@dazhicheng/ui 1.5.203 → 1.5.205
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/___vite-browser-external.js +6 -0
- package/dist/_virtual/__vite-browser-external.js +4 -0
- package/dist/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js +24 -0
- package/dist/_virtual/aes.js +4 -0
- package/dist/_virtual/cipher-core.js +4 -0
- package/dist/_virtual/core.js +4 -0
- package/dist/_virtual/enc-base64.js +4 -0
- package/dist/_virtual/enc-utf8.js +4 -0
- package/dist/_virtual/evpkdf.js +4 -0
- package/dist/_virtual/hmac.js +4 -0
- package/dist/_virtual/md5.js +4 -0
- package/dist/_virtual/mode-ecb.js +4 -0
- package/dist/_virtual/pad-pkcs7.js +4 -0
- package/dist/_virtual/sha1.js +4 -0
- package/dist/components/tt-api-component/index.js +17 -4
- package/dist/components/tt-api-component/index.vue2.js +24 -13
- package/dist/components/tt-area/TtArea.vue3.js +24 -13
- package/dist/components/tt-button/index.js +18 -5
- package/dist/components/tt-button/index.vue2.js +27 -16
- package/dist/components/tt-checkbox/index.js +17 -4
- package/dist/components/tt-checkbox/index.vue.js +38 -28
- package/dist/components/tt-drawer/index.js +17 -7
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +48 -36
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +39 -26
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +23 -10
- package/dist/components/tt-drawer/src/props.js +22 -9
- package/dist/components/tt-drawer/src/utils/drawer-api.js +42 -33
- package/dist/components/tt-empty/index.js +28 -18
- package/dist/components/tt-form/index.js +22 -14
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +23 -14
- package/dist/components/tt-form/src/components/FormActions.vue2.js +42 -32
- package/dist/components/tt-form/src/form/FormDescription.vue.js +19 -10
- package/dist/components/tt-form/src/form/FormItem.vue.js +18 -9
- package/dist/components/tt-form/src/form/FormLabel.vue.js +18 -9
- package/dist/components/tt-form/src/form/RenderContent.vue.js +25 -13
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +62 -55
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +36 -28
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +64 -56
- package/dist/components/tt-form/src/form-render/array-register/utils.js +18 -8
- package/dist/components/tt-form/src/form-render/dependencies.js +36 -24
- package/dist/components/tt-form/src/form-render/form.vue2.js +17 -7
- package/dist/components/tt-form/src/form-render/helper.js +29 -16
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +17 -7
- package/dist/components/tt-form/src/formApi.js +59 -48
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +17 -4
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +67 -57
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +55 -46
- package/dist/components/tt-form/src/group-form/groupFormApi.js +21 -10
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +27 -17
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +32 -23
- package/dist/components/tt-form/src/index.vue2.js +53 -45
- package/dist/components/tt-form/src/useFormContext.js +74 -62
- package/dist/components/tt-form-item-error-tooltip/index.js +18 -5
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +32 -21
- package/dist/components/tt-icon/index.js +20 -7
- package/dist/components/tt-image/index.js +19 -6
- package/dist/components/tt-image/src/components/ImageViewer.js +27 -17
- package/dist/components/tt-loading/index.js +16 -4
- package/dist/components/tt-loading/src/directive.js +34 -22
- package/dist/components/tt-log/index.js +17 -4
- package/dist/components/tt-log/index.vue.js +21 -8
- package/dist/components/tt-modal/index.js +16 -5
- package/dist/components/tt-modal/src/RenderModal.vue.js +163 -151
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +38 -28
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +24 -11
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +36 -23
- package/dist/components/tt-modal/src/props.js +22 -9
- package/dist/components/tt-modal/src/utils/modal-api.js +39 -29
- package/dist/components/tt-modal-form/index.vue.js +44 -36
- package/dist/components/tt-nav-anchor/index.js +17 -4
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +69 -57
- package/dist/components/tt-panel-select/index.js +17 -4
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +51 -40
- package/dist/components/tt-panel-select/src/index.vue.js +35 -24
- package/dist/components/tt-select/index.js +17 -4
- package/dist/components/tt-select/src/Select.vue.js +79 -68
- package/dist/components/tt-select/src/components/SelectTable.vue.js +41 -30
- package/dist/components/tt-select/src/components/Table.vue.js +86 -76
- package/dist/components/tt-select/src/hooks/useDataSource.js +59 -49
- package/dist/components/tt-select/src/hooks/useSelect.js +46 -38
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +123 -112
- package/dist/components/tt-table/index.js +19 -12
- package/dist/components/tt-table/src/Table.vue.js +82 -71
- package/dist/components/tt-table/src/TableForm.vue.js +77 -65
- package/dist/components/tt-table/src/components/TableAction.vue.js +49 -39
- package/dist/components/tt-table/src/components/TableButtons.js +73 -60
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +14 -3
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +36 -25
- package/dist/components/tt-table/src/hooks/useColumns.js +72 -65
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +43 -31
- package/dist/components/tt-table/src/hooks/useDataSource.js +50 -42
- package/dist/components/tt-table/src/hooks/usePagination.js +36 -25
- package/dist/components/tt-table/src/props.js +55 -42
- package/dist/components/tt-table/src/utils/table-api.js +33 -22
- package/dist/components/tt-table/src/utils/table-form-api.js +35 -24
- package/dist/components/tt-text/index.js +17 -4
- package/dist/components/tt-upload/index.d.ts +15 -6
- package/dist/components/tt-upload/index.js +19 -6
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +9 -3
- package/dist/components/tt-upload/src/TtUpload.vue.js +77 -66
- package/dist/components/tt-upload/src/typing.d.ts +4 -1
- package/dist/components/tt-upload/src/typing.js +4 -0
- package/dist/directives/disabled-tip/index.js +37 -26
- package/dist/hooks/useFormSchemasLink.js +90 -79
- package/dist/hooks/useScreenshotOss.js +49 -35
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js +64 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.js +545 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js +508 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.js +81 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js +10 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.js +71 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.js +84 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.js +72 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js +22 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js +11 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js +50 -0
- package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js +1024 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js +32 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js +11 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js +92 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js +34 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js +52 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js +43 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js +47 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js +122 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js +30 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js +24 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js +106 -0
- package/dist/node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.js +16 -0
- package/dist/node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js +21 -0
- package/dist/node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +2922 -0
- package/dist/node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js +93 -0
- package/dist/packages/hooks/src/propTypes.js +17 -0
- package/dist/packages/hooks/src/tools.js +6 -0
- package/dist/packages/hooks/src/useDebounce.js +32 -0
- package/dist/packages/hooks/src/useDesign.js +12 -0
- package/dist/packages/hooks/src/useElementScreenshot.js +136 -0
- package/dist/packages/hooks/src/useIsScroll.js +12 -0
- package/dist/packages/hooks/src/usePriorityValue.js +45 -0
- package/dist/packages/utils/src/calc.js +14 -0
- package/dist/packages/utils/src/check.js +10 -0
- package/dist/packages/utils/src/install.js +11 -0
- package/dist/packages/utils/src/is.js +64 -0
- package/dist/packages/utils/src/merge.js +13 -0
- package/dist/packages/utils/src/stateHandler.js +33 -0
- package/dist/packages/utils/src/string.js +6 -0
- package/dist/packages/utils/src/testid-helper.js +14 -0
- package/dist/packages/utils/src/tool.js +181 -0
- package/dist/plugins/default/renderCellContent.js +39 -28
- package/dist/plugins/vxeTable/switchStatus.js +37 -26
- package/package.json +3 -3
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import { defineComponent as I, inject as S, computed as
|
|
2
|
-
import { propTypes as a
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { defineComponent as I, inject as S, computed as f, toRaw as k, createVNode as n, resolveComponent as P, unref as d, isVNode as j, mergeProps as c, withDirectives as F, resolveDirective as $ } from "vue";
|
|
2
|
+
import { propTypes as a } from "../../../../packages/hooks/src/propTypes.js";
|
|
3
|
+
import { useDesign as x } from "../../../../packages/hooks/src/useDesign.js";
|
|
4
|
+
import "axios";
|
|
5
|
+
import { ElPopover as z } from "element-plus";
|
|
6
|
+
import { isBoolean as D, isFunction as m, isArray as N, isObject as O } from "../../../../packages/utils/src/is.js";
|
|
7
|
+
import { generateTestId as A, toKebabCase as R } from "../../../../packages/utils/src/testid-helper.js";
|
|
8
|
+
import "xe-utils";
|
|
9
|
+
import "dayjs";
|
|
10
|
+
import "dayjs/plugin/utc";
|
|
11
|
+
import "dayjs/plugin/timezone";
|
|
12
|
+
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
13
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
14
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
15
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
16
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
17
|
+
import "lodash-es";
|
|
18
|
+
import { TtButton as U } from "../../../tt-button/index.js";
|
|
19
|
+
import { TtIcon as b } from "../../../tt-icon/index.js";
|
|
20
|
+
import V from "../../../../directives/disabled-tip/index.js";
|
|
8
21
|
import { componentMap as _ } from "../componentMap.js";
|
|
9
22
|
/* empty css */
|
|
10
|
-
function E(
|
|
11
|
-
return typeof
|
|
23
|
+
function E(i) {
|
|
24
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !j(i);
|
|
12
25
|
}
|
|
13
|
-
const
|
|
26
|
+
const ft = /* @__PURE__ */ I({
|
|
14
27
|
name: "TtTableButton",
|
|
15
28
|
directives: {
|
|
16
|
-
disabledTip:
|
|
29
|
+
disabledTip: V
|
|
17
30
|
},
|
|
18
31
|
props: {
|
|
19
32
|
/** 按钮acitons */
|
|
@@ -26,92 +39,92 @@ const X = /* @__PURE__ */ I({
|
|
|
26
39
|
/** 是否阻止默认行为 */
|
|
27
40
|
stopButtonPropagation: a.bool.def(!0)
|
|
28
41
|
},
|
|
29
|
-
setup(
|
|
42
|
+
setup(i, {
|
|
30
43
|
slots: g
|
|
31
44
|
}) {
|
|
32
45
|
const {
|
|
33
|
-
prefixCls:
|
|
34
|
-
} = x("table-buttons"), h = S("tableIdContext",
|
|
35
|
-
const
|
|
46
|
+
prefixCls: l
|
|
47
|
+
} = x("table-buttons"), h = S("tableIdContext", f(() => "")), T = (t) => A(d(h), "toolbar-btn", R(t)), C = (t) => {
|
|
48
|
+
const e = t.ifShow;
|
|
36
49
|
let o = !0;
|
|
37
|
-
return
|
|
38
|
-
}, v =
|
|
39
|
-
if (!
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
return ((
|
|
43
|
-
}) &&
|
|
50
|
+
return D(e) && (o = e), m(e) && (o = e(t)), o;
|
|
51
|
+
}, v = f(() => (k(i.actions) || []).filter((t) => C(t))), y = (t) => {
|
|
52
|
+
if (!i.stopButtonPropagation) return;
|
|
53
|
+
t.composedPath().find((r) => {
|
|
54
|
+
var s;
|
|
55
|
+
return ((s = r.tagName) == null ? void 0 : s.toUpperCase()) === "BUTTON";
|
|
56
|
+
}) && t.stopPropagation();
|
|
44
57
|
};
|
|
45
|
-
function B(
|
|
46
|
-
const o =
|
|
47
|
-
return
|
|
58
|
+
function B(t, e) {
|
|
59
|
+
const o = t;
|
|
60
|
+
return N(o) && o.length > 0 ? o.some((r) => !!(r != null && r.condition)) : O(o) ? !!o.condition : !!e;
|
|
48
61
|
}
|
|
49
|
-
function w(
|
|
50
|
-
if (!
|
|
62
|
+
function w(t, e = "default", o) {
|
|
63
|
+
if (!t || !Reflect.has(t, e) || !m(t[e]))
|
|
51
64
|
return null;
|
|
52
|
-
const r = e
|
|
65
|
+
const r = t[e];
|
|
53
66
|
return r ? r(o) : null;
|
|
54
67
|
}
|
|
55
|
-
const
|
|
56
|
-
disabled: B(
|
|
57
|
-
key:
|
|
68
|
+
const p = (t, e) => F(n(U, c({
|
|
69
|
+
disabled: B(t.disabledTip, t.disabled),
|
|
70
|
+
key: e,
|
|
58
71
|
style: {
|
|
59
|
-
color:
|
|
72
|
+
color: t.color
|
|
60
73
|
},
|
|
61
|
-
class: `${
|
|
62
|
-
onClick:
|
|
63
|
-
loading:
|
|
64
|
-
type:
|
|
65
|
-
size:
|
|
66
|
-
"data-testid": T(
|
|
67
|
-
},
|
|
68
|
-
default: () => [n("span", null, [
|
|
74
|
+
class: `${l}-reference-btn`,
|
|
75
|
+
onClick: t.onClick,
|
|
76
|
+
loading: t.loading,
|
|
77
|
+
type: t.type || "",
|
|
78
|
+
size: t.size || "default",
|
|
79
|
+
"data-testid": T(t.label || "")
|
|
80
|
+
}, t.props ?? {}), {
|
|
81
|
+
default: () => [n("span", null, [t.label || ""]), t.children && !t.disabled && n(b, {
|
|
69
82
|
"icon-font": "icon-xiala",
|
|
70
83
|
class: "el-icon--right"
|
|
71
84
|
}, null)],
|
|
72
|
-
...
|
|
73
|
-
icon: () => n(
|
|
74
|
-
"icon-font":
|
|
85
|
+
...t.iconFont && {
|
|
86
|
+
icon: () => n(b, {
|
|
87
|
+
"icon-font": t.iconFont,
|
|
75
88
|
size: 14
|
|
76
89
|
}, null)
|
|
77
90
|
}
|
|
78
|
-
}), [[$("disabled-tip"),
|
|
79
|
-
const r = _.get(
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
reference: () =>
|
|
91
|
+
}), [[$("disabled-tip"), t.disabledTip]]), u = (t) => t.map((e, o) => {
|
|
92
|
+
const r = _.get(e.component);
|
|
93
|
+
if (e.children && e.children.length > 0) {
|
|
94
|
+
const s = {
|
|
95
|
+
reference: () => p(e, o)
|
|
83
96
|
};
|
|
84
|
-
return
|
|
97
|
+
return e.disabled ? p(e, o) : n(z, {
|
|
85
98
|
placement: "bottom",
|
|
86
99
|
width: "auto",
|
|
87
100
|
trigger: "hover",
|
|
88
101
|
offset: 8,
|
|
89
102
|
"show-arrow": !1,
|
|
90
|
-
"popper-class": `${
|
|
103
|
+
"popper-class": `${l}-popover`
|
|
91
104
|
}, {
|
|
92
105
|
default: () => [n("div", {
|
|
93
|
-
class: `${
|
|
94
|
-
}, [
|
|
95
|
-
...
|
|
106
|
+
class: `${l}-popover-btnbox`
|
|
107
|
+
}, [u(e.children)])],
|
|
108
|
+
...s
|
|
96
109
|
});
|
|
97
110
|
}
|
|
98
|
-
return
|
|
111
|
+
return e.slot ? w(g, e.slot, e) : e.component ? n(r, c({
|
|
99
112
|
key: o
|
|
100
|
-
},
|
|
113
|
+
}, e), null) : p(e, o);
|
|
101
114
|
});
|
|
102
115
|
return () => {
|
|
103
|
-
let
|
|
116
|
+
let t;
|
|
104
117
|
return n("div", {
|
|
105
|
-
class: `${
|
|
118
|
+
class: `${l} flex`,
|
|
106
119
|
onClick: y
|
|
107
120
|
}, [n(P("el-space"), {
|
|
108
121
|
size: 8
|
|
109
|
-
}, E(
|
|
110
|
-
default: () => [
|
|
122
|
+
}, E(t = u(d(v))) ? t : {
|
|
123
|
+
default: () => [t]
|
|
111
124
|
})]);
|
|
112
125
|
};
|
|
113
126
|
}
|
|
114
127
|
});
|
|
115
128
|
export {
|
|
116
|
-
|
|
129
|
+
ft as default
|
|
117
130
|
};
|
|
@@ -5,12 +5,23 @@ import { TtIcon as B } from "../../../tt-icon/index.js";
|
|
|
5
5
|
import { TtText as oe } from "../../../tt-text/index.js";
|
|
6
6
|
import "../../../tt-modal/index.js";
|
|
7
7
|
import { TtButton as ne } from "../../../tt-button/index.js";
|
|
8
|
-
import
|
|
8
|
+
import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
9
|
+
import { useDesign as se } from "../../../../packages/hooks/src/useDesign.js";
|
|
10
|
+
import "axios";
|
|
9
11
|
import { ElScrollbar as $, ElCheckbox as I, ElCheckboxGroup as ie, ElTooltip as de } from "element-plus";
|
|
12
|
+
import "dayjs";
|
|
13
|
+
import "xe-utils";
|
|
14
|
+
import "dayjs/plugin/utc";
|
|
15
|
+
import "dayjs/plugin/timezone";
|
|
16
|
+
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
17
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
18
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
19
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
20
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
10
21
|
import { cloneDeep as ce } from "lodash-es";
|
|
11
22
|
import ae from "sortablejs";
|
|
12
23
|
import { useModalRender as re } from "../../../tt-modal/src/hooks/useModalRender.js";
|
|
13
|
-
const ue = { class: "flex-1" }, me = { class: "cb flex items-center" }, fe = { class: "text-[var(--el-text-color-primary)] font-bold" }, pe = { class: "flex flex-col w-[200px] shrink-0" }, he = { class: "flex items-center justify-between px-15px pt-12px pb-6px text-xs text-[var(--el-text-color-regular)]" }, xe = { class: "flex items-center text-xs" }, Ce = ["onClick"], be = { class: "text-left" },
|
|
24
|
+
const ue = { class: "flex-1" }, me = { class: "cb flex items-center" }, fe = { class: "text-[var(--el-text-color-primary)] font-bold" }, pe = { class: "flex flex-col w-[200px] shrink-0" }, he = { class: "flex items-center justify-between px-15px pt-12px pb-6px text-xs text-[var(--el-text-color-regular)]" }, xe = { class: "flex items-center text-xs" }, Ce = ["onClick"], be = { class: "text-left" }, qe = /* @__PURE__ */ X({
|
|
14
25
|
__name: "TableColumnModal",
|
|
15
26
|
props: {
|
|
16
27
|
openColumn: { type: Function },
|
|
@@ -230,5 +241,5 @@ const ue = { class: "flex-1" }, me = { class: "cb flex items-center" }, fe = { c
|
|
|
230
241
|
}
|
|
231
242
|
});
|
|
232
243
|
export {
|
|
233
|
-
|
|
244
|
+
qe as default
|
|
234
245
|
};
|
|
@@ -1,55 +1,66 @@
|
|
|
1
|
-
import { defineComponent as w, inject as E, computed as
|
|
1
|
+
import { defineComponent as w, inject as E, computed as s, unref as n, ref as x, createElementBlock as a, openBlock as t, createBlock as p, createCommentVNode as d, withCtx as f, renderSlot as u, Fragment as h, renderList as I, createElementVNode as $, createVNode as y } from "vue";
|
|
2
2
|
import { TtIcon as A } from "../../../tt-icon/index.js";
|
|
3
|
-
import
|
|
4
|
-
import { ElSpace as
|
|
3
|
+
import "axios";
|
|
4
|
+
import { ElSpace as B, ElTooltip as N } from "element-plus";
|
|
5
|
+
import "dayjs";
|
|
6
|
+
import { generateTestId as V } from "../../../../packages/utils/src/testid-helper.js";
|
|
7
|
+
import "xe-utils";
|
|
8
|
+
import "dayjs/plugin/utc";
|
|
9
|
+
import "dayjs/plugin/timezone";
|
|
10
|
+
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
+
import "lodash-es";
|
|
5
16
|
import { toolProps as z } from "../toolProps.js";
|
|
6
17
|
import R from "../../../../assets/svg/RiRefreshLine.svg.js";
|
|
7
18
|
import j from "../../../../assets/svg/exportSvg.svg.js";
|
|
8
19
|
import F from "../../../../assets/svg/columnSet.svg.js";
|
|
9
|
-
const L = ["data-testid"], P = ["onClick", "onAnimationend"],
|
|
20
|
+
const L = ["data-testid"], P = ["onClick", "onAnimationend"], ie = /* @__PURE__ */ w({
|
|
10
21
|
__name: "TableToobalTools",
|
|
11
22
|
props: z,
|
|
12
23
|
emits: ["on-refresh", "on-columns-setting", "on-export"],
|
|
13
24
|
setup(b, { emit: k }) {
|
|
14
|
-
const r = b,
|
|
25
|
+
const r = b, i = k, v = E(
|
|
15
26
|
"tableIdContext",
|
|
16
|
-
|
|
17
|
-
), _ =
|
|
18
|
-
function g(e,
|
|
19
|
-
|
|
27
|
+
s(() => "")
|
|
28
|
+
), _ = s(() => V(n(v), "table-toolbar-tools")), m = x(/* @__PURE__ */ new Set());
|
|
29
|
+
function g(e, c) {
|
|
30
|
+
m.value.add(e), c();
|
|
20
31
|
}
|
|
21
32
|
function C(e) {
|
|
22
|
-
|
|
33
|
+
m.value.delete(e);
|
|
23
34
|
}
|
|
24
|
-
const S =
|
|
35
|
+
const S = s(() => [
|
|
25
36
|
{
|
|
26
37
|
label: "自定义导出",
|
|
27
38
|
icon: j,
|
|
28
|
-
handler: () =>
|
|
39
|
+
handler: () => i("on-export"),
|
|
29
40
|
if: r.showExport
|
|
30
41
|
},
|
|
31
42
|
{
|
|
32
43
|
label: "刷新",
|
|
33
44
|
icon: R,
|
|
34
|
-
handler: () =>
|
|
45
|
+
handler: () => i("on-refresh"),
|
|
35
46
|
if: r.showRefresh
|
|
36
47
|
},
|
|
37
48
|
{
|
|
38
49
|
label: "列设置",
|
|
39
50
|
icon: F,
|
|
40
|
-
handler: () =>
|
|
51
|
+
handler: () => i("on-columns-setting"),
|
|
41
52
|
if: r.showSetColumn
|
|
42
53
|
}
|
|
43
54
|
]);
|
|
44
|
-
return (e,
|
|
45
|
-
e.showSetting ? (t(),
|
|
55
|
+
return (e, c) => (t(), a("div", { "data-testid": _.value }, [
|
|
56
|
+
e.showSetting ? (t(), p(n(B), {
|
|
46
57
|
key: 0,
|
|
47
58
|
size: 12
|
|
48
59
|
}, {
|
|
49
|
-
default:
|
|
60
|
+
default: f(() => [
|
|
50
61
|
u(e.$slots, "toolbar-left"),
|
|
51
|
-
(t(!0), a(h, null, I(S.value, (o,
|
|
52
|
-
o.if ? (t(),
|
|
62
|
+
(t(!0), a(h, null, I(S.value, (o, l) => (t(), a(h, { key: l }, [
|
|
63
|
+
o.if ? (t(), p(n(N), {
|
|
53
64
|
key: 0,
|
|
54
65
|
ref_for: !0,
|
|
55
66
|
ref: "tooltipRef",
|
|
@@ -59,11 +70,11 @@ const L = ["data-testid"], P = ["onClick", "onAnimationend"], Q = /* @__PURE__ *
|
|
|
59
70
|
placement: "top",
|
|
60
71
|
"show-after": 200
|
|
61
72
|
}, {
|
|
62
|
-
default:
|
|
73
|
+
default: f(() => [
|
|
63
74
|
$("div", {
|
|
64
75
|
class: "icon-table-btn",
|
|
65
|
-
onClick: (T) => g(
|
|
66
|
-
onAnimationend: (T) => C(
|
|
76
|
+
onClick: (T) => g(l, o.handler),
|
|
77
|
+
onAnimationend: (T) => C(l)
|
|
67
78
|
}, [
|
|
68
79
|
y(n(A), {
|
|
69
80
|
icon: o.icon,
|
|
@@ -73,15 +84,15 @@ const L = ["data-testid"], P = ["onClick", "onAnimationend"], Q = /* @__PURE__ *
|
|
|
73
84
|
], 40, P)
|
|
74
85
|
]),
|
|
75
86
|
_: 2
|
|
76
|
-
}, 1032, ["content"])) :
|
|
87
|
+
}, 1032, ["content"])) : d("", !0)
|
|
77
88
|
], 64))), 128)),
|
|
78
89
|
u(e.$slots, "toolbar-right")
|
|
79
90
|
]),
|
|
80
91
|
_: 3
|
|
81
|
-
})) :
|
|
92
|
+
})) : d("", !0)
|
|
82
93
|
], 8, L));
|
|
83
94
|
}
|
|
84
95
|
});
|
|
85
96
|
export {
|
|
86
|
-
|
|
97
|
+
ie as default
|
|
87
98
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import "axios";
|
|
2
|
+
import { ElMessage as G } from "element-plus";
|
|
3
|
+
import "dayjs";
|
|
4
|
+
import { ref as x, shallowRef as Y, computed as T, unref as n, watch as E, toValue as R, watchEffect as ee, onUnmounted as ne, nextTick as te } from "vue";
|
|
5
|
+
import { calcWordsWidth as oe } from "../../../../packages/utils/src/tool.js";
|
|
6
|
+
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
7
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
8
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
9
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
10
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
11
|
+
import { isEqual as U, debounce as B, cloneDeep as L, flattenDeep as le, isArray as ie, isFunction as se } from "lodash-es";
|
|
12
|
+
import { GlobalConfig as ue } from "../../../../hooks/useSetup.js";
|
|
6
13
|
function S(e) {
|
|
7
14
|
var u;
|
|
8
15
|
const s = L(e || []);
|
|
@@ -56,7 +63,7 @@ function ce(e) {
|
|
|
56
63
|
...W
|
|
57
64
|
}), a;
|
|
58
65
|
}
|
|
59
|
-
function
|
|
66
|
+
function re(e) {
|
|
60
67
|
const { showAction: s, actionProps: u, actionWidth: t, actionTitle: i } = n(e);
|
|
61
68
|
return s ? [
|
|
62
69
|
{
|
|
@@ -71,7 +78,7 @@ function de(e) {
|
|
|
71
78
|
}
|
|
72
79
|
] : [];
|
|
73
80
|
}
|
|
74
|
-
function
|
|
81
|
+
function de(e, s) {
|
|
75
82
|
const u = (t, i) => {
|
|
76
83
|
if (t.sortable && i) {
|
|
77
84
|
const h = `${t.field}_header`;
|
|
@@ -100,7 +107,7 @@ function ae(e, s, u) {
|
|
|
100
107
|
}
|
|
101
108
|
function he(e) {
|
|
102
109
|
const u = document.getElementsByTagName("body")[0], t = window.getComputedStyle(u).fontFamily;
|
|
103
|
-
return e.minWidth = e.minWidth === "auto" ? (
|
|
110
|
+
return e.minWidth = e.minWidth === "auto" ? (oe(e.title, "12px", t) + 60).toFixed(0) : e.minWidth, e;
|
|
104
111
|
}
|
|
105
112
|
function fe({
|
|
106
113
|
propsRef: e,
|
|
@@ -113,29 +120,29 @@ function fe({
|
|
|
113
120
|
}) {
|
|
114
121
|
var g;
|
|
115
122
|
const { columnsFieldSort: h, columnsFieldNoSort: b, isCellSort: W, isCellResize: C, customizeColumn: a } = n(e);
|
|
116
|
-
let
|
|
117
|
-
h.length > 0 && (
|
|
118
|
-
let
|
|
123
|
+
let p = W;
|
|
124
|
+
h.length > 0 && (p = h.includes(s.field)), b.length > 0 && (p = !b.includes(s.field));
|
|
125
|
+
let d = {
|
|
119
126
|
minWidth: 140,
|
|
120
|
-
sortable:
|
|
127
|
+
sortable: p,
|
|
121
128
|
resizable: C,
|
|
122
129
|
...s
|
|
123
130
|
};
|
|
124
|
-
const m = a || ((g =
|
|
125
|
-
return m &&
|
|
131
|
+
const m = a || ((g = ue.table) == null ? void 0 : g.customizeColumn);
|
|
132
|
+
return m && se(m) && (d = m(d)), d = de(d, t), d = ae(d, u, i), d = he(d), d;
|
|
126
133
|
}
|
|
127
|
-
function
|
|
134
|
+
function Pe(e, {
|
|
128
135
|
xGrid: s,
|
|
129
136
|
tableWidth: u
|
|
130
137
|
}, t) {
|
|
131
|
-
const i = x([]), h = x([]), b = x([]), W = x([]), C = x([]), a = x([]),
|
|
138
|
+
const i = x([]), h = x([]), b = x([]), W = x([]), C = x([]), a = x([]), p = Y(!0), d = x(!1);
|
|
132
139
|
let m = null, g = [];
|
|
133
|
-
function j(
|
|
140
|
+
function j(l) {
|
|
134
141
|
var c;
|
|
135
|
-
const
|
|
136
|
-
return (c =
|
|
142
|
+
const o = { ...l };
|
|
143
|
+
return (c = o.children) != null && c.length && (o.children = o.children.map((v) => j(v))), fe({
|
|
137
144
|
propsRef: e,
|
|
138
|
-
item:
|
|
145
|
+
item: o,
|
|
139
146
|
titleSolts: h,
|
|
140
147
|
validSolts: b,
|
|
141
148
|
validRulesKeys: W
|
|
@@ -144,70 +151,70 @@ function xe(e, {
|
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
const q = T(() => {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
154
|
+
const l = S(n(i));
|
|
155
|
+
return l ? l.map((c) => j(c)) : [];
|
|
149
156
|
}), H = () => ({
|
|
150
157
|
leftColumn: n(C),
|
|
151
158
|
actionColumn: n(a)
|
|
152
159
|
});
|
|
153
|
-
function D(
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
if (
|
|
160
|
+
function D(l) {
|
|
161
|
+
const o = S(l);
|
|
162
|
+
if (ie(o)) {
|
|
163
|
+
if (o.length <= 0) {
|
|
157
164
|
i.value = [];
|
|
158
165
|
return;
|
|
159
166
|
}
|
|
160
|
-
i.value = g =
|
|
167
|
+
i.value = g = o;
|
|
161
168
|
}
|
|
162
169
|
}
|
|
163
170
|
function $() {
|
|
164
171
|
return g;
|
|
165
172
|
}
|
|
166
|
-
function N(
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
173
|
+
function N(l) {
|
|
174
|
+
te(() => {
|
|
175
|
+
const o = n(s);
|
|
176
|
+
o && o.reloadColumn(le(l));
|
|
170
177
|
});
|
|
171
178
|
}
|
|
172
|
-
function V(
|
|
179
|
+
function V(l) {
|
|
173
180
|
m || (m = n(s).$el.querySelector(".vxe-table--scroll-y-virtual"));
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
), F =
|
|
177
|
-
if (c.resizeWidth <
|
|
178
|
-
const
|
|
179
|
-
c.resizeWidth =
|
|
181
|
+
const o = [...n(C), ...n(a)], { column: c } = l, { tableColumn: v } = n(s).getTableColumn(), w = L(
|
|
182
|
+
v.filter((r) => !o.map((f) => (f == null ? void 0 : f.type) || f.field).includes((r == null ? void 0 : r.type) || r.field))
|
|
183
|
+
), F = o.reduce((r, f) => r + (f.width || 0), 0), I = (n(u) || 0) - F, A = w.filter((r) => r.field !== c.field).reduce((r, f) => r + Number(f.renderWidth), 0), y = I - A;
|
|
184
|
+
if (c.resizeWidth < y) {
|
|
185
|
+
const r = (m == null ? void 0 : m.offsetWidth) || 0;
|
|
186
|
+
c.resizeWidth = y - r, c.renderWidth = c.resizeWidth, n(s).setColumnWidth(w, c.resizeWidth), G.warning("不能小于拖动的最小宽度,会导致表格右侧空白");
|
|
180
187
|
}
|
|
181
|
-
const k = w == null ? void 0 : w.find((
|
|
188
|
+
const k = w == null ? void 0 : w.find((r) => r.field === c.field);
|
|
182
189
|
k && (k.width = c.resizeWidth);
|
|
183
190
|
}
|
|
184
|
-
function J(
|
|
185
|
-
V(
|
|
191
|
+
function J(l) {
|
|
192
|
+
V(l), t("resizable-change", l);
|
|
186
193
|
}
|
|
187
|
-
function K(
|
|
188
|
-
V(
|
|
194
|
+
function K(l) {
|
|
195
|
+
V(l), t("column-resizable-change", l);
|
|
189
196
|
}
|
|
190
|
-
function Q(
|
|
197
|
+
function Q(l) {
|
|
191
198
|
var _;
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
c &&
|
|
195
|
-
const { collectColumn: A } = ((_ =
|
|
196
|
-
function
|
|
199
|
+
d.value = !0;
|
|
200
|
+
const o = [], { showAction: c, showCheckbox: v, showIndex: w, showRadio: F, showExpand: I } = n(e);
|
|
201
|
+
c && o.push("action"), v && o.push("checkbox"), w && o.push("seq"), F && o.push("radio"), I && o.push("expand");
|
|
202
|
+
const { collectColumn: A } = ((_ = l.$grid) == null ? void 0 : _.getTableColumn()) || { collectColumn: [] }, y = A.filter((P) => !o.includes(P.field) && !o.includes(P.type)), k = $();
|
|
203
|
+
function r(P, X) {
|
|
197
204
|
const M = [];
|
|
198
205
|
return P.forEach((O) => {
|
|
199
|
-
const
|
|
200
|
-
|
|
206
|
+
const z = X.find((Z) => Z.field === O.field);
|
|
207
|
+
z && (O.children && z.children && (z.children = r(O.children, z.children)), M.push(z));
|
|
201
208
|
}), M;
|
|
202
209
|
}
|
|
203
|
-
const f =
|
|
204
|
-
D(f), t("column-dragend",
|
|
210
|
+
const f = r(y, k);
|
|
211
|
+
D(f), t("column-dragend", l);
|
|
205
212
|
}
|
|
206
213
|
return E(
|
|
207
|
-
T(() =>
|
|
208
|
-
(
|
|
209
|
-
if (!U(
|
|
210
|
-
const c = S(
|
|
214
|
+
T(() => R(n(e).columns)),
|
|
215
|
+
(l, o) => {
|
|
216
|
+
if (!U(l, o)) {
|
|
217
|
+
const c = S(l || []);
|
|
211
218
|
i.value = g = c || [];
|
|
212
219
|
}
|
|
213
220
|
},
|
|
@@ -217,13 +224,13 @@ function xe(e, {
|
|
|
217
224
|
}
|
|
218
225
|
), E(
|
|
219
226
|
() => [C.value, q.value, a.value],
|
|
220
|
-
(
|
|
221
|
-
if (n(
|
|
222
|
-
return
|
|
223
|
-
|
|
227
|
+
(l, o) => {
|
|
228
|
+
if (n(d))
|
|
229
|
+
return d.value = !1, !1;
|
|
230
|
+
p.value && (N(l), p.value = !1), U(l, o) || N(l);
|
|
224
231
|
},
|
|
225
232
|
{ deep: !0 }
|
|
226
|
-
),
|
|
233
|
+
), ee(() => {
|
|
227
234
|
n(e).editRules && (W.value = Object.keys(n(e).editRules));
|
|
228
235
|
}), E(
|
|
229
236
|
T(() => [
|
|
@@ -251,12 +258,12 @@ function xe(e, {
|
|
|
251
258
|
n(e).isI18n
|
|
252
259
|
]),
|
|
253
260
|
() => {
|
|
254
|
-
a.value =
|
|
261
|
+
a.value = re(e);
|
|
255
262
|
},
|
|
256
263
|
{
|
|
257
264
|
immediate: !0
|
|
258
265
|
}
|
|
259
|
-
),
|
|
266
|
+
), ne(() => {
|
|
260
267
|
g = [];
|
|
261
268
|
}), {
|
|
262
269
|
getColumnsRef: q,
|
|
@@ -271,5 +278,5 @@ function xe(e, {
|
|
|
271
278
|
};
|
|
272
279
|
}
|
|
273
280
|
export {
|
|
274
|
-
|
|
281
|
+
Pe as useColumns
|
|
275
282
|
};
|