@bigbinary/neeto-atoms 1.0.20 → 1.0.21
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.
|
@@ -33,7 +33,7 @@ require('react-i18next');
|
|
|
33
33
|
require('../loader-circle-Bw7zP2Gn.js');
|
|
34
34
|
|
|
35
35
|
const FormikSelect = React.forwardRef((props, ref) => {
|
|
36
|
-
const { name, onOpenChange, onChange:
|
|
36
|
+
const { name, onOpenChange, onChange: onChangeProp, ...otherProps } = props;
|
|
37
37
|
const [field, meta, { setValue, setTouched }] = formik.useField(name);
|
|
38
38
|
const { status = {}, setStatus } = formik.useFormikContext();
|
|
39
39
|
const fieldStatus = formik.getIn(status, name);
|
|
@@ -45,12 +45,13 @@ const FormikSelect = React.forwardRef((props, ref) => {
|
|
|
45
45
|
value: field.value,
|
|
46
46
|
onOpenChange: (open) => {
|
|
47
47
|
if (!open)
|
|
48
|
-
setTouched(true);
|
|
48
|
+
setTouched(true, false);
|
|
49
49
|
onOpenChange?.(open);
|
|
50
50
|
},
|
|
51
51
|
onChange: (value) => {
|
|
52
52
|
setStatus(ramda.dissoc(name, status));
|
|
53
53
|
setValue(value);
|
|
54
|
+
onChangeProp?.(value);
|
|
54
55
|
},
|
|
55
56
|
};
|
|
56
57
|
return jsxRuntime.jsx(Select.Select, { ...selectProps });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange:
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange: onChangeProp, ...otherProps } = props;\n const [field, meta, { setValue, setTouched }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n const selectProps = {\n ...otherProps,\n ref,\n error: meta.touched ? meta.error || fieldStatus : \"\",\n name: field.name,\n value: field.value,\n onOpenChange: (open: boolean) => {\n if (!open) setTouched(true, false);\n onOpenChange?.(open);\n },\n onChange: (value: unknown) => {\n setStatus(dissoc(name, status));\n setValue(value);\n (onChangeProp as ((v: unknown) => void) | undefined)?.(value);\n },\n };\n\n return <Select {...(selectProps as SelectProps)} />;\n }\n);\n\nFormikSelect.displayName = \"FormikSelect\";\n\nexport { FormikSelect };\n"],"names":["forwardRef","useField","useFormikContext","getIn","dissoc","_jsx","Select"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAY,GAAGA,gBAAU,CAC7B,CAAC,KAAK,EAAE,GAAG,KAAI;AACb,IAAA,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK;AAC3E,IAAA,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAGC,eAAQ,CAAC,IAAI,CAAC;IAC9D,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,EAAE,GAAGC,uBAAgB,EAAE;IACrD,MAAM,WAAW,GAAGC,YAAK,CAAC,MAAM,EAAE,IAAI,CAAC;AAEvC,IAAA,MAAM,WAAW,GAAG;AAClB,QAAA,GAAG,UAAU;QACb,GAAG;AACH,QAAA,KAAK,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,WAAW,GAAG,EAAE;QACpD,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;AAClB,QAAA,YAAY,EAAE,CAAC,IAAa,KAAI;AAC9B,YAAA,IAAI,CAAC,IAAI;AAAE,gBAAA,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC;AAClC,YAAA,YAAY,GAAG,IAAI,CAAC;QACtB,CAAC;AACD,QAAA,QAAQ,EAAE,CAAC,KAAc,KAAI;YAC3B,SAAS,CAACC,YAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC/B,QAAQ,CAAC,KAAK,CAAC;AACd,YAAA,YAAmD,GAAG,KAAK,CAAC;QAC/D,CAAC;KACF;AAED,IAAA,OAAOC,cAAA,CAACC,aAAM,EAAA,EAAA,GAAM,WAA2B,GAAI;AACrD,CAAC;AAGH,YAAY,CAAC,WAAW,GAAG,cAAc;;;;"}
|
package/dist/formik/Select.js
CHANGED
|
@@ -31,7 +31,7 @@ import 'react-i18next';
|
|
|
31
31
|
import '../loader-circle-DycHUAWN.js';
|
|
32
32
|
|
|
33
33
|
const FormikSelect = forwardRef((props, ref) => {
|
|
34
|
-
const { name, onOpenChange, onChange:
|
|
34
|
+
const { name, onOpenChange, onChange: onChangeProp, ...otherProps } = props;
|
|
35
35
|
const [field, meta, { setValue, setTouched }] = useField(name);
|
|
36
36
|
const { status = {}, setStatus } = useFormikContext();
|
|
37
37
|
const fieldStatus = getIn(status, name);
|
|
@@ -43,12 +43,13 @@ const FormikSelect = forwardRef((props, ref) => {
|
|
|
43
43
|
value: field.value,
|
|
44
44
|
onOpenChange: (open) => {
|
|
45
45
|
if (!open)
|
|
46
|
-
setTouched(true);
|
|
46
|
+
setTouched(true, false);
|
|
47
47
|
onOpenChange?.(open);
|
|
48
48
|
},
|
|
49
49
|
onChange: (value) => {
|
|
50
50
|
setStatus(dissoc(name, status));
|
|
51
51
|
setValue(value);
|
|
52
|
+
onChangeProp?.(value);
|
|
52
53
|
},
|
|
53
54
|
};
|
|
54
55
|
return jsx(Select, { ...selectProps });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange:
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange: onChangeProp, ...otherProps } = props;\n const [field, meta, { setValue, setTouched }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n const selectProps = {\n ...otherProps,\n ref,\n error: meta.touched ? meta.error || fieldStatus : \"\",\n name: field.name,\n value: field.value,\n onOpenChange: (open: boolean) => {\n if (!open) setTouched(true, false);\n onOpenChange?.(open);\n },\n onChange: (value: unknown) => {\n setStatus(dissoc(name, status));\n setValue(value);\n (onChangeProp as ((v: unknown) => void) | undefined)?.(value);\n },\n };\n\n return <Select {...(selectProps as SelectProps)} />;\n }\n);\n\nFormikSelect.displayName = \"FormikSelect\";\n\nexport { FormikSelect };\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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