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.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/common/utils.bignumber.js +23 -0
- package/dist/common/utils.debounce.js +66 -0
- package/dist/common/utils.js +64 -0
- package/dist/common/utils.throttle.js +15 -0
- package/dist/components/button/Button.vue.js +65 -0
- package/dist/components/button/index.js +7 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
- package/dist/components/buttonGroup/index.js +7 -0
- package/dist/components/calendar/Calendar.vue.js +299 -0
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/uses.js +579 -0
- package/dist/components/chart/Chart.vue.js +261 -0
- package/dist/components/chart/ChartToolbar.vue.js +32 -0
- package/dist/components/chart/chart.core.js +738 -0
- package/dist/components/chart/chartZoom.core.js +221 -0
- package/dist/components/chart/element/element.bar.js +358 -0
- package/dist/components/chart/element/element.bar.time.js +55 -0
- package/dist/components/chart/element/element.heatmap.js +403 -0
- package/dist/components/chart/element/element.line.js +292 -0
- package/dist/components/chart/element/element.pie.js +73 -0
- package/dist/components/chart/element/element.scatter.js +209 -0
- package/dist/components/chart/element/element.tip.js +312 -0
- package/dist/components/chart/helpers/helpers.canvas.js +141 -0
- package/dist/components/chart/helpers/helpers.constant.js +253 -0
- package/dist/components/chart/helpers/helpers.util.js +265 -0
- package/dist/components/chart/index.js +7 -0
- package/dist/components/chart/model/index.js +6 -0
- package/dist/components/chart/model/model.series.js +82 -0
- package/dist/components/chart/model/model.store.js +650 -0
- package/dist/components/chart/plugins/plugins.interaction.js +823 -0
- package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
- package/dist/components/chart/plugins/plugins.legend.js +665 -0
- package/dist/components/chart/plugins/plugins.pie.js +86 -0
- package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
- package/dist/components/chart/plugins/plugins.title.js +43 -0
- package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
- package/dist/components/chart/scale/scale.js +492 -0
- package/dist/components/chart/scale/scale.linear.js +248 -0
- package/dist/components/chart/scale/scale.logarithmic.js +82 -0
- package/dist/components/chart/scale/scale.step.js +227 -0
- package/dist/components/chart/scale/scale.time.category.js +148 -0
- package/dist/components/chart/scale/scale.time.js +95 -0
- package/dist/components/chart/uses.js +479 -0
- package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
- package/dist/components/chartBrush/chartBrush.core.js +265 -0
- package/dist/components/chartBrush/index.js +7 -0
- package/dist/components/chartBrush/uses.js +18 -0
- package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
- package/dist/components/chartGroup/index.js +7 -0
- package/dist/components/chartGroup/uses.js +47 -0
- package/dist/components/checkbox/Checkbox.vue.js +99 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
- package/dist/components/checkboxGroup/index.js +7 -0
- package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
- package/dist/components/contextMenu/MenuList.vue.js +105 -0
- package/dist/components/contextMenu/index.js +7 -0
- package/dist/components/contextMenu/uses.js +79 -0
- package/dist/components/datePicker/DatePicker.vue.js +310 -0
- package/dist/components/datePicker/index.js +7 -0
- package/dist/components/datePicker/uses.js +190 -0
- package/dist/components/grid/Grid.vue.js +1261 -0
- package/dist/components/grid/GridColumnSetting.vue.js +212 -0
- package/dist/components/grid/GridFilterSetting.vue.js +222 -0
- package/dist/components/grid/GridPagination.vue.js +69 -0
- package/dist/components/grid/GridSummary.vue.js +186 -0
- package/dist/components/grid/GridToolbar.vue.js +15 -0
- package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
- package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
- package/dist/components/grid/index.js +7 -0
- package/dist/components/grid/uses.js +697 -0
- package/dist/components/icon/Icon.vue.js +50 -0
- package/dist/components/icon/index.js +8 -0
- package/dist/components/inputNumber/InputNumber.vue.js +112 -0
- package/dist/components/inputNumber/index.js +7 -0
- package/dist/components/inputNumber/uses.js +76 -0
- package/dist/components/loading/Loading.vue.js +78 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/menu/Menu.vue.js +66 -0
- package/dist/components/menu/MenuItem.vue.js +125 -0
- package/dist/components/menu/index.js +7 -0
- package/dist/components/message/Message.vue.js +122 -0
- package/dist/components/message/index.js +16 -0
- package/dist/components/messageBox/MessageBox.vue.js +216 -0
- package/dist/components/messageBox/index.js +13 -0
- package/dist/components/notification/Notification.vue.js +140 -0
- package/dist/components/notification/index.js +23 -0
- package/dist/components/pagination/Pagination.vue.js +215 -0
- package/dist/components/pagination/index.js +7 -0
- package/dist/components/pagination/pageButton.vue.js +35 -0
- package/dist/components/progress/Progress.vue.js +88 -0
- package/dist/components/progress/index.js +7 -0
- package/dist/components/radio/Radio.vue.js +75 -0
- package/dist/components/radio/index.js +7 -0
- package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
- package/dist/components/radioGroup/index.js +7 -0
- package/dist/components/scheduler/Scheduler.vue.js +128 -0
- package/dist/components/scheduler/index.js +7 -0
- package/dist/components/scheduler/uses.js +73 -0
- package/dist/components/select/Select.vue.js +381 -0
- package/dist/components/select/index.js +7 -0
- package/dist/components/select/uses.js +147 -0
- package/dist/components/slider/Slider.vue.js +243 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/uses.js +188 -0
- package/dist/components/tabPanel/TabPanel.vue.js +39 -0
- package/dist/components/tabPanel/index.js +7 -0
- package/dist/components/tabs/Tabs.vue.js +220 -0
- package/dist/components/tabs/index.js +7 -0
- package/dist/components/textField/TextField.vue.js +209 -0
- package/dist/components/textField/index.js +7 -0
- package/dist/components/timePicker/TimePicker.vue.js +227 -0
- package/dist/components/timePicker/index.js +7 -0
- package/dist/components/toggle/Toggle.vue.js +66 -0
- package/dist/components/toggle/index.js +7 -0
- package/dist/components/tree/Tree.vue.js +220 -0
- package/dist/components/tree/TreeNode.vue.js +146 -0
- package/dist/components/tree/index.js +7 -0
- package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
- package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
- package/dist/components/treeGrid/index.js +7 -0
- package/dist/components/treeGrid/uses.js +497 -0
- package/dist/components/window/Window.vue.js +211 -0
- package/dist/components/window/index.js +7 -0
- package/dist/components/window/uses.js +345 -0
- package/dist/directives/clickoutside.js +47 -0
- package/dist/main.js +142 -0
- package/dist/package.json.js +4 -0
- package/dist/resolver.js +17 -0
- package/dist/style.css +1 -1
- package/package.json +56 -23
- package/dist/index.js +0 -21754
- package/dist/index.umd.cjs +0 -28
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { getCurrentInstance as $, computed as A, ref as p, reactive as C, watch as I, nextTick as P } from "vue";
|
|
2
|
+
import { getChangedValueByTimeFormat as v, getLastDateOfMonth as W } from "../calendar/uses.js";
|
|
3
|
+
const B = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/), Y = new RegExp(
|
|
4
|
+
/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/
|
|
5
|
+
), j = () => {
|
|
6
|
+
var F;
|
|
7
|
+
const { props: t, emit: n } = $(), m = (F = t.options) == null ? void 0 : F.timeFormat, h = ["dateTimeRange", "dateRange", "dateMulti"].includes(t.mode), V = (s) => {
|
|
8
|
+
let e;
|
|
9
|
+
if (t.mode === "dateTime")
|
|
10
|
+
e = v(m, s);
|
|
11
|
+
else if (t.modelValue.length) {
|
|
12
|
+
const [o, i] = m;
|
|
13
|
+
e = [
|
|
14
|
+
v(o, s[0]),
|
|
15
|
+
v(i, s[1])
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
return e;
|
|
19
|
+
}, l = A({
|
|
20
|
+
get: () => t.modelValue ? ["dateTime", "dateTimeRange"].includes(t.mode) && m ? V(t.modelValue) : h ? [...t.modelValue] : t.modelValue : t.mode === "date" || t.mode === "dateTime" ? "" : [],
|
|
21
|
+
set: (s) => {
|
|
22
|
+
if (["dateTime", "dateTimeRange"].includes(t.mode) && m) {
|
|
23
|
+
n("update:modelValue", V(s));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
n("update:modelValue", s);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
let c;
|
|
30
|
+
if (["dateTimeRange", "dateTime"].includes(t.mode) && m)
|
|
31
|
+
if (t.mode === "dateTimeRange" && Array.isArray(t.modelValue) && t.modelValue.length === 2) {
|
|
32
|
+
const [s, e] = t.modelValue, [o, i] = m;
|
|
33
|
+
t.modelValue = [
|
|
34
|
+
v(o, s),
|
|
35
|
+
v(i, e)
|
|
36
|
+
], c = p([...t.modelValue]);
|
|
37
|
+
} else t.mode === "dateTime" && t.modelValue ? c = p(v(m, t.modelValue)) : c = p(t.modelValue);
|
|
38
|
+
else
|
|
39
|
+
c = p(h ? [...t.modelValue] : t.modelValue);
|
|
40
|
+
const x = (s) => {
|
|
41
|
+
const e = (a) => !!(a.length === 10 && B.exec(a)), o = (a) => !!(a.length === 19 && Y.exec(a)), i = (a) => {
|
|
42
|
+
const f = a.split(" ")[0], d = +f.split("-")[0], g = +f.split("-")[1], R = +f.split("-")[2], y = W(d, g);
|
|
43
|
+
return +R <= y && d >= (/* @__PURE__ */ new Date(0)).getFullYear();
|
|
44
|
+
};
|
|
45
|
+
let u = !0;
|
|
46
|
+
t.mode === "date" ? u = e(s) && i(s) : t.mode === "dateTime" ? u = o(s) && i(s) : t.mode === "dateRange" ? u = s.every((a) => e(a) && i(a)) : t.mode === "dateTimeRange" && (u = s.every((a) => o(a) && i(a))), u && (l.value = h ? [...s] : s), c.value = h ? [...l.value] : l.value;
|
|
47
|
+
}, T = A(() => t.mode === "date" || t.mode === "dateTime" ? l.value : l.value.length);
|
|
48
|
+
return {
|
|
49
|
+
mv: l,
|
|
50
|
+
currentValue: c,
|
|
51
|
+
isClearableIcon: T,
|
|
52
|
+
validateValue: x,
|
|
53
|
+
removeAllMv: () => {
|
|
54
|
+
t.mode === "date" || t.mode === "dateTime" ? l.value = null : (l.value.splice(0), l.value = [...l.value]);
|
|
55
|
+
},
|
|
56
|
+
changeMv: async (s) => {
|
|
57
|
+
await P(), n("change", l.value, s);
|
|
58
|
+
},
|
|
59
|
+
removeMv: (s) => {
|
|
60
|
+
if (!t.disabled) {
|
|
61
|
+
const e = l.value.indexOf(s);
|
|
62
|
+
l.value.splice(e, 1), l.value = [...l.value];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}, q = () => {
|
|
67
|
+
const { props: t } = $(), n = p(!1), m = p(null), h = p(null), V = p(null), l = p(null), c = C({
|
|
68
|
+
top: null,
|
|
69
|
+
right: null,
|
|
70
|
+
left: null
|
|
71
|
+
}), x = async () => {
|
|
72
|
+
var f, d;
|
|
73
|
+
await P();
|
|
74
|
+
const r = (f = h.value) == null ? void 0 : f.getBoundingClientRect(), k = (d = V.value) == null ? void 0 : d.getBoundingClientRect(), F = r.height, s = r.y, e = r.x, o = k.height, i = k.width, u = document.documentElement.clientHeight, a = document.documentElement.clientWidth;
|
|
75
|
+
u < s + F + o ? (c.top = `-${o}px`, a < e + i ? (c.left = "auto", c.right = "0px") : (c.left = "0px", c.right = "auto")) : (c.top = `${F}px`, a < e + i ? (c.left = "auto", c.right = "0px") : (c.left = "0px", c.right = "auto"));
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
isDropbox: n,
|
|
79
|
+
datePicker: m,
|
|
80
|
+
datePickerWrapper: h,
|
|
81
|
+
dropbox: V,
|
|
82
|
+
itemWrapper: l,
|
|
83
|
+
dropboxPosition: c,
|
|
84
|
+
clickSelectInput: async () => {
|
|
85
|
+
t.disabled || (n.value = t.enableTextInput ? !0 : !n.value, n.value && await x());
|
|
86
|
+
},
|
|
87
|
+
clickOutsideDropbox: () => {
|
|
88
|
+
n.value = !1;
|
|
89
|
+
},
|
|
90
|
+
changeDropboxPosition: x
|
|
91
|
+
};
|
|
92
|
+
}, z = (t) => {
|
|
93
|
+
var s;
|
|
94
|
+
const { props: n } = $(), { mv: m, currentValue: h, clickOutsideDropbox: V } = t, l = C([]);
|
|
95
|
+
(s = n.shortcuts) == null || s.forEach(({ value: e, label: o, shortcutDate: i }) => {
|
|
96
|
+
l.push({
|
|
97
|
+
key: e,
|
|
98
|
+
label: o,
|
|
99
|
+
shortcutDate: i,
|
|
100
|
+
isActive: !1
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
const c = () => {
|
|
104
|
+
const e = l.find((o) => o.isActive);
|
|
105
|
+
e && (e.isActive = !1);
|
|
106
|
+
}, x = (e) => {
|
|
107
|
+
const o = l.find((i) => i.key === e);
|
|
108
|
+
o && (o.isActive = !0);
|
|
109
|
+
}, T = (e) => e === null ? "00" : +e < 10 ? `0${e}` : e, D = (e) => {
|
|
110
|
+
const o = e ? new Date(e) : /* @__PURE__ */ new Date(), i = o.getFullYear(), u = o.getMonth() + 1, a = o.getDate();
|
|
111
|
+
return `${i}-${T(u)}-${T(a)}`;
|
|
112
|
+
}, r = (e) => {
|
|
113
|
+
const o = e ? new Date(e) : /* @__PURE__ */ new Date(), i = o.getHours(), u = o.getMinutes(), a = o.getSeconds();
|
|
114
|
+
return `${D(o)} ${T(i)}:${T(u)}:${T(a)}`;
|
|
115
|
+
}, k = () => {
|
|
116
|
+
var i, u;
|
|
117
|
+
c();
|
|
118
|
+
const e = ["dateRange", "dateTimeRange"].includes(n.mode);
|
|
119
|
+
if (!l.length || n.mode === "dateMulti" && ((i = n.options) == null ? void 0 : i.multiType) !== "date" || e && !m.value.length || !e && !m.value)
|
|
120
|
+
return;
|
|
121
|
+
let o;
|
|
122
|
+
if (e) {
|
|
123
|
+
const a = (u = n.options) == null ? void 0 : u.timeFormat, [f, d] = m.value;
|
|
124
|
+
let g;
|
|
125
|
+
n.mode === "dateTimeRange" && (a != null && a.length) ? g = l.find(({ shortcutDate: R }) => {
|
|
126
|
+
const [y, b] = R(), [M, w] = a, S = v(
|
|
127
|
+
M,
|
|
128
|
+
r(y)
|
|
129
|
+
), O = v(w, r(b)), E = S === r(f), H = O === r(d);
|
|
130
|
+
return E && H;
|
|
131
|
+
}) : g = l.find(({ shortcutDate: R }) => {
|
|
132
|
+
const [y, b] = R(), M = n.mode === "dateTimeRange" ? r : D, w = M(y) === M(f), S = M(b) === M(d);
|
|
133
|
+
return w && S;
|
|
134
|
+
}), o = g == null ? void 0 : g.key;
|
|
135
|
+
} else {
|
|
136
|
+
const a = n.mode === "dateTime" ? r : D, f = a(m.value), d = l.find(({ shortcutDate: g }) => a(g()) === f);
|
|
137
|
+
o = d == null ? void 0 : d.key;
|
|
138
|
+
}
|
|
139
|
+
o && x(o);
|
|
140
|
+
}, F = (e) => {
|
|
141
|
+
var f;
|
|
142
|
+
const o = ["dateRange", "dateTimeRange"].includes(n.mode), i = l.find(({ key: d }) => d === e);
|
|
143
|
+
if (!i)
|
|
144
|
+
return;
|
|
145
|
+
const u = i.shortcutDate, a = (f = n.options) == null ? void 0 : f.timeFormat;
|
|
146
|
+
if (o) {
|
|
147
|
+
const [d, g] = u();
|
|
148
|
+
if (n.mode === "dateTimeRange")
|
|
149
|
+
if (a != null && a.length) {
|
|
150
|
+
const [R, y] = a;
|
|
151
|
+
m.value = [
|
|
152
|
+
v(R, r(d)),
|
|
153
|
+
v(y, r(g))
|
|
154
|
+
];
|
|
155
|
+
} else
|
|
156
|
+
m.value = [r(d), r(g)];
|
|
157
|
+
else
|
|
158
|
+
m.value = [D(d), D(g)];
|
|
159
|
+
} else {
|
|
160
|
+
const d = u();
|
|
161
|
+
m.value = n.mode === "dateTime" ? v(a, r(d)) : D(d);
|
|
162
|
+
}
|
|
163
|
+
c(), x(e);
|
|
164
|
+
};
|
|
165
|
+
return I(
|
|
166
|
+
() => n.modelValue,
|
|
167
|
+
(e) => {
|
|
168
|
+
var o, i;
|
|
169
|
+
if (k(), !(n.mode === "dateMulti" && ((o = n == null ? void 0 : n.options) == null ? void 0 : o.multiType) === "date" && ((i = n == null ? void 0 : n.options) == null ? void 0 : i.multiDayLimit) > e.length)) {
|
|
170
|
+
if (n.mode === "dateRange" || n.mode === "dateTimeRange") {
|
|
171
|
+
h.value = [...e];
|
|
172
|
+
return;
|
|
173
|
+
} else if (n.mode === "dateTime") {
|
|
174
|
+
h.value = e;
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
h.value = e, V();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
), {
|
|
181
|
+
usedShortcuts: l,
|
|
182
|
+
clickShortcut: F,
|
|
183
|
+
setActiveShortcut: k
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
q as useDropdown,
|
|
188
|
+
j as useModel,
|
|
189
|
+
z as useShortcuts
|
|
190
|
+
};
|