@aplus-frontend/ui 0.2.0-beta.2 → 0.2.0-beta.3

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 (61) hide show
  1. package/es/index.mjs +59 -52
  2. package/es/src/ap-field/interface.d.ts +6 -0
  3. package/es/src/ap-field/select/index.vue.mjs +14 -13
  4. package/es/src/ap-form/item/index.vue.mjs +58 -58
  5. package/es/src/ap-table/ap-table.vue.d.ts +2 -0
  6. package/es/src/ap-table/ap-table.vue.mjs +28 -27
  7. package/es/src/ap-table/constants.d.ts +18 -30
  8. package/es/src/ap-table/utils.d.ts +33 -3
  9. package/es/src/ap-table/utils.mjs +69 -69
  10. package/es/src/business/ap-summary/ap-summary.vue.d.ts +30 -0
  11. package/es/src/business/ap-summary/ap-summary.vue.mjs +4 -0
  12. package/es/src/business/ap-summary/ap-summary.vue2.mjs +68 -0
  13. package/es/src/business/ap-summary/index.d.ts +95 -0
  14. package/es/src/business/ap-summary/index.mjs +13 -0
  15. package/es/src/business/ap-summary/interface.d.ts +41 -0
  16. package/es/src/business/ap-summary/interface.mjs +1 -0
  17. package/es/src/business/ap-summary/style/css.d.ts +0 -0
  18. package/es/src/business/ap-summary/style/css.js +1 -0
  19. package/es/src/business/ap-summary/style/index.d.ts +0 -0
  20. package/es/src/business/ap-summary/style/index.js +1 -0
  21. package/es/src/business/ap-summary/utils.d.ts +12 -0
  22. package/es/src/business/ap-summary/utils.mjs +36 -0
  23. package/es/src/business/index.d.ts +1 -0
  24. package/es/src/business/index.mjs +16 -14
  25. package/es/src/editable-table/utils.mjs +51 -51
  26. package/es/src/hooks/useControllableValue.d.ts +8 -3
  27. package/es/src/hooks/useControllableValue.mjs +18 -13
  28. package/es/src/index.mjs +59 -52
  29. package/es/src/utils/slot.d.ts +9 -1
  30. package/es/src/utils/slot.mjs +10 -6
  31. package/lib/index.js +1 -1
  32. package/lib/src/ap-field/interface.d.ts +6 -0
  33. package/lib/src/ap-field/select/index.vue.js +1 -1
  34. package/lib/src/ap-form/item/index.vue.js +1 -1
  35. package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
  36. package/lib/src/ap-table/ap-table.vue.js +1 -1
  37. package/lib/src/ap-table/constants.d.ts +18 -30
  38. package/lib/src/ap-table/utils.d.ts +33 -3
  39. package/lib/src/ap-table/utils.js +1 -1
  40. package/lib/src/business/ap-summary/ap-summary.vue.d.ts +30 -0
  41. package/lib/src/business/ap-summary/ap-summary.vue.js +1 -0
  42. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -0
  43. package/lib/src/business/ap-summary/index.d.ts +95 -0
  44. package/lib/src/business/ap-summary/index.js +1 -0
  45. package/lib/src/business/ap-summary/interface.d.ts +41 -0
  46. package/lib/src/business/ap-summary/interface.js +1 -0
  47. package/lib/src/business/ap-summary/style/css.d.ts +0 -0
  48. package/lib/src/business/ap-summary/style/css.js +1 -0
  49. package/lib/src/business/ap-summary/style/index.d.ts +0 -0
  50. package/lib/src/business/ap-summary/style/index.js +1 -0
  51. package/lib/src/business/ap-summary/utils.d.ts +12 -0
  52. package/lib/src/business/ap-summary/utils.js +1 -0
  53. package/lib/src/business/index.d.ts +1 -0
  54. package/lib/src/business/index.js +1 -1
  55. package/lib/src/editable-table/utils.js +1 -1
  56. package/lib/src/hooks/useControllableValue.d.ts +8 -3
  57. package/lib/src/hooks/useControllableValue.js +1 -1
  58. package/lib/src/index.js +1 -1
  59. package/lib/src/utils/slot.d.ts +9 -1
  60. package/lib/src/utils/slot.js +1 -1
  61. package/package.json +3 -3
package/es/index.mjs CHANGED
@@ -4,10 +4,10 @@ import "./src/hooks/index.mjs";
4
4
  import { configProviderProps as x } from "./src/config-provider/config-provider-props.mjs";
5
5
  import { configProviderContextKey as u } from "./src/config-provider/constants.mjs";
6
6
  import { keysOf as i, provideGlobalConfig as n, useGlobalConfig as c } from "./src/config-provider/hooks/use-global-config.mjs";
7
- import { buildLocaleContext as b, buildTranslator as T, localeContextKey as I, translate as g, useLocale as C } from "./src/config-provider/hooks/use-locale.mjs";
8
- import { defaultNamespace as h, namespaceContextKey as G, useGetDerivedNamespace as S, useNamespace as L } from "./src/config-provider/hooks/use-namespace.mjs";
9
- import { ConfigProvider as P, globalConfigCached as y } from "./src/config-provider/config-provider.mjs";
10
- import { APConfigProvider as w } from "./src/config-provider/index.mjs";
7
+ import { buildLocaleContext as b, buildTranslator as T, localeContextKey as I, translate as C, useLocale as g } from "./src/config-provider/hooks/use-locale.mjs";
8
+ import { defaultNamespace as h, namespaceContextKey as G, useGetDerivedNamespace as S, useNamespace as y } from "./src/config-provider/hooks/use-namespace.mjs";
9
+ import { ConfigProvider as M, globalConfigCached as P } from "./src/config-provider/config-provider.mjs";
10
+ import { APConfigProvider as k } from "./src/config-provider/index.mjs";
11
11
  import { ApFormItemText as R } from "./src/ap-form/items/text/index.mjs";
12
12
  import { default as E } from "./src/ap-form/items/text-area/index.vue.mjs";
13
13
  import { default as K } from "./src/ap-form/items/number/index.vue.mjs";
@@ -28,13 +28,13 @@ import { default as Ao } from "./src/ap-form/dependency/index.vue.mjs";
28
28
  import { default as no } from "./src/ap-form/set/index.vue.mjs";
29
29
  import { default as Fo } from "./src/ap-form/drawer-form/index.vue.mjs";
30
30
  import { ApField as To } from "./src/ap-field/index.mjs";
31
- import { ApFieldText as go } from "./src/ap-field/text/index.mjs";
31
+ import { ApFieldText as Co } from "./src/ap-field/text/index.mjs";
32
32
  import { default as Do } from "./src/ap-field/checkbox/index.vue.mjs";
33
33
  import { default as Go } from "./src/ap-field/date/index.vue.mjs";
34
- import { default as Lo } from "./src/ap-field/number/index.vue.mjs";
35
- import { default as Po } from "./src/ap-field/radio/index.vue.mjs";
36
- import { default as ko } from "./src/ap-field/switch/index.vue.mjs";
37
- import { default as No } from "./src/ap-field/text-area/index.vue.mjs";
34
+ import { default as yo } from "./src/ap-field/number/index.vue.mjs";
35
+ import { default as Mo } from "./src/ap-field/radio/index.vue.mjs";
36
+ import { default as No } from "./src/ap-field/switch/index.vue.mjs";
37
+ import { default as wo } from "./src/ap-field/text-area/index.vue.mjs";
38
38
  import { default as vo } from "./src/ap-field/date-range/index.vue.mjs";
39
39
  import { default as Bo } from "./src/ap-field/select/index.vue.mjs";
40
40
  import { default as Oo } from "./src/ap-field/text/password.vue.mjs";
@@ -54,13 +54,13 @@ import { default as Ae } from "./src/ap-tag/ap-tag.vue.mjs";
54
54
  import { default as ne } from "./src/ap-tag/ap-tag-group.vue.mjs";
55
55
  import { default as Fe } from "./src/ap-info-layout/ApInfoLayout.vue.mjs";
56
56
  import { NeedNameKeyDefault as Te } from "./src/ap-upload/apUploadTypes.mjs";
57
- import { default as ge } from "./src/ap-upload/apUpload.vue.mjs";
57
+ import { default as Ce } from "./src/ap-upload/apUpload.vue.mjs";
58
58
  import { ApDownLoadNeedNameKeyDefault as De } from "./src/ap-download/interface.mjs";
59
59
  import { default as Ge } from "./src/ap-download/ap-download.vue.mjs";
60
- import { CheckCard as Le } from "./src/check-card/index.mjs";
61
- import { default as Pe } from "./src/check-card/group.vue.mjs";
62
- import { ApModal as ke } from "./src/ap-modal/index.mjs";
63
- import { default as Ne } from "./src/ap-list/index.vue.mjs";
60
+ import { CheckCard as ye } from "./src/check-card/index.mjs";
61
+ import { default as Me } from "./src/check-card/group.vue.mjs";
62
+ import { ApModal as Ne } from "./src/ap-modal/index.mjs";
63
+ import { default as we } from "./src/ap-list/index.vue.mjs";
64
64
  import { default as ve } from "./src/ap-button/ap-button.vue.mjs";
65
65
  import { default as Be } from "./src/ap-button/ap-action-button.vue.mjs";
66
66
  import { ApTransformDataHelper as Oe } from "./src/utils/ap-trans-data/index.mjs";
@@ -81,18 +81,20 @@ import { ApInputRadio as Ar } from "./src/business/ap-input-radio/index.mjs";
81
81
  import { ApLabel as nr, ApLabelGroup as cr } from "./src/business/ap-label/index.mjs";
82
82
  import { locales as br } from "./src/business/ap-ladder/interface.mjs";
83
83
  import { ApLadder as Ir } from "./src/business/ap-ladder/index.mjs";
84
- import { ApSelectLayout as Cr } from "./src/business/ap-select-layout/index.mjs";
84
+ import { ApSelectLayout as gr } from "./src/business/ap-select-layout/index.mjs";
85
85
  import { ApStatus as hr, ApStatusGroup as Gr } from "./src/business/ap-status/index.mjs";
86
- import { ApTitle as Lr } from "./src/business/ap-title/index.mjs";
87
- import { usePageListApTable as Pr } from "./src/business/hooks/usePageListApTable.mjs";
88
- import { useTableRefresh as kr } from "./src/business/hooks/useTableRefresh.mjs";
89
- import { useTablePaging as Nr } from "./src/ap-table/hooks/use-table-paging.mjs";
90
- import { default as vr } from "./src/ap-table/ap-table.vue.mjs";
91
- import { default as Br } from "./src/editable-table/index.vue.mjs";
92
- import { default as Or } from "./src/editable-table/form-item.vue.mjs";
93
- import { default as Hr } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
94
- import { useMessage as Vr } from "./src/hooks/useMessage.mjs";
95
- import { useControllableValue as jr } from "./src/hooks/useControllableValue.mjs";
86
+ import { ApTitle as yr } from "./src/business/ap-title/index.mjs";
87
+ import { usePageListApTable as Mr } from "./src/business/hooks/usePageListApTable.mjs";
88
+ import { useTableRefresh as Nr } from "./src/business/hooks/useTableRefresh.mjs";
89
+ import { computedRecords as wr, flattenColumns as Rr, formatDataIndex as vr, formatNumber as Er } from "./src/business/ap-summary/utils.mjs";
90
+ import { ApSummary as Kr } from "./src/business/ap-summary/index.mjs";
91
+ import { useTablePaging as Wr } from "./src/ap-table/hooks/use-table-paging.mjs";
92
+ import { default as Ur } from "./src/ap-table/ap-table.vue.mjs";
93
+ import { default as $r } from "./src/editable-table/index.vue.mjs";
94
+ import { default as qr } from "./src/editable-table/form-item.vue.mjs";
95
+ import { default as Jr } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
96
+ import { useMessage as Xr } from "./src/hooks/useMessage.mjs";
97
+ import { useControllableValue as Zr } from "./src/hooks/useControllableValue.mjs";
96
98
  const p = {
97
99
  install: (r) => {
98
100
  for (const t in e) {
@@ -102,7 +104,7 @@ const p = {
102
104
  }
103
105
  };
104
106
  export {
105
- w as APConfigProvider,
107
+ k as APConfigProvider,
106
108
  Be as ApActionButton,
107
109
  ae as ApActionGroup,
108
110
  Xo as ApActionItem,
@@ -115,7 +117,7 @@ export {
115
117
  ve as ApButton,
116
118
  _e as ApButtonGroup,
117
119
  er as ApCard,
118
- Hr as ApDescriptions,
120
+ Jr as ApDescriptions,
119
121
  De as ApDownLoadNeedNameKeyDefault,
120
122
  Ge as ApDownload,
121
123
  tr as ApExpandAlert,
@@ -125,16 +127,16 @@ export {
125
127
  Do as ApFieldCheckbox,
126
128
  Go as ApFieldDate,
127
129
  vo as ApFieldDateRange,
128
- Lo as ApFieldNumber,
130
+ yo as ApFieldNumber,
129
131
  Oo as ApFieldPassword,
130
- Po as ApFieldRadio,
132
+ Mo as ApFieldRadio,
131
133
  jo as ApFieldRate,
132
134
  Vo as ApFieldSegmented,
133
135
  Bo as ApFieldSelect,
134
136
  Ho as ApFieldSlider,
135
- ko as ApFieldSwitch,
136
- go as ApFieldText,
137
- No as ApFieldTextArea,
137
+ No as ApFieldSwitch,
138
+ Co as ApFieldText,
139
+ wo as ApFieldTextArea,
138
140
  oo as ApForm,
139
141
  Ao as ApFormDependency,
140
142
  Fo as ApFormDrawerForm,
@@ -160,36 +162,41 @@ export {
160
162
  nr as ApLabel,
161
163
  cr as ApLabelGroup,
162
164
  Ir as ApLadder,
163
- Ne as ApList,
164
- ke as ApModal,
165
- Cr as ApSelectLayout,
165
+ we as ApList,
166
+ Ne as ApModal,
167
+ gr as ApSelectLayout,
166
168
  hr as ApStatus,
167
169
  Gr as ApStatusGroup,
168
- vr as ApTable,
170
+ Kr as ApSummary,
171
+ Ur as ApTable,
169
172
  He as ApTableModal,
170
173
  Ae as ApTag,
171
174
  ne as ApTagGroup,
172
- Lr as ApTitle,
175
+ yr as ApTitle,
173
176
  Oe as ApTransformDataHelper,
174
- ge as ApUpload,
175
- Le as CheckCard,
176
- Pe as CheckCardGroup,
177
- P as ConfigProvider,
177
+ Ce as ApUpload,
178
+ ye as CheckCard,
179
+ Me as CheckCardGroup,
180
+ M as ConfigProvider,
178
181
  fe as DictCode,
179
- Br as EditableTable,
180
- Or as EditableTableFormItem,
182
+ $r as EditableTable,
183
+ qr as EditableTableFormItem,
181
184
  Te as NeedNameKeyDefault,
182
185
  se as WorkOrderModal,
183
186
  zo as adminToken,
184
187
  Jo as aplusToken,
185
188
  b as buildLocaleContext,
186
189
  T as buildTranslator,
190
+ wr as computedRecords,
187
191
  u as configProviderContextKey,
188
192
  x as configProviderProps,
189
193
  de as createWorkOrderModal,
190
194
  p as default,
191
195
  h as defaultNamespace,
192
- y as globalConfigCached,
196
+ Rr as flattenColumns,
197
+ vr as formatDataIndex,
198
+ Er as formatNumber,
199
+ P as globalConfigCached,
193
200
  dr as handleExportDownload,
194
201
  i as keysOf,
195
202
  me as langMap,
@@ -198,16 +205,16 @@ export {
198
205
  G as namespaceContextKey,
199
206
  l as pathMap,
200
207
  n as provideGlobalConfig,
201
- g as translate,
202
- jr as useControllableValue,
208
+ C as translate,
209
+ Zr as useControllableValue,
203
210
  S as useGetDerivedNamespace,
204
211
  c as useGlobalConfig,
205
- C as useLocale,
206
- Vr as useMessage,
207
- L as useNamespace,
208
- Pr as usePageListApTable,
212
+ g as useLocale,
213
+ Xr as useMessage,
214
+ y as useNamespace,
215
+ Mr as usePageListApTable,
209
216
  Ve as useTableModal,
210
- Nr as useTablePaging,
211
- kr as useTableRefresh,
217
+ Wr as useTablePaging,
218
+ Nr as useTableRefresh,
212
219
  je as useTableSelectModal
213
220
  };
@@ -6,6 +6,7 @@ import { RangePickerProps } from 'ant-design-vue/es/date-picker/dayjs';
6
6
  import { LiteralUnion } from '../type';
7
7
  import { InputPasswordProps } from './text/input-password-props';
8
8
  import { ZoneAlias } from '@aplus-frontend/utils';
9
+ import { SelectValue } from 'ant-design-vue/es/select';
9
10
  export type FieldMode = 'read' | 'edit';
10
11
  export type BasicApFieldProps<FieldPropsType = any> = {
11
12
  mode?: FieldMode;
@@ -117,6 +118,11 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
117
118
  * 是否延迟请求选项列表
118
119
  */
119
120
  lazy?: boolean;
121
+ /**
122
+ * 选中之前调用,如果返回false,则不更新值,支持异步
123
+ * @returns
124
+ */
125
+ onBeforeSelect?: (newVal: SelectValue) => boolean | Promise<boolean>;
120
126
  };
121
127
  export type ApFieldSelectExpose = {
122
128
  focus: () => void;
@@ -1,5 +1,5 @@
1
- import { defineComponent as T, ref as p, onMounted as _, computed as y, unref as u, openBlock as w, createElementBlock as R, toDisplayString as z, createBlock as D, mergeProps as U, createSlots as L, renderList as K, withCtx as S, renderSlot as H, normalizeProps as $, guardReactiveProps as j, createVNode as E } from "vue";
2
- import { debounce as W, isFunction as g, isArray as G, isNil as J, omit as Q } from "lodash-unified";
1
+ import { defineComponent as T, ref as p, onMounted as _, computed as y, unref as u, openBlock as S, createElementBlock as R, toDisplayString as U, createBlock as z, mergeProps as D, createSlots as L, renderList as K, withCtx as w, renderSlot as H, normalizeProps as $, guardReactiveProps as j, createVNode as E } from "vue";
2
+ import { debounce as W, isFunction as B, isArray as G, isNil as J, omit as Q } from "lodash-unified";
3
3
  import { Select as X, Spin as Y } from "ant-design-vue";
4
4
  import "../../hooks/index.mjs";
5
5
  import { omitUndefined as Z } from "../../utils/index.mjs";
@@ -90,13 +90,14 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
90
90
  "onUpdate:value": {},
91
91
  searchMode: { default: "filter" },
92
92
  refetchOnFocus: { type: Boolean, default: !1 },
93
- lazy: { type: Boolean, default: !1 }
93
+ lazy: { type: Boolean, default: !1 },
94
+ onBeforeSelect: {}
94
95
  },
95
96
  emits: ["update:value"],
96
- setup(B, { expose: F, emit: b }) {
97
+ setup(g, { expose: F, emit: b }) {
97
98
  let n = 0;
98
99
  const C = W((o) => {
99
- if (!g(e.request))
100
+ if (!B(e.request))
100
101
  return;
101
102
  n += 1;
102
103
  const t = n;
@@ -105,13 +106,13 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
105
106
  }).finally(() => {
106
107
  r.value = !1;
107
108
  });
108
- }, 300), e = B, N = (o, t) => {
109
+ }, 300), e = g, N = (o, t) => {
109
110
  var a;
110
111
  const l = ((a = e.fieldNames) == null ? void 0 : a.label) || "label";
111
112
  return typeof (t == null ? void 0 : t[l]) == "string" && t[l].indexOf(o) > -1;
112
113
  }, i = p((e == null ? void 0 : e.options) || []), s = p(), r = p((e == null ? void 0 : e.loading) || !1), x = b;
113
114
  async function c(o = !0) {
114
- if (!g(e.request))
115
+ if (!B(e.request))
115
116
  return;
116
117
  r.value = !0, n += 1;
117
118
  const t = n;
@@ -136,7 +137,7 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
136
137
  }
137
138
  c();
138
139
  });
139
- const { value: m, updateValue: O } = oe(e, x), P = ee("Select", e), V = y(() => {
140
+ const { value: m, updateValue: V } = oe(e, x, { beforeUpdateValue: e.onBeforeSelect }), O = ee("Select", e), P = y(() => {
140
141
  var d, v;
141
142
  const o = u(m);
142
143
  if (!o)
@@ -176,7 +177,7 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
176
177
  "onFocus"
177
178
  ])
178
179
  ),
179
- placeholder: u(P),
180
+ placeholder: u(O),
180
181
  ...l
181
182
  };
182
183
  });
@@ -192,7 +193,7 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
192
193
  focus: q,
193
194
  blur: A,
194
195
  request: c
195
- }), (o, t) => o.mode === "read" ? (w(), R("span", te, z(V.value), 1)) : (w(), D(u(X), U({
196
+ }), (o, t) => o.mode === "read" ? (S(), R("span", te, U(P.value), 1)) : (S(), z(u(X), D({
196
197
  key: 1,
197
198
  "allow-clear": "",
198
199
  ref_key: "selectRef",
@@ -200,20 +201,20 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
200
201
  }, k.value, {
201
202
  mode: o.multiple ? "multiple" : void 0,
202
203
  value: u(m),
203
- "onUpdate:value": u(O),
204
+ "onUpdate:value": u(V),
204
205
  options: i.value,
205
206
  loading: r.value,
206
207
  onFocus: I
207
208
  }), L({ _: 2 }, [
208
209
  K(o.$slots, (l, a) => ({
209
210
  name: a,
210
- fn: S((d) => [
211
+ fn: w((d) => [
211
212
  H(o.$slots, a, $(j(d || {})))
212
213
  ])
213
214
  })),
214
215
  r.value ? {
215
216
  name: "notFoundContent",
216
- fn: S(() => [
217
+ fn: w(() => [
217
218
  E(u(Y), { size: "small" })
218
219
  ]),
219
220
  key: "0"
@@ -1,14 +1,15 @@
1
- import { defineComponent as j, useSlots as q, ref as d, onMounted as E, computed as B, unref as l, watch as K, cloneVNode as Q, openBlock as V, createBlock as g, mergeProps as U, createSlots as G, withCtx as i, resolveDynamicComponent as H, createCommentVNode as J, createElementVNode as C, normalizeClass as M, createVNode as k, normalizeStyle as W, toDisplayString as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as oe } from "vue";
2
- import { Form as le, Tooltip as te } from "ant-design-vue";
3
- import { useToken as re } from "ant-design-vue/es/theme/internal";
4
- import { isFunction as N, cloneDeep as ae, isArray as ne, omit as P } from "lodash-unified";
5
- import { apFormItemColPropKeys as ie } from "../constant.mjs";
6
- import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
1
+ import { defineComponent as O, useSlots as $, ref as f, onMounted as j, computed as b, unref as l, watch as q, cloneVNode as E, openBlock as F, createBlock as g, mergeProps as K, createSlots as Q, withCtx as i, resolveDynamicComponent as U, createCommentVNode as G, createElementVNode as h, normalizeClass as H, createVNode as B, normalizeStyle as J, toDisplayString as M, renderList as W, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
+ import { Form as ee, Tooltip as oe } from "ant-design-vue";
3
+ import { useToken as le } from "ant-design-vue/es/theme/internal";
4
+ import { isFunction as C, cloneDeep as te, isArray as ae, omit as N } from "lodash-unified";
5
+ import { apFormItemColPropKeys as re } from "../constant.mjs";
6
+ import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
7
7
  import "../../config-provider/index.mjs";
8
- import { useInjectForm as se } from "../context.mjs";
9
- import { isPromise as fe } from "@fruits-chain/utils";
10
- import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
11
- const de = ["title"], Ce = /* @__PURE__ */ j({
8
+ import { useInjectForm as ie } from "../context.mjs";
9
+ import { isPromise as se } from "@fruits-chain/utils";
10
+ import { getSingleVNode as ue, getValidVNodeList as me } from "../../utils/slot.mjs";
11
+ import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
12
+ const fe = ["title"], Ne = /* @__PURE__ */ O({
12
13
  name: "ApFormItem",
13
14
  __name: "index",
14
15
  props: {
@@ -52,58 +53,57 @@ const de = ["title"], Ce = /* @__PURE__ */ j({
52
53
  _signal: {},
53
54
  transform: {}
54
55
  },
55
- setup(S, { expose: w }) {
56
- var b, F;
57
- const o = S, r = q(), { model: u, updateModel: s, internalInstance: f } = se(), { m: p, b: x } = me("ap-form-item"), m = d(!1), n = d(), [, I] = re();
58
- E(async () => {
59
- let e = N(o.initialValue) ? o.initialValue() : o.initialValue;
60
- fe(e) && (e = await e), f == null || f.registerField({
56
+ setup(k, { expose: w }) {
57
+ const o = k, r = $(), { model: s, updateModel: u, internalInstance: m } = ie(), { m: p, b: P } = de("ap-form-item"), d = f(!1), n = f(), [, S] = le();
58
+ j(async () => {
59
+ let e = C(o.initialValue) ? o.initialValue() : o.initialValue;
60
+ se(e) && (e = await e), m == null || m.registerField({
61
61
  name: o.name,
62
- initialValue: ae(e),
62
+ initialValue: te(e),
63
63
  transform: o.transform
64
64
  });
65
65
  });
66
- const c = B(() => o.name ? ne(o.name) ? o.name.reduce((e, t) => e == null ? void 0 : e[t], l(u)) : u == null ? void 0 : u.value[o.name] : null), v = d((F = (b = r.default) == null ? void 0 : b.call(r)) == null ? void 0 : F[0]);
67
- K(
66
+ const c = b(() => o.name ? ae(o.name) ? o.name.reduce((e, t) => e == null ? void 0 : e[t], l(s)) : s == null ? void 0 : s.value[o.name] : null), v = f(ue(r.default));
67
+ q(
68
68
  () => {
69
69
  var e;
70
70
  return (e = r.default) == null ? void 0 : e.call(r);
71
71
  },
72
72
  (e) => {
73
- v.value = e == null ? void 0 : e[0];
73
+ v.value = me(e)[0];
74
74
  }
75
75
  );
76
- function _(e) {
77
- s == null || s(o.name, e);
76
+ function x(e) {
77
+ u == null || u(o.name, e);
78
78
  }
79
- function z() {
80
- m.value = !0;
79
+ function I() {
80
+ d.value = !0;
81
81
  }
82
- function A() {
83
- m.value = !1;
82
+ function _() {
83
+ d.value = !1;
84
84
  }
85
- const y = B(() => {
85
+ const y = b(() => {
86
86
  var t, a;
87
87
  if (!o.name)
88
88
  return (t = r.default()) == null ? void 0 : t[0];
89
89
  const e = l(v);
90
- return e ? Q(e, {
90
+ return e ? E(e, {
91
91
  [o.valuePropName]: l(c),
92
- [`onUpdate:${o.valuePropName}`]: _,
92
+ [`onUpdate:${o.valuePropName}`]: x,
93
93
  bordered: o.bordered ? !1 : (a = e == null ? void 0 : e.props) == null ? void 0 : a.bordered,
94
- onFocus: z,
95
- onBlur: A
94
+ onFocus: I,
95
+ onBlur: _
96
96
  }) : null;
97
97
  });
98
- function D() {
98
+ function z() {
99
99
  var e;
100
100
  (e = n.value) == null || e.onFieldBlur();
101
101
  }
102
- function R() {
102
+ function A() {
103
103
  var e;
104
104
  (e = n.value) == null || e.onFieldChange();
105
105
  }
106
- function T() {
106
+ function D() {
107
107
  var e;
108
108
  (e = n.value) == null || e.clearValidate();
109
109
  }
@@ -111,47 +111,47 @@ const de = ["title"], Ce = /* @__PURE__ */ j({
111
111
  var e;
112
112
  (e = n.value) == null || e.resetField();
113
113
  }
114
- function O(e = !1) {
114
+ function R(e = !1) {
115
115
  const t = l(c);
116
116
  if (!e || !o.transform)
117
117
  return t;
118
- const a = N(o.transform) ? o.transform : o.transform.transformer;
118
+ const a = C(o.transform) ? o.transform : o.transform.transformer;
119
119
  return o.transform ? a(t) : t;
120
120
  }
121
121
  return w({
122
- onFieldBlur: D,
123
- onFieldChange: R,
124
- clearValidate: T,
122
+ onFieldBlur: z,
123
+ onFieldChange: A,
124
+ clearValidate: D,
125
125
  resetField: L,
126
- getFieldValue: O
127
- }), (e, t) => (V(), g(l(le).Item, U({
126
+ getFieldValue: R
127
+ }), (e, t) => (F(), g(l(ee).Item, K({
128
128
  ref_key: "formItemRef",
129
129
  ref: n
130
- }, l(P)(o, [...l(ie), "tooltip", "label"]), {
130
+ }, l(N)(o, [...l(re), "tooltip", "label"]), {
131
131
  class: {
132
132
  [l(p)("bordered")]: e.bordered,
133
- [l(p)("focused")]: e.bordered && m.value,
134
- [l(x)()]: !0
133
+ [l(p)("focused")]: e.bordered && d.value,
134
+ [l(P)()]: !0
135
135
  },
136
136
  colon: e.bordered ? !1 : o.colon
137
- }), G({
137
+ }), Q({
138
138
  default: i(() => [
139
- y.value ? (V(), g(H(y.value), { key: 0 })) : J("", !0)
139
+ y.value ? (F(), g(U(y.value), { key: 0 })) : G("", !0)
140
140
  ]),
141
141
  _: 2
142
142
  }, [
143
143
  o.tooltip ? {
144
144
  name: "tooltip",
145
145
  fn: i(({ class: a }) => [
146
- C("span", {
147
- class: M(a)
146
+ h("span", {
147
+ class: H(a)
148
148
  }, [
149
- k(l(te), {
149
+ B(l(oe), {
150
150
  title: o.tooltip
151
151
  }, {
152
152
  default: i(() => [
153
- k(l(ue), {
154
- style: W({ color: l(I).colorPrimary })
153
+ B(l(ne), {
154
+ style: J({ color: l(S).colorPrimary })
155
155
  }, null, 8, ["style"])
156
156
  ]),
157
157
  _: 1
@@ -163,26 +163,26 @@ const de = ["title"], Ce = /* @__PURE__ */ j({
163
163
  e.label ? {
164
164
  name: "label",
165
165
  fn: i(() => [
166
- C("span", {
166
+ h("span", {
167
167
  title: e.label,
168
168
  style: {
169
169
  whiteSpace: "nowrap",
170
170
  overflow: "hidden",
171
171
  textOverflow: "ellipsis"
172
172
  }
173
- }, X(e.label), 9, de)
173
+ }, M(e.label), 9, fe)
174
174
  ]),
175
175
  key: "1"
176
176
  } : void 0,
177
- Y(l(P)(r, "default"), (a, h) => ({
178
- name: h,
179
- fn: i(($) => [
180
- Z(e.$slots, h, ee(oe($ || {})))
177
+ W(l(N)(r, "default"), (a, V) => ({
178
+ name: V,
179
+ fn: i((T) => [
180
+ X(e.$slots, V, Y(Z(T || {})))
181
181
  ])
182
182
  }))
183
183
  ]), 1040, ["class", "colon"]));
184
184
  }
185
185
  });
186
186
  export {
187
- Ce as default
187
+ Ne as default
188
188
  };
@@ -37,6 +37,7 @@ declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __V
37
37
  summary?: (params: {
38
38
  columns: ColumnType<RecordType>[];
39
39
  records: RecordType[];
40
+ selectedRows: RecordType[];
40
41
  }) => any;
41
42
  expandedRowRender?: any;
42
43
  expandColumnTitle?: any;
@@ -60,6 +61,7 @@ declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __V
60
61
  summary?: (params: {
61
62
  columns: ColumnType<RecordType>[];
62
63
  records: RecordType[];
64
+ selectedRows: RecordType[];
63
65
  }) => any;
64
66
  expandedRowRender?: any;
65
67
  expandColumnTitle?: any;