@aplus-frontend/ui 0.5.36 → 0.5.37
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/ap-grid/editable/form-item.vue.mjs +62 -56
- package/es/src/ap-grid/editable/index.vue.mjs +82 -76
- package/es/src/ap-list/index.vue.mjs +145 -138
- package/es/src/ap-list/interface.d.ts +4 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +28 -30
- 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-list/index.vue.js +1 -1
- package/lib/src/ap-list/interface.d.ts +4 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/package.json +1 -1
- package/theme/ap-list/index.css +38 -4
- package/theme/ap-list/index.less +41 -3
- package/theme/index.css +38 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as
|
|
2
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as u, watch as K, nextTick as W, createBlock as G, openBlock as U, mergeProps as g, withCtx as y, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isArray as Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { isDef as w } from "../../utils/index.mjs";
|
|
@@ -9,7 +9,7 @@ import { useInjectForm as te } from "../../ap-form/context.mjs";
|
|
|
9
9
|
import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import ne from "../index.vue.mjs";
|
|
12
|
-
const
|
|
12
|
+
const ye = /* @__PURE__ */ P({
|
|
13
13
|
name: "EditableGrid",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -154,10 +154,10 @@ const ge = /* @__PURE__ */ P({
|
|
|
154
154
|
default: () => ({})
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
|
-
setup(
|
|
158
|
-
expose:
|
|
157
|
+
setup(b, {
|
|
158
|
+
expose: x
|
|
159
159
|
}) {
|
|
160
|
-
const R = A(), l =
|
|
160
|
+
const R = A(), l = b, {
|
|
161
161
|
b: B
|
|
162
162
|
} = ae("editable-grid");
|
|
163
163
|
function S(e, o) {
|
|
@@ -166,108 +166,114 @@ const ge = /* @__PURE__ */ P({
|
|
|
166
166
|
const {
|
|
167
167
|
internalInstance: t,
|
|
168
168
|
model: F
|
|
169
|
-
} = te(), p = H(l.name), d = h(S(
|
|
170
|
-
|
|
169
|
+
} = te(), p = H(l.name), d = h(S(u(F), p.value) || []), N = C.useWatch(p);
|
|
170
|
+
K(() => N.value, async (e) => {
|
|
171
171
|
var o;
|
|
172
|
-
await
|
|
172
|
+
await W(), d.value = e, (o = l.onChange) == null || o.call(l, e);
|
|
173
173
|
}, {
|
|
174
174
|
deep: !0
|
|
175
175
|
});
|
|
176
|
-
const c = h(), v = le("valueTypeMap"),
|
|
177
|
-
function
|
|
178
|
-
var
|
|
179
|
-
const n = ((
|
|
176
|
+
const c = h(), v = le("valueTypeMap"), k = oe(l, v);
|
|
177
|
+
function D(e, o) {
|
|
178
|
+
var s;
|
|
179
|
+
const n = ((s = u(d)) == null ? void 0 : s.length) || 0;
|
|
180
180
|
if (w(l.maxLength) && n >= l.maxLength)
|
|
181
181
|
return;
|
|
182
182
|
const a = {
|
|
183
183
|
...e || {}
|
|
184
184
|
};
|
|
185
|
-
t == null || t.setFieldValue(l.name, a, !0, (
|
|
186
|
-
if (!
|
|
187
|
-
|
|
185
|
+
t == null || t.setFieldValue(l.name, a, !0, (r, f) => {
|
|
186
|
+
if (!r[f]) {
|
|
187
|
+
r[f] = [a];
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
|
-
I(o) ?
|
|
190
|
+
I(o) ? r[f].push(a) : r[f].splice(o, 0, a);
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
var
|
|
195
|
-
const n = ((
|
|
193
|
+
function L(e, o = "suffix") {
|
|
194
|
+
var r;
|
|
195
|
+
const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
|
|
196
196
|
if (w(l.maxLength) && n + a > l.maxLength)
|
|
197
197
|
return;
|
|
198
|
-
const
|
|
199
|
-
t == null || t.setFieldValue(l.name,
|
|
200
|
-
if (!
|
|
201
|
-
|
|
198
|
+
const s = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
|
|
199
|
+
t == null || t.setFieldValue(l.name, s, !0, (f, i) => {
|
|
200
|
+
if (!f[i]) {
|
|
201
|
+
f[i] = [...s];
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
o === "suffix" ?
|
|
204
|
+
o === "suffix" ? f[i].push(...s) : f[i].unshift(...s);
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function V(e) {
|
|
208
208
|
const o = new Set(m(e) ? [e] : e);
|
|
209
209
|
t == null || t.setFieldValue(l.name, void 0, !0, (n, a) => {
|
|
210
|
-
n[a] = n[a].filter((
|
|
210
|
+
n[a] = n[a].filter((s, r) => !o.has(r));
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return
|
|
213
|
+
function T() {
|
|
214
|
+
return u(d);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function _(e) {
|
|
217
217
|
var o;
|
|
218
|
-
return (o =
|
|
218
|
+
return (o = u(d)) == null ? void 0 : o[e];
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
t == null || t.setFieldValue(l.name, void 0, !0, (a,
|
|
222
|
-
!a[
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
function j(e, o, n = !0) {
|
|
221
|
+
t == null || t.setFieldValue(l.name, void 0, !0, (a, s) => {
|
|
222
|
+
if (!(!a[s] || !a[s][e])) {
|
|
223
|
+
if (!n) {
|
|
224
|
+
const r = Object.keys(a[s][e]);
|
|
225
|
+
for (const f of r)
|
|
226
|
+
f !== l.rowKey && delete a[s][e][f];
|
|
227
|
+
}
|
|
228
|
+
Object.assign(a[s][e], {
|
|
229
|
+
...o
|
|
230
|
+
});
|
|
231
|
+
}
|
|
226
232
|
});
|
|
227
233
|
}
|
|
228
|
-
function
|
|
234
|
+
function E(e) {
|
|
229
235
|
t == null || t.setFieldValue(l.name, e);
|
|
230
236
|
}
|
|
231
|
-
function
|
|
237
|
+
function O(e) {
|
|
232
238
|
var n;
|
|
233
239
|
const o = e === "end" ? d.value.length - 1 : e;
|
|
234
240
|
(n = c.value) == null || n.scrollToRow(o);
|
|
235
241
|
}
|
|
236
|
-
function
|
|
242
|
+
function z() {
|
|
237
243
|
var e;
|
|
238
244
|
(e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, l.name, []);
|
|
239
245
|
}
|
|
240
|
-
return
|
|
241
|
-
add:
|
|
242
|
-
remove:
|
|
243
|
-
getRowData:
|
|
244
|
-
getRowsData:
|
|
245
|
-
setRowData:
|
|
246
|
-
addMultiple:
|
|
247
|
-
scrollTo:
|
|
248
|
-
setTableData:
|
|
249
|
-
clear:
|
|
250
|
-
}), (e, o) => (U(),
|
|
246
|
+
return x({
|
|
247
|
+
add: D,
|
|
248
|
+
remove: V,
|
|
249
|
+
getRowData: _,
|
|
250
|
+
getRowsData: T,
|
|
251
|
+
setRowData: j,
|
|
252
|
+
addMultiple: L,
|
|
253
|
+
scrollTo: O,
|
|
254
|
+
setTableData: E,
|
|
255
|
+
clear: z
|
|
256
|
+
}), (e, o) => (U(), G(u(C).FormItem, g(e.formItem, {
|
|
251
257
|
name: e.name,
|
|
252
258
|
label: e.label
|
|
253
259
|
}), {
|
|
254
|
-
default:
|
|
260
|
+
default: y(() => [$(ne, g(u(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
255
261
|
ref_key: "tableRef",
|
|
256
262
|
ref: c,
|
|
257
|
-
class:
|
|
258
|
-
columns:
|
|
263
|
+
class: u(B)(),
|
|
264
|
+
columns: u(k),
|
|
259
265
|
"data-source": d.value,
|
|
260
266
|
"search-form": !1
|
|
261
267
|
}), q({
|
|
262
268
|
_: 2
|
|
263
269
|
}, [J(R, (n, a) => ({
|
|
264
270
|
name: a,
|
|
265
|
-
fn:
|
|
271
|
+
fn: y((s) => [Q(e.$slots, a, X(Y(s || {})))])
|
|
266
272
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
267
273
|
_: 3
|
|
268
274
|
}, 16, ["name", "label"]));
|
|
269
275
|
}
|
|
270
276
|
});
|
|
271
277
|
export {
|
|
272
|
-
|
|
278
|
+
ye as default
|
|
273
279
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, createBlock as q, openBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isEqual as ae, isArray as
|
|
2
|
+
import { ApForm as y } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as b, isUndefined as te, isNumber as g, cloneDeep as oe, omit as le } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isDef as
|
|
6
|
+
import { isDef as R } from "../../utils/index.mjs";
|
|
7
7
|
import { useGetEditableColumns as ne } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
9
|
+
import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
11
11
|
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import ie from "../index.vue.mjs";
|
|
13
|
-
const
|
|
13
|
+
const be = /* @__PURE__ */ U({
|
|
14
14
|
name: "EditableGrid",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -160,116 +160,122 @@ const Re = /* @__PURE__ */ U({
|
|
|
160
160
|
}) {
|
|
161
161
|
const N = $(), t = B, {
|
|
162
162
|
b: V
|
|
163
|
-
} =
|
|
163
|
+
} = se("editable-grid"), _ = F, C = w(), {
|
|
164
164
|
value: m,
|
|
165
|
-
updateValue:
|
|
166
|
-
} =
|
|
165
|
+
updateValue: k
|
|
166
|
+
} = re(t, _), f = w(), L = ue("valueTypeMap"), c = y.useWatch(t.name, f);
|
|
167
167
|
x(() => c.value, (e) => {
|
|
168
168
|
var a;
|
|
169
|
-
|
|
169
|
+
k(e), (a = t.onChange) == null || a.call(t, e);
|
|
170
170
|
}, {
|
|
171
171
|
deep: !0,
|
|
172
172
|
flush: "post"
|
|
173
173
|
}), x(m, (e) => {
|
|
174
174
|
var a;
|
|
175
|
-
e !== u(c) && (ae(e, u(c)) || (a =
|
|
175
|
+
e !== u(c) && (ae(e, u(c)) || (a = f.value) == null || a.setFieldValue(t.name, e));
|
|
176
176
|
}, {
|
|
177
177
|
deep: !0
|
|
178
178
|
});
|
|
179
|
-
const
|
|
180
|
-
function
|
|
179
|
+
const E = ne(t, L);
|
|
180
|
+
function D() {
|
|
181
181
|
var e;
|
|
182
|
-
(e =
|
|
182
|
+
(e = f.value) == null || e.resetFields();
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return e ? (
|
|
184
|
+
function T(e) {
|
|
185
|
+
return e ? (b(e) ? e : [e]).map((o) => b(o) ? [t.name, ...o] : [t.name, o]) : void 0;
|
|
186
186
|
}
|
|
187
|
-
async function
|
|
188
|
-
var
|
|
189
|
-
const
|
|
190
|
-
return
|
|
187
|
+
async function j(e, a) {
|
|
188
|
+
var l;
|
|
189
|
+
const o = await ((l = f.value) == null ? void 0 : l.validateFields(T(e), a));
|
|
190
|
+
return o == null ? void 0 : o[t.name];
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
var n, r
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
192
|
+
function O(e, a) {
|
|
193
|
+
var s, n, r;
|
|
194
|
+
const o = ((s = u(m)) == null ? void 0 : s.length) || 0;
|
|
195
|
+
if (R(t.maxLength) && o >= t.maxLength)
|
|
196
196
|
return;
|
|
197
|
-
const
|
|
197
|
+
const l = {
|
|
198
198
|
...e || {}
|
|
199
199
|
};
|
|
200
|
-
(
|
|
201
|
-
if (!d[
|
|
202
|
-
d[
|
|
200
|
+
(r = (n = f.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, t.name, l, !0, (d, i) => {
|
|
201
|
+
if (!d[i]) {
|
|
202
|
+
d[i] = [l];
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
|
-
te(a) ? d[
|
|
205
|
+
te(a) ? d[i].push(l) : d[i].splice(a, 0, l);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
208
|
+
function A(e, a = "suffix") {
|
|
209
|
+
var n, r, d;
|
|
210
|
+
const o = ((n = u(m)) == null ? void 0 : n.length) || 0, l = g(e) ? e : e.length;
|
|
211
|
+
if (R(t.maxLength) && o + l > t.maxLength)
|
|
212
212
|
return;
|
|
213
|
-
const
|
|
214
|
-
(d = (
|
|
215
|
-
if (!
|
|
216
|
-
|
|
213
|
+
const s = g(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
|
|
214
|
+
(d = (r = f.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, s, !0, (i, p) => {
|
|
215
|
+
if (!i[p]) {
|
|
216
|
+
i[p] = [...s];
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
a === "suffix" ?
|
|
219
|
+
a === "suffix" ? i[p].push(...s) : i[p].unshift(...s);
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
var
|
|
224
|
-
const a = new Set(
|
|
225
|
-
(
|
|
226
|
-
n
|
|
222
|
+
function z(e) {
|
|
223
|
+
var o, l;
|
|
224
|
+
const a = new Set(g(e) ? [e] : e);
|
|
225
|
+
(l = (o = f.value) == null ? void 0 : o.setFieldValue) == null || l.call(o, t.name, void 0, !0, (s, n) => {
|
|
226
|
+
s[n] = s[n].filter((r, d) => !a.has(d));
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function I() {
|
|
230
230
|
return u(m);
|
|
231
231
|
}
|
|
232
232
|
function P(e) {
|
|
233
233
|
var a;
|
|
234
|
-
(a =
|
|
234
|
+
(a = f.value) == null || a.setFieldValue(t.name, e);
|
|
235
235
|
}
|
|
236
236
|
function H(e) {
|
|
237
237
|
var a;
|
|
238
238
|
return (a = u(m)) == null ? void 0 : a[e];
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
var
|
|
242
|
-
(
|
|
243
|
-
!r
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
240
|
+
function K(e, a, o = !0) {
|
|
241
|
+
var l, s;
|
|
242
|
+
(s = (l = f.value) == null ? void 0 : l.setFieldValue) == null || s.call(l, t.name, void 0, !0, (n, r) => {
|
|
243
|
+
if (!(!n[r] || !n[r][e])) {
|
|
244
|
+
if (!o) {
|
|
245
|
+
const d = Object.keys(n[r][e]);
|
|
246
|
+
for (const i of d)
|
|
247
|
+
i !== t.rowKey && delete n[r][e][i];
|
|
248
|
+
}
|
|
249
|
+
Object.assign(n[r][e], {
|
|
250
|
+
...a
|
|
251
|
+
});
|
|
252
|
+
}
|
|
247
253
|
});
|
|
248
254
|
}
|
|
249
|
-
function
|
|
250
|
-
var
|
|
255
|
+
function W(e) {
|
|
256
|
+
var o;
|
|
251
257
|
const a = e === "end" ? m.value.length - 1 : e;
|
|
252
|
-
(
|
|
258
|
+
(o = C.value) == null || o.scrollToRow(a);
|
|
253
259
|
}
|
|
254
|
-
function
|
|
260
|
+
function G() {
|
|
255
261
|
var e, a;
|
|
256
|
-
(a = (e =
|
|
262
|
+
(a = (e = f.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
|
|
257
263
|
}
|
|
258
264
|
return S({
|
|
259
|
-
resetFields:
|
|
260
|
-
validateFields:
|
|
261
|
-
add:
|
|
262
|
-
remove:
|
|
265
|
+
resetFields: D,
|
|
266
|
+
validateFields: j,
|
|
267
|
+
add: O,
|
|
268
|
+
remove: z,
|
|
263
269
|
getRowData: H,
|
|
264
|
-
getRowsData:
|
|
265
|
-
setRowData:
|
|
266
|
-
addMultiple:
|
|
267
|
-
scrollTo:
|
|
268
|
-
clear:
|
|
270
|
+
getRowsData: I,
|
|
271
|
+
setRowData: K,
|
|
272
|
+
addMultiple: A,
|
|
273
|
+
scrollTo: W,
|
|
274
|
+
clear: G,
|
|
269
275
|
setTableData: P
|
|
270
|
-
}), (e, a) => (J(), q(u(
|
|
276
|
+
}), (e, a) => (J(), q(u(y), {
|
|
271
277
|
ref_key: "formRef",
|
|
272
|
-
ref:
|
|
278
|
+
ref: f,
|
|
273
279
|
"initial-values": {
|
|
274
280
|
[t.name]: u(m)
|
|
275
281
|
},
|
|
@@ -277,22 +283,22 @@ const Re = /* @__PURE__ */ U({
|
|
|
277
283
|
height: "100%"
|
|
278
284
|
}
|
|
279
285
|
}, {
|
|
280
|
-
default: h(() => [v(u(
|
|
286
|
+
default: h(() => [v(u(y).FormItem, {
|
|
281
287
|
name: e.name,
|
|
282
288
|
"no-style": ""
|
|
283
289
|
}, {
|
|
284
|
-
default: h(() => [v(ie, Q(u(
|
|
290
|
+
default: h(() => [v(ie, Q(u(le)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
285
291
|
ref_key: "tableRef",
|
|
286
|
-
ref:
|
|
292
|
+
ref: C,
|
|
287
293
|
class: u(V)(),
|
|
288
|
-
columns: u(
|
|
294
|
+
columns: u(E),
|
|
289
295
|
"data-source": u(m),
|
|
290
296
|
"search-form": !1
|
|
291
297
|
}), X({
|
|
292
298
|
_: 2
|
|
293
|
-
}, [Y(N, (
|
|
294
|
-
name:
|
|
295
|
-
fn: h((
|
|
299
|
+
}, [Y(N, (o, l) => ({
|
|
300
|
+
name: l,
|
|
301
|
+
fn: h((s) => [Z(e.$slots, l, M(ee(s || {})))])
|
|
296
302
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
297
303
|
_: 3
|
|
298
304
|
}, 8, ["name"])]),
|
|
@@ -301,5 +307,5 @@ const Re = /* @__PURE__ */ U({
|
|
|
301
307
|
}
|
|
302
308
|
});
|
|
303
309
|
export {
|
|
304
|
-
|
|
310
|
+
be as default
|
|
305
311
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Empty as
|
|
3
|
-
import { useTablePaging as
|
|
1
|
+
import { defineComponent as X, ref as Y, unref as e, computed as p, watch as Z, createElementBlock as s, openBlock as i, normalizeStyle as v, normalizeClass as l, renderSlot as u, createElementVNode as _, createCommentVNode as I, createVNode as g, Fragment as E, createBlock as O, withCtx as h, renderList as x, mergeProps as ee } from "vue";
|
|
2
|
+
import { Empty as V, Spin as te, Pagination as ae } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useTablePaging as ne } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
5
|
-
import { isUndefined as
|
|
6
|
-
import { useOfflineList as
|
|
5
|
+
import { isUndefined as F, isNumber as re, omit as oe } from "lodash-unified";
|
|
6
|
+
import { useOfflineList as ie } from "./hooks/use-offline-list.mjs";
|
|
7
7
|
import "vue-virtual-scroller/dist/vue-virtual-scroller.css";
|
|
8
|
-
import { RecycleScroller as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
const
|
|
8
|
+
import { RecycleScroller as le, DynamicScroller as se, DynamicScrollerItem as ue } from "vue-virtual-scroller";
|
|
9
|
+
import { useNamespace as ce } from "../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const be = /* @__PURE__ */ X({
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
13
13
|
dataSource: {},
|
|
@@ -24,22 +24,23 @@ const he = /* @__PURE__ */ H({
|
|
|
24
24
|
contentStyle: { type: [Boolean, null, String, Object, Array] },
|
|
25
25
|
footerWarpperStyle: { type: [Boolean, null, String, Object, Array] },
|
|
26
26
|
virtual: { default: void 0 },
|
|
27
|
-
rowKey: {}
|
|
27
|
+
rowKey: {},
|
|
28
|
+
adaptive: { type: Boolean, default: !1 }
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
30
|
+
setup(L, { expose: N }) {
|
|
31
|
+
const R = V.PRESENTED_IMAGE_SIMPLE, n = L, { b: m, e: y, bm: T, m: $ } = ce("ap-list"), b = Y(), {
|
|
31
32
|
formRef: k,
|
|
32
33
|
submit: w,
|
|
33
|
-
reset:
|
|
34
|
-
handleTableChange:
|
|
35
|
-
data:
|
|
36
|
-
refresh:
|
|
37
|
-
refreshByDelete:
|
|
38
|
-
tableProps:
|
|
39
|
-
} =
|
|
40
|
-
async request(
|
|
34
|
+
reset: B,
|
|
35
|
+
handleTableChange: j,
|
|
36
|
+
data: S,
|
|
37
|
+
refresh: q,
|
|
38
|
+
refreshByDelete: A,
|
|
39
|
+
tableProps: D
|
|
40
|
+
} = ne({
|
|
41
|
+
async request(t) {
|
|
41
42
|
var r;
|
|
42
|
-
const a = await ((r = n.request) == null ? void 0 : r.call(n,
|
|
43
|
+
const a = await ((r = n.request) == null ? void 0 : r.call(n, t));
|
|
43
44
|
return {
|
|
44
45
|
data: (a == null ? void 0 : a.data) || [],
|
|
45
46
|
total: (a == null ? void 0 : a.total) || 0
|
|
@@ -50,143 +51,149 @@ const he = /* @__PURE__ */ H({
|
|
|
50
51
|
manual: n.manual,
|
|
51
52
|
pagination: n.pagination,
|
|
52
53
|
formatParams: n.beforeSearchSubmit
|
|
53
|
-
}),
|
|
54
|
-
pagination:
|
|
55
|
-
dataSource:
|
|
56
|
-
onChange:
|
|
57
|
-
} =
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
|
|
54
|
+
}), K = { form: k }, {
|
|
55
|
+
pagination: z,
|
|
56
|
+
dataSource: M,
|
|
57
|
+
onChange: W
|
|
58
|
+
} = ie(n);
|
|
59
|
+
function G(t, a) {
|
|
60
|
+
if (e(f)) {
|
|
61
|
+
W(t, a);
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
{ current:
|
|
64
|
+
j(
|
|
65
|
+
{ current: t, pageSize: a },
|
|
65
66
|
{},
|
|
66
67
|
{},
|
|
67
68
|
{ currentDataSource: [], action: "paginate" }
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
|
-
const
|
|
71
|
-
var
|
|
72
|
-
return n.pagination === !1 || n.virtual ? !1 : ((
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
() =>
|
|
76
|
-
(
|
|
71
|
+
const c = p(() => e(f) ? e(M) : e(S).records), d = p(() => F(n.loading) ? e(S).loading : n.loading), U = p(() => {
|
|
72
|
+
var t, a;
|
|
73
|
+
return n.pagination === !1 || n.virtual ? !1 : ((t = n.pagination) == null ? void 0 : t.hideOnSinglePage) !== !0 ? !0 : e(f) ? (((a = n.dataSource) == null ? void 0 : a.length) || 0) > e(z).pageSize : e(S).total > e(D).pagination.pageSize;
|
|
74
|
+
}), f = p(() => !F(n.dataSource));
|
|
75
|
+
Z(
|
|
76
|
+
() => e(d),
|
|
77
|
+
(t) => {
|
|
77
78
|
var a;
|
|
78
|
-
(a = n.onLoadingChange) == null || a.call(n,
|
|
79
|
+
(a = n.onLoadingChange) == null || a.call(n, t);
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
|
-
function
|
|
82
|
+
function H(t) {
|
|
82
83
|
var a, r;
|
|
83
|
-
(r = (a = b.value) == null ? void 0 : a.querySelector(
|
|
84
|
+
(r = (a = b.value) == null ? void 0 : a.querySelector(t || ":first-child")) == null || r.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function J(t = !1) {
|
|
86
87
|
var o;
|
|
87
|
-
const a = (o = k.value) == null ? void 0 : o.apForm, r =
|
|
88
|
+
const a = (o = k.value) == null ? void 0 : o.apForm, r = t ? a == null ? void 0 : a.getFieldsValueTransformed : a == null ? void 0 : a.getFieldsValue;
|
|
88
89
|
return (r == null ? void 0 : r()) || {};
|
|
89
90
|
}
|
|
90
|
-
return
|
|
91
|
+
return N({
|
|
91
92
|
submit: () => w(),
|
|
92
|
-
reset: () =>
|
|
93
|
-
refresh: () =>
|
|
94
|
-
refreshByDelete: (
|
|
95
|
-
scrollToFirstRow:
|
|
96
|
-
getSearchFormValuesIfSetted:
|
|
97
|
-
}), (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
reset: () => B(),
|
|
94
|
+
refresh: () => q(),
|
|
95
|
+
refreshByDelete: (t) => A(t),
|
|
96
|
+
scrollToFirstRow: H,
|
|
97
|
+
getSearchFormValuesIfSetted: J
|
|
98
|
+
}), (t, a) => (i(), s("div", {
|
|
99
|
+
class: l([e(m)(), { [e($)("adaptive")]: t.adaptive }]),
|
|
100
|
+
style: v(t.containerStyle)
|
|
101
|
+
}, [
|
|
102
|
+
u(t.$slots, "header", {
|
|
103
|
+
formIns: K,
|
|
104
|
+
submit: e(w),
|
|
105
|
+
reset: e(B)
|
|
106
|
+
}),
|
|
107
|
+
_("div", {
|
|
108
|
+
class: l([
|
|
109
|
+
e(m)("content-container"),
|
|
110
|
+
{ [e(T)("content-container", "spinning")]: d.value }
|
|
111
|
+
])
|
|
112
|
+
}, [
|
|
113
|
+
d.value ? (i(), s("div", {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: l(e(y)("spin-wrapper"))
|
|
105
116
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
_: 3
|
|
137
|
-
}, 8, ["class", "items", "item-size", "key-field"])) : (i(), S(t(ie), {
|
|
138
|
-
key: 1,
|
|
139
|
-
items: s.value,
|
|
140
|
-
"min-item-size": e.virtual.minItemSize,
|
|
141
|
-
class: f(t(u)("scroll-wrapper"))
|
|
142
|
-
}, {
|
|
143
|
-
default: d(({ item: r, index: o, active: U }) => {
|
|
144
|
-
var C, P;
|
|
145
|
-
return [
|
|
146
|
-
v(t(le), {
|
|
147
|
-
item: r,
|
|
148
|
-
active: U,
|
|
149
|
-
"data-index": o,
|
|
150
|
-
"size-dependencies": (P = (C = e.virtual).sizeDependencies) == null ? void 0 : P.call(C, r)
|
|
151
|
-
}, {
|
|
152
|
-
default: d(() => [
|
|
153
|
-
l(e.$slots, "renderItem", {
|
|
154
|
-
item: r,
|
|
155
|
-
index: o
|
|
156
|
-
})
|
|
157
|
-
]),
|
|
158
|
-
_: 2
|
|
159
|
-
}, 1032, ["item", "active", "data-index", "size-dependencies"])
|
|
160
|
-
];
|
|
161
|
-
}),
|
|
162
|
-
_: 3
|
|
163
|
-
}, 8, ["items", "min-item-size", "class"]))
|
|
164
|
-
], 64)) : l(e.$slots, "renderContent", {
|
|
117
|
+
g(e(te), { spinning: d.value }, null, 8, ["spinning"])
|
|
118
|
+
], 2)) : I("", !0),
|
|
119
|
+
c.value.length === 0 ? u(t.$slots, "empty", {
|
|
120
|
+
key: 1,
|
|
121
|
+
loading: d.value
|
|
122
|
+
}, () => [
|
|
123
|
+
g(e(V), { image: e(R) }, null, 8, ["image"])
|
|
124
|
+
]) : (i(), s("div", {
|
|
125
|
+
key: 2,
|
|
126
|
+
ref_key: "contentRef",
|
|
127
|
+
ref: b,
|
|
128
|
+
style: v(t.contentStyle),
|
|
129
|
+
class: l(e(y)("content"))
|
|
130
|
+
}, [
|
|
131
|
+
t.virtual ? (i(), s(E, { key: 0 }, [
|
|
132
|
+
e(re)(t.virtual) ? (i(), O(e(le), {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: l(e(m)("scroll-wrapper")),
|
|
135
|
+
items: c.value,
|
|
136
|
+
"item-size": t.virtual,
|
|
137
|
+
"key-field": n.rowKey || "id"
|
|
138
|
+
}, {
|
|
139
|
+
default: h(({ item: r, index: o }) => [
|
|
140
|
+
u(t.$slots, "renderItem", {
|
|
141
|
+
item: r,
|
|
142
|
+
index: o
|
|
143
|
+
})
|
|
144
|
+
]),
|
|
145
|
+
_: 3
|
|
146
|
+
}, 8, ["class", "items", "item-size", "key-field"])) : (i(), O(e(se), {
|
|
165
147
|
key: 1,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
148
|
+
items: c.value,
|
|
149
|
+
"min-item-size": t.virtual.minItemSize,
|
|
150
|
+
class: l(e(m)("scroll-wrapper"))
|
|
151
|
+
}, {
|
|
152
|
+
default: h(({ item: r, index: o, active: Q }) => {
|
|
153
|
+
var C, P;
|
|
154
|
+
return [
|
|
155
|
+
g(e(ue), {
|
|
156
|
+
item: r,
|
|
157
|
+
active: Q,
|
|
158
|
+
"data-index": o,
|
|
159
|
+
"size-dependencies": (P = (C = t.virtual).sizeDependencies) == null ? void 0 : P.call(C, r)
|
|
160
|
+
}, {
|
|
161
|
+
default: h(() => [
|
|
162
|
+
u(t.$slots, "renderItem", {
|
|
163
|
+
item: r,
|
|
164
|
+
index: o
|
|
165
|
+
})
|
|
166
|
+
]),
|
|
167
|
+
_: 2
|
|
168
|
+
}, 1032, ["item", "active", "data-index", "size-dependencies"])
|
|
169
|
+
];
|
|
170
|
+
}),
|
|
171
|
+
_: 3
|
|
172
|
+
}, 8, ["items", "min-item-size", "class"]))
|
|
173
|
+
], 64)) : u(t.$slots, "renderContent", {
|
|
174
|
+
key: 1,
|
|
175
|
+
dataSource: c.value
|
|
176
|
+
}, () => [
|
|
177
|
+
(i(!0), s(E, null, x(c.value, (r, o) => u(t.$slots, "renderItem", {
|
|
178
|
+
item: r,
|
|
179
|
+
index: o
|
|
180
|
+
})), 256))
|
|
181
|
+
])
|
|
182
|
+
], 6))
|
|
183
|
+
], 2),
|
|
184
|
+
U.value ? (i(), s("div", {
|
|
185
|
+
key: 0,
|
|
186
|
+
class: l(e(y)("footer")),
|
|
187
|
+
style: v(t.footerWarpperStyle)
|
|
188
|
+
}, [
|
|
189
|
+
g(e(ae), ee(
|
|
190
|
+
f.value ? e(z) : e(oe)(e(D).pagination, ["showTotal"]),
|
|
191
|
+
{ onChange: G }
|
|
192
|
+
), null, 16)
|
|
193
|
+
], 6)) : I("", !0)
|
|
194
|
+
], 6));
|
|
188
195
|
}
|
|
189
196
|
});
|
|
190
197
|
export {
|
|
191
|
-
|
|
198
|
+
be as default
|
|
192
199
|
};
|
|
@@ -27,16 +27,16 @@ const Ae = ({
|
|
|
27
27
|
request: f,
|
|
28
28
|
defaultParams: L = {},
|
|
29
29
|
defaultData: v = [],
|
|
30
|
-
formatParams:
|
|
31
|
-
paramsValueTypeMap:
|
|
32
|
-
resetFieldsIgnores:
|
|
30
|
+
formatParams: O,
|
|
31
|
+
paramsValueTypeMap: R,
|
|
32
|
+
resetFieldsIgnores: y,
|
|
33
33
|
filterFields: J,
|
|
34
34
|
sortFields: K,
|
|
35
35
|
namespace: M = "ap-table",
|
|
36
36
|
pagination: S
|
|
37
37
|
}) => {
|
|
38
38
|
let b = 0, i = {};
|
|
39
|
-
const Q = Se(S), $ = (e) =>
|
|
39
|
+
const Q = Se(S), $ = (e) => O ? O(e) : e, z = ae(), c = j(ze(S)), {
|
|
40
40
|
getColumnSFConfig: G,
|
|
41
41
|
setSF: W,
|
|
42
42
|
clearAll: Z,
|
|
@@ -46,7 +46,7 @@ const Ae = ({
|
|
|
46
46
|
t: T
|
|
47
47
|
} = me(), {
|
|
48
48
|
b: P
|
|
49
|
-
} = he(M),
|
|
49
|
+
} = he(M), o = j({
|
|
50
50
|
total: v.length,
|
|
51
51
|
records: v,
|
|
52
52
|
loading: !1
|
|
@@ -56,32 +56,30 @@ const Ae = ({
|
|
|
56
56
|
}, I = async (e) => {
|
|
57
57
|
var r;
|
|
58
58
|
const t = $(e), n = Date.now();
|
|
59
|
-
b = n,
|
|
59
|
+
b = n, o.loading = !0;
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
61
|
+
const a = await f({
|
|
62
62
|
...m(L),
|
|
63
63
|
...t
|
|
64
64
|
});
|
|
65
|
-
b === n && (
|
|
65
|
+
b === n && (o.total = a.total || ((r = a.data) == null ? void 0 : r.length) || 0, o.records = [...a.data || []], o.loading = !1);
|
|
66
66
|
} catch {
|
|
67
|
-
b === n && (
|
|
68
|
-
} finally {
|
|
69
|
-
a.loading = !1;
|
|
67
|
+
b === n && (o.records = [], o.total = 0, o.loading = !1);
|
|
70
68
|
}
|
|
71
69
|
}, V = (e) => {
|
|
72
70
|
const t = {};
|
|
73
71
|
return Object.entries(e).forEach(([n, r]) => {
|
|
74
|
-
if (t[n] = r,
|
|
75
|
-
const
|
|
76
|
-
|
|
72
|
+
if (t[n] = r, R && r) {
|
|
73
|
+
const a = R[n];
|
|
74
|
+
a && (t[n] = le(a, r));
|
|
77
75
|
}
|
|
78
76
|
}), t;
|
|
79
77
|
}, Y = async (e) => {
|
|
80
|
-
var r,
|
|
78
|
+
var r, a, l, g, d;
|
|
81
79
|
const t = w(), n = {};
|
|
82
80
|
Object.entries(t).forEach(([p, F]) => {
|
|
83
|
-
|
|
84
|
-
}), await ((
|
|
81
|
+
y && y.indexOf(p) > -1 && (n[p] = F);
|
|
82
|
+
}), await ((a = (r = z.value) == null ? void 0 : r.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, n), se(() => {
|
|
85
83
|
e == null || e();
|
|
86
84
|
});
|
|
87
85
|
}, C = (e) => {
|
|
@@ -113,7 +111,7 @@ const Ae = ({
|
|
|
113
111
|
const {
|
|
114
112
|
current: t,
|
|
115
113
|
pageSize: n
|
|
116
|
-
} = c, r =
|
|
114
|
+
} = c, r = o.total - e, a = Math.ceil(r / n), l = t > a ? a : t;
|
|
117
115
|
k({
|
|
118
116
|
current: l > 0 ? l : 1
|
|
119
117
|
});
|
|
@@ -122,8 +120,8 @@ const Ae = ({
|
|
|
122
120
|
var p, F;
|
|
123
121
|
const r = w();
|
|
124
122
|
c.current = e.current, c.pageSize = e.pageSize, W(t, n);
|
|
125
|
-
const
|
|
126
|
-
for (const u of
|
|
123
|
+
const a = q(n) ? [...n] : [n], l = {};
|
|
124
|
+
for (const u of a)
|
|
127
125
|
(p = m(K)) != null && p.includes(u.columnKey || u.field) && u.order && (l[fe(u.columnKey || u.field)] = u.order);
|
|
128
126
|
const g = {};
|
|
129
127
|
for (const u of Object.keys(t))
|
|
@@ -158,16 +156,16 @@ const Ae = ({
|
|
|
158
156
|
deep: !0
|
|
159
157
|
});
|
|
160
158
|
const ne = A(() => {
|
|
161
|
-
if (
|
|
159
|
+
if (o.total === 0)
|
|
162
160
|
return "-";
|
|
163
161
|
const {
|
|
164
162
|
current: e,
|
|
165
163
|
pageSize: t
|
|
166
164
|
} = c;
|
|
167
|
-
return `${e}/${Math.ceil(
|
|
165
|
+
return `${e}/${Math.ceil(o.total / t)}`;
|
|
168
166
|
});
|
|
169
167
|
function re(e) {
|
|
170
|
-
q(e) && (
|
|
168
|
+
q(e) && (o.records = e, o.total = e.length);
|
|
171
169
|
}
|
|
172
170
|
const oe = A(() => {
|
|
173
171
|
const {
|
|
@@ -175,19 +173,19 @@ const Ae = ({
|
|
|
175
173
|
showTotal: t,
|
|
176
174
|
showQuickJumper: n,
|
|
177
175
|
showSizeChanger: r,
|
|
178
|
-
pageSizeOptions:
|
|
176
|
+
pageSizeOptions: a
|
|
179
177
|
} = Q;
|
|
180
178
|
return {
|
|
181
|
-
loading:
|
|
179
|
+
loading: o.loading,
|
|
182
180
|
pagination: {
|
|
183
181
|
current: c.current,
|
|
184
182
|
pageSize: c.pageSize,
|
|
185
|
-
total:
|
|
183
|
+
total: o.total,
|
|
186
184
|
showSizeChanger: N(r) ? r : !e,
|
|
187
185
|
showQuickJumper: N(n) ? n : !e,
|
|
188
186
|
showLessItems: e,
|
|
189
187
|
size: "default",
|
|
190
|
-
pageSizeOptions: pe(
|
|
188
|
+
pageSizeOptions: pe(a) ? ["10", "20", "50", "100"] : a,
|
|
191
189
|
showTotal: t ? (l) => x("span", {
|
|
192
190
|
class: P("pagination-total-wrapper")
|
|
193
191
|
}, [T("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
|
|
@@ -199,7 +197,7 @@ const Ae = ({
|
|
|
199
197
|
}, [m(ne)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
200
198
|
},
|
|
201
199
|
onChange: _,
|
|
202
|
-
dataSource:
|
|
200
|
+
dataSource: o.records
|
|
203
201
|
};
|
|
204
202
|
});
|
|
205
203
|
return {
|
|
@@ -208,12 +206,12 @@ const Ae = ({
|
|
|
208
206
|
reset: ee,
|
|
209
207
|
refresh: U,
|
|
210
208
|
refreshByDelete: te,
|
|
211
|
-
data:
|
|
209
|
+
data: o,
|
|
212
210
|
current: c.current,
|
|
213
211
|
pageSize: c.pageSize,
|
|
214
212
|
handleTableChange: _,
|
|
215
213
|
tableProps: oe,
|
|
216
|
-
dataSource: A(() =>
|
|
214
|
+
dataSource: A(() => o.records),
|
|
217
215
|
setDataSource: re,
|
|
218
216
|
getColumnSFConfig: G,
|
|
219
217
|
sortedInfo: H,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),g=require("../../ap-form/index.js"),i=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),g=require("../../ap-form/index.js"),i=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const E=require("../../ap-form/context.js"),O=require("../../config-provider/hooks/use-namespace.js"),P=require("../../config-provider/hooks/use-global-config.js"),z=require("../index.vue.js"),A=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(C,{expose:y}){const b=o.useSlots(),n=C,{b:w}=O.useNamespace("editable-grid");function x(e,t){return i.isArray(t)?t.reduce((u,l)=>u==null?void 0:u[l],e):e==null?void 0:e[t]}const{internalInstance:a,model:R}=E.useInjectForm(),p=o.toRef(n.name),d=o.ref(x(o.unref(R),p.value)||[]),S=g.ApForm.useWatch(p);o.watch(()=>S.value,async e=>{var t;await o.nextTick(),d.value=e,(t=n.onChange)==null||t.call(n,e)},{deep:!0});const m=o.ref(),B=P.useGlobalConfig("valueTypeMap"),v=j.useGetEditableColumns(n,B);function N(e,t){var s;const u=((s=o.unref(d))==null?void 0:s.length)||0;if(h.isDef(n.maxLength)&&u>=n.maxLength)return;const l={...e||{}};a==null||a.setFieldValue(n.name,l,!0,(f,r)=>{if(!f[r]){f[r]=[l];return}i.isUndefined(t)?f[r].push(l):f[r].splice(t,0,l)})}function _(e,t="suffix"){var f;const u=((f=o.unref(d))==null?void 0:f.length)||0,l=i.isNumber(e)?e:e.length;if(h.isDef(n.maxLength)&&u+l>n.maxLength)return;const s=i.isNumber(e)?new Array(e).fill(0).map(()=>({})):i.cloneDeep(e);a==null||a.setFieldValue(n.name,s,!0,(r,c)=>{if(!r[c]){r[c]=[...s];return}t==="suffix"?r[c].push(...s):r[c].unshift(...s)})}function F(e){const t=new Set(i.isNumber(e)?[e]:e);a==null||a.setFieldValue(n.name,void 0,!0,(u,l)=>{u[l]=u[l].filter((s,f)=>!t.has(f))})}function q(){return o.unref(d)}function D(e){var t;return(t=o.unref(d))==null?void 0:t[e]}function k(e,t,u=!0){a==null||a.setFieldValue(n.name,void 0,!0,(l,s)=>{if(!(!l[s]||!l[s][e])){if(!u){const f=Object.keys(l[s][e]);for(const r of f)r!==n.rowKey&&delete l[s][e][r]}Object.assign(l[s][e],{...t})}})}function L(e){a==null||a.setFieldValue(n.name,e)}function T(e){var u;const t=e==="end"?d.value.length-1:e;(u=m.value)==null||u.scrollToRow(t)}function V(){var e;(e=a==null?void 0:a.setFieldValue)==null||e.call(a,n.name,[])}return y({add:N,remove:F,getRowData:D,getRowsData:q,setRowData:k,addMultiple:_,scrollTo:T,setTableData:L,clear:V}),(e,t)=>(o.openBlock(),o.createBlock(o.unref(g.ApForm).FormItem,o.mergeProps(e.formItem,{name:e.name,label:e.label}),{default:o.withCtx(()=>[o.createVNode(z.default,o.mergeProps(o.unref(i.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:m,class:o.unref(w)(),columns:o.unref(v),"data-source":d.value,"search-form":!1}),o.createSlots({_:2},[o.renderList(b,(u,l)=>({name:l,fn:o.withCtx(s=>[o.renderSlot(e.$slots,l,o.normalizeProps(o.guardReactiveProps(s||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const C=require("../../utils/index.js"),z=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const I=require("../../config-provider/hooks/use-namespace.js"),G=require("../../hooks/useControllableValue.js"),H=require("../../config-provider/hooks/use-global-config.js"),K=require("../index.vue.js"),U=t.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(w,{expose:v,emit:x}){const b=t.useSlots(),n=w,{b:R}=I.useNamespace("editable-grid"),S=x,y=t.ref(),{value:p,updateValue:F}=G.useControllableValue(n,S),f=t.ref(),B=H.useGlobalConfig("valueTypeMap"),h=g.ApForm.useWatch(n.name,f);t.watch(()=>h.value,e=>{var a;F(e),(a=n.onChange)==null||a.call(n,e)},{deep:!0,flush:"post"}),t.watch(p,e=>{var a;e!==t.unref(h)&&(c.isEqual(e,t.unref(h))||(a=f.value)==null||a.setFieldValue(n.name,e))},{deep:!0});const _=z.useGetEditableColumns(n,B);function N(){var e;(e=f.value)==null||e.resetFields()}function V(e){return e?(c.isArray(e)?e:[e]).map(l=>c.isArray(l)?[n.name,...l]:[n.name,l]):void 0}async function q(e,a){var o;const l=await((o=f.value)==null?void 0:o.validateFields(V(e),a));return l==null?void 0:l[n.name]}function k(e,a){var r,u,s;const l=((r=t.unref(p))==null?void 0:r.length)||0;if(C.isDef(n.maxLength)&&l>=n.maxLength)return;const o={...e||{}};(s=(u=f.value)==null?void 0:u.setFieldValue)==null||s.call(u,n.name,o,!0,(d,i)=>{if(!d[i]){d[i]=[o];return}c.isUndefined(a)?d[i].push(o):d[i].splice(a,0,o)})}function E(e,a="suffix"){var u,s,d;const l=((u=t.unref(p))==null?void 0:u.length)||0,o=c.isNumber(e)?e:e.length;if(C.isDef(n.maxLength)&&l+o>n.maxLength)return;const r=c.isNumber(e)?new Array(e).fill(0).map(()=>({})):c.cloneDeep(e);(d=(s=f.value)==null?void 0:s.setFieldValue)==null||d.call(s,n.name,r,!0,(i,m)=>{if(!i[m]){i[m]=[...r];return}a==="suffix"?i[m].push(...r):i[m].unshift(...r)})}function L(e){var l,o;const a=new Set(c.isNumber(e)?[e]:e);(o=(l=f.value)==null?void 0:l.setFieldValue)==null||o.call(l,n.name,void 0,!0,(r,u)=>{r[u]=r[u].filter((s,d)=>!a.has(d))})}function A(){return t.unref(p)}function D(e){var a;(a=f.value)==null||a.setFieldValue(n.name,e)}function T(e){var a;return(a=t.unref(p))==null?void 0:a[e]}function j(e,a,l=!0){var o,r;(r=(o=f.value)==null?void 0:o.setFieldValue)==null||r.call(o,n.name,void 0,!0,(u,s)=>{if(!(!u[s]||!u[s][e])){if(!l){const d=Object.keys(u[s][e]);for(const i of d)i!==n.rowKey&&delete u[s][e][i]}Object.assign(u[s][e],{...a})}})}function O(e){var l;const a=e==="end"?p.value.length-1:e;(l=y.value)==null||l.scrollToRow(a)}function P(){var e,a;(a=(e=f.value)==null?void 0:e.setFieldValue)==null||a.call(e,n.name,[])}return v({resetFields:N,validateFields:q,add:k,remove:L,getRowData:T,getRowsData:A,setRowData:j,addMultiple:E,scrollTo:O,clear:P,setTableData:D}),(e,a)=>(t.openBlock(),t.createBlock(t.unref(g.ApForm),{ref_key:"formRef",ref:f,"initial-values":{[n.name]:t.unref(p)},style:{height:"100%"}},{default:t.withCtx(()=>[t.createVNode(t.unref(g.ApForm).FormItem,{name:e.name,"no-style":""},{default:t.withCtx(()=>[t.createVNode(K.default,t.mergeProps(t.unref(c.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:y,class:t.unref(R)(),columns:t.unref(_),"data-source":t.unref(p),"search-form":!1}),t.createSlots({_:2},[t.renderList(b,(l,o)=>({name:o,fn:t.withCtx(r=>[t.renderSlot(e.$slots,o,t.normalizeProps(t.guardReactiveProps(r||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=U;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),j=require("../ap-table/hooks/use-table-paging-ng.js");require("../config-provider/index.js");const d=require("lodash-unified"),A=require("./hooks/use-offline-list.js");require("vue-virtual-scroller/dist/vue-virtual-scroller.css");const p=require("vue-virtual-scroller"),M=require("../config-provider/hooks/use-namespace.js"),U=e.defineComponent({__name:"index",props:{dataSource:{},loading:{type:Boolean,default:void 0},onItem:{},params:{},request:{},defaultData:{},onLoadingChange:{},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},manual:{type:Boolean},containerStyle:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},footerWarpperStyle:{type:[Boolean,null,String,Object,Array]},virtual:{default:void 0},rowKey:{},adaptive:{type:Boolean,default:!1}},setup(C,{expose:z}){const w=c.Empty.PRESENTED_IMAGE_SIMPLE,a=C,{b:u,e:f,bm:E,m:q}=M.useNamespace("ap-list"),g=e.ref(),{formRef:y,submit:S,reset:v,handleTableChange:P,data:m,refresh:D,refreshByDelete:N,tableProps:h}=j.useTablePaging({async request(n){var r;const t=await((r=a.request)==null?void 0:r.call(a,n));return{data:(t==null?void 0:t.data)||[],total:(t==null?void 0:t.total)||0}},defaultParams:a.params,defaultData:a.defaultData,manual:a.manual,pagination:a.pagination,formatParams:a.beforeSearchSubmit}),V={form:y},{pagination:k,dataSource:I,onChange:O}=A.useOfflineList(a);function T(n,t){if(e.unref(s)){O(n,t);return}P({current:n,pageSize:t},{},{},{currentDataSource:[],action:"paginate"})}const l=e.computed(()=>e.unref(s)?e.unref(I):e.unref(m).records),i=e.computed(()=>d.isUndefined(a.loading)?e.unref(m).loading:a.loading),F=e.computed(()=>{var n,t;return a.pagination===!1||a.virtual?!1:((n=a.pagination)==null?void 0:n.hideOnSinglePage)!==!0?!0:e.unref(s)?(((t=a.dataSource)==null?void 0:t.length)||0)>e.unref(k).pageSize:e.unref(m).total>e.unref(h).pagination.pageSize}),s=e.computed(()=>!d.isUndefined(a.dataSource));e.watch(()=>e.unref(i),n=>{var t;(t=a.onLoadingChange)==null||t.call(a,n)});function L(n){var t,r;(r=(t=g.value)==null?void 0:t.querySelector(n||":first-child"))==null||r.scrollIntoView({behavior:"smooth",block:"center"})}function R(n=!1){var o;const t=(o=y.value)==null?void 0:o.apForm,r=n?t==null?void 0:t.getFieldsValueTransformed:t==null?void 0:t.getFieldsValue;return(r==null?void 0:r())||{}}return z({submit:()=>S(),reset:()=>v(),refresh:()=>D(),refreshByDelete:n=>N(n),scrollToFirstRow:L,getSearchFormValuesIfSetted:R}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(u)(),{[e.unref(q)("adaptive")]:n.adaptive}]),style:e.normalizeStyle(n.containerStyle)},[e.renderSlot(n.$slots,"header",{formIns:V,submit:e.unref(S),reset:e.unref(v)}),e.createElementVNode("div",{class:e.normalizeClass([e.unref(u)("content-container"),{[e.unref(E)("content-container","spinning")]:i.value}])},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("spin-wrapper"))},[e.createVNode(e.unref(c.Spin),{spinning:i.value},null,8,["spinning"])],2)):e.createCommentVNode("",!0),l.value.length===0?e.renderSlot(n.$slots,"empty",{key:1,loading:i.value},()=>[e.createVNode(e.unref(c.Empty),{image:e.unref(w)},null,8,["image"])]):(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"contentRef",ref:g,style:e.normalizeStyle(n.contentStyle),class:e.normalizeClass(e.unref(f)("content"))},[n.virtual?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(d.isNumber)(n.virtual)?(e.openBlock(),e.createBlock(e.unref(p.RecycleScroller),{key:0,class:e.normalizeClass(e.unref(u)("scroll-wrapper")),items:l.value,"item-size":n.virtual,"key-field":a.rowKey||"id"},{default:e.withCtx(({item:r,index:o})=>[e.renderSlot(n.$slots,"renderItem",{item:r,index:o})]),_:3},8,["class","items","item-size","key-field"])):(e.openBlock(),e.createBlock(e.unref(p.DynamicScroller),{key:1,items:l.value,"min-item-size":n.virtual.minItemSize,class:e.normalizeClass(e.unref(u)("scroll-wrapper"))},{default:e.withCtx(({item:r,index:o,active:$})=>{var B,b;return[e.createVNode(e.unref(p.DynamicScrollerItem),{item:r,active:$,"data-index":o,"size-dependencies":(b=(B=n.virtual).sizeDependencies)==null?void 0:b.call(B,r)},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"renderItem",{item:r,index:o})]),_:2},1032,["item","active","data-index","size-dependencies"])]}),_:3},8,["items","min-item-size","class"]))],64)):e.renderSlot(n.$slots,"renderContent",{key:1,dataSource:l.value},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,o)=>e.renderSlot(n.$slots,"renderItem",{item:r,index:o})),256))])],6))],2),F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("footer")),style:e.normalizeStyle(n.footerWarpperStyle)},[e.createVNode(e.unref(c.Pagination),e.mergeProps(s.value?e.unref(k):e.unref(d.omit)(e.unref(h).pagination,["showTotal"]),{onChange:T}),null,16)],6)):e.createCommentVNode("",!0)],6))}});exports.default=U;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),E=require("lodash-unified"),_=require("../../utils/index.js"),ae=require("../../config-provider/hooks/use-locale.js"),oe=require("../../config-provider/hooks/use-namespace.js"),p=1,b=10,I={defaultCurrent:p,defaultPageSize:b,showLessItems:!1,showTotal:!0};function se(i){return i===!1?{}:i==null||i===!0?I:{...I,...i}}function ie(i){const d={};return i===!1||(i===!0||i==null?(d.current=p,d.pageSize=b):(d.current=i.defaultCurrent||p,d.pageSize=i.defaultPageSize||b)),d}const ce=({manual:i=!1,request:d,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:j,sortFields:M,namespace:B="ap-table",pagination:m})=>{let q=0,c={};const G=se(m),J=e=>v?v(e):e,T=a.ref(),u=a.reactive(ie(m)),{getColumnSFConfig:K,setSF:Q,clearAll:Z,sortedInfo:$,filteredInfo:W}=re.useTableSortedAndFiltered(),{t:z}=ae.useLocale(),{b:P}=oe.useNamespace(B),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),E=require("lodash-unified"),_=require("../../utils/index.js"),ae=require("../../config-provider/hooks/use-locale.js"),oe=require("../../config-provider/hooks/use-namespace.js"),p=1,b=10,I={defaultCurrent:p,defaultPageSize:b,showLessItems:!1,showTotal:!0};function se(i){return i===!1?{}:i==null||i===!0?I:{...I,...i}}function ie(i){const d={};return i===!1||(i===!0||i==null?(d.current=p,d.pageSize=b):(d.current=i.defaultCurrent||p,d.pageSize=i.defaultPageSize||b)),d}const ce=({manual:i=!1,request:d,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:j,sortFields:M,namespace:B="ap-table",pagination:m})=>{let q=0,c={};const G=se(m),J=e=>v?v(e):e,T=a.ref(),u=a.reactive(ie(m)),{getColumnSFConfig:K,setSF:Q,clearAll:Z,sortedInfo:$,filteredInfo:W}=re.useTableSortedAndFiltered(),{t:z}=ae.useLocale(),{b:P}=oe.useNamespace(B),o=a.reactive({total:L.length,records:L,loading:!1}),F=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},R=async e=>{var r;const t=J(e),n=Date.now();q=n,o.loading=!0;try{const s=await d({...a.unref(D),...t});q===n&&(o.total=s.total||((r=s.data)==null?void 0:r.length)||0,o.records=[...s.data||[]],o.loading=!1)}catch{q===n&&(o.records=[],o.total=0,o.loading=!1)}},U=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,y&&r){const s=y[n];s&&(t[n]=A.parseFieldValue(s,r))}}),t},H=async e=>{var r,s,f,g,S;const t=F(),n={};Object.entries(t).forEach(([h,w])=>{N&&N.indexOf(h)>-1&&(n[h]=w)}),await((s=(r=T.value)==null?void 0:r.apForm)==null?void 0:s.resetFields()),(S=(g=(f=T.value)==null?void 0:f.apForm)==null?void 0:g.setFieldsValue)==null||S.call(g,n),a.nextTick(()=>{e==null||e()})},C=e=>{c=e;const t=U(e);R(t)},X=e=>{C({...c,...e})},x=()=>{const e=F(),t=m!==!1;t&&(u.current=p),C({...e,filter:c.filter,sort:c.sort,current:t?p:void 0,pageSize:t?c.pageSize||u.pageSize:void 0})},Y=()=>{Z(),c.sort={},c.filter={},H(x)},V=()=>{C(c)},k=e=>{if(m===!1)V();else{const{current:t,pageSize:n}=u,r=o.total-e,s=Math.ceil(r/n),f=t>s?s:t;X({current:f>0?f:1})}},O=(e,t,n)=>{var h,w;const r=F();u.current=e.current,u.pageSize=e.pageSize,Q(t,n);const s=E.isArray(n)?[...n]:[n],f={};for(const l of s)(h=a.unref(M))!=null&&h.includes(l.columnKey||l.field)&&l.order&&(f[A.dataIndexToStr(l.columnKey||l.field)]=l.order);const g={};for(const l of Object.keys(t))(w=a.unref(j))!=null&&w.includes(l)&&t[l]&&(g[l]=t[l]);const S={...r,filter:g,sort:f,current:e.current,pageSize:e.pageSize};E.isEqualWith(c,S,A.isEqualCustom)||C(S)};a.onMounted(()=>{const e=F(),{current:t,pageSize:n}=u;if(c={current:t,pageSize:n,filter:{},sort:{},...e},!i){const r=U(c);R(r)}}),a.watch(()=>a.unref(D),()=>{x()},{deep:!0});const ee=a.computed(()=>{if(o.total===0)return"-";const{current:e,pageSize:t}=u;return`${e}/${Math.ceil(o.total/t)}`});function te(e){E.isArray(e)&&(o.records=e,o.total=e.length)}const ne=a.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:n,showSizeChanger:r,pageSizeOptions:s}=G;return{loading:o.loading,pagination:{current:u.current,pageSize:u.pageSize,total:o.total,showSizeChanger:_.isDef(r)?r:!e,showQuickJumper:_.isDef(n)?n:!e,showLessItems:e,size:"default",pageSizeOptions:E.isUndefined(s)?["10","20","50","100"]:s,showTotal:t?f=>a.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[f])," ",z("ap.apTable.pagination.totalLeftSuffix"),a.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[a.unref(ee)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:o.records}});return{formRef:T,submit:x,reset:Y,refresh:V,refreshByDelete:k,data:o,current:u.current,pageSize:u.pageSize,handleTableChange:O,tableProps:ne,dataSource:a.computed(()=>o.records),setDataSource:te,getColumnSFConfig:K,sortedInfo:$,filteredInfo:W}};exports.DEFAULT_CURRENT=p;exports.DEFAULT_PAGE_SIZE=b;exports.useTablePaging=ce;
|
package/package.json
CHANGED
package/theme/ap-list/index.css
CHANGED
|
@@ -1,14 +1,48 @@
|
|
|
1
|
-
.aplus-ap-list {
|
|
2
|
-
|
|
1
|
+
.aplus-ap-list-content-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.aplus-ap-list-content-container--spinning {
|
|
5
|
+
opacity: 0.5;
|
|
6
|
+
-webkit-user-select: none;
|
|
7
|
+
-moz-user-select: none;
|
|
8
|
+
user-select: none;
|
|
9
|
+
pointer-events: none;
|
|
3
10
|
}
|
|
4
11
|
.aplus-ap-list__footer {
|
|
5
12
|
margin-top: 16px;
|
|
6
13
|
display: flex;
|
|
7
14
|
justify-content: flex-end;
|
|
8
15
|
}
|
|
9
|
-
.aplus-ap-
|
|
10
|
-
|
|
16
|
+
.aplus-ap-list__spin-wrapper {
|
|
17
|
+
position: absolute;
|
|
18
|
+
width: 100%;
|
|
19
|
+
top: 0;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
z-index: 1;
|
|
11
26
|
}
|
|
12
27
|
.aplus-ap-list-scroll-wrapper {
|
|
13
28
|
height: 100%;
|
|
14
29
|
}
|
|
30
|
+
.aplus-ap-list--adaptive {
|
|
31
|
+
height: 100%;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
}
|
|
35
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container {
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
flex-shrink: 1;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container:has(.ant-empty) {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container .aplus-ap-list__content {
|
|
46
|
+
height: 100%;
|
|
47
|
+
overflow: auto;
|
|
48
|
+
}
|
package/theme/ap-list/index.less
CHANGED
|
@@ -1,16 +1,54 @@
|
|
|
1
1
|
@import '../mixins/mixins.less';
|
|
2
2
|
|
|
3
|
+
@listCls: ~'@{ns}-ap-list';
|
|
4
|
+
@listContentContainerCls: ~'@{listCls}-content-container';
|
|
5
|
+
@contentCls: ~'@{listCls}__content';
|
|
6
|
+
|
|
3
7
|
.b(ap-list, {
|
|
4
|
-
|
|
8
|
+
&-content-container {
|
|
9
|
+
position: relative;
|
|
10
|
+
&--spinning {
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
user-select: none;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
5
16
|
&__footer {
|
|
6
17
|
margin-top: 16px;
|
|
7
18
|
display: flex;
|
|
8
19
|
justify-content: flex-end;
|
|
9
20
|
}
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
&__spin-wrapper {
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 100%;
|
|
24
|
+
top: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
z-index: 1;
|
|
12
31
|
}
|
|
13
32
|
&-scroll-wrapper {
|
|
14
33
|
height: 100%;
|
|
15
34
|
}
|
|
35
|
+
&--adaptive {
|
|
36
|
+
height: 100%;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
.@{listContentContainerCls} {
|
|
40
|
+
flex-grow: 1;
|
|
41
|
+
flex-shrink: 1;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
&:has(.ant-empty) {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
.@{contentCls} {
|
|
49
|
+
height: 100%;
|
|
50
|
+
overflow: auto;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
16
54
|
});
|
package/theme/index.css
CHANGED
|
@@ -863,20 +863,54 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
863
863
|
.aplus-ap-info-layout-admin__sticky_box-bordered {
|
|
864
864
|
border-bottom: 1px solid #e9e9e9;
|
|
865
865
|
}
|
|
866
|
-
.aplus-ap-list {
|
|
867
|
-
|
|
866
|
+
.aplus-ap-list-content-container {
|
|
867
|
+
position: relative;
|
|
868
|
+
}
|
|
869
|
+
.aplus-ap-list-content-container--spinning {
|
|
870
|
+
opacity: 0.5;
|
|
871
|
+
-webkit-user-select: none;
|
|
872
|
+
-moz-user-select: none;
|
|
873
|
+
user-select: none;
|
|
874
|
+
pointer-events: none;
|
|
868
875
|
}
|
|
869
876
|
.aplus-ap-list__footer {
|
|
870
877
|
margin-top: 16px;
|
|
871
878
|
display: flex;
|
|
872
879
|
justify-content: flex-end;
|
|
873
880
|
}
|
|
874
|
-
.aplus-ap-
|
|
875
|
-
|
|
881
|
+
.aplus-ap-list__spin-wrapper {
|
|
882
|
+
position: absolute;
|
|
883
|
+
width: 100%;
|
|
884
|
+
top: 0;
|
|
885
|
+
bottom: 0;
|
|
886
|
+
border-radius: 4px;
|
|
887
|
+
display: flex;
|
|
888
|
+
justify-content: center;
|
|
889
|
+
align-items: center;
|
|
890
|
+
z-index: 1;
|
|
876
891
|
}
|
|
877
892
|
.aplus-ap-list-scroll-wrapper {
|
|
878
893
|
height: 100%;
|
|
879
894
|
}
|
|
895
|
+
.aplus-ap-list--adaptive {
|
|
896
|
+
height: 100%;
|
|
897
|
+
display: flex;
|
|
898
|
+
flex-direction: column;
|
|
899
|
+
}
|
|
900
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container {
|
|
901
|
+
flex-grow: 1;
|
|
902
|
+
flex-shrink: 1;
|
|
903
|
+
overflow: hidden;
|
|
904
|
+
}
|
|
905
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container:has(.ant-empty) {
|
|
906
|
+
display: flex;
|
|
907
|
+
justify-content: center;
|
|
908
|
+
align-items: center;
|
|
909
|
+
}
|
|
910
|
+
.aplus-ap-list--adaptive .aplus-ap-list-content-container .aplus-ap-list__content {
|
|
911
|
+
height: 100%;
|
|
912
|
+
overflow: auto;
|
|
913
|
+
}
|
|
880
914
|
.aplus-ap-select-layout {
|
|
881
915
|
display: flex;
|
|
882
916
|
height: 100%;
|