x-next 1.12.0 → 1.13.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/catalog.md +1 -1
- package/AI_USAGE/components/alert.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/button.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker.md +1 -1
- package/AI_USAGE/components/dialog.md +1 -1
- package/AI_USAGE/components/dropdown.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/line-chart.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination.md +7 -3
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +1 -1
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +8 -4
- package/CHANGELOG.md +22 -0
- package/dist/components/network/Network.vue.d.ts +7 -3
- package/dist/components/network/index.d.ts +10 -2
- package/dist/components/network/props.d.ts +5 -0
- package/dist/components/network/utils.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +4 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +101 -130
- package/dist/components/pagination/page-item.vue.d.ts +1 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +1 -1
- package/dist/components/pagination/page-options.vue.d.ts +6 -4
- package/dist/components/pagination/utils.d.ts +3 -0
- package/dist/components/time-range-selector/index.d.ts +6 -6
- package/dist/es/_container/resize-observer-v2.js +1 -1
- package/dist/es/_container/resize-observer.js +1 -1
- package/dist/es/_hooks/use-resize-observer.js +1 -1
- package/dist/es/_styles/palette-aliases.js +4 -4
- package/dist/es/_virtual/advancedFormat.js +1 -1
- package/dist/es/_virtual/customParseFormat.js +1 -1
- package/dist/es/_virtual/dayjs.min.js +1 -1
- package/dist/es/_virtual/isBetween.js +1 -1
- package/dist/es/_virtual/quarterOfYear.js +1 -1
- package/dist/es/_virtual/weekOfYear.js +1 -1
- package/dist/es/_virtual/weekYear.js +1 -1
- package/dist/es/_virtual/zh-cn.js +1 -1
- package/dist/es/components/button/Button.js +53 -42
- package/dist/es/components/draggable/useDraggable.js +1 -1
- package/dist/es/components/form/Form.vue2.js +1 -1
- package/dist/es/components/form/FormItem.vue2.js +1 -1
- package/dist/es/components/form-input-number/InputNumber.js +1 -1
- package/dist/es/components/form-slider/Slider.vue2.js +1 -1
- package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
- package/dist/es/components/form-slider/utils.js +1 -1
- package/dist/es/components/menu/MenuItem.js +1 -1
- package/dist/es/components/menu/overflow-wrap.js +1 -1
- package/dist/es/components/network/Network.vue.js +17 -12
- package/dist/es/components/network/Network.vue2.js +78 -70
- package/dist/es/components/network/utils.js +112 -71
- package/dist/es/components/pagination/Pagination.js +132 -123
- package/dist/es/components/pagination/page-item-ellipsis.vue.js +10 -10
- package/dist/es/components/pagination/page-item-ellipsis.vue2.js +24 -19
- package/dist/es/components/pagination/page-item-step.vue.js +14 -11
- package/dist/es/components/pagination/page-item-step.vue2.js +20 -22
- package/dist/es/components/pagination/page-item.vue.js +10 -9
- package/dist/es/components/pagination/page-item.vue2.js +24 -19
- package/dist/es/components/pagination/page-jumper.vue2.js +23 -23
- package/dist/es/components/pagination/page-options.vue.js +15 -10
- package/dist/es/components/pagination/page-options.vue2.js +21 -17
- package/dist/es/components/pagination/utils.js +4 -2
- package/dist/es/components/progress/circle.vue2.js +1 -1
- package/dist/es/components/progress/line.vue2.js +1 -1
- package/dist/es/components/progress/steps.vue2.js +1 -1
- package/dist/es/components/rate/Rate.js +1 -1
- package/dist/es/components/virtual-list-v2/virtual-list-item.js +1 -1
- package/dist/es/locale/en-US.js +2 -0
- package/dist/es/locale/zh-CN.js +2 -0
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/locale/interface.d.ts +3 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/form-select.css +1 -1
- package/dist/style/network.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { isNumber as
|
|
8
|
-
import { useSize as
|
|
9
|
-
import { getClassNameMixin as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
|
|
1
|
+
import { defineComponent as U, toRefs as Y, ref as B, computed as s, reactive as Z, watch as ee, createVNode as l, mergeProps as S, nextTick as te } from "vue";
|
|
2
|
+
import ae from "./page-item.vue.js";
|
|
3
|
+
import I from "./page-item-step.vue.js";
|
|
4
|
+
import re from "./page-item-ellipsis.vue.js";
|
|
5
|
+
import T from "./page-jumper.vue.js";
|
|
6
|
+
import ue from "./page-options.vue.js";
|
|
7
|
+
import { isNumber as le } from "../../_utils/is.js";
|
|
8
|
+
import { useSize as ne } from "../../_hooks/use-size.js";
|
|
9
|
+
import { getClassNameMixin as ie } from "../../_utils/config.js";
|
|
10
|
+
import { useLocale as se } from "../../locale/index.js";
|
|
11
|
+
import { normalizeInteger as P, isValidPageSize as A } from "./utils.js";
|
|
12
|
+
const Se = /* @__PURE__ */ U({
|
|
12
13
|
name: "Pagination",
|
|
13
14
|
props: {
|
|
14
15
|
/**
|
|
@@ -214,184 +215,192 @@ const oe = /* @__PURE__ */ D({
|
|
|
214
215
|
emit: f,
|
|
215
216
|
slots: o
|
|
216
217
|
}) {
|
|
217
|
-
const
|
|
218
|
-
t:
|
|
219
|
-
} =
|
|
220
|
-
disabled:
|
|
221
|
-
pageItemStyle:
|
|
222
|
-
activePageItemStyle:
|
|
223
|
-
size:
|
|
224
|
-
} =
|
|
225
|
-
mergedSize:
|
|
226
|
-
} =
|
|
218
|
+
const d = ie("pagination"), {
|
|
219
|
+
t: z
|
|
220
|
+
} = se(), {
|
|
221
|
+
disabled: C,
|
|
222
|
+
pageItemStyle: _,
|
|
223
|
+
activePageItemStyle: L,
|
|
224
|
+
size: K
|
|
225
|
+
} = Y(t), {
|
|
226
|
+
mergedSize: h
|
|
227
|
+
} = ne(K), k = B(t.defaultCurrent), x = B(t.defaultPageSize), E = (e, a = 10) => A(e) ? e : a, R = s(() => t.current ?? k.value), y = s(() => E(t.pageSize ?? x.value, E(t.defaultPageSize))), N = s(() => {
|
|
227
228
|
const e = t.total;
|
|
228
|
-
return
|
|
229
|
-
}),
|
|
230
|
-
const e =
|
|
231
|
-
return
|
|
232
|
-
}),
|
|
233
|
-
if (e
|
|
234
|
-
const a = Math.min(Math.max(e, 1),
|
|
235
|
-
a !==
|
|
229
|
+
return P(e, 0, 0, Number.MAX_SAFE_INTEGER);
|
|
230
|
+
}), j = s(() => {
|
|
231
|
+
const e = R.value;
|
|
232
|
+
return P(e, 1, 1, Number.MAX_SAFE_INTEGER);
|
|
233
|
+
}), q = s(() => P(t.baseSize, 6, 1, 100)), n = s(() => P(t.bufferSize, 2, 0, 100)), r = s(() => Math.max(Math.ceil(N.value / y.value), 1)), m = s(() => Math.min(Math.max(j.value, 1), r.value)), M = (e) => {
|
|
234
|
+
if (le(e) && Number.isFinite(e) && !t.disabled) {
|
|
235
|
+
const a = Math.min(Math.max(Math.trunc(e), 1), r.value);
|
|
236
|
+
a !== m.value && (k.value = a, f("update:current", a), f("change", a));
|
|
236
237
|
}
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
},
|
|
240
|
-
current:
|
|
241
|
-
style:
|
|
242
|
-
activeStyle:
|
|
243
|
-
onClick:
|
|
244
|
-
}),
|
|
238
|
+
}, F = (e) => {
|
|
239
|
+
t.disabled || !A(e) || e === y.value || (x.value = e, f("update:pageSize", e), f("pageSizeChange", e));
|
|
240
|
+
}, i = Z({
|
|
241
|
+
current: m,
|
|
242
|
+
style: _,
|
|
243
|
+
activeStyle: L,
|
|
244
|
+
onClick: M
|
|
245
|
+
}), J = {
|
|
245
246
|
get current() {
|
|
246
|
-
return
|
|
247
|
+
return i.current;
|
|
247
248
|
},
|
|
248
249
|
get disabled() {
|
|
249
|
-
return
|
|
250
|
+
return C.value;
|
|
250
251
|
},
|
|
251
252
|
get style() {
|
|
252
|
-
return
|
|
253
|
+
return i.style;
|
|
253
254
|
},
|
|
254
255
|
get activeStyle() {
|
|
255
|
-
return
|
|
256
|
+
return i.activeStyle;
|
|
256
257
|
},
|
|
257
258
|
get onClick() {
|
|
258
|
-
return
|
|
259
|
+
return i.onClick;
|
|
259
260
|
}
|
|
260
|
-
},
|
|
261
|
+
}, O = {
|
|
261
262
|
get current() {
|
|
262
|
-
return
|
|
263
|
+
return i.current;
|
|
263
264
|
},
|
|
264
265
|
get disabled() {
|
|
265
|
-
return
|
|
266
|
+
return C.value;
|
|
266
267
|
},
|
|
267
268
|
get style() {
|
|
268
|
-
return
|
|
269
|
+
return i.style;
|
|
269
270
|
},
|
|
270
271
|
get onClick() {
|
|
271
|
-
return
|
|
272
|
+
return i.onClick;
|
|
272
273
|
},
|
|
273
274
|
get pages() {
|
|
274
|
-
return
|
|
275
|
+
return r.value;
|
|
275
276
|
}
|
|
276
|
-
},
|
|
277
|
+
}, V = {
|
|
277
278
|
get current() {
|
|
278
|
-
return
|
|
279
|
+
return i.current;
|
|
279
280
|
},
|
|
280
281
|
get disabled() {
|
|
281
|
-
return
|
|
282
|
+
return C.value;
|
|
282
283
|
},
|
|
283
284
|
get style() {
|
|
284
|
-
return
|
|
285
|
+
return i.style;
|
|
285
286
|
},
|
|
286
287
|
get onClick() {
|
|
287
|
-
return
|
|
288
|
+
return i.onClick;
|
|
288
289
|
},
|
|
289
290
|
get pages() {
|
|
290
|
-
return
|
|
291
|
+
return r.value;
|
|
291
292
|
}
|
|
292
|
-
},
|
|
293
|
+
}, u = (e, a = {}) => e === "more" ? l(re, S(a, V), {
|
|
293
294
|
default: o["page-item-ellipsis"]
|
|
294
|
-
}) : e === "previous" ?
|
|
295
|
+
}) : e === "previous" ? l(I, S({
|
|
295
296
|
type: "previous"
|
|
296
|
-
}, a,
|
|
297
|
+
}, a, O), {
|
|
297
298
|
default: o["page-item-step"]
|
|
298
|
-
}) : e === "next" ?
|
|
299
|
+
}) : e === "next" ? l(I, S({
|
|
299
300
|
type: "next"
|
|
300
|
-
}, a,
|
|
301
|
+
}, a, O), {
|
|
301
302
|
default: o["page-item-step"]
|
|
302
|
-
}) :
|
|
303
|
+
}) : l(ae, S(a, J), {
|
|
303
304
|
default: o["page-item"]
|
|
304
|
-
}),
|
|
305
|
+
}), G = s(() => {
|
|
305
306
|
const e = [];
|
|
306
|
-
if (
|
|
307
|
-
for (let a = 1; a <=
|
|
308
|
-
e.push(
|
|
307
|
+
if (r.value < q.value + n.value * 2)
|
|
308
|
+
for (let a = 1; a <= r.value; a++)
|
|
309
|
+
e.push(u("page", {
|
|
309
310
|
key: a,
|
|
310
311
|
pageNumber: a
|
|
311
312
|
}));
|
|
312
313
|
else {
|
|
313
|
-
let a = 1,
|
|
314
|
-
|
|
314
|
+
let a = 1, c = r.value, g = !1, v = !1;
|
|
315
|
+
m.value > 2 + n.value && (g = !0, a = Math.min(m.value - n.value, r.value - 2 * n.value)), m.value < r.value - (n.value + 1) && (v = !0, c = Math.max(m.value + n.value, 2 * n.value + 1)), g && (e.push(u("page", {
|
|
315
316
|
key: 1,
|
|
316
317
|
pageNumber: 1
|
|
317
|
-
})), e.push(
|
|
318
|
+
})), e.push(u("more", {
|
|
318
319
|
key: "left-ellipsis-pager",
|
|
319
|
-
step: -(
|
|
320
|
+
step: -(n.value * 2 + 1)
|
|
320
321
|
})));
|
|
321
|
-
for (let
|
|
322
|
-
e.push(
|
|
323
|
-
key:
|
|
324
|
-
pageNumber:
|
|
322
|
+
for (let p = a; p <= c; p++)
|
|
323
|
+
e.push(u("page", {
|
|
324
|
+
key: p,
|
|
325
|
+
pageNumber: p
|
|
325
326
|
}));
|
|
326
|
-
|
|
327
|
+
v && (e.push(u("more", {
|
|
327
328
|
key: "right-ellipsis-pager",
|
|
328
|
-
step:
|
|
329
|
-
})), e.push(
|
|
330
|
-
key:
|
|
331
|
-
pageNumber:
|
|
329
|
+
step: n.value * 2 + 1
|
|
330
|
+
})), e.push(u("page", {
|
|
331
|
+
key: r.value,
|
|
332
|
+
pageNumber: r.value
|
|
332
333
|
})));
|
|
333
334
|
}
|
|
334
335
|
return e;
|
|
335
|
-
}),
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
}), w = /* @__PURE__ */ new WeakSet(), X = (e) => {
|
|
337
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
338
|
+
const a = e.target;
|
|
339
|
+
a.matches(".x-pagination--item") && a === document.activeElement && w.add(e);
|
|
340
|
+
}, W = (e) => {
|
|
341
|
+
if (!w.has(e)) return;
|
|
342
|
+
w.delete(e);
|
|
343
|
+
const a = e.target, c = e.currentTarget;
|
|
344
|
+
te(() => {
|
|
345
|
+
var g;
|
|
346
|
+
!a.isConnected && c.isConnected && document.activeElement === document.body && ((g = c.querySelector('[aria-current="page"]')) == null || g.focus());
|
|
347
|
+
});
|
|
348
|
+
}, $ = () => t.simple ? l("span", {
|
|
349
|
+
class: d.element("simple")
|
|
350
|
+
}, [u("previous", {
|
|
338
351
|
simple: !0
|
|
339
|
-
}),
|
|
352
|
+
}), l(T, {
|
|
340
353
|
disabled: t.disabled,
|
|
341
|
-
current:
|
|
342
|
-
size:
|
|
343
|
-
pages:
|
|
354
|
+
current: m.value,
|
|
355
|
+
size: h.value,
|
|
356
|
+
pages: r.value,
|
|
344
357
|
simple: !0,
|
|
345
|
-
onChange:
|
|
346
|
-
}, null),
|
|
358
|
+
onChange: M
|
|
359
|
+
}, null), u("next", {
|
|
347
360
|
simple: !0
|
|
348
|
-
})]) :
|
|
349
|
-
class:
|
|
350
|
-
|
|
361
|
+
})]) : l("ul", {
|
|
362
|
+
class: d.element("list"),
|
|
363
|
+
onKeydownCapture: X,
|
|
364
|
+
onKeydown: W
|
|
365
|
+
}, [u("previous"), G.value, t.showMore && u("more", {
|
|
351
366
|
key: "more",
|
|
352
|
-
step:
|
|
353
|
-
}),
|
|
354
|
-
|
|
355
|
-
if (t.autoAdjust
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
}), B(u, (e, a) => {
|
|
360
|
-
if (!t.autoAdjust || e === a || x.value <= e)
|
|
361
|
-
return;
|
|
362
|
-
const i = Math.max(e, 1);
|
|
363
|
-
p.value = i, f("update:current", i), f("change", i);
|
|
367
|
+
step: n.value * 2 + 1
|
|
368
|
+
}), u("next")]);
|
|
369
|
+
ee([y, r, j], ([e, a, c], [g, v, p]) => {
|
|
370
|
+
if (!t.autoAdjust || c !== p || e === g && a === v) return;
|
|
371
|
+
const H = Math.min(p, v), Q = e === g ? c : Math.floor((H - 1) * g / e) + 1, b = Math.min(Q, a);
|
|
372
|
+
b !== c && (k.value = b, f("update:current", b), f("change", b));
|
|
364
373
|
});
|
|
365
|
-
const
|
|
366
|
-
[
|
|
367
|
-
[
|
|
374
|
+
const D = s(() => [d.block, d.modifier(`size-${h.value}`), {
|
|
375
|
+
[d.modifier("simple")]: t.simple,
|
|
376
|
+
[d.modifier("disabled")]: t.disabled
|
|
368
377
|
}]);
|
|
369
378
|
return () => {
|
|
370
379
|
var e;
|
|
371
|
-
return t.hideOnSinglePage &&
|
|
372
|
-
class:
|
|
380
|
+
return t.hideOnSinglePage && r.value <= 1 ? null : l("div", {
|
|
381
|
+
class: D.value,
|
|
373
382
|
role: "navigation",
|
|
374
|
-
"aria-label":
|
|
375
|
-
}, [t.showTotal &&
|
|
376
|
-
class:
|
|
383
|
+
"aria-label": z("pagination.ariaLabel")
|
|
384
|
+
}, [t.showTotal && l("span", {
|
|
385
|
+
class: d.element("total")
|
|
377
386
|
}, [((e = o.total) == null ? void 0 : e.call(o, {
|
|
378
|
-
total:
|
|
379
|
-
})) ??
|
|
380
|
-
total:
|
|
381
|
-
})]),
|
|
387
|
+
total: N.value
|
|
388
|
+
})) ?? z("pagination.total", {
|
|
389
|
+
total: N.value
|
|
390
|
+
})]), $(), t.showPageSize && l(ue, {
|
|
382
391
|
disabled: t.disabled,
|
|
383
392
|
sizeOptions: t.pageSizeOptions,
|
|
384
|
-
pageSize:
|
|
385
|
-
size:
|
|
386
|
-
onChange:
|
|
393
|
+
pageSize: y.value,
|
|
394
|
+
size: h.value,
|
|
395
|
+
onChange: F,
|
|
387
396
|
selectProps: t.pageSizeProps
|
|
388
|
-
}, null), !t.simple && t.showJumper &&
|
|
397
|
+
}, null), !t.simple && t.showJumper && l(T, {
|
|
389
398
|
disabled: t.disabled,
|
|
390
|
-
current:
|
|
391
|
-
pages:
|
|
392
|
-
size:
|
|
393
|
-
ariaLabel:
|
|
394
|
-
onChange:
|
|
399
|
+
current: m.value,
|
|
400
|
+
pages: r.value,
|
|
401
|
+
size: h.value,
|
|
402
|
+
ariaLabel: z("pagination.jumpTo"),
|
|
403
|
+
onChange: M
|
|
395
404
|
}, {
|
|
396
405
|
"jumper-prepend": o["jumper-prepend"],
|
|
397
406
|
"jumper-append": o["jumper-append"]
|
|
@@ -400,5 +409,5 @@ const oe = /* @__PURE__ */ D({
|
|
|
400
409
|
}
|
|
401
410
|
});
|
|
402
411
|
export {
|
|
403
|
-
|
|
412
|
+
Se as default
|
|
404
413
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import l from "./page-item-ellipsis.vue2.js";
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
2
|
+
import { resolveComponent as r, openBlock as i, createElementBlock as s, normalizeClass as d, renderSlot as t, createVNode as m } from "vue";
|
|
3
|
+
import p from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const b = ["tabindex", "aria-label", "aria-disabled"];
|
|
5
|
-
function f(e, o,
|
|
6
|
-
const a =
|
|
7
|
-
return
|
|
5
|
+
function f(e, o, g, u, k, C) {
|
|
6
|
+
const a = r("icon-more");
|
|
7
|
+
return i(), s("li", {
|
|
8
8
|
class: d(e.cls),
|
|
9
9
|
role: "button",
|
|
10
|
-
tabindex: e.
|
|
10
|
+
tabindex: e.mergedDisabled ? -1 : 0,
|
|
11
11
|
"aria-label": e.t("pagination.jumpToPage", { page: e.nextPage }),
|
|
12
|
-
"aria-disabled": e.
|
|
12
|
+
"aria-disabled": e.mergedDisabled || void 0,
|
|
13
13
|
onClick: o[0] || (o[0] = (...n) => e.handleClick && e.handleClick(...n)),
|
|
14
14
|
onKeydown: o[1] || (o[1] = (...n) => e.handleKeyDown && e.handleKeyDown(...n))
|
|
15
15
|
}, [
|
|
16
16
|
t(e.$slots, "default", {}, () => [
|
|
17
|
-
|
|
17
|
+
m(a)
|
|
18
18
|
])
|
|
19
19
|
], 42, b);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const w = /* @__PURE__ */ p(l, [["render", f]]);
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
w as default
|
|
24
24
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { getLegalPage as
|
|
4
|
-
import { getClassNameMixin as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
const x =
|
|
1
|
+
import { defineComponent as u, computed as r } from "vue";
|
|
2
|
+
import d from "../../icons/_self/more-dot.js";
|
|
3
|
+
import { getLegalPage as f } from "./utils.js";
|
|
4
|
+
import { getClassNameMixin as p } from "../../_utils/config.js";
|
|
5
|
+
import { useLocale as g } from "../../locale/index.js";
|
|
6
|
+
const x = u({
|
|
7
7
|
name: "EllipsisPager",
|
|
8
8
|
components: {
|
|
9
|
-
IconMore:
|
|
9
|
+
IconMore: d
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
12
|
current: {
|
|
@@ -27,24 +27,29 @@ const x = c({
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
emits: ["click"],
|
|
30
|
-
setup(e, { emit:
|
|
31
|
-
const
|
|
32
|
-
() =>
|
|
30
|
+
setup(e, { emit: l }) {
|
|
31
|
+
const t = p("pagination--item"), { t: s } = g(), a = r(
|
|
32
|
+
() => f(e.current + e.step, {
|
|
33
33
|
min: 1,
|
|
34
34
|
max: e.pages
|
|
35
35
|
})
|
|
36
|
-
), r = (
|
|
37
|
-
|
|
38
|
-
}, m = (
|
|
39
|
-
(
|
|
40
|
-
},
|
|
36
|
+
), i = r(() => e.disabled || a.value === e.current), n = (o) => {
|
|
37
|
+
i.value || l("click", a.value);
|
|
38
|
+
}, m = (o) => {
|
|
39
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), n());
|
|
40
|
+
}, c = r(() => [
|
|
41
|
+
t.block,
|
|
42
|
+
t.modifier("ellipsis"),
|
|
43
|
+
{ [t.modifier("disabled")]: i.value }
|
|
44
|
+
]);
|
|
41
45
|
return {
|
|
42
46
|
t: s,
|
|
43
|
-
className:
|
|
44
|
-
cls:
|
|
47
|
+
className: t,
|
|
48
|
+
cls: c,
|
|
45
49
|
// 模板的 aria-label 需要它(点击后真正跳转到的页码)
|
|
46
|
-
nextPage:
|
|
47
|
-
|
|
50
|
+
nextPage: a,
|
|
51
|
+
mergedDisabled: i,
|
|
52
|
+
handleClick: n,
|
|
48
53
|
handleKeyDown: m
|
|
49
54
|
};
|
|
50
55
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import n from "./page-item-step.vue2.js";
|
|
2
|
+
import { resolveComponent as a, openBlock as i, createBlock as r, resolveDynamicComponent as l, normalizeClass as t, withCtx as s, renderSlot as d, createVNode as p } from "vue";
|
|
3
3
|
import m from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
function c(e, f, b, u,
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
class:
|
|
4
|
+
function c(e, f, b, u, h, v) {
|
|
5
|
+
const o = a("x-icon");
|
|
6
|
+
return i(), r(l(e.simple ? "span" : "li"), {
|
|
7
|
+
class: t(e.cls),
|
|
8
8
|
role: "button",
|
|
9
9
|
tabindex: e.mergedDisabled ? -1 : 0,
|
|
10
10
|
"aria-label": e.isNext ? e.t("pagination.next") : e.t("pagination.prev"),
|
|
@@ -12,17 +12,20 @@ function c(e, f, b, u, g, k) {
|
|
|
12
12
|
onClick: e.handleClick,
|
|
13
13
|
onKeydown: e.handleKeyDown
|
|
14
14
|
}, {
|
|
15
|
-
default:
|
|
16
|
-
|
|
15
|
+
default: s(() => [
|
|
16
|
+
d(e.$slots, "default", {
|
|
17
17
|
type: e.isNext ? "next" : "previous"
|
|
18
18
|
}, () => [
|
|
19
|
-
|
|
19
|
+
p(o, {
|
|
20
|
+
name: e.isNext ? "chevron-right" : "chevron-left",
|
|
21
|
+
"stroke-width": 1.5
|
|
22
|
+
}, null, 8, ["name"])
|
|
20
23
|
])
|
|
21
24
|
]),
|
|
22
25
|
_: 3
|
|
23
26
|
}, 40, ["class", "tabindex", "aria-label", "aria-disabled", "onClick", "onKeydown"]);
|
|
24
27
|
}
|
|
25
|
-
const
|
|
28
|
+
const w = /* @__PURE__ */ m(n, [["render", c]]);
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
w as default
|
|
28
31
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { defineComponent as d, computed as
|
|
2
|
-
import f from "../../icons/
|
|
3
|
-
import g from "
|
|
4
|
-
import { getLegalPage as p } from "./utils.js";
|
|
1
|
+
import { defineComponent as d, computed as i } from "vue";
|
|
2
|
+
import { Icon as f } from "../../icons/index.js";
|
|
3
|
+
import { getLegalPage as g } from "./utils.js";
|
|
5
4
|
import { getClassNameMixin as y } from "../../_utils/config.js";
|
|
6
|
-
import { useLocale as
|
|
7
|
-
const
|
|
5
|
+
import { useLocale as p } from "../../locale/index.js";
|
|
6
|
+
const q = d({
|
|
8
7
|
name: "StepPager",
|
|
9
8
|
components: {
|
|
10
|
-
|
|
11
|
-
IconRight: g
|
|
9
|
+
XIcon: f
|
|
12
10
|
},
|
|
13
11
|
props: {
|
|
14
12
|
pages: {
|
|
@@ -33,34 +31,34 @@ const C = d({
|
|
|
33
31
|
}
|
|
34
32
|
},
|
|
35
33
|
emits: ["click"],
|
|
36
|
-
setup(e, { emit:
|
|
37
|
-
const t = y("pagination--item"), { t:
|
|
38
|
-
() =>
|
|
34
|
+
setup(e, { emit: u }) {
|
|
35
|
+
const t = y("pagination--item"), { t: l } = p(), n = e.type === "next", a = i(() => e.disabled ? e.disabled : !e.pages || n && e.current === e.pages ? !0 : !n && e.current <= 1), c = i(
|
|
36
|
+
() => g(e.current + (n ? 1 : -1), {
|
|
39
37
|
min: 1,
|
|
40
38
|
max: e.pages
|
|
41
39
|
})
|
|
42
|
-
), o = (
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
(
|
|
46
|
-
}, s =
|
|
40
|
+
), o = (r) => {
|
|
41
|
+
a.value || u("click", c.value);
|
|
42
|
+
}, m = (r) => {
|
|
43
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), o());
|
|
44
|
+
}, s = i(() => [
|
|
47
45
|
t.block,
|
|
48
46
|
t.modifier(e.type),
|
|
49
47
|
{
|
|
50
|
-
[t.modifier("disabled")]:
|
|
48
|
+
[t.modifier("disabled")]: a.value
|
|
51
49
|
}
|
|
52
50
|
]);
|
|
53
51
|
return {
|
|
54
|
-
t:
|
|
52
|
+
t: l,
|
|
55
53
|
className: t,
|
|
56
54
|
cls: s,
|
|
57
|
-
isNext:
|
|
58
|
-
mergedDisabled:
|
|
55
|
+
isNext: n,
|
|
56
|
+
mergedDisabled: a,
|
|
59
57
|
handleClick: o,
|
|
60
|
-
handleKeyDown:
|
|
58
|
+
handleKeyDown: m
|
|
61
59
|
};
|
|
62
60
|
}
|
|
63
61
|
});
|
|
64
62
|
export {
|
|
65
|
-
|
|
63
|
+
q as default
|
|
66
64
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as
|
|
1
|
+
import l from "./page-item.vue2.js";
|
|
2
|
+
import { openBlock as o, createElementBlock as i, normalizeStyle as n, normalizeClass as d, renderSlot as s, createTextVNode as t, toDisplayString as p } from "vue";
|
|
3
3
|
import m from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return
|
|
4
|
+
const b = ["tabindex", "aria-current", "aria-label", "aria-disabled"];
|
|
5
|
+
function u(e, a, f, g, y, k) {
|
|
6
|
+
return o(), i("li", {
|
|
7
7
|
class: d(e.cls),
|
|
8
8
|
style: n(e.mergedStyle),
|
|
9
9
|
role: "button",
|
|
10
10
|
tabindex: e.disabled ? -1 : 0,
|
|
11
11
|
"aria-current": e.isActive ? "page" : void 0,
|
|
12
|
+
"aria-label": e.pageLabel,
|
|
12
13
|
"aria-disabled": e.disabled || void 0,
|
|
13
|
-
onClick:
|
|
14
|
-
onKeydown:
|
|
14
|
+
onClick: a[0] || (a[0] = (...r) => e.handleClick && e.handleClick(...r)),
|
|
15
|
+
onKeydown: a[1] || (a[1] = (...r) => e.handleKeyDown && e.handleKeyDown(...r))
|
|
15
16
|
}, [
|
|
16
17
|
s(e.$slots, "default", { page: e.pageNumber }, () => [
|
|
17
18
|
t(p(e.pageNumber), 1)
|
|
18
19
|
])
|
|
19
|
-
], 46,
|
|
20
|
+
], 46, b);
|
|
20
21
|
}
|
|
21
|
-
const v = /* @__PURE__ */ m(
|
|
22
|
+
const v = /* @__PURE__ */ m(l, [["render", u]]);
|
|
22
23
|
export {
|
|
23
24
|
v as default
|
|
24
25
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as b, computed as a } from "vue";
|
|
2
|
+
import { getClassNameMixin as p } from "../../_utils/config.js";
|
|
3
|
+
import { useLocale as y } from "../../locale/index.js";
|
|
4
|
+
const N = b({
|
|
4
5
|
name: "Pager",
|
|
5
6
|
props: {
|
|
6
7
|
pageNumber: {
|
|
@@ -21,27 +22,31 @@ const f = o({
|
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
emits: ["click"],
|
|
24
|
-
setup(e, { emit:
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
setup(e, { emit: c }) {
|
|
26
|
+
const n = p("pagination--item"), { t: o, locale: m } = y(), r = a(() => o(
|
|
27
|
+
m.value.pagination.pageLabel ? "pagination.pageLabel" : "pagination.jumpToPage",
|
|
28
|
+
{ page: e.pageNumber ?? 1 }
|
|
29
|
+
)), i = a(() => e.current === e.pageNumber), l = (t) => {
|
|
30
|
+
e.disabled || c("click", e.pageNumber, t);
|
|
31
|
+
}, s = (t) => {
|
|
32
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), l(t));
|
|
33
|
+
}, u = a(() => [
|
|
34
|
+
n.block,
|
|
31
35
|
{
|
|
32
|
-
[
|
|
36
|
+
[n.modifier("active")]: i.value
|
|
33
37
|
}
|
|
34
|
-
]),
|
|
38
|
+
]), g = a(() => i.value ? { ...e.style, ...e.activeStyle } : e.style);
|
|
35
39
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
pageLabel: r,
|
|
41
|
+
className: n,
|
|
42
|
+
isActive: i,
|
|
43
|
+
cls: u,
|
|
44
|
+
mergedStyle: g,
|
|
45
|
+
handleClick: l,
|
|
46
|
+
handleKeyDown: s
|
|
42
47
|
};
|
|
43
48
|
}
|
|
44
49
|
});
|
|
45
50
|
export {
|
|
46
|
-
|
|
51
|
+
N as default
|
|
47
52
|
};
|