@aplus-frontend/ui 7.15.0 → 7.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ag-grid/editable/form-item.vue.mjs +8 -7
- package/es/src/ag-grid/editable/index.vue.mjs +19 -18
- package/es/src/ag-grid/index.vue.mjs +110 -105
- package/es/src/ag-grid/interface.d.ts +7 -0
- package/es/src/ap-form/drawer-form/index.vue.d.ts +1 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +107 -116
- package/es/src/ap-form/interface.d.ts +1 -1
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -2
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +27 -26
- package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +23 -21
- package/es/src/business/ap-descriptions/style/index.mjs +7 -4
- package/es/src/time-ago/index.vue.mjs +21 -17
- package/es/src/time-ago/interface.d.ts +8 -0
- package/es/src/time-ago/useTimeAgo.d.ts +21 -0
- package/es/src/time-ago/useTimeAgo.mjs +36 -34
- package/es/src/time-ago/utils.d.ts +11 -0
- package/es/src/time-ago/utils.mjs +41 -9
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +18 -14
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +7 -0
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +1 -0
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/business/ap-descriptions/style/index.js +1 -1
- package/lib/src/time-ago/index.vue.js +1 -1
- package/lib/src/time-ago/interface.d.ts +8 -0
- package/lib/src/time-ago/useTimeAgo.d.ts +21 -0
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/time-ago/utils.d.ts +11 -0
- package/lib/src/time-ago/utils.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -124,6 +124,7 @@ const _e = /* @__PURE__ */ A({
|
|
|
124
124
|
theme: {},
|
|
125
125
|
emptyComponent: {},
|
|
126
126
|
emptyText: {},
|
|
127
|
+
onColumnResized: {},
|
|
127
128
|
columns: {},
|
|
128
129
|
defaultValue: {},
|
|
129
130
|
onChange: {},
|
|
@@ -173,10 +174,10 @@ const _e = /* @__PURE__ */ A({
|
|
|
173
174
|
getRowData: k,
|
|
174
175
|
getRowsData: D,
|
|
175
176
|
setRowData: O,
|
|
176
|
-
clear:
|
|
177
|
+
clear: z,
|
|
177
178
|
refreshRowIds: d
|
|
178
179
|
} = se(o, s, n, i);
|
|
179
|
-
function
|
|
180
|
+
function H() {
|
|
180
181
|
const e = r.value?._internalGridApi;
|
|
181
182
|
if (!d.value?.length || !e)
|
|
182
183
|
return;
|
|
@@ -195,7 +196,7 @@ const _e = /* @__PURE__ */ A({
|
|
|
195
196
|
const a = e === "end" ? n.value.length - 1 : e;
|
|
196
197
|
r.value?.scrollToRow(a, t);
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
+
function K(e, t) {
|
|
199
200
|
r.value?.scrollToColumn(e, t);
|
|
200
201
|
}
|
|
201
202
|
return R({
|
|
@@ -206,11 +207,11 @@ const _e = /* @__PURE__ */ A({
|
|
|
206
207
|
getRowData: k,
|
|
207
208
|
getRowsData: D,
|
|
208
209
|
setRowData: O,
|
|
209
|
-
clear:
|
|
210
|
+
clear: z,
|
|
210
211
|
setTableData: c,
|
|
211
212
|
scrollTo: w,
|
|
212
213
|
scrollToRow: w,
|
|
213
|
-
scrollToColumn:
|
|
214
|
+
scrollToColumn: K,
|
|
214
215
|
table: r
|
|
215
216
|
}), (e, t) => (U(), W($, null, [p(l(h).FormItem, {
|
|
216
217
|
hidden: "",
|
|
@@ -228,12 +229,12 @@ const _e = /* @__PURE__ */ A({
|
|
|
228
229
|
columns: l(E),
|
|
229
230
|
"data-source": n.value,
|
|
230
231
|
"search-form": !1,
|
|
231
|
-
onUpdate:
|
|
232
|
+
onUpdate: H
|
|
232
233
|
}), J({
|
|
233
234
|
_: 2
|
|
234
235
|
}, [Q(B, (a, m) => ({
|
|
235
236
|
name: m,
|
|
236
|
-
fn: g((
|
|
237
|
+
fn: g((M) => [X(e.$slots, m, Y(Z(M || {})))])
|
|
237
238
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
238
239
|
_: 3
|
|
239
240
|
}, 8, ["label"])], 64));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as $, ref as
|
|
2
|
-
import { isEqual as te, isArray as
|
|
1
|
+
import { defineComponent as M, useSlots as $, ref as R, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as p, createVNode as b, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ae } from "vue";
|
|
2
|
+
import { isEqual as te, isArray as v, omit as ne } from "lodash-unified";
|
|
3
3
|
import { ApForm as c } from "../../ap-form/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
@@ -10,8 +10,8 @@ import se from "../style/editable.mjs";
|
|
|
10
10
|
import { arrayToObject as f, getRowKey as ie } from "./utils.mjs";
|
|
11
11
|
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
import
|
|
13
|
+
import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
import pe from "../index.vue.mjs";
|
|
15
15
|
const Fe = /* @__PURE__ */ M({
|
|
16
16
|
name: "EditableGrid",
|
|
17
17
|
__name: "index",
|
|
@@ -121,6 +121,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
121
121
|
theme: {},
|
|
122
122
|
emptyComponent: {},
|
|
123
123
|
emptyText: {},
|
|
124
|
+
onColumnResized: {},
|
|
124
125
|
columns: {},
|
|
125
126
|
value: {},
|
|
126
127
|
defaultValue: {},
|
|
@@ -139,28 +140,28 @@ const Fe = /* @__PURE__ */ M({
|
|
|
139
140
|
}) {
|
|
140
141
|
const S = $(), a = C, {
|
|
141
142
|
b: T
|
|
142
|
-
} = de("editable-aggrid"), F = se("editable-aggrid"), _ = B, i =
|
|
143
|
+
} = de("editable-aggrid"), F = se("editable-aggrid"), _ = B, i = R(), {
|
|
143
144
|
value: s,
|
|
144
145
|
updateValue: y
|
|
145
|
-
} = ue(a, _), r =
|
|
146
|
+
} = ue(a, _), r = R(), E = c.useWatch(a.name, r);
|
|
146
147
|
q(s, (e) => {
|
|
147
148
|
const o = f(e, a.rowKey);
|
|
148
149
|
te(o, l(E)) || r.value?.setFieldValue(a.name, o);
|
|
149
150
|
}, {
|
|
150
151
|
deep: !0
|
|
151
152
|
});
|
|
152
|
-
const K =
|
|
153
|
+
const K = me("valueTypeMap"), k = re(a, K), {
|
|
153
154
|
add: A,
|
|
154
155
|
addMultiple: N,
|
|
155
156
|
remove: j,
|
|
156
157
|
removeByKey: I,
|
|
157
158
|
getRowData: V,
|
|
158
159
|
getRowsData: D,
|
|
159
|
-
setRowData:
|
|
160
|
-
clear:
|
|
160
|
+
setRowData: z,
|
|
161
|
+
clear: H,
|
|
161
162
|
refreshRowIds: d
|
|
162
163
|
} = le(a, r, s, y);
|
|
163
|
-
function
|
|
164
|
+
function O() {
|
|
164
165
|
const e = i.value?._internalGridApi;
|
|
165
166
|
if (!d.value?.length || !e)
|
|
166
167
|
return;
|
|
@@ -174,12 +175,12 @@ const Fe = /* @__PURE__ */ M({
|
|
|
174
175
|
r.value?.resetFields();
|
|
175
176
|
}
|
|
176
177
|
function w(e) {
|
|
177
|
-
return e ? (
|
|
178
|
+
return e ? (v(e) ? e : [e]).map((t) => v(t) ? [a.name, ...t] : [a.name, t]) : void 0;
|
|
178
179
|
}
|
|
179
180
|
function g(e) {
|
|
180
181
|
try {
|
|
181
182
|
const o = Object.keys(e), t = s.value.map((n) => ie(n, void 0, a.rowKey));
|
|
182
|
-
return o.sort((n, u) => t.findIndex((
|
|
183
|
+
return o.sort((n, u) => t.findIndex((m) => String(m) === n) - t.findIndex((m) => String(m) === u)), o.map((n) => e[n]);
|
|
183
184
|
} catch {
|
|
184
185
|
return e;
|
|
185
186
|
}
|
|
@@ -214,8 +215,8 @@ const Fe = /* @__PURE__ */ M({
|
|
|
214
215
|
removeByKey: I,
|
|
215
216
|
getRowData: V,
|
|
216
217
|
getRowsData: D,
|
|
217
|
-
setRowData:
|
|
218
|
-
clear:
|
|
218
|
+
setRowData: z,
|
|
219
|
+
clear: H,
|
|
219
220
|
setTableData: U,
|
|
220
221
|
scrollTo: h,
|
|
221
222
|
scrollToRow: h,
|
|
@@ -231,11 +232,11 @@ const Fe = /* @__PURE__ */ M({
|
|
|
231
232
|
height: "100%"
|
|
232
233
|
}
|
|
233
234
|
}, {
|
|
234
|
-
default:
|
|
235
|
+
default: p(() => [b(l(c).FormItem, {
|
|
235
236
|
name: e.name,
|
|
236
237
|
"no-style": ""
|
|
237
238
|
}, {
|
|
238
|
-
default:
|
|
239
|
+
default: p(() => [b(pe, X(l(ne)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
239
240
|
ref_key: "tableRef",
|
|
240
241
|
ref: i,
|
|
241
242
|
class: [l(T)(), l(F)],
|
|
@@ -243,12 +244,12 @@ const Fe = /* @__PURE__ */ M({
|
|
|
243
244
|
columns: l(k),
|
|
244
245
|
"data-source": l(s),
|
|
245
246
|
"search-form": !1,
|
|
246
|
-
onUpdate:
|
|
247
|
+
onUpdate: O
|
|
247
248
|
}), Y({
|
|
248
249
|
_: 2
|
|
249
250
|
}, [Z(S, (t, n) => ({
|
|
250
251
|
name: n,
|
|
251
|
-
fn:
|
|
252
|
+
fn: p((u) => [ee(e.$slots, n, oe(ae(u || {})))])
|
|
252
253
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
253
254
|
_: 3
|
|
254
255
|
}, 8, ["name"])]),
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AG_GRID_LOCALE_EN as
|
|
3
|
-
import { Pagination as
|
|
4
|
-
import { useToken as
|
|
5
|
-
import { ModuleRegistry as
|
|
6
|
-
import { AgGridVue as
|
|
1
|
+
import { defineComponent as Co, useSlots as yo, ref as M, toRef as B, computed as n, unref as r, nextTick as A, watch as G, createElementBlock as L, openBlock as y, normalizeStyle as W, normalizeClass as h, createCommentVNode as de, createElementVNode as T, createVNode as ho, mergeProps as H, createSlots as vo, withCtx as ce, Fragment as Ro, renderList as bo, createBlock as U, resolveDynamicComponent as Mo, renderSlot as me } from "vue";
|
|
2
|
+
import { AG_GRID_LOCALE_EN as Bo, AG_GRID_LOCALE_CN as Fo } from "@ag-grid-community/locale";
|
|
3
|
+
import { Pagination as ko } from "@aplus-frontend/antdv";
|
|
4
|
+
import { useToken as xo } from "@aplus-frontend/antdv/es/theme/internal";
|
|
5
|
+
import { ModuleRegistry as Io, ValidationModule as Ao, ColumnAutoSizeModule as To, PinnedRowModule as No, RowAutoHeightModule as Do, RowStyleModule as Eo, CellSpanModule as zo, CellStyleModule as Ko, TooltipModule as Oo, RowSelectionModule as Po, LocaleModule as Vo, ValueCacheModule as Go, GridStateModule as Lo, ColumnApiModule as Wo, RowApiModule as Ho, CellApiModule as Uo, RenderApiModule as _o, EventApiModule as jo, ScrollApiModule as $o, ClientSideRowModelApiModule as qo, ClientSideRowModelModule as Jo } from "ag-grid-community";
|
|
6
|
+
import { AgGridVue as Qo } from "ag-grid-vue3";
|
|
7
7
|
import { isUndefined as F, isFunction as N } from "lodash-unified";
|
|
8
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as pe, sizeReverseMap as
|
|
9
|
-
import { useProvideApTable as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import { recursionApColumns as
|
|
8
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as pe, sizeReverseMap as Xo, sizeMap as Yo } from "../ap-grid/constants.mjs";
|
|
9
|
+
import { useProvideApTable as Zo } from "../ap-table/context.mjs";
|
|
10
|
+
import { useTablePaging as et } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import { recursionApColumns as ot } from "../ap-table/utils.mjs";
|
|
12
12
|
import "../config-provider/index.mjs";
|
|
13
13
|
import "../utils/index.mjs";
|
|
14
|
-
import { retryUntil as
|
|
15
|
-
import { getValidVNodeList as
|
|
16
|
-
import { ApForm as
|
|
14
|
+
import { retryUntil as tt } from "../utils/retry.mjs";
|
|
15
|
+
import { getValidVNodeList as rt } from "../utils/slot.mjs";
|
|
16
|
+
import { ApForm as lt } from "../ap-form/index.mjs";
|
|
17
17
|
import "./components/empty/index.vue.mjs";
|
|
18
18
|
import "./components/loading/index.vue.mjs";
|
|
19
19
|
import "./components/row/index.vue.mjs";
|
|
20
|
-
import { useProvideSorter as
|
|
21
|
-
import { useColumns as
|
|
22
|
-
import { useColumnsDef as
|
|
23
|
-
import { usePinnedRow as
|
|
24
|
-
import
|
|
25
|
-
import { useSearchForm as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { useTheme as
|
|
30
|
-
import { mergeProps as
|
|
31
|
-
import { useNamespace as
|
|
32
|
-
import { useLocale as
|
|
33
|
-
import { useGlobalConfig as
|
|
20
|
+
import { useProvideSorter as at } from "./context.mjs";
|
|
21
|
+
import { useColumns as nt } from "./hooks/use-columns.mjs";
|
|
22
|
+
import { useColumnsDef as st } from "./hooks/use-columns-def.mjs";
|
|
23
|
+
import { usePinnedRow as it } from "./hooks/use-pinned-row.mjs";
|
|
24
|
+
import ut from "./hooks/use-row-selection.mjs";
|
|
25
|
+
import { useSearchForm as dt } from "./hooks/use-search-form.mjs";
|
|
26
|
+
import ct from "./hooks/use-selection-col-def.mjs";
|
|
27
|
+
import mt from "./hooks/use-virtual-config.mjs";
|
|
28
|
+
import pt from "./style/index.mjs";
|
|
29
|
+
import { useTheme as ft } from "./theme.mjs";
|
|
30
|
+
import { mergeProps as gt } from "./utils.mjs";
|
|
31
|
+
import { useNamespace as St } from "../config-provider/hooks/use-namespace.mjs";
|
|
32
|
+
import { useLocale as wt } from "../config-provider/hooks/use-locale.mjs";
|
|
33
|
+
import { useGlobalConfig as Ct } from "../config-provider/hooks/use-global-config.mjs";
|
|
34
34
|
import { isDef as yt } from "../utils/is.mjs";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
const
|
|
35
|
+
import ht from "./components/row/index.vue2.mjs";
|
|
36
|
+
import vt from "./components/loading/index.vue2.mjs";
|
|
37
|
+
import Rt from "./components/empty/index.vue2.mjs";
|
|
38
|
+
const nr = /* @__PURE__ */ Co({
|
|
39
39
|
name: "AgGrid",
|
|
40
40
|
__name: "index",
|
|
41
41
|
props: {
|
|
@@ -111,25 +111,25 @@ const ar = /* @__PURE__ */ wo({
|
|
|
111
111
|
customRow: {},
|
|
112
112
|
theme: {},
|
|
113
113
|
emptyComponent: {},
|
|
114
|
-
emptyText: {}
|
|
114
|
+
emptyText: {},
|
|
115
|
+
onColumnResized: {}
|
|
115
116
|
},
|
|
116
117
|
setup(fe, { expose: ge }) {
|
|
117
118
|
const Se = {
|
|
118
|
-
"zh-cn":
|
|
119
|
-
en:
|
|
119
|
+
"zh-cn": Fo,
|
|
120
|
+
en: Bo
|
|
120
121
|
};
|
|
121
|
-
|
|
122
|
-
Io,
|
|
122
|
+
Io.registerModules([
|
|
123
123
|
Ao,
|
|
124
124
|
To,
|
|
125
125
|
No,
|
|
126
126
|
Do,
|
|
127
127
|
Eo,
|
|
128
|
+
zo,
|
|
128
129
|
Ko,
|
|
129
130
|
Oo,
|
|
130
131
|
Po,
|
|
131
132
|
Vo,
|
|
132
|
-
zo,
|
|
133
133
|
Go,
|
|
134
134
|
Lo,
|
|
135
135
|
Wo,
|
|
@@ -138,23 +138,24 @@ const ar = /* @__PURE__ */ wo({
|
|
|
138
138
|
_o,
|
|
139
139
|
jo,
|
|
140
140
|
$o,
|
|
141
|
-
qo
|
|
141
|
+
qo,
|
|
142
|
+
Jo
|
|
142
143
|
]);
|
|
143
|
-
const o = fe, _ = yo(), { e: D, b: d, be: we } =
|
|
144
|
+
const o = fe, _ = yo(), { e: D, b: d, be: we } = St("ag-grid"), { lang: j } = wt(), Ce = pt("ag-grid"), v = M(o.size), ye = ft(
|
|
144
145
|
v,
|
|
145
146
|
B(o, "rowHeight"),
|
|
146
147
|
B(o, "theme")
|
|
147
|
-
), he =
|
|
148
|
+
), he = mt(B(o, "virtual")), { rowPinnedGridConfig: $, getRowPinnedCellClass: ve } = it(
|
|
148
149
|
B(o, "summary")
|
|
149
|
-
), Re =
|
|
150
|
+
), Re = Ct("apGrid"), s = M(), [, be] = xo();
|
|
150
151
|
let R = !!o.dataSource;
|
|
151
|
-
const q =
|
|
152
|
+
const q = dt(o), {
|
|
152
153
|
shownColumns: S,
|
|
153
154
|
columns: J,
|
|
154
155
|
columnKeys: Me,
|
|
155
156
|
getTargetColumnByKey: Be,
|
|
156
157
|
defaultSortOrder: k
|
|
157
|
-
} =
|
|
158
|
+
} = nt(o), { defaultColDef: Fe, columnDefs: ke, gridWrapperRef: xe } = st(J, o, ve), Ie = {
|
|
158
159
|
asc: "ascend",
|
|
159
160
|
desc: "descend"
|
|
160
161
|
}, Q = {
|
|
@@ -173,7 +174,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
173
174
|
return t;
|
|
174
175
|
}
|
|
175
176
|
const x = M(Ae());
|
|
176
|
-
|
|
177
|
+
at({
|
|
177
178
|
sorter: x,
|
|
178
179
|
setSorter(e) {
|
|
179
180
|
x.value = e;
|
|
@@ -196,7 +197,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
196
197
|
order: f ? Ie[f] : null
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
|
-
const X = n(() =>
|
|
200
|
+
const X = n(() => ot(r(S), (e) => {
|
|
200
201
|
if (e.sorter === !0)
|
|
201
202
|
return e.field ?? e.dataIndex ?? e.key;
|
|
202
203
|
}).filter(Boolean)), De = () => {
|
|
@@ -206,22 +207,22 @@ const ar = /* @__PURE__ */ wo({
|
|
|
206
207
|
return;
|
|
207
208
|
const t = e.getColumnState()?.map((l) => ({ ...l, sort: null }));
|
|
208
209
|
e.applyColumnState({ state: t });
|
|
209
|
-
}, E = M(!0), Ee = n(() => yt(o.manual) ? o.manual :
|
|
210
|
+
}, E = M(!0), Ee = n(() => yt(o.manual) ? o.manual : rt(_.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
|
|
210
211
|
formRef: w,
|
|
211
|
-
submit:
|
|
212
|
-
reset:
|
|
212
|
+
submit: z,
|
|
213
|
+
reset: K,
|
|
213
214
|
data: m,
|
|
214
215
|
tableProps: Y,
|
|
215
216
|
handleTableChangeOptional: Z,
|
|
216
217
|
submitWith: ee,
|
|
217
218
|
refresh: oe,
|
|
218
|
-
getPaging:
|
|
219
|
-
setPaging:
|
|
220
|
-
setDataSource:
|
|
221
|
-
getLastParams:
|
|
222
|
-
} =
|
|
219
|
+
getPaging: ze,
|
|
220
|
+
setPaging: Ke,
|
|
221
|
+
setDataSource: Oe,
|
|
222
|
+
getLastParams: Pe
|
|
223
|
+
} = et({
|
|
223
224
|
async request(e) {
|
|
224
|
-
if (R = !1,
|
|
225
|
+
if (R = !1, C.value && !C.value.preserveSelectedRowKeys && F(o.dataSource) && !E.value && V(), E.value && (E.value = !1), !F(o.dataSource)) {
|
|
225
226
|
const l = e.pageSize * (e.current - 1);
|
|
226
227
|
return {
|
|
227
228
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(l, l + e.pageSize)) || [],
|
|
@@ -244,33 +245,33 @@ const ar = /* @__PURE__ */ wo({
|
|
|
244
245
|
sortFields: X,
|
|
245
246
|
onClickReset: De,
|
|
246
247
|
defaultSortOrder: Te()
|
|
247
|
-
}),
|
|
248
|
+
}), C = n(() => {
|
|
248
249
|
const e = o.rowSelection || Re.value?.rowSelection;
|
|
249
250
|
if (e)
|
|
250
251
|
return e === !0 ? pe : {
|
|
251
252
|
...pe,
|
|
252
253
|
...e
|
|
253
254
|
};
|
|
254
|
-
}),
|
|
255
|
+
}), Ve = ct(o, S), Ge = n(
|
|
255
256
|
() => F(o.dataSource) ? m.records : o.dataSource
|
|
256
257
|
), {
|
|
257
258
|
select: Le,
|
|
258
259
|
unSelect: We,
|
|
259
|
-
selectedRows:
|
|
260
|
+
selectedRows: O,
|
|
260
261
|
selectedRowKeys: He,
|
|
261
262
|
clearAll: Ue,
|
|
262
263
|
selectMultiByKeys: _e,
|
|
263
264
|
selectMulti: je,
|
|
264
265
|
unSelectMulti: $e
|
|
265
|
-
} =
|
|
266
|
-
...
|
|
266
|
+
} = ut({
|
|
267
|
+
...C.value,
|
|
267
268
|
dataSource: Ge,
|
|
268
269
|
rowKey: o.rowKey
|
|
269
270
|
}), qe = {
|
|
270
271
|
checkbox: "multiRow",
|
|
271
272
|
radio: "singleRow"
|
|
272
273
|
}, Je = n(() => {
|
|
273
|
-
const e =
|
|
274
|
+
const e = C.value;
|
|
274
275
|
if (!e)
|
|
275
276
|
return;
|
|
276
277
|
const { type: t = "checkbox", disabled: l } = e;
|
|
@@ -280,25 +281,25 @@ const ar = /* @__PURE__ */ wo({
|
|
|
280
281
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
281
282
|
};
|
|
282
283
|
});
|
|
283
|
-
function
|
|
284
|
+
function P(e) {
|
|
284
285
|
return N(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
285
286
|
}
|
|
286
287
|
const I = ({
|
|
287
288
|
api: e = s.value
|
|
288
289
|
}) => {
|
|
289
|
-
if (o.onUpdate?.(), !
|
|
290
|
+
if (o.onUpdate?.(), !C.value)
|
|
290
291
|
return;
|
|
291
|
-
const t =
|
|
292
|
+
const t = O.value || [];
|
|
292
293
|
R = !1;
|
|
293
294
|
const l = [];
|
|
294
295
|
e.forEachNode((u) => {
|
|
295
|
-
const p = u.data, i =
|
|
296
|
-
t.find((g) =>
|
|
296
|
+
const p = u.data, i = P(p), f = u.isSelected();
|
|
297
|
+
t.find((g) => P(g) === i) ? !f && l.push(u) : f && u.setSelected(!1);
|
|
297
298
|
}), e.setNodesSelected({ nodes: l, newValue: !0 }), setTimeout(() => {
|
|
298
299
|
R = !0;
|
|
299
300
|
}, 0);
|
|
300
301
|
}, Qe = (e) => {
|
|
301
|
-
R && (e.node.isSelected() ? Le(e.data) : We(e.data), N(
|
|
302
|
+
R && (e.node.isSelected() ? Le(e.data) : We(e.data), N(C.value?.tooltip) && e.api.refreshCells({
|
|
302
303
|
rowNodes: [e.node],
|
|
303
304
|
// todo: 取消硬编码
|
|
304
305
|
columns: ["ag-Grid-SelectionColumn"],
|
|
@@ -316,7 +317,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
316
317
|
e.applyColumnState({
|
|
317
318
|
state: p
|
|
318
319
|
});
|
|
319
|
-
},
|
|
320
|
+
}, V = () => {
|
|
320
321
|
Ue(), s.value?.deselectAll();
|
|
321
322
|
};
|
|
322
323
|
function Ye(e) {
|
|
@@ -328,7 +329,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
328
329
|
const e = o.customRow;
|
|
329
330
|
return e ? {
|
|
330
331
|
isFullWidthRow: e.isCustomRow,
|
|
331
|
-
fullWidthCellRenderer:
|
|
332
|
+
fullWidthCellRenderer: ht,
|
|
332
333
|
fullWidthCellRendererParams: {
|
|
333
334
|
render: e.render
|
|
334
335
|
}
|
|
@@ -374,7 +375,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
374
375
|
...a,
|
|
375
376
|
hide: b
|
|
376
377
|
}, ue = e.find(
|
|
377
|
-
(
|
|
378
|
+
(wo) => se(wo.key) === a.colId
|
|
378
379
|
);
|
|
379
380
|
return ue && (ie.pinned = ue.fixed || null), ie;
|
|
380
381
|
}), i = new Map(
|
|
@@ -390,12 +391,12 @@ const ar = /* @__PURE__ */ wo({
|
|
|
390
391
|
applyOrder: !0
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
|
-
|
|
394
|
+
Zo({
|
|
394
395
|
columns: n(() => S.value),
|
|
395
396
|
columnsBackup: n(() => J.value),
|
|
396
|
-
size: n(() =>
|
|
397
|
+
size: n(() => Yo[v.value]),
|
|
397
398
|
updateColumns(e) {
|
|
398
|
-
S.value = e, o.onShownColumnsChange?.(e),
|
|
399
|
+
S.value = e, o.onShownColumnsChange?.(e), tt(
|
|
399
400
|
() => s.value,
|
|
400
401
|
() => {
|
|
401
402
|
to(e);
|
|
@@ -406,7 +407,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
406
407
|
);
|
|
407
408
|
},
|
|
408
409
|
updateSize(e) {
|
|
409
|
-
v.value =
|
|
410
|
+
v.value = Xo[e];
|
|
410
411
|
},
|
|
411
412
|
renderConfig: n(() => ({
|
|
412
413
|
className: we("table-header", "title"),
|
|
@@ -415,14 +416,14 @@ const ar = /* @__PURE__ */ wo({
|
|
|
415
416
|
dataSource: n(() => r(m).records),
|
|
416
417
|
getSearchFormValues: te,
|
|
417
418
|
setSearchFormValues: re,
|
|
418
|
-
submit:
|
|
419
|
+
submit: z,
|
|
419
420
|
submitWith: ee,
|
|
420
|
-
reset:
|
|
421
|
+
reset: K,
|
|
421
422
|
refresh: oe,
|
|
422
423
|
getSearchFormSorterItems: le,
|
|
423
424
|
setSearchFormSorterItems: ae,
|
|
424
425
|
resetSearchFormSorterItems: ne,
|
|
425
|
-
getLastParams:
|
|
426
|
+
getLastParams: Pe
|
|
426
427
|
});
|
|
427
428
|
const ro = n(
|
|
428
429
|
() => F(o.loading) ? m.loading : o.loading
|
|
@@ -432,7 +433,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
432
433
|
d("adaptive"),
|
|
433
434
|
d(`size-${v.value}`),
|
|
434
435
|
o.autoHeight && m.records.length ? d("auto-height") : null,
|
|
435
|
-
|
|
436
|
+
Ce.value
|
|
436
437
|
].filter(Boolean)), ao = n(() => ({
|
|
437
438
|
height: "100%",
|
|
438
439
|
...o.tableStyle || {}
|
|
@@ -441,7 +442,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
441
442
|
};
|
|
442
443
|
function so(e) {
|
|
443
444
|
const t = e.data;
|
|
444
|
-
return
|
|
445
|
+
return P(t);
|
|
445
446
|
}
|
|
446
447
|
function io(e, t) {
|
|
447
448
|
(N(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, t);
|
|
@@ -461,7 +462,10 @@ const ar = /* @__PURE__ */ wo({
|
|
|
461
462
|
function fo(e) {
|
|
462
463
|
return s.value?.redrawRows(e);
|
|
463
464
|
}
|
|
464
|
-
|
|
465
|
+
function go({ finished: e, column: t }) {
|
|
466
|
+
!e || !t || o.onColumnResized?.(t.getColId(), t.getActualWidth());
|
|
467
|
+
}
|
|
468
|
+
const So = (e) => {
|
|
465
469
|
const t = [
|
|
466
470
|
$.value.getRowClass?.(e)
|
|
467
471
|
];
|
|
@@ -475,7 +479,7 @@ const ar = /* @__PURE__ */ wo({
|
|
|
475
479
|
() => o.dataSource,
|
|
476
480
|
(e) => {
|
|
477
481
|
A(() => {
|
|
478
|
-
|
|
482
|
+
Oe(e);
|
|
479
483
|
});
|
|
480
484
|
},
|
|
481
485
|
{ immediate: !0, deep: !0 }
|
|
@@ -490,50 +494,50 @@ const ar = /* @__PURE__ */ wo({
|
|
|
490
494
|
o.onLoadingChange?.(e);
|
|
491
495
|
}
|
|
492
496
|
), ge({
|
|
493
|
-
submit:
|
|
494
|
-
reset:
|
|
497
|
+
submit: z,
|
|
498
|
+
reset: K,
|
|
495
499
|
refresh: oe,
|
|
496
500
|
submitWith: ee,
|
|
497
501
|
setSearchFormValues: re,
|
|
498
502
|
getSearchFormValues: te,
|
|
499
503
|
getShowColumns: () => r(S),
|
|
500
504
|
rowSelection: {
|
|
501
|
-
selectedRows: n(() =>
|
|
505
|
+
selectedRows: n(() => O.value),
|
|
502
506
|
setSelectedRowKeys: Ye,
|
|
503
507
|
setSelectedRows: eo,
|
|
504
|
-
clearAll:
|
|
508
|
+
clearAll: V,
|
|
505
509
|
unSelectRows: oo
|
|
506
510
|
},
|
|
507
511
|
scrollToRow: io,
|
|
508
512
|
scrollToColumn: uo,
|
|
509
513
|
getDataSource: () => r(m.records),
|
|
510
|
-
getPaging:
|
|
511
|
-
setPaging:
|
|
514
|
+
getPaging: ze,
|
|
515
|
+
setPaging: Ke,
|
|
512
516
|
getSearchFormSorterItems: le,
|
|
513
517
|
setSearchFormSorterItems: ae,
|
|
514
518
|
resetSearchFormSorterItems: ne,
|
|
515
519
|
refreshCells: po,
|
|
516
520
|
redrawRows: fo,
|
|
517
521
|
_internalGridApi: n(() => s.value)
|
|
518
|
-
}), (e, t) => (
|
|
522
|
+
}), (e, t) => (y(), L("div", {
|
|
519
523
|
class: h(lo.value),
|
|
520
524
|
style: W(e.wrapperStyle)
|
|
521
525
|
}, [
|
|
522
|
-
r(F)(e.dataSource) && e.searchForm !== !1 && r(q).length > 0 ? (
|
|
526
|
+
r(F)(e.dataSource) && e.searchForm !== !1 && r(q).length > 0 ? (y(), L("div", {
|
|
523
527
|
key: 0,
|
|
524
528
|
class: h(e.card ? r(D)("search-wrapper") : null),
|
|
525
529
|
style: W(e.searchFormWrapperStyle)
|
|
526
530
|
}, [
|
|
527
|
-
|
|
531
|
+
ho(r(lt).SearchForm, H(e.searchForm || {}, {
|
|
528
532
|
ref_key: "formRef",
|
|
529
533
|
ref: w,
|
|
530
534
|
"custom-reset": "",
|
|
531
535
|
"submit-loading": r(Y).loading,
|
|
532
|
-
onSubmit: r(
|
|
533
|
-
onReset: r(
|
|
534
|
-
}),
|
|
536
|
+
onSubmit: r(z),
|
|
537
|
+
onReset: r(K)
|
|
538
|
+
}), vo({
|
|
535
539
|
default: ce(() => [
|
|
536
|
-
(
|
|
540
|
+
(y(!0), L(Ro, null, bo(r(q), (l) => (y(), U(Mo(l.renderNode), {
|
|
537
541
|
key: l.dataIndex
|
|
538
542
|
}))), 128))
|
|
539
543
|
]),
|
|
@@ -556,10 +560,10 @@ const ar = /* @__PURE__ */ wo({
|
|
|
556
560
|
class: h(r(d)("header-wrapper"))
|
|
557
561
|
}, [
|
|
558
562
|
me(e.$slots, "title", {
|
|
559
|
-
selectedRows: r(
|
|
563
|
+
selectedRows: r(O),
|
|
560
564
|
selectedRowKeys: r(He),
|
|
561
565
|
shownColumns: r(S),
|
|
562
|
-
clearAll:
|
|
566
|
+
clearAll: V
|
|
563
567
|
})
|
|
564
568
|
], 2),
|
|
565
569
|
T("div", {
|
|
@@ -567,28 +571,28 @@ const ar = /* @__PURE__ */ wo({
|
|
|
567
571
|
ref: xe,
|
|
568
572
|
class: h(r(d)("grid-wrapper"))
|
|
569
573
|
}, [
|
|
570
|
-
(
|
|
571
|
-
r(
|
|
574
|
+
(y(), U(r(Qo), H(
|
|
575
|
+
r(gt)(r(he), r($), Ze.value),
|
|
572
576
|
{
|
|
573
577
|
key: r(j),
|
|
574
|
-
"get-row-class":
|
|
578
|
+
"get-row-class": So,
|
|
575
579
|
style: ao.value,
|
|
576
580
|
"row-data": r(m).records,
|
|
577
581
|
"column-defs": r(ke),
|
|
578
582
|
"default-col-def": r(Fe),
|
|
579
583
|
"suppress-loading-overlay": "",
|
|
580
584
|
"row-selection": Je.value,
|
|
581
|
-
"selection-column-def": r(
|
|
585
|
+
"selection-column-def": r(Ve),
|
|
582
586
|
"get-row-id": so,
|
|
583
587
|
"get-row-height": o.getRowHeight,
|
|
584
|
-
theme: r(
|
|
588
|
+
theme: r(ye),
|
|
585
589
|
"tooltip-show-delay": 500,
|
|
586
590
|
"enable-browser-tooltips": e.browserTooltips,
|
|
587
591
|
"tooltip-interaction": "",
|
|
588
592
|
"row-class-rules": e.rowClassRules,
|
|
589
|
-
"no-rows-overlay-component":
|
|
593
|
+
"no-rows-overlay-component": Rt,
|
|
590
594
|
"no-rows-overlay-component-params": { emptyComponent: e.emptyComponent, emptyText: e.emptyText },
|
|
591
|
-
"loading-overlay-component":
|
|
595
|
+
"loading-overlay-component": vt,
|
|
592
596
|
loading: ro.value,
|
|
593
597
|
"suppress-cell-focus": "",
|
|
594
598
|
"tab-to-next-cell": () => !1,
|
|
@@ -601,14 +605,15 @@ const ar = /* @__PURE__ */ wo({
|
|
|
601
605
|
onRowSelected: Qe,
|
|
602
606
|
onFirstDataRendered: Xe,
|
|
603
607
|
onRowClicked: co,
|
|
604
|
-
onBodyScrollEnd: mo
|
|
608
|
+
onBodyScrollEnd: mo,
|
|
609
|
+
onColumnResized: go
|
|
605
610
|
}
|
|
606
611
|
), 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-params", "loading", "dom-layout", "locale-text"]))
|
|
607
612
|
], 2),
|
|
608
613
|
T("div", {
|
|
609
614
|
class: h(r(d)("pagination-wrapper"))
|
|
610
615
|
}, [
|
|
611
|
-
e.pagination !== !1 ? (
|
|
616
|
+
e.pagination !== !1 ? (y(), U(r(ko), H({
|
|
612
617
|
key: 0,
|
|
613
618
|
class: r(d)("pagination")
|
|
614
619
|
}, r(Y).pagination, { onChange: no }), null, 16, ["class"])) : de("", !0)
|
|
@@ -618,5 +623,5 @@ const ar = /* @__PURE__ */ wo({
|
|
|
618
623
|
}
|
|
619
624
|
});
|
|
620
625
|
export {
|
|
621
|
-
|
|
626
|
+
nr as default
|
|
622
627
|
};
|