x-next 1.3.1 → 1.5.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 +71 -0
- package/dist/_utils/constant.d.ts +1 -1
- package/dist/_utils/palette.d.ts +6 -14
- package/dist/components/alert/Alert.vue.d.ts +9 -9
- package/dist/components/alert/index.d.ts +6 -6
- package/dist/components/button/ButtonGroup.vue.d.ts +22 -18
- package/dist/components/date-picker/DatePanel.vue.d.ts +342 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +343 -2
- package/dist/components/date-picker/index.d.ts +1765 -1083
- package/dist/components/dropdown/DropdownButton.vue.d.ts +2 -1
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/form-input-tag/index.d.ts +26 -25
- package/dist/components/form-input-tag/interface.d.ts +8 -0
- package/dist/components/link/Link.vue.d.ts +4 -4
- package/dist/components/link/index.d.ts +6 -6
- package/dist/components/message/index.d.ts +3 -3
- package/dist/components/message/message.vue.d.ts +1 -1
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/popconfirm/src/types.d.ts +1 -1
- package/dist/components/progress/Progress.vue.d.ts +3 -3
- package/dist/components/progress/index.d.ts +3 -3
- package/dist/components/steps/context.d.ts +9 -0
- package/dist/components/tabs/TabPane.vue.d.ts +2 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/interface.d.ts +4 -0
- package/dist/components/tag/Tag.vue.d.ts +14 -0
- package/dist/components/tag/index.d.ts +9 -0
- package/dist/components/tag/interface.d.ts +5 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +127 -17
- package/dist/components/trend-chart/components/trend-chart-curve.d.ts +27 -7
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +4 -0
- package/dist/components/trend-chart/helpers/getPadding.d.ts +3 -2
- package/dist/components/trend-chart/index.d.ts +223 -28
- package/dist/components/trend-chart/props.d.ts +63 -5
- package/dist/es/_styles/palette-aliases.js +182 -127
- package/dist/es/_utils/palette.js +49 -43
- package/dist/es/components/_components/picker/input-range.vue2.js +10 -10
- package/dist/es/components/_components/picker/input.vue2.js +20 -20
- package/dist/es/components/_components/select-view/select-view.js +2 -2
- package/dist/es/components/alert/Alert.vue.js +2 -2
- package/dist/es/components/alert/Alert.vue2.js +21 -20
- package/dist/es/components/button/Button.js +17 -17
- package/dist/es/components/button/ButtonGroup.vue2.js +11 -9
- package/dist/es/components/date-picker/DatePanel.vue.js +71 -62
- package/dist/es/components/date-picker/DatePanel.vue2.js +50 -40
- package/dist/es/components/date-picker/DatePicker.vue2.js +1 -1
- package/dist/es/components/dropdown/Dropdown.vue2.js +11 -4
- package/dist/es/components/dropdown/DropdownButton.vue.js +8 -7
- package/dist/es/components/dropdown/DropdownButton.vue2.js +19 -17
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +18 -17
- package/dist/es/components/form/form-item-label.vue.js +25 -22
- package/dist/es/components/form/form-item-label.vue2.js +1 -1
- package/dist/es/components/form-checkbox/icon-check.js +12 -43
- package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
- package/dist/es/components/form-input/InputSearch.js +1 -1
- package/dist/es/components/form-input-number/InputNumber.js +4 -4
- package/dist/es/components/form-input-tag/InputTag.js +168 -147
- package/dist/es/components/form-input-tag/utils.js +21 -19
- package/dist/es/components/form-textarea/Textarea.vue2.js +1 -1
- package/dist/es/components/link/Link.vue2.js +1 -1
- package/dist/es/components/menu/MenuSubMenu.js +50 -36
- package/dist/es/components/menu/sub-menu-pop.vue2.js +30 -30
- package/dist/es/components/pagination/Pagination.js +73 -70
- package/dist/es/components/popconfirm/src/popup.vue.js +1 -1
- package/dist/es/components/progress/Progress.vue2.js +1 -1
- package/dist/es/components/steps/Step.vue2.js +51 -47
- package/dist/es/components/steps/Steps.vue2.js +22 -19
- package/dist/es/components/table/Table.js +1 -1
- package/dist/es/components/table/table-th.js +2 -2
- package/dist/es/components/tabs/TabPane.vue.js +11 -9
- package/dist/es/components/tabs/TabPane.vue2.js +28 -24
- package/dist/es/components/tabs/tabs-button.js +2 -2
- package/dist/es/components/tabs/tabs-nav.js +21 -19
- package/dist/es/components/tabs/tabs-tab.vue.js +10 -8
- package/dist/es/components/tag/Tag.vue.js +20 -20
- package/dist/es/components/tag/Tag.vue2.js +35 -28
- package/dist/es/components/time-picker/TimePanel.vue.js +30 -29
- package/dist/es/components/time-picker/TimePicker.vue2.js +1 -1
- package/dist/es/components/time-picker/TimeRangePanel.js +26 -23
- package/dist/es/components/trend-chart/components/TrendChart.js +208 -142
- package/dist/es/components/trend-chart/components/trend-chart-curve.js +124 -59
- package/dist/es/components/trend-chart/components/trend-chart-labels.js +43 -41
- package/dist/es/components/trend-chart/helpers/getPadding.js +3 -3
- package/dist/es/components/trend-chart/props.js +101 -33
- package/dist/es/components/trend-chart/themes.js +15 -15
- package/dist/es/components/watermark/controller.js +40 -40
- package/dist/es/icons/default/calendar.js +15 -0
- package/dist/es/icons/default/clock-circle.js +15 -0
- package/dist/es/icons/default/double-left.js +15 -0
- package/dist/es/icons/default/double-right.js +15 -0
- package/dist/es/icons/default/down.js +16 -0
- package/dist/es/icons/default/eye-invisible.js +20 -0
- package/dist/es/icons/default/eye.js +18 -0
- package/dist/es/icons/default/left.js +15 -0
- package/dist/es/icons/default/minus.js +16 -0
- package/dist/es/icons/default/plus.js +16 -0
- package/dist/es/icons/default/question-circle.js +18 -0
- package/dist/es/icons/default/right.js +15 -0
- package/dist/es/icons/default/search.js +16 -0
- package/dist/es/icons/default/up.js +16 -0
- package/dist/es/icons/icon.js +26 -25
- package/dist/es/icons/public/boxicons/basic.js +1893 -0
- package/dist/es/icons/public/boxicons/brands.js +304 -0
- package/dist/es/icons/public/boxicons/filled.js +1893 -0
- package/dist/es/icons/public/boxicons/index.js +24 -0
- package/dist/es/icons/public/boxicons/names.js +4082 -0
- package/dist/es/icons/registry.js +15 -15
- package/dist/es/locale/en-US.js +2 -1
- package/dist/es/locale/zh-CN.js +2 -1
- package/dist/es/style.css +1 -1
- package/dist/icons/default/calendar.d.ts +93 -0
- package/dist/icons/default/clock-circle.d.ts +93 -0
- package/dist/icons/{_self/down.d.ts → default/double-left.d.ts} +6 -0
- package/dist/icons/{_self/eye-invisible.d.ts → default/double-right.d.ts} +6 -0
- package/dist/icons/default/down.d.ts +93 -0
- package/dist/icons/default/eye-invisible.d.ts +93 -0
- package/dist/icons/default/eye.d.ts +93 -0
- package/dist/icons/{_self/eye.d.ts → default/left.d.ts} +7 -0
- package/dist/icons/default/minus.d.ts +93 -0
- package/dist/icons/{_self → default}/plus.d.ts +7 -0
- package/dist/icons/default/question-circle.d.ts +93 -0
- package/dist/icons/{_self/minus.d.ts → default/right.d.ts} +7 -0
- package/dist/icons/{_self → default}/search.d.ts +7 -0
- package/dist/icons/{_self → default}/up.d.ts +7 -0
- package/dist/icons/public/boxicons/basic.cjs +1 -0
- package/dist/icons/public/boxicons/basic.d.ts +2 -0
- package/dist/icons/public/boxicons/brands.cjs +1 -0
- package/dist/icons/public/boxicons/brands.d.ts +2 -0
- package/dist/icons/public/boxicons/filled.cjs +1 -0
- package/dist/icons/public/boxicons/filled.d.ts +2 -0
- package/dist/icons/public/boxicons/index.cjs +1 -0
- package/dist/icons/public/boxicons/index.d.ts +10 -0
- package/dist/icons/public/boxicons/names.d.ts +10 -0
- package/dist/icons/registry.d.ts +5 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +2 -0
- package/dist/style/alert.css +1 -1
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/dialog.css +1 -1
- package/dist/style/drawer.css +1 -1
- package/dist/style/dropdown.css +1 -1
- package/dist/style/form-input-number.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-select.css +1 -1
- package/dist/style/form-textarea.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/link.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/message-box.css +1 -1
- package/dist/style/network.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/popconfirm.css +1 -1
- package/dist/style/popover.css +1 -1
- package/dist/style/popup.css +1 -1
- package/dist/style/progress.css +1 -1
- package/dist/style/rate.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/tabs.css +1 -1
- package/dist/style/tag.css +1 -1
- package/dist/style/time-picker.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +31 -4
- package/dist/es/icons/_self/down.js +0 -16
- package/dist/es/icons/_self/eye-invisible.js +0 -13
- package/dist/es/icons/_self/eye.js +0 -13
- package/dist/es/icons/_self/minus.js +0 -13
- package/dist/es/icons/_self/plus.js +0 -12
- package/dist/es/icons/_self/question-message.js +0 -12
- package/dist/es/icons/_self/search.js +0 -13
- package/dist/es/icons/_self/up.js +0 -16
- package/dist/es/icons/_ui/calendar.js +0 -13
- package/dist/es/icons/_ui/time.js +0 -12
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, createVNode as s, mergeProps as y, toRefs as x, computed as a, provide as C, toRef as b } from "vue";
|
|
2
2
|
import g from "./sub-menu-inline.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
3
|
+
import I from "./sub-menu-pop.vue.js";
|
|
4
|
+
import v from "./hooks/use-menu.js";
|
|
5
|
+
import k from "./hooks/use-level.js";
|
|
6
|
+
import K from "../../icons/_self/menu/down.js";
|
|
7
|
+
import _ from "../../icons/_self/dropdown/more.js";
|
|
8
|
+
import D from "./hooks/use-menu-context.js";
|
|
9
|
+
import P from "./hooks/use-menu-data-collector.js";
|
|
10
|
+
import { DataCollectorInjectionKey as w } from "./context.js";
|
|
11
|
+
const R = {
|
|
11
12
|
/**
|
|
12
13
|
* @zh 子菜单的标题
|
|
13
14
|
* @en The title of the submenu
|
|
@@ -51,9 +52,9 @@ const w = {
|
|
|
51
52
|
_internalSkipCollect: {
|
|
52
53
|
type: Boolean
|
|
53
54
|
}
|
|
54
|
-
},
|
|
55
|
+
}, q = /* @__PURE__ */ h({
|
|
55
56
|
name: "SubMenu",
|
|
56
|
-
props:
|
|
57
|
+
props: R,
|
|
57
58
|
slots: Object,
|
|
58
59
|
/**
|
|
59
60
|
* @zh 菜单的图标
|
|
@@ -81,47 +82,60 @@ const w = {
|
|
|
81
82
|
}) {
|
|
82
83
|
const {
|
|
83
84
|
key: n
|
|
84
|
-
} =
|
|
85
|
+
} = v(), {
|
|
85
86
|
level: d
|
|
86
|
-
} =
|
|
87
|
+
} = k(), {
|
|
87
88
|
popup: o
|
|
88
|
-
} =
|
|
89
|
+
} = x(e), t = D(), i = a(() => {
|
|
89
90
|
const {
|
|
90
|
-
mode:
|
|
91
|
-
collapsed:
|
|
91
|
+
mode: p,
|
|
92
|
+
collapsed: c,
|
|
92
93
|
inTrigger: m
|
|
93
94
|
} = t;
|
|
94
|
-
return !!(typeof o.value == "function" ? o.value(d.value) : o.value) ||
|
|
95
|
+
return !!(typeof o.value == "function" ? o.value(d.value) : o.value) || c || m || p !== "vertical";
|
|
95
96
|
}), {
|
|
96
97
|
subMenuKeys: l,
|
|
97
98
|
menuItemKeys: f
|
|
98
99
|
} = e._internalSkipCollect ? {
|
|
99
100
|
subMenuKeys: a(() => []),
|
|
100
101
|
menuItemKeys: a(() => [])
|
|
101
|
-
} :
|
|
102
|
+
} : P({
|
|
102
103
|
key: n.value,
|
|
103
104
|
type: "subMenu"
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
});
|
|
106
|
+
e._internalSkipCollect && C(w, {
|
|
107
|
+
collectSubMenu: () => {
|
|
108
|
+
},
|
|
109
|
+
removeSubMenu: () => {
|
|
110
|
+
},
|
|
111
|
+
collectMenuItem: () => {
|
|
112
|
+
},
|
|
113
|
+
removeMenuItem: () => {
|
|
114
|
+
},
|
|
115
|
+
reportMenuData: () => {
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const M = a(() => {
|
|
119
|
+
const p = t.selectedKeys || [], c = (m) => {
|
|
120
|
+
for (let r = 0; r < p.length; r++) {
|
|
121
|
+
const S = p[r];
|
|
108
122
|
if (m.includes(S))
|
|
109
123
|
return !0;
|
|
110
124
|
}
|
|
111
125
|
return !1;
|
|
112
126
|
};
|
|
113
|
-
return
|
|
127
|
+
return c(l.value) || c(f.value);
|
|
114
128
|
});
|
|
115
129
|
return {
|
|
116
130
|
subMenuKeys: l,
|
|
117
131
|
menuItemKeys: f,
|
|
118
|
-
isChildrenSelected:
|
|
132
|
+
isChildrenSelected: M,
|
|
119
133
|
props: e,
|
|
120
134
|
attrs: u,
|
|
121
135
|
computedKey: n,
|
|
122
|
-
computedPopup:
|
|
123
|
-
expandIconDown:
|
|
124
|
-
expandIconRight:
|
|
136
|
+
computedPopup: i,
|
|
137
|
+
expandIconDown: b(t, "expandIconDown"),
|
|
138
|
+
expandIconRight: b(t, "expandIconRight")
|
|
125
139
|
};
|
|
126
140
|
},
|
|
127
141
|
render() {
|
|
@@ -132,30 +146,30 @@ const w = {
|
|
|
132
146
|
computedPopup: d,
|
|
133
147
|
expandIconDown: o,
|
|
134
148
|
expandIconRight: t,
|
|
135
|
-
isChildrenSelected:
|
|
149
|
+
isChildrenSelected: i
|
|
136
150
|
} = this, l = {
|
|
137
151
|
...this.$slots,
|
|
138
|
-
"expand-icon-down": this.$slots["expand-icon-down"] || o || (() => [
|
|
139
|
-
"expand-icon-right": this.$slots["expand-icon-right"] || t || (() => [
|
|
152
|
+
"expand-icon-down": this.$slots["expand-icon-down"] || o || (() => [s(K, null, null)]),
|
|
153
|
+
"expand-icon-right": this.$slots["expand-icon-right"] || t || (() => [s(_, null, null)])
|
|
140
154
|
};
|
|
141
|
-
return d ?
|
|
155
|
+
return d ? s(I, y({
|
|
142
156
|
key: n,
|
|
143
157
|
title: e.title,
|
|
144
158
|
selectable: e.selectable,
|
|
145
159
|
disabled: e.disabled,
|
|
146
|
-
isChildrenSelected:
|
|
160
|
+
isChildrenSelected: i,
|
|
147
161
|
popupMaxHeight: e.popupMaxHeight,
|
|
148
162
|
_internalSkipCollect: e._internalSkipCollect
|
|
149
|
-
}, u), l) :
|
|
163
|
+
}, u), l) : s(g, y({
|
|
150
164
|
key: n,
|
|
151
165
|
title: e.title,
|
|
152
166
|
disabled: e.disabled,
|
|
153
|
-
isChildrenSelected:
|
|
167
|
+
isChildrenSelected: i,
|
|
154
168
|
_internalSkipCollect: e._internalSkipCollect
|
|
155
169
|
}, u), l);
|
|
156
170
|
}
|
|
157
171
|
});
|
|
158
172
|
export {
|
|
159
|
-
|
|
160
|
-
|
|
173
|
+
q as default,
|
|
174
|
+
R as menuSubMenuProps
|
|
161
175
|
};
|
|
@@ -2,10 +2,10 @@ import { defineComponent as S, toRefs as B, computed as o, ref as P } from "vue"
|
|
|
2
2
|
import { Trigger as $ } from "../trigger/index.js";
|
|
3
3
|
import H from "./base-menu.vue.js";
|
|
4
4
|
import N from "./hooks/use-menu.js";
|
|
5
|
-
import
|
|
6
|
-
import { omit as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import _ from "./hooks/use-level.js";
|
|
6
|
+
import { omit as I } from "../../_utils/omit.js";
|
|
7
|
+
import K from "./indent.vue.js";
|
|
8
|
+
import V from "./hooks/use-menu-context.js";
|
|
9
9
|
import R from "../../_container/render-function.js";
|
|
10
10
|
import { isNumber as T } from "../../_utils/is.js";
|
|
11
11
|
import { getClassNameMixin as w } from "../../_utils/config.js";
|
|
@@ -14,7 +14,7 @@ const Q = S({
|
|
|
14
14
|
components: {
|
|
15
15
|
Menu: H,
|
|
16
16
|
Trigger: $,
|
|
17
|
-
MenuIndent:
|
|
17
|
+
MenuIndent: K,
|
|
18
18
|
RenderFunction: R
|
|
19
19
|
},
|
|
20
20
|
inheritAttrs: !1,
|
|
@@ -39,57 +39,57 @@ const Q = S({
|
|
|
39
39
|
type: Boolean
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
setup(
|
|
43
|
-
const { key: l } = N(), { level:
|
|
44
|
-
() =>
|
|
42
|
+
setup(s) {
|
|
43
|
+
const { key: l } = N(), { level: a } = _(), { selectable: u, disabled: p, isChildrenSelected: C, popupMaxHeight: x } = B(s), t = V(), { onSubMenuClick: r, onMenuItemClick: n } = t, m = o(() => t.prefixCls), c = o(() => t.mode), f = o(() => t.selectedKeys || []), i = o(() => `${m.value}-pop`), v = o(
|
|
44
|
+
() => u.value && f.value.includes(l.value) || C.value
|
|
45
45
|
), M = o(() => [
|
|
46
|
-
`${
|
|
47
|
-
`${
|
|
46
|
+
`${i.value}`,
|
|
47
|
+
`${i.value}-header`,
|
|
48
48
|
{
|
|
49
|
-
[`${
|
|
49
|
+
[`${m.value}-selected`]: v.value
|
|
50
50
|
}
|
|
51
|
-
]), h = o(() =>
|
|
52
|
-
|
|
53
|
-
}, y = w("trigger"),
|
|
51
|
+
]), h = o(() => c.value === "horizontal" && !t.inTrigger), d = P(!1), g = (e) => {
|
|
52
|
+
d.value = e;
|
|
53
|
+
}, y = w("trigger"), k = o(() => {
|
|
54
54
|
var e;
|
|
55
55
|
return [
|
|
56
|
-
`${
|
|
56
|
+
`${i.value}-trigger`,
|
|
57
57
|
{
|
|
58
|
-
[`${
|
|
58
|
+
[`${i.value}-trigger-dark`]: t.theme === "dark"
|
|
59
59
|
},
|
|
60
60
|
// @ts-ignore
|
|
61
61
|
(e = t.triggerProps) == null ? void 0 : e.class
|
|
62
62
|
];
|
|
63
|
-
}),
|
|
63
|
+
}), b = o(() => I(t.triggerProps || {}, ["class"]));
|
|
64
64
|
return {
|
|
65
|
-
menuPrefixCls:
|
|
66
|
-
mode:
|
|
67
|
-
level:
|
|
65
|
+
menuPrefixCls: m,
|
|
66
|
+
mode: c,
|
|
67
|
+
level: a,
|
|
68
68
|
classNames: M,
|
|
69
|
-
isSelected:
|
|
70
|
-
disabled:
|
|
71
|
-
selectedKeys:
|
|
69
|
+
isSelected: v,
|
|
70
|
+
disabled: p,
|
|
71
|
+
selectedKeys: f,
|
|
72
72
|
needPopOnBottom: h,
|
|
73
|
-
popVisible:
|
|
73
|
+
popVisible: d,
|
|
74
74
|
className: y,
|
|
75
|
-
triggerClassNames:
|
|
76
|
-
triggerProps:
|
|
75
|
+
triggerClassNames: k,
|
|
76
|
+
triggerProps: b,
|
|
77
77
|
menuContext: t,
|
|
78
78
|
popupMenuStyles: o(() => {
|
|
79
79
|
const e = x.value ?? t.popupMaxHeight;
|
|
80
80
|
return T(e) ? { maxHeight: `${e}px` } : e ? {} : { maxHeight: "unset" };
|
|
81
81
|
}),
|
|
82
82
|
onClick: () => {
|
|
83
|
-
|
|
83
|
+
p.value || s._internalSkipCollect || (r && r(l.value, a.value), u.value && n && n(l.value));
|
|
84
84
|
},
|
|
85
85
|
onKeydown: (e) => {
|
|
86
|
-
|
|
86
|
+
p.value || s._internalSkipCollect || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r && r(l.value, a.value), u.value && n && n(l.value));
|
|
87
87
|
},
|
|
88
88
|
onMenuItemClick: (e) => {
|
|
89
|
-
n && n(e),
|
|
89
|
+
n && n(e), g(!1);
|
|
90
90
|
},
|
|
91
91
|
onVisibleChange: (e) => {
|
|
92
|
-
|
|
92
|
+
g(e);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as F, toRefs as $, ref as
|
|
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
2
|
import G from "./page-item.vue.js";
|
|
3
3
|
import O from "./page-item-step.vue.js";
|
|
4
4
|
import H from "./page-item-ellipsis.vue.js";
|
|
5
5
|
import B from "./page-jumper.vue.js";
|
|
6
6
|
import K from "./page-options.vue.js";
|
|
7
|
-
import { isNumber as
|
|
7
|
+
import { isNumber as h } from "../../_utils/is.js";
|
|
8
8
|
import { useSize as Q } from "../../_hooks/use-size.js";
|
|
9
9
|
import { getClassNameMixin as U } from "../../_utils/config.js";
|
|
10
10
|
import { useLocale as W } from "../../locale/index.js";
|
|
@@ -211,88 +211,88 @@ const ne = /* @__PURE__ */ F({
|
|
|
211
211
|
* @binding {number} total
|
|
212
212
|
*/
|
|
213
213
|
setup(e, {
|
|
214
|
-
emit:
|
|
215
|
-
slots:
|
|
214
|
+
emit: o,
|
|
215
|
+
slots: f
|
|
216
216
|
}) {
|
|
217
|
-
const
|
|
217
|
+
const g = U("pagination"), {
|
|
218
218
|
t: I
|
|
219
219
|
} = W(), {
|
|
220
|
-
disabled:
|
|
220
|
+
disabled: P,
|
|
221
221
|
pageItemStyle: A,
|
|
222
222
|
activePageItemStyle: E,
|
|
223
223
|
size: L
|
|
224
224
|
} = $(e), {
|
|
225
|
-
mergedSize:
|
|
226
|
-
} = Q(L), p =
|
|
227
|
-
if (t !== l.value &&
|
|
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
228
|
const a = Math.min(Math.max(t, 1), u.value);
|
|
229
|
-
a !== l.value && (p.value = a,
|
|
229
|
+
a !== l.value && (p.value = a, o("update:current", a), o("change", a));
|
|
230
230
|
}
|
|
231
231
|
}, J = (t) => {
|
|
232
|
-
|
|
233
|
-
},
|
|
232
|
+
k(t) && (C.value = t, o("update:pageSize", t), o("pageSizeChange", t));
|
|
233
|
+
}, s = D({
|
|
234
234
|
current: l,
|
|
235
235
|
style: A,
|
|
236
236
|
activeStyle: E,
|
|
237
|
-
onClick:
|
|
237
|
+
onClick: z
|
|
238
238
|
}), V = {
|
|
239
239
|
get current() {
|
|
240
|
-
return
|
|
240
|
+
return s.current;
|
|
241
241
|
},
|
|
242
242
|
get disabled() {
|
|
243
|
-
return
|
|
243
|
+
return P.value;
|
|
244
244
|
},
|
|
245
245
|
get style() {
|
|
246
|
-
return
|
|
246
|
+
return s.style;
|
|
247
247
|
},
|
|
248
248
|
get activeStyle() {
|
|
249
|
-
return
|
|
249
|
+
return s.activeStyle;
|
|
250
250
|
},
|
|
251
251
|
get onClick() {
|
|
252
|
-
return
|
|
252
|
+
return s.onClick;
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, w = {
|
|
255
255
|
get current() {
|
|
256
|
-
return
|
|
256
|
+
return s.current;
|
|
257
257
|
},
|
|
258
258
|
get disabled() {
|
|
259
|
-
return
|
|
259
|
+
return P.value;
|
|
260
260
|
},
|
|
261
261
|
get style() {
|
|
262
|
-
return
|
|
262
|
+
return s.style;
|
|
263
263
|
},
|
|
264
264
|
get onClick() {
|
|
265
|
-
return
|
|
265
|
+
return s.onClick;
|
|
266
266
|
},
|
|
267
267
|
get pages() {
|
|
268
268
|
return u.value;
|
|
269
269
|
}
|
|
270
270
|
}, _ = {
|
|
271
271
|
get current() {
|
|
272
|
-
return
|
|
272
|
+
return s.current;
|
|
273
273
|
},
|
|
274
274
|
get style() {
|
|
275
|
-
return
|
|
275
|
+
return s.style;
|
|
276
276
|
},
|
|
277
277
|
get onClick() {
|
|
278
|
-
return
|
|
278
|
+
return s.onClick;
|
|
279
279
|
},
|
|
280
280
|
get pages() {
|
|
281
281
|
return u.value;
|
|
282
282
|
}
|
|
283
|
-
}, r = (t, a = {}) => t === "more" ?
|
|
284
|
-
default:
|
|
285
|
-
}) : t === "previous" ?
|
|
283
|
+
}, r = (t, a = {}) => t === "more" ? n(H, b(a, _), {
|
|
284
|
+
default: f["page-item-ellipsis"]
|
|
285
|
+
}) : t === "previous" ? n(O, b({
|
|
286
286
|
type: "previous"
|
|
287
|
-
}, a,
|
|
288
|
-
default:
|
|
289
|
-
}) : t === "next" ?
|
|
287
|
+
}, a, w), {
|
|
288
|
+
default: f["page-item-step"]
|
|
289
|
+
}) : t === "next" ? n(O, b({
|
|
290
290
|
type: "next"
|
|
291
|
-
}, a,
|
|
292
|
-
default:
|
|
293
|
-
}) :
|
|
294
|
-
default:
|
|
295
|
-
}), R =
|
|
291
|
+
}, a, w), {
|
|
292
|
+
default: f["page-item-step"]
|
|
293
|
+
}) : n(G, b(a, V), {
|
|
294
|
+
default: f["page-item"]
|
|
295
|
+
}), R = d(() => {
|
|
296
296
|
const t = [];
|
|
297
297
|
if (u.value < e.baseSize + e.bufferSize * 2)
|
|
298
298
|
for (let a = 1; a <= u.value; a++)
|
|
@@ -301,20 +301,20 @@ const ne = /* @__PURE__ */ F({
|
|
|
301
301
|
pageNumber: a
|
|
302
302
|
}));
|
|
303
303
|
else {
|
|
304
|
-
let a = 1,
|
|
305
|
-
l.value > 2 + e.bufferSize && (
|
|
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", {
|
|
306
306
|
key: 1,
|
|
307
307
|
pageNumber: 1
|
|
308
308
|
})), t.push(r("more", {
|
|
309
309
|
key: "left-ellipsis-pager",
|
|
310
310
|
step: -(e.bufferSize * 2 + 1)
|
|
311
311
|
})));
|
|
312
|
-
for (let v = a; v <=
|
|
312
|
+
for (let v = a; v <= c; v++)
|
|
313
313
|
t.push(r("page", {
|
|
314
314
|
key: v,
|
|
315
315
|
pageNumber: v
|
|
316
316
|
}));
|
|
317
|
-
|
|
317
|
+
x && (t.push(r("more", {
|
|
318
318
|
key: "right-ellipsis-pager",
|
|
319
319
|
step: e.bufferSize * 2 + 1
|
|
320
320
|
})), t.push(r("page", {
|
|
@@ -323,66 +323,69 @@ const ne = /* @__PURE__ */ F({
|
|
|
323
323
|
})));
|
|
324
324
|
}
|
|
325
325
|
return t;
|
|
326
|
-
}), T = () => e.simple ?
|
|
327
|
-
class:
|
|
326
|
+
}), T = () => e.simple ? n("span", {
|
|
327
|
+
class: g.element("simple")
|
|
328
328
|
}, [r("previous", {
|
|
329
329
|
simple: !0
|
|
330
|
-
}),
|
|
330
|
+
}), n(B, {
|
|
331
331
|
disabled: e.disabled,
|
|
332
332
|
current: l.value,
|
|
333
|
-
size:
|
|
333
|
+
size: m.value,
|
|
334
334
|
pages: u.value,
|
|
335
335
|
simple: !0,
|
|
336
|
-
onChange:
|
|
336
|
+
onChange: z
|
|
337
337
|
}, null), r("next", {
|
|
338
338
|
simple: !0
|
|
339
|
-
})]) :
|
|
340
|
-
class:
|
|
339
|
+
})]) : n("ul", {
|
|
340
|
+
class: g.element("list")
|
|
341
341
|
}, [r("previous"), R.value, e.showMore && r("more", {
|
|
342
342
|
key: "more",
|
|
343
343
|
step: e.bufferSize * 2 + 1
|
|
344
344
|
}), r("next")]);
|
|
345
|
-
j(
|
|
345
|
+
j(y, (t, a) => {
|
|
346
346
|
if (e.autoAdjust && t !== a && l.value > 1) {
|
|
347
|
-
const
|
|
348
|
-
|
|
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));
|
|
349
349
|
}
|
|
350
350
|
}), j(u, (t, a) => {
|
|
351
|
-
if (e.autoAdjust
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
351
|
+
if (!e.autoAdjust || t === a)
|
|
352
|
+
return;
|
|
353
|
+
const c = S.value;
|
|
354
|
+
if (!h(c) || c <= t)
|
|
355
|
+
return;
|
|
356
|
+
const i = Math.max(t, 1);
|
|
357
|
+
p.value = i, o("update:current", i), o("change", i);
|
|
355
358
|
});
|
|
356
|
-
const q =
|
|
357
|
-
[
|
|
358
|
-
[
|
|
359
|
+
const q = d(() => [g.block, g.modifier(`size-${m.value}`), {
|
|
360
|
+
[g.modifier("simple")]: e.simple,
|
|
361
|
+
[g.modifier("disabled")]: e.disabled
|
|
359
362
|
}]);
|
|
360
363
|
return () => {
|
|
361
364
|
var t;
|
|
362
|
-
return e.hideOnSinglePage && u.value <= 1 ? null :
|
|
365
|
+
return e.hideOnSinglePage && u.value <= 1 ? null : n("div", {
|
|
363
366
|
class: q.value
|
|
364
|
-
}, [e.showTotal &&
|
|
365
|
-
class:
|
|
366
|
-
}, [((t =
|
|
367
|
+
}, [e.showTotal && n("span", {
|
|
368
|
+
class: g.element("total")
|
|
369
|
+
}, [((t = f.total) == null ? void 0 : t.call(f, {
|
|
367
370
|
total: e.total
|
|
368
371
|
})) ?? I("pagination.total", {
|
|
369
372
|
total: e.total
|
|
370
|
-
})]), T(), e.showPageSize &&
|
|
373
|
+
})]), T(), e.showPageSize && n(K, {
|
|
371
374
|
disabled: e.disabled,
|
|
372
375
|
sizeOptions: e.pageSizeOptions,
|
|
373
|
-
pageSize:
|
|
374
|
-
size:
|
|
376
|
+
pageSize: y.value,
|
|
377
|
+
size: m.value,
|
|
375
378
|
onChange: J,
|
|
376
379
|
selectProps: e.pageSizeProps
|
|
377
|
-
}, null), !e.simple && e.showJumper &&
|
|
380
|
+
}, null), !e.simple && e.showJumper && n(B, {
|
|
378
381
|
disabled: e.disabled,
|
|
379
382
|
current: l.value,
|
|
380
383
|
pages: u.value,
|
|
381
|
-
size:
|
|
382
|
-
onChange:
|
|
384
|
+
size: m.value,
|
|
385
|
+
onChange: z
|
|
383
386
|
}, {
|
|
384
|
-
"jumper-prepend":
|
|
385
|
-
"jumper-append":
|
|
387
|
+
"jumper-prepend": f["jumper-prepend"],
|
|
388
|
+
"jumper-append": f["jumper-append"]
|
|
386
389
|
})]);
|
|
387
390
|
};
|
|
388
391
|
}
|
|
@@ -94,7 +94,7 @@ const g = (e) => Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 0, C = c({
|
|
|
94
94
|
/**
|
|
95
95
|
* @zh 进度条状态
|
|
96
96
|
* @en Progress bar status
|
|
97
|
-
* @values 'normal', 'success', 'warning', 'danger'
|
|
97
|
+
* @values 'normal', 'success', 'warning', 'strong', 'danger'
|
|
98
98
|
*/
|
|
99
99
|
status: {
|
|
100
100
|
type: String
|