@aplus-frontend/ui 6.33.0 → 6.35.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.
- package/es/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/tooltip/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/tooltip/index.vue2.mjs +29 -0
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +94 -87
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +28 -22
- package/es/src/ag-grid/index.vue.mjs +164 -161
- package/es/src/ag-grid/interface.d.ts +5 -1
- package/es/src/ap-download/ap-download.vue.mjs +31 -25
- package/es/src/ap-form/ap-form.vue.d.ts +2 -6
- package/es/src/ap-form/ap-form.vue2.mjs +71 -69
- package/es/src/ap-grid/editable/form-item.vue.mjs +74 -71
- package/es/src/ap-grid/editable/index.vue.mjs +94 -91
- package/es/src/ap-grid/index.vue.mjs +74 -69
- package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue2.mjs +72 -69
- package/es/src/ap-tag/ap-tag-group.vue.mjs +33 -30
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +103 -103
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
- package/es/src/business/ap-attachment/ApAttachment.mjs +16 -15
- package/es/src/business/ap-copy/ApCopy.mjs +5 -6
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +176 -175
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +4 -4
- package/es/src/business/ap-label/ApLabel.d.ts +1 -1
- package/es/src/business/ap-label/index.d.ts +3 -3
- package/es/src/business/hooks/usePageListApTable.mjs +10 -9
- package/es/src/editable-table/form-item.vue.mjs +75 -72
- package/es/src/editable-table/hooks/use-get-columns.mjs +35 -34
- package/es/src/editable-table/index.vue.mjs +68 -65
- package/es/src/utils/warning.d.ts +25 -0
- package/es/src/utils/warning.mjs +74 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/tooltip/index.vue.js +1 -0
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +5 -1
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -6
- package/lib/src/ap-form/ap-form.vue2.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-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
- package/lib/src/business/ap-label/index.d.ts +3 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/utils/warning.d.ts +25 -0
- package/lib/src/utils/warning.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +5 -1
- package/theme/ag-grid/index.less +5 -1
- package/theme/index.css +5 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, ref as p, unref as r, useSlots as A, toRef as K, watch as O, nextTick as G, createBlock as W, openBlock as H, mergeProps as c, withCtx as g, createVNode as U, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
2
|
import { Table as Y } from "@aplus-frontend/antdv";
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isUndefined as Z, isNumber as d, cloneDeep as M, isArray as ee, omit as
|
|
3
|
+
import { ApForm as h } from "../ap-form/index.mjs";
|
|
4
|
+
import { isUndefined as Z, isNumber as d, cloneDeep as M, isArray as ee, omit as b } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import { useInjectForm as te } from "../ap-form/context.mjs";
|
|
7
|
-
import { isDef as
|
|
8
|
-
import
|
|
9
|
-
import { scrollToRowIndex as
|
|
7
|
+
import { isDef as w } from "../utils/index.mjs";
|
|
8
|
+
import ae from "./hooks/use-get-columns.mjs";
|
|
9
|
+
import { scrollToRowIndex as oe } from "./utils.mjs";
|
|
10
10
|
import { getModelValue as ne } from "../ap-form/utils/get.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
11
|
+
import { useDevWarning as le } from "../utils/warning.mjs";
|
|
12
|
+
import { useNamespace as se } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useGlobalConfig as re } from "../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
const Re = /* @__PURE__ */ z({
|
|
14
15
|
name: "EditableTableFormItem",
|
|
15
16
|
__name: "form-item",
|
|
16
17
|
props: {
|
|
@@ -111,116 +112,118 @@ const ye = /* @__PURE__ */ K({
|
|
|
111
112
|
default: () => ({})
|
|
112
113
|
}
|
|
113
114
|
},
|
|
114
|
-
setup(
|
|
115
|
-
expose:
|
|
115
|
+
setup(x, {
|
|
116
|
+
expose: y
|
|
116
117
|
}) {
|
|
117
|
-
const
|
|
118
|
-
|
|
118
|
+
const o = x;
|
|
119
|
+
le("EditableTableFormItem")(!1, "breaking", "EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
120
|
+
const {
|
|
121
|
+
internalInstance: i,
|
|
119
122
|
model: C
|
|
120
|
-
} = te(),
|
|
121
|
-
O(() =>
|
|
122
|
-
await G(),
|
|
123
|
+
} = te(), u = p(ne(r(C), o.name) || []), R = A(), F = K(o, "name"), B = h.useWatch(F);
|
|
124
|
+
O(() => B.value, async (e) => {
|
|
125
|
+
await G(), u.value = e, o.onChange?.(e);
|
|
123
126
|
}, {
|
|
124
127
|
deep: !0
|
|
125
128
|
});
|
|
126
129
|
const {
|
|
127
|
-
b:
|
|
128
|
-
} =
|
|
129
|
-
function
|
|
130
|
-
const l = r(
|
|
131
|
-
if (
|
|
130
|
+
b: T
|
|
131
|
+
} = se("editable-table"), m = p(), v = re("valueTypeMap"), I = ae(o, v);
|
|
132
|
+
function D(e, n) {
|
|
133
|
+
const l = r(u)?.length || 0;
|
|
134
|
+
if (w(o.maxLength) && l >= o.maxLength)
|
|
132
135
|
return;
|
|
133
136
|
const t = {
|
|
134
137
|
...e || {}
|
|
135
138
|
};
|
|
136
|
-
|
|
137
|
-
if (!
|
|
138
|
-
|
|
139
|
+
i?.setFieldValue(o.name, t, !0, (a, s) => {
|
|
140
|
+
if (!a[s]) {
|
|
141
|
+
a[s] = [t];
|
|
139
142
|
return;
|
|
140
143
|
}
|
|
141
|
-
Z(n) ?
|
|
144
|
+
Z(n) ? a[s].push(t) : a[s].splice(n, 0, t);
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
|
-
function
|
|
145
|
-
const l = r(
|
|
146
|
-
if (
|
|
147
|
+
function E(e, n = "suffix") {
|
|
148
|
+
const l = r(u)?.length || 0, t = d(e) ? e : e.length;
|
|
149
|
+
if (w(o.maxLength) && l + t > o.maxLength)
|
|
147
150
|
return;
|
|
148
|
-
const
|
|
149
|
-
|
|
151
|
+
const a = d(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
|
|
152
|
+
i?.setFieldValue(o.name, a, !0, (s, f) => {
|
|
150
153
|
if (!s[f]) {
|
|
151
|
-
s[f] = [...
|
|
154
|
+
s[f] = [...a];
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
|
-
n === "suffix" ? s[f].push(...
|
|
157
|
+
n === "suffix" ? s[f].push(...a) : s[f].unshift(...a);
|
|
155
158
|
});
|
|
156
159
|
}
|
|
157
|
-
function
|
|
160
|
+
function L(e) {
|
|
158
161
|
const n = new Set(d(e) ? [e] : e);
|
|
159
|
-
|
|
160
|
-
l[t] = l[t].filter((
|
|
162
|
+
i?.setFieldValue(o.name, void 0, !0, (l, t) => {
|
|
163
|
+
l[t] = l[t].filter((a, s) => !n.has(s));
|
|
161
164
|
});
|
|
162
165
|
}
|
|
163
|
-
function
|
|
166
|
+
function S(e) {
|
|
164
167
|
const n = new Set(ee(e) ? e : [e]);
|
|
165
|
-
n.size !== 0 &&
|
|
166
|
-
l[t] = l[t].filter((
|
|
168
|
+
n.size !== 0 && i?.setFieldValue?.(o.name, void 0, !0, (l, t) => {
|
|
169
|
+
l[t] = l[t].filter((a) => !n.has(a[o.rowKey]));
|
|
167
170
|
});
|
|
168
171
|
}
|
|
169
|
-
function
|
|
170
|
-
return r(
|
|
172
|
+
function V() {
|
|
173
|
+
return r(u);
|
|
171
174
|
}
|
|
172
|
-
function
|
|
173
|
-
return r(
|
|
175
|
+
function k(e) {
|
|
176
|
+
return r(u)?.[e];
|
|
174
177
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
!t[
|
|
178
|
-
...l ? t[
|
|
178
|
+
function N(e, n, l = !0) {
|
|
179
|
+
i?.setFieldValue(o.name, void 0, !0, (t, a) => {
|
|
180
|
+
!t[a] || !t[a][e] || (t[a][e] = {
|
|
181
|
+
...l ? t[a][e] : {},
|
|
179
182
|
...n
|
|
180
183
|
});
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
186
|
+
function _(e) {
|
|
187
|
+
i?.setFieldValue(o.name, e);
|
|
185
188
|
}
|
|
186
|
-
function
|
|
187
|
-
const l = e === "end" ?
|
|
188
|
-
|
|
189
|
+
function P(e, n) {
|
|
190
|
+
const l = e === "end" ? u.value.length - 1 : e;
|
|
191
|
+
oe(l, m.value?.$el, n);
|
|
189
192
|
}
|
|
190
|
-
function
|
|
191
|
-
|
|
193
|
+
function j() {
|
|
194
|
+
i?.setFieldValue?.(o.name, []);
|
|
192
195
|
}
|
|
193
|
-
return
|
|
194
|
-
add:
|
|
195
|
-
remove:
|
|
196
|
-
getRowData:
|
|
197
|
-
getRowsData:
|
|
198
|
-
setRowData:
|
|
199
|
-
addMultiple:
|
|
200
|
-
scrollTo:
|
|
201
|
-
setTableData:
|
|
202
|
-
clear:
|
|
203
|
-
removeByKey:
|
|
204
|
-
}), (e, n) => (
|
|
196
|
+
return y({
|
|
197
|
+
add: D,
|
|
198
|
+
remove: L,
|
|
199
|
+
getRowData: k,
|
|
200
|
+
getRowsData: V,
|
|
201
|
+
setRowData: N,
|
|
202
|
+
addMultiple: E,
|
|
203
|
+
scrollTo: P,
|
|
204
|
+
setTableData: _,
|
|
205
|
+
clear: j,
|
|
206
|
+
removeByKey: S
|
|
207
|
+
}), (e, n) => (H(), W(r(h).FormItem, c(e.formItem, {
|
|
205
208
|
name: e.name,
|
|
206
209
|
label: e.label
|
|
207
210
|
}), {
|
|
208
|
-
default:
|
|
211
|
+
default: g(() => [U(r(Y), c(r(b)(o, ["name", "maxLength", "onChange"]), {
|
|
209
212
|
ref_key: "tableRef",
|
|
210
213
|
ref: m,
|
|
211
|
-
class: r(
|
|
212
|
-
columns: r(
|
|
213
|
-
"data-source":
|
|
214
|
+
class: r(T)(),
|
|
215
|
+
columns: r(I),
|
|
216
|
+
"data-source": u.value
|
|
214
217
|
}), $({
|
|
215
218
|
_: 2
|
|
216
|
-
}, [q(r(
|
|
219
|
+
}, [q(r(b)(R, ["headerCell"]), (l, t) => ({
|
|
217
220
|
name: t,
|
|
218
|
-
fn:
|
|
221
|
+
fn: g((a) => [J(e.$slots, t, Q(X(a || {})))])
|
|
219
222
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
220
223
|
_: 3
|
|
221
224
|
}, 16, ["name", "label"]));
|
|
222
225
|
}
|
|
223
226
|
});
|
|
224
227
|
export {
|
|
225
|
-
|
|
228
|
+
Re as default
|
|
226
229
|
};
|
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { useSlots as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { getEditableTableTitle as
|
|
4
|
-
import { updateFormProps as A, getFieldProps as
|
|
1
|
+
import { useSlots as p, computed as C, unref as u } from "vue";
|
|
2
|
+
import { omit as N, isFunction as y, isArray as m } from "lodash-unified";
|
|
3
|
+
import { getEditableTableTitle as k, mergeClass as v, getFinalNode as w } from "../utils.mjs";
|
|
4
|
+
import { updateFormProps as A, getFieldProps as E, getTableRenderProps as q } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { useToken as
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { useToken as D } from "@aplus-frontend/antdv/es/theme/internal";
|
|
7
|
+
import { useDevWarning as G } from "../../utils/warning.mjs";
|
|
8
|
+
import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const M = (r, f) => {
|
|
9
10
|
const {
|
|
10
11
|
em: b,
|
|
11
|
-
be:
|
|
12
|
-
} =
|
|
12
|
+
be: g
|
|
13
|
+
} = S("editable-table"), x = G("EditableTable"), F = p(), [, T] = D();
|
|
13
14
|
return C(() => {
|
|
14
|
-
const d =
|
|
15
|
+
const d = r.columns;
|
|
15
16
|
if (!d)
|
|
16
17
|
return [];
|
|
17
18
|
function c(h) {
|
|
18
19
|
return h.map((e) => ({
|
|
19
|
-
...
|
|
20
|
+
...N(e, ["ellipsis"]),
|
|
20
21
|
children: c(e.children || []),
|
|
21
|
-
title:
|
|
22
|
+
title: k(e, g("table-header", "title"), b("header-cell", "required"), F.headerCell, u(T).colorTextTertiary),
|
|
22
23
|
customRender({
|
|
23
|
-
value:
|
|
24
|
+
value: a,
|
|
24
25
|
...n
|
|
25
26
|
}) {
|
|
26
|
-
const
|
|
27
|
+
const l = y(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
|
|
27
28
|
if (!e.valueType && !e.customRender && !e.customRenderFormItem)
|
|
28
|
-
return
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
value:
|
|
29
|
+
return x(!1, "usage", "'can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`'"), null;
|
|
30
|
+
let t;
|
|
31
|
+
if (l) {
|
|
32
|
+
const o = A(e, E(e.fieldProps, {
|
|
33
|
+
value: a,
|
|
33
34
|
...n
|
|
34
|
-
})),
|
|
35
|
-
|
|
35
|
+
})), i = {};
|
|
36
|
+
r.onFieldChange && (i[`onUpdate:${o.valuePropName || "value"}`] = (R) => r.onFieldChange?.(n.index, e.dataIndex, R));
|
|
36
37
|
const I = m(e.dataIndex) ? e.dataIndex : [e.dataIndex];
|
|
37
|
-
|
|
38
|
-
name: [...m(
|
|
39
|
-
...
|
|
38
|
+
t = {
|
|
39
|
+
name: [...m(r.name) ? r.name : [r.name], n.index, ...I],
|
|
40
|
+
...o || {},
|
|
40
41
|
field: {
|
|
41
42
|
style: "width: 100%",
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
class:
|
|
43
|
+
...o?.field || {},
|
|
44
|
+
...i,
|
|
45
|
+
class: v("is-editable", o.class)
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
} else
|
|
48
|
-
|
|
49
|
-
field:
|
|
50
|
-
value:
|
|
49
|
+
t = {
|
|
50
|
+
field: q(e, {
|
|
51
|
+
value: a,
|
|
51
52
|
...n
|
|
52
53
|
})
|
|
53
54
|
};
|
|
54
|
-
const s = w(e, t, a,
|
|
55
|
+
const s = w(e, l, t, a, n.record, u(f));
|
|
55
56
|
return e.customRender ? e.customRender({
|
|
56
|
-
value:
|
|
57
|
+
value: a,
|
|
57
58
|
...n,
|
|
58
|
-
editable:
|
|
59
|
+
editable: l,
|
|
59
60
|
originalNode: s
|
|
60
61
|
}) : s;
|
|
61
62
|
}
|
|
@@ -65,5 +66,5 @@ const K = (o, f) => {
|
|
|
65
66
|
});
|
|
66
67
|
};
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
M as default
|
|
69
70
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as W, useSlots as H, ref as b, watch as v, unref as s, 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 { Table as ee } from "@aplus-frontend/antdv";
|
|
3
3
|
import { ApForm as m } from "../ap-form/index.mjs";
|
|
4
|
-
import { isEqual as te, isArray as c, isUndefined as ae, isNumber as
|
|
4
|
+
import { isEqual as te, isArray as c, isUndefined as ae, isNumber as g, cloneDeep as ne, omit as x } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
|
-
import { isDef as
|
|
7
|
+
import { isDef as y } from "../utils/index.mjs";
|
|
8
8
|
import { scrollToRowIndex as oe } from "./utils.mjs";
|
|
9
9
|
import le from "./hooks/use-get-columns.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { useDevWarning as se } from "../utils/warning.mjs";
|
|
11
|
+
import { useNamespace as re } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
12
|
import { useControllableValue as ue } from "../hooks/useControllableValue.mjs";
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
const
|
|
13
|
+
import { useGlobalConfig as ie } from "../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
const Fe = /* @__PURE__ */ W({
|
|
14
15
|
name: "EditableTable",
|
|
15
16
|
__name: "index",
|
|
16
17
|
props: {
|
|
@@ -110,133 +111,135 @@ const Ce = /* @__PURE__ */ H({
|
|
|
110
111
|
onFieldChange: {}
|
|
111
112
|
},
|
|
112
113
|
emits: ["update:value"],
|
|
113
|
-
setup(
|
|
114
|
+
setup(C, {
|
|
114
115
|
expose: R,
|
|
115
116
|
emit: F
|
|
116
117
|
}) {
|
|
117
|
-
const t =
|
|
118
|
+
const t = C;
|
|
119
|
+
se("EditableTable")(!1, "breaking", "EditableTable has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
120
|
+
const {
|
|
118
121
|
b: B
|
|
119
|
-
} =
|
|
122
|
+
} = re("editable-table"), T = H(), E = F, h = b(), {
|
|
120
123
|
value: i,
|
|
121
|
-
updateValue:
|
|
122
|
-
} = ue(t,
|
|
123
|
-
v(() =>
|
|
124
|
-
|
|
124
|
+
updateValue: V
|
|
125
|
+
} = ue(t, E), r = b(), D = ie("valueTypeMap"), f = m.useWatch(t.name, r);
|
|
126
|
+
v(() => f.value, (e) => {
|
|
127
|
+
V(e), t.onChange?.(e);
|
|
125
128
|
}, {
|
|
126
129
|
deep: !0,
|
|
127
130
|
flush: "post"
|
|
128
131
|
}), v(i, (e) => {
|
|
129
|
-
e !== s(
|
|
132
|
+
e !== s(f) && (te(e, s(f)) || r.value?.setFieldValue(t.name, e));
|
|
130
133
|
}, {
|
|
131
134
|
deep: !0
|
|
132
135
|
});
|
|
133
136
|
const L = le(t, D);
|
|
134
|
-
function
|
|
135
|
-
|
|
137
|
+
function S() {
|
|
138
|
+
r.value?.resetFields();
|
|
136
139
|
}
|
|
137
|
-
function
|
|
140
|
+
function _(e) {
|
|
138
141
|
return e ? (c(e) ? e : [e]).map((n) => c(n) ? [t.name, ...n] : [t.name, n]) : void 0;
|
|
139
142
|
}
|
|
140
|
-
async function
|
|
141
|
-
return (await
|
|
143
|
+
async function k(e, l) {
|
|
144
|
+
return (await r.value?.validateFields(_(e), l))?.[t.name];
|
|
142
145
|
}
|
|
143
|
-
function
|
|
146
|
+
function N(e, l) {
|
|
144
147
|
const n = s(i)?.length || 0;
|
|
145
|
-
if (
|
|
148
|
+
if (y(t.maxLength) && n >= t.maxLength)
|
|
146
149
|
return;
|
|
147
150
|
const a = {
|
|
148
151
|
...e || {}
|
|
149
152
|
};
|
|
150
|
-
|
|
151
|
-
if (!o[
|
|
152
|
-
o[
|
|
153
|
+
r.value?.setFieldValue?.(t.name, a, !0, (o, u) => {
|
|
154
|
+
if (!o[u]) {
|
|
155
|
+
o[u] = [a];
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
|
-
ae(l) ? o[
|
|
158
|
+
ae(l) ? o[u].push(a) : o[u].splice(l, 0, a);
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
161
|
function A(e, l = "suffix") {
|
|
159
|
-
const n = s(i)?.length || 0, a =
|
|
160
|
-
if (
|
|
162
|
+
const n = s(i)?.length || 0, a = g(e) ? e : e.length;
|
|
163
|
+
if (y(t.maxLength) && n + a > t.maxLength)
|
|
161
164
|
return;
|
|
162
|
-
const o =
|
|
163
|
-
|
|
164
|
-
if (!
|
|
165
|
-
|
|
165
|
+
const o = g(e) ? new Array(e).fill(0).map(() => ({})) : ne(e);
|
|
166
|
+
r.value?.setFieldValue?.(t.name, o, !0, (u, d) => {
|
|
167
|
+
if (!u[d]) {
|
|
168
|
+
u[d] = [...o];
|
|
166
169
|
return;
|
|
167
170
|
}
|
|
168
|
-
l === "suffix" ?
|
|
171
|
+
l === "suffix" ? u[d].push(...o) : u[d].unshift(...o);
|
|
169
172
|
});
|
|
170
173
|
}
|
|
171
|
-
function
|
|
172
|
-
const l = new Set(
|
|
173
|
-
|
|
174
|
-
n[a] = n[a].filter((o,
|
|
174
|
+
function P(e) {
|
|
175
|
+
const l = new Set(g(e) ? [e] : e);
|
|
176
|
+
r.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
|
|
177
|
+
n[a] = n[a].filter((o, u) => !l.has(u));
|
|
175
178
|
});
|
|
176
179
|
}
|
|
177
|
-
function
|
|
180
|
+
function z(e) {
|
|
178
181
|
const l = new Set(c(e) ? e : [e]);
|
|
179
|
-
l.size !== 0 &&
|
|
182
|
+
l.size !== 0 && r.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
|
|
180
183
|
n[a] = n[a].filter((o) => !l.has(o[t.rowKey]));
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
|
-
function
|
|
186
|
+
function I() {
|
|
184
187
|
return s(i);
|
|
185
188
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
189
|
+
function K(e) {
|
|
190
|
+
r.value?.setFieldValue(t.name, e);
|
|
188
191
|
}
|
|
189
|
-
function
|
|
192
|
+
function O(e) {
|
|
190
193
|
return s(i)?.[e];
|
|
191
194
|
}
|
|
192
|
-
function
|
|
193
|
-
|
|
195
|
+
function j(e, l, n = !0) {
|
|
196
|
+
r.value?.setFieldValue?.(t.name, void 0, !0, (a, o) => {
|
|
194
197
|
!a[o] || !a[o][e] || (a[o][e] = {
|
|
195
198
|
...n ? a[o][e] : {},
|
|
196
199
|
...l
|
|
197
200
|
});
|
|
198
201
|
});
|
|
199
202
|
}
|
|
200
|
-
function
|
|
203
|
+
function G(e, l) {
|
|
201
204
|
const n = e === "end" ? i.value.length - 1 : e;
|
|
202
|
-
oe(n,
|
|
205
|
+
oe(n, h.value?.$el, l);
|
|
203
206
|
}
|
|
204
|
-
function
|
|
205
|
-
|
|
207
|
+
function U() {
|
|
208
|
+
r.value?.setFieldValue?.(t.name, []);
|
|
206
209
|
}
|
|
207
210
|
return R({
|
|
208
|
-
resetFields:
|
|
209
|
-
validateFields:
|
|
210
|
-
add:
|
|
211
|
-
remove:
|
|
212
|
-
getRowData:
|
|
213
|
-
getRowsData:
|
|
214
|
-
setRowData:
|
|
211
|
+
resetFields: S,
|
|
212
|
+
validateFields: k,
|
|
213
|
+
add: N,
|
|
214
|
+
remove: P,
|
|
215
|
+
getRowData: O,
|
|
216
|
+
getRowsData: I,
|
|
217
|
+
setRowData: j,
|
|
215
218
|
addMultiple: A,
|
|
216
|
-
scrollTo:
|
|
217
|
-
clear:
|
|
218
|
-
setTableData:
|
|
219
|
-
removeByKey:
|
|
219
|
+
scrollTo: G,
|
|
220
|
+
clear: U,
|
|
221
|
+
setTableData: K,
|
|
222
|
+
removeByKey: z
|
|
220
223
|
}), (e, l) => (q(), $(s(m), {
|
|
221
224
|
ref_key: "formRef",
|
|
222
|
-
ref:
|
|
225
|
+
ref: r,
|
|
223
226
|
"initial-values": {
|
|
224
227
|
[t.name]: s(i)
|
|
225
228
|
}
|
|
226
229
|
}, {
|
|
227
|
-
default: p(() => [
|
|
230
|
+
default: p(() => [w(s(m).FormItem, {
|
|
228
231
|
name: e.name,
|
|
229
232
|
"no-style": ""
|
|
230
233
|
}, {
|
|
231
|
-
default: p(() => [
|
|
234
|
+
default: p(() => [w(s(ee), J(s(x)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
232
235
|
ref_key: "tableRef",
|
|
233
|
-
ref:
|
|
236
|
+
ref: h,
|
|
234
237
|
class: s(B)(),
|
|
235
238
|
columns: s(L),
|
|
236
239
|
"data-source": s(i)
|
|
237
240
|
}), Q({
|
|
238
241
|
_: 2
|
|
239
|
-
}, [X(s(
|
|
242
|
+
}, [X(s(x)(T, ["headerCell"]), (n, a) => ({
|
|
240
243
|
name: a,
|
|
241
244
|
fn: p((o) => [Y(e.$slots, a, Z(M(o || {})))])
|
|
242
245
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
@@ -247,5 +250,5 @@ const Ce = /* @__PURE__ */ H({
|
|
|
247
250
|
}
|
|
248
251
|
});
|
|
249
252
|
export {
|
|
250
|
-
|
|
253
|
+
Fe as default
|
|
251
254
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* copy from rc-util/warnings
|
|
3
|
+
*/
|
|
4
|
+
type preMessageFn = (message: string, type: 'warning' | 'note') => string | null | undefined | number;
|
|
5
|
+
export declare function warning(valid: boolean, message: string): void;
|
|
6
|
+
export declare function note(valid: boolean, message: string): void;
|
|
7
|
+
export declare function warningOnce(valid: boolean, message: string): void;
|
|
8
|
+
export declare namespace warningOnce {
|
|
9
|
+
var preMessage: (fn: preMessageFn) => void;
|
|
10
|
+
var resetWarned: () => void;
|
|
11
|
+
var noteOnce: (valid: boolean, message: string) => void;
|
|
12
|
+
}
|
|
13
|
+
type BaseTypeWarning = (valid: boolean,
|
|
14
|
+
/**
|
|
15
|
+
* - deprecated: Some API will be removed in future but still support now.
|
|
16
|
+
* - usage: Some API usage is not correct.
|
|
17
|
+
* - breaking: Breaking change like API is removed.
|
|
18
|
+
*/
|
|
19
|
+
type: 'deprecated' | 'usage' | 'breaking', message?: string) => void;
|
|
20
|
+
type TypeWarning = BaseTypeWarning & {
|
|
21
|
+
deprecated: (valid: boolean, oldProp: string, newProp: string, message?: string) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare function resetWarning(): void;
|
|
24
|
+
export declare function useDevWarning(component: string): TypeWarning;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
let a = {};
|
|
2
|
+
const u = [], l = (e) => {
|
|
3
|
+
u.push(e);
|
|
4
|
+
};
|
|
5
|
+
function p(e, r) {
|
|
6
|
+
if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
|
|
7
|
+
const n = u.reduce(
|
|
8
|
+
(t, i) => i(t ?? "", "warning"),
|
|
9
|
+
r
|
|
10
|
+
);
|
|
11
|
+
n && console.error(`Warning: ${n}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function g(e, r) {
|
|
15
|
+
if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
|
|
16
|
+
const n = u.reduce(
|
|
17
|
+
(t, i) => i(t ?? "", "note"),
|
|
18
|
+
r
|
|
19
|
+
);
|
|
20
|
+
n && console.warn(`Note: ${n}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function d() {
|
|
24
|
+
a = {};
|
|
25
|
+
}
|
|
26
|
+
function f(e, r, n) {
|
|
27
|
+
!r && !a[n] && (e(!1, n), a[n] = !0);
|
|
28
|
+
}
|
|
29
|
+
function s(e, r) {
|
|
30
|
+
f(p, e, r);
|
|
31
|
+
}
|
|
32
|
+
function W(e, r) {
|
|
33
|
+
f(g, e, r);
|
|
34
|
+
}
|
|
35
|
+
s.preMessage = l;
|
|
36
|
+
s.resetWarned = d;
|
|
37
|
+
s.noteOnce = W;
|
|
38
|
+
function $() {
|
|
39
|
+
}
|
|
40
|
+
let o = null;
|
|
41
|
+
function w() {
|
|
42
|
+
d(), o = null;
|
|
43
|
+
}
|
|
44
|
+
function N(e) {
|
|
45
|
+
const r = (n, t, i) => {
|
|
46
|
+
if (!n)
|
|
47
|
+
if (t === "deprecated") {
|
|
48
|
+
const c = o;
|
|
49
|
+
o || (o = {}), o[e] = o[e] || [], o[e].includes(i || "") || o[e].push(i || ""), c || console.warn(
|
|
50
|
+
"[aplus-ui] There exists deprecated usage in your code:",
|
|
51
|
+
o
|
|
52
|
+
);
|
|
53
|
+
} else
|
|
54
|
+
s(n, `[aplus-ui: ${e}] ${i}`);
|
|
55
|
+
};
|
|
56
|
+
return r.deprecated = (n, t, i, c) => {
|
|
57
|
+
r(
|
|
58
|
+
n,
|
|
59
|
+
"deprecated",
|
|
60
|
+
`\`${t}\` is deprecated. Please use \`${i}\` instead.${c ? ` ${c}` : ""}`
|
|
61
|
+
);
|
|
62
|
+
}, process.env.NODE_ENV !== "production" ? r : (() => {
|
|
63
|
+
const n = () => {
|
|
64
|
+
};
|
|
65
|
+
return n.deprecated = $, n;
|
|
66
|
+
})();
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
g as note,
|
|
70
|
+
w as resetWarning,
|
|
71
|
+
N as useDevWarning,
|
|
72
|
+
p as warning,
|
|
73
|
+
s as warningOnce
|
|
74
|
+
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.35.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
params: any;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|