@dazhicheng/ui 1.5.266 → 1.6.1
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/components/tt-api-component/index.js +4 -3
- package/dist/components/tt-api-component/index.vue2.js +4 -3
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-area/TtArea.vue3.js +8 -7
- package/dist/components/tt-button/index.js +5 -4
- package/dist/components/tt-button/index.vue2.js +4 -3
- package/dist/components/tt-checkbox/index.js +4 -3
- package/dist/components/tt-checkbox/index.vue.js +4 -3
- package/dist/components/tt-drawer/index.js +4 -3
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
- package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
- package/dist/components/tt-drawer/src/props.js +3 -2
- package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
- package/dist/components/tt-empty/index.js +9 -8
- package/dist/components/tt-form/index.js +10 -9
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
- package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
- package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
- package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
- package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
- package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
- package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
- package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
- package/dist/components/tt-form/src/form-render/helper.js +15 -14
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
- package/dist/components/tt-form/src/formApi.js +3 -2
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
- package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
- package/dist/components/tt-form/src/index.vue2.js +3 -2
- package/dist/components/tt-form/src/useFormContext.js +11 -10
- package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
- package/dist/components/tt-icon/index.js +6 -5
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.js +6 -5
- package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
- package/dist/components/tt-loading/index.js +4 -3
- package/dist/components/tt-loading/src/directive.js +24 -23
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-log/index.js +4 -3
- package/dist/components/tt-log/index.vue.js +3 -2
- package/dist/components/tt-modal/index.js +3 -2
- package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
- package/dist/components/tt-modal/src/props.js +3 -2
- package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
- package/dist/components/tt-modal-form/index.vue.js +4 -3
- package/dist/components/tt-nav-anchor/index.js +4 -3
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
- package/dist/components/tt-panel-select/index.js +4 -3
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +95 -87
- package/dist/components/tt-panel-select/src/index.vue.js +4 -2
- package/dist/components/tt-radio-group/index.js +4 -3
- package/dist/components/tt-radio-group/index.vue.js +7 -6
- package/dist/components/tt-select/index.js +4 -3
- package/dist/components/tt-select/src/Select.vue.d.ts +12 -12
- package/dist/components/tt-select/src/Select.vue.js +4 -3
- package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
- package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
- package/dist/components/tt-select/src/components/Table.vue.d.ts +8 -8
- package/dist/components/tt-select/src/components/Table.vue.js +3 -2
- package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
- package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
- package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
- package/dist/components/tt-select/src/props.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +526 -361
- package/dist/components/tt-table/index.js +7 -5
- package/dist/components/tt-table/src/Table.vue.d.ts +308 -218
- package/dist/components/tt-table/src/Table.vue.js +406 -618
- package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
- package/dist/components/tt-table/src/TableForm.vue.js +219 -229
- package/dist/components/tt-table/src/components/TableAction.vue.js +110 -131
- package/dist/components/tt-table/src/components/TableButtons.js +30 -29
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -84
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
- package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +34 -35
- package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.d.ts +10 -1
- package/dist/components/tt-table/src/emits.js +2 -1
- package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
- package/dist/components/tt-table/src/hooks/useColumnPersistence.js +64 -0
- package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
- package/dist/components/tt-table/src/hooks/useColumns.js +101 -245
- package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
- package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
- package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
- package/dist/components/tt-table/src/hooks/useKeyboardNav.js +98 -0
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
- package/dist/components/tt-table/src/hooks/usePagination.js +30 -33
- package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
- package/dist/components/tt-table/src/hooks/useQuery.js +148 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.js +97 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +24 -12
- package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -70
- package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
- package/dist/components/tt-table/src/hooks/useSideSlot.js +78 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.js +56 -0
- package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
- package/dist/components/tt-table/src/hooks/useTableData.js +308 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.js +47 -0
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
- package/dist/components/tt-table/src/hooks/useTableForm.js +56 -48
- package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
- package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +57 -55
- package/dist/components/tt-table/src/props.d.ts +326 -153
- package/dist/components/tt-table/src/props.js +125 -271
- package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
- package/dist/components/tt-table/src/table-defaults.js +71 -0
- package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
- package/dist/components/tt-table/src/table-mutation-events.js +71 -0
- package/dist/components/tt-table/src/types/table.d.ts +223 -88
- package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
- package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
- package/dist/components/tt-table/src/utils/action-tab-index.js +51 -0
- package/dist/components/tt-table/src/utils/context.js +26 -12
- package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
- package/dist/components/tt-table/src/utils/table-api.js +200 -165
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
- package/dist/components/tt-table/src/utils/table-form-api.js +35 -23
- package/dist/components/tt-text/index.js +4 -3
- package/dist/components/tt-upload/index.js +6 -5
- package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
- package/dist/components/types.d.ts +0 -20
- package/dist/directives/disabled-tip/index.js +9 -8
- package/dist/hooks/useFormSchemasLink.js +4 -3
- package/dist/hooks/useFormat.d.ts +35 -71
- package/dist/hooks/useFormat.js +28 -39
- package/dist/hooks/usePanelSelectSchemas.js +4 -3
- package/dist/hooks/useScreenshotOss.js +16 -15
- package/dist/hooks/useSetup.js +0 -3
- package/dist/packages/hooks/src/useDebounce.js +6 -5
- package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
- package/dist/packages/hooks/src/usePriorityValue.js +5 -4
- package/dist/packages/utils/src/format.js +48 -0
- package/dist/packages/utils/src/is.js +20 -18
- package/dist/packages/utils/src/tool.js +76 -149
- package/dist/plugins/default/renderCellContent.js +4 -3
- package/dist/plugins/vxeTable/switchStatus.js +14 -13
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
- package/dist/components/tt-table/src/enum.d.ts +0 -2
- package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
- package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
- package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
- package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
- package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
- package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
- package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
- package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
- package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
- package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
- package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
- package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
- package/dist/packages/utils/src/check.js +0 -10
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { propTypes as
|
|
3
|
-
import { useDesign as
|
|
1
|
+
import { defineComponent as q, useAttrs as G, ref as x, inject as A, computed as d, unref as r, h as J, onMounted as Q, createElementBlock as s, openBlock as i, normalizeClass as w, createVNode as k, createBlock as c, createCommentVNode as p, withCtx as u, Fragment as m, renderList as S, renderSlot as Z, withDirectives as F, mergeProps as ee, normalizeStyle as W, toDisplayString as E, createElementVNode as te, withModifiers as oe, createSlots as re, createTextVNode as ne } from "vue";
|
|
2
|
+
import { propTypes as v } from "../../../../packages/hooks/src/propTypes.js";
|
|
3
|
+
import { useDesign as ie } from "../../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { ElDivider as
|
|
6
|
-
import { isBoolean as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import { ElDivider as le, ElSpace as se, ElPopover as ae } from "element-plus";
|
|
6
|
+
import { isNullOrUnDef as f, isBoolean as de, isFunction as pe, isArray as ue, isObject as ce } from "../../../../packages/utils/src/is.js";
|
|
7
|
+
import "dayjs";
|
|
8
|
+
import "numeral";
|
|
9
|
+
import { generateTestId as M, toKebabCase as D } from "../../../../packages/utils/src/testid-helper.js";
|
|
10
|
+
import { calcWordsWidth as me } from "../../../../packages/utils/src/tool.js";
|
|
9
11
|
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
10
12
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
11
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
@@ -13,12 +15,13 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mo
|
|
|
13
15
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
16
|
import "lodash-es";
|
|
15
17
|
import "vue-router";
|
|
16
|
-
import { TtButton as
|
|
17
|
-
import { TtIcon as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { ROW_INDEX_KEY as
|
|
21
|
-
|
|
18
|
+
import { TtButton as C } from "../../../tt-button/index.js";
|
|
19
|
+
import { TtIcon as I } from "../../../tt-icon/index.js";
|
|
20
|
+
import P from "../../../../directives/disabled-tip/index.js";
|
|
21
|
+
import fe from "../../../../assets/svg/action_more.svg.js";
|
|
22
|
+
import { ROW_INDEX_KEY as be } from "./RowContext.js";
|
|
23
|
+
import { scheduleNormalizeActionTabIndex as ve } from "../utils/action-tab-index.js";
|
|
24
|
+
const ye = { key: 1 }, ge = ["onClick"], Ve = /* @__PURE__ */ q({
|
|
22
25
|
name: "TtTableAction",
|
|
23
26
|
__name: "TableAction",
|
|
24
27
|
props: {
|
|
@@ -40,223 +43,199 @@ const Ie = { key: 1 }, Be = ["onClick"], qe = /* @__PURE__ */ oe({
|
|
|
40
43
|
/** 是否分割线 */
|
|
41
44
|
// divider: propTypes.bool.def(true),
|
|
42
45
|
/** 是否清除冒泡 */
|
|
43
|
-
stopButtonPropagation:
|
|
46
|
+
stopButtonPropagation: v.bool.def(!1),
|
|
44
47
|
/** 显示buttton的个数 默认是2 */
|
|
45
|
-
showBtnNums:
|
|
48
|
+
showBtnNums: v.number.def(100),
|
|
46
49
|
/** 弹出框的宽度 */
|
|
47
|
-
popoverWidth:
|
|
50
|
+
popoverWidth: v.number.def(27),
|
|
48
51
|
/** 是否自动换行 */
|
|
49
|
-
wrap:
|
|
52
|
+
wrap: v.bool.def(!0)
|
|
50
53
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
54
|
+
setup(T) {
|
|
55
|
+
const l = T, B = G(), { prefixCls: N } = ie("table-action"), b = x(!1), z = A(
|
|
53
56
|
"tableIdContext",
|
|
54
|
-
|
|
55
|
-
),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
d(() => "")
|
|
58
|
+
), R = A(be, void 0), j = d(() => {
|
|
59
|
+
var o;
|
|
60
|
+
if (!f(l.rowIndex))
|
|
61
|
+
return l.rowIndex;
|
|
62
|
+
const t = r(R);
|
|
63
|
+
if (!f(t))
|
|
60
64
|
return t;
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
65
|
+
if (!f((o = l.slotContext) == null ? void 0 : o.$rowIndex))
|
|
66
|
+
return l.slotContext.$rowIndex;
|
|
67
|
+
if (!f(B.$rowIndex))
|
|
68
|
+
return B.$rowIndex;
|
|
65
69
|
});
|
|
66
|
-
function
|
|
67
|
-
const o = r(
|
|
68
|
-
return e
|
|
70
|
+
function y(t) {
|
|
71
|
+
const o = r(z), e = j.value;
|
|
72
|
+
return f(e) ? M(o, "action", D(t)) : M(o, "action", `row${e}`, D(t));
|
|
69
73
|
}
|
|
70
|
-
function
|
|
74
|
+
function _(t) {
|
|
71
75
|
const o = t.ifShow;
|
|
72
76
|
let e = !0;
|
|
73
|
-
return
|
|
77
|
+
return de(o) && (e = o), pe(o) && (e = o(t)), e;
|
|
74
78
|
}
|
|
75
|
-
const
|
|
76
|
-
const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e =
|
|
77
|
-
return n >
|
|
79
|
+
const O = d(() => (l.actions || []).filter((t) => _(t)).slice(0, l.showBtnNums)), g = d(() => (l.actions || []).filter((t) => _(t)).slice(l.showBtnNums)), V = d(() => r(g).length > 0), U = d(() => "left flex items-center"), K = d(() => {
|
|
80
|
+
const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = g.value.map((a) => me(a.label, "12px", o) + 22), n = Math.max(...e);
|
|
81
|
+
return n > l.popoverWidth ? n : l.popoverWidth;
|
|
78
82
|
});
|
|
79
|
-
function
|
|
83
|
+
function $(t, o) {
|
|
80
84
|
const e = t;
|
|
81
|
-
return
|
|
85
|
+
return ue(e) && e.length > 0 ? e.some((n) => !!(n != null && n.condition)) : ce(e) ? !!e.condition : !!o;
|
|
82
86
|
}
|
|
83
|
-
function
|
|
84
|
-
if (!
|
|
87
|
+
function H(t) {
|
|
88
|
+
if (!l.stopButtonPropagation) return;
|
|
85
89
|
t.composedPath().find((n) => {
|
|
86
|
-
var
|
|
87
|
-
return ((
|
|
90
|
+
var a;
|
|
91
|
+
return ((a = n.tagName) == null ? void 0 : a.toUpperCase()) === "BUTTON";
|
|
88
92
|
}) && t.stopPropagation();
|
|
89
93
|
}
|
|
90
|
-
const
|
|
94
|
+
const L = J(le, {
|
|
91
95
|
direction: "vertical",
|
|
92
96
|
style: { fontSize: "12px", margin: "0 6px" }
|
|
93
97
|
});
|
|
94
|
-
function
|
|
95
|
-
|
|
98
|
+
function X(t) {
|
|
99
|
+
b.value = !0, h.value = t.target && t.target.getBoundingClientRect();
|
|
96
100
|
}
|
|
97
|
-
const
|
|
101
|
+
const h = x({
|
|
98
102
|
top: 0,
|
|
99
103
|
left: 0,
|
|
100
104
|
bottom: 0,
|
|
101
105
|
right: 0
|
|
102
106
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
t.forEach((e) => {
|
|
106
|
-
const n = e.closest(".vxe-table");
|
|
107
|
-
if (!n) return;
|
|
108
|
-
const s = e.getBoundingClientRect(), a = Math.round(s.top), d = o.get(n) || /* @__PURE__ */ new Map(), c = d.get(a) || [];
|
|
109
|
-
c.push(e), d.set(a, c), o.set(n, d);
|
|
110
|
-
}), o.forEach((e) => {
|
|
111
|
-
e.forEach((n) => {
|
|
112
|
-
const s = n.sort((a, d) => {
|
|
113
|
-
const c = a.closest(".vxe-table"), k = d.closest(".vxe-table"), R = c != null && c.classList.contains("is--fixed-right") ? 1 : 0, _ = k != null && k.classList.contains("is--fixed-right") ? 1 : 0;
|
|
114
|
-
return R !== _ ? _ - R : d.getBoundingClientRect().left - a.getBoundingClientRect().left;
|
|
115
|
-
})[0];
|
|
116
|
-
n.forEach((a) => {
|
|
117
|
-
a.querySelectorAll("[data-table-action-button]").forEach((d) => {
|
|
118
|
-
d.tabIndex = a === s ? 0 : -1;
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
ie(() => {
|
|
125
|
-
le(() => {
|
|
126
|
-
window.setTimeout(ee, 80);
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
const te = I({
|
|
107
|
+
Q(() => ve());
|
|
108
|
+
const Y = x({
|
|
130
109
|
getBoundingClientRect() {
|
|
131
|
-
return
|
|
110
|
+
return h.value;
|
|
132
111
|
}
|
|
133
112
|
});
|
|
134
|
-
return (t, o) => (
|
|
135
|
-
class:
|
|
113
|
+
return (t, o) => (i(), s("div", {
|
|
114
|
+
class: w([r(N), U.value]),
|
|
136
115
|
tabindex: "-1",
|
|
137
|
-
onClick:
|
|
116
|
+
onClick: H
|
|
138
117
|
}, [
|
|
139
|
-
|
|
118
|
+
k(r(se), {
|
|
140
119
|
size: 0,
|
|
141
|
-
spacer: r(
|
|
142
|
-
wrap:
|
|
120
|
+
spacer: r(L),
|
|
121
|
+
wrap: T.wrap
|
|
143
122
|
}, {
|
|
144
|
-
default:
|
|
145
|
-
(
|
|
123
|
+
default: u(() => [
|
|
124
|
+
(i(!0), s(m, null, S(O.value, (e, n) => (i(), s(m, {
|
|
146
125
|
key: `${n}-${e.label}`
|
|
147
126
|
}, [
|
|
148
|
-
e.slot ?
|
|
127
|
+
e.slot ? Z(t.$slots, e.slot, ee({
|
|
149
128
|
key: 0,
|
|
150
129
|
ref_for: !0
|
|
151
|
-
}, e)) :
|
|
130
|
+
}, e)) : F((i(), c(r(C), {
|
|
152
131
|
key: 1,
|
|
153
132
|
link: "",
|
|
154
133
|
type: e.type || "primary",
|
|
155
|
-
disabled:
|
|
156
|
-
style:
|
|
134
|
+
disabled: $(e.disabledTip, e.disabled),
|
|
135
|
+
style: W({ color: e.color, visibility: e.isTextHide ? "hidden" : "visible" }),
|
|
157
136
|
loading: e.loading,
|
|
158
137
|
"data-index": n,
|
|
159
138
|
"data-table-action-button": "",
|
|
160
|
-
"data-testid":
|
|
139
|
+
"data-testid": y(e.label || ""),
|
|
161
140
|
onClick: e.onClick
|
|
162
141
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
e.iconFont ? (
|
|
165
|
-
e.iconFont ? (
|
|
142
|
+
default: u(() => [
|
|
143
|
+
e.iconFont ? (i(), s(m, { key: 0 }, [
|
|
144
|
+
e.iconFont ? (i(), c(r(I), {
|
|
166
145
|
key: 0,
|
|
167
146
|
"icon-font": e.iconFont,
|
|
168
|
-
class:
|
|
169
|
-
}, null, 8, ["icon-font", "class"])) :
|
|
170
|
-
], 64)) :
|
|
171
|
-
e.label ? (
|
|
147
|
+
class: w({ "mr-1": !!e.label })
|
|
148
|
+
}, null, 8, ["icon-font", "class"])) : p("", !0)
|
|
149
|
+
], 64)) : p("", !0),
|
|
150
|
+
e.label ? (i(), s("span", ye, E(e.label), 1)) : p("", !0)
|
|
172
151
|
]),
|
|
173
152
|
_: 2
|
|
174
153
|
}, 1032, ["type", "disabled", "style", "loading", "data-index", "data-testid", "onClick"])), [
|
|
175
|
-
[r(
|
|
154
|
+
[r(P), e.disabledTip]
|
|
176
155
|
])
|
|
177
156
|
], 64))), 128)),
|
|
178
|
-
|
|
157
|
+
V.value ? (i(), c(r(C), {
|
|
179
158
|
key: 0,
|
|
180
159
|
link: "",
|
|
181
160
|
type: "primary",
|
|
182
|
-
"data-testid":
|
|
161
|
+
"data-testid": y("more")
|
|
183
162
|
}, {
|
|
184
|
-
default:
|
|
185
|
-
|
|
186
|
-
onMouseover:
|
|
187
|
-
onMouseleave: o[0] || (o[0] = (e) =>
|
|
163
|
+
default: u(() => [
|
|
164
|
+
te("span", {
|
|
165
|
+
onMouseover: oe(X, ["stop"]),
|
|
166
|
+
onMouseleave: o[0] || (o[0] = (e) => b.value = !1)
|
|
188
167
|
}, [
|
|
189
|
-
|
|
190
|
-
icon: r(
|
|
168
|
+
k(r(I), {
|
|
169
|
+
icon: r(fe),
|
|
191
170
|
"is-custom-svg": "",
|
|
192
171
|
size: 14
|
|
193
172
|
}, null, 8, ["icon"])
|
|
194
173
|
], 32)
|
|
195
174
|
]),
|
|
196
175
|
_: 1
|
|
197
|
-
}, 8, ["data-testid"])) :
|
|
176
|
+
}, 8, ["data-testid"])) : p("", !0)
|
|
198
177
|
]),
|
|
199
178
|
_: 3
|
|
200
179
|
}, 8, ["spacer", "wrap"]),
|
|
201
|
-
|
|
180
|
+
h.value.left ? (i(), c(r(ae), {
|
|
202
181
|
key: 0,
|
|
203
|
-
visible:
|
|
204
|
-
"onUpdate:visible": o[1] || (o[1] = (e) =>
|
|
182
|
+
visible: b.value,
|
|
183
|
+
"onUpdate:visible": o[1] || (o[1] = (e) => b.value = e),
|
|
205
184
|
trigger: "hover",
|
|
206
185
|
placement: "bottom",
|
|
207
|
-
width:
|
|
186
|
+
width: K.value,
|
|
208
187
|
offset: 8,
|
|
209
188
|
"hide-after": 0,
|
|
210
|
-
"virtual-ref":
|
|
189
|
+
"virtual-ref": Y.value,
|
|
211
190
|
"virtual-triggering": "",
|
|
212
|
-
"popper-class": `${r(
|
|
191
|
+
"popper-class": `${r(N)}-popover-class`,
|
|
213
192
|
"popper-style": {
|
|
214
193
|
padding: "6px 0px",
|
|
215
194
|
minWidth: "60px"
|
|
216
195
|
}
|
|
217
196
|
}, {
|
|
218
|
-
default:
|
|
219
|
-
(
|
|
197
|
+
default: u(() => [
|
|
198
|
+
(i(!0), s(m, null, S(g.value, (e, n) => (i(), s("div", {
|
|
220
199
|
key: `${n}-${e.label}`,
|
|
221
200
|
onClick: () => {
|
|
222
|
-
var
|
|
223
|
-
!e.disabled && ((
|
|
201
|
+
var a;
|
|
202
|
+
!e.disabled && ((a = e.onClick) == null || a.call(e));
|
|
224
203
|
}
|
|
225
204
|
}, [
|
|
226
|
-
|
|
205
|
+
F((i(), c(r(C), {
|
|
227
206
|
link: "",
|
|
228
|
-
disabled:
|
|
207
|
+
disabled: $(e.disabledTip, e.disabled),
|
|
229
208
|
type: e.type || "primary",
|
|
230
|
-
style:
|
|
231
|
-
"data-testid":
|
|
232
|
-
},
|
|
233
|
-
default:
|
|
234
|
-
e.label ? (
|
|
235
|
-
|
|
236
|
-
], 64)) :
|
|
209
|
+
style: W({ color: e.color }),
|
|
210
|
+
"data-testid": y(e.label || "")
|
|
211
|
+
}, re({
|
|
212
|
+
default: u(() => [
|
|
213
|
+
e.label ? (i(), s(m, { key: 0 }, [
|
|
214
|
+
ne(E(e.label), 1)
|
|
215
|
+
], 64)) : p("", !0)
|
|
237
216
|
]),
|
|
238
217
|
_: 2
|
|
239
218
|
}, [
|
|
240
219
|
e.iconFont ? {
|
|
241
220
|
name: "icon",
|
|
242
|
-
fn:
|
|
243
|
-
|
|
221
|
+
fn: u(() => [
|
|
222
|
+
k(r(I), {
|
|
244
223
|
"icon-font": e.iconFont,
|
|
245
|
-
class:
|
|
224
|
+
class: w({ "mr-1": !!e.label })
|
|
246
225
|
}, null, 8, ["icon-font", "class"])
|
|
247
226
|
]),
|
|
248
227
|
key: "0"
|
|
249
228
|
} : void 0
|
|
250
229
|
]), 1032, ["disabled", "type", "style", "data-testid"])), [
|
|
251
|
-
[r(
|
|
230
|
+
[r(P), e.disabledTip]
|
|
252
231
|
])
|
|
253
|
-
], 8,
|
|
232
|
+
], 8, ge))), 128))
|
|
254
233
|
]),
|
|
255
234
|
_: 1
|
|
256
|
-
}, 8, ["visible", "width", "virtual-ref", "popper-class"])) :
|
|
235
|
+
}, 8, ["visible", "width", "virtual-ref", "popper-class"])) : p("", !0)
|
|
257
236
|
], 2));
|
|
258
237
|
}
|
|
259
238
|
});
|
|
260
239
|
export {
|
|
261
|
-
|
|
240
|
+
Ve as default
|
|
262
241
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { propTypes as
|
|
3
|
-
import { useDesign as
|
|
1
|
+
import { defineComponent as w, inject as S, computed as f, createVNode as n, unref as d, isVNode as k, mergeProps as c, withDirectives as P, resolveDirective as j } from "vue";
|
|
2
|
+
import { propTypes as m } from "../../../../packages/hooks/src/propTypes.js";
|
|
3
|
+
import { useDesign as F } from "../../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { ElPopover as
|
|
6
|
-
import { isBoolean as
|
|
7
|
-
import { generateTestId as A, toKebabCase as R } from "../../../../packages/utils/src/testid-helper.js";
|
|
8
|
-
import "xe-utils";
|
|
5
|
+
import { ElSpace as $, ElPopover as x } from "element-plus";
|
|
6
|
+
import { isBoolean as z, isFunction as a, isArray as D, isObject as N } from "../../../../packages/utils/src/is.js";
|
|
9
7
|
import "dayjs";
|
|
8
|
+
import "numeral";
|
|
9
|
+
import { generateTestId as O, toKebabCase as A } from "../../../../packages/utils/src/testid-helper.js";
|
|
10
|
+
import "xe-utils";
|
|
10
11
|
import "dayjs/plugin/utc";
|
|
11
12
|
import "dayjs/plugin/timezone";
|
|
12
13
|
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -16,18 +17,18 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mo
|
|
|
16
17
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
17
18
|
import "lodash-es";
|
|
18
19
|
import "vue-router";
|
|
19
|
-
import { TtButton as
|
|
20
|
+
import { TtButton as E } from "../../../tt-button/index.js";
|
|
20
21
|
import { TtIcon as b } from "../../../tt-icon/index.js";
|
|
21
|
-
import
|
|
22
|
-
import { componentMap as
|
|
22
|
+
import U from "../../../../directives/disabled-tip/index.js";
|
|
23
|
+
import { componentMap as V } from "../componentMap.js";
|
|
23
24
|
/* empty css */
|
|
24
|
-
function
|
|
25
|
-
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !
|
|
25
|
+
function _(i) {
|
|
26
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !k(i);
|
|
26
27
|
}
|
|
27
|
-
const dt = /* @__PURE__ */
|
|
28
|
+
const dt = /* @__PURE__ */ w({
|
|
28
29
|
name: "TtTableButton",
|
|
29
30
|
directives: {
|
|
30
|
-
disabledTip:
|
|
31
|
+
disabledTip: U
|
|
31
32
|
},
|
|
32
33
|
props: {
|
|
33
34
|
/** 按钮acitons */
|
|
@@ -36,20 +37,20 @@ const dt = /* @__PURE__ */ I({
|
|
|
36
37
|
default: () => []
|
|
37
38
|
},
|
|
38
39
|
/** 分割线 */
|
|
39
|
-
divider:
|
|
40
|
+
divider: m.bool.def(!0),
|
|
40
41
|
/** 是否阻止默认行为 */
|
|
41
|
-
stopButtonPropagation:
|
|
42
|
+
stopButtonPropagation: m.bool.def(!0)
|
|
42
43
|
},
|
|
43
44
|
setup(i, {
|
|
44
45
|
slots: g
|
|
45
46
|
}) {
|
|
46
47
|
const {
|
|
47
48
|
prefixCls: l
|
|
48
|
-
} =
|
|
49
|
+
} = F("table-buttons"), h = S("tableIdContext", f(() => "")), T = (t) => O(d(h), "toolbar-btn", A(t)), C = (t) => {
|
|
49
50
|
const e = t.ifShow;
|
|
50
51
|
let o = !0;
|
|
51
|
-
return
|
|
52
|
-
}, v = f(() => (
|
|
52
|
+
return z(e) && (o = e), a(e) && (o = e(t)), o;
|
|
53
|
+
}, v = f(() => (i.actions || []).filter((t) => C(t))), y = (t) => {
|
|
53
54
|
if (!i.stopButtonPropagation) return;
|
|
54
55
|
t.composedPath().find((r) => {
|
|
55
56
|
var s;
|
|
@@ -58,15 +59,15 @@ const dt = /* @__PURE__ */ I({
|
|
|
58
59
|
};
|
|
59
60
|
function B(t, e) {
|
|
60
61
|
const o = t;
|
|
61
|
-
return
|
|
62
|
+
return D(o) && o.length > 0 ? o.some((r) => !!(r != null && r.condition)) : N(o) ? !!o.condition : !!e;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
if (!t || !Reflect.has(t, e) || !
|
|
64
|
+
function I(t, e = "default", o) {
|
|
65
|
+
if (!t || !Reflect.has(t, e) || !a(t[e]))
|
|
65
66
|
return null;
|
|
66
67
|
const r = t[e];
|
|
67
68
|
return r ? r(o) : null;
|
|
68
69
|
}
|
|
69
|
-
const p = (t, e) =>
|
|
70
|
+
const p = (t, e) => P(n(E, c({
|
|
70
71
|
disabled: B(t.disabledTip, t.disabled),
|
|
71
72
|
key: e,
|
|
72
73
|
style: {
|
|
@@ -89,13 +90,13 @@ const dt = /* @__PURE__ */ I({
|
|
|
89
90
|
size: 14
|
|
90
91
|
}, null)
|
|
91
92
|
}
|
|
92
|
-
}), [[
|
|
93
|
-
const r =
|
|
93
|
+
}), [[j("disabled-tip"), t.disabledTip]]), u = (t) => t.map((e, o) => {
|
|
94
|
+
const r = V.get(e.component);
|
|
94
95
|
if (e.children && e.children.length > 0) {
|
|
95
96
|
const s = {
|
|
96
97
|
reference: () => p(e, o)
|
|
97
98
|
};
|
|
98
|
-
return e.disabled ? p(e, o) : n(
|
|
99
|
+
return e.disabled ? p(e, o) : n(x, {
|
|
99
100
|
placement: "bottom",
|
|
100
101
|
width: "auto",
|
|
101
102
|
trigger: "hover",
|
|
@@ -109,7 +110,7 @@ const dt = /* @__PURE__ */ I({
|
|
|
109
110
|
...s
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
|
-
return e.slot ?
|
|
113
|
+
return e.slot ? I(g, e.slot, e) : e.component ? n(r, c({
|
|
113
114
|
key: o
|
|
114
115
|
}, e), null) : p(e, o);
|
|
115
116
|
});
|
|
@@ -118,9 +119,9 @@ const dt = /* @__PURE__ */ I({
|
|
|
118
119
|
return n("div", {
|
|
119
120
|
class: `${l} flex`,
|
|
120
121
|
onClick: y
|
|
121
|
-
}, [n(
|
|
122
|
+
}, [n($, {
|
|
122
123
|
size: 8
|
|
123
|
-
},
|
|
124
|
+
}, _(t = u(d(v))) ? t : {
|
|
124
125
|
default: () => [t]
|
|
125
126
|
})]);
|
|
126
127
|
};
|