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