@dazhicheng/ui 1.5.199 → 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 +3 -1
- package/dist/index-NG5FNCLD.js +0 -3430
- package/dist/index.modern-4Cf3dcJP.js +0 -3069
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { defineComponent as fe, useTemplateRef as K, computed as i, reactive as pe, markRaw as ve, toRaw as he, watch as G, nextTick as be, onUnmounted as ye, createBlock as h, createCommentVNode as m, unref as l, openBlock as u, mergeProps as N, withCtx as b, withDirectives as Ce, createVNode as w, createElementVNode as $, createElementBlock as H, normalizeClass as O, normalizeStyle as J, renderSlot as ge, normalizeProps as we, guardReactiveProps as Fe, resolveDynamicComponent as Re, createSlots as Se, renderList as ke, Transition as Ne, vShow as Oe } from "vue";
|
|
2
|
+
import Ee from "../form/FormControl.vue.js";
|
|
3
|
+
import Be from "../form/FormDescription.vue.js";
|
|
4
|
+
import Pe from "../form/FormItem.vue.js";
|
|
5
|
+
import { isString as y, isFunction as q, clnm as j, isObject as Te } from "@dazhicheng/utils";
|
|
6
|
+
import Ve from "../form/FormMessageToolTip.vue.js";
|
|
7
|
+
import Ie from "../form/FormMessage.vue.js";
|
|
8
|
+
import "@dazhicheng-ui/assets/img/FormItemWarning.jpeg?inline";
|
|
9
|
+
import "@dazhicheng-ui/components/tt-icon";
|
|
10
|
+
import "@vueuse/core";
|
|
11
|
+
import "element-plus";
|
|
12
|
+
import { useFormValues as Le, useFieldError as $e, Field as qe } from "vee-validate";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import E from "../form/RenderContent.vue.js";
|
|
15
|
+
import { set as je, get as Me } from "lodash-es";
|
|
16
|
+
import { toTypedSchema as Ue } from "@vee-validate/zod";
|
|
17
|
+
import { injectComponentRefMap as De } from "../useFormContext.js";
|
|
18
|
+
import { useFormContext as We, injectRenderFormProps as ze } from "./context.js";
|
|
19
|
+
import xe from "./dependencies.js";
|
|
20
|
+
import Ae from "./FormLabel.vue2.js";
|
|
21
|
+
import { useSelectCollapseOptions as Ke } from "../hooks/useSelectCollapse.js";
|
|
22
|
+
import { isEventObjectLike as Q } from "./helper.js";
|
|
23
|
+
const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "ml-1"
|
|
26
|
+
}, bn = /* @__PURE__ */ fe({
|
|
27
|
+
__name: "FormField",
|
|
28
|
+
props: {
|
|
29
|
+
component: {},
|
|
30
|
+
componentProps: { type: [Function, Object] },
|
|
31
|
+
defaultValue: {},
|
|
32
|
+
dependencies: {},
|
|
33
|
+
description: { type: [Function, String] },
|
|
34
|
+
fieldName: {},
|
|
35
|
+
help: { type: [Function, String] },
|
|
36
|
+
hide: { type: Boolean },
|
|
37
|
+
label: { type: [Function, String] },
|
|
38
|
+
renderComponentContent: { type: Function },
|
|
39
|
+
rules: {},
|
|
40
|
+
suffix: { type: [Function, String] },
|
|
41
|
+
helpTrigger: {},
|
|
42
|
+
toolTip: {},
|
|
43
|
+
toolTipText: { type: [Function, String] },
|
|
44
|
+
useArraySchema: { type: Boolean },
|
|
45
|
+
arraySchema: { type: [Array, Function] },
|
|
46
|
+
colon: { type: Boolean },
|
|
47
|
+
controlClass: {},
|
|
48
|
+
disabled: { type: Boolean },
|
|
49
|
+
disabledOnChangeListener: { type: Boolean },
|
|
50
|
+
disabledOnInputListener: { type: Boolean },
|
|
51
|
+
emptyStateValue: {},
|
|
52
|
+
formFieldProps: {},
|
|
53
|
+
formItemClass: { type: [Function, String] },
|
|
54
|
+
hideLabel: { type: Boolean },
|
|
55
|
+
hideRequiredMark: { type: Boolean },
|
|
56
|
+
labelClass: {},
|
|
57
|
+
labelWidth: {},
|
|
58
|
+
modelPropName: {},
|
|
59
|
+
wrapperClass: {},
|
|
60
|
+
commonComponentProps: {}
|
|
61
|
+
},
|
|
62
|
+
setup(n) {
|
|
63
|
+
const B = K("wrapperRef"), { componentBindEventMap: X, componentMap: Y, isVertical: C } = We(), M = ze(), k = Le(), Z = $e(n.fieldName), f = K("fieldComponentRef"), F = M.form, R = i(() => M.compact), S = i(() => {
|
|
64
|
+
var e;
|
|
65
|
+
return ((e = Z.value) == null ? void 0 : e.length) > 0;
|
|
66
|
+
}), P = pe(
|
|
67
|
+
new Proxy({}, {
|
|
68
|
+
/**
|
|
69
|
+
* @param _target 代理目标(空对象,不实际存储)
|
|
70
|
+
* @param key 属性名
|
|
71
|
+
* @returns 当前表单值
|
|
72
|
+
*/
|
|
73
|
+
get(e, t) {
|
|
74
|
+
return Me(k.value, t);
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* @param _target 代理目标
|
|
78
|
+
* @param key 属性名
|
|
79
|
+
* @param value 新值
|
|
80
|
+
* @returns 是否设置成功
|
|
81
|
+
*/
|
|
82
|
+
set(e, t, o) {
|
|
83
|
+
return je(k.value, t, o), F == null || F.validateField(t), !0;
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
), _ = i(() => {
|
|
87
|
+
const e = y(n.component) ? Y.value[n.component] : n.component;
|
|
88
|
+
return ve(he(e));
|
|
89
|
+
}), { dynamicComponentProps: ee, dynamicRules: ne, isDisabled: te, isIf: U, isRequired: T, isShow: D } = xe(
|
|
90
|
+
() => n.dependencies
|
|
91
|
+
), oe = i(() => {
|
|
92
|
+
var e;
|
|
93
|
+
return (e = n.labelClass) != null && e.includes("w-") || C.value ? {} : {
|
|
94
|
+
width: `${n.labelWidth}px`
|
|
95
|
+
};
|
|
96
|
+
}), s = i(() => ne.value || n.rules), W = i(() => !n.hide && U.value && D.value), V = i(() => {
|
|
97
|
+
var o, a, d;
|
|
98
|
+
if (!W.value)
|
|
99
|
+
return !1;
|
|
100
|
+
if (!s.value)
|
|
101
|
+
return T.value;
|
|
102
|
+
if (T.value)
|
|
103
|
+
return !0;
|
|
104
|
+
if (y(s.value))
|
|
105
|
+
return ["required", "selectRequired"].includes(s.value);
|
|
106
|
+
let e = (a = (o = s == null ? void 0 : s.value) == null ? void 0 : o.isOptional) == null ? void 0 : a.call(o);
|
|
107
|
+
const t = s.value.def;
|
|
108
|
+
if ((t == null ? void 0 : t.type) === "default" && "innerType" in t) {
|
|
109
|
+
const v = t.innerType;
|
|
110
|
+
v && (e = (d = v.isOptional) == null ? void 0 : d.call(v));
|
|
111
|
+
}
|
|
112
|
+
return !e;
|
|
113
|
+
}), le = i(() => {
|
|
114
|
+
var o;
|
|
115
|
+
if (!W.value)
|
|
116
|
+
return null;
|
|
117
|
+
let e = s.value;
|
|
118
|
+
if (!e)
|
|
119
|
+
return T.value ? "required" : null;
|
|
120
|
+
if (y(e))
|
|
121
|
+
return e;
|
|
122
|
+
if (!!V.value) {
|
|
123
|
+
const a = (o = e == null ? void 0 : e.unwrap) == null ? void 0 : o.call(e);
|
|
124
|
+
a && (e = a);
|
|
125
|
+
}
|
|
126
|
+
return Ue(e);
|
|
127
|
+
}), r = i(() => {
|
|
128
|
+
const e = q(n.componentProps) ? n.componentProps(k.value, F) : n.componentProps;
|
|
129
|
+
return {
|
|
130
|
+
...n.commonComponentProps,
|
|
131
|
+
...e,
|
|
132
|
+
...ee.value
|
|
133
|
+
};
|
|
134
|
+
}), { selectComponentProps: ae } = Ke(
|
|
135
|
+
i(() => ({
|
|
136
|
+
componentProps: r,
|
|
137
|
+
component: n.component,
|
|
138
|
+
selectWrapRef: B,
|
|
139
|
+
selectRef: f
|
|
140
|
+
}))
|
|
141
|
+
);
|
|
142
|
+
G(
|
|
143
|
+
() => {
|
|
144
|
+
var e;
|
|
145
|
+
return (e = r.value) == null ? void 0 : e.autofocus;
|
|
146
|
+
},
|
|
147
|
+
(e) => {
|
|
148
|
+
e === !0 && be(() => {
|
|
149
|
+
ce();
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
{ immediate: !0 }
|
|
153
|
+
);
|
|
154
|
+
const I = i(() => {
|
|
155
|
+
var e;
|
|
156
|
+
return te.value || n.disabled || ((e = r.value) == null ? void 0 : e.disabled);
|
|
157
|
+
}), z = i(() => q(n.renderComponentContent) ? n.renderComponentContent(k.value, F) : {}), ie = i(() => Object.keys(z.value)), re = i(() => {
|
|
158
|
+
const e = le.value;
|
|
159
|
+
return {
|
|
160
|
+
keepValue: !0,
|
|
161
|
+
label: y(n.label) ? n.label : "",
|
|
162
|
+
...e ? { rules: e } : {},
|
|
163
|
+
...n.formFieldProps
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
function ue(e) {
|
|
167
|
+
var v;
|
|
168
|
+
const t = e.componentField.modelValue, o = e.componentField["onUpdate:modelValue"], a = n.modelPropName || (y(n.component) ? (v = X.value) == null ? void 0 : v[n.component] : null);
|
|
169
|
+
let d = t;
|
|
170
|
+
if (t && Te(t) && a) {
|
|
171
|
+
const c = t.target;
|
|
172
|
+
d = Q(t) ? c == null ? void 0 : c[a] : (t == null ? void 0 : t[a]) ?? t;
|
|
173
|
+
}
|
|
174
|
+
return a ? {
|
|
175
|
+
[`onUpdate:${a}`]: o,
|
|
176
|
+
[a]: d === void 0 ? n.emptyStateValue : d,
|
|
177
|
+
onChange: n.disabledOnChangeListener ? void 0 : (c) => {
|
|
178
|
+
var A;
|
|
179
|
+
const me = Q(c), g = (A = e == null ? void 0 : e.componentField) == null ? void 0 : A.onChange;
|
|
180
|
+
if (!me)
|
|
181
|
+
return g == null ? void 0 : g(c);
|
|
182
|
+
const L = c.target;
|
|
183
|
+
return g == null ? void 0 : g((L == null ? void 0 : L[a]) ?? c);
|
|
184
|
+
},
|
|
185
|
+
...n.disabledOnInputListener ? { onInput: void 0 } : {}
|
|
186
|
+
} : {
|
|
187
|
+
...n.disabledOnInputListener ? { onInput: void 0 } : {},
|
|
188
|
+
...n.disabledOnChangeListener ? { onChange: void 0 } : {}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const se = /* @__PURE__ */ new Set(["ElCheckbox", "ElCheckboxButton", "ElSwitch"]), de = /* @__PURE__ */ new Set(["ElInputNumber"]);
|
|
192
|
+
function x(e) {
|
|
193
|
+
const t = ue(e), o = {
|
|
194
|
+
...e.componentField,
|
|
195
|
+
...r.value,
|
|
196
|
+
...ae.value,
|
|
197
|
+
...t,
|
|
198
|
+
...Reflect.has(r.value, "onChange") ? { onChange: r.value.onChange } : {},
|
|
199
|
+
...Reflect.has(r.value, "onInput") ? { onInput: r.value.onInput } : {}
|
|
200
|
+
};
|
|
201
|
+
return Reflect.has(r.value, "name") || delete o.name, y(n.component) && se.has(n.component) && o.modelValue === void 0 && (o.modelValue = !1), y(n.component) && de.has(n.component) && (o.controls = !1, o.align = "left"), o;
|
|
202
|
+
}
|
|
203
|
+
function ce() {
|
|
204
|
+
var e, t;
|
|
205
|
+
f.value && q(f.value.focus) && // 检查当前是否有元素被聚焦
|
|
206
|
+
document.activeElement !== f.value && ((t = (e = f.value) == null ? void 0 : e.focus) == null || t.call(e));
|
|
207
|
+
}
|
|
208
|
+
const p = De();
|
|
209
|
+
return G(f, (e) => {
|
|
210
|
+
p == null || p.set(n.fieldName, e);
|
|
211
|
+
}), ye(() => {
|
|
212
|
+
p != null && p.has(n.fieldName) && p.delete(n.fieldName);
|
|
213
|
+
}), (e, t) => !e.hide && l(U) ? (u(), h(l(qe), N({ key: 0 }, re.value, { name: e.fieldName }), {
|
|
214
|
+
default: b((o) => [
|
|
215
|
+
Ce(w(l(Pe), N({
|
|
216
|
+
class: [{
|
|
217
|
+
"form-valid-error": S.value,
|
|
218
|
+
"form-is-required": V.value,
|
|
219
|
+
"pb-(--form-valid-error-nocompact-padding-bottom)": !R.value,
|
|
220
|
+
"pb-2": R.value
|
|
221
|
+
}, "relative"]
|
|
222
|
+
}, e.$attrs), {
|
|
223
|
+
default: b(() => [
|
|
224
|
+
$("div", {
|
|
225
|
+
class: O([{ "flex-col": l(C), "flex-row items-center": !l(C) }, "flex"])
|
|
226
|
+
}, [
|
|
227
|
+
e.hideLabel ? m("", !0) : (u(), h(Ae, {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: O(
|
|
230
|
+
l(j)(
|
|
231
|
+
"flex leading-6",
|
|
232
|
+
{
|
|
233
|
+
"mr-2 shrink-0 items-center justify-end": !l(C),
|
|
234
|
+
"mb-1 flex-row": l(C)
|
|
235
|
+
},
|
|
236
|
+
e.labelClass
|
|
237
|
+
)
|
|
238
|
+
),
|
|
239
|
+
help: e.help,
|
|
240
|
+
colon: e.colon,
|
|
241
|
+
label: e.label,
|
|
242
|
+
required: V.value && !e.hideRequiredMark,
|
|
243
|
+
style: J(oe.value),
|
|
244
|
+
"tool-tip": e.toolTip,
|
|
245
|
+
"help-trigger": e.helpTrigger,
|
|
246
|
+
form: P,
|
|
247
|
+
"tool-tip-text": e.toolTipText
|
|
248
|
+
}, {
|
|
249
|
+
default: b(() => [
|
|
250
|
+
e.label ? (u(), h(l(E), {
|
|
251
|
+
key: 0,
|
|
252
|
+
content: e.label
|
|
253
|
+
}, null, 8, ["content"])) : m("", !0)
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 8, ["class", "help", "colon", "label", "required", "style", "tool-tip", "help-trigger", "form", "tool-tip-text"])),
|
|
257
|
+
$("div", Ge, [
|
|
258
|
+
$("div", {
|
|
259
|
+
ref_key: "wrapperRef",
|
|
260
|
+
ref: B,
|
|
261
|
+
class: O(l(j)("relative flex w-full items-center", e.wrapperClass))
|
|
262
|
+
}, [
|
|
263
|
+
w(l(Ee), {
|
|
264
|
+
class: O(l(j)(e.controlClass))
|
|
265
|
+
}, {
|
|
266
|
+
default: b(() => [
|
|
267
|
+
ge(e.$slots, "default", we(Fe({
|
|
268
|
+
...o,
|
|
269
|
+
...x(o),
|
|
270
|
+
disabled: I.value,
|
|
271
|
+
isInValid: S.value,
|
|
272
|
+
form: P,
|
|
273
|
+
fieldName: e.fieldName
|
|
274
|
+
})), () => [
|
|
275
|
+
(u(), h(Re(_.value), N({
|
|
276
|
+
ref_key: "fieldComponentRef",
|
|
277
|
+
ref: f,
|
|
278
|
+
class: {
|
|
279
|
+
"border-destructive hover:border-destructive/80 focus:border-destructive focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]": S.value
|
|
280
|
+
}
|
|
281
|
+
}, {
|
|
282
|
+
...x(o),
|
|
283
|
+
disabled: I.value,
|
|
284
|
+
isInValid: S.value,
|
|
285
|
+
form: P,
|
|
286
|
+
fieldName: e.fieldName
|
|
287
|
+
}, { disabled: I.value }), Se({ _: 2 }, [
|
|
288
|
+
ke(ie.value, (a) => ({
|
|
289
|
+
name: a,
|
|
290
|
+
fn: b((d) => [
|
|
291
|
+
w(l(E), N({
|
|
292
|
+
content: z.value[a]
|
|
293
|
+
}, { ...d, formContext: o }), null, 16, ["content"])
|
|
294
|
+
])
|
|
295
|
+
}))
|
|
296
|
+
]), 1040, ["class", "disabled"]))
|
|
297
|
+
])
|
|
298
|
+
]),
|
|
299
|
+
_: 2
|
|
300
|
+
}, 1032, ["class"]),
|
|
301
|
+
e.suffix ? (u(), H("div", He, [
|
|
302
|
+
w(l(E), { content: e.suffix }, null, 8, ["content"])
|
|
303
|
+
])) : m("", !0),
|
|
304
|
+
R.value && S.value ? (u(), h(l(Ve), {
|
|
305
|
+
key: 1,
|
|
306
|
+
"ref-dom": B.value
|
|
307
|
+
}, null, 8, ["ref-dom"])) : m("", !0)
|
|
308
|
+
], 2)
|
|
309
|
+
])
|
|
310
|
+
], 2),
|
|
311
|
+
e.description || !R.value ? (u(), H("div", {
|
|
312
|
+
key: 0,
|
|
313
|
+
style: J(!l(C) && !e.hideLabel ? { paddingLeft: `${(e.labelWidth || 0) + 8}px` } : {})
|
|
314
|
+
}, [
|
|
315
|
+
e.description ? (u(), h(l(Be), {
|
|
316
|
+
key: 0,
|
|
317
|
+
class: "text-[12px]"
|
|
318
|
+
}, {
|
|
319
|
+
default: b(() => [
|
|
320
|
+
w(l(E), { content: e.description }, null, 8, ["content"])
|
|
321
|
+
]),
|
|
322
|
+
_: 1
|
|
323
|
+
})) : m("", !0),
|
|
324
|
+
R.value ? m("", !0) : (u(), h(Ne, {
|
|
325
|
+
key: 1,
|
|
326
|
+
name: "slide-up"
|
|
327
|
+
}, {
|
|
328
|
+
default: b(() => [
|
|
329
|
+
w(l(Ie), { class: "absolute" })
|
|
330
|
+
]),
|
|
331
|
+
_: 1
|
|
332
|
+
}))
|
|
333
|
+
], 4)) : m("", !0)
|
|
334
|
+
]),
|
|
335
|
+
_: 2
|
|
336
|
+
}, 1040, ["class"]), [
|
|
337
|
+
[Oe, l(D)]
|
|
338
|
+
])
|
|
339
|
+
]),
|
|
340
|
+
_: 3
|
|
341
|
+
}, 16, ["name"])) : m("", !0);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
export {
|
|
345
|
+
bn as default
|
|
346
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as a, h as l } from "vue";
|
|
2
|
+
import i from "../group-form/LazyFormField.vue.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { FormArrayRegister as m } from "./array-register/FormArrayRegister.js";
|
|
5
|
+
import o from "./FormField.vue2.js";
|
|
6
|
+
const c = a({
|
|
7
|
+
name: "FieldRenderer",
|
|
8
|
+
props: {
|
|
9
|
+
fieldConfig: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
rules: { type: [String, Object], default: void 0 },
|
|
14
|
+
virtual: { type: Boolean, default: !1 },
|
|
15
|
+
scrollElement: { type: Object, default: null },
|
|
16
|
+
rootMargin: { type: String, default: "200px 0px" },
|
|
17
|
+
estimateFieldHeight: { type: Number, default: 52 }
|
|
18
|
+
},
|
|
19
|
+
setup(r, { slots: t }) {
|
|
20
|
+
return () => {
|
|
21
|
+
const e = {
|
|
22
|
+
commonComponentProps: {},
|
|
23
|
+
...r.fieldConfig
|
|
24
|
+
};
|
|
25
|
+
return e.useArraySchema ? l(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
...e,
|
|
29
|
+
rules: r.rules,
|
|
30
|
+
virtual: r.virtual,
|
|
31
|
+
arraySchema: e.arraySchema,
|
|
32
|
+
fieldName: e.fieldName,
|
|
33
|
+
formItemClass: e.formItemClass,
|
|
34
|
+
wrapperClass: e.wrapperClass
|
|
35
|
+
},
|
|
36
|
+
t
|
|
37
|
+
) : r.virtual ? l(
|
|
38
|
+
i,
|
|
39
|
+
{
|
|
40
|
+
fieldProps: e,
|
|
41
|
+
rules: r.rules,
|
|
42
|
+
fieldClass: e.formItemClass,
|
|
43
|
+
scrollElement: r.scrollElement,
|
|
44
|
+
rootMargin: r.rootMargin,
|
|
45
|
+
estimateFieldHeight: r.estimateFieldHeight
|
|
46
|
+
},
|
|
47
|
+
t
|
|
48
|
+
) : l(o, { ...e, class: e.formItemClass, rules: r.rules }, t);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
c as FieldRenderer
|
|
54
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent as h, createBlock as l, openBlock as t, unref as o, normalizeClass as g, withCtx as r, createElementBlock as s, createCommentVNode as i, Fragment as m, createElementVNode as u, toDisplayString as f, createVNode as a, normalizeProps as b, mergeProps as k, createTextVNode as y } from "vue";
|
|
2
|
+
import _ from "@dazhicheng-ui/assets/svg/help.svg?raw";
|
|
3
|
+
import { TtIcon as v } from "@dazhicheng-ui/components/tt-icon";
|
|
4
|
+
import { TtText as x } from "@dazhicheng-ui/components/tt-text";
|
|
5
|
+
import { isObject as B, isFunction as C, clnm as V } from "@dazhicheng/utils";
|
|
6
|
+
import { ElTooltip as d } from "element-plus";
|
|
7
|
+
import "../components/Slot.js";
|
|
8
|
+
import "vee-validate";
|
|
9
|
+
import z from "../form/FormLabel.vue.js";
|
|
10
|
+
import "@dazhicheng-ui/components/tt-form-item-error-tooltip";
|
|
11
|
+
import "@dazhicheng-ui/assets/img/FormItemWarning.jpeg?inline";
|
|
12
|
+
import "@vueuse/core";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import p from "../form/RenderContent.vue.js";
|
|
15
|
+
const N = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "mr-[2px] text-destructive color-var(--el-color-error)"
|
|
18
|
+
}, E = { class: "flex items-center" }, F = { key: 0 }, q = { class: "flex items-center" }, L = {
|
|
19
|
+
key: 3,
|
|
20
|
+
class: "ml-[2px]"
|
|
21
|
+
}, R = /* @__PURE__ */ h({
|
|
22
|
+
__name: "FormLabel",
|
|
23
|
+
props: {
|
|
24
|
+
class: {},
|
|
25
|
+
colon: { type: Boolean },
|
|
26
|
+
help: {},
|
|
27
|
+
label: {},
|
|
28
|
+
required: { type: Boolean },
|
|
29
|
+
helpTrigger: { default: "hover" },
|
|
30
|
+
toolTip: { default: () => ({
|
|
31
|
+
toolTipLine: 3
|
|
32
|
+
}) },
|
|
33
|
+
toolTipText: {}
|
|
34
|
+
},
|
|
35
|
+
setup(T) {
|
|
36
|
+
const n = T, c = (B(n.label) || C(n.label)) && n.label !== null;
|
|
37
|
+
return (e, P) => (t(), l(o(z), {
|
|
38
|
+
class: g(o(V)("flex items-center text-var(--el-font-size-base)", n.class))
|
|
39
|
+
}, {
|
|
40
|
+
default: r(() => [
|
|
41
|
+
e.required ? (t(), s("span", N, "*")) : i("", !0),
|
|
42
|
+
e.label ? (t(), s(m, { key: 1 }, [
|
|
43
|
+
e.toolTipText ? (t(), l(o(d), {
|
|
44
|
+
key: 0,
|
|
45
|
+
"popper-class": "mx-1",
|
|
46
|
+
placement: "top",
|
|
47
|
+
trigger: "hover"
|
|
48
|
+
}, {
|
|
49
|
+
content: r(() => [
|
|
50
|
+
a(o(p), { content: e.toolTipText }, null, 8, ["content"])
|
|
51
|
+
]),
|
|
52
|
+
default: r(() => [
|
|
53
|
+
u("div", E, [
|
|
54
|
+
o(c) ? (t(), l(o(p), {
|
|
55
|
+
key: 1,
|
|
56
|
+
content: e.label
|
|
57
|
+
}, null, 8, ["content"])) : (t(), s("div", F, f(e.label), 1))
|
|
58
|
+
])
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})) : (t(), s(m, { key: 1 }, [
|
|
62
|
+
o(c) ? (t(), l(o(p), {
|
|
63
|
+
key: 1,
|
|
64
|
+
content: e.label
|
|
65
|
+
}, null, 8, ["content"])) : (t(), l(o(x), b(k({ key: 0 }, n.toolTip)), {
|
|
66
|
+
default: r(() => [
|
|
67
|
+
y(f(e.label), 1)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}, 16))
|
|
71
|
+
], 64))
|
|
72
|
+
], 64)) : i("", !0),
|
|
73
|
+
e.help ? (t(), l(o(d), {
|
|
74
|
+
key: 2,
|
|
75
|
+
"popper-class": "mx-1",
|
|
76
|
+
placement: "top",
|
|
77
|
+
trigger: e.helpTrigger
|
|
78
|
+
}, {
|
|
79
|
+
content: r(() => [
|
|
80
|
+
a(o(p), { content: e.help }, null, 8, ["content"])
|
|
81
|
+
]),
|
|
82
|
+
default: r(() => [
|
|
83
|
+
u("div", q, [
|
|
84
|
+
a(o(v), {
|
|
85
|
+
class: "ml-[4px] cursor-pointer",
|
|
86
|
+
size: 14,
|
|
87
|
+
"is-custom-svg": "",
|
|
88
|
+
icon: o(_)
|
|
89
|
+
}, null, 8, ["icon"])
|
|
90
|
+
])
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["trigger"])) : i("", !0),
|
|
94
|
+
e.colon && e.label ? (t(), s("span", L, ":")) : i("", !0)
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
}, 8, ["class"]));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
R as default
|
|
102
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { defineComponent as M, computed as h, unref as C, reactive as T, onMounted as Y, onUnmounted as z, createVNode as N, toValue as b, Fragment as B, mergeProps as G, isVNode as U } from "vue";
|
|
2
|
+
import { clnm as W } from "@dazhicheng/utils";
|
|
3
|
+
import { set as q, get as J, omit as Q } from "lodash-es";
|
|
4
|
+
import { useFormValues as X } from "vee-validate";
|
|
5
|
+
import { useArrayRegistry as Z } from "../../hooks/useArrayRegistry.js";
|
|
6
|
+
import { useFieldArray as ee } from "../../hooks/useFieldArray.js";
|
|
7
|
+
import { injectFormProps as re, resolveArraySchemasForRuntime as ae, createArraySchemaContext as te } from "../../useFormContext.js";
|
|
8
|
+
import { normalizeArrayFieldPath as I } from "../../utils/array-path.js";
|
|
9
|
+
import { injectRenderFormProps as ne } from "../context.js";
|
|
10
|
+
import le from "../dependencies.js";
|
|
11
|
+
import { FieldRenderer as ie } from "../FormFieldContact.js";
|
|
12
|
+
import { formArrayRegisterProps as oe } from "./props.js";
|
|
13
|
+
import { getMergedDisabled as de, resolveArrayItemState as x } from "./utils.js";
|
|
14
|
+
function me(r) {
|
|
15
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !U(r);
|
|
16
|
+
}
|
|
17
|
+
const ue = ["fieldName", "arraySchema", "useArraySchema", "useFieldArray", "rules", "formItemClass", "wrapperClass", "defaultValue", "hide", "disabled", "dependencies"], se = /* @__PURE__ */ M({
|
|
18
|
+
name: "FormArrayRegister",
|
|
19
|
+
props: oe,
|
|
20
|
+
setup(r, {
|
|
21
|
+
slots: i,
|
|
22
|
+
attrs: D
|
|
23
|
+
}) {
|
|
24
|
+
const o = ee(() => r.fieldName), [O, _] = Z(r.fieldName, r), y = X(), p = ne().form, [j] = re(), $ = h(() => {
|
|
25
|
+
var e;
|
|
26
|
+
return (e = C(j)) == null ? void 0 : e.formApi;
|
|
27
|
+
}), v = h(() => {
|
|
28
|
+
var e;
|
|
29
|
+
return (e = $.value) == null ? void 0 : e.arrayAction;
|
|
30
|
+
}), A = T(new Proxy(y.value, {
|
|
31
|
+
get(e, a) {
|
|
32
|
+
return J(y.value, a);
|
|
33
|
+
},
|
|
34
|
+
set(e, a, t) {
|
|
35
|
+
return q(y.value, a, t), p == null || p.validateField(String(a)), !0;
|
|
36
|
+
},
|
|
37
|
+
ownKeys() {
|
|
38
|
+
return Reflect.ownKeys(y.value);
|
|
39
|
+
},
|
|
40
|
+
getOwnPropertyDescriptor(e, a) {
|
|
41
|
+
return Object.getOwnPropertyDescriptor(y.value, a);
|
|
42
|
+
}
|
|
43
|
+
})), {
|
|
44
|
+
dynamicRules: F,
|
|
45
|
+
isDisabled: R,
|
|
46
|
+
isIf: H,
|
|
47
|
+
isShow: L
|
|
48
|
+
} = le(() => r.dependencies), w = h(() => Q(D, ue)), g = h(() => I(r.fieldName)), P = h(() => {
|
|
49
|
+
var e;
|
|
50
|
+
return (e = v.value) == null ? void 0 : e.at(g.value);
|
|
51
|
+
});
|
|
52
|
+
Y(() => {
|
|
53
|
+
O(o);
|
|
54
|
+
}), z(_);
|
|
55
|
+
function V(e) {
|
|
56
|
+
var n;
|
|
57
|
+
const {
|
|
58
|
+
entry: a,
|
|
59
|
+
index: t,
|
|
60
|
+
itemFieldName: s,
|
|
61
|
+
parentItemPath: d
|
|
62
|
+
} = e;
|
|
63
|
+
return te({
|
|
64
|
+
arrayPath: g.value,
|
|
65
|
+
itemPath: I(s),
|
|
66
|
+
index: t,
|
|
67
|
+
row: a.value,
|
|
68
|
+
arrayLength: ((n = b(o.fields)) == null ? void 0 : n.length) ?? 0,
|
|
69
|
+
parentItemPath: d,
|
|
70
|
+
form: A,
|
|
71
|
+
arrayAction: v.value,
|
|
72
|
+
arrayHandle: P.value
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function k(e, a) {
|
|
76
|
+
const {
|
|
77
|
+
entry: t,
|
|
78
|
+
index: s,
|
|
79
|
+
itemFieldName: d,
|
|
80
|
+
parentItemPath: n
|
|
81
|
+
} = a, m = `${d}.${e.fieldName}`;
|
|
82
|
+
if (e.useArraySchema) {
|
|
83
|
+
const l = x(e, {
|
|
84
|
+
dynamicRules: F.value,
|
|
85
|
+
dynamicDisabled: R.value,
|
|
86
|
+
props: r
|
|
87
|
+
}), u = {
|
|
88
|
+
...w.value,
|
|
89
|
+
...e,
|
|
90
|
+
fieldName: m,
|
|
91
|
+
rules: l.rules,
|
|
92
|
+
disabled: l.disabled,
|
|
93
|
+
formItemClass: l.formItemClass,
|
|
94
|
+
virtual: r.virtual,
|
|
95
|
+
arraySchema: e.arraySchema
|
|
96
|
+
};
|
|
97
|
+
return N(se, G({
|
|
98
|
+
key: m
|
|
99
|
+
}, u), me(i) ? i : {
|
|
100
|
+
default: () => [i]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const c = x(e, {
|
|
104
|
+
dynamicRules: F.value,
|
|
105
|
+
dynamicDisabled: R.value,
|
|
106
|
+
props: r
|
|
107
|
+
}), S = {
|
|
108
|
+
...w.value,
|
|
109
|
+
...e,
|
|
110
|
+
fieldName: m,
|
|
111
|
+
rules: c.rules,
|
|
112
|
+
disabled: c.disabled,
|
|
113
|
+
formItemClass: c.formItemClass
|
|
114
|
+
};
|
|
115
|
+
return N(ie, {
|
|
116
|
+
key: `${t.key}-${m}`,
|
|
117
|
+
fieldConfig: S,
|
|
118
|
+
rules: S.rules,
|
|
119
|
+
virtual: r.virtual
|
|
120
|
+
}, {
|
|
121
|
+
default: (l) => {
|
|
122
|
+
var u, f;
|
|
123
|
+
return (f = i[e.fieldName]) == null ? void 0 : f.call(i, {
|
|
124
|
+
...l,
|
|
125
|
+
action: o,
|
|
126
|
+
entry: t,
|
|
127
|
+
index: s,
|
|
128
|
+
fieldName: d,
|
|
129
|
+
form: A,
|
|
130
|
+
arrayPath: g.value,
|
|
131
|
+
arrayHandle: P.value,
|
|
132
|
+
arrayAction: v.value,
|
|
133
|
+
parentItemPath: n,
|
|
134
|
+
arrayLength: ((u = b(o.fields)) == null ? void 0 : u.length) ?? 0
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function E(e, a) {
|
|
140
|
+
var u;
|
|
141
|
+
const t = `${r.fieldName}[${a}]`, s = i[r.fieldName], d = r.fieldName.lastIndexOf("."), n = d !== -1 ? r.fieldName.slice(0, d) : void 0;
|
|
142
|
+
if (s) {
|
|
143
|
+
const f = de(R.value, void 0, r.disabled);
|
|
144
|
+
return s({
|
|
145
|
+
action: o,
|
|
146
|
+
entry: e,
|
|
147
|
+
index: a,
|
|
148
|
+
fieldName: t,
|
|
149
|
+
disabled: f,
|
|
150
|
+
form: A,
|
|
151
|
+
arrayPath: g.value,
|
|
152
|
+
arrayHandle: P.value,
|
|
153
|
+
arrayAction: v.value,
|
|
154
|
+
parentItemPath: n,
|
|
155
|
+
arrayLength: ((u = b(o.fields)) == null ? void 0 : u.length) ?? 0
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const m = {
|
|
159
|
+
entry: e,
|
|
160
|
+
index: a,
|
|
161
|
+
itemFieldName: t,
|
|
162
|
+
parentItemPath: n
|
|
163
|
+
}, c = V(m), l = ae({
|
|
164
|
+
item: r,
|
|
165
|
+
arrayPath: g.value,
|
|
166
|
+
itemPath: c.itemPath,
|
|
167
|
+
index: a,
|
|
168
|
+
row: e.value,
|
|
169
|
+
arrayLength: c.arrayLength,
|
|
170
|
+
parentItemPath: n,
|
|
171
|
+
form: A,
|
|
172
|
+
arrayAction: v.value,
|
|
173
|
+
arrayHandle: P.value
|
|
174
|
+
}).map((f) => k(f, m));
|
|
175
|
+
return l.length ? N(B, {
|
|
176
|
+
key: e.key
|
|
177
|
+
}, [l]) : null;
|
|
178
|
+
}
|
|
179
|
+
function K(e) {
|
|
180
|
+
return e.some(Boolean) ? r.wrapperClass : void 0;
|
|
181
|
+
}
|
|
182
|
+
return () => {
|
|
183
|
+
if (r.hide || !H.value) return null;
|
|
184
|
+
const a = (C(o.fields) ?? []).map(E);
|
|
185
|
+
return N("div", {
|
|
186
|
+
class: W("grid col-span-full", {
|
|
187
|
+
hidden: !L.value
|
|
188
|
+
}, K(a))
|
|
189
|
+
}, [a]);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
export {
|
|
194
|
+
se as FormArrayRegister
|
|
195
|
+
};
|