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