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.
@@ -1,12 +1,13 @@
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";
2
- import { A as be } from "../AnimatePresence-nl0c23TZ.mjs";
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 = {
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
- }, W = {
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 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)
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
- }), m;
26
+ }), h;
26
27
  }
27
- function Je() {
28
- const l = ie(/* @__PURE__ */ new Map()), m = d(() => {
29
- const o = [];
30
- return l.forEach((n) => {
31
- n.isMinimized && o.push(n.id);
32
- }), o;
33
- }), a = d(() => Te(m.value));
34
- function s(o) {
35
- l.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 });
36
37
  }
37
- function p(o) {
38
- l.delete(o);
38
+ function y(i) {
39
+ l.delete(i);
39
40
  }
40
- function e(o) {
41
- const n = l.get(o);
42
- if (n) {
43
- if (n.isMinimized) {
44
- n.attentionTick = (n.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;
45
46
  return;
46
47
  }
47
- n.isMinimized = !0;
48
+ o.isMinimized = !0;
48
49
  }
49
50
  }
50
- function i(o) {
51
- const n = l.get(o);
52
- n?.isMinimized && (n.attentionTick = (n.attentionTick ?? 0) + 1);
51
+ function t(i) {
52
+ const o = l.get(i);
53
+ o?.isMinimized && (o.attentionTick = (o.attentionTick ?? 0) + 1);
53
54
  }
54
- function u(o) {
55
- const n = l.get(o);
56
- n && (n.isMinimized = !1);
55
+ function c(i) {
56
+ const o = l.get(i);
57
+ o && (o.isMinimized = !1);
57
58
  }
58
- function g(o) {
59
- return d(
60
- () => a.value.get(o) ?? {
61
- right: W.RIGHT_OFFSET,
62
- bottom: W.BOTTOM_OFFSET
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 v = d(() => m.value.map((o) => l.get(o)).filter(Boolean));
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: p,
71
- minimize: e,
72
- remindMinimized: i,
73
- restore: u,
71
+ unregister: y,
72
+ minimize: a,
73
+ remindMinimized: t,
74
+ restore: c,
74
75
  getPosition: g,
75
- minimizedList: v
76
+ minimizedList: p
76
77
  };
77
78
  }
78
- function Me() {
79
- return pe(Ce, null);
79
+ function Oe() {
80
+ return fe(Ce, null);
80
81
  }
81
- const V = {
82
- viewBox: "0 0 16 16",
83
- fill: "none",
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
- }, Ie = () => f("svg", V, [
87
- f("path", {
88
- d: "M3.5 8h9",
89
- stroke: "currentColor",
90
- "stroke-width": 1.6,
91
- "stroke-linecap": "round"
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
- ]), 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"
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
- f("path", {
101
- d: "M13.5 2v3.5H10",
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
- ]), Be = () => f("svg", V, [
108
- f("circle", {
109
- cx: 8,
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
- 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"
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
- ]), 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"
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
- 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 = {
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
- }, De = { class: "g-dialog-pro-minimized-icon__title" }, Se = /* @__PURE__ */ x({
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: 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(() => ({
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: `${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(() => {
154
- 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;
155
144
  }, 580);
156
145
  }));
157
- }), oe(() => {
158
- window.clearTimeout(E);
146
+ }), ie(() => {
147
+ window.clearTimeout(S);
159
148
  });
160
- function S() {
149
+ function D() {
161
150
  s("restore");
162
151
  }
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 }]),
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(B.value),
168
- title: e.value,
169
- "aria-label": e.value,
170
- initial: i,
171
- animate: u,
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: v,
174
- "while-hover": o,
175
- "while-press": n,
176
- onClick: S
162
+ transition: p,
163
+ "while-hover": i,
164
+ "while-press": o,
165
+ onClick: D
177
166
  }, {
178
- default: T(() => [
179
- y[0] || (y[0] = c("span", {
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
- y[1] || (y[1] = c("span", {
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
- c("span", $e, [
188
- L(I(Ee))
176
+ d("span", De, [
177
+ w(O(Ae))
189
178
  ]),
190
- c("span", De, M(p.value), 1)
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
- }), 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 = {
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
- }, Ne = ["aria-label", "title"], We = { class: "g-dialog-pro-body" }, je = {
189
+ }, Re = ["aria-label", "title"], Ve = { class: "g-dialog-pro-body" }, Pe = {
272
190
  key: 0,
273
191
  class: "g-dialog-pro-footer"
274
- }, xe = { class: "g-dialog-pro-actions" }, te = "关闭", Ke = /* @__PURE__ */ x({
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: 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,
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", U);
303
- }), oe(() => {
304
- i?.unregister(e), document.removeEventListener("keydown", U);
220
+ }), document.addEventListener("keydown", j);
221
+ }), ie(() => {
222
+ t?.unregister(a), document.removeEventListener("keydown", j);
305
223
  }), N(
306
- () => a.title,
307
- (t) => {
308
- if (i) {
309
- const C = i.dialogs.get(e);
310
- C && (C.title = t);
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
- () => 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);
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
- t === !0 && (i?.dialogs.get(e)?.isMinimized ? i.remindMinimized(e) : u.value && (v.value += 1));
238
+ e === !0 && (t?.dialogs.get(a)?.isMinimized ? t.remindMinimized(a) : c.value && (p.value += 1));
321
239
  }
322
240
  );
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;
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 a.beforeClose(t) !== !1;
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 $("close") && s("update:modelValue", !1);
251
+ await E("close") && s("update:modelValue", !1);
334
252
  }
335
- function se() {
253
+ function le() {
336
254
  G();
337
255
  }
338
- function U(t) {
339
- t.key === "Escape" && (!a.modelValue || !S.value || z.value || (t.stopPropagation(), G()));
256
+ function j(e) {
257
+ e.key === "Escape" && (!n.modelValue || !D.value || M.value || (e.stopPropagation(), G()));
340
258
  }
341
- async function X() {
342
- await $("cancel") && s("cancel");
259
+ async function K() {
260
+ await E("cancel") && s("cancel");
343
261
  }
344
- function Y() {
262
+ function U() {
345
263
  s("reset");
346
264
  }
347
- async function Z() {
348
- await $("save") && s("save");
265
+ async function X() {
266
+ await E("save") && s("save");
349
267
  }
350
- const P = ie({});
351
- async function re(t) {
352
- if (await $("action") && (s("action", t.key), !!t.onClick))
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 C = t.onClick();
355
- C instanceof Promise && (P[t.key] = !0, await C);
272
+ const T = e.onClick();
273
+ T instanceof Promise && (V[e.key] = !0, await T);
356
274
  } finally {
357
- P[t.key] = !1;
275
+ V[e.key] = !1;
358
276
  }
359
277
  }
360
- const D = k(!1), ce = () => {
361
- D.value = !D.value;
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 });
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
- o.value = !0, i ? i.minimize(e) : u.value = !0, s("update:modelValue", !1), s("minimize", { id: e });
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
- 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);
290
+ i.value && (t ? o.value = !0 : g.value = !1, i.value = !1);
373
291
  }, me = () => {
374
- B.value = !1;
292
+ I.value = !1;
375
293
  };
376
- return (t, C) => (r(), _(ne, { to: "body" }, [
377
- L(he, {
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: fe
298
+ onAfterLeave: ue
381
299
  }, {
382
- default: T(() => [
383
- S.value && p.value ? (r(), b("div", {
300
+ default: f(() => [
301
+ D.value && y.value ? (m(), F("div", {
384
302
  key: 0,
385
303
  class: "g-dialog-pro-overlay",
386
- onClick: ke(se, ["self"])
304
+ onClick: ye(le, ["self"])
387
305
  }, [
388
- c("div", _e(t.$attrs, {
306
+ d("div", ze(e.$attrs, {
389
307
  class: ["g-dialog-pro", {
390
- "is-fullscreen": D.value,
391
- "is-leave-to-minimize": o.value,
392
- "is-enter-from-minimize": B.value
308
+ "is-fullscreen": A.value,
309
+ "is-leave-to-minimize": i.value,
310
+ "is-enter-from-minimize": I.value
393
311
  }],
394
- style: le.value,
312
+ style: ne.value,
395
313
  role: "dialog",
396
314
  "aria-modal": "true"
397
315
  }), [
398
- c("header", Ve, [
399
- c("p", Pe, M(t.title), 1),
400
- c("div", He, [
401
- c("button", {
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: de
324
+ onClick: ce
407
325
  }),
408
- c("button", {
326
+ d("button", {
409
327
  type: "button",
410
328
  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", {
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": te,
419
- title: te,
336
+ "aria-label": Q,
337
+ title: Q,
420
338
  onClick: G
421
339
  })
422
340
  ])
423
341
  ]),
424
- c("div", We, [
425
- R(t.$slots, "default", {}, void 0, !0)
342
+ d("div", Ve, [
343
+ P(e.$slots, "default", {}, void 0, !0)
426
344
  ]),
427
- t.hideFooter ? w("", !0) : (r(), b("footer", je, [
428
- R(t.$slots, "footer", {
429
- cancel: X,
430
- reset: Y,
431
- save: Z,
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: t.saveLoading
351
+ loading: e.saveLoading
434
352
  }, () => [
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,
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: (Ue) => re(h)
445
- }, {
446
- default: T(() => [
447
- F(M(h.label), 1)
361
+ onClick: (xe) => se(v)
362
+ }, ke({
363
+ default: f(() => [
364
+ H(" " + b(v.label), 1)
448
365
  ]),
449
366
  _: 2
450
- }, 1032, ["type", "icon", "loading", "disabled", "plain", "onClick"]))), 128)) : (r(), b(Q, { key: 1 }, [
451
- t.showCancel ? (r(), _(O, {
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: X
379
+ onClick: K
456
380
  }, {
457
- default: T(() => [
458
- F(M(t.cancelText), 1)
381
+ icon: f(() => [
382
+ w(O(Ie))
383
+ ]),
384
+ default: f(() => [
385
+ H(" " + b(e.cancelText), 1)
459
386
  ]),
460
387
  _: 1
461
- }, 8, ["icon"])) : w("", !0),
462
- t.showReset ? (r(), _(O, {
388
+ })) : C("", !0),
389
+ e.showReset ? (m(), k(L, {
463
390
  key: 1,
464
- icon: I(Oe),
465
391
  size: "small",
466
- onClick: Y
392
+ onClick: U
467
393
  }, {
468
- default: T(() => [
469
- F(M(t.resetText), 1)
394
+ icon: f(() => [
395
+ w(O(Se))
396
+ ]),
397
+ default: f(() => [
398
+ H(" " + b(e.resetText), 1)
470
399
  ]),
471
400
  _: 1
472
- }, 8, ["icon"])) : w("", !0),
473
- t.showSave ? (r(), _(O, {
401
+ })) : C("", !0),
402
+ e.showSave ? (m(), k(L, {
474
403
  key: 2,
475
404
  type: "primary",
476
- icon: I(Be),
477
- loading: t.saveLoading,
478
- disabled: t.saveDisabled,
405
+ loading: e.saveLoading,
406
+ disabled: e.saveDisabled,
479
407
  size: "small",
480
- onClick: Z
408
+ onClick: X
481
409
  }, {
482
- default: T(() => [
483
- F(M(t.saveText), 1)
410
+ icon: f(() => [
411
+ w(O(Ee))
412
+ ]),
413
+ default: f(() => [
414
+ H(" " + b(e.saveText), 1)
484
415
  ]),
485
416
  _: 1
486
- }, 8, ["icon", "loading", "disabled"])) : w("", !0)
417
+ }, 8, ["loading", "disabled"])) : C("", !0)
487
418
  ], 64)),
488
- R(t.$slots, "moreOperations", {}, void 0, !0)
419
+ P(e.$slots, "moreOperations", {}, void 0, !0)
489
420
  ])
490
421
  ], !0)
491
422
  ]))
492
423
  ], 16)
493
- ])) : w("", !0)
424
+ ])) : C("", !0)
494
425
  ]),
495
426
  _: 3
496
427
  }),
497
- L(I(be), null, {
498
- default: T(() => [
499
- z.value ? (r(), _(j, {
428
+ w(O(Te), null, {
429
+ default: f(() => [
430
+ M.value ? (m(), k(W, {
500
431
  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)
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
- }), 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);
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
- Ee as ChatDotRound,
517
- Be as CircleCheck,
447
+ Ae as ChatDotRound,
448
+ Ee as CircleCheck,
518
449
  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,
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
- Je as createDialogManager,
527
- H as default,
528
- Me as useDialogManager
456
+ Ye as createDialogManager,
457
+ $ as default,
458
+ Oe as useDialogManager
529
459
  };