@namroodinc/liquid-editorial 0.8.0 → 0.9.0
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/README.md +13 -7
- package/UPGRADING.md +142 -0
- package/dist/chunks/{Avatar-6t78C9Np.js → Avatar-BK8IdL5W.js} +2 -2
- package/dist/chunks/{Avatar-6t78C9Np.js.map → Avatar-BK8IdL5W.js.map} +1 -1
- package/dist/chunks/{Avatar-Cvj_DqG0.cjs → Avatar-DPnrvkwd.cjs} +2 -2
- package/dist/chunks/{Avatar-Cvj_DqG0.cjs.map → Avatar-DPnrvkwd.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-B18Ihv7X.cjs → CollectionView-BNYx29b1.cjs} +2 -2
- package/dist/chunks/{CollectionView-B18Ihv7X.cjs.map → CollectionView-BNYx29b1.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-C-SwkPWC.js → CollectionView-Vj84E26b.js} +2 -2
- package/dist/chunks/{CollectionView-C-SwkPWC.js.map → CollectionView-Vj84E26b.js.map} +1 -1
- package/dist/chunks/{ColourField-Dohdx7eW.cjs → ColourField-C1qjpIfB.cjs} +2 -2
- package/dist/chunks/{ColourField-Dohdx7eW.cjs.map → ColourField-C1qjpIfB.cjs.map} +1 -1
- package/dist/chunks/{ColourField-DzZ--mQZ.js → ColourField-Ce2oaVcd.js} +2 -2
- package/dist/chunks/{ColourField-DzZ--mQZ.js.map → ColourField-Ce2oaVcd.js.map} +1 -1
- package/dist/chunks/{DatePicker-Bjc4D8Kg.cjs → DatePicker-BCnzFJFF.cjs} +2 -2
- package/dist/chunks/{DatePicker-Bjc4D8Kg.cjs.map → DatePicker-BCnzFJFF.cjs.map} +1 -1
- package/dist/chunks/{DatePicker-DZVOtzoU.js → DatePicker-CnVmsCwO.js} +2 -2
- package/dist/chunks/{DatePicker-DZVOtzoU.js.map → DatePicker-CnVmsCwO.js.map} +1 -1
- package/dist/chunks/{Drawer-CcVF_p4b.cjs → Drawer-BDX9_qHA.cjs} +2 -2
- package/dist/chunks/Drawer-BDX9_qHA.cjs.map +1 -0
- package/dist/chunks/{Drawer-uhJvy3s9.js → Drawer-DTtgAZO2.js} +3 -3
- package/dist/chunks/Drawer-DTtgAZO2.js.map +1 -0
- package/dist/chunks/EntryPicker-Baqn0SQM.cjs +2 -0
- package/dist/chunks/EntryPicker-Baqn0SQM.cjs.map +1 -0
- package/dist/chunks/EntryPicker-DIYjKmBf.js +803 -0
- package/dist/chunks/EntryPicker-DIYjKmBf.js.map +1 -0
- package/dist/chunks/FormEditor-B7Pm_ZzT.cjs +2 -0
- package/dist/chunks/FormEditor-B7Pm_ZzT.cjs.map +1 -0
- package/dist/chunks/{FormEditor-D0J3JN-H.js → FormEditor-HqqFmu7s.js} +156 -150
- package/dist/chunks/FormEditor-HqqFmu7s.js.map +1 -0
- package/dist/chunks/{RichTextEditor-B6H6_3wk.js → RichTextEditor-CuZnjiy2.js} +86 -86
- package/dist/chunks/RichTextEditor-CuZnjiy2.js.map +1 -0
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs +2 -0
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs.map +1 -0
- package/dist/chunks/{dialogLabel-3EeaH1Zl.cjs → dialogLabel-2HRYMHbF.cjs} +2 -2
- package/dist/chunks/{dialogLabel-3EeaH1Zl.cjs.map → dialogLabel-2HRYMHbF.cjs.map} +1 -1
- package/dist/chunks/{dialogLabel-BjtTix5C.js → dialogLabel-D18maX-p.js} +2 -2
- package/dist/chunks/{dialogLabel-BjtTix5C.js.map → dialogLabel-D18maX-p.js.map} +1 -1
- package/dist/chunks/{frame-CycTDnzE.js → frame-CzadNYgy.js} +3 -3
- package/dist/chunks/{frame-CycTDnzE.js.map → frame-CzadNYgy.js.map} +1 -1
- package/dist/chunks/{frame-BtIh7K-M.cjs → frame-Mh99nmhR.cjs} +2 -2
- package/dist/chunks/{frame-BtIh7K-M.cjs.map → frame-Mh99nmhR.cjs.map} +1 -1
- package/dist/chunks/group-CJA3-3s5.js +35 -0
- package/dist/chunks/group-CJA3-3s5.js.map +1 -0
- package/dist/chunks/group-DRSLOsXu.cjs +2 -0
- package/dist/chunks/group-DRSLOsXu.cjs.map +1 -0
- package/dist/chunks/limit-BNo4dlRj.cjs +2 -0
- package/dist/chunks/limit-BNo4dlRj.cjs.map +1 -0
- package/dist/chunks/{limit-BHHST_0G.js → limit-s9zfxIMC.js} +5 -4
- package/dist/chunks/limit-s9zfxIMC.js.map +1 -0
- package/dist/chunks/overlayLayer-IuoPVwTO.js +158 -0
- package/dist/chunks/overlayLayer-IuoPVwTO.js.map +1 -0
- package/dist/chunks/overlayLayer-seJG-EFn.cjs +2 -0
- package/dist/chunks/overlayLayer-seJG-EFn.cjs.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js +7 -0
- package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs +2 -0
- package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs.map +1 -0
- package/dist/chunks/{useLimit-WWWDacob.cjs → useLimit-CCv6sAUS.cjs} +2 -2
- package/dist/chunks/{useLimit-WWWDacob.cjs.map → useLimit-CCv6sAUS.cjs.map} +1 -1
- package/dist/chunks/{useLimit-C471qZ4H.js → useLimit-DZOKm4S_.js} +2 -2
- package/dist/chunks/{useLimit-C471qZ4H.js.map → useLimit-DZOKm4S_.js.map} +1 -1
- package/dist/chunks/{useTooltip-DtrE7QYu.cjs → useTooltip-BXAvQwt4.cjs} +2 -2
- package/dist/chunks/{useTooltip-DtrE7QYu.cjs.map → useTooltip-BXAvQwt4.cjs.map} +1 -1
- package/dist/chunks/{useTooltip-DajWQyNL.js → useTooltip-BrC7FdeH.js} +2 -2
- package/dist/chunks/{useTooltip-DajWQyNL.js.map → useTooltip-BrC7FdeH.js.map} +1 -1
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/style.css +1 -1
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.d.cts +13 -2
- package/dist/components/Choice/index.d.cts.map +1 -1
- package/dist/components/Choice/index.d.ts +13 -2
- package/dist/components/Choice/index.d.ts.map +1 -1
- package/dist/components/Choice/index.js +55 -35
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +7 -2
- package/dist/components/CollectionView/index.cjs +1 -1
- package/dist/components/CollectionView/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.d.cts +4 -1
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts +4 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Drawer/style.css +4 -1
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.cjs.map +1 -1
- package/dist/components/EditLayout/index.d.cts.map +1 -1
- package/dist/components/EditLayout/index.d.ts.map +1 -1
- package/dist/components/EditLayout/index.js +62 -61
- package/dist/components/EditLayout/index.js.map +1 -1
- package/dist/components/EditLayout/style.css +12 -5
- package/dist/components/EntryPicker/blocked.d.cts +21 -0
- package/dist/components/EntryPicker/blocked.d.cts.map +1 -0
- package/dist/components/EntryPicker/blocked.d.ts +21 -0
- package/dist/components/EntryPicker/blocked.d.ts.map +1 -0
- package/dist/components/EntryPicker/dialog.d.cts +7 -3
- package/dist/components/EntryPicker/dialog.d.cts.map +1 -1
- package/dist/components/EntryPicker/dialog.d.ts +7 -3
- package/dist/components/EntryPicker/dialog.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/item.d.cts +25 -1
- package/dist/components/EntryPicker/item.d.cts.map +1 -1
- package/dist/components/EntryPicker/item.d.ts +25 -1
- package/dist/components/EntryPicker/item.d.ts.map +1 -1
- package/dist/components/EntryPicker/limit.d.cts +25 -2
- package/dist/components/EntryPicker/limit.d.cts.map +1 -1
- package/dist/components/EntryPicker/limit.d.ts +25 -2
- package/dist/components/EntryPicker/limit.d.ts.map +1 -1
- package/dist/components/EntryPicker/results.d.cts +3 -4
- package/dist/components/EntryPicker/results.d.cts.map +1 -1
- package/dist/components/EntryPicker/results.d.ts +3 -4
- package/dist/components/EntryPicker/results.d.ts.map +1 -1
- package/dist/components/EntryPicker/selected-items.d.cts.map +1 -1
- package/dist/components/EntryPicker/selected-items.d.ts.map +1 -1
- package/dist/components/EntryPicker/style.css +79 -12
- package/dist/components/EntryPicker/types.d.cts +8 -0
- package/dist/components/EntryPicker/types.d.cts.map +1 -1
- package/dist/components/EntryPicker/types.d.ts +8 -0
- package/dist/components/EntryPicker/types.d.ts.map +1 -1
- package/dist/components/EntryPicker/use-picker-scroll.d.cts +14 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.cts.map +1 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.ts +14 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.ts.map +1 -0
- package/dist/components/Field/group.d.cts +1 -1
- package/dist/components/Field/group.d.cts.map +1 -1
- package/dist/components/Field/group.d.ts +1 -1
- package/dist/components/Field/group.d.ts.map +1 -1
- package/dist/components/Field/index.cjs +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/Field/types.d.cts +3 -1
- package/dist/components/Field/types.d.cts.map +1 -1
- package/dist/components/Field/types.d.ts +3 -1
- package/dist/components/Field/types.d.ts.map +1 -1
- package/dist/components/FieldAffix/index.cjs +1 -1
- package/dist/components/FieldAffix/index.cjs.map +1 -1
- package/dist/components/FieldAffix/index.d.cts.map +1 -1
- package/dist/components/FieldAffix/index.d.ts.map +1 -1
- package/dist/components/FieldAffix/index.js +2 -1
- package/dist/components/FieldAffix/index.js.map +1 -1
- package/dist/components/FormEditor/README.md +31 -10
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +9 -2
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +9 -2
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.d.cts.map +1 -1
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.js +30 -29
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/LimitReading/index.cjs +1 -1
- package/dist/components/LimitReading/index.cjs.map +1 -1
- package/dist/components/LimitReading/index.d.cts +1 -1
- package/dist/components/LimitReading/index.d.cts.map +1 -1
- package/dist/components/LimitReading/index.d.ts +1 -1
- package/dist/components/LimitReading/index.d.ts.map +1 -1
- package/dist/components/LimitReading/index.js +19 -14
- package/dist/components/LimitReading/index.js.map +1 -1
- package/dist/components/LimitReading/limit.d.cts +3 -3
- package/dist/components/LimitReading/limit.d.cts.map +1 -1
- package/dist/components/LimitReading/limit.d.ts +3 -3
- package/dist/components/LimitReading/limit.d.ts.map +1 -1
- package/dist/components/LimitReading/types.d.cts +8 -0
- package/dist/components/LimitReading/types.d.cts.map +1 -1
- package/dist/components/LimitReading/types.d.ts +8 -0
- package/dist/components/LimitReading/types.d.ts.map +1 -1
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.d.cts +4 -1
- package/dist/components/Modal/index.d.cts.map +1 -1
- package/dist/components/Modal/index.d.ts +4 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +5 -3
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/style.css +4 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.js +1 -1
- package/dist/components/RichTextEditor/expansion.d.cts.map +1 -1
- package/dist/components/RichTextEditor/expansion.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.js +1 -1
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.cjs.map +1 -1
- package/dist/components/SortableList/index.d.cts +2 -0
- package/dist/components/SortableList/index.d.cts.map +1 -1
- package/dist/components/SortableList/index.d.ts +2 -0
- package/dist/components/SortableList/index.d.ts.map +1 -1
- package/dist/components/SortableList/index.js +14 -13
- package/dist/components/SortableList/index.js.map +1 -1
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.cjs.map +1 -1
- package/dist/components/SubNav/index.d.cts.map +1 -1
- package/dist/components/SubNav/index.d.ts.map +1 -1
- package/dist/components/SubNav/index.js +40 -31
- package/dist/components/SubNav/index.js.map +1 -1
- package/dist/components/SubNav/style.css +0 -14
- package/dist/components/TagsInput/index.cjs +1 -1
- package/dist/components/TagsInput/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/internal/portalScope.d.cts.map +1 -1
- package/dist/internal/portalScope.d.ts.map +1 -1
- package/dist/internal/useIsomorphicLayoutEffect.d.cts +7 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.cts.map +1 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.ts +7 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/internal/useLatest.d.cts.map +1 -1
- package/dist/internal/useLatest.d.ts.map +1 -1
- package/dist/internal/useModalDialog.d.cts.map +1 -1
- package/dist/internal/useModalDialog.d.ts.map +1 -1
- package/dist/tokens.css +1 -0
- package/package.json +1 -1
- package/dist/chunks/Drawer-CcVF_p4b.cjs.map +0 -1
- package/dist/chunks/Drawer-uhJvy3s9.js.map +0 -1
- package/dist/chunks/EntryPicker-CBquan7o.js +0 -685
- package/dist/chunks/EntryPicker-CBquan7o.js.map +0 -1
- package/dist/chunks/EntryPicker-Dq72wjTt.cjs +0 -2
- package/dist/chunks/EntryPicker-Dq72wjTt.cjs.map +0 -1
- package/dist/chunks/FormEditor-CTcnpR51.cjs +0 -2
- package/dist/chunks/FormEditor-CTcnpR51.cjs.map +0 -1
- package/dist/chunks/FormEditor-D0J3JN-H.js.map +0 -1
- package/dist/chunks/RichTextEditor-B6H6_3wk.js.map +0 -1
- package/dist/chunks/RichTextEditor-BIopdEDA.cjs +0 -2
- package/dist/chunks/RichTextEditor-BIopdEDA.cjs.map +0 -1
- package/dist/chunks/group-67F_I1yw.js +0 -34
- package/dist/chunks/group-67F_I1yw.js.map +0 -1
- package/dist/chunks/group-BSJHLagi.cjs +0 -2
- package/dist/chunks/group-BSJHLagi.cjs.map +0 -1
- package/dist/chunks/limit-BBnpe9o9.cjs +0 -2
- package/dist/chunks/limit-BBnpe9o9.cjs.map +0 -1
- package/dist/chunks/limit-BHHST_0G.js.map +0 -1
- package/dist/chunks/overlayLayer-BgnMskpk.js +0 -158
- package/dist/chunks/overlayLayer-BgnMskpk.js.map +0 -1
- package/dist/chunks/overlayLayer-YVudmo27.cjs +0 -2
- package/dist/chunks/overlayLayer-YVudmo27.cjs.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { Button as e } from "../components/Button/index.js";
|
|
2
2
|
import { Field as t } from "../components/Field/index.js";
|
|
3
3
|
import { TextArea as n, TextField as r } from "../components/TextField/index.js";
|
|
4
|
-
import { n as i, r as a, t as o } from "./RichTextEditor-
|
|
4
|
+
import { n as i, r as a, t as o } from "./RichTextEditor-CuZnjiy2.js";
|
|
5
5
|
import { Container as s } from "../components/Container/index.js";
|
|
6
|
-
import { n as c,
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { Select as
|
|
11
|
-
import { Switch as
|
|
12
|
-
import { i as
|
|
13
|
-
import { t as
|
|
14
|
-
import { i as
|
|
15
|
-
import { a as
|
|
16
|
-
import { TagsInput as
|
|
17
|
-
import { CheckboxCard as
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { Fragment as ie, jsx as
|
|
6
|
+
import { n as c, r as l, t as u } from "./EntryPicker-DIYjKmBf.js";
|
|
7
|
+
import { Checkbox as d, ChoiceGroup as f, Radio as p } from "../components/Choice/index.js";
|
|
8
|
+
import { n as m } from "./decimal-hq_W9D3s.js";
|
|
9
|
+
import { t as h } from "./NumberField-CVsK4l9P.js";
|
|
10
|
+
import { Select as g } from "../components/Select/index.js";
|
|
11
|
+
import { Switch as _ } from "../components/Switch/index.js";
|
|
12
|
+
import { i as v } from "./colour-CYEF4Q_n.js";
|
|
13
|
+
import { t as y } from "./ColourField-Ce2oaVcd.js";
|
|
14
|
+
import { i as b, n as x, r as S, t as ee } from "./Slider-Cab6NqhK.js";
|
|
15
|
+
import { a as te, n as ne } from "./DatePicker-CnVmsCwO.js";
|
|
16
|
+
import { TagsInput as re } from "../components/TagsInput/index.js";
|
|
17
|
+
import { CheckboxCard as C, RadioCard as w, SelectionCardGroup as T } from "../components/SelectionCard/index.js";
|
|
18
|
+
import { useMemo as E, useState as D } from "react";
|
|
19
|
+
import { Fragment as ie, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
20
20
|
//#region src/components/RichTextEditor/expanded-width.ts
|
|
21
21
|
var ae = ["wide", "full"], oe = [
|
|
22
22
|
"sm",
|
|
@@ -41,22 +41,22 @@ var ae = ["wide", "full"], oe = [
|
|
|
41
41
|
"date",
|
|
42
42
|
"divider"
|
|
43
43
|
]);
|
|
44
|
-
function
|
|
44
|
+
function A(e) {
|
|
45
45
|
let t = /* @__PURE__ */ new Set();
|
|
46
46
|
for (let n of e.fields) {
|
|
47
47
|
if (!n.id?.trim() || t.has(n.id)) throw Error("Form field IDs must be nonempty and unique.");
|
|
48
48
|
if (!se.has(n.type)) throw Error(`Unsupported form field type: ${n.type}`);
|
|
49
|
-
n.type !== "divider" && (ce(n),
|
|
49
|
+
n.type !== "divider" && (ce(n), P(n), ue(n)), t.add(n.id);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function ce(e) {
|
|
53
53
|
switch (e.type) {
|
|
54
54
|
case "select":
|
|
55
55
|
case "radioGroup":
|
|
56
|
-
case "checkboxGroup": return
|
|
56
|
+
case "checkboxGroup": return L(e);
|
|
57
57
|
case "slider":
|
|
58
|
-
case "rangeSlider": return
|
|
59
|
-
case "number": return
|
|
58
|
+
case "rangeSlider": return F(e);
|
|
59
|
+
case "number": return I(e);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
var le = /* @__PURE__ */ new Set([
|
|
@@ -66,18 +66,18 @@ var le = /* @__PURE__ */ new Set([
|
|
|
66
66
|
"asset",
|
|
67
67
|
"reference"
|
|
68
68
|
]);
|
|
69
|
-
function
|
|
69
|
+
function j(e) {
|
|
70
70
|
return le.has(e.type);
|
|
71
71
|
}
|
|
72
72
|
function ue(e) {
|
|
73
|
-
if (
|
|
73
|
+
if (j(e)) {
|
|
74
74
|
if (e.limitDisplay !== void 0 && !["used", "remaining"].includes(e.limitDisplay)) throw Error(`Field ${e.id} needs a limitDisplay of used or remaining.`);
|
|
75
75
|
if (e.limitVisibility !== void 0 && !["always", "nearLimit"].includes(e.limitVisibility)) throw Error(`Field ${e.id} needs a limitVisibility of always or nearLimit.`);
|
|
76
76
|
if (e.showLimitRing !== void 0 && typeof e.showLimitRing != "boolean") throw Error(`Field ${e.id} needs a boolean showLimitRing.`);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
function de(e, t, n, r) {
|
|
80
|
-
return
|
|
80
|
+
return j(e) ? {
|
|
81
81
|
limitDisplay: e.limitDisplay,
|
|
82
82
|
limitVisibility: e.limitVisibility,
|
|
83
83
|
showLimitRing: e.showLimitRing,
|
|
@@ -88,54 +88,60 @@ function fe(e, t, n, r) {
|
|
|
88
88
|
switch (e.type) {
|
|
89
89
|
case "shortText":
|
|
90
90
|
case "longText": return e.maxLength === void 0 ? void 0 : {
|
|
91
|
-
count:
|
|
91
|
+
count: M(t).length,
|
|
92
92
|
max: e.maxLength
|
|
93
93
|
};
|
|
94
94
|
case "tags": return e.max === void 0 ? void 0 : {
|
|
95
|
-
count:
|
|
95
|
+
count: q(t).length,
|
|
96
96
|
max: e.max
|
|
97
97
|
};
|
|
98
98
|
default: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return c(t, n.length, i);
|
|
99
|
+
let { mode: t, max: i } = N(e, r);
|
|
100
|
+
return l(t, n.length, i);
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
function
|
|
104
|
+
function pe(e, t, n, r) {
|
|
105
|
+
if (n !== void 0 && (e.type === "asset" || e.type === "reference")) {
|
|
106
|
+
let { mode: t, max: i } = N(e, r);
|
|
107
|
+
return c(t, n.length, i);
|
|
108
|
+
}
|
|
109
|
+
return e.type === "checkboxGroup" ? q(t).length : void 0;
|
|
110
|
+
}
|
|
111
|
+
function M(e) {
|
|
106
112
|
return typeof e == "string" ? e : "";
|
|
107
113
|
}
|
|
108
|
-
function
|
|
114
|
+
function N(e, t) {
|
|
109
115
|
let n = t?.mode ?? (e.multiple ? "multiple" : "single");
|
|
110
116
|
if (!e.multiple) return {
|
|
111
117
|
mode: n,
|
|
112
118
|
max: n === "multiple" ? 1 : void 0
|
|
113
119
|
};
|
|
114
|
-
let r = [
|
|
120
|
+
let r = [B(e).max, t?.max].filter((e) => e !== void 0 && Number.isFinite(e));
|
|
115
121
|
return {
|
|
116
122
|
mode: n,
|
|
117
123
|
max: r.length > 0 ? Math.min(...r) : void 0
|
|
118
124
|
};
|
|
119
125
|
}
|
|
120
|
-
function
|
|
126
|
+
function P(e) {
|
|
121
127
|
if (e.width !== void 0 && !oe.includes(e.width)) throw Error(`Field ${e.id} needs a width of sm, md or lg.`);
|
|
122
128
|
if (e.type === "richText" && e.expandedWidth !== void 0 && !ae.includes(e.expandedWidth)) throw Error(`Rich text field ${e.id} needs an expandedWidth of wide or full.`);
|
|
123
129
|
}
|
|
124
|
-
function
|
|
125
|
-
let { min: t, max: n, step: r } =
|
|
130
|
+
function F(e) {
|
|
131
|
+
let { min: t, max: n, step: r } = b(e);
|
|
126
132
|
if (![
|
|
127
133
|
t,
|
|
128
134
|
n,
|
|
129
135
|
r
|
|
130
136
|
].every(Number.isFinite) || t >= n || r <= 0) throw Error(`Slider field ${e.id} needs finite min < max and a positive step.`);
|
|
131
|
-
if (e.type === "rangeSlider" && r >
|
|
137
|
+
if (e.type === "rangeSlider" && r > m(n, -t)) throw Error(`Range slider ${e.id} needs room for at least one step.`);
|
|
132
138
|
}
|
|
133
|
-
function
|
|
139
|
+
function I(e) {
|
|
134
140
|
let { min: t, max: n, step: r = "any" } = e;
|
|
135
141
|
if ([t, n].some((e) => e !== void 0 && !Number.isFinite(e)) || t !== void 0 && n !== void 0 && t > n || r !== "any" && !(Number.isFinite(r) && r > 0)) throw Error(`Number field ${e.id} needs finite min <= max and a positive step or "any".`);
|
|
136
142
|
if ([e.decreaseLabel, e.increaseLabel].some((e) => e !== void 0 && (typeof e != "string" || !e.trim()))) throw Error(`Number field ${e.id} needs nonempty stepper labels.`);
|
|
137
143
|
}
|
|
138
|
-
function
|
|
144
|
+
function L(e) {
|
|
139
145
|
if (!Array.isArray(e.options)) {
|
|
140
146
|
let t = e.type === "select" ? "Select" : "Choice";
|
|
141
147
|
throw Error(`${t} field ${e.id} needs an options array.`);
|
|
@@ -144,7 +150,7 @@ function I(e) {
|
|
|
144
150
|
let t = e.options.map((e) => e.value);
|
|
145
151
|
if (t.some((e) => typeof e != "string" || !e.trim()) || new Set(t).size !== t.length) throw Error(`Choice field ${e.id} needs nonempty, unique option values.`);
|
|
146
152
|
}
|
|
147
|
-
var
|
|
153
|
+
var R = {
|
|
148
154
|
asset: {
|
|
149
155
|
key: "assetId",
|
|
150
156
|
itemLabel: "asset",
|
|
@@ -156,11 +162,11 @@ var L = {
|
|
|
156
162
|
itemsLabel: "entries"
|
|
157
163
|
}
|
|
158
164
|
};
|
|
159
|
-
function
|
|
165
|
+
function z(e) {
|
|
160
166
|
return e.type === "asset" || e.type === "reference" ? e.picker?.label ?? e.label : e.label;
|
|
161
167
|
}
|
|
162
|
-
function
|
|
163
|
-
let t =
|
|
168
|
+
function B(e) {
|
|
169
|
+
let t = R[e.type], { addLabel: n = `Choose ${z(e)}`, emptyLabel: r, itemLabel: i = t.itemLabel, itemsLabel: a = t.itemsLabel, max: o, isReorderable: s } = e.picker ?? {};
|
|
164
170
|
return {
|
|
165
171
|
addLabel: n,
|
|
166
172
|
emptyLabel: r,
|
|
@@ -170,8 +176,8 @@ function z(e) {
|
|
|
170
176
|
isReorderable: s
|
|
171
177
|
};
|
|
172
178
|
}
|
|
173
|
-
function
|
|
174
|
-
let { key: n } =
|
|
179
|
+
function me(e, t) {
|
|
180
|
+
let { key: n } = R[e.type];
|
|
175
181
|
return (Array.isArray(t) ? t : t === void 0 ? [] : [t]).flatMap((e) => H(e, n) ? [e[n]] : []);
|
|
176
182
|
}
|
|
177
183
|
function V(e) {
|
|
@@ -188,52 +194,52 @@ function U(e) {
|
|
|
188
194
|
return !!e.text?.trim() || e.type === "horizontalRule" || !!e.content?.some(U);
|
|
189
195
|
}
|
|
190
196
|
function W(e) {
|
|
191
|
-
return `${
|
|
197
|
+
return `${z(e)} is required.`;
|
|
192
198
|
}
|
|
193
199
|
function G(e, t) {
|
|
194
200
|
if (typeof t != "string") return "Enter text.";
|
|
195
201
|
if (e.required && !t.trim()) return W(e);
|
|
196
202
|
if ((e.type === "shortText" || e.type === "longText") && e.maxLength !== void 0 && t.length > e.maxLength) return `Enter no more than ${e.maxLength} characters.`;
|
|
197
203
|
}
|
|
198
|
-
function
|
|
204
|
+
function he(e, t) {
|
|
199
205
|
let n = i(t);
|
|
200
206
|
if (n) return n;
|
|
201
207
|
if (e.required && !U(t)) return W(e);
|
|
202
208
|
}
|
|
203
|
-
function
|
|
209
|
+
function K(e, t) {
|
|
204
210
|
if (typeof t != "string") return "Choose an available option.";
|
|
205
211
|
if (t === "") return e.required ? W(e) : void 0;
|
|
206
212
|
if ((e.type === "select" || e.type === "radioGroup") && e.options.length > 0 && !e.options.some((e) => e.value === t)) return "Choose an available option.";
|
|
207
213
|
}
|
|
208
|
-
function
|
|
214
|
+
function q(e) {
|
|
209
215
|
return Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
210
216
|
}
|
|
211
|
-
function
|
|
217
|
+
function J(e, t) {
|
|
212
218
|
if (!Array.isArray(t) || !t.every((e) => typeof e == "string" && e.trim()) || new Set(t).size !== t.length) return "Enter a list of unique, nonempty text values.";
|
|
213
219
|
if (e.required && !t.length) return W(e);
|
|
214
220
|
if (e.type === "tags" && e.max !== void 0 && t.length > e.max) return `Enter no more than ${e.max} tags.`;
|
|
215
221
|
if (e.type === "checkboxGroup" && e.options.length && t.some((t) => !e.options.some((e) => e.value === t))) return "Choose available options.";
|
|
216
222
|
}
|
|
217
|
-
function
|
|
223
|
+
function Y(e, t) {
|
|
218
224
|
if (typeof t != "number" || !Number.isFinite(t)) return "Enter a finite number.";
|
|
219
|
-
let { min: n, max: r } = e.type === "slider" || e.type === "rangeSlider" ?
|
|
225
|
+
let { min: n, max: r } = e.type === "slider" || e.type === "rangeSlider" ? b(e) : e.type === "number" ? e : {};
|
|
220
226
|
if (n !== void 0 && t < n) return `Enter a number of at least ${n}.`;
|
|
221
227
|
if (r !== void 0 && t > r) return `Enter a number no greater than ${r}.`;
|
|
222
228
|
}
|
|
223
|
-
function
|
|
229
|
+
function ge(e, t) {
|
|
224
230
|
if (typeof t != "string") return "Enter a valid calendar date (YYYY-MM-DD).";
|
|
225
231
|
if (!t) return e.required ? W(e) : void 0;
|
|
226
|
-
if (!
|
|
232
|
+
if (!te(t)) return "Enter a valid calendar date (YYYY-MM-DD).";
|
|
227
233
|
if (e.type === "date") {
|
|
228
234
|
if (e.min && t < e.min) return `Choose a date on or after ${e.min}.`;
|
|
229
235
|
if (e.max && t > e.max) return `Choose a date on or before ${e.max}.`;
|
|
230
236
|
}
|
|
231
237
|
}
|
|
232
|
-
function
|
|
233
|
-
return typeof e == "number" && Number.isFinite(e) ?
|
|
238
|
+
function X(e, t) {
|
|
239
|
+
return typeof e == "number" && Number.isFinite(e) ? S(e, t) : void 0;
|
|
234
240
|
}
|
|
235
|
-
function
|
|
236
|
-
let n = e, r =
|
|
241
|
+
function _e(e, t) {
|
|
242
|
+
let n = e, r = X(n?.min, t), i = X(n?.max, t);
|
|
237
243
|
if (r === void 0 && i === void 0) return;
|
|
238
244
|
let [a, o] = [r ?? t.min, i ?? t.max].sort((e, t) => e - t);
|
|
239
245
|
return {
|
|
@@ -241,56 +247,56 @@ function me(e, t) {
|
|
|
241
247
|
max: o
|
|
242
248
|
};
|
|
243
249
|
}
|
|
244
|
-
function
|
|
250
|
+
function ve(e, t) {
|
|
245
251
|
if (!t || typeof t != "object" || Array.isArray(t)) return "Enter a range.";
|
|
246
|
-
let n = t, r = n.min, i = n.max, a =
|
|
252
|
+
let n = t, r = n.min, i = n.max, a = Y(e, r) ?? Y(e, i);
|
|
247
253
|
if (a) return a;
|
|
248
254
|
if (r > i) return "The start must not be greater than the end.";
|
|
249
|
-
if (e.type === "rangeSlider" &&
|
|
255
|
+
if (e.type === "rangeSlider" && m(i, -r) < b(e).step) return "Keep the range endpoints at least one step apart.";
|
|
250
256
|
}
|
|
251
|
-
function
|
|
252
|
-
return typeof t == "string" ? t.trim() ?
|
|
257
|
+
function ye(e, t) {
|
|
258
|
+
return typeof t == "string" ? t.trim() ? v(t) ? void 0 : "Enter a valid colour." : e.required ? W(e) : void 0 : "Enter a valid colour.";
|
|
253
259
|
}
|
|
254
|
-
function
|
|
260
|
+
function Z(e, t) {
|
|
255
261
|
if (e.type !== "asset" && e.type !== "reference") return;
|
|
256
|
-
let { key: n, itemLabel: r, itemsLabel: i } =
|
|
262
|
+
let { key: n, itemLabel: r, itemsLabel: i } = R[e.type];
|
|
257
263
|
if (!e.multiple) return H(t, n) ? void 0 : `Choose an ${r}.`;
|
|
258
264
|
if (!Array.isArray(t) || !t.every((e) => H(e, n))) return `Choose a list of ${i}.`;
|
|
259
265
|
if (e.required && t.length === 0) return W(e);
|
|
260
266
|
let a = e.picker?.max;
|
|
261
|
-
if (a !== void 0 && t.length > a) return `Choose no more than ${a} ${
|
|
267
|
+
if (a !== void 0 && t.length > a) return `Choose no more than ${a} ${B(e).itemsLabel}.`;
|
|
262
268
|
}
|
|
263
|
-
var
|
|
269
|
+
var be = {
|
|
264
270
|
shortText: G,
|
|
265
271
|
longText: G,
|
|
266
|
-
richText:
|
|
267
|
-
number:
|
|
268
|
-
slider:
|
|
269
|
-
rangeSlider:
|
|
270
|
-
date:
|
|
271
|
-
colour:
|
|
272
|
-
radioGroup:
|
|
273
|
-
checkboxGroup:
|
|
274
|
-
tags:
|
|
272
|
+
richText: he,
|
|
273
|
+
number: Y,
|
|
274
|
+
slider: Y,
|
|
275
|
+
rangeSlider: ve,
|
|
276
|
+
date: ge,
|
|
277
|
+
colour: ye,
|
|
278
|
+
radioGroup: K,
|
|
279
|
+
checkboxGroup: J,
|
|
280
|
+
tags: J,
|
|
275
281
|
boolean: (e, t) => typeof t == "boolean" ? void 0 : "Choose a boolean value.",
|
|
276
282
|
dateTime: (e, t) => V(t) ? void 0 : "Enter a valid UTC date and time.",
|
|
277
|
-
select:
|
|
278
|
-
asset:
|
|
279
|
-
reference:
|
|
283
|
+
select: K,
|
|
284
|
+
asset: Z,
|
|
285
|
+
reference: Z
|
|
280
286
|
};
|
|
281
|
-
function
|
|
282
|
-
return t === void 0 ? e.required ? W(e) : void 0 :
|
|
287
|
+
function Q(e, t) {
|
|
288
|
+
return t === void 0 ? e.required ? W(e) : void 0 : be[e.type](e, t);
|
|
283
289
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
290
|
+
function xe(e, t) {
|
|
291
|
+
return A(e), Object.fromEntries(e.fields.flatMap((e) => {
|
|
286
292
|
if (e.type === "divider") return [];
|
|
287
|
-
let n =
|
|
293
|
+
let n = Q(e, Object.hasOwn(t, e.id) ? t[e.id] : void 0);
|
|
288
294
|
return n ? [[e.id, n]] : [];
|
|
289
295
|
}));
|
|
290
296
|
}
|
|
291
297
|
//#endregion
|
|
292
298
|
//#region src/components/FormEditor/choice-control.tsx
|
|
293
|
-
function
|
|
299
|
+
function Se({ field: e, option: t, name: n, checked: r, isDisabled: i, invalid: a, onChange: o }) {
|
|
294
300
|
let s = {
|
|
295
301
|
name: n,
|
|
296
302
|
value: t.value,
|
|
@@ -302,29 +308,29 @@ function ye({ field: e, option: t, name: n, checked: r, isDisabled: i, invalid:
|
|
|
302
308
|
}
|
|
303
309
|
};
|
|
304
310
|
if (e.appearance === "card") {
|
|
305
|
-
let n = e.type === "radioGroup" ?
|
|
306
|
-
return /* @__PURE__ */
|
|
311
|
+
let n = e.type === "radioGroup" ? w : C;
|
|
312
|
+
return /* @__PURE__ */ O(n, {
|
|
307
313
|
...s,
|
|
308
314
|
title: t.label,
|
|
309
315
|
description: t.description
|
|
310
316
|
});
|
|
311
317
|
}
|
|
312
|
-
let c = e.type === "radioGroup" ?
|
|
313
|
-
return /* @__PURE__ */
|
|
318
|
+
let c = e.type === "radioGroup" ? p : d;
|
|
319
|
+
return /* @__PURE__ */ O(c, {
|
|
314
320
|
...s,
|
|
315
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ k("span", { children: [t.label, t.description && /* @__PURE__ */ O("span", {
|
|
316
322
|
className: "ds-form-editor__option-description",
|
|
317
323
|
children: t.description
|
|
318
324
|
})] })
|
|
319
325
|
});
|
|
320
326
|
}
|
|
321
|
-
function
|
|
322
|
-
let s = t.type === "checkboxGroup", c = s ?
|
|
323
|
-
return /* @__PURE__ */
|
|
327
|
+
function Ce({ field: t, stored: n, isDisabled: r, required: i, accessibility: a, onChange: o }) {
|
|
328
|
+
let s = t.type === "checkboxGroup", c = s ? q(n) : typeof n == "string" && n ? [n] : [], l = t.appearance === "card" ? T : f;
|
|
329
|
+
return /* @__PURE__ */ k(ie, { children: [/* @__PURE__ */ O(l, {
|
|
324
330
|
...a,
|
|
325
331
|
label: t.label,
|
|
326
332
|
columns: t.columns ?? (t.appearance === "card" ? 2 : 1),
|
|
327
|
-
children: t.options.map((e) => /* @__PURE__ */
|
|
333
|
+
children: t.options.map((e) => /* @__PURE__ */ O(Se, {
|
|
328
334
|
field: t,
|
|
329
335
|
option: e,
|
|
330
336
|
name: a.id,
|
|
@@ -335,7 +341,7 @@ function be({ field: t, stored: n, isDisabled: r, required: i, accessibility: a,
|
|
|
335
341
|
o(s ? c.includes(e.value) ? c.filter((t) => t !== e.value) : [...c, e.value] : e.value);
|
|
336
342
|
}
|
|
337
343
|
}, e.value))
|
|
338
|
-
}), !s && !i && c.length > 0 && /* @__PURE__ */
|
|
344
|
+
}), !s && !i && c.length > 0 && /* @__PURE__ */ k(e, {
|
|
339
345
|
variant: "simple",
|
|
340
346
|
size: "sm",
|
|
341
347
|
isDisabled: r,
|
|
@@ -345,9 +351,9 @@ function be({ field: t, stored: n, isDisabled: r, required: i, accessibility: a,
|
|
|
345
351
|
}
|
|
346
352
|
//#endregion
|
|
347
353
|
//#region src/components/FormEditor/additional-control.tsx
|
|
348
|
-
function
|
|
349
|
-
let a =
|
|
350
|
-
return /* @__PURE__ */
|
|
354
|
+
function we({ field: e, stored: t, isDisabled: n, accessibility: r, onChange: i }) {
|
|
355
|
+
let a = b(e), o = X(t, a);
|
|
356
|
+
return /* @__PURE__ */ O(x, {
|
|
351
357
|
...r,
|
|
352
358
|
...a,
|
|
353
359
|
prefix: e.prefix,
|
|
@@ -363,9 +369,9 @@ function xe({ field: e, stored: t, isDisabled: n, accessibility: r, onChange: i
|
|
|
363
369
|
}
|
|
364
370
|
});
|
|
365
371
|
}
|
|
366
|
-
function
|
|
367
|
-
let a =
|
|
368
|
-
return /* @__PURE__ */
|
|
372
|
+
function Te({ field: e, stored: t, isDisabled: n, accessibility: r, onChange: i }) {
|
|
373
|
+
let a = b(e), o = _e(t, a);
|
|
374
|
+
return /* @__PURE__ */ O(ee, {
|
|
369
375
|
...r,
|
|
370
376
|
...a,
|
|
371
377
|
prefix: e.prefix,
|
|
@@ -386,7 +392,7 @@ function Se({ field: e, stored: t, isDisabled: n, accessibility: r, onChange: i
|
|
|
386
392
|
}
|
|
387
393
|
});
|
|
388
394
|
}
|
|
389
|
-
function
|
|
395
|
+
function Ee({ field: e, stored: t, isDisabled: n, required: r, accessibility: i, onChange: a }) {
|
|
390
396
|
let o = {
|
|
391
397
|
stored: t,
|
|
392
398
|
isDisabled: n,
|
|
@@ -396,19 +402,19 @@ function Ce({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
396
402
|
};
|
|
397
403
|
switch (e.type) {
|
|
398
404
|
case "radioGroup":
|
|
399
|
-
case "checkboxGroup": return /* @__PURE__ */
|
|
405
|
+
case "checkboxGroup": return /* @__PURE__ */ O(Ce, {
|
|
400
406
|
field: e,
|
|
401
407
|
...o
|
|
402
408
|
});
|
|
403
|
-
case "rangeSlider": return /* @__PURE__ */
|
|
409
|
+
case "rangeSlider": return /* @__PURE__ */ O(Te, {
|
|
404
410
|
field: e,
|
|
405
411
|
...o
|
|
406
412
|
});
|
|
407
|
-
case "slider": return /* @__PURE__ */
|
|
413
|
+
case "slider": return /* @__PURE__ */ O(we, {
|
|
408
414
|
field: e,
|
|
409
415
|
...o
|
|
410
416
|
});
|
|
411
|
-
case "colour": return /* @__PURE__ */
|
|
417
|
+
case "colour": return /* @__PURE__ */ O(y, {
|
|
412
418
|
...i,
|
|
413
419
|
required: r,
|
|
414
420
|
placeholder: e.placeholder,
|
|
@@ -422,20 +428,20 @@ function Ce({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
422
428
|
value: typeof t == "string" ? t : "",
|
|
423
429
|
onInput: (e) => {
|
|
424
430
|
let t = e.currentTarget.value;
|
|
425
|
-
t.trim() && !
|
|
431
|
+
t.trim() && !v(t) && a(t);
|
|
426
432
|
},
|
|
427
433
|
onValueChange: (e) => a(e === "" ? void 0 : e)
|
|
428
434
|
});
|
|
429
|
-
case "tags": return /* @__PURE__ */
|
|
435
|
+
case "tags": return /* @__PURE__ */ O(re, {
|
|
430
436
|
...i,
|
|
431
437
|
required: r,
|
|
432
438
|
placeholder: e.placeholder,
|
|
433
439
|
max: e.max,
|
|
434
440
|
isDisabled: n,
|
|
435
|
-
value:
|
|
441
|
+
value: q(t),
|
|
436
442
|
onValueChange: a
|
|
437
443
|
});
|
|
438
|
-
case "date": return /* @__PURE__ */
|
|
444
|
+
case "date": return /* @__PURE__ */ O(ne, {
|
|
439
445
|
...i,
|
|
440
446
|
placeholder: e.placeholder,
|
|
441
447
|
min: e.min,
|
|
@@ -451,7 +457,7 @@ function Ce({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
451
457
|
}
|
|
452
458
|
//#endregion
|
|
453
459
|
//#region src/components/FormEditor/control.tsx
|
|
454
|
-
function
|
|
460
|
+
function De(e, t) {
|
|
455
461
|
if (e.type === "asset") {
|
|
456
462
|
let n = t.map((e) => ({ assetId: e }));
|
|
457
463
|
return e.multiple ? n : n[0];
|
|
@@ -459,8 +465,8 @@ function we(e, t) {
|
|
|
459
465
|
let n = t.map((e) => ({ entryId: e }));
|
|
460
466
|
return e.multiple ? n : n[0];
|
|
461
467
|
}
|
|
462
|
-
function
|
|
463
|
-
return /* @__PURE__ */
|
|
468
|
+
function $({ field: e, stored: t, isDisabled: n, required: r, accessibility: i, onChange: a }) {
|
|
469
|
+
return /* @__PURE__ */ O(h, {
|
|
464
470
|
...i,
|
|
465
471
|
required: r,
|
|
466
472
|
isDisabled: n,
|
|
@@ -480,9 +486,9 @@ function Te({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
480
486
|
}
|
|
481
487
|
});
|
|
482
488
|
}
|
|
483
|
-
function
|
|
489
|
+
function Oe({ field: e, stored: t, isDisabled: n, required: r, accessibility: i, onChange: a }) {
|
|
484
490
|
let o = !r && !e.options.some((e) => e.value === "");
|
|
485
|
-
return /* @__PURE__ */
|
|
491
|
+
return /* @__PURE__ */ O(g, {
|
|
486
492
|
...i,
|
|
487
493
|
"aria-required": r || void 0,
|
|
488
494
|
isDisabled: n,
|
|
@@ -497,19 +503,19 @@ function Ee({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
497
503
|
onValueChange: (e) => a(e === "" ? void 0 : e)
|
|
498
504
|
});
|
|
499
505
|
}
|
|
500
|
-
function
|
|
501
|
-
return /* @__PURE__ */
|
|
506
|
+
function ke({ field: e, selected: t, items: n, source: r, isDisabled: i, accessibility: a, onChange: o }) {
|
|
507
|
+
return /* @__PURE__ */ O(u, {
|
|
502
508
|
...a,
|
|
503
509
|
...r,
|
|
504
510
|
items: n,
|
|
505
511
|
value: t,
|
|
506
|
-
...
|
|
507
|
-
...
|
|
512
|
+
...B(e),
|
|
513
|
+
...N(e, r),
|
|
508
514
|
isDisabled: i,
|
|
509
|
-
onValueChange: (t) => o(
|
|
515
|
+
onValueChange: (t) => o(De(e, t))
|
|
510
516
|
});
|
|
511
517
|
}
|
|
512
|
-
function
|
|
518
|
+
function Ae({ field: e, stored: t, selected: i, items: s, source: c, isDisabled: l, accessibility: { required: u, ...d }, onChange: f }) {
|
|
513
519
|
let p = {
|
|
514
520
|
stored: t,
|
|
515
521
|
isDisabled: l,
|
|
@@ -518,7 +524,7 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
518
524
|
onChange: f
|
|
519
525
|
};
|
|
520
526
|
switch (e.type) {
|
|
521
|
-
case "shortText": return /* @__PURE__ */
|
|
527
|
+
case "shortText": return /* @__PURE__ */ O(r, {
|
|
522
528
|
...d,
|
|
523
529
|
required: u,
|
|
524
530
|
disabled: l,
|
|
@@ -527,10 +533,10 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
527
533
|
maxLength: e.maxLength,
|
|
528
534
|
readOnly: e.readOnly,
|
|
529
535
|
autoFocus: e.autoFocus,
|
|
530
|
-
value:
|
|
536
|
+
value: M(t),
|
|
531
537
|
onChange: (e) => f(e.target.value)
|
|
532
538
|
});
|
|
533
|
-
case "longText": return /* @__PURE__ */
|
|
539
|
+
case "longText": return /* @__PURE__ */ O(n, {
|
|
534
540
|
...d,
|
|
535
541
|
required: u,
|
|
536
542
|
disabled: l,
|
|
@@ -539,21 +545,21 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
539
545
|
maxLength: e.maxLength,
|
|
540
546
|
readOnly: e.readOnly,
|
|
541
547
|
autoFocus: e.autoFocus,
|
|
542
|
-
value:
|
|
548
|
+
value: M(t),
|
|
543
549
|
onChange: (e) => f(e.target.value)
|
|
544
550
|
});
|
|
545
|
-
case "number": return /* @__PURE__ */
|
|
551
|
+
case "number": return /* @__PURE__ */ O($, {
|
|
546
552
|
field: e,
|
|
547
553
|
...p
|
|
548
554
|
});
|
|
549
|
-
case "boolean": return /* @__PURE__ */
|
|
555
|
+
case "boolean": return /* @__PURE__ */ O(_, {
|
|
550
556
|
...d,
|
|
551
557
|
isDisabled: l,
|
|
552
558
|
autoFocus: e.autoFocus,
|
|
553
559
|
isSelected: t === !0,
|
|
554
560
|
onSelectedChange: f
|
|
555
561
|
});
|
|
556
|
-
case "dateTime": return /* @__PURE__ */
|
|
562
|
+
case "dateTime": return /* @__PURE__ */ O(r, {
|
|
557
563
|
...d,
|
|
558
564
|
required: u,
|
|
559
565
|
disabled: l,
|
|
@@ -563,7 +569,7 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
563
569
|
value: V(t)?.slice(0, -1) ?? "",
|
|
564
570
|
onChange: (e) => f(V(`${e.target.value}Z`))
|
|
565
571
|
});
|
|
566
|
-
case "richText": return /* @__PURE__ */
|
|
572
|
+
case "richText": return /* @__PURE__ */ O(o, {
|
|
567
573
|
...d,
|
|
568
574
|
expandedWidth: e.expandedWidth,
|
|
569
575
|
label: e.label,
|
|
@@ -574,19 +580,19 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
574
580
|
value: t === void 0 ? a : t,
|
|
575
581
|
onChange: f
|
|
576
582
|
});
|
|
577
|
-
case "select": return /* @__PURE__ */
|
|
583
|
+
case "select": return /* @__PURE__ */ O(Oe, {
|
|
578
584
|
field: e,
|
|
579
585
|
...p
|
|
580
586
|
});
|
|
581
587
|
case "asset":
|
|
582
|
-
case "reference": return /* @__PURE__ */
|
|
588
|
+
case "reference": return /* @__PURE__ */ O(ke, {
|
|
583
589
|
field: e,
|
|
584
590
|
items: s,
|
|
585
591
|
source: c,
|
|
586
592
|
selected: i ?? [],
|
|
587
593
|
...p
|
|
588
594
|
});
|
|
589
|
-
default: return /* @__PURE__ */
|
|
595
|
+
default: return /* @__PURE__ */ O(Ee, {
|
|
590
596
|
field: e,
|
|
591
597
|
...p
|
|
592
598
|
});
|
|
@@ -594,28 +600,28 @@ function Oe({ field: e, stored: t, selected: i, items: s, source: c, isDisabled:
|
|
|
594
600
|
}
|
|
595
601
|
//#endregion
|
|
596
602
|
//#region src/components/FormEditor/index.tsx
|
|
597
|
-
function
|
|
598
|
-
let u =
|
|
603
|
+
function je({ field: e, stored: n, items: r, source: i, isDisabled: a, error: o, isErrorVisible: c, onChange: l }) {
|
|
604
|
+
let u = E(() => o === void 0 && c ? Q(e, n) : void 0, [
|
|
599
605
|
o,
|
|
600
606
|
c,
|
|
601
607
|
e,
|
|
602
608
|
n
|
|
603
|
-
]), d =
|
|
604
|
-
return /* @__PURE__ */
|
|
609
|
+
]), d = E(() => e.type === "asset" || e.type === "reference" ? me(e, n) : void 0, [e, n]);
|
|
610
|
+
return /* @__PURE__ */ O(s, {
|
|
605
611
|
width: e.width,
|
|
606
612
|
padded: !1,
|
|
607
613
|
center: !1,
|
|
608
614
|
className: "ds-form-editor__field",
|
|
609
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ O(t, {
|
|
610
616
|
...de(e, n, d, i),
|
|
611
|
-
label: e.type === "dateTime" ? `${e.label} (UTC)` :
|
|
617
|
+
label: e.type === "dateTime" ? `${e.label} (UTC)` : z(e),
|
|
612
618
|
hint: e.hint,
|
|
613
619
|
labelHint: e.labelHint,
|
|
614
620
|
error: o ?? u,
|
|
615
621
|
isRequired: e.required,
|
|
616
|
-
count:
|
|
617
|
-
isGroup: d !== void 0 ||
|
|
618
|
-
children: (t) => /* @__PURE__ */
|
|
622
|
+
count: pe(e, n, d, i),
|
|
623
|
+
isGroup: d !== void 0 || Me.has(e.type),
|
|
624
|
+
children: (t) => /* @__PURE__ */ O(Ae, {
|
|
619
625
|
field: e,
|
|
620
626
|
stored: n,
|
|
621
627
|
selected: d,
|
|
@@ -628,19 +634,19 @@ function ke({ field: e, stored: n, items: r, source: i, isDisabled: a, error: o,
|
|
|
628
634
|
})
|
|
629
635
|
});
|
|
630
636
|
}
|
|
631
|
-
var
|
|
637
|
+
var Me = /* @__PURE__ */ new Set([
|
|
632
638
|
"radioGroup",
|
|
633
639
|
"checkboxGroup",
|
|
634
640
|
"rangeSlider"
|
|
635
|
-
]),
|
|
641
|
+
]), Ne = /* @__PURE__ */ new Set([
|
|
636
642
|
"slider",
|
|
637
643
|
"rangeSlider",
|
|
638
644
|
"date",
|
|
639
645
|
"colour"
|
|
640
646
|
]);
|
|
641
|
-
function
|
|
642
|
-
let [m, h] =
|
|
643
|
-
|
|
647
|
+
function Pe({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, pickerItems: i = {}, pickerSources: a = {}, errors: o = {}, isDisabled: s = !1, showAllErrors: c = !1, columns: l = 1, minColumnWidth: u = "16rem", className: d, style: f, ...p }) {
|
|
648
|
+
let [m, h] = D(n), [g, _] = D(() => /* @__PURE__ */ new Set()), v = t ?? m;
|
|
649
|
+
E(() => A(e), [e]);
|
|
644
650
|
let y = (e, n) => {
|
|
645
651
|
let i = { ...v };
|
|
646
652
|
n === void 0 ? delete i[e] : i[e] = n, t === void 0 && h(i), _((t) => new Set(t).add(e)), r?.(i, { fieldId: e });
|
|
@@ -648,7 +654,7 @@ function Me({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, picke
|
|
|
648
654
|
"--form-editor-columns": l,
|
|
649
655
|
"--form-editor-min-column": u
|
|
650
656
|
};
|
|
651
|
-
return /* @__PURE__ */
|
|
657
|
+
return /* @__PURE__ */ O("div", {
|
|
652
658
|
className: [
|
|
653
659
|
"ds-form-editor",
|
|
654
660
|
l === "auto" && "ds-form-editor--auto",
|
|
@@ -660,9 +666,9 @@ function Me({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, picke
|
|
|
660
666
|
},
|
|
661
667
|
...p,
|
|
662
668
|
children: e.fields.map((e) => {
|
|
663
|
-
if (e.type === "divider") return /* @__PURE__ */
|
|
664
|
-
let t = Object.hasOwn(v, e.id) ? v[e.id] : void 0, n = s || !!e.isDisabled, r = n || "readOnly" in e && !!e.readOnly, l = typeof t == "string" ? t.trim() !== "" : t !== void 0, u = c || g.has(e.id) || l &&
|
|
665
|
-
return /* @__PURE__ */
|
|
669
|
+
if (e.type === "divider") return /* @__PURE__ */ O("hr", { className: "ds-form-editor__divider" }, e.id);
|
|
670
|
+
let t = Object.hasOwn(v, e.id) ? v[e.id] : void 0, n = s || !!e.isDisabled, r = n || "readOnly" in e && !!e.readOnly, l = typeof t == "string" ? t.trim() !== "" : t !== void 0, u = c || g.has(e.id) || l && Ne.has(e.type) || e.type === "number" && typeof t == "number";
|
|
671
|
+
return /* @__PURE__ */ O(je, {
|
|
666
672
|
field: e,
|
|
667
673
|
stored: t,
|
|
668
674
|
items: i[e.id] ?? [],
|
|
@@ -678,6 +684,6 @@ function Me({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, picke
|
|
|
678
684
|
});
|
|
679
685
|
}
|
|
680
686
|
//#endregion
|
|
681
|
-
export {
|
|
687
|
+
export { xe as n, Pe as t };
|
|
682
688
|
|
|
683
|
-
//# sourceMappingURL=FormEditor-
|
|
689
|
+
//# sourceMappingURL=FormEditor-HqqFmu7s.js.map
|