@aplus-frontend/ui 7.12.6 → 7.13.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/loading/index.vue.d.ts +3 -0
- package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
- package/es/src/ag-grid/context.mjs +1 -1
- package/es/src/ag-grid/editable/form-item.vue.mjs +33 -31
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.mjs +209 -202
- package/es/src/ag-grid/interface.d.ts +4 -0
- package/es/src/ag-grid/style/index.mjs +8 -5
- package/es/src/ap-drawer/interface.d.ts +13 -2
- package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
- package/es/src/ap-field/select/index.vue.d.ts +1 -2
- package/es/src/ap-field/select/index.vue.mjs +126 -88
- package/es/src/ap-field/style/index.mjs +8 -6
- package/es/src/ap-field/style/select.d.ts +2 -0
- package/es/src/ap-field/style/select.mjs +43 -0
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/item-group/helper.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
- package/es/src/ap-table/ap-table.vue2.mjs +15 -16
- package/es/src/ap-table/components/setting/context.d.ts +17 -0
- package/es/src/ap-table/components/setting/context.mjs +18 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +217 -88
- package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
- package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +77 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
- package/es/src/ap-table/components/setting/utils.d.ts +1 -0
- package/es/src/ap-table/components/setting/utils.mjs +22 -15
- package/es/src/ap-table/constants.d.ts +2 -4
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
- package/es/src/ap-table/interface.d.ts +26 -3
- package/es/src/ap-table/style/index.d.ts +1 -0
- package/es/src/ap-table/style/index.mjs +2 -1
- package/es/src/ap-table/style/setting.d.ts +2 -0
- package/es/src/ap-table/style/setting.mjs +114 -19
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
- package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
- package/es/src/business/ap-attachment/style/index.mjs +33 -16
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/es/src/business/ap-download/hooks/index.mjs +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
- package/es/src/business/ap-keep-alive/hook.mjs +1 -1
- package/es/src/business/ap-keep-alive/utils.mjs +1 -1
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
- package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/style/index.mjs +2 -2
- package/es/src/check-card/context.mjs +1 -1
- package/es/src/config-provider/constants.mjs +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +1 -1
- package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
- package/es/src/config-provider/hooks/use-token.mjs +1 -1
- package/es/src/design-token/index.mjs +5 -5
- package/es/src/editable-table/utils.mjs +1 -1
- package/es/src/locale/lang/en.mjs +15 -4
- package/es/src/locale/lang/zh-cn.mjs +18 -7
- package/es/src/text/context.mjs +1 -1
- package/es/src/time-ago/useTimeAgo.mjs +26 -27
- package/es/src/utils/data-range-persets.d.ts +13 -1
- package/es/src/utils/data-range-persets.mjs +80 -60
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +56 -48
- package/es/src/utils/retry.d.ts +12 -0
- package/es/src/utils/retry.mjs +27 -0
- package/es/src/utils/slot.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
- package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
- package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +4 -0
- package/lib/src/ag-grid/style/index.js +1 -1
- package/lib/src/ap-drawer/interface.d.ts +13 -2
- package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +1 -2
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/style/index.js +1 -1
- package/lib/src/ap-field/style/select.d.ts +2 -0
- package/lib/src/ap-field/style/select.js +1 -0
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/context.d.ts +17 -0
- package/lib/src/ap-table/components/setting/context.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2 -4
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
- package/lib/src/ap-table/interface.d.ts +26 -3
- package/lib/src/ap-table/style/index.d.ts +1 -0
- package/lib/src/ap-table/style/index.js +1 -1
- package/lib/src/ap-table/style/setting.d.ts +2 -0
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/business/ag-grid-modal/style/index.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style/index.js +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/style/index.js +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
- package/lib/src/business/ap-view/style/index.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +13 -1
- package/lib/src/utils/data-range-persets.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/utils/retry.d.ts +12 -0
- package/lib/src/utils/retry.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AG_GRID_LOCALE_EN as
|
|
3
|
-
import {
|
|
4
|
-
import { useToken as
|
|
5
|
-
import { ModuleRegistry as
|
|
6
|
-
import { AgGridVue as
|
|
7
|
-
import { isUndefined as
|
|
8
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as
|
|
9
|
-
import { useProvideApTable as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import { recursionApColumns as
|
|
1
|
+
import { defineComponent as po, useSlots as fo, ref as M, toRef as F, unref as t, computed as n, nextTick as x, watch as G, createElementBlock as L, openBlock as C, normalizeStyle as O, normalizeClass as y, createCommentVNode as se, createElementVNode as A, createVNode as go, mergeProps as W, createSlots as wo, withCtx as ie, Fragment as So, renderList as Co, createBlock as H, resolveDynamicComponent as yo, renderSlot as ue } from "vue";
|
|
2
|
+
import { AG_GRID_LOCALE_EN as ho, AG_GRID_LOCALE_CN as Ro } from "@ag-grid-community/locale";
|
|
3
|
+
import { Pagination as vo } from "@aplus-frontend/antdv";
|
|
4
|
+
import { useToken as bo } from "@aplus-frontend/antdv/es/theme/internal";
|
|
5
|
+
import { ModuleRegistry as Mo, ValidationModule as Fo, ColumnAutoSizeModule as Bo, PinnedRowModule as ko, RowAutoHeightModule as Io, RowStyleModule as xo, CellSpanModule as Ao, CellStyleModule as No, TooltipModule as To, RowSelectionModule as Do, LocaleModule as Eo, ValueCacheModule as Po, GridStateModule as Ko, ColumnApiModule as Vo, RowApiModule as zo, CellApiModule as Go, RenderApiModule as Lo, EventApiModule as Oo, ScrollApiModule as Wo, ClientSideRowModelApiModule as Ho, ClientSideRowModelModule as Uo } from "ag-grid-community";
|
|
6
|
+
import { AgGridVue as _o } from "ag-grid-vue3";
|
|
7
|
+
import { isUndefined as B, isFunction as N } from "lodash-unified";
|
|
8
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as de, sizeReverseMap as jo, sizeMap as $o } from "../ap-grid/constants.mjs";
|
|
9
|
+
import { useProvideApTable as qo } from "../ap-table/context.mjs";
|
|
10
|
+
import { useTablePaging as Jo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import { recursionApColumns as Qo } from "../ap-table/utils.mjs";
|
|
12
12
|
import "../config-provider/index.mjs";
|
|
13
13
|
import "../utils/index.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { retryUntil as Xo } from "../utils/retry.mjs";
|
|
15
|
+
import { getValidVNodeList as Yo } from "../utils/slot.mjs";
|
|
16
|
+
import { ApForm as Zo } from "../ap-form/index.mjs";
|
|
16
17
|
import "./components/empty/index.vue.mjs";
|
|
18
|
+
import "./components/loading/index.vue.mjs";
|
|
17
19
|
import "./components/row/index.vue.mjs";
|
|
18
|
-
import { useProvideSorter as
|
|
19
|
-
import { useColumns as
|
|
20
|
-
import { useColumnsDef as
|
|
21
|
-
import { usePinnedRow as
|
|
22
|
-
import
|
|
23
|
-
import { useSearchForm as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { useTheme as
|
|
28
|
-
import { mergeProps as
|
|
29
|
-
import { useNamespace as
|
|
30
|
-
import { useLocale as
|
|
31
|
-
import { useGlobalConfig as
|
|
32
|
-
import { isDef as
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
|
|
20
|
+
import { useProvideSorter as et } from "./context.mjs";
|
|
21
|
+
import { useColumns as ot } from "./hooks/use-columns.mjs";
|
|
22
|
+
import { useColumnsDef as tt } from "./hooks/use-columns-def.mjs";
|
|
23
|
+
import { usePinnedRow as rt } from "./hooks/use-pinned-row.mjs";
|
|
24
|
+
import lt from "./hooks/use-row-selection.mjs";
|
|
25
|
+
import { useSearchForm as at } from "./hooks/use-search-form.mjs";
|
|
26
|
+
import nt from "./hooks/use-selection-col-def.mjs";
|
|
27
|
+
import st from "./hooks/use-virtual-config.mjs";
|
|
28
|
+
import it from "./style/index.mjs";
|
|
29
|
+
import { useTheme as ut } from "./theme.mjs";
|
|
30
|
+
import { mergeProps as dt } from "./utils.mjs";
|
|
31
|
+
import { useNamespace as ct } from "../config-provider/hooks/use-namespace.mjs";
|
|
32
|
+
import { useLocale as mt } from "../config-provider/hooks/use-locale.mjs";
|
|
33
|
+
import { useGlobalConfig as pt } from "../config-provider/hooks/use-global-config.mjs";
|
|
34
|
+
import { isDef as ft } from "../utils/is.mjs";
|
|
35
|
+
import gt from "./components/row/index.vue2.mjs";
|
|
36
|
+
import wt from "./components/loading/index.vue2.mjs";
|
|
37
|
+
import St from "./components/empty/index.vue2.mjs";
|
|
38
|
+
const or = /* @__PURE__ */ po({
|
|
36
39
|
name: "AgGrid",
|
|
37
40
|
__name: "index",
|
|
38
41
|
props: {
|
|
@@ -106,16 +109,20 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
106
109
|
autoHeight: { type: Boolean },
|
|
107
110
|
onUpdate: {},
|
|
108
111
|
customRow: {},
|
|
109
|
-
theme: {}
|
|
112
|
+
theme: {},
|
|
113
|
+
emptyComponent: {}
|
|
110
114
|
},
|
|
111
|
-
setup(
|
|
112
|
-
const
|
|
113
|
-
"zh-cn":
|
|
114
|
-
en:
|
|
115
|
+
setup(ce, { expose: me }) {
|
|
116
|
+
const pe = {
|
|
117
|
+
"zh-cn": Ro,
|
|
118
|
+
en: ho
|
|
115
119
|
};
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
Mo.registerModules([
|
|
121
|
+
Fo,
|
|
122
|
+
Bo,
|
|
123
|
+
ko,
|
|
118
124
|
Io,
|
|
125
|
+
xo,
|
|
119
126
|
Ao,
|
|
120
127
|
No,
|
|
121
128
|
To,
|
|
@@ -130,32 +137,29 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
130
137
|
Oo,
|
|
131
138
|
Wo,
|
|
132
139
|
Ho,
|
|
133
|
-
Uo
|
|
134
|
-
_o,
|
|
135
|
-
jo,
|
|
136
|
-
$o
|
|
140
|
+
Uo
|
|
137
141
|
]);
|
|
138
|
-
const o =
|
|
139
|
-
|
|
142
|
+
const o = ce, U = fo(), { e: T, b: d, be: fe } = ct("ag-grid"), { lang: _ } = mt(), ge = it("ag-grid"), h = M(o.size), we = ut(
|
|
143
|
+
h,
|
|
140
144
|
F(o, "rowHeight"),
|
|
141
145
|
F(o, "theme")
|
|
142
|
-
),
|
|
146
|
+
), Se = st(F(o, "virtual")), { rowPinnedGridConfig: j, getRowPinnedCellClass: Ce } = rt(
|
|
143
147
|
F(o, "summary")
|
|
144
|
-
), ye =
|
|
148
|
+
), ye = pt("apGrid"), s = M(), [, he] = bo();
|
|
145
149
|
let R = !!o.dataSource;
|
|
146
|
-
const $ =
|
|
147
|
-
|
|
148
|
-
sorter:
|
|
150
|
+
const $ = at(o), { shownColumns: g, columns: q, columnKeys: Re, getTargetColumnByKey: ve } = ot(o), { defaultColDef: be, columnDefs: Me, gridWrapperRef: Fe } = tt(q, o, Ce), k = M({});
|
|
151
|
+
et({
|
|
152
|
+
sorter: k,
|
|
149
153
|
setSorter(e) {
|
|
150
|
-
|
|
154
|
+
k.value = e;
|
|
151
155
|
}
|
|
152
156
|
});
|
|
153
|
-
const
|
|
157
|
+
const Be = {
|
|
154
158
|
asc: "ascend",
|
|
155
159
|
desc: "descend"
|
|
156
160
|
};
|
|
157
|
-
function
|
|
158
|
-
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(
|
|
161
|
+
function ke() {
|
|
162
|
+
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(k) || {};
|
|
159
163
|
let l = e?.[0];
|
|
160
164
|
const i = Object.keys(r);
|
|
161
165
|
if (i.length && i.every((c) => r[c] === null)) {
|
|
@@ -164,25 +168,25 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
164
168
|
}
|
|
165
169
|
if (!l)
|
|
166
170
|
return;
|
|
167
|
-
const u = l.getColDef(), p = l.getSort(), f =
|
|
171
|
+
const u = l.getColDef(), p = l.getSort(), f = ve(u.colId);
|
|
168
172
|
Q(void 0, void 0, {
|
|
169
173
|
column: u,
|
|
170
174
|
field: f?.field ?? u.field ?? u.colId,
|
|
171
|
-
order: p ?
|
|
175
|
+
order: p ? Be[p] : null
|
|
172
176
|
});
|
|
173
177
|
}
|
|
174
|
-
const Ie = n(() =>
|
|
178
|
+
const Ie = n(() => Qo(t(g), (e) => {
|
|
175
179
|
if (e.sorter === !0)
|
|
176
180
|
return e.field ?? e.dataIndex ?? e.key;
|
|
177
|
-
}).filter(Boolean)),
|
|
178
|
-
|
|
181
|
+
}).filter(Boolean)), xe = () => {
|
|
182
|
+
k.value = {};
|
|
179
183
|
const e = s.value;
|
|
180
184
|
if (!e)
|
|
181
185
|
return;
|
|
182
186
|
const r = e.getColumnState()?.map((l) => ({ ...l, sort: null }));
|
|
183
187
|
e.applyColumnState({ state: r });
|
|
184
|
-
}, D = M(!0),
|
|
185
|
-
formRef:
|
|
188
|
+
}, D = M(!0), Ae = n(() => ft(o.manual) ? o.manual : Yo(U.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
189
|
+
formRef: w,
|
|
186
190
|
submit: E,
|
|
187
191
|
reset: P,
|
|
188
192
|
data: m,
|
|
@@ -190,13 +194,13 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
190
194
|
handleTableChangeOptional: Q,
|
|
191
195
|
submitWith: X,
|
|
192
196
|
refresh: Y,
|
|
193
|
-
getPaging:
|
|
194
|
-
setPaging:
|
|
195
|
-
setDataSource:
|
|
196
|
-
getLastParams:
|
|
197
|
-
} =
|
|
197
|
+
getPaging: Ne,
|
|
198
|
+
setPaging: Te,
|
|
199
|
+
setDataSource: De,
|
|
200
|
+
getLastParams: Ee
|
|
201
|
+
} = Jo({
|
|
198
202
|
async request(e) {
|
|
199
|
-
if (R = !1,
|
|
203
|
+
if (R = !1, S.value && !S.value.preserveSelectedRowKeys && B(o.dataSource) && !D.value && z(), D.value && (D.value = !1), !B(o.dataSource)) {
|
|
200
204
|
const l = e.pageSize * (e.current - 1);
|
|
201
205
|
return {
|
|
202
206
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(l, l + e.pageSize)) || [],
|
|
@@ -213,54 +217,54 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
213
217
|
filterFields: M([]),
|
|
214
218
|
params: F(o, "params"),
|
|
215
219
|
defaultData: o.defaultData,
|
|
216
|
-
manual: t(
|
|
220
|
+
manual: t(Ae),
|
|
217
221
|
formatParams: o.beforeSearchSubmit,
|
|
218
222
|
pagination: o.pagination,
|
|
219
223
|
sortFields: Ie,
|
|
220
|
-
onClickReset:
|
|
221
|
-
}),
|
|
224
|
+
onClickReset: xe
|
|
225
|
+
}), S = n(() => {
|
|
222
226
|
const e = o.rowSelection || ye.value?.rowSelection;
|
|
223
227
|
if (e)
|
|
224
|
-
return e === !0 ?
|
|
225
|
-
...
|
|
228
|
+
return e === !0 ? de : {
|
|
229
|
+
...de,
|
|
226
230
|
...e
|
|
227
231
|
};
|
|
228
|
-
}),
|
|
229
|
-
() =>
|
|
232
|
+
}), Pe = nt(o, g), Ke = n(
|
|
233
|
+
() => B(o.dataSource) ? m.records : o.dataSource
|
|
230
234
|
), {
|
|
231
|
-
select:
|
|
232
|
-
unSelect:
|
|
235
|
+
select: Ve,
|
|
236
|
+
unSelect: ze,
|
|
233
237
|
selectedRows: K,
|
|
234
|
-
selectedRowKeys:
|
|
235
|
-
clearAll:
|
|
236
|
-
selectMultiByKeys:
|
|
237
|
-
selectMulti:
|
|
238
|
-
unSelectMulti:
|
|
239
|
-
} =
|
|
240
|
-
...
|
|
241
|
-
dataSource:
|
|
238
|
+
selectedRowKeys: Ge,
|
|
239
|
+
clearAll: Le,
|
|
240
|
+
selectMultiByKeys: Oe,
|
|
241
|
+
selectMulti: We,
|
|
242
|
+
unSelectMulti: He
|
|
243
|
+
} = lt({
|
|
244
|
+
...S.value,
|
|
245
|
+
dataSource: Ke,
|
|
242
246
|
rowKey: o.rowKey
|
|
243
|
-
}),
|
|
247
|
+
}), Ue = {
|
|
244
248
|
checkbox: "multiRow",
|
|
245
249
|
radio: "singleRow"
|
|
246
|
-
},
|
|
247
|
-
const e =
|
|
250
|
+
}, _e = n(() => {
|
|
251
|
+
const e = S.value;
|
|
248
252
|
if (!e)
|
|
249
253
|
return;
|
|
250
254
|
const { type: r = "checkbox", disabled: l } = e;
|
|
251
255
|
return {
|
|
252
|
-
mode:
|
|
256
|
+
mode: Ue[r],
|
|
253
257
|
isRowSelectable: (i) => l ? !l(i.data) : !0,
|
|
254
258
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
255
259
|
};
|
|
256
260
|
});
|
|
257
261
|
function V(e) {
|
|
258
|
-
return
|
|
262
|
+
return N(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
259
263
|
}
|
|
260
|
-
const
|
|
264
|
+
const I = ({
|
|
261
265
|
api: e = s.value
|
|
262
266
|
}) => {
|
|
263
|
-
if (o.onUpdate?.(), !
|
|
267
|
+
if (o.onUpdate?.(), !S.value)
|
|
264
268
|
return;
|
|
265
269
|
const r = K.value || [];
|
|
266
270
|
R = !1;
|
|
@@ -271,74 +275,74 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
271
275
|
}), e.setNodesSelected({ nodes: l, newValue: !0 }), setTimeout(() => {
|
|
272
276
|
R = !0;
|
|
273
277
|
}, 0);
|
|
274
|
-
},
|
|
275
|
-
R && (e.node.isSelected() ?
|
|
278
|
+
}, je = (e) => {
|
|
279
|
+
R && (e.node.isSelected() ? Ve(e.data) : ze(e.data), N(S.value?.tooltip) && e.api.refreshCells({
|
|
276
280
|
rowNodes: [e.node],
|
|
277
281
|
// todo: 取消硬编码
|
|
278
282
|
columns: ["ag-Grid-SelectionColumn"],
|
|
279
283
|
force: !0
|
|
280
284
|
}));
|
|
281
|
-
},
|
|
285
|
+
}, $e = () => {
|
|
282
286
|
R = !0;
|
|
283
287
|
}, z = () => {
|
|
284
|
-
|
|
288
|
+
Le(), s.value?.deselectAll();
|
|
285
289
|
};
|
|
286
|
-
function
|
|
287
|
-
|
|
288
|
-
|
|
290
|
+
function qe(e) {
|
|
291
|
+
Oe(e), x(() => {
|
|
292
|
+
I({});
|
|
289
293
|
});
|
|
290
294
|
}
|
|
291
|
-
const
|
|
295
|
+
const Je = n(() => {
|
|
292
296
|
const e = o.customRow;
|
|
293
297
|
return e ? {
|
|
294
298
|
isFullWidthRow: e.isCustomRow,
|
|
295
|
-
fullWidthCellRenderer:
|
|
299
|
+
fullWidthCellRenderer: gt,
|
|
296
300
|
fullWidthCellRendererParams: {
|
|
297
301
|
render: e.render
|
|
298
302
|
}
|
|
299
303
|
} : {};
|
|
300
304
|
});
|
|
301
|
-
function
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
function Qe(e) {
|
|
306
|
+
We(e), x(() => {
|
|
307
|
+
I({});
|
|
304
308
|
});
|
|
305
309
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
308
|
-
|
|
310
|
+
function Xe(e) {
|
|
311
|
+
He(e), x(() => {
|
|
312
|
+
I({});
|
|
309
313
|
});
|
|
310
314
|
}
|
|
311
315
|
function Z(e = !1) {
|
|
312
316
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
313
|
-
return
|
|
317
|
+
return w.value?.apForm?.[r]?.(!0);
|
|
314
318
|
}
|
|
315
319
|
function ee(e) {
|
|
316
|
-
|
|
320
|
+
w.value?.apForm?.setFieldsValue?.(e);
|
|
317
321
|
}
|
|
318
322
|
function oe() {
|
|
319
|
-
return
|
|
323
|
+
return w.value?.getSorterItems() || [];
|
|
320
324
|
}
|
|
321
325
|
function te(e) {
|
|
322
|
-
|
|
326
|
+
w.value?.setSorterItems(e);
|
|
323
327
|
}
|
|
324
328
|
function re() {
|
|
325
|
-
|
|
329
|
+
w.value?.resetSorterItems();
|
|
326
330
|
}
|
|
327
331
|
function le(e) {
|
|
328
332
|
return e && String(e);
|
|
329
333
|
}
|
|
330
|
-
function
|
|
334
|
+
function Ye(e) {
|
|
331
335
|
const r = s.value;
|
|
332
336
|
if (!r)
|
|
333
337
|
return;
|
|
334
338
|
const l = r.getColumnState() || [], i = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean), v = l.map((a) => {
|
|
335
|
-
if (!
|
|
339
|
+
if (!Re.value.includes(a.colId))
|
|
336
340
|
return a;
|
|
337
341
|
const b = !i.includes(a.colId), ae = {
|
|
338
342
|
...a,
|
|
339
343
|
hide: b
|
|
340
344
|
}, ne = e.find(
|
|
341
|
-
(
|
|
345
|
+
(mo) => le(mo.key) === a.colId
|
|
342
346
|
);
|
|
343
347
|
return ne && (ae.pinned = ne.fixed || null), ae;
|
|
344
348
|
}), u = new Map(
|
|
@@ -354,19 +358,27 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
354
358
|
applyOrder: !0
|
|
355
359
|
});
|
|
356
360
|
}
|
|
357
|
-
|
|
358
|
-
columns: n(() =>
|
|
361
|
+
qo({
|
|
362
|
+
columns: n(() => g.value),
|
|
359
363
|
columnsBackup: n(() => q.value),
|
|
360
|
-
size: n(() =>
|
|
364
|
+
size: n(() => $o[h.value]),
|
|
361
365
|
updateColumns(e) {
|
|
362
|
-
|
|
366
|
+
g.value = e, o.onShownColumnsChange?.(e), Xo(
|
|
367
|
+
() => s.value,
|
|
368
|
+
() => {
|
|
369
|
+
Ye(e);
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
interval: 17
|
|
373
|
+
}
|
|
374
|
+
);
|
|
363
375
|
},
|
|
364
376
|
updateSize(e) {
|
|
365
|
-
|
|
377
|
+
h.value = jo[e];
|
|
366
378
|
},
|
|
367
379
|
renderConfig: n(() => ({
|
|
368
|
-
className:
|
|
369
|
-
color:
|
|
380
|
+
className: fe("table-header", "title"),
|
|
381
|
+
color: he.value.colorTextTertiary
|
|
370
382
|
})),
|
|
371
383
|
dataSource: n(() => t(m).records),
|
|
372
384
|
getSearchFormValues: Z,
|
|
@@ -378,51 +390,51 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
378
390
|
getSearchFormSorterItems: oe,
|
|
379
391
|
setSearchFormSorterItems: te,
|
|
380
392
|
resetSearchFormSorterItems: re,
|
|
381
|
-
getLastParams:
|
|
393
|
+
getLastParams: Ee
|
|
382
394
|
});
|
|
383
|
-
const
|
|
384
|
-
() =>
|
|
385
|
-
),
|
|
395
|
+
const Ze = n(
|
|
396
|
+
() => B(o.loading) ? m.loading : o.loading
|
|
397
|
+
), eo = n(() => [
|
|
386
398
|
d(),
|
|
387
399
|
o.card ? null : d("wrapper"),
|
|
388
400
|
d("adaptive"),
|
|
389
|
-
d(`size-${
|
|
401
|
+
d(`size-${h.value}`),
|
|
390
402
|
o.autoHeight && m.records.length ? d("auto-height") : null,
|
|
391
|
-
|
|
392
|
-
].filter(Boolean)),
|
|
403
|
+
ge.value
|
|
404
|
+
].filter(Boolean)), oo = n(() => ({
|
|
393
405
|
height: "100%",
|
|
394
406
|
...o.tableStyle || {}
|
|
395
|
-
})),
|
|
407
|
+
})), to = (e, r) => {
|
|
396
408
|
Q({ current: e, pageSize: r });
|
|
397
409
|
};
|
|
398
|
-
function
|
|
410
|
+
function ro(e) {
|
|
399
411
|
const r = e.data;
|
|
400
412
|
return V(r);
|
|
401
413
|
}
|
|
402
|
-
function
|
|
403
|
-
(
|
|
414
|
+
function lo(e, r) {
|
|
415
|
+
(N(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, r);
|
|
404
416
|
}
|
|
405
|
-
function
|
|
417
|
+
function ao(e, r) {
|
|
406
418
|
s.value?.ensureColumnVisible(e, r);
|
|
407
419
|
}
|
|
408
|
-
function
|
|
420
|
+
function no(e) {
|
|
409
421
|
o.onRowClicked?.(e.data, e.event);
|
|
410
422
|
}
|
|
411
|
-
function
|
|
423
|
+
function so(e) {
|
|
412
424
|
o.onScrollEnd?.(e.direction);
|
|
413
425
|
}
|
|
414
|
-
function
|
|
426
|
+
function io(e) {
|
|
415
427
|
return s.value?.refreshCells(e);
|
|
416
428
|
}
|
|
417
|
-
function
|
|
429
|
+
function uo(e) {
|
|
418
430
|
return s.value?.redrawRows(e);
|
|
419
431
|
}
|
|
420
|
-
const
|
|
432
|
+
const co = (e) => {
|
|
421
433
|
const r = [
|
|
422
434
|
j.value.getRowClass?.(e)
|
|
423
435
|
];
|
|
424
436
|
if (!e.node.rowPinned) {
|
|
425
|
-
const l =
|
|
437
|
+
const l = N(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
426
438
|
r.push(l);
|
|
427
439
|
}
|
|
428
440
|
return r.flat().filter(Boolean);
|
|
@@ -430,66 +442,66 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
430
442
|
return G(
|
|
431
443
|
() => o.dataSource,
|
|
432
444
|
(e) => {
|
|
433
|
-
|
|
434
|
-
|
|
445
|
+
x(() => {
|
|
446
|
+
De(e);
|
|
435
447
|
});
|
|
436
448
|
},
|
|
437
449
|
{ immediate: !0, deep: !0 }
|
|
438
450
|
), G(
|
|
439
451
|
() => o.size,
|
|
440
452
|
(e) => {
|
|
441
|
-
|
|
453
|
+
h.value = e;
|
|
442
454
|
}
|
|
443
455
|
), G(
|
|
444
456
|
() => t(m).loading,
|
|
445
457
|
(e) => {
|
|
446
458
|
o.onLoadingChange?.(e);
|
|
447
459
|
}
|
|
448
|
-
),
|
|
460
|
+
), me({
|
|
449
461
|
submit: E,
|
|
450
462
|
reset: P,
|
|
451
463
|
refresh: Y,
|
|
452
464
|
submitWith: X,
|
|
453
465
|
setSearchFormValues: ee,
|
|
454
466
|
getSearchFormValues: Z,
|
|
455
|
-
getShowColumns: () => t(
|
|
467
|
+
getShowColumns: () => t(g),
|
|
456
468
|
rowSelection: {
|
|
457
469
|
selectedRows: n(() => K.value),
|
|
458
|
-
setSelectedRowKeys:
|
|
459
|
-
setSelectedRows:
|
|
470
|
+
setSelectedRowKeys: qe,
|
|
471
|
+
setSelectedRows: Qe,
|
|
460
472
|
clearAll: z,
|
|
461
|
-
unSelectRows:
|
|
473
|
+
unSelectRows: Xe
|
|
462
474
|
},
|
|
463
|
-
scrollToRow:
|
|
464
|
-
scrollToColumn:
|
|
475
|
+
scrollToRow: lo,
|
|
476
|
+
scrollToColumn: ao,
|
|
465
477
|
getDataSource: () => t(m.records),
|
|
466
|
-
getPaging:
|
|
467
|
-
setPaging:
|
|
478
|
+
getPaging: Ne,
|
|
479
|
+
setPaging: Te,
|
|
468
480
|
getSearchFormSorterItems: oe,
|
|
469
481
|
setSearchFormSorterItems: te,
|
|
470
482
|
resetSearchFormSorterItems: re,
|
|
471
|
-
refreshCells:
|
|
472
|
-
redrawRows:
|
|
483
|
+
refreshCells: io,
|
|
484
|
+
redrawRows: uo,
|
|
473
485
|
_internalGridApi: n(() => s.value)
|
|
474
486
|
}), (e, r) => (C(), L("div", {
|
|
475
|
-
class:
|
|
487
|
+
class: y(eo.value),
|
|
476
488
|
style: O(e.wrapperStyle)
|
|
477
489
|
}, [
|
|
478
|
-
t(
|
|
490
|
+
t(B)(e.dataSource) && e.searchForm !== !1 && t($).length > 0 ? (C(), L("div", {
|
|
479
491
|
key: 0,
|
|
480
|
-
class:
|
|
492
|
+
class: y(e.card ? t(T)("search-wrapper") : null),
|
|
481
493
|
style: O(e.searchFormWrapperStyle)
|
|
482
494
|
}, [
|
|
483
|
-
|
|
495
|
+
go(t(Zo).SearchForm, W(e.searchForm || {}, {
|
|
484
496
|
ref_key: "formRef",
|
|
485
|
-
ref:
|
|
497
|
+
ref: w,
|
|
486
498
|
"custom-reset": "",
|
|
487
499
|
"submit-loading": t(J).loading,
|
|
488
500
|
onSubmit: t(E),
|
|
489
501
|
onReset: t(P)
|
|
490
502
|
}), wo({
|
|
491
|
-
default:
|
|
492
|
-
(C(!0), L(So, null,
|
|
503
|
+
default: ie(() => [
|
|
504
|
+
(C(!0), L(So, null, Co(t($), (l) => (C(), H(yo(l.renderNode), {
|
|
493
505
|
key: l.dataIndex
|
|
494
506
|
}))), 128))
|
|
495
507
|
]),
|
|
@@ -497,85 +509,80 @@ const Zt = /* @__PURE__ */ fo({
|
|
|
497
509
|
}, [
|
|
498
510
|
U.searchFormExtra ? {
|
|
499
511
|
name: "extra",
|
|
500
|
-
fn:
|
|
501
|
-
|
|
512
|
+
fn: ie(() => [
|
|
513
|
+
ue(e.$slots, "searchFormExtra")
|
|
502
514
|
]),
|
|
503
515
|
key: "0"
|
|
504
516
|
} : void 0
|
|
505
517
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
506
518
|
], 6)) : se("", !0),
|
|
507
|
-
|
|
508
|
-
class:
|
|
519
|
+
A("div", {
|
|
520
|
+
class: y([t(T)("table-wrapper"), e.card ? t(T)("table-wrapper-card") : null]),
|
|
509
521
|
style: O(e.tableWrapperStyle)
|
|
510
522
|
}, [
|
|
511
|
-
|
|
512
|
-
class:
|
|
523
|
+
A("div", {
|
|
524
|
+
class: y(t(d)("header-wrapper"))
|
|
513
525
|
}, [
|
|
514
|
-
|
|
526
|
+
ue(e.$slots, "title", {
|
|
515
527
|
selectedRows: t(K),
|
|
516
|
-
selectedRowKeys: t(
|
|
517
|
-
shownColumns: t(
|
|
528
|
+
selectedRowKeys: t(Ge),
|
|
529
|
+
shownColumns: t(g),
|
|
518
530
|
clearAll: z
|
|
519
531
|
})
|
|
520
532
|
], 2),
|
|
521
|
-
|
|
533
|
+
A("div", {
|
|
522
534
|
ref_key: "gridWrapperRef",
|
|
523
|
-
ref:
|
|
524
|
-
class:
|
|
535
|
+
ref: Fe,
|
|
536
|
+
class: y(t(d)("grid-wrapper"))
|
|
525
537
|
}, [
|
|
526
|
-
(C(), H(t(
|
|
527
|
-
t(
|
|
538
|
+
(C(), H(t(_o), W(
|
|
539
|
+
t(dt)(t(Se), t(j), Je.value),
|
|
528
540
|
{
|
|
529
541
|
key: t(_),
|
|
530
|
-
"get-row-class":
|
|
531
|
-
style:
|
|
542
|
+
"get-row-class": co,
|
|
543
|
+
style: oo.value,
|
|
532
544
|
"row-data": t(m).records,
|
|
533
|
-
"column-defs": t(
|
|
534
|
-
"default-col-def": t(
|
|
545
|
+
"column-defs": t(Me),
|
|
546
|
+
"default-col-def": t(be),
|
|
535
547
|
"suppress-loading-overlay": "",
|
|
536
|
-
"row-selection":
|
|
537
|
-
"selection-column-def": t(
|
|
538
|
-
"get-row-id":
|
|
548
|
+
"row-selection": _e.value,
|
|
549
|
+
"selection-column-def": t(Pe),
|
|
550
|
+
"get-row-id": ro,
|
|
539
551
|
"get-row-height": o.getRowHeight,
|
|
540
|
-
theme: t(
|
|
552
|
+
theme: t(we),
|
|
541
553
|
"tooltip-show-delay": 500,
|
|
542
554
|
"enable-browser-tooltips": e.browserTooltips,
|
|
543
555
|
"tooltip-interaction": "",
|
|
544
556
|
"row-class-rules": e.rowClassRules,
|
|
545
|
-
"no-rows-overlay-component":
|
|
557
|
+
"no-rows-overlay-component": e.emptyComponent ?? St,
|
|
558
|
+
"loading-overlay-component": wt,
|
|
559
|
+
loading: Ze.value,
|
|
546
560
|
"suppress-cell-focus": "",
|
|
547
561
|
"enable-cell-span": "",
|
|
548
562
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
549
|
-
"locale-text":
|
|
550
|
-
onSortChanged:
|
|
563
|
+
"locale-text": pe[t(_)],
|
|
564
|
+
onSortChanged: ke,
|
|
551
565
|
onGridReady: r[0] || (r[0] = (l) => s.value = l.api),
|
|
552
|
-
onRowDataUpdated:
|
|
553
|
-
onRowSelected:
|
|
554
|
-
onFirstDataRendered:
|
|
555
|
-
onRowClicked:
|
|
556
|
-
onBodyScrollEnd:
|
|
566
|
+
onRowDataUpdated: I,
|
|
567
|
+
onRowSelected: je,
|
|
568
|
+
onFirstDataRendered: $e,
|
|
569
|
+
onRowClicked: no,
|
|
570
|
+
onBodyScrollEnd: so
|
|
557
571
|
}
|
|
558
|
-
), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout", "locale-text"]))
|
|
559
|
-
yo(B("div", {
|
|
560
|
-
class: g(t(x)("table-loading-wrapper"))
|
|
561
|
-
}, [
|
|
562
|
-
ie(t(Mo), { delay: 300 })
|
|
563
|
-
], 2), [
|
|
564
|
-
[Ro, eo.value]
|
|
565
|
-
])
|
|
572
|
+
), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "no-rows-overlay-component", "loading", "dom-layout", "locale-text"]))
|
|
566
573
|
], 2),
|
|
567
|
-
|
|
568
|
-
class:
|
|
574
|
+
A("div", {
|
|
575
|
+
class: y(t(d)("pagination-wrapper"))
|
|
569
576
|
}, [
|
|
570
|
-
e.pagination !== !1 ? (C(), H(t(
|
|
577
|
+
e.pagination !== !1 ? (C(), H(t(vo), W({
|
|
571
578
|
key: 0,
|
|
572
579
|
class: t(d)("pagination")
|
|
573
|
-
}, t(J).pagination, { onChange:
|
|
580
|
+
}, t(J).pagination, { onChange: to }), null, 16, ["class"])) : se("", !0)
|
|
574
581
|
], 2)
|
|
575
582
|
], 6)
|
|
576
583
|
], 6));
|
|
577
584
|
}
|
|
578
585
|
});
|
|
579
586
|
export {
|
|
580
|
-
|
|
587
|
+
or as default
|
|
581
588
|
};
|