x-next 1.4.0 → 1.6.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 (144) hide show
  1. package/AI_USAGE.md +2 -2
  2. package/CHANGELOG.md +71 -0
  3. package/dist/_utils/color.d.ts +53 -0
  4. package/dist/components/color-picker/ColorPicker.d.ts +239 -0
  5. package/dist/components/color-picker/gradient-slider.d.ts +52 -0
  6. package/dist/components/color-picker/index.d.ts +238 -0
  7. package/dist/components/color-picker/panel.d.ts +721 -0
  8. package/dist/components/color-picker/sv-panel.d.ts +48 -0
  9. package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
  10. package/dist/components/date-picker/index.d.ts +6 -6
  11. package/dist/components/dropdown/Dropdown.vue.d.ts +34 -4
  12. package/dist/components/dropdown/DropdownButton.vue.d.ts +37 -6
  13. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +34 -4
  14. package/dist/components/dropdown/dropdown-panel.vue.d.ts +30 -0
  15. package/dist/components/dropdown/index.d.ts +212 -29
  16. package/dist/components/form/FormItem.vue.d.ts +3 -3
  17. package/dist/components/form/form-item-label.vue.d.ts +3 -3
  18. package/dist/components/form/index.d.ts +6 -6
  19. package/dist/components/form-select/Select.d.ts +3 -3
  20. package/dist/components/form-select/SelectDropdown.vue.d.ts +30 -0
  21. package/dist/components/form-select/index.d.ts +66 -6
  22. package/dist/components/form-slider/Slider.vue.d.ts +3 -3
  23. package/dist/components/form-slider/index.d.ts +6 -6
  24. package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
  25. package/dist/components/heatmap/Heatmap.d.ts +311 -0
  26. package/dist/components/heatmap/helpers/matrix.d.ts +58 -0
  27. package/dist/components/heatmap/index.d.ts +372 -0
  28. package/dist/components/heatmap/interface.d.ts +57 -0
  29. package/dist/components/image/Image.vue.d.ts +3 -3
  30. package/dist/components/image/ImagePreview.vue.d.ts +3 -3
  31. package/dist/components/image/ImagePreviewAction.d.ts +3 -3
  32. package/dist/components/image/ImagePreviewGroup.vue.d.ts +3 -3
  33. package/dist/components/image/index.d.ts +24 -24
  34. package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
  37. package/dist/components/network/Network.vue.d.ts +1 -1
  38. package/dist/components/network/index.d.ts +3 -3
  39. package/dist/components/network/utils.d.ts +2 -0
  40. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +9 -0
  41. package/dist/components/pagination/page-jumper.vue.d.ts +6 -0
  42. package/dist/components/pagination/page-options.vue.d.ts +6 -6
  43. package/dist/components/popover/Popover.d.ts +1 -1
  44. package/dist/components/popover/index.d.ts +3 -3
  45. package/dist/components/popup/Popup.d.ts +1 -1
  46. package/dist/components/popup/index.d.ts +3 -3
  47. package/dist/components/skeleton/SkeletonShape.vue.d.ts +3 -3
  48. package/dist/components/skeleton/index.d.ts +6 -6
  49. package/dist/components/spin/Spin.d.ts +38 -0
  50. package/dist/components/spin/index.d.ts +30 -0
  51. package/dist/components/steps/context.d.ts +9 -0
  52. package/dist/components/table/Table.d.ts +1 -1
  53. package/dist/components/table/index.d.ts +3 -3
  54. package/dist/components/tabs/TabPane.vue.d.ts +2 -0
  55. package/dist/components/tabs/Tabs.d.ts +1 -1
  56. package/dist/components/tabs/index.d.ts +9 -3
  57. package/dist/components/tabs/interface.d.ts +4 -0
  58. package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
  59. package/dist/components/time-picker/index.d.ts +6 -6
  60. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  61. package/dist/components/tooltip/index.d.ts +3 -3
  62. package/dist/components/trigger/Trigger.d.ts +1 -1
  63. package/dist/components/trigger/index.d.ts +3 -3
  64. package/dist/components/watermark/Watermark.d.ts +1 -1
  65. package/dist/components/watermark/index.d.ts +3 -3
  66. package/dist/es/_styles/palette-aliases.js +8 -0
  67. package/dist/es/_utils/color.js +73 -0
  68. package/dist/es/components/button/Button.js +2 -2
  69. package/dist/es/components/color-picker/ColorPicker.js +239 -0
  70. package/dist/es/components/color-picker/gradient-slider.js +79 -0
  71. package/dist/es/components/color-picker/index.js +8 -0
  72. package/dist/es/components/color-picker/panel.js +307 -0
  73. package/dist/es/components/color-picker/sv-panel.js +99 -0
  74. package/dist/es/components/dropdown/Dropdown.vue2.js +11 -4
  75. package/dist/es/components/dropdown/DropdownButton.vue.js +8 -7
  76. package/dist/es/components/dropdown/DropdownButton.vue2.js +19 -17
  77. package/dist/es/components/dropdown/DropdownSubmenu.vue.js +18 -17
  78. package/dist/es/components/dropdown/dropdown-panel.vue.js +17 -17
  79. package/dist/es/components/form-input/Input.js +7 -7
  80. package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
  81. package/dist/es/components/form-input/InputSearch.js +2 -2
  82. package/dist/es/components/form-input-number/InputNumber.js +12 -12
  83. package/dist/es/components/heatmap/Heatmap.js +334 -0
  84. package/dist/es/components/heatmap/helpers/matrix.js +106 -0
  85. package/dist/es/components/heatmap/index.js +8 -0
  86. package/dist/es/components/index.js +118 -114
  87. package/dist/es/components/menu/MenuSubMenu.js +50 -36
  88. package/dist/es/components/menu/sub-menu-pop.vue2.js +30 -30
  89. package/dist/es/components/network/Network.vue2.js +72 -72
  90. package/dist/es/components/network/utils.js +44 -35
  91. package/dist/es/components/pagination/Pagination.js +124 -112
  92. package/dist/es/components/pagination/page-item-ellipsis.vue.js +13 -12
  93. package/dist/es/components/pagination/page-item-ellipsis.vue2.js +19 -15
  94. package/dist/es/components/pagination/page-jumper.vue.js +13 -12
  95. package/dist/es/components/pagination/page-jumper.vue2.js +7 -4
  96. package/dist/es/components/pagination/page-options.vue.js +4 -3
  97. package/dist/es/components/pagination/page-options.vue2.js +17 -15
  98. package/dist/es/components/skeleton/Skeleton.vue.js +11 -9
  99. package/dist/es/components/skeleton/SkeletonLine.vue.js +9 -8
  100. package/dist/es/components/skeleton/SkeletonShape.vue.js +8 -7
  101. package/dist/es/components/spin/Spin.js +124 -60
  102. package/dist/es/components/steps/Step.vue2.js +51 -47
  103. package/dist/es/components/steps/Steps.vue2.js +22 -19
  104. package/dist/es/components/table/Table.js +3 -1
  105. package/dist/es/components/tabs/TabPane.vue.js +11 -9
  106. package/dist/es/components/tabs/TabPane.vue2.js +28 -24
  107. package/dist/es/components/tabs/tabs-nav.js +20 -18
  108. package/dist/es/components/tabs/tabs-tab.vue.js +10 -8
  109. package/dist/es/components/trigger/Trigger.js +19 -19
  110. package/dist/es/icons/_self/empty-better.js +25 -8
  111. package/dist/es/index.js +162 -158
  112. package/dist/es/locale/en-US.js +19 -2
  113. package/dist/es/locale/zh-CN.js +19 -2
  114. package/dist/es/style.css +1 -1
  115. package/dist/index.cjs +4 -4
  116. package/dist/index.umd.js +4 -4
  117. package/dist/locale/interface.d.ts +30 -0
  118. package/dist/style/base.css +1 -1
  119. package/dist/style/button.css +1 -1
  120. package/dist/style/color-picker.css +1 -0
  121. package/dist/style/color-picker.js +2 -0
  122. package/dist/style/date-picker.css +1 -1
  123. package/dist/style/dropdown.css +1 -1
  124. package/dist/style/empty.css +1 -1
  125. package/dist/style/form-checkbox.css +1 -1
  126. package/dist/style/form-input-tag.css +1 -1
  127. package/dist/style/form-input.css +1 -1
  128. package/dist/style/form-radio.css +1 -1
  129. package/dist/style/form-textarea.css +1 -1
  130. package/dist/style/form.css +1 -1
  131. package/dist/style/heatmap.css +1 -0
  132. package/dist/style/heatmap.js +2 -0
  133. package/dist/style/image.css +1 -1
  134. package/dist/style/menu.css +1 -1
  135. package/dist/style/pagination.css +1 -1
  136. package/dist/style/skeleton.css +1 -1
  137. package/dist/style/spin.css +1 -1
  138. package/dist/style/steps.css +1 -1
  139. package/dist/style/table.css +1 -1
  140. package/dist/style/tabs.css +1 -1
  141. package/dist/style.css +1 -1
  142. package/dist/types.d.ts +2 -0
  143. package/package.json +3 -2
  144. package/volar.d.ts +2 -0
@@ -1,14 +1,14 @@
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";
2
- import G from "./page-item.vue.js";
3
- import O from "./page-item-step.vue.js";
4
- import H from "./page-item-ellipsis.vue.js";
5
- import B from "./page-jumper.vue.js";
6
- import K from "./page-options.vue.js";
7
- import { isNumber as y } from "../../_utils/is.js";
8
- import { useSize as Q } from "../../_hooks/use-size.js";
9
- import { getClassNameMixin as U } from "../../_utils/config.js";
10
- import { useLocale as W } from "../../locale/index.js";
11
- const ne = /* @__PURE__ */ F({
1
+ import { defineComponent as D, toRefs as G, ref as O, computed as g, reactive as H, watch as B, createVNode as n, mergeProps as b } from "vue";
2
+ import K from "./page-item.vue.js";
3
+ import L from "./page-item-step.vue.js";
4
+ import Q from "./page-item-ellipsis.vue.js";
5
+ import I from "./page-jumper.vue.js";
6
+ import U from "./page-options.vue.js";
7
+ import { isNumber as h } from "../../_utils/is.js";
8
+ import { useSize as W } from "../../_hooks/use-size.js";
9
+ import { getClassNameMixin as X } from "../../_utils/config.js";
10
+ import { useLocale as Y } from "../../locale/index.js";
11
+ const oe = /* @__PURE__ */ D({
12
12
  name: "Pagination",
13
13
  props: {
14
14
  /**
@@ -168,20 +168,20 @@ const ne = /* @__PURE__ */ F({
168
168
  }
169
169
  },
170
170
  emits: {
171
- "update:current": (e) => !0,
172
- "update:pageSize": (e) => !0,
171
+ "update:current": (t) => !0,
172
+ "update:pageSize": (t) => !0,
173
173
  /**
174
174
  * @zh 页码改变时触发
175
175
  * @en Triggered when page number changes
176
176
  * @param {number} current
177
177
  */
178
- change: (e) => !0,
178
+ change: (t) => !0,
179
179
  /**
180
180
  * @zh 数据条数改变时触发
181
181
  * @en Triggered when the number of data items changes
182
182
  * @param {number} pageSize
183
183
  */
184
- pageSizeChange: (e) => !0
184
+ pageSizeChange: (t) => !0
185
185
  },
186
186
  /**
187
187
  * @zh 分页按钮
@@ -210,183 +210,195 @@ const ne = /* @__PURE__ */ F({
210
210
  * @slot total
211
211
  * @binding {number} total
212
212
  */
213
- setup(e, {
213
+ setup(t, {
214
214
  emit: f,
215
- slots: s
215
+ slots: o
216
216
  }) {
217
- const o = U("pagination"), {
218
- t: I
219
- } = W(), {
220
- disabled: z,
217
+ const c = X("pagination"), {
218
+ t: S
219
+ } = Y(), {
220
+ disabled: y,
221
221
  pageItemStyle: A,
222
222
  activePageItemStyle: E,
223
- size: L
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) {
228
- const a = Math.min(Math.max(t, 1), u.value);
223
+ size: T
224
+ } = G(t), {
225
+ mergedSize: d
226
+ } = W(T), p = O(t.defaultCurrent), N = O(t.defaultPageSize), k = (e) => h(e) && Number.isFinite(e) && e > 0, w = (e, a = 10) => k(e) ? e : a, F = g(() => t.current ?? p.value), z = g(() => w(t.pageSize ?? N.value, w(t.defaultPageSize))), P = g(() => {
227
+ const e = t.total;
228
+ return h(e) && Number.isFinite(e) && e > 0 ? e : 0;
229
+ }), x = g(() => {
230
+ const e = F.value;
231
+ return h(e) && Number.isFinite(e) ? e : 1;
232
+ }), u = g(() => Math.max(Math.ceil(P.value / z.value), 1)), l = g(() => Math.min(Math.max(x.value, 1), u.value)), C = (e) => {
233
+ if (e !== l.value && h(e) && !t.disabled) {
234
+ const a = Math.min(Math.max(e, 1), u.value);
229
235
  a !== l.value && (p.value = a, f("update:current", a), f("change", a));
230
236
  }
231
- }, J = (t) => {
232
- C(t) && (P.value = t, f("update:pageSize", t), f("pageSizeChange", t));
233
- }, n = D({
237
+ }, J = (e) => {
238
+ k(e) && (N.value = e, f("update:pageSize", e), f("pageSizeChange", e));
239
+ }, s = H({
234
240
  current: l,
235
241
  style: A,
236
242
  activeStyle: E,
237
- onClick: S
243
+ onClick: C
238
244
  }), V = {
239
245
  get current() {
240
- return n.current;
246
+ return s.current;
241
247
  },
242
248
  get disabled() {
243
- return z.value;
249
+ return y.value;
244
250
  },
245
251
  get style() {
246
- return n.style;
252
+ return s.style;
247
253
  },
248
254
  get activeStyle() {
249
- return n.activeStyle;
255
+ return s.activeStyle;
250
256
  },
251
257
  get onClick() {
252
- return n.onClick;
258
+ return s.onClick;
253
259
  }
254
- }, x = {
260
+ }, M = {
255
261
  get current() {
256
- return n.current;
262
+ return s.current;
257
263
  },
258
264
  get disabled() {
259
- return z.value;
265
+ return y.value;
260
266
  },
261
267
  get style() {
262
- return n.style;
268
+ return s.style;
263
269
  },
264
270
  get onClick() {
265
- return n.onClick;
271
+ return s.onClick;
266
272
  },
267
273
  get pages() {
268
274
  return u.value;
269
275
  }
270
276
  }, _ = {
271
277
  get current() {
272
- return n.current;
278
+ return s.current;
279
+ },
280
+ get disabled() {
281
+ return y.value;
273
282
  },
274
283
  get style() {
275
- return n.style;
284
+ return s.style;
276
285
  },
277
286
  get onClick() {
278
- return n.onClick;
287
+ return s.onClick;
279
288
  },
280
289
  get pages() {
281
290
  return u.value;
282
291
  }
283
- }, r = (t, a = {}) => t === "more" ? i(H, b(a, _), {
284
- default: s["page-item-ellipsis"]
285
- }) : t === "previous" ? i(O, b({
292
+ }, r = (e, a = {}) => e === "more" ? n(Q, b(a, _), {
293
+ default: o["page-item-ellipsis"]
294
+ }) : e === "previous" ? n(L, b({
286
295
  type: "previous"
287
- }, a, x), {
288
- default: s["page-item-step"]
289
- }) : t === "next" ? i(O, b({
296
+ }, a, M), {
297
+ default: o["page-item-step"]
298
+ }) : e === "next" ? n(L, b({
290
299
  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(() => {
296
- const t = [];
297
- if (u.value < e.baseSize + e.bufferSize * 2)
300
+ }, a, M), {
301
+ default: o["page-item-step"]
302
+ }) : n(K, b(a, V), {
303
+ default: o["page-item"]
304
+ }), R = g(() => {
305
+ const e = [];
306
+ if (u.value < t.baseSize + t.bufferSize * 2)
298
307
  for (let a = 1; a <= u.value; a++)
299
- t.push(r("page", {
308
+ e.push(r("page", {
300
309
  key: a,
301
310
  pageNumber: a
302
311
  }));
303
312
  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", {
313
+ let a = 1, m = u.value, i = !1, j = !1;
314
+ l.value > 2 + t.bufferSize && (i = !0, a = Math.min(l.value - t.bufferSize, u.value - 2 * t.bufferSize)), l.value < u.value - (t.bufferSize + 1) && (j = !0, m = Math.max(l.value + t.bufferSize, 2 * t.bufferSize + 1)), i && (e.push(r("page", {
306
315
  key: 1,
307
316
  pageNumber: 1
308
- })), t.push(r("more", {
317
+ })), e.push(r("more", {
309
318
  key: "left-ellipsis-pager",
310
- step: -(e.bufferSize * 2 + 1)
319
+ step: -(t.bufferSize * 2 + 1)
311
320
  })));
312
- for (let v = a; v <= g; v++)
313
- t.push(r("page", {
321
+ for (let v = a; v <= m; v++)
322
+ e.push(r("page", {
314
323
  key: v,
315
324
  pageNumber: v
316
325
  }));
317
- M && (t.push(r("more", {
326
+ j && (e.push(r("more", {
318
327
  key: "right-ellipsis-pager",
319
- step: e.bufferSize * 2 + 1
320
- })), t.push(r("page", {
328
+ step: t.bufferSize * 2 + 1
329
+ })), e.push(r("page", {
321
330
  key: u.value,
322
331
  pageNumber: u.value
323
332
  })));
324
333
  }
325
- return t;
326
- }), T = () => e.simple ? i("span", {
327
- class: o.element("simple")
334
+ return e;
335
+ }), q = () => t.simple ? n("span", {
336
+ class: c.element("simple")
328
337
  }, [r("previous", {
329
338
  simple: !0
330
- }), i(B, {
331
- disabled: e.disabled,
339
+ }), n(I, {
340
+ disabled: t.disabled,
332
341
  current: l.value,
333
- size: c.value,
342
+ size: d.value,
334
343
  pages: u.value,
335
344
  simple: !0,
336
- onChange: S
345
+ onChange: C
337
346
  }, null), r("next", {
338
347
  simple: !0
339
- })]) : i("ul", {
340
- class: o.element("list")
341
- }, [r("previous"), R.value, e.showMore && r("more", {
348
+ })]) : n("ul", {
349
+ class: c.element("list")
350
+ }, [r("previous"), R.value, t.showMore && r("more", {
342
351
  key: "more",
343
- step: e.bufferSize * 2 + 1
352
+ step: t.bufferSize * 2 + 1
344
353
  }), r("next")]);
345
- j(h, (t, a) => {
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));
349
- }
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
+ B(z, (e, a) => {
355
+ if (t.autoAdjust && e !== a && l.value > 1) {
356
+ const m = a * (l.value - 1) + 1, i = Math.ceil(m / e);
357
+ i !== l.value && (p.value = i, f("update:current", i), f("change", i));
354
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);
355
364
  });
356
- const q = m(() => [o.block, o.modifier(`size-${c.value}`), {
357
- [o.modifier("simple")]: e.simple,
358
- [o.modifier("disabled")]: e.disabled
365
+ const $ = g(() => [c.block, c.modifier(`size-${d.value}`), {
366
+ [c.modifier("simple")]: t.simple,
367
+ [c.modifier("disabled")]: t.disabled
359
368
  }]);
360
369
  return () => {
361
- var t;
362
- return e.hideOnSinglePage && u.value <= 1 ? null : i("div", {
363
- class: q.value
364
- }, [e.showTotal && i("span", {
365
- class: o.element("total")
366
- }, [((t = s.total) == null ? void 0 : t.call(s, {
367
- total: e.total
368
- })) ?? I("pagination.total", {
369
- total: e.total
370
- })]), T(), e.showPageSize && i(K, {
371
- disabled: e.disabled,
372
- sizeOptions: e.pageSizeOptions,
373
- pageSize: h.value,
374
- size: c.value,
370
+ var e;
371
+ return t.hideOnSinglePage && u.value <= 1 ? null : n("div", {
372
+ class: $.value,
373
+ role: "navigation",
374
+ "aria-label": S("pagination.ariaLabel")
375
+ }, [t.showTotal && n("span", {
376
+ class: c.element("total")
377
+ }, [((e = o.total) == null ? void 0 : e.call(o, {
378
+ total: P.value
379
+ })) ?? S("pagination.total", {
380
+ total: P.value
381
+ })]), q(), t.showPageSize && n(U, {
382
+ disabled: t.disabled,
383
+ sizeOptions: t.pageSizeOptions,
384
+ pageSize: z.value,
385
+ size: d.value,
375
386
  onChange: J,
376
- selectProps: e.pageSizeProps
377
- }, null), !e.simple && e.showJumper && i(B, {
378
- disabled: e.disabled,
387
+ selectProps: t.pageSizeProps
388
+ }, null), !t.simple && t.showJumper && n(I, {
389
+ disabled: t.disabled,
379
390
  current: l.value,
380
391
  pages: u.value,
381
- size: c.value,
382
- onChange: S
392
+ size: d.value,
393
+ ariaLabel: S("pagination.jumpTo"),
394
+ onChange: C
383
395
  }, {
384
- "jumper-prepend": s["jumper-prepend"],
385
- "jumper-append": s["jumper-append"]
396
+ "jumper-prepend": o["jumper-prepend"],
397
+ "jumper-append": o["jumper-append"]
386
398
  })]);
387
399
  };
388
400
  }
389
401
  });
390
402
  export {
391
- ne as default
403
+ oe as default
392
404
  };
@@ -1,23 +1,24 @@
1
- import r from "./page-item-ellipsis.vue2.js";
2
- import { resolveComponent as a, openBlock as t, createElementBlock as i, normalizeClass as s, renderSlot as p, createVNode as d } from "vue";
1
+ import l from "./page-item-ellipsis.vue2.js";
2
+ import { resolveComponent as i, openBlock as r, createElementBlock as s, normalizeClass as d, renderSlot as t, createVNode as p } from "vue";
3
3
  import m from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = ["aria-label"];
5
- function u(e, o, c, g, k, C) {
6
- const l = a("icon-more");
7
- return t(), i("li", {
8
- class: s(e.cls),
4
+ const b = ["tabindex", "aria-label", "aria-disabled"];
5
+ function f(e, o, u, g, k, C) {
6
+ const a = i("icon-more");
7
+ return r(), s("li", {
8
+ class: d(e.cls),
9
9
  role: "button",
10
- tabindex: "0",
10
+ tabindex: e.disabled ? -1 : 0,
11
11
  "aria-label": e.t("pagination.jumpToPage", { page: e.nextPage }),
12
+ "aria-disabled": e.disabled || void 0,
12
13
  onClick: o[0] || (o[0] = (...n) => e.handleClick && e.handleClick(...n)),
13
14
  onKeydown: o[1] || (o[1] = (...n) => e.handleKeyDown && e.handleKeyDown(...n))
14
15
  }, [
15
- p(e.$slots, "default", {}, () => [
16
- d(l)
16
+ t(e.$slots, "default", {}, () => [
17
+ p(a)
17
18
  ])
18
- ], 42, f);
19
+ ], 42, b);
19
20
  }
20
- const y = /* @__PURE__ */ m(r, [["render", u]]);
21
+ const y = /* @__PURE__ */ m(l, [["render", f]]);
21
22
  export {
22
23
  y as default
23
24
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as l, computed as i } from "vue";
1
+ import { defineComponent as c, computed as i } from "vue";
2
2
  import p from "../../icons/_self/more-dot.js";
3
3
  import { getLegalPage as u } from "./utils.js";
4
4
  import { getClassNameMixin as f } from "../../_utils/config.js";
5
5
  import { useLocale as d } from "../../locale/index.js";
6
- const x = l({
6
+ const x = c({
7
7
  name: "EllipsisPager",
8
8
  components: {
9
9
  IconMore: p
@@ -20,28 +20,32 @@ const x = l({
20
20
  pages: {
21
21
  type: Number,
22
22
  required: !0
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: !1
23
27
  }
24
28
  },
25
29
  emits: ["click"],
26
- setup(t, { emit: m }) {
27
- const o = f("pagination--item"), { t: s } = d(), r = i(
28
- () => u(t.current + t.step, {
30
+ setup(e, { emit: a }) {
31
+ const o = f("pagination--item"), { t: s } = d(), n = i(
32
+ () => u(e.current + e.step, {
29
33
  min: 1,
30
- max: t.pages
34
+ max: e.pages
31
35
  })
32
- ), n = (e) => {
33
- m("click", r.value);
34
- }, a = (e) => {
35
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n());
36
- }, c = i(() => [o.block, o.modifier("ellipsis")]);
36
+ ), r = (t) => {
37
+ e.disabled || a("click", n.value);
38
+ }, m = (t) => {
39
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r());
40
+ }, l = i(() => [o.block, o.modifier("ellipsis")]);
37
41
  return {
38
42
  t: s,
39
43
  className: o,
40
- cls: c,
44
+ cls: l,
41
45
  // 模板的 aria-label 需要它(点击后真正跳转到的页码)
42
- nextPage: r,
43
- handleClick: n,
44
- handleKeyDown: a
46
+ nextPage: n,
47
+ handleClick: r,
48
+ handleKeyDown: m
45
49
  };
46
50
  }
47
51
  });
@@ -1,7 +1,7 @@
1
- import i from "./page-jumper.vue2.js";
2
- import { resolveComponent as u, openBlock as s, createElementBlock as n, normalizeClass as a, renderSlot as p, createTextVNode as f, toDisplayString as r, createCommentVNode as l, createVNode as g, Fragment as N, createElementVNode as m } from "vue";
3
- import V from "../../_virtual/_plugin-vue_export-helper.js";
4
- function $(e, o, b, c, C, h) {
1
+ import d from "./page-jumper.vue2.js";
2
+ import { resolveComponent as u, openBlock as s, createElementBlock as n, normalizeClass as a, renderSlot as r, createTextVNode as g, toDisplayString as p, createCommentVNode as l, createVNode as f, Fragment as N, createElementVNode as m } from "vue";
3
+ import b from "../../_virtual/_plugin-vue_export-helper.js";
4
+ function V(e, o, $, C, h, j) {
5
5
  const t = u("input-number");
6
6
  return s(), n("span", {
7
7
  class: a(e.cls)
@@ -10,13 +10,13 @@ function $(e, o, b, c, C, h) {
10
10
  key: 0,
11
11
  class: a([e.className.element("prepend"), e.className.modifier("text-goto")])
12
12
  }, [
13
- p(e.$slots, "jumper-prepend", {}, () => [
14
- f(r(e.t("pagination.jumpTo")), 1)
13
+ r(e.$slots, "jumper-prepend", {}, () => [
14
+ g(p(e.t("pagination.jumpTo")), 1)
15
15
  ])
16
16
  ], 2)),
17
- g(t, {
17
+ f(t, {
18
18
  modelValue: e.inputValue,
19
- "onUpdate:modelValue": o[0] || (o[0] = (d) => e.inputValue = d),
19
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => e.inputValue = i),
20
20
  class: a(e.className.element("input")),
21
21
  min: 1,
22
22
  max: e.pages,
@@ -24,13 +24,14 @@ function $(e, o, b, c, C, h) {
24
24
  disabled: e.disabled,
25
25
  "hide-button": "",
26
26
  formatter: e.handleFormatter,
27
+ "aria-label": e.ariaLabel || e.t("pagination.jumpTo"),
27
28
  onChange: e.handleChange
28
- }, null, 8, ["modelValue", "class", "max", "size", "disabled", "formatter", "onChange"]),
29
+ }, null, 8, ["modelValue", "class", "max", "size", "disabled", "formatter", "aria-label", "onChange"]),
29
30
  e.$slots["jumper-append"] ? (s(), n("span", {
30
31
  key: 1,
31
32
  class: a(e.className.element("append"))
32
33
  }, [
33
- p(e.$slots, "jumper-append")
34
+ r(e.$slots, "jumper-append")
34
35
  ], 2)) : l("", !0),
35
36
  e.simple ? (s(), n(N, { key: 2 }, [
36
37
  m("span", {
@@ -38,11 +39,11 @@ function $(e, o, b, c, C, h) {
38
39
  }, "/", 2),
39
40
  m("span", {
40
41
  class: a(e.className.element("total-page"))
41
- }, r(e.pages), 3)
42
+ }, p(e.pages), 3)
42
43
  ], 64)) : l("", !0)
43
44
  ], 2);
44
45
  }
45
- const z = /* @__PURE__ */ V(i, [["render", $]]);
46
+ const z = /* @__PURE__ */ b(d, [["render", V]]);
46
47
  export {
47
48
  z as default
48
49
  };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as l, ref as c, watch as p, computed as d, nextTick as f } from "vue";
2
2
  import { InputNumber as g } from "../form-input-number/index.js";
3
3
  import { getClassNameMixin as N } from "../../_utils/config.js";
4
- import { useLocale as h } from "../../locale/index.js";
5
- const x = l({
4
+ import { useLocale as b } from "../../locale/index.js";
5
+ const S = l({
6
6
  name: "PageJumper",
7
7
  components: {
8
8
  InputNumber: g
@@ -27,13 +27,16 @@ const x = l({
27
27
  size: {
28
28
  type: String
29
29
  },
30
+ ariaLabel: {
31
+ type: String
32
+ },
30
33
  onChange: {
31
34
  type: Function
32
35
  }
33
36
  },
34
37
  emits: ["change"],
35
38
  setup(e, { emit: i }) {
36
- const a = N("pagination--jumper"), { t: o } = h(), t = c(e.simple ? e.current : void 0), m = (n) => {
39
+ const a = N("pagination--jumper"), { t: o } = b(), t = c(e.simple ? e.current : void 0), m = (n) => {
37
40
  const r = parseInt(n.toString(), 10);
38
41
  return Number.isNaN(r) ? void 0 : String(r);
39
42
  }, s = (n) => {
@@ -64,5 +67,5 @@ const x = l({
64
67
  }
65
68
  });
66
69
  export {
67
- x as default
70
+ S as default
68
71
  };
@@ -6,12 +6,13 @@ function m(e, d, c, f, u, g) {
6
6
  return a(), l("span", {
7
7
  class: r(e.className.block)
8
8
  }, [
9
- p(o, t({
9
+ p(o, t(e.selectProps, {
10
10
  "model-value": e.pageSize,
11
11
  options: e.options,
12
12
  size: e.size,
13
- disabled: e.disabled
14
- }, e.selectProps, { onChange: e.handleChange }), null, 16, ["model-value", "options", "size", "disabled", "onChange"])
13
+ disabled: e.disabled,
14
+ onChange: e.handleChange
15
+ }), null, 16, ["model-value", "options", "size", "disabled", "onChange"])
15
16
  ], 2);
16
17
  }
17
18
  const b = /* @__PURE__ */ i(s, [["render", m]]);
@@ -1,11 +1,12 @@
1
- import { defineComponent as p, computed as a } from "vue";
2
- import { Select as r } from "../form-select/index.js";
3
- import { getClassNameMixin as m } from "../../_utils/config.js";
4
- import { useLocale as c } from "../../locale/index.js";
5
- const u = p({
1
+ import { defineComponent as r, computed as m } from "vue";
2
+ import { Select as c } from "../form-select/index.js";
3
+ import { getClassNameMixin as g } from "../../_utils/config.js";
4
+ import { useLocale as f } from "../../locale/index.js";
5
+ import { isNumber as u } from "../../_utils/is.js";
6
+ const y = r({
6
7
  name: "PageOptions",
7
8
  components: {
8
- Select: r
9
+ Select: c
9
10
  },
10
11
  props: {
11
12
  sizeOptions: {
@@ -25,16 +26,17 @@ const u = p({
25
26
  }
26
27
  },
27
28
  emits: ["change"],
28
- setup(t, { emit: n }) {
29
- const o = m("pagination--options"), { t: i } = c(), s = a(
30
- () => t.sizeOptions.map((e) => ({
31
- value: e,
32
- label: i("pagination.pageSizeOption", { size: e })
33
- }))
34
- );
29
+ setup(i, { emit: n }) {
30
+ const o = g("pagination--options"), { t: s } = f(), a = m(() => {
31
+ const e = i.sizeOptions.slice();
32
+ return u(i.pageSize) && i.pageSize > 0 && !e.includes(i.pageSize) && (e.push(i.pageSize), e.sort((t, p) => t - p)), e.map((t) => ({
33
+ value: t,
34
+ label: s("pagination.pageSizeOption", { size: t })
35
+ }));
36
+ });
35
37
  return {
36
38
  className: o,
37
- options: s,
39
+ options: a,
38
40
  handleChange: (e) => {
39
41
  typeof e == "number" && Number.isFinite(e) && e > 0 && n("change", e);
40
42
  }
@@ -42,5 +44,5 @@ const u = p({
42
44
  }
43
45
  });
44
46
  export {
45
- u as default
47
+ y as default
46
48
  };
@@ -1,14 +1,16 @@
1
1
  import r from "./Skeleton.vue2.js";
2
- import { openBlock as t, createElementBlock as s, normalizeClass as n, renderSlot as o } from "vue";
3
- import l from "../../_virtual/_plugin-vue_export-helper.js";
4
- function a(e, c, p, f, i, m) {
5
- return t(), s("div", {
6
- class: n(e.cls)
2
+ import { openBlock as s, createElementBlock as t, normalizeClass as n, renderSlot as e } from "vue";
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const l = ["aria-busy"];
5
+ function i(o, d, c, p, f, m) {
6
+ return s(), t("div", {
7
+ class: n(o.cls),
8
+ "aria-busy": o.loading ? "true" : void 0
7
9
  }, [
8
- e.loading ? o(e.$slots, "default", { key: 0 }) : o(e.$slots, "content", { key: 1 })
9
- ], 2);
10
+ o.loading ? e(o.$slots, "default", { key: 0 }) : e(o.$slots, "content", { key: 1 })
11
+ ], 10, l);
10
12
  }
11
- const u = /* @__PURE__ */ l(r, [["render", a]]);
13
+ const k = /* @__PURE__ */ a(r, [["render", i]]);
12
14
  export {
13
- u as default
15
+ k as default
14
16
  };