x-next 1.12.0 → 1.14.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 (226) hide show
  1. package/AI_CODING.md +6 -5
  2. package/AI_USAGE/catalog.md +106 -105
  3. package/AI_USAGE/components/alert-api.md +48 -0
  4. package/AI_USAGE/components/alert.md +222 -3
  5. package/AI_USAGE/components/bar-chart-api.md +177 -0
  6. package/AI_USAGE/components/bar-chart.md +297 -3
  7. package/AI_USAGE/components/boxicons.md +147 -0
  8. package/AI_USAGE/components/button-api.md +144 -0
  9. package/AI_USAGE/components/button.md +447 -3
  10. package/AI_USAGE/components/charts.md +81 -0
  11. package/AI_USAGE/components/checkbox-api.md +145 -0
  12. package/AI_USAGE/components/checkbox.md +365 -3
  13. package/AI_USAGE/components/color-picker-api.md +52 -0
  14. package/AI_USAGE/components/color-picker.md +211 -3
  15. package/AI_USAGE/components/config-provider-api.md +38 -0
  16. package/AI_USAGE/components/config-provider.md +250 -3
  17. package/AI_USAGE/components/date-picker-api.md +1114 -0
  18. package/AI_USAGE/components/date-picker.md +378 -3
  19. package/AI_USAGE/components/dialog-api.md +142 -0
  20. package/AI_USAGE/components/dialog.md +284 -3
  21. package/AI_USAGE/components/draggable-api.md +146 -0
  22. package/AI_USAGE/components/draggable.md +259 -0
  23. package/AI_USAGE/components/drawer-api.md +78 -0
  24. package/AI_USAGE/components/drawer.md +227 -0
  25. package/AI_USAGE/components/dropdown-api.md +529 -0
  26. package/AI_USAGE/components/dropdown.md +392 -3
  27. package/AI_USAGE/components/empty-api.md +36 -0
  28. package/AI_USAGE/components/empty.md +227 -3
  29. package/AI_USAGE/components/finicon.md +88 -0
  30. package/AI_USAGE/components/form-api.md +524 -0
  31. package/AI_USAGE/components/form.md +454 -0
  32. package/AI_USAGE/components/grid-api.md +527 -0
  33. package/AI_USAGE/components/grid.md +224 -0
  34. package/AI_USAGE/components/heatmap-api.md +122 -0
  35. package/AI_USAGE/components/heatmap.md +220 -0
  36. package/AI_USAGE/components/icon-api.md +4707 -0
  37. package/AI_USAGE/components/icon.md +257 -0
  38. package/AI_USAGE/components/image-api.md +440 -0
  39. package/AI_USAGE/components/image.md +465 -0
  40. package/AI_USAGE/components/input-api.md +184 -0
  41. package/AI_USAGE/components/input-number-api.md +66 -0
  42. package/AI_USAGE/components/input-number.md +294 -0
  43. package/AI_USAGE/components/input-tag-api.md +114 -0
  44. package/AI_USAGE/components/input-tag.md +482 -0
  45. package/AI_USAGE/components/input.md +293 -3
  46. package/AI_USAGE/components/layout-api.md +147 -0
  47. package/AI_USAGE/components/layout.md +230 -0
  48. package/AI_USAGE/components/line-chart-api.md +197 -0
  49. package/AI_USAGE/components/line-chart.md +279 -3
  50. package/AI_USAGE/components/link-api.md +42 -0
  51. package/AI_USAGE/components/link.md +197 -0
  52. package/AI_USAGE/components/menu-api.md +516 -0
  53. package/AI_USAGE/components/menu.md +268 -0
  54. package/AI_USAGE/components/message-api.md +215 -0
  55. package/AI_USAGE/components/message-box-api.md +108 -0
  56. package/AI_USAGE/components/message-box.md +268 -3
  57. package/AI_USAGE/components/message.md +231 -3
  58. package/AI_USAGE/components/network-api.md +91 -0
  59. package/AI_USAGE/components/network.md +378 -0
  60. package/AI_USAGE/components/notification-api.md +236 -0
  61. package/AI_USAGE/components/notification.md +275 -3
  62. package/AI_USAGE/components/pagination-api.md +62 -0
  63. package/AI_USAGE/components/pagination.md +386 -5
  64. package/AI_USAGE/components/pie-chart-api.md +109 -0
  65. package/AI_USAGE/components/pie-chart.md +245 -3
  66. package/AI_USAGE/components/popconfirm-api.md +75 -0
  67. package/AI_USAGE/components/popconfirm.md +231 -3
  68. package/AI_USAGE/components/popover-api.md +75 -0
  69. package/AI_USAGE/components/popover.md +208 -3
  70. package/AI_USAGE/components/popup-api.md +75 -0
  71. package/AI_USAGE/components/popup.md +52 -0
  72. package/AI_USAGE/components/progress-api.md +44 -0
  73. package/AI_USAGE/components/progress.md +248 -3
  74. package/AI_USAGE/components/radio-api.md +165 -0
  75. package/AI_USAGE/components/radio.md +259 -3
  76. package/AI_USAGE/components/rate-api.md +54 -0
  77. package/AI_USAGE/components/rate.md +233 -3
  78. package/AI_USAGE/components/resize-box-api.md +56 -0
  79. package/AI_USAGE/components/resize-box.md +231 -0
  80. package/AI_USAGE/components/scrollbar-api.md +77 -0
  81. package/AI_USAGE/components/scrollbar.md +218 -0
  82. package/AI_USAGE/components/select-api.md +758 -0
  83. package/AI_USAGE/components/select.md +640 -3
  84. package/AI_USAGE/components/skeleton-api.md +85 -0
  85. package/AI_USAGE/components/skeleton.md +150 -0
  86. package/AI_USAGE/components/slider-api.md +51 -0
  87. package/AI_USAGE/components/slider.md +233 -3
  88. package/AI_USAGE/components/space-api.md +38 -0
  89. package/AI_USAGE/components/space.md +145 -0
  90. package/AI_USAGE/components/spin-api.md +43 -0
  91. package/AI_USAGE/components/spin.md +205 -0
  92. package/AI_USAGE/components/steps-api.md +111 -0
  93. package/AI_USAGE/components/steps.md +201 -3
  94. package/AI_USAGE/components/switch-api.md +58 -0
  95. package/AI_USAGE/components/switch.md +290 -3
  96. package/AI_USAGE/components/table-api.md +2919 -0
  97. package/AI_USAGE/components/table.md +1414 -0
  98. package/AI_USAGE/components/tabs-api.md +135 -0
  99. package/AI_USAGE/components/tabs.md +308 -3
  100. package/AI_USAGE/components/tag-api.md +124 -0
  101. package/AI_USAGE/components/tag.md +292 -0
  102. package/AI_USAGE/components/textarea-api.md +55 -0
  103. package/AI_USAGE/components/textarea.md +326 -3
  104. package/AI_USAGE/components/time-picker-api.md +137 -0
  105. package/AI_USAGE/components/time-picker.md +271 -3
  106. package/AI_USAGE/components/time-range-selector-api.md +44 -0
  107. package/AI_USAGE/components/time-range-selector.md +355 -0
  108. package/AI_USAGE/components/timeline-api.md +93 -0
  109. package/AI_USAGE/components/timeline.md +312 -0
  110. package/AI_USAGE/components/tooltip-api.md +77 -0
  111. package/AI_USAGE/components/tooltip.md +182 -0
  112. package/AI_USAGE/components/trend-chart-api.md +119 -0
  113. package/AI_USAGE/components/trend-chart.md +335 -0
  114. package/AI_USAGE/components/trigger-api.md +124 -0
  115. package/AI_USAGE/components/trigger.md +185 -0
  116. package/AI_USAGE/components/upload-api.md +200 -0
  117. package/AI_USAGE/components/upload.md +711 -3
  118. package/AI_USAGE/components/watermark-api.md +87 -0
  119. package/AI_USAGE/components/watermark.md +200 -0
  120. package/AI_USAGE/core.md +1 -1
  121. package/AI_USAGE/index.md +35 -7
  122. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  123. package/AI_USAGE.md +33657 -7
  124. package/CHANGELOG.md +40 -0
  125. package/dist/_utils/inherit-component-type.d.ts +11 -0
  126. package/dist/components/date-picker/index.d.ts +420 -5
  127. package/dist/components/form-input/index.d.ts +617 -2
  128. package/dist/components/layout/index.d.ts +689 -1
  129. package/dist/components/menu/index.d.ts +786 -1
  130. package/dist/components/network/Network.vue.d.ts +7 -3
  131. package/dist/components/network/index.d.ts +10 -2
  132. package/dist/components/network/props.d.ts +5 -0
  133. package/dist/components/network/utils.d.ts +3 -3
  134. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +4 -1
  135. package/dist/components/pagination/page-item-step.vue.d.ts +101 -130
  136. package/dist/components/pagination/page-item.vue.d.ts +1 -0
  137. package/dist/components/pagination/page-jumper.vue.d.ts +1 -1
  138. package/dist/components/pagination/page-options.vue.d.ts +6 -4
  139. package/dist/components/pagination/utils.d.ts +3 -0
  140. package/dist/components/time-range-selector/index.d.ts +6 -6
  141. package/dist/es/_container/resize-observer-v2.js +1 -1
  142. package/dist/es/_container/resize-observer.js +1 -1
  143. package/dist/es/_hooks/use-resize-observer.js +1 -1
  144. package/dist/es/_styles/palette-aliases.js +4 -4
  145. package/dist/es/_utils/inherit-component-type.js +6 -0
  146. package/dist/es/_virtual/advancedFormat.js +1 -1
  147. package/dist/es/_virtual/customParseFormat.js +1 -1
  148. package/dist/es/_virtual/dayjs.min.js +1 -1
  149. package/dist/es/_virtual/isBetween.js +1 -1
  150. package/dist/es/_virtual/quarterOfYear.js +1 -1
  151. package/dist/es/_virtual/weekOfYear.js +1 -1
  152. package/dist/es/_virtual/weekYear.js +1 -1
  153. package/dist/es/_virtual/zh-cn.js +1 -1
  154. package/dist/es/components/button/Button.js +53 -42
  155. package/dist/es/components/date-picker/index.js +18 -17
  156. package/dist/es/components/draggable/useDraggable.js +1 -1
  157. package/dist/es/components/form/Form.vue2.js +1 -1
  158. package/dist/es/components/form/FormItem.vue2.js +1 -1
  159. package/dist/es/components/form-input/index.js +12 -11
  160. package/dist/es/components/form-input-number/InputNumber.js +1 -1
  161. package/dist/es/components/form-slider/Slider.vue2.js +1 -1
  162. package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
  163. package/dist/es/components/form-slider/utils.js +1 -1
  164. package/dist/es/components/layout/index.js +10 -9
  165. package/dist/es/components/menu/MenuItem.js +1 -1
  166. package/dist/es/components/menu/hooks/use-level.js +5 -5
  167. package/dist/es/components/menu/index.js +13 -10
  168. package/dist/es/components/menu/overflow-wrap.js +1 -1
  169. package/dist/es/components/network/Network.vue.js +17 -12
  170. package/dist/es/components/network/Network.vue2.js +78 -70
  171. package/dist/es/components/network/utils.js +112 -71
  172. package/dist/es/components/pagination/Pagination.js +132 -123
  173. package/dist/es/components/pagination/page-item-ellipsis.vue.js +10 -10
  174. package/dist/es/components/pagination/page-item-ellipsis.vue2.js +24 -19
  175. package/dist/es/components/pagination/page-item-step.vue.js +14 -11
  176. package/dist/es/components/pagination/page-item-step.vue2.js +20 -22
  177. package/dist/es/components/pagination/page-item.vue.js +10 -9
  178. package/dist/es/components/pagination/page-item.vue2.js +24 -19
  179. package/dist/es/components/pagination/page-jumper.vue2.js +23 -23
  180. package/dist/es/components/pagination/page-options.vue.js +15 -10
  181. package/dist/es/components/pagination/page-options.vue2.js +21 -17
  182. package/dist/es/components/pagination/utils.js +4 -2
  183. package/dist/es/components/progress/circle.vue2.js +1 -1
  184. package/dist/es/components/progress/line.vue2.js +1 -1
  185. package/dist/es/components/progress/steps.vue2.js +1 -1
  186. package/dist/es/components/rate/Rate.js +1 -1
  187. package/dist/es/components/virtual-list-v2/virtual-list-item.js +1 -1
  188. package/dist/es/locale/en-US.js +2 -0
  189. package/dist/es/locale/zh-CN.js +2 -0
  190. 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
  191. 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
  192. 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
  193. 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
  194. 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
  195. 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
  196. 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
  197. 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
  198. package/dist/es/style.css +1 -1
  199. package/dist/index.cjs +3 -3
  200. package/dist/index.umd.js +3 -3
  201. package/dist/locale/interface.d.ts +3 -0
  202. package/dist/style/base.css +1 -1
  203. package/dist/style/button.css +1 -1
  204. package/dist/style/form-select.css +1 -1
  205. package/dist/style/network.css +1 -1
  206. package/dist/style/pagination.css +1 -1
  207. package/dist/style/table.css +1 -1
  208. package/dist/style.css +1 -1
  209. package/package.json +10 -5
  210. /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
  211. /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
  212. /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
  213. /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
  214. /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
  215. /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
  216. /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
  217. /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
  218. /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
  219. /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
  220. /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
  221. /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
  222. /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
  223. /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
  224. /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
  225. /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
  226. /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 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({
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 c = X("pagination"), {
218
- t: S
219
- } = Y(), {
220
- disabled: y,
221
- pageItemStyle: A,
222
- activePageItemStyle: E,
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(() => {
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 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);
235
- a !== l.value && (p.value = a, f("update:current", a), f("change", 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
- }, J = (e) => {
238
- k(e) && (N.value = e, f("update:pageSize", e), f("pageSizeChange", e));
239
- }, s = H({
240
- current: l,
241
- style: A,
242
- activeStyle: E,
243
- onClick: C
244
- }), V = {
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 s.current;
247
+ return i.current;
247
248
  },
248
249
  get disabled() {
249
- return y.value;
250
+ return C.value;
250
251
  },
251
252
  get style() {
252
- return s.style;
253
+ return i.style;
253
254
  },
254
255
  get activeStyle() {
255
- return s.activeStyle;
256
+ return i.activeStyle;
256
257
  },
257
258
  get onClick() {
258
- return s.onClick;
259
+ return i.onClick;
259
260
  }
260
- }, M = {
261
+ }, O = {
261
262
  get current() {
262
- return s.current;
263
+ return i.current;
263
264
  },
264
265
  get disabled() {
265
- return y.value;
266
+ return C.value;
266
267
  },
267
268
  get style() {
268
- return s.style;
269
+ return i.style;
269
270
  },
270
271
  get onClick() {
271
- return s.onClick;
272
+ return i.onClick;
272
273
  },
273
274
  get pages() {
274
- return u.value;
275
+ return r.value;
275
276
  }
276
- }, _ = {
277
+ }, V = {
277
278
  get current() {
278
- return s.current;
279
+ return i.current;
279
280
  },
280
281
  get disabled() {
281
- return y.value;
282
+ return C.value;
282
283
  },
283
284
  get style() {
284
- return s.style;
285
+ return i.style;
285
286
  },
286
287
  get onClick() {
287
- return s.onClick;
288
+ return i.onClick;
288
289
  },
289
290
  get pages() {
290
- return u.value;
291
+ return r.value;
291
292
  }
292
- }, r = (e, a = {}) => e === "more" ? n(Q, b(a, _), {
293
+ }, u = (e, a = {}) => e === "more" ? l(re, S(a, V), {
293
294
  default: o["page-item-ellipsis"]
294
- }) : e === "previous" ? n(L, b({
295
+ }) : e === "previous" ? l(I, S({
295
296
  type: "previous"
296
- }, a, M), {
297
+ }, a, O), {
297
298
  default: o["page-item-step"]
298
- }) : e === "next" ? n(L, b({
299
+ }) : e === "next" ? l(I, S({
299
300
  type: "next"
300
- }, a, M), {
301
+ }, a, O), {
301
302
  default: o["page-item-step"]
302
- }) : n(K, b(a, V), {
303
+ }) : l(ae, S(a, J), {
303
304
  default: o["page-item"]
304
- }), R = g(() => {
305
+ }), G = s(() => {
305
306
  const e = [];
306
- if (u.value < t.baseSize + t.bufferSize * 2)
307
- for (let a = 1; a <= u.value; a++)
308
- e.push(r("page", {
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, 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", {
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(r("more", {
318
+ })), e.push(u("more", {
318
319
  key: "left-ellipsis-pager",
319
- step: -(t.bufferSize * 2 + 1)
320
+ step: -(n.value * 2 + 1)
320
321
  })));
321
- for (let v = a; v <= m; v++)
322
- e.push(r("page", {
323
- key: v,
324
- pageNumber: v
322
+ for (let p = a; p <= c; p++)
323
+ e.push(u("page", {
324
+ key: p,
325
+ pageNumber: p
325
326
  }));
326
- j && (e.push(r("more", {
327
+ v && (e.push(u("more", {
327
328
  key: "right-ellipsis-pager",
328
- step: t.bufferSize * 2 + 1
329
- })), e.push(r("page", {
330
- key: u.value,
331
- pageNumber: u.value
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
- }), q = () => t.simple ? n("span", {
336
- class: c.element("simple")
337
- }, [r("previous", {
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
- }), n(I, {
352
+ }), l(T, {
340
353
  disabled: t.disabled,
341
- current: l.value,
342
- size: d.value,
343
- pages: u.value,
354
+ current: m.value,
355
+ size: h.value,
356
+ pages: r.value,
344
357
  simple: !0,
345
- onChange: C
346
- }, null), r("next", {
358
+ onChange: M
359
+ }, null), u("next", {
347
360
  simple: !0
348
- })]) : n("ul", {
349
- class: c.element("list")
350
- }, [r("previous"), R.value, t.showMore && r("more", {
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: t.bufferSize * 2 + 1
353
- }), r("next")]);
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));
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 $ = g(() => [c.block, c.modifier(`size-${d.value}`), {
366
- [c.modifier("simple")]: t.simple,
367
- [c.modifier("disabled")]: t.disabled
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 && u.value <= 1 ? null : n("div", {
372
- class: $.value,
380
+ return t.hideOnSinglePage && r.value <= 1 ? null : l("div", {
381
+ class: D.value,
373
382
  role: "navigation",
374
- "aria-label": S("pagination.ariaLabel")
375
- }, [t.showTotal && n("span", {
376
- class: c.element("total")
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: P.value
379
- })) ?? S("pagination.total", {
380
- total: P.value
381
- })]), q(), t.showPageSize && n(U, {
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: z.value,
385
- size: d.value,
386
- onChange: J,
393
+ pageSize: y.value,
394
+ size: h.value,
395
+ onChange: F,
387
396
  selectProps: t.pageSizeProps
388
- }, null), !t.simple && t.showJumper && n(I, {
397
+ }, null), !t.simple && t.showJumper && l(T, {
389
398
  disabled: t.disabled,
390
- current: l.value,
391
- pages: u.value,
392
- size: d.value,
393
- ariaLabel: S("pagination.jumpTo"),
394
- onChange: C
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
- oe as default
412
+ Se as default
404
413
  };
@@ -1,24 +1,24 @@
1
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
- import m from "../../_virtual/_plugin-vue_export-helper.js";
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, u, g, k, C) {
6
- const a = i("icon-more");
7
- return r(), s("li", {
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.disabled ? -1 : 0,
10
+ tabindex: e.mergedDisabled ? -1 : 0,
11
11
  "aria-label": e.t("pagination.jumpToPage", { page: e.nextPage }),
12
- "aria-disabled": e.disabled || void 0,
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
- p(a)
17
+ m(a)
18
18
  ])
19
19
  ], 42, b);
20
20
  }
21
- const y = /* @__PURE__ */ m(l, [["render", f]]);
21
+ const w = /* @__PURE__ */ p(l, [["render", f]]);
22
22
  export {
23
- y as default
23
+ w as default
24
24
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as c, computed as i } from "vue";
2
- import p from "../../icons/_self/more-dot.js";
3
- import { getLegalPage as u } from "./utils.js";
4
- import { getClassNameMixin as f } from "../../_utils/config.js";
5
- import { useLocale as d } from "../../locale/index.js";
6
- const x = c({
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: p
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: a }) {
31
- const o = f("pagination--item"), { t: s } = d(), n = i(
32
- () => u(e.current + e.step, {
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 = (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")]);
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: o,
44
- cls: l,
47
+ className: t,
48
+ cls: c,
45
49
  // 模板的 aria-label 需要它(点击后真正跳转到的页码)
46
- nextPage: n,
47
- handleClick: r,
50
+ nextPage: a,
51
+ mergedDisabled: i,
52
+ handleClick: n,
48
53
  handleKeyDown: m
49
54
  };
50
55
  }
@@ -1,10 +1,10 @@
1
- import t from "./page-item-step.vue2.js";
2
- import { resolveComponent as i, openBlock as o, createBlock as n, resolveDynamicComponent as l, normalizeClass as s, withCtx as d, renderSlot as p } from "vue";
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, g, k) {
5
- const a = i("icon-right"), r = i("icon-left");
6
- return o(), n(l(e.simple ? "span" : "li"), {
7
- class: s(e.cls),
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: d(() => [
16
- p(e.$slots, "default", {
15
+ default: s(() => [
16
+ d(e.$slots, "default", {
17
17
  type: e.isNext ? "next" : "previous"
18
18
  }, () => [
19
- e.isNext ? (o(), n(a, { key: 0 })) : (o(), n(r, { key: 1 }))
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 v = /* @__PURE__ */ m(t, [["render", c]]);
28
+ const w = /* @__PURE__ */ m(n, [["render", c]]);
26
29
  export {
27
- v as default
30
+ w as default
28
31
  };
@@ -1,14 +1,12 @@
1
- import { defineComponent as d, computed as a } from "vue";
2
- import f from "../../icons/_self/left.js";
3
- import g from "../../icons/_self/right.js";
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 b } from "../../locale/index.js";
7
- const C = d({
5
+ import { useLocale as p } from "../../locale/index.js";
6
+ const q = d({
8
7
  name: "StepPager",
9
8
  components: {
10
- IconLeft: f,
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: m }) {
37
- const t = y("pagination--item"), { t: u } = b(), r = e.type === "next", i = a(() => e.disabled ? e.disabled : !e.pages || r && e.current === e.pages ? !0 : !r && e.current <= 1), l = a(
38
- () => p(e.current + (r ? 1 : -1), {
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 = (n) => {
43
- i.value || m("click", l.value);
44
- }, c = (n) => {
45
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), o());
46
- }, s = a(() => [
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")]: i.value
48
+ [t.modifier("disabled")]: a.value
51
49
  }
52
50
  ]);
53
51
  return {
54
- t: u,
52
+ t: l,
55
53
  className: t,
56
54
  cls: s,
57
- isNext: r,
58
- mergedDisabled: i,
55
+ isNext: n,
56
+ mergedDisabled: a,
59
57
  handleClick: o,
60
- handleKeyDown: c
58
+ handleKeyDown: m
61
59
  };
62
60
  }
63
61
  });
64
62
  export {
65
- C as default
63
+ q as default
66
64
  };
@@ -1,24 +1,25 @@
1
- import o from "./page-item.vue2.js";
2
- import { openBlock as i, createElementBlock as l, normalizeStyle as n, normalizeClass as d, renderSlot as s, createTextVNode as t, toDisplayString as p } from "vue";
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 u = ["tabindex", "aria-current", "aria-disabled"];
5
- function b(e, r, f, g, y, k) {
6
- return i(), l("li", {
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: r[0] || (r[0] = (...a) => e.handleClick && e.handleClick(...a)),
14
- onKeydown: r[1] || (r[1] = (...a) => e.handleKeyDown && e.handleKeyDown(...a))
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, u);
20
+ ], 46, b);
20
21
  }
21
- const v = /* @__PURE__ */ m(o, [["render", b]]);
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 o, computed as n } from "vue";
2
- import { getClassNameMixin as u } from "../../_utils/config.js";
3
- const f = o({
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: l }) {
25
- const a = u("pagination--item"), c = n(() => e.current === e.pageNumber), i = (t) => {
26
- e.disabled || l("click", e.pageNumber, t);
27
- }, m = (t) => {
28
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), i(t));
29
- }, r = n(() => [
30
- a.block,
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
- [a.modifier("active")]: c.value
36
+ [n.modifier("active")]: i.value
33
37
  }
34
- ]), s = n(() => c.value ? e.activeStyle : e.style);
38
+ ]), g = a(() => i.value ? { ...e.style, ...e.activeStyle } : e.style);
35
39
  return {
36
- className: a,
37
- isActive: c,
38
- cls: r,
39
- mergedStyle: s,
40
- handleClick: i,
41
- handleKeyDown: m
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
- f as default
51
+ N as default
47
52
  };