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,70 @@
|
|
|
1
|
+
import { resolveComponent as f, resolveDirective as p, openBlock as m, createBlock as u, Teleport as h, withDirectives as y, normalizeStyle as S, normalizeClass as w, createSlots as C, renderList as _, withCtx as k, renderSlot as v, normalizeProps as M, guardReactiveProps as x, createCommentVNode as b, onBeforeMount as A } from "vue";
|
|
2
|
+
import { clickoutside as B } from "../../directives/clickoutside.js";
|
|
3
|
+
import E from "./MenuList.vue.js";
|
|
4
|
+
import { useModel as L, usePosition as g } from "./uses.js";
|
|
5
|
+
import z from "../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const D = {
|
|
7
|
+
name: "EvContextMenu",
|
|
8
|
+
directives: {
|
|
9
|
+
clickoutside: B
|
|
10
|
+
},
|
|
11
|
+
components: {
|
|
12
|
+
MenuList: E
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
items: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => [],
|
|
18
|
+
validator: (o) => o.some((e) => e.children !== void 0 && !Array.isArray(e.children)) ? (console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."), !1) : o.some((e) => e.click !== void 0 && typeof e.click != "function") ? (console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."), !1) : !0
|
|
19
|
+
},
|
|
20
|
+
customClass: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
isShowMenuOnClick: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup() {
|
|
30
|
+
const { comp: o, initWrapperDiv: e } = L(), { isShow: n, rootMenuList: t, menuStyle: i, show: s, hide: r } = g();
|
|
31
|
+
return A(() => e()), {
|
|
32
|
+
isShow: n,
|
|
33
|
+
rootMenuList: t,
|
|
34
|
+
menuStyle: i,
|
|
35
|
+
comp: o,
|
|
36
|
+
show: s,
|
|
37
|
+
hide: r
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
function P(o, e, n, t, i, s) {
|
|
42
|
+
const r = f("menu-list"), a = p("clickoutside");
|
|
43
|
+
return t.isShow && n.items.length ? (m(), u(h, {
|
|
44
|
+
key: 0,
|
|
45
|
+
to: "#ev-context-menu-modal"
|
|
46
|
+
}, [
|
|
47
|
+
y((m(), u(r, {
|
|
48
|
+
ref: "rootMenuList",
|
|
49
|
+
isShow: t.isShow,
|
|
50
|
+
"onUpdate:isShow": e[0] || (e[0] = (c) => t.isShow = c),
|
|
51
|
+
class: w(n.customClass),
|
|
52
|
+
items: n.items,
|
|
53
|
+
style: S(t.menuStyle),
|
|
54
|
+
comp: t.comp
|
|
55
|
+
}, C({ _: 2 }, [
|
|
56
|
+
_(o.$slots, (c, l) => ({
|
|
57
|
+
name: l,
|
|
58
|
+
fn: k((d) => [
|
|
59
|
+
v(o.$slots, l, M(x(d)))
|
|
60
|
+
])
|
|
61
|
+
}))
|
|
62
|
+
]), 1032, ["isShow", "class", "items", "style", "comp"])), [
|
|
63
|
+
[a, t.hide]
|
|
64
|
+
])
|
|
65
|
+
])) : b("", !0);
|
|
66
|
+
}
|
|
67
|
+
const R = /* @__PURE__ */ z(D, [["render", P]]);
|
|
68
|
+
export {
|
|
69
|
+
R as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useMenuList as _ } from "./uses.js";
|
|
2
|
+
import { openBlock as s, createElementBlock as r, createElementVNode as h, Fragment as m, renderList as f, withDirectives as y, normalizeClass as p, createCommentVNode as a, renderSlot as C, createTextVNode as S, toDisplayString as w, vShow as k, createBlock as v, resolveDynamicComponent as M, normalizeStyle as x, createSlots as I, withCtx as E, normalizeProps as b, guardReactiveProps as g } from "vue";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import A from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const B = {
|
|
6
|
+
name: "EvMenuList",
|
|
7
|
+
props: {
|
|
8
|
+
isShow: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: !1
|
|
11
|
+
},
|
|
12
|
+
items: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => [],
|
|
15
|
+
validator: (o) => o.some((n) => n.children !== void 0 && !Array.isArray(n.children)) ? (console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."), !1) : o.some((n) => n.click !== void 0 && typeof n.click != "function") ? (console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."), !1) : !0
|
|
16
|
+
},
|
|
17
|
+
comp: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
emits: {
|
|
24
|
+
"update:isShow": [Boolean]
|
|
25
|
+
},
|
|
26
|
+
setup() {
|
|
27
|
+
const {
|
|
28
|
+
isExistChild: o,
|
|
29
|
+
computedIsShow: n,
|
|
30
|
+
isShowChild: c,
|
|
31
|
+
childMenu: t,
|
|
32
|
+
menuStyle: d,
|
|
33
|
+
childrenItems: u,
|
|
34
|
+
handleItemClick: e,
|
|
35
|
+
handleMouseEnter: l,
|
|
36
|
+
hideAll: i
|
|
37
|
+
} = _();
|
|
38
|
+
return {
|
|
39
|
+
isExistChild: o,
|
|
40
|
+
computedIsShow: n,
|
|
41
|
+
isShowChild: c,
|
|
42
|
+
childMenu: t,
|
|
43
|
+
menuStyle: d,
|
|
44
|
+
childrenItems: u,
|
|
45
|
+
handleItemClick: e,
|
|
46
|
+
handleMouseEnter: l,
|
|
47
|
+
hideAll: i
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}, V = { class: "ev-menu-list" }, L = { class: "ev-menu-ul" }, z = ["onClick", "onMouseenter"], D = { class: "ev-menu-li-text" }, U = {
|
|
51
|
+
key: 1,
|
|
52
|
+
class: "ev-menu-li-suffix ev-icon-arrow-right2"
|
|
53
|
+
};
|
|
54
|
+
function F(o, n, c, t, d, u) {
|
|
55
|
+
return s(), r("div", V, [
|
|
56
|
+
h("ul", L, [
|
|
57
|
+
(s(!0), r(m, null, f(c.items, (e, l) => y((s(), r("li", {
|
|
58
|
+
key: `${e.value}_${l}`,
|
|
59
|
+
class: p(["ev-menu-li", { disabled: e.disabled, [e.itemClass]: e.itemClass }]),
|
|
60
|
+
onClick: (i) => t.handleItemClick(e),
|
|
61
|
+
onMouseenter: (i) => t.handleMouseEnter(i, e)
|
|
62
|
+
}, [
|
|
63
|
+
e.iconClass ? (s(), r("i", {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: p(["ev-menu-li-prefix", e.iconClass])
|
|
66
|
+
}, null, 2)) : a("", !0),
|
|
67
|
+
h("span", D, [
|
|
68
|
+
e.slotKey ? C(o.$slots, e.slotKey, {
|
|
69
|
+
key: 0,
|
|
70
|
+
item: e
|
|
71
|
+
}, () => [
|
|
72
|
+
S(w(e.text), 1)
|
|
73
|
+
]) : (s(), r(m, { key: 1 }, [
|
|
74
|
+
S(w(e.text), 1)
|
|
75
|
+
], 64))
|
|
76
|
+
]),
|
|
77
|
+
e.children || e.isShowMenu ? (s(), r("i", U)) : a("", !0)
|
|
78
|
+
], 42, z)), [
|
|
79
|
+
[k, !e.hidden]
|
|
80
|
+
])), 128))
|
|
81
|
+
]),
|
|
82
|
+
t.isExistChild ? y((s(), v(M(c.comp), {
|
|
83
|
+
key: 0,
|
|
84
|
+
ref: "childMenu",
|
|
85
|
+
isShow: t.computedIsShow,
|
|
86
|
+
"onUpdate:isShow": n[0] || (n[0] = (e) => t.computedIsShow = e),
|
|
87
|
+
comp: c.comp,
|
|
88
|
+
items: t.childrenItems,
|
|
89
|
+
style: x(t.menuStyle)
|
|
90
|
+
}, I({ _: 2 }, [
|
|
91
|
+
f(o.$slots, (e, l) => ({
|
|
92
|
+
name: l,
|
|
93
|
+
fn: E((i) => [
|
|
94
|
+
C(o.$slots, l, b(g(i)))
|
|
95
|
+
])
|
|
96
|
+
}))
|
|
97
|
+
]), 1064, ["isShow", "comp", "items", "style"])), [
|
|
98
|
+
[k, t.childrenItems.length && t.isShowChild]
|
|
99
|
+
]) : a("", !0)
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
const O = /* @__PURE__ */ A(B, [["render", F]]);
|
|
103
|
+
export {
|
|
104
|
+
O as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineComponent as L, ref as u, getCurrentInstance as H, computed as w, reactive as S, nextTick as M } from "vue";
|
|
2
|
+
import O from "./MenuList.vue.js";
|
|
3
|
+
const F = () => {
|
|
4
|
+
const s = L(O), r = u([]);
|
|
5
|
+
return {
|
|
6
|
+
comp: s,
|
|
7
|
+
childrenItems: r,
|
|
8
|
+
initWrapperDiv: () => {
|
|
9
|
+
const o = document.createElement("div");
|
|
10
|
+
o.id = "ev-context-menu-modal", o.setAttribute("style", "position: absolute; top: 0; left: 0;"), document.getElementById("ev-context-menu-modal") || document.body.appendChild(o);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}, P = () => {
|
|
14
|
+
const { props: s } = H(), r = w(() => s.isShowMenuOnClick), l = u(!1), o = u(null), n = S({
|
|
15
|
+
top: null,
|
|
16
|
+
left: null,
|
|
17
|
+
right: null,
|
|
18
|
+
pageY: null,
|
|
19
|
+
pageX: null,
|
|
20
|
+
clientX: null
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
isShow: l,
|
|
24
|
+
rootMenuList: o,
|
|
25
|
+
menuStyle: n,
|
|
26
|
+
show: async (t) => {
|
|
27
|
+
var h, p;
|
|
28
|
+
l.value = !0, await M();
|
|
29
|
+
const c = (p = (h = o.value) == null ? void 0 : h.$el) == null ? void 0 : p.children[0].getBoundingClientRect();
|
|
30
|
+
if (c) {
|
|
31
|
+
const m = c.height, e = c.width, i = document.documentElement.clientHeight, g = document.documentElement.clientWidth, f = 20;
|
|
32
|
+
n.pageX = t.pageX, n.pageY = t.pageY, n.clientX = t.clientX, i < t.clientY + m ? n.top = `${t.pageY - m}px` : n.top = `${t.pageY}px`, g < t.clientX + e + f ? n.left = `${t.pageX - e}px` : n.left = `${t.pageX}px`;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
hide: async () => {
|
|
36
|
+
await M(), !r.value && (l.value = !1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}, _ = () => {
|
|
40
|
+
const { props: s, emit: r } = H(), l = w({
|
|
41
|
+
get: () => s.isShow,
|
|
42
|
+
set: (e) => r("update:isShow", e)
|
|
43
|
+
}), o = w(() => !!s.items.some((e) => e.children)), n = u([]), d = u(!1), a = u(null), t = S({
|
|
44
|
+
top: null,
|
|
45
|
+
left: null,
|
|
46
|
+
right: null
|
|
47
|
+
}), c = (e) => {
|
|
48
|
+
e || (l.value = !1);
|
|
49
|
+
}, h = (e) => {
|
|
50
|
+
var R, X, y;
|
|
51
|
+
const i = document.documentElement.clientWidth, g = document.documentElement.clientHeight, f = 20, W = (R = e.target.parentElement) == null ? void 0 : R.getBoundingClientRect(), {
|
|
52
|
+
x: $,
|
|
53
|
+
y: b,
|
|
54
|
+
width: v,
|
|
55
|
+
height: I
|
|
56
|
+
} = W, k = (y = (X = a.value) == null ? void 0 : X.$el) == null ? void 0 : y.children[0].getBoundingClientRect(), { width: x, height: C } = k, E = e.target.offsetTop, Y = g < b + E + C, B = i < $ + v + x + f;
|
|
57
|
+
Y ? t.top = `${I - C}px` : t.top = `${E}px`, B ? t.left = `${0 - x}px` : t.left = `${v}px`;
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
computedIsShow: l,
|
|
61
|
+
isExistChild: o,
|
|
62
|
+
isShowChild: d,
|
|
63
|
+
childMenu: a,
|
|
64
|
+
menuStyle: t,
|
|
65
|
+
childrenItems: n,
|
|
66
|
+
handleItemClick: (e) => {
|
|
67
|
+
e.click && !e.disabled && e.click(e), e.isShowMenu || c(e.children);
|
|
68
|
+
},
|
|
69
|
+
handleMouseEnter: async (e, i) => {
|
|
70
|
+
!i.children || !Array.isArray(i.children) || i.disabled ? d.value = !1 : (d.value = !0, n.value = i.children, await M(), h(e));
|
|
71
|
+
},
|
|
72
|
+
hideAll: c
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
_ as useMenuList,
|
|
77
|
+
F as useModel,
|
|
78
|
+
P as usePosition
|
|
79
|
+
};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { datePickerClickoutside as E } from "../../directives/clickoutside.js";
|
|
2
|
+
import { useModel as B, useDropdown as U, useShortcuts as K } from "./uses.js";
|
|
3
|
+
import { resolveComponent as S, resolveDirective as W, withDirectives as v, openBlock as a, createElementBlock as i, normalizeClass as m, createElementVNode as n, Fragment as c, withKeys as x, withModifiers as y, vModelText as h, renderList as T, toDisplayString as k, createCommentVNode as d, vShow as j, normalizeStyle as z, createBlock as w, withCtx as C, createTextVNode as I, createVNode as H } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import q from "../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const G = {
|
|
7
|
+
name: "EvDatePicker",
|
|
8
|
+
directives: {
|
|
9
|
+
clickoutside: E
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: [String, Array],
|
|
14
|
+
default: "",
|
|
15
|
+
validator: (r) => {
|
|
16
|
+
const t = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/), l = new RegExp(
|
|
17
|
+
/[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]/
|
|
18
|
+
);
|
|
19
|
+
return Array.isArray(r) ? r.every(
|
|
20
|
+
(e) => !!(!e || e.length === 10 && t.exec(e)) || e.length === 19 && l.exec(e)
|
|
21
|
+
) : !!(!r || r.length === 10 && t.exec(r) || r.length === 19 && l.exec(r));
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
clearable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
enableTextInput: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
mode: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "date",
|
|
43
|
+
validator: (r) => ["date", "dateTime", "dateMulti", "dateRange", "dateTimeRange"].indexOf(r) !== -1
|
|
44
|
+
},
|
|
45
|
+
monthNotation: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "fullName",
|
|
48
|
+
validator: (r) => ["fullName", "abbrName", "numberName", "korName"].indexOf(r) !== -1
|
|
49
|
+
},
|
|
50
|
+
dayOfTheWeekNotation: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "abbrUpperName",
|
|
53
|
+
validator: (r) => ["abbrUpperName", "abbrLowerName", "abbrPascalName", "abbrKorName"].indexOf(r) !== -1
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({
|
|
58
|
+
type: "date",
|
|
59
|
+
limit: 1,
|
|
60
|
+
tagShorten: !1
|
|
61
|
+
}),
|
|
62
|
+
validator: ({ multiType: r, multiDayLimit: t, disabledDate: l, tagShorten: e, timeFormat: s }) => {
|
|
63
|
+
const u = new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);
|
|
64
|
+
return (!r || ["weekday", "week", "date"].indexOf(r) !== -1) && (!t || typeof t == "number" && t > 0) && (!l || typeof l == "function" || Array.isArray(l)) && (e === void 0 || typeof e == "boolean") && Array.isArray(s) ? s.every((p) => !!(!p || u.exec(p))) : !!(!s || u.exec(s));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
shortcuts: {
|
|
68
|
+
type: Array,
|
|
69
|
+
default: () => [],
|
|
70
|
+
validator: (r) => r.length ? r.every(({ shortcutDate: t }) => {
|
|
71
|
+
if (typeof t != "function")
|
|
72
|
+
return !1;
|
|
73
|
+
const l = t();
|
|
74
|
+
return Array.isArray(l) && l.every((e) => e instanceof Date) && l[0] <= l[1] || typeof l == "object" && l instanceof Date;
|
|
75
|
+
}) : !0
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
emits: {
|
|
79
|
+
"update:modelValue": [Array, String]
|
|
80
|
+
},
|
|
81
|
+
setup() {
|
|
82
|
+
const { mv: r, currentValue: t, isClearableIcon: l, validateValue: e, removeAllMv: s, changeMv: u, removeMv: p } = B(), {
|
|
83
|
+
isDropbox: g,
|
|
84
|
+
datePicker: b,
|
|
85
|
+
datePickerWrapper: V,
|
|
86
|
+
dropbox: o,
|
|
87
|
+
itemWrapper: f,
|
|
88
|
+
dropboxPosition: N,
|
|
89
|
+
clickSelectInput: P,
|
|
90
|
+
clickOutsideDropbox: A,
|
|
91
|
+
changeDropboxPosition: M
|
|
92
|
+
} = U(), { usedShortcuts: D, clickShortcut: O, setActiveShortcut: R } = K({
|
|
93
|
+
mv: r,
|
|
94
|
+
currentValue: t,
|
|
95
|
+
clickOutsideDropbox: A
|
|
96
|
+
});
|
|
97
|
+
return R(), {
|
|
98
|
+
mv: r,
|
|
99
|
+
currentValue: t,
|
|
100
|
+
isClearableIcon: l,
|
|
101
|
+
validateValue: e,
|
|
102
|
+
removeAllMv: s,
|
|
103
|
+
changeMv: u,
|
|
104
|
+
removeMv: p,
|
|
105
|
+
isDropbox: g,
|
|
106
|
+
datePicker: b,
|
|
107
|
+
datePickerWrapper: V,
|
|
108
|
+
dropbox: o,
|
|
109
|
+
itemWrapper: f,
|
|
110
|
+
dropboxPosition: N,
|
|
111
|
+
clickSelectInput: P,
|
|
112
|
+
clickOutsideDropbox: A,
|
|
113
|
+
changeDropboxPosition: M,
|
|
114
|
+
usedShortcuts: D,
|
|
115
|
+
clickShortcut: O
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}, J = {
|
|
119
|
+
ref: "datePickerWrapper",
|
|
120
|
+
class: "ev-date-picker__wrapper"
|
|
121
|
+
}, L = ["placeholder", "readonly", "disabled"], Q = ["placeholder", "disabled"], X = { class: "ev-tag-name" }, Y = ["onClick"], Z = {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: "ev-select-tag num"
|
|
124
|
+
}, F = { class: "ev-tag-name" }, _ = { class: "ev-select-tag num" }, $ = { class: "ev-tag-name" }, ee = { class: "ev-date-picker-dropbox-wrapper" }, te = {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "ev-date-picker-dropbox__button-layout"
|
|
127
|
+
}, re = {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "ev-date-picker-dropbox__divider"
|
|
130
|
+
};
|
|
131
|
+
function oe(r, t, l, e, s, u) {
|
|
132
|
+
const p = S("ev-button"), g = S("ev-button-group"), b = S("ev-calendar"), V = W("clickoutside");
|
|
133
|
+
return v((a(), i("div", {
|
|
134
|
+
ref: "datePicker",
|
|
135
|
+
class: m(["ev-date-picker", {
|
|
136
|
+
disabled: r.$props.disabled
|
|
137
|
+
}])
|
|
138
|
+
}, [
|
|
139
|
+
n("div", J, [
|
|
140
|
+
r.$props.mode === "date" || r.$props.mode === "dateTime" ? (a(), i(c, { key: 0 }, [
|
|
141
|
+
t[15] || (t[15] = n("span", { class: "ev-date-picker-prefix-icon" }, [
|
|
142
|
+
n("i", { class: "ev-icon-calendar" })
|
|
143
|
+
], -1)),
|
|
144
|
+
v(n("input", {
|
|
145
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => e.currentValue = o),
|
|
146
|
+
type: "text",
|
|
147
|
+
class: m(["ev-input", { readonly: !r.$props.enableTextInput }]),
|
|
148
|
+
placeholder: r.$props.placeholder,
|
|
149
|
+
readonly: !r.$props.enableTextInput,
|
|
150
|
+
disabled: r.$props.disabled,
|
|
151
|
+
onClick: t[1] || (t[1] = (...o) => e.clickSelectInput && e.clickSelectInput(...o)),
|
|
152
|
+
onKeydown: t[2] || (t[2] = x(y((o) => e.validateValue(e.currentValue), ["prevent"]), ["enter"])),
|
|
153
|
+
onChange: t[3] || (t[3] = (o) => e.validateValue(e.currentValue))
|
|
154
|
+
}, null, 42, L), [
|
|
155
|
+
[
|
|
156
|
+
h,
|
|
157
|
+
e.currentValue,
|
|
158
|
+
void 0,
|
|
159
|
+
{ trim: !0 }
|
|
160
|
+
]
|
|
161
|
+
])
|
|
162
|
+
], 64)) : r.$props.mode === "dateMulti" || !r.$props.enableTextInput ? (a(), i("div", {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: "ev-date-picker-tag-wrapper",
|
|
165
|
+
onClick: t[4] || (t[4] = (...o) => e.clickSelectInput && e.clickSelectInput(...o))
|
|
166
|
+
}, [
|
|
167
|
+
t[18] || (t[18] = n("span", { class: "ev-date-picker-prefix-icon" }, [
|
|
168
|
+
n("i", { class: "ev-icon-calendar" })
|
|
169
|
+
], -1)),
|
|
170
|
+
n("input", {
|
|
171
|
+
type: "text",
|
|
172
|
+
class: "ev-input readonly",
|
|
173
|
+
readonly: "",
|
|
174
|
+
placeholder: r.$props.placeholder,
|
|
175
|
+
disabled: r.$props.disabled
|
|
176
|
+
}, null, 8, Q),
|
|
177
|
+
r.$props.mode === "dateMulti" && (r.$props.options.multiType === "date" || !r.$props.options.tagShorten) ? (a(!0), i(c, { key: 0 }, T(e.mv, (o, f) => (a(), i("div", {
|
|
178
|
+
key: `${o}_${f}`,
|
|
179
|
+
class: m(["ev-select-tag", { num: r.$props.options.multiType !== "date" }])
|
|
180
|
+
}, [
|
|
181
|
+
n("span", X, k(o), 1),
|
|
182
|
+
r.$props.options.multiType === "date" ? (a(), i("span", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "ev-tag-suffix",
|
|
185
|
+
onClick: y((N) => [e.removeMv(o), e.changeDropboxPosition()], ["stop"])
|
|
186
|
+
}, [...t[16] || (t[16] = [
|
|
187
|
+
n("i", { class: "ev-tag-suffix-close ev-icon-error" }, null, -1)
|
|
188
|
+
])], 8, Y)) : d("", !0)
|
|
189
|
+
], 2))), 128)) : (a(), i(c, { key: 1 }, [
|
|
190
|
+
e.mv[0] ? (a(), i("div", Z, [
|
|
191
|
+
n("span", F, k(e.mv[0]), 1)
|
|
192
|
+
])) : d("", !0),
|
|
193
|
+
e.mv[e.mv.length - 1] ? (a(), i(c, { key: 1 }, [
|
|
194
|
+
t[17] || (t[17] = n("div", { class: "ev-select-tag num" }, [
|
|
195
|
+
n("span", { class: "ev-tag-name" }, " ~ ")
|
|
196
|
+
], -1)),
|
|
197
|
+
n("div", _, [
|
|
198
|
+
n("span", $, k(e.mv[e.mv.length - 1]), 1)
|
|
199
|
+
])
|
|
200
|
+
], 64)) : d("", !0)
|
|
201
|
+
], 64))
|
|
202
|
+
])) : (a(), i("div", {
|
|
203
|
+
key: 2,
|
|
204
|
+
class: "ev-date-picker-input-wrapper",
|
|
205
|
+
onClick: t[11] || (t[11] = (...o) => e.clickSelectInput && e.clickSelectInput(...o))
|
|
206
|
+
}, [
|
|
207
|
+
t[20] || (t[20] = n("span", { class: "ev-date-picker-prefix-icon" }, [
|
|
208
|
+
n("i", { class: "ev-icon-calendar" })
|
|
209
|
+
], -1)),
|
|
210
|
+
v(n("input", {
|
|
211
|
+
"onUpdate:modelValue": t[5] || (t[5] = (o) => e.currentValue[0] = o),
|
|
212
|
+
type: "text",
|
|
213
|
+
class: "ev-date-picker-range-input",
|
|
214
|
+
onKeydown: t[6] || (t[6] = x(y((o) => e.validateValue(e.currentValue), ["prevent"]), ["enter"])),
|
|
215
|
+
onChange: t[7] || (t[7] = (o) => e.validateValue(e.currentValue))
|
|
216
|
+
}, null, 544), [
|
|
217
|
+
[
|
|
218
|
+
h,
|
|
219
|
+
e.currentValue[0],
|
|
220
|
+
void 0,
|
|
221
|
+
{ trim: !0 }
|
|
222
|
+
]
|
|
223
|
+
]),
|
|
224
|
+
e.currentValue[e.currentValue.length - 1] ? (a(), i(c, { key: 0 }, [
|
|
225
|
+
t[19] || (t[19] = n("div", { class: "ev-date-picker-range-separator" }, [
|
|
226
|
+
n("span", { class: "ev-tag-name" }, " ~ ")
|
|
227
|
+
], -1)),
|
|
228
|
+
v(n("input", {
|
|
229
|
+
"onUpdate:modelValue": t[8] || (t[8] = (o) => e.currentValue[e.currentValue.length - 1] = o),
|
|
230
|
+
type: "text",
|
|
231
|
+
class: "ev-date-picker-range-input",
|
|
232
|
+
onKeydown: t[9] || (t[9] = x(y((o) => e.validateValue(e.currentValue), ["prevent"]), ["enter"])),
|
|
233
|
+
onChange: t[10] || (t[10] = (o) => e.validateValue(e.currentValue))
|
|
234
|
+
}, null, 544), [
|
|
235
|
+
[
|
|
236
|
+
h,
|
|
237
|
+
e.currentValue[e.currentValue.length - 1],
|
|
238
|
+
void 0,
|
|
239
|
+
{ trim: !0 }
|
|
240
|
+
]
|
|
241
|
+
])
|
|
242
|
+
], 64)) : d("", !0)
|
|
243
|
+
])),
|
|
244
|
+
r.$props.clearable ? v((a(), i("span", {
|
|
245
|
+
key: 3,
|
|
246
|
+
class: "ev-input-suffix",
|
|
247
|
+
onClick: t[12] || (t[12] = y((o) => [e.removeAllMv(), e.clickOutsideDropbox()], ["stop"]))
|
|
248
|
+
}, [...t[21] || (t[21] = [
|
|
249
|
+
n("i", { class: "ev-icon-error" }, null, -1)
|
|
250
|
+
])], 512)), [
|
|
251
|
+
[j, e.isClearableIcon]
|
|
252
|
+
]) : d("", !0),
|
|
253
|
+
n("div", ee, [
|
|
254
|
+
e.isDropbox ? (a(), i("div", {
|
|
255
|
+
key: 0,
|
|
256
|
+
ref: "dropbox",
|
|
257
|
+
class: m(["ev-date-picker-dropdown", r.$props.mode]),
|
|
258
|
+
style: z(e.dropboxPosition)
|
|
259
|
+
}, [
|
|
260
|
+
e.usedShortcuts.length ? (a(), i("div", te, [
|
|
261
|
+
e.usedShortcuts.length === 1 ? (a(), w(p, {
|
|
262
|
+
key: 0,
|
|
263
|
+
type: e.usedShortcuts[0].isActive ? "primary" : "default",
|
|
264
|
+
onClick: t[13] || (t[13] = (o) => e.clickShortcut(e.usedShortcuts[0].key))
|
|
265
|
+
}, {
|
|
266
|
+
default: C(() => [
|
|
267
|
+
I(k(e.usedShortcuts[0].label), 1)
|
|
268
|
+
]),
|
|
269
|
+
_: 1
|
|
270
|
+
}, 8, ["type"])) : (a(), w(g, { key: 1 }, {
|
|
271
|
+
default: C(() => [
|
|
272
|
+
(a(!0), i(c, null, T(e.usedShortcuts, (o) => (a(), w(p, {
|
|
273
|
+
key: o.key,
|
|
274
|
+
type: o.isActive ? "primary" : "default",
|
|
275
|
+
onClick: (f) => e.clickShortcut(o.key)
|
|
276
|
+
}, {
|
|
277
|
+
default: C(() => [
|
|
278
|
+
I(k(o.label), 1)
|
|
279
|
+
]),
|
|
280
|
+
_: 2
|
|
281
|
+
}, 1032, ["type", "onClick"]))), 128))
|
|
282
|
+
]),
|
|
283
|
+
_: 1
|
|
284
|
+
}))
|
|
285
|
+
])) : d("", !0),
|
|
286
|
+
e.usedShortcuts.length ? (a(), i("div", re)) : d("", !0),
|
|
287
|
+
n("div", {
|
|
288
|
+
class: m({ "ev-date-picker-dropbox__calendar": e.usedShortcuts.length })
|
|
289
|
+
}, [
|
|
290
|
+
H(b, {
|
|
291
|
+
key: "fromCalendar",
|
|
292
|
+
modelValue: e.mv,
|
|
293
|
+
"onUpdate:modelValue": t[14] || (t[14] = (o) => e.mv = o),
|
|
294
|
+
mode: r.$props.mode,
|
|
295
|
+
"month-notation": r.$props.monthNotation,
|
|
296
|
+
"day-of-the-week-notation": r.$props.dayOfTheWeekNotation,
|
|
297
|
+
options: r.$props.options
|
|
298
|
+
}, null, 8, ["modelValue", "mode", "month-notation", "day-of-the-week-notation", "options"])
|
|
299
|
+
], 2)
|
|
300
|
+
], 6)) : d("", !0)
|
|
301
|
+
])
|
|
302
|
+
], 512)
|
|
303
|
+
], 2)), [
|
|
304
|
+
[V, e.clickOutsideDropbox]
|
|
305
|
+
]);
|
|
306
|
+
}
|
|
307
|
+
const se = /* @__PURE__ */ q(G, [["render", oe]]);
|
|
308
|
+
export {
|
|
309
|
+
se as default
|
|
310
|
+
};
|