evui 3.5.0 → 3.5.1
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/index.js +23148 -0
- package/dist/index.umd.cjs +28 -0
- package/package.json +5 -11
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/common/utils.bignumber.js +0 -23
- package/dist/common/utils.debounce.js +0 -66
- package/dist/common/utils.js +0 -64
- package/dist/common/utils.throttle.js +0 -15
- package/dist/components/button/Button.vue.js +0 -65
- package/dist/components/button/index.js +0 -7
- package/dist/components/buttonGroup/ButtonGroup.vue.js +0 -14
- package/dist/components/buttonGroup/index.js +0 -7
- package/dist/components/calendar/Calendar.vue.js +0 -299
- package/dist/components/calendar/index.js +0 -7
- package/dist/components/calendar/uses.js +0 -579
- package/dist/components/chart/Chart.vue.js +0 -261
- package/dist/components/chart/ChartToolbar.vue.js +0 -32
- package/dist/components/chart/chart.core.js +0 -738
- package/dist/components/chart/chartZoom.core.js +0 -221
- package/dist/components/chart/element/element.bar.js +0 -358
- package/dist/components/chart/element/element.bar.time.js +0 -55
- package/dist/components/chart/element/element.heatmap.js +0 -403
- package/dist/components/chart/element/element.line.js +0 -292
- package/dist/components/chart/element/element.pie.js +0 -73
- package/dist/components/chart/element/element.scatter.js +0 -209
- package/dist/components/chart/element/element.tip.js +0 -312
- package/dist/components/chart/helpers/helpers.canvas.js +0 -141
- package/dist/components/chart/helpers/helpers.constant.js +0 -253
- package/dist/components/chart/helpers/helpers.util.js +0 -265
- package/dist/components/chart/index.js +0 -7
- package/dist/components/chart/model/index.js +0 -6
- package/dist/components/chart/model/model.series.js +0 -82
- package/dist/components/chart/model/model.store.js +0 -650
- package/dist/components/chart/plugins/plugins.interaction.js +0 -823
- package/dist/components/chart/plugins/plugins.legend.gradient.js +0 -281
- package/dist/components/chart/plugins/plugins.legend.js +0 -665
- package/dist/components/chart/plugins/plugins.pie.js +0 -86
- package/dist/components/chart/plugins/plugins.scrollbar.js +0 -345
- package/dist/components/chart/plugins/plugins.title.js +0 -43
- package/dist/components/chart/plugins/plugins.tooltip.js +0 -508
- package/dist/components/chart/scale/scale.js +0 -492
- package/dist/components/chart/scale/scale.linear.js +0 -248
- package/dist/components/chart/scale/scale.logarithmic.js +0 -82
- package/dist/components/chart/scale/scale.step.js +0 -227
- package/dist/components/chart/scale/scale.time.category.js +0 -148
- package/dist/components/chart/scale/scale.time.js +0 -95
- package/dist/components/chart/uses.js +0 -479
- package/dist/components/chartBrush/ChartBrush.vue.js +0 -198
- package/dist/components/chartBrush/chartBrush.core.js +0 -265
- package/dist/components/chartBrush/index.js +0 -7
- package/dist/components/chartBrush/uses.js +0 -18
- package/dist/components/chartGroup/ChartGroup.vue.js +0 -128
- package/dist/components/chartGroup/index.js +0 -7
- package/dist/components/chartGroup/uses.js +0 -47
- package/dist/components/checkbox/Checkbox.vue.js +0 -99
- package/dist/components/checkbox/index.js +0 -7
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +0 -40
- package/dist/components/checkboxGroup/index.js +0 -7
- package/dist/components/contextMenu/ContextMenu.vue.js +0 -70
- package/dist/components/contextMenu/MenuList.vue.js +0 -105
- package/dist/components/contextMenu/index.js +0 -7
- package/dist/components/contextMenu/uses.js +0 -79
- package/dist/components/datePicker/DatePicker.vue.js +0 -310
- package/dist/components/datePicker/index.js +0 -7
- package/dist/components/datePicker/uses.js +0 -190
- package/dist/components/grid/Grid.vue.js +0 -1261
- package/dist/components/grid/GridColumnSetting.vue.js +0 -212
- package/dist/components/grid/GridFilterSetting.vue.js +0 -222
- package/dist/components/grid/GridPagination.vue.js +0 -69
- package/dist/components/grid/GridSummary.vue.js +0 -186
- package/dist/components/grid/GridToolbar.vue.js +0 -15
- package/dist/components/grid/icon/icon-option-button.vue.js +0 -39
- package/dist/components/grid/icon/icon-sort-button.vue.js +0 -56
- package/dist/components/grid/index.js +0 -7
- package/dist/components/grid/uses.js +0 -697
- package/dist/components/icon/Icon.vue.js +0 -50
- package/dist/components/icon/index.js +0 -8
- package/dist/components/inputNumber/InputNumber.vue.js +0 -112
- package/dist/components/inputNumber/index.js +0 -7
- package/dist/components/inputNumber/uses.js +0 -76
- package/dist/components/loading/Loading.vue.js +0 -78
- package/dist/components/loading/index.js +0 -7
- package/dist/components/menu/Menu.vue.js +0 -66
- package/dist/components/menu/MenuItem.vue.js +0 -125
- package/dist/components/menu/index.js +0 -7
- package/dist/components/message/Message.vue.js +0 -122
- package/dist/components/message/index.js +0 -16
- package/dist/components/messageBox/MessageBox.vue.js +0 -216
- package/dist/components/messageBox/index.js +0 -13
- package/dist/components/notification/Notification.vue.js +0 -140
- package/dist/components/notification/index.js +0 -23
- package/dist/components/pagination/Pagination.vue.js +0 -215
- package/dist/components/pagination/index.js +0 -7
- package/dist/components/pagination/pageButton.vue.js +0 -35
- package/dist/components/progress/Progress.vue.js +0 -88
- package/dist/components/progress/index.js +0 -7
- package/dist/components/radio/Radio.vue.js +0 -75
- package/dist/components/radio/index.js +0 -7
- package/dist/components/radioGroup/RadioGroup.vue.js +0 -37
- package/dist/components/radioGroup/index.js +0 -7
- package/dist/components/scheduler/Scheduler.vue.js +0 -128
- package/dist/components/scheduler/index.js +0 -7
- package/dist/components/scheduler/uses.js +0 -73
- package/dist/components/select/Select.vue.js +0 -381
- package/dist/components/select/index.js +0 -7
- package/dist/components/select/uses.js +0 -147
- package/dist/components/slider/Slider.vue.js +0 -243
- package/dist/components/slider/index.js +0 -7
- package/dist/components/slider/uses.js +0 -188
- package/dist/components/tabPanel/TabPanel.vue.js +0 -39
- package/dist/components/tabPanel/index.js +0 -7
- package/dist/components/tabs/Tabs.vue.js +0 -220
- package/dist/components/tabs/index.js +0 -7
- package/dist/components/textField/TextField.vue.js +0 -209
- package/dist/components/textField/index.js +0 -7
- package/dist/components/timePicker/TimePicker.vue.js +0 -227
- package/dist/components/timePicker/index.js +0 -7
- package/dist/components/toggle/Toggle.vue.js +0 -66
- package/dist/components/toggle/index.js +0 -7
- package/dist/components/tree/Tree.vue.js +0 -220
- package/dist/components/tree/TreeNode.vue.js +0 -146
- package/dist/components/tree/index.js +0 -7
- package/dist/components/treeGrid/TreeGrid.vue.js +0 -898
- package/dist/components/treeGrid/TreeGridNode.vue.js +0 -274
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +0 -15
- package/dist/components/treeGrid/index.js +0 -7
- package/dist/components/treeGrid/uses.js +0 -497
- package/dist/components/window/Window.vue.js +0 -211
- package/dist/components/window/index.js +0 -7
- package/dist/components/window/uses.js +0 -345
- package/dist/directives/clickoutside.js +0 -47
- package/dist/main.js +0 -142
- package/dist/package.json.js +0 -4
- package/dist/resolver.js +0 -17
|
@@ -1,579 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as Oe, computed as ae, ref as z, reactive as Q, onBeforeMount as Fe, watch as Ue, unref as Xe } from "vue";
|
|
2
|
-
import { throttle as We } from "lodash-es";
|
|
3
|
-
const Me = 6, Ee = 7, Re = 4, pe = 3, Ne = 5, ye = 4, k = 12, Be = 24, Ge = 60, Je = 60, X = 12, $e = 4, be = 20, Ie = {
|
|
4
|
-
fullName: [
|
|
5
|
-
"January",
|
|
6
|
-
"February",
|
|
7
|
-
"March",
|
|
8
|
-
"April",
|
|
9
|
-
"May",
|
|
10
|
-
"June",
|
|
11
|
-
"July",
|
|
12
|
-
"August",
|
|
13
|
-
"September",
|
|
14
|
-
"October",
|
|
15
|
-
"November",
|
|
16
|
-
"December"
|
|
17
|
-
],
|
|
18
|
-
numberName: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
|
|
19
|
-
abbrName: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"],
|
|
20
|
-
korName: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]
|
|
21
|
-
}, je = {
|
|
22
|
-
abbrUpperName: ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"],
|
|
23
|
-
abbrLowerName: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],
|
|
24
|
-
abbrPascalName: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
25
|
-
abbrKorName: ["일", "월", "화", "수", "목", "금", "토"]
|
|
26
|
-
}, P = {
|
|
27
|
-
DATE: "date",
|
|
28
|
-
MONTH: "month",
|
|
29
|
-
YEAR: "year"
|
|
30
|
-
}, De = 864e5, ge = +/* @__PURE__ */ new Date("1970-01-01 00:00:00"), xe = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/), Se = new RegExp(
|
|
31
|
-
/[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]/
|
|
32
|
-
), Ke = (e, t) => e.length ? e.reduce(
|
|
33
|
-
(a, s) => new Date(a).getTime() > new Date(s).getTime() ? a : s
|
|
34
|
-
) : "", I = (e) => e === null ? "00" : +e < 10 ? `0${e}` : e, oe = (e, t) => Array.from(Array(e), () => Array(t).fill(!1)), Ze = (e, t) => (/* @__PURE__ */ new Date(`${e}-${t}-1`)).getDay(), we = (e, t) => {
|
|
35
|
-
let a;
|
|
36
|
-
switch (t) {
|
|
37
|
-
case 4:
|
|
38
|
-
case 6:
|
|
39
|
-
case 9:
|
|
40
|
-
case 11:
|
|
41
|
-
a = 30;
|
|
42
|
-
break;
|
|
43
|
-
case 2:
|
|
44
|
-
e % 4 === 0 && e % 100 !== 0 || e % 400 === 0 ? a = 29 : a = 28;
|
|
45
|
-
break;
|
|
46
|
-
default:
|
|
47
|
-
a = 31;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
return a;
|
|
51
|
-
}, ce = ({ year: e, month: t, date: a, hour: s, min: r, sec: m }) => s !== void 0 && r !== void 0 && m !== void 0 ? `${e}-${I(t)}-${I(a)} ${I(s)}:${I(r)}:${I(m)}` : `${e}-${I(t)}-${I(a)}`, b = (e, t) => {
|
|
52
|
-
var r, m, g, D, N, W;
|
|
53
|
-
let a = Xe(e);
|
|
54
|
-
Array.isArray(a) && (a = Ke(e));
|
|
55
|
-
const s = {
|
|
56
|
-
year: +((r = a == null ? void 0 : a.split(" ")[0]) == null ? void 0 : r.split("-")[0]) || null,
|
|
57
|
-
month: +((m = a == null ? void 0 : a.split(" ")[0]) == null ? void 0 : m.split("-")[1]) || null,
|
|
58
|
-
date: +((g = a == null ? void 0 : a.split(" ")[0]) == null ? void 0 : g.split("-")[2]) || null,
|
|
59
|
-
hour: +((D = a == null ? void 0 : a.split(" ")[1]) == null ? void 0 : D.split(":")[0]) || 0,
|
|
60
|
-
min: +((N = a == null ? void 0 : a.split(" ")[1]) == null ? void 0 : N.split(":")[1]) || 0,
|
|
61
|
-
sec: +((W = a == null ? void 0 : a.split(" ")[1]) == null ? void 0 : W.split(":")[2]) || 0
|
|
62
|
-
};
|
|
63
|
-
return t === "year" ? s.year : t === "month" ? s.month : t === "date" ? s.date : t === "hour" ? s.hour : t === "min" ? s.min : t === "sec" ? s.sec : s;
|
|
64
|
-
}, Ve = (e, t, a) => e === "next" ? {
|
|
65
|
-
year: a === 12 ? t + 1 : t,
|
|
66
|
-
month: (a + 1) % 12 || 12
|
|
67
|
-
} : {
|
|
68
|
-
year: a === 1 ? t - 1 : t,
|
|
69
|
-
month: (a - 1) % 12 || 12
|
|
70
|
-
}, ue = (e, t, a) => {
|
|
71
|
-
const s = b(t, a);
|
|
72
|
-
if (e) {
|
|
73
|
-
const r = e == null ? void 0 : e.split(":")[0], m = e == null ? void 0 : e.split(":")[1], g = e == null ? void 0 : e.split(":")[2];
|
|
74
|
-
if (a === "hour")
|
|
75
|
-
return r === "HH" ? s : +r;
|
|
76
|
-
if (a === "min")
|
|
77
|
-
return m === "mm" ? s : +m;
|
|
78
|
-
if (a === "sec")
|
|
79
|
-
return g === "ss" ? s : +g;
|
|
80
|
-
}
|
|
81
|
-
return s;
|
|
82
|
-
}, U = (e, t) => {
|
|
83
|
-
if (!t)
|
|
84
|
-
return "";
|
|
85
|
-
const a = I(ue(e, t, "hour")), s = I(ue(e, t, "min")), r = I(ue(e, t, "sec"));
|
|
86
|
-
return `${t.split(" ")[0]} ${a}:${s}:${r}`;
|
|
87
|
-
}, Te = (e, t, a, s) => {
|
|
88
|
-
if (!s.length)
|
|
89
|
-
return !1;
|
|
90
|
-
let r = t === "main" ? a : s[0], m = t === "expanded" ? a : s[1], g = r, D = m;
|
|
91
|
-
if (!a.split(" ")[1])
|
|
92
|
-
if (e === "dateTimeRange") {
|
|
93
|
-
r = r.split(" ")[0], m = m.split(" ")[0];
|
|
94
|
-
const N = s[0].split(" ")[1], W = s[1].split(" ")[1];
|
|
95
|
-
g = `${r} ${N}`, D = `${m} ${W}`;
|
|
96
|
-
} else
|
|
97
|
-
g = `${r} 00:00:00`, D = `${m} 23:59:59`;
|
|
98
|
-
return g && D && new Date(g).getTime() > +new Date(D).getTime();
|
|
99
|
-
}, se = (e) => (/* @__PURE__ */ new Date(`${e}`)).getTime(), ve = (e) => {
|
|
100
|
-
const t = 10 ** (e.toString().length - 1), a = Math.floor(e / t), s = Math.floor(e % (t * a)), r = a * t + Math.floor(s / be) * be, m = r + be - 1;
|
|
101
|
-
return {
|
|
102
|
-
start: r,
|
|
103
|
-
end: m
|
|
104
|
-
};
|
|
105
|
-
}, Qe = () => {
|
|
106
|
-
var i, T, x;
|
|
107
|
-
const { props: e } = Oe(), t = (i = e.options) == null ? void 0 : i.timeFormat, a = ae(
|
|
108
|
-
() => ["dateRange", "dateTimeRange"].includes(e.mode) ? ["main", "expanded"] : ["main"]
|
|
109
|
-
);
|
|
110
|
-
let s;
|
|
111
|
-
if (e.mode !== "dateMulti" && e.mode !== "dateRange" && e.mode !== "dateTimeRange")
|
|
112
|
-
if (e.modelValue && (e.modelValue.length === 10 && xe.exec((T = e.modelValue) == null ? void 0 : T.toString()) || e.modelValue.length === 19 && Se.exec((x = e.modelValue) == null ? void 0 : x.toString())))
|
|
113
|
-
if (e.mode === "dateTime" && t) {
|
|
114
|
-
const d = U(t, e.modelValue);
|
|
115
|
-
s = z(d);
|
|
116
|
-
} else
|
|
117
|
-
s = z(e.modelValue);
|
|
118
|
-
else
|
|
119
|
-
s = z("");
|
|
120
|
-
else if (Array.isArray(e.modelValue) && e.modelValue.every(
|
|
121
|
-
(d) => !d || d.length === 10 && xe.exec(d) || d.length === 19 && Se.exec(d)
|
|
122
|
-
))
|
|
123
|
-
if (e.mode === "dateTimeRange" && e.modelValue.length === 2 && t) {
|
|
124
|
-
const d = [];
|
|
125
|
-
d.push(U(t[0], e.modelValue[0])), d.push(U(t[1], e.modelValue[1])), s = z([...d]);
|
|
126
|
-
} else
|
|
127
|
-
s = z([...e.modelValue]);
|
|
128
|
-
else
|
|
129
|
-
s = z([]);
|
|
130
|
-
const r = () => {
|
|
131
|
-
e.mode === "date" && e.modelValue && typeof e.modelValue != "string" ? console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type.") : e.mode === "dateTime" && e.modelValue && typeof e.modelValue != "string" ? console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type.") : e.mode === "dateMulti" && e.modelValue && !Array.isArray(e.modelValue) ? console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type.") : e.mode === "dateRange" && e.modelValue ? Array.isArray(e.modelValue) ? se(`${e.modelValue[0]} 00:00:00`) > se(`${e.modelValue[1]} 00:00:00`) && console.warn(
|
|
132
|
-
"[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."
|
|
133
|
-
) : console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type.") : e.mode === "dateTimeRange" && e.modelValue && (Array.isArray(e.modelValue) ? se(e.modelValue[0]) > se(e.modelValue[1]) && console.warn(
|
|
134
|
-
"[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."
|
|
135
|
-
) : console.warn(
|
|
136
|
-
"[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."
|
|
137
|
-
));
|
|
138
|
-
};
|
|
139
|
-
let m;
|
|
140
|
-
const g = ["dateRange", "dateTimeRange"].includes(e.mode) ? s.value[0] : s.value;
|
|
141
|
-
g != null && g.length ? m = {
|
|
142
|
-
year: b(g, "year"),
|
|
143
|
-
month: b(g, "month"),
|
|
144
|
-
hour: Math.floor(b(g, "hour") / X) + 1 || 1,
|
|
145
|
-
min: Math.floor(b(g, "min") / X) + 1 || 1,
|
|
146
|
-
sec: Math.floor(b(g, "sec") / X) + 1 || 1
|
|
147
|
-
} : m = {
|
|
148
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
149
|
-
month: (/* @__PURE__ */ new Date()).getMonth() + 1,
|
|
150
|
-
hour: 1,
|
|
151
|
-
min: 1,
|
|
152
|
-
sec: 1
|
|
153
|
-
};
|
|
154
|
-
let D;
|
|
155
|
-
if (["dateRange", "dateTimeRange"].includes(e.mode) && Array.isArray(s.value) && s.value[1]) {
|
|
156
|
-
const d = s.value[1];
|
|
157
|
-
D = {
|
|
158
|
-
year: b(d, "year"),
|
|
159
|
-
month: b(d, "month")
|
|
160
|
-
}, e.mode === "dateTimeRange" && (D.hour = Math.floor(b(d, "hour") / X) + 1 || 1, D.min = Math.floor(b(d, "min") / X) + 1 || 1, D.sec = Math.floor(b(d, "sec") / X) + 1 || 1);
|
|
161
|
-
} else
|
|
162
|
-
D = {
|
|
163
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
164
|
-
month: (/* @__PURE__ */ new Date()).getMonth() + 1,
|
|
165
|
-
hour: 1,
|
|
166
|
-
min: 1,
|
|
167
|
-
sec: 1
|
|
168
|
-
};
|
|
169
|
-
const N = Q({
|
|
170
|
-
main: m,
|
|
171
|
-
expanded: D
|
|
172
|
-
}), W = Q({
|
|
173
|
-
main: ae(() => ve(N.main.year)),
|
|
174
|
-
expanded: ae(() => ve(N.expanded.year))
|
|
175
|
-
}), le = ae(
|
|
176
|
-
() => Ie[e.monthNotation][N.main.month - 1]
|
|
177
|
-
), j = ae(
|
|
178
|
-
() => Ie[e.monthNotation][N.expanded.month - 1]
|
|
179
|
-
), fe = Q({
|
|
180
|
-
main: le,
|
|
181
|
-
expanded: j
|
|
182
|
-
}), he = ae(() => je[e.dayOfTheWeekNotation]), u = Q({
|
|
183
|
-
main: P.DATE,
|
|
184
|
-
expanded: P.DATE
|
|
185
|
-
});
|
|
186
|
-
return Fe(() => {
|
|
187
|
-
r();
|
|
188
|
-
}), {
|
|
189
|
-
calendarList: a,
|
|
190
|
-
selectedValue: s,
|
|
191
|
-
calendarPageInfo: N,
|
|
192
|
-
calendarYearRangeInfo: W,
|
|
193
|
-
calendarMonth: fe,
|
|
194
|
-
dayOfTheWeekList: he,
|
|
195
|
-
selectedListType: u
|
|
196
|
-
// isContinuousMonths,
|
|
197
|
-
};
|
|
198
|
-
}, et = (e) => {
|
|
199
|
-
const { props: t } = Oe(), { selectedValue: a, calendarPageInfo: s, calendarYearRangeInfo: r } = e, m = Q({
|
|
200
|
-
main: oe(Ne, ye),
|
|
201
|
-
expanded: oe(Ne, ye)
|
|
202
|
-
}), g = Q({
|
|
203
|
-
main: oe(Re, pe),
|
|
204
|
-
expanded: oe(Re, pe)
|
|
205
|
-
}), D = Q({
|
|
206
|
-
main: oe(Me, Ee),
|
|
207
|
-
expanded: oe(Me, Ee)
|
|
208
|
-
}), N = Q({
|
|
209
|
-
main: {
|
|
210
|
-
hour: [],
|
|
211
|
-
min: [],
|
|
212
|
-
sec: []
|
|
213
|
-
},
|
|
214
|
-
expanded: {
|
|
215
|
-
hour: [],
|
|
216
|
-
min: [],
|
|
217
|
-
sec: []
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
return {
|
|
221
|
-
calendarTableInfo: D,
|
|
222
|
-
calendarMonthTableInfo: g,
|
|
223
|
-
calendarYearTableInfo: m,
|
|
224
|
-
calendarTimeTableInfo: N,
|
|
225
|
-
setCalendarDate: (u) => {
|
|
226
|
-
const i = s[u];
|
|
227
|
-
let T = t.options.disabledDate;
|
|
228
|
-
T && Array.isArray(T) && (T = u === "main" ? T[0] : T[1]);
|
|
229
|
-
const x = ["dateRange", "dateTimeRange"].includes(t.mode), d = ce({
|
|
230
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
231
|
-
month: (/* @__PURE__ */ new Date()).getMonth() + 1,
|
|
232
|
-
date: (/* @__PURE__ */ new Date()).getDate()
|
|
233
|
-
}), O = (k + i.month - 1) % k || k, F = (i.month + 1) % k || k, H = i.month === 1 ? i.year - 1 : i.year, K = i.month === 12 ? i.year + 1 : i.year, B = Ze(i.year, i.month), ee = we(
|
|
234
|
-
i.month === 1 ? i.year - 1 : i.year,
|
|
235
|
-
(k + i.month - 1) % k || k
|
|
236
|
-
), R = we(i.year, i.month);
|
|
237
|
-
let v = "";
|
|
238
|
-
t.mode.includes("Time") && (t.mode === "dateTime" ? v = a.value : v = u === "main" ? a.value[0] : a.value[1]);
|
|
239
|
-
let $ = 0, S = 0, A = 0, w = 0, L = "";
|
|
240
|
-
const n = (l, o, c) => {
|
|
241
|
-
var Z, te, q;
|
|
242
|
-
L = ce({ year: S, month: A, date: w });
|
|
243
|
-
const p = (v == null ? void 0 : v.split(" ")[1]) ?? "", y = x && !T && Te(t.mode, u, L, a.value) || +/* @__PURE__ */ new Date(`${L} ${p}`) < ge, f = T && T(/* @__PURE__ */ new Date(`${L} ${p}`)) || y, E = +(u !== "main"), C = x && a.value.length > E && ((te = (Z = a.value) == null ? void 0 : Z[E]) == null ? void 0 : te.includes(L)), _ = !f && (x ? C : (q = a.value) == null ? void 0 : q.includes(L));
|
|
244
|
-
D[u][o][c] = {
|
|
245
|
-
monthType: `${l}${f ? " disabled" : ""}`,
|
|
246
|
-
isToday: d === L,
|
|
247
|
-
isSelected: _,
|
|
248
|
-
year: S,
|
|
249
|
-
month: A,
|
|
250
|
-
date: w
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
for (let l = 0; l < Me; l++)
|
|
254
|
-
for (let o = 0; o < Ee; o++)
|
|
255
|
-
l === 0 ? B !== 0 ? o < B ? (S = H, A = O, w = ee - B + 1 + o, n("prev", l, o)) : ($++, S = i.year, A = i.month, w = $, n("", l, o)) : (S = H, A = O, w = ee - 6 + o, n("prev", l, o)) : R <= $ ? ($++, S = K, A = F, w = $ - R, n("next", l, o)) : ($++, S = i.year, A = i.month, w = $, n("", l, o));
|
|
256
|
-
},
|
|
257
|
-
setCalendarMonth: (u) => {
|
|
258
|
-
let i = 0;
|
|
259
|
-
const T = (/* @__PURE__ */ new Date()).getFullYear(), x = (/* @__PURE__ */ new Date()).getMonth() + 1, { year: d, month: O } = s[u];
|
|
260
|
-
for (let F = 0; F < Re; F++)
|
|
261
|
-
for (let H = 0; H < pe; H++)
|
|
262
|
-
g[u][F][H] = {
|
|
263
|
-
label: Ie.abbrName[i++],
|
|
264
|
-
value: i,
|
|
265
|
-
today: d === T && i === x,
|
|
266
|
-
isSelected: i === O
|
|
267
|
-
};
|
|
268
|
-
},
|
|
269
|
-
setCalendarYear: (u) => {
|
|
270
|
-
let i = r[u].start;
|
|
271
|
-
const T = (/* @__PURE__ */ new Date()).getFullYear(), x = new Date(ge).getFullYear();
|
|
272
|
-
for (let d = 0; d < Ne; d++)
|
|
273
|
-
for (let O = 0; O < ye; O++)
|
|
274
|
-
m[u][d][O] = {
|
|
275
|
-
label: i,
|
|
276
|
-
value: i,
|
|
277
|
-
today: i === T,
|
|
278
|
-
isSelected: i === s[u].year,
|
|
279
|
-
disabled: i < x
|
|
280
|
-
}, i++;
|
|
281
|
-
},
|
|
282
|
-
setHmsTime: () => {
|
|
283
|
-
var B, ee;
|
|
284
|
-
const u = (B = t.options) == null ? void 0 : B.timeFormat, i = (ee = t.options) == null ? void 0 : ee.disabledDate, T = Array.isArray(u) ? u[0] : u, x = Array.isArray(u) ? u[1] : "", d = t.mode === "dateTimeRange" ? a.value[0] : a.value, O = t.mode === "dateTimeRange" ? a.value[1] : "", F = Array.isArray(i) ? i[0] : i, H = Array.isArray(i) ? i[1] : i, K = (R, v, $) => {
|
|
285
|
-
const S = R === "main" ? d : O, A = R === "main" ? F : H;
|
|
286
|
-
if (!S)
|
|
287
|
-
return !1;
|
|
288
|
-
const w = S.split(" ")[0];
|
|
289
|
-
let L = b(S, "hour"), n = b(S, "min"), l = b(S, "sec");
|
|
290
|
-
v === "hour" ? L = $ : v === "min" ? n = $ : v === "sec" && (l = $);
|
|
291
|
-
const o = `${w} ${I(L)}:${I(n)}:${I(l)}`;
|
|
292
|
-
return A && A(new Date(o)) ? !0 : !A && Te(t.mode, R, o, a.value);
|
|
293
|
-
};
|
|
294
|
-
["hour", "min", "sec"].forEach((R) => {
|
|
295
|
-
let v = Je;
|
|
296
|
-
R === "hour" ? v = Be : R === "min" && (v = Ge);
|
|
297
|
-
const $ = d && d.length > 0 ? ue(T, d, R) : -1, S = O && O.length > 0 ? ue(x, O, R) : -1;
|
|
298
|
-
for (let A = 0; A < v; A++) {
|
|
299
|
-
let w = t.mode === "dateTimeRange" && K("main", R, A);
|
|
300
|
-
N.main[R][A] = {
|
|
301
|
-
timeType: R,
|
|
302
|
-
num: A,
|
|
303
|
-
isSelected: !w && $ === A,
|
|
304
|
-
isDisabled: w
|
|
305
|
-
}, t.mode === "dateTimeRange" && (w = K("expanded", R, A), N.expanded[R][A] = {
|
|
306
|
-
timeType: R,
|
|
307
|
-
num: A,
|
|
308
|
-
isSelected: !w && S === A,
|
|
309
|
-
isDisabled: w
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
},
|
|
314
|
-
getTimeInfo: (u, i, T, x) => {
|
|
315
|
-
const d = s[x], O = N[x], F = d[u] - 1, H = i - 1, K = T - 1, B = F * X + H * $e + K;
|
|
316
|
-
return O[u][B];
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
}, tt = (e) => {
|
|
320
|
-
var L;
|
|
321
|
-
const { props: t, emit: a } = Oe(), s = (L = t.options) == null ? void 0 : L.timeFormat, {
|
|
322
|
-
selectedValue: r,
|
|
323
|
-
calendarPageInfo: m,
|
|
324
|
-
calendarTimeTableInfo: g,
|
|
325
|
-
setCalendarDate: D,
|
|
326
|
-
setCalendarMonth: N,
|
|
327
|
-
setCalendarYear: W,
|
|
328
|
-
setHmsTime: le,
|
|
329
|
-
selectedListType: j
|
|
330
|
-
} = e, fe = z(""), he = z(null), u = Array.isArray(s) ? s[0] : s, i = Array.isArray(s) ? s[1] : "", T = {
|
|
331
|
-
main: {
|
|
332
|
-
hour: u && u.split(":")[0] !== "HH",
|
|
333
|
-
min: u && u.split(":")[1] !== "mm",
|
|
334
|
-
sec: u && u.split(":")[2] !== "ss"
|
|
335
|
-
},
|
|
336
|
-
expanded: {
|
|
337
|
-
hour: i && i.split(":")[0] !== "HH",
|
|
338
|
-
min: i && i.split(":")[1] !== "mm",
|
|
339
|
-
sec: i && i.split(":")[2] !== "ss"
|
|
340
|
-
}
|
|
341
|
-
}, x = (n, l) => {
|
|
342
|
-
const o = m[n], { year: c, month: p, hour: y, min: f, sec: E } = l;
|
|
343
|
-
c && (o.year = c), p && (o.month = p), y && (o.hour = y), f && (o.min = f), E && (o.sec = E);
|
|
344
|
-
}, d = (n) => {
|
|
345
|
-
n == null || n.forEach((l, o) => {
|
|
346
|
-
const c = o === 0 ? "main" : "expanded";
|
|
347
|
-
x(c, {
|
|
348
|
-
year: b(l, "year"),
|
|
349
|
-
month: b(l, "month"),
|
|
350
|
-
hour: Math.floor(b(l, "hour") / X) + 1,
|
|
351
|
-
min: Math.floor(b(l, "min") / X) + 1,
|
|
352
|
-
sec: Math.floor(b(l, "sec") / X) + 1
|
|
353
|
-
}), D(c);
|
|
354
|
-
});
|
|
355
|
-
}, O = (n, l) => {
|
|
356
|
-
const o = j[n] === P.MONTH ? 1 : 20, c = l === "prev" ? -o : o, p = new Date(ge).getFullYear(), y = m[n].year + c;
|
|
357
|
-
m[n].year = y < p ? p : y;
|
|
358
|
-
}, F = (n, l) => {
|
|
359
|
-
const o = m[n];
|
|
360
|
-
if (l === "prev") {
|
|
361
|
-
const c = new Date(ge).getFullYear();
|
|
362
|
-
if (o.year === c && o.month === 1)
|
|
363
|
-
return;
|
|
364
|
-
o.month === 1 ? (o.year -= 1, o.month = 12) : o.month -= 1;
|
|
365
|
-
} else o.month === 12 ? (o.year += 1, o.month = 1) : o.month += 1;
|
|
366
|
-
}, H = (n, l) => {
|
|
367
|
-
switch (j[n]) {
|
|
368
|
-
case P.DATE: {
|
|
369
|
-
F(n, l), D(n);
|
|
370
|
-
break;
|
|
371
|
-
}
|
|
372
|
-
case P.MONTH:
|
|
373
|
-
O(n, l), N(n);
|
|
374
|
-
break;
|
|
375
|
-
case P.YEAR:
|
|
376
|
-
O(n, l), W(n);
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
}, K = (n, l) => {
|
|
380
|
-
l === P.DATE ? D(n) : l === P.MONTH ? N(n) : l === P.YEAR && W(n), j[n] = l;
|
|
381
|
-
}, B = (n, l) => {
|
|
382
|
-
const { value: o } = l;
|
|
383
|
-
l.disabled || (j[n] === P.YEAR ? (m[n].year = o, j[n] = P.MONTH, N(n)) : (m[n].month = o, j[n] = P.DATE, D(n)));
|
|
384
|
-
}, ee = (n, l) => {
|
|
385
|
-
var de, me, M, G;
|
|
386
|
-
const { year: o, month: c, date: p, monthType: y } = l, f = ce({ year: o, month: c, date: p }), E = t.modelValue ? (Array.isArray(t.modelValue) ? ((de = t.modelValue) == null ? void 0 : de.map((h) => h == null ? void 0 : h.split(" ")[0])) ?? [] : t.modelValue.split(" ")[0]).includes(f) : !1;
|
|
387
|
-
let C = t.options.disabledDate;
|
|
388
|
-
if (C && Array.isArray(C) && (C = n === "main" ? C[0] : C[1]), C && C(new Date(f)) && !E)
|
|
389
|
-
return;
|
|
390
|
-
if (!C && ["dateRange", "dateTimeRange"].includes(t.mode) && Te(t.mode, n, f, r.value))
|
|
391
|
-
return;
|
|
392
|
-
const _ = m[n], Z = (k + _.month - 1) % k || k, te = _.month === 1 ? _.year - 1 : _.year, q = (_.month + 1) % k || k, ie = _.month === 12 ? _.year + 1 : _.year, re = () => {
|
|
393
|
-
y.includes("prev") ? (_.year = te, _.month = Z) : y.includes("next") && (_.year = ie, _.month = q);
|
|
394
|
-
};
|
|
395
|
-
switch (t.mode) {
|
|
396
|
-
case "date":
|
|
397
|
-
a("update:modelValue", f);
|
|
398
|
-
break;
|
|
399
|
-
case "dateTime": {
|
|
400
|
-
const V = !!((me = r.value) != null && me.split(" ")[1]) ? (M = r.value) == null ? void 0 : M.split(" ")[1] : "00:00:00", Y = U(
|
|
401
|
-
s,
|
|
402
|
-
`${f} ${V}`
|
|
403
|
-
);
|
|
404
|
-
a("update:modelValue", Y);
|
|
405
|
-
break;
|
|
406
|
-
}
|
|
407
|
-
case "dateMulti": {
|
|
408
|
-
const h = t.options.multiType, V = t.options.multiDayLimit;
|
|
409
|
-
if (h === "date") {
|
|
410
|
-
const Y = r.value.indexOf(f);
|
|
411
|
-
Y > -1 ? (r.value.splice(Y, 1), a("update:modelValue", [...r.value])) : r.value.length < V && (r.value.push(f), re(), a("update:modelValue", [...r.value]));
|
|
412
|
-
} else if (h === "week" || h === "weekday") {
|
|
413
|
-
const Y = h === "week" ? 7 : 5, J = h === "week" ? 6 : 5, Ce = /* @__PURE__ */ new Date(`${f} 00:00:00`), Ye = Ce.getDay(), He = J - Ye, Ae = Ce.getTime() + De * He;
|
|
414
|
-
for (let ne = 0; ne < Y; ne++) {
|
|
415
|
-
const Le = new Date(Ae - ne * De).getFullYear(), ke = new Date(Ae - ne * De).getMonth() + 1, Pe = new Date(Ae - ne * De).getDate(), _e = `${Le}-${I(ke)}-${I(Pe)}`;
|
|
416
|
-
if (ne === 0)
|
|
417
|
-
if (r.value.includes(_e)) {
|
|
418
|
-
r.value.splice(0);
|
|
419
|
-
break;
|
|
420
|
-
} else
|
|
421
|
-
r.value.splice(0), re();
|
|
422
|
-
(!C || !C(new Date(_e))) && r.value.unshift(_e);
|
|
423
|
-
}
|
|
424
|
-
a("update:modelValue", [...r.value]);
|
|
425
|
-
}
|
|
426
|
-
D("main");
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
case "dateRange": {
|
|
430
|
-
let h = [...r.value];
|
|
431
|
-
if (!r.value.length)
|
|
432
|
-
h = [f, f];
|
|
433
|
-
else {
|
|
434
|
-
const V = +(n === "expanded");
|
|
435
|
-
h[V] = f;
|
|
436
|
-
}
|
|
437
|
-
a("update:modelValue", h);
|
|
438
|
-
break;
|
|
439
|
-
}
|
|
440
|
-
case "dateTimeRange": {
|
|
441
|
-
let h = [...r.value];
|
|
442
|
-
if (h.length) {
|
|
443
|
-
const V = +(n === "expanded"), Y = ((G = h[V]) == null ? void 0 : G.split(" ")[1]) || "00:00:00";
|
|
444
|
-
let J = `${f} ${Y}`;
|
|
445
|
-
s && s.length && (J = U(s[V], J)), h[V] = J;
|
|
446
|
-
} else {
|
|
447
|
-
let V = `${f} 00:00:00`, Y = `${f} 00:00:00`;
|
|
448
|
-
s && s.length && (V = U(s[0], V), Y = U(s[1], Y)), h = [V, Y];
|
|
449
|
-
}
|
|
450
|
-
a("update:modelValue", h);
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}, R = (n, l, o) => {
|
|
455
|
-
if (T[n][l])
|
|
456
|
-
return;
|
|
457
|
-
const c = m[n], p = 1;
|
|
458
|
-
l === "hour" ? o === "down" && c.hour < 2 ? c.hour++ : o === "up" && c.hour > p && c.hour-- : l === "min" ? o === "down" && c.min < 5 ? c.min++ : o === "up" && c.min > p && c.min-- : l === "sec" && (o === "down" && c.sec < 5 ? c.sec++ : o === "up" && c.sec > p && c.sec--);
|
|
459
|
-
}, v = (n, l, o, c) => {
|
|
460
|
-
var me;
|
|
461
|
-
if (T[n][l])
|
|
462
|
-
return;
|
|
463
|
-
const p = m[n], y = g[n], f = p[l] - 1, E = o - 1, C = c - 1, _ = f * X + E * $e + C;
|
|
464
|
-
if ((me = y[l][_]) != null && me.isDisabled)
|
|
465
|
-
return;
|
|
466
|
-
const Z = /* @__PURE__ */ new Date(), te = {
|
|
467
|
-
year: Z.getFullYear(),
|
|
468
|
-
month: Z.getMonth() + 1,
|
|
469
|
-
date: Z.getDate()
|
|
470
|
-
};
|
|
471
|
-
let q = !0, ie = [];
|
|
472
|
-
const re = () => {
|
|
473
|
-
let M;
|
|
474
|
-
return l === "hour" ? M = `${I(_)}:00:00'` : l === "min" ? M = `00:${I(_)}:00` : l === "sec" && (M = `00:00:${I(_)}`), `${ce(te)} ${M}`;
|
|
475
|
-
}, de = (M) => {
|
|
476
|
-
let J = 11;
|
|
477
|
-
return l === "min" ? J = 14 : l === "sec" && (J = 17), `${M == null ? void 0 : M.substr(0, J)}${I(_)}${M == null ? void 0 : M.substr(J + 2)}`;
|
|
478
|
-
};
|
|
479
|
-
if (t.mode === "dateTime") {
|
|
480
|
-
let M;
|
|
481
|
-
t.modelValue ? M = U(s, de(t.modelValue)) : (q = !1, M = U(s, re())), a("update:modelValue", M), ie.push(M);
|
|
482
|
-
} else {
|
|
483
|
-
const M = n !== "main" | 0;
|
|
484
|
-
let G = [...r.value];
|
|
485
|
-
if (t.modelValue.length) {
|
|
486
|
-
let h = de(t.modelValue[M]);
|
|
487
|
-
s && s.length && (h = U(s[M], h)), G[M] = h;
|
|
488
|
-
} else {
|
|
489
|
-
const h = re();
|
|
490
|
-
G = [h, h], s && s.length && (G = [
|
|
491
|
-
...G.map((V, Y) => U(s[Y], V))
|
|
492
|
-
]), q = !1, ie = G;
|
|
493
|
-
}
|
|
494
|
-
a("update:modelValue", G);
|
|
495
|
-
}
|
|
496
|
-
le(), q || d(ie);
|
|
497
|
-
}, $ = (n, l) => {
|
|
498
|
-
H(n, l.deltaY > 0 ? "next" : "prev");
|
|
499
|
-
}, S = (n, l, o) => {
|
|
500
|
-
T[n][l] || R(n, l, o.deltaY > 0 ? "down" : "up");
|
|
501
|
-
}, A = We((n, l) => {
|
|
502
|
-
const o = l.target.tagName === "TD" ? l.target : l.target.parentElement, c = o.classList.contains("disabled"), p = o.classList.contains("prev"), y = o.classList.contains("next");
|
|
503
|
-
if (o.classList.length > 0 && !c) {
|
|
504
|
-
const f = m[n];
|
|
505
|
-
let E = {
|
|
506
|
-
year: +f.year,
|
|
507
|
-
month: +f.month,
|
|
508
|
-
date: l.target.innerText
|
|
509
|
-
};
|
|
510
|
-
p ? E = {
|
|
511
|
-
...E,
|
|
512
|
-
...Ve("prev", E.year, E.month)
|
|
513
|
-
} : y && (E = {
|
|
514
|
-
...E,
|
|
515
|
-
...Ve("next", E.year, E.month)
|
|
516
|
-
});
|
|
517
|
-
const C = fe.value, _ = ce({
|
|
518
|
-
year: E.year,
|
|
519
|
-
month: E.month,
|
|
520
|
-
date: E.date
|
|
521
|
-
});
|
|
522
|
-
se(_) < se(C) ? (r.value[0] = _, r.value[1] = C) : (r.value[0] = C, r.value[1] = _), D("main"), D("expanded");
|
|
523
|
-
}
|
|
524
|
-
}, 10), w = (n) => {
|
|
525
|
-
const l = ["dateRange", "dateMulti", "dateTimeRange"].includes(t.mode), o = t.options.disabledDate;
|
|
526
|
-
if (l) {
|
|
527
|
-
const [c, p] = r.value;
|
|
528
|
-
let [y, f] = [o, o];
|
|
529
|
-
if (o && Array.isArray(o) && ([y, f] = o), n[0] && n[0] !== c && y && y(new Date(n[0])))
|
|
530
|
-
return !0;
|
|
531
|
-
if (n[1] && n[1] !== p && f && f(new Date(n[1])))
|
|
532
|
-
return !0;
|
|
533
|
-
if (!o && Te(t.mode, "main", n[0], n))
|
|
534
|
-
return !0;
|
|
535
|
-
} else {
|
|
536
|
-
if (t.mode === "dateMulti")
|
|
537
|
-
return n.some((c) => o && o(new Date(c)));
|
|
538
|
-
if (o && o(new Date(n)))
|
|
539
|
-
return !0;
|
|
540
|
-
}
|
|
541
|
-
return !1;
|
|
542
|
-
};
|
|
543
|
-
return Ue(
|
|
544
|
-
() => t.modelValue,
|
|
545
|
-
(n) => {
|
|
546
|
-
if (w(n)) {
|
|
547
|
-
a("update:modelValue", r.value);
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const l = ["dateRange", "dateMulti", "dateTimeRange"].includes(t.mode);
|
|
551
|
-
if (r.value = l ? [...n] : n, t.mode === "dateRange")
|
|
552
|
-
d(n);
|
|
553
|
-
else if (t.mode.includes("Time")) {
|
|
554
|
-
let o = [];
|
|
555
|
-
t.mode === "dateTime" ? o = [n] : t.mode === "dateTimeRange" && (o = n), d(o), le();
|
|
556
|
-
} else t.mode === "date" && d([n]);
|
|
557
|
-
}
|
|
558
|
-
), {
|
|
559
|
-
clickYearMonthBtn: K,
|
|
560
|
-
clickPrevNextBtn: H,
|
|
561
|
-
clickDate: ee,
|
|
562
|
-
clickYearMonth: B,
|
|
563
|
-
clickHmsBtn: R,
|
|
564
|
-
clickTime: v,
|
|
565
|
-
wheelMonth: $,
|
|
566
|
-
wheelTime: S,
|
|
567
|
-
calendarEventName: he,
|
|
568
|
-
onMousemoveDate: A,
|
|
569
|
-
preventTimeEventType: T
|
|
570
|
-
};
|
|
571
|
-
};
|
|
572
|
-
export {
|
|
573
|
-
U as getChangedValueByTimeFormat,
|
|
574
|
-
we as getLastDateOfMonth,
|
|
575
|
-
I as lpadToTwoDigits,
|
|
576
|
-
et as useCalendarDate,
|
|
577
|
-
tt as useEvent,
|
|
578
|
-
Qe as useModel
|
|
579
|
-
};
|