vue-quest-ui 0.0.8 → 0.0.10
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/vue-quest-ui.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.base-icon__wrapper[data-v-af0f176c]{display:inline-flex;align-items:center;justify-content:center}.image-icon[data-v-af0f176c]{width:1.1em}.user-image__wrapper[data-v-5fa938c7]{display:inline-block}.user-image[data-v-5fa938c7]{border-radius:50%;width:2.35em}.user-icon[data-v-5fa938c7]{color:var(--37a07012)}.user-icon [data-v-5fa938c7] svg{width:2.3em;height:2.3em}.
|
|
1
|
+
.base-icon__wrapper[data-v-af0f176c]{display:inline-flex;align-items:center;justify-content:center}.image-icon[data-v-af0f176c]{width:1.1em}.user-image__wrapper[data-v-5fa938c7]{display:inline-block}.user-image[data-v-5fa938c7]{border-radius:50%;width:2.35em}.user-icon[data-v-5fa938c7]{color:var(--37a07012)}.user-icon [data-v-5fa938c7] svg{width:2.3em;height:2.3em}.user-image__wrapper[data-v-72891255]{display:inline-block}.user-image[data-v-72891255]{border-radius:50%;width:2.35em}[data-v-72891255] .user-icon svg{width:2.3em!important;height:2.3em!important}[data-v-72891255] .user-icon.icon-border{border:1px solid white;border-radius:50%}.user-image__wrapper[data-v-7173ea41]{display:inline-block}.user--image[data-v-7173ea41]{border-radius:50%;width:2.35em}[data-v-7173ea41] .user--icon svg{width:2.3em!important;height:2.3em!important}[data-v-7173ea41] .user--icon.icon-border{border:1px solid white;border-radius:50%}.base-icon__wrapper[data-v-369c65cf]{display:inline-flex;align-items:center;justify-content:center}.base-icon__wrapper.icon--align[data-v-369c65cf]{vertical-align:sub}.image-icon[data-v-369c65cf]{width:1.1em}.user-image__wrapper.user--image[data-v-196f14f1]{display:inline-block}.user-image__wrapper.user--image .user-item[data-v-196f14f1]{width:2.5em}.user-image__wrapper.user--icon[data-v-196f14f1]{display:inline-flex}.user-item[data-v-196f14f1]{border-radius:50%}[data-v-196f14f1] .base-icon__wrapper{border:1px solid white}[data-v-196f14f1] .base-icon__wrapper svg{width:2.375em!important;height:2.375em!important}
|
package/dist/vue-quest-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ve, h as K, computed as Se, createElementBlock as
|
|
1
|
+
import { defineComponent as ve, h as K, computed as Se, createElementBlock as M, openBlock as k, normalizeClass as le, normalizeStyle as B, createBlock as ue, unref as ke } from "vue";
|
|
2
2
|
const ae = /^[a-z0-9]+(-[a-z0-9]+)*$/, z = (e, t, o, i = "") => {
|
|
3
3
|
const n = e.split(":");
|
|
4
4
|
if (e.slice(0, 1) === "@") {
|
|
@@ -44,13 +44,13 @@ const ae = /^[a-z0-9]+(-[a-z0-9]+)*$/, z = (e, t, o, i = "") => {
|
|
|
44
44
|
width: 16,
|
|
45
45
|
height: 16
|
|
46
46
|
}
|
|
47
|
-
),
|
|
47
|
+
), _ = Object.freeze({
|
|
48
48
|
rotate: 0,
|
|
49
49
|
vFlip: !1,
|
|
50
50
|
hFlip: !1
|
|
51
51
|
}), N = Object.freeze({
|
|
52
52
|
...fe,
|
|
53
|
-
...
|
|
53
|
+
..._
|
|
54
54
|
}), $ = Object.freeze({
|
|
55
55
|
...N,
|
|
56
56
|
body: "",
|
|
@@ -65,7 +65,7 @@ function Te(e, t) {
|
|
|
65
65
|
function J(e, t) {
|
|
66
66
|
const o = Te(e, t);
|
|
67
67
|
for (const i in $)
|
|
68
|
-
i in
|
|
68
|
+
i in _ ? i in e && !(i in o) && (o[i] = _[i]) : i in t ? o[i] = t[i] : i in e && (o[i] = e[i]);
|
|
69
69
|
return o;
|
|
70
70
|
}
|
|
71
71
|
function Ce(e, t) {
|
|
@@ -224,8 +224,8 @@ const me = Object.freeze({
|
|
|
224
224
|
// Dimensions
|
|
225
225
|
...me,
|
|
226
226
|
// Transformations
|
|
227
|
-
...
|
|
228
|
-
}),
|
|
227
|
+
..._
|
|
228
|
+
}), Me = /(-?[0-9.]*[0-9]+[0-9.]*)/g, _e = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
229
229
|
function Y(e, t, o) {
|
|
230
230
|
if (t === 1)
|
|
231
231
|
return e;
|
|
@@ -233,11 +233,11 @@ function Y(e, t, o) {
|
|
|
233
233
|
return Math.ceil(e * t * o) / o;
|
|
234
234
|
if (typeof e != "string")
|
|
235
235
|
return e;
|
|
236
|
-
const i = e.split(
|
|
236
|
+
const i = e.split(Me);
|
|
237
237
|
if (i === null || !i.length)
|
|
238
238
|
return e;
|
|
239
239
|
const n = [];
|
|
240
|
-
let s = i.shift(), r =
|
|
240
|
+
let s = i.shift(), r = _e.test(s);
|
|
241
241
|
for (; ; ) {
|
|
242
242
|
if (r) {
|
|
243
243
|
const c = parseFloat(s);
|
|
@@ -1216,11 +1216,11 @@ const St = {
|
|
|
1216
1216
|
} : t.color ? { color: t.color } : null);
|
|
1217
1217
|
return (i, n) => {
|
|
1218
1218
|
var s;
|
|
1219
|
-
return k(),
|
|
1219
|
+
return k(), M("div", {
|
|
1220
1220
|
style: B({ fontSize: e.size }),
|
|
1221
1221
|
class: le([{ "icon--align": e.alignText }, "base-icon__wrapper"])
|
|
1222
1222
|
}, [
|
|
1223
|
-
(s = e.icon) != null && s.startsWith("https") ? (k(),
|
|
1223
|
+
(s = e.icon) != null && s.startsWith("https") ? (k(), M("img", {
|
|
1224
1224
|
key: 0,
|
|
1225
1225
|
src: e.icon,
|
|
1226
1226
|
class: "image-icon"
|
|
@@ -1232,7 +1232,7 @@ const St = {
|
|
|
1232
1232
|
], 6);
|
|
1233
1233
|
};
|
|
1234
1234
|
}
|
|
1235
|
-
}, Pt = /* @__PURE__ */ we(Ct, [["__scopeId", "data-v-369c65cf"]]), jt =
|
|
1235
|
+
}, Pt = /* @__PURE__ */ we(Ct, [["__scopeId", "data-v-369c65cf"]]), jt = ["src"], Et = {
|
|
1236
1236
|
__name: "UserImage",
|
|
1237
1237
|
props: {
|
|
1238
1238
|
image: {
|
|
@@ -1258,24 +1258,26 @@ const St = {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
},
|
|
1260
1260
|
setup(e) {
|
|
1261
|
-
return (t, o) => (k(),
|
|
1262
|
-
e.image ?
|
|
1261
|
+
return (t, o) => (k(), M("div", {
|
|
1262
|
+
class: le([e.image ? "user--image" : "user--icon", "user-image__wrapper"])
|
|
1263
|
+
}, [
|
|
1264
|
+
e.image ? (k(), M("img", {
|
|
1263
1265
|
key: 0,
|
|
1264
1266
|
src: e.image,
|
|
1265
1267
|
style: B({ fontSize: e.size }),
|
|
1266
|
-
class: "user-
|
|
1267
|
-
}, null, 12,
|
|
1268
|
+
class: "user-item"
|
|
1269
|
+
}, null, 12, jt)) : (k(), ue(Pt, {
|
|
1268
1270
|
key: 1,
|
|
1269
1271
|
icon: "ph:user-fill",
|
|
1270
1272
|
size: e.size,
|
|
1271
1273
|
circle: "",
|
|
1272
1274
|
color: e.backgroundColor,
|
|
1273
|
-
class:
|
|
1274
|
-
}, null, 8, ["size", "color"
|
|
1275
|
-
]));
|
|
1275
|
+
class: "user-item"
|
|
1276
|
+
}, null, 8, ["size", "color"]))
|
|
1277
|
+
], 2));
|
|
1276
1278
|
}
|
|
1277
|
-
},
|
|
1279
|
+
}, Ft = /* @__PURE__ */ we(Et, [["__scopeId", "data-v-196f14f1"]]);
|
|
1278
1280
|
export {
|
|
1279
1281
|
Pt as BaseIcon,
|
|
1280
|
-
|
|
1282
|
+
Ft as UserImage
|
|
1281
1283
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],p):(k=typeof globalThis<"u"?globalThis:k||self,p(k.QuestUI={},k.Vue))})(this,function(k,p){"use strict";const W=/^[a-z0-9]+(-[a-z0-9]+)*$/,L=(e,t,o,i="")=>{const n=e.split(":");if(e.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const c=n.pop(),l=n.pop(),a={provider:n.length>0?n[0]:i,prefix:l,name:c};return t&&!O(a)?null:a}const s=n[0],r=s.split("-");if(r.length>1){const c={provider:i,prefix:r.shift(),name:r.join("-")};return t&&!O(c)?null:c}if(o&&i===""){const c={provider:i,prefix:"",name:s};return t&&!O(c,o)?null:c}return null},O=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,K=Object.freeze({left:0,top:0,width:16,height:16}),A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),_=Object.freeze({...K,...A}),q=Object.freeze({..._,body:"",hidden:!1});function xe(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(o.rotate=i),o}function J(e,t){const o=xe(e,t);for(const i in q)i in A?i in e&&!(i in o)&&(o[i]=A[i]):i in t?o[i]=t[i]:i in e&&(o[i]=e[i]);return o}function Ie(e,t){const o=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);function s(r){if(o[r])return n[r]=[];if(!(r in n)){n[r]=null;const c=i[r]&&i[r].parent,l=c&&s(c);l&&(n[r]=[c].concat(l))}return n[r]}return Object.keys(o).concat(Object.keys(i)).forEach(s),n}function we(e,t,o){const i=e.icons,n=e.aliases||Object.create(null);let s={};function r(c){s=J(i[c]||n[c],s)}return r(t),o.forEach(r),J(e,s)}function X(e,t){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(n=>{t(n,null),o.push(n)});const i=Ie(e);for(const n in i){const s=i[n];s&&(t(n,we(e,n,s)),o.push(n))}return o}const ke={provider:"",aliases:{},not_found:{},...K};function N(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function Y(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!N(e,ke))return null;const o=t.icons;for(const n in o){const s=o[n];if(!n||typeof s.body!="string"||!N(s,q))return null}const i=t.aliases||Object.create(null);for(const n in i){const s=i[n],r=s.parent;if(!n||typeof r!="string"||!o[r]&&!i[r]||!N(s,q))return null}return t}const Z=Object.create(null);function Se(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function v(e,t){const o=Z[e]||(Z[e]=Object.create(null));return o[t]||(o[t]=Se(e,t))}function ee(e,t){return Y(t)?X(t,(o,i)=>{i?e.icons[o]=i:e.missing.add(o)}):[]}function Te(e,t,o){try{if(typeof o.body=="string")return e.icons[t]={...o},!0}catch{}return!1}let j=!1;function te(e){return typeof e=="boolean"&&(j=e),j}function ve(e){const t=typeof e=="string"?L(e,!0,j):e;if(t){const o=v(t.provider,t.prefix),i=t.name;return o.icons[i]||(o.missing.has(i)?null:void 0)}}function Ce(e,t){const o=L(e,!0,j);if(!o)return!1;const i=v(o.provider,o.prefix);return t?Te(i,o.name,t):(i.missing.add(o.name),!0)}function je(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),j&&!t&&!e.prefix){let n=!1;return Y(e)&&(e.prefix="",X(e,(s,r)=>{Ce(s,r)&&(n=!0)})),n}const o=e.prefix;if(!O({prefix:o,name:"a"}))return!1;const i=v(t,o);return!!ee(i,e)}const ne=Object.freeze({width:null,height:null}),oe=Object.freeze({...ne,...A}),Pe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ee=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ie(e,t,o){if(t===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*t*o)/o;if(typeof e!="string")return e;const i=e.split(Pe);if(i===null||!i.length)return e;const n=[];let s=i.shift(),r=Ee.test(s);for(;;){if(r){const c=parseFloat(s);isNaN(c)?n.push(s):n.push(Math.ceil(c*t*o)/o)}else n.push(s);if(s=i.shift(),s===void 0)return n.join("");r=!r}}function Fe(e,t="defs"){let o="";const i=e.indexOf("<"+t);for(;i>=0;){const n=e.indexOf(">",i),s=e.indexOf("</"+t);if(n===-1||s===-1)break;const r=e.indexOf(">",s);if(r===-1)break;o+=e.slice(n+1,s).trim(),e=e.slice(0,i).trim()+e.slice(r+1)}return{defs:o,content:e}}function Le(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Oe(e,t,o){const i=Fe(e);return Le(i.defs,t+i.content+o)}const Ae=e=>e==="unset"||e==="undefined"||e==="none";function _e(e,t){const o={..._,...e},i={...oe,...t},n={left:o.left,top:o.top,width:o.width,height:o.height};let s=o.body;[o,i].forEach(m=>{const f=[],C=m.hFlip,S=m.vFlip;let I=m.rotate;C?S?I+=2:(f.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),f.push("scale(-1 1)"),n.top=n.left=0):S&&(f.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),f.push("scale(1 -1)"),n.top=n.left=0);let b;switch(I<0&&(I-=Math.floor(I/4)*4),I=I%4,I){case 1:b=n.height/2+n.top,f.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:f.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:b=n.width/2+n.left,f.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}I%2===1&&(n.left!==n.top&&(b=n.left,n.left=n.top,n.top=b),n.width!==n.height&&(b=n.width,n.width=n.height,n.height=b)),f.length&&(s=Oe(s,'<g transform="'+f.join(" ")+'">',"</g>"))});const r=i.width,c=i.height,l=n.width,a=n.height;let u,d;r===null?(d=c===null?"1em":c==="auto"?a:c,u=ie(d,l/a)):(u=r==="auto"?l:r,d=c===null?ie(u,a/l):c==="auto"?a:c);const g={},y=(m,f)=>{Ae(f)||(g[m]=f.toString())};y("width",u),y("height",d);const w=[n.left,n.top,l,a];return g.viewBox=w.join(" "),{attributes:g,viewBox:w,body:s}}const Me=/\sid="(\S+)"/g,ze="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Be=0;function qe(e,t=ze){const o=[];let i;for(;i=Me.exec(e);)o.push(i[1]);if(!o.length)return e;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(s=>{const r=typeof t=="function"?t(s):t+(Be++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+r+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}const R=Object.create(null);function Ne(e,t){R[e]=t}function D(e){return R[e]||R[""]}function U(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const $=Object.create(null),P=["https://api.simplesvg.com","https://api.unisvg.com"],M=[];for(;P.length>0;)P.length===1||Math.random()>.5?M.push(P.shift()):M.push(P.pop());$[""]=U({resources:["https://api.iconify.design"].concat(M)});function Re(e,t){const o=U(t);return o===null?!1:($[e]=o,!0)}function Q(e){return $[e]}let se=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function De(e,t){const o=Q(e);if(!o)return 0;let i;if(!o.maxURL)i=0;else{let n=0;o.resources.forEach(r=>{n=Math.max(n,r.length)});const s=t+".json?icons=";i=o.maxURL-n-o.path.length-s.length}return i}function Ue(e){return e===404}const $e=(e,t,o)=>{const i=[],n=De(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},c=0;return o.forEach((l,a)=>{c+=l.length+1,c>=n&&a>0&&(i.push(r),r={type:s,provider:e,prefix:t,icons:[]},c=l.length),r.icons.push(l)}),i.push(r),i};function Qe(e){if(typeof e=="string"){const t=Q(e);if(t)return t.path}return"/"}const Ve={prepare:$e,send:(e,t,o)=>{if(!se){o("abort",424);return}let i=Qe(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});i+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:o("abort",400);return}let n=503;se(e+i).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{o(Ue(r)?"abort":"next",r)});return}return n=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?o("abort",s):o("next",n)});return}setTimeout(()=>{o("success",s)})}).catch(()=>{o("next",n)})}};function He(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((n,s)=>n.provider!==s.provider?n.provider.localeCompare(s.provider):n.prefix!==s.prefix?n.prefix.localeCompare(s.prefix):n.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(n=>{if(i.name===n.name&&i.prefix===n.prefix&&i.provider===n.provider)return;i=n;const s=n.provider,r=n.prefix,c=n.name,l=o[s]||(o[s]=Object.create(null)),a=l[r]||(l[r]=v(s,r));let u;c in a.icons?u=t.loaded:r===""||a.missing.has(c)?u=t.missing:u=t.pending;const d={provider:s,prefix:r,name:c};u.push(d)}),t}function re(e,t){e.forEach(o=>{const i=o.loaderCallbacks;i&&(o.loaderCallbacks=i.filter(n=>n.id!==t))})}function Ge(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let o=!1;const i=e.provider,n=e.prefix;t.forEach(s=>{const r=s.icons,c=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==n)return!0;const a=l.name;if(e.icons[a])r.loaded.push({provider:i,prefix:n,name:a});else if(e.missing.has(a))r.missing.push({provider:i,prefix:n,name:a});else return o=!0,!0;return!1}),r.pending.length!==c&&(o||re([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let We=0;function Ke(e,t,o){const i=We++,n=re.bind(null,o,i);if(!t.pending.length)return n;const s={id:i,icons:t,callback:e,abort:n};return o.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),n}function Je(e,t=!0,o=!1){const i=[];return e.forEach(n=>{const s=typeof n=="string"?L(n,t,o):n;s&&i.push(s)}),i}var Xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ye(e,t,o,i){const n=e.resources.length,s=e.random?Math.floor(Math.random()*n):e.index;let r;if(e.random){let h=e.resources.slice(0);for(r=[];h.length>1;){const x=Math.floor(Math.random()*h.length);r.push(h[x]),h=h.slice(0,x).concat(h.slice(x+1))}r=r.concat(h)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",a=0,u,d=null,g=[],y=[];typeof i=="function"&&y.push(i);function w(){d&&(clearTimeout(d),d=null)}function m(){l==="pending"&&(l="aborted"),w(),g.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),g=[]}function f(h,x){x&&(y=[]),typeof h=="function"&&y.push(h)}function C(){return{startTime:c,payload:t,status:l,queriesSent:a,queriesPending:g.length,subscribe:f,abort:m}}function S(){l="failed",y.forEach(h=>{h(void 0,u)})}function I(){g.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),g=[]}function b(h,x,F){const B=x!=="success";switch(g=g.filter(T=>T!==h),l){case"pending":break;case"failed":if(B||!e.dataAfterTimeout)return;break;default:return}if(x==="abort"){u=F,S();return}if(B){u=F,g.length||(r.length?G():S());return}if(w(),I(),!e.random){const T=e.resources.indexOf(h.resource);T!==-1&&T!==e.index&&(e.index=T)}l="completed",y.forEach(T=>{T(F)})}function G(){if(l!=="pending")return;w();const h=r.shift();if(h===void 0){if(g.length){d=setTimeout(()=>{w(),l==="pending"&&(I(),S())},e.timeout);return}S();return}const x={status:"pending",resource:h,callback:(F,B)=>{b(x,F,B)}};g.push(x),a++,d=setTimeout(G,e.rotate),o(h,t,x.callback)}return setTimeout(G),C}function ce(e){const t={...Xe,...e};let o=[];function i(){o=o.filter(c=>c().status==="pending")}function n(c,l,a){const u=Ye(t,c,l,(d,g)=>{i(),a&&a(d,g)});return o.push(u),u}function s(c){return o.find(l=>c(l))||null}return{query:n,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:i}}function le(){}const V=Object.create(null);function Ze(e){if(!V[e]){const t=Q(e);if(!t)return;const o=ce(t),i={config:t,redundancy:o};V[e]=i}return V[e]}function et(e,t,o){let i,n;if(typeof e=="string"){const s=D(e);if(!s)return o(void 0,424),le;n=s.send;const r=Ze(e);r&&(i=r.redundancy)}else{const s=U(e);if(s){i=ce(s);const r=e.resources?e.resources[0]:"",c=D(r);c&&(n=c.send)}}return!i||!n?(o(void 0,424),le):i.query(t,n,o)().abort}function ae(){}function tt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ge(e)}))}function nt(e){const t=[],o=[];return e.forEach(i=>{(i.match(W)?t:o).push(i)}),{valid:t,invalid:o}}function E(e,t,o){function i(){const n=e.pendingIcons;t.forEach(s=>{n&&n.delete(s),e.icons[s]||e.missing.add(s)})}if(o&&typeof o=="object")try{if(!ee(e,o).length){i();return}}catch(n){console.error(n)}i(),tt(e)}function fe(e,t){e instanceof Promise?e.then(o=>{t(o)}).catch(()=>{t(null)}):t(e)}function ot(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:i}=e,n=e.iconsToLoad;if(delete e.iconsToLoad,!n||!n.length)return;const s=e.loadIcon;if(e.loadIcons&&(n.length>1||!s)){fe(e.loadIcons(n,i,o),u=>{E(e,n,u)});return}if(s){n.forEach(u=>{const d=s(u,i,o);fe(d,g=>{const y=g?{prefix:i,icons:{[u]:g}}:null;E(e,[u],y)})});return}const{valid:r,invalid:c}=nt(n);if(c.length&&E(e,c,null),!r.length)return;const l=i.match(W)?D(o):null;if(!l){E(e,r,null);return}l.prepare(o,i,r).forEach(u=>{et(o,u,d=>{E(e,u.icons,d)})})}))}const it=(e,t)=>{const o=Je(e,!0,te()),i=He(o);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,ae)}),()=>{l=!1}}const n=Object.create(null),s=[];let r,c;return i.pending.forEach(l=>{const{provider:a,prefix:u}=l;if(u===c&&a===r)return;r=a,c=u,s.push(v(a,u));const d=n[a]||(n[a]=Object.create(null));d[u]||(d[u]=[])}),i.pending.forEach(l=>{const{provider:a,prefix:u,name:d}=l,g=v(a,u),y=g.pendingIcons||(g.pendingIcons=new Set);y.has(d)||(y.add(d),n[a][u].push(d))}),s.forEach(l=>{const a=n[l.provider][l.prefix];a.length&&ot(l,a)}),t?Ke(t,i,s):ae};function st(e,t){const o={...e};for(const i in t){const n=t[i],s=typeof n;i in ne?(n===null||n&&(s==="string"||s==="number"))&&(o[i]=n):s===typeof o[i]&&(o[i]=i==="rotate"?n%4:n)}return o}const rt=/[\s,]+/;function ct(e,t){t.split(rt).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function lt(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function i(n){for(;n<0;)n+=4;return n%4}if(o===""){const n=parseInt(e);return isNaN(n)?0:i(n)}else if(o!==e){let n=0;switch(o){case"%":n=25;break;case"deg":n=90}if(n){let s=parseFloat(e.slice(0,e.length-o.length));return isNaN(s)?0:(s=s/n,s%1===0?i(s):0)}}return t}function at(e,t){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)o+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}function ft(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ut(e){return"data:image/svg+xml,"+ft(e)}function dt(e){return'url("'+ut(e)+'")'}const ue={...oe,inline:!1},pt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ht={display:"inline-block"},H={backgroundColor:"currentColor"},de={backgroundColor:"transparent"},pe={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},he={webkitMask:H,mask:H,background:de};for(const e in he){const t=he[e];for(const o in pe)t[e+o]=pe[o]}const z={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";z[e+"-flip"]=t,z[e.slice(0,1)+"-flip"]=t,z[e+"Flip"]=t});function ge(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const me=(e,t)=>{const o=st(ue,t),i={...pt},n=t.mode||"svg",s={},r=t.style,c=typeof r=="object"&&!(r instanceof Array)?r:{};for(let m in t){const f=t[m];if(f!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[m]=f===!0||f==="true"||f===1;break;case"flip":typeof f=="string"&&ct(o,f);break;case"color":s.color=f;break;case"rotate":typeof f=="string"?o[m]=lt(f):typeof f=="number"&&(o[m]=f);break;case"ariaHidden":case"aria-hidden":f!==!0&&f!=="true"&&delete i["aria-hidden"];break;default:{const C=z[m];C?(f===!0||f==="true"||f===1)&&(o[C]=!0):ue[m]===void 0&&(i[m]=f)}}}const l=_e(e,o),a=l.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),n==="svg"){i.style={...s,...c},Object.assign(i,a);let m=0,f=t.id;return typeof f=="string"&&(f=f.replace(/-/g,"_")),i.innerHTML=qe(l.body,f?()=>f+"ID"+m++:"iconifyVue"),p.h("svg",i)}const{body:u,width:d,height:g}=e,y=n==="mask"||(n==="bg"?!1:u.indexOf("currentColor")!==-1),w=at(u,{...a,width:d+"",height:g+""});return i.style={...s,"--svg":dt(w),width:ge(a.width),height:ge(a.height),...ht,...y?H:de,...c},p.h("span",i)};if(te(!0),Ne("",Ve),typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!je(i))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let o in t){const i="IconifyProviders["+o+"] is invalid.";try{const n=t[o];if(typeof n!="object"||!n||n.resources===void 0)continue;Re(o,n)||console.error(i)}catch{console.error(i)}}}}const gt={..._,body:""},mt=p.defineComponent({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t,o){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let i;if(typeof e!="string"||(i=L(e,!1,!0))===null)return this.abortLoading(),null;let n=ve(i);if(!n)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",n!==null&&(this._loadingIcon={name:e,abort:it([i],()=>{this.counter++})})),null;if(this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e)),o){n=Object.assign({},n);const r=o(n.body,i.name,i.prefix,i.provider);typeof r=="string"&&(n.body=r)}const s=["iconify"];return i.prefix!==""&&s.push("iconify--"+i.prefix),i.provider!==""&&s.push("iconify--"+i.provider),{data:n,classes:s}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad,e.customise):null;if(!t)return me(gt,e);let o=e;return t.classes&&(o={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),me({..._,...t.data},o)}}),ye=(e,t)=>{const o=e.__vccOpts||e;for(const[i,n]of t)o[i]=n;return o},yt=["src"],be=ye({__name:"BaseIcon",props:{icon:{type:String,required:!0,tsType:"string",description:"Any iconify value."},color:{type:String,required:!1,default:null,tsType:"string",description:"Color of the icon."},circle:{type:Boolean,required:!1,default:!1,tsType:"boolean",description:"Shows the icon in a circle."},size:{type:String,required:!1,default:"16px",tsType:"string",description:"Size of the icon."},alignText:{type:Boolean,required:!1,default:!1,tsType:"boolean",description:"Vertically aligns the icon and text."}},setup(e){const t=e,o=p.computed(()=>t.circle?{backgroundColor:t.color,color:"white",borderRadius:"50%",padding:"3px"}:t.color?{color:t.color}:null);return(i,n)=>{var s;return p.openBlock(),p.createElementBlock("div",{style:p.normalizeStyle({fontSize:e.size}),class:p.normalizeClass([{"icon--align":e.alignText},"base-icon__wrapper"])},[(s=e.icon)!=null&&s.startsWith("https")?(p.openBlock(),p.createElementBlock("img",{key:0,src:e.icon,class:"image-icon"},null,8,yt)):(p.openBlock(),p.createBlock(p.unref(mt),{key:1,icon:e.icon,style:p.normalizeStyle(o.value)},null,8,["icon","style"]))],6)}}},[["__scopeId","data-v-369c65cf"]]),bt={class:"user-image__wrapper"},xt=["src"],It=ye({__name:"UserImage",props:{image:{type:String,required:!1,default:null,tsType:"string",description:"The image for the user, if not provided defaults to a user icon."},size:{type:String,required:!1,default:"14px",tsType:"string",description:"Size of the image."},backgroundColor:{type:String,required:!1,default:null,tsType:"string",description:"Background color when showing the user icon."}},setup(e){return(t,o)=>(p.openBlock(),p.createElementBlock("div",bt,[e.image?(p.openBlock(),p.createElementBlock("img",{key:0,src:e.image,style:p.normalizeStyle({fontSize:e.size}),class:"user-image"},null,12,xt)):(p.openBlock(),p.createBlock(be,{key:1,icon:"ph:user-fill",size:e.size,circle:"",color:e.backgroundColor,class:p.normalizeClass([{"icon-border":!e.backgroundColor},"user-icon"])},null,8,["size","color","class"]))]))}},[["__scopeId","data-v-72891255"]]);k.BaseIcon=be,k.UserImage=It,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(k,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],p):(k=typeof globalThis<"u"?globalThis:k||self,p(k.QuestUI={},k.Vue))})(this,function(k,p){"use strict";const W=/^[a-z0-9]+(-[a-z0-9]+)*$/,L=(e,t,o,i="")=>{const n=e.split(":");if(e.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const c=n.pop(),l=n.pop(),a={provider:n.length>0?n[0]:i,prefix:l,name:c};return t&&!O(a)?null:a}const s=n[0],r=s.split("-");if(r.length>1){const c={provider:i,prefix:r.shift(),name:r.join("-")};return t&&!O(c)?null:c}if(o&&i===""){const c={provider:i,prefix:"",name:s};return t&&!O(c,o)?null:c}return null},O=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,K=Object.freeze({left:0,top:0,width:16,height:16}),A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),_=Object.freeze({...K,...A}),q=Object.freeze({..._,body:"",hidden:!1});function xe(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(o.rotate=i),o}function J(e,t){const o=xe(e,t);for(const i in q)i in A?i in e&&!(i in o)&&(o[i]=A[i]):i in t?o[i]=t[i]:i in e&&(o[i]=e[i]);return o}function Ie(e,t){const o=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);function s(r){if(o[r])return n[r]=[];if(!(r in n)){n[r]=null;const c=i[r]&&i[r].parent,l=c&&s(c);l&&(n[r]=[c].concat(l))}return n[r]}return Object.keys(o).concat(Object.keys(i)).forEach(s),n}function we(e,t,o){const i=e.icons,n=e.aliases||Object.create(null);let s={};function r(c){s=J(i[c]||n[c],s)}return r(t),o.forEach(r),J(e,s)}function X(e,t){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(n=>{t(n,null),o.push(n)});const i=Ie(e);for(const n in i){const s=i[n];s&&(t(n,we(e,n,s)),o.push(n))}return o}const ke={provider:"",aliases:{},not_found:{},...K};function N(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function Y(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!N(e,ke))return null;const o=t.icons;for(const n in o){const s=o[n];if(!n||typeof s.body!="string"||!N(s,q))return null}const i=t.aliases||Object.create(null);for(const n in i){const s=i[n],r=s.parent;if(!n||typeof r!="string"||!o[r]&&!i[r]||!N(s,q))return null}return t}const Z=Object.create(null);function Se(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function v(e,t){const o=Z[e]||(Z[e]=Object.create(null));return o[t]||(o[t]=Se(e,t))}function ee(e,t){return Y(t)?X(t,(o,i)=>{i?e.icons[o]=i:e.missing.add(o)}):[]}function Te(e,t,o){try{if(typeof o.body=="string")return e.icons[t]={...o},!0}catch{}return!1}let j=!1;function te(e){return typeof e=="boolean"&&(j=e),j}function ve(e){const t=typeof e=="string"?L(e,!0,j):e;if(t){const o=v(t.provider,t.prefix),i=t.name;return o.icons[i]||(o.missing.has(i)?null:void 0)}}function Ce(e,t){const o=L(e,!0,j);if(!o)return!1;const i=v(o.provider,o.prefix);return t?Te(i,o.name,t):(i.missing.add(o.name),!0)}function je(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),j&&!t&&!e.prefix){let n=!1;return Y(e)&&(e.prefix="",X(e,(s,r)=>{Ce(s,r)&&(n=!0)})),n}const o=e.prefix;if(!O({prefix:o,name:"a"}))return!1;const i=v(t,o);return!!ee(i,e)}const ne=Object.freeze({width:null,height:null}),oe=Object.freeze({...ne,...A}),Pe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ee=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ie(e,t,o){if(t===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*t*o)/o;if(typeof e!="string")return e;const i=e.split(Pe);if(i===null||!i.length)return e;const n=[];let s=i.shift(),r=Ee.test(s);for(;;){if(r){const c=parseFloat(s);isNaN(c)?n.push(s):n.push(Math.ceil(c*t*o)/o)}else n.push(s);if(s=i.shift(),s===void 0)return n.join("");r=!r}}function Fe(e,t="defs"){let o="";const i=e.indexOf("<"+t);for(;i>=0;){const n=e.indexOf(">",i),s=e.indexOf("</"+t);if(n===-1||s===-1)break;const r=e.indexOf(">",s);if(r===-1)break;o+=e.slice(n+1,s).trim(),e=e.slice(0,i).trim()+e.slice(r+1)}return{defs:o,content:e}}function Le(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Oe(e,t,o){const i=Fe(e);return Le(i.defs,t+i.content+o)}const Ae=e=>e==="unset"||e==="undefined"||e==="none";function _e(e,t){const o={..._,...e},i={...oe,...t},n={left:o.left,top:o.top,width:o.width,height:o.height};let s=o.body;[o,i].forEach(m=>{const f=[],C=m.hFlip,S=m.vFlip;let I=m.rotate;C?S?I+=2:(f.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),f.push("scale(-1 1)"),n.top=n.left=0):S&&(f.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),f.push("scale(1 -1)"),n.top=n.left=0);let b;switch(I<0&&(I-=Math.floor(I/4)*4),I=I%4,I){case 1:b=n.height/2+n.top,f.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:f.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:b=n.width/2+n.left,f.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}I%2===1&&(n.left!==n.top&&(b=n.left,n.left=n.top,n.top=b),n.width!==n.height&&(b=n.width,n.width=n.height,n.height=b)),f.length&&(s=Oe(s,'<g transform="'+f.join(" ")+'">',"</g>"))});const r=i.width,c=i.height,l=n.width,a=n.height;let u,d;r===null?(d=c===null?"1em":c==="auto"?a:c,u=ie(d,l/a)):(u=r==="auto"?l:r,d=c===null?ie(u,a/l):c==="auto"?a:c);const g={},y=(m,f)=>{Ae(f)||(g[m]=f.toString())};y("width",u),y("height",d);const w=[n.left,n.top,l,a];return g.viewBox=w.join(" "),{attributes:g,viewBox:w,body:s}}const Me=/\sid="(\S+)"/g,ze="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Be=0;function qe(e,t=ze){const o=[];let i;for(;i=Me.exec(e);)o.push(i[1]);if(!o.length)return e;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(s=>{const r=typeof t=="function"?t(s):t+(Be++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+r+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}const R=Object.create(null);function Ne(e,t){R[e]=t}function D(e){return R[e]||R[""]}function U(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const $=Object.create(null),P=["https://api.simplesvg.com","https://api.unisvg.com"],M=[];for(;P.length>0;)P.length===1||Math.random()>.5?M.push(P.shift()):M.push(P.pop());$[""]=U({resources:["https://api.iconify.design"].concat(M)});function Re(e,t){const o=U(t);return o===null?!1:($[e]=o,!0)}function Q(e){return $[e]}let se=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function De(e,t){const o=Q(e);if(!o)return 0;let i;if(!o.maxURL)i=0;else{let n=0;o.resources.forEach(r=>{n=Math.max(n,r.length)});const s=t+".json?icons=";i=o.maxURL-n-o.path.length-s.length}return i}function Ue(e){return e===404}const $e=(e,t,o)=>{const i=[],n=De(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},c=0;return o.forEach((l,a)=>{c+=l.length+1,c>=n&&a>0&&(i.push(r),r={type:s,provider:e,prefix:t,icons:[]},c=l.length),r.icons.push(l)}),i.push(r),i};function Qe(e){if(typeof e=="string"){const t=Q(e);if(t)return t.path}return"/"}const Ve={prepare:$e,send:(e,t,o)=>{if(!se){o("abort",424);return}let i=Qe(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});i+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:o("abort",400);return}let n=503;se(e+i).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{o(Ue(r)?"abort":"next",r)});return}return n=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?o("abort",s):o("next",n)});return}setTimeout(()=>{o("success",s)})}).catch(()=>{o("next",n)})}};function He(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((n,s)=>n.provider!==s.provider?n.provider.localeCompare(s.provider):n.prefix!==s.prefix?n.prefix.localeCompare(s.prefix):n.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(n=>{if(i.name===n.name&&i.prefix===n.prefix&&i.provider===n.provider)return;i=n;const s=n.provider,r=n.prefix,c=n.name,l=o[s]||(o[s]=Object.create(null)),a=l[r]||(l[r]=v(s,r));let u;c in a.icons?u=t.loaded:r===""||a.missing.has(c)?u=t.missing:u=t.pending;const d={provider:s,prefix:r,name:c};u.push(d)}),t}function re(e,t){e.forEach(o=>{const i=o.loaderCallbacks;i&&(o.loaderCallbacks=i.filter(n=>n.id!==t))})}function Ge(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let o=!1;const i=e.provider,n=e.prefix;t.forEach(s=>{const r=s.icons,c=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==n)return!0;const a=l.name;if(e.icons[a])r.loaded.push({provider:i,prefix:n,name:a});else if(e.missing.has(a))r.missing.push({provider:i,prefix:n,name:a});else return o=!0,!0;return!1}),r.pending.length!==c&&(o||re([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let We=0;function Ke(e,t,o){const i=We++,n=re.bind(null,o,i);if(!t.pending.length)return n;const s={id:i,icons:t,callback:e,abort:n};return o.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),n}function Je(e,t=!0,o=!1){const i=[];return e.forEach(n=>{const s=typeof n=="string"?L(n,t,o):n;s&&i.push(s)}),i}var Xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ye(e,t,o,i){const n=e.resources.length,s=e.random?Math.floor(Math.random()*n):e.index;let r;if(e.random){let h=e.resources.slice(0);for(r=[];h.length>1;){const x=Math.floor(Math.random()*h.length);r.push(h[x]),h=h.slice(0,x).concat(h.slice(x+1))}r=r.concat(h)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",a=0,u,d=null,g=[],y=[];typeof i=="function"&&y.push(i);function w(){d&&(clearTimeout(d),d=null)}function m(){l==="pending"&&(l="aborted"),w(),g.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),g=[]}function f(h,x){x&&(y=[]),typeof h=="function"&&y.push(h)}function C(){return{startTime:c,payload:t,status:l,queriesSent:a,queriesPending:g.length,subscribe:f,abort:m}}function S(){l="failed",y.forEach(h=>{h(void 0,u)})}function I(){g.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),g=[]}function b(h,x,F){const B=x!=="success";switch(g=g.filter(T=>T!==h),l){case"pending":break;case"failed":if(B||!e.dataAfterTimeout)return;break;default:return}if(x==="abort"){u=F,S();return}if(B){u=F,g.length||(r.length?G():S());return}if(w(),I(),!e.random){const T=e.resources.indexOf(h.resource);T!==-1&&T!==e.index&&(e.index=T)}l="completed",y.forEach(T=>{T(F)})}function G(){if(l!=="pending")return;w();const h=r.shift();if(h===void 0){if(g.length){d=setTimeout(()=>{w(),l==="pending"&&(I(),S())},e.timeout);return}S();return}const x={status:"pending",resource:h,callback:(F,B)=>{b(x,F,B)}};g.push(x),a++,d=setTimeout(G,e.rotate),o(h,t,x.callback)}return setTimeout(G),C}function ce(e){const t={...Xe,...e};let o=[];function i(){o=o.filter(c=>c().status==="pending")}function n(c,l,a){const u=Ye(t,c,l,(d,g)=>{i(),a&&a(d,g)});return o.push(u),u}function s(c){return o.find(l=>c(l))||null}return{query:n,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:i}}function le(){}const V=Object.create(null);function Ze(e){if(!V[e]){const t=Q(e);if(!t)return;const o=ce(t),i={config:t,redundancy:o};V[e]=i}return V[e]}function et(e,t,o){let i,n;if(typeof e=="string"){const s=D(e);if(!s)return o(void 0,424),le;n=s.send;const r=Ze(e);r&&(i=r.redundancy)}else{const s=U(e);if(s){i=ce(s);const r=e.resources?e.resources[0]:"",c=D(r);c&&(n=c.send)}}return!i||!n?(o(void 0,424),le):i.query(t,n,o)().abort}function ae(){}function tt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ge(e)}))}function nt(e){const t=[],o=[];return e.forEach(i=>{(i.match(W)?t:o).push(i)}),{valid:t,invalid:o}}function E(e,t,o){function i(){const n=e.pendingIcons;t.forEach(s=>{n&&n.delete(s),e.icons[s]||e.missing.add(s)})}if(o&&typeof o=="object")try{if(!ee(e,o).length){i();return}}catch(n){console.error(n)}i(),tt(e)}function fe(e,t){e instanceof Promise?e.then(o=>{t(o)}).catch(()=>{t(null)}):t(e)}function ot(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:i}=e,n=e.iconsToLoad;if(delete e.iconsToLoad,!n||!n.length)return;const s=e.loadIcon;if(e.loadIcons&&(n.length>1||!s)){fe(e.loadIcons(n,i,o),u=>{E(e,n,u)});return}if(s){n.forEach(u=>{const d=s(u,i,o);fe(d,g=>{const y=g?{prefix:i,icons:{[u]:g}}:null;E(e,[u],y)})});return}const{valid:r,invalid:c}=nt(n);if(c.length&&E(e,c,null),!r.length)return;const l=i.match(W)?D(o):null;if(!l){E(e,r,null);return}l.prepare(o,i,r).forEach(u=>{et(o,u,d=>{E(e,u.icons,d)})})}))}const it=(e,t)=>{const o=Je(e,!0,te()),i=He(o);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,ae)}),()=>{l=!1}}const n=Object.create(null),s=[];let r,c;return i.pending.forEach(l=>{const{provider:a,prefix:u}=l;if(u===c&&a===r)return;r=a,c=u,s.push(v(a,u));const d=n[a]||(n[a]=Object.create(null));d[u]||(d[u]=[])}),i.pending.forEach(l=>{const{provider:a,prefix:u,name:d}=l,g=v(a,u),y=g.pendingIcons||(g.pendingIcons=new Set);y.has(d)||(y.add(d),n[a][u].push(d))}),s.forEach(l=>{const a=n[l.provider][l.prefix];a.length&&ot(l,a)}),t?Ke(t,i,s):ae};function st(e,t){const o={...e};for(const i in t){const n=t[i],s=typeof n;i in ne?(n===null||n&&(s==="string"||s==="number"))&&(o[i]=n):s===typeof o[i]&&(o[i]=i==="rotate"?n%4:n)}return o}const rt=/[\s,]+/;function ct(e,t){t.split(rt).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function lt(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function i(n){for(;n<0;)n+=4;return n%4}if(o===""){const n=parseInt(e);return isNaN(n)?0:i(n)}else if(o!==e){let n=0;switch(o){case"%":n=25;break;case"deg":n=90}if(n){let s=parseFloat(e.slice(0,e.length-o.length));return isNaN(s)?0:(s=s/n,s%1===0?i(s):0)}}return t}function at(e,t){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)o+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}function ft(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ut(e){return"data:image/svg+xml,"+ft(e)}function dt(e){return'url("'+ut(e)+'")'}const ue={...oe,inline:!1},pt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ht={display:"inline-block"},H={backgroundColor:"currentColor"},de={backgroundColor:"transparent"},pe={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},he={webkitMask:H,mask:H,background:de};for(const e in he){const t=he[e];for(const o in pe)t[e+o]=pe[o]}const z={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";z[e+"-flip"]=t,z[e.slice(0,1)+"-flip"]=t,z[e+"Flip"]=t});function ge(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const me=(e,t)=>{const o=st(ue,t),i={...pt},n=t.mode||"svg",s={},r=t.style,c=typeof r=="object"&&!(r instanceof Array)?r:{};for(let m in t){const f=t[m];if(f!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[m]=f===!0||f==="true"||f===1;break;case"flip":typeof f=="string"&&ct(o,f);break;case"color":s.color=f;break;case"rotate":typeof f=="string"?o[m]=lt(f):typeof f=="number"&&(o[m]=f);break;case"ariaHidden":case"aria-hidden":f!==!0&&f!=="true"&&delete i["aria-hidden"];break;default:{const C=z[m];C?(f===!0||f==="true"||f===1)&&(o[C]=!0):ue[m]===void 0&&(i[m]=f)}}}const l=_e(e,o),a=l.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),n==="svg"){i.style={...s,...c},Object.assign(i,a);let m=0,f=t.id;return typeof f=="string"&&(f=f.replace(/-/g,"_")),i.innerHTML=qe(l.body,f?()=>f+"ID"+m++:"iconifyVue"),p.h("svg",i)}const{body:u,width:d,height:g}=e,y=n==="mask"||(n==="bg"?!1:u.indexOf("currentColor")!==-1),w=at(u,{...a,width:d+"",height:g+""});return i.style={...s,"--svg":dt(w),width:ge(a.width),height:ge(a.height),...ht,...y?H:de,...c},p.h("span",i)};if(te(!0),Ne("",Ve),typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!je(i))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let o in t){const i="IconifyProviders["+o+"] is invalid.";try{const n=t[o];if(typeof n!="object"||!n||n.resources===void 0)continue;Re(o,n)||console.error(i)}catch{console.error(i)}}}}const gt={..._,body:""},mt=p.defineComponent({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t,o){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let i;if(typeof e!="string"||(i=L(e,!1,!0))===null)return this.abortLoading(),null;let n=ve(i);if(!n)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",n!==null&&(this._loadingIcon={name:e,abort:it([i],()=>{this.counter++})})),null;if(this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e)),o){n=Object.assign({},n);const r=o(n.body,i.name,i.prefix,i.provider);typeof r=="string"&&(n.body=r)}const s=["iconify"];return i.prefix!==""&&s.push("iconify--"+i.prefix),i.provider!==""&&s.push("iconify--"+i.provider),{data:n,classes:s}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad,e.customise):null;if(!t)return me(gt,e);let o=e;return t.classes&&(o={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),me({..._,...t.data},o)}}),ye=(e,t)=>{const o=e.__vccOpts||e;for(const[i,n]of t)o[i]=n;return o},yt=["src"],be=ye({__name:"BaseIcon",props:{icon:{type:String,required:!0,tsType:"string",description:"Any iconify value."},color:{type:String,required:!1,default:null,tsType:"string",description:"Color of the icon."},circle:{type:Boolean,required:!1,default:!1,tsType:"boolean",description:"Shows the icon in a circle."},size:{type:String,required:!1,default:"16px",tsType:"string",description:"Size of the icon."},alignText:{type:Boolean,required:!1,default:!1,tsType:"boolean",description:"Vertically aligns the icon and text."}},setup(e){const t=e,o=p.computed(()=>t.circle?{backgroundColor:t.color,color:"white",borderRadius:"50%",padding:"3px"}:t.color?{color:t.color}:null);return(i,n)=>{var s;return p.openBlock(),p.createElementBlock("div",{style:p.normalizeStyle({fontSize:e.size}),class:p.normalizeClass([{"icon--align":e.alignText},"base-icon__wrapper"])},[(s=e.icon)!=null&&s.startsWith("https")?(p.openBlock(),p.createElementBlock("img",{key:0,src:e.icon,class:"image-icon"},null,8,yt)):(p.openBlock(),p.createBlock(p.unref(mt),{key:1,icon:e.icon,style:p.normalizeStyle(o.value)},null,8,["icon","style"]))],6)}}},[["__scopeId","data-v-369c65cf"]]),bt=["src"],xt=ye({__name:"UserImage",props:{image:{type:String,required:!1,default:null,tsType:"string",description:"The image for the user, if not provided defaults to a user icon."},size:{type:String,required:!1,default:"14px",tsType:"string",description:"Size of the image."},backgroundColor:{type:String,required:!1,default:null,tsType:"string",description:"Background color when showing the user icon."}},setup(e){return(t,o)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass([e.image?"user--image":"user--icon","user-image__wrapper"])},[e.image?(p.openBlock(),p.createElementBlock("img",{key:0,src:e.image,style:p.normalizeStyle({fontSize:e.size}),class:"user-item"},null,12,bt)):(p.openBlock(),p.createBlock(be,{key:1,icon:"ph:user-fill",size:e.size,circle:"",color:e.backgroundColor,class:"user-item"},null,8,["size","color"]))],2))}},[["__scopeId","data-v-196f14f1"]]);k.BaseIcon=be,k.UserImage=xt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -28,28 +28,32 @@ const props = defineProps({
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<div class="user-image__wrapper">
|
|
32
|
-
<img v-if="!!image" :src="image" :style="{fontSize: size}" class="user-
|
|
33
|
-
<base-icon v-else icon="ph:user-fill" :size="size" circle :color="backgroundColor"
|
|
31
|
+
<div :class="!!image ? 'user--image' : 'user--icon'" class="user-image__wrapper">
|
|
32
|
+
<img v-if="!!image" :src="image" :style="{fontSize: size}" class="user-item" />
|
|
33
|
+
<base-icon v-else icon="ph:user-fill" :size="size" circle :color="backgroundColor" class="user-item" />
|
|
34
34
|
</div>
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<style scoped>
|
|
38
38
|
.user-image__wrapper{
|
|
39
|
-
|
|
39
|
+
&.user--image{
|
|
40
|
+
display: inline-block;
|
|
41
|
+
.user-item{
|
|
42
|
+
width: 2.5em;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
&.user--icon{
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
|
-
.user-
|
|
49
|
+
.user-item{
|
|
42
50
|
border-radius: 50%;
|
|
43
|
-
width: 2.35em;
|
|
44
51
|
}
|
|
45
|
-
:deep(.
|
|
52
|
+
:deep(.base-icon__wrapper){
|
|
53
|
+
border: 1px solid white;
|
|
46
54
|
svg{
|
|
47
|
-
width: 2.
|
|
48
|
-
height: 2.
|
|
49
|
-
}
|
|
50
|
-
&.icon-border{
|
|
51
|
-
border: 1px solid white;
|
|
52
|
-
border-radius: 50%;
|
|
55
|
+
width: 2.375em !important;
|
|
56
|
+
height: 2.375em !important;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
</style>
|