@mittwald/flow-react-components 0.2.0-alpha.642 → 0.2.0-alpha.644
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/CHANGELOG.md +10 -0
- package/dist/assets/doc-properties.json +6112 -4124
- package/dist/css/all.css +1 -1
- package/dist/js/components/src/components/Action/Action.mjs +0 -1
- package/dist/js/components/src/components/Action/Action.mjs.map +1 -1
- package/dist/js/components/src/components/Action/models/ActionState.mjs +5 -1
- package/dist/js/components/src/components/Action/models/ActionState.mjs.map +1 -1
- package/dist/js/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/components/src/components/Heading/Heading.module.scss.mjs +3 -1
- package/dist/js/components/src/components/Heading/Heading.module.scss.mjs.map +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.module.scss.mjs +3 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.module.scss.mjs.map +1 -1
- package/dist/js/components/src/components/propTypes/index.mjs +0 -2
- package/dist/js/components/src/components/propTypes/index.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -15
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs +19 -36
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/useHotkeySubmit.mjs +19 -0
- package/dist/js/components/src/integrations/react-hook-form/components/Form/useHotkeySubmit.mjs.map +1 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.mjs +42 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.mjs.map +1 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs +37 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs.map +1 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.mjs +17 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.mjs.map +1 -0
- package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs +16 -34
- package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs +19 -56
- package/dist/js/components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs.map +1 -1
- package/dist/js/react-hook-form.mjs +1 -1
- package/dist/types/components/Action/Action.d.ts.map +1 -1
- package/dist/types/components/Action/models/ActionState.d.ts +1 -0
- package/dist/types/components/Action/models/ActionState.d.ts.map +1 -1
- package/dist/types/components/Button/stories/lib.d.ts +3 -0
- package/dist/types/components/Button/stories/lib.d.ts.map +1 -1
- package/dist/types/components/Heading/Heading.d.ts +1 -1
- package/dist/types/components/Heading/Heading.d.ts.map +1 -1
- package/dist/types/components/Heading/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/Heading/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts +1 -1
- package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -1
- package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/List/typedList.d.ts +1 -1
- package/dist/types/components/propTypes/index.d.ts +0 -4
- package/dist/types/components/propTypes/index.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/stories/Form.stories.d.ts +4 -0
- package/dist/types/integrations/react-hook-form/components/Form/stories/Form.stories.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/useHotkeySubmit.d.ts +8 -0
- package/dist/types/integrations/react-hook-form/components/Form/useHotkeySubmit.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.d.ts +21 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/index.d.ts +3 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/index.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.d.ts +9 -0
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.d.ts +4 -0
- package/dist/types/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormSubmitAction/index.d.ts +2 -0
- package/dist/types/integrations/react-hook-form/components/FormSubmitAction/index.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts +1 -6
- package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/ResetButton/index.d.ts +1 -1
- package/dist/types/integrations/react-hook-form/components/ResetButton/index.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/SubmitButton/SubmitButton.d.ts +1 -6
- package/dist/types/integrations/react-hook-form/components/SubmitButton/SubmitButton.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/SubmitButton/index.d.ts +1 -1
- package/dist/types/integrations/react-hook-form/components/SubmitButton/index.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs +0 -77
- package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs.map +0 -1
- package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs +0 -19
- package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs.map +0 -1
- package/dist/types/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.d.ts +0 -7
- package/dist/types/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.d.ts.map +0 -1
- package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts +0 -19
- package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts.map +0 -1
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import { ActionModel } from '../../../../../components/Action/models/ActionModel.mjs';
|
|
4
|
-
import { useRef, useEffect } from 'react';
|
|
5
|
-
import { isPromise } from 'remeda';
|
|
6
|
-
|
|
7
|
-
const callAfterSubmitFunction = (result) => {
|
|
8
|
-
const callFn = (something) => {
|
|
9
|
-
if (typeof something === "function") {
|
|
10
|
-
something();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
if (result instanceof Promise) {
|
|
14
|
-
result.then(callFn);
|
|
15
|
-
} else {
|
|
16
|
-
callFn(result);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const useRegisterActionStateContext = (form) => {
|
|
20
|
-
const action = ActionModel.useNew({});
|
|
21
|
-
const trackedSubmitCount = useRef(0);
|
|
22
|
-
const submitHandlerResultRef = useRef(null);
|
|
23
|
-
const currentActionState = action.state.useValue();
|
|
24
|
-
const lastActionState = useRef(currentActionState);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (currentActionState === "isIdle" && lastActionState.current === "isSucceeded") {
|
|
27
|
-
callAfterSubmitFunction(submitHandlerResultRef.current);
|
|
28
|
-
}
|
|
29
|
-
lastActionState.current = currentActionState;
|
|
30
|
-
}, [currentActionState]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return form.subscribe({
|
|
33
|
-
formState: {
|
|
34
|
-
errors: true
|
|
35
|
-
},
|
|
36
|
-
callback: ({
|
|
37
|
-
isSubmitted = false,
|
|
38
|
-
isSubmitSuccessful = false,
|
|
39
|
-
submitCount = 0,
|
|
40
|
-
errors
|
|
41
|
-
}) => {
|
|
42
|
-
if (submitCount === 0 && trackedSubmitCount.current > 0) {
|
|
43
|
-
trackedSubmitCount.current = 0;
|
|
44
|
-
}
|
|
45
|
-
if (trackedSubmitCount.current === submitCount) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
trackedSubmitCount.current = submitCount;
|
|
49
|
-
if (isSubmitted) {
|
|
50
|
-
if (isSubmitSuccessful) {
|
|
51
|
-
void action.state.onSucceeded();
|
|
52
|
-
} else {
|
|
53
|
-
const hasFailedWithError = isSubmitted && errors && Object.entries(errors).length > 0 ? errors : void 0;
|
|
54
|
-
void action.state.onFailed(hasFailedWithError);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}, [form.subscribe]);
|
|
60
|
-
const registerSubmitResult = (result) => {
|
|
61
|
-
if (isPromise(result)) {
|
|
62
|
-
void action.state.onAsyncStart();
|
|
63
|
-
result.then((submitResult) => {
|
|
64
|
-
submitHandlerResultRef.current = submitResult;
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
submitHandlerResultRef.current = result;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return {
|
|
71
|
-
action,
|
|
72
|
-
registerSubmitResult
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export { useRegisterActionStateContext };
|
|
77
|
-
//# sourceMappingURL=useRegisterActionStateContext.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterActionStateContext.mjs","sources":["../../../../../../../../../src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.ts"],"sourcesContent":["import { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { useEffect, useRef } from \"react\";\nimport { isPromise } from \"remeda\";\nimport type { FieldValues, UseFormReturn } from \"react-hook-form\";\n\nconst callAfterSubmitFunction = (result: unknown) => {\n const callFn = (something: unknown) => {\n if (typeof something === \"function\") {\n something();\n }\n };\n\n if (result instanceof Promise) {\n result.then(callFn);\n } else {\n callFn(result);\n }\n};\n\nexport const useRegisterActionStateContext = <T extends FieldValues>(\n form: UseFormReturn<T>,\n) => {\n const action = ActionModel.useNew({});\n const trackedSubmitCount = useRef(0);\n const submitHandlerResultRef = useRef<unknown>(null);\n\n const currentActionState = action.state.useValue();\n const lastActionState = useRef<string>(currentActionState);\n\n useEffect(() => {\n if (\n currentActionState === \"isIdle\" &&\n lastActionState.current === \"isSucceeded\"\n ) {\n callAfterSubmitFunction(submitHandlerResultRef.current);\n }\n lastActionState.current = currentActionState;\n }, [currentActionState]);\n\n useEffect(() => {\n return form.subscribe({\n formState: {\n errors: true,\n },\n callback: ({\n isSubmitted = false,\n isSubmitSuccessful = false,\n submitCount = 0,\n errors,\n }) => {\n if (submitCount === 0 && trackedSubmitCount.current > 0) {\n trackedSubmitCount.current = 0;\n }\n\n if (trackedSubmitCount.current === submitCount) {\n return;\n }\n trackedSubmitCount.current = submitCount;\n\n if (isSubmitted) {\n if (isSubmitSuccessful) {\n void action.state.onSucceeded();\n } else {\n const hasFailedWithError =\n isSubmitted && errors && Object.entries(errors).length > 0\n ? errors\n : undefined;\n\n void action.state.onFailed(hasFailedWithError);\n }\n }\n },\n });\n }, [form.subscribe]);\n\n const registerSubmitResult = (result: unknown) => {\n if (isPromise(result)) {\n void action.state.onAsyncStart();\n result.then((submitResult) => {\n submitHandlerResultRef.current = submitResult;\n });\n } else {\n submitHandlerResultRef.current = result;\n }\n };\n\n return {\n action,\n registerSubmitResult,\n } as const;\n};\n"],"names":[],"mappings":"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"}
|
package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import { createContext, useContext } from 'react';
|
|
4
|
-
import invariant from 'invariant';
|
|
5
|
-
|
|
6
|
-
const formContext = createContext(void 0);
|
|
7
|
-
const FormContextProvider = formContext.Provider;
|
|
8
|
-
const useFormContext = () => {
|
|
9
|
-
const ctx = useContext(formContext);
|
|
10
|
-
invariant(
|
|
11
|
-
!!ctx,
|
|
12
|
-
"Could not useFormContext() outside a Form, or multiple versions of Flow installed."
|
|
13
|
-
);
|
|
14
|
-
return ctx;
|
|
15
|
-
};
|
|
16
|
-
const useOptionalFormContext = () => useContext(formContext);
|
|
17
|
-
|
|
18
|
-
export { FormContextProvider, formContext, useFormContext, useOptionalFormContext };
|
|
19
|
-
//# sourceMappingURL=formContext.mjs.map
|
package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formContext.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"sourcesContent":["import type { FieldValues, UseFormReturn } from \"react-hook-form\";\nimport {\n createContext,\n useContext,\n type Dispatch,\n type FormEvent,\n type RefObject,\n type SetStateAction,\n} from \"react\";\nimport invariant from \"invariant\";\nimport type { ActionModel } from \"@/components/Action/models/ActionModel\";\n\ninterface FormContext<F extends FieldValues> {\n form: UseFormReturn<F>;\n id: string;\n isReadOnly: boolean;\n setReadOnly: Dispatch<SetStateAction<boolean>>;\n submitButtonRef: RefObject<HTMLButtonElement | null>;\n submit: (e?: FormEvent<HTMLFormElement> | F) => void;\n formActionModel: ActionModel;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFormContext = FormContext<any>;\n\nexport const formContext = createContext<AnyFormContext | undefined>(undefined);\n\nexport const FormContextProvider = formContext.Provider;\n\nexport const useFormContext = <F extends FieldValues>(): FormContext<F> => {\n const ctx = useContext(formContext);\n invariant(\n !!ctx,\n \"Could not useFormContext() outside a Form, or multiple versions of Flow installed.\",\n );\n return ctx;\n};\n\nexport const useOptionalFormContext = <F extends FieldValues>() =>\n useContext(formContext) as FormContext<F> | undefined;\n"],"names":[],"mappings":";;;AAyBO,MAAM,WAAA,GAAc,cAA0C,MAAS;AAEvE,MAAM,sBAAsB,WAAA,CAAY;AAExC,MAAM,iBAAiB,MAA6C;AACzE,EAAA,MAAM,GAAA,GAAM,WAAW,WAAW,CAAA;AAClC,EAAA,SAAA;AAAA,IACE,CAAC,CAAC,GAAA;AAAA,IACF;AAAA,GACF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,MAAM,sBAAA,GAAyB,MACpC,UAAA,CAAW,WAAW;;;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionModel } from '../../../../../components/Action/models/ActionModel';
|
|
2
|
-
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
export declare const useRegisterActionStateContext: <T extends FieldValues>(form: UseFormReturn<T>) => {
|
|
4
|
-
readonly action: ActionModel;
|
|
5
|
-
readonly registerSubmitResult: (result: unknown) => void;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=useRegisterActionStateContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterActionStateContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgBlE,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,WAAW,EACjE,MAAM,aAAa,CAAC,CAAC,CAAC;;4CAuDgB,OAAO;CAe9C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import { Dispatch, FormEvent, RefObject, SetStateAction } from 'react';
|
|
3
|
-
import { ActionModel } from '../../../../components/Action/models/ActionModel';
|
|
4
|
-
interface FormContext<F extends FieldValues> {
|
|
5
|
-
form: UseFormReturn<F>;
|
|
6
|
-
id: string;
|
|
7
|
-
isReadOnly: boolean;
|
|
8
|
-
setReadOnly: Dispatch<SetStateAction<boolean>>;
|
|
9
|
-
submitButtonRef: RefObject<HTMLButtonElement | null>;
|
|
10
|
-
submit: (e?: FormEvent<HTMLFormElement> | F) => void;
|
|
11
|
-
formActionModel: ActionModel;
|
|
12
|
-
}
|
|
13
|
-
type AnyFormContext = FormContext<any>;
|
|
14
|
-
export declare const formContext: import('react').Context<AnyFormContext | undefined>;
|
|
15
|
-
export declare const FormContextProvider: import('react').Provider<AnyFormContext | undefined>;
|
|
16
|
-
export declare const useFormContext: <F extends FieldValues>() => FormContext<F>;
|
|
17
|
-
export declare const useOptionalFormContext: <F extends FieldValues>() => FormContext<F> | undefined;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=formContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formContext.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,UAAU,WAAW,CAAC,CAAC,SAAS,WAAW;IACzC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,eAAe,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACrD,eAAe,EAAE,WAAW,CAAC;CAC9B;AAGD,KAAK,cAAc,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,qDAAuD,CAAC;AAEhF,eAAO,MAAM,mBAAmB,sDAAuB,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,OAAK,WAAW,CAAC,CAAC,CAOrE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,WAAW,OAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC"}
|