geekin-devtoys 0.3.6 → 0.3.7
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/GDialog/index.js +1 -1
- package/lib/GDialog/index.mjs +425 -304
- package/lib/GDialog/style.css +1 -1
- package/lib/GSteps/index.js +1 -0
- package/lib/GSteps/index.mjs +69 -0
- package/lib/GSteps/style.css +1 -0
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +106 -79
- package/lib/components/GDialog/const.d.ts +2 -2
- package/lib/components/GDialog/index.d.ts +1 -1
- package/lib/components/GInputTreeTag/index.d.ts +4 -4
- package/lib/components/GSteps/index.d.ts +43 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +36 -36
- package/lib/index.d.ts +2 -2
- package/package.json +9 -9
- package/lib/GDialog/style2.css +0 -1
- package/lib/GDialogPro/index.js +0 -1
- package/lib/GDialogPro/index.mjs +0 -529
- package/lib/components/GDialogPro/GDialogMinimizedIcon.d.ts +0 -17
- package/lib/components/GDialogPro/const.d.ts +0 -55
- package/lib/components/GDialogPro/index.d.ts +0 -147
- package/lib/components/GDialogPro/useDialogManager.d.ts +0 -58
- package/lib/index-B1MYKy3L.js +0 -1
- package/lib/index-Dxw2pU4z.mjs +0 -106
- /package/lib/{GDialogPro.d.ts → GSteps.d.ts} +0 -0
- /package/lib/components/{GDialogPro → GDialog}/GButton.d.ts +0 -0
- /package/lib/components/{GDialogPro → GDialog}/icons.d.ts +0 -0
package/lib/GDialog/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { c as he, r as ze, a as Te, b as ke } from "../index-Dxw2pU4z.mjs";
|
|
1
|
+
import { inject as pe, reactive as ie, computed as d, h as f, defineComponent as x, ref as k, watch as N, onUnmounted as oe, createBlock as _, openBlock as r, Teleport as ne, createVNode as L, unref as I, normalizeStyle as ge, normalizeClass as ae, withCtx as T, createElementVNode as c, toDisplayString as M, createElementBlock as b, createCommentVNode as w, resolveDynamicComponent as ve, renderSlot as R, useId as J, onMounted as ye, Transition as he, withModifiers as ke, mergeProps as _e, Fragment as Q, renderList as we, createTextVNode as F } from "vue";
|
|
3
2
|
import { A as be } from "../AnimatePresence-nl0c23TZ.mjs";
|
|
4
|
-
import { m as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
3
|
+
import { m as ze } from "../index-Bbr5fWvI.mjs";
|
|
4
|
+
import { _ as K } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Ce = /* @__PURE__ */ Symbol("GDialogManager"), ee = {
|
|
7
6
|
small: "380px",
|
|
8
7
|
medium: "480px",
|
|
9
8
|
large: "580px"
|
|
10
|
-
},
|
|
9
|
+
}, W = {
|
|
11
10
|
ICON_WIDTH: 92,
|
|
12
11
|
ICON_HEIGHT: 34,
|
|
13
12
|
GAP: 8,
|
|
@@ -15,74 +14,125 @@ const Me = /* @__PURE__ */ Symbol("GDialogManager"), q = {
|
|
|
15
14
|
RIGHT_OFFSET: 18,
|
|
16
15
|
MAX_PER_ROW: 8
|
|
17
16
|
};
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
const o = Math.floor(
|
|
22
|
-
|
|
23
|
-
right:
|
|
24
|
-
bottom:
|
|
17
|
+
function Te(l) {
|
|
18
|
+
const m = /* @__PURE__ */ new Map(), { ICON_WIDTH: a, ICON_HEIGHT: s, GAP: p, BOTTOM_OFFSET: e, RIGHT_OFFSET: i, MAX_PER_ROW: u } = W;
|
|
19
|
+
return l.forEach((g, v) => {
|
|
20
|
+
const o = Math.floor(v / u), n = v % u;
|
|
21
|
+
m.set(g, {
|
|
22
|
+
right: i + n * (a + p),
|
|
23
|
+
bottom: e + o * (s + p)
|
|
25
24
|
});
|
|
26
|
-
}),
|
|
25
|
+
}), m;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
27
|
+
function Je() {
|
|
28
|
+
const l = ie(/* @__PURE__ */ new Map()), m = d(() => {
|
|
30
29
|
const o = [];
|
|
31
|
-
return
|
|
32
|
-
|
|
30
|
+
return l.forEach((n) => {
|
|
31
|
+
n.isMinimized && o.push(n.id);
|
|
33
32
|
}), o;
|
|
34
|
-
}),
|
|
33
|
+
}), a = d(() => Te(m.value));
|
|
35
34
|
function s(o) {
|
|
36
|
-
|
|
35
|
+
l.set(o.id, { attentionTick: 0, ...o });
|
|
37
36
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
37
|
+
function p(o) {
|
|
38
|
+
l.delete(o);
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
45
|
-
|
|
40
|
+
function e(o) {
|
|
41
|
+
const n = l.get(o);
|
|
42
|
+
if (n) {
|
|
43
|
+
if (n.isMinimized) {
|
|
44
|
+
n.attentionTick = (n.attentionTick ?? 0) + 1;
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
n.isMinimized = !0;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
|
|
50
|
+
function i(o) {
|
|
51
|
+
const n = l.get(o);
|
|
52
|
+
n?.isMinimized && (n.attentionTick = (n.attentionTick ?? 0) + 1);
|
|
54
53
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
function u(o) {
|
|
55
|
+
const n = l.get(o);
|
|
56
|
+
n && (n.isMinimized = !1);
|
|
58
57
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
61
|
-
() =>
|
|
62
|
-
right:
|
|
63
|
-
bottom:
|
|
58
|
+
function g(o) {
|
|
59
|
+
return d(
|
|
60
|
+
() => a.value.get(o) ?? {
|
|
61
|
+
right: W.RIGHT_OFFSET,
|
|
62
|
+
bottom: W.BOTTOM_OFFSET
|
|
64
63
|
}
|
|
65
64
|
);
|
|
66
65
|
}
|
|
67
|
-
const
|
|
66
|
+
const v = d(() => m.value.map((o) => l.get(o)).filter(Boolean));
|
|
68
67
|
return {
|
|
69
|
-
dialogs:
|
|
68
|
+
dialogs: l,
|
|
70
69
|
register: s,
|
|
71
|
-
unregister:
|
|
72
|
-
minimize:
|
|
73
|
-
remindMinimized:
|
|
74
|
-
restore:
|
|
75
|
-
getPosition:
|
|
76
|
-
minimizedList:
|
|
70
|
+
unregister: p,
|
|
71
|
+
minimize: e,
|
|
72
|
+
remindMinimized: i,
|
|
73
|
+
restore: u,
|
|
74
|
+
getPosition: g,
|
|
75
|
+
minimizedList: v
|
|
77
76
|
};
|
|
78
77
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
78
|
+
function Me() {
|
|
79
|
+
return pe(Ce, null);
|
|
81
80
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
81
|
+
const V = {
|
|
82
|
+
viewBox: "0 0 16 16",
|
|
83
|
+
fill: "none",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
84
85
|
"aria-hidden": "true"
|
|
85
|
-
},
|
|
86
|
+
}, Ie = () => f("svg", V, [
|
|
87
|
+
f("path", {
|
|
88
|
+
d: "M3.5 8h9",
|
|
89
|
+
stroke: "currentColor",
|
|
90
|
+
"stroke-width": 1.6,
|
|
91
|
+
"stroke-linecap": "round"
|
|
92
|
+
})
|
|
93
|
+
]), Oe = () => f("svg", V, [
|
|
94
|
+
f("path", {
|
|
95
|
+
d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9",
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
"stroke-width": 1.6,
|
|
98
|
+
"stroke-linecap": "round"
|
|
99
|
+
}),
|
|
100
|
+
f("path", {
|
|
101
|
+
d: "M13.5 2v3.5H10",
|
|
102
|
+
stroke: "currentColor",
|
|
103
|
+
"stroke-width": 1.6,
|
|
104
|
+
"stroke-linecap": "round",
|
|
105
|
+
"stroke-linejoin": "round"
|
|
106
|
+
})
|
|
107
|
+
]), Be = () => f("svg", V, [
|
|
108
|
+
f("circle", {
|
|
109
|
+
cx: 8,
|
|
110
|
+
cy: 8,
|
|
111
|
+
r: 6,
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
"stroke-width": 1.6
|
|
114
|
+
}),
|
|
115
|
+
f("path", {
|
|
116
|
+
d: "M5.3 8.2l1.9 1.9 3.5-4",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
"stroke-width": 1.6,
|
|
119
|
+
"stroke-linecap": "round",
|
|
120
|
+
"stroke-linejoin": "round"
|
|
121
|
+
})
|
|
122
|
+
]), Ee = () => f("svg", V, [
|
|
123
|
+
f("path", {
|
|
124
|
+
d: "M2.5 4.5a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4.5a2 2 0 0 1-2 2H7.2L4.8 13.6V11a2 2 0 0 1-2-2V4.5z",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
"stroke-width": 1.4,
|
|
127
|
+
"stroke-linejoin": "round"
|
|
128
|
+
}),
|
|
129
|
+
f("circle", { cx: 5.8, cy: 6.7, r: 0.7, fill: "currentColor" }),
|
|
130
|
+
f("circle", { cx: 8, cy: 6.7, r: 0.7, fill: "currentColor" }),
|
|
131
|
+
f("circle", { cx: 10.2, cy: 6.7, r: 0.7, fill: "currentColor" })
|
|
132
|
+
]), $e = {
|
|
133
|
+
class: "g-dialog-pro-minimized-icon__icon",
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
}, De = { class: "g-dialog-pro-minimized-icon__title" }, Se = /* @__PURE__ */ x({
|
|
86
136
|
name: "GDialogMinimizedIcon",
|
|
87
137
|
__name: "GDialogMinimizedIcon",
|
|
88
138
|
props: {
|
|
@@ -91,71 +141,137 @@ const Ie = {
|
|
|
91
141
|
attentionTick: { default: 0 }
|
|
92
142
|
},
|
|
93
143
|
emits: ["restore"],
|
|
94
|
-
setup(
|
|
95
|
-
const
|
|
144
|
+
setup(l, { emit: m }) {
|
|
145
|
+
const a = l, s = m, p = d(() => a.title || "弹窗"), e = d(() => `恢复 ${p.value}`), i = { opacity: 0, scale: 0.8, x: -24, y: 12 }, u = { opacity: 1, scale: 1, x: 0, y: 0 }, g = { opacity: 0, scale: 0.8, x: -24, y: 12 }, v = { duration: 0.28, ease: [0.2, 0.8, 0.2, 1] }, o = { scale: 1.04, y: -2 }, n = { scale: 0.98 }, B = d(() => ({
|
|
96
146
|
position: "fixed",
|
|
97
|
-
right: `${
|
|
98
|
-
bottom: `${
|
|
99
|
-
})), z =
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
z.value = !0,
|
|
147
|
+
right: `${a.position.right}px`,
|
|
148
|
+
bottom: `${a.position.bottom}px`
|
|
149
|
+
})), z = k(!1);
|
|
150
|
+
let E;
|
|
151
|
+
N(() => a.attentionTick, (A, y) => {
|
|
152
|
+
y === void 0 || A === y || (z.value = !1, window.clearTimeout(E), window.requestAnimationFrame(() => {
|
|
153
|
+
z.value = !0, E = window.setTimeout(() => {
|
|
104
154
|
z.value = !1;
|
|
105
155
|
}, 580);
|
|
106
156
|
}));
|
|
107
|
-
}),
|
|
108
|
-
window.clearTimeout(
|
|
157
|
+
}), oe(() => {
|
|
158
|
+
window.clearTimeout(E);
|
|
109
159
|
});
|
|
110
|
-
function
|
|
160
|
+
function S() {
|
|
111
161
|
s("restore");
|
|
112
162
|
}
|
|
113
|
-
return (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
f("span", Ie, [
|
|
140
|
-
F(G, null, {
|
|
141
|
-
default: g(() => [
|
|
142
|
-
F(C(he))
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
})
|
|
146
|
-
]),
|
|
147
|
-
f("span", Se, M(v.value), 1)
|
|
163
|
+
return (A, y) => (r(), _(ne, { to: "body" }, [
|
|
164
|
+
L(I(ze).div, {
|
|
165
|
+
class: ae(["g-dialog-pro-minimized-icon", { "is-attention": z.value }]),
|
|
166
|
+
type: "button",
|
|
167
|
+
style: ge(B.value),
|
|
168
|
+
title: e.value,
|
|
169
|
+
"aria-label": e.value,
|
|
170
|
+
initial: i,
|
|
171
|
+
animate: u,
|
|
172
|
+
exit: g,
|
|
173
|
+
transition: v,
|
|
174
|
+
"while-hover": o,
|
|
175
|
+
"while-press": n,
|
|
176
|
+
onClick: S
|
|
177
|
+
}, {
|
|
178
|
+
default: T(() => [
|
|
179
|
+
y[0] || (y[0] = c("span", {
|
|
180
|
+
class: "g-dialog-pro-minimized-icon__glow",
|
|
181
|
+
"aria-hidden": "true"
|
|
182
|
+
}, null, -1)),
|
|
183
|
+
y[1] || (y[1] = c("span", {
|
|
184
|
+
class: "g-dialog-pro-minimized-icon__wave",
|
|
185
|
+
"aria-hidden": "true"
|
|
186
|
+
}, null, -1)),
|
|
187
|
+
c("span", $e, [
|
|
188
|
+
L(I(Ee))
|
|
148
189
|
]),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
190
|
+
c("span", De, M(p.value), 1)
|
|
191
|
+
]),
|
|
192
|
+
_: 1,
|
|
193
|
+
__: [0, 1]
|
|
194
|
+
}, 8, ["class", "style", "title", "aria-label"])
|
|
195
|
+
]));
|
|
154
196
|
}
|
|
155
|
-
}),
|
|
156
|
-
|
|
197
|
+
}), j = /* @__PURE__ */ K(Se, [["__scopeId", "data-v-8c4e520e"]]), Ae = ["disabled"], Ge = {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "g-btn__icon g-btn__loading",
|
|
200
|
+
"aria-hidden": "true"
|
|
201
|
+
}, Fe = {
|
|
202
|
+
key: 1,
|
|
203
|
+
class: "g-btn__icon",
|
|
204
|
+
"aria-hidden": "true"
|
|
205
|
+
}, Re = {
|
|
206
|
+
key: 2,
|
|
207
|
+
class: "g-btn__text"
|
|
208
|
+
}, Le = /* @__PURE__ */ x({
|
|
209
|
+
name: "GButton",
|
|
210
|
+
__name: "GButton",
|
|
211
|
+
props: {
|
|
212
|
+
type: { default: "default" },
|
|
213
|
+
icon: {},
|
|
214
|
+
loading: { type: Boolean, default: !1 },
|
|
215
|
+
disabled: { type: Boolean, default: !1 },
|
|
216
|
+
plain: { type: Boolean, default: !1 },
|
|
217
|
+
size: { default: "default" }
|
|
218
|
+
},
|
|
219
|
+
emits: ["click"],
|
|
220
|
+
setup(l, { emit: m }) {
|
|
221
|
+
const a = l, s = m;
|
|
222
|
+
function p(e) {
|
|
223
|
+
a.disabled || a.loading || s("click", e);
|
|
224
|
+
}
|
|
225
|
+
return (e, i) => (r(), b("button", {
|
|
226
|
+
type: "button",
|
|
227
|
+
class: ae(["g-btn", [
|
|
228
|
+
`g-btn--${e.type}`,
|
|
229
|
+
`g-btn--size-${e.size}`,
|
|
230
|
+
{
|
|
231
|
+
"is-plain": e.plain,
|
|
232
|
+
"is-disabled": e.disabled,
|
|
233
|
+
"is-loading": e.loading
|
|
234
|
+
}
|
|
235
|
+
]]),
|
|
236
|
+
disabled: e.disabled || e.loading,
|
|
237
|
+
onClick: p
|
|
238
|
+
}, [
|
|
239
|
+
e.loading ? (r(), b("span", Ge, i[0] || (i[0] = [
|
|
240
|
+
c("svg", {
|
|
241
|
+
viewBox: "0 0 16 16",
|
|
242
|
+
fill: "none",
|
|
243
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
244
|
+
}, [
|
|
245
|
+
c("circle", {
|
|
246
|
+
cx: "8",
|
|
247
|
+
cy: "8",
|
|
248
|
+
r: "6",
|
|
249
|
+
stroke: "currentColor",
|
|
250
|
+
"stroke-width": "1.6",
|
|
251
|
+
"stroke-opacity": "0.25"
|
|
252
|
+
}),
|
|
253
|
+
c("path", {
|
|
254
|
+
d: "M14 8a6 6 0 0 0-6-6",
|
|
255
|
+
stroke: "currentColor",
|
|
256
|
+
"stroke-width": "1.6",
|
|
257
|
+
"stroke-linecap": "round"
|
|
258
|
+
})
|
|
259
|
+
], -1)
|
|
260
|
+
]))) : e.icon ? (r(), b("span", Fe, [
|
|
261
|
+
(r(), _(ve(e.icon)))
|
|
262
|
+
])) : w("", !0),
|
|
263
|
+
e.$slots.default ? (r(), b("span", Re, [
|
|
264
|
+
R(e.$slots, "default", {}, void 0, !0)
|
|
265
|
+
])) : w("", !0)
|
|
266
|
+
], 10, Ae));
|
|
267
|
+
}
|
|
268
|
+
}), O = /* @__PURE__ */ K(Le, [["__scopeId", "data-v-f42a3a2f"]]), Ve = { class: "g-dialog-pro-header" }, Pe = { class: "g-dialog-pro-title" }, He = {
|
|
269
|
+
class: "g-dialog-pro-operation-container",
|
|
157
270
|
"aria-label": "弹窗操作"
|
|
158
|
-
},
|
|
271
|
+
}, Ne = ["aria-label", "title"], We = { class: "g-dialog-pro-body" }, je = {
|
|
272
|
+
key: 0,
|
|
273
|
+
class: "g-dialog-pro-footer"
|
|
274
|
+
}, xe = { class: "g-dialog-pro-actions" }, te = "关闭", Ke = /* @__PURE__ */ x({
|
|
159
275
|
name: "GDialog",
|
|
160
276
|
inheritAttrs: !1,
|
|
161
277
|
__name: "index",
|
|
@@ -176,233 +292,238 @@ const Ie = {
|
|
|
176
292
|
beforeClose: {}
|
|
177
293
|
},
|
|
178
294
|
emits: ["cancel", "reset", "save", "minimize", "action", "update:modelValue"],
|
|
179
|
-
setup(
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
pe(() => {
|
|
186
|
-
t?.register({
|
|
187
|
-
id: n,
|
|
188
|
-
title: l.title,
|
|
295
|
+
setup(l, { emit: m }) {
|
|
296
|
+
const a = l, s = m, p = d(() => a.modelValue), e = J ? J() : `g-dialog-pro-${Date.now()}-${Math.random().toString(36).slice(2)}`, i = Me(), u = k(!1), g = k(!0), v = k(0), o = k(!1), n = k(!1), B = k(!1), z = d(() => i ? i.dialogs.get(e)?.isMinimized ?? !1 : u.value), E = d(() => i ? i.dialogs.get(e)?.attentionTick ?? 0 : v.value), S = d(() => i ? !n.value : g.value), A = d(() => i ? i.getPosition(e).value : { right: 20, bottom: 20 });
|
|
297
|
+
ye(() => {
|
|
298
|
+
i?.register({
|
|
299
|
+
id: e,
|
|
300
|
+
title: a.title,
|
|
189
301
|
isMinimized: !1
|
|
190
|
-
});
|
|
191
|
-
}),
|
|
192
|
-
|
|
193
|
-
}),
|
|
194
|
-
() =>
|
|
195
|
-
(
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
|
|
302
|
+
}), document.addEventListener("keydown", U);
|
|
303
|
+
}), oe(() => {
|
|
304
|
+
i?.unregister(e), document.removeEventListener("keydown", U);
|
|
305
|
+
}), N(
|
|
306
|
+
() => a.title,
|
|
307
|
+
(t) => {
|
|
308
|
+
if (i) {
|
|
309
|
+
const C = i.dialogs.get(e);
|
|
310
|
+
C && (C.title = t);
|
|
199
311
|
}
|
|
200
312
|
}
|
|
201
|
-
),
|
|
202
|
-
() =>
|
|
203
|
-
(
|
|
204
|
-
if (
|
|
205
|
-
if (
|
|
206
|
-
|
|
313
|
+
), N(
|
|
314
|
+
() => a.modelValue,
|
|
315
|
+
(t) => {
|
|
316
|
+
if (t === !1) {
|
|
317
|
+
if (o.value) return;
|
|
318
|
+
i ? (i.restore(e), n.value = !1) : (g.value = !0, u.value = !1);
|
|
207
319
|
}
|
|
208
|
-
|
|
320
|
+
t === !0 && (i?.dialogs.get(e)?.isMinimized ? i.remindMinimized(e) : u.value && (v.value += 1));
|
|
209
321
|
}
|
|
210
322
|
);
|
|
211
|
-
const
|
|
212
|
-
async function
|
|
213
|
-
if (!
|
|
323
|
+
const y = d(() => Object.prototype.hasOwnProperty.call(ee, a.size) ? ee[a.size] : a.size), le = d(() => D.value ? {} : { width: y.value });
|
|
324
|
+
async function $(t) {
|
|
325
|
+
if (!a.beforeClose) return !0;
|
|
214
326
|
try {
|
|
215
|
-
return await
|
|
327
|
+
return await a.beforeClose(t) !== !1;
|
|
216
328
|
} catch {
|
|
217
329
|
return !1;
|
|
218
330
|
}
|
|
219
331
|
}
|
|
220
|
-
async function
|
|
221
|
-
|
|
222
|
-
|
|
332
|
+
async function G() {
|
|
333
|
+
await $("close") && s("update:modelValue", !1);
|
|
334
|
+
}
|
|
335
|
+
function se() {
|
|
336
|
+
G();
|
|
223
337
|
}
|
|
224
|
-
|
|
225
|
-
|
|
338
|
+
function U(t) {
|
|
339
|
+
t.key === "Escape" && (!a.modelValue || !S.value || z.value || (t.stopPropagation(), G()));
|
|
226
340
|
}
|
|
227
|
-
async function
|
|
228
|
-
await
|
|
341
|
+
async function X() {
|
|
342
|
+
await $("cancel") && s("cancel");
|
|
229
343
|
}
|
|
230
|
-
function
|
|
344
|
+
function Y() {
|
|
231
345
|
s("reset");
|
|
232
346
|
}
|
|
233
|
-
async function
|
|
234
|
-
await
|
|
347
|
+
async function Z() {
|
|
348
|
+
await $("save") && s("save");
|
|
235
349
|
}
|
|
236
|
-
const
|
|
237
|
-
async function
|
|
238
|
-
if (await
|
|
350
|
+
const P = ie({});
|
|
351
|
+
async function re(t) {
|
|
352
|
+
if (await $("action") && (s("action", t.key), !!t.onClick))
|
|
239
353
|
try {
|
|
240
|
-
const
|
|
241
|
-
|
|
354
|
+
const C = t.onClick();
|
|
355
|
+
C instanceof Promise && (P[t.key] = !0, await C);
|
|
242
356
|
} finally {
|
|
243
|
-
|
|
357
|
+
P[t.key] = !1;
|
|
244
358
|
}
|
|
245
359
|
}
|
|
246
|
-
const D =
|
|
360
|
+
const D = k(!1), ce = () => {
|
|
247
361
|
D.value = !D.value;
|
|
248
|
-
},
|
|
249
|
-
if (!await
|
|
250
|
-
if (
|
|
251
|
-
|
|
362
|
+
}, q = d(() => D.value ? "退出全屏" : "全屏"), de = async () => {
|
|
363
|
+
if (!await $("minimize")) return;
|
|
364
|
+
if (i ? i.dialogs.get(e)?.isMinimized ?? !1 : u.value) {
|
|
365
|
+
i ? i.minimize(e) : v.value += 1, s("minimize", { id: e });
|
|
252
366
|
return;
|
|
253
367
|
}
|
|
254
|
-
|
|
255
|
-
}, re = () => {
|
|
256
|
-
z.value = !0, i.value = !1, t ? (b.value = !1, t.restore(n)) : (u.value = !0, c.value = !1), s("update:modelValue", !0);
|
|
257
|
-
}, ce = () => {
|
|
258
|
-
i.value && (t ? b.value = !0 : u.value = !1, i.value = !1);
|
|
368
|
+
o.value = !0, i ? i.minimize(e) : u.value = !0, s("update:modelValue", !1), s("minimize", { id: e });
|
|
259
369
|
}, ue = () => {
|
|
260
|
-
|
|
370
|
+
B.value = !0, o.value = !1, i ? (n.value = !1, i.restore(e)) : (g.value = !0, u.value = !1), s("update:modelValue", !0);
|
|
371
|
+
}, fe = () => {
|
|
372
|
+
o.value && (i ? n.value = !0 : g.value = !1, o.value = !1);
|
|
373
|
+
}, me = () => {
|
|
374
|
+
B.value = !1;
|
|
261
375
|
};
|
|
262
|
-
return (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
key:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
onClick: (Re) => le(d)
|
|
330
|
-
}, {
|
|
331
|
-
default: g(() => [
|
|
332
|
-
A(M(d.label), 1)
|
|
333
|
-
]),
|
|
334
|
-
_: 2
|
|
335
|
-
}, 1032, ["type", "icon", "loading", "disabled", "plain", "onClick"]))), 128)) : (m(), Y(Z, { key: 1 }, [
|
|
336
|
-
e.showCancel ? (m(), k(E, {
|
|
337
|
-
key: 0,
|
|
338
|
-
icon: C(ze),
|
|
339
|
-
size: "small",
|
|
340
|
-
onClick: W
|
|
341
|
-
}, {
|
|
342
|
-
default: g(() => [
|
|
343
|
-
A(M(e.cancelText), 1)
|
|
344
|
-
]),
|
|
345
|
-
_: 1
|
|
346
|
-
}, 8, ["icon"])) : I("", !0),
|
|
347
|
-
e.showReset ? (m(), k(E, {
|
|
348
|
-
key: 1,
|
|
349
|
-
icon: C(Te),
|
|
350
|
-
size: "small",
|
|
351
|
-
onClick: x
|
|
352
|
-
}, {
|
|
353
|
-
default: g(() => [
|
|
354
|
-
A(M(e.resetText), 1)
|
|
355
|
-
]),
|
|
356
|
-
_: 1
|
|
357
|
-
}, 8, ["icon"])) : I("", !0),
|
|
358
|
-
e.showSave ? (m(), k(E, {
|
|
359
|
-
key: 2,
|
|
360
|
-
type: "primary",
|
|
361
|
-
icon: C(ke),
|
|
362
|
-
loading: e.saveLoading,
|
|
363
|
-
disabled: e.saveDisabled,
|
|
376
|
+
return (t, C) => (r(), _(ne, { to: "body" }, [
|
|
377
|
+
L(he, {
|
|
378
|
+
name: "g-dialog-pro-fade",
|
|
379
|
+
onAfterEnter: me,
|
|
380
|
+
onAfterLeave: fe
|
|
381
|
+
}, {
|
|
382
|
+
default: T(() => [
|
|
383
|
+
S.value && p.value ? (r(), b("div", {
|
|
384
|
+
key: 0,
|
|
385
|
+
class: "g-dialog-pro-overlay",
|
|
386
|
+
onClick: ke(se, ["self"])
|
|
387
|
+
}, [
|
|
388
|
+
c("div", _e(t.$attrs, {
|
|
389
|
+
class: ["g-dialog-pro", {
|
|
390
|
+
"is-fullscreen": D.value,
|
|
391
|
+
"is-leave-to-minimize": o.value,
|
|
392
|
+
"is-enter-from-minimize": B.value
|
|
393
|
+
}],
|
|
394
|
+
style: le.value,
|
|
395
|
+
role: "dialog",
|
|
396
|
+
"aria-modal": "true"
|
|
397
|
+
}), [
|
|
398
|
+
c("header", Ve, [
|
|
399
|
+
c("p", Pe, M(t.title), 1),
|
|
400
|
+
c("div", He, [
|
|
401
|
+
c("button", {
|
|
402
|
+
type: "button",
|
|
403
|
+
class: "g-dialog-pro-control g-dialog-pro-control--minimize",
|
|
404
|
+
"aria-label": "最小化",
|
|
405
|
+
title: "最小化",
|
|
406
|
+
onClick: de
|
|
407
|
+
}),
|
|
408
|
+
c("button", {
|
|
409
|
+
type: "button",
|
|
410
|
+
class: "g-dialog-pro-control g-dialog-pro-control--fullscreen",
|
|
411
|
+
"aria-label": q.value,
|
|
412
|
+
title: q.value,
|
|
413
|
+
onClick: ce
|
|
414
|
+
}, null, 8, Ne),
|
|
415
|
+
c("button", {
|
|
416
|
+
type: "button",
|
|
417
|
+
class: "g-dialog-pro-control g-dialog-pro-control--close",
|
|
418
|
+
"aria-label": te,
|
|
419
|
+
title: te,
|
|
420
|
+
onClick: G
|
|
421
|
+
})
|
|
422
|
+
])
|
|
423
|
+
]),
|
|
424
|
+
c("div", We, [
|
|
425
|
+
R(t.$slots, "default", {}, void 0, !0)
|
|
426
|
+
]),
|
|
427
|
+
t.hideFooter ? w("", !0) : (r(), b("footer", je, [
|
|
428
|
+
R(t.$slots, "footer", {
|
|
429
|
+
cancel: X,
|
|
430
|
+
reset: Y,
|
|
431
|
+
save: Z,
|
|
432
|
+
close: G,
|
|
433
|
+
loading: t.saveLoading
|
|
434
|
+
}, () => [
|
|
435
|
+
c("div", xe, [
|
|
436
|
+
t.actions && t.actions.length ? (r(!0), b(Q, { key: 0 }, we(t.actions, (h) => (r(), _(O, {
|
|
437
|
+
key: h.key,
|
|
438
|
+
type: h.type,
|
|
439
|
+
icon: h.icon,
|
|
440
|
+
loading: h.loading || P[h.key],
|
|
441
|
+
disabled: h.disabled,
|
|
442
|
+
plain: h.plain,
|
|
364
443
|
size: "small",
|
|
365
|
-
onClick:
|
|
444
|
+
onClick: (Ue) => re(h)
|
|
366
445
|
}, {
|
|
367
|
-
default:
|
|
368
|
-
|
|
446
|
+
default: T(() => [
|
|
447
|
+
F(M(h.label), 1)
|
|
369
448
|
]),
|
|
370
|
-
_:
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
449
|
+
_: 2
|
|
450
|
+
}, 1032, ["type", "icon", "loading", "disabled", "plain", "onClick"]))), 128)) : (r(), b(Q, { key: 1 }, [
|
|
451
|
+
t.showCancel ? (r(), _(O, {
|
|
452
|
+
key: 0,
|
|
453
|
+
icon: I(Ie),
|
|
454
|
+
size: "small",
|
|
455
|
+
onClick: X
|
|
456
|
+
}, {
|
|
457
|
+
default: T(() => [
|
|
458
|
+
F(M(t.cancelText), 1)
|
|
459
|
+
]),
|
|
460
|
+
_: 1
|
|
461
|
+
}, 8, ["icon"])) : w("", !0),
|
|
462
|
+
t.showReset ? (r(), _(O, {
|
|
463
|
+
key: 1,
|
|
464
|
+
icon: I(Oe),
|
|
465
|
+
size: "small",
|
|
466
|
+
onClick: Y
|
|
467
|
+
}, {
|
|
468
|
+
default: T(() => [
|
|
469
|
+
F(M(t.resetText), 1)
|
|
470
|
+
]),
|
|
471
|
+
_: 1
|
|
472
|
+
}, 8, ["icon"])) : w("", !0),
|
|
473
|
+
t.showSave ? (r(), _(O, {
|
|
474
|
+
key: 2,
|
|
475
|
+
type: "primary",
|
|
476
|
+
icon: I(Be),
|
|
477
|
+
loading: t.saveLoading,
|
|
478
|
+
disabled: t.saveDisabled,
|
|
479
|
+
size: "small",
|
|
480
|
+
onClick: Z
|
|
481
|
+
}, {
|
|
482
|
+
default: T(() => [
|
|
483
|
+
F(M(t.saveText), 1)
|
|
484
|
+
]),
|
|
485
|
+
_: 1
|
|
486
|
+
}, 8, ["icon", "loading", "disabled"])) : w("", !0)
|
|
487
|
+
], 64)),
|
|
488
|
+
R(t.$slots, "moreOperations", {}, void 0, !0)
|
|
489
|
+
])
|
|
490
|
+
], !0)
|
|
491
|
+
]))
|
|
492
|
+
], 16)
|
|
493
|
+
])) : w("", !0)
|
|
494
|
+
]),
|
|
495
|
+
_: 3
|
|
496
|
+
}),
|
|
497
|
+
L(I(be), null, {
|
|
498
|
+
default: T(() => [
|
|
499
|
+
z.value ? (r(), _(j, {
|
|
500
|
+
key: 0,
|
|
501
|
+
title: t.title,
|
|
502
|
+
position: A.value,
|
|
503
|
+
"attention-tick": E.value,
|
|
504
|
+
onRestore: ue
|
|
505
|
+
}, null, 8, ["title", "position", "attention-tick"])) : w("", !0)
|
|
506
|
+
]),
|
|
507
|
+
_: 1
|
|
508
|
+
})
|
|
509
|
+
]));
|
|
394
510
|
}
|
|
395
|
-
}),
|
|
396
|
-
|
|
397
|
-
|
|
511
|
+
}), H = /* @__PURE__ */ K(Ke, [["__scopeId", "data-v-d0535e3a"]]);
|
|
512
|
+
H.install = (l) => {
|
|
513
|
+
l.component(H.name, H), l.component(j.name, j), l.component(O.name, O);
|
|
398
514
|
};
|
|
399
515
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
516
|
+
Ee as ChatDotRound,
|
|
517
|
+
Be as CircleCheck,
|
|
518
|
+
Ce as DIALOG_MANAGER_KEY,
|
|
519
|
+
ee as DIALOG_SIZES,
|
|
520
|
+
O as GButton,
|
|
521
|
+
H as GDialog,
|
|
522
|
+
j as GDialogMinimizedIcon,
|
|
523
|
+
W as MINIMIZED_LAYOUT,
|
|
524
|
+
Oe as Refresh,
|
|
525
|
+
Ie as Remove,
|
|
526
|
+
Je as createDialogManager,
|
|
527
|
+
H as default,
|
|
528
|
+
Me as useDialogManager
|
|
408
529
|
};
|