@mittwald/flow-react-components 0.2.0-alpha.665 → 0.2.0-alpha.666
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
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.666](https://github.com/mittwald/flow/compare/0.2.0-alpha.665...0.2.0-alpha.666) (2026-02-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **Form:** fix missing submit event ([#2303](https://github.com/mittwald/flow/issues/2303)) ([a4f7048](https://github.com/mittwald/flow/commit/a4f704886f88538602a19cfd1254c5e2ed0dab08))
|
|
11
|
+
|
|
6
12
|
# [0.2.0-alpha.665](https://github.com/mittwald/flow/compare/0.2.0-alpha.664...0.2.0-alpha.665) (2026-02-06)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -299684,34 +299684,6 @@
|
|
|
299684
299684
|
}
|
|
299685
299685
|
}
|
|
299686
299686
|
},
|
|
299687
|
-
{
|
|
299688
|
-
"tags": {},
|
|
299689
|
-
"filePath": "src/components/Popover/components/PopoverTip/PopoverTip.tsx",
|
|
299690
|
-
"description": "",
|
|
299691
|
-
"displayName": "PopoverTip",
|
|
299692
|
-
"methods": [],
|
|
299693
|
-
"props": {
|
|
299694
|
-
"className": {
|
|
299695
|
-
"defaultValue": null,
|
|
299696
|
-
"description": "The elements class name.",
|
|
299697
|
-
"name": "className",
|
|
299698
|
-
"parent": {
|
|
299699
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
299700
|
-
"name": "PropsWithClassName"
|
|
299701
|
-
},
|
|
299702
|
-
"declarations": [
|
|
299703
|
-
{
|
|
299704
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
299705
|
-
"name": "PropsWithClassName"
|
|
299706
|
-
}
|
|
299707
|
-
],
|
|
299708
|
-
"required": false,
|
|
299709
|
-
"type": {
|
|
299710
|
-
"name": "string"
|
|
299711
|
-
}
|
|
299712
|
-
}
|
|
299713
|
-
}
|
|
299714
|
-
},
|
|
299715
299687
|
{
|
|
299716
299688
|
"tags": {
|
|
299717
299689
|
"flr-generate": "all"
|
|
@@ -299890,6 +299862,34 @@
|
|
|
299890
299862
|
}
|
|
299891
299863
|
}
|
|
299892
299864
|
},
|
|
299865
|
+
{
|
|
299866
|
+
"tags": {},
|
|
299867
|
+
"filePath": "src/components/Popover/components/PopoverTip/PopoverTip.tsx",
|
|
299868
|
+
"description": "",
|
|
299869
|
+
"displayName": "PopoverTip",
|
|
299870
|
+
"methods": [],
|
|
299871
|
+
"props": {
|
|
299872
|
+
"className": {
|
|
299873
|
+
"defaultValue": null,
|
|
299874
|
+
"description": "The elements class name.",
|
|
299875
|
+
"name": "className",
|
|
299876
|
+
"parent": {
|
|
299877
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
299878
|
+
"name": "PropsWithClassName"
|
|
299879
|
+
},
|
|
299880
|
+
"declarations": [
|
|
299881
|
+
{
|
|
299882
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
299883
|
+
"name": "PropsWithClassName"
|
|
299884
|
+
}
|
|
299885
|
+
],
|
|
299886
|
+
"required": false,
|
|
299887
|
+
"type": {
|
|
299888
|
+
"name": "string"
|
|
299889
|
+
}
|
|
299890
|
+
}
|
|
299891
|
+
}
|
|
299892
|
+
},
|
|
299893
299893
|
{
|
|
299894
299894
|
"tags": {
|
|
299895
299895
|
"internal": ""
|
|
@@ -30,8 +30,8 @@ function Form(props) {
|
|
|
30
30
|
const handleSubmit = (e) => {
|
|
31
31
|
const formEvent = e && "nativeEvent" in e ? e : void 0;
|
|
32
32
|
formEvent?.stopPropagation();
|
|
33
|
-
return form.handleSubmit((
|
|
34
|
-
const submitResult = onSubmit(
|
|
33
|
+
return form.handleSubmit((values, event) => {
|
|
34
|
+
const submitResult = onSubmit(values, event);
|
|
35
35
|
if (submitResult instanceof Promise) {
|
|
36
36
|
return submitResult.then(handleSubmitResult);
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/useHotkeySubmit\";\nimport { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n type ComponentProps,\n type FC,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n type Ref,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\nexport type AfterFormSubmitCallback = (...unknownArgs: unknown[]) => unknown;\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">, PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n isReadOnly?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n const afterSubmitCallback = useRef<AfterFormSubmitCallback>(undefined);\n\n const handleSubmitResult = (result: unknown) => {\n if (typeof result === \"function\") {\n afterSubmitCallback.current = result as AfterFormSubmitCallback;\n }\n };\n\n const handleSubmit = (e?: FormEvent | F) => {\n const formEvent = e && \"nativeEvent\" in e ? (e as FormEvent) : undefined;\n formEvent?.stopPropagation();\n return form.handleSubmit((
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/useHotkeySubmit\";\nimport { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n type ComponentProps,\n type FC,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n type Ref,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\nexport type AfterFormSubmitCallback = (...unknownArgs: unknown[]) => unknown;\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">, PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n isReadOnly?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n const afterSubmitCallback = useRef<AfterFormSubmitCallback>(undefined);\n\n const handleSubmitResult = (result: unknown) => {\n if (typeof result === \"function\") {\n afterSubmitCallback.current = result as AfterFormSubmitCallback;\n }\n };\n\n const handleSubmit = (e?: FormEvent | F) => {\n const formEvent = e && \"nativeEvent\" in e ? (e as FormEvent) : undefined;\n formEvent?.stopPropagation();\n return form.handleSubmit((values, event) => {\n const submitResult = onSubmit(values, event);\n if (submitResult instanceof Promise) {\n return submitResult.then(handleSubmitResult);\n }\n handleSubmitResult(submitResult);\n })(formEvent);\n };\n\n const onAfterSuccessFeedback = () => {\n afterSubmitCallback.current?.();\n };\n\n const refWithHotkeySubmit = useHotkeySubmit({\n ref,\n handleSubmit,\n });\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n form={form as UseFormReturn}\n isReadOnly={isReadOnly}\n id={formId}\n onAfterSuccessFeedback={onAfterSuccessFeedback}\n >\n <FormComponent\n {...formProps}\n ref={refWithHotkeySubmit}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\n </FormComponent>\n </FormContextProvider>\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"names":["RhfFormContextProvider"],"mappings":";;;;;;AAwCA,MAAM,uBAA0C,CAAC,CAAA,qBAAM,GAAA,CAAC,MAAA,EAAA,EAAM,GAAG,CAAA,EAAG,CAAA;AAE7D,SAAS,KAA4B,KAAA,EAAqB;AAC/D,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,aAAA,GAAgB,oBAAA;AAAA,IAChB,UAAA;AAAA,IACA,GAAA;AAAA,IACA,EAAA,EAAI,MAAA;AAAA,IACJ,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,YAAY,KAAA,EAAM;AACxB,EAAA,MAAM,SAAS,MAAA,IAAU,SAAA;AACzB,EAAA,MAAM,gBAAgB,OAAA,CAAQ,MAAM,aAAA,EAAe,CAAC,MAAM,CAAC,CAAA;AAC3D,EAAA,MAAM,mBAAA,GAAsB,OAA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A,EAAU,YAAA;AAAA,UAET;AAAA;AAAA;AACH;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.666",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.666",
|
|
62
62
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
63
63
|
"@react-aria/form": "^3.1.3",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@faker-js/faker": "^10.2.0",
|
|
104
104
|
"@internationalized/date": "^3.10.1",
|
|
105
105
|
"@mittwald/flow-core": "",
|
|
106
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
106
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.666",
|
|
107
107
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
108
108
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
109
109
|
"@mittwald/typescript-config": "",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"optional": true
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "de98191434e751583123d4223569dc09d5fbfd87"
|
|
175
175
|
}
|