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