@aplus-frontend/ui 7.19.8 → 7.20.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.
- package/es/src/ag-grid/components/tooltip/index.vue2.mjs +9 -9
- package/es/src/ag-grid/editable/form-item.vue.mjs +113 -93
- package/es/src/ag-grid/editable/index.vue.mjs +91 -79
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +74 -65
- package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
- package/es/src/ag-grid/index.vue.mjs +124 -120
- package/es/src/ag-grid/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/es/src/business/ag-grid-modal/constants.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +47 -37
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +30 -29
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +46 -45
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -4
- package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/es/src/business/ag-grid-modal/utils.mjs +34 -30
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/constants.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +4 -4
- package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, ref as u, onMounted as d, unref as l, withDirectives as f, openBlock as v, createElementBlock as g, normalizeClass as h, toDisplayString as w, vShow as _ } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
3
|
import { useNamespace as x } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
4
|
-
const k = /* @__PURE__ */
|
|
4
|
+
const k = /* @__PURE__ */ m({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
params: {}
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const { rowIndex: o, column: t, gridWrapperRef:
|
|
9
|
+
setup(n) {
|
|
10
|
+
const i = n, e = u(!1), { e: s } = x("ag-grid");
|
|
11
|
+
return d(() => {
|
|
12
|
+
const { rowIndex: o, column: t, gridWrapperRef: c, lineClamp: p } = i.params, r = l(c)?.querySelector(
|
|
13
13
|
`div.ag-row[row-index="${o}"] .ag-cell[col-id="${t.colId}"] span.ag-cell-value`
|
|
14
14
|
);
|
|
15
15
|
if (!r) {
|
|
16
16
|
e.value = !0;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const a =
|
|
19
|
+
const a = p === 1 ? "Width" : "Height";
|
|
20
20
|
e.value = r[`scroll${a}`] > r[`client${a}`];
|
|
21
|
-
}), (o, t) =>
|
|
22
|
-
class:
|
|
21
|
+
}), (o, t) => f((v(), g("div", {
|
|
22
|
+
class: h(l(s)("tooltip"))
|
|
23
23
|
}, w(o.params.value), 3)), [
|
|
24
24
|
[_, e.value]
|
|
25
25
|
]);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { useInjectForm as
|
|
5
|
-
import { useWatch as
|
|
6
|
-
import { getModelValue as
|
|
7
|
-
import { transformValues as
|
|
1
|
+
import { defineComponent as Q, useSlots as X, ref as w, watch as y, unref as l, createElementBlock as Y, openBlock as Z, Fragment as ee, createVNode as c, mergeProps as g, withCtx as h, createSlots as oe, renderList as te, renderSlot as ae, normalizeProps as ne, guardReactiveProps as le } from "vue";
|
|
2
|
+
import { isEqual as C, cloneDeep as re, omit as se } from "lodash-unified";
|
|
3
|
+
import { ApForm as b } from "../../ap-form/index.mjs";
|
|
4
|
+
import { useInjectForm as ie } from "../../ap-form/context.mjs";
|
|
5
|
+
import { useWatch as R } from "../../ap-form/hooks/use-watch.mjs";
|
|
6
|
+
import { getModelValue as me } from "../../ap-form/utils/get.mjs";
|
|
7
|
+
import { transformValues as ue } from "../../ap-form/utils/transform.mjs";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { useGetEditableColumns as
|
|
10
|
-
import { useEditableFormItemApi as
|
|
9
|
+
import { useGetEditableColumns as de } from "../hooks/use-editable-columns.mjs";
|
|
10
|
+
import { useEditableFormItemApi as pe } from "../hooks/use-editable-form-item-api.mjs";
|
|
11
11
|
import "../index.vue2.mjs";
|
|
12
|
-
import
|
|
12
|
+
import ce from "../style/editable.mjs";
|
|
13
13
|
import { getShadowName as fe } from "../utils.mjs";
|
|
14
|
-
import { getColumnTransformOptions as
|
|
15
|
-
import { useNamespace as
|
|
16
|
-
import { useGlobalConfig as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
14
|
+
import { getColumnTransformOptions as we, arrayToObject as ye, getRowKey as ge } from "./utils.mjs";
|
|
15
|
+
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useGlobalConfig as Ce } from "../../config-provider/hooks/use-global-config.mjs";
|
|
17
|
+
import be from "../index.vue.mjs";
|
|
18
|
+
const ze = /* @__PURE__ */ Q({
|
|
19
19
|
name: "EditableGrid",
|
|
20
20
|
__name: "form-item",
|
|
21
21
|
props: {
|
|
@@ -120,6 +120,7 @@ const ke = /* @__PURE__ */ W({
|
|
|
120
120
|
type: Boolean
|
|
121
121
|
},
|
|
122
122
|
onUpdate: {},
|
|
123
|
+
onModelUpdated: {},
|
|
123
124
|
customRow: {},
|
|
124
125
|
theme: {},
|
|
125
126
|
emptyComponent: {},
|
|
@@ -142,126 +143,145 @@ const ke = /* @__PURE__ */ W({
|
|
|
142
143
|
name: {},
|
|
143
144
|
formItem: {}
|
|
144
145
|
},
|
|
145
|
-
setup(
|
|
146
|
-
expose:
|
|
146
|
+
setup(v, {
|
|
147
|
+
expose: B
|
|
147
148
|
}) {
|
|
148
|
-
const x =
|
|
149
|
-
b:
|
|
150
|
-
} =
|
|
151
|
-
internalInstance:
|
|
152
|
-
} =
|
|
153
|
-
function
|
|
154
|
-
const o =
|
|
149
|
+
const x = X(), a = v, {
|
|
150
|
+
b: T
|
|
151
|
+
} = he("editable-aggrid"), S = ce("editable-aggrid"), r = w(), {
|
|
152
|
+
internalInstance: s
|
|
153
|
+
} = ie();
|
|
154
|
+
function I(e) {
|
|
155
|
+
const o = we(a.columns || []);
|
|
155
156
|
if (!Object.keys(o).length || !e?.length)
|
|
156
157
|
return e;
|
|
157
|
-
let
|
|
158
|
-
for (const
|
|
159
|
-
|
|
160
|
-
return
|
|
158
|
+
let t = [];
|
|
159
|
+
for (const m of e)
|
|
160
|
+
t.push(ue(m, o));
|
|
161
|
+
return t;
|
|
161
162
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
const i = fe(a.name);
|
|
164
|
+
function F() {
|
|
165
|
+
return a.formItem?.initialValue ?? me(s?.getInitialValues() ?? {}, a.name) ?? [];
|
|
166
|
+
}
|
|
167
|
+
let V = F();
|
|
168
|
+
const n = w([]), E = R(a.name), D = R(i);
|
|
169
|
+
y(() => E.value, (e) => {
|
|
170
|
+
if (C(e, n.value))
|
|
171
|
+
return;
|
|
172
|
+
const o = e ?? re(V);
|
|
173
|
+
n.value = [...o];
|
|
171
174
|
}, {
|
|
172
175
|
deep: !0,
|
|
173
176
|
flush: "post",
|
|
174
177
|
immediate: !0
|
|
175
178
|
});
|
|
176
|
-
|
|
179
|
+
let u;
|
|
180
|
+
y(n, (e) => {
|
|
181
|
+
const o = ye(e, a.rowKey);
|
|
182
|
+
C(o, l(D)) || (u = () => {
|
|
183
|
+
s?.setFieldValue(a.name, [...e]), s?.setFieldValue(i, o);
|
|
184
|
+
});
|
|
185
|
+
}, {
|
|
186
|
+
deep: !0,
|
|
187
|
+
immediate: !0
|
|
188
|
+
});
|
|
189
|
+
const N = Ce("valueTypeMap"), A = de(a, N, i), {
|
|
177
190
|
add: K,
|
|
178
|
-
addMultiple:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
getRowData: k,
|
|
191
|
+
addMultiple: j,
|
|
192
|
+
remove: _,
|
|
193
|
+
removeByKey: k,
|
|
194
|
+
getRowData: z,
|
|
183
195
|
getRowsData: O,
|
|
184
|
-
getRowDataByKey:
|
|
196
|
+
getRowDataByKey: U,
|
|
185
197
|
setRowData: H,
|
|
186
198
|
setRowDataByKey: L,
|
|
187
|
-
clear:
|
|
199
|
+
clear: P,
|
|
188
200
|
refreshRowIds: d
|
|
189
|
-
} =
|
|
190
|
-
function
|
|
191
|
-
|
|
201
|
+
} = pe(a, s, n, i);
|
|
202
|
+
function G() {
|
|
203
|
+
if (a.onUpdate?.(), u && (u(), u = void 0), a.supressForceRowUpdate)
|
|
204
|
+
return;
|
|
205
|
+
const e = r.value?._internalGridApi;
|
|
192
206
|
if (!d.value?.length || !e)
|
|
193
207
|
return;
|
|
194
|
-
const o = d.value.map((
|
|
195
|
-
|
|
208
|
+
const o = d.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
|
|
209
|
+
e.refreshCells({
|
|
196
210
|
rowNodes: o,
|
|
197
211
|
force: !0
|
|
198
212
|
}), d.value = [];
|
|
199
213
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
214
|
+
function M(e) {
|
|
215
|
+
n.value = [...e];
|
|
216
|
+
}
|
|
217
|
+
function f(e, o) {
|
|
218
|
+
const t = e === "end" ? n.value.length - 1 : e;
|
|
219
|
+
r.value?.scrollToRow(t, o);
|
|
204
220
|
}
|
|
205
|
-
function
|
|
206
|
-
|
|
207
|
-
m.value?.scrollToRow(a, o);
|
|
221
|
+
function W(e, o) {
|
|
222
|
+
r.value?.scrollToColumn(e, o);
|
|
208
223
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
224
|
+
function $(e, o) {
|
|
225
|
+
const t = [i, String(e), o].flat();
|
|
226
|
+
return s?.validateFields([t]);
|
|
211
227
|
}
|
|
212
|
-
function
|
|
213
|
-
const
|
|
214
|
-
return
|
|
228
|
+
function q(e) {
|
|
229
|
+
const t = l(n).map((m, p) => [i, String(ge(m, p, a.rowKey)), e].flat());
|
|
230
|
+
return s?.validateFields(t);
|
|
215
231
|
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
|
|
232
|
+
function J(e, o = !0) {
|
|
233
|
+
const t = Array.isArray(e) ? e : [e];
|
|
234
|
+
r.value?._internalGridApi?.refreshCells({
|
|
235
|
+
columns: t,
|
|
236
|
+
force: o
|
|
237
|
+
});
|
|
219
238
|
}
|
|
220
|
-
return
|
|
239
|
+
return B({
|
|
221
240
|
add: K,
|
|
222
|
-
addMultiple:
|
|
223
|
-
remove:
|
|
224
|
-
removeByKey:
|
|
225
|
-
getRowData:
|
|
241
|
+
addMultiple: j,
|
|
242
|
+
remove: _,
|
|
243
|
+
removeByKey: k,
|
|
244
|
+
getRowData: z,
|
|
226
245
|
getRowsData: O,
|
|
227
|
-
getRowDataByKey:
|
|
246
|
+
getRowDataByKey: U,
|
|
228
247
|
setRowData: H,
|
|
229
|
-
clear:
|
|
230
|
-
setTableData:
|
|
231
|
-
scrollTo:
|
|
232
|
-
scrollToRow:
|
|
233
|
-
scrollToColumn:
|
|
234
|
-
validateCell:
|
|
235
|
-
validateColumn:
|
|
248
|
+
clear: P,
|
|
249
|
+
setTableData: M,
|
|
250
|
+
scrollTo: f,
|
|
251
|
+
scrollToRow: f,
|
|
252
|
+
scrollToColumn: W,
|
|
253
|
+
validateCell: $,
|
|
254
|
+
validateColumn: q,
|
|
236
255
|
setRowDataByKey: L,
|
|
237
|
-
table:
|
|
238
|
-
|
|
256
|
+
table: r,
|
|
257
|
+
refreshColumns: J
|
|
258
|
+
}), (e, o) => (Z(), Y(ee, null, [c(l(b).FormItem, {
|
|
239
259
|
hidden: "",
|
|
240
260
|
name: e.name,
|
|
241
261
|
"initial-value": e.formItem?.initialValue,
|
|
242
|
-
transform:
|
|
243
|
-
}, null, 8, ["name", "initial-value"]),
|
|
262
|
+
transform: I
|
|
263
|
+
}, null, 8, ["name", "initial-value"]), c(l(b).FormItem, g({
|
|
244
264
|
label: e.label
|
|
245
265
|
}, e.formItem), {
|
|
246
|
-
default:
|
|
266
|
+
default: h(() => [c(be, g(l(se)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem", "onUpdate"]), {
|
|
247
267
|
ref_key: "tableRef",
|
|
248
|
-
ref:
|
|
249
|
-
class: [
|
|
268
|
+
ref: r,
|
|
269
|
+
class: [l(T)(), l(S)],
|
|
250
270
|
size: "mini",
|
|
251
|
-
columns:
|
|
252
|
-
"data-source":
|
|
271
|
+
columns: l(A),
|
|
272
|
+
"data-source": n.value,
|
|
253
273
|
"search-form": !1,
|
|
254
|
-
onUpdate:
|
|
255
|
-
}),
|
|
274
|
+
onUpdate: G
|
|
275
|
+
}), oe({
|
|
256
276
|
_: 2
|
|
257
|
-
}, [
|
|
258
|
-
name:
|
|
259
|
-
fn:
|
|
277
|
+
}, [te(x, (t, m) => ({
|
|
278
|
+
name: m,
|
|
279
|
+
fn: h((p) => [ae(e.$slots, m, ne(le(p || {})))])
|
|
260
280
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
261
281
|
_: 3
|
|
262
282
|
}, 16, ["label"])], 64));
|
|
263
283
|
}
|
|
264
284
|
});
|
|
265
285
|
export {
|
|
266
|
-
|
|
286
|
+
ze as default
|
|
267
287
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isEqual as
|
|
3
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as Q, useSlots as X, ref as h, watch as Y, unref as r, createBlock as Z, openBlock as ee, withCtx as c, createVNode as C, mergeProps as oe, createSlots as ae, renderList as te, renderSlot as ne, normalizeProps as re, guardReactiveProps as le } from "vue";
|
|
2
|
+
import { isEqual as se, isArray as b, omit as ie } from "lodash-unified";
|
|
3
|
+
import { ApForm as f } from "../../ap-form/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { useEditableApi as
|
|
7
|
-
import { useGetEditableColumns as
|
|
6
|
+
import { useEditableApi as de } from "../hooks/use-editable-api.mjs";
|
|
7
|
+
import { useGetEditableColumns as ue } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { arrayToObject as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import { useControllableValue as
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
import
|
|
15
|
-
const Ke = /* @__PURE__ */
|
|
9
|
+
import pe from "../style/editable.mjs";
|
|
10
|
+
import { arrayToObject as v, getRowKey as me } from "./utils.mjs";
|
|
11
|
+
import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useControllableValue as fe } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
import { useGlobalConfig as ye } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
import we from "../index.vue.mjs";
|
|
15
|
+
const Ke = /* @__PURE__ */ Q({
|
|
16
16
|
name: "EditableGrid",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -117,6 +117,7 @@ const Ke = /* @__PURE__ */ q({
|
|
|
117
117
|
type: Boolean
|
|
118
118
|
},
|
|
119
119
|
onUpdate: {},
|
|
120
|
+
onModelUpdated: {},
|
|
120
121
|
customRow: {},
|
|
121
122
|
theme: {},
|
|
122
123
|
emptyComponent: {},
|
|
@@ -142,126 +143,137 @@ const Ke = /* @__PURE__ */ q({
|
|
|
142
143
|
}
|
|
143
144
|
},
|
|
144
145
|
emits: ["update:value"],
|
|
145
|
-
setup(
|
|
146
|
-
expose:
|
|
147
|
-
emit:
|
|
146
|
+
setup(x, {
|
|
147
|
+
expose: B,
|
|
148
|
+
emit: S
|
|
148
149
|
}) {
|
|
149
|
-
const
|
|
150
|
-
b:
|
|
151
|
-
} =
|
|
152
|
-
value:
|
|
150
|
+
const T = X(), t = x, {
|
|
151
|
+
b: F
|
|
152
|
+
} = ce("editable-aggrid"), _ = pe("editable-aggrid"), A = S, s = h(), {
|
|
153
|
+
value: i,
|
|
153
154
|
updateValue: y
|
|
154
|
-
} =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
} = fe(t, A), l = h(), E = f.useWatch(t.name, l);
|
|
156
|
+
let d;
|
|
157
|
+
Y(i, (e) => {
|
|
158
|
+
const o = v(e, t.rowKey);
|
|
159
|
+
se(o, r(E)) || (d = () => {
|
|
160
|
+
l.value?.setFieldValue(t.name, o);
|
|
161
|
+
});
|
|
158
162
|
}, {
|
|
159
163
|
deep: !0
|
|
160
164
|
});
|
|
161
|
-
const
|
|
162
|
-
add:
|
|
163
|
-
addMultiple:
|
|
164
|
-
remove:
|
|
165
|
-
removeByKey:
|
|
166
|
-
getRowData:
|
|
167
|
-
getRowsData:
|
|
168
|
-
getRowDataByKey:
|
|
165
|
+
const K = ye("valueTypeMap"), k = ue(t, K), {
|
|
166
|
+
add: D,
|
|
167
|
+
addMultiple: N,
|
|
168
|
+
remove: U,
|
|
169
|
+
removeByKey: I,
|
|
170
|
+
getRowData: j,
|
|
171
|
+
getRowsData: z,
|
|
172
|
+
getRowDataByKey: V,
|
|
169
173
|
setRowData: H,
|
|
170
174
|
setRowDataByKey: O,
|
|
171
|
-
clear:
|
|
172
|
-
refreshRowIds:
|
|
173
|
-
} =
|
|
175
|
+
clear: G,
|
|
176
|
+
refreshRowIds: u
|
|
177
|
+
} = de(t, l, i, y);
|
|
174
178
|
function L() {
|
|
175
|
-
|
|
176
|
-
if (!d.value?.length || !e)
|
|
179
|
+
if (t.onUpdate?.(), d && (d(), d = void 0), t.supressForceRowUpdate)
|
|
177
180
|
return;
|
|
178
|
-
const
|
|
179
|
-
|
|
181
|
+
const e = s.value?._internalGridApi;
|
|
182
|
+
if (!u.value?.length || !e)
|
|
183
|
+
return;
|
|
184
|
+
const o = u.value.map((a) => e.getRowNode(a)).filter((a) => !!a);
|
|
185
|
+
e.refreshCells({
|
|
180
186
|
rowNodes: o,
|
|
181
187
|
force: !0
|
|
182
|
-
}),
|
|
188
|
+
}), u.value = [];
|
|
183
189
|
}
|
|
184
190
|
function P() {
|
|
185
|
-
|
|
191
|
+
l.value?.resetFields();
|
|
186
192
|
}
|
|
187
193
|
function w(e) {
|
|
188
|
-
return e ? (
|
|
194
|
+
return e ? (b(e) ? e : [e]).map((a) => b(a) ? [t.name, ...a] : [t.name, a]) : void 0;
|
|
189
195
|
}
|
|
190
196
|
function g(e) {
|
|
191
197
|
try {
|
|
192
|
-
const o = Object.keys(e),
|
|
193
|
-
return o.sort((n,
|
|
198
|
+
const o = Object.keys(e), a = i.value.map((n) => me(n, void 0, t.rowKey));
|
|
199
|
+
return o.sort((n, p) => a.findIndex((m) => String(m) === n) - a.findIndex((m) => String(m) === p)), o.map((n) => e[n]);
|
|
194
200
|
} catch {
|
|
195
201
|
return e;
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
|
-
async function
|
|
199
|
-
const n = (await
|
|
204
|
+
async function M(e, o) {
|
|
205
|
+
const n = (await l.value?.validateFields(w(e), o))?.[t.name];
|
|
200
206
|
return g(n);
|
|
201
207
|
}
|
|
202
208
|
async function W(e, o) {
|
|
203
|
-
const n = (await
|
|
209
|
+
const n = (await l.value?.validateFieldsReturnTransformed(w(e), o))?.[t.name];
|
|
204
210
|
return g(n);
|
|
205
211
|
}
|
|
206
|
-
function
|
|
212
|
+
function $(e) {
|
|
207
213
|
y(e);
|
|
208
|
-
const o = f(e, a.rowKey);
|
|
209
|
-
r.value?.setFieldValue(a.name, o);
|
|
210
214
|
}
|
|
211
215
|
function R(e, o) {
|
|
212
|
-
const
|
|
213
|
-
|
|
216
|
+
const a = e === "end" ? i.value.length - 1 : e;
|
|
217
|
+
s.value?.scrollToRow(a, o);
|
|
218
|
+
}
|
|
219
|
+
function q(e, o) {
|
|
220
|
+
s.value?.scrollToColumn(e, o);
|
|
214
221
|
}
|
|
215
|
-
function
|
|
216
|
-
|
|
222
|
+
function J(e, o = !0) {
|
|
223
|
+
const a = Array.isArray(e) ? e : [e];
|
|
224
|
+
s.value?._internalGridApi?.refreshCells({
|
|
225
|
+
columns: a,
|
|
226
|
+
force: o
|
|
227
|
+
});
|
|
217
228
|
}
|
|
218
|
-
return
|
|
229
|
+
return B({
|
|
219
230
|
resetFields: P,
|
|
220
|
-
validateFields:
|
|
231
|
+
validateFields: M,
|
|
221
232
|
validateFieldsReturnTransformed: W,
|
|
222
|
-
add:
|
|
223
|
-
addMultiple:
|
|
224
|
-
remove:
|
|
225
|
-
removeByKey:
|
|
226
|
-
getRowData:
|
|
227
|
-
getRowsData:
|
|
233
|
+
add: D,
|
|
234
|
+
addMultiple: N,
|
|
235
|
+
remove: U,
|
|
236
|
+
removeByKey: I,
|
|
237
|
+
getRowData: j,
|
|
238
|
+
getRowsData: z,
|
|
228
239
|
setRowData: H,
|
|
229
|
-
clear:
|
|
230
|
-
setTableData:
|
|
240
|
+
clear: G,
|
|
241
|
+
setTableData: $,
|
|
231
242
|
scrollTo: R,
|
|
232
243
|
scrollToRow: R,
|
|
233
|
-
scrollToColumn:
|
|
234
|
-
table:
|
|
235
|
-
getRowDataByKey:
|
|
236
|
-
setRowDataByKey: O
|
|
237
|
-
|
|
244
|
+
scrollToColumn: q,
|
|
245
|
+
table: s,
|
|
246
|
+
getRowDataByKey: V,
|
|
247
|
+
setRowDataByKey: O,
|
|
248
|
+
refreshColumns: J
|
|
249
|
+
}), (e, o) => (ee(), Z(r(f), {
|
|
238
250
|
ref_key: "formRef",
|
|
239
|
-
ref:
|
|
251
|
+
ref: l,
|
|
240
252
|
"initial-values": {
|
|
241
|
-
[
|
|
253
|
+
[t.name]: r(v)(r(i), t.rowKey)
|
|
242
254
|
},
|
|
243
255
|
style: {
|
|
244
256
|
height: "100%"
|
|
245
257
|
}
|
|
246
258
|
}, {
|
|
247
|
-
default:
|
|
259
|
+
default: c(() => [C(r(f).FormItem, {
|
|
248
260
|
name: e.name,
|
|
249
261
|
"no-style": ""
|
|
250
262
|
}, {
|
|
251
|
-
default:
|
|
263
|
+
default: c(() => [C(we, oe(r(ie)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "onUpdate"]), {
|
|
252
264
|
ref_key: "tableRef",
|
|
253
|
-
ref:
|
|
254
|
-
class: [
|
|
265
|
+
ref: s,
|
|
266
|
+
class: [r(F)(), r(_)],
|
|
255
267
|
size: "mini",
|
|
256
|
-
columns:
|
|
257
|
-
"data-source":
|
|
268
|
+
columns: r(k),
|
|
269
|
+
"data-source": r(i),
|
|
258
270
|
"search-form": !1,
|
|
259
271
|
onUpdate: L
|
|
260
|
-
}),
|
|
272
|
+
}), ae({
|
|
261
273
|
_: 2
|
|
262
|
-
}, [
|
|
274
|
+
}, [te(T, (a, n) => ({
|
|
263
275
|
name: n,
|
|
264
|
-
fn:
|
|
276
|
+
fn: c((p) => [ne(e.$slots, n, re(le(p || {})))])
|
|
265
277
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
266
278
|
_: 3
|
|
267
279
|
}, 8, ["name"])]),
|
|
@@ -104,6 +104,13 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
104
104
|
* @returns
|
|
105
105
|
*/
|
|
106
106
|
setRowDataByKey: (key: any, data: Partial<RecordType>, merge?: boolean) => void;
|
|
107
|
+
/**
|
|
108
|
+
* 刷新列单元格
|
|
109
|
+
* @param columnKey
|
|
110
|
+
* @param force 是否强制刷新,默认为 `true`
|
|
111
|
+
* @returns
|
|
112
|
+
*/
|
|
113
|
+
refreshColumns: (columnKey: string | string[], force?: boolean) => void;
|
|
107
114
|
};
|
|
108
115
|
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
|
|
109
116
|
/**
|