@digitalwalletcorp/vue-core 1.4.0 → 1.4.2
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/lib/accordion-section.d.cts +1 -1
- package/lib/accordion-section.d.ts +1 -1
- package/lib/{components-B2jz-g6A.js → components-Mk1fpjbw.js} +5 -5
- package/lib/components-ytOBcKlQ.cjs +1 -0
- package/lib/data-table.d.cts +1 -1
- package/lib/data-table.d.ts +1 -1
- package/lib/{types → helpers}/data-table.d.cts +47 -0
- package/lib/{types → helpers}/data-table.d.ts +47 -0
- package/lib/helpers/{show-floating-component.d.cts → floating-component.d.cts} +1 -1
- package/lib/helpers/{show-floating-component.d.ts → floating-component.d.ts} +1 -1
- package/lib/helpers/{show-modal-dialog.d.cts → modal-dialog.d.cts} +21 -7
- package/lib/helpers/{show-modal-dialog.d.ts → modal-dialog.d.ts} +21 -7
- package/lib/helpers/{show-overlay-box.d.ts → overlay-box.d.cts} +3 -1
- package/lib/helpers/{show-overlay-box.d.cts → overlay-box.d.ts} +3 -1
- package/lib/helpers/{show-snackbar.d.cts → snackbar.d.cts} +16 -1
- package/lib/helpers/{show-snackbar.d.ts → snackbar.d.ts} +16 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +15 -18
- package/lib/index.d.ts +15 -18
- package/lib/index.js +181 -265
- package/lib/internal/data-table-controls.d.cts +1 -1
- package/lib/internal/data-table-controls.d.ts +1 -1
- package/lib/internal/floating-component.d.cts +1 -1
- package/lib/internal/floating-component.d.ts +1 -1
- package/lib/internal/message.d.cts +11 -0
- package/lib/internal/message.d.ts +11 -0
- package/lib/internal/movable-window.d.cts +1 -1
- package/lib/internal/movable-window.d.ts +1 -1
- package/lib/internal/pagination.d.cts +1 -1
- package/lib/internal/pagination.d.ts +1 -1
- package/lib/internal/snackbar-container.d.cts +1 -1
- package/lib/internal/snackbar-container.d.ts +1 -1
- package/lib/internal/use-movable-window.d.cts +1 -1
- package/lib/internal/use-movable-window.d.ts +1 -1
- package/lib/internal/{mount-window.d.cts → window-control.d.cts} +22 -1
- package/lib/internal/{mount-window.d.ts → window-control.d.ts} +22 -1
- package/lib/label-button.d.cts +1 -1
- package/lib/label-button.d.ts +1 -1
- package/lib/label-icon.d.cts +12 -2
- package/lib/label-icon.d.ts +12 -2
- package/lib/modal-dialog.d.cts +5 -5
- package/lib/modal-dialog.d.ts +5 -5
- package/lib/nuxt.cjs +1 -1
- package/lib/nuxt.js +1 -1
- package/lib/overlay-box.d.cts +1 -1
- package/lib/overlay-box.d.ts +1 -1
- package/lib/register.cjs +1 -1
- package/lib/register.js +1 -1
- package/lib/style.css +1 -1
- package/lib/tab-content.d.cts +1 -1
- package/lib/tab-content.d.ts +1 -1
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-142lRixg.cjs +4 -0
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-BKR56ef2.js +2019 -0
- package/package.json +1 -1
- package/src/accordion-section.vue +1 -1
- package/src/data-table.vue +2 -2
- package/src/helpers/data-table.ts +250 -0
- package/src/helpers/{show-floating-component.ts → floating-component.ts} +3 -6
- package/src/helpers/{show-modal-dialog.ts → modal-dialog.ts} +26 -7
- package/src/helpers/{show-overlay-box.ts → overlay-box.ts} +5 -2
- package/src/helpers/{show-snackbar.ts → snackbar.ts} +19 -1
- package/src/index.ts +15 -18
- package/src/internal/data-table-controls.vue +1 -1
- package/src/internal/floating-component.vue +2 -2
- package/src/internal/message.ts +118 -0
- package/src/internal/movable-window.vue +1 -1
- package/src/internal/pagination.vue +1 -1
- package/src/internal/snackbar-container.vue +1 -1
- package/src/internal/use-movable-window.ts +1 -1
- package/src/internal/{mount-window.ts → window-control.ts} +31 -1
- package/src/label-button.vue +1 -1
- package/src/label-icon.vue +13 -2
- package/src/modal-dialog.vue +17 -10
- package/src/overlay-box.vue +3 -3
- package/src/tab-content.vue +2 -2
- package/src/tab-group.vue +2 -2
- package/lib/components-COL2ZbhC.cjs +0 -1
- package/lib/helpers/data-table-csv.d.cts +0 -17
- package/lib/helpers/data-table-csv.d.ts +0 -17
- package/lib/internal/data-table-value.d.cts +0 -32
- package/lib/internal/data-table-value.d.ts +0 -32
- package/lib/internal/opened-overlay-boxes.d.cts +0 -2
- package/lib/internal/opened-overlay-boxes.d.ts +0 -2
- package/lib/internal/snackbar-item.d.cts +0 -17
- package/lib/internal/snackbar-item.d.ts +0 -17
- package/lib/internal/window-order.d.cts +0 -6
- package/lib/internal/window-order.d.ts +0 -6
- package/lib/types/label-preset.d.cts +0 -12
- package/lib/types/label-preset.d.ts +0 -12
- package/lib/types/modal-dialog.d.cts +0 -13
- package/lib/types/modal-dialog.d.ts +0 -13
- package/lib/types/movable-window.d.cts +0 -16
- package/lib/types/movable-window.d.ts +0 -16
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-4FIOsOY5.cjs +0 -1
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js +0 -1865
- package/src/helpers/data-table-csv.ts +0 -55
- package/src/internal/data-table-value.ts +0 -99
- package/src/internal/opened-overlay-boxes.ts +0 -2
- package/src/internal/snackbar-item.ts +0 -20
- package/src/internal/window-order.ts +0 -11
- package/src/types/data-table.ts +0 -99
- package/src/types/label-preset.ts +0 -13
- package/src/types/modal-dialog.ts +0 -16
- package/src/types/movable-window.ts +0 -18
- /package/lib/helpers/{show-screen-loading.d.cts → screen-loading.d.cts} +0 -0
- /package/lib/helpers/{show-screen-loading.d.ts → screen-loading.d.ts} +0 -0
- /package/lib/internal/{tab-group-context.d.cts → tab-group.d.cts} +0 -0
- /package/lib/internal/{tab-group-context.d.ts → tab-group.d.ts} +0 -0
- /package/src/helpers/{show-screen-loading.ts → screen-loading.ts} +0 -0
- /package/src/internal/{tab-group-context.ts → tab-group.ts} +0 -0
package/lib/index.js
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { SvgWastebasket as
|
|
5
|
-
const
|
|
6
|
-
const t = [];
|
|
7
|
-
for (const e of n)
|
|
8
|
-
if (e.csv === !0)
|
|
9
|
-
t.push({ header: e, column: {} });
|
|
10
|
-
else if (Array.isArray(e.csv))
|
|
11
|
-
for (const o of e.csv)
|
|
12
|
-
o.disabled || t.push({ header: e, column: o });
|
|
13
|
-
return t;
|
|
14
|
-
}, De = (n) => H(n).map(({ header: t, column: e }) => J(e.label ?? t.label)), Ae = (n, t, e) => H(n).map(({ header: o, column: a }) => {
|
|
15
|
-
if (a.format)
|
|
16
|
-
return a.format(t);
|
|
17
|
-
const s = a.key ?? o.id;
|
|
18
|
-
return s === he ? e : X(t, s);
|
|
19
|
-
}), be = /* @__PURE__ */ E({
|
|
1
|
+
import { n as $, _ as j, a as G, c as q, t as B, u as K, m as J, b as Q, d as U } from "./warning-popper.vue_vue_type_style_index_0_lang-BKR56ef2.js";
|
|
2
|
+
import { e as Fe, f as ze, g as Pe, h as Ve, i as He, j as Ie, k as Ne, l as Re, o as je, p as Ge, q as qe, r as Ke, s as Je, v as Qe, w as Ue, x as Xe, y as Ye, z as Ze, A as en, B as nn, C as tn, D as on } from "./warning-popper.vue_vue_type_style_index_0_lang-BKR56ef2.js";
|
|
3
|
+
import { defineComponent as W, ref as O, onMounted as X, openBlock as u, createBlock as L, Transition as Y, withCtx as b, normalizeStyle as F, normalizeClass as S, createSlots as Z, renderSlot as ee, createTextVNode as ne, toDisplayString as y, createVNode as z, createCommentVNode as w, h as p, render as g, computed as M, TransitionGroup as te, createElementBlock as m, unref as oe, Fragment as ae, renderList as le, createElementVNode as se, shallowReactive as ie } from "vue";
|
|
4
|
+
import { SvgWastebasket as re } from "@digitalwalletcorp/vue-svg-icons";
|
|
5
|
+
const ce = /* @__PURE__ */ W({
|
|
20
6
|
__name: "floating-component",
|
|
21
7
|
props: {
|
|
22
8
|
open: { type: Boolean },
|
|
@@ -35,73 +21,73 @@ const he = "$index", H = (n) => {
|
|
|
35
21
|
},
|
|
36
22
|
emits: ["update:open", "emit:close"],
|
|
37
23
|
setup(n, { emit: t }) {
|
|
38
|
-
const e = n, o = t,
|
|
39
|
-
|
|
40
|
-
},
|
|
24
|
+
const e = n, o = t, l = O(), a = O($()), i = () => {
|
|
25
|
+
a.value = $();
|
|
26
|
+
}, r = () => {
|
|
41
27
|
e.closeOnDblClick && o("update:open", !1);
|
|
42
|
-
},
|
|
43
|
-
const c =
|
|
28
|
+
}, s = () => {
|
|
29
|
+
const c = l.value;
|
|
44
30
|
if (!c?.element)
|
|
45
31
|
return;
|
|
46
32
|
const d = c.element.getBoundingClientRect();
|
|
47
|
-
let
|
|
48
|
-
window.innerWidth <
|
|
33
|
+
let f = e.initialSize?.width ?? d.width;
|
|
34
|
+
window.innerWidth < f && (f = window.innerWidth * 0.9);
|
|
49
35
|
let h = e.initialSize?.height ?? -1;
|
|
50
|
-
window.innerHeight < h && (h = window.innerHeight * 0.9), c.size.width =
|
|
51
|
-
const
|
|
36
|
+
window.innerHeight < h && (h = window.innerHeight * 0.9), c.size.width = f, c.size.height = h;
|
|
37
|
+
const E = document.documentElement.scrollLeft, T = document.documentElement.scrollTop;
|
|
52
38
|
if (e.anchor) {
|
|
53
|
-
const
|
|
54
|
-
width:
|
|
39
|
+
const N = {
|
|
40
|
+
width: f,
|
|
55
41
|
height: 0 <= h ? h : d.height
|
|
56
|
-
},
|
|
42
|
+
}, R = {
|
|
57
43
|
width: document.documentElement.clientWidth,
|
|
58
44
|
height: document.documentElement.clientHeight
|
|
59
|
-
}, D =
|
|
45
|
+
}, D = q(e.anchor.getBoundingClientRect(), N, R, {
|
|
60
46
|
placement: "bottom-start",
|
|
61
47
|
offset: 0,
|
|
62
48
|
margin: 0,
|
|
63
49
|
arrowMargin: 0
|
|
64
50
|
});
|
|
65
|
-
c.position.x = D.left +
|
|
51
|
+
c.position.x = D.left + E, c.position.y = D.top + T;
|
|
66
52
|
} else
|
|
67
|
-
c.position.x = 10 +
|
|
53
|
+
c.position.x = 10 + E, c.position.y = 10 + T;
|
|
68
54
|
};
|
|
69
|
-
return
|
|
70
|
-
e.open &&
|
|
71
|
-
}), (c, d) => (
|
|
55
|
+
return X(() => {
|
|
56
|
+
e.open && s();
|
|
57
|
+
}), (c, d) => (u(), L(Y, {
|
|
72
58
|
name: "dwui-floating-component-fade",
|
|
73
|
-
onAfterLeave: d[1] || (d[1] = (
|
|
59
|
+
onAfterLeave: d[1] || (d[1] = (f) => o("emit:close"))
|
|
74
60
|
}, {
|
|
75
61
|
default: b(() => [
|
|
76
|
-
e.open ? (
|
|
62
|
+
e.open ? (u(), L(j, {
|
|
77
63
|
key: 0,
|
|
78
64
|
ref_key: "refWindow",
|
|
79
|
-
ref:
|
|
65
|
+
ref: l,
|
|
80
66
|
class: S(["dwui-floating-component", { "dwui-lock-scroll": e.lockScroll }]),
|
|
81
67
|
name: "dwui-floating-component",
|
|
82
|
-
style:
|
|
68
|
+
style: F({ "--dwui-order-window": a.value }),
|
|
83
69
|
"drag-mode": e.dragMode,
|
|
84
70
|
loading: e.loading,
|
|
85
71
|
"close-label": e.closeLabel,
|
|
86
72
|
"clamp-bottom": !1,
|
|
87
73
|
"header-class": e.headerClass,
|
|
88
74
|
"header-style": e.headerStyle,
|
|
89
|
-
onPointerdownCapture:
|
|
90
|
-
onDblclick:
|
|
91
|
-
"onEmit:close": d[0] || (d[0] = (
|
|
92
|
-
},
|
|
75
|
+
onPointerdownCapture: i,
|
|
76
|
+
onDblclick: r,
|
|
77
|
+
"onEmit:close": d[0] || (d[0] = (f) => o("update:open", !1))
|
|
78
|
+
}, Z({
|
|
93
79
|
title: b(() => [
|
|
94
|
-
|
|
80
|
+
ne(y(e.title), 1)
|
|
95
81
|
]),
|
|
96
82
|
default: b(() => [
|
|
97
|
-
|
|
83
|
+
ee(c.$slots, "default")
|
|
98
84
|
]),
|
|
99
85
|
_: 2
|
|
100
86
|
}, [
|
|
101
87
|
e.copyValue != null ? {
|
|
102
88
|
name: "actions",
|
|
103
89
|
fn: b(() => [
|
|
104
|
-
|
|
90
|
+
z(G, {
|
|
105
91
|
class: "dwui-floating-component-copy-button",
|
|
106
92
|
value: e.copyValue,
|
|
107
93
|
"aria-label": e.copyLabel
|
|
@@ -109,191 +95,121 @@ const he = "$index", H = (n) => {
|
|
|
109
95
|
]),
|
|
110
96
|
key: "0"
|
|
111
97
|
} : void 0
|
|
112
|
-
]), 1032, ["class", "style", "drag-mode", "loading", "close-label", "header-class", "header-style"])) :
|
|
98
|
+
]), 1032, ["class", "style", "drag-mode", "loading", "close-label", "header-class", "header-style"])) : w("", !0)
|
|
113
99
|
]),
|
|
114
100
|
_: 3
|
|
115
101
|
}));
|
|
116
102
|
}
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
document.body.appendChild(o);
|
|
121
|
-
const a = C(!0), s = C(!1), r = {
|
|
122
|
-
close: () => {
|
|
123
|
-
a.value = !1;
|
|
124
|
-
},
|
|
125
|
-
setLoading: (c) => {
|
|
126
|
-
s.value = c;
|
|
127
|
-
}
|
|
128
|
-
}, i = E(() => () => n({
|
|
129
|
-
open: a.value,
|
|
130
|
-
loading: s.value,
|
|
131
|
-
"onUpdate:open": (c) => {
|
|
132
|
-
a.value = c;
|
|
133
|
-
},
|
|
134
|
-
"onEmit:close": () => {
|
|
135
|
-
e.delete(r), m(null, o), o.remove(), t.onClosed?.(), t.onClose?.();
|
|
136
|
-
}
|
|
137
|
-
}, r)), l = u(i);
|
|
138
|
-
return t.appContext && (l.appContext = t.appContext), m(l, o), e.add(r), r;
|
|
139
|
-
}
|
|
140
|
-
function I(n) {
|
|
141
|
-
const t = ie();
|
|
142
|
-
if (!t)
|
|
143
|
-
throw new Error(`${n}() must be called inside setup().`);
|
|
144
|
-
const e = /* @__PURE__ */ new Set();
|
|
145
|
-
return ce(() => {
|
|
146
|
-
for (const o of e)
|
|
147
|
-
o.close();
|
|
148
|
-
}), {
|
|
149
|
-
appContext: t.appContext,
|
|
150
|
-
own: (o) => {
|
|
151
|
-
const a = o(() => {
|
|
152
|
-
e.delete(a);
|
|
153
|
-
});
|
|
154
|
-
return e.add(a), a;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
const z = /* @__PURE__ */ new Set(), k = (n, t, e) => {
|
|
159
|
-
const { appContext: o, onClose: a, ...s } = t ?? {};
|
|
160
|
-
return V((r, i) => u(be, {
|
|
103
|
+
}), P = /* @__PURE__ */ new Set(), v = (n, t, e) => {
|
|
104
|
+
const { appContext: o, onClose: l, ...a } = t ?? {};
|
|
105
|
+
return J((i, r) => p(ce, {
|
|
161
106
|
closeLabel: "Close",
|
|
162
107
|
copyLabel: "Copy",
|
|
163
108
|
closeOnDblClick: !1,
|
|
164
109
|
lockScroll: !1,
|
|
165
|
-
...
|
|
166
|
-
...
|
|
110
|
+
...a,
|
|
111
|
+
...i
|
|
167
112
|
}, {
|
|
168
|
-
default: () => n(
|
|
169
|
-
}), { appContext: o, onClose:
|
|
170
|
-
},
|
|
113
|
+
default: () => n(r)
|
|
114
|
+
}), { appContext: o, onClose: l, onClosed: e }, P);
|
|
115
|
+
}, V = (n, t) => (e) => p(n, {
|
|
171
116
|
...t,
|
|
172
117
|
...e
|
|
173
|
-
}),
|
|
174
|
-
function
|
|
175
|
-
return
|
|
118
|
+
}), H = (n, t) => () => t && typeof n == "string" ? p("div", { class: "dwui-floating-component-message", innerHTML: n }) : p("div", { class: "dwui-floating-component-message" }, B(n));
|
|
119
|
+
function _e(n, t, e) {
|
|
120
|
+
return v(V(n, t), e);
|
|
176
121
|
}
|
|
177
|
-
function
|
|
122
|
+
function Le(n, t) {
|
|
178
123
|
const { html: e, ...o } = t ?? {};
|
|
179
|
-
return
|
|
180
|
-
copyValue:
|
|
124
|
+
return v(H(n, e), {
|
|
125
|
+
copyValue: B(n),
|
|
181
126
|
...o
|
|
182
127
|
});
|
|
183
128
|
}
|
|
184
|
-
function
|
|
185
|
-
for (const n of [...
|
|
129
|
+
function Se() {
|
|
130
|
+
for (const n of [...P])
|
|
186
131
|
n.close();
|
|
187
132
|
}
|
|
188
|
-
function
|
|
189
|
-
const n =
|
|
133
|
+
function xe() {
|
|
134
|
+
const n = K("useFloatingComponent"), t = (e) => ({
|
|
190
135
|
appContext: n.appContext,
|
|
191
136
|
...e
|
|
192
137
|
});
|
|
193
138
|
return {
|
|
194
|
-
showFloatingComponent: (e, o,
|
|
139
|
+
showFloatingComponent: (e, o, l) => n.own((a) => v(V(e, o), t(l), a)),
|
|
195
140
|
showFloatingMessage: (e, o) => {
|
|
196
|
-
const { html:
|
|
197
|
-
return n.own((
|
|
198
|
-
copyValue:
|
|
199
|
-
...
|
|
200
|
-
}),
|
|
141
|
+
const { html: l, ...a } = o ?? {};
|
|
142
|
+
return n.own((i) => v(H(e, l), t({
|
|
143
|
+
copyValue: B(e),
|
|
144
|
+
...a
|
|
145
|
+
}), i));
|
|
201
146
|
}
|
|
202
147
|
};
|
|
203
148
|
}
|
|
204
149
|
function _(n, t) {
|
|
205
|
-
const { icon: e, appContext: o, ...
|
|
206
|
-
return new Promise((
|
|
207
|
-
const
|
|
208
|
-
document.body.appendChild(
|
|
209
|
-
const
|
|
210
|
-
...
|
|
150
|
+
const { icon: e, appContext: o, ...l } = t ?? {};
|
|
151
|
+
return new Promise((a) => {
|
|
152
|
+
const i = document.createElement("div");
|
|
153
|
+
document.body.appendChild(i);
|
|
154
|
+
const r = p(Q, {
|
|
155
|
+
...l,
|
|
211
156
|
message: n,
|
|
212
157
|
open: !0,
|
|
213
|
-
"onEmit:close": (
|
|
214
|
-
|
|
158
|
+
"onEmit:close": (s) => {
|
|
159
|
+
g(null, i), i.remove(), a(s);
|
|
215
160
|
}
|
|
216
|
-
}, e ? { icon: () =>
|
|
217
|
-
o && (
|
|
161
|
+
}, e ? { icon: () => p(e) } : void 0);
|
|
162
|
+
o && (r.appContext = o), g(r, i);
|
|
218
163
|
});
|
|
219
164
|
}
|
|
220
|
-
function
|
|
165
|
+
function Be(n, t) {
|
|
221
166
|
return _(n, {
|
|
222
167
|
...t,
|
|
223
168
|
type: "info"
|
|
224
169
|
});
|
|
225
170
|
}
|
|
226
|
-
function
|
|
171
|
+
function Ee(n, t) {
|
|
227
172
|
return _(n, {
|
|
228
173
|
...t,
|
|
229
174
|
type: "confirm"
|
|
230
175
|
});
|
|
231
176
|
}
|
|
232
|
-
function
|
|
177
|
+
function Te(n, t) {
|
|
233
178
|
return _(n, {
|
|
234
179
|
...t,
|
|
235
180
|
type: "warn"
|
|
236
181
|
});
|
|
237
182
|
}
|
|
238
|
-
function
|
|
183
|
+
function De(n, t) {
|
|
239
184
|
return _(n, {
|
|
240
185
|
...t,
|
|
241
186
|
type: "error"
|
|
242
187
|
});
|
|
243
188
|
}
|
|
244
|
-
|
|
245
|
-
const { appContext: a, onClose: s, ...r } = e ?? {};
|
|
246
|
-
return V((i, l) => u(ne, {
|
|
247
|
-
...r,
|
|
248
|
-
...i
|
|
249
|
-
}, {
|
|
250
|
-
default: () => u(n, {
|
|
251
|
-
...t,
|
|
252
|
-
close: l.close,
|
|
253
|
-
setLoading: l.setLoading
|
|
254
|
-
})
|
|
255
|
-
}), { appContext: a, onClose: s, onClosed: o }, j);
|
|
256
|
-
};
|
|
257
|
-
function Ne(n, t, e) {
|
|
258
|
-
return G(n, t, e);
|
|
259
|
-
}
|
|
260
|
-
function Re() {
|
|
261
|
-
for (const n of [...j])
|
|
262
|
-
n.close();
|
|
263
|
-
}
|
|
264
|
-
function je() {
|
|
265
|
-
const n = I("useOverlayBox");
|
|
266
|
-
return {
|
|
267
|
-
showOverlayBox: (t, e, o) => n.own((a) => G(t, e, {
|
|
268
|
-
appContext: n.appContext,
|
|
269
|
-
...o
|
|
270
|
-
}, a))
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
function Ge(n) {
|
|
189
|
+
function $e(n) {
|
|
274
190
|
const t = document.createElement("div");
|
|
275
191
|
document.body.appendChild(t);
|
|
276
192
|
const e = () => {
|
|
277
|
-
|
|
193
|
+
g(null, t), t.remove();
|
|
278
194
|
};
|
|
279
|
-
return
|
|
195
|
+
return g(p(U, {
|
|
280
196
|
...n,
|
|
281
197
|
loading: !0
|
|
282
198
|
}), t), { close: e };
|
|
283
199
|
}
|
|
284
|
-
const
|
|
200
|
+
const de = ["aria-label", "title"], ue = ["title", "onClick"], pe = {
|
|
285
201
|
key: 0,
|
|
286
202
|
class: "dwui-snackbar-header"
|
|
287
|
-
},
|
|
203
|
+
}, me = {
|
|
288
204
|
key: 0,
|
|
289
205
|
class: "dwui-snackbar-title"
|
|
290
|
-
},
|
|
206
|
+
}, fe = {
|
|
291
207
|
key: 1,
|
|
292
208
|
class: "dwui-snackbar-label"
|
|
293
|
-
},
|
|
209
|
+
}, we = { class: "dwui-snackbar-message" }, ge = {
|
|
294
210
|
key: 1,
|
|
295
211
|
class: "dwui-snackbar-timestamp"
|
|
296
|
-
},
|
|
212
|
+
}, he = /* @__PURE__ */ W({
|
|
297
213
|
__name: "snackbar-container",
|
|
298
214
|
props: {
|
|
299
215
|
placement: {},
|
|
@@ -302,147 +218,147 @@ const ye = ["aria-label", "title"], ve = ["title", "onClick"], Ce = {
|
|
|
302
218
|
},
|
|
303
219
|
emits: ["emit:close", "emit:clear", "emit:afterLeave"],
|
|
304
220
|
setup(n, { emit: t }) {
|
|
305
|
-
const e = n, o = t,
|
|
306
|
-
const [
|
|
221
|
+
const e = n, o = t, l = M(() => {
|
|
222
|
+
const [i, r = "center"] = e.placement.split("-");
|
|
307
223
|
return [
|
|
308
|
-
`dwui-snackbar-container-${r}`,
|
|
309
224
|
`dwui-snackbar-container-${i}`,
|
|
225
|
+
`dwui-snackbar-container-${r}`,
|
|
310
226
|
`dwui-snackbar-container-${e.direction}`
|
|
311
227
|
];
|
|
312
|
-
}),
|
|
313
|
-
return (
|
|
228
|
+
}), a = M(() => e.items.filter((i) => i.clearable).at(-1)?.clearLabel);
|
|
229
|
+
return (i, r) => (u(), L(te, {
|
|
314
230
|
tag: "div",
|
|
315
231
|
name: "dwui-snackbar-fade",
|
|
316
|
-
class: S(["dwui-snackbar-container",
|
|
232
|
+
class: S(["dwui-snackbar-container", l.value]),
|
|
317
233
|
role: "status",
|
|
318
|
-
onAfterLeave:
|
|
234
|
+
onAfterLeave: r[1] || (r[1] = (s) => o("emit:afterLeave"))
|
|
319
235
|
}, {
|
|
320
236
|
default: b(() => [
|
|
321
|
-
|
|
237
|
+
a.value != null ? (u(), m("button", {
|
|
322
238
|
key: "clear",
|
|
323
239
|
type: "button",
|
|
324
240
|
class: "dwui-snackbar-clear-button",
|
|
325
|
-
"aria-label":
|
|
326
|
-
title:
|
|
327
|
-
onClick:
|
|
241
|
+
"aria-label": a.value,
|
|
242
|
+
title: a.value,
|
|
243
|
+
onClick: r[0] || (r[0] = (s) => o("emit:clear"))
|
|
328
244
|
}, [
|
|
329
|
-
|
|
330
|
-
], 8,
|
|
331
|
-
(
|
|
332
|
-
key:
|
|
245
|
+
z(oe(re))
|
|
246
|
+
], 8, de)) : w("", !0),
|
|
247
|
+
(u(!0), m(ae, null, le(e.items, (s) => (u(), m("button", {
|
|
248
|
+
key: s.id,
|
|
333
249
|
type: "button",
|
|
334
|
-
class: S(["dwui-snackbar",
|
|
335
|
-
style:
|
|
336
|
-
title:
|
|
337
|
-
onClick: (c) => o("emit:close",
|
|
250
|
+
class: S(["dwui-snackbar", s.class]),
|
|
251
|
+
style: F(s.style),
|
|
252
|
+
title: s.message,
|
|
253
|
+
onClick: (c) => o("emit:close", s.id)
|
|
338
254
|
}, [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
])) :
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
], 14,
|
|
255
|
+
s.title || s.label ? (u(), m("span", pe, [
|
|
256
|
+
s.title ? (u(), m("span", me, y(s.title), 1)) : w("", !0),
|
|
257
|
+
s.label ? (u(), m("span", fe, y(s.label), 1)) : w("", !0)
|
|
258
|
+
])) : w("", !0),
|
|
259
|
+
se("span", we, y(s.message), 1),
|
|
260
|
+
s.timestamp ? (u(), m("span", ge, y(s.timestamp), 1)) : w("", !0)
|
|
261
|
+
], 14, ue))), 128))
|
|
346
262
|
]),
|
|
347
263
|
_: 1
|
|
348
264
|
}, 8, ["class"]));
|
|
349
265
|
}
|
|
350
|
-
}),
|
|
351
|
-
let
|
|
352
|
-
const
|
|
353
|
-
const o = n.findIndex((
|
|
266
|
+
}), be = 50, C = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
267
|
+
let A = 0;
|
|
268
|
+
const k = (n, t, e) => {
|
|
269
|
+
const o = n.findIndex((a) => a.id === t);
|
|
354
270
|
if (o < 0)
|
|
355
271
|
return;
|
|
356
272
|
n.splice(o, 1);
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
},
|
|
273
|
+
const l = x.get(t);
|
|
274
|
+
x.delete(t), clearTimeout(l?.timer), l?.onClose?.(e);
|
|
275
|
+
}, I = (n) => {
|
|
360
276
|
const t = n.map((e) => e.id);
|
|
361
277
|
for (let e = 0; e < t.length; e++)
|
|
362
|
-
setTimeout(() =>
|
|
363
|
-
},
|
|
364
|
-
const e = `${n} ${t}`, o =
|
|
278
|
+
setTimeout(() => k(n, t[e], "clear"), be * e);
|
|
279
|
+
}, ye = (n, t) => {
|
|
280
|
+
const e = `${n} ${t}`, o = C.get(e);
|
|
365
281
|
if (o)
|
|
366
282
|
return o;
|
|
367
|
-
const
|
|
368
|
-
document.body.appendChild(
|
|
369
|
-
const
|
|
370
|
-
return
|
|
283
|
+
const l = document.createElement("div");
|
|
284
|
+
document.body.appendChild(l);
|
|
285
|
+
const a = ie([]);
|
|
286
|
+
return C.set(e, a), g(p(he, {
|
|
371
287
|
placement: n,
|
|
372
288
|
direction: t,
|
|
373
|
-
items:
|
|
374
|
-
"onEmit:close": (
|
|
375
|
-
"onEmit:clear": () =>
|
|
289
|
+
items: a,
|
|
290
|
+
"onEmit:close": (i) => k(a, i, "click"),
|
|
291
|
+
"onEmit:clear": () => I(a),
|
|
376
292
|
"onEmit:afterLeave": () => {
|
|
377
|
-
|
|
293
|
+
a.length === 0 && C.get(e) === a && (C.delete(e), g(null, l), l.remove());
|
|
378
294
|
}
|
|
379
|
-
}),
|
|
295
|
+
}), l), a;
|
|
380
296
|
};
|
|
381
|
-
function
|
|
297
|
+
function Oe(n, t) {
|
|
382
298
|
const {
|
|
383
299
|
placement: e = "bottom",
|
|
384
300
|
direction: o = "overlap",
|
|
385
|
-
duration:
|
|
386
|
-
clearable:
|
|
387
|
-
clearLabel:
|
|
388
|
-
onClose:
|
|
389
|
-
...
|
|
390
|
-
} = t ?? {}, c =
|
|
391
|
-
|
|
392
|
-
const d =
|
|
301
|
+
duration: l,
|
|
302
|
+
clearable: a = !1,
|
|
303
|
+
clearLabel: i = "Clear all",
|
|
304
|
+
onClose: r,
|
|
305
|
+
...s
|
|
306
|
+
} = t ?? {}, c = ye(e, o);
|
|
307
|
+
A += 1;
|
|
308
|
+
const d = A;
|
|
393
309
|
return c.push({
|
|
394
|
-
...
|
|
310
|
+
...s,
|
|
395
311
|
id: d,
|
|
396
312
|
message: n,
|
|
397
|
-
clearable:
|
|
398
|
-
clearLabel:
|
|
399
|
-
}),
|
|
400
|
-
timer:
|
|
401
|
-
onClose:
|
|
313
|
+
clearable: a,
|
|
314
|
+
clearLabel: i
|
|
315
|
+
}), x.set(d, {
|
|
316
|
+
timer: l ? setTimeout(() => k(c, d, "duration"), l) : void 0,
|
|
317
|
+
onClose: r
|
|
402
318
|
}), {
|
|
403
|
-
close: () =>
|
|
319
|
+
close: () => k(c, d, "handle")
|
|
404
320
|
};
|
|
405
321
|
}
|
|
406
|
-
function
|
|
407
|
-
for (const n of
|
|
408
|
-
|
|
322
|
+
function Me() {
|
|
323
|
+
for (const n of C.values())
|
|
324
|
+
I(n);
|
|
409
325
|
}
|
|
410
326
|
export {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
327
|
+
Fe as AccordionFieldset,
|
|
328
|
+
ze as AccordionSection,
|
|
329
|
+
G as CopyButton,
|
|
330
|
+
Pe as DarkModeSelector,
|
|
331
|
+
Ve as DataTable,
|
|
332
|
+
He as HelpButton,
|
|
333
|
+
Ie as HelpPopper,
|
|
334
|
+
Ne as HourglassLoading,
|
|
335
|
+
Re as IntersectionLazyComponent,
|
|
336
|
+
je as LabelButton,
|
|
337
|
+
Ge as LabelIcon,
|
|
338
|
+
Q as ModalDialog,
|
|
339
|
+
qe as OverlayBox,
|
|
340
|
+
Ke as PageSection,
|
|
341
|
+
Je as PageTitle,
|
|
342
|
+
U as ScreenLoading,
|
|
343
|
+
Qe as TabContent,
|
|
344
|
+
Ue as TabGroup,
|
|
345
|
+
Xe as WarningPopper,
|
|
346
|
+
Se as closeAllFloatingComponents,
|
|
347
|
+
Ye as closeAllOverlayBoxes,
|
|
348
|
+
Me as closeAllSnackbars,
|
|
349
|
+
Ze as headersToCsvColumns,
|
|
350
|
+
en as rowToCsvColumns,
|
|
351
|
+
Ee as showConfirmationDialog,
|
|
352
|
+
De as showErrorDialog,
|
|
353
|
+
_e as showFloatingComponent,
|
|
354
|
+
Le as showFloatingMessage,
|
|
355
|
+
Be as showInformationDialog,
|
|
440
356
|
_ as showModalDialog,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
357
|
+
nn as showOverlayBox,
|
|
358
|
+
$e as showScreenLoading,
|
|
359
|
+
Oe as showSnackbar,
|
|
360
|
+
Te as showWarningDialog,
|
|
361
|
+
xe as useFloatingComponent,
|
|
362
|
+
tn as useOverlayBox,
|
|
363
|
+
on as vueCoreOptionsKey
|
|
448
364
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文字列またはオブジェクトを、ダイアログやウィンドウに表示するテキストにする
|
|
3
|
+
* オブジェクトは 2 スペースで字下げした JSON 風のテキストにする。読みやすさを優先し、JSON として元に戻せる形にはしない
|
|
4
|
+
* ・JSON 文字列を値に持つ項目は、オブジェクトとして展開する
|
|
5
|
+
* ・文字列の値はエスケープせず、改行や引用符もそのまま出す
|
|
6
|
+
* ・Error は name と message、bigint は文字列、循環参照は "[Circular]" にし、undefined と関数の項目は省く
|
|
7
|
+
*
|
|
8
|
+
* @param {string | object} message
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare function toMessageText(message: string | object): string;
|