@deck9/ui 0.8.6 → 0.9.3
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/src/Button/Button.vue.d.ts +44 -24
- package/dist/src/Checkbox/Checkbox.vue.d.ts +19 -12
- package/dist/src/Icon/Icon.vue.d.ts +8 -5
- package/dist/src/Icon/index.d.ts +1 -1
- package/dist/src/Icon/registerIcons.d.ts +1 -0
- package/dist/src/Label/Label.vue.d.ts +14 -10
- package/dist/src/Menu/MenuContainer.vue.d.ts +24 -16
- package/dist/src/Menu/MenuLink.vue.d.ts +19 -9
- package/dist/src/Skeleton/Skeleton.vue.d.ts +23 -12
- package/dist/src/Switch/Switch.vue.d.ts +31 -18
- package/dist/src/index.es.js +3715 -1
- package/dist/src/index.umd.js +8 -1
- package/package.json +36 -32
- package/tailwind.config.js +12 -12
package/dist/src/index.es.js
CHANGED
|
@@ -1 +1,3715 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,a=(e,a)=>{for(var i in a||(a={}))n.call(a,i)&&o(e,i,a[i]);if(t)for(var i of t(a))r.call(a,i)&&o(e,i,a[i]);return e};import{defineComponent as i,computed as l,unref as s,openBlock as u,createBlock as d,mergeProps as c,createCommentVNode as p,createElementBlock as f,normalizeClass as v,createElementVNode as m,toDisplayString as b,createVNode as y,inject as g,ref as h,cloneVNode as x,h as w,onMounted as S,watchEffect as O,provide as k,toRaw as C,onUnmounted as I,watch as D,nextTick as E,withCtx as P,isRef as R,renderSlot as L,Teleport as j,normalizeProps as T,guardReactiveProps as A,Transition as V,Fragment as M,renderList as q,createStaticVNode as B}from"vue";import{FontAwesomeIcon as U}from"@fortawesome/vue-fontawesome";import{library as N}from"@fortawesome/fontawesome-svg-core";import*as z from"@fortawesome/free-solid-svg-icons";N.add(z.faChartPie,z.faCheck,z.faCheckCircle,z.faChevronDown,z.faChevronLeft,z.faChevronRight,z.faChevronUp,z.faCircleNotch,z.faClipboard,z.faCog,z.faDoorOpen,z.faEllipsisH,z.faEnvelope,z.faExclamationTriangle,z.faFingerprint,z.faGlobe,z.faHandPointRight,z.faInfoCircle,z.faPencilAlt,z.faPlayCircle,z.faPlus,z.faPlusCircle,z.faRobot,z.faSave,z.faShieldAlt,z.faTimes,z.faTrash,z.faUser,z.faUserShield);var _=[...Object.keys(N.definitions.fas)].sort();const K=i({props:{name:{type:String,required:!0,default:"user"}},setup(e){const t=e,n=l((()=>!!_.includes(t.name)||(console.warn("could not load icon, because it is not available",t.name),!1)));return(t,r)=>s(n)?(u(),d(s(U),c({key:0,icon:["fas",e.name]},t.$attrs),null,16,["icon"])):p("",!0)}}),F=["aria-label","tabindex"],$={key:0,class:"absolute inset-0 flex items-center justify-center"},H=i({props:{label:{type:String,required:!0},size:{type:null,required:!1,default:"medium"},color:{type:null,required:!1,default:"primary"},isLoading:{type:Boolean,required:!1,default:!1},isDisabled:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1},iconPosition:{type:null,required:!1,default:"right"}},emits:["onClick"],setup(e,{emit:t}){const n=e,r=l((()=>{const e={"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900":"primary"===n.color,"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900":"light"===n.color,"text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900":"dark"===n.color},t={"pointer-events-none opacity-75 cursor-not-allowed":n.isDisabled},r={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":"small"===n.size,"px-5 py-2 text-sm leading-4 font-medium rounded-lg":"medium"===n.size,"px-8 py-3 text-base leading-6 font-medium rounded-lg":"large"===n.size};return a(a(a({},e),t),r)})),o=l((()=>{const e={"mr-2 -ml-1":["small","medium"].includes(n.size)&&"left"===n.iconPosition,"mr-4 -ml-2":["large"].includes(n.size)&&"left"===n.iconPosition},t={"ml-3 -mr-1":["small","medium"].includes(n.size)&&"right"===n.iconPosition,"ml-3 -mr-3":["large"].includes(n.size)&&"right"===n.iconPosition},r={"text-white":"primary"===n.color,"text-blue-600":"light"===n.color,"text-grey-50":"dark"===n.color};return a(a(a({},e),t),r)}));function i(){n.isDisabled||t("onClick")}return(t,n)=>(u(),f("button",{class:v(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",s(r)]),type:"button","aria-label":e.label,tabindex:e.isDisabled?"-1":void 0,onClick:i},[m("div",{class:v(!e.isLoading||"invisible")},[e.icon&&"left"===e.iconPosition?(u(),d(K,{key:0,name:e.icon,class:v(s(o))},null,8,["name","class"])):p("",!0),m("span",null,b(e.label),1),e.icon&&"right"===e.iconPosition?(u(),d(K,{key:1,name:e.icon,class:v(s(o))},null,8,["name","class"])):p("",!0)],2),e.isLoading?(u(),f("span",$,[y(K,{class:"animate-spin",name:"circle-notch"})])):p("",!0)],10,F))}});var W,Q=new Uint8Array(16);function Y(){if(!W&&!(W="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return W(Q)}var G=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function X(e){return"string"==typeof e&&G.test(e)}for(var J=[],Z=0;Z<256;++Z)J.push((Z+256).toString(16).substr(1));function ee(e,t,n){var r=(e=e||{}).random||(e.rng||Y)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase();if(!X(n))throw TypeError("Stringified UUID is invalid");return n}(r)}const te={class:"relative flex items-start"},ne={class:"flex items-center h-5"},re=["checked","id"],oe={class:"ml-2 text-sm leading-5"},ae=["for"],ie={key:0,class:"text-grey-700 dark:text-grey-400 mono-0 casual-60"},le=i({props:{id:{type:String,required:!1,default:ee()},label:{type:String,required:!0},modelValue:{type:Boolean,required:!0},description:{type:String,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e=>{t("update:modelValue",e.target.checked)};return(t,r)=>(u(),f("div",te,[m("div",ne,[m("input",{class:"h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm",type:"checkbox",checked:e.modelValue,onChange:n,id:e.id},null,40,re)]),m("div",oe,[m("label",{for:e.id,class:"font-medium text-grey-900 dark:text-grey-200 casual-25"},b(e.label),9,ae),e.description?(u(),f("p",ie,b(e.description),1)):p("",!0)])]))}}),se=()=>{},ue=Array.isArray;const de=e=>(e.w&fe)>0,ce=e=>(e.n&fe)>0;let pe=0,fe=1;const ve=[];let me;class be{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],function(e,t){(t=t||void 0)&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();if(!ve.includes(this))try{return ve.push(me=this),he.push(ge),ge=!0,fe=1<<++pe,pe<=30?(({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=fe})(this):ye(this),this.fn()}finally{pe<=30&&(e=>{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r<t.length;r++){const o=t[r];de(o)&&!ce(o)?o.delete(e):t[n++]=o,o.w&=~fe,o.n&=~fe}t.length=n}})(this),fe=1<<--pe,function(){const e=he.pop();ge=void 0===e||e}(),ve.pop();const e=ve.length;me=e>0?ve[e-1]:void 0}}stop(){this.active&&(ye(this),this.onStop&&this.onStop(),this.active=!1)}}function ye(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let ge=!0;const he=[];function xe(e){const t=e&&e.__v_raw;return t?xe(t):e}function we(e){ge&&void 0!==me&&((e=xe(e)).dep||(e.dep=(e=>{const t=new Set(e);return t.w=0,t.n=0,t})()),function(e,t){let n=!1;pe<=30?ce(e)||(e.n|=fe,n=!de(e)):n=!e.has(me),n&&(e.add(me),me.deps.push(e))}(e.dep))}function Se(e,t){(e=xe(e)).dep&&function(e,t){for(const n of ue(e)?e:[...e])(n!==me||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}(e.dep)}new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e)));class Oe{constructor(e,t,n){this._setter=t,this.dep=void 0,this._dirty=!0,this.__v_isRef=!0,this.effect=new be(e,(()=>{this._dirty||(this._dirty=!0,Se(this))})),this.__v_isReadonly=n}get value(){const e=xe(this);return we(e),e._dirty&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function ke(e,t){let n,r;const o="function"==typeof e;o?(n=e,r=se):(n=e.get,r=e.set);return new Oe(n,r,o||!r)}function Ce(e){return{inputClasses:ke((()=>({"pl-3 pr-10 py-1":!e.icon&&"small"===e.size,"pl-4 pr-10 py-3":!e.icon&&"medium"===e.size,"pl-6 pr-10 py-3":!e.icon&&"large"===e.size,"pl-10 pr-10 py-1":e.icon&&"small"===e.size,"pl-12 pr-10 py-3":e.icon&&("medium"===e.size||"large"===e.size),"w-full block":!0===e.block}))),disabledClasses:ke((()=>({"pointer-events-none opacity-50 cursor-not-allowed":e.isDisabled}))),textSizeClasses:ke((()=>({"text-xs leading-4":"small"===e.size,"text-sm leading-4":"medium"===e.size,"text-base leading-5":"large"===e.size})))}}Promise.resolve();const Ie={class:"relative"},De=["placeholder","type","tabindex","value"],Ee=i({props:{modelValue:{type:[String,null],required:!1},type:{type:String,required:!0,default:"text"},placeholder:{type:String,required:!1},size:{type:null,required:!1,default:"medium"},icon:{type:String,required:!1},isDisabled:{type:Boolean,required:!1,default:!1},block:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,{inputClasses:r,disabledClasses:o,textSizeClasses:a}=Ce(n),i=function(e){t("update:modelValue",(null==e?void 0:e.target).value)};return(t,n)=>(u(),f("div",Ie,[m("input",{class:v(["mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[s(r),s(a),s(o)]]),placeholder:e.placeholder,type:e.type,tabindex:e.isDisabled?"-1":void 0,value:e.modelValue,onInput:i},null,42,De),e.icon?(u(),f("span",{key:0,class:v(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",s(a)])},[y(K,{name:e.icon},null,8,["name"])],2)):p("",!0)]))}}),Pe={class:"inline-block text-blue-900 text-sm font-medium"},Re=["for"],Le={key:0,class:"block text-xs text-grey-400"},je=i({props:{id:{type:String,required:!1},label:{type:String,required:!0},description:{type:String,required:!1}},setup:e=>(t,n)=>(u(),f("span",Pe,[m("label",{for:e.id},b(e.label),9,Re),e.description?(u(),f("span",Le,b(e.description),1)):p("",!0)]))});function Te(){return(Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ae(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Me(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function qe(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];return"function"==typeof n?n.apply(void 0,o):n}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,qe),i}var Be,Ue,Ne,ze,_e,Ke;function Fe(e){var t,n,r=e.visible,o=void 0===r||r,a=e.features,i=void 0===a?Be.None:a,l=Ae(e,["visible","features"]);return o||i&Be.Static&&l.props.static?$e(l):i&Be.RenderStrategy?qe(null==(t=l.props.unmount)||t?Ne.Unmount:Ne.Hidden,((n={})[Ne.Unmount]=function(){return null},n[Ne.Hidden]=function(){return $e(Te({},l,{props:Te({},l.props,{hidden:!0,style:{display:"none"}})}))},n)):$e(l)}function $e(e){var t,n=e.props,r=e.attrs,o=e.slots,a=e.slot,i=e.name,l=He(n,["unmount","static"]),s=l.as,u=Ae(l,["as"]),d=null==o.default?void 0:o.default(a);if("template"===s){if(Object.keys(u).length>0||Object.keys(r).length>0){var c=null!=d?d:[],p=c[0],f=c.slice(1);if(null==(t=p)||"string"!=typeof t.type&&"object"!=typeof t.type&&"function"!=typeof t.type||f.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+i+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(u).concat(Object.keys(r)).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return x(p,u)}return Array.isArray(d)&&1===d.length?d[0]:d}return w(s,u,d)}function He(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=Me(t);!(n=o()).done;){var a=n.value;a in r&&delete r[a]}return r}(Ue=Be||(Be={}))[Ue.None=0]="None",Ue[Ue.RenderStrategy=1]="RenderStrategy",Ue[Ue.Static=2]="Static",(ze=Ne||(Ne={}))[ze.Unmount=0]="Unmount",ze[ze.Hidden=1]="Hidden",(Ke=_e||(_e={})).Space=" ",Ke.Enter="Enter",Ke.Escape="Escape",Ke.Backspace="Backspace",Ke.ArrowLeft="ArrowLeft",Ke.ArrowUp="ArrowUp",Ke.ArrowRight="ArrowRight",Ke.ArrowDown="ArrowDown",Ke.Home="Home",Ke.End="End",Ke.PageUp="PageUp",Ke.PageDown="PageDown",Ke.Tab="Tab";var We,Qe,Ye,Ge,Xe,Je,Ze,et,tt,nt,rt=0;function ot(){return++rt}function at(e,t,n){window.addEventListener(e,t,n),I((function(){return window.removeEventListener(e,t,n)}))}function it(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}(Qe=We||(We={}))[Qe.First=1]="First",Qe[Qe.Previous=2]="Previous",Qe[Qe.Next=4]="Next",Qe[Qe.Last=8]="Last",Qe[Qe.WrapAround=16]="WrapAround",Qe[Qe.NoScroll=32]="NoScroll",(Ge=Ye||(Ye={}))[Ge.Error=0]="Error",Ge[Ge.Overflow=1]="Overflow",Ge[Ge.Success=2]="Success",Ge[Ge.Underflow=3]="Underflow",(Je=Xe||(Xe={}))[Je.Previous=-1]="Previous",Je[Je.Next=1]="Next",(et=Ze||(Ze={}))[et.Strict=0]="Strict",et[et.Loose=1]="Loose",(nt=tt||(tt={}))[nt.AddElement=0]="AddElement",nt[nt.RemoveElement=1]="RemoveElement";var lt,st,ut,dt,ct,pt,ft,vt,mt,bt=Symbol("Context");function yt(){return g(bt,null)}function gt(e){k(bt,e)}function ht(e,t){if(e)return e;var n=null!=t?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function xt(e,t){var n=h(ht(e.value.type,e.value.as));return S((function(){n.value=ht(e.value.type,e.value.as)})),O((function(){var e;n.value||it(t)&&it(t)instanceof HTMLButtonElement&&!(null==(e=it(t))?void 0:e.hasAttribute("type"))&&(n.value="button")})),n}function wt(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,a=function(){switch(e.focus){case ft.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case ft.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)}));return-1===r?r:n.length-1-r;case ft.Next:return n.findIndex((function(e,n){return!(n<=o)&&!t.resolveDisabled(e)}));case ft.Last:var a=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===a?a:n.length-1-a;case ft.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case ft.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===a?r:a}(st=lt||(lt={}))[st.Open=0]="Open",st[st.Closed=1]="Closed",(dt=ut||(ut={}))[dt.Open=0]="Open",dt[dt.Closed=1]="Closed",(pt=ct||(ct={}))[pt.Open=0]="Open",pt[pt.Closed=1]="Closed",function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(ft||(ft={})),(mt=vt||(vt={}))[mt.Open=0]="Open",mt[mt.Closed=1]="Closed";var St=Symbol("ListboxContext");function Ot(e){var t=g(St,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ot),n}return t}var kt,Ct,It=i({name:"Listbox",emits:{"update:modelValue":function(e){return!0}},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},horizontal:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},setup:function(e,t){var n=t.slots,r=t.attrs,o=t.emit,a=h(vt.Closed),i=h(null),s=h(null),u=h(null),d=h([]),c=h(""),p=h(null),f=l((function(){return e.modelValue})),v={listboxState:a,value:f,orientation:l((function(){return e.horizontal?"horizontal":"vertical"})),labelRef:i,buttonRef:s,optionsRef:u,disabled:l((function(){return e.disabled})),options:d,searchQuery:c,activeOptionIndex:p,closeListbox:function(){e.disabled||a.value!==vt.Closed&&(a.value=vt.Closed,p.value=null)},openListbox:function(){e.disabled||a.value!==vt.Open&&(a.value=vt.Open)},goToOption:function(t,n){if(!e.disabled&&a.value!==vt.Closed){var r=wt(t===ft.Specific?{focus:ft.Specific,id:n}:{focus:t},{resolveItems:function(){return d.value},resolveActiveIndex:function(){return p.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===c.value&&p.value===r||(c.value="",p.value=r)}},search:function(t){if(!e.disabled&&a.value!==vt.Closed){c.value+=t.toLowerCase();var n=d.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(c.value)}));-1!==n&&n!==p.value&&(p.value=n)}},clearSearch:function(){e.disabled||a.value!==vt.Closed&&""!==c.value&&(c.value="")},registerOption:function(e,t){d.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=d.value.slice(),n=null!==p.value?t[p.value]:null,r=t.findIndex((function(t){return t.id===e}));-1!==r&&t.splice(r,1),d.value=t,p.value=r===p.value||null===n?null:t.indexOf(n)},select:function(t){e.disabled||o("update:modelValue",t)}};return at("mousedown",(function(e){var t,n,r,o=e.target,i=document.activeElement;a.value===vt.Open&&((null==(t=it(s))?void 0:t.contains(o))||((null==(n=it(u))?void 0:n.contains(o))||v.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(o))||e.defaultPrevented||null==(r=it(s))||r.focus({preventScroll:!0})))})),k(St,v),gt(l((function(){var e;return qe(a.value,((e={})[vt.Open]=lt.Open,e[vt.Closed]=lt.Closed,e))}))),function(){var t={open:a.value===vt.Open,disabled:e.disabled};return Fe({props:He(e,["modelValue","onUpdate:modelValue","disabled","horizontal"]),slot:t,slots:n,attrs:r,name:"Listbox"})}}}),Dt=i({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,n=Ot("ListboxButton"),r={open:n.listboxState.value===vt.Open,disabled:n.disabled.value},o={ref:"el",id:this.id,type:this.type,"aria-haspopup":!0,"aria-controls":null==(e=it(n.optionsRef))?void 0:e.id,"aria-expanded":n.disabled.value?void 0:n.listboxState.value===vt.Open,"aria-labelledby":n.labelRef.value?[null==(t=it(n.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:!0===n.disabled.value||void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return Fe({props:Te({},this.$props,o),slot:r,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(e,t){var n=t.attrs,r=Ot("ListboxButton");return{id:"headlessui-listbox-button-"+ot(),el:r.buttonRef,type:xt(l((function(){return{as:e.as,type:n.type}})),r.buttonRef),handleKeyDown:function(e){switch(e.key){case _e.Space:case _e.Enter:case _e.ArrowDown:e.preventDefault(),r.openListbox(),E((function(){var e;null==(e=it(r.optionsRef))||e.focus({preventScroll:!0}),r.value.value||r.goToOption(ft.First)}));break;case _e.ArrowUp:e.preventDefault(),r.openListbox(),E((function(){var e;null==(e=it(r.optionsRef))||e.focus({preventScroll:!0}),r.value.value||r.goToOption(ft.Last)}))}},handleKeyUp:function(e){switch(e.key){case _e.Space:e.preventDefault()}},handleClick:function(e){var t;r.disabled.value||(r.listboxState.value===vt.Open?(r.closeListbox(),E((function(){var e;return null==(e=it(r.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),r.openListbox(),t=function(){var e;return null==(e=it(r.optionsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(t)}))))}}}}),Et=i({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,n,r,o=Ot("ListboxOptions"),a={open:o.listboxState.value===vt.Open},i={"aria-activedescendant":null===o.activeOptionIndex.value||null==(e=o.options.value[o.activeOptionIndex.value])?void 0:e.id,"aria-labelledby":null!=(t=null==(n=it(o.labelRef))?void 0:n.id)?t:null==(r=it(o.buttonRef))?void 0:r.id,"aria-orientation":o.orientation.value,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return Fe({props:Te({},this.$props,i),slot:a,attrs:this.$attrs,slots:this.$slots,features:Be.RenderStrategy|Be.Static,visible:this.visible,name:"ListboxOptions"})},setup:function(){var e=Ot("ListboxOptions"),t="headlessui-listbox-options-"+ot(),n=h(null);var r=yt(),o=l((function(){return null!==r?r.value===lt.Open:e.listboxState.value===vt.Open}));return{id:t,el:e.optionsRef,handleKeyDown:function(t){switch(n.value&&clearTimeout(n.value),t.key){case _e.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case _e.Enter:if(t.preventDefault(),t.stopPropagation(),null!==e.activeOptionIndex.value){var r=e.options.value[e.activeOptionIndex.value].dataRef;e.select(r.value)}e.closeListbox(),E((function(){var t;return null==(t=it(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case qe(e.orientation.value,{vertical:_e.ArrowDown,horizontal:_e.ArrowRight}):return t.preventDefault(),t.stopPropagation(),e.goToOption(ft.Next);case qe(e.orientation.value,{vertical:_e.ArrowUp,horizontal:_e.ArrowLeft}):return t.preventDefault(),t.stopPropagation(),e.goToOption(ft.Previous);case _e.Home:case _e.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(ft.First);case _e.End:case _e.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(ft.Last);case _e.Escape:t.preventDefault(),t.stopPropagation(),e.closeListbox(),E((function(){var t;return null==(t=it(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case _e.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),n.value=setTimeout((function(){return e.clearSearch()}),350))}},visible:o}}}),Pt=i({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots,r=t.attrs,o=Ot("ListboxOption"),a="headlessui-listbox-option-"+ot(),i=l((function(){return null!==o.activeOptionIndex.value&&o.options.value[o.activeOptionIndex.value].id===a})),s=l((function(){return C(o.value.value)===C(e.value)})),u=h({disabled:e.disabled,value:e.value,textValue:""});function d(t){if(e.disabled)return t.preventDefault();o.select(e.value),o.closeListbox(),E((function(){var e;return null==(e=it(o.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function c(){if(e.disabled)return o.goToOption(ft.Nothing);o.goToOption(ft.Specific,a)}function p(){e.disabled||i.value||o.goToOption(ft.Specific,a)}function f(){e.disabled||i.value&&o.goToOption(ft.Nothing)}return S((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(u.value.textValue=n)})),S((function(){return o.registerOption(a,u)})),I((function(){return o.unregisterOption(a)})),S((function(){D([o.listboxState,s],(function(){var e;o.listboxState.value===vt.Open&&s.value&&(o.goToOption(ft.Specific,a),null==(e=document.getElementById(a))||null==e.focus||e.focus())}),{immediate:!0})})),O((function(){o.listboxState.value===vt.Open&&i.value&&E((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t=e.disabled,o={active:i.value,selected:s.value,disabled:t},l={id:a,role:"option",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,"aria-selected":!0===s.value?s.value:void 0,disabled:void 0,onClick:d,onFocus:c,onPointermove:p,onMousemove:p,onPointerleave:f,onMouseleave:f};return Fe({props:Te({},e,l),slot:o,attrs:r,slots:n,name:"ListboxOption"})}}});(Ct=kt||(kt={}))[Ct.Open=0]="Open",Ct[Ct.Closed=1]="Closed";var Rt=Symbol("MenuContext");function Lt(e){var t=g(Rt,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Lt),n}return t}var jt,Tt,At,Vt,Mt=i({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,o=h(kt.Closed),a=h(null),i=h(null),s=h([]),u=h(""),d=h(null),c={menuState:o,buttonRef:a,itemsRef:i,items:s,searchQuery:u,activeItemIndex:d,closeMenu:function(){o.value=kt.Closed,d.value=null},openMenu:function(){return o.value=kt.Open},goToItem:function(e,t){var n=wt(e===ft.Specific?{focus:ft.Specific,id:t}:{focus:e},{resolveItems:function(){return s.value},resolveActiveIndex:function(){return d.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===u.value&&d.value===n||(u.value="",d.value=n)},search:function(e){u.value+=e.toLowerCase();var t=s.value.findIndex((function(e){return e.dataRef.textValue.startsWith(u.value)&&!e.dataRef.disabled}));-1!==t&&t!==d.value&&(d.value=t)},clearSearch:function(){u.value=""},registerItem:function(e,t){s.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=s.value.slice(),n=null!==d.value?t[d.value]:null,r=t.findIndex((function(t){return t.id===e}));-1!==r&&t.splice(r,1),s.value=t,d.value=r===d.value||null===n?null:t.indexOf(n)}};return at("mousedown",(function(e){var t,n,r,l=e.target,s=document.activeElement;o.value===kt.Open&&((null==(t=it(a))?void 0:t.contains(l))||((null==(n=it(i))?void 0:n.contains(l))||c.closeMenu(),s!==document.body&&(null==s?void 0:s.contains(l))||e.defaultPrevented||null==(r=it(a))||r.focus({preventScroll:!0})))})),k(Rt,c),gt(l((function(){var e;return qe(o.value,((e={})[kt.Open]=lt.Open,e[kt.Closed]=lt.Closed,e))}))),function(){var t={open:o.value===kt.Open};return Fe({props:e,slot:t,slots:n,attrs:r,name:"Menu"})}}}),qt=i({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=Lt("MenuButton"),n={open:t.menuState.value===kt.Open},r={ref:"el",id:this.id,type:this.type,"aria-haspopup":!0,"aria-controls":null==(e=it(t.itemsRef))?void 0:e.id,"aria-expanded":this.$props.disabled?void 0:t.menuState.value===kt.Open,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return Fe({props:Te({},this.$props,r),slot:n,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e,t){var n=t.attrs,r=Lt("MenuButton");return{id:"headlessui-menu-button-"+ot(),el:r.buttonRef,type:xt(l((function(){return{as:e.as,type:n.type}})),r.buttonRef),handleKeyDown:function(e){switch(e.key){case _e.Space:case _e.Enter:case _e.ArrowDown:e.preventDefault(),e.stopPropagation(),r.openMenu(),E((function(){var e;null==(e=it(r.itemsRef))||e.focus({preventScroll:!0}),r.goToItem(ft.First)}));break;case _e.ArrowUp:e.preventDefault(),e.stopPropagation(),r.openMenu(),E((function(){var e;null==(e=it(r.itemsRef))||e.focus({preventScroll:!0}),r.goToItem(ft.Last)}))}},handleKeyUp:function(e){switch(e.key){case _e.Space:e.preventDefault()}},handleClick:function(t){var n;e.disabled||(r.menuState.value===kt.Open?(r.closeMenu(),E((function(){var e;return null==(e=it(r.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),t.stopPropagation(),r.openMenu(),n=function(){var e;return null==(e=it(r.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(n)}))))}}}}),Bt=i({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,n=Lt("MenuItems"),r={open:n.menuState.value===kt.Open},o={"aria-activedescendant":null===n.activeItemIndex.value||null==(e=n.items.value[n.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=it(n.buttonRef))?void 0:t.id,id:this.id,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,role:"menu",tabIndex:0,ref:"el"};return Fe({props:Te({},this.$props,o),slot:r,attrs:this.$attrs,slots:this.$slots,features:Be.RenderStrategy|Be.Static,visible:this.visible,name:"MenuItems"})},setup:function(){var e,t,n,r,o,a=Lt("MenuItems"),i="headlessui-menu-items-"+ot(),s=h(null);e={container:l((function(){return it(a.itemsRef)})),enabled:l((function(){return a.menuState.value===kt.Open})),accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}},t=e.container,n=e.accept,r=e.walk,o=e.enabled,O((function(){var e=t.value;if(e&&(void 0===o||o.value))for(var a=Object.assign((function(e){return n(e)}),{acceptNode:n}),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);i.nextNode();)r(i.currentNode)}));var u=yt(),d=l((function(){return null!==u?u.value===lt.Open:a.menuState.value===kt.Open}));return{id:i,el:a.itemsRef,handleKeyDown:function(e){switch(s.value&&clearTimeout(s.value),e.key){case _e.Space:if(""!==a.searchQuery.value)return e.preventDefault(),e.stopPropagation(),a.search(e.key);case _e.Enter:if(e.preventDefault(),e.stopPropagation(),null!==a.activeItemIndex.value){var t,n=a.items.value[a.activeItemIndex.value].id;null==(t=document.getElementById(n))||t.click()}a.closeMenu(),E((function(){var e;return null==(e=it(a.buttonRef))?void 0:e.focus({preventScroll:!0})}));break;case _e.ArrowDown:return e.preventDefault(),e.stopPropagation(),a.goToItem(ft.Next);case _e.ArrowUp:return e.preventDefault(),e.stopPropagation(),a.goToItem(ft.Previous);case _e.Home:case _e.PageUp:return e.preventDefault(),e.stopPropagation(),a.goToItem(ft.First);case _e.End:case _e.PageDown:return e.preventDefault(),e.stopPropagation(),a.goToItem(ft.Last);case _e.Escape:e.preventDefault(),e.stopPropagation(),a.closeMenu(),E((function(){var e;return null==(e=it(a.buttonRef))?void 0:e.focus({preventScroll:!0})}));break;case _e.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(a.search(e.key),s.value=setTimeout((function(){return a.clearSearch()}),350))}},handleKeyUp:function(e){switch(e.key){case _e.Space:e.preventDefault()}},visible:d}}}),Ut=i({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots,r=t.attrs,o=Lt("MenuItem"),a="headlessui-menu-item-"+ot(),i=l((function(){return null!==o.activeItemIndex.value&&o.items.value[o.activeItemIndex.value].id===a})),s=h({disabled:e.disabled,textValue:""});function u(t){if(e.disabled)return t.preventDefault();o.closeMenu(),E((function(){var e;return null==(e=it(o.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function d(){if(e.disabled)return o.goToItem(ft.Nothing);o.goToItem(ft.Specific,a)}function c(){e.disabled||i.value||o.goToItem(ft.Specific,a)}function p(){e.disabled||i.value&&o.goToItem(ft.Nothing)}return S((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(s.value.textValue=n)})),S((function(){return o.registerItem(a,s)})),I((function(){return o.unregisterItem(a)})),O((function(){o.menuState.value===kt.Open&&i.value&&E((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t=e.disabled,o={active:i.value,disabled:t};return Fe({props:Te({},e,{id:a,role:"menuitem",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,onClick:u,onFocus:d,onPointermove:c,onMousemove:c,onPointerleave:p,onMouseleave:p}),slot:o,attrs:r,slots:n,name:"MenuItem"})}}});(Tt=jt||(jt={}))[Tt.Open=0]="Open",Tt[Tt.Closed=1]="Closed",(Vt=At||(At={}))[Vt.Empty=1]="Empty",Vt[Vt.Active=2]="Active";var Nt,zt,_t,Kt,Ft=Symbol("GroupContext"),$t=i({name:"Switch",emits:{"update:modelValue":function(e){return!0}},props:{as:{type:[Object,String],default:"button"},modelValue:{type:Boolean,default:!1}},render:function(){var e={checked:this.$props.modelValue},t={id:this.id,ref:"el",role:"switch",type:this.type,tabIndex:0,"aria-checked":this.$props.modelValue,"aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return Fe({props:Te({},this.$props,t),slot:e,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,t){var n=t.emit,r=t.attrs,o=g(Ft,null),a="headlessui-switch-"+ot();function i(){n("update:modelValue",!e.modelValue)}var s=h(null),u=null===o?s:o.switchRef;return{id:a,el:u,type:xt(l((function(){return{as:e.as,type:r.type}})),u),labelledby:null==o?void 0:o.labelledby,describedby:null==o?void 0:o.describedby,handleClick:function(e){e.preventDefault(),i()},handleKeyUp:function(e){e.key!==_e.Tab&&e.preventDefault(),e.key===_e.Space&&i()},handleKeyPress:function(e){e.preventDefault()}}}});function Ht(e,t){var n=e.getBoundingClientRect();return{width:n.width/1,height:n.height/1,top:n.top/1,right:n.right/1,bottom:n.bottom/1,left:n.left/1,x:n.left/1,y:n.top/1}}function Wt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Qt(e){var t=Wt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Yt(e){return e instanceof Wt(e).Element||e instanceof Element}function Gt(e){return e instanceof Wt(e).HTMLElement||e instanceof HTMLElement}function Xt(e){return e?(e.nodeName||"").toLowerCase():null}function Jt(e){return((Yt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zt(e){return Wt(e).getComputedStyle(e)}function en(e){var t=Zt(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function tn(e,t,n){void 0===n&&(n=!1);var r=Gt(t);Gt(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1}(t);var o,a,i=Jt(t),l=Ht(e),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==Xt(t)||en(i))&&(s=(o=t)!==Wt(o)&&Gt(o)?{scrollLeft:(a=o).scrollLeft,scrollTop:a.scrollTop}:Qt(o)),Gt(t)?((u=Ht(t)).x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=function(e){return Ht(Jt(e)).left+Qt(e).scrollLeft}(i))),{x:l.left+s.scrollLeft-u.x,y:l.top+s.scrollTop-u.y,width:l.width,height:l.height}}function nn(e){return"html"===Xt(e)?e:e.assignedSlot||e.parentNode||(t=e,"undefined"!=typeof ShadowRoot&&(t instanceof Wt(t).ShadowRoot||t instanceof ShadowRoot)?e.host:null)||Jt(e);var t}function rn(e){return["html","body","#document"].indexOf(Xt(e))>=0?e.ownerDocument.body:Gt(e)&&en(e)?e:rn(nn(e))}function on(e,t){var n;void 0===t&&(t=[]);var r=rn(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Wt(r),i=o?[a].concat(a.visualViewport||[],en(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(on(nn(i)))}function an(e){return["table","td","th"].indexOf(Xt(e))>=0}function ln(e){return Gt(e)&&"fixed"!==Zt(e).position?e.offsetParent:null}function sn(e){for(var t=Wt(e),n=ln(e);n&&an(n)&&"static"===Zt(n).position;)n=ln(n);return n&&("html"===Xt(n)||"body"===Xt(n)&&"static"===Zt(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Gt(e)&&"fixed"===Zt(e).position)return null;for(var n=nn(e);Gt(n)&&["html","body"].indexOf(Xt(n))<0;){var r=Zt(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}(zt=Nt||(Nt={})).Finished="finished",zt.Cancelled="cancelled",(Kt=_t||(_t={})).Visible="visible",Kt.Hidden="hidden",Be.RenderStrategy;var un=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function dn(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function cn(e){return e.split("-")[0]}var pn=Math.round;function fn(e){return e.split("-")[1]}var vn={placement:"bottom",modifiers:[],strategy:"absolute"};function mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function bn(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,a=void 0===o?vn:o;return function(e,t,n){void 0===n&&(n=a);var o,i,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},vn,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],u=!1,d={state:l,setOptions:function(n){var o="function"==typeof n?n(l.options):n;c(),l.options=Object.assign({},a,l.options,o),l.scrollParents={reference:Yt(e)?on(e):e.contextElement?on(e.contextElement):[],popper:on(t)};var i,u,p=function(e){var t=dn(e);return un.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((i=[].concat(r,l.options.modifiers),u=i.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return l.orderedModifiers=p.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var a=o({state:l,name:t,instance:d,options:r}),i=function(){};s.push(a||i)}})),d.update()},forceUpdate:function(){if(!u){var e=l.elements,t=e.reference,n=e.popper;if(mn(t,n)){var r,o,a,i;l.rects={reference:tn(t,sn(n),"fixed"===l.options.strategy),popper:(r=n,o=Ht(r),a=r.offsetWidth,i=r.offsetHeight,Math.abs(o.width-a)<=1&&(a=o.width),Math.abs(o.height-i)<=1&&(i=o.height),{x:r.offsetLeft,y:r.offsetTop,width:a,height:i})},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var s=0;s<l.orderedModifiers.length;s++)if(!0!==l.reset){var c=l.orderedModifiers[s],p=c.fn,f=c.options,v=void 0===f?{}:f,m=c.name;"function"==typeof p&&(l=p({state:l,options:v,name:m,instance:d})||l)}else l.reset=!1,s=-1}}},update:(o=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return i||(i=new Promise((function(e){Promise.resolve().then((function(){i=void 0,e(o())}))}))),i}),destroy:function(){c(),u=!0}};if(!mn(e,t))return d;function c(){s.forEach((function(e){return e()})),s=[]}return d.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var yn={passive:!0};var gn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hn(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,l=e.position,s=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,c=!0===d?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:pn(pn(t*r)/r)||0,y:pn(pn(n*r)/r)||0}}(i):"function"==typeof d?d(i):i,p=c.x,f=void 0===p?0:p,v=c.y,m=void 0===v?0:v,b=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),g="left",h="top",x=window;if(u){var w=sn(n),S="clientHeight",O="clientWidth";w===Wt(n)&&"static"!==Zt(w=Jt(n)).position&&"absolute"===l&&(S="scrollHeight",O="scrollWidth"),w=w,"top"!==o&&("left"!==o&&"right"!==o||"end"!==a)||(h="bottom",m-=w[S]-r.height,m*=s?1:-1),"left"!==o&&("top"!==o&&"bottom"!==o||"end"!==a)||(g="right",f-=w[O]-r.width,f*=s?1:-1)}var k,C=Object.assign({position:l},u&&gn);return s?Object.assign({},C,((k={})[h]=y?"0":"",k[g]=b?"0":"",k.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",k)):Object.assign({},C,((t={})[h]=y?m+"px":"",t[g]=b?f+"px":"",t.transform="",t))}var xn=bn({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=void 0===o||o,i=r.resize,l=void 0===i||i,s=Wt(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",n.update,yn)})),l&&s.addEventListener("resize",n.update,yn),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",n.update,yn)})),l&&s.removeEventListener("resize",n.update,yn)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=function(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?cn(o):null,i=o?fn(o):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(a){case"top":t={x:l,y:n.y-r.height};break;case"bottom":t={x:l,y:n.y+n.height};break;case"right":t={x:n.x+n.width,y:s};break;case"left":t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var u=a?function(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}(a):null;if(null!=u){var d="y"===u?"height":"width";switch(i){case"start":t[u]=t[u]-(n[d]/2-r[d]/2);break;case"end":t[u]=t[u]+(n[d]/2-r[d]/2)}}return t}({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,a=n.adaptive,i=void 0===a||a,l=n.roundOffsets,s=void 0===l||l,u={placement:cn(t.placement),variation:fn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,hn(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,hn(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];Gt(o)&&Xt(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Gt(r)&&Xt(r)&&(Object.assign(r.style,a),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]}]});const wn=i({props:{position:{type:String,required:!0,default:"left"},usePortal:{type:[Boolean,String],required:!0,default:!1}},setup(e){const t="left"===e.position?"bottom-end":"bottom-start",[n,r]=function(e){const t=h(null),n=h(null);return S((()=>{O((r=>{if(!n.value)return;if(!t.value)return;const o=n.value.el||n.value,a=t.value.el||t.value;if(!(a instanceof HTMLElement))return;if(!(o instanceof HTMLElement))return;const{destroy:i}=xn(a,o,e);r(i)}))})),[t,n]}({placement:t});return(t,o)=>(u(),d(s(Mt),{as:"div",class:"relative inline-block text-left"},{default:P((()=>[y(s(qt),{class:"focus:outline-none",ref:(e,t)=>{t.button=e,R(n)&&(n.value=e)}},{default:P((()=>[L(t.$slots,"button",{},(()=>[y(s(K),{class:"fill-current",name:"ellipsis-h"})]))])),_:3},512),(u(),d(j,{to:"string"==typeof e.usePortal?e.usePortal:"body",disabled:!e.usePortal},[y(s(Bt),{ref:(e,t)=>{t.container=e,R(r)&&(r.value=e)},class:v([{"absolute left-0 origin-top-left":!e.usePortal&&"right"===e.position,"absolute right-0 origin-top-right":!e.usePortal&&"left"===e.position},"z-40 mt-1 py-1 bg-white w-56 rounded shadow-lg text-grey-700 focus:outline-none"])},{default:P((()=>[L(t.$slots,"default")])),_:3},8,["class"])],8,["to","disabled"]))])),_:3}))}}),Sn=i({props:{label:{type:String,required:!1},disabled:{type:Boolean,required:!1}},setup:e=>(t,n)=>(u(),d(s(Ut),T(A({disabled:e.disabled})),{default:P((({active:n})=>[m("span",c({class:["block px-4 py-2 text-xs",[n?"bg-grey-200":"",e.disabled?"opacity-50 pointer-events-none":"hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"]]},t.$attrs),b(e.label),17)])),_:1},16))}),On={class:"relative"},kn={key:1,class:"block truncate"},Cn={key:2,class:"text-grey-500"},In={class:"absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},Dn=i({props:{modelValue:{type:[Object,null],required:!1},size:{type:null,required:!1,default:"medium"},icon:{type:String,required:!1},placeholder:{type:String,required:!1},isDisabled:{type:Boolean,required:!1,default:!1},options:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=n.modelValue?h(n.modelValue):h(null),{inputClasses:o,disabledClasses:a,textSizeClasses:i}=Ce(n);return D((()=>n.modelValue),(e=>{var t;e&&e.id!==(null==(t=r.value)?void 0:t.id)&&(r.value=e)})),D(r,(e=>{e&&t("update:modelValue",e)})),(t,n)=>(u(),d(s(It),{as:"div",modelValue:s(r),"onUpdate:modelValue":n[0]||(n[0]=e=>R(r)?r.value=e:null),disabled:e.isDisabled},{default:P((()=>[m("div",On,[y(s(Dt),{class:v(["w-full mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left",[s(o),s(i),s(a)]])},{default:P((()=>[e.icon?(u(),f("span",{key:0,class:v(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none",s(i)])},[y(K,{name:e.icon},null,8,["name"])],2)):p("",!0),s(r)?(u(),f("span",kn,b(s(r).label),1)):(u(),f("span",Cn,b(e.placeholder),1)),m("span",In,[y(K,{class:"text-grey-400",name:"chevron-down","aria-hidden":"true"})])])),_:1},8,["class"]),y(V,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:P((()=>[y(s(Et),{class:"absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"},{default:P((()=>[(u(!0),f(M,null,q(e.options,(e=>(u(),d(s(Pt),{as:"template",key:e.id,value:e},{default:P((({active:t,selected:n})=>[m("li",{class:v([t?"text-white bg-grey-800":"text-gray-900 dark:text-grey-50","cursor-default select-none relative py-2 pl-3 pr-9"])},[m("span",{class:v([n?"font-semibold":"font-normal","block truncate"])},b(e.label),3),n?(u(),f("span",{key:0,class:v([t?"text-blue-100":"text-blue-500","absolute inset-y-0 right-0 flex items-center pr-4"])},[y(K,{name:"check",class:"h-5 w-5","aria-hidden":"true"})],2)):p("",!0)],2)])),_:2},1032,["value"])))),128))])),_:1})])),_:1})])])),_:1},8,["modelValue","disabled"]))}}),En={class:"sr-only"},Pn=i({props:{id:{type:String,required:!1,default:ee()},label:{type:String,required:!0},modelValue:{type:Boolean,required:!0},description:{type:String,required:!1},onLabel:{type:String,required:!1,default:"on"},offLabel:{type:String,required:!1,default:"off"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e=>{t("update:modelValue",e),t("change",e)};return(t,r)=>(u(),d(s($t),{modelValue:e.modelValue,label:e.label,class:v([e.modelValue?"bg-blue-700":"bg-grey-700","relative inline-flex items-center h-6 rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-blue-300 transition"]),"onUpdate:modelValue":n},{default:P((()=>[m("span",{class:v(["absolute inset-x-2 text-xs text-white text-center",e.modelValue?"pr-3":"pl-3"])},b(e.modelValue?e.onLabel:e.offLabel),3),m("span",En,b(e.label),1),m("span",{class:v([e.modelValue?"translate-x-9":"translate-x-1","inline-block w-4 h-4 transform bg-white rounded-full transition"])},null,2)])),_:1},8,["modelValue","label","class"]))}}),Rn={class:"animate-pulse"},Ln={class:"flex items-center justify-between space-x-4"},jn={key:0,class:"h-12 w-12 bg-current rounded-full flex-shrink-0"},Tn={key:1,class:"bg-current h-8 w-full rounded-lg"},An={key:0,class:"space-y-2 mt-6"},Vn={key:1,class:"mt-6 bg-current h-10 rounded-lg w-1/3"},Mn=i({props:{avatar:{type:Boolean,required:!1,default:!1},title:{type:Boolean,required:!1,default:!0},lines:{type:Number,required:!1,default:3},footer:{type:Boolean,required:!1,default:!1}},setup(e){const t=new Array(e.lines).fill(void 0).map((()=>{const e=[4,5,6,8,10,16,24,32];return{margin:`mr-${e[Math.floor(Math.random()*e.length)]}`}}));return(n,r)=>(u(),f("div",Rn,[m("div",Ln,[e.avatar?(u(),f("div",jn)):p("",!0),e.title?(u(),f("div",Tn)):p("",!0)]),e.lines>0?(u(),f("div",An,[(u(!0),f(M,null,q(s(t),((e,t)=>(u(),f("div",{class:v(["bg-current h-4 rounded-lg",e.margin]),key:t},null,2)))),128))])):p("",!0),e.footer?(u(),f("div",Vn)):p("",!0)]))}});var qn=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const Bn={},Un={class:"grid grid-cols-3 grid-rows-3 gap-1 w-12 h-12"},Nn=[B('<div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.3s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.4s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.1s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.3s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.1s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div>',9)];var zn=qn(Bn,[["render",function(e,t){return u(),f("div",Un,Nn)}]]);export{H as D9Button,le as D9Checkbox,K as D9Icon,Ee as D9Input,je as D9Label,wn as D9Menu,Sn as D9MenuLink,Dn as D9Select,Mn as D9Skeleton,zn as D9Spinner,Pn as D9Switch,_ as icons};
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { defineComponent, computed as computed$2, unref as unref$1, openBlock, createBlock, mergeProps, createCommentVNode, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, cloneVNode, h, watchEffect, inject, provide, ref, onMounted, toRaw as toRaw$1, onUnmounted, watch, nextTick as nextTick$1, withCtx, renderSlot, Teleport, Transition, normalizeProps, guardReactiveProps, isRef as isRef$1, Fragment, renderList, createStaticVNode } from "vue";
|
|
18
|
+
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|
19
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
20
|
+
import * as fasIcons from "@fortawesome/free-solid-svg-icons";
|
|
21
|
+
/*!
|
|
22
|
+
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
|
|
23
|
+
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
24
|
+
*/
|
|
25
|
+
var faFacebook = {
|
|
26
|
+
prefix: "fab",
|
|
27
|
+
iconName: "facebook",
|
|
28
|
+
icon: [512, 512, [], "f09a", "M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"]
|
|
29
|
+
};
|
|
30
|
+
var faGithub = {
|
|
31
|
+
prefix: "fab",
|
|
32
|
+
iconName: "github",
|
|
33
|
+
icon: [496, 512, [], "f09b", "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"]
|
|
34
|
+
};
|
|
35
|
+
var faInstagram = {
|
|
36
|
+
prefix: "fab",
|
|
37
|
+
iconName: "instagram",
|
|
38
|
+
icon: [448, 512, [], "f16d", "M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]
|
|
39
|
+
};
|
|
40
|
+
var faLinkedin = {
|
|
41
|
+
prefix: "fab",
|
|
42
|
+
iconName: "linkedin",
|
|
43
|
+
icon: [448, 512, [], "f08c", "M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"]
|
|
44
|
+
};
|
|
45
|
+
var faTwitter = {
|
|
46
|
+
prefix: "fab",
|
|
47
|
+
iconName: "twitter",
|
|
48
|
+
icon: [512, 512, [], "f099", "M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]
|
|
49
|
+
};
|
|
50
|
+
library.add(fasIcons.faChartPie, fasIcons.faCheck, fasIcons.faCheckCircle, fasIcons.faChevronDown, fasIcons.faChevronLeft, fasIcons.faChevronRight, fasIcons.faChevronUp, fasIcons.faCircleNotch, fasIcons.faClipboard, fasIcons.faCog, fasIcons.faDoorOpen, fasIcons.faEllipsisH, fasIcons.faEnvelope, fasIcons.faExclamationTriangle, fasIcons.faFingerprint, fasIcons.faGlobe, fasIcons.faHandPointRight, fasIcons.faInfoCircle, fasIcons.faPencilAlt, fasIcons.faPlayCircle, fasIcons.faPlus, fasIcons.faPlusCircle, fasIcons.faRobot, fasIcons.faSave, fasIcons.faShieldAlt, fasIcons.faTimes, fasIcons.faTrash, fasIcons.faUser, fasIcons.faUserShield, faTwitter, faInstagram, faGithub, faLinkedin, faFacebook);
|
|
51
|
+
var icons = [...Object.keys(library.definitions.fas)].sort();
|
|
52
|
+
const brands = [...Object.keys(library.definitions.fab)].sort();
|
|
53
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
54
|
+
props: {
|
|
55
|
+
name: { default: "user" }
|
|
56
|
+
},
|
|
57
|
+
setup(__props) {
|
|
58
|
+
const props = __props;
|
|
59
|
+
const iconBag = computed$2(() => {
|
|
60
|
+
if (brands.includes(props.name)) {
|
|
61
|
+
return "fab";
|
|
62
|
+
}
|
|
63
|
+
return "fas";
|
|
64
|
+
});
|
|
65
|
+
const isIconAvailable = computed$2(() => {
|
|
66
|
+
if (icons.includes(props.name) || brands.includes(props.name)) {
|
|
67
|
+
return true;
|
|
68
|
+
} else {
|
|
69
|
+
console.warn("could not load icon, because it is not available", props.name);
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return (_ctx, _cache) => {
|
|
74
|
+
return unref$1(isIconAvailable) ? (openBlock(), createBlock(unref$1(FontAwesomeIcon), mergeProps({
|
|
75
|
+
key: 0,
|
|
76
|
+
icon: [unref$1(iconBag), __props.name]
|
|
77
|
+
}, _ctx.$attrs), null, 16, ["icon"])) : createCommentVNode("", true);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const _hoisted_1$8 = ["aria-label", "tabindex"];
|
|
82
|
+
const _hoisted_2$6 = {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
85
|
+
};
|
|
86
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
87
|
+
props: {
|
|
88
|
+
label: null,
|
|
89
|
+
size: { default: "medium" },
|
|
90
|
+
color: { default: "primary" },
|
|
91
|
+
isLoading: { type: Boolean, default: false },
|
|
92
|
+
isDisabled: { type: Boolean, default: false },
|
|
93
|
+
icon: null,
|
|
94
|
+
iconPosition: { default: "right" }
|
|
95
|
+
},
|
|
96
|
+
emits: ["onClick"],
|
|
97
|
+
setup(__props, { emit }) {
|
|
98
|
+
const props = __props;
|
|
99
|
+
const buttonClasses = computed$2(() => {
|
|
100
|
+
const colors = {
|
|
101
|
+
"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": props.color === "primary",
|
|
102
|
+
"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": props.color === "light",
|
|
103
|
+
"text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": props.color === "dark"
|
|
104
|
+
};
|
|
105
|
+
const disabledClasses = {
|
|
106
|
+
"pointer-events-none opacity-75 cursor-not-allowed": props.isDisabled
|
|
107
|
+
};
|
|
108
|
+
const sizes = {
|
|
109
|
+
"px-4 py-1 text-xs leading-5 mono-100 rounded-lg": props.size === "small",
|
|
110
|
+
"px-5 py-2 text-sm leading-4 font-medium rounded-lg": props.size === "medium",
|
|
111
|
+
"px-8 py-3 text-base leading-6 font-medium rounded-lg": props.size === "large"
|
|
112
|
+
};
|
|
113
|
+
return __spreadValues(__spreadValues(__spreadValues({}, colors), disabledClasses), sizes);
|
|
114
|
+
});
|
|
115
|
+
const iconClasses = computed$2(() => {
|
|
116
|
+
const iconLeft = {
|
|
117
|
+
"mr-2 -ml-1": ["small", "medium"].includes(props.size) && props.iconPosition === "left",
|
|
118
|
+
"mr-4 -ml-2": ["large"].includes(props.size) && props.iconPosition === "left"
|
|
119
|
+
};
|
|
120
|
+
const iconRight = {
|
|
121
|
+
"ml-3 -mr-1": ["small", "medium"].includes(props.size) && props.iconPosition === "right",
|
|
122
|
+
"ml-3 -mr-3": ["large"].includes(props.size) && props.iconPosition === "right"
|
|
123
|
+
};
|
|
124
|
+
const colors = {
|
|
125
|
+
"text-white": props.color === "primary",
|
|
126
|
+
"text-blue-600": props.color === "light",
|
|
127
|
+
"text-grey-50": props.color === "dark"
|
|
128
|
+
};
|
|
129
|
+
return __spreadValues(__spreadValues(__spreadValues({}, iconLeft), iconRight), colors);
|
|
130
|
+
});
|
|
131
|
+
function onClick() {
|
|
132
|
+
if (props.isDisabled) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
emit("onClick");
|
|
136
|
+
}
|
|
137
|
+
return (_ctx, _cache) => {
|
|
138
|
+
return openBlock(), createElementBlock("button", {
|
|
139
|
+
class: normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", unref$1(buttonClasses)]),
|
|
140
|
+
type: "button",
|
|
141
|
+
"aria-label": __props.label,
|
|
142
|
+
tabindex: __props.isDisabled ? "-1" : void 0,
|
|
143
|
+
onClick
|
|
144
|
+
}, [
|
|
145
|
+
createElementVNode("div", {
|
|
146
|
+
class: normalizeClass(!__props.isLoading || "invisible")
|
|
147
|
+
}, [
|
|
148
|
+
__props.icon && __props.iconPosition === "left" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
149
|
+
key: 0,
|
|
150
|
+
name: __props.icon,
|
|
151
|
+
class: normalizeClass(unref$1(iconClasses))
|
|
152
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("", true),
|
|
153
|
+
createElementVNode("span", null, toDisplayString(__props.label), 1),
|
|
154
|
+
__props.icon && __props.iconPosition === "right" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
155
|
+
key: 1,
|
|
156
|
+
name: __props.icon,
|
|
157
|
+
class: normalizeClass(unref$1(iconClasses))
|
|
158
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("", true)
|
|
159
|
+
], 2),
|
|
160
|
+
__props.isLoading ? (openBlock(), createElementBlock("span", _hoisted_2$6, [
|
|
161
|
+
createVNode(_sfc_main$a, {
|
|
162
|
+
class: "animate-spin",
|
|
163
|
+
name: "circle-notch"
|
|
164
|
+
})
|
|
165
|
+
])) : createCommentVNode("", true)
|
|
166
|
+
], 10, _hoisted_1$8);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
var getRandomValues;
|
|
171
|
+
var rnds8 = new Uint8Array(16);
|
|
172
|
+
function rng() {
|
|
173
|
+
if (!getRandomValues) {
|
|
174
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
175
|
+
if (!getRandomValues) {
|
|
176
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return getRandomValues(rnds8);
|
|
180
|
+
}
|
|
181
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
182
|
+
function validate(uuid) {
|
|
183
|
+
return typeof uuid === "string" && REGEX.test(uuid);
|
|
184
|
+
}
|
|
185
|
+
var byteToHex = [];
|
|
186
|
+
for (var i = 0; i < 256; ++i) {
|
|
187
|
+
byteToHex.push((i + 256).toString(16).substr(1));
|
|
188
|
+
}
|
|
189
|
+
function stringify(arr) {
|
|
190
|
+
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
191
|
+
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
192
|
+
if (!validate(uuid)) {
|
|
193
|
+
throw TypeError("Stringified UUID is invalid");
|
|
194
|
+
}
|
|
195
|
+
return uuid;
|
|
196
|
+
}
|
|
197
|
+
function v4(options, buf, offset) {
|
|
198
|
+
options = options || {};
|
|
199
|
+
var rnds = options.random || (options.rng || rng)();
|
|
200
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
201
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
202
|
+
if (buf) {
|
|
203
|
+
offset = offset || 0;
|
|
204
|
+
for (var i = 0; i < 16; ++i) {
|
|
205
|
+
buf[offset + i] = rnds[i];
|
|
206
|
+
}
|
|
207
|
+
return buf;
|
|
208
|
+
}
|
|
209
|
+
return stringify(rnds);
|
|
210
|
+
}
|
|
211
|
+
const _hoisted_1$7 = { class: "relative flex items-start" };
|
|
212
|
+
const _hoisted_2$5 = { class: "flex items-center h-5" };
|
|
213
|
+
const _hoisted_3$3 = ["checked", "id"];
|
|
214
|
+
const _hoisted_4$2 = { class: "ml-2 text-sm leading-5" };
|
|
215
|
+
const _hoisted_5$1 = ["for"];
|
|
216
|
+
const _hoisted_6$1 = {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: "text-grey-700 dark:text-grey-400 mono-0 casual-60"
|
|
219
|
+
};
|
|
220
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
221
|
+
props: {
|
|
222
|
+
id: { default: v4() },
|
|
223
|
+
label: null,
|
|
224
|
+
modelValue: { type: Boolean },
|
|
225
|
+
description: null
|
|
226
|
+
},
|
|
227
|
+
emits: ["update:modelValue"],
|
|
228
|
+
setup(__props, { emit: emits }) {
|
|
229
|
+
const update = (value) => {
|
|
230
|
+
emits("update:modelValue", value.target.checked);
|
|
231
|
+
};
|
|
232
|
+
return (_ctx, _cache) => {
|
|
233
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
234
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
235
|
+
createElementVNode("input", {
|
|
236
|
+
class: "h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm",
|
|
237
|
+
type: "checkbox",
|
|
238
|
+
checked: __props.modelValue,
|
|
239
|
+
onChange: update,
|
|
240
|
+
id: __props.id
|
|
241
|
+
}, null, 40, _hoisted_3$3)
|
|
242
|
+
]),
|
|
243
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
244
|
+
createElementVNode("label", {
|
|
245
|
+
for: __props.id,
|
|
246
|
+
class: "font-medium text-grey-900 dark:text-grey-200 casual-25"
|
|
247
|
+
}, toDisplayString(__props.label), 9, _hoisted_5$1),
|
|
248
|
+
__props.description ? (openBlock(), createElementBlock("p", _hoisted_6$1, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
249
|
+
])
|
|
250
|
+
]);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
const EMPTY_OBJ = {};
|
|
255
|
+
const NOOP = () => {
|
|
256
|
+
};
|
|
257
|
+
const extend = Object.assign;
|
|
258
|
+
const remove = (arr, el) => {
|
|
259
|
+
const i = arr.indexOf(el);
|
|
260
|
+
if (i > -1) {
|
|
261
|
+
arr.splice(i, 1);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const isArray = Array.isArray;
|
|
265
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
266
|
+
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
267
|
+
const isFunction = (val) => typeof val === "function";
|
|
268
|
+
const isString = (val) => typeof val === "string";
|
|
269
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
270
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
271
|
+
const isPromise = (val) => {
|
|
272
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
273
|
+
};
|
|
274
|
+
const objectToString = Object.prototype.toString;
|
|
275
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
276
|
+
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
277
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
278
|
+
const def = (obj, key, value) => {
|
|
279
|
+
Object.defineProperty(obj, key, {
|
|
280
|
+
configurable: true,
|
|
281
|
+
enumerable: false,
|
|
282
|
+
value
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
let activeEffectScope;
|
|
286
|
+
function recordEffectScope(effect2, scope) {
|
|
287
|
+
scope = scope || activeEffectScope;
|
|
288
|
+
if (scope && scope.active) {
|
|
289
|
+
scope.effects.push(effect2);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
const createDep = (effects) => {
|
|
293
|
+
const dep = new Set(effects);
|
|
294
|
+
dep.w = 0;
|
|
295
|
+
dep.n = 0;
|
|
296
|
+
return dep;
|
|
297
|
+
};
|
|
298
|
+
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
299
|
+
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
300
|
+
const initDepMarkers = ({ deps }) => {
|
|
301
|
+
if (deps.length) {
|
|
302
|
+
for (let i = 0; i < deps.length; i++) {
|
|
303
|
+
deps[i].w |= trackOpBit;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
const finalizeDepMarkers = (effect2) => {
|
|
308
|
+
const { deps } = effect2;
|
|
309
|
+
if (deps.length) {
|
|
310
|
+
let ptr = 0;
|
|
311
|
+
for (let i = 0; i < deps.length; i++) {
|
|
312
|
+
const dep = deps[i];
|
|
313
|
+
if (wasTracked(dep) && !newTracked(dep)) {
|
|
314
|
+
dep.delete(effect2);
|
|
315
|
+
} else {
|
|
316
|
+
deps[ptr++] = dep;
|
|
317
|
+
}
|
|
318
|
+
dep.w &= ~trackOpBit;
|
|
319
|
+
dep.n &= ~trackOpBit;
|
|
320
|
+
}
|
|
321
|
+
deps.length = ptr;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
let effectTrackDepth = 0;
|
|
325
|
+
let trackOpBit = 1;
|
|
326
|
+
const maxMarkerBits = 30;
|
|
327
|
+
const effectStack = [];
|
|
328
|
+
let activeEffect;
|
|
329
|
+
class ReactiveEffect {
|
|
330
|
+
constructor(fn2, scheduler = null, scope) {
|
|
331
|
+
this.fn = fn2;
|
|
332
|
+
this.scheduler = scheduler;
|
|
333
|
+
this.active = true;
|
|
334
|
+
this.deps = [];
|
|
335
|
+
recordEffectScope(this, scope);
|
|
336
|
+
}
|
|
337
|
+
run() {
|
|
338
|
+
if (!this.active) {
|
|
339
|
+
return this.fn();
|
|
340
|
+
}
|
|
341
|
+
if (!effectStack.length || !effectStack.includes(this)) {
|
|
342
|
+
try {
|
|
343
|
+
effectStack.push(activeEffect = this);
|
|
344
|
+
enableTracking();
|
|
345
|
+
trackOpBit = 1 << ++effectTrackDepth;
|
|
346
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
347
|
+
initDepMarkers(this);
|
|
348
|
+
} else {
|
|
349
|
+
cleanupEffect(this);
|
|
350
|
+
}
|
|
351
|
+
return this.fn();
|
|
352
|
+
} finally {
|
|
353
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
354
|
+
finalizeDepMarkers(this);
|
|
355
|
+
}
|
|
356
|
+
trackOpBit = 1 << --effectTrackDepth;
|
|
357
|
+
resetTracking();
|
|
358
|
+
effectStack.pop();
|
|
359
|
+
const n = effectStack.length;
|
|
360
|
+
activeEffect = n > 0 ? effectStack[n - 1] : void 0;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
stop() {
|
|
365
|
+
if (this.active) {
|
|
366
|
+
cleanupEffect(this);
|
|
367
|
+
if (this.onStop) {
|
|
368
|
+
this.onStop();
|
|
369
|
+
}
|
|
370
|
+
this.active = false;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function cleanupEffect(effect2) {
|
|
375
|
+
const { deps } = effect2;
|
|
376
|
+
if (deps.length) {
|
|
377
|
+
for (let i = 0; i < deps.length; i++) {
|
|
378
|
+
deps[i].delete(effect2);
|
|
379
|
+
}
|
|
380
|
+
deps.length = 0;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
let shouldTrack = true;
|
|
384
|
+
const trackStack = [];
|
|
385
|
+
function enableTracking() {
|
|
386
|
+
trackStack.push(shouldTrack);
|
|
387
|
+
shouldTrack = true;
|
|
388
|
+
}
|
|
389
|
+
function resetTracking() {
|
|
390
|
+
const last = trackStack.pop();
|
|
391
|
+
shouldTrack = last === void 0 ? true : last;
|
|
392
|
+
}
|
|
393
|
+
function isTracking() {
|
|
394
|
+
return shouldTrack && activeEffect !== void 0;
|
|
395
|
+
}
|
|
396
|
+
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
397
|
+
let shouldTrack2 = false;
|
|
398
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
399
|
+
if (!newTracked(dep)) {
|
|
400
|
+
dep.n |= trackOpBit;
|
|
401
|
+
shouldTrack2 = !wasTracked(dep);
|
|
402
|
+
}
|
|
403
|
+
} else {
|
|
404
|
+
shouldTrack2 = !dep.has(activeEffect);
|
|
405
|
+
}
|
|
406
|
+
if (shouldTrack2) {
|
|
407
|
+
dep.add(activeEffect);
|
|
408
|
+
activeEffect.deps.push(dep);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
412
|
+
for (const effect2 of isArray(dep) ? dep : [...dep]) {
|
|
413
|
+
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
414
|
+
if (effect2.scheduler) {
|
|
415
|
+
effect2.scheduler();
|
|
416
|
+
} else {
|
|
417
|
+
effect2.run();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
|
|
423
|
+
function isReactive(value) {
|
|
424
|
+
if (isReadonly(value)) {
|
|
425
|
+
return isReactive(value["__v_raw"]);
|
|
426
|
+
}
|
|
427
|
+
return !!(value && value["__v_isReactive"]);
|
|
428
|
+
}
|
|
429
|
+
function isReadonly(value) {
|
|
430
|
+
return !!(value && value["__v_isReadonly"]);
|
|
431
|
+
}
|
|
432
|
+
function isShallow(value) {
|
|
433
|
+
return !!(value && value["__v_isShallow"]);
|
|
434
|
+
}
|
|
435
|
+
function toRaw(observed) {
|
|
436
|
+
const raw = observed && observed["__v_raw"];
|
|
437
|
+
return raw ? toRaw(raw) : observed;
|
|
438
|
+
}
|
|
439
|
+
function markRaw(value) {
|
|
440
|
+
def(value, "__v_skip", true);
|
|
441
|
+
return value;
|
|
442
|
+
}
|
|
443
|
+
function trackRefValue(ref2) {
|
|
444
|
+
if (isTracking()) {
|
|
445
|
+
ref2 = toRaw(ref2);
|
|
446
|
+
if (!ref2.dep) {
|
|
447
|
+
ref2.dep = createDep();
|
|
448
|
+
}
|
|
449
|
+
{
|
|
450
|
+
trackEffects(ref2.dep);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function triggerRefValue(ref2, newVal) {
|
|
455
|
+
ref2 = toRaw(ref2);
|
|
456
|
+
if (ref2.dep) {
|
|
457
|
+
{
|
|
458
|
+
triggerEffects(ref2.dep);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function isRef(r) {
|
|
463
|
+
return Boolean(r && r.__v_isRef === true);
|
|
464
|
+
}
|
|
465
|
+
function unref(ref2) {
|
|
466
|
+
return isRef(ref2) ? ref2.value : ref2;
|
|
467
|
+
}
|
|
468
|
+
const shallowUnwrapHandlers = {
|
|
469
|
+
get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
|
|
470
|
+
set: (target, key, value, receiver) => {
|
|
471
|
+
const oldValue = target[key];
|
|
472
|
+
if (isRef(oldValue) && !isRef(value)) {
|
|
473
|
+
oldValue.value = value;
|
|
474
|
+
return true;
|
|
475
|
+
} else {
|
|
476
|
+
return Reflect.set(target, key, value, receiver);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
function proxyRefs(objectWithRefs) {
|
|
481
|
+
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
482
|
+
}
|
|
483
|
+
class ComputedRefImpl {
|
|
484
|
+
constructor(getter, _setter, isReadonly2, isSSR) {
|
|
485
|
+
this._setter = _setter;
|
|
486
|
+
this.dep = void 0;
|
|
487
|
+
this.__v_isRef = true;
|
|
488
|
+
this._dirty = true;
|
|
489
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
490
|
+
if (!this._dirty) {
|
|
491
|
+
this._dirty = true;
|
|
492
|
+
triggerRefValue(this);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
this.effect.computed = this;
|
|
496
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
497
|
+
this["__v_isReadonly"] = isReadonly2;
|
|
498
|
+
}
|
|
499
|
+
get value() {
|
|
500
|
+
const self = toRaw(this);
|
|
501
|
+
trackRefValue(self);
|
|
502
|
+
if (self._dirty || !self._cacheable) {
|
|
503
|
+
self._dirty = false;
|
|
504
|
+
self._value = self.effect.run();
|
|
505
|
+
}
|
|
506
|
+
return self._value;
|
|
507
|
+
}
|
|
508
|
+
set value(newValue) {
|
|
509
|
+
this._setter(newValue);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
513
|
+
let getter;
|
|
514
|
+
let setter;
|
|
515
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
516
|
+
if (onlyGetter) {
|
|
517
|
+
getter = getterOrOptions;
|
|
518
|
+
setter = NOOP;
|
|
519
|
+
} else {
|
|
520
|
+
getter = getterOrOptions.get;
|
|
521
|
+
setter = getterOrOptions.set;
|
|
522
|
+
}
|
|
523
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
524
|
+
return cRef;
|
|
525
|
+
}
|
|
526
|
+
Promise.resolve();
|
|
527
|
+
function callWithErrorHandling(fn2, instance, type, args) {
|
|
528
|
+
let res;
|
|
529
|
+
try {
|
|
530
|
+
res = args ? fn2(...args) : fn2();
|
|
531
|
+
} catch (err) {
|
|
532
|
+
handleError(err, instance, type);
|
|
533
|
+
}
|
|
534
|
+
return res;
|
|
535
|
+
}
|
|
536
|
+
function callWithAsyncErrorHandling(fn2, instance, type, args) {
|
|
537
|
+
if (isFunction(fn2)) {
|
|
538
|
+
const res = callWithErrorHandling(fn2, instance, type, args);
|
|
539
|
+
if (res && isPromise(res)) {
|
|
540
|
+
res.catch((err) => {
|
|
541
|
+
handleError(err, instance, type);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
return res;
|
|
545
|
+
}
|
|
546
|
+
const values = [];
|
|
547
|
+
for (let i = 0; i < fn2.length; i++) {
|
|
548
|
+
values.push(callWithAsyncErrorHandling(fn2[i], instance, type, args));
|
|
549
|
+
}
|
|
550
|
+
return values;
|
|
551
|
+
}
|
|
552
|
+
function handleError(err, instance, type, throwInDev = true) {
|
|
553
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
554
|
+
if (instance) {
|
|
555
|
+
let cur = instance.parent;
|
|
556
|
+
const exposedInstance = instance.proxy;
|
|
557
|
+
const errorInfo = type;
|
|
558
|
+
while (cur) {
|
|
559
|
+
const errorCapturedHooks = cur.ec;
|
|
560
|
+
if (errorCapturedHooks) {
|
|
561
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
562
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
cur = cur.parent;
|
|
568
|
+
}
|
|
569
|
+
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
570
|
+
if (appErrorHandler) {
|
|
571
|
+
callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
logError(err, type, contextVNode, throwInDev);
|
|
576
|
+
}
|
|
577
|
+
function logError(err, type, contextVNode, throwInDev = true) {
|
|
578
|
+
{
|
|
579
|
+
console.error(err);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
let isFlushing = false;
|
|
583
|
+
let isFlushPending = false;
|
|
584
|
+
const queue = [];
|
|
585
|
+
let flushIndex = 0;
|
|
586
|
+
const pendingPreFlushCbs = [];
|
|
587
|
+
let activePreFlushCbs = null;
|
|
588
|
+
let preFlushIndex = 0;
|
|
589
|
+
const pendingPostFlushCbs = [];
|
|
590
|
+
let activePostFlushCbs = null;
|
|
591
|
+
let postFlushIndex = 0;
|
|
592
|
+
const resolvedPromise = Promise.resolve();
|
|
593
|
+
let currentFlushPromise = null;
|
|
594
|
+
let currentPreFlushParentJob = null;
|
|
595
|
+
function nextTick(fn2) {
|
|
596
|
+
const p = currentFlushPromise || resolvedPromise;
|
|
597
|
+
return fn2 ? p.then(this ? fn2.bind(this) : fn2) : p;
|
|
598
|
+
}
|
|
599
|
+
function findInsertionIndex(id2) {
|
|
600
|
+
let start2 = flushIndex + 1;
|
|
601
|
+
let end2 = queue.length;
|
|
602
|
+
while (start2 < end2) {
|
|
603
|
+
const middle = start2 + end2 >>> 1;
|
|
604
|
+
const middleJobId = getId(queue[middle]);
|
|
605
|
+
middleJobId < id2 ? start2 = middle + 1 : end2 = middle;
|
|
606
|
+
}
|
|
607
|
+
return start2;
|
|
608
|
+
}
|
|
609
|
+
function queueJob(job) {
|
|
610
|
+
if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
|
|
611
|
+
if (job.id == null) {
|
|
612
|
+
queue.push(job);
|
|
613
|
+
} else {
|
|
614
|
+
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
615
|
+
}
|
|
616
|
+
queueFlush();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function queueFlush() {
|
|
620
|
+
if (!isFlushing && !isFlushPending) {
|
|
621
|
+
isFlushPending = true;
|
|
622
|
+
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function queueCb(cb, activeQueue, pendingQueue, index) {
|
|
626
|
+
if (!isArray(cb)) {
|
|
627
|
+
if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
|
|
628
|
+
pendingQueue.push(cb);
|
|
629
|
+
}
|
|
630
|
+
} else {
|
|
631
|
+
pendingQueue.push(...cb);
|
|
632
|
+
}
|
|
633
|
+
queueFlush();
|
|
634
|
+
}
|
|
635
|
+
function queuePreFlushCb(cb) {
|
|
636
|
+
queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
|
|
637
|
+
}
|
|
638
|
+
function queuePostFlushCb(cb) {
|
|
639
|
+
queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
|
|
640
|
+
}
|
|
641
|
+
function flushPreFlushCbs(seen, parentJob = null) {
|
|
642
|
+
if (pendingPreFlushCbs.length) {
|
|
643
|
+
currentPreFlushParentJob = parentJob;
|
|
644
|
+
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
645
|
+
pendingPreFlushCbs.length = 0;
|
|
646
|
+
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
647
|
+
activePreFlushCbs[preFlushIndex]();
|
|
648
|
+
}
|
|
649
|
+
activePreFlushCbs = null;
|
|
650
|
+
preFlushIndex = 0;
|
|
651
|
+
currentPreFlushParentJob = null;
|
|
652
|
+
flushPreFlushCbs(seen, parentJob);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function flushPostFlushCbs(seen) {
|
|
656
|
+
if (pendingPostFlushCbs.length) {
|
|
657
|
+
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
658
|
+
pendingPostFlushCbs.length = 0;
|
|
659
|
+
if (activePostFlushCbs) {
|
|
660
|
+
activePostFlushCbs.push(...deduped);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
activePostFlushCbs = deduped;
|
|
664
|
+
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
665
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
666
|
+
activePostFlushCbs[postFlushIndex]();
|
|
667
|
+
}
|
|
668
|
+
activePostFlushCbs = null;
|
|
669
|
+
postFlushIndex = 0;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
673
|
+
function flushJobs(seen) {
|
|
674
|
+
isFlushPending = false;
|
|
675
|
+
isFlushing = true;
|
|
676
|
+
flushPreFlushCbs(seen);
|
|
677
|
+
queue.sort((a, b) => getId(a) - getId(b));
|
|
678
|
+
const check = NOOP;
|
|
679
|
+
try {
|
|
680
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
681
|
+
const job = queue[flushIndex];
|
|
682
|
+
if (job && job.active !== false) {
|
|
683
|
+
if (false)
|
|
684
|
+
;
|
|
685
|
+
callWithErrorHandling(job, null, 14);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
} finally {
|
|
689
|
+
flushIndex = 0;
|
|
690
|
+
queue.length = 0;
|
|
691
|
+
flushPostFlushCbs();
|
|
692
|
+
isFlushing = false;
|
|
693
|
+
currentFlushPromise = null;
|
|
694
|
+
if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
|
|
695
|
+
flushJobs(seen);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function queueEffectWithSuspense(fn2, suspense) {
|
|
700
|
+
if (suspense && suspense.pendingBranch) {
|
|
701
|
+
if (isArray(fn2)) {
|
|
702
|
+
suspense.effects.push(...fn2);
|
|
703
|
+
} else {
|
|
704
|
+
suspense.effects.push(fn2);
|
|
705
|
+
}
|
|
706
|
+
} else {
|
|
707
|
+
queuePostFlushCb(fn2);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
const INITIAL_WATCHER_VALUE = {};
|
|
711
|
+
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
712
|
+
const instance = currentInstance;
|
|
713
|
+
let getter;
|
|
714
|
+
let forceTrigger = false;
|
|
715
|
+
let isMultiSource = false;
|
|
716
|
+
if (isRef(source)) {
|
|
717
|
+
getter = () => source.value;
|
|
718
|
+
forceTrigger = isShallow(source);
|
|
719
|
+
} else if (isReactive(source)) {
|
|
720
|
+
getter = () => source;
|
|
721
|
+
deep = true;
|
|
722
|
+
} else if (isArray(source)) {
|
|
723
|
+
isMultiSource = true;
|
|
724
|
+
forceTrigger = source.some(isReactive);
|
|
725
|
+
getter = () => source.map((s) => {
|
|
726
|
+
if (isRef(s)) {
|
|
727
|
+
return s.value;
|
|
728
|
+
} else if (isReactive(s)) {
|
|
729
|
+
return traverse(s);
|
|
730
|
+
} else if (isFunction(s)) {
|
|
731
|
+
return callWithErrorHandling(s, instance, 2);
|
|
732
|
+
} else
|
|
733
|
+
;
|
|
734
|
+
});
|
|
735
|
+
} else if (isFunction(source)) {
|
|
736
|
+
if (cb) {
|
|
737
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
738
|
+
} else {
|
|
739
|
+
getter = () => {
|
|
740
|
+
if (instance && instance.isUnmounted) {
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
if (cleanup) {
|
|
744
|
+
cleanup();
|
|
745
|
+
}
|
|
746
|
+
return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
} else {
|
|
750
|
+
getter = NOOP;
|
|
751
|
+
}
|
|
752
|
+
if (cb && deep) {
|
|
753
|
+
const baseGetter = getter;
|
|
754
|
+
getter = () => traverse(baseGetter());
|
|
755
|
+
}
|
|
756
|
+
let cleanup;
|
|
757
|
+
let onCleanup = (fn2) => {
|
|
758
|
+
cleanup = effect2.onStop = () => {
|
|
759
|
+
callWithErrorHandling(fn2, instance, 4);
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
763
|
+
const job = () => {
|
|
764
|
+
if (!effect2.active) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
if (cb) {
|
|
768
|
+
const newValue = effect2.run();
|
|
769
|
+
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
|
|
770
|
+
if (cleanup) {
|
|
771
|
+
cleanup();
|
|
772
|
+
}
|
|
773
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
774
|
+
newValue,
|
|
775
|
+
oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
|
|
776
|
+
onCleanup
|
|
777
|
+
]);
|
|
778
|
+
oldValue = newValue;
|
|
779
|
+
}
|
|
780
|
+
} else {
|
|
781
|
+
effect2.run();
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
job.allowRecurse = !!cb;
|
|
785
|
+
let scheduler;
|
|
786
|
+
if (flush === "sync") {
|
|
787
|
+
scheduler = job;
|
|
788
|
+
} else if (flush === "post") {
|
|
789
|
+
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
790
|
+
} else {
|
|
791
|
+
scheduler = () => {
|
|
792
|
+
if (!instance || instance.isMounted) {
|
|
793
|
+
queuePreFlushCb(job);
|
|
794
|
+
} else {
|
|
795
|
+
job();
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
const effect2 = new ReactiveEffect(getter, scheduler);
|
|
800
|
+
if (cb) {
|
|
801
|
+
if (immediate) {
|
|
802
|
+
job();
|
|
803
|
+
} else {
|
|
804
|
+
oldValue = effect2.run();
|
|
805
|
+
}
|
|
806
|
+
} else if (flush === "post") {
|
|
807
|
+
queuePostRenderEffect(effect2.run.bind(effect2), instance && instance.suspense);
|
|
808
|
+
} else {
|
|
809
|
+
effect2.run();
|
|
810
|
+
}
|
|
811
|
+
return () => {
|
|
812
|
+
effect2.stop();
|
|
813
|
+
if (instance && instance.scope) {
|
|
814
|
+
remove(instance.scope.effects, effect2);
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
function instanceWatch(source, value, options) {
|
|
819
|
+
const publicThis = this.proxy;
|
|
820
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
821
|
+
let cb;
|
|
822
|
+
if (isFunction(value)) {
|
|
823
|
+
cb = value;
|
|
824
|
+
} else {
|
|
825
|
+
cb = value.handler;
|
|
826
|
+
options = value;
|
|
827
|
+
}
|
|
828
|
+
const cur = currentInstance;
|
|
829
|
+
setCurrentInstance(this);
|
|
830
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
831
|
+
if (cur) {
|
|
832
|
+
setCurrentInstance(cur);
|
|
833
|
+
} else {
|
|
834
|
+
unsetCurrentInstance();
|
|
835
|
+
}
|
|
836
|
+
return res;
|
|
837
|
+
}
|
|
838
|
+
function createPathGetter(ctx, path) {
|
|
839
|
+
const segments = path.split(".");
|
|
840
|
+
return () => {
|
|
841
|
+
let cur = ctx;
|
|
842
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
843
|
+
cur = cur[segments[i]];
|
|
844
|
+
}
|
|
845
|
+
return cur;
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
function traverse(value, seen) {
|
|
849
|
+
if (!isObject(value) || value["__v_skip"]) {
|
|
850
|
+
return value;
|
|
851
|
+
}
|
|
852
|
+
seen = seen || new Set();
|
|
853
|
+
if (seen.has(value)) {
|
|
854
|
+
return value;
|
|
855
|
+
}
|
|
856
|
+
seen.add(value);
|
|
857
|
+
if (isRef(value)) {
|
|
858
|
+
traverse(value.value, seen);
|
|
859
|
+
} else if (isArray(value)) {
|
|
860
|
+
for (let i = 0; i < value.length; i++) {
|
|
861
|
+
traverse(value[i], seen);
|
|
862
|
+
}
|
|
863
|
+
} else if (isSet(value) || isMap(value)) {
|
|
864
|
+
value.forEach((v) => {
|
|
865
|
+
traverse(v, seen);
|
|
866
|
+
});
|
|
867
|
+
} else if (isPlainObject(value)) {
|
|
868
|
+
for (const key in value) {
|
|
869
|
+
traverse(value[key], seen);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return value;
|
|
873
|
+
}
|
|
874
|
+
function resolveMergedOptions(instance) {
|
|
875
|
+
const base = instance.type;
|
|
876
|
+
const { mixins, extends: extendsOptions } = base;
|
|
877
|
+
const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
|
|
878
|
+
const cached = cache.get(base);
|
|
879
|
+
let resolved;
|
|
880
|
+
if (cached) {
|
|
881
|
+
resolved = cached;
|
|
882
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
883
|
+
{
|
|
884
|
+
resolved = base;
|
|
885
|
+
}
|
|
886
|
+
} else {
|
|
887
|
+
resolved = {};
|
|
888
|
+
if (globalMixins.length) {
|
|
889
|
+
globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
890
|
+
}
|
|
891
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
892
|
+
}
|
|
893
|
+
cache.set(base, resolved);
|
|
894
|
+
return resolved;
|
|
895
|
+
}
|
|
896
|
+
function mergeOptions(to, from, strats, asMixin = false) {
|
|
897
|
+
const { mixins, extends: extendsOptions } = from;
|
|
898
|
+
if (extendsOptions) {
|
|
899
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
900
|
+
}
|
|
901
|
+
if (mixins) {
|
|
902
|
+
mixins.forEach((m) => mergeOptions(to, m, strats, true));
|
|
903
|
+
}
|
|
904
|
+
for (const key in from) {
|
|
905
|
+
if (asMixin && key === "expose")
|
|
906
|
+
;
|
|
907
|
+
else {
|
|
908
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
909
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return to;
|
|
913
|
+
}
|
|
914
|
+
const internalOptionMergeStrats = {
|
|
915
|
+
data: mergeDataFn,
|
|
916
|
+
props: mergeObjectOptions,
|
|
917
|
+
emits: mergeObjectOptions,
|
|
918
|
+
methods: mergeObjectOptions,
|
|
919
|
+
computed: mergeObjectOptions,
|
|
920
|
+
beforeCreate: mergeAsArray,
|
|
921
|
+
created: mergeAsArray,
|
|
922
|
+
beforeMount: mergeAsArray,
|
|
923
|
+
mounted: mergeAsArray,
|
|
924
|
+
beforeUpdate: mergeAsArray,
|
|
925
|
+
updated: mergeAsArray,
|
|
926
|
+
beforeDestroy: mergeAsArray,
|
|
927
|
+
beforeUnmount: mergeAsArray,
|
|
928
|
+
destroyed: mergeAsArray,
|
|
929
|
+
unmounted: mergeAsArray,
|
|
930
|
+
activated: mergeAsArray,
|
|
931
|
+
deactivated: mergeAsArray,
|
|
932
|
+
errorCaptured: mergeAsArray,
|
|
933
|
+
serverPrefetch: mergeAsArray,
|
|
934
|
+
components: mergeObjectOptions,
|
|
935
|
+
directives: mergeObjectOptions,
|
|
936
|
+
watch: mergeWatchOptions,
|
|
937
|
+
provide: mergeDataFn,
|
|
938
|
+
inject: mergeInject
|
|
939
|
+
};
|
|
940
|
+
function mergeDataFn(to, from) {
|
|
941
|
+
if (!from) {
|
|
942
|
+
return to;
|
|
943
|
+
}
|
|
944
|
+
if (!to) {
|
|
945
|
+
return from;
|
|
946
|
+
}
|
|
947
|
+
return function mergedDataFn() {
|
|
948
|
+
return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
function mergeInject(to, from) {
|
|
952
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
953
|
+
}
|
|
954
|
+
function normalizeInject(raw) {
|
|
955
|
+
if (isArray(raw)) {
|
|
956
|
+
const res = {};
|
|
957
|
+
for (let i = 0; i < raw.length; i++) {
|
|
958
|
+
res[raw[i]] = raw[i];
|
|
959
|
+
}
|
|
960
|
+
return res;
|
|
961
|
+
}
|
|
962
|
+
return raw;
|
|
963
|
+
}
|
|
964
|
+
function mergeAsArray(to, from) {
|
|
965
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
966
|
+
}
|
|
967
|
+
function mergeObjectOptions(to, from) {
|
|
968
|
+
return to ? extend(extend(Object.create(null), to), from) : from;
|
|
969
|
+
}
|
|
970
|
+
function mergeWatchOptions(to, from) {
|
|
971
|
+
if (!to)
|
|
972
|
+
return from;
|
|
973
|
+
if (!from)
|
|
974
|
+
return to;
|
|
975
|
+
const merged = extend(Object.create(null), to);
|
|
976
|
+
for (const key in from) {
|
|
977
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
978
|
+
}
|
|
979
|
+
return merged;
|
|
980
|
+
}
|
|
981
|
+
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
982
|
+
const getPublicInstance = (i) => {
|
|
983
|
+
if (!i)
|
|
984
|
+
return null;
|
|
985
|
+
if (isStatefulComponent(i))
|
|
986
|
+
return getExposeProxy(i) || i.proxy;
|
|
987
|
+
return getPublicInstance(i.parent);
|
|
988
|
+
};
|
|
989
|
+
const publicPropertiesMap = extend(Object.create(null), {
|
|
990
|
+
$: (i) => i,
|
|
991
|
+
$el: (i) => i.vnode.el,
|
|
992
|
+
$data: (i) => i.data,
|
|
993
|
+
$props: (i) => i.props,
|
|
994
|
+
$attrs: (i) => i.attrs,
|
|
995
|
+
$slots: (i) => i.slots,
|
|
996
|
+
$refs: (i) => i.refs,
|
|
997
|
+
$parent: (i) => getPublicInstance(i.parent),
|
|
998
|
+
$root: (i) => getPublicInstance(i.root),
|
|
999
|
+
$emit: (i) => i.emit,
|
|
1000
|
+
$options: (i) => resolveMergedOptions(i),
|
|
1001
|
+
$forceUpdate: (i) => () => queueJob(i.update),
|
|
1002
|
+
$nextTick: (i) => nextTick.bind(i.proxy),
|
|
1003
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
1004
|
+
});
|
|
1005
|
+
let currentInstance = null;
|
|
1006
|
+
const setCurrentInstance = (instance) => {
|
|
1007
|
+
currentInstance = instance;
|
|
1008
|
+
instance.scope.on();
|
|
1009
|
+
};
|
|
1010
|
+
const unsetCurrentInstance = () => {
|
|
1011
|
+
currentInstance && currentInstance.scope.off();
|
|
1012
|
+
currentInstance = null;
|
|
1013
|
+
};
|
|
1014
|
+
function isStatefulComponent(instance) {
|
|
1015
|
+
return instance.vnode.shapeFlag & 4;
|
|
1016
|
+
}
|
|
1017
|
+
let isInSSRComponentSetup = false;
|
|
1018
|
+
function getExposeProxy(instance) {
|
|
1019
|
+
if (instance.exposed) {
|
|
1020
|
+
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
1021
|
+
get(target, key) {
|
|
1022
|
+
if (key in target) {
|
|
1023
|
+
return target[key];
|
|
1024
|
+
} else if (key in publicPropertiesMap) {
|
|
1025
|
+
return publicPropertiesMap[key](instance);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}));
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
const computed = (getterOrOptions, debugOptions) => {
|
|
1032
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
1033
|
+
};
|
|
1034
|
+
function useFormClasses(props) {
|
|
1035
|
+
const inputClasses = computed(() => {
|
|
1036
|
+
return {
|
|
1037
|
+
"pl-3 pr-10 py-1": !props.icon && props.size === "small",
|
|
1038
|
+
"pl-4 pr-10 py-3": !props.icon && props.size === "medium",
|
|
1039
|
+
"pl-6 pr-10 py-3": !props.icon && props.size === "large",
|
|
1040
|
+
"pl-10 pr-10 py-1": props.icon && props.size === "small",
|
|
1041
|
+
"pl-12 pr-10 py-3": props.icon && (props.size === "medium" || props.size === "large"),
|
|
1042
|
+
"w-full block": props.block === true
|
|
1043
|
+
};
|
|
1044
|
+
});
|
|
1045
|
+
const disabledClasses = computed(() => {
|
|
1046
|
+
return {
|
|
1047
|
+
"pointer-events-none opacity-50 cursor-not-allowed": props.isDisabled
|
|
1048
|
+
};
|
|
1049
|
+
});
|
|
1050
|
+
const textSizeClasses = computed(() => {
|
|
1051
|
+
return {
|
|
1052
|
+
"text-xs leading-4": props.size === "small",
|
|
1053
|
+
"text-sm leading-4": props.size === "medium",
|
|
1054
|
+
"text-base leading-5": props.size === "large"
|
|
1055
|
+
};
|
|
1056
|
+
});
|
|
1057
|
+
return {
|
|
1058
|
+
inputClasses,
|
|
1059
|
+
disabledClasses,
|
|
1060
|
+
textSizeClasses
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
const _hoisted_1$6 = { class: "relative" };
|
|
1064
|
+
const _hoisted_2$4 = ["placeholder", "type", "tabindex", "value"];
|
|
1065
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1066
|
+
props: {
|
|
1067
|
+
modelValue: null,
|
|
1068
|
+
type: { default: "text" },
|
|
1069
|
+
placeholder: null,
|
|
1070
|
+
size: { default: "medium" },
|
|
1071
|
+
icon: null,
|
|
1072
|
+
isDisabled: { type: Boolean, default: false },
|
|
1073
|
+
block: { type: Boolean }
|
|
1074
|
+
},
|
|
1075
|
+
emits: ["update:modelValue"],
|
|
1076
|
+
setup(__props, { emit }) {
|
|
1077
|
+
const props = __props;
|
|
1078
|
+
const { inputClasses, disabledClasses, textSizeClasses } = useFormClasses(props);
|
|
1079
|
+
const onInput = function(payload) {
|
|
1080
|
+
emit("update:modelValue", (payload == null ? void 0 : payload.target).value);
|
|
1081
|
+
};
|
|
1082
|
+
return (_ctx, _cache) => {
|
|
1083
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
1084
|
+
createElementVNode("input", {
|
|
1085
|
+
class: normalizeClass(["mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [unref$1(inputClasses), unref$1(textSizeClasses), unref$1(disabledClasses)]]),
|
|
1086
|
+
placeholder: __props.placeholder,
|
|
1087
|
+
type: __props.type,
|
|
1088
|
+
tabindex: __props.isDisabled ? "-1" : void 0,
|
|
1089
|
+
value: __props.modelValue,
|
|
1090
|
+
onInput
|
|
1091
|
+
}, null, 42, _hoisted_2$4),
|
|
1092
|
+
__props.icon ? (openBlock(), createElementBlock("span", {
|
|
1093
|
+
key: 0,
|
|
1094
|
+
class: normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", unref$1(textSizeClasses)])
|
|
1095
|
+
}, [
|
|
1096
|
+
createVNode(_sfc_main$a, { name: __props.icon }, null, 8, ["name"])
|
|
1097
|
+
], 2)) : createCommentVNode("", true)
|
|
1098
|
+
]);
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
});
|
|
1102
|
+
const _hoisted_1$5 = { class: "inline-block text-blue-900 text-sm font-medium" };
|
|
1103
|
+
const _hoisted_2$3 = ["for"];
|
|
1104
|
+
const _hoisted_3$2 = {
|
|
1105
|
+
key: 0,
|
|
1106
|
+
class: "block text-xs text-grey-400"
|
|
1107
|
+
};
|
|
1108
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1109
|
+
props: {
|
|
1110
|
+
id: null,
|
|
1111
|
+
label: null,
|
|
1112
|
+
description: null
|
|
1113
|
+
},
|
|
1114
|
+
setup(__props) {
|
|
1115
|
+
return (_ctx, _cache) => {
|
|
1116
|
+
return openBlock(), createElementBlock("span", _hoisted_1$5, [
|
|
1117
|
+
createElementVNode("label", { for: __props.id }, toDisplayString(__props.label), 9, _hoisted_2$3),
|
|
1118
|
+
__props.description ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
1119
|
+
]);
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
function _extends() {
|
|
1124
|
+
_extends = Object.assign || function(target) {
|
|
1125
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1126
|
+
var source = arguments[i];
|
|
1127
|
+
for (var key in source) {
|
|
1128
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1129
|
+
target[key] = source[key];
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
return target;
|
|
1134
|
+
};
|
|
1135
|
+
return _extends.apply(this, arguments);
|
|
1136
|
+
}
|
|
1137
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1138
|
+
if (source == null)
|
|
1139
|
+
return {};
|
|
1140
|
+
var target = {};
|
|
1141
|
+
var sourceKeys = Object.keys(source);
|
|
1142
|
+
var key, i;
|
|
1143
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1144
|
+
key = sourceKeys[i];
|
|
1145
|
+
if (excluded.indexOf(key) >= 0)
|
|
1146
|
+
continue;
|
|
1147
|
+
target[key] = source[key];
|
|
1148
|
+
}
|
|
1149
|
+
return target;
|
|
1150
|
+
}
|
|
1151
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1152
|
+
if (!o)
|
|
1153
|
+
return;
|
|
1154
|
+
if (typeof o === "string")
|
|
1155
|
+
return _arrayLikeToArray(o, minLen);
|
|
1156
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1157
|
+
if (n === "Object" && o.constructor)
|
|
1158
|
+
n = o.constructor.name;
|
|
1159
|
+
if (n === "Map" || n === "Set")
|
|
1160
|
+
return Array.from(o);
|
|
1161
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1162
|
+
return _arrayLikeToArray(o, minLen);
|
|
1163
|
+
}
|
|
1164
|
+
function _arrayLikeToArray(arr, len) {
|
|
1165
|
+
if (len == null || len > arr.length)
|
|
1166
|
+
len = arr.length;
|
|
1167
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
1168
|
+
arr2[i] = arr[i];
|
|
1169
|
+
return arr2;
|
|
1170
|
+
}
|
|
1171
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
1172
|
+
var it;
|
|
1173
|
+
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
1174
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
1175
|
+
if (it)
|
|
1176
|
+
o = it;
|
|
1177
|
+
var i = 0;
|
|
1178
|
+
return function() {
|
|
1179
|
+
if (i >= o.length)
|
|
1180
|
+
return {
|
|
1181
|
+
done: true
|
|
1182
|
+
};
|
|
1183
|
+
return {
|
|
1184
|
+
done: false,
|
|
1185
|
+
value: o[i++]
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1190
|
+
}
|
|
1191
|
+
it = o[Symbol.iterator]();
|
|
1192
|
+
return it.next.bind(it);
|
|
1193
|
+
}
|
|
1194
|
+
function match(value, lookup) {
|
|
1195
|
+
if (value in lookup) {
|
|
1196
|
+
var returnValue = lookup[value];
|
|
1197
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1198
|
+
args[_key - 2] = arguments[_key];
|
|
1199
|
+
}
|
|
1200
|
+
return typeof returnValue === "function" ? returnValue.apply(void 0, args) : returnValue;
|
|
1201
|
+
}
|
|
1202
|
+
var error = new Error('Tried to handle "' + value + '" but there is no handler defined. Only defined handlers are: ' + Object.keys(lookup).map(function(key) {
|
|
1203
|
+
return '"' + key + '"';
|
|
1204
|
+
}).join(", ") + ".");
|
|
1205
|
+
if (Error.captureStackTrace)
|
|
1206
|
+
Error.captureStackTrace(error, match);
|
|
1207
|
+
throw error;
|
|
1208
|
+
}
|
|
1209
|
+
var Features;
|
|
1210
|
+
(function(Features2) {
|
|
1211
|
+
Features2[Features2["None"] = 0] = "None";
|
|
1212
|
+
Features2[Features2["RenderStrategy"] = 1] = "RenderStrategy";
|
|
1213
|
+
Features2[Features2["Static"] = 2] = "Static";
|
|
1214
|
+
})(Features || (Features = {}));
|
|
1215
|
+
var RenderStrategy;
|
|
1216
|
+
(function(RenderStrategy2) {
|
|
1217
|
+
RenderStrategy2[RenderStrategy2["Unmount"] = 0] = "Unmount";
|
|
1218
|
+
RenderStrategy2[RenderStrategy2["Hidden"] = 1] = "Hidden";
|
|
1219
|
+
})(RenderStrategy || (RenderStrategy = {}));
|
|
1220
|
+
function render(_ref) {
|
|
1221
|
+
var _ref$visible = _ref.visible, visible = _ref$visible === void 0 ? true : _ref$visible, _ref$features = _ref.features, features = _ref$features === void 0 ? Features.None : _ref$features, main2 = _objectWithoutPropertiesLoose(_ref, ["visible", "features"]);
|
|
1222
|
+
if (visible)
|
|
1223
|
+
return _render(main2);
|
|
1224
|
+
if (features & Features.Static) {
|
|
1225
|
+
if (main2.props["static"])
|
|
1226
|
+
return _render(main2);
|
|
1227
|
+
}
|
|
1228
|
+
if (features & Features.RenderStrategy) {
|
|
1229
|
+
var _main$props$unmount, _match;
|
|
1230
|
+
var strategy = ((_main$props$unmount = main2.props.unmount) != null ? _main$props$unmount : true) ? RenderStrategy.Unmount : RenderStrategy.Hidden;
|
|
1231
|
+
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function() {
|
|
1232
|
+
return null;
|
|
1233
|
+
}, _match[RenderStrategy.Hidden] = function() {
|
|
1234
|
+
return _render(_extends({}, main2, {
|
|
1235
|
+
props: _extends({}, main2.props, {
|
|
1236
|
+
hidden: true,
|
|
1237
|
+
style: {
|
|
1238
|
+
display: "none"
|
|
1239
|
+
}
|
|
1240
|
+
})
|
|
1241
|
+
}));
|
|
1242
|
+
}, _match));
|
|
1243
|
+
}
|
|
1244
|
+
return _render(main2);
|
|
1245
|
+
}
|
|
1246
|
+
function _render(_ref2) {
|
|
1247
|
+
var props = _ref2.props, attrs = _ref2.attrs, slots = _ref2.slots, slot = _ref2.slot, name = _ref2.name;
|
|
1248
|
+
var _omit = omit(props, ["unmount", "static"]), as = _omit.as, passThroughProps = _objectWithoutPropertiesLoose(_omit, ["as"]);
|
|
1249
|
+
var children = slots["default"] == null ? void 0 : slots["default"](slot);
|
|
1250
|
+
if (as === "template") {
|
|
1251
|
+
if (Object.keys(passThroughProps).length > 0 || Object.keys(attrs).length > 0) {
|
|
1252
|
+
var _ref3 = children != null ? children : [], firstChild = _ref3[0], other = _ref3.slice(1);
|
|
1253
|
+
if (!isValidElement(firstChild) || other.length > 0) {
|
|
1254
|
+
throw new Error(['Passing props on "template"!', "", "The current component <" + name + ' /> is rendering a "template".', "However we need to passthrough the following props:", Object.keys(passThroughProps).concat(Object.keys(attrs)).map(function(line) {
|
|
1255
|
+
return " - " + line;
|
|
1256
|
+
}).join("\n"), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map(function(line) {
|
|
1257
|
+
return " - " + line;
|
|
1258
|
+
}).join("\n")].join("\n"));
|
|
1259
|
+
}
|
|
1260
|
+
return cloneVNode(firstChild, passThroughProps);
|
|
1261
|
+
}
|
|
1262
|
+
if (Array.isArray(children) && children.length === 1) {
|
|
1263
|
+
return children[0];
|
|
1264
|
+
}
|
|
1265
|
+
return children;
|
|
1266
|
+
}
|
|
1267
|
+
return h(as, passThroughProps, children);
|
|
1268
|
+
}
|
|
1269
|
+
function omit(object, keysToOmit) {
|
|
1270
|
+
if (keysToOmit === void 0) {
|
|
1271
|
+
keysToOmit = [];
|
|
1272
|
+
}
|
|
1273
|
+
var clone = Object.assign({}, object);
|
|
1274
|
+
for (var _iterator = _createForOfIteratorHelperLoose(keysToOmit), _step; !(_step = _iterator()).done; ) {
|
|
1275
|
+
var key = _step.value;
|
|
1276
|
+
if (key in clone)
|
|
1277
|
+
delete clone[key];
|
|
1278
|
+
}
|
|
1279
|
+
return clone;
|
|
1280
|
+
}
|
|
1281
|
+
function isValidElement(input) {
|
|
1282
|
+
if (input == null)
|
|
1283
|
+
return false;
|
|
1284
|
+
if (typeof input.type === "string")
|
|
1285
|
+
return true;
|
|
1286
|
+
if (typeof input.type === "object")
|
|
1287
|
+
return true;
|
|
1288
|
+
if (typeof input.type === "function")
|
|
1289
|
+
return true;
|
|
1290
|
+
return false;
|
|
1291
|
+
}
|
|
1292
|
+
var Keys;
|
|
1293
|
+
(function(Keys2) {
|
|
1294
|
+
Keys2["Space"] = " ";
|
|
1295
|
+
Keys2["Enter"] = "Enter";
|
|
1296
|
+
Keys2["Escape"] = "Escape";
|
|
1297
|
+
Keys2["Backspace"] = "Backspace";
|
|
1298
|
+
Keys2["ArrowLeft"] = "ArrowLeft";
|
|
1299
|
+
Keys2["ArrowUp"] = "ArrowUp";
|
|
1300
|
+
Keys2["ArrowRight"] = "ArrowRight";
|
|
1301
|
+
Keys2["ArrowDown"] = "ArrowDown";
|
|
1302
|
+
Keys2["Home"] = "Home";
|
|
1303
|
+
Keys2["End"] = "End";
|
|
1304
|
+
Keys2["PageUp"] = "PageUp";
|
|
1305
|
+
Keys2["PageDown"] = "PageDown";
|
|
1306
|
+
Keys2["Tab"] = "Tab";
|
|
1307
|
+
})(Keys || (Keys = {}));
|
|
1308
|
+
var id = 0;
|
|
1309
|
+
function generateId() {
|
|
1310
|
+
return ++id;
|
|
1311
|
+
}
|
|
1312
|
+
function useId() {
|
|
1313
|
+
return generateId();
|
|
1314
|
+
}
|
|
1315
|
+
function useWindowEvent(type, listener, options) {
|
|
1316
|
+
if (typeof window === "undefined")
|
|
1317
|
+
return;
|
|
1318
|
+
watchEffect(function(onInvalidate) {
|
|
1319
|
+
window.addEventListener(type, listener, options);
|
|
1320
|
+
onInvalidate(function() {
|
|
1321
|
+
window.removeEventListener(type, listener, options);
|
|
1322
|
+
});
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
function dom(ref2) {
|
|
1326
|
+
var _ref$value$$el;
|
|
1327
|
+
if (ref2 == null)
|
|
1328
|
+
return null;
|
|
1329
|
+
if (ref2.value == null)
|
|
1330
|
+
return null;
|
|
1331
|
+
return (_ref$value$$el = ref2.value.$el) != null ? _ref$value$$el : ref2.value;
|
|
1332
|
+
}
|
|
1333
|
+
var Context = /* @__PURE__ */ Symbol("Context");
|
|
1334
|
+
var State;
|
|
1335
|
+
(function(State2) {
|
|
1336
|
+
State2[State2["Open"] = 0] = "Open";
|
|
1337
|
+
State2[State2["Closed"] = 1] = "Closed";
|
|
1338
|
+
})(State || (State = {}));
|
|
1339
|
+
function useOpenClosed() {
|
|
1340
|
+
return inject(Context, null);
|
|
1341
|
+
}
|
|
1342
|
+
function useOpenClosedProvider(value) {
|
|
1343
|
+
provide(Context, value);
|
|
1344
|
+
}
|
|
1345
|
+
function resolveType(type, as) {
|
|
1346
|
+
if (type)
|
|
1347
|
+
return type;
|
|
1348
|
+
var tag = as != null ? as : "button";
|
|
1349
|
+
if (typeof tag === "string" && tag.toLowerCase() === "button")
|
|
1350
|
+
return "button";
|
|
1351
|
+
return void 0;
|
|
1352
|
+
}
|
|
1353
|
+
function useResolveButtonType(data, refElement) {
|
|
1354
|
+
var type = ref(resolveType(data.value.type, data.value.as));
|
|
1355
|
+
onMounted(function() {
|
|
1356
|
+
type.value = resolveType(data.value.type, data.value.as);
|
|
1357
|
+
});
|
|
1358
|
+
watchEffect(function() {
|
|
1359
|
+
var _dom;
|
|
1360
|
+
if (type.value)
|
|
1361
|
+
return;
|
|
1362
|
+
if (!dom(refElement))
|
|
1363
|
+
return;
|
|
1364
|
+
if (dom(refElement) instanceof HTMLButtonElement && !((_dom = dom(refElement)) == null ? void 0 : _dom.hasAttribute("type"))) {
|
|
1365
|
+
type.value = "button";
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
return type;
|
|
1369
|
+
}
|
|
1370
|
+
function assertNever(x) {
|
|
1371
|
+
throw new Error("Unexpected object: " + x);
|
|
1372
|
+
}
|
|
1373
|
+
var Focus;
|
|
1374
|
+
(function(Focus2) {
|
|
1375
|
+
Focus2[Focus2["First"] = 0] = "First";
|
|
1376
|
+
Focus2[Focus2["Previous"] = 1] = "Previous";
|
|
1377
|
+
Focus2[Focus2["Next"] = 2] = "Next";
|
|
1378
|
+
Focus2[Focus2["Last"] = 3] = "Last";
|
|
1379
|
+
Focus2[Focus2["Specific"] = 4] = "Specific";
|
|
1380
|
+
Focus2[Focus2["Nothing"] = 5] = "Nothing";
|
|
1381
|
+
})(Focus || (Focus = {}));
|
|
1382
|
+
function calculateActiveIndex(action, resolvers) {
|
|
1383
|
+
var items = resolvers.resolveItems();
|
|
1384
|
+
if (items.length <= 0)
|
|
1385
|
+
return null;
|
|
1386
|
+
var currentActiveIndex = resolvers.resolveActiveIndex();
|
|
1387
|
+
var activeIndex = currentActiveIndex != null ? currentActiveIndex : -1;
|
|
1388
|
+
var nextActiveIndex = function() {
|
|
1389
|
+
switch (action.focus) {
|
|
1390
|
+
case Focus.First:
|
|
1391
|
+
return items.findIndex(function(item) {
|
|
1392
|
+
return !resolvers.resolveDisabled(item);
|
|
1393
|
+
});
|
|
1394
|
+
case Focus.Previous: {
|
|
1395
|
+
var idx = items.slice().reverse().findIndex(function(item, idx2, all) {
|
|
1396
|
+
if (activeIndex !== -1 && all.length - idx2 - 1 >= activeIndex)
|
|
1397
|
+
return false;
|
|
1398
|
+
return !resolvers.resolveDisabled(item);
|
|
1399
|
+
});
|
|
1400
|
+
if (idx === -1)
|
|
1401
|
+
return idx;
|
|
1402
|
+
return items.length - 1 - idx;
|
|
1403
|
+
}
|
|
1404
|
+
case Focus.Next:
|
|
1405
|
+
return items.findIndex(function(item, idx2) {
|
|
1406
|
+
if (idx2 <= activeIndex)
|
|
1407
|
+
return false;
|
|
1408
|
+
return !resolvers.resolveDisabled(item);
|
|
1409
|
+
});
|
|
1410
|
+
case Focus.Last: {
|
|
1411
|
+
var _idx = items.slice().reverse().findIndex(function(item) {
|
|
1412
|
+
return !resolvers.resolveDisabled(item);
|
|
1413
|
+
});
|
|
1414
|
+
if (_idx === -1)
|
|
1415
|
+
return _idx;
|
|
1416
|
+
return items.length - 1 - _idx;
|
|
1417
|
+
}
|
|
1418
|
+
case Focus.Specific:
|
|
1419
|
+
return items.findIndex(function(item) {
|
|
1420
|
+
return resolvers.resolveId(item) === action.id;
|
|
1421
|
+
});
|
|
1422
|
+
case Focus.Nothing:
|
|
1423
|
+
return null;
|
|
1424
|
+
default:
|
|
1425
|
+
assertNever(action);
|
|
1426
|
+
}
|
|
1427
|
+
}();
|
|
1428
|
+
return nextActiveIndex === -1 ? currentActiveIndex : nextActiveIndex;
|
|
1429
|
+
}
|
|
1430
|
+
var ListboxStates;
|
|
1431
|
+
(function(ListboxStates2) {
|
|
1432
|
+
ListboxStates2[ListboxStates2["Open"] = 0] = "Open";
|
|
1433
|
+
ListboxStates2[ListboxStates2["Closed"] = 1] = "Closed";
|
|
1434
|
+
})(ListboxStates || (ListboxStates = {}));
|
|
1435
|
+
function nextFrame$1(cb) {
|
|
1436
|
+
requestAnimationFrame(function() {
|
|
1437
|
+
return requestAnimationFrame(cb);
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
var ListboxContext = /* @__PURE__ */ Symbol("ListboxContext");
|
|
1441
|
+
function useListboxContext(component) {
|
|
1442
|
+
var context = inject(ListboxContext, null);
|
|
1443
|
+
if (context === null) {
|
|
1444
|
+
var err = new Error("<" + component + " /> is missing a parent <Listbox /> component.");
|
|
1445
|
+
if (Error.captureStackTrace)
|
|
1446
|
+
Error.captureStackTrace(err, useListboxContext);
|
|
1447
|
+
throw err;
|
|
1448
|
+
}
|
|
1449
|
+
return context;
|
|
1450
|
+
}
|
|
1451
|
+
var Listbox = /* @__PURE__ */ defineComponent({
|
|
1452
|
+
name: "Listbox",
|
|
1453
|
+
emits: {
|
|
1454
|
+
"update:modelValue": function updateModelValue(_value) {
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
},
|
|
1458
|
+
props: {
|
|
1459
|
+
as: {
|
|
1460
|
+
type: [Object, String],
|
|
1461
|
+
"default": "template"
|
|
1462
|
+
},
|
|
1463
|
+
disabled: {
|
|
1464
|
+
type: [Boolean],
|
|
1465
|
+
"default": false
|
|
1466
|
+
},
|
|
1467
|
+
horizontal: {
|
|
1468
|
+
type: [Boolean],
|
|
1469
|
+
"default": false
|
|
1470
|
+
},
|
|
1471
|
+
modelValue: {
|
|
1472
|
+
type: [Object, String, Number, Boolean]
|
|
1473
|
+
}
|
|
1474
|
+
},
|
|
1475
|
+
setup: function setup(props, _ref) {
|
|
1476
|
+
var slots = _ref.slots, attrs = _ref.attrs, emit = _ref.emit;
|
|
1477
|
+
var listboxState = ref(ListboxStates.Closed);
|
|
1478
|
+
var labelRef = ref(null);
|
|
1479
|
+
var buttonRef = ref(null);
|
|
1480
|
+
var optionsRef = ref(null);
|
|
1481
|
+
var options = ref([]);
|
|
1482
|
+
var searchQuery = ref("");
|
|
1483
|
+
var activeOptionIndex = ref(null);
|
|
1484
|
+
var value = computed$2(function() {
|
|
1485
|
+
return props.modelValue;
|
|
1486
|
+
});
|
|
1487
|
+
var api = {
|
|
1488
|
+
listboxState,
|
|
1489
|
+
value,
|
|
1490
|
+
orientation: computed$2(function() {
|
|
1491
|
+
return props.horizontal ? "horizontal" : "vertical";
|
|
1492
|
+
}),
|
|
1493
|
+
labelRef,
|
|
1494
|
+
buttonRef,
|
|
1495
|
+
optionsRef,
|
|
1496
|
+
disabled: computed$2(function() {
|
|
1497
|
+
return props.disabled;
|
|
1498
|
+
}),
|
|
1499
|
+
options,
|
|
1500
|
+
searchQuery,
|
|
1501
|
+
activeOptionIndex,
|
|
1502
|
+
closeListbox: function closeListbox() {
|
|
1503
|
+
if (props.disabled)
|
|
1504
|
+
return;
|
|
1505
|
+
if (listboxState.value === ListboxStates.Closed)
|
|
1506
|
+
return;
|
|
1507
|
+
listboxState.value = ListboxStates.Closed;
|
|
1508
|
+
activeOptionIndex.value = null;
|
|
1509
|
+
},
|
|
1510
|
+
openListbox: function openListbox() {
|
|
1511
|
+
if (props.disabled)
|
|
1512
|
+
return;
|
|
1513
|
+
if (listboxState.value === ListboxStates.Open)
|
|
1514
|
+
return;
|
|
1515
|
+
listboxState.value = ListboxStates.Open;
|
|
1516
|
+
},
|
|
1517
|
+
goToOption: function goToOption(focus, id2) {
|
|
1518
|
+
if (props.disabled)
|
|
1519
|
+
return;
|
|
1520
|
+
if (listboxState.value === ListboxStates.Closed)
|
|
1521
|
+
return;
|
|
1522
|
+
var nextActiveOptionIndex = calculateActiveIndex(focus === Focus.Specific ? {
|
|
1523
|
+
focus: Focus.Specific,
|
|
1524
|
+
id: id2
|
|
1525
|
+
} : {
|
|
1526
|
+
focus
|
|
1527
|
+
}, {
|
|
1528
|
+
resolveItems: function resolveItems() {
|
|
1529
|
+
return options.value;
|
|
1530
|
+
},
|
|
1531
|
+
resolveActiveIndex: function resolveActiveIndex() {
|
|
1532
|
+
return activeOptionIndex.value;
|
|
1533
|
+
},
|
|
1534
|
+
resolveId: function resolveId(option) {
|
|
1535
|
+
return option.id;
|
|
1536
|
+
},
|
|
1537
|
+
resolveDisabled: function resolveDisabled(option) {
|
|
1538
|
+
return option.dataRef.disabled;
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
if (searchQuery.value === "" && activeOptionIndex.value === nextActiveOptionIndex)
|
|
1542
|
+
return;
|
|
1543
|
+
searchQuery.value = "";
|
|
1544
|
+
activeOptionIndex.value = nextActiveOptionIndex;
|
|
1545
|
+
},
|
|
1546
|
+
search: function search(value2) {
|
|
1547
|
+
if (props.disabled)
|
|
1548
|
+
return;
|
|
1549
|
+
if (listboxState.value === ListboxStates.Closed)
|
|
1550
|
+
return;
|
|
1551
|
+
searchQuery.value += value2.toLowerCase();
|
|
1552
|
+
var match2 = options.value.findIndex(function(option) {
|
|
1553
|
+
return !option.dataRef.disabled && option.dataRef.textValue.startsWith(searchQuery.value);
|
|
1554
|
+
});
|
|
1555
|
+
if (match2 === -1 || match2 === activeOptionIndex.value)
|
|
1556
|
+
return;
|
|
1557
|
+
activeOptionIndex.value = match2;
|
|
1558
|
+
},
|
|
1559
|
+
clearSearch: function clearSearch() {
|
|
1560
|
+
if (props.disabled)
|
|
1561
|
+
return;
|
|
1562
|
+
if (listboxState.value === ListboxStates.Closed)
|
|
1563
|
+
return;
|
|
1564
|
+
if (searchQuery.value === "")
|
|
1565
|
+
return;
|
|
1566
|
+
searchQuery.value = "";
|
|
1567
|
+
},
|
|
1568
|
+
registerOption: function registerOption(id2, dataRef) {
|
|
1569
|
+
options.value.push({
|
|
1570
|
+
id: id2,
|
|
1571
|
+
dataRef
|
|
1572
|
+
});
|
|
1573
|
+
},
|
|
1574
|
+
unregisterOption: function unregisterOption(id2) {
|
|
1575
|
+
var nextOptions = options.value.slice();
|
|
1576
|
+
var currentActiveOption = activeOptionIndex.value !== null ? nextOptions[activeOptionIndex.value] : null;
|
|
1577
|
+
var idx = nextOptions.findIndex(function(a) {
|
|
1578
|
+
return a.id === id2;
|
|
1579
|
+
});
|
|
1580
|
+
if (idx !== -1)
|
|
1581
|
+
nextOptions.splice(idx, 1);
|
|
1582
|
+
options.value = nextOptions;
|
|
1583
|
+
activeOptionIndex.value = function() {
|
|
1584
|
+
if (idx === activeOptionIndex.value)
|
|
1585
|
+
return null;
|
|
1586
|
+
if (currentActiveOption === null)
|
|
1587
|
+
return null;
|
|
1588
|
+
return nextOptions.indexOf(currentActiveOption);
|
|
1589
|
+
}();
|
|
1590
|
+
},
|
|
1591
|
+
select: function select(value2) {
|
|
1592
|
+
if (props.disabled)
|
|
1593
|
+
return;
|
|
1594
|
+
emit("update:modelValue", value2);
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
useWindowEvent("mousedown", function(event) {
|
|
1598
|
+
var _dom, _dom2, _dom3;
|
|
1599
|
+
var target = event.target;
|
|
1600
|
+
var active = document.activeElement;
|
|
1601
|
+
if (listboxState.value !== ListboxStates.Open)
|
|
1602
|
+
return;
|
|
1603
|
+
if ((_dom = dom(buttonRef)) == null ? void 0 : _dom.contains(target))
|
|
1604
|
+
return;
|
|
1605
|
+
if (!((_dom2 = dom(optionsRef)) == null ? void 0 : _dom2.contains(target)))
|
|
1606
|
+
api.closeListbox();
|
|
1607
|
+
if (active !== document.body && (active == null ? void 0 : active.contains(target)))
|
|
1608
|
+
return;
|
|
1609
|
+
if (!event.defaultPrevented)
|
|
1610
|
+
(_dom3 = dom(buttonRef)) == null ? void 0 : _dom3.focus({
|
|
1611
|
+
preventScroll: true
|
|
1612
|
+
});
|
|
1613
|
+
});
|
|
1614
|
+
provide(ListboxContext, api);
|
|
1615
|
+
useOpenClosedProvider(computed$2(function() {
|
|
1616
|
+
var _match;
|
|
1617
|
+
return match(listboxState.value, (_match = {}, _match[ListboxStates.Open] = State.Open, _match[ListboxStates.Closed] = State.Closed, _match));
|
|
1618
|
+
}));
|
|
1619
|
+
return function() {
|
|
1620
|
+
var slot = {
|
|
1621
|
+
open: listboxState.value === ListboxStates.Open,
|
|
1622
|
+
disabled: props.disabled
|
|
1623
|
+
};
|
|
1624
|
+
return render({
|
|
1625
|
+
props: omit(props, ["modelValue", "onUpdate:modelValue", "disabled", "horizontal"]),
|
|
1626
|
+
slot,
|
|
1627
|
+
slots,
|
|
1628
|
+
attrs,
|
|
1629
|
+
name: "Listbox"
|
|
1630
|
+
});
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
var ListboxButton = /* @__PURE__ */ defineComponent({
|
|
1635
|
+
name: "ListboxButton",
|
|
1636
|
+
props: {
|
|
1637
|
+
as: {
|
|
1638
|
+
type: [Object, String],
|
|
1639
|
+
"default": "button"
|
|
1640
|
+
}
|
|
1641
|
+
},
|
|
1642
|
+
render: function render$1() {
|
|
1643
|
+
var _dom5, _dom6;
|
|
1644
|
+
var api = useListboxContext("ListboxButton");
|
|
1645
|
+
var slot = {
|
|
1646
|
+
open: api.listboxState.value === ListboxStates.Open,
|
|
1647
|
+
disabled: api.disabled.value
|
|
1648
|
+
};
|
|
1649
|
+
var propsWeControl = {
|
|
1650
|
+
ref: "el",
|
|
1651
|
+
id: this.id,
|
|
1652
|
+
type: this.type,
|
|
1653
|
+
"aria-haspopup": true,
|
|
1654
|
+
"aria-controls": (_dom5 = dom(api.optionsRef)) == null ? void 0 : _dom5.id,
|
|
1655
|
+
"aria-expanded": api.disabled.value ? void 0 : api.listboxState.value === ListboxStates.Open,
|
|
1656
|
+
"aria-labelledby": api.labelRef.value ? [(_dom6 = dom(api.labelRef)) == null ? void 0 : _dom6.id, this.id].join(" ") : void 0,
|
|
1657
|
+
disabled: api.disabled.value === true ? true : void 0,
|
|
1658
|
+
onKeydown: this.handleKeyDown,
|
|
1659
|
+
onKeyup: this.handleKeyUp,
|
|
1660
|
+
onClick: this.handleClick
|
|
1661
|
+
};
|
|
1662
|
+
return render({
|
|
1663
|
+
props: _extends({}, this.$props, propsWeControl),
|
|
1664
|
+
slot,
|
|
1665
|
+
attrs: this.$attrs,
|
|
1666
|
+
slots: this.$slots,
|
|
1667
|
+
name: "ListboxButton"
|
|
1668
|
+
});
|
|
1669
|
+
},
|
|
1670
|
+
setup: function setup2(props, _ref2) {
|
|
1671
|
+
var attrs = _ref2.attrs;
|
|
1672
|
+
var api = useListboxContext("ListboxButton");
|
|
1673
|
+
var id2 = "headlessui-listbox-button-" + useId();
|
|
1674
|
+
function handleKeyDown(event) {
|
|
1675
|
+
switch (event.key) {
|
|
1676
|
+
case Keys.Space:
|
|
1677
|
+
case Keys.Enter:
|
|
1678
|
+
case Keys.ArrowDown:
|
|
1679
|
+
event.preventDefault();
|
|
1680
|
+
api.openListbox();
|
|
1681
|
+
nextTick$1(function() {
|
|
1682
|
+
var _dom7;
|
|
1683
|
+
(_dom7 = dom(api.optionsRef)) == null ? void 0 : _dom7.focus({
|
|
1684
|
+
preventScroll: true
|
|
1685
|
+
});
|
|
1686
|
+
if (!api.value.value)
|
|
1687
|
+
api.goToOption(Focus.First);
|
|
1688
|
+
});
|
|
1689
|
+
break;
|
|
1690
|
+
case Keys.ArrowUp:
|
|
1691
|
+
event.preventDefault();
|
|
1692
|
+
api.openListbox();
|
|
1693
|
+
nextTick$1(function() {
|
|
1694
|
+
var _dom8;
|
|
1695
|
+
(_dom8 = dom(api.optionsRef)) == null ? void 0 : _dom8.focus({
|
|
1696
|
+
preventScroll: true
|
|
1697
|
+
});
|
|
1698
|
+
if (!api.value.value)
|
|
1699
|
+
api.goToOption(Focus.Last);
|
|
1700
|
+
});
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
function handleKeyUp(event) {
|
|
1705
|
+
switch (event.key) {
|
|
1706
|
+
case Keys.Space:
|
|
1707
|
+
event.preventDefault();
|
|
1708
|
+
break;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
function handleClick(event) {
|
|
1712
|
+
if (api.disabled.value)
|
|
1713
|
+
return;
|
|
1714
|
+
if (api.listboxState.value === ListboxStates.Open) {
|
|
1715
|
+
api.closeListbox();
|
|
1716
|
+
nextTick$1(function() {
|
|
1717
|
+
var _dom9;
|
|
1718
|
+
return (_dom9 = dom(api.buttonRef)) == null ? void 0 : _dom9.focus({
|
|
1719
|
+
preventScroll: true
|
|
1720
|
+
});
|
|
1721
|
+
});
|
|
1722
|
+
} else {
|
|
1723
|
+
event.preventDefault();
|
|
1724
|
+
api.openListbox();
|
|
1725
|
+
nextFrame$1(function() {
|
|
1726
|
+
var _dom10;
|
|
1727
|
+
return (_dom10 = dom(api.optionsRef)) == null ? void 0 : _dom10.focus({
|
|
1728
|
+
preventScroll: true
|
|
1729
|
+
});
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
return {
|
|
1734
|
+
id: id2,
|
|
1735
|
+
el: api.buttonRef,
|
|
1736
|
+
type: useResolveButtonType(computed$2(function() {
|
|
1737
|
+
return {
|
|
1738
|
+
as: props.as,
|
|
1739
|
+
type: attrs.type
|
|
1740
|
+
};
|
|
1741
|
+
}), api.buttonRef),
|
|
1742
|
+
handleKeyDown,
|
|
1743
|
+
handleKeyUp,
|
|
1744
|
+
handleClick
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
var ListboxOptions = /* @__PURE__ */ defineComponent({
|
|
1749
|
+
name: "ListboxOptions",
|
|
1750
|
+
props: {
|
|
1751
|
+
as: {
|
|
1752
|
+
type: [Object, String],
|
|
1753
|
+
"default": "ul"
|
|
1754
|
+
},
|
|
1755
|
+
"static": {
|
|
1756
|
+
type: Boolean,
|
|
1757
|
+
"default": false
|
|
1758
|
+
},
|
|
1759
|
+
unmount: {
|
|
1760
|
+
type: Boolean,
|
|
1761
|
+
"default": true
|
|
1762
|
+
}
|
|
1763
|
+
},
|
|
1764
|
+
render: function render$12() {
|
|
1765
|
+
var _api$options$value$ap, _dom$id, _dom11, _dom12;
|
|
1766
|
+
var api = useListboxContext("ListboxOptions");
|
|
1767
|
+
var slot = {
|
|
1768
|
+
open: api.listboxState.value === ListboxStates.Open
|
|
1769
|
+
};
|
|
1770
|
+
var propsWeControl = {
|
|
1771
|
+
"aria-activedescendant": api.activeOptionIndex.value === null ? void 0 : (_api$options$value$ap = api.options.value[api.activeOptionIndex.value]) == null ? void 0 : _api$options$value$ap.id,
|
|
1772
|
+
"aria-labelledby": (_dom$id = (_dom11 = dom(api.labelRef)) == null ? void 0 : _dom11.id) != null ? _dom$id : (_dom12 = dom(api.buttonRef)) == null ? void 0 : _dom12.id,
|
|
1773
|
+
"aria-orientation": api.orientation.value,
|
|
1774
|
+
id: this.id,
|
|
1775
|
+
onKeydown: this.handleKeyDown,
|
|
1776
|
+
role: "listbox",
|
|
1777
|
+
tabIndex: 0,
|
|
1778
|
+
ref: "el"
|
|
1779
|
+
};
|
|
1780
|
+
var passThroughProps = this.$props;
|
|
1781
|
+
return render({
|
|
1782
|
+
props: _extends({}, passThroughProps, propsWeControl),
|
|
1783
|
+
slot,
|
|
1784
|
+
attrs: this.$attrs,
|
|
1785
|
+
slots: this.$slots,
|
|
1786
|
+
features: Features.RenderStrategy | Features.Static,
|
|
1787
|
+
visible: this.visible,
|
|
1788
|
+
name: "ListboxOptions"
|
|
1789
|
+
});
|
|
1790
|
+
},
|
|
1791
|
+
setup: function setup3() {
|
|
1792
|
+
var api = useListboxContext("ListboxOptions");
|
|
1793
|
+
var id2 = "headlessui-listbox-options-" + useId();
|
|
1794
|
+
var searchDebounce = ref(null);
|
|
1795
|
+
function handleKeyDown(event) {
|
|
1796
|
+
if (searchDebounce.value)
|
|
1797
|
+
clearTimeout(searchDebounce.value);
|
|
1798
|
+
switch (event.key) {
|
|
1799
|
+
case Keys.Space:
|
|
1800
|
+
if (api.searchQuery.value !== "") {
|
|
1801
|
+
event.preventDefault();
|
|
1802
|
+
event.stopPropagation();
|
|
1803
|
+
return api.search(event.key);
|
|
1804
|
+
}
|
|
1805
|
+
case Keys.Enter:
|
|
1806
|
+
event.preventDefault();
|
|
1807
|
+
event.stopPropagation();
|
|
1808
|
+
if (api.activeOptionIndex.value !== null) {
|
|
1809
|
+
var dataRef = api.options.value[api.activeOptionIndex.value].dataRef;
|
|
1810
|
+
api.select(dataRef.value);
|
|
1811
|
+
}
|
|
1812
|
+
api.closeListbox();
|
|
1813
|
+
nextTick$1(function() {
|
|
1814
|
+
var _dom13;
|
|
1815
|
+
return (_dom13 = dom(api.buttonRef)) == null ? void 0 : _dom13.focus({
|
|
1816
|
+
preventScroll: true
|
|
1817
|
+
});
|
|
1818
|
+
});
|
|
1819
|
+
break;
|
|
1820
|
+
case match(api.orientation.value, {
|
|
1821
|
+
vertical: Keys.ArrowDown,
|
|
1822
|
+
horizontal: Keys.ArrowRight
|
|
1823
|
+
}):
|
|
1824
|
+
event.preventDefault();
|
|
1825
|
+
event.stopPropagation();
|
|
1826
|
+
return api.goToOption(Focus.Next);
|
|
1827
|
+
case match(api.orientation.value, {
|
|
1828
|
+
vertical: Keys.ArrowUp,
|
|
1829
|
+
horizontal: Keys.ArrowLeft
|
|
1830
|
+
}):
|
|
1831
|
+
event.preventDefault();
|
|
1832
|
+
event.stopPropagation();
|
|
1833
|
+
return api.goToOption(Focus.Previous);
|
|
1834
|
+
case Keys.Home:
|
|
1835
|
+
case Keys.PageUp:
|
|
1836
|
+
event.preventDefault();
|
|
1837
|
+
event.stopPropagation();
|
|
1838
|
+
return api.goToOption(Focus.First);
|
|
1839
|
+
case Keys.End:
|
|
1840
|
+
case Keys.PageDown:
|
|
1841
|
+
event.preventDefault();
|
|
1842
|
+
event.stopPropagation();
|
|
1843
|
+
return api.goToOption(Focus.Last);
|
|
1844
|
+
case Keys.Escape:
|
|
1845
|
+
event.preventDefault();
|
|
1846
|
+
event.stopPropagation();
|
|
1847
|
+
api.closeListbox();
|
|
1848
|
+
nextTick$1(function() {
|
|
1849
|
+
var _dom14;
|
|
1850
|
+
return (_dom14 = dom(api.buttonRef)) == null ? void 0 : _dom14.focus({
|
|
1851
|
+
preventScroll: true
|
|
1852
|
+
});
|
|
1853
|
+
});
|
|
1854
|
+
break;
|
|
1855
|
+
case Keys.Tab:
|
|
1856
|
+
event.preventDefault();
|
|
1857
|
+
event.stopPropagation();
|
|
1858
|
+
break;
|
|
1859
|
+
default:
|
|
1860
|
+
if (event.key.length === 1) {
|
|
1861
|
+
api.search(event.key);
|
|
1862
|
+
searchDebounce.value = setTimeout(function() {
|
|
1863
|
+
return api.clearSearch();
|
|
1864
|
+
}, 350);
|
|
1865
|
+
}
|
|
1866
|
+
break;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
var usesOpenClosedState = useOpenClosed();
|
|
1870
|
+
var visible = computed$2(function() {
|
|
1871
|
+
if (usesOpenClosedState !== null) {
|
|
1872
|
+
return usesOpenClosedState.value === State.Open;
|
|
1873
|
+
}
|
|
1874
|
+
return api.listboxState.value === ListboxStates.Open;
|
|
1875
|
+
});
|
|
1876
|
+
return {
|
|
1877
|
+
id: id2,
|
|
1878
|
+
el: api.optionsRef,
|
|
1879
|
+
handleKeyDown,
|
|
1880
|
+
visible
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
var ListboxOption = /* @__PURE__ */ defineComponent({
|
|
1885
|
+
name: "ListboxOption",
|
|
1886
|
+
props: {
|
|
1887
|
+
as: {
|
|
1888
|
+
type: [Object, String],
|
|
1889
|
+
"default": "li"
|
|
1890
|
+
},
|
|
1891
|
+
value: {
|
|
1892
|
+
type: [Object, String, Number, Boolean]
|
|
1893
|
+
},
|
|
1894
|
+
disabled: {
|
|
1895
|
+
type: Boolean,
|
|
1896
|
+
"default": false
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
setup: function setup4(props, _ref3) {
|
|
1900
|
+
var slots = _ref3.slots, attrs = _ref3.attrs;
|
|
1901
|
+
var api = useListboxContext("ListboxOption");
|
|
1902
|
+
var id2 = "headlessui-listbox-option-" + useId();
|
|
1903
|
+
var active = computed$2(function() {
|
|
1904
|
+
return api.activeOptionIndex.value !== null ? api.options.value[api.activeOptionIndex.value].id === id2 : false;
|
|
1905
|
+
});
|
|
1906
|
+
var selected = computed$2(function() {
|
|
1907
|
+
return toRaw$1(api.value.value) === toRaw$1(props.value);
|
|
1908
|
+
});
|
|
1909
|
+
var dataRef = ref({
|
|
1910
|
+
disabled: props.disabled,
|
|
1911
|
+
value: props.value,
|
|
1912
|
+
textValue: ""
|
|
1913
|
+
});
|
|
1914
|
+
onMounted(function() {
|
|
1915
|
+
var _document$getElementB, _document$getElementB2;
|
|
1916
|
+
var textValue = (_document$getElementB = document.getElementById(id2)) == null ? void 0 : (_document$getElementB2 = _document$getElementB.textContent) == null ? void 0 : _document$getElementB2.toLowerCase().trim();
|
|
1917
|
+
if (textValue !== void 0)
|
|
1918
|
+
dataRef.value.textValue = textValue;
|
|
1919
|
+
});
|
|
1920
|
+
onMounted(function() {
|
|
1921
|
+
return api.registerOption(id2, dataRef);
|
|
1922
|
+
});
|
|
1923
|
+
onUnmounted(function() {
|
|
1924
|
+
return api.unregisterOption(id2);
|
|
1925
|
+
});
|
|
1926
|
+
onMounted(function() {
|
|
1927
|
+
watch([api.listboxState, selected], function() {
|
|
1928
|
+
var _document$getElementB3;
|
|
1929
|
+
if (api.listboxState.value !== ListboxStates.Open)
|
|
1930
|
+
return;
|
|
1931
|
+
if (!selected.value)
|
|
1932
|
+
return;
|
|
1933
|
+
api.goToOption(Focus.Specific, id2);
|
|
1934
|
+
(_document$getElementB3 = document.getElementById(id2)) == null ? void 0 : _document$getElementB3.focus == null ? void 0 : _document$getElementB3.focus();
|
|
1935
|
+
}, {
|
|
1936
|
+
immediate: true
|
|
1937
|
+
});
|
|
1938
|
+
});
|
|
1939
|
+
watchEffect(function() {
|
|
1940
|
+
if (api.listboxState.value !== ListboxStates.Open)
|
|
1941
|
+
return;
|
|
1942
|
+
if (!active.value)
|
|
1943
|
+
return;
|
|
1944
|
+
nextTick$1(function() {
|
|
1945
|
+
var _document$getElementB4;
|
|
1946
|
+
return (_document$getElementB4 = document.getElementById(id2)) == null ? void 0 : _document$getElementB4.scrollIntoView == null ? void 0 : _document$getElementB4.scrollIntoView({
|
|
1947
|
+
block: "nearest"
|
|
1948
|
+
});
|
|
1949
|
+
});
|
|
1950
|
+
});
|
|
1951
|
+
function handleClick(event) {
|
|
1952
|
+
if (props.disabled)
|
|
1953
|
+
return event.preventDefault();
|
|
1954
|
+
api.select(props.value);
|
|
1955
|
+
api.closeListbox();
|
|
1956
|
+
nextTick$1(function() {
|
|
1957
|
+
var _dom15;
|
|
1958
|
+
return (_dom15 = dom(api.buttonRef)) == null ? void 0 : _dom15.focus({
|
|
1959
|
+
preventScroll: true
|
|
1960
|
+
});
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
function handleFocus() {
|
|
1964
|
+
if (props.disabled)
|
|
1965
|
+
return api.goToOption(Focus.Nothing);
|
|
1966
|
+
api.goToOption(Focus.Specific, id2);
|
|
1967
|
+
}
|
|
1968
|
+
function handleMove() {
|
|
1969
|
+
if (props.disabled)
|
|
1970
|
+
return;
|
|
1971
|
+
if (active.value)
|
|
1972
|
+
return;
|
|
1973
|
+
api.goToOption(Focus.Specific, id2);
|
|
1974
|
+
}
|
|
1975
|
+
function handleLeave() {
|
|
1976
|
+
if (props.disabled)
|
|
1977
|
+
return;
|
|
1978
|
+
if (!active.value)
|
|
1979
|
+
return;
|
|
1980
|
+
api.goToOption(Focus.Nothing);
|
|
1981
|
+
}
|
|
1982
|
+
return function() {
|
|
1983
|
+
var disabled = props.disabled;
|
|
1984
|
+
var slot = {
|
|
1985
|
+
active: active.value,
|
|
1986
|
+
selected: selected.value,
|
|
1987
|
+
disabled
|
|
1988
|
+
};
|
|
1989
|
+
var propsWeControl = {
|
|
1990
|
+
id: id2,
|
|
1991
|
+
role: "option",
|
|
1992
|
+
tabIndex: disabled === true ? void 0 : -1,
|
|
1993
|
+
"aria-disabled": disabled === true ? true : void 0,
|
|
1994
|
+
"aria-selected": selected.value === true ? selected.value : void 0,
|
|
1995
|
+
disabled: void 0,
|
|
1996
|
+
onClick: handleClick,
|
|
1997
|
+
onFocus: handleFocus,
|
|
1998
|
+
onPointermove: handleMove,
|
|
1999
|
+
onMousemove: handleMove,
|
|
2000
|
+
onPointerleave: handleLeave,
|
|
2001
|
+
onMouseleave: handleLeave
|
|
2002
|
+
};
|
|
2003
|
+
return render({
|
|
2004
|
+
props: _extends({}, props, propsWeControl),
|
|
2005
|
+
slot,
|
|
2006
|
+
attrs,
|
|
2007
|
+
slots,
|
|
2008
|
+
name: "ListboxOption"
|
|
2009
|
+
});
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
});
|
|
2013
|
+
function useTreeWalker(_ref) {
|
|
2014
|
+
var container = _ref.container, accept = _ref.accept, walk = _ref.walk, enabled = _ref.enabled;
|
|
2015
|
+
watchEffect(function() {
|
|
2016
|
+
var root = container.value;
|
|
2017
|
+
if (!root)
|
|
2018
|
+
return;
|
|
2019
|
+
if (enabled !== void 0 && !enabled.value)
|
|
2020
|
+
return;
|
|
2021
|
+
var acceptNode = Object.assign(function(node) {
|
|
2022
|
+
return accept(node);
|
|
2023
|
+
}, {
|
|
2024
|
+
acceptNode: accept
|
|
2025
|
+
});
|
|
2026
|
+
var walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, acceptNode, false);
|
|
2027
|
+
while (walker.nextNode()) {
|
|
2028
|
+
walk(walker.currentNode);
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
var MenuStates;
|
|
2033
|
+
(function(MenuStates2) {
|
|
2034
|
+
MenuStates2[MenuStates2["Open"] = 0] = "Open";
|
|
2035
|
+
MenuStates2[MenuStates2["Closed"] = 1] = "Closed";
|
|
2036
|
+
})(MenuStates || (MenuStates = {}));
|
|
2037
|
+
function nextFrame(cb) {
|
|
2038
|
+
requestAnimationFrame(function() {
|
|
2039
|
+
return requestAnimationFrame(cb);
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
var MenuContext = /* @__PURE__ */ Symbol("MenuContext");
|
|
2043
|
+
function useMenuContext(component) {
|
|
2044
|
+
var context = inject(MenuContext, null);
|
|
2045
|
+
if (context === null) {
|
|
2046
|
+
var err = new Error("<" + component + " /> is missing a parent <Menu /> component.");
|
|
2047
|
+
if (Error.captureStackTrace)
|
|
2048
|
+
Error.captureStackTrace(err, useMenuContext);
|
|
2049
|
+
throw err;
|
|
2050
|
+
}
|
|
2051
|
+
return context;
|
|
2052
|
+
}
|
|
2053
|
+
var Menu = /* @__PURE__ */ defineComponent({
|
|
2054
|
+
name: "Menu",
|
|
2055
|
+
props: {
|
|
2056
|
+
as: {
|
|
2057
|
+
type: [Object, String],
|
|
2058
|
+
"default": "template"
|
|
2059
|
+
}
|
|
2060
|
+
},
|
|
2061
|
+
setup: function setup5(props, _ref) {
|
|
2062
|
+
var slots = _ref.slots, attrs = _ref.attrs;
|
|
2063
|
+
var menuState = ref(MenuStates.Closed);
|
|
2064
|
+
var buttonRef = ref(null);
|
|
2065
|
+
var itemsRef = ref(null);
|
|
2066
|
+
var items = ref([]);
|
|
2067
|
+
var searchQuery = ref("");
|
|
2068
|
+
var activeItemIndex = ref(null);
|
|
2069
|
+
var api = {
|
|
2070
|
+
menuState,
|
|
2071
|
+
buttonRef,
|
|
2072
|
+
itemsRef,
|
|
2073
|
+
items,
|
|
2074
|
+
searchQuery,
|
|
2075
|
+
activeItemIndex,
|
|
2076
|
+
closeMenu: function closeMenu() {
|
|
2077
|
+
menuState.value = MenuStates.Closed;
|
|
2078
|
+
activeItemIndex.value = null;
|
|
2079
|
+
},
|
|
2080
|
+
openMenu: function openMenu() {
|
|
2081
|
+
return menuState.value = MenuStates.Open;
|
|
2082
|
+
},
|
|
2083
|
+
goToItem: function goToItem(focus, id2) {
|
|
2084
|
+
var nextActiveItemIndex = calculateActiveIndex(focus === Focus.Specific ? {
|
|
2085
|
+
focus: Focus.Specific,
|
|
2086
|
+
id: id2
|
|
2087
|
+
} : {
|
|
2088
|
+
focus
|
|
2089
|
+
}, {
|
|
2090
|
+
resolveItems: function resolveItems() {
|
|
2091
|
+
return items.value;
|
|
2092
|
+
},
|
|
2093
|
+
resolveActiveIndex: function resolveActiveIndex() {
|
|
2094
|
+
return activeItemIndex.value;
|
|
2095
|
+
},
|
|
2096
|
+
resolveId: function resolveId(item) {
|
|
2097
|
+
return item.id;
|
|
2098
|
+
},
|
|
2099
|
+
resolveDisabled: function resolveDisabled(item) {
|
|
2100
|
+
return item.dataRef.disabled;
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
if (searchQuery.value === "" && activeItemIndex.value === nextActiveItemIndex)
|
|
2104
|
+
return;
|
|
2105
|
+
searchQuery.value = "";
|
|
2106
|
+
activeItemIndex.value = nextActiveItemIndex;
|
|
2107
|
+
},
|
|
2108
|
+
search: function search(value) {
|
|
2109
|
+
searchQuery.value += value.toLowerCase();
|
|
2110
|
+
var match2 = items.value.findIndex(function(item) {
|
|
2111
|
+
return item.dataRef.textValue.startsWith(searchQuery.value) && !item.dataRef.disabled;
|
|
2112
|
+
});
|
|
2113
|
+
if (match2 === -1 || match2 === activeItemIndex.value)
|
|
2114
|
+
return;
|
|
2115
|
+
activeItemIndex.value = match2;
|
|
2116
|
+
},
|
|
2117
|
+
clearSearch: function clearSearch() {
|
|
2118
|
+
searchQuery.value = "";
|
|
2119
|
+
},
|
|
2120
|
+
registerItem: function registerItem(id2, dataRef) {
|
|
2121
|
+
items.value.push({
|
|
2122
|
+
id: id2,
|
|
2123
|
+
dataRef
|
|
2124
|
+
});
|
|
2125
|
+
},
|
|
2126
|
+
unregisterItem: function unregisterItem(id2) {
|
|
2127
|
+
var nextItems = items.value.slice();
|
|
2128
|
+
var currentActiveItem = activeItemIndex.value !== null ? nextItems[activeItemIndex.value] : null;
|
|
2129
|
+
var idx = nextItems.findIndex(function(a) {
|
|
2130
|
+
return a.id === id2;
|
|
2131
|
+
});
|
|
2132
|
+
if (idx !== -1)
|
|
2133
|
+
nextItems.splice(idx, 1);
|
|
2134
|
+
items.value = nextItems;
|
|
2135
|
+
activeItemIndex.value = function() {
|
|
2136
|
+
if (idx === activeItemIndex.value)
|
|
2137
|
+
return null;
|
|
2138
|
+
if (currentActiveItem === null)
|
|
2139
|
+
return null;
|
|
2140
|
+
return nextItems.indexOf(currentActiveItem);
|
|
2141
|
+
}();
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
useWindowEvent("mousedown", function(event) {
|
|
2145
|
+
var _dom, _dom2, _dom3;
|
|
2146
|
+
var target = event.target;
|
|
2147
|
+
var active = document.activeElement;
|
|
2148
|
+
if (menuState.value !== MenuStates.Open)
|
|
2149
|
+
return;
|
|
2150
|
+
if ((_dom = dom(buttonRef)) == null ? void 0 : _dom.contains(target))
|
|
2151
|
+
return;
|
|
2152
|
+
if (!((_dom2 = dom(itemsRef)) == null ? void 0 : _dom2.contains(target)))
|
|
2153
|
+
api.closeMenu();
|
|
2154
|
+
if (active !== document.body && (active == null ? void 0 : active.contains(target)))
|
|
2155
|
+
return;
|
|
2156
|
+
if (!event.defaultPrevented)
|
|
2157
|
+
(_dom3 = dom(buttonRef)) == null ? void 0 : _dom3.focus({
|
|
2158
|
+
preventScroll: true
|
|
2159
|
+
});
|
|
2160
|
+
});
|
|
2161
|
+
provide(MenuContext, api);
|
|
2162
|
+
useOpenClosedProvider(computed$2(function() {
|
|
2163
|
+
var _match;
|
|
2164
|
+
return match(menuState.value, (_match = {}, _match[MenuStates.Open] = State.Open, _match[MenuStates.Closed] = State.Closed, _match));
|
|
2165
|
+
}));
|
|
2166
|
+
return function() {
|
|
2167
|
+
var slot = {
|
|
2168
|
+
open: menuState.value === MenuStates.Open
|
|
2169
|
+
};
|
|
2170
|
+
return render({
|
|
2171
|
+
props,
|
|
2172
|
+
slot,
|
|
2173
|
+
slots,
|
|
2174
|
+
attrs,
|
|
2175
|
+
name: "Menu"
|
|
2176
|
+
});
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
var MenuButton = /* @__PURE__ */ defineComponent({
|
|
2181
|
+
name: "MenuButton",
|
|
2182
|
+
props: {
|
|
2183
|
+
disabled: {
|
|
2184
|
+
type: Boolean,
|
|
2185
|
+
"default": false
|
|
2186
|
+
},
|
|
2187
|
+
as: {
|
|
2188
|
+
type: [Object, String],
|
|
2189
|
+
"default": "button"
|
|
2190
|
+
}
|
|
2191
|
+
},
|
|
2192
|
+
render: function render$13() {
|
|
2193
|
+
var _dom4;
|
|
2194
|
+
var api = useMenuContext("MenuButton");
|
|
2195
|
+
var slot = {
|
|
2196
|
+
open: api.menuState.value === MenuStates.Open
|
|
2197
|
+
};
|
|
2198
|
+
var propsWeControl = {
|
|
2199
|
+
ref: "el",
|
|
2200
|
+
id: this.id,
|
|
2201
|
+
type: this.type,
|
|
2202
|
+
"aria-haspopup": true,
|
|
2203
|
+
"aria-controls": (_dom4 = dom(api.itemsRef)) == null ? void 0 : _dom4.id,
|
|
2204
|
+
"aria-expanded": this.$props.disabled ? void 0 : api.menuState.value === MenuStates.Open,
|
|
2205
|
+
onKeydown: this.handleKeyDown,
|
|
2206
|
+
onKeyup: this.handleKeyUp,
|
|
2207
|
+
onClick: this.handleClick
|
|
2208
|
+
};
|
|
2209
|
+
return render({
|
|
2210
|
+
props: _extends({}, this.$props, propsWeControl),
|
|
2211
|
+
slot,
|
|
2212
|
+
attrs: this.$attrs,
|
|
2213
|
+
slots: this.$slots,
|
|
2214
|
+
name: "MenuButton"
|
|
2215
|
+
});
|
|
2216
|
+
},
|
|
2217
|
+
setup: function setup6(props, _ref2) {
|
|
2218
|
+
var attrs = _ref2.attrs;
|
|
2219
|
+
var api = useMenuContext("MenuButton");
|
|
2220
|
+
var id2 = "headlessui-menu-button-" + useId();
|
|
2221
|
+
function handleKeyDown(event) {
|
|
2222
|
+
switch (event.key) {
|
|
2223
|
+
case Keys.Space:
|
|
2224
|
+
case Keys.Enter:
|
|
2225
|
+
case Keys.ArrowDown:
|
|
2226
|
+
event.preventDefault();
|
|
2227
|
+
event.stopPropagation();
|
|
2228
|
+
api.openMenu();
|
|
2229
|
+
nextTick$1(function() {
|
|
2230
|
+
var _dom5;
|
|
2231
|
+
(_dom5 = dom(api.itemsRef)) == null ? void 0 : _dom5.focus({
|
|
2232
|
+
preventScroll: true
|
|
2233
|
+
});
|
|
2234
|
+
api.goToItem(Focus.First);
|
|
2235
|
+
});
|
|
2236
|
+
break;
|
|
2237
|
+
case Keys.ArrowUp:
|
|
2238
|
+
event.preventDefault();
|
|
2239
|
+
event.stopPropagation();
|
|
2240
|
+
api.openMenu();
|
|
2241
|
+
nextTick$1(function() {
|
|
2242
|
+
var _dom6;
|
|
2243
|
+
(_dom6 = dom(api.itemsRef)) == null ? void 0 : _dom6.focus({
|
|
2244
|
+
preventScroll: true
|
|
2245
|
+
});
|
|
2246
|
+
api.goToItem(Focus.Last);
|
|
2247
|
+
});
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
function handleKeyUp(event) {
|
|
2252
|
+
switch (event.key) {
|
|
2253
|
+
case Keys.Space:
|
|
2254
|
+
event.preventDefault();
|
|
2255
|
+
break;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
function handleClick(event) {
|
|
2259
|
+
if (props.disabled)
|
|
2260
|
+
return;
|
|
2261
|
+
if (api.menuState.value === MenuStates.Open) {
|
|
2262
|
+
api.closeMenu();
|
|
2263
|
+
nextTick$1(function() {
|
|
2264
|
+
var _dom7;
|
|
2265
|
+
return (_dom7 = dom(api.buttonRef)) == null ? void 0 : _dom7.focus({
|
|
2266
|
+
preventScroll: true
|
|
2267
|
+
});
|
|
2268
|
+
});
|
|
2269
|
+
} else {
|
|
2270
|
+
event.preventDefault();
|
|
2271
|
+
event.stopPropagation();
|
|
2272
|
+
api.openMenu();
|
|
2273
|
+
nextFrame(function() {
|
|
2274
|
+
var _dom8;
|
|
2275
|
+
return (_dom8 = dom(api.itemsRef)) == null ? void 0 : _dom8.focus({
|
|
2276
|
+
preventScroll: true
|
|
2277
|
+
});
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
return {
|
|
2282
|
+
id: id2,
|
|
2283
|
+
el: api.buttonRef,
|
|
2284
|
+
type: useResolveButtonType(computed$2(function() {
|
|
2285
|
+
return {
|
|
2286
|
+
as: props.as,
|
|
2287
|
+
type: attrs.type
|
|
2288
|
+
};
|
|
2289
|
+
}), api.buttonRef),
|
|
2290
|
+
handleKeyDown,
|
|
2291
|
+
handleKeyUp,
|
|
2292
|
+
handleClick
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
});
|
|
2296
|
+
var MenuItems = /* @__PURE__ */ defineComponent({
|
|
2297
|
+
name: "MenuItems",
|
|
2298
|
+
props: {
|
|
2299
|
+
as: {
|
|
2300
|
+
type: [Object, String],
|
|
2301
|
+
"default": "div"
|
|
2302
|
+
},
|
|
2303
|
+
"static": {
|
|
2304
|
+
type: Boolean,
|
|
2305
|
+
"default": false
|
|
2306
|
+
},
|
|
2307
|
+
unmount: {
|
|
2308
|
+
type: Boolean,
|
|
2309
|
+
"default": true
|
|
2310
|
+
}
|
|
2311
|
+
},
|
|
2312
|
+
render: function render$14() {
|
|
2313
|
+
var _api$items$value$api$, _dom9;
|
|
2314
|
+
var api = useMenuContext("MenuItems");
|
|
2315
|
+
var slot = {
|
|
2316
|
+
open: api.menuState.value === MenuStates.Open
|
|
2317
|
+
};
|
|
2318
|
+
var propsWeControl = {
|
|
2319
|
+
"aria-activedescendant": api.activeItemIndex.value === null ? void 0 : (_api$items$value$api$ = api.items.value[api.activeItemIndex.value]) == null ? void 0 : _api$items$value$api$.id,
|
|
2320
|
+
"aria-labelledby": (_dom9 = dom(api.buttonRef)) == null ? void 0 : _dom9.id,
|
|
2321
|
+
id: this.id,
|
|
2322
|
+
onKeydown: this.handleKeyDown,
|
|
2323
|
+
onKeyup: this.handleKeyUp,
|
|
2324
|
+
role: "menu",
|
|
2325
|
+
tabIndex: 0,
|
|
2326
|
+
ref: "el"
|
|
2327
|
+
};
|
|
2328
|
+
var passThroughProps = this.$props;
|
|
2329
|
+
return render({
|
|
2330
|
+
props: _extends({}, passThroughProps, propsWeControl),
|
|
2331
|
+
slot,
|
|
2332
|
+
attrs: this.$attrs,
|
|
2333
|
+
slots: this.$slots,
|
|
2334
|
+
features: Features.RenderStrategy | Features.Static,
|
|
2335
|
+
visible: this.visible,
|
|
2336
|
+
name: "MenuItems"
|
|
2337
|
+
});
|
|
2338
|
+
},
|
|
2339
|
+
setup: function setup7() {
|
|
2340
|
+
var api = useMenuContext("MenuItems");
|
|
2341
|
+
var id2 = "headlessui-menu-items-" + useId();
|
|
2342
|
+
var searchDebounce = ref(null);
|
|
2343
|
+
useTreeWalker({
|
|
2344
|
+
container: computed$2(function() {
|
|
2345
|
+
return dom(api.itemsRef);
|
|
2346
|
+
}),
|
|
2347
|
+
enabled: computed$2(function() {
|
|
2348
|
+
return api.menuState.value === MenuStates.Open;
|
|
2349
|
+
}),
|
|
2350
|
+
accept: function accept(node) {
|
|
2351
|
+
if (node.getAttribute("role") === "menuitem")
|
|
2352
|
+
return NodeFilter.FILTER_REJECT;
|
|
2353
|
+
if (node.hasAttribute("role"))
|
|
2354
|
+
return NodeFilter.FILTER_SKIP;
|
|
2355
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
2356
|
+
},
|
|
2357
|
+
walk: function walk(node) {
|
|
2358
|
+
node.setAttribute("role", "none");
|
|
2359
|
+
}
|
|
2360
|
+
});
|
|
2361
|
+
function handleKeyDown(event) {
|
|
2362
|
+
if (searchDebounce.value)
|
|
2363
|
+
clearTimeout(searchDebounce.value);
|
|
2364
|
+
switch (event.key) {
|
|
2365
|
+
case Keys.Space:
|
|
2366
|
+
if (api.searchQuery.value !== "") {
|
|
2367
|
+
event.preventDefault();
|
|
2368
|
+
event.stopPropagation();
|
|
2369
|
+
return api.search(event.key);
|
|
2370
|
+
}
|
|
2371
|
+
case Keys.Enter:
|
|
2372
|
+
event.preventDefault();
|
|
2373
|
+
event.stopPropagation();
|
|
2374
|
+
if (api.activeItemIndex.value !== null) {
|
|
2375
|
+
var _document$getElementB;
|
|
2376
|
+
var _id = api.items.value[api.activeItemIndex.value].id;
|
|
2377
|
+
(_document$getElementB = document.getElementById(_id)) == null ? void 0 : _document$getElementB.click();
|
|
2378
|
+
}
|
|
2379
|
+
api.closeMenu();
|
|
2380
|
+
nextTick$1(function() {
|
|
2381
|
+
var _dom10;
|
|
2382
|
+
return (_dom10 = dom(api.buttonRef)) == null ? void 0 : _dom10.focus({
|
|
2383
|
+
preventScroll: true
|
|
2384
|
+
});
|
|
2385
|
+
});
|
|
2386
|
+
break;
|
|
2387
|
+
case Keys.ArrowDown:
|
|
2388
|
+
event.preventDefault();
|
|
2389
|
+
event.stopPropagation();
|
|
2390
|
+
return api.goToItem(Focus.Next);
|
|
2391
|
+
case Keys.ArrowUp:
|
|
2392
|
+
event.preventDefault();
|
|
2393
|
+
event.stopPropagation();
|
|
2394
|
+
return api.goToItem(Focus.Previous);
|
|
2395
|
+
case Keys.Home:
|
|
2396
|
+
case Keys.PageUp:
|
|
2397
|
+
event.preventDefault();
|
|
2398
|
+
event.stopPropagation();
|
|
2399
|
+
return api.goToItem(Focus.First);
|
|
2400
|
+
case Keys.End:
|
|
2401
|
+
case Keys.PageDown:
|
|
2402
|
+
event.preventDefault();
|
|
2403
|
+
event.stopPropagation();
|
|
2404
|
+
return api.goToItem(Focus.Last);
|
|
2405
|
+
case Keys.Escape:
|
|
2406
|
+
event.preventDefault();
|
|
2407
|
+
event.stopPropagation();
|
|
2408
|
+
api.closeMenu();
|
|
2409
|
+
nextTick$1(function() {
|
|
2410
|
+
var _dom11;
|
|
2411
|
+
return (_dom11 = dom(api.buttonRef)) == null ? void 0 : _dom11.focus({
|
|
2412
|
+
preventScroll: true
|
|
2413
|
+
});
|
|
2414
|
+
});
|
|
2415
|
+
break;
|
|
2416
|
+
case Keys.Tab:
|
|
2417
|
+
event.preventDefault();
|
|
2418
|
+
event.stopPropagation();
|
|
2419
|
+
break;
|
|
2420
|
+
default:
|
|
2421
|
+
if (event.key.length === 1) {
|
|
2422
|
+
api.search(event.key);
|
|
2423
|
+
searchDebounce.value = setTimeout(function() {
|
|
2424
|
+
return api.clearSearch();
|
|
2425
|
+
}, 350);
|
|
2426
|
+
}
|
|
2427
|
+
break;
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
function handleKeyUp(event) {
|
|
2431
|
+
switch (event.key) {
|
|
2432
|
+
case Keys.Space:
|
|
2433
|
+
event.preventDefault();
|
|
2434
|
+
break;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
var usesOpenClosedState = useOpenClosed();
|
|
2438
|
+
var visible = computed$2(function() {
|
|
2439
|
+
if (usesOpenClosedState !== null) {
|
|
2440
|
+
return usesOpenClosedState.value === State.Open;
|
|
2441
|
+
}
|
|
2442
|
+
return api.menuState.value === MenuStates.Open;
|
|
2443
|
+
});
|
|
2444
|
+
return {
|
|
2445
|
+
id: id2,
|
|
2446
|
+
el: api.itemsRef,
|
|
2447
|
+
handleKeyDown,
|
|
2448
|
+
handleKeyUp,
|
|
2449
|
+
visible
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
});
|
|
2453
|
+
var MenuItem = /* @__PURE__ */ defineComponent({
|
|
2454
|
+
name: "MenuItem",
|
|
2455
|
+
props: {
|
|
2456
|
+
as: {
|
|
2457
|
+
type: [Object, String],
|
|
2458
|
+
"default": "template"
|
|
2459
|
+
},
|
|
2460
|
+
disabled: {
|
|
2461
|
+
type: Boolean,
|
|
2462
|
+
"default": false
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
setup: function setup8(props, _ref3) {
|
|
2466
|
+
var slots = _ref3.slots, attrs = _ref3.attrs;
|
|
2467
|
+
var api = useMenuContext("MenuItem");
|
|
2468
|
+
var id2 = "headlessui-menu-item-" + useId();
|
|
2469
|
+
var active = computed$2(function() {
|
|
2470
|
+
return api.activeItemIndex.value !== null ? api.items.value[api.activeItemIndex.value].id === id2 : false;
|
|
2471
|
+
});
|
|
2472
|
+
var dataRef = ref({
|
|
2473
|
+
disabled: props.disabled,
|
|
2474
|
+
textValue: ""
|
|
2475
|
+
});
|
|
2476
|
+
onMounted(function() {
|
|
2477
|
+
var _document$getElementB2, _document$getElementB3;
|
|
2478
|
+
var textValue = (_document$getElementB2 = document.getElementById(id2)) == null ? void 0 : (_document$getElementB3 = _document$getElementB2.textContent) == null ? void 0 : _document$getElementB3.toLowerCase().trim();
|
|
2479
|
+
if (textValue !== void 0)
|
|
2480
|
+
dataRef.value.textValue = textValue;
|
|
2481
|
+
});
|
|
2482
|
+
onMounted(function() {
|
|
2483
|
+
return api.registerItem(id2, dataRef);
|
|
2484
|
+
});
|
|
2485
|
+
onUnmounted(function() {
|
|
2486
|
+
return api.unregisterItem(id2);
|
|
2487
|
+
});
|
|
2488
|
+
watchEffect(function() {
|
|
2489
|
+
if (api.menuState.value !== MenuStates.Open)
|
|
2490
|
+
return;
|
|
2491
|
+
if (!active.value)
|
|
2492
|
+
return;
|
|
2493
|
+
nextTick$1(function() {
|
|
2494
|
+
var _document$getElementB4;
|
|
2495
|
+
return (_document$getElementB4 = document.getElementById(id2)) == null ? void 0 : _document$getElementB4.scrollIntoView == null ? void 0 : _document$getElementB4.scrollIntoView({
|
|
2496
|
+
block: "nearest"
|
|
2497
|
+
});
|
|
2498
|
+
});
|
|
2499
|
+
});
|
|
2500
|
+
function handleClick(event) {
|
|
2501
|
+
if (props.disabled)
|
|
2502
|
+
return event.preventDefault();
|
|
2503
|
+
api.closeMenu();
|
|
2504
|
+
nextTick$1(function() {
|
|
2505
|
+
var _dom12;
|
|
2506
|
+
return (_dom12 = dom(api.buttonRef)) == null ? void 0 : _dom12.focus({
|
|
2507
|
+
preventScroll: true
|
|
2508
|
+
});
|
|
2509
|
+
});
|
|
2510
|
+
}
|
|
2511
|
+
function handleFocus() {
|
|
2512
|
+
if (props.disabled)
|
|
2513
|
+
return api.goToItem(Focus.Nothing);
|
|
2514
|
+
api.goToItem(Focus.Specific, id2);
|
|
2515
|
+
}
|
|
2516
|
+
function handleMove() {
|
|
2517
|
+
if (props.disabled)
|
|
2518
|
+
return;
|
|
2519
|
+
if (active.value)
|
|
2520
|
+
return;
|
|
2521
|
+
api.goToItem(Focus.Specific, id2);
|
|
2522
|
+
}
|
|
2523
|
+
function handleLeave() {
|
|
2524
|
+
if (props.disabled)
|
|
2525
|
+
return;
|
|
2526
|
+
if (!active.value)
|
|
2527
|
+
return;
|
|
2528
|
+
api.goToItem(Focus.Nothing);
|
|
2529
|
+
}
|
|
2530
|
+
return function() {
|
|
2531
|
+
var disabled = props.disabled;
|
|
2532
|
+
var slot = {
|
|
2533
|
+
active: active.value,
|
|
2534
|
+
disabled
|
|
2535
|
+
};
|
|
2536
|
+
var propsWeControl = {
|
|
2537
|
+
id: id2,
|
|
2538
|
+
role: "menuitem",
|
|
2539
|
+
tabIndex: disabled === true ? void 0 : -1,
|
|
2540
|
+
"aria-disabled": disabled === true ? true : void 0,
|
|
2541
|
+
onClick: handleClick,
|
|
2542
|
+
onFocus: handleFocus,
|
|
2543
|
+
onPointermove: handleMove,
|
|
2544
|
+
onMousemove: handleMove,
|
|
2545
|
+
onPointerleave: handleLeave,
|
|
2546
|
+
onMouseleave: handleLeave
|
|
2547
|
+
};
|
|
2548
|
+
return render({
|
|
2549
|
+
props: _extends({}, props, propsWeControl),
|
|
2550
|
+
slot,
|
|
2551
|
+
attrs,
|
|
2552
|
+
slots,
|
|
2553
|
+
name: "MenuItem"
|
|
2554
|
+
});
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
var GroupContext = /* @__PURE__ */ Symbol("GroupContext");
|
|
2559
|
+
var Switch = /* @__PURE__ */ defineComponent({
|
|
2560
|
+
name: "Switch",
|
|
2561
|
+
emits: {
|
|
2562
|
+
"update:modelValue": function updateModelValue2(_value) {
|
|
2563
|
+
return true;
|
|
2564
|
+
}
|
|
2565
|
+
},
|
|
2566
|
+
props: {
|
|
2567
|
+
as: {
|
|
2568
|
+
type: [Object, String],
|
|
2569
|
+
"default": "button"
|
|
2570
|
+
},
|
|
2571
|
+
modelValue: {
|
|
2572
|
+
type: Boolean,
|
|
2573
|
+
"default": false
|
|
2574
|
+
}
|
|
2575
|
+
},
|
|
2576
|
+
render: function render$15() {
|
|
2577
|
+
var slot = {
|
|
2578
|
+
checked: this.$props.modelValue
|
|
2579
|
+
};
|
|
2580
|
+
var propsWeControl = {
|
|
2581
|
+
id: this.id,
|
|
2582
|
+
ref: "el",
|
|
2583
|
+
role: "switch",
|
|
2584
|
+
type: this.type,
|
|
2585
|
+
tabIndex: 0,
|
|
2586
|
+
"aria-checked": this.$props.modelValue,
|
|
2587
|
+
"aria-labelledby": this.labelledby,
|
|
2588
|
+
"aria-describedby": this.describedby,
|
|
2589
|
+
onClick: this.handleClick,
|
|
2590
|
+
onKeyup: this.handleKeyUp,
|
|
2591
|
+
onKeypress: this.handleKeyPress
|
|
2592
|
+
};
|
|
2593
|
+
return render({
|
|
2594
|
+
props: _extends({}, this.$props, propsWeControl),
|
|
2595
|
+
slot,
|
|
2596
|
+
attrs: this.$attrs,
|
|
2597
|
+
slots: this.$slots,
|
|
2598
|
+
name: "Switch"
|
|
2599
|
+
});
|
|
2600
|
+
},
|
|
2601
|
+
setup: function setup9(props, _ref2) {
|
|
2602
|
+
var emit = _ref2.emit, attrs = _ref2.attrs;
|
|
2603
|
+
var api = inject(GroupContext, null);
|
|
2604
|
+
var id2 = "headlessui-switch-" + useId();
|
|
2605
|
+
function toggle() {
|
|
2606
|
+
emit("update:modelValue", !props.modelValue);
|
|
2607
|
+
}
|
|
2608
|
+
var internalSwitchRef = ref(null);
|
|
2609
|
+
var switchRef = api === null ? internalSwitchRef : api.switchRef;
|
|
2610
|
+
return {
|
|
2611
|
+
id: id2,
|
|
2612
|
+
el: switchRef,
|
|
2613
|
+
type: useResolveButtonType(computed$2(function() {
|
|
2614
|
+
return {
|
|
2615
|
+
as: props.as,
|
|
2616
|
+
type: attrs.type
|
|
2617
|
+
};
|
|
2618
|
+
}), switchRef),
|
|
2619
|
+
labelledby: api == null ? void 0 : api.labelledby,
|
|
2620
|
+
describedby: api == null ? void 0 : api.describedby,
|
|
2621
|
+
handleClick: function handleClick(event) {
|
|
2622
|
+
event.preventDefault();
|
|
2623
|
+
toggle();
|
|
2624
|
+
},
|
|
2625
|
+
handleKeyUp: function handleKeyUp(event) {
|
|
2626
|
+
if (event.key !== Keys.Tab)
|
|
2627
|
+
event.preventDefault();
|
|
2628
|
+
if (event.key === Keys.Space)
|
|
2629
|
+
toggle();
|
|
2630
|
+
},
|
|
2631
|
+
handleKeyPress: function handleKeyPress(event) {
|
|
2632
|
+
event.preventDefault();
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
});
|
|
2637
|
+
function getWindow(node) {
|
|
2638
|
+
if (node == null) {
|
|
2639
|
+
return window;
|
|
2640
|
+
}
|
|
2641
|
+
if (node.toString() !== "[object Window]") {
|
|
2642
|
+
var ownerDocument = node.ownerDocument;
|
|
2643
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
2644
|
+
}
|
|
2645
|
+
return node;
|
|
2646
|
+
}
|
|
2647
|
+
function isElement(node) {
|
|
2648
|
+
var OwnElement = getWindow(node).Element;
|
|
2649
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
2650
|
+
}
|
|
2651
|
+
function isHTMLElement(node) {
|
|
2652
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
2653
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
2654
|
+
}
|
|
2655
|
+
function isShadowRoot(node) {
|
|
2656
|
+
if (typeof ShadowRoot === "undefined") {
|
|
2657
|
+
return false;
|
|
2658
|
+
}
|
|
2659
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
2660
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
2661
|
+
}
|
|
2662
|
+
var round = Math.round;
|
|
2663
|
+
function getBoundingClientRect(element, includeScale) {
|
|
2664
|
+
if (includeScale === void 0) {
|
|
2665
|
+
includeScale = false;
|
|
2666
|
+
}
|
|
2667
|
+
var rect = element.getBoundingClientRect();
|
|
2668
|
+
var scaleX = 1;
|
|
2669
|
+
var scaleY = 1;
|
|
2670
|
+
if (isHTMLElement(element) && includeScale) {
|
|
2671
|
+
var offsetHeight = element.offsetHeight;
|
|
2672
|
+
var offsetWidth = element.offsetWidth;
|
|
2673
|
+
if (offsetWidth > 0) {
|
|
2674
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
2675
|
+
}
|
|
2676
|
+
if (offsetHeight > 0) {
|
|
2677
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
return {
|
|
2681
|
+
width: rect.width / scaleX,
|
|
2682
|
+
height: rect.height / scaleY,
|
|
2683
|
+
top: rect.top / scaleY,
|
|
2684
|
+
right: rect.right / scaleX,
|
|
2685
|
+
bottom: rect.bottom / scaleY,
|
|
2686
|
+
left: rect.left / scaleX,
|
|
2687
|
+
x: rect.left / scaleX,
|
|
2688
|
+
y: rect.top / scaleY
|
|
2689
|
+
};
|
|
2690
|
+
}
|
|
2691
|
+
function getWindowScroll(node) {
|
|
2692
|
+
var win = getWindow(node);
|
|
2693
|
+
var scrollLeft = win.pageXOffset;
|
|
2694
|
+
var scrollTop = win.pageYOffset;
|
|
2695
|
+
return {
|
|
2696
|
+
scrollLeft,
|
|
2697
|
+
scrollTop
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
function getHTMLElementScroll(element) {
|
|
2701
|
+
return {
|
|
2702
|
+
scrollLeft: element.scrollLeft,
|
|
2703
|
+
scrollTop: element.scrollTop
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
function getNodeScroll(node) {
|
|
2707
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
2708
|
+
return getWindowScroll(node);
|
|
2709
|
+
} else {
|
|
2710
|
+
return getHTMLElementScroll(node);
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
function getNodeName(element) {
|
|
2714
|
+
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
2715
|
+
}
|
|
2716
|
+
function getDocumentElement(element) {
|
|
2717
|
+
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
|
2718
|
+
}
|
|
2719
|
+
function getWindowScrollBarX(element) {
|
|
2720
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
2721
|
+
}
|
|
2722
|
+
function getComputedStyle(element) {
|
|
2723
|
+
return getWindow(element).getComputedStyle(element);
|
|
2724
|
+
}
|
|
2725
|
+
function isScrollParent(element) {
|
|
2726
|
+
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
2727
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
2728
|
+
}
|
|
2729
|
+
function isElementScaled(element) {
|
|
2730
|
+
var rect = element.getBoundingClientRect();
|
|
2731
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
2732
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
2733
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
2734
|
+
}
|
|
2735
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
2736
|
+
if (isFixed === void 0) {
|
|
2737
|
+
isFixed = false;
|
|
2738
|
+
}
|
|
2739
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2740
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
2741
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
2742
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
2743
|
+
var scroll = {
|
|
2744
|
+
scrollLeft: 0,
|
|
2745
|
+
scrollTop: 0
|
|
2746
|
+
};
|
|
2747
|
+
var offsets = {
|
|
2748
|
+
x: 0,
|
|
2749
|
+
y: 0
|
|
2750
|
+
};
|
|
2751
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
2752
|
+
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
|
2753
|
+
scroll = getNodeScroll(offsetParent);
|
|
2754
|
+
}
|
|
2755
|
+
if (isHTMLElement(offsetParent)) {
|
|
2756
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
2757
|
+
offsets.x += offsetParent.clientLeft;
|
|
2758
|
+
offsets.y += offsetParent.clientTop;
|
|
2759
|
+
} else if (documentElement) {
|
|
2760
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
return {
|
|
2764
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
2765
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
2766
|
+
width: rect.width,
|
|
2767
|
+
height: rect.height
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
function getLayoutRect(element) {
|
|
2771
|
+
var clientRect = getBoundingClientRect(element);
|
|
2772
|
+
var width = element.offsetWidth;
|
|
2773
|
+
var height = element.offsetHeight;
|
|
2774
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
2775
|
+
width = clientRect.width;
|
|
2776
|
+
}
|
|
2777
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
2778
|
+
height = clientRect.height;
|
|
2779
|
+
}
|
|
2780
|
+
return {
|
|
2781
|
+
x: element.offsetLeft,
|
|
2782
|
+
y: element.offsetTop,
|
|
2783
|
+
width,
|
|
2784
|
+
height
|
|
2785
|
+
};
|
|
2786
|
+
}
|
|
2787
|
+
function getParentNode(element) {
|
|
2788
|
+
if (getNodeName(element) === "html") {
|
|
2789
|
+
return element;
|
|
2790
|
+
}
|
|
2791
|
+
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
|
2792
|
+
}
|
|
2793
|
+
function getScrollParent(node) {
|
|
2794
|
+
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
2795
|
+
return node.ownerDocument.body;
|
|
2796
|
+
}
|
|
2797
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
2798
|
+
return node;
|
|
2799
|
+
}
|
|
2800
|
+
return getScrollParent(getParentNode(node));
|
|
2801
|
+
}
|
|
2802
|
+
function listScrollParents(element, list) {
|
|
2803
|
+
var _element$ownerDocumen;
|
|
2804
|
+
if (list === void 0) {
|
|
2805
|
+
list = [];
|
|
2806
|
+
}
|
|
2807
|
+
var scrollParent = getScrollParent(element);
|
|
2808
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
2809
|
+
var win = getWindow(scrollParent);
|
|
2810
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
2811
|
+
var updatedList = list.concat(target);
|
|
2812
|
+
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
|
2813
|
+
}
|
|
2814
|
+
function isTableElement(element) {
|
|
2815
|
+
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
2816
|
+
}
|
|
2817
|
+
function getTrueOffsetParent(element) {
|
|
2818
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
2819
|
+
return null;
|
|
2820
|
+
}
|
|
2821
|
+
return element.offsetParent;
|
|
2822
|
+
}
|
|
2823
|
+
function getContainingBlock(element) {
|
|
2824
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
|
|
2825
|
+
var isIE = navigator.userAgent.indexOf("Trident") !== -1;
|
|
2826
|
+
if (isIE && isHTMLElement(element)) {
|
|
2827
|
+
var elementCss = getComputedStyle(element);
|
|
2828
|
+
if (elementCss.position === "fixed") {
|
|
2829
|
+
return null;
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
var currentNode = getParentNode(element);
|
|
2833
|
+
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
2834
|
+
var css = getComputedStyle(currentNode);
|
|
2835
|
+
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
2836
|
+
return currentNode;
|
|
2837
|
+
} else {
|
|
2838
|
+
currentNode = currentNode.parentNode;
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
return null;
|
|
2842
|
+
}
|
|
2843
|
+
function getOffsetParent(element) {
|
|
2844
|
+
var window2 = getWindow(element);
|
|
2845
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
2846
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
2847
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
2848
|
+
}
|
|
2849
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
2850
|
+
return window2;
|
|
2851
|
+
}
|
|
2852
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
2853
|
+
}
|
|
2854
|
+
var top = "top";
|
|
2855
|
+
var bottom = "bottom";
|
|
2856
|
+
var right = "right";
|
|
2857
|
+
var left = "left";
|
|
2858
|
+
var start = "start";
|
|
2859
|
+
var end = "end";
|
|
2860
|
+
var beforeRead = "beforeRead";
|
|
2861
|
+
var read = "read";
|
|
2862
|
+
var afterRead = "afterRead";
|
|
2863
|
+
var beforeMain = "beforeMain";
|
|
2864
|
+
var main = "main";
|
|
2865
|
+
var afterMain = "afterMain";
|
|
2866
|
+
var beforeWrite = "beforeWrite";
|
|
2867
|
+
var write = "write";
|
|
2868
|
+
var afterWrite = "afterWrite";
|
|
2869
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
2870
|
+
function order(modifiers) {
|
|
2871
|
+
var map = new Map();
|
|
2872
|
+
var visited = new Set();
|
|
2873
|
+
var result = [];
|
|
2874
|
+
modifiers.forEach(function(modifier) {
|
|
2875
|
+
map.set(modifier.name, modifier);
|
|
2876
|
+
});
|
|
2877
|
+
function sort(modifier) {
|
|
2878
|
+
visited.add(modifier.name);
|
|
2879
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
2880
|
+
requires.forEach(function(dep) {
|
|
2881
|
+
if (!visited.has(dep)) {
|
|
2882
|
+
var depModifier = map.get(dep);
|
|
2883
|
+
if (depModifier) {
|
|
2884
|
+
sort(depModifier);
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
});
|
|
2888
|
+
result.push(modifier);
|
|
2889
|
+
}
|
|
2890
|
+
modifiers.forEach(function(modifier) {
|
|
2891
|
+
if (!visited.has(modifier.name)) {
|
|
2892
|
+
sort(modifier);
|
|
2893
|
+
}
|
|
2894
|
+
});
|
|
2895
|
+
return result;
|
|
2896
|
+
}
|
|
2897
|
+
function orderModifiers(modifiers) {
|
|
2898
|
+
var orderedModifiers = order(modifiers);
|
|
2899
|
+
return modifierPhases.reduce(function(acc, phase) {
|
|
2900
|
+
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
2901
|
+
return modifier.phase === phase;
|
|
2902
|
+
}));
|
|
2903
|
+
}, []);
|
|
2904
|
+
}
|
|
2905
|
+
function debounce(fn2) {
|
|
2906
|
+
var pending;
|
|
2907
|
+
return function() {
|
|
2908
|
+
if (!pending) {
|
|
2909
|
+
pending = new Promise(function(resolve) {
|
|
2910
|
+
Promise.resolve().then(function() {
|
|
2911
|
+
pending = void 0;
|
|
2912
|
+
resolve(fn2());
|
|
2913
|
+
});
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
return pending;
|
|
2917
|
+
};
|
|
2918
|
+
}
|
|
2919
|
+
function getBasePlacement(placement) {
|
|
2920
|
+
return placement.split("-")[0];
|
|
2921
|
+
}
|
|
2922
|
+
function mergeByName(modifiers) {
|
|
2923
|
+
var merged = modifiers.reduce(function(merged2, current) {
|
|
2924
|
+
var existing = merged2[current.name];
|
|
2925
|
+
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
2926
|
+
options: Object.assign({}, existing.options, current.options),
|
|
2927
|
+
data: Object.assign({}, existing.data, current.data)
|
|
2928
|
+
}) : current;
|
|
2929
|
+
return merged2;
|
|
2930
|
+
}, {});
|
|
2931
|
+
return Object.keys(merged).map(function(key) {
|
|
2932
|
+
return merged[key];
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
function getVariation(placement) {
|
|
2936
|
+
return placement.split("-")[1];
|
|
2937
|
+
}
|
|
2938
|
+
function getMainAxisFromPlacement(placement) {
|
|
2939
|
+
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
2940
|
+
}
|
|
2941
|
+
function computeOffsets(_ref) {
|
|
2942
|
+
var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
2943
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
2944
|
+
var variation = placement ? getVariation(placement) : null;
|
|
2945
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
2946
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
2947
|
+
var offsets;
|
|
2948
|
+
switch (basePlacement) {
|
|
2949
|
+
case top:
|
|
2950
|
+
offsets = {
|
|
2951
|
+
x: commonX,
|
|
2952
|
+
y: reference.y - element.height
|
|
2953
|
+
};
|
|
2954
|
+
break;
|
|
2955
|
+
case bottom:
|
|
2956
|
+
offsets = {
|
|
2957
|
+
x: commonX,
|
|
2958
|
+
y: reference.y + reference.height
|
|
2959
|
+
};
|
|
2960
|
+
break;
|
|
2961
|
+
case right:
|
|
2962
|
+
offsets = {
|
|
2963
|
+
x: reference.x + reference.width,
|
|
2964
|
+
y: commonY
|
|
2965
|
+
};
|
|
2966
|
+
break;
|
|
2967
|
+
case left:
|
|
2968
|
+
offsets = {
|
|
2969
|
+
x: reference.x - element.width,
|
|
2970
|
+
y: commonY
|
|
2971
|
+
};
|
|
2972
|
+
break;
|
|
2973
|
+
default:
|
|
2974
|
+
offsets = {
|
|
2975
|
+
x: reference.x,
|
|
2976
|
+
y: reference.y
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
2980
|
+
if (mainAxis != null) {
|
|
2981
|
+
var len = mainAxis === "y" ? "height" : "width";
|
|
2982
|
+
switch (variation) {
|
|
2983
|
+
case start:
|
|
2984
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
2985
|
+
break;
|
|
2986
|
+
case end:
|
|
2987
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
2988
|
+
break;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
return offsets;
|
|
2992
|
+
}
|
|
2993
|
+
var DEFAULT_OPTIONS = {
|
|
2994
|
+
placement: "bottom",
|
|
2995
|
+
modifiers: [],
|
|
2996
|
+
strategy: "absolute"
|
|
2997
|
+
};
|
|
2998
|
+
function areValidElements() {
|
|
2999
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3000
|
+
args[_key] = arguments[_key];
|
|
3001
|
+
}
|
|
3002
|
+
return !args.some(function(element) {
|
|
3003
|
+
return !(element && typeof element.getBoundingClientRect === "function");
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
function popperGenerator(generatorOptions) {
|
|
3007
|
+
if (generatorOptions === void 0) {
|
|
3008
|
+
generatorOptions = {};
|
|
3009
|
+
}
|
|
3010
|
+
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
3011
|
+
return function createPopper2(reference, popper, options) {
|
|
3012
|
+
if (options === void 0) {
|
|
3013
|
+
options = defaultOptions;
|
|
3014
|
+
}
|
|
3015
|
+
var state = {
|
|
3016
|
+
placement: "bottom",
|
|
3017
|
+
orderedModifiers: [],
|
|
3018
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
3019
|
+
modifiersData: {},
|
|
3020
|
+
elements: {
|
|
3021
|
+
reference,
|
|
3022
|
+
popper
|
|
3023
|
+
},
|
|
3024
|
+
attributes: {},
|
|
3025
|
+
styles: {}
|
|
3026
|
+
};
|
|
3027
|
+
var effectCleanupFns = [];
|
|
3028
|
+
var isDestroyed = false;
|
|
3029
|
+
var instance = {
|
|
3030
|
+
state,
|
|
3031
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
3032
|
+
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
3033
|
+
cleanupModifierEffects();
|
|
3034
|
+
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
3035
|
+
state.scrollParents = {
|
|
3036
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
3037
|
+
popper: listScrollParents(popper)
|
|
3038
|
+
};
|
|
3039
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
3040
|
+
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
3041
|
+
return m.enabled;
|
|
3042
|
+
});
|
|
3043
|
+
runModifierEffects();
|
|
3044
|
+
return instance.update();
|
|
3045
|
+
},
|
|
3046
|
+
forceUpdate: function forceUpdate() {
|
|
3047
|
+
if (isDestroyed) {
|
|
3048
|
+
return;
|
|
3049
|
+
}
|
|
3050
|
+
var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
|
|
3051
|
+
if (!areValidElements(reference2, popper2)) {
|
|
3052
|
+
return;
|
|
3053
|
+
}
|
|
3054
|
+
state.rects = {
|
|
3055
|
+
reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === "fixed"),
|
|
3056
|
+
popper: getLayoutRect(popper2)
|
|
3057
|
+
};
|
|
3058
|
+
state.reset = false;
|
|
3059
|
+
state.placement = state.options.placement;
|
|
3060
|
+
state.orderedModifiers.forEach(function(modifier) {
|
|
3061
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
3062
|
+
});
|
|
3063
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
3064
|
+
if (state.reset === true) {
|
|
3065
|
+
state.reset = false;
|
|
3066
|
+
index = -1;
|
|
3067
|
+
continue;
|
|
3068
|
+
}
|
|
3069
|
+
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
3070
|
+
if (typeof fn2 === "function") {
|
|
3071
|
+
state = fn2({
|
|
3072
|
+
state,
|
|
3073
|
+
options: _options,
|
|
3074
|
+
name,
|
|
3075
|
+
instance
|
|
3076
|
+
}) || state;
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
},
|
|
3080
|
+
update: debounce(function() {
|
|
3081
|
+
return new Promise(function(resolve) {
|
|
3082
|
+
instance.forceUpdate();
|
|
3083
|
+
resolve(state);
|
|
3084
|
+
});
|
|
3085
|
+
}),
|
|
3086
|
+
destroy: function destroy() {
|
|
3087
|
+
cleanupModifierEffects();
|
|
3088
|
+
isDestroyed = true;
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
if (!areValidElements(reference, popper)) {
|
|
3092
|
+
return instance;
|
|
3093
|
+
}
|
|
3094
|
+
instance.setOptions(options).then(function(state2) {
|
|
3095
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
3096
|
+
options.onFirstUpdate(state2);
|
|
3097
|
+
}
|
|
3098
|
+
});
|
|
3099
|
+
function runModifierEffects() {
|
|
3100
|
+
state.orderedModifiers.forEach(function(_ref3) {
|
|
3101
|
+
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
|
3102
|
+
if (typeof effect2 === "function") {
|
|
3103
|
+
var cleanupFn = effect2({
|
|
3104
|
+
state,
|
|
3105
|
+
name,
|
|
3106
|
+
instance,
|
|
3107
|
+
options: options2
|
|
3108
|
+
});
|
|
3109
|
+
var noopFn = function noopFn2() {
|
|
3110
|
+
};
|
|
3111
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
3112
|
+
}
|
|
3113
|
+
});
|
|
3114
|
+
}
|
|
3115
|
+
function cleanupModifierEffects() {
|
|
3116
|
+
effectCleanupFns.forEach(function(fn2) {
|
|
3117
|
+
return fn2();
|
|
3118
|
+
});
|
|
3119
|
+
effectCleanupFns = [];
|
|
3120
|
+
}
|
|
3121
|
+
return instance;
|
|
3122
|
+
};
|
|
3123
|
+
}
|
|
3124
|
+
var passive = {
|
|
3125
|
+
passive: true
|
|
3126
|
+
};
|
|
3127
|
+
function effect$1(_ref) {
|
|
3128
|
+
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
3129
|
+
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
3130
|
+
var window2 = getWindow(state.elements.popper);
|
|
3131
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
3132
|
+
if (scroll) {
|
|
3133
|
+
scrollParents.forEach(function(scrollParent) {
|
|
3134
|
+
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
if (resize) {
|
|
3138
|
+
window2.addEventListener("resize", instance.update, passive);
|
|
3139
|
+
}
|
|
3140
|
+
return function() {
|
|
3141
|
+
if (scroll) {
|
|
3142
|
+
scrollParents.forEach(function(scrollParent) {
|
|
3143
|
+
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
if (resize) {
|
|
3147
|
+
window2.removeEventListener("resize", instance.update, passive);
|
|
3148
|
+
}
|
|
3149
|
+
};
|
|
3150
|
+
}
|
|
3151
|
+
var eventListeners = {
|
|
3152
|
+
name: "eventListeners",
|
|
3153
|
+
enabled: true,
|
|
3154
|
+
phase: "write",
|
|
3155
|
+
fn: function fn() {
|
|
3156
|
+
},
|
|
3157
|
+
effect: effect$1,
|
|
3158
|
+
data: {}
|
|
3159
|
+
};
|
|
3160
|
+
function popperOffsets(_ref) {
|
|
3161
|
+
var state = _ref.state, name = _ref.name;
|
|
3162
|
+
state.modifiersData[name] = computeOffsets({
|
|
3163
|
+
reference: state.rects.reference,
|
|
3164
|
+
element: state.rects.popper,
|
|
3165
|
+
strategy: "absolute",
|
|
3166
|
+
placement: state.placement
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3169
|
+
var popperOffsets$1 = {
|
|
3170
|
+
name: "popperOffsets",
|
|
3171
|
+
enabled: true,
|
|
3172
|
+
phase: "read",
|
|
3173
|
+
fn: popperOffsets,
|
|
3174
|
+
data: {}
|
|
3175
|
+
};
|
|
3176
|
+
var unsetSides = {
|
|
3177
|
+
top: "auto",
|
|
3178
|
+
right: "auto",
|
|
3179
|
+
bottom: "auto",
|
|
3180
|
+
left: "auto"
|
|
3181
|
+
};
|
|
3182
|
+
function roundOffsetsByDPR(_ref) {
|
|
3183
|
+
var x = _ref.x, y = _ref.y;
|
|
3184
|
+
var win = window;
|
|
3185
|
+
var dpr = win.devicePixelRatio || 1;
|
|
3186
|
+
return {
|
|
3187
|
+
x: round(x * dpr) / dpr || 0,
|
|
3188
|
+
y: round(y * dpr) / dpr || 0
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
function mapToStyles(_ref2) {
|
|
3192
|
+
var _Object$assign2;
|
|
3193
|
+
var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
3194
|
+
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
3195
|
+
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
3196
|
+
x,
|
|
3197
|
+
y
|
|
3198
|
+
}) : {
|
|
3199
|
+
x,
|
|
3200
|
+
y
|
|
3201
|
+
};
|
|
3202
|
+
x = _ref3.x;
|
|
3203
|
+
y = _ref3.y;
|
|
3204
|
+
var hasX = offsets.hasOwnProperty("x");
|
|
3205
|
+
var hasY = offsets.hasOwnProperty("y");
|
|
3206
|
+
var sideX = left;
|
|
3207
|
+
var sideY = top;
|
|
3208
|
+
var win = window;
|
|
3209
|
+
if (adaptive) {
|
|
3210
|
+
var offsetParent = getOffsetParent(popper);
|
|
3211
|
+
var heightProp = "clientHeight";
|
|
3212
|
+
var widthProp = "clientWidth";
|
|
3213
|
+
if (offsetParent === getWindow(popper)) {
|
|
3214
|
+
offsetParent = getDocumentElement(popper);
|
|
3215
|
+
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
|
3216
|
+
heightProp = "scrollHeight";
|
|
3217
|
+
widthProp = "scrollWidth";
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
offsetParent = offsetParent;
|
|
3221
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3222
|
+
sideY = bottom;
|
|
3223
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
|
3224
|
+
y -= offsetY - popperRect.height;
|
|
3225
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
3226
|
+
}
|
|
3227
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3228
|
+
sideX = right;
|
|
3229
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
|
3230
|
+
x -= offsetX - popperRect.width;
|
|
3231
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
var commonStyles = Object.assign({
|
|
3235
|
+
position
|
|
3236
|
+
}, adaptive && unsetSides);
|
|
3237
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
3238
|
+
x,
|
|
3239
|
+
y
|
|
3240
|
+
}) : {
|
|
3241
|
+
x,
|
|
3242
|
+
y
|
|
3243
|
+
};
|
|
3244
|
+
x = _ref4.x;
|
|
3245
|
+
y = _ref4.y;
|
|
3246
|
+
if (gpuAcceleration) {
|
|
3247
|
+
var _Object$assign;
|
|
3248
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
3249
|
+
}
|
|
3250
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
3251
|
+
}
|
|
3252
|
+
function computeStyles(_ref5) {
|
|
3253
|
+
var state = _ref5.state, options = _ref5.options;
|
|
3254
|
+
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
3255
|
+
var commonStyles = {
|
|
3256
|
+
placement: getBasePlacement(state.placement),
|
|
3257
|
+
variation: getVariation(state.placement),
|
|
3258
|
+
popper: state.elements.popper,
|
|
3259
|
+
popperRect: state.rects.popper,
|
|
3260
|
+
gpuAcceleration,
|
|
3261
|
+
isFixed: state.options.strategy === "fixed"
|
|
3262
|
+
};
|
|
3263
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
3264
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
3265
|
+
offsets: state.modifiersData.popperOffsets,
|
|
3266
|
+
position: state.options.strategy,
|
|
3267
|
+
adaptive,
|
|
3268
|
+
roundOffsets
|
|
3269
|
+
})));
|
|
3270
|
+
}
|
|
3271
|
+
if (state.modifiersData.arrow != null) {
|
|
3272
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
3273
|
+
offsets: state.modifiersData.arrow,
|
|
3274
|
+
position: "absolute",
|
|
3275
|
+
adaptive: false,
|
|
3276
|
+
roundOffsets
|
|
3277
|
+
})));
|
|
3278
|
+
}
|
|
3279
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
3280
|
+
"data-popper-placement": state.placement
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
var computeStyles$1 = {
|
|
3284
|
+
name: "computeStyles",
|
|
3285
|
+
enabled: true,
|
|
3286
|
+
phase: "beforeWrite",
|
|
3287
|
+
fn: computeStyles,
|
|
3288
|
+
data: {}
|
|
3289
|
+
};
|
|
3290
|
+
function applyStyles(_ref) {
|
|
3291
|
+
var state = _ref.state;
|
|
3292
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
3293
|
+
var style = state.styles[name] || {};
|
|
3294
|
+
var attributes = state.attributes[name] || {};
|
|
3295
|
+
var element = state.elements[name];
|
|
3296
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
3297
|
+
return;
|
|
3298
|
+
}
|
|
3299
|
+
Object.assign(element.style, style);
|
|
3300
|
+
Object.keys(attributes).forEach(function(name2) {
|
|
3301
|
+
var value = attributes[name2];
|
|
3302
|
+
if (value === false) {
|
|
3303
|
+
element.removeAttribute(name2);
|
|
3304
|
+
} else {
|
|
3305
|
+
element.setAttribute(name2, value === true ? "" : value);
|
|
3306
|
+
}
|
|
3307
|
+
});
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
function effect(_ref2) {
|
|
3311
|
+
var state = _ref2.state;
|
|
3312
|
+
var initialStyles = {
|
|
3313
|
+
popper: {
|
|
3314
|
+
position: state.options.strategy,
|
|
3315
|
+
left: "0",
|
|
3316
|
+
top: "0",
|
|
3317
|
+
margin: "0"
|
|
3318
|
+
},
|
|
3319
|
+
arrow: {
|
|
3320
|
+
position: "absolute"
|
|
3321
|
+
},
|
|
3322
|
+
reference: {}
|
|
3323
|
+
};
|
|
3324
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
3325
|
+
state.styles = initialStyles;
|
|
3326
|
+
if (state.elements.arrow) {
|
|
3327
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
3328
|
+
}
|
|
3329
|
+
return function() {
|
|
3330
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
3331
|
+
var element = state.elements[name];
|
|
3332
|
+
var attributes = state.attributes[name] || {};
|
|
3333
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
3334
|
+
var style = styleProperties.reduce(function(style2, property) {
|
|
3335
|
+
style2[property] = "";
|
|
3336
|
+
return style2;
|
|
3337
|
+
}, {});
|
|
3338
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
3339
|
+
return;
|
|
3340
|
+
}
|
|
3341
|
+
Object.assign(element.style, style);
|
|
3342
|
+
Object.keys(attributes).forEach(function(attribute) {
|
|
3343
|
+
element.removeAttribute(attribute);
|
|
3344
|
+
});
|
|
3345
|
+
});
|
|
3346
|
+
};
|
|
3347
|
+
}
|
|
3348
|
+
var applyStyles$1 = {
|
|
3349
|
+
name: "applyStyles",
|
|
3350
|
+
enabled: true,
|
|
3351
|
+
phase: "write",
|
|
3352
|
+
fn: applyStyles,
|
|
3353
|
+
effect,
|
|
3354
|
+
requires: ["computeStyles"]
|
|
3355
|
+
};
|
|
3356
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
|
3357
|
+
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
3358
|
+
defaultModifiers
|
|
3359
|
+
});
|
|
3360
|
+
function usePopper(options) {
|
|
3361
|
+
const reference = ref(null);
|
|
3362
|
+
const popper = ref(null);
|
|
3363
|
+
onMounted(() => {
|
|
3364
|
+
watchEffect((onInvalidate) => {
|
|
3365
|
+
if (!popper.value)
|
|
3366
|
+
return;
|
|
3367
|
+
if (!reference.value)
|
|
3368
|
+
return;
|
|
3369
|
+
const popperEl = popper.value.el || popper.value;
|
|
3370
|
+
const referenceEl = reference.value.el || reference.value;
|
|
3371
|
+
if (!(referenceEl instanceof HTMLElement))
|
|
3372
|
+
return;
|
|
3373
|
+
if (!(popperEl instanceof HTMLElement))
|
|
3374
|
+
return;
|
|
3375
|
+
const { destroy } = createPopper(referenceEl, popperEl, options);
|
|
3376
|
+
onInvalidate(destroy);
|
|
3377
|
+
});
|
|
3378
|
+
});
|
|
3379
|
+
return [reference, popper];
|
|
3380
|
+
}
|
|
3381
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
3382
|
+
props: {
|
|
3383
|
+
position: { default: "left" },
|
|
3384
|
+
usePortal: { type: [Boolean, String], default: false }
|
|
3385
|
+
},
|
|
3386
|
+
setup(__props) {
|
|
3387
|
+
const props = __props;
|
|
3388
|
+
const placement = props.position === "left" ? "bottom-end" : "bottom-start";
|
|
3389
|
+
const [button, container] = usePopper({ placement });
|
|
3390
|
+
return (_ctx, _cache) => {
|
|
3391
|
+
return openBlock(), createBlock(unref$1(Menu), {
|
|
3392
|
+
as: "div",
|
|
3393
|
+
class: "relative inline-block text-left"
|
|
3394
|
+
}, {
|
|
3395
|
+
default: withCtx(() => [
|
|
3396
|
+
createVNode(unref$1(MenuButton), {
|
|
3397
|
+
class: "focus:outline-none",
|
|
3398
|
+
ref_key: "button",
|
|
3399
|
+
ref: button
|
|
3400
|
+
}, {
|
|
3401
|
+
default: withCtx(() => [
|
|
3402
|
+
renderSlot(_ctx.$slots, "button", {}, () => [
|
|
3403
|
+
createVNode(unref$1(_sfc_main$a), {
|
|
3404
|
+
class: "fill-current",
|
|
3405
|
+
name: "ellipsis-h"
|
|
3406
|
+
})
|
|
3407
|
+
])
|
|
3408
|
+
]),
|
|
3409
|
+
_: 3
|
|
3410
|
+
}, 512),
|
|
3411
|
+
(openBlock(), createBlock(Teleport, {
|
|
3412
|
+
to: typeof __props.usePortal === "string" ? __props.usePortal : "body",
|
|
3413
|
+
disabled: !__props.usePortal
|
|
3414
|
+
}, [
|
|
3415
|
+
createElementVNode("div", {
|
|
3416
|
+
ref_key: "container",
|
|
3417
|
+
ref: container,
|
|
3418
|
+
class: "w-56"
|
|
3419
|
+
}, [
|
|
3420
|
+
createVNode(Transition, {
|
|
3421
|
+
"enter-active-class": "transition duration-200 ease-in-out",
|
|
3422
|
+
"enter-from-class": "transform -translate-y-4 opacity-0",
|
|
3423
|
+
"enter-to-class": "transform opacity-100",
|
|
3424
|
+
"leave-active-class": "transition duration-100 ease-in-out",
|
|
3425
|
+
"leave-from-class": "transform opacity-100",
|
|
3426
|
+
"leave-to-class": "transform -translate-y-2 opacity-0"
|
|
3427
|
+
}, {
|
|
3428
|
+
default: withCtx(() => [
|
|
3429
|
+
createVNode(unref$1(MenuItems), {
|
|
3430
|
+
class: normalizeClass([
|
|
3431
|
+
{
|
|
3432
|
+
"absolute left-0 origin-top-left": !__props.usePortal && __props.position === "right",
|
|
3433
|
+
"absolute right-0 origin-top-right": !__props.usePortal && __props.position === "left"
|
|
3434
|
+
},
|
|
3435
|
+
"z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
|
|
3436
|
+
])
|
|
3437
|
+
}, {
|
|
3438
|
+
default: withCtx(() => [
|
|
3439
|
+
renderSlot(_ctx.$slots, "default")
|
|
3440
|
+
]),
|
|
3441
|
+
_: 3
|
|
3442
|
+
}, 8, ["class"])
|
|
3443
|
+
]),
|
|
3444
|
+
_: 3
|
|
3445
|
+
})
|
|
3446
|
+
], 512)
|
|
3447
|
+
], 8, ["to", "disabled"]))
|
|
3448
|
+
]),
|
|
3449
|
+
_: 3
|
|
3450
|
+
});
|
|
3451
|
+
};
|
|
3452
|
+
}
|
|
3453
|
+
});
|
|
3454
|
+
const _hoisted_1$4 = {
|
|
3455
|
+
key: 0,
|
|
3456
|
+
class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
|
|
3457
|
+
};
|
|
3458
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3459
|
+
props: {
|
|
3460
|
+
label: null,
|
|
3461
|
+
meta: null,
|
|
3462
|
+
disabled: { type: Boolean }
|
|
3463
|
+
},
|
|
3464
|
+
setup(__props) {
|
|
3465
|
+
return (_ctx, _cache) => {
|
|
3466
|
+
return openBlock(), createBlock(unref$1(MenuItem), normalizeProps(guardReactiveProps({ disabled: __props.disabled })), {
|
|
3467
|
+
default: withCtx(({ active }) => [
|
|
3468
|
+
createElementVNode("span", mergeProps({
|
|
3469
|
+
class: ["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
|
|
3470
|
+
active ? "bg-grey-200" : "",
|
|
3471
|
+
__props.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
|
|
3472
|
+
]]
|
|
3473
|
+
}, _ctx.$attrs), [
|
|
3474
|
+
createElementVNode("span", null, toDisplayString(__props.label), 1),
|
|
3475
|
+
__props.meta ? (openBlock(), createElementBlock("span", _hoisted_1$4, toDisplayString(__props.meta), 1)) : createCommentVNode("", true)
|
|
3476
|
+
], 16)
|
|
3477
|
+
]),
|
|
3478
|
+
_: 1
|
|
3479
|
+
}, 16);
|
|
3480
|
+
};
|
|
3481
|
+
}
|
|
3482
|
+
});
|
|
3483
|
+
const _hoisted_1$3 = { class: "relative" };
|
|
3484
|
+
const _hoisted_2$2 = {
|
|
3485
|
+
key: 1,
|
|
3486
|
+
class: "block truncate"
|
|
3487
|
+
};
|
|
3488
|
+
const _hoisted_3$1 = {
|
|
3489
|
+
key: 2,
|
|
3490
|
+
class: "text-grey-500"
|
|
3491
|
+
};
|
|
3492
|
+
const _hoisted_4$1 = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" };
|
|
3493
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3494
|
+
props: {
|
|
3495
|
+
modelValue: null,
|
|
3496
|
+
size: { default: "medium" },
|
|
3497
|
+
icon: null,
|
|
3498
|
+
placeholder: null,
|
|
3499
|
+
isDisabled: { type: Boolean, default: false },
|
|
3500
|
+
options: null
|
|
3501
|
+
},
|
|
3502
|
+
emits: ["update:modelValue"],
|
|
3503
|
+
setup(__props, { emit }) {
|
|
3504
|
+
const props = __props;
|
|
3505
|
+
const selected = props.modelValue ? ref(props.modelValue) : ref(null);
|
|
3506
|
+
const { inputClasses, disabledClasses, textSizeClasses } = useFormClasses(props);
|
|
3507
|
+
watch(() => props.modelValue, (value) => {
|
|
3508
|
+
var _a;
|
|
3509
|
+
if (!value)
|
|
3510
|
+
return;
|
|
3511
|
+
if (value.id !== ((_a = selected.value) == null ? void 0 : _a.id)) {
|
|
3512
|
+
selected.value = value;
|
|
3513
|
+
}
|
|
3514
|
+
});
|
|
3515
|
+
watch(selected, (value) => {
|
|
3516
|
+
if (value) {
|
|
3517
|
+
emit("update:modelValue", value);
|
|
3518
|
+
}
|
|
3519
|
+
});
|
|
3520
|
+
return (_ctx, _cache) => {
|
|
3521
|
+
return openBlock(), createBlock(unref$1(Listbox), {
|
|
3522
|
+
as: "div",
|
|
3523
|
+
modelValue: unref$1(selected),
|
|
3524
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(selected) ? selected.value = $event : null),
|
|
3525
|
+
disabled: __props.isDisabled
|
|
3526
|
+
}, {
|
|
3527
|
+
default: withCtx(() => [
|
|
3528
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
3529
|
+
createVNode(unref$1(ListboxButton), {
|
|
3530
|
+
class: normalizeClass(["w-full mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [unref$1(inputClasses), unref$1(textSizeClasses), unref$1(disabledClasses)]])
|
|
3531
|
+
}, {
|
|
3532
|
+
default: withCtx(() => [
|
|
3533
|
+
__props.icon ? (openBlock(), createElementBlock("span", {
|
|
3534
|
+
key: 0,
|
|
3535
|
+
class: normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none", unref$1(textSizeClasses)])
|
|
3536
|
+
}, [
|
|
3537
|
+
createVNode(_sfc_main$a, { name: __props.icon }, null, 8, ["name"])
|
|
3538
|
+
], 2)) : createCommentVNode("", true),
|
|
3539
|
+
unref$1(selected) ? (openBlock(), createElementBlock("span", _hoisted_2$2, toDisplayString(unref$1(selected).label), 1)) : (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(__props.placeholder), 1)),
|
|
3540
|
+
createElementVNode("span", _hoisted_4$1, [
|
|
3541
|
+
createVNode(_sfc_main$a, {
|
|
3542
|
+
class: "text-grey-400",
|
|
3543
|
+
name: "chevron-down",
|
|
3544
|
+
"aria-hidden": "true"
|
|
3545
|
+
})
|
|
3546
|
+
])
|
|
3547
|
+
]),
|
|
3548
|
+
_: 1
|
|
3549
|
+
}, 8, ["class"]),
|
|
3550
|
+
createVNode(Transition, {
|
|
3551
|
+
"leave-active-class": "transition ease-in duration-100",
|
|
3552
|
+
"leave-from-class": "opacity-100",
|
|
3553
|
+
"leave-to-class": "opacity-0"
|
|
3554
|
+
}, {
|
|
3555
|
+
default: withCtx(() => [
|
|
3556
|
+
createVNode(unref$1(ListboxOptions), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
|
|
3557
|
+
default: withCtx(() => [
|
|
3558
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
|
|
3559
|
+
return openBlock(), createBlock(unref$1(ListboxOption), {
|
|
3560
|
+
as: "template",
|
|
3561
|
+
key: item.id,
|
|
3562
|
+
value: item
|
|
3563
|
+
}, {
|
|
3564
|
+
default: withCtx(({ active, selected: selected2 }) => [
|
|
3565
|
+
createElementVNode("li", {
|
|
3566
|
+
class: normalizeClass([
|
|
3567
|
+
active ? "text-white bg-grey-800" : "text-gray-900 dark:text-grey-50",
|
|
3568
|
+
"cursor-default select-none relative py-2 pl-3 pr-9"
|
|
3569
|
+
])
|
|
3570
|
+
}, [
|
|
3571
|
+
createElementVNode("span", {
|
|
3572
|
+
class: normalizeClass([
|
|
3573
|
+
selected2 ? "font-semibold" : "font-normal",
|
|
3574
|
+
"block truncate"
|
|
3575
|
+
])
|
|
3576
|
+
}, toDisplayString(item.label), 3),
|
|
3577
|
+
selected2 ? (openBlock(), createElementBlock("span", {
|
|
3578
|
+
key: 0,
|
|
3579
|
+
class: normalizeClass([
|
|
3580
|
+
active ? "text-blue-100" : "text-blue-500",
|
|
3581
|
+
"absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3582
|
+
])
|
|
3583
|
+
}, [
|
|
3584
|
+
createVNode(_sfc_main$a, {
|
|
3585
|
+
name: "check",
|
|
3586
|
+
class: "h-5 w-5",
|
|
3587
|
+
"aria-hidden": "true"
|
|
3588
|
+
})
|
|
3589
|
+
], 2)) : createCommentVNode("", true)
|
|
3590
|
+
], 2)
|
|
3591
|
+
]),
|
|
3592
|
+
_: 2
|
|
3593
|
+
}, 1032, ["value"]);
|
|
3594
|
+
}), 128))
|
|
3595
|
+
]),
|
|
3596
|
+
_: 1
|
|
3597
|
+
})
|
|
3598
|
+
]),
|
|
3599
|
+
_: 1
|
|
3600
|
+
})
|
|
3601
|
+
])
|
|
3602
|
+
]),
|
|
3603
|
+
_: 1
|
|
3604
|
+
}, 8, ["modelValue", "disabled"]);
|
|
3605
|
+
};
|
|
3606
|
+
}
|
|
3607
|
+
});
|
|
3608
|
+
const _hoisted_1$2 = { class: "sr-only" };
|
|
3609
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3610
|
+
props: {
|
|
3611
|
+
id: { default: v4() },
|
|
3612
|
+
label: null,
|
|
3613
|
+
modelValue: { type: Boolean },
|
|
3614
|
+
description: null,
|
|
3615
|
+
onLabel: { default: "on" },
|
|
3616
|
+
offLabel: { default: "off" }
|
|
3617
|
+
},
|
|
3618
|
+
emits: ["update:modelValue", "change"],
|
|
3619
|
+
setup(__props, { emit: emits }) {
|
|
3620
|
+
const update = (newValue) => {
|
|
3621
|
+
emits("update:modelValue", newValue);
|
|
3622
|
+
emits("change", newValue);
|
|
3623
|
+
};
|
|
3624
|
+
return (_ctx, _cache) => {
|
|
3625
|
+
return openBlock(), createBlock(unref$1(Switch), {
|
|
3626
|
+
modelValue: __props.modelValue,
|
|
3627
|
+
label: __props.label,
|
|
3628
|
+
class: normalizeClass([__props.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-blue-300"]),
|
|
3629
|
+
"onUpdate:modelValue": update
|
|
3630
|
+
}, {
|
|
3631
|
+
default: withCtx(() => [
|
|
3632
|
+
createElementVNode("span", {
|
|
3633
|
+
class: normalizeClass(["absolute text-xs text-center text-white inset-x-2", __props.modelValue ? "pr-3" : "pl-3"])
|
|
3634
|
+
}, toDisplayString(__props.modelValue === true ? __props.onLabel : __props.offLabel), 3),
|
|
3635
|
+
createElementVNode("span", _hoisted_1$2, toDisplayString(__props.label), 1),
|
|
3636
|
+
createElementVNode("span", {
|
|
3637
|
+
class: normalizeClass([__props.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
|
|
3638
|
+
}, null, 2)
|
|
3639
|
+
]),
|
|
3640
|
+
_: 1
|
|
3641
|
+
}, 8, ["modelValue", "label", "class"]);
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
});
|
|
3645
|
+
const _hoisted_1$1 = { class: "animate-pulse" };
|
|
3646
|
+
const _hoisted_2$1 = { class: "flex items-center justify-between space-x-4" };
|
|
3647
|
+
const _hoisted_3 = {
|
|
3648
|
+
key: 0,
|
|
3649
|
+
class: "w-12 h-12 bg-current rounded-full shrink-0"
|
|
3650
|
+
};
|
|
3651
|
+
const _hoisted_4 = {
|
|
3652
|
+
key: 1,
|
|
3653
|
+
class: "w-full h-8 bg-current rounded-lg"
|
|
3654
|
+
};
|
|
3655
|
+
const _hoisted_5 = {
|
|
3656
|
+
key: 0,
|
|
3657
|
+
class: "mt-6 space-y-2"
|
|
3658
|
+
};
|
|
3659
|
+
const _hoisted_6 = {
|
|
3660
|
+
key: 1,
|
|
3661
|
+
class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
|
|
3662
|
+
};
|
|
3663
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3664
|
+
props: {
|
|
3665
|
+
avatar: { type: Boolean, default: false },
|
|
3666
|
+
title: { type: Boolean, default: true },
|
|
3667
|
+
lines: { default: 3 },
|
|
3668
|
+
footer: { type: Boolean, default: false }
|
|
3669
|
+
},
|
|
3670
|
+
setup(__props) {
|
|
3671
|
+
const props = __props;
|
|
3672
|
+
const lineSettings = new Array(props.lines).fill(void 0).map(() => {
|
|
3673
|
+
const margins = [4, 5, 6, 8, 10, 16, 24, 32];
|
|
3674
|
+
const margin = margins[Math.floor(Math.random() * margins.length)];
|
|
3675
|
+
return {
|
|
3676
|
+
margin: `mr-${margin}`
|
|
3677
|
+
};
|
|
3678
|
+
});
|
|
3679
|
+
return (_ctx, _cache) => {
|
|
3680
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
3681
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
3682
|
+
__props.avatar ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true),
|
|
3683
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
|
|
3684
|
+
]),
|
|
3685
|
+
__props.lines > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
3686
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(lineSettings), (setting, index) => {
|
|
3687
|
+
return openBlock(), createElementBlock("div", {
|
|
3688
|
+
class: normalizeClass(["h-4 bg-current rounded-lg", setting.margin]),
|
|
3689
|
+
key: index
|
|
3690
|
+
}, null, 2);
|
|
3691
|
+
}), 128))
|
|
3692
|
+
])) : createCommentVNode("", true),
|
|
3693
|
+
__props.footer ? (openBlock(), createElementBlock("div", _hoisted_6)) : createCommentVNode("", true)
|
|
3694
|
+
]);
|
|
3695
|
+
};
|
|
3696
|
+
}
|
|
3697
|
+
});
|
|
3698
|
+
var _export_sfc = (sfc, props) => {
|
|
3699
|
+
const target = sfc.__vccOpts || sfc;
|
|
3700
|
+
for (const [key, val] of props) {
|
|
3701
|
+
target[key] = val;
|
|
3702
|
+
}
|
|
3703
|
+
return target;
|
|
3704
|
+
};
|
|
3705
|
+
const _sfc_main = {};
|
|
3706
|
+
const _hoisted_1 = { class: "grid grid-cols-3 grid-rows-3 gap-1 w-12 h-12" };
|
|
3707
|
+
const _hoisted_2 = /* @__PURE__ */ createStaticVNode('<div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.3s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.4s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.1s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.3s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.1s;"></div><div class="animate-spinner bg-current rounded" style="animation-delay:0.2s;"></div>', 9);
|
|
3708
|
+
const _hoisted_11 = [
|
|
3709
|
+
_hoisted_2
|
|
3710
|
+
];
|
|
3711
|
+
function _sfc_render(_ctx, _cache) {
|
|
3712
|
+
return openBlock(), createElementBlock("div", _hoisted_1, _hoisted_11);
|
|
3713
|
+
}
|
|
3714
|
+
var Spinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3715
|
+
export { _sfc_main$9 as D9Button, _sfc_main$8 as D9Checkbox, _sfc_main$a as D9Icon, _sfc_main$7 as D9Input, _sfc_main$6 as D9Label, _sfc_main$5 as D9Menu, _sfc_main$4 as D9MenuLink, _sfc_main$3 as D9Select, _sfc_main$1 as D9Skeleton, Spinner as D9Spinner, _sfc_main$2 as D9Switch, brands, icons };
|