@dazhicheng/ui 1.5.198 → 1.5.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/api/dataTypeContext.js +17 -0
- package/dist/assets/img/empty_images/no_data.png.js +4 -0
- package/dist/assets/img/empty_images/search.png.js +4 -0
- package/dist/assets/img/image_status/develop.png.js +4 -0
- package/dist/assets/img/image_status/loading.gif.js +4 -0
- package/dist/assets/img/image_status/loading_fail.png.js +4 -0
- package/dist/assets/img/image_status/no_network.png.js +4 -0
- package/dist/assets/img/image_status/no_permission.png.js +4 -0
- package/dist/assets/svg/action_more.svg.js +4 -0
- package/dist/assets/svg/close.svg.js +4 -0
- package/dist/assets/svg/item_error.svg.js +4 -0
- package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
- package/dist/assets/svg/paixu-moren.svg.js +4 -0
- package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
- package/dist/assets/svg/quanping.svg.js +4 -0
- package/dist/assets/svg/suoxiao.svg.js +4 -0
- package/dist/components/tt-api-component/index.js +7 -0
- package/dist/components/tt-api-component/index.vue.js +7 -0
- package/dist/components/tt-api-component/index.vue2.js +199 -0
- package/dist/components/tt-area/TtArea.vue.js +7 -0
- package/dist/components/tt-area/TtArea.vue2.js +36 -0
- package/dist/components/tt-button/components/AddButton.vue.js +24 -0
- package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
- package/dist/components/tt-button/index.js +9 -0
- package/dist/components/tt-button/index.vue.js +7 -0
- package/dist/components/tt-button/index.vue2.js +68 -0
- package/dist/components/tt-checkbox/index.js +7 -0
- package/dist/components/tt-checkbox/index.vue.js +77 -0
- package/dist/components/tt-checkbox/index.vue2.js +4 -0
- package/dist/components/tt-drawer/index.js +14 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +156 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
- package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
- package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
- package/dist/components/tt-drawer/src/index.js +17 -0
- package/dist/components/tt-drawer/src/props.js +72 -0
- package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
- package/dist/components/tt-empty/index.js +34 -0
- package/dist/components/tt-form/index.js +65 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
- package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
- package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
- package/dist/components/tt-form/src/components/Slot.js +28 -0
- package/dist/components/tt-form/src/config.js +57 -0
- package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
- package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
- package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
- package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
- package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
- package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
- package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
- package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
- package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
- package/dist/components/tt-form/src/form/useFormField.js +24 -0
- package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +346 -0
- package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +102 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
- package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
- package/dist/components/tt-form/src/form-render/context.js +15 -0
- package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
- package/dist/components/tt-form/src/form-render/expandable.js +46 -0
- package/dist/components/tt-form/src/form-render/form.vue2.js +197 -0
- package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
- package/dist/components/tt-form/src/form-render/helper.js +22 -0
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
- package/dist/components/tt-form/src/formApi.js +790 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +278 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
- package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
- package/dist/components/tt-form/src/group-form/utils.js +106 -0
- package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
- package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
- package/dist/components/tt-form/src/index.vue2.js +149 -0
- package/dist/components/tt-form/src/index.vue3.js +5 -0
- package/dist/components/tt-form/src/shared/createContext.js +14 -0
- package/dist/components/tt-form/src/shared/global-state.js +22 -0
- package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
- package/dist/components/tt-form/src/types/forms.js +6 -0
- package/dist/components/tt-form/src/useForm.js +28 -0
- package/dist/components/tt-form/src/useFormContext.js +320 -0
- package/dist/components/tt-form/src/utils/array-path.js +18 -0
- package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
- package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
- package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
- package/dist/components/tt-icon/index.js +11 -0
- package/dist/components/tt-icon/index.vue.js +8 -0
- package/dist/components/tt-icon/index.vue2.js +115 -0
- package/dist/components/tt-image/index.js +9 -0
- package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
- package/dist/components/tt-image/tt-image.js +55 -0
- package/dist/components/tt-loading/index.js +8 -0
- package/dist/components/tt-loading/src/directive.js +51 -0
- package/dist/components/tt-loading/src/loading.vue.js +7 -0
- package/dist/components/tt-loading/src/loading.vue2.js +75 -0
- package/dist/components/tt-loading/src/service.js +79 -0
- package/dist/components/tt-log/index.js +7 -0
- package/dist/components/tt-log/index.vue.js +30 -0
- package/dist/components/tt-log/index.vue2.js +4 -0
- package/dist/components/tt-modal/index.js +14 -0
- package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
- package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
- package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
- package/dist/components/tt-modal/src/index.js +17 -0
- package/dist/components/tt-modal/src/props.js +75 -0
- package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
- package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
- package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
- package/dist/components/tt-modal-form/index.vue.js +178 -0
- package/dist/components/tt-modal-form/index.vue2.js +4 -0
- package/dist/components/tt-modal-form/useModalForm.js +30 -0
- package/dist/components/tt-nav-anchor/index.js +8 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
- package/dist/components/tt-nav-anchor/src/constants.js +4 -0
- package/dist/components/tt-panel-select/index.js +7 -0
- package/dist/components/tt-panel-select/src/common.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
- package/dist/components/tt-panel-select/src/index.vue.js +386 -0
- package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
- package/dist/components/tt-select/index.js +8 -0
- package/dist/components/tt-select/src/Select.vue.js +315 -0
- package/dist/components/tt-select/src/Select.vue3.js +5 -0
- package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
- package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
- package/dist/components/tt-select/src/components/Table.vue.js +307 -0
- package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
- package/dist/components/tt-select/src/const.js +19 -0
- package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
- package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
- package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
- package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
- package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
- package/dist/components/tt-select/src/props.js +201 -0
- package/dist/components/tt-select/src/utils/index.js +16 -0
- package/dist/components/tt-table/index.js +33 -0
- package/dist/components/tt-table/src/Table.vue.js +623 -0
- package/dist/components/tt-table/src/Table.vue3.js +5 -0
- package/dist/components/tt-table/src/TableForm.vue.js +317 -0
- package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
- package/dist/components/tt-table/src/componentMap.js +4 -0
- package/dist/components/tt-table/src/components/RowContext.js +24 -0
- package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
- package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
- package/dist/components/tt-table/src/components/TableButtons.js +117 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +233 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.js +15 -0
- package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
- package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
- package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
- package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
- package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
- package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
- package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
- package/dist/components/tt-table/src/props.js +482 -0
- package/dist/components/tt-table/src/toolProps.js +30 -0
- package/dist/components/tt-table/src/utils/context.js +17 -0
- package/dist/components/tt-table/src/utils/table-api.js +386 -0
- package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
- package/dist/components/tt-text/index.js +7 -0
- package/dist/components/tt-text/index.vue.js +7 -0
- package/dist/components/tt-text/index.vue2.js +73 -0
- package/dist/components/tt-upload/index.js +9 -0
- package/dist/components/tt-upload/src/TtUpload.vue.js +305 -0
- package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
- package/dist/components/tt-upload/src/typing.js +107 -0
- package/dist/directives/auto-tip/index.js +62 -0
- package/dist/directives/dialog-resize/index.js +49 -0
- package/dist/directives/dialog-resize/use-css-variable.js +44 -0
- package/dist/directives/dialog-resize/use-draggable.js +35 -0
- package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
- package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
- package/dist/directives/dialog-resize/use-resizer.js +37 -0
- package/dist/directives/disabled-tip/index.js +78 -0
- package/dist/directives/index.js +8 -0
- package/dist/hooks/useDataPermissionOptions.js +142 -0
- package/dist/hooks/useFormSchemasLink.js +261 -0
- package/dist/hooks/useFormat.js +44 -0
- package/dist/hooks/useLoading.js +22 -0
- package/dist/hooks/useScreenshotOss.js +69 -0
- package/dist/hooks/useSetup.js +59 -0
- package/dist/index.js +142 -60274
- package/dist/plugins/default/renderCellContent.js +58 -0
- package/dist/plugins/vxeTable/switchStatus.js +91 -0
- package/dist/plugins.js +4 -146
- package/dist/style.css +1 -1
- package/dist/utils/xhr.js +8 -0
- package/package.json +5 -3
- package/dist/index-NG5FNCLD.js +0 -3430
- package/dist/index.modern-4Cf3dcJP.js +0 -3069
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const f = Symbol("VirtualGroupFormErrorCache");
|
|
2
|
+
function d(c = 4) {
|
|
3
|
+
const e = [];
|
|
4
|
+
let u = !1, n = !1;
|
|
5
|
+
function o() {
|
|
6
|
+
if (u = !1, n) return;
|
|
7
|
+
let l = 0;
|
|
8
|
+
for (; e.length > 0 && l < c; ) {
|
|
9
|
+
const t = e.shift();
|
|
10
|
+
t.cancelled || (t.cb(), l++);
|
|
11
|
+
}
|
|
12
|
+
e.length > 0 && r();
|
|
13
|
+
}
|
|
14
|
+
function r() {
|
|
15
|
+
u || n || (u = !0, requestAnimationFrame(o));
|
|
16
|
+
}
|
|
17
|
+
function i(l) {
|
|
18
|
+
const t = { cb: l, cancelled: !1 };
|
|
19
|
+
return e.push(t), r(), () => {
|
|
20
|
+
t.cancelled = !0;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function s() {
|
|
24
|
+
n = !0;
|
|
25
|
+
}
|
|
26
|
+
function a() {
|
|
27
|
+
n = !1, e.length > 0 && r();
|
|
28
|
+
}
|
|
29
|
+
return { request: i, pause: s, resume: a };
|
|
30
|
+
}
|
|
31
|
+
const E = Symbol("VirtualRenderScheduler"), h = Symbol("GroupVisibilityCallback"), R = Symbol("HiddenGroupKeys");
|
|
32
|
+
export {
|
|
33
|
+
h as GROUP_VISIBILITY_CALLBACK_KEY,
|
|
34
|
+
R as HIDDEN_GROUP_KEYS_KEY,
|
|
35
|
+
E as RENDER_SCHEDULER_KEY,
|
|
36
|
+
f as VIRTUAL_ERROR_CACHE_KEY,
|
|
37
|
+
d as createRenderScheduler
|
|
38
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as y, onMounted as C, watch as a, onBeforeUnmount as _, h as x, isReactive as N } from "vue";
|
|
2
|
+
import { useStore as P } from "@tanstack/vue-store";
|
|
3
|
+
import { GroupFormApi as w } from "./groupFormApi.js";
|
|
4
|
+
import M from "./GroupForm.vue2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { resolveGroupSchema as u, extractFlatSchemas as D } from "./utils.js";
|
|
7
|
+
function q(e) {
|
|
8
|
+
const m = u(e), {
|
|
9
|
+
groupSchema: H,
|
|
10
|
+
schema: O,
|
|
11
|
+
virtual: i = !0,
|
|
12
|
+
containerHeight: l = "100%",
|
|
13
|
+
rootMargin: f = "400px 0px",
|
|
14
|
+
estimateFieldHeight: h = 52,
|
|
15
|
+
navAnchorProps: F,
|
|
16
|
+
scrollToFirstError: v,
|
|
17
|
+
scrollOffset: S = 0,
|
|
18
|
+
...d
|
|
19
|
+
} = e, g = {
|
|
20
|
+
title: "导航",
|
|
21
|
+
show: !0,
|
|
22
|
+
...F
|
|
23
|
+
}, A = D(m), G = {
|
|
24
|
+
...d,
|
|
25
|
+
schema: A,
|
|
26
|
+
showDefaultActions: !1,
|
|
27
|
+
scrollToFirstError: !1
|
|
28
|
+
}, r = new w(G, {
|
|
29
|
+
groupSchema: m,
|
|
30
|
+
navAnchorProps: g,
|
|
31
|
+
virtual: i,
|
|
32
|
+
scrollToFirstError: v ?? !0,
|
|
33
|
+
containerHeight: l,
|
|
34
|
+
rootMargin: f,
|
|
35
|
+
estimateFieldHeight: h,
|
|
36
|
+
scrollOffset: S
|
|
37
|
+
}), s = r;
|
|
38
|
+
s.useStore = (o) => P(r.store, o);
|
|
39
|
+
const E = y({
|
|
40
|
+
name: "TtGroupForm",
|
|
41
|
+
inheritAttrs: !1,
|
|
42
|
+
setup(o, { attrs: p, slots: T }) {
|
|
43
|
+
r.setState({ ...p });
|
|
44
|
+
const n = [];
|
|
45
|
+
return C(() => {
|
|
46
|
+
r.resetCollapseStatesToDefault(), r.navAnchorProps.show && (r.syncNavErrorCountsFromForm(), n.push(
|
|
47
|
+
a(
|
|
48
|
+
() => {
|
|
49
|
+
var t, c;
|
|
50
|
+
return (c = (t = r.form) == null ? void 0 : t.errors) == null ? void 0 : c.value;
|
|
51
|
+
},
|
|
52
|
+
() => r.syncNavErrorCountsFromForm(),
|
|
53
|
+
{ deep: !0, flush: "post" }
|
|
54
|
+
)
|
|
55
|
+
), r.virtual && n.push(
|
|
56
|
+
a(
|
|
57
|
+
() => r.resetSignal.value,
|
|
58
|
+
() => r.syncNavErrorCountsFromForm()
|
|
59
|
+
)
|
|
60
|
+
));
|
|
61
|
+
}), _(() => {
|
|
62
|
+
n.splice(0).forEach((t) => t()), r.unmount();
|
|
63
|
+
}), () => x(
|
|
64
|
+
M,
|
|
65
|
+
{
|
|
66
|
+
...p,
|
|
67
|
+
ref: r.groupFormRef,
|
|
68
|
+
formApi: s
|
|
69
|
+
},
|
|
70
|
+
T
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return N(e) && a(
|
|
75
|
+
() => u(e),
|
|
76
|
+
(o) => {
|
|
77
|
+
o.length && r._applyGroupSchema(o);
|
|
78
|
+
}
|
|
79
|
+
), [E, s];
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
q as useGroupForm
|
|
83
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { set as a, get as c } from "lodash-es";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return "type" in r && r.type === "group";
|
|
4
|
+
}
|
|
5
|
+
function l(r) {
|
|
6
|
+
return "type" in r && r.type === "row";
|
|
7
|
+
}
|
|
8
|
+
function s(r) {
|
|
9
|
+
return "type" in r && r.type === "slot";
|
|
10
|
+
}
|
|
11
|
+
function v(r, e) {
|
|
12
|
+
return o(r) ? `group-${r.key}` : l(r) ? `row-${e}` : s(r) ? `slot-${e}` : r.fieldName || `field-${e}`;
|
|
13
|
+
}
|
|
14
|
+
function E(r) {
|
|
15
|
+
return r.map((e) => e.fieldName).filter((e) => !!e);
|
|
16
|
+
}
|
|
17
|
+
function I(r) {
|
|
18
|
+
const { groupSchema: e, schema: t } = r;
|
|
19
|
+
return process.env.NODE_ENV, e ?? t ?? [];
|
|
20
|
+
}
|
|
21
|
+
function y(r) {
|
|
22
|
+
const e = [];
|
|
23
|
+
for (const t of r)
|
|
24
|
+
o(t) ? e.push(...y(t.children)) : l(t) ? e.push(...t.children) : s(t) || e.push(t);
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function N(r, e) {
|
|
28
|
+
for (const t of r)
|
|
29
|
+
o(t) && (t.defaultCollapsed && (e[t.key] = !0), t.children && N(t.children, e));
|
|
30
|
+
}
|
|
31
|
+
function g(r, e) {
|
|
32
|
+
const t = {};
|
|
33
|
+
return a(t, e, !0), r.findIndex((n) => {
|
|
34
|
+
var i;
|
|
35
|
+
return !!("fieldName" in n && c(t, n.fieldName) || s(n) && typeof n.content == "string" && n.content === e || o(n) && n.key === e || l(n) && ((i = n.children) != null && i.some((f) => c(t, f.fieldName))));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function S(r, e, t) {
|
|
39
|
+
const n = t.before ?? t.after;
|
|
40
|
+
if (!n) return !1;
|
|
41
|
+
const i = {};
|
|
42
|
+
r.children.forEach((d, u) => {
|
|
43
|
+
a(i, d.fieldName, u);
|
|
44
|
+
});
|
|
45
|
+
const f = c(i, n);
|
|
46
|
+
return typeof f != "number" ? !1 : (r.children.splice(t.before ? f : f + 1, 0, ...e), !0);
|
|
47
|
+
}
|
|
48
|
+
function b(r, e, t) {
|
|
49
|
+
var d;
|
|
50
|
+
const n = t.before ?? t.after;
|
|
51
|
+
if (!n) return !1;
|
|
52
|
+
const i = {};
|
|
53
|
+
a(i, n, !0);
|
|
54
|
+
const f = g(r, n);
|
|
55
|
+
if (f !== -1) {
|
|
56
|
+
const u = r[f];
|
|
57
|
+
return l(u) && ((d = u.children) != null && d.some((h) => h.fieldName && c(i, h.fieldName))) ? S(u, e, t) : (r.splice(t.before ? f : f + 1, 0, ...e), !0);
|
|
58
|
+
}
|
|
59
|
+
for (const u of r)
|
|
60
|
+
if (o(u) && b(u.children, e, t))
|
|
61
|
+
return !0;
|
|
62
|
+
return !1;
|
|
63
|
+
}
|
|
64
|
+
function p(r, e, t) {
|
|
65
|
+
return !!("fieldName" in r && c(e, r.fieldName) || s(r) && typeof r.content == "string" && t.has(r.content));
|
|
66
|
+
}
|
|
67
|
+
function F(r, e) {
|
|
68
|
+
const t = [];
|
|
69
|
+
for (const n of r)
|
|
70
|
+
o(n) && e.has(n.key) || (o(n) && (n.children = F(n.children, e)), t.push(n));
|
|
71
|
+
return t;
|
|
72
|
+
}
|
|
73
|
+
function G(r, e) {
|
|
74
|
+
const t = {};
|
|
75
|
+
e.forEach((i) => {
|
|
76
|
+
a(t, i, !0);
|
|
77
|
+
});
|
|
78
|
+
const n = [];
|
|
79
|
+
for (const i of r)
|
|
80
|
+
p(i, t, e) || (o(i) && (i.children = G(i.children, e)), l(i) && (i.children = i.children.filter((f) => !p(f, t, e))), n.push(i));
|
|
81
|
+
return n;
|
|
82
|
+
}
|
|
83
|
+
function k(r) {
|
|
84
|
+
return r.map((e) => o(e) ? { ...e, children: k(e.children) } : l(e) ? { ...e, children: [...e.children] } : e);
|
|
85
|
+
}
|
|
86
|
+
function m(r, e) {
|
|
87
|
+
const t = {};
|
|
88
|
+
for (const n of r)
|
|
89
|
+
o(n) ? t[n.key] = m(n.children, e) : l(n) ? Object.assign(t, m(n.children, e)) : s(n) || (t[n.fieldName] = e[n.fieldName]);
|
|
90
|
+
return t;
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
k as cloneSchemaTree,
|
|
94
|
+
N as collectDefaultCollapseStates,
|
|
95
|
+
y as extractFlatSchemas,
|
|
96
|
+
E as getFieldNames,
|
|
97
|
+
m as getGroupValues,
|
|
98
|
+
v as getSchemaKey,
|
|
99
|
+
b as insertFieldsByPosition,
|
|
100
|
+
o as isGroupSchema,
|
|
101
|
+
l as isRowSchema,
|
|
102
|
+
s as isSlotSchema,
|
|
103
|
+
G as removeFieldsFromGroup,
|
|
104
|
+
F as removeGroupsFromGroup,
|
|
105
|
+
I as resolveGroupSchema
|
|
106
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed as p, unref as c } from "vue";
|
|
2
|
+
import { injectFormProps as g } from "../useFormContext.js";
|
|
3
|
+
import { normalizeArrayFieldPath as l } from "../utils/array-path.js";
|
|
4
|
+
function d(n, u) {
|
|
5
|
+
const [f] = g(), i = p(() => {
|
|
6
|
+
var r;
|
|
7
|
+
return (r = c(f)) == null ? void 0 : r.formApi;
|
|
8
|
+
}), e = l(n);
|
|
9
|
+
let t;
|
|
10
|
+
function s(r) {
|
|
11
|
+
var o;
|
|
12
|
+
e && r && (t = r, (o = i.value) == null || o.registerArrayField(e, r, u));
|
|
13
|
+
}
|
|
14
|
+
function m() {
|
|
15
|
+
var r;
|
|
16
|
+
e && ((r = i.value) == null || r.unregisterArrayField(e, t), t = void 0);
|
|
17
|
+
}
|
|
18
|
+
return [s, m];
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
d as useArrayRegistry
|
|
22
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { inject as K, computed as d, toValue as V, ref as M, watch as O, onBeforeUnmount as R } from "vue";
|
|
2
|
+
import { get as U, set as C, cloneDeep as y } from "lodash-es";
|
|
3
|
+
import { FormContextKey as q } from "vee-validate";
|
|
4
|
+
function J(g) {
|
|
5
|
+
const r = K(q), i = d(() => V(g)), s = M([]);
|
|
6
|
+
let E = 0, f;
|
|
7
|
+
function a() {
|
|
8
|
+
if (!r)
|
|
9
|
+
return [];
|
|
10
|
+
const t = U(r.values, i.value);
|
|
11
|
+
return Array.isArray(t) ? t : [];
|
|
12
|
+
}
|
|
13
|
+
function c(t) {
|
|
14
|
+
r && (C(r.values, i.value, t), f = a());
|
|
15
|
+
}
|
|
16
|
+
function A(t, e) {
|
|
17
|
+
return d({
|
|
18
|
+
get() {
|
|
19
|
+
const n = a(), u = s.value.findIndex((l) => l.key === t);
|
|
20
|
+
return u === -1 ? e : n[u];
|
|
21
|
+
},
|
|
22
|
+
set(n) {
|
|
23
|
+
const u = s.value.findIndex((l) => l.key === t);
|
|
24
|
+
u !== -1 && F(u, n);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function h() {
|
|
29
|
+
const t = s.value.length;
|
|
30
|
+
for (let e = 0; e < t; e++) {
|
|
31
|
+
const n = s.value[e];
|
|
32
|
+
n.isFirst = e === 0, n.isLast = e === t - 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function o() {
|
|
36
|
+
h(), r == null || r.validate({ mode: "silent" });
|
|
37
|
+
}
|
|
38
|
+
function v(t, e, n) {
|
|
39
|
+
if (n && e != null && n[e])
|
|
40
|
+
return n[e];
|
|
41
|
+
const u = E++;
|
|
42
|
+
return {
|
|
43
|
+
key: u,
|
|
44
|
+
value: A(u, t),
|
|
45
|
+
isFirst: !1,
|
|
46
|
+
isLast: !1
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function p() {
|
|
50
|
+
const t = a(), e = s.value;
|
|
51
|
+
s.value = t.map((n, u) => v(n, u, e)), f = a(), h();
|
|
52
|
+
}
|
|
53
|
+
p(), O([() => a(), () => a().length], ([t]) => {
|
|
54
|
+
const e = t.length !== s.value.length || t !== f;
|
|
55
|
+
f = t, e && p();
|
|
56
|
+
});
|
|
57
|
+
function I(t) {
|
|
58
|
+
if (!r)
|
|
59
|
+
return;
|
|
60
|
+
const e = [...a()];
|
|
61
|
+
if (t < 0 || t >= e.length)
|
|
62
|
+
return;
|
|
63
|
+
const n = `${i.value}[${t}]`;
|
|
64
|
+
r.destroyPath(n), r.unsetInitialValue(n), e.splice(t, 1), c(e), s.value.splice(t, 1), o();
|
|
65
|
+
}
|
|
66
|
+
function j(t) {
|
|
67
|
+
if (!r)
|
|
68
|
+
return;
|
|
69
|
+
const e = y(t), n = [...a(), e];
|
|
70
|
+
r.stageInitialValue(`${i.value}[${n.length - 1}]`, e), c(n), s.value.push(v(e)), o();
|
|
71
|
+
}
|
|
72
|
+
function k(t) {
|
|
73
|
+
if (!r)
|
|
74
|
+
return;
|
|
75
|
+
const e = y(t), n = [e, ...a()];
|
|
76
|
+
r.stageInitialValue(`${i.value}[0]`, e), c(n), s.value.unshift(v(e)), o();
|
|
77
|
+
}
|
|
78
|
+
function w(t, e) {
|
|
79
|
+
if (!r)
|
|
80
|
+
return;
|
|
81
|
+
const n = y(e), u = [...a()];
|
|
82
|
+
t < 0 || t > u.length || (u.splice(t, 0, n), c(u), s.value.splice(t, 0, v(n)), o());
|
|
83
|
+
}
|
|
84
|
+
function L(t) {
|
|
85
|
+
r && (r.stageInitialValue(i.value, t), c(y(t)), p(), o());
|
|
86
|
+
}
|
|
87
|
+
function F(t, e) {
|
|
88
|
+
if (!r)
|
|
89
|
+
return;
|
|
90
|
+
const n = a();
|
|
91
|
+
t < 0 || t >= n.length || (C(r.values, `${i.value}[${t}]`, e), r.validate({ mode: "validated-only" }));
|
|
92
|
+
}
|
|
93
|
+
function b(t, e) {
|
|
94
|
+
if (!r)
|
|
95
|
+
return;
|
|
96
|
+
const n = [...a()];
|
|
97
|
+
if (!(t in n) || !(e in n))
|
|
98
|
+
return;
|
|
99
|
+
const u = n[t];
|
|
100
|
+
n[t] = n[e], n[e] = u;
|
|
101
|
+
const l = [...s.value], m = l[t];
|
|
102
|
+
l[t] = l[e], l[e] = m, c(n), s.value = l, h();
|
|
103
|
+
}
|
|
104
|
+
function D(t, e) {
|
|
105
|
+
if (!r)
|
|
106
|
+
return;
|
|
107
|
+
const n = [...a()];
|
|
108
|
+
if (!(t in n) || !(e in n))
|
|
109
|
+
return;
|
|
110
|
+
const u = n.splice(t, 1)[0];
|
|
111
|
+
n.splice(e, 0, u);
|
|
112
|
+
const l = [...s.value], m = l.splice(t, 1)[0];
|
|
113
|
+
l.splice(e, 0, m), c(n), s.value = l, o();
|
|
114
|
+
}
|
|
115
|
+
const $ = {
|
|
116
|
+
fields: s,
|
|
117
|
+
remove: I,
|
|
118
|
+
push: j,
|
|
119
|
+
prepend: k,
|
|
120
|
+
insert: w,
|
|
121
|
+
replace: L,
|
|
122
|
+
update: F,
|
|
123
|
+
swap: b,
|
|
124
|
+
move: D
|
|
125
|
+
};
|
|
126
|
+
if (r) {
|
|
127
|
+
const t = Object.assign({ path: g, reset: p }, $);
|
|
128
|
+
r.fieldArrays.push(t), R(() => {
|
|
129
|
+
const e = r.fieldArrays.findIndex((n) => V(n.path) === V(g));
|
|
130
|
+
e >= 0 && r.fieldArrays.splice(e, 1);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return $;
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
J as useFieldArray
|
|
137
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { kebabToCamelCase as d, getFirstNonNullOrUndefined as p } from "@dazhicheng/utils";
|
|
2
|
+
import { computed as l, unref as b, getCurrentInstance as O, useSlots as j, useAttrs as C } from "vue";
|
|
3
|
+
function g(o, u, t) {
|
|
4
|
+
const r = O(), e = j(), i = C();
|
|
5
|
+
return l(() => {
|
|
6
|
+
var s, c;
|
|
7
|
+
const f = ((s = r == null ? void 0 : r.vnode) == null ? void 0 : s.props) || {}, n = {};
|
|
8
|
+
for (const [m, v] of Object.entries(f))
|
|
9
|
+
n[d(m)] = v;
|
|
10
|
+
const a = (n == null ? void 0 : n[o]) === void 0 ? void 0 : u[o];
|
|
11
|
+
return p(
|
|
12
|
+
e[o],
|
|
13
|
+
i[o],
|
|
14
|
+
a,
|
|
15
|
+
(c = t == null ? void 0 : t.value) == null ? void 0 : c[o]
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function F(o, u) {
|
|
20
|
+
const t = {};
|
|
21
|
+
return Object.keys(o).forEach((r) => {
|
|
22
|
+
t[r] = g(r, o, u);
|
|
23
|
+
}), l(() => {
|
|
24
|
+
const r = {};
|
|
25
|
+
return Object.keys(o).forEach((e) => {
|
|
26
|
+
r[e] = b(t[e]);
|
|
27
|
+
}), r;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
F as useForwardPriorityValues,
|
|
32
|
+
g as usePriorityValue
|
|
33
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { isString as x, calcWordsWidth as A } from "@dazhicheng/utils";
|
|
2
|
+
import { useResizeObserver as E } from "@vueuse/core";
|
|
3
|
+
import { ref as z, computed as a, toValue as L, watch as F, nextTick as T } from "vue";
|
|
4
|
+
function _(c) {
|
|
5
|
+
const n = z(1), u = ["ElSelect", "ElSelectV2"], i = () => c.value.component, r = () => L(c.value.componentProps), p = () => c.value.selectWrapRef, b = () => c.value.selectRef, f = a(() => {
|
|
6
|
+
const t = i();
|
|
7
|
+
return x(t) && u.includes(t);
|
|
8
|
+
}), m = a(() => {
|
|
9
|
+
var o;
|
|
10
|
+
const t = i(), e = r();
|
|
11
|
+
return t === "TtApiComponent" && u.includes((o = e == null ? void 0 : e.component) == null ? void 0 : o.name);
|
|
12
|
+
}), R = a(() => {
|
|
13
|
+
const t = r();
|
|
14
|
+
if (f.value || m.value) {
|
|
15
|
+
const e = {
|
|
16
|
+
clearable: !0,
|
|
17
|
+
filterable: !0
|
|
18
|
+
};
|
|
19
|
+
return t != null && t.multiple && (e.collapseTagsTooltip = !0, e.collapseTags = !0, e.maxCollapseTags = n.value), e;
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
});
|
|
23
|
+
function v() {
|
|
24
|
+
var e, o, l, s;
|
|
25
|
+
const t = b();
|
|
26
|
+
if (m.value)
|
|
27
|
+
return (l = (o = (e = t.value) == null ? void 0 : e.getComponentRef) == null ? void 0 : o.call(e)) == null ? void 0 : l.selectedLabel;
|
|
28
|
+
if (f.value)
|
|
29
|
+
return (s = t.value) == null ? void 0 : s.selectedLabel;
|
|
30
|
+
}
|
|
31
|
+
function g() {
|
|
32
|
+
var h;
|
|
33
|
+
if (!((h = r()) != null && h.multiple)) {
|
|
34
|
+
n.value = 1;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const t = v();
|
|
38
|
+
if (!Array.isArray(t)) {
|
|
39
|
+
n.value = 1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!t.length) {
|
|
43
|
+
n.value = 1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const e = p().value;
|
|
47
|
+
if (!e) {
|
|
48
|
+
n.value = 1;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const o = e.querySelector(".el-select__selection");
|
|
52
|
+
if (!o) {
|
|
53
|
+
n.value = 1;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const l = window.getComputedStyle(o), s = l.fontFamily, W = l.fontSize, d = o.clientWidth - 48;
|
|
57
|
+
if (d <= 0) {
|
|
58
|
+
n.value = 1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let S = 0, C = 0;
|
|
62
|
+
t.slice(0).forEach((w) => {
|
|
63
|
+
const y = A(w, W, s) + 32 + 4;
|
|
64
|
+
S + y < d && (S += y, C += 1);
|
|
65
|
+
}), n.value = Math.max(1, C);
|
|
66
|
+
}
|
|
67
|
+
return F(
|
|
68
|
+
v,
|
|
69
|
+
async () => {
|
|
70
|
+
await T(), g();
|
|
71
|
+
},
|
|
72
|
+
{ flush: "post", deep: !0 }
|
|
73
|
+
), E(p(), async () => {
|
|
74
|
+
await T(), g();
|
|
75
|
+
}), {
|
|
76
|
+
selectComponentProps: R
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
_ as useSelectCollapseOptions
|
|
81
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { defineComponent as P, ref as N, onMounted as S, nextTick as $, watch as k, createBlock as A, openBlock as B, unref as r, mergeProps as x, withKeys as L, createSlots as I, withCtx as m, renderSlot as u, normalizeProps as c, guardReactiveProps as f, createCommentVNode as K, renderList as U } from "vue";
|
|
2
|
+
import { useDesign as z } from "@dazhicheng/hooks";
|
|
3
|
+
import { cloneDeep as q } from "@dazhicheng/utils";
|
|
4
|
+
import { get as M, isEqual as G, set as H } from "lodash-es";
|
|
5
|
+
import { useForwardPriorityValues as W } from "./hooks/useForwardPriorityValues.js";
|
|
6
|
+
import { useDebounceFn as j } from "@vueuse/core";
|
|
7
|
+
import J from "./components/FormActions.vue2.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { DEFAULT_FORM_COMMON_CONFIG as Q, COMPONENT_MAP as X, COMPONENT_BIND_EVENT_MAP as Y } from "./config.js";
|
|
10
|
+
import "./components/Slot.js";
|
|
11
|
+
import "vee-validate";
|
|
12
|
+
import "@dazhicheng-ui/components/tt-form-item-error-tooltip";
|
|
13
|
+
import "@dazhicheng-ui/assets/img/FormItemWarning.jpeg?inline";
|
|
14
|
+
import "@dazhicheng-ui/components/tt-icon";
|
|
15
|
+
import "element-plus";
|
|
16
|
+
/* empty css */
|
|
17
|
+
import "./form/RenderContent.vue.js";
|
|
18
|
+
import "@vee-validate/zod";
|
|
19
|
+
import { useFormInitial as Z, provideFormProps as ee, provideComponentRefMap as oe } from "./useFormContext.js";
|
|
20
|
+
import "es-toolkit/compat";
|
|
21
|
+
import "@dazhicheng-ui/assets/svg/help.svg?raw";
|
|
22
|
+
import "@dazhicheng-ui/components/tt-text";
|
|
23
|
+
import te from "./form-render/form.vue2.js";
|
|
24
|
+
/* empty css */
|
|
25
|
+
const _e = /* @__PURE__ */ P({
|
|
26
|
+
name: "TtForm",
|
|
27
|
+
__name: "index",
|
|
28
|
+
props: {
|
|
29
|
+
formApi: {},
|
|
30
|
+
actionButtonsReverse: { type: Boolean },
|
|
31
|
+
actionLayout: {},
|
|
32
|
+
actionPosition: {},
|
|
33
|
+
actionWrapperClass: {},
|
|
34
|
+
arrayToStringFields: {},
|
|
35
|
+
fieldMappingTime: {},
|
|
36
|
+
handleCollapsedChange: { type: Function },
|
|
37
|
+
handleReset: { type: Function },
|
|
38
|
+
handleSubmit: { type: Function },
|
|
39
|
+
handleValuesChange: { type: Function },
|
|
40
|
+
resetButtonOptions: {},
|
|
41
|
+
scrollToFirstError: { type: Boolean },
|
|
42
|
+
showDefaultActions: { type: Boolean },
|
|
43
|
+
submitButtonOptions: {},
|
|
44
|
+
submitOnChange: { type: Boolean },
|
|
45
|
+
submitOnEnter: { type: Boolean },
|
|
46
|
+
collapsed: { type: Boolean },
|
|
47
|
+
collapsedRows: {},
|
|
48
|
+
collapseTriggerResize: { type: Boolean },
|
|
49
|
+
commonConfig: {},
|
|
50
|
+
compact: { type: Boolean },
|
|
51
|
+
layout: {},
|
|
52
|
+
schema: {},
|
|
53
|
+
showCollapseButton: { type: Boolean },
|
|
54
|
+
wrapperClass: {}
|
|
55
|
+
},
|
|
56
|
+
setup(O) {
|
|
57
|
+
var g, w, y, F;
|
|
58
|
+
const C = N(), { prefixCls: _ } = z("form-plus"), d = O, o = (w = (g = d.formApi) == null ? void 0 : g.useStore) == null ? void 0 : w.call(g), t = W(d, o), v = /* @__PURE__ */ new Map(), { delegatedSlots: E, form: h } = Z(t);
|
|
59
|
+
ee([t, h]), oe(v), (F = (y = d.formApi) == null ? void 0 : y.mount) == null || F.call(y, h, v);
|
|
60
|
+
const T = (e) => {
|
|
61
|
+
var p, n, a;
|
|
62
|
+
(p = d.formApi) == null || p.setState({ collapsed: e }), (a = (n = t.value).handleCollapsedChange) == null || a.call(n, e);
|
|
63
|
+
};
|
|
64
|
+
function R(e) {
|
|
65
|
+
var p, n;
|
|
66
|
+
!(o != null && o.value.submitOnEnter) || !((p = t.value.formApi) != null && p.isMounted) || e.target instanceof HTMLTextAreaElement || (e.preventDefault(), (n = t.value.formApi) == null || n.validateAndSubmitForm());
|
|
67
|
+
}
|
|
68
|
+
const V = j(async () => {
|
|
69
|
+
var e;
|
|
70
|
+
o != null && o.value.submitOnChange && ((e = t.value.formApi) == null || e.validateAndSubmitForm());
|
|
71
|
+
}, 300), b = {};
|
|
72
|
+
return S(async () => {
|
|
73
|
+
await $(), k(
|
|
74
|
+
() => h.values,
|
|
75
|
+
async (e) => {
|
|
76
|
+
var p, n;
|
|
77
|
+
if (t.value.handleValuesChange) {
|
|
78
|
+
const a = (p = o == null ? void 0 : o.value.schema) == null ? void 0 : p.map((l) => l.fieldName);
|
|
79
|
+
if (a && a.length > 0) {
|
|
80
|
+
const l = [];
|
|
81
|
+
if (a.forEach((i) => {
|
|
82
|
+
const s = M(e, i), D = M(b, i);
|
|
83
|
+
G(s, D) || (l.push(i), H(b, i, s));
|
|
84
|
+
}), l.length > 0) {
|
|
85
|
+
const i = await ((n = t.value.formApi) == null ? void 0 : n.getValues());
|
|
86
|
+
t.value.handleValuesChange(q(i ?? {}), l);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
V();
|
|
91
|
+
},
|
|
92
|
+
{ deep: !0 }
|
|
93
|
+
);
|
|
94
|
+
}), (e, p) => {
|
|
95
|
+
var n;
|
|
96
|
+
return B(), A(r(te), x({
|
|
97
|
+
ref_key: "formRef",
|
|
98
|
+
ref: C
|
|
99
|
+
}, r(t), {
|
|
100
|
+
class: r(_),
|
|
101
|
+
collapsed: (n = r(o)) == null ? void 0 : n.collapsed,
|
|
102
|
+
"component-bind-event-map": r(Y),
|
|
103
|
+
"component-map": r(X),
|
|
104
|
+
form: r(h),
|
|
105
|
+
"global-common-config": r(Q),
|
|
106
|
+
onKeydown: L(R, ["enter"])
|
|
107
|
+
}), I({
|
|
108
|
+
default: m((a) => [
|
|
109
|
+
u(e.$slots, "default", c(f(a)), () => {
|
|
110
|
+
var l, i;
|
|
111
|
+
return [
|
|
112
|
+
r(t).showDefaultActions ? (B(), A(J, {
|
|
113
|
+
key: 0,
|
|
114
|
+
"model-value": (l = r(o)) == null ? void 0 : l.collapsed,
|
|
115
|
+
"wrapper-ref": (i = C.value) == null ? void 0 : i.wrapperRef,
|
|
116
|
+
"onUpdate:modelValue": T
|
|
117
|
+
}, {
|
|
118
|
+
"reset-before": m((s) => [
|
|
119
|
+
u(e.$slots, "reset-before", c(f(s)))
|
|
120
|
+
]),
|
|
121
|
+
"submit-before": m((s) => [
|
|
122
|
+
u(e.$slots, "submit-before", c(f(s)))
|
|
123
|
+
]),
|
|
124
|
+
"expand-before": m((s) => [
|
|
125
|
+
u(e.$slots, "expand-before", c(f(s)))
|
|
126
|
+
]),
|
|
127
|
+
"expand-after": m((s) => [
|
|
128
|
+
u(e.$slots, "expand-after", c(f(s)))
|
|
129
|
+
]),
|
|
130
|
+
_: 3
|
|
131
|
+
}, 8, ["model-value", "wrapper-ref"])) : K("", !0)
|
|
132
|
+
];
|
|
133
|
+
})
|
|
134
|
+
]),
|
|
135
|
+
_: 2
|
|
136
|
+
}, [
|
|
137
|
+
U(r(E), (a) => ({
|
|
138
|
+
name: a,
|
|
139
|
+
fn: m((l) => [
|
|
140
|
+
u(e.$slots, a, c(f(l)))
|
|
141
|
+
])
|
|
142
|
+
}))
|
|
143
|
+
]), 1040, ["class", "collapsed", "component-bind-event-map", "component-map", "form", "global-common-config"]);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
export {
|
|
148
|
+
_e as default
|
|
149
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { inject as c, provide as s } from "vue";
|
|
2
|
+
function x(t, r) {
|
|
3
|
+
const e = typeof t == "string" && !r ? `${t}Context` : r, i = Symbol(e);
|
|
4
|
+
return [(n) => {
|
|
5
|
+
const o = c(i, n);
|
|
6
|
+
if (o || o === null) return o;
|
|
7
|
+
throw new Error(
|
|
8
|
+
`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t) ? `one of the following components: ${t.join(", ")}` : `\`${t}\``}`
|
|
9
|
+
);
|
|
10
|
+
}, (n) => (s(i, n), n)];
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
x as createContext
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var a = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var l = (t, e, o) => e.has(t) || a("Cannot " + o);
|
|
5
|
+
var r = (t, e, o) => (l(t, e, "read from private field"), o ? o.call(t) : e.get(t)), h = (t, e, o) => e.has(t) ? a("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), p = (t, e, o, s) => (l(t, e, "write to private field"), s ? s.call(t, o) : e.set(t, o), o);
|
|
6
|
+
var n;
|
|
7
|
+
class S {
|
|
8
|
+
constructor() {
|
|
9
|
+
h(this, n, {});
|
|
10
|
+
}
|
|
11
|
+
getComponents() {
|
|
12
|
+
return r(this, n);
|
|
13
|
+
}
|
|
14
|
+
setComponents(e) {
|
|
15
|
+
p(this, n, e);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n = new WeakMap();
|
|
19
|
+
const m = new S();
|
|
20
|
+
export {
|
|
21
|
+
m as globalShareState
|
|
22
|
+
};
|