@xto/data 1.1.3 → 1.1.4

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/es/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { defineComponent as O, computed as x, openBlock as c, createElementBlock as u, normalizeStyle as L, normalizeClass as f, renderSlot as j, unref as h, createCommentVNode as M, createTextVNode as J, toDisplayString as A, createElementVNode as m, ref as H, watch as F, Fragment as R, renderList as U, useSlots as de, withModifiers as re, inject as le, resolveComponent as ye, withDirectives as ge, createBlock as ae, withCtx as ce, vShow as ve, reactive as he, provide as ne, toRef as me, nextTick as fe, onMounted as se, onUnmounted as oe, resolveDynamicComponent as ie, createVNode as ke } from "vue";
2
- import { useNamespace as G } from "@xto/core";
3
- const ft = /* @__PURE__ */ O({
1
+ import { defineComponent as G, computed as x, openBlock as c, createElementBlock as h, normalizeStyle as j, normalizeClass as g, renderSlot as B, unref as f, createCommentVNode as S, createTextVNode as J, toDisplayString as A, createElementVNode as y, ref as P, watch as q, Fragment as R, renderList as U, useSlots as ue, withModifiers as de, inject as oe, resolveComponent as ye, withDirectives as ve, createBlock as se, withCtx as he, vShow as me, reactive as fe, provide as le, toRef as ke, nextTick as pe, onMounted as ie, onUnmounted as re, resolveDynamicComponent as ce, createVNode as xe } from "vue";
2
+ import { useNamespace as Y } from "@xto/core";
3
+ const pt = /* @__PURE__ */ G({
4
4
  name: "XTag",
5
5
  __name: "index",
6
6
  props: {
@@ -12,33 +12,33 @@ const ft = /* @__PURE__ */ O({
12
12
  color: {}
13
13
  },
14
14
  emits: ["close"],
15
- setup(l, { emit: s }) {
16
- const i = l, e = s, y = G("tag"), r = x(() => [
17
- y.b(),
18
- y.m(i.type || "primary"),
19
- i.size !== "default" ? y.m(i.size) : "",
20
- y.m(i.effect),
21
- y.is("hit", i.hit)
22
- ]), n = x(() => i.color ? {
23
- backgroundColor: i.effect === "dark" ? i.color : "",
24
- borderColor: i.color,
25
- color: i.effect === "dark" ? "#fff" : i.color
15
+ setup(l, { emit: o }) {
16
+ const r = l, t = o, u = Y("tag"), i = x(() => [
17
+ u.b(),
18
+ u.m(r.type || "primary"),
19
+ r.size !== "default" ? u.m(r.size) : "",
20
+ u.m(r.effect),
21
+ u.is("hit", r.hit)
22
+ ]), s = x(() => r.color ? {
23
+ backgroundColor: r.effect === "dark" ? r.color : "",
24
+ borderColor: r.color,
25
+ color: r.effect === "dark" ? "#fff" : r.color
26
26
  } : {}), k = (b) => {
27
- e("close", b);
27
+ t("close", b);
28
28
  };
29
- return (b, I) => (c(), u("span", {
30
- class: f(r.value),
31
- style: L(n.value)
29
+ return (b, M) => (c(), h("span", {
30
+ class: g(i.value),
31
+ style: j(s.value)
32
32
  }, [
33
- j(b.$slots, "default"),
34
- l.closable ? (c(), u("i", {
33
+ B(b.$slots, "default"),
34
+ l.closable ? (c(), h("i", {
35
35
  key: 0,
36
- class: f(h(y).e("close")),
36
+ class: g(f(u).e("close")),
37
37
  onClick: k
38
- }, "✕", 2)) : M("", !0)
38
+ }, "✕", 2)) : S("", !0)
39
39
  ], 6));
40
40
  }
41
- }), pt = /* @__PURE__ */ O({
41
+ }), gt = /* @__PURE__ */ G({
42
42
  name: "XCard",
43
43
  __name: "index",
44
44
  props: {
@@ -47,30 +47,30 @@ const ft = /* @__PURE__ */ O({
47
47
  shadow: { default: "always" }
48
48
  },
49
49
  setup(l) {
50
- const s = l, i = G("card"), e = x(() => [
51
- i.b(),
52
- i.is(`shadow-${s.shadow}`)
50
+ const o = l, r = Y("card"), t = x(() => [
51
+ r.b(),
52
+ r.is(`shadow-${o.shadow}`)
53
53
  ]);
54
- return (y, r) => (c(), u("div", {
55
- class: f(e.value)
54
+ return (u, i) => (c(), h("div", {
55
+ class: g(t.value)
56
56
  }, [
57
- l.header || y.$slots.header ? (c(), u("div", {
57
+ l.header || u.$slots.header ? (c(), h("div", {
58
58
  key: 0,
59
- class: f(h(i).e("header"))
59
+ class: g(f(r).e("header"))
60
60
  }, [
61
- j(y.$slots, "header", {}, () => [
61
+ B(u.$slots, "header", {}, () => [
62
62
  J(A(l.header), 1)
63
63
  ])
64
- ], 2)) : M("", !0),
65
- m("div", {
66
- class: f(h(i).e("body")),
67
- style: L(l.bodyStyle)
64
+ ], 2)) : S("", !0),
65
+ y("div", {
66
+ class: g(f(r).e("body")),
67
+ style: j(l.bodyStyle)
68
68
  }, [
69
- j(y.$slots, "default")
69
+ B(u.$slots, "default")
70
70
  ], 6)
71
71
  ], 2));
72
72
  }
73
- }), be = ["viewBox"], xe = ["cx", "cy", "r", "stroke-width"], Ce = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], yt = /* @__PURE__ */ O({
73
+ }), be = ["viewBox"], Ce = ["cx", "cy", "r", "stroke-width"], we = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], yt = /* @__PURE__ */ G({
74
74
  name: "XProgress",
75
75
  __name: "index",
76
76
  props: {
@@ -83,74 +83,74 @@ const ft = /* @__PURE__ */ O({
83
83
  showText: { type: Boolean, default: !0 }
84
84
  },
85
85
  setup(l) {
86
- const s = l, i = G("progress"), e = x(() => Math.min(100, Math.max(0, s.percentage))), y = x(() => ({
87
- width: `${e.value}%`,
88
- backgroundColor: typeof s.color == "function" ? s.color(e.value) : s.color
89
- })), r = x(() => [
90
- i.b(),
91
- i.m(s.type),
92
- i.is("show-text", s.showText),
93
- i.is(`status-${s.status || ""}`, s.status)
86
+ const o = l, r = Y("progress"), t = x(() => Math.min(100, Math.max(0, o.percentage))), u = x(() => ({
87
+ width: `${t.value}%`,
88
+ backgroundColor: typeof o.color == "function" ? o.color(t.value) : o.color
89
+ })), i = x(() => [
90
+ r.b(),
91
+ r.m(o.type),
92
+ r.is("show-text", o.showText),
93
+ r.is(`status-${o.status || ""}`, o.status)
94
94
  ]);
95
- return x(() => s.status === "success" ? "100%" : s.status === "warning" ? "Warning" : s.status === "exception" ? "Exception" : `${e.value}%`), (n, k) => (c(), u("div", {
96
- class: f(r.value)
95
+ return x(() => o.status === "success" ? "100%" : o.status === "warning" ? "Warning" : o.status === "exception" ? "Exception" : `${t.value}%`), (s, k) => (c(), h("div", {
96
+ class: g(i.value)
97
97
  }, [
98
- l.type === "line" ? (c(), u("div", {
98
+ l.type === "line" ? (c(), h("div", {
99
99
  key: 0,
100
- class: f(h(i).e("line"))
100
+ class: g(f(r).e("line"))
101
101
  }, [
102
- m("div", {
103
- class: f(h(i).e("outer"))
102
+ y("div", {
103
+ class: g(f(r).e("outer"))
104
104
  }, [
105
- m("div", {
106
- class: f(h(i).e("inner"))
105
+ y("div", {
106
+ class: g(f(r).e("inner"))
107
107
  }, [
108
- m("div", {
109
- class: f(h(i).e("bar")),
110
- style: L(y.value)
108
+ y("div", {
109
+ class: g(f(r).e("bar")),
110
+ style: j(u.value)
111
111
  }, null, 6)
112
112
  ], 2)
113
113
  ], 2),
114
- l.showText ? (c(), u("div", {
114
+ l.showText ? (c(), h("div", {
115
115
  key: 0,
116
- class: f(h(i).e("text"))
117
- }, A(e.value) + "% ", 3)) : M("", !0)
118
- ], 2)) : (c(), u("div", {
116
+ class: g(f(r).e("text"))
117
+ }, A(t.value) + "% ", 3)) : S("", !0)
118
+ ], 2)) : (c(), h("div", {
119
119
  key: 1,
120
- class: f(h(i).e("circle"))
120
+ class: g(f(r).e("circle"))
121
121
  }, [
122
- (c(), u("svg", {
122
+ (c(), h("svg", {
123
123
  viewBox: `0 0 ${l.width} ${l.width}`,
124
- style: L({ width: `${l.width}px`, height: `${l.width}px` })
124
+ style: j({ width: `${l.width}px`, height: `${l.width}px` })
125
125
  }, [
126
- m("circle", {
126
+ y("circle", {
127
127
  cx: l.width / 2,
128
128
  cy: l.width / 2,
129
129
  r: (l.width - l.strokeWidth) / 2,
130
130
  fill: "none",
131
131
  "stroke-width": l.strokeWidth,
132
132
  stroke: "#ebeef5"
133
- }, null, 8, xe),
134
- m("circle", {
133
+ }, null, 8, Ce),
134
+ y("circle", {
135
135
  cx: l.width / 2,
136
136
  cy: l.width / 2,
137
137
  r: (l.width - l.strokeWidth) / 2,
138
138
  fill: "none",
139
139
  "stroke-width": l.strokeWidth,
140
- "stroke-dasharray": `${e.value / 100 * Math.PI * (l.width - l.strokeWidth)} ${Math.PI * (l.width - l.strokeWidth)}`,
141
- stroke: typeof l.color == "function" ? l.color(e.value) : l.color,
140
+ "stroke-dasharray": `${t.value / 100 * Math.PI * (l.width - l.strokeWidth)} ${Math.PI * (l.width - l.strokeWidth)}`,
141
+ stroke: typeof l.color == "function" ? l.color(t.value) : l.color,
142
142
  "stroke-linecap": "round",
143
143
  style: { transform: "rotate(-90deg)", "transform-origin": "center" }
144
- }, null, 8, Ce)
144
+ }, null, 8, we)
145
145
  ], 12, be)),
146
- l.showText ? (c(), u("div", {
146
+ l.showText ? (c(), h("div", {
147
147
  key: 0,
148
- class: f(h(i).e("circle-text"))
149
- }, A(e.value) + "% ", 3)) : M("", !0)
148
+ class: g(f(r).e("circle-text"))
149
+ }, A(t.value) + "% ", 3)) : S("", !0)
150
150
  ], 2))
151
151
  ], 2));
152
152
  }
153
- }), we = ["disabled"], Ie = ["onClick"], Me = ["disabled"], $e = ["value"], Se = ["value"], Ke = /* @__PURE__ */ O({
153
+ }), Ie = ["disabled"], $e = ["onClick"], Me = ["disabled"], Se = ["value"], Ke = ["value"], Ne = /* @__PURE__ */ G({
154
154
  name: "XPagination",
155
155
  __name: "index",
156
156
  props: {
@@ -161,73 +161,73 @@ const ft = /* @__PURE__ */ O({
161
161
  layout: { default: "total, sizes, prev, pager, next, jumper" }
162
162
  },
163
163
  emits: ["update:currentPage", "update:pageSize", "current-change", "size-change"],
164
- setup(l, { emit: s }) {
165
- const i = l, e = s, y = G("pagination"), r = H(i.currentPage), n = H(i.pageSize);
166
- F(() => i.currentPage, (C) => {
167
- r.value = C;
168
- }), F(() => i.pageSize, (C) => {
169
- n.value = C;
164
+ setup(l, { emit: o }) {
165
+ const r = l, t = o, u = Y("pagination"), i = P(r.currentPage), s = P(r.pageSize);
166
+ q(() => r.currentPage, (w) => {
167
+ i.value = w;
168
+ }), q(() => r.pageSize, (w) => {
169
+ s.value = w;
170
170
  });
171
- const k = x(() => r.value), b = x(() => n.value), I = x(() => Math.max(1, Math.ceil(i.total / b.value))), w = x(() => {
172
- const C = [], S = I.value, K = k.value;
173
- if (S <= 7)
174
- for (let N = 1; N <= S; N++) C.push(N);
171
+ const k = x(() => i.value), b = x(() => s.value), M = x(() => Math.max(1, Math.ceil(r.total / b.value))), C = x(() => {
172
+ const w = [], $ = M.value, K = k.value;
173
+ if ($ <= 7)
174
+ for (let N = 1; N <= $; N++) w.push(N);
175
175
  else if (K <= 4) {
176
- for (let N = 1; N <= 5; N++) C.push(N);
177
- C.push(-1), C.push(S);
178
- } else if (K >= S - 3) {
179
- C.push(1), C.push(-1);
180
- for (let N = S - 4; N <= S; N++) C.push(N);
176
+ for (let N = 1; N <= 5; N++) w.push(N);
177
+ w.push(-1), w.push($);
178
+ } else if (K >= $ - 3) {
179
+ w.push(1), w.push(-1);
180
+ for (let N = $ - 4; N <= $; N++) w.push(N);
181
181
  } else {
182
- C.push(1), C.push(-1);
183
- for (let N = K - 1; N <= K + 1; N++) C.push(N);
184
- C.push(-1), C.push(S);
182
+ w.push(1), w.push(-1);
183
+ for (let N = K - 1; N <= K + 1; N++) w.push(N);
184
+ w.push(-1), w.push($);
185
185
  }
186
- return C;
187
- }), T = (C) => {
188
- C < 1 || C > I.value || C === k.value || (r.value = C, e("update:currentPage", C), e("current-change", C));
189
- }, $ = (C) => {
190
- n.value = C, e("update:pageSize", C), e("size-change", C), r.value = 1, e("update:currentPage", 1), e("current-change", 1);
186
+ return w;
187
+ }), T = (w) => {
188
+ w < 1 || w > M.value || w === k.value || (i.value = w, t("update:currentPage", w), t("current-change", w));
189
+ }, L = (w) => {
190
+ s.value = w, t("update:pageSize", w), t("size-change", w), i.value = 1, t("update:currentPage", 1), t("current-change", 1);
191
191
  };
192
- return (C, S) => (c(), u("div", {
193
- class: f(h(y).b())
192
+ return (w, $) => (c(), h("div", {
193
+ class: g(f(u).b())
194
194
  }, [
195
- m("span", {
196
- class: f(h(y).e("total"))
195
+ y("span", {
196
+ class: g(f(u).e("total"))
197
197
  }, "共 " + A(l.total) + " 条", 3),
198
- m("button", {
199
- class: f(h(y).e("btn")),
198
+ y("button", {
199
+ class: g(f(u).e("btn")),
200
200
  disabled: k.value <= 1,
201
- onClick: S[0] || (S[0] = (K) => T(k.value - 1))
202
- }, " ‹ ", 10, we),
203
- (c(!0), u(R, null, U(w.value, (K) => (c(), u(R, { key: K }, [
204
- K === -1 ? (c(), u("span", {
201
+ onClick: $[0] || ($[0] = (K) => T(k.value - 1))
202
+ }, " ‹ ", 10, Ie),
203
+ (c(!0), h(R, null, U(C.value, (K) => (c(), h(R, { key: K }, [
204
+ K === -1 ? (c(), h("span", {
205
205
  key: 0,
206
- class: f(h(y).e("ellipsis"))
207
- }, "...", 2)) : (c(), u("button", {
206
+ class: g(f(u).e("ellipsis"))
207
+ }, "...", 2)) : (c(), h("button", {
208
208
  key: 1,
209
- class: f([h(y).e("btn"), h(y).is("active", K === k.value)]),
209
+ class: g([f(u).e("btn"), f(u).is("active", K === k.value)]),
210
210
  onClick: (N) => T(K)
211
- }, A(K), 11, Ie))
211
+ }, A(K), 11, $e))
212
212
  ], 64))), 128)),
213
- m("button", {
214
- class: f(h(y).e("btn")),
215
- disabled: k.value >= I.value,
216
- onClick: S[1] || (S[1] = (K) => T(k.value + 1))
213
+ y("button", {
214
+ class: g(f(u).e("btn")),
215
+ disabled: k.value >= M.value,
216
+ onClick: $[1] || ($[1] = (K) => T(k.value + 1))
217
217
  }, " › ", 10, Me),
218
- m("select", {
219
- class: f(h(y).e("sizes")),
218
+ y("select", {
219
+ class: g(f(u).e("sizes")),
220
220
  value: b.value,
221
- onChange: S[2] || (S[2] = (K) => $(Number(K.target.value)))
221
+ onChange: $[2] || ($[2] = (K) => L(Number(K.target.value)))
222
222
  }, [
223
- (c(!0), u(R, null, U(l.pageSizes, (K) => (c(), u("option", {
223
+ (c(!0), h(R, null, U(l.pageSizes, (K) => (c(), h("option", {
224
224
  key: K,
225
225
  value: K
226
- }, A(K) + " 条/页", 9, Se))), 128))
227
- ], 42, $e)
226
+ }, A(K) + " 条/页", 9, Ke))), 128))
227
+ ], 42, Se)
228
228
  ], 2));
229
229
  }
230
- }), Ne = { key: 0 }, De = ["checked", "indeterminate"], ze = ["onClick"], Ae = ["onClick"], Te = ["checked", "onChange"], Ee = ["onClick"], Le = ["onClick"], je = { key: 1 }, Be = ["colspan"], gt = /* @__PURE__ */ O({
230
+ }), ze = { key: 0 }, De = ["checked", "indeterminate"], Ae = ["onClick"], Te = ["onClick"], Ee = ["checked", "onChange"], Le = ["onClick"], je = ["onClick"], Be = { key: 1 }, He = ["colspan"], vt = /* @__PURE__ */ G({
231
231
  name: "XDynamicTable",
232
232
  __name: "index",
233
233
  props: {
@@ -249,336 +249,336 @@ const ft = /* @__PURE__ */ O({
249
249
  defaultSort: {}
250
250
  },
251
251
  emits: ["sort-change", "row-click", "row-dblclick", "selection-change", "select-all", "cell-click", "add-row", "delete-row", "update:data"],
252
- setup(l, { expose: s, emit: i }) {
253
- var g, t;
254
- const e = l, y = i, r = G("dynamic-table");
255
- de();
256
- const n = x({
257
- get: () => e.data,
258
- set: (a) => y("update:data", a)
259
- }), k = H({
260
- prop: ((g = e.defaultSort) == null ? void 0 : g.prop) || "",
261
- order: ((t = e.defaultSort) == null ? void 0 : t.order) || null
262
- }), b = H([]), I = H(!1), w = H(!1), T = x(() => {
252
+ setup(l, { expose: o, emit: r }) {
253
+ var I, n;
254
+ const t = l, u = r, i = Y("dynamic-table");
255
+ ue();
256
+ const s = x({
257
+ get: () => t.data,
258
+ set: (e) => u("update:data", e)
259
+ }), k = P({
260
+ prop: ((I = t.defaultSort) == null ? void 0 : I.prop) || "",
261
+ order: ((n = t.defaultSort) == null ? void 0 : n.order) || null
262
+ }), b = P([]), M = P(!1), C = P(!1), T = x(() => {
263
263
  if (!k.value.prop || !k.value.order)
264
- return n.value;
265
- const { prop: a, order: o } = k.value;
266
- return [...n.value].sort((p, v) => {
267
- const z = p[a], W = v[a];
268
- if (z === W) return 0;
269
- const V = z > W ? 1 : -1;
270
- return o === "ascending" ? V : -V;
264
+ return s.value;
265
+ const { prop: e, order: a } = k.value;
266
+ return [...s.value].sort((d, p) => {
267
+ const m = d[e], D = p[e];
268
+ if (m === D) return 0;
269
+ const H = m > D ? 1 : -1;
270
+ return a === "ascending" ? H : -H;
271
271
  });
272
- }), $ = x(() => {
272
+ }), L = x(() => {
273
+ const e = {};
274
+ return t.height && (e.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (e.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), e;
275
+ }), w = x(() => {
276
+ const e = typeof t.operationWidth == "number" ? `${t.operationWidth}px` : t.operationWidth;
277
+ return { width: e, minWidth: e };
278
+ }), $ = x(() => [
279
+ i.b(),
280
+ i.is("border", t.border),
281
+ i.is("stripe", t.stripe),
282
+ i.is("loading", t.loading)
283
+ ]), K = (e) => {
284
+ e.sortable && (k.value.prop === e.prop ? k.value.order === "ascending" ? k.value.order = "descending" : k.value.order === "descending" && (k.value.order = null, k.value.prop = "") : (k.value.prop = e.prop, k.value.order = "ascending"), u("sort-change", { ...k.value }));
285
+ }, N = (e) => e.sortable ? k.value.prop !== e.prop ? i.is("sortable") : [
286
+ i.is("sortable"),
287
+ i.is(`sort-${k.value.order}`)
288
+ ] : "", V = (e, a, d) => {
289
+ const p = e[a.prop];
290
+ return a.formatter ? a.formatter(e, a, p, d) : p ?? "";
291
+ }, X = (e, a, d) => {
292
+ u("row-click", e, a, d);
293
+ }, E = (e, a, d) => {
294
+ const p = d.target;
295
+ u("cell-click", e, a, p, d);
296
+ }, z = () => {
297
+ M.value || C.value ? (b.value = [], M.value = !1, C.value = !1) : (b.value = [...s.value], M.value = !0, C.value = !1), u("select-all", b.value), u("selection-change", b.value);
298
+ }, W = (e) => {
299
+ const a = b.value.findIndex((d) => typeof t.rowKey == "function" ? t.rowKey(d) === t.rowKey(e) : t.rowKey ? d[t.rowKey] === e[t.rowKey] : d === e);
300
+ a > -1 ? b.value.splice(a, 1) : b.value.push(e), M.value = b.value.length === s.value.length, C.value = b.value.length > 0 && b.value.length < s.value.length, u("selection-change", b.value);
301
+ }, Z = (e) => b.value.some((a) => typeof t.rowKey == "function" ? t.rowKey(a) === t.rowKey(e) : t.rowKey ? a[t.rowKey] === e[t.rowKey] : a === e), O = (e) => {
273
302
  const a = {};
274
- return e.height && (a.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (a.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), a;
275
- }), C = x(() => {
276
- const a = typeof e.operationWidth == "number" ? `${e.operationWidth}px` : e.operationWidth;
277
- return { width: a, minWidth: a };
278
- }), S = x(() => [
279
- r.b(),
280
- r.is("border", e.border),
281
- r.is("stripe", e.stripe),
282
- r.is("loading", e.loading)
283
- ]), K = (a) => {
284
- a.sortable && (k.value.prop === a.prop ? k.value.order === "ascending" ? k.value.order = "descending" : k.value.order === "descending" && (k.value.order = null, k.value.prop = "") : (k.value.prop = a.prop, k.value.order = "ascending"), y("sort-change", { ...k.value }));
285
- }, N = (a) => a.sortable ? k.value.prop !== a.prop ? r.is("sortable") : [
286
- r.is("sortable"),
287
- r.is(`sort-${k.value.order}`)
288
- ] : "", Z = (a, o, p) => {
289
- const v = a[o.prop];
290
- return o.formatter ? o.formatter(a, o, v, p) : v ?? "";
291
- }, Y = (a, o, p) => {
292
- y("row-click", a, o, p);
293
- }, E = (a, o, p) => {
294
- const v = p.target;
295
- y("cell-click", a, o, v, p);
296
- }, D = () => {
297
- I.value || w.value ? (b.value = [], I.value = !1, w.value = !1) : (b.value = [...n.value], I.value = !0, w.value = !1), y("select-all", b.value), y("selection-change", b.value);
298
- }, B = (a) => {
299
- const o = b.value.findIndex((p) => typeof e.rowKey == "function" ? e.rowKey(p) === e.rowKey(a) : e.rowKey ? p[e.rowKey] === a[e.rowKey] : p === a);
300
- o > -1 ? b.value.splice(o, 1) : b.value.push(a), I.value = b.value.length === n.value.length, w.value = b.value.length > 0 && b.value.length < n.value.length, y("selection-change", b.value);
301
- }, X = (a) => b.value.some((o) => typeof e.rowKey == "function" ? e.rowKey(o) === e.rowKey(a) : e.rowKey ? o[e.rowKey] === a[e.rowKey] : o === a), P = (a) => {
302
- const o = {};
303
- return a.width && (o.width = typeof a.width == "number" ? `${a.width}px` : a.width), a.minWidth && (o.minWidth = typeof a.minWidth == "number" ? `${a.minWidth}px` : a.minWidth), a.align && (o.textAlign = a.align), o;
304
- }, Q = (a) => {
305
- const o = a || {};
306
- e.columns.forEach((p) => {
307
- o[p.prop] === void 0 && (o[p.prop] = "");
308
- }), n.value = [...n.value, o], y("add-row", o);
309
- }, q = (a) => {
310
- const o = n.value[a];
311
- n.value = n.value.filter((p, v) => v !== a), y("delete-row", o, a);
303
+ return e.width && (a.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.minWidth && (a.minWidth = typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth), e.align && (a.textAlign = e.align), a;
304
+ }, Q = (e) => {
305
+ const a = e || {};
306
+ t.columns.forEach((d) => {
307
+ a[d.prop] === void 0 && (a[d.prop] = "");
308
+ }), s.value = [...s.value, a], u("add-row", a);
309
+ }, F = (e) => {
310
+ const a = s.value[e];
311
+ s.value = s.value.filter((d, p) => p !== e), u("delete-row", a, e);
312
312
  };
313
- return s({
313
+ return o({
314
314
  clearSelection: () => {
315
- b.value = [], I.value = !1, w.value = !1;
315
+ b.value = [], M.value = !1, C.value = !1;
316
316
  },
317
317
  getSelection: () => [...b.value],
318
318
  sortState: k,
319
319
  addRow: Q,
320
- deleteRow: q,
321
- getData: () => [...n.value]
322
- }), (a, o) => (c(), u("div", {
323
- class: f(S.value)
320
+ deleteRow: F,
321
+ getData: () => [...s.value]
322
+ }), (e, a) => (c(), h("div", {
323
+ class: g($.value)
324
324
  }, [
325
- l.showAddButton ? (c(), u("div", {
325
+ l.showAddButton ? (c(), h("div", {
326
326
  key: 0,
327
- class: f(h(r).e("toolbar"))
327
+ class: g(f(i).e("toolbar"))
328
328
  }, [
329
- j(a.$slots, "toolbar", {}, () => [
330
- m("button", {
331
- class: f(h(r).e("add-btn")),
332
- onClick: o[0] || (o[0] = (p) => Q())
333
- }, [...o[2] || (o[2] = [
334
- m("span", { class: "add-icon" }, "+", -1),
329
+ B(e.$slots, "toolbar", {}, () => [
330
+ y("button", {
331
+ class: g(f(i).e("add-btn")),
332
+ onClick: a[0] || (a[0] = (d) => Q())
333
+ }, [...a[2] || (a[2] = [
334
+ y("span", { class: "add-icon" }, "+", -1),
335
335
  J(" 新增一行 ", -1)
336
336
  ])], 2)
337
337
  ])
338
- ], 2)) : M("", !0),
339
- l.loading ? (c(), u("div", {
338
+ ], 2)) : S("", !0),
339
+ l.loading ? (c(), h("div", {
340
340
  key: 1,
341
- class: f(h(r).e("loading"))
342
- }, [...o[3] || (o[3] = [
343
- m("span", { class: "loading-spinner" }, null, -1),
344
- m("span", { class: "loading-text" }, "加载中...", -1)
345
- ])], 2)) : M("", !0),
346
- m("div", {
347
- class: f(h(r).e("wrapper")),
348
- style: L($.value)
341
+ class: g(f(i).e("loading"))
342
+ }, [...a[3] || (a[3] = [
343
+ y("span", { class: "loading-spinner" }, null, -1),
344
+ y("span", { class: "loading-text" }, "加载中...", -1)
345
+ ])], 2)) : S("", !0),
346
+ y("div", {
347
+ class: g(f(i).e("wrapper")),
348
+ style: j(L.value)
349
349
  }, [
350
- m("table", null, [
351
- l.showHeader ? (c(), u("thead", Ne, [
352
- m("tr", null, [
353
- l.rowKey ? (c(), u("th", {
350
+ y("table", null, [
351
+ l.showHeader ? (c(), h("thead", ze, [
352
+ y("tr", null, [
353
+ l.rowKey ? (c(), h("th", {
354
354
  key: 0,
355
- class: f([h(r).e("header-cell"), h(r).e("selection-cell")])
355
+ class: g([f(i).e("header-cell"), f(i).e("selection-cell")])
356
356
  }, [
357
- m("input", {
357
+ y("input", {
358
358
  type: "checkbox",
359
- checked: I.value,
360
- indeterminate: w.value,
361
- onChange: D
359
+ checked: M.value,
360
+ indeterminate: C.value,
361
+ onChange: z
362
362
  }, null, 40, De)
363
- ], 2)) : M("", !0),
364
- l.showIndex ? (c(), u("th", {
363
+ ], 2)) : S("", !0),
364
+ l.showIndex ? (c(), h("th", {
365
365
  key: 1,
366
- class: f(h(r).e("header-cell")),
366
+ class: g(f(i).e("header-cell")),
367
367
  style: { width: "60px" }
368
- }, " 序号 ", 2)) : M("", !0),
369
- (c(!0), u(R, null, U(l.columns, (p) => (c(), u("th", {
370
- key: p.prop,
371
- class: f([h(r).e("header-cell"), N(p)]),
372
- style: L(P(p)),
373
- onClick: (v) => K(p)
368
+ }, " 序号 ", 2)) : S("", !0),
369
+ (c(!0), h(R, null, U(l.columns, (d) => (c(), h("th", {
370
+ key: d.prop,
371
+ class: g([f(i).e("header-cell"), N(d)]),
372
+ style: j(O(d)),
373
+ onClick: (p) => K(d)
374
374
  }, [
375
- m("span", null, A(p.label), 1),
376
- p.sortable ? (c(), u("span", {
375
+ y("span", null, A(d.label), 1),
376
+ d.sortable ? (c(), h("span", {
377
377
  key: 0,
378
- class: f(h(r).e("sort-icon"))
379
- }, [...o[4] || (o[4] = [
380
- m("span", { class: "sort-arrow up" }, "▲", -1),
381
- m("span", { class: "sort-arrow down" }, "▼", -1)
382
- ])], 2)) : M("", !0)
383
- ], 14, ze))), 128)),
384
- l.showOperation ? (c(), u("th", {
378
+ class: g(f(i).e("sort-icon"))
379
+ }, [...a[4] || (a[4] = [
380
+ y("span", { class: "sort-arrow up" }, "▲", -1),
381
+ y("span", { class: "sort-arrow down" }, "▼", -1)
382
+ ])], 2)) : S("", !0)
383
+ ], 14, Ae))), 128)),
384
+ l.showOperation ? (c(), h("th", {
385
385
  key: 2,
386
- class: f(h(r).e("header-cell")),
387
- style: L(C.value)
388
- }, A(l.operationLabel), 7)) : M("", !0)
386
+ class: g(f(i).e("header-cell")),
387
+ style: j(w.value)
388
+ }, A(l.operationLabel), 7)) : S("", !0)
389
389
  ])
390
- ])) : M("", !0),
391
- m("tbody", null, [
392
- (c(!0), u(R, null, U(T.value, (p, v) => (c(), u("tr", {
393
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(p) : p[l.rowKey] : v,
394
- class: f([h(r).e("row"), h(r).is("selected", X(p))]),
395
- onClick: (z) => Y(p, l.columns[0], z)
390
+ ])) : S("", !0),
391
+ y("tbody", null, [
392
+ (c(!0), h(R, null, U(T.value, (d, p) => (c(), h("tr", {
393
+ key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(d) : d[l.rowKey] : p,
394
+ class: g([f(i).e("row"), f(i).is("selected", Z(d))]),
395
+ onClick: (m) => X(d, l.columns[0], m)
396
396
  }, [
397
- l.rowKey ? (c(), u("td", {
397
+ l.rowKey ? (c(), h("td", {
398
398
  key: 0,
399
- class: f(h(r).e("cell"))
399
+ class: g(f(i).e("cell"))
400
400
  }, [
401
- m("input", {
401
+ y("input", {
402
402
  type: "checkbox",
403
- checked: X(p),
404
- onClick: o[1] || (o[1] = re(() => {
403
+ checked: Z(d),
404
+ onClick: a[1] || (a[1] = de(() => {
405
405
  }, ["stop"])),
406
- onChange: (z) => B(p)
407
- }, null, 40, Te)
408
- ], 2)) : M("", !0),
409
- l.showIndex ? (c(), u("td", {
406
+ onChange: (m) => W(d)
407
+ }, null, 40, Ee)
408
+ ], 2)) : S("", !0),
409
+ l.showIndex ? (c(), h("td", {
410
410
  key: 1,
411
- class: f(h(r).e("cell"))
412
- }, A(v + 1), 3)) : M("", !0),
413
- (c(!0), u(R, null, U(l.columns, (z) => (c(), u("td", {
414
- key: z.prop,
415
- class: f(h(r).e("cell")),
416
- style: L(P(z)),
417
- onClick: (W) => E(p, z, W)
411
+ class: g(f(i).e("cell"))
412
+ }, A(p + 1), 3)) : S("", !0),
413
+ (c(!0), h(R, null, U(l.columns, (m) => (c(), h("td", {
414
+ key: m.prop,
415
+ class: g(f(i).e("cell")),
416
+ style: j(O(m)),
417
+ onClick: (D) => E(d, m, D)
418
418
  }, [
419
- j(a.$slots, `column-${z.prop}`, {
420
- row: p,
421
- column: z,
422
- $index: v
419
+ B(e.$slots, `column-${m.prop}`, {
420
+ row: d,
421
+ column: m,
422
+ $index: p
423
423
  }, () => [
424
- J(A(Z(p, z, v)), 1)
424
+ J(A(V(d, m, p)), 1)
425
425
  ])
426
- ], 14, Ee))), 128)),
427
- l.showOperation ? (c(), u("td", {
426
+ ], 14, Le))), 128)),
427
+ l.showOperation ? (c(), h("td", {
428
428
  key: 2,
429
- class: f([h(r).e("cell"), h(r).e("operation-cell")])
429
+ class: g([f(i).e("cell"), f(i).e("operation-cell")])
430
430
  }, [
431
- j(a.$slots, "operation", {
432
- row: p,
433
- $index: v,
434
- deleteRow: () => q(v)
431
+ B(e.$slots, "operation", {
432
+ row: d,
433
+ $index: p,
434
+ deleteRow: () => F(p)
435
435
  }, () => [
436
- m("button", {
437
- class: f(h(r).e("operation-btn")),
438
- onClick: re((z) => q(v), ["stop"])
439
- }, " 删除 ", 10, Le)
436
+ y("button", {
437
+ class: g(f(i).e("operation-btn")),
438
+ onClick: de((m) => F(p), ["stop"])
439
+ }, " 删除 ", 10, je)
440
440
  ])
441
- ], 2)) : M("", !0)
442
- ], 10, Ae))), 128))
441
+ ], 2)) : S("", !0)
442
+ ], 10, Te))), 128))
443
443
  ]),
444
- T.value.length === 0 && !l.loading ? (c(), u("tbody", je, [
445
- m("tr", null, [
446
- m("td", {
444
+ T.value.length === 0 && !l.loading ? (c(), h("tbody", Be, [
445
+ y("tr", null, [
446
+ y("td", {
447
447
  colspan: l.columns.length + (l.rowKey ? 1 : 0) + (l.showIndex ? 1 : 0) + (l.showOperation ? 1 : 0),
448
- class: f(h(r).e("empty"))
448
+ class: g(f(i).e("empty"))
449
449
  }, [
450
- j(a.$slots, "empty", {}, () => [
450
+ B(e.$slots, "empty", {}, () => [
451
451
  J(A(l.emptyText), 1)
452
452
  ])
453
- ], 10, Be)
453
+ ], 10, He)
454
454
  ])
455
- ])) : M("", !0)
455
+ ])) : S("", !0)
456
456
  ])
457
457
  ], 6)
458
458
  ], 2));
459
459
  }
460
- }), He = ["draggable"], Pe = {
460
+ }), Pe = ["draggable"], We = {
461
461
  key: 0,
462
462
  class: "x-tree-node__loading-icon"
463
- }, We = {
463
+ }, Re = {
464
464
  key: 0,
465
465
  class: "x-tree-node__expand-arrow"
466
- }, Re = {
466
+ }, Oe = {
467
467
  key: 0,
468
468
  class: "x-tree-node__icon"
469
- }, Oe = { class: "x-tree-node__label" }, Ge = /* @__PURE__ */ O({
469
+ }, Ge = { class: "x-tree-node__label" }, Ye = /* @__PURE__ */ G({
470
470
  name: "XTreeNode",
471
471
  __name: "tree-node",
472
472
  props: {
473
473
  node: {}
474
474
  },
475
475
  setup(l) {
476
- const s = l, i = le("tree"), { props: e, store: y, toggleExpand: r, toggleCheck: n, handleNodeClick: k, handleNodeContextmenu: b } = i, I = H(), w = H(null), T = x(() => s.node.expanded), $ = x(() => s.node.checked), C = x(() => s.node.indeterminate), S = x(() => s.node.disabled), K = x(() => s.node.loading), N = x(() => s.node.isLeaf), Z = x(() => e.showCheckbox || e.checkable), Y = x(() => s.node.selected), E = x(() => ({
477
- paddingLeft: `${s.node.level * (e.indent || 16)}px`
478
- })), D = (t) => {
479
- k(s.node, t);
480
- }, B = (t) => {
481
- b(s.node, t);
482
- }, X = (t) => {
483
- t.stopPropagation(), S.value || r(s.node);
484
- }, P = (t) => {
485
- t.stopPropagation(), S.value || n(s.node);
486
- }, Q = (t) => {
487
- var a;
488
- if (!(!e.draggable || S.value)) {
489
- if (e.allowDrag && !e.allowDrag(s.node)) {
490
- t.preventDefault();
476
+ const o = l, r = oe("tree"), { props: t, store: u, toggleExpand: i, toggleCheck: s, handleNodeClick: k, handleNodeContextmenu: b } = r, M = P(), C = P(null), T = x(() => o.node.expanded), L = x(() => o.node.checked), w = x(() => o.node.indeterminate), $ = x(() => o.node.disabled), K = x(() => o.node.loading), N = x(() => o.node.isLeaf), V = x(() => t.showCheckbox || t.checkable), X = x(() => o.node.selected), E = x(() => ({
477
+ paddingLeft: `${o.node.level * (t.indent || 16)}px`
478
+ })), z = (n) => {
479
+ k(o.node, n);
480
+ }, W = (n) => {
481
+ b(o.node, n);
482
+ }, Z = (n) => {
483
+ n.stopPropagation(), $.value || i(o.node);
484
+ }, O = (n) => {
485
+ n.stopPropagation(), $.value || s(o.node);
486
+ }, Q = (n) => {
487
+ var e;
488
+ if (!(!t.draggable || $.value)) {
489
+ if (t.allowDrag && !t.allowDrag(o.node)) {
490
+ n.preventDefault();
491
491
  return;
492
492
  }
493
- t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("nodeKey", String(s.node.key)), (a = i.emit) == null || a.call(i, "node-drag-start", s.node, t);
493
+ n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData("nodeKey", String(o.node.key)), (e = r.emit) == null || e.call(r, "node-drag-start", o.node, n);
494
494
  }
495
- }, q = (t) => {
496
- var a;
497
- t.preventDefault(), e.draggable && (w.value = "inner", (a = i.emit) == null || a.call(i, "node-drag-enter", s.node, t));
498
- }, _ = (t) => {
499
- var a;
500
- w.value = null, (a = i.emit) == null || a.call(i, "node-drag-leave", s.node, t);
501
- }, ee = (t) => {
502
- var v, z;
503
- if (t.preventDefault(), !e.draggable || S.value) return;
504
- const a = (v = I.value) == null ? void 0 : v.getBoundingClientRect();
505
- if (!a) return;
506
- const o = t.clientY - a.top, p = a.height;
507
- o < p * 0.25 ? w.value = "prev" : o > p * 0.75 ? w.value = "next" : w.value = "inner", (z = i.emit) == null || z.call(i, "node-drag-over", s.node, t);
508
- }, d = (t) => {
509
- var o, p;
510
- if (t.preventDefault(), !e.draggable) return;
511
- const a = (o = t.dataTransfer) == null ? void 0 : o.getData("nodeKey");
512
- if (a) {
513
- const v = y.nodesMap.get(a);
514
- if (v && w.value) {
515
- if (e.allowDrop && !e.allowDrop(v, s.node, w.value)) {
516
- w.value = null;
495
+ }, F = (n) => {
496
+ var e;
497
+ n.preventDefault(), t.draggable && (C.value = "inner", (e = r.emit) == null || e.call(r, "node-drag-enter", o.node, n));
498
+ }, _ = (n) => {
499
+ var e;
500
+ C.value = null, (e = r.emit) == null || e.call(r, "node-drag-leave", o.node, n);
501
+ }, ae = (n) => {
502
+ var p, m;
503
+ if (n.preventDefault(), !t.draggable || $.value) return;
504
+ const e = (p = M.value) == null ? void 0 : p.getBoundingClientRect();
505
+ if (!e) return;
506
+ const a = n.clientY - e.top, d = e.height;
507
+ a < d * 0.25 ? C.value = "prev" : a > d * 0.75 ? C.value = "next" : C.value = "inner", (m = r.emit) == null || m.call(r, "node-drag-over", o.node, n);
508
+ }, v = (n) => {
509
+ var a, d;
510
+ if (n.preventDefault(), !t.draggable) return;
511
+ const e = (a = n.dataTransfer) == null ? void 0 : a.getData("nodeKey");
512
+ if (e) {
513
+ const p = u.nodesMap.get(e);
514
+ if (p && C.value) {
515
+ if (t.allowDrop && !t.allowDrop(p, o.node, C.value)) {
516
+ C.value = null;
517
517
  return;
518
518
  }
519
- (p = i.emit) == null || p.call(i, "node-drop", v, s.node, w.value, t);
519
+ (d = r.emit) == null || d.call(r, "node-drop", p, o.node, C.value, n);
520
520
  }
521
521
  }
522
- w.value = null;
523
- }, g = (t) => {
524
- var a;
525
- w.value = null, (a = i.emit) == null || a.call(i, "node-drag-end", s.node, t);
522
+ C.value = null;
523
+ }, I = (n) => {
524
+ var e;
525
+ C.value = null, (e = r.emit) == null || e.call(r, "node-drag-end", o.node, n);
526
526
  };
527
- return (t, a) => {
528
- var p;
529
- const o = ye("TreeNode", !0);
530
- return ge((c(), u("div", {
527
+ return (n, e) => {
528
+ var d;
529
+ const a = ye("TreeNode", !0);
530
+ return ve((c(), h("div", {
531
531
  ref_key: "nodeRef",
532
- ref: I,
533
- class: f(["x-tree-node", {
532
+ ref: M,
533
+ class: g(["x-tree-node", {
534
534
  "is-expanded": T.value,
535
- "is-current": t.isCurrent,
536
- "is-selected": Y.value,
537
- "is-disabled": S.value,
538
- "is-drop-inner": w.value === "inner",
539
- "is-drop-prev": w.value === "prev",
540
- "is-drop-next": w.value === "next"
535
+ "is-current": n.isCurrent,
536
+ "is-selected": X.value,
537
+ "is-disabled": $.value,
538
+ "is-drop-inner": C.value === "inner",
539
+ "is-drop-prev": C.value === "prev",
540
+ "is-drop-next": C.value === "next"
541
541
  }]),
542
- draggable: h(e).draggable && !S.value,
542
+ draggable: f(t).draggable && !$.value,
543
543
  onDragstart: Q,
544
- onDragenter: q,
544
+ onDragenter: F,
545
545
  onDragleave: _,
546
- onDragover: ee,
547
- onDrop: d,
548
- onDragend: g
546
+ onDragover: ae,
547
+ onDrop: v,
548
+ onDragend: I
549
549
  }, [
550
- m("div", {
550
+ y("div", {
551
551
  class: "x-tree-node__content",
552
- style: L(E.value),
553
- onClick: D,
554
- onContextmenu: B
552
+ style: j(E.value),
553
+ onClick: z,
554
+ onContextmenu: W
555
555
  }, [
556
- m("span", {
557
- class: f(["x-tree-node__expand-icon", {
556
+ y("span", {
557
+ class: g(["x-tree-node__expand-icon", {
558
558
  "is-expanded": T.value,
559
559
  "is-leaf": N.value,
560
560
  "is-loading": K.value
561
561
  }]),
562
- onClick: X
562
+ onClick: Z
563
563
  }, [
564
- K.value ? (c(), u("span", Pe)) : (c(), u(R, { key: 1 }, [
565
- N.value ? M("", !0) : (c(), u("span", We))
564
+ K.value ? (c(), h("span", We)) : (c(), h(R, { key: 1 }, [
565
+ N.value ? S("", !0) : (c(), h("span", Re))
566
566
  ], 64))
567
567
  ], 2),
568
- l.node.icon || h(e).icon ? (c(), u("span", Re, A(l.node.icon || h(e).icon), 1)) : M("", !0),
569
- Z.value ? (c(), u("span", {
568
+ l.node.icon || f(t).icon ? (c(), h("span", Oe, A(l.node.icon || f(t).icon), 1)) : S("", !0),
569
+ V.value ? (c(), h("span", {
570
570
  key: 1,
571
- class: f(["x-tree-node__checkbox", {
572
- "is-checked": $.value,
573
- "is-indeterminate": C.value,
574
- "is-disabled": S.value
571
+ class: g(["x-tree-node__checkbox", {
572
+ "is-checked": L.value,
573
+ "is-indeterminate": w.value,
574
+ "is-disabled": $.value
575
575
  }]),
576
- onClick: re(P, ["stop"])
577
- }, [...a[0] || (a[0] = [
578
- m("span", { class: "x-tree-node__checkbox-inner" }, null, -1)
579
- ])], 2)) : M("", !0),
580
- m("span", Oe, [
581
- j(t.$slots, "default", {
576
+ onClick: de(O, ["stop"])
577
+ }, [...e[0] || (e[0] = [
578
+ y("span", { class: "x-tree-node__checkbox-inner" }, null, -1)
579
+ ])], 2)) : S("", !0),
580
+ y("span", Ge, [
581
+ B(n.$slots, "default", {
582
582
  node: l.node,
583
583
  data: l.node.data
584
584
  }, () => [
@@ -586,71 +586,71 @@ const ft = /* @__PURE__ */ O({
586
586
  ])
587
587
  ])
588
588
  ], 36),
589
- !N.value && T.value ? (c(), u("div", {
589
+ !N.value && T.value ? (c(), h("div", {
590
590
  key: 0,
591
- class: f(["x-tree-node__children", { "x-tree-node__children--show-line": h(e).showLine }])
591
+ class: g(["x-tree-node__children", { "x-tree-node__children--show-line": f(t).showLine }])
592
592
  }, [
593
- !h(e).renderAfterExpand || T.value ? (c(!0), u(R, { key: 0 }, U(l.node.children, (v) => (c(), ae(o, {
594
- key: v.key,
595
- node: v
593
+ !f(t).renderAfterExpand || T.value ? (c(!0), h(R, { key: 0 }, U(l.node.children, (p) => (c(), se(a, {
594
+ key: p.key,
595
+ node: p
596
596
  }, {
597
- default: ce((z) => [
598
- j(t.$slots, "default", {
599
- node: z.node,
600
- data: z.data
597
+ default: he((m) => [
598
+ B(n.$slots, "default", {
599
+ node: m.node,
600
+ data: m.data
601
601
  })
602
602
  ]),
603
603
  _: 3
604
- }, 8, ["node"]))), 128)) : M("", !0)
605
- ], 2)) : M("", !0)
606
- ], 42, He)), [
607
- [ve, l.node.visible && (((p = l.node.parent) == null ? void 0 : p.expanded) ?? !0)]
604
+ }, 8, ["node"]))), 128)) : S("", !0)
605
+ ], 2)) : S("", !0)
606
+ ], 42, Pe)), [
607
+ [me, l.node.visible && (((d = l.node.parent) == null ? void 0 : d.expanded) ?? !0)]
608
608
  ]);
609
609
  };
610
610
  }
611
611
  });
612
612
  class te {
613
- constructor(s, i, e = 0, y = null) {
614
- this.data = s, this.store = i, this.level = e, this.parent = y, this.children = [], this.expanded = !1, this.selected = !1, this.checked = !1, this.indeterminate = !1, this.loading = !1, this.visible = !0, this.loaded = !1;
615
- const r = i.props || {}, n = r.value || "value", k = r.label || "label", b = r.disabled || "disabled", I = r.isLeaf || "isLeaf";
616
- this.key = s[n] ?? s.value ?? s.id ?? Math.random().toString(), this.label = s[k] ?? s.label ?? "", this.disabled = s[b] ?? s.disabled ?? !1, this.isLeaf = s[I] ?? s.isLeaf ?? !1;
617
- const w = r.children || "children", T = s[w] ?? s.children ?? [];
613
+ constructor(o, r, t = 0, u = null) {
614
+ this.data = o, this.store = r, this.level = t, this.parent = u, this.children = [], this.expanded = !1, this.selected = !1, this.checked = !1, this.indeterminate = !1, this.loading = !1, this.visible = !0, this.loaded = !1;
615
+ const i = r.props || {}, s = i.value || "value", k = i.label || "label", b = i.disabled || "disabled", M = i.isLeaf || "isLeaf";
616
+ this.key = o[s] ?? o.value ?? o.id ?? Math.random().toString(), this.label = o[k] ?? o.label ?? "", this.disabled = o[b] ?? o.disabled ?? !1, this.isLeaf = o[M] ?? o.isLeaf ?? !1;
617
+ const C = i.children || "children", T = o[C] ?? o.children ?? [];
618
618
  T.length > 0 ? this.children = T.map(
619
- ($) => new te($, i, e + 1, this)
619
+ (L) => new te(L, r, t + 1, this)
620
620
  ) : this.isLeaf = !0;
621
621
  }
622
622
  /** 设置展开状态 */
623
- setExpanded(s, i = !0) {
624
- this.expanded = s, s ? this.store.expandedKeys.add(this.key) : this.store.expandedKeys.delete(this.key);
623
+ setExpanded(o, r = !0) {
624
+ this.expanded = o, o ? this.store.expandedKeys.add(this.key) : this.store.expandedKeys.delete(this.key);
625
625
  }
626
626
  /** 设置选中状态 */
627
- setSelected(s) {
628
- this.selected = s, s ? this.store.selectedKeys.add(this.key) : this.store.selectedKeys.delete(this.key);
627
+ setSelected(o) {
628
+ this.selected = o, o ? this.store.selectedKeys.add(this.key) : this.store.selectedKeys.delete(this.key);
629
629
  }
630
630
  /** 设置勾选状态 */
631
- setChecked(s, i = !0, e = !0) {
632
- this.checked = s, this.indeterminate = !1, s ? (this.store.checkedKeys.add(this.key), this.store.indeterminateKeys.delete(this.key)) : (this.store.checkedKeys.delete(this.key), this.store.indeterminateKeys.delete(this.key)), i && (this.updateChildrenChecked(s), this.updateParentChecked());
631
+ setChecked(o, r = !0, t = !0) {
632
+ this.checked = o, this.indeterminate = !1, o ? (this.store.checkedKeys.add(this.key), this.store.indeterminateKeys.delete(this.key)) : (this.store.checkedKeys.delete(this.key), this.store.indeterminateKeys.delete(this.key)), r && (this.updateChildrenChecked(o), this.updateParentChecked());
633
633
  }
634
634
  /** 更新子节点勾选状态 */
635
- updateChildrenChecked(s) {
636
- const i = (e) => {
637
- e.children.forEach((y) => {
638
- y.disabled || (y.checked = s, y.indeterminate = !1, s ? (this.store.checkedKeys.add(y.key), this.store.indeterminateKeys.delete(y.key)) : (this.store.checkedKeys.delete(y.key), this.store.indeterminateKeys.delete(y.key)), i(y));
635
+ updateChildrenChecked(o) {
636
+ const r = (t) => {
637
+ t.children.forEach((u) => {
638
+ u.disabled || (u.checked = o, u.indeterminate = !1, o ? (this.store.checkedKeys.add(u.key), this.store.indeterminateKeys.delete(u.key)) : (this.store.checkedKeys.delete(u.key), this.store.indeterminateKeys.delete(u.key)), r(u));
639
639
  });
640
640
  };
641
- i(this);
641
+ r(this);
642
642
  }
643
643
  /** 更新父节点勾选状态 */
644
644
  updateParentChecked() {
645
- let s = this.parent;
646
- for (; s; ) {
647
- const i = s.children.filter((r) => !r.disabled);
648
- if (i.length === 0) {
649
- s = s.parent;
645
+ let o = this.parent;
646
+ for (; o; ) {
647
+ const r = o.children.filter((i) => !i.disabled);
648
+ if (r.length === 0) {
649
+ o = o.parent;
650
650
  continue;
651
651
  }
652
- const e = i.every((r) => r.checked), y = i.some((r) => r.checked || r.indeterminate);
653
- e ? (s.checked = !0, s.indeterminate = !1, this.store.checkedKeys.add(s.key), this.store.indeterminateKeys.delete(s.key)) : y ? (s.checked = !1, s.indeterminate = !0, this.store.checkedKeys.delete(s.key), this.store.indeterminateKeys.add(s.key)) : (s.checked = !1, s.indeterminate = !1, this.store.checkedKeys.delete(s.key), this.store.indeterminateKeys.delete(s.key)), s = s.parent;
652
+ const t = r.every((i) => i.checked), u = r.some((i) => i.checked || i.indeterminate);
653
+ t ? (o.checked = !0, o.indeterminate = !1, this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) : u ? (o.checked = !1, o.indeterminate = !0, this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.add(o.key)) : (o.checked = !1, o.indeterminate = !1, this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.delete(o.key)), o = o.parent;
654
654
  }
655
655
  }
656
656
  /** 展开/收起 */
@@ -667,23 +667,23 @@ class te {
667
667
  }
668
668
  /** 获取所有父节点的 key */
669
669
  getParentKeys() {
670
- const s = [];
671
- let i = this.parent;
672
- for (; i; )
673
- s.push(i.key), i = i.parent;
674
- return s;
670
+ const o = [];
671
+ let r = this.parent;
672
+ for (; r; )
673
+ o.push(r.key), r = r.parent;
674
+ return o;
675
675
  }
676
676
  /** 获取所有子节点的 key */
677
677
  getChildrenKeys() {
678
- const s = [], i = (e) => {
679
- e.forEach((y) => {
680
- s.push(y.key), y.children.length && i(y.children);
678
+ const o = [], r = (t) => {
679
+ t.forEach((u) => {
680
+ o.push(u.key), u.children.length && r(u.children);
681
681
  });
682
682
  };
683
- return i(this.children), s;
683
+ return r(this.children), o;
684
684
  }
685
685
  }
686
- const vt = /* @__PURE__ */ O({
686
+ const mt = /* @__PURE__ */ G({
687
687
  name: "XTree",
688
688
  __name: "index",
689
689
  props: {
@@ -724,8 +724,8 @@ const vt = /* @__PURE__ */ O({
724
724
  checkable: { type: Boolean }
725
725
  },
726
726
  emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop"],
727
- setup(l, { expose: s, emit: i }) {
728
- const e = l, y = i, r = G("tree"), n = he({
727
+ setup(l, { expose: o, emit: r }) {
728
+ const t = l, u = r, i = Y("tree"), s = fe({
729
729
  nodesMap: /* @__PURE__ */ new Map(),
730
730
  rootNodes: [],
731
731
  expandedKeys: /* @__PURE__ */ new Set(),
@@ -734,258 +734,258 @@ const vt = /* @__PURE__ */ O({
734
734
  indeterminateKeys: /* @__PURE__ */ new Set(),
735
735
  currentKey: null,
736
736
  filterValue: ""
737
- }), k = H(""), b = () => e.fieldNames ? {
738
- value: e.fieldNames.key || "value",
739
- label: e.fieldNames.title || e.fieldNames.key || "label",
740
- children: e.fieldNames.children || "children",
741
- disabled: e.fieldNames.disabled || "disabled",
742
- isLeaf: e.fieldNames.isLeaf || "isLeaf"
743
- } : e.props, I = () => e.treeData || e.data || [];
744
- n.props = b();
745
- const w = (t) => {
746
- if (n.nodesMap.clear(), n.rootNodes = [], n.checkedKeys.clear(), n.indeterminateKeys.clear(), !t || !t.length) return;
747
- const a = b(), o = (p, v, z) => {
748
- const W = new te(p, n, v, z);
749
- n.nodesMap.set(W.key, W);
750
- const V = (a == null ? void 0 : a.children) || "children", ue = p[V] ?? p.children ?? [];
751
- return ue.length > 0 && (W.children = ue.map(
752
- (pe) => o(pe, v + 1, W)
753
- ), W.isLeaf = !1), W;
737
+ }), k = P(""), b = () => t.fieldNames ? {
738
+ value: t.fieldNames.key || "value",
739
+ label: t.fieldNames.title || t.fieldNames.key || "label",
740
+ children: t.fieldNames.children || "children",
741
+ disabled: t.fieldNames.disabled || "disabled",
742
+ isLeaf: t.fieldNames.isLeaf || "isLeaf"
743
+ } : t.props, M = () => t.treeData || t.data || [];
744
+ s.props = b();
745
+ const C = (n) => {
746
+ if (s.nodesMap.clear(), s.rootNodes = [], s.checkedKeys.clear(), s.indeterminateKeys.clear(), !n || !n.length) return;
747
+ const e = b(), a = (d, p, m) => {
748
+ const D = new te(d, s, p, m);
749
+ s.nodesMap.set(D.key, D);
750
+ const H = (e == null ? void 0 : e.children) || "children", ee = d[H] ?? d.children ?? [];
751
+ return ee.length > 0 && (D.children = ee.map(
752
+ (ne) => a(ne, p + 1, D)
753
+ ), D.isLeaf = !1), D;
754
754
  };
755
- n.rootNodes = t.map((p) => o(p, 0, null)), T();
755
+ s.rootNodes = n.map((d) => a(d, 0, null)), T();
756
756
  }, T = () => {
757
- var t, a, o;
758
- e.defaultExpandAll ? $() : (t = e.defaultExpandedKeys) != null && t.length && e.defaultExpandedKeys.forEach((p) => {
759
- const v = n.nodesMap.get(p);
760
- v && (v.expanded = !0, n.expandedKeys.add(p));
761
- }), (a = e.defaultCheckedKeys) != null && a.length && e.defaultCheckedKeys.forEach((p) => {
762
- const v = n.nodesMap.get(p);
763
- v && v.setChecked(!0, !e.checkStrictly);
764
- }), (o = e.checkedKeys) != null && o.length && e.checkedKeys.forEach((p) => {
765
- const v = n.nodesMap.get(p);
766
- v && v.setChecked(!0, !e.checkStrictly);
757
+ var n, e, a;
758
+ t.defaultExpandAll ? L() : (n = t.defaultExpandedKeys) != null && n.length && t.defaultExpandedKeys.forEach((d) => {
759
+ const p = s.nodesMap.get(d);
760
+ p && (p.expanded = !0, s.expandedKeys.add(d));
761
+ }), (e = t.defaultCheckedKeys) != null && e.length && t.defaultCheckedKeys.forEach((d) => {
762
+ const p = s.nodesMap.get(d);
763
+ p && p.setChecked(!0, !t.checkStrictly);
764
+ }), (a = t.checkedKeys) != null && a.length && t.checkedKeys.forEach((d) => {
765
+ const p = s.nodesMap.get(d);
766
+ p && p.setChecked(!0, !t.checkStrictly);
767
767
  });
768
- }, $ = () => {
769
- n.nodesMap.forEach((t) => {
770
- t.children.length > 0 && (t.expanded = !0, n.expandedKeys.add(t.key));
768
+ }, L = () => {
769
+ s.nodesMap.forEach((n) => {
770
+ n.children.length > 0 && (n.expanded = !0, s.expandedKeys.add(n.key));
771
771
  });
772
- }, C = () => {
773
- n.nodesMap.forEach((t) => {
774
- t.expanded = !1;
775
- }), n.expandedKeys.clear();
776
- }, S = (t) => {
777
- if (t.disabled) return;
778
- !t.expanded ? (t.expanded = !0, n.expandedKeys.add(t.key), y("node-expand", t.data, t, null)) : (t.expanded = !1, n.expandedKeys.delete(t.key), y("node-collapse", t.data, t, null));
779
- }, K = (t, a) => {
780
- if (t.disabled) return;
781
- const o = a ?? !t.checked;
782
- t.setChecked(o, !e.checkStrictly), y("check-change", t.data, t.checked, t.indeterminate);
783
- const p = [], v = [], z = [], W = [];
784
- n.nodesMap.forEach((V) => {
785
- V.checked && (p.push(V.data), v.push(V.key)), V.indeterminate && (z.push(V.data), W.push(V.key));
786
- }), y("check", t.data, {
787
- checkedNodes: p,
788
- checkedKeys: v,
789
- halfCheckedNodes: z,
790
- halfCheckedKeys: W
772
+ }, w = () => {
773
+ s.nodesMap.forEach((n) => {
774
+ n.expanded = !1;
775
+ }), s.expandedKeys.clear();
776
+ }, $ = (n) => {
777
+ if (n.disabled) return;
778
+ !n.expanded ? (n.expanded = !0, s.expandedKeys.add(n.key), u("node-expand", n.data, n, null)) : (n.expanded = !1, s.expandedKeys.delete(n.key), u("node-collapse", n.data, n, null));
779
+ }, K = (n, e) => {
780
+ if (n.disabled) return;
781
+ const a = e ?? !n.checked;
782
+ n.setChecked(a, !t.checkStrictly), u("check-change", n.data, n.checked, n.indeterminate);
783
+ const d = [], p = [], m = [], D = [];
784
+ s.nodesMap.forEach((H) => {
785
+ H.checked && (d.push(H.data), p.push(H.key)), H.indeterminate && (m.push(H.data), D.push(H.key));
786
+ }), u("check", n.data, {
787
+ checkedNodes: d,
788
+ checkedKeys: p,
789
+ halfCheckedNodes: m,
790
+ halfCheckedKeys: D
791
791
  });
792
- }, N = (t, a) => {
793
- t.disabled || (y("node-click", t.data, t, null), e.expandOnClickNode && t.children.length > 0 && S(t), e.highlightCurrent && (n.currentKey = t.key, y("current-change", t.data, t)));
794
- }, Z = (t) => {
795
- if (k.value = t, n.filterValue = t, !t) {
796
- n.nodesMap.forEach((a) => {
797
- a.visible = !0;
792
+ }, N = (n, e) => {
793
+ n.disabled || (u("node-click", n.data, n, null), t.expandOnClickNode && n.children.length > 0 && $(n), t.highlightCurrent && (s.currentKey = n.key, u("current-change", n.data, n)));
794
+ }, V = (n) => {
795
+ if (k.value = n, s.filterValue = n, !n) {
796
+ s.nodesMap.forEach((e) => {
797
+ e.visible = !0;
798
798
  });
799
799
  return;
800
800
  }
801
- n.nodesMap.forEach((a) => {
802
- const o = a.label || "";
803
- a.visible = String(o).toLowerCase().includes(t.toLowerCase());
804
- }), n.nodesMap.forEach((a) => {
805
- if (a.visible && a.parent) {
806
- let o = a.parent;
807
- for (; o; )
808
- o.visible = !0, o.expanded = !0, n.expandedKeys.add(o.key), o = o.parent;
801
+ s.nodesMap.forEach((e) => {
802
+ const a = e.label || "";
803
+ e.visible = String(a).toLowerCase().includes(n.toLowerCase());
804
+ }), s.nodesMap.forEach((e) => {
805
+ if (e.visible && e.parent) {
806
+ let a = e.parent;
807
+ for (; a; )
808
+ a.visible = !0, a.expanded = !0, s.expandedKeys.add(a.key), a = a.parent;
809
809
  }
810
810
  });
811
- }, Y = (t) => n.nodesMap.get(t), E = (t) => {
812
- n.currentKey = t;
813
- }, D = () => {
814
- if (n.currentKey)
815
- return n.nodesMap.get(n.currentKey);
816
- }, B = (t = !1) => {
817
- const a = [];
818
- return n.nodesMap.forEach((o) => {
819
- o.checked && (!t || o.isLeaf) && a.push(o.data);
820
- }), a;
821
- }, X = (t = !1) => {
822
- const a = [];
823
- return n.nodesMap.forEach((o) => {
824
- o.checked && (!t || o.isLeaf) && a.push(o.key);
825
- }), a;
826
- }, P = (t) => {
827
- n.nodesMap.forEach((a) => {
828
- a.checked = !1, a.indeterminate = !1;
829
- }), n.checkedKeys.clear(), n.indeterminateKeys.clear(), t.forEach((a) => {
830
- const o = n.nodesMap.get(a);
831
- o && o.setChecked(!0, !e.checkStrictly);
811
+ }, X = (n) => s.nodesMap.get(n), E = (n) => {
812
+ s.currentKey = n;
813
+ }, z = () => {
814
+ if (s.currentKey)
815
+ return s.nodesMap.get(s.currentKey);
816
+ }, W = (n = !1) => {
817
+ const e = [];
818
+ return s.nodesMap.forEach((a) => {
819
+ a.checked && (!n || a.isLeaf) && e.push(a.data);
820
+ }), e;
821
+ }, Z = (n = !1) => {
822
+ const e = [];
823
+ return s.nodesMap.forEach((a) => {
824
+ a.checked && (!n || a.isLeaf) && e.push(a.key);
825
+ }), e;
826
+ }, O = (n) => {
827
+ s.nodesMap.forEach((e) => {
828
+ e.checked = !1, e.indeterminate = !1;
829
+ }), s.checkedKeys.clear(), s.indeterminateKeys.clear(), n.forEach((e) => {
830
+ const a = s.nodesMap.get(e);
831
+ a && a.setChecked(!0, !t.checkStrictly);
832
832
  });
833
833
  }, Q = () => {
834
- const t = [];
835
- return n.nodesMap.forEach((a) => {
836
- a.indeterminate && t.push(a.data);
837
- }), t;
838
- }, q = () => {
839
- const t = [];
840
- return n.nodesMap.forEach((a) => {
841
- a.indeterminate && t.push(a.key);
842
- }), t;
843
- }, _ = (t, a, o = !0) => {
844
- const p = n.nodesMap.get(t);
845
- p && p.setChecked(a, o && !e.checkStrictly);
846
- }, ee = () => {
847
- const t = [];
848
- return n.nodesMap.forEach((a) => {
849
- a.selected && t.push(a.data);
850
- }), t;
851
- }, d = (t) => {
852
- n.nodesMap.forEach((a) => {
853
- a.selected = !1;
854
- }), n.selectedKeys.clear(), t.forEach((a) => {
855
- const o = n.nodesMap.get(a);
856
- o && (o.selected = !0, n.selectedKeys.add(a));
834
+ const n = [];
835
+ return s.nodesMap.forEach((e) => {
836
+ e.indeterminate && n.push(e.data);
837
+ }), n;
838
+ }, F = () => {
839
+ const n = [];
840
+ return s.nodesMap.forEach((e) => {
841
+ e.indeterminate && n.push(e.key);
842
+ }), n;
843
+ }, _ = (n, e, a = !0) => {
844
+ const d = s.nodesMap.get(n);
845
+ d && d.setChecked(e, a && !t.checkStrictly);
846
+ }, ae = () => {
847
+ const n = [];
848
+ return s.nodesMap.forEach((e) => {
849
+ e.selected && n.push(e.data);
850
+ }), n;
851
+ }, v = (n) => {
852
+ s.nodesMap.forEach((e) => {
853
+ e.selected = !1;
854
+ }), s.selectedKeys.clear(), n.forEach((e) => {
855
+ const a = s.nodesMap.get(e);
856
+ a && (a.selected = !0, s.selectedKeys.add(e));
857
857
  });
858
- }, g = x(() => e.showCheckbox || e.checkable);
859
- return ne("tree", {
860
- props: e,
861
- store: n,
862
- emit: y,
863
- toggleExpand: S,
858
+ }, I = x(() => t.showCheckbox || t.checkable);
859
+ return le("tree", {
860
+ props: t,
861
+ store: s,
862
+ emit: u,
863
+ toggleExpand: $,
864
864
  toggleCheck: K,
865
865
  handleNodeClick: N,
866
- filterValue: me(k),
867
- showCheckboxComputed: g
868
- }), s({
869
- filter: Z,
870
- getNode: Y,
866
+ filterValue: ke(k),
867
+ showCheckboxComputed: I
868
+ }), o({
869
+ filter: V,
870
+ getNode: X,
871
871
  setCurrentKey: E,
872
- getCurrentKey: () => n.currentKey,
873
- getCurrentNode: D,
874
- getCheckedNodes: B,
875
- getCheckedKeys: X,
876
- setCheckedKeys: P,
872
+ getCurrentKey: () => s.currentKey,
873
+ getCurrentNode: z,
874
+ getCheckedNodes: W,
875
+ getCheckedKeys: Z,
876
+ setCheckedKeys: O,
877
877
  getHalfCheckedNodes: Q,
878
- getHalfCheckedKeys: q,
878
+ getHalfCheckedKeys: F,
879
879
  setChecked: _,
880
- getSelectedNodes: ee,
881
- setSelectedKeys: d,
882
- expandAll: $,
883
- collapseAll: C,
880
+ getSelectedNodes: ae,
881
+ setSelectedKeys: v,
882
+ expandAll: L,
883
+ collapseAll: w,
884
884
  // 额外方法
885
- updateKeyChildren: (t, a) => {
886
- const o = n.nodesMap.get(t);
887
- o && (o.children.forEach((p) => {
888
- n.nodesMap.delete(p.key);
889
- }), o.children = a.map((p) => {
890
- const v = new te(p, n, o.level + 1, o);
891
- return n.nodesMap.set(v.key, v), v;
892
- }), o.isLeaf = o.children.length === 0);
885
+ updateKeyChildren: (n, e) => {
886
+ const a = s.nodesMap.get(n);
887
+ a && (a.children.forEach((d) => {
888
+ s.nodesMap.delete(d.key);
889
+ }), a.children = e.map((d) => {
890
+ const p = new te(d, s, a.level + 1, a);
891
+ return s.nodesMap.set(p.key, p), p;
892
+ }), a.isLeaf = a.children.length === 0);
893
893
  },
894
- remove: (t) => {
895
- const a = n.nodesMap.get(t);
896
- if (a) {
897
- const o = a.parent;
898
- if (o) {
899
- const v = o.children.indexOf(a);
900
- v > -1 && o.children.splice(v, 1), o.children.length === 0 && (o.isLeaf = !0);
894
+ remove: (n) => {
895
+ const e = s.nodesMap.get(n);
896
+ if (e) {
897
+ const a = e.parent;
898
+ if (a) {
899
+ const p = a.children.indexOf(e);
900
+ p > -1 && a.children.splice(p, 1), a.children.length === 0 && (a.isLeaf = !0);
901
901
  } else {
902
- const v = n.rootNodes.indexOf(a);
903
- v > -1 && n.rootNodes.splice(v, 1);
902
+ const p = s.rootNodes.indexOf(e);
903
+ p > -1 && s.rootNodes.splice(p, 1);
904
904
  }
905
- const p = (v) => {
906
- n.nodesMap.delete(v.key), v.children.forEach(p);
905
+ const d = (p) => {
906
+ s.nodesMap.delete(p.key), p.children.forEach(d);
907
907
  };
908
- p(a);
908
+ d(e);
909
909
  }
910
910
  },
911
- append: (t, a) => {
912
- if (a) {
913
- const o = n.nodesMap.get(a);
914
- if (o) {
915
- const p = new te(t, n, o.level + 1, o);
916
- n.nodesMap.set(p.key, p), o.children.push(p), o.isLeaf = !1;
911
+ append: (n, e) => {
912
+ if (e) {
913
+ const a = s.nodesMap.get(e);
914
+ if (a) {
915
+ const d = new te(n, s, a.level + 1, a);
916
+ s.nodesMap.set(d.key, d), a.children.push(d), a.isLeaf = !1;
917
917
  }
918
918
  } else {
919
- const o = new te(t, n, 0, null);
920
- n.nodesMap.set(o.key, o), n.rootNodes.push(o);
919
+ const a = new te(n, s, 0, null);
920
+ s.nodesMap.set(a.key, a), s.rootNodes.push(a);
921
921
  }
922
922
  },
923
- insertBefore: (t, a) => {
924
- var p;
925
- const o = n.nodesMap.get(a);
926
- if (o) {
927
- const v = new te(t, n, o.level, o.parent);
928
- n.nodesMap.set(v.key, v);
929
- const z = ((p = o.parent) == null ? void 0 : p.children) || n.rootNodes, W = z.indexOf(o);
930
- z.splice(W, 0, v);
923
+ insertBefore: (n, e) => {
924
+ var d;
925
+ const a = s.nodesMap.get(e);
926
+ if (a) {
927
+ const p = new te(n, s, a.level, a.parent);
928
+ s.nodesMap.set(p.key, p);
929
+ const m = ((d = a.parent) == null ? void 0 : d.children) || s.rootNodes, D = m.indexOf(a);
930
+ m.splice(D, 0, p);
931
931
  }
932
932
  },
933
- insertAfter: (t, a) => {
934
- var p;
935
- const o = n.nodesMap.get(a);
936
- if (o) {
937
- const v = new te(t, n, o.level, o.parent);
938
- n.nodesMap.set(v.key, v);
939
- const z = ((p = o.parent) == null ? void 0 : p.children) || n.rootNodes, W = z.indexOf(o);
940
- z.splice(W + 1, 0, v);
933
+ insertAfter: (n, e) => {
934
+ var d;
935
+ const a = s.nodesMap.get(e);
936
+ if (a) {
937
+ const p = new te(n, s, a.level, a.parent);
938
+ s.nodesMap.set(p.key, p);
939
+ const m = ((d = a.parent) == null ? void 0 : d.children) || s.rootNodes, D = m.indexOf(a);
940
+ m.splice(D + 1, 0, p);
941
941
  }
942
942
  }
943
- }), F(
944
- () => [e.treeData, e.data],
943
+ }), q(
944
+ () => [t.treeData, t.data],
945
945
  () => {
946
- w(I());
946
+ C(M());
947
947
  },
948
948
  { immediate: !0, deep: !0 }
949
- ), F(
950
- () => e.checkedKeys,
951
- (t) => {
952
- t && P(t);
949
+ ), q(
950
+ () => t.checkedKeys,
951
+ (n) => {
952
+ n && O(n);
953
953
  },
954
954
  { immediate: !0, deep: !0 }
955
- ), F(
956
- () => e.defaultCheckedKeys,
957
- (t) => {
958
- t && t.length > 0 && !e.checkedKeys && P(t);
955
+ ), q(
956
+ () => t.defaultCheckedKeys,
957
+ (n) => {
958
+ n && n.length > 0 && !t.checkedKeys && O(n);
959
959
  },
960
960
  { immediate: !0, deep: !0 }
961
- ), (t, a) => (c(), u("div", {
962
- class: f([h(r).b(), h(r).m(l.size)])
961
+ ), (n, e) => (c(), h("div", {
962
+ class: g([f(i).b(), f(i).m(l.size)])
963
963
  }, [
964
- (c(!0), u(R, null, U(n.rootNodes, (o) => (c(), ae(Ge, {
965
- key: o.key,
966
- node: o
964
+ (c(!0), h(R, null, U(s.rootNodes, (a) => (c(), se(Ye, {
965
+ key: a.key,
966
+ node: a
967
967
  }, {
968
- default: ce((p) => [
969
- j(t.$slots, "default", {
970
- node: p.node,
971
- data: p.data
968
+ default: he((d) => [
969
+ B(n.$slots, "default", {
970
+ node: d.node,
971
+ data: d.data
972
972
  }, () => [
973
- J(A(p.node.label), 1)
973
+ J(A(d.node.label), 1)
974
974
  ])
975
975
  ]),
976
976
  _: 2
977
977
  }, 1032, ["node"]))), 128)),
978
- n.rootNodes.length ? M("", !0) : (c(), u("div", {
978
+ s.rootNodes.length ? S("", !0) : (c(), h("div", {
979
979
  key: 0,
980
- class: f(h(r).e("empty"))
980
+ class: g(f(i).e("empty"))
981
981
  }, [
982
- j(t.$slots, "empty", {}, () => [
982
+ B(n.$slots, "empty", {}, () => [
983
983
  J(A(l.emptyText), 1)
984
984
  ])
985
985
  ], 2))
986
986
  ], 2));
987
987
  }
988
- }), Ye = ["src"], Xe = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", mt = /* @__PURE__ */ O({
988
+ }), Xe = ["src"], Qe = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", kt = /* @__PURE__ */ G({
989
989
  name: "XEmpty",
990
990
  __name: "index",
991
991
  props: {
@@ -995,69 +995,69 @@ const vt = /* @__PURE__ */ O({
995
995
  size: { default: "default" }
996
996
  },
997
997
  setup(l) {
998
- const s = l, i = G("empty"), e = x(() => {
999
- const r = {};
1000
- return s.imageSize && (r.height = `${s.imageSize}px`, r.width = `${s.imageSize}px`), r;
1001
- }), y = x(() => s.description || "暂无数据");
1002
- return (r, n) => (c(), u("div", {
1003
- class: f([h(i).b(), h(i).m(l.size)])
998
+ const o = l, r = Y("empty"), t = x(() => {
999
+ const i = {};
1000
+ return o.imageSize && (i.height = `${o.imageSize}px`, i.width = `${o.imageSize}px`), i;
1001
+ }), u = x(() => o.description || "暂无数据");
1002
+ return (i, s) => (c(), h("div", {
1003
+ class: g([f(r).b(), f(r).m(l.size)])
1004
1004
  }, [
1005
- m("div", {
1006
- class: f(h(i).e("image")),
1007
- style: L(e.value)
1005
+ y("div", {
1006
+ class: g(f(r).e("image")),
1007
+ style: j(t.value)
1008
1008
  }, [
1009
- j(r.$slots, "image", {}, () => [
1010
- l.image ? (c(), u("img", {
1009
+ B(i.$slots, "image", {}, () => [
1010
+ l.image ? (c(), h("img", {
1011
1011
  key: 0,
1012
1012
  src: l.image,
1013
- style: L(e.value),
1013
+ style: j(t.value),
1014
1014
  draggable: "false"
1015
- }, null, 12, Ye)) : (c(), u("img", {
1015
+ }, null, 12, Xe)) : (c(), h("img", {
1016
1016
  key: 1,
1017
- src: Xe,
1018
- style: L(e.value),
1017
+ src: Qe,
1018
+ style: j(t.value),
1019
1019
  draggable: "false"
1020
1020
  }, null, 4))
1021
1021
  ])
1022
1022
  ], 6),
1023
- m("div", {
1024
- class: f(h(i).e("description"))
1023
+ y("div", {
1024
+ class: g(f(r).e("description"))
1025
1025
  }, [
1026
- j(r.$slots, "description", {}, () => [
1027
- m("p", null, A(y.value), 1)
1026
+ B(i.$slots, "description", {}, () => [
1027
+ y("p", null, A(u.value), 1)
1028
1028
  ])
1029
1029
  ], 2),
1030
- r.$slots.default ? (c(), u("div", {
1030
+ i.$slots.default ? (c(), h("div", {
1031
1031
  key: 0,
1032
- class: f(h(i).e("bottom"))
1032
+ class: g(f(r).e("bottom"))
1033
1033
  }, [
1034
- j(r.$slots, "default")
1035
- ], 2)) : M("", !0)
1034
+ B(i.$slots, "default")
1035
+ ], 2)) : S("", !0)
1036
1036
  ], 2));
1037
1037
  }
1038
- }), kt = /* @__PURE__ */ O({
1038
+ }), xt = /* @__PURE__ */ G({
1039
1039
  name: "XTimeline",
1040
1040
  __name: "index",
1041
1041
  props: {
1042
1042
  direction: { default: "vertical" }
1043
1043
  },
1044
1044
  setup(l) {
1045
- const s = l, i = G("timeline");
1046
- ne("timeline", {
1047
- props: s
1045
+ const o = l, r = Y("timeline");
1046
+ le("timeline", {
1047
+ props: o
1048
1048
  });
1049
- const e = x(() => [
1050
- i.b(),
1051
- i.m(s.direction)
1049
+ const t = x(() => [
1050
+ r.b(),
1051
+ r.m(o.direction)
1052
1052
  ]);
1053
- return (y, r) => (c(), u("ul", {
1054
- class: f(e.value),
1053
+ return (u, i) => (c(), h("ul", {
1054
+ class: g(t.value),
1055
1055
  role: "timeline"
1056
1056
  }, [
1057
- j(y.$slots, "default")
1057
+ B(u.$slots, "default")
1058
1058
  ], 2));
1059
1059
  }
1060
- }), bt = /* @__PURE__ */ O({
1060
+ }), bt = /* @__PURE__ */ G({
1061
1061
  name: "XTimelineItem",
1062
1062
  __name: "TimelineItem",
1063
1063
  props: {
@@ -1069,51 +1069,51 @@ const vt = /* @__PURE__ */ O({
1069
1069
  placement: { default: "bottom" }
1070
1070
  },
1071
1071
  setup(l) {
1072
- const s = l, i = G("timeline-item"), e = {
1072
+ const o = l, r = Y("timeline-item"), t = {
1073
1073
  primary: "#409eff",
1074
1074
  success: "#67c23a",
1075
1075
  warning: "#e6a23c",
1076
1076
  danger: "#f56c6c",
1077
1077
  info: "#909399"
1078
- }, y = x(() => {
1079
- const n = {};
1080
- return s.color ? n.backgroundColor = s.color : s.type && e[s.type] && (n.backgroundColor = e[s.type]), n;
1081
- }), r = x(() => [
1082
- i.b(),
1083
- i.m(s.size)
1078
+ }, u = x(() => {
1079
+ const s = {};
1080
+ return o.color ? s.backgroundColor = o.color : o.type && t[o.type] && (s.backgroundColor = t[o.type]), s;
1081
+ }), i = x(() => [
1082
+ r.b(),
1083
+ r.m(o.size)
1084
1084
  ]);
1085
- return (n, k) => (c(), u("li", {
1086
- class: f(r.value)
1085
+ return (s, k) => (c(), h("li", {
1086
+ class: g(i.value)
1087
1087
  }, [
1088
- m("div", {
1089
- class: f(h(i).e("node")),
1090
- style: L(y.value)
1088
+ y("div", {
1089
+ class: g(f(r).e("node")),
1090
+ style: j(u.value)
1091
1091
  }, [
1092
- j(n.$slots, "dot")
1092
+ B(s.$slots, "dot")
1093
1093
  ], 6),
1094
- m("div", {
1095
- class: f(h(i).e("tail"))
1094
+ y("div", {
1095
+ class: g(f(r).e("tail"))
1096
1096
  }, null, 2),
1097
- m("div", {
1098
- class: f(h(i).e("wrapper"))
1097
+ y("div", {
1098
+ class: g(f(r).e("wrapper"))
1099
1099
  }, [
1100
- !l.hideTimestamp && l.timestamp && l.placement === "top" ? (c(), u("div", {
1100
+ !l.hideTimestamp && l.timestamp && l.placement === "top" ? (c(), h("div", {
1101
1101
  key: 0,
1102
- class: f(h(i).e("timestamp"))
1103
- }, A(l.timestamp), 3)) : M("", !0),
1104
- m("div", {
1105
- class: f(h(i).e("content"))
1102
+ class: g(f(r).e("timestamp"))
1103
+ }, A(l.timestamp), 3)) : S("", !0),
1104
+ y("div", {
1105
+ class: g(f(r).e("content"))
1106
1106
  }, [
1107
- j(n.$slots, "default")
1107
+ B(s.$slots, "default")
1108
1108
  ], 2),
1109
- !l.hideTimestamp && l.timestamp && l.placement === "bottom" ? (c(), u("div", {
1109
+ !l.hideTimestamp && l.timestamp && l.placement === "bottom" ? (c(), h("div", {
1110
1110
  key: 1,
1111
- class: f(h(i).e("timestamp"))
1112
- }, A(l.timestamp), 3)) : M("", !0)
1111
+ class: g(f(r).e("timestamp"))
1112
+ }, A(l.timestamp), 3)) : S("", !0)
1113
1113
  ], 2)
1114
1114
  ], 2));
1115
1115
  }
1116
- }), Qe = ["onMouseenter", "onClick"], xt = /* @__PURE__ */ O({
1116
+ }), Ze = ["onMouseenter", "onClick"], Ct = /* @__PURE__ */ G({
1117
1117
  name: "XCarousel",
1118
1118
  __name: "index",
1119
1119
  props: {
@@ -1127,115 +1127,115 @@ const vt = /* @__PURE__ */ O({
1127
1127
  height: { default: 300 }
1128
1128
  },
1129
1129
  emits: ["update:activeIndex", "change"],
1130
- setup(l, { expose: s, emit: i }) {
1131
- const e = l, y = i, r = G("carousel"), n = H(e.activeIndex), k = H(0), b = H(null), I = H(!1);
1132
- ne("carousel", {
1133
- currentIndex: n,
1130
+ setup(l, { expose: o, emit: r }) {
1131
+ const t = l, u = r, i = Y("carousel"), s = P(t.activeIndex), k = P(0), b = P(null), M = P(!1);
1132
+ le("carousel", {
1133
+ currentIndex: s,
1134
1134
  itemCount: k
1135
1135
  });
1136
- const w = (B) => {
1137
- const X = n.value;
1138
- e.loop ? n.value = (B + k.value) % k.value : n.value = Math.max(0, Math.min(B, k.value - 1)), y("update:activeIndex", n.value), y("change", n.value, X);
1136
+ const C = (W) => {
1137
+ const Z = s.value;
1138
+ t.loop ? s.value = (W + k.value) % k.value : s.value = Math.max(0, Math.min(W, k.value - 1)), u("update:activeIndex", s.value), u("change", s.value, Z);
1139
1139
  }, T = () => {
1140
- w(n.value - 1);
1140
+ C(s.value - 1);
1141
+ }, L = () => {
1142
+ C(s.value + 1);
1143
+ }, w = () => {
1144
+ t.autoplay && k.value > 1 && ($(), b.value = setInterval(() => {
1145
+ M.value || L();
1146
+ }, t.interval));
1141
1147
  }, $ = () => {
1142
- w(n.value + 1);
1143
- }, C = () => {
1144
- e.autoplay && k.value > 1 && (S(), b.value = setInterval(() => {
1145
- I.value || $();
1146
- }, e.interval));
1147
- }, S = () => {
1148
1148
  b.value && (clearInterval(b.value), b.value = null);
1149
1149
  }, K = () => {
1150
- I.value = !0, e.arrow;
1150
+ M.value = !0, t.arrow;
1151
1151
  }, N = () => {
1152
- I.value = !1;
1153
- }, Z = (B) => {
1154
- e.trigger === "hover" && w(B);
1155
- }, Y = (B) => {
1156
- e.trigger === "click" && w(B);
1152
+ M.value = !1;
1153
+ }, V = (W) => {
1154
+ t.trigger === "hover" && C(W);
1155
+ }, X = (W) => {
1156
+ t.trigger === "click" && C(W);
1157
1157
  }, E = x(() => ({
1158
- height: typeof e.height == "number" ? `${e.height}px` : e.height
1159
- })), D = x(() => [
1160
- r.b(),
1161
- r.m(`arrow-${e.arrow}`),
1162
- r.m(`indicator-${e.indicatorPosition}`)
1158
+ height: typeof t.height == "number" ? `${t.height}px` : t.height
1159
+ })), z = x(() => [
1160
+ i.b(),
1161
+ i.m(`arrow-${t.arrow}`),
1162
+ i.m(`indicator-${t.indicatorPosition}`)
1163
1163
  ]);
1164
- return F(() => e.activeIndex, (B) => {
1165
- n.value = B;
1166
- }), F(() => e.autoplay, () => {
1167
- C();
1168
- }), F(k, () => {
1169
- fe(() => {
1170
- C();
1164
+ return q(() => t.activeIndex, (W) => {
1165
+ s.value = W;
1166
+ }), q(() => t.autoplay, () => {
1167
+ w();
1168
+ }), q(k, () => {
1169
+ pe(() => {
1170
+ w();
1171
1171
  });
1172
- }), se(() => {
1173
- C();
1174
- }), oe(() => {
1175
- S();
1176
- }), s({
1172
+ }), ie(() => {
1173
+ w();
1174
+ }), re(() => {
1175
+ $();
1176
+ }), o({
1177
1177
  prev: T,
1178
- next: $,
1179
- setActiveItem: w
1180
- }), (B, X) => (c(), u("div", {
1181
- class: f(D.value),
1182
- style: L(E.value),
1178
+ next: L,
1179
+ setActiveItem: C
1180
+ }), (W, Z) => (c(), h("div", {
1181
+ class: g(z.value),
1182
+ style: j(E.value),
1183
1183
  onMouseenter: K,
1184
1184
  onMouseleave: N
1185
1185
  }, [
1186
- m("div", {
1187
- class: f(h(r).e("container"))
1186
+ y("div", {
1187
+ class: g(f(i).e("container"))
1188
1188
  }, [
1189
- j(B.$slots, "default")
1189
+ B(W.$slots, "default")
1190
1190
  ], 2),
1191
- l.arrow !== "never" ? (c(), u("button", {
1191
+ l.arrow !== "never" ? (c(), h("button", {
1192
1192
  key: 0,
1193
- class: f([h(r).e("arrow"), h(r).e("arrow-left")]),
1193
+ class: g([f(i).e("arrow"), f(i).e("arrow-left")]),
1194
1194
  onClick: T
1195
- }, " ‹ ", 2)) : M("", !0),
1196
- l.arrow !== "never" ? (c(), u("button", {
1195
+ }, " ‹ ", 2)) : S("", !0),
1196
+ l.arrow !== "never" ? (c(), h("button", {
1197
1197
  key: 1,
1198
- class: f([h(r).e("arrow"), h(r).e("arrow-right")]),
1199
- onClick: $
1200
- }, " › ", 2)) : M("", !0),
1201
- l.indicatorPosition !== "none" ? (c(), u("ul", {
1198
+ class: g([f(i).e("arrow"), f(i).e("arrow-right")]),
1199
+ onClick: L
1200
+ }, " › ", 2)) : S("", !0),
1201
+ l.indicatorPosition !== "none" ? (c(), h("ul", {
1202
1202
  key: 2,
1203
- class: f(h(r).e("indicators"))
1203
+ class: g(f(i).e("indicators"))
1204
1204
  }, [
1205
- (c(!0), u(R, null, U(k.value, (P) => (c(), u("li", {
1206
- key: P,
1207
- class: f([h(r).e("indicator"), h(r).is("active", P - 1 === n.value)]),
1208
- onMouseenter: (Q) => Z(P - 1),
1209
- onClick: (Q) => Y(P - 1)
1205
+ (c(!0), h(R, null, U(k.value, (O) => (c(), h("li", {
1206
+ key: O,
1207
+ class: g([f(i).e("indicator"), f(i).is("active", O - 1 === s.value)]),
1208
+ onMouseenter: (Q) => V(O - 1),
1209
+ onClick: (Q) => X(O - 1)
1210
1210
  }, [
1211
- m("button", {
1212
- class: f(h(r).e("indicator-btn"))
1211
+ y("button", {
1212
+ class: g(f(i).e("indicator-btn"))
1213
1213
  }, null, 2)
1214
- ], 42, Qe))), 128))
1215
- ], 2)) : M("", !0)
1214
+ ], 42, Ze))), 128))
1215
+ ], 2)) : S("", !0)
1216
1216
  ], 38));
1217
1217
  }
1218
- }), Ct = /* @__PURE__ */ O({
1218
+ }), wt = /* @__PURE__ */ G({
1219
1219
  name: "XCarouselItem",
1220
1220
  __name: "CarouselItem",
1221
1221
  setup(l) {
1222
- const s = G("carousel-item"), i = le("carousel"), e = H(-1);
1223
- se(() => {
1224
- i && (e.value = i.itemCount.value, i.itemCount.value++);
1225
- }), oe(() => {
1226
- i && i.itemCount.value--;
1222
+ const o = Y("carousel-item"), r = oe("carousel"), t = P(-1);
1223
+ ie(() => {
1224
+ r && (t.value = r.itemCount.value, r.itemCount.value++);
1225
+ }), re(() => {
1226
+ r && r.itemCount.value--;
1227
1227
  });
1228
- const y = x(() => i && e.value === i.currentIndex.value), r = x(() => [
1229
- s.b(),
1230
- s.is("active", y.value)
1228
+ const u = x(() => r && t.value === r.currentIndex.value), i = x(() => [
1229
+ o.b(),
1230
+ o.is("active", u.value)
1231
1231
  ]);
1232
- return (n, k) => (c(), u("div", {
1233
- class: f(r.value)
1232
+ return (s, k) => (c(), h("div", {
1233
+ class: g(i.value)
1234
1234
  }, [
1235
- j(n.$slots, "default")
1235
+ B(s.$slots, "default")
1236
1236
  ], 2));
1237
1237
  }
1238
- }), Ze = { key: 0 }, Ve = ["onClick"], Ue = ["onClick"], Je = ["onClick"], Fe = { key: 1 }, qe = ["colspan"], _e = { style: { display: "none" } }, wt = /* @__PURE__ */ O({
1238
+ }), Ve = { key: 0 }, Ue = ["onClick"], Fe = ["onClick"], Je = ["onClick"], qe = { key: 1 }, _e = ["colspan"], et = { style: { display: "none" } }, It = /* @__PURE__ */ G({
1239
1239
  name: "XTable",
1240
1240
  __name: "index",
1241
1241
  props: {
@@ -1252,161 +1252,196 @@ const vt = /* @__PURE__ */ O({
1252
1252
  pagination: {}
1253
1253
  },
1254
1254
  emits: ["sort-change", "row-click", "row-dblclick", "cell-click", "selection-change", "select-all", "page-change", "size-change"],
1255
- setup(l, { expose: s, emit: i }) {
1256
- var _, ee;
1257
- const e = l, y = i, r = G("table");
1258
- de();
1259
- const n = he(/* @__PURE__ */ new Map());
1260
- ne("x-table", {
1261
- registerColumn: (d, g) => {
1262
- n.set(d.prop, { config: d, slot: g });
1255
+ setup(l, { expose: o, emit: r }) {
1256
+ var I, n;
1257
+ const t = l, u = r, i = Y("table");
1258
+ ue();
1259
+ const s = fe([]);
1260
+ le("x-table", {
1261
+ registerColumn: (e, a) => {
1262
+ s.findIndex((p) => p.config.prop === e.prop) === -1 && s.push({ config: e, slot: a });
1263
1263
  },
1264
- unregisterColumn: (d) => {
1265
- n.delete(d);
1264
+ unregisterColumn: (e) => {
1265
+ const a = s.findIndex((d) => d.config.prop === e);
1266
+ a !== -1 && s.splice(a, 1);
1266
1267
  },
1267
- updateColumnSlot: (d, g) => {
1268
- const t = n.get(d);
1269
- t && (t.slot = g);
1268
+ updateColumnSlot: (e, a) => {
1269
+ const d = s.find((p) => p.config.prop === e);
1270
+ d && (d.slot = a);
1270
1271
  },
1271
- props: e
1272
+ props: t
1272
1273
  });
1273
- const w = x(() => Array.from(n.values()).map((d) => d.config)), T = x(() => {
1274
- const d = {};
1275
- return n.forEach((g, t) => {
1276
- g.slot && (d[t] = g.slot);
1277
- }), d;
1278
- }), $ = H({
1279
- prop: ((_ = e.defaultSort) == null ? void 0 : _.prop) || "",
1280
- order: ((ee = e.defaultSort) == null ? void 0 : ee.order) || null
1281
- }), C = x(() => {
1274
+ const C = x(() => {
1275
+ const e = s.map((m) => m.config), a = e.filter((m) => m.fixed === "left" || m.fixed === !0), d = e.filter((m) => !m.fixed), p = e.filter((m) => m.fixed === "right");
1276
+ return [...a, ...d, ...p];
1277
+ }), T = x(() => C.value.filter((e) => e.fixed === "left" || e.fixed === !0)), L = x(() => C.value.filter((e) => e.fixed === "right"));
1278
+ x(() => C.value.filter((e) => !e.fixed)), x(() => T.value.reduce((e, a) => {
1279
+ const d = a.width ? typeof a.width == "number" ? a.width : parseInt(a.width) : 100;
1280
+ return e + d;
1281
+ }, 0)), x(() => L.value.reduce((e, a) => {
1282
+ const d = a.width ? typeof a.width == "number" ? a.width : parseInt(a.width) : 100;
1283
+ return e + d;
1284
+ }, 0));
1285
+ const w = x(() => {
1286
+ const e = {};
1287
+ return s.forEach((a) => {
1288
+ a.slot && (e[a.config.prop] = a.slot);
1289
+ }), e;
1290
+ }), $ = P({
1291
+ prop: ((I = t.defaultSort) == null ? void 0 : I.prop) || "",
1292
+ order: ((n = t.defaultSort) == null ? void 0 : n.order) || null
1293
+ }), K = x(() => {
1282
1294
  if (!$.value.prop || !$.value.order)
1283
- return e.data;
1284
- const { prop: d, order: g } = $.value;
1285
- return [...e.data].sort((t, a) => {
1286
- const o = t[d], p = a[d];
1287
- if (o === p) return 0;
1288
- const v = o > p ? 1 : -1;
1289
- return g === "ascending" ? v : -v;
1295
+ return t.data;
1296
+ const { prop: e, order: a } = $.value;
1297
+ return [...t.data].sort((d, p) => {
1298
+ const m = d[e], D = p[e];
1299
+ if (m === D) return 0;
1300
+ const H = m > D ? 1 : -1;
1301
+ return a === "ascending" ? H : -H;
1290
1302
  });
1291
- }), S = x(() => {
1292
- const d = {};
1293
- return e.height && (d.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (d.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), d;
1294
- }), K = x(() => [
1295
- r.b(),
1296
- r.is("border", e.border),
1297
- r.is("stripe", e.stripe),
1298
- r.is("loading", e.loading)
1299
- ]), N = (d) => {
1300
- d.sortable && ($.value.prop === d.prop ? $.value.order === "ascending" ? $.value.order = "descending" : $.value.order === "descending" && ($.value.order = null, $.value.prop = "") : ($.value.prop = d.prop, $.value.order = "ascending"), y("sort-change", { ...$.value }));
1301
- }, Z = (d) => d.sortable ? $.value.prop !== d.prop ? r.is("sortable") : [
1302
- r.is("sortable"),
1303
- r.is(`sort-${$.value.order}`)
1304
- ] : "", Y = (d, g, t) => {
1305
- const a = d[g.prop];
1306
- return g.formatter ? g.formatter(d, g, a, t) : a ?? "";
1307
- }, E = (d, g) => {
1308
- y("row-click", d, w.value[0], g);
1309
- }, D = (d, g, t) => {
1310
- const a = t.target;
1311
- y("cell-click", d, g, a, t);
1312
- }, B = (d) => {
1313
- y("page-change", d);
1314
- }, X = (d) => {
1315
- y("size-change", d);
1316
- }, P = (d) => {
1317
- const g = {};
1318
- return d.width && (g.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (g.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (g.textAlign = d.align), g;
1303
+ }), N = x(() => {
1304
+ const e = {};
1305
+ return t.height && (e.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (e.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), e;
1306
+ }), V = x(() => [
1307
+ i.b(),
1308
+ i.is("border", t.border),
1309
+ i.is("stripe", t.stripe),
1310
+ i.is("loading", t.loading),
1311
+ i.is("has-fixed", T.value.length > 0 || L.value.length > 0)
1312
+ ]), X = (e) => {
1313
+ e.sortable && ($.value.prop === e.prop ? $.value.order === "ascending" ? $.value.order = "descending" : $.value.order === "descending" && ($.value.order = null, $.value.prop = "") : ($.value.prop = e.prop, $.value.order = "ascending"), u("sort-change", { ...$.value }));
1314
+ }, E = (e) => e.sortable ? $.value.prop !== e.prop ? i.is("sortable") : [
1315
+ i.is("sortable"),
1316
+ i.is(`sort-${$.value.order}`)
1317
+ ] : "", z = (e, a, d) => {
1318
+ const p = e[a.prop];
1319
+ return a.formatter ? a.formatter(e, a, p, d) : p ?? "";
1320
+ }, W = (e, a) => {
1321
+ u("row-click", e, C.value[0], a);
1322
+ }, Z = (e, a, d) => {
1323
+ const p = d.target;
1324
+ u("cell-click", e, a, p, d);
1325
+ }, O = (e) => {
1326
+ u("page-change", e);
1327
+ }, Q = (e) => {
1328
+ u("size-change", e);
1329
+ }, F = (e, a, d) => {
1330
+ const p = {};
1331
+ if (e.width && (p.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.minWidth && (p.minWidth = typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth), e.align && (p.textAlign = e.align), (e.fixed === "left" || e.fixed === !0) && (p.position = "sticky", p.left = "0px", p.zIndex = "2", a !== void 0 && a > 0)) {
1332
+ let m = 0;
1333
+ for (let D = 0; D < a; D++) {
1334
+ const H = T.value[D], ee = H.width ? typeof H.width == "number" ? H.width : parseInt(H.width) : 100;
1335
+ m += ee;
1336
+ }
1337
+ p.left = `${m}px`;
1338
+ }
1339
+ if (e.fixed === "right" && (p.position = "sticky", p.right = "0px", p.zIndex = "2", a !== void 0)) {
1340
+ const m = L.value, D = m.length - 1 - a;
1341
+ if (D > 0) {
1342
+ let H = 0;
1343
+ for (let ee = 0; ee < D; ee++) {
1344
+ const ne = m[m.length - 1 - ee], ge = ne.width ? typeof ne.width == "number" ? ne.width : parseInt(ne.width) : 100;
1345
+ H += ge;
1346
+ }
1347
+ p.right = `${H}px`;
1348
+ }
1349
+ }
1350
+ return p;
1351
+ }, _ = (e) => {
1352
+ const a = [];
1353
+ return (e.fixed === "left" || e.fixed === !0) && a.push(i.is("fixed-left")), e.fixed === "right" && a.push(i.is("fixed-right")), a;
1319
1354
  };
1320
- return s({
1355
+ return o({
1321
1356
  clearSelection: () => {
1322
1357
  },
1323
1358
  getSelection: () => [],
1324
1359
  sortState: $,
1325
- columns: w
1326
- }), (d, g) => (c(), u("div", {
1327
- class: f(K.value)
1360
+ columns: C
1361
+ }), (e, a) => (c(), h("div", {
1362
+ class: g(V.value)
1328
1363
  }, [
1329
- l.loading ? (c(), u("div", {
1364
+ l.loading ? (c(), h("div", {
1330
1365
  key: 0,
1331
- class: f(h(r).e("loading"))
1332
- }, [...g[0] || (g[0] = [
1333
- m("span", { class: "loading-spinner" }, null, -1),
1334
- m("span", { class: "loading-text" }, "加载中...", -1)
1335
- ])], 2)) : M("", !0),
1336
- m("div", {
1337
- class: f(h(r).e("wrapper")),
1338
- style: L(S.value)
1366
+ class: g(f(i).e("loading"))
1367
+ }, [...a[0] || (a[0] = [
1368
+ y("span", { class: "loading-spinner" }, null, -1),
1369
+ y("span", { class: "loading-text" }, "加载中...", -1)
1370
+ ])], 2)) : S("", !0),
1371
+ y("div", {
1372
+ class: g(f(i).e("wrapper")),
1373
+ style: j(N.value)
1339
1374
  }, [
1340
- m("table", null, [
1341
- l.showHeader ? (c(), u("thead", Ze, [
1342
- m("tr", null, [
1343
- (c(!0), u(R, null, U(w.value, (t) => (c(), u("th", {
1344
- key: t.prop,
1345
- class: f([h(r).e("header-cell"), Z(t)]),
1346
- style: L(P(t)),
1347
- onClick: (a) => N(t)
1375
+ y("table", null, [
1376
+ l.showHeader ? (c(), h("thead", Ve, [
1377
+ y("tr", null, [
1378
+ (c(!0), h(R, null, U(C.value, (d, p) => (c(), h("th", {
1379
+ key: d.prop,
1380
+ class: g([f(i).e("header-cell"), E(d), ..._(d)]),
1381
+ style: j(F(d, d.fixed === "right" ? L.value.indexOf(d) : p)),
1382
+ onClick: (m) => X(d)
1348
1383
  }, [
1349
- m("span", null, A(t.label), 1),
1350
- t.sortable ? (c(), u("span", {
1384
+ y("span", null, A(d.label), 1),
1385
+ d.sortable ? (c(), h("span", {
1351
1386
  key: 0,
1352
- class: f(h(r).e("sort-icon"))
1353
- }, [...g[1] || (g[1] = [
1354
- m("span", { class: "sort-arrow up" }, "▲", -1),
1355
- m("span", { class: "sort-arrow down" }, "▼", -1)
1356
- ])], 2)) : M("", !0)
1357
- ], 14, Ve))), 128))
1387
+ class: g(f(i).e("sort-icon"))
1388
+ }, [...a[1] || (a[1] = [
1389
+ y("span", { class: "sort-arrow up" }, "▲", -1),
1390
+ y("span", { class: "sort-arrow down" }, "▼", -1)
1391
+ ])], 2)) : S("", !0)
1392
+ ], 14, Ue))), 128))
1358
1393
  ])
1359
- ])) : M("", !0),
1360
- m("tbody", null, [
1361
- (c(!0), u(R, null, U(C.value, (t, a) => (c(), u("tr", {
1362
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(t) : t[l.rowKey] : a,
1363
- class: f([h(r).e("row")]),
1364
- onClick: (o) => E(t, o)
1394
+ ])) : S("", !0),
1395
+ y("tbody", null, [
1396
+ (c(!0), h(R, null, U(K.value, (d, p) => (c(), h("tr", {
1397
+ key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(d) : d[l.rowKey] : p,
1398
+ class: g([f(i).e("row")]),
1399
+ onClick: (m) => W(d, m)
1365
1400
  }, [
1366
- (c(!0), u(R, null, U(w.value, (o) => (c(), u("td", {
1367
- key: o.prop,
1368
- class: f(h(r).e("cell")),
1369
- style: L(P(o)),
1370
- onClick: (p) => D(t, o, p)
1401
+ (c(!0), h(R, null, U(C.value, (m, D) => (c(), h("td", {
1402
+ key: m.prop,
1403
+ class: g([f(i).e("cell"), ..._(m)]),
1404
+ style: j(F(m, m.fixed === "right" ? L.value.indexOf(m) : D)),
1405
+ onClick: (H) => Z(d, m, H)
1371
1406
  }, [
1372
- T.value[o.prop] ? (c(), ae(ie(() => T.value[o.prop]({ row: t, column: o, $index: a })), { key: 0 })) : (c(), u(R, { key: 1 }, [
1373
- J(A(Y(t, o, a)), 1)
1407
+ w.value[m.prop] ? (c(), se(ce(() => w.value[m.prop]({ row: d, column: m, $index: p })), { key: 0 })) : (c(), h(R, { key: 1 }, [
1408
+ J(A(z(d, m, p)), 1)
1374
1409
  ], 64))
1375
1410
  ], 14, Je))), 128))
1376
- ], 10, Ue))), 128))
1411
+ ], 10, Fe))), 128))
1377
1412
  ]),
1378
- C.value.length === 0 && !l.loading ? (c(), u("tbody", Fe, [
1379
- m("tr", null, [
1380
- m("td", {
1381
- colspan: w.value.length || 1,
1382
- class: f(h(r).e("empty"))
1413
+ K.value.length === 0 && !l.loading ? (c(), h("tbody", qe, [
1414
+ y("tr", null, [
1415
+ y("td", {
1416
+ colspan: C.value.length || 1,
1417
+ class: g(f(i).e("empty"))
1383
1418
  }, [
1384
- j(d.$slots, "empty", {}, () => [
1419
+ B(e.$slots, "empty", {}, () => [
1385
1420
  J(A(l.emptyText), 1)
1386
1421
  ])
1387
- ], 10, qe)
1422
+ ], 10, _e)
1388
1423
  ])
1389
- ])) : M("", !0)
1424
+ ])) : S("", !0)
1390
1425
  ])
1391
1426
  ], 6),
1392
- l.pagination ? (c(), u("div", {
1427
+ l.pagination ? (c(), h("div", {
1393
1428
  key: 1,
1394
- class: f(h(r).e("pagination"))
1429
+ class: g(f(i).e("pagination"))
1395
1430
  }, [
1396
- ke(Ke, {
1431
+ xe(Ne, {
1397
1432
  total: l.pagination.total,
1398
1433
  "current-page": l.pagination.current,
1399
1434
  "page-size": l.pagination.pageSize,
1400
- onCurrentChange: B,
1401
- onSizeChange: X
1435
+ onCurrentChange: O,
1436
+ onSizeChange: Q
1402
1437
  }, null, 8, ["total", "current-page", "page-size"])
1403
- ], 2)) : M("", !0),
1404
- m("div", _e, [
1405
- j(d.$slots, "default")
1438
+ ], 2)) : S("", !0),
1439
+ y("div", et, [
1440
+ B(e.$slots, "default")
1406
1441
  ])
1407
1442
  ], 2));
1408
1443
  }
1409
- }), It = /* @__PURE__ */ O({
1444
+ }), $t = /* @__PURE__ */ G({
1410
1445
  name: "XTableColumn",
1411
1446
  __name: "TableColumn",
1412
1447
  props: {
@@ -1420,27 +1455,27 @@ const vt = /* @__PURE__ */ O({
1420
1455
  formatter: {}
1421
1456
  },
1422
1457
  setup(l) {
1423
- const s = l;
1424
- G("table-column");
1425
- const i = de(), e = le("x-table"), y = x(() => ({
1426
- prop: s.prop,
1427
- label: s.label,
1428
- width: s.width,
1429
- minWidth: s.minWidth,
1430
- align: s.align,
1431
- sortable: s.sortable,
1432
- fixed: s.fixed,
1433
- formatter: s.formatter
1458
+ const o = l;
1459
+ Y("table-column");
1460
+ const r = ue(), t = P(`column_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`), u = oe("x-table"), i = x(() => ({
1461
+ prop: o.prop || t.value,
1462
+ label: o.label,
1463
+ width: o.width,
1464
+ minWidth: o.minWidth,
1465
+ align: o.align,
1466
+ sortable: o.sortable,
1467
+ fixed: o.fixed,
1468
+ formatter: o.formatter
1434
1469
  }));
1435
- return se(() => {
1436
- e != null && e.registerColumn && e.registerColumn(y.value, i.default);
1437
- }), F(() => i.default, (r) => {
1438
- e != null && e.updateColumnSlot && r && e.updateColumnSlot(s.prop, r);
1439
- }, { immediate: !0 }), oe(() => {
1440
- e != null && e.unregisterColumn && e.unregisterColumn(s.prop);
1441
- }), (r, n) => null;
1470
+ return ie(() => {
1471
+ u != null && u.registerColumn && u.registerColumn(i.value, r.default);
1472
+ }), q(() => r.default, (s) => {
1473
+ u != null && u.updateColumnSlot && s && u.updateColumnSlot(o.prop || t.value, s);
1474
+ }, { immediate: !0 }), re(() => {
1475
+ u != null && u.unregisterColumn && u.unregisterColumn(o.prop || t.value);
1476
+ }), (s, k) => null;
1442
1477
  }
1443
- }), et = { key: 0 }, tt = ["onClick"], at = ["onClick"], nt = { key: 0 }, lt = { key: 1 }, st = { key: 0 }, ot = ["colspan"], rt = { style: { display: "none" } }, Mt = /* @__PURE__ */ O({
1478
+ }), tt = { key: 0 }, at = ["onClick"], nt = ["onClick"], st = { key: 0 }, lt = { key: 1 }, ot = { key: 0 }, it = ["colspan"], rt = { style: { display: "none" } }, Mt = /* @__PURE__ */ G({
1444
1479
  name: "XTreeTable",
1445
1480
  __name: "index",
1446
1481
  props: {
@@ -1459,197 +1494,197 @@ const vt = /* @__PURE__ */ O({
1459
1494
  collapseIcon: {}
1460
1495
  },
1461
1496
  emits: ["row-click", "cell-click", "expand-change", "sort-change"],
1462
- setup(l, { expose: s, emit: i }) {
1463
- const e = l, y = i, r = G("tree-table"), n = H(/* @__PURE__ */ new Set()), k = H([]), b = H({});
1464
- ne("x-tree-table", {
1465
- registerColumn: (d, g) => {
1466
- const t = k.value.findIndex((a) => a.prop === d.prop);
1467
- t === -1 ? k.value.push(d) : k.value[t] = d, g && (b.value[d.prop] = g);
1497
+ setup(l, { expose: o, emit: r }) {
1498
+ const t = l, u = r, i = Y("tree-table"), s = P(/* @__PURE__ */ new Set()), k = P([]), b = P({});
1499
+ le("x-tree-table", {
1500
+ registerColumn: (v, I) => {
1501
+ const n = k.value.findIndex((e) => e.prop === v.prop);
1502
+ n === -1 ? k.value.push(v) : k.value[n] = v, I && (b.value[v.prop] = I);
1468
1503
  },
1469
- unregisterColumn: (d) => {
1470
- const g = k.value.findIndex((t) => t.prop === d);
1471
- g > -1 && k.value.splice(g, 1), delete b.value[d];
1504
+ unregisterColumn: (v) => {
1505
+ const I = k.value.findIndex((n) => n.prop === v);
1506
+ I > -1 && k.value.splice(I, 1), delete b.value[v];
1472
1507
  },
1473
- updateColumnSlot: (d, g) => {
1474
- b.value[d] = g;
1508
+ updateColumnSlot: (v, I) => {
1509
+ b.value[v] = I;
1475
1510
  },
1476
- props: e
1511
+ props: t
1477
1512
  });
1478
- const $ = (d) => typeof e.rowKey == "function" ? e.rowKey(d) : d[e.rowKey || "id"], C = (d) => {
1479
- var t;
1480
- const g = ((t = e.treeProps) == null ? void 0 : t.children) || "children";
1481
- return d[g] || [];
1482
- }, S = (d) => {
1483
- var a;
1484
- if (C(d).length > 0) return !0;
1485
- const t = ((a = e.treeProps) == null ? void 0 : a.hasChildren) || "hasChildren";
1486
- return d[t] === !0;
1487
- }, K = (d) => {
1488
- const g = $(d);
1489
- return n.value.has(g);
1490
- }, N = (d) => {
1491
- const g = $(d), t = !n.value.has(g);
1492
- t ? n.value.add(g) : n.value.delete(g), y("expand-change", d, t);
1493
- }, Z = () => {
1494
- const d = (g) => {
1495
- g.forEach((t) => {
1496
- S(t) && (n.value.add($(t)), d(C(t)));
1513
+ const L = (v) => typeof t.rowKey == "function" ? t.rowKey(v) : v[t.rowKey || "id"], w = (v) => {
1514
+ var n;
1515
+ const I = ((n = t.treeProps) == null ? void 0 : n.children) || "children";
1516
+ return v[I] || [];
1517
+ }, $ = (v) => {
1518
+ var e;
1519
+ if (w(v).length > 0) return !0;
1520
+ const n = ((e = t.treeProps) == null ? void 0 : e.hasChildren) || "hasChildren";
1521
+ return v[n] === !0;
1522
+ }, K = (v) => {
1523
+ const I = L(v);
1524
+ return s.value.has(I);
1525
+ }, N = (v) => {
1526
+ const I = L(v), n = !s.value.has(I);
1527
+ n ? s.value.add(I) : s.value.delete(I), u("expand-change", v, n);
1528
+ }, V = () => {
1529
+ const v = (I) => {
1530
+ I.forEach((n) => {
1531
+ $(n) && (s.value.add(L(n)), v(w(n)));
1497
1532
  });
1498
1533
  };
1499
- d(e.data);
1500
- }, Y = () => {
1501
- n.value.clear();
1534
+ v(t.data);
1535
+ }, X = () => {
1536
+ s.value.clear();
1502
1537
  }, E = x(() => {
1503
- const d = [], g = (t, a = 0, o = !0) => {
1504
- t.forEach((p) => {
1505
- const v = $(p), z = n.value.has(v), W = o;
1506
- d.push({ row: p, level: a, visible: W });
1507
- const V = C(p);
1508
- V.length > 0 && z && g(V, a + 1, W);
1538
+ const v = [], I = (n, e = 0, a = !0) => {
1539
+ n.forEach((d) => {
1540
+ const p = L(d), m = s.value.has(p), D = a;
1541
+ v.push({ row: d, level: e, visible: D });
1542
+ const H = w(d);
1543
+ H.length > 0 && m && I(H, e + 1, D);
1509
1544
  });
1510
1545
  };
1511
- return g(e.data), d;
1512
- }), D = H({
1546
+ return I(t.data), v;
1547
+ }), z = P({
1513
1548
  prop: "",
1514
1549
  order: null
1515
- }), B = x(() => {
1516
- if (!D.value.prop || !D.value.order)
1550
+ }), W = x(() => {
1551
+ if (!z.value.prop || !z.value.order)
1517
1552
  return E.value;
1518
- const { prop: d, order: g } = D.value;
1519
- return [...E.value].sort((t, a) => {
1520
- const o = t.row[d], p = a.row[d];
1521
- if (o === p) return 0;
1522
- const v = o > p ? 1 : -1;
1523
- return g === "ascending" ? v : -v;
1553
+ const { prop: v, order: I } = z.value;
1554
+ return [...E.value].sort((n, e) => {
1555
+ const a = n.row[v], d = e.row[v];
1556
+ if (a === d) return 0;
1557
+ const p = a > d ? 1 : -1;
1558
+ return I === "ascending" ? p : -p;
1524
1559
  });
1525
- }), X = (d) => {
1526
- d.sortable && (D.value.prop === d.prop ? D.value.order === "ascending" ? D.value.order = "descending" : D.value.order === "descending" && (D.value.order = null, D.value.prop = "") : (D.value.prop = d.prop, D.value.order = "ascending"), y("sort-change", { ...D.value }));
1527
- }, P = (d) => d.sortable ? D.value.prop !== d.prop ? r.is("sortable") : [
1528
- r.is("sortable"),
1529
- r.is(`sort-${D.value.order}`)
1530
- ] : "", Q = (d, g, t) => {
1531
- const a = d[g.prop];
1532
- return g.formatter ? g.formatter(d, g, a, t) : a ?? "";
1533
- }, q = (d) => {
1534
- const g = {};
1535
- return d.width && (g.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (g.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (g.textAlign = d.align), g;
1560
+ }), Z = (v) => {
1561
+ v.sortable && (z.value.prop === v.prop ? z.value.order === "ascending" ? z.value.order = "descending" : z.value.order === "descending" && (z.value.order = null, z.value.prop = "") : (z.value.prop = v.prop, z.value.order = "ascending"), u("sort-change", { ...z.value }));
1562
+ }, O = (v) => v.sortable ? z.value.prop !== v.prop ? i.is("sortable") : [
1563
+ i.is("sortable"),
1564
+ i.is(`sort-${z.value.order}`)
1565
+ ] : "", Q = (v, I, n) => {
1566
+ const e = v[I.prop];
1567
+ return I.formatter ? I.formatter(v, I, e, n) : e ?? "";
1568
+ }, F = (v) => {
1569
+ const I = {};
1570
+ return v.width && (I.width = typeof v.width == "number" ? `${v.width}px` : v.width), v.minWidth && (I.minWidth = typeof v.minWidth == "number" ? `${v.minWidth}px` : v.minWidth), v.align && (I.textAlign = v.align), I;
1536
1571
  }, _ = x(() => [
1537
- r.b(),
1538
- r.is("border", e.border),
1539
- r.is("stripe", e.stripe),
1540
- r.is("loading", e.loading)
1541
- ]), ee = () => {
1542
- var d;
1543
- e.defaultExpandAll ? Z() : (d = e.defaultExpandedKeys) != null && d.length && e.defaultExpandedKeys.forEach((g) => {
1544
- n.value.add(g);
1572
+ i.b(),
1573
+ i.is("border", t.border),
1574
+ i.is("stripe", t.stripe),
1575
+ i.is("loading", t.loading)
1576
+ ]), ae = () => {
1577
+ var v;
1578
+ t.defaultExpandAll ? V() : (v = t.defaultExpandedKeys) != null && v.length && t.defaultExpandedKeys.forEach((I) => {
1579
+ s.value.add(I);
1545
1580
  });
1546
1581
  };
1547
- return F(() => e.data, () => {
1548
- ee();
1549
- }, { immediate: !0 }), F(() => e.defaultExpandedKeys, (d) => {
1550
- d != null && d.length && !e.defaultExpandAll && (n.value.clear(), d.forEach((g) => {
1551
- n.value.add(g);
1582
+ return q(() => t.data, () => {
1583
+ ae();
1584
+ }, { immediate: !0 }), q(() => t.defaultExpandedKeys, (v) => {
1585
+ v != null && v.length && !t.defaultExpandAll && (s.value.clear(), v.forEach((I) => {
1586
+ s.value.add(I);
1552
1587
  }));
1553
- }, { immediate: !0 }), s({
1554
- expandAll: Z,
1555
- collapseAll: Y,
1588
+ }, { immediate: !0 }), o({
1589
+ expandAll: V,
1590
+ collapseAll: X,
1556
1591
  toggleExpand: N,
1557
- expandedKeys: n,
1592
+ expandedKeys: s,
1558
1593
  columns: k
1559
- }), (d, g) => (c(), u("div", {
1560
- class: f(_.value)
1594
+ }), (v, I) => (c(), h("div", {
1595
+ class: g(_.value)
1561
1596
  }, [
1562
- l.loading ? (c(), u("div", {
1597
+ l.loading ? (c(), h("div", {
1563
1598
  key: 0,
1564
- class: f(h(r).e("loading"))
1565
- }, [...g[0] || (g[0] = [
1566
- m("span", { class: "loading-spinner" }, null, -1),
1567
- m("span", { class: "loading-text" }, "加载中...", -1)
1568
- ])], 2)) : M("", !0),
1569
- m("div", {
1570
- class: f(h(r).e("wrapper"))
1599
+ class: g(f(i).e("loading"))
1600
+ }, [...I[0] || (I[0] = [
1601
+ y("span", { class: "loading-spinner" }, null, -1),
1602
+ y("span", { class: "loading-text" }, "加载中...", -1)
1603
+ ])], 2)) : S("", !0),
1604
+ y("div", {
1605
+ class: g(f(i).e("wrapper"))
1571
1606
  }, [
1572
- m("table", null, [
1573
- l.showHeader ? (c(), u("thead", et, [
1574
- m("tr", null, [
1575
- (c(!0), u(R, null, U(k.value, (t) => (c(), u("th", {
1576
- key: t.prop,
1577
- class: f([h(r).e("header-cell"), P(t)]),
1578
- style: L(q(t)),
1579
- onClick: (a) => X(t)
1607
+ y("table", null, [
1608
+ l.showHeader ? (c(), h("thead", tt, [
1609
+ y("tr", null, [
1610
+ (c(!0), h(R, null, U(k.value, (n) => (c(), h("th", {
1611
+ key: n.prop,
1612
+ class: g([f(i).e("header-cell"), O(n)]),
1613
+ style: j(F(n)),
1614
+ onClick: (e) => Z(n)
1580
1615
  }, [
1581
- m("span", null, A(t.label), 1),
1582
- t.sortable ? (c(), u("span", {
1616
+ y("span", null, A(n.label), 1),
1617
+ n.sortable ? (c(), h("span", {
1583
1618
  key: 0,
1584
- class: f(h(r).e("sort-icon"))
1585
- }, [...g[1] || (g[1] = [
1586
- m("span", { class: "sort-arrow up" }, "▲", -1),
1587
- m("span", { class: "sort-arrow down" }, "▼", -1)
1588
- ])], 2)) : M("", !0)
1589
- ], 14, tt))), 128))
1619
+ class: g(f(i).e("sort-icon"))
1620
+ }, [...I[1] || (I[1] = [
1621
+ y("span", { class: "sort-arrow up" }, "▲", -1),
1622
+ y("span", { class: "sort-arrow down" }, "▼", -1)
1623
+ ])], 2)) : S("", !0)
1624
+ ], 14, at))), 128))
1590
1625
  ])
1591
- ])) : M("", !0),
1592
- m("tbody", null, [
1593
- (c(!0), u(R, null, U(B.value, (t, a) => (c(), u(R, {
1594
- key: $(t.row)
1626
+ ])) : S("", !0),
1627
+ y("tbody", null, [
1628
+ (c(!0), h(R, null, U(W.value, (n, e) => (c(), h(R, {
1629
+ key: L(n.row)
1595
1630
  }, [
1596
- t.visible ? (c(), u("tr", {
1631
+ n.visible ? (c(), h("tr", {
1597
1632
  key: 0,
1598
- class: f([h(r).e("row"), h(r).is("level-" + t.level)])
1633
+ class: g([f(i).e("row"), f(i).is("level-" + n.level)])
1599
1634
  }, [
1600
- (c(!0), u(R, null, U(k.value, (o, p) => (c(), u("td", {
1601
- key: o.prop,
1602
- class: f(h(r).e("cell")),
1603
- style: L(q(o))
1635
+ (c(!0), h(R, null, U(k.value, (a, d) => (c(), h("td", {
1636
+ key: a.prop,
1637
+ class: g(f(i).e("cell")),
1638
+ style: j(F(a))
1604
1639
  }, [
1605
- p === 0 ? (c(), u("div", {
1640
+ d === 0 ? (c(), h("div", {
1606
1641
  key: 0,
1607
- class: f(h(r).e("cell-content"))
1642
+ class: g(f(i).e("cell-content"))
1608
1643
  }, [
1609
- m("span", {
1610
- class: f(h(r).e("indent")),
1611
- style: L({ width: `${t.level * l.indent}px` })
1644
+ y("span", {
1645
+ class: g(f(i).e("indent")),
1646
+ style: j({ width: `${n.level * l.indent}px` })
1612
1647
  }, null, 6),
1613
- S(t.row) ? (c(), u("span", {
1648
+ $(n.row) ? (c(), h("span", {
1614
1649
  key: 0,
1615
- class: f([h(r).e("expand-icon"), h(r).is("expanded", K(t.row))]),
1616
- onClick: re((v) => N(t.row), ["stop"])
1650
+ class: g([f(i).e("expand-icon"), f(i).is("expanded", K(n.row))]),
1651
+ onClick: de((p) => N(n.row), ["stop"])
1617
1652
  }, [
1618
- K(t.row) ? (c(), u("span", nt, "▼")) : (c(), u("span", lt, "▶"))
1619
- ], 10, at)) : (c(), u("span", {
1653
+ K(n.row) ? (c(), h("span", st, "▼")) : (c(), h("span", lt, "▶"))
1654
+ ], 10, nt)) : (c(), h("span", {
1620
1655
  key: 1,
1621
- class: f(h(r).e("expand-placeholder"))
1656
+ class: g(f(i).e("expand-placeholder"))
1622
1657
  }, null, 2)),
1623
- m("span", null, [
1624
- b.value[o.prop] ? (c(), ae(ie(() => b.value[o.prop]({ row: t.row, column: o, $index: a })), { key: 0 })) : (c(), u(R, { key: 1 }, [
1625
- J(A(Q(t.row, o, a)), 1)
1658
+ y("span", null, [
1659
+ b.value[a.prop] ? (c(), se(ce(() => b.value[a.prop]({ row: n.row, column: a, $index: e })), { key: 0 })) : (c(), h(R, { key: 1 }, [
1660
+ J(A(Q(n.row, a, e)), 1)
1626
1661
  ], 64))
1627
1662
  ])
1628
- ], 2)) : b.value[o.prop] ? (c(), ae(ie(() => b.value[o.prop]({ row: t.row, column: o, $index: a })), { key: 1 })) : (c(), u(R, { key: 2 }, [
1629
- J(A(Q(t.row, o, a)), 1)
1663
+ ], 2)) : b.value[a.prop] ? (c(), se(ce(() => b.value[a.prop]({ row: n.row, column: a, $index: e })), { key: 1 })) : (c(), h(R, { key: 2 }, [
1664
+ J(A(Q(n.row, a, e)), 1)
1630
1665
  ], 64))
1631
1666
  ], 6))), 128))
1632
- ], 2)) : M("", !0)
1667
+ ], 2)) : S("", !0)
1633
1668
  ], 64))), 128)),
1634
- B.value.length === 0 && !l.loading ? (c(), u("tr", st, [
1635
- m("td", {
1669
+ W.value.length === 0 && !l.loading ? (c(), h("tr", ot, [
1670
+ y("td", {
1636
1671
  colspan: k.value.length || 1,
1637
- class: f(h(r).e("empty"))
1672
+ class: g(f(i).e("empty"))
1638
1673
  }, [
1639
- j(d.$slots, "empty", {}, () => [
1674
+ B(v.$slots, "empty", {}, () => [
1640
1675
  J(A(l.emptyText), 1)
1641
1676
  ])
1642
- ], 10, ot)
1643
- ])) : M("", !0)
1677
+ ], 10, it)
1678
+ ])) : S("", !0)
1644
1679
  ])
1645
1680
  ])
1646
1681
  ], 2),
1647
- m("div", rt, [
1648
- j(d.$slots, "default")
1682
+ y("div", rt, [
1683
+ B(v.$slots, "default")
1649
1684
  ])
1650
1685
  ], 2));
1651
1686
  }
1652
- }), $t = /* @__PURE__ */ O({
1687
+ }), St = /* @__PURE__ */ G({
1653
1688
  name: "XTreeTableColumn",
1654
1689
  __name: "TreeTableColumn",
1655
1690
  props: {
@@ -1663,27 +1698,27 @@ const vt = /* @__PURE__ */ O({
1663
1698
  formatter: {}
1664
1699
  },
1665
1700
  setup(l) {
1666
- const s = l;
1667
- G("tree-table-column");
1668
- const i = de(), e = le("x-tree-table"), y = x(() => ({
1669
- prop: s.prop,
1670
- label: s.label,
1671
- width: s.width,
1672
- minWidth: s.minWidth,
1673
- align: s.align,
1674
- sortable: s.sortable,
1675
- fixed: s.fixed,
1676
- formatter: s.formatter
1701
+ const o = l;
1702
+ Y("tree-table-column");
1703
+ const r = ue(), t = oe("x-tree-table"), u = x(() => ({
1704
+ prop: o.prop,
1705
+ label: o.label,
1706
+ width: o.width,
1707
+ minWidth: o.minWidth,
1708
+ align: o.align,
1709
+ sortable: o.sortable,
1710
+ fixed: o.fixed,
1711
+ formatter: o.formatter
1677
1712
  }));
1678
- return se(() => {
1679
- e != null && e.registerColumn && e.registerColumn(y.value, i.default);
1680
- }), F(() => i.default, (r) => {
1681
- e != null && e.updateColumnSlot && r && e.updateColumnSlot(s.prop, r);
1682
- }, { immediate: !0 }), oe(() => {
1683
- e != null && e.unregisterColumn && e.unregisterColumn(s.prop);
1684
- }), (r, n) => null;
1713
+ return ie(() => {
1714
+ t != null && t.registerColumn && t.registerColumn(u.value, r.default);
1715
+ }), q(() => r.default, (i) => {
1716
+ t != null && t.updateColumnSlot && i && t.updateColumnSlot(o.prop, i);
1717
+ }, { immediate: !0 }), re(() => {
1718
+ t != null && t.unregisterColumn && t.unregisterColumn(o.prop);
1719
+ }), (i, s) => null;
1685
1720
  }
1686
- }), it = ["src", "alt"], St = /* @__PURE__ */ O({
1721
+ }), dt = ["src", "alt"], Kt = /* @__PURE__ */ G({
1687
1722
  name: "XAvatar",
1688
1723
  __name: "index",
1689
1724
  props: {
@@ -1695,39 +1730,39 @@ const vt = /* @__PURE__ */ O({
1695
1730
  alt: {}
1696
1731
  },
1697
1732
  emits: ["error"],
1698
- setup(l, { emit: s }) {
1699
- const i = l, e = s, y = G("avatar"), r = x(() => [
1700
- y.b(),
1701
- y.m(i.shape),
1702
- typeof i.size == "string" ? y.m(i.size) : ""
1703
- ]), n = x(() => {
1733
+ setup(l, { emit: o }) {
1734
+ const r = l, t = o, u = Y("avatar"), i = x(() => [
1735
+ u.b(),
1736
+ u.m(r.shape),
1737
+ typeof r.size == "string" ? u.m(r.size) : ""
1738
+ ]), s = x(() => {
1704
1739
  const b = {};
1705
- return typeof i.size == "number" && (b.width = `${i.size}px`, b.height = `${i.size}px`, b.lineHeight = `${i.size}px`), b;
1740
+ return typeof r.size == "number" && (b.width = `${r.size}px`, b.height = `${r.size}px`, b.lineHeight = `${r.size}px`), b;
1706
1741
  }), k = (b) => {
1707
- e("error", b);
1742
+ t("error", b);
1708
1743
  };
1709
- return (b, I) => (c(), u("span", {
1710
- class: f(r.value),
1711
- style: L(n.value)
1744
+ return (b, M) => (c(), h("span", {
1745
+ class: g(i.value),
1746
+ style: j(s.value)
1712
1747
  }, [
1713
- l.src ? (c(), u("img", {
1748
+ l.src ? (c(), h("img", {
1714
1749
  key: 0,
1715
1750
  src: l.src,
1716
1751
  alt: l.alt,
1717
- style: L({ objectFit: l.fit }),
1752
+ style: j({ objectFit: l.fit }),
1718
1753
  onError: k
1719
- }, null, 44, it)) : l.icon ? (c(), u("span", {
1754
+ }, null, 44, dt)) : l.icon ? (c(), h("span", {
1720
1755
  key: 1,
1721
- class: f(h(y).e("icon"))
1722
- }, A(l.icon), 3)) : (c(), u("span", {
1756
+ class: g(f(u).e("icon"))
1757
+ }, A(l.icon), 3)) : (c(), h("span", {
1723
1758
  key: 2,
1724
- class: f(h(y).e("default"))
1759
+ class: g(f(u).e("default"))
1725
1760
  }, [
1726
- j(b.$slots, "default")
1761
+ B(b.$slots, "default")
1727
1762
  ], 2))
1728
1763
  ], 6));
1729
1764
  }
1730
- }), Kt = /* @__PURE__ */ O({
1765
+ }), Nt = /* @__PURE__ */ G({
1731
1766
  name: "XDescriptions",
1732
1767
  __name: "index",
1733
1768
  props: {
@@ -1741,35 +1776,35 @@ const vt = /* @__PURE__ */ O({
1741
1776
  colon: { type: Boolean, default: !0 }
1742
1777
  },
1743
1778
  setup(l) {
1744
- const s = l, i = G("descriptions");
1745
- ne("x-descriptions", {
1746
- props: s,
1747
- column: x(() => s.column)
1779
+ const o = l, r = Y("descriptions");
1780
+ le("x-descriptions", {
1781
+ props: o,
1782
+ column: x(() => o.column)
1748
1783
  });
1749
- const e = x(() => [
1750
- i.b(),
1751
- i.m(s.size),
1752
- i.is("bordered", s.border)
1784
+ const t = x(() => [
1785
+ r.b(),
1786
+ r.m(o.size),
1787
+ r.is("bordered", o.border)
1753
1788
  ]);
1754
- return (y, r) => (c(), u("div", {
1755
- class: f(e.value)
1789
+ return (u, i) => (c(), h("div", {
1790
+ class: g(t.value)
1756
1791
  }, [
1757
- l.title ? (c(), u("div", {
1792
+ l.title ? (c(), h("div", {
1758
1793
  key: 0,
1759
- class: f(h(i).e("title"))
1760
- }, A(l.title), 3)) : M("", !0),
1761
- m("div", {
1762
- class: f(h(i).e("body"))
1794
+ class: g(f(r).e("title"))
1795
+ }, A(l.title), 3)) : S("", !0),
1796
+ y("div", {
1797
+ class: g(f(r).e("body"))
1763
1798
  }, [
1764
- m("table", null, [
1765
- m("tbody", null, [
1766
- j(y.$slots, "default")
1799
+ y("table", null, [
1800
+ y("tbody", null, [
1801
+ B(u.$slots, "default")
1767
1802
  ])
1768
1803
  ])
1769
1804
  ], 2)
1770
1805
  ], 2));
1771
1806
  }
1772
- }), dt = ["colspan"], ct = ["colspan"], Nt = /* @__PURE__ */ O({
1807
+ }), ct = ["colspan"], ut = ["colspan"], zt = /* @__PURE__ */ G({
1773
1808
  name: "XDescriptionsItem",
1774
1809
  __name: "DescriptionsItem",
1775
1810
  props: {
@@ -1779,51 +1814,51 @@ const vt = /* @__PURE__ */ O({
1779
1814
  contentAlign: {}
1780
1815
  },
1781
1816
  setup(l) {
1782
- const s = l, i = G("descriptions-item"), e = le("x-descriptions"), y = x(() => {
1817
+ const o = l, r = Y("descriptions-item"), t = oe("x-descriptions"), u = x(() => {
1783
1818
  var T;
1784
- const I = {}, w = (T = e == null ? void 0 : e.props) == null ? void 0 : T.labelWidth;
1785
- return w && (I.width = typeof w == "number" ? `${w}px` : w), I;
1786
- }), r = x(() => {
1787
- var I;
1788
- return s.labelAlign || ((I = e == null ? void 0 : e.props) == null ? void 0 : I.labelAlign) || "right";
1789
- }), n = x(() => {
1790
- var I;
1791
- return s.contentAlign || ((I = e == null ? void 0 : e.props) == null ? void 0 : I.contentAlign) || "left";
1819
+ const M = {}, C = (T = t == null ? void 0 : t.props) == null ? void 0 : T.labelWidth;
1820
+ return C && (M.width = typeof C == "number" ? `${C}px` : C), M;
1821
+ }), i = x(() => {
1822
+ var M;
1823
+ return o.labelAlign || ((M = t == null ? void 0 : t.props) == null ? void 0 : M.labelAlign) || "right";
1824
+ }), s = x(() => {
1825
+ var M;
1826
+ return o.contentAlign || ((M = t == null ? void 0 : t.props) == null ? void 0 : M.contentAlign) || "left";
1792
1827
  }), k = x(() => {
1793
- var I;
1794
- return ((I = e == null ? void 0 : e.props) == null ? void 0 : I.colon) ?? !0;
1828
+ var M;
1829
+ return ((M = t == null ? void 0 : t.props) == null ? void 0 : M.colon) ?? !0;
1795
1830
  }), b = x(() => {
1796
- var I;
1797
- return ((I = e == null ? void 0 : e.props) == null ? void 0 : I.border) ?? !1;
1831
+ var M;
1832
+ return ((M = t == null ? void 0 : t.props) == null ? void 0 : M.border) ?? !1;
1798
1833
  });
1799
- return (I, w) => b.value ? (c(), u(R, { key: 0 }, [
1800
- m("th", {
1801
- class: f([h(i).b(), h(i).e("label"), `is-${r.value}`]),
1802
- style: L(y.value)
1834
+ return (M, C) => b.value ? (c(), h(R, { key: 0 }, [
1835
+ y("th", {
1836
+ class: g([f(r).b(), f(r).e("label"), `is-${i.value}`]),
1837
+ style: j(u.value)
1803
1838
  }, A(l.label) + A(k.value ? ":" : ""), 7),
1804
- m("td", {
1805
- class: f([h(i).e("content"), `is-${n.value}`]),
1839
+ y("td", {
1840
+ class: g([f(r).e("content"), `is-${s.value}`]),
1806
1841
  colspan: l.span * 2 - 1
1807
1842
  }, [
1808
- j(I.$slots, "default")
1809
- ], 10, dt)
1810
- ], 64)) : (c(), u("tr", {
1843
+ B(M.$slots, "default")
1844
+ ], 10, ct)
1845
+ ], 64)) : (c(), h("tr", {
1811
1846
  key: 1,
1812
- class: f(h(i).b())
1847
+ class: g(f(r).b())
1813
1848
  }, [
1814
- m("th", {
1815
- class: f([h(i).e("label"), `is-${r.value}`]),
1816
- style: L(y.value)
1849
+ y("th", {
1850
+ class: g([f(r).e("label"), `is-${i.value}`]),
1851
+ style: j(u.value)
1817
1852
  }, A(l.label) + A(k.value ? ":" : ""), 7),
1818
- m("td", {
1819
- class: f([h(i).e("content"), `is-${n.value}`]),
1853
+ y("td", {
1854
+ class: g([f(r).e("content"), `is-${s.value}`]),
1820
1855
  colspan: l.span * 2 - 1
1821
1856
  }, [
1822
- j(I.$slots, "default")
1823
- ], 10, ct)
1857
+ B(M.$slots, "default")
1858
+ ], 10, ut)
1824
1859
  ], 2));
1825
1860
  }
1826
- }), Dt = /* @__PURE__ */ O({
1861
+ }), Dt = /* @__PURE__ */ G({
1827
1862
  name: "XScrollbar",
1828
1863
  __name: "index",
1829
1864
  props: {
@@ -1840,90 +1875,90 @@ const vt = /* @__PURE__ */ O({
1840
1875
  minSize: { default: 20 }
1841
1876
  },
1842
1877
  emits: ["scroll"],
1843
- setup(l, { expose: s, emit: i }) {
1844
- const e = l, y = i, r = G("scrollbar"), n = H(), k = H(), b = H("0"), I = H("0"), w = H(0), T = H(0), $ = x(() => {
1878
+ setup(l, { expose: o, emit: r }) {
1879
+ const t = l, u = r, i = Y("scrollbar"), s = P(), k = P(), b = P("0"), M = P("0"), C = P(0), T = P(0), L = x(() => {
1845
1880
  const E = {};
1846
- return e.height && (E.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (E.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), E;
1847
- }), C = () => {
1848
- if (!n.value) return;
1849
- const E = n.value.offsetHeight - 4, D = n.value.offsetWidth - 4, B = n.value.scrollHeight, X = n.value.scrollWidth, P = E / B, Q = D / X;
1850
- I.value = P >= 1 ? "0" : `${E * P}px`, b.value = Q >= 1 ? "0" : `${D * Q}px`;
1851
- }, S = (E) => {
1852
- if (!n.value) return;
1853
- const D = n.value.offsetHeight, B = n.value.offsetWidth;
1854
- T.value = n.value.scrollTop * 100 / D, w.value = n.value.scrollLeft * 100 / B, y("scroll", E);
1881
+ return t.height && (E.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (E.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), E;
1882
+ }), w = () => {
1883
+ if (!s.value) return;
1884
+ const E = s.value.offsetHeight - 4, z = s.value.offsetWidth - 4, W = s.value.scrollHeight, Z = s.value.scrollWidth, O = E / W, Q = z / Z;
1885
+ M.value = O >= 1 ? "0" : `${E * O}px`, b.value = Q >= 1 ? "0" : `${z * Q}px`;
1886
+ }, $ = (E) => {
1887
+ if (!s.value) return;
1888
+ const z = s.value.offsetHeight, W = s.value.offsetWidth;
1889
+ T.value = s.value.scrollTop * 100 / z, C.value = s.value.scrollLeft * 100 / W, u("scroll", E);
1855
1890
  }, K = (E) => {
1856
- var D;
1857
- (D = n.value) == null || D.scrollTo(E);
1891
+ var z;
1892
+ (z = s.value) == null || z.scrollTo(E);
1858
1893
  }, N = (E) => {
1859
- n.value && (n.value.scrollTop = E);
1860
- }, Z = (E) => {
1861
- n.value && (n.value.scrollLeft = E);
1894
+ s.value && (s.value.scrollTop = E);
1895
+ }, V = (E) => {
1896
+ s.value && (s.value.scrollLeft = E);
1862
1897
  };
1863
- let Y = null;
1864
- return se(() => {
1865
- e.native || (fe(C), e.noresize || (Y = new ResizeObserver(C), k.value && Y.observe(k.value), window.addEventListener("resize", C)));
1866
- }), oe(() => {
1867
- Y && Y.disconnect(), window.removeEventListener("resize", C);
1868
- }), s({
1898
+ let X = null;
1899
+ return ie(() => {
1900
+ t.native || (pe(w), t.noresize || (X = new ResizeObserver(w), k.value && X.observe(k.value), window.addEventListener("resize", w)));
1901
+ }), re(() => {
1902
+ X && X.disconnect(), window.removeEventListener("resize", w);
1903
+ }), o({
1869
1904
  scrollTo: K,
1870
1905
  setScrollTop: N,
1871
- setScrollLeft: Z,
1872
- update: C
1873
- }), (E, D) => (c(), u("div", {
1874
- class: f(h(r).b())
1906
+ setScrollLeft: V,
1907
+ update: w
1908
+ }), (E, z) => (c(), h("div", {
1909
+ class: g(f(i).b())
1875
1910
  }, [
1876
- m("div", {
1911
+ y("div", {
1877
1912
  ref_key: "wrapRef",
1878
- ref: n,
1879
- class: f([h(r).e("wrap"), l.wrapClass, { [h(r).em("wrap", "hidden-default")]: !l.native }]),
1880
- style: L([$.value, { overflow: l.native ? "auto" : "hidden" }]),
1881
- onScroll: S
1913
+ ref: s,
1914
+ class: g([f(i).e("wrap"), l.wrapClass, { [f(i).em("wrap", "hidden-default")]: !l.native }]),
1915
+ style: j([L.value, { overflow: l.native ? "auto" : "hidden" }]),
1916
+ onScroll: $
1882
1917
  }, [
1883
- (c(), ae(ie(l.tag), {
1918
+ (c(), se(ce(l.tag), {
1884
1919
  ref_key: "resizeRef",
1885
1920
  ref: k,
1886
- class: f([h(r).e("view"), l.viewClass]),
1887
- style: L(l.viewStyle)
1921
+ class: g([f(i).e("view"), l.viewClass]),
1922
+ style: j(l.viewStyle)
1888
1923
  }, {
1889
- default: ce(() => [
1890
- j(E.$slots, "default")
1924
+ default: he(() => [
1925
+ B(E.$slots, "default")
1891
1926
  ]),
1892
1927
  _: 3
1893
1928
  }, 8, ["class", "style"]))
1894
1929
  ], 38),
1895
- !l.native && I.value ? (c(), u("div", {
1930
+ !l.native && M.value ? (c(), h("div", {
1896
1931
  key: 0,
1897
- class: f([h(r).e("bar"), h(r).is("vertical")]),
1898
- style: L({ height: I.value, top: `${T.value}%` })
1899
- }, null, 6)) : M("", !0),
1900
- !l.native && b.value ? (c(), u("div", {
1932
+ class: g([f(i).e("bar"), f(i).is("vertical")]),
1933
+ style: j({ height: M.value, top: `${T.value}%` })
1934
+ }, null, 6)) : S("", !0),
1935
+ !l.native && b.value ? (c(), h("div", {
1901
1936
  key: 1,
1902
- class: f([h(r).e("bar"), h(r).is("horizontal")]),
1903
- style: L({ width: b.value, left: `${w.value}%` })
1904
- }, null, 6)) : M("", !0)
1937
+ class: g([f(i).e("bar"), f(i).is("horizontal")]),
1938
+ style: j({ width: b.value, left: `${C.value}%` })
1939
+ }, null, 6)) : S("", !0)
1905
1940
  ], 2));
1906
1941
  }
1907
1942
  });
1908
1943
  export {
1909
- St as Avatar,
1910
- pt as Card,
1911
- xt as Carousel,
1912
- Ct as CarouselItem,
1913
- Kt as Descriptions,
1914
- Nt as DescriptionsItem,
1915
- gt as DynamicTable,
1916
- mt as Empty,
1917
- Ke as Pagination,
1944
+ Kt as Avatar,
1945
+ gt as Card,
1946
+ Ct as Carousel,
1947
+ wt as CarouselItem,
1948
+ Nt as Descriptions,
1949
+ zt as DescriptionsItem,
1950
+ vt as DynamicTable,
1951
+ kt as Empty,
1952
+ Ne as Pagination,
1918
1953
  yt as Progress,
1919
1954
  Dt as Scrollbar,
1920
- wt as Table,
1921
- It as TableColumn,
1922
- ft as Tag,
1923
- kt as Timeline,
1955
+ It as Table,
1956
+ $t as TableColumn,
1957
+ pt as Tag,
1958
+ xt as Timeline,
1924
1959
  bt as TimelineItem,
1925
- vt as Tree,
1960
+ mt as Tree,
1926
1961
  te as TreeNode,
1927
1962
  Mt as TreeTable,
1928
- $t as TreeTableColumn
1963
+ St as TreeTableColumn
1929
1964
  };