@zeng-alt/formkit-form-builder 1.3.0 → 2.0.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/CHANGELOG.md +41 -0
- package/README.md +323 -137
- package/dist/builder.css +1 -1
- package/dist/builder.es.js +7916 -42625
- package/dist/builder.es.js.map +1 -0
- package/dist/builder.umd.js +61 -90
- package/dist/chunks/AiPrompt-CWUhBDH4.js +174 -0
- package/dist/chunks/AiPrompt-CWUhBDH4.js.map +1 -0
- package/dist/chunks/BadgeEditor-B1kB2DXg.js +133 -0
- package/dist/chunks/BadgeEditor-B1kB2DXg.js.map +1 -0
- package/dist/chunks/BuilderPreview-CKL5bqCP.js +142 -0
- package/dist/chunks/BuilderPreview-CKL5bqCP.js.map +1 -0
- package/dist/chunks/ButtonGroupEditor-C5pChDFz.js +55 -0
- package/dist/chunks/ButtonGroupEditor-C5pChDFz.js.map +1 -0
- package/dist/chunks/CardEditor-Bsbriwvu.js +61 -0
- package/dist/chunks/CardEditor-Bsbriwvu.js.map +1 -0
- package/dist/chunks/CheckboxEditor-CxNEvn_Y.js +23 -0
- package/dist/chunks/CheckboxEditor-CxNEvn_Y.js.map +1 -0
- package/dist/chunks/CollapseEditor-CUFTdj0V.js +36 -0
- package/dist/chunks/CollapseEditor-CUFTdj0V.js.map +1 -0
- package/dist/chunks/ColorEditor-Bo9QkLsR.js +17 -0
- package/dist/chunks/ColorEditor-Bo9QkLsR.js.map +1 -0
- package/dist/chunks/DataTableContainerPreview-phlGcigM.js +403 -0
- package/dist/chunks/DataTableContainerPreview-phlGcigM.js.map +1 -0
- package/dist/chunks/DataTableEditor-BTDWXdtk.js +473 -0
- package/dist/chunks/DataTableEditor-BTDWXdtk.js.map +1 -0
- package/dist/chunks/DataTableFieldPicker-qWxGmVxr.js +1579 -0
- package/dist/chunks/DataTableFieldPicker-qWxGmVxr.js.map +1 -0
- package/dist/chunks/DataTableRowCellInput-BLTM3I21.js +195 -0
- package/dist/chunks/DataTableRowCellInput-BLTM3I21.js.map +1 -0
- package/dist/chunks/DataTableSearchField-PU89hniM.js +81 -0
- package/dist/chunks/DataTableSearchField-PU89hniM.js.map +1 -0
- package/dist/chunks/DateLikeEditor-ZkCbMhpE.js +74 -0
- package/dist/chunks/DateLikeEditor-ZkCbMhpE.js.map +1 -0
- package/dist/chunks/DateTimeEditor-C-jZKTT5.js +73 -0
- package/dist/chunks/DateTimeEditor-C-jZKTT5.js.map +1 -0
- package/dist/chunks/EditorSection-BR3qdK2c.js +23 -0
- package/dist/chunks/EditorSection-BR3qdK2c.js.map +1 -0
- package/dist/chunks/EditsLayout-fueCrxZM.js +22 -0
- package/dist/chunks/EditsLayout-fueCrxZM.js.map +1 -0
- package/dist/chunks/ExprEditModal-CeXiPStM.js +540 -0
- package/dist/chunks/ExprEditModal-CeXiPStM.js.map +1 -0
- package/dist/chunks/FileEditor-BXELd_SD.js +35 -0
- package/dist/chunks/FileEditor-BXELd_SD.js.map +1 -0
- package/dist/chunks/FormRenderer-BwykpB3h.js +2625 -0
- package/dist/chunks/FormRenderer-BwykpB3h.js.map +1 -0
- package/dist/chunks/GroupEditor-DchDUDDY.js +13 -0
- package/dist/chunks/GroupEditor-DchDUDDY.js.map +1 -0
- package/dist/chunks/HistoryPanel-1p0-Obef.js +104 -0
- package/dist/chunks/HistoryPanel-1p0-Obef.js.map +1 -0
- package/dist/chunks/ImportExportModal-CTqkyp1s.js +266 -0
- package/dist/chunks/ImportExportModal-CTqkyp1s.js.map +1 -0
- package/dist/chunks/InlineEditableText-BO-dT5rp.js +68 -0
- package/dist/chunks/InlineEditableText-BO-dT5rp.js.map +1 -0
- package/dist/chunks/InputGroupEditor-D_5giZtN.js +13 -0
- package/dist/chunks/InputGroupEditor-D_5giZtN.js.map +1 -0
- package/dist/chunks/IssuesPanel-CW5bdwvC.js +82 -0
- package/dist/chunks/IssuesPanel-CW5bdwvC.js.map +1 -0
- package/dist/chunks/JsCodeEditor-CIPxhwZa.js +751 -0
- package/dist/chunks/JsCodeEditor-CIPxhwZa.js.map +1 -0
- package/dist/chunks/JsonTextarea-C3mnRwtG.js +54 -0
- package/dist/chunks/JsonTextarea-C3mnRwtG.js.map +1 -0
- package/dist/chunks/ListEditor-C1hn5yOi.js +25 -0
- package/dist/chunks/ListEditor-C1hn5yOi.js.map +1 -0
- package/dist/chunks/NaiveAlertEditor-DACimYS1.js +67 -0
- package/dist/chunks/NaiveAlertEditor-DACimYS1.js.map +1 -0
- package/dist/chunks/NaiveAutoCompleteEditor-CtCvPe7H.js +122 -0
- package/dist/chunks/NaiveAutoCompleteEditor-CtCvPe7H.js.map +1 -0
- package/dist/chunks/NaiveAvatarEditor-CmDUodoa.js +36 -0
- package/dist/chunks/NaiveAvatarEditor-CmDUodoa.js.map +1 -0
- package/dist/chunks/NaiveBackTopEditor-Iq-li1JT.js +69 -0
- package/dist/chunks/NaiveBackTopEditor-Iq-li1JT.js.map +1 -0
- package/dist/chunks/NaiveBasicSection-wNyhGLou.js +184 -0
- package/dist/chunks/NaiveBasicSection-wNyhGLou.js.map +1 -0
- package/dist/chunks/NaiveBlockquoteEditor-BfqWqKwF.js +13 -0
- package/dist/chunks/NaiveBlockquoteEditor-BfqWqKwF.js.map +1 -0
- package/dist/chunks/NaiveButtonEditor-B4Rp2T7n.js +168 -0
- package/dist/chunks/NaiveButtonEditor-B4Rp2T7n.js.map +1 -0
- package/dist/chunks/NaiveCascaderEditor-BtD6KRXl.js +26 -0
- package/dist/chunks/NaiveCascaderEditor-BtD6KRXl.js.map +1 -0
- package/dist/chunks/NaiveDividerEditor-B1dPteDV.js +52 -0
- package/dist/chunks/NaiveDividerEditor-B1dPteDV.js.map +1 -0
- package/dist/chunks/NaiveH1Editor-Can7c9mh.js +14 -0
- package/dist/chunks/NaiveH1Editor-Can7c9mh.js.map +1 -0
- package/dist/chunks/NaiveH2Editor-BRKeEVf4.js +14 -0
- package/dist/chunks/NaiveH2Editor-BRKeEVf4.js.map +1 -0
- package/dist/chunks/NaiveH3Editor-DCdyd3-n.js +14 -0
- package/dist/chunks/NaiveH3Editor-DCdyd3-n.js.map +1 -0
- package/dist/chunks/NaiveH4Editor-COFS6udv.js +14 -0
- package/dist/chunks/NaiveH4Editor-COFS6udv.js.map +1 -0
- package/dist/chunks/NaiveH5Editor-CQEe6s1O.js +14 -0
- package/dist/chunks/NaiveH5Editor-CQEe6s1O.js.map +1 -0
- package/dist/chunks/NaiveH6Editor-DHGzIUAl.js +14 -0
- package/dist/chunks/NaiveH6Editor-DHGzIUAl.js.map +1 -0
- package/dist/chunks/NaiveHeaderEditor-Cy02AmLI.js +12 -0
- package/dist/chunks/NaiveHeaderEditor-Cy02AmLI.js.map +1 -0
- package/dist/chunks/NaiveImageEditor-WyVYLNbT.js +201 -0
- package/dist/chunks/NaiveImageEditor-WyVYLNbT.js.map +1 -0
- package/dist/chunks/NaiveLiEditor-CC65rrna.js +13 -0
- package/dist/chunks/NaiveLiEditor-CC65rrna.js.map +1 -0
- package/dist/chunks/NaiveLinkEditor-DkjFrzEE.js +38 -0
- package/dist/chunks/NaiveLinkEditor-DkjFrzEE.js.map +1 -0
- package/dist/chunks/NaiveMentionEditor-BupocM2c.js +23 -0
- package/dist/chunks/NaiveMentionEditor-BupocM2c.js.map +1 -0
- package/dist/chunks/NaiveOlEditor-DYFqg6Sp.js +16 -0
- package/dist/chunks/NaiveOlEditor-DYFqg6Sp.js.map +1 -0
- package/dist/chunks/NaiveParagraphEditor-B3Ju6ZNI.js +104 -0
- package/dist/chunks/NaiveParagraphEditor-B3Ju6ZNI.js.map +1 -0
- package/dist/chunks/NaiveProgressEditor-CwpsZG2z.js +119 -0
- package/dist/chunks/NaiveProgressEditor-CwpsZG2z.js.map +1 -0
- package/dist/chunks/NaiveQrCodeEditor-YWWAozHe.js +77 -0
- package/dist/chunks/NaiveQrCodeEditor-YWWAozHe.js.map +1 -0
- package/dist/chunks/NaiveRateEditor-BVY1QiXv.js +44 -0
- package/dist/chunks/NaiveRateEditor-BVY1QiXv.js.map +1 -0
- package/dist/chunks/NaiveSwitchEditor-BP1v-oZf.js +17 -0
- package/dist/chunks/NaiveSwitchEditor-BP1v-oZf.js.map +1 -0
- package/dist/chunks/NaiveTextEditor-C38l4Q-j.js +107 -0
- package/dist/chunks/NaiveTextEditor-C38l4Q-j.js.map +1 -0
- package/dist/chunks/NaiveTransferEditor-BRH_5ioX.js +19 -0
- package/dist/chunks/NaiveTransferEditor-BRH_5ioX.js.map +1 -0
- package/dist/chunks/NaiveTreeSelectEditor-jX2DrMcT.js +26 -0
- package/dist/chunks/NaiveTreeSelectEditor-jX2DrMcT.js.map +1 -0
- package/dist/chunks/NaiveUlEditor-CMKofBid.js +16 -0
- package/dist/chunks/NaiveUlEditor-CMKofBid.js.map +1 -0
- package/dist/chunks/NumberEditor-0P2Li_GH.js +40 -0
- package/dist/chunks/NumberEditor-0P2Li_GH.js.map +1 -0
- package/dist/chunks/NumberInput-DU-FiLxW.js +37 -0
- package/dist/chunks/NumberInput-DU-FiLxW.js.map +1 -0
- package/dist/chunks/OptionsLayoutSection-C9gVadRA.js +21 -0
- package/dist/chunks/OptionsLayoutSection-C9gVadRA.js.map +1 -0
- package/dist/chunks/OptionsSourceTabs-3fsum0OI.js +628 -0
- package/dist/chunks/OptionsSourceTabs-3fsum0OI.js.map +1 -0
- package/dist/chunks/OptionsTagsSection-vKkxlWLw.js +31 -0
- package/dist/chunks/OptionsTagsSection-vKkxlWLw.js.map +1 -0
- package/dist/chunks/PasswordEditor-Igld1ak6.js +29 -0
- package/dist/chunks/PasswordEditor-Igld1ak6.js.map +1 -0
- package/dist/chunks/PlaceholderSection-BKOS-7Qu.js +26 -0
- package/dist/chunks/PlaceholderSection-BKOS-7Qu.js.map +1 -0
- package/dist/chunks/RadioEditor-CyJhILjI.js +23 -0
- package/dist/chunks/RadioEditor-CyJhILjI.js.map +1 -0
- package/dist/chunks/RangeEditor-PGOnGfuV.js +86 -0
- package/dist/chunks/RangeEditor-PGOnGfuV.js.map +1 -0
- package/dist/chunks/RichText-DqcMtoil.js +424 -0
- package/dist/chunks/RichText-DqcMtoil.js.map +1 -0
- package/dist/chunks/RichTextEditor-EfA6m9w2.js +81 -0
- package/dist/chunks/RichTextEditor-EfA6m9w2.js.map +1 -0
- package/dist/chunks/SelectEditor-mJ_zUivj.js +21 -0
- package/dist/chunks/SelectEditor-mJ_zUivj.js.map +1 -0
- package/dist/chunks/SelectInput-DY4Oi2Lp.js +31 -0
- package/dist/chunks/SelectInput-DY4Oi2Lp.js.map +1 -0
- package/dist/chunks/SignatureEditor-BNttg68X.js +52 -0
- package/dist/chunks/SignatureEditor-BNttg68X.js.map +1 -0
- package/dist/chunks/SignaturePad-qhmoMg1E.js +170 -0
- package/dist/chunks/SignaturePad-qhmoMg1E.js.map +1 -0
- package/dist/chunks/StepsEditor-C8U-ext8.js +63 -0
- package/dist/chunks/StepsEditor-C8U-ext8.js.map +1 -0
- package/dist/chunks/SubmitEditor-B9R984q8.js +168 -0
- package/dist/chunks/SubmitEditor-B9R984q8.js.map +1 -0
- package/dist/chunks/SwitchInput-DQrSTyW0.js +34 -0
- package/dist/chunks/SwitchInput-DQrSTyW0.js.map +1 -0
- package/dist/chunks/TabsEditor-DepUhmsz.js +100 -0
- package/dist/chunks/TabsEditor-DepUhmsz.js.map +1 -0
- package/dist/chunks/TagsInput-DeG3Om1R.js +36 -0
- package/dist/chunks/TagsInput-DeG3Om1R.js.map +1 -0
- package/dist/chunks/TemplatePickerModal-DPkdJJJs.js +440 -0
- package/dist/chunks/TemplatePickerModal-DPkdJJJs.js.map +1 -0
- package/dist/chunks/TextInput-D1EMeBPf.js +53 -0
- package/dist/chunks/TextInput-D1EMeBPf.js.map +1 -0
- package/dist/chunks/TextLikeEditor-Du0nHQWQ.js +56 -0
- package/dist/chunks/TextLikeEditor-Du0nHQWQ.js.map +1 -0
- package/dist/chunks/ToggleInput-DoZPwM0A.js +51 -0
- package/dist/chunks/ToggleInput-DoZPwM0A.js.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-BxNYtmDu.js +8 -0
- package/dist/chunks/axios-agM_iOnv.js +1589 -0
- package/dist/chunks/axios-agM_iOnv.js.map +1 -0
- package/dist/chunks/bind-runtime-CRyrBYCi.js +58 -0
- package/dist/chunks/bind-runtime-CRyrBYCi.js.map +1 -0
- package/dist/chunks/canvas-locate-CxDD4bDp.js +64 -0
- package/dist/chunks/canvas-locate-CxDD4bDp.js.map +1 -0
- package/dist/chunks/context-4zkSHwVA.js +2510 -0
- package/dist/chunks/context-4zkSHwVA.js.map +1 -0
- package/dist/chunks/create-form-builder-state-CoXaJhWO.js +358 -0
- package/dist/chunks/create-form-builder-state-CoXaJhWO.js.map +1 -0
- package/dist/chunks/date-family-BYkr1OaE.js +75 -0
- package/dist/chunks/date-family-BYkr1OaE.js.map +1 -0
- package/dist/chunks/evaluator-DqNftI0d.js +139 -0
- package/dist/chunks/evaluator-DqNftI0d.js.map +1 -0
- package/dist/chunks/expr-parse-u7_CxMWg.js +463 -0
- package/dist/chunks/expr-parse-u7_CxMWg.js.map +1 -0
- package/dist/chunks/expr-source-BRPYrxuB.js +118 -0
- package/dist/chunks/expr-source-BRPYrxuB.js.map +1 -0
- package/dist/chunks/form-builder-plugin-BCbiWZKT.js +280 -0
- package/dist/chunks/form-builder-plugin-BCbiWZKT.js.map +1 -0
- package/dist/chunks/form-fields-DjLk8iH2.js +877 -0
- package/dist/chunks/form-fields-DjLk8iH2.js.map +1 -0
- package/dist/chunks/form-layout-Dm4QeYrL.js +69 -0
- package/dist/chunks/form-layout-Dm4QeYrL.js.map +1 -0
- package/dist/chunks/grid-C8xMKll5.js +137 -0
- package/dist/chunks/grid-C8xMKll5.js.map +1 -0
- package/dist/chunks/keys-D4DlFgJT.js +61 -0
- package/dist/chunks/keys-D4DlFgJT.js.map +1 -0
- package/dist/chunks/media-family-B4Wijm18.js +178 -0
- package/dist/chunks/media-family-B4Wijm18.js.map +1 -0
- package/dist/chunks/misc-family-CQJhCKco.js +133 -0
- package/dist/chunks/misc-family-CQJhCKco.js.map +1 -0
- package/dist/chunks/rich-text-toolbar-CQidmjGI.js +32 -0
- package/dist/chunks/rich-text-toolbar-CQidmjGI.js.map +1 -0
- package/dist/chunks/rolldown-runtime-DMoxecvO.js +11 -0
- package/dist/chunks/schema-adapter-_sLPmdLy.js +2089 -0
- package/dist/chunks/schema-adapter-_sLPmdLy.js.map +1 -0
- package/dist/chunks/selection-family-T_wZGrXc.js +249 -0
- package/dist/chunks/selection-family-T_wZGrXc.js.map +1 -0
- package/dist/chunks/use-ai-prompt-focus-39DHK41R.js +14 -0
- package/dist/chunks/use-ai-prompt-focus-39DHK41R.js.map +1 -0
- package/dist/chunks/use-bind-events-C-H7jhW_.js +89 -0
- package/dist/chunks/use-bind-events-C-H7jhW_.js.map +1 -0
- package/dist/chunks/use-config-DTr8dhzM.js +16 -0
- package/dist/chunks/use-config-DTr8dhzM.js.map +1 -0
- package/dist/chunks/use-dictionary-BAN34x49.js +26 -0
- package/dist/chunks/use-dictionary-BAN34x49.js.map +1 -0
- package/dist/chunks/use-dynamic-options-DbGSz-3_.js +29 -0
- package/dist/chunks/use-dynamic-options-DbGSz-3_.js.map +1 -0
- package/dist/chunks/use-schema-render-data-DagOPKiy.js +33 -0
- package/dist/chunks/use-schema-render-data-DagOPKiy.js.map +1 -0
- package/dist/chunks/utils-DlUMv2vG.js +53 -0
- package/dist/chunks/utils-DlUMv2vG.js.map +1 -0
- package/dist/index.d.ts +244 -1079
- package/dist/renderer.d.ts +632 -0
- package/dist/renderer.es.js +6 -0
- package/dist/renderer.umd.js +34 -0
- package/package.json +39 -24
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
import { t as e } from "./expr-parse-u7_CxMWg.js";
|
|
2
|
+
import { a as t, o as n } from "./form-layout-Dm4QeYrL.js";
|
|
3
|
+
import { n as r, t as i } from "./expr-source-BRPYrxuB.js";
|
|
4
|
+
import { a } from "./grid-C8xMKll5.js";
|
|
5
|
+
import { l as o, o as s, r as c } from "./create-form-builder-state-CoXaJhWO.js";
|
|
6
|
+
import { computed as l } from "vue";
|
|
7
|
+
//#region src/dsl/refs.ts
|
|
8
|
+
var u = [
|
|
9
|
+
"visibleIf",
|
|
10
|
+
"requiredIf",
|
|
11
|
+
"disabledIf",
|
|
12
|
+
"readonlyIf"
|
|
13
|
+
];
|
|
14
|
+
function d(e) {
|
|
15
|
+
return e.key ?? e.id;
|
|
16
|
+
}
|
|
17
|
+
function f(e) {
|
|
18
|
+
if (e.category === "container" || e.category === "layout") {
|
|
19
|
+
let t = e.children;
|
|
20
|
+
return Array.isArray(t) ? t : [];
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
function p(e) {
|
|
25
|
+
let t = e.props?.columns;
|
|
26
|
+
return Array.isArray(t) ? t : [];
|
|
27
|
+
}
|
|
28
|
+
function m(e, t) {
|
|
29
|
+
return e[t];
|
|
30
|
+
}
|
|
31
|
+
function h(e, t) {
|
|
32
|
+
if (e) {
|
|
33
|
+
if (e.type === "field") {
|
|
34
|
+
t.add(e.name);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (e.type === "call") for (let n of e.args) h(n, t);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function g(e, t, n) {
|
|
41
|
+
if (e.type === "field") return e.name === t ? {
|
|
42
|
+
expr: {
|
|
43
|
+
...e,
|
|
44
|
+
name: n
|
|
45
|
+
},
|
|
46
|
+
count: 1
|
|
47
|
+
} : {
|
|
48
|
+
expr: e,
|
|
49
|
+
count: 0
|
|
50
|
+
};
|
|
51
|
+
if (e.type === "call") {
|
|
52
|
+
let r = 0, i = !1, a = e.args.map((e) => {
|
|
53
|
+
let a = g(e, t, n);
|
|
54
|
+
return r += a.count, a.expr !== e && (i = !0), a.expr;
|
|
55
|
+
});
|
|
56
|
+
return i ? {
|
|
57
|
+
expr: {
|
|
58
|
+
...e,
|
|
59
|
+
args: a
|
|
60
|
+
},
|
|
61
|
+
count: r
|
|
62
|
+
} : {
|
|
63
|
+
expr: e,
|
|
64
|
+
count: 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
expr: e,
|
|
69
|
+
count: 0
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function _(e) {
|
|
73
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
74
|
+
}
|
|
75
|
+
function v(e, t, n) {
|
|
76
|
+
let r = RegExp(`\\$${_(t)}(?![A-Za-z0-9_])`, "g");
|
|
77
|
+
return e.replace(r, () => `$${n}`);
|
|
78
|
+
}
|
|
79
|
+
function y(e, t) {
|
|
80
|
+
return RegExp(`\\$${_(t)}(?![A-Za-z0-9_])`).test(e);
|
|
81
|
+
}
|
|
82
|
+
function b(e) {
|
|
83
|
+
if (e.rule !== "confirm") return;
|
|
84
|
+
let t = e.args?.[0];
|
|
85
|
+
return typeof t == "string" && t ? t : void 0;
|
|
86
|
+
}
|
|
87
|
+
function x(t, n, i, a = []) {
|
|
88
|
+
if (typeof t.expr == "string" && t.expr.trim()) {
|
|
89
|
+
let o = e(t.expr), s = r(o), c = /* @__PURE__ */ new Set();
|
|
90
|
+
s || h(o, c);
|
|
91
|
+
for (let e of c) a.push({
|
|
92
|
+
nodeKey: n,
|
|
93
|
+
nodeType: t.type,
|
|
94
|
+
location: { kind: "expr" },
|
|
95
|
+
fieldName: e,
|
|
96
|
+
dataTableKey: i?.key,
|
|
97
|
+
columnIndex: i?.index
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (Array.isArray(t.validation)) for (let e of t.validation) {
|
|
101
|
+
let r = b(e);
|
|
102
|
+
r && a.push({
|
|
103
|
+
nodeKey: n,
|
|
104
|
+
nodeType: t.type,
|
|
105
|
+
location: {
|
|
106
|
+
kind: "validation",
|
|
107
|
+
rule: e.rule
|
|
108
|
+
},
|
|
109
|
+
fieldName: r,
|
|
110
|
+
dataTableKey: i?.key,
|
|
111
|
+
columnIndex: i?.index
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return a;
|
|
115
|
+
}
|
|
116
|
+
function S(e) {
|
|
117
|
+
let t = [], n = (e, r) => {
|
|
118
|
+
let i = d(e);
|
|
119
|
+
for (let n of u) {
|
|
120
|
+
let a = m(e, n);
|
|
121
|
+
if (!a) continue;
|
|
122
|
+
let o = /* @__PURE__ */ new Set();
|
|
123
|
+
h(a, o);
|
|
124
|
+
for (let a of o) t.push({
|
|
125
|
+
nodeKey: i,
|
|
126
|
+
nodeType: e.type,
|
|
127
|
+
location: {
|
|
128
|
+
kind: "expr-key",
|
|
129
|
+
exprKey: n
|
|
130
|
+
},
|
|
131
|
+
fieldName: a,
|
|
132
|
+
dataTableKey: r?.key,
|
|
133
|
+
columnIndex: r?.index
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
e.category === "field" && x(e, i, r, t), p(e).forEach((e, t) => {
|
|
137
|
+
e.element && n(e.element, {
|
|
138
|
+
key: i,
|
|
139
|
+
index: t
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
for (let t of f(e)) n(t, r);
|
|
143
|
+
};
|
|
144
|
+
for (let t of e?.root?.children ?? []) n(t);
|
|
145
|
+
return t;
|
|
146
|
+
}
|
|
147
|
+
function C(t, n, a) {
|
|
148
|
+
if (!n || !a || n === a) return {
|
|
149
|
+
definition: t,
|
|
150
|
+
count: 0
|
|
151
|
+
};
|
|
152
|
+
let o = 0, s = (e) => {
|
|
153
|
+
let t = e;
|
|
154
|
+
for (let e of u) {
|
|
155
|
+
let r = m(t, e);
|
|
156
|
+
if (!r) continue;
|
|
157
|
+
let i = g(r, n, a);
|
|
158
|
+
i.count > 0 && (o += i.count, t = {
|
|
159
|
+
...t,
|
|
160
|
+
[e]: i.expr
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return t;
|
|
164
|
+
}, c = (t) => {
|
|
165
|
+
let s = t;
|
|
166
|
+
if (typeof s.expr == "string" && s.expr.trim()) {
|
|
167
|
+
let t = e(s.expr);
|
|
168
|
+
if (r(t)) y(s.expr, n) && (s = {
|
|
169
|
+
...s,
|
|
170
|
+
expr: v(s.expr, n, a)
|
|
171
|
+
}, o += 1);
|
|
172
|
+
else {
|
|
173
|
+
let e = g(t, n, a);
|
|
174
|
+
e.count > 0 && (o += e.count, s = {
|
|
175
|
+
...s,
|
|
176
|
+
expr: i(e.expr)
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (Array.isArray(s.validation)) {
|
|
181
|
+
let e = !1, t = s.validation.map((t) => b(t) === n ? (e = !0, o += 1, {
|
|
182
|
+
...t,
|
|
183
|
+
args: [a, ...t.args?.slice(1) ?? []]
|
|
184
|
+
}) : t);
|
|
185
|
+
e && (s = {
|
|
186
|
+
...s,
|
|
187
|
+
validation: t
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return s;
|
|
191
|
+
}, l = (e) => c(s(e)), d = (e) => {
|
|
192
|
+
let t = p(e);
|
|
193
|
+
if (!t.length) return e;
|
|
194
|
+
let n = !1, r = t.map((e) => {
|
|
195
|
+
if (!e.element) return e;
|
|
196
|
+
let t = l(e.element);
|
|
197
|
+
return t === e.element ? e : (n = !0, {
|
|
198
|
+
...e,
|
|
199
|
+
element: t
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
return n ? {
|
|
203
|
+
...e,
|
|
204
|
+
props: {
|
|
205
|
+
...e.props,
|
|
206
|
+
columns: r
|
|
207
|
+
}
|
|
208
|
+
} : e;
|
|
209
|
+
}, h = (e) => {
|
|
210
|
+
let t = e.category === "field" ? l(e) : s(e);
|
|
211
|
+
t = d(t);
|
|
212
|
+
let n = f(t);
|
|
213
|
+
if (n.length) {
|
|
214
|
+
let e = !1, r = n.map((t) => {
|
|
215
|
+
let n = h(t);
|
|
216
|
+
return n !== t && (e = !0), n;
|
|
217
|
+
});
|
|
218
|
+
e && (t = {
|
|
219
|
+
...t,
|
|
220
|
+
children: r
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return t;
|
|
224
|
+
}, _ = t?.root?.children;
|
|
225
|
+
if (!Array.isArray(_) || !_.length) return {
|
|
226
|
+
definition: t,
|
|
227
|
+
count: 0
|
|
228
|
+
};
|
|
229
|
+
let x = !1, S = _.map((e) => {
|
|
230
|
+
let t = h(e);
|
|
231
|
+
return t !== e && (x = !0), t;
|
|
232
|
+
});
|
|
233
|
+
return x ? {
|
|
234
|
+
definition: {
|
|
235
|
+
...t,
|
|
236
|
+
root: {
|
|
237
|
+
...t.root,
|
|
238
|
+
children: S
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
count: o
|
|
242
|
+
} : {
|
|
243
|
+
definition: t,
|
|
244
|
+
count: 0
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/composables/form-fields.ts
|
|
249
|
+
function w() {
|
|
250
|
+
let r = c(), { formDefinition: u, selectedIndex: d, selectedKey: f, selectedTarget: p, elementEditTarget: m, elementEditCommit: h } = r, { commitFormDefinition: g } = r, _ = l(() => {
|
|
251
|
+
if (m.value) return m.value;
|
|
252
|
+
let e = u.value?.root?.children;
|
|
253
|
+
if (!Array.isArray(e)) return;
|
|
254
|
+
let t = f.value;
|
|
255
|
+
return t ? s(e, t)?.node : e[d.value];
|
|
256
|
+
}), v = l(() => {
|
|
257
|
+
let e = u.value?.root?.children;
|
|
258
|
+
if (!Array.isArray(e)) return;
|
|
259
|
+
let t = f.value;
|
|
260
|
+
return t ? s(e, t)?.node : e[d.value];
|
|
261
|
+
}), y = r.selectedColumnIndex, b = l(() => {
|
|
262
|
+
let e = y.value;
|
|
263
|
+
if (e == null || e < 0) return;
|
|
264
|
+
let t = v.value?.props?.columns;
|
|
265
|
+
if (!Array.isArray(t)) return;
|
|
266
|
+
let n = t[e];
|
|
267
|
+
if (!(!n || typeof n != "object")) return {
|
|
268
|
+
index: e,
|
|
269
|
+
column: n
|
|
270
|
+
};
|
|
271
|
+
}), x = l(() => y.value !== null), S = (e, t) => {
|
|
272
|
+
m.value = e, h.value = t ?? null;
|
|
273
|
+
}, w = (e) => {
|
|
274
|
+
let t = e.trim().replace(/[^a-zA-Z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
|
|
275
|
+
return t ? (/^\d/.test(t) && (t = `field_${t}`), t) : "";
|
|
276
|
+
}, T = (e) => {
|
|
277
|
+
let t = u.value, n = Array.isArray(t?.root?.children) ? t.root.children : [];
|
|
278
|
+
if (!n.length) return;
|
|
279
|
+
let r = Math.max(0, Math.min(d.value, n.length - 1)), i = f.value ?? n[r]?.key ?? n[r]?.id, a = i ? s(n, i)?.node ?? n[r] : n[r];
|
|
280
|
+
if (!a) return;
|
|
281
|
+
let c = e({ ...a });
|
|
282
|
+
c.id = a.id;
|
|
283
|
+
let l = i ? o(n, i, c).nodes : n.map((e, t) => t === r ? c : e);
|
|
284
|
+
g({
|
|
285
|
+
...t,
|
|
286
|
+
root: {
|
|
287
|
+
...t.root,
|
|
288
|
+
children: l
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
reason: "field-edit",
|
|
292
|
+
merge: !0
|
|
293
|
+
});
|
|
294
|
+
}, E = (e) => {
|
|
295
|
+
if (m.value) {
|
|
296
|
+
let t = m.value, n = e({ ...t });
|
|
297
|
+
n.id = t.id, m.value = n, h.value?.(n);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
T(e);
|
|
301
|
+
}, D = (e, t) => {
|
|
302
|
+
E((n) => {
|
|
303
|
+
let r = n;
|
|
304
|
+
return t === void 0 ? delete r[e] : r[e] = t, n;
|
|
305
|
+
});
|
|
306
|
+
}, O = (e, t) => {
|
|
307
|
+
E((n) => {
|
|
308
|
+
let r = { ...n.props };
|
|
309
|
+
return t === void 0 ? delete r[e] : r[e] = t, n.props = Object.keys(r).length ? r : void 0, n;
|
|
310
|
+
});
|
|
311
|
+
}, ee = (e, t) => l({
|
|
312
|
+
get: () => _.value?.props?.[e] ?? t,
|
|
313
|
+
set: (t) => O(e, t)
|
|
314
|
+
}), te = () => l({
|
|
315
|
+
get: () => !!_.value?.props?.disabled,
|
|
316
|
+
set: (e) => O("disabled", e ? !0 : void 0)
|
|
317
|
+
}), k = (e, t) => {
|
|
318
|
+
T((n) => {
|
|
319
|
+
let r = { ...n.props }, i = Array.isArray(r.columns) ? [...r.columns] : [], a = y.value;
|
|
320
|
+
if (a == null || a < 0 || a >= i.length) return n;
|
|
321
|
+
let o = { ...i[a] };
|
|
322
|
+
t == null || t === "" ? delete o[e] : o[e] = t;
|
|
323
|
+
let s = o.element;
|
|
324
|
+
return e === "key" && s && typeof s == "object" && t ? o.element = {
|
|
325
|
+
...s,
|
|
326
|
+
name: t
|
|
327
|
+
} : e === "title" && s && typeof s == "object" && t && (o.element = {
|
|
328
|
+
...s,
|
|
329
|
+
label: t
|
|
330
|
+
}), i[a] = o, r.columns = i.length ? i : void 0, n.props = Object.keys(r).length ? r : void 0, n;
|
|
331
|
+
});
|
|
332
|
+
}, ne = (e, t) => l({
|
|
333
|
+
get: () => b.value?.column?.[e] ?? t,
|
|
334
|
+
set: (t) => k(e, t)
|
|
335
|
+
}), re = (e, t) => l({
|
|
336
|
+
get: () => _.value?.props?.[e] ?? t,
|
|
337
|
+
set: (t) => O(e, t)
|
|
338
|
+
}), A = l(() => _.value?.validation ?? []), j = (e) => {
|
|
339
|
+
E((t) => (t.category === "field" && (t.validation = e.length ? e : void 0), t));
|
|
340
|
+
}, ie = l(() => A.value.length), M = (e, t = !0) => l({
|
|
341
|
+
get: () => pe(e),
|
|
342
|
+
set: (n) => {
|
|
343
|
+
X(`${e}:${n}`, t);
|
|
344
|
+
}
|
|
345
|
+
}), N = (e) => l({
|
|
346
|
+
get: () => (_.value?.validation)?.find((t) => t.rule === e)?.message ?? "",
|
|
347
|
+
set: (t) => {
|
|
348
|
+
E((n) => {
|
|
349
|
+
if (n.category !== "field") return n;
|
|
350
|
+
let r = n, i = [...r.validation ?? []], a = i.findIndex((t) => t.rule === e), o = t.trim();
|
|
351
|
+
if (a >= 0) {
|
|
352
|
+
let e = { ...i[a] };
|
|
353
|
+
o ? e.message = o : delete e.message, i[a] = e;
|
|
354
|
+
} else o && i.push({
|
|
355
|
+
rule: e,
|
|
356
|
+
message: o
|
|
357
|
+
});
|
|
358
|
+
return r.validation = i.length ? i : void 0, n;
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}), P = l({
|
|
362
|
+
get: () => _.value?.name || "",
|
|
363
|
+
set: (e) => {
|
|
364
|
+
D("name", w(e) || void 0);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
function F(e, t) {
|
|
368
|
+
let n = u.value;
|
|
369
|
+
if (!n || !e || !t || e === t) return 0;
|
|
370
|
+
let { definition: r, count: i } = C(n, e, t);
|
|
371
|
+
return i > 0 && g(r, {
|
|
372
|
+
reason: "field-edit",
|
|
373
|
+
merge: !0
|
|
374
|
+
}), i;
|
|
375
|
+
}
|
|
376
|
+
let I = l({
|
|
377
|
+
get: () => _.value?.label || "",
|
|
378
|
+
set: (e) => {
|
|
379
|
+
E((t) => {
|
|
380
|
+
let n = e.trim();
|
|
381
|
+
return n ? t.label = n : delete t.label, t;
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}), L = l({
|
|
385
|
+
get: () => {
|
|
386
|
+
let e = _.value?.props?.help;
|
|
387
|
+
return typeof e == "string" ? e : "";
|
|
388
|
+
},
|
|
389
|
+
set: (e) => O("help", e.trim() || void 0)
|
|
390
|
+
}), R = l({
|
|
391
|
+
get: () => {
|
|
392
|
+
let e = _.value?.props?.placeholder;
|
|
393
|
+
return typeof e == "string" ? e : "";
|
|
394
|
+
},
|
|
395
|
+
set: (e) => O("placeholder", e.trim() || void 0)
|
|
396
|
+
}), z = l({
|
|
397
|
+
get: () => {
|
|
398
|
+
let e = _.value, t = e?.props?.buttonText ?? e?.props?.text ?? e?.label;
|
|
399
|
+
return typeof t == "string" ? t : "";
|
|
400
|
+
},
|
|
401
|
+
set: (e) => {
|
|
402
|
+
O("buttonText", e.trim() || void 0);
|
|
403
|
+
}
|
|
404
|
+
}), B = l({
|
|
405
|
+
get: () => {
|
|
406
|
+
let e = _.value?.props?.buttonType ?? "default";
|
|
407
|
+
return typeof e == "string" ? e : "";
|
|
408
|
+
},
|
|
409
|
+
set: (e) => {
|
|
410
|
+
O("buttonType", e.trim() || void 0);
|
|
411
|
+
}
|
|
412
|
+
}), V = l({
|
|
413
|
+
get: () => {
|
|
414
|
+
let e = _.value;
|
|
415
|
+
if (!e || typeof e.expr == "string" && e.expr) return "";
|
|
416
|
+
let t = e.value;
|
|
417
|
+
if (t != null) return String(t);
|
|
418
|
+
let n = e.props?.value ?? e.props?.text;
|
|
419
|
+
return n == null ? "" : String(n);
|
|
420
|
+
},
|
|
421
|
+
set: (e) => {
|
|
422
|
+
E((t) => {
|
|
423
|
+
if (t.category === "field") t.value = e === "" ? void 0 : e;
|
|
424
|
+
else {
|
|
425
|
+
let n = { ...t.props }, r = "value" in n || !("text" in n) ? "value" : "text";
|
|
426
|
+
e === "" ? delete n[r] : n[r] = e, t.props = Object.keys(n).length ? n : void 0;
|
|
427
|
+
}
|
|
428
|
+
return t;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}), H = l({
|
|
432
|
+
get: () => typeof _.value?.expr == "string",
|
|
433
|
+
set: (e) => {
|
|
434
|
+
E((t) => {
|
|
435
|
+
if (t.category !== "field") return t;
|
|
436
|
+
let n = t;
|
|
437
|
+
if (e) {
|
|
438
|
+
if (typeof n.expr != "string" || !n.expr) {
|
|
439
|
+
let e = n.value;
|
|
440
|
+
n.expr = (e == null ? "" : String(e)) || "$";
|
|
441
|
+
}
|
|
442
|
+
} else n.expr = void 0;
|
|
443
|
+
return t;
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}), U = l({
|
|
447
|
+
get: () => _.value?.expr ?? "",
|
|
448
|
+
set: (e) => {
|
|
449
|
+
E((t) => {
|
|
450
|
+
if (t.category !== "field") return t;
|
|
451
|
+
let n = t;
|
|
452
|
+
return e.trim() ? n.expr = e : n.expr = void 0, t;
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}), W = (t) => l({
|
|
456
|
+
get: () => {
|
|
457
|
+
let e = _.value?.[t];
|
|
458
|
+
return e ? i(e) : "";
|
|
459
|
+
},
|
|
460
|
+
set: (n) => {
|
|
461
|
+
let r = n.trim();
|
|
462
|
+
D(t, r ? e(r) : void 0);
|
|
463
|
+
}
|
|
464
|
+
}), G = W("visibleIf"), K = W("requiredIf"), q = W("disabledIf"), J = W("readonlyIf"), Y = l(() => (_.value?.validation ?? []).some((e) => e.rule === "required")), ae = l({
|
|
465
|
+
get: () => {
|
|
466
|
+
let e = _.value?.props?.number;
|
|
467
|
+
return typeof e == "string" ? e : "integer";
|
|
468
|
+
},
|
|
469
|
+
set: (e) => {
|
|
470
|
+
E((t) => {
|
|
471
|
+
let n = { ...t.props };
|
|
472
|
+
return n.number = e, n.step = e === "integer" ? "1" : "0.1", t.props = Object.keys(n).length ? n : void 0, t;
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}), oe = l({
|
|
476
|
+
get: () => {
|
|
477
|
+
let e = _.value?.props?.multiple;
|
|
478
|
+
return typeof e == "string" ? e : "false";
|
|
479
|
+
},
|
|
480
|
+
set: (e) => O("multiple", e)
|
|
481
|
+
}), se = l({
|
|
482
|
+
get: () => _.value?.props?.min,
|
|
483
|
+
set: (e) => O("min", e)
|
|
484
|
+
}), ce = l({
|
|
485
|
+
get: () => _.value?.props?.max,
|
|
486
|
+
set: (e) => O("max", e)
|
|
487
|
+
}), le = l({
|
|
488
|
+
get: () => {
|
|
489
|
+
let e = _.value, t = e?.options ?? e?.props?.options;
|
|
490
|
+
return Array.isArray(t) ? t : [];
|
|
491
|
+
},
|
|
492
|
+
set: (e) => {
|
|
493
|
+
E((t) => {
|
|
494
|
+
if (t.category === "field") t.options = e;
|
|
495
|
+
else {
|
|
496
|
+
let n = { ...t.props };
|
|
497
|
+
n.options = e, t.props = Object.keys(n).length ? n : void 0;
|
|
498
|
+
}
|
|
499
|
+
return t;
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}), ue = l({
|
|
503
|
+
get: () => {
|
|
504
|
+
let e = _.value;
|
|
505
|
+
return e?.options ?? e?.props?.options ?? [];
|
|
506
|
+
},
|
|
507
|
+
set: (e) => {
|
|
508
|
+
E((t) => {
|
|
509
|
+
if (t.category === "field") t.options = e;
|
|
510
|
+
else {
|
|
511
|
+
let n = { ...t.props };
|
|
512
|
+
n.options = e, t.props = Object.keys(n).length ? n : void 0;
|
|
513
|
+
}
|
|
514
|
+
return t;
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}), de = (e) => {
|
|
518
|
+
let t = e.trim();
|
|
519
|
+
return /^-?\d+(\.\d+)?$/.test(t) ? Number(t) : t === "true" ? !0 : t === "false" ? !1 : t;
|
|
520
|
+
}, X = (e, t = !0) => {
|
|
521
|
+
let n = e.indexOf(":"), r = n === -1 ? e : e.slice(0, n), i = n === -1 ? void 0 : e.slice(n + 1), a = [...A.value], o = a.findIndex((e) => e.rule === r);
|
|
522
|
+
if (n === -1) {
|
|
523
|
+
o === -1 ? a.push({ rule: r }) : a.splice(o, 1), j(a);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (!t) {
|
|
527
|
+
o !== -1 && a.splice(o, 1), j(a);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
let s = i ? i.split(",").map(de) : [], c = {
|
|
531
|
+
...o === -1 ? { rule: r } : a[o],
|
|
532
|
+
rule: r
|
|
533
|
+
};
|
|
534
|
+
s.length ? c.args = s : delete c.args, o === -1 ? a.push(c) : a[o] = c, j(a);
|
|
535
|
+
}, fe = (e, t) => l(() => e(t)), pe = (e) => {
|
|
536
|
+
let t = A.value.find((t) => t.rule === e);
|
|
537
|
+
return t?.args?.length ? t.args.join(",") : "";
|
|
538
|
+
}, Z = l(() => p.value === "form"), Q = l(() => Z.value || !!_.value), me = (e) => {
|
|
539
|
+
if (!Q.value) return !1;
|
|
540
|
+
let t = _.value?.validation;
|
|
541
|
+
return t?.length ? t.some((t) => t.rule === e) : !1;
|
|
542
|
+
}, he = l(() => {
|
|
543
|
+
if (!Q.value) return null;
|
|
544
|
+
if (Z.value) return "form";
|
|
545
|
+
let e = _.value;
|
|
546
|
+
return e ? e.type : null;
|
|
547
|
+
}), ge = l({
|
|
548
|
+
get: () => u.value?.name ?? "",
|
|
549
|
+
set: (e) => {
|
|
550
|
+
let t = e.trim(), n = u.value;
|
|
551
|
+
g({
|
|
552
|
+
...n,
|
|
553
|
+
name: t || ""
|
|
554
|
+
}, {
|
|
555
|
+
reason: "form-name",
|
|
556
|
+
merge: !0
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}), _e = l({
|
|
560
|
+
get: () => u.value?.id ?? "",
|
|
561
|
+
set: (e) => {
|
|
562
|
+
let t = e.trim(), n = u.value;
|
|
563
|
+
g({
|
|
564
|
+
...n,
|
|
565
|
+
id: t || ""
|
|
566
|
+
}, {
|
|
567
|
+
reason: "form-id",
|
|
568
|
+
merge: !0
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
}), ve = l({
|
|
572
|
+
get: () => u.value?.version ?? 1,
|
|
573
|
+
set: (e) => {
|
|
574
|
+
let t = Number(e), n = Number.isFinite(t) && t > 0 ? Math.round(t) : 1, r = u.value;
|
|
575
|
+
g({
|
|
576
|
+
...r,
|
|
577
|
+
version: n
|
|
578
|
+
}, {
|
|
579
|
+
reason: "form-version",
|
|
580
|
+
merge: !0
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
}), ye = l({
|
|
584
|
+
get: () => u.value?.settings?.labelAlign === "left" ? "left" : "top",
|
|
585
|
+
set: (e) => {
|
|
586
|
+
let t = u.value;
|
|
587
|
+
g({
|
|
588
|
+
...t,
|
|
589
|
+
settings: {
|
|
590
|
+
...t.settings,
|
|
591
|
+
labelAlign: e
|
|
592
|
+
}
|
|
593
|
+
}, {
|
|
594
|
+
reason: "form-label-position",
|
|
595
|
+
merge: !0
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}), be = l({
|
|
599
|
+
get: () => u.value?.settings?.labelWidth ?? 80,
|
|
600
|
+
set: (e) => {
|
|
601
|
+
let t = Number(e), n = Number.isFinite(t) ? Math.max(0, Math.min(2e3, Math.round(t))) : 80, r = u.value;
|
|
602
|
+
g({
|
|
603
|
+
...r,
|
|
604
|
+
settings: {
|
|
605
|
+
...r.settings,
|
|
606
|
+
labelWidth: n
|
|
607
|
+
}
|
|
608
|
+
}, {
|
|
609
|
+
reason: "form-label-width",
|
|
610
|
+
merge: !0
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}), $ = l({
|
|
614
|
+
get: () => u.value?.settings?.submit ?? "",
|
|
615
|
+
set: (e) => {
|
|
616
|
+
let t = u.value;
|
|
617
|
+
g({
|
|
618
|
+
...t,
|
|
619
|
+
settings: {
|
|
620
|
+
...t.settings,
|
|
621
|
+
submit: e
|
|
622
|
+
}
|
|
623
|
+
}, {
|
|
624
|
+
reason: "form-submit",
|
|
625
|
+
merge: !0
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
}), xe = l({
|
|
629
|
+
get: () => u.value?.settings?.size,
|
|
630
|
+
set: (e) => {
|
|
631
|
+
let t = u.value;
|
|
632
|
+
g({
|
|
633
|
+
...t,
|
|
634
|
+
settings: {
|
|
635
|
+
...t.settings,
|
|
636
|
+
size: e || void 0
|
|
637
|
+
}
|
|
638
|
+
}, {
|
|
639
|
+
reason: "form-size",
|
|
640
|
+
merge: !0
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
}), Se = l({
|
|
644
|
+
get: () => !!u.value?.settings?.disabled,
|
|
645
|
+
set: (e) => {
|
|
646
|
+
let t = u.value;
|
|
647
|
+
g({
|
|
648
|
+
...t,
|
|
649
|
+
settings: {
|
|
650
|
+
...t.settings,
|
|
651
|
+
disabled: e || void 0
|
|
652
|
+
}
|
|
653
|
+
}, {
|
|
654
|
+
reason: "form-disabled",
|
|
655
|
+
merge: !0
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
}), Ce = l({
|
|
659
|
+
get: () => !!u.value?.settings?.readonly,
|
|
660
|
+
set: (e) => {
|
|
661
|
+
let t = u.value;
|
|
662
|
+
g({
|
|
663
|
+
...t,
|
|
664
|
+
settings: {
|
|
665
|
+
...t.settings,
|
|
666
|
+
readonly: e || void 0
|
|
667
|
+
}
|
|
668
|
+
}, {
|
|
669
|
+
reason: "form-readonly",
|
|
670
|
+
merge: !0
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
}), we = l({
|
|
674
|
+
get: () => u.value?.settings?.successMessage ?? "",
|
|
675
|
+
set: (e) => {
|
|
676
|
+
let t = u.value;
|
|
677
|
+
g({
|
|
678
|
+
...t,
|
|
679
|
+
settings: {
|
|
680
|
+
...t.settings,
|
|
681
|
+
successMessage: e || void 0
|
|
682
|
+
}
|
|
683
|
+
}, {
|
|
684
|
+
reason: "form-success-message",
|
|
685
|
+
merge: !0
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
}), Te = l({
|
|
689
|
+
get: () => u.value?.settings?.successRedirect ?? "",
|
|
690
|
+
set: (e) => {
|
|
691
|
+
let t = u.value;
|
|
692
|
+
g({
|
|
693
|
+
...t,
|
|
694
|
+
settings: {
|
|
695
|
+
...t.settings,
|
|
696
|
+
successRedirect: e || void 0
|
|
697
|
+
}
|
|
698
|
+
}, {
|
|
699
|
+
reason: "form-success-redirect",
|
|
700
|
+
merge: !0
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}), Ee = l({
|
|
704
|
+
get: () => u.value?.settings?.showReset !== !1,
|
|
705
|
+
set: (e) => {
|
|
706
|
+
let t = u.value;
|
|
707
|
+
g({
|
|
708
|
+
...t,
|
|
709
|
+
settings: {
|
|
710
|
+
...t.settings,
|
|
711
|
+
showReset: e
|
|
712
|
+
}
|
|
713
|
+
}, {
|
|
714
|
+
reason: "form-show-reset",
|
|
715
|
+
merge: !0
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}), De = l({
|
|
719
|
+
get: () => u.value?.settings?.submitText ?? "",
|
|
720
|
+
set: (e) => {
|
|
721
|
+
let t = u.value;
|
|
722
|
+
g({
|
|
723
|
+
...t,
|
|
724
|
+
settings: {
|
|
725
|
+
...t.settings,
|
|
726
|
+
submitText: e || void 0
|
|
727
|
+
}
|
|
728
|
+
}, {
|
|
729
|
+
reason: "form-submit-text",
|
|
730
|
+
merge: !0
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
}), Oe = l({
|
|
734
|
+
get: () => u.value?.settings?.resetText ?? "",
|
|
735
|
+
set: (e) => {
|
|
736
|
+
let t = u.value;
|
|
737
|
+
g({
|
|
738
|
+
...t,
|
|
739
|
+
settings: {
|
|
740
|
+
...t.settings,
|
|
741
|
+
resetText: e || void 0
|
|
742
|
+
}
|
|
743
|
+
}, {
|
|
744
|
+
reason: "form-reset-text",
|
|
745
|
+
merge: !0
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
return {
|
|
750
|
+
selectedField: _,
|
|
751
|
+
selectedTableField: v,
|
|
752
|
+
selectedColumn: b,
|
|
753
|
+
selectedColumnIndex: y,
|
|
754
|
+
selectedIsColumn: x,
|
|
755
|
+
setElementEditTarget: S,
|
|
756
|
+
createColumnProp: ne,
|
|
757
|
+
setColumnProp: k,
|
|
758
|
+
fieldName: P,
|
|
759
|
+
syncFieldRefs: F,
|
|
760
|
+
useExpressionValue: H,
|
|
761
|
+
valueExpression: U,
|
|
762
|
+
ifExpression: G,
|
|
763
|
+
requiredIfExpression: K,
|
|
764
|
+
disabledIfExpression: q,
|
|
765
|
+
readonlyIfExpression: J,
|
|
766
|
+
hasStaticRequiredRule: Y,
|
|
767
|
+
label: I,
|
|
768
|
+
buttonText: z,
|
|
769
|
+
buttonType: B,
|
|
770
|
+
placeholder: R,
|
|
771
|
+
fieldValue: V,
|
|
772
|
+
updateValidationString: X,
|
|
773
|
+
isActive: fe,
|
|
774
|
+
createValidationValue: M,
|
|
775
|
+
createValidationMessageValue: N,
|
|
776
|
+
validationStringLength: ie,
|
|
777
|
+
currentFieldType: he,
|
|
778
|
+
availableFieldNames: l(() => {
|
|
779
|
+
let e = /* @__PURE__ */ new Set(), t = (n) => {
|
|
780
|
+
for (let r of n) {
|
|
781
|
+
r.name && typeof r.name == "string" && e.add(r.name);
|
|
782
|
+
let n = r.children;
|
|
783
|
+
Array.isArray(n) && t(n);
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
return t(u.value?.root?.children ?? []), Array.from(e);
|
|
787
|
+
}),
|
|
788
|
+
availableFields: l(() => {
|
|
789
|
+
let e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
790
|
+
for (let r of n) {
|
|
791
|
+
r.name && typeof r.name == "string" && e.set(r.name, r.label ?? "");
|
|
792
|
+
let n = r.children;
|
|
793
|
+
Array.isArray(n) && t(n);
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
return t(u.value?.root?.children ?? []), Array.from(e, ([e, t]) => ({
|
|
797
|
+
name: e,
|
|
798
|
+
label: t
|
|
799
|
+
}));
|
|
800
|
+
}),
|
|
801
|
+
hasField: Q,
|
|
802
|
+
selectedIsForm: Z,
|
|
803
|
+
formName: ge,
|
|
804
|
+
formId: _e,
|
|
805
|
+
formVersion: ve,
|
|
806
|
+
formLabelPosition: ye,
|
|
807
|
+
formLabelWidth: be,
|
|
808
|
+
formSubmit: $,
|
|
809
|
+
formSize: xe,
|
|
810
|
+
formDisabled: Se,
|
|
811
|
+
formReadonly: Ce,
|
|
812
|
+
formSuccessMessage: we,
|
|
813
|
+
formSuccessRedirect: Te,
|
|
814
|
+
formShowReset: Ee,
|
|
815
|
+
formSubmitText: De,
|
|
816
|
+
formResetText: Oe,
|
|
817
|
+
help: L,
|
|
818
|
+
whichNumber: ae,
|
|
819
|
+
numOfFiles: oe,
|
|
820
|
+
modelValue: le,
|
|
821
|
+
optionsRaw: ue,
|
|
822
|
+
min: se,
|
|
823
|
+
max: ce,
|
|
824
|
+
isValidationChecked: me,
|
|
825
|
+
createButtonProp: re,
|
|
826
|
+
createPropsProp: ee,
|
|
827
|
+
createDisabledProp: te,
|
|
828
|
+
rowSpan: l({
|
|
829
|
+
get: () => {
|
|
830
|
+
let e = (typeof _.value?.outerClass == "string" ? _.value.outerClass : "").match(/\brow-span-(\d+)\b/), t = e ? parseInt(e[1], 10) : 1;
|
|
831
|
+
return Number.isFinite(t) && t > 1 ? t : 1;
|
|
832
|
+
},
|
|
833
|
+
set: (e) => {
|
|
834
|
+
let t = Math.max(1, Math.min(6, Math.round(e)));
|
|
835
|
+
E((e) => {
|
|
836
|
+
let n = typeof e.outerClass == "string" ? e.outerClass : "";
|
|
837
|
+
return n = t > 1 ? /\brow-span-\d+\b/.test(n) ? n.replace(/\brow-span-\d+\b/g, `row-span-${t}`) : `${n} row-span-${t}`.replace(/\s+/g, " ").trim() : n.replace(/\brow-span-\d+\b/g, "").replace(/\s+/g, " ").trim(), n ? e.outerClass = n : delete e.outerClass, e;
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
}),
|
|
841
|
+
colSpan: l({
|
|
842
|
+
get: () => a(_.value),
|
|
843
|
+
set: (e) => {
|
|
844
|
+
let t = Math.max(2, Math.min(12, Math.round(e)));
|
|
845
|
+
E((e) => {
|
|
846
|
+
let n = typeof e.outerClass == "string" ? e.outerClass : "";
|
|
847
|
+
return n = t < 12 ? /\bcol-span-\d+\b/.test(n) ? n.replace(/\bcol-span-\d+\b/g, `col-span-${t}`) : `${n} col-span-${t}`.replace(/\s+/g, " ").trim() : n.replace(/\bcol-span-\d+\b/g, "").replace(/\s+/g, " ").trim(), n ? e.outerClass = n : delete e.outerClass, e;
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
}),
|
|
851
|
+
bindEvents: l({
|
|
852
|
+
get: () => {
|
|
853
|
+
let e = _.value;
|
|
854
|
+
return e ? n(e.events) ?? {} : {};
|
|
855
|
+
},
|
|
856
|
+
set: (e) => {
|
|
857
|
+
E((n) => {
|
|
858
|
+
let r = t(e);
|
|
859
|
+
return r?.length ? n.events = r : delete n.events, n;
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}),
|
|
863
|
+
customAttrs: l({
|
|
864
|
+
get: () => {
|
|
865
|
+
let e = _.value?.props?.__attrs;
|
|
866
|
+
return e && typeof e == "object" ? e : {};
|
|
867
|
+
},
|
|
868
|
+
set: (e) => {
|
|
869
|
+
O("__attrs", e && typeof e == "object" && Object.keys(e).length > 0 ? e : void 0);
|
|
870
|
+
}
|
|
871
|
+
})
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
//#endregion
|
|
875
|
+
export { u as n, S as r, w as t };
|
|
876
|
+
|
|
877
|
+
//# sourceMappingURL=form-fields-DjLk8iH2.js.map
|