@aplus-frontend/ui 6.32.0 → 6.34.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/index.mjs +39 -37
- 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/editable/form-item.vue.d.ts +16 -0
- package/es/src/ag-grid/editable/form-item.vue.mjs +215 -0
- package/es/src/ag-grid/editable/form-item.vue2.mjs +4 -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-editable-api.mjs +39 -39
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +174 -0
- package/es/src/ag-grid/index.d.ts +2 -1
- package/es/src/ag-grid/index.mjs +1 -0
- package/es/src/ag-grid/index.vue.mjs +109 -111
- package/es/src/ap-download/ap-download.vue.mjs +31 -25
- package/es/src/ap-drawer/interface.d.ts +5 -0
- package/es/src/ap-drawer/utils/createDrawer.mjs +22 -19
- package/es/src/ap-modal/index.d.ts +1 -0
- package/es/src/ap-modal/index.mjs +29 -27
- package/es/src/ap-modal/interface.d.ts +5 -0
- package/es/src/ap-modal/utils/confirm.mjs +35 -34
- package/es/src/ap-modal/utils/createModal.mjs +39 -37
- package/es/src/ap-modal/utils/util.d.ts +3 -0
- package/es/src/ap-modal/utils/util.mjs +8 -2
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
- package/es/src/business/ap-view/ap-view.vue2.mjs +20 -18
- package/es/src/business/ap-view/interface.d.ts +4 -0
- package/es/src/config-provider/config-provider.mjs +32 -24
- package/es/src/index.mjs +15 -13
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +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/editable/form-item.vue.d.ts +16 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -0
- package/lib/src/ag-grid/editable/form-item.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-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -0
- package/lib/src/ag-grid/index.d.ts +2 -1
- package/lib/src/ag-grid/index.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-drawer/interface.d.ts +5 -0
- package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
- package/lib/src/ap-modal/index.d.ts +1 -0
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +5 -0
- package/lib/src/ap-modal/utils/confirm.js +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-modal/utils/util.d.ts +3 -0
- package/lib/src/ap-modal/utils/util.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +4 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/index.js +1 -1
- 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 +7 -2
- package/theme/ag-grid/index.less +6 -1
- package/theme/ap-form/ap-form-item.css +1 -1
- package/theme/ap-form/ap-form-item.less +1 -1
- package/theme/ap-form/index.css +1 -1
- package/theme/ap-form/search-form.css +1 -1
- package/theme/ap-grid/index.css +1 -1
- package/theme/ap-table/ap-table.css +1 -1
- package/theme/ap-table-modal/index.css +1 -1
- package/theme/css-var.css +2 -0
- package/theme/css-var.less +4 -0
- package/theme/editable-table/index.css +1 -1
- package/theme/index.css +9 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Spin as
|
|
1
|
+
import { defineComponent as oo, useSlots as to, ref as I, toRef as T, unref as t, computed as l, nextTick as ro, watch as z, createElementBlock as A, openBlock as b, normalizeStyle as V, normalizeClass as m, createCommentVNode as re, createElementVNode as B, createVNode as M, mergeProps as O, createSlots as ao, withCtx as ae, Fragment as no, renderList as lo, createBlock as ne, resolveDynamicComponent as so, renderSlot as le, withDirectives as io, vShow as uo } from "vue";
|
|
2
|
+
import { AgGridVue as co } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as mo, AllCommunityModule as po } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as fo } from "./utils.mjs";
|
|
5
|
+
import { Spin as go, Pagination as wo } from "@aplus-frontend/antdv";
|
|
6
6
|
import { isUndefined as F, isFunction as se } from "lodash-unified";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
|
-
import { ApForm as
|
|
9
|
-
import { recursionApColumns as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import
|
|
12
|
-
import { useProvideSorter as
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as
|
|
15
|
-
import { useToken as
|
|
16
|
-
import { useTheme as
|
|
17
|
-
import { useColumns as
|
|
18
|
-
import { useColumnsDef as
|
|
19
|
-
import { isDef as
|
|
20
|
-
import { getValidVNodeList as
|
|
21
|
-
import { useSearchForm as
|
|
8
|
+
import { ApForm as So } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as yo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Co } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import ho from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as vo } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as Ro } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as bo, sizeMap as Bo } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as Fo } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as ko } from "./theme.mjs";
|
|
17
|
+
import { useColumns as xo } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Io } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as To } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as No } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as Do } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
|
-
import
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
26
|
-
import { useNamespace as
|
|
27
|
-
import { useGlobalConfig as
|
|
28
|
-
import
|
|
29
|
-
const
|
|
23
|
+
import Eo from "./hooks/use-virtual-config.mjs";
|
|
24
|
+
import { usePinnedRow as Ko } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Po from "./hooks/use-selection-col-def.mjs";
|
|
26
|
+
import { useNamespace as zo } from "../config-provider/hooks/use-namespace.mjs";
|
|
27
|
+
import { useGlobalConfig as Ao } from "../config-provider/hooks/use-global-config.mjs";
|
|
28
|
+
import Vo from "./components/empty/index.vue2.mjs";
|
|
29
|
+
const mt = /* @__PURE__ */ oo({
|
|
30
30
|
name: "AgGrid",
|
|
31
31
|
__name: "index",
|
|
32
32
|
props: {
|
|
@@ -100,27 +100,23 @@ const ct = /* @__PURE__ */ eo({
|
|
|
100
100
|
onUpdate: {}
|
|
101
101
|
},
|
|
102
102
|
setup(de, { expose: ue }) {
|
|
103
|
-
|
|
104
|
-
const o = de,
|
|
103
|
+
mo.registerModules([po]);
|
|
104
|
+
const o = de, W = to(), { e: k, b: u, be: ce } = zo("ag-grid"), y = I(o.size), me = ko(y, T(o, "rowHeight")), pe = Eo(T(o, "virtual")), { rowPinnedGridConfig: G, getRowPinnedCellClass: fe } = Ko(
|
|
105
105
|
T(o, "summary")
|
|
106
|
-
), ge =
|
|
106
|
+
), ge = Ao("apGrid"), s = I(), [, we] = Fo();
|
|
107
107
|
let p = !!o.dataSource;
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
o,
|
|
111
|
-
fe
|
|
112
|
-
), x = I({});
|
|
113
|
-
ho({
|
|
108
|
+
const H = Do(o), { shownColumns: f, columns: L, columnKeys: Se, getTargetColumnByKey: ye } = xo(o), { defaultColDef: Ce, columnDefs: he, gridWrapperRef: ve } = Io(L, o, fe), x = I({});
|
|
109
|
+
vo({
|
|
114
110
|
sorter: x,
|
|
115
111
|
setSorter(e) {
|
|
116
112
|
x.value = e;
|
|
117
113
|
}
|
|
118
114
|
});
|
|
119
|
-
const
|
|
115
|
+
const Re = {
|
|
120
116
|
asc: "ascend",
|
|
121
117
|
desc: "descend"
|
|
122
118
|
};
|
|
123
|
-
function
|
|
119
|
+
function be() {
|
|
124
120
|
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
|
|
125
121
|
let a = e?.[0];
|
|
126
122
|
const d = Object.keys(r);
|
|
@@ -134,32 +130,32 @@ const ct = /* @__PURE__ */ eo({
|
|
|
134
130
|
j(void 0, void 0, {
|
|
135
131
|
column: i,
|
|
136
132
|
field: v?.field ?? i.field ?? i.colId,
|
|
137
|
-
order: S ?
|
|
133
|
+
order: S ? Re[S] : null
|
|
138
134
|
});
|
|
139
135
|
}
|
|
140
|
-
const
|
|
136
|
+
const Be = l(() => yo(t(f), (e) => {
|
|
141
137
|
if (e.sorter === !0)
|
|
142
138
|
return e.field ?? e.dataIndex ?? e.key;
|
|
143
|
-
}).filter(Boolean)),
|
|
139
|
+
}).filter(Boolean)), Fe = () => {
|
|
144
140
|
x.value = {};
|
|
145
141
|
const e = s.value;
|
|
146
142
|
if (!e)
|
|
147
143
|
return;
|
|
148
144
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
149
145
|
e.applyColumnState({ state: r });
|
|
150
|
-
},
|
|
146
|
+
}, ke = l(() => To(o.manual) ? o.manual : No(W.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
151
147
|
formRef: g,
|
|
152
148
|
submit: N,
|
|
153
149
|
reset: D,
|
|
154
150
|
data: w,
|
|
155
|
-
tableProps:
|
|
151
|
+
tableProps: U,
|
|
156
152
|
handleTableChangeOptional: j,
|
|
157
153
|
submitWith: $,
|
|
158
154
|
refresh: q,
|
|
159
|
-
getPaging:
|
|
160
|
-
setPaging:
|
|
161
|
-
setDataSource:
|
|
162
|
-
} =
|
|
155
|
+
getPaging: xe,
|
|
156
|
+
setPaging: Ie,
|
|
157
|
+
setDataSource: Te
|
|
158
|
+
} = Co({
|
|
163
159
|
async request(e) {
|
|
164
160
|
if (p = !1, C.value && !C.value.preserveSelectedRowKeys && F(o.dataSource) && P(), !F(o.dataSource)) {
|
|
165
161
|
const a = e.pageSize * (e.current - 1);
|
|
@@ -178,11 +174,11 @@ const ct = /* @__PURE__ */ eo({
|
|
|
178
174
|
filterFields: I([]),
|
|
179
175
|
params: T(o, "params"),
|
|
180
176
|
defaultData: o.defaultData,
|
|
181
|
-
manual: t(
|
|
177
|
+
manual: t(ke),
|
|
182
178
|
formatParams: o.beforeSearchSubmit,
|
|
183
179
|
pagination: o.pagination,
|
|
184
|
-
sortFields:
|
|
185
|
-
onClickReset:
|
|
180
|
+
sortFields: Be,
|
|
181
|
+
onClickReset: Fe
|
|
186
182
|
}), C = l(() => {
|
|
187
183
|
const e = o.rowSelection || ge.value?.rowSelection;
|
|
188
184
|
if (e)
|
|
@@ -190,29 +186,29 @@ const ct = /* @__PURE__ */ eo({
|
|
|
190
186
|
...ie,
|
|
191
187
|
...e
|
|
192
188
|
};
|
|
193
|
-
}),
|
|
189
|
+
}), Ne = Po(o, f), De = l(
|
|
194
190
|
() => F(o.dataSource) ? w.records : o.dataSource
|
|
195
191
|
), {
|
|
196
|
-
select:
|
|
197
|
-
unSelect:
|
|
192
|
+
select: Ee,
|
|
193
|
+
unSelect: Ke,
|
|
198
194
|
selectedRows: E,
|
|
199
|
-
selectedRowKeys:
|
|
200
|
-
clearAll:
|
|
201
|
-
selectMultiByKeys:
|
|
202
|
-
} =
|
|
195
|
+
selectedRowKeys: Pe,
|
|
196
|
+
clearAll: ze,
|
|
197
|
+
selectMultiByKeys: Ae
|
|
198
|
+
} = ho({
|
|
203
199
|
...C,
|
|
204
|
-
dataSource:
|
|
200
|
+
dataSource: De,
|
|
205
201
|
rowKey: o.rowKey
|
|
206
|
-
}),
|
|
202
|
+
}), Ve = {
|
|
207
203
|
checkbox: "multiRow",
|
|
208
204
|
radio: "singleRow"
|
|
209
|
-
},
|
|
205
|
+
}, Me = l(() => {
|
|
210
206
|
const e = C.value;
|
|
211
207
|
if (!e)
|
|
212
208
|
return;
|
|
213
209
|
const { type: r = "checkbox", disabled: a } = e;
|
|
214
210
|
return {
|
|
215
|
-
mode:
|
|
211
|
+
mode: Ve[r],
|
|
216
212
|
isRowSelectable: (d) => a ? !a(d.data) : !0
|
|
217
213
|
};
|
|
218
214
|
});
|
|
@@ -239,15 +235,15 @@ const ct = /* @__PURE__ */ eo({
|
|
|
239
235
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
240
236
|
p = !0;
|
|
241
237
|
}, 0);
|
|
242
|
-
},
|
|
243
|
-
p && (e.node.isSelected() ?
|
|
244
|
-
},
|
|
238
|
+
}, Oe = (e) => {
|
|
239
|
+
p && (e.node.isSelected() ? Ee(e.data) : Ke(e.data));
|
|
240
|
+
}, We = () => {
|
|
245
241
|
p = !0;
|
|
246
242
|
}, P = () => {
|
|
247
|
-
|
|
243
|
+
ze(), s.value?.deselectAll();
|
|
248
244
|
};
|
|
249
245
|
function Ge(e) {
|
|
250
|
-
|
|
246
|
+
Ae(e), ro(() => {
|
|
251
247
|
J({});
|
|
252
248
|
});
|
|
253
249
|
}
|
|
@@ -281,7 +277,7 @@ const ct = /* @__PURE__ */ eo({
|
|
|
281
277
|
...n,
|
|
282
278
|
hide: R
|
|
283
279
|
}, te = e.find(
|
|
284
|
-
(
|
|
280
|
+
(eo) => ee(eo.key) === n.colId
|
|
285
281
|
);
|
|
286
282
|
return te && (oe.pinned = te.fixed || null), oe;
|
|
287
283
|
}), i = new Map(
|
|
@@ -297,15 +293,15 @@ const ct = /* @__PURE__ */ eo({
|
|
|
297
293
|
applyOrder: !0
|
|
298
294
|
});
|
|
299
295
|
}
|
|
300
|
-
|
|
296
|
+
Ro({
|
|
301
297
|
columns: l(() => f.value),
|
|
302
|
-
columnsBackup: l(() =>
|
|
303
|
-
size: l(() =>
|
|
298
|
+
columnsBackup: l(() => L.value),
|
|
299
|
+
size: l(() => Bo[y.value]),
|
|
304
300
|
updateColumns(e) {
|
|
305
301
|
f.value = e, o.onShownColumnsChange?.(e), He(e);
|
|
306
302
|
},
|
|
307
303
|
updateSize(e) {
|
|
308
|
-
y.value =
|
|
304
|
+
y.value = bo[e];
|
|
309
305
|
},
|
|
310
306
|
renderConfig: l(() => ({
|
|
311
307
|
className: ce("table-header", "title"),
|
|
@@ -329,34 +325,34 @@ const ct = /* @__PURE__ */ eo({
|
|
|
329
325
|
o.card ? null : u("wrapper"),
|
|
330
326
|
u("adaptive"),
|
|
331
327
|
u(`size-${y.value}`)
|
|
332
|
-
].filter(Boolean)),
|
|
328
|
+
].filter(Boolean)), je = l(() => ({
|
|
333
329
|
height: "100%",
|
|
334
330
|
...o.tableStyle || {}
|
|
335
|
-
})),
|
|
331
|
+
})), $e = (e, r) => {
|
|
336
332
|
j({ current: e, pageSize: r });
|
|
337
333
|
};
|
|
338
|
-
function
|
|
334
|
+
function qe(e) {
|
|
339
335
|
const r = e.data;
|
|
340
336
|
return K(r);
|
|
341
337
|
}
|
|
342
|
-
function
|
|
338
|
+
function Je(e, r) {
|
|
343
339
|
s.value?.ensureIndexVisible(e, r);
|
|
344
340
|
}
|
|
345
|
-
function
|
|
341
|
+
function Qe(e) {
|
|
346
342
|
o.onRowClicked?.(e.data, e.event);
|
|
347
343
|
}
|
|
348
|
-
function
|
|
344
|
+
function Xe(e) {
|
|
349
345
|
o.onScrollEnd?.(e.direction);
|
|
350
346
|
}
|
|
351
|
-
function
|
|
347
|
+
function Ye(e) {
|
|
352
348
|
return s.value?.refreshCells(e);
|
|
353
349
|
}
|
|
354
|
-
function
|
|
350
|
+
function Ze(e) {
|
|
355
351
|
return s.value?.redrawRows(e);
|
|
356
352
|
}
|
|
357
|
-
const
|
|
353
|
+
const _e = (e) => {
|
|
358
354
|
const r = [
|
|
359
|
-
|
|
355
|
+
G.value.getRowClass?.(e)
|
|
360
356
|
];
|
|
361
357
|
if (!e.node.rowPinned) {
|
|
362
358
|
const a = se(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
@@ -367,7 +363,7 @@ const ct = /* @__PURE__ */ eo({
|
|
|
367
363
|
return z(
|
|
368
364
|
() => o.dataSource,
|
|
369
365
|
(e) => {
|
|
370
|
-
|
|
366
|
+
Te(e);
|
|
371
367
|
},
|
|
372
368
|
{ immediate: !0, deep: !0 }
|
|
373
369
|
), z(
|
|
@@ -393,41 +389,41 @@ const ct = /* @__PURE__ */ eo({
|
|
|
393
389
|
setSelectedRowKeys: Ge,
|
|
394
390
|
clearAll: P
|
|
395
391
|
},
|
|
396
|
-
scrollToRow:
|
|
392
|
+
scrollToRow: Je,
|
|
397
393
|
getDataSource: () => t(w.records),
|
|
398
|
-
getPaging:
|
|
399
|
-
setPaging:
|
|
394
|
+
getPaging: xe,
|
|
395
|
+
setPaging: Ie,
|
|
400
396
|
getSearchFormSorterItems: Y,
|
|
401
397
|
setSearchFormSorterItems: Z,
|
|
402
398
|
resetSearchFormSorterItems: _,
|
|
403
|
-
refreshCells:
|
|
404
|
-
redrawRows:
|
|
399
|
+
refreshCells: Ye,
|
|
400
|
+
redrawRows: Ze,
|
|
405
401
|
_internalGridApi: l(() => s.value)
|
|
406
402
|
}), (e, r) => (b(), A("div", {
|
|
407
403
|
class: m(Ue.value),
|
|
408
404
|
style: V(e.wrapperStyle)
|
|
409
405
|
}, [
|
|
410
|
-
t(F)(e.dataSource) && e.searchForm !== !1 && t(
|
|
406
|
+
t(F)(e.dataSource) && e.searchForm !== !1 && t(H).length > 0 ? (b(), A("div", {
|
|
411
407
|
key: 0,
|
|
412
408
|
class: m(e.card ? t(k)("search-wrapper") : null),
|
|
413
409
|
style: V(e.searchFormWrapperStyle)
|
|
414
410
|
}, [
|
|
415
|
-
M(t(
|
|
411
|
+
M(t(So).SearchForm, O(e.searchForm || {}, {
|
|
416
412
|
ref_key: "formRef",
|
|
417
413
|
ref: g,
|
|
418
414
|
"custom-reset": "",
|
|
419
|
-
"submit-loading": t(
|
|
415
|
+
"submit-loading": t(U).loading,
|
|
420
416
|
onSubmit: t(N),
|
|
421
417
|
onReset: t(D)
|
|
422
|
-
}),
|
|
418
|
+
}), ao({
|
|
423
419
|
default: ae(() => [
|
|
424
|
-
(b(!0), A(
|
|
420
|
+
(b(!0), A(no, null, lo(t(H), (a) => (b(), ne(so(a.renderNode), {
|
|
425
421
|
key: a.dataIndex
|
|
426
422
|
}))), 128))
|
|
427
423
|
]),
|
|
428
424
|
_: 2
|
|
429
425
|
}, [
|
|
430
|
-
|
|
426
|
+
W.searchFormExtra ? {
|
|
431
427
|
name: "extra",
|
|
432
428
|
fn: ae(() => [
|
|
433
429
|
le(e.$slots, "searchFormExtra")
|
|
@@ -445,60 +441,62 @@ const ct = /* @__PURE__ */ eo({
|
|
|
445
441
|
}, [
|
|
446
442
|
le(e.$slots, "title", {
|
|
447
443
|
selectedRows: t(E),
|
|
448
|
-
selectedRowKeys: t(
|
|
444
|
+
selectedRowKeys: t(Pe),
|
|
449
445
|
shownColumns: t(f),
|
|
450
446
|
clearAll: P
|
|
451
447
|
})
|
|
452
448
|
], 2),
|
|
453
449
|
B("div", {
|
|
450
|
+
ref_key: "gridWrapperRef",
|
|
451
|
+
ref: ve,
|
|
454
452
|
class: m(t(u)("grid-wrapper"))
|
|
455
453
|
}, [
|
|
456
|
-
M(t(
|
|
457
|
-
"get-row-class":
|
|
458
|
-
style:
|
|
454
|
+
M(t(co), O(t(fo)(t(pe), t(G)), {
|
|
455
|
+
"get-row-class": _e,
|
|
456
|
+
style: je.value,
|
|
459
457
|
"row-data": t(w).records,
|
|
460
458
|
"column-defs": t(he),
|
|
461
459
|
"default-col-def": t(Ce),
|
|
462
460
|
"suppress-loading-overlay": "",
|
|
463
|
-
"row-selection":
|
|
464
|
-
"selection-column-def": t(
|
|
465
|
-
"get-row-id":
|
|
461
|
+
"row-selection": Me.value,
|
|
462
|
+
"selection-column-def": t(Ne),
|
|
463
|
+
"get-row-id": qe,
|
|
466
464
|
theme: t(me),
|
|
467
465
|
"tooltip-show-delay": 500,
|
|
468
466
|
"enable-browser-tooltips": e.browserTooltips,
|
|
469
467
|
"tooltip-interaction": "",
|
|
470
468
|
"row-class-rules": e.rowClassRules,
|
|
471
|
-
"no-rows-overlay-component":
|
|
469
|
+
"no-rows-overlay-component": Vo,
|
|
472
470
|
"suppress-cell-focus": "",
|
|
473
471
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
474
|
-
onSortChanged:
|
|
472
|
+
onSortChanged: be,
|
|
475
473
|
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
476
474
|
onRowDataUpdated: J,
|
|
477
|
-
onRowSelected:
|
|
478
|
-
onFirstDataRendered:
|
|
479
|
-
onRowClicked:
|
|
480
|
-
onBodyScrollEnd:
|
|
475
|
+
onRowSelected: Oe,
|
|
476
|
+
onFirstDataRendered: We,
|
|
477
|
+
onRowClicked: Qe,
|
|
478
|
+
onBodyScrollEnd: Xe
|
|
481
479
|
}), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
|
|
482
|
-
|
|
480
|
+
io(B("div", {
|
|
483
481
|
class: m(t(k)("table-loading-wrapper"))
|
|
484
482
|
}, [
|
|
485
|
-
M(t(
|
|
483
|
+
M(t(go), { delay: 300 })
|
|
486
484
|
], 2), [
|
|
487
|
-
[
|
|
485
|
+
[uo, Le.value]
|
|
488
486
|
])
|
|
489
487
|
], 2),
|
|
490
488
|
B("div", {
|
|
491
489
|
class: m(t(u)("pagination-wrapper"))
|
|
492
490
|
}, [
|
|
493
|
-
e.pagination !== !1 ? (b(), ne(t(
|
|
491
|
+
e.pagination !== !1 ? (b(), ne(t(wo), O({
|
|
494
492
|
key: 0,
|
|
495
493
|
class: t(u)("pagination")
|
|
496
|
-
}, t(
|
|
494
|
+
}, t(U).pagination, { onChange: $e }), null, 16, ["class"])) : re("", !0)
|
|
497
495
|
], 2)
|
|
498
496
|
], 6)
|
|
499
497
|
], 6));
|
|
500
498
|
}
|
|
501
499
|
});
|
|
502
500
|
export {
|
|
503
|
-
|
|
501
|
+
mt as default
|
|
504
502
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as F, ref as L, useSlots as S, computed as t, unref as
|
|
1
|
+
import { defineComponent as F, ref as L, useSlots as S, computed as t, unref as a, createBlock as x, openBlock as i, mergeProps as A, withCtx as j, createElementVNode as m, normalizeClass as I, createElementBlock as u, createCommentVNode as f, createVNode as M, renderSlot as T, toDisplayString as U } from "vue";
|
|
2
2
|
import { Button as V } from "@aplus-frontend/antdv";
|
|
3
3
|
import { LoadingOutlined as D } from "@ant-design/icons-vue";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
5
5
|
import { useOssInit as E } from "./hooks/index.mjs";
|
|
6
|
-
import { getFileInfo as
|
|
6
|
+
import { getFileInfo as g } from "./utils/getFileInfo.mjs";
|
|
7
7
|
import { useStyle as P } from "./hooks/useStyle.mjs";
|
|
8
8
|
import { useLocale as G } from "../config-provider/hooks/use-locale.mjs";
|
|
9
|
-
import { useGlobalConfig as
|
|
9
|
+
import { useGlobalConfig as r } from "../config-provider/hooks/use-global-config.mjs";
|
|
10
10
|
const R = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "spin"
|
|
@@ -43,27 +43,33 @@ const R = {
|
|
|
43
43
|
getOssAccess: {}
|
|
44
44
|
},
|
|
45
45
|
emits: ["downloadCallback"],
|
|
46
|
-
setup(
|
|
47
|
-
const
|
|
46
|
+
setup(y, { emit: C }) {
|
|
47
|
+
const N = C, n = L(!1), { lang: b } = G(), v = S(), h = t(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), w = r("uiMode"), e = y, l = r("apUpload"), c = r(
|
|
48
48
|
"downloadCenterTriggerConfig"
|
|
49
|
-
),
|
|
49
|
+
), d = t(() => e.disabled), _ = t(() => e.color ? e.color : w.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: B } = P(_, k, d), z = t(() => e.getOssAccess || l.value?.getOssAccess), O = async () => {
|
|
50
50
|
if (!e.disabled) {
|
|
51
51
|
n.value = !0;
|
|
52
52
|
try {
|
|
53
|
-
if (
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (c.value?.trigger) {
|
|
54
|
+
let s = g(
|
|
55
|
+
e.needName ?? l?.value?.needName,
|
|
56
|
+
e.fileName
|
|
57
|
+
).map((p) => ({
|
|
58
|
+
objectName: p.path,
|
|
59
|
+
fileName: p.fileName
|
|
57
60
|
}));
|
|
58
|
-
await
|
|
61
|
+
await c.value?.trigger(s);
|
|
59
62
|
} else {
|
|
60
|
-
const
|
|
63
|
+
const s = await (await E(
|
|
61
64
|
z.value,
|
|
62
|
-
|
|
65
|
+
a(h)
|
|
63
66
|
)).downloadFile(
|
|
64
|
-
|
|
67
|
+
g(
|
|
68
|
+
e.needName ?? l?.value?.needName,
|
|
69
|
+
e.fileName
|
|
70
|
+
)
|
|
65
71
|
);
|
|
66
|
-
|
|
72
|
+
N("downloadCallback", s);
|
|
67
73
|
}
|
|
68
74
|
} catch (o) {
|
|
69
75
|
console.error(o);
|
|
@@ -72,23 +78,23 @@ const R = {
|
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
80
|
};
|
|
75
|
-
return (o,
|
|
81
|
+
return (o, s) => (i(), x(a(V), A(e, {
|
|
76
82
|
type: e.type,
|
|
77
83
|
size: e.size,
|
|
78
|
-
disabled:
|
|
84
|
+
disabled: d.value,
|
|
79
85
|
onClick: O
|
|
80
86
|
}), {
|
|
81
87
|
default: j(() => [
|
|
82
|
-
|
|
83
|
-
class: I(
|
|
88
|
+
m("div", {
|
|
89
|
+
class: I(a(B))
|
|
84
90
|
}, [
|
|
85
|
-
n.value ? (
|
|
86
|
-
M(
|
|
87
|
-
])) :
|
|
88
|
-
|
|
91
|
+
n.value ? (i(), u("span", R, [
|
|
92
|
+
M(a(D), { spin: !0 })
|
|
93
|
+
])) : f("", !0),
|
|
94
|
+
a(v).icon ? (i(), u("span", W, [
|
|
89
95
|
T(o.$slots, "icon")
|
|
90
|
-
])) :
|
|
91
|
-
|
|
96
|
+
])) : f("", !0),
|
|
97
|
+
m("span", $, U(o.text), 1)
|
|
92
98
|
], 2)
|
|
93
99
|
]),
|
|
94
100
|
_: 3
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DrawerProps } from '@aplus-frontend/antdv';
|
|
2
|
+
import { AppContext } from 'vue';
|
|
2
3
|
export type CreateDrawerFuncProps<ContentRecord = any> = Omit<DrawerProps, 'visible' | 'onUpdate:visible' | 'afterVisibleChange' | 'onAfterVisibleOChange' | 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onClose' | 'getContainer' | 'extra' | 'footer'> & Partial<{
|
|
3
4
|
onClose: (params: ContentRecord) => any | Promise<any>;
|
|
4
5
|
getContainer: HTMLElement;
|
|
@@ -6,6 +7,10 @@ export type CreateDrawerFuncProps<ContentRecord = any> = Omit<DrawerProps, 'visi
|
|
|
6
7
|
destroyOnClose: boolean;
|
|
7
8
|
extra: (params: ContentRecord, close: () => void) => any;
|
|
8
9
|
footer: (params: ContentRecord, close: () => void) => any;
|
|
10
|
+
/**
|
|
11
|
+
* 抽屉的上下文,一般用于获取全局注册组件、vuex 等内容
|
|
12
|
+
*/
|
|
13
|
+
appContext: AppContext;
|
|
9
14
|
}>;
|
|
10
15
|
export type CreateDrawerFuncReturn = {
|
|
11
16
|
destroy: () => void;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { render as
|
|
2
|
-
import { Drawer as
|
|
3
|
-
import { ConfigProvider as
|
|
4
|
-
import { omit as
|
|
1
|
+
import { render as m, defineComponent as g, createVNode as l, mergeProps as b, h as v } from "vue";
|
|
2
|
+
import { Drawer as w } from "@aplus-frontend/antdv";
|
|
3
|
+
import { ConfigProvider as P, globalConfigCached as y } from "../../config-provider/config-provider.mjs";
|
|
4
|
+
import { omit as A } from "lodash-unified";
|
|
5
5
|
import "../components/ApDrawerClose.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import { getModalGlobalAppContext as D } from "../../ap-modal/utils/util.mjs";
|
|
7
|
+
import O from "../components/ApDrawerClose.vue2.mjs";
|
|
8
|
+
const N = (n) => {
|
|
8
9
|
let o, s;
|
|
9
10
|
const {
|
|
10
11
|
destroyOnClose: r = !0
|
|
11
12
|
} = n;
|
|
12
13
|
function p() {
|
|
13
14
|
o && o(!1), setTimeout(() => {
|
|
14
|
-
|
|
15
|
+
m(null, t), t.parentElement?.removeChild(t);
|
|
15
16
|
}, 500);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function f() {
|
|
18
19
|
o && o(!0);
|
|
19
20
|
}
|
|
20
21
|
function i() {
|
|
21
22
|
o && o(!1);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function h(e) {
|
|
24
25
|
s && s(e);
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
+
const C = /* @__PURE__ */ g({
|
|
27
28
|
data() {
|
|
28
29
|
return {
|
|
29
30
|
open: r,
|
|
@@ -50,29 +51,31 @@ const _ = (n) => {
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
render() {
|
|
53
|
-
const e =
|
|
54
|
-
return
|
|
55
|
-
default: () => [
|
|
54
|
+
const e = A(this.props, ["onClose", "extra", "footer", "visible", "onUpdate:visible", "afterVisibleChange", "onAfterVisibleOChange", "open", "onUpdate:open", "getContainer"]), d = this.props?.content?.component?.exposed ?? void 0, c = () => r ? p() : i();
|
|
55
|
+
return l(P, y.value, {
|
|
56
|
+
default: () => [l(w, b({
|
|
56
57
|
open: this.open,
|
|
57
58
|
onClose: this.handleClose,
|
|
58
59
|
closeIcon: this.props?.closeIcon ?? null,
|
|
59
|
-
extra: this.props?.extra ? this.props?.extra?.(
|
|
60
|
+
extra: this.props?.extra ? this.props?.extra?.(d, c) : l(O, {
|
|
60
61
|
onClose: this.handleClose
|
|
61
62
|
}, null),
|
|
62
|
-
footer: this.props?.footer?.(
|
|
63
|
+
footer: this.props?.footer?.(d, c)
|
|
63
64
|
}, e), {
|
|
64
65
|
default: () => [this.props?.content]
|
|
65
66
|
})]
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
}), u = n.getContainer || document.body, t = document.createElement("div");
|
|
69
|
-
|
|
70
|
+
u.appendChild(t);
|
|
71
|
+
const a = v(C), x = D();
|
|
72
|
+
return a.appContext = n.appContext || x || a.appContext, m(a, t), {
|
|
70
73
|
destroy: p,
|
|
71
|
-
update:
|
|
72
|
-
open:
|
|
74
|
+
update: h,
|
|
75
|
+
open: f,
|
|
73
76
|
close: i
|
|
74
77
|
};
|
|
75
78
|
};
|
|
76
79
|
export {
|
|
77
|
-
|
|
80
|
+
N as createDrawer
|
|
78
81
|
};
|
|
@@ -11,6 +11,7 @@ type ApModalMixedProps = Omit<typeof _Modal, ApModalType | 'warn'> & {
|
|
|
11
11
|
error: ModalFunc;
|
|
12
12
|
success: ModalFunc;
|
|
13
13
|
info: ModalFunc;
|
|
14
|
+
setModalGlobalAppContext: (appContext: any) => void;
|
|
14
15
|
};
|
|
15
16
|
declare const ApModal: ApModalMixedProps;
|
|
16
17
|
export { ApModal };
|