@dazhicheng/ui 1.6.4 → 1.6.6
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/index.d.ts +32 -8
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +32 -8
- package/dist/components/tt-modal/src/RenderModal.vue.js +255 -193
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +14 -2
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +61 -30
- package/dist/components/tt-modal/src/hooks/useModalRender.js +72 -71
- package/dist/components/tt-modal/src/typing.d.ts +5 -0
- package/dist/components/tt-modal/src/utils/modal-api.js +7 -5
- package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +19 -0
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +153 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +199 -167
- package/dist/components/tt-nav-anchor/src/types.d.ts +13 -4
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/directives/dialog-resize/use-draggable.js +47 -25
- package/dist/index.js +82 -81
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { TtIcon as
|
|
4
|
-
import { TtText as
|
|
1
|
+
import { defineComponent as ye, ref as m, computed as T, watch as h, useTemplateRef as W, onMounted as we, onActivated as be, onDeactivated as Te, onBeforeUnmount as xe, watchPostEffect as $e, nextTick as te, createElementBlock as _, openBlock as d, Fragment as oe, createElementVNode as u, createBlock as Ce, normalizeClass as l, unref as t, Teleport as Me, createCommentVNode as Z, normalizeStyle as ke, createVNode as E, withCtx as ne, createTextVNode as Re, toDisplayString as ie, renderList as Ne, renderSlot as Ve, isVNode as Ae, h as Ee } from "vue";
|
|
2
|
+
import Ie from "../../../assets/svg/drag.svg.js";
|
|
3
|
+
import { TtIcon as De } from "../../tt-icon/index.js";
|
|
4
|
+
import { TtText as Se } 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 He } from "../../../packages/hooks/src/useDesign.js";
|
|
7
7
|
import "axios";
|
|
8
|
-
import { useZIndex as
|
|
9
|
-
import { isString as
|
|
8
|
+
import { useZIndex as Oe, ElScrollbar as Pe } from "element-plus";
|
|
9
|
+
import { isString as ze, isFunction as ae, isNullOrUnDef as Be, isArray as Fe, isObject as Xe } from "../../../packages/utils/src/is.js";
|
|
10
10
|
import "dayjs";
|
|
11
11
|
import "numeral";
|
|
12
12
|
import "xe-utils";
|
|
@@ -19,9 +19,9 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
|
|
|
19
19
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
20
20
|
import "lodash-es";
|
|
21
21
|
import "vue-router";
|
|
22
|
-
import { useElementSize as
|
|
23
|
-
import { TT_NAV_ANCHOR_DRAG_VISIBLE_SIZE_PX as
|
|
24
|
-
const
|
|
22
|
+
import { useElementSize as Le, useDraggable as We } from "@vueuse/core";
|
|
23
|
+
import { TT_NAV_ANCHOR_DRAG_VISIBLE_SIZE_PX as I, TT_NAV_ANCHOR_ROOT_WIDTH_PX as g } from "./constants.js";
|
|
24
|
+
const Ze = ["tabindex"], Ye = ["onClick"], Ue = ["title"], _t = /* @__PURE__ */ ye({
|
|
25
25
|
name: "TtNavAnchor",
|
|
26
26
|
__name: "TtNavAnchor",
|
|
27
27
|
props: {
|
|
@@ -38,235 +38,267 @@ const De = ["tabindex"], He = ["onClick"], Oe = ["title"], rt = /* @__PURE__ */
|
|
|
38
38
|
collapseMode: {}
|
|
39
39
|
},
|
|
40
40
|
emits: ["change", "update:modelValue"],
|
|
41
|
-
setup(
|
|
42
|
-
var
|
|
43
|
-
const { prefixCls:
|
|
44
|
-
function
|
|
45
|
-
return
|
|
41
|
+
setup(le, { emit: re }) {
|
|
42
|
+
var ee;
|
|
43
|
+
const { prefixCls: n } = He("nav-anchor"), o = le, Y = re;
|
|
44
|
+
function se(e) {
|
|
45
|
+
return Be(e) || Ae(e) || Fe(e) ? e : Xe(e) || ae(e) ? Ee(e) : e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const { title:
|
|
49
|
-
return
|
|
47
|
+
function ue(e) {
|
|
48
|
+
const { title: a } = e.row;
|
|
49
|
+
return se(ae(a) ? a(e.row) : a);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
() =>
|
|
51
|
+
const x = m(o.modelValue || ((ee = o.items[0]) == null ? void 0 : ee.key) || ""), $ = T(() => o.collapseMode), U = T(() => !!$.value), f = m(!1);
|
|
52
|
+
let y;
|
|
53
|
+
h(
|
|
54
|
+
() => o.modelValue,
|
|
55
55
|
(e) => {
|
|
56
|
-
e && (
|
|
56
|
+
e && (x.value = e);
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function ce(e) {
|
|
60
|
+
x.value = e, Y("update:modelValue", e), Y("change", e);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
62
|
+
function D() {
|
|
63
|
+
y && (clearTimeout(y), y = void 0);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
65
|
+
function j() {
|
|
66
|
+
$.value === "hover" && (D(), f.value = !0);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
function G() {
|
|
69
|
+
$.value === "hover" && (D(), y = setTimeout(() => {
|
|
70
|
+
f.value = !1, y = void 0;
|
|
71
71
|
}, 180));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
|
|
73
|
+
function de(e) {
|
|
74
|
+
var a;
|
|
75
|
+
if (X(), R) {
|
|
76
|
+
R = !1;
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
$.value === "click" && (!f.value || (a = S.value) != null && a.contains(e.target)) && (f.value = !f.value);
|
|
80
|
+
}
|
|
81
|
+
const w = W("navRef"), S = W("headerRef"), C = W("sourceRef"), M = m(!0), H = m(o.teleportTo || null), { height: O } = Le(w);
|
|
82
|
+
function c(e, a) {
|
|
83
|
+
return e == null ? a : typeof e == "number" ? e : parseInt(e, 10) || a;
|
|
80
84
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
const k = m(!1);
|
|
86
|
+
let P = { x: 0, y: 0 }, R = !1;
|
|
87
|
+
function fe(e, a, i) {
|
|
88
|
+
if (typeof window > "u") return { x: e, y: a };
|
|
89
|
+
const s = Math.max(0, window.innerWidth - g), r = i > 0 ? Math.max(0, window.innerHeight - i) : window.innerHeight;
|
|
90
|
+
return { x: Math.max(0, Math.min(e, s)), y: Math.max(0, Math.min(a, r)) };
|
|
84
91
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (typeof window > "u") return { x: e, y: n };
|
|
89
|
-
const d = Math.max(0, window.innerWidth - h), C = a > 0 ? Math.max(0, window.innerHeight - a) : window.innerHeight;
|
|
90
|
-
return { x: Math.max(0, Math.min(e, d)), y: Math.max(0, Math.min(n, C)) };
|
|
92
|
+
function q() {
|
|
93
|
+
const e = C.value;
|
|
94
|
+
return e ? e.closest(".el-dialog, .tt-ui-modal") : null;
|
|
91
95
|
}
|
|
92
|
-
function
|
|
96
|
+
function N(e) {
|
|
93
97
|
if (typeof window > "u") return { x: 0, y: 0 };
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
|
|
98
|
+
const a = q(), i = a == null ? void 0 : a.getBoundingClientRect();
|
|
99
|
+
let s, r;
|
|
100
|
+
if (i && i.width > 0) {
|
|
101
|
+
const L = c(o.left, 0), ge = c(o.right, 24);
|
|
102
|
+
o.left !== void 0 ? s = i.left - g - L : s = i.right + ge, o.top !== void 0 ? r = i.top + c(o.top, 0) : o.bottom !== void 0 ? r = e > 0 ? i.bottom - e - c(o.bottom, 24) : i.top : r = i.top;
|
|
103
|
+
} else
|
|
104
|
+
s = o.left !== void 0 ? c(o.left, 0) : window.innerWidth - g - c(o.right, 24), o.top !== void 0 ? r = c(o.top, 24) : o.bottom !== void 0 ? r = e > 0 ? window.innerHeight - e - c(o.bottom, 24) : 0 : r = 24;
|
|
105
|
+
return fe(s, r, e);
|
|
106
|
+
}
|
|
107
|
+
function V() {
|
|
108
|
+
k.value || o.position === "static" || (b.value = N(O.value));
|
|
97
109
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
let p, v;
|
|
111
|
+
function z() {
|
|
112
|
+
p == null || p.disconnect(), p = void 0, v == null || v.disconnect(), v = void 0;
|
|
113
|
+
}
|
|
114
|
+
function B() {
|
|
115
|
+
z();
|
|
116
|
+
const e = q();
|
|
117
|
+
if (!e) {
|
|
118
|
+
V();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
V(), typeof MutationObserver < "u" && (p = new MutationObserver(() => V()), p.observe(e, { attributes: !0, attributeFilter: ["style", "class"] })), typeof ResizeObserver < "u" && (v = new ResizeObserver(() => V()), v.observe(e));
|
|
122
|
+
}
|
|
123
|
+
const { nextZIndex: J } = Oe(), F = m(J()), {
|
|
124
|
+
style: pe,
|
|
125
|
+
isDragging: ve,
|
|
126
|
+
position: b
|
|
127
|
+
} = We(w, {
|
|
128
|
+
handle: S,
|
|
129
|
+
initialValue: N(0),
|
|
105
130
|
preventDefault: !0,
|
|
106
131
|
onStart() {
|
|
107
|
-
|
|
132
|
+
k.value = !0, P = { ...b.value }, R = !1, X();
|
|
108
133
|
},
|
|
109
134
|
onMove(e) {
|
|
110
|
-
if (typeof window > "u" || !
|
|
111
|
-
(Math.abs(e.x -
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
x: Math.max(
|
|
115
|
-
y: Math.max(
|
|
135
|
+
if (typeof window > "u" || !w.value) return;
|
|
136
|
+
(Math.abs(e.x - P.x) > 3 || Math.abs(e.y - P.y) > 3) && (R = !0);
|
|
137
|
+
const a = w.value.getBoundingClientRect(), i = Math.min(0, I - a.width), s = Math.max(0, document.documentElement.clientWidth - I), r = Math.min(0, I - a.height), L = Math.max(0, document.documentElement.clientHeight - I);
|
|
138
|
+
b.value = {
|
|
139
|
+
x: Math.max(i, Math.min(e.x, s)),
|
|
140
|
+
y: Math.max(r, Math.min(e.y, L))
|
|
116
141
|
};
|
|
117
142
|
}
|
|
118
143
|
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}),
|
|
122
|
-
|
|
144
|
+
h(O, (e) => {
|
|
145
|
+
k.value || e <= 0 || (b.value = N(e));
|
|
146
|
+
}), h([() => o.left, () => o.right, () => o.top, () => o.bottom], () => {
|
|
147
|
+
k.value = !1, b.value = N(O.value), B();
|
|
123
148
|
});
|
|
124
|
-
const
|
|
125
|
-
const e = { "--tt-nav-anchor-root-width": `${
|
|
126
|
-
if (
|
|
127
|
-
return { "--tt-nav-anchor-root-width": `${
|
|
128
|
-
const
|
|
129
|
-
return typeof
|
|
130
|
-
}),
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
149
|
+
const me = T(() => {
|
|
150
|
+
const e = { "--tt-nav-anchor-root-width": `${g}px`, zIndex: F.value };
|
|
151
|
+
if (o.position === "static")
|
|
152
|
+
return { "--tt-nav-anchor-root-width": `${g}px` };
|
|
153
|
+
const a = pe.value;
|
|
154
|
+
return typeof a == "string" ? `${a};--tt-nav-anchor-root-width:${g}px;z-index:${F.value}` : [a, e];
|
|
155
|
+
}), he = T(() => o.position === "static" || !!H.value), K = T(() => M.value && he.value);
|
|
156
|
+
function _e() {
|
|
157
|
+
if (o.teleportTo) return o.teleportTo;
|
|
133
158
|
if (typeof window > "u" || !window.__MICRO_APP_ENVIRONMENT__) return "body";
|
|
134
|
-
const e =
|
|
159
|
+
const e = C.value;
|
|
135
160
|
return e ? e.closest("micro-app, [data-v-app], #app") ?? "body" : "body";
|
|
136
161
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
162
|
+
function Q() {
|
|
163
|
+
H.value = _e();
|
|
164
|
+
}
|
|
165
|
+
function X() {
|
|
166
|
+
F.value = J();
|
|
139
167
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
168
|
+
function A() {
|
|
169
|
+
Q(), te(() => B());
|
|
142
170
|
}
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
}),
|
|
146
|
-
|
|
147
|
-
}),
|
|
148
|
-
|
|
149
|
-
}),
|
|
150
|
-
|
|
151
|
-
}),
|
|
152
|
-
()
|
|
171
|
+
return we(() => {
|
|
172
|
+
A();
|
|
173
|
+
}), be(() => {
|
|
174
|
+
M.value = !0, A();
|
|
175
|
+
}), Te(() => {
|
|
176
|
+
M.value = !1, z();
|
|
177
|
+
}), xe(() => {
|
|
178
|
+
D(), z();
|
|
179
|
+
}), h(C, () => {
|
|
180
|
+
A();
|
|
181
|
+
}), h(
|
|
182
|
+
() => o.teleportTo,
|
|
153
183
|
() => {
|
|
154
|
-
|
|
184
|
+
A();
|
|
155
185
|
}
|
|
156
|
-
),
|
|
157
|
-
|
|
158
|
-
}), (
|
|
159
|
-
|
|
186
|
+
), $e(() => {
|
|
187
|
+
M.value && Q();
|
|
188
|
+
}), h(K, (e) => {
|
|
189
|
+
e && te(() => B());
|
|
190
|
+
}), (e, a) => (d(), _(oe, null, [
|
|
191
|
+
u("span", {
|
|
160
192
|
ref_key: "sourceRef",
|
|
161
|
-
ref:
|
|
162
|
-
class: l(`${t(
|
|
193
|
+
ref: C,
|
|
194
|
+
class: l(`${t(n)}__source`),
|
|
163
195
|
"aria-hidden": "true"
|
|
164
196
|
}, null, 2),
|
|
165
|
-
(
|
|
166
|
-
to:
|
|
197
|
+
(d(), Ce(Me, {
|
|
198
|
+
to: H.value || "body",
|
|
167
199
|
disabled: e.position === "static"
|
|
168
200
|
}, [
|
|
169
|
-
|
|
201
|
+
K.value ? (d(), _("div", {
|
|
170
202
|
key: 0,
|
|
171
203
|
ref_key: "navRef",
|
|
172
|
-
ref:
|
|
204
|
+
ref: w,
|
|
173
205
|
class: l([
|
|
174
|
-
t(
|
|
175
|
-
{ [`${t(
|
|
176
|
-
{ [`${t(
|
|
177
|
-
{ [`${t(
|
|
206
|
+
t(n),
|
|
207
|
+
{ [`${t(n)}--dragging`]: t(ve) },
|
|
208
|
+
{ [`${t(n)}--collapse-on-hover`]: U.value },
|
|
209
|
+
{ [`${t(n)}--collapse-on-hover-expanded`]: f.value }
|
|
178
210
|
]),
|
|
179
|
-
style:
|
|
180
|
-
tabindex:
|
|
181
|
-
onMouseenter:
|
|
182
|
-
onMouseleave:
|
|
183
|
-
onFocusin:
|
|
184
|
-
onFocusout:
|
|
185
|
-
onClick:
|
|
211
|
+
style: ke(me.value),
|
|
212
|
+
tabindex: U.value ? 0 : void 0,
|
|
213
|
+
onMouseenter: j,
|
|
214
|
+
onMouseleave: G,
|
|
215
|
+
onFocusin: j,
|
|
216
|
+
onFocusout: G,
|
|
217
|
+
onClick: de
|
|
186
218
|
}, [
|
|
187
|
-
|
|
219
|
+
u("div", {
|
|
188
220
|
ref_key: "headerRef",
|
|
189
|
-
ref:
|
|
190
|
-
class: l(`${t(
|
|
191
|
-
onClick:
|
|
221
|
+
ref: S,
|
|
222
|
+
class: l(`${t(n)}__header`),
|
|
223
|
+
onClick: X
|
|
192
224
|
}, [
|
|
193
|
-
|
|
194
|
-
class: l(["opacity-0", `${t(
|
|
195
|
-
icon: t(
|
|
225
|
+
E(t(De), {
|
|
226
|
+
class: l(["opacity-0", `${t(n)}__drag-icon`]),
|
|
227
|
+
icon: t(Ie),
|
|
196
228
|
size: 16,
|
|
197
229
|
"is-custom-svg": ""
|
|
198
230
|
}, null, 8, ["icon", "class"]),
|
|
199
|
-
|
|
200
|
-
class: l(`${t(
|
|
231
|
+
E(t(Se), {
|
|
232
|
+
class: l(`${t(n)}__title`),
|
|
201
233
|
"tool-tip": !1
|
|
202
234
|
}, {
|
|
203
|
-
default:
|
|
204
|
-
|
|
235
|
+
default: ne(() => [
|
|
236
|
+
Re(ie(e.title), 1)
|
|
205
237
|
]),
|
|
206
238
|
_: 1
|
|
207
239
|
}, 8, ["class"])
|
|
208
240
|
], 2),
|
|
209
|
-
|
|
210
|
-
class: l(`${t(
|
|
241
|
+
u("div", {
|
|
242
|
+
class: l(`${t(n)}__body`)
|
|
211
243
|
}, [
|
|
212
|
-
|
|
244
|
+
E(t(Pe), {
|
|
213
245
|
tag: "ul",
|
|
214
|
-
"view-class": `${t(
|
|
246
|
+
"view-class": `${t(n)}__list`,
|
|
215
247
|
"max-height": 400
|
|
216
248
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
(
|
|
219
|
-
key:
|
|
220
|
-
class: l(`${t(
|
|
249
|
+
default: ne(() => [
|
|
250
|
+
(d(!0), _(oe, null, Ne(e.items, (i, s) => (d(), _("li", {
|
|
251
|
+
key: i.key,
|
|
252
|
+
class: l(`${t(n)}__node`)
|
|
221
253
|
}, [
|
|
222
|
-
|
|
223
|
-
class: l(`${t(
|
|
254
|
+
u("div", {
|
|
255
|
+
class: l(`${t(n)}__content`)
|
|
224
256
|
}, [
|
|
225
|
-
|
|
257
|
+
u("div", {
|
|
226
258
|
class: l([
|
|
227
|
-
`${t(
|
|
228
|
-
{ [`${t(
|
|
229
|
-
{ [`${t(
|
|
259
|
+
`${t(n)}__item`,
|
|
260
|
+
{ [`${t(n)}__item--active`]: x.value === i.key },
|
|
261
|
+
{ [`${t(n)}__item--error`]: e.badgeCounts[i.key] }
|
|
230
262
|
]),
|
|
231
|
-
onClick: (
|
|
263
|
+
onClick: (r) => ce(i.key)
|
|
232
264
|
}, [
|
|
233
|
-
e.badgeCounts[
|
|
265
|
+
e.badgeCounts[i.key] ? (d(), _("span", {
|
|
234
266
|
key: 0,
|
|
235
|
-
class: l(`${t(
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
class: l(`${t(
|
|
267
|
+
class: l(`${t(n)}__badge`)
|
|
268
|
+
}, ie(e.badgeCounts[i.key]), 3)) : Z("", !0),
|
|
269
|
+
u("span", {
|
|
270
|
+
class: l(`${t(n)}__item-main`)
|
|
239
271
|
}, [
|
|
240
|
-
|
|
241
|
-
class: l(`${t(
|
|
242
|
-
title: t(
|
|
272
|
+
u("span", {
|
|
273
|
+
class: l(`${t(n)}__item-text`),
|
|
274
|
+
title: t(ze)(i.title) ? i.title : void 0
|
|
243
275
|
}, [
|
|
244
|
-
|
|
245
|
-
], 10,
|
|
246
|
-
e.$slots.description ? (
|
|
276
|
+
E(ue, { row: i }, null, 8, ["row"])
|
|
277
|
+
], 10, Ue),
|
|
278
|
+
e.$slots.description ? (d(), _("span", {
|
|
247
279
|
key: 0,
|
|
248
|
-
class: l(`${t(
|
|
280
|
+
class: l(`${t(n)}__item-description`)
|
|
249
281
|
}, [
|
|
250
|
-
|
|
251
|
-
], 2)) :
|
|
282
|
+
Ve(e.$slots, "description", { row: i })
|
|
283
|
+
], 2)) : Z("", !0)
|
|
252
284
|
], 2)
|
|
253
|
-
], 10,
|
|
285
|
+
], 10, Ye)
|
|
254
286
|
], 2),
|
|
255
|
-
|
|
256
|
-
class: l(`${t(
|
|
287
|
+
u("div", {
|
|
288
|
+
class: l(`${t(n)}__rail`)
|
|
257
289
|
}, [
|
|
258
|
-
|
|
259
|
-
class: l([`${t(
|
|
290
|
+
u("span", {
|
|
291
|
+
class: l([`${t(n)}__line-slot`, { [`${t(n)}__line-slot--visible`]: s > 0 }])
|
|
260
292
|
}, null, 2),
|
|
261
|
-
|
|
293
|
+
u("span", {
|
|
262
294
|
class: l([
|
|
263
|
-
`${t(
|
|
264
|
-
{ [`${t(
|
|
265
|
-
{ [`${t(
|
|
295
|
+
`${t(n)}__dot`,
|
|
296
|
+
{ [`${t(n)}__dot--active`]: x.value === i.key },
|
|
297
|
+
{ [`${t(n)}__dot--error`]: e.badgeCounts[i.key] }
|
|
266
298
|
])
|
|
267
299
|
}, null, 2),
|
|
268
|
-
|
|
269
|
-
class: l([`${t(
|
|
300
|
+
u("span", {
|
|
301
|
+
class: l([`${t(n)}__line-slot`, { [`${t(n)}__line-slot--visible`]: s < e.items.length - 1 }])
|
|
270
302
|
}, null, 2)
|
|
271
303
|
], 2)
|
|
272
304
|
], 2))), 128))
|
|
@@ -274,11 +306,11 @@ const De = ["tabindex"], He = ["onClick"], Oe = ["title"], rt = /* @__PURE__ */
|
|
|
274
306
|
_: 3
|
|
275
307
|
}, 8, ["view-class"])
|
|
276
308
|
], 2)
|
|
277
|
-
], 46,
|
|
309
|
+
], 46, Ze)) : Z("", !0)
|
|
278
310
|
], 8, ["to", "disabled"]))
|
|
279
311
|
], 64));
|
|
280
312
|
}
|
|
281
313
|
});
|
|
282
314
|
export {
|
|
283
|
-
|
|
315
|
+
_t as default
|
|
284
316
|
};
|
|
@@ -29,13 +29,22 @@ export interface TtNavAnchorProps {
|
|
|
29
29
|
* - 'static' 普通文档流定位
|
|
30
30
|
*/
|
|
31
31
|
position?: "fixed" | "static" | "sticky";
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* fixed/sticky 时距顶部的距离。
|
|
34
|
+
* 在弹窗内时相对弹窗顶部(外侧贴齐上沿);否则相对视口顶部。
|
|
35
|
+
*/
|
|
33
36
|
top?: number | string;
|
|
34
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* fixed/sticky 时距右侧的距离。
|
|
39
|
+
* 在弹窗内时表示与弹窗右上角外侧的间距;否则相对视口右侧。
|
|
40
|
+
*/
|
|
35
41
|
right?: number | string;
|
|
36
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* fixed/sticky 时距左侧的距离。
|
|
44
|
+
* 在弹窗内时表示与弹窗左上角外侧的间距;否则相对视口左侧。
|
|
45
|
+
*/
|
|
37
46
|
left?: number | string;
|
|
38
|
-
/** fixed/sticky
|
|
47
|
+
/** fixed/sticky 时距底部的距离。在弹窗内时相对弹窗底部;否则相对视口底部。 */
|
|
39
48
|
bottom?: number | string;
|
|
40
49
|
/** Teleport 挂载目标,未传时默认使用组件内置策略 */
|
|
41
50
|
teleportTo?: string | HTMLElement;
|
|
@@ -58,6 +58,7 @@ import "../tt-log/index.js";
|
|
|
58
58
|
/* empty css */
|
|
59
59
|
/* empty css */
|
|
60
60
|
/* empty css */
|
|
61
|
+
/* empty css */
|
|
61
62
|
/* empty css */
|
|
62
63
|
import "../tt-loading/index.js";
|
|
63
64
|
import "../../hooks/basicDataCodes.js";
|
|
@@ -67,9 +68,9 @@ import "./src/emits.js";
|
|
|
67
68
|
import "./src/props.js";
|
|
68
69
|
import "./src/table-mutation-events.js";
|
|
69
70
|
import "./src/utils/context.js";
|
|
70
|
-
const
|
|
71
|
+
const xt = t(o), At = t(r), Ct = t(m);
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Ct as TtTable,
|
|
74
|
+
xt as TtTableAction,
|
|
75
|
+
At as TtTableButton
|
|
75
76
|
};
|
|
@@ -56,6 +56,7 @@ import "../../tt-log/index.js";
|
|
|
56
56
|
/* empty css */
|
|
57
57
|
/* empty css */
|
|
58
58
|
/* empty css */
|
|
59
|
+
/* empty css */
|
|
59
60
|
/* empty css */
|
|
60
61
|
import "../../tt-loading/index.js";
|
|
61
62
|
import "../index.js";
|
|
@@ -75,7 +76,7 @@ import rt from "./Table.vue.js";
|
|
|
75
76
|
import { forwardedEventEntries as st } from "./table-mutation-events.js";
|
|
76
77
|
import { TableFormApi as at } from "./utils/table-form-api.js";
|
|
77
78
|
import { provideFormActionTestIds as it } from "./utils/context.js";
|
|
78
|
-
const nt = ["data-testid"], lt = ["data-testid"],
|
|
79
|
+
const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
|
|
79
80
|
name: "TtTableForm",
|
|
80
81
|
__name: "TableForm",
|
|
81
82
|
props: ot,
|
|
@@ -367,5 +368,5 @@ const nt = ["data-testid"], lt = ["data-testid"], _o = /* @__PURE__ */ Ee({
|
|
|
367
368
|
}
|
|
368
369
|
});
|
|
369
370
|
export {
|
|
370
|
-
|
|
371
|
+
Do as default
|
|
371
372
|
};
|
|
@@ -1,35 +1,57 @@
|
|
|
1
|
-
import { isString as
|
|
2
|
-
import { unref as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { isString as U, isNumber as j } from "lodash-es";
|
|
2
|
+
import { unref as X, watchEffect as k } from "vue";
|
|
3
|
+
import z from "./use-parse-translate.js";
|
|
4
|
+
function Y(e, n = "px") {
|
|
5
5
|
if (!e) return "";
|
|
6
|
-
if (S(e))
|
|
7
|
-
return e;
|
|
8
6
|
if (U(e))
|
|
9
|
-
return
|
|
7
|
+
return e;
|
|
8
|
+
if (j(e))
|
|
9
|
+
return `${e}${n}`;
|
|
10
|
+
}
|
|
11
|
+
function G(e) {
|
|
12
|
+
const n = e.closest(".el-overlay-dialog"), c = e.closest(".el-overlay"), s = n || c;
|
|
13
|
+
if (s)
|
|
14
|
+
return s.getBoundingClientRect();
|
|
15
|
+
const { clientWidth: o, clientHeight: t } = document.documentElement;
|
|
16
|
+
return {
|
|
17
|
+
left: 0,
|
|
18
|
+
top: 0,
|
|
19
|
+
right: o,
|
|
20
|
+
bottom: t,
|
|
21
|
+
width: o,
|
|
22
|
+
height: t,
|
|
23
|
+
x: 0,
|
|
24
|
+
y: 0,
|
|
25
|
+
toJSON() {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
10
29
|
}
|
|
11
|
-
function
|
|
12
|
-
const t =
|
|
13
|
-
var
|
|
14
|
-
const
|
|
30
|
+
function V(e, n, c, s, o) {
|
|
31
|
+
const t = X(e), a = X(n), f = (h) => {
|
|
32
|
+
var w, x, y, E, M, R, N, D;
|
|
33
|
+
const B = h.clientX, C = h.clientY, { x: m, y: l } = z(t.style.transform), H = ((x = (w = o.value) == null ? void 0 : w.draggableLimit) == null ? void 0 : x[0]) ?? 50, S = ((E = (y = o.value) == null ? void 0 : y.draggableLimit) == null ? void 0 : E[1]) ?? 50, W = ((R = (M = o.value) == null ? void 0 : M.draggableLimit) == null ? void 0 : R[2]) ?? 50, _ = ((D = (N = o.value) == null ? void 0 : N.draggableLimit) == null ? void 0 : D[3]) ?? 50, i = t.getBoundingClientRect(), v = i.left, p = i.top, q = i.width, A = i.height, r = G(t), F = r.left - v - q + _ + m, J = r.right - v - S + m, u = r.top - p + H + l;
|
|
34
|
+
let g = r.bottom - p - A - W + l;
|
|
35
|
+
g < u && (g = u);
|
|
36
|
+
const L = (T) => {
|
|
15
37
|
requestAnimationFrame(() => {
|
|
16
|
-
const
|
|
17
|
-
t.style.transform = `translate(${
|
|
38
|
+
const O = Math.min(Math.max(m + T.clientX - B, F), J), P = Math.min(Math.max(l + T.clientY - C, u), g);
|
|
39
|
+
t.style.transform = `translate(${Y(O)}, ${Y(P)})`;
|
|
18
40
|
});
|
|
19
|
-
},
|
|
20
|
-
document.removeEventListener("mousemove",
|
|
41
|
+
}, b = () => {
|
|
42
|
+
document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", b);
|
|
21
43
|
};
|
|
22
|
-
document.addEventListener("mousemove",
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
44
|
+
document.addEventListener("mousemove", L), document.addEventListener("mouseup", b);
|
|
45
|
+
}, $ = () => {
|
|
46
|
+
a && t && (t.className = `${t.className} is-draggable`, a.addEventListener("mousedown", f));
|
|
47
|
+
}, d = () => {
|
|
48
|
+
a && t && (t.className = t.className.replace("is-draggable", ""), a.removeEventListener("mousedown", f));
|
|
27
49
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}),
|
|
50
|
+
k(() => {
|
|
51
|
+
c.value ? $() : d();
|
|
52
|
+
}), s.push(d);
|
|
31
53
|
}
|
|
32
54
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
Y as addUnit,
|
|
56
|
+
V as default
|
|
35
57
|
};
|