@quidgest/ui 0.3.1 → 0.3.2
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/ui.esm.js +417 -412
- package/dist/ui.esm.js.map +1 -1
- package/dist/ui.js +3 -3
- package/dist/ui.js.map +1 -1
- package/dist/ui.min.js +29 -24
- package/dist/ui.min.js.map +1 -1
- package/lib/composables/theme.d.ts.map +1 -1
- package/lib/styles/ui.scss +1 -1
- package/lib/utils/color.d.ts +22 -30
- package/lib/utils/color.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ui.min.js
CHANGED
|
@@ -273,39 +273,44 @@ if(e)switch(n.trigger){case"click":e.addEventListener("click",h)
|
|
|
273
273
|
break
|
|
274
274
|
case"hover":e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",p)}}))}),{immediate:!0}),t.watch((()=>a.value),(e=>{e?v():b()}),{immediate:!0}),(e,r)=>(t.openBlock(),t.createBlock(t.Teleport,{to:n.attach},[t.createVNode(t.Transition,{name:n.transition,appear:""},{default:t.withCtx((()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(o.value),style:t.normalizeStyle(c.value)},[t.createElementVNode("div",{class:"q-overlay__content",ref_key:"overlay",ref:i},[n.arrow?(t.openBlock(),t.createElementBlock("div",so)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default")],512)],6)):t.createCommentVNode("",!0)])),_:3},8,["name"])],8,["to"]))}}),fo={key:0,class:"q-popover__header"},po={key:1,class:"q-popover__body"},ho=["innerHTML"],yo={key:1},vo=t.defineComponent({__name:"QPopover",props:{anchor:{},arrow:{type:Boolean,default:!0},attach:{default:"body"},disabled:{type:Boolean},html:{type:Boolean,default:!0},persistent:{type:Boolean},placement:{default:"right"},spy:{type:Boolean,default:!0},text:{},title:{}},setup(e){const n=e
|
|
275
275
|
return(e,o)=>(t.openBlock(),t.createBlock(t.unref(uo),{trigger:"click",anchor:n.anchor,arrow:n.arrow,attach:n.attach,"content-classes":["q-popover"],disabled:n.disabled,persistent:n.persistent,placement:n.placement,spy:n.spy},{default:t.withCtx((()=>[n.title||e.$slots.header?(t.openBlock(),t.createElementBlock("h3",fo,[t.createTextVNode(t.toDisplayString(n.title)+" ",1),t.renderSlot(e.$slots,"header")])):t.createCommentVNode("",!0),n.text||e.$slots.body?(t.openBlock(),t.createElementBlock("div",po,[n.html?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:n.text},null,8,ho)):(t.openBlock(),t.createElementBlock("span",yo,t.toDisplayString(n.text),1)),t.renderSlot(e.$slots,"body")])):t.createCommentVNode("",!0)])),_:3},8,["anchor","arrow","attach","disabled","persistent","placement","spy"]))}}),bo=["innerHTML"],mo={key:1},go=Object.freeze(Object.defineProperty({__proto__:null,QButton:i,QButtonGroup:Wn,QButtonToggle:Gn,QIcon:Yn,QIconFont:Xn,QIconImg:Jn,QIconSvg:to,QLineLoader:oo,QOverlay:uo,QPopover:vo,QSpinnerLoader:o,QTooltip:t.defineComponent({__name:"QTooltip",props:{anchor:{},appearance:{default:"inverted"},arrow:{type:Boolean,default:!0},attach:{default:"body"},delay:{default:500},disabled:{type:Boolean},html:{type:Boolean,default:!0},persistent:{type:Boolean},placement:{default:"right"},text:{},trigger:{default:"hover"}},setup(e){const n=e
|
|
276
|
-
return(e,o)=>(t.openBlock(),t.createBlock(t.unref(uo),{anchor:n.anchor,appearance:n.appearance,arrow:n.arrow,attach:n.attach,"content-classes":["q-tooltip"],delay:n.delay,disabled:n.disabled,persistent:n.persistent,placement:n.placement,trigger:n.trigger},{default:t.withCtx((()=>[n.html?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:n.text},null,8,bo)):(t.openBlock(),t.createElementBlock("span",mo,t.toDisplayString(n.text),1))])),_:1},8,["anchor","appearance","arrow","attach","delay","disabled","persistent","placement","trigger"]))}})},Symbol.toStringTag,{value:"Module"})),_o={primary:"#00a1f8",primaryLight:"#
|
|
277
|
-
|
|
276
|
+
return(e,o)=>(t.openBlock(),t.createBlock(t.unref(uo),{anchor:n.anchor,appearance:n.appearance,arrow:n.arrow,attach:n.attach,"content-classes":["q-tooltip"],delay:n.delay,disabled:n.disabled,persistent:n.persistent,placement:n.placement,trigger:n.trigger},{default:t.withCtx((()=>[n.html?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:n.text},null,8,bo)):(t.openBlock(),t.createElementBlock("span",mo,t.toDisplayString(n.text),1))])),_:1},8,["anchor","appearance","arrow","attach","delay","disabled","persistent","placement","trigger"]))}})},Symbol.toStringTag,{value:"Module"})),_o={primary:"#00a1f8",primaryLight:"#bee8ff",primaryDark:"#0079ba",secondary:"#11294d",secondaryLight:"#aac4ec",secondaryDark:"#0d1f3a",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"},wo={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"}
|
|
277
|
+
function jo(e){if(!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e))throw new Error("Invalid color format")
|
|
278
278
|
4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3])
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return n.l
|
|
283
|
-
|
|
279
|
+
return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)}}function ko(e,t){if(t<0||t>100)throw new Error("Amount must be in the range [0, 100]")
|
|
280
|
+
if(0===t)return e
|
|
281
|
+
const n=Oo(e),o=t/100
|
|
282
|
+
return n.l=n.l+o*(100-n.l),Eo(n)}function Bo(e,t){if(t<0||t>100)throw new Error("Amount must be in the range [0, 100]")
|
|
283
|
+
if(0===t)return e
|
|
284
|
+
const n=Oo(e),o=t/100
|
|
285
|
+
return n.l=n.l-o*n.l,Eo(n)}function So(e){return`#${e.r.toString(16).padStart(2,"0")}${e.g.toString(16).padStart(2,"0")}${e.b.toString(16).padStart(2,"0")}`}function Oo(e){const t=e.r/255,n=e.g/255,o=e.b/255,r=Math.max(t,n,o),a=Math.min(t,n,o)
|
|
286
|
+
let c,i=0
|
|
284
287
|
const l=(r+a)/2
|
|
285
|
-
if(r
|
|
286
|
-
|
|
288
|
+
if(r===a)i=c=0
|
|
289
|
+
else{const e=r-a
|
|
290
|
+
switch(c=l>.5?e/(2-r-a):e/(r+a),r){case t:i=(n-o)/e+(n<o?6:0)
|
|
287
291
|
break
|
|
288
|
-
case n:
|
|
292
|
+
case n:i=(o-t)/e+2
|
|
289
293
|
break
|
|
290
|
-
case o:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
function
|
|
294
|
+
case o:i=(t-n)/e+4}i/=6}return{h:Math.round(360*i),s:Math.round(100*c),l:Math.round(100*l)}}function Eo(e){const t=e.h/360,n=e.s/100,o=e.l/100
|
|
295
|
+
let r,a,c
|
|
296
|
+
if(0===n)r=a=c=o
|
|
297
|
+
else{const e=o<.5?o*(1+n):o+n-o*n,i=2*o-e
|
|
298
|
+
r=Co(i,e,t+1/3),a=Co(i,e,t),c=Co(i,e,t-1/3)}return{r:Math.round(255*r),g:Math.round(255*a),b:Math.round(255*c)}}function Co(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const xo="q-theme"
|
|
299
|
+
function Ao(e,n){let o=null
|
|
295
300
|
if(n)for(const e of n.themes){const t="light"===e.mode?_o:wo
|
|
296
301
|
if(e.colors){let t
|
|
297
302
|
for(t in e.colors){const n=e.colors[t]
|
|
298
|
-
if(n&&!t.startsWith("on")&&!t.endsWith("Light")&&!t.endsWith("Dark")){const o=
|
|
299
|
-
r in e.colors||(e.colors[r]=
|
|
303
|
+
if(n&&!t.startsWith("on")&&!t.endsWith("Light")&&!t.endsWith("Dark")){const o=jo(n),r=`${t}Light`,a=`${t}Dark`
|
|
304
|
+
r in e.colors||(e.colors[r]=So(ko(o,75))),a in e.colors||(e.colors[a]=So(Bo(o,25)))}}}e.colors=Nn(t,e.colors),e.name===n.defaultTheme&&(o=e)}else{const e="default"
|
|
300
305
|
o={name:e,mode:"light",colors:_o},n={defaultTheme:e,themes:[o]}}if(o){const r=t.ref({activeTheme:o.name,themes:n.themes})
|
|
301
306
|
t.watch((()=>r.value.activeTheme),(e=>{const t=r.value.themes.find((t=>t.name===e))
|
|
302
|
-
t&&
|
|
303
|
-
t||(t=document.createElement("style"),t.type="text/css",t.id=
|
|
307
|
+
t&&zo(t.colors)}),{immediate:!0}),e.provide(xo,r)}}function zo(e){let t=document.getElementById(xo)
|
|
308
|
+
t||(t=document.createElement("style"),t.type="text/css",t.id=xo,document.head.appendChild(t))
|
|
304
309
|
let n,o=":root {\n"
|
|
305
310
|
for(n in e){const t=e[n]
|
|
306
|
-
if(t){o+=` ${
|
|
307
|
-
const e=
|
|
308
|
-
o+=` ${
|
|
311
|
+
if(t){o+=` ${$o(n)}: ${t};\n`
|
|
312
|
+
const e=jo(t)
|
|
313
|
+
o+=` ${$o(n)}-rgb: ${e.r} ${e.g} ${e.b};\n`}}o+="}",t.textContent=o}function $o(e){return e?`--q-theme-${e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}`:""}function Do(e){const n=e.setup
|
|
309
314
|
return n&&(e.setup=(e,o)=>{const r=Un()
|
|
310
315
|
if(function(e){if(null==e)return!0
|
|
311
316
|
if(pe(e)&&(j(e)||"string"==typeof e||"function"==typeof e.splice||Se(e)||Te(e)||we(e)))return!e.length
|
|
@@ -319,9 +324,9 @@ if(null===a)return n(e,o)
|
|
|
319
324
|
const c=new Proxy(e,{get(e,n){const o=Reflect.get(e,n),c=t.unref(r[n])
|
|
320
325
|
return"class"===n||"style"===n?[c,o].filter((e=>null!=e)):"string"!=typeof n||function(e,t){var n
|
|
321
326
|
return typeof(null==(n=e.props)?void 0:n[t])<"u"}(a.vnode,n)?o:c??o}})
|
|
322
|
-
return n(c,o)}),e}e.DEFAULTS_SYMBOL=Qn,e.THEME_SYMBOL=
|
|
327
|
+
return n(c,o)}),e}e.DEFAULTS_SYMBOL=Qn,e.THEME_SYMBOL=xo,e.computePosition=ro,e.createFramework=e=>function(e,t){return{install:n=>{for(const t in e)n.component(t,Do(e[t]))
|
|
323
328
|
const o=(null==t?void 0:t.defaults)||{}
|
|
324
|
-
n.provide(Qn,o)
|
|
329
|
+
n.provide(Qn,o),Ao(n,null==t?void 0:t.themes)}}}(go,e),e.generateRootStyle=zo,e.injectDefaults=Hn,e.installThemes=Ao,e.provideDefaults=Rn,e.toProperty=$o,e.useDefaults=Un,e.useTheme=function(){const e=t.inject(xo)
|
|
325
330
|
if(!e)throw new Error("[framework] Could not find theme instance")
|
|
326
331
|
return e},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}))
|
|
327
332
|
//# sourceMappingURL=ui.min.js.map
|