@rft-rc/recycle-ui 0.0.1-rc.7 → 0.0.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/index.vue.d.ts +18 -6
- package/dist/components/button/index.vue.d.ts.map +1 -1
- package/dist/components/card/index.vue.d.ts +2 -2
- package/dist/components/card/index.vue.d.ts.map +1 -1
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.vue.d.ts +1 -1
- package/dist/components/icon/index.vue.d.ts.map +1 -1
- package/dist/components/search-area/index.d.ts +10 -0
- package/dist/components/search-area/index.d.ts.map +1 -0
- package/dist/components/search-area/index.vue.d.ts +51 -0
- package/dist/components/search-area/index.vue.d.ts.map +1 -0
- package/dist/favicon.svg +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +546 -294
- package/dist/index.mjs.map +1 -1
- package/dist/logo.svg +22 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
2
2
|
type ButtonSize = 'mini' | 'small' | 'medium' | 'large';
|
|
3
|
+
type ButtonMode = 'outline' | 'text';
|
|
3
4
|
interface Props {
|
|
4
5
|
type?: ButtonType;
|
|
5
6
|
size?: ButtonSize;
|
|
6
|
-
|
|
7
|
+
/** 按钮模式:outline 中空模式,text 文本模式 */
|
|
8
|
+
mode?: ButtonMode;
|
|
7
9
|
block?: boolean;
|
|
8
10
|
/** 按钮文本,提供时可不写默认插槽 */
|
|
9
11
|
label?: string;
|
|
@@ -11,24 +13,34 @@ interface Props {
|
|
|
11
13
|
round?: number | string | boolean;
|
|
12
14
|
disabled?: boolean;
|
|
13
15
|
loading?: boolean;
|
|
16
|
+
/** 前置图标名称 */
|
|
17
|
+
preIcon?: string;
|
|
18
|
+
/** 后置图标名称 */
|
|
19
|
+
suffixIcon?: string;
|
|
14
20
|
}
|
|
15
|
-
declare var __VLS_1: {};
|
|
21
|
+
declare var __VLS_1: {}, __VLS_6: {}, __VLS_8: {};
|
|
16
22
|
type __VLS_Slots = {} & {
|
|
17
|
-
|
|
23
|
+
preIcon?: (props: typeof __VLS_1) => any;
|
|
24
|
+
} & {
|
|
25
|
+
default?: (props: typeof __VLS_6) => any;
|
|
26
|
+
} & {
|
|
27
|
+
suffixIcon?: (props: typeof __VLS_8) => any;
|
|
18
28
|
};
|
|
19
29
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
30
|
click: (ev: MouseEvent) => any;
|
|
21
31
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
22
32
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
23
33
|
}>, {
|
|
24
|
-
type: ButtonType;
|
|
25
34
|
size: ButtonSize;
|
|
26
|
-
|
|
27
|
-
block: boolean;
|
|
35
|
+
type: ButtonType;
|
|
28
36
|
label: string;
|
|
37
|
+
mode: ButtonMode;
|
|
38
|
+
block: boolean;
|
|
29
39
|
round: number | string | boolean;
|
|
30
40
|
disabled: boolean;
|
|
31
41
|
loading: boolean;
|
|
42
|
+
preIcon: string;
|
|
43
|
+
suffixIcon: string;
|
|
32
44
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
45
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
34
46
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.vue"],"names":[],"mappings":"AA8KA,KAAK,UAAU,GAAG,SAA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AO,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"}
|
|
@@ -37,11 +37,11 @@ type __VLS_Slots = {} & {
|
|
|
37
37
|
action?: (props: typeof __VLS_9) => any;
|
|
38
38
|
};
|
|
39
39
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
40
|
-
|
|
40
|
+
color: string;
|
|
41
41
|
title: string;
|
|
42
|
+
round: number | string;
|
|
42
43
|
width: string | number;
|
|
43
44
|
gap: number | string;
|
|
44
|
-
color: string;
|
|
45
45
|
topBgColor: string;
|
|
46
46
|
status: string;
|
|
47
47
|
statusColor: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/card/index.vue"],"names":[],"mappings":"AAyLA,UAAU,KAAK;IACb,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,GAAG,MA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C,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -15,9 +15,9 @@ export declare const RcIcon: import("vue").DefineComponent<{
|
|
|
15
15
|
code?: string | number;
|
|
16
16
|
}> & Readonly<{}>, {
|
|
17
17
|
size: number | string;
|
|
18
|
-
code: string | number;
|
|
19
18
|
color: string;
|
|
20
19
|
spin: boolean;
|
|
20
|
+
code: string | number;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
export default Icon;
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -12,9 +12,9 @@ type __VLS_Props = {
|
|
|
12
12
|
};
|
|
13
13
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
14
|
size: number | string;
|
|
15
|
-
code: string | number;
|
|
16
15
|
color: string;
|
|
17
16
|
spin: boolean;
|
|
17
|
+
code: string | number;
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
19
|
export default _default;
|
|
20
20
|
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/icon/index.vue"],"names":[],"mappings":"AA0GA,KAAK,WAAW,GAAG;IACjB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;;UAPO,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/icon/index.vue"],"names":[],"mappings":"AA0GA,KAAK,WAAW,GAAG;IACjB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;;UAPO,MAAM,GAAG,MAAM;WAEd,MAAM;UAEP,OAAO;UAEP,MAAM,GAAG,MAAM;;AA6GxB,wBAOG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 基础用法
|
|
3
|
+
*/
|
|
4
|
+
import type { App } from 'vue';
|
|
5
|
+
import RcSearchArea from './index.vue';
|
|
6
|
+
export { RcSearchArea };
|
|
7
|
+
export type { FilterItem, FilterOption } from './index.vue';
|
|
8
|
+
export declare const install: (app: App) => void;
|
|
9
|
+
export default RcSearchArea;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search-area/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,YAAY,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,eAAO,MAAM,OAAO,GAAI,KAAK,GAAG,SAG/B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface FilterOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface FilterItem {
|
|
7
|
+
/** 筛选项标签 */
|
|
8
|
+
label: string;
|
|
9
|
+
/** 筛选项唯一标识 */
|
|
10
|
+
key: string;
|
|
11
|
+
/** 选项列表 */
|
|
12
|
+
options: FilterOption[] | string[];
|
|
13
|
+
/** 筛选类型:single 单选,multiple 多选(默认) */
|
|
14
|
+
type?: 'single' | 'multiple';
|
|
15
|
+
/** 多选时的列数(默认 2) */
|
|
16
|
+
column?: number;
|
|
17
|
+
}
|
|
18
|
+
type __VLS_Props = {
|
|
19
|
+
/** 筛选项配置 */
|
|
20
|
+
items: FilterItem[];
|
|
21
|
+
/** 当前筛选值(支持 v-model) */
|
|
22
|
+
modelValue?: Record<string, any>;
|
|
23
|
+
/** 是否显示蒙层 */
|
|
24
|
+
showMask?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
27
|
+
/** 获取当前筛选值 */
|
|
28
|
+
getValues: () => {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
};
|
|
31
|
+
/** 重置所有筛选 */
|
|
32
|
+
reset: () => void;
|
|
33
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
34
|
+
"update:modelValue": (values: Record<string, any>) => any;
|
|
35
|
+
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
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
40
|
+
"onUpdate:modelValue"?: ((values: Record<string, any>) => any) | undefined;
|
|
41
|
+
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
|
+
}>, {
|
|
46
|
+
items: FilterItem[];
|
|
47
|
+
modelValue: Record<string, any>;
|
|
48
|
+
showMask: boolean;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
export default _default;
|
|
51
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="32" height="32" viewBox="0 0 1162 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<!-- 统一蓝色渐变 -->
|
|
4
|
+
<linearGradient id="faviconGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#1890ff;stop-opacity:1" />
|
|
6
|
+
<stop offset="100%" style="stop-color:#40a9ff;stop-opacity:1" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
<path d="M1162 453.2C1162 238.2 901.8 64 581 64S0 238.2 0 453.2C0 644.8 206.6 804 478.8 836.2V960h198.2v-123c48.6-5.4 95.2-14.8 138.8-27.8L896 960h224l-134.8-227.4c109-70.8 176.8-169.8 176.8-279.4z m-933.6 29c0-147 197.8-266 441.6-266s423.8 81.4 423.8 266c0 100.2-53 170-140.6 212.8-4.8-3.2-9.4-5.8-12.8-7.4-20.4-10.4-55.6-21-55.6-21s173.2-12.8 173.2-185.4-181.2-175.8-181.2-175.8h-398V722c-148.2-43-250.4-134.2-250.4-239.8z m450.2 76.6v-111.2c115.6 0 175.6-13.6 175.6 54.6 0 73-76.4 56.6-175.6 56.6z m-1.8 145H730c21.6 0 37.8 23.4 48 38.4-32.2 3.8-66 5.6-101.2 5.8v-44.2z" fill="url(#faviconGradient)"></path>
|
|
10
|
+
</svg>
|
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"),A=["disabled"],P={key:0,class:"rc-button__spinner"},F=e.defineComponent({__name:"index",props:{type:{default:"default"},size:{default:"medium"},plain:{type:Boolean,default:!1},block:{type:Boolean,default:!1},label:{default:""},round:{type:[Number,String,Boolean],default:6},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,s=n,r=i=>{!o.disabled&&!o.loading&&s("click",i)},d=e.computed(()=>{const i=o.round;return typeof i=="boolean"?i?"999px":"6px":typeof i=="number"?`${i}px`:String(i)});return(i,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["rc-button",[`rc-button--${t.type}`,`rc-button--${t.size}`,{"is-plain":t.plain,"is-block":t.block,"is-disabled":t.disabled,"is-loading":t.loading}]]),style:e.normalizeStyle({borderRadius:d.value}),disabled:t.disabled||t.loading,onClick:r},[t.loading?(e.openBlock(),e.createElementBlock("span",P)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)],14,A))}}),v=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},x=v(F,[["__scopeId","data-v-a70e95bb"]]);x.name="rc-button";function N(t){return t.component(x.name,x),t}const O={class:"rc-desc-item__value"},Y=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 o=e.inject("rcDescGapPx",0),s=e.inject("rcDescColCount",1),r=e.inject("rcDescLabelWidth",""),d=e.computed(()=>{const c=typeof n.span=="string"?parseInt(n.span,10):n.span,l=typeof(s==null?void 0:s.value)=="number"?s.value:s,u=!Number.isNaN(c)&&c>0?c:1;return Math.min(u,l||1)}),i=e.computed(()=>{const c=typeof(s==null?void 0:s.value)=="number"?s.value:s,l=typeof(o==null?void 0:o.value)=="number"?o.value:o,u=d.value;if(!c||c<=1||u>=c)return"100%";const m=(c-1)*l,f=(u-1)*l;return`calc((100% - ${m}px) * ${u} / ${c} + ${f}px)`}),a=e.computed(()=>{const c=typeof(r==null?void 0:r.value)=="string"?r.value:r,l=n.labelWidth!==""?n.labelWidth:c||"";return l?{width:typeof l=="number"?`${l}px`:String(l),flex:"0 0 auto"}:{}});return(c,l)=>(e.openBlock(),e.createElementBlock("div",{class:"rc-desc-item",style:e.normalizeStyle({width:i.value,flex:`0 0 ${i.value}`})},[e.createElementVNode("div",{class:"rc-desc-item__label",style:e.normalizeStyle(a.value)},[e.renderSlot(c.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)],4),e.createElementVNode("div",O,[e.renderSlot(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)],!0)])],4))}}),k=v(Y,[["__scopeId","data-v-970d0b99"]]),q={class:"rc-descriptions"},H={key:0,class:"rc-descriptions__title"},K=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,o=e.ref(null),s=e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap)),r=e.computed(()=>{const l=typeof n.column=="string"?Number.parseInt(n.column,10):n.column??1;return!Number.isNaN(l)&&l>0?l:1}),d=e.ref("100%"),i=e.ref("100%");e.watchEffect(()=>{const l=r.value;if(l<=1)d.value="100%",i.value="100%";else{const u=typeof n.gap=="number"?n.gap:parseFloat(String(n.gap))||0,f=`calc((100% - ${(l-1)*u}px) / ${l})`;i.value=f,d.value=f}}),e.provide("rcDescItemWidth",d),e.provide("rcDescSingleWidth",i),e.provide("rcDescColCount",r),e.provide("rcDescGapPx",e.computed(()=>typeof n.gap=="number"?n.gap:parseFloat(String(n.gap))||0));const a=e.computed(()=>n.labelWidth===""||n.labelWidth===void 0?"":typeof n.labelWidth=="number"?`${n.labelWidth}px`:String(n.labelWidth));e.provide("rcDescLabelWidth",a),e.provide("rcDescGap",e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap)));const c=e.computed(()=>{var m,f,W;const l=((m=n.keyMap)==null?void 0:m.key)??"label",u=((f=n.keyMap)==null?void 0:f.value)??"value";return(W=n.data)!=null&&W.length?n.data.map(b=>({label:b==null?void 0:b[l],value:b==null?void 0:b[u]})):[]});return(l,u)=>(e.openBlock(),e.createElementBlock("div",q,[l.$slots.title||t.title?(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-descriptions__body",style:e.normalizeStyle({gap:s.value}),ref_key:"wrapEl",ref:o},[c.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,(m,f)=>(e.openBlock(),e.createBlock(k,{key:f,label:m.label,value:m.value,"label-width":t.labelWidth},null,8,["label","value","label-width"]))),128)):e.renderSlot(l.$slots,"default",{key:1},void 0,!0)],4)]))}}),$=v(K,[["__scopeId","data-v-5fcaa235"]]);$.name="rc-descriptions";k.name="rc-descriptions-item";function D(t){return t.component($.name,$),t.component("RcDescriptions",$),t.component(k.name,k),t.component("RcDescriptionsItem",k),t}const U=$,L=k,J={class:"rc-card__title"},Q={class:"rc-card__title-text"},X={key:0,class:"rc-card__status"},Z={key:1,class:"rc-card__divider"},ee={key:2,class:"rc-card__action"},te=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,o=e.computed(()=>{const a=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:a,boxShadow:i(n.elevation),width:d(n.width),height:d(n.height)}}),s=e.computed(()=>n.padding||"16px"),r=e.computed(()=>typeof n.gap=="number"?`${n.gap}px`:String(n.gap));function d(a){return a==null||a===""?"":typeof a=="number"?`${a}px`:String(a)}function i(a){if(!a||a<=0)return"none";const c=4*a;return`0 ${Math.round(c/2)}px ${c}px rgba(0,0,0,0.06), 0 ${Math.round(c/4)}px ${Math.round(c/2)}px rgba(0,0,0,0.04)`}return(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rc-card",[{"rc-card--bordered":t.bordered}]]),style:e.normalizeStyle(o.value)},[a.$slots.title||t.title||a.$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",J,[e.renderSlot(a.$slots,"title",{},()=>[e.createElementVNode("span",Q,e.toDisplayString(t.title),1)],!0)]),a.$slots.status||t.status?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(a.$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:s.value,gap:r.value})},[e.renderSlot(a.$slots,"content",{},()=>[e.renderSlot(a.$slots,"default",{},void 0,!0)],!0)],4),a.$slots.action?(e.openBlock(),e.createElementBlock("div",Z)):e.createCommentVNode("",!0),a.$slots.action?(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(a.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),C=v(te,[["__scopeId","data-v-a7b95214"]]);C.name="rc-card";const ne="RcCard";function I(t){return t.component(C.name,C),t.component(ne,C),t}const oe={key:0,class:"rc-toast__mask"},ce={class:"rc-toast__content"},ae={key:0,class:"rc-toast__spinner"},le={key:1,class:"rc-toast__icon rc-toast__icon--success"},se={key:2,class:"rc-toast__icon rc-toast__icon--fail"},re={class:"rc-toast__text"},ie=e.defineComponent({__name:"index",props:{message:{default:""},type:{default:"text"},duration:{default:2e3},mask:{type:Boolean,default:!1},onAfterLeave:{}},setup(t,{expose:n}){const o=t,s=e.ref(!0);let r;function d(){r&&(clearTimeout(r),r=null)}function i(){d(),s.value=!1}return n({close:i}),e.onMounted(()=>{o.duration&&o.duration>0&&(r=setTimeout(()=>{i()},o.duration))}),e.onUnmounted(()=>{d()}),(a,c)=>(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(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-toast",[`rc-toast--${t.type}`]])},[t.mask?(e.openBlock(),e.createElementBlock("div",oe)):e.createCommentVNode("",!0),e.createElementVNode("div",ce,[t.type==="loading"?(e.openBlock(),e.createElementBlock("div",ae)):t.type==="success"?(e.openBlock(),e.createElementBlock("div",le)):t.type==="fail"?(e.openBlock(),e.createElementBlock("div",se)):e.createCommentVNode("",!0),e.createElementVNode("div",re,e.toDisplayString(t.message),1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["onAfterLeave"])])),e.renderSlot(a.$slots,"default",{},void 0,!0)],64))}}),S=v(ie,[["__scopeId","data-v-d234c9c5"]]);let g=null,_=null;function T(){g&&(g.unmount(),g=null),_&&(document.body.removeChild(_),_=null)}function de(t){const n=typeof t=="string"?{message:t}:t||{};T(),_=document.createElement("div"),document.body.appendChild(_);const o={message:n.message,type:n.type??"text",duration:n.duration??2e3,mask:n.mask??!1,onAfterLeave:()=>{var s;T(),(s=n.onClose)==null||s.call(n)}};return g=e.createApp(S,o),g.mount(_),{close:G}}function G(){var t,n,o;g&&((o=(n=(t=g._instance)==null?void 0:t.exposed)==null?void 0:n.close)==null||o.call(n))}S.name="rc-toast";function M(t){return t.component(S.name,S),t}const ue={class:"rc-message",role:"alert","aria-live":"polite"},me={class:"rc-message__content"},fe=e.defineComponent({__name:"index",setup(t,{expose:n}){const o=e.reactive([]);let s=1;function r(i){const a=o.findIndex(c=>c.id===i);a>=0&&o.splice(a,1)}function d(i,a,c){const l=s++;return o.push({id:l,type:i,content:a,duration:c}),c>0&&window.setTimeout(()=>r(l),c),l}return n({add:d,remove:r}),(i,a)=>(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(e.TransitionGroup,{name:"rc-message-fade",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:e.normalizeClass(["rc-message__item",`rc-message--${c.type}`])},[e.createElementVNode("span",me,e.toDisplayString(c.content),1)],2))),128))]),_:1})]))}}),pe=v(fe,[["__scopeId","data-v-87811df0"]]);let y=null,p=null;function ye(){var n;if(y&&p)return;y=document.createElement("div"),document.body.appendChild(y);const t=e.createVNode(pe,{});e.render(t,y),p=(n=t.component)==null?void 0:n.exposed}function h(t,n,o){var r;ye();const s=typeof o=="number"?o:t==="loading"?0:2e3;return(r=p==null?void 0:p.add)==null?void 0:r.call(p,t,n,s)}const j={open(t){return h(t.type||"info",t.content,t.duration)},info(t,n){return h("info",t,n)},success(t,n){return h("success",t,n)},warning(t,n){return h("warning",t,n)},error(t,n){return h("error",t,n)},loading(t,n){return h("loading",t,n)},destroy(){y&&(e.render(null,y),y.remove(),y=null,p=null)}};function w(t){return t.config.globalProperties.$message=j,t}const ge={key:0,class:"rc-icon__unicode"},ve=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,o=e.inject(E,{}),s=e.computed(()=>(o==null?void 0:o.iconClass)||"iconfont"),r=e.computed(()=>n.name||""),d=e.computed(()=>typeof n.size=="number"?`${n.size}px`:n.size||"16px"),i=e.computed(()=>({fontSize:d.value,color:n.color||void 0,lineHeight:1,fontFamily:(o==null?void 0:o.iconClass)||"iconfont"})),a=e.computed(()=>{const c=n.code;if(c==null||c===""||c===0)return"";if(typeof c=="number")return String.fromCharCode(c);const l=String(c).replace(/^0x/i,""),u=parseInt(l,16);return Number.isNaN(u)?"":String.fromCharCode(u)});return e.onMounted(()=>{if(typeof window>"u")return;const c=o&&o.iconCssUrl||z.iconCssUrl;if(!c)return;const l=`link[rel="stylesheet"][data-rcui-icon="true"][href="${c}"]`;if(!document.head.querySelector(l)){const m=document.createElement("link");m.rel="stylesheet",m.href=c,m.setAttribute("data-rcui-icon","true"),document.head.appendChild(m)}}),(c,l)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["rc-icon",[s.value,r.value,{"rc-icon--spin":t.spin}]]),style:e.normalizeStyle(i.value),"aria-hidden":"true"},[a.value?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)],6))}}),B=v(ve,[["__scopeId","data-v-3857a892"]]);B.name="rc-icon";function V(t){return t.component(B.name,B),t.component("RcIcon",B),t}const E=Symbol("RECYCLE_UI_CONFIG"),z={prefix:"rc",autoRegister:!0,provideKey:E,theme:{},iconCssUrl:"//at.alicdn.com/t/c/font_4252799_9vcnw0pnmkh.css",iconClass:"iconfont"};function be(t,n){n.autoRegister!==!1&&(typeof N=="function"&&N(t),typeof D=="function"&&D(t),typeof I=="function"&&I(t),typeof M=="function"&&M(t),typeof V=="function"&&V(t),typeof w=="function"&&w(t))}const R=(t,n)=>{const o={...z,...n||{}};if(t.provide(o.provideKey??E,o),t.config.globalProperties.$recycleUI=o,typeof window<"u"&&o.iconCssUrl){const s=`link[rel="stylesheet"][data-rcui-icon="true"][href="${o.iconCssUrl}"]`;if(!document.head.querySelector(s)){const d=document.createElement("link");d.rel="stylesheet",d.href=o.iconCssUrl,d.setAttribute("data-rcui-icon","true"),document.head.appendChild(d)}}return be(t,o),t},he={install:R};function ke(t){return{install(n){R(n,t)}}}exports.RECYCLE_UI_SYMBOL=E;exports.RcButton=x;exports.RcCard=C;exports.RcDescriptions=U;exports.RcDescriptionsItem=L;exports.RcIcon=B;exports.RcToast=S;exports.createRecycleUI=ke;exports.default=he;exports.defaultRecycleUIConfig=z;exports.hideToast=G;exports.install=R;exports.installButton=N;exports.installCard=I;exports.installDescriptions=D;exports.installIcon=V;exports.installMessage=w;exports.message=j;exports.rcDescriptions=U;exports.rcDescriptionsItem=L;exports.showToast=de;
|
|
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;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|