@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,34 @@
|
|
|
1
|
+
import { t as e } from "./utils-DlUMv2vG.js";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, createVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, toDisplayString as s, unref as c } from "vue";
|
|
3
|
+
import { NSwitch as l } from "naive-ui";
|
|
4
|
+
//#region src/components/sidebar-right/edits/common/SwitchInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var u = { class: "text-xs text-foreground/80 font-medium" }, d = /* @__PURE__ */ i({
|
|
6
|
+
__name: "SwitchInput",
|
|
7
|
+
props: {
|
|
8
|
+
class: { type: [
|
|
9
|
+
Boolean,
|
|
10
|
+
null,
|
|
11
|
+
String,
|
|
12
|
+
Object,
|
|
13
|
+
Array
|
|
14
|
+
] },
|
|
15
|
+
label: {},
|
|
16
|
+
value: { type: Boolean }
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:value"],
|
|
19
|
+
setup(i, { emit: d }) {
|
|
20
|
+
let f = i, p = d;
|
|
21
|
+
function m(e) {
|
|
22
|
+
p("update:value", e);
|
|
23
|
+
}
|
|
24
|
+
return (i, d) => (o(), t("div", { class: a(c(e)("flex flex-row gap-2 items-center justify-between py-1", f.class)) }, [n("label", u, s(f.label), 1), r(c(l), {
|
|
25
|
+
size: "small",
|
|
26
|
+
value: f.value,
|
|
27
|
+
"onUpdate:value": m
|
|
28
|
+
}, null, 8, ["value"])], 2));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { d as t };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=SwitchInput-DQrSTyW0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchInput-DQrSTyW0.js","names":[],"sources":["../../src/components/sidebar-right/edits/common/SwitchInput.vue","../../src/components/sidebar-right/edits/common/SwitchInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue'\nimport { NSwitch } from 'naive-ui'\nimport { cn } from '../../../../utils/utils'\n\nconst props = defineProps<{\n class?: HTMLAttributes['class']\n label?: string\n value?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:value': [value: boolean]\n}>()\n\nfunction updateValue(value: boolean) {\n emit('update:value', value)\n}\n</script>\n\n<template>\n <div :class=\"cn('flex flex-row gap-2 items-center justify-between py-1', props.class)\">\n <label class=\"text-xs text-foreground/80 font-medium\">{{ props.label }}</label>\n <n-switch size=\"small\" :value=\"props.value\" @update:value=\"updateValue\" />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue'\nimport { NSwitch } from 'naive-ui'\nimport { cn } from '../../../../utils/utils'\n\nconst props = defineProps<{\n class?: HTMLAttributes['class']\n label?: string\n value?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:value': [value: boolean]\n}>()\n\nfunction updateValue(value: boolean) {\n emit('update:value', value)\n}\n</script>\n\n<template>\n <div :class=\"cn('flex flex-row gap-2 items-center justify-between py-1', props.class)\">\n <label class=\"text-xs text-foreground/80 font-medium\">{{ props.label }}</label>\n <n-switch size=\"small\" :value=\"props.value\" @update:value=\"updateValue\" />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAKA,IAAM,IAAQ,GAMR,IAAO;EAIb,SAAS,EAAY,GAAgB;AACnC,KAAK,gBAAgB,EAAK;;yBAK1B,EAGM,OAAA,EAHA,OAAK,EAAE,EAAA,EAAE,CAAA,yDAA0D,EAAM,MAAK,CAAA,EAAA,EAAA,CAClF,EAA+E,SAA/E,GAA+E,EAAtB,EAAM,MAAK,EAAA,EAAA,EACpE,EAA0E,EAAA,EAAA,EAAA;GAAhE,MAAK;GAAS,OAAO,EAAM;GAAQ,kBAAc"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { n as e } from "./context-4zkSHwVA.js";
|
|
2
|
+
import { t } from "./form-fields-DjLk8iH2.js";
|
|
3
|
+
import { t as n } from "./EditorSection-BR3qdK2c.js";
|
|
4
|
+
import { t as r } from "./SelectInput-DY4Oi2Lp.js";
|
|
5
|
+
import { t as i } from "./SwitchInput-DQrSTyW0.js";
|
|
6
|
+
import { Fragment as a, createElementBlock as o, createVNode as s, defineComponent as c, openBlock as l, unref as u, withCtx as d } from "vue";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/sidebar-right/edits/editors/TabsEditor.vue
|
|
9
|
+
var f = /* @__PURE__ */ c({
|
|
10
|
+
__name: "TabsEditor",
|
|
11
|
+
setup(c) {
|
|
12
|
+
let { createPropsProp: f } = t(), { t: p } = e(), m = f("type", "line"), h = f("placement", "top"), g = f("size", "small"), _ = f("animated", !0), v = f("closable", !1);
|
|
13
|
+
return (e, t) => (l(), o(a, null, [s(n, { title: u(p)("edits.sections.appearance") }, {
|
|
14
|
+
default: d(() => [
|
|
15
|
+
s(r, {
|
|
16
|
+
label: u(p)("edits.props.type"),
|
|
17
|
+
value: u(m),
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
label: "line",
|
|
21
|
+
value: "line"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "bar",
|
|
25
|
+
value: "bar"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "segment",
|
|
29
|
+
value: "segment"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "card",
|
|
33
|
+
value: "card"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"onUpdate:value": t[0] ||= (e) => m.value = e
|
|
37
|
+
}, null, 8, ["label", "value"]),
|
|
38
|
+
s(r, {
|
|
39
|
+
label: u(p)("edits.props.placement"),
|
|
40
|
+
value: u(h),
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
label: "top",
|
|
44
|
+
value: "top"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "bottom",
|
|
48
|
+
value: "bottom"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "left",
|
|
52
|
+
value: "left"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "right",
|
|
56
|
+
value: "right"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"onUpdate:value": t[1] ||= (e) => h.value = e
|
|
60
|
+
}, null, 8, ["label", "value"]),
|
|
61
|
+
s(r, {
|
|
62
|
+
label: u(p)("edits.props.size"),
|
|
63
|
+
value: u(g),
|
|
64
|
+
options: [
|
|
65
|
+
{
|
|
66
|
+
label: "small",
|
|
67
|
+
value: "small"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "medium",
|
|
71
|
+
value: "medium"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "large",
|
|
75
|
+
value: "large"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"onUpdate:value": t[2] ||= (e) => g.value = e
|
|
79
|
+
}, null, 8, ["label", "value"]),
|
|
80
|
+
s(i, {
|
|
81
|
+
label: u(p)("edits.props.animated"),
|
|
82
|
+
value: u(_),
|
|
83
|
+
"onUpdate:value": t[3] ||= (e) => _.value = e
|
|
84
|
+
}, null, 8, ["label", "value"])
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["title"]), s(n, { title: u(p)("edits.sections.behavior") }, {
|
|
88
|
+
default: d(() => [s(i, {
|
|
89
|
+
label: u(p)("edits.props.closable"),
|
|
90
|
+
value: u(v),
|
|
91
|
+
"onUpdate:value": t[4] ||= (e) => v.value = e
|
|
92
|
+
}, null, 8, ["label", "value"])]),
|
|
93
|
+
_: 1
|
|
94
|
+
}, 8, ["title"])], 64));
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//#endregion
|
|
98
|
+
export { f as default };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=TabsEditor-DepUhmsz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsEditor-DepUhmsz.js","names":[],"sources":["../../src/components/sidebar-right/edits/editors/TabsEditor.vue","../../src/components/sidebar-right/edits/editors/TabsEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EditorSection from '../common/EditorSection.vue'\nimport SelectInput from '../common/SelectInput.vue'\nimport SwitchInput from '../common/SwitchInput.vue'\nimport { useFormField } from '../../../../composables/form-fields'\nimport { useFormBuilderI18n } from '../../../../i18n/context'\n\nconst { createPropsProp } = useFormField()\nconst { t } = useFormBuilderI18n()\n\nconst type = createPropsProp<string>('type', 'line')\nconst placement = createPropsProp<string>('placement', 'top')\nconst size = createPropsProp<string>('size', 'small')\nconst animated = createPropsProp<boolean>('animated', true)\nconst closable = createPropsProp<boolean>('closable', false)\n</script>\n\n<template>\n <EditorSection :title=\"t('edits.sections.appearance')\">\n <SelectInput\n :label=\"t('edits.props.type')\"\n :value=\"type\"\n :options=\"[\n { label: 'line', value: 'line' },\n { label: 'bar', value: 'bar' },\n { label: 'segment', value: 'segment' },\n { label: 'card', value: 'card' },\n ]\"\n @update:value=\"(v) => (type = v)\"\n />\n <SelectInput\n :label=\"t('edits.props.placement')\"\n :value=\"placement\"\n :options=\"[\n { label: 'top', value: 'top' },\n { label: 'bottom', value: 'bottom' },\n { label: 'left', value: 'left' },\n { label: 'right', value: 'right' },\n ]\"\n @update:value=\"(v) => (placement = v)\"\n />\n <SelectInput\n :label=\"t('edits.props.size')\"\n :value=\"size\"\n :options=\"[\n { label: 'small', value: 'small' },\n { label: 'medium', value: 'medium' },\n { label: 'large', value: 'large' },\n ]\"\n @update:value=\"(v) => (size = v)\"\n />\n <SwitchInput\n :label=\"t('edits.props.animated')\"\n :value=\"animated\"\n @update:value=\"(v) => (animated = v)\"\n />\n </EditorSection>\n <EditorSection :title=\"t('edits.sections.behavior')\">\n <SwitchInput\n :label=\"t('edits.props.closable')\"\n :value=\"closable\"\n @update:value=\"(v) => (closable = v)\"\n />\n </EditorSection>\n</template>\n","<script setup lang=\"ts\">\nimport EditorSection from '../common/EditorSection.vue'\nimport SelectInput from '../common/SelectInput.vue'\nimport SwitchInput from '../common/SwitchInput.vue'\nimport { useFormField } from '../../../../composables/form-fields'\nimport { useFormBuilderI18n } from '../../../../i18n/context'\n\nconst { createPropsProp } = useFormField()\nconst { t } = useFormBuilderI18n()\n\nconst type = createPropsProp<string>('type', 'line')\nconst placement = createPropsProp<string>('placement', 'top')\nconst size = createPropsProp<string>('size', 'small')\nconst animated = createPropsProp<boolean>('animated', true)\nconst closable = createPropsProp<boolean>('closable', false)\n</script>\n\n<template>\n <EditorSection :title=\"t('edits.sections.appearance')\">\n <SelectInput\n :label=\"t('edits.props.type')\"\n :value=\"type\"\n :options=\"[\n { label: 'line', value: 'line' },\n { label: 'bar', value: 'bar' },\n { label: 'segment', value: 'segment' },\n { label: 'card', value: 'card' },\n ]\"\n @update:value=\"(v) => (type = v)\"\n />\n <SelectInput\n :label=\"t('edits.props.placement')\"\n :value=\"placement\"\n :options=\"[\n { label: 'top', value: 'top' },\n { label: 'bottom', value: 'bottom' },\n { label: 'left', value: 'left' },\n { label: 'right', value: 'right' },\n ]\"\n @update:value=\"(v) => (placement = v)\"\n />\n <SelectInput\n :label=\"t('edits.props.size')\"\n :value=\"size\"\n :options=\"[\n { label: 'small', value: 'small' },\n { label: 'medium', value: 'medium' },\n { label: 'large', value: 'large' },\n ]\"\n @update:value=\"(v) => (size = v)\"\n />\n <SwitchInput\n :label=\"t('edits.props.animated')\"\n :value=\"animated\"\n @update:value=\"(v) => (animated = v)\"\n />\n </EditorSection>\n <EditorSection :title=\"t('edits.sections.behavior')\">\n <SwitchInput\n :label=\"t('edits.props.closable')\"\n :value=\"closable\"\n @update:value=\"(v) => (closable = v)\"\n />\n </EditorSection>\n</template>\n"],"mappings":";;;;;;;;;;;EAOA,IAAM,EAAE,uBAAoB,GAAa,EACnC,EAAE,SAAM,GAAmB,EAE3B,IAAO,EAAwB,QAAQ,OAAM,EAC7C,IAAY,EAAwB,aAAa,MAAK,EACtD,IAAO,EAAwB,QAAQ,QAAO,EAC9C,IAAW,EAAyB,YAAY,GAAI,EACpD,IAAW,EAAyB,YAAY,GAAK;qCAIzD,EAsCgB,GAAA,EAtCA,OAAO,EAAA,EAAC,CAAA,4BAAA,EAAA,EAAA;oBAWpB;IAVF,EAUE,GAAA;KATC,OAAO,EAAA,EAAC,CAAA,mBAAA;KACR,OAAO,EAAA,EAAI;KACX,SAAS;;;;;;;;;;;;;;;;;MAKT;KACA,kBAAY,AAAA,EAAA,QAAG,MAAO,EAAA,QAAO;;IAEhC,EAUE,GAAA;KATC,OAAO,EAAA,EAAC,CAAA,wBAAA;KACR,OAAO,EAAA,EAAS;KAChB,SAAS;;;;;;;;;;;;;;;;;MAKT;KACA,kBAAY,AAAA,EAAA,QAAG,MAAO,EAAA,QAAY;;IAErC,EASE,GAAA;KARC,OAAO,EAAA,EAAC,CAAA,mBAAA;KACR,OAAO,EAAA,EAAI;KACX,SAAS;;;;;;;;;;;;;MAIT;KACA,kBAAY,AAAA,EAAA,QAAG,MAAO,EAAA,QAAO;;IAEhC,EAIE,GAAA;KAHC,OAAO,EAAA,EAAC,CAAA,uBAAA;KACR,OAAO,EAAA,EAAQ;KACf,kBAAY,AAAA,EAAA,QAAG,MAAO,EAAA,QAAW;;;;oBAGtC,EAMgB,GAAA,EANA,OAAO,EAAA,EAAC,CAAA,0BAAA,EAAA,EAAA;oBAKpB,CAJF,EAIE,GAAA;IAHC,OAAO,EAAA,EAAC,CAAA,uBAAA;IACR,OAAO,EAAA,EAAQ;IACf,kBAAY,AAAA,EAAA,QAAG,MAAO,EAAA,QAAW"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as e } from "./EditsLayout-fueCrxZM.js";
|
|
2
|
+
import { computed as t, createBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, unref as c, withCtx as l } from "vue";
|
|
3
|
+
import { NDynamicTags as u } from "naive-ui";
|
|
4
|
+
//#region src/components/sidebar-right/edits/common/TagsInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var d = {
|
|
6
|
+
for: "selectTags",
|
|
7
|
+
class: "text-[11px] text-foreground/80 font-medium"
|
|
8
|
+
}, f = /* @__PURE__ */ a({
|
|
9
|
+
__name: "TagsInput",
|
|
10
|
+
props: {
|
|
11
|
+
value: {},
|
|
12
|
+
label: {},
|
|
13
|
+
placeholder: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:value"],
|
|
16
|
+
setup(a, { emit: f }) {
|
|
17
|
+
let p = a, m = f, h = t({
|
|
18
|
+
get: () => p.value || [],
|
|
19
|
+
set: (e) => {
|
|
20
|
+
m("update:value", e);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (t, a) => (o(), n(e, null, {
|
|
24
|
+
default: l(() => [r("div", null, [r("label", d, s(p.label), 1)]), r("div", null, [i(c(u), {
|
|
25
|
+
value: h.value,
|
|
26
|
+
"onUpdate:value": a[0] ||= (e) => h.value = e,
|
|
27
|
+
id: "selectTags"
|
|
28
|
+
}, null, 8, ["value"])])]),
|
|
29
|
+
_: 1
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { f as t };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=TagsInput-DeG3Om1R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagsInput-DeG3Om1R.js","names":[],"sources":["../../src/components/sidebar-right/edits/common/TagsInput.vue","../../src/components/sidebar-right/edits/common/TagsInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { NDynamicTags } from 'naive-ui'\nimport EditsLayout from './EditsLayout.vue'\n\nconst props = defineProps<{\n value: string[]\n label: string\n placeholder: string\n}>()\n\nconst emit = defineEmits<{\n 'update:value': [value: string[]]\n}>()\n\nconst modelValue = computed({\n get: () => props.value || [],\n set: (value: string[]) => {\n emit('update:value', value)\n },\n})\n</script>\n\n<template>\n <EditsLayout>\n <div>\n <label for=\"selectTags\" class=\"text-[11px] text-foreground/80 font-medium\">{{\n props.label\n }}</label>\n </div>\n <div>\n <n-dynamic-tags v-model:value=\"modelValue\" id=\"selectTags\" />\n </div>\n </EditsLayout>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { NDynamicTags } from 'naive-ui'\nimport EditsLayout from './EditsLayout.vue'\n\nconst props = defineProps<{\n value: string[]\n label: string\n placeholder: string\n}>()\n\nconst emit = defineEmits<{\n 'update:value': [value: string[]]\n}>()\n\nconst modelValue = computed({\n get: () => props.value || [],\n set: (value: string[]) => {\n emit('update:value', value)\n },\n})\n</script>\n\n<template>\n <EditsLayout>\n <div>\n <label for=\"selectTags\" class=\"text-[11px] text-foreground/80 font-medium\">{{\n props.label\n }}</label>\n </div>\n <div>\n <n-dynamic-tags v-model:value=\"modelValue\" id=\"selectTags\" />\n </div>\n </EditsLayout>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAKA,IAAM,IAAQ,GAMR,IAAO,GAIP,IAAa,EAAS;GAC1B,WAAW,EAAM,SAAS,EAAE;GAC5B,MAAM,MAAoB;AACxB,MAAK,gBAAgB,EAAK;;GAE7B,CAAA;yBAIC,EASc,GAAA,MAAA;oBAJN,CAJN,EAIM,OAAA,MAAA,CAHJ,EAEU,SAFV,GAEU,EADR,EAAM,MAAK,EAAA,EAAA,CAAA,CAAA,EAGf,EAEM,OAAA,MAAA,CADJ,EAA6D,EAAA,EAAA,EAAA;IAArC,OAAO,EAAA;wCAAU,QAAA;IAAE,IAAG"}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { u as e, y as t } from "./schema-adapter-_sLPmdLy.js";
|
|
2
|
+
import { t as n } from "./form-layout-Dm4QeYrL.js";
|
|
3
|
+
import { n as r } from "./context-4zkSHwVA.js";
|
|
4
|
+
import { r as i } from "./create-form-builder-state-CoXaJhWO.js";
|
|
5
|
+
import { Fragment as a, computed as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
6
|
+
import { NModal as v } from "naive-ui";
|
|
7
|
+
//#region src/templates/helpers.ts
|
|
8
|
+
function y(t, n = {}) {
|
|
9
|
+
let r = e(t);
|
|
10
|
+
if (!r) throw Error(`[templates] 未注册的元素类型: ${t}`);
|
|
11
|
+
let i = r.defaults(), { props: a, ...o } = n;
|
|
12
|
+
return {
|
|
13
|
+
...i,
|
|
14
|
+
...o,
|
|
15
|
+
props: a ? {
|
|
16
|
+
...i.props,
|
|
17
|
+
...a
|
|
18
|
+
} : i.props
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function b(t, n, r) {
|
|
22
|
+
let i = e(t);
|
|
23
|
+
if (!i) throw Error(`[templates] 未注册的元素类型: ${t}`);
|
|
24
|
+
let a = i.defaults();
|
|
25
|
+
return {
|
|
26
|
+
...a,
|
|
27
|
+
...n.label === void 0 ? {} : { label: n.label },
|
|
28
|
+
props: n.props ? {
|
|
29
|
+
...a.props,
|
|
30
|
+
...n.props
|
|
31
|
+
} : a.props,
|
|
32
|
+
children: r
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function x(t) {
|
|
36
|
+
let n = e("submit");
|
|
37
|
+
if (!n) throw Error("[templates] 未注册的元素类型: submit");
|
|
38
|
+
let r = n.defaults(), i = t("elements.submit.label");
|
|
39
|
+
return r.label = i, r.props = {
|
|
40
|
+
...r.props,
|
|
41
|
+
text: i
|
|
42
|
+
}, r;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/templates/user-registration.ts
|
|
46
|
+
function S(e) {
|
|
47
|
+
let r = y("text", {
|
|
48
|
+
name: "username",
|
|
49
|
+
label: e("templates.userRegistration.fieldUsername"),
|
|
50
|
+
props: { placeholder: e("templates.userRegistration.fieldUsernamePlaceholder") }
|
|
51
|
+
}), i = y("password", {
|
|
52
|
+
name: "password",
|
|
53
|
+
label: e("templates.userRegistration.fieldPassword"),
|
|
54
|
+
props: { placeholder: e("templates.userRegistration.fieldPasswordPlaceholder") }
|
|
55
|
+
}), a = y("email", {
|
|
56
|
+
name: "email",
|
|
57
|
+
label: e("templates.userRegistration.fieldEmail"),
|
|
58
|
+
props: { placeholder: e("templates.userRegistration.fieldEmailPlaceholder") }
|
|
59
|
+
}), o = y("checkbox", {
|
|
60
|
+
name: "agreement",
|
|
61
|
+
label: e("templates.userRegistration.fieldAgreement"),
|
|
62
|
+
options: [{
|
|
63
|
+
label: e("templates.userRegistration.fieldAgreementOption"),
|
|
64
|
+
value: "agreed"
|
|
65
|
+
}]
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
version: 1,
|
|
69
|
+
id: t(),
|
|
70
|
+
name: e("templates.userRegistration.name"),
|
|
71
|
+
root: {
|
|
72
|
+
id: t(),
|
|
73
|
+
category: "container",
|
|
74
|
+
type: "group",
|
|
75
|
+
renderAs: "formkit",
|
|
76
|
+
dataType: "object",
|
|
77
|
+
children: [
|
|
78
|
+
r,
|
|
79
|
+
i,
|
|
80
|
+
a,
|
|
81
|
+
o,
|
|
82
|
+
x(e)
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
settings: { ...n }
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var C = {
|
|
89
|
+
id: "userRegistration",
|
|
90
|
+
icon: "i-lucide-user-plus",
|
|
91
|
+
nameKey: "templates.userRegistration.name",
|
|
92
|
+
descriptionKey: "templates.userRegistration.description",
|
|
93
|
+
fieldCount: 4,
|
|
94
|
+
fieldTypes: [
|
|
95
|
+
"text",
|
|
96
|
+
"password",
|
|
97
|
+
"email",
|
|
98
|
+
"checkbox"
|
|
99
|
+
],
|
|
100
|
+
build: S
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/templates/leave-application.ts
|
|
104
|
+
function w(e) {
|
|
105
|
+
let r = y("text", {
|
|
106
|
+
name: "name",
|
|
107
|
+
label: e("templates.leaveApplication.fieldName")
|
|
108
|
+
}), i = y("select", {
|
|
109
|
+
name: "leaveType",
|
|
110
|
+
label: e("templates.leaveApplication.fieldLeaveType"),
|
|
111
|
+
options: [
|
|
112
|
+
{
|
|
113
|
+
label: e("templates.leaveApplication.leaveTypeCasual"),
|
|
114
|
+
value: "casual"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: e("templates.leaveApplication.leaveTypeSick"),
|
|
118
|
+
value: "sick"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: e("templates.leaveApplication.leaveTypeAnnual"),
|
|
122
|
+
value: "annual"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: e("templates.leaveApplication.leaveTypeMarriage"),
|
|
126
|
+
value: "marriage"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}), a = y("date", {
|
|
130
|
+
name: "startDate",
|
|
131
|
+
label: e("templates.leaveApplication.fieldStartDate")
|
|
132
|
+
}), o = y("date", {
|
|
133
|
+
name: "endDate",
|
|
134
|
+
label: e("templates.leaveApplication.fieldEndDate")
|
|
135
|
+
}), s = y("textarea", {
|
|
136
|
+
name: "reason",
|
|
137
|
+
label: e("templates.leaveApplication.fieldReason"),
|
|
138
|
+
props: { placeholder: e("templates.leaveApplication.fieldReasonPlaceholder") }
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
version: 1,
|
|
142
|
+
id: t(),
|
|
143
|
+
name: e("templates.leaveApplication.name"),
|
|
144
|
+
root: {
|
|
145
|
+
id: t(),
|
|
146
|
+
category: "container",
|
|
147
|
+
type: "group",
|
|
148
|
+
renderAs: "formkit",
|
|
149
|
+
dataType: "object",
|
|
150
|
+
children: [
|
|
151
|
+
r,
|
|
152
|
+
i,
|
|
153
|
+
a,
|
|
154
|
+
o,
|
|
155
|
+
s,
|
|
156
|
+
x(e)
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
settings: { ...n }
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
var T = {
|
|
163
|
+
id: "leaveApplication",
|
|
164
|
+
icon: "i-lucide-calendar-off",
|
|
165
|
+
nameKey: "templates.leaveApplication.name",
|
|
166
|
+
descriptionKey: "templates.leaveApplication.description",
|
|
167
|
+
fieldCount: 5,
|
|
168
|
+
fieldTypes: [
|
|
169
|
+
"select",
|
|
170
|
+
"date",
|
|
171
|
+
"textarea"
|
|
172
|
+
],
|
|
173
|
+
build: w
|
|
174
|
+
};
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/templates/satisfaction-survey.ts
|
|
177
|
+
function E(e) {
|
|
178
|
+
let r = y("naiveRate", {
|
|
179
|
+
name: "rating",
|
|
180
|
+
label: e("templates.satisfactionSurvey.fieldRating")
|
|
181
|
+
}), i = y("radio", {
|
|
182
|
+
name: "recommend",
|
|
183
|
+
label: e("templates.satisfactionSurvey.fieldRecommend"),
|
|
184
|
+
options: [{
|
|
185
|
+
label: e("templates.satisfactionSurvey.recommendYes"),
|
|
186
|
+
value: "yes"
|
|
187
|
+
}, {
|
|
188
|
+
label: e("templates.satisfactionSurvey.recommendNo"),
|
|
189
|
+
value: "no"
|
|
190
|
+
}]
|
|
191
|
+
}), a = y("textarea", {
|
|
192
|
+
name: "suggestion",
|
|
193
|
+
label: e("templates.satisfactionSurvey.fieldSuggestion"),
|
|
194
|
+
props: { placeholder: e("templates.satisfactionSurvey.fieldSuggestionPlaceholder") }
|
|
195
|
+
});
|
|
196
|
+
return {
|
|
197
|
+
version: 1,
|
|
198
|
+
id: t(),
|
|
199
|
+
name: e("templates.satisfactionSurvey.name"),
|
|
200
|
+
root: {
|
|
201
|
+
id: t(),
|
|
202
|
+
category: "container",
|
|
203
|
+
type: "group",
|
|
204
|
+
renderAs: "formkit",
|
|
205
|
+
dataType: "object",
|
|
206
|
+
children: [
|
|
207
|
+
r,
|
|
208
|
+
i,
|
|
209
|
+
a,
|
|
210
|
+
x(e)
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
settings: { ...n }
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
var D = {
|
|
217
|
+
id: "satisfactionSurvey",
|
|
218
|
+
icon: "i-lucide-star",
|
|
219
|
+
nameKey: "templates.satisfactionSurvey.name",
|
|
220
|
+
descriptionKey: "templates.satisfactionSurvey.description",
|
|
221
|
+
fieldCount: 3,
|
|
222
|
+
fieldTypes: [
|
|
223
|
+
"naiveRate",
|
|
224
|
+
"radio",
|
|
225
|
+
"textarea"
|
|
226
|
+
],
|
|
227
|
+
build: E
|
|
228
|
+
};
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/templates/contact-us.ts
|
|
231
|
+
function O(e) {
|
|
232
|
+
let r = y("text", {
|
|
233
|
+
name: "name",
|
|
234
|
+
label: e("templates.contactUs.fieldName")
|
|
235
|
+
}), i = y("email", {
|
|
236
|
+
name: "email",
|
|
237
|
+
label: e("templates.contactUs.fieldEmail")
|
|
238
|
+
}), a = y("text", {
|
|
239
|
+
name: "subject",
|
|
240
|
+
label: e("templates.contactUs.fieldSubject")
|
|
241
|
+
}), o = y("textarea", {
|
|
242
|
+
name: "message",
|
|
243
|
+
label: e("templates.contactUs.fieldMessage"),
|
|
244
|
+
props: { placeholder: e("templates.contactUs.fieldMessagePlaceholder") }
|
|
245
|
+
});
|
|
246
|
+
return {
|
|
247
|
+
version: 1,
|
|
248
|
+
id: t(),
|
|
249
|
+
name: e("templates.contactUs.name"),
|
|
250
|
+
root: {
|
|
251
|
+
id: t(),
|
|
252
|
+
category: "container",
|
|
253
|
+
type: "group",
|
|
254
|
+
renderAs: "formkit",
|
|
255
|
+
dataType: "object",
|
|
256
|
+
children: [
|
|
257
|
+
r,
|
|
258
|
+
i,
|
|
259
|
+
a,
|
|
260
|
+
o,
|
|
261
|
+
x(e)
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
settings: { ...n }
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
var k = {
|
|
268
|
+
id: "contactUs",
|
|
269
|
+
icon: "i-lucide-mail",
|
|
270
|
+
nameKey: "templates.contactUs.name",
|
|
271
|
+
descriptionKey: "templates.contactUs.description",
|
|
272
|
+
fieldCount: 4,
|
|
273
|
+
fieldTypes: [
|
|
274
|
+
"text",
|
|
275
|
+
"email",
|
|
276
|
+
"textarea"
|
|
277
|
+
],
|
|
278
|
+
build: O
|
|
279
|
+
};
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/templates/employee-registration.ts
|
|
282
|
+
function A(e) {
|
|
283
|
+
let r = y("text", {
|
|
284
|
+
name: "name",
|
|
285
|
+
label: e("templates.employeeRegistration.fieldName")
|
|
286
|
+
}), i = y("select", {
|
|
287
|
+
name: "gender",
|
|
288
|
+
label: e("templates.employeeRegistration.fieldGender"),
|
|
289
|
+
options: [{
|
|
290
|
+
label: e("templates.employeeRegistration.genderMale"),
|
|
291
|
+
value: "male"
|
|
292
|
+
}, {
|
|
293
|
+
label: e("templates.employeeRegistration.genderFemale"),
|
|
294
|
+
value: "female"
|
|
295
|
+
}]
|
|
296
|
+
}), a = y("date", {
|
|
297
|
+
name: "birthDate",
|
|
298
|
+
label: e("templates.employeeRegistration.fieldBirthDate")
|
|
299
|
+
}), o = b("card", { label: e("templates.employeeRegistration.groupBasicInfo") }, [
|
|
300
|
+
r,
|
|
301
|
+
i,
|
|
302
|
+
a
|
|
303
|
+
]), s = y("select", {
|
|
304
|
+
name: "department",
|
|
305
|
+
label: e("templates.employeeRegistration.fieldDepartment"),
|
|
306
|
+
options: [
|
|
307
|
+
{
|
|
308
|
+
label: e("templates.employeeRegistration.departmentTech"),
|
|
309
|
+
value: "tech"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
label: e("templates.employeeRegistration.departmentMarketing"),
|
|
313
|
+
value: "marketing"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
label: e("templates.employeeRegistration.departmentHr"),
|
|
317
|
+
value: "hr"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
label: e("templates.employeeRegistration.departmentFinance"),
|
|
321
|
+
value: "finance"
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
}), c = y("date", {
|
|
325
|
+
name: "hireDate",
|
|
326
|
+
label: e("templates.employeeRegistration.fieldHireDate")
|
|
327
|
+
}), l = y("text", {
|
|
328
|
+
name: "position",
|
|
329
|
+
label: e("templates.employeeRegistration.fieldPosition")
|
|
330
|
+
}), u = b("card", { label: e("templates.employeeRegistration.groupWorkInfo") }, [
|
|
331
|
+
s,
|
|
332
|
+
c,
|
|
333
|
+
l
|
|
334
|
+
]);
|
|
335
|
+
return {
|
|
336
|
+
version: 1,
|
|
337
|
+
id: t(),
|
|
338
|
+
name: e("templates.employeeRegistration.name"),
|
|
339
|
+
root: {
|
|
340
|
+
id: t(),
|
|
341
|
+
category: "container",
|
|
342
|
+
type: "group",
|
|
343
|
+
renderAs: "formkit",
|
|
344
|
+
dataType: "object",
|
|
345
|
+
children: [
|
|
346
|
+
o,
|
|
347
|
+
u,
|
|
348
|
+
x(e)
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
settings: { ...n }
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/templates/index.ts
|
|
356
|
+
var j = [
|
|
357
|
+
C,
|
|
358
|
+
T,
|
|
359
|
+
D,
|
|
360
|
+
k,
|
|
361
|
+
{
|
|
362
|
+
id: "employeeRegistration",
|
|
363
|
+
icon: "i-lucide-id-card",
|
|
364
|
+
nameKey: "templates.employeeRegistration.name",
|
|
365
|
+
descriptionKey: "templates.employeeRegistration.description",
|
|
366
|
+
fieldCount: 6,
|
|
367
|
+
fieldTypes: [
|
|
368
|
+
"card",
|
|
369
|
+
"date",
|
|
370
|
+
"select"
|
|
371
|
+
],
|
|
372
|
+
build: A
|
|
373
|
+
}
|
|
374
|
+
], M = { class: "mb-3 text-[12px] text-muted-foreground" }, N = { class: "grid grid-cols-1 sm:grid-cols-2 gap-3" }, P = ["aria-label", "onClick"], F = { class: "rounded-xl border border-border/60 p-3.5 transition-colors duration-150 hover:border-[#7c9ef8] hover:bg-[#f0f4ff] dark:hover:bg-[rgba(100,130,255,0.07)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#a277ff]" }, I = { class: "flex items-center gap-2 mb-2" }, L = { class: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-[#a277ff]/10 text-[#a277ff]" }, R = { class: "min-w-0" }, z = { class: "truncate text-[13px] font-medium text-foreground" }, B = { class: "text-[11px] text-muted-foreground" }, V = { class: "mb-2.5 text-[12px] leading-relaxed text-muted-foreground line-clamp-2" }, H = { class: "flex items-center gap-1.5" }, U = /* @__PURE__ */ u({
|
|
375
|
+
__name: "TemplatePickerModal",
|
|
376
|
+
props: { show: { type: Boolean } },
|
|
377
|
+
emits: ["update:show"],
|
|
378
|
+
setup(t, { emit: n }) {
|
|
379
|
+
let u = t, y = n, { t: b } = r(), { formDefinition: x, commitFormDefinition: S } = i(), C = o(() => (x.value?.root?.children?.length ?? 0) === 0), w = p(null), T = p(!1);
|
|
380
|
+
function E(t) {
|
|
381
|
+
return e(t)?.icon || "i-lucide-shapes";
|
|
382
|
+
}
|
|
383
|
+
function D(e) {
|
|
384
|
+
S(e.build(b), { reason: "apply-template" }), T.value = !1, w.value = null, y("update:show", !1);
|
|
385
|
+
}
|
|
386
|
+
function O(e) {
|
|
387
|
+
if (C.value) {
|
|
388
|
+
D(e);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
w.value = e, T.value = !0;
|
|
392
|
+
}
|
|
393
|
+
function k() {
|
|
394
|
+
w.value && D(w.value);
|
|
395
|
+
}
|
|
396
|
+
return (e, t) => (f(), s(a, null, [l(g(v), {
|
|
397
|
+
show: u.show,
|
|
398
|
+
preset: "card",
|
|
399
|
+
class: "max-w-[760px]",
|
|
400
|
+
title: g(b)("templates.modalTitle"),
|
|
401
|
+
"onUpdate:show": t[0] ||= (e) => y("update:show", e)
|
|
402
|
+
}, {
|
|
403
|
+
default: _(() => [c("div", M, h(g(b)("templates.modalDescription")), 1), c("div", N, [(f(!0), s(a, null, m(g(j), (e) => (f(), s("button", {
|
|
404
|
+
key: e.id,
|
|
405
|
+
type: "button",
|
|
406
|
+
class: "w-full border-0 bg-transparent p-0 text-left",
|
|
407
|
+
"aria-label": g(b)(e.nameKey),
|
|
408
|
+
onClick: (t) => O(e)
|
|
409
|
+
}, [c("div", F, [
|
|
410
|
+
c("div", I, [c("span", L, [c("span", { class: d([e.icon, "h-4.5 w-4.5"]) }, null, 2)]), c("div", R, [c("div", z, h(g(b)(e.nameKey)), 1), c("div", B, h(g(b)("templates.fieldCount", { count: e.fieldCount })), 1)])]),
|
|
411
|
+
c("p", V, h(g(b)(e.descriptionKey)), 1),
|
|
412
|
+
c("div", H, [(f(!0), s(a, null, m(e.fieldTypes, (e) => (f(), s("span", {
|
|
413
|
+
key: e,
|
|
414
|
+
class: "flex h-5 w-5 items-center justify-center rounded-md bg-secondary text-foreground/70"
|
|
415
|
+
}, [c("span", { class: d([E(e), "h-3 w-3"]) }, null, 2)]))), 128))])
|
|
416
|
+
])], 8, P))), 128))])]),
|
|
417
|
+
_: 1
|
|
418
|
+
}, 8, ["show", "title"]), l(g(v), {
|
|
419
|
+
show: T.value,
|
|
420
|
+
preset: "dialog",
|
|
421
|
+
title: g(b)("templates.replaceConfirmTitle"),
|
|
422
|
+
content: g(b)("templates.replaceConfirmContent"),
|
|
423
|
+
"positive-text": g(b)("templates.replaceConfirmOk"),
|
|
424
|
+
"negative-text": g(b)("common.cancel"),
|
|
425
|
+
onPositiveClick: k,
|
|
426
|
+
onNegativeClick: t[1] ||= (e) => (T.value = !1, w.value = null),
|
|
427
|
+
"onUpdate:show": t[2] ||= (e) => T.value = e
|
|
428
|
+
}, null, 8, [
|
|
429
|
+
"show",
|
|
430
|
+
"title",
|
|
431
|
+
"content",
|
|
432
|
+
"positive-text",
|
|
433
|
+
"negative-text"
|
|
434
|
+
])], 64));
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
//#endregion
|
|
438
|
+
export { U as default };
|
|
439
|
+
|
|
440
|
+
//# sourceMappingURL=TemplatePickerModal-DPkdJJJs.js.map
|