@qxs-bns/components 0.0.85 → 0.0.87

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.
@@ -1,2 +1,2 @@
1
- var r="0.0.85";export{r as version};
1
+ var r="0.0.87";export{r as version};
2
2
  //# sourceMappingURL=package.json.mjs.map
@@ -1,2 +1,2 @@
1
- import{defineComponent as t,h as o}from"vue";import{withInstall as r}from"../withInstall.mjs";import i from"./src/icon.vue.mjs";const m=r(i);function n(r){return r="string"==typeof r?{icon:r}:r,t({setup:()=>()=>o(i,{...r})})}export{m as QxsIcon,n as createQxsIcon,m as default};
1
+ import{defineComponent as t,h as o}from"vue";import{withInstall as r}from"../withInstall.mjs";import i from"./src/icon.mjs";const m=r(i);function n(r){return r="string"==typeof r?{icon:r}:r,t({setup:()=>()=>o(i,{...r})})}export{m as QxsIcon,n as createQxsIcon,m as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import type { PropsType } from './src/icon.vue'\nimport { defineComponent, h } from 'vue'\nimport { withInstall } from '../withInstall'\nimport component from './src/icon.vue'\n\nconst QxsIcon = withInstall(component)\n\n// 返回一个组件对象\nfunction createQxsIcon(opt: PropsType | string) {\n opt = typeof opt === 'string' ? { icon: opt } : opt\n return defineComponent({\n setup() {\n return () => h(component, { ...opt })\n },\n })\n}\n\nexport {\n createQxsIcon,\n QxsIcon,\n}\n\nexport default QxsIcon\n"],"names":["QxsIcon","withInstall","component","createQxsIcon","opt","icon","defineComponent","setup","h"],"mappings":"gIAKA,MAAMA,EAAUC,EAAYC,GAG5B,SAASC,EAAcC,GAErB,OADAA,EAAqB,iBAARA,EAAmB,CAAEC,KAAMD,GAAQA,EACzCE,EAAgB,CACrBC,MAAAA,IACS,IAAMC,EAAEN,EAAW,IAAKE,KAGrC"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import type { PropsType } from './src/icon'\nimport { defineComponent, h } from 'vue'\nimport { withInstall } from '../withInstall'\nimport component from './src/icon'\n\nconst QxsIcon = withInstall(component)\n\n// 返回一个组件对象\nfunction createQxsIcon(opt: PropsType | string) {\n opt = typeof opt === 'string' ? { icon: opt } : opt\n return defineComponent({\n setup() {\n return () => h(component, { ...opt })\n },\n })\n}\n\nexport {\n createQxsIcon,\n QxsIcon,\n}\n\nexport default QxsIcon\n"],"names":["QxsIcon","withInstall","component","createQxsIcon","opt","icon","defineComponent","setup","h"],"mappings":"4HAKA,MAAMA,EAAUC,EAAYC,GAG5B,SAASC,EAAcC,GAErB,OADAA,EAAqB,iBAARA,EAAmB,CAAEC,KAAMD,GAAQA,EACzCE,EAAgB,CACrBC,MAAAA,IACS,IAAMC,EAAEN,EAAW,IAAKE,KAGrC"}
@@ -0,0 +1,2 @@
1
+ import{Icon as e}from"../../../node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.mjs";import{useNamespace as t}from"@qxs-bns/hooks";import{defineComponent as s,useAttrs as i,computed as l,ref as r,h as a}from"vue";var o=s({name:"QxsIcon",inheritAttrs:!1,props:{icon:{type:[String,Object,Function],required:!0},flip:{type:String,default:""},rotate:{type:Number,default:0},color:String,size:[String,Number],localIconPrefix:{type:String,default:"icon-"},fallback:String,loading:String},setup(s){const o=i(),n=t("icon"),u=l(()=>{const e=[n.b()];return o.class&&("string"==typeof o.class?e.push(o.class):Array.isArray(o.class)?e.push(...o.class):e.push(o.class)),e}),c=l(()=>{const{class:e,style:t,...s}=o;return s}),v=l(()=>"object"==typeof s.icon||"function"==typeof s.icon),f=l(()=>{if(v.value)return"component";const e=s.icon;return/^https?:\/\//.test(e)||(/^\.{1,2}\//.test(t=e)||t.startsWith("/")||t.includes("/"))?"img":/^i-[^:]+:[^:]+/.test(e)?"unocss":e.startsWith("i-")&&!e.includes(":")?"css":e.includes(":")&&!e.startsWith("i-")?"iconify":/^[\w-]+$/.test(e)&&!e.startsWith("i-")?"svg":"css";var t}),p=l(()=>{if(v.value)return"";const e=s.icon;return"img"===f.value||"unocss"===f.value||f.value,e}),h=l(()=>"css"===f.value?p.value.split(" ").filter(e=>e.trim()):[]);function d(e){return e?"number"==typeof e||/^\d+(?:\.\d+)?$/.test(e)?`${e}px`:e:""}const g=l(()=>{const e=[];switch(s.flip){case"horizontal":e.push("rotateY(180deg)");break;case"vertical":e.push("rotateX(180deg)");break;case"both":e.push("rotateX(180deg)"),e.push("rotateY(180deg)")}s.rotate&&e.push(`rotate(${s.rotate%360}deg)`);let t=`${s.color?`color: ${s.color};`:""}${s.size?`font-size: ${d(s.size)};`:""}${e.length?`transform: ${e.join(" ")};`:""}`;const i=o.style;if(i)if("string"==typeof i)t+=i;else if("object"==typeof i){t+=Object.entries(i).map(e=>{let[t,s]=e;return`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${s};`}).join("")}return t}),y=r(!0),m=r(!1);function b(){y.value=!1,m.value=!1}function $(){y.value=!1,m.value=!0}return()=>{if("component"===f.value)return a(s.icon,{class:["size-inherit","shrink-0",...u.value],style:g.value,...c.value});if("unocss"===f.value)return a("i",{class:[...u.value,p.value],style:g.value,...c.value});if("css"===f.value)return a("i",{class:["size-inherit","shrink-0",...u.value,...h.value],style:g.value,...c.value});if("iconify"===f.value){const t={class:["size-inherit","shrink-0",...u.value],icon:p.value,...c.value};if(s.color&&(t.color=s.color),s.flip&&(t.flip=s.flip),s.rotate&&(t.rotate=s.rotate),s.size){const e=d(s.size);t.width=e,t.height=e}const i=o.style;return i&&(t.style=i),a(e,t)}return"img"===f.value?y.value&&s.loading?a("i",{class:s.loading,...c.value}):m.value&&s.fallback?a("i",{class:s.fallback,...c.value}):a("img",{src:p.value,class:["size-inherit","shrink-0",...u.value],style:[g.value,{width:s.size?d(s.size):"auto",height:"auto"}],onLoad:b,onError:$,...c.value}):p.value?a("i",{class:u.value,style:g.value,...c.value},[a("svg",{"aria-hidden":"true",class:"size-inherit shrink-0"},[a("use",{"xlink:href":`#${s.localIconPrefix}${p.value}`})])]):null}}});export{o as default};
2
+ //# sourceMappingURL=icon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.mjs","sources":["../../../../../../packages/components/src/icon/src/icon.tsx"],"sourcesContent":["import type { Component, CSSProperties } from 'vue'\nimport { Icon } from '@iconify/vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { computed, defineComponent, h, ref, useAttrs } from 'vue'\n\nexport interface PropsType {\n icon: string | Component\n flip?: 'horizontal' | 'vertical' | 'both' | '' | undefined\n rotate?: number\n color?: string\n size?: string | number\n localIconPrefix?: string\n // 新增功能:支持图片URL\n fallback?: string // 加载失败时的备用图标\n loading?: string // 加载中显示的图标\n}\n\nexport default defineComponent({\n name: 'QxsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: [String, Object, Function] as any,\n required: true,\n },\n flip: {\n type: String as () => 'horizontal' | 'vertical' | 'both' | '' | undefined,\n default: '',\n },\n rotate: {\n type: Number,\n default: 0,\n },\n color: String,\n size: [String, Number],\n localIconPrefix: {\n type: String,\n default: 'icon-',\n },\n fallback: String,\n loading: String,\n },\n setup(props) {\n const attrs = useAttrs()\n const ns = useNamespace('icon')\n\n // 合并外部传入的类名\n const mergedClass = computed(() => {\n const classes: any[] = [ns.b()]\n if (attrs.class) {\n if (typeof attrs.class === 'string') {\n classes.push(attrs.class)\n }\n else if (Array.isArray(attrs.class)) {\n classes.push(...attrs.class)\n }\n else {\n classes.push(attrs.class)\n }\n }\n return classes\n })\n\n // 获取非 class 的其他属性\n const otherAttrs = computed(() => {\n const { class: _, style: __, ...rest } = attrs\n return rest\n })\n\n const isComponentName = computed(() => typeof props.icon === 'object' || typeof props.icon === 'function')\n\n const outputType = computed(() => {\n if (isComponentName.value) {\n return 'component'\n }\n\n const iconStr = props.icon as string\n\n // 检测是否为图片URL或路径\n const hasPathFeatures = (str: string) => {\n return /^\\.{1,2}\\//.test(str) || str.startsWith('/') || str.includes('/')\n }\n if (/^https?:\\/\\//.test(iconStr) || hasPathFeatures(iconStr)) {\n return 'img'\n }\n\n // 检测UnoCSS图标格式 (i-[provider]:[name])\n if (/^i-[^:]+:[^:]+/.test(iconStr)) {\n return 'unocss'\n }\n\n // 检测以i-开头的自定义CSS类图标(不包含冒号)\n if (iconStr.startsWith('i-') && !iconStr.includes(':')) {\n return 'css'\n }\n\n // 检测Iconify格式 (provider:name,但不以i-开头)\n if (iconStr.includes(':') && !iconStr.startsWith('i-')) {\n return 'iconify'\n }\n\n // 检测SVG sprite(单个单词,不包含空格和特殊字符,且不以i-开头)\n if (/^[\\w-]+$/.test(iconStr) && !iconStr.startsWith('i-')) {\n return 'svg'\n }\n\n // 其他情况都视为CSS类图标(包括多个类名等)\n return 'css'\n })\n\n const outputName = computed(() => {\n if (isComponentName.value) {\n return ''\n }\n\n const iconStr = props.icon as string\n\n // 对于图片类型,直接返回URL\n if (outputType.value === 'img') {\n return iconStr\n }\n\n // 对于UnoCSS图标,直接返回类名\n if (outputType.value === 'unocss') {\n return iconStr\n }\n\n // 对于传统CSS图标,处理多个类名的情况\n if (outputType.value === 'css') {\n return iconStr\n }\n\n // 其他情况直接返回\n return iconStr\n })\n\n // 对于CSS类图标,将字符串拆分为类名数组\n const cssClasses = computed(() => {\n if (outputType.value === 'css') {\n return outputName.value.split(' ').filter(cls => cls.trim())\n }\n return []\n })\n\n // 用正则匹配 size 是不是 number 值,再判断是否有 px 结尾的单位,没有则拼接\n function formatSize(size: string | number | undefined): string {\n if (!size) {\n return ''\n }\n\n // 如果是数字,直接添加 px\n if (typeof size === 'number') {\n return `${size}px`\n }\n\n // 如果是纯数字字符串,添加 px\n if (/^\\d+(?:\\.\\d+)?$/.test(size)) {\n return `${size}px`\n }\n\n // 如果已经有单位(px、em、rem等)或者不是纯数字,直接返回\n return size\n }\n\n // 统一的样式计算属性,适用于所有图标类型\n // 包含颜色、尺寸和变换(旋转、翻转)\n const style = computed(() => {\n const transform = [] as string[]\n switch (props.flip) {\n case 'horizontal':\n transform.push('rotateY(180deg)')\n break\n case 'vertical':\n transform.push('rotateX(180deg)')\n break\n case 'both':\n transform.push('rotateX(180deg)')\n transform.push('rotateY(180deg)')\n break\n // 对于 '' 和 undefined,不做任何处理\n }\n if (props.rotate) {\n transform.push(`rotate(${props.rotate % 360}deg)`)\n }\n\n // 构建基础样式\n let baseStyle = `${props.color ? `color: ${props.color};` : ''}${props.size ? `font-size: ${formatSize(props.size)};` : ''}${transform.length ? `transform: ${transform.join(' ')};` : ''}`\n\n // 拼接 attrs.style\n const attrsStyle = attrs.style\n if (attrsStyle) {\n if (typeof attrsStyle === 'string') {\n baseStyle += attrsStyle\n }\n else if (typeof attrsStyle === 'object') {\n // 处理对象形式的样式\n const styleEntries = Object.entries(attrsStyle as CSSProperties)\n const styleString = styleEntries\n .map(([key, value]) => `${key.replace(/([A-Z])/g, '-$1').toLowerCase()}: ${value};`)\n .join('')\n baseStyle += styleString\n }\n }\n\n return baseStyle\n })\n\n // 图片加载状态管理\n const imageLoading = ref(true)\n const imageError = ref(false)\n\n function handleImageLoad() {\n imageLoading.value = false\n imageError.value = false\n }\n\n function handleImageError() {\n imageLoading.value = false\n imageError.value = true\n }\n\n return () => {\n // Vue组件\n if (outputType.value === 'component') {\n return h(\n props.icon as Component,\n {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // UnoCSS图标\n if (outputType.value === 'unocss') {\n return h(\n 'i',\n {\n class: [...mergedClass.value, outputName.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // CSS类图标\n if (outputType.value === 'css') {\n return h(\n 'i',\n {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value, ...cssClasses.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // Iconify图标\n if (outputType.value === 'iconify') {\n // Iconify 组件有自己的 color、width、height、flip、rotate 等属性\n // 需要单独处理这些属性\n const iconifyProps: any = {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n icon: outputName.value,\n ...otherAttrs.value,\n }\n\n // 传递 color 属性给 Iconify\n if (props.color) {\n iconifyProps.color = props.color\n }\n\n // 传递 flip 属性给 Iconify\n if (props.flip) {\n iconifyProps.flip = props.flip\n }\n\n // 传递 rotate 属性给 Iconify\n if (props.rotate) {\n iconifyProps.rotate = props.rotate\n }\n\n // 处理 size - Iconify 使用 width 和 height\n if (props.size) {\n const formattedSize = formatSize(props.size)\n iconifyProps.width = formattedSize\n iconifyProps.height = formattedSize\n }\n\n // 如果有额外的 style,也要传递\n const attrsStyle = attrs.style\n if (attrsStyle) {\n iconifyProps.style = attrsStyle\n }\n\n return h(Icon, iconifyProps)\n }\n\n // 图片\n if (outputType.value === 'img') {\n // 加载中状态\n if (imageLoading.value && props.loading) {\n return h('i', {\n class: props.loading,\n ...otherAttrs.value,\n })\n }\n // 错误状态\n if (imageError.value && props.fallback) {\n return h('i', {\n class: props.fallback,\n ...otherAttrs.value,\n })\n }\n // 图片本体\n return h('img', {\n src: outputName.value,\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n style: [style.value, { width: props.size ? formatSize(props.size) : 'auto', height: 'auto' }],\n onLoad: handleImageLoad,\n onError: handleImageError,\n ...otherAttrs.value,\n })\n }\n\n // SVG Sprite\n if (outputName.value) {\n return h(\n 'i',\n {\n class: mergedClass.value,\n style: style.value,\n ...otherAttrs.value,\n },\n [\n h(\n 'svg',\n {\n 'aria-hidden': 'true',\n 'class': 'size-inherit shrink-0',\n },\n [\n h('use', {\n 'xlink:href': `#${props.localIconPrefix}${outputName.value}`,\n }),\n ],\n ),\n ],\n )\n }\n\n return null\n }\n },\n})\n"],"names":["component","defineComponent","name","inheritAttrs","props","icon","type","String","Object","Function","required","flip","default","rotate","Number","color","size","localIconPrefix","fallback","loading","setup","attrs","useAttrs","ns","useNamespace","mergedClass","computed","classes","b","class","push","Array","isArray","otherAttrs","_","style","__","rest","isComponentName","outputType","value","iconStr","test","str","startsWith","includes","outputName","cssClasses","split","filter","cls","trim","formatSize","transform","baseStyle","length","join","attrsStyle","entries","map","_ref","key","replace","toLowerCase","imageLoading","ref","imageError","handleImageLoad","handleImageError","h","iconifyProps","formattedSize","width","height","Icon","src","onLoad","onError"],"mappings":"8QAiBA,IAAAA,EAAeC,EAAgB,CAC7BC,KAAM,UACNC,cAAc,EACdC,MAAO,CACLC,KAAM,CACJC,KAAM,CAACC,OAAQC,OAAQC,UACvBC,UAAU,GAEZC,KAAM,CACJL,KAAMC,OACNK,QAAS,IAEXC,OAAQ,CACNP,KAAMQ,OACNF,QAAS,GAEXG,MAAOR,OACPS,KAAM,CAACT,OAAQO,QACfG,gBAAiB,CACfX,KAAMC,OACNK,QAAS,SAEXM,SAAUX,OACVY,QAASZ,QAEXa,KAAAA,CAAMhB,GACJ,MAAMiB,EAAQC,IACRC,EAAKC,EAAa,QAGlBC,EAAcC,EAAS,KAC3B,MAAMC,EAAiB,CAACJ,EAAGK,KAY3B,OAXIP,EAAMQ,QACmB,iBAAhBR,EAAMQ,MACfF,EAAQG,KAAKT,EAAMQ,OAEZE,MAAMC,QAAQX,EAAMQ,OAC3BF,EAAQG,QAAQT,EAAMQ,OAGtBF,EAAQG,KAAKT,EAAMQ,QAGhBF,IAIHM,EAAaP,EAAS,KAC1B,MAAQG,MAAOK,EAAGC,MAAOC,KAAOC,GAAShB,EACzC,OAAOgB,IAGHC,EAAkBZ,EAAS,IAA4B,iBAAftB,EAAMC,MAA2C,mBAAfD,EAAMC,MAEhFkC,EAAab,EAAS,KAC1B,GAAIY,EAAgBE,MAClB,MAAO,YAGT,MAAMC,EAAUrC,EAAMC,KAMtB,MAAI,eAAeqC,KAAKD,KAFf,aAAaC,KADGC,EAG2BF,IAFjBE,EAAIC,WAAW,MAAQD,EAAIE,SAAS,MAG9D,MAIL,iBAAiBH,KAAKD,GACjB,SAILA,EAAQG,WAAW,QAAUH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AAWO,QAIX6B,EAAE,MAAO,CACdM,IAAK7B,EAAWN,MAChBX,MAAO,CAAC,eAAgB,cAAeJ,EAAYe,OACnDL,MAAO,CAACA,EAAMK,MAAO,CAAEgC,MAAOpE,EAAMY,KAAOoC,EAAWhD,EAAMY,MAAQ,OAAQyD,OAAQ,SACpFG,OAAQT,EACRU,QAAST,KACNnC,EAAWO,QAKdM,EAAWN,MACN6B,EACL,IACA,CACExC,MAAOJ,EAAYe,MACnBL,MAAOA,EAAMK,SACVP,EAAWO,OAEhB,CACE6B,EACE,MACA,CACE,cAAe,OACfxC,MAAS,yBAEX,CACEwC,EAAE,MAAO,CACP,aAAc,IAAIjE,EAAMa,kBAAkB6B,EAAWN,cAQ1D,KAEX"}
@@ -1,2 +1,2 @@
1
- "use strict";exports.version="0.0.85";
1
+ "use strict";exports.version="0.0.87";
2
2
  //# sourceMappingURL=package.json.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("../withInstall.cjs"),r=require("./src/icon.vue.cjs");const s=t.withInstall(r.default);exports.QxsIcon=s,exports.createQxsIcon=function(t){return t="string"==typeof t?{icon:t}:t,e.defineComponent({setup:()=>()=>e.h(r.default,{...t})})},exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("../withInstall.cjs"),r=require("./src/icon.cjs");const s=t.withInstall(r.default);exports.QxsIcon=s,exports.createQxsIcon=function(t){return t="string"==typeof t?{icon:t}:t,e.defineComponent({setup:()=>()=>e.h(r.default,{...t})})},exports.default=s;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import type { PropsType } from './src/icon.vue'\nimport { defineComponent, h } from 'vue'\nimport { withInstall } from '../withInstall'\nimport component from './src/icon.vue'\n\nconst QxsIcon = withInstall(component)\n\n// 返回一个组件对象\nfunction createQxsIcon(opt: PropsType | string) {\n opt = typeof opt === 'string' ? { icon: opt } : opt\n return defineComponent({\n setup() {\n return () => h(component, { ...opt })\n },\n })\n}\n\nexport {\n createQxsIcon,\n QxsIcon,\n}\n\nexport default QxsIcon\n"],"names":["QxsIcon","withInstall","component","opt","icon","defineComponent","setup","h"],"mappings":"yJAKA,MAAMA,EAAUC,EAAAA,YAAYC,EAAAA,iDAG5B,SAAuBC,GAErB,OADAA,EAAqB,iBAARA,EAAmB,CAAEC,KAAMD,GAAQA,EACzCE,kBAAgB,CACrBC,MAAAA,IACS,IAAMC,EAAAA,EAAEL,UAAW,IAAKC,KAGrC"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import type { PropsType } from './src/icon'\nimport { defineComponent, h } from 'vue'\nimport { withInstall } from '../withInstall'\nimport component from './src/icon'\n\nconst QxsIcon = withInstall(component)\n\n// 返回一个组件对象\nfunction createQxsIcon(opt: PropsType | string) {\n opt = typeof opt === 'string' ? { icon: opt } : opt\n return defineComponent({\n setup() {\n return () => h(component, { ...opt })\n },\n })\n}\n\nexport {\n createQxsIcon,\n QxsIcon,\n}\n\nexport default QxsIcon\n"],"names":["QxsIcon","withInstall","component","opt","icon","defineComponent","setup","h"],"mappings":"qJAKA,MAAMA,EAAUC,EAAAA,YAAYC,EAAAA,iDAG5B,SAAuBC,GAErB,OADAA,EAAqB,iBAARA,EAAmB,CAAEC,KAAMD,GAAQA,EACzCE,kBAAgB,CACrBC,MAAAA,IACS,IAAMC,EAAAA,EAAEL,UAAW,IAAKC,KAGrC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.cjs"),t=require("@qxs-bns/hooks"),s=require("vue"),i=s.defineComponent({name:"QxsIcon",inheritAttrs:!1,props:{icon:{type:[String,Object,Function],required:!0},flip:{type:String,default:""},rotate:{type:Number,default:0},color:String,size:[String,Number],localIconPrefix:{type:String,default:"icon-"},fallback:String,loading:String},setup(i){const r=s.useAttrs(),l=t.useNamespace("icon"),o=s.computed(()=>{const e=[l.b()];return r.class&&("string"==typeof r.class?e.push(r.class):Array.isArray(r.class)?e.push(...r.class):e.push(r.class)),e}),a=s.computed(()=>{const{class:e,style:t,...s}=r;return s}),u=s.computed(()=>"object"==typeof i.icon||"function"==typeof i.icon),n=s.computed(()=>{if(u.value)return"component";const e=i.icon;return/^https?:\/\//.test(e)||(/^\.{1,2}\//.test(t=e)||t.startsWith("/")||t.includes("/"))?"img":/^i-[^:]+:[^:]+/.test(e)?"unocss":e.startsWith("i-")&&!e.includes(":")?"css":e.includes(":")&&!e.startsWith("i-")?"iconify":/^[\w-]+$/.test(e)&&!e.startsWith("i-")?"svg":"css";var t}),c=s.computed(()=>{if(u.value)return"";const e=i.icon;return"img"===n.value||"unocss"===n.value||n.value,e}),v=s.computed(()=>"css"===n.value?c.value.split(" ").filter(e=>e.trim()):[]);function p(e){return e?"number"==typeof e||/^\d+(?:\.\d+)?$/.test(e)?`${e}px`:e:""}const f=s.computed(()=>{const e=[];switch(i.flip){case"horizontal":e.push("rotateY(180deg)");break;case"vertical":e.push("rotateX(180deg)");break;case"both":e.push("rotateX(180deg)"),e.push("rotateY(180deg)")}i.rotate&&e.push(`rotate(${i.rotate%360}deg)`);let t=`${i.color?`color: ${i.color};`:""}${i.size?`font-size: ${p(i.size)};`:""}${e.length?`transform: ${e.join(" ")};`:""}`;const s=r.style;if(s)if("string"==typeof s)t+=s;else if("object"==typeof s){t+=Object.entries(s).map(e=>{let[t,s]=e;return`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${s};`}).join("")}return t}),h=s.ref(!0),d=s.ref(!1);function y(){h.value=!1,d.value=!1}function g(){h.value=!1,d.value=!0}return()=>{if("component"===n.value)return s.h(i.icon,{class:["size-inherit","shrink-0",...o.value],style:f.value,...a.value});if("unocss"===n.value)return s.h("i",{class:[...o.value,c.value],style:f.value,...a.value});if("css"===n.value)return s.h("i",{class:["size-inherit","shrink-0",...o.value,...v.value],style:f.value,...a.value});if("iconify"===n.value){const t={class:["size-inherit","shrink-0",...o.value],icon:c.value,...a.value};if(i.color&&(t.color=i.color),i.flip&&(t.flip=i.flip),i.rotate&&(t.rotate=i.rotate),i.size){const e=p(i.size);t.width=e,t.height=e}const l=r.style;return l&&(t.style=l),s.h(e.Icon,t)}return"img"===n.value?h.value&&i.loading?s.h("i",{class:i.loading,...a.value}):d.value&&i.fallback?s.h("i",{class:i.fallback,...a.value}):s.h("img",{src:c.value,class:["size-inherit","shrink-0",...o.value],style:[f.value,{width:i.size?p(i.size):"auto",height:"auto"}],onLoad:y,onError:g,...a.value}):c.value?s.h("i",{class:o.value,style:f.value,...a.value},[s.h("svg",{"aria-hidden":"true",class:"size-inherit shrink-0"},[s.h("use",{"xlink:href":`#${i.localIconPrefix}${c.value}`})])]):null}}});exports.default=i;
2
+ //# sourceMappingURL=icon.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.cjs","sources":["../../../../../../packages/components/src/icon/src/icon.tsx"],"sourcesContent":["import type { Component, CSSProperties } from 'vue'\nimport { Icon } from '@iconify/vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { computed, defineComponent, h, ref, useAttrs } from 'vue'\n\nexport interface PropsType {\n icon: string | Component\n flip?: 'horizontal' | 'vertical' | 'both' | '' | undefined\n rotate?: number\n color?: string\n size?: string | number\n localIconPrefix?: string\n // 新增功能:支持图片URL\n fallback?: string // 加载失败时的备用图标\n loading?: string // 加载中显示的图标\n}\n\nexport default defineComponent({\n name: 'QxsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: [String, Object, Function] as any,\n required: true,\n },\n flip: {\n type: String as () => 'horizontal' | 'vertical' | 'both' | '' | undefined,\n default: '',\n },\n rotate: {\n type: Number,\n default: 0,\n },\n color: String,\n size: [String, Number],\n localIconPrefix: {\n type: String,\n default: 'icon-',\n },\n fallback: String,\n loading: String,\n },\n setup(props) {\n const attrs = useAttrs()\n const ns = useNamespace('icon')\n\n // 合并外部传入的类名\n const mergedClass = computed(() => {\n const classes: any[] = [ns.b()]\n if (attrs.class) {\n if (typeof attrs.class === 'string') {\n classes.push(attrs.class)\n }\n else if (Array.isArray(attrs.class)) {\n classes.push(...attrs.class)\n }\n else {\n classes.push(attrs.class)\n }\n }\n return classes\n })\n\n // 获取非 class 的其他属性\n const otherAttrs = computed(() => {\n const { class: _, style: __, ...rest } = attrs\n return rest\n })\n\n const isComponentName = computed(() => typeof props.icon === 'object' || typeof props.icon === 'function')\n\n const outputType = computed(() => {\n if (isComponentName.value) {\n return 'component'\n }\n\n const iconStr = props.icon as string\n\n // 检测是否为图片URL或路径\n const hasPathFeatures = (str: string) => {\n return /^\\.{1,2}\\//.test(str) || str.startsWith('/') || str.includes('/')\n }\n if (/^https?:\\/\\//.test(iconStr) || hasPathFeatures(iconStr)) {\n return 'img'\n }\n\n // 检测UnoCSS图标格式 (i-[provider]:[name])\n if (/^i-[^:]+:[^:]+/.test(iconStr)) {\n return 'unocss'\n }\n\n // 检测以i-开头的自定义CSS类图标(不包含冒号)\n if (iconStr.startsWith('i-') && !iconStr.includes(':')) {\n return 'css'\n }\n\n // 检测Iconify格式 (provider:name,但不以i-开头)\n if (iconStr.includes(':') && !iconStr.startsWith('i-')) {\n return 'iconify'\n }\n\n // 检测SVG sprite(单个单词,不包含空格和特殊字符,且不以i-开头)\n if (/^[\\w-]+$/.test(iconStr) && !iconStr.startsWith('i-')) {\n return 'svg'\n }\n\n // 其他情况都视为CSS类图标(包括多个类名等)\n return 'css'\n })\n\n const outputName = computed(() => {\n if (isComponentName.value) {\n return ''\n }\n\n const iconStr = props.icon as string\n\n // 对于图片类型,直接返回URL\n if (outputType.value === 'img') {\n return iconStr\n }\n\n // 对于UnoCSS图标,直接返回类名\n if (outputType.value === 'unocss') {\n return iconStr\n }\n\n // 对于传统CSS图标,处理多个类名的情况\n if (outputType.value === 'css') {\n return iconStr\n }\n\n // 其他情况直接返回\n return iconStr\n })\n\n // 对于CSS类图标,将字符串拆分为类名数组\n const cssClasses = computed(() => {\n if (outputType.value === 'css') {\n return outputName.value.split(' ').filter(cls => cls.trim())\n }\n return []\n })\n\n // 用正则匹配 size 是不是 number 值,再判断是否有 px 结尾的单位,没有则拼接\n function formatSize(size: string | number | undefined): string {\n if (!size) {\n return ''\n }\n\n // 如果是数字,直接添加 px\n if (typeof size === 'number') {\n return `${size}px`\n }\n\n // 如果是纯数字字符串,添加 px\n if (/^\\d+(?:\\.\\d+)?$/.test(size)) {\n return `${size}px`\n }\n\n // 如果已经有单位(px、em、rem等)或者不是纯数字,直接返回\n return size\n }\n\n // 统一的样式计算属性,适用于所有图标类型\n // 包含颜色、尺寸和变换(旋转、翻转)\n const style = computed(() => {\n const transform = [] as string[]\n switch (props.flip) {\n case 'horizontal':\n transform.push('rotateY(180deg)')\n break\n case 'vertical':\n transform.push('rotateX(180deg)')\n break\n case 'both':\n transform.push('rotateX(180deg)')\n transform.push('rotateY(180deg)')\n break\n // 对于 '' 和 undefined,不做任何处理\n }\n if (props.rotate) {\n transform.push(`rotate(${props.rotate % 360}deg)`)\n }\n\n // 构建基础样式\n let baseStyle = `${props.color ? `color: ${props.color};` : ''}${props.size ? `font-size: ${formatSize(props.size)};` : ''}${transform.length ? `transform: ${transform.join(' ')};` : ''}`\n\n // 拼接 attrs.style\n const attrsStyle = attrs.style\n if (attrsStyle) {\n if (typeof attrsStyle === 'string') {\n baseStyle += attrsStyle\n }\n else if (typeof attrsStyle === 'object') {\n // 处理对象形式的样式\n const styleEntries = Object.entries(attrsStyle as CSSProperties)\n const styleString = styleEntries\n .map(([key, value]) => `${key.replace(/([A-Z])/g, '-$1').toLowerCase()}: ${value};`)\n .join('')\n baseStyle += styleString\n }\n }\n\n return baseStyle\n })\n\n // 图片加载状态管理\n const imageLoading = ref(true)\n const imageError = ref(false)\n\n function handleImageLoad() {\n imageLoading.value = false\n imageError.value = false\n }\n\n function handleImageError() {\n imageLoading.value = false\n imageError.value = true\n }\n\n return () => {\n // Vue组件\n if (outputType.value === 'component') {\n return h(\n props.icon as Component,\n {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // UnoCSS图标\n if (outputType.value === 'unocss') {\n return h(\n 'i',\n {\n class: [...mergedClass.value, outputName.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // CSS类图标\n if (outputType.value === 'css') {\n return h(\n 'i',\n {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value, ...cssClasses.value],\n style: style.value,\n ...otherAttrs.value,\n },\n )\n }\n\n // Iconify图标\n if (outputType.value === 'iconify') {\n // Iconify 组件有自己的 color、width、height、flip、rotate 等属性\n // 需要单独处理这些属性\n const iconifyProps: any = {\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n icon: outputName.value,\n ...otherAttrs.value,\n }\n\n // 传递 color 属性给 Iconify\n if (props.color) {\n iconifyProps.color = props.color\n }\n\n // 传递 flip 属性给 Iconify\n if (props.flip) {\n iconifyProps.flip = props.flip\n }\n\n // 传递 rotate 属性给 Iconify\n if (props.rotate) {\n iconifyProps.rotate = props.rotate\n }\n\n // 处理 size - Iconify 使用 width 和 height\n if (props.size) {\n const formattedSize = formatSize(props.size)\n iconifyProps.width = formattedSize\n iconifyProps.height = formattedSize\n }\n\n // 如果有额外的 style,也要传递\n const attrsStyle = attrs.style\n if (attrsStyle) {\n iconifyProps.style = attrsStyle\n }\n\n return h(Icon, iconifyProps)\n }\n\n // 图片\n if (outputType.value === 'img') {\n // 加载中状态\n if (imageLoading.value && props.loading) {\n return h('i', {\n class: props.loading,\n ...otherAttrs.value,\n })\n }\n // 错误状态\n if (imageError.value && props.fallback) {\n return h('i', {\n class: props.fallback,\n ...otherAttrs.value,\n })\n }\n // 图片本体\n return h('img', {\n src: outputName.value,\n class: ['size-inherit', 'shrink-0', ...mergedClass.value],\n style: [style.value, { width: props.size ? formatSize(props.size) : 'auto', height: 'auto' }],\n onLoad: handleImageLoad,\n onError: handleImageError,\n ...otherAttrs.value,\n })\n }\n\n // SVG Sprite\n if (outputName.value) {\n return h(\n 'i',\n {\n class: mergedClass.value,\n style: style.value,\n ...otherAttrs.value,\n },\n [\n h(\n 'svg',\n {\n 'aria-hidden': 'true',\n 'class': 'size-inherit shrink-0',\n },\n [\n h('use', {\n 'xlink:href': `#${props.localIconPrefix}${outputName.value}`,\n }),\n ],\n ),\n ],\n )\n }\n\n return null\n }\n },\n})\n"],"names":["component","defineComponent","name","inheritAttrs","props","icon","type","String","Object","Function","required","flip","default","rotate","Number","color","size","localIconPrefix","fallback","loading","setup","attrs","useAttrs","ns","useNamespace","mergedClass","computed","classes","b","class","push","Array","isArray","otherAttrs","_","style","__","rest","isComponentName","outputType","value","iconStr","test","str","startsWith","includes","outputName","cssClasses","split","filter","cls","trim","formatSize","transform","baseStyle","length","join","attrsStyle","entries","map","_ref","key","replace","toLowerCase","imageLoading","ref","imageError","handleImageLoad","handleImageError","h","iconifyProps","formattedSize","width","height","Icon","src","onLoad","onError"],"mappings":"yPAiBAA,EAAeC,kBAAgB,CAC7BC,KAAM,UACNC,cAAc,EACdC,MAAO,CACLC,KAAM,CACJC,KAAM,CAACC,OAAQC,OAAQC,UACvBC,UAAU,GAEZC,KAAM,CACJL,KAAMC,OACNK,QAAS,IAEXC,OAAQ,CACNP,KAAMQ,OACNF,QAAS,GAEXG,MAAOR,OACPS,KAAM,CAACT,OAAQO,QACfG,gBAAiB,CACfX,KAAMC,OACNK,QAAS,SAEXM,SAAUX,OACVY,QAASZ,QAEXa,KAAAA,CAAMhB,GACJ,MAAMiB,EAAQC,EAAAA,WACRC,EAAKC,EAAAA,aAAa,QAGlBC,EAAcC,EAAAA,SAAS,KAC3B,MAAMC,EAAiB,CAACJ,EAAGK,KAY3B,OAXIP,EAAMQ,QACmB,iBAAhBR,E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CAAC,eAAgB,cAAeJ,EAAYe,OACnDnC,KAAMyC,EAAWN,SACdP,EAAWO,OAmBhB,GAfIpC,EAAMW,QACRuD,EAAavD,MAAQX,EAAMW,OAIzBX,EAAMO,OACR2D,EAAa3D,KAAOP,EAAMO,MAIxBP,EAAMS,SACRyD,EAAazD,OAAST,EAAMS,QAI1BT,EAAMY,KAAM,CACd,MAAMuD,EAAgBnB,EAAWhD,EAAMY,MACvCsD,EAAaE,MAAQD,EACrBD,EAAaG,OAASF,CACxB,CAGA,MAAMd,EAAapC,EAAMc,MAKzB,OAJIsB,IACFa,EAAanC,MAAQsB,GAGhBY,EAAAA,EAAEK,EAAAA,KAAMJ,EACjB,CAGA,MAAyB,QAArB/B,EAAWC,MAETwB,EAAaxB,OAASpC,EAAMe,QACvBkD,EAAAA,EAAE,IAAK,CACZxC,MAAOzB,EAAMe,WACVc,EAAWO,QAId0B,EAAW1B,OAASpC,EAAMc,SACrBmD,EAAAA,EAAE,IAAK,CACZxC,MAAOzB,EAAMc,YACVe,EAAWO,QAIX6B,EAAAA,EAAE,MAAO,CACdM,IAAK7B,EAAWN,MAChBX,MAAO,CAAC,eAAgB,cAAeJ,EAAYe,OACnDL,MAAO,CAACA,EAAMK,MAAO,CAAEgC,MAAOpE,EAAMY,KAAOoC,EAAWhD,EAAMY,MAAQ,OAAQyD,OAAQ,SACpFG,OAAQT,EACRU,QAAST,KACNnC,EAAWO,QAKdM,EAAWN,MACN6B,EAAAA,EACL,IACA,CACExC,MAAOJ,EAAYe,MACnBL,MAAOA,EAAMK,SACVP,EAAWO,OAEhB,CACE6B,EAAAA,EACE,MACA,CACE,cAAe,OACfxC,MAAS,yBAEX,CACEwC,EAAAA,EAAE,MAAO,CACP,aAAc,IAAIjE,EAAMa,kBAAkB6B,EAAWN,cAQ1D,KAEX"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
3
  "type": "module",
4
- "version": "0.0.85",
4
+ "version": "0.0.87",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://qxs-bns.pages.dev/guide/components/overview.html",
@@ -1,5 +1,53 @@
1
- import type { PropsType } from './src/icon.vue';
2
- declare const QxsIcon: import("../withInstall").SFCWithInstall<import("vue").DefineComponent<PropsType, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PropsType> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>> & Record<string, any>;
1
+ import type { PropsType } from './src/icon';
2
+ declare const QxsIcon: import("../withInstall").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ icon: {
4
+ type: any;
5
+ required: true;
6
+ };
7
+ flip: {
8
+ type: () => "horizontal" | "vertical" | "both" | "" | undefined;
9
+ default: string;
10
+ };
11
+ rotate: {
12
+ type: NumberConstructor;
13
+ default: number;
14
+ };
15
+ color: StringConstructor;
16
+ size: (NumberConstructor | StringConstructor)[];
17
+ localIconPrefix: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ fallback: StringConstructor;
22
+ loading: StringConstructor;
23
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
+ [key: string]: any;
25
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ icon: {
27
+ type: any;
28
+ required: true;
29
+ };
30
+ flip: {
31
+ type: () => "horizontal" | "vertical" | "both" | "" | undefined;
32
+ default: string;
33
+ };
34
+ rotate: {
35
+ type: NumberConstructor;
36
+ default: number;
37
+ };
38
+ color: StringConstructor;
39
+ size: (NumberConstructor | StringConstructor)[];
40
+ localIconPrefix: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ fallback: StringConstructor;
45
+ loading: StringConstructor;
46
+ }>> & Readonly<{}>, {
47
+ rotate: number;
48
+ flip: "" | "vertical" | "horizontal" | "both" | undefined;
49
+ localIconPrefix: string;
50
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
3
51
  declare function createQxsIcon(opt: PropsType | string): import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
52
  [key: string]: any;
5
53
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/components/src/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAK/C,QAAA,MAAM,OAAO,6VAAyB,CAAA;AAGtC,iBAAS,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;;4OAO7C;AAED,OAAO,EACL,aAAa,EACb,OAAO,GACR,CAAA;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/components/src/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAK3C,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mGAAyB,CAAA;AAGtC,iBAAS,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;;4OAO7C;AAED,OAAO,EACL,aAAa,EACb,OAAO,GACR,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,62 @@
1
+ import type { Component } from 'vue';
2
+ export interface PropsType {
3
+ icon: string | Component;
4
+ flip?: 'horizontal' | 'vertical' | 'both' | '' | undefined;
5
+ rotate?: number;
6
+ color?: string;
7
+ size?: string | number;
8
+ localIconPrefix?: string;
9
+ fallback?: string;
10
+ loading?: string;
11
+ }
12
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ icon: {
14
+ type: any;
15
+ required: true;
16
+ };
17
+ flip: {
18
+ type: () => "horizontal" | "vertical" | "both" | "" | undefined;
19
+ default: string;
20
+ };
21
+ rotate: {
22
+ type: NumberConstructor;
23
+ default: number;
24
+ };
25
+ color: StringConstructor;
26
+ size: (NumberConstructor | StringConstructor)[];
27
+ localIconPrefix: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ fallback: StringConstructor;
32
+ loading: StringConstructor;
33
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
34
+ [key: string]: any;
35
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
36
+ icon: {
37
+ type: any;
38
+ required: true;
39
+ };
40
+ flip: {
41
+ type: () => "horizontal" | "vertical" | "both" | "" | undefined;
42
+ default: string;
43
+ };
44
+ rotate: {
45
+ type: NumberConstructor;
46
+ default: number;
47
+ };
48
+ color: StringConstructor;
49
+ size: (NumberConstructor | StringConstructor)[];
50
+ localIconPrefix: {
51
+ type: StringConstructor;
52
+ default: string;
53
+ };
54
+ fallback: StringConstructor;
55
+ loading: StringConstructor;
56
+ }>> & Readonly<{}>, {
57
+ rotate: number;
58
+ flip: "" | "vertical" | "horizontal" | "both" | undefined;
59
+ localIconPrefix: string;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
61
+ export default _default;
62
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/icon/src/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,KAAK,CAAA;AAKnD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE,GAAG,SAAS,CAAA;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;;;cAOyC,GAAG;;;;cAIvB,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE,GAAG,SAAS;;;;;;;;;;;;;;;;;;;cAJrC,GAAG;;;;cAIvB,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;AAT/E,wBAkVE"}