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.
- package/AI_USAGE.md +2 -2
- package/CHANGELOG.md +36 -0
- package/dist/_utils/color.d.ts +53 -0
- package/dist/components/color-picker/ColorPicker.d.ts +239 -0
- package/dist/components/color-picker/gradient-slider.d.ts +52 -0
- package/dist/components/color-picker/index.d.ts +238 -0
- package/dist/components/color-picker/panel.d.ts +721 -0
- package/dist/components/color-picker/sv-panel.d.ts +48 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/dropdown/Dropdown.vue.d.ts +34 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +35 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +34 -4
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +30 -0
- package/dist/components/dropdown/index.d.ts +209 -29
- package/dist/components/form/FormItem.vue.d.ts +3 -3
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +6 -6
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/SelectDropdown.vue.d.ts +30 -0
- package/dist/components/form-select/index.d.ts +66 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/heatmap/Heatmap.d.ts +311 -0
- package/dist/components/heatmap/helpers/matrix.d.ts +58 -0
- package/dist/components/heatmap/index.d.ts +372 -0
- package/dist/components/heatmap/interface.d.ts +57 -0
- package/dist/components/image/Image.vue.d.ts +3 -3
- package/dist/components/image/ImagePreview.vue.d.ts +3 -3
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +3 -3
- package/dist/components/image/index.d.ts +24 -24
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/network/utils.d.ts +2 -0
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +9 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +6 -0
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/skeleton/SkeletonShape.vue.d.ts +3 -3
- package/dist/components/skeleton/index.d.ts +6 -6
- package/dist/components/spin/Spin.d.ts +38 -0
- package/dist/components/spin/index.d.ts +30 -0
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/watermark/Watermark.d.ts +1 -1
- package/dist/components/watermark/index.d.ts +3 -3
- package/dist/es/_styles/palette-aliases.js +8 -0
- package/dist/es/_utils/color.js +73 -0
- package/dist/es/components/button/Button.js +2 -2
- package/dist/es/components/color-picker/ColorPicker.js +239 -0
- package/dist/es/components/color-picker/gradient-slider.js +79 -0
- package/dist/es/components/color-picker/index.js +8 -0
- package/dist/es/components/color-picker/panel.js +307 -0
- package/dist/es/components/color-picker/sv-panel.js +99 -0
- package/dist/es/components/dropdown/dropdown-panel.vue.js +17 -17
- package/dist/es/components/form-input/Input.js +7 -7
- package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
- package/dist/es/components/form-input/InputSearch.js +2 -2
- package/dist/es/components/form-input-number/InputNumber.js +12 -12
- package/dist/es/components/heatmap/Heatmap.js +334 -0
- package/dist/es/components/heatmap/helpers/matrix.js +106 -0
- package/dist/es/components/heatmap/index.js +8 -0
- package/dist/es/components/index.js +118 -114
- package/dist/es/components/menu/sub-menu-pop.vue2.js +12 -12
- package/dist/es/components/network/Network.vue2.js +72 -72
- package/dist/es/components/network/utils.js +44 -35
- package/dist/es/components/pagination/Pagination.js +113 -104
- package/dist/es/components/pagination/page-item-ellipsis.vue.js +13 -12
- package/dist/es/components/pagination/page-item-ellipsis.vue2.js +19 -15
- package/dist/es/components/pagination/page-jumper.vue.js +13 -12
- package/dist/es/components/pagination/page-jumper.vue2.js +7 -4
- package/dist/es/components/pagination/page-options.vue.js +4 -3
- package/dist/es/components/pagination/page-options.vue2.js +17 -15
- package/dist/es/components/skeleton/Skeleton.vue.js +11 -9
- package/dist/es/components/skeleton/SkeletonLine.vue.js +9 -8
- package/dist/es/components/skeleton/SkeletonShape.vue.js +8 -7
- package/dist/es/components/spin/Spin.js +124 -60
- package/dist/es/components/table/Table.js +3 -1
- package/dist/es/components/trigger/Trigger.js +19 -19
- package/dist/es/icons/_self/empty-better.js +25 -8
- package/dist/es/index.js +162 -158
- package/dist/es/locale/en-US.js +17 -1
- package/dist/es/locale/zh-CN.js +17 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +28 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -0
- package/dist/style/color-picker.js +2 -0
- package/dist/style/date-picker.css +1 -1
- package/dist/style/empty.css +1 -1
- package/dist/style/form-checkbox.css +1 -1
- package/dist/style/form-input-tag.css +1 -1
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-radio.css +1 -1
- package/dist/style/form-textarea.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/heatmap.css +1 -0
- package/dist/style/heatmap.js +2 -0
- package/dist/style/image.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/skeleton.css +1 -1
- package/dist/style/spin.css +1 -1
- package/dist/style/steps.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/volar.d.ts +2 -0
|
@@ -1,60 +1,67 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (
|
|
4
|
-
const
|
|
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
|
-
},
|
|
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 = (
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
24
|
+
source: t,
|
|
20
25
|
reason: e,
|
|
21
|
-
lastCheckedAt:
|
|
22
|
-
}), c = (
|
|
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:
|
|
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:
|
|
42
|
-
lastCheckedAt:
|
|
46
|
+
reason: t,
|
|
47
|
+
lastCheckedAt: f()
|
|
43
48
|
} : {
|
|
44
49
|
online: !0,
|
|
45
50
|
quality: "good",
|
|
46
51
|
source: "navigator",
|
|
47
|
-
reason:
|
|
48
|
-
lastCheckedAt:
|
|
52
|
+
reason: t,
|
|
53
|
+
lastCheckedAt: f()
|
|
49
54
|
};
|
|
50
55
|
};
|
|
51
56
|
class L {
|
|
52
|
-
constructor(e,
|
|
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 =
|
|
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" ?
|
|
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
|
|
79
|
-
return this.pendingRefresh = this.resolveStatus(e).then((i) => (!this.destroyed &&
|
|
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" ?
|
|
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,
|
|
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
|
|
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),
|
|
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:
|
|
109
|
+
quality: q(a),
|
|
103
110
|
latency: a,
|
|
104
|
-
downloadSpeed:
|
|
105
|
-
speedSource:
|
|
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:
|
|
112
|
-
speedSource:
|
|
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
|
-
|
|
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) :
|
|
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
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
9
|
-
import { getClassNameMixin as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
const
|
|
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": (
|
|
172
|
-
"update:pageSize": (
|
|
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: (
|
|
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: (
|
|
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(
|
|
214
|
-
emit:
|
|
215
|
-
slots:
|
|
213
|
+
setup(t, {
|
|
214
|
+
emit: f,
|
|
215
|
+
slots: o
|
|
216
216
|
}) {
|
|
217
|
-
const
|
|
218
|
-
t:
|
|
219
|
-
} =
|
|
220
|
-
disabled:
|
|
217
|
+
const c = X("pagination"), {
|
|
218
|
+
t: S
|
|
219
|
+
} = Y(), {
|
|
220
|
+
disabled: y,
|
|
221
221
|
pageItemStyle: A,
|
|
222
222
|
activePageItemStyle: E,
|
|
223
|
-
size:
|
|
224
|
-
} =
|
|
225
|
-
mergedSize:
|
|
226
|
-
} =
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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 = (
|
|
232
|
-
k(
|
|
233
|
-
}, s =
|
|
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:
|
|
243
|
+
onClick: C
|
|
238
244
|
}), V = {
|
|
239
245
|
get current() {
|
|
240
246
|
return s.current;
|
|
241
247
|
},
|
|
242
248
|
get disabled() {
|
|
243
|
-
return
|
|
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
|
-
},
|
|
260
|
+
}, M = {
|
|
255
261
|
get current() {
|
|
256
262
|
return s.current;
|
|
257
263
|
},
|
|
258
264
|
get disabled() {
|
|
259
|
-
return
|
|
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 = (
|
|
284
|
-
default:
|
|
285
|
-
}) :
|
|
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,
|
|
288
|
-
default:
|
|
289
|
-
}) :
|
|
296
|
+
}, a, M), {
|
|
297
|
+
default: o["page-item-step"]
|
|
298
|
+
}) : e === "next" ? n(L, b({
|
|
290
299
|
type: "next"
|
|
291
|
-
}, a,
|
|
292
|
-
default:
|
|
293
|
-
}) : n(
|
|
294
|
-
default:
|
|
295
|
-
}), R =
|
|
296
|
-
const
|
|
297
|
-
if (u.value <
|
|
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
|
-
|
|
308
|
+
e.push(r("page", {
|
|
300
309
|
key: a,
|
|
301
310
|
pageNumber: a
|
|
302
311
|
}));
|
|
303
312
|
else {
|
|
304
|
-
let a = 1,
|
|
305
|
-
l.value > 2 +
|
|
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
|
-
})),
|
|
317
|
+
})), e.push(r("more", {
|
|
309
318
|
key: "left-ellipsis-pager",
|
|
310
|
-
step: -(
|
|
319
|
+
step: -(t.bufferSize * 2 + 1)
|
|
311
320
|
})));
|
|
312
|
-
for (let v = a; v <=
|
|
313
|
-
|
|
321
|
+
for (let v = a; v <= m; v++)
|
|
322
|
+
e.push(r("page", {
|
|
314
323
|
key: v,
|
|
315
324
|
pageNumber: v
|
|
316
325
|
}));
|
|
317
|
-
|
|
326
|
+
j && (e.push(r("more", {
|
|
318
327
|
key: "right-ellipsis-pager",
|
|
319
|
-
step:
|
|
320
|
-
})),
|
|
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
|
|
326
|
-
}),
|
|
327
|
-
class:
|
|
334
|
+
return e;
|
|
335
|
+
}), q = () => t.simple ? n("span", {
|
|
336
|
+
class: c.element("simple")
|
|
328
337
|
}, [r("previous", {
|
|
329
338
|
simple: !0
|
|
330
|
-
}), n(
|
|
331
|
-
disabled:
|
|
339
|
+
}), n(I, {
|
|
340
|
+
disabled: t.disabled,
|
|
332
341
|
current: l.value,
|
|
333
|
-
size:
|
|
342
|
+
size: d.value,
|
|
334
343
|
pages: u.value,
|
|
335
344
|
simple: !0,
|
|
336
|
-
onChange:
|
|
345
|
+
onChange: C
|
|
337
346
|
}, null), r("next", {
|
|
338
347
|
simple: !0
|
|
339
348
|
})]) : n("ul", {
|
|
340
|
-
class:
|
|
341
|
-
}, [r("previous"), R.value,
|
|
349
|
+
class: c.element("list")
|
|
350
|
+
}, [r("previous"), R.value, t.showMore && r("more", {
|
|
342
351
|
key: "more",
|
|
343
|
-
step:
|
|
352
|
+
step: t.bufferSize * 2 + 1
|
|
344
353
|
}), r("next")]);
|
|
345
|
-
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
i !== l.value && (p.value = 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
|
-
}),
|
|
351
|
-
if (!
|
|
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(
|
|
357
|
-
p.value = i,
|
|
362
|
+
const i = Math.max(e, 1);
|
|
363
|
+
p.value = i, f("update:current", i), f("change", i);
|
|
358
364
|
});
|
|
359
|
-
const
|
|
360
|
-
[
|
|
361
|
-
[
|
|
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
|
|
365
|
-
return
|
|
366
|
-
class:
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}, [
|
|
370
|
-
|
|
371
|
-
})
|
|
372
|
-
total:
|
|
373
|
-
})
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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:
|
|
380
|
-
}, null), !
|
|
381
|
-
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:
|
|
385
|
-
|
|
392
|
+
size: d.value,
|
|
393
|
+
ariaLabel: S("pagination.jumpTo"),
|
|
394
|
+
onChange: C
|
|
386
395
|
}, {
|
|
387
|
-
"jumper-prepend":
|
|
388
|
-
"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
|
-
|
|
403
|
+
oe as default
|
|
395
404
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
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
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
class:
|
|
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:
|
|
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
|
-
|
|
16
|
-
|
|
16
|
+
t(e.$slots, "default", {}, () => [
|
|
17
|
+
p(a)
|
|
17
18
|
])
|
|
18
|
-
], 42,
|
|
19
|
+
], 42, b);
|
|
19
20
|
}
|
|
20
|
-
const y = /* @__PURE__ */ m(
|
|
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
|
|
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 =
|
|
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(
|
|
27
|
-
const o = f("pagination--item"), { t: s } = d(),
|
|
28
|
-
() => u(
|
|
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:
|
|
34
|
+
max: e.pages
|
|
31
35
|
})
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
(
|
|
36
|
-
},
|
|
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:
|
|
44
|
+
cls: l,
|
|
41
45
|
// 模板的 aria-label 需要它(点击后真正跳转到的页码)
|
|
42
|
-
nextPage:
|
|
43
|
-
handleClick:
|
|
44
|
-
handleKeyDown:
|
|
46
|
+
nextPage: n,
|
|
47
|
+
handleClick: r,
|
|
48
|
+
handleKeyDown: m
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
});
|