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.
- package/AI_USAGE.md +2 -2
- package/CHANGELOG.md +35 -0
- package/dist/components/dropdown/DropdownButton.vue.d.ts +2 -1
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/steps/context.d.ts +9 -0
- package/dist/components/tabs/TabPane.vue.d.ts +2 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/interface.d.ts +4 -0
- package/dist/es/components/dropdown/Dropdown.vue2.js +11 -4
- package/dist/es/components/dropdown/DropdownButton.vue.js +8 -7
- package/dist/es/components/dropdown/DropdownButton.vue2.js +19 -17
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +18 -17
- package/dist/es/components/menu/MenuSubMenu.js +50 -36
- package/dist/es/components/menu/sub-menu-pop.vue2.js +30 -30
- package/dist/es/components/pagination/Pagination.js +73 -70
- package/dist/es/components/steps/Step.vue2.js +51 -47
- package/dist/es/components/steps/Steps.vue2.js +22 -19
- package/dist/es/components/tabs/TabPane.vue.js +11 -9
- package/dist/es/components/tabs/TabPane.vue2.js +28 -24
- package/dist/es/components/tabs/tabs-nav.js +20 -18
- package/dist/es/components/tabs/tabs-tab.vue.js +10 -8
- package/dist/es/locale/en-US.js +2 -1
- package/dist/es/locale/zh-CN.js +2 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +2 -0
- package/dist/style/dropdown.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/steps.css +1 -1
- package/dist/style/tabs.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as F, toRefs as $, ref as
|
|
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
|
|
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:
|
|
215
|
-
slots:
|
|
214
|
+
emit: o,
|
|
215
|
+
slots: f
|
|
216
216
|
}) {
|
|
217
|
-
const
|
|
217
|
+
const g = U("pagination"), {
|
|
218
218
|
t: I
|
|
219
219
|
} = W(), {
|
|
220
|
-
disabled:
|
|
220
|
+
disabled: P,
|
|
221
221
|
pageItemStyle: A,
|
|
222
222
|
activePageItemStyle: E,
|
|
223
223
|
size: L
|
|
224
224
|
} = $(e), {
|
|
225
|
-
mergedSize:
|
|
226
|
-
} = Q(L), p =
|
|
227
|
-
if (t !== l.value &&
|
|
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,
|
|
229
|
+
a !== l.value && (p.value = a, o("update:current", a), o("change", a));
|
|
230
230
|
}
|
|
231
231
|
}, J = (t) => {
|
|
232
|
-
|
|
233
|
-
},
|
|
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:
|
|
237
|
+
onClick: z
|
|
238
238
|
}), V = {
|
|
239
239
|
get current() {
|
|
240
|
-
return
|
|
240
|
+
return s.current;
|
|
241
241
|
},
|
|
242
242
|
get disabled() {
|
|
243
|
-
return
|
|
243
|
+
return P.value;
|
|
244
244
|
},
|
|
245
245
|
get style() {
|
|
246
|
-
return
|
|
246
|
+
return s.style;
|
|
247
247
|
},
|
|
248
248
|
get activeStyle() {
|
|
249
|
-
return
|
|
249
|
+
return s.activeStyle;
|
|
250
250
|
},
|
|
251
251
|
get onClick() {
|
|
252
|
-
return
|
|
252
|
+
return s.onClick;
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, w = {
|
|
255
255
|
get current() {
|
|
256
|
-
return
|
|
256
|
+
return s.current;
|
|
257
257
|
},
|
|
258
258
|
get disabled() {
|
|
259
|
-
return
|
|
259
|
+
return P.value;
|
|
260
260
|
},
|
|
261
261
|
get style() {
|
|
262
|
-
return
|
|
262
|
+
return s.style;
|
|
263
263
|
},
|
|
264
264
|
get onClick() {
|
|
265
|
-
return
|
|
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
|
|
272
|
+
return s.current;
|
|
273
273
|
},
|
|
274
274
|
get style() {
|
|
275
|
-
return
|
|
275
|
+
return s.style;
|
|
276
276
|
},
|
|
277
277
|
get onClick() {
|
|
278
|
-
return
|
|
278
|
+
return s.onClick;
|
|
279
279
|
},
|
|
280
280
|
get pages() {
|
|
281
281
|
return u.value;
|
|
282
282
|
}
|
|
283
|
-
}, r = (t, a = {}) => t === "more" ?
|
|
284
|
-
default:
|
|
285
|
-
}) : t === "previous" ?
|
|
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,
|
|
288
|
-
default:
|
|
289
|
-
}) : t === "next" ?
|
|
287
|
+
}, a, w), {
|
|
288
|
+
default: f["page-item-step"]
|
|
289
|
+
}) : t === "next" ? n(O, b({
|
|
290
290
|
type: "next"
|
|
291
|
-
}, a,
|
|
292
|
-
default:
|
|
293
|
-
}) :
|
|
294
|
-
default:
|
|
295
|
-
}), R =
|
|
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,
|
|
305
|
-
l.value > 2 + e.bufferSize && (
|
|
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 <=
|
|
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
|
-
|
|
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 ?
|
|
327
|
-
class:
|
|
326
|
+
}), T = () => e.simple ? n("span", {
|
|
327
|
+
class: g.element("simple")
|
|
328
328
|
}, [r("previous", {
|
|
329
329
|
simple: !0
|
|
330
|
-
}),
|
|
330
|
+
}), n(B, {
|
|
331
331
|
disabled: e.disabled,
|
|
332
332
|
current: l.value,
|
|
333
|
-
size:
|
|
333
|
+
size: m.value,
|
|
334
334
|
pages: u.value,
|
|
335
335
|
simple: !0,
|
|
336
|
-
onChange:
|
|
336
|
+
onChange: z
|
|
337
337
|
}, null), r("next", {
|
|
338
338
|
simple: !0
|
|
339
|
-
})]) :
|
|
340
|
-
class:
|
|
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(
|
|
345
|
+
j(y, (t, a) => {
|
|
346
346
|
if (e.autoAdjust && t !== a && l.value > 1) {
|
|
347
|
-
const
|
|
348
|
-
|
|
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
|
|
352
|
-
|
|
353
|
-
|
|
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 =
|
|
357
|
-
[
|
|
358
|
-
[
|
|
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 :
|
|
365
|
+
return e.hideOnSinglePage && u.value <= 1 ? null : n("div", {
|
|
363
366
|
class: q.value
|
|
364
|
-
}, [e.showTotal &&
|
|
365
|
-
class:
|
|
366
|
-
}, [((t =
|
|
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 &&
|
|
373
|
+
})]), T(), e.showPageSize && n(K, {
|
|
371
374
|
disabled: e.disabled,
|
|
372
375
|
sizeOptions: e.pageSizeOptions,
|
|
373
|
-
pageSize:
|
|
374
|
-
size:
|
|
376
|
+
pageSize: y.value,
|
|
377
|
+
size: m.value,
|
|
375
378
|
onChange: J,
|
|
376
379
|
selectProps: e.pageSizeProps
|
|
377
|
-
}, null), !e.simple && e.showJumper &&
|
|
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:
|
|
382
|
-
onChange:
|
|
384
|
+
size: m.value,
|
|
385
|
+
onChange: z
|
|
383
386
|
}, {
|
|
384
|
-
"jumper-prepend":
|
|
385
|
-
"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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { stepsInjectionKey as
|
|
5
|
-
import { useIndex as
|
|
6
|
-
import { getClassNameMixin as
|
|
7
|
-
const
|
|
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:
|
|
11
|
-
IconClose:
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
step:
|
|
75
|
-
status:
|
|
75
|
+
c && (e == null || e.addItem(
|
|
76
|
+
c.uid,
|
|
77
|
+
E({
|
|
78
|
+
step: r,
|
|
79
|
+
status: l
|
|
76
80
|
})
|
|
77
|
-
)),
|
|
78
|
-
|
|
81
|
+
)), K(() => {
|
|
82
|
+
c && (e == null || e.removeItem(c.uid));
|
|
79
83
|
});
|
|
80
|
-
const
|
|
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
|
-
),
|
|
83
|
-
a.disabled || e == null || e.onClick(
|
|
84
|
-
},
|
|
85
|
-
!
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
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:
|
|
98
|
-
iconClassName:
|
|
99
|
-
cls:
|
|
100
|
-
itemRef:
|
|
101
|
-
showTail:
|
|
102
|
-
stepNumber:
|
|
103
|
-
computedStatus:
|
|
104
|
-
type:
|
|
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:
|
|
107
|
-
isActive:
|
|
108
|
-
handleClick:
|
|
109
|
-
handleKeydown:
|
|
110
|
+
interactive: t,
|
|
111
|
+
isActive: u,
|
|
112
|
+
handleClick: y,
|
|
113
|
+
handleKeydown: h
|
|
110
114
|
};
|
|
111
115
|
}
|
|
112
116
|
});
|
|
113
117
|
export {
|
|
114
|
-
|
|
118
|
+
$ as default
|
|
115
119
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { stepsInjectionKey as
|
|
3
|
-
import { getClassNameMixin as
|
|
4
|
-
const
|
|
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:
|
|
96
|
-
const { type: s, lineLess: c, changeable: v } =
|
|
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" ?
|
|
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
|
-
},
|
|
101
|
-
() => Array.from(
|
|
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
|
-
|
|
103
|
+
i.set(t, u);
|
|
104
104
|
}, b = (t) => {
|
|
105
|
-
|
|
106
|
-
}
|
|
105
|
+
i.delete(t);
|
|
106
|
+
};
|
|
107
|
+
let C = 0;
|
|
108
|
+
const S = () => ++C, z = n(() => [
|
|
107
109
|
a.block,
|
|
108
|
-
a.modifier(
|
|
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
|
|
118
|
-
|
|
119
|
+
return B(
|
|
120
|
+
I,
|
|
119
121
|
m({
|
|
120
122
|
type: s,
|
|
121
|
-
direction:
|
|
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:
|
|
137
|
+
cls: z
|
|
135
138
|
};
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
141
|
export {
|
|
139
|
-
|
|
142
|
+
$ as default
|
|
140
143
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as a, createElementBlock as t, normalizeClass as n, renderSlot as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
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
|
-
|
|
21
|
-
], 2)) :
|
|
22
|
-
], 10,
|
|
22
|
+
o(e.$slots, "default")
|
|
23
|
+
], 2)) : r("", !0)
|
|
24
|
+
], 10, s);
|
|
23
25
|
}
|
|
24
|
-
const h = /* @__PURE__ */ i
|
|
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
|
|
2
|
-
import { tabsInjectionKey as
|
|
3
|
-
import { getClassNameMixin as
|
|
4
|
-
const
|
|
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(
|
|
44
|
-
var
|
|
45
|
-
const { title:
|
|
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
|
|
48
|
-
}), a =
|
|
49
|
-
key:
|
|
50
|
-
title:
|
|
51
|
-
disabled:
|
|
52
|
-
closable:
|
|
53
|
-
slots:
|
|
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 && ((
|
|
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
|
-
}),
|
|
59
|
-
var
|
|
60
|
-
o ? a.value || (a.value = !0) : (
|
|
61
|
-
}),
|
|
62
|
-
|
|
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:
|
|
66
|
+
className: g,
|
|
65
67
|
active: l,
|
|
66
|
-
itemRef:
|
|
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
|
-
|
|
76
|
+
L as default
|
|
73
77
|
};
|