@rft-rc/recycle-ui 0.0.2-rc.1 → 0.0.2-rc.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.
@@ -10,10 +10,22 @@ export interface FilterItem {
10
10
  key: string;
11
11
  /** 选项列表 */
12
12
  options: FilterOption[] | string[];
13
- /** 筛选类型:single 单选,multiple 多选(默认) */
14
- type?: 'single' | 'multiple';
13
+ /** 筛选类型:single 单选,multiple 多选,tree-single 树形单选,tree-multiple 树形多选,input 输入框(默认 multiple) */
14
+ type?: 'single' | 'multiple' | 'tree-single' | 'tree-multiple' | 'input';
15
15
  /** 多选时的列数(默认 2) */
16
16
  column?: number;
17
+ /** 格式化 value,默认返回原始数据。为 string 时,会作为 key 从原始数据中获取值,相当于 (d) => d[format]。为函数时,以函数返回结果作为 value */
18
+ format?: ((data: FilterOption) => any) | string;
19
+ /** 渲染选项内容。为 string 时,返回 d[string]。为 function 时,返回函数结果 */
20
+ renderItem?: ((data: FilterOption) => any) | string;
21
+ /** 选中后在结果中显示的内容,默认和 renderItem 相同 */
22
+ renderResult?: ((data: FilterOption) => any) | string;
23
+ /** 树形数据下,指定子数据的属性名,有值时可以展示树形结构 */
24
+ childrenKey?: string;
25
+ /** 输入框类型的占位符(仅 type='input' 时有效) */
26
+ placeholder?: string;
27
+ /** 是否使用插槽自定义渲染,为 true 时使用名为 key 的插槽 */
28
+ slot?: boolean;
17
29
  }
18
30
  type __VLS_Props = {
19
31
  /** 筛选项配置 */
@@ -23,7 +35,14 @@ type __VLS_Props = {
23
35
  /** 是否显示蒙层 */
24
36
  showMask?: boolean;
25
37
  };
26
- declare const _default: import("vue").DefineComponent<__VLS_Props, {
38
+ declare var __VLS_14: string, __VLS_15: {
39
+ value: any;
40
+ 'update:value': (val: any) => void;
41
+ };
42
+ type __VLS_Slots = {} & {
43
+ [K in NonNullable<typeof __VLS_14>]?: (props: typeof __VLS_15) => any;
44
+ };
45
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
27
46
  /** 获取当前筛选值 */
28
47
  getValues: () => {
29
48
  [x: string]: any;
@@ -33,19 +52,19 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
33
52
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
34
53
  "update:modelValue": (values: Record<string, any>) => any;
35
54
  change: (values: Record<string, any>, item: FilterItem) => any;
36
- confirm: (values: Record<string, any>, item: FilterItem) => any;
37
- reset: (key?: string | undefined) => any;
38
- "item-change": (key: string, value: any) => any;
39
55
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
40
56
  "onUpdate:modelValue"?: ((values: Record<string, any>) => any) | undefined;
41
57
  onChange?: ((values: Record<string, any>, item: FilterItem) => any) | undefined;
42
- onConfirm?: ((values: Record<string, any>, item: FilterItem) => any) | undefined;
43
- onReset?: ((key?: string | undefined) => any) | undefined;
44
- "onItem-change"?: ((key: string, value: any) => any) | undefined;
45
58
  }>, {
46
59
  items: FilterItem[];
47
60
  modelValue: Record<string, any>;
48
61
  showMask: boolean;
49
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
63
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
64
  export default _default;
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
51
70
  //# sourceMappingURL=index.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/search-area/index.vue"],"names":[],"mappings":"AAsrBA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,qCAAqC;IACrC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,WAAW,GAAG;IACjB,YAAY;IACZ,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;IA+TA,cAAc;;;;IAEd,aAAa;;;;;;;;;;;;;;;WAtUN,UAAU,EAAE;gBAEN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cAErB,OAAO;;AA6mBpB,wBASG"}
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/search-area/index.vue"],"names":[],"mappings":"AAwmCA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,4FAA4F;IAC5F,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,eAAe,GAAG,OAAO,CAAC;IACzE,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC;IAChD,yDAAyD;IACzD,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC;IACpD,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC;IACtD,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,KAAK,WAAW,GAAG;IACjB,YAAY;IACZ,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAs/BF,QAAA,IAAI,QAAQ,QAAW,EAAE,QAAQ;;0BAvRV,GAAG;CAuRmB,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;KAAG,CAAC,IAAI,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG;CAAE,CAAC;AAgD5E,QAAA,MAAM,eAAe;IAtcnB,cAAc;;;;IAEd,aAAa;;;;;;;;;WAzmBN,UAAU,EAAE;gBAEN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cAErB,OAAO;6EAkjClB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),me={key:0,class:"rc-icon__unicode"},fe=e.defineComponent({name:"rc-icon",__name:"index",props:{name:{},size:{default:16},color:{default:""},spin:{type:Boolean,default:!1},code:{default:""}},setup(t){const n=t,a=e.inject(W,{}),i=e.computed(()=>(a==null?void 0:a.iconClass)||"iconfont"),f=e.computed(()=>n.name||""),m=e.computed(()=>typeof n.size=="number"?`${n.size}px`:n.size||"16px"),u=e.computed(()=>({fontSize:m.value,color:n.color||void 0,lineHeight:1,fontFamily:(a==null?void 0:a.iconClass)||"iconfont"})),c=e.computed(()=>{const r=n.code;if(r==null||r===""||r===0)return"";if(typeof r=="number")return String.fromCharCode(r);const s=String(r).replace(/^0x/i,""),g=parseInt(s,16);return Number.isNaN(g)?"":String.fromCharCode(g)});return e.onMounted(()=>{if(typeof window>"u")return;const r=a&&a.iconCssUrl||H.iconCssUrl;if(!r)return;const s=`link[rel="stylesheet"][data-rcui-icon="true"][href="${r}"]`;if(!document.head.querySelector(s)){const v=document.createElement("link");v.rel="stylesheet",v.href=r,v.setAttribute("data-rcui-icon","true"),document.head.appendChild(v)}}),(r,s)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["rc-icon",[i.value,f.value,{"rc-icon--spin":t.spin}]]),style:e.normalizeStyle(u.value),"aria-hidden":"true"},[c.value?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)],6))}}),E=(t,n)=>{const a=t.__vccOpts||t;for(const[i,f]of n)a[i]=f;return a},b=E(fe,[["__scopeId","data-v-3857a892"]]),pe=["disabled"],ve={key:0,class:"rc-button__spinner"},ye={key:0,class:"rc-button__icon rc-button__icon--prefix"},ke={key:2,class:"rc-button__icon rc-button__icon--suffix"},ge=e.defineComponent({__name:"index",props:{type:{default:"default"},size:{default:"medium"},mode:{default:void 0},block:{type:Boolean,default:!1},label:{default:""},round:{type:[Number,String,Boolean],default:6},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},preIcon:{default:""},suffixIcon:{default:""}},emits:["click"],setup(t,{emit:n}){const a=t,i=n,f=u=>{!a.disabled&&!a.loading&&i("click",u)},m=e.computed(()=>{const u=a.round;return typeof u=="boolean"?u?"999px":"6px":typeof u=="number"?`${u}px`:String(u)});return(u,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["rc-button",[`rc-button--${t.type}`,`rc-button--${t.size}`,t.mode?`rc-button--${t.mode}`:"",{"is-block":t.block,"is-disabled":t.disabled,"is-loading":t.loading}]]),style:e.normalizeStyle({borderRadius:m.value}),disabled:t.disabled||t.loading,onClick:f},[t.loading?(e.openBlock(),e.createElementBlock("span",ve)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.preIcon||u.$slots.preIcon?(e.openBlock(),e.createElementBlock("span",ye,[e.renderSlot(u.$slots,"preIcon",{},()=>[t.preIcon?(e.openBlock(),e.createBlock(b,{key:0,name:t.preIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],64)),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0),!t.loading&&(t.suffixIcon||u.$slots.suffixIcon)?(e.openBlock(),e.createElementBlock("span",ke,[e.renderSlot(u.$slots,"suffixIcon",{},()=>[t.suffixIcon?(e.openBlock(),e.createBlock(b,{key:0,name:t.suffixIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],14,pe))}}),I=E(ge,[["__scopeId","data-v-3ed3109f"]]);I.name="rc-button";function U(t){return t.component(I.name,I),t}const he={class:"rc-desc-item__value"},_e=e.defineComponent({name:"rc-descriptions-item",__name:"item",props:{label:{default:""},value:{default:""},labelWidth:{default:""},span:{default:1}},setup(t){const n=t;e.inject("rcDescItemWidth",void 0),e.inject("rcDescSingleWidth",""),e.inject("rcDescGap","0px");const a=e.inject("rcDescGapPx",0),i=e.inject("rcDescColCount",1),f=e.inject("rcDescLabelWidth",""),m=e.computed(()=>{const r=typeof n.span=="string"?parseInt(n.span,10):n.span,s=typeof(i==null?void 0:i.value)=="number"?i.value:i,g=!Number.isNaN(r)&&r>0?r:1;return Math.min(g,s||1)}),u=e.computed(()=>{const r=typeof(i==null?void 0:i.value)=="number"?i.value:i,s=typeof(a==null?void 0:a.value)=="number"?a.value:a,g=m.value;if(!r||r<=1||g>=r)return"100%";const v=(r-1)*s,k=(g-1)*s;return`calc((100% - ${v}px) * ${g} / ${r} + ${k}px)`}),c=e.computed(()=>{const r=typeof(f==null?void 0:f.value)=="string"?f.value:f,s=n.labelWidth!==""?n.labelWidth:r||"";return s?{width:typeof s=="number"?`${s}px`:String(s),flex:"0 0 auto"}:{}});return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:"rc-desc-item",style:e.normalizeStyle({width:u.value,flex:`0 0 ${u.value}`})},[e.createElementVNode("div",{class:"rc-desc-item__label",style:e.normalizeStyle(c.value)},[e.renderSlot(r.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)],4),e.createElementVNode("div",he,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)],!0)])],4))}}),N=E(_e,[["__scopeId","data-v-970d0b99"]]),be={class:"rc-descriptions"},Be={key:0,class:"rc-descriptions__title"},Ce=e.defineComponent({name:"rc-descriptions",__name:"index",props:{title:{},column:{default:2},gap:{default:4},labelWidth:{default:""},data:{default:()=>[]},keyMap:{}},setup(t){const n=t,a=e.ref(null),i=e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap)),f=e.computed(()=>{const s=typeof n.column=="string"?Number.parseInt(n.column,10):n.column??1;return!Number.isNaN(s)&&s>0?s:1}),m=e.ref("100%"),u=e.ref("100%");e.watchEffect(()=>{const s=f.value;if(s<=1)m.value="100%",u.value="100%";else{const g=typeof n.gap=="number"?n.gap:parseFloat(String(n.gap))||0,k=`calc((100% - ${(s-1)*g}px) / ${s})`;u.value=k,m.value=k}}),e.provide("rcDescItemWidth",m),e.provide("rcDescSingleWidth",u),e.provide("rcDescColCount",f),e.provide("rcDescGapPx",e.computed(()=>typeof n.gap=="number"?n.gap:parseFloat(String(n.gap))||0));const c=e.computed(()=>n.labelWidth===""||n.labelWidth===void 0?"":typeof n.labelWidth=="number"?`${n.labelWidth}px`:String(n.labelWidth));e.provide("rcDescLabelWidth",c),e.provide("rcDescGap",e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap)));const r=e.computed(()=>{var v,k,y;const s=((v=n.keyMap)==null?void 0:v.key)??"label",g=((k=n.keyMap)==null?void 0:k.value)??"value";return(y=n.data)!=null&&y.length?n.data.map(C=>({label:C==null?void 0:C[s],value:C==null?void 0:C[g]})):[]});return(s,g)=>(e.openBlock(),e.createElementBlock("div",be,[s.$slots.title||t.title?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(s.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-descriptions__body",style:e.normalizeStyle({gap:i.value}),ref_key:"wrapEl",ref:a},[r.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(v,k)=>(e.openBlock(),e.createBlock(N,{key:k,label:v.label,value:v.value,"label-width":t.labelWidth},null,8,["label","value","label-width"]))),128)):e.renderSlot(s.$slots,"default",{key:1},void 0,!0)],4)]))}}),D=E(Ce,[["__scopeId","data-v-5fcaa235"]]);D.name="rc-descriptions";N.name="rc-descriptions-item";function O(t){return t.component(D.name,D),t.component("RcDescriptions",D),t.component(N.name,N),t.component("RcDescriptionsItem",N),t}const ee=D,te=N,$e={class:"rc-card__title"},Se={class:"rc-card__title-text"},Ee={key:0,class:"rc-card__status"},Ve={key:1,class:"rc-card__divider"},xe={key:2,class:"rc-card__action"},Ne=e.defineComponent({name:"rc-card",__name:"index",props:{color:{default:"var(--rc-white)"},topBgColor:{default:"rgba(29, 133, 252, 0.05)"},title:{default:""},status:{default:""},statusColor:{default:"var(--rc-primary)"},round:{default:8},bordered:{type:Boolean,default:!1},elevation:{default:2},padding:{default:"16px"},gap:{default:12},width:{default:"100%"},height:{default:""}},setup(t){const n=t,a=e.computed(()=>{const c=typeof n.round=="boolean"?n.round?"12px":"0":typeof n.round=="number"?`${n.round}px`:String(n.round);return{backgroundColor:n.color||"var(--rc-white)",borderRadius:c,boxShadow:u(n.elevation),width:m(n.width),height:m(n.height)}}),i=e.computed(()=>n.padding||"16px"),f=e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap));function m(c){return c==null||c===""?"":typeof c=="number"?`${c}px`:String(c)}function u(c){if(!c||c<=0)return"none";const r=4*c;return`0 ${Math.round(r/2)}px ${r}px rgba(0,0,0,0.06), 0 ${Math.round(r/4)}px ${Math.round(r/2)}px rgba(0,0,0,0.04)`}return(c,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rc-card",[{"rc-card--bordered":t.bordered}]]),style:e.normalizeStyle(a.value)},[c.$slots.title||t.title||c.$slots.status||t.status?(e.openBlock(),e.createElementBlock("div",{key:0,class:"rc-card__top",style:e.normalizeStyle({backgroundColor:t.topBgColor||"rgba(29, 133, 252, 0.05)"})},[e.createElementVNode("div",$e,[e.renderSlot(c.$slots,"title",{},()=>[e.createElementVNode("span",Se,e.toDisplayString(t.title),1)],!0)]),c.$slots.status||t.status?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(c.$slots,"status",{},()=>[e.createElementVNode("span",{class:"rc-card__status-text",style:e.normalizeStyle({color:t.statusColor||"var(--rc-primary)"})},e.toDisplayString(t.status),5)],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-card__body",style:e.normalizeStyle({padding:i.value,gap:f.value})},[e.renderSlot(c.$slots,"content",{},()=>[e.renderSlot(c.$slots,"default",{},void 0,!0)],!0)],4),c.$slots.action?(e.openBlock(),e.createElementBlock("div",Ve)):e.createCommentVNode("",!0),c.$slots.action?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(c.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),R=E(Ne,[["__scopeId","data-v-a7b95214"]]);R.name="rc-card";const we="RcCard";function j(t){return t.component(R.name,R),t.component(we,R),t}const Ie={key:0,class:"rc-toast__mask"},De={class:"rc-toast__content"},Re={key:0,class:"rc-toast__spinner"},ze={key:1,class:"rc-toast__icon rc-toast__icon--success"},Ae={key:2,class:"rc-toast__icon rc-toast__icon--fail"},Te={class:"rc-toast__text"},Le=e.defineComponent({__name:"index",props:{message:{default:""},type:{default:"text"},duration:{default:2e3},mask:{type:Boolean,default:!1},onAfterLeave:{}},setup(t,{expose:n}){const a=t,i=e.ref(!0);let f;function m(){f&&(clearTimeout(f),f=null)}function u(){m(),i.value=!1}return n({close:u}),e.onMounted(()=>{a.duration&&a.duration>0&&(f=setTimeout(()=>{u()},a.duration))}),e.onUnmounted(()=>{m()}),(c,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"rc-toast-fade",onAfterLeave:t.onAfterLeave},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-toast",[`rc-toast--${t.type}`]])},[t.mask?(e.openBlock(),e.createElementBlock("div",Ie)):e.createCommentVNode("",!0),e.createElementVNode("div",De,[t.type==="loading"?(e.openBlock(),e.createElementBlock("div",Re)):t.type==="success"?(e.openBlock(),e.createElementBlock("div",ze)):t.type==="fail"?(e.openBlock(),e.createElementBlock("div",Ae)):e.createCommentVNode("",!0),e.createElementVNode("div",Te,e.toDisplayString(t.message),1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["onAfterLeave"])])),e.renderSlot(c.$slots,"default",{},void 0,!0)],64))}}),z=E(Le,[["__scopeId","data-v-d234c9c5"]]);let V=null,w=null;function X(){V&&(V.unmount(),V=null),w&&(document.body.removeChild(w),w=null)}function We(t){const n=typeof t=="string"?{message:t}:t||{};X(),w=document.createElement("div"),document.body.appendChild(w);const a={message:n.message,type:n.type??"text",duration:n.duration??2e3,mask:n.mask??!1,onAfterLeave:()=>{var i;X(),(i=n.onClose)==null||i.call(n)}};return V=e.createApp(z,a),V.mount(w),{close:ne}}function ne(){var t,n,a;V&&((a=(n=(t=V._instance)==null?void 0:t.exposed)==null?void 0:n.close)==null||a.call(n))}z.name="rc-toast";function Z(t){return t.component(z.name,z),t}const Me={class:"rc-message",role:"alert","aria-live":"polite"},Fe={class:"rc-message__content"},Ue=e.defineComponent({__name:"index",setup(t,{expose:n}){const a=e.reactive([]);let i=1;function f(u){const c=a.findIndex(r=>r.id===u);c>=0&&a.splice(c,1)}function m(u,c,r){const s=i++;return a.push({id:s,type:u,content:c,duration:r}),r>0&&window.setTimeout(()=>f(s),r),s}return n({add:m,remove:f}),(u,c)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.TransitionGroup,{name:"rc-message-fade",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["rc-message__item",`rc-message--${r.type}`])},[e.createElementVNode("span",Fe,e.toDisplayString(r.content),1)],2))),128))]),_:1})]))}}),Oe=E(Ue,[["__scopeId","data-v-87811df0"]]);let S=null,$=null;function je(){var n;if(S&&$)return;S=document.createElement("div"),document.body.appendChild(S);const t=e.createVNode(Oe,{});e.render(t,S),$=(n=t.component)==null?void 0:n.exposed}function x(t,n,a){var f;je();const i=typeof a=="number"?a:t==="loading"?0:2e3;return(f=$==null?void 0:$.add)==null?void 0:f.call($,t,n,i)}const oe={open(t){return x(t.type||"info",t.content,t.duration)},info(t,n){return x("info",t,n)},success(t,n){return x("success",t,n)},warning(t,n){return x("warning",t,n)},error(t,n){return x("error",t,n)},loading(t,n){return x("loading",t,n)},destroy(){S&&(e.render(null,S),S.remove(),S=null,$=null)}};function G(t){return t.config.globalProperties.$message=oe,t}b.name="rc-icon";function P(t){return t.component(b.name,b),t.component("RcIcon",b),t}const Ge={class:"rc-search-area"},Pe={class:"rc-search-area__bar"},Ye=["onClick"],qe={class:"rc-search-area__item-label"},He={class:"rc-search-area__panel-content"},Ke={key:0,class:"rc-search-area__options-grid"},Je=["onClick"],Qe={class:"rc-search-area__option-label"},Xe={key:1,class:"rc-search-area__options-grid"},Ze=["onClick"],et={class:"rc-search-area__option-label"},tt={key:2,class:"rc-search-area__empty"},nt={class:"rc-search-area__panel-footer"},ot=e.defineComponent({name:"rc-search-area",__name:"index",props:{items:{default:()=>[]},modelValue:{default:()=>({})},showMask:{type:Boolean,default:!0}},emits:["update:modelValue","change","confirm","reset","item-change"],setup(t,{expose:n,emit:a}){const i=t,f=a,m=e.ref(null),u=e.ref(null),c=e.ref(null),r=e.ref({top:"0px"}),s=async()=>{if(m.value===null||!u.value)return;await e.nextTick();const l=u.value.getBoundingClientRect().top;r.value={top:`${l}px`}},g=o=>{if(m.value===null||!u.value)return;const l=o.target;if(u.value.contains(l))return;const d=u.value.closest(".rc-search-area");if(d){const p=d.querySelector(".rc-search-area__bar");if(p&&p.contains(l))return}M()};e.watch(m,async o=>{o!==null?(await e.nextTick(),s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),document.addEventListener("click",g,!0)):(window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0),document.removeEventListener("click",g,!0))}),e.onUnmounted(()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0),document.removeEventListener("click",g,!0)});const v=e.ref({}),k=e.ref({...i.modelValue});e.watch(()=>i.modelValue,o=>{k.value={...o||{}}},{deep:!0,immediate:!0});const y=e.computed(()=>m.value===null?null:i.items[m.value]),C=e.computed(()=>{if(!y.value)return"";const o=ue(y.value);return o>0?`(${o}项)`:""}),le=o=>{const l=k.value[o.key];if(l==null||l==="")return o.label;if(o.type==="single"){const d=J(o,l);if(d)return`${o.label}: ${A(d)}`}else{const d=Array.isArray(l)?l:[l];if(d.length>0){const p=d.map(h=>{const _=J(o,h);return _?A(_):null}).filter(h=>h!==null);if(p.length>0)return`${o.label}: ${p.join("、")}`}}return o.label},ae=o=>{const l=i.items[o];if(!l)return;if(m.value===o){m.value=null;return}const d=k.value[l.key];l.type==="single"?v.value[l.key]=d!==void 0?d:null:v.value[l.key]=d!==void 0?Array.isArray(d)?[...d]:[d]:[],m.value=o},M=()=>{m.value=null},A=o=>typeof o=="string"?o:o.label||String(o.value),T=o=>typeof o=="string"?o:o.value!==void 0?o.value:o,J=(o,l)=>o.options.find(d=>{const p=T(d);return p===l||String(p)===String(l)})||null,L=o=>{if(!y.value)return!1;const l=y.value.key,d=v.value[l],p=T(o);return y.value.type==="single"?d!=null&&d===p:(Array.isArray(d)?d:[]).some(_=>_===p||String(_)===String(p))},re=o=>{if(!y.value)return;const l=y.value.key,d=T(o);v.value[l]===d?v.value[l]=null:v.value[l]=d},ce=o=>{if(!y.value)return;const l=y.value.key,d=T(o),p=Array.isArray(v.value[l])?[...v.value[l]]:[],h=p.findIndex(_=>_===d||String(_)===String(d));h>=0?p.splice(h,1):p.push(d),v.value[l]=p},se=()=>{if(!y.value)return;const o=y.value.key;y.value.type==="single"?v.value[o]=null:v.value[o]=[]},ie=()=>{if(!y.value)return;const o=y.value.key,l=v.value[o],d=k.value[o];let p;y.value.type==="single"?(p=l??void 0,k.value[o]=p):(p=Array.isArray(l)&&l.length>0?l:void 0,k.value[o]=p),f("update:modelValue",{...k.value}),f("change",{...k.value},y.value),f("confirm",{...k.value},y.value),JSON.stringify(d)!==JSON.stringify(p)&&f("item-change",o,p),M()},Q=o=>{const l=k.value[o.key];return l==null||l===""?0:o.type==="single"?1:Array.isArray(l)?l.length:l?1:0},ue=o=>{const l=v.value[o.key];return l==null||l===""?0:o.type==="single"?1:Array.isArray(l)?l.length:0};return n({getValues:()=>({...k.value}),reset:()=>{k.value={},v.value={},f("update:modelValue",{}),f("change",{},null),f("reset")}}),(o,l)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.items,(d,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:e.normalizeClass(["rc-search-area__item",{"is-active":m.value===p,"has-value":Q(d)>0}]),onClick:h=>ae(p)},[e.createElementVNode("span",qe,e.toDisplayString(le(d)),1),e.createVNode(e.unref(b),{name:"icon_a-xiala2",color:m.value!==p&&Q(d)>0?"#1677ff":"#969799",class:e.normalizeClass(["rc-search-area__item-arrow",{"is-up":m.value===p}])},null,8,["color","class"])],10,Ye))),128))]),e.createVNode(e.Transition,{name:"rc-search-area-fade"},{default:e.withCtx(()=>[m.value!==null&&i.showMask?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"maskRef",ref:c,class:"rc-search-area__mask",style:e.normalizeStyle(r.value),onClick:M},null,4)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"rc-search-area-slide"},{default:e.withCtx(()=>{var d,p,h,_;return[m.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"panelRef",ref:u,class:"rc-search-area__panel"},[e.createElementVNode("div",He,[((d=y.value)==null?void 0:d.type)==="single"?(e.openBlock(),e.createElementBlock("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value.options,(B,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:e.normalizeClass(["rc-search-area__option",{"is-selected":L(B)}]),onClick:de=>re(B)},[e.createElementVNode("span",Qe,e.toDisplayString(A(B)),1),L(B)?(e.openBlock(),e.createBlock(e.unref(b),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,Je))),128))])):(e.openBlock(),e.createElementBlock("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((p=y.value)==null?void 0:p.options)||[],(B,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:e.normalizeClass(["rc-search-area__option",{"is-selected":L(B)}]),onClick:de=>ce(B)},[e.createElementVNode("span",et,e.toDisplayString(A(B)),1),L(B)?(e.openBlock(),e.createBlock(e.unref(b),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,Ze))),128))])),((_=(h=y.value)==null?void 0:h.options)==null?void 0:_.length)===0?(e.openBlock(),e.createElementBlock("div",tt,[...l[0]||(l[0]=[e.createElementVNode("p",null,"暂无选项",-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",nt,[e.createVNode(e.unref(I),{block:"",onClick:se},{default:e.withCtx(()=>[...l[1]||(l[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1}),e.createVNode(e.unref(I),{type:"primary",block:"",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(" 确定"+e.toDisplayString(C.value),1)]),_:1})])],512)):e.createCommentVNode("",!0)]}),_:1})]))}}),Y=E(ot,[["__scopeId","data-v-6a70650d"]]),q=t=>{t.component("RcSearchArea",Y),t.component("rc-search-area",Y)},W=Symbol("RECYCLE_UI_CONFIG"),H={prefix:"rc",autoRegister:!0,provideKey:W,theme:{},iconCssUrl:"//at.alicdn.com/t/c/font_4252799_9vcnw0pnmkh.css",iconClass:"iconfont"};function lt(t,n){n.autoRegister!==!1&&(typeof U=="function"&&U(t),typeof O=="function"&&O(t),typeof j=="function"&&j(t),typeof Z=="function"&&Z(t),typeof P=="function"&&P(t),typeof G=="function"&&G(t),typeof q=="function"&&q(t))}const K=(t,n)=>{const a={...H,...n||{}};if(t.provide(a.provideKey??W,a),t.config.globalProperties.$recycleUI=a,typeof window<"u"&&a.iconCssUrl){const i=`link[rel="stylesheet"][data-rcui-icon="true"][href="${a.iconCssUrl}"]`;if(!document.head.querySelector(i)){const m=document.createElement("link");m.rel="stylesheet",m.href=a.iconCssUrl,m.setAttribute("data-rcui-icon","true"),document.head.appendChild(m)}}return lt(t,a),t},at={install:K};function rt(t){return{install(n){K(n,t)}}}exports.RECYCLE_UI_SYMBOL=W;exports.RcButton=I;exports.RcCard=R;exports.RcDescriptions=ee;exports.RcDescriptionsItem=te;exports.RcIcon=b;exports.RcSearchArea=Y;exports.RcToast=z;exports.createRecycleUI=rt;exports.default=at;exports.defaultRecycleUIConfig=H;exports.hideToast=ne;exports.install=K;exports.installButton=U;exports.installCard=j;exports.installDescriptions=O;exports.installIcon=P;exports.installMessage=G;exports.installSearchArea=q;exports.message=oe;exports.rcDescriptions=ee;exports.rcDescriptionsItem=te;exports.showToast=We;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Ie={key:0,class:"rc-icon__unicode"},De=e.defineComponent({name:"rc-icon",__name:"index",props:{name:{},size:{default:16},color:{default:""},spin:{type:Boolean,default:!1},code:{default:""}},setup(n){const r=n,c=e.inject(O,{}),f=e.computed(()=>(c==null?void 0:c.iconClass)||"iconfont"),v=e.computed(()=>r.name||""),p=e.computed(()=>typeof r.size=="number"?`${r.size}px`:r.size||"16px"),m=e.computed(()=>({fontSize:p.value,color:r.color||void 0,lineHeight:1,fontFamily:(c==null?void 0:c.iconClass)||"iconfont"})),u=e.computed(()=>{const s=r.code;if(s==null||s===""||s===0)return"";if(typeof s=="number")return String.fromCharCode(s);const d=String(s).replace(/^0x/i,""),B=parseInt(d,16);return Number.isNaN(B)?"":String.fromCharCode(B)});return e.onMounted(()=>{if(typeof window>"u")return;const s=c&&c.iconCssUrl||te.iconCssUrl;if(!s)return;const d=`link[rel="stylesheet"][data-rcui-icon="true"][href="${s}"]`;if(!document.head.querySelector(d)){const y=document.createElement("link");y.rel="stylesheet",y.href=s,y.setAttribute("data-rcui-icon","true"),document.head.appendChild(y)}}),(s,d)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["rc-icon",[f.value,v.value,{"rc-icon--spin":n.spin}]]),style:e.normalizeStyle(m.value),"aria-hidden":"true"},[u.value?(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)],6))}}),w=(n,r)=>{const c=n.__vccOpts||n;for(const[f,v]of r)c[f]=v;return c},C=w(De,[["__scopeId","data-v-3857a892"]]),Ae=["disabled"],Re={key:0,class:"rc-button__spinner"},ze={key:0,class:"rc-button__icon rc-button__icon--prefix"},Le={key:2,class:"rc-button__icon rc-button__icon--suffix"},Te=e.defineComponent({__name:"index",props:{type:{default:"default"},size:{default:"medium"},mode:{default:void 0},block:{type:Boolean,default:!1},label:{default:""},round:{type:[Number,String,Boolean],default:6},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},preIcon:{default:""},suffixIcon:{default:""}},emits:["click"],setup(n,{emit:r}){const c=n,f=r,v=m=>{!c.disabled&&!c.loading&&f("click",m)},p=e.computed(()=>{const m=c.round;return typeof m=="boolean"?m?"999px":"6px":typeof m=="number"?`${m}px`:String(m)});return(m,u)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["rc-button",[`rc-button--${n.type}`,`rc-button--${n.size}`,n.mode?`rc-button--${n.mode}`:"",{"is-block":n.block,"is-disabled":n.disabled,"is-loading":n.loading}]]),style:e.normalizeStyle({borderRadius:p.value}),disabled:n.disabled||n.loading,onClick:v},[n.loading?(e.openBlock(),e.createElementBlock("span",Re)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.preIcon||m.$slots.preIcon?(e.openBlock(),e.createElementBlock("span",ze,[e.renderSlot(m.$slots,"preIcon",{},()=>[n.preIcon?(e.openBlock(),e.createBlock(C,{key:0,name:n.preIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],64)),e.renderSlot(m.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0),!n.loading&&(n.suffixIcon||m.$slots.suffixIcon)?(e.openBlock(),e.createElementBlock("span",Le,[e.renderSlot(m.$slots,"suffixIcon",{},()=>[n.suffixIcon?(e.openBlock(),e.createBlock(C,{key:0,name:n.suffixIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],14,Ae))}}),F=w(Te,[["__scopeId","data-v-3ed3109f"]]);F.name="rc-button";function q(n){return n.component(F.name,F),n}const Fe={class:"rc-desc-item__value"},Me=e.defineComponent({name:"rc-descriptions-item",__name:"item",props:{label:{default:""},value:{default:""},labelWidth:{default:""},span:{default:1}},setup(n){const r=n;e.inject("rcDescItemWidth",void 0),e.inject("rcDescSingleWidth",""),e.inject("rcDescGap","0px");const c=e.inject("rcDescGapPx",0),f=e.inject("rcDescColCount",1),v=e.inject("rcDescLabelWidth",""),p=e.computed(()=>{const s=typeof r.span=="string"?parseInt(r.span,10):r.span,d=typeof(f==null?void 0:f.value)=="number"?f.value:f,B=!Number.isNaN(s)&&s>0?s:1;return Math.min(B,d||1)}),m=e.computed(()=>{const s=typeof(f==null?void 0:f.value)=="number"?f.value:f,d=typeof(c==null?void 0:c.value)=="number"?c.value:c,B=p.value;if(!s||s<=1||B>=s)return"100%";const y=(s-1)*d,b=(B-1)*d;return`calc((100% - ${y}px) * ${B} / ${s} + ${b}px)`}),u=e.computed(()=>{const s=typeof(v==null?void 0:v.value)=="string"?v.value:v,d=r.labelWidth!==""?r.labelWidth:s||"";return d?{width:typeof d=="number"?`${d}px`:String(d),flex:"0 0 auto"}:{}});return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:"rc-desc-item",style:e.normalizeStyle({width:m.value,flex:`0 0 ${m.value}`})},[e.createElementVNode("div",{class:"rc-desc-item__label",style:e.normalizeStyle(u.value)},[e.renderSlot(s.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)],4),e.createElementVNode("div",Fe,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.value),1)],!0)])],4))}}),L=w(Me,[["__scopeId","data-v-970d0b99"]]),We={class:"rc-descriptions"},Ue={key:0,class:"rc-descriptions__title"},je=e.defineComponent({name:"rc-descriptions",__name:"index",props:{title:{},column:{default:2},gap:{default:4},labelWidth:{default:""},data:{default:()=>[]},keyMap:{}},setup(n){const r=n,c=e.ref(null),f=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)),v=e.computed(()=>{const d=typeof r.column=="string"?Number.parseInt(r.column,10):r.column??1;return!Number.isNaN(d)&&d>0?d:1}),p=e.ref("100%"),m=e.ref("100%");e.watchEffect(()=>{const d=v.value;if(d<=1)p.value="100%",m.value="100%";else{const B=typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0,b=`calc((100% - ${(d-1)*B}px) / ${d})`;m.value=b,p.value=b}}),e.provide("rcDescItemWidth",p),e.provide("rcDescSingleWidth",m),e.provide("rcDescColCount",v),e.provide("rcDescGapPx",e.computed(()=>typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0));const u=e.computed(()=>r.labelWidth===""||r.labelWidth===void 0?"":typeof r.labelWidth=="number"?`${r.labelWidth}px`:String(r.labelWidth));e.provide("rcDescLabelWidth",u),e.provide("rcDescGap",e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)));const s=e.computed(()=>{var y,b,S;const d=((y=r.keyMap)==null?void 0:y.key)??"label",B=((b=r.keyMap)==null?void 0:b.value)??"value";return(S=r.data)!=null&&S.length?r.data.map(k=>({label:k==null?void 0:k[d],value:k==null?void 0:k[B]})):[]});return(d,B)=>(e.openBlock(),e.createElementBlock("div",We,[d.$slots.title||n.title?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(d.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(n.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-descriptions__body",style:e.normalizeStyle({gap:f.value}),ref_key:"wrapEl",ref:c},[s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(y,b)=>(e.openBlock(),e.createBlock(L,{key:b,label:y.label,value:y.value,"label-width":n.labelWidth},null,8,["label","value","label-width"]))),128)):e.renderSlot(d.$slots,"default",{key:1},void 0,!0)],4)]))}}),W=w(je,[["__scopeId","data-v-5fcaa235"]]);W.name="rc-descriptions";L.name="rc-descriptions-item";function H(n){return n.component(W.name,W),n.component("RcDescriptions",W),n.component(L.name,L),n.component("RcDescriptionsItem",L),n}const ke=W,he=L,Ke={class:"rc-card__title"},Ge={class:"rc-card__title-text"},Oe={key:0,class:"rc-card__status"},Pe={key:1,class:"rc-card__divider"},Ye={key:2,class:"rc-card__action"},qe=e.defineComponent({name:"rc-card",__name:"index",props:{color:{default:"var(--rc-white)"},topBgColor:{default:"rgba(29, 133, 252, 0.05)"},title:{default:""},status:{default:""},statusColor:{default:"var(--rc-primary)"},round:{default:8},bordered:{type:Boolean,default:!1},elevation:{default:2},padding:{default:"16px"},gap:{default:12},width:{default:"100%"},height:{default:""}},setup(n){const r=n,c=e.computed(()=>{const u=typeof r.round=="boolean"?r.round?"12px":"0":typeof r.round=="number"?`${r.round}px`:String(r.round);return{backgroundColor:r.color||"var(--rc-white)",borderRadius:u,boxShadow:m(r.elevation),width:p(r.width),height:p(r.height)}}),f=e.computed(()=>r.padding||"16px"),v=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap));function p(u){return u==null||u===""?"":typeof u=="number"?`${u}px`:String(u)}function m(u){if(!u||u<=0)return"none";const s=4*u;return`0 ${Math.round(s/2)}px ${s}px rgba(0,0,0,0.06), 0 ${Math.round(s/4)}px ${Math.round(s/2)}px rgba(0,0,0,0.04)`}return(u,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rc-card",[{"rc-card--bordered":n.bordered}]]),style:e.normalizeStyle(c.value)},[u.$slots.title||n.title||u.$slots.status||n.status?(e.openBlock(),e.createElementBlock("div",{key:0,class:"rc-card__top",style:e.normalizeStyle({backgroundColor:n.topBgColor||"rgba(29, 133, 252, 0.05)"})},[e.createElementVNode("div",Ke,[e.renderSlot(u.$slots,"title",{},()=>[e.createElementVNode("span",Ge,e.toDisplayString(n.title),1)],!0)]),u.$slots.status||n.status?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(u.$slots,"status",{},()=>[e.createElementVNode("span",{class:"rc-card__status-text",style:e.normalizeStyle({color:n.statusColor||"var(--rc-primary)"})},e.toDisplayString(n.status),5)],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-card__body",style:e.normalizeStyle({padding:f.value,gap:v.value})},[e.renderSlot(u.$slots,"content",{},()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)],!0)],4),u.$slots.action?(e.openBlock(),e.createElementBlock("div",Pe)):e.createCommentVNode("",!0),u.$slots.action?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(u.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),U=w(qe,[["__scopeId","data-v-a7b95214"]]);U.name="rc-card";const He="RcCard";function J(n){return n.component(U.name,U),n.component(He,U),n}const Je={key:0,class:"rc-toast__mask"},Qe={class:"rc-toast__content"},Xe={key:0,class:"rc-toast__spinner"},Ze={key:1,class:"rc-toast__icon rc-toast__icon--success"},et={key:2,class:"rc-toast__icon rc-toast__icon--fail"},tt={class:"rc-toast__text"},nt=e.defineComponent({__name:"index",props:{message:{default:""},type:{default:"text"},duration:{default:2e3},mask:{type:Boolean,default:!1},onAfterLeave:{}},setup(n,{expose:r}){const c=n,f=e.ref(!0);let v;function p(){v&&(clearTimeout(v),v=null)}function m(){p(),f.value=!1}return r({close:m}),e.onMounted(()=>{c.duration&&c.duration>0&&(v=setTimeout(()=>{m()},c.duration))}),e.onUnmounted(()=>{p()}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"rc-toast-fade",onAfterLeave:n.onAfterLeave},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-toast",[`rc-toast--${n.type}`]])},[n.mask?(e.openBlock(),e.createElementBlock("div",Je)):e.createCommentVNode("",!0),e.createElementVNode("div",Qe,[n.type==="loading"?(e.openBlock(),e.createElementBlock("div",Xe)):n.type==="success"?(e.openBlock(),e.createElementBlock("div",Ze)):n.type==="fail"?(e.openBlock(),e.createElementBlock("div",et)):e.createCommentVNode("",!0),e.createElementVNode("div",tt,e.toDisplayString(n.message),1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["onAfterLeave"])])),e.renderSlot(u.$slots,"default",{},void 0,!0)],64))}}),j=w(nt,[["__scopeId","data-v-d234c9c5"]]);let A=null,T=null;function ve(){A&&(A.unmount(),A=null),T&&(document.body.removeChild(T),T=null)}function rt(n){const r=typeof n=="string"?{message:n}:n||{};ve(),T=document.createElement("div"),document.body.appendChild(T);const c={message:r.message,type:r.type??"text",duration:r.duration??2e3,mask:r.mask??!1,onAfterLeave:()=>{var f;ve(),(f=r.onClose)==null||f.call(r)}};return A=e.createApp(j,c),A.mount(T),{close:ge}}function ge(){var n,r,c;A&&((c=(r=(n=A._instance)==null?void 0:n.exposed)==null?void 0:r.close)==null||c.call(r))}j.name="rc-toast";function ye(n){return n.component(j.name,j),n}const lt={class:"rc-message",role:"alert","aria-live":"polite"},ot={class:"rc-message__content"},at=e.defineComponent({__name:"index",setup(n,{expose:r}){const c=e.reactive([]);let f=1;function v(m){const u=c.findIndex(s=>s.id===m);u>=0&&c.splice(u,1)}function p(m,u,s){const d=f++;return c.push({id:d,type:m,content:u,duration:s}),s>0&&window.setTimeout(()=>v(d),s),d}return r({add:p,remove:v}),(m,u)=>(e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(e.TransitionGroup,{name:"rc-message-fade",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["rc-message__item",`rc-message--${s.type}`])},[e.createElementVNode("span",ot,e.toDisplayString(s.content),1)],2))),128))]),_:1})]))}}),ct=w(at,[["__scopeId","data-v-87811df0"]]);let x=null,N=null;function st(){var r;if(x&&N)return;x=document.createElement("div"),document.body.appendChild(x);const n=e.createVNode(ct,{});e.render(n,x),N=(r=n.component)==null?void 0:r.exposed}function z(n,r,c){var v;st();const f=typeof c=="number"?c:n==="loading"?0:2e3;return(v=N==null?void 0:N.add)==null?void 0:v.call(N,n,r,f)}const _e={open(n){return z(n.type||"info",n.content,n.duration)},info(n,r){return z("info",n,r)},success(n,r){return z("success",n,r)},warning(n,r){return z("warning",n,r)},error(n,r){return z("error",n,r)},loading(n,r){return z("loading",n,r)},destroy(){x&&(e.render(null,x),x.remove(),x=null,N=null)}};function Q(n){return n.config.globalProperties.$message=_e,n}C.name="rc-icon";function X(n){return n.component(C.name,C),n.component("RcIcon",C),n}const it={class:"rc-search-area"},ut={class:"rc-search-area__bar"},dt=["onClick"],ft={class:"rc-search-area__item-label"},mt={class:"rc-search-area__panel-content"},pt={key:1,class:"rc-search-area__input-wrapper"},vt=["placeholder"],yt={key:2,class:"rc-search-area__tree-container"},kt={class:"rc-search-area__tree-group-title"},ht={class:"rc-search-area__tree-group-options"},gt=["onClick"],_t={class:"rc-search-area__option-label"},Bt={key:3,class:"rc-search-area__tree-container"},bt={class:"rc-search-area__tree-group-title"},Ct={class:"rc-search-area__tree-group-options"},St=["onClick"],$t={class:"rc-search-area__option-label"},Et={key:4,class:"rc-search-area__options-grid"},Vt=["onClick"],Nt={class:"rc-search-area__option-label"},xt={key:5,class:"rc-search-area__options-grid"},wt=["onClick"],It={class:"rc-search-area__option-label"},Dt={key:6,class:"rc-search-area__empty"},At={key:0,class:"rc-search-area__panel-footer"},Rt=e.defineComponent({name:"rc-search-area",__name:"index",props:{items:{default:()=>[]},modelValue:{default:()=>({})},showMask:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(n,{expose:r,emit:c}){const f=n,v=c,p=e.ref(null),m=e.ref(null),u=e.ref(null),s=e.ref({top:"0px"}),d=async()=>{if(p.value===null||!m.value)return;await e.nextTick();const l=m.value.getBoundingClientRect().top;s.value={top:`${l}px`}},B=t=>{if(p.value===null||!m.value)return;const l=t.target;if(m.value.contains(l))return;const o=m.value.closest(".rc-search-area");if(o){const i=o.querySelector(".rc-search-area__bar");if(i&&i.contains(l))return}K()};e.watch(p,async t=>{t!==null?(await e.nextTick(),d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),document.addEventListener("click",B,!0)):(window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),document.removeEventListener("click",B,!0))}),e.onUnmounted(()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),document.removeEventListener("click",B,!0)});const y=e.ref({}),b=e.ref(""),S=e.ref({}),k=e.ref({...f.modelValue});e.watch(()=>f.modelValue,t=>{k.value={...t||{}}},{deep:!0,immediate:!0});const a=e.computed(()=>p.value===null?null:f.items[p.value]),Be=e.computed(()=>{if(!a.value)return"";const t=xe(a.value);return t>0?`(${t}项)`:""}),be=t=>{const l=k.value[t.key];if(l==null||l===""||t.slot)return t.label;if(t.type==="input"){if(l&&String(l).trim())return`${t.label}: ${l}`}else if(t.type==="single"||t.type==="tree-single"){const o=P(t,l);if(o)return`${t.label}: ${re(o,t)}`}else{const o=Array.isArray(l)?l:[l];if(o.length>0){const i=o.map(g=>{const h=P(t,g);return h?re(h,t):null}).filter(g=>g!==null);if(i.length>0)return`${t.label}: ${i.join("、")}`}}return t.label},Ce=t=>{const l=f.items[t];if(!l)return;if(p.value===t){p.value=null;return}const o=k.value[l.key];l.slot?S.value[l.key]=o!==void 0?typeof o=="object"&&o!==null?{...o}:o:void 0:l.type==="input"?b.value=o!=null?String(o):"":l.type==="single"||l.type==="tree-single"?y.value[l.key]=o!==void 0?o:null:y.value[l.key]=o!==void 0?Array.isArray(o)?[...o]:[o]:[],p.value=t},K=()=>{p.value=null},I=(t,l)=>{if(!l)return typeof t=="string"?t:t.label||String(t.value);const o=t;if(l.renderItem){if(typeof l.renderItem=="string")return String(typeof o=="object"&&o!==null?o[l.renderItem]??"":o);{const i=l.renderItem(o);return i!=null?String(i):""}}return typeof t=="string"?t:t.label||String(t.value)},G=(t,l)=>{if(!l)return typeof t=="string"?t:t.value!==void 0?t.value:t;const o=t;return l.format?typeof l.format=="string"?typeof o=="object"&&o!==null?o[l.format]:o:l.format(o):typeof t=="string"?t:t.value!==void 0?t.value:t},re=(t,l)=>{const o=t,i=l.renderResult||l.renderItem;if(i){if(typeof i=="string")return String(typeof o=="object"&&o!==null?o[i]??"":o);{const g=i(o);return g!=null?String(g):""}}return I(t,l)},P=(t,l,o)=>{const i=o||t.options,g=t.childrenKey||"children";for(const h of i){const E=G(h,t);if(E===l||String(E)===String(l))return h;if(t.childrenKey&&typeof h=="object"&&h!==null){const R=h[g];if(Array.isArray(R)&&R.length>0){const M=P(t,l,R);if(M)return M}}}return null},le=(t,l)=>{const o=l||t.options,i=t.childrenKey||"children",g=[];for(const h of o)if(g.push(h),t.childrenKey&&typeof h=="object"&&h!==null){const E=h[i];Array.isArray(E)&&E.length>0&&g.push(...le(t,E))}return g},V=t=>{if(!a.value)return!1;const l=a.value.key,o=y.value[l],i=G(t,a.value);return a.value.type==="single"||a.value.type==="tree-single"?o!=null&&o===i:(Array.isArray(o)?o:[]).some(h=>h===i||String(h)===String(i))},oe=t=>t?t.childrenKey?le(t):t.options:[],ae=t=>{if(!t)return[];const l=t.childrenKey||"children";return(t.options||[]).filter(o=>{if(typeof o=="string")return!1;const i=o[l];return Array.isArray(i)&&i.length>0})},ce=(t,l)=>{if(!l||typeof t=="string")return[];const o=l.childrenKey||"children",i=t[o];return Array.isArray(i)?i:[]},Se=t=>{if(t)return S.value[t.key]!==void 0?S.value[t.key]:k.value[t.key]},$e=(t,l)=>{t&&(S.value[t.key]=l)},se=t=>{if(!a.value)return;const l=a.value.key,o=G(t,a.value);k.value[l];let i;y.value[l]===o?i=void 0:i=o,k.value[l]=i,v("update:modelValue",{...k.value}),v("change",{...k.value},a.value),K()},ie=t=>{if(!a.value)return;const l=a.value.key,o=G(t,a.value),i=Array.isArray(y.value[l])?[...y.value[l]]:[],g=i.findIndex(h=>h===o||String(h)===String(o));g>=0?i.splice(g,1):i.push(o),y.value[l]=i},Ee=()=>{if(!a.value)return;const t=a.value.key;a.value.slot?S.value[t]=void 0:a.value.type==="input"?b.value="":a.value.type==="single"||a.value.type==="tree-single"?y.value[t]=null:y.value[t]=[]},Ve=()=>{},Ne=()=>{if(!a.value)return;const t=a.value.key;k.value[t];let l;if(a.value.slot)l=S.value[t],k.value[t]=l;else if(a.value.type==="input")l=b.value.trim()||void 0,k.value[t]=l;else if(a.value.type==="single"||a.value.type==="tree-single"){const o=y.value[t];l=o??void 0,k.value[t]=l}else{const o=y.value[t];l=Array.isArray(o)&&o.length>0?o:void 0,k.value[t]=l}v("update:modelValue",{...k.value}),v("change",{...k.value},a.value),K()},ue=t=>{const l=k.value[t.key];return l==null||l===""?0:t.slot?1:t.type==="input"?String(l).trim()?1:0:t.type==="single"||t.type==="tree-single"?1:Array.isArray(l)?l.length:l?1:0},xe=t=>{if(t.slot){const o=S.value[t.key];return o!=null&&o!==""?1:0}else if(t.type==="input")return b.value.trim()?1:0;const l=y.value[t.key];return l==null||l===""?0:t.type==="single"||t.type==="tree-single"?1:Array.isArray(l)?l.length:0};return r({getValues:()=>({...k.value}),reset:()=>{k.value={},y.value={},S.value={},v("update:modelValue",{})}}),(t,l)=>(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.items,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["rc-search-area__item",{"is-active":p.value===i,"has-value":ue(o)>0}]),onClick:g=>Ce(i)},[e.createElementVNode("span",ft,e.toDisplayString(be(o)),1),e.createVNode(e.unref(C),{name:"icon_a-xiala2",color:p.value!==i&&ue(o)>0?"#1677ff":"#969799",class:e.normalizeClass(["rc-search-area__item-arrow",{"is-up":p.value===i}])},null,8,["color","class"])],10,dt))),128))]),e.createVNode(e.Transition,{name:"rc-search-area-fade"},{default:e.withCtx(()=>[p.value!==null&&f.showMask?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"maskRef",ref:u,class:"rc-search-area__mask",style:e.normalizeStyle(s.value),onClick:K},null,4)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"rc-search-area-slide"},{default:e.withCtx(()=>{var o,i,g,h,E,R,M,de,fe,me,pe;return[p.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"panelRef",ref:m,class:"rc-search-area__panel"},[e.createElementVNode("div",mt,[(o=a.value)!=null&&o.slot&&t.$slots[a.value.key]?e.renderSlot(t.$slots,a.value.key,{key:0,value:Se(a.value),"update:value":_=>$e(a.value,_)},void 0,!0):((i=a.value)==null?void 0:i.type)==="input"?(e.openBlock(),e.createElementBlock("div",pt,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=_=>b.value=_),type:"text",class:"rc-search-area__input",placeholder:a.value.placeholder||"请输入",onInput:Ve},null,40,vt),[[e.vModelText,b.value]])])):((g=a.value)==null?void 0:g.type)==="tree-single"?(e.openBlock(),e.createElementBlock("div",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae(a.value),(_,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:"rc-search-area__tree-group"},[e.createElementVNode("div",kt,e.toDisplayString(I(_,a.value||void 0)),1),e.createElementVNode("div",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce(_,a.value),($,Y)=>(e.openBlock(),e.createElementBlock("div",{key:Y,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V($)}]),onClick:we=>se($)},[e.createElementVNode("span",_t,e.toDisplayString(I($,a.value||void 0)),1),V($)?(e.openBlock(),e.createBlock(e.unref(C),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,gt))),128))])]))),128))])):((h=a.value)==null?void 0:h.type)==="tree-multiple"?(e.openBlock(),e.createElementBlock("div",Bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae(a.value),(_,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:"rc-search-area__tree-group"},[e.createElementVNode("div",bt,e.toDisplayString(I(_,a.value||void 0)),1),e.createElementVNode("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce(_,a.value),($,Y)=>(e.openBlock(),e.createElementBlock("div",{key:Y,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V($)}]),onClick:we=>ie($)},[e.createElementVNode("span",$t,e.toDisplayString(I($,a.value||void 0)),1),V($)?(e.openBlock(),e.createBlock(e.unref(C),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,St))),128))])]))),128))])):((E=a.value)==null?void 0:E.type)==="single"?(e.openBlock(),e.createElementBlock("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe(a.value),(_,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V(_)}]),onClick:$=>se(_)},[e.createElementVNode("span",Nt,e.toDisplayString(I(_,a.value||void 0)),1),V(_)?(e.openBlock(),e.createBlock(e.unref(C),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,Vt))),128))])):(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe(a.value),(_,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V(_)}]),onClick:$=>ie(_)},[e.createElementVNode("span",It,e.toDisplayString(I(_,a.value||void 0)),1),V(_)?(e.openBlock(),e.createBlock(e.unref(C),{key:0,name:"icon_select",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,wt))),128))])),((R=a.value)==null?void 0:R.type)!=="input"&&!((M=a.value)!=null&&M.slot)&&((fe=(de=a.value)==null?void 0:de.options)==null?void 0:fe.length)===0?(e.openBlock(),e.createElementBlock("div",Dt,[...l[1]||(l[1]=[e.createElementVNode("p",null,"暂无选项",-1)])])):e.createCommentVNode("",!0)]),((me=a.value)==null?void 0:me.type)!=="single"&&((pe=a.value)==null?void 0:pe.type)!=="tree-single"?(e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(F),{block:"",onClick:Ee},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode(" 重置 ",-1)])]),_:1}),e.createVNode(e.unref(F),{type:"primary",block:"",onClick:Ne},{default:e.withCtx(()=>[e.createTextVNode(" 确定"+e.toDisplayString(Be.value),1)]),_:1})])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]}),_:3})]))}}),Z=w(Rt,[["__scopeId","data-v-26a764e2"]]),ee=n=>{n.component("RcSearchArea",Z),n.component("rc-search-area",Z)},O=Symbol("RECYCLE_UI_CONFIG"),te={prefix:"rc",autoRegister:!0,provideKey:O,theme:{},iconCssUrl:"//at.alicdn.com/t/c/font_4252799_9vcnw0pnmkh.css",iconClass:"iconfont"};function zt(n,r){r.autoRegister!==!1&&(typeof q=="function"&&q(n),typeof H=="function"&&H(n),typeof J=="function"&&J(n),typeof ye=="function"&&ye(n),typeof X=="function"&&X(n),typeof Q=="function"&&Q(n),typeof ee=="function"&&ee(n))}const ne=(n,r)=>{const c={...te,...r||{}};if(n.provide(c.provideKey??O,c),n.config.globalProperties.$recycleUI=c,typeof window<"u"&&c.iconCssUrl){const f=`link[rel="stylesheet"][data-rcui-icon="true"][href="${c.iconCssUrl}"]`;if(!document.head.querySelector(f)){const p=document.createElement("link");p.rel="stylesheet",p.href=c.iconCssUrl,p.setAttribute("data-rcui-icon","true"),document.head.appendChild(p)}}return zt(n,c),n},Lt={install:ne};function Tt(n){return{install(r){ne(r,n)}}}exports.RECYCLE_UI_SYMBOL=O;exports.RcButton=F;exports.RcCard=U;exports.RcDescriptions=ke;exports.RcDescriptionsItem=he;exports.RcIcon=C;exports.RcSearchArea=Z;exports.RcToast=j;exports.createRecycleUI=Tt;exports.default=Lt;exports.defaultRecycleUIConfig=te;exports.hideToast=ge;exports.install=ne;exports.installButton=q;exports.installCard=J;exports.installDescriptions=H;exports.installIcon=X;exports.installMessage=Q;exports.installSearchArea=ee;exports.message=_e;exports.rcDescriptions=ke;exports.rcDescriptionsItem=he;exports.showToast=rt;
2
2
  //# sourceMappingURL=index.cjs.map