@aplus-frontend/ui 7.15.8 → 7.17.0
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/index.mjs +285 -281
- package/es/src/ag-grid/components/header-cell/index.vue2.mjs +56 -41
- package/es/src/ag-grid/context.d.ts +8 -0
- package/es/src/ag-grid/context.mjs +18 -7
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
- package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
- package/es/src/ag-grid/index.vue.mjs +270 -255
- package/es/src/ag-grid/interface.d.ts +20 -1
- package/es/src/ag-grid/style/custom-header.mjs +22 -13
- package/es/src/ap-field/cascader/index.vue.d.ts +60 -0
- package/es/src/ap-field/cascader/index.vue.mjs +217 -0
- package/es/src/ap-field/cascader/index.vue2.mjs +4 -0
- package/es/src/ap-field/cascader/read.vue.d.ts +8 -0
- package/es/src/ap-field/cascader/read.vue.mjs +4 -0
- package/es/src/ap-field/cascader/read.vue2.mjs +159 -0
- package/es/src/ap-field/cascader/use-options.d.ts +25 -0
- package/es/src/ap-field/cascader/use-options.mjs +66 -0
- package/es/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
- package/es/src/ap-field/hooks/use-default-placeholder.mjs +13 -8
- package/es/src/ap-field/index.d.ts +8 -2
- package/es/src/ap-field/index.mjs +72 -65
- package/es/src/ap-field/interface.d.ts +27 -1
- package/es/src/ap-field/tree-select/index.vue.mjs +43 -39
- package/es/src/ap-field/tree-select/use-request.mjs +22 -19
- package/es/src/ap-form/items/cascader/index.vue.d.ts +435 -0
- package/es/src/ap-form/items/cascader/index.vue.mjs +102 -0
- package/es/src/ap-form/items/cascader/index.vue2.mjs +4 -0
- package/es/src/ap-form/items/index.d.ts +2 -1
- package/es/src/ap-form/items/index.mjs +3 -2
- package/es/src/ap-form/items/interface.d.ts +6 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
- package/es/src/ap-table/constants.d.ts +269 -4
- package/es/src/ap-table/constants.mjs +29 -26
- package/es/src/ap-table/interface.d.ts +5 -1
- package/es/src/ap-table/style/setting.mjs +30 -27
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +25 -21
- package/es/src/business/ag-grid-modal/style/index.mjs +1 -1
- package/es/src/business/ag-grid-modal/utils.d.ts +1 -0
- package/es/src/index.mjs +250 -246
- package/es/src/locale/lang/en.mjs +1 -0
- package/es/src/locale/lang/zh-cn.mjs +1 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/context.d.ts +8 -0
- package/lib/src/ag-grid/context.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +20 -1
- package/lib/src/ag-grid/style/custom-header.js +1 -1
- package/lib/src/ap-field/cascader/index.vue.d.ts +60 -0
- package/lib/src/ap-field/cascader/index.vue.js +1 -0
- package/lib/src/ap-field/cascader/index.vue2.js +1 -0
- package/lib/src/ap-field/cascader/read.vue.d.ts +8 -0
- package/lib/src/ap-field/cascader/read.vue.js +1 -0
- package/lib/src/ap-field/cascader/read.vue2.js +1 -0
- package/lib/src/ap-field/cascader/use-options.d.ts +25 -0
- package/lib/src/ap-field/cascader/use-options.js +1 -0
- package/lib/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
- package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -1
- package/lib/src/ap-field/index.d.ts +8 -2
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/interface.d.ts +27 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/use-request.js +1 -1
- package/lib/src/ap-form/items/cascader/index.vue.d.ts +435 -0
- package/lib/src/ap-form/items/cascader/index.vue.js +1 -0
- package/lib/src/ap-form/items/cascader/index.vue2.js +1 -0
- package/lib/src/ap-form/items/index.d.ts +2 -1
- package/lib/src/ap-form/items/index.js +1 -1
- package/lib/src/ap-form/items/interface.d.ts +6 -1
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +269 -4
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/interface.d.ts +5 -1
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -1
- package/lib/src/business/ag-grid-modal/style/index.js +1 -1
- package/lib/src/business/ag-grid-modal/utils.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +4 -4
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as o } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
4
|
import { useLocale as n } from "../../config-provider/hooks/use-locale.mjs";
|
|
5
|
-
import { isDef as
|
|
6
|
-
const
|
|
5
|
+
import { isDef as c } from "../../utils/is.mjs";
|
|
6
|
+
const i = [
|
|
7
|
+
"Select",
|
|
8
|
+
"Date",
|
|
9
|
+
"Cascader",
|
|
10
|
+
"TreeSelect"
|
|
11
|
+
], a = [
|
|
7
12
|
"Text",
|
|
8
13
|
"TextArea",
|
|
9
14
|
"Number",
|
|
10
15
|
"TextPassword",
|
|
11
16
|
"Second"
|
|
12
|
-
], m = (t,
|
|
17
|
+
], m = (t, r) => {
|
|
13
18
|
const { t: e } = n();
|
|
14
|
-
return
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
19
|
+
return o(() => {
|
|
20
|
+
if (c(r.placeholder))
|
|
21
|
+
return r.placeholder;
|
|
17
22
|
if (t === "DateRange")
|
|
18
23
|
return [e("ap.field.startDateText"), e("ap.field.endDateText")];
|
|
19
|
-
if (
|
|
24
|
+
if (i.includes(t))
|
|
20
25
|
return e("ap.common.chooseText");
|
|
21
26
|
if (a.includes(t))
|
|
22
27
|
return e("ap.common.inputText");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as ApFieldCascader } from './cascader/index.vue';
|
|
1
2
|
import { default as ApFieldCheckbox } from './checkbox/index.vue';
|
|
2
3
|
import { default as ApFieldDate } from './date/index.vue';
|
|
3
4
|
import { default as ApFieldDateRange } from './date-range/index.vue';
|
|
@@ -13,7 +14,7 @@ import { ApFieldText, ApFieldPassword } from './text';
|
|
|
13
14
|
import { default as ApFieldTextArea } from './text-area/index.vue';
|
|
14
15
|
import { default as ApFieldTreeSelect } from './tree-select/index.vue';
|
|
15
16
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
16
|
-
import { ApFieldTextProps, FieldMode, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldRadioProps, ApFieldCheckboxProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTreeSelectProps, ApFieldTextPasswordProps, ApFieldSecondProps } from './interface';
|
|
17
|
+
import { ApFieldTextProps, FieldMode, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldRadioProps, ApFieldCheckboxProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTreeSelectProps, ApFieldTextPasswordProps, ApFieldSecondProps, ApFieldCascaderProps } from './interface';
|
|
17
18
|
import { LiteralUnion } from '../type';
|
|
18
19
|
import { ApFormatPresetType } from './date/interface';
|
|
19
20
|
import { CheckboxOptionType } from '@aplus-frontend/antdv';
|
|
@@ -32,6 +33,7 @@ export type FieldType = {
|
|
|
32
33
|
Rate: typeof ApFieldRate;
|
|
33
34
|
TreeSelect: typeof ApFieldTreeSelect;
|
|
34
35
|
Second: typeof ApFieldSecond;
|
|
36
|
+
Cascader: typeof ApFieldCascader;
|
|
35
37
|
};
|
|
36
38
|
export declare const ApFieldRead: {
|
|
37
39
|
readonly Text: DefineComponent<ApFieldTextProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ApFieldTextProps> & Readonly<{}>, {
|
|
@@ -132,7 +134,11 @@ export declare const ApFieldRead: {
|
|
|
132
134
|
readonly Second: DefineComponent<ApFieldSecondProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ApFieldSecondProps> & Readonly<{}>, {
|
|
133
135
|
emptyText: string;
|
|
134
136
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
137
|
+
readonly Cascader: DefineComponent<ApFieldCascaderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ApFieldCascaderProps> & Readonly<{}>, {
|
|
138
|
+
mode: FieldMode;
|
|
139
|
+
emptyText: string;
|
|
140
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
135
141
|
};
|
|
136
142
|
export declare const ApField: FieldType;
|
|
137
143
|
export * from './interface';
|
|
138
|
-
export { ApFieldText, ApFieldCheckbox, ApFieldDate, ApFieldNumber, ApFieldRadio, ApFieldSwitch, ApFieldTextArea, ApFieldDateRange, ApFieldSelect, ApFieldPassword, ApFieldSlider, ApFieldSegmented, ApFieldRate, ApFieldTreeSelect, ApFieldSecond };
|
|
144
|
+
export { ApFieldText, ApFieldCheckbox, ApFieldDate, ApFieldNumber, ApFieldRadio, ApFieldSwitch, ApFieldTextArea, ApFieldDateRange, ApFieldSelect, ApFieldPassword, ApFieldSlider, ApFieldSegmented, ApFieldRate, ApFieldTreeSelect, ApFieldSecond, ApFieldCascader };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "./cascader/index.vue2.mjs";
|
|
2
|
+
import "./cascader/read.vue.mjs";
|
|
1
3
|
import "./checkbox/index.vue2.mjs";
|
|
2
4
|
import "./checkbox/read.vue.mjs";
|
|
3
5
|
import "./date/index.vue2.mjs";
|
|
@@ -25,75 +27,80 @@ import "./text-area/read.vue.mjs";
|
|
|
25
27
|
import "./tree-select/index.vue2.mjs";
|
|
26
28
|
import "./tree-select/read.vue.mjs";
|
|
27
29
|
import "./interface.mjs";
|
|
28
|
-
import i from "./
|
|
30
|
+
import i from "./cascader/read.vue2.mjs";
|
|
31
|
+
import r from "./second/read.vue2.mjs";
|
|
29
32
|
import o from "./text/read-password.vue2.mjs";
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import D from "./
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
import t from "./tree-select/read.vue2.mjs";
|
|
34
|
+
import e from "./switch/read.vue2.mjs";
|
|
35
|
+
import p from "./select/read.vue2.mjs";
|
|
36
|
+
import a from "./checkbox/read.vue2.mjs";
|
|
37
|
+
import f from "./radio/read.vue2.mjs";
|
|
38
|
+
import _ from "./date-range/read.vue2.mjs";
|
|
39
|
+
import c from "./date/read.vue2.mjs";
|
|
40
|
+
import s from "./number/read.vue2.mjs";
|
|
41
|
+
import n from "./text-area/read.vue2.mjs";
|
|
42
|
+
import d from "./text/read.vue2.mjs";
|
|
43
|
+
import l from "./cascader/index.vue.mjs";
|
|
44
|
+
import $ from "./second/index.vue.mjs";
|
|
45
|
+
import A from "./tree-select/index.vue.mjs";
|
|
46
|
+
import F from "./rate/index.vue.mjs";
|
|
47
|
+
import S from "./segmented/index.vue.mjs";
|
|
48
|
+
import x from "./slider/index.vue.mjs";
|
|
49
|
+
import R from "./switch/index.vue.mjs";
|
|
50
|
+
import T from "./select/index.vue.mjs";
|
|
51
|
+
import b from "./checkbox/index.vue.mjs";
|
|
52
|
+
import h from "./radio/index.vue.mjs";
|
|
53
|
+
import g from "./date-range/index.vue.mjs";
|
|
54
|
+
import C from "./date/index.vue.mjs";
|
|
55
|
+
import D from "./number/index.vue.mjs";
|
|
56
|
+
import k from "./text-area/index.vue.mjs";
|
|
57
|
+
const Nm = {
|
|
58
|
+
Text: d,
|
|
59
|
+
TextArea: n,
|
|
60
|
+
Number: s,
|
|
61
|
+
Date: c,
|
|
62
|
+
DateRange: _,
|
|
63
|
+
Radio: f,
|
|
64
|
+
Checkbox: a,
|
|
65
|
+
Select: p,
|
|
66
|
+
Switch: e,
|
|
67
|
+
TreeSelect: t,
|
|
64
68
|
Password: o,
|
|
65
|
-
Second:
|
|
66
|
-
|
|
69
|
+
Second: r,
|
|
70
|
+
Cascader: i
|
|
71
|
+
}, jm = {
|
|
67
72
|
Text: m,
|
|
68
|
-
TextArea:
|
|
69
|
-
Number:
|
|
70
|
-
Date:
|
|
71
|
-
DateRange:
|
|
72
|
-
Radio:
|
|
73
|
-
Checkbox:
|
|
74
|
-
Select:
|
|
75
|
-
Switch:
|
|
76
|
-
Slider:
|
|
77
|
-
Segmented:
|
|
78
|
-
Rate:
|
|
79
|
-
TreeSelect:
|
|
80
|
-
Second:
|
|
73
|
+
TextArea: k,
|
|
74
|
+
Number: D,
|
|
75
|
+
Date: C,
|
|
76
|
+
DateRange: g,
|
|
77
|
+
Radio: h,
|
|
78
|
+
Checkbox: b,
|
|
79
|
+
Select: T,
|
|
80
|
+
Switch: R,
|
|
81
|
+
Slider: x,
|
|
82
|
+
Segmented: S,
|
|
83
|
+
Rate: F,
|
|
84
|
+
TreeSelect: A,
|
|
85
|
+
Second: $,
|
|
86
|
+
Cascader: l
|
|
81
87
|
};
|
|
82
88
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
g as
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
jm as ApField,
|
|
90
|
+
l as ApFieldCascader,
|
|
91
|
+
b as ApFieldCheckbox,
|
|
92
|
+
C as ApFieldDate,
|
|
93
|
+
g as ApFieldDateRange,
|
|
94
|
+
D as ApFieldNumber,
|
|
95
|
+
h as ApFieldRadio,
|
|
96
|
+
F as ApFieldRate,
|
|
97
|
+
Nm as ApFieldRead,
|
|
98
|
+
$ as ApFieldSecond,
|
|
99
|
+
S as ApFieldSegmented,
|
|
100
|
+
T as ApFieldSelect,
|
|
101
|
+
x as ApFieldSlider,
|
|
102
|
+
R as ApFieldSwitch,
|
|
96
103
|
m as ApFieldText,
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
k as ApFieldTextArea,
|
|
105
|
+
A as ApFieldTreeSelect
|
|
99
106
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { InputProps, CheckboxGroupProps, DatePickerProps, InputNumberProps, RadioGroupProps, SwitchProps, TextAreaProps, SelectProps, PopconfirmProps, SliderProps, SegmentedProps, RateProps, TreeSelectProps } from '@aplus-frontend/antdv';
|
|
1
|
+
import { InputProps, CheckboxGroupProps, DatePickerProps, InputNumberProps, RadioGroupProps, SwitchProps, TextAreaProps, SelectProps, PopconfirmProps, SliderProps, SegmentedProps, RateProps, TreeSelectProps, CascaderProps } from '@aplus-frontend/antdv';
|
|
2
2
|
import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker/dayjs';
|
|
3
|
+
import { DefaultOptionType } from '@aplus-frontend/antdv/es/select';
|
|
3
4
|
import { InputFocusOptions } from '@aplus-frontend/antdv/es/vc-input/utils/commonUtils';
|
|
4
5
|
import { RangeValue } from '@aplus-frontend/antdv/es/vc-picker/interface';
|
|
5
6
|
import { SharedTimeProps } from '@aplus-frontend/antdv/es/vc-picker/panels/TimePanel';
|
|
@@ -287,4 +288,29 @@ export type ApFieldSecondProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'
|
|
|
287
288
|
emptyText?: string;
|
|
288
289
|
};
|
|
289
290
|
export type ApFieldSecondExpose = ApiFieldNumberExpose;
|
|
291
|
+
export type ApFieldCascaderProps = BasicApFieldProps<Omit<CascaderProps, 'loadData'>> & {
|
|
292
|
+
emptyText?: string;
|
|
293
|
+
/**
|
|
294
|
+
* 手动请求节点数据
|
|
295
|
+
* @param currentNode 当前选中项
|
|
296
|
+
* @param clear 请求数据时是否清空数据
|
|
297
|
+
* @returns
|
|
298
|
+
*/
|
|
299
|
+
request?: (selectOptions?: DefaultOptionType[], extraParams?: Recordable) => Promise<CascaderProps['options']>;
|
|
300
|
+
/**
|
|
301
|
+
* 是否跳过首次加载数据
|
|
302
|
+
*/
|
|
303
|
+
lazy?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* 发起request额外的请求,变更后会自动重新发器请求
|
|
306
|
+
*/
|
|
307
|
+
params?: Recordable;
|
|
308
|
+
/**
|
|
309
|
+
* 是否动态加载选项
|
|
310
|
+
*/
|
|
311
|
+
loadData?: boolean;
|
|
312
|
+
};
|
|
313
|
+
export type ApFieldCascaderExpose = Omit<CommonApFieldExpose, 'request'> & {
|
|
314
|
+
request: (selectOptions?: DefaultOptionType[] | undefined, clear?: boolean) => Promise<void>;
|
|
315
|
+
};
|
|
290
316
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Space as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { isVNode as A, defineComponent as F, useSlots as _, shallowRef as E, computed as K, unref as e, createVNode as r, Fragment as g, createBlock as S, openBlock as v, resolveDynamicComponent as U, mergeProps as z, createSlots as M, renderList as j, withCtx as w, renderSlot as q, normalizeProps as O, guardReactiveProps as $ } from "vue";
|
|
2
|
+
import { Space as H, Tag as W, TreeSelect as G, Spin as J } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isArray as Q, omit as X } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { useDefaultPlaceholder as Y } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { useRequest as Z } from "./use-request.mjs";
|
|
7
|
+
import { useControllableValue as ee } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
function B(d) {
|
|
9
|
+
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !A(d);
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
+
const ie = /* @__PURE__ */ F({
|
|
11
12
|
name: "ApFieldTreeSelect",
|
|
12
13
|
__name: "index",
|
|
13
14
|
props: {
|
|
@@ -173,80 +174,83 @@ const de = /* @__PURE__ */ A({
|
|
|
173
174
|
}
|
|
174
175
|
},
|
|
175
176
|
emits: ["update:value"],
|
|
176
|
-
setup(
|
|
177
|
-
expose:
|
|
178
|
-
emit:
|
|
177
|
+
setup(d, {
|
|
178
|
+
expose: C,
|
|
179
|
+
emit: x
|
|
179
180
|
}) {
|
|
180
|
-
const
|
|
181
|
+
const n = d, N = _(), T = x, p = E(), {
|
|
181
182
|
value: f,
|
|
182
183
|
updateValue: b
|
|
183
|
-
} =
|
|
184
|
+
} = ee(n, T), D = Y("TreeSelect", n), {
|
|
184
185
|
treeData: c,
|
|
185
186
|
loading: m,
|
|
186
187
|
request: y
|
|
187
|
-
} =
|
|
188
|
+
} = Z(n), V = K(() => {
|
|
188
189
|
let t;
|
|
189
|
-
const u = e(f), i =
|
|
190
|
+
const u = e(f), i = Q(u) ? u : [u].filter(Boolean);
|
|
190
191
|
if (!i.length)
|
|
191
|
-
return
|
|
192
|
-
const
|
|
192
|
+
return r(g, null, [n.emptyText]);
|
|
193
|
+
const o = [], s = n.fieldNames?.label || "label", R = n.fieldNames?.value || "value";
|
|
193
194
|
function h(a) {
|
|
194
195
|
for (const l of a) {
|
|
195
|
-
if (i.find((
|
|
196
|
+
if (i.find((L) => L === l[R]) && o.push(l[s]), o.length === i.length)
|
|
196
197
|
return;
|
|
197
198
|
l.children?.length && h(l.children);
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
|
-
return h(e(c)),
|
|
201
|
+
return h(e(c)), o.length ? o.length === 1 ? r("span", null, [o[0]]) : r(H, {
|
|
201
202
|
size: 4
|
|
202
|
-
}, B(t =
|
|
203
|
-
style:
|
|
203
|
+
}, B(t = o.map((a, l) => r(W, {
|
|
204
|
+
style: {
|
|
205
|
+
marginRight: 0
|
|
206
|
+
},
|
|
204
207
|
key: `${a}-${l}`
|
|
205
208
|
}, B(a) ? a : {
|
|
206
209
|
default: () => [a]
|
|
207
210
|
}))) ? t : {
|
|
208
211
|
default: () => [t]
|
|
209
|
-
}) :
|
|
212
|
+
}) : r(g, null, [n.emptyText]);
|
|
210
213
|
});
|
|
211
|
-
function
|
|
214
|
+
function k() {
|
|
212
215
|
p.value?.focus?.();
|
|
213
216
|
}
|
|
214
|
-
function
|
|
217
|
+
function I() {
|
|
215
218
|
p.value?.blur?.();
|
|
216
219
|
}
|
|
217
|
-
function
|
|
220
|
+
function P(t) {
|
|
218
221
|
return y(t);
|
|
219
222
|
}
|
|
220
|
-
return
|
|
223
|
+
return C({
|
|
221
224
|
request: y,
|
|
222
|
-
focus:
|
|
223
|
-
blur:
|
|
224
|
-
}), (t, u) => t.mode === "read" ? (
|
|
225
|
+
focus: k,
|
|
226
|
+
blur: I
|
|
227
|
+
}), (t, u) => t.mode === "read" ? (v(), S(U(V.value), {
|
|
225
228
|
key: 0
|
|
226
|
-
})) : (
|
|
229
|
+
})) : (v(), S(e(G), z({
|
|
227
230
|
key: 1
|
|
228
|
-
}, e(
|
|
231
|
+
}, e(X)(n, ["onUpdate:value", "value", "treeData", "loadData"]), {
|
|
229
232
|
ref_key: "treeSelectRef",
|
|
230
233
|
ref: p,
|
|
231
234
|
value: e(f),
|
|
232
235
|
"tree-data": e(c),
|
|
233
236
|
loading: e(m),
|
|
234
|
-
|
|
237
|
+
placeholder: e(D),
|
|
238
|
+
"load-data": t.loadData ? P : void 0,
|
|
235
239
|
"onUpdate:value": e(b)
|
|
236
|
-
}),
|
|
240
|
+
}), M({
|
|
237
241
|
_: 2
|
|
238
|
-
}, [
|
|
239
|
-
name:
|
|
240
|
-
fn: w((s) => [
|
|
242
|
+
}, [j(N, (i, o) => ({
|
|
243
|
+
name: o,
|
|
244
|
+
fn: w((s) => [q(t.$slots, o, O($(s || {})))])
|
|
241
245
|
})), e(m) ? {
|
|
242
246
|
name: "notFoundContent",
|
|
243
|
-
fn: w(() => [
|
|
247
|
+
fn: w(() => [r(e(J), {
|
|
244
248
|
size: "small"
|
|
245
249
|
})]),
|
|
246
250
|
key: "0"
|
|
247
|
-
} : void 0]), 1040, ["value", "tree-data", "loading", "load-data", "onUpdate:value"]));
|
|
251
|
+
} : void 0]), 1040, ["value", "tree-data", "loading", "placeholder", "load-data", "onUpdate:value"]));
|
|
248
252
|
}
|
|
249
253
|
});
|
|
250
254
|
export {
|
|
251
|
-
|
|
255
|
+
ie as default
|
|
252
256
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isFunction as d } from "lodash-unified";
|
|
2
2
|
import { ref as o, watch as v, onMounted as h } from "vue";
|
|
3
3
|
const y = (e) => {
|
|
4
|
-
let
|
|
4
|
+
let f = 0;
|
|
5
5
|
const a = o(
|
|
6
6
|
e.treeData || []
|
|
7
|
-
),
|
|
7
|
+
), i = o(!1);
|
|
8
8
|
v(
|
|
9
9
|
() => e.treeData,
|
|
10
10
|
(t) => {
|
|
@@ -14,50 +14,53 @@ const y = (e) => {
|
|
|
14
14
|
deep: !0
|
|
15
15
|
}
|
|
16
16
|
);
|
|
17
|
-
function
|
|
17
|
+
function s(t, u) {
|
|
18
18
|
if (!t?.length)
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
20
|
+
const l = e.fieldNames?.value || "value";
|
|
21
21
|
for (const n of t) {
|
|
22
|
-
if (n[
|
|
22
|
+
if (n[l] === u[l])
|
|
23
23
|
return n;
|
|
24
|
-
if (n.children?.length)
|
|
25
|
-
|
|
24
|
+
if (n.children?.length) {
|
|
25
|
+
const r = s(n.children, u);
|
|
26
|
+
if (r)
|
|
27
|
+
return r;
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
|
-
async function
|
|
31
|
+
async function c(t, u = !1) {
|
|
29
32
|
if (!d(e.request))
|
|
30
33
|
return;
|
|
31
|
-
|
|
32
|
-
const
|
|
34
|
+
i.value = !0, f += 1;
|
|
35
|
+
const l = f;
|
|
33
36
|
try {
|
|
34
|
-
|
|
37
|
+
u && (a.value = []);
|
|
35
38
|
const n = await e.request(t, e.params);
|
|
36
|
-
if (
|
|
39
|
+
if (l !== f)
|
|
37
40
|
return;
|
|
38
41
|
if (t) {
|
|
39
|
-
const
|
|
40
|
-
|
|
42
|
+
const r = s(a.value, t);
|
|
43
|
+
r && (r.children = n);
|
|
41
44
|
} else
|
|
42
45
|
a.value = n;
|
|
43
46
|
} finally {
|
|
44
|
-
|
|
47
|
+
i.value = !1;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
return h(() => {
|
|
48
|
-
e.lazy ||
|
|
51
|
+
e.lazy || c();
|
|
49
52
|
}), v(
|
|
50
53
|
() => e.params,
|
|
51
54
|
() => {
|
|
52
|
-
|
|
55
|
+
c();
|
|
53
56
|
},
|
|
54
57
|
{
|
|
55
58
|
deep: !0
|
|
56
59
|
}
|
|
57
60
|
), {
|
|
58
61
|
treeData: a,
|
|
59
|
-
request:
|
|
60
|
-
loading:
|
|
62
|
+
request: c,
|
|
63
|
+
loading: i
|
|
61
64
|
};
|
|
62
65
|
};
|
|
63
66
|
export {
|