@gradient-ui/core 0.2.1 → 0.4.1

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 (183) hide show
  1. package/README.md +58 -2
  2. package/dist/GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs +1 -0
  3. package/dist/GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js +466 -0
  4. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs +1 -0
  5. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js +7015 -0
  6. package/dist/{default-585QCoXx.js → camelToKebabCase-6qY6WHvl.js} +987 -1194
  7. package/dist/camelToKebabCase-BQDotaQm.cjs +316 -0
  8. package/dist/components.cjs +1 -1
  9. package/dist/components.mjs +55 -51
  10. package/dist/default-BhuY-A3o.cjs +4 -0
  11. package/dist/default-OTmCd0Aq.js +131 -0
  12. package/dist/directives.cjs +1 -1
  13. package/dist/directives.mjs +6 -5
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.mjs +184 -110
  16. package/dist/mask-BbofdFd4.cjs +1 -0
  17. package/dist/mask-CZX-I_iy.js +936 -0
  18. package/dist/material-Ca7ZZAiO.cjs +194 -0
  19. package/dist/material-okvXHenb.js +1162 -0
  20. package/dist/materialSurface-BBrP9ltj.js +591 -0
  21. package/dist/materialSurface-CK8LN_dU.cjs +1 -0
  22. package/dist/services.cjs +1 -1
  23. package/dist/services.mjs +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/surface-8z3gR7vF.cjs +1 -0
  26. package/dist/surface-BKu4KfkY.js +288 -0
  27. package/dist/theme.cjs +1 -1
  28. package/dist/theme.mjs +55 -9
  29. package/dist/types/components/index.d.ts +5 -1
  30. package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +1 -1
  31. package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +675 -9
  32. package/dist/types/components/ui/GAlert/types.d.ts +352 -4
  33. package/dist/types/components/ui/GAside/GAside.vue.d.ts +7 -5
  34. package/dist/types/components/ui/GAside/types.d.ts +17 -6
  35. package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +679 -13
  36. package/dist/types/components/ui/GBadge/types.d.ts +350 -3
  37. package/dist/types/components/ui/GButton/GButton.vue.d.ts +357 -27
  38. package/dist/types/components/ui/GButton/types.d.ts +230 -49
  39. package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +24 -24
  40. package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +24 -24
  41. package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +24 -24
  42. package/dist/types/components/ui/GChip/GChip.vue.d.ts +295 -25
  43. package/dist/types/components/ui/GChip/types.d.ts +188 -43
  44. package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +1 -1
  45. package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +47 -13
  46. package/dist/types/components/ui/GExpansion/types.d.ts +284 -22
  47. package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +220 -7
  48. package/dist/types/components/ui/GFAB/types.d.ts +122 -3
  49. package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +15 -15
  50. package/dist/types/components/ui/GFieldBase/props.d.ts +10 -10
  51. package/dist/types/components/ui/GForm/GForm.vue.d.ts +156 -0
  52. package/dist/types/components/ui/GForm/index.d.ts +2 -0
  53. package/dist/types/components/ui/GForm/types.d.ts +107 -0
  54. package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +165 -66
  55. package/dist/types/components/ui/GGradient/GGradientBorderLayer.vue.d.ts +11 -0
  56. package/dist/types/components/ui/GGradient/index.d.ts +1 -0
  57. package/dist/types/components/ui/GGradient/types.d.ts +10 -1
  58. package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +257 -0
  59. package/dist/types/components/ui/GGradientMaterial/index.d.ts +2 -0
  60. package/dist/types/components/ui/GGradientMaterial/types.d.ts +140 -0
  61. package/dist/types/components/ui/GInput/GInput.vue.d.ts +15 -15
  62. package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +5 -5
  63. package/dist/types/components/ui/GLoading/types.d.ts +3 -2
  64. package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +14 -14
  65. package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +11 -11
  66. package/dist/types/components/ui/GMenuItem/types.d.ts +4 -4
  67. package/dist/types/components/ui/GModal/GModal.vue.d.ts +1 -1
  68. package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +7 -5
  69. package/dist/types/components/ui/GNavList/types.d.ts +17 -6
  70. package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +4 -4
  71. package/dist/types/components/ui/GNavbar/GNavbarItem.vue.d.ts +3 -3
  72. package/dist/types/components/ui/GNavbar/GNavbarMenu.vue.d.ts +3 -3
  73. package/dist/types/components/ui/GNavbar/types.d.ts +6 -6
  74. package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +41 -20
  75. package/dist/types/components/ui/GProgress/types.d.ts +23 -10
  76. package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +1 -1
  77. package/dist/types/components/ui/GSelectItem.vue.d.ts +5 -3
  78. package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +681 -15
  79. package/dist/types/components/ui/GSnackbar/types.d.ts +350 -3
  80. package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +2 -2
  81. package/dist/types/components/ui/GSquircle/types.d.ts +8 -2
  82. package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +24 -24
  83. package/dist/types/components/ui/GTable/GTable.vue.d.ts +191 -0
  84. package/dist/types/components/ui/GTable/GTableBody.vue.d.ts +69 -0
  85. package/dist/types/components/ui/GTable/GTableCell.vue.d.ts +35 -0
  86. package/dist/types/components/ui/GTable/GTableExpandedRow.vue.d.ts +25 -0
  87. package/dist/types/components/ui/GTable/GTableHead.vue.d.ts +30 -0
  88. package/dist/types/components/ui/GTable/GTableRow.vue.d.ts +40 -0
  89. package/dist/types/components/ui/GTable/context.d.ts +25 -0
  90. package/dist/types/components/ui/GTable/index.d.ts +3 -0
  91. package/dist/types/components/ui/GTable/types.d.ts +666 -0
  92. package/dist/types/components/ui/GTable/useTable.d.ts +22 -0
  93. package/dist/types/components/ui/GTable/useTableExpansion.d.ts +17 -0
  94. package/dist/types/components/ui/GTable/useTableSpans.d.ts +12 -0
  95. package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +4 -4
  96. package/dist/types/components/ui/GTabs/types.d.ts +6 -6
  97. package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +15 -15
  98. package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +490 -16
  99. package/dist/types/components/ui/GToggleButton/types.d.ts +284 -32
  100. package/dist/types/directives/index.d.ts +2 -0
  101. package/dist/types/directives/ripple.d.ts +1 -1
  102. package/dist/types/directives/specular.d.ts +34 -0
  103. package/dist/types/theme/color.d.ts +11 -0
  104. package/dist/types/theme/colorSeeds.d.ts +21 -20
  105. package/dist/types/theme/colorSystem.d.ts +12 -0
  106. package/dist/types/theme/cssTokens.d.ts +7 -0
  107. package/dist/types/theme/default.d.ts +26 -80
  108. package/dist/types/theme/gradient/animation/css.d.ts +12 -0
  109. package/dist/types/theme/gradient/animation/index.d.ts +1 -0
  110. package/dist/types/theme/gradient/colorMath.d.ts +3 -0
  111. package/dist/types/theme/gradient/constants.d.ts +3 -0
  112. package/dist/types/theme/gradient/core.d.ts +1 -0
  113. package/dist/types/theme/gradient/effects/index.d.ts +1 -0
  114. package/dist/types/theme/gradient/effects/morph.d.ts +5 -0
  115. package/dist/types/theme/gradient/effects/shadow.d.ts +3 -0
  116. package/dist/types/theme/gradient/formatters/canvas.d.ts +2 -0
  117. package/dist/types/theme/gradient/formatters/css.d.ts +3 -0
  118. package/dist/types/theme/gradient/formatters/index.d.ts +1 -0
  119. package/dist/types/theme/gradient/formatters/svg.d.ts +5 -0
  120. package/dist/types/theme/gradient/index.d.ts +1 -0
  121. package/dist/types/theme/gradient/material.d.ts +1 -0
  122. package/dist/types/theme/gradient/model.d.ts +5 -0
  123. package/dist/types/theme/gradient/presets.d.ts +158 -0
  124. package/dist/types/theme/gradient/recipes.d.ts +14 -0
  125. package/dist/types/theme/gradient/tokens.d.ts +72 -0
  126. package/dist/types/theme/gradient/types.d.ts +117 -0
  127. package/dist/types/theme/gradient/utils.d.ts +10 -0
  128. package/dist/types/theme/gradient.d.ts +1 -0
  129. package/dist/types/theme/index.d.ts +12 -1
  130. package/dist/types/theme/palette.d.ts +13 -0
  131. package/dist/types/theme/scheme.d.ts +2 -0
  132. package/dist/types/theme/types.d.ts +11 -0
  133. package/dist/types/use/actionSurface.d.ts +1742 -20
  134. package/dist/types/use/check/booleanControl.d.ts +9 -9
  135. package/dist/types/use/check/optionGroup.d.ts +9 -7
  136. package/dist/types/use/check/types.d.ts +26 -26
  137. package/dist/types/use/color.d.ts +2 -2
  138. package/dist/types/use/colorResolver.d.ts +15 -5
  139. package/dist/types/use/form/context.d.ts +8 -0
  140. package/dist/types/use/form/control.d.ts +4 -0
  141. package/dist/types/use/form/props.d.ts +4 -4
  142. package/dist/types/use/form/textFieldControl.d.ts +1 -1
  143. package/dist/types/use/glass.d.ts +24 -0
  144. package/dist/types/use/gradient.d.ts +1759 -43
  145. package/dist/types/use/gradientGlow.d.ts +4 -4
  146. package/dist/types/use/gradientMaterial.d.ts +21 -0
  147. package/dist/types/use/gradientRuntime.d.ts +11 -0
  148. package/dist/types/use/gradientRuntimeRegistry.d.ts +8 -0
  149. package/dist/types/use/gradientSurface.d.ts +31 -4
  150. package/dist/types/use/index.d.ts +9 -0
  151. package/dist/types/use/input/props.d.ts +11 -11
  152. package/dist/types/use/material.d.ts +112 -0
  153. package/dist/types/use/materialSurface.d.ts +376 -0
  154. package/dist/types/use/surface.d.ts +67 -19
  155. package/dist/types/use/surfaceColor.d.ts +1 -1
  156. package/dist/types/use/tagName.d.ts +47 -0
  157. package/dist/types/use/textarea/props.d.ts +11 -11
  158. package/dist/types/use/variant.d.ts +1 -1
  159. package/dist/use.cjs +1 -1
  160. package/dist/use.mjs +42 -19
  161. package/dist/useSnackbar-BHQshEZ8.cjs +1 -0
  162. package/dist/useSnackbar-DeNHZH8v.js +908 -0
  163. package/package.json +11 -4
  164. package/dist/GLoading.vue_vue_type_style_index_0_lang-CqbeZChH.cjs +0 -1
  165. package/dist/GLoading.vue_vue_type_style_index_0_lang-DDqJEYGf.js +0 -691
  166. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-DVKJZfcV.cjs +0 -4
  167. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-hL_S3ZHD.js +0 -5633
  168. package/dist/camelToKebabCase-BAESShJ1.cjs +0 -1
  169. package/dist/camelToKebabCase-KgkZ7-1F.js +0 -28
  170. package/dist/default-BcPApP1Q.cjs +0 -318
  171. package/dist/icon-0-mbYGMr.cjs +0 -1
  172. package/dist/icon-BrFRYYf3.js +0 -66
  173. package/dist/mask-BgaDaVWU.js +0 -816
  174. package/dist/mask-pzGv8apS.cjs +0 -1
  175. package/dist/types/theme/changeTone.d.ts +0 -1
  176. package/dist/types/theme/colorPallete.d.ts +0 -2
  177. package/dist/types/theme/generateColors.d.ts +0 -1
  178. package/dist/types/theme/generateGradient.d.ts +0 -9
  179. package/dist/types/theme/getComplementaryColor.d.ts +0 -1
  180. package/dist/types/utils/color.d.ts +0 -3
  181. package/dist/types/utils/colors/normaliseColor.d.ts +0 -5
  182. package/dist/useSnackbar-CFrWSpt4.cjs +0 -1
  183. package/dist/useSnackbar-lGrTDbl-.js +0 -763
@@ -1,816 +0,0 @@
1
- import { r as z, b as $, _ as fe, p as Q, m as pe, a as G, c as ee } from "./GLoading.vue_vue_type_style_index_0_lang-DDqJEYGf.js";
2
- import { createApp as te, ref as v, computed as p, onMounted as me, onBeforeUnmount as S, watch as ne, defineComponent as oe, toRef as ge, openBlock as L, createElementBlock as ye, Fragment as ve, createElementVNode as _, normalizeClass as _e, renderSlot as C, unref as y, createBlock as A, Teleport as be, createVNode as ke, withCtx as D, withDirectives as K, normalizeStyle as W, vShow as j, mergeProps as P, createSlots as he, toDisplayString as xe, h as we } from "vue";
3
- import { offset as Te, flip as Ee, shift as Le, size as Ce, useFloating as De, autoUpdate as Be } from "@floating-ui/vue";
4
- import { d as Me, a as Fe } from "./index-Cs3XQ3JB.js";
5
- const U = "var(--g-gradient-current, var(--g-gradient-main))", Ie = "135deg";
6
- function Ve() {
7
- return /* @__PURE__ */ new WeakMap();
8
- }
9
- function re(e) {
10
- const t = Ve();
11
- function n(r) {
12
- const i = t.get(r);
13
- if (i) {
14
- for (const [l, s] of i.targets)
15
- Se(l, s);
16
- t.delete(r);
17
- }
18
- }
19
- function o(r, i) {
20
- const l = Pe(i, e);
21
- if (n(r), l.disabled) return;
22
- const s = Ne(r, l.selector), a = {
23
- targets: /* @__PURE__ */ new Map()
24
- };
25
- for (const u of s)
26
- a.targets.set(u, Oe(u)), Re(u, l.gradient);
27
- t.set(r, a);
28
- }
29
- return {
30
- mounted(r, i) {
31
- o(r, i.value);
32
- },
33
- updated(r, i) {
34
- o(r, i.value);
35
- },
36
- unmounted(r) {
37
- n(r);
38
- }
39
- };
40
- }
41
- function Pe(e, t) {
42
- if (typeof e == "string")
43
- return {
44
- gradient: z(e),
45
- disabled: !1,
46
- selector: t
47
- };
48
- if (!e)
49
- return {
50
- gradient: U,
51
- disabled: !1,
52
- selector: t
53
- };
54
- const n = $e(e);
55
- return {
56
- gradient: e.gradient ?? (n.length ? Ae(n, e.direction) : void 0) ?? z(e.state ?? e.color) ?? U,
57
- disabled: e.disabled ?? !1,
58
- selector: e.selector ?? t
59
- };
60
- }
61
- function $e(e) {
62
- var t;
63
- return (t = e.colors) != null && t.length ? e.colors : [e.from, e.to].filter(
64
- (n) => !!n
65
- );
66
- }
67
- function Ae(e, t = Ie) {
68
- const n = e.length === 1 ? [e[0], e[0]] : e;
69
- return `linear-gradient(${t}, ${n.map((o) => $(o)).join(", ")})`;
70
- }
71
- function Ne(e, t) {
72
- if (!t)
73
- return [e];
74
- const n = [];
75
- return e.matches(t) && n.push(e), n.push(...Array.from(e.querySelectorAll(t))), n;
76
- }
77
- function Oe(e) {
78
- return {
79
- backgroundClip: e.style.backgroundClip,
80
- backgroundImage: e.style.backgroundImage,
81
- color: e.style.color,
82
- webkitBackgroundClip: e.style.getPropertyValue(
83
- "-webkit-background-clip"
84
- ),
85
- webkitTextFillColor: e.style.getPropertyValue(
86
- "-webkit-text-fill-color"
87
- )
88
- };
89
- }
90
- function Se(e, t) {
91
- e.style.backgroundClip = t.backgroundClip, e.style.backgroundImage = t.backgroundImage, e.style.color = t.color, e.style.setProperty(
92
- "-webkit-background-clip",
93
- t.webkitBackgroundClip
94
- ), e.style.setProperty(
95
- "-webkit-text-fill-color",
96
- t.webkitTextFillColor
97
- );
98
- }
99
- function Re(e, t) {
100
- e.style.backgroundImage = t, e.style.backgroundClip = "text", e.style.color = "transparent", e.style.setProperty("-webkit-background-clip", "text"), e.style.setProperty("-webkit-text-fill-color", "transparent");
101
- }
102
- const wt = re(), Tt = re(".mdi");
103
- function ze(e) {
104
- const t = e == null ? void 0 : e.isVisible;
105
- return typeof t == "object" && t !== null && "value" in t ? !!t.value : !!t;
106
- }
107
- const Ge = {
108
- active: !1,
109
- text: "Loading...",
110
- noText: !1,
111
- color: "primary",
112
- dark: !1,
113
- opacity: void 0,
114
- blur: void 0,
115
- progressView: "glow"
116
- };
117
- function Ke(e, t = {}) {
118
- const n = typeof e == "object" && e !== null ? e : {}, o = typeof e == "boolean" ? e : n.active ?? n.value ?? !1;
119
- return {
120
- ...Ge,
121
- ...n,
122
- active: o,
123
- dark: n.dark ?? !!t.dark,
124
- noText: n.noText ?? !!t.noText
125
- };
126
- }
127
- function ie(e) {
128
- return JSON.stringify({
129
- text: e.text,
130
- noText: e.noText,
131
- color: e.color,
132
- dark: e.dark,
133
- opacity: e.opacity,
134
- blur: e.blur,
135
- progressView: e.progressView
136
- });
137
- }
138
- function We(e) {
139
- return ["relative", "absolute", "fixed", "sticky"].includes(
140
- getComputedStyle(e).position
141
- );
142
- }
143
- function je(e) {
144
- We(e) || (e.style.position = "relative");
145
- }
146
- function B(e) {
147
- var n, o;
148
- const t = e.__gLoading__;
149
- t && ((n = t.app) == null || n.unmount(), (o = t.container) == null || o.remove(), t.app = void 0, t.container = void 0, t.component = void 0, t.optionsKey = void 0, e.style.position = t.originalPosition);
150
- }
151
- function Ue(e) {
152
- const t = e.__gLoading__;
153
- if (t) {
154
- if (!t.component) {
155
- B(e);
156
- return;
157
- }
158
- t.component.hide();
159
- }
160
- }
161
- function He(e, t) {
162
- const n = e.__gLoading__;
163
- if (!n) return;
164
- je(e);
165
- const o = document.createElement("div");
166
- o.className = "g-loading__container";
167
- const r = te(fe, {
168
- text: t.text,
169
- noText: t.noText,
170
- color: t.color,
171
- dark: t.dark,
172
- opacity: t.opacity,
173
- blur: t.blur,
174
- progressView: t.progressView,
175
- onClose: () => {
176
- ze(n.component) || B(e);
177
- }
178
- });
179
- n.app = r, n.container = o, n.optionsKey = ie(t), e.appendChild(o), n.component = r.mount(o), n.component.show();
180
- }
181
- function H(e, t, n) {
182
- var l;
183
- const o = e.__gLoading__;
184
- if (!o) return;
185
- const r = Ke(t, n), i = ie(r);
186
- if (!r.active) {
187
- Ue(e);
188
- return;
189
- }
190
- if (o.app && o.optionsKey === i) {
191
- (l = o.component) == null || l.show();
192
- return;
193
- }
194
- B(e), He(e, r);
195
- }
196
- const Et = {
197
- mounted(e, t) {
198
- e.__gLoading__ = {
199
- originalPosition: e.style.position
200
- }, H(e, t.value, t.modifiers);
201
- },
202
- updated(e, t) {
203
- t.value === t.oldValue && (typeof t.value != "object" || t.value === null) || H(e, t.value, t.modifiers);
204
- },
205
- unmounted(e) {
206
- B(e), delete e.__gLoading__;
207
- }
208
- }, h = {
209
- center: !1,
210
- color: "currentcolor",
211
- disabled: !1,
212
- duration: 520,
213
- easing: "var(--g-token-easing-standard)",
214
- opacity: 0.16
215
- };
216
- function se(e) {
217
- if (typeof e == "boolean")
218
- return {
219
- ...h,
220
- disabled: !e
221
- };
222
- if (typeof e == "string")
223
- return {
224
- ...h,
225
- color: $(e)
226
- };
227
- const t = e != null && e.color ? $(e.color) : h.color;
228
- return {
229
- ...h,
230
- ...e,
231
- color: t
232
- };
233
- }
234
- function qe(e) {
235
- getComputedStyle(e).position === "static" && (e.style.position = "relative");
236
- }
237
- function Je(e) {
238
- return typeof e == "number" ? `${e}ms` : e;
239
- }
240
- function Xe(e) {
241
- if (typeof e == "number") return e;
242
- const t = e.trim();
243
- if (t.endsWith("ms"))
244
- return Number.parseFloat(t);
245
- if (t.endsWith("s"))
246
- return Number.parseFloat(t) * 1e3;
247
- const n = Number.parseFloat(t);
248
- return Number.isNaN(n) ? Number(h.duration) : n;
249
- }
250
- function Ye(e, t, n) {
251
- const o = e.getBoundingClientRect(), r = Math.hypot(o.width, o.height) * 2, i = t.x - o.left - r / 2, l = t.y - o.top - r / 2, s = document.createElement("span"), a = document.createElement("span");
252
- return s.className = "g-ripple__container", s.style.setProperty("--g-ripple-color", n.color), s.style.setProperty(
253
- "--g-ripple-duration",
254
- Je(n.duration)
255
- ), s.style.setProperty("--g-ripple-easing", n.easing), s.style.setProperty(
256
- "--g-ripple-opacity",
257
- String(n.opacity)
258
- ), a.className = "g-ripple__animation", a.style.width = `${r}px`, a.style.height = `${r}px`, a.style.left = `${i}px`, a.style.top = `${l}px`, s.appendChild(a), e.appendChild(s), s;
259
- }
260
- function Ze(e, t) {
261
- var n;
262
- t.remove(), (n = e.__gRipple__) == null || n.ripples.delete(t);
263
- }
264
- function ae(e) {
265
- const t = e.__gRipple__;
266
- if (t) {
267
- for (const n of t.ripples)
268
- n.remove();
269
- t.ripples.clear();
270
- }
271
- }
272
- function q(e) {
273
- const t = e.getBoundingClientRect();
274
- return {
275
- x: t.left + t.width / 2,
276
- y: t.top + t.height / 2
277
- };
278
- }
279
- function Qe(e) {
280
- return e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true" || e.classList.contains("g-button_disabled");
281
- }
282
- function J(e, t, n) {
283
- var r;
284
- if (n.disabled || Qe(e)) return;
285
- qe(e);
286
- const o = Ye(e, t, n);
287
- (r = e.__gRipple__) == null || r.ripples.add(o), window.setTimeout(
288
- () => Ze(e, o),
289
- Xe(n.duration)
290
- );
291
- }
292
- function et(e, t) {
293
- if (e.__gRipple__) {
294
- le(e, t);
295
- return;
296
- }
297
- const n = se(t), o = {
298
- originalPosition: e.style.position,
299
- options: n,
300
- onKeyDown: (r) => {
301
- r.key !== "Enter" && r.key !== " " || J(e, q(e), o.options);
302
- },
303
- onPointerDown: (r) => {
304
- r.button !== 0 || e.hasAttribute("disabled") || J(
305
- e,
306
- o.options.center ? q(e) : { x: r.clientX, y: r.clientY },
307
- o.options
308
- );
309
- },
310
- ripples: /* @__PURE__ */ new Set()
311
- };
312
- e.addEventListener("pointerdown", o.onPointerDown), e.addEventListener("keydown", o.onKeyDown), e.__gRipple__ = o;
313
- }
314
- function le(e, t) {
315
- const n = e.__gRipple__;
316
- n && (n.options = se(t), n.options.disabled && ae(e));
317
- }
318
- function tt(e) {
319
- const t = e.__gRipple__;
320
- t && (e.removeEventListener("pointerdown", t.onPointerDown), e.removeEventListener("keydown", t.onKeyDown), ae(e), e.style.position = t.originalPosition, delete e.__gRipple__);
321
- }
322
- const Lt = {
323
- mounted(e, t) {
324
- et(e, t.value);
325
- },
326
- updated(e, t) {
327
- le(e, t.value);
328
- },
329
- unmounted(e) {
330
- tt(e);
331
- }
332
- }, ue = Q({
333
- ...pe(),
334
- modelValue: {
335
- type: Boolean,
336
- default: void 0
337
- },
338
- defaultOpen: {
339
- type: Boolean,
340
- default: !1
341
- },
342
- placement: {
343
- type: String,
344
- default: "bottom"
345
- },
346
- strategy: {
347
- type: String,
348
- default: "absolute"
349
- },
350
- offset: {
351
- type: Number,
352
- default: 8
353
- },
354
- shift: {
355
- type: Boolean,
356
- default: !0
357
- },
358
- flip: {
359
- type: Boolean,
360
- default: !0
361
- },
362
- sameWidth: {
363
- type: Boolean,
364
- default: !1
365
- },
366
- referenceFullWidth: {
367
- type: Boolean,
368
- default: !1
369
- },
370
- appendTo: {
371
- type: String,
372
- default: ""
373
- },
374
- zIndexBase: {
375
- type: Number,
376
- default: 1e3
377
- },
378
- disabled: Boolean,
379
- content: String,
380
- reference: Object
381
- }), nt = (e) => {
382
- const t = v(null), n = v(null), o = p(() => {
383
- const u = [];
384
- return e.offset && u.push(Te(e.offset)), e.flip && u.push(Ee()), e.shift && u.push(
385
- Le({
386
- padding: 4,
387
- crossAxis: !0
388
- })
389
- ), e.sameWidth && u.push(
390
- Ce({
391
- apply({ rects: c, elements: d }) {
392
- Object.assign(d.floating.style, {
393
- width: `${c.reference.width}px`
394
- });
395
- }
396
- })
397
- ), u;
398
- }), { x: r, y: i, strategy: l, placement: s, update: a } = De(
399
- t,
400
- n,
401
- {
402
- ...e,
403
- middleware: o,
404
- whileElementsMounted: Be
405
- }
406
- );
407
- return {
408
- reference: t,
409
- floating: n,
410
- x: r,
411
- y: i,
412
- strategy: l,
413
- placement: s,
414
- update: a
415
- };
416
- };
417
- function ot(e) {
418
- const t = p(() => !!e), n = p(() => e || "body");
419
- return {
420
- hasAppendTarget: t,
421
- appendTarget: n
422
- };
423
- }
424
- function rt(e, t) {
425
- const n = p(() => e.modelValue !== void 0), o = v(e.defaultOpen ?? !1);
426
- return {
427
- open: p({
428
- get() {
429
- return n.value ? e.modelValue ?? !1 : o.value;
430
- },
431
- set(i) {
432
- n.value || (o.value = i), t("update:modelValue", i);
433
- }
434
- }),
435
- isControlled: n
436
- };
437
- }
438
- function it(e) {
439
- return e instanceof HTMLElement;
440
- }
441
- function st(e) {
442
- return !!e && typeof e == "object" && "$el" in e;
443
- }
444
- function X(e) {
445
- return e ? it(e) ? e : st(e) ? e.$el : null : null;
446
- }
447
- function at({
448
- open: e,
449
- reference: t,
450
- floating: n,
451
- escapeKey: o = !0,
452
- outsideClick: r = !0
453
- }) {
454
- if (!e || !t || !n)
455
- throw new Error(
456
- "useDismiss: open, reference, and floating are required"
457
- );
458
- const i = (s) => {
459
- if (!r) return;
460
- const a = X(t.value), u = X(n.value), c = s.target;
461
- a && u && !a.contains(c) && !u.contains(c) && (e.value = !1);
462
- }, l = (s) => {
463
- o && s.key === "Escape" && (e.value = !1);
464
- };
465
- me(() => {
466
- document.addEventListener("click", i), document.addEventListener("keydown", l);
467
- }), S(() => {
468
- document.removeEventListener("click", i), document.removeEventListener("keydown", l);
469
- });
470
- }
471
- let lt = 0;
472
- const g = [], ce = v(null);
473
- function Y(e) {
474
- const t = g.find((r) => r.id === e);
475
- if (!t) return;
476
- const o = g.filter((r) => r.kind === t.kind).findIndex((r) => r.id === e);
477
- return t.base + o + 1;
478
- }
479
- function N() {
480
- const e = [...g].reverse().find((t) => t.kind === "overlay" && t.open.value);
481
- ce.value = (e == null ? void 0 : e.id) ?? null;
482
- }
483
- function Z(e) {
484
- const t = g.findIndex((o) => o.id === e);
485
- if (t === -1) return;
486
- const [n] = g.splice(t, 1);
487
- g.push(n), N();
488
- }
489
- function ut(e) {
490
- const { open: t, base: n = 1e3, kind: o = "floating" } = e, r = ++lt, i = v();
491
- function l() {
492
- g.findIndex((m) => m.id === r) === -1 ? g.push({ id: r, kind: o, base: n, open: t }) : Z(r), i.value = Y(r), N();
493
- }
494
- function s() {
495
- const d = g.findIndex((m) => m.id === r);
496
- d !== -1 && g.splice(d, 1), i.value = void 0, N();
497
- }
498
- function a() {
499
- t.value && (Z(r), i.value = Y(r));
500
- }
501
- const u = p(() => {
502
- var m;
503
- return ((m = g.filter((b) => b.kind === o).at(-1)) == null ? void 0 : m.id) === r;
504
- }), c = p(
505
- () => o === "overlay" && ce.value === r
506
- );
507
- return ne(
508
- t,
509
- (d) => {
510
- d ? l() : s();
511
- },
512
- { immediate: !0 }
513
- ), S(() => {
514
- s();
515
- }), {
516
- id: r,
517
- zIndex: i,
518
- isTop: u,
519
- isTopOverlay: c,
520
- bringToFront: a
521
- };
522
- }
523
- const ct = /* @__PURE__ */ oe({
524
- __name: "BaseFloating",
525
- props: ue(),
526
- emits: ["update:modelValue"],
527
- setup(e, { emit: t }) {
528
- const n = e, o = ge(n, "reference"), r = t, { open: i } = rt(n, r), { hasAppendTarget: l, appendTarget: s } = ot(n.appendTo), a = v(!1), u = p(() => i.value || a.value), { reference: c, floating: d, x: m, y: b, strategy: M, update: F } = nt(n);
529
- at({ open: i, reference: c, floating: d });
530
- const { zIndex: x } = ut({
531
- open: u,
532
- base: n.zIndexBase,
533
- kind: "floating"
534
- }), k = p(() => ({
535
- position: M.value,
536
- top: b.value != null ? `${b.value}px` : "",
537
- left: m.value != null ? `${m.value}px` : "",
538
- minWidth: n.sameWidth && c.value instanceof HTMLElement ? `${c.value.offsetWidth}px` : void 0,
539
- zIndex: x.value
540
- }));
541
- function I(f) {
542
- f && ("$el" in f || f instanceof HTMLElement) ? c.value = f : (c.value = n.reference, F());
543
- }
544
- function w() {
545
- a.value = !0;
546
- }
547
- function T() {
548
- a.value = !1;
549
- }
550
- function E() {
551
- a.value = !1;
552
- }
553
- return ne(
554
- o,
555
- (f) => {
556
- f && (c.value = f);
557
- },
558
- { deep: !0, immediate: !0 }
559
- ), (f, V) => (L(), ye(ve, null, [
560
- _("div", {
561
- class: _e(["base-floating__reference", {
562
- "base-floating__reference_full": n.referenceFullWidth
563
- }])
564
- }, [
565
- C(f.$slots, "reference", { ref: I }, void 0, !0)
566
- ], 2),
567
- y(l) ? (L(), A(be, {
568
- key: 0,
569
- to: y(s)
570
- }, [
571
- ke(y(G), {
572
- transition: n.transition,
573
- name: "scale",
574
- onBeforeLeave: w,
575
- onAfterLeave: T,
576
- onLeaveCancelled: E
577
- }, {
578
- default: D(() => [
579
- K(_("div", {
580
- ref_key: "floating",
581
- ref: d,
582
- style: W(k.value)
583
- }, [
584
- C(f.$slots, "default", {}, void 0, !0)
585
- ], 4), [
586
- [j, y(i)]
587
- ])
588
- ]),
589
- _: 3
590
- }, 8, ["transition"])
591
- ], 8, ["to"])) : (L(), A(y(G), {
592
- key: 1,
593
- transition: n.transition,
594
- name: "scale",
595
- onBeforeLeave: w,
596
- onAfterLeave: T,
597
- onLeaveCancelled: E
598
- }, {
599
- default: D(() => [
600
- K(_("div", {
601
- ref_key: "floating",
602
- ref: d,
603
- style: W(k.value)
604
- }, [
605
- C(f.$slots, "default", {}, void 0, !0)
606
- ], 4), [
607
- [j, y(i)]
608
- ])
609
- ]),
610
- _: 3
611
- }, 8, ["transition"]))
612
- ], 64));
613
- }
614
- }), dt = /* @__PURE__ */ ee(ct, [["__scopeId", "data-v-d9f4cacd"]]), ft = Q({
615
- ...ue(),
616
- openDelay: {
617
- type: Number,
618
- default: 0
619
- },
620
- closeDelay: {
621
- type: Number,
622
- default: 0
623
- }
624
- });
625
- function pt(e, t) {
626
- const { click: n, hover: o, focus: r, contextmenu: i, disabled: l = !1 } = t;
627
- let s = null, a = null;
628
- function u() {
629
- s && clearTimeout(s), a && clearTimeout(a), s = null, a = null;
630
- }
631
- function c(f, V = 0) {
632
- if (u(), V === 0) {
633
- e.value = f;
634
- return;
635
- }
636
- const R = window.setTimeout(() => {
637
- e.value = f;
638
- }, V);
639
- f ? s = R : a = R;
640
- }
641
- const d = typeof o == "object" ? o : {}, m = d.openDelay ?? 0, b = d.closeDelay ?? 0;
642
- function M() {
643
- l || !n || (e.value = !e.value);
644
- }
645
- function F(f) {
646
- l || !i || (f.preventDefault(), e.value = !0);
647
- }
648
- function x() {
649
- l || !o || c(!0, m);
650
- }
651
- function k() {
652
- o && c(!1, b);
653
- }
654
- function I() {
655
- l || !r || (e.value = !0);
656
- }
657
- function w() {
658
- r && (e.value = !1);
659
- }
660
- S(u);
661
- const T = p(() => ({
662
- ...n ? { onClick: M } : {},
663
- ...i ? { onContextmenu: F } : {},
664
- ...o ? { onMouseenter: x, onMouseleave: k } : {},
665
- ...r ? { onFocus: I, onBlur: w } : {}
666
- })), E = p(() => ({
667
- ...o ? { onMouseenter: x, onMouseleave: k } : {}
668
- }));
669
- return {
670
- triggerAttrs: T,
671
- floatingAttrs: E
672
- };
673
- }
674
- const mt = { class: "g-tooltip__content" }, gt = /* @__PURE__ */ oe({
675
- __name: "GTooltip",
676
- props: ft(),
677
- setup(e, { expose: t }) {
678
- const n = e, o = v(!1), r = p(
679
- () => n.transition ?? { name: "scale-only", scale: 0.96 }
680
- ), { triggerAttrs: i, floatingAttrs: l } = pt(o, {
681
- hover: {
682
- openDelay: n.openDelay,
683
- closeDelay: n.closeDelay
684
- },
685
- focus: !0
686
- });
687
- function s() {
688
- o.value = !1;
689
- }
690
- function a() {
691
- o.value = !0;
692
- }
693
- return t({ hide: s, show: a, open: o }), (u, c) => (L(), A(y(dt), P(n, {
694
- "model-value": o.value,
695
- "onUpdate:modelValue": c[0] || (c[0] = (d) => o.value = d),
696
- transition: r.value
697
- }), he({
698
- default: D(() => [
699
- _("div", P({ class: "g-tooltip" }, y(l), { role: "tooltip" }), [
700
- c[1] || (c[1] = _("div", { class: "g-tooltip__underlay" }, null, -1)),
701
- _("span", mt, xe(n.content), 1)
702
- ], 16)
703
- ]),
704
- _: 2
705
- }, [
706
- u.$slots.default ? {
707
- name: "reference",
708
- fn: D(({ ref: d }) => [
709
- _("div", P({
710
- ref: d,
711
- class: "g-tooltip__trigger",
712
- tabindex: "0"
713
- }, y(i)), [
714
- C(u.$slots, "default", {}, void 0, !0)
715
- ], 16)
716
- ]),
717
- key: "0"
718
- } : void 0
719
- ]), 1040, ["model-value", "transition"]));
720
- }
721
- }), yt = /* @__PURE__ */ ee(gt, [["__scopeId", "data-v-578012d6"]]), Ct = {
722
- mounted(e, t) {
723
- if (!t.value) return;
724
- const n = typeof t.value == "string" ? { content: t.value } : t.value, o = v(!1), r = document.createElement("div");
725
- document.body.appendChild(r);
726
- const i = v(null), l = te({
727
- setup() {
728
- return () => we(
729
- yt,
730
- {
731
- ...n,
732
- reference: e,
733
- ref: (u) => {
734
- u && (i.value = u);
735
- }
736
- },
737
- {
738
- reference: ({
739
- ref: u
740
- }) => (u(e), e)
741
- }
742
- );
743
- }
744
- });
745
- l.mount(r);
746
- const s = () => {
747
- i.value && i.value.show();
748
- }, a = () => {
749
- i.value && i.value.hide();
750
- };
751
- e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", a), e.addEventListener("focus", s), e.addEventListener("blur", a), e.__tooltip__ = {
752
- app: l,
753
- container: r,
754
- open: o,
755
- cleanup() {
756
- e.removeEventListener("mouseenter", s), e.removeEventListener("mouseleave", a), e.removeEventListener("focus", s), e.removeEventListener("blur", a), l.unmount(), r.remove();
757
- }
758
- };
759
- },
760
- unmounted(e) {
761
- var t;
762
- (t = e.__tooltip__) == null || t.cleanup();
763
- }
764
- };
765
- function vt(e) {
766
- return typeof e == "string" || Array.isArray(e) || e === void 0 ? {
767
- mask: e
768
- } : e;
769
- }
770
- function de(e) {
771
- return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? e : e.querySelector("input, textarea");
772
- }
773
- function O(e, t) {
774
- const n = de(e);
775
- if (!n) return;
776
- const o = vt(t.value), r = {
777
- ...Me,
778
- ...o.tokens ?? {}
779
- }, i = Fe(n.value, o.mask, r);
780
- n.value !== i && (n.value = i);
781
- }
782
- function _t(e, t) {
783
- const n = de(e);
784
- if (!n) return;
785
- const o = () => {
786
- e._gMaskFormatting || (e._gMaskFormatting = !0, O(e, t), n.dispatchEvent(new Event("input", { bubbles: !0 })), e._gMaskFormatting = !1);
787
- };
788
- n.addEventListener("input", o), e._gMaskCleanup = () => {
789
- n.removeEventListener("input", o);
790
- }, O(e, t);
791
- }
792
- const Dt = {
793
- mounted: _t,
794
- updated(e, t) {
795
- O(e, t);
796
- },
797
- beforeUnmount(e) {
798
- var t;
799
- (t = e._gMaskCleanup) == null || t.call(e), delete e._gMaskCleanup, delete e._gMaskFormatting;
800
- }
801
- };
802
- export {
803
- dt as B,
804
- yt as G,
805
- Dt as a,
806
- Ct as b,
807
- ot as c,
808
- ut as d,
809
- pt as e,
810
- Tt as g,
811
- Et as l,
812
- ue as m,
813
- Lt as r,
814
- rt as u,
815
- wt as v
816
- };