@gradient-ui/core 0.5.0-rc.0 → 0.6.0
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.
- package/README.md +4 -4
- package/dist/{GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js → GLoading.vue_vue_type_style_index_0_lang-COggAM7a.js} +90 -88
- package/dist/GLoading.vue_vue_type_style_index_0_lang-CoPHejAL.cjs +1 -0
- package/dist/{GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js → GSwitch.vue_vue_type_script_setup_true_lang-CRlkCyW_.js} +2371 -2355
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-DZXv1j__.cjs +1 -0
- package/dist/{camelToKebabCase-6qY6WHvl.js → camelToKebabCase-BWbQb81D.js} +4 -4
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +4 -4
- package/dist/default--73FwpwZ.cjs +4 -0
- package/dist/default-DlsS6GI_.js +58 -0
- package/dist/directives.cjs +1 -1
- package/dist/directives.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +112 -108
- package/dist/{mask-CZX-I_iy.js → mask-BqOamrcF.js} +2 -2
- package/dist/{mask-BbofdFd4.cjs → mask-ObMqNEfF.cjs} +1 -1
- package/dist/materialSurface-CbOpfFGO.js +634 -0
- package/dist/materialSurface-CjhWd_yD.cjs +1 -0
- package/dist/scheme-CZ0a0X5e.cjs +299 -0
- package/dist/scheme-Dqwdqg6N.js +1405 -0
- package/dist/services.cjs +1 -1
- package/dist/services.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-BKu4KfkY.js → surface-DImNM7I1.js} +49 -46
- package/dist/surface-_J0t7c3m.cjs +1 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +52 -48
- package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +2 -2
- package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +4 -4
- package/dist/types/components/ui/GButton/GButton.vue.d.ts +2 -2
- package/dist/types/components/ui/GChip/GChip.vue.d.ts +1 -1
- package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +5 -5
- package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +3 -3
- package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +2 -2
- package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +2 -2
- package/dist/types/components/ui/GTable/GTable.vue.d.ts +7 -7
- package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +3 -3
- package/dist/types/theme/default.d.ts +2 -1
- package/dist/types/theme/gradient.d.ts +1 -1
- package/dist/types/theme/index.d.ts +6 -6
- package/dist/types/use/actionSurface.d.ts +5 -1650
- package/dist/types/use/gradient.d.ts +4 -1653
- package/dist/types/use/gradientMaterial.d.ts +1 -1
- package/dist/types/use/material.d.ts +3 -2
- package/dist/types/use/materialSurface.d.ts +10 -4
- package/dist/types/use/surfaceColor.d.ts +2 -1
- package/dist/types/use/surfaceMaterial.d.ts +45 -0
- package/dist/use.cjs +1 -1
- package/dist/use.mjs +2 -2
- package/dist/useSnackbar-D60dFSV1.cjs +1 -0
- package/dist/useSnackbar-us11nXny.js +922 -0
- package/package.json +4 -2
- package/dist/GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs +0 -1
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs +0 -1
- package/dist/default-BhuY-A3o.cjs +0 -4
- package/dist/default-OTmCd0Aq.js +0 -131
- package/dist/material-Ca7ZZAiO.cjs +0 -194
- package/dist/material-okvXHenb.js +0 -1162
- package/dist/materialSurface-BBrP9ltj.js +0 -591
- package/dist/materialSurface-CK8LN_dU.cjs +0 -1
- package/dist/surface-8z3gR7vF.cjs +0 -1
- package/dist/types/theme/gradient/animation/css.d.ts +0 -12
- package/dist/types/theme/gradient/animation/index.d.ts +0 -1
- package/dist/types/theme/gradient/colorMath.d.ts +0 -3
- package/dist/types/theme/gradient/constants.d.ts +0 -3
- package/dist/types/theme/gradient/core.d.ts +0 -1
- package/dist/types/theme/gradient/effects/index.d.ts +0 -1
- package/dist/types/theme/gradient/effects/morph.d.ts +0 -5
- package/dist/types/theme/gradient/effects/shadow.d.ts +0 -3
- package/dist/types/theme/gradient/formatters/canvas.d.ts +0 -2
- package/dist/types/theme/gradient/formatters/css.d.ts +0 -3
- package/dist/types/theme/gradient/formatters/index.d.ts +0 -1
- package/dist/types/theme/gradient/formatters/svg.d.ts +0 -5
- package/dist/types/theme/gradient/index.d.ts +0 -1
- package/dist/types/theme/gradient/material.d.ts +0 -1
- package/dist/types/theme/gradient/model.d.ts +0 -5
- package/dist/types/theme/gradient/presets.d.ts +0 -158
- package/dist/types/theme/gradient/recipes.d.ts +0 -14
- package/dist/types/theme/gradient/tokens.d.ts +0 -72
- package/dist/types/theme/gradient/types.d.ts +0 -117
- package/dist/types/theme/gradient/utils.d.ts +0 -10
- package/dist/useSnackbar-BHQshEZ8.cjs +0 -1
- package/dist/useSnackbar-DeNHZH8v.js +0 -908
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { B as o, G as i, a as n, b as G, c as
|
|
2
|
-
import { n as Ca } from "./GSwitch.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { _ as Q, G as z, a as J } from "./GLoading.vue_vue_type_style_index_0_lang-
|
|
4
|
-
import { _ as K, G as W, a as X, b as Y } from "./useSnackbar-
|
|
5
|
-
import { u as
|
|
6
|
-
import { g as Z, v as p, l as aa, a as ea, r as sa, s as ra, b as ta, G as oa } from "./mask-
|
|
7
|
-
import { a as Na, d as
|
|
8
|
-
import { d as Oa, u as
|
|
9
|
-
import { i as ia } from "./materialSurface-
|
|
10
|
-
import { c as
|
|
11
|
-
import { C as ee, O as se, S as re, c as te, a as oe, b as ie, d as ne, g as Ge, p as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
import { B as o, G as i, a as n, b as G, c as d, d as l, _ as c, e as u, f as m, g as f, h as v, j as T, k as b, l as _, m as g, o as M, p as S, q as k, u as x, v as C, w as h, x as D, r as A, s as I, t as N, y as E, z as P, A as L, C as B, D as O, E as F, F as R, H as $, I as w, J as y, K as H, L as V, M as q, N as U, i as j } from "./GSwitch.vue_vue_type_script_setup_true_lang-CRlkCyW_.js";
|
|
2
|
+
import { n as Ca } from "./GSwitch.vue_vue_type_script_setup_true_lang-CRlkCyW_.js";
|
|
3
|
+
import { _ as Q, G as z, a as J } from "./GLoading.vue_vue_type_style_index_0_lang-COggAM7a.js";
|
|
4
|
+
import { _ as K, G as W, a as X, b as Y } from "./useSnackbar-us11nXny.js";
|
|
5
|
+
import { u as Da, c as Aa } from "./useSnackbar-us11nXny.js";
|
|
6
|
+
import { g as Z, v as p, l as aa, a as ea, r as sa, s as ra, b as ta, G as oa } from "./mask-BqOamrcF.js";
|
|
7
|
+
import { a as Na, d as Ea, u as Pa, b as La } from "./index-Cs3XQ3JB.js";
|
|
8
|
+
import { d as Oa, u as Fa } from "./index-BtCLucTD.js";
|
|
9
|
+
import { i as ia } from "./materialSurface-CbOpfFGO.js";
|
|
10
|
+
import { c as $a, m as wa, a as ya, b as Ha, d as Va, e as qa, f as Ua, p as ja, u as Qa, g as za, h as Ja, j as Ka, k as Wa, l as Xa, n as Ya, o as Za, q as pa } from "./materialSurface-CbOpfFGO.js";
|
|
11
|
+
import { C as ee, O as se, S as re, c as te, a as oe, b as ie, d as ne, g as Ge, p as de, r as le, e as ce } from "./camelToKebabCase-BWbQb81D.js";
|
|
12
|
+
import { c as me, a as fe, i as ve, b as Te, d as be, e as _e, m as ge } from "./scheme-Dqwdqg6N.js";
|
|
13
|
+
import { DEFAULT_GRADIENT_MORPH_BLEND_MODE as Se, DEFAULT_SEED as ke, GRADIENT_MORPH_BLEND_MODES as xe, createGradient as Ce, createGradientFromColor as he, createGradientMaterial as De, createGradientModel as Ae, createGradientModelFromColor as Ie, createGradientMorphBlobs as Ne, createGradientPreset as Ee, createGradientTokens as Pe, createLinearGradient as Le, defineGradientPreset as Be, defineGradientPresetRegistry as Oe, getGradientPreset as Fe, gradientPresets as Re, isGradientMorphBlendMode as $e, resolveGradientMorphBlendMode as we, toCanvasGradient as ye, toCssGradient as He, toGradientAnimationCSS as Ve, toGradientBoxShadow as qe, toGradientDropShadow as Ue, toGradientMorphCSS as je, toGradientMorphFilter as Qe, toGradientMorphFilterMarkup as ze, toSvgGradient as Je, toSvgGradientMarkup as Ke, toSvgPathAnimationMarkup as We, toSvgSourceAnimationMarkup as Xe } from "@gradient-ui/gradient-engine";
|
|
14
|
+
import { i as na, d as Ga } from "./default-DlsS6GI_.js";
|
|
15
|
+
import { c as Ze, a as pe, b as as, p as es, u as ss } from "./default-DlsS6GI_.js";
|
|
16
|
+
import { i as da, w as la } from "./defaults-DMi34V8q.js";
|
|
17
|
+
import { c as ts, p as os, u as is } from "./defaults-DMi34V8q.js";
|
|
18
|
+
import { S as Gs, m as ds, a as ls, r as cs, b as us, c as ms, u as fs, d as vs, e as Ts } from "./surface-DImNM7I1.js";
|
|
19
19
|
function e(a, s, t) {
|
|
20
|
-
a.component(s,
|
|
20
|
+
a.component(s, la(s, t));
|
|
21
21
|
}
|
|
22
22
|
function ca(a) {
|
|
23
|
-
e(a, "BaseOverlay", o), e(a, "GAlert", i), e(a, "GAside", n), e(a, "GAsideGroup", G), e(a, "GAsideItem",
|
|
23
|
+
e(a, "BaseOverlay", o), e(a, "GAlert", i), e(a, "GAside", n), e(a, "GAsideGroup", G), e(a, "GAsideItem", d), e(a, "GBadge", l), e(a, "GButton", K), e(a, "GCheckbox", c), e(a, "GCheckboxGroup", u), e(a, "GChip", m), e(a, "GDrawer", f), e(a, "GDropdownGroup", v), e(a, "GExpansion", T), e(a, "GExpansionGroup", b), e(a, "GFAB", _), e(a, "GForm", g), e(a, "GGradient", W), e(a, "GIcon", X), e(a, "GInput", M), e(a, "GLoading", Q), e(a, "GMenu", S), e(a, "GModal", k), e(a, "GNavbar", x), e(a, "GNavbarItem", C), e(a, "GNavbarMenu", h), e(a, "GNavbarSubItem", D), e(a, "GNavGroup", A), e(a, "GNavItem", I), e(a, "GNavList", N), e(a, "GProgress", z), e(a, "GQuickActions", E), e(a, "GRadio", P), e(a, "GSelect", L), e(a, "GSnackbar", Y), e(a, "GSquircle", B), e(a, "GSwitch", O), e(a, "GTab", F), e(a, "GTabList", R), e(a, "GTabPanel", $), e(a, "GTabPanels", w), e(a, "GTable", y), e(a, "GTabs", H), e(a, "GText", V), e(a, "GTextarea", q), e(a, "GTooltip", oa), e(a, "GTransition", J), e(a, "GTransitionGroup", U), e(a, "GExpandTransition", j);
|
|
24
24
|
}
|
|
25
25
|
function ua(a) {
|
|
26
26
|
return a == null || a === !1 ? {} : typeof a == "string" || typeof a == "number" ? {
|
|
@@ -38,7 +38,7 @@ function ma(a = {}) {
|
|
|
38
38
|
...t.defaults ?? {}
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
da(s, r.defaults), ca(s), s.directive("gradient-icon", Z), s.directive("gradient-text", p), s.directive("loading", aa), s.directive("mask", ea), s.directive("ripple", sa), s.directive("specular", ra), s.directive("tooltip", ta), r.icons !== !1 && ia(
|
|
42
42
|
s,
|
|
43
43
|
typeof r.icons == "object" ? r.icons : void 0
|
|
44
44
|
), r.theme !== !1 && na(
|
|
@@ -48,7 +48,7 @@ function ma(a = {}) {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Sa = {
|
|
52
52
|
install(a, s = {}) {
|
|
53
53
|
var t, r;
|
|
54
54
|
(r = (t = ma(s)).install) == null || r.call(t, a);
|
|
@@ -57,146 +57,150 @@ const ka = {
|
|
|
57
57
|
export {
|
|
58
58
|
o as BaseOverlay,
|
|
59
59
|
ee as COLOR_SHADES,
|
|
60
|
-
Se as
|
|
60
|
+
Se as DEFAULT_GRADIENT_MORPH_BLEND_MODE,
|
|
61
|
+
ke as DEFAULT_SEED,
|
|
61
62
|
i as GAlert,
|
|
62
63
|
n as GAside,
|
|
63
64
|
G as GAsideGroup,
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
d as GAsideItem,
|
|
66
|
+
l as GBadge,
|
|
66
67
|
K as GButton,
|
|
67
68
|
c as GCheckbox,
|
|
68
69
|
u as GCheckboxGroup,
|
|
69
70
|
m as GChip,
|
|
70
71
|
f as GDrawer,
|
|
71
72
|
v as GDropdownGroup,
|
|
72
|
-
|
|
73
|
+
j as GExpandTransition,
|
|
73
74
|
T as GExpansion,
|
|
74
75
|
b as GExpansionGroup,
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
_ as GFAB,
|
|
77
|
+
g as GForm,
|
|
77
78
|
W as GGradient,
|
|
78
79
|
Ca as GGradientMaterial,
|
|
79
80
|
X as GIcon,
|
|
80
|
-
|
|
81
|
+
M as GInput,
|
|
81
82
|
Q as GLoading,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
S as GMenu,
|
|
84
|
+
k as GModal,
|
|
85
|
+
A as GNavGroup,
|
|
86
|
+
I as GNavItem,
|
|
86
87
|
N as GNavList,
|
|
87
|
-
|
|
88
|
+
x as GNavbar,
|
|
88
89
|
C as GNavbarItem,
|
|
89
90
|
h as GNavbarMenu,
|
|
90
|
-
|
|
91
|
+
D as GNavbarSubItem,
|
|
91
92
|
z as GProgress,
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
E as GQuickActions,
|
|
94
|
+
xe as GRADIENT_MORPH_BLEND_MODES,
|
|
95
|
+
P as GRadio,
|
|
94
96
|
L as GSelect,
|
|
95
97
|
Y as GSnackbar,
|
|
96
98
|
B as GSquircle,
|
|
97
99
|
O as GSwitch,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
F as GTab,
|
|
101
|
+
R as GTabList,
|
|
102
|
+
$ as GTabPanel,
|
|
103
|
+
w as GTabPanels,
|
|
104
|
+
y as GTable,
|
|
103
105
|
H as GTabs,
|
|
104
106
|
V as GText,
|
|
105
107
|
q as GTextarea,
|
|
106
108
|
oa as GTooltip,
|
|
107
109
|
J as GTransition,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
U as GTransitionGroup,
|
|
111
|
+
Sa as GradientUI,
|
|
110
112
|
se as ON_SHADE_TONES,
|
|
111
|
-
|
|
113
|
+
Gs as SEMANTIC_COLORS,
|
|
112
114
|
re as SHADE_TONES,
|
|
113
115
|
Na as applyMask,
|
|
114
116
|
te as colorToHex,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
me as createColorSystem,
|
|
118
|
+
Ze as createDefaultDarkTheme,
|
|
119
|
+
pe as createDefaultLightTheme,
|
|
120
|
+
as as createDefaultTheme,
|
|
121
|
+
ts as createDefaults,
|
|
122
|
+
Ce as createGradient,
|
|
123
|
+
he as createGradientFromColor,
|
|
124
|
+
De as createGradientMaterial,
|
|
125
|
+
Ae as createGradientModel,
|
|
126
|
+
Ie as createGradientModelFromColor,
|
|
127
|
+
Ne as createGradientMorphBlobs,
|
|
128
|
+
Ee as createGradientPreset,
|
|
129
|
+
Pe as createGradientTokens,
|
|
128
130
|
ma as createGradientUI,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
$a as createIcons,
|
|
132
|
+
Le as createLinearGradient,
|
|
131
133
|
oe as createOnPalette,
|
|
132
134
|
ie as createPalette,
|
|
133
135
|
ne as createPalettePair,
|
|
134
|
-
|
|
136
|
+
fe as createSemanticTokens,
|
|
135
137
|
Ga as createTheme,
|
|
136
|
-
|
|
138
|
+
Sa as default,
|
|
137
139
|
Oa as defaultBreakpoints,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
Ea as defaultMaskTokens,
|
|
141
|
+
Be as defineGradientPreset,
|
|
142
|
+
Oe as defineGradientPresetRegistry,
|
|
141
143
|
Ge as getContrastingColor,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
Fe as getGradientPreset,
|
|
145
|
+
ve as gradientAnimation,
|
|
146
|
+
Te as gradientCore,
|
|
147
|
+
be as gradientEffects,
|
|
148
|
+
_e as gradientFormatters,
|
|
149
|
+
ge as gradientMaterial,
|
|
150
|
+
Re as gradientPresets,
|
|
151
|
+
da as installDefaults,
|
|
150
152
|
ia as installIcons,
|
|
151
153
|
na as installTheme,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
$e as isGradientMorphBlendMode,
|
|
155
|
+
ds as makeColorProps,
|
|
156
|
+
ls as makeGlassProps,
|
|
157
|
+
wa as makeMaterialProps,
|
|
158
|
+
ya as makeMaterialSurfaceProps,
|
|
156
159
|
Ha as makeTagNameProps,
|
|
157
160
|
Va as mountGradientCss,
|
|
158
161
|
qa as mountGradientMaterial,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
we as
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
Ua as mountGradientSvg,
|
|
163
|
+
de as parseColor,
|
|
164
|
+
os as provideDefaults,
|
|
165
|
+
ja as provideIcons,
|
|
166
|
+
es as provideTheme,
|
|
167
|
+
cs as resolveColorValue,
|
|
168
|
+
we as resolveGradientMorphBlendMode,
|
|
169
|
+
us as resolveGradientValue,
|
|
170
|
+
ms as resolveOnColorValue,
|
|
171
|
+
le as rgbToChannels,
|
|
168
172
|
ce as rgbToHex,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
173
|
+
ye as toCanvasGradient,
|
|
174
|
+
He as toCssGradient,
|
|
175
|
+
Ve as toGradientAnimationCSS,
|
|
176
|
+
qe as toGradientBoxShadow,
|
|
177
|
+
Ue as toGradientDropShadow,
|
|
178
|
+
je as toGradientMorphCSS,
|
|
179
|
+
Qe as toGradientMorphFilter,
|
|
180
|
+
ze as toGradientMorphFilterMarkup,
|
|
181
|
+
Je as toSvgGradient,
|
|
182
|
+
Ke as toSvgGradientMarkup,
|
|
183
|
+
We as toSvgPathAnimationMarkup,
|
|
184
|
+
Xe as toSvgSourceAnimationMarkup,
|
|
185
|
+
Pa as unmaskValue,
|
|
182
186
|
Qa as useAsLink,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
Fa as useBreakpoints,
|
|
188
|
+
fs as useColor,
|
|
189
|
+
is as useComponentDefaults,
|
|
190
|
+
vs as useGlass,
|
|
187
191
|
za as useGradientMaterial,
|
|
188
192
|
Ja as useGradientRuntime,
|
|
189
193
|
Ka as useIcon,
|
|
190
194
|
Wa as useIcons,
|
|
191
|
-
|
|
195
|
+
Da as useLoading,
|
|
192
196
|
La as useMask,
|
|
193
197
|
Xa as useMaterial,
|
|
194
198
|
Ya as useMaterialLayers,
|
|
195
199
|
Za as useMaterialSurface,
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
Ts as useResolveGradientValue,
|
|
201
|
+
Aa as useSnackbar,
|
|
198
202
|
pa as useTagName,
|
|
199
|
-
|
|
203
|
+
ss as useTheme,
|
|
200
204
|
Z as vGradientIcon,
|
|
201
205
|
p as vGradientText,
|
|
202
206
|
aa as vLoading,
|
|
@@ -204,5 +208,5 @@ export {
|
|
|
204
208
|
sa as vRipple,
|
|
205
209
|
ra as vSpecular,
|
|
206
210
|
ta as vTooltip,
|
|
207
|
-
|
|
211
|
+
la as withGradientDefaults
|
|
208
212
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as K, r as E, p as se } from "./surface-
|
|
1
|
+
import { b as K, r as E, p as se } from "./surface-DImNM7I1.js";
|
|
2
2
|
import { createLinearGradient as ke } from "@gradient-ui/gradient-engine";
|
|
3
3
|
import { createApp as ae, ref as v, computed as f, onMounted as Ee, onBeforeUnmount as z, watch as ue, defineComponent as ce, toRef as xe, openBlock as C, createElementBlock as Le, Fragment as we, createElementVNode as _, normalizeClass as Te, renderSlot as $, unref as y, createBlock as N, Teleport as Pe, createVNode as Ce, withCtx as D, withDirectives as W, normalizeStyle as H, vShow as U, mergeProps as I, createSlots as $e, toDisplayString as De, h as Be } from "vue";
|
|
4
|
-
import { _ as Se, m as Fe, a as j, b as le } from "./GLoading.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import { _ as Se, m as Fe, a as j, b as le } from "./GLoading.vue_vue_type_style_index_0_lang-COggAM7a.js";
|
|
5
5
|
import { offset as Me, flip as Ae, shift as Oe, size as Ie, useFloating as Ne, autoUpdate as Ve } from "@floating-ui/vue";
|
|
6
6
|
import { d as Re, a as ze } from "./index-Cs3XQ3JB.js";
|
|
7
7
|
const q = "var(--g-gradient-current, var(--g-gradient-main))", Ge = "135deg";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const y=require("./surface-8z3gR7vF.cjs"),de=require("@gradient-ui/gradient-engine"),o=require("vue"),b=require("./GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs"),_=require("@floating-ui/vue"),M=require("./index-DN5ngVtp.cjs"),O="var(--g-gradient-current, var(--g-gradient-main))",pe="135deg";function fe(){return new WeakMap}function Y(e){const t=fe();function n(i){const s=t.get(i);if(s){for(const[a,u]of s.targets)be(a,u);t.delete(i)}}function r(i,s){const a=ge(s,e);if(n(i),a.disabled)return;const u=ve(i,a.selector),c={targets:new Map};for(const l of u)c.targets.set(l,_e(l)),ke(l,a.gradient);t.set(i,c)}return{mounted(i,s){r(i,s.value)},updated(i,s){r(i,s.value)},unmounted(i){n(i)}}}function ge(e,t){if(typeof e=="string")return{gradient:y.resolveGradientValue(e),disabled:!1,selector:t};if(!e)return{gradient:O,disabled:!1,selector:t};const n=me(e);return{gradient:e.gradient??(n.length?ye(n,e.direction):void 0)??y.resolveGradientValue(e.state??e.color)??O,disabled:e.disabled??!1,selector:e.selector??t}}function me(e){var t;return(t=e.colors)!=null&&t.length?e.colors:[e.from,e.to].filter(n=>!!n)}function ye(e,t=pe){const n=e.length===1?[e[0],e[0]]:e;return de.createLinearGradient(n.map(r=>y.resolveColorValue(r)),t)}function ve(e,t){if(!t)return[e];const n=[];return e.matches(t)&&n.push(e),n.push(...Array.from(e.querySelectorAll(t))),n}function _e(e){return{backgroundClip:e.style.backgroundClip,backgroundImage:e.style.backgroundImage,color:e.style.color,webkitBackgroundClip:e.style.getPropertyValue("-webkit-background-clip"),webkitTextFillColor:e.style.getPropertyValue("-webkit-text-fill-color")}}function be(e,t){e.style.backgroundClip=t.backgroundClip,e.style.backgroundImage=t.backgroundImage,e.style.color=t.color,e.style.setProperty("-webkit-background-clip",t.webkitBackgroundClip),e.style.setProperty("-webkit-text-fill-color",t.webkitTextFillColor)}function ke(e,t){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")}const he=Y(),Ee=Y(".mdi");function xe(e){const t=e==null?void 0:e.isVisible;return typeof t=="object"&&t!==null&&"value"in t?!!t.value:!!t}const we={active:!1,text:"Loading...",noText:!1,color:"primary",dark:!1,opacity:void 0,blur:void 0,progressView:"glow"};function Le(e,t={}){const n=typeof e=="object"&&e!==null?e:{},r=typeof e=="boolean"?e:n.active??n.value??!1;return{...we,...n,active:r,dark:n.dark??!!t.dark,noText:n.noText??!!t.noText}}function J(e){return JSON.stringify({text:e.text,noText:e.noText,color:e.color,dark:e.dark,opacity:e.opacity,blur:e.blur,progressView:e.progressView})}function Te(e){return["relative","absolute","fixed","sticky"].includes(getComputedStyle(e).position)}function Ce(e){Te(e)||(e.style.position="relative")}function P(e){var n,r;const t=e.__gLoading__;t&&((n=t.app)==null||n.unmount(),(r=t.container)==null||r.remove(),t.app=void 0,t.container=void 0,t.component=void 0,t.optionsKey=void 0,e.style.position=t.originalPosition)}function Pe(e){const t=e.__gLoading__;if(t){if(!t.component){P(e);return}t.component.hide()}}function Be(e,t){const n=e.__gLoading__;if(!n)return;Ce(e);const r=document.createElement("div");r.className="g-loading__container";const i=o.createApp(b._sfc_main,{text:t.text,noText:t.noText,color:t.color,dark:t.dark,opacity:t.opacity,blur:t.blur,progressView:t.progressView,onClose:()=>{xe(n.component)||P(e)}});n.app=i,n.container=r,n.optionsKey=J(t),e.appendChild(r),n.component=i.mount(r),n.component.show()}function I(e,t,n){var a;const r=e.__gLoading__;if(!r)return;const i=Le(t,n),s=J(i);if(!i.active){Pe(e);return}if(r.app&&r.optionsKey===s){(a=r.component)==null||a.show();return}P(e),Be(e,i)}const $e={mounted(e,t){e.__gLoading__={originalPosition:e.style.position},I(e,t.value,t.modifiers)},updated(e,t){t.value===t.oldValue&&(typeof t.value!="object"||t.value===null)||I(e,t.value,t.modifiers)},unmounted(e){P(e),delete e.__gLoading__}},h={center:!1,color:"currentcolor",disabled:!1,duration:520,easing:"var(--g-token-easing-standard)",opacity:.16};function Z(e){if(typeof e=="boolean")return{...h,disabled:!e};if(typeof e=="string")return{...h,color:y.resolveColorValue(e)};const t=e!=null&&e.color?y.resolveColorValue(e.color):h.color;return{...h,...e,color:t}}function Se(e){getComputedStyle(e).position==="static"&&(e.style.position="relative")}function Ve(e){return typeof e=="number"?`${e}ms`:e}function De(e){if(typeof e=="number")return e;const t=e.trim();if(t.endsWith("ms"))return Number.parseFloat(t);if(t.endsWith("s"))return Number.parseFloat(t)*1e3;const n=Number.parseFloat(t);return Number.isNaN(n)?Number(h.duration):n}function Fe(e,t,n){const r=e.getBoundingClientRect(),i=Math.hypot(r.width,r.height)*2,s=t.x-r.left-i/2,a=t.y-r.top-i/2,u=document.createElement("span"),c=document.createElement("span");return u.className="g-ripple__container",u.style.setProperty("--g-ripple-color",n.color),u.style.setProperty("--g-ripple-duration",Ve(n.duration)),u.style.setProperty("--g-ripple-easing",n.easing),u.style.setProperty("--g-ripple-opacity",String(n.opacity)),c.className="g-ripple__animation",c.style.width=`${i}px`,c.style.height=`${i}px`,c.style.left=`${s}px`,c.style.top=`${a}px`,u.appendChild(c),e.appendChild(u),u}function Ne(e,t){var n;t.remove(),(n=e.__gRipple__)==null||n.ripples.delete(t)}function Q(e){const t=e.__gRipple__;if(t){for(const n of t.ripples)n.remove();t.ripples.clear()}}function R(e){const t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}function Ae(e){return e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.classList.contains("g-button_disabled")}function z(e,t,n){var i;if(n.disabled||Ae(e))return;Se(e);const r=Fe(e,t,n);(i=e.__gRipple__)==null||i.ripples.add(r),window.setTimeout(()=>Ne(e,r),De(n.duration))}function Me(e,t){if(e.__gRipple__){ee(e,t);return}const n=Z(t),r={originalPosition:e.style.position,options:n,onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||z(e,R(e),r.options)},onPointerDown:i=>{i.button!==0||e.hasAttribute("disabled")||z(e,r.options.center?R(e):{x:i.clientX,y:i.clientY},r.options)},ripples:new Set};e.addEventListener("pointerdown",r.onPointerDown),e.addEventListener("keydown",r.onKeyDown),e.__gRipple__=r}function ee(e,t){const n=e.__gRipple__;n&&(n.options=Z(t),n.options.disabled&&Q(e))}function Oe(e){const t=e.__gRipple__;t&&(e.removeEventListener("pointerdown",t.onPointerDown),e.removeEventListener("keydown",t.onKeyDown),Q(e),e.style.position=t.originalPosition,delete e.__gRipple__)}const Ie={mounted(e,t){Me(e,t.value)},updated(e,t){ee(e,t.value)},unmounted(e){Oe(e)}},T={color:"var(--g-color, var(--g-gradient-material-color, currentcolor))",disabled:!1,duration:180,easing:"var(--g-token-easing-standard)",opacity:.28,size:"140px"};function te(e){if(typeof e=="boolean")return{...T,disabled:!e};if(typeof e=="string")return{...T,color:y.resolveColorValue(e)};const t=e!=null&&e.color?y.resolveColorValue(e.color):T.color;return{...T,...e,color:t}}function Re(e){getComputedStyle(e).position==="static"&&(e.style.position="relative")}function ze(e){return typeof e=="number"?`${e}px`:e}function Ge(e){return typeof e=="number"?`${e}ms`:e}function Ue(e){return e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.classList.contains("g-button_disabled")}function ne(e,t){e.style.setProperty("--g-specular-color",t.color),e.style.setProperty("--g-specular-size",ze(t.size)),e.style.setProperty("--g-specular-duration",Ge(t.duration)),e.style.setProperty("--g-specular-easing",t.easing),e.style.setProperty("--g-specular-max-opacity",String(t.opacity))}function G(e,t,n){const r=e.getBoundingClientRect();e.style.setProperty("--g-specular-x",`${t-r.left}px`),e.style.setProperty("--g-specular-y",`${n-r.top}px`)}function U(e){const t=e.getBoundingClientRect();e.style.setProperty("--g-specular-x",`${t.width/2}px`),e.style.setProperty("--g-specular-y",`${t.height/2}px`)}function K(e){const t=e.__gSpecular__;!t||t.options.disabled||Ue(e)||e.setAttribute("data-g-specular-active","true")}function C(e){e.removeAttribute("data-g-specular-active")}function Ke(){const e=document.createElement("span"),t=document.createElement("span");return e.className="g-specular__container",t.className="g-specular__highlight",e.appendChild(t),{containerEl:e,highlightEl:t}}function W(e,t){if(e.__gSpecular__){We(e,t);return}const n=te(t),{containerEl:r,highlightEl:i}=Ke();Re(e),ne(e,n),U(e),e.classList.add("g-specular"),e.appendChild(r);const s={containerEl:r,highlightEl:i,options:n,originalPosition:e.style.position,onBlur:()=>C(e),onFocus:()=>{U(e),K(e)},onPointerEnter:a=>{G(e,a.clientX,a.clientY),K(e)},onPointerLeave:()=>C(e),onPointerMove:a=>{G(e,a.clientX,a.clientY)}};e.addEventListener("blur",s.onBlur),e.addEventListener("focus",s.onFocus),e.addEventListener("pointerenter",s.onPointerEnter),e.addEventListener("pointerleave",s.onPointerLeave),e.addEventListener("pointermove",s.onPointerMove),e.__gSpecular__=s}function We(e,t){const n=e.__gSpecular__;n&&(n.options=te(t),ne(e,n.options),n.options.disabled&&C(e))}function q(e){const t=e.__gSpecular__;t&&(e.removeEventListener("blur",t.onBlur),e.removeEventListener("focus",t.onFocus),e.removeEventListener("pointerenter",t.onPointerEnter),e.removeEventListener("pointerleave",t.onPointerLeave),e.removeEventListener("pointermove",t.onPointerMove),t.containerEl.remove(),e.classList.remove("g-specular"),C(e),e.style.position=t.originalPosition,e.style.removeProperty("--g-specular-color"),e.style.removeProperty("--g-specular-duration"),e.style.removeProperty("--g-specular-easing"),e.style.removeProperty("--g-specular-max-opacity"),e.style.removeProperty("--g-specular-size"),e.style.removeProperty("--g-specular-x"),e.style.removeProperty("--g-specular-y"),delete e.__gSpecular__)}const qe={mounted(e,t){t.value!==!1&&W(e,t.value)},updated(e,t){if(t.value===!1){q(e);return}W(e,t.value)},unmounted(e){q(e)}},N=y.propsFactory({...b.makeTransitionProps(),modelValue:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},strategy:{type:String,default:"absolute"},offset:{type:Number,default:8},shift:{type:Boolean,default:!0},flip:{type:Boolean,default:!0},sameWidth:{type:Boolean,default:!1},referenceFullWidth:{type:Boolean,default:!1},appendTo:{type:String,default:""},zIndexBase:{type:Number,default:1e3},disabled:Boolean,content:String,reference:Object}),He=e=>{const t=o.ref(null),n=o.ref(null),r=o.computed(()=>{const l=[];return e.offset&&l.push(_.offset(e.offset)),e.flip&&l.push(_.flip()),e.shift&&l.push(_.shift({padding:4,crossAxis:!0})),e.sameWidth&&l.push(_.size({apply({rects:d,elements:p}){Object.assign(p.floating.style,{width:`${d.reference.width}px`})}})),l}),{x:i,y:s,strategy:a,placement:u,update:c}=_.useFloating(t,n,{...e,middleware:r,whileElementsMounted:_.autoUpdate});return{reference:t,floating:n,x:i,y:s,strategy:a,placement:u,update:c}};function oe(e){const t=o.computed(()=>!!e),n=o.computed(()=>e||"body");return{hasAppendTarget:t,appendTarget:n}}function re(e,t){const n=o.computed(()=>e.modelValue!==void 0),r=o.ref(e.defaultOpen??!1);return{open:o.computed({get(){return n.value?e.modelValue??!1:r.value},set(s){n.value||(r.value=s),t("update:modelValue",s)}}),isControlled:n}}function je(e){return e instanceof HTMLElement}function Xe(e){return!!e&&typeof e=="object"&&"$el"in e}function H(e){return e?je(e)?e:Xe(e)?e.$el:null:null}function Ye({open:e,reference:t,floating:n,escapeKey:r=!0,outsideClick:i=!0}){if(!e||!t||!n)throw new Error("useDismiss: open, reference, and floating are required");const s=u=>{if(!i)return;const c=H(t.value),l=H(n.value),d=u.target;c&&l&&!c.contains(d)&&!l.contains(d)&&(e.value=!1)},a=u=>{r&&u.key==="Escape"&&(e.value=!1)};o.onMounted(()=>{document.addEventListener("click",s),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",a)})}let Je=0;const m=[],ie=o.ref(null);function j(e){const t=m.find(i=>i.id===e);if(!t)return;const r=m.filter(i=>i.kind===t.kind).findIndex(i=>i.id===e);return t.base+r+1}function D(){const e=[...m].reverse().find(t=>t.kind==="overlay"&&t.open.value);ie.value=(e==null?void 0:e.id)??null}function X(e){const t=m.findIndex(r=>r.id===e);if(t===-1)return;const[n]=m.splice(t,1);m.push(n),D()}function se(e){const{open:t,base:n=1e3,kind:r="floating"}=e,i=++Je,s=o.ref();function a(){m.findIndex(g=>g.id===i)===-1?m.push({id:i,kind:r,base:n,open:t}):X(i),s.value=j(i),D()}function u(){const p=m.findIndex(g=>g.id===i);p!==-1&&m.splice(p,1),s.value=void 0,D()}function c(){t.value&&(X(i),s.value=j(i))}const l=o.computed(()=>{var g;return((g=m.filter(v=>v.kind===r).at(-1))==null?void 0:g.id)===i}),d=o.computed(()=>r==="overlay"&&ie.value===i);return o.watch(t,p=>{p?a():u()},{immediate:!0}),o.onBeforeUnmount(()=>{u()}),{id:i,zIndex:s,isTop:l,isTopOverlay:d,bringToFront:c}}const Ze=o.defineComponent({__name:"BaseFloating",props:N(),emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=o.toRef(n,"reference"),i=t,{open:s}=re(n,i),{hasAppendTarget:a,appendTarget:u}=oe(n.appendTo),c=o.ref(!1),l=o.computed(()=>s.value||c.value),{reference:d,floating:p,x:g,y:v,strategy:B,update:$}=He(n);Ye({open:s,reference:d,floating:p});const{zIndex:E}=se({open:l,base:n.zIndexBase,kind:"floating"}),k=o.computed(()=>({position:B.value,top:v.value!=null?`${v.value}px`:"",left:g.value!=null?`${g.value}px`:"",minWidth:n.sameWidth&&d.value instanceof HTMLElement?`${d.value.offsetWidth}px`:void 0,zIndex:E.value}));function S(f){f&&("$el"in f||f instanceof HTMLElement)?d.value=f:(d.value=n.reference,$())}function x(){c.value=!0}function w(){c.value=!1}function L(){c.value=!1}return o.watch(r,f=>{f&&(d.value=f)},{deep:!0,immediate:!0}),(f,V)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{class:o.normalizeClass(["base-floating__reference",{"base-floating__reference_full":n.referenceFullWidth}])},[o.renderSlot(f.$slots,"reference",{ref:S},void 0,!0)],2),o.unref(a)?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:o.unref(u)},[o.createVNode(o.unref(b._sfc_main$1),{transition:n.transition,name:"scale",onBeforeLeave:x,onAfterLeave:w,onLeaveCancelled:L},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"floating",ref:p,style:o.normalizeStyle(k.value)},[o.renderSlot(f.$slots,"default",{},void 0,!0)],4),[[o.vShow,o.unref(s)]])]),_:3},8,["transition"])],8,["to"])):(o.openBlock(),o.createBlock(o.unref(b._sfc_main$1),{key:1,transition:n.transition,name:"scale",onBeforeLeave:x,onAfterLeave:w,onLeaveCancelled:L},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"floating",ref:p,style:o.normalizeStyle(k.value)},[o.renderSlot(f.$slots,"default",{},void 0,!0)],4),[[o.vShow,o.unref(s)]])]),_:3},8,["transition"]))],64))}}),ae=b._export_sfc(Ze,[["__scopeId","data-v-d9f4cacd"]]),Qe=y.propsFactory({...N(),openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0}});function ue(e,t){const{click:n,hover:r,focus:i,contextmenu:s,disabled:a=!1}=t;let u=null,c=null;function l(){u&&clearTimeout(u),c&&clearTimeout(c),u=null,c=null}function d(f,V=0){if(l(),V===0){e.value=f;return}const A=window.setTimeout(()=>{e.value=f},V);f?u=A:c=A}const p=typeof r=="object"?r:{},g=p.openDelay??0,v=p.closeDelay??0;function B(){a||!n||(e.value=!e.value)}function $(f){a||!s||(f.preventDefault(),e.value=!0)}function E(){a||!r||d(!0,g)}function k(){r&&d(!1,v)}function S(){a||!i||(e.value=!0)}function x(){i&&(e.value=!1)}o.onBeforeUnmount(l);const w=o.computed(()=>({...n?{onClick:B}:{},...s?{onContextmenu:$}:{},...r?{onMouseenter:E,onMouseleave:k}:{},...i?{onFocus:S,onBlur:x}:{}})),L=o.computed(()=>({...r?{onMouseenter:E,onMouseleave:k}:{}}));return{triggerAttrs:w,floatingAttrs:L}}const et={class:"g-tooltip__content"},tt=o.defineComponent({__name:"GTooltip",props:Qe(),setup(e,{expose:t}){const n=e,r=o.ref(!1),i=o.computed(()=>n.transition??{name:"scale-only",scale:.96}),{triggerAttrs:s,floatingAttrs:a}=ue(r,{hover:{openDelay:n.openDelay,closeDelay:n.closeDelay},focus:!0});function u(){r.value=!1}function c(){r.value=!0}return t({hide:u,show:c,open:r}),(l,d)=>(o.openBlock(),o.createBlock(o.unref(ae),o.mergeProps(n,{"model-value":r.value,"onUpdate:modelValue":d[0]||(d[0]=p=>r.value=p),transition:i.value}),o.createSlots({default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({class:"g-tooltip"},o.unref(a),{role:"tooltip"}),[d[1]||(d[1]=o.createElementVNode("div",{class:"g-tooltip__underlay"},null,-1)),o.createElementVNode("span",et,o.toDisplayString(n.content),1)],16)]),_:2},[l.$slots.default?{name:"reference",fn:o.withCtx(({ref:p})=>[o.createElementVNode("div",o.mergeProps({ref:p,class:"g-tooltip__trigger",tabindex:"0"},o.unref(s)),[o.renderSlot(l.$slots,"default",{},void 0,!0)],16)]),key:"0"}:void 0]),1040,["model-value","transition"]))}}),ce=b._export_sfc(tt,[["__scopeId","data-v-578012d6"]]),nt={mounted(e,t){if(!t.value)return;const n=typeof t.value=="string"?{content:t.value}:t.value,r=o.ref(!1),i=document.createElement("div");document.body.appendChild(i);const s=o.ref(null),a=o.createApp({setup(){return()=>o.h(ce,{...n,reference:e,ref:l=>{l&&(s.value=l)}},{reference:({ref:l})=>(l(e),e)})}});a.mount(i);const u=()=>{s.value&&s.value.show()},c=()=>{s.value&&s.value.hide()};e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",c),e.addEventListener("focus",u),e.addEventListener("blur",c),e.__tooltip__={app:a,container:i,open:r,cleanup(){e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",c),e.removeEventListener("focus",u),e.removeEventListener("blur",c),a.unmount(),i.remove()}}},unmounted(e){var t;(t=e.__tooltip__)==null||t.cleanup()}};function ot(e){return typeof e=="string"||Array.isArray(e)||e===void 0?{mask:e}:e}function le(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:e.querySelector("input, textarea")}function F(e,t){const n=le(e);if(!n)return;const r=ot(t.value),i={...M.defaultMaskTokens,...r.tokens??{}},s=M.applyMask(n.value,r.mask,i);n.value!==s&&(n.value=s)}function rt(e,t){const n=le(e);if(!n)return;const r=()=>{e._gMaskFormatting||(e._gMaskFormatting=!0,F(e,t),n.dispatchEvent(new Event("input",{bubbles:!0})),e._gMaskFormatting=!1)};n.addEventListener("input",r),e._gMaskCleanup=()=>{n.removeEventListener("input",r)},F(e,t)}const it={mounted:rt,updated(e,t){F(e,t)},beforeUnmount(e){var t;(t=e._gMaskCleanup)==null||t.call(e),delete e._gMaskCleanup,delete e._gMaskFormatting}};exports.BaseFloating=ae;exports.GTooltip=ce;exports.gradientIcon=Ee;exports.loading=$e;exports.makeFloatingProps=N;exports.ripple=Ie;exports.specular=qe;exports.useAppendTarget=oe;exports.useControllableOpen=re;exports.useLayerStack=se;exports.useTriggerFactory=ue;exports.vGradientText=he;exports.vMask=it;exports.vTooltip=nt;
|
|
1
|
+
"use strict";const y=require("./surface-_J0t7c3m.cjs"),de=require("@gradient-ui/gradient-engine"),o=require("vue"),b=require("./GLoading.vue_vue_type_style_index_0_lang-CoPHejAL.cjs"),_=require("@floating-ui/vue"),M=require("./index-DN5ngVtp.cjs"),O="var(--g-gradient-current, var(--g-gradient-main))",pe="135deg";function fe(){return new WeakMap}function Y(e){const t=fe();function n(i){const s=t.get(i);if(s){for(const[a,u]of s.targets)be(a,u);t.delete(i)}}function r(i,s){const a=ge(s,e);if(n(i),a.disabled)return;const u=ve(i,a.selector),c={targets:new Map};for(const l of u)c.targets.set(l,_e(l)),ke(l,a.gradient);t.set(i,c)}return{mounted(i,s){r(i,s.value)},updated(i,s){r(i,s.value)},unmounted(i){n(i)}}}function ge(e,t){if(typeof e=="string")return{gradient:y.resolveGradientValue(e),disabled:!1,selector:t};if(!e)return{gradient:O,disabled:!1,selector:t};const n=me(e);return{gradient:e.gradient??(n.length?ye(n,e.direction):void 0)??y.resolveGradientValue(e.state??e.color)??O,disabled:e.disabled??!1,selector:e.selector??t}}function me(e){var t;return(t=e.colors)!=null&&t.length?e.colors:[e.from,e.to].filter(n=>!!n)}function ye(e,t=pe){const n=e.length===1?[e[0],e[0]]:e;return de.createLinearGradient(n.map(r=>y.resolveColorValue(r)),t)}function ve(e,t){if(!t)return[e];const n=[];return e.matches(t)&&n.push(e),n.push(...Array.from(e.querySelectorAll(t))),n}function _e(e){return{backgroundClip:e.style.backgroundClip,backgroundImage:e.style.backgroundImage,color:e.style.color,webkitBackgroundClip:e.style.getPropertyValue("-webkit-background-clip"),webkitTextFillColor:e.style.getPropertyValue("-webkit-text-fill-color")}}function be(e,t){e.style.backgroundClip=t.backgroundClip,e.style.backgroundImage=t.backgroundImage,e.style.color=t.color,e.style.setProperty("-webkit-background-clip",t.webkitBackgroundClip),e.style.setProperty("-webkit-text-fill-color",t.webkitTextFillColor)}function ke(e,t){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")}const he=Y(),Ee=Y(".mdi");function xe(e){const t=e==null?void 0:e.isVisible;return typeof t=="object"&&t!==null&&"value"in t?!!t.value:!!t}const we={active:!1,text:"Loading...",noText:!1,color:"primary",dark:!1,opacity:void 0,blur:void 0,progressView:"glow"};function Le(e,t={}){const n=typeof e=="object"&&e!==null?e:{},r=typeof e=="boolean"?e:n.active??n.value??!1;return{...we,...n,active:r,dark:n.dark??!!t.dark,noText:n.noText??!!t.noText}}function J(e){return JSON.stringify({text:e.text,noText:e.noText,color:e.color,dark:e.dark,opacity:e.opacity,blur:e.blur,progressView:e.progressView})}function Te(e){return["relative","absolute","fixed","sticky"].includes(getComputedStyle(e).position)}function Ce(e){Te(e)||(e.style.position="relative")}function P(e){var n,r;const t=e.__gLoading__;t&&((n=t.app)==null||n.unmount(),(r=t.container)==null||r.remove(),t.app=void 0,t.container=void 0,t.component=void 0,t.optionsKey=void 0,e.style.position=t.originalPosition)}function Pe(e){const t=e.__gLoading__;if(t){if(!t.component){P(e);return}t.component.hide()}}function Be(e,t){const n=e.__gLoading__;if(!n)return;Ce(e);const r=document.createElement("div");r.className="g-loading__container";const i=o.createApp(b._sfc_main,{text:t.text,noText:t.noText,color:t.color,dark:t.dark,opacity:t.opacity,blur:t.blur,progressView:t.progressView,onClose:()=>{xe(n.component)||P(e)}});n.app=i,n.container=r,n.optionsKey=J(t),e.appendChild(r),n.component=i.mount(r),n.component.show()}function I(e,t,n){var a;const r=e.__gLoading__;if(!r)return;const i=Le(t,n),s=J(i);if(!i.active){Pe(e);return}if(r.app&&r.optionsKey===s){(a=r.component)==null||a.show();return}P(e),Be(e,i)}const $e={mounted(e,t){e.__gLoading__={originalPosition:e.style.position},I(e,t.value,t.modifiers)},updated(e,t){t.value===t.oldValue&&(typeof t.value!="object"||t.value===null)||I(e,t.value,t.modifiers)},unmounted(e){P(e),delete e.__gLoading__}},h={center:!1,color:"currentcolor",disabled:!1,duration:520,easing:"var(--g-token-easing-standard)",opacity:.16};function Z(e){if(typeof e=="boolean")return{...h,disabled:!e};if(typeof e=="string")return{...h,color:y.resolveColorValue(e)};const t=e!=null&&e.color?y.resolveColorValue(e.color):h.color;return{...h,...e,color:t}}function Se(e){getComputedStyle(e).position==="static"&&(e.style.position="relative")}function Ve(e){return typeof e=="number"?`${e}ms`:e}function De(e){if(typeof e=="number")return e;const t=e.trim();if(t.endsWith("ms"))return Number.parseFloat(t);if(t.endsWith("s"))return Number.parseFloat(t)*1e3;const n=Number.parseFloat(t);return Number.isNaN(n)?Number(h.duration):n}function Fe(e,t,n){const r=e.getBoundingClientRect(),i=Math.hypot(r.width,r.height)*2,s=t.x-r.left-i/2,a=t.y-r.top-i/2,u=document.createElement("span"),c=document.createElement("span");return u.className="g-ripple__container",u.style.setProperty("--g-ripple-color",n.color),u.style.setProperty("--g-ripple-duration",Ve(n.duration)),u.style.setProperty("--g-ripple-easing",n.easing),u.style.setProperty("--g-ripple-opacity",String(n.opacity)),c.className="g-ripple__animation",c.style.width=`${i}px`,c.style.height=`${i}px`,c.style.left=`${s}px`,c.style.top=`${a}px`,u.appendChild(c),e.appendChild(u),u}function Ne(e,t){var n;t.remove(),(n=e.__gRipple__)==null||n.ripples.delete(t)}function Q(e){const t=e.__gRipple__;if(t){for(const n of t.ripples)n.remove();t.ripples.clear()}}function R(e){const t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}function Ae(e){return e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.classList.contains("g-button_disabled")}function z(e,t,n){var i;if(n.disabled||Ae(e))return;Se(e);const r=Fe(e,t,n);(i=e.__gRipple__)==null||i.ripples.add(r),window.setTimeout(()=>Ne(e,r),De(n.duration))}function Me(e,t){if(e.__gRipple__){ee(e,t);return}const n=Z(t),r={originalPosition:e.style.position,options:n,onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||z(e,R(e),r.options)},onPointerDown:i=>{i.button!==0||e.hasAttribute("disabled")||z(e,r.options.center?R(e):{x:i.clientX,y:i.clientY},r.options)},ripples:new Set};e.addEventListener("pointerdown",r.onPointerDown),e.addEventListener("keydown",r.onKeyDown),e.__gRipple__=r}function ee(e,t){const n=e.__gRipple__;n&&(n.options=Z(t),n.options.disabled&&Q(e))}function Oe(e){const t=e.__gRipple__;t&&(e.removeEventListener("pointerdown",t.onPointerDown),e.removeEventListener("keydown",t.onKeyDown),Q(e),e.style.position=t.originalPosition,delete e.__gRipple__)}const Ie={mounted(e,t){Me(e,t.value)},updated(e,t){ee(e,t.value)},unmounted(e){Oe(e)}},T={color:"var(--g-color, var(--g-gradient-material-color, currentcolor))",disabled:!1,duration:180,easing:"var(--g-token-easing-standard)",opacity:.28,size:"140px"};function te(e){if(typeof e=="boolean")return{...T,disabled:!e};if(typeof e=="string")return{...T,color:y.resolveColorValue(e)};const t=e!=null&&e.color?y.resolveColorValue(e.color):T.color;return{...T,...e,color:t}}function Re(e){getComputedStyle(e).position==="static"&&(e.style.position="relative")}function ze(e){return typeof e=="number"?`${e}px`:e}function Ge(e){return typeof e=="number"?`${e}ms`:e}function Ue(e){return e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.classList.contains("g-button_disabled")}function ne(e,t){e.style.setProperty("--g-specular-color",t.color),e.style.setProperty("--g-specular-size",ze(t.size)),e.style.setProperty("--g-specular-duration",Ge(t.duration)),e.style.setProperty("--g-specular-easing",t.easing),e.style.setProperty("--g-specular-max-opacity",String(t.opacity))}function G(e,t,n){const r=e.getBoundingClientRect();e.style.setProperty("--g-specular-x",`${t-r.left}px`),e.style.setProperty("--g-specular-y",`${n-r.top}px`)}function U(e){const t=e.getBoundingClientRect();e.style.setProperty("--g-specular-x",`${t.width/2}px`),e.style.setProperty("--g-specular-y",`${t.height/2}px`)}function K(e){const t=e.__gSpecular__;!t||t.options.disabled||Ue(e)||e.setAttribute("data-g-specular-active","true")}function C(e){e.removeAttribute("data-g-specular-active")}function Ke(){const e=document.createElement("span"),t=document.createElement("span");return e.className="g-specular__container",t.className="g-specular__highlight",e.appendChild(t),{containerEl:e,highlightEl:t}}function W(e,t){if(e.__gSpecular__){We(e,t);return}const n=te(t),{containerEl:r,highlightEl:i}=Ke();Re(e),ne(e,n),U(e),e.classList.add("g-specular"),e.appendChild(r);const s={containerEl:r,highlightEl:i,options:n,originalPosition:e.style.position,onBlur:()=>C(e),onFocus:()=>{U(e),K(e)},onPointerEnter:a=>{G(e,a.clientX,a.clientY),K(e)},onPointerLeave:()=>C(e),onPointerMove:a=>{G(e,a.clientX,a.clientY)}};e.addEventListener("blur",s.onBlur),e.addEventListener("focus",s.onFocus),e.addEventListener("pointerenter",s.onPointerEnter),e.addEventListener("pointerleave",s.onPointerLeave),e.addEventListener("pointermove",s.onPointerMove),e.__gSpecular__=s}function We(e,t){const n=e.__gSpecular__;n&&(n.options=te(t),ne(e,n.options),n.options.disabled&&C(e))}function q(e){const t=e.__gSpecular__;t&&(e.removeEventListener("blur",t.onBlur),e.removeEventListener("focus",t.onFocus),e.removeEventListener("pointerenter",t.onPointerEnter),e.removeEventListener("pointerleave",t.onPointerLeave),e.removeEventListener("pointermove",t.onPointerMove),t.containerEl.remove(),e.classList.remove("g-specular"),C(e),e.style.position=t.originalPosition,e.style.removeProperty("--g-specular-color"),e.style.removeProperty("--g-specular-duration"),e.style.removeProperty("--g-specular-easing"),e.style.removeProperty("--g-specular-max-opacity"),e.style.removeProperty("--g-specular-size"),e.style.removeProperty("--g-specular-x"),e.style.removeProperty("--g-specular-y"),delete e.__gSpecular__)}const qe={mounted(e,t){t.value!==!1&&W(e,t.value)},updated(e,t){if(t.value===!1){q(e);return}W(e,t.value)},unmounted(e){q(e)}},N=y.propsFactory({...b.makeTransitionProps(),modelValue:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},strategy:{type:String,default:"absolute"},offset:{type:Number,default:8},shift:{type:Boolean,default:!0},flip:{type:Boolean,default:!0},sameWidth:{type:Boolean,default:!1},referenceFullWidth:{type:Boolean,default:!1},appendTo:{type:String,default:""},zIndexBase:{type:Number,default:1e3},disabled:Boolean,content:String,reference:Object}),He=e=>{const t=o.ref(null),n=o.ref(null),r=o.computed(()=>{const l=[];return e.offset&&l.push(_.offset(e.offset)),e.flip&&l.push(_.flip()),e.shift&&l.push(_.shift({padding:4,crossAxis:!0})),e.sameWidth&&l.push(_.size({apply({rects:d,elements:p}){Object.assign(p.floating.style,{width:`${d.reference.width}px`})}})),l}),{x:i,y:s,strategy:a,placement:u,update:c}=_.useFloating(t,n,{...e,middleware:r,whileElementsMounted:_.autoUpdate});return{reference:t,floating:n,x:i,y:s,strategy:a,placement:u,update:c}};function oe(e){const t=o.computed(()=>!!e),n=o.computed(()=>e||"body");return{hasAppendTarget:t,appendTarget:n}}function re(e,t){const n=o.computed(()=>e.modelValue!==void 0),r=o.ref(e.defaultOpen??!1);return{open:o.computed({get(){return n.value?e.modelValue??!1:r.value},set(s){n.value||(r.value=s),t("update:modelValue",s)}}),isControlled:n}}function je(e){return e instanceof HTMLElement}function Xe(e){return!!e&&typeof e=="object"&&"$el"in e}function H(e){return e?je(e)?e:Xe(e)?e.$el:null:null}function Ye({open:e,reference:t,floating:n,escapeKey:r=!0,outsideClick:i=!0}){if(!e||!t||!n)throw new Error("useDismiss: open, reference, and floating are required");const s=u=>{if(!i)return;const c=H(t.value),l=H(n.value),d=u.target;c&&l&&!c.contains(d)&&!l.contains(d)&&(e.value=!1)},a=u=>{r&&u.key==="Escape"&&(e.value=!1)};o.onMounted(()=>{document.addEventListener("click",s),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",a)})}let Je=0;const m=[],ie=o.ref(null);function j(e){const t=m.find(i=>i.id===e);if(!t)return;const r=m.filter(i=>i.kind===t.kind).findIndex(i=>i.id===e);return t.base+r+1}function D(){const e=[...m].reverse().find(t=>t.kind==="overlay"&&t.open.value);ie.value=(e==null?void 0:e.id)??null}function X(e){const t=m.findIndex(r=>r.id===e);if(t===-1)return;const[n]=m.splice(t,1);m.push(n),D()}function se(e){const{open:t,base:n=1e3,kind:r="floating"}=e,i=++Je,s=o.ref();function a(){m.findIndex(g=>g.id===i)===-1?m.push({id:i,kind:r,base:n,open:t}):X(i),s.value=j(i),D()}function u(){const p=m.findIndex(g=>g.id===i);p!==-1&&m.splice(p,1),s.value=void 0,D()}function c(){t.value&&(X(i),s.value=j(i))}const l=o.computed(()=>{var g;return((g=m.filter(v=>v.kind===r).at(-1))==null?void 0:g.id)===i}),d=o.computed(()=>r==="overlay"&&ie.value===i);return o.watch(t,p=>{p?a():u()},{immediate:!0}),o.onBeforeUnmount(()=>{u()}),{id:i,zIndex:s,isTop:l,isTopOverlay:d,bringToFront:c}}const Ze=o.defineComponent({__name:"BaseFloating",props:N(),emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=o.toRef(n,"reference"),i=t,{open:s}=re(n,i),{hasAppendTarget:a,appendTarget:u}=oe(n.appendTo),c=o.ref(!1),l=o.computed(()=>s.value||c.value),{reference:d,floating:p,x:g,y:v,strategy:B,update:$}=He(n);Ye({open:s,reference:d,floating:p});const{zIndex:E}=se({open:l,base:n.zIndexBase,kind:"floating"}),k=o.computed(()=>({position:B.value,top:v.value!=null?`${v.value}px`:"",left:g.value!=null?`${g.value}px`:"",minWidth:n.sameWidth&&d.value instanceof HTMLElement?`${d.value.offsetWidth}px`:void 0,zIndex:E.value}));function S(f){f&&("$el"in f||f instanceof HTMLElement)?d.value=f:(d.value=n.reference,$())}function x(){c.value=!0}function w(){c.value=!1}function L(){c.value=!1}return o.watch(r,f=>{f&&(d.value=f)},{deep:!0,immediate:!0}),(f,V)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{class:o.normalizeClass(["base-floating__reference",{"base-floating__reference_full":n.referenceFullWidth}])},[o.renderSlot(f.$slots,"reference",{ref:S},void 0,!0)],2),o.unref(a)?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:o.unref(u)},[o.createVNode(o.unref(b._sfc_main$1),{transition:n.transition,name:"scale",onBeforeLeave:x,onAfterLeave:w,onLeaveCancelled:L},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"floating",ref:p,style:o.normalizeStyle(k.value)},[o.renderSlot(f.$slots,"default",{},void 0,!0)],4),[[o.vShow,o.unref(s)]])]),_:3},8,["transition"])],8,["to"])):(o.openBlock(),o.createBlock(o.unref(b._sfc_main$1),{key:1,transition:n.transition,name:"scale",onBeforeLeave:x,onAfterLeave:w,onLeaveCancelled:L},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"floating",ref:p,style:o.normalizeStyle(k.value)},[o.renderSlot(f.$slots,"default",{},void 0,!0)],4),[[o.vShow,o.unref(s)]])]),_:3},8,["transition"]))],64))}}),ae=b._export_sfc(Ze,[["__scopeId","data-v-d9f4cacd"]]),Qe=y.propsFactory({...N(),openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0}});function ue(e,t){const{click:n,hover:r,focus:i,contextmenu:s,disabled:a=!1}=t;let u=null,c=null;function l(){u&&clearTimeout(u),c&&clearTimeout(c),u=null,c=null}function d(f,V=0){if(l(),V===0){e.value=f;return}const A=window.setTimeout(()=>{e.value=f},V);f?u=A:c=A}const p=typeof r=="object"?r:{},g=p.openDelay??0,v=p.closeDelay??0;function B(){a||!n||(e.value=!e.value)}function $(f){a||!s||(f.preventDefault(),e.value=!0)}function E(){a||!r||d(!0,g)}function k(){r&&d(!1,v)}function S(){a||!i||(e.value=!0)}function x(){i&&(e.value=!1)}o.onBeforeUnmount(l);const w=o.computed(()=>({...n?{onClick:B}:{},...s?{onContextmenu:$}:{},...r?{onMouseenter:E,onMouseleave:k}:{},...i?{onFocus:S,onBlur:x}:{}})),L=o.computed(()=>({...r?{onMouseenter:E,onMouseleave:k}:{}}));return{triggerAttrs:w,floatingAttrs:L}}const et={class:"g-tooltip__content"},tt=o.defineComponent({__name:"GTooltip",props:Qe(),setup(e,{expose:t}){const n=e,r=o.ref(!1),i=o.computed(()=>n.transition??{name:"scale-only",scale:.96}),{triggerAttrs:s,floatingAttrs:a}=ue(r,{hover:{openDelay:n.openDelay,closeDelay:n.closeDelay},focus:!0});function u(){r.value=!1}function c(){r.value=!0}return t({hide:u,show:c,open:r}),(l,d)=>(o.openBlock(),o.createBlock(o.unref(ae),o.mergeProps(n,{"model-value":r.value,"onUpdate:modelValue":d[0]||(d[0]=p=>r.value=p),transition:i.value}),o.createSlots({default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({class:"g-tooltip"},o.unref(a),{role:"tooltip"}),[d[1]||(d[1]=o.createElementVNode("div",{class:"g-tooltip__underlay"},null,-1)),o.createElementVNode("span",et,o.toDisplayString(n.content),1)],16)]),_:2},[l.$slots.default?{name:"reference",fn:o.withCtx(({ref:p})=>[o.createElementVNode("div",o.mergeProps({ref:p,class:"g-tooltip__trigger",tabindex:"0"},o.unref(s)),[o.renderSlot(l.$slots,"default",{},void 0,!0)],16)]),key:"0"}:void 0]),1040,["model-value","transition"]))}}),ce=b._export_sfc(tt,[["__scopeId","data-v-578012d6"]]),nt={mounted(e,t){if(!t.value)return;const n=typeof t.value=="string"?{content:t.value}:t.value,r=o.ref(!1),i=document.createElement("div");document.body.appendChild(i);const s=o.ref(null),a=o.createApp({setup(){return()=>o.h(ce,{...n,reference:e,ref:l=>{l&&(s.value=l)}},{reference:({ref:l})=>(l(e),e)})}});a.mount(i);const u=()=>{s.value&&s.value.show()},c=()=>{s.value&&s.value.hide()};e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",c),e.addEventListener("focus",u),e.addEventListener("blur",c),e.__tooltip__={app:a,container:i,open:r,cleanup(){e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",c),e.removeEventListener("focus",u),e.removeEventListener("blur",c),a.unmount(),i.remove()}}},unmounted(e){var t;(t=e.__tooltip__)==null||t.cleanup()}};function ot(e){return typeof e=="string"||Array.isArray(e)||e===void 0?{mask:e}:e}function le(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:e.querySelector("input, textarea")}function F(e,t){const n=le(e);if(!n)return;const r=ot(t.value),i={...M.defaultMaskTokens,...r.tokens??{}},s=M.applyMask(n.value,r.mask,i);n.value!==s&&(n.value=s)}function rt(e,t){const n=le(e);if(!n)return;const r=()=>{e._gMaskFormatting||(e._gMaskFormatting=!0,F(e,t),n.dispatchEvent(new Event("input",{bubbles:!0})),e._gMaskFormatting=!1)};n.addEventListener("input",r),e._gMaskCleanup=()=>{n.removeEventListener("input",r)},F(e,t)}const it={mounted:rt,updated(e,t){F(e,t)},beforeUnmount(e){var t;(t=e._gMaskCleanup)==null||t.call(e),delete e._gMaskCleanup,delete e._gMaskFormatting}};exports.BaseFloating=ae;exports.GTooltip=ce;exports.gradientIcon=Ee;exports.loading=$e;exports.makeFloatingProps=N;exports.ripple=Ie;exports.specular=qe;exports.useAppendTarget=oe;exports.useControllableOpen=re;exports.useLayerStack=se;exports.useTriggerFactory=ue;exports.vGradientText=he;exports.vMask=it;exports.vTooltip=nt;
|