@bigbinary/neeto-atoms 1.0.95 → 1.0.96
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.
|
@@ -39,13 +39,14 @@ const FormikButton = React.forwardRef(
|
|
|
39
39
|
({ disabled, ...otherProps }, ref) => {
|
|
40
40
|
const { handleSubmit, isSubmitting, values, initialValues, isValid } = formik.useFormikContext();
|
|
41
41
|
const isDisabled = disabled ?? (isSubmitting || ramda.equals(values, initialValues));
|
|
42
|
+
const handleClick = (event) => handleSubmit(event);
|
|
42
43
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
44
|
Button.Button,
|
|
44
45
|
{
|
|
45
46
|
ref,
|
|
46
47
|
disabled: isDisabled,
|
|
47
48
|
loading: isSubmitting && isValid,
|
|
48
|
-
onClick:
|
|
49
|
+
onClick: handleClick,
|
|
49
50
|
...otherProps
|
|
50
51
|
}
|
|
51
52
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/formik/Button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { equals } from \"ramda\";\n\nimport { Button, ButtonProps } from \"src/components/Button\";\n\nexport interface FormikButtonProps extends ButtonProps {\n /** Override the auto-computed disabled state. */\n disabled?: boolean;\n}\n\nconst FormikButton = forwardRef<HTMLButtonElement, FormikButtonProps>(\n ({ disabled, ...otherProps }, ref) => {\n const { handleSubmit, isSubmitting, values, initialValues, isValid } =\n useFormikContext();\n\n const isDisabled =\n disabled ?? (isSubmitting || equals(values, initialValues));\n\n return (\n <Button\n ref={ref}\n disabled={isDisabled}\n loading={isSubmitting && isValid}\n onClick={
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/formik/Button.tsx"],"sourcesContent":["import { forwardRef, type FormEvent, type MouseEvent } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { equals } from \"ramda\";\n\nimport { Button, ButtonProps } from \"src/components/Button\";\n\nexport interface FormikButtonProps extends ButtonProps {\n /** Override the auto-computed disabled state. */\n disabled?: boolean;\n}\n\nconst FormikButton = forwardRef<HTMLButtonElement, FormikButtonProps>(\n ({ disabled, ...otherProps }, ref) => {\n const { handleSubmit, isSubmitting, values, initialValues, isValid } =\n useFormikContext();\n\n const isDisabled =\n disabled ?? (isSubmitting || equals(values, initialValues));\n\n // Formik's handleSubmit calls preventDefault on the event it receives, which\n // cancels the native form submission of a type=\"submit\" button. Dropping the\n // event lets that native submit run alongside this one, submitting twice.\n const handleClick = (\n event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => handleSubmit(event as unknown as FormEvent<HTMLFormElement>);\n\n return (\n <Button\n ref={ref}\n disabled={isDisabled}\n loading={isSubmitting && isValid}\n onClick={handleClick}\n {...otherProps}\n />\n );\n }\n);\n\nFormikButton.displayName = \"FormikButton\";\n\nexport { FormikButton };\n"],"names":["forwardRef","useFormikContext","equals","jsx","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAA,GAAeA,gBAAA;AAAA,EACnB,CAAC,EAAE,QAAA,EAAU,GAAG,UAAA,IAAc,GAAA,KAAQ;AACpC,IAAA,MAAM,EAAE,YAAA,EAAc,YAAA,EAAc,QAAQ,aAAA,EAAe,OAAA,KACzDC,uBAAA,EAAiB;AAEnB,IAAA,MAAM,UAAA,GACJ,QAAA,KAAa,YAAA,IAAgBC,YAAA,CAAO,QAAQ,aAAa,CAAA,CAAA;AAK3D,IAAA,MAAM,WAAA,GAAc,CAClB,KAAA,KACG,YAAA,CAAa,KAA8C,CAAA;AAEhE,IAAA,uBACEC,cAAA;AAAA,MAACC,aAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,QAAA,EAAU,UAAA;AAAA,QACV,SAAS,YAAA,IAAgB,OAAA;AAAA,QACzB,OAAA,EAAS,WAAA;AAAA,QACR,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,YAAA,CAAa,WAAA,GAAc,cAAA;;;;"}
|
package/dist/formik/Button.js
CHANGED
|
@@ -37,13 +37,14 @@ const FormikButton = forwardRef(
|
|
|
37
37
|
({ disabled, ...otherProps }, ref) => {
|
|
38
38
|
const { handleSubmit, isSubmitting, values, initialValues, isValid } = useFormikContext();
|
|
39
39
|
const isDisabled = disabled ?? (isSubmitting || equals(values, initialValues));
|
|
40
|
+
const handleClick = (event) => handleSubmit(event);
|
|
40
41
|
return /* @__PURE__ */ jsx(
|
|
41
42
|
Button,
|
|
42
43
|
{
|
|
43
44
|
ref,
|
|
44
45
|
disabled: isDisabled,
|
|
45
46
|
loading: isSubmitting && isValid,
|
|
46
|
-
onClick:
|
|
47
|
+
onClick: handleClick,
|
|
47
48
|
...otherProps
|
|
48
49
|
}
|
|
49
50
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/formik/Button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { equals } from \"ramda\";\n\nimport { Button, ButtonProps } from \"src/components/Button\";\n\nexport interface FormikButtonProps extends ButtonProps {\n /** Override the auto-computed disabled state. */\n disabled?: boolean;\n}\n\nconst FormikButton = forwardRef<HTMLButtonElement, FormikButtonProps>(\n ({ disabled, ...otherProps }, ref) => {\n const { handleSubmit, isSubmitting, values, initialValues, isValid } =\n useFormikContext();\n\n const isDisabled =\n disabled ?? (isSubmitting || equals(values, initialValues));\n\n return (\n <Button\n ref={ref}\n disabled={isDisabled}\n loading={isSubmitting && isValid}\n onClick={
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/formik/Button.tsx"],"sourcesContent":["import { forwardRef, type FormEvent, type MouseEvent } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { equals } from \"ramda\";\n\nimport { Button, ButtonProps } from \"src/components/Button\";\n\nexport interface FormikButtonProps extends ButtonProps {\n /** Override the auto-computed disabled state. */\n disabled?: boolean;\n}\n\nconst FormikButton = forwardRef<HTMLButtonElement, FormikButtonProps>(\n ({ disabled, ...otherProps }, ref) => {\n const { handleSubmit, isSubmitting, values, initialValues, isValid } =\n useFormikContext();\n\n const isDisabled =\n disabled ?? (isSubmitting || equals(values, initialValues));\n\n // Formik's handleSubmit calls preventDefault on the event it receives, which\n // cancels the native form submission of a type=\"submit\" button. Dropping the\n // event lets that native submit run alongside this one, submitting twice.\n const handleClick = (\n event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => handleSubmit(event as unknown as FormEvent<HTMLFormElement>);\n\n return (\n <Button\n ref={ref}\n disabled={isDisabled}\n loading={isSubmitting && isValid}\n onClick={handleClick}\n {...otherProps}\n />\n );\n }\n);\n\nFormikButton.displayName = \"FormikButton\";\n\nexport { FormikButton };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAA,GAAe,UAAA;AAAA,EACnB,CAAC,EAAE,QAAA,EAAU,GAAG,UAAA,IAAc,GAAA,KAAQ;AACpC,IAAA,MAAM,EAAE,YAAA,EAAc,YAAA,EAAc,QAAQ,aAAA,EAAe,OAAA,KACzD,gBAAA,EAAiB;AAEnB,IAAA,MAAM,UAAA,GACJ,QAAA,KAAa,YAAA,IAAgB,MAAA,CAAO,QAAQ,aAAa,CAAA,CAAA;AAK3D,IAAA,MAAM,WAAA,GAAc,CAClB,KAAA,KACG,YAAA,CAAa,KAA8C,CAAA;AAEhE,IAAA,uBACE,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,QAAA,EAAU,UAAA;AAAA,QACV,SAAS,YAAA,IAAgB,OAAA;AAAA,QACzB,OAAA,EAAS,WAAA;AAAA,QACR,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,YAAA,CAAa,WAAA,GAAc,cAAA;;;;"}
|