@vaebe/ccui 2.0.0-beta.0 → 2.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/button/index.es.js +28 -22
- package/button/index.umd.js +1 -1
- package/calendar/index.es.js +445 -90
- package/calendar/index.umd.js +1 -1
- package/ccui-cli.css +1 -1
- package/check-box/index.es.js +8 -2
- package/check-box/index.umd.js +1 -1
- package/chunk-Ndeg2fpE.js +20 -0
- package/collapse/index.es.js +10 -7
- package/collapse/index.umd.js +1 -1
- package/config-provider/chunk-C_CI6nMA.js +13 -0
- package/config-provider/en-BG83iZ_P.js +24 -0
- package/config-provider/index.es.js +408 -53
- package/config-provider/index.umd.js +1 -1
- package/config-provider/ja-B-93MQG5.js +56 -0
- package/config-provider/ko-86th3uXt.js +56 -0
- package/config-provider/zh-cn-BQE-LNg1.js +59 -0
- package/date-picker/ccui-cli.css +1 -1
- package/date-picker/index.es.js +664 -482
- package/date-picker/index.umd.js +1 -1
- package/drawer/index.es.js +271 -279
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +187 -171
- package/dropdown/index.umd.js +1 -1
- package/empty/index.es.js +341 -24
- package/empty/index.umd.js +1 -1
- package/en-BVwCvuzF.js +24 -0
- package/float-button/index.es.js +1134 -46
- package/float-button/index.umd.js +1 -1
- package/form/index.es.js +1357 -261
- package/form/index.umd.js +1 -1
- package/icon/index.es.js +93 -10
- package/icon/index.umd.js +1 -1
- package/image/index.es.js +353 -36
- package/image/index.umd.js +1 -1
- package/input/index.es.js +24 -15
- package/input/index.umd.js +1 -1
- package/input-number/index.es.js +45 -25
- package/input-number/index.umd.js +1 -1
- package/ja-B4U4rt8A.js +56 -0
- package/ko-BG35I8uK.js +56 -0
- package/menu/index.es.js +3 -1
- package/menu/index.umd.js +1 -1
- package/message/index.es.js +1179 -86
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +735 -335
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +1176 -83
- package/notification/index.umd.js +1 -1
- package/package.json +9 -9
- package/pagination/index.es.js +381 -60
- package/pagination/index.umd.js +1 -1
- package/popconfirm/index.es.js +469 -143
- package/popconfirm/index.umd.js +1 -1
- package/popover/index.es.js +192 -175
- package/popover/index.umd.js +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/rate/index.es.js +22 -12
- package/rate/index.umd.js +1 -1
- package/select/index.es.js +135 -53
- package/select/index.umd.js +1 -1
- package/slider/index.es.js +165 -155
- package/slider/index.umd.js +1 -1
- package/steps/index.es.js +1140 -49
- package/steps/index.umd.js +1 -1
- package/switch/index.es.js +2 -0
- package/switch/index.umd.js +1 -1
- package/tabs/index.es.js +31 -5
- package/tabs/index.umd.js +1 -1
- package/tag/index.es.js +53 -35
- package/tag/index.umd.js +1 -1
- package/tooltip/index.es.js +78 -77
- package/tooltip/index.umd.js +1 -1
- package/tree/ccui-cli.css +1 -1
- package/tree/index.es.js +1491 -276
- package/tree/index.umd.js +1 -1
- package/typography/index.es.js +1213 -125
- package/typography/index.umd.js +1 -1
- package/vue-ccui.es.js +8726 -7604
- package/vue-ccui.umd.js +1 -1
- package/zh-cn-C8nbfD5S.js +59 -0
package/select/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@floating-ui/dom`),require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`@floating-ui/dom`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e._floating_ui_dom,e.Vue))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},d=(e,t,n)=>(u(e,t,`default`),n&&u(n,t,`default`));n=((e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);function f(){return typeof window<`u`}function p(e){return h(e)?(e.nodeName||``).toLowerCase():`#document`}function m(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function h(e){return f()?e instanceof Node||e instanceof m(e).Node:!1}var g=l({Vue:()=>n,Vue2:()=>void 0,del:()=>y,install:()=>_,isVue2:()=>!1,isVue3:()=>!0,set:()=>v});d(g,require(`vue`));function _(){}function v(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function y(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function b(e){return typeof e==`object`&&!!e&&`$el`in e}function x(e){if(b(e)){let t=e.$el;return h(t)&&p(t)===`#comment`?null:t}return e}function S(e){return typeof e==`function`?e():(0,g.unref)(e)}function ee(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function te(e,t){let n=ee(e);return Math.round(t*n)/n}function C(e,n,r){r===void 0&&(r={});let i=r.whileElementsMounted,a=(0,g.computed)(()=>S(r.open)??!0),o=(0,g.computed)(()=>S(r.middleware)),s=(0,g.computed)(()=>S(r.placement)??`bottom`),c=(0,g.computed)(()=>S(r.strategy)??`absolute`),l=(0,g.computed)(()=>S(r.transform)??!0),u=(0,g.computed)(()=>x(e.value)),d=(0,g.computed)(()=>x(n.value)),f=(0,g.ref)(0),p=(0,g.ref)(0),m=(0,g.ref)(c.value),h=(0,g.ref)(s.value),_=(0,g.shallowRef)({}),v=(0,g.ref)(!1),y=(0,g.computed)(()=>{let e={position:m.value,left:`0`,top:`0`};if(!d.value)return e;let t=te(d.value,f.value),n=te(d.value,p.value);return l.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...ee(d.value)>=1.5&&{willChange:`transform`}}:{position:m.value,left:t+`px`,top:n+`px`}}),b;function C(){if(u.value==null||d.value==null)return;let e=a.value;(0,t.computePosition)(u.value,d.value,{middleware:o.value,placement:s.value,strategy:c.value}).then(t=>{f.value=t.x,p.value=t.y,m.value=t.strategy,h.value=t.placement,_.value=t.middlewareData,v.value=e!==!1})}function ne(){typeof b==`function`&&(b(),b=void 0)}function w(){if(ne(),i===void 0){C();return}if(u.value!=null&&d.value!=null){b=i(u.value,d.value,C);return}}function T(){a.value||(v.value=!1)}return(0,g.watch)([o,s,c,a],C,{flush:`sync`}),(0,g.watch)([u,d],w,{flush:`sync`}),(0,g.watch)(a,T,{flush:`sync`}),(0,g.getCurrentScope)()&&(0,g.onScopeDispose)(ne),{x:(0,g.shallowReadonly)(f),y:(0,g.shallowReadonly)(p),strategy:(0,g.shallowReadonly)(m),placement:(0,g.shallowReadonly)(h),middlewareData:(0,g.shallowReadonly)(_),isPositioned:(0,g.shallowReadonly)(v),floatingStyles:y,update:C}}var ne=Symbol(`ccuiFormItem`),w=/^[a-z0-9]+(-[a-z0-9]+)*$/,T=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!E(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!E(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!E(e,n)?null:e}return null},E=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function re(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var D=Object.freeze({left:0,top:0,width:16,height:16}),O=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),k=Object.freeze({...D,...O}),A=Object.freeze({...k,body:``,hidden:!1});function j(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function M(e,t){let n=j(e,t);for(let r in A)r in O?r in e&&!(r in n)&&(n[r]=O[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ie(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=M(r[e]||i[e],a)}return o(t),n.forEach(o),M(e,a)}function ae(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=re(e);for(let i in r){let a=r[i];a&&(t(i,ie(e,i,a)),n.push(i))}return n}var N={provider:``,aliases:{},not_found:{},...D};function P(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function F(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!P(e,N))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!P(t,A))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!P(t,A))return null}return t}var I=Object.create(null);function oe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function L(e,t){let n=I[e]||(I[e]=Object.create(null));return n[t]||(n[t]=oe(e,t))}function R(e,t){return F(t)?ae(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function se(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var z=!1;function B(e){return typeof e==`boolean`&&(z=e),z}function V(e){let t=typeof e==`string`?T(e,!0,z):e;if(t){let e=L(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ce(e,t){let n=T(e,!0,z);if(!n)return!1;let r=L(n.provider,n.prefix);return t?se(r,n.name,t):(r.missing.add(n.name),!0)}function le(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),z&&!t&&!e.prefix){let t=!1;return F(e)&&(e.prefix=``,ae(e,(e,n)=>{ce(e,n)&&(t=!0)})),t}let n=e.prefix;return E({prefix:n,name:`a`})?!!R(L(t,n),e):!1}var ue=Object.freeze({width:null,height:null}),de=Object.freeze({...ue,...O}),fe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,pe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function me(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(fe);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=pe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function he(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function ge(e,t){return e?`<defs>`+e+`</defs>`+t:t}function _e(e,t,n){let r=he(e);return ge(r.defs,t+r.content+n)}var ve=e=>e===`unset`||e===`undefined`||e===`none`;function ye(e,t){let n={...k,...e},r={...de,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=_e(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=me(d,c/l)):(u=o===`auto`?c:o,d=s===null?me(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ve(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var be=/\sid="(\S+)"/g,xe=new Map;function H(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=xe.get(e)||0;return xe.set(e,t+1),t?`${e}${t}`:e}function Se(e){let t=[],n;for(;n=be.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=H(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var U=Object.create(null);function Ce(e,t){U[e]=t}function W(e){return U[e]||U[``]}function G(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var K=Object.create(null),q=[`https://api.simplesvg.com`,`https://api.unisvg.com`],J=[];q.length>0;)q.length===1||Math.random()>.5?J.push(q.shift()):J.push(q.pop());K[``]=G({resources:[`https://api.iconify.design`].concat(J)});function we(e,t){let n=G(t);return n===null?!1:(K[e]=n,!0)}function Y(e){return K[e]}var Te=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Ee(e,t){let n=Y(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function De(e){return e===404}var Oe=(e,t,n)=>{let r=[],i=Ee(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ke(e){if(typeof e==`string`){let t=Y(e);if(t)return t.path}return`/`}var Ae={prepare:Oe,send:(e,t,n)=>{if(!Te){n(`abort`,424);return}let r=ke(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;Te(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(De(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function je(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||je([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=je.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=L(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?T(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var Ve=Object.create(null);function He(e){if(!Ve[e]){let t=Y(e);if(!t)return;Ve[e]={config:t,redundancy:ze(t)}}return Ve[e]}function Ue(e,t,n){let r,i;if(typeof e==`string`){let t=W(e);if(!t)return n(void 0,424),Be;i=t.send;let a=He(e);a&&(r=a.redundancy)}else{let t=G(e);if(t){r=ze(t);let n=W(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function We(){}function Ge(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ke(e){let t=[],n=[];return e.forEach(e=>{(e.match(w)?t:n).push(e)}),{valid:t,invalid:n}}function X(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!R(e,n).length){r();return}}catch(e){console.error(e)}r(),Ge(e)}function qe(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Je(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){qe(e.loadIcons(r,n,t),t=>{X(e,r,t)});return}if(i){r.forEach(r=>{qe(i(r,n,t),t=>{X(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ke(r);if(o.length&&X(e,o,null),!a.length)return;let s=n.match(w)?W(t):null;if(!s){X(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Ue(t,n,t=>{X(e,n.icons,t)})})}))}var Ye=(e,t)=>{let n=Fe(Ie(e,!0,B()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,We)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(L(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=L(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Je(e,t)}),t?Pe(t,n,i):We};function Xe(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in ue?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Ze=/[\s,]+/;function Qe(e,t){t.split(Ze).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function $e(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function et(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function tt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function nt(e){return`data:image/svg+xml,`+tt(e)}function rt(e){return`url("`+nt(e)+`")`}var it={...de,inline:!1},at={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},ot={display:`inline-block`},st={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={webkitMask:st,mask:st,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var Z={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;Z[e+`-flip`]=t,Z[e.slice(0,1)+`-flip`]=t,Z[e+`Flip`]=t});function dt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var ft=(e,t)=>{let r=Xe(it,t),i={...at},a=t.mode||`svg`,o={},s=t.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:case`customise`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Qe(r,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?r[e]=$e(n):typeof n==`number`&&(r[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete i[`aria-hidden`];break;default:{let t=Z[e];t?(n===!0||n===`true`||n===1)&&(r[t]=!0):it[e]===void 0&&(i[e]=n)}}}let l=ye(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`)return i.style={...o,...c},Object.assign(i,u),i.innerHTML=Se(l.body),(0,n.h)(`svg`,i);let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=et(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":rt(h),width:dt(u.width),height:dt(u.height),...ot,...m?st:ct,...c},(0,n.h)(`span`,i)};if(B(!0),Ce(``,Ae),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!le(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;we(e,r)||console.error(n)}catch{console.error(n)}}}}var pt={...k,body:``},mt=(0,n.defineComponent)((e,{emit:t})=>{let r=(0,n.ref)(null);function i(){r.value&&=(r.value.abort?.(),null)}let a=(0,n.ref)(!!e.ssr),o=(0,n.ref)(``),s=(0,n.shallowRef)(null);function c(){let a=e.icon;if(typeof a==`object`&&a&&typeof a.body==`string`)return o.value=``,{data:a};let s;if(typeof a!=`string`||(s=T(a,!1,!0))===null)return null;let c=V(s);if(!c){let e=r.value;return(!e||e.name!==a)&&(c===null?r.value={name:a}:r.value={name:a,abort:Ye([s],l)}),null}i(),o.value!==a&&(o.value=a,(0,n.nextTick)(()=>{t(`load`,a)}));let u=e.customise;if(u){c=Object.assign({},c);let e=u(c.body,s.name,s.prefix,s.provider);typeof e==`string`&&(c.body=e)}let d=[`iconify`];return s.prefix!==``&&d.push(`iconify--`+s.prefix),s.provider!==``&&d.push(`iconify--`+s.provider),{data:c,classes:d}}function l(){let e=c();e?e.data!==s.value?.data&&(s.value=e):s.value=null}return a.value?l():(0,n.onMounted)(()=>{a.value=!0,l()}),(0,n.watch)(()=>e.icon,l),(0,n.onUnmounted)(i),()=>{let t=s.value;if(!t)return ft(pt,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),ft({...k,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]});function ht(e){return e.includes(`:`)}function gt(e){return e?typeof e==`string`?ht(e)?(0,n.h)(mt,{icon:e}):(0,n.h)(`i`,{class:e}):e:null}function Q(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function _t(e,t=!1){let n=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>Q(n),e:e=>e?Q(n,e):``,m:e=>e?Q(n,``,e):``,em:(e,t)=>e&&t?Q(n,e,t):``,is:e=>`is-${e}`}}function vt(e,t){let r=(0,n.ref)(0),i=t.buffer??4,a=(0,n.computed)(()=>e.value.length*t.itemHeight),o=(0,n.computed)(()=>Math.min(t.maxHeight,a.value));return{scrollTop:r,onScroll:e=>{r.value=e.currentTarget.scrollTop},visible:(0,n.computed)(()=>{let n=e.value;if(n.length===0)return[];let a=Math.max(0,Math.floor(r.value/t.itemHeight)-i),s=Math.ceil(o.value/t.itemHeight)+i*2,c=Math.min(n.length,a+s),l=[];for(let e=a;e<c;e+=1)l.push({index:e,data:n[e],top:e*t.itemHeight});return l}),totalHeight:a,containerHeight:o,scrollToIndex:(e,n)=>{if(!n)return;let i=e*t.itemHeight;i<r.value?n.scrollTop=i:i+t.itemHeight>r.value+o.value&&(n.scrollTop=i-o.value+t.itemHeight)}}}var yt={label:`label`,value:`value`,disabled:`disabled`,options:`options`};function bt(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}function xt(e){return typeof e==`object`&&!!e&&`value`in e}function St(e){if(xt(e))return e.value;if(typeof e==`string`||typeof e==`number`)return e}function Ct(e){if(Array.isArray(e))return e.map(St).filter(e=>e!==void 0);if(e==null||e===``)return[];let t=St(e);return t===void 0?[]:[t]}function wt(e,t){let n=e[t];return Array.isArray(n)}function Tt(e){return e.mode?e.mode:e.multiple?`multiple`:`default`}function Et(e,t,n){return{raw:e,label:e[t.label],value:e[t.value],disabled:!!e[t.disabled],groupPath:n}}function Dt(e,t,n){if(!t||n===!1)return e;if(typeof n==`function`)return e.filter(e=>n(t,e.raw));let r=t.toLowerCase();return e.filter(e=>bt(e.label).toLowerCase().includes(r)||bt(e.value).toLowerCase().includes(r))}function Ot(e,t,n=[],r=[]){for(let i of e)if(wt(i,t.options)){let e=[...n,i[t.label]];Ot(i[t.options],t,e,r)}else r.push(Et(i,t,n));return r}function kt(e,t,n,r,i,a){let o=!1;for(let s of e)if(wt(s,t.options)){let e=s[t.options],c=a.length;a.push({type:`group`,group:{label:s[t.label],depth:i}}),kt(e,t,n,r,i+1,a)?o=!0:a.splice(c,a.length-c)}else{let e=Dt([Et(s,t,[])],n,r);for(let t of e)a.push({type:`option`,option:t}),o=!0}return o}function At(e,t,r){let i=(0,n.computed)(()=>({...yt,...e.fieldNames})),a=(0,n.computed)(()=>Tt(e)),o=(0,n.computed)(()=>a.value===`multiple`||a.value===`tags`),s=(0,n.computed)(()=>Ot(e.options,i.value)),c=(0,n.computed)(()=>Ct(e.modelValue)),l=(0,n.computed)(()=>{let e=new Map;for(let t of s.value)e.set(t.value,t);return c.value.map(t=>e.get(t)||{raw:{[i.value.label]:t,[i.value.value]:t},label:t,value:t,disabled:!1,groupPath:[]})}),u=t=>{if(e.optionLabelProp){let n=t.raw[e.optionLabelProp];if(n!==void 0)return n}return t.label},d=(0,n.computed)(()=>{let e=l.value[0];return e?u(e):``}),f=(0,n.computed)(()=>{let n=i.value,r=t.value.trim(),a=e.filterable||e.showSearch?e.filterOption:!1,o=[];return kt(e.options,n,r,a,0,o),o}),p=(0,n.computed)(()=>f.value.filter(e=>e.type===`option`).map(e=>e.option)),m=(0,n.computed)(()=>new Set(c.value)),h=t=>{if(t!==void 0)return e.labelInValue?{value:t,label:s.value.find(e=>e.value===t)?.label??t}:t},g=t=>{let n;n=t===void 0?void 0:Array.isArray(t)?e.labelInValue?t.map(e=>h(e)):t:e.labelInValue?h(t):t,r(`update:modelValue`,n),r(`change`,n)},_=()=>!o.value||!e.maxCount||e.maxCount<=0?!1:c.value.length>=e.maxCount;return{addTagValue:e=>{if(a.value!==`tags`)return!1;let t=e.trim();return!t||c.value.includes(t)||_()?!1:(g(c.value.concat(t)),!0)},clearValue:()=>{o.value?g([]):g(void 0)},displayLabelOf:u,fieldNames:i,isMultiple:o,mode:a,removeValue:e=>{o.value&&g(c.value.filter(t=>t!==e))},reorderTagValue:(e,t)=>{if(!o.value)return;let n=[...c.value],r=n.indexOf(e),i=n.indexOf(t);r<0||i<0||r===i||(n.splice(r,1),n.splice(i,0,e),g(n))},selectOption:e=>{if(e.disabled)return;if(!o.value){g(e.value);return}let t=c.value.includes(e.value);!t&&_()||g(t?c.value.filter(t=>t!==e.value):c.value.concat(e.value))},selectedLabel:d,selectedOptions:l,selectedValueSet:m,selectedValues:c,visibleFlatOptions:f,visibleOptions:p}}var jt={modelValue:{type:[String,Number,Array,Object],default:void 0},options:{type:Array,default:()=>[]},fieldNames:{type:Object,default:()=>({})},mode:{type:String,default:void 0},placement:{type:String,default:`bottom`},filterOption:{type:[Boolean,Function],default:!0},popupClassName:{type:String,default:``},getPopupContainer:{type:Function,default:void 0},popupAppendToBody:{type:Boolean,default:!1},placeholder:{type:String,default:`Please select`},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},clearIcon:{type:[String,Object],default:void 0},suffixIcon:{type:[String,Object],default:void 0},removeIcon:{type:[String,Object],default:void 0},multiple:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,default:`default`},noDataText:{type:String,default:`No data`},loadingText:{type:String,default:`Loading...`},maxTagCount:{type:Number,default:3},maxCount:{type:Number,default:0},status:{type:String,default:``},labelInValue:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},defaultActiveFirstOption:{type:Boolean,default:!0},highlightMatch:{type:Boolean,default:!1},virtualScroll:{type:Boolean,default:!1},virtualItemHeight:{type:Number,default:32},virtualMaxHeight:{type:Number,default:240},optionLabelProp:{type:String,default:``},showSearch:{type:Boolean,default:!1},transitionName:{type:String,default:`ccui-select-fade`},tagsDraggable:{type:Boolean,default:!1},variant:{type:String,default:`outlined`},classNames:{type:Object,default:void 0},styles:{type:Object,default:void 0}},Mt=0;function Nt(e,t){if(!t)return Pt(e);let r=Pt(e),i=r.toLowerCase().indexOf(t.toLowerCase());return i<0?r:(0,n.h)(`span`,null,[r.slice(0,i),(0,n.h)(`mark`,{class:`ccui-select__highlight`},r.slice(i,i+t.length)),r.slice(i+t.length)])}function Pt(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}var $=(0,n.defineComponent)({name:`CSelect`,props:jt,emits:[`update:modelValue`,`change`,`search`,`visible-change`,`clear`,`focus`,`blur`],setup(e,{emit:r,slots:i}){let a=_t(`select`),o=(0,n.getCurrentInstance)();Mt+=1;let s=`${o?.uid??Mt}-${Mt}`,c=`ccui-select-listbox-${s}`,l=e=>`ccui-select-option-${s}-${e}`,u=(0,n.ref)(null),d=(0,n.ref)(null),f=(0,n.ref)(null),p=(0,n.ref)(null),m=(0,n.shallowRef)(!1),h=(0,n.shallowRef)(0),g=(0,n.shallowRef)(``),_=(0,n.inject)(ne,null),{addTagValue:v,clearValue:y,displayLabelOf:b,isMultiple:x,mode:S,removeValue:ee,reorderTagValue:te,selectOption:w,selectedLabel:T,selectedOptions:E,selectedValueSet:re,visibleFlatOptions:D,visibleOptions:O}=At(e,g,r),k=(0,n.shallowRef)(null),A=(0,n.shallowRef)(null),j=(0,n.computed)(()=>E.value.length>0),M=(0,n.computed)(()=>E.value.slice(0,e.maxTagCount)),ie=(0,n.computed)(()=>Math.max(E.value.length-M.value.length,0)),ae=(0,n.computed)(()=>e.filterable||e.showSearch),N=(0,n.computed)(()=>ae.value||S.value===`tags`),P=(0,n.computed)(()=>e.placement===`auto`?`bottom-start`:`${e.placement}-start`),F=(0,n.computed)(()=>typeof document>`u`?null:e.getPopupContainer?e.getPopupContainer(u.value):e.popupAppendToBody?document.body:null),I=(0,n.computed)(()=>F.value!==null),{floatingStyles:oe}=C(u,d,{placement:P,open:m,whileElementsMounted:t.autoUpdate,middleware:[(0,t.offset)(4),(0,t.flip)(),(0,t.shift)({padding:8})],strategy:(0,n.computed)(()=>I.value?`fixed`:`absolute`)}),L=(0,n.computed)(()=>_?.validateStatus.value??``),R=(0,n.computed)(()=>e.status||L.value),se=(0,n.computed)(()=>({[a.b()]:!0,[a.m(e.size)]:!!e.size,[a.m(`open`)]:m.value,[a.m(`disabled`)]:e.disabled,[a.m(`multiple`)]:x.value,[a.m(`tags`)]:S.value===`tags`,[a.m(R.value)]:!!R.value,[a.m(`variant-${e.variant}`)]:!!e.variant})),z=(0,n.computed)(()=>e.virtualScroll&&D.value.filter(e=>e.type===`option`).length>0),B=vt((0,n.computed)(()=>D.value),{itemHeight:e.virtualItemHeight,maxHeight:e.virtualMaxHeight}),V=t=>{e.disabled||m.value===t||(m.value=t,r(`visible-change`,t),t&&(e.defaultActiveFirstOption&&(h.value=le()),N.value&&(0,n.nextTick)(()=>p.value?.focus())),t||(g.value=``,_&&_.validate(`blur`)))},ce=e=>{let t=e.target;u.value?.contains(t)||d.value?.contains(t)||V(!1)};(0,n.onMounted)(()=>{document.addEventListener(`mousedown`,ce),e.autoFocus&&(0,n.nextTick)(()=>u.value?.focus())}),(0,n.onUnmounted)(()=>{document.removeEventListener(`mousedown`,ce)});let le=()=>{let e=O.value.findIndex(e=>!e.disabled);return e<0?0:e};(0,n.watch)(()=>O.value.length,()=>{e.defaultActiveFirstOption?h.value=le():h.value=0}),(0,n.watch)(()=>e.modelValue,()=>{_&&_.validate(`change`)});let ue=e=>{let t=O.value;if(t.length===0)return 0;let n=h.value;for(let r=1;r<=t.length;r+=1){let i=(n+r*e+t.length)%t.length;if(!t[i].disabled)return i}return n},de=e=>{let t=O.value;if(t.length===0)return 0;if(e===1){for(let e=t.length-1;e>=0;--e)if(!t[e].disabled)return e}else for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e;return h.value},fe=t=>{let n=Math.max(1,Math.floor(e.virtualMaxHeight/e.virtualItemHeight)),r=O.value;if(r.length===0)return h.value;let i=h.value+t*n;for(i=Math.max(0,Math.min(r.length-1,i));i>=0&&i<r.length&&r[i].disabled;)i+=t;return(i<0||i>=r.length)&&(i=h.value),i},pe=()=>{if(!z.value||!f.value)return;let e=D.value,t=-1,n=0;for(let r=0;r<e.length;r+=1)if(e[r].type===`option`&&(t+=1,t===h.value)){n=r;break}B.scrollToIndex(n,f.value)};(0,n.watch)(h,()=>{(0,n.nextTick)(pe)});let me=e=>{let t=e.target.value;g.value=t,r(`search`,t),V(!0)},he=e=>{e.disabled||(w(e),x.value||V(!1),N.value&&(g.value=``))},ge=e=>{e.stopPropagation(),y(),r(`clear`),V(!1)},_e=(e,t)=>{t.stopPropagation(),ee(e)},ve=()=>{if(S.value!==`tags`)return!1;let e=v(g.value);return e&&(g.value=``),e},ye=t=>{if(!e.disabled){if(t.key===`Escape`){V(!1);return}if(t.key===`Enter`){if(!m.value){V(!0);return}let e=O.value[h.value];if(e&&(O.value.length>0||S.value!==`tags`)){he(e);return}S.value===`tags`&&ve();return}if(t.key===`Backspace`&&x.value&&!g.value&&j.value){let e=E.value[E.value.length-1]?.value;e!==void 0&&ee(e);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),V(!0),h.value=de(t.key===`Home`?-1:1);return}if(t.key===`PageUp`||t.key===`PageDown`){t.preventDefault(),V(!0),h.value=fe(t.key===`PageDown`?1:-1);return}t.key!==`ArrowDown`&&t.key!==`ArrowUp`||(t.preventDefault(),V(!0),O.value.length!==0&&(h.value=ue(t.key===`ArrowDown`?1:-1)))}},be=e=>{r(`focus`,e)},xe=e=>{r(`blur`,e)},H=t=>(0,n.h)(`input`,{ref:p,class:a.e(`search`),value:g.value,placeholder:t,disabled:e.disabled,"aria-autocomplete":`list`,"aria-controls":c,onInput:me,onKeydown:ye}),Se=()=>{if(N.value&&m.value)return H(j.value?Pt(T.value):e.placeholder);let t=j.value?i.selected?i.selected({option:E.value[0]}):T.value:e.placeholder;return(0,n.h)(`span`,{class:j.value?a.e(`single`):a.e(`placeholder`)},t)},U=(t,n)=>{if(!e.tagsDraggable||n.disabled){t.preventDefault();return}k.value=n.value,t.dataTransfer?.setData(`text/plain`,String(n.value))},Ce=(t,n)=>{!e.tagsDraggable||k.value===null||(t.preventDefault(),A.value=n.value)},W=(t,n)=>{if(!e.tagsDraggable||k.value===null)return;t.preventDefault();let r=k.value;r!==n.value&&te(r,n.value),k.value=null,A.value=null},G=()=>{k.value=null,A.value=null},K=t=>{if(i.tag)return i.tag({option:t,onClose:e=>_e(t.value,e)});let r=b(t);return(0,n.h)(`span`,{class:[a.e(`tag`),e.tagsDraggable&&a.em(`tag`,`draggable`),A.value===t.value&&a.em(`tag`,`drop-over`),k.value===t.value&&a.em(`tag`,`dragging`)],key:t.value,draggable:e.tagsDraggable&&!t.disabled?!0:void 0,onDragstart:e=>U(e,t),onDragover:e=>Ce(e,t),onDrop:e=>W(e,t),onDragend:G},[(0,n.h)(`span`,{class:a.e(`tag-label`)},r),(0,n.h)(`span`,{class:a.e(`tag-close`),onClick:e=>_e(t.value,e)},i.removeIcon?i.removeIcon():gt(e.removeIcon)??`x`)])},q=(e=[])=>(0,n.h)(`div`,{class:a.e(`tags`)},[...M.value.map(K),...ie.value>0?[(0,n.h)(`span`,{class:a.e(`tag`),key:`__more`},`+${ie.value}`)]:[],...e]),J=()=>j.value?q(N.value&&m.value?[H(``)]:[]):N.value&&m.value?H(e.placeholder):(0,n.h)(`span`,{class:a.e(`placeholder`)},e.placeholder),we=(t,r)=>{let o=re.value.has(t.value),s=e.highlightMatch?Nt(t.label,g.value.trim()):t.label,c=i.option?i.option({option:t,selected:o}):[(0,n.h)(`span`,null,s),o?(0,n.h)(`span`,{class:a.e(`check`)},`*`):null];return(0,n.h)(`li`,{key:t.value,id:l(r),class:[a.e(`option`),r===h.value&&a.em(`option`,`active`),o&&a.em(`option`,`selected`),t.disabled&&a.em(`option`,`disabled`)],role:`option`,"aria-selected":o,"aria-disabled":t.disabled||void 0,onMouseenter:()=>{t.disabled||(h.value=r)},onClick:e=>{e.stopPropagation(),he(t)}},c)},Y=()=>{let e=D.value,t=-1,r=[];for(let i=0;i<e.length;i+=1){let o=e[i];if(o.type===`group`&&o.group){let e=o.group.depth*12;r.push((0,n.h)(`li`,{class:a.e(`group-label`),key:`__group_${i}`,role:`presentation`,style:e>0?{paddingLeft:`${e}px`}:void 0},o.group.label))}else o.type===`option`&&o.option&&(t+=1,r.push(we(o.option,t)))}return r},Te=()=>{let t=D.value,r=-1,i=[];for(let e of t)r+=+(e.type===`option`),i.push(e.type===`option`?r:-1);return B.visible.value.map(({index:t,data:r,top:o})=>{let s={position:`absolute`,left:0,right:0,top:`${o}px`,height:`${e.virtualItemHeight}px`};if(r.type===`group`&&r.group){let e=r.group.depth*12;return(0,n.h)(`li`,{key:`__group_${t}`,class:a.e(`group-label`),role:`presentation`,style:e>0?{...s,paddingLeft:`${e}px`}:s},r.group.label)}if(r.type===`option`&&r.option){let e=i[t],n=we(r.option,e);return n.props&&(n.props.style=s),n}return null})},Ee=()=>z.value?(0,n.h)(`div`,{ref:f,class:a.e(`virtual`),style:{height:`${B.containerHeight.value}px`,overflow:`auto`,position:`relative`},onScroll:B.onScroll},(0,n.h)(`ul`,{id:c,class:a.e(`list`),role:`listbox`,style:{height:`${B.totalHeight.value}px`,position:`relative`}},Te())):(0,n.h)(`ul`,{id:c,class:a.e(`list`),role:`listbox`,ref:f},Y()),De=()=>{let t=[a.e(`dropdown`),e.popupClassName,e.classNames?.popup].filter(Boolean),r=[oe.value,e.styles?.popup];if(e.loading)return(0,n.h)(`div`,{ref:d,class:t,style:r},(0,n.h)(`div`,{class:a.e(`loading`)},e.loadingText));if(O.value.length===0){let o=i.empty?i.empty():e.noDataText;return(0,n.h)(`div`,{ref:d,class:t,style:r},(0,n.h)(`div`,{class:a.e(`empty`)},o))}return(0,n.h)(`div`,{ref:d,class:t,style:r},Ee())},Oe=()=>{let t=m.value?De():null,r=(0,n.h)(n.Transition,{name:e.transitionName,appear:!0},{default:()=>t});return I.value&&F.value?(0,n.h)(n.Teleport,{to:F.value},[r]):r},ke=(0,n.computed)(()=>{if(!(!m.value||O.value.length===0))return l(h.value)});return()=>(0,n.h)(`div`,{ref:u,class:[se.value,e.classNames?.root],style:e.styles?.root,tabindex:e.disabled?void 0:0,role:`combobox`,"aria-expanded":m.value,"aria-haspopup":`listbox`,"aria-controls":c,"aria-disabled":e.disabled||void 0,"aria-activedescendant":ke.value,onClick:()=>V(!0),onKeydown:ye,onFocus:be,onBlur:xe},[i.prefix?(0,n.h)(`span`,{class:a.e(`prefix`)},i.prefix()):null,(0,n.h)(`div`,{class:[a.e(`selector`),e.classNames?.selector],style:e.styles?.selector},[(0,n.h)(`div`,{class:a.e(`selection`)},x.value?J():Se()),e.clearable&&j.value&&!e.disabled?(0,n.h)(`span`,{class:a.e(`clear`),onClick:ge},i.clearIcon?i.clearIcon():gt(e.clearIcon)??`x`):(0,n.h)(`span`,{class:a.e(`arrow`)},i.suffixIcon?i.suffixIcon():gt(e.suffixIcon)??`v`)]),i.suffix?(0,n.h)(`span`,{class:a.e(`suffix`)},i.suffix()):null,Oe()])}});$.install=function(e){e.component($.name,$)},e.Select=$,e.default={title:`Select 选择器`,category:`数据录入`,status:`100%`,install(e){e.component($.name,$)}}});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@floating-ui/dom`),require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`@floating-ui/dom`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e._floating_ui_dom,e.Vue))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},d=(e,t,n)=>(u(e,t,`default`),n&&u(n,t,`default`));n=((e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);function f(){return typeof window<`u`}function p(e){return h(e)?(e.nodeName||``).toLowerCase():`#document`}function m(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function h(e){return f()?e instanceof Node||e instanceof m(e).Node:!1}var g=l({Vue:()=>n,Vue2:()=>void 0,del:()=>y,install:()=>_,isVue2:()=>!1,isVue3:()=>!0,set:()=>v});d(g,require(`vue`));function _(){}function v(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function y(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function b(e){return typeof e==`object`&&!!e&&`$el`in e}function x(e){if(b(e)){let t=e.$el;return h(t)&&p(t)===`#comment`?null:t}return e}function S(e){return typeof e==`function`?e():(0,g.unref)(e)}function ee(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function te(e,t){let n=ee(e);return Math.round(t*n)/n}function C(e,n,r){r===void 0&&(r={});let i=r.whileElementsMounted,a=(0,g.computed)(()=>S(r.open)??!0),o=(0,g.computed)(()=>S(r.middleware)),s=(0,g.computed)(()=>S(r.placement)??`bottom`),c=(0,g.computed)(()=>S(r.strategy)??`absolute`),l=(0,g.computed)(()=>S(r.transform)??!0),u=(0,g.computed)(()=>x(e.value)),d=(0,g.computed)(()=>x(n.value)),f=(0,g.ref)(0),p=(0,g.ref)(0),m=(0,g.ref)(c.value),h=(0,g.ref)(s.value),_=(0,g.shallowRef)({}),v=(0,g.ref)(!1),y=(0,g.computed)(()=>{let e={position:m.value,left:`0`,top:`0`};if(!d.value)return e;let t=te(d.value,f.value),n=te(d.value,p.value);return l.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...ee(d.value)>=1.5&&{willChange:`transform`}}:{position:m.value,left:t+`px`,top:n+`px`}}),b;function C(){if(u.value==null||d.value==null)return;let e=a.value;(0,t.computePosition)(u.value,d.value,{middleware:o.value,placement:s.value,strategy:c.value}).then(t=>{f.value=t.x,p.value=t.y,m.value=t.strategy,h.value=t.placement,_.value=t.middlewareData,v.value=e!==!1})}function ne(){typeof b==`function`&&(b(),b=void 0)}function w(){if(ne(),i===void 0){C();return}if(u.value!=null&&d.value!=null){b=i(u.value,d.value,C);return}}function T(){a.value||(v.value=!1)}return(0,g.watch)([o,s,c,a],C,{flush:`sync`}),(0,g.watch)([u,d],w,{flush:`sync`}),(0,g.watch)(a,T,{flush:`sync`}),(0,g.getCurrentScope)()&&(0,g.onScopeDispose)(ne),{x:(0,g.shallowReadonly)(f),y:(0,g.shallowReadonly)(p),strategy:(0,g.shallowReadonly)(m),placement:(0,g.shallowReadonly)(h),middlewareData:(0,g.shallowReadonly)(_),isPositioned:(0,g.shallowReadonly)(v),floatingStyles:y,update:C}}var ne=Symbol(`ccuiFormItem`),w=/^[a-z0-9]+(-[a-z0-9]+)*$/,T=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!E(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!E(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!E(e,n)?null:e}return null},E=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function re(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var D=Object.freeze({left:0,top:0,width:16,height:16}),O=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),k=Object.freeze({...D,...O}),A=Object.freeze({...k,body:``,hidden:!1});function j(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function M(e,t){let n=j(e,t);for(let r in A)r in O?r in e&&!(r in n)&&(n[r]=O[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ie(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=M(r[e]||i[e],a)}return o(t),n.forEach(o),M(e,a)}function ae(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=re(e);for(let i in r){let a=r[i];a&&(t(i,ie(e,i,a)),n.push(i))}return n}var N={provider:``,aliases:{},not_found:{},...D};function P(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function F(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!P(e,N))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!P(t,A))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!P(t,A))return null}return t}var oe=Object.create(null);function se(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function I(e,t){let n=oe[e]||(oe[e]=Object.create(null));return n[t]||(n[t]=se(e,t))}function L(e,t){return F(t)?ae(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ce(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var R=!1;function z(e){return typeof e==`boolean`&&(R=e),R}function B(e){let t=typeof e==`string`?T(e,!0,R):e;if(t){let e=I(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function le(e,t){let n=T(e,!0,R);if(!n)return!1;let r=I(n.provider,n.prefix);return t?ce(r,n.name,t):(r.missing.add(n.name),!0)}function V(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),R&&!t&&!e.prefix){let t=!1;return F(e)&&(e.prefix=``,ae(e,(e,n)=>{le(e,n)&&(t=!0)})),t}let n=e.prefix;return E({prefix:n,name:`a`})?!!L(I(t,n),e):!1}var ue=Object.freeze({width:null,height:null}),de=Object.freeze({...ue,...O}),fe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,pe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function me(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(fe);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=pe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function he(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function ge(e,t){return e?`<defs>`+e+`</defs>`+t:t}function _e(e,t,n){let r=he(e);return ge(r.defs,t+r.content+n)}var ve=e=>e===`unset`||e===`undefined`||e===`none`;function ye(e,t){let n={...k,...e},r={...de,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=_e(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=me(d,c/l)):(u=o===`auto`?c:o,d=s===null?me(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ve(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var be=/\sid="(\S+)"/g,xe=new Map;function H(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=xe.get(e)||0;return xe.set(e,t+1),t?`${e}${t}`:e}function Se(e){let t=[],n;for(;n=be.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=H(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var U=Object.create(null);function Ce(e,t){U[e]=t}function W(e){return U[e]||U[``]}function G(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var K=Object.create(null),q=[`https://api.simplesvg.com`,`https://api.unisvg.com`],J=[];q.length>0;)q.length===1||Math.random()>.5?J.push(q.shift()):J.push(q.pop());K[``]=G({resources:[`https://api.iconify.design`].concat(J)});function we(e,t){let n=G(t);return n===null?!1:(K[e]=n,!0)}function Y(e){return K[e]}var Te=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Ee(e,t){let n=Y(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function De(e){return e===404}var Oe=(e,t,n)=>{let r=[],i=Ee(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ke(e){if(typeof e==`string`){let t=Y(e);if(t)return t.path}return`/`}var Ae={prepare:Oe,send:(e,t,n)=>{if(!Te){n(`abort`,424);return}let r=ke(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;Te(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(De(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function je(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||je([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=je.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=I(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?T(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var Ve=Object.create(null);function He(e){if(!Ve[e]){let t=Y(e);if(!t)return;Ve[e]={config:t,redundancy:ze(t)}}return Ve[e]}function Ue(e,t,n){let r,i;if(typeof e==`string`){let t=W(e);if(!t)return n(void 0,424),Be;i=t.send;let a=He(e);a&&(r=a.redundancy)}else{let t=G(e);if(t){r=ze(t);let n=W(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function We(){}function Ge(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ke(e){let t=[],n=[];return e.forEach(e=>{(e.match(w)?t:n).push(e)}),{valid:t,invalid:n}}function X(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!L(e,n).length){r();return}}catch(e){console.error(e)}r(),Ge(e)}function qe(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Je(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){qe(e.loadIcons(r,n,t),t=>{X(e,r,t)});return}if(i){r.forEach(r=>{qe(i(r,n,t),t=>{X(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ke(r);if(o.length&&X(e,o,null),!a.length)return;let s=n.match(w)?W(t):null;if(!s){X(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Ue(t,n,t=>{X(e,n.icons,t)})})}))}var Ye=(e,t)=>{let n=Fe(Ie(e,!0,z()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,We)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(I(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=I(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Je(e,t)}),t?Pe(t,n,i):We};function Xe(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in ue?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Ze=/[\s,]+/;function Qe(e,t){t.split(Ze).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function $e(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function et(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function tt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function nt(e){return`data:image/svg+xml,`+tt(e)}function rt(e){return`url("`+nt(e)+`")`}var it={...de,inline:!1},at={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},ot={display:`inline-block`},st={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={webkitMask:st,mask:st,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var Z={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;Z[e+`-flip`]=t,Z[e.slice(0,1)+`-flip`]=t,Z[e+`Flip`]=t});function dt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var ft=(e,t)=>{let r=Xe(it,t),i={...at},a=t.mode||`svg`,o={},s=t.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:case`customise`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Qe(r,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?r[e]=$e(n):typeof n==`number`&&(r[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete i[`aria-hidden`];break;default:{let t=Z[e];t?(n===!0||n===`true`||n===1)&&(r[t]=!0):it[e]===void 0&&(i[e]=n)}}}let l=ye(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`)return i.style={...o,...c},Object.assign(i,u),i.innerHTML=Se(l.body),(0,n.h)(`svg`,i);let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=et(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":rt(h),width:dt(u.width),height:dt(u.height),...ot,...m?st:ct,...c},(0,n.h)(`span`,i)};if(z(!0),Ce(``,Ae),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!V(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;we(e,r)||console.error(n)}catch{console.error(n)}}}}var pt={...k,body:``},mt=(0,n.defineComponent)((e,{emit:t})=>{let r=(0,n.ref)(null);function i(){r.value&&=(r.value.abort?.(),null)}let a=(0,n.ref)(!!e.ssr),o=(0,n.ref)(``),s=(0,n.shallowRef)(null);function c(){let a=e.icon;if(typeof a==`object`&&a&&typeof a.body==`string`)return o.value=``,{data:a};let s;if(typeof a!=`string`||(s=T(a,!1,!0))===null)return null;let c=B(s);if(!c){let e=r.value;return(!e||e.name!==a)&&(c===null?r.value={name:a}:r.value={name:a,abort:Ye([s],l)}),null}i(),o.value!==a&&(o.value=a,(0,n.nextTick)(()=>{t(`load`,a)}));let u=e.customise;if(u){c=Object.assign({},c);let e=u(c.body,s.name,s.prefix,s.provider);typeof e==`string`&&(c.body=e)}let d=[`iconify`];return s.prefix!==``&&d.push(`iconify--`+s.prefix),s.provider!==``&&d.push(`iconify--`+s.provider),{data:c,classes:d}}function l(){let e=c();e?e.data!==s.value?.data&&(s.value=e):s.value=null}return a.value?l():(0,n.onMounted)(()=>{a.value=!0,l()}),(0,n.watch)(()=>e.icon,l),(0,n.onUnmounted)(i),()=>{let t=s.value;if(!t)return ft(pt,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),ft({...k,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),ht={prefix:`mdi`,icons:{"alert-circle":{width:24,height:24,body:`<path fill="currentColor" d="M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"/>`},"arrow-up":{width:24,height:24,body:`<path fill="currentColor" d="M13 20h-2V8l-5.5 5.5l-1.42-1.42L12 4.16l7.92 7.92l-1.42 1.42L13 8v12Z"/>`},"calendar-outline":{width:24,height:24,body:`<path fill="currentColor" d="M12 12h5v5h-5v-5m7-9h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 2v2H5V5h14M5 19V9h14v10H5Z"/>`},check:{width:24,height:24,body:`<path fill="currentColor" d="M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59L21 7Z"/>`},"check-circle":{width:24,height:24,body:`<path fill="currentColor" d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2m-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9Z"/>`},"chevron-right":{width:24,height:24,body:`<path fill="currentColor" d="M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6l-1.41-1.42Z"/>`},"clock-outline":{width:24,height:24,body:`<path fill="currentColor" d="M12 20a8 8 0 0 0 8-8a8 8 0 0 0-8-8a8 8 0 0 0-8 8a8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10a10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67l-.75 1.23L11 13V7h1.5Z"/>`},close:{width:24,height:24,body:`<path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z"/>`},"close-circle":{width:24,height:24,body:`<path fill="currentColor" d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"/>`},"content-copy":{width:24,height:24,body:`<path fill="currentColor" d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"/>`},loading:{width:24,height:24,body:`<path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z"/>`},magnify:{width:24,height:24,body:`<path fill="currentColor" d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5Z"/>`},"menu-down":{width:24,height:24,body:`<path fill="currentColor" d="m7 10l5 5l5-5H7Z"/>`},"menu-right":{width:24,height:24,body:`<path fill="currentColor" d="m10 17l5-5l-5-5v10Z"/>`}}},gt=!1;function _t(){gt||=(V(ht),!0)}_t();function vt(e){return e.includes(`:`)}function yt(e){return e?typeof e==`string`?vt(e)?(0,n.h)(mt,{icon:e}):(0,n.h)(`i`,{class:e}):e:null}function Q(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function bt(e,t=!1){let n=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>Q(n),e:e=>e?Q(n,e):``,m:e=>e?Q(n,``,e):``,em:(e,t)=>e&&t?Q(n,e,t):``,is:e=>`is-${e}`}}function xt(e,t){let r=(0,n.ref)(0),i=t.buffer??4,a=(0,n.computed)(()=>e.value.length*t.itemHeight),o=(0,n.computed)(()=>Math.min(t.maxHeight,a.value));return{scrollTop:r,onScroll:e=>{r.value=e.currentTarget.scrollTop},visible:(0,n.computed)(()=>{let n=e.value;if(n.length===0)return[];let a=Math.max(0,Math.floor(r.value/t.itemHeight)-i),s=Math.ceil(o.value/t.itemHeight)+i*2,c=Math.min(n.length,a+s),l=[];for(let e=a;e<c;e+=1)l.push({index:e,data:n[e],top:e*t.itemHeight});return l}),totalHeight:a,containerHeight:o,scrollToIndex:(e,n)=>{if(!n)return;let i=e*t.itemHeight;i<r.value?n.scrollTop=i:i+t.itemHeight>r.value+o.value&&(n.scrollTop=i-o.value+t.itemHeight)}}}var St={label:`label`,value:`value`,disabled:`disabled`,options:`options`};function Ct(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}function wt(e){return typeof e==`object`&&!!e&&`value`in e}function Tt(e){if(wt(e))return e.value;if(typeof e==`string`||typeof e==`number`)return e}function Et(e){if(Array.isArray(e))return e.map(Tt).filter(e=>e!==void 0);if(e==null||e===``)return[];let t=Tt(e);return t===void 0?[]:[t]}function Dt(e,t){let n=e[t];return Array.isArray(n)}function Ot(e){return e.mode?e.mode:e.multiple?`multiple`:`default`}function kt(e,t,n){return{raw:e,label:e[t.label],value:e[t.value],disabled:!!e[t.disabled],groupPath:n}}function At(e,t,n){if(!t||n===!1)return e;if(typeof n==`function`)return e.filter(e=>n(t,e.raw));let r=t.toLowerCase();return e.filter(e=>Ct(e.label).toLowerCase().includes(r)||Ct(e.value).toLowerCase().includes(r))}function jt(e,t,n=[],r=[]){for(let i of e)if(Dt(i,t.options)){let e=[...n,i[t.label]];jt(i[t.options],t,e,r)}else r.push(kt(i,t,n));return r}function Mt(e,t,n,r,i,a){let o=!1;for(let s of e)if(Dt(s,t.options)){let e=s[t.options],c=a.length;a.push({type:`group`,group:{label:s[t.label],depth:i}}),Mt(e,t,n,r,i+1,a)?o=!0:a.splice(c,a.length-c)}else{let e=At([kt(s,t,[])],n,r);for(let t of e)a.push({type:`option`,option:t}),o=!0}return o}function Nt(e,t,r){let i=(0,n.computed)(()=>({...St,...e.fieldNames})),a=(0,n.computed)(()=>Ot(e)),o=(0,n.computed)(()=>a.value===`multiple`||a.value===`tags`),s=(0,n.computed)(()=>jt(e.options,i.value)),c=(0,n.computed)(()=>Et(e.modelValue)),l=(0,n.computed)(()=>{let e=new Map;for(let t of s.value)e.set(t.value,t);return c.value.map(t=>e.get(t)||{raw:{[i.value.label]:t,[i.value.value]:t},label:t,value:t,disabled:!1,groupPath:[]})}),u=t=>{if(e.optionLabelProp){let n=t.raw[e.optionLabelProp];if(n!==void 0)return n}return t.label},d=(0,n.computed)(()=>{let e=l.value[0];return e?u(e):``}),f=(0,n.computed)(()=>{let n=i.value,r=t.value.trim(),a=e.filterable||e.showSearch?e.filterOption:!1,o=[];return Mt(e.options,n,r,a,0,o),o}),p=(0,n.computed)(()=>f.value.filter(e=>e.type===`option`).map(e=>e.option)),m=(0,n.computed)(()=>new Set(c.value)),h=t=>{if(t!==void 0)return e.labelInValue?{value:t,label:s.value.find(e=>e.value===t)?.label??t}:t},g=t=>{let n;n=t===void 0?void 0:Array.isArray(t)?e.labelInValue?t.map(e=>h(e)):t:e.labelInValue?h(t):t,r(`update:modelValue`,n),r(`change`,n)},_=()=>!o.value||!e.maxCount||e.maxCount<=0?!1:c.value.length>=e.maxCount;return{addTagValue:e=>{if(a.value!==`tags`)return!1;let t=e.trim();return!t||c.value.includes(t)||_()?!1:(g(c.value.concat(t)),!0)},clearValue:()=>{o.value?g([]):g(void 0)},displayLabelOf:u,fieldNames:i,isMultiple:o,mode:a,removeValue:e=>{o.value&&g(c.value.filter(t=>t!==e))},reorderTagValue:(e,t)=>{if(!o.value)return;let n=[...c.value],r=n.indexOf(e),i=n.indexOf(t);r<0||i<0||r===i||(n.splice(r,1),n.splice(i,0,e),g(n))},selectOption:e=>{if(e.disabled)return;if(!o.value){g(e.value);return}let t=c.value.includes(e.value);!t&&_()||g(t?c.value.filter(t=>t!==e.value):c.value.concat(e.value))},selectedLabel:d,selectedOptions:l,selectedValueSet:m,selectedValues:c,visibleFlatOptions:f,visibleOptions:p}}var Pt={modelValue:{type:[String,Number,Array,Object],default:void 0},options:{type:Array,default:()=>[]},fieldNames:{type:Object,default:()=>({})},mode:{type:String,default:void 0},placement:{type:String,default:`bottom`},filterOption:{type:[Boolean,Function],default:!0},popupClassName:{type:String,default:``},getPopupContainer:{type:Function,default:void 0},popupAppendToBody:{type:Boolean,default:!1},placeholder:{type:String,default:`Please select`},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},clearIcon:{type:[String,Object],default:void 0},suffixIcon:{type:[String,Object],default:void 0},removeIcon:{type:[String,Object],default:void 0},multiple:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,default:`default`},noDataText:{type:String,default:`No data`},loadingText:{type:String,default:`Loading...`},maxTagCount:{type:Number,default:3},maxCount:{type:Number,default:0},status:{type:String,default:``},labelInValue:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},defaultActiveFirstOption:{type:Boolean,default:!0},highlightMatch:{type:Boolean,default:!1},virtualScroll:{type:Boolean,default:!1},virtualItemHeight:{type:Number,default:32},virtualMaxHeight:{type:Number,default:240},optionLabelProp:{type:String,default:``},showSearch:{type:Boolean,default:!1},transitionName:{type:String,default:`ccui-select-fade`},tagsDraggable:{type:Boolean,default:!1},variant:{type:String,default:`outlined`},classNames:{type:Object,default:void 0},styles:{type:Object,default:void 0}},Ft=0;function It(e,t){if(!t)return Lt(e);let r=Lt(e),i=r.toLowerCase().indexOf(t.toLowerCase());return i<0?r:(0,n.h)(`span`,null,[r.slice(0,i),(0,n.h)(`mark`,{class:`ccui-select__highlight`},r.slice(i,i+t.length)),r.slice(i+t.length)])}function Lt(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}var $=(0,n.defineComponent)({name:`CSelect`,props:Pt,emits:[`update:modelValue`,`change`,`search`,`visible-change`,`clear`,`focus`,`blur`],setup(e,{emit:r,slots:i}){let a=bt(`select`),o=(0,n.getCurrentInstance)();Ft+=1;let s=`${o?.uid??Ft}-${Ft}`,c=`ccui-select-listbox-${s}`,l=e=>`ccui-select-option-${s}-${e}`,u=(0,n.ref)(null),d=(0,n.ref)(null),f=(0,n.ref)(null),p=(0,n.ref)(null),m=(0,n.shallowRef)(!1),h=(0,n.shallowRef)(0),g=(0,n.shallowRef)(``),_=(0,n.inject)(ne,null),{addTagValue:v,clearValue:y,displayLabelOf:b,isMultiple:x,mode:S,removeValue:ee,reorderTagValue:te,selectOption:w,selectedLabel:T,selectedOptions:E,selectedValueSet:re,visibleFlatOptions:D,visibleOptions:O}=Nt(e,g,r),k=(0,n.shallowRef)(null),A=(0,n.shallowRef)(null),j=(0,n.computed)(()=>E.value.length>0),M=(0,n.computed)(()=>E.value.slice(0,e.maxTagCount)),ie=(0,n.computed)(()=>Math.max(E.value.length-M.value.length,0)),ae=(0,n.computed)(()=>e.filterable||e.showSearch),N=(0,n.computed)(()=>ae.value||S.value===`tags`),P=(0,n.computed)(()=>e.placement===`auto`?`bottom-start`:`${e.placement}-start`),F=(0,n.computed)(()=>typeof document>`u`?null:e.getPopupContainer?e.getPopupContainer(u.value):e.popupAppendToBody?document.body:null),oe=(0,n.computed)(()=>F.value!==null),{floatingStyles:se}=C(u,d,{placement:P,open:m,whileElementsMounted:t.autoUpdate,middleware:[(0,t.offset)(4),(0,t.flip)(),(0,t.shift)({padding:8})],strategy:(0,n.computed)(()=>oe.value?`fixed`:`absolute`)}),I=(0,n.computed)(()=>_?.validateStatus.value??``),L=(0,n.computed)(()=>e.status||I.value),ce=(0,n.computed)(()=>({[a.b()]:!0,[a.m(e.size)]:!!e.size,[a.m(`open`)]:m.value,[a.m(`disabled`)]:e.disabled,[a.m(`multiple`)]:x.value,[a.m(`tags`)]:S.value===`tags`,[a.m(L.value)]:!!L.value,[a.m(`variant-${e.variant}`)]:!!e.variant})),R=(0,n.computed)(()=>e.virtualScroll&&D.value.filter(e=>e.type===`option`).length>0),z=xt((0,n.computed)(()=>D.value),{itemHeight:e.virtualItemHeight,maxHeight:e.virtualMaxHeight}),B=t=>{e.disabled||m.value===t||(m.value=t,r(`visible-change`,t),t&&(e.defaultActiveFirstOption&&(h.value=V()),N.value&&(0,n.nextTick)(()=>p.value?.focus())),t||(g.value=``,_&&_.validate(`blur`)))},le=e=>{let t=e.target;u.value?.contains(t)||d.value?.contains(t)||B(!1)};(0,n.onMounted)(()=>{document.addEventListener(`mousedown`,le),e.autoFocus&&(0,n.nextTick)(()=>u.value?.focus())}),(0,n.onUnmounted)(()=>{document.removeEventListener(`mousedown`,le)});let V=()=>{let e=O.value.findIndex(e=>!e.disabled);return e<0?0:e};(0,n.watch)(()=>O.value.length,()=>{e.defaultActiveFirstOption?h.value=V():h.value=0}),(0,n.watch)(()=>e.modelValue,()=>{_&&_.validate(`change`)});let ue=e=>{let t=O.value;if(t.length===0)return 0;let n=h.value;for(let r=1;r<=t.length;r+=1){let i=(n+r*e+t.length)%t.length;if(!t[i].disabled)return i}return n},de=e=>{let t=O.value;if(t.length===0)return 0;if(e===1){for(let e=t.length-1;e>=0;--e)if(!t[e].disabled)return e}else for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e;return h.value},fe=t=>{let n=Math.max(1,Math.floor(e.virtualMaxHeight/e.virtualItemHeight)),r=O.value;if(r.length===0)return h.value;let i=h.value+t*n;for(i=Math.max(0,Math.min(r.length-1,i));i>=0&&i<r.length&&r[i].disabled;)i+=t;return(i<0||i>=r.length)&&(i=h.value),i},pe=()=>{if(!R.value||!f.value)return;let e=D.value,t=-1,n=0;for(let r=0;r<e.length;r+=1)if(e[r].type===`option`&&(t+=1,t===h.value)){n=r;break}z.scrollToIndex(n,f.value)};(0,n.watch)(h,()=>{(0,n.nextTick)(pe)});let me=e=>{let t=e.target.value;g.value=t,r(`search`,t),B(!0)},he=e=>{e.disabled||(w(e),x.value||B(!1),N.value&&(g.value=``))},ge=e=>{e.stopPropagation(),y(),r(`clear`),B(!1)},_e=(e,t)=>{t.stopPropagation(),ee(e)},ve=()=>{if(S.value!==`tags`)return!1;let e=v(g.value);return e&&(g.value=``),e},ye=t=>{if(!e.disabled){if(t.key===`Escape`){B(!1);return}if(t.key===`Enter`){if(!m.value){B(!0);return}let e=O.value[h.value];if(e&&(O.value.length>0||S.value!==`tags`)){he(e);return}S.value===`tags`&&ve();return}if(t.key===`Backspace`&&x.value&&!g.value&&j.value){let e=E.value[E.value.length-1]?.value;e!==void 0&&ee(e);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),B(!0),h.value=de(t.key===`Home`?-1:1);return}if(t.key===`PageUp`||t.key===`PageDown`){t.preventDefault(),B(!0),h.value=fe(t.key===`PageDown`?1:-1);return}t.key!==`ArrowDown`&&t.key!==`ArrowUp`||(t.preventDefault(),B(!0),O.value.length!==0&&(h.value=ue(t.key===`ArrowDown`?1:-1)))}},be=e=>{r(`focus`,e)},xe=e=>{r(`blur`,e)},H=t=>(0,n.h)(`input`,{ref:p,class:a.e(`search`),value:g.value,placeholder:t,disabled:e.disabled,"aria-autocomplete":`list`,"aria-controls":c,onInput:me,onKeydown:ye}),Se=()=>{if(N.value&&m.value)return H(j.value?Lt(T.value):e.placeholder);let t=j.value?i.selected?i.selected({option:E.value[0]}):T.value:e.placeholder;return(0,n.h)(`span`,{class:j.value?a.e(`single`):a.e(`placeholder`)},t)},U=(t,n)=>{if(!e.tagsDraggable||n.disabled){t.preventDefault();return}k.value=n.value,t.dataTransfer?.setData(`text/plain`,String(n.value))},Ce=(t,n)=>{!e.tagsDraggable||k.value===null||(t.preventDefault(),A.value=n.value)},W=(t,n)=>{if(!e.tagsDraggable||k.value===null)return;t.preventDefault();let r=k.value;r!==n.value&&te(r,n.value),k.value=null,A.value=null},G=()=>{k.value=null,A.value=null},K=t=>{if(i.tag)return i.tag({option:t,onClose:e=>_e(t.value,e)});let r=b(t);return(0,n.h)(`span`,{class:[a.e(`tag`),e.tagsDraggable&&a.em(`tag`,`draggable`),A.value===t.value&&a.em(`tag`,`drop-over`),k.value===t.value&&a.em(`tag`,`dragging`)],key:t.value,draggable:e.tagsDraggable&&!t.disabled?!0:void 0,onDragstart:e=>U(e,t),onDragover:e=>Ce(e,t),onDrop:e=>W(e,t),onDragend:G},[(0,n.h)(`span`,{class:a.e(`tag-label`)},r),(0,n.h)(`span`,{class:a.e(`tag-close`),onClick:e=>_e(t.value,e)},i.removeIcon?i.removeIcon():yt(e.removeIcon)??`x`)])},q=(e=[])=>(0,n.h)(`div`,{class:a.e(`tags`)},[...M.value.map(K),...ie.value>0?[(0,n.h)(`span`,{class:a.e(`tag`),key:`__more`},`+${ie.value}`)]:[],...e]),J=()=>j.value?q(N.value&&m.value?[H(``)]:[]):N.value&&m.value?H(e.placeholder):(0,n.h)(`span`,{class:a.e(`placeholder`)},e.placeholder),we=(t,r)=>{let o=re.value.has(t.value),s=e.highlightMatch?It(t.label,g.value.trim()):t.label,c=i.option?i.option({option:t,selected:o}):[(0,n.h)(`span`,null,s),o?(0,n.h)(`span`,{class:a.e(`check`)},`*`):null];return(0,n.h)(`li`,{key:t.value,id:l(r),class:[a.e(`option`),r===h.value&&a.em(`option`,`active`),o&&a.em(`option`,`selected`),t.disabled&&a.em(`option`,`disabled`)],role:`option`,"aria-selected":o,"aria-disabled":t.disabled||void 0,onMouseenter:()=>{t.disabled||(h.value=r)},onClick:e=>{e.stopPropagation(),he(t)}},c)},Y=()=>{let e=D.value,t=-1,r=[];for(let i=0;i<e.length;i+=1){let o=e[i];if(o.type===`group`&&o.group){let e=o.group.depth*12;r.push((0,n.h)(`li`,{class:a.e(`group-label`),key:`__group_${i}`,role:`presentation`,style:e>0?{paddingLeft:`${e}px`}:void 0},o.group.label))}else o.type===`option`&&o.option&&(t+=1,r.push(we(o.option,t)))}return r},Te=()=>{let t=D.value,r=-1,i=[];for(let e of t)r+=+(e.type===`option`),i.push(e.type===`option`?r:-1);return z.visible.value.map(({index:t,data:r,top:o})=>{let s={position:`absolute`,left:0,right:0,top:`${o}px`,height:`${e.virtualItemHeight}px`};if(r.type===`group`&&r.group){let e=r.group.depth*12;return(0,n.h)(`li`,{key:`__group_${t}`,class:a.e(`group-label`),role:`presentation`,style:e>0?{...s,paddingLeft:`${e}px`}:s},r.group.label)}if(r.type===`option`&&r.option){let e=i[t],n=we(r.option,e);return n.props&&(n.props.style=s),n}return null})},Ee=()=>R.value?(0,n.h)(`div`,{ref:f,class:a.e(`virtual`),style:{height:`${z.containerHeight.value}px`,overflow:`auto`,position:`relative`},onScroll:z.onScroll},(0,n.h)(`ul`,{id:c,class:a.e(`list`),role:`listbox`,"aria-multiselectable":x.value||void 0,style:{height:`${z.totalHeight.value}px`,position:`relative`}},Te())):(0,n.h)(`ul`,{id:c,class:a.e(`list`),role:`listbox`,"aria-multiselectable":x.value||void 0,ref:f},Y()),De=()=>{let t=[a.e(`dropdown`),e.popupClassName,e.classNames?.popup].filter(Boolean),r=[se.value,e.styles?.popup];if(e.loading)return(0,n.h)(`div`,{ref:d,class:t,style:r},(0,n.h)(`div`,{class:a.e(`loading`)},e.loadingText));if(O.value.length===0){let o=i.empty?i.empty():e.noDataText;return(0,n.h)(`div`,{ref:d,class:t,style:r},(0,n.h)(`div`,{class:a.e(`empty`)},o))}return(0,n.h)(`div`,{ref:d,class:t,style:r},Ee())},Oe=()=>{let t=m.value?De():null,r=(0,n.h)(n.Transition,{name:e.transitionName,appear:!0},{default:()=>t});return oe.value&&F.value?(0,n.h)(n.Teleport,{to:F.value},[r]):r},ke=(0,n.computed)(()=>{if(!(!m.value||O.value.length===0))return l(h.value)});return()=>(0,n.h)(`div`,{ref:u,class:[ce.value,e.classNames?.root],style:e.styles?.root,tabindex:e.disabled?void 0:0,role:`combobox`,"aria-expanded":m.value,"aria-haspopup":`listbox`,"aria-controls":c,"aria-disabled":e.disabled||void 0,"aria-activedescendant":ke.value,onClick:()=>B(!0),onKeydown:ye,onFocus:be,onBlur:xe},[i.prefix?(0,n.h)(`span`,{class:a.e(`prefix`)},i.prefix()):null,(0,n.h)(`div`,{class:[a.e(`selector`),e.classNames?.selector],style:e.styles?.selector},[(0,n.h)(`div`,{class:a.e(`selection`)},x.value?J():Se()),e.clearable&&j.value&&!e.disabled?(0,n.h)(`span`,{class:a.e(`clear`),onClick:ge},i.clearIcon?i.clearIcon():yt(e.clearIcon)??`x`):(0,n.h)(`span`,{class:a.e(`arrow`)},i.suffixIcon?i.suffixIcon():yt(e.suffixIcon)??`v`)]),i.suffix?(0,n.h)(`span`,{class:a.e(`suffix`)},i.suffix()):null,Oe()])}});$.install=function(e){e.component($.name,$)},e.Select=$,e.default={title:`Select 选择器`,category:`数据录入`,status:`100%`,install(e){e.component($.name,$)}}});
|