@aplus-frontend/ui 6.32.0 → 6.33.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 (62) hide show
  1. package/es/index.mjs +39 -37
  2. package/es/src/ag-grid/editable/form-item.vue.d.ts +16 -0
  3. package/es/src/ag-grid/editable/form-item.vue.mjs +215 -0
  4. package/es/src/ag-grid/editable/form-item.vue2.mjs +4 -0
  5. package/es/src/ag-grid/hooks/use-editable-api.mjs +39 -39
  6. package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
  7. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +174 -0
  8. package/es/src/ag-grid/index.d.ts +2 -1
  9. package/es/src/ag-grid/index.mjs +1 -0
  10. package/es/src/ap-drawer/interface.d.ts +5 -0
  11. package/es/src/ap-drawer/utils/createDrawer.mjs +22 -19
  12. package/es/src/ap-modal/index.d.ts +1 -0
  13. package/es/src/ap-modal/index.mjs +29 -27
  14. package/es/src/ap-modal/interface.d.ts +5 -0
  15. package/es/src/ap-modal/utils/confirm.mjs +35 -34
  16. package/es/src/ap-modal/utils/createModal.mjs +39 -37
  17. package/es/src/ap-modal/utils/util.d.ts +3 -0
  18. package/es/src/ap-modal/utils/util.mjs +8 -2
  19. package/es/src/business/ap-view/ap-view.vue2.mjs +20 -18
  20. package/es/src/business/ap-view/interface.d.ts +4 -0
  21. package/es/src/config-provider/config-provider.mjs +32 -24
  22. package/es/src/index.mjs +15 -13
  23. package/es/src/version.d.ts +1 -1
  24. package/es/src/version.mjs +1 -1
  25. package/lib/index.js +1 -1
  26. package/lib/src/ag-grid/editable/form-item.vue.d.ts +16 -0
  27. package/lib/src/ag-grid/editable/form-item.vue.js +1 -0
  28. package/lib/src/ag-grid/editable/form-item.vue2.js +1 -0
  29. package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
  30. package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
  31. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -0
  32. package/lib/src/ag-grid/index.d.ts +2 -1
  33. package/lib/src/ag-grid/index.js +1 -1
  34. package/lib/src/ap-drawer/interface.d.ts +5 -0
  35. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  36. package/lib/src/ap-modal/index.d.ts +1 -0
  37. package/lib/src/ap-modal/index.js +1 -1
  38. package/lib/src/ap-modal/interface.d.ts +5 -0
  39. package/lib/src/ap-modal/utils/confirm.js +1 -1
  40. package/lib/src/ap-modal/utils/createModal.js +1 -1
  41. package/lib/src/ap-modal/utils/util.d.ts +3 -0
  42. package/lib/src/ap-modal/utils/util.js +1 -1
  43. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  44. package/lib/src/business/ap-view/interface.d.ts +4 -0
  45. package/lib/src/config-provider/config-provider.js +1 -1
  46. package/lib/src/index.js +1 -1
  47. package/lib/src/version.d.ts +1 -1
  48. package/lib/src/version.js +1 -1
  49. package/package.json +1 -1
  50. package/theme/ag-grid/index.css +2 -1
  51. package/theme/ag-grid/index.less +1 -0
  52. package/theme/ap-form/ap-form-item.css +1 -1
  53. package/theme/ap-form/ap-form-item.less +1 -1
  54. package/theme/ap-form/index.css +1 -1
  55. package/theme/ap-form/search-form.css +1 -1
  56. package/theme/ap-grid/index.css +1 -1
  57. package/theme/ap-table/ap-table.css +1 -1
  58. package/theme/ap-table-modal/index.css +1 -1
  59. package/theme/css-var.css +2 -0
  60. package/theme/css-var.less +4 -0
  61. package/theme/editable-table/index.css +1 -1
  62. package/theme/index.css +4 -1
package/es/index.mjs CHANGED
@@ -4,9 +4,9 @@ import p from "./src/version.mjs";
4
4
  import "./src/hooks/index.mjs";
5
5
  import { configProviderProps as A } from "./src/config-provider/config-provider-props.mjs";
6
6
  import { DEFAULT_NAMESPACE as n, DEFAULT_UIMODE as c, configProviderContextKey as F } from "./src/config-provider/constants.mjs";
7
- import { keysOf as T, provideGlobalConfig as g, useGlobalConfig as b } from "./src/config-provider/hooks/use-global-config.mjs";
7
+ import { keysOf as g, provideGlobalConfig as T, useGlobalConfig as b } from "./src/config-provider/hooks/use-global-config.mjs";
8
8
  import { buildLocaleContext as S, buildTranslator as G, localeContextKey as D, translate as h, useLocale as P } from "./src/config-provider/hooks/use-locale.mjs";
9
- import { defaultNamespace as E, namespaceContextKey as L, useGetDerivedNamespace as M, useNamespace as N } from "./src/config-provider/hooks/use-namespace.mjs";
9
+ import { defaultNamespace as R, namespaceContextKey as L, useGetDerivedNamespace as M, useNamespace as N } from "./src/config-provider/hooks/use-namespace.mjs";
10
10
  import { ConfigProvider as y, globalConfigCached as w } from "./src/config-provider/config-provider.mjs";
11
11
  import { APConfigProvider as B } from "./src/config-provider/index.mjs";
12
12
  import { ApFormItemText as O } from "./src/ap-form/items/text/index.mjs";
@@ -26,12 +26,12 @@ import { default as se } from "./src/ap-form/item-group/index.vue.mjs";
26
26
  import { default as Ae } from "./src/ap-form/list/index.vue.mjs";
27
27
  import { default as ne } from "./src/ap-form/search-form/index.vue.mjs";
28
28
  import { default as Fe } from "./src/ap-form/modal-form/index.vue.mjs";
29
- import { default as Te } from "./src/ap-form/dependency/index.vue.mjs";
29
+ import { default as ge } from "./src/ap-form/dependency/index.vue.mjs";
30
30
  import { default as be } from "./src/ap-form/set/index.vue.mjs";
31
31
  import { default as Se } from "./src/ap-form/drawer-form/index.vue.mjs";
32
32
  import { default as De } from "./src/ap-form/render/control.vue.mjs";
33
33
  import { default as Pe } from "./src/ap-form/render/item.vue.mjs";
34
- import { default as Ee } from "./src/ap-form/provider/index.vue.mjs";
34
+ import { default as Re } from "./src/ap-form/provider/index.vue.mjs";
35
35
  import { ApField as Me, ApFieldRead as Ne } from "./src/ap-field/index.mjs";
36
36
  import { ApFieldText as ye } from "./src/ap-field/text/index.mjs";
37
37
  import { default as ke } from "./src/ap-field/checkbox/index.vue.mjs";
@@ -52,11 +52,11 @@ import { ApActionItem as uo } from "./src/ap-action/index.mjs";
52
52
  import { default as io } from "./src/ap-action/item-modal/index.vue.mjs";
53
53
  import { default as co } from "./src/ap-action/item-popconfirm/index.vue.mjs";
54
54
  import { default as Io } from "./src/ap-action/item-dropdown/index.vue.mjs";
55
- import { default as go } from "./src/ap-action/group/index.vue.mjs";
55
+ import { default as To } from "./src/ap-action/group/index.vue.mjs";
56
56
  import { DictCode as Co, langMap as So } from "./src/work-order-modal/interfaces.mjs";
57
57
  import { createWorkOrderModal as Do } from "./src/work-order-modal/createWorkOrder.mjs";
58
58
  import { default as Po } from "./src/work-order-modal/work-order-modal.vue.mjs";
59
- import { default as Eo } from "./src/ap-tag/ap-tag.vue.mjs";
59
+ import { default as Ro } from "./src/ap-tag/ap-tag.vue.mjs";
60
60
  import { default as Mo } from "./src/ap-tag/ap-tag-group.vue.mjs";
61
61
  import { NeedNameKeyDefault as vo } from "./src/ap-upload/apUploadTypes.mjs";
62
62
  import { default as wo } from "./src/ap-upload/apUpload.vue.mjs";
@@ -78,11 +78,11 @@ import { useTableSelectModal as ur } from "./src/business/ap-table-modal/hooks/u
78
78
  import { ApAttachment as ir } from "./src/business/ap-attachment/index.mjs";
79
79
  import { ApBatchAction as cr } from "./src/business/ap-batch-action/index.mjs";
80
80
  import { ApBatchActionGroup as Ir } from "./src/business/ap-batch-action-group/index.mjs";
81
- import { ApButtonGroup as gr } from "./src/business/ap-button-group/index.mjs";
81
+ import { ApButtonGroup as Tr } from "./src/business/ap-button-group/index.mjs";
82
82
  import { ApCard as Cr } from "./src/business/ap-card/index.mjs";
83
83
  import { ApExpandAlert as Gr } from "./src/business/ap-expand-alert/index.mjs";
84
84
  import { ApExportGroupActionType as hr } from "./src/business/ap-export-group/interface.mjs";
85
- import { ApExportGroup as Rr } from "./src/business/ap-export-group/index.mjs";
85
+ import { ApExportGroup as Er } from "./src/business/ap-export-group/index.mjs";
86
86
  import { handleExportDownload as Lr } from "./src/business/ap-export-group/handleExportDownload.mjs";
87
87
  import { convertExportField as Nr } from "./src/business/ap-export-group/convertExportField.mjs";
88
88
  import { ApImage as yr } from "./src/business/ap-image/index.mjs";
@@ -102,12 +102,12 @@ import { computedRecords as lt, flattenColumns as xt, formatDataIndex as dt, for
102
102
  import { ApSummary as At } from "./src/business/ap-summary/index.mjs";
103
103
  import { ApNeedNameKeyDefault as nt } from "./src/business/ap-appendix/interface.mjs";
104
104
  import { ApAppendix as Ft } from "./src/business/ap-appendix/index.mjs";
105
- import { default as Tt } from "./src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs";
105
+ import { default as gt } from "./src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs";
106
106
  import { default as bt } from "./src/business/batch-input-group/index.vue.mjs";
107
107
  import { default as St } from "./src/business/batch-input-group/form-item.vue.mjs";
108
108
  import { ApSizeInput as Dt } from "./src/business/ap-size-input/index.mjs";
109
109
  import { ApProductInfo as Pt } from "./src/business/ap-product-info/index.mjs";
110
- import { ApCopy as Et } from "./src/business/ap-copy/index.mjs";
110
+ import { ApCopy as Rt } from "./src/business/ap-copy/index.mjs";
111
111
  import { ApView as Mt } from "./src/business/ap-view/index.mjs";
112
112
  import { ApRadioGroup as vt } from "./src/business/ap-radio-group/index.mjs";
113
113
  import { ApKeepAliveProps as wt, forceStopTags as kt } from "./src/business/ap-keep-alive/interface.mjs";
@@ -129,23 +129,24 @@ import { default as up } from "./src/scroll-view/index.vue.mjs";
129
129
  import { default as ip } from "./src/portal/index.vue.mjs";
130
130
  import { default as cp } from "./src/full-screen/index.vue.mjs";
131
131
  import { default as Ip } from "./src/resize-observer/index.vue.mjs";
132
- import { ROW_SELECTION_FIELD as gp } from "./src/ap-grid/constants.mjs";
132
+ import { ROW_SELECTION_FIELD as Tp } from "./src/ap-grid/constants.mjs";
133
133
  import { toTreeArray as Cp } from "./src/ap-grid/utils/to-tree-array.mjs";
134
134
  import { default as Gp } from "./src/ap-grid/index.vue.mjs";
135
135
  import { default as hp } from "./src/ap-grid/editable/index.vue.mjs";
136
- import { default as Rp } from "./src/ap-grid/editable/form-item.vue.mjs";
136
+ import { default as Ep } from "./src/ap-grid/editable/form-item.vue.mjs";
137
137
  import { default as Lp } from "./src/text/index.vue.mjs";
138
138
  import { default as Np } from "./src/text/group.vue.mjs";
139
139
  import { default as yp } from "./src/mask/index.vue.mjs";
140
140
  import { Splitter as kp } from "./src/splitter/index.mjs";
141
141
  import { default as Kp } from "./src/ag-grid/index.vue.mjs";
142
142
  import { default as Up } from "./src/ag-grid/editable/index.vue.mjs";
143
- import { useMessage as _p } from "./src/hooks/useMessage.mjs";
144
- import { useControllableValue as Wp } from "./src/hooks/useControllableValue.mjs";
145
- import { useManualRef as jp } from "./src/hooks/useManualRef.mjs";
146
- import { useThrottleRef as qp } from "./src/hooks/useThrottleRef.mjs";
147
- import { useFullScreen as Qp } from "./src/hooks/useFullScreen.mjs";
148
- import { useResize as Yp } from "./src/hooks/useResize.mjs";
143
+ import { default as _p } from "./src/ag-grid/editable/form-item.vue.mjs";
144
+ import { useMessage as Wp } from "./src/hooks/useMessage.mjs";
145
+ import { useControllableValue as jp } from "./src/hooks/useControllableValue.mjs";
146
+ import { useManualRef as qp } from "./src/hooks/useManualRef.mjs";
147
+ import { useThrottleRef as Qp } from "./src/hooks/useThrottleRef.mjs";
148
+ import { useFullScreen as Yp } from "./src/hooks/useFullScreen.mjs";
149
+ import { useResize as ea } from "./src/hooks/useResize.mjs";
149
150
  const a = console.log;
150
151
  a(`APlus-UI version ${p}`);
151
152
  const l = {
@@ -160,7 +161,7 @@ export {
160
161
  B as APConfigProvider,
161
162
  Kp as AgGrid,
162
163
  Xo as ApActionButton,
163
- go as ApActionGroup,
164
+ To as ApActionGroup,
164
165
  uo as ApActionItem,
165
166
  Io as ApActionItemDropdown,
166
167
  io as ApActionItemModal,
@@ -170,17 +171,17 @@ export {
170
171
  cr as ApBatchAction,
171
172
  Ir as ApBatchActionGroup,
172
173
  Jo as ApButton,
173
- gr as ApButtonGroup,
174
+ Tr as ApButtonGroup,
174
175
  Cr as ApCard,
175
176
  Zo as ApConfirmButton,
176
- Et as ApCopy,
177
+ Rt as ApCopy,
177
178
  pp as ApDescriptions,
178
179
  Bo as ApDownLoadNeedNameKeyDefault,
179
180
  Oo as ApDownload,
180
181
  jt as ApDraggableGrid,
181
182
  or as ApDrawer,
182
183
  Gr as ApExpandAlert,
183
- Rr as ApExportGroup,
184
+ Er as ApExportGroup,
184
185
  hr as ApExportGroupActionType,
185
186
  Me as ApField,
186
187
  ke as ApFieldCheckbox,
@@ -200,7 +201,7 @@ export {
200
201
  fo as ApFieldTreeSelect,
201
202
  me as ApForm,
202
203
  De as ApFormControlRender,
203
- Te as ApFormDependency,
204
+ ge as ApFormDependency,
204
205
  Se as ApFormDrawerForm,
205
206
  xe as ApFormItem,
206
207
  St as ApFormItemBatchInput,
@@ -219,7 +220,7 @@ export {
219
220
  ae as ApFormItemTreeSelect,
220
221
  Ae as ApFormList,
221
222
  Fe as ApFormModalForm,
222
- Ee as ApFormProvider,
223
+ Re as ApFormProvider,
223
224
  ne as ApFormSearchForm,
224
225
  be as ApFormSet,
225
226
  Gp as ApGrid,
@@ -244,14 +245,14 @@ export {
244
245
  At as ApSummary,
245
246
  Yt as ApTable,
246
247
  lr as ApTableModal,
247
- Eo as ApTag,
248
+ Ro as ApTag,
248
249
  Mo as ApTagGroup,
249
250
  Lp as ApText,
250
251
  Np as ApTextGroup,
251
252
  Qr as ApTitle,
252
253
  fr as ApTransformDataHelper,
253
254
  wo as ApUpload,
254
- Tt as ApUploadSingle,
255
+ gt as ApUploadSingle,
255
256
  qt as ApValueSelectCard,
256
257
  Mt as ApView,
257
258
  bt as BatchInputGroup,
@@ -262,8 +263,9 @@ export {
262
263
  c as DEFAULT_UIMODE,
263
264
  Co as DictCode,
264
265
  Up as EditableAgGrid,
266
+ _p as EditableAgGridFormItem,
265
267
  hp as EditableGrid,
266
- Rp as EditableGridFormItem,
268
+ Ep as EditableGridFormItem,
267
269
  ep as EditableTable,
268
270
  rp as EditableTableFormItem,
269
271
  cp as FullScreen,
@@ -272,7 +274,7 @@ export {
272
274
  yp as Mask,
273
275
  vo as NeedNameKeyDefault,
274
276
  ip as Portal,
275
- gp as ROW_SELECTION_FIELD,
277
+ Tp as ROW_SELECTION_FIELD,
276
278
  Ip as ResizeObserver,
277
279
  lp as ScrollBar,
278
280
  up as ScrollView,
@@ -288,7 +290,7 @@ export {
288
290
  Nr as convertExportField,
289
291
  Do as createWorkOrderModal,
290
292
  l as default,
291
- E as defaultNamespace,
293
+ R as defaultNamespace,
292
294
  fp as ensureRangeValue,
293
295
  xt as flattenColumns,
294
296
  kt as forceStopTags,
@@ -297,32 +299,32 @@ export {
297
299
  w as globalConfigCached,
298
300
  Lr as handleExportDownload,
299
301
  Wt as isNameMatches,
300
- T as keysOf,
302
+ g as keysOf,
301
303
  So as langMap,
302
304
  D as localeContextKey,
303
305
  Vr as locales,
304
306
  L as namespaceContextKey,
305
307
  s as pathMap,
306
- g as provideGlobalConfig,
308
+ T as provideGlobalConfig,
307
309
  Cp as toTreeArray,
308
310
  h as translate,
309
311
  _t as useApKeepAliveInject,
310
- Wp as useControllableValue,
311
- Qp as useFullScreen,
312
+ jp as useControllableValue,
313
+ Yp as useFullScreen,
312
314
  M as useGetDerivedNamespace,
313
315
  b as useGlobalConfig,
314
316
  pt as useGridRefresh,
315
317
  P as useLocale,
316
- jp as useManualRef,
317
- _p as useMessage,
318
+ qp as useManualRef,
319
+ Wp as useMessage,
318
320
  N as useNamespace,
319
321
  ft as usePageListAgGrid,
320
322
  rt as usePageListApGrid,
321
323
  Yr as usePageListApTable,
322
- Yp as useResize,
324
+ ea as useResize,
323
325
  dr as useTableModal,
324
326
  Qt as useTablePaging,
325
327
  et as useTableRefresh,
326
328
  ur as useTableSelectModal,
327
- qp as useThrottleRef
329
+ Qp as useThrottleRef
328
330
  };
@@ -0,0 +1,16 @@
1
+ import { EditableAgGridFormItemExpose, EditableAgGridFormItemProps } from './interface';
2
+ import { Recordable } from '../../type';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
+ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableAgGridFormItemProps<RecordType> & Partial<{}>> & PublicProps;
6
+ expose(exposed: ShallowUnwrapRef<EditableAgGridFormItemExpose<RecordType>>): void;
7
+ attrs: any;
8
+ slots: Readonly<Record<string, any>> & Record<string, any>;
9
+ emit: {};
10
+ }>) => VNode & {
11
+ __ctx?: Awaited<typeof __VLS_setup>;
12
+ };
13
+ export default _default;
14
+ type __VLS_PrettifyLocal<T> = {
15
+ [K in keyof T]: T[K];
16
+ } & {};
@@ -0,0 +1,215 @@
1
+ import { defineComponent as A, useSlots as K, ref as w, onMounted as P, unref as a, watch as G, createElementBlock as H, openBlock as M, Fragment as O, createVNode as d, mergeProps as y, withCtx as g, createSlots as W, renderList as U, renderSlot as $, normalizeProps as q, guardReactiveProps as J } from "vue";
2
+ import { ApForm as h } from "../../ap-form/index.mjs";
3
+ import { cloneDeep as Q, isEqual as X, omit as C } from "lodash-unified";
4
+ import "../../config-provider/index.mjs";
5
+ import { useGetEditableColumns as Y } from "../hooks/use-editable-columns.mjs";
6
+ import "../index.vue2.mjs";
7
+ import { useEditableFormItemApi as Z } from "../hooks/use-editable-form-item-api.mjs";
8
+ import { useInjectForm as ee } from "../../ap-form/context.mjs";
9
+ import { getModelValue as oe } from "../../ap-form/utils/get.mjs";
10
+ import { getShadowName as ae } from "../utils.mjs";
11
+ import { useWatch as te } from "../../ap-form/hooks/use-watch.mjs";
12
+ import { arrayToObject as ne } from "./utils.mjs";
13
+ import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import { useGlobalConfig as re } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import se from "../index.vue.mjs";
16
+ const xe = /* @__PURE__ */ A({
17
+ name: "EditableGrid",
18
+ __name: "form-item",
19
+ props: {
20
+ dropdownPrefixCls: {},
21
+ bordered: {
22
+ type: Boolean
23
+ },
24
+ locale: {},
25
+ onResizeColumn: {},
26
+ getPopupContainer: {},
27
+ scroll: {},
28
+ sortDirections: {},
29
+ showSorterTooltip: {
30
+ type: [Boolean, Object]
31
+ },
32
+ prefixCls: {},
33
+ rowKey: {
34
+ type: [String, Function],
35
+ default: "key"
36
+ },
37
+ tableLayout: {},
38
+ title: {},
39
+ id: {},
40
+ showHeader: {
41
+ type: Boolean
42
+ },
43
+ components: {},
44
+ customRow: {},
45
+ customHeaderRow: {},
46
+ direction: {},
47
+ expandFixed: {
48
+ type: [String, Boolean]
49
+ },
50
+ expandColumnWidth: {},
51
+ expandedRowKeys: {},
52
+ defaultExpandedRowKeys: {},
53
+ expandedRowRender: {},
54
+ expandRowByClick: {
55
+ type: Boolean
56
+ },
57
+ expandIcon: {},
58
+ onExpand: {},
59
+ onExpandedRowsChange: {},
60
+ defaultExpandAllRows: {
61
+ type: Boolean
62
+ },
63
+ indentSize: {},
64
+ expandIconColumnIndex: {},
65
+ showExpandColumn: {
66
+ type: Boolean
67
+ },
68
+ expandedRowClassName: {},
69
+ childrenColumnName: {},
70
+ rowExpandable: {},
71
+ transformCellText: {},
72
+ rowSelection: {
73
+ type: Boolean
74
+ },
75
+ onLoadingChange: {},
76
+ onShownColumnsChange: {},
77
+ pagination: {
78
+ type: [Boolean, Object],
79
+ default: !1
80
+ },
81
+ searchFormWrapperStyle: {},
82
+ tableWrapperStyle: {},
83
+ wrapperStyle: {},
84
+ tableStyle: {},
85
+ adaptive: {
86
+ type: Boolean
87
+ },
88
+ columnResizable: {
89
+ type: Boolean,
90
+ default: !1
91
+ },
92
+ loading: {
93
+ type: Boolean,
94
+ default: void 0
95
+ },
96
+ summary: {},
97
+ rowHeight: {
98
+ default: 66
99
+ },
100
+ advanceRenderer: {
101
+ type: Boolean
102
+ },
103
+ browserTooltips: {
104
+ type: Boolean
105
+ },
106
+ virtual: {
107
+ type: [Boolean, Object],
108
+ default: void 0
109
+ },
110
+ onRowClicked: {},
111
+ onScrollEnd: {},
112
+ rowClassName: {},
113
+ rowClassRules: {},
114
+ autoHeight: {
115
+ type: Boolean
116
+ },
117
+ onUpdate: {},
118
+ columns: {},
119
+ defaultValue: {},
120
+ onChange: {},
121
+ maxLength: {},
122
+ onFieldChange: {},
123
+ label: {},
124
+ name: {},
125
+ formItem: {}
126
+ },
127
+ setup(b, {
128
+ expose: R
129
+ }) {
130
+ const B = K(), o = b, {
131
+ b: x
132
+ } = le("editable-aggrid"), r = w(), {
133
+ internalInstance: s,
134
+ model: v
135
+ } = ee(), i = ae(o.name);
136
+ let p;
137
+ P(() => {
138
+ const e = o.formItem?.initialValue ?? oe(a(v), o.name);
139
+ p = Q(e), u(e, "suffix");
140
+ });
141
+ const n = w([]), S = te(o.name);
142
+ G(() => S.value, (e) => {
143
+ X(e, n.value) || c(e ?? p);
144
+ }, {
145
+ deep: !0
146
+ });
147
+ const I = re("valueTypeMap"), E = Y(o, I, i), {
148
+ add: F,
149
+ addMultiple: u,
150
+ remove: N,
151
+ removeByKey: _,
152
+ getRowData: T,
153
+ getRowsData: V,
154
+ setRowData: D,
155
+ clear: j,
156
+ refreshRowIds: m
157
+ } = Z(o, s, n, i);
158
+ function k() {
159
+ const e = r.value?._internalGridApi;
160
+ if (!m.value?.length || !e)
161
+ return;
162
+ const t = m.value.map((l) => e.getRowNode(l)).filter((l) => !!l);
163
+ e.refreshCells({
164
+ rowNodes: t,
165
+ force: !0
166
+ }), m.value = [];
167
+ }
168
+ function c(e) {
169
+ n.value = e;
170
+ const t = ne(e, o.rowKey);
171
+ s?.setFieldValue(o.name, e), s?.setFieldValue(i, t);
172
+ }
173
+ function L(e) {
174
+ const t = e === "end" ? n.value.length - 1 : e;
175
+ r.value?.scrollToRow(t);
176
+ }
177
+ return R({
178
+ add: F,
179
+ addMultiple: u,
180
+ remove: N,
181
+ removeByKey: _,
182
+ getRowData: T,
183
+ getRowsData: V,
184
+ setRowData: D,
185
+ clear: j,
186
+ setTableData: c,
187
+ scrollTo: L
188
+ }), (e, t) => (M(), H(O, null, [d(a(h).FormItem, {
189
+ hidden: "",
190
+ name: e.name
191
+ }, null, 8, ["name"]), d(a(h).FormItem, y(a(C)(e.formItem, "initialValue"), {
192
+ label: e.label
193
+ }), {
194
+ default: g(() => [d(se, y(a(C)(o, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
195
+ ref_key: "tableRef",
196
+ ref: r,
197
+ class: a(x)(),
198
+ size: "mini",
199
+ columns: a(E),
200
+ "data-source": n.value,
201
+ "search-form": !1,
202
+ onUpdate: k
203
+ }), W({
204
+ _: 2
205
+ }, [U(B, (l, f) => ({
206
+ name: f,
207
+ fn: g((z) => [$(e.$slots, f, q(J(z || {})))])
208
+ }))]), 1040, ["class", "columns", "data-source"])]),
209
+ _: 3
210
+ }, 16, ["label"])], 64));
211
+ }
212
+ });
213
+ export {
214
+ xe as default
215
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./form-item.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,16 +1,16 @@
1
1
  import { shallowRef as _, computed as S, unref as d, isRef as z } from "vue";
2
- import { isDef as K } from "../../utils/index.mjs";
3
- import { isFunction as x, isUndefined as A, isNumber as h, cloneDeep as E, isArray as I, isString as N } from "lodash-unified";
2
+ import { isDef as h } from "../../utils/index.mjs";
3
+ import { isFunction as x, isUndefined as A, isNumber as K, cloneDeep as E, isArray as I, isString as N } from "lodash-unified";
4
4
  import { arrayToObject as U } from "../editable/utils.mjs";
5
5
  let $ = 0;
6
6
  function R() {
7
7
  return `_ag_grid${$++}`;
8
8
  }
9
- const J = (n, g, i, m) => {
10
- const w = _([]), y = S(() => z(g) ? d(g) : g);
11
- function F(u, l) {
12
- const r = d(i)?.length || 0;
13
- if (K(n.maxLength) && r >= n.maxLength || !u && x(n.rowKey))
9
+ const J = (n, m, i, g) => {
10
+ const w = _([]), y = S(() => z(m) ? d(m) : m);
11
+ function F(u, r) {
12
+ const l = d(i)?.length || 0;
13
+ if (h(n.maxLength) && l >= n.maxLength || !u && x(n.rowKey))
14
14
  return;
15
15
  const f = {
16
16
  ...u || { [n.rowKey]: R() }
@@ -21,79 +21,79 @@ const J = (n, g, i, m) => {
21
21
  !0,
22
22
  (o, s) => {
23
23
  const e = c(f, void 0, n.rowKey);
24
- if (o[s] ? o[s][e] = f : o[s] = { [e]: f }, !i.value?.length) {
24
+ if (o[s] ? o[s][e] = f : o[s] = { [e]: f }, !i.value) {
25
25
  i.value = [f];
26
26
  return;
27
27
  }
28
- A(l) ? i.value.push(f) : (w.value = i.value.map(
29
- (t, v) => v < l ? null : c(t, v, n.rowKey)
30
- ).filter(Boolean), i.value.splice(l, 0, f));
28
+ A(r) ? i.value.push(f) : (w.value = i.value.map(
29
+ (t, v) => v < r ? null : c(t, v, n.rowKey)
30
+ ).filter(Boolean), i.value.splice(r, 0, f));
31
31
  }
32
32
  );
33
33
  }
34
- function j(u, l = "suffix") {
35
- const r = d(i)?.length || 0, f = h(u) ? u : u.length;
36
- if (K(n.maxLength) && r + f > n.maxLength || h(u) && x(n.rowKey))
34
+ function j(u, r = "suffix") {
35
+ const l = d(i)?.length || 0, f = K(u) ? u : u.length;
36
+ if (h(n.maxLength) && l + f > n.maxLength || K(u) && x(n.rowKey))
37
37
  return;
38
- const o = h(u) ? new Array(u).fill(0).map(() => ({ [n.rowKey]: R() })) : E(u), s = U(o, n.rowKey);
38
+ const o = K(u) ? new Array(u).fill(0).map(() => ({ [n.rowKey]: R() })) : E(u), s = U(o, n.rowKey);
39
39
  y.value?.setFieldValue?.(
40
40
  n.name,
41
41
  o,
42
42
  !0,
43
43
  (e, t) => {
44
- if (e[t] ? Object.assign(e[t], s) : e[t] = s, !i.value?.length) {
44
+ if (e[t] ? Object.assign(e[t], s) : e[t] = s, !i.value) {
45
45
  i.value = [...o];
46
46
  return;
47
47
  }
48
- l === "suffix" ? i.value.push(...o) : (w.value = i.value.map(
48
+ r === "suffix" ? i.value.push(...o) : (w.value = i.value.map(
49
49
  (v, T) => c(v, T, n.rowKey)
50
50
  ), i.value.unshift(...o));
51
51
  }
52
52
  );
53
53
  }
54
54
  function k(u) {
55
- const l = I(u) ? u : [u];
55
+ const r = I(u) ? u : [u];
56
56
  y.value?.setFieldValue?.(
57
57
  n.name,
58
58
  void 0,
59
59
  !0,
60
- (r, f) => {
61
- for (const e of l) {
60
+ (l, f) => {
61
+ for (const e of r) {
62
62
  const t = c(e, void 0, n.rowKey);
63
- delete r[f][t];
63
+ delete l[f][t];
64
64
  }
65
65
  const o = i.value.filter(
66
- (e) => !l.includes(e)
66
+ (e) => !r.includes(e)
67
67
  ), s = i.value.findIndex(
68
- (e) => l.includes(e)
68
+ (e) => r.includes(e)
69
69
  );
70
70
  w.value = i.value.map(
71
71
  (e, t) => t <= s ? null : c(e, t, n.rowKey)
72
- ).filter(Boolean), m?.(o);
72
+ ).filter(Boolean), g?.(o);
73
73
  }
74
74
  );
75
75
  }
76
- function c(u, l, r) {
77
- if (r)
78
- return N(r) ? u[r] : r(u, l);
76
+ function c(u, r, l) {
77
+ if (l)
78
+ return N(l) ? u[l] : l(u, r);
79
79
  }
80
80
  function L(u) {
81
- const l = new Set(I(u) ? u : [u]);
82
- l.size !== 0 && y.value?.setFieldValue?.(
81
+ const r = new Set(I(u) ? u : [u]);
82
+ r.size !== 0 && y.value?.setFieldValue?.(
83
83
  n.name,
84
84
  void 0,
85
85
  !0,
86
- (r, f) => {
87
- for (const e of l)
88
- delete r[f][e];
86
+ (l, f) => {
87
+ for (const e of r)
88
+ delete l[f][e];
89
89
  const o = i.value.filter(
90
- (e, t) => !l.has(c(e, t, n.rowKey))
90
+ (e, t) => !r.has(c(e, t, n.rowKey))
91
91
  ), s = i.value.findIndex(
92
- (e, t) => l.has(c(e, t, n.rowKey))
92
+ (e, t) => r.has(c(e, t, n.rowKey))
93
93
  );
94
94
  w.value = i.value.map(
95
95
  (e, t) => t <= s ? null : c(e, t, n.rowKey)
96
- ).filter(Boolean), m?.(o);
96
+ ).filter(Boolean), g?.(o);
97
97
  }
98
98
  );
99
99
  }
@@ -103,7 +103,7 @@ const J = (n, g, i, m) => {
103
103
  function V() {
104
104
  return d(i);
105
105
  }
106
- function B(u, l, r = !0) {
106
+ function B(u, r, l = !0) {
107
107
  y.value?.setFieldValue?.(
108
108
  n.name,
109
109
  void 0,
@@ -120,18 +120,18 @@ const J = (n, g, i, m) => {
120
120
  n.rowKey
121
121
  );
122
122
  if (e && !(!f[o] || !f[o][e])) {
123
- if (!r) {
123
+ if (!l) {
124
124
  const t = Object.keys(f[o][e]);
125
125
  for (const v of t)
126
126
  v !== n.rowKey && delete f[o][e][v];
127
127
  }
128
- Object.assign(f[o][e], { ...l });
128
+ Object.assign(f[o][e], { ...r });
129
129
  }
130
130
  }
131
131
  );
132
132
  }
133
133
  function a() {
134
- y.value?.setFieldValue?.(n.name, {}), m?.([]);
134
+ y.value?.setFieldValue?.(n.name, {}), g?.([]);
135
135
  }
136
136
  return {
137
137
  add: F,
@@ -1,4 +1,4 @@
1
- import { Ref } from 'vue';
1
+ import { Ref, ShallowRef } from 'vue';
2
2
  import { ApFormInternalInstance } from '../../ap-form';
3
3
  import { EditableAgGridProps } from '../editable/interface';
4
4
  import { Key } from '@aplus-frontend/antdv/es/_util/type';
@@ -11,4 +11,5 @@ export declare const useEditableFormItemApi: <RecordType>(props: EditableAgGridP
11
11
  getRowsData: () => RecordType[];
12
12
  setRowData: (index: number, payload: any, merge?: boolean) => void;
13
13
  clear: () => void;
14
+ refreshRowIds: ShallowRef<string[], string[]>;
14
15
  };