x-next 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/AI_USAGE.md +2 -2
  2. package/CHANGELOG.md +35 -0
  3. package/dist/components/dropdown/DropdownButton.vue.d.ts +2 -1
  4. package/dist/components/dropdown/index.d.ts +3 -0
  5. package/dist/components/steps/context.d.ts +9 -0
  6. package/dist/components/tabs/TabPane.vue.d.ts +2 -0
  7. package/dist/components/tabs/index.d.ts +6 -0
  8. package/dist/components/tabs/interface.d.ts +4 -0
  9. package/dist/es/components/dropdown/Dropdown.vue2.js +11 -4
  10. package/dist/es/components/dropdown/DropdownButton.vue.js +8 -7
  11. package/dist/es/components/dropdown/DropdownButton.vue2.js +19 -17
  12. package/dist/es/components/dropdown/DropdownSubmenu.vue.js +18 -17
  13. package/dist/es/components/menu/MenuSubMenu.js +50 -36
  14. package/dist/es/components/menu/sub-menu-pop.vue2.js +30 -30
  15. package/dist/es/components/pagination/Pagination.js +73 -70
  16. package/dist/es/components/steps/Step.vue2.js +51 -47
  17. package/dist/es/components/steps/Steps.vue2.js +22 -19
  18. package/dist/es/components/tabs/TabPane.vue.js +11 -9
  19. package/dist/es/components/tabs/TabPane.vue2.js +28 -24
  20. package/dist/es/components/tabs/tabs-nav.js +20 -18
  21. package/dist/es/components/tabs/tabs-tab.vue.js +10 -8
  22. package/dist/es/locale/en-US.js +2 -1
  23. package/dist/es/locale/zh-CN.js +2 -1
  24. package/dist/es/style.css +1 -1
  25. package/dist/index.cjs +4 -4
  26. package/dist/index.umd.js +4 -4
  27. package/dist/locale/interface.d.ts +2 -0
  28. package/dist/style/dropdown.css +1 -1
  29. package/dist/style/menu.css +1 -1
  30. package/dist/style/pagination.css +1 -1
  31. package/dist/style/steps.css +1 -1
  32. package/dist/style/tabs.css +1 -1
  33. package/dist/style.css +1 -1
  34. package/package.json +3 -2
@@ -1,10 +1,10 @@
1
- import { defineComponent as F, toRefs as $, ref as w, computed as m, reactive as D, watch as j, createVNode as i, mergeProps as b } from "vue";
1
+ import { defineComponent as F, toRefs as $, ref as M, computed as d, reactive as D, watch as j, createVNode as n, mergeProps as b } from "vue";
2
2
  import G from "./page-item.vue.js";
3
3
  import O from "./page-item-step.vue.js";
4
4
  import H from "./page-item-ellipsis.vue.js";
5
5
  import B from "./page-jumper.vue.js";
6
6
  import K from "./page-options.vue.js";
7
- import { isNumber as y } from "../../_utils/is.js";
7
+ import { isNumber as h } from "../../_utils/is.js";
8
8
  import { useSize as Q } from "../../_hooks/use-size.js";
9
9
  import { getClassNameMixin as U } from "../../_utils/config.js";
10
10
  import { useLocale as W } from "../../locale/index.js";
@@ -211,88 +211,88 @@ const ne = /* @__PURE__ */ F({
211
211
  * @binding {number} total
212
212
  */
213
213
  setup(e, {
214
- emit: f,
215
- slots: s
214
+ emit: o,
215
+ slots: f
216
216
  }) {
217
- const o = U("pagination"), {
217
+ const g = U("pagination"), {
218
218
  t: I
219
219
  } = W(), {
220
- disabled: z,
220
+ disabled: P,
221
221
  pageItemStyle: A,
222
222
  activePageItemStyle: E,
223
223
  size: L
224
224
  } = $(e), {
225
- mergedSize: c
226
- } = Q(L), p = w(e.defaultCurrent), P = w(e.defaultPageSize), C = (t) => y(t) && Number.isFinite(t) && t > 0, k = (t, a = 10) => C(t) ? t : a, N = m(() => e.current ?? p.value), h = m(() => k(e.pageSize ?? P.value, k(e.defaultPageSize))), u = m(() => Math.max(Math.ceil(e.total / h.value), 1)), l = m(() => y(N.value) ? Math.min(Math.max(N.value, 1), u.value) : 1), S = (t) => {
227
- if (t !== l.value && y(t) && !e.disabled) {
225
+ mergedSize: m
226
+ } = Q(L), p = M(e.defaultCurrent), C = M(e.defaultPageSize), k = (t) => h(t) && Number.isFinite(t) && t > 0, N = (t, a = 10) => k(t) ? t : a, S = d(() => e.current ?? p.value), y = d(() => N(e.pageSize ?? C.value, N(e.defaultPageSize))), u = d(() => Math.max(Math.ceil(e.total / y.value), 1)), l = d(() => h(S.value) ? Math.min(Math.max(S.value, 1), u.value) : 1), z = (t) => {
227
+ if (t !== l.value && h(t) && !e.disabled) {
228
228
  const a = Math.min(Math.max(t, 1), u.value);
229
- a !== l.value && (p.value = a, f("update:current", a), f("change", a));
229
+ a !== l.value && (p.value = a, o("update:current", a), o("change", a));
230
230
  }
231
231
  }, J = (t) => {
232
- C(t) && (P.value = t, f("update:pageSize", t), f("pageSizeChange", t));
233
- }, n = D({
232
+ k(t) && (C.value = t, o("update:pageSize", t), o("pageSizeChange", t));
233
+ }, s = D({
234
234
  current: l,
235
235
  style: A,
236
236
  activeStyle: E,
237
- onClick: S
237
+ onClick: z
238
238
  }), V = {
239
239
  get current() {
240
- return n.current;
240
+ return s.current;
241
241
  },
242
242
  get disabled() {
243
- return z.value;
243
+ return P.value;
244
244
  },
245
245
  get style() {
246
- return n.style;
246
+ return s.style;
247
247
  },
248
248
  get activeStyle() {
249
- return n.activeStyle;
249
+ return s.activeStyle;
250
250
  },
251
251
  get onClick() {
252
- return n.onClick;
252
+ return s.onClick;
253
253
  }
254
- }, x = {
254
+ }, w = {
255
255
  get current() {
256
- return n.current;
256
+ return s.current;
257
257
  },
258
258
  get disabled() {
259
- return z.value;
259
+ return P.value;
260
260
  },
261
261
  get style() {
262
- return n.style;
262
+ return s.style;
263
263
  },
264
264
  get onClick() {
265
- return n.onClick;
265
+ return s.onClick;
266
266
  },
267
267
  get pages() {
268
268
  return u.value;
269
269
  }
270
270
  }, _ = {
271
271
  get current() {
272
- return n.current;
272
+ return s.current;
273
273
  },
274
274
  get style() {
275
- return n.style;
275
+ return s.style;
276
276
  },
277
277
  get onClick() {
278
- return n.onClick;
278
+ return s.onClick;
279
279
  },
280
280
  get pages() {
281
281
  return u.value;
282
282
  }
283
- }, r = (t, a = {}) => t === "more" ? i(H, b(a, _), {
284
- default: s["page-item-ellipsis"]
285
- }) : t === "previous" ? i(O, b({
283
+ }, r = (t, a = {}) => t === "more" ? n(H, b(a, _), {
284
+ default: f["page-item-ellipsis"]
285
+ }) : t === "previous" ? n(O, b({
286
286
  type: "previous"
287
- }, a, x), {
288
- default: s["page-item-step"]
289
- }) : t === "next" ? i(O, b({
287
+ }, a, w), {
288
+ default: f["page-item-step"]
289
+ }) : t === "next" ? n(O, b({
290
290
  type: "next"
291
- }, a, x), {
292
- default: s["page-item-step"]
293
- }) : i(G, b(a, V), {
294
- default: s["page-item"]
295
- }), R = m(() => {
291
+ }, a, w), {
292
+ default: f["page-item-step"]
293
+ }) : n(G, b(a, V), {
294
+ default: f["page-item"]
295
+ }), R = d(() => {
296
296
  const t = [];
297
297
  if (u.value < e.baseSize + e.bufferSize * 2)
298
298
  for (let a = 1; a <= u.value; a++)
@@ -301,20 +301,20 @@ const ne = /* @__PURE__ */ F({
301
301
  pageNumber: a
302
302
  }));
303
303
  else {
304
- let a = 1, g = u.value, d = !1, M = !1;
305
- l.value > 2 + e.bufferSize && (d = !0, a = Math.min(l.value - e.bufferSize, u.value - 2 * e.bufferSize)), l.value < u.value - (e.bufferSize + 1) && (M = !0, g = Math.max(l.value + e.bufferSize, 2 * e.bufferSize + 1)), d && (t.push(r("page", {
304
+ let a = 1, c = u.value, i = !1, x = !1;
305
+ l.value > 2 + e.bufferSize && (i = !0, a = Math.min(l.value - e.bufferSize, u.value - 2 * e.bufferSize)), l.value < u.value - (e.bufferSize + 1) && (x = !0, c = Math.max(l.value + e.bufferSize, 2 * e.bufferSize + 1)), i && (t.push(r("page", {
306
306
  key: 1,
307
307
  pageNumber: 1
308
308
  })), t.push(r("more", {
309
309
  key: "left-ellipsis-pager",
310
310
  step: -(e.bufferSize * 2 + 1)
311
311
  })));
312
- for (let v = a; v <= g; v++)
312
+ for (let v = a; v <= c; v++)
313
313
  t.push(r("page", {
314
314
  key: v,
315
315
  pageNumber: v
316
316
  }));
317
- M && (t.push(r("more", {
317
+ x && (t.push(r("more", {
318
318
  key: "right-ellipsis-pager",
319
319
  step: e.bufferSize * 2 + 1
320
320
  })), t.push(r("page", {
@@ -323,66 +323,69 @@ const ne = /* @__PURE__ */ F({
323
323
  })));
324
324
  }
325
325
  return t;
326
- }), T = () => e.simple ? i("span", {
327
- class: o.element("simple")
326
+ }), T = () => e.simple ? n("span", {
327
+ class: g.element("simple")
328
328
  }, [r("previous", {
329
329
  simple: !0
330
- }), i(B, {
330
+ }), n(B, {
331
331
  disabled: e.disabled,
332
332
  current: l.value,
333
- size: c.value,
333
+ size: m.value,
334
334
  pages: u.value,
335
335
  simple: !0,
336
- onChange: S
336
+ onChange: z
337
337
  }, null), r("next", {
338
338
  simple: !0
339
- })]) : i("ul", {
340
- class: o.element("list")
339
+ })]) : n("ul", {
340
+ class: g.element("list")
341
341
  }, [r("previous"), R.value, e.showMore && r("more", {
342
342
  key: "more",
343
343
  step: e.bufferSize * 2 + 1
344
344
  }), r("next")]);
345
- j(h, (t, a) => {
345
+ j(y, (t, a) => {
346
346
  if (e.autoAdjust && t !== a && l.value > 1) {
347
- const g = a * (l.value - 1) + 1, d = Math.ceil(g / t);
348
- d !== l.value && (p.value = d, f("update:current", d), f("change", d));
347
+ const c = a * (l.value - 1) + 1, i = Math.ceil(c / t);
348
+ i !== l.value && (p.value = i, o("update:current", i), o("change", i));
349
349
  }
350
350
  }), j(u, (t, a) => {
351
- if (e.autoAdjust && t !== a && l.value > 1 && l.value > t) {
352
- const g = Math.max(t, 1);
353
- p.value = g, f("update:current", g), f("change", g);
354
- }
351
+ if (!e.autoAdjust || t === a)
352
+ return;
353
+ const c = S.value;
354
+ if (!h(c) || c <= t)
355
+ return;
356
+ const i = Math.max(t, 1);
357
+ p.value = i, o("update:current", i), o("change", i);
355
358
  });
356
- const q = m(() => [o.block, o.modifier(`size-${c.value}`), {
357
- [o.modifier("simple")]: e.simple,
358
- [o.modifier("disabled")]: e.disabled
359
+ const q = d(() => [g.block, g.modifier(`size-${m.value}`), {
360
+ [g.modifier("simple")]: e.simple,
361
+ [g.modifier("disabled")]: e.disabled
359
362
  }]);
360
363
  return () => {
361
364
  var t;
362
- return e.hideOnSinglePage && u.value <= 1 ? null : i("div", {
365
+ return e.hideOnSinglePage && u.value <= 1 ? null : n("div", {
363
366
  class: q.value
364
- }, [e.showTotal && i("span", {
365
- class: o.element("total")
366
- }, [((t = s.total) == null ? void 0 : t.call(s, {
367
+ }, [e.showTotal && n("span", {
368
+ class: g.element("total")
369
+ }, [((t = f.total) == null ? void 0 : t.call(f, {
367
370
  total: e.total
368
371
  })) ?? I("pagination.total", {
369
372
  total: e.total
370
- })]), T(), e.showPageSize && i(K, {
373
+ })]), T(), e.showPageSize && n(K, {
371
374
  disabled: e.disabled,
372
375
  sizeOptions: e.pageSizeOptions,
373
- pageSize: h.value,
374
- size: c.value,
376
+ pageSize: y.value,
377
+ size: m.value,
375
378
  onChange: J,
376
379
  selectProps: e.pageSizeProps
377
- }, null), !e.simple && e.showJumper && i(B, {
380
+ }, null), !e.simple && e.showJumper && n(B, {
378
381
  disabled: e.disabled,
379
382
  current: l.value,
380
383
  pages: u.value,
381
- size: c.value,
382
- onChange: S
384
+ size: m.value,
385
+ onChange: z
383
386
  }, {
384
- "jumper-prepend": s["jumper-prepend"],
385
- "jumper-append": s["jumper-append"]
387
+ "jumper-prepend": f["jumper-prepend"],
388
+ "jumper-append": f["jumper-append"]
386
389
  })]);
387
390
  };
388
391
  }
@@ -1,14 +1,14 @@
1
- import { defineComponent as y, getCurrentInstance as h, inject as N, computed as n, ref as j, reactive as w, onBeforeUnmount as B } from "vue";
2
- import E from "../../icons/default/check.js";
3
- import K from "../../icons/default/close.js";
4
- import { stepsInjectionKey as _ } from "./context.js";
5
- import { useIndex as A } from "../../_hooks/use-index.js";
6
- import { getClassNameMixin as u } from "../../_utils/config.js";
7
- const T = y({
1
+ import { defineComponent as j, getCurrentInstance as w, inject as B, computed as o, ref as f, reactive as E, onBeforeUnmount as K } from "vue";
2
+ import O from "../../icons/default/check.js";
3
+ import _ from "../../icons/default/close.js";
4
+ import { stepsInjectionKey as A } from "./context.js";
5
+ import { useIndex as D } from "../../_hooks/use-index.js";
6
+ import { getClassNameMixin as v } from "../../_utils/config.js";
7
+ const $ = j({
8
8
  name: "Step",
9
9
  components: {
10
- IconCheck: E,
11
- IconClose: K
10
+ IconCheck: O,
11
+ IconClose: _
12
12
  },
13
13
  slots: Object,
14
14
  props: {
@@ -59,57 +59,61 @@ const T = y({
59
59
  * @slot description
60
60
  */
61
61
  setup(a) {
62
- const o = u("steps--item"), l = h(), f = u("steps--icon"), e = N(_, void 0), s = n(() => (e == null ? void 0 : e.type) ?? "default"), t = j(), { innerIndex: v } = A({
63
- itemRef: t,
64
- selector: `.${o.block}`,
62
+ var m;
63
+ const i = v("steps--item"), c = w(), s = v("steps--icon"), e = B(A, void 0), b = o(() => (e == null ? void 0 : e.type) ?? "default"), d = f(), I = f(((m = e == null ? void 0 : e.registerOrder) == null ? void 0 : m.call(e)) ?? 1), { innerIndex: g } = D({
64
+ itemRef: d,
65
+ selector: `.${i.block}`,
65
66
  parentClassName: e == null ? void 0 : e.parentCls
66
- }), i = n(() => v.value + 1), r = n(
67
- () => a.status ?? (e == null ? void 0 : e.getStatus(i.value)) ?? "process"
68
- ), b = n(
69
- () => (e == null ? void 0 : e.errorSteps.includes(i.value + 1)) ?? !1
67
+ }), r = o(() => {
68
+ const n = g.value;
69
+ return (n >= 0 ? n : I.value - 1) + 1;
70
+ }), l = o(
71
+ () => a.status ?? (e == null ? void 0 : e.getStatus(r.value)) ?? "process"
72
+ ), S = o(
73
+ () => (e == null ? void 0 : e.errorSteps.includes(r.value + 1)) ?? !1
70
74
  );
71
- l && (e == null || e.addItem(
72
- l.uid,
73
- w({
74
- step: i,
75
- status: r
75
+ c && (e == null || e.addItem(
76
+ c.uid,
77
+ E({
78
+ step: r,
79
+ status: l
76
80
  })
77
- )), B(() => {
78
- l && (e == null || e.removeItem(l.uid));
81
+ )), K(() => {
82
+ c && (e == null || e.removeItem(c.uid));
79
83
  });
80
- const I = n(
84
+ const k = o(
81
85
  () => !(e != null && e.lineLess) && ((e == null ? void 0 : e.labelPlacement) === "vertical" || (e == null ? void 0 : e.direction) === "vertical")
82
- ), d = n(() => !!(e != null && e.changeable) && !a.disabled), m = n(() => i.value === (e == null ? void 0 : e.current)), S = (c) => {
83
- a.disabled || e == null || e.onClick(i.value, c);
84
- }, g = (c) => {
85
- !d.value || !["Enter", " "].includes(c.key) || (c.preventDefault(), e == null || e.onClick(i.value, c));
86
- }, k = n(() => [
87
- o.block,
88
- o.modifier(r.value),
86
+ ), t = o(() => !!(e != null && e.changeable) && !a.disabled), u = o(() => r.value === (e == null ? void 0 : e.current)), y = (n) => {
87
+ a.disabled || e == null || e.onClick(r.value, n);
88
+ }, h = (n) => {
89
+ !t.value || !["Enter", " "].includes(n.key) || (n.preventDefault(), e == null || e.onClick(r.value, n));
90
+ }, N = o(() => [
91
+ i.block,
92
+ i.modifier(l.value),
89
93
  {
90
- [o.modifier("active")]: m.value,
91
- [o.modifier("next-error")]: b.value,
92
- [o.modifier("disabled")]: a.disabled
94
+ [i.modifier("active")]: u.value,
95
+ [i.modifier("next-error")]: S.value,
96
+ [i.modifier("disabled")]: a.disabled
93
97
  // [`${prefixCls}-custom`]: !!icon,
94
98
  }
95
99
  ]);
96
100
  return {
97
- className: o,
98
- iconClassName: f,
99
- cls: k,
100
- itemRef: t,
101
- showTail: I,
102
- stepNumber: i,
103
- computedStatus: r,
104
- type: s,
101
+ className: i,
102
+ iconClassName: s,
103
+ cls: N,
104
+ itemRef: d,
105
+ showTail: k,
106
+ stepNumber: r,
107
+ computedStatus: l,
108
+ type: b,
105
109
  disabled: a.disabled,
106
- interactive: d,
107
- isActive: m,
108
- handleClick: S,
109
- handleKeydown: g
110
+ interactive: t,
111
+ isActive: u,
112
+ handleClick: y,
113
+ handleKeydown: h
110
114
  };
111
115
  }
112
116
  });
113
117
  export {
114
- T as default
118
+ $ as default
115
119
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as S, toRefs as z, ref as k, computed as n, reactive as m, provide as N } from "vue";
2
- import { stepsInjectionKey as w } from "./context.js";
3
- import { getClassNameMixin as B } from "../../_utils/config.js";
4
- const x = S({
1
+ import { defineComponent as k, toRefs as N, ref as w, computed as n, reactive as m, provide as B } from "vue";
2
+ import { stepsInjectionKey as I } from "./context.js";
3
+ import { getClassNameMixin as M } from "../../_utils/config.js";
4
+ const $ = k({
5
5
  name: "Steps",
6
6
  props: {
7
7
  /**
@@ -92,20 +92,22 @@ const x = S({
92
92
  */
93
93
  change: (e, l) => !0
94
94
  },
95
- setup(e, { emit: l, slots: I }) {
96
- const { type: s, lineLess: c, changeable: v } = z(e), a = B("steps"), d = k(e.defaultCurrent), r = n(() => e.current ?? d.value), i = n(
95
+ setup(e, { emit: l, slots: P }) {
96
+ const { type: s, lineLess: c, changeable: v } = N(e), a = M("steps"), d = w(e.defaultCurrent), r = n(() => e.current ?? d.value), o = n(
97
97
  () => ["navigation", "arrow"].includes(e.type) ? "horizontal" : e.direction
98
- ), f = n(() => e.type === "dot" ? i.value === "vertical" ? "horizontal" : "vertical" : e.type === "navigation" ? "horizontal" : e.labelPlacement), y = (t) => t < r.value ? "finish" : t > r.value ? "wait" : e.status, g = (t, u) => {
98
+ ), f = n(() => e.type === "dot" ? o.value === "vertical" ? "horizontal" : "vertical" : e.type === "navigation" ? "horizontal" : e.labelPlacement), y = (t) => t < r.value ? "finish" : t > r.value ? "wait" : e.status, g = (t, u) => {
99
99
  e.changeable && (d.value = t, l("update:current", t), l("change", t, u));
100
- }, o = m(/* @__PURE__ */ new Map()), h = n(
101
- () => Array.from(o.values()).filter((t) => t.status === "error").map((t) => t.step)
100
+ }, i = m(/* @__PURE__ */ new Map()), h = n(
101
+ () => Array.from(i.values()).filter((t) => t.status === "error").map((t) => t.step)
102
102
  ), p = (t, u) => {
103
- o.set(t, u);
103
+ i.set(t, u);
104
104
  }, b = (t) => {
105
- o.delete(t);
106
- }, C = n(() => [
105
+ i.delete(t);
106
+ };
107
+ let C = 0;
108
+ const S = () => ++C, z = n(() => [
107
109
  a.block,
108
- a.modifier(i.value),
110
+ a.modifier(o.value),
109
111
  a.element(`label-${f.value}`),
110
112
  a.modifier(`mode-${s.value}`),
111
113
  {
@@ -114,11 +116,11 @@ const x = S({
114
116
  [a.modifier("line-less")]: c.value
115
117
  }
116
118
  ]);
117
- return N(
118
- w,
119
+ return B(
120
+ I,
119
121
  m({
120
122
  type: s,
121
- direction: i,
123
+ direction: o,
122
124
  labelPlacement: f,
123
125
  lineLess: c,
124
126
  changeable: v,
@@ -128,13 +130,14 @@ const x = S({
128
130
  addItem: p,
129
131
  removeItem: b,
130
132
  onClick: g,
131
- parentCls: a.block
133
+ parentCls: a.block,
134
+ registerOrder: S
132
135
  })
133
136
  ), {
134
- cls: C
137
+ cls: z
135
138
  };
136
139
  }
137
140
  });
138
141
  export {
139
- x as default
142
+ $ as default
140
143
  };
@@ -1,13 +1,15 @@
1
- import o from "./TabPane.vue2.js";
2
- import { openBlock as a, createElementBlock as t, normalizeClass as n, renderSlot as r, createCommentVNode as s } from "vue";
3
- import i from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = ["tabindex", "aria-hidden"];
5
- function l(e, d, c, p, f, u) {
1
+ import i from "./TabPane.vue2.js";
2
+ import { openBlock as a, createElementBlock as t, normalizeClass as n, renderSlot as o, createCommentVNode as r } from "vue";
3
+ import l from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = ["id", "tabindex", "aria-hidden", "aria-labelledby"];
5
+ function d(e, m, c, p, f, b) {
6
6
  return a(), t("div", {
7
7
  ref: "itemRef",
8
8
  role: "tabpanel",
9
+ id: e.panelId,
9
10
  tabindex: e.active ? 0 : -1,
10
11
  "aria-hidden": !e.active,
12
+ "aria-labelledby": e.tabId,
11
13
  class: n([
12
14
  e.className.element("content--item"),
13
15
  { [`${e.className.element("content--item")}-active`]: e.active }
@@ -17,11 +19,11 @@ function l(e, d, c, p, f, u) {
17
19
  key: 0,
18
20
  class: n(e.className.element("pane"))
19
21
  }, [
20
- r(e.$slots, "default")
21
- ], 2)) : s("", !0)
22
- ], 10, m);
22
+ o(e.$slots, "default")
23
+ ], 2)) : r("", !0)
24
+ ], 10, s);
23
25
  }
24
- const h = /* @__PURE__ */ i(o, [["render", l]]);
26
+ const h = /* @__PURE__ */ l(i, [["render", d]]);
25
27
  export {
26
28
  h as default
27
29
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as I, toRefs as g, getCurrentInstance as H, inject as O, ref as m, computed as c, reactive as j, onBeforeUnmount as k, watch as K, onUpdated as N } from "vue";
2
- import { tabsInjectionKey as R } from "./context.js";
3
- import { getClassNameMixin as U } from "../../_utils/config.js";
4
- const z = I({
1
+ import { defineComponent as O, toRefs as j, getCurrentInstance as k, inject as K, ref as y, computed as d, reactive as N, onBeforeUnmount as R, watch as U, onUpdated as _ } from "vue";
2
+ import { tabsInjectionKey as $ } from "./context.js";
3
+ import { getClassNameMixin as h } from "../../_utils/config.js";
4
+ const L = O({
5
5
  name: "TabPane",
6
6
  props: {
7
7
  /**
@@ -40,34 +40,38 @@ const z = I({
40
40
  * @en Tab title
41
41
  * @slot title
42
42
  */
43
- setup(d, { slots: n }) {
44
- var s, r;
45
- const { title: v, disabled: p, closable: y } = g(d), e = H(), b = U("tabs"), t = O(R, {}), B = m(), i = c(() => e == null ? void 0 : e.vnode.key), l = c(() => {
43
+ setup(n, { slots: s }) {
44
+ var m, p;
45
+ const { title: b, disabled: I, closable: B } = j(n), e = k(), g = h("tabs"), t = K($, {}), H = y(), u = d(() => e == null ? void 0 : e.vnode.key), l = d(() => {
46
46
  var o;
47
- return i.value === ((o = t.activeKey) == null ? void 0 : o.value);
48
- }), a = m((s = t.lazyLoad) != null && s.value ? l.value : !0), u = j({
49
- key: i,
50
- title: v,
51
- disabled: p,
52
- closable: y,
53
- slots: n
47
+ return u.value === ((o = t.activeKey) == null ? void 0 : o.value);
48
+ }), a = y((m = t.lazyLoad) != null && m.value ? l.value : !0), i = e == null ? void 0 : e.uid, r = d(() => `x-tabs-tab-${i}`), f = d(() => `x-tabs-panel-${i}`), c = N({
49
+ key: u,
50
+ title: b,
51
+ disabled: I,
52
+ closable: B,
53
+ slots: s,
54
+ tabId: r,
55
+ panelId: f
54
56
  });
55
- return e != null && e.uid && ((r = t.addItem) == null || r.call(t, e.uid, u)), k(() => {
57
+ return e != null && e.uid && ((p = t.addItem) == null || p.call(t, e.uid, c)), R(() => {
56
58
  var o;
57
59
  e != null && e.uid && ((o = t.removeItem) == null || o.call(t, e.uid));
58
- }), K(l, (o) => {
59
- var f;
60
- o ? a.value || (a.value = !0) : (d.destroyOnHide || (f = t.destroyOnHide) != null && f.value) && (a.value = !1);
61
- }), N(() => {
62
- u.slots = { ...n };
60
+ }), U(l, (o) => {
61
+ var v;
62
+ o ? a.value || (a.value = !0) : (n.destroyOnHide || (v = t.destroyOnHide) != null && v.value) && (a.value = !1);
63
+ }), _(() => {
64
+ c.slots = { ...s };
63
65
  }), {
64
- className: b,
66
+ className: g,
65
67
  active: l,
66
- itemRef: B,
67
- mounted: a
68
+ itemRef: H,
69
+ mounted: a,
70
+ tabId: r,
71
+ panelId: f
68
72
  };
69
73
  }
70
74
  });
71
75
  export {
72
- z as default
76
+ L as default
73
77
  };