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