@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,315 @@
|
|
|
1
|
+
import { defineComponent as Ne, useAttrs as Re, ref as g, useSlots as Ae, computed as r, unref as l, watch as Be, createElementBlock as ae, openBlock as x, mergeProps as h, createBlock as We, createCommentVNode as Ke, resolveDynamicComponent as ze, createSlots as I, withCtx as c, renderSlot as p, normalizeProps as P, guardReactiveProps as y, createElementVNode as He, normalizeClass as ne, toDisplayString as _e, renderList as O, createVNode as u, toHandlers as re, withModifiers as Ge, withDirectives as Ue, resolveComponent as qe, toValue as Je, isRef as Qe, isReactive as Xe } from "vue";
|
|
2
|
+
import Ye from "./components/Table.vue.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { useDesign as Ze } from "@dazhicheng/hooks";
|
|
5
|
+
import { useLoading as et } from "@dazhicheng-ui/hooks/useLoading";
|
|
6
|
+
import { isArray as ie, isObject as tt, isEmpty as ot } from "@dazhicheng/utils";
|
|
7
|
+
import { CopyDocument as lt } from "@element-plus/icons-vue";
|
|
8
|
+
import { ElIcon as st, ElSelect as at } from "element-plus";
|
|
9
|
+
import nt from "@dazhicheng-ui/directives/disabled-tip";
|
|
10
|
+
import { useTableSlot as rt } from "@dazhicheng-ui/hooks/useTable";
|
|
11
|
+
import { useResizeObserver as it } from "@vueuse/core";
|
|
12
|
+
import { omit as ct, pick as dt, cloneDeep as j, isEqual as pt } from "lodash-es";
|
|
13
|
+
import ut from "./components/SelectTable.vue.js";
|
|
14
|
+
/* empty css */
|
|
15
|
+
import { useDataSource as ft } from "./hooks/useDataSource.js";
|
|
16
|
+
import { usePagination as mt } from "./hooks/usePagination.js";
|
|
17
|
+
import { useSelect as gt } from "./hooks/useSelect.js";
|
|
18
|
+
import { useSelectTableEvent as vt } from "./hooks/useSelectTableEvent.js";
|
|
19
|
+
import { selectProps as bt, configDefault as ht } from "./props.js";
|
|
20
|
+
const Pt = ["title"], At = /* @__PURE__ */ Ne({
|
|
21
|
+
name: "TtSelect",
|
|
22
|
+
inheritAttrs: !1,
|
|
23
|
+
__name: "Select",
|
|
24
|
+
props: bt,
|
|
25
|
+
emits: ["update:modelValue", "change", "fetch-success", "fetch-error", "select-change", "visible-change", "scroll", "scroll-boundary", "blur", "focus", "clear", "remove-tag"],
|
|
26
|
+
setup(ce, {
|
|
27
|
+
expose: de,
|
|
28
|
+
emit: pe
|
|
29
|
+
}) {
|
|
30
|
+
var X, Y, Z, ee;
|
|
31
|
+
const t = ce, f = pe, S = Re(), m = g(null), v = g(), i = g((X = t.selectProps) != null && X.multiple ? [] : void 0), a = g(void 0), C = g(!1), {
|
|
32
|
+
prefixCls: w
|
|
33
|
+
} = Ze("select-v2"), ue = Ae(), {
|
|
34
|
+
getTableSlotKeys: M,
|
|
35
|
+
replaceTableSlotKey: N
|
|
36
|
+
} = rt(ue), {
|
|
37
|
+
getLoading: V,
|
|
38
|
+
setLoading: fe
|
|
39
|
+
} = et(r(() => t.loading || !1)), R = r(() => {
|
|
40
|
+
var e;
|
|
41
|
+
return (((e = t.gridProps) == null ? void 0 : e.columns) || []).map((o) => o.field || "");
|
|
42
|
+
}), {
|
|
43
|
+
setShowPager: me,
|
|
44
|
+
showPager: k,
|
|
45
|
+
getPaginationInfo: A,
|
|
46
|
+
setPagination: b,
|
|
47
|
+
getPagination: E,
|
|
48
|
+
hasNextPage: B,
|
|
49
|
+
setHasNextPage: ge
|
|
50
|
+
} = mt(), {
|
|
51
|
+
options: $,
|
|
52
|
+
reload: W,
|
|
53
|
+
isLoaded: ve,
|
|
54
|
+
dataList: be,
|
|
55
|
+
setSearchValue: K,
|
|
56
|
+
activeIndex: he,
|
|
57
|
+
setActiveIndex: z,
|
|
58
|
+
getDefaultSingle: Pe,
|
|
59
|
+
getIsSelectFirstOption: ye,
|
|
60
|
+
needLoad: Se,
|
|
61
|
+
searchValue: Ce,
|
|
62
|
+
getImmediate: we,
|
|
63
|
+
updateOptionsDisabled: Ve
|
|
64
|
+
} = ft(r(() => ({
|
|
65
|
+
...ht,
|
|
66
|
+
...t.configProps
|
|
67
|
+
})), {
|
|
68
|
+
setLoading: fe,
|
|
69
|
+
getPaginationInfo: A,
|
|
70
|
+
setShowPager: me,
|
|
71
|
+
setPagination: b,
|
|
72
|
+
getPagination: E,
|
|
73
|
+
setSelectValue: q,
|
|
74
|
+
multiple: t.selectProps.multiple,
|
|
75
|
+
getKeyboardEvent: () => U,
|
|
76
|
+
columnsFields: l(R),
|
|
77
|
+
setHasNextPage: ge,
|
|
78
|
+
getSelectEvent: () => D,
|
|
79
|
+
extra: r(() => t.extra),
|
|
80
|
+
selectValue: i,
|
|
81
|
+
renderType: t.renderType,
|
|
82
|
+
multipleLimit: r(() => t.selectProps.multipleLimit)
|
|
83
|
+
}, f), ke = r(() => {
|
|
84
|
+
if (S.disabled !== void 0)
|
|
85
|
+
return !!S.disabled;
|
|
86
|
+
if (t.disabled || t.configProps.disabled)
|
|
87
|
+
return !0;
|
|
88
|
+
const e = t.disabledTip;
|
|
89
|
+
return ie(e) && e.length > 0 ? e.some((o) => !!(o != null && o.condition)) : tt(e) ? !!e.condition : !1;
|
|
90
|
+
}), {
|
|
91
|
+
getOtherSelectProps: Ee,
|
|
92
|
+
calcMaxCollapseTags: H,
|
|
93
|
+
calcSelectWidth: $e,
|
|
94
|
+
selectWidth: _,
|
|
95
|
+
showPopup: De,
|
|
96
|
+
setShowPopup: Fe,
|
|
97
|
+
getSelectWidth: Te
|
|
98
|
+
} = gt(r(() => t.selectProps), {
|
|
99
|
+
collapse: t.configProps.collapse,
|
|
100
|
+
selectOption: a,
|
|
101
|
+
selectRef: m,
|
|
102
|
+
disabled: ke,
|
|
103
|
+
autoSelectWidth: t.configProps.autoSelectWidth,
|
|
104
|
+
showPager: k,
|
|
105
|
+
isFilterMethod: t.configProps.isFilterMethod,
|
|
106
|
+
options: $,
|
|
107
|
+
dataList: be,
|
|
108
|
+
searchField: t.configProps.searchField,
|
|
109
|
+
placeholder: t.placeholder,
|
|
110
|
+
columnsFields: l(R),
|
|
111
|
+
allowCreate: ((Y = t.selectProps) == null ? void 0 : Y.allowCreate) || !1,
|
|
112
|
+
setSearchValue: K,
|
|
113
|
+
getKeyboardEvent: () => U,
|
|
114
|
+
setActiveIndex: z
|
|
115
|
+
}), {
|
|
116
|
+
gridEvent: G,
|
|
117
|
+
selectEvent: D,
|
|
118
|
+
keyboardEvent: U,
|
|
119
|
+
defaultDataSelect: Le
|
|
120
|
+
} = vt(r(() => t), {
|
|
121
|
+
tableRef: v,
|
|
122
|
+
selectRef: m,
|
|
123
|
+
options: $,
|
|
124
|
+
selectValue: i,
|
|
125
|
+
selectOption: a,
|
|
126
|
+
setSelectValue: q,
|
|
127
|
+
multiple: ((Z = t.selectProps) == null ? void 0 : Z.multiple) || !1,
|
|
128
|
+
reload: W,
|
|
129
|
+
isLoaded: ve,
|
|
130
|
+
getPagination: E,
|
|
131
|
+
setPagination: b,
|
|
132
|
+
showPager: k,
|
|
133
|
+
loading: V,
|
|
134
|
+
activeIndex: he,
|
|
135
|
+
setActiveIndex: z,
|
|
136
|
+
hasNextPage: B,
|
|
137
|
+
getDefaultSingle: Pe,
|
|
138
|
+
showPopup: De,
|
|
139
|
+
setShowPopup: Fe,
|
|
140
|
+
needLoad: Se,
|
|
141
|
+
dataNoBindValueClear: t.configProps.dataNoBindValueClear,
|
|
142
|
+
checkedClearSearchValue: t.configProps.checkedClearSearchValue,
|
|
143
|
+
setSearchValue: K,
|
|
144
|
+
searchValue: Ce,
|
|
145
|
+
getImmediate: we,
|
|
146
|
+
isExpandLoadData: t.configProps.isExpandLoadData,
|
|
147
|
+
persistent: ((ee = t.selectProps) == null ? void 0 : ee.persistent) || !1,
|
|
148
|
+
updateOptionsDisabled: Ve,
|
|
149
|
+
getIsSelectFirstOption: ye
|
|
150
|
+
}, f), F = r(() => ({
|
|
151
|
+
popperClass: `${w}-popper vxe-table--ignore-clear`,
|
|
152
|
+
valueKey: "value",
|
|
153
|
+
placement: "bottom-end",
|
|
154
|
+
clearable: !0,
|
|
155
|
+
persistent: !1,
|
|
156
|
+
...ct(t.selectProps, ["allowCreate"]),
|
|
157
|
+
...l(Ee),
|
|
158
|
+
loading: l(V)
|
|
159
|
+
})), T = r(() => {
|
|
160
|
+
var o;
|
|
161
|
+
return {
|
|
162
|
+
grid: t.gridProps ?? {},
|
|
163
|
+
list: l($),
|
|
164
|
+
loading: l(V),
|
|
165
|
+
showPager: l(k),
|
|
166
|
+
pagination: l(A),
|
|
167
|
+
multiple: t.selectProps.multiple,
|
|
168
|
+
disableFn: t.configProps.disableFn,
|
|
169
|
+
selectValue: l(i),
|
|
170
|
+
selectWidth: l(_),
|
|
171
|
+
deleteField: t.configProps.deleteField,
|
|
172
|
+
hasNextPage: l(B),
|
|
173
|
+
showCheckbox: (o = t.gridProps) == null ? void 0 : o.showCheckbox,
|
|
174
|
+
setPagination: b,
|
|
175
|
+
getPagination: E,
|
|
176
|
+
reload: W,
|
|
177
|
+
multipleLimit: l(F).multipleLimit
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
function q(e, o, s = !0) {
|
|
181
|
+
const n = j(i.value);
|
|
182
|
+
a.value = o, i.value = j(e), !(pt(j(e), n) || !s) && (f("update:modelValue", i.value), f("change", i.value, a.value), f("select-change", i.value, a.value), Ie());
|
|
183
|
+
}
|
|
184
|
+
function xe() {
|
|
185
|
+
return Object.keys(D).reduce((e, o) => (e[`on${o.charAt(0).toUpperCase()}${o.slice(1)}`] = D[o], e), {});
|
|
186
|
+
}
|
|
187
|
+
function Ie() {
|
|
188
|
+
var e;
|
|
189
|
+
if (t.configProps.bindFields && t.configProps.model) {
|
|
190
|
+
const o = (e = t.configProps.bindFields) == null ? void 0 : e.reduce((n, te) => {
|
|
191
|
+
var oe;
|
|
192
|
+
if (te) {
|
|
193
|
+
const [L, le] = te.split("|"), d = Je(a);
|
|
194
|
+
n[L || ""] = t.selectProps.multiple ? d == null ? void 0 : d.map((Me) => {
|
|
195
|
+
var se;
|
|
196
|
+
return (se = Me.item) == null ? void 0 : se[le || L || ""];
|
|
197
|
+
}) : (oe = d == null ? void 0 : d.item) == null ? void 0 : oe[le || L || ""];
|
|
198
|
+
}
|
|
199
|
+
return n;
|
|
200
|
+
}, {}), s = t.configProps.model;
|
|
201
|
+
Qe(s) ? Object.assign(s.value, o) : (Xe(s), Object.assign(s, o));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function Oe() {
|
|
205
|
+
return Ue(u(at, h({
|
|
206
|
+
ref: m,
|
|
207
|
+
modelValue: a.value,
|
|
208
|
+
"onUpdate:modelValue": (e) => a.value = e,
|
|
209
|
+
class: {
|
|
210
|
+
"is-not-border": !t.border
|
|
211
|
+
},
|
|
212
|
+
style: {
|
|
213
|
+
width: l($e)
|
|
214
|
+
}
|
|
215
|
+
}, l(F), xe()), {
|
|
216
|
+
default: () => [u(qe("slot"), null, null)]
|
|
217
|
+
}), [[nt, t.disabledTip]]);
|
|
218
|
+
}
|
|
219
|
+
Be(() => a.value, () => {
|
|
220
|
+
H();
|
|
221
|
+
}, {
|
|
222
|
+
deep: !0
|
|
223
|
+
}), it(m, () => {
|
|
224
|
+
H(), _.value = Te();
|
|
225
|
+
});
|
|
226
|
+
function J(e) {
|
|
227
|
+
try {
|
|
228
|
+
const o = document.createElement("textarea");
|
|
229
|
+
o.value = e, o.style.position = "fixed", o.style.opacity = "0", document.body.appendChild(o), o.select(), document.execCommand("copy"), document.body.removeChild(o);
|
|
230
|
+
} catch {
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function Q(e) {
|
|
234
|
+
navigator.clipboard ? navigator.clipboard.writeText(e).catch(() => {
|
|
235
|
+
J(e);
|
|
236
|
+
}) : J(e);
|
|
237
|
+
}
|
|
238
|
+
function je() {
|
|
239
|
+
if (!ot(a.value)) {
|
|
240
|
+
const e = a.value;
|
|
241
|
+
if (ie(e)) {
|
|
242
|
+
const o = e.map((s) => s.label).join(",");
|
|
243
|
+
Q(o);
|
|
244
|
+
} else
|
|
245
|
+
Q((e == null ? void 0 : e.label) || "");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return de({
|
|
249
|
+
getSelectInstance: () => m.value,
|
|
250
|
+
getTableInstance: () => {
|
|
251
|
+
var e;
|
|
252
|
+
return ((e = l(v)) == null ? void 0 : e.getGridInstance()) ?? void 0;
|
|
253
|
+
},
|
|
254
|
+
getSelectProps: F,
|
|
255
|
+
getGridProps: T,
|
|
256
|
+
setModelValue: Le,
|
|
257
|
+
setPagination: b,
|
|
258
|
+
getSelectOption: () => a.value
|
|
259
|
+
}), (e, o) => (x(), ae("div", h(l(dt)(l(S), ["data-component-config", "data-testid", "data-validation-rules"]), {
|
|
260
|
+
class: [[l(w), e.$attrs.class], "w-full line-height-normal"],
|
|
261
|
+
onMouseenter: o[1] || (o[1] = (s) => C.value = !0),
|
|
262
|
+
onMouseleave: o[2] || (o[2] = (s) => C.value = !1)
|
|
263
|
+
}), [(x(), We(ze(Oe()), null, I({
|
|
264
|
+
label: c((s) => [p(e.$slots, "label", P(y(s)), () => [He("span", {
|
|
265
|
+
title: s.label,
|
|
266
|
+
class: ne({
|
|
267
|
+
"line-through": s.value.isDelete
|
|
268
|
+
})
|
|
269
|
+
}, _e(s.label), 11, Pt)])]),
|
|
270
|
+
_: 2
|
|
271
|
+
}, [e.renderType === "grid" ? {
|
|
272
|
+
name: "empty",
|
|
273
|
+
fn: c(() => [p(e.$slots, "empty", {}, () => [u(ut, h({
|
|
274
|
+
ref_key: "tableRef",
|
|
275
|
+
ref: v
|
|
276
|
+
}, T.value, re(l(G))), I({
|
|
277
|
+
_: 2
|
|
278
|
+
}, [O(l(M), (s) => ({
|
|
279
|
+
name: l(N)(s),
|
|
280
|
+
fn: c((n) => [p(e.$slots, s, P(y(n || {})))])
|
|
281
|
+
}))]), 1040)])]),
|
|
282
|
+
key: "0"
|
|
283
|
+
} : e.renderType === "table" ? {
|
|
284
|
+
name: "empty",
|
|
285
|
+
fn: c(() => [p(e.$slots, "empty", {}, () => [u(Ye, h({
|
|
286
|
+
ref_key: "tableRef",
|
|
287
|
+
ref: v
|
|
288
|
+
}, T.value, {
|
|
289
|
+
"config-props": e.configProps
|
|
290
|
+
}, re(l(G))), I({
|
|
291
|
+
_: 2
|
|
292
|
+
}, [O(l(M), (s) => ({
|
|
293
|
+
name: l(N)(s),
|
|
294
|
+
fn: c((n) => [p(e.$slots, s, P(y(n || {})))])
|
|
295
|
+
}))]), 1040, ["config-props"])])]),
|
|
296
|
+
key: "1"
|
|
297
|
+
} : void 0, O(Object.keys(e.$slots), (s) => ({
|
|
298
|
+
name: s,
|
|
299
|
+
fn: c((n) => [p(e.$slots, s, P(y(n || {})))])
|
|
300
|
+
}))]), 1024)), t.configProps.isCopy && a.value ? (x(), ae("div", {
|
|
301
|
+
key: 0,
|
|
302
|
+
class: ne([`${l(w)}__copy`, C.value ? "is-show" : "is-hidden"]),
|
|
303
|
+
title: "复制",
|
|
304
|
+
onMousedown: o[0] || (o[0] = Ge(() => {
|
|
305
|
+
}, ["stop"])),
|
|
306
|
+
onClick: je
|
|
307
|
+
}, [u(l(st), null, {
|
|
308
|
+
default: c(() => [u(l(lt))]),
|
|
309
|
+
_: 1
|
|
310
|
+
})], 34)) : Ke("", !0)], 16));
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
export {
|
|
314
|
+
At as default
|
|
315
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent as C, useSlots as y, computed as s, unref as r, withDirectives as I, createElementBlock as b, openBlock as P, normalizeClass as R, createVNode as a, mergeProps as S, toHandlers as T, createSlots as k, withCtx as c, createElementVNode as D, renderList as V, renderSlot as z, normalizeProps as N, guardReactiveProps as O } from "vue";
|
|
2
|
+
import { useDesign as j } from "@dazhicheng/hooks";
|
|
3
|
+
import { TtEmpty as B } from "@dazhicheng-ui/components/tt-empty";
|
|
4
|
+
import { vLoading as L } from "element-plus";
|
|
5
|
+
import { VxeGrid as M } from "vxe-table";
|
|
6
|
+
import { tableEmits as d } from "vxe-table/es/table/src/emits";
|
|
7
|
+
import X from "xe-utils";
|
|
8
|
+
import { GRID_MIN_HEIGHT as A, GRID_MAX_HEIGHT as U } from "../const.js";
|
|
9
|
+
import { useGrid as Y } from "../hooks/useGrid.js";
|
|
10
|
+
import { selectTableProps as $ } from "../props.js";
|
|
11
|
+
const q = { class: "flex flex-col items-center justify-center" }, se = /* @__PURE__ */ C({
|
|
12
|
+
__name: "SelectTable",
|
|
13
|
+
props: $,
|
|
14
|
+
emits: d,
|
|
15
|
+
setup(p, { expose: f, emit: u }) {
|
|
16
|
+
const e = p, g = u, h = y(), i = {}, { prefixCls: v } = j("select-v2-grid"), { getColumns: w, rowStyle: _, gridRef: n, getOtherGridConfig: x } = Y(
|
|
17
|
+
s(() => e.grid),
|
|
18
|
+
s(() => e)
|
|
19
|
+
), l = s(() => {
|
|
20
|
+
const t = x();
|
|
21
|
+
return {
|
|
22
|
+
maxHeight: U,
|
|
23
|
+
minHeight: A,
|
|
24
|
+
virtualYConfig: {
|
|
25
|
+
enabled: !0,
|
|
26
|
+
immediate: !0,
|
|
27
|
+
gt: 50,
|
|
28
|
+
threshold: 50
|
|
29
|
+
},
|
|
30
|
+
size: "mini",
|
|
31
|
+
showOverflow: !0,
|
|
32
|
+
...e.grid,
|
|
33
|
+
// 如果用户没有设置 showHeader,则使用默认逻辑
|
|
34
|
+
showHeader: e.grid.showHeader !== void 0 ? e.grid.showHeader : (e.grid.columns || []).length > 1 && !!e.list.length,
|
|
35
|
+
...t,
|
|
36
|
+
columns: r(w),
|
|
37
|
+
data: e.list,
|
|
38
|
+
rowStyle: _
|
|
39
|
+
// autoResize: false,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
d.forEach((t) => {
|
|
43
|
+
const m = X.camelCase(t);
|
|
44
|
+
i[m] = (...o) => g(t, ...o);
|
|
45
|
+
});
|
|
46
|
+
const G = s(() => ({
|
|
47
|
+
...i
|
|
48
|
+
}));
|
|
49
|
+
function H() {
|
|
50
|
+
return r(n);
|
|
51
|
+
}
|
|
52
|
+
return f({
|
|
53
|
+
getGridInstance: H
|
|
54
|
+
}), (t, m) => I((P(), b("div", {
|
|
55
|
+
class: R(["w-full", {
|
|
56
|
+
[r(v)]: !0,
|
|
57
|
+
"pt-5px": !l.value.showHeader
|
|
58
|
+
}])
|
|
59
|
+
}, [
|
|
60
|
+
a(r(M), S({
|
|
61
|
+
ref_key: "gridRef",
|
|
62
|
+
ref: n,
|
|
63
|
+
class: "max-w-1000px min-w-100%"
|
|
64
|
+
}, l.value, T(G.value)), k({
|
|
65
|
+
empty: c(() => [
|
|
66
|
+
D("div", q, [
|
|
67
|
+
a(r(B))
|
|
68
|
+
])
|
|
69
|
+
]),
|
|
70
|
+
_: 2
|
|
71
|
+
}, [
|
|
72
|
+
V(Object.keys(r(h)), (o) => ({
|
|
73
|
+
name: o,
|
|
74
|
+
fn: c((E) => [
|
|
75
|
+
z(t.$slots, o, N(O(E)))
|
|
76
|
+
])
|
|
77
|
+
}))
|
|
78
|
+
]), 1040)
|
|
79
|
+
], 2)), [
|
|
80
|
+
[r(L), t.loading]
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
se as default
|
|
86
|
+
};
|