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