@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
@@ -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
@@ -1,11 +1,14 @@
1
- import { defineComponent as B, computed as b, shallowRef as x, useSlots as S, createElementBlock as _, createBlock as g, openBlock as r, toDisplayString as k, unref as e, mergeProps as P, createSlots as C, renderList as I, withCtx as U, renderSlot as w, normalizeProps as R, guardReactiveProps as V } from "vue";
1
+ import { defineComponent as R, computed as l, shallowRef as _, useSlots as P, createBlock as u, openBlock as d, unref as e, withCtx as p, createElementVNode as k, toDisplayString as C, mergeProps as I, createSlots as M, renderList as N, renderSlot as U, normalizeProps as V, guardReactiveProps as w } from "vue";
2
2
  import { InputNumber as z } from "@aplus-frontend/antdv";
3
3
  import { omit as A } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
+ import "../../render/index.mjs";
5
6
  import { useDefaultPlaceholder as D } from "../hooks/use-default-placeholder.mjs";
6
- import { formatSecond as E } from "./helper.mjs";
7
+ import { useReadModeRender as E } from "../hooks/use-read-mode-render.mjs";
8
+ import { formatSecond as s } from "./helper.mjs";
7
9
  import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
8
- const M = { key: 0 }, H = /* @__PURE__ */ B({
10
+ import O from "../../render/render.mjs";
11
+ const Y = /* @__PURE__ */ R({
9
12
  name: "ApFieldSecond",
10
13
  __name: "index",
11
14
  props: {
@@ -13,6 +16,7 @@ const M = { key: 0 }, H = /* @__PURE__ */ B({
13
16
  class: {},
14
17
  style: {},
15
18
  emptyText: { default: "--" },
19
+ customReadMode: {},
16
20
  size: {},
17
21
  bordered: { type: Boolean, default: !0 },
18
22
  placeholder: {},
@@ -54,35 +58,46 @@ const M = { key: 0 }, H = /* @__PURE__ */ B({
54
58
  onFocus: {}
55
59
  },
56
60
  emits: ["update:value"],
57
- setup(u, { expose: d, emit: s }) {
58
- const o = u, p = b(
61
+ setup(i, { expose: m, emit: f }) {
62
+ const o = i, { renderer: c } = E(
63
+ o,
64
+ l(() => s(Number(t.value)))
65
+ ), v = l(
59
66
  () => A(o, ["value", "onUpdate:value", "min", "placeholder", "mode"])
60
- ), i = s, t = x(), { value: a, updateValue: f } = F(
67
+ ), y = f, r = _(), { value: t, updateValue: h } = F(
61
68
  o,
62
- i
63
- ), c = S(), m = D("Second", o);
64
- function y() {
65
- t.value?.focus();
69
+ y
70
+ ), B = P(), b = D("Second", o);
71
+ function x() {
72
+ r.value?.focus();
66
73
  }
67
- function v() {
68
- t.value?.blur();
74
+ function S() {
75
+ r.value?.blur();
69
76
  }
70
- return d({ focus: y, blur: v }), (l, N) => l.mode === "read" ? (r(), _("span", M, k(e(E)(Number(e(a)))), 1)) : (r(), g(e(z), P({
77
+ return m({ focus: x, blur: S }), (a, L) => a.mode === "read" ? (d(), u(e(O), {
78
+ key: 0,
79
+ renderer: e(c)
80
+ }, {
81
+ default: p(() => [
82
+ k("span", null, C(e(s)(Number(e(t)))), 1)
83
+ ]),
84
+ _: 1
85
+ }, 8, ["renderer"])) : (d(), u(e(z), I({
71
86
  key: 1,
72
87
  min: 0,
73
88
  style: { width: "100%" },
74
- placeholder: e(m),
75
- value: e(a)
76
- }, p.value, { "onUpdate:value": e(f) }), C({ _: 2 }, [
77
- I(c, (O, n) => ({
89
+ placeholder: e(b),
90
+ value: e(t)
91
+ }, v.value, { "onUpdate:value": e(h) }), M({ _: 2 }, [
92
+ N(B, (T, n) => ({
78
93
  name: n,
79
- fn: U((h) => [
80
- w(l.$slots, n, R(V(h || {})))
94
+ fn: p((g) => [
95
+ U(a.$slots, n, V(w(g || {})))
81
96
  ])
82
97
  }))
83
98
  ]), 1040, ["placeholder", "value", "onUpdate:value"]));
84
99
  }
85
100
  });
86
101
  export {
87
- H as default
102
+ Y as default
88
103
  };
@@ -8,6 +8,7 @@ const m = /* @__PURE__ */ n({
8
8
  class: {},
9
9
  style: {},
10
10
  emptyText: { default: "--" },
11
+ customReadMode: {},
11
12
  size: {},
12
13
  bordered: { type: Boolean },
13
14
  placeholder: {},
@@ -1,8 +1,8 @@
1
- import { defineComponent as S, computed as f, ref as h, useSlots as U, onMounted as V, unref as o, createVNode as s, Fragment as a, createBlock as i, createElementBlock as _, openBlock as u, resolveDynamicComponent as N, mergeProps as P, withCtx as q, renderSlot as z, normalizeProps as F, guardReactiveProps as T } from "vue";
2
- import { Spin as O, Segmented as R } from "@aplus-frontend/antdv";
3
- import { omit as w, isFunction as c, isUndefined as A, isString as D, isNumber as E } from "lodash-unified";
1
+ import { defineComponent as S, computed as c, ref as h, useSlots as U, onMounted as V, unref as o, createVNode as s, Fragment as a, createBlock as i, createElementBlock as _, openBlock as u, resolveDynamicComponent as N, mergeProps as P, withCtx as q, renderSlot as z, normalizeProps as F, guardReactiveProps as R } from "vue";
2
+ import { Spin as T, Segmented as M } from "@aplus-frontend/antdv";
3
+ import { omit as O, isFunction as f, isUndefined as w, isString as A, isNumber as D } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
- import M from "../hooks/use-options.mjs";
5
+ import E from "../hooks/use-options.mjs";
6
6
  import { useControllableValue as $ } from "../../hooks/useControllableValue.mjs";
7
7
  const L = /* @__PURE__ */ S({
8
8
  name: "ApFieldSegmented",
@@ -16,6 +16,7 @@ const L = /* @__PURE__ */ S({
16
16
  emptyText: {
17
17
  default: "--"
18
18
  },
19
+ customReadMode: {},
19
20
  prefixCls: {},
20
21
  options: {},
21
22
  block: {
@@ -43,45 +44,45 @@ const L = /* @__PURE__ */ S({
43
44
  setup(v, {
44
45
  emit: y
45
46
  }) {
46
- const t = v, g = f(() => w(t, ["onUpdate:value", "value", "defaultValue", "options"])), {
47
+ const t = v, g = c(() => O(t, ["onUpdate:value", "value", "defaultValue", "options"])), {
47
48
  options: p,
48
49
  updateOptions: b
49
- } = M(t), k = y, {
50
+ } = E(t), k = y, {
50
51
  value: d,
51
52
  updateValue: x
52
53
  } = $(t, k), r = h(!1), B = U();
53
54
  V(() => {
54
- c(t.request) && (r.value = !0, t.request().then((e) => b(e)).finally(() => {
55
+ f(t.request) && (r.value = !0, t.request().then((e) => b(e)).finally(() => {
55
56
  r.value = !1;
56
57
  }));
57
58
  });
58
- const C = f(() => {
59
+ const C = c(() => {
59
60
  const e = o(d);
60
- if (A(e))
61
+ if (w(e))
61
62
  return s(a, null, [t.emptyText]);
62
63
  const l = o(p)?.find((m) => m === e || m?.value === e);
63
- if (D(l) || E(l))
64
+ if (A(l) || D(l))
64
65
  return s(a, null, [l]);
65
66
  const n = l?.label || B.label;
66
- return c(n) ? s(a, null, [n?.({
67
+ return f(n) ? s(a, null, [n?.({
67
68
  ...l
68
69
  })]) : s(a, null, [n || t.emptyText]);
69
70
  });
70
- return (e, l) => r.value ? (u(), i(o(O), {
71
+ return (e, l) => r.value ? (u(), i(o(T), {
71
72
  key: 0,
72
73
  size: "small"
73
74
  })) : (u(), _(a, {
74
75
  key: 1
75
76
  }, [e.mode === "read" ? (u(), i(N(C.value), {
76
77
  key: 0
77
- })) : (u(), i(o(R), P({
78
+ })) : (u(), i(o(M), P({
78
79
  key: 1
79
80
  }, g.value, {
80
81
  value: o(d),
81
82
  options: o(p),
82
83
  "onUpdate:value": o(x)
83
84
  }), {
84
- label: q((n) => [z(e.$slots, "label", F(T(n)))]),
85
+ label: q((n) => [z(e.$slots, "label", F(R(n)))]),
85
86
  _: 3
86
87
  }, 16, ["value", "options", "onUpdate:value"]))], 64));
87
88
  }