@aplus-frontend/ui 7.17.4 → 7.18.1

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 (105) hide show
  1. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +1 -1
  2. package/es/src/ag-grid/index.vue.mjs +1 -1
  3. package/es/src/ap-field/cascader/index.vue.mjs +9 -8
  4. package/es/src/ap-field/cascader/read.vue2.mjs +3 -2
  5. package/es/src/ap-field/checkbox/index.vue.mjs +12 -11
  6. package/es/src/ap-field/checkbox/read.vue2.mjs +5 -4
  7. package/es/src/ap-field/date/index.vue.mjs +83 -73
  8. package/es/src/ap-field/date/read.vue2.mjs +1 -0
  9. package/es/src/ap-field/date-range/index.vue.mjs +80 -70
  10. package/es/src/ap-field/date-range/read.vue2.mjs +3 -2
  11. package/es/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
  12. package/es/src/ap-field/hooks/use-read-mode-render.mjs +6 -0
  13. package/es/src/ap-field/interface.d.ts +8 -0
  14. package/es/src/ap-field/number/index.vue.mjs +57 -46
  15. package/es/src/ap-field/number/read.vue2.mjs +1 -0
  16. package/es/src/ap-field/radio/index.vue.mjs +17 -16
  17. package/es/src/ap-field/radio/read.vue2.mjs +1 -0
  18. package/es/src/ap-field/rate/index.vue.mjs +6 -5
  19. package/es/src/ap-field/second/index.vue.mjs +35 -20
  20. package/es/src/ap-field/second/read.vue2.mjs +1 -0
  21. package/es/src/ap-field/segmented/index.vue.mjs +15 -14
  22. package/es/src/ap-field/select/index.vue.mjs +53 -52
  23. package/es/src/ap-field/select/read.vue2.mjs +1 -0
  24. package/es/src/ap-field/slider/index.vue.mjs +11 -10
  25. package/es/src/ap-field/switch/index.vue.mjs +20 -19
  26. package/es/src/ap-field/switch/read.vue2.mjs +5 -4
  27. package/es/src/ap-field/text/index.vue2.mjs +35 -31
  28. package/es/src/ap-field/text/password.vue.d.ts +4 -4
  29. package/es/src/ap-field/text/password.vue.mjs +57 -48
  30. package/es/src/ap-field/text/read-password.vue2.mjs +6 -5
  31. package/es/src/ap-field/text/read.vue2.mjs +3 -2
  32. package/es/src/ap-field/text-area/index.vue.mjs +46 -36
  33. package/es/src/ap-field/text-area/read.vue2.mjs +1 -0
  34. package/es/src/ap-field/tree-select/index.vue.mjs +9 -8
  35. package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
  36. package/es/src/ap-form/items/cascader/index.vue.d.ts +3 -1
  37. package/es/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
  38. package/es/src/ap-form/items/date/index.vue.d.ts +3 -1
  39. package/es/src/ap-form/items/date-range/index.vue.d.ts +3 -1
  40. package/es/src/ap-form/items/number/index.vue.d.ts +3 -1
  41. package/es/src/ap-form/items/select/index.vue.d.ts +3 -1
  42. package/es/src/ap-form/items/switch/index.vue.d.ts +3 -1
  43. package/es/src/ap-form/items/text/index.vue.d.ts +3 -1
  44. package/es/src/ap-form/items/text/password.vue.d.ts +3 -1
  45. package/es/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
  46. package/es/src/ap-table/constants.d.ts +11 -1
  47. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  48. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +110 -99
  49. package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
  50. package/es/src/business/batch-input-group/index.vue.mjs +11 -10
  51. package/es/src/version.d.ts +1 -1
  52. package/es/src/version.mjs +1 -1
  53. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  54. package/lib/src/ag-grid/index.vue.js +1 -1
  55. package/lib/src/ap-field/cascader/index.vue.js +1 -1
  56. package/lib/src/ap-field/cascader/read.vue2.js +1 -1
  57. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  58. package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
  59. package/lib/src/ap-field/date/index.vue.js +1 -1
  60. package/lib/src/ap-field/date/read.vue2.js +1 -1
  61. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  62. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  63. package/lib/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
  64. package/lib/src/ap-field/hooks/use-read-mode-render.js +1 -0
  65. package/lib/src/ap-field/interface.d.ts +8 -0
  66. package/lib/src/ap-field/number/index.vue.js +1 -1
  67. package/lib/src/ap-field/number/read.vue2.js +1 -1
  68. package/lib/src/ap-field/radio/index.vue.js +1 -1
  69. package/lib/src/ap-field/radio/read.vue2.js +1 -1
  70. package/lib/src/ap-field/rate/index.vue.js +1 -1
  71. package/lib/src/ap-field/second/index.vue.js +1 -1
  72. package/lib/src/ap-field/second/read.vue2.js +1 -1
  73. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  74. package/lib/src/ap-field/select/index.vue.js +1 -1
  75. package/lib/src/ap-field/select/read.vue2.js +1 -1
  76. package/lib/src/ap-field/slider/index.vue.js +1 -1
  77. package/lib/src/ap-field/switch/index.vue.js +1 -1
  78. package/lib/src/ap-field/switch/read.vue2.js +1 -1
  79. package/lib/src/ap-field/text/index.vue2.js +1 -1
  80. package/lib/src/ap-field/text/password.vue.d.ts +4 -4
  81. package/lib/src/ap-field/text/password.vue.js +1 -1
  82. package/lib/src/ap-field/text/read-password.vue2.js +1 -1
  83. package/lib/src/ap-field/text/read.vue2.js +1 -1
  84. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  85. package/lib/src/ap-field/text-area/read.vue2.js +1 -1
  86. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  87. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  88. package/lib/src/ap-form/items/cascader/index.vue.d.ts +3 -1
  89. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
  90. package/lib/src/ap-form/items/date/index.vue.d.ts +3 -1
  91. package/lib/src/ap-form/items/date-range/index.vue.d.ts +3 -1
  92. package/lib/src/ap-form/items/number/index.vue.d.ts +3 -1
  93. package/lib/src/ap-form/items/select/index.vue.d.ts +3 -1
  94. package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -1
  95. package/lib/src/ap-form/items/text/index.vue.d.ts +3 -1
  96. package/lib/src/ap-form/items/text/password.vue.d.ts +3 -1
  97. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
  98. package/lib/src/ap-table/constants.d.ts +11 -1
  99. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  100. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  101. package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
  102. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  103. package/lib/src/version.d.ts +1 -1
  104. package/lib/src/version.js +1 -1
  105. package/package.json +1 -1
@@ -1,18 +1,23 @@
1
- import { defineComponent as $, 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 T, 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
- import { getTimeFormatToZone as M } from "@aplus-frontend/utils";
1
+ import { defineComponent as q, useSlots as J, ref as Q, computed as s, unref as t, isVNode as X, createVNode as O, Fragment as k, createBlock as h, openBlock as u, withCtx as g, createElementBlock as R, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as ee, normalizeStyle as oe, createCommentVNode as te, isRef as ne, renderList as M, mergeProps as ae, createSlots as re, renderSlot as le, normalizeProps as ue, guardReactiveProps as de } from "vue";
2
+ import { SwapRightOutlined as ie } from "@ant-design/icons-vue";
3
+ import { InputGroup as se, Select as fe, SelectOption as pe, DatePicker as me } from "@aplus-frontend/antdv";
4
+ import { getTimeFormatToZone as w } from "@aplus-frontend/utils";
5
5
  import d from "dayjs";
6
- import { isNil as R, omit as A, isString as c, isFunction as me } from "lodash-unified";
6
+ import { isNil as T, omit as _, isString as m, isFunction as ce } from "lodash-unified";
7
+ import "../../render/index.mjs";
7
8
  import "../../hooks/index.mjs";
8
- import { omitUndefined as ce } from "../../utils/index.mjs";
9
- import { ApFieldDatePresetFormats as ye, PRESET_FORMAT_MAP as _, 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__ */ $({
9
+ import { omitUndefined as ye } from "../../utils/index.mjs";
10
+ import { ApFieldDatePresetFormats as ve, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as he, PRESET_FORMAT_TIME_MAP as ge } from "../date/constant.mjs";
11
+ import { formatDayWithTimezone as ke } from "../date/helper.mjs";
12
+ import { useDateTimezone as Se } from "../hooks/use-date-timezone.mjs";
13
+ import { useDefaultPlaceholder as Ce } from "../hooks/use-default-placeholder.mjs";
14
+ import { useDefaultPresets as Pe } from "../hooks/use-default-presets.mjs";
15
+ import { useReadModeRender as Be } from "../hooks/use-read-mode-render.mjs";
16
+ import { useControllableValue as Oe } from "../../hooks/useControllableValue.mjs";
17
+ import Re from "../../render/render.mjs";
18
+ const De = {
19
+ key: 0
20
+ }, We = /* @__PURE__ */ q({
16
21
  name: "ApFieldDateRange",
17
22
  __name: "index",
18
23
  props: {
@@ -24,6 +29,7 @@ const Ee = /* @__PURE__ */ $({
24
29
  emptyText: {
25
30
  default: "--"
26
31
  },
32
+ customReadMode: {},
27
33
  id: {},
28
34
  defaultPickerValue: {},
29
35
  placeholder: {},
@@ -165,115 +171,119 @@ const Ee = /* @__PURE__ */ $({
165
171
  expose: x,
166
172
  emit: z
167
173
  }) {
168
- const o = F, N = z, b = q(), B = J(), i = s(() => ye.indexOf(o.format) > -1), y = s(() => i.value ? _[o.format] : o.format), {
169
- value: v,
170
- updateValue: w
171
- } = Pe(o, N), E = s(() => o.shownFormat ? o.shownFormat : i.value ? _[o.format] : o.format), V = Se("DateRange", o), {
174
+ const o = F, N = z, D = J(), P = Q(), i = s(() => ve.indexOf(o.format) > -1), c = s(() => i.value ? A[o.format] : o.format), {
175
+ value: y,
176
+ updateValue: b
177
+ } = Oe(o, N), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Ce("DateRange", o), {
172
178
  currentTimezone: l
173
- } = ke(o), {
179
+ } = Se(o), {
174
180
  presets: j,
175
181
  changeCurrentDate: I
176
- } = Ce({
182
+ } = Pe({
177
183
  ...o,
178
184
  timezone: l
179
- }), f = (e, a, n = !0) => ge(l.value)(e, a, n), h = s(() => {
180
- const e = t(v);
181
- if (R(e) || !e?.length)
185
+ }), f = (e, a, n = !0) => ke(l.value)(e, a, n), v = s(() => {
186
+ const e = t(y);
187
+ if (T(e) || !e?.length)
182
188
  return e;
183
- const a = l.value ? M(t(v)[0], l.value) : t(v)?.[0], n = o.timezone ? M(t(v)[1], l.value) : t(v)?.[1];
189
+ const a = l.value ? w(t(y)[0], l.value) : t(y)?.[0], n = o.timezone ? w(t(y)[1], l.value) : t(y)?.[1];
184
190
  return [d(a), d(n)];
185
- }), U = s(() => t(i) ? o.picker ?? ve[o.format] : o.picker), H = s(() => {
186
- const e = t(i) ? he[o.format] : {};
191
+ }), {
192
+ renderer: U
193
+ } = Be(o, v), H = s(() => t(i) ? o.picker ?? he[o.format] : o.picker), K = s(() => {
194
+ const e = t(i) ? ge[o.format] : {};
187
195
  return {
188
- ...ce(A(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
196
+ ...ye(_(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
189
197
  placeholder: t(V),
190
198
  presets: t(j),
191
199
  ...e
192
200
  };
193
201
  });
194
- function K(e) {
202
+ function W(e) {
195
203
  if (!e) {
196
- w(e);
204
+ b(e);
197
205
  return;
198
206
  }
199
- let a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1];
200
- const r = t(i) ? t(y) : void 0;
201
- w([f(a, r), f(n, r, !1)]);
202
- }
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]);
207
+ let a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1];
208
+ const r = t(i) ? t(c) : void 0;
209
+ b([f(a, r), f(n, r, !1)]);
206
210
  }
207
211
  function G(e) {
212
+ const a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(c) : void 0, p = e[0] ? f(a, r) : null, B = e[1] ? f(n, r, !1) : null;
213
+ o.onOk?.([p, B]);
214
+ }
215
+ function L(e) {
208
216
  e && I(), o.onOpenChange?.(e);
209
217
  }
210
- function L(e, a) {
211
- if (R(e)) {
218
+ function Y(e, a) {
219
+ if (T(e)) {
212
220
  o.onChange?.(e, a);
213
221
  return;
214
222
  }
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, Z = e[1] ? f(r, p, !1) : null;
216
- o.onChange?.([O, Z], a);
223
+ const n = m(e[0]) ? d(e[0]) : e[0], r = m(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(c) : void 0, B = e[0] ? f(n, p) : null, $ = e[1] ? f(r, p, !1) : null;
224
+ o.onChange?.([B, $], a);
217
225
  }
218
- const Y = s(() => {
226
+ const Z = s(() => {
219
227
  const e = o.readModeSeparator;
220
228
  if (e)
221
- return Q(e) || me(e) ? o.readModeSeparator : D(m, null, [o.readModeSeparator]);
222
- const a = b.readModeSeparator?.();
223
- return a ? D(m, null, [a]) : de;
229
+ return X(e) || ce(e) ? o.readModeSeparator : O(k, null, [o.readModeSeparator]);
230
+ const a = D.readModeSeparator?.();
231
+ return a ? O(k, null, [a]) : ie;
224
232
  });
225
233
  return x({
226
- focus: B.value?.focus(),
227
- blur: B.value?.blur()
228
- }), (e, a) => e.mode === "read" ? (u(), g(m, {
229
- key: 0
230
- }, [h.value ? (u(), g(m, {
231
- key: 0
232
- }, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(X(Y.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
233
- key: 1
234
- }, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(ie), {
234
+ focus: P.value?.focus(),
235
+ blur: P.value?.blur()
236
+ }), (e, a) => e.mode === "read" ? (u(), h(t(Re), {
237
+ key: 0,
238
+ renderer: t(U)
239
+ }, {
240
+ default: g(() => [v.value ? (u(), R("span", De, [S(C(v.value[0]?.format(c.value)) + " ", 1), (u(), h(ee(Z.value))), S(" " + C(v.value[1]?.format(c.value)), 1)])) : (u(), R(k, {
241
+ key: 1
242
+ }, [S(C(e.emptyText), 1)], 64))]),
243
+ _: 1
244
+ }, 8, ["renderer"])) : (u(), h(t(se), {
235
245
  key: 1,
236
246
  compact: "",
237
- style: ee({
247
+ style: oe({
238
248
  display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
239
249
  })
240
250
  }, {
241
- default: P(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), k(t(se), {
251
+ default: g(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), h(t(fe), {
242
252
  key: 0,
243
253
  value: t(l),
244
- "onUpdate:value": a[0] || (a[0] = (n) => te(l) ? l.value = n : null),
254
+ "onUpdate:value": a[0] || (a[0] = (n) => ne(l) ? l.value = n : null),
245
255
  "default-active-first-option": "",
246
256
  "dropdown-match-select-width": !1
247
257
  }, {
248
- default: P(() => [(u(!0), g(m, null, T(o.timezone, (n) => (u(), k(t(fe), {
258
+ default: g(() => [(u(!0), R(k, null, M(o.timezone, (n) => (u(), h(t(pe), {
249
259
  key: n?.value,
250
260
  value: n?.value
251
261
  }, {
252
- default: P(() => [S(C(n?.label ?? n?.value), 1)]),
262
+ default: g(() => [S(C(n?.label ?? n?.value), 1)]),
253
263
  _: 2
254
264
  }, 1032, ["value"]))), 128))]),
255
265
  _: 1
256
- }, 8, ["value"])) : oe("", !0), D(t(pe).RangePicker, ne({
266
+ }, 8, ["value"])) : te("", !0), O(t(me).RangePicker, ae({
257
267
  ref_key: "rangePickerRef",
258
- ref: B
259
- }, H.value, {
260
- value: h.value,
261
- picker: U.value,
268
+ ref: P
269
+ }, K.value, {
270
+ value: v.value,
271
+ picker: H.value,
262
272
  format: E.value,
263
- "onUpdate:value": K,
264
- onChange: L,
265
- onOk: W,
266
- onOpenChange: G
267
- }), ae({
273
+ "onUpdate:value": W,
274
+ onChange: Y,
275
+ onOk: G,
276
+ onOpenChange: L
277
+ }), re({
268
278
  _: 2
269
- }, [T(t(A)(b, "readModeSeparator"), (n, r) => ({
279
+ }, [M(t(_)(D, "readModeSeparator"), (n, r) => ({
270
280
  name: r,
271
- fn: P((p) => [re(e.$slots, r, le(ue(p || {})))])
281
+ fn: g((p) => [le(e.$slots, r, ue(de(p || {})))])
272
282
  }))]), 1040, ["value", "picker", "format"])]),
273
283
  _: 3
274
284
  }, 8, ["style"]));
275
285
  }
276
286
  });
277
287
  export {
278
- Ee as default
288
+ We as default
279
289
  };
@@ -4,7 +4,7 @@ import c from "dayjs";
4
4
  import { isNil as g } from "lodash-unified";
5
5
  import { ApFieldDatePresetFormats as w, PRESET_FORMAT_MAP as C } from "../date/constant.mjs";
6
6
  import { useDateTimezone as O } from "../hooks/use-date-timezone.mjs";
7
- const M = /* @__PURE__ */ v({
7
+ const F = /* @__PURE__ */ v({
8
8
  name: "ApFieldDateRangeRead",
9
9
  __name: "read",
10
10
  props: {
@@ -12,6 +12,7 @@ const M = /* @__PURE__ */ v({
12
12
  class: {},
13
13
  style: {},
14
14
  emptyText: { default: "--" },
15
+ customReadMode: {},
15
16
  id: {},
16
17
  defaultPickerValue: {},
17
18
  placeholder: {},
@@ -116,5 +117,5 @@ const M = /* @__PURE__ */ v({
116
117
  }
117
118
  });
118
119
  export {
119
- M as default
120
+ F as default
120
121
  };
@@ -0,0 +1,9 @@
1
+ import { Ref, VNode, RendererNode, RendererElement } from 'vue';
2
+ import { BasicApFieldProps } from '../interface';
3
+ export declare const useReadModeRender: (props: BasicApFieldProps<object>, val: Ref<any>) => {
4
+ renderer: (children: VNode[]) => VNode< RendererNode, RendererElement, {
5
+ [key: string]: any;
6
+ }> | VNode< RendererNode, RendererElement, {
7
+ [key: string]: any;
8
+ }>[];
9
+ };
@@ -0,0 +1,6 @@
1
+ const o = (r, d) => ({
2
+ renderer: (e) => r.customReadMode?.(e, d.value) ?? e
3
+ });
4
+ export {
5
+ o as useReadModeRender
6
+ };
@@ -7,6 +7,7 @@ import { SharedTimeProps } from '@aplus-frontend/antdv/es/vc-picker/panels/TimeP
7
7
  import { LegacyDataNode } from '@aplus-frontend/antdv/es/vc-tree-select/interface';
8
8
  import { ZoneAlias } from '@aplus-frontend/utils';
9
9
  import { Dayjs } from 'dayjs';
10
+ import { VNode } from 'vue';
10
11
  import { LiteralUnion, Recordable } from '../type';
11
12
  import { ApFormatPresetType } from './date/interface';
12
13
  import { InputPasswordProps } from './text/input-password-props';
@@ -21,6 +22,13 @@ export type BasicApFieldProps<FieldPropsType = any> = {
21
22
  class?: unknown;
22
23
  style?: unknown;
23
24
  emptyText?: string;
25
+ /**
26
+ * 自定义渲染只读模式(仅输入类型控件支持)
27
+ * @param originalNode 默认渲染的节点
28
+ * @param val 将要渲染的文本
29
+ * @returns
30
+ */
31
+ customReadMode?: (originalNode: any, val?: any) => VNode;
24
32
  } & FieldPropsType;
25
33
  export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
26
34
  /**
@@ -1,15 +1,18 @@
1
- import { defineComponent as D, useSlots as R, computed as m, shallowRef as V, unref as t, createElementBlock as s, createBlock as I, openBlock as l, normalizeClass as i, createCommentVNode as f, createElementVNode as M, renderSlot as u, toDisplayString as $, mergeProps as A, createSlots as U, renderList as z, withCtx as E, normalizeProps as T, guardReactiveProps as w } from "vue";
1
+ import { defineComponent as I, useSlots as $, computed as m, shallowRef as A, unref as t, createBlock as f, openBlock as r, withCtx as c, createElementVNode as y, normalizeClass as s, createElementBlock as v, createCommentVNode as h, renderSlot as i, toDisplayString as U, mergeProps as z, createSlots as E, renderList as T, normalizeProps as _, guardReactiveProps as w } from "vue";
2
2
  import { InputNumber as F } from "@aplus-frontend/antdv";
3
3
  import { omit as O, isNil as W } from "lodash-unified";
4
- import { roundWith as _, toDecimalMark as L } from "../../utils/format.mjs";
4
+ import "../../render/index.mjs";
5
+ import { roundWith as L, toDecimalMark as Z } from "../../utils/format.mjs";
5
6
  import "../../config-provider/index.mjs";
6
7
  import "../../hooks/index.mjs";
7
- import { useDefaultPlaceholder as Z } from "../hooks/use-default-placeholder.mjs";
8
- import j from "../style/index.mjs";
9
- import { addZeroToDecimalPlaces as q } from "./helper.mjs";
10
- import { useNamespace as G } from "../../config-provider/hooks/use-namespace.mjs";
11
- import { useControllableValue as H } from "../../hooks/useControllableValue.mjs";
12
- const se = /* @__PURE__ */ D({
8
+ import { useDefaultPlaceholder as j } from "../hooks/use-default-placeholder.mjs";
9
+ import { useReadModeRender as q } from "../hooks/use-read-mode-render.mjs";
10
+ import G from "../style/index.mjs";
11
+ import { addZeroToDecimalPlaces as H } from "./helper.mjs";
12
+ import { useNamespace as J } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useControllableValue as K } from "../../hooks/useControllableValue.mjs";
14
+ import Q from "../../render/render.mjs";
15
+ const fe = /* @__PURE__ */ I({
13
16
  name: "ApFieldNumber",
14
17
  __name: "index",
15
18
  props: {
@@ -17,6 +20,7 @@ const se = /* @__PURE__ */ D({
17
20
  class: {},
18
21
  style: {},
19
22
  emptyText: { default: "--" },
23
+ customReadMode: {},
20
24
  size: {},
21
25
  bordered: { type: Boolean, default: !0 },
22
26
  placeholder: {},
@@ -61,60 +65,67 @@ const se = /* @__PURE__ */ D({
61
65
  limitDecimalsRetain: { type: Boolean }
62
66
  },
63
67
  emits: ["update:value"],
64
- setup(c, { expose: y, emit: v }) {
65
- const h = v, B = R(), { b: r } = G("field-number"), b = j("field"), o = c, g = m(
68
+ setup(B, { expose: b, emit: g }) {
69
+ const k = g, R = $(), { b: l } = J("field-number"), S = G("field"), o = B, x = m(
66
70
  () => O(o, ["value", "onUpdate:value", "mode"])
67
- ), n = V(), { value: p, updateValue: k } = H(
71
+ ), n = A(), { value: u, updateValue: C } = K(
68
72
  o,
69
- h
70
- ), S = Z("Number", o), x = m(() => {
71
- let e = t(p);
73
+ k
74
+ ), M = j("Number", o), d = m(() => {
75
+ let e = t(u);
72
76
  if (W(e))
73
77
  return o.emptyText;
74
- o.precision && (e = _(e, o.precision));
75
- let a = o.thousands ? L(e) : String(e);
76
- return o.precision && o.limitDecimalsRetain && (a = q(a, o.precision)), a;
77
- });
78
- function C() {
78
+ o.precision && (e = L(e, o.precision));
79
+ let a = o.thousands ? Z(e) : String(e);
80
+ return o.precision && o.limitDecimalsRetain && (a = H(a, o.precision)), a;
81
+ }), { renderer: N } = q(o, d);
82
+ function P() {
79
83
  n.value?.focus();
80
84
  }
81
- function N() {
85
+ function D() {
82
86
  n.value?.blur();
83
87
  }
84
- return y({ focus: C, blur: N }), (e, a) => e.mode === "read" ? (l(), s("span", {
88
+ return b({ focus: P, blur: D }), (e, a) => e.mode === "read" ? (r(), f(t(Q), {
85
89
  key: 0,
86
- class: i([t(r)(), t(b)])
87
- }, [
88
- e.$slots.prefix ? (l(), s("span", {
89
- key: 0,
90
- class: i(t(r)("label-left"))
91
- }, [
92
- u(e.$slots, "prefix")
93
- ], 2)) : f("", !0),
94
- M("span", null, $(x.value), 1),
95
- e.$slots.addonAfter ? (l(), s("span", {
96
- key: 1,
97
- class: i(t(r)("label-right"))
98
- }, [
99
- u(e.$slots, "addonAfter")
100
- ], 2)) : f("", !0)
101
- ], 2)) : (l(), I(t(F), A({ key: 1 }, g.value, {
90
+ renderer: t(N)
91
+ }, {
92
+ default: c(() => [
93
+ y("span", {
94
+ class: s([t(l)(), t(S)])
95
+ }, [
96
+ e.$slots.prefix ? (r(), v("span", {
97
+ key: 0,
98
+ class: s(t(l)("label-left"))
99
+ }, [
100
+ i(e.$slots, "prefix")
101
+ ], 2)) : h("", !0),
102
+ y("span", null, U(d.value), 1),
103
+ e.$slots.addonAfter ? (r(), v("span", {
104
+ key: 1,
105
+ class: s(t(l)("label-right"))
106
+ }, [
107
+ i(e.$slots, "addonAfter")
108
+ ], 2)) : h("", !0)
109
+ ], 2)
110
+ ]),
111
+ _: 3
112
+ }, 8, ["renderer"])) : (r(), f(t(F), z({ key: 1 }, x.value, {
102
113
  ref_key: "inputRef",
103
114
  ref: n,
104
- placeholder: t(S),
105
- value: t(p),
115
+ placeholder: t(M),
116
+ value: t(u),
106
117
  mode: e.inputMode,
107
- "onUpdate:value": t(k)
108
- }), U({ _: 2 }, [
109
- z(B, (J, d) => ({
110
- name: d,
111
- fn: E((P) => [
112
- u(e.$slots, d, T(w(P || {})))
118
+ "onUpdate:value": t(C)
119
+ }), E({ _: 2 }, [
120
+ T(R, (X, p) => ({
121
+ name: p,
122
+ fn: c((V) => [
123
+ i(e.$slots, p, _(w(V || {})))
113
124
  ])
114
125
  }))
115
126
  ]), 1040, ["placeholder", "value", "mode", "onUpdate:value"]));
116
127
  }
117
128
  });
118
129
  export {
119
- se as default
130
+ fe as default
120
131
  };
@@ -16,6 +16,7 @@ const h = {
16
16
  class: {},
17
17
  style: {},
18
18
  emptyText: { default: "--" },
19
+ customReadMode: {},
19
20
  size: {},
20
21
  bordered: { type: Boolean },
21
22
  placeholder: {},
@@ -1,13 +1,13 @@
1
- import { defineComponent as V, computed as p, ref as C, onMounted as O, unref as e, createElementBlock as u, openBlock as a, Fragment as m, createTextVNode as S, toDisplayString as U, createBlock as d, mergeProps as _ } from "vue";
2
- import { Spin as N, RadioGroup as R } from "@aplus-frontend/antdv";
1
+ import { defineComponent as V, computed as u, ref as C, onMounted as O, unref as e, createElementBlock as p, openBlock as a, Fragment as m, createTextVNode as R, toDisplayString as S, createBlock as d, mergeProps as U } from "vue";
2
+ import { Spin as _, RadioGroup as N } from "@aplus-frontend/antdv";
3
3
  import { omit as z, isNil as F } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
6
  import G from "../hooks/use-options.mjs";
7
- import P 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";
7
+ import M from "../style/index.mjs";
8
+ import { getOptionValue as P, getOptionLabel as A } from "./helper.mjs";
9
+ import { useControllableValue as D } from "../../hooks/useControllableValue.mjs";
10
+ import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
11
11
  const Y = /* @__PURE__ */ V({
12
12
  name: "ApFieldRadio",
13
13
  __name: "index",
@@ -16,6 +16,7 @@ const Y = /* @__PURE__ */ V({
16
16
  class: {},
17
17
  style: {},
18
18
  emptyText: { default: "--" },
19
+ customReadMode: {},
19
20
  prefixCls: {},
20
21
  value: {},
21
22
  size: {},
@@ -33,9 +34,9 @@ const Y = /* @__PURE__ */ V({
33
34
  },
34
35
  emits: ["update:value"],
35
36
  setup(c, { expose: f, emit: v }) {
36
- const t = c, y = p(
37
+ const t = c, y = u(
37
38
  () => z(t, ["value", "onUpdate:value", "options", "request", "vertical"])
38
- ), g = v, { options: n, updateOptions: k } = G(t), { value: r, updateValue: x } = E(t, g), { b, m: B } = I("field-radio"), T = P("field"), l = C(!1);
39
+ ), g = v, { options: n, updateOptions: k } = G(t), { value: r, updateValue: x } = D(t, g), { b, m: B } = E("field-radio"), T = M("field"), l = C(!1);
39
40
  async function s() {
40
41
  t.request && (l.value = !0, t.request?.().then((o) => k(o)).finally(() => {
41
42
  l.value = !1;
@@ -44,24 +45,24 @@ const Y = /* @__PURE__ */ V({
44
45
  O(() => {
45
46
  s();
46
47
  });
47
- const h = p(() => {
48
+ const h = u(() => {
48
49
  const o = e(r);
49
50
  if (F(o))
50
51
  return t.emptyText;
51
52
  const i = n.value?.find(
52
- (q) => o === A(q)
53
+ (q) => o === P(q)
53
54
  );
54
- return D(i) || t.emptyText;
55
+ return A(i) || t.emptyText;
55
56
  });
56
57
  return f({
57
58
  request: s
58
- }), (o, i) => o.mode === "read" ? (a(), u(m, { key: 0 }, [
59
- S(U(h.value), 1)
60
- ], 64)) : (a(), u(m, { key: 1 }, [
61
- l.value ? (a(), d(e(N), {
59
+ }), (o, i) => o.mode === "read" ? (a(), p(m, { key: 0 }, [
60
+ R(S(h.value), 1)
61
+ ], 64)) : (a(), p(m, { key: 1 }, [
62
+ l.value ? (a(), d(e(_), {
62
63
  key: 0,
63
64
  size: "small"
64
- })) : (a(), d(e(R), _({ key: 1 }, y.value, {
65
+ })) : (a(), d(e(N), U({ key: 1 }, y.value, {
65
66
  ref: "radioGroupRef",
66
67
  value: e(r),
67
68
  options: e(n),
@@ -9,6 +9,7 @@ const y = /* @__PURE__ */ p({
9
9
  class: {},
10
10
  style: {},
11
11
  emptyText: { default: "--" },
12
+ customReadMode: {},
12
13
  prefixCls: {},
13
14
  value: {},
14
15
  size: {},
@@ -1,5 +1,5 @@
1
- import { defineComponent as b, computed as a, shallowRef as y, useSlots as h, createBlock as B, openBlock as C, unref as t, mergeProps as _, createSlots as x, withCtx as k, renderSlot as w } from "vue";
2
- import { Rate as R } from "@aplus-frontend/antdv";
1
+ import { defineComponent as b, computed as a, shallowRef as y, useSlots as h, createBlock as B, openBlock as C, unref as t, mergeProps as _, createSlots as x, withCtx as R, renderSlot as k } from "vue";
2
+ import { Rate as w } from "@aplus-frontend/antdv";
3
3
  import { omit as g } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
5
  import { useControllableValue as V } from "../../hooks/useControllableValue.mjs";
@@ -10,6 +10,7 @@ const A = /* @__PURE__ */ b({
10
10
  mode: { default: "edit" },
11
11
  class: {},
12
12
  style: {},
13
+ customReadMode: {},
13
14
  prefixCls: {},
14
15
  count: { default: 5 },
15
16
  value: {},
@@ -44,7 +45,7 @@ const A = /* @__PURE__ */ b({
44
45
  return r({
45
46
  focus: p,
46
47
  blur: m
47
- }), (v, S) => (C(), B(t(R), _(n.value, {
48
+ }), (v, S) => (C(), B(t(w), _(n.value, {
48
49
  ref_key: "rateRef",
49
50
  ref: o,
50
51
  value: t(c),
@@ -53,8 +54,8 @@ const A = /* @__PURE__ */ b({
53
54
  }), x({ _: 2 }, [
54
55
  d.character ? {
55
56
  name: "character",
56
- fn: k(() => [
57
- w(v.$slots, "character")
57
+ fn: R(() => [
58
+ k(v.$slots, "character")
58
59
  ]),
59
60
  key: "0"
60
61
  } : void 0