geekin-devtoys 0.3.5 → 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.
@@ -1,13 +1,12 @@
1
- import { inject as fe, reactive as J, computed as r, defineComponent as Q, ref as T, watch as $, onUnmounted as ee, resolveComponent as H, createBlock as k, openBlock as m, Teleport as te, createVNode as F, unref as C, normalizeStyle as me, normalizeClass as ge, withCtx as g, createElementVNode as f, toDisplayString as M, useId as X, onMounted as pe, createCommentVNode as I, mergeProps as ve, createSlots as _e, renderSlot as P, createElementBlock as Y, Fragment as Z, renderList as ye, createTextVNode as A } from "vue";
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 we } from "../index-Bbr5fWvI.mjs";
5
- import { _ as ie } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
6
- const Me = /* @__PURE__ */ Symbol("GDialogManager"), q = {
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
- }, L = {
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 Ce(a) {
19
- const p = /* @__PURE__ */ new Map(), { ICON_WIDTH: l, ICON_HEIGHT: s, GAP: v, BOTTOM_OFFSET: h, RIGHT_OFFSET: n, MAX_PER_ROW: t } = L;
20
- return a.forEach((c, u) => {
21
- const o = Math.floor(u / t), i = u % t;
22
- p.set(c, {
23
- right: n + i * (l + v),
24
- bottom: h + o * (s + v)
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
- }), p;
25
+ }), m;
27
26
  }
28
- function xe() {
29
- const a = J(/* @__PURE__ */ new Map()), p = r(() => {
27
+ function Je() {
28
+ const l = ie(/* @__PURE__ */ new Map()), m = d(() => {
30
29
  const o = [];
31
- return a.forEach((i) => {
32
- i.isMinimized && o.push(i.id);
30
+ return l.forEach((n) => {
31
+ n.isMinimized && o.push(n.id);
33
32
  }), o;
34
- }), l = r(() => Ce(p.value));
33
+ }), a = d(() => Te(m.value));
35
34
  function s(o) {
36
- a.set(o.id, { attentionTick: 0, ...o });
35
+ l.set(o.id, { attentionTick: 0, ...o });
37
36
  }
38
- function v(o) {
39
- a.delete(o);
37
+ function p(o) {
38
+ l.delete(o);
40
39
  }
41
- function h(o) {
42
- const i = a.get(o);
43
- if (i) {
44
- if (i.isMinimized) {
45
- i.attentionTick = (i.attentionTick ?? 0) + 1;
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
- i.isMinimized = !0;
47
+ n.isMinimized = !0;
49
48
  }
50
49
  }
51
- function n(o) {
52
- const i = a.get(o);
53
- i?.isMinimized && (i.attentionTick = (i.attentionTick ?? 0) + 1);
50
+ function i(o) {
51
+ const n = l.get(o);
52
+ n?.isMinimized && (n.attentionTick = (n.attentionTick ?? 0) + 1);
54
53
  }
55
- function t(o) {
56
- const i = a.get(o);
57
- i && (i.isMinimized = !1);
54
+ function u(o) {
55
+ const n = l.get(o);
56
+ n && (n.isMinimized = !1);
58
57
  }
59
- function c(o) {
60
- return r(
61
- () => l.value.get(o) ?? {
62
- right: L.RIGHT_OFFSET,
63
- bottom: L.BOTTOM_OFFSET
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 u = r(() => p.value.map((o) => a.get(o)).filter(Boolean));
66
+ const v = d(() => m.value.map((o) => l.get(o)).filter(Boolean));
68
67
  return {
69
- dialogs: a,
68
+ dialogs: l,
70
69
  register: s,
71
- unregister: v,
72
- minimize: h,
73
- remindMinimized: n,
74
- restore: t,
75
- getPosition: c,
76
- minimizedList: u
70
+ unregister: p,
71
+ minimize: e,
72
+ remindMinimized: i,
73
+ restore: u,
74
+ getPosition: g,
75
+ minimizedList: v
77
76
  };
78
77
  }
79
- function Oe() {
80
- return fe(Me, null);
78
+ function Me() {
79
+ return pe(Ce, null);
81
80
  }
82
- const Ie = {
83
- class: "g-dialog-minimized-icon__icon",
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
- }, Se = { class: "g-dialog-minimized-icon__title" }, De = /* @__PURE__ */ Q({
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(a, { emit: p }) {
95
- const l = a, s = p, v = r(() => l.title || "弹窗"), h = r(() => `恢复 ${v.value}`), n = { opacity: 0, scale: 0.8, x: -24, y: 12 }, t = { opacity: 1, scale: 1, x: 0, y: 0 }, c = { opacity: 0, scale: 0.8, x: -24, y: 12 }, u = { duration: 0.28, ease: [0.2, 0.8, 0.2, 1] }, o = { scale: 1.04, y: -2 }, i = { scale: 0.98 }, b = r(() => ({
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: `${l.position.right}px`,
98
- bottom: `${l.position.bottom}px`
99
- })), z = T(!1);
100
- let O;
101
- $(() => l.attentionTick, (S, _) => {
102
- _ === void 0 || S === _ || (z.value = !1, window.clearTimeout(O), window.requestAnimationFrame(() => {
103
- z.value = !0, O = window.setTimeout(() => {
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
- }), ee(() => {
108
- window.clearTimeout(O);
157
+ }), oe(() => {
158
+ window.clearTimeout(E);
109
159
  });
110
- function B() {
160
+ function S() {
111
161
  s("restore");
112
162
  }
113
- return (S, _) => {
114
- const G = H("el-icon");
115
- return m(), k(te, { to: "body" }, [
116
- F(C(we).div, {
117
- class: ge(["g-dialog-minimized-icon", { "is-attention": z.value }]),
118
- type: "button",
119
- style: me(b.value),
120
- title: h.value,
121
- "aria-label": h.value,
122
- initial: n,
123
- animate: t,
124
- exit: c,
125
- transition: u,
126
- "while-hover": o,
127
- "while-press": i,
128
- onClick: B
129
- }, {
130
- default: g(() => [
131
- _[0] || (_[0] = f("span", {
132
- class: "g-dialog-minimized-icon__glow",
133
- "aria-hidden": "true"
134
- }, null, -1)),
135
- _[1] || (_[1] = f("span", {
136
- class: "g-dialog-minimized-icon__wave",
137
- "aria-hidden": "true"
138
- }, null, -1)),
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
- _: 1,
150
- __: [0, 1]
151
- }, 8, ["class", "style", "title", "aria-label"])
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
- }), N = /* @__PURE__ */ ie(De, [["__scopeId", "data-v-5ff0a7c2"]]), Ee = { class: "g-dialog-header" }, Ae = { class: "g-dialog-title" }, Fe = {
156
- class: "g-dialog-operation-container",
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
- }, Be = ["aria-label", "title"], Ge = ["onClick"], Ve = { class: "g-dialog-footer" }, K = "关闭", Pe = /* @__PURE__ */ Q({
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(a, { emit: p }) {
180
- const l = a, s = p, v = r(() => l.modelValue);
181
- function h(e) {
182
- s("update:modelValue", e);
183
- }
184
- const n = X ? X() : `g-dialog-${Date.now()}-${Math.random().toString(36).slice(2)}`, t = Oe(), c = T(!1), u = T(!0), o = T(0), i = T(!1), b = T(!1), z = T(!1), O = r(() => t ? t.dialogs.get(n)?.isMinimized ?? !1 : c.value), B = r(() => t ? t.dialogs.get(n)?.attentionTick ?? 0 : o.value), S = r(() => t ? !b.value : u.value), _ = r(() => t ? t.getPosition(n).value : { right: 20, bottom: 20 });
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
- }), ee(() => {
192
- t?.unregister(n);
193
- }), $(
194
- () => l.title,
195
- (e) => {
196
- if (t) {
197
- const y = t.dialogs.get(n);
198
- y && (y.title = e);
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
- () => l.modelValue,
203
- (e) => {
204
- if (e === !1) {
205
- if (i.value) return;
206
- t ? (t.restore(n), b.value = !1) : (u.value = !0, c.value = !1);
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
- e === !0 && (t?.dialogs.get(n)?.isMinimized ? t.remindMinimized(n) : c.value && (o.value += 1));
320
+ t === !0 && (i?.dialogs.get(e)?.isMinimized ? i.remindMinimized(e) : u.value && (v.value += 1));
209
321
  }
210
322
  );
211
- const G = r(() => Object.prototype.hasOwnProperty.call(q, l.size) ? q[l.size] : l.size);
212
- async function w(e) {
213
- if (!l.beforeClose) return !0;
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 l.beforeClose(e) !== !1;
327
+ return await a.beforeClose(t) !== !1;
216
328
  } catch {
217
329
  return !1;
218
330
  }
219
331
  }
220
- async function oe(e) {
221
- const y = await w("close");
222
- e(!y);
332
+ async function G() {
333
+ await $("close") && s("update:modelValue", !1);
334
+ }
335
+ function se() {
336
+ G();
223
337
  }
224
- async function ne() {
225
- await w("close") && s("update:modelValue", !1);
338
+ function U(t) {
339
+ t.key === "Escape" && (!a.modelValue || !S.value || z.value || (t.stopPropagation(), G()));
226
340
  }
227
- async function W() {
228
- await w("cancel") && s("cancel");
341
+ async function X() {
342
+ await $("cancel") && s("cancel");
229
343
  }
230
- function x() {
344
+ function Y() {
231
345
  s("reset");
232
346
  }
233
- async function U() {
234
- await w("save") && s("save");
347
+ async function Z() {
348
+ await $("save") && s("save");
235
349
  }
236
- const V = J({});
237
- async function le(e) {
238
- if (await w("action") && (s("action", e.key), !!e.onClick))
350
+ const P = ie({});
351
+ async function re(t) {
352
+ if (await $("action") && (s("action", t.key), !!t.onClick))
239
353
  try {
240
- const y = e.onClick();
241
- y instanceof Promise && (V[e.key] = !0, await y);
354
+ const C = t.onClick();
355
+ C instanceof Promise && (P[t.key] = !0, await C);
242
356
  } finally {
243
- V[e.key] = !1;
357
+ P[t.key] = !1;
244
358
  }
245
359
  }
246
- const D = T(!1), ae = () => {
360
+ const D = k(!1), ce = () => {
247
361
  D.value = !D.value;
248
- }, j = r(() => D.value ? "退出全屏" : "全屏"), se = async () => {
249
- if (!await w("minimize")) return;
250
- if (t ? t.dialogs.get(n)?.isMinimized ?? !1 : c.value) {
251
- t ? t.minimize(n) : o.value += 1, s("minimize", { id: n });
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
- i.value = !0, t ? t.minimize(n) : c.value = !0, s("update:modelValue", !1), s("minimize", { id: n });
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
- z.value = !1;
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 (e, y) => {
263
- const E = H("el-button"), de = H("el-dialog");
264
- return m(), k(te, { to: "body" }, [
265
- S.value ? (m(), k(de, ve({ key: 0 }, e.$attrs, {
266
- "model-value": v.value,
267
- width: G.value,
268
- "lock-scroll": !1,
269
- "show-close": !1,
270
- fullscreen: D.value,
271
- "before-close": oe,
272
- class: ["g-dialog", { "is-leave-to-minimize": i.value, "is-enter-from-minimize": z.value }],
273
- "onUpdate:modelValue": h,
274
- onClosed: ce,
275
- onOpened: ue
276
- }), _e({
277
- header: g(({ close: d }) => [
278
- f("div", Ee, [
279
- f("p", Ae, M(e.title), 1),
280
- f("div", Fe, [
281
- f("button", {
282
- type: "button",
283
- class: "g-dialog-control g-dialog-control--minimize",
284
- "aria-label": "最小化",
285
- title: "最小化",
286
- onClick: se
287
- }),
288
- f("button", {
289
- type: "button",
290
- class: "g-dialog-control g-dialog-control--fullscreen",
291
- "aria-label": j.value,
292
- title: j.value,
293
- onClick: ae
294
- }, null, 8, Be),
295
- f("button", {
296
- type: "button",
297
- class: "g-dialog-control g-dialog-control--close",
298
- "aria-label": K,
299
- title: K,
300
- onClick: d
301
- }, null, 8, Ge)
302
- ])
303
- ])
304
- ]),
305
- default: g(() => [
306
- P(e.$slots, "default", {}, void 0, !0)
307
- ]),
308
- _: 2
309
- }, [
310
- e.hideFooter ? void 0 : {
311
- name: "footer",
312
- fn: g(() => [
313
- P(e.$slots, "footer", {
314
- cancel: W,
315
- reset: x,
316
- save: U,
317
- close: ne,
318
- loading: e.saveLoading
319
- }, () => [
320
- f("div", Ve, [
321
- e.actions && e.actions.length ? (m(!0), Y(Z, { key: 0 }, ye(e.actions, (d) => (m(), k(E, {
322
- key: d.key,
323
- type: d.type,
324
- icon: d.icon,
325
- loading: d.loading || V[d.key],
326
- disabled: d.disabled,
327
- plain: d.plain,
328
- size: "small",
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: U
444
+ onClick: (Ue) => re(h)
366
445
  }, {
367
- default: g(() => [
368
- A(M(e.saveText), 1)
446
+ default: T(() => [
447
+ F(M(h.label), 1)
369
448
  ]),
370
- _: 1
371
- }, 8, ["icon", "loading", "disabled"])) : I("", !0)
372
- ], 64)),
373
- P(e.$slots, "moreOperations", {}, void 0, !0)
374
- ])
375
- ], !0)
376
- ]),
377
- key: "0"
378
- }
379
- ]), 1040, ["model-value", "width", "fullscreen", "class"])) : I("", !0),
380
- F(C(be), null, {
381
- default: g(() => [
382
- O.value ? (m(), k(N, {
383
- key: 0,
384
- title: e.title,
385
- position: _.value,
386
- "attention-tick": B.value,
387
- onRestore: re
388
- }, null, 8, ["title", "position", "attention-tick"])) : I("", !0)
389
- ]),
390
- _: 1
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
- }), R = /* @__PURE__ */ ie(Pe, [["__scopeId", "data-v-4a8b52ec"]]);
396
- R.install = (a) => {
397
- a.component(R.name, R), a.component(N.name, N);
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
- Me as DIALOG_MANAGER_KEY,
401
- q as DIALOG_SIZES,
402
- R as GDialog,
403
- N as GDialogMinimizedIcon,
404
- L as MINIMIZED_LAYOUT,
405
- xe as createDialogManager,
406
- R as default,
407
- Oe as useDialogManager
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
  };