@aplus-frontend/ui 7.14.4 → 7.15.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 (93) hide show
  1. package/es/src/ap-field/checkbox/index.vue.d.ts +3 -1
  2. package/es/src/ap-field/checkbox/index.vue.mjs +37 -31
  3. package/es/src/ap-field/date/index.vue.d.ts +1086 -6
  4. package/es/src/ap-field/date/index.vue.mjs +63 -57
  5. package/es/src/ap-field/date-range/index.vue.d.ts +1155 -4
  6. package/es/src/ap-field/date-range/index.vue.mjs +70 -63
  7. package/es/src/ap-field/interface.d.ts +25 -27
  8. package/es/src/ap-field/number/index.vue.d.ts +1 -1
  9. package/es/src/ap-field/radio/index.vue.d.ts +1 -2
  10. package/es/src/ap-field/radio/index.vue.mjs +36 -41
  11. package/es/src/ap-field/rate/index.vue.d.ts +1 -1
  12. package/es/src/ap-field/second/index.vue.d.ts +1 -1
  13. package/es/src/ap-field/select/index.vue.d.ts +5 -4
  14. package/es/src/ap-field/select/index.vue.mjs +126 -112
  15. package/es/src/ap-field/select/read.vue2.mjs +4 -3
  16. package/es/src/ap-field/slider/index.vue.d.ts +1 -1
  17. package/es/src/ap-field/switch/index.vue.d.ts +232 -4
  18. package/es/src/ap-field/switch/index.vue.mjs +48 -42
  19. package/es/src/ap-field/text/password.vue.d.ts +1 -1
  20. package/es/src/ap-field/text-area/index.vue.d.ts +1 -1
  21. package/es/src/ap-form/item-group/index.vue.d.ts +2 -4
  22. package/es/src/ap-form/item-group/index.vue.mjs +37 -42
  23. package/es/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
  24. package/es/src/ap-form/items/checkbox/index.vue.mjs +20 -14
  25. package/es/src/ap-form/items/date/index.vue.d.ts +1497 -5
  26. package/es/src/ap-form/items/date/index.vue.mjs +25 -19
  27. package/es/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
  28. package/es/src/ap-form/items/date-range/index.vue.mjs +25 -19
  29. package/es/src/ap-form/items/number/index.vue.d.ts +4 -4
  30. package/es/src/ap-form/items/radio/index.vue.d.ts +5 -10
  31. package/es/src/ap-form/items/radio/index.vue.mjs +14 -20
  32. package/es/src/ap-form/items/select/index.vue.d.ts +18 -12
  33. package/es/src/ap-form/items/switch/index.vue.d.ts +436 -5
  34. package/es/src/ap-form/items/switch/index.vue.mjs +24 -17
  35. package/es/src/ap-form/items/text/password.vue.d.ts +5 -5
  36. package/es/src/ap-form/items/text-area/index.vue.d.ts +5 -5
  37. package/es/src/ap-table/constants.d.ts +1923 -112
  38. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +36 -36
  39. package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +28 -27
  40. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +78 -81
  41. package/es/src/config-provider/config-provider-props.d.ts +3 -1
  42. package/es/src/config-provider/config-provider.d.ts +7 -28
  43. package/es/src/config-provider/hooks/use-global-config.d.ts +3 -10
  44. package/es/src/config-provider/index.d.ts +13 -55
  45. package/es/src/version.d.ts +1 -1
  46. package/es/src/version.mjs +1 -1
  47. package/lib/src/ap-field/checkbox/index.vue.d.ts +3 -1
  48. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  49. package/lib/src/ap-field/date/index.vue.d.ts +1086 -6
  50. package/lib/src/ap-field/date/index.vue.js +1 -1
  51. package/lib/src/ap-field/date-range/index.vue.d.ts +1155 -4
  52. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  53. package/lib/src/ap-field/interface.d.ts +25 -27
  54. package/lib/src/ap-field/number/index.vue.d.ts +1 -1
  55. package/lib/src/ap-field/radio/index.vue.d.ts +1 -2
  56. package/lib/src/ap-field/radio/index.vue.js +1 -1
  57. package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
  58. package/lib/src/ap-field/second/index.vue.d.ts +1 -1
  59. package/lib/src/ap-field/select/index.vue.d.ts +5 -4
  60. package/lib/src/ap-field/select/index.vue.js +1 -1
  61. package/lib/src/ap-field/select/read.vue2.js +1 -1
  62. package/lib/src/ap-field/slider/index.vue.d.ts +1 -1
  63. package/lib/src/ap-field/switch/index.vue.d.ts +232 -4
  64. package/lib/src/ap-field/switch/index.vue.js +1 -1
  65. package/lib/src/ap-field/text/password.vue.d.ts +1 -1
  66. package/lib/src/ap-field/text-area/index.vue.d.ts +1 -1
  67. package/lib/src/ap-form/item-group/index.vue.d.ts +2 -4
  68. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  69. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
  70. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  71. package/lib/src/ap-form/items/date/index.vue.d.ts +1497 -5
  72. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  73. package/lib/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
  74. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  75. package/lib/src/ap-form/items/number/index.vue.d.ts +4 -4
  76. package/lib/src/ap-form/items/radio/index.vue.d.ts +5 -10
  77. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  78. package/lib/src/ap-form/items/select/index.vue.d.ts +18 -12
  79. package/lib/src/ap-form/items/switch/index.vue.d.ts +436 -5
  80. package/lib/src/ap-form/items/switch/index.vue.js +1 -1
  81. package/lib/src/ap-form/items/text/password.vue.d.ts +5 -5
  82. package/lib/src/ap-form/items/text-area/index.vue.d.ts +5 -5
  83. package/lib/src/ap-table/constants.d.ts +1923 -112
  84. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  85. package/lib/src/business/ap-button-group/ApButtonGroup.vue2.js +1 -1
  86. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  87. package/lib/src/config-provider/config-provider-props.d.ts +3 -1
  88. package/lib/src/config-provider/config-provider.d.ts +7 -28
  89. package/lib/src/config-provider/hooks/use-global-config.d.ts +3 -10
  90. package/lib/src/config-provider/index.d.ts +13 -55
  91. package/lib/src/version.d.ts +1 -1
  92. package/lib/src/version.js +1 -1
  93. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
- import { defineComponent as L, useSlots as Y, computed as s, unref as t, isVNode as Z, createVNode as D, Fragment as m, createElementBlock as g, createBlock as k, openBlock as u, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as q, normalizeStyle as J, withCtx as B, createCommentVNode as Q, isRef as X, renderList as w, mergeProps as ee, createSlots as oe, renderSlot as te, normalizeProps as ne, guardReactiveProps as ae } from "vue";
2
- import { SwapRightOutlined as re } from "@ant-design/icons-vue";
3
- import { InputGroup as le, Select as ue, SelectOption as de, DatePicker as ie } from "@aplus-frontend/antdv";
1
+ import { defineComponent as Z, useSlots as q, ref as J, computed as s, unref as t, isVNode as Q, createVNode as D, Fragment as m, createElementBlock as g, createBlock as k, openBlock as u, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as X, normalizeStyle as ee, withCtx as P, createCommentVNode as oe, isRef as te, renderList as w, mergeProps as ne, createSlots as ae, renderSlot as re, normalizeProps as le, guardReactiveProps as ue } from "vue";
2
+ import { SwapRightOutlined as de } from "@ant-design/icons-vue";
3
+ import { InputGroup as ie, Select as se, SelectOption as fe, DatePicker as pe } from "@aplus-frontend/antdv";
4
4
  import { getTimeFormatToZone as T } from "@aplus-frontend/utils";
5
5
  import d from "dayjs";
6
- import { isNil as b, omit as M, isString as c, isFunction as se } from "lodash-unified";
6
+ import { isNil as M, omit as R, isString as c, isFunction as me } from "lodash-unified";
7
7
  import "../../hooks/index.mjs";
8
- import { omitUndefined as pe } from "../../utils/index.mjs";
9
- import { ApFieldDatePresetFormats as fe, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as me, PRESET_FORMAT_TIME_MAP as ce } from "../date/constant.mjs";
10
- import { formatDayWithTimezone as ye } from "../date/helper.mjs";
11
- import { useDateTimezone as ve } from "../hooks/use-date-timezone.mjs";
12
- import { useDefaultPlaceholder as he } from "../hooks/use-default-placeholder.mjs";
13
- import { useDefaultPresets as ge } from "../hooks/use-default-presets.mjs";
14
- import { useControllableValue as ke } from "../../hooks/useControllableValue.mjs";
15
- const ze = /* @__PURE__ */ L({
8
+ import { omitUndefined as ce } from "../../utils/index.mjs";
9
+ import { ApFieldDatePresetFormats as ye, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as ve, PRESET_FORMAT_TIME_MAP as he } from "../date/constant.mjs";
10
+ import { formatDayWithTimezone as ge } from "../date/helper.mjs";
11
+ import { useDateTimezone as ke } from "../hooks/use-date-timezone.mjs";
12
+ import { useDefaultPlaceholder as Se } from "../hooks/use-default-placeholder.mjs";
13
+ import { useDefaultPresets as Ce } from "../hooks/use-default-presets.mjs";
14
+ import { useControllableValue as Pe } from "../../hooks/useControllableValue.mjs";
15
+ const Ee = /* @__PURE__ */ Z({
16
16
  name: "ApFieldDateRange",
17
17
  __name: "index",
18
18
  props: {
@@ -161,112 +161,119 @@ const ze = /* @__PURE__ */ L({
161
161
  }
162
162
  },
163
163
  emits: ["update:value"],
164
- setup(R, {
165
- emit: F
164
+ setup(F, {
165
+ expose: _,
166
+ emit: x
166
167
  }) {
167
- const o = R, _ = F, z = Y(), i = s(() => fe.indexOf(o.format) > -1), y = s(() => i.value ? A[o.format] : o.format), {
168
+ const o = F, z = x, N = q(), B = J(), i = s(() => ye.indexOf(o.format) > -1), y = s(() => i.value ? A[o.format] : o.format), {
168
169
  value: v,
169
- updateValue: P
170
- } = ke(o, _), N = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), x = he("DateRange", o), {
170
+ updateValue: b
171
+ } = Pe(o, z), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Se("DateRange", o), {
171
172
  currentTimezone: l
172
- } = ve(o), {
173
- presets: E,
174
- changeCurrentDate: V
175
- } = ge({
173
+ } = ke(o), {
174
+ presets: j,
175
+ changeCurrentDate: I
176
+ } = Ce({
176
177
  ...o,
177
178
  timezone: l
178
- }), p = (e, a, n = !0) => ye(l.value)(e, a, n), h = s(() => {
179
+ }), f = (e, a, n = !0) => ge(l.value)(e, a, n), h = s(() => {
179
180
  const e = t(v);
180
- if (b(e) || !e?.length)
181
+ if (M(e) || !e?.length)
181
182
  return e;
182
183
  const a = l.value ? T(t(v)[0], l.value) : t(v)?.[0], n = o.timezone ? T(t(v)[1], l.value) : t(v)?.[1];
183
184
  return [d(a), d(n)];
184
- }), j = s(() => t(i) ? o.picker ?? me[o.format] : o.picker), I = s(() => {
185
- const e = t(i) ? ce[o.format] : {};
185
+ }), U = s(() => t(i) ? o.picker ?? ve[o.format] : o.picker), H = s(() => {
186
+ const e = t(i) ? he[o.format] : {};
186
187
  return {
187
- ...pe(M(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
188
- placeholder: t(x),
189
- presets: t(E),
188
+ ...ce(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
189
+ placeholder: t(V),
190
+ presets: t(j),
190
191
  ...e
191
192
  };
192
193
  });
193
- function U(e) {
194
+ function K(e) {
194
195
  if (!e) {
195
- P(e);
196
+ b(e);
196
197
  return;
197
198
  }
198
199
  let a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1];
199
200
  const r = t(i) ? t(y) : void 0;
200
- P([p(a, r), p(n, r, !1)]);
201
+ b([f(a, r), f(n, r, !1)]);
201
202
  }
202
- function H(e) {
203
- const a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(y) : void 0, f = e[0] ? p(a, r) : null, O = e[1] ? p(n, r, !1) : null;
204
- o.onOk?.([f, O]);
203
+ function W(e) {
204
+ const a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(y) : void 0, p = e[0] ? f(a, r) : null, O = e[1] ? f(n, r, !1) : null;
205
+ o.onOk?.([p, O]);
205
206
  }
206
- function K(e) {
207
- e && V(), o.onOpenChange?.(e);
207
+ function $(e) {
208
+ e && I(), o.onOpenChange?.(e);
208
209
  }
209
- function W(e, a) {
210
- if (b(e)) {
210
+ function G(e, a) {
211
+ if (M(e)) {
211
212
  o.onChange?.(e, a);
212
213
  return;
213
214
  }
214
- const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1], f = t(i) ? t(y) : void 0, O = e[0] ? p(n, f) : null, G = e[1] ? p(r, f, !1) : null;
215
- o.onChange?.([O, G], a);
215
+ const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(y) : void 0, O = e[0] ? f(n, p) : null, Y = e[1] ? f(r, p, !1) : null;
216
+ o.onChange?.([O, Y], a);
216
217
  }
217
- const $ = s(() => {
218
+ const L = s(() => {
218
219
  const e = o.readModeSeparator;
219
220
  if (e)
220
- return Z(e) || se(e) ? o.readModeSeparator : D(m, null, [o.readModeSeparator]);
221
- const a = z.readModeSeparator?.();
222
- return a ? D(m, null, [a]) : re;
221
+ return Q(e) || me(e) ? o.readModeSeparator : D(m, null, [o.readModeSeparator]);
222
+ const a = N.readModeSeparator?.();
223
+ return a ? D(m, null, [a]) : de;
223
224
  });
224
- return (e, a) => e.mode === "read" ? (u(), g(m, {
225
+ return _({
226
+ focus: B.value?.focus(),
227
+ blur: B.value?.blur()
228
+ }), (e, a) => e.mode === "read" ? (u(), g(m, {
225
229
  key: 0
226
230
  }, [h.value ? (u(), g(m, {
227
231
  key: 0
228
- }, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(q($.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
232
+ }, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(X(L.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
229
233
  key: 1
230
- }, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(le), {
234
+ }, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(ie), {
231
235
  key: 1,
232
236
  compact: "",
233
- style: J({
237
+ style: ee({
234
238
  display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
235
239
  })
236
240
  }, {
237
- default: B(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), k(t(ue), {
241
+ default: P(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), k(t(se), {
238
242
  key: 0,
239
243
  value: t(l),
240
- "onUpdate:value": a[0] || (a[0] = (n) => X(l) ? l.value = n : null),
244
+ "onUpdate:value": a[0] || (a[0] = (n) => te(l) ? l.value = n : null),
241
245
  "default-active-first-option": "",
242
246
  "dropdown-match-select-width": !1
243
247
  }, {
244
- default: B(() => [(u(!0), g(m, null, w(o.timezone, (n) => (u(), k(t(de), {
248
+ default: P(() => [(u(!0), g(m, null, w(o.timezone, (n) => (u(), k(t(fe), {
245
249
  key: n?.value,
246
250
  value: n?.value
247
251
  }, {
248
- default: B(() => [S(C(n?.label ?? n?.value), 1)]),
252
+ default: P(() => [S(C(n?.label ?? n?.value), 1)]),
249
253
  _: 2
250
254
  }, 1032, ["value"]))), 128))]),
251
255
  _: 1
252
- }, 8, ["value"])) : Q("", !0), D(t(ie).RangePicker, ee(I.value, {
256
+ }, 8, ["value"])) : oe("", !0), D(t(pe).RangePicker, ne({
257
+ ref_key: "rangePickerRef",
258
+ ref: B
259
+ }, H.value, {
253
260
  value: h.value,
254
- picker: j.value,
255
- format: N.value,
256
- "onUpdate:value": U,
257
- onChange: W,
258
- onOk: H,
259
- onOpenChange: K
260
- }), oe({
261
+ picker: U.value,
262
+ format: E.value,
263
+ "onUpdate:value": K,
264
+ onChange: G,
265
+ onOk: W,
266
+ onOpenChange: $
267
+ }), ae({
261
268
  _: 2
262
- }, [w(t(M)(e.$slots, "readModeSeparator"), (n, r) => ({
269
+ }, [w(t(R)(e.$slots, "readModeSeparator"), (n, r) => ({
263
270
  name: r,
264
- fn: B((f) => [te(e.$slots, r, ne(ae(f || {})))])
271
+ fn: P((p) => [re(e.$slots, r, le(ue(p || {})))])
265
272
  }))]), 1040, ["value", "picker", "format"])]),
266
273
  _: 3
267
274
  }, 8, ["style"]));
268
275
  }
269
276
  });
270
277
  export {
271
- ze as default
278
+ Ee as default
272
279
  };
@@ -10,6 +10,11 @@ import { LiteralUnion, Recordable } from '../type';
10
10
  import { ApFormatPresetType } from './date/interface';
11
11
  import { InputPasswordProps } from './text/input-password-props';
12
12
  export type FieldMode = 'read' | 'edit';
13
+ type CommonApFieldExpose = {
14
+ focus: () => void;
15
+ blur: () => void;
16
+ request: () => void;
17
+ };
13
18
  export type BasicApFieldProps<FieldPropsType = any> = {
14
19
  mode?: FieldMode;
15
20
  class?: unknown;
@@ -27,10 +32,7 @@ export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
27
32
  export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
28
33
  emptyText?: string;
29
34
  };
30
- export type ApFieldTextPasswordExpose = {
31
- focus: () => void;
32
- blur: () => void;
33
- };
35
+ export type ApFieldTextPasswordExpose = Omit<CommonApFieldExpose, 'request'>;
34
36
  export type ApFieldTextExpose = {
35
37
  focus: (options?: InputFocusOptions) => void;
36
38
  blur: () => void;
@@ -43,6 +45,7 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
43
45
  request?: () => Promise<CheckboxGroupProps['options']>;
44
46
  vertical?: boolean;
45
47
  };
48
+ export type ApFieldCheckboxExpose = Pick<CommonApFieldExpose, 'request'>;
46
49
  export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format' | 'onUpdate:value'>> & {
47
50
  emptyText?: string;
48
51
  value?: number | null;
@@ -69,6 +72,7 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
69
72
  }[];
70
73
  disabledTime?: SharedTimeProps<Dayjs>['disabledTime'];
71
74
  };
75
+ export type ApFieldDateExpose = Omit<CommonApFieldExpose, 'request'>;
72
76
  export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
73
77
  /**
74
78
  * 输入框的显示模式(输入框/数字轮播)
@@ -84,25 +88,20 @@ export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'
84
88
  */
85
89
  limitDecimalsRetain?: boolean;
86
90
  };
87
- export type ApiFieldNumberExpose = {
88
- focus: () => void;
89
- blur: () => void;
90
- };
91
+ export type ApiFieldNumberExpose = Omit<CommonApFieldExpose, 'request'>;
91
92
  export type ApFieldRadioProps = BasicApFieldProps<RadioGroupProps> & {
92
93
  emptyText?: string;
93
94
  request?: () => Promise<RadioGroupProps['options']>;
94
95
  vertical?: boolean;
95
96
  };
96
- export type ApiFieldRadioExpose = {
97
- focus: () => void;
98
- blur: () => void;
99
- };
97
+ export type ApFieldRadioExpose = Pick<CommonApFieldExpose, 'request'>;
100
98
  export type ApFieldSwitchConfirmConfig = Pick<PopconfirmProps, 'title' | 'okText' | 'cancelText' | 'description' | 'showCancel' | 'icon' | 'okType' | 'onCancel' | 'okButtonProps' | 'cancelButtonProps'>;
101
99
  export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>> & {
102
100
  emptyText?: string;
103
101
  onAction?: (checked: string | boolean | number, e?: Event) => boolean | Promise<boolean>;
104
102
  confirm?: ApFieldSwitchConfirmConfig | ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig);
105
103
  };
104
+ export type ApFieldSwitchExpose = Omit<CommonApFieldExpose, 'request'>;
106
105
  export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
107
106
  emptyText?: string;
108
107
  /**
@@ -118,9 +117,8 @@ export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosi
118
117
  language?: 'text' | 'json';
119
118
  };
120
119
  };
121
- export type ApFieldTextAreaExpose = {
120
+ export type ApFieldTextAreaExpose = Pick<CommonApFieldExpose, 'blur'> & {
122
121
  focus: (options?: InputFocusOptions) => void;
123
- blur: () => void;
124
122
  resizableTextArea: any;
125
123
  };
126
124
  export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format' | 'presets'>> & {
@@ -193,6 +191,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
193
191
  lastYear?: boolean;
194
192
  };
195
193
  };
194
+ export type ApFieldDateRangeExpose = Omit<CommonApFieldExpose, 'request'>;
196
195
  export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
197
196
  emptyText?: string;
198
197
  request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
@@ -205,12 +204,18 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
205
204
  searchMode?: 'filter' | 'request';
206
205
  /**
207
206
  * 是否在Select框聚焦时再次触发选项请求
207
+ * @deprecated 有歧义,请使用fetchOnFocus
208
208
  */
209
209
  refetchOnFocus?: boolean;
210
210
  /**
211
- * 是否延迟请求选项列表
211
+ * 是否在聚焦时触发网络请求
212
+ * @since 7.15.0
212
213
  */
213
- lazy?: boolean;
214
+ fetchOnFocus?: boolean;
215
+ /**
216
+ * 是否延迟请求选项列表 true: 不请求选项; 'first-focus': 首次聚焦时触发网络请求
217
+ */
218
+ lazy?: boolean | 'first-focus';
214
219
  /**
215
220
  * 添加一个名为全部的节点(只在多选的情况下有效)
216
221
  */
@@ -251,9 +256,7 @@ export type ApFieldTreeSelectProps = BasicApFieldProps<Omit<TreeSelectProps, 'lo
251
256
  */
252
257
  loadData?: boolean;
253
258
  };
254
- export type ApFieldSelectExpose = {
255
- focus: () => void;
256
- blur: () => void;
259
+ export type ApFieldSelectExpose = Omit<CommonApFieldExpose, 'request'> & {
257
260
  request: (clear?: boolean) => Promise<void>;
258
261
  };
259
262
  export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
@@ -269,10 +272,7 @@ export type ApFieldSliderProps = BasicApFieldProps<Partial<SliderProps>> & {
269
272
  emptyText?: string;
270
273
  defaultValue?: number | [number, number];
271
274
  };
272
- export type ApFieldSliderExpose = {
273
- focus: () => void;
274
- blur: () => void;
275
- };
275
+ export type ApFieldSliderExpose = Omit<CommonApFieldExpose, 'request'>;
276
276
  export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
277
277
  emptyText?: string;
278
278
  defaultValue?: string | number;
@@ -281,12 +281,10 @@ export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
281
281
  export type ApFieldRateProps = BasicApFieldProps<RateProps> & {
282
282
  defaultValue?: number;
283
283
  };
284
- export type ApFieldRateExpose = {
285
- focus: () => void;
286
- blur: () => void;
287
- };
284
+ export type ApFieldRateExpose = Omit<CommonApFieldExpose, 'request'>;
288
285
  export type ApFieldSecondProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
289
286
  placeholder?: string;
290
287
  emptyText?: string;
291
288
  };
292
289
  export type ApFieldSecondExpose = ApiFieldNumberExpose;
290
+ export {};
@@ -382,8 +382,8 @@ declare function __VLS_template(): {
382
382
  };
383
383
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
384
384
  declare const __VLS_component: DefineComponent<ApFieldNumberProps, {
385
- focus: () => void;
386
385
  blur: () => void;
386
+ focus: () => void;
387
387
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
388
388
  "update:value": (...args: any[]) => void;
389
389
  }, string, PublicProps, Readonly<ApFieldNumberProps> & Readonly<{
@@ -7,8 +7,7 @@ import { RadioGroupButtonStyle, RadioGroupOptionType } from '@aplus-frontend/ant
7
7
  import { RadioChangeEvent } from '@aplus-frontend/antdv';
8
8
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
9
9
  declare const _default: DefineComponent<ApFieldRadioProps, {
10
- focus: () => void;
11
- blur: () => void;
10
+ request: () => void;
12
11
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
13
12
  "update:value": (...args: any[]) => void;
14
13
  }, string, PublicProps, Readonly<ApFieldRadioProps> & Readonly<{
@@ -1,14 +1,14 @@
1
- import { defineComponent as V, shallowRef as _, ref as q, onMounted as C, computed as O, unref as e, createElementBlock as s, openBlock as a, Fragment as p, createTextVNode as S, toDisplayString as U, createBlock as m, mergeProps as G } from "vue";
2
- import { Spin as N, RadioGroup as z } from "@aplus-frontend/antdv";
3
- import { isNil as F, omit as w } from "lodash-unified";
1
+ import { defineComponent as h, ref as q, onMounted as V, computed as C, unref as e, createElementBlock as p, openBlock as a, Fragment as u, createTextVNode as O, toDisplayString as S, createBlock as m, mergeProps as U } from "vue";
2
+ import { Spin as _, RadioGroup as N } from "@aplus-frontend/antdv";
3
+ import { isNil as R, omit as z } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import A from "../hooks/use-options.mjs";
7
- import D from "../style/index.mjs";
8
- import { getOptionValue as E, getOptionLabel as I } from "./helper.mjs";
9
- import { useControllableValue as L } from "../../hooks/useControllableValue.mjs";
10
- import { useNamespace as M } from "../../config-provider/hooks/use-namespace.mjs";
11
- const $ = /* @__PURE__ */ V({
6
+ import F from "../hooks/use-options.mjs";
7
+ import G from "../style/index.mjs";
8
+ import { getOptionValue as A, getOptionLabel as D } from "./helper.mjs";
9
+ import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
10
+ import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const X = /* @__PURE__ */ h({
12
12
  name: "ApFieldRadio",
13
13
  __name: "index",
14
14
  props: {
@@ -32,40 +32,36 @@ const $ = /* @__PURE__ */ V({
32
32
  request: {}
33
33
  },
34
34
  emits: ["update:value"],
35
- setup(d, { expose: f, emit: c }) {
36
- const t = d, v = c, l = _(), { options: r, updateOptions: y } = A(t), { value: u, updateValue: g } = L(t, v), { b: k, m: b } = M("field-radio"), x = D("field"), n = q(!1);
37
- C(() => {
38
- t.request && (n.value = !0, t.request?.().then((o) => y(o)).finally(() => {
39
- n.value = !1;
35
+ setup(d, { expose: c, emit: f }) {
36
+ const t = d, v = f, { options: n, updateOptions: y } = F(t), { value: r, updateValue: g } = E(t, v), { b: k, m: x } = I("field-radio"), b = G("field"), l = q(!1);
37
+ async function i() {
38
+ t.request && (l.value = !0, t.request?.().then((o) => y(o)).finally(() => {
39
+ l.value = !1;
40
40
  }));
41
+ }
42
+ V(() => {
43
+ i();
41
44
  });
42
- const h = O(() => {
43
- const o = e(u);
44
- if (F(o))
45
+ const B = C(() => {
46
+ const o = e(r);
47
+ if (R(o))
45
48
  return t.emptyText;
46
- const i = r.value?.find(
47
- (R) => o === E(R)
49
+ const s = n.value?.find(
50
+ (T) => o === A(T)
48
51
  );
49
- return I(i) || t.emptyText;
52
+ return D(s) || t.emptyText;
50
53
  });
51
- function B() {
52
- l.value?.focus();
53
- }
54
- function T() {
55
- l.value?.blur();
56
- }
57
- return f({
58
- focus: B,
59
- blur: T
60
- }), (o, i) => o.mode === "read" ? (a(), s(p, { key: 0 }, [
61
- S(U(h.value), 1)
62
- ], 64)) : (a(), s(p, { key: 1 }, [
63
- n.value ? (a(), m(e(N), {
54
+ return c({
55
+ request: i
56
+ }), (o, s) => o.mode === "read" ? (a(), p(u, { key: 0 }, [
57
+ O(S(B.value), 1)
58
+ ], 64)) : (a(), p(u, { key: 1 }, [
59
+ l.value ? (a(), m(e(_), {
64
60
  key: 0,
65
61
  size: "small"
66
- })) : (a(), m(e(z), G(
62
+ })) : (a(), m(e(N), U(
67
63
  { key: 1 },
68
- e(w)(t, [
64
+ e(z)(t, [
69
65
  "value",
70
66
  "onUpdate:value",
71
67
  "options",
@@ -73,11 +69,10 @@ const $ = /* @__PURE__ */ V({
73
69
  "vertical"
74
70
  ]),
75
71
  {
76
- ref_key: "radioGroupRef",
77
- ref: l,
78
- value: e(u),
79
- options: e(r),
80
- class: [e(k)(), o.vertical ? e(b)("vertical") : null, e(x)],
72
+ ref: "radioGroupRef",
73
+ value: e(r),
74
+ options: e(n),
75
+ class: [e(k)(), o.vertical ? e(x)("vertical") : null, e(b)],
81
76
  "onUpdate:value": e(g)
82
77
  }
83
78
  ), null, 16, ["value", "options", "class", "onUpdate:value"]))
@@ -85,5 +80,5 @@ const $ = /* @__PURE__ */ V({
85
80
  }
86
81
  });
87
82
  export {
88
- $ as default
83
+ X as default
89
84
  };
@@ -270,8 +270,8 @@ declare function __VLS_template(): {
270
270
  };
271
271
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
272
272
  declare const __VLS_component: DefineComponent<ApFieldRateProps, {
273
- focus: () => void;
274
273
  blur: () => void;
274
+ focus: () => void;
275
275
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
276
276
  "update:value": (...args: any[]) => void;
277
277
  }, string, PublicProps, Readonly<ApFieldRateProps> & Readonly<{
@@ -17,8 +17,8 @@ declare function __VLS_template(): {
17
17
  };
18
18
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
19
  declare const __VLS_component: DefineComponent<ApFieldSecondProps, {
20
- focus: () => void;
21
20
  blur: () => void;
21
+ focus: () => void;
22
22
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
23
  "update:value": (...args: any[]) => void;
24
24
  }, string, PublicProps, Readonly<ApFieldSecondProps> & Readonly<{
@@ -322,7 +322,7 @@ declare function __VLS_template(): {
322
322
  };
323
323
  animation: StringConstructor;
324
324
  direction: {
325
- type: ** @type { [typeof __VLS_components.Select, typeof __VLS_components.Select, ] } */).PropType<"rtl" | "ltr">;
325
+ type: PropType<"rtl" | "ltr">;
326
326
  };
327
327
  disabled: {
328
328
  type: BooleanConstructor;
@@ -454,8 +454,8 @@ declare function __VLS_template(): {
454
454
  };
455
455
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
456
456
  declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
457
- focus: () => void;
458
457
  blur: () => void;
458
+ focus: () => void;
459
459
  request: (clear?: boolean) => Promise<void>;
460
460
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
461
461
  "update:value": (...args: any[]) => void;
@@ -468,7 +468,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
468
468
  disabled: boolean;
469
469
  virtual: boolean;
470
470
  autofocus: boolean;
471
- lazy: boolean;
471
+ lazy: boolean | "first-focus";
472
472
  loading: boolean;
473
473
  bordered: boolean;
474
474
  allowClear: boolean;
@@ -481,6 +481,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
481
481
  emptyText: string;
482
482
  searchMode: "filter" | "request";
483
483
  refetchOnFocus: boolean;
484
+ fetchOnFocus: boolean;
484
485
  addAll: boolean | number;
485
486
  searchDelay: number;
486
487
  allowOnlySelect: boolean;
@@ -782,7 +783,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
782
783
  };
783
784
  animation: StringConstructor;
784
785
  direction: {
785
- type: ** @type { [typeof __VLS_components.Select, typeof __VLS_components.Select, ] } */).PropType<"rtl" | "ltr">;
786
+ type: PropType<"rtl" | "ltr">;
786
787
  };
787
788
  disabled: {
788
789
  type: BooleanConstructor;