form-input-fields 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controls/FormSwitch/FormSwitch.d.ts +22 -4
- package/dist/controls/FormSwitch/FormSwitch.d.ts.map +1 -1
- package/dist/index.es.js +3482 -3459
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +69 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FieldProps } from 'formik';
|
|
3
|
+
import { SwitchProps } from '@mui/material/Switch';
|
|
1
4
|
export interface FormSwitchProps {
|
|
2
|
-
id: string;
|
|
3
|
-
checked: boolean;
|
|
4
5
|
/**
|
|
5
6
|
* Label text displayed next to the switch
|
|
6
7
|
*/
|
|
7
8
|
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Position of the label relative to the switch
|
|
11
|
+
* @default 'end'
|
|
12
|
+
*/
|
|
13
|
+
labelPlacement?: 'top' | 'start' | 'bottom' | 'end';
|
|
8
14
|
/**
|
|
9
15
|
* Color of the switch when checked
|
|
10
16
|
* @default 'primary'
|
|
11
17
|
*/
|
|
12
18
|
color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default';
|
|
19
|
+
/**
|
|
20
|
+
* Size of the switch
|
|
21
|
+
* @default 'medium'
|
|
22
|
+
*/
|
|
23
|
+
size?: 'small' | 'medium';
|
|
13
24
|
/**
|
|
14
25
|
* Whether the switch is disabled
|
|
15
26
|
* @default false
|
|
@@ -23,7 +34,14 @@ export interface FormSwitchProps {
|
|
|
23
34
|
/**
|
|
24
35
|
* Custom onChange handler with additional switch-related data
|
|
25
36
|
*/
|
|
26
|
-
onChange
|
|
37
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, context: {
|
|
38
|
+
fieldName: string;
|
|
39
|
+
formikValue: boolean;
|
|
40
|
+
}) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Custom onBlur handler
|
|
43
|
+
*/
|
|
44
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
27
45
|
/**
|
|
28
46
|
* Helper text to display below the switch
|
|
29
47
|
*/
|
|
@@ -37,6 +55,6 @@ export interface FormSwitchProps {
|
|
|
37
55
|
*/
|
|
38
56
|
className?: string;
|
|
39
57
|
}
|
|
40
|
-
export type FormSwitchComponentProps = FormSwitchProps;
|
|
58
|
+
export type FormSwitchComponentProps = FieldProps & SwitchProps & FormSwitchProps;
|
|
41
59
|
export declare const FormSwitch: (props: FormSwitchComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
60
|
//# sourceMappingURL=FormSwitch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSwitch.d.ts","sourceRoot":"","sources":["../../../src/controls/FormSwitch/FormSwitch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormSwitch.d.ts","sourceRoot":"","sources":["../../../src/controls/FormSwitch/FormSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAS,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAEpD;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAEvF;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CA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