@aplus-frontend/ui 7.17.3 → 7.18.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 (103) 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 +183 -180
  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.mjs +109 -98
  48. package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
  49. package/es/src/business/batch-input-group/index.vue.mjs +11 -10
  50. package/es/src/version.d.ts +1 -1
  51. package/es/src/version.mjs +1 -1
  52. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  53. package/lib/src/ag-grid/index.vue.js +1 -1
  54. package/lib/src/ap-field/cascader/index.vue.js +1 -1
  55. package/lib/src/ap-field/cascader/read.vue2.js +1 -1
  56. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  57. package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
  58. package/lib/src/ap-field/date/index.vue.js +1 -1
  59. package/lib/src/ap-field/date/read.vue2.js +1 -1
  60. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  61. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  62. package/lib/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
  63. package/lib/src/ap-field/hooks/use-read-mode-render.js +1 -0
  64. package/lib/src/ap-field/interface.d.ts +8 -0
  65. package/lib/src/ap-field/number/index.vue.js +1 -1
  66. package/lib/src/ap-field/number/read.vue2.js +1 -1
  67. package/lib/src/ap-field/radio/index.vue.js +1 -1
  68. package/lib/src/ap-field/radio/read.vue2.js +1 -1
  69. package/lib/src/ap-field/rate/index.vue.js +1 -1
  70. package/lib/src/ap-field/second/index.vue.js +1 -1
  71. package/lib/src/ap-field/second/read.vue2.js +1 -1
  72. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  73. package/lib/src/ap-field/select/index.vue.js +1 -1
  74. package/lib/src/ap-field/select/read.vue2.js +1 -1
  75. package/lib/src/ap-field/slider/index.vue.js +1 -1
  76. package/lib/src/ap-field/switch/index.vue.js +1 -1
  77. package/lib/src/ap-field/switch/read.vue2.js +1 -1
  78. package/lib/src/ap-field/text/index.vue2.js +1 -1
  79. package/lib/src/ap-field/text/password.vue.d.ts +4 -4
  80. package/lib/src/ap-field/text/password.vue.js +1 -1
  81. package/lib/src/ap-field/text/read-password.vue2.js +1 -1
  82. package/lib/src/ap-field/text/read.vue2.js +1 -1
  83. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  84. package/lib/src/ap-field/text-area/read.vue2.js +1 -1
  85. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  86. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  87. package/lib/src/ap-form/items/cascader/index.vue.d.ts +3 -1
  88. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
  89. package/lib/src/ap-form/items/date/index.vue.d.ts +3 -1
  90. package/lib/src/ap-form/items/date-range/index.vue.d.ts +3 -1
  91. package/lib/src/ap-form/items/number/index.vue.d.ts +3 -1
  92. package/lib/src/ap-form/items/select/index.vue.d.ts +3 -1
  93. package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -1
  94. package/lib/src/ap-form/items/text/index.vue.d.ts +3 -1
  95. package/lib/src/ap-form/items/text/password.vue.d.ts +3 -1
  96. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
  97. package/lib/src/ap-table/constants.d.ts +11 -1
  98. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  99. package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
  100. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  101. package/lib/src/version.d.ts +1 -1
  102. package/lib/src/version.js +1 -1
  103. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { defineComponent as fe, useSlots as me, ref as k, shallowRef as he, computed as s, onMounted as ve, watch as ye, unref as o, createVNode as m, createElementBlock as M, createBlock as C, openBlock as h, toDisplayString as N, mergeProps as ge, h as Ce, createSlots as be, withCtx as v, createElementVNode as x, normalizeClass as y, createCommentVNode as P, resolveDynamicComponent as L, withModifiers as we, renderList as Oe, renderSlot as Se, normalizeProps as Fe, guardReactiveProps as Be } from "vue";
1
+ import { defineComponent as fe, useSlots as me, ref as k, shallowRef as he, computed as s, onMounted as ve, watch as ye, unref as l, createVNode as m, createElementBlock as M, createBlock as C, openBlock as h, toDisplayString as N, mergeProps as ge, h as Ce, createSlots as be, withCtx as v, createElementVNode as x, normalizeClass as y, createCommentVNode as P, resolveDynamicComponent as L, withModifiers as we, renderList as Oe, renderSlot as Se, normalizeProps as Fe, guardReactiveProps as Be } from "vue";
2
2
  import { Select as ke, Flex as T, Checkbox as q, Spin as Ne } from "@aplus-frontend/antdv";
3
- import { debounce as xe, isFunction as z, isArray as Ve, isNil as Ae, omit as R, isNumber as Ie } from "lodash-unified";
3
+ import { debounce as xe, isFunction as R, isArray as Ve, isNil as Ae, omit as z, isNumber as Ie } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../utils/index.mjs";
6
6
  import { useDevWarning as _e } from "../../utils/warning.mjs";
@@ -14,7 +14,7 @@ import { useLocale as Le } from "../../config-provider/hooks/use-locale.mjs";
14
14
  import { useControllableValue as Te } from "../../hooks/useControllableValue.mjs";
15
15
  const qe = {
16
16
  key: 0
17
- }, ze = ["onClick"], et = /* @__PURE__ */ fe({
17
+ }, Re = ["onClick"], et = /* @__PURE__ */ fe({
18
18
  name: "ApFieldSelect",
19
19
  __name: "index",
20
20
  props: {
@@ -26,6 +26,7 @@ const qe = {
26
26
  emptyText: {
27
27
  default: "--"
28
28
  },
29
+ customReadMode: {},
29
30
  defaultValue: {},
30
31
  notFoundContent: {},
31
32
  suffixIcon: {},
@@ -196,16 +197,16 @@ const qe = {
196
197
  } = E("field-select-popup-option"), H = Me("field"), A = k(!1), I = k(!1), {
197
198
  t: _
198
199
  } = Le(), W = xe((t) => {
199
- if (!z(e.request))
200
+ if (!R(e.request))
200
201
  return;
201
202
  r += 1;
202
203
  const n = r;
203
- g([]), u.value = !0, e.request(t).then((l) => {
204
- r === n && (g(l), u.value = !1);
204
+ g([]), u.value = !0, e.request(t).then((o) => {
205
+ r === n && (g(o), u.value = !1);
205
206
  });
206
207
  }, e.searchDelay), G = (t, n) => {
207
- const l = e.fieldNames?.label || "label";
208
- return typeof n?.[l] == "string" && n[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
208
+ const o = e.fieldNames?.label || "label";
209
+ return typeof n?.[o] == "string" && n[o].toLowerCase().indexOf(t.toLowerCase()) > -1;
209
210
  }, {
210
211
  options: p,
211
212
  updateOptions: g
@@ -214,16 +215,16 @@ const qe = {
214
215
  return e.tokenSeparators ? "tags" : "multiple";
215
216
  });
216
217
  async function i(t = !0) {
217
- if (!z(e.request))
218
+ if (!R(e.request))
218
219
  return;
219
220
  u.value = !0, r += 1;
220
221
  const n = r;
221
222
  try {
222
223
  t && g([]);
223
- const l = await e.request(void 0, e.params);
224
+ const o = await e.request(void 0, e.params);
224
225
  if (n !== r)
225
226
  return;
226
- g(l);
227
+ g(o);
227
228
  } finally {
228
229
  u.value = !1;
229
230
  }
@@ -252,15 +253,15 @@ const qe = {
252
253
  value: f,
253
254
  updateValue: S
254
255
  } = Te(e, J), ee = De("Select", e), te = s(() => {
255
- const t = o(f);
256
+ const t = l(f);
256
257
  if (!t)
257
258
  return e.emptyText;
258
- const n = e.fieldNames?.label || "label", l = e.fieldNames?.value || "value";
259
- return Ve(t) ? t.map((a) => o(p).find((pe) => pe[l] === a)?.[n]).filter(Boolean).join("、") || e.emptyText : o(p).find((a) => a[l] === t)?.[n] || e.emptyText;
259
+ const n = e.fieldNames?.label || "label", o = e.fieldNames?.value || "value";
260
+ return Ve(t) ? t.map((a) => l(p).find((pe) => pe[o] === a)?.[n]).filter(Boolean).join("、") || e.emptyText : l(p).find((a) => a[o] === t)?.[n] || e.emptyText;
260
261
  }), ne = s(() => {
261
262
  const t = !!e?.showSearch, n = e.searchMode;
262
- let l = {};
263
- return t && (l = n === "request" ? {
263
+ let o = {};
264
+ return t && (o = n === "request" ? {
264
265
  defaultActiveFirstOption: !1,
265
266
  onSearch: W,
266
267
  notFoundContent: u.value ? void 0 : null,
@@ -269,11 +270,11 @@ const qe = {
269
270
  } : {
270
271
  filterOption: Ae(e?.filterOption) ? G : e?.filterOption
271
272
  }), {
272
- ...R(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
273
- placeholder: o(ee),
274
- ...l
273
+ ...z(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
274
+ placeholder: l(ee),
275
+ ...o
275
276
  };
276
- }), le = s(() => p.value.map((t) => t[e.fieldNames?.value || "value"])), F = s(() => p.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), D = s(() => !e.multiple || V(e.maxCount) ? !1 : Ie(e.addAll) ? le.value.length >= e.addAll : !!e.addAll), oe = s(() => e.multiple && e.allowOnlySelect && (!V(e.maxCount) || e.maxCount >= 1));
277
+ }), oe = s(() => p.value.map((t) => t[e.fieldNames?.value || "value"])), F = s(() => p.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), D = s(() => !e.multiple || V(e.maxCount) ? !1 : Ie(e.addAll) ? oe.value.length >= e.addAll : !!e.addAll), le = s(() => e.multiple && e.allowOnlySelect && (!V(e.maxCount) || e.maxCount >= 1));
277
278
  function ae() {
278
279
  O.value?.focus();
279
280
  }
@@ -281,8 +282,8 @@ const qe = {
281
282
  O.value?.blur();
282
283
  }
283
284
  function B(t, n) {
284
- const l = e.fieldNames?.[n] ?? n;
285
- return l === "groupLabel" ? t[l] ?? t.label : t[l];
285
+ const o = e.fieldNames?.[n] ?? n;
286
+ return o === "groupLabel" ? t[o] ?? t.label : t[o];
286
287
  }
287
288
  function ue(t) {
288
289
  const n = B(t, "value");
@@ -296,14 +297,14 @@ const qe = {
296
297
  }, [B(t, t.options?.length ? "groupLabel" : "label")]);
297
298
  }
298
299
  const ie = s(() => {
299
- const t = o(f) || [], n = F.value;
300
- return n.length > 0 && n.every((l) => t.includes(l));
300
+ const t = l(f) || [], n = F.value;
301
+ return n.length > 0 && n.every((o) => t.includes(o));
301
302
  }), ce = s(() => {
302
- const t = o(f) || [], n = F.value, l = n.filter((c) => t.includes(c)).length;
303
- return l > 0 && l < n.length;
303
+ const t = l(f) || [], n = F.value, o = n.filter((c) => t.includes(c)).length;
304
+ return o > 0 && o < n.length;
304
305
  });
305
306
  function de() {
306
- const t = new Set(o(f) || []), n = F.value;
307
+ const t = new Set(l(f) || []), n = F.value;
307
308
  n.length > 0 && n.every((a) => t.has(a)) ? n.forEach((a) => t.delete(a)) : n.forEach((a) => t.add(a));
308
309
  const c = p.value.filter((a) => t.has(a[e.fieldNames?.value || "value"]));
309
310
  S([...t]), e.onChange?.([...t], c);
@@ -312,71 +313,71 @@ const qe = {
312
313
  focus: ae,
313
314
  blur: se,
314
315
  request: i
315
- }), (t, n) => t.mode === "read" ? (h(), M("span", qe, N(te.value), 1)) : (h(), C(o(ke), ge({
316
+ }), (t, n) => t.mode === "read" ? (h(), M("span", qe, N(te.value), 1)) : (h(), C(l(ke), ge({
316
317
  key: 1,
317
318
  ref_key: "selectRef",
318
319
  ref: O,
319
320
  "allow-clear": ""
320
321
  }, ne.value, {
321
322
  mode: X.value,
322
- value: o(f),
323
- options: o(p),
323
+ value: l(f),
324
+ options: l(p),
324
325
  loading: u.value,
325
326
  "menu-item-selected-icon": Ce("span"),
326
- "popup-class-name": `${o(w)("popup")} ${o(H)}`,
327
- "onUpdate:value": o(S),
327
+ "popup-class-name": `${l(w)("popup")} ${l(H)}`,
328
+ "onUpdate:value": l(S),
328
329
  onFocus: Y,
329
330
  onDropdownVisibleChange: Z
330
331
  }), be({
331
- option: v((l) => [x("div", {
332
- class: y(o(d)("outter"))
333
- }, [m(o(T), {
332
+ option: v((o) => [x("div", {
333
+ class: y(l(d)("outter"))
334
+ }, [m(l(T), {
334
335
  justify: "space-between",
335
336
  align: "center",
336
- class: y(o(d)("wrapper")),
337
+ class: y(l(d)("wrapper")),
337
338
  gap: 8
338
339
  }, {
339
- default: v(() => [m(o(T), {
340
+ default: v(() => [m(l(T), {
340
341
  gap: 8,
341
342
  align: "center",
342
- class: y(o(d)("content-wrapper"))
343
+ class: y(l(d)("content-wrapper"))
343
344
  }, {
344
- default: v(() => [D.value ? (h(), C(o(q), {
345
+ default: v(() => [D.value ? (h(), C(l(q), {
345
346
  key: 0,
346
- checked: o(f)?.includes(B(l, "value"))
347
- }, null, 8, ["checked"])) : P("", !0), (h(), C(L(re(l))))]),
347
+ checked: l(f)?.includes(B(o, "value"))
348
+ }, null, 8, ["checked"])) : P("", !0), (h(), C(L(re(o))))]),
348
349
  _: 2
349
- }, 1032, ["class"]), oe.value && !l?.disabled ? (h(), M("span", {
350
+ }, 1032, ["class"]), le.value && !o?.disabled ? (h(), M("span", {
350
351
  key: 0,
351
- class: y(o(d)("action")),
352
- onClick: we(() => ue(l), ["stop"])
353
- }, N(o(_)("ap.field.chooseOnly")), 11, ze)) : P("", !0)]),
352
+ class: y(l(d)("action")),
353
+ onClick: we(() => ue(o), ["stop"])
354
+ }, N(l(_)("ap.field.chooseOnly")), 11, Re)) : P("", !0)]),
354
355
  _: 2
355
356
  }, 1032, ["class"])], 2)]),
356
357
  _: 2
357
- }, [Oe(o(R)(b, ["option"]), (l, c) => ({
358
+ }, [Oe(l(z)(b, ["option"]), (o, c) => ({
358
359
  name: c,
359
360
  fn: v((a) => [Se(t.$slots, c, Fe(Be(a || {})))])
360
361
  })), u.value ? {
361
362
  name: "notFoundContent",
362
- fn: v(() => [m(o(Ne), {
363
+ fn: v(() => [m(l(Ne), {
363
364
  size: "small"
364
365
  })]),
365
366
  key: "0"
366
367
  } : void 0, D.value ? {
367
368
  name: "dropdownRender",
368
369
  fn: v(({
369
- menuNode: l
370
+ menuNode: o
370
371
  }) => [x("div", {
371
372
  tabindex: -1,
372
- class: y(o(w)("popup-all-option")),
373
+ class: y(l(w)("popup-all-option")),
373
374
  onClick: de
374
- }, [m(o(q), {
375
+ }, [m(l(q), {
375
376
  checked: ie.value,
376
377
  indeterminate: ce.value
377
378
  }, null, 8, ["checked", "indeterminate"]), x("span", {
378
- class: y(o(w)("popup-all-option-label"))
379
- }, N(o(_)("ap.field.selectAll")), 3)], 2), (h(), C(L(l)))]),
379
+ class: y(l(w)("popup-all-option-label"))
380
+ }, N(l(_)("ap.field.selectAll")), 3)], 2), (h(), C(L(o)))]),
380
381
  key: "1"
381
382
  } : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "onUpdate:value"]));
382
383
  }
@@ -8,6 +8,7 @@ const f = { key: 0 }, C = /* @__PURE__ */ i({
8
8
  class: {},
9
9
  style: {},
10
10
  emptyText: { default: "--" },
11
+ customReadMode: {},
11
12
  defaultValue: {},
12
13
  notFoundContent: {},
13
14
  suffixIcon: {},
@@ -1,9 +1,9 @@
1
- import { defineComponent as C, useSlots as b, shallowRef as g, computed as n, unref as t, createElementBlock as k, createBlock as F, openBlock as s, Fragment as S, createTextVNode as h, toDisplayString as P, mergeProps as T, createSlots as V, renderList as _, withCtx as R, renderSlot as N, normalizeProps as U, guardReactiveProps as A } from "vue";
1
+ import { defineComponent as C, useSlots as b, shallowRef as g, computed as n, unref as t, createElementBlock as k, createBlock as F, openBlock as s, Fragment as S, createTextVNode as h, toDisplayString as P, mergeProps as R, createSlots as T, renderList as V, withCtx as _, renderSlot as N, normalizeProps as U, guardReactiveProps as A } from "vue";
2
2
  import { Slider as H } from "@aplus-frontend/antdv";
3
3
  import { omit as L, isNil as $, isArray as w } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
5
  import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
6
- const J = /* @__PURE__ */ C({
6
+ const G = /* @__PURE__ */ C({
7
7
  name: "ApFieldSlider",
8
8
  __name: "index",
9
9
  props: {
@@ -11,6 +11,7 @@ const J = /* @__PURE__ */ C({
11
11
  class: {},
12
12
  style: {},
13
13
  emptyText: { default: "--" },
14
+ customReadMode: {},
14
15
  range: { type: [Boolean, Object] },
15
16
  value: {},
16
17
  defaultValue: {},
@@ -52,8 +53,8 @@ const J = /* @__PURE__ */ C({
52
53
  ariaValueTextFormatterForHandle: {}
53
54
  },
54
55
  emits: ["update:value"],
55
- setup(u, { expose: i, emit: p }) {
56
- const d = b(), o = g(), a = u, m = n(
56
+ setup(u, { expose: i, emit: d }) {
57
+ const p = b(), o = g(), a = u, m = n(
57
58
  () => L(a, [
58
59
  "value",
59
60
  "onUpdate:value",
@@ -61,7 +62,7 @@ const J = /* @__PURE__ */ C({
61
62
  "emptyText",
62
63
  "defaultValue"
63
64
  ])
64
- ), c = p, { value: l, updateValue: f } = j(a, c), y = n(() => {
65
+ ), c = d, { value: l, updateValue: f } = j(a, c), y = n(() => {
65
66
  const e = t(l);
66
67
  return $(e) ? a.emptyText : w(e) ? `${e[0]}-${e[1]}` : e;
67
68
  });
@@ -76,15 +77,15 @@ const J = /* @__PURE__ */ C({
76
77
  blur: B
77
78
  }), (e, q) => e.mode === "read" ? (s(), k(S, { key: 0 }, [
78
79
  h(P(y.value), 1)
79
- ], 64)) : (s(), F(t(H), T({ key: 1 }, m.value, {
80
+ ], 64)) : (s(), F(t(H), R({ key: 1 }, m.value, {
80
81
  ref_key: "sliderRef",
81
82
  ref: o,
82
83
  value: t(l),
83
84
  "onUpdate:value": t(f)
84
- }), V({ _: 2 }, [
85
- _(d, (z, r) => ({
85
+ }), T({ _: 2 }, [
86
+ V(p, (z, r) => ({
86
87
  name: r,
87
- fn: R((x) => [
88
+ fn: _((x) => [
88
89
  N(e.$slots, r, U(A(x || {})))
89
90
  ])
90
91
  }))
@@ -92,5 +93,5 @@ const J = /* @__PURE__ */ C({
92
93
  }
93
94
  });
94
95
  export {
95
- J as default
96
+ G as default
96
97
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as D, useSlots as U, computed as p, ref as b, unref as o, createVNode as d, Fragment as s, createBlock as k, createElementBlock as E, openBlock as f, resolveDynamicComponent as K, mergeProps as C, createSlots as w, renderList as B, withCtx as y, renderSlot as P, normalizeProps as A, guardReactiveProps as _ } from "vue";
2
- import { Switch as S, Popconfirm as L } from "@aplus-frontend/antdv";
3
- import { omit as M, isNil as j, isFunction as q } from "lodash-unified";
1
+ import { defineComponent as D, useSlots as M, computed as p, ref as b, unref as o, createVNode as a, Fragment as s, createBlock as k, createElementBlock as U, openBlock as f, resolveDynamicComponent as E, mergeProps as C, createSlots as w, renderList as B, withCtx as y, renderSlot as P, normalizeProps as A, guardReactiveProps as _ } from "vue";
2
+ import { Switch as S, Popconfirm as K } from "@aplus-frontend/antdv";
3
+ import { omit as L, isNil as j, isFunction as q } from "lodash-unified";
4
4
  import "../../utils/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
6
  import { useControllableValue as G } from "../../hooks/useControllableValue.mjs";
@@ -15,6 +15,7 @@ const Y = /* @__PURE__ */ D({
15
15
  emptyText: {
16
16
  default: "--"
17
17
  },
18
+ customReadMode: {},
18
19
  id: {},
19
20
  prefixCls: {},
20
21
  size: {
@@ -53,23 +54,23 @@ const Y = /* @__PURE__ */ D({
53
54
  emits: ["update:checked"],
54
55
  setup(F, {
55
56
  expose: N,
56
- emit: $
57
+ emit: R
57
58
  }) {
58
- const i = U(), e = F, v = p(() => M(e, ["onUpdate:checked", "emptyText"])), R = $, h = b(), {
59
+ const u = M(), e = F, v = p(() => L(e, ["onUpdate:checked", "emptyText"])), $ = R, h = b(), {
59
60
  value: t,
60
- updateValue: u
61
- } = G(e, R, {
61
+ updateValue: d
62
+ } = G(e, $, {
62
63
  valuePropName: "checked"
63
64
  }), c = b(!1);
64
- async function g(n, a) {
65
+ async function g(n, i) {
65
66
  if (!r(e.confirm)) {
66
67
  if (!r(e.onAction)) {
67
- u(n);
68
+ d(n);
68
69
  return;
69
70
  }
70
71
  c.value = !0;
71
72
  try {
72
- await e.onAction(n, a) && u(n);
73
+ await e.onAction(n, i) && d(n);
73
74
  } finally {
74
75
  c.value = !1;
75
76
  }
@@ -78,21 +79,21 @@ const Y = /* @__PURE__ */ D({
78
79
  async function T() {
79
80
  const n = o(t) === e.checkedValue ? e.unCheckedValue : e.checkedValue;
80
81
  if (!r(e.onAction)) {
81
- u(n);
82
+ d(n);
82
83
  return;
83
84
  }
84
- await e.onAction(n) && u(n);
85
+ await e.onAction(n) && d(n);
85
86
  }
86
87
  const x = p(() => {
87
88
  const n = o(t);
88
- return j(n) ? d(s, null, [e.emptyText]) : n === e.checkedValue ? d(s, null, [e.checkedChildren || i.checkedChildren?.() || `${e.checkedValue}`]) : d(s, null, [e.unCheckedChildren || i.unCheckedChildren?.() || `${e.unCheckedValue}`]);
89
+ return j(n) ? a(s, null, [e.emptyText]) : n === e.checkedValue ? a(s, null, [e.checkedChildren || u.checkedChildren?.() || `${e.checkedValue}`]) : a(s, null, [e.unCheckedChildren || u.unCheckedChildren?.() || `${e.unCheckedValue}`]);
89
90
  }), z = p(() => r(e.confirm) ? q(e.confirm) ? e.confirm(o(t)) : e.confirm : {});
90
91
  return N({
91
92
  focus: () => h.value?.focus(),
92
93
  blur: () => h.value?.blur()
93
- }), (n, a) => n.mode === "read" ? (f(), k(K(x.value), {
94
+ }), (n, i) => n.mode === "read" ? (f(), k(E(x.value), {
94
95
  key: 0
95
- })) : (f(), E(s, {
96
+ })) : (f(), U(s, {
96
97
  key: 1
97
98
  }, [!o(r)(n.confirm) || n.disabled ? (f(), k(o(S), C({
98
99
  key: 0,
@@ -104,22 +105,22 @@ const Y = /* @__PURE__ */ D({
104
105
  onClick: g
105
106
  }), w({
106
107
  _: 2
107
- }, [B(i, (V, l) => ({
108
+ }, [B(u, (V, l) => ({
108
109
  name: l,
109
110
  fn: y((m) => [P(n.$slots, l, A(_(m || {})))])
110
- }))]), 1040, ["checked", "loading"])) : (f(), k(o(L), C({
111
+ }))]), 1040, ["checked", "loading"])) : (f(), k(o(K), C({
111
112
  key: 1,
112
113
  disabled: c.value
113
114
  }, z.value, {
114
115
  onConfirm: T
115
116
  }), {
116
- default: y(() => [d(o(S), C(v.value, {
117
+ default: y(() => [a(o(S), C(v.value, {
117
118
  checked: o(t),
118
119
  loading: n.loading ?? c.value,
119
120
  onClick: g
120
121
  }), w({
121
122
  _: 2
122
- }, [B(i, (V, l) => ({
123
+ }, [B(u, (V, l) => ({
123
124
  name: l,
124
125
  fn: y((m) => [P(n.$slots, l, A(_(m || {})))])
125
126
  }))]), 1040, ["checked", "loading"])]),
@@ -1,4 +1,4 @@
1
- import { defineComponent as u, computed as a, createVNode as d, Fragment as c, createBlock as r, openBlock as i, resolveDynamicComponent as s } from "vue";
1
+ import { defineComponent as u, computed as a, createVNode as d, Fragment as o, createBlock as r, openBlock as i, resolveDynamicComponent as s } from "vue";
2
2
  import { isNil as h } from "lodash-unified";
3
3
  const k = /* @__PURE__ */ u({
4
4
  name: "ApFieldSwitchRead",
@@ -10,6 +10,7 @@ const k = /* @__PURE__ */ u({
10
10
  emptyText: {
11
11
  default: "--"
12
12
  },
13
+ customReadMode: {},
13
14
  id: {},
14
15
  prefixCls: {},
15
16
  size: {
@@ -45,10 +46,10 @@ const k = /* @__PURE__ */ u({
45
46
  onAction: {},
46
47
  confirm: {}
47
48
  },
48
- setup(o) {
49
- const e = o, t = a(() => {
49
+ setup(c) {
50
+ const e = c, t = a(() => {
50
51
  const n = e.checked;
51
- return h(n) ? d(c, null, [e.emptyText]) : n === e.checkedValue ? d(c, null, [e.checkedChildren || `${e.checkedValue}`]) : d(c, null, [e.unCheckedChildren || `${e.unCheckedValue}`]);
52
+ return h(n) ? d(o, null, [e.emptyText]) : n === e.checkedValue ? d(o, null, [e.checkedChildren || `${e.checkedValue}`]) : d(o, null, [e.unCheckedChildren || `${e.unCheckedValue}`]);
52
53
  });
53
54
  return (n, l) => (i(), r(s(t.value)));
54
55
  }
@@ -1,10 +1,10 @@
1
- import { defineComponent as S, useSlots as P, computed as s, createVNode as _, shallowRef as k, createBlock as d, openBlock as i, unref as u, mergeProps as T, createSlots as V, renderList as z, withCtx as U, renderSlot as F, normalizeProps as M, guardReactiveProps as $ } from "vue";
2
- import { Input as A } from "@aplus-frontend/antdv";
3
- import { omit as E } from "lodash-unified";
1
+ import { defineComponent as S, useSlots as P, computed as p, createVNode as V, shallowRef as _, createBlock as d, openBlock as i, unref as u, mergeProps as k, createSlots as M, renderList as T, withCtx as z, renderSlot as U, normalizeProps as F, guardReactiveProps as N } from "vue";
2
+ import { Input as $ } from "@aplus-frontend/antdv";
3
+ import { omit as A } from "lodash-unified";
4
4
  import "../../render/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { useDefaultPlaceholder as K } from "../hooks/use-default-placeholder.mjs";
7
- import { useControllableValue as N } from "../../hooks/useControllableValue.mjs";
6
+ import { useDefaultPlaceholder as E } from "../hooks/use-default-placeholder.mjs";
7
+ import { useControllableValue as K } from "../../hooks/useControllableValue.mjs";
8
8
  import j from "../../render/render.mjs";
9
9
  const W = /* @__PURE__ */ S({
10
10
  name: "ApFieldText",
@@ -18,6 +18,7 @@ const W = /* @__PURE__ */ S({
18
18
  emptyText: {
19
19
  default: "--"
20
20
  },
21
+ customReadMode: {},
21
22
  variant: {},
22
23
  size: {},
23
24
  value: {},
@@ -92,45 +93,48 @@ const W = /* @__PURE__ */ S({
92
93
  beforeInput: {}
93
94
  },
94
95
  emits: ["update:value"],
95
- setup(f, {
96
- expose: c,
96
+ setup(c, {
97
+ expose: f,
97
98
  emit: m
98
99
  }) {
99
- const r = P(), o = f, y = m, {
100
- value: p,
100
+ const r = P(), o = c, y = m, {
101
+ value: s,
101
102
  updateValue: v
102
- } = N(o, y), x = K("Text", o), h = s(() => E(o, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"])), B = () => _("span", null, [o.prefix || r.prefix?.(), p.value || o.emptyText, o.suffix || r.suffix?.()]), t = k(), I = (e) => {
103
- t.value?.focus(e);
103
+ } = K(o, y), x = E("Text", o), h = p(() => A(o, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"])), B = () => {
104
+ const e = s.value || o.emptyText, t = V("span", null, [o.prefix || r.prefix?.(), e, o.suffix || r.suffix?.()]);
105
+ return o.customReadMode?.(e, t) ?? t;
106
+ }, n = _(), g = (e) => {
107
+ n.value?.focus(e);
108
+ }, I = () => {
109
+ n.value?.blur();
110
+ }, R = (e, t, l) => {
111
+ n.value?.setSelectionRange(e, t, l);
104
112
  }, b = () => {
105
- t.value?.blur();
106
- }, g = (e, n, l) => {
107
- t.value?.setSelectionRange(e, n, l);
108
- }, C = () => {
109
- t.value?.select();
113
+ n.value?.select();
110
114
  };
111
- function R(e) {
112
- const n = e.target.value || "", l = o.beforeInput ? o.beforeInput?.(n) : n, a = t.value?.$el?.querySelector("input");
115
+ function C(e) {
116
+ const t = e.target.value || "", l = o.beforeInput ? o.beforeInput?.(t) : t, a = n.value?.$el?.querySelector("input");
113
117
  a && (a.value = l), v(l);
114
118
  }
115
- return c({
116
- focus: I,
117
- blur: b,
118
- setSelectionRange: g,
119
- select: C,
120
- input: s(() => t.value?.input)
121
- }), (e, n) => e.mode === "edit" ? (i(), d(u(A), T({
119
+ return f({
120
+ focus: g,
121
+ blur: I,
122
+ setSelectionRange: R,
123
+ select: b,
124
+ input: p(() => n.value?.input)
125
+ }), (e, t) => e.mode === "edit" ? (i(), d(u($), k({
122
126
  key: 0
123
127
  }, h.value, {
124
128
  ref_key: "inputRef",
125
- ref: t,
129
+ ref: n,
126
130
  placeholder: u(x),
127
- value: u(p),
128
- onInput: R
129
- }), V({
131
+ value: u(s),
132
+ onInput: C
133
+ }), M({
130
134
  _: 2
131
- }, [z(e.$slots, (l, a) => ({
135
+ }, [T(e.$slots, (l, a) => ({
132
136
  name: a,
133
- fn: U((w) => [F(e.$slots, a, M($(w || {})))])
137
+ fn: z((w) => [U(e.$slots, a, F(N(w || {})))])
134
138
  }))]), 1040, ["placeholder", "value"])) : (i(), d(u(j), {
135
139
  key: 1,
136
140
  node: B()
@@ -122,7 +122,7 @@ declare function __VLS_template(): {
122
122
  handleReset: PropType<MouseEventHandler>;
123
123
  addonBefore: VueTypeValidableDef<any>;
124
124
  addonAfter: VueTypeValidableDef<any>;
125
- prefix: VueTypeValidableDef<any>;
125
+ prefix: ** @type { [typeof __VLS_components.Flex, typeof __VLS_components.Flex, ] } */).VueTypeValidableDef<any>;
126
126
  suffix: VueTypeValidableDef<any>;
127
127
  clearIcon: VueTypeValidableDef<any>;
128
128
  allowClear: {
@@ -260,7 +260,7 @@ declare function __VLS_template(): {
260
260
  handleReset: PropType<MouseEventHandler>;
261
261
  addonBefore: VueTypeValidableDef<any>;
262
262
  addonAfter: VueTypeValidableDef<any>;
263
- prefix: VueTypeValidableDef<any>;
263
+ prefix: ** @type { [typeof __VLS_components.Flex, typeof __VLS_components.Flex, ] } */).VueTypeValidableDef<any>;
264
264
  suffix: VueTypeValidableDef<any>;
265
265
  clearIcon: VueTypeValidableDef<any>;
266
266
  allowClear: {
@@ -417,7 +417,7 @@ declare const __VLS_component: DefineComponent<ApFieldTextPasswordProps, {
417
417
  handleReset: PropType<MouseEventHandler>;
418
418
  addonBefore: VueTypeValidableDef<any>;
419
419
  addonAfter: VueTypeValidableDef<any>;
420
- prefix: VueTypeValidableDef<any>;
420
+ prefix: ** @type { [typeof __VLS_components.Flex, typeof __VLS_components.Flex, ] } */).VueTypeValidableDef<any>;
421
421
  suffix: VueTypeValidableDef<any>;
422
422
  clearIcon: VueTypeValidableDef<any>;
423
423
  allowClear: {
@@ -555,7 +555,7 @@ declare const __VLS_component: DefineComponent<ApFieldTextPasswordProps, {
555
555
  handleReset: PropType<MouseEventHandler>;
556
556
  addonBefore: VueTypeValidableDef<any>;
557
557
  addonAfter: VueTypeValidableDef<any>;
558
- prefix: VueTypeValidableDef<any>;
558
+ prefix: ** @type { [typeof __VLS_components.Flex, typeof __VLS_components.Flex, ] } */).VueTypeValidableDef<any>;
559
559
  suffix: VueTypeValidableDef<any>;
560
560
  clearIcon: VueTypeValidableDef<any>;
561
561
  allowClear: {