x-next 1.5.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 (128) hide show
  1. package/AI_USAGE.md +2 -2
  2. package/CHANGELOG.md +36 -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 +35 -5
  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 +209 -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/table/Table.d.ts +1 -1
  52. package/dist/components/table/index.d.ts +3 -3
  53. package/dist/components/tabs/Tabs.d.ts +1 -1
  54. package/dist/components/tabs/index.d.ts +3 -3
  55. package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
  56. package/dist/components/time-picker/index.d.ts +6 -6
  57. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  58. package/dist/components/tooltip/index.d.ts +3 -3
  59. package/dist/components/trigger/Trigger.d.ts +1 -1
  60. package/dist/components/trigger/index.d.ts +3 -3
  61. package/dist/components/watermark/Watermark.d.ts +1 -1
  62. package/dist/components/watermark/index.d.ts +3 -3
  63. package/dist/es/_styles/palette-aliases.js +8 -0
  64. package/dist/es/_utils/color.js +73 -0
  65. package/dist/es/components/button/Button.js +2 -2
  66. package/dist/es/components/color-picker/ColorPicker.js +239 -0
  67. package/dist/es/components/color-picker/gradient-slider.js +79 -0
  68. package/dist/es/components/color-picker/index.js +8 -0
  69. package/dist/es/components/color-picker/panel.js +307 -0
  70. package/dist/es/components/color-picker/sv-panel.js +99 -0
  71. package/dist/es/components/dropdown/dropdown-panel.vue.js +17 -17
  72. package/dist/es/components/form-input/Input.js +7 -7
  73. package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
  74. package/dist/es/components/form-input/InputSearch.js +2 -2
  75. package/dist/es/components/form-input-number/InputNumber.js +12 -12
  76. package/dist/es/components/heatmap/Heatmap.js +334 -0
  77. package/dist/es/components/heatmap/helpers/matrix.js +106 -0
  78. package/dist/es/components/heatmap/index.js +8 -0
  79. package/dist/es/components/index.js +118 -114
  80. package/dist/es/components/menu/sub-menu-pop.vue2.js +12 -12
  81. package/dist/es/components/network/Network.vue2.js +72 -72
  82. package/dist/es/components/network/utils.js +44 -35
  83. package/dist/es/components/pagination/Pagination.js +113 -104
  84. package/dist/es/components/pagination/page-item-ellipsis.vue.js +13 -12
  85. package/dist/es/components/pagination/page-item-ellipsis.vue2.js +19 -15
  86. package/dist/es/components/pagination/page-jumper.vue.js +13 -12
  87. package/dist/es/components/pagination/page-jumper.vue2.js +7 -4
  88. package/dist/es/components/pagination/page-options.vue.js +4 -3
  89. package/dist/es/components/pagination/page-options.vue2.js +17 -15
  90. package/dist/es/components/skeleton/Skeleton.vue.js +11 -9
  91. package/dist/es/components/skeleton/SkeletonLine.vue.js +9 -8
  92. package/dist/es/components/skeleton/SkeletonShape.vue.js +8 -7
  93. package/dist/es/components/spin/Spin.js +124 -60
  94. package/dist/es/components/table/Table.js +3 -1
  95. package/dist/es/components/trigger/Trigger.js +19 -19
  96. package/dist/es/icons/_self/empty-better.js +25 -8
  97. package/dist/es/index.js +162 -158
  98. package/dist/es/locale/en-US.js +17 -1
  99. package/dist/es/locale/zh-CN.js +17 -1
  100. package/dist/es/style.css +1 -1
  101. package/dist/index.cjs +4 -4
  102. package/dist/index.umd.js +4 -4
  103. package/dist/locale/interface.d.ts +28 -0
  104. package/dist/style/base.css +1 -1
  105. package/dist/style/button.css +1 -1
  106. package/dist/style/color-picker.css +1 -0
  107. package/dist/style/color-picker.js +2 -0
  108. package/dist/style/date-picker.css +1 -1
  109. package/dist/style/empty.css +1 -1
  110. package/dist/style/form-checkbox.css +1 -1
  111. package/dist/style/form-input-tag.css +1 -1
  112. package/dist/style/form-input.css +1 -1
  113. package/dist/style/form-radio.css +1 -1
  114. package/dist/style/form-textarea.css +1 -1
  115. package/dist/style/form.css +1 -1
  116. package/dist/style/heatmap.css +1 -0
  117. package/dist/style/heatmap.js +2 -0
  118. package/dist/style/image.css +1 -1
  119. package/dist/style/menu.css +1 -1
  120. package/dist/style/pagination.css +1 -1
  121. package/dist/style/skeleton.css +1 -1
  122. package/dist/style/spin.css +1 -1
  123. package/dist/style/steps.css +1 -1
  124. package/dist/style/table.css +1 -1
  125. package/dist/style.css +1 -1
  126. package/dist/types.d.ts +2 -0
  127. package/package.json +1 -1
  128. package/volar.d.ts +2 -0
@@ -1,60 +1,67 @@
1
- var T = Object.defineProperty;
2
- var C = (n, e, t) => e in n ? T(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var o = (n, e, t) => C(n, typeof e != "symbol" ? e + "" : e, t);
4
- const v = {
1
+ var b = Object.defineProperty;
2
+ var T = (t, e, n) => e in t ? b(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var o = (t, e, n) => T(t, typeof e != "symbol" ? e + "" : e, n);
4
+ const y = {
5
5
  online: !0,
6
6
  quality: "unknown",
7
7
  source: "manual",
8
8
  reason: "initial",
9
9
  lastCheckedAt: 0
10
- }, u = () => Date.now(), d = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), m = () => {
10
+ }, f = () => Date.now(), d = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), m = () => {
11
11
  if (!(typeof navigator > "u"))
12
12
  return navigator.connection;
13
- }, l = () => typeof navigator < "u" && navigator.onLine === !1, k = (n) => {
14
- const { downlink: e = 0, rtt: t = Number.POSITIVE_INFINITY, effectiveType: i } = n;
15
- return i === "slow-2g" || i === "2g" ? "poor" : i === "3g" ? "medium" : e > 2 && t <= 100 ? "good" : e > 1 && t <= 300 ? "medium" : "poor";
16
- }, E = (n) => n < 500 ? "good" : n < 1500 ? "medium" : "poor", w = (n, e) => ({
13
+ }, l = () => typeof navigator < "u" && navigator.onLine === !1, k = (t) => {
14
+ const { effectiveType: e } = t;
15
+ if (e === "slow-2g" || e === "2g") return "poor";
16
+ if (e === "3g") return "medium";
17
+ if (e === "4g") return "good";
18
+ const { downlink: n, rtt: i } = t, r = typeof n == "number" && Number.isFinite(n), h = typeof i == "number" && Number.isFinite(i);
19
+ if (!(!r || !h))
20
+ return n > 2 && i <= 100 ? "good" : n > 1 && i <= 300 ? "medium" : "poor";
21
+ }, q = (t) => t < 500 ? "good" : t < 1500 ? "medium" : "poor", w = (t, e) => ({
17
22
  online: !1,
18
23
  quality: "offline",
19
- source: n,
24
+ source: t,
20
25
  reason: e,
21
- lastCheckedAt: u()
22
- }), c = (n) => {
26
+ lastCheckedAt: f()
27
+ }), c = (t) => {
23
28
  if (typeof navigator > "u")
24
29
  return {
25
30
  online: !0,
26
31
  quality: "unknown",
27
32
  source: "navigator",
28
33
  reason: "unsupported",
29
- lastCheckedAt: u()
34
+ lastCheckedAt: f()
30
35
  };
31
36
  if (l())
32
37
  return w("navigator", "browser-offline");
33
38
  const e = m();
34
39
  return e ? {
35
40
  online: !0,
36
- quality: k(e),
41
+ quality: k(e) ?? "unknown",
37
42
  downlink: e.downlink,
38
43
  rtt: e.rtt,
39
44
  effectiveType: e.effectiveType,
40
45
  source: "connection",
41
- reason: n,
42
- lastCheckedAt: u()
46
+ reason: t,
47
+ lastCheckedAt: f()
43
48
  } : {
44
49
  online: !0,
45
50
  quality: "good",
46
51
  source: "navigator",
47
- reason: n,
48
- lastCheckedAt: u()
52
+ reason: t,
53
+ lastCheckedAt: f()
49
54
  };
50
55
  };
51
56
  class L {
52
- constructor(e, t = {}) {
57
+ constructor(e, n = {}) {
53
58
  o(this, "callback");
54
59
  o(this, "options");
55
60
  o(this, "timer");
56
61
  o(this, "initialTimer");
57
62
  o(this, "connection");
63
+ /** 不支持 addEventListener 时保存 connection.onchange 的原处理器,销毁时归还 */
64
+ o(this, "previousConnectionOnChange");
58
65
  o(this, "controller");
59
66
  o(this, "destroyed", !1);
60
67
  o(this, "pendingRefresh");
@@ -65,51 +72,51 @@ class L {
65
72
  o(this, "handleConnectionChange", () => {
66
73
  this.refresh("connection-change");
67
74
  });
68
- this.callback = e, this.options = t, this.boot();
75
+ this.callback = e, this.options = n, this.boot();
69
76
  }
70
77
  checkNetworkQuality() {
71
78
  return c().quality;
72
79
  }
73
80
  getSnapshot() {
74
- return typeof window > "u" || typeof navigator > "u" ? v : c();
81
+ return typeof window > "u" || typeof navigator > "u" ? y : c();
75
82
  }
76
83
  async refresh(e) {
77
84
  if (this.pendingRefresh) return this.pendingRefresh;
78
- const t = ++this.sequence;
79
- return this.pendingRefresh = this.resolveStatus(e).then((i) => (!this.destroyed && t === this.sequence && this.emitCallback(i), i)).finally(() => {
85
+ const n = ++this.sequence;
86
+ return this.pendingRefresh = this.resolveStatus(e).then((i) => (!this.destroyed && n === this.sequence && this.emitCallback(i), i)).finally(() => {
80
87
  this.pendingRefresh = void 0;
81
88
  }), this.pendingRefresh;
82
89
  }
83
90
  async resolveStatus(e) {
84
- return typeof window > "u" || typeof navigator > "u" ? v : l() ? w("navigator", "browser-offline") : this.options.ping ? this.pingNetworkQuality(this.options.ping, this.options.timeout) : c(e);
91
+ return typeof window > "u" || typeof navigator > "u" ? y : l() ? w("navigator", "browser-offline") : this.options.ping ? this.pingNetworkQuality(this.options.ping, this.options.timeout) : c(e);
85
92
  }
86
- async pingNetworkQuality(e, t = 5e3) {
93
+ async pingNetworkQuality(e, n = 5e3) {
87
94
  var p;
88
95
  const i = d();
89
96
  (p = this.controller) == null || p.abort();
90
97
  const r = typeof AbortController < "u" ? new AbortController() : void 0;
91
98
  this.controller = r;
92
- const f = r ? setTimeout(() => r.abort(), Math.max(t, 1)) : void 0;
99
+ const h = r ? setTimeout(() => r.abort(), Math.max(n, 1)) : void 0;
93
100
  try {
94
101
  const s = await fetch(e, {
95
102
  cache: "no-cache",
96
103
  method: "GET",
97
104
  mode: "cors",
98
105
  signal: r == null ? void 0 : r.signal
99
- }), a = Math.round(d() - i), b = await s.arrayBuffer(), g = Math.round(d() - i), y = b.byteLength || Number(s.headers.get("content-length") || 0), h = y > 0 && g > 0 ? y / g * 1e3 : void 0;
106
+ }), a = Math.round(d() - i), C = await s.arrayBuffer(), g = Math.round(d() - i), v = C.byteLength || Number(s.headers.get("content-length") || 0), u = v > 0 && g > 0 ? v / g * 1e3 : void 0;
100
107
  return s.ok ? {
101
108
  ...c(),
102
- quality: E(a),
109
+ quality: q(a),
103
110
  latency: a,
104
- downloadSpeed: h,
105
- speedSource: h ? "probe" : void 0,
111
+ downloadSpeed: u,
112
+ speedSource: u ? "probe" : void 0,
106
113
  source: "probe"
107
114
  } : {
108
115
  ...c("http-error"),
109
116
  quality: "poor",
110
117
  latency: a,
111
- downloadSpeed: h,
112
- speedSource: h ? "probe" : void 0,
118
+ downloadSpeed: u,
119
+ speedSource: u ? "probe" : void 0,
113
120
  source: "probe",
114
121
  reason: "http-error"
115
122
  };
@@ -123,7 +130,7 @@ class L {
123
130
  reason: a ? "probe-timeout" : "probe-error"
124
131
  };
125
132
  } finally {
126
- f && clearTimeout(f), this.controller === r && (this.controller = void 0);
133
+ h && clearTimeout(h), this.controller === r && (this.controller = void 0);
127
134
  }
128
135
  }
129
136
  boot() {
@@ -131,7 +138,9 @@ class L {
131
138
  return;
132
139
  window.addEventListener("online", this.handleWindowChange), window.addEventListener("offline", this.handleWindowChange);
133
140
  const e = m();
134
- e && (this.connection = e, e.addEventListener ? e.addEventListener("change", this.handleConnectionChange) : e.onchange = this.handleConnectionChange), this.initialTimer = setTimeout(() => {
141
+ e && (this.connection = e, e.addEventListener ? e.addEventListener("change", this.handleConnectionChange) : (this.previousConnectionOnChange = e.onchange, e.onchange = (n) => {
142
+ typeof this.previousConnectionOnChange == "function" && this.previousConnectionOnChange.call(e, n), this.handleConnectionChange();
143
+ })), this.initialTimer = setTimeout(() => {
135
144
  this.refresh();
136
145
  }, 0), this.scheduleNextRefresh();
137
146
  }
@@ -145,7 +154,7 @@ class L {
145
154
  }
146
155
  destroy() {
147
156
  var e;
148
- this.destroyed = !0, this.sequence += 1, (e = this.controller) == null || e.abort(), this.controller = void 0, this.initialTimer && (clearTimeout(this.initialTimer), this.initialTimer = void 0), this.timer && (clearTimeout(this.timer), this.timer = void 0), typeof window < "u" && (window.removeEventListener("online", this.handleWindowChange), window.removeEventListener("offline", this.handleWindowChange)), this.connection && (this.connection.removeEventListener ? this.connection.removeEventListener("change", this.handleConnectionChange) : this.connection.onchange === this.handleConnectionChange && (this.connection.onchange = null), this.connection = void 0);
157
+ this.destroyed = !0, this.sequence += 1, (e = this.controller) == null || e.abort(), this.controller = void 0, this.initialTimer && (clearTimeout(this.initialTimer), this.initialTimer = void 0), this.timer && (clearTimeout(this.timer), this.timer = void 0), typeof window < "u" && (window.removeEventListener("online", this.handleWindowChange), window.removeEventListener("offline", this.handleWindowChange)), this.connection && (this.connection.removeEventListener ? this.connection.removeEventListener("change", this.handleConnectionChange) : this.connection.onchange = this.previousConnectionOnChange ?? null, this.connection = void 0, this.previousConnectionOnChange = void 0);
149
158
  }
150
159
  }
151
160
  export {
@@ -1,14 +1,14 @@
1
- import { defineComponent as F, toRefs as $, ref as M, computed as d, reactive as D, watch as j, createVNode as n, mergeProps as b } from "vue";
2
- 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";
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
7
  import { isNumber as h } 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({
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,37 +210,43 @@ const ne = /* @__PURE__ */ F({
210
210
  * @slot total
211
211
  * @binding {number} total
212
212
  */
213
- setup(e, {
214
- emit: o,
215
- slots: f
213
+ setup(t, {
214
+ emit: f,
215
+ slots: o
216
216
  }) {
217
- const g = U("pagination"), {
218
- t: I
219
- } = W(), {
220
- disabled: P,
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: m
226
- } = Q(L), p = M(e.defaultCurrent), C = M(e.defaultPageSize), k = (t) => h(t) && Number.isFinite(t) && t > 0, N = (t, a = 10) => k(t) ? t : a, S = d(() => e.current ?? p.value), y = d(() => N(e.pageSize ?? C.value, N(e.defaultPageSize))), u = d(() => Math.max(Math.ceil(e.total / y.value), 1)), l = d(() => h(S.value) ? Math.min(Math.max(S.value, 1), u.value) : 1), z = (t) => {
227
- if (t !== l.value && h(t) && !e.disabled) {
228
- const a = Math.min(Math.max(t, 1), u.value);
229
- a !== l.value && (p.value = a, o("update:current", a), o("change", a));
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);
235
+ a !== l.value && (p.value = a, f("update:current", a), f("change", a));
230
236
  }
231
- }, J = (t) => {
232
- k(t) && (C.value = t, o("update:pageSize", t), o("pageSizeChange", t));
233
- }, s = 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: z
243
+ onClick: C
238
244
  }), V = {
239
245
  get current() {
240
246
  return s.current;
241
247
  },
242
248
  get disabled() {
243
- return P.value;
249
+ return y.value;
244
250
  },
245
251
  get style() {
246
252
  return s.style;
@@ -251,12 +257,12 @@ const ne = /* @__PURE__ */ F({
251
257
  get onClick() {
252
258
  return s.onClick;
253
259
  }
254
- }, w = {
260
+ }, M = {
255
261
  get current() {
256
262
  return s.current;
257
263
  },
258
264
  get disabled() {
259
- return P.value;
265
+ return y.value;
260
266
  },
261
267
  get style() {
262
268
  return s.style;
@@ -271,6 +277,9 @@ const ne = /* @__PURE__ */ F({
271
277
  get current() {
272
278
  return s.current;
273
279
  },
280
+ get disabled() {
281
+ return y.value;
282
+ },
274
283
  get style() {
275
284
  return s.style;
276
285
  },
@@ -280,116 +289,116 @@ const ne = /* @__PURE__ */ F({
280
289
  get pages() {
281
290
  return u.value;
282
291
  }
283
- }, r = (t, a = {}) => t === "more" ? n(H, b(a, _), {
284
- default: f["page-item-ellipsis"]
285
- }) : t === "previous" ? n(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, w), {
288
- default: f["page-item-step"]
289
- }) : t === "next" ? n(O, b({
296
+ }, a, M), {
297
+ default: o["page-item-step"]
298
+ }) : e === "next" ? n(L, b({
290
299
  type: "next"
291
- }, a, w), {
292
- default: f["page-item-step"]
293
- }) : n(G, b(a, V), {
294
- default: f["page-item"]
295
- }), R = d(() => {
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, c = u.value, i = !1, x = !1;
305
- l.value > 2 + e.bufferSize && (i = !0, a = Math.min(l.value - e.bufferSize, u.value - 2 * e.bufferSize)), l.value < u.value - (e.bufferSize + 1) && (x = !0, c = Math.max(l.value + e.bufferSize, 2 * e.bufferSize + 1)), i && (t.push(r("page", {
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 <= c; 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
- x && (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 ? n("span", {
327
- class: g.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
- }), n(B, {
331
- disabled: e.disabled,
339
+ }), n(I, {
340
+ disabled: t.disabled,
332
341
  current: l.value,
333
- size: m.value,
342
+ size: d.value,
334
343
  pages: u.value,
335
344
  simple: !0,
336
- onChange: z
345
+ onChange: C
337
346
  }, null), r("next", {
338
347
  simple: !0
339
348
  })]) : n("ul", {
340
- class: g.element("list")
341
- }, [r("previous"), R.value, e.showMore && r("more", {
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(y, (t, a) => {
346
- if (e.autoAdjust && t !== a && l.value > 1) {
347
- const c = a * (l.value - 1) + 1, i = Math.ceil(c / t);
348
- i !== l.value && (p.value = i, o("update:current", i), o("change", i));
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));
349
358
  }
350
- }), j(u, (t, a) => {
351
- if (!e.autoAdjust || t === a)
352
- return;
353
- const c = S.value;
354
- if (!h(c) || c <= t)
359
+ }), B(u, (e, a) => {
360
+ if (!t.autoAdjust || e === a || x.value <= e)
355
361
  return;
356
- const i = Math.max(t, 1);
357
- p.value = i, o("update:current", i), o("change", i);
362
+ const i = Math.max(e, 1);
363
+ p.value = i, f("update:current", i), f("change", i);
358
364
  });
359
- const q = d(() => [g.block, g.modifier(`size-${m.value}`), {
360
- [g.modifier("simple")]: e.simple,
361
- [g.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
362
368
  }]);
363
369
  return () => {
364
- var t;
365
- return e.hideOnSinglePage && u.value <= 1 ? null : n("div", {
366
- class: q.value
367
- }, [e.showTotal && n("span", {
368
- class: g.element("total")
369
- }, [((t = f.total) == null ? void 0 : t.call(f, {
370
- total: e.total
371
- })) ?? I("pagination.total", {
372
- total: e.total
373
- })]), T(), e.showPageSize && n(K, {
374
- disabled: e.disabled,
375
- sizeOptions: e.pageSizeOptions,
376
- pageSize: y.value,
377
- size: m.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,
378
386
  onChange: J,
379
- selectProps: e.pageSizeProps
380
- }, null), !e.simple && e.showJumper && n(B, {
381
- disabled: e.disabled,
387
+ selectProps: t.pageSizeProps
388
+ }, null), !t.simple && t.showJumper && n(I, {
389
+ disabled: t.disabled,
382
390
  current: l.value,
383
391
  pages: u.value,
384
- size: m.value,
385
- onChange: z
392
+ size: d.value,
393
+ ariaLabel: S("pagination.jumpTo"),
394
+ onChange: C
386
395
  }, {
387
- "jumper-prepend": f["jumper-prepend"],
388
- "jumper-append": f["jumper-append"]
396
+ "jumper-prepend": o["jumper-prepend"],
397
+ "jumper-append": o["jumper-append"]
389
398
  })]);
390
399
  };
391
400
  }
392
401
  });
393
402
  export {
394
- ne as default
403
+ oe as default
395
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
  });