@aplus-frontend/ui 7.7.6 → 7.7.8
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/editable/form-item.vue.mjs +19 -16
- package/es/src/ag-grid/editable/index.vue.mjs +15 -12
- package/es/src/ag-grid/index.vue.mjs +1 -0
- package/es/src/ap-action/item/index.vue2.mjs +30 -31
- package/es/src/ap-action/style/index.d.ts +1 -0
- package/es/src/ap-action/style/index.mjs +63 -36
- package/es/src/ap-field/number/index.vue.d.ts +2 -0
- package/es/src/ap-field/number/index.vue.mjs +2 -2
- package/es/src/ap-field/tree-select/index.vue.d.ts +22 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +12 -11
- package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
- package/es/src/ap-form/items/number/index.vue.d.ts +10 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +24 -0
- package/es/src/ap-form/style/item.mjs +6 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +51 -48
- package/es/src/ap-grid/editable/index.vue.mjs +59 -56
- package/es/src/ap-grid/index.vue.mjs +11 -10
- package/es/src/ap-table/ap-table.vue2.mjs +3 -0
- package/es/src/ap-table/constants.d.ts +17 -1
- package/es/src/business/batch-input-group/index.vue.mjs +63 -63
- package/es/src/design-token/index.mjs +4 -2
- package/es/src/editable-table/form-item.vue.mjs +33 -30
- package/es/src/editable-table/index.vue.mjs +13 -10
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +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/index.vue.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/style/index.d.ts +1 -0
- package/lib/src/ap-action/style/index.js +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +2 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +22 -0
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +10 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +24 -0
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +17 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -129,6 +129,7 @@ declare function __VLS_template(): {
|
|
|
129
129
|
readonly replaceFields?: FieldNames | undefined;
|
|
130
130
|
readonly 'onUpdate:treeExpandedKeys'?: ((keys: Key[]) => void) | undefined;
|
|
131
131
|
readonly 'onUpdate:searchValue'?: ((value: string) => void) | undefined;
|
|
132
|
+
readonly switcherLoadingIcon?: any;
|
|
132
133
|
readonly filterTreeNode?: boolean | ((inputValue: string, treeNode: DefaultOptionType) => boolean) | undefined;
|
|
133
134
|
readonly treeNodeFilterProp?: string | undefined;
|
|
134
135
|
readonly treeNodeLabelProp?: string | undefined;
|
|
@@ -206,6 +207,10 @@ declare function __VLS_template(): {
|
|
|
206
207
|
type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
|
|
207
208
|
default: "filled" | "outlined" | "borderless" | "underlined";
|
|
208
209
|
};
|
|
210
|
+
switcherLoadingIcon: {
|
|
211
|
+
default: any;
|
|
212
|
+
type: PropType<any>;
|
|
213
|
+
};
|
|
209
214
|
value: {
|
|
210
215
|
type: PropType<any>;
|
|
211
216
|
};
|
|
@@ -420,6 +425,7 @@ declare function __VLS_template(): {
|
|
|
420
425
|
treeCheckStrictly: boolean;
|
|
421
426
|
treeDataSimpleMode: any;
|
|
422
427
|
treeDefaultExpandAll: boolean;
|
|
428
|
+
switcherLoadingIcon: any;
|
|
423
429
|
replaceFields: FieldNames;
|
|
424
430
|
'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
|
|
425
431
|
'onUpdate:searchValue': (value: string) => void;
|
|
@@ -436,6 +442,7 @@ declare function __VLS_template(): {
|
|
|
436
442
|
tagRender?: any;
|
|
437
443
|
suffixIcon?: any;
|
|
438
444
|
clearIcon?: any;
|
|
445
|
+
switcherLoadingIcon?: any;
|
|
439
446
|
}>, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
440
447
|
P: {};
|
|
441
448
|
B: {};
|
|
@@ -491,6 +498,10 @@ declare function __VLS_template(): {
|
|
|
491
498
|
type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
|
|
492
499
|
default: "filled" | "outlined" | "borderless" | "underlined";
|
|
493
500
|
};
|
|
501
|
+
switcherLoadingIcon: {
|
|
502
|
+
default: any;
|
|
503
|
+
type: PropType<any>;
|
|
504
|
+
};
|
|
494
505
|
value: {
|
|
495
506
|
type: PropType<any>;
|
|
496
507
|
};
|
|
@@ -705,6 +716,7 @@ declare function __VLS_template(): {
|
|
|
705
716
|
treeCheckStrictly: boolean;
|
|
706
717
|
treeDataSimpleMode: any;
|
|
707
718
|
treeDefaultExpandAll: boolean;
|
|
719
|
+
switcherLoadingIcon: any;
|
|
708
720
|
replaceFields: FieldNames;
|
|
709
721
|
'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
|
|
710
722
|
'onUpdate:searchValue': (value: string) => void;
|
|
@@ -921,6 +933,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
921
933
|
readonly replaceFields?: FieldNames | undefined;
|
|
922
934
|
readonly 'onUpdate:treeExpandedKeys'?: ((keys: Key[]) => void) | undefined;
|
|
923
935
|
readonly 'onUpdate:searchValue'?: ((value: string) => void) | undefined;
|
|
936
|
+
readonly switcherLoadingIcon?: any;
|
|
924
937
|
readonly filterTreeNode?: boolean | ((inputValue: string, treeNode: DefaultOptionType) => boolean) | undefined;
|
|
925
938
|
readonly treeNodeFilterProp?: string | undefined;
|
|
926
939
|
readonly treeNodeLabelProp?: string | undefined;
|
|
@@ -998,6 +1011,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
998
1011
|
type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
|
|
999
1012
|
default: "filled" | "outlined" | "borderless" | "underlined";
|
|
1000
1013
|
};
|
|
1014
|
+
switcherLoadingIcon: {
|
|
1015
|
+
default: any;
|
|
1016
|
+
type: PropType<any>;
|
|
1017
|
+
};
|
|
1001
1018
|
value: {
|
|
1002
1019
|
type: PropType<any>;
|
|
1003
1020
|
};
|
|
@@ -1212,6 +1229,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1212
1229
|
treeCheckStrictly: boolean;
|
|
1213
1230
|
treeDataSimpleMode: any;
|
|
1214
1231
|
treeDefaultExpandAll: boolean;
|
|
1232
|
+
switcherLoadingIcon: any;
|
|
1215
1233
|
replaceFields: FieldNames;
|
|
1216
1234
|
'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
|
|
1217
1235
|
'onUpdate:searchValue': (value: string) => void;
|
|
@@ -1228,6 +1246,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1228
1246
|
tagRender?: any;
|
|
1229
1247
|
suffixIcon?: any;
|
|
1230
1248
|
clearIcon?: any;
|
|
1249
|
+
switcherLoadingIcon?: any;
|
|
1231
1250
|
}>, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
1232
1251
|
P: {};
|
|
1233
1252
|
B: {};
|
|
@@ -1283,6 +1302,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1283
1302
|
type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
|
|
1284
1303
|
default: "filled" | "outlined" | "borderless" | "underlined";
|
|
1285
1304
|
};
|
|
1305
|
+
switcherLoadingIcon: {
|
|
1306
|
+
default: any;
|
|
1307
|
+
type: PropType<any>;
|
|
1308
|
+
};
|
|
1286
1309
|
value: {
|
|
1287
1310
|
type: PropType<any>;
|
|
1288
1311
|
};
|
|
@@ -1497,6 +1520,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1497
1520
|
treeCheckStrictly: boolean;
|
|
1498
1521
|
treeDataSimpleMode: any;
|
|
1499
1522
|
treeDefaultExpandAll: boolean;
|
|
1523
|
+
switcherLoadingIcon: any;
|
|
1500
1524
|
replaceFields: FieldNames;
|
|
1501
1525
|
'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
|
|
1502
1526
|
'onUpdate:searchValue': (value: string) => void;
|
|
@@ -129,6 +129,12 @@ const r = (n) => {
|
|
|
129
129
|
paddingInline: n.space,
|
|
130
130
|
flex: 1
|
|
131
131
|
}
|
|
132
|
+
},
|
|
133
|
+
textarea: {
|
|
134
|
+
lineHeight: "20px"
|
|
135
|
+
},
|
|
136
|
+
"& .ant-input-affix-wrapper-textarea-with-clear-btn .ant-input-clear-icon": {
|
|
137
|
+
insetBlockStart: "8px"
|
|
132
138
|
}
|
|
133
139
|
}
|
|
134
140
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as z, useSlots as G, toRef as
|
|
1
|
+
import { defineComponent as z, useSlots as G, toRef as H, ref as c, unref as s, watch as K, nextTick as P, createBlock as A, openBlock as W, mergeProps as g, withCtx as h, createVNode as U, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
2
|
import { ApForm as y } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isUndefined as Y, isNumber as d, cloneDeep as Z, isArray as M, omit as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
6
|
import { useGetEditableColumns as te } from "../hooks/use-editable-columns.mjs";
|
|
7
7
|
import "../index.vue2.mjs";
|
|
8
|
-
import { useInjectForm as
|
|
9
|
-
import { getModelValue as
|
|
10
|
-
import { useDevWarning as
|
|
11
|
-
import
|
|
8
|
+
import { useInjectForm as oe } from "../../ap-form/context.mjs";
|
|
9
|
+
import { getModelValue as ae } from "../../ap-form/utils/get.mjs";
|
|
10
|
+
import { useDevWarning as le } from "../../utils/warning.mjs";
|
|
11
|
+
import ne from "../style/editable.mjs";
|
|
12
12
|
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
14
|
import { isDef as C } from "../../utils/is.mjs";
|
|
15
15
|
import ie from "../index.vue.mjs";
|
|
16
|
-
const
|
|
16
|
+
const ve = /* @__PURE__ */ z({
|
|
17
17
|
name: "EditableGridFormItem",
|
|
18
18
|
__name: "form-item",
|
|
19
19
|
props: {
|
|
@@ -84,6 +84,9 @@ const Fe = /* @__PURE__ */ z({
|
|
|
84
84
|
default: !1
|
|
85
85
|
},
|
|
86
86
|
transformCellText: {},
|
|
87
|
+
rowHoverable: {
|
|
88
|
+
type: Boolean
|
|
89
|
+
},
|
|
87
90
|
rowClassName: {},
|
|
88
91
|
stripe: {
|
|
89
92
|
type: Boolean
|
|
@@ -169,58 +172,58 @@ const Fe = /* @__PURE__ */ z({
|
|
|
169
172
|
setup(w, {
|
|
170
173
|
expose: b
|
|
171
174
|
}) {
|
|
172
|
-
const x = G(),
|
|
173
|
-
|
|
175
|
+
const x = G(), a = w;
|
|
176
|
+
le("EditableGridFormItem")(!1, "breaking", "EditableGridFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
174
177
|
const {
|
|
175
178
|
b: R
|
|
176
|
-
} = re("editable-grid"), B =
|
|
179
|
+
} = re("editable-grid"), B = ne("editable-grid"), {
|
|
177
180
|
internalInstance: i,
|
|
178
181
|
model: S
|
|
179
|
-
} =
|
|
180
|
-
|
|
181
|
-
await
|
|
182
|
+
} = oe(), m = H(a.name), f = c(ae(s(S), m.value) || []), v = y.useWatch(m);
|
|
183
|
+
K(() => v.value, async (e) => {
|
|
184
|
+
await P(), f.value = e, a.onChange?.(e);
|
|
182
185
|
}, {
|
|
183
186
|
deep: !0
|
|
184
187
|
});
|
|
185
|
-
const p = c(),
|
|
186
|
-
function N(e,
|
|
188
|
+
const p = c(), F = se("valueTypeMap"), I = te(a, F);
|
|
189
|
+
function N(e, l) {
|
|
187
190
|
const r = s(f)?.length || 0;
|
|
188
|
-
if (C(
|
|
191
|
+
if (C(a.maxLength) && r >= a.maxLength)
|
|
189
192
|
return;
|
|
190
193
|
const t = {
|
|
191
194
|
...e || {}
|
|
192
195
|
};
|
|
193
|
-
i?.setFieldValue(
|
|
194
|
-
if (!
|
|
195
|
-
|
|
196
|
+
i?.setFieldValue(a.name, t, !0, (o, n) => {
|
|
197
|
+
if (!o[n]) {
|
|
198
|
+
o[n] = [t];
|
|
196
199
|
return;
|
|
197
200
|
}
|
|
198
|
-
Y(
|
|
201
|
+
Y(l) ? o[n].push(t) : o[n].splice(l, 0, t);
|
|
199
202
|
});
|
|
200
203
|
}
|
|
201
|
-
function D(e,
|
|
204
|
+
function D(e, l = "suffix") {
|
|
202
205
|
const r = s(f)?.length || 0, t = d(e) ? e : e.length;
|
|
203
|
-
if (C(
|
|
206
|
+
if (C(a.maxLength) && r + t > a.maxLength)
|
|
204
207
|
return;
|
|
205
|
-
const
|
|
206
|
-
i?.setFieldValue(
|
|
207
|
-
if (!
|
|
208
|
-
|
|
208
|
+
const o = d(e) ? new Array(e).fill(0).map(() => ({})) : Z(e);
|
|
209
|
+
i?.setFieldValue(a.name, o, !0, (n, u) => {
|
|
210
|
+
if (!n[u]) {
|
|
211
|
+
n[u] = [...o];
|
|
209
212
|
return;
|
|
210
213
|
}
|
|
211
|
-
|
|
214
|
+
l === "suffix" ? n[u].push(...o) : n[u].unshift(...o);
|
|
212
215
|
});
|
|
213
216
|
}
|
|
214
217
|
function E(e) {
|
|
215
|
-
const
|
|
216
|
-
i?.setFieldValue(
|
|
217
|
-
r[t] = r[t].filter((
|
|
218
|
+
const l = new Set(d(e) ? [e] : e);
|
|
219
|
+
i?.setFieldValue(a.name, void 0, !0, (r, t) => {
|
|
220
|
+
r[t] = r[t].filter((o, n) => !l.has(n));
|
|
218
221
|
});
|
|
219
222
|
}
|
|
220
223
|
function k(e) {
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
r[t] = r[t].filter((
|
|
224
|
+
const l = new Set(M(e) ? e : [e]);
|
|
225
|
+
l.size !== 0 && i?.setFieldValue?.(a.name, void 0, !0, (r, t) => {
|
|
226
|
+
r[t] = r[t].filter((o) => !l.has(o[a.rowKey]));
|
|
224
227
|
});
|
|
225
228
|
}
|
|
226
229
|
function L() {
|
|
@@ -229,29 +232,29 @@ const Fe = /* @__PURE__ */ z({
|
|
|
229
232
|
function V(e) {
|
|
230
233
|
return s(f)?.[e];
|
|
231
234
|
}
|
|
232
|
-
function T(e,
|
|
233
|
-
i?.setFieldValue(
|
|
234
|
-
if (!(!t[
|
|
235
|
+
function T(e, l, r = !0) {
|
|
236
|
+
i?.setFieldValue(a.name, void 0, !0, (t, o) => {
|
|
237
|
+
if (!(!t[o] || !t[o][e])) {
|
|
235
238
|
if (!r) {
|
|
236
|
-
const
|
|
237
|
-
for (const u of
|
|
238
|
-
u !==
|
|
239
|
+
const n = Object.keys(t[o][e]);
|
|
240
|
+
for (const u of n)
|
|
241
|
+
u !== a.rowKey && delete t[o][e][u];
|
|
239
242
|
}
|
|
240
|
-
Object.assign(t[
|
|
241
|
-
...
|
|
243
|
+
Object.assign(t[o][e], {
|
|
244
|
+
...l
|
|
242
245
|
});
|
|
243
246
|
}
|
|
244
247
|
});
|
|
245
248
|
}
|
|
246
249
|
function j(e) {
|
|
247
|
-
i?.setFieldValue(
|
|
250
|
+
i?.setFieldValue(a.name, e);
|
|
248
251
|
}
|
|
249
252
|
function O(e) {
|
|
250
|
-
const
|
|
251
|
-
p.value?.scrollToRow(
|
|
253
|
+
const l = e === "end" ? f.value.length - 1 : e;
|
|
254
|
+
p.value?.scrollToRow(l);
|
|
252
255
|
}
|
|
253
256
|
function _() {
|
|
254
|
-
i?.setFieldValue?.(
|
|
257
|
+
i?.setFieldValue?.(a.name, []);
|
|
255
258
|
}
|
|
256
259
|
return b({
|
|
257
260
|
add: N,
|
|
@@ -264,11 +267,11 @@ const Fe = /* @__PURE__ */ z({
|
|
|
264
267
|
setTableData: j,
|
|
265
268
|
clear: _,
|
|
266
269
|
removeByKey: k
|
|
267
|
-
}), (e,
|
|
270
|
+
}), (e, l) => (W(), A(s(y).FormItem, g(e.formItem, {
|
|
268
271
|
name: e.name,
|
|
269
272
|
label: e.label
|
|
270
273
|
}), {
|
|
271
|
-
default: h(() => [U(ie, g(s(ee)(
|
|
274
|
+
default: h(() => [U(ie, g(s(ee)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
272
275
|
ref_key: "tableRef",
|
|
273
276
|
ref: p,
|
|
274
277
|
class: [s(R)(), s(B)],
|
|
@@ -279,12 +282,12 @@ const Fe = /* @__PURE__ */ z({
|
|
|
279
282
|
_: 2
|
|
280
283
|
}, [q(x, (r, t) => ({
|
|
281
284
|
name: t,
|
|
282
|
-
fn: h((
|
|
285
|
+
fn: h((o) => [J(e.$slots, t, Q(X(o || {})))])
|
|
283
286
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
284
287
|
_: 3
|
|
285
288
|
}, 16, ["name", "label"]));
|
|
286
289
|
}
|
|
287
290
|
});
|
|
288
291
|
export {
|
|
289
|
-
|
|
292
|
+
ve as default
|
|
290
293
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as W, useSlots as U, ref as y, watch as C, unref as
|
|
1
|
+
import { defineComponent as W, useSlots as U, ref as y, watch as C, unref as r, createBlock as $, openBlock as q, withCtx as p, createVNode as w, mergeProps as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as M } from "vue";
|
|
2
2
|
import { ApForm as m } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isEqual as ee, isArray as c, isUndefined as te, isNumber as g, cloneDeep as ae, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import "../../utils/index.mjs";
|
|
7
|
-
import { useGetEditableColumns as
|
|
7
|
+
import { useGetEditableColumns as le } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useDevWarning as
|
|
10
|
-
import
|
|
11
|
-
import { useNamespace as
|
|
9
|
+
import { useDevWarning as ne } from "../../utils/warning.mjs";
|
|
10
|
+
import re from "../style/editable.mjs";
|
|
11
|
+
import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
import { useControllableValue as ie } from "../../hooks/useControllableValue.mjs";
|
|
13
13
|
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
14
|
import { isDef as b } from "../../utils/is.mjs";
|
|
@@ -84,6 +84,9 @@ const Ee = /* @__PURE__ */ W({
|
|
|
84
84
|
default: !1
|
|
85
85
|
},
|
|
86
86
|
transformCellText: {},
|
|
87
|
+
rowHoverable: {
|
|
88
|
+
type: Boolean
|
|
89
|
+
},
|
|
87
90
|
rowClassName: {},
|
|
88
91
|
stripe: {
|
|
89
92
|
type: Boolean
|
|
@@ -171,8 +174,8 @@ const Ee = /* @__PURE__ */ W({
|
|
|
171
174
|
}) {
|
|
172
175
|
const B = U(), t = v, {
|
|
173
176
|
b: S
|
|
174
|
-
} =
|
|
175
|
-
|
|
177
|
+
} = se("editable-grid"), F = re("editable-grid"), E = R;
|
|
178
|
+
ne("EditableGrid")(!1, "breaking", "EditableGrid has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
176
179
|
const h = y(), {
|
|
177
180
|
value: u,
|
|
178
181
|
updateValue: N
|
|
@@ -183,88 +186,88 @@ const Ee = /* @__PURE__ */ W({
|
|
|
183
186
|
deep: !0,
|
|
184
187
|
flush: "post"
|
|
185
188
|
}), C(u, (e) => {
|
|
186
|
-
e !==
|
|
189
|
+
e !== r(f) && (ee(e, r(f)) || i.value?.setFieldValue(t.name, e));
|
|
187
190
|
}, {
|
|
188
191
|
deep: !0
|
|
189
192
|
});
|
|
190
|
-
const k =
|
|
193
|
+
const k = le(t, V);
|
|
191
194
|
function L() {
|
|
192
195
|
i.value?.resetFields();
|
|
193
196
|
}
|
|
194
197
|
function _(e) {
|
|
195
|
-
return e ? (c(e) ? e : [e]).map((
|
|
198
|
+
return e ? (c(e) ? e : [e]).map((n) => c(n) ? [t.name, ...n] : [t.name, n]) : void 0;
|
|
196
199
|
}
|
|
197
|
-
async function D(e,
|
|
198
|
-
return (await i.value?.validateFields(_(e),
|
|
200
|
+
async function D(e, l) {
|
|
201
|
+
return (await i.value?.validateFields(_(e), l))?.[t.name];
|
|
199
202
|
}
|
|
200
|
-
function O(e,
|
|
201
|
-
const
|
|
202
|
-
if (b(t.maxLength) &&
|
|
203
|
+
function O(e, l) {
|
|
204
|
+
const n = r(u)?.length || 0;
|
|
205
|
+
if (b(t.maxLength) && n >= t.maxLength)
|
|
203
206
|
return;
|
|
204
207
|
const a = {
|
|
205
208
|
...e || {}
|
|
206
209
|
};
|
|
207
|
-
i.value?.setFieldValue?.(t.name, a, !0, (o,
|
|
208
|
-
if (!o[
|
|
209
|
-
o[
|
|
210
|
+
i.value?.setFieldValue?.(t.name, a, !0, (o, s) => {
|
|
211
|
+
if (!o[s]) {
|
|
212
|
+
o[s] = [a];
|
|
210
213
|
return;
|
|
211
214
|
}
|
|
212
|
-
te(
|
|
215
|
+
te(l) ? o[s].push(a) : o[s].splice(l, 0, a);
|
|
213
216
|
});
|
|
214
217
|
}
|
|
215
|
-
function T(e,
|
|
216
|
-
const
|
|
217
|
-
if (b(t.maxLength) &&
|
|
218
|
+
function T(e, l = "suffix") {
|
|
219
|
+
const n = r(u)?.length || 0, a = g(e) ? e : e.length;
|
|
220
|
+
if (b(t.maxLength) && n + a > t.maxLength)
|
|
218
221
|
return;
|
|
219
222
|
const o = g(e) ? new Array(e).fill(0).map(() => ({})) : ae(e);
|
|
220
|
-
i.value?.setFieldValue?.(t.name, o, !0, (
|
|
221
|
-
if (!
|
|
222
|
-
|
|
223
|
+
i.value?.setFieldValue?.(t.name, o, !0, (s, d) => {
|
|
224
|
+
if (!s[d]) {
|
|
225
|
+
s[d] = [...o];
|
|
223
226
|
return;
|
|
224
227
|
}
|
|
225
|
-
|
|
228
|
+
l === "suffix" ? s[d].push(...o) : s[d].unshift(...o);
|
|
226
229
|
});
|
|
227
230
|
}
|
|
228
231
|
function j(e) {
|
|
229
|
-
const
|
|
230
|
-
i.value?.setFieldValue?.(t.name, void 0, !0, (
|
|
231
|
-
|
|
232
|
+
const l = new Set(g(e) ? [e] : e);
|
|
233
|
+
i.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
|
|
234
|
+
n[a] = n[a].filter((o, s) => !l.has(s));
|
|
232
235
|
});
|
|
233
236
|
}
|
|
234
237
|
function A(e) {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
+
const l = new Set(c(e) ? e : [e]);
|
|
239
|
+
l.size !== 0 && i.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
|
|
240
|
+
n[a] = n[a].filter((o) => !l.has(o[t.rowKey]));
|
|
238
241
|
});
|
|
239
242
|
}
|
|
240
243
|
function z() {
|
|
241
|
-
return
|
|
244
|
+
return r(u);
|
|
242
245
|
}
|
|
243
246
|
function G(e) {
|
|
244
247
|
i.value?.setFieldValue(t.name, e);
|
|
245
248
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
249
|
+
function H(e) {
|
|
250
|
+
return r(u)?.[e];
|
|
248
251
|
}
|
|
249
|
-
function
|
|
252
|
+
function I(e, l, n = !0) {
|
|
250
253
|
i.value?.setFieldValue?.(t.name, void 0, !0, (a, o) => {
|
|
251
254
|
if (!(!a[o] || !a[o][e])) {
|
|
252
|
-
if (!
|
|
253
|
-
const
|
|
254
|
-
for (const d of
|
|
255
|
+
if (!n) {
|
|
256
|
+
const s = Object.keys(a[o][e]);
|
|
257
|
+
for (const d of s)
|
|
255
258
|
d !== t.rowKey && delete a[o][e][d];
|
|
256
259
|
}
|
|
257
260
|
Object.assign(a[o][e], {
|
|
258
|
-
...
|
|
261
|
+
...l
|
|
259
262
|
});
|
|
260
263
|
}
|
|
261
264
|
});
|
|
262
265
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
h.value?.scrollToRow(
|
|
266
|
+
function K(e) {
|
|
267
|
+
const l = e === "end" ? u.value.length - 1 : e;
|
|
268
|
+
h.value?.scrollToRow(l);
|
|
266
269
|
}
|
|
267
|
-
function
|
|
270
|
+
function P() {
|
|
268
271
|
i.value?.setFieldValue?.(t.name, []);
|
|
269
272
|
}
|
|
270
273
|
return x({
|
|
@@ -272,38 +275,38 @@ const Ee = /* @__PURE__ */ W({
|
|
|
272
275
|
validateFields: D,
|
|
273
276
|
add: O,
|
|
274
277
|
remove: j,
|
|
275
|
-
getRowData:
|
|
278
|
+
getRowData: H,
|
|
276
279
|
getRowsData: z,
|
|
277
|
-
setRowData:
|
|
280
|
+
setRowData: I,
|
|
278
281
|
addMultiple: T,
|
|
279
|
-
scrollTo:
|
|
280
|
-
clear:
|
|
282
|
+
scrollTo: K,
|
|
283
|
+
clear: P,
|
|
281
284
|
setTableData: G,
|
|
282
285
|
removeByKey: A
|
|
283
|
-
}), (e,
|
|
286
|
+
}), (e, l) => (q(), $(r(m), {
|
|
284
287
|
ref_key: "formRef",
|
|
285
288
|
ref: i,
|
|
286
289
|
"initial-values": {
|
|
287
|
-
[t.name]:
|
|
290
|
+
[t.name]: r(u)
|
|
288
291
|
},
|
|
289
292
|
style: {
|
|
290
293
|
height: "100%"
|
|
291
294
|
}
|
|
292
295
|
}, {
|
|
293
|
-
default: p(() => [w(
|
|
296
|
+
default: p(() => [w(r(m).FormItem, {
|
|
294
297
|
name: e.name,
|
|
295
298
|
"no-style": ""
|
|
296
299
|
}, {
|
|
297
|
-
default: p(() => [w(de, J(
|
|
300
|
+
default: p(() => [w(de, J(r(oe)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
298
301
|
ref_key: "tableRef",
|
|
299
302
|
ref: h,
|
|
300
|
-
class: [
|
|
301
|
-
columns:
|
|
302
|
-
"data-source":
|
|
303
|
+
class: [r(S)(), r(F)],
|
|
304
|
+
columns: r(k),
|
|
305
|
+
"data-source": r(u),
|
|
303
306
|
"search-form": !1
|
|
304
307
|
}), Q({
|
|
305
308
|
_: 2
|
|
306
|
-
}, [X(B, (
|
|
309
|
+
}, [X(B, (n, a) => ({
|
|
307
310
|
name: a,
|
|
308
311
|
fn: p((o) => [Y(e.$slots, a, Z(M(o || {})))])
|
|
309
312
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
@@ -66,6 +66,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
66
66
|
rowExpandable: {},
|
|
67
67
|
sticky: { type: [Boolean, Object], default: !1 },
|
|
68
68
|
transformCellText: {},
|
|
69
|
+
rowHoverable: { type: Boolean },
|
|
69
70
|
rowClassName: {},
|
|
70
71
|
stripe: { type: Boolean },
|
|
71
72
|
headerRowClassName: {},
|
|
@@ -177,14 +178,14 @@ const io = /* @__PURE__ */ Qe({
|
|
|
177
178
|
].filter(Boolean)), j = n(() => ie(t(i), (e) => {
|
|
178
179
|
if (e.sorter === !0)
|
|
179
180
|
return e.key || e.dataIndex;
|
|
180
|
-
}).filter(Boolean)),
|
|
181
|
+
}).filter(Boolean)), H = n(() => ie(t(i), (e) => {
|
|
181
182
|
if (e.filters && !e.onFilter)
|
|
182
183
|
return e.key || e.dataIndex;
|
|
183
184
|
}).filter(Boolean)), {
|
|
184
185
|
formRef: g,
|
|
185
186
|
submit: P,
|
|
186
187
|
reset: A,
|
|
187
|
-
refresh:
|
|
188
|
+
refresh: q,
|
|
188
189
|
data: p,
|
|
189
190
|
tableProps: U,
|
|
190
191
|
setDataSource: Fe,
|
|
@@ -208,7 +209,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
208
209
|
};
|
|
209
210
|
},
|
|
210
211
|
namespace: "ap-grid",
|
|
211
|
-
filterFields:
|
|
212
|
+
filterFields: H,
|
|
212
213
|
sortFields: j,
|
|
213
214
|
params: et(o, "params"),
|
|
214
215
|
defaultData: o.defaultData,
|
|
@@ -238,7 +239,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
238
239
|
submit: P,
|
|
239
240
|
submitWith: X,
|
|
240
241
|
reset: A,
|
|
241
|
-
refresh:
|
|
242
|
+
refresh: q,
|
|
242
243
|
getSearchFormSorterItems: Y,
|
|
243
244
|
setSearchFormSorterItems: Z,
|
|
244
245
|
resetSearchFormSorterItems: ee
|
|
@@ -338,18 +339,18 @@ const io = /* @__PURE__ */ Qe({
|
|
|
338
339
|
o.onReady(e);
|
|
339
340
|
});
|
|
340
341
|
}
|
|
341
|
-
async function
|
|
342
|
+
async function He(e, a) {
|
|
342
343
|
const r = p.records[e];
|
|
343
344
|
if (r)
|
|
344
345
|
return l.value?.scrollToRow(r, a);
|
|
345
346
|
}
|
|
346
|
-
const
|
|
347
|
+
const qe = (e) => $(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
347
348
|
async function Ue(e, a = !0) {
|
|
348
349
|
const r = l.value;
|
|
349
350
|
if (!r)
|
|
350
351
|
return;
|
|
351
352
|
const f = rt(e) ? e : [e], Xe = (r.getData() || []).filter(
|
|
352
|
-
(Je) => f.includes(
|
|
353
|
+
(Je) => f.includes(qe(Je))
|
|
353
354
|
);
|
|
354
355
|
r.setRowExpand(Xe, a);
|
|
355
356
|
}
|
|
@@ -382,7 +383,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
382
383
|
), fe({
|
|
383
384
|
submit: P,
|
|
384
385
|
reset: A,
|
|
385
|
-
refresh:
|
|
386
|
+
refresh: q,
|
|
386
387
|
submitWith: X,
|
|
387
388
|
setSearchFormValues: J,
|
|
388
389
|
getSearchFormValues: Q,
|
|
@@ -392,7 +393,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
392
393
|
setSelectedRowKeys: We,
|
|
393
394
|
clearAll: _
|
|
394
395
|
},
|
|
395
|
-
scrollToRow:
|
|
396
|
+
scrollToRow: He,
|
|
396
397
|
getDataSource: () => t(p.records),
|
|
397
398
|
setCurrentRow: Ge,
|
|
398
399
|
getPaging: Ie,
|
|
@@ -461,7 +462,7 @@ const io = /* @__PURE__ */ Qe({
|
|
|
461
462
|
trigger: "cell"
|
|
462
463
|
},
|
|
463
464
|
"filter-config": {
|
|
464
|
-
remote:
|
|
465
|
+
remote: H.value.length > 0
|
|
465
466
|
},
|
|
466
467
|
loading: ze.value,
|
|
467
468
|
style: t(ve),
|