geekin-devtoys 0.3.6 → 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.
Files changed (44) hide show
  1. package/lib/GButton/index.js +1 -0
  2. package/lib/GButton/index.mjs +8 -0
  3. package/lib/GDialog/index.js +1 -1
  4. package/lib/GDialog/index.mjs +351 -300
  5. package/lib/GDialog/style.css +1 -1
  6. package/lib/GInputTreeTag/index.js +1 -1
  7. package/lib/GInputTreeTag/index.mjs +1 -1
  8. package/lib/GInputTreeTag/style.css +1 -1
  9. package/lib/GSteps/index.js +1 -0
  10. package/lib/GSteps/index.mjs +69 -0
  11. package/lib/GSteps/style.css +1 -0
  12. package/lib/GSteps.d.ts +1 -0
  13. package/lib/GTable/index.js +1 -1
  14. package/lib/GTable/index.mjs +106 -79
  15. package/lib/GVideo/index.js +2 -2
  16. package/lib/GVideo/index.mjs +159 -158
  17. package/lib/GVideo/style.css +1 -1
  18. package/lib/components/GButton/index.d.ts +38 -0
  19. package/lib/components/GDialog/const.d.ts +5 -5
  20. package/lib/components/{GDialogPro → GDialog}/icons.d.ts +4 -4
  21. package/lib/components/GDialog/index.d.ts +1 -1
  22. package/lib/components/GInputTreeTag/index.d.ts +25 -17
  23. package/lib/components/GProgress/index.d.ts +1 -1
  24. package/lib/components/GRing/index.d.ts +1 -1
  25. package/lib/components/GScreen/index.d.ts +1 -1
  26. package/lib/components/GSteps/index.d.ts +43 -0
  27. package/lib/index/index.js +1 -1
  28. package/lib/index/index.mjs +40 -36
  29. package/lib/index/style.css +1 -0
  30. package/lib/index-CWxEZ_zc.mjs +74 -0
  31. package/lib/index-Q0Ej8RIj.js +1 -0
  32. package/lib/index.d.ts +3 -2
  33. package/package.json +17 -9
  34. package/lib/GDialog/style2.css +0 -1
  35. package/lib/GDialogPro/index.js +0 -1
  36. package/lib/GDialogPro/index.mjs +0 -529
  37. package/lib/components/GDialogPro/GButton.d.ts +0 -42
  38. package/lib/components/GDialogPro/GDialogMinimizedIcon.d.ts +0 -17
  39. package/lib/components/GDialogPro/const.d.ts +0 -55
  40. package/lib/components/GDialogPro/index.d.ts +0 -147
  41. package/lib/components/GDialogPro/useDialogManager.d.ts +0 -58
  42. package/lib/index-B1MYKy3L.js +0 -1
  43. package/lib/index-Dxw2pU4z.mjs +0 -106
  44. /package/lib/{GDialogPro.d.ts → GButton.d.ts} +0 -0
@@ -1,13 +1,13 @@
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";
3
- import { A as be } from "../AnimatePresence-nl0c23TZ.mjs";
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";
4
3
  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 = {
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 = {
7
7
  small: "380px",
8
8
  medium: "480px",
9
9
  large: "580px"
10
- }, L = {
10
+ }, x = {
11
11
  ICON_WIDTH: 92,
12
12
  ICON_HEIGHT: 34,
13
13
  GAP: 8,
@@ -15,74 +15,113 @@ const Me = /* @__PURE__ */ Symbol("GDialogManager"), q = {
15
15
  RIGHT_OFFSET: 18,
16
16
  MAX_PER_ROW: 8
17
17
  };
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)
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)
25
25
  });
26
- }), p;
26
+ }), h;
27
27
  }
28
- function xe() {
29
- const a = J(/* @__PURE__ */ new Map()), p = r(() => {
30
- const o = [];
31
- return a.forEach((i) => {
32
- i.isMinimized && o.push(i.id);
33
- }), o;
34
- }), l = r(() => Ce(p.value));
35
- function s(o) {
36
- a.set(o.id, { attentionTick: 0, ...o });
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 });
37
37
  }
38
- function v(o) {
39
- a.delete(o);
38
+ function y(i) {
39
+ l.delete(i);
40
40
  }
41
- function h(o) {
42
- const i = a.get(o);
43
- if (i) {
44
- if (i.isMinimized) {
45
- i.attentionTick = (i.attentionTick ?? 0) + 1;
41
+ function a(i) {
42
+ const o = l.get(i);
43
+ if (o) {
44
+ if (o.isMinimized) {
45
+ o.attentionTick = (o.attentionTick ?? 0) + 1;
46
46
  return;
47
47
  }
48
- i.isMinimized = !0;
48
+ o.isMinimized = !0;
49
49
  }
50
50
  }
51
- function n(o) {
52
- const i = a.get(o);
53
- i?.isMinimized && (i.attentionTick = (i.attentionTick ?? 0) + 1);
51
+ function t(i) {
52
+ const o = l.get(i);
53
+ o?.isMinimized && (o.attentionTick = (o.attentionTick ?? 0) + 1);
54
54
  }
55
- function t(o) {
56
- const i = a.get(o);
57
- i && (i.isMinimized = !1);
55
+ function c(i) {
56
+ const o = l.get(i);
57
+ o && (o.isMinimized = !1);
58
58
  }
59
- function c(o) {
59
+ function g(i) {
60
60
  return r(
61
- () => l.value.get(o) ?? {
62
- right: L.RIGHT_OFFSET,
63
- bottom: L.BOTTOM_OFFSET
61
+ () => n.value.get(i) ?? {
62
+ right: x.RIGHT_OFFSET,
63
+ bottom: x.BOTTOM_OFFSET
64
64
  }
65
65
  );
66
66
  }
67
- const u = r(() => p.value.map((o) => a.get(o)).filter(Boolean));
67
+ const p = r(() => h.value.map((i) => l.get(i)).filter(Boolean));
68
68
  return {
69
- dialogs: a,
69
+ dialogs: l,
70
70
  register: s,
71
- unregister: v,
72
- minimize: h,
73
- remindMinimized: n,
74
- restore: t,
75
- getPosition: c,
76
- minimizedList: u
71
+ unregister: y,
72
+ minimize: a,
73
+ remindMinimized: t,
74
+ restore: c,
75
+ getPosition: g,
76
+ minimizedList: p
77
77
  };
78
78
  }
79
79
  function Oe() {
80
- return fe(Me, null);
80
+ return fe(Ce, null);
81
81
  }
82
- const Ie = {
83
- class: "g-dialog-minimized-icon__icon",
82
+ const R = {
83
+ viewBox: "0 0 1024 1024",
84
+ fill: "currentColor",
85
+ xmlns: "http://www.w3.org/2000/svg",
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"
99
+ })
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"
103
+ }),
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
+ })
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"
110
+ }),
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"
113
+ })
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"
117
+ }),
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 = {
122
+ class: "g-dialog-pro-minimized-icon__icon",
84
123
  "aria-hidden": "true"
85
- }, Se = { class: "g-dialog-minimized-icon__title" }, De = /* @__PURE__ */ Q({
124
+ }, Be = { class: "g-dialog-pro-minimized-icon__title" }, Ge = /* @__PURE__ */ te({
86
125
  name: "GDialogMinimizedIcon",
87
126
  __name: "GDialogMinimizedIcon",
88
127
  props: {
@@ -91,71 +130,66 @@ const Ie = {
91
130
  attentionTick: { default: 0 }
92
131
  },
93
132
  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(() => ({
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(() => ({
96
135
  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(() => {
104
- z.value = !1;
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;
105
144
  }, 580);
106
145
  }));
107
- }), ee(() => {
108
- window.clearTimeout(O);
146
+ }), ie(() => {
147
+ window.clearTimeout(S);
109
148
  });
110
- function B() {
149
+ function D() {
111
150
  s("restore");
112
151
  }
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)
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 }]),
155
+ type: "button",
156
+ style: ge(I.value),
157
+ title: a.value,
158
+ "aria-label": a.value,
159
+ initial: t,
160
+ animate: c,
161
+ exit: g,
162
+ transition: p,
163
+ "while-hover": i,
164
+ "while-press": o,
165
+ onClick: D
166
+ }, {
167
+ default: f(() => [
168
+ z[0] || (z[0] = d("span", {
169
+ class: "g-dialog-pro-minimized-icon__glow",
170
+ "aria-hidden": "true"
171
+ }, null, -1)),
172
+ z[1] || (z[1] = d("span", {
173
+ class: "g-dialog-pro-minimized-icon__wave",
174
+ "aria-hidden": "true"
175
+ }, null, -1)),
176
+ d("span", De, [
177
+ w(O(Ae))
148
178
  ]),
149
- _: 1,
150
- __: [0, 1]
151
- }, 8, ["class", "style", "title", "aria-label"])
152
- ]);
153
- };
179
+ d("span", Be, b(y.value), 1)
180
+ ]),
181
+ _: 1,
182
+ __: [0, 1]
183
+ }, 8, ["class", "style", "title", "aria-label"])
184
+ ]));
154
185
  }
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",
186
+ }), W = /* @__PURE__ */ ae(Ge, [["__scopeId", "data-v-e7d8c859"]]), Fe = { class: "g-dialog-pro-header" }, He = { class: "g-dialog-pro-title" }, Le = {
187
+ class: "g-dialog-pro-operation-container",
157
188
  "aria-label": "弹窗操作"
158
- }, Be = ["aria-label", "title"], Ge = ["onClick"], Ve = { class: "g-dialog-footer" }, K = "关闭", Pe = /* @__PURE__ */ Q({
189
+ }, Re = ["aria-label", "title"], Ve = { class: "g-dialog-pro-body" }, Pe = {
190
+ key: 0,
191
+ class: "g-dialog-pro-footer"
192
+ }, $e = { class: "g-dialog-pro-actions" }, Q = "关闭", Ne = /* @__PURE__ */ te({
159
193
  name: "GDialog",
160
194
  inheritAttrs: !1,
161
195
  __name: "index",
@@ -176,233 +210,250 @@ const Ie = {
176
210
  beforeClose: {}
177
211
  },
178
212
  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(() => {
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(() => {
186
216
  t?.register({
187
- id: n,
188
- title: l.title,
217
+ id: a,
218
+ title: n.title,
189
219
  isMinimized: !1
190
- });
191
- }), ee(() => {
192
- t?.unregister(n);
193
- }), $(
194
- () => l.title,
220
+ }), document.addEventListener("keydown", j);
221
+ }), ie(() => {
222
+ t?.unregister(a), document.removeEventListener("keydown", j);
223
+ }), N(
224
+ () => n.title,
195
225
  (e) => {
196
226
  if (t) {
197
- const y = t.dialogs.get(n);
198
- y && (y.title = e);
227
+ const T = t.dialogs.get(a);
228
+ T && (T.title = e);
199
229
  }
200
230
  }
201
- ), $(
202
- () => l.modelValue,
231
+ ), N(
232
+ () => n.modelValue,
203
233
  (e) => {
204
234
  if (e === !1) {
205
235
  if (i.value) return;
206
- t ? (t.restore(n), b.value = !1) : (u.value = !0, c.value = !1);
236
+ t ? (t.restore(a), o.value = !1) : (g.value = !0, c.value = !1);
207
237
  }
208
- e === !0 && (t?.dialogs.get(n)?.isMinimized ? t.remindMinimized(n) : c.value && (o.value += 1));
238
+ e === !0 && (t?.dialogs.get(a)?.isMinimized ? t.remindMinimized(a) : c.value && (p.value += 1));
209
239
  }
210
240
  );
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;
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;
214
244
  try {
215
- return await l.beforeClose(e) !== !1;
245
+ return await n.beforeClose(e) !== !1;
216
246
  } catch {
217
247
  return !1;
218
248
  }
219
249
  }
220
- async function oe(e) {
221
- const y = await w("close");
222
- e(!y);
250
+ async function G() {
251
+ await E("close") && s("update:modelValue", !1);
223
252
  }
224
- async function ne() {
225
- await w("close") && s("update:modelValue", !1);
253
+ function le() {
254
+ G();
226
255
  }
227
- async function W() {
228
- await w("cancel") && s("cancel");
256
+ function j(e) {
257
+ e.key === "Escape" && (!n.modelValue || !D.value || M.value || (e.stopPropagation(), G()));
229
258
  }
230
- function x() {
259
+ async function K() {
260
+ await E("cancel") && s("cancel");
261
+ }
262
+ function U() {
231
263
  s("reset");
232
264
  }
233
- async function U() {
234
- await w("save") && s("save");
265
+ async function X() {
266
+ await E("save") && s("save");
235
267
  }
236
- const V = J({});
237
- async function le(e) {
238
- if (await w("action") && (s("action", e.key), !!e.onClick))
268
+ const V = ee({});
269
+ async function se(e) {
270
+ if (await E("action") && (s("action", e.key), !!e.onClick))
239
271
  try {
240
- const y = e.onClick();
241
- y instanceof Promise && (V[e.key] = !0, await y);
272
+ const T = e.onClick();
273
+ T instanceof Promise && (V[e.key] = !0, await T);
242
274
  } finally {
243
275
  V[e.key] = !1;
244
276
  }
245
277
  }
246
- const D = T(!1), ae = () => {
247
- 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 });
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 });
252
284
  return;
253
285
  }
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);
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);
259
289
  }, ue = () => {
260
- z.value = !1;
290
+ i.value && (t ? o.value = !0 : g.value = !1, i.value = !1);
291
+ }, me = () => {
292
+ I.value = !1;
261
293
  };
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,
294
+ return (e, T) => (m(), k(oe, { to: "body" }, [
295
+ w(he, {
296
+ name: "g-dialog-pro-fade",
297
+ onAfterEnter: me,
298
+ onAfterLeave: ue
299
+ }, {
300
+ default: f(() => [
301
+ D.value && y.value ? (m(), F("div", {
302
+ key: 0,
303
+ class: "g-dialog-pro-overlay",
304
+ onClick: ye(le, ["self"])
305
+ }, [
306
+ d("div", ze(e.$attrs, {
307
+ class: ["g-dialog-pro", {
308
+ "is-fullscreen": A.value,
309
+ "is-leave-to-minimize": i.value,
310
+ "is-enter-from-minimize": I.value
311
+ }],
312
+ style: ne.value,
313
+ role: "dialog",
314
+ "aria-modal": "true"
315
+ }), [
316
+ d("header", Fe, [
317
+ d("p", He, b(e.title), 1),
318
+ d("div", Le, [
319
+ d("button", {
320
+ type: "button",
321
+ class: "g-dialog-pro-control g-dialog-pro-control--minimize",
322
+ "aria-label": "最小化",
323
+ title: "最小化",
324
+ onClick: ce
325
+ }),
326
+ d("button", {
327
+ type: "button",
328
+ class: "g-dialog-pro-control g-dialog-pro-control--fullscreen",
329
+ "aria-label": Y.value,
330
+ title: Y.value,
331
+ onClick: re
332
+ }, null, 8, Re),
333
+ d("button", {
334
+ type: "button",
335
+ class: "g-dialog-pro-control g-dialog-pro-control--close",
336
+ "aria-label": Q,
337
+ title: Q,
338
+ onClick: G
339
+ })
340
+ ])
341
+ ]),
342
+ d("div", Ve, [
343
+ P(e.$slots, "default", {}, void 0, !0)
344
+ ]),
345
+ e.hideFooter ? C("", !0) : (m(), F("footer", Pe, [
346
+ P(e.$slots, "footer", {
347
+ cancel: K,
348
+ reset: U,
349
+ save: X,
350
+ close: G,
351
+ loading: e.saveLoading
352
+ }, () => [
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,
364
360
  size: "small",
365
- onClick: U
366
- }, {
367
- default: g(() => [
368
- A(M(e.saveText), 1)
361
+ onClick: (xe) => se(v)
362
+ }, ke({
363
+ default: f(() => [
364
+ H(" " + b(v.label), 1)
369
365
  ]),
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
- };
366
+ _: 2
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, {
377
+ key: 0,
378
+ size: "small",
379
+ onClick: K
380
+ }, {
381
+ icon: f(() => [
382
+ w(O(Ie))
383
+ ]),
384
+ default: f(() => [
385
+ H(" " + b(e.cancelText), 1)
386
+ ]),
387
+ _: 1
388
+ })) : C("", !0),
389
+ e.showReset ? (m(), k(L, {
390
+ key: 1,
391
+ size: "small",
392
+ onClick: U
393
+ }, {
394
+ icon: f(() => [
395
+ w(O(Se))
396
+ ]),
397
+ default: f(() => [
398
+ H(" " + b(e.resetText), 1)
399
+ ]),
400
+ _: 1
401
+ })) : C("", !0),
402
+ e.showSave ? (m(), k(L, {
403
+ key: 2,
404
+ type: "primary",
405
+ loading: e.saveLoading,
406
+ disabled: e.saveDisabled,
407
+ size: "small",
408
+ onClick: X
409
+ }, {
410
+ icon: f(() => [
411
+ w(O(Ee))
412
+ ]),
413
+ default: f(() => [
414
+ H(" " + b(e.saveText), 1)
415
+ ]),
416
+ _: 1
417
+ }, 8, ["loading", "disabled"])) : C("", !0)
418
+ ], 64)),
419
+ P(e.$slots, "moreOperations", {}, void 0, !0)
420
+ ])
421
+ ], !0)
422
+ ]))
423
+ ], 16)
424
+ ])) : C("", !0)
425
+ ]),
426
+ _: 3
427
+ }),
428
+ w(O(Te), null, {
429
+ default: f(() => [
430
+ M.value ? (m(), k(W, {
431
+ key: 0,
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)
437
+ ]),
438
+ _: 1
439
+ })
440
+ ]));
394
441
  }
395
- }), R = /* @__PURE__ */ ie(Pe, [["__scopeId", "data-v-4a8b52ec"]]);
396
- R.install = (a) => {
397
- a.component(R.name, R), a.component(N.name, N);
442
+ }), $ = /* @__PURE__ */ ae(Ne, [["__scopeId", "data-v-5e0eed3b"]]);
443
+ $.install = (l) => {
444
+ l.component($.name, $), l.component(W.name, W);
398
445
  };
399
446
  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,
447
+ Ae as ChatDotRound,
448
+ Ee as CircleCheck,
449
+ Ce as DIALOG_MANAGER_KEY,
450
+ J as DIALOG_SIZES,
451
+ $ as GDialog,
452
+ W as GDialogMinimizedIcon,
453
+ x as MINIMIZED_LAYOUT,
454
+ Se as Refresh,
455
+ Ie as Remove,
456
+ Ye as createDialogManager,
457
+ $ as default,
407
458
  Oe as useDialogManager
408
459
  };