Skip to content

Commit 75fd1de

Browse files
feat: support whittaker, cubic, and bernstein baseline algorithms (#4008)
* feat: support whittaker, cubic, and bernstein baseline algorithms - whittaker options: lambda, scale, maxIterations - cubic: no options - bernstein options: maxIterations, tolerance, factorStd, learningRate, minWeight close #3969 * refactor: baseline correction options * fix: pass 'degree' to bernstein baseline correction * refactor: props type of NumberInputFieldProps component * refactor: simple baseline correction options * refactor: methods options
1 parent 3eb317b commit 75fd1de

7 files changed

Lines changed: 680 additions & 166 deletions

File tree

src/component/elements/Label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface LabelStyle {
1414
wrapper?: CSSProperties;
1515
container?: CSSProperties;
1616
}
17-
interface LabelProps
17+
export interface LabelProps
1818
extends
1919
Omit<LabelHTMLAttributes<HTMLLabelElement>, 'style'>,
2020
Partial<ContainerQueryWrapperProps> {

src/component/elements/NumberInput2Controller.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Controller } from 'react-hook-form';
44
import type { NumberInput2Props } from './NumberInput2.js';
55
import { NumberInput2 } from './NumberInput2.js';
66

7-
interface NumberInput2ControllerProps<
7+
export interface NumberInput2ControllerProps<
88
TFieldValues extends FieldValues = FieldValues,
99
>
1010
extends
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { FieldValues } from 'react-hook-form';
2+
3+
import type { LabelProps } from './Label.tsx';
4+
import Label from './Label.tsx';
5+
import type { NumberInput2ControllerProps } from './NumberInput2Controller.tsx';
6+
import { NumberInput2Controller } from './NumberInput2Controller.tsx';
7+
8+
interface NumberInputFieldProps<
9+
T extends FieldValues,
10+
> extends NumberInput2ControllerProps<T> {
11+
labelProps: Omit<LabelProps, 'children'>;
12+
}
13+
14+
export function NumberInputField<T extends FieldValues>(
15+
props: NumberInputFieldProps<T>,
16+
) {
17+
const { labelProps, ...inputProps } = props;
18+
return (
19+
<Label {...labelProps}>
20+
<NumberInput2Controller {...inputProps} />
21+
</Label>
22+
);
23+
}

0 commit comments

Comments
 (0)