@gradient-ui/core 0.4.0 → 0.5.0-rc.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 +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 +56 -53
- 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 +183 -113
- 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 +3 -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 +295 -25
- package/dist/types/components/ui/GButton/types.d.ts +194 -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/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 +51 -3
- package/dist/types/components/ui/GTable/types.d.ts +351 -3
- 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 +8 -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/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 -22
- 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-CPzo3WD3.js +0 -680
- package/dist/GLoading.vue_vue_type_style_index_0_lang-cokm-HBh.cjs +0 -1
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BmbKqNgm.js +0 -6421
- package/dist/GSwitch.vue_vue_type_script_setup_true_lang-By_7hZOW.cjs +0 -4
- package/dist/camelToKebabCase-BAESShJ1.cjs +0 -1
- package/dist/camelToKebabCase-KgkZ7-1F.js +0 -28
- package/dist/default-BcPApP1Q.cjs +0 -318
- package/dist/mask-Bu8cjwwH.js +0 -817
- package/dist/mask-D1vJj5Hl.cjs +0 -1
- package/dist/propsFactory-DyyboUaC.cjs +0 -1
- package/dist/propsFactory-UhcvubZJ.js +0 -13
- package/dist/tagName-CYG1CUfd.js +0 -103
- package/dist/tagName-CbsvFHGg.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-2iJU4bdd.js +0 -769
- package/dist/useSnackbar-3QuH25xm.cjs +0 -1
package/README.md
CHANGED
|
@@ -11,6 +11,32 @@ The npm package is published as `@gradient-ui/core`.
|
|
|
11
11
|
|
|
12
12
|
Documentation: https://gradient-ui-docs.netlify.app/docs/get-started
|
|
13
13
|
|
|
14
|
+
## 0.5 RC
|
|
15
|
+
|
|
16
|
+
Gradient UI `0.5` is the release-candidate line for the new color and gradient
|
|
17
|
+
architecture.
|
|
18
|
+
|
|
19
|
+
- The standalone `@gradient-ui/gradient-engine` package powers gradient
|
|
20
|
+
materials, recipes, effects and animation output.
|
|
21
|
+
- Component variants now treat `default` as the regular material fill and
|
|
22
|
+
`gradient` as the explicit gradient surface.
|
|
23
|
+
- `filled` has been replaced by `gradient` for gradient-backed controls.
|
|
24
|
+
- Color tokens are generated through the new palette layer, while components can
|
|
25
|
+
still resolve semantic colors such as `primary`, `error`, `warning` and
|
|
26
|
+
`success`.
|
|
27
|
+
|
|
28
|
+
Install the RC when validating the next version:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @gradient-ui/core@rc
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The gradient engine can also be installed independently:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @gradient-ui/gradient-engine
|
|
38
|
+
```
|
|
39
|
+
|
|
14
40
|
## Install
|
|
15
41
|
|
|
16
42
|
```bash
|
|
@@ -43,7 +69,7 @@ const gradientUI = createGradientUI({
|
|
|
43
69
|
},
|
|
44
70
|
GButton: {
|
|
45
71
|
rounded: true,
|
|
46
|
-
variant: '
|
|
72
|
+
variant: 'default'
|
|
47
73
|
},
|
|
48
74
|
GInput: {
|
|
49
75
|
variant: 'outlined'
|
|
@@ -150,7 +176,7 @@ app.use(
|
|
|
150
176
|
color: 'primary'
|
|
151
177
|
},
|
|
152
178
|
GButton: {
|
|
153
|
-
variant: '
|
|
179
|
+
variant: 'default',
|
|
154
180
|
size: 'm'
|
|
155
181
|
},
|
|
156
182
|
GInput: {
|
|
@@ -163,6 +189,36 @@ app.use(
|
|
|
163
189
|
|
|
164
190
|
Local props always win over configured defaults.
|
|
165
191
|
|
|
192
|
+
Use `variant: 'gradient'` when a component should render an expressive gradient
|
|
193
|
+
surface:
|
|
194
|
+
|
|
195
|
+
```vue
|
|
196
|
+
<g-button label="Save" />
|
|
197
|
+
<g-button label="Launch" variant="gradient" gradient-recipe="glare" />
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Gradient Engine
|
|
201
|
+
|
|
202
|
+
Gradient UI uses `@gradient-ui/gradient-engine` as its material generation
|
|
203
|
+
layer. The engine is framework-free and can be used outside Vue:
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
import { createGradientMaterial } from '@gradient-ui/gradient-engine';
|
|
207
|
+
|
|
208
|
+
const material = createGradientMaterial('#704aff', {
|
|
209
|
+
preset: 'materialAction',
|
|
210
|
+
recipe: 'glare',
|
|
211
|
+
animation: {
|
|
212
|
+
preset: 'shift',
|
|
213
|
+
duration: 6000
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The returned material contains CSS variables, CSS text, keyframes and effect
|
|
219
|
+
descriptors that can be applied by Vue, React, vanilla JavaScript or SSR
|
|
220
|
+
adapters.
|
|
221
|
+
|
|
166
222
|
## Directives
|
|
167
223
|
|
|
168
224
|
The full plugin registers all public directives:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),c=require("./surface-8z3gR7vF.cjs");require("@mdi/js");const L=(n,o)=>{const r=n.__vccOpts||n;for(const[a,d]of o)r[a]=d;return r},V=c.propsFactory({size:{type:String,default:"m"}});function W(n,o){return e.computed(()=>`${o}_${n.size}`)}const I={fade:"g-fade-transition",scale:"g-scale-transition","scale-only":"g-scale-only-transition","slide-x":"g-slide-x-transition","slide-x-reverse":"g-slide-x-reverse-transition","slide-y":"g-slide-y-transition","slide-y-reverse":"g-slide-y-reverse-transition",dialog:"g-dialog-transition",overlay:"g-overlay-transition",expand:"g-expand-transition"},B=c.propsFactory({transition:{type:[Boolean,String,Object],default:void 0}},"transition"),$=c.propsFactory({...B(),name:String,appear:Boolean,disabled:Boolean,group:Boolean,tag:String,mode:String,origin:String,duration:[Number,String],enterDuration:[Number,String],leaveDuration:[Number,String],easing:String,enterEasing:String,leaveEasing:String,distance:[Number,String],scale:[Number,String],opacity:{type:Boolean,default:void 0},leaveAbsolute:Boolean,hideOnLeave:Boolean,css:{type:Boolean,default:!0}},"transition");function U(n){return n?I[n]??n:""}function j(n){if(!(n===void 0||n===""))return typeof n=="number"?`${n}px`:n}function E(n){if(!(n===void 0||n===""))return typeof n=="number"?`${n}ms`:n}function T(n,o){if(n===void 0||n==="")return o;if(typeof n=="number")return n;const r=n.trim();if(r.endsWith("ms"))return Number.parseFloat(r);if(r.endsWith("s"))return Number.parseFloat(r)*1e3;const a=Number.parseFloat(r);return Number.isNaN(a)?o:a}function z(n,o){return n===!1?{...o,disabled:!0}:n===!0||n===void 0?o:typeof n=="string"?{...o,name:n}:{...o,...n}}function P(){const n=e.ref(!1);let o=null;const r=()=>{n.value=(o==null?void 0:o.matches)??!1};return e.onMounted(()=>{typeof window>"u"||!window.matchMedia||(o=window.matchMedia("(prefers-reduced-motion: reduce)"),r(),o.addEventListener("change",r))}),e.onBeforeUnmount(()=>{o==null||o.removeEventListener("change",r)}),n}const q=80,D=e.defineComponent({inheritAttrs:!1,__name:"GTransition",props:$({name:"fade",css:!0}),emits:["before-enter","after-enter","before-leave","leave","after-leave","enter-cancelled","leave-cancelled"],setup(n,{emit:o}){const r=n,a=o,d=e.useAttrs(),u=P(),p=e.computed(()=>r.group?e.TransitionGroup:e.Transition),s=e.computed(()=>z(r.transition,N.value)),f=e.computed(()=>v.value?"":U(s.value.name)),v=e.computed(()=>r.disabled||u.value||s.value.disabled),_=e.computed(()=>r.group||s.value.mode==="default"?void 0:s.value.mode),y=e.computed(()=>!v.value&&s.value.css!==!1),i=e.computed(()=>{if(!b.value||v.value)return;const t=s.value;return{enter:T(t.enterDuration??t.duration,220),leave:T(t.leaveDuration??t.duration,180)+q}}),b=e.computed(()=>s.value.name==="overlay"||f.value==="g-overlay-transition"),N=e.computed(()=>({name:r.name,appear:r.appear,mode:r.mode,origin:r.origin,duration:r.duration,enterDuration:r.enterDuration,leaveDuration:r.leaveDuration,easing:r.easing,enterEasing:r.enterEasing,leaveEasing:r.leaveEasing,distance:r.distance,scale:r.scale,opacity:r.opacity,leaveAbsolute:r.leaveAbsolute,hideOnLeave:r.hideOnLeave,css:r.css})),C=e.computed(()=>{const t=s.value;return{"--g-transition-enter-duration":E(t.enterDuration??t.duration),"--g-transition-leave-duration":E(t.leaveDuration??t.duration),"--g-transition-enter-easing":t.enterEasing??t.easing,"--g-transition-leave-easing":t.leaveEasing??t.easing,"--g-transition-origin":t.origin,"--g-transition-distance":j(t.distance),"--g-transition-scale":t.scale===void 0?void 0:String(t.scale),"--g-transition-opacity-from":t.opacity===!1?"1":void 0}});function h(t){if(t instanceof HTMLElement)for(const[l,x]of Object.entries(C.value))x!==void 0&&t.style.setProperty(l,x)}function w(t){const{offsetTop:l,offsetLeft:x,offsetWidth:G,offsetHeight:H}=t;t._gTransitionInitialStyles={position:t.style.position,top:t.style.top,left:t.style.left,width:t.style.width,height:t.style.height,display:t.style.display},t.style.position="absolute",t.style.top=`${l}px`,t.style.left=`${x}px`,t.style.width=`${G}px`,t.style.height=`${H}px`}function S(t){const l=t._gTransitionInitialStyles;l&&(t.style.position=l.position,t.style.top=l.top,t.style.left=l.left,t.style.width=l.width,t.style.height=l.height,t.style.display=l.display,delete t._gTransitionInitialStyles)}function g(t){h(t),a("before-enter",t)}function m(t){a("after-enter",t)}function k(t){h(t),a("before-leave",t)}function A(t){if(!(t instanceof HTMLElement)){a("leave",t);return}s.value.leaveAbsolute&&w(t),s.value.hideOnLeave&&t.style.setProperty("display","none","important"),a("leave",t)}function O(t){t instanceof HTMLElement&&S(t),a("after-leave",t)}function F(t){a("enter-cancelled",t)}function R(t){t instanceof HTMLElement&&S(t),a("leave-cancelled",t)}return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),e.mergeProps(e.unref(d),{name:f.value,css:y.value,appear:s.value.appear,duration:i.value,mode:_.value,tag:r.group?r.tag:void 0,onBeforeEnter:g,onAfterEnter:m,onBeforeLeave:k,onLeave:A,onAfterLeave:O,onEnterCancelled:F,onLeaveCancelled:R}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["name","css","appear","duration","mode","tag"]))}}),J=c.propsFactory({...c.makeColorProps(),...c.makeRoundedProps(),...V(),...c.makeStateProps(),...c.makeSurfaceTextureProps(),modelValue:{type:Number,default:0},indeterminate:Boolean,noLabel:Boolean,label:String,labelAlign:{type:String,default:"center"},view:{type:String,default:"default"},segments:{type:Number,default:12}}),K={key:0,class:"g-progress__label"},Q=["aria-valuenow","aria-valuetext"],X=e.defineComponent({__name:"GProgress",props:J({color:"primary"}),setup(n){const o=n,{gradientStyles:r}=c.useSurfaceColor(o),a=e.ref(0),d=e.ref(null);let u;const p=e.computed(()=>Math.min(100,Math.max(0,o.modelValue))),s=c.usePx(a),f=e.computed(()=>Math.max(2,Math.round(o.segments))),v=e.computed(()=>Array.from({length:f.value-1},(g,m)=>m)),_=e.computed(()=>`${p.value}%`),y=e.computed(()=>o.label??`${Math.round(p.value)}%`),i=g=>({"--g-progress-segment-position":`${(g+1)/f.value*100}%`}),b=e.computed(()=>({...r.value,"--g-progress-value":_.value,"--g-progress-track-width":s.value})),N=()=>{u=new ResizeObserver(g=>{for(const m of g)a.value=m.contentRect.width}),d.value&&u.observe(d.value)};e.onMounted(()=>{N()}),e.onBeforeUnmount(()=>{u==null||u.disconnect()});const{surfaceOverlayClasses:C,surfaceUnderlayClasses:h,surfaceTextureClasses:w,surfaceContentClasses:S}=c.useSurfaceLayers("g-progress");return(g,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-progress",{"g-progress_rounded":o.rounded,"g-progress_indeterminate":o.indeterminate,"g-progress_no-label":o.noLabel,[`g-progress_${o.size}`]:!0,[`g-progress_label-${o.labelAlign}`]:!0,[`g-progress_view-${o.view}`]:!0,[`g-progress_texture-${o.texture}`]:o.texture!=="none"}]),style:e.normalizeStyle(b.value)},[o.noLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(g.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(y.value),1)],!0)])),e.createElementVNode("div",{ref_key:"parentRef",ref:d,class:"g-progress__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":o.indeterminate?void 0:p.value,"aria-valuetext":o.indeterminate?void 0:y.value},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(h))},null,2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(C))},null,2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w))},null,2),e.createElementVNode("div",{class:e.normalizeClass(["g-progress__surface-content",e.unref(S)])},[...m[0]||(m[0]=[e.createElementVNode("div",{class:"g-progress__bar"},[e.createElementVNode("div",{class:"g-progress__active"},[e.createElementVNode("div",{class:"g-progress__overlay"})])],-1)])],2),o.view==="segmented"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(v.value,k=>(e.openBlock(),e.createElementBlock("span",{key:k,class:"g-progress__segment-divider",style:e.normalizeStyle(i(k))},null,4))),128)):e.createCommentVNode("",!0)],8,Q)],6))}}),M=L(X,[["__scopeId","data-v-4cff0429"]]),Y=c.propsFactory({...B(),text:String,noText:Boolean,show:Boolean,color:String,dark:Boolean,opacity:[Number,String],blur:[Number,String],progressView:String,onClose:Function}),Z={class:"g-loading__body"},ee={key:0,class:"g-loading__text"},te={class:"g-loading__progress"},ne=e.defineComponent({__name:"GLoading",props:Y({text:"Loading...",noText:!1,show:!1,color:"primary",dark:!1,opacity:void 0,blur:void 0,progressView:"glow",transition:()=>({name:"fade",duration:220}),onClose:void 0}),emits:["close"],setup(n,{expose:o,emit:r}){const a=n,d=r,u=e.ref(!1),p=e.computed(()=>a.show||u.value),s=e.computed(()=>({"--g-loading-overlay-opacity":a.opacity!==void 0?String(a.opacity):void 0,"--g-loading-overlay-blur":a.blur!==void 0?f(a.blur):void 0}));function f(i){return typeof i=="number"?`${i}px`:i}function v(){u.value=!0}function _(){u.value=!1}function y(){var i;(i=a.onClose)==null||i.call(a),d("close")}return o({hide:_,show:v,isVisible:p}),(i,b)=>(e.openBlock(),e.createBlock(e.unref(D),{transition:a.transition,name:"scale",onAfterLeave:y},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["g-loading",{"g-loading_dark":a.dark}]),style:e.normalizeStyle(s.value),"aria-live":"polite","aria-busy":"true"},[e.createElementVNode("div",Z,[a.noText?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.text),1)])])),e.createElementVNode("div",te,[e.createVNode(M,{"no-label":"",indeterminate:"","model-value":100,color:a.color,view:a.progressView,size:"s"},null,8,["color","view"])])])],6)):e.createCommentVNode("",!0)]),_:3},8,["transition"]))}});exports.GProgress=M;exports._export_sfc=L;exports._sfc_main=ne;exports._sfc_main$1=D;exports.makeGTransitionProps=$;exports.makeSizeProps=V;exports.makeTransitionProps=B;exports.resolveTransitionOptions=z;exports.useReducedMotion=P;exports.useSize=W;
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { computed as s, ref as N, onMounted as R, onBeforeUnmount as G, defineComponent as z, useAttrs as Z, TransitionGroup as q, Transition as ee, openBlock as f, createBlock as F, resolveDynamicComponent as te, mergeProps as ne, unref as h, withCtx as H, renderSlot as A, createElementBlock as S, normalizeStyle as P, normalizeClass as b, createTextVNode as W, toDisplayString as I, createCommentVNode as B, createElementVNode as d, Fragment as oe, renderList as ae, createVNode as se } from "vue";
|
|
2
|
+
import { p as w, f as re, g as ie, h as le, m as ue, i as de, j as ce, k as ge } from "./surface-BKu4KfkY.js";
|
|
3
|
+
import "@mdi/js";
|
|
4
|
+
const pe = (t, n) => {
|
|
5
|
+
const o = t.__vccOpts || t;
|
|
6
|
+
for (const [a, c] of n)
|
|
7
|
+
o[a] = c;
|
|
8
|
+
return o;
|
|
9
|
+
}, ve = w({
|
|
10
|
+
size: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "m"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
function ze(t, n) {
|
|
16
|
+
return s(() => `${n}_${t.size}`);
|
|
17
|
+
}
|
|
18
|
+
const fe = {
|
|
19
|
+
fade: "g-fade-transition",
|
|
20
|
+
scale: "g-scale-transition",
|
|
21
|
+
"scale-only": "g-scale-only-transition",
|
|
22
|
+
"slide-x": "g-slide-x-transition",
|
|
23
|
+
"slide-x-reverse": "g-slide-x-reverse-transition",
|
|
24
|
+
"slide-y": "g-slide-y-transition",
|
|
25
|
+
"slide-y-reverse": "g-slide-y-reverse-transition",
|
|
26
|
+
dialog: "g-dialog-transition",
|
|
27
|
+
overlay: "g-overlay-transition",
|
|
28
|
+
expand: "g-expand-transition"
|
|
29
|
+
}, j = w(
|
|
30
|
+
{
|
|
31
|
+
transition: {
|
|
32
|
+
type: [Boolean, String, Object],
|
|
33
|
+
default: void 0
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"transition"
|
|
37
|
+
), me = w(
|
|
38
|
+
{
|
|
39
|
+
...j(),
|
|
40
|
+
name: String,
|
|
41
|
+
appear: Boolean,
|
|
42
|
+
disabled: Boolean,
|
|
43
|
+
group: Boolean,
|
|
44
|
+
tag: String,
|
|
45
|
+
mode: String,
|
|
46
|
+
origin: String,
|
|
47
|
+
duration: [Number, String],
|
|
48
|
+
enterDuration: [Number, String],
|
|
49
|
+
leaveDuration: [Number, String],
|
|
50
|
+
easing: String,
|
|
51
|
+
enterEasing: String,
|
|
52
|
+
leaveEasing: String,
|
|
53
|
+
distance: [Number, String],
|
|
54
|
+
scale: [Number, String],
|
|
55
|
+
opacity: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: void 0
|
|
58
|
+
},
|
|
59
|
+
leaveAbsolute: Boolean,
|
|
60
|
+
hideOnLeave: Boolean,
|
|
61
|
+
css: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"transition"
|
|
67
|
+
);
|
|
68
|
+
function ye(t) {
|
|
69
|
+
return t ? fe[t] ?? t : "";
|
|
70
|
+
}
|
|
71
|
+
function _e(t) {
|
|
72
|
+
if (!(t === void 0 || t === ""))
|
|
73
|
+
return typeof t == "number" ? `${t}px` : t;
|
|
74
|
+
}
|
|
75
|
+
function V(t) {
|
|
76
|
+
if (!(t === void 0 || t === ""))
|
|
77
|
+
return typeof t == "number" ? `${t}ms` : t;
|
|
78
|
+
}
|
|
79
|
+
function O(t, n) {
|
|
80
|
+
if (t === void 0 || t === "") return n;
|
|
81
|
+
if (typeof t == "number") return t;
|
|
82
|
+
const o = t.trim();
|
|
83
|
+
if (o.endsWith("ms"))
|
|
84
|
+
return Number.parseFloat(o);
|
|
85
|
+
if (o.endsWith("s"))
|
|
86
|
+
return Number.parseFloat(o) * 1e3;
|
|
87
|
+
const a = Number.parseFloat(o);
|
|
88
|
+
return Number.isNaN(a) ? n : a;
|
|
89
|
+
}
|
|
90
|
+
function be(t, n) {
|
|
91
|
+
return t === !1 ? {
|
|
92
|
+
...n,
|
|
93
|
+
disabled: !0
|
|
94
|
+
} : t === !0 || t === void 0 ? n : typeof t == "string" ? {
|
|
95
|
+
...n,
|
|
96
|
+
name: t
|
|
97
|
+
} : {
|
|
98
|
+
...n,
|
|
99
|
+
...t
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function he() {
|
|
103
|
+
const t = N(!1);
|
|
104
|
+
let n = null;
|
|
105
|
+
const o = () => {
|
|
106
|
+
t.value = (n == null ? void 0 : n.matches) ?? !1;
|
|
107
|
+
};
|
|
108
|
+
return R(() => {
|
|
109
|
+
typeof window > "u" || !window.matchMedia || (n = window.matchMedia("(prefers-reduced-motion: reduce)"), o(), n.addEventListener("change", o));
|
|
110
|
+
}), G(() => {
|
|
111
|
+
n == null || n.removeEventListener("change", o);
|
|
112
|
+
}), t;
|
|
113
|
+
}
|
|
114
|
+
const Se = 80, xe = /* @__PURE__ */ z({
|
|
115
|
+
inheritAttrs: !1,
|
|
116
|
+
__name: "GTransition",
|
|
117
|
+
props: me({
|
|
118
|
+
name: "fade",
|
|
119
|
+
css: !0
|
|
120
|
+
}),
|
|
121
|
+
emits: ["before-enter", "after-enter", "before-leave", "leave", "after-leave", "enter-cancelled", "leave-cancelled"],
|
|
122
|
+
setup(t, { emit: n }) {
|
|
123
|
+
const o = t, a = n, c = Z(), u = he(), g = s(
|
|
124
|
+
() => o.group ? q : ee
|
|
125
|
+
), r = s(
|
|
126
|
+
() => be(o.transition, D.value)
|
|
127
|
+
), m = s(
|
|
128
|
+
() => y.value ? "" : ye(r.value.name)
|
|
129
|
+
), y = s(
|
|
130
|
+
() => o.disabled || u.value || r.value.disabled
|
|
131
|
+
), x = s(
|
|
132
|
+
() => o.group || r.value.mode === "default" ? void 0 : r.value.mode
|
|
133
|
+
), _ = s(
|
|
134
|
+
() => !y.value && r.value.css !== !1
|
|
135
|
+
), i = s(() => {
|
|
136
|
+
if (!L.value || y.value) return;
|
|
137
|
+
const e = r.value;
|
|
138
|
+
return {
|
|
139
|
+
enter: O(
|
|
140
|
+
e.enterDuration ?? e.duration,
|
|
141
|
+
220
|
|
142
|
+
),
|
|
143
|
+
leave: O(
|
|
144
|
+
e.leaveDuration ?? e.duration,
|
|
145
|
+
180
|
|
146
|
+
) + Se
|
|
147
|
+
};
|
|
148
|
+
}), L = s(
|
|
149
|
+
() => r.value.name === "overlay" || m.value === "g-overlay-transition"
|
|
150
|
+
), D = s(() => ({
|
|
151
|
+
name: o.name,
|
|
152
|
+
appear: o.appear,
|
|
153
|
+
mode: o.mode,
|
|
154
|
+
origin: o.origin,
|
|
155
|
+
duration: o.duration,
|
|
156
|
+
enterDuration: o.enterDuration,
|
|
157
|
+
leaveDuration: o.leaveDuration,
|
|
158
|
+
easing: o.easing,
|
|
159
|
+
enterEasing: o.enterEasing,
|
|
160
|
+
leaveEasing: o.leaveEasing,
|
|
161
|
+
distance: o.distance,
|
|
162
|
+
scale: o.scale,
|
|
163
|
+
opacity: o.opacity,
|
|
164
|
+
leaveAbsolute: o.leaveAbsolute,
|
|
165
|
+
hideOnLeave: o.hideOnLeave,
|
|
166
|
+
css: o.css
|
|
167
|
+
})), E = s(() => {
|
|
168
|
+
const e = r.value;
|
|
169
|
+
return {
|
|
170
|
+
"--g-transition-enter-duration": V(
|
|
171
|
+
e.enterDuration ?? e.duration
|
|
172
|
+
),
|
|
173
|
+
"--g-transition-leave-duration": V(
|
|
174
|
+
e.leaveDuration ?? e.duration
|
|
175
|
+
),
|
|
176
|
+
"--g-transition-enter-easing": e.enterEasing ?? e.easing,
|
|
177
|
+
"--g-transition-leave-easing": e.leaveEasing ?? e.easing,
|
|
178
|
+
"--g-transition-origin": e.origin,
|
|
179
|
+
"--g-transition-distance": _e(e.distance),
|
|
180
|
+
"--g-transition-scale": e.scale === void 0 ? void 0 : String(e.scale),
|
|
181
|
+
"--g-transition-opacity-from": e.opacity === !1 ? "1" : void 0
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
function T(e) {
|
|
185
|
+
if (e instanceof HTMLElement)
|
|
186
|
+
for (const [l, $] of Object.entries(E.value))
|
|
187
|
+
$ !== void 0 && e.style.setProperty(l, $);
|
|
188
|
+
}
|
|
189
|
+
function M(e) {
|
|
190
|
+
const { offsetTop: l, offsetLeft: $, offsetWidth: X, offsetHeight: Y } = e;
|
|
191
|
+
e._gTransitionInitialStyles = {
|
|
192
|
+
position: e.style.position,
|
|
193
|
+
top: e.style.top,
|
|
194
|
+
left: e.style.left,
|
|
195
|
+
width: e.style.width,
|
|
196
|
+
height: e.style.height,
|
|
197
|
+
display: e.style.display
|
|
198
|
+
}, e.style.position = "absolute", e.style.top = `${l}px`, e.style.left = `${$}px`, e.style.width = `${X}px`, e.style.height = `${Y}px`;
|
|
199
|
+
}
|
|
200
|
+
function k(e) {
|
|
201
|
+
const l = e._gTransitionInitialStyles;
|
|
202
|
+
l && (e.style.position = l.position, e.style.top = l.top, e.style.left = l.left, e.style.width = l.width, e.style.height = l.height, e.style.display = l.display, delete e._gTransitionInitialStyles);
|
|
203
|
+
}
|
|
204
|
+
function p(e) {
|
|
205
|
+
T(e), a("before-enter", e);
|
|
206
|
+
}
|
|
207
|
+
function v(e) {
|
|
208
|
+
a("after-enter", e);
|
|
209
|
+
}
|
|
210
|
+
function C(e) {
|
|
211
|
+
T(e), a("before-leave", e);
|
|
212
|
+
}
|
|
213
|
+
function U(e) {
|
|
214
|
+
if (!(e instanceof HTMLElement)) {
|
|
215
|
+
a("leave", e);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
r.value.leaveAbsolute && M(e), r.value.hideOnLeave && e.style.setProperty("display", "none", "important"), a("leave", e);
|
|
219
|
+
}
|
|
220
|
+
function J(e) {
|
|
221
|
+
e instanceof HTMLElement && k(e), a("after-leave", e);
|
|
222
|
+
}
|
|
223
|
+
function K(e) {
|
|
224
|
+
a("enter-cancelled", e);
|
|
225
|
+
}
|
|
226
|
+
function Q(e) {
|
|
227
|
+
e instanceof HTMLElement && k(e), a("leave-cancelled", e);
|
|
228
|
+
}
|
|
229
|
+
return (e, l) => (f(), F(te(g.value), ne(h(c), {
|
|
230
|
+
name: m.value,
|
|
231
|
+
css: _.value,
|
|
232
|
+
appear: r.value.appear,
|
|
233
|
+
duration: i.value,
|
|
234
|
+
mode: x.value,
|
|
235
|
+
tag: o.group ? o.tag : void 0,
|
|
236
|
+
onBeforeEnter: p,
|
|
237
|
+
onAfterEnter: v,
|
|
238
|
+
onBeforeLeave: C,
|
|
239
|
+
onLeave: U,
|
|
240
|
+
onAfterLeave: J,
|
|
241
|
+
onEnterCancelled: K,
|
|
242
|
+
onLeaveCancelled: Q
|
|
243
|
+
}), {
|
|
244
|
+
default: H(() => [
|
|
245
|
+
A(e.$slots, "default")
|
|
246
|
+
]),
|
|
247
|
+
_: 3
|
|
248
|
+
}, 16, ["name", "css", "appear", "duration", "mode", "tag"]));
|
|
249
|
+
}
|
|
250
|
+
}), we = w({
|
|
251
|
+
...ue(),
|
|
252
|
+
...le(),
|
|
253
|
+
...ve(),
|
|
254
|
+
...ie(),
|
|
255
|
+
...re(),
|
|
256
|
+
modelValue: {
|
|
257
|
+
type: Number,
|
|
258
|
+
default: 0
|
|
259
|
+
},
|
|
260
|
+
indeterminate: Boolean,
|
|
261
|
+
noLabel: Boolean,
|
|
262
|
+
label: String,
|
|
263
|
+
labelAlign: {
|
|
264
|
+
type: String,
|
|
265
|
+
default: "center"
|
|
266
|
+
},
|
|
267
|
+
view: {
|
|
268
|
+
type: String,
|
|
269
|
+
default: "default"
|
|
270
|
+
},
|
|
271
|
+
segments: {
|
|
272
|
+
type: Number,
|
|
273
|
+
default: 12
|
|
274
|
+
}
|
|
275
|
+
}), Le = {
|
|
276
|
+
key: 0,
|
|
277
|
+
class: "g-progress__label"
|
|
278
|
+
}, Te = ["aria-valuenow", "aria-valuetext"], ke = /* @__PURE__ */ z({
|
|
279
|
+
__name: "GProgress",
|
|
280
|
+
props: we({ color: "primary" }),
|
|
281
|
+
setup(t) {
|
|
282
|
+
const n = t, { gradientStyles: o } = de(n), a = N(0), c = N(null);
|
|
283
|
+
let u;
|
|
284
|
+
const g = s(
|
|
285
|
+
() => Math.min(100, Math.max(0, n.modelValue))
|
|
286
|
+
), r = ce(a), m = s(
|
|
287
|
+
() => Math.max(2, Math.round(n.segments))
|
|
288
|
+
), y = s(
|
|
289
|
+
() => Array.from({ length: m.value - 1 }, (p, v) => v)
|
|
290
|
+
), x = s(() => `${g.value}%`), _ = s(
|
|
291
|
+
() => n.label ?? `${Math.round(g.value)}%`
|
|
292
|
+
), i = (p) => ({
|
|
293
|
+
"--g-progress-segment-position": `${(p + 1) / m.value * 100}%`
|
|
294
|
+
}), L = s(() => ({
|
|
295
|
+
...o.value,
|
|
296
|
+
"--g-progress-value": x.value,
|
|
297
|
+
"--g-progress-track-width": r.value
|
|
298
|
+
})), D = () => {
|
|
299
|
+
u = new ResizeObserver((p) => {
|
|
300
|
+
for (const v of p)
|
|
301
|
+
a.value = v.contentRect.width;
|
|
302
|
+
}), c.value && u.observe(c.value);
|
|
303
|
+
};
|
|
304
|
+
R(() => {
|
|
305
|
+
D();
|
|
306
|
+
}), G(() => {
|
|
307
|
+
u == null || u.disconnect();
|
|
308
|
+
});
|
|
309
|
+
const {
|
|
310
|
+
surfaceOverlayClasses: E,
|
|
311
|
+
surfaceUnderlayClasses: T,
|
|
312
|
+
surfaceTextureClasses: M,
|
|
313
|
+
surfaceContentClasses: k
|
|
314
|
+
} = ge("g-progress");
|
|
315
|
+
return (p, v) => (f(), S("div", {
|
|
316
|
+
class: b(["g-progress", {
|
|
317
|
+
"g-progress_rounded": n.rounded,
|
|
318
|
+
"g-progress_indeterminate": n.indeterminate,
|
|
319
|
+
"g-progress_no-label": n.noLabel,
|
|
320
|
+
[`g-progress_${n.size}`]: !0,
|
|
321
|
+
[`g-progress_label-${n.labelAlign}`]: !0,
|
|
322
|
+
[`g-progress_view-${n.view}`]: !0,
|
|
323
|
+
[`g-progress_texture-${n.texture}`]: n.texture !== "none"
|
|
324
|
+
}]),
|
|
325
|
+
style: P(L.value)
|
|
326
|
+
}, [
|
|
327
|
+
n.noLabel ? B("", !0) : (f(), S("div", Le, [
|
|
328
|
+
A(p.$slots, "default", {}, () => [
|
|
329
|
+
W(I(_.value), 1)
|
|
330
|
+
], !0)
|
|
331
|
+
])),
|
|
332
|
+
d("div", {
|
|
333
|
+
ref_key: "parentRef",
|
|
334
|
+
ref: c,
|
|
335
|
+
class: "g-progress__track",
|
|
336
|
+
role: "progressbar",
|
|
337
|
+
"aria-valuemin": 0,
|
|
338
|
+
"aria-valuemax": 100,
|
|
339
|
+
"aria-valuenow": n.indeterminate ? void 0 : g.value,
|
|
340
|
+
"aria-valuetext": n.indeterminate ? void 0 : _.value
|
|
341
|
+
}, [
|
|
342
|
+
d("span", {
|
|
343
|
+
class: b(h(T))
|
|
344
|
+
}, null, 2),
|
|
345
|
+
d("span", {
|
|
346
|
+
class: b(h(E))
|
|
347
|
+
}, null, 2),
|
|
348
|
+
d("span", {
|
|
349
|
+
class: b(h(M))
|
|
350
|
+
}, null, 2),
|
|
351
|
+
d("div", {
|
|
352
|
+
class: b(["g-progress__surface-content", h(k)])
|
|
353
|
+
}, [...v[0] || (v[0] = [
|
|
354
|
+
d("div", { class: "g-progress__bar" }, [
|
|
355
|
+
d("div", { class: "g-progress__active" }, [
|
|
356
|
+
d("div", { class: "g-progress__overlay" })
|
|
357
|
+
])
|
|
358
|
+
], -1)
|
|
359
|
+
])], 2),
|
|
360
|
+
n.view === "segmented" ? (f(!0), S(oe, { key: 0 }, ae(y.value, (C) => (f(), S("span", {
|
|
361
|
+
key: C,
|
|
362
|
+
class: "g-progress__segment-divider",
|
|
363
|
+
style: P(i(C))
|
|
364
|
+
}, null, 4))), 128)) : B("", !0)
|
|
365
|
+
], 8, Te)
|
|
366
|
+
], 6));
|
|
367
|
+
}
|
|
368
|
+
}), Ce = /* @__PURE__ */ pe(ke, [["__scopeId", "data-v-4cff0429"]]), $e = w({
|
|
369
|
+
...j(),
|
|
370
|
+
text: String,
|
|
371
|
+
noText: Boolean,
|
|
372
|
+
show: Boolean,
|
|
373
|
+
color: String,
|
|
374
|
+
dark: Boolean,
|
|
375
|
+
opacity: [Number, String],
|
|
376
|
+
blur: [Number, String],
|
|
377
|
+
progressView: String,
|
|
378
|
+
onClose: Function
|
|
379
|
+
}), Ne = { class: "g-loading__body" }, Be = {
|
|
380
|
+
key: 0,
|
|
381
|
+
class: "g-loading__text"
|
|
382
|
+
}, De = { class: "g-loading__progress" }, Ae = /* @__PURE__ */ z({
|
|
383
|
+
__name: "GLoading",
|
|
384
|
+
props: $e({
|
|
385
|
+
text: "Loading...",
|
|
386
|
+
noText: !1,
|
|
387
|
+
show: !1,
|
|
388
|
+
color: "primary",
|
|
389
|
+
dark: !1,
|
|
390
|
+
opacity: void 0,
|
|
391
|
+
blur: void 0,
|
|
392
|
+
progressView: "glow",
|
|
393
|
+
transition: () => ({ name: "fade", duration: 220 }),
|
|
394
|
+
onClose: void 0
|
|
395
|
+
}),
|
|
396
|
+
emits: ["close"],
|
|
397
|
+
setup(t, { expose: n, emit: o }) {
|
|
398
|
+
const a = t, c = o, u = N(!1), g = s(() => a.show || u.value), r = s(() => ({
|
|
399
|
+
"--g-loading-overlay-opacity": a.opacity !== void 0 ? String(a.opacity) : void 0,
|
|
400
|
+
"--g-loading-overlay-blur": a.blur !== void 0 ? m(a.blur) : void 0
|
|
401
|
+
}));
|
|
402
|
+
function m(i) {
|
|
403
|
+
return typeof i == "number" ? `${i}px` : i;
|
|
404
|
+
}
|
|
405
|
+
function y() {
|
|
406
|
+
u.value = !0;
|
|
407
|
+
}
|
|
408
|
+
function x() {
|
|
409
|
+
u.value = !1;
|
|
410
|
+
}
|
|
411
|
+
function _() {
|
|
412
|
+
var i;
|
|
413
|
+
(i = a.onClose) == null || i.call(a), c("close");
|
|
414
|
+
}
|
|
415
|
+
return n({
|
|
416
|
+
hide: x,
|
|
417
|
+
show: y,
|
|
418
|
+
isVisible: g
|
|
419
|
+
}), (i, L) => (f(), F(h(xe), {
|
|
420
|
+
transition: a.transition,
|
|
421
|
+
name: "scale",
|
|
422
|
+
onAfterLeave: _
|
|
423
|
+
}, {
|
|
424
|
+
default: H(() => [
|
|
425
|
+
g.value ? (f(), S("div", {
|
|
426
|
+
key: 0,
|
|
427
|
+
class: b(["g-loading", { "g-loading_dark": a.dark }]),
|
|
428
|
+
style: P(r.value),
|
|
429
|
+
"aria-live": "polite",
|
|
430
|
+
"aria-busy": "true"
|
|
431
|
+
}, [
|
|
432
|
+
d("div", Ne, [
|
|
433
|
+
a.noText ? B("", !0) : (f(), S("div", Be, [
|
|
434
|
+
A(i.$slots, "default", {}, () => [
|
|
435
|
+
W(I(a.text), 1)
|
|
436
|
+
])
|
|
437
|
+
])),
|
|
438
|
+
d("div", De, [
|
|
439
|
+
se(Ce, {
|
|
440
|
+
"no-label": "",
|
|
441
|
+
indeterminate: "",
|
|
442
|
+
"model-value": 100,
|
|
443
|
+
color: a.color,
|
|
444
|
+
view: a.progressView,
|
|
445
|
+
size: "s"
|
|
446
|
+
}, null, 8, ["color", "view"])
|
|
447
|
+
])
|
|
448
|
+
])
|
|
449
|
+
], 6)) : B("", !0)
|
|
450
|
+
]),
|
|
451
|
+
_: 3
|
|
452
|
+
}, 8, ["transition"]));
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
export {
|
|
456
|
+
Ce as G,
|
|
457
|
+
Ae as _,
|
|
458
|
+
xe as a,
|
|
459
|
+
pe as b,
|
|
460
|
+
ve as c,
|
|
461
|
+
he as d,
|
|
462
|
+
me as e,
|
|
463
|
+
j as m,
|
|
464
|
+
be as r,
|
|
465
|
+
ze as u
|
|
466
|
+
};
|