hys-ui 0.5.0 → 0.6.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/CHANGELOG.md +7 -0
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +38 -38
- package/dist/components/HysSearch/HysSearch.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
- package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
- package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
- package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
- package/dist/components/HysSortableList/geometry.js +230 -0
- package/dist/components/HysSortableList/model.js +254 -0
- package/dist/components/HysSortableList/transactions.js +281 -0
- package/dist/components/HysSortableList/useSortDrag.js +270 -0
- package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
- package/dist/components/HysSortableList/useSortWindow.js +144 -0
- package/dist/components/HysToast/HysToast.vue.js +3 -3
- package/dist/components/HysToast/HysToast2.vue.js +379 -107
- package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
- package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
- package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
- package/dist/components/HysToast/toastPresentation.js +98 -0
- package/dist/components/HysToast/useToastActions.js +62 -0
- package/dist/components/HysToast/useToastSwipe.js +48 -0
- package/dist/components/HysToast/useToastTimer.js +90 -0
- package/dist/composables/popupReferenceBinding.js +41 -0
- package/dist/composables/toastEscape.js +18 -10
- package/dist/composables/toastQueue.js +276 -0
- package/dist/composables/toastQueueModel.js +86 -0
- package/dist/composables/toastTasks.js +58 -0
- package/dist/composables/useHysToast.js +117 -135
- package/dist/composables/usePopupSurface.js +190 -356
- package/dist/composables/usePopupSurfaceInteractions.js +172 -0
- package/dist/index.js +59 -57
- package/dist/style.css +1 -1
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
- package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
- package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
- package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
- package/dist/types/components/HysSortableList/model.d.ts +61 -0
- package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
- package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
- package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
- package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
- package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
- package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
- package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
- package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
- package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
- package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
- package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
- package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
- package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
- package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
- package/dist/types/composables/toastEscape.d.ts +1 -1
- package/dist/types/composables/toastQueue.d.ts +121 -0
- package/dist/types/composables/toastQueueModel.d.ts +116 -0
- package/dist/types/composables/toastTasks.d.ts +2 -0
- package/dist/types/composables/useHysToast.d.ts +4 -48
- package/dist/types/composables/usePopupSurface.d.ts +20 -20
- package/dist/types/composables/usePopupSurfaceInteractions.d.ts +33 -0
- package/dist/types/index.d.ts +3 -4
- package/package.json +1 -1
|
@@ -1,140 +1,412 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { LoaderCircle as le, TriangleAlert as
|
|
3
|
-
import { useHysRootAttrs as
|
|
4
|
-
import { registerToastEscape as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as me, useSlots as he, getCurrentInstance as ge, useAttrs as be, ref as T, shallowRef as ke, computed as g, watch as Y, onDeactivated as we, onActivated as Ce, onBeforeUnmount as xe, openBlock as u, createBlock as j, Teleport as Be, createVNode as G, Transition as Te, withCtx as Se, createElementBlock as r, mergeProps as Me, unref as l, renderSlot as L, normalizeProps as z, guardReactiveProps as D, resolveDynamicComponent as Pe, normalizeClass as I, createCommentVNode as d, createElementVNode as N, createTextVNode as J, toDisplayString as S, Fragment as $e, renderList as Oe, normalizeStyle as Ae, nextTick as oe } from "vue";
|
|
2
|
+
import { LoaderCircle as le, TriangleAlert as Le, Info as ze, CircleAlert as De, CircleCheck as Ee, Copy as He, X as Ie } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as Ne } from "../../config.js";
|
|
4
|
+
import { registerToastEscape as Ve } from "../../composables/toastEscape.js";
|
|
5
|
+
import { toastLocale as Fe, normalizeToastPosition as Re, toastDuration as Ue, toastMotion as Xe, toastPlacement as qe } from "./toastPresentation.js";
|
|
6
|
+
import { useToastTimer as Ke } from "./useToastTimer.js";
|
|
7
|
+
import { useToastSwipe as Ye } from "./useToastSwipe.js";
|
|
8
|
+
import { useToastActions as je } from "./useToastActions.js";
|
|
9
|
+
const Ge = ["data-hys-theme", "tabindex"], Je = {
|
|
6
10
|
key: 0,
|
|
7
11
|
class: "hys-ui-toast-icon",
|
|
8
12
|
"aria-hidden": "true"
|
|
9
|
-
},
|
|
10
|
-
key:
|
|
11
|
-
class: "hys-ui-toast-
|
|
12
|
-
},
|
|
13
|
+
}, Qe = { class: "hys-ui-toast-content" }, We = ["role", "aria-live"], Ze = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "hys-ui-toast-title"
|
|
16
|
+
}, _e = ["aria-expanded"], et = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "hys-ui-toast-footer"
|
|
19
|
+
}, tt = ["aria-label"], at = ["disabled", "aria-busy", "onClick"], ot = ["aria-label", "title"], lt = {
|
|
20
|
+
key: 1,
|
|
21
|
+
role: "status",
|
|
22
|
+
class: "hys-ui-toast-copy-status"
|
|
23
|
+
}, st = ["title"], it = ["aria-label", "disabled"], ut = ["role", "aria-label", "aria-valuenow"], mt = /* @__PURE__ */ me({
|
|
13
24
|
inheritAttrs: !1,
|
|
14
25
|
__name: "HysToast",
|
|
15
26
|
props: {
|
|
27
|
+
open: { type: Boolean, default: void 0 },
|
|
28
|
+
teleport: { type: Boolean, default: !0 },
|
|
29
|
+
appendTo: { default: "body" },
|
|
30
|
+
repeat: { default: 1 },
|
|
31
|
+
paused: { type: Boolean },
|
|
16
32
|
message: { default: "" },
|
|
33
|
+
title: {},
|
|
17
34
|
type: { default: "success" },
|
|
18
|
-
duration: {},
|
|
35
|
+
duration: { default: void 0 },
|
|
36
|
+
persistent: { type: Boolean },
|
|
19
37
|
closable: { type: Boolean, default: !0 },
|
|
38
|
+
closeOnClick: { type: Boolean },
|
|
39
|
+
closeOnEscape: { type: Boolean },
|
|
40
|
+
keyboardDismiss: { type: Boolean },
|
|
41
|
+
pauseOnHover: { type: Boolean, default: !0 },
|
|
42
|
+
pauseOnBlur: { type: Boolean, default: !0 },
|
|
43
|
+
swipe: { type: Boolean },
|
|
44
|
+
interactive: { type: Boolean, default: !0 },
|
|
20
45
|
position: { default: "top-center" },
|
|
21
46
|
offset: { default: 24 },
|
|
47
|
+
offsetX: {},
|
|
48
|
+
offsetY: {},
|
|
49
|
+
coordinates: {},
|
|
22
50
|
zIndex: { default: 2e3 },
|
|
51
|
+
width: {},
|
|
23
52
|
showIcon: { type: Boolean, default: !0 },
|
|
24
|
-
pauseOnHover: { type: Boolean, default: !0 },
|
|
25
|
-
closeOnEscape: { type: Boolean },
|
|
26
|
-
repeat: { default: 1 },
|
|
27
53
|
plain: { type: Boolean },
|
|
28
|
-
|
|
29
|
-
|
|
54
|
+
glass: { type: Boolean },
|
|
55
|
+
theme: {},
|
|
56
|
+
toastStyle: {},
|
|
57
|
+
progressStyle: {},
|
|
58
|
+
progress: {},
|
|
59
|
+
showProgress: { type: Boolean },
|
|
60
|
+
countdown: { type: Boolean },
|
|
61
|
+
maxLines: {},
|
|
62
|
+
copyable: { type: Boolean },
|
|
63
|
+
copyText: {},
|
|
64
|
+
actionLayout: { default: "inline" },
|
|
65
|
+
actions: {},
|
|
66
|
+
animation: {},
|
|
67
|
+
direction: {},
|
|
68
|
+
animationDuration: {},
|
|
69
|
+
easing: {},
|
|
70
|
+
live: {},
|
|
71
|
+
locale: {},
|
|
72
|
+
beforeClose: {}
|
|
30
73
|
},
|
|
31
|
-
emits: ["close", "afterClose"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
emits: ["update:open", "update", "show", "afterShow", "close", "afterClose", "click", "action", "stateChange"],
|
|
75
|
+
setup(k, { expose: se, emit: ie }) {
|
|
76
|
+
const M = k, c = ie, Q = he(), V = ge(), F = be(), W = Ne(), y = T(), p = T(!0), n = T(!1), A = T(!1), w = T(!1), m = T(!1), P = T(!1), R = ke({}), e = g(() => ({ ...M, ...R.value })), f = g(() => ({ ...Fe, ...e.value.locale })), ue = g(
|
|
77
|
+
() => Re(e.value.position)
|
|
78
|
+
), E = g(() => Ue(e.value)), Z = g(
|
|
79
|
+
() => ({
|
|
80
|
+
success: Ee,
|
|
81
|
+
error: De,
|
|
82
|
+
info: ze,
|
|
83
|
+
warning: Le,
|
|
84
|
+
loading: le,
|
|
85
|
+
default: void 0,
|
|
86
|
+
custom: void 0
|
|
87
|
+
})[e.value.type]
|
|
88
|
+
), U = g(
|
|
89
|
+
() => e.value.live ?? (e.value.type === "error" ? "assertive" : "polite")
|
|
90
|
+
);
|
|
91
|
+
let H, X, q, C, x, $ = 0;
|
|
92
|
+
function B() {
|
|
93
|
+
return {
|
|
94
|
+
id: typeof F["data-toast-id"] == "string" ? F["data-toast-id"] : void 0,
|
|
95
|
+
message: e.value.message,
|
|
96
|
+
title: e.value.title,
|
|
97
|
+
type: e.value.type
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function ne(t) {
|
|
101
|
+
var a;
|
|
102
|
+
n.value && ((a = V == null ? void 0 : V.vnode.props) != null && a.onUpdate || (R.value = {
|
|
103
|
+
...R.value,
|
|
104
|
+
...typeof t == "string" ? { message: t } : t
|
|
105
|
+
}), c("update", t));
|
|
37
106
|
}
|
|
38
|
-
|
|
39
|
-
|
|
107
|
+
const s = je({
|
|
108
|
+
available: () => p.value && n.value && e.value.interactive,
|
|
109
|
+
locale: () => f.value,
|
|
110
|
+
context: B,
|
|
111
|
+
close: () => b("action"),
|
|
112
|
+
update: ne,
|
|
113
|
+
copyText: () => {
|
|
114
|
+
var t, a;
|
|
115
|
+
return e.value.copyText ?? (e.value.message || ((a = (t = y.value) == null ? void 0 : t.querySelector(".hys-ui-toast-message")) == null ? void 0 : a.textContent) || "");
|
|
116
|
+
},
|
|
117
|
+
emit: (t) => c("action", t)
|
|
118
|
+
}), i = Ye(
|
|
119
|
+
y,
|
|
120
|
+
() => e.value.swipe && e.value.interactive && n.value && !m.value,
|
|
121
|
+
(t) => b("swipe", t)
|
|
122
|
+
), v = Ke({
|
|
123
|
+
running: () => p.value && n.value && !e.value.paused && !m.value && !(e.value.pauseOnHover && A.value) && !w.value && !i.dragging.value && s.busy.value === void 0,
|
|
124
|
+
duration: () => E.value,
|
|
125
|
+
indicators: () => e.value.countdown || e.value.showProgress && e.value.progress === void 0,
|
|
126
|
+
pauseOnBlur: () => e.value.pauseOnBlur,
|
|
127
|
+
expire: () => {
|
|
128
|
+
b("timeout");
|
|
129
|
+
}
|
|
130
|
+
}), O = g(() => {
|
|
131
|
+
const t = e.value.progress;
|
|
132
|
+
if (t === "indeterminate") return t;
|
|
133
|
+
if (typeof t == "number")
|
|
134
|
+
return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
|
|
135
|
+
if (e.value.showProgress && E.value > 0 && v.total.value > 0)
|
|
136
|
+
return v.remaining.value / v.total.value * 100;
|
|
137
|
+
}), re = g(() => Xe(e.value)), ve = g(() => ({
|
|
138
|
+
...M.teleport ? qe(e.value) : {},
|
|
139
|
+
...re.value,
|
|
140
|
+
"--hys-toast-drag-x": i.shift.value + "px",
|
|
141
|
+
"--hys-toast-drag-opacity": Math.max(
|
|
142
|
+
0.38,
|
|
143
|
+
1 - Math.abs(i.shift.value) / 280
|
|
144
|
+
),
|
|
145
|
+
"--hys-toast-lines": Math.max(1, Math.floor(e.value.maxLines ?? 1)),
|
|
146
|
+
width: typeof e.value.width == "number" ? Math.max(0, e.value.width) + "px" : e.value.width,
|
|
147
|
+
...e.value.toastStyle
|
|
148
|
+
}));
|
|
149
|
+
function _() {
|
|
150
|
+
const t = H;
|
|
151
|
+
!t || n.value || !p.value || (H = void 0, i.reset(), C != null && C.isConnected && document.activeElement === document.body && C.focus({ preventScroll: !0 }), C = void 0, c("afterClose", t), c("stateChange", "closed", t));
|
|
40
152
|
}
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
153
|
+
function ee(t) {
|
|
154
|
+
if (!n.value) return;
|
|
155
|
+
$++, H = t;
|
|
156
|
+
const a = !!y.value;
|
|
157
|
+
C = w.value ? q : void 0, n.value = !1, m.value = !1, A.value = w.value = !1, s.reset(), c("stateChange", "closing", t), c("close", t), a || oe(_);
|
|
158
|
+
}
|
|
159
|
+
async function b(t = "api", a, h = !1) {
|
|
160
|
+
if (!n.value || !p.value || m.value && !h)
|
|
161
|
+
return !1;
|
|
162
|
+
const o = { ...B(), reason: t, event: a }, ae = $;
|
|
163
|
+
if (!h && e.value.beforeClose) {
|
|
164
|
+
m.value = !0;
|
|
165
|
+
let K = !1;
|
|
166
|
+
try {
|
|
167
|
+
K = await e.value.beforeClose(o) !== !1;
|
|
168
|
+
} catch {
|
|
169
|
+
K = !1;
|
|
46
170
|
}
|
|
47
|
-
|
|
171
|
+
if (ae !== $) return !1;
|
|
172
|
+
if (!K)
|
|
173
|
+
return m.value = !1, !1;
|
|
48
174
|
}
|
|
175
|
+
return M.open !== void 0 && !h ? (X = o, c("update:open", !1), await oe(), X = void 0, m.value = !1, !n.value) : (ee(o), !0);
|
|
49
176
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
177
|
+
function de() {
|
|
178
|
+
$++, H = void 0, C = void 0, P.value = !1, n.value = !0, v.restart(), c("show", B()), c("stateChange", "visible", B());
|
|
52
179
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
180
|
+
function te() {
|
|
181
|
+
p.value && n.value && c("afterShow", B());
|
|
55
182
|
}
|
|
56
|
-
function
|
|
57
|
-
!
|
|
183
|
+
function ce(t) {
|
|
184
|
+
!e.value.interactive || !e.value.keyboardDismiss || t.target !== y.value || (t.key === "Delete" || (t.key === "Enter" || t.key === " ") && e.value.closeOnClick) && (t.preventDefault(), b("keyboard", t));
|
|
58
185
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
186
|
+
function pe(t) {
|
|
187
|
+
var a;
|
|
188
|
+
!w.value && t.relatedTarget instanceof HTMLElement && !((a = y.value) != null && a.contains(t.relatedTarget)) && (q = t.relatedTarget), w.value = !0;
|
|
189
|
+
}
|
|
190
|
+
function fe(t) {
|
|
191
|
+
var a;
|
|
192
|
+
(a = y.value) != null && a.contains(t.relatedTarget) || (w.value = !1, q = void 0);
|
|
193
|
+
}
|
|
194
|
+
function ye(t) {
|
|
195
|
+
var a;
|
|
196
|
+
!e.value.interactive || i.suppressClick.value || (a = t.target) != null && a.closest(
|
|
197
|
+
"button,a,input,textarea,select,[role=button],[contenteditable=true]"
|
|
198
|
+
) || (c("click", t, B()), e.value.closeOnClick && b("click", t));
|
|
199
|
+
}
|
|
200
|
+
return Y(
|
|
201
|
+
() => [
|
|
202
|
+
M.open ?? !!(e.value.message || e.value.title || Q.default || Q.header),
|
|
203
|
+
e.value.message,
|
|
204
|
+
e.value.title
|
|
205
|
+
],
|
|
206
|
+
([t, a, h], o) => {
|
|
207
|
+
t ? !n.value && (!(o != null && o[0]) || M.open === void 0 && (a && a !== o[1] || h && h !== o[2])) && de() : ee(X ?? { ...B(), reason: "model" });
|
|
208
|
+
},
|
|
209
|
+
{ immediate: !0 }
|
|
210
|
+
), Y(
|
|
211
|
+
() => [E.value, e.value.message, M.repeat],
|
|
212
|
+
() => {
|
|
213
|
+
n.value && v.restart();
|
|
214
|
+
}
|
|
215
|
+
), Y(
|
|
216
|
+
() => n.value && p.value && e.value.interactive && e.value.closeOnEscape,
|
|
217
|
+
(t) => {
|
|
218
|
+
x == null || x(), x = t ? Ve(
|
|
219
|
+
(a) => void b("escape", a),
|
|
220
|
+
() => y.value
|
|
221
|
+
) : void 0;
|
|
222
|
+
},
|
|
223
|
+
{ immediate: !0, flush: "sync" }
|
|
224
|
+
), we(() => {
|
|
225
|
+
p.value = !1, $++, m.value = !1, A.value = w.value = !1, s.reset(), i.reset();
|
|
226
|
+
}), Ce(() => {
|
|
227
|
+
p.value = !0;
|
|
228
|
+
}), xe(() => {
|
|
229
|
+
$++, p.value = !1, s.reset(), x == null || x();
|
|
230
|
+
}), se({
|
|
231
|
+
close: b,
|
|
232
|
+
pause: v.pause,
|
|
233
|
+
resume: v.resume,
|
|
234
|
+
restart: v.restart,
|
|
235
|
+
extend: v.extend,
|
|
236
|
+
element: y,
|
|
237
|
+
snapshotClock: v.snapshot,
|
|
238
|
+
restoreClock: v.restore
|
|
239
|
+
}), (t, a) => (u(), j(Be, {
|
|
240
|
+
to: k.appendTo,
|
|
241
|
+
disabled: !k.teleport
|
|
72
242
|
}, [
|
|
73
|
-
|
|
74
|
-
name: "hys-
|
|
243
|
+
G(Te, {
|
|
244
|
+
name: "hys-toast-enter",
|
|
75
245
|
appear: "",
|
|
76
|
-
|
|
246
|
+
onAfterEnter: te,
|
|
247
|
+
onAfterAppear: te,
|
|
248
|
+
onAfterLeave: _
|
|
77
249
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
250
|
+
default: Se(() => {
|
|
251
|
+
var h;
|
|
252
|
+
return [
|
|
253
|
+
n.value && p.value ? (u(), r("div", Me({
|
|
254
|
+
key: 0,
|
|
255
|
+
ref_key: "element",
|
|
256
|
+
ref: y
|
|
257
|
+
}, { ...l(W), ...l(F) }, {
|
|
258
|
+
"data-hys-theme": e.value.theme ?? l(W)["data-hys-theme"],
|
|
259
|
+
class: ["hys-ui-toast", [
|
|
260
|
+
"hys-ui-toast-" + e.value.type,
|
|
261
|
+
"hys-ui-toast-position-" + ue.value,
|
|
262
|
+
{
|
|
263
|
+
"hys-ui-toast-inline": !k.teleport,
|
|
264
|
+
"hys-ui-toast-plain": e.value.plain,
|
|
265
|
+
"hys-ui-toast-glass": e.value.glass,
|
|
266
|
+
"hys-ui-toast-swipe": e.value.swipe && e.value.interactive,
|
|
267
|
+
"hys-ui-toast-dragging": l(i).dragging.value,
|
|
268
|
+
"hys-ui-toast-clickable": e.value.closeOnClick && e.value.interactive,
|
|
269
|
+
"hys-ui-toast-bounce": e.value.animation === "bounce"
|
|
270
|
+
}
|
|
271
|
+
]],
|
|
272
|
+
style: ve.value,
|
|
273
|
+
tabindex: e.value.keyboardDismiss && e.value.interactive ? 0 : void 0,
|
|
274
|
+
onMouseenter: a[3] || (a[3] = (o) => A.value = !0),
|
|
275
|
+
onMouseleave: a[4] || (a[4] = (o) => A.value = !1),
|
|
276
|
+
onFocusin: pe,
|
|
277
|
+
onFocusout: fe,
|
|
278
|
+
onClick: ye,
|
|
279
|
+
onKeydown: ce,
|
|
280
|
+
onPointerdown: a[5] || (a[5] = //@ts-ignore
|
|
281
|
+
(...o) => l(i).start && l(i).start(...o)),
|
|
282
|
+
onPointermove: a[6] || (a[6] = //@ts-ignore
|
|
283
|
+
(...o) => l(i).move && l(i).move(...o)),
|
|
284
|
+
onPointerup: a[7] || (a[7] = //@ts-ignore
|
|
285
|
+
(...o) => l(i).end && l(i).end(...o)),
|
|
286
|
+
onPointerleave: a[8] || (a[8] = //@ts-ignore
|
|
287
|
+
(...o) => l(i).leave && l(i).leave(...o)),
|
|
288
|
+
onPointercancel: a[9] || (a[9] = //@ts-ignore
|
|
289
|
+
(...o) => l(i).reset && l(i).reset(...o))
|
|
290
|
+
}), [
|
|
291
|
+
e.value.showIcon && (Z.value || t.$slots.icon) ? (u(), r("span", Je, [
|
|
292
|
+
L(t.$slots, "icon", z(D(l(s).context())), () => [
|
|
293
|
+
(u(), j(Pe(Z.value), {
|
|
294
|
+
size: 18,
|
|
295
|
+
class: I({ "hys-ui-toast-spinner": e.value.type === "loading" })
|
|
296
|
+
}, null, 8, ["class"]))
|
|
297
|
+
], !0)
|
|
298
|
+
])) : d("", !0),
|
|
299
|
+
N("div", Qe, [
|
|
300
|
+
N("div", {
|
|
301
|
+
role: U.value === "off" ? void 0 : U.value === "assertive" ? "alert" : "status",
|
|
302
|
+
"aria-live": U.value,
|
|
303
|
+
"aria-atomic": "true"
|
|
304
|
+
}, [
|
|
305
|
+
e.value.title || t.$slots.header ? (u(), r("div", Ze, [
|
|
306
|
+
L(t.$slots, "header", z(D(l(s).context())), () => [
|
|
307
|
+
J(S(e.value.title), 1)
|
|
308
|
+
], !0)
|
|
309
|
+
])) : d("", !0),
|
|
310
|
+
N("div", {
|
|
311
|
+
class: I(["hys-ui-toast-message", { "hys-ui-toast-clamped": e.value.maxLines && !P.value }])
|
|
312
|
+
}, [
|
|
313
|
+
L(t.$slots, "default", z(D(l(s).context())), () => [
|
|
314
|
+
J(S(e.value.message), 1)
|
|
315
|
+
], !0)
|
|
316
|
+
], 2)
|
|
317
|
+
], 8, We),
|
|
318
|
+
e.value.maxLines && e.value.interactive ? (u(), r("button", {
|
|
319
|
+
key: 0,
|
|
320
|
+
class: "hys-ui-toast-text-action",
|
|
321
|
+
type: "button",
|
|
322
|
+
"aria-expanded": P.value,
|
|
323
|
+
onClick: a[0] || (a[0] = (o) => P.value = !P.value)
|
|
324
|
+
}, S(P.value ? f.value.collapse : f.value.expand), 9, _e)) : d("", !0),
|
|
325
|
+
t.$slots.footer ? (u(), r("div", et, [
|
|
326
|
+
L(t.$slots, "footer", z(D(l(s).context())), void 0, !0)
|
|
327
|
+
])) : d("", !0)
|
|
328
|
+
]),
|
|
329
|
+
k.repeat > 1 ? (u(), r("span", {
|
|
330
|
+
key: 1,
|
|
331
|
+
class: "hys-ui-toast-repeat",
|
|
332
|
+
"aria-label": f.value.repeat(k.repeat)
|
|
333
|
+
}, "×" + S(k.repeat), 9, tt)) : d("", !0),
|
|
334
|
+
e.value.interactive && (t.$slots.action || (h = e.value.actions) != null && h.length || e.value.copyable) ? (u(), r("div", {
|
|
335
|
+
key: 2,
|
|
336
|
+
class: I(["hys-ui-toast-action", {
|
|
337
|
+
"hys-ui-toast-action-footer": e.value.actionLayout === "footer"
|
|
338
|
+
}])
|
|
339
|
+
}, [
|
|
340
|
+
L(t.$slots, "action", z(D(l(s).context())), () => [
|
|
341
|
+
(u(!0), r($e, null, Oe(e.value.actions, (o) => (u(), r("button", {
|
|
342
|
+
key: o.id,
|
|
343
|
+
class: "hys-ui-toast-text-action",
|
|
344
|
+
type: "button",
|
|
345
|
+
disabled: o.disabled || l(s).busy.value !== void 0 && l(s).busy.value !== o.id,
|
|
346
|
+
"aria-busy": l(s).busy.value === o.id || void 0,
|
|
347
|
+
onClick: (ae) => l(s).run(o)
|
|
348
|
+
}, [
|
|
349
|
+
l(s).busy.value === o.id ? (u(), j(l(le), {
|
|
350
|
+
key: 0,
|
|
351
|
+
class: "hys-ui-toast-spinner",
|
|
352
|
+
size: 14,
|
|
353
|
+
"aria-hidden": "true"
|
|
354
|
+
})) : d("", !0),
|
|
355
|
+
J(S(o.label), 1)
|
|
356
|
+
], 8, at))), 128))
|
|
357
|
+
], !0),
|
|
358
|
+
e.value.copyable ? (u(), r("button", {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "hys-ui-toast-close",
|
|
361
|
+
type: "button",
|
|
362
|
+
"aria-label": f.value.copy,
|
|
363
|
+
title: f.value.copy,
|
|
364
|
+
onClick: a[1] || (a[1] = //@ts-ignore
|
|
365
|
+
(...o) => l(s).copy && l(s).copy(...o))
|
|
366
|
+
}, [
|
|
367
|
+
G(l(He), { size: 15 })
|
|
368
|
+
], 8, ot)) : d("", !0),
|
|
369
|
+
l(s).copyStatus.value ? (u(), r("span", lt, S(l(s).copyStatus.value), 1)) : d("", !0)
|
|
370
|
+
], 2)) : d("", !0),
|
|
371
|
+
e.value.countdown && E.value > 0 ? (u(), r("span", {
|
|
372
|
+
key: 3,
|
|
373
|
+
class: "hys-ui-toast-countdown",
|
|
374
|
+
title: f.value.remaining(Math.ceil(l(v).remaining.value / 1e3))
|
|
375
|
+
}, S(f.value.remaining(Math.ceil(l(v).remaining.value / 1e3))), 9, st)) : d("", !0),
|
|
376
|
+
e.value.closable && e.value.interactive ? (u(), r("button", {
|
|
377
|
+
key: 4,
|
|
378
|
+
class: "hys-ui-toast-close hys-ui-toast-dismiss",
|
|
379
|
+
type: "button",
|
|
380
|
+
"aria-label": f.value.close,
|
|
381
|
+
disabled: m.value,
|
|
382
|
+
onClick: a[2] || (a[2] = (o) => b("button", o))
|
|
383
|
+
}, [
|
|
384
|
+
G(l(Ie), { size: 14 })
|
|
385
|
+
], 8, it)) : d("", !0),
|
|
386
|
+
O.value !== void 0 ? (u(), r("div", {
|
|
387
|
+
key: 5,
|
|
388
|
+
class: I(["hys-ui-toast-progress", {
|
|
389
|
+
"hys-ui-toast-progress-indeterminate": O.value === "indeterminate"
|
|
390
|
+
}]),
|
|
391
|
+
role: e.value.progress !== void 0 ? "progressbar" : void 0,
|
|
392
|
+
"aria-label": f.value.progress,
|
|
393
|
+
"aria-valuenow": typeof O.value == "number" ? Math.round(O.value) : void 0
|
|
394
|
+
}, [
|
|
395
|
+
N("span", {
|
|
396
|
+
style: Ae({
|
|
397
|
+
inlineSize: O.value === "indeterminate" ? void 0 : O.value + "%",
|
|
398
|
+
...e.value.progressStyle
|
|
399
|
+
})
|
|
400
|
+
}, null, 4)
|
|
401
|
+
], 10, ut)) : d("", !0)
|
|
402
|
+
], 16, Ge)) : d("", !0)
|
|
403
|
+
];
|
|
404
|
+
}),
|
|
133
405
|
_: 3
|
|
134
406
|
})
|
|
135
407
|
], 8, ["to", "disabled"]));
|
|
136
408
|
}
|
|
137
409
|
});
|
|
138
410
|
export {
|
|
139
|
-
|
|
411
|
+
mt as default
|
|
140
412
|
};
|