@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/form/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function r(e,t=!1){let r=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>n(r),e:e=>e?n(r,e):``,m:e=>e?n(r,``,e):``,em:(e,t)=>e&&t?n(r,e,t):``,is:e=>`is-${e}`}}var i=Symbol(`ccuiForm`),a=Symbol(`ccuiFormItem`),o=Symbol(`ccuiFormList`),s=Symbol(`ccuiFormProvider`),c={model:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},initialValues:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:``},labelPosition:{type:String,default:`right`},disabled:{type:Boolean,default:!1},layout:{type:String,default:`horizontal`},colon:{type:Boolean,default:!0},requiredMark:{type:[Boolean,String],default:!0},validateMessages:{type:Object,default:()=>({})},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{type:[Boolean,Object],default:!1},name:{type:String,default:``},preserve:{type:Boolean,default:!0},labelCol:{type:Object,default:void 0},wrapperCol:{type:Object,default:void 0},hasFeedback:{type:Boolean,default:!1}},l={name:{type:[String,Number,Array],default:void 0},label:{type:String,default:``},prop:{type:[String,Number,Array],default:void 0},initialValue:{type:null,default:void 0},required:{type:Boolean,default:!1},rules:{type:[Object,Array,Function],default:void 0},help:{type:String,default:``},validateStatus:{type:String,default:``},extra:{type:String,default:``},htmlFor:{type:String,default:``},colon:{type:Boolean,default:void 0},hidden:{type:Boolean,default:!1},noStyle:{type:Boolean,default:!1},dependencies:{type:Array,default:()=>[]},preserve:{type:Boolean,default:void 0},shouldUpdate:{type:[Boolean,Function],default:void 0},hasFeedback:{type:Boolean,default:void 0},labelCol:{type:Object,default:void 0},wrapperCol:{type:Object,default:void 0},validateDebounce:{type:Number,default:0},normalize:{type:Function,default:void 0}},u={name:{type:[String,Number,Array],required:!0},initialValue:{type:Array,default:void 0}},d={};function f(e){return e==null||e===``?[]:Array.isArray(e)?[...e]:typeof e==`number`?[e]:e.replace(/\[(\w+)\]/g,`.$1`).split(`.`).filter(Boolean)}function p(e){return f(e).join(`.`)}function m(e,t){let n=f(t);if(n.length!==0)return n.reduce((e,t)=>e?.[t],e)}function h(e,t,n){let r=f(t),i=r.pop();if(i===void 0)return;let a=r.reduce((e,t)=>((!e[t]||typeof e[t]!=`object`)&&(e[t]={}),e[t]),e);a[i]=n}function g(e,t){let n=f(t);if(n.length===0)return;let r=n.pop(),i=e;for(let e of n){if(i?.[e]===void 0||i[e]===null)return;i=i[e]}i&&typeof i==`object`&&(Array.isArray(i)&&typeof r==`number`?i.splice(r,1):delete i[r])}function _(e){if(e==null)return e;if(typeof structuredClone==`function`)try{return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))}function v(e){return e?Array.isArray(e)?e:[e]:[]}function y(e,t){return t?e.filter(e=>e.trigger?(Array.isArray(e.trigger)?e.trigger:[e.trigger]).includes(t):!0):e}function b(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function x(e,t){return b(t)||!e.type?!0:e.type===`email`?typeof t==`string`&&/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t):e.type===`url`?typeof t==`string`&&/^https?:\/\/\S+$/i.test(t):e.type===`array`?Array.isArray(t):e.type===`object`?typeof t==`object`&&!Array.isArray(t):typeof t===e.type}function S(e){if(typeof e==`string`||Array.isArray(e))return e.length;if(typeof e==`number`)return e}var C={default:"${label} is invalid",required:"${label} is required",enum:"${label} must be one of ${enum}",whitespace:"${label} cannot be empty",pattern:"${label} is invalid",types:{string:"${label} is not a valid string",number:"${label} is not a valid number",boolean:"${label} is not a valid boolean",array:"${label} is not a valid array",object:"${label} is not a valid object",email:"${label} is not a valid email",url:"${label} is not a valid url"},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min} and ${max} characters"},number:{len:"${label} must equal ${len}",min:"${label} must be at least ${min}",max:"${label} must be up to ${max}",range:"${label} must be between ${min} and ${max}"},array:{len:"${label} must contain ${len} items",min:"${label} must contain at least ${min} items",max:"${label} must contain up to ${max} items",range:"${label} must contain between ${min} and ${max} items"}};function w(e,t){return e.replace(/\$\{(\w+)\}/g,(e,n)=>String(t[n]??``))}function T(e,t,n,r,i,a){if(e.message)return e.message;let o={...C,...r,types:{...C.types,...r.types},string:{...C.string,...r.string},number:{...C.number,...r.number},array:{...C.array,...r.array}};return w((a&&i&&typeof o[i]==`object`?o[i]?.[a]:void 0)||(i===`types`&&e.type?o.types?.[e.type]:void 0)||(i?o[i]:void 0)||o.default||"${label} is invalid",{label:n||t,name:t,field:t,enum:e.enum?.join(`, `),len:e.len,min:e.min,max:e.max})}function E(e,t){return e.type===`array`||Array.isArray(t)?`array`:typeof t==`number`?`number`:`string`}async function ee(e,t,n,r,i=r,a={}){if(e.required&&b(t))return{field:r,message:T(e,r,i,a,`required`)};if(e.whitespace&&typeof t==`string`&&t.trim()===``)return{field:r,message:T(e,r,i,a,`whitespace`)};if(e.enum&&!b(t)&&!e.enum.includes(t))return{field:r,message:T(e,r,i,a,`enum`)};if(!x(e,t))return{field:r,message:T(e,r,i,a,`types`)};let o=S(t);if(o!==void 0){let n=E(e,t);if(e.len!==void 0&&o!==e.len)return{field:r,message:T(e,r,i,a,n,`len`)};if(e.min!==void 0&&e.max!==void 0&&(o<e.min||o>e.max))return{field:r,message:T(e,r,i,a,n,`range`)};if(e.min!==void 0&&o<e.min)return{field:r,message:T(e,r,i,a,n,`min`)};if(e.max!==void 0&&o>e.max)return{field:r,message:T(e,r,i,a,n,`max`)}}if(e.pattern&&!e.pattern.test(String(t)))return{field:r,message:T(e,r,i,a,`pattern`)};if(e.validator){let o=await e.validator(e,t,n);if(o===!1)return{field:r,message:T(e,r,i,a)};if(typeof o==`string`)return{field:r,message:o};if(o instanceof Error)return{field:r,message:o.message}}return null}var D=(0,t.defineComponent)({name:`CForm`,props:c,emits:[`submit`,`validate`,`validate-failed`,`values-change`],setup(e,{emit:n,expose:a,slots:o}){let c=r(`form`),l=(0,t.ref)([]),u=(0,t.inject)(s,null),d=e=>{if(e===void 0)return l.value;if(!Array.isArray(e)){let t=p(e);return l.value.filter(e=>e.field===t)}let t=p(e);if(l.value.some(e=>e.field===t))return l.value.filter(e=>e.field===t);let n=new Set(e.map(e=>p(e)));return l.value.filter(e=>n.has(e.field))},f=e=>{e.field&&!l.value.includes(e)&&l.value.push(e)},m=e=>{l.value=l.value.filter(t=>t!==e)},h=(e,t,r)=>{n(`validate`,e,t,r)},g=(t,r)=>{n(`values-change`,{name:t,value:r},e.model),e.name&&u&&u.triggerFormChange(e.name,[{name:t,value:r}])},_=(0,t.computed)(()=>({[c.b()]:!0,[c.m(`label-${e.labelPosition}`)]:!!e.labelPosition,[c.m(e.layout)]:!!e.layout,[c.m(`disabled`)]:e.disabled})),v=async t=>{let r=[];for(let e of l.value)!await e.validate()&&e.prop&&r.push({field:e.field,message:e.getValidateMessage()});let i=r.length===0;return t?.(i,r),i||(n(`validate-failed`,r),e.scrollToFirstError&&S(r[0].field,e.scrollToFirstError===!0?void 0:e.scrollToFirstError)),i},y=async(e,t)=>{let n=d(e);return(await Promise.all(n.map(e=>e.validate(t)))).every(Boolean)},b=e=>{d(e).forEach(e=>e.resetField())},x=e=>{d(e).forEach(e=>e.clearValidate())},S=(e,t)=>{d(e)[0]?.getElement()?.scrollIntoView(t??{block:`nearest`})},C=()=>e.model,w=async t=>{t.preventDefault();let r=await v();n(`submit`,r,t),r&&e.name&&u&&u.triggerFormFinish(e.name,e.model)};(0,t.watch)(()=>e.rules,()=>{e.validateOnRuleChange&&x()}),(0,t.watch)(()=>e.model,()=>{l.value.forEach(e=>{e.dependencies.length>0&&e.validate()})},{deep:!0});let T={validate:v,validateField:y,resetFields:b,clearValidate:x,scrollToField:S,getFieldsValue:C};return a(T),(0,t.onMounted)(()=>{e.name&&u&&u.registerForm(e.name,T)}),(0,t.onUnmounted)(()=>{e.name&&u&&u.unregisterForm(e.name)}),(0,t.provide)(i,{model:(0,t.toRef)(e,`model`),rules:(0,t.toRef)(e,`rules`),initialValues:(0,t.toRef)(e,`initialValues`),validateMessages:(0,t.toRef)(e,`validateMessages`),disabled:(0,t.toRef)(e,`disabled`),labelWidth:(0,t.toRef)(e,`labelWidth`),labelPosition:(0,t.toRef)(e,`labelPosition`),layout:(0,t.toRef)(e,`layout`),colon:(0,t.toRef)(e,`colon`),requiredMark:(0,t.toRef)(e,`requiredMark`),preserve:(0,t.toRef)(e,`preserve`),labelCol:(0,t.toRef)(e,`labelCol`),wrapperCol:(0,t.toRef)(e,`wrapperCol`),hasFeedback:(0,t.toRef)(e,`hasFeedback`),addField:f,removeField:m,emitValidate:h,validateField:y,notifyFieldChange:g}),()=>(0,t.h)(`form`,{class:_.value,novalidate:!0,onSubmit:w},o.default?.())}}),O=new Set;function te(e,t,n){let r=`${e}.${t}`;O.has(r)||(O.add(r),typeof console<`u`&&console.warn(`[ccui][${e}] ${t} 已 deprecated,请改用 ${n}。`))}function ne(e,t,n){return e?Object.prototype.hasOwnProperty.call(e,t)||Object.prototype.hasOwnProperty.call(e,n):!1}function k(e){if(!e)return{};let t={};return e.flex!==void 0&&(t.flex=typeof e.flex==`number`?`${e.flex} ${e.flex} auto`:e.flex),e.span!==void 0&&(t.width=`${e.span/24*100}%`),e.offset!==void 0&&e.offset>0&&(t.marginInlineStart=`${e.offset/24*100}%`),t}var A=(0,t.defineComponent)({name:`CFormItem`,props:l,setup(e,{expose:n,slots:s}){let c=r(`form-item`),l=(0,t.getCurrentInstance)()?.vnode.props;ne(l,`prop`,`prop`)&&te(`FormItem`,`prop`,`name`);let u=(0,t.inject)(i,null),d=(0,t.inject)(o,null),b=(0,t.ref)(``),x=(0,t.ref)(``),S=(0,t.ref)(!1),C=(0,t.ref)(null),w=(0,t.computed)(()=>e.name??e.prop),T=(0,t.computed)(()=>{let e=w.value;if(!d)return e;let t=d.prefixName.value;return e==null||e===``?t.length?[...t]:void 0:[...t,...f(e)]}),E=(0,t.computed)(()=>p(T.value)),D=(0,t.computed)(()=>e.label||E.value),O=(0,t.ref)(),A=()=>{if(e.initialValue!==void 0)return e.initialValue;let t=u?m(u.initialValues.value,T.value):void 0;return t===void 0?u?m(u.model.value,T.value):void 0:t},j=()=>{let t=e.rules;return typeof t==`function`?t(u?.model.value??{}):t},M=(0,t.computed)(()=>{let t=[...v(u?.rules.value?.[E.value]),...v(j())];return e.required&&!t.some(e=>e.required)&&t.unshift({required:!0}),t}),N=(0,t.computed)(()=>e.required||M.value.some(e=>e.required)),P=(0,t.computed)(()=>e.validateStatus?e.validateStatus:S.value?`warning`:b.value),F=(0,t.computed)(()=>x.value||e.help),I=(0,t.computed)(()=>!N.value&&u?.requiredMark.value===`optional`),L=(0,t.computed)(()=>N.value&&u?.requiredMark.value!==!1),R=(0,t.computed)(()=>e.colon??u?.colon.value??!0),z=(0,t.computed)(()=>e.hasFeedback===void 0?!!u?.hasFeedback.value:e.hasFeedback),B=(0,t.computed)(()=>e.labelCol??u?.labelCol.value),V=(0,t.computed)(()=>e.wrapperCol??u?.wrapperCol.value),H=(0,t.computed)(()=>B.value?k(B.value):!u?.labelWidth.value||u.labelPosition.value===`top`||u.layout.value===`vertical`?{}:{width:typeof u.labelWidth.value==`number`?`${u.labelWidth.value}px`:u.labelWidth.value}),U=(0,t.computed)(()=>k(V.value)),W=(0,t.computed)(()=>({[c.b()]:!0,[c.m(P.value)]:!!P.value,[c.m(`required`)]:L.value,[c.m(`optional`)]:I.value,[c.m(`no-style`)]:e.noStyle,[c.m(`hidden`)]:e.hidden,[c.m(`top`)]:u?.labelPosition.value===`top`||u?.layout.value===`vertical`})),G=()=>{b.value=``,x.value=``,S.value=!1},K=null,q=async e=>{if(!E.value||!u)return!0;let t=y(M.value,e);if(t.length===0)return G(),!0;b.value=`validating`;let n=m(u.model.value,T.value),r=``;for(let e of t){let t=await ee(e,n,u.model.value,E.value,D.value,u.validateMessages.value);if(t){if(e.warningOnly){r=t.message;continue}return b.value=`error`,x.value=t.message,u.emitValidate(E.value,!1,t.message),!1}}return r?(b.value=`success`,x.value=r,S.value=!0,u.emitValidate(E.value,!0,r),!0):(S.value=!1,b.value=`success`,x.value=``,u.emitValidate(E.value,!0,``),!0)},J=async t=>e.validateDebounce>0?(K&&clearTimeout(K),new Promise(n=>{K=setTimeout(()=>{q(t).then(n)},e.validateDebounce)})):q(t),Y=()=>{E.value&&u&&h(u.model.value,T.value,_(O.value)),G()},X={get prop(){return T.value},get field(){return E.value},get dependencies(){return e.dependencies},validate:J,resetField:Y,clearValidate:G,getValidateMessage:()=>x.value,getElement:()=>C.value},Z=t=>{if(e.normalize&&u&&T.value!==void 0){let t=m(u.model.value,T.value),n=_(t),r=e.normalize(t,n,u.model.value);r!==t&&h(u.model.value,T.value,r)}if(J(`change`),u&&T.value!==void 0){let e=m(u.model.value,T.value);u.notifyFieldChange(T.value,e)}},Q=()=>{J(`blur`)};(0,t.onMounted)(()=>{if(O.value=_(A()),T.value&&u&&m(u.model.value,T.value)===void 0){let e=A();e!==void 0&&h(u.model.value,T.value,_(e))}u?.addField(X)}),(0,t.onUnmounted)(()=>{u?.removeField(X);let t=e.preserve,n=u?.preserve.value??!0;!(t===void 0?n:t)&&u&&T.value!==void 0&&g(u.model.value,T.value)}),n({validate:J,resetField:Y,clearValidate:G}),(0,t.provide)(a,{validateStatus:P,isInsideForm:!!u,validate:J});let $;(0,t.watch)(()=>u?.model.value,t=>{if(e.shouldUpdate!==void 0){if(typeof e.shouldUpdate==`function`){if(!e.shouldUpdate($,t)){$=_(t);return}}else if(!e.shouldUpdate){$=_(t);return}}$=_(t),e.dependencies.length>0&&J()},{deep:!0});let re=()=>{if(!e.label&&!s.label)return null;let n=[s.label?.()||e.label,I.value?(0,t.h)(`span`,{class:c.e(`optional`)},` (optional)`):null];return(0,t.h)(`label`,{class:[c.e(`label`),R.value&&c.em(`label`,`colon`)],style:H.value,for:e.htmlFor||void 0},n)},ie=()=>{if(!z.value)return null;let e=P.value;if(!e)return null;let n=e===`success`?`✓`:e===`error`?`✕`:e===`warning`?`!`:e===`validating`?`◌`:``;return n?(0,t.h)(`span`,{class:[c.e(`feedback`),c.em(`feedback`,e)],"aria-hidden":`true`},n):null},ae=()=>(0,t.h)(`div`,{class:c.e(`content`),style:U.value},[(0,t.h)(`div`,{class:[c.e(`control`),z.value&&c.em(`control`,`has-feedback`)]},[s.default?.(),ie()]),F.value?(0,t.h)(`div`,{class:c.e(`message`),role:`alert`},F.value):null,e.extra?(0,t.h)(`div`,{class:c.e(`extra`)},e.extra):null]);return()=>e.noStyle?(0,t.h)(`div`,{ref:C,class:W.value,"data-field":E.value||void 0,onChangeCapture:Z,onFocusoutCapture:Q},s.default?.()):(0,t.h)(`div`,{ref:C,class:W.value,"data-field":E.value||void 0,"aria-invalid":P.value===`error`?`true`:void 0,onChangeCapture:Z,onFocusoutCapture:Q},[re(),ae()])}}),j=(0,t.defineComponent)({name:`CFormList`,props:u,setup(e,{slots:n}){let r=(0,t.inject)(i,null),a=(0,t.computed)(()=>f(e.name)),s=()=>{if(!r)return[];let t=m(r.model.value,e.name);if(Array.isArray(t))return t;let n=e.initialValue??m(r.initialValues.value,e.name),i=Array.isArray(n)?_(n):[];return h(r.model.value,e.name,i),i},c=(0,t.reactive)({keys:[],seed:0}),l=e=>{for(;c.keys.length<e;)c.keys.push(c.seed++);c.keys.length>e&&(c.keys.length=e)};(0,t.onMounted)(()=>{l(s().length)}),(0,t.watch)(()=>r?m(r.model.value,e.name):void 0,e=>{Array.isArray(e)&&e.length!==c.keys.length&&l(e.length)},{deep:!1});let u={add(e,t){if(!r)return;let n=s(),i=_(e),a=t===void 0?n.length:Math.max(0,Math.min(t,n.length));n.splice(a,0,i),c.keys.splice(a,0,c.seed++)},remove(e){if(!r)return;let t=s(),n=(Array.isArray(e)?e:[e]).filter(e=>e>=0&&e<t.length).sort((e,t)=>t-e);for(let e of n)t.splice(e,1),c.keys.splice(e,1)},move(e,t){if(!r)return;let n=s();if(e===t||e<0||t<0||e>=n.length||t>=n.length)return;let[i]=n.splice(e,1);n.splice(t,0,i);let[a]=c.keys.splice(e,1);c.keys.splice(t,0,a)}};return(0,t.provide)(o,{prefixName:a}),()=>{let e=c.keys.map((e,t)=>({key:e,name:t}));return n.default?.(e,u)??null}}}),M=(0,t.defineComponent)({name:`CFormProvider`,props:d,emits:[`form-change`,`form-finish`],setup(e,{emit:n,slots:r}){let i={};return(0,t.provide)(s,{registerForm:(e,t)=>{e&&(i[e]=t)},unregisterForm:e=>{e&&delete i[e]},triggerFormChange:(e,t)=>{e&&n(`form-change`,e,{changedFields:t,forms:i})},triggerFormFinish:(e,t)=>{e&&n(`form-finish`,e,{values:t,forms:i})}}),()=>r.default?.()??null}}),N=D;N.install=function(e){e.component(D.name,D),e.component(A.name,A),e.component(j.name,j),e.component(M.name,M)},e.Form=D,e.FormItem=A,e.FormList=j,e.FormProvider=M,e.default={title:`Form 表单`,category:`数据录入`,status:`95%`,install(e){e.component(D.name,D),e.component(A.name,A),e.component(j.name,j),e.component(M.name,M)}}});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function r(e,t=!1){let r=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>n(r),e:e=>e?n(r,e):``,m:e=>e?n(r,``,e):``,em:(e,t)=>e&&t?n(r,e,t):``,is:e=>`is-${e}`}}var i=new Set;function a(){return globalThis.process?.env?.NODE_ENV!==`production`}function o(e,t,n){if(!a())return;let r=n?`${n}.${e}`:e;if(i.has(r)||(i.add(r),typeof console>`u`))return;let o=n?`[ccui][${n}]`:`[ccui]`,s=t?`,请改用 ${t}`:``;console.warn(`${o} ${e} 已 deprecated${s}。`)}function s(e,t,n){return e?Object.prototype.hasOwnProperty.call(e,t)||Object.prototype.hasOwnProperty.call(e,n):!1}var c=Symbol(`ccuiForm`),l=Symbol(`ccuiFormItem`),u=Symbol(`ccuiFormList`),d=Symbol(`ccuiFormProvider`),f={model:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},initialValues:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:``},labelPosition:{type:String,default:`right`},disabled:{type:Boolean,default:!1},layout:{type:String,default:`horizontal`},colon:{type:Boolean,default:!0},requiredMark:{type:[Boolean,String],default:!0},validateMessages:{type:Object,default:()=>({})},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{type:[Boolean,Object],default:!1},name:{type:String,default:``},preserve:{type:Boolean,default:!0},labelCol:{type:Object,default:void 0},wrapperCol:{type:Object,default:void 0},hasFeedback:{type:Boolean,default:!1}},p={name:{type:[String,Number,Array],default:void 0},label:{type:String,default:``},prop:{type:[String,Number,Array],default:void 0},initialValue:{type:null,default:void 0},required:{type:Boolean,default:!1},rules:{type:[Object,Array,Function],default:void 0},help:{type:String,default:``},validateStatus:{type:String,default:``},extra:{type:String,default:``},htmlFor:{type:String,default:``},colon:{type:Boolean,default:void 0},hidden:{type:Boolean,default:!1},noStyle:{type:Boolean,default:!1},dependencies:{type:Array,default:()=>[]},preserve:{type:Boolean,default:void 0},shouldUpdate:{type:[Boolean,Function],default:void 0},hasFeedback:{type:Boolean,default:void 0},labelCol:{type:Object,default:void 0},wrapperCol:{type:Object,default:void 0},validateDebounce:{type:Number,default:0},normalize:{type:Function,default:void 0}},m={name:{type:[String,Number,Array],required:!0},initialValue:{type:Array,default:void 0}},h={};function g(e){return e==null||e===``?[]:Array.isArray(e)?[...e]:typeof e==`number`?[e]:e.replace(/\[(\w+)\]/g,`.$1`).split(`.`).filter(Boolean)}function _(e){return g(e).join(`.`)}function v(e,t){let n=g(t);if(n.length!==0)return n.reduce((e,t)=>e?.[t],e)}function y(e,t,n){let r=g(t),i=r.pop();if(i===void 0)return;let a=r.reduce((e,t)=>((!e[t]||typeof e[t]!=`object`)&&(e[t]={}),e[t]),e);a[i]=n}function b(e,t){let n=g(t);if(n.length===0)return;let r=n.pop(),i=e;for(let e of n){if(i?.[e]===void 0||i[e]===null)return;i=i[e]}i&&typeof i==`object`&&(Array.isArray(i)&&typeof r==`number`?i.splice(r,1):delete i[r])}function x(e){if(e==null)return e;if(typeof structuredClone==`function`)try{return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))}function S(e){return e?Array.isArray(e)?e:[e]:[]}function ee(e,t){return t?e.filter(e=>e.trigger?(Array.isArray(e.trigger)?e.trigger:[e.trigger]).includes(t):!0):e}function C(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function w(e,t){return C(t)||!e.type?!0:e.type===`email`?typeof t==`string`&&/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t):e.type===`url`?typeof t==`string`&&/^https?:\/\/\S+$/i.test(t):e.type===`array`?Array.isArray(t):e.type===`object`?typeof t==`object`&&!Array.isArray(t):typeof t===e.type}function te(e){if(typeof e==`string`||Array.isArray(e))return e.length;if(typeof e==`number`)return e}var T={default:"${label} is invalid",required:"${label} is required",enum:"${label} must be one of ${enum}",whitespace:"${label} cannot be empty",pattern:"${label} is invalid",types:{string:"${label} is not a valid string",number:"${label} is not a valid number",boolean:"${label} is not a valid boolean",array:"${label} is not a valid array",object:"${label} is not a valid object",email:"${label} is not a valid email",url:"${label} is not a valid url"},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min} and ${max} characters"},number:{len:"${label} must equal ${len}",min:"${label} must be at least ${min}",max:"${label} must be up to ${max}",range:"${label} must be between ${min} and ${max}"},array:{len:"${label} must contain ${len} items",min:"${label} must contain at least ${min} items",max:"${label} must contain up to ${max} items",range:"${label} must contain between ${min} and ${max} items"}};function E(e,t){return e.replace(/\$\{(\w+)\}/g,(e,n)=>String(t[n]??``))}function D(e,t,n,r,i,a){if(e.message)return e.message;let o={...T,...r,types:{...T.types,...r.types},string:{...T.string,...r.string},number:{...T.number,...r.number},array:{...T.array,...r.array}};return E((a&&i&&typeof o[i]==`object`?o[i]?.[a]:void 0)||(i===`types`&&e.type?o.types?.[e.type]:void 0)||(i?o[i]:void 0)||o.default||"${label} is invalid",{label:n||t,name:t,field:t,enum:e.enum?.join(`, `),len:e.len,min:e.min,max:e.max})}function O(e,t){return e.type===`array`||Array.isArray(t)?`array`:typeof t==`number`?`number`:`string`}async function ne(e,t,n,r,i=r,a={}){if(e.required&&C(t))return{field:r,message:D(e,r,i,a,`required`)};if(e.whitespace&&typeof t==`string`&&t.trim()===``)return{field:r,message:D(e,r,i,a,`whitespace`)};if(e.enum&&!C(t)&&!e.enum.includes(t))return{field:r,message:D(e,r,i,a,`enum`)};if(!w(e,t))return{field:r,message:D(e,r,i,a,`types`)};let o=te(t);if(o!==void 0){let n=O(e,t);if(e.len!==void 0&&o!==e.len)return{field:r,message:D(e,r,i,a,n,`len`)};if(e.min!==void 0&&e.max!==void 0&&(o<e.min||o>e.max))return{field:r,message:D(e,r,i,a,n,`range`)};if(e.min!==void 0&&o<e.min)return{field:r,message:D(e,r,i,a,n,`min`)};if(e.max!==void 0&&o>e.max)return{field:r,message:D(e,r,i,a,n,`max`)}}if(e.pattern&&!e.pattern.test(String(t)))return{field:r,message:D(e,r,i,a,`pattern`)};if(e.validator){let o=await e.validator(e,t,n);if(o===!1)return{field:r,message:D(e,r,i,a)};if(typeof o==`string`)return{field:r,message:o};if(o instanceof Error)return{field:r,message:o.message}}return null}var k=(0,t.defineComponent)({name:`CForm`,props:f,emits:[`submit`,`validate`,`validate-failed`,`values-change`],setup(e,{emit:n,expose:i,slots:a}){let l=r(`form`),u=(0,t.ref)([]),f=(0,t.inject)(d,null),p=(0,t.getCurrentInstance)()?.vnode.props;s(p,`shouldUpdate`,`should-update`)&&o(`shouldUpdate`,void 0,`Form`);let m=e=>{if(e===void 0)return u.value;if(!Array.isArray(e)){let t=_(e);return u.value.filter(e=>e.field===t)}let t=_(e);if(u.value.some(e=>e.field===t))return u.value.filter(e=>e.field===t);let n=new Set(e.map(e=>_(e)));return u.value.filter(e=>n.has(e.field))},h=e=>{e.field&&!u.value.includes(e)&&u.value.push(e)},g=e=>{u.value=u.value.filter(t=>t!==e)},v=(e,t,r)=>{n(`validate`,e,t,r)},y=(t,r)=>{n(`values-change`,{name:t,value:r},e.model),e.name&&f&&f.triggerFormChange(e.name,[{name:t,value:r}])},b=(0,t.computed)(()=>({[l.b()]:!0,[l.m(`label-${e.labelPosition}`)]:!!e.labelPosition,[l.m(e.layout)]:!!e.layout,[l.m(`disabled`)]:e.disabled})),x=async t=>{let r=[];for(let e of u.value)!await e.validate()&&e.prop&&r.push({field:e.field,message:e.getValidateMessage()});let i=r.length===0;return t?.(i,r),i||(n(`validate-failed`,r),e.scrollToFirstError&&w(r[0].field,e.scrollToFirstError===!0?void 0:e.scrollToFirstError)),i},S=async(e,t)=>{let n=m(e);return(await Promise.all(n.map(e=>e.validate(t)))).every(Boolean)},ee=e=>{m(e).forEach(e=>e.resetField())},C=e=>{m(e).forEach(e=>e.clearValidate())},w=(e,t)=>{m(e)[0]?.getElement()?.scrollIntoView(t??{block:`nearest`})},te=()=>e.model,T=async t=>{t.preventDefault();let r=await x();n(`submit`,r,t),r&&e.name&&f&&f.triggerFormFinish(e.name,e.model)};(0,t.watch)(()=>e.rules,()=>{e.validateOnRuleChange&&C()}),(0,t.watch)(()=>e.model,()=>{u.value.forEach(e=>{e.dependencies.length>0&&e.validate()})},{deep:!0});let E={validate:x,validateField:S,resetFields:ee,clearValidate:C,scrollToField:w,getFieldsValue:te};return i(E),(0,t.onMounted)(()=>{e.name&&f&&f.registerForm(e.name,E)}),(0,t.onUnmounted)(()=>{e.name&&f&&f.unregisterForm(e.name)}),(0,t.provide)(c,{model:(0,t.toRef)(e,`model`),rules:(0,t.toRef)(e,`rules`),initialValues:(0,t.toRef)(e,`initialValues`),validateMessages:(0,t.toRef)(e,`validateMessages`),disabled:(0,t.toRef)(e,`disabled`),labelWidth:(0,t.toRef)(e,`labelWidth`),labelPosition:(0,t.toRef)(e,`labelPosition`),layout:(0,t.toRef)(e,`layout`),colon:(0,t.toRef)(e,`colon`),requiredMark:(0,t.toRef)(e,`requiredMark`),preserve:(0,t.toRef)(e,`preserve`),labelCol:(0,t.toRef)(e,`labelCol`),wrapperCol:(0,t.toRef)(e,`wrapperCol`),hasFeedback:(0,t.toRef)(e,`hasFeedback`),addField:h,removeField:g,emitValidate:v,validateField:S,notifyFieldChange:y}),()=>(0,t.h)(`form`,{class:b.value,novalidate:!0,onSubmit:T},a.default?.())}}),re=/^[a-z0-9]+(-[a-z0-9]+)*$/,A=(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&&!j(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&&!j(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!j(e,n)?null:e}return null},j=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function M(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 N=Object.freeze({left:0,top:0,width:16,height:16}),P=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),F=Object.freeze({...N,...P}),I=Object.freeze({...F,body:``,hidden:!1});function ie(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 L(e,t){let n=ie(e,t);for(let r in I)r in P?r in e&&!(r in n)&&(n[r]=P[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ae(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=L(r[e]||i[e],a)}return o(t),n.forEach(o),L(e,a)}function oe(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=M(e);for(let i in r){let a=r[i];a&&(t(i,ae(e,i,a)),n.push(i))}return n}var se={provider:``,aliases:{},not_found:{},...N};function R(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function z(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!R(e,se))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!R(t,I))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]||!R(t,I))return null}return t}var B=Object.create(null);function V(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function H(e,t){let n=B[e]||(B[e]=Object.create(null));return n[t]||(n[t]=V(e,t))}function U(e,t){return z(t)?oe(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function W(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var G=!1;function K(e){return typeof e==`boolean`&&(G=e),G}function q(e){let t=typeof e==`string`?A(e,!0,G):e;if(t){let e=H(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ce(e,t){let n=A(e,!0,G);if(!n)return!1;let r=H(n.provider,n.prefix);return t?W(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||``),G&&!t&&!e.prefix){let t=!1;return z(e)&&(e.prefix=``,oe(e,(e,n)=>{ce(e,n)&&(t=!0)})),t}let n=e.prefix;return j({prefix:n,name:`a`})?!!U(H(t,n),e):!1}var ue=Object.freeze({width:null,height:null}),de=Object.freeze({...ue,...P}),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={...F,...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 Se(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=xe.get(e)||0;return xe.set(e,t+1),t?`${e}${t}`:e}function Ce(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=Se(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 we=Object.create(null);function Te(e,t){we[e]=t}function Ee(e){return we[e]||we[``]}function De(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 Oe=Object.create(null),J=[`https://api.simplesvg.com`,`https://api.unisvg.com`],ke=[];J.length>0;)J.length===1||Math.random()>.5?ke.push(J.shift()):ke.push(J.pop());Oe[``]=De({resources:[`https://api.iconify.design`].concat(ke)});function Ae(e,t){let n=De(t);return n===null?!1:(Oe[e]=n,!0)}function je(e){return Oe[e]}var Me=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Ne(e,t){let n=je(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 Pe(e){return e===404}var Fe=(e,t,n)=>{let r=[],i=Ne(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 Ie(e){if(typeof e==`string`){let t=je(e);if(t)return t.path}return`/`}var Le={prepare:Fe,send:(e,t,n)=>{if(!Me){n(`abort`,424);return}let r=Ie(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;Me(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Pe(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 Re(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function ze(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||Re([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Be=0;function Ve(e,t,n){let r=Be++,i=Re.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 He(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]=H(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 Ue(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?A(e,t,n):e;i&&r.push(i)}),r}var We={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ge(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 Ke(e){let t={...We,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Ge(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 qe(){}var Je=Object.create(null);function Ye(e){if(!Je[e]){let t=je(e);if(!t)return;Je[e]={config:t,redundancy:Ke(t)}}return Je[e]}function Xe(e,t,n){let r,i;if(typeof e==`string`){let t=Ee(e);if(!t)return n(void 0,424),qe;i=t.send;let a=Ye(e);a&&(r=a.redundancy)}else{let t=De(e);if(t){r=Ke(t);let n=Ee(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),qe):r.query(t,i,n)().abort}function Ze(){}function Qe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,ze(e)}))}function $e(e){let t=[],n=[];return e.forEach(e=>{(e.match(re)?t:n).push(e)}),{valid:t,invalid:n}}function Y(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(!U(e,n).length){r();return}}catch(e){console.error(e)}r(),Qe(e)}function et(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function tt(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)){et(e.loadIcons(r,n,t),t=>{Y(e,r,t)});return}if(i){r.forEach(r=>{et(i(r,n,t),t=>{Y(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=$e(r);if(o.length&&Y(e,o,null),!a.length)return;let s=n.match(re)?Ee(t):null;if(!s){Y(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Xe(t,n,t=>{Y(e,n.icons,t)})})}))}var nt=(e,t)=>{let n=He(Ue(e,!0,K()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Ze)}),()=>{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(H(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=H(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&&tt(e,t)}),t?Ve(t,n,i):Ze};function rt(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 it=/[\s,]+/;function at(e,t){t.split(it).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function ot(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 st(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 ct(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function lt(e){return`data:image/svg+xml,`+ct(e)}function ut(e){return`url("`+lt(e)+`")`}var dt={...de,inline:!1},ft={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},pt={display:`inline-block`},mt={backgroundColor:`currentColor`},ht={backgroundColor:`transparent`},gt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},_t={webkitMask:mt,mask:mt,background:ht};for(let e in _t){let t=_t[e];for(let n in gt)t[e+n]=gt[n]}var X={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;X[e+`-flip`]=t,X[e.slice(0,1)+`-flip`]=t,X[e+`Flip`]=t});function vt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var yt=(e,n)=>{let r=rt(dt,n),i={...ft},a=n.mode||`svg`,o={},s=n.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in n){let t=n[e];if(t!==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]=t===!0||t===`true`||t===1;break;case`flip`:typeof t==`string`&&at(r,t);break;case`color`:o.color=t;break;case`rotate`:typeof t==`string`?r[e]=ot(t):typeof t==`number`&&(r[e]=t);break;case`ariaHidden`:case`aria-hidden`:t!==!0&&t!==`true`&&delete i[`aria-hidden`];break;default:{let n=X[e];n?(t===!0||t===`true`||t===1)&&(r[n]=!0):dt[e]===void 0&&(i[e]=t)}}}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=Ce(l.body),(0,t.h)(`svg`,i);let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=st(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":ut(h),width:vt(u.width),height:vt(u.height),...pt,...m?mt:ht,...c},(0,t.h)(`span`,i)};if(K(!0),Te(``,Le),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;Ae(e,r)||console.error(n)}catch{console.error(n)}}}}var bt={...F,body:``},xt=(0,t.defineComponent)((e,{emit:n})=>{let r=(0,t.ref)(null);function i(){r.value&&=(r.value.abort?.(),null)}let a=(0,t.ref)(!!e.ssr),o=(0,t.ref)(``),s=(0,t.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=A(a,!1,!0))===null)return null;let c=q(s);if(!c){let e=r.value;return(!e||e.name!==a)&&(c===null?r.value={name:a}:r.value={name:a,abort:nt([s],l)}),null}i(),o.value!==a&&(o.value=a,(0,t.nextTick)(()=>{n(`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,t.onMounted)(()=>{a.value=!0,l()}),(0,t.watch)(()=>e.icon,l),(0,t.onUnmounted)(i),()=>{let t=s.value;if(!t)return yt(bt,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),yt({...F,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),St={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"/>`}}},Ct=!1;function wt(){Ct||=(le(St),!0)}wt();function Tt(e){return e.includes(`:`)}function Et(e){return e?typeof e==`string`?Tt(e)?(0,t.h)(xt,{icon:e}):(0,t.h)(`i`,{class:e}):e:null}function Dt(e){if(!e)return{};let t={};return e.flex!==void 0&&(t.flex=typeof e.flex==`number`?`${e.flex} ${e.flex} auto`:e.flex),e.span!==void 0&&(t.width=`${e.span/24*100}%`),e.offset!==void 0&&e.offset>0&&(t.marginInlineStart=`${e.offset/24*100}%`),t}var Z=(0,t.defineComponent)({name:`CFormItem`,props:p,setup(e,{expose:n,slots:i}){let a=r(`form-item`),d=(0,t.getCurrentInstance)()?.vnode.props;s(d,`prop`,`prop`)&&o(`prop`,`name`,`FormItem`);let f=(0,t.inject)(c,null),p=(0,t.inject)(u,null),m=(0,t.ref)(``),h=(0,t.ref)(``),C=(0,t.ref)(!1),w=(0,t.ref)(null),te=(0,t.computed)(()=>e.name??e.prop),T=(0,t.computed)(()=>{let e=te.value;if(!p)return e;let t=p.prefixName.value;return e==null||e===``?t.length?[...t]:void 0:[...t,...g(e)]}),E=(0,t.computed)(()=>_(T.value)),D=(0,t.computed)(()=>e.label||E.value),O=(0,t.ref)(),k=()=>{if(e.initialValue!==void 0)return e.initialValue;let t=f?v(f.initialValues.value,T.value):void 0;return t===void 0?f?v(f.model.value,T.value):void 0:t},re=()=>{let t=e.rules;return typeof t==`function`?t(f?.model.value??{}):t},A=(0,t.computed)(()=>{let t=[...S(f?.rules.value?.[E.value]),...S(re())];return e.required&&!t.some(e=>e.required)&&t.unshift({required:!0}),t}),j=(0,t.computed)(()=>e.required||A.value.some(e=>e.required)),M=(0,t.computed)(()=>e.validateStatus?e.validateStatus:C.value?`warning`:m.value),N=(0,t.computed)(()=>h.value||e.help),P=(0,t.computed)(()=>!j.value&&f?.requiredMark.value===`optional`),F=(0,t.computed)(()=>j.value&&f?.requiredMark.value!==!1),I=(0,t.computed)(()=>e.colon??f?.colon.value??!0),ie=(0,t.computed)(()=>e.hasFeedback===void 0?!!f?.hasFeedback.value:e.hasFeedback),L=(0,t.computed)(()=>e.labelCol??f?.labelCol.value),ae=(0,t.computed)(()=>e.wrapperCol??f?.wrapperCol.value),oe=(0,t.computed)(()=>L.value?Dt(L.value):!f?.labelWidth.value||f.labelPosition.value===`top`||f.layout.value===`vertical`?{}:{width:typeof f.labelWidth.value==`number`?`${f.labelWidth.value}px`:f.labelWidth.value}),se=(0,t.computed)(()=>Dt(ae.value)),R=(0,t.computed)(()=>({[a.b()]:!0,[a.m(M.value)]:!!M.value,[a.m(`required`)]:F.value,[a.m(`optional`)]:P.value,[a.m(`no-style`)]:e.noStyle,[a.m(`hidden`)]:e.hidden,[a.m(`top`)]:f?.labelPosition.value===`top`||f?.layout.value===`vertical`})),z=()=>{m.value=``,h.value=``,C.value=!1},B=null,V=async e=>{if(!E.value||!f)return!0;let t=ee(A.value,e);if(t.length===0)return z(),!0;m.value=`validating`;let n=v(f.model.value,T.value),r=``;for(let e of t){let t=await ne(e,n,f.model.value,E.value,D.value,f.validateMessages.value);if(t){if(e.warningOnly){r=t.message;continue}return m.value=`error`,h.value=t.message,f.emitValidate(E.value,!1,t.message),!1}}return r?(m.value=`success`,h.value=r,C.value=!0,f.emitValidate(E.value,!0,r),!0):(C.value=!1,m.value=`success`,h.value=``,f.emitValidate(E.value,!0,``),!0)},H=async t=>e.validateDebounce>0?(B&&clearTimeout(B),new Promise(n=>{B=setTimeout(()=>{V(t).then(n)},e.validateDebounce)})):V(t),U=()=>{E.value&&f&&y(f.model.value,T.value,x(O.value)),z()},W={get prop(){return T.value},get field(){return E.value},get dependencies(){return e.dependencies},validate:H,resetField:U,clearValidate:z,getValidateMessage:()=>h.value,getElement:()=>w.value},G=t=>{if(e.normalize&&f&&T.value!==void 0){let t=v(f.model.value,T.value),n=x(t),r=e.normalize(t,n,f.model.value);r!==t&&y(f.model.value,T.value,r)}if(H(`change`),f&&T.value!==void 0){let e=v(f.model.value,T.value);f.notifyFieldChange(T.value,e)}},K=()=>{H(`blur`)};(0,t.onMounted)(()=>{if(O.value=x(k()),T.value&&f&&v(f.model.value,T.value)===void 0){let e=k();e!==void 0&&y(f.model.value,T.value,x(e))}f?.addField(W)}),(0,t.onUnmounted)(()=>{f?.removeField(W);let t=e.preserve,n=f?.preserve.value??!0;!(t===void 0?n:t)&&f&&T.value!==void 0&&b(f.model.value,T.value)}),n({validate:H,resetField:U,clearValidate:z}),(0,t.provide)(l,{validateStatus:M,isInsideForm:!!f,validate:H});let q;(0,t.watch)(()=>f?.model.value,t=>{if(e.shouldUpdate!==void 0){if(typeof e.shouldUpdate==`function`){if(!e.shouldUpdate(q,t)){q=x(t);return}}else if(!e.shouldUpdate){q=x(t);return}}q=x(t),e.dependencies.length>0&&H()},{deep:!0});let ce=()=>{if(!e.label&&!i.label)return null;let n=[i.label?.()||e.label,P.value?(0,t.h)(`span`,{class:a.e(`optional`)},` (optional)`):null];return(0,t.h)(`label`,{class:[a.e(`label`),I.value&&a.em(`label`,`colon`)],style:oe.value,for:e.htmlFor||void 0},n)},le=()=>{if(!ie.value)return null;let e=M.value;if(!e)return null;let n=e===`success`?`mdi:check-circle`:e===`error`?`mdi:close-circle`:e===`warning`?`mdi:alert-circle`:``,r=n?Et(n):e===`validating`?`◌`:``;return r?(0,t.h)(`span`,{class:[a.e(`feedback`),a.em(`feedback`,e)],"aria-hidden":`true`},r):null},ue=()=>(0,t.h)(`div`,{class:a.e(`content`),style:se.value},[(0,t.h)(`div`,{class:[a.e(`control`),ie.value&&a.em(`control`,`has-feedback`)]},[i.default?.(),le()]),N.value?(0,t.h)(`div`,{class:a.e(`message`),role:`alert`},N.value):null,e.extra?(0,t.h)(`div`,{class:a.e(`extra`)},e.extra):null]);return()=>e.noStyle?(0,t.h)(`div`,{ref:w,class:R.value,"data-field":E.value||void 0,onChangeCapture:G,onFocusoutCapture:K},i.default?.()):(0,t.h)(`div`,{ref:w,class:R.value,"data-field":E.value||void 0,"aria-invalid":M.value===`error`?`true`:void 0,onChangeCapture:G,onFocusoutCapture:K},[ce(),ue()])}}),Q=(0,t.defineComponent)({name:`CFormList`,props:m,setup(e,{slots:n}){let r=(0,t.inject)(c,null),i=(0,t.computed)(()=>g(e.name)),a=()=>{if(!r)return[];let t=v(r.model.value,e.name);if(Array.isArray(t))return t;let n=e.initialValue??v(r.initialValues.value,e.name),i=Array.isArray(n)?x(n):[];return y(r.model.value,e.name,i),i},o=(0,t.reactive)({keys:[],seed:0}),s=e=>{for(;o.keys.length<e;)o.keys.push(o.seed++);o.keys.length>e&&(o.keys.length=e)};(0,t.onMounted)(()=>{s(a().length)}),(0,t.watch)(()=>r?v(r.model.value,e.name):void 0,e=>{Array.isArray(e)&&e.length!==o.keys.length&&s(e.length)},{deep:!1});let l={add(e,t){if(!r)return;let n=a(),i=x(e),s=t===void 0?n.length:Math.max(0,Math.min(t,n.length));n.splice(s,0,i),o.keys.splice(s,0,o.seed++)},remove(e){if(!r)return;let t=a(),n=(Array.isArray(e)?e:[e]).filter(e=>e>=0&&e<t.length).sort((e,t)=>t-e);for(let e of n)t.splice(e,1),o.keys.splice(e,1)},move(e,t){if(!r)return;let n=a();if(e===t||e<0||t<0||e>=n.length||t>=n.length)return;let[i]=n.splice(e,1);n.splice(t,0,i);let[s]=o.keys.splice(e,1);o.keys.splice(t,0,s)}};return(0,t.provide)(u,{prefixName:i}),()=>{let e=o.keys.map((e,t)=>({key:e,name:t}));return n.default?.(e,l)??null}}}),$=(0,t.defineComponent)({name:`CFormProvider`,props:h,emits:[`form-change`,`form-finish`],setup(e,{emit:n,slots:r}){let i={};return(0,t.provide)(d,{registerForm:(e,t)=>{e&&(i[e]=t)},unregisterForm:e=>{e&&delete i[e]},triggerFormChange:(e,t)=>{e&&n(`form-change`,e,{changedFields:t,forms:i})},triggerFormFinish:(e,t)=>{e&&n(`form-finish`,e,{values:t,forms:i})}}),()=>r.default?.()??null}}),Ot=k;Ot.install=function(e){e.component(k.name,k),e.component(Z.name,Z),e.component(Q.name,Q),e.component($.name,$)},e.Form=k,e.FormItem=Z,e.FormList=Q,e.FormProvider=$,e.default={title:`Form 表单`,category:`数据录入`,status:`95%`,install(e){e.component(k.name,k),e.component(Z.name,Z),e.component(Q.name,Q),e.component($.name,$)}}});
|
package/icon/index.es.js
CHANGED
|
@@ -1123,24 +1123,107 @@ var ct = {
|
|
|
1123
1123
|
default: ""
|
|
1124
1124
|
}
|
|
1125
1125
|
}, lt = {
|
|
1126
|
+
prefix: "mdi",
|
|
1127
|
+
icons: {
|
|
1128
|
+
"alert-circle": {
|
|
1129
|
+
width: 24,
|
|
1130
|
+
height: 24,
|
|
1131
|
+
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\"/>"
|
|
1132
|
+
},
|
|
1133
|
+
"arrow-up": {
|
|
1134
|
+
width: 24,
|
|
1135
|
+
height: 24,
|
|
1136
|
+
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\"/>"
|
|
1137
|
+
},
|
|
1138
|
+
"calendar-outline": {
|
|
1139
|
+
width: 24,
|
|
1140
|
+
height: 24,
|
|
1141
|
+
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\"/>"
|
|
1142
|
+
},
|
|
1143
|
+
check: {
|
|
1144
|
+
width: 24,
|
|
1145
|
+
height: 24,
|
|
1146
|
+
body: "<path fill=\"currentColor\" d=\"M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59L21 7Z\"/>"
|
|
1147
|
+
},
|
|
1148
|
+
"check-circle": {
|
|
1149
|
+
width: 24,
|
|
1150
|
+
height: 24,
|
|
1151
|
+
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\"/>"
|
|
1152
|
+
},
|
|
1153
|
+
"chevron-right": {
|
|
1154
|
+
width: 24,
|
|
1155
|
+
height: 24,
|
|
1156
|
+
body: "<path fill=\"currentColor\" d=\"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6l-1.41-1.42Z\"/>"
|
|
1157
|
+
},
|
|
1158
|
+
"clock-outline": {
|
|
1159
|
+
width: 24,
|
|
1160
|
+
height: 24,
|
|
1161
|
+
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\"/>"
|
|
1162
|
+
},
|
|
1163
|
+
close: {
|
|
1164
|
+
width: 24,
|
|
1165
|
+
height: 24,
|
|
1166
|
+
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\"/>"
|
|
1167
|
+
},
|
|
1168
|
+
"close-circle": {
|
|
1169
|
+
width: 24,
|
|
1170
|
+
height: 24,
|
|
1171
|
+
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\"/>"
|
|
1172
|
+
},
|
|
1173
|
+
"content-copy": {
|
|
1174
|
+
width: 24,
|
|
1175
|
+
height: 24,
|
|
1176
|
+
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\"/>"
|
|
1177
|
+
},
|
|
1178
|
+
loading: {
|
|
1179
|
+
width: 24,
|
|
1180
|
+
height: 24,
|
|
1181
|
+
body: "<path fill=\"currentColor\" d=\"M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z\"/>"
|
|
1182
|
+
},
|
|
1183
|
+
magnify: {
|
|
1184
|
+
width: 24,
|
|
1185
|
+
height: 24,
|
|
1186
|
+
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\"/>"
|
|
1187
|
+
},
|
|
1188
|
+
"menu-down": {
|
|
1189
|
+
width: 24,
|
|
1190
|
+
height: 24,
|
|
1191
|
+
body: "<path fill=\"currentColor\" d=\"m7 10l5 5l5-5H7Z\"/>"
|
|
1192
|
+
},
|
|
1193
|
+
"menu-right": {
|
|
1194
|
+
width: 24,
|
|
1195
|
+
height: 24,
|
|
1196
|
+
body: "<path fill=\"currentColor\" d=\"m10 17l5-5l-5-5v10Z\"/>"
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}, ut = !1;
|
|
1200
|
+
function dt() {
|
|
1201
|
+
ut ||= (D(lt), !0);
|
|
1202
|
+
}
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region ../icons/dist/install.js
|
|
1205
|
+
dt();
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region ../ccui/ui/icon/src/icon.tsx
|
|
1208
|
+
var ft = {
|
|
1126
1209
|
prefixCls: "ccui",
|
|
1127
1210
|
componentSize: "middle",
|
|
1128
1211
|
locale: void 0,
|
|
1129
1212
|
direction: "ltr",
|
|
1130
1213
|
theme: void 0,
|
|
1131
1214
|
iconPrefixCls: "ccui-icon"
|
|
1132
|
-
},
|
|
1215
|
+
}, pt = {
|
|
1133
1216
|
small: 14,
|
|
1134
1217
|
large: 20
|
|
1135
1218
|
};
|
|
1136
|
-
function
|
|
1219
|
+
function mt(e) {
|
|
1137
1220
|
return !!e && e.includes(":");
|
|
1138
1221
|
}
|
|
1139
|
-
function
|
|
1222
|
+
function ht(e, t) {
|
|
1140
1223
|
let n = e === void 0 ? t : e;
|
|
1141
|
-
if (!(n == null || n === "" || n === "default")) return typeof n == "number" ? `${n}px` : n in
|
|
1224
|
+
if (!(n == null || n === "" || n === "default")) return typeof n == "number" ? `${n}px` : n in pt ? `${pt[n]}px` : n;
|
|
1142
1225
|
}
|
|
1143
|
-
function
|
|
1226
|
+
function gt(e) {
|
|
1144
1227
|
return e === "middle" ? "default" : e;
|
|
1145
1228
|
}
|
|
1146
1229
|
var $ = /* @__PURE__ */ t({
|
|
@@ -1149,13 +1232,13 @@ var $ = /* @__PURE__ */ t({
|
|
|
1149
1232
|
props: ct,
|
|
1150
1233
|
emits: ["click"],
|
|
1151
1234
|
setup(t, { slots: i, emit: a }) {
|
|
1152
|
-
let o = l(), s = rt("icon"), c = r(nt,
|
|
1235
|
+
let o = l(), s = rt("icon"), c = r(nt, ft), u = e(() => t.prefixCls || c.iconPrefixCls || "ccui-icon"), d = e(() => {
|
|
1153
1236
|
if (!(!t.theme || !t.themePrefixMap)) return t.themePrefixMap[t.theme];
|
|
1154
|
-
}), f = e(() => t.name ? t.name.includes(":") ? t.name : d.value ? `${d.value}:${t.name}` : t.iconifyPrefix ? `${t.iconifyPrefix}:${t.name}` : t.name : ""), p = e(() =>
|
|
1237
|
+
}), f = e(() => t.name ? t.name.includes(":") ? t.name : d.value ? `${d.value}:${t.name}` : t.iconifyPrefix ? `${t.iconifyPrefix}:${t.name}` : t.name : ""), p = e(() => mt(f.value) ? f.value : void 0), m = e(() => {
|
|
1155
1238
|
if (t.component) return t.component;
|
|
1156
1239
|
if (t.name && !p.value) return st(t.name);
|
|
1157
1240
|
}), h = e(() => !!t.name && !p.value && !m.value && !t.component), g = e(() => {
|
|
1158
|
-
let e = {}, n =
|
|
1241
|
+
let e = {}, n = ht(t.size, gt(c.componentSize));
|
|
1159
1242
|
return n && (e.fontSize = n), t.color && (e.color = t.color), t.twoToneColor && (e["--ccui-icon-two-tone-color"] = t.twoToneColor), t.rotate !== void 0 && (e["--ccui-icon-rotate"] = `${t.rotate}deg`), e;
|
|
1160
1243
|
}), _ = e(() => ({
|
|
1161
1244
|
[s.b()]: !0,
|
|
@@ -1216,7 +1299,7 @@ var $ = /* @__PURE__ */ t({
|
|
|
1216
1299
|
$.install = function(e) {
|
|
1217
1300
|
e.component($.name, $);
|
|
1218
1301
|
};
|
|
1219
|
-
var
|
|
1302
|
+
var _t = {
|
|
1220
1303
|
title: "Icon 图标",
|
|
1221
1304
|
category: "通用",
|
|
1222
1305
|
status: "100%",
|
|
@@ -1225,4 +1308,4 @@ var mt = {
|
|
|
1225
1308
|
}
|
|
1226
1309
|
};
|
|
1227
1310
|
//#endregion
|
|
1228
|
-
export { $ as Icon, be as addAPIProvider, D as addCollection, E as addIcon, ot as clearIconRegistry,
|
|
1311
|
+
export { $ as Icon, be as addAPIProvider, D as addCollection, E as addIcon, ot as clearIconRegistry, _t as default, Re as loadIcon, K as loadIcons, it as registerIcon, st as resolveIcon, at as unregisterIcon };
|
package/icon/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=/^[a-z0-9]+(-[a-z0-9]+)*$/,r=(e,t,n,r=``)=>{let a=e.split(`:`);if(e.slice(0,1)===`@`){if(a.length<2||a.length>3)return null;r=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){let e=a.pop(),n=a.pop(),o={provider:a.length>0?a[0]:r,prefix:n,name:e};return t&&!i(o)?null:o}let o=a[0],s=o.split(`-`);if(s.length>1){let e={provider:r,prefix:s.shift(),name:s.join(`-`)};return t&&!i(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:o};return t&&!i(e,n)?null:e}return null},i=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function a(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 o=Object.freeze({left:0,top:0,width:16,height:16}),s=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),c=Object.freeze({...o,...s}),l=Object.freeze({...c,body:``,hidden:!1});function u(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 d(e,t){let n=u(e,t);for(let r in l)r in s?r in e&&!(r in n)&&(n[r]=s[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function f(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=d(r[e]||i[e],a)}return o(t),n.forEach(o),d(e,a)}function p(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=a(e);for(let i in r){let a=r[i];a&&(t(i,f(e,i,a)),n.push(i))}return n}var m={provider:``,aliases:{},not_found:{},...o};function h(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function g(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!h(e,m))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!h(t,l))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]||!h(t,l))return null}return t}var _=Object.create(null);function v(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function y(e,t){let n=_[e]||(_[e]=Object.create(null));return n[t]||(n[t]=v(e,t))}function b(e,t){return g(t)?p(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function x(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var S=!1;function C(e){return typeof e==`boolean`&&(S=e),S}function w(e){let t=typeof e==`string`?r(e,!0,S):e;if(t){let e=y(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function T(e,t){let n=r(e,!0,S);if(!n)return!1;let i=y(n.provider,n.prefix);return t?x(i,n.name,t):(i.missing.add(n.name),!0)}function E(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),S&&!t&&!e.prefix){let t=!1;return g(e)&&(e.prefix=``,p(e,(e,n)=>{T(e,n)&&(t=!0)})),t}let n=e.prefix;return i({prefix:n,name:`a`})?!!b(y(t,n),e):!1}var D=Object.freeze({width:null,height:null}),O=Object.freeze({...D,...s}),ee=/(-?[0-9.]*[0-9]+[0-9.]*)/g,te=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function k(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(ee);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=te.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 ne(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 re(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ie(e,t,n){let r=ne(e);return re(r.defs,t+r.content+n)}var ae=e=>e===`unset`||e===`undefined`||e===`none`;function oe(e,t){let n={...c,...e},r={...O,...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=ie(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,l=i.width,u=i.height,d,f;o===null?(f=s===null?`1em`:s===`auto`?u:s,d=k(f,l/u)):(d=o===`auto`?l:o,f=s===null?k(d,u/l):s===`auto`?u:s);let p={},m=(e,t)=>{ae(t)||(p[e]=t.toString())};m(`width`,d),m(`height`,f);let h=[i.left,i.top,l,u];return p.viewBox=h.join(` `),{attributes:p,viewBox:h,body:a}}var se=/\sid="(\S+)"/g,ce=new Map;function le(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=ce.get(e)||0;return ce.set(e,t+1),t?`${e}${t}`:e}function ue(e){let t=[],n;for(;n=se.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=le(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 A=Object.create(null);function de(e,t){A[e]=t}function j(e){return A[e]||A[``]}function M(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 N=Object.create(null),P=[`https://api.simplesvg.com`,`https://api.unisvg.com`],F=[];P.length>0;)P.length===1||Math.random()>.5?F.push(P.shift()):F.push(P.pop());N[``]=M({resources:[`https://api.iconify.design`].concat(F)});function I(e,t){let n=M(t);return n===null?!1:(N[e]=n,!0)}function L(e){return N[e]}var R=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function fe(e,t){let n=L(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 pe(e){return e===404}var me=(e,t,n)=>{let r=[],i=fe(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 he(e){if(typeof e==`string`){let t=L(e);if(t)return t.path}return`/`}var ge={prepare:me,send:(e,t,n)=>{if(!R){n(`abort`,424);return}let r=he(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;R(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(pe(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 z(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function _e(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||z([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var ve=0;function ye(e,t,n){let r=ve++,i=z.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 be(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]=y(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 xe(e,t=!0,n=!1){let i=[];return e.forEach(e=>{let a=typeof e==`string`?r(e,t,n):e;a&&i.push(a)}),i}var Se={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ce(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 B(e){let t={...Se,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Ce(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 V(){}var H=Object.create(null);function we(e){if(!H[e]){let t=L(e);if(!t)return;H[e]={config:t,redundancy:B(t)}}return H[e]}function Te(e,t,n){let r,i;if(typeof e==`string`){let t=j(e);if(!t)return n(void 0,424),V;i=t.send;let a=we(e);a&&(r=a.redundancy)}else{let t=M(e);if(t){r=B(t);let n=j(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),V):r.query(t,i,n)().abort}function U(){}function Ee(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,_e(e)}))}function De(e){let t=[],r=[];return e.forEach(e=>{(e.match(n)?t:r).push(e)}),{valid:t,invalid:r}}function W(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(!b(e,n).length){r();return}}catch(e){console.error(e)}r(),Ee(e)}function G(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Oe(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:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;let a=e.loadIcon;if(e.loadIcons&&(i.length>1||!a)){G(e.loadIcons(i,r,t),t=>{W(e,i,t)});return}if(a){i.forEach(n=>{G(a(n,r,t),t=>{W(e,[n],t?{prefix:r,icons:{[n]:t}}:null)})});return}let{valid:o,invalid:s}=De(i);if(s.length&&W(e,s,null),!o.length)return;let c=r.match(n)?j(t):null;if(!c){W(e,o,null);return}c.prepare(t,r,o).forEach(n=>{Te(t,n,t=>{W(e,n.icons,t)})})}))}var K=(e,t)=>{let n=be(xe(e,!0,C()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,U)}),()=>{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(y(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=y(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&&Oe(e,t)}),t?ye(t,n,i):U},ke=e=>new Promise((t,n)=>{let i=typeof e==`string`?r(e,!0):e;if(!i){n(e);return}K([i||e],r=>{if(r.length&&i){let e=w(i);if(e){t({...c,...e});return}}n(e)})});function Ae(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in D?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var je=/[\s,]+/;function Me(e,t){t.split(je).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Ne(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 Pe(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 Fe(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Ie(e){return`data:image/svg+xml,`+Fe(e)}function Le(e){return`url("`+Ie(e)+`")`}var Re={...O,inline:!1},ze={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Be={display:`inline-block`},q={backgroundColor:`currentColor`},Ve={backgroundColor:`transparent`},He={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Ue={webkitMask:q,mask:q,background:Ve};for(let e in Ue){let t=Ue[e];for(let n in He)t[e+n]=He[n]}var J={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;J[e+`-flip`]=t,J[e.slice(0,1)+`-flip`]=t,J[e+`Flip`]=t});function We(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Ge=(e,n)=>{let r=Ae(Re,n),i={...ze},a=n.mode||`svg`,o={},s=n.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in n){let t=n[e];if(t!==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]=t===!0||t===`true`||t===1;break;case`flip`:typeof t==`string`&&Me(r,t);break;case`color`:o.color=t;break;case`rotate`:typeof t==`string`?r[e]=Ne(t):typeof t==`number`&&(r[e]=t);break;case`ariaHidden`:case`aria-hidden`:t!==!0&&t!==`true`&&delete i[`aria-hidden`];break;default:{let n=J[e];n?(t===!0||t===`true`||t===1)&&(r[n]=!0):Re[e]===void 0&&(i[e]=t)}}}let l=oe(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=ue(l.body),(0,t.h)(`svg`,i);let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Pe(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":Le(h),width:We(u.width),height:We(u.height),...Be,...m?q:Ve,...c},(0,t.h)(`span`,i)};if(C(!0),de(``,ge),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`||!E(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;I(e,r)||console.error(n)}catch{console.error(n)}}}}var Ke={...c,body:``},qe=(0,t.defineComponent)((e,{emit:n})=>{let i=(0,t.ref)(null);function a(){i.value&&=(i.value.abort?.(),null)}let o=(0,t.ref)(!!e.ssr),s=(0,t.ref)(``),l=(0,t.shallowRef)(null);function u(){let o=e.icon;if(typeof o==`object`&&o&&typeof o.body==`string`)return s.value=``,{data:o};let c;if(typeof o!=`string`||(c=r(o,!1,!0))===null)return null;let l=w(c);if(!l){let e=i.value;return(!e||e.name!==o)&&(l===null?i.value={name:o}:i.value={name:o,abort:K([c],d)}),null}a(),s.value!==o&&(s.value=o,(0,t.nextTick)(()=>{n(`load`,o)}));let u=e.customise;if(u){l=Object.assign({},l);let e=u(l.body,c.name,c.prefix,c.provider);typeof e==`string`&&(l.body=e)}let f=[`iconify`];return c.prefix!==``&&f.push(`iconify--`+c.prefix),c.provider!==``&&f.push(`iconify--`+c.provider),{data:l,classes:f}}function d(){let e=u();e?e.data!==l.value?.data&&(l.value=e):l.value=null}return o.value?d():(0,t.onMounted)(()=>{o.value=!0,d()}),(0,t.watch)(()=>e.icon,d),(0,t.onUnmounted)(a),()=>{let t=l.value;if(!t)return Ge(Ke,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),Ge({...c,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),Je=Symbol(`ccui-config`);function Y(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function Ye(e,t=!1){let n=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>Y(n),e:e=>e?Y(n,e):``,m:e=>e?Y(n,``,e):``,em:(e,t)=>e&&t?Y(n,e,t):``,is:e=>`is-${e}`}}var X=new Map;function Z(e){return e.trim()}function Xe(e,t){X.set(Z(e),t)}function Ze(e){X.delete(Z(e))}function Qe(){X.clear()}function Q(e){if(e)return X.get(Z(e))}var $e={name:{type:String,default:``},component:{type:Object,default:void 0},size:{type:[Number,String],default:void 0},color:{type:String,default:``},twoToneColor:{type:String,default:``},theme:{type:String,default:void 0},themePrefixMap:{type:Object,default:void 0},rotate:{type:Number,default:0},spin:{type:Boolean,default:!1},spinDirection:{type:String,default:`cw`},loading:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},iconifyPrefix:{type:String,default:``},title:{type:String,default:``},ariaLabel:{type:String,default:``},prefixCls:{type:String,default:``}},et={prefixCls:`ccui`,componentSize:`middle`,locale:void 0,direction:`ltr`,theme:void 0,iconPrefixCls:`ccui-icon`},tt={small:14,large:20};function nt(e){return!!e&&e.includes(`:`)}function rt(e,t){let n=e===void 0?t:e;if(!(n==null||n===``||n===`default`))return typeof n==`number`?`${n}px`:n in tt?`${tt[n]}px`:n}function it(e){return e===`middle`?`default`:e}var $=(0,t.defineComponent)({name:`CIcon`,inheritAttrs:!1,props:$e,emits:[`click`],setup(e,{slots:n,emit:r}){let i=(0,t.useAttrs)(),a=Ye(`icon`),o=(0,t.inject)(Je,et),s=(0,t.computed)(()=>e.prefixCls||o.iconPrefixCls||`ccui-icon`),c=(0,t.computed)(()=>{if(!(!e.theme||!e.themePrefixMap))return e.themePrefixMap[e.theme]}),l=(0,t.computed)(()=>e.name?e.name.includes(`:`)?e.name:c.value?`${c.value}:${e.name}`:e.iconifyPrefix?`${e.iconifyPrefix}:${e.name}`:e.name:``),u=(0,t.computed)(()=>nt(l.value)?l.value:void 0),d=(0,t.computed)(()=>{if(e.component)return e.component;if(e.name&&!u.value)return Q(e.name)}),f=(0,t.computed)(()=>!!e.name&&!u.value&&!d.value&&!e.component),p=(0,t.computed)(()=>{let t={},n=rt(e.size,it(o.componentSize));return n&&(t.fontSize=n),e.color&&(t.color=e.color),e.twoToneColor&&(t[`--ccui-icon-two-tone-color`]=e.twoToneColor),e.rotate!==void 0&&(t[`--ccui-icon-rotate`]=`${e.rotate}deg`),t}),m=(0,t.computed)(()=>({[a.b()]:!0,[a.m(`spin`)]:e.spin||e.loading,[a.m(`spin-ccw`)]:(e.spin||e.loading)&&e.spinDirection===`ccw`,[a.m(`font`)]:f.value,[a.m(`svg`)]:!!d.value||!!u.value||!!n.default,[a.m(`iconify`)]:!!u.value,[a.m(e.theme)]:!!e.theme,[a.m(`clickable`)]:e.clickable&&!e.disabled,[a.m(`disabled`)]:e.clickable&&e.disabled,[a.m(`loading`)]:e.loading})),h=t=>{if(e.clickable&&e.disabled){t.preventDefault(),t.stopPropagation();return}r(`click`,t)},g=t=>{!e.clickable||e.disabled||(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.currentTarget.click())};return()=>{let{class:r,style:o,...c}=i,l;l=e.loading?(0,t.h)(`svg`,{viewBox:`0 0 24 24`,class:a.e(`loading-spinner`),"aria-hidden":`true`},(0,t.h)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-dasharray":`40 18`})):d.value?(0,t.h)(d.value):u.value?(0,t.h)(qe,{icon:u.value}):f.value?(0,t.h)(`i`,{class:[s.value,`${s.value}-${e.name}`]}):n.default?.();let _=e.clickable,v=_?`button`:e.title||e.ariaLabel?`img`:void 0,y=_?e.disabled?-1:0:void 0;return(0,t.h)(`span`,{...c,class:[r,m.value],style:[o,p.value],role:v,tabindex:y,"aria-hidden":_||e.title||e.ariaLabel?void 0:`true`,"aria-label":e.ariaLabel||e.title||void 0,"aria-disabled":_&&e.disabled?`true`:void 0,"aria-busy":e.loading?`true`:void 0,title:e.title||void 0,onClick:h,onKeydown:g},l)}}});$.install=function(e){e.component($.name,$)},e.Icon=$,e.addAPIProvider=I,e.addCollection=E,e.addIcon=T,e.clearIconRegistry=Qe,e.default={title:`Icon 图标`,category:`通用`,status:`100%`,install(e){e.component($.name,$)}},e.loadIcon=ke,e.loadIcons=K,e.registerIcon=Xe,e.resolveIcon=Q,e.unregisterIcon=Ze});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=/^[a-z0-9]+(-[a-z0-9]+)*$/,r=(e,t,n,r=``)=>{let a=e.split(`:`);if(e.slice(0,1)===`@`){if(a.length<2||a.length>3)return null;r=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){let e=a.pop(),n=a.pop(),o={provider:a.length>0?a[0]:r,prefix:n,name:e};return t&&!i(o)?null:o}let o=a[0],s=o.split(`-`);if(s.length>1){let e={provider:r,prefix:s.shift(),name:s.join(`-`)};return t&&!i(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:o};return t&&!i(e,n)?null:e}return null},i=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function a(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 o=Object.freeze({left:0,top:0,width:16,height:16}),s=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),c=Object.freeze({...o,...s}),l=Object.freeze({...c,body:``,hidden:!1});function u(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 d(e,t){let n=u(e,t);for(let r in l)r in s?r in e&&!(r in n)&&(n[r]=s[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function f(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=d(r[e]||i[e],a)}return o(t),n.forEach(o),d(e,a)}function p(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=a(e);for(let i in r){let a=r[i];a&&(t(i,f(e,i,a)),n.push(i))}return n}var m={provider:``,aliases:{},not_found:{},...o};function h(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function g(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!h(e,m))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!h(t,l))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]||!h(t,l))return null}return t}var _=Object.create(null);function v(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function y(e,t){let n=_[e]||(_[e]=Object.create(null));return n[t]||(n[t]=v(e,t))}function b(e,t){return g(t)?p(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function x(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var S=!1;function C(e){return typeof e==`boolean`&&(S=e),S}function ee(e){let t=typeof e==`string`?r(e,!0,S):e;if(t){let e=y(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function w(e,t){let n=r(e,!0,S);if(!n)return!1;let i=y(n.provider,n.prefix);return t?x(i,n.name,t):(i.missing.add(n.name),!0)}function T(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),S&&!t&&!e.prefix){let t=!1;return g(e)&&(e.prefix=``,p(e,(e,n)=>{w(e,n)&&(t=!0)})),t}let n=e.prefix;return i({prefix:n,name:`a`})?!!b(y(t,n),e):!1}var E=Object.freeze({width:null,height:null}),D=Object.freeze({...E,...s}),te=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ne=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function O(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(te);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=ne.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 re(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 ie(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ae(e,t,n){let r=re(e);return ie(r.defs,t+r.content+n)}var oe=e=>e===`unset`||e===`undefined`||e===`none`;function se(e,t){let n={...c,...e},r={...D,...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=ae(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,l=i.width,u=i.height,d,f;o===null?(f=s===null?`1em`:s===`auto`?u:s,d=O(f,l/u)):(d=o===`auto`?l:o,f=s===null?O(d,u/l):s===`auto`?u:s);let p={},m=(e,t)=>{oe(t)||(p[e]=t.toString())};m(`width`,d),m(`height`,f);let h=[i.left,i.top,l,u];return p.viewBox=h.join(` `),{attributes:p,viewBox:h,body:a}}var ce=/\sid="(\S+)"/g,le=new Map;function ue(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=le.get(e)||0;return le.set(e,t+1),t?`${e}${t}`:e}function de(e){let t=[],n;for(;n=ce.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=ue(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 k=Object.create(null);function fe(e,t){k[e]=t}function A(e){return k[e]||k[``]}function j(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 M=Object.create(null),N=[`https://api.simplesvg.com`,`https://api.unisvg.com`],P=[];N.length>0;)N.length===1||Math.random()>.5?P.push(N.shift()):P.push(N.pop());M[``]=j({resources:[`https://api.iconify.design`].concat(P)});function F(e,t){let n=j(t);return n===null?!1:(M[e]=n,!0)}function I(e){return M[e]}var L=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function pe(e,t){let n=I(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 me(e){return e===404}var he=(e,t,n)=>{let r=[],i=pe(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 ge(e){if(typeof e==`string`){let t=I(e);if(t)return t.path}return`/`}var _e={prepare:he,send:(e,t,n)=>{if(!L){n(`abort`,424);return}let r=ge(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;L(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(me(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 R(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function ve(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||R([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var ye=0;function be(e,t,n){let r=ye++,i=R.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 xe(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]=y(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 Se(e,t=!0,n=!1){let i=[];return e.forEach(e=>{let a=typeof e==`string`?r(e,t,n):e;a&&i.push(a)}),i}var Ce={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function we(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 z(e){let t={...Ce,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=we(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 B(){}var V=Object.create(null);function Te(e){if(!V[e]){let t=I(e);if(!t)return;V[e]={config:t,redundancy:z(t)}}return V[e]}function Ee(e,t,n){let r,i;if(typeof e==`string`){let t=A(e);if(!t)return n(void 0,424),B;i=t.send;let a=Te(e);a&&(r=a.redundancy)}else{let t=j(e);if(t){r=z(t);let n=A(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),B):r.query(t,i,n)().abort}function H(){}function De(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,ve(e)}))}function Oe(e){let t=[],r=[];return e.forEach(e=>{(e.match(n)?t:r).push(e)}),{valid:t,invalid:r}}function U(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(!b(e,n).length){r();return}}catch(e){console.error(e)}r(),De(e)}function W(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ke(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:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;let a=e.loadIcon;if(e.loadIcons&&(i.length>1||!a)){W(e.loadIcons(i,r,t),t=>{U(e,i,t)});return}if(a){i.forEach(n=>{W(a(n,r,t),t=>{U(e,[n],t?{prefix:r,icons:{[n]:t}}:null)})});return}let{valid:o,invalid:s}=Oe(i);if(s.length&&U(e,s,null),!o.length)return;let c=r.match(n)?A(t):null;if(!c){U(e,o,null);return}c.prepare(t,r,o).forEach(n=>{Ee(t,n,t=>{U(e,n.icons,t)})})}))}var G=(e,t)=>{let n=xe(Se(e,!0,C()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,H)}),()=>{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(y(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=y(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&&ke(e,t)}),t?be(t,n,i):H},Ae=e=>new Promise((t,n)=>{let i=typeof e==`string`?r(e,!0):e;if(!i){n(e);return}G([i||e],r=>{if(r.length&&i){let e=ee(i);if(e){t({...c,...e});return}}n(e)})});function je(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in E?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Me=/[\s,]+/;function Ne(e,t){t.split(Me).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Pe(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 Fe(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 Ie(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Le(e){return`data:image/svg+xml,`+Ie(e)}function Re(e){return`url("`+Le(e)+`")`}var ze={...D,inline:!1},Be={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Ve={display:`inline-block`},K={backgroundColor:`currentColor`},He={backgroundColor:`transparent`},Ue={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},We={webkitMask:K,mask:K,background:He};for(let e in We){let t=We[e];for(let n in Ue)t[e+n]=Ue[n]}var q={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;q[e+`-flip`]=t,q[e.slice(0,1)+`-flip`]=t,q[e+`Flip`]=t});function Ge(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Ke=(e,n)=>{let r=je(ze,n),i={...Be},a=n.mode||`svg`,o={},s=n.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in n){let t=n[e];if(t!==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]=t===!0||t===`true`||t===1;break;case`flip`:typeof t==`string`&&Ne(r,t);break;case`color`:o.color=t;break;case`rotate`:typeof t==`string`?r[e]=Pe(t):typeof t==`number`&&(r[e]=t);break;case`ariaHidden`:case`aria-hidden`:t!==!0&&t!==`true`&&delete i[`aria-hidden`];break;default:{let n=q[e];n?(t===!0||t===`true`||t===1)&&(r[n]=!0):ze[e]===void 0&&(i[e]=t)}}}let l=se(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=de(l.body),(0,t.h)(`svg`,i);let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Fe(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":Re(h),width:Ge(u.width),height:Ge(u.height),...Ve,...m?K:He,...c},(0,t.h)(`span`,i)};if(C(!0),fe(``,_e),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`||!T(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;F(e,r)||console.error(n)}catch{console.error(n)}}}}var qe={...c,body:``},Je=(0,t.defineComponent)((e,{emit:n})=>{let i=(0,t.ref)(null);function a(){i.value&&=(i.value.abort?.(),null)}let o=(0,t.ref)(!!e.ssr),s=(0,t.ref)(``),l=(0,t.shallowRef)(null);function u(){let o=e.icon;if(typeof o==`object`&&o&&typeof o.body==`string`)return s.value=``,{data:o};let c;if(typeof o!=`string`||(c=r(o,!1,!0))===null)return null;let l=ee(c);if(!l){let e=i.value;return(!e||e.name!==o)&&(l===null?i.value={name:o}:i.value={name:o,abort:G([c],d)}),null}a(),s.value!==o&&(s.value=o,(0,t.nextTick)(()=>{n(`load`,o)}));let u=e.customise;if(u){l=Object.assign({},l);let e=u(l.body,c.name,c.prefix,c.provider);typeof e==`string`&&(l.body=e)}let f=[`iconify`];return c.prefix!==``&&f.push(`iconify--`+c.prefix),c.provider!==``&&f.push(`iconify--`+c.provider),{data:l,classes:f}}function d(){let e=u();e?e.data!==l.value?.data&&(l.value=e):l.value=null}return o.value?d():(0,t.onMounted)(()=>{o.value=!0,d()}),(0,t.watch)(()=>e.icon,d),(0,t.onUnmounted)(a),()=>{let t=l.value;if(!t)return Ke(qe,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),Ke({...c,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),Ye=Symbol(`ccui-config`);function J(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function Xe(e,t=!1){let n=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>J(n),e:e=>e?J(n,e):``,m:e=>e?J(n,``,e):``,em:(e,t)=>e&&t?J(n,e,t):``,is:e=>`is-${e}`}}var Y=new Map;function X(e){return e.trim()}function Ze(e,t){Y.set(X(e),t)}function Qe(e){Y.delete(X(e))}function $e(){Y.clear()}function Z(e){if(e)return Y.get(X(e))}var et={name:{type:String,default:``},component:{type:Object,default:void 0},size:{type:[Number,String],default:void 0},color:{type:String,default:``},twoToneColor:{type:String,default:``},theme:{type:String,default:void 0},themePrefixMap:{type:Object,default:void 0},rotate:{type:Number,default:0},spin:{type:Boolean,default:!1},spinDirection:{type:String,default:`cw`},loading:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},iconifyPrefix:{type:String,default:``},title:{type:String,default:``},ariaLabel:{type:String,default:``},prefixCls:{type:String,default:``}},tt={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"/>`}}},nt=!1;function rt(){nt||=(T(tt),!0)}rt();var it={prefixCls:`ccui`,componentSize:`middle`,locale:void 0,direction:`ltr`,theme:void 0,iconPrefixCls:`ccui-icon`},Q={small:14,large:20};function at(e){return!!e&&e.includes(`:`)}function ot(e,t){let n=e===void 0?t:e;if(!(n==null||n===``||n===`default`))return typeof n==`number`?`${n}px`:n in Q?`${Q[n]}px`:n}function st(e){return e===`middle`?`default`:e}var $=(0,t.defineComponent)({name:`CIcon`,inheritAttrs:!1,props:et,emits:[`click`],setup(e,{slots:n,emit:r}){let i=(0,t.useAttrs)(),a=Xe(`icon`),o=(0,t.inject)(Ye,it),s=(0,t.computed)(()=>e.prefixCls||o.iconPrefixCls||`ccui-icon`),c=(0,t.computed)(()=>{if(!(!e.theme||!e.themePrefixMap))return e.themePrefixMap[e.theme]}),l=(0,t.computed)(()=>e.name?e.name.includes(`:`)?e.name:c.value?`${c.value}:${e.name}`:e.iconifyPrefix?`${e.iconifyPrefix}:${e.name}`:e.name:``),u=(0,t.computed)(()=>at(l.value)?l.value:void 0),d=(0,t.computed)(()=>{if(e.component)return e.component;if(e.name&&!u.value)return Z(e.name)}),f=(0,t.computed)(()=>!!e.name&&!u.value&&!d.value&&!e.component),p=(0,t.computed)(()=>{let t={},n=ot(e.size,st(o.componentSize));return n&&(t.fontSize=n),e.color&&(t.color=e.color),e.twoToneColor&&(t[`--ccui-icon-two-tone-color`]=e.twoToneColor),e.rotate!==void 0&&(t[`--ccui-icon-rotate`]=`${e.rotate}deg`),t}),m=(0,t.computed)(()=>({[a.b()]:!0,[a.m(`spin`)]:e.spin||e.loading,[a.m(`spin-ccw`)]:(e.spin||e.loading)&&e.spinDirection===`ccw`,[a.m(`font`)]:f.value,[a.m(`svg`)]:!!d.value||!!u.value||!!n.default,[a.m(`iconify`)]:!!u.value,[a.m(e.theme)]:!!e.theme,[a.m(`clickable`)]:e.clickable&&!e.disabled,[a.m(`disabled`)]:e.clickable&&e.disabled,[a.m(`loading`)]:e.loading})),h=t=>{if(e.clickable&&e.disabled){t.preventDefault(),t.stopPropagation();return}r(`click`,t)},g=t=>{!e.clickable||e.disabled||(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.currentTarget.click())};return()=>{let{class:r,style:o,...c}=i,l;l=e.loading?(0,t.h)(`svg`,{viewBox:`0 0 24 24`,class:a.e(`loading-spinner`),"aria-hidden":`true`},(0,t.h)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-dasharray":`40 18`})):d.value?(0,t.h)(d.value):u.value?(0,t.h)(Je,{icon:u.value}):f.value?(0,t.h)(`i`,{class:[s.value,`${s.value}-${e.name}`]}):n.default?.();let _=e.clickable,v=_?`button`:e.title||e.ariaLabel?`img`:void 0,y=_?e.disabled?-1:0:void 0;return(0,t.h)(`span`,{...c,class:[r,m.value],style:[o,p.value],role:v,tabindex:y,"aria-hidden":_||e.title||e.ariaLabel?void 0:`true`,"aria-label":e.ariaLabel||e.title||void 0,"aria-disabled":_&&e.disabled?`true`:void 0,"aria-busy":e.loading?`true`:void 0,title:e.title||void 0,onClick:h,onKeydown:g},l)}}});$.install=function(e){e.component($.name,$)},e.Icon=$,e.addAPIProvider=F,e.addCollection=T,e.addIcon=w,e.clearIconRegistry=$e,e.default={title:`Icon 图标`,category:`通用`,status:`100%`,install(e){e.component($.name,$)}},e.loadIcon=Ae,e.loadIcons=G,e.registerIcon=Ze,e.resolveIcon=Z,e.unregisterIcon=Qe});
|