@dazhicheng/ui 1.5.222 → 1.5.224
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-modal/src/components/ModalHeader.vue.js +1 -1
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +173 -137
- package/dist/components/tt-nav-anchor/src/constants.d.ts +2 -0
- package/dist/components/tt-nav-anchor/src/constants.js +2 -1
- package/dist/components/tt-nav-anchor/src/types.d.ts +2 -0
- package/dist/components/tt-table/src/TableForm.vue.d.ts +161 -57
- package/dist/components/tt-table/src/TableForm.vue.js +126 -113
- package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +19 -1
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +103 -94
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ModalHeader.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-400f114d"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { TtIcon as
|
|
4
|
-
import { TtText as
|
|
1
|
+
import { defineComponent as de, ref as c, computed as m, watch as _, useTemplateRef as O, onActivated as ce, onDeactivated as fe, onBeforeUnmount as pe, watchPostEffect as ve, createElementBlock as f, openBlock as s, Fragment as Y, createElementVNode as r, createBlock as me, normalizeClass as l, unref as t, Teleport as _e, createCommentVNode as P, normalizeStyle as he, createVNode as M, withCtx as U, createTextVNode as ge, toDisplayString as j, renderList as ye, renderSlot as we, isVNode as Te, h as $e } from "vue";
|
|
2
|
+
import xe from "../../../assets/svg/drag.svg.js";
|
|
3
|
+
import { TtIcon as be } from "../../tt-icon/index.js";
|
|
4
|
+
import { TtText as Ce } from "../../tt-text/index.js";
|
|
5
5
|
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";
|
|
6
|
-
import { useDesign as
|
|
6
|
+
import { useDesign as Me } from "../../../packages/hooks/src/useDesign.js";
|
|
7
7
|
import "axios";
|
|
8
|
-
import { useZIndex as
|
|
9
|
-
import { isString as
|
|
8
|
+
import { useZIndex as ke, ElScrollbar as Re } from "element-plus";
|
|
9
|
+
import { isString as Ne, isFunction as G, isNullOrUnDef as Ve, isArray as Ae, isObject as Ee } from "../../../packages/utils/src/is.js";
|
|
10
10
|
import "xe-utils";
|
|
11
11
|
import "dayjs";
|
|
12
12
|
import "dayjs/plugin/utc";
|
|
@@ -17,9 +17,9 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-u
|
|
|
17
17
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
18
18
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
19
19
|
import "lodash-es";
|
|
20
|
-
import { useElementSize as
|
|
21
|
-
import { TT_NAV_ANCHOR_ROOT_WIDTH_PX as
|
|
22
|
-
const
|
|
20
|
+
import { useElementSize as Ie, useDraggable as Se } from "@vueuse/core";
|
|
21
|
+
import { TT_NAV_ANCHOR_DRAG_VISIBLE_SIZE_PX as k, TT_NAV_ANCHOR_ROOT_WIDTH_PX as h } from "./constants.js";
|
|
22
|
+
const De = ["tabindex"], He = ["onClick"], Oe = ["title"], it = /* @__PURE__ */ de({
|
|
23
23
|
name: "TtNavAnchor",
|
|
24
24
|
__name: "TtNavAnchor",
|
|
25
25
|
props: {
|
|
@@ -32,203 +32,239 @@ const Te = ["onClick"], be = ["title"], Ye = /* @__PURE__ */ K({
|
|
|
32
32
|
right: { default: void 0 },
|
|
33
33
|
left: { default: void 0 },
|
|
34
34
|
bottom: { default: void 0 },
|
|
35
|
-
teleportTo: { default: void 0 }
|
|
35
|
+
teleportTo: { default: void 0 },
|
|
36
|
+
collapseMode: {}
|
|
36
37
|
},
|
|
37
38
|
emits: ["change", "update:modelValue"],
|
|
38
|
-
setup(
|
|
39
|
-
var
|
|
40
|
-
const { prefixCls: o } =
|
|
41
|
-
function
|
|
42
|
-
return
|
|
39
|
+
setup(q, { emit: J }) {
|
|
40
|
+
var L;
|
|
41
|
+
const { prefixCls: o } = Me("nav-anchor"), i = q, z = J;
|
|
42
|
+
function K(e) {
|
|
43
|
+
return Ve(e) || Te(e) || Ae(e) ? e : Ee(e) || G(e) ? $e(e) : e;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const { title:
|
|
46
|
-
return
|
|
45
|
+
function Q(e) {
|
|
46
|
+
const { title: n } = e.row;
|
|
47
|
+
return K(G(n) ? n(e.row) : n);
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
p
|
|
49
|
+
const g = c(i.modelValue || ((L = i.items[0]) == null ? void 0 : L.key) || ""), y = m(() => i.collapseMode), B = m(() => !!y.value), u = c(!1);
|
|
50
|
+
let p;
|
|
51
|
+
_(
|
|
50
52
|
() => i.modelValue,
|
|
51
53
|
(e) => {
|
|
52
|
-
e && (
|
|
54
|
+
e && (g.value = e);
|
|
53
55
|
}
|
|
54
56
|
);
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
+
function ee(e) {
|
|
58
|
+
g.value = e, z("update:modelValue", e), z("change", e);
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return e == null ? r : typeof e == "number" ? e : parseInt(e, 10) || r;
|
|
60
|
+
function R() {
|
|
61
|
+
p && (clearTimeout(p), p = void 0);
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (typeof window > "u") return { x: e, y: r };
|
|
65
|
-
const u = Math.max(0, window.innerWidth - m), D = n > 0 ? Math.max(0, window.innerHeight - n) : window.innerHeight;
|
|
66
|
-
return { x: Math.max(0, Math.min(e, u)), y: Math.max(0, Math.min(r, D)) };
|
|
63
|
+
function X() {
|
|
64
|
+
y.value === "hover" && (R(), u.value = !0);
|
|
67
65
|
}
|
|
68
|
-
function
|
|
66
|
+
function F() {
|
|
67
|
+
y.value === "hover" && (R(), p = setTimeout(() => {
|
|
68
|
+
u.value = !1, p = void 0;
|
|
69
|
+
}, 180));
|
|
70
|
+
}
|
|
71
|
+
function te(e) {
|
|
72
|
+
var n;
|
|
73
|
+
if (H(), $) {
|
|
74
|
+
$ = !1;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
y.value === "click" && (!u.value || (n = N.value) != null && n.contains(e.target)) && (u.value = !u.value);
|
|
78
|
+
}
|
|
79
|
+
const v = O("navRef"), N = O("headerRef"), V = O("sourceRef"), w = c(!0), A = c(i.teleportTo || null), { height: W } = Ie(v);
|
|
80
|
+
function T(e, n) {
|
|
81
|
+
return e == null ? n : typeof e == "number" ? e : parseInt(e, 10) || n;
|
|
82
|
+
}
|
|
83
|
+
const E = c(!1);
|
|
84
|
+
let I = { x: 0, y: 0 }, $ = !1;
|
|
85
|
+
function oe(e, n, a) {
|
|
86
|
+
if (typeof window > "u") return { x: e, y: n };
|
|
87
|
+
const d = Math.max(0, window.innerWidth - h), C = a > 0 ? Math.max(0, window.innerHeight - a) : window.innerHeight;
|
|
88
|
+
return { x: Math.max(0, Math.min(e, d)), y: Math.max(0, Math.min(n, C)) };
|
|
89
|
+
}
|
|
90
|
+
function S(e) {
|
|
69
91
|
if (typeof window > "u") return { x: 0, y: 0 };
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
return i.top !== void 0 ?
|
|
92
|
+
const n = i.left !== void 0 ? T(i.left, 0) : window.innerWidth - h - T(i.right, 24);
|
|
93
|
+
let a;
|
|
94
|
+
return i.top !== void 0 ? a = T(i.top, 24) : i.bottom !== void 0 ? a = e > 0 ? window.innerHeight - e - T(i.bottom, 24) : 0 : a = 24, oe(n, a, e);
|
|
73
95
|
}
|
|
74
|
-
const { nextZIndex:
|
|
75
|
-
style:
|
|
76
|
-
isDragging:
|
|
77
|
-
position:
|
|
78
|
-
} =
|
|
79
|
-
handle:
|
|
80
|
-
initialValue:
|
|
96
|
+
const { nextZIndex: Z } = ke(), D = c(Z()), {
|
|
97
|
+
style: ne,
|
|
98
|
+
isDragging: ae,
|
|
99
|
+
position: x
|
|
100
|
+
} = Se(v, {
|
|
101
|
+
handle: N,
|
|
102
|
+
initialValue: S(0),
|
|
81
103
|
preventDefault: !0,
|
|
82
104
|
onStart() {
|
|
83
|
-
|
|
105
|
+
E.value = !0, I = { ...x.value }, $ = !1, H();
|
|
84
106
|
},
|
|
85
107
|
onMove(e) {
|
|
86
|
-
if (typeof window > "u" || !
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
if (typeof window > "u" || !v.value) return;
|
|
109
|
+
(Math.abs(e.x - I.x) > 3 || Math.abs(e.y - I.y) > 3) && ($ = !0);
|
|
110
|
+
const n = v.value.getBoundingClientRect(), a = Math.min(0, k - n.width), d = Math.max(0, document.documentElement.clientWidth - k), C = Math.min(0, k - n.height), ue = Math.max(0, document.documentElement.clientHeight - k);
|
|
111
|
+
x.value = {
|
|
112
|
+
x: Math.max(a, Math.min(e.x, d)),
|
|
113
|
+
y: Math.max(C, Math.min(e.y, ue))
|
|
91
114
|
};
|
|
92
115
|
}
|
|
93
116
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}),
|
|
97
|
-
|
|
117
|
+
_(W, (e) => {
|
|
118
|
+
E.value || e <= 0 || (x.value = S(e));
|
|
119
|
+
}), _([() => i.left, () => i.right, () => i.top, () => i.bottom], () => {
|
|
120
|
+
E.value = !1, x.value = S(W.value);
|
|
98
121
|
});
|
|
99
|
-
const
|
|
122
|
+
const ie = m(() => {
|
|
123
|
+
const e = { "--tt-nav-anchor-root-width": `${h}px`, zIndex: D.value };
|
|
100
124
|
if (i.position === "static")
|
|
101
|
-
return { width: `${
|
|
102
|
-
const
|
|
103
|
-
return typeof
|
|
104
|
-
}),
|
|
105
|
-
function
|
|
125
|
+
return { "--tt-nav-anchor-root-width": `${h}px` };
|
|
126
|
+
const n = ne.value;
|
|
127
|
+
return typeof n == "string" ? `${n};--tt-nav-anchor-root-width:${h}px;z-index:${D.value}` : [n, e];
|
|
128
|
+
}), le = m(() => i.position === "static" || !!A.value), re = m(() => w.value && le.value);
|
|
129
|
+
function se() {
|
|
106
130
|
if (i.teleportTo) return i.teleportTo;
|
|
107
131
|
if (typeof window > "u" || !window.__MICRO_APP_ENVIRONMENT__) return "body";
|
|
108
|
-
const e =
|
|
132
|
+
const e = V.value;
|
|
109
133
|
return e ? e.closest("micro-app, [data-v-app], #app") ?? "body" : "body";
|
|
110
134
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
135
|
+
function b() {
|
|
136
|
+
A.value = se();
|
|
113
137
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
138
|
+
function H() {
|
|
139
|
+
D.value = Z();
|
|
116
140
|
}
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
|
|
121
|
-
}),
|
|
122
|
-
|
|
123
|
-
}),
|
|
141
|
+
return ce(() => {
|
|
142
|
+
w.value = !0, b();
|
|
143
|
+
}), fe(() => {
|
|
144
|
+
w.value = !1;
|
|
145
|
+
}), pe(() => {
|
|
146
|
+
R();
|
|
147
|
+
}), _(V, () => {
|
|
148
|
+
b();
|
|
149
|
+
}), _(
|
|
124
150
|
() => i.teleportTo,
|
|
125
151
|
() => {
|
|
126
|
-
|
|
152
|
+
b();
|
|
127
153
|
}
|
|
128
|
-
),
|
|
129
|
-
|
|
130
|
-
}), (e,
|
|
131
|
-
|
|
154
|
+
), ve(() => {
|
|
155
|
+
w.value && b();
|
|
156
|
+
}), (e, n) => (s(), f(Y, null, [
|
|
157
|
+
r("span", {
|
|
132
158
|
ref_key: "sourceRef",
|
|
133
|
-
ref:
|
|
134
|
-
class:
|
|
159
|
+
ref: V,
|
|
160
|
+
class: l(`${t(o)}__source`),
|
|
135
161
|
"aria-hidden": "true"
|
|
136
162
|
}, null, 2),
|
|
137
|
-
(s(),
|
|
138
|
-
to:
|
|
163
|
+
(s(), me(_e, {
|
|
164
|
+
to: A.value || "body",
|
|
139
165
|
disabled: e.position === "static"
|
|
140
166
|
}, [
|
|
141
|
-
|
|
167
|
+
re.value ? (s(), f("div", {
|
|
142
168
|
key: 0,
|
|
143
169
|
ref_key: "navRef",
|
|
144
|
-
ref:
|
|
145
|
-
class:
|
|
146
|
-
|
|
147
|
-
|
|
170
|
+
ref: v,
|
|
171
|
+
class: l([
|
|
172
|
+
t(o),
|
|
173
|
+
{ [`${t(o)}--dragging`]: t(ae) },
|
|
174
|
+
{ [`${t(o)}--collapse-on-hover`]: B.value },
|
|
175
|
+
{ [`${t(o)}--collapse-on-hover-expanded`]: u.value }
|
|
176
|
+
]),
|
|
177
|
+
style: he(ie.value),
|
|
178
|
+
tabindex: B.value ? 0 : void 0,
|
|
179
|
+
onMouseenter: X,
|
|
180
|
+
onMouseleave: F,
|
|
181
|
+
onFocusin: X,
|
|
182
|
+
onFocusout: F,
|
|
183
|
+
onClick: te
|
|
148
184
|
}, [
|
|
149
|
-
|
|
185
|
+
r("div", {
|
|
150
186
|
ref_key: "headerRef",
|
|
151
|
-
ref:
|
|
152
|
-
class:
|
|
153
|
-
onClick:
|
|
187
|
+
ref: N,
|
|
188
|
+
class: l(`${t(o)}__header`),
|
|
189
|
+
onClick: H
|
|
154
190
|
}, [
|
|
155
|
-
|
|
156
|
-
class:
|
|
157
|
-
icon: t(
|
|
191
|
+
M(t(be), {
|
|
192
|
+
class: l(["opacity-0", `${t(o)}__drag-icon`]),
|
|
193
|
+
icon: t(xe),
|
|
158
194
|
size: 16,
|
|
159
195
|
"is-custom-svg": ""
|
|
160
196
|
}, null, 8, ["icon", "class"]),
|
|
161
|
-
|
|
162
|
-
class:
|
|
197
|
+
M(t(Ce), {
|
|
198
|
+
class: l(`${t(o)}__title`),
|
|
163
199
|
"tool-tip": !1
|
|
164
200
|
}, {
|
|
165
|
-
default:
|
|
166
|
-
|
|
201
|
+
default: U(() => [
|
|
202
|
+
ge(j(e.title), 1)
|
|
167
203
|
]),
|
|
168
204
|
_: 1
|
|
169
205
|
}, 8, ["class"])
|
|
170
206
|
], 2),
|
|
171
|
-
|
|
172
|
-
class:
|
|
207
|
+
r("div", {
|
|
208
|
+
class: l(`${t(o)}__body`)
|
|
173
209
|
}, [
|
|
174
|
-
|
|
210
|
+
M(t(Re), {
|
|
175
211
|
tag: "ul",
|
|
176
212
|
"view-class": `${t(o)}__list`,
|
|
177
213
|
"max-height": 400
|
|
178
214
|
}, {
|
|
179
|
-
default:
|
|
180
|
-
(s(!0),
|
|
181
|
-
key:
|
|
182
|
-
class:
|
|
215
|
+
default: U(() => [
|
|
216
|
+
(s(!0), f(Y, null, ye(e.items, (a, d) => (s(), f("li", {
|
|
217
|
+
key: a.key,
|
|
218
|
+
class: l(`${t(o)}__node`)
|
|
183
219
|
}, [
|
|
184
|
-
|
|
185
|
-
class:
|
|
220
|
+
r("div", {
|
|
221
|
+
class: l(`${t(o)}__content`)
|
|
186
222
|
}, [
|
|
187
|
-
|
|
188
|
-
class:
|
|
223
|
+
r("div", {
|
|
224
|
+
class: l([
|
|
189
225
|
`${t(o)}__item`,
|
|
190
|
-
{ [`${t(o)}__item--active`]:
|
|
191
|
-
{ [`${t(o)}__item--error`]: e.badgeCounts[
|
|
226
|
+
{ [`${t(o)}__item--active`]: g.value === a.key },
|
|
227
|
+
{ [`${t(o)}__item--error`]: e.badgeCounts[a.key] }
|
|
192
228
|
]),
|
|
193
|
-
onClick: (
|
|
229
|
+
onClick: (C) => ee(a.key)
|
|
194
230
|
}, [
|
|
195
|
-
e.badgeCounts[
|
|
231
|
+
e.badgeCounts[a.key] ? (s(), f("span", {
|
|
196
232
|
key: 0,
|
|
197
|
-
class:
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
class:
|
|
233
|
+
class: l(`${t(o)}__badge`)
|
|
234
|
+
}, j(e.badgeCounts[a.key]), 3)) : P("", !0),
|
|
235
|
+
r("span", {
|
|
236
|
+
class: l(`${t(o)}__item-main`)
|
|
201
237
|
}, [
|
|
202
|
-
|
|
203
|
-
class:
|
|
204
|
-
title: t(
|
|
238
|
+
r("span", {
|
|
239
|
+
class: l(`${t(o)}__item-text`),
|
|
240
|
+
title: t(Ne)(a.title) ? a.title : void 0
|
|
205
241
|
}, [
|
|
206
|
-
|
|
207
|
-
], 10,
|
|
208
|
-
e.$slots.description ? (s(),
|
|
242
|
+
M(Q, { row: a }, null, 8, ["row"])
|
|
243
|
+
], 10, Oe),
|
|
244
|
+
e.$slots.description ? (s(), f("span", {
|
|
209
245
|
key: 0,
|
|
210
|
-
class:
|
|
246
|
+
class: l(`${t(o)}__item-description`)
|
|
211
247
|
}, [
|
|
212
|
-
|
|
213
|
-
], 2)) :
|
|
248
|
+
we(e.$slots, "description", { row: a })
|
|
249
|
+
], 2)) : P("", !0)
|
|
214
250
|
], 2)
|
|
215
|
-
], 10,
|
|
251
|
+
], 10, He)
|
|
216
252
|
], 2),
|
|
217
|
-
|
|
218
|
-
class:
|
|
253
|
+
r("div", {
|
|
254
|
+
class: l(`${t(o)}__rail`)
|
|
219
255
|
}, [
|
|
220
|
-
|
|
221
|
-
class:
|
|
256
|
+
r("span", {
|
|
257
|
+
class: l([`${t(o)}__line-slot`, { [`${t(o)}__line-slot--visible`]: d > 0 }])
|
|
222
258
|
}, null, 2),
|
|
223
|
-
|
|
224
|
-
class:
|
|
259
|
+
r("span", {
|
|
260
|
+
class: l([
|
|
225
261
|
`${t(o)}__dot`,
|
|
226
|
-
{ [`${t(o)}__dot--active`]:
|
|
227
|
-
{ [`${t(o)}__dot--error`]: e.badgeCounts[
|
|
262
|
+
{ [`${t(o)}__dot--active`]: g.value === a.key },
|
|
263
|
+
{ [`${t(o)}__dot--error`]: e.badgeCounts[a.key] }
|
|
228
264
|
])
|
|
229
265
|
}, null, 2),
|
|
230
|
-
|
|
231
|
-
class:
|
|
266
|
+
r("span", {
|
|
267
|
+
class: l([`${t(o)}__line-slot`, { [`${t(o)}__line-slot--visible`]: d < e.items.length - 1 }])
|
|
232
268
|
}, null, 2)
|
|
233
269
|
], 2)
|
|
234
270
|
], 2))), 128))
|
|
@@ -236,11 +272,11 @@ const Te = ["onClick"], be = ["title"], Ye = /* @__PURE__ */ K({
|
|
|
236
272
|
_: 3
|
|
237
273
|
}, 8, ["view-class"])
|
|
238
274
|
], 2)
|
|
239
|
-
],
|
|
275
|
+
], 46, De)) : P("", !0)
|
|
240
276
|
], 8, ["to", "disabled"]))
|
|
241
277
|
], 64));
|
|
242
278
|
}
|
|
243
279
|
});
|
|
244
280
|
export {
|
|
245
|
-
|
|
281
|
+
it as default
|
|
246
282
|
};
|