@tsed/react-formio 3.0.0-alpha.10 → 3.0.0-alpha.12
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/atoms/icon/Icon.js.map +1 -1
- package/dist/chunks/index.js +33 -30
- package/dist/chunks/index.js.map +1 -1
- package/dist/chunks/index.module.js +16 -16
- package/dist/chunks/index.module.js.map +1 -1
- package/dist/chunks/react-select-animated.esm.js +1204 -1101
- package/dist/chunks/react-select-animated.esm.js.map +1 -1
- package/dist/hooks/keyboard.constants.d.ts +38 -0
- package/dist/hooks/keyboard.constants.js +7 -0
- package/dist/hooks/keyboard.constants.js.map +1 -0
- package/dist/hooks/useKeyboardControls.d.ts +12 -0
- package/dist/hooks/useKeyboardControls.js +35 -0
- package/dist/hooks/useKeyboardControls.js.map +1 -0
- package/dist/hooks/useTooltip.js.map +1 -1
- package/dist/interfaces/Operation.d.ts +12 -2
- package/dist/molecules/alert/Alert.js.map +1 -1
- package/dist/molecules/button/Button.d.ts +18 -5
- package/dist/molecules/button/Button.js +22 -26
- package/dist/molecules/button/Button.js.map +1 -1
- package/dist/molecules/card/Card.js +7 -5
- package/dist/molecules/card/Card.js.map +1 -1
- package/dist/molecules/forms/form-control/FormControl.js.map +1 -1
- package/dist/molecules/forms/input-tags/InputTags.js +14 -14
- package/dist/molecules/forms/input-tags/InputTags.js.map +1 -1
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js +26 -26
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -1
- package/dist/molecules/forms/input-tags/components/ReactTags.js +289 -300
- package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -1
- package/dist/molecules/forms/input-text/InputText.js +3 -3
- package/dist/molecules/forms/input-text/InputText.js.map +1 -1
- package/dist/molecules/forms/select/Select.js.map +1 -1
- package/dist/molecules/forms/select/components/ChoicesSelect.js +71 -73
- package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/ReactSelect.js +13 -14
- package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/choices.template.js +2340 -2257
- package/dist/molecules/forms/select/components/choices.template.js.map +1 -1
- package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -1
- package/dist/molecules/loader/Loader.js.map +1 -1
- package/dist/molecules/modal/Modal.js +23 -24
- package/dist/molecules/modal/Modal.js.map +1 -1
- package/dist/molecules/pagination/Pagination.js +19 -19
- package/dist/molecules/pagination/Pagination.js.map +1 -1
- package/dist/molecules/pagination/PaginationButton.js.map +1 -1
- package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -1
- package/dist/molecules/table/Table.d.ts +11 -3
- package/dist/molecules/table/Table.js +31 -32
- package/dist/molecules/table/Table.js.map +1 -1
- package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -1
- package/dist/molecules/table/components/DefaultCell.js.map +1 -1
- package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -1
- package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -1
- package/dist/molecules/table/components/DefaultCellOperations.d.ts +12 -4
- package/dist/molecules/table/components/DefaultCellOperations.js +13 -7
- package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -1
- package/dist/molecules/table/components/DefaultFilter.js.map +1 -1
- package/dist/molecules/table/components/DefaultOperationButton.d.ts +12 -4
- package/dist/molecules/table/components/DefaultOperationButton.js +1 -1
- package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -1
- package/dist/molecules/table/filters/RangeFilter.js +23 -24
- package/dist/molecules/table/filters/RangeFilter.js.map +1 -1
- package/dist/molecules/table/filters/SelectFilter.js +11 -13
- package/dist/molecules/table/filters/SelectFilter.js.map +1 -1
- package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -1
- package/dist/molecules/table/hooks/useTable.d.ts +12 -4
- package/dist/molecules/table/hooks/useTable.js +7 -7
- package/dist/molecules/table/hooks/useTable.js.map +1 -1
- package/dist/molecules/table/hooks/useUniqValues.js.map +1 -1
- package/dist/molecules/table/utils/mapFormToColumns.js +20 -21
- package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -1
- package/dist/molecules/tabs/Tab.d.ts +13 -0
- package/dist/molecules/tabs/Tab.js +66 -0
- package/dist/molecules/tabs/Tab.js.map +1 -0
- package/dist/molecules/tabs/TabList.d.ts +2 -0
- package/dist/molecules/tabs/TabList.js +23 -0
- package/dist/molecules/tabs/TabList.js.map +1 -0
- package/dist/molecules/tabs/TabPanel.d.ts +9 -0
- package/dist/molecules/tabs/TabPanel.js +27 -0
- package/dist/molecules/tabs/TabPanel.js.map +1 -0
- package/dist/molecules/tabs/Tabs.d.ts +4 -16
- package/dist/molecules/tabs/Tabs.js +7 -67
- package/dist/molecules/tabs/Tabs.js.map +1 -1
- package/dist/molecules/tabs/TabsBody.d.ts +1 -0
- package/dist/molecules/tabs/TabsBody.js +10 -0
- package/dist/molecules/tabs/TabsBody.js.map +1 -0
- package/dist/molecules/tabs/TabsLegacy.d.ts +17 -0
- package/dist/molecules/tabs/TabsLegacy.js +49 -0
- package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
- package/dist/molecules/tabs/all.d.ts +5 -0
- package/dist/molecules/tabs/all.js +13 -0
- package/dist/molecules/tabs/all.js.map +1 -0
- package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
- package/dist/molecules/tabs/context/TabControl.js +85 -0
- package/dist/molecules/tabs/context/TabControl.js.map +1 -0
- package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
- package/dist/molecules/tabs/hooks/tabControl.js +34 -0
- package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
- package/dist/organisms/form/Form.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.js +41 -41
- package/dist/organisms/form/access/FormAccess.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.utils.js +2 -2
- package/dist/organisms/form/access/FormAccess.utils.js.map +1 -1
- package/dist/organisms/form/{action → actions}/FormAction.js +7 -8
- package/dist/organisms/form/actions/FormAction.js.map +1 -0
- package/dist/organisms/form/builder/FormBuilder.js.map +1 -1
- package/dist/organisms/form/builder/FormEdit.d.ts +3 -1
- package/dist/organisms/form/builder/FormEdit.js +38 -35
- package/dist/organisms/form/builder/FormEdit.js.map +1 -1
- package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -1
- package/dist/organisms/form/builder/FormEditCtas.js +34 -34
- package/dist/organisms/form/builder/FormEditCtas.js.map +1 -1
- package/dist/organisms/form/builder/FormParameters.js.map +1 -1
- package/dist/organisms/form/builder/useFormBuilder.js +41 -38
- package/dist/organisms/form/builder/useFormBuilder.js.map +1 -1
- package/dist/organisms/form/builder/useFormEdit.js +1 -1
- package/dist/organisms/form/builder/useFormEdit.js.map +1 -1
- package/dist/organisms/form/exports/FormExport.d.ts +5 -0
- package/dist/organisms/form/exports/FormExport.js +55 -0
- package/dist/organisms/form/exports/FormExport.js.map +1 -0
- package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
- package/dist/organisms/form/preview/FormPreview.js +11 -0
- package/dist/organisms/form/preview/FormPreview.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.js +24 -24
- package/dist/organisms/form/settings/FormSettings.js.map +1 -1
- package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -1
- package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -1
- package/dist/organisms/form/useForm.js +664 -661
- package/dist/organisms/form/useForm.js.map +1 -1
- package/dist/organisms/modal/RemoveModal.js +16 -17
- package/dist/organisms/modal/RemoveModal.js.map +1 -1
- package/dist/organisms/table/actions/ActionsTable.js.map +1 -1
- package/dist/organisms/table/forms/FormsTable.js.map +1 -1
- package/dist/organisms/table/forms/components/FormsCell.js.map +1 -1
- package/dist/organisms/table/submissions/SubmissionsTable.d.ts +11 -3
- package/dist/organisms/table/submissions/SubmissionsTable.js +4 -1
- package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -1
- package/dist/organisms/views/FormViews.d.ts +24 -0
- package/dist/organisms/views/FormViews.js +96 -0
- package/dist/organisms/views/FormViews.js.map +1 -0
- package/dist/registries/components.js.map +1 -1
- package/dist/utils/getEventValue.js.map +1 -1
- package/dist/utils/iconClass.js.map +1 -1
- package/dist/utils/mapPagination.js.map +1 -1
- package/dist/utils/stopPropagationWrapper.js.map +1 -1
- package/package.json +7 -7
- package/src/atoms/icon/Icon.stories.tsx +1 -1
- package/src/hooks/keyboard.constants.ts +40 -0
- package/src/hooks/useKeyboardControls.spec.tsx +208 -0
- package/src/hooks/useKeyboardControls.ts +84 -0
- package/src/interfaces/Operation.ts +9 -3
- package/src/molecules/button/Button.stories.tsx +1 -1
- package/src/molecules/button/Button.tsx +43 -24
- package/src/molecules/card/Card.tsx +4 -0
- package/src/molecules/forms/form-control/FormControl.stories.tsx +1 -1
- package/src/molecules/forms/input-tags/InputTags.tsx +1 -1
- package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +1 -1
- package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +1 -1
- package/src/molecules/forms/input-text/InputText.stories.tsx +2 -2
- package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +2 -2
- package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +2 -2
- package/src/molecules/forms/select/components/ReactSelect.stories.tsx +2 -2
- package/src/molecules/loader/Loader.stories.tsx +1 -1
- package/src/molecules/modal/Modal.stories.tsx +1 -1
- package/src/molecules/pagination/Pagination.stories.tsx +1 -8
- package/src/molecules/pagination/Pagination.tsx +0 -1
- package/src/molecules/table/Table.stories.tsx +36 -3
- package/src/molecules/table/Table.tsx +12 -6
- package/src/molecules/table/components/DefaultCellOperations.tsx +13 -7
- package/src/molecules/table/components/DefaultOperationButton.tsx +5 -4
- package/src/molecules/table/filters/SelectFilter.tsx +1 -1
- package/src/molecules/table/hooks/useTable.tsx +5 -5
- package/src/molecules/tabs/Tab.tsx +106 -0
- package/src/molecules/tabs/TabList.tsx +37 -0
- package/src/molecules/tabs/TabPanel.tsx +37 -0
- package/src/molecules/tabs/Tabs.spec.tsx +126 -73
- package/src/molecules/tabs/Tabs.stories.tsx +298 -65
- package/src/molecules/tabs/Tabs.tsx +10 -81
- package/src/molecules/tabs/TabsBody.tsx +11 -0
- package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
- package/src/molecules/tabs/TabsLegacy.tsx +84 -0
- package/src/molecules/tabs/all.ts +5 -0
- package/src/molecules/tabs/context/TabControl.tsx +166 -0
- package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
- package/src/molecules/tabs/hooks/tabControl.ts +52 -0
- package/src/organisms/__fixtures__/form-firstname.fixture.json +1 -0
- package/src/organisms/__fixtures__/form.fixture.json +1 -0
- package/src/organisms/form/Form.stories.tsx +94 -118
- package/src/organisms/form/access/FormAccess.stories.tsx +2 -2
- package/src/organisms/form/actions/FormAction.stories.tsx +422 -0
- package/src/organisms/form/builder/FormBuilder.stories.tsx +4 -1
- package/src/organisms/form/builder/FormEdit.stories.tsx +1 -1
- package/src/organisms/form/builder/FormEdit.tsx +7 -1
- package/src/organisms/form/builder/useFormBuilder.ts +5 -1
- package/src/organisms/form/builder/useFormEdit.ts +1 -1
- package/src/organisms/form/exports/FormExport.stories.tsx +71 -0
- package/src/organisms/form/exports/FormExport.tsx +58 -0
- package/src/organisms/form/preview/FormPreview.stories.tsx +61 -0
- package/src/organisms/form/preview/FormPreview.tsx +21 -0
- package/src/organisms/modal/RemoveModal.stories.tsx +1 -1
- package/src/organisms/table/actions/ActionsTable.stories.tsx +38 -36
- package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +103 -57
- package/src/organisms/table/submissions/SubmissionsTable.tsx +10 -4
- package/src/organisms/views/FormViews.stories.tsx +224 -0
- package/src/organisms/views/FormViews.tsx +146 -0
- package/vite.config.mts +2 -2
- package/dist/organisms/form/action/FormAction.js.map +0 -1
- package/src/organisms/form/action/FormAction.stories.tsx +0 -364
- package/tsconfig.app.json +0 -11
- package/tsconfig.json +0 -21
- package/tsconfig.node.json +0 -13
- package/tsconfig.spec.json +0 -14
- /package/dist/organisms/form/{action → actions}/FormAction.d.ts +0 -0
- /package/src/organisms/form/{action → actions}/FormAction.tsx +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormBuilder as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
const
|
|
1
|
+
import { FormBuilder as R } from "formiojs";
|
|
2
|
+
import C from "lodash/cloneDeep";
|
|
3
|
+
import { useRef as p, useState as b, useEffect as d } from "react";
|
|
4
|
+
const g = [
|
|
5
5
|
"addComponent",
|
|
6
6
|
"updateComponent",
|
|
7
7
|
"removeComponent",
|
|
@@ -12,60 +12,63 @@ const w = [
|
|
|
12
12
|
"editJson",
|
|
13
13
|
"copyComponent",
|
|
14
14
|
"pasteComponent"
|
|
15
|
-
],
|
|
16
|
-
async function E(
|
|
17
|
-
const
|
|
18
|
-
display:
|
|
15
|
+
], v = ["addComponent", "saveComponent", "updateComponent", "removeComponent"];
|
|
16
|
+
async function E(t, { components: o = [], display: u, options: c, onChange: m, events: i = {} }) {
|
|
17
|
+
const s = {
|
|
18
|
+
display: u,
|
|
19
19
|
components: [...o]
|
|
20
|
-
}, e = await new
|
|
21
|
-
i[
|
|
20
|
+
}, e = await new R(t, s, { ...c }).ready, f = (r) => (...a) => {
|
|
21
|
+
i[r] && i[r](...a), v.includes(r) && m(e.form.components);
|
|
22
22
|
};
|
|
23
|
-
return
|
|
23
|
+
return g.forEach((r) => e.on(r, f(r))), e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
|
|
25
|
+
function w({ components: t, display: o, options: u = {}, onBuilderReady: c, onChange: m, ...i }) {
|
|
26
|
+
const s = p(null), e = p(null), [f, r] = b(C(t)), a = Object.fromEntries(Object.entries(i).filter(([n]) => n.startsWith("on")));
|
|
27
|
+
d(() => {
|
|
28
28
|
async function n() {
|
|
29
|
-
if (!
|
|
29
|
+
if (!s.current) {
|
|
30
30
|
console.warn("FormBuilder render element not found, cannot render builder.");
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
e.current = await E(
|
|
33
|
+
e.current = await E(s.current.firstChild, {
|
|
34
34
|
display: o,
|
|
35
|
-
options: { ...
|
|
36
|
-
components:
|
|
37
|
-
onChange:
|
|
38
|
-
events:
|
|
35
|
+
options: { ...u },
|
|
36
|
+
components: C(t),
|
|
37
|
+
onChange: l,
|
|
38
|
+
events: a
|
|
39
39
|
}), c && c(e.current);
|
|
40
40
|
}
|
|
41
|
-
return n().catch((
|
|
42
|
-
console.error(
|
|
41
|
+
return n().catch((h) => {
|
|
42
|
+
console.error(h);
|
|
43
43
|
}), () => {
|
|
44
|
-
|
|
45
|
-
(a = e.current) == null || a.destroy();
|
|
44
|
+
e.current?.destroy();
|
|
46
45
|
};
|
|
47
|
-
}, []),
|
|
48
|
-
e.current && (o !== e.current.form.display ? E(
|
|
46
|
+
}, []), d(() => {
|
|
47
|
+
e.current && (o !== e.current.form.display ? E(s.current.firstChild, {
|
|
49
48
|
display: o,
|
|
50
|
-
options: { ...
|
|
51
|
-
components:
|
|
52
|
-
onChange:
|
|
53
|
-
events:
|
|
49
|
+
options: { ...u },
|
|
50
|
+
components: C(t),
|
|
51
|
+
onChange: l,
|
|
52
|
+
events: a
|
|
54
53
|
}).then((n) => {
|
|
55
54
|
e.current = n, c && c(e.current);
|
|
56
55
|
}).catch((n) => {
|
|
57
|
-
console.error(
|
|
58
|
-
|
|
56
|
+
console.error({
|
|
57
|
+
event: "FORM_BUILDER_RECREATE_ERROR",
|
|
58
|
+
message: n.message,
|
|
59
|
+
stack: n.stack
|
|
60
|
+
});
|
|
61
|
+
}) : t !== f && (e.current.form = {
|
|
59
62
|
display: o,
|
|
60
|
-
components:
|
|
63
|
+
components: t
|
|
61
64
|
}));
|
|
62
|
-
}, [o,
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
+
}, [o, t]);
|
|
66
|
+
const l = (n) => {
|
|
67
|
+
r(n), m && m(n);
|
|
65
68
|
};
|
|
66
|
-
return
|
|
69
|
+
return s;
|
|
67
70
|
}
|
|
68
71
|
export {
|
|
69
|
-
|
|
72
|
+
w as useFormBuilder
|
|
70
73
|
};
|
|
71
74
|
//# sourceMappingURL=useFormBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormBuilder.js","sources":["../../../../src/organisms/form/builder/useFormBuilder.ts"],"sourcesContent":["import { FormBuilder as FormioFormBuilder } from \"formiojs\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { ComponentType, FormOptions, FormType } from \"../../../interfaces\";\n\ninterface BuilderConstructor {\n new (element: HTMLDivElement, form: FormType, options: FormOptions): FormioFormBuilder;\n}\n\nconst EVENTS = [\n \"addComponent\",\n \"updateComponent\",\n \"removeComponent\",\n \"saveComponent\",\n \"cancelComponent\",\n \"moveComponent\",\n \"editComponent\",\n \"editJson\",\n \"copyComponent\",\n \"pasteComponent\"\n];\n\nconst EVENTS_CHANGE = [\"addComponent\", \"saveComponent\", \"updateComponent\", \"removeComponent\"];\n\nasync function createBuilder(el: Element, { components = [], display, options, onChange, events = {} }: any): Promise<FormioFormBuilder> {\n const form = {\n display,\n components: [...components]\n };\n\n const builder = await new FormioFormBuilder(el, form, { ...options }).ready;\n\n const handleEvent = (event: string) => {\n return (...args: any[]) => {\n events[event] && events[event](...args);\n\n if (EVENTS_CHANGE.includes(event)) {\n onChange(builder.form.components);\n }\n };\n };\n\n EVENTS.forEach((event) => builder.on(event, handleEvent(event)));\n\n return builder;\n}\nexport interface FormBuilderEvents {\n onAddComponent?: Function;\n onRemoveComponent?: Function;\n onCancelComponent?: Function;\n onMoveComponent?: Function;\n onEditJson?: Function;\n onCopyComponent?: Function;\n onPasteComponent?: Function;\n onBuilderReady?: (builder: FormioFormBuilder) => void;\n onChange?: (components: ComponentType[]) => void;\n onSaveComponent?: (\n component: ComponentType,\n original: ComponentType,\n parent: ComponentType,\n path: string,\n index: number,\n isNew: boolean,\n originalComponentSchema: ComponentType\n ) => void;\n onEditComponent?: (component: ComponentType) => void;\n onUpdateComponent?: (component: ComponentType) => void;\n onDeleteComponent?: (component: ComponentType, parent: ComponentType, path: string, index: number) => void;\n}\n\nexport interface UseFormBuilderProps extends FormBuilderEvents {\n Builder?: BuilderConstructor;\n components: ComponentType[];\n display?: string;\n options?: FormOptions;\n}\n\nexport function useFormBuilder({ components, display, options = {}, onBuilderReady, onChange, ...props }: UseFormBuilderProps) {\n const renderElement = useRef<HTMLDivElement>(null);\n const builderRef = useRef<FormioFormBuilder | null>(null);\n const [currentComponents, setCurrentComponents] = useState<ComponentType[]>(cloneDeep(components));\n const events = Object.fromEntries(Object.entries(props).filter(([key]) => key.startsWith(\"on\")));\n\n useEffect(() => {\n async function initializeBuilder() {\n if (!renderElement.current) {\n console.warn(\"FormBuilder render element not found, cannot render builder.\");\n return;\n }\n\n builderRef.current = await createBuilder(renderElement.current.firstChild as Element, {\n display,\n options: { ...options },\n components: cloneDeep(components),\n onChange: handleComponentsChange,\n events\n });\n\n onBuilderReady && onBuilderReady(builderRef.current);\n }\n\n initializeBuilder().catch((er) => {\n console.error(er);\n });\n\n return () => {\n builderRef.current?.destroy();\n };\n }, []);\n\n useEffect(() => {\n if (builderRef.current) {\n if (display !== builderRef.current.form.display) {\n createBuilder(renderElement.current!.firstChild as Element, {\n display,\n options: { ...options },\n components: cloneDeep(components),\n onChange: handleComponentsChange,\n events\n })\n .then((builder) => {\n builderRef.current = builder;\n onBuilderReady && onBuilderReady(builderRef.current);\n })\n .catch((er) => {\n console.error(er);\n });\n } else if (components !== currentComponents) {\n builderRef.current.form = {\n display,\n components\n };\n }\n }\n }, [display, components]);\n\n const handleComponentsChange = (newComponents: ComponentType[]) => {\n setCurrentComponents(newComponents);\n onChange && onChange(newComponents);\n };\n return renderElement;\n}\n"],"names":["EVENTS","EVENTS_CHANGE","createBuilder","el","components","display","options","onChange","events","form","builder","FormioFormBuilder","handleEvent","event","args","useFormBuilder","onBuilderReady","props","renderElement","useRef","builderRef","currentComponents","setCurrentComponents","useState","cloneDeep","key","useEffect","initializeBuilder","handleComponentsChange","er","
|
|
1
|
+
{"version":3,"file":"useFormBuilder.js","sources":["../../../../src/organisms/form/builder/useFormBuilder.ts"],"sourcesContent":["import { FormBuilder as FormioFormBuilder } from \"formiojs\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { ComponentType, FormOptions, FormType } from \"../../../interfaces\";\n\ninterface BuilderConstructor {\n new (element: HTMLDivElement, form: FormType, options: FormOptions): FormioFormBuilder;\n}\n\nconst EVENTS = [\n \"addComponent\",\n \"updateComponent\",\n \"removeComponent\",\n \"saveComponent\",\n \"cancelComponent\",\n \"moveComponent\",\n \"editComponent\",\n \"editJson\",\n \"copyComponent\",\n \"pasteComponent\"\n];\n\nconst EVENTS_CHANGE = [\"addComponent\", \"saveComponent\", \"updateComponent\", \"removeComponent\"];\n\nasync function createBuilder(el: Element, { components = [], display, options, onChange, events = {} }: any): Promise<FormioFormBuilder> {\n const form = {\n display,\n components: [...components]\n };\n\n const builder = await new FormioFormBuilder(el, form, { ...options }).ready;\n\n const handleEvent = (event: string) => {\n return (...args: any[]) => {\n events[event] && events[event](...args);\n\n if (EVENTS_CHANGE.includes(event)) {\n onChange(builder.form.components);\n }\n };\n };\n\n EVENTS.forEach((event) => builder.on(event, handleEvent(event)));\n\n return builder;\n}\nexport interface FormBuilderEvents {\n onAddComponent?: Function;\n onRemoveComponent?: Function;\n onCancelComponent?: Function;\n onMoveComponent?: Function;\n onEditJson?: Function;\n onCopyComponent?: Function;\n onPasteComponent?: Function;\n onBuilderReady?: (builder: FormioFormBuilder) => void;\n onChange?: (components: ComponentType[]) => void;\n onSaveComponent?: (\n component: ComponentType,\n original: ComponentType,\n parent: ComponentType,\n path: string,\n index: number,\n isNew: boolean,\n originalComponentSchema: ComponentType\n ) => void;\n onEditComponent?: (component: ComponentType) => void;\n onUpdateComponent?: (component: ComponentType) => void;\n onDeleteComponent?: (component: ComponentType, parent: ComponentType, path: string, index: number) => void;\n}\n\nexport interface UseFormBuilderProps extends FormBuilderEvents {\n Builder?: BuilderConstructor;\n components: ComponentType[];\n display?: string;\n options?: FormOptions;\n}\n\nexport function useFormBuilder({ components, display, options = {}, onBuilderReady, onChange, ...props }: UseFormBuilderProps) {\n const renderElement = useRef<HTMLDivElement>(null);\n const builderRef = useRef<FormioFormBuilder | null>(null);\n const [currentComponents, setCurrentComponents] = useState<ComponentType[]>(cloneDeep(components));\n const events = Object.fromEntries(Object.entries(props).filter(([key]) => key.startsWith(\"on\")));\n\n useEffect(() => {\n async function initializeBuilder() {\n if (!renderElement.current) {\n console.warn(\"FormBuilder render element not found, cannot render builder.\");\n return;\n }\n\n builderRef.current = await createBuilder(renderElement.current.firstChild as Element, {\n display,\n options: { ...options },\n components: cloneDeep(components),\n onChange: handleComponentsChange,\n events\n });\n\n onBuilderReady && onBuilderReady(builderRef.current);\n }\n\n initializeBuilder().catch((er) => {\n console.error(er);\n });\n\n return () => {\n builderRef.current?.destroy();\n };\n }, []);\n\n useEffect(() => {\n if (builderRef.current) {\n if (display !== builderRef.current.form.display) {\n createBuilder(renderElement.current!.firstChild as Element, {\n display,\n options: { ...options },\n components: cloneDeep(components),\n onChange: handleComponentsChange,\n events\n })\n .then((builder) => {\n builderRef.current = builder;\n onBuilderReady && onBuilderReady(builderRef.current);\n })\n .catch((er) => {\n console.error({\n event: \"FORM_BUILDER_RECREATE_ERROR\",\n message: er.message,\n stack: er.stack\n });\n });\n } else if (components !== currentComponents) {\n builderRef.current.form = {\n display,\n components\n };\n }\n }\n }, [display, components]);\n\n const handleComponentsChange = (newComponents: ComponentType[]) => {\n setCurrentComponents(newComponents);\n onChange && onChange(newComponents);\n };\n return renderElement;\n}\n"],"names":["EVENTS","EVENTS_CHANGE","createBuilder","el","components","display","options","onChange","events","form","builder","FormioFormBuilder","handleEvent","event","args","useFormBuilder","onBuilderReady","props","renderElement","useRef","builderRef","currentComponents","setCurrentComponents","useState","cloneDeep","key","useEffect","initializeBuilder","handleComponentsChange","er","newComponents"],"mappings":";;;AAUA,MAAMA,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAgB,CAAC,gBAAgB,iBAAiB,mBAAmB,iBAAiB;AAE5F,eAAeC,EAAcC,GAAa,EAAE,YAAAC,IAAa,CAAA,GAAI,SAAAC,GAAS,SAAAC,GAAS,UAAAC,GAAU,QAAAC,IAAS,CAAA,KAAuC;AACvI,QAAMC,IAAO;AAAA,IACX,SAAAJ;AAAA,IACA,YAAY,CAAC,GAAGD,CAAU;AAAA,EAAA,GAGtBM,IAAU,MAAM,IAAIC,EAAkBR,GAAIM,GAAM,EAAE,GAAGH,EAAA,CAAS,EAAE,OAEhEM,IAAc,CAACC,MACZ,IAAIC,MAAgB;AACzB,IAAAN,EAAOK,CAAK,KAAKL,EAAOK,CAAK,EAAE,GAAGC,CAAI,GAElCb,EAAc,SAASY,CAAK,KAC9BN,EAASG,EAAQ,KAAK,UAAU;AAAA,EAEpC;AAGF,SAAAV,EAAO,QAAQ,CAACa,MAAUH,EAAQ,GAAGG,GAAOD,EAAYC,CAAK,CAAC,CAAC,GAExDH;AACT;AAgCO,SAASK,EAAe,EAAE,YAAAX,GAAY,SAAAC,GAAS,SAAAC,IAAU,CAAA,GAAI,gBAAAU,GAAgB,UAAAT,GAAU,GAAGU,KAA8B;AAC7H,QAAMC,IAAgBC,EAAuB,IAAI,GAC3CC,IAAaD,EAAiC,IAAI,GAClD,CAACE,GAAmBC,CAAoB,IAAIC,EAA0BC,EAAUpB,CAAU,CAAC,GAC3FI,IAAS,OAAO,YAAY,OAAO,QAAQS,CAAK,EAAE,OAAO,CAAC,CAACQ,CAAG,MAAMA,EAAI,WAAW,IAAI,CAAC,CAAC;AAE/F,EAAAC,EAAU,MAAM;AACd,mBAAeC,IAAoB;AACjC,UAAI,CAACT,EAAc,SAAS;AAC1B,gBAAQ,KAAK,8DAA8D;AAC3E;AAAA,MACF;AAEA,MAAAE,EAAW,UAAU,MAAMlB,EAAcgB,EAAc,QAAQ,YAAuB;AAAA,QACpF,SAAAb;AAAA,QACA,SAAS,EAAE,GAAGC,EAAA;AAAA,QACd,YAAYkB,EAAUpB,CAAU;AAAA,QAChC,UAAUwB;AAAA,QACV,QAAApB;AAAA,MAAA,CACD,GAEDQ,KAAkBA,EAAeI,EAAW,OAAO;AAAA,IACrD;AAEA,WAAAO,EAAA,EAAoB,MAAM,CAACE,MAAO;AAChC,cAAQ,MAAMA,CAAE;AAAA,IAClB,CAAC,GAEM,MAAM;AACX,MAAAT,EAAW,SAAS,QAAA;AAAA,IACtB;AAAA,EACF,GAAG,CAAA,CAAE,GAELM,EAAU,MAAM;AACd,IAAIN,EAAW,YACTf,MAAYe,EAAW,QAAQ,KAAK,UACtClB,EAAcgB,EAAc,QAAS,YAAuB;AAAA,MAC1D,SAAAb;AAAA,MACA,SAAS,EAAE,GAAGC,EAAA;AAAA,MACd,YAAYkB,EAAUpB,CAAU;AAAA,MAChC,UAAUwB;AAAA,MACV,QAAApB;AAAA,IAAA,CACD,EACE,KAAK,CAACE,MAAY;AACjB,MAAAU,EAAW,UAAUV,GACrBM,KAAkBA,EAAeI,EAAW,OAAO;AAAA,IACrD,CAAC,EACA,MAAM,CAACS,MAAO;AACb,cAAQ,MAAM;AAAA,QACZ,OAAO;AAAA,QACP,SAASA,EAAG;AAAA,QACZ,OAAOA,EAAG;AAAA,MAAA,CACX;AAAA,IACH,CAAC,IACMzB,MAAeiB,MACxBD,EAAW,QAAQ,OAAO;AAAA,MACxB,SAAAf;AAAA,MACA,YAAAD;AAAA,IAAA;AAAA,EAIR,GAAG,CAACC,GAASD,CAAU,CAAC;AAExB,QAAMwB,IAAyB,CAACE,MAAmC;AACjE,IAAAR,EAAqBQ,CAAa,GAClCvB,KAAYA,EAASuB,CAAa;AAAA,EACpC;AACA,SAAOZ;AACT;"}
|
|
@@ -8,7 +8,7 @@ function R(e) {
|
|
|
8
8
|
e.onSubmit && typeof e.onCopy == "function" && e.onCopy(t);
|
|
9
9
|
};
|
|
10
10
|
g(() => {
|
|
11
|
-
e.form && (t
|
|
11
|
+
e.form && (t?._id !== e.form._id || t.modified !== e.form.modified) && o({ type: "replaceForm", value: e.form });
|
|
12
12
|
}, [e.form]);
|
|
13
13
|
const f = (n) => {
|
|
14
14
|
b(t, { ...t, ...n }) && o({ type: "formChange", value: n });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormEdit.js","sources":["../../../../src/organisms/form/builder/useFormEdit.ts"],"sourcesContent":["import cloneDeep from \"lodash/cloneDeep\";\nimport { useEffect, useReducer } from \"react\";\n\nimport type { FormType } from \"../../../interfaces\";\nimport { createInitialState, hasChanged, reducer } from \"./FormEdit.reducer\";\n\nexport interface UseFormEditHookProps extends Record<string, unknown> {\n form?: Partial<FormType>;\n typeChoices?: { label: string; value: any }[];\n displayChoices?: { label: string; value: any }[];\n enableTags?: boolean;\n onSubmit?: (form: Partial<FormType>) => void;\n onCopy?: (form: Partial<FormType>) => void;\n}\n\nexport function useFormEdit(props: UseFormEditHookProps) {\n const [{ current, future, past }, dispatchFormAction] = useReducer(reducer, createInitialState(props));\n\n const onSubmit = () => {\n if (props.onSubmit && typeof props.onSubmit === \"function\") {\n props.onSubmit(current);\n }\n };\n const onCopy = () => {\n if (props.onSubmit && typeof props.onCopy === \"function\") {\n props.onCopy(current);\n }\n };\n\n useEffect(() => {\n if (props.form && (current
|
|
1
|
+
{"version":3,"file":"useFormEdit.js","sources":["../../../../src/organisms/form/builder/useFormEdit.ts"],"sourcesContent":["import cloneDeep from \"lodash/cloneDeep\";\nimport { useEffect, useReducer } from \"react\";\n\nimport type { FormType } from \"../../../interfaces\";\nimport { createInitialState, hasChanged, reducer } from \"./FormEdit.reducer\";\n\nexport interface UseFormEditHookProps extends Record<string, unknown> {\n form?: Partial<FormType>;\n typeChoices?: { label: string; value: any }[];\n displayChoices?: { label: string; value: any }[];\n enableTags?: boolean;\n onSubmit?: (form: Partial<FormType>) => void;\n onCopy?: (form: Partial<FormType>) => void;\n}\n\nexport function useFormEdit(props: UseFormEditHookProps) {\n const [{ current, future, past }, dispatchFormAction] = useReducer(reducer, createInitialState(props));\n\n const onSubmit = () => {\n if (props.onSubmit && typeof props.onSubmit === \"function\") {\n props.onSubmit(current);\n }\n };\n const onCopy = () => {\n if (props.onSubmit && typeof props.onCopy === \"function\") {\n props.onCopy(current);\n }\n };\n\n useEffect(() => {\n if (props.form && (current?._id !== props.form._id || current.modified !== props.form.modified)) {\n dispatchFormAction({ type: \"replaceForm\", value: props.form });\n }\n }, [props.form]);\n\n const formChange = (newForm: Partial<FormType>) => {\n if (hasChanged(current, { ...current, ...newForm })) {\n dispatchFormAction({ type: \"formChange\", value: newForm });\n }\n };\n\n const redo = () => dispatchFormAction({ type: \"redo\" });\n const undo = () => dispatchFormAction({ type: \"undo\" });\n const reset = () => dispatchFormAction({ type: \"reset\" });\n\n const setChange = (path: string | undefined, value: any) => {\n formChange({ ...current, [path!]: value });\n };\n\n return {\n form: cloneDeep(current),\n redo,\n undo,\n reset,\n hasChanged: !!past.length,\n isValid: current.title && current.name && current.path,\n hasUndo: !!past.length,\n hasRedo: !!future.length,\n onSubmit,\n onCopy,\n formChange,\n setChange\n };\n}\n"],"names":["useFormEdit","props","current","future","past","dispatchFormAction","useReducer","reducer","createInitialState","onSubmit","onCopy","useEffect","formChange","newForm","hasChanged","redo","undo","reset","setChange","path","value","cloneDeep"],"mappings":";;;AAeO,SAASA,EAAYC,GAA6B;AACvD,QAAM,CAAC,EAAE,SAAAC,GAAS,QAAAC,GAAQ,MAAAC,EAAA,GAAQC,CAAkB,IAAIC,EAAWC,GAASC,EAAmBP,CAAK,CAAC,GAE/FQ,IAAW,MAAM;AACrB,IAAIR,EAAM,YAAY,OAAOA,EAAM,YAAa,cAC9CA,EAAM,SAASC,CAAO;AAAA,EAE1B,GACMQ,IAAS,MAAM;AACnB,IAAIT,EAAM,YAAY,OAAOA,EAAM,UAAW,cAC5CA,EAAM,OAAOC,CAAO;AAAA,EAExB;AAEA,EAAAS,EAAU,MAAM;AACd,IAAIV,EAAM,SAASC,GAAS,QAAQD,EAAM,KAAK,OAAOC,EAAQ,aAAaD,EAAM,KAAK,aACpFI,EAAmB,EAAE,MAAM,eAAe,OAAOJ,EAAM,MAAM;AAAA,EAEjE,GAAG,CAACA,EAAM,IAAI,CAAC;AAEf,QAAMW,IAAa,CAACC,MAA+B;AACjD,IAAIC,EAAWZ,GAAS,EAAE,GAAGA,GAAS,GAAGW,EAAA,CAAS,KAChDR,EAAmB,EAAE,MAAM,cAAc,OAAOQ,GAAS;AAAA,EAE7D,GAEME,IAAO,MAAMV,EAAmB,EAAE,MAAM,QAAQ,GAChDW,IAAO,MAAMX,EAAmB,EAAE,MAAM,QAAQ,GAChDY,IAAQ,MAAMZ,EAAmB,EAAE,MAAM,SAAS,GAElDa,IAAY,CAACC,GAA0BC,MAAe;AAC1D,IAAAR,EAAW,EAAE,GAAGV,GAAS,CAACiB,CAAK,GAAGC,GAAO;AAAA,EAC3C;AAEA,SAAO;AAAA,IACL,MAAMC,EAAUnB,CAAO;AAAA,IACvB,MAAAa;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAY,CAAC,CAACb,EAAK;AAAA,IACnB,SAASF,EAAQ,SAASA,EAAQ,QAAQA,EAAQ;AAAA,IAClD,SAAS,CAAC,CAACE,EAAK;AAAA,IAChB,SAAS,CAAC,CAACD,EAAO;AAAA,IAClB,UAAAM;AAAA,IACA,QAAAC;AAAA,IACA,YAAAE;AAAA,IACA,WAAAM;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface FormExportProps {
|
|
2
|
+
i18n?: (key: string) => string;
|
|
3
|
+
onClick?: (action: "export:form" | "export:submissions", format: "json" | "csv") => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function FormExport({ i18n, onClick }: FormExportProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as r } from "../../../atoms/icon/Icon.js";
|
|
3
|
+
import { getComponent as n } from "../../../registries/components.js";
|
|
4
|
+
function i({ i18n: a = (m) => m, onClick: c }) {
|
|
5
|
+
const m = n("Card");
|
|
6
|
+
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
|
|
7
|
+
/* @__PURE__ */ e("div", { className: "sm:w-1/2", children: /* @__PURE__ */ s(
|
|
8
|
+
m,
|
|
9
|
+
{
|
|
10
|
+
label: /* @__PURE__ */ s("span", { className: "flex items-center", children: [
|
|
11
|
+
/* @__PURE__ */ e(r, { name: "detail", className: "mr-1 text-secondary" }),
|
|
12
|
+
" ",
|
|
13
|
+
a("Export schema")
|
|
14
|
+
] }),
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ e("p", { className: "mb-5", children: a("Export the formIO schema:") }),
|
|
17
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("button", { className: "btn btn-primary", onClick: () => c?.("export:form", "json"), children: [
|
|
18
|
+
/* @__PURE__ */ e(r, { name: "code", className: "mr-1" }),
|
|
19
|
+
" ",
|
|
20
|
+
a("Json")
|
|
21
|
+
] }) })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
) }),
|
|
25
|
+
/* @__PURE__ */ e("div", { className: "sm:w-1/2", children: /* @__PURE__ */ s(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
label: /* @__PURE__ */ s("span", { className: "flex items-center", children: [
|
|
29
|
+
/* @__PURE__ */ e(r, { name: "data", className: "mr-1 text-secondary" }),
|
|
30
|
+
" ",
|
|
31
|
+
a("Export submissions")
|
|
32
|
+
] }),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ e("p", { className: "mb-5", children: a("Export all submission as JSON or CSV:") }),
|
|
35
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: [
|
|
36
|
+
/* @__PURE__ */ s("button", { className: "btn btn-primary mr-4", onClick: () => c?.("export:submissions", "json"), children: [
|
|
37
|
+
/* @__PURE__ */ e(r, { name: "code", className: "mr-1" }),
|
|
38
|
+
" ",
|
|
39
|
+
a("Json")
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ s("button", { className: "btn btn-primary", onClick: () => c?.("export:submissions", "csv"), children: [
|
|
42
|
+
/* @__PURE__ */ e(r, { name: "spreadsheet", className: "mr-1" }),
|
|
43
|
+
" ",
|
|
44
|
+
a("Csv")
|
|
45
|
+
] })
|
|
46
|
+
] })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
] }) });
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
i as FormExport
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=FormExport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormExport.js","sources":["../../../../src/organisms/form/exports/FormExport.tsx"],"sourcesContent":["import { Icon } from \"../../../atoms/icon/Icon.js\";\nimport type { Card } from \"../../../molecules/card/Card.js\";\nimport { getComponent } from \"../../../registries/components.js\";\n\nexport interface FormExportProps {\n i18n?: (key: string) => string;\n onClick?: (action: \"export:form\" | \"export:submissions\", format: \"json\" | \"csv\") => void;\n}\n\nexport function FormExport({ i18n = (f: string) => f, onClick }: FormExportProps) {\n const FCard = getComponent<typeof Card>(\"Card\");\n\n return (\n <div>\n <div className={\"flex gap-3\"}>\n <div className={\"sm:w-1/2\"}>\n <FCard\n label={\n (\n <span className={\"flex items-center\"}>\n <Icon name={\"detail\"} className={\"mr-1 text-secondary\"} /> {i18n(`Export schema`)}\n </span>\n ) as any\n }\n >\n <p className={\"mb-5\"}>{i18n(\"Export the formIO schema:\")}</p>\n <div className={\"flex items-center justify-center\"}>\n <button className={\"btn btn-primary\"} onClick={() => onClick?.(\"export:form\", \"json\")}>\n <Icon name={\"code\"} className={\"mr-1\"} /> {i18n(`Json`)}\n </button>\n </div>\n </FCard>\n </div>\n <div className={\"sm:w-1/2\"}>\n <FCard\n label={\n (\n <span className={\"flex items-center\"}>\n <Icon name={\"data\"} className={\"mr-1 text-secondary\"} /> {i18n(`Export submissions`)}\n </span>\n ) as any\n }\n >\n <p className={\"mb-5\"}>{i18n(\"Export all submission as JSON or CSV:\")}</p>\n <div className={\"flex items-center justify-center\"}>\n <button className={\"btn btn-primary mr-4\"} onClick={() => onClick?.(\"export:submissions\", \"json\")}>\n <Icon name={\"code\"} className={\"mr-1\"} /> {i18n(`Json`)}\n </button>\n <button className={\"btn btn-primary\"} onClick={() => onClick?.(\"export:submissions\", \"csv\")}>\n <Icon name={\"spreadsheet\"} className={\"mr-1\"} /> {i18n(`Csv`)}\n </button>\n </div>\n </FCard>\n </div>\n </div>\n </div>\n );\n}\n"],"names":["FormExport","i18n","f","onClick","FCard","getComponent","jsx","jsxs","Icon"],"mappings":";;;AASO,SAASA,EAAW,EAAE,MAAAC,IAAO,CAACC,MAAcA,GAAG,SAAAC,KAA4B;AAChF,QAAMC,IAAQC,EAA0B,MAAM;AAE9C,SACE,gBAAAC,EAAC,OAAA,EACC,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAW,cACd,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAW,YACd,UAAA,gBAAAC;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,OAEI,gBAAAG,EAAC,QAAA,EAAK,WAAW,qBACf,UAAA;AAAA,UAAA,gBAAAD,EAACE,GAAA,EAAK,MAAM,UAAU,WAAW,uBAAuB;AAAA,UAAE;AAAA,UAAEP,EAAK,eAAe;AAAA,QAAA,GAClF;AAAA,QAIJ,UAAA;AAAA,UAAA,gBAAAK,EAAC,KAAA,EAAE,WAAW,QAAS,UAAAL,EAAK,2BAA2B,GAAE;AAAA,UACzD,gBAAAK,EAAC,OAAA,EAAI,WAAW,oCACd,UAAA,gBAAAC,EAAC,UAAA,EAAO,WAAW,mBAAmB,SAAS,MAAMJ,IAAU,eAAe,MAAM,GAClF,UAAA;AAAA,YAAA,gBAAAG,EAACE,GAAA,EAAK,MAAM,QAAQ,WAAW,QAAQ;AAAA,YAAE;AAAA,YAAEP,EAAK,MAAM;AAAA,UAAA,EAAA,CACxD,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,IACA,gBAAAK,EAAC,OAAA,EAAI,WAAW,YACd,UAAA,gBAAAC;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,OAEI,gBAAAG,EAAC,QAAA,EAAK,WAAW,qBACf,UAAA;AAAA,UAAA,gBAAAD,EAACE,GAAA,EAAK,MAAM,QAAQ,WAAW,uBAAuB;AAAA,UAAE;AAAA,UAAEP,EAAK,oBAAoB;AAAA,QAAA,GACrF;AAAA,QAIJ,UAAA;AAAA,UAAA,gBAAAK,EAAC,KAAA,EAAE,WAAW,QAAS,UAAAL,EAAK,uCAAuC,GAAE;AAAA,UACrE,gBAAAM,EAAC,OAAA,EAAI,WAAW,oCACd,UAAA;AAAA,YAAA,gBAAAA,EAAC,UAAA,EAAO,WAAW,wBAAwB,SAAS,MAAMJ,IAAU,sBAAsB,MAAM,GAC9F,UAAA;AAAA,cAAA,gBAAAG,EAACE,GAAA,EAAK,MAAM,QAAQ,WAAW,QAAQ;AAAA,cAAE;AAAA,cAAEP,EAAK,MAAM;AAAA,YAAA,GACxD;AAAA,YACA,gBAAAM,EAAC,YAAO,WAAW,mBAAmB,SAAS,MAAMJ,IAAU,sBAAsB,KAAK,GACxF,UAAA;AAAA,cAAA,gBAAAG,EAACE,GAAA,EAAK,MAAM,eAAe,WAAW,QAAQ;AAAA,cAAE;AAAA,cAAEP,EAAK,KAAK;AAAA,YAAA,EAAA,CAC9D;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,EACF,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { getComponent as m } from "../../../registries/components.js";
|
|
3
|
+
import { Form as a } from "../Form.js";
|
|
4
|
+
function l({ form: e, i18n: t = (r) => r }) {
|
|
5
|
+
const r = m("Card");
|
|
6
|
+
return /* @__PURE__ */ o("div", { className: "p-10 bg-gray-500", children: /* @__PURE__ */ o(r, { label: t(e.title || ""), className: "shadow", children: /* @__PURE__ */ o(a, { form: e, options: { i18n: t } }) }) });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
l as FormPreview
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=FormPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormPreview.js","sources":["../../../../src/organisms/form/preview/FormPreview.tsx"],"sourcesContent":["import type { FormType } from \"../../../interfaces/index.js\";\nimport type { Card } from \"../../../molecules/card/Card.js\";\nimport { getComponent } from \"../../../registries/components.js\";\nimport { Form } from \"../Form.js\";\n\nexport interface FormPreviewProps {\n form: FormType;\n i18n?: (key: string) => string;\n}\n\nexport function FormPreview({ form, i18n = (f) => f }: FormPreviewProps) {\n const FCard = getComponent<typeof Card>(\"Card\");\n\n return (\n <div className='p-10 bg-gray-500'>\n <FCard label={i18n(form.title || \"\")} className={\"shadow\"}>\n <Form form={form} options={{ i18n }} />\n </FCard>\n </div>\n );\n}\n"],"names":["FormPreview","form","i18n","f","FCard","getComponent","jsx","Form"],"mappings":";;;AAUO,SAASA,EAAY,EAAE,MAAAC,GAAM,MAAAC,IAAO,CAACC,MAAMA,KAAuB;AACvE,QAAMC,IAAQC,EAA0B,MAAM;AAE9C,SACE,gBAAAC,EAAC,SAAI,WAAU,oBACb,4BAACF,GAAA,EAAM,OAAOF,EAAKD,EAAK,SAAS,EAAE,GAAG,WAAW,UAC/C,4BAACM,GAAA,EAAK,MAAAN,GAAY,SAAS,EAAE,MAAAC,EAAA,GAAQ,EAAA,CACvC,EAAA,CACF;AAEJ;"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as S, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import g from "lodash/isEqual";
|
|
3
3
|
import l from "lodash/noop";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Form as
|
|
6
|
-
import { getFormSettingsSchema as
|
|
7
|
-
import { formSettingsToSubmission as
|
|
8
|
-
function
|
|
9
|
-
const o =
|
|
10
|
-
|
|
4
|
+
import { useState as d, useEffect as f } from "react";
|
|
5
|
+
import { Form as h } from "../Form.js";
|
|
6
|
+
import { getFormSettingsSchema as F } from "./FormSettings.schema.js";
|
|
7
|
+
import { formSettingsToSubmission as b, submissionToFormSettings as y } from "./FormSettings.utils.js";
|
|
8
|
+
function x({ form: t, onSubmit: r = l, options: e }) {
|
|
9
|
+
const o = F(), [u, i] = d(!0), [s, m] = d(() => b(t)), a = ({ data: n, isValid: c }) => {
|
|
10
|
+
c && m({ data: n }), i(c);
|
|
11
11
|
};
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
}, [
|
|
12
|
+
return f(() => {
|
|
13
|
+
const n = b(t);
|
|
14
|
+
t?._id && !g(s.data, n.data) && m(n);
|
|
15
|
+
}, [t?._id]), {
|
|
16
16
|
options: e,
|
|
17
17
|
form: o,
|
|
18
|
-
type:
|
|
19
|
-
submission:
|
|
20
|
-
onChange:
|
|
21
|
-
isValid:
|
|
22
|
-
setIsValid:
|
|
18
|
+
type: t.type,
|
|
19
|
+
submission: s,
|
|
20
|
+
onChange: a,
|
|
21
|
+
isValid: u,
|
|
22
|
+
setIsValid: i,
|
|
23
23
|
onSubmit: () => {
|
|
24
|
-
|
|
24
|
+
r(y(t, s));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const { form:
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
28
|
+
function k(t) {
|
|
29
|
+
const { form: r, submission: e, options: o = {}, onChange: u, onSubmit: i, isValid: s } = x(t), m = o.i18n || ((a) => a);
|
|
30
|
+
return /* @__PURE__ */ S("div", { children: [
|
|
31
|
+
/* @__PURE__ */ p(h, { form: r, submission: e, onChange: u, options: o }),
|
|
32
|
+
/* @__PURE__ */ p("button", { "data-testid": "submit", disabled: !s, className: "mt-5 btn btn-primary", onClick: i, type: "submit", children: m("Save settings") })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
k as FormSettings
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=FormSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSettings.js","sources":["../../../../src/organisms/form/settings/FormSettings.tsx"],"sourcesContent":["import isEqual from \"lodash/isEqual\";\nimport noop from \"lodash/noop\";\nimport { useEffect, useState } from \"react\";\n\nimport type { ChangedSubmission, FormOptions, FormType } from \"../../../interfaces\";\nimport { Form } from \"../../form/Form\";\nimport { getFormSettingsSchema } from \"./FormSettings.schema\";\nimport { formSettingsToSubmission, FormSettingsType, submissionToFormSettings } from \"./FormSettings.utils\";\n\nexport interface FormSettingsProps {\n form: Partial<FormType>;\n onSubmit?: Function;\n options?: FormOptions;\n}\n\nfunction useFormSettings({ form: formDefinition, onSubmit = noop, options }: FormSettingsProps) {\n const form = getFormSettingsSchema();\n const [isValid, setIsValid] = useState(true);\n const [submission, setSubmission] = useState(() => formSettingsToSubmission(formDefinition));\n\n const onChange = ({ data, isValid }: ChangedSubmission<FormSettingsType>) => {\n if (isValid) {\n setSubmission({ data });\n }\n setIsValid(isValid);\n };\n\n useEffect(() => {\n const input = formSettingsToSubmission(formDefinition);\n if (formDefinition?._id && !isEqual(submission.data, input.data)) {\n setSubmission(input);\n }\n }, [formDefinition?._id]);\n\n return {\n options,\n form,\n type: formDefinition.type,\n submission,\n onChange,\n isValid,\n setIsValid,\n onSubmit: () => {\n onSubmit(submissionToFormSettings(formDefinition, submission));\n }\n };\n}\n\nexport function FormSettings(props: FormSettingsProps) {\n const { form, submission, options = {}, onChange, onSubmit, isValid } = useFormSettings(props);\n\n const i18n = options.i18n || ((f: string) => f);\n\n return (\n <div>\n <Form<FormSettingsType> form={form} submission={submission} onChange={onChange} options={options} />\n\n <button data-testid='submit' disabled={!isValid} className={\"mt-5 btn btn-primary\"} onClick={onSubmit} type={\"submit\"}>\n {i18n(\"Save settings\")}\n </button>\n </div>\n );\n}\n"],"names":["useFormSettings","formDefinition","onSubmit","noop","options","form","getFormSettingsSchema","isValid","setIsValid","useState","submission","setSubmission","formSettingsToSubmission","onChange","data","useEffect","input","isEqual","submissionToFormSettings","FormSettings","props","i18n","f","jsx","Form"],"mappings":";;;;;;;AAeA,SAASA,EAAgB,EAAE,MAAMC,GAAgB,UAAAC,IAAWC,GAAM,SAAAC,KAA8B;AAC9F,QAAMC,IAAOC,
|
|
1
|
+
{"version":3,"file":"FormSettings.js","sources":["../../../../src/organisms/form/settings/FormSettings.tsx"],"sourcesContent":["import isEqual from \"lodash/isEqual\";\nimport noop from \"lodash/noop\";\nimport { useEffect, useState } from \"react\";\n\nimport type { ChangedSubmission, FormOptions, FormType } from \"../../../interfaces\";\nimport { Form } from \"../../form/Form\";\nimport { getFormSettingsSchema } from \"./FormSettings.schema\";\nimport { formSettingsToSubmission, FormSettingsType, submissionToFormSettings } from \"./FormSettings.utils\";\n\nexport interface FormSettingsProps {\n form: Partial<FormType>;\n onSubmit?: Function;\n options?: FormOptions;\n}\n\nfunction useFormSettings({ form: formDefinition, onSubmit = noop, options }: FormSettingsProps) {\n const form = getFormSettingsSchema();\n const [isValid, setIsValid] = useState(true);\n const [submission, setSubmission] = useState(() => formSettingsToSubmission(formDefinition));\n\n const onChange = ({ data, isValid }: ChangedSubmission<FormSettingsType>) => {\n if (isValid) {\n setSubmission({ data });\n }\n setIsValid(isValid);\n };\n\n useEffect(() => {\n const input = formSettingsToSubmission(formDefinition);\n if (formDefinition?._id && !isEqual(submission.data, input.data)) {\n setSubmission(input);\n }\n }, [formDefinition?._id]);\n\n return {\n options,\n form,\n type: formDefinition.type,\n submission,\n onChange,\n isValid,\n setIsValid,\n onSubmit: () => {\n onSubmit(submissionToFormSettings(formDefinition, submission));\n }\n };\n}\n\nexport function FormSettings(props: FormSettingsProps) {\n const { form, submission, options = {}, onChange, onSubmit, isValid } = useFormSettings(props);\n\n const i18n = options.i18n || ((f: string) => f);\n\n return (\n <div>\n <Form<FormSettingsType> form={form} submission={submission} onChange={onChange} options={options} />\n\n <button data-testid='submit' disabled={!isValid} className={\"mt-5 btn btn-primary\"} onClick={onSubmit} type={\"submit\"}>\n {i18n(\"Save settings\")}\n </button>\n </div>\n );\n}\n"],"names":["useFormSettings","formDefinition","onSubmit","noop","options","form","getFormSettingsSchema","isValid","setIsValid","useState","submission","setSubmission","formSettingsToSubmission","onChange","data","useEffect","input","isEqual","submissionToFormSettings","FormSettings","props","i18n","f","jsx","Form"],"mappings":";;;;;;;AAeA,SAASA,EAAgB,EAAE,MAAMC,GAAgB,UAAAC,IAAWC,GAAM,SAAAC,KAA8B;AAC9F,QAAMC,IAAOC,EAAA,GACP,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAI,GACrC,CAACC,GAAYC,CAAa,IAAIF,EAAS,MAAMG,EAAyBX,CAAc,CAAC,GAErFY,IAAW,CAAC,EAAE,MAAAC,GAAM,SAAAP,QAAmD;AAC3E,IAAIA,KACFI,EAAc,EAAE,MAAAG,GAAM,GAExBN,EAAWD,CAAO;AAAA,EACpB;AAEA,SAAAQ,EAAU,MAAM;AACd,UAAMC,IAAQJ,EAAyBX,CAAc;AACrD,IAAIA,GAAgB,OAAO,CAACgB,EAAQP,EAAW,MAAMM,EAAM,IAAI,KAC7DL,EAAcK,CAAK;AAAA,EAEvB,GAAG,CAACf,GAAgB,GAAG,CAAC,GAEjB;AAAA,IACL,SAAAG;AAAA,IACA,MAAAC;AAAA,IACA,MAAMJ,EAAe;AAAA,IACrB,YAAAS;AAAA,IACA,UAAAG;AAAA,IACA,SAAAN;AAAA,IACA,YAAAC;AAAA,IACA,UAAU,MAAM;AACd,MAAAN,EAASgB,EAAyBjB,GAAgBS,CAAU,CAAC;AAAA,IAC/D;AAAA,EAAA;AAEJ;AAEO,SAASS,EAAaC,GAA0B;AACrD,QAAM,EAAE,MAAAf,GAAM,YAAAK,GAAY,SAAAN,IAAU,CAAA,GAAI,UAAAS,GAAU,UAAAX,GAAU,SAAAK,EAAA,IAAYP,EAAgBoB,CAAK,GAEvFC,IAAOjB,EAAQ,SAAS,CAACkB,MAAcA;AAE7C,2BACG,OAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAuB,MAAAnB,GAAY,YAAAK,GAAwB,UAAAG,GAAoB,SAAAT,GAAkB;AAAA,IAElG,gBAAAmB,EAAC,UAAA,EAAO,eAAY,UAAS,UAAU,CAAChB,GAAS,WAAW,wBAAwB,SAASL,GAAU,MAAM,UAC1G,UAAAmB,EAAK,eAAe,EAAA,CACvB;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSettings.schema.js","sources":["../../../../src/organisms/form/settings/FormSettings.schema.ts"],"sourcesContent":["import type { FormType } from \"../../../interfaces\";\n\nexport function getFormSettingsSchema(): FormType {\n return {\n type: \"form\",\n tags: [],\n components: [\n {\n input: true,\n key: \"action\",\n placeholder: \"Enter the custom submission URL\",\n label: \"Custom Action Url\",\n labelPosition: \"top\",\n widget: { type: \"input\" },\n type: \"url\",\n mask: false,\n inputType: \"url\",\n inputFormat: \"plain\",\n spellcheck: true,\n id: \"efyrzea\",\n attributes: {\n \"data-testid\": \"action\"\n }\n },\n {\n input: true,\n key: \"tags\",\n placeholder: \"Add tags\",\n label: \"Form tags\",\n widget: { type: \"input\" },\n type: \"tags\",\n delimeter: \",\",\n storeas: \"array\",\n maxTags: 0,\n id: \"erxcyw\"\n },\n {\n input: true,\n key: \"properties\",\n label: \"Custom Properties\",\n labelPosition: \"top\",\n type: \"datamap\",\n addAnother: \"Add Another\",\n disableAddingRemovingRows: false,\n keyBeforeValue: true,\n valueComponent: {\n type: \"textfield\",\n key: \"value\",\n label: \"Value\",\n input: true,\n hideLabel: true\n },\n id: \"ezne35\"\n }\n ],\n display: \"form\"\n };\n}\n"],"names":["getFormSettingsSchema"],"mappings":"AAEO,SAASA,IAAkC;
|
|
1
|
+
{"version":3,"file":"FormSettings.schema.js","sources":["../../../../src/organisms/form/settings/FormSettings.schema.ts"],"sourcesContent":["import type { FormType } from \"../../../interfaces\";\n\nexport function getFormSettingsSchema(): FormType {\n return {\n type: \"form\",\n tags: [],\n components: [\n {\n input: true,\n key: \"action\",\n placeholder: \"Enter the custom submission URL\",\n label: \"Custom Action Url\",\n labelPosition: \"top\",\n widget: { type: \"input\" },\n type: \"url\",\n mask: false,\n inputType: \"url\",\n inputFormat: \"plain\",\n spellcheck: true,\n id: \"efyrzea\",\n attributes: {\n \"data-testid\": \"action\"\n }\n },\n {\n input: true,\n key: \"tags\",\n placeholder: \"Add tags\",\n label: \"Form tags\",\n widget: { type: \"input\" },\n type: \"tags\",\n delimeter: \",\",\n storeas: \"array\",\n maxTags: 0,\n id: \"erxcyw\"\n },\n {\n input: true,\n key: \"properties\",\n label: \"Custom Properties\",\n labelPosition: \"top\",\n type: \"datamap\",\n addAnother: \"Add Another\",\n disableAddingRemovingRows: false,\n keyBeforeValue: true,\n valueComponent: {\n type: \"textfield\",\n key: \"value\",\n label: \"Value\",\n input: true,\n hideLabel: true\n },\n id: \"ezne35\"\n }\n ],\n display: \"form\"\n };\n}\n"],"names":["getFormSettingsSchema"],"mappings":"AAEO,SAASA,IAAkC;AAChD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,CAAA;AAAA,IACN,YAAY;AAAA,MACV;AAAA,QACE,OAAO;AAAA,QACP,KAAK;AAAA,QACL,aAAa;AAAA,QACb,OAAO;AAAA,QACP,eAAe;AAAA,QACf,QAAQ,EAAE,MAAM,QAAA;AAAA,QAChB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,WAAW;AAAA,QACX,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,IAAI;AAAA,QACJ,YAAY;AAAA,UACV,eAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MAEF;AAAA,QACE,OAAO;AAAA,QACP,KAAK;AAAA,QACL,aAAa;AAAA,QACb,OAAO;AAAA,QACP,QAAQ,EAAE,MAAM,QAAA;AAAA,QAChB,MAAM;AAAA,QACN,WAAW;AAAA,QACX,SAAS;AAAA,QACT,SAAS;AAAA,QACT,IAAI;AAAA,MAAA;AAAA,MAEN;AAAA,QACE,OAAO;AAAA,QACP,KAAK;AAAA,QACL,OAAO;AAAA,QACP,eAAe;AAAA,QACf,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,2BAA2B;AAAA,QAC3B,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,KAAK;AAAA,UACL,OAAO;AAAA,UACP,OAAO;AAAA,UACP,WAAW;AAAA,QAAA;AAAA,QAEb,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,SAAS;AAAA,EAAA;AAEb;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSettings.utils.js","sources":["../../../../src/organisms/form/settings/FormSettings.utils.ts"],"sourcesContent":["import cloneDeep from \"lodash/cloneDeep\";\n\nimport { FormType, SubmissionType } from \"../../../interfaces\";\n\nexport type FormSettingsType = {\n action: string;\n tags: string[];\n properties: Record<string, any>;\n};\n\nexport function formSettingsToSubmission(form: Partial<FormType>): SubmissionType<FormSettingsType> {\n return {\n data: {\n action: form.action!,\n tags: form.tags!,\n properties: form.properties!\n }\n };\n}\n\nexport function submissionToFormSettings(form: Partial<FormType>, submission: SubmissionType<FormSettingsType>): Partial<FormType> {\n return {\n ...cloneDeep(form),\n tags: submission.data.tags,\n action: submission.data.action,\n properties: submission.data.properties\n };\n}\n"],"names":["formSettingsToSubmission","form","submissionToFormSettings","submission","cloneDeep"],"mappings":";AAUO,SAASA,EAAyBC,GAA2D;
|
|
1
|
+
{"version":3,"file":"FormSettings.utils.js","sources":["../../../../src/organisms/form/settings/FormSettings.utils.ts"],"sourcesContent":["import cloneDeep from \"lodash/cloneDeep\";\n\nimport { FormType, SubmissionType } from \"../../../interfaces\";\n\nexport type FormSettingsType = {\n action: string;\n tags: string[];\n properties: Record<string, any>;\n};\n\nexport function formSettingsToSubmission(form: Partial<FormType>): SubmissionType<FormSettingsType> {\n return {\n data: {\n action: form.action!,\n tags: form.tags!,\n properties: form.properties!\n }\n };\n}\n\nexport function submissionToFormSettings(form: Partial<FormType>, submission: SubmissionType<FormSettingsType>): Partial<FormType> {\n return {\n ...cloneDeep(form),\n tags: submission.data.tags,\n action: submission.data.action,\n properties: submission.data.properties\n };\n}\n"],"names":["formSettingsToSubmission","form","submissionToFormSettings","submission","cloneDeep"],"mappings":";AAUO,SAASA,EAAyBC,GAA2D;AAClG,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,QAAQA,EAAK;AAAA,MACb,MAAMA,EAAK;AAAA,MACX,YAAYA,EAAK;AAAA,IAAA;AAAA,EACnB;AAEJ;AAEO,SAASC,EAAyBD,GAAyBE,GAAiE;AACjI,SAAO;AAAA,IACL,GAAGC,EAAUH,CAAI;AAAA,IACjB,MAAME,EAAW,KAAK;AAAA,IACtB,QAAQA,EAAW,KAAK;AAAA,IACxB,YAAYA,EAAW,KAAK;AAAA,EAAA;AAEhC;"}
|