@tsed/react-formio 3.0.0-alpha.12 → 3.0.0-alpha.13
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/all.d.ts +0 -0
- package/dist/all.js +38 -0
- package/dist/all.js.map +1 -0
- package/dist/chunks/_commonjsHelpers.js +30 -3
- package/dist/chunks/_commonjsHelpers.js.map +1 -1
- package/dist/chunks/index2.js +56953 -0
- package/dist/chunks/index2.js.map +1 -0
- package/dist/contexts/FormioContext.d.ts +20 -0
- package/dist/contexts/FormioContext.js +40 -0
- package/dist/contexts/FormioContext.js.map +1 -0
- package/dist/hooks/useFormioContext.d.ts +10 -0
- package/dist/hooks/useFormioContext.js +12 -0
- package/dist/hooks/useFormioContext.js.map +1 -0
- package/dist/hooks/useI18n.d.ts +4 -0
- package/dist/hooks/useI18n.js +9 -0
- package/dist/hooks/useI18n.js.map +1 -0
- package/dist/index.d.ts +1 -6
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ComponentType.d.ts +6 -2
- package/dist/interfaces/FormBuilderOptions.d.ts +7 -0
- package/dist/interfaces/FormBuilderOptions.js +2 -0
- package/dist/interfaces/FormBuilderOptions.js.map +1 -0
- package/dist/interfaces/FormOptions.d.ts +6 -13
- package/dist/interfaces/FormType.d.ts +4 -11
- package/dist/interfaces/SubmissionType.d.ts +5 -10
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +19 -19
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js +16 -16
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -1
- package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -1
- package/dist/molecules/modal/Modal.js +6 -6
- package/dist/molecules/modal/Modal.js.map +1 -1
- package/dist/molecules/pagination/Pagination.d.ts +2 -1
- package/dist/molecules/pagination/Pagination.js +24 -24
- package/dist/molecules/pagination/Pagination.js.map +1 -1
- package/dist/molecules/table/Table.js +27 -27
- package/dist/molecules/table/Table.js.map +1 -1
- package/dist/molecules/table/hooks/useTable.d.ts +3 -3
- package/dist/molecules/table/hooks/useTable.js +13 -12
- package/dist/molecules/table/hooks/useTable.js.map +1 -1
- package/dist/molecules/table/utils/mapFormToColumns.js +22 -22
- package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -1
- package/dist/molecules/tabs/TabsLegacy.d.ts +3 -2
- package/dist/molecules/tabs/TabsLegacy.js +30 -30
- package/dist/molecules/tabs/TabsLegacy.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.schema.js +1 -0
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -1
- package/dist/organisms/form/actions/FormAction.js +14 -11
- package/dist/organisms/form/actions/FormAction.js.map +1 -1
- package/dist/organisms/form/builder/FormEdit.d.ts +4 -3
- package/dist/organisms/form/builder/FormEdit.js +36 -36
- package/dist/organisms/form/builder/FormEdit.js.map +1 -1
- package/dist/organisms/form/builder/FormEditCtas.d.ts +2 -2
- package/dist/organisms/form/builder/FormEditCtas.js +14 -13
- package/dist/organisms/form/builder/FormEditCtas.js.map +1 -1
- package/dist/organisms/form/builder/useFormBuilder.d.ts +4 -4
- package/dist/organisms/form/builder/useFormBuilder.js +12 -12
- package/dist/organisms/form/builder/useFormBuilder.js.map +1 -1
- package/dist/organisms/form/builder/useFormEdit.d.ts +1 -1
- package/dist/organisms/form/exports/FormExport.d.ts +3 -2
- package/dist/organisms/form/exports/FormExport.js +21 -20
- package/dist/organisms/form/exports/FormExport.js.map +1 -1
- package/dist/organisms/form/preview/FormPreview.d.ts +3 -3
- package/dist/organisms/form/preview/FormPreview.js +5 -4
- package/dist/organisms/form/preview/FormPreview.js.map +1 -1
- package/dist/organisms/form/settings/FormSettings.js +21 -21
- package/dist/organisms/form/settings/FormSettings.js.map +1 -1
- package/dist/organisms/form/useForm.d.ts +2 -1
- package/dist/organisms/form/useForm.js +2 -2
- package/dist/organisms/form/useForm.js.map +1 -1
- package/dist/organisms/table/actions/ActionsTable.d.ts +2 -1
- package/dist/organisms/table/actions/ActionsTable.js +10 -9
- package/dist/organisms/table/actions/ActionsTable.js.map +1 -1
- package/dist/organisms/table/forms/FormsTable.d.ts +1 -1
- package/dist/organisms/table/forms/FormsTable.js +9 -8
- package/dist/organisms/table/forms/FormsTable.js.map +1 -1
- package/dist/organisms/table/forms/components/FormsCell.js +10 -10
- package/dist/organisms/views/FormViews.d.ts +3 -3
- package/dist/organisms/views/FormViews.js +47 -46
- package/dist/organisms/views/FormViews.js.map +1 -1
- package/dist/utils/iconClass.js +4 -5
- package/dist/utils/iconClass.js.map +1 -1
- package/package.json +3 -3
- package/src/all.ts +34 -0
- package/src/contexts/FormioContext.tsx +96 -0
- package/src/hooks/useFormioContext.ts +13 -0
- package/src/hooks/useI18n.ts +9 -0
- package/src/index.ts +17 -13
- package/src/interfaces/ComponentType.ts +2 -2
- package/src/interfaces/FormBuilderOptions.ts +9 -0
- package/src/interfaces/FormOptions.ts +7 -13
- package/src/interfaces/FormType.ts +5 -11
- package/src/interfaces/SubmissionType.ts +9 -8
- package/src/interfaces/index.ts +1 -0
- package/src/molecules/forms/form-control/FormControl.spec.tsx +5 -2
- package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +4 -4
- package/src/molecules/forms/select/components/ChoicesSelect.tsx +2 -2
- package/src/molecules/pagination/Pagination.tsx +10 -9
- package/src/molecules/table/Table.stories.tsx +6 -6
- package/src/molecules/table/Table.tsx +1 -1
- package/src/molecules/table/hooks/useTable.tsx +7 -6
- package/src/molecules/table/utils/mapFormToColumns.tsx +6 -5
- package/src/molecules/tabs/TabsLegacy.stories.tsx +1 -1
- package/src/molecules/tabs/TabsLegacy.tsx +5 -3
- package/src/organisms/form/Form.stories.tsx +4 -0
- package/src/organisms/form/access/FormAccess.schema.ts +1 -0
- package/src/organisms/form/access/FormAccess.stories.tsx +3 -1
- package/src/organisms/form/actions/FormAction.stories.tsx +5 -1
- package/src/organisms/form/actions/FormAction.tsx +2 -2
- package/src/organisms/form/builder/FormEdit.stories.tsx +10 -6
- package/src/organisms/form/builder/FormEdit.tsx +6 -6
- package/src/organisms/form/builder/FormEditCtas.tsx +10 -10
- package/src/organisms/form/builder/useFormBuilder.ts +7 -6
- package/src/organisms/form/exports/FormExport.stories.tsx +8 -11
- package/src/organisms/form/exports/FormExport.tsx +12 -9
- package/src/organisms/form/preview/FormPreview.stories.tsx +6 -9
- package/src/organisms/form/preview/FormPreview.tsx +7 -5
- package/src/organisms/form/settings/FormSettings.component.spec.tsx +3 -1
- package/src/organisms/form/settings/FormSettings.stories.tsx +1 -1
- package/src/organisms/form/settings/FormSettings.tsx +6 -6
- package/src/organisms/form/useForm.ts +2 -3
- package/src/organisms/table/actions/ActionsTable.tsx +7 -5
- package/src/organisms/table/forms/FormsTable.tsx +6 -5
- package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +10 -13
- package/src/organisms/views/FormViews.stories.tsx +13 -16
- package/src/organisms/views/FormViews.tsx +18 -16
- package/src/utils/iconClass.ts +1 -3
- package/dist/typings.d.js +0 -2
- package/dist/typings.d.js.map +0 -1
- package/src/typings.d.ts +0 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Formio as ImportedFormio } from '@formio/js';
|
|
2
|
+
type BaseConfigurationArgs = {
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
projectUrl?: string;
|
|
5
|
+
Formio?: typeof ImportedFormio;
|
|
6
|
+
};
|
|
7
|
+
export declare const FormioContext: import('react').Context<({
|
|
8
|
+
Formio: any;
|
|
9
|
+
baseUrl: any;
|
|
10
|
+
projectUrl: any;
|
|
11
|
+
} & {
|
|
12
|
+
token: any;
|
|
13
|
+
setToken: import('react').Dispatch<any>;
|
|
14
|
+
isAuthenticated: boolean;
|
|
15
|
+
logout: () => Promise<void>;
|
|
16
|
+
}) | null>;
|
|
17
|
+
export declare function FormioProvider({ children, baseUrl, projectUrl, Formio }: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
} & BaseConfigurationArgs): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "../chunks/index2.js";
|
|
3
|
+
import { createContext as g, useState as c, useEffect as U } from "react";
|
|
4
|
+
const m = ({ baseUrl: t, projectUrl: o, Formio: e }) => e ? (t && e.setBaseUrl(t), o && e.setProjectUrl(o), {
|
|
5
|
+
Formio: e,
|
|
6
|
+
baseUrl: e.baseUrl,
|
|
7
|
+
projectUrl: e.projectUrl
|
|
8
|
+
}) : (t && r.Formio.setBaseUrl(t), o && r.Formio.setProjectUrl(o), {
|
|
9
|
+
Formio: r.Formio,
|
|
10
|
+
baseUrl: r.Formio.baseUrl,
|
|
11
|
+
projectUrl: r.Formio.projectUrl
|
|
12
|
+
}), d = ({ Formio: t }) => {
|
|
13
|
+
const [o, e] = c(t.getToken() || null), [s, n] = c(!!o);
|
|
14
|
+
return U(() => {
|
|
15
|
+
const u = async (l) => {
|
|
16
|
+
l ? (e(t.getToken()), n(!0)) : s && (await t.logout(), e(null), n(!1));
|
|
17
|
+
}, i = async () => {
|
|
18
|
+
s && (await t.currentUser() || (e(null), n(!1)));
|
|
19
|
+
};
|
|
20
|
+
return t.events.on("formio.user", u), i(), () => {
|
|
21
|
+
t.events.off("formio.user", u);
|
|
22
|
+
};
|
|
23
|
+
}, [s, t]), { token: o, setToken: e, isAuthenticated: s, logout: async () => {
|
|
24
|
+
await t.logout(), e(null), n(!1);
|
|
25
|
+
} };
|
|
26
|
+
}, h = g(null);
|
|
27
|
+
function k({
|
|
28
|
+
children: t,
|
|
29
|
+
baseUrl: o,
|
|
30
|
+
projectUrl: e,
|
|
31
|
+
Formio: s
|
|
32
|
+
}) {
|
|
33
|
+
const n = m({ baseUrl: o, projectUrl: e, Formio: s }), a = d({ Formio: n.Formio }), u = { ...n, ...a };
|
|
34
|
+
return /* @__PURE__ */ f(h.Provider, { value: u, children: t });
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
h as FormioContext,
|
|
38
|
+
k as FormioProvider
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=FormioContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormioContext.js","sources":["../../src/contexts/FormioContext.tsx"],"sourcesContent":["import { Formio as ImportedFormio } from \"@formio/js\";\nimport { createContext, useEffect, useState } from \"react\";\n\ntype BaseConfigurationArgs = {\n baseUrl?: string;\n projectUrl?: string;\n Formio?: typeof ImportedFormio;\n};\n\nconst useBaseConfiguration = ({ baseUrl, projectUrl, Formio }: BaseConfigurationArgs) => {\n if (!Formio) {\n if (baseUrl) {\n ImportedFormio.setBaseUrl(baseUrl);\n }\n if (projectUrl) {\n ImportedFormio.setProjectUrl(projectUrl);\n }\n return {\n Formio: ImportedFormio,\n baseUrl: ImportedFormio.baseUrl,\n projectUrl: ImportedFormio.projectUrl\n };\n }\n\n if (baseUrl) {\n Formio.setBaseUrl(baseUrl);\n }\n if (projectUrl) {\n Formio.setProjectUrl(projectUrl);\n }\n\n return {\n Formio,\n baseUrl: Formio.baseUrl,\n projectUrl: Formio.projectUrl\n };\n};\n\nconst useAuthentication = ({ Formio }: { Formio: typeof ImportedFormio }) => {\n const [token, setToken] = useState(Formio.getToken() || null);\n const [isAuthenticated, setIsAuthenticated] = useState(!!token);\n\n useEffect(() => {\n const handleUserEvent = async (user: unknown) => {\n if (user) {\n setToken(Formio.getToken());\n setIsAuthenticated(true);\n } else if (isAuthenticated) {\n await Formio.logout();\n setToken(null);\n setIsAuthenticated(false);\n }\n };\n\n const handleStaleToken = async () => {\n if (isAuthenticated) {\n const user = await Formio.currentUser();\n if (!user) {\n setToken(null);\n setIsAuthenticated(false);\n }\n }\n };\n\n Formio.events.on(\"formio.user\", handleUserEvent);\n handleStaleToken();\n\n return () => {\n Formio.events.off(\"formio.user\", handleUserEvent);\n };\n }, [isAuthenticated, Formio]);\n\n const logout = async () => {\n await Formio.logout();\n setToken(null);\n setIsAuthenticated(false);\n };\n\n return { token, setToken, isAuthenticated, logout };\n};\n\nexport const FormioContext = createContext<(ReturnType<typeof useBaseConfiguration> & ReturnType<typeof useAuthentication>) | null>(null);\n\nexport function FormioProvider({\n children,\n baseUrl,\n projectUrl,\n Formio\n}: {\n children: React.ReactNode;\n} & BaseConfigurationArgs) {\n const baseConfig = useBaseConfiguration({ baseUrl, projectUrl, Formio });\n const auth = useAuthentication({ Formio: baseConfig.Formio });\n const formio = { ...baseConfig, ...auth };\n return <FormioContext.Provider value={formio}>{children}</FormioContext.Provider>;\n}\n"],"names":["useBaseConfiguration","baseUrl","projectUrl","Formio","ImportedFormio","useAuthentication","token","setToken","useState","isAuthenticated","setIsAuthenticated","useEffect","handleUserEvent","user","handleStaleToken","FormioContext","createContext","FormioProvider","children","baseConfig","auth","formio"],"mappings":";;;AASA,MAAMA,IAAuB,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,QAAAC,QAC9CA,KAcDF,KACFE,EAAO,WAAWF,CAAO,GAEvBC,KACFC,EAAO,cAAcD,CAAU,GAG1B;AAAA,EACL,QAAAC;AAAA,EACA,SAASA,EAAO;AAAA,EAChB,YAAYA,EAAO;AAAA,MAvBfF,KACFG,EAAAA,OAAe,WAAWH,CAAO,GAE/BC,KACFE,EAAAA,OAAe,cAAcF,CAAU,GAElC;AAAA,EACL,QAAQE,EAAAA;AAAAA,EACR,SAASA,EAAAA,OAAe;AAAA,EACxB,YAAYA,EAAAA,OAAe;AAAA,IAkB3BC,IAAoB,CAAC,EAAE,QAAAF,QAAgD;AAC3E,QAAM,CAACG,GAAOC,CAAQ,IAAIC,EAASL,EAAO,SAAA,KAAc,IAAI,GACtD,CAACM,GAAiBC,CAAkB,IAAIF,EAAS,CAAC,CAACF,CAAK;AAE9D,SAAAK,EAAU,MAAM;AACd,UAAMC,IAAkB,OAAOC,MAAkB;AAC/C,MAAIA,KACFN,EAASJ,EAAO,UAAU,GAC1BO,EAAmB,EAAI,KACdD,MACT,MAAMN,EAAO,OAAA,GACbI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,IAE5B,GAEMI,IAAmB,YAAY;AACnC,MAAIL,MACW,MAAMN,EAAO,YAAA,MAExBI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,IAG9B;AAEA,WAAAP,EAAO,OAAO,GAAG,eAAeS,CAAe,GAC/CE,EAAA,GAEO,MAAM;AACX,MAAAX,EAAO,OAAO,IAAI,eAAeS,CAAe;AAAA,IAClD;AAAA,EACF,GAAG,CAACH,GAAiBN,CAAM,CAAC,GAQrB,EAAE,OAAAG,GAAO,UAAAC,GAAU,iBAAAE,GAAiB,QAN5B,YAAY;AACzB,UAAMN,EAAO,OAAA,GACbI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,EAC1B,EAE2C;AAC7C,GAEaK,IAAgBC,EAAuG,IAAI;AAEjI,SAASC,EAAe;AAAA,EAC7B,UAAAC;AAAA,EACA,SAAAjB;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AACF,GAE2B;AACzB,QAAMgB,IAAanB,EAAqB,EAAE,SAAAC,GAAS,YAAAC,GAAY,QAAAC,GAAQ,GACjEiB,IAAOf,EAAkB,EAAE,QAAQc,EAAW,QAAQ,GACtDE,IAAS,EAAE,GAAGF,GAAY,GAAGC,EAAA;AACnC,2BAAQL,EAAc,UAAd,EAAuB,OAAOM,GAAS,UAAAH,GAAS;AAC1D;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { FormioContext as r } from "../contexts/FormioContext.js";
|
|
3
|
+
function i() {
|
|
4
|
+
const o = t(r);
|
|
5
|
+
if (!o)
|
|
6
|
+
throw new Error("useFormioContext must be used within a FormioProvider component.");
|
|
7
|
+
return o;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as useFormioContext
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useFormioContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormioContext.js","sources":["../../src/hooks/useFormioContext.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { FormioContext } from \"../contexts/FormioContext\";\n\nexport function useFormioContext() {\n const context = useContext(FormioContext);\n\n if (!context) {\n throw new Error(\"useFormioContext must be used within a FormioProvider component.\");\n }\n\n return context;\n}\n"],"names":["useFormioContext","context","useContext","FormioContext"],"mappings":";;AAIO,SAASA,IAAmB;AACjC,QAAMC,IAAUC,EAAWC,CAAa;AAExC,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,kEAAkE;AAGpF,SAAOA;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useI18n.js","sources":["../../src/hooks/useI18n.ts"],"sourcesContent":["import type { FormOptions } from \"../interfaces/index.js\";\n\nexport function useI18n(labels?: FormOptions[\"i18n\"]) {\n return {\n t: (key: string, defaultValue: string = key) => {\n return labels?.[key] || defaultValue;\n }\n };\n}\n"],"names":["useI18n","labels","key","defaultValue"],"mappings":"AAEO,SAASA,EAAQC,GAA8B;AACpD,SAAO;AAAA,IACL,GAAG,CAACC,GAAaC,IAAuBD,MAC/BD,IAASC,CAAG,KAAKC;AAAA,EAC1B;AAEJ;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import { default as Webform } from 'formiojs/Webform';
|
|
2
|
-
import { default as WebformBuilder } from 'formiojs/WebformBuilder';
|
|
3
|
-
import { default as Wizard } from 'formiojs/Wizard';
|
|
4
|
-
import { default as WizardBuilder } from 'formiojs/WizardBuilder';
|
|
5
|
-
export { Webform, WebformBuilder, Wizard, WizardBuilder };
|
|
6
1
|
export * from './interfaces';
|
|
7
|
-
export { Components, Formio, Templates, Utils } from '
|
|
2
|
+
export { Builders, Components, DefaultEvaluator, Displays, EventEmitter, Form, FormBuilder, Formio, Licenses, Providers, registerModule, Templates, useModule, Utils, Webform, Widgets } from '@formio/js';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { default as m } from "formiojs/Wizard";
|
|
4
|
-
import { default as l } from "formiojs/WizardBuilder";
|
|
5
|
-
import { Components as s, Formio as i, Templates as u, Utils as x } from "formiojs";
|
|
1
|
+
import { c as s } from "./chunks/index2.js";
|
|
2
|
+
const t = s.Builders, e = s.Components, r = s.DefaultEvaluator, n = s.Displays, i = s.EventEmitter, c = s.Form, l = s.FormBuilder, m = s.Formio, u = s.Licenses, d = s.Providers, a = s.Templates, p = s.Utils, E = s.Webform, v = s.Widgets, F = s.registerModule, f = s.useModule;
|
|
6
3
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
t as Builders,
|
|
5
|
+
e as Components,
|
|
6
|
+
r as DefaultEvaluator,
|
|
7
|
+
n as Displays,
|
|
8
|
+
i as EventEmitter,
|
|
9
|
+
c as Form,
|
|
10
|
+
l as FormBuilder,
|
|
11
|
+
m as Formio,
|
|
12
|
+
u as Licenses,
|
|
13
|
+
d as Providers,
|
|
14
|
+
a as Templates,
|
|
15
|
+
p as Utils,
|
|
16
|
+
E as Webform,
|
|
17
|
+
v as Widgets,
|
|
18
|
+
F as registerModule,
|
|
19
|
+
f as useModule
|
|
15
20
|
};
|
|
16
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ComponentType =
|
|
1
|
+
import { Component } from '@formio/core';
|
|
2
|
+
export type ComponentType = Omit<Component, "components"> & {
|
|
3
|
+
components?: ComponentType[];
|
|
4
|
+
} & {
|
|
5
|
+
title?: string;
|
|
6
|
+
} & Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormBuilderOptions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
template?: string;
|
|
8
|
-
saveDraft?: boolean;
|
|
9
|
-
events?: EventEmitter2;
|
|
10
|
-
hooks?: {
|
|
11
|
-
customValidation?: Function;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
1
|
+
import { EventEmitter, Form } from '@formio/js';
|
|
2
|
+
import { FormType } from './FormType.js';
|
|
3
|
+
export type FormOptions = Form["options"] & {
|
|
4
|
+
events?: EventEmitter;
|
|
5
|
+
currentForm?: FormType;
|
|
6
|
+
};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
machineName?: string;
|
|
1
|
+
import { Form } from '@formio/core';
|
|
2
|
+
import { ComponentType } from './ComponentType.js';
|
|
3
|
+
export type FormType = Omit<Form, "components"> & {
|
|
7
4
|
components: ComponentType[];
|
|
8
|
-
|
|
9
|
-
action?: string;
|
|
10
|
-
properties?: Record<string, any>;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
5
|
+
} & Record<string, unknown>;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, Submission } from '@formio/core';
|
|
2
2
|
export type JSON = unknown | string | number | boolean | null | undefined | JSON[] | {
|
|
3
3
|
[key: string]: JSON;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type SubmissionType<Data extends {
|
|
6
6
|
[key: string]: JSON;
|
|
7
7
|
} = {
|
|
8
8
|
[key: string]: JSON;
|
|
9
|
-
}>
|
|
10
|
-
_id?: string;
|
|
9
|
+
}> = Omit<Partial<Submission>, "data"> & {
|
|
11
10
|
data: Data;
|
|
12
|
-
|
|
13
|
-
[key: string]: JSON;
|
|
14
|
-
};
|
|
15
|
-
state?: string;
|
|
16
|
-
}
|
|
11
|
+
};
|
|
17
12
|
export interface ChangedSubmission<Data extends {
|
|
18
13
|
[key: string]: JSON;
|
|
19
14
|
} = {
|
|
@@ -21,7 +16,7 @@ export interface ChangedSubmission<Data extends {
|
|
|
21
16
|
}> extends SubmissionType<Data> {
|
|
22
17
|
data: Data;
|
|
23
18
|
changed?: {
|
|
24
|
-
component:
|
|
19
|
+
component: Component;
|
|
25
20
|
instance: any;
|
|
26
21
|
value: unknown;
|
|
27
22
|
} & Record<string, JSON>;
|
|
@@ -10,10 +10,23 @@ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>
|
|
|
10
10
|
after?: import('react').ReactNode | string;
|
|
11
11
|
shadow?: boolean;
|
|
12
12
|
size?: "small" | string;
|
|
13
|
+
resource?: string | undefined | undefined;
|
|
14
|
+
type?: import('react').HTMLInputTypeAttribute | undefined;
|
|
15
|
+
placeholder?: string | undefined | undefined;
|
|
16
|
+
prefix?: string | undefined | undefined;
|
|
17
|
+
multiple?: boolean | undefined | undefined;
|
|
18
|
+
hidden?: boolean | undefined | undefined;
|
|
19
|
+
disabled?: boolean | undefined | undefined;
|
|
20
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
21
|
+
src?: string | undefined | undefined;
|
|
22
|
+
form?: string | undefined | undefined;
|
|
23
|
+
content?: string | undefined | undefined;
|
|
24
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
25
|
+
width?: number | string | undefined | undefined;
|
|
26
|
+
height?: number | string | undefined | undefined;
|
|
13
27
|
title?: string | undefined | undefined;
|
|
14
28
|
onClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
|
|
15
29
|
defaultChecked?: boolean | undefined | undefined;
|
|
16
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
17
30
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
18
31
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
19
32
|
accessKey?: string | undefined | undefined;
|
|
@@ -23,11 +36,9 @@ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>
|
|
|
23
36
|
contextMenu?: string | undefined | undefined;
|
|
24
37
|
dir?: string | undefined | undefined;
|
|
25
38
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
26
|
-
hidden?: boolean | undefined | undefined;
|
|
27
39
|
id?: string | undefined | undefined;
|
|
28
40
|
lang?: string | undefined | undefined;
|
|
29
41
|
nonce?: string | undefined | undefined;
|
|
30
|
-
placeholder?: string | undefined | undefined;
|
|
31
42
|
slot?: string | undefined | undefined;
|
|
32
43
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
33
44
|
style?: import('react').CSSProperties | undefined;
|
|
@@ -36,13 +47,10 @@ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>
|
|
|
36
47
|
radioGroup?: string | undefined | undefined;
|
|
37
48
|
role?: import('react').AriaRole | undefined;
|
|
38
49
|
about?: string | undefined | undefined;
|
|
39
|
-
content?: string | undefined | undefined;
|
|
40
50
|
datatype?: string | undefined | undefined;
|
|
41
51
|
inlist?: any;
|
|
42
|
-
prefix?: string | undefined | undefined;
|
|
43
52
|
property?: string | undefined | undefined;
|
|
44
53
|
rel?: string | undefined | undefined;
|
|
45
|
-
resource?: string | undefined | undefined;
|
|
46
54
|
rev?: string | undefined | undefined;
|
|
47
55
|
typeof?: string | undefined | undefined;
|
|
48
56
|
vocab?: string | undefined | undefined;
|
|
@@ -58,7 +66,6 @@ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>
|
|
|
58
66
|
results?: number | undefined | undefined;
|
|
59
67
|
security?: string | undefined | undefined;
|
|
60
68
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
61
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
62
69
|
is?: string | undefined | undefined;
|
|
63
70
|
'aria-activedescendant'?: string | undefined | undefined;
|
|
64
71
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -272,34 +279,27 @@ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>
|
|
|
272
279
|
onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
|
|
273
280
|
onTransitionEnd?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
|
|
274
281
|
onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
|
|
275
|
-
form?: string | undefined | undefined;
|
|
276
282
|
pattern?: string | undefined | undefined;
|
|
277
283
|
list?: string | undefined | undefined;
|
|
278
284
|
step?: number | string | undefined | undefined;
|
|
285
|
+
formAction?: string | undefined;
|
|
286
|
+
formEncType?: string | undefined | undefined;
|
|
287
|
+
formMethod?: string | undefined | undefined;
|
|
288
|
+
formNoValidate?: boolean | undefined | undefined;
|
|
289
|
+
formTarget?: string | undefined | undefined;
|
|
279
290
|
accept?: string | undefined | undefined;
|
|
280
291
|
alt?: string | undefined | undefined;
|
|
281
292
|
autoComplete?: string | undefined | undefined;
|
|
282
293
|
capture?: boolean | "user" | "environment" | undefined | undefined;
|
|
283
294
|
checked?: boolean | undefined | undefined;
|
|
284
295
|
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined | undefined;
|
|
285
|
-
disabled?: boolean | undefined | undefined;
|
|
286
296
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
287
|
-
formAction?: string | undefined;
|
|
288
|
-
formEncType?: string | undefined | undefined;
|
|
289
|
-
formMethod?: string | undefined | undefined;
|
|
290
|
-
formNoValidate?: boolean | undefined | undefined;
|
|
291
|
-
formTarget?: string | undefined | undefined;
|
|
292
|
-
height?: number | string | undefined | undefined;
|
|
293
297
|
max?: number | string | undefined | undefined;
|
|
294
298
|
maxLength?: number | undefined | undefined;
|
|
295
299
|
min?: number | string | undefined | undefined;
|
|
296
300
|
minLength?: number | undefined | undefined;
|
|
297
|
-
multiple?: boolean | undefined | undefined;
|
|
298
301
|
readOnly?: boolean | undefined | undefined;
|
|
299
302
|
required?: boolean | undefined | undefined;
|
|
300
|
-
src?: string | undefined | undefined;
|
|
301
|
-
type?: import('react').HTMLInputTypeAttribute | undefined;
|
|
302
|
-
width?: number | string | undefined | undefined;
|
|
303
303
|
};
|
|
304
304
|
ref: import('react').MutableRefObject<HTMLInputElement | null>;
|
|
305
305
|
instanceRef: import('react').MutableRefObject<Choices | null>;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { c as
|
|
5
|
-
import { registerComponent as
|
|
2
|
+
import g from "@formio/choices.js";
|
|
3
|
+
import { useRef as i, useEffect as C } from "react";
|
|
4
|
+
import { c as a } from "../../../../chunks/index.module.js";
|
|
5
|
+
import { registerComponent as I } from "../../../../registries/components.js";
|
|
6
6
|
import { cleanFormControlProps as E } from "../../form-control/FormControl.js";
|
|
7
7
|
function P(s) {
|
|
8
|
-
const { value: r, onChange: o, name: c = "", delimiter:
|
|
8
|
+
const { value: r, onChange: o, name: c = "", delimiter: u, customProperties: l, ...p } = s, m = i(null), n = i(null), f = a((e) => {
|
|
9
9
|
const t = (r || []).concat(e);
|
|
10
10
|
o?.(c, [...t]);
|
|
11
|
-
}, 100), d =
|
|
11
|
+
}, 100), d = a((e) => {
|
|
12
12
|
const t = (r || []).filter((v) => v !== e);
|
|
13
13
|
o?.(c, [...t]);
|
|
14
14
|
});
|
|
15
|
-
return
|
|
16
|
-
if (
|
|
17
|
-
const e = new
|
|
15
|
+
return C(() => {
|
|
16
|
+
if (m.current) {
|
|
17
|
+
const e = new g(m.current, {
|
|
18
18
|
duplicateItemsAllowed: !1,
|
|
19
|
-
...
|
|
20
|
-
delimiter:
|
|
19
|
+
...l,
|
|
20
|
+
delimiter: u,
|
|
21
21
|
editItems: !0,
|
|
22
22
|
removeItemButton: !0
|
|
23
23
|
});
|
|
24
24
|
e.setValue(r || []), n.current = e, e.passedElement.element.addEventListener("addItem", (t) => {
|
|
25
|
-
f(t.
|
|
25
|
+
f(t.target.value);
|
|
26
26
|
}), e.passedElement.element.addEventListener("removeItem", (t) => {
|
|
27
|
-
d(t.
|
|
27
|
+
d(t.target.value);
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
return () => {
|
|
31
31
|
n.current && n.current.destroy();
|
|
32
32
|
};
|
|
33
|
-
}, [
|
|
33
|
+
}, [u]), {
|
|
34
34
|
otherProps: {
|
|
35
35
|
...p,
|
|
36
36
|
name: c
|
|
37
37
|
},
|
|
38
|
-
ref:
|
|
38
|
+
ref: m,
|
|
39
39
|
instanceRef: n
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -43,7 +43,7 @@ function x(s) {
|
|
|
43
43
|
const { ref: r, otherProps: o } = P(s);
|
|
44
44
|
return /* @__PURE__ */ h("input", { type: "text", ...E(o), ref: r });
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
I("InputTags.choicesjs", x);
|
|
47
47
|
export {
|
|
48
48
|
x as ChoicesTags,
|
|
49
49
|
P as useChoiceTags
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoicesTags.js","sources":["../../../../../src/molecules/forms/input-tags/components/ChoicesTags.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport { useEffect, useRef } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nimport { registerComponent } from \"../../../../registries/components\";\nimport { cleanFormControlProps } from \"../../form-control/FormControl\";\nimport type { InputTagsProps } from \"../InputTags.interface\";\n\nexport function useChoiceTags<Data = string>(props: InputTagsProps<Data>) {\n const { value, onChange, name = \"\", delimiter, customProperties, ...otherProps } = props;\n const ref = useRef<HTMLInputElement | null>(null);\n const instanceRef = useRef<Choices | null>(null);\n\n const onAdd = useDebouncedCallback((add: Data) => {\n const values = ((value || []) as Data[]).concat(add);\n\n onChange?.(name, [...values]);\n }, 100);\n\n const onDelete = useDebouncedCallback((remove: Data) => {\n const values = (value || []).filter((v) => v !== remove);\n\n onChange?.(name, [...values]);\n });\n\n useEffect(() => {\n if (ref.current) {\n const instance = new Choices(ref.current!, {\n duplicateItemsAllowed: false,\n ...customProperties,\n delimiter,\n editItems: true,\n removeItemButton: true\n });\n\n instance.setValue((value || []) as string[]);\n\n instanceRef.current = instance;\n\n instance.passedElement.element.addEventListener(\"addItem\", (event
|
|
1
|
+
{"version":3,"file":"ChoicesTags.js","sources":["../../../../../src/molecules/forms/input-tags/components/ChoicesTags.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport { useEffect, useRef } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nimport { registerComponent } from \"../../../../registries/components\";\nimport { cleanFormControlProps } from \"../../form-control/FormControl\";\nimport type { InputTagsProps } from \"../InputTags.interface\";\n\nexport function useChoiceTags<Data = string>(props: InputTagsProps<Data>) {\n const { value, onChange, name = \"\", delimiter, customProperties, ...otherProps } = props;\n const ref = useRef<HTMLInputElement | null>(null);\n const instanceRef = useRef<Choices | null>(null);\n\n const onAdd = useDebouncedCallback((add: Data) => {\n const values = ((value || []) as Data[]).concat(add);\n\n onChange?.(name, [...values]);\n }, 100);\n\n const onDelete = useDebouncedCallback((remove: Data) => {\n const values = (value || []).filter((v) => v !== remove);\n\n onChange?.(name, [...values]);\n });\n\n useEffect(() => {\n if (ref.current) {\n const instance = new Choices(ref.current!, {\n duplicateItemsAllowed: false,\n ...customProperties,\n delimiter,\n editItems: true,\n removeItemButton: true\n });\n\n instance.setValue((value || []) as string[]);\n\n instanceRef.current = instance;\n\n instance.passedElement.element.addEventListener(\"addItem\", (event) => {\n onAdd((event.target as any).value as Data);\n });\n\n instance.passedElement.element.addEventListener(\"removeItem\", (event) => {\n onDelete((event.target as any).value as Data);\n });\n }\n\n return () => {\n if (instanceRef.current) {\n instanceRef.current.destroy();\n }\n };\n }, [delimiter]);\n\n return {\n otherProps: {\n ...otherProps,\n name\n },\n ref,\n instanceRef\n };\n}\n\nexport function ChoicesTags<Data = string>(props: InputTagsProps<Data>) {\n const { ref, otherProps } = useChoiceTags<Data>(props);\n\n return <input type='text' {...cleanFormControlProps(otherProps)} ref={ref} />;\n}\n\nregisterComponent(\"InputTags.choicesjs\", ChoicesTags);\n"],"names":["useChoiceTags","props","value","onChange","name","delimiter","customProperties","otherProps","ref","useRef","instanceRef","onAdd","useDebouncedCallback","add","values","onDelete","remove","useEffect","instance","Choices","event","ChoicesTags","jsx","cleanFormControlProps","registerComponent"],"mappings":";;;;;;AAQO,SAASA,EAA6BC,GAA6B;AACxE,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,MAAAC,IAAO,IAAI,WAAAC,GAAW,kBAAAC,GAAkB,GAAGC,EAAA,IAAeN,GAC7EO,IAAMC,EAAgC,IAAI,GAC1CC,IAAcD,EAAuB,IAAI,GAEzCE,IAAQC,EAAqB,CAACC,MAAc;AAChD,UAAMC,KAAWZ,KAAS,CAAA,GAAe,OAAOW,CAAG;AAEnD,IAAAV,IAAWC,GAAM,CAAC,GAAGU,CAAM,CAAC;AAAA,EAC9B,GAAG,GAAG,GAEAC,IAAWH,EAAqB,CAACI,MAAiB;AACtD,UAAMF,KAAUZ,KAAS,CAAA,GAAI,OAAO,CAAC,MAAM,MAAMc,CAAM;AAEvD,IAAAb,IAAWC,GAAM,CAAC,GAAGU,CAAM,CAAC;AAAA,EAC9B,CAAC;AAED,SAAAG,EAAU,MAAM;AACd,QAAIT,EAAI,SAAS;AACf,YAAMU,IAAW,IAAIC,EAAQX,EAAI,SAAU;AAAA,QACzC,uBAAuB;AAAA,QACvB,GAAGF;AAAA,QACH,WAAAD;AAAA,QACA,WAAW;AAAA,QACX,kBAAkB;AAAA,MAAA,CACnB;AAED,MAAAa,EAAS,SAAUhB,KAAS,EAAe,GAE3CQ,EAAY,UAAUQ,GAEtBA,EAAS,cAAc,QAAQ,iBAAiB,WAAW,CAACE,MAAU;AACpE,QAAAT,EAAOS,EAAM,OAAe,KAAa;AAAA,MAC3C,CAAC,GAEDF,EAAS,cAAc,QAAQ,iBAAiB,cAAc,CAACE,MAAU;AACvE,QAAAL,EAAUK,EAAM,OAAe,KAAa;AAAA,MAC9C,CAAC;AAAA,IACH;AAEA,WAAO,MAAM;AACX,MAAIV,EAAY,WACdA,EAAY,QAAQ,QAAA;AAAA,IAExB;AAAA,EACF,GAAG,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,YAAY;AAAA,MACV,GAAGE;AAAA,MACH,MAAAH;AAAA,IAAA;AAAA,IAEF,KAAAI;AAAA,IACA,aAAAE;AAAA,EAAA;AAEJ;AAEO,SAASW,EAA2BpB,GAA6B;AACtE,QAAM,EAAE,KAAAO,GAAK,YAAAD,MAAeP,EAAoBC,CAAK;AAErD,SAAO,gBAAAqB,EAAC,WAAM,MAAK,QAAQ,GAAGC,EAAsBhB,CAAU,GAAG,KAAAC,GAAU;AAC7E;AAEAgB,EAAkB,uBAAuBH,CAAW;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoicesSelect.js","sources":["../../../../../src/molecules/forms/select/components/ChoicesSelect.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport cx from \"classnames\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nimport { registerComponent } from \"../../../../registries/components\";\nimport { cleanFormControlProps } from \"../../form-control/FormControl\";\nimport type { AllSelectProps } from \"../Select.interface\";\nimport { callbackOnCreateTemplates } from \"./choices.template\";\n\nexport function useChoices({\n name,\n disabled,\n multiple,\n options,\n placeholder,\n searchEnabled = true,\n customProperties = {},\n size,\n value,\n required,\n onChange\n}: AllSelectProps) {\n const ref = useRef<any>();\n const choicesRef = useRef<Choices>();\n\n const opts = useMemo(() => {\n const isSelected = (itemValue: any) => [].concat(value as any).includes(itemValue as never);\n\n const opts = options.map((item) => {\n if (item.options) {\n item = {\n ...item,\n choices: item.options.map((item: any) => ({\n ...item,\n selected: isSelected(item.value)\n }))\n };\n }\n\n return {\n ...item,\n selected: isSelected(item.value)\n };\n });\n\n if (!multiple && placeholder) {\n return [\n {\n disabled: required,\n label: placeholder,\n value: \"\"\n },\n ...opts\n ];\n }\n\n return opts;\n }, [options, value, required, multiple, placeholder]);\n\n const onChangeCallback = useDebouncedCallback((name: string | undefined, value: any) => {\n onChange?.(name, value);\n }, 50);\n\n useEffect(() => {\n if (choicesRef.current) {\n if (multiple) {\n choicesRef.current.clearStore();\n choicesRef.current.setChoices(opts, \"value\", \"label\", true);\n } else {\n choicesRef.current.setChoices(opts, \"value\", \"label\", true);\n }\n }\n }, [opts]);\n\n useEffect(() => {\n if (!choicesRef.current) {\n const { allowHTML = true, silent = true, removeItemButton = true, shouldSort = false, itemSelectText = \"\" } = customProperties;\n choicesRef.current = new Choices(ref.current, {\n ...customProperties,\n allowHTML,\n silent,\n searchEnabled,\n removeItemButton,\n choices: opts,\n placeholder: placeholder as string,\n placeholderValue: \"\" as string,\n itemSelectText,\n shouldSort,\n callbackOnCreateTemplates\n } as any);\n }\n\n if (disabled) {\n choicesRef.current?.disable();\n } else {\n choicesRef.current?.enable();\n }\n\n const addItem = ({ detail: { value: newValue } }: any) => {\n onChangeCallback(name, multiple ? [...new Set([...new Set(value as string[]), newValue])] : newValue);\n };\n\n const removeItem = ({ detail: { value: newValue } }: any) => {\n if (multiple) {\n onChangeCallback(\n name,\n (value as string[]).filter((v) => v !== newValue)\n );\n } else {\n onChangeCallback(name, undefined as any);\n }\n };\n\n choicesRef.current?.passedElement.element.addEventListener(\"addItem\", addItem);\n choicesRef.current?.passedElement.element.addEventListener(\"removeItem\", removeItem);\n\n return () => {\n choicesRef.current?.passedElement.element.removeEventListener(\"addItem\", addItem);\n choicesRef.current?.passedElement.element.removeEventListener(\"removeItem\", removeItem);\n };\n }, [disabled, onChange, opts, placeholder, searchEnabled, size, value]);\n\n return {\n ref,\n choicesRef\n };\n}\n\nexport function ChoiceSelect(props: AllSelectProps) {\n const { ref } = useChoices({\n ...props,\n searchEnabled: !props.disableSearch\n });\n\n return (\n <select\n ref={ref}\n data-testid={`select_${props.name}`}\n {...cleanFormControlProps(props as any, [\n \"className\",\n \"size\",\n \"value\",\n \"options\",\n \"placeholder\",\n \"onChange\",\n \"allowHTML\",\n \"silent\",\n \"removeItemButton\",\n \"shouldSort\",\n \"itemSelectText\",\n \"customProperties\"\n ])}\n className={cx(\"form-control\", props.size && `form-control-${props.size}`)}\n />\n );\n}\n\nregisterComponent(\"Select.choicesjs\", ChoiceSelect);\n"],"names":["useChoices","name","disabled","multiple","options","placeholder","searchEnabled","customProperties","size","value","required","onChange","ref","useRef","choicesRef","opts","useMemo","isSelected","itemValue","item","onChangeCallback","useDebouncedCallback","useEffect","allowHTML","silent","removeItemButton","shouldSort","itemSelectText","Choices","callbackOnCreateTemplates","addItem","newValue","removeItem","v","ChoiceSelect","props","jsx","cleanFormControlProps","cx","registerComponent"],"mappings":";;;;;;;;AAUO,SAASA,EAAW;AAAA,EACzB,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,kBAAAC,IAAmB,CAAA;AAAA,EACnB,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AACF,GAAmB;AACjB,QAAMC,IAAMC,EAAA,GACNC,IAAaD,EAAA,GAEbE,IAAOC,EAAQ,MAAM;AACzB,UAAMC,IAAa,CAACC,MAAmB,CAAA,EAAG,OAAOT,CAAY,EAAE,SAASS,CAAkB,GAEpFH,IAAOX,EAAQ,IAAI,CAACe,OACpBA,EAAK,YACPA,IAAO;AAAA,MACL,GAAGA;AAAA,MACH,SAASA,EAAK,QAAQ,IAAI,CAACA,OAAe;AAAA,QACxC,GAAGA;AAAAA,QACH,UAAUF,EAAWE,EAAK,KAAK;AAAA,MAAA,EAC/B;AAAA,IAAA,IAIC;AAAA,MACL,GAAGA;AAAA,MACH,UAAUF,EAAWE,EAAK,KAAK;AAAA,IAAA,EAElC;AAED,WAAI,CAAChB,KAAYE,IACR;AAAA,MACL;AAAA,QACE,UAAUK;AAAA,QACV,OAAOL;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,MAET,GAAGU;AAAAA,IAAA,IAIAA;AAAAA,EACT,GAAG,CAACX,GAASK,GAAOC,GAAUP,GAAUE,CAAW,CAAC,GAE9Ce,IAAmBC,EAAqB,CAACpB,GAA0BQ,MAAe;AACtF,IAAAE,IAAWV,GAAMQ,CAAK;AAAA,EACxB,GAAG,EAAE;AAEL,SAAAa,EAAU,MAAM;AACd,IAAIR,EAAW,YACTX,KACFW,EAAW,QAAQ,WAAA,GACnBA,EAAW,QAAQ,WAAWC,
|
|
1
|
+
{"version":3,"file":"ChoicesSelect.js","sources":["../../../../../src/molecules/forms/select/components/ChoicesSelect.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport cx from \"classnames\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nimport { registerComponent } from \"../../../../registries/components\";\nimport { cleanFormControlProps } from \"../../form-control/FormControl\";\nimport type { AllSelectProps } from \"../Select.interface\";\nimport { callbackOnCreateTemplates } from \"./choices.template\";\n\nexport function useChoices({\n name,\n disabled,\n multiple,\n options,\n placeholder,\n searchEnabled = true,\n customProperties = {},\n size,\n value,\n required,\n onChange\n}: AllSelectProps) {\n const ref = useRef<any>();\n const choicesRef = useRef<Choices>();\n\n const opts = useMemo(() => {\n const isSelected = (itemValue: any) => [].concat(value as any).includes(itemValue as never);\n\n const opts = options.map((item) => {\n if (item.options) {\n item = {\n ...item,\n choices: item.options.map((item: any) => ({\n ...item,\n selected: isSelected(item.value)\n }))\n };\n }\n\n return {\n ...item,\n selected: isSelected(item.value)\n };\n });\n\n if (!multiple && placeholder) {\n return [\n {\n disabled: required,\n label: placeholder,\n value: \"\"\n },\n ...opts\n ];\n }\n\n return opts;\n }, [options, value, required, multiple, placeholder]);\n\n const onChangeCallback = useDebouncedCallback((name: string | undefined, value: any) => {\n onChange?.(name, value);\n }, 50);\n\n useEffect(() => {\n if (choicesRef.current) {\n if (multiple) {\n choicesRef.current.clearStore();\n choicesRef.current.setChoices(opts as any, \"value\", \"label\", true);\n } else {\n choicesRef.current.setChoices(opts as any, \"value\", \"label\", true);\n }\n }\n }, [opts]);\n\n useEffect(() => {\n if (!choicesRef.current) {\n const { allowHTML = true, silent = true, removeItemButton = true, shouldSort = false, itemSelectText = \"\" } = customProperties;\n choicesRef.current = new Choices(ref.current, {\n ...customProperties,\n allowHTML,\n silent,\n searchEnabled,\n removeItemButton,\n choices: opts,\n placeholder: placeholder as string,\n placeholderValue: \"\" as string,\n itemSelectText,\n shouldSort,\n callbackOnCreateTemplates\n } as any);\n }\n\n if (disabled) {\n choicesRef.current?.disable();\n } else {\n choicesRef.current?.enable();\n }\n\n const addItem = ({ detail: { value: newValue } }: any) => {\n onChangeCallback(name, multiple ? [...new Set([...new Set(value as string[]), newValue])] : newValue);\n };\n\n const removeItem = ({ detail: { value: newValue } }: any) => {\n if (multiple) {\n onChangeCallback(\n name,\n (value as string[]).filter((v) => v !== newValue)\n );\n } else {\n onChangeCallback(name, undefined as any);\n }\n };\n\n choicesRef.current?.passedElement.element.addEventListener(\"addItem\", addItem);\n choicesRef.current?.passedElement.element.addEventListener(\"removeItem\", removeItem);\n\n return () => {\n choicesRef.current?.passedElement.element.removeEventListener(\"addItem\", addItem);\n choicesRef.current?.passedElement.element.removeEventListener(\"removeItem\", removeItem);\n };\n }, [disabled, onChange, opts, placeholder, searchEnabled, size, value]);\n\n return {\n ref,\n choicesRef\n };\n}\n\nexport function ChoiceSelect(props: AllSelectProps) {\n const { ref } = useChoices({\n ...props,\n searchEnabled: !props.disableSearch\n });\n\n return (\n <select\n ref={ref}\n data-testid={`select_${props.name}`}\n {...cleanFormControlProps(props as any, [\n \"className\",\n \"size\",\n \"value\",\n \"options\",\n \"placeholder\",\n \"onChange\",\n \"allowHTML\",\n \"silent\",\n \"removeItemButton\",\n \"shouldSort\",\n \"itemSelectText\",\n \"customProperties\"\n ])}\n className={cx(\"form-control\", props.size && `form-control-${props.size}`)}\n />\n );\n}\n\nregisterComponent(\"Select.choicesjs\", ChoiceSelect);\n"],"names":["useChoices","name","disabled","multiple","options","placeholder","searchEnabled","customProperties","size","value","required","onChange","ref","useRef","choicesRef","opts","useMemo","isSelected","itemValue","item","onChangeCallback","useDebouncedCallback","useEffect","allowHTML","silent","removeItemButton","shouldSort","itemSelectText","Choices","callbackOnCreateTemplates","addItem","newValue","removeItem","v","ChoiceSelect","props","jsx","cleanFormControlProps","cx","registerComponent"],"mappings":"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"}
|
|
@@ -14,7 +14,7 @@ function H() {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function $({
|
|
18
18
|
show: e,
|
|
19
19
|
children: t,
|
|
20
20
|
closeModal: s = f,
|
|
@@ -22,8 +22,8 @@ function k({
|
|
|
22
22
|
title: d,
|
|
23
23
|
footer: n,
|
|
24
24
|
style: h,
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
25
|
+
className: v = "",
|
|
26
|
+
...p
|
|
27
27
|
}) {
|
|
28
28
|
const l = m(), a = m(), [N, c] = u(), i = () => {
|
|
29
29
|
s(), g();
|
|
@@ -34,13 +34,13 @@ function k({
|
|
|
34
34
|
c(`calc(85vh - ${b}px)`);
|
|
35
35
|
} else
|
|
36
36
|
c("auto");
|
|
37
|
-
}, [e]), e ? /* @__PURE__ */ r("div", { role: "dialog", className: `formio-dialog formio-dialog-theme-default ${
|
|
37
|
+
}, [e]), e ? /* @__PURE__ */ r("div", { role: "dialog", className: `formio-dialog formio-dialog-theme-default ${v}`, children: [
|
|
38
38
|
/* @__PURE__ */ o("div", { className: "formio-dialog-overlay", onClick: i }),
|
|
39
39
|
/* @__PURE__ */ r("div", { style: h, className: "formio-dialog-content", children: [
|
|
40
40
|
/* @__PURE__ */ r("div", { className: "formio-dialog-wrapper", children: [
|
|
41
41
|
d ? /* @__PURE__ */ o("div", { className: "formio-dialog-title", ref: l, "data-testid": "modalTitle", children: d }) : null,
|
|
42
42
|
/* @__PURE__ */ o("div", { className: "formio-dialog-body", style: { maxHeight: N }, "data-testid": "modalBody", children: e && t }),
|
|
43
|
-
n ? /* @__PURE__ */ o("div", { className: "formio-dialog-footer", ref: a, "data-testid": "modalFooter", children: /* @__PURE__ */ o(n, { ...
|
|
43
|
+
n ? /* @__PURE__ */ o("div", { className: "formio-dialog-footer", ref: a, "data-testid": "modalFooter", children: /* @__PURE__ */ o(n, { ...p, closeModal: s, onClose: i }) }) : null
|
|
44
44
|
] }),
|
|
45
45
|
/* @__PURE__ */ o(
|
|
46
46
|
"button",
|
|
@@ -55,7 +55,7 @@ function k({
|
|
|
55
55
|
] }) : null;
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
$ as Modal,
|
|
59
59
|
H as useModal
|
|
60
60
|
};
|
|
61
61
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/molecules/modal/Modal.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport noop from \"lodash\";\nimport { PropsWithChildren, useEffect, useRef, useState } from \"react\";\n\nexport function useModal() {\n const [show, setShowModal] = useState(false);\n\n return {\n show,\n setShowModal,\n openModal() {\n setShowModal(true);\n },\n closeModal() {\n setShowModal(false);\n }\n };\n}\n\nexport interface ModalProps extends Record<string, any> {\n show?: boolean;\n closeModal?: () => void;\n onClose?: () => void;\n footer?: any;\n title?: string;\n}\n\nexport function Modal({\n show,\n children,\n closeModal = noop as any,\n onClose = noop as any,\n title,\n footer: ModalFooter,\n style,\n className = \"\",\n ...props\n}: PropsWithChildren<ModalProps>) {\n const titleRef: any = useRef<HTMLDivElement>();\n const footerRef: any = useRef<HTMLDivElement>();\n const [maxHeight, setMaxHeight] = useState<string>();\n\n const onClickClose = () => {\n closeModal();\n onClose();\n };\n\n useEffect(() => {\n if (titleRef.current || footerRef.current) {\n const height = (titleRef?.current?.offsetHeight || 0) + (footerRef?.current?.offsetHeight || 0);\n\n setMaxHeight(`calc(85vh - ${height}px)`);\n } else {\n setMaxHeight(\"auto\");\n }\n }, [show]);\n\n if (!show) {\n return null;\n }\n\n return (\n <div role={\"dialog\"} className={`formio-dialog formio-dialog-theme-default ${className}`}>\n <div className='formio-dialog-overlay' onClick={onClickClose} />\n <div style={style} className={\"formio-dialog-content\"}>\n <div className={\"formio-dialog-wrapper\"}>\n {title ? (\n <div className={\"formio-dialog-title\"} ref={titleRef} data-testid={\"modalTitle\"}>\n {title}\n </div>\n ) : null}\n\n <div className='formio-dialog-body' style={{ maxHeight }} data-testid={\"modalBody\"}>\n {show && children}\n </div>\n\n {ModalFooter ? (\n <div className={\"formio-dialog-footer\"} ref={footerRef} data-testid={\"modalFooter\"}>\n <ModalFooter {...props} closeModal={closeModal} onClose={onClickClose} />\n </div>\n ) : null}\n </div>\n <button\n className='formio-dialog-close float-right btn btn-secondary btn-sm'\n aria-label='close'\n data-testid={\"closeModal\"}\n onClick={onClickClose}\n />\n </div>\n </div>\n );\n}\n"],"names":["useModal","show","setShowModal","useState","Modal","children","closeModal","noop","onClose","title","ModalFooter","style","className","props","titleRef","useRef","footerRef","maxHeight","setMaxHeight","onClickClose","useEffect","height","jsx","jsxs"],"mappings":";;;AAKO,SAASA,IAAW;AACzB,QAAM,CAACC,GAAMC,CAAY,IAAIC,EAAS,EAAK;AAE3C,SAAO;AAAA,IACL,MAAAF;AAAA,IACA,cAAAC;AAAA,IACA,YAAY;AACV,MAAAA,EAAa,EAAI;AAAA,IACnB;AAAA,IACA,aAAa;AACX,MAAAA,EAAa,EAAK;AAAA,IACpB;AAAA,EAAA;AAEJ;AAUO,SAASE,EAAM;AAAA,EACpB,MAAAH;AAAA,EACA,UAAAI;AAAA,EACA,YAAAC,IAAaC;
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/molecules/modal/Modal.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport noop from \"lodash\";\nimport { PropsWithChildren, useEffect, useRef, useState } from \"react\";\n\nexport function useModal() {\n const [show, setShowModal] = useState(false);\n\n return {\n show,\n setShowModal,\n openModal() {\n setShowModal(true);\n },\n closeModal() {\n setShowModal(false);\n }\n };\n}\n\nexport interface ModalProps extends Record<string, any> {\n show?: boolean;\n closeModal?: () => void;\n onClose?: () => void;\n footer?: any;\n title?: string;\n}\n\nexport function Modal({\n show,\n children,\n closeModal = noop as any,\n onClose = noop as any,\n title,\n footer: ModalFooter,\n style,\n className = \"\",\n ...props\n}: PropsWithChildren<ModalProps>) {\n const titleRef: any = useRef<HTMLDivElement>();\n const footerRef: any = useRef<HTMLDivElement>();\n const [maxHeight, setMaxHeight] = useState<string>();\n\n const onClickClose = () => {\n closeModal();\n onClose();\n };\n\n useEffect(() => {\n if (titleRef.current || footerRef.current) {\n const height = (titleRef?.current?.offsetHeight || 0) + (footerRef?.current?.offsetHeight || 0);\n\n setMaxHeight(`calc(85vh - ${height}px)`);\n } else {\n setMaxHeight(\"auto\");\n }\n }, [show]);\n\n if (!show) {\n return null;\n }\n\n return (\n <div role={\"dialog\"} className={`formio-dialog formio-dialog-theme-default ${className}`}>\n <div className='formio-dialog-overlay' onClick={onClickClose} />\n <div style={style} className={\"formio-dialog-content\"}>\n <div className={\"formio-dialog-wrapper\"}>\n {title ? (\n <div className={\"formio-dialog-title\"} ref={titleRef} data-testid={\"modalTitle\"}>\n {title}\n </div>\n ) : null}\n\n <div className='formio-dialog-body' style={{ maxHeight }} data-testid={\"modalBody\"}>\n {show && children}\n </div>\n\n {ModalFooter ? (\n <div className={\"formio-dialog-footer\"} ref={footerRef} data-testid={\"modalFooter\"}>\n <ModalFooter {...props} closeModal={closeModal} onClose={onClickClose} />\n </div>\n ) : null}\n </div>\n <button\n className='formio-dialog-close float-right btn btn-secondary btn-sm'\n aria-label='close'\n data-testid={\"closeModal\"}\n onClick={onClickClose}\n />\n </div>\n </div>\n );\n}\n"],"names":["useModal","show","setShowModal","useState","Modal","children","closeModal","noop","onClose","title","ModalFooter","style","className","props","titleRef","useRef","footerRef","maxHeight","setMaxHeight","onClickClose","useEffect","height","jsx","jsxs"],"mappings":";;;AAKO,SAASA,IAAW;AACzB,QAAM,CAACC,GAAMC,CAAY,IAAIC,EAAS,EAAK;AAE3C,SAAO;AAAA,IACL,MAAAF;AAAA,IACA,cAAAC;AAAA,IACA,YAAY;AACV,MAAAA,EAAa,EAAI;AAAA,IACnB;AAAA,IACA,aAAa;AACX,MAAAA,EAAa,EAAK;AAAA,IACpB;AAAA,EAAA;AAEJ;AAUO,SAASE,EAAM;AAAA,EACpB,MAAAH;AAAA,EACA,UAAAI;AAAA,EACA,YAAAC,IAAaC;AAAAA,EACb,SAAAC,IAAUD;AAAAA,EACV,OAAAE;AAAA,EACA,QAAQC;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAkC;AAChC,QAAMC,IAAgBC,EAAA,GAChBC,IAAiBD,EAAA,GACjB,CAACE,GAAWC,CAAY,IAAIf,EAAA,GAE5BgB,IAAe,MAAM;AACzB,IAAAb,EAAA,GACAE,EAAA;AAAA,EACF;AAYA,SAVAY,EAAU,MAAM;AACd,QAAIN,EAAS,WAAWE,EAAU,SAAS;AACzC,YAAMK,KAAUP,GAAU,SAAS,gBAAgB,MAAME,GAAW,SAAS,gBAAgB;AAE7F,MAAAE,EAAa,eAAeG,CAAM,KAAK;AAAA,IACzC;AACE,MAAAH,EAAa,MAAM;AAAA,EAEvB,GAAG,CAACjB,CAAI,CAAC,GAEJA,sBAKF,OAAA,EAAI,MAAM,UAAU,WAAW,6CAA6CW,CAAS,IACpF,UAAA;AAAA,IAAA,gBAAAU,EAAC,OAAA,EAAI,WAAU,yBAAwB,SAASH,GAAc;AAAA,IAC9D,gBAAAI,EAAC,OAAA,EAAI,OAAAZ,GAAc,WAAW,yBAC5B,UAAA;AAAA,MAAA,gBAAAY,EAAC,OAAA,EAAI,WAAW,yBACb,UAAA;AAAA,QAAAd,IACC,gBAAAa,EAAC,SAAI,WAAW,uBAAuB,KAAKR,GAAU,eAAa,cAChE,UAAAL,EAAA,CACH,IACE;AAAA,QAEJ,gBAAAa,EAAC,OAAA,EAAI,WAAU,sBAAqB,OAAO,EAAE,WAAAL,EAAA,GAAa,eAAa,aACpE,UAAAhB,KAAQI,EAAA,CACX;AAAA,QAECK,IACC,gBAAAY,EAAC,OAAA,EAAI,WAAW,wBAAwB,KAAKN,GAAW,eAAa,eACnE,UAAA,gBAAAM,EAACZ,KAAa,GAAGG,GAAO,YAAAP,GAAwB,SAASa,GAAc,GACzE,IACE;AAAA,MAAA,GACN;AAAA,MACA,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,cAAW;AAAA,UACX,eAAa;AAAA,UACb,SAASH;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CACF;AAAA,EAAA,GACF,IA/BO;AAiCX;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FormOptions } from '../../interfaces/index.js';
|
|
1
2
|
export interface PaginationProps {
|
|
2
3
|
className?: string;
|
|
3
4
|
pageSizes?: number[];
|
|
@@ -9,7 +10,7 @@ export interface PaginationProps {
|
|
|
9
10
|
pageSize: number;
|
|
10
11
|
rowCount?: number;
|
|
11
12
|
layout?: "html5" | "react" | "choicesjs";
|
|
12
|
-
i18n?:
|
|
13
|
+
i18n?: FormOptions["i18n"];
|
|
13
14
|
onPageIndexChange: (pageIndex: number) => void;
|
|
14
15
|
onClickPreviousPage: () => void;
|
|
15
16
|
onClickNextPage: () => void;
|