@rft-rc/recycle-ui 0.0.2-rc.3 → 0.0.2-rc.4
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/calendar/index.d.ts +5 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.vue.d.ts +61 -0
- package/dist/components/calendar/index.vue.d.ts.map +1 -0
- package/dist/components/calendar/panel-content.vue.d.ts +35 -0
- package/dist/components/calendar/panel-content.vue.d.ts.map +1 -0
- package/dist/components/popup/index.d.ts +5 -0
- package/dist/components/popup/index.d.ts.map +1 -0
- package/dist/components/popup/index.vue.d.ts +70 -0
- package/dist/components/popup/index.vue.d.ts.map +1 -0
- package/dist/components/search-area/index.vue.d.ts +19 -3
- package/dist/components/search-area/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1301 -581
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,QAAQ,MAAM,aAAa,CAAC;AAMnC,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,YAI/B;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
type CalendarValue = string | [string, string] | null;
|
|
2
|
+
interface DayItem {
|
|
3
|
+
date: Date;
|
|
4
|
+
type: string;
|
|
5
|
+
text: string;
|
|
6
|
+
bottomInfo?: string;
|
|
7
|
+
}
|
|
8
|
+
type CalendarMode = 'default' | 'popup';
|
|
9
|
+
interface Props {
|
|
10
|
+
/** 当前选中的日期,格式为 YYYY-MM-DD */
|
|
11
|
+
modelValue?: CalendarValue;
|
|
12
|
+
/** 是否支持区间选择:true/false 或数字(表示区间可选的最大天数) */
|
|
13
|
+
range?: boolean | number;
|
|
14
|
+
/** 显示模式:default 直接展示,popup 输入框模式(点击后弹出日历) */
|
|
15
|
+
mode?: CalendarMode;
|
|
16
|
+
/** 输入框占位符 */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** 是否显示标题栏 */
|
|
19
|
+
showTitle?: boolean;
|
|
20
|
+
/** 标题栏文字 */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** 最小可选日期 */
|
|
23
|
+
minDate?: string;
|
|
24
|
+
/** 最大可选日期 */
|
|
25
|
+
maxDate?: string;
|
|
26
|
+
/** 禁用日期函数 */
|
|
27
|
+
disabledDate?: (date: Date) => boolean;
|
|
28
|
+
/** 日期格式化函数 */
|
|
29
|
+
formatter?: (day: DayItem) => {
|
|
30
|
+
text?: string;
|
|
31
|
+
bottomInfo?: string;
|
|
32
|
+
};
|
|
33
|
+
/** 区间模式下是否显示底部按钮(确定/取消),为 false 时区间完整后自动确认 */
|
|
34
|
+
showFooter?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
37
|
+
"update:modelValue": (value: CalendarValue) => any;
|
|
38
|
+
confirm: (value: CalendarValue) => any;
|
|
39
|
+
change: (value: CalendarValue) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((value: CalendarValue) => any) | undefined;
|
|
42
|
+
onConfirm?: ((value: CalendarValue) => any) | undefined;
|
|
43
|
+
onChange?: ((value: CalendarValue) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
title: string;
|
|
46
|
+
mode: CalendarMode;
|
|
47
|
+
placeholder: string;
|
|
48
|
+
modelValue: CalendarValue;
|
|
49
|
+
showTitle: boolean;
|
|
50
|
+
range: boolean | number;
|
|
51
|
+
minDate: string;
|
|
52
|
+
maxDate: string;
|
|
53
|
+
disabledDate: (date: Date) => boolean;
|
|
54
|
+
formatter: (day: DayItem) => {
|
|
55
|
+
text?: string;
|
|
56
|
+
bottomInfo?: string;
|
|
57
|
+
};
|
|
58
|
+
showFooter: boolean;
|
|
59
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
|
+
export default _default;
|
|
61
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/index.vue"],"names":[],"mappings":"AA8dA,KAAK,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AAEtD,UAAU,OAAO;IACf,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAExC,UAAU,KAAK;IACb,6BAA6B;IAC7B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa;IACb,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACvC,cAAc;IACd,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;;;;;WAXS,MAAM;UANP,YAAY;iBAEL,MAAM;gBANP,aAAa;eAQd,OAAO;WANX,OAAO,GAAG,MAAM;aAUd,MAAM;aAEN,MAAM;kBAED,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;eAE1B,CAAC,GAAG,EAAE,OAAO,KAAK;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;gBAEvD,OAAO;;AAkhBtB,wBAQG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface DayItem {
|
|
2
|
+
date: Date;
|
|
3
|
+
type: string;
|
|
4
|
+
text: string;
|
|
5
|
+
bottomInfo?: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
showTitle?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
range?: boolean;
|
|
11
|
+
selectedDate: string | null;
|
|
12
|
+
rangeStart: string | null;
|
|
13
|
+
rangeEnd: string | null;
|
|
14
|
+
minDate?: string;
|
|
15
|
+
maxDate?: string;
|
|
16
|
+
disabledDate?: (date: Date) => boolean;
|
|
17
|
+
formatter?: (day: DayItem) => {
|
|
18
|
+
text?: string;
|
|
19
|
+
bottomInfo?: string;
|
|
20
|
+
};
|
|
21
|
+
showFooter?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: import("vue").DefineComponent<Props, {
|
|
24
|
+
yearScrollRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
25
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
|
+
clear: () => any;
|
|
27
|
+
"select-day": (day: DayItem) => any;
|
|
28
|
+
confirm: () => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
30
|
+
onClear?: (() => any) | undefined;
|
|
31
|
+
"onSelect-day"?: ((day: DayItem) => any) | undefined;
|
|
32
|
+
onConfirm?: (() => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=panel-content.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-content.vue.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/panel-content.vue"],"names":[],"mappings":"AA04BA,UAAU,OAAO;IACf,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,KAAK;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;;;;;;;AAozBD,wBAQG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popup/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,MAAM,aAAa,CAAC;AAMhC,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,YAI/B;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
type PopupPosition = 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
2
|
+
type CloseIconPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** 是否显示弹出层 */
|
|
5
|
+
modelValue?: boolean;
|
|
6
|
+
/** 弹出位置 */
|
|
7
|
+
position?: PopupPosition;
|
|
8
|
+
/** 是否显示遮罩层 */
|
|
9
|
+
overlay?: boolean;
|
|
10
|
+
/** 遮罩层样式类名 */
|
|
11
|
+
overlayClass?: string;
|
|
12
|
+
/** 遮罩层样式 */
|
|
13
|
+
overlayStyle?: Record<string, string>;
|
|
14
|
+
/** 是否显示关闭图标 */
|
|
15
|
+
closeable?: boolean;
|
|
16
|
+
/** 关闭图标位置 */
|
|
17
|
+
closeIconPosition?: CloseIconPosition;
|
|
18
|
+
/** 自定义关闭图标 */
|
|
19
|
+
closeIcon?: string;
|
|
20
|
+
/** 是否显示圆角 */
|
|
21
|
+
round?: boolean;
|
|
22
|
+
/** 弹出层样式 */
|
|
23
|
+
popupStyle?: Record<string, string>;
|
|
24
|
+
/** 是否点击遮罩层关闭 */
|
|
25
|
+
closeOnClickOverlay?: boolean;
|
|
26
|
+
/** 是否锁定背景滚动 */
|
|
27
|
+
lockScroll?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare function close(): void;
|
|
30
|
+
declare function open(): void;
|
|
31
|
+
declare var __VLS_16: {};
|
|
32
|
+
type __VLS_Slots = {} & {
|
|
33
|
+
default?: (props: typeof __VLS_16) => any;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
36
|
+
open: typeof open;
|
|
37
|
+
close: typeof close;
|
|
38
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
40
|
+
close: () => any;
|
|
41
|
+
"update:modelValue": (value: boolean) => any;
|
|
42
|
+
open: () => any;
|
|
43
|
+
"click-overlay": () => any;
|
|
44
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
45
|
+
onClose?: (() => any) | undefined;
|
|
46
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
47
|
+
onOpen?: (() => any) | undefined;
|
|
48
|
+
"onClick-overlay"?: (() => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
round: boolean;
|
|
51
|
+
modelValue: boolean;
|
|
52
|
+
position: PopupPosition;
|
|
53
|
+
overlay: boolean;
|
|
54
|
+
overlayClass: string;
|
|
55
|
+
overlayStyle: Record<string, string>;
|
|
56
|
+
closeable: boolean;
|
|
57
|
+
closeIconPosition: CloseIconPosition;
|
|
58
|
+
closeIcon: string;
|
|
59
|
+
popupStyle: Record<string, string>;
|
|
60
|
+
closeOnClickOverlay: boolean;
|
|
61
|
+
lockScroll: boolean;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
63
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
64
|
+
export default _default;
|
|
65
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
66
|
+
new (): {
|
|
67
|
+
$slots: S;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/popup/index.vue"],"names":[],"mappings":"AA0WA,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACpE,KAAK,iBAAiB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAEnF,UAAU,KAAK;IACb,cAAc;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW;IACX,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa;IACb,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,gBAAgB;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAiGD,iBAAS,KAAK,SAEb;AAGD,iBAAS,IAAI,SAEZ;AA8ID,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA4BhD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;WA3RX,OAAO;gBAhBF,OAAO;cAET,aAAa;aAEd,OAAO;kBAEF,MAAM;kBAEN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;eAEzB,OAAO;uBAEC,iBAAiB;eAEzB,MAAM;gBAIL,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;yBAEb,OAAO;gBAEhB,OAAO;6EA8RpB,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"}
|
|
@@ -10,8 +10,8 @@ export interface FilterItem {
|
|
|
10
10
|
key: string;
|
|
11
11
|
/** 选项列表 */
|
|
12
12
|
options: FilterOption[] | string[];
|
|
13
|
-
/** 筛选类型:single 单选,multiple 多选,tree-single 树形单选,tree-multiple 树形多选,input
|
|
14
|
-
type?: 'single' | 'multiple' | 'tree-single' | 'tree-multiple' | 'input';
|
|
13
|
+
/** 筛选类型:single 单选,multiple 多选,tree-single 树形单选,tree-multiple 树形多选,input 输入框,calendar 日期选择器(默认 multiple) */
|
|
14
|
+
type?: 'single' | 'multiple' | 'tree-single' | 'tree-multiple' | 'input' | 'calendar';
|
|
15
15
|
/** 多选时的列数(默认 2) */
|
|
16
16
|
column?: number;
|
|
17
17
|
/** 格式化 value,默认返回原始数据。为 string 时,会作为 key 从原始数据中获取值,相当于 (d) => d[format]。为函数时,以函数返回结果作为 value */
|
|
@@ -26,6 +26,22 @@ export interface FilterItem {
|
|
|
26
26
|
placeholder?: string;
|
|
27
27
|
/** 是否使用插槽自定义渲染,为 true 时使用名为 key 的插槽 */
|
|
28
28
|
slot?: boolean;
|
|
29
|
+
/** 日期选择器相关配置(仅 type='calendar' 时有效) */
|
|
30
|
+
calendarConfig?: {
|
|
31
|
+
/** 是否支持区间选择:true/false 或数字(表示区间可选的最大天数) */
|
|
32
|
+
range?: boolean | number;
|
|
33
|
+
/** 最小可选日期,格式为 YYYY-MM-DD */
|
|
34
|
+
minDate?: string;
|
|
35
|
+
/** 最大可选日期,格式为 YYYY-MM-DD */
|
|
36
|
+
maxDate?: string;
|
|
37
|
+
/** 禁用日期函数 */
|
|
38
|
+
disabledDate?: (date: Date) => boolean;
|
|
39
|
+
/** 日期格式化函数 */
|
|
40
|
+
formatter?: (day: any) => {
|
|
41
|
+
text?: string;
|
|
42
|
+
bottomInfo?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
29
45
|
}
|
|
30
46
|
type __VLS_Props = {
|
|
31
47
|
/** 筛选项配置 */
|
|
@@ -58,8 +74,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
|
58
74
|
"onUpdate:modelValue"?: ((values: Record<string, any>) => any) | undefined;
|
|
59
75
|
onChange?: ((values: Record<string, any>, item: FilterItem) => any) | undefined;
|
|
60
76
|
}>, {
|
|
61
|
-
items: FilterItem[];
|
|
62
77
|
modelValue: Record<string, any>;
|
|
78
|
+
items: FilterItem[];
|
|
63
79
|
showMask: boolean;
|
|
64
80
|
autoConfirm: boolean;
|
|
65
81
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/search-area/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/search-area/index.vue"],"names":[],"mappings":"AA2tCA,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,2GAA2G;IAC3G,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC;IACtF,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;IACf,uCAAuC;IACvC,cAAc,CAAC,EAAE;QACf,2CAA2C;QAC3C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QACzB,4BAA4B;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,4BAA4B;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa;QACb,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;QACvC,cAAc;QACd,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAClE,CAAC;CACH;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;IACnB,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AA4mCF,QAAA,IAAI,QAAQ,QAAW,EAAE,QAAQ;;0BA9TV,GAAG;CA8TmB,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;AAmD5E,QAAA,MAAM,eAAe;IAjfnB,cAAc;;;;IAEd,aAAa;;;;;;;;;gBAvrBA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAFzB,UAAU,EAAE;cAIR,OAAO;iBAEJ,OAAO;6EA2qCrB,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"),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,{}),u=e.computed(()=>(c==null?void 0:c.iconClass)||"iconfont"),m=e.computed(()=>r.name||""),v=e.computed(()=>typeof r.size=="number"?`${r.size}px`:r.size||"16px"),p=e.computed(()=>({fontSize:v.value,color:r.color||void 0,lineHeight:1,fontFamily:(c==null?void 0:c.iconClass)||"iconfont"})),d=e.computed(()=>{const s=r.code;if(s==null||s===""||s===0)return"";if(typeof s=="number")return String.fromCharCode(s);const f=String(s).replace(/^0x/i,""),B=parseInt(f,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 f=`link[rel="stylesheet"][data-rcui-icon="true"][href="${s}"]`;if(!document.head.querySelector(f)){const k=document.createElement("link");k.rel="stylesheet",k.href=s,k.setAttribute("data-rcui-icon","true"),document.head.appendChild(k)}}),(s,f)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["rc-icon",[u.value,m.value,{"rc-icon--spin":n.spin}]]),style:e.normalizeStyle(p.value),"aria-hidden":"true"},[d.value?(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)],6))}}),w=(n,r)=>{const c=n.__vccOpts||n;for(const[u,m]of r)c[u]=m;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,u=r,m=p=>{!c.disabled&&!c.loading&&u("click",p)},v=e.computed(()=>{const p=c.round;return typeof p=="boolean"?p?"999px":"6px":typeof p=="number"?`${p}px`:String(p)});return(p,d)=>(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:v.value}),disabled:n.disabled||n.loading,onClick:m},[n.loading?(e.openBlock(),e.createElementBlock("span",Re)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.preIcon||p.$slots.preIcon?(e.openBlock(),e.createElementBlock("span",ze,[e.renderSlot(p.$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(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0),!n.loading&&(n.suffixIcon||p.$slots.suffixIcon)?(e.openBlock(),e.createElementBlock("span",Le,[e.renderSlot(p.$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))}}),M=w(Te,[["__scopeId","data-v-3ed3109f"]]);M.name="rc-button";function q(n){return n.component(M.name,M),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),u=e.inject("rcDescColCount",1),m=e.inject("rcDescLabelWidth",""),v=e.computed(()=>{const s=typeof r.span=="string"?parseInt(r.span,10):r.span,f=typeof(u==null?void 0:u.value)=="number"?u.value:u,B=!Number.isNaN(s)&&s>0?s:1;return Math.min(B,f||1)}),p=e.computed(()=>{const s=typeof(u==null?void 0:u.value)=="number"?u.value:u,f=typeof(c==null?void 0:c.value)=="number"?c.value:c,B=v.value;if(!s||s<=1||B>=s)return"100%";const k=(s-1)*f,b=(B-1)*f;return`calc((100% - ${k}px) * ${B} / ${s} + ${b}px)`}),d=e.computed(()=>{const s=typeof(m==null?void 0:m.value)=="string"?m.value:m,f=r.labelWidth!==""?r.labelWidth:s||"";return f?{width:typeof f=="number"?`${f}px`:String(f),flex:"0 0 auto"}:{}});return(s,f)=>(e.openBlock(),e.createElementBlock("div",{class:"rc-desc-item",style:e.normalizeStyle({width:p.value,flex:`0 0 ${p.value}`})},[e.createElementVNode("div",{class:"rc-desc-item__label",style:e.normalizeStyle(d.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))}}),T=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),u=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)),m=e.computed(()=>{const f=typeof r.column=="string"?Number.parseInt(r.column,10):r.column??1;return!Number.isNaN(f)&&f>0?f:1}),v=e.ref("100%"),p=e.ref("100%");e.watchEffect(()=>{const f=m.value;if(f<=1)v.value="100%",p.value="100%";else{const B=typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0,b=`calc((100% - ${(f-1)*B}px) / ${f})`;p.value=b,v.value=b}}),e.provide("rcDescItemWidth",v),e.provide("rcDescSingleWidth",p),e.provide("rcDescColCount",m),e.provide("rcDescGapPx",e.computed(()=>typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0));const d=e.computed(()=>r.labelWidth===""||r.labelWidth===void 0?"":typeof r.labelWidth=="number"?`${r.labelWidth}px`:String(r.labelWidth));e.provide("rcDescLabelWidth",d),e.provide("rcDescGap",e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)));const s=e.computed(()=>{var k,b,S;const f=((k=r.keyMap)==null?void 0:k.key)??"label",B=((b=r.keyMap)==null?void 0:b.value)??"value";return(S=r.data)!=null&&S.length?r.data.map(y=>({label:y==null?void 0:y[f],value:y==null?void 0:y[B]})):[]});return(f,B)=>(e.openBlock(),e.createElementBlock("div",We,[f.$slots.title||n.title?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(f.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(n.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-descriptions__body",style:e.normalizeStyle({gap:u.value}),ref_key:"wrapEl",ref:c},[s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(k,b)=>(e.openBlock(),e.createBlock(T,{key:b,label:k.label,value:k.value,"label-width":n.labelWidth},null,8,["label","value","label-width"]))),128)):e.renderSlot(f.$slots,"default",{key:1},void 0,!0)],4)]))}}),U=w(je,[["__scopeId","data-v-5fcaa235"]]);U.name="rc-descriptions";T.name="rc-descriptions-item";function H(n){return n.component(U.name,U),n.component("RcDescriptions",U),n.component(T.name,T),n.component("RcDescriptionsItem",T),n}const ke=U,he=T,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 d=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:d,boxShadow:p(r.elevation),width:v(r.width),height:v(r.height)}}),u=e.computed(()=>r.padding||"16px"),m=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap));function v(d){return d==null||d===""?"":typeof d=="number"?`${d}px`:String(d)}function p(d){if(!d||d<=0)return"none";const s=4*d;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(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rc-card",[{"rc-card--bordered":n.bordered}]]),style:e.normalizeStyle(c.value)},[d.$slots.title||n.title||d.$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(d.$slots,"title",{},()=>[e.createElementVNode("span",Ge,e.toDisplayString(n.title),1)],!0)]),d.$slots.status||n.status?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(d.$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:u.value,gap:m.value})},[e.renderSlot(d.$slots,"content",{},()=>[e.renderSlot(d.$slots,"default",{},void 0,!0)],!0)],4),d.$slots.action?(e.openBlock(),e.createElementBlock("div",Pe)):e.createCommentVNode("",!0),d.$slots.action?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(d.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),j=w(qe,[["__scopeId","data-v-a7b95214"]]);j.name="rc-card";const He="RcCard";function J(n){return n.component(j.name,j),n.component(He,j),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,u=e.ref(!0);let m;function v(){m&&(clearTimeout(m),m=null)}function p(){v(),u.value=!1}return r({close:p}),e.onMounted(()=>{c.duration&&c.duration>0&&(m=setTimeout(()=>{p()},c.duration))}),e.onUnmounted(()=>{v()}),(d,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(()=>[u.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(d.$slots,"default",{},void 0,!0)],64))}}),K=w(nt,[["__scopeId","data-v-d234c9c5"]]);let R=null,F=null;function ve(){R&&(R.unmount(),R=null),F&&(document.body.removeChild(F),F=null)}function lt(n){const r=typeof n=="string"?{message:n}:n||{};ve(),F=document.createElement("div"),document.body.appendChild(F);const c={message:r.message,type:r.type??"text",duration:r.duration??2e3,mask:r.mask??!1,onAfterLeave:()=>{var u;ve(),(u=r.onClose)==null||u.call(r)}};return R=e.createApp(K,c),R.mount(F),{close:ge}}function ge(){var n,r,c;R&&((c=(r=(n=R._instance)==null?void 0:n.exposed)==null?void 0:r.close)==null||c.call(r))}K.name="rc-toast";function ye(n){return n.component(K.name,K),n}const rt={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 u=1;function m(p){const d=c.findIndex(s=>s.id===p);d>=0&&c.splice(d,1)}function v(p,d,s){const f=u++;return c.push({id:f,type:p,content:d,duration:s}),s>0&&window.setTimeout(()=>m(f),s),f}return r({add:v,remove:m}),(p,d)=>(e.openBlock(),e.createElementBlock("div",rt,[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 L(n,r,c){var m;st();const u=typeof c=="number"?c:n==="loading"?0:2e3;return(m=N==null?void 0:N.add)==null?void 0:m.call(N,n,r,u)}const _e={open(n){return L(n.type||"info",n.content,n.duration)},info(n,r){return L("info",n,r)},success(n,r){return L("success",n,r)},warning(n,r){return L("warning",n,r)},error(n,r){return L("error",n,r)},loading(n,r){return L("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},autoConfirm:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(n,{expose:r,emit:c}){const u=n,m=c,v=e.ref(null),p=e.ref(null),d=e.ref(null),s=e.ref({top:"0px"}),f=async()=>{if(v.value===null||!p.value)return;await e.nextTick();const l=p.value.getBoundingClientRect().top;s.value={top:`${l}px`}},B=t=>{if(v.value===null||!p.value)return;const l=t.target;if(p.value.contains(l))return;const o=p.value.closest(".rc-search-area");if(o){const i=o.querySelector(".rc-search-area__bar");if(i&&i.contains(l))return}I()};e.watch(v,async t=>{t!==null?(await e.nextTick(),f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),document.addEventListener("click",B,!0)):(window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),document.removeEventListener("click",B,!0))}),e.onUnmounted(()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),document.removeEventListener("click",B,!0)});const k=e.ref({}),b=e.ref(""),S=e.ref({}),y=e.ref({...u.modelValue});e.watch(()=>u.modelValue,t=>{y.value={...t||{}}},{deep:!0,immediate:!0});const a=e.computed(()=>v.value===null?null:u.items[v.value]),Be=e.computed(()=>{if(!a.value)return"";const t=xe(a.value);return t>0?`(${t}项)`:""}),be=t=>{const l=y.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}: ${le(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?le(h,t):null}).filter(g=>g!==null);if(i.length>0)return`${t.label}: ${i.join("、")}`}}return t.label},Ce=t=>{const l=u.items[t];if(!l)return;if(v.value===t){v.value=null;return}const o=y.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"?k.value[l.key]=o!==void 0?o:null:k.value[l.key]=o!==void 0?Array.isArray(o)?[...o]:[o]:[],v.value=t},I=()=>{v.value=null},D=(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},le=(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 D(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 z=h[g];if(Array.isArray(z)&&z.length>0){const W=P(t,l,z);if(W)return W}}}return null},re=(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(...re(t,E))}return g},V=t=>{if(!a.value)return!1;const l=a.value.key,o=k.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?re(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]:y.value[t.key]},$e=(t,l)=>{if(t&&(S.value[t.key]=l,u.autoConfirm)){const o=t.key;y.value[o]=l,m("update:modelValue",{...y.value}),m("change",{...y.value},t),I()}},se=t=>{if(!a.value)return;const l=a.value.key,o=G(t,a.value);y.value[l];let i;k.value[l]===o?i=void 0:i=o,y.value[l]=i,m("update:modelValue",{...y.value}),m("change",{...y.value},a.value),I()},ie=t=>{if(!a.value)return;const l=a.value.key,o=G(t,a.value),i=Array.isArray(k.value[l])?[...k.value[l]]:[],g=i.findIndex(h=>h===o||String(h)===String(o));if(g>=0?i.splice(g,1):i.push(o),k.value[l]=i,u.autoConfirm){const h=i.length>0?i:void 0;y.value[l]=h,m("update:modelValue",{...y.value}),m("change",{...y.value},a.value),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"?k.value[t]=null:k.value[t]=[]},Ve=()=>{if(u.autoConfirm&&a.value){const t=a.value.key,l=b.value.trim()||void 0;y.value[t]=l,m("update:modelValue",{...y.value}),m("change",{...y.value},a.value),I()}},Ne=()=>{if(!a.value)return;const t=a.value.key;y.value[t];let l;if(a.value.slot)l=S.value[t],y.value[t]=l;else if(a.value.type==="input")l=b.value.trim()||void 0,y.value[t]=l;else if(a.value.type==="single"||a.value.type==="tree-single"){const o=k.value[t];l=o??void 0,y.value[t]=l}else{const o=k.value[t];l=Array.isArray(o)&&o.length>0?o:void 0,y.value[t]=l}m("update:modelValue",{...y.value}),m("change",{...y.value},a.value),I()},ue=t=>{const l=y.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=k.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:()=>({...y.value}),reset:()=>{y.value={},k.value={},S.value={},m("update:modelValue",{})}}),(t,l)=>(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.items,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["rc-search-area__item",{"is-active":v.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:v.value!==i&&ue(o)>0?"#1677ff":"#969799",class:e.normalizeClass(["rc-search-area__item-arrow",{"is-up":v.value===i}])},null,8,["color","class"])],10,dt))),128))]),e.createVNode(e.Transition,{name:"rc-search-area-fade"},{default:e.withCtx(()=>[v.value!==null&&u.showMask?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"maskRef",ref:d,class:"rc-search-area__mask",style:e.normalizeStyle(s.value),onClick:I},null,4)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"rc-search-area-slide"},{default:e.withCtx(()=>{var o,i,g,h,E,z,W,de,fe,me,pe;return[v.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"panelRef",ref:p,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),(_,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:"rc-search-area__tree-group"},[e.createElementVNode("div",kt,e.toDisplayString(D(_,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(D($,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),(_,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:"rc-search-area__tree-group"},[e.createElementVNode("div",bt,e.toDisplayString(D(_,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(D($,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),(_,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V(_)}]),onClick:$=>se(_)},[e.createElementVNode("span",Nt,e.toDisplayString(D(_,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),(_,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:e.normalizeClass(["rc-search-area__option",{"is-selected":V(_)}]),onClick:$=>ie(_)},[e.createElementVNode("span",It,e.toDisplayString(D(_,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))])),((z=a.value)==null?void 0:z.type)!=="input"&&!((W=a.value)!=null&&W.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)]),!u.autoConfirm&&((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(M),{block:"",onClick:Ee},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode(" 重置 ",-1)])]),_:1}),e.createVNode(e.unref(M),{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-2252d02c"]]),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 u=`link[rel="stylesheet"][data-rcui-icon="true"][href="${c.iconCssUrl}"]`;if(!document.head.querySelector(u)){const v=document.createElement("link");v.rel="stylesheet",v.href=c.iconCssUrl,v.setAttribute("data-rcui-icon","true"),document.head.appendChild(v)}}return zt(n,c),n},Lt={install:ne};function Tt(n){return{install(r){ne(r,n)}}}exports.RECYCLE_UI_SYMBOL=O;exports.RcButton=M;exports.RcCard=j;exports.RcDescriptions=ke;exports.RcDescriptionsItem=he;exports.RcIcon=C;exports.RcSearchArea=Z;exports.RcToast=K;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=lt;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),He={key:0,class:"rc-icon__unicode"},qe=e.defineComponent({name:"rc-icon",__name:"index",props:{name:{},size:{default:16},color:{default:""},spin:{type:Boolean,default:!1},code:{default:""}},setup(t){const r=t,d=e.inject(he,{}),o=e.computed(()=>(d==null?void 0:d.iconClass)||"iconfont"),p=e.computed(()=>r.name||""),g=e.computed(()=>typeof r.size=="number"?`${r.size}px`:r.size||"16px"),m=e.computed(()=>({fontSize:g.value,color:r.color||void 0,lineHeight:1,fontFamily:(d==null?void 0:d.iconClass)||"iconfont"})),v=e.computed(()=>{const i=r.code;if(i==null||i===""||i===0)return"";if(typeof i=="number")return String.fromCharCode(i);const y=String(i).replace(/^0x/i,""),$=parseInt(y,16);return Number.isNaN($)?"":String.fromCharCode($)});return e.onMounted(()=>{if(typeof window>"u")return;const i=d&&d.iconCssUrl||Re.iconCssUrl;if(!i)return;const y=`link[rel="stylesheet"][data-rcui-icon="true"][href="${i}"]`;if(!document.head.querySelector(y)){const _=document.createElement("link");_.rel="stylesheet",_.href=i,_.setAttribute("data-rcui-icon","true"),document.head.appendChild(_)}}),(i,y)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["rc-icon",[o.value,p.value,{"rc-icon--spin":t.spin}]]),style:e.normalizeStyle(m.value),"aria-hidden":"true"},[v.value?(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(v.value),1)):e.createCommentVNode("",!0)],6))}}),H=(t,r)=>{const d=t.__vccOpts||t;for(const[o,p]of r)d[o]=p;return d},L=H(qe,[["__scopeId","data-v-3857a892"]]),Je=["disabled"],Qe={key:0,class:"rc-button__spinner"},Xe={key:0,class:"rc-button__icon rc-button__icon--prefix"},Ze={key:2,class:"rc-button__icon rc-button__icon--suffix"},et=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:r}){const d=t,o=r,p=m=>{!d.disabled&&!d.loading&&o("click",m)},g=e.computed(()=>{const m=d.round;return typeof m=="boolean"?m?"999px":"6px":typeof m=="number"?`${m}px`:String(m)});return(m,v)=>(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:g.value}),disabled:t.disabled||t.loading,onClick:p},[t.loading?(e.openBlock(),e.createElementBlock("span",Qe)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.preIcon||m.$slots.preIcon?(e.openBlock(),e.createElementBlock("span",Xe,[e.renderSlot(m.$slots,"preIcon",{},()=>[t.preIcon?(e.openBlock(),e.createBlock(L,{key:0,name:t.preIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],64)),e.renderSlot(m.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0),!t.loading&&(t.suffixIcon||m.$slots.suffixIcon)?(e.openBlock(),e.createElementBlock("span",Ze,[e.renderSlot(m.$slots,"suffixIcon",{},()=>[t.suffixIcon?(e.openBlock(),e.createBlock(L,{key:0,name:t.suffixIcon},null,8,["name"])):e.createCommentVNode("",!0)],!0)])):e.createCommentVNode("",!0)],14,Je))}}),q=H(et,[["__scopeId","data-v-3ed3109f"]]);q.name="rc-button";function Se(t){return t.component(q.name,q),t}const tt={class:"rc-desc-item__value"},nt=e.defineComponent({name:"rc-descriptions-item",__name:"item",props:{label:{default:""},value:{default:""},labelWidth:{default:""},span:{default:1}},setup(t){const r=t;e.inject("rcDescItemWidth",void 0),e.inject("rcDescSingleWidth",""),e.inject("rcDescGap","0px");const d=e.inject("rcDescGapPx",0),o=e.inject("rcDescColCount",1),p=e.inject("rcDescLabelWidth",""),g=e.computed(()=>{const i=typeof r.span=="string"?parseInt(r.span,10):r.span,y=typeof(o==null?void 0:o.value)=="number"?o.value:o,$=!Number.isNaN(i)&&i>0?i:1;return Math.min($,y||1)}),m=e.computed(()=>{const i=typeof(o==null?void 0:o.value)=="number"?o.value:o,y=typeof(d==null?void 0:d.value)=="number"?d.value:d,$=g.value;if(!i||i<=1||$>=i)return"100%";const _=(i-1)*y,h=($-1)*y;return`calc((100% - ${_}px) * ${$} / ${i} + ${h}px)`}),v=e.computed(()=>{const i=typeof(p==null?void 0:p.value)=="string"?p.value:p,y=r.labelWidth!==""?r.labelWidth:i||"";return y?{width:typeof y=="number"?`${y}px`:String(y),flex:"0 0 auto"}:{}});return(i,y)=>(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(v.value)},[e.renderSlot(i.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)],4),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)],!0)])],4))}}),le=H(nt,[["__scopeId","data-v-970d0b99"]]),at={class:"rc-descriptions"},lt={key:0,class:"rc-descriptions__title"},ot=e.defineComponent({name:"rc-descriptions",__name:"index",props:{title:{},column:{default:2},gap:{default:4},labelWidth:{default:""},data:{default:()=>[]},keyMap:{}},setup(t){const r=t,d=e.ref(null),o=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)),p=e.computed(()=>{const y=typeof r.column=="string"?Number.parseInt(r.column,10):r.column??1;return!Number.isNaN(y)&&y>0?y:1}),g=e.ref("100%"),m=e.ref("100%");e.watchEffect(()=>{const y=p.value;if(y<=1)g.value="100%",m.value="100%";else{const $=typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0,h=`calc((100% - ${(y-1)*$}px) / ${y})`;m.value=h,g.value=h}}),e.provide("rcDescItemWidth",g),e.provide("rcDescSingleWidth",m),e.provide("rcDescColCount",p),e.provide("rcDescGapPx",e.computed(()=>typeof r.gap=="number"?r.gap:parseFloat(String(r.gap))||0));const v=e.computed(()=>r.labelWidth===""||r.labelWidth===void 0?"":typeof r.labelWidth=="number"?`${r.labelWidth}px`:String(r.labelWidth));e.provide("rcDescLabelWidth",v),e.provide("rcDescGap",e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap)));const i=e.computed(()=>{var _,h,b;const y=((_=r.keyMap)==null?void 0:_.key)??"label",$=((h=r.keyMap)==null?void 0:h.value)??"value";return(b=r.data)!=null&&b.length?r.data.map(S=>({label:S==null?void 0:S[y],value:S==null?void 0:S[$]})):[]});return(y,$)=>(e.openBlock(),e.createElementBlock("div",at,[y.$slots.title||t.title?(e.openBlock(),e.createElementBlock("div",lt,[e.renderSlot(y.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"rc-descriptions__body",style:e.normalizeStyle({gap:o.value}),ref_key:"wrapEl",ref:d},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(i.value,(_,h)=>(e.openBlock(),e.createBlock(le,{key:h,label:_.label,value:_.value,"label-width":t.labelWidth},null,8,["label","value","label-width"]))),128)):e.renderSlot(y.$slots,"default",{key:1},void 0,!0)],4)]))}}),ie=H(ot,[["__scopeId","data-v-5fcaa235"]]);ie.name="rc-descriptions";le.name="rc-descriptions-item";function $e(t){return t.component(ie.name,ie),t.component("RcDescriptions",ie),t.component(le.name,le),t.component("RcDescriptionsItem",le),t}const We=ie,Oe=le,rt={class:"rc-card__title"},ct={class:"rc-card__title-text"},st={key:0,class:"rc-card__status"},ut={key:1,class:"rc-card__divider"},it={key:2,class:"rc-card__action"},dt=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 r=t,d=e.computed(()=>{const v=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:v,boxShadow:m(r.elevation),width:g(r.width),height:g(r.height)}}),o=e.computed(()=>r.padding||"16px"),p=e.computed(()=>typeof r.gap=="number"?`${r.gap}px`:String(r.gap));function g(v){return v==null||v===""?"":typeof v=="number"?`${v}px`:String(v)}function m(v){if(!v||v<=0)return"none";const i=4*v;return`0 ${Math.round(i/2)}px ${i}px rgba(0,0,0,0.06), 0 ${Math.round(i/4)}px ${Math.round(i/2)}px rgba(0,0,0,0.04)`}return(v,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rc-card",[{"rc-card--bordered":t.bordered}]]),style:e.normalizeStyle(d.value)},[v.$slots.title||t.title||v.$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",rt,[e.renderSlot(v.$slots,"title",{},()=>[e.createElementVNode("span",ct,e.toDisplayString(t.title),1)],!0)]),v.$slots.status||t.status?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(v.$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:o.value,gap:p.value})},[e.renderSlot(v.$slots,"content",{},()=>[e.renderSlot(v.$slots,"default",{},void 0,!0)],!0)],4),v.$slots.action?(e.openBlock(),e.createElementBlock("div",ut)):e.createCommentVNode("",!0),v.$slots.action?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(v.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),de=H(dt,[["__scopeId","data-v-a7b95214"]]);de.name="rc-card";const ft="RcCard";function Ee(t){return t.component(de.name,de),t.component(ft,de),t}const mt={key:0,class:"rc-toast__mask"},vt={class:"rc-toast__content"},pt={key:0,class:"rc-toast__spinner"},yt={key:1,class:"rc-toast__icon rc-toast__icon--success"},ht={key:2,class:"rc-toast__icon rc-toast__icon--fail"},kt={class:"rc-toast__text"},gt=e.defineComponent({__name:"index",props:{message:{default:""},type:{default:"text"},duration:{default:2e3},mask:{type:Boolean,default:!1},onAfterLeave:{}},setup(t,{expose:r}){const d=t,o=e.ref(!0);let p;function g(){p&&(clearTimeout(p),p=null)}function m(){g(),o.value=!1}return r({close:m}),e.onMounted(()=>{d.duration&&d.duration>0&&(p=setTimeout(()=>{m()},d.duration))}),e.onUnmounted(()=>{g()}),(v,i)=>(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(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-toast",[`rc-toast--${t.type}`]])},[t.mask?(e.openBlock(),e.createElementBlock("div",mt)):e.createCommentVNode("",!0),e.createElementVNode("div",vt,[t.type==="loading"?(e.openBlock(),e.createElementBlock("div",pt)):t.type==="success"?(e.openBlock(),e.createElementBlock("div",yt)):t.type==="fail"?(e.openBlock(),e.createElementBlock("div",ht)):e.createCommentVNode("",!0),e.createElementVNode("div",kt,e.toDisplayString(t.message),1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["onAfterLeave"])])),e.renderSlot(v.$slots,"default",{},void 0,!0)],64))}}),fe=H(gt,[["__scopeId","data-v-d234c9c5"]]);let ne=null,oe=null;function Ye(){ne&&(ne.unmount(),ne=null),oe&&(document.body.removeChild(oe),oe=null)}function _t(t){const r=typeof t=="string"?{message:t}:t||{};Ye(),oe=document.createElement("div"),document.body.appendChild(oe);const d={message:r.message,type:r.type??"text",duration:r.duration??2e3,mask:r.mask??!1,onAfterLeave:()=>{var o;Ye(),(o=r.onClose)==null||o.call(r)}};return ne=e.createApp(fe,d),ne.mount(oe),{close:je}}function je(){var t,r,d;ne&&((d=(r=(t=ne._instance)==null?void 0:t.exposed)==null?void 0:r.close)==null||d.call(r))}fe.name="rc-toast";function Pe(t){return t.component(fe.name,fe),t}const Bt={class:"rc-message",role:"alert","aria-live":"polite"},Ct={class:"rc-message__content"},bt=e.defineComponent({__name:"index",setup(t,{expose:r}){const d=e.reactive([]);let o=1;function p(m){const v=d.findIndex(i=>i.id===m);v>=0&&d.splice(v,1)}function g(m,v,i){const y=o++;return d.push({id:y,type:m,content:v,duration:i}),i>0&&window.setTimeout(()=>p(y),i),y}return r({add:g,remove:p}),(m,v)=>(e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(e.TransitionGroup,{name:"rc-message-fade",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass(["rc-message__item",`rc-message--${i.type}`])},[e.createElementVNode("span",Ct,e.toDisplayString(i.content),1)],2))),128))]),_:1})]))}}),Vt=H(bt,[["__scopeId","data-v-87811df0"]]);let Z=null,X=null;function St(){var r;if(Z&&X)return;Z=document.createElement("div"),document.body.appendChild(Z);const t=e.createVNode(Vt,{});e.render(t,Z),X=(r=t.component)==null?void 0:r.exposed}function ae(t,r,d){var p;St();const o=typeof d=="number"?d:t==="loading"?0:2e3;return(p=X==null?void 0:X.add)==null?void 0:p.call(X,t,r,o)}const Ge={open(t){return ae(t.type||"info",t.content,t.duration)},info(t,r){return ae("info",t,r)},success(t,r){return ae("success",t,r)},warning(t,r){return ae("warning",t,r)},error(t,r){return ae("error",t,r)},loading(t,r){return ae("loading",t,r)},destroy(){Z&&(e.render(null,Z),Z.remove(),Z=null,X=null)}};function De(t){return t.config.globalProperties.$message=Ge,t}L.name="rc-icon";function xe(t){return t.component(L.name,L),t.component("RcIcon",L),t}const $t={class:"rc-popup__content"},Et=e.defineComponent({name:"rc-popup",__name:"index",props:{modelValue:{type:Boolean,default:!1},position:{default:"center"},overlay:{type:Boolean,default:!0},overlayClass:{default:""},overlayStyle:{default:void 0},closeable:{type:Boolean,default:!1},closeIconPosition:{default:"top-right"},closeIcon:{default:"icon_close"},round:{type:Boolean,default:!1},popupStyle:{default:void 0},closeOnClickOverlay:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0}},emits:["update:modelValue","open","close","click-overlay"],setup(t,{expose:r,emit:d}){const o=t,p=d,g=e.ref(),m=e.ref(o.modelValue);e.watch(()=>o.modelValue,s=>{m.value=s,s?(p("open"),o.lockScroll&&$()):(p("close"),o.lockScroll&&_())},{immediate:!0}),e.watch(m,s=>{s!==o.modelValue&&p("update:modelValue",s)});const v=e.computed(()=>`rc-popup-slide-${o.position}`),i=e.computed(()=>({...o.popupStyle||{}}));let y=!1;function $(){y||(y=!0,document.body.style.overflow="hidden")}function _(){y&&(y=!1,document.body.style.overflow="")}function h(){p("click-overlay"),o.closeOnClickOverlay&&S()}function b(){S()}function S(){m.value=!1}function B(){m.value=!0}return e.onUnmounted(()=>{_()}),r({open:B,close:S,visible:m}),(s,J)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"rc-popup-fade"},{default:e.withCtx(()=>[m.value&&o.overlay?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-popup__overlay",{"rc-popup__overlay--transparent":o.overlayClass==="transparent"}]),style:e.normalizeStyle(o.overlayStyle),onClick:h},null,6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:v.value},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popupRef",ref:g,class:e.normalizeClass(["rc-popup",[`rc-popup--${t.position}`,{"rc-popup--round":t.round}]]),style:e.normalizeStyle(i.value),onClick:J[0]||(J[0]=e.withModifiers(()=>{},["stop"]))},[t.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rc-popup__close",`rc-popup__close--${t.closeIconPosition}`]),onClick:b},[e.createVNode(L,{name:t.closeIcon,class:"rc-popup__close-icon"},null,8,["name"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.renderSlot(s.$slots,"default",{},void 0,!0)])],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),re=H(Et,[["__scopeId","data-v-f1696784"]]);re.name="rc-popup";const Dt="RcPopup";function Ne(t){return t.component(re.name,re),t.component(Dt,re),t}const xt={key:0,class:"rc-calendar__header"},Nt={class:"rc-calendar__header-title"},wt={class:"rc-calendar__month-title"},It={class:"rc-calendar__weekdays"},Mt={class:"rc-calendar__days"},Rt=["onClick"],Tt={class:"rc-calendar__day-content"},Ft={class:"rc-calendar__day-text"},zt={key:0,class:"rc-calendar__day-bottom"},At={key:1,class:"rc-calendar__footer"},Lt={key:0,class:"rc-calendar__month-picker-overlay"},Yt={class:"rc-calendar__month-picker"},Pt={class:"rc-calendar__month-picker-header"},Ut={class:"rc-calendar__month-picker-title"},Wt={key:0},Ot={key:0,class:"rc-calendar__year-picker-content"},jt={class:"rc-calendar__year-picker-grid"},Gt=["onClick"],Kt={key:1,class:"rc-calendar__month-picker-content"},Ht=["onClick"],ye=48,Y=3,Ve=7,qt=e.defineComponent({__name:"panel-content",props:{showTitle:{type:Boolean},title:{},range:{type:Boolean},selectedDate:{},rangeStart:{},rangeEnd:{},minDate:{},maxDate:{},disabledDate:{type:Function},formatter:{type:Function},showFooter:{type:Boolean}},emits:["select-day","clear","confirm"],setup(t,{expose:r,emit:d}){const o=t,p=d,g=["日","一","二","三","四","五","六"];function m(a){if(!a)return null;const u=new Date(a);return isNaN(u.getTime())?null:u}function v(a){const u=a.getFullYear(),f=String(a.getMonth()+1).padStart(2,"0"),V=String(a.getDate()).padStart(2,"0");return`${u}-${f}-${V}`}const i=e.ref(new Date);e.watch(()=>[o.selectedDate,o.rangeStart],()=>{if(o.range&&o.rangeStart){const a=m(o.rangeStart);a&&(i.value=a)}else if(!o.range&&o.selectedDate){const a=m(o.selectedDate);a&&(i.value=a)}},{immediate:!0});function y(a){const u=new Date;return a.getFullYear()===u.getFullYear()&&a.getMonth()===u.getMonth()&&a.getDate()===u.getDate()}function $(a){if(!o.rangeStart||!o.rangeEnd)return!1;const u=v(a),f=o.rangeStart,V=o.rangeEnd;return u>f&&u<V}function _(a){if(o.disabledDate&&o.disabledDate(a))return!0;const u=v(a);return!!(o.minDate&&u<o.minDate||o.maxDate&&u>o.maxDate)}function h(a,u){const f=new Date(a,u,1),V=new Date(a,u+1,0),D=f.getDay(),W=V.getDate(),j=[],se=new Date(a,u,0).getDate();for(let R=D-1;R>=0;R--){const T={date:new Date(a,u-1,se-R),type:"prev-month",text:String(se-R)};if(o.formatter){const F=o.formatter(T);F.text&&(T.text=F.text),F.bottomInfo&&(T.bottomInfo=F.bottomInfo)}j.push(T)}for(let R=1;R<=W;R++){const T={date:new Date(a,u,R),type:"current-month",text:String(R)};if(o.formatter){const F=o.formatter(T);F.text&&(T.text=F.text),F.bottomInfo&&(T.bottomInfo=F.bottomInfo)}j.push(T)}const pe=42-j.length;for(let R=1;R<=pe;R++){const T={date:new Date(a,u+1,R),type:"next-month",text:String(R)};if(o.formatter){const F=o.formatter(T);F.text&&(T.text=F.text),F.bottomInfo&&(T.bottomInfo=F.bottomInfo)}j.push(T)}return j}const b=e.computed(()=>{const a=i.value.getFullYear(),u=i.value.getMonth();return h(a,u)}),S=e.computed(()=>{const a=i.value.getFullYear(),u=i.value.getMonth()+1;return`${a}年${u}月`});function B(a){const u=[];if(a.type!=="current-month"&&u.push("is-other-month"),y(a.date)&&u.push("is-today"),_(a.date))return u.push("is-disabled"),u;const f=v(a.date);return o.range?(o.rangeStart===f&&u.push("is-start"),o.rangeEnd===f&&u.push("is-end"),$(a.date)&&u.push("is-in-range")):o.selectedDate===f&&u.push("is-selected"),u}const s=e.computed(()=>!!(o.rangeStart&&o.rangeEnd)),J=e.computed(()=>o.rangeStart&&o.rangeEnd?2:o.rangeStart||o.rangeEnd?1:0);function ee(a){if(!o.minDate&&!o.maxDate)return!1;const u=o.minDate?m(o.minDate):null,f=o.maxDate?m(o.maxDate):null;return!!(u&&a<u.getFullYear()||f&&a>f.getFullYear())}function Q(a,u){const f=o.minDate?m(o.minDate):null,V=o.maxDate?m(o.maxDate):null;if(f){const D=f.getFullYear(),W=f.getMonth()+1;if(a<D||a===D&&u<W)return!0}if(V){const D=V.getFullYear(),W=V.getMonth()+1;if(a>D||a===D&&u>W)return!0}return!1}const z=e.ref(!1),w=e.ref("year"),I=e.ref(i.value.getFullYear()),G=e.ref(i.value.getMonth()+1),P=e.ref(),U=e.ref(1900),M=e.ref(1920),x=e.ref(1900),k=e.ref(2100),C=e.computed(()=>{const a=[],f=Math.floor((U.value-x.value)/Y)-3,V=Math.ceil((M.value-x.value)/Y)+3,D=x.value+Math.max(0,f)*Y,W=x.value+V*Y-1;for(let j=D;j<=W;j++)a.push(j);return a});e.watch(()=>i.value,a=>{I.value=a.getFullYear(),G.value=a.getMonth()+1},{immediate:!0});function E(){if(!P.value)return;const a=P.value.scrollTop,f=Math.max(0,Math.floor(a/ye)),V=x.value+f*Y,D=V+Ve*Y-1;V<x.value?x.value=V-100:D>k.value&&(k.value=D+100),(V!==U.value||D!==M.value)&&(U.value=V,M.value=D)}function A(){I.value=i.value.getFullYear(),G.value=i.value.getMonth()+1,w.value="year",z.value=!0;const a=I.value;a<x.value?x.value=Math.floor(a/100)*100:a>k.value&&(k.value=Math.ceil(a/100)*100+99),e.nextTick(()=>{if(P.value){const u=Math.floor((a-x.value)/Y),f=Math.max(0,u-2);U.value=x.value+f*Y,M.value=U.value+Ve*Y-1,O(a)}})}function O(a){if(!P.value)return;a<x.value?x.value=Math.floor(a/100)*100:a>k.value&&(k.value=Math.ceil(a/100)*100+99);const u=Math.floor((a-x.value)/Y),f=u*ye;P.value.scrollTop=f;const V=Math.max(0,u-2);U.value=x.value+V*Y,M.value=U.value+Ve*Y-1}function me(){const a=new Date(i.value);a.setMonth(a.getMonth()-1),i.value=a}function ke(){const a=new Date(i.value);a.setMonth(a.getMonth()+1),i.value=a}function ge(a){ee(a)||(I.value=a,w.value="month")}function _e(a){Q(I.value,a)||(G.value=a,Be())}function Be(){const a=new Date(i.value);a.setFullYear(I.value),a.setMonth(G.value-1),i.value=a,z.value=!1,w.value="year"}function ve(a){p("select-day",a)}function Ce(){p("clear")}function n(){p("confirm")}function l(){z.value=!1}function c(a){w.value=a}return r({yearScrollRef:P}),(a,u)=>(e.openBlock(),e.createElementBlock("div",null,[t.showTitle?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Nt,e.toDisplayString(t.title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",wt,[e.createElementVNode("div",{class:"rc-calendar__nav-button",onClick:me},[e.createVNode(e.unref(L),{name:"icon_caret-left",class:"rc-calendar__nav-icon"})]),e.createElementVNode("div",{class:"rc-calendar__month-text",onClick:A},e.toDisplayString(S.value),1),e.createElementVNode("div",{class:"rc-calendar__nav-button",onClick:ke},[e.createVNode(e.unref(L),{name:"icon_caret-right",class:"rc-calendar__nav-icon"})])]),e.createElementVNode("div",It,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,f=>e.createElementVNode("div",{key:f,class:"rc-calendar__weekday"},e.toDisplayString(f),1)),64))]),e.createElementVNode("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(f,V)=>(e.openBlock(),e.createElementBlock("div",{key:V,class:e.normalizeClass(["rc-calendar__day",B(f)]),onClick:D=>ve(f)},[e.createElementVNode("div",Tt,[e.createElementVNode("span",Ft,e.toDisplayString(f.text),1),f.bottomInfo?(e.openBlock(),e.createElementBlock("span",zt,e.toDisplayString(f.bottomInfo),1)):e.createCommentVNode("",!0)])],10,Rt))),128))]),t.range&&t.showFooter?(e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(q),{type:"default",class:"rc-calendar__footer-reset",onClick:Ce},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(q),{type:"primary",class:"rc-calendar__footer-confirm",disabled:!s.value,onClick:n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value?`确定(${J.value}项)`:"确定"),1)]),_:1},8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"rc-calendar-fade"},{default:e.withCtx(()=>[z.value?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("div",Yt,[e.createElementVNode("div",Pt,[e.createVNode(e.unref(q),{type:"default",mode:"text",size:"small",onClick:l},{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode("取消",-1)])]),_:1}),e.createElementVNode("div",Ut,[e.createElementVNode("span",{onClick:u[0]||(u[0]=f=>c("year"))},e.toDisplayString(I.value)+"年",1),w.value==="month"?(e.openBlock(),e.createElementBlock("span",Wt," - ")):e.createCommentVNode("",!0),w.value==="month"?(e.openBlock(),e.createElementBlock("span",{key:1,onClick:u[1]||(u[1]=f=>c("month"))},e.toDisplayString(G.value)+"月",1)):e.createCommentVNode("",!0)])]),w.value==="year"?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{class:"rc-calendar__year-picker-scroll",ref_key:"yearScrollRef",ref:P,onScroll:E},[e.createElementVNode("div",{class:"rc-calendar__year-picker-spacer",style:e.normalizeStyle({height:`${Math.floor((U.value-x.value)/Y)*ye}px`})},null,4),e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:e.normalizeClass(["rc-calendar__year-picker-item",{"is-selected":I.value===f,"is-disabled":ee(f)}]),onClick:V=>ge(f)},e.toDisplayString(f),11,Gt))),128))]),e.createElementVNode("div",{class:"rc-calendar__year-picker-spacer",style:e.normalizeStyle({height:`${Math.ceil((k.value-M.value)/Y)*ye}px`})},null,4)],544)])):e.createCommentVNode("",!0),w.value==="month"?(e.openBlock(),e.createElementBlock("div",Kt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(12,f=>e.createElementVNode("div",{key:f,class:e.normalizeClass(["rc-calendar__month-picker-item",{"is-selected":G.value===f,"is-disabled":Q(I.value,f)}]),onClick:V=>_e(f)},e.toDisplayString(f)+"月 ",11,Ht)),64))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1})]))}}),Ue=H(qt,[["__scopeId","data-v-30d4815e"]]),Jt={class:"rc-calendar"},Qt=["placeholder"],Xt={key:1,class:"rc-calendar__panel"},Zt=e.defineComponent({name:"rc-calendar",__name:"index",props:{modelValue:{default:null},range:{type:[Boolean,Number],default:!1},mode:{default:"default"},placeholder:{default:"请选择日期"},showTitle:{type:Boolean,default:!0},title:{default:"选择日期"},minDate:{default:void 0},maxDate:{default:void 0},disabledDate:{type:Function,default:void 0},formatter:{type:Function,default:void 0},showFooter:{type:Boolean,default:!0}},emits:["update:modelValue","change","confirm"],setup(t,{emit:r}){const d=t,o=r,p=e.ref(),g=e.ref(),m=e.ref(!1),v=e.ref(""),i=e.computed(()=>d.range===!0||typeof d.range=="number"),y=e.computed(()=>typeof d.range=="number"?d.range:void 0),$=e.computed(()=>k=>{if(d.disabledDate&&d.disabledDate(k))return!0;if(y.value!==void 0&&h.value&&!b.value){const C=s(k);if(B(h.value)&&J(h.value,C)>y.value)return!0}return!1}),_=e.ref(null),h=e.ref(null),b=e.ref(null);e.watch(()=>d.modelValue,k=>{i.value?Array.isArray(k)&&k.length===2?(h.value=k[0],b.value=k[1]):(h.value=null,b.value=null):_.value=typeof k=="string"?k:null,S()},{immediate:!0});function S(){d.mode==="popup"&&(i.value?h.value&&b.value?v.value=`${h.value} ~ ${b.value}`:h.value?v.value=`${h.value} ~ `:v.value="":v.value=_.value||"")}function B(k){if(!k)return null;const C=new Date(k);return isNaN(C.getTime())?null:C}function s(k){const C=k.getFullYear(),E=String(k.getMonth()+1).padStart(2,"0"),A=String(k.getDate()).padStart(2,"0");return`${C}-${E}-${A}`}function J(k,C){const E=B(k),A=B(C);if(!E||!A)return 0;const O=Math.abs(A.getTime()-E.getTime());return Math.ceil(O/(1e3*60*60*24))}function ee(k){if(k.type!=="current-month"||d.disabledDate&&d.disabledDate(k.date))return;const C=s(k.date);if(!(d.minDate&&C<d.minDate)&&!(d.maxDate&&C>d.maxDate)){if(i.value)if(!h.value||h.value&&b.value)h.value=C,b.value=null;else{let E=h.value,A=C;if(C<h.value&&(A=h.value,E=C),h.value=E,b.value=A,h.value&&b.value){const O=[h.value,b.value];o("update:modelValue",O),o("change",O),d.showFooter||Q()}}else{_.value=C;const E=C;o("update:modelValue",E),o("change",E),d.mode&&I()}S()}}function Q(){if(h.value&&b.value){const k=[h.value,b.value];o("update:modelValue",k),o("change",k),o("confirm",k),I()}}function z(){i.value?(h.value=null,b.value=null):_.value=null;const k=null;o("update:modelValue",k),o("change",k),S()}function w(){m.value=!0}function I(){m.value=!1}function G(k){m.value=k}function P(){w()}function U(){d.mode==="popup"&&x()}function M(){m.value||w()}function x(){const k=v.value.trim();if(i.value){const C=k.split("~").map(E=>E.trim());if(C.length===2&&C[0]&&C[1]){const E=B(C[0]),A=B(C[1]);if(E&&A&&!isNaN(E.getTime())&&!isNaN(A.getTime())){h.value=s(E),b.value=s(A);const O=[h.value,b.value];o("update:modelValue",O),o("change",O);return}}}else{const C=B(k);if(C&&!isNaN(C.getTime())){_.value=s(C),o("update:modelValue",_.value),o("change",_.value);return}}S()}return(k,C)=>(e.openBlock(),e.createElementBlock("div",Jt,[t.mode==="popup"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"rc-calendar__input",onClick:w},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:p,"onUpdate:modelValue":C[0]||(C[0]=E=>v.value=E),type:"text",class:"rc-calendar__input-field",placeholder:t.placeholder,readonly:"",onFocus:P,onBlur:U,onInput:M},null,40,Qt),[[e.vModelText,v.value]]),e.createVNode(e.unref(L),{name:"icon_a-rili",class:"rc-calendar__input-icon"})])):e.createCommentVNode("",!0),t.mode==="default"?(e.openBlock(),e.createElementBlock("div",Xt,[e.createVNode(Ue,{"show-title":t.showTitle,title:t.title,range:i.value,"selected-date":_.value,"range-start":h.value,"range-end":b.value,"min-date":t.minDate,"max-date":t.maxDate,"disabled-date":$.value,formatter:t.formatter,"show-footer":!1,onSelectDay:ee,onClear:z,onConfirm:Q},null,8,["show-title","title","range","selected-date","range-start","range-end","min-date","max-date","disabled-date","formatter"])])):e.createCommentVNode("",!0),t.mode==="popup"?(e.openBlock(),e.createBlock(e.unref(re),{key:2,modelValue:m.value,"onUpdate:modelValue":[C[1]||(C[1]=E=>m.value=E),G],position:"bottom",overlay:!0,round:!0,"close-on-click-overlay":!0,"lock-scroll":!0},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"popupPanelRef",ref:g,class:"rc-calendar__panel"},[e.createVNode(Ue,{"show-title":t.showTitle,title:t.title,range:i.value,"selected-date":_.value,"range-start":h.value,"range-end":b.value,"min-date":t.minDate,"max-date":t.maxDate,"disabled-date":$.value,formatter:t.formatter,"show-footer":t.showFooter,onSelectDay:ee,onClear:z,onConfirm:Q},null,8,["show-title","title","range","selected-date","range-start","range-end","min-date","max-date","disabled-date","formatter","show-footer"])],512)]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)]))}}),ce=H(Zt,[["__scopeId","data-v-2836ea57"]]);ce.name="rc-calendar";const en="RcCalendar";function we(t){return t.component(ce.name,ce),t.component(en,ce),t}const tn={class:"rc-search-area"},nn={class:"rc-search-area__bar"},an=["onClick"],ln={class:"rc-search-area__item-label"},on={class:"rc-search-area__panel-content"},rn={key:1,class:"rc-search-area__input-wrapper"},cn=["placeholder"],sn={key:2,class:"rc-search-area__calendar-wrapper"},un={key:3,class:"rc-search-area__tree-container"},dn={class:"rc-search-area__tree-group-title"},fn={class:"rc-search-area__tree-group-options"},mn=["onClick"],vn={class:"rc-search-area__option-label"},pn={key:4,class:"rc-search-area__tree-container"},yn={class:"rc-search-area__tree-group-title"},hn={class:"rc-search-area__tree-group-options"},kn=["onClick"],gn={class:"rc-search-area__option-label"},_n={key:5,class:"rc-search-area__options-grid"},Bn=["onClick"],Cn={class:"rc-search-area__option-label"},bn={key:6,class:"rc-search-area__options-grid"},Vn=["onClick"],Sn={class:"rc-search-area__option-label"},$n={key:7,class:"rc-search-area__empty"},En={key:0,class:"rc-search-area__panel-footer"},Dn=e.defineComponent({name:"rc-search-area",__name:"index",props:{items:{default:()=>[]},modelValue:{default:()=>({})},showMask:{type:Boolean,default:!0},autoConfirm:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{expose:r,emit:d}){const o=t,p=d,g=e.ref(null),m=e.ref(null),v=e.ref(null),i=e.ref({top:"0px"}),y=async()=>{if(g.value===null||!m.value)return;await e.nextTick();const l=m.value.getBoundingClientRect().top;i.value={top:`${l}px`}},$=n=>{if(g.value===null||!m.value)return;const l=n.target;if(m.value.contains(l))return;const c=m.value.closest(".rc-search-area");if(c){const a=c.querySelector(".rc-search-area__bar");if(a&&a.contains(l))return}z()};e.watch(g,async n=>{n!==null?(await e.nextTick(),y(),window.addEventListener("resize",y),window.addEventListener("scroll",y,!0),document.addEventListener("click",$,!0)):(window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0),document.removeEventListener("click",$,!0))}),e.onUnmounted(()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0),document.removeEventListener("click",$,!0)});const _=e.ref({}),h=e.ref(""),b=e.ref(null),S=e.ref({}),B=e.ref({...o.modelValue});e.watch(()=>o.modelValue,n=>{B.value={...n||{}}},{deep:!0,immediate:!0});const s=e.computed(()=>g.value===null?null:o.items[g.value]),J=e.computed(()=>{if(!s.value)return"";const n=Ce(s.value);return n>0?`(${n}项)`:""}),ee=n=>{const l=B.value[n.key];if(l==null||l===""||n.slot)return n.label;if(n.type==="input"){if(l&&String(l).trim())return`${n.label}: ${l}`}else if(n.type==="calendar"){if(l){if(Array.isArray(l)&&l.length===2)return`${n.label}: ${l[0]} ~ ${l[1]}`;if(typeof l=="string")return`${n.label}: ${l}`}}else if(n.type==="single"||n.type==="tree-single"){const c=P(n,l);if(c)return`${n.label}: ${G(c,n)}`}else{const c=Array.isArray(l)?l:[l];if(c.length>0){const a=c.map(u=>{const f=P(n,u);return f?G(f,n):null}).filter(u=>u!==null);if(a.length>0)return`${n.label}: ${a.join("、")}`}}return n.label},Q=n=>{const l=o.items[n];if(!l)return;if(g.value===n){g.value=null;return}const c=B.value[l.key];l.slot?c!=null?Array.isArray(c)?S.value[l.key]=[...c]:typeof c=="object"?S.value[l.key]={...c}:S.value[l.key]=c:S.value[l.key]=void 0:l.type==="input"?h.value=c!=null?String(c):"":l.type==="calendar"?b.value=c??null:l.type==="single"||l.type==="tree-single"?_.value[l.key]=c!==void 0?c:null:_.value[l.key]=c!==void 0?Array.isArray(c)?[...c]:[c]:[],g.value=n},z=()=>{g.value=null},w=(n,l)=>{if(!l)return typeof n=="string"?n:n.label||String(n.value);const c=n;if(l.renderItem){if(typeof l.renderItem=="string")return String(typeof c=="object"&&c!==null?c[l.renderItem]??"":c);{const a=l.renderItem(c);return a!=null?String(a):""}}return typeof n=="string"?n:n.label||String(n.value)},I=(n,l)=>{if(!l)return typeof n=="string"?n:n.value!==void 0?n.value:n;const c=n;return l.format?typeof l.format=="string"?typeof c=="object"&&c!==null?c[l.format]:c:l.format(c):typeof n=="string"?n:n.value!==void 0?n.value:n},G=(n,l)=>{const c=n,a=l.renderResult||l.renderItem;if(a){if(typeof a=="string")return String(typeof c=="object"&&c!==null?c[a]??"":c);{const u=a(c);return u!=null?String(u):""}}return w(n,l)},P=(n,l,c)=>{const a=c||n.options,u=n.childrenKey||"children";for(const f of a){const V=I(f,n);if(V===l||String(V)===String(l))return f;if(typeof f=="object"&&f!==null){const D=f[u];if(Array.isArray(D)&&D.length>0){const W=P(n,l,D);if(W)return W}}}return null},U=(n,l)=>{const c=l||n.options,a=n.childrenKey||"children",u=[];for(const f of c)if(u.push(f),typeof f=="object"&&f!==null){const V=f[a];Array.isArray(V)&&V.length>0&&u.push(...U(n,V))}return u},M=n=>{if(!s.value)return!1;const l=s.value.key,c=_.value[l],a=I(n,s.value);return s.value.type==="single"||s.value.type==="tree-single"?c!=null&&c===a:(Array.isArray(c)?c:[]).some(f=>f===a||String(f)===String(a))},x=n=>n?n.childrenKey?U(n):n.options:[],k=n=>{if(!n)return[];const l=n.childrenKey||"children";return(n.options||[]).filter(c=>{if(typeof c=="string")return!1;const a=c[l];return Array.isArray(a)&&a.length>0})},C=(n,l)=>{if(!l||typeof n=="string")return[];const c=l.childrenKey||"children",a=n[c];return Array.isArray(a)?a:[]},E=n=>{if(n)return S.value[n.key]!==void 0?S.value[n.key]:B.value[n.key]},A=(n,l)=>{if(n&&(S.value[n.key]=l,o.autoConfirm)){const c=n.key;B.value[c]=l,p("update:modelValue",{...B.value}),p("change",{...B.value},n),z()}},O=n=>{if(!s.value)return;const l=s.value.key,c=I(n,s.value);B.value[l];let a;_.value[l]===c?a=void 0:a=c,B.value[l]=a,p("update:modelValue",{...B.value}),p("change",{...B.value},s.value),z()},me=n=>{if(!s.value)return;const l=s.value.key,c=I(n,s.value),a=Array.isArray(_.value[l])?[..._.value[l]]:[],u=a.findIndex(f=>f===c||String(f)===String(c));if(u>=0?a.splice(u,1):a.push(c),_.value[l]=a,o.autoConfirm){const f=a.length>0?a:void 0;B.value[l]=f,p("update:modelValue",{...B.value}),p("change",{...B.value},s.value),z()}},ke=()=>{if(!s.value)return;const n=s.value.key;s.value.slot?S.value[n]=void 0:s.value.type==="input"?h.value="":s.value.type==="calendar"?b.value=null:s.value.type==="single"||s.value.type==="tree-single"?_.value[n]=null:_.value[n]=[]},ge=()=>{if(o.autoConfirm&&s.value){const n=s.value.key,l=h.value.trim()||void 0;B.value[n]=l,p("update:modelValue",{...B.value}),p("change",{...B.value},s.value),z()}},_e=n=>{if(b.value=n,o.autoConfirm&&s.value){const l=s.value.key,c=n??void 0;B.value[l]=c,p("update:modelValue",{...B.value}),p("change",{...B.value},s.value),z()}},Be=()=>{if(!s.value)return;const n=s.value.key;B.value[n];let l;if(s.value.slot)l=S.value[n],B.value[n]=l;else if(s.value.type==="input")l=h.value.trim()||void 0,B.value[n]=l;else if(s.value.type==="calendar")l=b.value!==null&&b.value!==void 0?b.value:void 0,B.value[n]=l;else if(s.value.type==="single"||s.value.type==="tree-single"){const c=_.value[n];l=c??void 0,B.value[n]=l}else{const c=_.value[n];l=Array.isArray(c)&&c.length>0?c:void 0,B.value[n]=l}p("update:modelValue",{...B.value}),p("change",{...B.value},s.value),z()},ve=n=>{const l=B.value[n.key];return l==null||l===""?0:n.slot?1:n.type==="input"?String(l).trim()?1:0:n.type==="single"||n.type==="tree-single"?1:Array.isArray(l)?l.length:l?1:0},Ce=n=>{if(n.slot){const c=S.value[n.key];return c!=null&&c!==""?1:0}else{if(n.type==="input")return h.value.trim()?1:0;if(n.type==="calendar")return b.value!==null&&b.value!==void 0?1:0}const l=_.value[n.key];return l==null||l===""?0:n.type==="single"||n.type==="tree-single"?1:Array.isArray(l)?l.length:0};return r({getValues:()=>({...B.value}),reset:()=>{B.value={},_.value={},S.value={},p("update:modelValue",{})}}),(n,l)=>(e.openBlock(),e.createElementBlock("div",tn,[e.createElementVNode("div",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,(c,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:e.normalizeClass(["rc-search-area__item",{"is-active":g.value===a,"has-value":ve(c)>0}]),onClick:u=>Q(a)},[e.createElementVNode("span",ln,e.toDisplayString(ee(c)),1),e.createVNode(e.unref(L),{name:"icon_a-xiala2",color:g.value!==a&&ve(c)>0?"#1677ff":"#969799",class:e.normalizeClass(["rc-search-area__item-arrow",{"is-up":g.value===a}])},null,8,["color","class"])],10,an))),128))]),e.createVNode(e.Transition,{name:"rc-search-area-fade"},{default:e.withCtx(()=>[g.value!==null&&o.showMask?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"maskRef",ref:v,class:"rc-search-area__mask",style:e.normalizeStyle(i.value),onClick:z},null,4)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"rc-search-area-slide"},{default:e.withCtx(()=>{var c,a,u,f,V,D,W,j,se,pe,R,ue,T,F,Fe,ze,Ae,Le;return[g.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"panelRef",ref:m,class:"rc-search-area__panel"},[e.createElementVNode("div",on,[(c=s.value)!=null&&c.slot&&n.$slots[s.value.key]?e.renderSlot(n.$slots,s.value.key,{key:0,value:E(s.value),"update:value":N=>A(s.value,N)},void 0,!0):((a=s.value)==null?void 0:a.type)==="input"?(e.openBlock(),e.createElementBlock("div",rn,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=N=>h.value=N),type:"text",class:"rc-search-area__input",placeholder:s.value.placeholder||"请输入",onInput:ge},null,40,cn),[[e.vModelText,h.value]])])):((u=s.value)==null?void 0:u.type)==="calendar"?(e.openBlock(),e.createElementBlock("div",sn,[e.createVNode(e.unref(ce),{modelValue:b.value,"onUpdate:modelValue":l[1]||(l[1]=N=>b.value=N),range:((f=s.value.calendarConfig)==null?void 0:f.range)||!1,mode:"default","min-date":(V=s.value.calendarConfig)==null?void 0:V.minDate,"max-date":(D=s.value.calendarConfig)==null?void 0:D.maxDate,"disabled-date":(W=s.value.calendarConfig)==null?void 0:W.disabledDate,formatter:(j=s.value.calendarConfig)==null?void 0:j.formatter,onChange:_e},null,8,["modelValue","range","min-date","max-date","disabled-date","formatter"])])):((se=s.value)==null?void 0:se.type)==="tree-single"?(e.openBlock(),e.createElementBlock("div",un,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(s.value),(N,te)=>(e.openBlock(),e.createElementBlock("div",{key:te,class:"rc-search-area__tree-group"},[e.createElementVNode("div",dn,e.toDisplayString(w(N,s.value||void 0)),1),e.createElementVNode("div",fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(N,s.value),(K,be)=>(e.openBlock(),e.createElementBlock("div",{key:be,class:e.normalizeClass(["rc-search-area__option",{"is-selected":M(K)}]),onClick:Ke=>O(K)},[e.createElementVNode("span",vn,e.toDisplayString(w(K,s.value||void 0)),1),M(K)?(e.openBlock(),e.createBlock(e.unref(L),{key:0,name:"icon_check",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,mn))),128))])]))),128))])):((pe=s.value)==null?void 0:pe.type)==="tree-multiple"?(e.openBlock(),e.createElementBlock("div",pn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(s.value),(N,te)=>(e.openBlock(),e.createElementBlock("div",{key:te,class:"rc-search-area__tree-group"},[e.createElementVNode("div",yn,e.toDisplayString(w(N,s.value||void 0)),1),e.createElementVNode("div",hn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(N,s.value),(K,be)=>(e.openBlock(),e.createElementBlock("div",{key:be,class:e.normalizeClass(["rc-search-area__option",{"is-selected":M(K)}]),onClick:Ke=>me(K)},[e.createElementVNode("span",gn,e.toDisplayString(w(K,s.value||void 0)),1),M(K)?(e.openBlock(),e.createBlock(e.unref(L),{key:0,name:"icon_check",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,kn))),128))])]))),128))])):((R=s.value)==null?void 0:R.type)==="single"?(e.openBlock(),e.createElementBlock("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x(s.value),(N,te)=>(e.openBlock(),e.createElementBlock("div",{key:te,class:e.normalizeClass(["rc-search-area__option",{"is-selected":M(N)}]),onClick:K=>O(N)},[e.createElementVNode("span",Cn,e.toDisplayString(w(N,s.value||void 0)),1),M(N)?(e.openBlock(),e.createBlock(e.unref(L),{key:0,name:"icon_check",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,Bn))),128))])):(e.openBlock(),e.createElementBlock("div",bn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x(s.value),(N,te)=>(e.openBlock(),e.createElementBlock("div",{key:te,class:e.normalizeClass(["rc-search-area__option",{"is-selected":M(N)}]),onClick:K=>me(N)},[e.createElementVNode("span",Sn,e.toDisplayString(w(N,s.value||void 0)),1),M(N)?(e.openBlock(),e.createBlock(e.unref(L),{key:0,name:"icon_check",class:"rc-search-area__option-check"})):e.createCommentVNode("",!0)],10,Vn))),128))])),((ue=s.value)==null?void 0:ue.type)!=="input"&&((T=s.value)==null?void 0:T.type)!=="calendar"&&!((F=s.value)!=null&&F.slot)&&((ze=(Fe=s.value)==null?void 0:Fe.options)==null?void 0:ze.length)===0?(e.openBlock(),e.createElementBlock("div",$n,[...l[2]||(l[2]=[e.createElementVNode("p",null,"暂无选项",-1)])])):e.createCommentVNode("",!0)]),!o.autoConfirm&&((Ae=s.value)==null?void 0:Ae.type)!=="single"&&((Le=s.value)==null?void 0:Le.type)!=="tree-single"?(e.openBlock(),e.createElementBlock("div",En,[e.createVNode(e.unref(q),{block:"",onClick:ke},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode(" 重置 ",-1)])]),_:1}),e.createVNode(e.unref(q),{type:"primary",block:"",onClick:Be},{default:e.withCtx(()=>[e.createTextVNode(" 确定"+e.toDisplayString(J.value),1)]),_:1})])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]}),_:3})]))}}),Ie=H(Dn,[["__scopeId","data-v-d6546197"]]),Me=t=>{t.component("RcSearchArea",Ie),t.component("rc-search-area",Ie)},he=Symbol("RECYCLE_UI_CONFIG"),Re={prefix:"rc",autoRegister:!0,provideKey:he,theme:{},iconCssUrl:"//at.alicdn.com/t/c/font_4252799_o59odx6bqil.css",iconClass:"iconfont"};function xn(t,r){r.autoRegister!==!1&&(typeof Se=="function"&&Se(t),typeof $e=="function"&&$e(t),typeof Ee=="function"&&Ee(t),typeof Pe=="function"&&Pe(t),typeof xe=="function"&&xe(t),typeof De=="function"&&De(t),typeof Me=="function"&&Me(t),typeof we=="function"&&we(t),typeof Ne=="function"&&Ne(t))}const Te=(t,r)=>{const d={...Re,...r||{}};if(t.provide(d.provideKey??he,d),t.config.globalProperties.$recycleUI=d,typeof window<"u"&&d.iconCssUrl){const o=`link[rel="stylesheet"][data-rcui-icon="true"][href="${d.iconCssUrl}"]`;if(!document.head.querySelector(o)){const g=document.createElement("link");g.rel="stylesheet",g.href=d.iconCssUrl,g.setAttribute("data-rcui-icon","true"),document.head.appendChild(g)}}return xn(t,d),t},Nn={install:Te};function wn(t){return{install(r){Te(r,t)}}}exports.RECYCLE_UI_SYMBOL=he;exports.RcButton=q;exports.RcCalendar=ce;exports.RcCard=de;exports.RcDescriptions=We;exports.RcDescriptionsItem=Oe;exports.RcIcon=L;exports.RcPopup=re;exports.RcSearchArea=Ie;exports.RcToast=fe;exports.createRecycleUI=wn;exports.default=Nn;exports.defaultRecycleUIConfig=Re;exports.hideToast=je;exports.install=Te;exports.installButton=Se;exports.installCalendar=we;exports.installCard=Ee;exports.installDescriptions=$e;exports.installIcon=xe;exports.installMessage=De;exports.installPopup=Ne;exports.installSearchArea=Me;exports.message=Ge;exports.rcDescriptions=We;exports.rcDescriptionsItem=Oe;exports.showToast=_t;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|