@aplus-frontend/ui 0.1.26 → 0.1.28
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/es/src/ap-download/ap-download.vue.d.ts +12 -4
- package/es/src/ap-download/ap-download.vue.mjs +72 -37
- package/es/src/ap-download/interface.d.ts +5 -12
- package/es/src/ap-download/style/ap-download.css +6 -0
- package/es/src/ap-field/select/index.vue.mjs +65 -63
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +89 -66
- package/es/src/business/ap-attachment/interface.d.ts +1 -1
- package/es/src/business/ap-attachment/style.css +6 -0
- package/es/src/business/ap-input-radio/interface.d.ts +1 -1
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/business/index.d.ts +1 -3
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +6 -0
- package/es/src/theme/ap-download/ap-download.css +6 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +12 -4
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +5 -12
- package/lib/src/ap-download/style/ap-download.css +6 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/interface.d.ts +1 -1
- package/lib/src/business/ap-attachment/style.css +6 -0
- package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/business/index.d.ts +1 -3
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +6 -0
- package/lib/src/theme/ap-download/ap-download.css +6 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApDownLoadProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { ButtonType } from 'ant-design-vue/es/button';
|
|
3
4
|
declare function __VLS_template(): {
|
|
4
5
|
slots: {
|
|
5
6
|
icon?(_: {}): any;
|
|
@@ -8,14 +9,21 @@ declare function __VLS_template(): {
|
|
|
8
9
|
attrs: Partial<{}>;
|
|
9
10
|
};
|
|
10
11
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
-
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps
|
|
12
|
+
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
|
|
13
|
+
type: string;
|
|
12
14
|
size: string;
|
|
13
15
|
disabled: boolean;
|
|
14
|
-
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
+
downloadCallback: (...args: any[]) => void;
|
|
18
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
|
|
19
|
+
type: string;
|
|
15
20
|
size: string;
|
|
16
21
|
disabled: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
22
|
+
}>>> & {
|
|
23
|
+
onDownloadCallback?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
size: "small" | "large" | "middle";
|
|
26
|
+
type: ButtonType;
|
|
19
27
|
disabled: boolean;
|
|
20
28
|
}, {}>;
|
|
21
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,56 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, ref as N, useSlots as O, computed as t, unref as s, openBlock as l, createBlock as F, mergeProps as x, withCtx as A, createElementVNode as r, normalizeClass as S, createElementBlock as c, createVNode as I, createCommentVNode as d, renderSlot as L, toDisplayString as M } from "vue";
|
|
2
|
+
import { Button as U } from "ant-design-vue";
|
|
3
|
+
import { LoadingOutlined as V } from "@ant-design/icons-vue";
|
|
2
4
|
import "../config-provider/index.mjs";
|
|
3
|
-
import { useOssInit as
|
|
5
|
+
import { useOssInit as j } from "./hooks/index.mjs";
|
|
4
6
|
import "./style/ap-download.css";
|
|
5
|
-
import { getFileInfo as
|
|
6
|
-
import { useStyle as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useGlobalConfig as
|
|
9
|
-
const
|
|
7
|
+
import { getFileInfo as D } from "./utils/getFileInfo.mjs";
|
|
8
|
+
import { useStyle as E } from "./hooks/useStyle.mjs";
|
|
9
|
+
import { useLocale as G } from "../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as p } from "../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const P = {
|
|
10
12
|
key: 0,
|
|
13
|
+
class: "spin"
|
|
14
|
+
}, R = {
|
|
15
|
+
key: 1,
|
|
11
16
|
class: "icon"
|
|
12
|
-
},
|
|
17
|
+
}, T = { class: "text" }, ee = /* @__PURE__ */ z({
|
|
13
18
|
name: "ApDownload",
|
|
14
19
|
__name: "ap-download",
|
|
15
20
|
props: {
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
prefixCls: {},
|
|
22
|
+
type: { default: "link" },
|
|
23
|
+
htmlType: {},
|
|
24
|
+
shape: {},
|
|
18
25
|
size: { default: "middle" },
|
|
26
|
+
loading: { type: [Boolean, Object] },
|
|
19
27
|
disabled: { type: Boolean, default: !1 },
|
|
28
|
+
ghost: { type: Boolean },
|
|
29
|
+
block: { type: Boolean },
|
|
30
|
+
danger: { type: Boolean },
|
|
31
|
+
icon: {},
|
|
32
|
+
href: {},
|
|
33
|
+
target: {},
|
|
34
|
+
title: {},
|
|
35
|
+
onClick: {},
|
|
36
|
+
onMousedown: {},
|
|
37
|
+
text: {},
|
|
38
|
+
color: {},
|
|
20
39
|
fileName: {},
|
|
21
40
|
needName: { type: [Boolean, Object] },
|
|
22
41
|
getOssAccess: {}
|
|
23
42
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_,
|
|
28
|
-
g
|
|
29
|
-
), N = s(() => {
|
|
43
|
+
emits: ["downloadCallback"],
|
|
44
|
+
setup(m, { emit: u }) {
|
|
45
|
+
const f = u, n = N(!1), { lang: g } = G(), y = O(), C = t(() => g.value === "zh-cn" ? "zh_CN" : "en_US"), _ = p("uiMode"), e = m, b = p("apUpload"), a = t(() => e.disabled), h = t(() => e.color ? e.color : _.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: w } = E(h, k, a), B = t(() => {
|
|
30
46
|
var o;
|
|
31
|
-
return e.getOssAccess || ((o =
|
|
32
|
-
}),
|
|
33
|
-
e.disabled
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
return e.getOssAccess || ((o = b.value) == null ? void 0 : o.getOssAccess);
|
|
48
|
+
}), v = async () => {
|
|
49
|
+
if (!e.disabled) {
|
|
50
|
+
n.value = !0;
|
|
51
|
+
try {
|
|
52
|
+
const i = await (await j(
|
|
53
|
+
B.value,
|
|
54
|
+
s(C)
|
|
55
|
+
)).downloadFile(
|
|
56
|
+
D(e.needName, e.fileName)
|
|
57
|
+
);
|
|
58
|
+
f("downloadCallback", i);
|
|
59
|
+
} catch (o) {
|
|
60
|
+
console.error(o);
|
|
61
|
+
} finally {
|
|
62
|
+
n.value = !1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
37
65
|
};
|
|
38
|
-
return (o,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
return (o, i) => (l(), F(s(U), x(e, {
|
|
67
|
+
type: e.type,
|
|
68
|
+
size: e.size,
|
|
69
|
+
disabled: a.value,
|
|
70
|
+
onClick: v
|
|
71
|
+
}), {
|
|
72
|
+
default: A(() => [
|
|
73
|
+
r("div", {
|
|
74
|
+
class: S(s(w))
|
|
75
|
+
}, [
|
|
76
|
+
n.value ? (l(), c("span", P, [
|
|
77
|
+
I(s(V), { spin: !0 })
|
|
78
|
+
])) : d("", !0),
|
|
79
|
+
s(y).icon ? (l(), c("span", R, [
|
|
80
|
+
L(o.$slots, "icon")
|
|
81
|
+
])) : d("", !0),
|
|
82
|
+
r("span", T, M(o.text), 1)
|
|
83
|
+
], 2)
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
}, 16, ["type", "size", "disabled"]));
|
|
52
87
|
}
|
|
53
88
|
});
|
|
54
89
|
export {
|
|
55
|
-
|
|
90
|
+
ee as default
|
|
56
91
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { accessCreate } from '@aplus-frontend/oss';
|
|
1
|
+
import { accessCreate, client } from '@aplus-frontend/oss';
|
|
2
|
+
import { ButtonProps } from 'ant-design-vue/es/button';
|
|
2
3
|
/**
|
|
3
4
|
* 类型转换为单例和数组
|
|
4
5
|
*/
|
|
5
6
|
type TypeToSingleAndArray<Type = any> = Type extends any ? Type | Type[] : never;
|
|
6
|
-
export
|
|
7
|
+
export type ApDownLoadProps<FileNameType extends Record<string, string> = Record<string, string>> = ButtonProps & {
|
|
7
8
|
/**
|
|
8
9
|
* 标签内容
|
|
9
10
|
*/
|
|
@@ -12,15 +13,6 @@ export interface ApDownLoadProps<FileNameType extends Record<string, string> = R
|
|
|
12
13
|
* 标签颜色
|
|
13
14
|
*/
|
|
14
15
|
color?: string;
|
|
15
|
-
/**
|
|
16
|
-
* 标签大小
|
|
17
|
-
*/
|
|
18
|
-
size?: 'small' | 'middle' | 'large';
|
|
19
|
-
/**
|
|
20
|
-
* 是否禁用
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
disabled?: boolean;
|
|
24
16
|
fileName: TypeToSingleAndArray<string | FileNameType>;
|
|
25
17
|
/**
|
|
26
18
|
* 是否需要fileName别名
|
|
@@ -30,7 +22,7 @@ export interface ApDownLoadProps<FileNameType extends Record<string, string> = R
|
|
|
30
22
|
*/
|
|
31
23
|
needName?: ApDownLoadNeedNameModel;
|
|
32
24
|
getOssAccess?: () => Promise<accessCreate>;
|
|
33
|
-
}
|
|
25
|
+
};
|
|
34
26
|
/**
|
|
35
27
|
* 别名配置项
|
|
36
28
|
*/
|
|
@@ -45,4 +37,5 @@ export declare enum ApDownLoadNeedNameKeyDefault {
|
|
|
45
37
|
nameKey = "name",
|
|
46
38
|
pathKey = "path"
|
|
47
39
|
}
|
|
40
|
+
export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
|
|
48
41
|
export {};
|
|
@@ -9,11 +9,17 @@
|
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
}
|
|
12
|
+
.aplus-ap-download-inner-wrapper .spin {
|
|
13
|
+
margin-right: 5px;
|
|
14
|
+
}
|
|
12
15
|
.aplus-ap-download-inner-wrapper .icon {
|
|
13
16
|
position: relative;
|
|
14
17
|
font-size: 18px;
|
|
15
18
|
margin-right: 5px;
|
|
16
19
|
}
|
|
20
|
+
.aplus-ap-download-inner-wrapper .text {
|
|
21
|
+
color: var(--download-main-color);
|
|
22
|
+
}
|
|
17
23
|
.aplus-ap-download-inner-wrapper:hover {
|
|
18
24
|
color: var(--download-main-color-opacity);
|
|
19
25
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { Select as
|
|
1
|
+
import { defineComponent as T, ref as p, onMounted as _, computed as y, unref as u, openBlock as w, createElementBlock as R, toDisplayString as z, createBlock as D, mergeProps as U, createSlots as L, renderList as K, withCtx as S, renderSlot as H, normalizeProps as $, guardReactiveProps as j, createVNode as E } from "vue";
|
|
2
|
+
import { debounce as W, isFunction as g, isArray as G, isNil as J, omit as Q } from "lodash-unified";
|
|
3
|
+
import { Select as X, Spin as Y } from "ant-design-vue";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { omitUndefined as
|
|
6
|
-
import { useDefaultPlaceholder as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
const
|
|
5
|
+
import { omitUndefined as Z } from "../../utils/index.mjs";
|
|
6
|
+
import { useDefaultPlaceholder as ee } from "../hooks/use-default-placeholder.mjs";
|
|
7
|
+
import { useControllableValue as oe } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
const te = { key: 0 }, se = /* @__PURE__ */ T({
|
|
9
9
|
name: "ApFieldSelect",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -93,27 +93,27 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
93
93
|
lazy: { type: Boolean, default: !1 }
|
|
94
94
|
},
|
|
95
95
|
emits: ["update:value"],
|
|
96
|
-
setup(
|
|
96
|
+
setup(B, { expose: F, emit: b }) {
|
|
97
97
|
let n = 0;
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
98
|
+
const C = W((o) => {
|
|
99
|
+
if (!g(e.request))
|
|
100
100
|
return;
|
|
101
101
|
n += 1;
|
|
102
102
|
const t = n;
|
|
103
|
-
i.value = [],
|
|
103
|
+
i.value = [], r.value = !0, e.request(o).then((l) => {
|
|
104
104
|
n === t && (i.value = l);
|
|
105
105
|
}).finally(() => {
|
|
106
|
-
|
|
106
|
+
r.value = !1;
|
|
107
107
|
});
|
|
108
|
-
}, 300), e =
|
|
109
|
-
var
|
|
110
|
-
const l = ((
|
|
108
|
+
}, 300), e = B, N = (o, t) => {
|
|
109
|
+
var a;
|
|
110
|
+
const l = ((a = e.fieldNames) == null ? void 0 : a.label) || "label";
|
|
111
111
|
return typeof (t == null ? void 0 : t[l]) == "string" && t[l].indexOf(o) > -1;
|
|
112
|
-
}, i =
|
|
113
|
-
async function
|
|
114
|
-
if (!
|
|
112
|
+
}, i = p((e == null ? void 0 : e.options) || []), s = p(), r = p((e == null ? void 0 : e.loading) || !1), x = b;
|
|
113
|
+
async function c(o = !0) {
|
|
114
|
+
if (!g(e.request))
|
|
115
115
|
return;
|
|
116
|
-
|
|
116
|
+
r.value = !0, n += 1;
|
|
117
117
|
const t = n;
|
|
118
118
|
try {
|
|
119
119
|
o && (i.value = []);
|
|
@@ -122,47 +122,49 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
122
122
|
return;
|
|
123
123
|
i.value = l;
|
|
124
124
|
} finally {
|
|
125
|
-
|
|
125
|
+
r.value = !1;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function I(o) {
|
|
129
129
|
var t;
|
|
130
|
-
(t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !
|
|
130
|
+
(t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !r.value && c(!0);
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
_(() => {
|
|
133
133
|
if (e.lazy) {
|
|
134
134
|
n += 1;
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
c();
|
|
138
138
|
});
|
|
139
|
-
const { value:
|
|
140
|
-
|
|
139
|
+
const { value: m, updateValue: O } = oe(e, x), P = ee("Select", e), V = y(() => {
|
|
140
|
+
var d, v;
|
|
141
|
+
const o = u(m);
|
|
141
142
|
if (!o)
|
|
142
143
|
return e.emptyText;
|
|
143
|
-
|
|
144
|
+
const t = ((d = e.fieldNames) == null ? void 0 : d.label) || "label", l = ((v = e.fieldNames) == null ? void 0 : v.value) || "value";
|
|
145
|
+
if (G(o))
|
|
144
146
|
return o.map(
|
|
145
|
-
(
|
|
146
|
-
var
|
|
147
|
-
return (
|
|
147
|
+
(f) => {
|
|
148
|
+
var h;
|
|
149
|
+
return (h = u(i).find((M) => M[l] === f)) == null ? void 0 : h[t];
|
|
148
150
|
}
|
|
149
151
|
).filter(Boolean).join("、") || e.emptyText;
|
|
150
|
-
const
|
|
151
|
-
return (
|
|
152
|
-
}),
|
|
152
|
+
const a = u(i).find((f) => f.value === o);
|
|
153
|
+
return (a == null ? void 0 : a.label) || e.emptyText;
|
|
154
|
+
}), k = y(() => {
|
|
153
155
|
const o = !!(e != null && e.showSearch), t = e.searchMode;
|
|
154
156
|
let l = {};
|
|
155
157
|
return o && (l = t === "request" ? {
|
|
156
158
|
showArrow: !1,
|
|
157
159
|
defaultActiveFirstOption: !1,
|
|
158
|
-
onSearch:
|
|
159
|
-
notFoundContent:
|
|
160
|
+
onSearch: C,
|
|
161
|
+
notFoundContent: r.value ? void 0 : null
|
|
160
162
|
} : {
|
|
161
163
|
showArrow: !0,
|
|
162
|
-
filterOption:
|
|
164
|
+
filterOption: J(e == null ? void 0 : e.filterOption) ? N : e == null ? void 0 : e.filterOption
|
|
163
165
|
}), {
|
|
164
|
-
...
|
|
165
|
-
|
|
166
|
+
...Z(
|
|
167
|
+
Q(e, [
|
|
166
168
|
"mode",
|
|
167
169
|
"value",
|
|
168
170
|
"onUpdate:value",
|
|
@@ -172,45 +174,45 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
172
174
|
"onFocus"
|
|
173
175
|
])
|
|
174
176
|
),
|
|
175
|
-
placeholder: u(
|
|
177
|
+
placeholder: u(P),
|
|
176
178
|
...l
|
|
177
179
|
};
|
|
178
180
|
});
|
|
179
|
-
function
|
|
181
|
+
function q() {
|
|
180
182
|
var o;
|
|
181
|
-
(o =
|
|
183
|
+
(o = s.value) == null || o.focus();
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function A() {
|
|
184
186
|
var o;
|
|
185
|
-
(o =
|
|
187
|
+
(o = s.value) == null || o.blur();
|
|
186
188
|
}
|
|
187
|
-
return
|
|
188
|
-
focus:
|
|
189
|
-
blur:
|
|
190
|
-
request:
|
|
191
|
-
}), (o, t) => o.mode === "read" ? (
|
|
189
|
+
return F({
|
|
190
|
+
focus: q,
|
|
191
|
+
blur: A,
|
|
192
|
+
request: c
|
|
193
|
+
}), (o, t) => o.mode === "read" ? (w(), R("span", te, z(V.value), 1)) : (w(), D(u(X), U({
|
|
192
194
|
key: 1,
|
|
193
195
|
"allow-clear": "",
|
|
194
196
|
ref_key: "selectRef",
|
|
195
|
-
ref:
|
|
196
|
-
},
|
|
197
|
+
ref: s
|
|
198
|
+
}, k.value, {
|
|
197
199
|
mode: o.multiple ? "multiple" : void 0,
|
|
198
|
-
value: u(
|
|
199
|
-
"onUpdate:value": u(
|
|
200
|
+
value: u(m),
|
|
201
|
+
"onUpdate:value": u(O),
|
|
200
202
|
options: i.value,
|
|
201
|
-
loading:
|
|
202
|
-
onFocus:
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
name:
|
|
206
|
-
fn:
|
|
207
|
-
|
|
203
|
+
loading: r.value,
|
|
204
|
+
onFocus: I
|
|
205
|
+
}), L({ _: 2 }, [
|
|
206
|
+
K(o.$slots, (l, a) => ({
|
|
207
|
+
name: a,
|
|
208
|
+
fn: S((d) => [
|
|
209
|
+
H(o.$slots, a, $(j(d || {})))
|
|
208
210
|
])
|
|
209
211
|
})),
|
|
210
|
-
|
|
212
|
+
r.value ? {
|
|
211
213
|
name: "notFoundContent",
|
|
212
|
-
fn:
|
|
213
|
-
|
|
214
|
+
fn: S(() => [
|
|
215
|
+
E(u(Y), { size: "small" })
|
|
214
216
|
]),
|
|
215
217
|
key: "0"
|
|
216
218
|
} : void 0
|
|
@@ -218,5 +220,5 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
218
220
|
}
|
|
219
221
|
});
|
|
220
222
|
export {
|
|
221
|
-
|
|
223
|
+
se as default
|
|
222
224
|
};
|