evui 3.5.0-rc.1 → 3.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.
Files changed (135) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/common/utils.bignumber.js +23 -0
  3. package/dist/common/utils.debounce.js +66 -0
  4. package/dist/common/utils.js +64 -0
  5. package/dist/common/utils.throttle.js +15 -0
  6. package/dist/components/button/Button.vue.js +65 -0
  7. package/dist/components/button/index.js +7 -0
  8. package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
  9. package/dist/components/buttonGroup/index.js +7 -0
  10. package/dist/components/calendar/Calendar.vue.js +299 -0
  11. package/dist/components/calendar/index.js +7 -0
  12. package/dist/components/calendar/uses.js +579 -0
  13. package/dist/components/chart/Chart.vue.js +261 -0
  14. package/dist/components/chart/ChartToolbar.vue.js +32 -0
  15. package/dist/components/chart/chart.core.js +738 -0
  16. package/dist/components/chart/chartZoom.core.js +221 -0
  17. package/dist/components/chart/element/element.bar.js +358 -0
  18. package/dist/components/chart/element/element.bar.time.js +55 -0
  19. package/dist/components/chart/element/element.heatmap.js +403 -0
  20. package/dist/components/chart/element/element.line.js +292 -0
  21. package/dist/components/chart/element/element.pie.js +73 -0
  22. package/dist/components/chart/element/element.scatter.js +209 -0
  23. package/dist/components/chart/element/element.tip.js +312 -0
  24. package/dist/components/chart/helpers/helpers.canvas.js +141 -0
  25. package/dist/components/chart/helpers/helpers.constant.js +253 -0
  26. package/dist/components/chart/helpers/helpers.util.js +265 -0
  27. package/dist/components/chart/index.js +7 -0
  28. package/dist/components/chart/model/index.js +6 -0
  29. package/dist/components/chart/model/model.series.js +82 -0
  30. package/dist/components/chart/model/model.store.js +650 -0
  31. package/dist/components/chart/plugins/plugins.interaction.js +823 -0
  32. package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
  33. package/dist/components/chart/plugins/plugins.legend.js +665 -0
  34. package/dist/components/chart/plugins/plugins.pie.js +86 -0
  35. package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
  36. package/dist/components/chart/plugins/plugins.title.js +43 -0
  37. package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
  38. package/dist/components/chart/scale/scale.js +492 -0
  39. package/dist/components/chart/scale/scale.linear.js +248 -0
  40. package/dist/components/chart/scale/scale.logarithmic.js +82 -0
  41. package/dist/components/chart/scale/scale.step.js +227 -0
  42. package/dist/components/chart/scale/scale.time.category.js +148 -0
  43. package/dist/components/chart/scale/scale.time.js +95 -0
  44. package/dist/components/chart/uses.js +479 -0
  45. package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
  46. package/dist/components/chartBrush/chartBrush.core.js +265 -0
  47. package/dist/components/chartBrush/index.js +7 -0
  48. package/dist/components/chartBrush/uses.js +18 -0
  49. package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
  50. package/dist/components/chartGroup/index.js +7 -0
  51. package/dist/components/chartGroup/uses.js +47 -0
  52. package/dist/components/checkbox/Checkbox.vue.js +99 -0
  53. package/dist/components/checkbox/index.js +7 -0
  54. package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
  55. package/dist/components/checkboxGroup/index.js +7 -0
  56. package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
  57. package/dist/components/contextMenu/MenuList.vue.js +105 -0
  58. package/dist/components/contextMenu/index.js +7 -0
  59. package/dist/components/contextMenu/uses.js +79 -0
  60. package/dist/components/datePicker/DatePicker.vue.js +310 -0
  61. package/dist/components/datePicker/index.js +7 -0
  62. package/dist/components/datePicker/uses.js +190 -0
  63. package/dist/components/grid/Grid.vue.js +1261 -0
  64. package/dist/components/grid/GridColumnSetting.vue.js +212 -0
  65. package/dist/components/grid/GridFilterSetting.vue.js +222 -0
  66. package/dist/components/grid/GridPagination.vue.js +69 -0
  67. package/dist/components/grid/GridSummary.vue.js +186 -0
  68. package/dist/components/grid/GridToolbar.vue.js +15 -0
  69. package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
  70. package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
  71. package/dist/components/grid/index.js +7 -0
  72. package/dist/components/grid/uses.js +697 -0
  73. package/dist/components/icon/Icon.vue.js +50 -0
  74. package/dist/components/icon/index.js +8 -0
  75. package/dist/components/inputNumber/InputNumber.vue.js +112 -0
  76. package/dist/components/inputNumber/index.js +7 -0
  77. package/dist/components/inputNumber/uses.js +76 -0
  78. package/dist/components/loading/Loading.vue.js +78 -0
  79. package/dist/components/loading/index.js +7 -0
  80. package/dist/components/menu/Menu.vue.js +66 -0
  81. package/dist/components/menu/MenuItem.vue.js +125 -0
  82. package/dist/components/menu/index.js +7 -0
  83. package/dist/components/message/Message.vue.js +122 -0
  84. package/dist/components/message/index.js +16 -0
  85. package/dist/components/messageBox/MessageBox.vue.js +216 -0
  86. package/dist/components/messageBox/index.js +13 -0
  87. package/dist/components/notification/Notification.vue.js +140 -0
  88. package/dist/components/notification/index.js +23 -0
  89. package/dist/components/pagination/Pagination.vue.js +215 -0
  90. package/dist/components/pagination/index.js +7 -0
  91. package/dist/components/pagination/pageButton.vue.js +35 -0
  92. package/dist/components/progress/Progress.vue.js +88 -0
  93. package/dist/components/progress/index.js +7 -0
  94. package/dist/components/radio/Radio.vue.js +75 -0
  95. package/dist/components/radio/index.js +7 -0
  96. package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
  97. package/dist/components/radioGroup/index.js +7 -0
  98. package/dist/components/scheduler/Scheduler.vue.js +128 -0
  99. package/dist/components/scheduler/index.js +7 -0
  100. package/dist/components/scheduler/uses.js +73 -0
  101. package/dist/components/select/Select.vue.js +381 -0
  102. package/dist/components/select/index.js +7 -0
  103. package/dist/components/select/uses.js +147 -0
  104. package/dist/components/slider/Slider.vue.js +243 -0
  105. package/dist/components/slider/index.js +7 -0
  106. package/dist/components/slider/uses.js +188 -0
  107. package/dist/components/tabPanel/TabPanel.vue.js +39 -0
  108. package/dist/components/tabPanel/index.js +7 -0
  109. package/dist/components/tabs/Tabs.vue.js +220 -0
  110. package/dist/components/tabs/index.js +7 -0
  111. package/dist/components/textField/TextField.vue.js +209 -0
  112. package/dist/components/textField/index.js +7 -0
  113. package/dist/components/timePicker/TimePicker.vue.js +227 -0
  114. package/dist/components/timePicker/index.js +7 -0
  115. package/dist/components/toggle/Toggle.vue.js +66 -0
  116. package/dist/components/toggle/index.js +7 -0
  117. package/dist/components/tree/Tree.vue.js +220 -0
  118. package/dist/components/tree/TreeNode.vue.js +146 -0
  119. package/dist/components/tree/index.js +7 -0
  120. package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
  121. package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
  122. package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
  123. package/dist/components/treeGrid/index.js +7 -0
  124. package/dist/components/treeGrid/uses.js +497 -0
  125. package/dist/components/window/Window.vue.js +211 -0
  126. package/dist/components/window/index.js +7 -0
  127. package/dist/components/window/uses.js +345 -0
  128. package/dist/directives/clickoutside.js +47 -0
  129. package/dist/main.js +142 -0
  130. package/dist/package.json.js +4 -0
  131. package/dist/resolver.js +17 -0
  132. package/dist/style.css +1 -1
  133. package/package.json +56 -23
  134. package/dist/index.js +0 -21754
  135. package/dist/index.umd.cjs +0 -28
@@ -0,0 +1,216 @@
1
+ import { resolveComponent as B, openBlock as a, createBlock as d, Teleport as x, createVNode as k, Transition as b, withCtx as v, withDirectives as _, createElementVNode as c, withModifiers as C, normalizeClass as y, createElementBlock as i, createCommentVNode as u, toDisplayString as m, createTextVNode as w, vShow as M, ref as S, reactive as T, onMounted as E, watch as L, onBeforeUnmount as F, toRefs as N } from "vue";
2
+ import H from "../button/Button.vue.js";
3
+ /* empty css */
4
+ import V from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const z = {
6
+ name: "EvMessageBox",
7
+ components: {
8
+ EvButton: H
9
+ },
10
+ props: {
11
+ type: {
12
+ type: String,
13
+ default: "",
14
+ validator: (t) => ["", "info", "success", "warning", "error"].includes(t)
15
+ },
16
+ title: {
17
+ type: String,
18
+ default: ""
19
+ },
20
+ message: {
21
+ type: [String, Array],
22
+ default: ""
23
+ },
24
+ iconClass: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ onClose: {
29
+ type: Function,
30
+ default: null
31
+ },
32
+ showClose: {
33
+ type: Boolean,
34
+ default: !0
35
+ },
36
+ showConfirmBtn: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ showCancelBtn: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ confirmBtnText: {
45
+ type: String,
46
+ default: "OK"
47
+ },
48
+ cancelBtnText: {
49
+ type: String,
50
+ default: "Cancel"
51
+ },
52
+ closeOnClickModal: {
53
+ type: Boolean,
54
+ default: !0
55
+ },
56
+ useHTML: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ unmount: {
61
+ type: Function,
62
+ default: null
63
+ },
64
+ focusable: {
65
+ type: Boolean,
66
+ default: !1
67
+ }
68
+ },
69
+ setup(t) {
70
+ const n = S(null), e = T({
71
+ isShow: !0,
72
+ iconClass: ""
73
+ }), s = (o) => {
74
+ if (!t.closeOnClickModal && o === "modal")
75
+ return;
76
+ const h = o === "modal" ? "cancel" : o;
77
+ e.isShow = !1, t.onClose && t.onClose(h), t.unmount && setTimeout(t.unmount, 1e3);
78
+ }, r = (o) => {
79
+ o.keyCode === 27 && e.isShow && s();
80
+ }, g = (o) => {
81
+ switch (o) {
82
+ case "success":
83
+ return "ev-icon-arrow-check";
84
+ case "warning":
85
+ return "ev-icon-warning2";
86
+ case "error":
87
+ return "ev-icon-warning3";
88
+ case "info":
89
+ default:
90
+ return "ev-icon-info2";
91
+ }
92
+ }, f = () => {
93
+ t.iconClass ? e.iconClass = t.iconClass : t.type && (e.iconClass = g(t.type));
94
+ }, l = (o) => {
95
+ if (!t.focusable) return !1;
96
+ switch (o) {
97
+ case "confirmBtn":
98
+ return t.showConfirmBtn;
99
+ case "cancelBtn":
100
+ return !t.showConfirmBtn && t.showCancelBtn;
101
+ case "messagebox":
102
+ return !t.showConfirmBtn && !t.showCancelBtn;
103
+ default:
104
+ return !1;
105
+ }
106
+ };
107
+ return E(() => {
108
+ f(), document.addEventListener("keydown", r), l("messagebox") && n.value.focus();
109
+ }), L(
110
+ () => e.isShow,
111
+ (o) => {
112
+ o || document.removeEventListener("keydown", r);
113
+ }
114
+ ), F(() => {
115
+ document.removeEventListener("keydown", r);
116
+ }), {
117
+ closeMsg: s,
118
+ ...N(e),
119
+ msgRef: n,
120
+ hasFocus: l
121
+ };
122
+ }
123
+ }, O = {
124
+ key: 0,
125
+ class: "ev-message-box-icon"
126
+ }, R = { class: "ev-message-box-content" }, D = {
127
+ key: 0,
128
+ class: "ev-message-box-title"
129
+ }, A = ["innerHTML"], I = {
130
+ key: 2,
131
+ class: "ev-message-box-message"
132
+ }, K = { class: "ev-message-box-btn" };
133
+ function U(t, n, e, s, r, g) {
134
+ const f = B("ev-button");
135
+ return a(), d(x, { to: "body" }, [
136
+ k(b, {
137
+ name: "ev-message-box-fade",
138
+ appear: ""
139
+ }, {
140
+ default: v(() => [
141
+ _(c("div", {
142
+ id: "ev-message-box-modal",
143
+ onClick: n[3] || (n[3] = C((l) => s.closeMsg("modal"), ["self"])),
144
+ onWheel: C(() => {
145
+ }, ["stop", "prevent"])
146
+ }, [
147
+ c("div", {
148
+ ref: "msgRef",
149
+ class: y(["ev-message-box", {
150
+ [`type-${e.type}`]: !!e.type,
151
+ "show-close": e.showClose,
152
+ "has-icon": !!e.iconClass,
153
+ "has-title": !!e.title
154
+ }]),
155
+ tabindex: "-1"
156
+ }, [
157
+ e.iconClass ? (a(), i("span", O, [
158
+ c("i", {
159
+ class: y(e.iconClass)
160
+ }, null, 2)
161
+ ])) : u("", !0),
162
+ c("div", R, [
163
+ e.title ? (a(), i("p", D, m(e.title), 1)) : u("", !0),
164
+ e.useHTML ? (a(), i("p", {
165
+ key: 1,
166
+ class: "ev-message-box-message",
167
+ innerHTML: e.message
168
+ }, null, 8, A)) : (a(), i("p", I, m(e.message), 1))
169
+ ]),
170
+ c("div", K, [
171
+ e.showCancelBtn ? (a(), d(f, {
172
+ key: 0,
173
+ size: "small",
174
+ class: "ev-message-box-cancel",
175
+ "auto-focus": s.hasFocus("cancelBtn"),
176
+ onClick: n[0] || (n[0] = (l) => s.closeMsg("cancel"))
177
+ }, {
178
+ default: v(() => [
179
+ w(m(e.cancelBtnText), 1)
180
+ ]),
181
+ _: 1
182
+ }, 8, ["auto-focus"])) : u("", !0),
183
+ e.showConfirmBtn ? (a(), d(f, {
184
+ key: 1,
185
+ type: "primary",
186
+ size: "small",
187
+ class: "ev-message-box-confirm",
188
+ "auto-focus": s.hasFocus("confirmBtn"),
189
+ onClick: n[1] || (n[1] = (l) => s.closeMsg("ok"))
190
+ }, {
191
+ default: v(() => [
192
+ w(m(e.confirmBtnText), 1)
193
+ ]),
194
+ _: 1
195
+ }, 8, ["auto-focus"])) : u("", !0)
196
+ ]),
197
+ e.showClose ? (a(), i("span", {
198
+ key: 1,
199
+ class: "ev-message-box-close",
200
+ onClick: n[2] || (n[2] = (l) => s.closeMsg("cancel"))
201
+ }, [...n[4] || (n[4] = [
202
+ c("i", { class: "ev-icon-close" }, null, -1)
203
+ ])])) : u("", !0)
204
+ ], 2)
205
+ ], 544), [
206
+ [M, t.isShow]
207
+ ])
208
+ ]),
209
+ _: 1
210
+ })
211
+ ]);
212
+ }
213
+ const J = /* @__PURE__ */ V(z, [["render", U]]);
214
+ export {
215
+ J as default
216
+ };
@@ -0,0 +1,13 @@
1
+ import { defineComponent as r, h as a, render as t } from "vue";
2
+ import l from "./MessageBox.vue.js";
3
+ const i = r(l), s = (n = {}) => {
4
+ const e = document.createElement("div"), o = () => t(null, e), m = typeof n == "string" ? { message: n, unmount: o } : { ...n, unmount: o }, c = a(i, m);
5
+ t(c, e);
6
+ };
7
+ s.install = (n) => {
8
+ const e = n.config.globalProperties;
9
+ e.$messagebox = s;
10
+ };
11
+ export {
12
+ s as default
13
+ };
@@ -0,0 +1,140 @@
1
+ import { openBlock as s, createBlock as y, Transition as g, withCtx as k, withDirectives as C, createElementVNode as c, normalizeClass as d, createElementBlock as l, createCommentVNode as m, toDisplayString as f, vShow as v, reactive as w, onMounted as T, onBeforeUnmount as h, toRefs as M } from "vue";
2
+ /* empty css */
3
+ import S from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const _ = {
5
+ name: "EvNotification",
6
+ props: {
7
+ type: {
8
+ type: String,
9
+ default: "info",
10
+ validator: (n) => ["info", "success", "warning", "error"].includes(n)
11
+ },
12
+ title: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ message: {
17
+ type: String,
18
+ default: ""
19
+ },
20
+ position: {
21
+ type: String,
22
+ default: "top-right",
23
+ validator: (n) => ["top-left", "top-right", "bottom-left", "bottom-right"].includes(n)
24
+ },
25
+ duration: {
26
+ type: Number,
27
+ default: 3e3
28
+ },
29
+ showClose: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ iconClass: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ onClose: {
38
+ type: Function,
39
+ default: null
40
+ },
41
+ onClick: {
42
+ type: Function,
43
+ default: null
44
+ },
45
+ useHTML: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ unmount: {
50
+ type: Function,
51
+ default: null
52
+ }
53
+ },
54
+ setup(n) {
55
+ const e = w({
56
+ timer: null,
57
+ isShow: !0
58
+ }), t = () => {
59
+ clearTimeout(e.timer), e.timer = null;
60
+ }, o = (u) => {
61
+ u.target.className !== "ev-notification-close" && n.onClick && n.onClick();
62
+ }, a = () => {
63
+ e.isShow = !1, n.onClose && n.onClose(), t(), n.unmount && setTimeout(n.unmount, 1e3);
64
+ }, r = () => {
65
+ n.duration > 0 && (e.timer = setTimeout(() => {
66
+ e.isShow && a();
67
+ }, n.duration));
68
+ }, i = (u) => {
69
+ u.keyCode === 27 && e.isShow && a();
70
+ };
71
+ return T(() => {
72
+ r(), document.addEventListener("keydown", i);
73
+ }), h(() => {
74
+ document.removeEventListener("keydown", i), t();
75
+ }), {
76
+ startTimer: r,
77
+ clearTimer: t,
78
+ clickMsg: o,
79
+ closeMsg: a,
80
+ ...M(e)
81
+ };
82
+ }
83
+ }, B = {
84
+ key: 0,
85
+ class: "ev-notification-icon"
86
+ }, L = { class: "ev-notification-content" }, E = {
87
+ key: 0,
88
+ class: "title"
89
+ }, N = ["innerHTML"], H = {
90
+ key: 2,
91
+ class: "message"
92
+ };
93
+ function b(n, e, t, o, a, r) {
94
+ return s(), y(g, {
95
+ name: "ev-notification-fade",
96
+ appear: ""
97
+ }, {
98
+ default: k(() => [
99
+ C(c("div", {
100
+ class: d(["ev-notification", {
101
+ [`type-${t.type}`]: !!t.type,
102
+ "show-close": t.showClose,
103
+ "has-icon": !!t.iconClass,
104
+ "has-click": !!t.onClick
105
+ }]),
106
+ onMouseenter: e[1] || (e[1] = (...i) => o.clearTimer && o.clearTimer(...i)),
107
+ onMouseleave: e[2] || (e[2] = (...i) => o.startTimer && o.startTimer(...i)),
108
+ onClick: e[3] || (e[3] = (...i) => o.clickMsg && o.clickMsg(...i))
109
+ }, [
110
+ t.iconClass ? (s(), l("span", B, [
111
+ c("i", {
112
+ class: d(t.iconClass)
113
+ }, null, 2)
114
+ ])) : m("", !0),
115
+ c("div", L, [
116
+ t.title ? (s(), l("p", E, f(t.title), 1)) : m("", !0),
117
+ t.useHTML ? (s(), l("p", {
118
+ key: 1,
119
+ class: "message",
120
+ innerHTML: t.message
121
+ }, null, 8, N)) : (s(), l("p", H, f(t.message), 1))
122
+ ]),
123
+ t.showClose ? (s(), l("span", {
124
+ key: 1,
125
+ class: "ev-notification-close",
126
+ onClick: e[0] || (e[0] = (...i) => o.closeMsg && o.closeMsg(...i))
127
+ }, [...e[4] || (e[4] = [
128
+ c("i", { class: "ev-icon-close" }, null, -1)
129
+ ])])) : m("", !0)
130
+ ], 34), [
131
+ [v, n.isShow]
132
+ ])
133
+ ]),
134
+ _: 1
135
+ });
136
+ }
137
+ const V = /* @__PURE__ */ S(_, [["render", b]]);
138
+ export {
139
+ V as default
140
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as r, h as p, render as c } from "vue";
2
+ import f from "./Notification.vue.js";
3
+ const h = r(f), d = "ev-notification-modal", n = document.createElement("div");
4
+ n.id = d;
5
+ const g = ["top-left", "top-right", "bottom-left", "bottom-right"], a = (o = {}) => {
6
+ const e = o.position || "top-right";
7
+ if (!g.includes(e)) {
8
+ console.warn("[EVUI][Notification] The position value is incorrectly entered.");
9
+ return;
10
+ }
11
+ document.getElementById(d) || document.body.appendChild(n);
12
+ let t = n.getElementsByClassName(`modal-${e}`);
13
+ t.length ? t = t[0] : (t = document.createElement("div"), t.classList.add(`modal-${e}`), n.appendChild(t));
14
+ const i = document.createElement("div"), s = () => c(null, i), m = typeof o == "string" ? { message: o, unmount: s } : { ...o, unmount: s }, l = p(h, m);
15
+ c(l, i), t.appendChild(l.el);
16
+ };
17
+ a.install = (o) => {
18
+ const e = o.config.globalProperties;
19
+ e.$notify = a;
20
+ };
21
+ export {
22
+ a as default
23
+ };
@@ -0,0 +1,215 @@
1
+ import { resolveComponent as w, openBlock as r, createElementBlock as c, Fragment as k, createTextVNode as E, toDisplayString as _, createCommentVNode as V, createElementVNode as C, normalizeStyle as j, normalizeClass as y, createVNode as g, withCtx as N, renderList as F, computed as u, watch as B, nextTick as q } from "vue";
2
+ import A from "../icon/Icon.vue.js";
3
+ import G from "./pageButton.vue.js";
4
+ /* empty css */
5
+ import H from "../../_virtual/_plugin-vue_export-helper.js";
6
+ const K = {
7
+ name: "EvPagination",
8
+ components: {
9
+ EvIcon: A,
10
+ pageButton: G
11
+ },
12
+ props: {
13
+ total: {
14
+ type: [Number, String],
15
+ default: 0
16
+ },
17
+ visiblePage: {
18
+ type: [Number, String],
19
+ default: 8
20
+ },
21
+ perPage: {
22
+ type: [Number, String],
23
+ default: 20
24
+ },
25
+ modelValue: {
26
+ type: [Number, String],
27
+ default: 1
28
+ },
29
+ showPageInfo: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ order: {
34
+ type: String,
35
+ default: "left",
36
+ validator: (n) => ["left", "right", "center"].includes(n)
37
+ },
38
+ pagePerJump: {
39
+ type: [Number, void 0],
40
+ default: void 0
41
+ }
42
+ },
43
+ emits: {
44
+ "update:modelValue": null,
45
+ change: null
46
+ },
47
+ setup(n, { emit: P }) {
48
+ const d = u(() => n.visiblePage > 7 ? n.visiblePage : 7), e = u(() => n.modelValue), t = u(
49
+ () => n.total === 0 ? 1 : Math.ceil(n.total / n.perPage)
50
+ ), M = u(() => e.value > 1), m = u(() => e.value < t.value), v = u(() => Math.max(e.value - n.pagePerJump, 1)), b = u(
51
+ () => Math.min(e.value + n.pagePerJump, t.value)
52
+ ), I = u(() => {
53
+ const a = e.value * n.perPage - n.perPage + 1;
54
+ return a >= 0 ? a : 0;
55
+ }), h = (a, l) => {
56
+ e.value === a || a < 1 || a > t.value || (P("update:modelValue", a), P("change", a), l && l.target && q(() => l.target.focus()));
57
+ }, i = (a, l = {}) => ({
58
+ number: a,
59
+ isCurrent: l.isCurrent ?? e.value === a,
60
+ click: (o) => h(a, o),
61
+ input: (o, s) => h(+s, o),
62
+ disabled: l.disabled || !1,
63
+ class: l.class || ""
64
+ }), p = (a, l) => {
65
+ const o = [], s = a > 0 ? a : 1;
66
+ for (let f = s; f <= l; f++)
67
+ o.push(i(f));
68
+ return o;
69
+ }, D = u(() => {
70
+ const a = parseInt(d.value, 10);
71
+ if (a === 0)
72
+ return [];
73
+ const l = Math.min(Math.max(0, a) || t.value, t.value);
74
+ if (t.value <= l)
75
+ return p(1, t.value);
76
+ const o = l % 2 === 0 ? 1 : 0, s = Math.floor(l / 2), f = t.value - s + 1 + o;
77
+ if (e.value > s && e.value < f) {
78
+ const R = t.value, S = e.value - s + 2, J = e.value + s - 2 - o, z = S - 1 === 2 ? 2 : -1, T = J + 1 === R - 1 ? J + 1 : -1;
79
+ return [
80
+ i(1),
81
+ i(z),
82
+ ...p(S, J),
83
+ i(T),
84
+ i(t.value)
85
+ ];
86
+ } else if (e.value === s) {
87
+ const x = e.value + s - 1 - o;
88
+ return [...p(1, x), i(-1), i(t.value)];
89
+ } else if (e.value === f) {
90
+ const x = e.value - s + 1;
91
+ return [i(1), i(-1), ...p(x, t.value)];
92
+ }
93
+ return [...p(1, s), i(-1), ...p(f, t.value)];
94
+ }), L = u(() => ({ "justify-content": n.order, flex: "3 1 0%" }));
95
+ return B(
96
+ () => t.value,
97
+ (a) => {
98
+ e.value > a && h(a);
99
+ }
100
+ ), B(
101
+ () => e.value,
102
+ (a, l) => {
103
+ t.value < a && h(l);
104
+ }
105
+ ), {
106
+ pageCount: t,
107
+ pagesInRange: D,
108
+ hasPrev: M,
109
+ hasNext: m,
110
+ listClasses: L,
111
+ firstData: I,
112
+ current: e,
113
+ changePage: h,
114
+ getPage: i,
115
+ prevJumpPage: v,
116
+ nextJumpPage: b
117
+ };
118
+ }
119
+ }, O = { class: "pagination" }, Q = {
120
+ key: 0,
121
+ class: "pagination-info"
122
+ }, U = {
123
+ key: 0,
124
+ class: "pagination-ellipsis"
125
+ }, W = ["onClick"];
126
+ function X(n, P, d, e, t, M) {
127
+ const m = w("ev-icon"), v = w("page-button");
128
+ return r(), c("nav", O, [
129
+ d.showPageInfo ? (r(), c("small", Q, [
130
+ d.perPage === 1 ? (r(), c(k, { key: 0 }, [
131
+ E(_(e.firstData) + " / " + _(d.total), 1)
132
+ ], 64)) : (r(), c(k, { key: 1 }, [
133
+ E(_(e.firstData) + " - " + _(Math.min(e.current * d.perPage, d.total)) + " / " + _(d.total), 1)
134
+ ], 64))
135
+ ])) : V("", !0),
136
+ C("ul", {
137
+ class: "pagination-list",
138
+ style: j(e.listClasses)
139
+ }, [
140
+ n.$props.pagePerJump ? (r(), c("li", {
141
+ key: 0,
142
+ class: y(["step-button", { "is-disabled": !e.hasPrev }])
143
+ }, [
144
+ g(v, {
145
+ class: "pagination-previous",
146
+ disabled: !e.hasPrev,
147
+ page: e.getPage(e.prevJumpPage, { isCurrent: !1 })
148
+ }, {
149
+ default: N(() => [
150
+ g(m, { icon: "ev-icon-s-double-left" })
151
+ ]),
152
+ _: 1
153
+ }, 8, ["disabled", "page"])
154
+ ], 2)) : V("", !0),
155
+ C("li", {
156
+ class: y(["step-button", { "is-disabled": !e.hasPrev }])
157
+ }, [
158
+ g(v, {
159
+ class: "pagination-previous",
160
+ disabled: !e.hasPrev,
161
+ page: e.getPage(e.current - 1)
162
+ }, {
163
+ default: N(() => [
164
+ g(m, { icon: "ev-icon-s-arrow-left" })
165
+ ]),
166
+ _: 1
167
+ }, 8, ["disabled", "page"])
168
+ ], 2),
169
+ (r(!0), c(k, null, F(e.pagesInRange, (b, I) => (r(), c(k, { key: I }, [
170
+ b.number === -1 ? (r(), c("li", U, [...P[0] || (P[0] = [
171
+ C("span", null, "…", -1)
172
+ ])])) : (r(), c("li", {
173
+ key: 1,
174
+ class: y({ "is-current": b.isCurrent, "is-page": !0 }),
175
+ onClick: b.click
176
+ }, [
177
+ g(v, { page: b }, null, 8, ["page"])
178
+ ], 10, W))
179
+ ], 64))), 128)),
180
+ C("li", {
181
+ class: y(["step-button", { "is-disabled": !e.hasNext }])
182
+ }, [
183
+ g(v, {
184
+ class: "pagination-next",
185
+ disabled: !e.hasNext,
186
+ page: e.getPage(e.current + 1)
187
+ }, {
188
+ default: N(() => [
189
+ g(m, { icon: "ev-icon-s-arrow-right" })
190
+ ]),
191
+ _: 1
192
+ }, 8, ["disabled", "page"])
193
+ ], 2),
194
+ n.$props.pagePerJump ? (r(), c("li", {
195
+ key: 1,
196
+ class: y(["step-button", { "is-disabled": !e.hasNext }])
197
+ }, [
198
+ g(v, {
199
+ class: "pagination-previous",
200
+ disabled: !e.hasNext,
201
+ page: e.getPage(e.nextJumpPage, { isCurrent: !1 })
202
+ }, {
203
+ default: N(() => [
204
+ g(m, { icon: "ev-icon-s-double-right" })
205
+ ]),
206
+ _: 1
207
+ }, 8, ["disabled", "page"])
208
+ ], 2)) : V("", !0)
209
+ ], 4)
210
+ ]);
211
+ }
212
+ const te = /* @__PURE__ */ H(K, [["render", X]]);
213
+ export {
214
+ te as default
215
+ };
@@ -0,0 +1,7 @@
1
+ import a from "./Pagination.vue.js";
2
+ a.install = (n) => {
3
+ n.component(a.name, a);
4
+ };
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,35 @@
1
+ import { openBlock as n, createElementBlock as i, mergeProps as s, withModifiers as o, renderSlot as l, createTextVNode as c, toDisplayString as d } from "vue";
2
+ import u from "../../_virtual/_plugin-vue_export-helper.js";
3
+ const g = {
4
+ name: "PageButton",
5
+ props: {
6
+ page: {
7
+ type: Object,
8
+ required: !0
9
+ },
10
+ disabled: {
11
+ type: Boolean,
12
+ default: !1
13
+ }
14
+ }
15
+ }, f = ["aria-current"];
16
+ function p(t, a, e, m, b, _) {
17
+ return n(), i("span", s({
18
+ class: {
19
+ "is-current": e.page.isCurrent,
20
+ "is-disabled": e.disabled || e.page.disabled,
21
+ [e.page.class]: !0
22
+ }
23
+ }, t.$attrs, {
24
+ "aria-current": e.page.isCurrent,
25
+ onClick: a[0] || (a[0] = o((...r) => e.page.click && e.page.click(...r), ["stop"]))
26
+ }), [
27
+ l(t.$slots, "default", {}, () => [
28
+ c(d(e.page.number), 1)
29
+ ])
30
+ ], 16, f);
31
+ }
32
+ const y = /* @__PURE__ */ u(g, [["render", p]]);
33
+ export {
34
+ y as default
35
+ };