@aplus-frontend/ui 7.3.3 → 7.4.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 (147) hide show
  1. package/es/index.mjs +176 -174
  2. package/es/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  3. package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
  4. package/es/src/ag-grid/index.vue.d.ts +2 -4
  5. package/es/src/ap-field/date/index.vue.mjs +68 -63
  6. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  7. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  8. package/es/src/ap-form/ap-form.vue.d.ts +1 -2
  9. package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  10. package/es/src/ap-form/item/index.vue.mjs +95 -86
  11. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  12. package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
  13. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  14. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  15. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  16. package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
  17. package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +1 -1
  18. package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
  19. package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  20. package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
  21. package/es/src/ap-grid/index.vue.d.ts +2 -4
  22. package/es/src/ap-grid/utils/table.mjs +2 -2
  23. package/es/src/ap-list/index.vue.d.ts +2 -4
  24. package/es/src/ap-modal/interface.d.ts +4 -0
  25. package/es/src/ap-modal/style/index.d.ts +3 -0
  26. package/es/src/ap-modal/style/index.mjs +20 -0
  27. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  28. package/es/src/ap-modal/utils/createModal.mjs +58 -56
  29. package/es/src/ap-table/ap-table.vue.d.ts +2 -4
  30. package/es/src/ap-table/constants.d.ts +10 -10
  31. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  32. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
  33. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +26 -24
  34. package/es/src/business/ag-grid-modal/interface.d.ts +2 -1
  35. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
  36. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +16 -15
  37. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  38. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  39. package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
  40. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  41. package/es/src/business/ap-expand-alert/index.d.ts +4 -6
  42. package/es/src/business/ap-select-layout/index.d.ts +2 -4
  43. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  44. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +2 -2
  45. package/es/src/business/ap-table-modal/index.d.ts +17 -5
  46. package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  47. package/es/src/business/ap-upload/components/Picture.vue.d.ts +2 -7
  48. package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  49. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  50. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  51. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  52. package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
  53. package/es/src/design-token/interface.d.ts +2 -0
  54. package/es/src/editable-table/form-item.vue.d.ts +2 -4
  55. package/es/src/editable-table/index.vue.d.ts +2 -4
  56. package/es/src/index.d.ts +1 -0
  57. package/es/src/index.mjs +280 -278
  58. package/es/src/loading-bar/global.d.ts +13 -0
  59. package/es/src/loading-bar/global.mjs +35 -0
  60. package/es/src/loading-bar/index.d.ts +9 -0
  61. package/es/src/loading-bar/index.mjs +9 -0
  62. package/es/src/loading-bar/index.vue.d.ts +14 -0
  63. package/es/src/loading-bar/index.vue.mjs +4 -0
  64. package/es/src/loading-bar/index.vue2.mjs +112 -0
  65. package/es/src/loading-bar/interface.d.ts +48 -0
  66. package/es/src/loading-bar/interface.mjs +1 -0
  67. package/es/src/loading-bar/style/index.d.ts +12 -0
  68. package/es/src/loading-bar/style/index.mjs +85 -0
  69. package/es/src/scroll-view/index.vue.d.ts +5 -5
  70. package/es/src/tests/wrapper.d.ts +4 -4
  71. package/es/src/utils/cssinjs/TokenUtil.mjs +1 -1
  72. package/es/src/version.d.ts +1 -1
  73. package/es/src/version.mjs +1 -1
  74. package/lib/index.js +1 -1
  75. package/lib/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  76. package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
  77. package/lib/src/ag-grid/index.vue.d.ts +2 -4
  78. package/lib/src/ap-field/date/index.vue.js +1 -1
  79. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  80. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  81. package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
  82. package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  83. package/lib/src/ap-form/item/index.vue.js +1 -1
  84. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  85. package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
  86. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  87. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  88. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  89. package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
  90. package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +1 -1
  91. package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
  92. package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  93. package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
  94. package/lib/src/ap-grid/index.vue.d.ts +2 -4
  95. package/lib/src/ap-grid/utils/table.js +1 -1
  96. package/lib/src/ap-list/index.vue.d.ts +2 -4
  97. package/lib/src/ap-modal/interface.d.ts +4 -0
  98. package/lib/src/ap-modal/style/index.d.ts +3 -0
  99. package/lib/src/ap-modal/style/index.js +1 -0
  100. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  101. package/lib/src/ap-modal/utils/createModal.js +1 -1
  102. package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
  103. package/lib/src/ap-table/constants.d.ts +10 -10
  104. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  105. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  106. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  107. package/lib/src/business/ag-grid-modal/interface.d.ts +2 -1
  108. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
  109. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  110. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  111. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  112. package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
  113. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  114. package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
  115. package/lib/src/business/ap-select-layout/index.d.ts +2 -4
  116. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  117. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  118. package/lib/src/business/ap-table-modal/index.d.ts +17 -5
  119. package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  120. package/lib/src/business/ap-upload/components/Picture.vue.d.ts +2 -7
  121. package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  122. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  123. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  124. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  125. package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
  126. package/lib/src/design-token/interface.d.ts +2 -0
  127. package/lib/src/editable-table/form-item.vue.d.ts +2 -4
  128. package/lib/src/editable-table/index.vue.d.ts +2 -4
  129. package/lib/src/index.d.ts +1 -0
  130. package/lib/src/index.js +1 -1
  131. package/lib/src/loading-bar/global.d.ts +13 -0
  132. package/lib/src/loading-bar/global.js +1 -0
  133. package/lib/src/loading-bar/index.d.ts +9 -0
  134. package/lib/src/loading-bar/index.js +1 -0
  135. package/lib/src/loading-bar/index.vue.d.ts +14 -0
  136. package/lib/src/loading-bar/index.vue.js +1 -0
  137. package/lib/src/loading-bar/index.vue2.js +1 -0
  138. package/lib/src/loading-bar/interface.d.ts +48 -0
  139. package/lib/src/loading-bar/interface.js +1 -0
  140. package/lib/src/loading-bar/style/index.d.ts +12 -0
  141. package/lib/src/loading-bar/style/index.js +17 -0
  142. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  143. package/lib/src/tests/wrapper.d.ts +4 -4
  144. package/lib/src/utils/cssinjs/TokenUtil.js +1 -1
  145. package/lib/src/version.d.ts +1 -1
  146. package/lib/src/version.js +1 -1
  147. package/package.json +5 -5
@@ -1,15 +1,15 @@
1
- import { defineComponent as z, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as E, withCtx as p, createCommentVNode as N, createVNode as j, isRef as I, renderList as P, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
1
+ import { defineComponent as E, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as N, withCtx as s, createVNode as P, createCommentVNode as I, isRef as j, renderList as b, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
2
2
  import u from "dayjs";
3
- import { InputGroup as G, Select as L, SelectOption as Y, DatePicker as Z } from "@aplus-frontend/antdv";
4
- import { ApFieldDatePresetFormats as q, PRESET_FORMAT_MAP as b, PRESET_FORMAT_PICK_MAP as J, PRESET_FORMAT_TIME_MAP as Q } from "./constant.mjs";
3
+ import { InputGroup as G, FormItemRest as L, Select as Y, SelectOption as Z, DatePicker as q } from "@aplus-frontend/antdv";
4
+ import { ApFieldDatePresetFormats as J, PRESET_FORMAT_MAP as C, PRESET_FORMAT_PICK_MAP as Q, PRESET_FORMAT_TIME_MAP as X } from "./constant.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { isNil as C, omit as X } from "lodash-unified";
7
- import { formatDayWithTimezone as ee } from "./helper.mjs";
8
- import { getTimeFormatToZone as oe } from "@aplus-frontend/utils";
9
- import { useDefaultPlaceholder as te } from "../hooks/use-default-placeholder.mjs";
10
- import { useDateTimezone as ae } from "../hooks/use-date-timezone.mjs";
11
- import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
12
- const ye = /* @__PURE__ */ z({
6
+ import { isNil as S, omit as ee } from "lodash-unified";
7
+ import { formatDayWithTimezone as oe } from "./helper.mjs";
8
+ import { getTimeFormatToZone as te } from "@aplus-frontend/utils";
9
+ import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
10
+ import { useDateTimezone as ne } from "../hooks/use-date-timezone.mjs";
11
+ import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
12
+ const he = /* @__PURE__ */ E({
13
13
  name: "ApFieldDate",
14
14
  __name: "index",
15
15
  props: {
@@ -91,23 +91,23 @@ const ye = /* @__PURE__ */ z({
91
91
  timezone: {}
92
92
  },
93
93
  emits: ["update:value"],
94
- setup(S, { emit: T }) {
95
- const e = S, O = T, { value: f, updateValue: h } = ne(
94
+ setup(T, { emit: F }) {
95
+ const e = T, O = F, { value: f, updateValue: h } = le(
96
96
  e,
97
97
  O
98
- ), F = te("Date", e), { currentTimezone: d } = ae(e), l = r(
99
- () => q.indexOf(e.format) > -1
100
- ), A = r(() => e.shownFormat ? e.shownFormat : l.value ? b[e.format] : e.format), s = r(
101
- () => l.value ? b[e.format] : e.format
98
+ ), _ = ae("Date", e), { currentTimezone: d } = ne(e), l = r(
99
+ () => J.indexOf(e.format) > -1
100
+ ), A = r(() => e.shownFormat ? e.shownFormat : l.value ? C[e.format] : e.format), m = r(
101
+ () => l.value ? C[e.format] : e.format
102
102
  ), c = r(() => {
103
- if (C(t(f)))
103
+ if (S(t(f)))
104
104
  return;
105
105
  let o = u(t(f));
106
- return e.timezone && (o = u(oe(t(f), d.value))), o;
107
- }), _ = r(() => t(l) ? e.picker ?? J[e.format] : e.picker), R = r(() => {
108
- const o = t(l) ? Q[e.format] : {};
106
+ return e.timezone && (o = u(te(t(f), d.value))), o;
107
+ }), R = r(() => t(l) ? e.picker ?? Q[e.format] : e.picker), M = r(() => {
108
+ const o = t(l) ? X[e.format] : {};
109
109
  return {
110
- ...X(e, [
110
+ ...ee(e, [
111
111
  "value",
112
112
  "defaultValue",
113
113
  "onChange",
@@ -116,12 +116,12 @@ const ye = /* @__PURE__ */ z({
116
116
  "onUpdate:value",
117
117
  "mode"
118
118
  ]),
119
- placeholder: t(F),
119
+ placeholder: t(_),
120
120
  ...o
121
121
  };
122
- }), v = (o, n, a = !0) => ee(d.value)(o, n, a);
123
- function M(o) {
124
- if (C(o)) {
122
+ }), v = (o, n, a = !0) => oe(d.value)(o, n, a);
123
+ function D(o) {
124
+ if (S(o)) {
125
125
  h(null);
126
126
  return;
127
127
  }
@@ -129,71 +129,76 @@ const ye = /* @__PURE__ */ z({
129
129
  h(
130
130
  v(
131
131
  n,
132
- t(l) ? t(s) : void 0,
132
+ t(l) ? t(m) : void 0,
133
133
  e.formatBegins
134
134
  )
135
135
  );
136
136
  }
137
- function D(o, n) {
138
- const a = u(o), m = o ? v(
137
+ function V(o, n) {
138
+ const a = u(o), p = o ? v(
139
139
  a,
140
- t(l) ? t(s) : void 0,
140
+ t(l) ? t(m) : void 0,
141
141
  e.formatBegins
142
142
  ) : null;
143
- e.onChange?.(m, n);
143
+ e.onChange?.(p, n);
144
144
  }
145
- function V(o) {
145
+ function x(o) {
146
146
  const n = u(o), a = o ? v(
147
147
  n,
148
- t(l) ? t(s) : void 0,
148
+ t(l) ? t(m) : void 0,
149
149
  e.formatBegins
150
150
  ) : null;
151
151
  e.onOk?.(a);
152
152
  }
153
153
  return (o, n) => o.mode === "read" ? (i(), B(g, { key: 0 }, [
154
- k(w(c.value ? t(u)(c.value).format(s.value) : o.emptyText), 1)
154
+ k(w(c.value ? t(u)(c.value).format(m.value) : o.emptyText), 1)
155
155
  ], 64)) : (i(), y(t(G), {
156
156
  key: 1,
157
157
  compact: "",
158
- style: E({
158
+ style: N({
159
159
  display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
160
160
  })
161
161
  }, {
162
- default: p(() => [
163
- Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(L), {
164
- key: 0,
165
- value: t(d),
166
- "onUpdate:value": n[0] || (n[0] = (a) => I(d) ? d.value = a : null),
167
- "default-active-first-option": "",
168
- "dropdown-match-select-width": !1,
169
- style: { "max-width": "50%" },
170
- disabled: o.disabled
171
- }, {
172
- default: p(() => [
173
- (i(!0), B(g, null, P(e.timezone, (a) => (i(), y(t(Y), {
174
- key: a?.value,
175
- value: a?.value
162
+ default: s(() => [
163
+ P(t(L), null, {
164
+ default: s(() => [
165
+ Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(Y), {
166
+ key: 0,
167
+ value: t(d),
168
+ "onUpdate:value": n[0] || (n[0] = (a) => j(d) ? d.value = a : null),
169
+ "default-active-first-option": "",
170
+ "dropdown-match-select-width": !1,
171
+ style: { "max-width": "50%" },
172
+ disabled: o.disabled
176
173
  }, {
177
- default: p(() => [
178
- k(w(a?.label ?? a?.value), 1)
174
+ default: s(() => [
175
+ (i(!0), B(g, null, b(e.timezone, (a) => (i(), y(t(Z), {
176
+ key: a?.value,
177
+ value: a?.value
178
+ }, {
179
+ default: s(() => [
180
+ k(w(a?.label ?? a?.value), 1)
181
+ ]),
182
+ _: 2
183
+ }, 1032, ["value"]))), 128))
179
184
  ]),
180
- _: 2
181
- }, 1032, ["value"]))), 128))
185
+ _: 1
186
+ }, 8, ["value", "disabled"])) : I("", !0)
182
187
  ]),
183
188
  _: 1
184
- }, 8, ["value", "disabled"])) : N("", !0),
185
- j(t(Z), U(R.value, {
189
+ }),
190
+ P(t(q), U(M.value, {
186
191
  value: c.value,
187
192
  format: A.value,
188
- picker: _.value,
189
- "onUpdate:value": M,
190
- onChange: D,
191
- onOk: V
193
+ picker: R.value,
194
+ "onUpdate:value": D,
195
+ onChange: V,
196
+ onOk: x
192
197
  }), H({ _: 2 }, [
193
- P(o.$slots, (a, m) => ({
194
- name: m,
195
- fn: p((x) => [
196
- K(o.$slots, m, W($(x || {})))
198
+ b(o.$slots, (a, p) => ({
199
+ name: p,
200
+ fn: s((z) => [
201
+ K(o.$slots, p, W($(z || {})))
197
202
  ])
198
203
  }))
199
204
  ]), 1040, ["value", "format", "picker"])
@@ -203,5 +208,5 @@ const ye = /* @__PURE__ */ z({
203
208
  }
204
209
  });
205
210
  export {
206
- ye as default
211
+ he as default
207
212
  };
@@ -6,13 +6,13 @@ export declare const useSelectOptions: (props: ApFieldSelectProps) => {
6
6
  options: Ref<{
7
7
  [x: string]: any;
8
8
  label?: any;
9
- value?: (string | number | null) | undefined;
9
+ value?: string | number | null | undefined;
10
10
  children?: Omit<DefaultOptionType, "children">[] | undefined;
11
11
  disabled?: boolean | undefined;
12
12
  }[], DefaultOptionType[] | {
13
13
  [x: string]: any;
14
14
  label?: any;
15
- value?: (string | number | null) | undefined;
15
+ value?: string | number | null | undefined;
16
16
  children?: Omit<DefaultOptionType, "children">[] | undefined;
17
17
  disabled?: boolean | undefined;
18
18
  }[]>;
@@ -8,14 +8,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
8
8
  disabled?: boolean | undefined;
9
9
  checkable?: boolean | undefined;
10
10
  disableCheckbox?: boolean | undefined;
11
- children?: any[] | undefined;
11
+ children?: /*elided*/ any[] | undefined;
12
12
  } | {
13
13
  [x: string]: any;
14
14
  value?: RawValueType | undefined;
15
15
  title?: any;
16
16
  label?: any;
17
17
  key?: Key | undefined;
18
- children?: any[] | undefined;
18
+ children?: /*elided*/ any[] | undefined;
19
19
  disabled?: boolean | undefined;
20
20
  checkable?: boolean | undefined;
21
21
  disableCheckbox?: boolean | undefined;
@@ -24,14 +24,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
24
24
  disabled?: boolean | undefined;
25
25
  checkable?: boolean | undefined;
26
26
  disableCheckbox?: boolean | undefined;
27
- children?: any[] | undefined;
27
+ children?: /*elided*/ any[] | undefined;
28
28
  } | {
29
29
  [x: string]: any;
30
30
  value?: RawValueType | undefined;
31
31
  title?: any;
32
32
  label?: any;
33
33
  key?: Key | undefined;
34
- children?: any[] | undefined;
34
+ children?: /*elided*/ any[] | undefined;
35
35
  disabled?: boolean | undefined;
36
36
  checkable?: boolean | undefined;
37
37
  disableCheckbox?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { ApFormProps, UpdateModelOptimizeFn, WatchFunc, ApFormInternalInstance } from './interface';
2
- import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, RuleObject, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
2
+ import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
3
3
  import { Recordable } from '../type';
4
4
  import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
5
5
  import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
@@ -7,7 +7,6 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
7
7
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
8
8
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
9
9
  import { Options } from '../../node_modules/scroll-into-view-if-needed';
10
- import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
11
10
  import { SizeType } from '@aplus-frontend/antdv/es/button';
12
11
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
13
12
  declare function __VLS_template(): {
@@ -1,13 +1,12 @@
1
1
  import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
2
2
  import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, CSSProperties } from 'vue';
3
- import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, RuleObject } from '@aplus-frontend/antdv/es/form/interface';
3
+ import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
4
4
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
5
5
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
6
6
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
7
7
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
8
8
  import { Recordable } from '../../type';
9
9
  import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
10
- import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
11
10
  import { SizeType } from '@aplus-frontend/antdv/es/button';
12
11
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
13
12
  import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
@@ -119,7 +118,7 @@ declare function __VLS_template(): {
119
118
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
120
119
  readonly initialValues?: Recordable | undefined;
121
120
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
122
- readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
121
+ readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
123
122
  readonly syncToUrlPriority?: boolean | undefined;
124
123
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
125
124
  $attrs: {
@@ -1082,7 +1081,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
1082
1081
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
1083
1082
  readonly initialValues?: Recordable | undefined;
1084
1083
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
1085
- readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
1084
+ readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
1086
1085
  readonly syncToUrlPriority?: boolean | undefined;
1087
1086
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
1088
1087
  $attrs: {
@@ -1,16 +1,16 @@
1
- import { defineComponent as L, useSlots as _, ref as c, onMounted as M, computed as $, unref as t, cloneVNode as j, createBlock as b, openBlock as v, mergeProps as q, createSlots as E, withCtx as a, resolveDynamicComponent as K, renderList as O, createElementVNode as Q, normalizeClass as U, createVNode as u, normalizeStyle as Y, renderSlot as G, normalizeProps as H, guardReactiveProps as J } from "vue";
2
- import { Form as W, Tooltip as X, TypographyText as Z } from "@aplus-frontend/antdv";
3
- import { useToken as ee } from "@aplus-frontend/antdv/es/theme/internal";
4
- import { isFunction as y, cloneDeep as oe, isArray as te, omit as F } from "lodash-unified";
1
+ import { defineComponent as _, useSlots as j, ref as y, onMounted as E, computed as M, unref as r, cloneVNode as O, createBlock as b, openBlock as v, mergeProps as $, createSlots as q, withCtx as i, resolveDynamicComponent as K, renderList as Q, createElementVNode as U, normalizeClass as Y, createVNode as f, normalizeStyle as G, renderSlot as H, normalizeProps as J, guardReactiveProps as W } from "vue";
2
+ import { Form as X, Tooltip as Z, TypographyText as ee } from "@aplus-frontend/antdv";
3
+ import { useToken as oe } from "@aplus-frontend/antdv/es/theme/internal";
4
+ import { isFunction as F, cloneDeep as te, isArray as re, omit as V } from "lodash-unified";
5
5
  import { apFormItemColPropKeys as le } from "../constant.mjs";
6
- import { QuestionCircleOutlined as re } from "@ant-design/icons-vue";
6
+ import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
7
7
  import "../../config-provider/index.mjs";
8
8
  import { useInjectForm as ae } from "../context.mjs";
9
- import { isPromise as ne } from "@fruits-chain/utils";
10
- import { getValidVNodeList as ie } from "../../utils/slot.mjs";
11
- import se from "../style/item.mjs";
12
- import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
13
- const Be = /* @__PURE__ */ L({
9
+ import { isPromise as ie } from "@fruits-chain/utils";
10
+ import { getValidVNodeList as se } from "../../utils/slot.mjs";
11
+ import ue from "../style/item.mjs";
12
+ import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
13
+ const Ce = /* @__PURE__ */ _({
14
14
  name: "ApFormItem",
15
15
  __name: "index",
16
16
  props: {
@@ -57,100 +57,109 @@ const Be = /* @__PURE__ */ L({
57
57
  customFilled: {},
58
58
  disabled: { type: Boolean }
59
59
  },
60
- setup(V, { expose: g }) {
61
- const e = V, d = _(), { model: m, updateModel: h, internalInstance: B } = ae(), { m: i, b: C } = ue("ap-form-item"), k = se("ap-form-item"), s = c(!1), r = c(), [, x] = ee();
62
- M(async () => {
63
- let o = y(e.initialValue) ? e.initialValue() : e.initialValue;
64
- ne(o) && (o = await o), B?.registerField({
65
- name: e.name,
66
- initialValue: oe(o),
67
- transform: e.transform
60
+ setup(g, { expose: h }) {
61
+ const o = g, m = j(), { model: p, updateModel: B, internalInstance: C } = ae(), { m: u, b: k } = de("ap-form-item"), P = ue("ap-form-item"), d = y(!1), a = y(), [, x] = oe();
62
+ E(async () => {
63
+ let e = F(o.initialValue) ? o.initialValue() : o.initialValue;
64
+ ie(e) && (e = await e), C?.registerField({
65
+ name: o.name,
66
+ initialValue: te(e),
67
+ transform: o.transform
68
68
  });
69
69
  });
70
- const f = $(() => e.name ? te(e.name) ? e.name.reduce((o, l) => o?.[l], t(m)) : m?.value[e.name] : null);
71
- function I() {
72
- const o = d.default?.() || [];
73
- if (!e.name)
74
- return o[0];
75
- const l = ie(o)[0];
76
- return l ? j(l, {
77
- [e.valuePropName]: t(f),
78
- [`onUpdate:${e.valuePropName}`]: N,
79
- variant: e.bordered ? "borderless" : l?.props?.variant,
80
- bordered: e.bordered ? !1 : l?.props?.bordered,
81
- onFocus: P,
82
- onBlur: S
83
- }) : null;
84
- }
85
- function N(o) {
86
- h?.(e.name, o);
70
+ const c = M(() => o.name ? re(o.name) ? o.name.reduce((e, t) => e?.[t], r(p)) : p?.value[o.name] : null);
71
+ function N(e, t) {
72
+ const l = Object.keys(t), n = { ...t };
73
+ return l.forEach((s) => {
74
+ s in e || delete n[s];
75
+ }), n;
87
76
  }
88
- function P() {
89
- s.value = !0;
77
+ function I() {
78
+ const e = m.default?.() || [];
79
+ if (!o.name)
80
+ return e[0];
81
+ const t = se(e)[0];
82
+ if (!t)
83
+ return null;
84
+ const l = t?.type?.props ?? {}, n = {
85
+ [o.valuePropName]: r(c),
86
+ [`onUpdate:${o.valuePropName}`]: S,
87
+ variant: o.bordered ? "borderless" : t?.props?.variant,
88
+ bordered: o.bordered ? !1 : t?.props?.bordered,
89
+ onFocus: T,
90
+ onBlur: w
91
+ };
92
+ return O(t, N(l, n));
90
93
  }
91
- function S() {
92
- s.value = !1;
94
+ function S(e) {
95
+ B?.(o.name, e);
93
96
  }
94
97
  function T() {
95
- r.value?.onFieldBlur();
98
+ d.value = !0;
96
99
  }
97
100
  function w() {
98
- r.value?.onFieldChange();
101
+ d.value = !1;
99
102
  }
100
103
  function z() {
101
- r.value?.clearValidate();
104
+ a.value?.onFieldBlur();
102
105
  }
103
106
  function R() {
104
- r.value?.resetField();
107
+ a.value?.onFieldChange();
108
+ }
109
+ function A() {
110
+ a.value?.clearValidate();
111
+ }
112
+ function D() {
113
+ a.value?.resetField();
105
114
  }
106
- function A(o = !1) {
107
- const l = t(f);
108
- if (!o || !e.transform)
109
- return l;
110
- const n = y(e.transform) ? e.transform : e.transform.transformer;
111
- return e.transform ? n(l) : l;
115
+ function L(e = !1) {
116
+ const t = r(c);
117
+ if (!e || !o.transform)
118
+ return t;
119
+ const l = F(o.transform) ? o.transform : o.transform.transformer;
120
+ return o.transform ? l(t) : t;
112
121
  }
113
- return g({
114
- onFieldBlur: T,
115
- onFieldChange: w,
116
- clearValidate: z,
117
- resetField: R,
118
- getFieldValue: A
119
- }), (o, l) => (v(), b(t(W).Item, q(
122
+ return h({
123
+ onFieldBlur: z,
124
+ onFieldChange: R,
125
+ clearValidate: A,
126
+ resetField: D,
127
+ getFieldValue: L
128
+ }), (e, t) => (v(), b(r(X).Item, $(
120
129
  {
121
130
  ref_key: "formItemRef",
122
- ref: r
131
+ ref: a
123
132
  },
124
- t(F)(e, [...t(le), "tooltip", "label", "description"]),
133
+ r(V)(o, [...r(le), "tooltip", "label", "description"]),
125
134
  {
126
135
  class: {
127
- [t(i)("bordered")]: o.bordered,
128
- [t(i)("focused")]: o.bordered && s.value,
129
- [t(i)("disabled")]: o.bordered && o.disabled,
130
- [t(C)()]: !0,
131
- [t(k)]: !0
136
+ [r(u)("bordered")]: e.bordered,
137
+ [r(u)("focused")]: e.bordered && d.value,
138
+ [r(u)("disabled")]: e.bordered && e.disabled,
139
+ [r(k)()]: !0,
140
+ [r(P)]: !0
132
141
  },
133
- colon: o.bordered ? !1 : e.colon
142
+ colon: e.bordered ? !1 : o.colon
134
143
  }
135
- ), E({
136
- default: a(() => [
144
+ ), q({
145
+ default: i(() => [
137
146
  (v(), b(K(I())))
138
147
  ]),
139
148
  _: 2
140
149
  }, [
141
- e.tooltip ? {
150
+ o.tooltip ? {
142
151
  name: "tooltip",
143
- fn: a(({ class: n }) => [
144
- Q("span", {
145
- class: U(n)
152
+ fn: i(({ class: l }) => [
153
+ U("span", {
154
+ class: Y(l)
146
155
  }, [
147
- u(t(X), {
148
- title: e.tooltip
156
+ f(r(Z), {
157
+ title: o.tooltip
149
158
  }, {
150
- default: a(() => [
151
- u(t(re), {
152
- style: Y({
153
- color: t(x).colorTextTertiary,
159
+ default: i(() => [
160
+ f(r(ne), {
161
+ style: G({
162
+ color: r(x).colorTextTertiary,
154
163
  fontSize: "14px",
155
164
  transform: "translateY(1px)"
156
165
  })
@@ -162,26 +171,26 @@ const Be = /* @__PURE__ */ L({
162
171
  ]),
163
172
  key: "0"
164
173
  } : void 0,
165
- o.label ? {
174
+ e.label ? {
166
175
  name: "label",
167
- fn: a(() => [
168
- u(t(Z), {
169
- content: o.label,
170
- ellipsis: { tooltip: o.label },
176
+ fn: i(() => [
177
+ f(r(ee), {
178
+ content: e.label,
179
+ ellipsis: { tooltip: e.label },
171
180
  style: { "min-width": "0px", flex: "1" }
172
181
  }, null, 8, ["content", "ellipsis"])
173
182
  ]),
174
183
  key: "1"
175
184
  } : void 0,
176
- O(t(F)(d, "default"), (n, p) => ({
177
- name: p,
178
- fn: a((D) => [
179
- G(o.$slots, p, H(J(D || {})))
185
+ Q(r(V)(m, "default"), (l, n) => ({
186
+ name: n,
187
+ fn: i((s) => [
188
+ H(e.$slots, n, J(W(s || {})))
180
189
  ])
181
190
  }))
182
191
  ]), 1040, ["class", "colon"]));
183
192
  }
184
193
  });
185
194
  export {
186
- Be as default
195
+ Ce as default
187
196
  };
@@ -66,9 +66,9 @@ declare function __VLS_template(): {
66
66
  type: "up" | "down";
67
67
  }) => void) | undefined;
68
68
  readonly type?: string | undefined;
69
- readonly placeholder?: string | undefined;
70
69
  readonly name?: string | undefined;
71
70
  readonly id?: string | undefined;
71
+ readonly placeholder?: string | undefined;
72
72
  readonly valueModifiers?: Record<string, any> | undefined;
73
73
  readonly addonBefore?: any;
74
74
  readonly addonAfter?: any;
@@ -561,9 +561,9 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
561
561
  type: "up" | "down";
562
562
  }) => void) | undefined;
563
563
  readonly type?: string | undefined;
564
- readonly placeholder?: string | undefined;
565
564
  readonly name?: string | undefined;
566
565
  readonly id?: string | undefined;
566
+ readonly placeholder?: string | undefined;
567
567
  readonly valueModifiers?: Record<string, any> | undefined;
568
568
  readonly addonBefore?: any;
569
569
  readonly addonAfter?: any;
@@ -66,7 +66,6 @@ declare function __VLS_template(): {
66
66
  readonly direction?: "ltr" | "rtl" | undefined;
67
67
  readonly animation?: string | undefined;
68
68
  readonly children?: VueNode[] | undefined;
69
- readonly placeholder?: any;
70
69
  readonly prefixCls?: string | undefined;
71
70
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
72
71
  readonly loading?: boolean | undefined;
@@ -77,6 +76,7 @@ declare function __VLS_template(): {
77
76
  readonly getPopupContainer?: RenderDOMFunc | undefined;
78
77
  readonly virtual?: boolean | undefined;
79
78
  readonly dropdownMatchSelectWidth?: number | boolean | undefined;
79
+ readonly placeholder?: any;
80
80
  readonly status?: "" | "error" | "warning" | undefined;
81
81
  readonly defaultValue?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
82
82
  readonly prefix?: any;
@@ -127,12 +127,12 @@ declare function __VLS_template(): {
127
127
  readonly emptyText?: string | undefined;
128
128
  readonly request?: ((value?: string, extraParams?: Recordable) => Promise< SelectProps["options"]>) | undefined;
129
129
  readonly multiple?: boolean | undefined;
130
- readonly value?: SelectProps["value"];
130
+ readonly value?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
131
131
  readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
132
- readonly searchMode?: ("filter" | "request") | undefined;
132
+ readonly searchMode?: "filter" | "request" | undefined;
133
133
  readonly refetchOnFocus?: boolean | undefined;
134
134
  readonly lazy?: boolean | undefined;
135
- readonly addAll?: (boolean | number) | undefined;
135
+ readonly addAll?: boolean | number | undefined;
136
136
  readonly params?: Recordable | undefined;
137
137
  readonly searchDelay?: number | undefined;
138
138
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
@@ -715,7 +715,6 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
715
715
  readonly direction?: "ltr" | "rtl" | undefined;
716
716
  readonly animation?: string | undefined;
717
717
  readonly children?: VueNode[] | undefined;
718
- readonly placeholder?: any;
719
718
  readonly prefixCls?: string | undefined;
720
719
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
721
720
  readonly loading?: boolean | undefined;
@@ -726,6 +725,7 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
726
725
  readonly getPopupContainer?: RenderDOMFunc | undefined;
727
726
  readonly virtual?: boolean | undefined;
728
727
  readonly dropdownMatchSelectWidth?: number | boolean | undefined;
728
+ readonly placeholder?: any;
729
729
  readonly status?: "" | "error" | "warning" | undefined;
730
730
  readonly defaultValue?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
731
731
  readonly prefix?: any;
@@ -776,12 +776,12 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
776
776
  readonly emptyText?: string | undefined;
777
777
  readonly request?: ((value?: string, extraParams?: Recordable) => Promise< SelectProps["options"]>) | undefined;
778
778
  readonly multiple?: boolean | undefined;
779
- readonly value?: SelectProps["value"];
779
+ readonly value?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
780
780
  readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
781
- readonly searchMode?: ("filter" | "request") | undefined;
781
+ readonly searchMode?: "filter" | "request" | undefined;
782
782
  readonly refetchOnFocus?: boolean | undefined;
783
783
  readonly lazy?: boolean | undefined;
784
- readonly addAll?: (boolean | number) | undefined;
784
+ readonly addAll?: boolean | number | undefined;
785
785
  readonly params?: Recordable | undefined;
786
786
  readonly searchDelay?: number | undefined;
787
787
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;