@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.
Files changed (95) hide show
  1. package/es/index.mjs +285 -281
  2. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +56 -41
  3. package/es/src/ag-grid/context.d.ts +8 -0
  4. package/es/src/ag-grid/context.mjs +18 -7
  5. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  6. package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
  7. package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
  8. package/es/src/ag-grid/index.vue.mjs +270 -255
  9. package/es/src/ag-grid/interface.d.ts +20 -1
  10. package/es/src/ag-grid/style/custom-header.mjs +22 -13
  11. package/es/src/ap-field/cascader/index.vue.d.ts +60 -0
  12. package/es/src/ap-field/cascader/index.vue.mjs +217 -0
  13. package/es/src/ap-field/cascader/index.vue2.mjs +4 -0
  14. package/es/src/ap-field/cascader/read.vue.d.ts +8 -0
  15. package/es/src/ap-field/cascader/read.vue.mjs +4 -0
  16. package/es/src/ap-field/cascader/read.vue2.mjs +159 -0
  17. package/es/src/ap-field/cascader/use-options.d.ts +25 -0
  18. package/es/src/ap-field/cascader/use-options.mjs +66 -0
  19. package/es/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
  20. package/es/src/ap-field/hooks/use-default-placeholder.mjs +13 -8
  21. package/es/src/ap-field/index.d.ts +8 -2
  22. package/es/src/ap-field/index.mjs +72 -65
  23. package/es/src/ap-field/interface.d.ts +27 -1
  24. package/es/src/ap-field/tree-select/index.vue.mjs +43 -39
  25. package/es/src/ap-field/tree-select/use-request.mjs +22 -19
  26. package/es/src/ap-form/items/cascader/index.vue.d.ts +435 -0
  27. package/es/src/ap-form/items/cascader/index.vue.mjs +102 -0
  28. package/es/src/ap-form/items/cascader/index.vue2.mjs +4 -0
  29. package/es/src/ap-form/items/index.d.ts +2 -1
  30. package/es/src/ap-form/items/index.mjs +3 -2
  31. package/es/src/ap-form/items/interface.d.ts +6 -1
  32. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
  33. package/es/src/ap-table/constants.d.ts +269 -4
  34. package/es/src/ap-table/constants.mjs +29 -26
  35. package/es/src/ap-table/interface.d.ts +5 -1
  36. package/es/src/ap-table/style/setting.mjs +30 -27
  37. package/es/src/ap-table/utils.d.ts +1 -1
  38. package/es/src/business/ag-grid-modal/interface.d.ts +4 -0
  39. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
  40. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +25 -21
  41. package/es/src/business/ag-grid-modal/style/index.mjs +1 -1
  42. package/es/src/business/ag-grid-modal/utils.d.ts +1 -0
  43. package/es/src/index.mjs +250 -246
  44. package/es/src/locale/lang/en.mjs +1 -0
  45. package/es/src/locale/lang/zh-cn.mjs +1 -0
  46. package/es/src/version.d.ts +1 -1
  47. package/es/src/version.mjs +1 -1
  48. package/lib/index.js +1 -1
  49. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  50. package/lib/src/ag-grid/context.d.ts +8 -0
  51. package/lib/src/ag-grid/context.js +1 -1
  52. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  53. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  54. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  55. package/lib/src/ag-grid/index.vue.js +1 -1
  56. package/lib/src/ag-grid/interface.d.ts +20 -1
  57. package/lib/src/ag-grid/style/custom-header.js +1 -1
  58. package/lib/src/ap-field/cascader/index.vue.d.ts +60 -0
  59. package/lib/src/ap-field/cascader/index.vue.js +1 -0
  60. package/lib/src/ap-field/cascader/index.vue2.js +1 -0
  61. package/lib/src/ap-field/cascader/read.vue.d.ts +8 -0
  62. package/lib/src/ap-field/cascader/read.vue.js +1 -0
  63. package/lib/src/ap-field/cascader/read.vue2.js +1 -0
  64. package/lib/src/ap-field/cascader/use-options.d.ts +25 -0
  65. package/lib/src/ap-field/cascader/use-options.js +1 -0
  66. package/lib/src/ap-field/hooks/use-default-placeholder.d.ts +3 -1
  67. package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -1
  68. package/lib/src/ap-field/index.d.ts +8 -2
  69. package/lib/src/ap-field/index.js +1 -1
  70. package/lib/src/ap-field/interface.d.ts +27 -1
  71. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  72. package/lib/src/ap-field/tree-select/use-request.js +1 -1
  73. package/lib/src/ap-form/items/cascader/index.vue.d.ts +435 -0
  74. package/lib/src/ap-form/items/cascader/index.vue.js +1 -0
  75. package/lib/src/ap-form/items/cascader/index.vue2.js +1 -0
  76. package/lib/src/ap-form/items/index.d.ts +2 -1
  77. package/lib/src/ap-form/items/index.js +1 -1
  78. package/lib/src/ap-form/items/interface.d.ts +6 -1
  79. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  80. package/lib/src/ap-table/constants.d.ts +269 -4
  81. package/lib/src/ap-table/constants.js +1 -1
  82. package/lib/src/ap-table/interface.d.ts +5 -1
  83. package/lib/src/ap-table/style/setting.js +1 -1
  84. package/lib/src/ap-table/utils.d.ts +1 -1
  85. package/lib/src/business/ag-grid-modal/interface.d.ts +4 -0
  86. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +1 -0
  87. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -1
  88. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  89. package/lib/src/business/ag-grid-modal/utils.d.ts +1 -0
  90. package/lib/src/index.js +1 -1
  91. package/lib/src/locale/lang/en.js +1 -1
  92. package/lib/src/locale/lang/zh-cn.js +1 -1
  93. package/lib/src/version.d.ts +1 -1
  94. package/lib/src/version.js +1 -1
  95. package/package.json +4 -4
@@ -1,22 +1,27 @@
1
- import { computed as r } from "vue";
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 i } from "../../utils/is.mjs";
6
- const c = ["Select", "Date"], a = [
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, o) => {
17
+ ], m = (t, r) => {
13
18
  const { t: e } = n();
14
- return r(() => {
15
- if (i(o.placeholder))
16
- return o.placeholder;
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 (c.includes(t))
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 "./second/read.vue2.mjs";
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 r from "./tree-select/read.vue2.mjs";
31
- import t from "./switch/read.vue2.mjs";
32
- import e from "./select/read.vue2.mjs";
33
- import p from "./checkbox/read.vue2.mjs";
34
- import a from "./radio/read.vue2.mjs";
35
- import f from "./date-range/read.vue2.mjs";
36
- import _ from "./date/read.vue2.mjs";
37
- import c from "./number/read.vue2.mjs";
38
- import s from "./text-area/read.vue2.mjs";
39
- import n from "./text/read.vue2.mjs";
40
- import d from "./second/index.vue.mjs";
41
- import l from "./tree-select/index.vue.mjs";
42
- import $ from "./rate/index.vue.mjs";
43
- import A from "./segmented/index.vue.mjs";
44
- import F from "./slider/index.vue.mjs";
45
- import S from "./switch/index.vue.mjs";
46
- import x from "./select/index.vue.mjs";
47
- import R from "./checkbox/index.vue.mjs";
48
- import T from "./radio/index.vue.mjs";
49
- import b from "./date-range/index.vue.mjs";
50
- import h from "./date/index.vue.mjs";
51
- import g from "./number/index.vue.mjs";
52
- import D from "./text-area/index.vue.mjs";
53
- const gm = {
54
- Text: n,
55
- TextArea: s,
56
- Number: c,
57
- Date: _,
58
- DateRange: f,
59
- Radio: a,
60
- Checkbox: p,
61
- Select: e,
62
- Switch: t,
63
- TreeSelect: r,
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: i
66
- }, Dm = {
69
+ Second: r,
70
+ Cascader: i
71
+ }, jm = {
67
72
  Text: m,
68
- TextArea: D,
69
- Number: g,
70
- Date: h,
71
- DateRange: b,
72
- Radio: T,
73
- Checkbox: R,
74
- Select: x,
75
- Switch: S,
76
- Slider: F,
77
- Segmented: A,
78
- Rate: $,
79
- TreeSelect: l,
80
- Second: d
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
- Dm as ApField,
84
- R as ApFieldCheckbox,
85
- h as ApFieldDate,
86
- b as ApFieldDateRange,
87
- g as ApFieldNumber,
88
- T as ApFieldRadio,
89
- $ as ApFieldRate,
90
- gm as ApFieldRead,
91
- d as ApFieldSecond,
92
- A as ApFieldSegmented,
93
- x as ApFieldSelect,
94
- F as ApFieldSlider,
95
- S as ApFieldSwitch,
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
- D as ApFieldTextArea,
98
- l as ApFieldTreeSelect
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 R, defineComponent as A, useSlots as F, shallowRef as _, computed as E, unref as e, createVNode as d, Fragment as g, createBlock as v, openBlock as S, resolveDynamicComponent as K, mergeProps as U, createSlots as z, renderList as M, withCtx as w, renderSlot as j, normalizeProps as q, guardReactiveProps as O } from "vue";
2
- import { Space as $, Tag as H, TreeSelect as W, Spin as G } from "@aplus-frontend/antdv";
3
- import { isArray as J, omit as Q } from "lodash-unified";
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 { useRequest as X } from "./use-request.mjs";
6
- import { useControllableValue as Y } from "../../hooks/useControllableValue.mjs";
7
- function B(r) {
8
- return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !R(r);
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 de = /* @__PURE__ */ A({
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(r, {
177
- expose: x,
178
- emit: C
177
+ setup(d, {
178
+ expose: C,
179
+ emit: x
179
180
  }) {
180
- const o = r, N = F(), T = C, p = _(), {
181
+ const n = d, N = _(), T = x, p = E(), {
181
182
  value: f,
182
183
  updateValue: b
183
- } = Y(o, T), {
184
+ } = ee(n, T), D = Y("TreeSelect", n), {
184
185
  treeData: c,
185
186
  loading: m,
186
187
  request: y
187
- } = X(o), D = E(() => {
188
+ } = Z(n), V = K(() => {
188
189
  let t;
189
- const u = e(f), i = J(u) ? u : [u].filter(Boolean);
190
+ const u = e(f), i = Q(u) ? u : [u].filter(Boolean);
190
191
  if (!i.length)
191
- return d(g, null, [o.emptyText]);
192
- const n = [], s = o.fieldNames?.label || "label", L = o.fieldNames?.value || "value";
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((P) => P === l[L]) && n.push(l[s]), n.length === i.length)
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)), n.length ? n.length === 1 ? d("span", null, [n[0]]) : d($, {
201
+ return h(e(c)), o.length ? o.length === 1 ? r("span", null, [o[0]]) : r(H, {
201
202
  size: 4
202
- }, B(t = n.map((a, l) => d(H, {
203
- style: "margin-right: 0px",
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
- }) : d(g, null, [o.emptyText]);
212
+ }) : r(g, null, [n.emptyText]);
210
213
  });
211
- function V() {
214
+ function k() {
212
215
  p.value?.focus?.();
213
216
  }
214
- function k() {
217
+ function I() {
215
218
  p.value?.blur?.();
216
219
  }
217
- function I(t) {
220
+ function P(t) {
218
221
  return y(t);
219
222
  }
220
- return x({
223
+ return C({
221
224
  request: y,
222
- focus: V,
223
- blur: k
224
- }), (t, u) => t.mode === "read" ? (S(), v(K(D.value), {
225
+ focus: k,
226
+ blur: I
227
+ }), (t, u) => t.mode === "read" ? (v(), S(U(V.value), {
225
228
  key: 0
226
- })) : (S(), v(e(W), U({
229
+ })) : (v(), S(e(G), z({
227
230
  key: 1
228
- }, e(Q)(o, ["onUpdate:value", "value", "treeData", "loadData"]), {
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
- "load-data": t.loadData ? I : void 0,
237
+ placeholder: e(D),
238
+ "load-data": t.loadData ? P : void 0,
235
239
  "onUpdate:value": e(b)
236
- }), z({
240
+ }), M({
237
241
  _: 2
238
- }, [M(N, (i, n) => ({
239
- name: n,
240
- fn: w((s) => [j(t.$slots, n, q(O(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(() => [d(e(G), {
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
- de as default
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 l = 0;
4
+ let f = 0;
5
5
  const a = o(
6
6
  e.treeData || []
7
- ), f = o(!1);
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 c(t, r) {
17
+ function s(t, u) {
18
18
  if (!t?.length)
19
19
  return;
20
- const u = e.fieldNames?.value || "value";
20
+ const l = e.fieldNames?.value || "value";
21
21
  for (const n of t) {
22
- if (n[u] === r[u])
22
+ if (n[l] === u[l])
23
23
  return n;
24
- if (n.children?.length)
25
- return c(n.children, r);
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 i(t, r = !1) {
31
+ async function c(t, u = !1) {
29
32
  if (!d(e.request))
30
33
  return;
31
- f.value = !0, l += 1;
32
- const u = l;
34
+ i.value = !0, f += 1;
35
+ const l = f;
33
36
  try {
34
- r && (a.value = []);
37
+ u && (a.value = []);
35
38
  const n = await e.request(t, e.params);
36
- if (u !== l)
39
+ if (l !== f)
37
40
  return;
38
41
  if (t) {
39
- const s = c(a.value, t);
40
- s && (s.children = n);
42
+ const r = s(a.value, t);
43
+ r && (r.children = n);
41
44
  } else
42
45
  a.value = n;
43
46
  } finally {
44
- f.value = !1;
47
+ i.value = !1;
45
48
  }
46
49
  }
47
50
  return h(() => {
48
- e.lazy || i();
51
+ e.lazy || c();
49
52
  }), v(
50
53
  () => e.params,
51
54
  () => {
52
- i();
55
+ c();
53
56
  },
54
57
  {
55
58
  deep: !0
56
59
  }
57
60
  ), {
58
61
  treeData: a,
59
- request: i,
60
- loading: f
62
+ request: c,
63
+ loading: i
61
64
  };
62
65
  };
63
66
  export {