@haoyulong1112/jh-ui 0.1.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/components/alert/index.d.ts +125 -0
- package/dist/components/alert/src/alert.vue.d.ts +73 -0
- package/dist/components/alert/src/props.d.ts +32 -0
- package/dist/components/alert/src/types.d.ts +2 -0
- package/dist/components/backtop/index.d.ts +102 -0
- package/dist/components/backtop/src/backtop.vue.d.ts +57 -0
- package/dist/components/backtop/src/props.d.ts +22 -0
- package/dist/components/backtop/src/types.d.ts +3 -0
- package/dist/components/badge/index.d.ts +101 -0
- package/dist/components/badge/src/badge.vue.d.ts +59 -0
- package/dist/components/badge/src/props.d.ts +24 -0
- package/dist/components/badge/src/types.d.ts +2 -0
- package/dist/components/button/index.d.ts +123 -0
- package/dist/components/button/src/button.vue.d.ts +69 -0
- package/dist/components/button/src/props.d.ts +33 -0
- package/dist/components/button/src/types.d.ts +3 -0
- package/dist/components/carousel/index.d.ts +187 -0
- package/dist/components/carousel/src/carousel-item.vue.d.ts +24 -0
- package/dist/components/carousel/src/carousel.vue.d.ts +86 -0
- package/dist/components/carousel/src/props.d.ts +44 -0
- package/dist/components/carousel/src/types.d.ts +11 -0
- package/dist/components/cascader/index.d.ts +68 -0
- package/dist/components/cascader/src/cascader.vue.d.ts +67 -0
- package/dist/components/cascader/src/props.d.ts +33 -0
- package/dist/components/cascader/src/types.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +139 -0
- package/dist/components/checkbox/src/checkbox-group.vue.d.ts +34 -0
- package/dist/components/checkbox/src/checkbox.vue.d.ts +44 -0
- package/dist/components/checkbox/src/props.d.ts +31 -0
- package/dist/components/checkbox/src/types.d.ts +8 -0
- package/dist/components/collapse/index.d.ts +120 -0
- package/dist/components/collapse/src/collapse-item.vue.d.ts +37 -0
- package/dist/components/collapse/src/collapse.vue.d.ts +33 -0
- package/dist/components/collapse/src/props.d.ts +24 -0
- package/dist/components/collapse/src/types.d.ts +8 -0
- package/dist/components/date-picker/index.d.ts +32 -0
- package/dist/components/date-picker/src/date-picker.vue.d.ts +30 -0
- package/dist/components/date-picker/src/props.d.ts +16 -0
- package/dist/components/date-picker/src/types.d.ts +1 -0
- package/dist/components/date-time-picker/index.d.ts +32 -0
- package/dist/components/date-time-picker/src/date-time-picker.vue.d.ts +30 -0
- package/dist/components/date-time-picker/src/props.d.ts +16 -0
- package/dist/components/date-time-picker/src/types.d.ts +1 -0
- package/dist/components/dialog/index.d.ts +97 -0
- package/dist/components/dialog/src/dialog.vue.d.ts +54 -0
- package/dist/components/dialog/src/props.d.ts +22 -0
- package/dist/components/dialog/src/types.d.ts +1 -0
- package/dist/components/drawer/index.d.ts +139 -0
- package/dist/components/drawer/src/drawer.vue.d.ts +79 -0
- package/dist/components/drawer/src/props.d.ts +33 -0
- package/dist/components/drawer/src/types.d.ts +2 -0
- package/dist/components/dropdown/index.d.ts +115 -0
- package/dist/components/dropdown/src/dropdown.vue.d.ts +67 -0
- package/dist/components/dropdown/src/props.d.ts +30 -0
- package/dist/components/dropdown/src/types.d.ts +9 -0
- package/dist/components/form/index.d.ts +127 -0
- package/dist/components/form/src/form-item.vue.d.ts +27 -0
- package/dist/components/form/src/form.vue.d.ts +45 -0
- package/dist/components/form/src/props.d.ts +24 -0
- package/dist/components/form/src/types.d.ts +19 -0
- package/dist/components/icon/index.d.ts +53 -0
- package/dist/components/icon/src/icon.vue.d.ts +31 -0
- package/dist/components/icon/src/props.d.ts +13 -0
- package/dist/components/icon/src/types.d.ts +1 -0
- package/dist/components/index.d.ts +6387 -0
- package/dist/components/infinite-scroll/index.d.ts +107 -0
- package/dist/components/infinite-scroll/src/infinite-scroll.vue.d.ts +59 -0
- package/dist/components/infinite-scroll/src/props.d.ts +21 -0
- package/dist/components/infinite-scroll/src/types.d.ts +5 -0
- package/dist/components/input/index.d.ts +110 -0
- package/dist/components/input/src/input.vue.d.ts +58 -0
- package/dist/components/input/src/props.d.ts +26 -0
- package/dist/components/input/src/types.d.ts +1 -0
- package/dist/components/link/index.d.ts +84 -0
- package/dist/components/link/src/link.vue.d.ts +48 -0
- package/dist/components/link/src/props.d.ts +23 -0
- package/dist/components/link/src/types.d.ts +2 -0
- package/dist/components/message/index.d.ts +7 -0
- package/dist/components/message/src/message.vue.d.ts +79 -0
- package/dist/components/message/src/props.d.ts +33 -0
- package/dist/components/message/src/types.d.ts +32 -0
- package/dist/components/message-box/index.d.ts +7 -0
- package/dist/components/message-box/src/message-box.vue.d.ts +101 -0
- package/dist/components/message-box/src/props.d.ts +42 -0
- package/dist/components/message-box/src/types.d.ts +27 -0
- package/dist/components/notification/index.d.ts +7 -0
- package/dist/components/notification/src/notification.vue.d.ts +95 -0
- package/dist/components/notification/src/props.d.ts +46 -0
- package/dist/components/notification/src/types.d.ts +36 -0
- package/dist/components/pagination/index.d.ts +45 -0
- package/dist/components/pagination/src/pagination.vue.d.ts +43 -0
- package/dist/components/pagination/src/props.d.ts +23 -0
- package/dist/components/pagination/src/types.d.ts +4 -0
- package/dist/components/radio/index.d.ts +112 -0
- package/dist/components/radio/src/props.d.ts +25 -0
- package/dist/components/radio/src/radio-group.vue.d.ts +27 -0
- package/dist/components/radio/src/radio.vue.d.ts +36 -0
- package/dist/components/radio/src/types.d.ts +8 -0
- package/dist/components/scrollbar/index.d.ts +60 -0
- package/dist/components/scrollbar/src/props.d.ts +14 -0
- package/dist/components/scrollbar/src/scrollbar.vue.d.ts +33 -0
- package/dist/components/scrollbar/src/types.d.ts +4 -0
- package/dist/components/select/index.d.ts +43 -0
- package/dist/components/select/src/props.d.ts +22 -0
- package/dist/components/select/src/select.vue.d.ts +42 -0
- package/dist/components/select/src/types.d.ts +6 -0
- package/dist/components/table/index.d.ts +147 -0
- package/dist/components/table/src/props.d.ts +31 -0
- package/dist/components/table/src/table.vue.d.ts +88 -0
- package/dist/components/table/src/types.d.ts +11 -0
- package/dist/components/tabs/index.d.ts +112 -0
- package/dist/components/tabs/src/props.d.ts +23 -0
- package/dist/components/tabs/src/tab-pane.vue.d.ts +35 -0
- package/dist/components/tabs/src/tabs.vue.d.ts +31 -0
- package/dist/components/tabs/src/types.d.ts +14 -0
- package/dist/components/text/index.d.ts +86 -0
- package/dist/components/text/src/props.d.ts +23 -0
- package/dist/components/text/src/text.vue.d.ts +51 -0
- package/dist/components/text/src/types.d.ts +3 -0
- package/dist/components/time-select/index.d.ts +64 -0
- package/dist/components/time-select/src/props.d.ts +29 -0
- package/dist/components/time-select/src/time-select.vue.d.ts +63 -0
- package/dist/components/time-select/src/types.d.ts +4 -0
- package/dist/components/tree/index.d.ts +167 -0
- package/dist/components/tree/src/props.d.ts +39 -0
- package/dist/components/tree/src/tree.vue.d.ts +97 -0
- package/dist/components/tree/src/types.d.ts +21 -0
- package/dist/components/upload/index.d.ts +89 -0
- package/dist/components/upload/src/props.d.ts +41 -0
- package/dist/components/upload/src/types.d.ts +11 -0
- package/dist/components/upload/src/upload.vue.d.ts +88 -0
- package/dist/components/waterfall/index.d.ts +195 -0
- package/dist/components/waterfall/src/props.d.ts +42 -0
- package/dist/components/waterfall/src/types.d.ts +17 -0
- package/dist/components/waterfall/src/waterfall.vue.d.ts +122 -0
- package/dist/es/components/alert/style/css.js +1 -0
- package/dist/es/components/alert/style/style.css +128 -0
- package/dist/es/components/backtop/style/css.js +1 -0
- package/dist/es/components/backtop/style/style.css +67 -0
- package/dist/es/components/badge/style/css.js +1 -0
- package/dist/es/components/badge/style/style.css +88 -0
- package/dist/es/components/button/style/css.js +1 -0
- package/dist/es/components/button/style/style.css +207 -0
- package/dist/es/components/carousel/style/css.js +1 -0
- package/dist/es/components/carousel/style/style.css +118 -0
- package/dist/es/components/cascader/style/css.js +1 -0
- package/dist/es/components/cascader/style/style.css +172 -0
- package/dist/es/components/checkbox/style/css.js +1 -0
- package/dist/es/components/checkbox/style/style.css +95 -0
- package/dist/es/components/collapse/style/css.js +1 -0
- package/dist/es/components/collapse/style/style.css +91 -0
- package/dist/es/components/date-picker/style/css.js +1 -0
- package/dist/es/components/date-picker/style/style.css +78 -0
- package/dist/es/components/date-time-picker/style/css.js +1 -0
- package/dist/es/components/date-time-picker/style/style.css +78 -0
- package/dist/es/components/dialog/style/css.js +1 -0
- package/dist/es/components/dialog/style/style.css +129 -0
- package/dist/es/components/drawer/style/css.js +1 -0
- package/dist/es/components/drawer/style/style.css +162 -0
- package/dist/es/components/dropdown/style/css.js +1 -0
- package/dist/es/components/dropdown/style/style.css +138 -0
- package/dist/es/components/form/style/css.js +1 -0
- package/dist/es/components/form/style/style.css +73 -0
- package/dist/es/components/icon/style/css.js +1 -0
- package/dist/es/components/icon/style/style.css +61 -0
- package/dist/es/components/infinite-scroll/style/css.js +1 -0
- package/dist/es/components/infinite-scroll/style/style.css +54 -0
- package/dist/es/components/input/style/css.js +1 -0
- package/dist/es/components/input/style/style.css +152 -0
- package/dist/es/components/link/style/css.js +1 -0
- package/dist/es/components/link/style/style.css +82 -0
- package/dist/es/components/message/style/css.js +1 -0
- package/dist/es/components/message/style/style.css +111 -0
- package/dist/es/components/message-box/style/css.js +1 -0
- package/dist/es/components/message-box/style/style.css +156 -0
- package/dist/es/components/notification/style/css.js +1 -0
- package/dist/es/components/notification/style/style.css +128 -0
- package/dist/es/components/pagination/style/css.js +1 -0
- package/dist/es/components/pagination/style/style.css +89 -0
- package/dist/es/components/radio/style/css.js +1 -0
- package/dist/es/components/radio/style/style.css +91 -0
- package/dist/es/components/scrollbar/style/css.js +1 -0
- package/dist/es/components/scrollbar/style/style.css +75 -0
- package/dist/es/components/select/style/css.js +1 -0
- package/dist/es/components/select/style/style.css +140 -0
- package/dist/es/components/table/style/css.js +1 -0
- package/dist/es/components/table/style/style.css +177 -0
- package/dist/es/components/tabs/style/css.js +1 -0
- package/dist/es/components/tabs/style/style.css +85 -0
- package/dist/es/components/text/style/css.js +1 -0
- package/dist/es/components/text/style/style.css +84 -0
- package/dist/es/components/time-select/style/css.js +1 -0
- package/dist/es/components/time-select/style/style.css +153 -0
- package/dist/es/components/tree/style/css.js +1 -0
- package/dist/es/components/tree/style/style.css +113 -0
- package/dist/es/components/upload/style/css.js +1 -0
- package/dist/es/components/upload/style/style.css +148 -0
- package/dist/es/components/waterfall/style/css.js +1 -0
- package/dist/es/components/waterfall/style/style.css +85 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.mjs +3341 -0
- package/dist/index.mjs.map +1 -0
- package/dist/resolver.cjs +2 -0
- package/dist/resolver.cjs.map +1 -0
- package/dist/resolver.d.ts +14 -0
- package/dist/resolver.mjs +59 -0
- package/dist/resolver.mjs.map +1 -0
- package/dist/utils/src/index.d.ts +1 -0
- package/dist/utils/src/install.d.ts +3 -0
- package/package.json +70 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3341 @@
|
|
|
1
|
+
import { defineComponent as T, computed as k, openBlock as n, createElementBlock as d, normalizeStyle as Z, normalizeClass as N, Fragment as O, createElementVNode as b, createCommentVNode as j, renderSlot as P, ref as E, createTextVNode as Q, toDisplayString as J, createVNode as K, unref as M, onMounted as se, nextTick as be, onBeforeUnmount as ae, createBlock as U, Transition as le, withCtx as X, withDirectives as ce, vShow as ue, watch as Y, withModifiers as te, renderList as W, provide as pe, inject as he, Teleport as _e, useSlots as Te, render as de, watchEffect as Je, resolveDynamicComponent as Ee } from "vue";
|
|
2
|
+
const I = (t) => (t.install = (s) => {
|
|
3
|
+
const e = t.name;
|
|
4
|
+
e && s.component(e, t);
|
|
5
|
+
}, t), Po = [
|
|
6
|
+
"plus",
|
|
7
|
+
"close",
|
|
8
|
+
"search",
|
|
9
|
+
"eye",
|
|
10
|
+
"eye-off",
|
|
11
|
+
"loading",
|
|
12
|
+
"arrow-left",
|
|
13
|
+
"arrow-right"
|
|
14
|
+
], Ie = {
|
|
15
|
+
name: String,
|
|
16
|
+
size: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
color: String,
|
|
21
|
+
spin: Boolean
|
|
22
|
+
}, Me = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "jh-icon__svg",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
"stroke-width": "2",
|
|
29
|
+
"stroke-linecap": "round",
|
|
30
|
+
"stroke-linejoin": "round",
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
}, ze = {
|
|
33
|
+
key: 5,
|
|
34
|
+
d: "M21 12a9 9 0 1 1-6.2-8.6"
|
|
35
|
+
}, Ke = {
|
|
36
|
+
key: 6,
|
|
37
|
+
d: "m15 18-6-6 6-6"
|
|
38
|
+
}, Fe = {
|
|
39
|
+
key: 7,
|
|
40
|
+
d: "m9 18 6-6-6-6"
|
|
41
|
+
}, De = /* @__PURE__ */ T({
|
|
42
|
+
name: "JhIcon",
|
|
43
|
+
__name: "icon",
|
|
44
|
+
props: Ie,
|
|
45
|
+
setup(t) {
|
|
46
|
+
const s = t, e = k(() => ({
|
|
47
|
+
color: s.color,
|
|
48
|
+
fontSize: typeof s.size == "number" ? `${s.size}px` : s.size
|
|
49
|
+
}));
|
|
50
|
+
return (a, l) => (n(), d("span", {
|
|
51
|
+
class: N(["jh-icon", { "is-spin": a.spin || a.name === "loading" }]),
|
|
52
|
+
style: Z(e.value)
|
|
53
|
+
}, [
|
|
54
|
+
a.name ? (n(), d("svg", Me, [
|
|
55
|
+
a.name === "plus" ? (n(), d(O, { key: 0 }, [
|
|
56
|
+
l[0] || (l[0] = b("path", { d: "M12 5v14" }, null, -1)),
|
|
57
|
+
l[1] || (l[1] = b("path", { d: "M5 12h14" }, null, -1))
|
|
58
|
+
], 64)) : a.name === "close" ? (n(), d(O, { key: 1 }, [
|
|
59
|
+
l[2] || (l[2] = b("path", { d: "M18 6 6 18" }, null, -1)),
|
|
60
|
+
l[3] || (l[3] = b("path", { d: "m6 6 12 12" }, null, -1))
|
|
61
|
+
], 64)) : a.name === "search" ? (n(), d(O, { key: 2 }, [
|
|
62
|
+
l[4] || (l[4] = b("circle", {
|
|
63
|
+
cx: "11",
|
|
64
|
+
cy: "11",
|
|
65
|
+
r: "7"
|
|
66
|
+
}, null, -1)),
|
|
67
|
+
l[5] || (l[5] = b("path", { d: "m20 20-3.5-3.5" }, null, -1))
|
|
68
|
+
], 64)) : a.name === "eye" ? (n(), d(O, { key: 3 }, [
|
|
69
|
+
l[6] || (l[6] = b("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z" }, null, -1)),
|
|
70
|
+
l[7] || (l[7] = b("circle", {
|
|
71
|
+
cx: "12",
|
|
72
|
+
cy: "12",
|
|
73
|
+
r: "3"
|
|
74
|
+
}, null, -1))
|
|
75
|
+
], 64)) : a.name === "eye-off" ? (n(), d(O, { key: 4 }, [
|
|
76
|
+
l[8] || (l[8] = b("path", { d: "M3 3l18 18" }, null, -1)),
|
|
77
|
+
l[9] || (l[9] = b("path", { d: "M10.6 10.6a3 3 0 0 0 4.2 4.2" }, null, -1)),
|
|
78
|
+
l[10] || (l[10] = b("path", { d: "M9.9 5.3A10.6 10.6 0 0 1 12 5c6.5 0 10 7 10 7a17.2 17.2 0 0 1-3.2 4.2" }, null, -1)),
|
|
79
|
+
l[11] || (l[11] = b("path", { d: "M6.6 6.6C3.6 8.6 2 12 2 12s3.5 7 10 7c1 0 1.9-.2 2.8-.5" }, null, -1))
|
|
80
|
+
], 64)) : a.name === "loading" ? (n(), d("path", ze)) : a.name === "arrow-left" ? (n(), d("path", Ke)) : a.name === "arrow-right" ? (n(), d("path", Fe)) : j("", !0)
|
|
81
|
+
])) : P(a.$slots, "default", { key: 1 })
|
|
82
|
+
], 6));
|
|
83
|
+
}
|
|
84
|
+
}), z = I(De), Le = ["success", "warning", "info", "danger"], Re = ["light", "dark"], Oe = {
|
|
85
|
+
title: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: ""
|
|
88
|
+
},
|
|
89
|
+
description: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: ""
|
|
92
|
+
},
|
|
93
|
+
type: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: "info",
|
|
96
|
+
validator: (t) => Le.includes(t)
|
|
97
|
+
},
|
|
98
|
+
effect: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "light",
|
|
101
|
+
validator: (t) => Re.includes(t)
|
|
102
|
+
},
|
|
103
|
+
closable: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !0
|
|
106
|
+
},
|
|
107
|
+
showIcon: Boolean
|
|
108
|
+
}, He = {
|
|
109
|
+
close: () => !0
|
|
110
|
+
}, xe = {
|
|
111
|
+
key: 0,
|
|
112
|
+
class: "jh-alert__icon",
|
|
113
|
+
"aria-hidden": "true"
|
|
114
|
+
}, qe = { class: "jh-alert__content" }, Ge = {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: "jh-alert__title"
|
|
117
|
+
}, Ue = {
|
|
118
|
+
key: 1,
|
|
119
|
+
class: "jh-alert__description"
|
|
120
|
+
}, We = /* @__PURE__ */ T({
|
|
121
|
+
name: "JhAlert",
|
|
122
|
+
__name: "alert",
|
|
123
|
+
props: Oe,
|
|
124
|
+
emits: He,
|
|
125
|
+
setup(t, { emit: s }) {
|
|
126
|
+
const e = s, a = E(!0), l = () => {
|
|
127
|
+
a.value = !1, e("close");
|
|
128
|
+
};
|
|
129
|
+
return (i, r) => a.value ? (n(), d("div", {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: N(["jh-alert", [`jh-alert--${i.type}`, `jh-alert--${i.effect}`]]),
|
|
132
|
+
role: "alert"
|
|
133
|
+
}, [
|
|
134
|
+
i.showIcon ? (n(), d("span", xe)) : j("", !0),
|
|
135
|
+
b("div", qe, [
|
|
136
|
+
i.title || i.$slots.title ? (n(), d("div", Ge, [
|
|
137
|
+
P(i.$slots, "title", {}, () => [
|
|
138
|
+
Q(J(i.title), 1)
|
|
139
|
+
])
|
|
140
|
+
])) : j("", !0),
|
|
141
|
+
i.description || i.$slots.default ? (n(), d("div", Ue, [
|
|
142
|
+
P(i.$slots, "default", {}, () => [
|
|
143
|
+
Q(J(i.description), 1)
|
|
144
|
+
])
|
|
145
|
+
])) : j("", !0)
|
|
146
|
+
]),
|
|
147
|
+
i.closable ? (n(), d("button", {
|
|
148
|
+
key: 1,
|
|
149
|
+
class: "jh-alert__close",
|
|
150
|
+
type: "button",
|
|
151
|
+
"aria-label": "Close alert",
|
|
152
|
+
onClick: l
|
|
153
|
+
}, [
|
|
154
|
+
K(M(z), { name: "close" })
|
|
155
|
+
])) : j("", !0)
|
|
156
|
+
], 2)) : j("", !0);
|
|
157
|
+
}
|
|
158
|
+
}), Ye = I(We), Ze = {
|
|
159
|
+
target: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: ""
|
|
162
|
+
},
|
|
163
|
+
visibilityHeight: {
|
|
164
|
+
type: Number,
|
|
165
|
+
default: 200
|
|
166
|
+
},
|
|
167
|
+
right: {
|
|
168
|
+
type: Number,
|
|
169
|
+
default: 40
|
|
170
|
+
},
|
|
171
|
+
bottom: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: 40
|
|
174
|
+
}
|
|
175
|
+
}, Qe = {
|
|
176
|
+
click: (t) => !!t.target
|
|
177
|
+
}, Xe = /* @__PURE__ */ T({
|
|
178
|
+
name: "JhBacktop",
|
|
179
|
+
__name: "backtop",
|
|
180
|
+
props: Ze,
|
|
181
|
+
emits: Qe,
|
|
182
|
+
setup(t, { expose: s, emit: e }) {
|
|
183
|
+
const a = t, l = e, i = E(!1), r = E(), h = k(() => ({
|
|
184
|
+
right: `${a.right}px`,
|
|
185
|
+
bottom: `${a.bottom}px`
|
|
186
|
+
})), o = () => {
|
|
187
|
+
const y = r.value;
|
|
188
|
+
return y ? typeof window < "u" && y === window ? window.scrollY || document.documentElement.scrollTop : y.scrollTop : 0;
|
|
189
|
+
}, c = () => {
|
|
190
|
+
i.value = o() >= a.visibilityHeight;
|
|
191
|
+
}, m = () => a.target && document.querySelector(a.target) || window, p = () => {
|
|
192
|
+
typeof window > "u" || (r.value = m(), r.value.addEventListener("scroll", c), c());
|
|
193
|
+
}, g = () => {
|
|
194
|
+
var y;
|
|
195
|
+
(y = r.value) == null || y.removeEventListener("scroll", c);
|
|
196
|
+
}, v = () => {
|
|
197
|
+
const y = r.value;
|
|
198
|
+
y && (typeof window < "u" && y === window ? window.scrollTo({ top: 0, behavior: "smooth" }) : y.scrollTo({ top: 0, behavior: "smooth" }), l("click", { target: y }));
|
|
199
|
+
};
|
|
200
|
+
return se(() => {
|
|
201
|
+
be(p);
|
|
202
|
+
}), ae(() => {
|
|
203
|
+
g();
|
|
204
|
+
}), s({
|
|
205
|
+
handleScroll: c
|
|
206
|
+
}), (y, B) => (n(), U(le, { name: "jh-backtop-fade" }, {
|
|
207
|
+
default: X(() => [
|
|
208
|
+
ce(b("button", {
|
|
209
|
+
class: "jh-backtop",
|
|
210
|
+
type: "button",
|
|
211
|
+
style: Z(h.value),
|
|
212
|
+
"aria-label": "Back to top",
|
|
213
|
+
onClick: v
|
|
214
|
+
}, [
|
|
215
|
+
P(y.$slots, "default", {}, () => [
|
|
216
|
+
K(M(z), { name: "arrow-left" })
|
|
217
|
+
])
|
|
218
|
+
], 4), [
|
|
219
|
+
[ue, i.value]
|
|
220
|
+
])
|
|
221
|
+
]),
|
|
222
|
+
_: 3
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
}), et = I(Xe), tt = ["primary", "success", "warning", "danger", "info"], at = {
|
|
226
|
+
value: {
|
|
227
|
+
type: [String, Number],
|
|
228
|
+
default: ""
|
|
229
|
+
},
|
|
230
|
+
max: {
|
|
231
|
+
type: Number,
|
|
232
|
+
default: 0
|
|
233
|
+
},
|
|
234
|
+
type: {
|
|
235
|
+
type: String,
|
|
236
|
+
default: "danger",
|
|
237
|
+
validator: (t) => tt.includes(t)
|
|
238
|
+
},
|
|
239
|
+
color: {
|
|
240
|
+
type: String,
|
|
241
|
+
default: ""
|
|
242
|
+
},
|
|
243
|
+
hidden: Boolean,
|
|
244
|
+
isDot: Boolean
|
|
245
|
+
}, lt = { class: "jh-badge" }, st = /* @__PURE__ */ T({
|
|
246
|
+
name: "JhBadge",
|
|
247
|
+
__name: "badge",
|
|
248
|
+
props: at,
|
|
249
|
+
setup(t) {
|
|
250
|
+
const s = t, e = k(() => s.isDot ? "" : typeof s.value == "number" && s.max > 0 && s.value > s.max ? `${s.max}+` : s.value), a = k(() => s.color ? { backgroundColor: s.color } : void 0);
|
|
251
|
+
return (l, i) => (n(), d("span", lt, [
|
|
252
|
+
P(l.$slots, "default"),
|
|
253
|
+
!l.hidden && (l.isDot || e.value !== "") ? (n(), d("sup", {
|
|
254
|
+
key: 0,
|
|
255
|
+
class: N(["jh-badge__content", [`jh-badge__content--${l.type}`, { "is-dot": l.isDot, "is-custom-color": l.color }]]),
|
|
256
|
+
style: Z(a.value)
|
|
257
|
+
}, [
|
|
258
|
+
l.isDot ? j("", !0) : (n(), d(O, { key: 0 }, [
|
|
259
|
+
Q(J(e.value), 1)
|
|
260
|
+
], 64))
|
|
261
|
+
], 6)) : j("", !0)
|
|
262
|
+
]));
|
|
263
|
+
}
|
|
264
|
+
}), ot = I(st), nt = [
|
|
265
|
+
"default",
|
|
266
|
+
"primary",
|
|
267
|
+
"success",
|
|
268
|
+
"warning",
|
|
269
|
+
"danger",
|
|
270
|
+
"info"
|
|
271
|
+
], it = ["small", "default", "large"], rt = ["button", "submit", "reset"], dt = {
|
|
272
|
+
type: {
|
|
273
|
+
type: String,
|
|
274
|
+
default: "default",
|
|
275
|
+
validator: (t) => nt.includes(t)
|
|
276
|
+
},
|
|
277
|
+
size: {
|
|
278
|
+
type: String,
|
|
279
|
+
default: "default",
|
|
280
|
+
validator: (t) => it.includes(t)
|
|
281
|
+
},
|
|
282
|
+
disabled: Boolean,
|
|
283
|
+
loading: Boolean,
|
|
284
|
+
plain: Boolean,
|
|
285
|
+
round: Boolean,
|
|
286
|
+
circle: Boolean,
|
|
287
|
+
icon: String,
|
|
288
|
+
nativeType: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: "button",
|
|
291
|
+
validator: (t) => rt.includes(t)
|
|
292
|
+
}
|
|
293
|
+
}, ct = {
|
|
294
|
+
click: (t) => t instanceof MouseEvent
|
|
295
|
+
}, ut = ["type", "disabled", "aria-disabled"], pt = {
|
|
296
|
+
key: 2,
|
|
297
|
+
class: "jh-button__content"
|
|
298
|
+
}, ht = /* @__PURE__ */ T({
|
|
299
|
+
name: "JhButton",
|
|
300
|
+
__name: "button",
|
|
301
|
+
props: dt,
|
|
302
|
+
emits: ct,
|
|
303
|
+
setup(t, { emit: s }) {
|
|
304
|
+
const e = t, a = s, l = k(() => [
|
|
305
|
+
`jh-button--${e.type}`,
|
|
306
|
+
e.size !== "default" ? `jh-button--${e.size}` : "",
|
|
307
|
+
{
|
|
308
|
+
"is-disabled": e.disabled,
|
|
309
|
+
"is-loading": e.loading,
|
|
310
|
+
"is-plain": e.plain,
|
|
311
|
+
"is-round": e.round,
|
|
312
|
+
"is-circle": e.circle
|
|
313
|
+
}
|
|
314
|
+
]), i = (r) => {
|
|
315
|
+
e.disabled || e.loading || a("click", r);
|
|
316
|
+
};
|
|
317
|
+
return (r, h) => (n(), d("button", {
|
|
318
|
+
class: N(["jh-button", l.value]),
|
|
319
|
+
type: r.nativeType,
|
|
320
|
+
disabled: r.disabled || r.loading,
|
|
321
|
+
"aria-disabled": r.disabled || r.loading,
|
|
322
|
+
onClick: i
|
|
323
|
+
}, [
|
|
324
|
+
r.loading ? (n(), U(M(z), {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: "jh-button__loading",
|
|
327
|
+
name: "loading"
|
|
328
|
+
})) : r.icon ? (n(), U(M(z), {
|
|
329
|
+
key: 1,
|
|
330
|
+
class: "jh-button__icon",
|
|
331
|
+
name: r.icon
|
|
332
|
+
}, null, 8, ["name"])) : j("", !0),
|
|
333
|
+
r.$slots.default ? (n(), d("span", pt, [
|
|
334
|
+
P(r.$slots, "default")
|
|
335
|
+
])) : j("", !0)
|
|
336
|
+
], 10, ut));
|
|
337
|
+
}
|
|
338
|
+
}), ye = I(ht), mt = {
|
|
339
|
+
modelValue: {
|
|
340
|
+
type: Array,
|
|
341
|
+
default: () => []
|
|
342
|
+
},
|
|
343
|
+
options: {
|
|
344
|
+
type: Array,
|
|
345
|
+
default: () => []
|
|
346
|
+
},
|
|
347
|
+
placeholder: {
|
|
348
|
+
type: String,
|
|
349
|
+
default: "Please select"
|
|
350
|
+
},
|
|
351
|
+
disabled: Boolean,
|
|
352
|
+
clearable: Boolean,
|
|
353
|
+
separator: {
|
|
354
|
+
type: String,
|
|
355
|
+
default: " / "
|
|
356
|
+
},
|
|
357
|
+
fieldNames: {
|
|
358
|
+
type: Object,
|
|
359
|
+
default: () => ({})
|
|
360
|
+
}
|
|
361
|
+
}, ft = {
|
|
362
|
+
"update:modelValue": (t) => !0,
|
|
363
|
+
change: (t, s) => !0,
|
|
364
|
+
"visible-change": (t) => !0,
|
|
365
|
+
clear: () => !0
|
|
366
|
+
}, bt = ["disabled", "aria-expanded"], gt = {
|
|
367
|
+
key: 0,
|
|
368
|
+
class: "jh-cascader__panel"
|
|
369
|
+
}, vt = ["disabled", "onClick"], yt = /* @__PURE__ */ T({
|
|
370
|
+
name: "JhCascader",
|
|
371
|
+
__name: "cascader",
|
|
372
|
+
props: mt,
|
|
373
|
+
emits: ft,
|
|
374
|
+
setup(t, { emit: s }) {
|
|
375
|
+
const e = t, a = s, l = E(!1), i = E([]), r = E(), h = k(() => ({
|
|
376
|
+
"is-disabled": e.disabled,
|
|
377
|
+
"is-visible": l.value
|
|
378
|
+
})), o = k(() => e.fieldNames.label || "label"), c = k(() => e.fieldNames.value || "value"), m = k(() => e.fieldNames.children || "children"), p = k(() => e.fieldNames.disabled || "disabled"), g = (S) => String(S[o.value] ?? ""), v = (S) => S[c.value], y = (S) => S[m.value] || [], B = (S) => !!S[p.value], f = (S) => y(S).length > 0, C = (S) => {
|
|
379
|
+
const D = [];
|
|
380
|
+
let q = e.options;
|
|
381
|
+
for (const ee of S) {
|
|
382
|
+
const G = q.find((fe) => v(fe) === ee);
|
|
383
|
+
if (!G) break;
|
|
384
|
+
D.push(G), q = y(G);
|
|
385
|
+
}
|
|
386
|
+
return D;
|
|
387
|
+
}, $ = k(() => C(e.modelValue)), F = k(
|
|
388
|
+
() => $.value.length ? $.value.map((S) => g(S)).join(e.separator) : ""
|
|
389
|
+
), u = k(() => {
|
|
390
|
+
const S = [];
|
|
391
|
+
let D = e.options;
|
|
392
|
+
S.push(D);
|
|
393
|
+
for (const q of i.value) {
|
|
394
|
+
const ee = D.find((fe) => v(fe) === q);
|
|
395
|
+
if (!ee) break;
|
|
396
|
+
const G = y(ee);
|
|
397
|
+
if (!G.length) break;
|
|
398
|
+
S.push(G), D = G;
|
|
399
|
+
}
|
|
400
|
+
return S.filter((q) => q.length);
|
|
401
|
+
}), w = k(
|
|
402
|
+
() => e.clearable && !e.disabled && e.modelValue.length > 0
|
|
403
|
+
), _ = (S) => {
|
|
404
|
+
e.disabled || l.value !== S && (l.value = S, a("visible-change", S));
|
|
405
|
+
}, L = () => {
|
|
406
|
+
_(!l.value);
|
|
407
|
+
}, V = () => {
|
|
408
|
+
_(!1);
|
|
409
|
+
}, x = (S, D) => i.value[D] === v(S), A = (S, D) => {
|
|
410
|
+
if (B(S)) return;
|
|
411
|
+
const q = i.value.slice(0, D);
|
|
412
|
+
if (q.push(v(S)), i.value = q, f(S)) return;
|
|
413
|
+
const ee = C(q);
|
|
414
|
+
a("update:modelValue", [...q]), a("change", [...q], ee), V();
|
|
415
|
+
}, R = () => {
|
|
416
|
+
i.value = [], a("update:modelValue", []), a("change", [], []), a("clear"), V();
|
|
417
|
+
}, H = (S) => {
|
|
418
|
+
var D;
|
|
419
|
+
l.value && ((D = r.value) != null && D.contains(S.target) || V());
|
|
420
|
+
};
|
|
421
|
+
return Y(
|
|
422
|
+
() => l.value,
|
|
423
|
+
(S) => {
|
|
424
|
+
S ? (i.value = [...e.modelValue], document.addEventListener("click", H)) : document.removeEventListener("click", H);
|
|
425
|
+
}
|
|
426
|
+
), Y(
|
|
427
|
+
() => e.modelValue,
|
|
428
|
+
(S) => {
|
|
429
|
+
i.value = [...S];
|
|
430
|
+
},
|
|
431
|
+
{ immediate: !0 }
|
|
432
|
+
), ae(() => {
|
|
433
|
+
document.removeEventListener("click", H);
|
|
434
|
+
}), (S, D) => (n(), d("div", {
|
|
435
|
+
ref_key: "cascaderRef",
|
|
436
|
+
ref: r,
|
|
437
|
+
class: N(["jh-cascader", h.value])
|
|
438
|
+
}, [
|
|
439
|
+
b("button", {
|
|
440
|
+
class: "jh-cascader__trigger",
|
|
441
|
+
type: "button",
|
|
442
|
+
disabled: S.disabled,
|
|
443
|
+
"aria-expanded": l.value,
|
|
444
|
+
onClick: L
|
|
445
|
+
}, [
|
|
446
|
+
b("span", {
|
|
447
|
+
class: N(["jh-cascader__label", { "is-placeholder": !F.value }])
|
|
448
|
+
}, J(F.value || S.placeholder), 3),
|
|
449
|
+
w.value ? (n(), d("button", {
|
|
450
|
+
key: 0,
|
|
451
|
+
class: "jh-cascader__clear",
|
|
452
|
+
type: "button",
|
|
453
|
+
"aria-label": "Clear cascader",
|
|
454
|
+
onClick: te(R, ["stop"])
|
|
455
|
+
}, [
|
|
456
|
+
K(M(z), { name: "close" })
|
|
457
|
+
])) : (n(), U(M(z), {
|
|
458
|
+
key: 1,
|
|
459
|
+
class: "jh-cascader__arrow",
|
|
460
|
+
name: "arrow-right"
|
|
461
|
+
}))
|
|
462
|
+
], 8, bt),
|
|
463
|
+
K(le, { name: "jh-cascader-fade" }, {
|
|
464
|
+
default: X(() => [
|
|
465
|
+
l.value ? (n(), d("div", gt, [
|
|
466
|
+
(n(!0), d(O, null, W(u.value, (q, ee) => (n(), d("ul", {
|
|
467
|
+
key: ee,
|
|
468
|
+
class: "jh-cascader__menu"
|
|
469
|
+
}, [
|
|
470
|
+
(n(!0), d(O, null, W(q, (G) => (n(), d("li", {
|
|
471
|
+
key: String(v(G)),
|
|
472
|
+
class: "jh-cascader__menu-item"
|
|
473
|
+
}, [
|
|
474
|
+
b("button", {
|
|
475
|
+
class: N(["jh-cascader__option", {
|
|
476
|
+
"is-active": x(G, ee),
|
|
477
|
+
"is-disabled": B(G)
|
|
478
|
+
}]),
|
|
479
|
+
type: "button",
|
|
480
|
+
disabled: B(G),
|
|
481
|
+
onClick: (fe) => A(G, ee)
|
|
482
|
+
}, [
|
|
483
|
+
b("span", null, J(g(G)), 1),
|
|
484
|
+
f(G) ? (n(), U(M(z), {
|
|
485
|
+
key: 0,
|
|
486
|
+
name: "arrow-right",
|
|
487
|
+
class: "jh-cascader__option-arrow"
|
|
488
|
+
})) : j("", !0)
|
|
489
|
+
], 10, vt)
|
|
490
|
+
]))), 128))
|
|
491
|
+
]))), 128))
|
|
492
|
+
])) : j("", !0)
|
|
493
|
+
]),
|
|
494
|
+
_: 1
|
|
495
|
+
})
|
|
496
|
+
], 2));
|
|
497
|
+
}
|
|
498
|
+
}), _t = I(yt), $e = Symbol("carouselContextKey"), kt = ["always", "hover", "never"], $t = {
|
|
499
|
+
modelValue: {
|
|
500
|
+
type: Number,
|
|
501
|
+
default: void 0
|
|
502
|
+
},
|
|
503
|
+
height: {
|
|
504
|
+
type: String,
|
|
505
|
+
default: "200px"
|
|
506
|
+
},
|
|
507
|
+
autoplay: {
|
|
508
|
+
type: Boolean,
|
|
509
|
+
default: !0
|
|
510
|
+
},
|
|
511
|
+
interval: {
|
|
512
|
+
type: Number,
|
|
513
|
+
default: 3e3
|
|
514
|
+
},
|
|
515
|
+
loop: {
|
|
516
|
+
type: Boolean,
|
|
517
|
+
default: !0
|
|
518
|
+
},
|
|
519
|
+
arrow: {
|
|
520
|
+
type: String,
|
|
521
|
+
default: "hover",
|
|
522
|
+
validator: (t) => kt.includes(t)
|
|
523
|
+
},
|
|
524
|
+
indicator: {
|
|
525
|
+
type: Boolean,
|
|
526
|
+
default: !0
|
|
527
|
+
}
|
|
528
|
+
}, Ct = {
|
|
529
|
+
"update:modelValue": (t) => Number.isInteger(t),
|
|
530
|
+
change: (t, s) => Number.isInteger(t) && Number.isInteger(s)
|
|
531
|
+
}, jt = {
|
|
532
|
+
name: {
|
|
533
|
+
type: String,
|
|
534
|
+
default: ""
|
|
535
|
+
}
|
|
536
|
+
}, wt = {
|
|
537
|
+
key: 0,
|
|
538
|
+
class: "jh-carousel__indicators"
|
|
539
|
+
}, St = ["aria-label", "onClick"], Bt = /* @__PURE__ */ T({
|
|
540
|
+
name: "JhCarousel",
|
|
541
|
+
__name: "carousel",
|
|
542
|
+
props: $t,
|
|
543
|
+
emits: Ct,
|
|
544
|
+
setup(t, { emit: s }) {
|
|
545
|
+
const e = t, a = s, l = E([]), i = E(e.modelValue ?? 0), r = k(() => {
|
|
546
|
+
var $;
|
|
547
|
+
return ($ = l.value[o.value]) == null ? void 0 : $.uid;
|
|
548
|
+
});
|
|
549
|
+
let h;
|
|
550
|
+
const o = k(() => l.value.length === 0 ? 0 : Math.min(Math.max(i.value, 0), l.value.length - 1)), c = ($, F) => {
|
|
551
|
+
i.value = $, a("update:modelValue", $), $ !== F && a("change", $, F);
|
|
552
|
+
}, m = ($) => {
|
|
553
|
+
if (l.value.length === 0) return;
|
|
554
|
+
const F = o.value, u = l.value.length - 1;
|
|
555
|
+
let w = $;
|
|
556
|
+
w < 0 && (w = e.loop ? u : 0), w > u && (w = e.loop ? 0 : u), c(w, F);
|
|
557
|
+
}, p = () => m(o.value - 1), g = () => m(o.value + 1), v = () => {
|
|
558
|
+
h && (window.clearInterval(h), h = void 0);
|
|
559
|
+
}, y = () => {
|
|
560
|
+
v(), !(!e.autoplay || e.interval <= 0 || l.value.length <= 1) && (h = window.setInterval(g, e.interval));
|
|
561
|
+
}, B = () => v();
|
|
562
|
+
return pe($e, {
|
|
563
|
+
activeUid: r,
|
|
564
|
+
registerItem: ($) => {
|
|
565
|
+
l.value.push($), y();
|
|
566
|
+
},
|
|
567
|
+
unregisterItem: ($) => {
|
|
568
|
+
l.value = l.value.filter((F) => F.uid !== $.uid), i.value > l.value.length - 1 && (i.value = Math.max(l.value.length - 1, 0)), y();
|
|
569
|
+
}
|
|
570
|
+
}), Y(
|
|
571
|
+
() => e.modelValue,
|
|
572
|
+
($) => {
|
|
573
|
+
typeof $ == "number" && (i.value = $);
|
|
574
|
+
}
|
|
575
|
+
), Y(
|
|
576
|
+
() => [e.autoplay, e.interval, l.value.length],
|
|
577
|
+
() => y()
|
|
578
|
+
), ae(() => {
|
|
579
|
+
v();
|
|
580
|
+
}), ($, F) => (n(), d("div", {
|
|
581
|
+
class: N(["jh-carousel", [`jh-carousel--arrow-${$.arrow}`]]),
|
|
582
|
+
onMouseenter: B,
|
|
583
|
+
onMouseleave: y
|
|
584
|
+
}, [
|
|
585
|
+
b("div", {
|
|
586
|
+
class: "jh-carousel__container",
|
|
587
|
+
style: Z({ height: $.height })
|
|
588
|
+
}, [
|
|
589
|
+
P($.$slots, "default"),
|
|
590
|
+
$.arrow !== "never" && l.value.length > 1 ? (n(), d("button", {
|
|
591
|
+
key: 0,
|
|
592
|
+
class: "jh-carousel__arrow jh-carousel__arrow--left",
|
|
593
|
+
type: "button",
|
|
594
|
+
"aria-label": "Previous",
|
|
595
|
+
onClick: p
|
|
596
|
+
}, [
|
|
597
|
+
K(M(z), { name: "arrow-left" })
|
|
598
|
+
])) : j("", !0),
|
|
599
|
+
$.arrow !== "never" && l.value.length > 1 ? (n(), d("button", {
|
|
600
|
+
key: 1,
|
|
601
|
+
class: "jh-carousel__arrow jh-carousel__arrow--right",
|
|
602
|
+
type: "button",
|
|
603
|
+
"aria-label": "Next",
|
|
604
|
+
onClick: g
|
|
605
|
+
}, [
|
|
606
|
+
K(M(z), { name: "arrow-right" })
|
|
607
|
+
])) : j("", !0)
|
|
608
|
+
], 4),
|
|
609
|
+
$.indicator && l.value.length > 1 ? (n(), d("div", wt, [
|
|
610
|
+
(n(!0), d(O, null, W(l.value, (u, w) => (n(), d("button", {
|
|
611
|
+
key: w,
|
|
612
|
+
class: N(["jh-carousel__indicator", { "is-active": w === o.value }]),
|
|
613
|
+
type: "button",
|
|
614
|
+
"aria-label": `Go to slide ${w + 1}`,
|
|
615
|
+
onClick: (_) => m(w)
|
|
616
|
+
}, null, 10, St))), 128))
|
|
617
|
+
])) : j("", !0)
|
|
618
|
+
], 34));
|
|
619
|
+
}
|
|
620
|
+
}), Vt = /* @__PURE__ */ T({
|
|
621
|
+
name: "JhCarouselItem",
|
|
622
|
+
__name: "carousel-item",
|
|
623
|
+
props: jt,
|
|
624
|
+
setup(t) {
|
|
625
|
+
const s = he($e, void 0), e = Symbol("carouselItem"), a = k(() => (s == null ? void 0 : s.activeUid.value) === e), l = {
|
|
626
|
+
uid: e
|
|
627
|
+
};
|
|
628
|
+
return se(() => {
|
|
629
|
+
s == null || s.registerItem(l);
|
|
630
|
+
}), ae(() => {
|
|
631
|
+
s == null || s.unregisterItem(l);
|
|
632
|
+
}), (i, r) => ce((n(), d("div", {
|
|
633
|
+
class: N(["jh-carousel__item", { "is-active": a.value }])
|
|
634
|
+
}, [
|
|
635
|
+
P(i.$slots, "default")
|
|
636
|
+
], 2)), [
|
|
637
|
+
[ue, a.value]
|
|
638
|
+
]);
|
|
639
|
+
}
|
|
640
|
+
}), Nt = I(Bt), Pt = I(Vt), At = {
|
|
641
|
+
modelValue: {
|
|
642
|
+
type: [Boolean, Array],
|
|
643
|
+
default: !1
|
|
644
|
+
},
|
|
645
|
+
value: {
|
|
646
|
+
type: [String, Number, Boolean],
|
|
647
|
+
default: !0
|
|
648
|
+
},
|
|
649
|
+
label: String,
|
|
650
|
+
disabled: Boolean
|
|
651
|
+
}, Tt = {
|
|
652
|
+
modelValue: {
|
|
653
|
+
type: Array,
|
|
654
|
+
default: () => []
|
|
655
|
+
},
|
|
656
|
+
disabled: Boolean
|
|
657
|
+
}, Jt = {
|
|
658
|
+
"update:modelValue": (t) => !0,
|
|
659
|
+
change: (t) => !0
|
|
660
|
+
}, Et = {
|
|
661
|
+
"update:modelValue": (t) => !0,
|
|
662
|
+
change: (t) => !0
|
|
663
|
+
}, Ce = Symbol("JhCheckboxGroup"), It = { class: "jh-checkbox__input" }, Mt = ["checked", "disabled"], zt = {
|
|
664
|
+
key: 0,
|
|
665
|
+
class: "jh-checkbox__label"
|
|
666
|
+
}, Kt = /* @__PURE__ */ T({
|
|
667
|
+
name: "JhCheckbox",
|
|
668
|
+
__name: "checkbox",
|
|
669
|
+
props: At,
|
|
670
|
+
emits: Jt,
|
|
671
|
+
setup(t, { emit: s }) {
|
|
672
|
+
const e = t, a = s, l = he(Ce, void 0), i = k(() => e.disabled || !!(l != null && l.disabled())), r = k(() => l ? l.modelValue().includes(e.value) : Array.isArray(e.modelValue) ? e.modelValue.includes(e.value) : !!e.modelValue), h = (o) => {
|
|
673
|
+
const c = o.target.checked;
|
|
674
|
+
if (l) {
|
|
675
|
+
l.changeValue(e.value, c);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
if (Array.isArray(e.modelValue)) {
|
|
679
|
+
const m = c ? [...e.modelValue, e.value] : e.modelValue.filter((p) => p !== e.value);
|
|
680
|
+
a("update:modelValue", m), a("change", m);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
a("update:modelValue", c), a("change", c);
|
|
684
|
+
};
|
|
685
|
+
return (o, c) => (n(), d("label", {
|
|
686
|
+
class: N(["jh-checkbox", { "is-checked": r.value, "is-disabled": i.value }])
|
|
687
|
+
}, [
|
|
688
|
+
b("span", It, [
|
|
689
|
+
b("input", {
|
|
690
|
+
class: "jh-checkbox__original",
|
|
691
|
+
type: "checkbox",
|
|
692
|
+
checked: r.value,
|
|
693
|
+
disabled: i.value,
|
|
694
|
+
onChange: h
|
|
695
|
+
}, null, 40, Mt),
|
|
696
|
+
c[0] || (c[0] = b("span", { class: "jh-checkbox__inner" }, null, -1))
|
|
697
|
+
]),
|
|
698
|
+
o.$slots.default || o.label ? (n(), d("span", zt, [
|
|
699
|
+
P(o.$slots, "default", {}, () => [
|
|
700
|
+
Q(J(o.label), 1)
|
|
701
|
+
])
|
|
702
|
+
])) : j("", !0)
|
|
703
|
+
], 2));
|
|
704
|
+
}
|
|
705
|
+
}), Ft = /* @__PURE__ */ T({
|
|
706
|
+
name: "JhCheckboxGroup",
|
|
707
|
+
__name: "checkbox-group",
|
|
708
|
+
props: Tt,
|
|
709
|
+
emits: Et,
|
|
710
|
+
setup(t, { emit: s }) {
|
|
711
|
+
const e = t, a = s;
|
|
712
|
+
return pe(Ce, {
|
|
713
|
+
modelValue: () => e.modelValue,
|
|
714
|
+
disabled: () => e.disabled,
|
|
715
|
+
changeValue: (i, r) => {
|
|
716
|
+
const h = r ? [...e.modelValue, i] : e.modelValue.filter((o) => o !== i);
|
|
717
|
+
a("update:modelValue", h), a("change", h);
|
|
718
|
+
}
|
|
719
|
+
}), (i, r) => (n(), d("div", {
|
|
720
|
+
class: N(["jh-checkbox-group", { "is-disabled": i.disabled }]),
|
|
721
|
+
role: "group"
|
|
722
|
+
}, [
|
|
723
|
+
P(i.$slots, "default")
|
|
724
|
+
], 2));
|
|
725
|
+
}
|
|
726
|
+
}), Dt = I(Kt), Lt = I(Ft), je = Symbol("collapseContextKey"), Rt = {
|
|
727
|
+
modelValue: {
|
|
728
|
+
type: [String, Number, Array],
|
|
729
|
+
default: () => []
|
|
730
|
+
},
|
|
731
|
+
accordion: Boolean
|
|
732
|
+
}, Ot = {
|
|
733
|
+
"update:modelValue": (t) => typeof t == "string" || typeof t == "number" || Array.isArray(t),
|
|
734
|
+
change: (t) => typeof t == "string" || typeof t == "number" || Array.isArray(t)
|
|
735
|
+
}, Ht = {
|
|
736
|
+
name: {
|
|
737
|
+
type: [String, Number],
|
|
738
|
+
required: !0
|
|
739
|
+
},
|
|
740
|
+
title: {
|
|
741
|
+
type: String,
|
|
742
|
+
default: ""
|
|
743
|
+
},
|
|
744
|
+
disabled: Boolean
|
|
745
|
+
}, xt = { class: "jh-collapse" }, qt = /* @__PURE__ */ T({
|
|
746
|
+
name: "JhCollapse",
|
|
747
|
+
__name: "collapse",
|
|
748
|
+
props: Rt,
|
|
749
|
+
emits: Ot,
|
|
750
|
+
setup(t, { emit: s }) {
|
|
751
|
+
const e = t, a = s, l = () => Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue], i = (h) => l().includes(h);
|
|
752
|
+
return pe(je, {
|
|
753
|
+
isActive: i,
|
|
754
|
+
toggle: (h) => {
|
|
755
|
+
if (e.accordion) {
|
|
756
|
+
const m = i(h) ? "" : h;
|
|
757
|
+
a("update:modelValue", m), a("change", m);
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
const o = l().filter((m) => m !== ""), c = i(h) ? o.filter((m) => m !== h) : [...o, h];
|
|
761
|
+
a("update:modelValue", c), a("change", c);
|
|
762
|
+
}
|
|
763
|
+
}), (h, o) => (n(), d("div", xt, [
|
|
764
|
+
P(h.$slots, "default")
|
|
765
|
+
]));
|
|
766
|
+
}
|
|
767
|
+
}), Gt = ["disabled"], Ut = { class: "jh-collapse-item__wrap" }, Wt = { class: "jh-collapse-item__content" }, Yt = /* @__PURE__ */ T({
|
|
768
|
+
name: "JhCollapseItem",
|
|
769
|
+
__name: "collapse-item",
|
|
770
|
+
props: Ht,
|
|
771
|
+
setup(t) {
|
|
772
|
+
const s = t, e = he(je, void 0), a = k(() => (e == null ? void 0 : e.isActive(s.name)) ?? !1), l = () => {
|
|
773
|
+
s.disabled || e == null || e.toggle(s.name);
|
|
774
|
+
};
|
|
775
|
+
return (i, r) => (n(), d("div", {
|
|
776
|
+
class: N(["jh-collapse-item", { "is-active": a.value, "is-disabled": i.disabled }])
|
|
777
|
+
}, [
|
|
778
|
+
b("button", {
|
|
779
|
+
class: "jh-collapse-item__header",
|
|
780
|
+
type: "button",
|
|
781
|
+
disabled: i.disabled,
|
|
782
|
+
onClick: l
|
|
783
|
+
}, [
|
|
784
|
+
P(i.$slots, "title", {}, () => [
|
|
785
|
+
Q(J(i.title), 1)
|
|
786
|
+
]),
|
|
787
|
+
K(M(z), {
|
|
788
|
+
class: "jh-collapse-item__arrow",
|
|
789
|
+
name: "arrow-right"
|
|
790
|
+
})
|
|
791
|
+
], 8, Gt),
|
|
792
|
+
ce(b("div", Ut, [
|
|
793
|
+
b("div", Wt, [
|
|
794
|
+
P(i.$slots, "default")
|
|
795
|
+
])
|
|
796
|
+
], 512), [
|
|
797
|
+
[ue, a.value]
|
|
798
|
+
])
|
|
799
|
+
], 2));
|
|
800
|
+
}
|
|
801
|
+
}), Zt = I(qt), Qt = I(Yt), Xt = {
|
|
802
|
+
modelValue: {
|
|
803
|
+
type: String,
|
|
804
|
+
default: ""
|
|
805
|
+
},
|
|
806
|
+
placeholder: String,
|
|
807
|
+
disabled: Boolean,
|
|
808
|
+
clearable: Boolean
|
|
809
|
+
}, ea = {
|
|
810
|
+
"update:modelValue": (t) => !0,
|
|
811
|
+
change: (t) => !0,
|
|
812
|
+
clear: () => !0
|
|
813
|
+
}, ta = ["value", "placeholder", "disabled"], aa = /* @__PURE__ */ T({
|
|
814
|
+
name: "JhDatePicker",
|
|
815
|
+
__name: "date-picker",
|
|
816
|
+
props: Xt,
|
|
817
|
+
emits: ea,
|
|
818
|
+
setup(t, { emit: s }) {
|
|
819
|
+
const e = t, a = s, l = k(() => e.clearable && !e.disabled && !!e.modelValue), i = (o) => {
|
|
820
|
+
a("update:modelValue", o.target.value);
|
|
821
|
+
}, r = (o) => {
|
|
822
|
+
a("change", o.target.value);
|
|
823
|
+
}, h = () => {
|
|
824
|
+
a("update:modelValue", ""), a("change", ""), a("clear");
|
|
825
|
+
};
|
|
826
|
+
return (o, c) => (n(), d("div", {
|
|
827
|
+
class: N(["jh-date-picker", { "is-disabled": o.disabled }])
|
|
828
|
+
}, [
|
|
829
|
+
b("input", {
|
|
830
|
+
class: "jh-date-picker__inner",
|
|
831
|
+
type: "date",
|
|
832
|
+
value: o.modelValue,
|
|
833
|
+
placeholder: o.placeholder,
|
|
834
|
+
disabled: o.disabled,
|
|
835
|
+
onInput: i,
|
|
836
|
+
onChange: r
|
|
837
|
+
}, null, 40, ta),
|
|
838
|
+
l.value ? (n(), d("button", {
|
|
839
|
+
key: 0,
|
|
840
|
+
class: "jh-date-picker__clear",
|
|
841
|
+
type: "button",
|
|
842
|
+
onClick: h
|
|
843
|
+
}, [
|
|
844
|
+
K(M(z), { name: "close" })
|
|
845
|
+
])) : j("", !0)
|
|
846
|
+
], 2));
|
|
847
|
+
}
|
|
848
|
+
}), la = I(aa), sa = {
|
|
849
|
+
modelValue: {
|
|
850
|
+
type: String,
|
|
851
|
+
default: ""
|
|
852
|
+
},
|
|
853
|
+
placeholder: String,
|
|
854
|
+
disabled: Boolean,
|
|
855
|
+
clearable: Boolean
|
|
856
|
+
}, oa = {
|
|
857
|
+
"update:modelValue": (t) => !0,
|
|
858
|
+
change: (t) => !0,
|
|
859
|
+
clear: () => !0
|
|
860
|
+
}, na = ["value", "placeholder", "disabled"], ia = /* @__PURE__ */ T({
|
|
861
|
+
name: "JhDateTimePicker",
|
|
862
|
+
__name: "date-time-picker",
|
|
863
|
+
props: sa,
|
|
864
|
+
emits: oa,
|
|
865
|
+
setup(t, { emit: s }) {
|
|
866
|
+
const e = t, a = s, l = k(() => e.clearable && !e.disabled && !!e.modelValue), i = (o) => {
|
|
867
|
+
a("update:modelValue", o.target.value);
|
|
868
|
+
}, r = (o) => {
|
|
869
|
+
a("change", o.target.value);
|
|
870
|
+
}, h = () => {
|
|
871
|
+
a("update:modelValue", ""), a("change", ""), a("clear");
|
|
872
|
+
};
|
|
873
|
+
return (o, c) => (n(), d("div", {
|
|
874
|
+
class: N(["jh-date-picker", { "is-disabled": o.disabled }])
|
|
875
|
+
}, [
|
|
876
|
+
b("input", {
|
|
877
|
+
class: "jh-date-picker__inner",
|
|
878
|
+
type: "datetime-local",
|
|
879
|
+
value: o.modelValue,
|
|
880
|
+
placeholder: o.placeholder,
|
|
881
|
+
disabled: o.disabled,
|
|
882
|
+
onInput: i,
|
|
883
|
+
onChange: r
|
|
884
|
+
}, null, 40, na),
|
|
885
|
+
l.value ? (n(), d("button", {
|
|
886
|
+
key: 0,
|
|
887
|
+
class: "jh-date-picker__clear",
|
|
888
|
+
type: "button",
|
|
889
|
+
onClick: h
|
|
890
|
+
}, [
|
|
891
|
+
K(M(z), { name: "close" })
|
|
892
|
+
])) : j("", !0)
|
|
893
|
+
], 2));
|
|
894
|
+
}
|
|
895
|
+
}), ra = I(ia), da = {
|
|
896
|
+
modelValue: Boolean,
|
|
897
|
+
title: String,
|
|
898
|
+
width: {
|
|
899
|
+
type: String,
|
|
900
|
+
default: "50%"
|
|
901
|
+
},
|
|
902
|
+
closeOnClickModal: {
|
|
903
|
+
type: Boolean,
|
|
904
|
+
default: !0
|
|
905
|
+
},
|
|
906
|
+
beforeClose: Function
|
|
907
|
+
}, ca = {
|
|
908
|
+
"update:modelValue": (t) => !0,
|
|
909
|
+
open: () => !0,
|
|
910
|
+
close: () => !0,
|
|
911
|
+
closed: () => !0
|
|
912
|
+
}, ua = ["aria-label"], pa = { class: "jh-dialog__header" }, ha = { class: "jh-dialog__title" }, ma = { class: "jh-dialog__body" }, fa = {
|
|
913
|
+
key: 0,
|
|
914
|
+
class: "jh-dialog__footer"
|
|
915
|
+
}, ba = /* @__PURE__ */ T({
|
|
916
|
+
name: "JhDialog",
|
|
917
|
+
__name: "dialog",
|
|
918
|
+
props: da,
|
|
919
|
+
emits: ca,
|
|
920
|
+
setup(t, { emit: s }) {
|
|
921
|
+
const e = t, a = s, l = k(() => ({
|
|
922
|
+
width: e.width
|
|
923
|
+
})), i = () => {
|
|
924
|
+
a("update:modelValue", !1), a("close");
|
|
925
|
+
}, r = () => {
|
|
926
|
+
if (e.beforeClose) {
|
|
927
|
+
e.beforeClose(i);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
i();
|
|
931
|
+
}, h = () => {
|
|
932
|
+
e.closeOnClickModal && r();
|
|
933
|
+
};
|
|
934
|
+
return Y(
|
|
935
|
+
() => e.modelValue,
|
|
936
|
+
(o) => {
|
|
937
|
+
o && a("open");
|
|
938
|
+
}
|
|
939
|
+
), (o, c) => (n(), U(_e, { to: "body" }, [
|
|
940
|
+
K(le, {
|
|
941
|
+
name: "jh-dialog-fade",
|
|
942
|
+
onAfterLeave: c[1] || (c[1] = (m) => a("closed"))
|
|
943
|
+
}, {
|
|
944
|
+
default: X(() => [
|
|
945
|
+
o.modelValue ? (n(), d("div", {
|
|
946
|
+
key: 0,
|
|
947
|
+
class: "jh-overlay",
|
|
948
|
+
onClick: h
|
|
949
|
+
}, [
|
|
950
|
+
b("div", {
|
|
951
|
+
class: "jh-dialog",
|
|
952
|
+
role: "dialog",
|
|
953
|
+
"aria-modal": "true",
|
|
954
|
+
"aria-label": o.title || "Dialog",
|
|
955
|
+
style: Z(l.value),
|
|
956
|
+
onClick: c[0] || (c[0] = te(() => {
|
|
957
|
+
}, ["stop"]))
|
|
958
|
+
}, [
|
|
959
|
+
b("header", pa, [
|
|
960
|
+
P(o.$slots, "header", {}, () => [
|
|
961
|
+
b("span", ha, J(o.title), 1)
|
|
962
|
+
]),
|
|
963
|
+
b("button", {
|
|
964
|
+
class: "jh-dialog__close",
|
|
965
|
+
type: "button",
|
|
966
|
+
"aria-label": "Close dialog",
|
|
967
|
+
onClick: r
|
|
968
|
+
}, " x ")
|
|
969
|
+
]),
|
|
970
|
+
b("section", ma, [
|
|
971
|
+
P(o.$slots, "default")
|
|
972
|
+
]),
|
|
973
|
+
o.$slots.footer ? (n(), d("footer", fa, [
|
|
974
|
+
P(o.$slots, "footer")
|
|
975
|
+
])) : j("", !0)
|
|
976
|
+
], 12, ua)
|
|
977
|
+
])) : j("", !0)
|
|
978
|
+
]),
|
|
979
|
+
_: 3
|
|
980
|
+
})
|
|
981
|
+
]));
|
|
982
|
+
}
|
|
983
|
+
}), ga = I(ba), va = ["rtl", "ltr", "ttb", "btt"], ya = {
|
|
984
|
+
modelValue: Boolean,
|
|
985
|
+
title: {
|
|
986
|
+
type: String,
|
|
987
|
+
default: ""
|
|
988
|
+
},
|
|
989
|
+
size: {
|
|
990
|
+
type: String,
|
|
991
|
+
default: "30%"
|
|
992
|
+
},
|
|
993
|
+
direction: {
|
|
994
|
+
type: String,
|
|
995
|
+
default: "rtl",
|
|
996
|
+
validator: (t) => va.includes(t)
|
|
997
|
+
},
|
|
998
|
+
closeOnClickModal: {
|
|
999
|
+
type: Boolean,
|
|
1000
|
+
default: !0
|
|
1001
|
+
},
|
|
1002
|
+
beforeClose: {
|
|
1003
|
+
type: Function,
|
|
1004
|
+
default: void 0
|
|
1005
|
+
}
|
|
1006
|
+
}, _a = {
|
|
1007
|
+
"update:modelValue": (t) => !0,
|
|
1008
|
+
open: () => !0,
|
|
1009
|
+
close: () => !0,
|
|
1010
|
+
closed: () => !0
|
|
1011
|
+
}, ka = ["aria-label"], $a = { class: "jh-drawer__header" }, Ca = { class: "jh-drawer__title" }, ja = { class: "jh-drawer__body" }, wa = {
|
|
1012
|
+
key: 0,
|
|
1013
|
+
class: "jh-drawer__footer"
|
|
1014
|
+
}, Sa = /* @__PURE__ */ T({
|
|
1015
|
+
name: "JhDrawer",
|
|
1016
|
+
__name: "drawer",
|
|
1017
|
+
props: ya,
|
|
1018
|
+
emits: _a,
|
|
1019
|
+
setup(t, { emit: s }) {
|
|
1020
|
+
const e = t, a = s, l = k(() => e.direction === "ttb" || e.direction === "btt" ? { height: e.size } : { width: e.size }), i = () => {
|
|
1021
|
+
a("update:modelValue", !1), a("close");
|
|
1022
|
+
}, r = () => {
|
|
1023
|
+
if (e.beforeClose) {
|
|
1024
|
+
e.beforeClose(i);
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
i();
|
|
1028
|
+
}, h = () => {
|
|
1029
|
+
e.closeOnClickModal && r();
|
|
1030
|
+
};
|
|
1031
|
+
return Y(
|
|
1032
|
+
() => e.modelValue,
|
|
1033
|
+
(o) => {
|
|
1034
|
+
o && a("open");
|
|
1035
|
+
}
|
|
1036
|
+
), (o, c) => (n(), U(_e, { to: "body" }, [
|
|
1037
|
+
K(le, {
|
|
1038
|
+
name: "jh-drawer-fade",
|
|
1039
|
+
onAfterLeave: c[1] || (c[1] = (m) => a("closed"))
|
|
1040
|
+
}, {
|
|
1041
|
+
default: X(() => [
|
|
1042
|
+
o.modelValue ? (n(), d("div", {
|
|
1043
|
+
key: 0,
|
|
1044
|
+
class: N(["jh-drawer-overlay", `jh-drawer-overlay--${o.direction}`]),
|
|
1045
|
+
onClick: h
|
|
1046
|
+
}, [
|
|
1047
|
+
b("aside", {
|
|
1048
|
+
class: N(["jh-drawer", `jh-drawer--${o.direction}`]),
|
|
1049
|
+
role: "dialog",
|
|
1050
|
+
"aria-modal": "true",
|
|
1051
|
+
"aria-label": o.title || "Drawer",
|
|
1052
|
+
style: Z(l.value),
|
|
1053
|
+
onClick: c[0] || (c[0] = te(() => {
|
|
1054
|
+
}, ["stop"]))
|
|
1055
|
+
}, [
|
|
1056
|
+
b("header", $a, [
|
|
1057
|
+
P(o.$slots, "header", {}, () => [
|
|
1058
|
+
b("span", Ca, J(o.title), 1)
|
|
1059
|
+
]),
|
|
1060
|
+
b("button", {
|
|
1061
|
+
class: "jh-drawer__close",
|
|
1062
|
+
type: "button",
|
|
1063
|
+
"aria-label": "Close drawer",
|
|
1064
|
+
onClick: r
|
|
1065
|
+
}, [
|
|
1066
|
+
K(M(z), { name: "close" })
|
|
1067
|
+
])
|
|
1068
|
+
]),
|
|
1069
|
+
b("section", ja, [
|
|
1070
|
+
P(o.$slots, "default")
|
|
1071
|
+
]),
|
|
1072
|
+
o.$slots.footer ? (n(), d("footer", wa, [
|
|
1073
|
+
P(o.$slots, "footer")
|
|
1074
|
+
])) : j("", !0)
|
|
1075
|
+
], 14, ka)
|
|
1076
|
+
], 2)) : j("", !0)
|
|
1077
|
+
]),
|
|
1078
|
+
_: 3
|
|
1079
|
+
})
|
|
1080
|
+
]));
|
|
1081
|
+
}
|
|
1082
|
+
}), Ba = I(Sa), Va = ["click", "hover"], Na = ["bottom-start", "bottom-end"], Pa = {
|
|
1083
|
+
options: {
|
|
1084
|
+
type: Array,
|
|
1085
|
+
default: () => []
|
|
1086
|
+
},
|
|
1087
|
+
trigger: {
|
|
1088
|
+
type: String,
|
|
1089
|
+
default: "click",
|
|
1090
|
+
validator: (t) => Va.includes(t)
|
|
1091
|
+
},
|
|
1092
|
+
placement: {
|
|
1093
|
+
type: String,
|
|
1094
|
+
default: "bottom-start",
|
|
1095
|
+
validator: (t) => Na.includes(t)
|
|
1096
|
+
},
|
|
1097
|
+
disabled: Boolean,
|
|
1098
|
+
hideOnClick: {
|
|
1099
|
+
type: Boolean,
|
|
1100
|
+
default: !0
|
|
1101
|
+
}
|
|
1102
|
+
}, Aa = {
|
|
1103
|
+
command: (t, s) => !0,
|
|
1104
|
+
"visible-change": (t) => !0
|
|
1105
|
+
}, Ta = ["disabled", "aria-expanded"], Ja = ["aria-expanded"], Ea = {
|
|
1106
|
+
key: 0,
|
|
1107
|
+
class: "jh-dropdown__menu",
|
|
1108
|
+
role: "menu"
|
|
1109
|
+
}, Ia = ["disabled", "onClick"], Ma = /* @__PURE__ */ T({
|
|
1110
|
+
name: "JhDropdown",
|
|
1111
|
+
__name: "dropdown",
|
|
1112
|
+
props: Pa,
|
|
1113
|
+
emits: Aa,
|
|
1114
|
+
setup(t, { emit: s }) {
|
|
1115
|
+
const e = t, a = s, l = E(!1), i = E(), r = k(() => ({
|
|
1116
|
+
"is-disabled": e.disabled,
|
|
1117
|
+
"is-visible": l.value,
|
|
1118
|
+
[`jh-dropdown--${e.placement}`]: !0
|
|
1119
|
+
})), h = (B) => {
|
|
1120
|
+
e.disabled || l.value !== B && (l.value = B, a("visible-change", B));
|
|
1121
|
+
}, o = () => h(!1), c = () => h(!l.value), m = () => {
|
|
1122
|
+
e.trigger === "click" && c();
|
|
1123
|
+
}, p = () => {
|
|
1124
|
+
e.trigger === "hover" && h(!0);
|
|
1125
|
+
}, g = () => {
|
|
1126
|
+
e.trigger === "hover" && o();
|
|
1127
|
+
}, v = (B) => {
|
|
1128
|
+
B.disabled || (a("command", B.command, B), e.hideOnClick && o());
|
|
1129
|
+
}, y = (B) => {
|
|
1130
|
+
var f;
|
|
1131
|
+
l.value && ((f = i.value) != null && f.contains(B.target) || o());
|
|
1132
|
+
};
|
|
1133
|
+
return Y(
|
|
1134
|
+
() => l.value,
|
|
1135
|
+
(B) => {
|
|
1136
|
+
e.trigger === "click" && (B ? document.addEventListener("click", y) : document.removeEventListener("click", y));
|
|
1137
|
+
}
|
|
1138
|
+
), ae(() => {
|
|
1139
|
+
document.removeEventListener("click", y);
|
|
1140
|
+
}), (B, f) => (n(), d("div", {
|
|
1141
|
+
ref_key: "dropdownRef",
|
|
1142
|
+
ref: i,
|
|
1143
|
+
class: N(["jh-dropdown", r.value]),
|
|
1144
|
+
onMouseenter: p,
|
|
1145
|
+
onMouseleave: g
|
|
1146
|
+
}, [
|
|
1147
|
+
B.$slots.default ? (n(), d("div", {
|
|
1148
|
+
key: 1,
|
|
1149
|
+
class: "jh-dropdown__trigger",
|
|
1150
|
+
"aria-expanded": l.value,
|
|
1151
|
+
"aria-haspopup": "menu",
|
|
1152
|
+
onClick: m
|
|
1153
|
+
}, [
|
|
1154
|
+
P(B.$slots, "default")
|
|
1155
|
+
], 8, Ja)) : (n(), d("button", {
|
|
1156
|
+
key: 0,
|
|
1157
|
+
class: "jh-dropdown__trigger",
|
|
1158
|
+
type: "button",
|
|
1159
|
+
disabled: B.disabled,
|
|
1160
|
+
"aria-expanded": l.value,
|
|
1161
|
+
"aria-haspopup": "menu",
|
|
1162
|
+
onClick: m
|
|
1163
|
+
}, [
|
|
1164
|
+
f[0] || (f[0] = Q(" Dropdown ", -1)),
|
|
1165
|
+
K(M(z), {
|
|
1166
|
+
name: "arrow-right",
|
|
1167
|
+
class: "jh-dropdown__arrow"
|
|
1168
|
+
})
|
|
1169
|
+
], 8, Ta)),
|
|
1170
|
+
K(le, { name: "jh-dropdown-fade" }, {
|
|
1171
|
+
default: X(() => [
|
|
1172
|
+
l.value ? (n(), d("div", Ea, [
|
|
1173
|
+
P(B.$slots, "dropdown", {}, () => [
|
|
1174
|
+
(n(!0), d(O, null, W(B.options, (C) => (n(), d("button", {
|
|
1175
|
+
key: C.command,
|
|
1176
|
+
class: N(["jh-dropdown__item", { "is-disabled": C.disabled, "is-divided": C.divided }]),
|
|
1177
|
+
type: "button",
|
|
1178
|
+
role: "menuitem",
|
|
1179
|
+
disabled: C.disabled,
|
|
1180
|
+
onClick: ($) => v(C)
|
|
1181
|
+
}, J(C.label), 11, Ia))), 128))
|
|
1182
|
+
])
|
|
1183
|
+
])) : j("", !0)
|
|
1184
|
+
]),
|
|
1185
|
+
_: 3
|
|
1186
|
+
})
|
|
1187
|
+
], 34));
|
|
1188
|
+
}
|
|
1189
|
+
}), za = I(Ma), Ka = {
|
|
1190
|
+
model: {
|
|
1191
|
+
type: Object,
|
|
1192
|
+
default: () => ({})
|
|
1193
|
+
},
|
|
1194
|
+
rules: {
|
|
1195
|
+
type: Object,
|
|
1196
|
+
default: () => ({})
|
|
1197
|
+
},
|
|
1198
|
+
labelWidth: {
|
|
1199
|
+
type: String,
|
|
1200
|
+
default: "100px"
|
|
1201
|
+
}
|
|
1202
|
+
}, Fa = {
|
|
1203
|
+
label: String,
|
|
1204
|
+
prop: String,
|
|
1205
|
+
rules: [Object, Array],
|
|
1206
|
+
required: Boolean
|
|
1207
|
+
}, we = Symbol("JhForm"), Da = /* @__PURE__ */ T({
|
|
1208
|
+
name: "JhForm",
|
|
1209
|
+
__name: "form",
|
|
1210
|
+
props: Ka,
|
|
1211
|
+
setup(t, { expose: s }) {
|
|
1212
|
+
const e = t, a = E([]), l = (o) => {
|
|
1213
|
+
a.value.push(o);
|
|
1214
|
+
}, i = (o) => {
|
|
1215
|
+
a.value = a.value.filter((c) => c !== o);
|
|
1216
|
+
}, r = async () => (await Promise.all(a.value.map((c) => c.validate()))).every(Boolean), h = () => {
|
|
1217
|
+
a.value.forEach((o) => o.resetField());
|
|
1218
|
+
};
|
|
1219
|
+
return pe(we, {
|
|
1220
|
+
model: e.model,
|
|
1221
|
+
rules: e.rules,
|
|
1222
|
+
registerItem: l,
|
|
1223
|
+
unregisterItem: i
|
|
1224
|
+
}), s({
|
|
1225
|
+
validate: r,
|
|
1226
|
+
resetFields: h
|
|
1227
|
+
}), (o, c) => (n(), d("form", {
|
|
1228
|
+
class: "jh-form",
|
|
1229
|
+
style: Z({ "--jh-form-label-width": o.labelWidth }),
|
|
1230
|
+
onSubmit: c[0] || (c[0] = te(() => {
|
|
1231
|
+
}, ["prevent"]))
|
|
1232
|
+
}, [
|
|
1233
|
+
P(o.$slots, "default")
|
|
1234
|
+
], 36));
|
|
1235
|
+
}
|
|
1236
|
+
}), La = {
|
|
1237
|
+
key: 0,
|
|
1238
|
+
class: "jh-form-item__label"
|
|
1239
|
+
}, Ra = { class: "jh-form-item__content" }, Oa = {
|
|
1240
|
+
key: 0,
|
|
1241
|
+
class: "jh-form-item__error"
|
|
1242
|
+
}, Ha = /* @__PURE__ */ T({
|
|
1243
|
+
name: "JhFormItem",
|
|
1244
|
+
__name: "form-item",
|
|
1245
|
+
props: Fa,
|
|
1246
|
+
setup(t, { expose: s }) {
|
|
1247
|
+
const e = t, a = he(we, void 0), l = E(""), i = k(() => {
|
|
1248
|
+
const p = e.prop ? a == null ? void 0 : a.rules[e.prop] : void 0, g = e.rules || p || [];
|
|
1249
|
+
return Array.isArray(g) ? g : [g];
|
|
1250
|
+
}), r = k(() => e.required || i.value.some((p) => p.required)), h = () => e.prop ? a == null ? void 0 : a.model[e.prop] : void 0, o = async () => {
|
|
1251
|
+
l.value = "";
|
|
1252
|
+
for (const p of i.value) {
|
|
1253
|
+
const g = h();
|
|
1254
|
+
if ((e.required || p.required) && (g === "" || g === void 0 || g === null))
|
|
1255
|
+
return l.value = p.message || `${e.label || e.prop || "Field"} is required`, !1;
|
|
1256
|
+
if (p.validator) {
|
|
1257
|
+
const v = await p.validator(g, (a == null ? void 0 : a.model) || {});
|
|
1258
|
+
if (v !== !0)
|
|
1259
|
+
return l.value = typeof v == "string" ? v : p.message || "Validation failed", !1;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
return !0;
|
|
1263
|
+
}, c = () => {
|
|
1264
|
+
e.prop && (a != null && a.model) && (a.model[e.prop] = ""), l.value = "";
|
|
1265
|
+
}, m = {
|
|
1266
|
+
prop: e.prop,
|
|
1267
|
+
validate: o,
|
|
1268
|
+
resetField: c
|
|
1269
|
+
};
|
|
1270
|
+
return se(() => {
|
|
1271
|
+
a == null || a.registerItem(m);
|
|
1272
|
+
}), ae(() => {
|
|
1273
|
+
a == null || a.unregisterItem(m);
|
|
1274
|
+
}), s({
|
|
1275
|
+
validate: o,
|
|
1276
|
+
resetField: c
|
|
1277
|
+
}), (p, g) => (n(), d("div", {
|
|
1278
|
+
class: N(["jh-form-item", { "is-error": !!l.value, "is-required": r.value }])
|
|
1279
|
+
}, [
|
|
1280
|
+
p.label ? (n(), d("label", La, J(p.label), 1)) : j("", !0),
|
|
1281
|
+
b("div", Ra, [
|
|
1282
|
+
P(p.$slots, "default"),
|
|
1283
|
+
l.value ? (n(), d("div", Oa, J(l.value), 1)) : j("", !0)
|
|
1284
|
+
])
|
|
1285
|
+
], 2));
|
|
1286
|
+
}
|
|
1287
|
+
}), xa = I(Da), qa = I(Ha), Ga = {
|
|
1288
|
+
height: {
|
|
1289
|
+
type: String,
|
|
1290
|
+
default: "240px"
|
|
1291
|
+
},
|
|
1292
|
+
distance: {
|
|
1293
|
+
type: Number,
|
|
1294
|
+
default: 0
|
|
1295
|
+
},
|
|
1296
|
+
delay: {
|
|
1297
|
+
type: Number,
|
|
1298
|
+
default: 200
|
|
1299
|
+
},
|
|
1300
|
+
disabled: Boolean,
|
|
1301
|
+
loading: Boolean,
|
|
1302
|
+
immediate: Boolean
|
|
1303
|
+
}, Ua = {
|
|
1304
|
+
load: (t) => Number.isFinite(t.scrollTop) && Number.isFinite(t.clientHeight) && Number.isFinite(t.scrollHeight)
|
|
1305
|
+
}, Wa = {
|
|
1306
|
+
key: 0,
|
|
1307
|
+
class: "jh-infinite-scroll__loading"
|
|
1308
|
+
}, Ya = /* @__PURE__ */ T({
|
|
1309
|
+
name: "JhInfiniteScroll",
|
|
1310
|
+
__name: "infinite-scroll",
|
|
1311
|
+
props: Ga,
|
|
1312
|
+
emits: Ua,
|
|
1313
|
+
setup(t, { expose: s, emit: e }) {
|
|
1314
|
+
const a = t, l = e, i = E();
|
|
1315
|
+
let r;
|
|
1316
|
+
const h = () => {
|
|
1317
|
+
r && (window.clearTimeout(r), r = void 0);
|
|
1318
|
+
}, o = (g) => g.scrollHeight - g.scrollTop - g.clientHeight <= a.distance, c = (g) => {
|
|
1319
|
+
a.disabled || a.loading || l("load", {
|
|
1320
|
+
scrollTop: g.scrollTop,
|
|
1321
|
+
clientHeight: g.clientHeight,
|
|
1322
|
+
scrollHeight: g.scrollHeight
|
|
1323
|
+
});
|
|
1324
|
+
}, m = () => {
|
|
1325
|
+
const g = i.value;
|
|
1326
|
+
!g || !o(g) || c(g);
|
|
1327
|
+
}, p = () => {
|
|
1328
|
+
h(), r = window.setTimeout(m, a.delay);
|
|
1329
|
+
};
|
|
1330
|
+
return se(() => {
|
|
1331
|
+
a.immediate && be(m);
|
|
1332
|
+
}), s({
|
|
1333
|
+
check: m
|
|
1334
|
+
}), (g, v) => (n(), d("div", {
|
|
1335
|
+
ref_key: "containerRef",
|
|
1336
|
+
ref: i,
|
|
1337
|
+
class: N(["jh-infinite-scroll", { "is-disabled": g.disabled, "is-loading": g.loading }]),
|
|
1338
|
+
style: Z({ height: g.height }),
|
|
1339
|
+
onScroll: p
|
|
1340
|
+
}, [
|
|
1341
|
+
P(g.$slots, "default"),
|
|
1342
|
+
g.$slots.loading || g.loading ? (n(), d("div", Wa, [
|
|
1343
|
+
P(g.$slots, "loading", {}, () => [
|
|
1344
|
+
v[0] || (v[0] = Q("Loading...", -1))
|
|
1345
|
+
])
|
|
1346
|
+
])) : j("", !0)
|
|
1347
|
+
], 38));
|
|
1348
|
+
}
|
|
1349
|
+
}), Za = I(Ya), Qa = {
|
|
1350
|
+
modelValue: {
|
|
1351
|
+
type: [String, Number],
|
|
1352
|
+
default: ""
|
|
1353
|
+
},
|
|
1354
|
+
placeholder: String,
|
|
1355
|
+
disabled: Boolean,
|
|
1356
|
+
clearable: Boolean,
|
|
1357
|
+
password: Boolean,
|
|
1358
|
+
prefixIcon: String,
|
|
1359
|
+
suffixIcon: String,
|
|
1360
|
+
name: String,
|
|
1361
|
+
autocomplete: String
|
|
1362
|
+
}, Xa = {
|
|
1363
|
+
"update:modelValue": (t) => !0,
|
|
1364
|
+
input: (t) => !0,
|
|
1365
|
+
change: (t) => !0,
|
|
1366
|
+
clear: () => !0,
|
|
1367
|
+
focus: (t) => t instanceof FocusEvent,
|
|
1368
|
+
blur: (t) => t instanceof FocusEvent
|
|
1369
|
+
}, el = {
|
|
1370
|
+
key: 0,
|
|
1371
|
+
class: "jh-input__prefix"
|
|
1372
|
+
}, tl = ["value", "type", "name", "placeholder", "disabled", "autocomplete"], al = {
|
|
1373
|
+
key: 1,
|
|
1374
|
+
class: "jh-input__suffix"
|
|
1375
|
+
}, ll = ["disabled"], sl = ["disabled", "aria-label"], ol = /* @__PURE__ */ T({
|
|
1376
|
+
name: "JhInput",
|
|
1377
|
+
__name: "input",
|
|
1378
|
+
props: Qa,
|
|
1379
|
+
emits: Xa,
|
|
1380
|
+
setup(t, { emit: s }) {
|
|
1381
|
+
const e = t, a = s, l = E(), i = E(!1), r = E(!1), h = Te(), o = k(() => e.password && !i.value ? "password" : "text"), c = k(() => e.modelValue !== "" && e.modelValue !== void 0), m = k(() => e.clearable && !e.disabled && c.value), p = k(
|
|
1382
|
+
() => m.value || e.password || !!e.suffixIcon || !!h.suffix
|
|
1383
|
+
), g = k(() => ({
|
|
1384
|
+
"is-disabled": e.disabled,
|
|
1385
|
+
"is-focus": r.value,
|
|
1386
|
+
"jh-input--prefix": !!h.prefix || !!e.prefixIcon,
|
|
1387
|
+
"jh-input--suffix": p.value
|
|
1388
|
+
})), v = (u) => {
|
|
1389
|
+
a("update:modelValue", u), a("input", u);
|
|
1390
|
+
}, y = (u) => {
|
|
1391
|
+
v(u.target.value);
|
|
1392
|
+
}, B = (u) => {
|
|
1393
|
+
a("change", u.target.value);
|
|
1394
|
+
}, f = () => {
|
|
1395
|
+
var u;
|
|
1396
|
+
e.disabled || (v(""), a("clear"), (u = l.value) == null || u.focus());
|
|
1397
|
+
}, C = () => {
|
|
1398
|
+
var u;
|
|
1399
|
+
e.disabled || (i.value = !i.value, (u = l.value) == null || u.focus());
|
|
1400
|
+
}, $ = (u) => {
|
|
1401
|
+
r.value = !0, a("focus", u);
|
|
1402
|
+
}, F = (u) => {
|
|
1403
|
+
r.value = !1, a("blur", u);
|
|
1404
|
+
};
|
|
1405
|
+
return (u, w) => (n(), d("div", {
|
|
1406
|
+
class: N(["jh-input", g.value])
|
|
1407
|
+
}, [
|
|
1408
|
+
u.$slots.prefix || u.prefixIcon ? (n(), d("span", el, [
|
|
1409
|
+
P(u.$slots, "prefix", {}, () => [
|
|
1410
|
+
u.prefixIcon ? (n(), U(M(z), {
|
|
1411
|
+
key: 0,
|
|
1412
|
+
class: "jh-input__icon",
|
|
1413
|
+
name: u.prefixIcon
|
|
1414
|
+
}, null, 8, ["name"])) : j("", !0)
|
|
1415
|
+
])
|
|
1416
|
+
])) : j("", !0),
|
|
1417
|
+
b("input", {
|
|
1418
|
+
ref_key: "inputRef",
|
|
1419
|
+
ref: l,
|
|
1420
|
+
class: "jh-input__inner",
|
|
1421
|
+
value: u.modelValue,
|
|
1422
|
+
type: o.value,
|
|
1423
|
+
name: u.name,
|
|
1424
|
+
placeholder: u.placeholder,
|
|
1425
|
+
disabled: u.disabled,
|
|
1426
|
+
autocomplete: u.autocomplete,
|
|
1427
|
+
onInput: y,
|
|
1428
|
+
onChange: B,
|
|
1429
|
+
onFocus: $,
|
|
1430
|
+
onBlur: F
|
|
1431
|
+
}, null, 40, tl),
|
|
1432
|
+
p.value ? (n(), d("span", al, [
|
|
1433
|
+
m.value ? (n(), d("button", {
|
|
1434
|
+
key: 0,
|
|
1435
|
+
class: "jh-input__action",
|
|
1436
|
+
type: "button",
|
|
1437
|
+
disabled: u.disabled,
|
|
1438
|
+
"aria-label": "Clear input",
|
|
1439
|
+
onMousedown: w[0] || (w[0] = te(() => {
|
|
1440
|
+
}, ["prevent"])),
|
|
1441
|
+
onClick: f
|
|
1442
|
+
}, [
|
|
1443
|
+
K(M(z), { name: "close" })
|
|
1444
|
+
], 40, ll)) : u.password ? (n(), d("button", {
|
|
1445
|
+
key: 1,
|
|
1446
|
+
class: "jh-input__action",
|
|
1447
|
+
type: "button",
|
|
1448
|
+
disabled: u.disabled,
|
|
1449
|
+
"aria-label": i.value ? "Hide password" : "Show password",
|
|
1450
|
+
onMousedown: w[1] || (w[1] = te(() => {
|
|
1451
|
+
}, ["prevent"])),
|
|
1452
|
+
onClick: C
|
|
1453
|
+
}, [
|
|
1454
|
+
K(M(z), {
|
|
1455
|
+
name: i.value ? "eye-off" : "eye"
|
|
1456
|
+
}, null, 8, ["name"])
|
|
1457
|
+
], 40, sl)) : P(u.$slots, "suffix", { key: 2 }, () => [
|
|
1458
|
+
u.suffixIcon ? (n(), U(M(z), {
|
|
1459
|
+
key: 0,
|
|
1460
|
+
class: "jh-input__icon",
|
|
1461
|
+
name: u.suffixIcon
|
|
1462
|
+
}, null, 8, ["name"])) : j("", !0)
|
|
1463
|
+
])
|
|
1464
|
+
])) : j("", !0)
|
|
1465
|
+
], 2));
|
|
1466
|
+
}
|
|
1467
|
+
}), nl = I(ol), il = ["default", "primary", "success", "warning", "danger", "info"], rl = {
|
|
1468
|
+
type: {
|
|
1469
|
+
type: String,
|
|
1470
|
+
default: "default",
|
|
1471
|
+
validator: (t) => il.includes(t)
|
|
1472
|
+
},
|
|
1473
|
+
href: String,
|
|
1474
|
+
target: String,
|
|
1475
|
+
disabled: Boolean,
|
|
1476
|
+
underline: {
|
|
1477
|
+
type: Boolean,
|
|
1478
|
+
default: !0
|
|
1479
|
+
},
|
|
1480
|
+
icon: String
|
|
1481
|
+
}, dl = {
|
|
1482
|
+
click: (t) => t instanceof MouseEvent
|
|
1483
|
+
}, cl = ["href", "target", "aria-disabled"], ul = {
|
|
1484
|
+
key: 1,
|
|
1485
|
+
class: "jh-link__inner"
|
|
1486
|
+
}, pl = /* @__PURE__ */ T({
|
|
1487
|
+
name: "JhLink",
|
|
1488
|
+
__name: "link",
|
|
1489
|
+
props: rl,
|
|
1490
|
+
emits: dl,
|
|
1491
|
+
setup(t, { emit: s }) {
|
|
1492
|
+
const e = t, a = s, l = k(() => [
|
|
1493
|
+
`jh-link--${e.type}`,
|
|
1494
|
+
{
|
|
1495
|
+
"is-disabled": e.disabled,
|
|
1496
|
+
"is-underline": e.underline
|
|
1497
|
+
}
|
|
1498
|
+
]), i = (r) => {
|
|
1499
|
+
if (e.disabled) {
|
|
1500
|
+
r.preventDefault();
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
a("click", r);
|
|
1504
|
+
};
|
|
1505
|
+
return (r, h) => (n(), d("a", {
|
|
1506
|
+
class: N(["jh-link", l.value]),
|
|
1507
|
+
href: r.disabled ? void 0 : r.href,
|
|
1508
|
+
target: r.disabled ? void 0 : r.target,
|
|
1509
|
+
"aria-disabled": r.disabled,
|
|
1510
|
+
onClick: i
|
|
1511
|
+
}, [
|
|
1512
|
+
r.icon ? (n(), U(M(z), {
|
|
1513
|
+
key: 0,
|
|
1514
|
+
class: "jh-link__icon",
|
|
1515
|
+
name: r.icon
|
|
1516
|
+
}, null, 8, ["name"])) : j("", !0),
|
|
1517
|
+
r.$slots.default ? (n(), d("span", ul, [
|
|
1518
|
+
P(r.$slots, "default")
|
|
1519
|
+
])) : j("", !0)
|
|
1520
|
+
], 10, cl));
|
|
1521
|
+
}
|
|
1522
|
+
}), hl = I(pl), ml = ["success", "warning", "info", "danger"], fl = {
|
|
1523
|
+
id: {
|
|
1524
|
+
type: String,
|
|
1525
|
+
required: !0
|
|
1526
|
+
},
|
|
1527
|
+
message: {
|
|
1528
|
+
type: String,
|
|
1529
|
+
default: ""
|
|
1530
|
+
},
|
|
1531
|
+
type: {
|
|
1532
|
+
type: String,
|
|
1533
|
+
default: "info",
|
|
1534
|
+
validator: (t) => ml.includes(t)
|
|
1535
|
+
},
|
|
1536
|
+
duration: {
|
|
1537
|
+
type: Number,
|
|
1538
|
+
default: 3e3
|
|
1539
|
+
},
|
|
1540
|
+
showClose: Boolean,
|
|
1541
|
+
offset: {
|
|
1542
|
+
type: Number,
|
|
1543
|
+
default: 20
|
|
1544
|
+
},
|
|
1545
|
+
zIndex: {
|
|
1546
|
+
type: Number,
|
|
1547
|
+
default: 3e3
|
|
1548
|
+
},
|
|
1549
|
+
onClose: Function,
|
|
1550
|
+
onDestroy: Function
|
|
1551
|
+
}, bl = { class: "jh-message__content" }, gl = /* @__PURE__ */ T({
|
|
1552
|
+
name: "JhMessage",
|
|
1553
|
+
__name: "message",
|
|
1554
|
+
props: fl,
|
|
1555
|
+
setup(t, { expose: s }) {
|
|
1556
|
+
const e = t, a = E(!1);
|
|
1557
|
+
let l;
|
|
1558
|
+
const i = k(() => ({
|
|
1559
|
+
top: `${e.offset}px`,
|
|
1560
|
+
zIndex: e.zIndex
|
|
1561
|
+
})), r = () => {
|
|
1562
|
+
l && (clearTimeout(l), l = void 0);
|
|
1563
|
+
}, h = () => {
|
|
1564
|
+
var m;
|
|
1565
|
+
a.value && (a.value = !1, (m = e.onClose) == null || m.call(e));
|
|
1566
|
+
}, o = () => {
|
|
1567
|
+
e.duration <= 0 || (r(), l = setTimeout(h, e.duration));
|
|
1568
|
+
}, c = () => {
|
|
1569
|
+
var m;
|
|
1570
|
+
(m = e.onDestroy) == null || m.call(e);
|
|
1571
|
+
};
|
|
1572
|
+
return se(() => {
|
|
1573
|
+
a.value = !0, o();
|
|
1574
|
+
}), ae(() => {
|
|
1575
|
+
r();
|
|
1576
|
+
}), s({
|
|
1577
|
+
close: h
|
|
1578
|
+
}), (m, p) => (n(), U(le, {
|
|
1579
|
+
name: "jh-message-fade",
|
|
1580
|
+
onAfterLeave: c
|
|
1581
|
+
}, {
|
|
1582
|
+
default: X(() => [
|
|
1583
|
+
ce(b("div", {
|
|
1584
|
+
class: N(["jh-message", `jh-message--${m.type}`]),
|
|
1585
|
+
role: "alert",
|
|
1586
|
+
style: Z(i.value),
|
|
1587
|
+
onMouseenter: r,
|
|
1588
|
+
onMouseleave: o
|
|
1589
|
+
}, [
|
|
1590
|
+
p[0] || (p[0] = b("span", {
|
|
1591
|
+
class: "jh-message__icon",
|
|
1592
|
+
"aria-hidden": "true"
|
|
1593
|
+
}, null, -1)),
|
|
1594
|
+
b("span", bl, [
|
|
1595
|
+
P(m.$slots, "default", {}, () => [
|
|
1596
|
+
Q(J(m.message), 1)
|
|
1597
|
+
])
|
|
1598
|
+
]),
|
|
1599
|
+
m.showClose ? (n(), d("button", {
|
|
1600
|
+
key: 0,
|
|
1601
|
+
class: "jh-message__close",
|
|
1602
|
+
type: "button",
|
|
1603
|
+
"aria-label": "Close message",
|
|
1604
|
+
onClick: h
|
|
1605
|
+
}, [
|
|
1606
|
+
K(M(z), { name: "close" })
|
|
1607
|
+
])) : j("", !0)
|
|
1608
|
+
], 38), [
|
|
1609
|
+
[ue, a.value]
|
|
1610
|
+
])
|
|
1611
|
+
]),
|
|
1612
|
+
_: 3
|
|
1613
|
+
}));
|
|
1614
|
+
}
|
|
1615
|
+
}), ie = [];
|
|
1616
|
+
let vl = 1;
|
|
1617
|
+
const Se = (t = {}) => typeof t == "string" ? { message: t } : t, yl = (t) => t + ie.length * 56, Be = (t = {}) => {
|
|
1618
|
+
if (typeof document > "u")
|
|
1619
|
+
return { close: () => {
|
|
1620
|
+
} };
|
|
1621
|
+
const s = Se(t), e = document.createElement("div"), a = `jh-message-${vl++}`, l = () => {
|
|
1622
|
+
const h = ie.find((o) => o.id === a);
|
|
1623
|
+
h == null || h.close();
|
|
1624
|
+
}, i = {
|
|
1625
|
+
id: a,
|
|
1626
|
+
message: s.message ?? "",
|
|
1627
|
+
type: s.type ?? "info",
|
|
1628
|
+
duration: s.duration ?? 3e3,
|
|
1629
|
+
showClose: s.showClose ?? !1,
|
|
1630
|
+
offset: yl(s.offset ?? 20),
|
|
1631
|
+
zIndex: s.zIndex ?? 3e3,
|
|
1632
|
+
onClose: s.onClose,
|
|
1633
|
+
onDestroy: () => {
|
|
1634
|
+
const h = ie.findIndex((o) => o.id === a);
|
|
1635
|
+
h > -1 && ie.splice(h, 1), de(null, e), e.remove();
|
|
1636
|
+
}
|
|
1637
|
+
}, r = K(gl, i);
|
|
1638
|
+
return de(r, e), document.body.appendChild(e), ie.push({
|
|
1639
|
+
id: a,
|
|
1640
|
+
close: () => {
|
|
1641
|
+
var o, c;
|
|
1642
|
+
const h = (o = r.component) == null ? void 0 : o.exposed;
|
|
1643
|
+
(c = h == null ? void 0 : h.close) == null || c.call(h);
|
|
1644
|
+
}
|
|
1645
|
+
}), { close: l };
|
|
1646
|
+
}, ge = (t) => (s = {}) => Be({
|
|
1647
|
+
...Se(s),
|
|
1648
|
+
type: t
|
|
1649
|
+
}), oe = Be;
|
|
1650
|
+
oe.success = ge("success");
|
|
1651
|
+
oe.warning = ge("warning");
|
|
1652
|
+
oe.info = ge("info");
|
|
1653
|
+
oe.danger = ge("danger");
|
|
1654
|
+
oe.closeAll = () => {
|
|
1655
|
+
[...ie].forEach((t) => t.close());
|
|
1656
|
+
};
|
|
1657
|
+
oe.install = (t) => {
|
|
1658
|
+
t.config.globalProperties.$message = oe;
|
|
1659
|
+
};
|
|
1660
|
+
const _l = ["success", "warning", "info", "danger"], kl = {
|
|
1661
|
+
title: {
|
|
1662
|
+
type: String,
|
|
1663
|
+
default: "Message"
|
|
1664
|
+
},
|
|
1665
|
+
message: {
|
|
1666
|
+
type: String,
|
|
1667
|
+
default: ""
|
|
1668
|
+
},
|
|
1669
|
+
type: {
|
|
1670
|
+
type: String,
|
|
1671
|
+
default: "info",
|
|
1672
|
+
validator: (t) => _l.includes(t)
|
|
1673
|
+
},
|
|
1674
|
+
confirmButtonText: {
|
|
1675
|
+
type: String,
|
|
1676
|
+
default: "OK"
|
|
1677
|
+
},
|
|
1678
|
+
cancelButtonText: {
|
|
1679
|
+
type: String,
|
|
1680
|
+
default: "Cancel"
|
|
1681
|
+
},
|
|
1682
|
+
showCancelButton: Boolean,
|
|
1683
|
+
showClose: {
|
|
1684
|
+
type: Boolean,
|
|
1685
|
+
default: !0
|
|
1686
|
+
},
|
|
1687
|
+
closeOnClickModal: {
|
|
1688
|
+
type: Boolean,
|
|
1689
|
+
default: !0
|
|
1690
|
+
},
|
|
1691
|
+
zIndex: {
|
|
1692
|
+
type: Number,
|
|
1693
|
+
default: 3e3
|
|
1694
|
+
},
|
|
1695
|
+
beforeClose: Function,
|
|
1696
|
+
onAction: Function,
|
|
1697
|
+
onDestroy: Function
|
|
1698
|
+
}, $l = ["aria-label"], Cl = { class: "jh-message-box__header" }, jl = { class: "jh-message-box__title" }, wl = { class: "jh-message-box__body" }, Sl = { class: "jh-message-box__message" }, Bl = { class: "jh-message-box__footer" }, Vl = /* @__PURE__ */ T({
|
|
1699
|
+
name: "JhMessageBox",
|
|
1700
|
+
__name: "message-box",
|
|
1701
|
+
props: kl,
|
|
1702
|
+
setup(t, { expose: s }) {
|
|
1703
|
+
const e = t, a = E(!1);
|
|
1704
|
+
let l = !1;
|
|
1705
|
+
const i = () => {
|
|
1706
|
+
a.value = !1;
|
|
1707
|
+
}, r = (c) => {
|
|
1708
|
+
if (l) return;
|
|
1709
|
+
const m = () => {
|
|
1710
|
+
var p;
|
|
1711
|
+
l = !0, (p = e.onAction) == null || p.call(e, c), i();
|
|
1712
|
+
};
|
|
1713
|
+
if (e.beforeClose) {
|
|
1714
|
+
e.beforeClose(c, m);
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
m();
|
|
1718
|
+
}, h = () => {
|
|
1719
|
+
e.closeOnClickModal && r("close");
|
|
1720
|
+
}, o = () => {
|
|
1721
|
+
var c;
|
|
1722
|
+
(c = e.onDestroy) == null || c.call(e);
|
|
1723
|
+
};
|
|
1724
|
+
return se(() => {
|
|
1725
|
+
a.value = !0;
|
|
1726
|
+
}), s({
|
|
1727
|
+
close: () => r("close")
|
|
1728
|
+
}), (c, m) => (n(), U(_e, { to: "body" }, [
|
|
1729
|
+
K(le, {
|
|
1730
|
+
name: "jh-message-box-fade",
|
|
1731
|
+
onAfterLeave: o
|
|
1732
|
+
}, {
|
|
1733
|
+
default: X(() => [
|
|
1734
|
+
a.value ? (n(), d("div", {
|
|
1735
|
+
key: 0,
|
|
1736
|
+
class: "jh-message-box-overlay",
|
|
1737
|
+
style: Z({ zIndex: c.zIndex }),
|
|
1738
|
+
onClick: h
|
|
1739
|
+
}, [
|
|
1740
|
+
b("section", {
|
|
1741
|
+
class: N(["jh-message-box", `jh-message-box--${c.type}`]),
|
|
1742
|
+
role: "dialog",
|
|
1743
|
+
"aria-modal": "true",
|
|
1744
|
+
"aria-label": c.title,
|
|
1745
|
+
onClick: m[3] || (m[3] = te(() => {
|
|
1746
|
+
}, ["stop"]))
|
|
1747
|
+
}, [
|
|
1748
|
+
b("header", Cl, [
|
|
1749
|
+
b("div", jl, J(c.title), 1),
|
|
1750
|
+
c.showClose ? (n(), d("button", {
|
|
1751
|
+
key: 0,
|
|
1752
|
+
class: "jh-message-box__close",
|
|
1753
|
+
type: "button",
|
|
1754
|
+
"aria-label": "Close message box",
|
|
1755
|
+
onClick: m[0] || (m[0] = (p) => r("close"))
|
|
1756
|
+
}, [
|
|
1757
|
+
K(M(z), { name: "close" })
|
|
1758
|
+
])) : j("", !0)
|
|
1759
|
+
]),
|
|
1760
|
+
b("div", wl, [
|
|
1761
|
+
m[4] || (m[4] = b("span", {
|
|
1762
|
+
class: "jh-message-box__status",
|
|
1763
|
+
"aria-hidden": "true"
|
|
1764
|
+
}, null, -1)),
|
|
1765
|
+
b("div", Sl, [
|
|
1766
|
+
P(c.$slots, "default", {}, () => [
|
|
1767
|
+
Q(J(c.message), 1)
|
|
1768
|
+
])
|
|
1769
|
+
])
|
|
1770
|
+
]),
|
|
1771
|
+
b("footer", Bl, [
|
|
1772
|
+
c.showCancelButton ? (n(), U(M(ye), {
|
|
1773
|
+
key: 0,
|
|
1774
|
+
onClick: m[1] || (m[1] = (p) => r("cancel"))
|
|
1775
|
+
}, {
|
|
1776
|
+
default: X(() => [
|
|
1777
|
+
Q(J(c.cancelButtonText), 1)
|
|
1778
|
+
]),
|
|
1779
|
+
_: 1
|
|
1780
|
+
})) : j("", !0),
|
|
1781
|
+
K(M(ye), {
|
|
1782
|
+
type: "primary",
|
|
1783
|
+
onClick: m[2] || (m[2] = (p) => r("confirm"))
|
|
1784
|
+
}, {
|
|
1785
|
+
default: X(() => [
|
|
1786
|
+
Q(J(c.confirmButtonText), 1)
|
|
1787
|
+
]),
|
|
1788
|
+
_: 1
|
|
1789
|
+
})
|
|
1790
|
+
])
|
|
1791
|
+
], 10, $l)
|
|
1792
|
+
], 4)) : j("", !0)
|
|
1793
|
+
]),
|
|
1794
|
+
_: 3
|
|
1795
|
+
})
|
|
1796
|
+
]));
|
|
1797
|
+
}
|
|
1798
|
+
}), Nl = (t = {}) => typeof t == "string" ? { message: t } : t, ke = (t = {}) => {
|
|
1799
|
+
if (typeof document > "u")
|
|
1800
|
+
return Promise.resolve("close");
|
|
1801
|
+
const s = Nl(t), e = document.createElement("div");
|
|
1802
|
+
return new Promise((a) => {
|
|
1803
|
+
const l = {
|
|
1804
|
+
title: s.title ?? "Message",
|
|
1805
|
+
message: s.message ?? "",
|
|
1806
|
+
type: s.type ?? "info",
|
|
1807
|
+
confirmButtonText: s.confirmButtonText ?? "OK",
|
|
1808
|
+
cancelButtonText: s.cancelButtonText ?? "Cancel",
|
|
1809
|
+
showCancelButton: s.showCancelButton ?? !1,
|
|
1810
|
+
showClose: s.showClose ?? !0,
|
|
1811
|
+
closeOnClickModal: s.closeOnClickModal ?? !0,
|
|
1812
|
+
zIndex: s.zIndex ?? 3e3,
|
|
1813
|
+
beforeClose: s.beforeClose,
|
|
1814
|
+
onAction: (r) => {
|
|
1815
|
+
a(r);
|
|
1816
|
+
},
|
|
1817
|
+
onDestroy: () => {
|
|
1818
|
+
de(null, e), e.remove();
|
|
1819
|
+
}
|
|
1820
|
+
}, i = K(Vl, l);
|
|
1821
|
+
de(i, e), document.body.appendChild(e);
|
|
1822
|
+
});
|
|
1823
|
+
}, me = ke;
|
|
1824
|
+
me.alert = (t, s = "Message", e = {}) => ke({
|
|
1825
|
+
...e,
|
|
1826
|
+
title: s,
|
|
1827
|
+
message: t,
|
|
1828
|
+
showCancelButton: !1
|
|
1829
|
+
});
|
|
1830
|
+
me.confirm = (t, s = "Message", e = {}) => ke({
|
|
1831
|
+
...e,
|
|
1832
|
+
title: s,
|
|
1833
|
+
message: t,
|
|
1834
|
+
showCancelButton: !0
|
|
1835
|
+
});
|
|
1836
|
+
me.install = (t) => {
|
|
1837
|
+
t.config.globalProperties.$messageBox = me;
|
|
1838
|
+
};
|
|
1839
|
+
const Pl = ["success", "warning", "info", "danger"], Al = [
|
|
1840
|
+
"top-right",
|
|
1841
|
+
"top-left",
|
|
1842
|
+
"bottom-right",
|
|
1843
|
+
"bottom-left"
|
|
1844
|
+
], Tl = {
|
|
1845
|
+
id: {
|
|
1846
|
+
type: String,
|
|
1847
|
+
required: !0
|
|
1848
|
+
},
|
|
1849
|
+
title: {
|
|
1850
|
+
type: String,
|
|
1851
|
+
default: ""
|
|
1852
|
+
},
|
|
1853
|
+
message: {
|
|
1854
|
+
type: String,
|
|
1855
|
+
default: ""
|
|
1856
|
+
},
|
|
1857
|
+
type: {
|
|
1858
|
+
type: String,
|
|
1859
|
+
default: "info",
|
|
1860
|
+
validator: (t) => Pl.includes(t)
|
|
1861
|
+
},
|
|
1862
|
+
duration: {
|
|
1863
|
+
type: Number,
|
|
1864
|
+
default: 4500
|
|
1865
|
+
},
|
|
1866
|
+
showClose: {
|
|
1867
|
+
type: Boolean,
|
|
1868
|
+
default: !0
|
|
1869
|
+
},
|
|
1870
|
+
position: {
|
|
1871
|
+
type: String,
|
|
1872
|
+
default: "top-right",
|
|
1873
|
+
validator: (t) => Al.includes(t)
|
|
1874
|
+
},
|
|
1875
|
+
offset: {
|
|
1876
|
+
type: Number,
|
|
1877
|
+
default: 20
|
|
1878
|
+
},
|
|
1879
|
+
zIndex: {
|
|
1880
|
+
type: Number,
|
|
1881
|
+
default: 3e3
|
|
1882
|
+
},
|
|
1883
|
+
onClose: Function,
|
|
1884
|
+
onDestroy: Function
|
|
1885
|
+
}, Jl = { class: "jh-notification__content" }, El = {
|
|
1886
|
+
key: 0,
|
|
1887
|
+
class: "jh-notification__title"
|
|
1888
|
+
}, Il = {
|
|
1889
|
+
key: 1,
|
|
1890
|
+
class: "jh-notification__message"
|
|
1891
|
+
}, Ml = /* @__PURE__ */ T({
|
|
1892
|
+
name: "JhNotification",
|
|
1893
|
+
__name: "notification",
|
|
1894
|
+
props: Tl,
|
|
1895
|
+
setup(t, { expose: s }) {
|
|
1896
|
+
const e = t, a = E(!1);
|
|
1897
|
+
let l;
|
|
1898
|
+
const i = k(() => e.position.endsWith("right")), r = k(() => e.position.startsWith("bottom")), h = k(
|
|
1899
|
+
() => i.value ? "jh-notification-slide-right" : "jh-notification-slide-left"
|
|
1900
|
+
), o = k(() => ({
|
|
1901
|
+
zIndex: e.zIndex,
|
|
1902
|
+
[i.value ? "right" : "left"]: "20px",
|
|
1903
|
+
[r.value ? "bottom" : "top"]: `${e.offset}px`
|
|
1904
|
+
})), c = () => {
|
|
1905
|
+
l && (clearTimeout(l), l = void 0);
|
|
1906
|
+
}, m = () => {
|
|
1907
|
+
var v;
|
|
1908
|
+
a.value && (a.value = !1, (v = e.onClose) == null || v.call(e));
|
|
1909
|
+
}, p = () => {
|
|
1910
|
+
e.duration <= 0 || (c(), l = setTimeout(m, e.duration));
|
|
1911
|
+
}, g = () => {
|
|
1912
|
+
var v;
|
|
1913
|
+
(v = e.onDestroy) == null || v.call(e);
|
|
1914
|
+
};
|
|
1915
|
+
return se(() => {
|
|
1916
|
+
a.value = !0, p();
|
|
1917
|
+
}), ae(() => {
|
|
1918
|
+
c();
|
|
1919
|
+
}), s({
|
|
1920
|
+
close: m
|
|
1921
|
+
}), (v, y) => (n(), U(le, {
|
|
1922
|
+
name: h.value,
|
|
1923
|
+
onAfterLeave: g
|
|
1924
|
+
}, {
|
|
1925
|
+
default: X(() => [
|
|
1926
|
+
ce(b("section", {
|
|
1927
|
+
class: N(["jh-notification", [`jh-notification--${v.type}`, `jh-notification--${v.position}`]]),
|
|
1928
|
+
role: "alert",
|
|
1929
|
+
style: Z(o.value),
|
|
1930
|
+
onMouseenter: c,
|
|
1931
|
+
onMouseleave: p
|
|
1932
|
+
}, [
|
|
1933
|
+
y[0] || (y[0] = b("span", {
|
|
1934
|
+
class: "jh-notification__status",
|
|
1935
|
+
"aria-hidden": "true"
|
|
1936
|
+
}, null, -1)),
|
|
1937
|
+
b("div", Jl, [
|
|
1938
|
+
v.title ? (n(), d("div", El, J(v.title), 1)) : j("", !0),
|
|
1939
|
+
v.message ? (n(), d("div", Il, J(v.message), 1)) : j("", !0)
|
|
1940
|
+
]),
|
|
1941
|
+
v.showClose ? (n(), d("button", {
|
|
1942
|
+
key: 0,
|
|
1943
|
+
class: "jh-notification__close",
|
|
1944
|
+
type: "button",
|
|
1945
|
+
"aria-label": "Close notification",
|
|
1946
|
+
onClick: m
|
|
1947
|
+
}, [
|
|
1948
|
+
K(M(z), { name: "close" })
|
|
1949
|
+
])) : j("", !0)
|
|
1950
|
+
], 38), [
|
|
1951
|
+
[ue, a.value]
|
|
1952
|
+
])
|
|
1953
|
+
]),
|
|
1954
|
+
_: 1
|
|
1955
|
+
}, 8, ["name"]));
|
|
1956
|
+
}
|
|
1957
|
+
}), re = [];
|
|
1958
|
+
let zl = 1;
|
|
1959
|
+
const Ve = (t = {}) => typeof t == "string" ? { message: t } : t, Kl = (t, s) => s + re.filter((e) => e.position === t).length * 92, Ne = (t = {}) => {
|
|
1960
|
+
if (typeof document > "u")
|
|
1961
|
+
return { close: () => {
|
|
1962
|
+
} };
|
|
1963
|
+
const s = Ve(t), e = s.position ?? "top-right", a = `jh-notification-${zl++}`, l = document.createElement("div"), i = () => {
|
|
1964
|
+
var o;
|
|
1965
|
+
(o = re.find((c) => c.id === a)) == null || o.close();
|
|
1966
|
+
}, r = {
|
|
1967
|
+
id: a,
|
|
1968
|
+
title: s.title ?? "",
|
|
1969
|
+
message: s.message ?? "",
|
|
1970
|
+
type: s.type ?? "info",
|
|
1971
|
+
duration: s.duration ?? 4500,
|
|
1972
|
+
showClose: s.showClose ?? !0,
|
|
1973
|
+
position: e,
|
|
1974
|
+
offset: Kl(e, s.offset ?? 20),
|
|
1975
|
+
zIndex: s.zIndex ?? 3e3,
|
|
1976
|
+
onClose: s.onClose,
|
|
1977
|
+
onDestroy: () => {
|
|
1978
|
+
const o = re.findIndex((c) => c.id === a);
|
|
1979
|
+
o > -1 && re.splice(o, 1), de(null, l), l.remove();
|
|
1980
|
+
}
|
|
1981
|
+
}, h = K(Ml, r);
|
|
1982
|
+
return de(h, l), document.body.appendChild(l), re.push({
|
|
1983
|
+
id: a,
|
|
1984
|
+
position: e,
|
|
1985
|
+
close: () => {
|
|
1986
|
+
var c, m;
|
|
1987
|
+
const o = (c = h.component) == null ? void 0 : c.exposed;
|
|
1988
|
+
(m = o == null ? void 0 : o.close) == null || m.call(o);
|
|
1989
|
+
}
|
|
1990
|
+
}), { close: i };
|
|
1991
|
+
}, ve = (t) => (s = {}) => Ne({
|
|
1992
|
+
...Ve(s),
|
|
1993
|
+
type: t
|
|
1994
|
+
}), ne = Ne;
|
|
1995
|
+
ne.success = ve("success");
|
|
1996
|
+
ne.warning = ve("warning");
|
|
1997
|
+
ne.info = ve("info");
|
|
1998
|
+
ne.danger = ve("danger");
|
|
1999
|
+
ne.closeAll = () => {
|
|
2000
|
+
[...re].forEach((t) => t.close());
|
|
2001
|
+
};
|
|
2002
|
+
ne.install = (t) => {
|
|
2003
|
+
t.config.globalProperties.$notify = ne;
|
|
2004
|
+
};
|
|
2005
|
+
const Fl = {
|
|
2006
|
+
currentPage: {
|
|
2007
|
+
type: Number,
|
|
2008
|
+
default: 1
|
|
2009
|
+
},
|
|
2010
|
+
pageSize: {
|
|
2011
|
+
type: Number,
|
|
2012
|
+
default: 10
|
|
2013
|
+
},
|
|
2014
|
+
total: {
|
|
2015
|
+
type: Number,
|
|
2016
|
+
default: 0
|
|
2017
|
+
},
|
|
2018
|
+
disabled: Boolean
|
|
2019
|
+
}, Dl = {
|
|
2020
|
+
"update:currentPage": (t) => !0,
|
|
2021
|
+
"update:pageSize": (t) => !0,
|
|
2022
|
+
"page-change": (t) => !0
|
|
2023
|
+
}, Ll = ["disabled"], Rl = ["disabled", "aria-current", "onClick"], Ol = ["disabled"], Hl = { class: "jh-pagination__total" }, xl = /* @__PURE__ */ T({
|
|
2024
|
+
name: "JhPagination",
|
|
2025
|
+
__name: "pagination",
|
|
2026
|
+
props: Fl,
|
|
2027
|
+
emits: Dl,
|
|
2028
|
+
setup(t, { emit: s }) {
|
|
2029
|
+
const e = t, a = s, l = k(() => Math.max(1, e.pageSize || 1)), i = k(() => Math.max(1, Math.ceil(e.total / l.value))), r = k(() => o(e.currentPage)), h = k(() => {
|
|
2030
|
+
const p = i.value, g = r.value, v = 7;
|
|
2031
|
+
if (p <= v)
|
|
2032
|
+
return Array.from({ length: p }, (f, C) => C + 1);
|
|
2033
|
+
let y = Math.max(1, g - 3);
|
|
2034
|
+
const B = Math.min(p, y + v - 1);
|
|
2035
|
+
return y = Math.max(1, B - v + 1), Array.from({ length: B - y + 1 }, (f, C) => y + C);
|
|
2036
|
+
});
|
|
2037
|
+
function o(p) {
|
|
2038
|
+
return Number.isFinite(p) ? Math.min(Math.max(1, Math.trunc(p)), i.value) : 1;
|
|
2039
|
+
}
|
|
2040
|
+
function c(p, g = l.value) {
|
|
2041
|
+
a("update:currentPage", p), a("page-change", {
|
|
2042
|
+
currentPage: p,
|
|
2043
|
+
pageSize: g
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
function m(p) {
|
|
2047
|
+
if (e.disabled) return;
|
|
2048
|
+
const g = o(p);
|
|
2049
|
+
g !== r.value && c(g);
|
|
2050
|
+
}
|
|
2051
|
+
return Y(
|
|
2052
|
+
() => e.pageSize,
|
|
2053
|
+
(p, g) => {
|
|
2054
|
+
const v = Math.max(1, p || 1);
|
|
2055
|
+
if (v !== p && a("update:pageSize", v), g === void 0) return;
|
|
2056
|
+
const y = o(e.currentPage);
|
|
2057
|
+
y !== e.currentPage && c(y, v);
|
|
2058
|
+
},
|
|
2059
|
+
{ immediate: !0 }
|
|
2060
|
+
), Y(
|
|
2061
|
+
() => e.currentPage,
|
|
2062
|
+
(p) => {
|
|
2063
|
+
const g = o(p);
|
|
2064
|
+
g !== p && c(g);
|
|
2065
|
+
},
|
|
2066
|
+
{ immediate: !0 }
|
|
2067
|
+
), (p, g) => (n(), d("nav", {
|
|
2068
|
+
class: N(["jh-pagination", { "is-disabled": p.disabled }]),
|
|
2069
|
+
"aria-label": "Pagination"
|
|
2070
|
+
}, [
|
|
2071
|
+
b("button", {
|
|
2072
|
+
class: "jh-pagination__button",
|
|
2073
|
+
type: "button",
|
|
2074
|
+
disabled: p.disabled || r.value <= 1,
|
|
2075
|
+
"aria-label": "Previous page",
|
|
2076
|
+
onClick: g[0] || (g[0] = (v) => m(r.value - 1))
|
|
2077
|
+
}, [
|
|
2078
|
+
K(M(z), { name: "arrow-left" })
|
|
2079
|
+
], 8, Ll),
|
|
2080
|
+
(n(!0), d(O, null, W(h.value, (v) => (n(), d("button", {
|
|
2081
|
+
key: v,
|
|
2082
|
+
class: N(["jh-pagination__pager", { "is-active": v === r.value }]),
|
|
2083
|
+
type: "button",
|
|
2084
|
+
disabled: p.disabled,
|
|
2085
|
+
"aria-current": v === r.value ? "page" : void 0,
|
|
2086
|
+
onClick: (y) => m(v)
|
|
2087
|
+
}, J(v), 11, Rl))), 128)),
|
|
2088
|
+
b("button", {
|
|
2089
|
+
class: "jh-pagination__button",
|
|
2090
|
+
type: "button",
|
|
2091
|
+
disabled: p.disabled || r.value >= i.value,
|
|
2092
|
+
"aria-label": "Next page",
|
|
2093
|
+
onClick: g[1] || (g[1] = (v) => m(r.value + 1))
|
|
2094
|
+
}, [
|
|
2095
|
+
K(M(z), { name: "arrow-right" })
|
|
2096
|
+
], 8, Ol),
|
|
2097
|
+
b("span", Hl, "Total " + J(p.total), 1)
|
|
2098
|
+
], 2));
|
|
2099
|
+
}
|
|
2100
|
+
}), ql = I(xl), Gl = {
|
|
2101
|
+
modelValue: [String, Number, Boolean],
|
|
2102
|
+
value: {
|
|
2103
|
+
type: [String, Number, Boolean],
|
|
2104
|
+
required: !0
|
|
2105
|
+
},
|
|
2106
|
+
label: String,
|
|
2107
|
+
disabled: Boolean
|
|
2108
|
+
}, Ul = {
|
|
2109
|
+
modelValue: [String, Number, Boolean],
|
|
2110
|
+
disabled: Boolean
|
|
2111
|
+
}, Wl = {
|
|
2112
|
+
"update:modelValue": (t) => !0,
|
|
2113
|
+
change: (t) => !0
|
|
2114
|
+
}, Yl = {
|
|
2115
|
+
"update:modelValue": (t) => !0,
|
|
2116
|
+
change: (t) => !0
|
|
2117
|
+
}, Pe = Symbol("JhRadioGroup"), Zl = { class: "jh-radio__input" }, Ql = ["checked", "disabled"], Xl = {
|
|
2118
|
+
key: 0,
|
|
2119
|
+
class: "jh-radio__label"
|
|
2120
|
+
}, es = /* @__PURE__ */ T({
|
|
2121
|
+
name: "JhRadio",
|
|
2122
|
+
__name: "radio",
|
|
2123
|
+
props: Gl,
|
|
2124
|
+
emits: Wl,
|
|
2125
|
+
setup(t, { emit: s }) {
|
|
2126
|
+
const e = t, a = s, l = he(Pe, void 0), i = k(() => e.disabled || !!(l != null && l.disabled())), r = k(() => l ? l.modelValue() === e.value : e.modelValue === e.value), h = () => {
|
|
2127
|
+
if (!i.value) {
|
|
2128
|
+
if (l) {
|
|
2129
|
+
l.changeValue(e.value);
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
a("update:modelValue", e.value), a("change", e.value);
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
return (o, c) => (n(), d("label", {
|
|
2136
|
+
class: N(["jh-radio", { "is-checked": r.value, "is-disabled": i.value }])
|
|
2137
|
+
}, [
|
|
2138
|
+
b("span", Zl, [
|
|
2139
|
+
b("input", {
|
|
2140
|
+
class: "jh-radio__original",
|
|
2141
|
+
type: "radio",
|
|
2142
|
+
checked: r.value,
|
|
2143
|
+
disabled: i.value,
|
|
2144
|
+
onChange: h
|
|
2145
|
+
}, null, 40, Ql),
|
|
2146
|
+
c[0] || (c[0] = b("span", { class: "jh-radio__inner" }, null, -1))
|
|
2147
|
+
]),
|
|
2148
|
+
o.$slots.default || o.label ? (n(), d("span", Xl, [
|
|
2149
|
+
P(o.$slots, "default", {}, () => [
|
|
2150
|
+
Q(J(o.label), 1)
|
|
2151
|
+
])
|
|
2152
|
+
])) : j("", !0)
|
|
2153
|
+
], 2));
|
|
2154
|
+
}
|
|
2155
|
+
}), ts = /* @__PURE__ */ T({
|
|
2156
|
+
name: "JhRadioGroup",
|
|
2157
|
+
__name: "radio-group",
|
|
2158
|
+
props: Ul,
|
|
2159
|
+
emits: Yl,
|
|
2160
|
+
setup(t, { emit: s }) {
|
|
2161
|
+
const e = t, a = s;
|
|
2162
|
+
return pe(Pe, {
|
|
2163
|
+
modelValue: () => e.modelValue,
|
|
2164
|
+
disabled: () => e.disabled,
|
|
2165
|
+
changeValue: (i) => {
|
|
2166
|
+
a("update:modelValue", i), a("change", i);
|
|
2167
|
+
}
|
|
2168
|
+
}), (i, r) => (n(), d("div", {
|
|
2169
|
+
class: N(["jh-radio-group", { "is-disabled": i.disabled }]),
|
|
2170
|
+
role: "radiogroup"
|
|
2171
|
+
}, [
|
|
2172
|
+
P(i.$slots, "default")
|
|
2173
|
+
], 2));
|
|
2174
|
+
}
|
|
2175
|
+
}), as = I(es), ls = I(ts), ss = {
|
|
2176
|
+
height: [String, Number],
|
|
2177
|
+
maxHeight: [String, Number],
|
|
2178
|
+
always: Boolean,
|
|
2179
|
+
native: Boolean,
|
|
2180
|
+
wrapClass: String,
|
|
2181
|
+
viewClass: String
|
|
2182
|
+
}, os = {
|
|
2183
|
+
scroll: (t) => !0
|
|
2184
|
+
}, ns = /* @__PURE__ */ T({
|
|
2185
|
+
name: "JhScrollbar",
|
|
2186
|
+
__name: "scrollbar",
|
|
2187
|
+
props: ss,
|
|
2188
|
+
emits: os,
|
|
2189
|
+
setup(t, { emit: s }) {
|
|
2190
|
+
const e = t, a = s, l = E(), i = (o) => typeof o == "number" ? `${o}px` : o, r = k(() => ({
|
|
2191
|
+
height: i(e.height),
|
|
2192
|
+
maxHeight: i(e.maxHeight)
|
|
2193
|
+
})), h = () => {
|
|
2194
|
+
l.value && a("scroll", {
|
|
2195
|
+
scrollTop: l.value.scrollTop,
|
|
2196
|
+
scrollLeft: l.value.scrollLeft
|
|
2197
|
+
});
|
|
2198
|
+
};
|
|
2199
|
+
return (o, c) => (n(), d("div", {
|
|
2200
|
+
class: N(["jh-scrollbar", { "is-always": o.always, "is-native": o.native }])
|
|
2201
|
+
}, [
|
|
2202
|
+
b("div", {
|
|
2203
|
+
ref_key: "wrapRef",
|
|
2204
|
+
ref: l,
|
|
2205
|
+
class: N(["jh-scrollbar__wrap", o.wrapClass]),
|
|
2206
|
+
style: Z(r.value),
|
|
2207
|
+
onScroll: h
|
|
2208
|
+
}, [
|
|
2209
|
+
b("div", {
|
|
2210
|
+
class: N(["jh-scrollbar__view", o.viewClass])
|
|
2211
|
+
}, [
|
|
2212
|
+
P(o.$slots, "default")
|
|
2213
|
+
], 2)
|
|
2214
|
+
], 38)
|
|
2215
|
+
], 2));
|
|
2216
|
+
}
|
|
2217
|
+
}), is = I(ns), rs = {
|
|
2218
|
+
modelValue: [String, Number],
|
|
2219
|
+
options: {
|
|
2220
|
+
type: Array,
|
|
2221
|
+
default: () => []
|
|
2222
|
+
},
|
|
2223
|
+
placeholder: {
|
|
2224
|
+
type: String,
|
|
2225
|
+
default: "Please select"
|
|
2226
|
+
},
|
|
2227
|
+
disabled: Boolean,
|
|
2228
|
+
clearable: Boolean
|
|
2229
|
+
}, ds = {
|
|
2230
|
+
"update:modelValue": (t) => !0,
|
|
2231
|
+
change: (t, s) => !0,
|
|
2232
|
+
"visible-change": (t) => !0,
|
|
2233
|
+
clear: () => !0
|
|
2234
|
+
}, cs = ["disabled", "aria-expanded"], us = {
|
|
2235
|
+
key: 0,
|
|
2236
|
+
class: "jh-select__menu"
|
|
2237
|
+
}, ps = ["disabled", "onClick"], hs = /* @__PURE__ */ T({
|
|
2238
|
+
name: "JhSelect",
|
|
2239
|
+
__name: "select",
|
|
2240
|
+
props: rs,
|
|
2241
|
+
emits: ds,
|
|
2242
|
+
setup(t, { emit: s }) {
|
|
2243
|
+
const e = t, a = s, l = E(!1), i = E(), r = k(() => e.options.find((y) => y.value === e.modelValue)), h = k(() => e.clearable && !e.disabled && e.modelValue !== void 0), o = (y) => {
|
|
2244
|
+
e.disabled || l.value !== y && (l.value = y, a("visible-change", y));
|
|
2245
|
+
}, c = () => o(!l.value), m = () => o(!1), p = (y) => {
|
|
2246
|
+
y.disabled || (a("update:modelValue", y.value), a("change", y.value, y), m());
|
|
2247
|
+
}, g = () => {
|
|
2248
|
+
a("update:modelValue", void 0), a("change", void 0), a("clear"), m();
|
|
2249
|
+
}, v = (y) => {
|
|
2250
|
+
var B;
|
|
2251
|
+
l.value && ((B = i.value) != null && B.contains(y.target) || m());
|
|
2252
|
+
};
|
|
2253
|
+
return Y(
|
|
2254
|
+
() => l.value,
|
|
2255
|
+
(y) => {
|
|
2256
|
+
y ? document.addEventListener("click", v) : document.removeEventListener("click", v);
|
|
2257
|
+
}
|
|
2258
|
+
), ae(() => {
|
|
2259
|
+
document.removeEventListener("click", v);
|
|
2260
|
+
}), (y, B) => {
|
|
2261
|
+
var f;
|
|
2262
|
+
return n(), d("div", {
|
|
2263
|
+
ref_key: "selectRef",
|
|
2264
|
+
ref: i,
|
|
2265
|
+
class: N(["jh-select", { "is-disabled": y.disabled, "is-visible": l.value }])
|
|
2266
|
+
}, [
|
|
2267
|
+
b("button", {
|
|
2268
|
+
class: "jh-select__trigger",
|
|
2269
|
+
type: "button",
|
|
2270
|
+
disabled: y.disabled,
|
|
2271
|
+
"aria-expanded": l.value,
|
|
2272
|
+
onClick: c
|
|
2273
|
+
}, [
|
|
2274
|
+
b("span", {
|
|
2275
|
+
class: N(["jh-select__label", { "is-placeholder": !r.value }])
|
|
2276
|
+
}, J(((f = r.value) == null ? void 0 : f.label) || y.placeholder), 3),
|
|
2277
|
+
h.value ? (n(), d("button", {
|
|
2278
|
+
key: 0,
|
|
2279
|
+
class: "jh-select__clear",
|
|
2280
|
+
type: "button",
|
|
2281
|
+
onClick: te(g, ["stop"])
|
|
2282
|
+
}, [
|
|
2283
|
+
K(M(z), { name: "close" })
|
|
2284
|
+
])) : (n(), U(M(z), {
|
|
2285
|
+
key: 1,
|
|
2286
|
+
class: "jh-select__arrow",
|
|
2287
|
+
name: "arrow-right"
|
|
2288
|
+
}))
|
|
2289
|
+
], 8, cs),
|
|
2290
|
+
K(le, { name: "jh-select-fade" }, {
|
|
2291
|
+
default: X(() => [
|
|
2292
|
+
l.value ? (n(), d("div", us, [
|
|
2293
|
+
(n(!0), d(O, null, W(y.options, (C) => (n(), d("button", {
|
|
2294
|
+
key: C.value,
|
|
2295
|
+
class: N(["jh-select__option", { "is-active": C.value === y.modelValue, "is-disabled": C.disabled }]),
|
|
2296
|
+
type: "button",
|
|
2297
|
+
disabled: C.disabled,
|
|
2298
|
+
onClick: ($) => p(C)
|
|
2299
|
+
}, J(C.label), 11, ps))), 128))
|
|
2300
|
+
])) : j("", !0)
|
|
2301
|
+
]),
|
|
2302
|
+
_: 1
|
|
2303
|
+
})
|
|
2304
|
+
], 2);
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
}), ms = I(hs), fs = {
|
|
2308
|
+
data: {
|
|
2309
|
+
type: Array,
|
|
2310
|
+
default: () => []
|
|
2311
|
+
},
|
|
2312
|
+
columns: {
|
|
2313
|
+
type: Array,
|
|
2314
|
+
default: () => []
|
|
2315
|
+
},
|
|
2316
|
+
loading: Boolean,
|
|
2317
|
+
border: Boolean,
|
|
2318
|
+
stripe: Boolean,
|
|
2319
|
+
selection: Boolean,
|
|
2320
|
+
rowKey: {
|
|
2321
|
+
type: [String, Function],
|
|
2322
|
+
default: void 0
|
|
2323
|
+
},
|
|
2324
|
+
selectable: Function,
|
|
2325
|
+
emptyText: {
|
|
2326
|
+
type: String,
|
|
2327
|
+
default: "No Data"
|
|
2328
|
+
}
|
|
2329
|
+
}, bs = {
|
|
2330
|
+
select: (t, s) => !0,
|
|
2331
|
+
"select-all": (t) => !0,
|
|
2332
|
+
"selection-change": (t) => !0
|
|
2333
|
+
}, gs = { class: "jh-table__wrapper" }, vs = { class: "jh-table__table" }, ys = {
|
|
2334
|
+
key: 0,
|
|
2335
|
+
class: "jh-table__selection-col"
|
|
2336
|
+
}, _s = { class: "jh-table__header" }, ks = {
|
|
2337
|
+
key: 0,
|
|
2338
|
+
class: "jh-table__cell jh-table__selection-cell"
|
|
2339
|
+
}, $s = ["checked", "aria-checked", "disabled"], Cs = { class: "jh-table__body" }, js = {
|
|
2340
|
+
key: 0,
|
|
2341
|
+
class: "jh-table__cell jh-table__selection-cell"
|
|
2342
|
+
}, ws = ["checked", "disabled", "onChange"], Ss = { key: 2 }, Bs = {
|
|
2343
|
+
key: 0,
|
|
2344
|
+
class: "jh-table__empty"
|
|
2345
|
+
}, Vs = {
|
|
2346
|
+
key: 1,
|
|
2347
|
+
class: "jh-table__loading",
|
|
2348
|
+
"aria-live": "polite"
|
|
2349
|
+
}, Ns = /* @__PURE__ */ T({
|
|
2350
|
+
name: "JhTable",
|
|
2351
|
+
__name: "table",
|
|
2352
|
+
props: fs,
|
|
2353
|
+
emits: bs,
|
|
2354
|
+
setup(t, { emit: s }) {
|
|
2355
|
+
const e = t, a = s, l = E(/* @__PURE__ */ new Set()), i = E(), r = k(() => ({
|
|
2356
|
+
"is-border": e.border,
|
|
2357
|
+
"is-stripe": e.stripe,
|
|
2358
|
+
"is-loading": e.loading,
|
|
2359
|
+
"is-selection": e.selection
|
|
2360
|
+
})), h = (u, w) => {
|
|
2361
|
+
if (typeof e.rowKey == "function") return e.rowKey(u);
|
|
2362
|
+
if (typeof e.rowKey == "string") {
|
|
2363
|
+
const _ = u[e.rowKey];
|
|
2364
|
+
if (typeof _ == "string" || typeof _ == "number") return _;
|
|
2365
|
+
}
|
|
2366
|
+
return w;
|
|
2367
|
+
}, o = (u, w) => e.selectable ? e.selectable(u, w) : !0, c = k(
|
|
2368
|
+
() => e.data.map((u, w) => ({ row: u, index: w, key: h(u, w) })).filter(({ row: u, index: w }) => o(u, w))
|
|
2369
|
+
), m = k(
|
|
2370
|
+
() => e.data.filter((u, w) => l.value.has(h(u, w)))
|
|
2371
|
+
), p = k(
|
|
2372
|
+
() => !!c.value.length && c.value.every(({ key: u }) => l.value.has(u))
|
|
2373
|
+
), g = k(
|
|
2374
|
+
() => c.value.some(({ key: u }) => l.value.has(u)) && !p.value
|
|
2375
|
+
);
|
|
2376
|
+
Je(() => {
|
|
2377
|
+
i.value && (i.value.indeterminate = g.value);
|
|
2378
|
+
}), Y(
|
|
2379
|
+
() => [e.data, e.rowKey],
|
|
2380
|
+
() => {
|
|
2381
|
+
const u = new Set(e.data.map((w, _) => h(w, _)));
|
|
2382
|
+
l.value = new Set([...l.value].filter((w) => u.has(w)));
|
|
2383
|
+
},
|
|
2384
|
+
{ deep: !0 }
|
|
2385
|
+
);
|
|
2386
|
+
const v = (u) => u.align && u.align !== "left" ? `is-${u.align}` : "", y = (u) => u.width ? { width: typeof u.width == "number" ? `${u.width}px` : u.width } : void 0, B = (u) => u == null ? "" : String(u), f = () => {
|
|
2387
|
+
a("selection-change", m.value);
|
|
2388
|
+
}, C = (u) => {
|
|
2389
|
+
const w = e.data.indexOf(u);
|
|
2390
|
+
return l.value.has(h(u, w));
|
|
2391
|
+
}, $ = (u, w) => {
|
|
2392
|
+
if (!o(u, w)) return;
|
|
2393
|
+
const _ = new Set(l.value), L = h(u, w);
|
|
2394
|
+
_.has(L) ? _.delete(L) : _.add(L), l.value = _, a("select", m.value, u), f();
|
|
2395
|
+
}, F = () => {
|
|
2396
|
+
const u = new Set(l.value);
|
|
2397
|
+
p.value ? c.value.forEach(({ key: w }) => u.delete(w)) : c.value.forEach(({ key: w }) => u.add(w)), l.value = u, a("select-all", m.value), f();
|
|
2398
|
+
};
|
|
2399
|
+
return (u, w) => (n(), d("div", {
|
|
2400
|
+
class: N(["jh-table", r.value])
|
|
2401
|
+
}, [
|
|
2402
|
+
b("div", gs, [
|
|
2403
|
+
b("table", vs, [
|
|
2404
|
+
b("colgroup", null, [
|
|
2405
|
+
u.selection ? (n(), d("col", ys)) : j("", !0),
|
|
2406
|
+
(n(!0), d(O, null, W(u.columns, (_) => (n(), d("col", {
|
|
2407
|
+
key: _.prop,
|
|
2408
|
+
style: Z(y(_))
|
|
2409
|
+
}, null, 4))), 128))
|
|
2410
|
+
]),
|
|
2411
|
+
b("thead", _s, [
|
|
2412
|
+
b("tr", null, [
|
|
2413
|
+
u.selection ? (n(), d("th", ks, [
|
|
2414
|
+
b("input", {
|
|
2415
|
+
ref_key: "selectAllRef",
|
|
2416
|
+
ref: i,
|
|
2417
|
+
class: "jh-table__selection",
|
|
2418
|
+
type: "checkbox",
|
|
2419
|
+
"aria-label": "Select all rows",
|
|
2420
|
+
checked: p.value,
|
|
2421
|
+
"aria-checked": g.value ? "mixed" : p.value,
|
|
2422
|
+
disabled: !c.value.length,
|
|
2423
|
+
onChange: F
|
|
2424
|
+
}, null, 40, $s)
|
|
2425
|
+
])) : j("", !0),
|
|
2426
|
+
(n(!0), d(O, null, W(u.columns, (_) => (n(), d("th", {
|
|
2427
|
+
key: _.prop,
|
|
2428
|
+
class: N(["jh-table__cell", v(_)])
|
|
2429
|
+
}, J(_.label), 3))), 128))
|
|
2430
|
+
])
|
|
2431
|
+
]),
|
|
2432
|
+
b("tbody", Cs, [
|
|
2433
|
+
(n(!0), d(O, null, W(u.data, (_, L) => (n(), d("tr", {
|
|
2434
|
+
key: L,
|
|
2435
|
+
class: "jh-table__row"
|
|
2436
|
+
}, [
|
|
2437
|
+
u.selection ? (n(), d("td", js, [
|
|
2438
|
+
b("input", {
|
|
2439
|
+
class: "jh-table__selection",
|
|
2440
|
+
type: "checkbox",
|
|
2441
|
+
"aria-label": "Select row",
|
|
2442
|
+
checked: C(_),
|
|
2443
|
+
disabled: !o(_, L),
|
|
2444
|
+
onChange: (V) => $(_, L)
|
|
2445
|
+
}, null, 40, ws)
|
|
2446
|
+
])) : j("", !0),
|
|
2447
|
+
(n(!0), d(O, null, W(u.columns, (V) => (n(), d("td", {
|
|
2448
|
+
key: V.prop,
|
|
2449
|
+
class: N(["jh-table__cell", v(V)])
|
|
2450
|
+
}, [
|
|
2451
|
+
V.slot && u.$slots[V.slot] ? P(u.$slots, V.slot, {
|
|
2452
|
+
key: 0,
|
|
2453
|
+
row: _,
|
|
2454
|
+
column: V,
|
|
2455
|
+
index: L,
|
|
2456
|
+
value: _[V.prop]
|
|
2457
|
+
}) : u.$slots.cell ? P(u.$slots, "cell", {
|
|
2458
|
+
key: 1,
|
|
2459
|
+
row: _,
|
|
2460
|
+
column: V,
|
|
2461
|
+
index: L,
|
|
2462
|
+
value: _[V.prop]
|
|
2463
|
+
}) : (n(), d("span", Ss, J(B(_[V.prop])), 1))
|
|
2464
|
+
], 2))), 128))
|
|
2465
|
+
]))), 128))
|
|
2466
|
+
])
|
|
2467
|
+
]),
|
|
2468
|
+
!u.data.length && !u.loading ? (n(), d("div", Bs, [
|
|
2469
|
+
P(u.$slots, "empty", {}, () => [
|
|
2470
|
+
Q(J(u.emptyText), 1)
|
|
2471
|
+
])
|
|
2472
|
+
])) : j("", !0),
|
|
2473
|
+
u.loading ? (n(), d("div", Vs, [...w[0] || (w[0] = [
|
|
2474
|
+
b("span", {
|
|
2475
|
+
class: "jh-table__spinner",
|
|
2476
|
+
"aria-hidden": "true"
|
|
2477
|
+
}, null, -1),
|
|
2478
|
+
b("span", null, "Loading", -1)
|
|
2479
|
+
])])) : j("", !0)
|
|
2480
|
+
])
|
|
2481
|
+
], 2));
|
|
2482
|
+
}
|
|
2483
|
+
}), Ps = I(Ns), Ae = Symbol("tabsContextKey"), As = {
|
|
2484
|
+
modelValue: {
|
|
2485
|
+
type: [String, Number],
|
|
2486
|
+
default: ""
|
|
2487
|
+
}
|
|
2488
|
+
}, Ts = {
|
|
2489
|
+
"update:modelValue": (t) => typeof t == "string" || typeof t == "number",
|
|
2490
|
+
change: (t) => typeof t == "string" || typeof t == "number"
|
|
2491
|
+
}, Js = {
|
|
2492
|
+
label: {
|
|
2493
|
+
type: String,
|
|
2494
|
+
default: ""
|
|
2495
|
+
},
|
|
2496
|
+
name: {
|
|
2497
|
+
type: [String, Number],
|
|
2498
|
+
required: !0
|
|
2499
|
+
},
|
|
2500
|
+
disabled: Boolean
|
|
2501
|
+
}, Es = { class: "jh-tabs" }, Is = {
|
|
2502
|
+
class: "jh-tabs__nav",
|
|
2503
|
+
role: "tablist"
|
|
2504
|
+
}, Ms = ["disabled", "aria-selected", "onClick"], zs = { class: "jh-tabs__content" }, Ks = /* @__PURE__ */ T({
|
|
2505
|
+
name: "JhTabs",
|
|
2506
|
+
__name: "tabs",
|
|
2507
|
+
props: As,
|
|
2508
|
+
emits: Ts,
|
|
2509
|
+
setup(t, { emit: s }) {
|
|
2510
|
+
const e = t, a = s, l = E([]), i = E(e.modelValue), r = k(() => {
|
|
2511
|
+
var p;
|
|
2512
|
+
return i.value || ((p = l.value[0]) == null ? void 0 : p.name) || "";
|
|
2513
|
+
}), h = (p) => {
|
|
2514
|
+
i.value = p, a("update:modelValue", p), a("change", p);
|
|
2515
|
+
}, o = (p) => {
|
|
2516
|
+
p.disabled || p.name !== r.value && h(p.name);
|
|
2517
|
+
};
|
|
2518
|
+
return pe(Ae, {
|
|
2519
|
+
activeName: r,
|
|
2520
|
+
registerPane: (p) => {
|
|
2521
|
+
l.value.push(p), i.value || (i.value = p.name);
|
|
2522
|
+
},
|
|
2523
|
+
unregisterPane: (p) => {
|
|
2524
|
+
l.value = l.value.filter((g) => g.uid !== p.uid);
|
|
2525
|
+
}
|
|
2526
|
+
}), Y(
|
|
2527
|
+
() => e.modelValue,
|
|
2528
|
+
(p) => {
|
|
2529
|
+
i.value = p;
|
|
2530
|
+
}
|
|
2531
|
+
), (p, g) => (n(), d("div", Es, [
|
|
2532
|
+
b("div", Is, [
|
|
2533
|
+
(n(!0), d(O, null, W(l.value, (v) => (n(), d("button", {
|
|
2534
|
+
key: v.name,
|
|
2535
|
+
class: N(["jh-tabs__tab", { "is-active": v.name === r.value, "is-disabled": v.disabled }]),
|
|
2536
|
+
type: "button",
|
|
2537
|
+
role: "tab",
|
|
2538
|
+
disabled: v.disabled,
|
|
2539
|
+
"aria-selected": v.name === r.value,
|
|
2540
|
+
onClick: (y) => o(v)
|
|
2541
|
+
}, J(v.label), 11, Ms))), 128))
|
|
2542
|
+
]),
|
|
2543
|
+
b("div", zs, [
|
|
2544
|
+
P(p.$slots, "default")
|
|
2545
|
+
])
|
|
2546
|
+
]));
|
|
2547
|
+
}
|
|
2548
|
+
}), Fs = {
|
|
2549
|
+
class: "jh-tab-pane",
|
|
2550
|
+
role: "tabpanel"
|
|
2551
|
+
}, Ds = /* @__PURE__ */ T({
|
|
2552
|
+
name: "JhTabPane",
|
|
2553
|
+
__name: "tab-pane",
|
|
2554
|
+
props: Js,
|
|
2555
|
+
setup(t) {
|
|
2556
|
+
const s = t, e = he(Ae, void 0), a = Symbol("tabPane"), l = k(() => ({
|
|
2557
|
+
uid: a,
|
|
2558
|
+
name: s.name,
|
|
2559
|
+
label: s.label || String(s.name),
|
|
2560
|
+
disabled: s.disabled
|
|
2561
|
+
})), i = k(() => (e == null ? void 0 : e.activeName.value) === s.name);
|
|
2562
|
+
return se(() => {
|
|
2563
|
+
e == null || e.registerPane(l.value);
|
|
2564
|
+
}), ae(() => {
|
|
2565
|
+
e == null || e.unregisterPane(l.value);
|
|
2566
|
+
}), Y(
|
|
2567
|
+
() => [s.label, s.name, s.disabled],
|
|
2568
|
+
() => {
|
|
2569
|
+
e == null || e.unregisterPane(l.value), e == null || e.registerPane(l.value);
|
|
2570
|
+
}
|
|
2571
|
+
), (r, h) => ce((n(), d("div", Fs, [
|
|
2572
|
+
P(r.$slots, "default")
|
|
2573
|
+
], 512)), [
|
|
2574
|
+
[ue, i.value]
|
|
2575
|
+
]);
|
|
2576
|
+
}
|
|
2577
|
+
}), Ls = I(Ks), Rs = I(Ds), Os = ["default", "primary", "success", "warning", "danger", "info"], Hs = ["small", "default", "large"], xs = {
|
|
2578
|
+
type: {
|
|
2579
|
+
type: String,
|
|
2580
|
+
default: "default",
|
|
2581
|
+
validator: (t) => Os.includes(t)
|
|
2582
|
+
},
|
|
2583
|
+
size: {
|
|
2584
|
+
type: String,
|
|
2585
|
+
default: "default",
|
|
2586
|
+
validator: (t) => Hs.includes(t)
|
|
2587
|
+
},
|
|
2588
|
+
tag: {
|
|
2589
|
+
type: String,
|
|
2590
|
+
default: "span"
|
|
2591
|
+
},
|
|
2592
|
+
truncated: Boolean,
|
|
2593
|
+
lineClamp: Number
|
|
2594
|
+
}, qs = /* @__PURE__ */ T({
|
|
2595
|
+
name: "JhText",
|
|
2596
|
+
__name: "text",
|
|
2597
|
+
props: xs,
|
|
2598
|
+
setup(t) {
|
|
2599
|
+
const s = t, e = k(() => [
|
|
2600
|
+
`jh-text--${s.type}`,
|
|
2601
|
+
s.size !== "default" ? `jh-text--${s.size}` : "",
|
|
2602
|
+
{
|
|
2603
|
+
"is-truncated": s.truncated,
|
|
2604
|
+
"is-line-clamp": !!s.lineClamp
|
|
2605
|
+
}
|
|
2606
|
+
]), a = k(
|
|
2607
|
+
() => s.lineClamp ? {
|
|
2608
|
+
"--jh-text-line-clamp": s.lineClamp
|
|
2609
|
+
} : void 0
|
|
2610
|
+
);
|
|
2611
|
+
return (l, i) => (n(), U(Ee(l.tag), {
|
|
2612
|
+
class: N(["jh-text", e.value]),
|
|
2613
|
+
style: Z(a.value)
|
|
2614
|
+
}, {
|
|
2615
|
+
default: X(() => [
|
|
2616
|
+
P(l.$slots, "default")
|
|
2617
|
+
]),
|
|
2618
|
+
_: 3
|
|
2619
|
+
}, 8, ["class", "style"]));
|
|
2620
|
+
}
|
|
2621
|
+
}), Gs = I(qs), Us = {
|
|
2622
|
+
modelValue: {
|
|
2623
|
+
type: String,
|
|
2624
|
+
default: ""
|
|
2625
|
+
},
|
|
2626
|
+
start: {
|
|
2627
|
+
type: String,
|
|
2628
|
+
default: "09:00"
|
|
2629
|
+
},
|
|
2630
|
+
end: {
|
|
2631
|
+
type: String,
|
|
2632
|
+
default: "18:00"
|
|
2633
|
+
},
|
|
2634
|
+
step: {
|
|
2635
|
+
type: String,
|
|
2636
|
+
default: "00:30"
|
|
2637
|
+
},
|
|
2638
|
+
placeholder: {
|
|
2639
|
+
type: String,
|
|
2640
|
+
default: "Select time"
|
|
2641
|
+
},
|
|
2642
|
+
disabled: Boolean,
|
|
2643
|
+
clearable: Boolean
|
|
2644
|
+
}, Ws = {
|
|
2645
|
+
"update:modelValue": (t) => typeof t == "string",
|
|
2646
|
+
change: (t, s) => typeof t == "string" && (!s || !!s)
|
|
2647
|
+
}, Ys = ["disabled", "aria-expanded"], Zs = {
|
|
2648
|
+
key: 0,
|
|
2649
|
+
class: "jh-time-select__menu"
|
|
2650
|
+
}, Qs = ["onClick"], Xs = {
|
|
2651
|
+
key: 0,
|
|
2652
|
+
class: "jh-time-select__empty"
|
|
2653
|
+
}, eo = /* @__PURE__ */ T({
|
|
2654
|
+
name: "JhTimeSelect",
|
|
2655
|
+
__name: "time-select",
|
|
2656
|
+
props: Us,
|
|
2657
|
+
emits: Ws,
|
|
2658
|
+
setup(t, { emit: s }) {
|
|
2659
|
+
const e = t, a = s, l = E(!1), i = E(), r = (f) => {
|
|
2660
|
+
const C = /^(\d{1,2}):(\d{2})$/.exec(f);
|
|
2661
|
+
if (!C) return Number.NaN;
|
|
2662
|
+
const $ = Number(C[1]), F = Number(C[2]);
|
|
2663
|
+
return $ > 23 || F > 59 ? Number.NaN : $ * 60 + F;
|
|
2664
|
+
}, h = (f) => {
|
|
2665
|
+
const C = Math.floor(f / 60), $ = f % 60;
|
|
2666
|
+
return `${String(C).padStart(2, "0")}:${String($).padStart(2, "0")}`;
|
|
2667
|
+
}, o = k(() => {
|
|
2668
|
+
const f = r(e.start), C = r(e.end), $ = r(e.step);
|
|
2669
|
+
if (!Number.isFinite(f) || !Number.isFinite(C) || !Number.isFinite($)) return [];
|
|
2670
|
+
if ($ <= 0 || f > C) return [];
|
|
2671
|
+
const F = [];
|
|
2672
|
+
for (let u = f; u <= C; u += $) {
|
|
2673
|
+
const w = h(u);
|
|
2674
|
+
F.push({ label: w, value: w });
|
|
2675
|
+
}
|
|
2676
|
+
return F;
|
|
2677
|
+
}), c = k(() => e.clearable && !e.disabled && !!e.modelValue), m = (f) => {
|
|
2678
|
+
e.disabled || (l.value = f);
|
|
2679
|
+
}, p = () => m(!l.value), g = () => m(!1), v = (f) => {
|
|
2680
|
+
a("update:modelValue", f.value), a("change", f.value, f), g();
|
|
2681
|
+
}, y = () => {
|
|
2682
|
+
a("update:modelValue", ""), a("change", ""), g();
|
|
2683
|
+
}, B = (f) => {
|
|
2684
|
+
var C;
|
|
2685
|
+
l.value && ((C = i.value) != null && C.contains(f.target) || g());
|
|
2686
|
+
};
|
|
2687
|
+
return Y(
|
|
2688
|
+
() => l.value,
|
|
2689
|
+
(f) => {
|
|
2690
|
+
f ? document.addEventListener("click", B) : document.removeEventListener("click", B);
|
|
2691
|
+
}
|
|
2692
|
+
), ae(() => {
|
|
2693
|
+
document.removeEventListener("click", B);
|
|
2694
|
+
}), (f, C) => (n(), d("div", {
|
|
2695
|
+
ref_key: "timeSelectRef",
|
|
2696
|
+
ref: i,
|
|
2697
|
+
class: N(["jh-time-select", { "is-disabled": f.disabled, "is-visible": l.value }])
|
|
2698
|
+
}, [
|
|
2699
|
+
b("button", {
|
|
2700
|
+
class: "jh-time-select__trigger",
|
|
2701
|
+
type: "button",
|
|
2702
|
+
disabled: f.disabled,
|
|
2703
|
+
"aria-expanded": l.value,
|
|
2704
|
+
onClick: p
|
|
2705
|
+
}, [
|
|
2706
|
+
b("span", {
|
|
2707
|
+
class: N(["jh-time-select__label", { "is-placeholder": !f.modelValue }])
|
|
2708
|
+
}, J(f.modelValue || f.placeholder), 3),
|
|
2709
|
+
c.value ? (n(), d("button", {
|
|
2710
|
+
key: 0,
|
|
2711
|
+
class: "jh-time-select__clear",
|
|
2712
|
+
type: "button",
|
|
2713
|
+
onClick: te(y, ["stop"])
|
|
2714
|
+
}, [
|
|
2715
|
+
K(M(z), { name: "close" })
|
|
2716
|
+
])) : (n(), U(M(z), {
|
|
2717
|
+
key: 1,
|
|
2718
|
+
class: "jh-time-select__arrow",
|
|
2719
|
+
name: "arrow-right"
|
|
2720
|
+
}))
|
|
2721
|
+
], 8, Ys),
|
|
2722
|
+
K(le, { name: "jh-time-select-fade" }, {
|
|
2723
|
+
default: X(() => [
|
|
2724
|
+
l.value ? (n(), d("div", Zs, [
|
|
2725
|
+
(n(!0), d(O, null, W(o.value, ($) => (n(), d("button", {
|
|
2726
|
+
key: $.value,
|
|
2727
|
+
class: N(["jh-time-select__option", { "is-active": $.value === f.modelValue }]),
|
|
2728
|
+
type: "button",
|
|
2729
|
+
onClick: (F) => v($)
|
|
2730
|
+
}, J($.label), 11, Qs))), 128)),
|
|
2731
|
+
o.value.length === 0 ? (n(), d("div", Xs, "No data")) : j("", !0)
|
|
2732
|
+
])) : j("", !0)
|
|
2733
|
+
]),
|
|
2734
|
+
_: 1
|
|
2735
|
+
})
|
|
2736
|
+
], 2));
|
|
2737
|
+
}
|
|
2738
|
+
}), to = I(eo), ao = {
|
|
2739
|
+
data: {
|
|
2740
|
+
type: Array,
|
|
2741
|
+
default: () => []
|
|
2742
|
+
},
|
|
2743
|
+
nodeKey: {
|
|
2744
|
+
type: String,
|
|
2745
|
+
default: "value"
|
|
2746
|
+
},
|
|
2747
|
+
fieldNames: {
|
|
2748
|
+
type: Object,
|
|
2749
|
+
default: () => ({})
|
|
2750
|
+
},
|
|
2751
|
+
defaultExpandedKeys: {
|
|
2752
|
+
type: Array,
|
|
2753
|
+
default: () => []
|
|
2754
|
+
},
|
|
2755
|
+
checkedKeys: {
|
|
2756
|
+
type: Array,
|
|
2757
|
+
default: () => []
|
|
2758
|
+
},
|
|
2759
|
+
showCheckbox: Boolean,
|
|
2760
|
+
checkStrictly: Boolean,
|
|
2761
|
+
expandOnClickNode: {
|
|
2762
|
+
type: Boolean,
|
|
2763
|
+
default: !0
|
|
2764
|
+
},
|
|
2765
|
+
emptyText: {
|
|
2766
|
+
type: String,
|
|
2767
|
+
default: "No data"
|
|
2768
|
+
}
|
|
2769
|
+
}, lo = {
|
|
2770
|
+
"update:checkedKeys": (t) => Array.isArray(t),
|
|
2771
|
+
"node-click": (t, s) => !!t && s !== void 0,
|
|
2772
|
+
check: (t, s) => Array.isArray(t) && !!s
|
|
2773
|
+
}, so = { class: "jh-tree" }, oo = {
|
|
2774
|
+
key: 0,
|
|
2775
|
+
class: "jh-tree__empty"
|
|
2776
|
+
}, no = ["disabled", "aria-label", "onClick"], io = ["checked", "disabled", "onChange"], ro = ["disabled", "onClick"], co = /* @__PURE__ */ T({
|
|
2777
|
+
name: "JhTree",
|
|
2778
|
+
__name: "tree",
|
|
2779
|
+
props: ao,
|
|
2780
|
+
emits: lo,
|
|
2781
|
+
setup(t, { emit: s }) {
|
|
2782
|
+
const e = t, a = s, l = E([...e.defaultExpandedKeys]), i = k(() => e.fieldNames.label || "label"), r = k(() => e.fieldNames.value || e.nodeKey), h = k(() => e.fieldNames.children || "children"), o = k(() => e.fieldNames.disabled || "disabled"), c = (_) => String(_[i.value] ?? ""), m = (_) => _[r.value], p = (_) => _[h.value] || [], g = (_) => !!_[o.value], v = (_) => p(_).length > 0, y = (_) => l.value.includes(_), B = (_) => e.checkedKeys.includes(_), f = (_, L = 0, V = []) => (_.forEach((x) => {
|
|
2783
|
+
const A = m(x), R = {
|
|
2784
|
+
node: x,
|
|
2785
|
+
key: A,
|
|
2786
|
+
label: c(x),
|
|
2787
|
+
level: L,
|
|
2788
|
+
disabled: g(x),
|
|
2789
|
+
hasChildren: v(x)
|
|
2790
|
+
};
|
|
2791
|
+
V.push(R), R.hasChildren && y(A) && f(p(x), L + 1, V);
|
|
2792
|
+
}), V), C = (_) => {
|
|
2793
|
+
const L = [], V = (x) => {
|
|
2794
|
+
L.push(m(x)), p(x).forEach(V);
|
|
2795
|
+
};
|
|
2796
|
+
return V(_), L;
|
|
2797
|
+
}, $ = k(() => f(e.data)), F = (_) => {
|
|
2798
|
+
_.hasChildren && (l.value = y(_.key) ? l.value.filter((L) => L !== _.key) : [...l.value, _.key]);
|
|
2799
|
+
}, u = (_) => {
|
|
2800
|
+
_.disabled || (e.expandOnClickNode && _.hasChildren && F(_), a("node-click", _.node, _.key));
|
|
2801
|
+
}, w = (_) => {
|
|
2802
|
+
if (_.disabled) return;
|
|
2803
|
+
const L = new Set(e.checkedKeys), V = e.checkStrictly ? [_.key] : C(_.node), x = B(_.key);
|
|
2804
|
+
V.forEach((R) => {
|
|
2805
|
+
x ? L.delete(R) : L.add(R);
|
|
2806
|
+
});
|
|
2807
|
+
const A = Array.from(L);
|
|
2808
|
+
a("update:checkedKeys", A), a("check", A, _.node);
|
|
2809
|
+
};
|
|
2810
|
+
return Y(
|
|
2811
|
+
() => e.defaultExpandedKeys,
|
|
2812
|
+
(_) => {
|
|
2813
|
+
l.value = [..._];
|
|
2814
|
+
}
|
|
2815
|
+
), (_, L) => (n(), d("div", so, [
|
|
2816
|
+
$.value.length === 0 ? (n(), d("div", oo, J(_.emptyText), 1)) : j("", !0),
|
|
2817
|
+
(n(!0), d(O, null, W($.value, (V) => (n(), d("div", {
|
|
2818
|
+
key: V.key,
|
|
2819
|
+
class: N(["jh-tree__node", { "is-disabled": V.disabled, "is-expanded": y(V.key) }]),
|
|
2820
|
+
style: Z({ "--jh-tree-node-level": V.level })
|
|
2821
|
+
}, [
|
|
2822
|
+
b("button", {
|
|
2823
|
+
class: "jh-tree__expand",
|
|
2824
|
+
type: "button",
|
|
2825
|
+
disabled: !V.hasChildren,
|
|
2826
|
+
"aria-label": y(V.key) ? "Collapse node" : "Expand node",
|
|
2827
|
+
onClick: (x) => F(V)
|
|
2828
|
+
}, [
|
|
2829
|
+
V.hasChildren ? (n(), U(M(z), {
|
|
2830
|
+
key: 0,
|
|
2831
|
+
name: "arrow-right"
|
|
2832
|
+
})) : j("", !0)
|
|
2833
|
+
], 8, no),
|
|
2834
|
+
_.showCheckbox ? (n(), d("input", {
|
|
2835
|
+
key: 0,
|
|
2836
|
+
class: "jh-tree__checkbox",
|
|
2837
|
+
type: "checkbox",
|
|
2838
|
+
checked: B(V.key),
|
|
2839
|
+
disabled: V.disabled,
|
|
2840
|
+
onChange: (x) => w(V)
|
|
2841
|
+
}, null, 40, io)) : j("", !0),
|
|
2842
|
+
b("button", {
|
|
2843
|
+
class: "jh-tree__label",
|
|
2844
|
+
type: "button",
|
|
2845
|
+
disabled: V.disabled,
|
|
2846
|
+
onClick: (x) => u(V)
|
|
2847
|
+
}, [
|
|
2848
|
+
P(_.$slots, "node", {
|
|
2849
|
+
node: V.node,
|
|
2850
|
+
data: V.node,
|
|
2851
|
+
label: V.label
|
|
2852
|
+
}, () => [
|
|
2853
|
+
Q(J(V.label), 1)
|
|
2854
|
+
])
|
|
2855
|
+
], 8, ro)
|
|
2856
|
+
], 6))), 128))
|
|
2857
|
+
]));
|
|
2858
|
+
}
|
|
2859
|
+
}), uo = I(co), po = {
|
|
2860
|
+
fileList: {
|
|
2861
|
+
type: Array,
|
|
2862
|
+
default: () => []
|
|
2863
|
+
},
|
|
2864
|
+
action: {
|
|
2865
|
+
type: String,
|
|
2866
|
+
default: ""
|
|
2867
|
+
},
|
|
2868
|
+
accept: {
|
|
2869
|
+
type: String,
|
|
2870
|
+
default: ""
|
|
2871
|
+
},
|
|
2872
|
+
multiple: Boolean,
|
|
2873
|
+
disabled: Boolean,
|
|
2874
|
+
drag: Boolean,
|
|
2875
|
+
limit: {
|
|
2876
|
+
type: Number,
|
|
2877
|
+
default: 0
|
|
2878
|
+
},
|
|
2879
|
+
buttonText: {
|
|
2880
|
+
type: String,
|
|
2881
|
+
default: "Click to upload"
|
|
2882
|
+
},
|
|
2883
|
+
tip: {
|
|
2884
|
+
type: String,
|
|
2885
|
+
default: ""
|
|
2886
|
+
},
|
|
2887
|
+
beforeUpload: {
|
|
2888
|
+
type: Function,
|
|
2889
|
+
default: void 0
|
|
2890
|
+
}
|
|
2891
|
+
}, ho = {
|
|
2892
|
+
"update:fileList": (t) => Array.isArray(t),
|
|
2893
|
+
change: (t, s) => !!t && Array.isArray(s),
|
|
2894
|
+
remove: (t, s) => !!t && Array.isArray(s),
|
|
2895
|
+
exceed: (t, s) => Array.isArray(t) && Array.isArray(s)
|
|
2896
|
+
}, mo = ["accept", "multiple", "disabled"], fo = ["disabled"], bo = {
|
|
2897
|
+
key: 0,
|
|
2898
|
+
class: "jh-upload__tip"
|
|
2899
|
+
}, go = {
|
|
2900
|
+
key: 1,
|
|
2901
|
+
class: "jh-upload__list"
|
|
2902
|
+
}, vo = { class: "jh-upload__name" }, yo = ["disabled", "aria-label", "onClick"], _o = /* @__PURE__ */ T({
|
|
2903
|
+
name: "JhUpload",
|
|
2904
|
+
__name: "upload",
|
|
2905
|
+
props: po,
|
|
2906
|
+
emits: ho,
|
|
2907
|
+
setup(t, { emit: s }) {
|
|
2908
|
+
const e = t, a = s, l = E(), i = E(!1);
|
|
2909
|
+
let r = 0;
|
|
2910
|
+
const h = (f) => ({
|
|
2911
|
+
uid: `${Date.now()}-${r++}`,
|
|
2912
|
+
name: f.name,
|
|
2913
|
+
size: f.size,
|
|
2914
|
+
type: f.type,
|
|
2915
|
+
status: "ready",
|
|
2916
|
+
raw: f
|
|
2917
|
+
}), o = () => {
|
|
2918
|
+
var f;
|
|
2919
|
+
e.disabled || (f = l.value) == null || f.click();
|
|
2920
|
+
}, c = async (f) => {
|
|
2921
|
+
const C = [];
|
|
2922
|
+
for (const $ of f)
|
|
2923
|
+
(e.beforeUpload ? await e.beforeUpload($) : !0) && C.push($);
|
|
2924
|
+
return C.map(h);
|
|
2925
|
+
}, m = async (f) => {
|
|
2926
|
+
if (e.disabled || f.length === 0) return;
|
|
2927
|
+
if (e.limit > 0 && e.fileList.length + f.length > e.limit) {
|
|
2928
|
+
a("exceed", f, e.fileList);
|
|
2929
|
+
return;
|
|
2930
|
+
}
|
|
2931
|
+
const C = await c(f);
|
|
2932
|
+
if (C.length === 0) return;
|
|
2933
|
+
const $ = [...e.fileList, ...C];
|
|
2934
|
+
a("update:fileList", $), C.forEach((F) => a("change", F, $));
|
|
2935
|
+
}, p = (f) => {
|
|
2936
|
+
const C = f.target;
|
|
2937
|
+
m(Array.from(C.files || [])), C.value = "";
|
|
2938
|
+
}, g = (f) => {
|
|
2939
|
+
if (e.disabled) return;
|
|
2940
|
+
const C = e.fileList.filter(($) => $.uid !== f.uid);
|
|
2941
|
+
a("update:fileList", C), a("remove", f, C);
|
|
2942
|
+
}, v = () => {
|
|
2943
|
+
e.disabled || !e.drag || (i.value = !0);
|
|
2944
|
+
}, y = () => {
|
|
2945
|
+
i.value = !1;
|
|
2946
|
+
}, B = (f) => {
|
|
2947
|
+
var C;
|
|
2948
|
+
e.disabled || !e.drag || (i.value = !1, m(Array.from(((C = f.dataTransfer) == null ? void 0 : C.files) || [])));
|
|
2949
|
+
};
|
|
2950
|
+
return (f, C) => (n(), d("div", {
|
|
2951
|
+
class: N(["jh-upload", { "is-disabled": f.disabled, "is-drag": f.drag, "is-dragover": i.value }]),
|
|
2952
|
+
onDragover: te(v, ["prevent"]),
|
|
2953
|
+
onDragleave: te(y, ["prevent"]),
|
|
2954
|
+
onDrop: te(B, ["prevent"])
|
|
2955
|
+
}, [
|
|
2956
|
+
b("input", {
|
|
2957
|
+
ref_key: "inputRef",
|
|
2958
|
+
ref: l,
|
|
2959
|
+
class: "jh-upload__input",
|
|
2960
|
+
type: "file",
|
|
2961
|
+
accept: f.accept,
|
|
2962
|
+
multiple: f.multiple,
|
|
2963
|
+
disabled: f.disabled,
|
|
2964
|
+
onChange: p
|
|
2965
|
+
}, null, 40, mo),
|
|
2966
|
+
b("button", {
|
|
2967
|
+
class: "jh-upload__trigger",
|
|
2968
|
+
type: "button",
|
|
2969
|
+
disabled: f.disabled,
|
|
2970
|
+
onClick: o
|
|
2971
|
+
}, [
|
|
2972
|
+
K(M(z), { name: "plus" }),
|
|
2973
|
+
b("span", null, J(f.buttonText), 1)
|
|
2974
|
+
], 8, fo),
|
|
2975
|
+
f.tip ? (n(), d("div", bo, J(f.tip), 1)) : j("", !0),
|
|
2976
|
+
f.fileList.length ? (n(), d("ul", go, [
|
|
2977
|
+
(n(!0), d(O, null, W(f.fileList, ($) => (n(), d("li", {
|
|
2978
|
+
key: $.uid,
|
|
2979
|
+
class: "jh-upload__item"
|
|
2980
|
+
}, [
|
|
2981
|
+
b("span", vo, J($.name), 1),
|
|
2982
|
+
b("button", {
|
|
2983
|
+
class: "jh-upload__remove",
|
|
2984
|
+
type: "button",
|
|
2985
|
+
disabled: f.disabled,
|
|
2986
|
+
"aria-label": `Remove ${$.name}`,
|
|
2987
|
+
onClick: (F) => g($)
|
|
2988
|
+
}, [
|
|
2989
|
+
K(M(z), { name: "close" })
|
|
2990
|
+
], 8, yo)
|
|
2991
|
+
]))), 128))
|
|
2992
|
+
])) : j("", !0)
|
|
2993
|
+
], 34));
|
|
2994
|
+
}
|
|
2995
|
+
}), ko = I(_o), $o = {
|
|
2996
|
+
data: {
|
|
2997
|
+
type: Array,
|
|
2998
|
+
default: () => []
|
|
2999
|
+
},
|
|
3000
|
+
columns: {
|
|
3001
|
+
type: Number,
|
|
3002
|
+
default: 2,
|
|
3003
|
+
validator: (t) => Number.isInteger(t) && t > 0
|
|
3004
|
+
},
|
|
3005
|
+
gap: {
|
|
3006
|
+
type: [Number, String],
|
|
3007
|
+
default: 16
|
|
3008
|
+
},
|
|
3009
|
+
itemKey: {
|
|
3010
|
+
type: [String, Function],
|
|
3011
|
+
default: "id"
|
|
3012
|
+
},
|
|
3013
|
+
itemHeight: {
|
|
3014
|
+
type: [Number, String, Function],
|
|
3015
|
+
default: "height"
|
|
3016
|
+
},
|
|
3017
|
+
batchSize: {
|
|
3018
|
+
type: Number,
|
|
3019
|
+
default: 40,
|
|
3020
|
+
validator: (t) => Number.isInteger(t) && t > 0
|
|
3021
|
+
},
|
|
3022
|
+
emptyText: {
|
|
3023
|
+
type: String,
|
|
3024
|
+
default: "No data"
|
|
3025
|
+
},
|
|
3026
|
+
immediate: {
|
|
3027
|
+
type: Boolean,
|
|
3028
|
+
default: !0
|
|
3029
|
+
}
|
|
3030
|
+
}, Co = {
|
|
3031
|
+
"layout-start": () => !0,
|
|
3032
|
+
"layout-end": () => !0
|
|
3033
|
+
}, jo = {
|
|
3034
|
+
key: 0,
|
|
3035
|
+
class: "jh-waterfall__empty"
|
|
3036
|
+
}, wo = { class: "jh-waterfall__columns" }, So = /* @__PURE__ */ T({
|
|
3037
|
+
name: "JhWaterfall",
|
|
3038
|
+
__name: "waterfall",
|
|
3039
|
+
props: $o,
|
|
3040
|
+
emits: Co,
|
|
3041
|
+
setup(t, { expose: s, emit: e }) {
|
|
3042
|
+
const a = t, l = e, i = E(), r = E([]), h = E([]), o = E(0);
|
|
3043
|
+
let c = 0, m;
|
|
3044
|
+
const p = () => Math.max(1, Math.floor(a.columns)), g = k(() => typeof a.gap == "number" ? `${a.gap}px` : a.gap), v = k(() => {
|
|
3045
|
+
if (typeof a.gap == "number") return a.gap;
|
|
3046
|
+
const A = Number.parseFloat(a.gap);
|
|
3047
|
+
return Number.isFinite(A) ? A : 0;
|
|
3048
|
+
}), y = k(
|
|
3049
|
+
() => `calc((100% - (${g.value} * ${p() - 1})) / ${p()})`
|
|
3050
|
+
), B = k(() => ({
|
|
3051
|
+
"--jh-waterfall-gap": g.value,
|
|
3052
|
+
"--jh-waterfall-column-width": y.value
|
|
3053
|
+
})), f = (A, R) => typeof a.itemKey == "function" ? a.itemKey(A, R) : A[a.itemKey] ?? R, C = (A, R) => {
|
|
3054
|
+
if (typeof a.itemHeight == "number") return a.itemHeight;
|
|
3055
|
+
if (typeof a.itemHeight == "function") return a.itemHeight(A, R);
|
|
3056
|
+
const H = A[a.itemHeight];
|
|
3057
|
+
return typeof H == "number" ? H : 0;
|
|
3058
|
+
}, $ = () => Array.from({ length: p() }, () => ({
|
|
3059
|
+
height: 0,
|
|
3060
|
+
items: []
|
|
3061
|
+
})), F = (A, R) => ({
|
|
3062
|
+
item: A,
|
|
3063
|
+
index: R,
|
|
3064
|
+
key: f(A, R),
|
|
3065
|
+
height: C(A, R)
|
|
3066
|
+
}), u = () => {
|
|
3067
|
+
var H;
|
|
3068
|
+
let A = 0, R = ((H = r.value[0]) == null ? void 0 : H.height) ?? 0;
|
|
3069
|
+
return r.value.forEach((S, D) => {
|
|
3070
|
+
S.height < R && (R = S.height, A = D);
|
|
3071
|
+
}), A;
|
|
3072
|
+
}, w = (A, R) => {
|
|
3073
|
+
const H = u(), S = r.value[H], D = R || A.height || 0;
|
|
3074
|
+
S.items.push({
|
|
3075
|
+
...A,
|
|
3076
|
+
height: D
|
|
3077
|
+
}), S.height += D + v.value;
|
|
3078
|
+
}, _ = () => new Promise((A) => {
|
|
3079
|
+
if (typeof window > "u" || typeof window.requestAnimationFrame != "function") {
|
|
3080
|
+
setTimeout(A, 0);
|
|
3081
|
+
return;
|
|
3082
|
+
}
|
|
3083
|
+
m = window.requestAnimationFrame(() => A());
|
|
3084
|
+
}), L = async (A) => {
|
|
3085
|
+
var S;
|
|
3086
|
+
if (A !== c) return;
|
|
3087
|
+
if (o.value >= a.data.length) {
|
|
3088
|
+
h.value = [], l("layout-end");
|
|
3089
|
+
return;
|
|
3090
|
+
}
|
|
3091
|
+
const R = a.data.slice(o.value, o.value + a.batchSize).map((D, q) => F(D, o.value + q));
|
|
3092
|
+
if (h.value = R, await be(), await _(), A !== c) return;
|
|
3093
|
+
const H = Array.from(((S = i.value) == null ? void 0 : S.children) ?? []);
|
|
3094
|
+
R.forEach((D, q) => {
|
|
3095
|
+
var G;
|
|
3096
|
+
const ee = ((G = H[q]) == null ? void 0 : G.getBoundingClientRect().height) ?? 0;
|
|
3097
|
+
w(D, ee);
|
|
3098
|
+
}), o.value += R.length, h.value = [], await be(), await _(), L(A);
|
|
3099
|
+
}, V = () => {
|
|
3100
|
+
c += 1, o.value = 0, h.value = [], r.value = $(), a.data.length !== 0 && (l("layout-start"), L(c));
|
|
3101
|
+
}, x = () => {
|
|
3102
|
+
V();
|
|
3103
|
+
};
|
|
3104
|
+
return Y(
|
|
3105
|
+
() => [a.data, a.columns, a.gap, a.batchSize, a.itemHeight, a.itemKey],
|
|
3106
|
+
() => V(),
|
|
3107
|
+
{ deep: !1 }
|
|
3108
|
+
), se(() => {
|
|
3109
|
+
a.immediate && V();
|
|
3110
|
+
}), ae(() => {
|
|
3111
|
+
c += 1, m !== void 0 && typeof window < "u" && window.cancelAnimationFrame(m);
|
|
3112
|
+
}), s({
|
|
3113
|
+
refresh: x
|
|
3114
|
+
}), (A, R) => (n(), d("div", {
|
|
3115
|
+
class: "jh-waterfall",
|
|
3116
|
+
style: Z(B.value)
|
|
3117
|
+
}, [
|
|
3118
|
+
A.data.length === 0 ? (n(), d("div", jo, [
|
|
3119
|
+
P(A.$slots, "empty", {}, () => [
|
|
3120
|
+
Q(J(A.emptyText), 1)
|
|
3121
|
+
])
|
|
3122
|
+
])) : (n(), d(O, { key: 1 }, [
|
|
3123
|
+
b("div", wo, [
|
|
3124
|
+
(n(!0), d(O, null, W(r.value, (H, S) => (n(), d("div", {
|
|
3125
|
+
key: S,
|
|
3126
|
+
class: "jh-waterfall__column"
|
|
3127
|
+
}, [
|
|
3128
|
+
(n(!0), d(O, null, W(H.items, (D) => (n(), d("div", {
|
|
3129
|
+
key: D.key,
|
|
3130
|
+
class: "jh-waterfall__item"
|
|
3131
|
+
}, [
|
|
3132
|
+
P(A.$slots, "default", {
|
|
3133
|
+
item: D.item,
|
|
3134
|
+
index: D.index,
|
|
3135
|
+
columnIndex: S,
|
|
3136
|
+
height: D.height
|
|
3137
|
+
})
|
|
3138
|
+
]))), 128))
|
|
3139
|
+
]))), 128))
|
|
3140
|
+
]),
|
|
3141
|
+
b("div", {
|
|
3142
|
+
ref_key: "measureRef",
|
|
3143
|
+
ref: i,
|
|
3144
|
+
class: "jh-waterfall__measure",
|
|
3145
|
+
"aria-hidden": "true"
|
|
3146
|
+
}, [
|
|
3147
|
+
(n(!0), d(O, null, W(h.value, (H) => (n(), d("div", {
|
|
3148
|
+
key: H.key,
|
|
3149
|
+
class: "jh-waterfall__measure-item"
|
|
3150
|
+
}, [
|
|
3151
|
+
P(A.$slots, "default", {
|
|
3152
|
+
item: H.item,
|
|
3153
|
+
index: H.index,
|
|
3154
|
+
columnIndex: -1,
|
|
3155
|
+
height: H.height
|
|
3156
|
+
})
|
|
3157
|
+
]))), 128))
|
|
3158
|
+
], 512)
|
|
3159
|
+
], 64))
|
|
3160
|
+
], 4));
|
|
3161
|
+
}
|
|
3162
|
+
}), Bo = I(So), Vo = [
|
|
3163
|
+
Ye,
|
|
3164
|
+
et,
|
|
3165
|
+
ot,
|
|
3166
|
+
ye,
|
|
3167
|
+
_t,
|
|
3168
|
+
Nt,
|
|
3169
|
+
Pt,
|
|
3170
|
+
Dt,
|
|
3171
|
+
Lt,
|
|
3172
|
+
Zt,
|
|
3173
|
+
Qt,
|
|
3174
|
+
la,
|
|
3175
|
+
ra,
|
|
3176
|
+
ga,
|
|
3177
|
+
Ba,
|
|
3178
|
+
za,
|
|
3179
|
+
xa,
|
|
3180
|
+
qa,
|
|
3181
|
+
z,
|
|
3182
|
+
Za,
|
|
3183
|
+
nl,
|
|
3184
|
+
hl,
|
|
3185
|
+
oe,
|
|
3186
|
+
me,
|
|
3187
|
+
ne,
|
|
3188
|
+
ql,
|
|
3189
|
+
as,
|
|
3190
|
+
ls,
|
|
3191
|
+
is,
|
|
3192
|
+
ms,
|
|
3193
|
+
Ps,
|
|
3194
|
+
Ls,
|
|
3195
|
+
Rs,
|
|
3196
|
+
Gs,
|
|
3197
|
+
to,
|
|
3198
|
+
uo,
|
|
3199
|
+
ko,
|
|
3200
|
+
Bo
|
|
3201
|
+
], Ao = {
|
|
3202
|
+
install(t) {
|
|
3203
|
+
Vo.forEach((s) => {
|
|
3204
|
+
t.use(s);
|
|
3205
|
+
});
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
export {
|
|
3209
|
+
Ye as JhAlert,
|
|
3210
|
+
et as JhBacktop,
|
|
3211
|
+
ot as JhBadge,
|
|
3212
|
+
ye as JhButton,
|
|
3213
|
+
Nt as JhCarousel,
|
|
3214
|
+
Pt as JhCarouselItem,
|
|
3215
|
+
_t as JhCascader,
|
|
3216
|
+
Dt as JhCheckbox,
|
|
3217
|
+
Lt as JhCheckboxGroup,
|
|
3218
|
+
Zt as JhCollapse,
|
|
3219
|
+
Qt as JhCollapseItem,
|
|
3220
|
+
la as JhDatePicker,
|
|
3221
|
+
ra as JhDateTimePicker,
|
|
3222
|
+
ga as JhDialog,
|
|
3223
|
+
Ba as JhDrawer,
|
|
3224
|
+
za as JhDropdown,
|
|
3225
|
+
xa as JhForm,
|
|
3226
|
+
qa as JhFormItem,
|
|
3227
|
+
z as JhIcon,
|
|
3228
|
+
Za as JhInfiniteScroll,
|
|
3229
|
+
nl as JhInput,
|
|
3230
|
+
hl as JhLink,
|
|
3231
|
+
oe as JhMessage,
|
|
3232
|
+
me as JhMessageBox,
|
|
3233
|
+
ne as JhNotification,
|
|
3234
|
+
ql as JhPagination,
|
|
3235
|
+
as as JhRadio,
|
|
3236
|
+
ls as JhRadioGroup,
|
|
3237
|
+
is as JhScrollbar,
|
|
3238
|
+
ms as JhSelect,
|
|
3239
|
+
Rs as JhTabPane,
|
|
3240
|
+
Ps as JhTable,
|
|
3241
|
+
Ls as JhTabs,
|
|
3242
|
+
Gs as JhText,
|
|
3243
|
+
to as JhTimeSelect,
|
|
3244
|
+
uo as JhTree,
|
|
3245
|
+
ko as JhUpload,
|
|
3246
|
+
Bo as JhWaterfall,
|
|
3247
|
+
gl as Message,
|
|
3248
|
+
Vl as MessageBox,
|
|
3249
|
+
Ml as Notification,
|
|
3250
|
+
Re as alertEffects,
|
|
3251
|
+
He as alertEmits,
|
|
3252
|
+
Oe as alertProps,
|
|
3253
|
+
Le as alertTypes,
|
|
3254
|
+
Qe as backtopEmits,
|
|
3255
|
+
Ze as backtopProps,
|
|
3256
|
+
at as badgeProps,
|
|
3257
|
+
tt as badgeTypes,
|
|
3258
|
+
ct as buttonEmits,
|
|
3259
|
+
rt as buttonNativeTypes,
|
|
3260
|
+
dt as buttonProps,
|
|
3261
|
+
it as buttonSizes,
|
|
3262
|
+
nt as buttonTypes,
|
|
3263
|
+
kt as carouselArrows,
|
|
3264
|
+
$e as carouselContextKey,
|
|
3265
|
+
Ct as carouselEmits,
|
|
3266
|
+
jt as carouselItemProps,
|
|
3267
|
+
$t as carouselProps,
|
|
3268
|
+
ft as cascaderEmits,
|
|
3269
|
+
mt as cascaderProps,
|
|
3270
|
+
Jt as checkboxEmits,
|
|
3271
|
+
Et as checkboxGroupEmits,
|
|
3272
|
+
Ce as checkboxGroupKey,
|
|
3273
|
+
Tt as checkboxGroupProps,
|
|
3274
|
+
At as checkboxProps,
|
|
3275
|
+
je as collapseContextKey,
|
|
3276
|
+
Ot as collapseEmits,
|
|
3277
|
+
Ht as collapseItemProps,
|
|
3278
|
+
Rt as collapseProps,
|
|
3279
|
+
ea as datePickerEmits,
|
|
3280
|
+
Xt as datePickerProps,
|
|
3281
|
+
oa as dateTimePickerEmits,
|
|
3282
|
+
sa as dateTimePickerProps,
|
|
3283
|
+
Ao as default,
|
|
3284
|
+
ca as dialogEmits,
|
|
3285
|
+
da as dialogProps,
|
|
3286
|
+
va as drawerDirections,
|
|
3287
|
+
_a as drawerEmits,
|
|
3288
|
+
ya as drawerProps,
|
|
3289
|
+
Aa as dropdownEmits,
|
|
3290
|
+
Na as dropdownPlacements,
|
|
3291
|
+
Pa as dropdownProps,
|
|
3292
|
+
Va as dropdownTriggers,
|
|
3293
|
+
we as formContextKey,
|
|
3294
|
+
Fa as formItemProps,
|
|
3295
|
+
Ka as formProps,
|
|
3296
|
+
Po as iconNames,
|
|
3297
|
+
Ie as iconProps,
|
|
3298
|
+
Ua as infiniteScrollEmits,
|
|
3299
|
+
Ga as infiniteScrollProps,
|
|
3300
|
+
Xa as inputEmits,
|
|
3301
|
+
Qa as inputProps,
|
|
3302
|
+
dl as linkEmits,
|
|
3303
|
+
rl as linkProps,
|
|
3304
|
+
il as linkTypes,
|
|
3305
|
+
kl as messageBoxProps,
|
|
3306
|
+
_l as messageBoxTypes,
|
|
3307
|
+
fl as messageProps,
|
|
3308
|
+
ml as messageTypes,
|
|
3309
|
+
Al as notificationPositions,
|
|
3310
|
+
Tl as notificationProps,
|
|
3311
|
+
Pl as notificationTypes,
|
|
3312
|
+
Dl as paginationEmits,
|
|
3313
|
+
Fl as paginationProps,
|
|
3314
|
+
Wl as radioEmits,
|
|
3315
|
+
Yl as radioGroupEmits,
|
|
3316
|
+
Pe as radioGroupKey,
|
|
3317
|
+
Ul as radioGroupProps,
|
|
3318
|
+
Gl as radioProps,
|
|
3319
|
+
os as scrollbarEmits,
|
|
3320
|
+
ss as scrollbarProps,
|
|
3321
|
+
ds as selectEmits,
|
|
3322
|
+
rs as selectProps,
|
|
3323
|
+
Js as tabPaneProps,
|
|
3324
|
+
bs as tableEmits,
|
|
3325
|
+
fs as tableProps,
|
|
3326
|
+
Ae as tabsContextKey,
|
|
3327
|
+
Ts as tabsEmits,
|
|
3328
|
+
As as tabsProps,
|
|
3329
|
+
xs as textProps,
|
|
3330
|
+
Hs as textSizes,
|
|
3331
|
+
Os as textTypes,
|
|
3332
|
+
Ws as timeSelectEmits,
|
|
3333
|
+
Us as timeSelectProps,
|
|
3334
|
+
lo as treeEmits,
|
|
3335
|
+
ao as treeProps,
|
|
3336
|
+
ho as uploadEmits,
|
|
3337
|
+
po as uploadProps,
|
|
3338
|
+
Co as waterfallEmits,
|
|
3339
|
+
$o as waterfallProps
|
|
3340
|
+
};
|
|
3341
|
+
//# sourceMappingURL=index.mjs.map
|