@quidgest/ui 0.5.6 → 0.5.7
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/dist/index.d.ts +4 -4
- package/dist/ui.esm.js +37 -36
- package/dist/ui.esm.js.map +1 -1
- package/dist/ui.js +2 -2
- package/dist/ui.js.map +1 -1
- package/dist/ui.min.js +43 -43
- package/dist/ui.min.js.map +1 -1
- package/dist/ui.scss +1 -1
- package/package.json +1 -1
package/dist/ui.min.js
CHANGED
|
@@ -4,10 +4,10 @@ for(const t in e)o[t]=e[t]
|
|
|
4
4
|
for(const a in t){const r=e[a],i=t[a]
|
|
5
5
|
n(r)&&n(i)?o[a]=l(r,i):o[a]=i}return o}const a="q-defaults"
|
|
6
6
|
function r(e){if(o(e))return
|
|
7
|
-
const n=i(),r=t.ref(e),
|
|
8
|
-
t.provide(a,
|
|
7
|
+
const n=i(),r=t.ref(e),c=t.computed((()=>o(r.value)?n.value:l(n.value,r.value)))
|
|
8
|
+
t.provide(a,c)}function i(){const e=t.inject(a,void 0)
|
|
9
9
|
if(!e)throw new Error("[Quidgest UI] Could not find defaults instance")
|
|
10
|
-
return e}const
|
|
10
|
+
return e}const c={primary:"#00a1f8",primaryLight:"#e5f6ff",primaryDark:"#0079ba",secondary:"#11294d",secondaryLight:"#707f94",secondaryDark:"#040a13",highlight:"#DF640A",background:"#fff",container:"#fff",info:"#17a2b8",infoLight:"#bceff7",infoDark:"#11798a",success:"#28a745",successLight:"#c2f0cd",successDark:"#1e7d34",warning:"#ffa900",warningLight:"#ffeabf",warningDark:"#bf7f00",danger:"#b71c1c",dangerLight:"#f5bebe",dangerDark:"#891515",onBackground:"#1e2436",onPrimary:"#fff",onSecondary:"#fff",onHighlight:"#fff",onSuccess:"#fff",onWarning:"#fff",onDanger:"#fff",onInfo:"#fff"},s={primary:"#018BD2",primaryLight:"#cce7f6",primaryDark:"#006fac",secondary:"#11294d",secondaryLight:"#707f94",secondaryDark:"#040a13",highlight:"#FFAD54",background:"#1e2436",container:"#21323d",info:"#3DB6D1",infoLight:"#5aa2bc",infoDark:"#0c616a",success:"#00C781",successLight:"#6bae78",successDark:"#0f3b16",warning:"#FFD860",warningLight:"#ffd07a",warningDark:"#cc8000",danger:"#FC4B6C",dangerLight:"#FF7A88",dangerDark:"#B21929",onBackground:"#fff",onPrimary:"#fff",onSecondary:"#fff",onHighlight:"#fff",onSuccess:"#fff",onWarning:"#fff",onDanger:"#fff",onInfo:"#fff"}
|
|
11
11
|
function d(e){if(!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e))throw new Error("Invalid color format")
|
|
12
12
|
4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3])
|
|
13
13
|
return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)}}function u(e,t){if(t<0||t>100)throw new Error("Amount must be in the range [0, 100]")
|
|
@@ -18,25 +18,25 @@ if(0===t)return e
|
|
|
18
18
|
const o=m(e),n=t/100
|
|
19
19
|
return o.l=o.l-n*o.l,h(o)}function p(e){return`#${e.r.toString(16).padStart(2,"0")}${e.g.toString(16).padStart(2,"0")}${e.b.toString(16).padStart(2,"0")}`}function m(e){const t=e.r/255,o=e.g/255,n=e.b/255,l=Math.max(t,o,n),a=Math.min(t,o,n)
|
|
20
20
|
let r,i=0
|
|
21
|
-
const
|
|
21
|
+
const c=(l+a)/2
|
|
22
22
|
if(l===a)i=r=0
|
|
23
23
|
else{const e=l-a
|
|
24
|
-
switch(r=
|
|
24
|
+
switch(r=c>.5?e/(2-l-a):e/(l+a),l){case t:i=(o-n)/e+(o<n?6:0)
|
|
25
25
|
break
|
|
26
26
|
case o:i=(n-t)/e+2
|
|
27
27
|
break
|
|
28
|
-
case n:i=(t-o)/e+4}i/=6}return{h:Math.round(360*i),s:Math.round(100*r),l:Math.round(100*
|
|
28
|
+
case n:i=(t-o)/e+4}i/=6}return{h:Math.round(360*i),s:Math.round(100*r),l:Math.round(100*c)}}function h(e){const t=e.h/360,o=e.s/100,n=e.l/100
|
|
29
29
|
let l,a,r
|
|
30
30
|
if(0===o)l=a=r=n
|
|
31
31
|
else{const e=n<.5?n*(1+o):n+o-n*o,i=2*n-e
|
|
32
32
|
l=v(i,e,t+1/3),a=v(i,e,t),r=v(i,e,t-1/3)}return{r:Math.round(255*l),g:Math.round(255*a),b:Math.round(255*r)}}function v(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}const y="q-theme"
|
|
33
33
|
function g(e,o){let n=null
|
|
34
|
-
if(o)for(const e of o.themes){const t="light"===e.mode?s
|
|
34
|
+
if(o)for(const e of o.themes){const t="light"===e.mode?c:s
|
|
35
35
|
if(e.colors){let t
|
|
36
36
|
for(t in e.colors){const o=e.colors[t]
|
|
37
37
|
if(o&&!t.startsWith("on")&&!t.endsWith("Light")&&!t.endsWith("Dark")){const n=d(o),l=`${t}Light`,a=`${t}Dark`
|
|
38
38
|
l in e.colors||(e.colors[l]=p(u(n,85))),a in e.colors||(e.colors[a]=p(f(n,25)))}}}e.colors=k(t,e.colors),e.name===o.defaultTheme&&(n=e)}else{const e="default"
|
|
39
|
-
n={name:e,mode:"light",colors:
|
|
39
|
+
n={name:e,mode:"light",colors:c},o={defaultTheme:e,themes:[n]}}if(n){const l=t.ref({activeTheme:n.name,themes:o.themes})
|
|
40
40
|
t.watch((()=>l.value.activeTheme),(e=>{const t=l.value.themes.find((t=>t.name===e))
|
|
41
41
|
t&&function(e){let t=document.getElementById(y)
|
|
42
42
|
t||(t=document.createElement("style"),t.type="text/css",t.id=y,document.head.appendChild(t))
|
|
@@ -56,11 +56,11 @@ return null==(e=n.value)?void 0:e[o]}))}()
|
|
|
56
56
|
if(o(a.value))return n(e,l)
|
|
57
57
|
const r=t.getCurrentInstance()
|
|
58
58
|
if(null===r)return n(e,l)
|
|
59
|
-
const
|
|
59
|
+
const c=new Proxy(e,{get(e,t){var o
|
|
60
60
|
const n=Reflect.get(e,t),l=null==(o=a.value)?void 0:o[t]
|
|
61
61
|
return"class"===t||"style"===t?[l,n].filter((e=>null!=e)):"string"!=typeof t||function(e,t){var o
|
|
62
62
|
return typeof(null==(o=e.props)?void 0:o[t])<"u"}(r.vnode,t)?n:l??n}})
|
|
63
|
-
return n(
|
|
63
|
+
return n(c,l)}),e}const C=B(t.defineComponent({__name:"QSpinnerLoader",props:{size:{default:48}},setup(e){const o=e,n=t.computed((()=>({"font-size":48!==o.size?`${o.size}px`:void 0})))
|
|
64
64
|
return(e,o)=>(t.openBlock(),t.createElementBlock("div",{class:"q-spinner-loader",style:t.normalizeStyle(n.value)},w,4))}})),S=["disabled","onClick"],_={key:0,class:"q-btn__spinner"},E={class:"q-btn__content"},x=B(t.defineComponent({__name:"QButton",props:{active:{type:Boolean},bStyle:{default:"secondary"},label:{default:""},disabled:{type:Boolean},iconOnRight:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean},block:{type:Boolean},loading:{type:Boolean},size:{default:"regular"}},emits:["click"],setup(e,{emit:o}){const n=e,l=t.computed((()=>n.disabled||n.loading))
|
|
65
65
|
function a(e){l.value||o("click",e)}const r=t.computed((()=>{const e=t.computed((()=>n.bStyle?`q-btn--${n.bStyle}`:void 0)),o=t.computed((()=>"regular"!==n.size?`q-btn--${n.size}`:void 0))
|
|
66
66
|
return["q-btn",e.value,o.value,{"q-btn--active":n.active,"q-btn--borderless":n.borderless,"q-btn--elevated":n.elevated,"q-btn--block":n.block,"q-btn--loading":n.loading}]}))
|
|
@@ -70,13 +70,13 @@ const n=t.computed((()=>["q-btn-group",{"q-btn-group--elevated":o.elevated}]))
|
|
|
70
70
|
return(e,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(n.value)},[t.renderSlot(e.$slots,"default")],2))}})),$=B(t.defineComponent({__name:"QButtonToggle",props:{modelValue:{},options:{},disabled:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean},mandatory:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:o}){const n=e,l=t.ref(n.modelValue)
|
|
71
71
|
t.watch((()=>n.modelValue),(e=>l.value=e))
|
|
72
72
|
const a=t.computed({get:()=>l.value,set(e){l.value=e,o("update:modelValue",e)}})
|
|
73
|
-
return(e,o)=>(t.openBlock(),t.createBlock(t.unref(V),{"b-style":"secondary",disabled:n.disabled,borderless:n.borderless,elevated:n.elevated},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.options,(o=>(t.openBlock(),t.createBlock(t.unref(x),{key:o.key,title:o.title,label:o.label,active:a.value===o.key,onClick:e=>function(e){a.value!==e.key||n.mandatory?a.value=e.key:a.value=void 0}(o)},{default:t.withCtx((()=>[t.renderSlot(e.$slots,o.key)])),_:2},1032,["title","label","active","onClick"])))),128))])),_:3},8,["disabled","borderless","elevated"]))}})),q=t.defineComponent({__name:"QIcon",props:{
|
|
73
|
+
return(e,o)=>(t.openBlock(),t.createBlock(t.unref(V),{"b-style":"secondary",disabled:n.disabled,borderless:n.borderless,elevated:n.elevated},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.options,(o=>(t.openBlock(),t.createBlock(t.unref(x),{key:o.key,title:o.title,label:o.label,active:a.value===o.key,onClick:e=>function(e){a.value!==e.key||n.mandatory?a.value=e.key:a.value=void 0}(o)},{default:t.withCtx((()=>[t.renderSlot(e.$slots,o.key)])),_:2},1032,["title","label","active","onClick"])))),128))])),_:3},8,["disabled","borderless","elevated"]))}})),q=t.defineComponent({__name:"QIcon",props:{icon:{},type:{default:"svg"},size:{default:void 0}},setup(e){const o=e,n=t.computed((()=>{switch(o.type){case"svg":return M
|
|
74
74
|
case"font":return A
|
|
75
75
|
case"img":return F
|
|
76
76
|
default:return}}))
|
|
77
|
-
return(e,l)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value),{icon:o.
|
|
78
|
-
return(e,
|
|
79
|
-
return(e,l)=>o.icon?(t.openBlock(),t.createElementBlock("img",{key:0,src:o.icon,class:"q-icon",style:t.normalizeStyle(n.value)},null,12,z)):t.createCommentVNode("",!0)}}),
|
|
77
|
+
return(e,l)=>o.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value),{key:0,icon:o.icon,size:o.size},null,8,["icon","size"])):t.createCommentVNode("",!0)}}),L=t.defineComponent({__name:"QIconFont",props:{icon:{},library:{default:""},variant:{default:""},size:{default:void 0}},setup(e){const o=e,n=t.computed((()=>o.variant?`${o.library}-${o.variant}`:o.library)),l=t.computed((()=>o.library&&o.icon?`${o.library}-${o.icon}`:o.icon)),a=t.computed((()=>({"font-size":void 0!==o.size?`${o.size}px`:void 0})))
|
|
78
|
+
return(e,o)=>l.value?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(["q-icon","q-icon__font",n.value,l.value]),style:t.normalizeStyle(a.value)},null,6)):t.createCommentVNode("",!0)}}),z=["src"],D=t.defineComponent({__name:"QIconImg",props:{icon:{},size:{}},setup(e){const o=e,n=t.computed((()=>({"font-size":void 0!==o.size?`${o.size}px`:void 0})))
|
|
79
|
+
return(e,l)=>o.icon?(t.openBlock(),t.createElementBlock("img",{key:0,src:o.icon,class:"q-icon",style:t.normalizeStyle(n.value)},null,12,z)):t.createCommentVNode("",!0)}}),N={},I=t.defineComponent({name:"InlineSvg",emits:["loaded","unloaded","error"],inheritAttrs:!1,render(){if(!this.svgElSource)return null
|
|
80
80
|
const e=this.getSvgContent(this.svgElSource)
|
|
81
81
|
if(!e)return t.h("div",this.$attrs)
|
|
82
82
|
const o={}
|
|
@@ -84,23 +84,23 @@ return this.copySvgAttrs(o,this.svgElSource),this.copySvgAttrs(o,e),this.copyCom
|
|
|
84
84
|
if(o)for(const t of o)e[t.name]=t.value},copyComponentAttrs(e,t){for(const[o,n]of Object.entries(t))!1!==n&&null!=n&&(e[o]=n)},getSvgContent(e){return this.symbol&&!(e=e.getElementById(this.symbol))?null:(this.transformSource&&(e=e.cloneNode(!0),e=this.transformSource(e)),this.title&&(this.transformSource||(e=e.cloneNode(!0)),function(e,t){const o=e.getElementsByTagName("title")
|
|
85
85
|
if(o.length)o[0].textContent=t
|
|
86
86
|
else{const o=document.createElementNS("http://www.w3.org/2000/svg","title")
|
|
87
|
-
o.textContent=t,e.insertBefore(o,e.firstChild)}}(e,this.title)),e)},async getSource(e){try{
|
|
87
|
+
o.textContent=t,e.insertBefore(o,e.firstChild)}}(e,this.title)),e)},async getSource(e){try{N[e]||(N[e]=function(e){if(e.getIsPending)return e
|
|
88
88
|
let t=!0
|
|
89
89
|
const o=e.then((e=>(t=!1,e)),(e=>{throw t=!1,e}))
|
|
90
|
-
return o.getIsPending=()=>t,o}(this.download(e))),this.svgElSource&&
|
|
91
|
-
const t=await
|
|
92
|
-
this.svgElSource=t,await this.$nextTick(),this.$emit("loaded",this.$el)}catch(t){this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete
|
|
90
|
+
return o.getIsPending=()=>t,o}(this.download(e))),this.svgElSource&&N[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded"))
|
|
91
|
+
const t=await N[e]
|
|
92
|
+
this.svgElSource=t,await this.$nextTick(),this.$emit("loaded",this.$el)}catch(t){this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete N[e],this.$emit("error",t)}},async download(e){const t=await fetch(e)
|
|
93
93
|
if(!t.ok)throw new Error("Error loading SVG")
|
|
94
94
|
const o=await t.text(),n=(new DOMParser).parseFromString(o,"text/xml").getElementsByTagName("svg")[0]
|
|
95
95
|
if(!n)throw new Error("Loaded file is not a valid SVG")
|
|
96
96
|
return n}},watch:{src(e){this.getSource(e)}}})
|
|
97
97
|
const Q=t.defineComponent({__name:"QIconSvg",props:{icon:{},bundle:{default:""},size:{default:void 0}},emits:["loaded","unloaded"],setup(e,{emit:o}){const n=e,l=t.computed((()=>({"font-size":void 0!==n.size?`${n.size}px`:void 0})))
|
|
98
|
-
return(e,a)=>n.icon?(t.openBlock(),t.createBlock(t.unref(
|
|
98
|
+
return(e,a)=>n.icon?(t.openBlock(),t.createBlock(t.unref(I),{key:0,class:"q-icon q-icon__svg",src:n.bundle,symbol:n.icon,style:t.normalizeStyle(l.value),onLoaded:a[0]||(a[0]=e=>o("loaded",e)),onUnloaded:a[1]||(a[1]=e=>o("unloaded",e))},null,8,["src","symbol","style"])):t.createCommentVNode("",!0)}}),T=B(q),A=B(L),F=B(D),M=B(Q),P={key:0,class:"q-input__prepend"},O={key:1,class:"q-input__append"},R=B(t.defineComponent({__name:"QInput",props:{size:{default:"medium"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const o=e
|
|
99
99
|
return(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["q-input",`q-input--${o.size}`,{"q-input--readonly":o.readonly,"q-input--disabled":o.disabled}])},[e.$slots.prepend?(t.openBlock(),t.createElementBlock("div",P,[t.renderSlot(e.$slots,"prepend")])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default"),e.$slots.append?(t.openBlock(),t.createElementBlock("div",O,[t.renderSlot(e.$slots,"append")])):t.createCommentVNode("",!0)],2))}})),H={class:"q-line-loader"}
|
|
100
100
|
const U=B(((e,t)=>{const o=e.__vccOpts||e
|
|
101
101
|
for(const[e,n]of t)o[e]=n
|
|
102
|
-
return o})({},[["render",function(e,o){return t.openBlock(),t.createElementBlock("div",H)}]])),j=t.defineComponent({__name:"QList",props:{modelValue:{type:[String,Number,Boolean,Symbol],default:void 0},items:{},groups:{default:()=>[]},itemValue:{default:"key"},itemLabel:{default:"label"},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:o,emit:n}){const l=e,a=t.ref(l.modelValue),r=t.computed((()=>i.value.length>1?"div":"ul")),i=t.computed((()=>l.groups.length?l.groups:[{title:""}])),
|
|
103
|
-
function
|
|
102
|
+
return o})({},[["render",function(e,o){return t.openBlock(),t.createElementBlock("div",H)}]])),j=t.defineComponent({__name:"QList",props:{modelValue:{type:[String,Number,Boolean,Symbol],default:void 0},items:{},groups:{default:()=>[]},itemValue:{default:"key"},itemLabel:{default:"label"},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:o,emit:n}){const l=e,a=t.ref(l.modelValue),r=t.computed((()=>i.value.length>1?"div":"ul")),i=t.computed((()=>l.groups.length?l.groups:[{title:""}])),c=t.ref(null)
|
|
103
|
+
function s(e){a.value=e,n("update:modelValue",e)}function d(){let e=0
|
|
104
104
|
a.value&&(e=l.items.findIndex((e=>e[l.itemValue]===a.value))),p(e)}function u(e){switch(["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&e.preventDefault(),e.key){case"ArrowDown":f("next")
|
|
105
105
|
break
|
|
106
106
|
case"ArrowUp":f("prev")
|
|
@@ -114,32 +114,32 @@ case"first":p(0)
|
|
|
114
114
|
break
|
|
115
115
|
case"last":p(-1)}}function p(e){var t
|
|
116
116
|
null==(t=m().at(e))||t.focus()}function m(){var e
|
|
117
|
-
const t=null==(e=
|
|
118
|
-
return t?Array.from(t).filter((e=>-1!==e.tabIndex)):[]}function h(e){return e?l.items.filter((t=>t.group===e)):l.items}return t.watch((()=>l.modelValue),(e=>{a.value=e})),o({focusItem:p}),(e,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value),{ref_key:"listRef",ref:
|
|
117
|
+
const t=null==(e=c.value)?void 0:e.querySelectorAll("li")
|
|
118
|
+
return t?Array.from(t).filter((e=>-1!==e.tabIndex)):[]}function h(e){return e?l.items.filter((t=>t.group===e)):l.items}return t.watch((()=>l.modelValue),(e=>{a.value=e})),o({focusItem:p}),(e,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value),{ref_key:"listRef",ref:c,class:t.normalizeClass(["q-list",{"q-list--disabled":l.disabled}]),role:"listbox",tabindex:l.disabled?-1:0,onFocus:d,onKeydown:u},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(e=>(t.openBlock(),t.createBlock(t.unref(oe),t.mergeProps({key:e.title},e),{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h(e.title),(e=>(t.openBlock(),t.createBlock(t.unref(te),{key:e[l.itemValue],value:e[l.itemValue],label:e[l.itemLabel],icon:e.icon,disabled:l.disabled||e.disabled,selected:a.value===e[l.itemValue],onSelect:s},null,8,["value","label","icon","disabled","selected"])))),128))])),_:2},1040)))),128))])),_:1},40,["class","tabindex"]))}}),W=["tabindex","aria-label","aria-selected","onClick"],G={check:{icon:"check"}},K=t.defineComponent({__name:"QListItem",props:{value:{type:[String,Number,Boolean,Symbol]},label:{},icon:{default:void 0},selected:{type:Boolean,default:!1},highlighted:{type:Boolean,default:!1},icons:{default:()=>G},disabled:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:o}){const n=e
|
|
119
119
|
function l(){n.disabled||o("select",n.value)}function a(e){"Tab"===e.key&&l(),("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),l())}return(e,o)=>(t.openBlock(),t.createElementBlock("li",{role:"option",tabindex:n.disabled?void 0:-2,class:t.normalizeClass(["q-list-item",{"q-list-item--disabled":n.disabled,"q-list-item--selected":n.selected,"q-list-item--highlighted":n.highlighted}]),"aria-label":n.label,"aria-selected":n.disabled?void 0:n.selected,onKeydown:a,onClick:t.withModifiers(l,["stop","prevent"])},[n.icon?(t.openBlock(),t.createBlock(t.unref(T),t.normalizeProps(t.mergeProps({key:0},n.icon)),null,16)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(n.label)+" ",1),n.selected?(t.openBlock(),t.createBlock(t.unref(T),t.mergeProps({key:1},n.icons.check,{class:"q-list-item__check"}),null,16)):t.createCommentVNode("",!0)],42,W))}})
|
|
120
120
|
let X=0
|
|
121
121
|
const Y=["aria-labelledby"],Z=["id"],J=t.defineComponent({__name:"QListItemGroup",props:{id:{default:()=>"uid-"+ ++X},title:{default:""},disabled:{type:Boolean,default:!1}},setup(e){const o=e
|
|
122
122
|
return(e,n)=>o.title?(t.openBlock(),t.createElementBlock("ul",{key:1,class:"q-list-item-group",role:"group","aria-labelledby":o.id},[o.title?(t.openBlock(),t.createElementBlock("li",{key:0,id:o.id,class:"q-list-item-group__title",role:"presentation"},t.toDisplayString(o.title),9,Z)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default")],8,Y)):t.renderSlot(e.$slots,"default",{key:0})}}),ee=B(j),te=B(K),oe=B(J)
|
|
123
|
-
function ne(e,t,o="right",n){const l=e.getBoundingClientRect(),a=l.x+window.scrollX,r=l.y+window.scrollY,i=null==t?void 0:t.getBoundingClientRect(),
|
|
123
|
+
function ne(e,t,o="right",n){const l=e.getBoundingClientRect(),a=l.x+window.scrollX,r=l.y+window.scrollY,i=null==t?void 0:t.getBoundingClientRect(),c=(null==i?void 0:i.width)??0,s=(null==i?void 0:i.height)??0
|
|
124
124
|
let d=o
|
|
125
125
|
i&&!le(l,i,d)&&(d=function(e,t,o){const n={top:["bottom","left","right"],bottom:["top","left","right"],left:["right","top","bottom"],right:["left","top","bottom"]}
|
|
126
126
|
for(const l of n[o])if(le(e,t,l))return l
|
|
127
127
|
return o}(l,i,d))
|
|
128
128
|
const u={x:0,y:0,placement:d}
|
|
129
|
-
switch(d){case"top":u.x="anchor"===n?a:a+(l.width-
|
|
129
|
+
switch(d){case"top":u.x="anchor"===n?a:a+(l.width-c)/2,u.y=r-s
|
|
130
130
|
break
|
|
131
|
-
case"bottom":u.x="anchor"===n?a:a+(l.width-
|
|
131
|
+
case"bottom":u.x="anchor"===n?a:a+(l.width-c)/2,u.y=r+l.height
|
|
132
132
|
break
|
|
133
|
-
case"left":u.x=a-
|
|
133
|
+
case"left":u.x=a-c,u.y=r+l.height/2-s/2
|
|
134
134
|
break
|
|
135
|
-
case"right":u.x=a+l.width,u.y=r+l.height/2-
|
|
135
|
+
case"right":u.x=a+l.width,u.y=r+l.height/2-s/2}return"anchor"===n&&(u.width=l.width),u}function le(e,t,o){let n=!1,l=!1
|
|
136
136
|
switch(o){case"top":n=re(e,t),l=e.top>t.height
|
|
137
137
|
break
|
|
138
138
|
case"bottom":n=re(e,t),l=window.innerHeight-e.top-e.height>t.height
|
|
139
139
|
break
|
|
140
140
|
case"left":n=e.left>t.width,l=ae(e,t)
|
|
141
141
|
break
|
|
142
|
-
case"right":n=window.innerWidth-e.left-e.width>t.width,l=ae(e,t)}return n&&l}function ae(e,t){return window.innerHeight-e.top-e.height/2>t.height/2&&e.top+e.height/2>t.height/2}function re(e,t){return window.innerWidth-e.left-e.width/2>t.width/2&&e.left+e.width/2>t.width/2}function ie(e){return"string"==typeof e?document.querySelector(e):e&&"$el"in e?e.$el:e}const
|
|
142
|
+
case"right":n=window.innerWidth-e.left-e.width>t.width,l=ae(e,t)}return n&&l}function ae(e,t){return window.innerHeight-e.top-e.height/2>t.height/2&&e.top+e.height/2>t.height/2}function re(e,t){return window.innerWidth-e.left-e.width/2>t.width/2&&e.left+e.width/2>t.width/2}function ie(e){return"string"==typeof e?document.querySelector(e):e&&"$el"in e?e.$el:e}const ce={key:0,class:"q-overlay__arrow"},se=B(t.defineComponent({__name:"QOverlay",props:{modelValue:{type:Boolean},anchor:{},appearance:{default:"regular"},arrow:{type:Boolean,default:!1},attach:{default:"body"},contentClasses:{default:()=>[]},delay:{default:500},disabled:{type:Boolean},offset:{default:8},placement:{default:"right"},spy:{type:Boolean,default:!1},transition:{default:"fade"},trigger:{default:"click"},width:{default:"auto"}},emits:["enter","leave"],setup(e,{emit:o}){const n=e,l=t.computed((()=>["q-overlay",`q-overlay--${a.placement}`,{"q-overlay--inverted":"inverted"===n.appearance},...n.contentClasses])),a=t.reactive({visible:n.modelValue,top:0,left:0,width:0,placement:n.placement}),r=t.computed((()=>a.visible&&!n.disabled))
|
|
143
143
|
t.watch((()=>n.modelValue),(()=>a.visible=n.modelValue))
|
|
144
144
|
const i=t.computed((()=>{let e=0,t=0
|
|
145
145
|
switch(a.placement){case"top":t=-(n.offset||0)
|
|
@@ -149,36 +149,36 @@ break
|
|
|
149
149
|
case"left":e=-(n.offset||0)
|
|
150
150
|
break
|
|
151
151
|
case"right":e=n.offset||0}const o={top:`${a.top+t}px`,left:`${a.left+e}px`}
|
|
152
|
-
return void 0!==a.width&&["top","bottom"].includes(a.placement)&&(o.width=`${a.width}px`),o})),
|
|
153
|
-
function
|
|
154
|
-
if(e){const t=ne(e,
|
|
152
|
+
return void 0!==a.width&&["top","bottom"].includes(a.placement)&&(o.width=`${a.width}px`),o})),c=t.ref(null)
|
|
153
|
+
function s(){const e=ie(n.anchor)
|
|
154
|
+
if(e){const t=ne(e,c.value,n.placement,n.width)
|
|
155
155
|
a.left=t.x,a.top=t.y,a.width=t.width,a.placement=t.placement}}let d,u,f
|
|
156
156
|
function p(){const e="hover"===n.trigger?n.delay:0
|
|
157
|
-
d||(d=window.setTimeout((()=>a.visible=!0),e))}function m(){clearTimeout(d),d=void 0,a.visible=!1}function h(){r.value?m():p()}function v(){ie(n.anchor)?(
|
|
158
|
-
e&&(window.addEventListener("scroll",
|
|
157
|
+
d||(d=window.setTimeout((()=>a.visible=!0),e))}function m(){clearTimeout(d),d=void 0,a.visible=!1}function h(){r.value?m():p()}function v(){ie(n.anchor)?(s(),f=window.setTimeout(v,100)):m()}function y(){t.nextTick((()=>{const e=ie(n.anchor)
|
|
158
|
+
e&&(window.addEventListener("scroll",s),window.addEventListener("resize",s),u=new MutationObserver(s),u.observe(e,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),s())})),n.spy&&v()}function g(){window.removeEventListener("scroll",s),window.removeEventListener("resize",s),null==u||u.disconnect(),n.spy&&(clearTimeout(f),f=void 0)}return t.watch([()=>r.value,()=>n.placement],s),t.onBeforeUnmount(g),t.onMounted(s),t.watch((()=>n.disabled),(e=>{e||t.nextTick((()=>{const e=ie(n.anchor)
|
|
159
159
|
if(e)switch(n.trigger){case"click":e.addEventListener("click",h)
|
|
160
160
|
break
|
|
161
|
-
case"hover":e.addEventListener("mouseenter",p),e.addEventListener("mouseleave",m)}}))}),{immediate:!0}),t.watch((()=>r.value),(e=>{e?y():g()}),{immediate:!0}),(e,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(e.$slots,"trigger",{open:r.value}),(t.openBlock(),t.createBlock(t.Teleport,{to:n.attach},[t.createVNode(t.Transition,{name:n.transition,appear:"",onEnter:a[0]||(a[0]=e=>o("enter")),onLeave:a[1]||(a[1]=e=>o("leave"))},{default:t.withCtx((()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.value),style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:t.normalizeClass(["q-overlay__content"]),ref_key:"overlay",ref:
|
|
162
|
-
return(e,n)=>(t.openBlock(),t.createBlock(t.unref(
|
|
163
|
-
t.arg?e===n||e.contains(n)||n.closest(t.arg)||t.value(o,e):e===n||e.contains(n)||t.value(o,e)},document.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent)}},ve={key:1,class:"q-select__placeholder"},ye={placeholder:"Choose..."},ge={chevron:{
|
|
161
|
+
case"hover":e.addEventListener("mouseenter",p),e.addEventListener("mouseleave",m)}}))}),{immediate:!0}),t.watch((()=>r.value),(e=>{e?y():g()}),{immediate:!0}),(e,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(e.$slots,"trigger",{open:r.value}),(t.openBlock(),t.createBlock(t.Teleport,{to:n.attach},[t.createVNode(t.Transition,{name:n.transition,appear:"",onEnter:a[0]||(a[0]=e=>o("enter")),onLeave:a[1]||(a[1]=e=>o("leave"))},{default:t.withCtx((()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.value),style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:t.normalizeClass(["q-overlay__content"]),ref_key:"overlay",ref:c},[n.arrow?(t.openBlock(),t.createElementBlock("div",ce)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default")],512)],6)):t.createCommentVNode("",!0)])),_:3},8,["name"])],8,["to"]))],64))}})),de={key:0,class:"q-popover__header"},ue={key:1,class:"q-popover__body"},fe=["innerHTML"],pe={key:1},me=B(t.defineComponent({__name:"QPopover",props:{modelValue:{type:Boolean},anchor:{},arrow:{type:Boolean,default:!0},attach:{default:"body"},disabled:{type:Boolean},html:{type:Boolean,default:!0},placement:{default:"right"},spy:{type:Boolean,default:!0},text:{},title:{}},setup(e){const o=e
|
|
162
|
+
return(e,n)=>(t.openBlock(),t.createBlock(t.unref(se),{"model-value":o.modelValue,trigger:"click",anchor:o.anchor,arrow:o.arrow,attach:o.attach,"content-classes":["q-popover"],disabled:o.disabled,placement:o.placement,spy:o.spy},{default:t.withCtx((()=>[o.title||e.$slots.header?(t.openBlock(),t.createElementBlock("h3",de,[t.createTextVNode(t.toDisplayString(o.title)+" ",1),t.renderSlot(e.$slots,"header")])):t.createCommentVNode("",!0),o.text||e.$slots.body?(t.openBlock(),t.createElementBlock("div",ue,[o.html?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:o.text},null,8,fe)):(t.openBlock(),t.createElementBlock("span",pe,t.toDisplayString(o.text),1)),t.renderSlot(e.$slots,"body")])):t.createCommentVNode("",!0)])),_:3},8,["model-value","anchor","arrow","attach","disabled","placement","spy"]))}})),he={mounted(e,t){e.clickOutsideEvent=function(o){const n=o.target
|
|
163
|
+
t.arg?e===n||e.contains(n)||n.closest(t.arg)||t.value(o,e):e===n||e.contains(n)||t.value(o,e)},document.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent)}},ve={key:1,class:"q-select__placeholder"},ye={placeholder:"Choose..."},ge={chevron:{icon:"chevron-down"},clear:{icon:"close"}},ke=B(t.defineComponent({__name:"QSelect",props:{modelValue:{type:[String,Number,Boolean,Symbol],default:void 0},clearable:{type:Boolean,default:!1},readonly:{type:Boolean},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icons:{default:()=>ge},items:{},groups:{default:()=>[]},itemValue:{default:"key"},itemLabel:{default:"label"},size:{default:"medium"},texts:{default:()=>ye}},emits:["update:modelValue","before-show","before-hide","show","hide"],setup(e,{emit:o}){const n=e,l=t.ref(n.modelValue),a=t.ref(!1),r=t.ref(""),i=t.ref(null),c=t.ref(null),s=t.ref(null),d=t.computed((()=>{var e
|
|
164
164
|
return null==(e=n.items)?void 0:e.find((e=>e[n.itemValue]===l.value))})),u=t.computed((()=>d.value?d.value[n.itemLabel]:"")),f=t.computed((()=>n.clearable&&!n.readonly&&!n.disabled&&!n.loading))
|
|
165
165
|
function p(){f.value&&(l.value=void 0,o("update:modelValue",l.value),v())}function m(){n.readonly||n.disabled||(a.value?v():a.value||(o("before-show"),a.value=!0))}function h(e){var t
|
|
166
166
|
null!=(t=i.value)&&t.$el.contains(e.target)||v()}function v(){a.value&&(o("before-hide"),a.value=!1)}let y
|
|
167
167
|
function g(e){if(e.key&&!n.readonly&&!n.disabled){if(window.clearTimeout(y),["Enter"," ","ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),e.stopPropagation()),["Enter"," "].includes(e.key)&&(a.value=!0),["Escape","Tab"].includes(e.key)&&(a.value?a.value=!1:n.clearable&&"Escape"===e.key&&p()),"Delete"===e.key&&n.clearable&&p(),/^[a-z]$/i.test(e.key)){r.value+=e.key.toLowerCase()
|
|
168
168
|
for(let e=0;e<n.items.length;e++)if(n.items[e][n.itemLabel].toLowerCase().startsWith(r.value)){w(e)
|
|
169
169
|
break}}y=window.setTimeout((function(){r.value=""}),500)}}function k(){var e
|
|
170
|
-
null==(e=
|
|
170
|
+
null==(e=c.value)||e.$el.focus(),o("show")}function b(){var e
|
|
171
171
|
null==(e=i.value)||e.$el.focus(),o("hide")}function w(e){var t
|
|
172
|
-
null==(t=
|
|
172
|
+
null==(t=c.value)||t.focusItem(e)}return t.watch((()=>n.modelValue),(e=>{l.value=e})),(e,o)=>{var r,y
|
|
173
173
|
return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(t.unref(R),{ref_key:"inputRef",ref:i,role:"combobox",tabindex:"0",class:t.normalizeClass(["q-select",{"q-select--readonly":n.readonly,"q-select--disabled":n.disabled,"q-select--expanded":a.value}]),readonly:"",disabled:n.disabled,"aria-expanded":a.value,"aria-haspopup":"listbox",size:n.size,onClick:m,onKeydown:t.withModifiers(g,["stop"])},t.createSlots({append:t.withCtx((()=>[f.value&&l.value?(t.openBlock(),t.createBlock(t.unref(T),t.mergeProps({key:0},n.icons.clear,{class:"q-select__clear",onClick:t.withModifiers(p,["stop","prevent"])}),null,16,["onClick"])):t.createCommentVNode("",!0),n.readonly||n.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(T),t.mergeProps({key:1},n.icons.chevron,{class:"q-select__chevron"}),null,16))])),default:t.withCtx((()=>[l.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(u.value),1)],64)):(t.openBlock(),t.createElementBlock("span",ve,t.toDisplayString(e.texts.placeholder),1))])),_:2},[null!=(r=d.value)&&r.icon?{name:"prepend",fn:t.withCtx((()=>{var e
|
|
174
|
-
return[t.createVNode(t.unref(T),t.normalizeProps(t.guardReactiveProps(null==(e=d.value)?void 0:e.icon)),null,16)]})),key:"0"}:void 0]),1032,["class","disabled","aria-expanded","size","onKeydown"]),t.createVNode(t.unref(
|
|
175
|
-
return(e,n)=>(t.openBlock(),t.createBlock(t.unref(
|
|
176
|
-
e.QButton=x,e.QButtonGroup=V,e.QButtonToggle=$,e.QIcon=T,e.QIconFont=A,e.QIconImg=F,e.QIconSvg=M,e.QInput=R,e.QLineLoader=U,e.QList=ee,e.QListItem=te,e.QListItemGroup=oe,e.QOverlay=
|
|
174
|
+
return[t.createVNode(t.unref(T),t.normalizeProps(t.guardReactiveProps(null==(e=d.value)?void 0:e.icon)),null,16)]})),key:"0"}:void 0]),1032,["class","disabled","aria-expanded","size","onKeydown"]),t.createVNode(t.unref(se),{"model-value":a.value,spy:"",trigger:"manual",placement:"bottom",width:"anchor",offset:2,anchor:null==(y=i.value)?void 0:y.$el,onEnter:k,onLeave:b},{default:t.withCtx((()=>[t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref_key:"contentRef",ref:s,class:"q-select__body"},[t.renderSlot(e.$slots,"body.prepend"),n.loading?(t.openBlock(),t.createBlock(t.unref(C),{key:0,class:"q-select__loader",size:24})):(t.openBlock(),t.createBlock(t.unref(ee),{key:1,ref_key:"listRef",ref:c,class:"q-select__items",modelValue:l.value,"onUpdate:modelValue":[o[0]||(o[0]=e=>l.value=e),v],items:n.items,groups:e.groups,"item-label":n.itemLabel,"item-value":n.itemValue,onKeydown:t.withModifiers(g,["stop"])},null,8,["modelValue","items","groups","item-label","item-value","onKeydown"])),t.renderSlot(e.$slots,"body.append")])),[[t.unref(he),h]])])),_:3},8,["model-value","anchor"])],64)}}})),be=["innerHTML"],we={key:1},Be=B(t.defineComponent({__name:"QTooltip",props:{modelValue:{type:Boolean},anchor:{},appearance:{default:"inverted"},arrow:{type:Boolean,default:!0},attach:{default:"body"},delay:{default:500},disabled:{type:Boolean},html:{type:Boolean,default:!0},placement:{default:"right"},text:{},trigger:{default:"hover"}},setup(e){const o=e
|
|
175
|
+
return(e,n)=>(t.openBlock(),t.createBlock(t.unref(se),{"model-value":o.modelValue,anchor:o.anchor,appearance:o.appearance,arrow:o.arrow,attach:o.attach,"content-classes":["q-tooltip"],delay:o.delay,disabled:o.disabled,placement:o.placement,trigger:o.trigger},{default:t.withCtx((()=>[o.html?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:o.text},null,8,be)):(t.openBlock(),t.createElementBlock("span",we,t.toDisplayString(o.text),1))])),_:1},8,["model-value","anchor","appearance","arrow","attach","delay","disabled","placement","trigger"]))}}))
|
|
176
|
+
e.QButton=x,e.QButtonGroup=V,e.QButtonToggle=$,e.QIcon=T,e.QIconFont=A,e.QIconImg=F,e.QIconSvg=M,e.QInput=R,e.QLineLoader=U,e.QList=ee,e.QListItem=te,e.QListItemGroup=oe,e.QOverlay=se,e.QPopover=me,e.QSelect=ke,e.QSpinnerLoader=C,e.QTooltip=Be,e.clickOutside=he,e.createFramework=function(e={}){return{install:o=>{const n=e.components||{}
|
|
177
177
|
for(const e in n)o.component(e,n[e])
|
|
178
178
|
const l=e.directives||{}
|
|
179
179
|
for(const e in l)o.directive(e,l[e])
|
|
180
180
|
const r=e.defaults||{}
|
|
181
|
-
o.provide(a,t.ref(r)),g(o,e.themes)}}},e.defaultDarkColorScheme=
|
|
181
|
+
o.provide(a,t.ref(r)),g(o,e.themes)}}},e.defaultDarkColorScheme=s,e.defaultLightColorScheme=c,e.useTheme=function(){const e=t.inject(y)
|
|
182
182
|
if(!e)throw new Error("[Quidgest UI] Could not find theme instance")
|
|
183
183
|
return e},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}))
|
|
184
184
|
//# sourceMappingURL=ui.min.js.map
|