@kong-ui-public/table-data-grid 0.6.0 → 0.6.1-pr.3854.00eedd2c7.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/README.md +36 -2
- package/dist/style.css +1 -1
- package/dist/table-data-grid.es.js +515 -337
- package/dist/table-data-grid.umd.js +1 -1
- package/dist/types/components/TableDataGrid.vue.d.ts +1 -0
- package/dist/types/components/TableDataGrid.vue.d.ts.map +1 -1
- package/dist/types/components/TableDataGridCellRenderer.vue.d.ts +4 -1
- package/dist/types/components/TableDataGridCellRenderer.vue.d.ts.map +1 -1
- package/dist/types/composables/useTableDataGridColumnDefs.d.ts +13 -1
- package/dist/types/composables/useTableDataGridColumnDefs.d.ts.map +1 -1
- package/dist/types/composables/useTableDataGridConfig.d.ts +2 -0
- package/dist/types/composables/useTableDataGridConfig.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +20 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/tableConfig.d.ts.map +1 -1
- package/dist/types/utils/tableDataGridPresentation.d.ts +100 -0
- package/dist/types/utils/tableDataGridPresentation.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { createI18n as
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
const p = e.value !== void 0,
|
|
10
|
-
return t.value ? "LOADING" :
|
|
1
|
+
import { computed as u, watch as A, ref as M, shallowRef as _, readonly as W, shallowReadonly as fe, defineComponent as re, onMounted as se, onUnmounted as ge, nextTick as Ce, resolveComponent as ie, openBlock as E, createElementBlock as I, normalizeClass as ue, createElementVNode as V, createBlock as Q, resolveDynamicComponent as ee, withCtx as te, createVNode as J, toDisplayString as ae, createCommentVNode as P, normalizeStyle as pe, h as he, renderSlot as j, useSlots as be, useTemplateRef as ye, onBeforeUnmount as Se, toRef as z, unref as k } from "vue";
|
|
2
|
+
import { AgGridVue as ke } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as we, AllCommunityModule as De, ClientSideRowModelModule as Re, InfiniteRowModelModule as Te, themeQuartz as Ee } from "ag-grid-community";
|
|
4
|
+
import { createI18n as xe, i18nTComponent as Fe } from "@kong-ui-public/i18n";
|
|
5
|
+
var $ = /* @__PURE__ */ ((e) => (e.PENDING = "PENDING", e.LOADING = "LOADING", e.SUCCESS = "SUCCESS", e.ERROR = "ERROR", e))($ || {});
|
|
6
|
+
const Oe = (e) => !!e?.length;
|
|
7
|
+
function Ie(e, a, t, l = Oe) {
|
|
8
|
+
const n = u(() => l(e.value)), o = u(() => {
|
|
9
|
+
const p = e.value !== void 0, s = a.value !== void 0 && a.value !== null;
|
|
10
|
+
return t.value ? "LOADING" : n.value ? "SUCCESS" : s ? "ERROR" : p ? "SUCCESS" : "PENDING";
|
|
11
11
|
});
|
|
12
12
|
return {
|
|
13
|
-
fetchState:
|
|
14
|
-
hasData:
|
|
15
|
-
state:
|
|
13
|
+
fetchState: $,
|
|
14
|
+
hasData: n,
|
|
15
|
+
state: o
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const Ke = ({
|
|
19
19
|
emitState: e,
|
|
20
|
-
fetchLifecycleState:
|
|
20
|
+
fetchLifecycleState: a,
|
|
21
21
|
hasData: t
|
|
22
22
|
}) => {
|
|
23
23
|
A(
|
|
24
24
|
() => ({
|
|
25
25
|
hasData: t.value,
|
|
26
|
-
state:
|
|
26
|
+
state: a.value
|
|
27
27
|
}),
|
|
28
|
-
({ hasData: l, state:
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
28
|
+
({ hasData: l, state: n }) => {
|
|
29
|
+
if (n !== $.PENDING) {
|
|
30
|
+
if (n === $.LOADING) {
|
|
31
31
|
e({
|
|
32
32
|
hasData: l,
|
|
33
33
|
state: "loading"
|
|
34
34
|
});
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (n === $.ERROR) {
|
|
38
38
|
e({
|
|
39
39
|
hasData: l,
|
|
40
40
|
state: "error"
|
|
@@ -48,370 +48,529 @@ const pe = ({
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
},
|
|
52
|
-
const t =
|
|
51
|
+
}, ze = ({ startRow: e, endRow: a }) => {
|
|
52
|
+
const t = a - e;
|
|
53
53
|
return {
|
|
54
54
|
blockIndex: t > 0 ? Math.floor(e / t) : 0,
|
|
55
55
|
pageSize: t
|
|
56
56
|
};
|
|
57
|
-
},
|
|
57
|
+
}, Ge = ({
|
|
58
58
|
startRow: e,
|
|
59
|
-
rowsLength:
|
|
59
|
+
rowsLength: a,
|
|
60
60
|
pageSize: t,
|
|
61
61
|
total: l,
|
|
62
|
-
hasMore:
|
|
62
|
+
hasMore: n
|
|
63
63
|
}) => {
|
|
64
64
|
if (typeof l == "number")
|
|
65
65
|
return l;
|
|
66
|
-
if (
|
|
67
|
-
return e +
|
|
68
|
-
},
|
|
66
|
+
if (n !== !0 && (n === !1 || a < t))
|
|
67
|
+
return e + a;
|
|
68
|
+
}, Ne = ({
|
|
69
69
|
fetcher: e,
|
|
70
|
-
resetKey:
|
|
70
|
+
resetKey: a,
|
|
71
71
|
sort: t
|
|
72
72
|
}) => {
|
|
73
|
-
const l = /* @__PURE__ */ new Map(),
|
|
74
|
-
let
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
85
|
-
let
|
|
86
|
-
const
|
|
73
|
+
const l = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = M(0), c = _(), p = _(), s = _(), v = M(0), b = M(!1);
|
|
74
|
+
let S, T;
|
|
75
|
+
const w = (d) => d === o.value && S === e.value && T === a?.value, R = () => {
|
|
76
|
+
b.value = v.value > 0;
|
|
77
|
+
}, G = () => {
|
|
78
|
+
s.value = void 0, v.value += 1, R();
|
|
79
|
+
}, i = () => {
|
|
80
|
+
v.value = Math.max(0, v.value - 1), R();
|
|
81
|
+
}, C = (d) => {
|
|
82
|
+
const f = n.get(d);
|
|
83
|
+
if (f)
|
|
84
|
+
return f;
|
|
85
|
+
let h;
|
|
86
|
+
const r = {
|
|
87
87
|
promise: new Promise((g) => {
|
|
88
|
-
|
|
88
|
+
h = g;
|
|
89
89
|
}),
|
|
90
|
-
resolve: (g) =>
|
|
90
|
+
resolve: (g) => h(g)
|
|
91
91
|
};
|
|
92
|
-
return
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
blockIndex:
|
|
97
|
-
currentBlockCompletion:
|
|
98
|
-
datasourceId:
|
|
92
|
+
return n.set(d, r), r;
|
|
93
|
+
}, m = (d, f) => {
|
|
94
|
+
f.resolve(!1), n.get(d) === f && n.delete(d);
|
|
95
|
+
}, K = async ({
|
|
96
|
+
blockIndex: d,
|
|
97
|
+
currentBlockCompletion: f,
|
|
98
|
+
datasourceId: h
|
|
99
99
|
}) => {
|
|
100
|
-
if (
|
|
100
|
+
if (d === 0)
|
|
101
101
|
return "ready";
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
-
return
|
|
105
|
-
const g = await
|
|
106
|
-
return
|
|
107
|
-
},
|
|
108
|
-
blockIndex:
|
|
109
|
-
currentBlockCompletion:
|
|
110
|
-
getRowsParams:
|
|
111
|
-
pageSize:
|
|
102
|
+
const r = n.get(d - 1);
|
|
103
|
+
if (!r)
|
|
104
|
+
return m(d, f), "failed";
|
|
105
|
+
const g = await r.promise;
|
|
106
|
+
return w(h) ? g ? "ready" : (m(d, f), "failed") : (m(d, f), "stale");
|
|
107
|
+
}, F = ({
|
|
108
|
+
blockIndex: d,
|
|
109
|
+
currentBlockCompletion: f,
|
|
110
|
+
getRowsParams: h,
|
|
111
|
+
pageSize: r,
|
|
112
112
|
result: g
|
|
113
113
|
}) => {
|
|
114
|
-
g.cursor !== void 0 && l.set(
|
|
115
|
-
startRow:
|
|
114
|
+
g.cursor !== void 0 && l.set(d, g.cursor), h.successCallback(g.data, Ge({
|
|
115
|
+
startRow: h.startRow,
|
|
116
116
|
rowsLength: g.data.length,
|
|
117
|
-
pageSize:
|
|
117
|
+
pageSize: r,
|
|
118
118
|
total: g.total,
|
|
119
119
|
hasMore: g.hasMore
|
|
120
|
-
})),
|
|
121
|
-
},
|
|
122
|
-
blockIndex:
|
|
123
|
-
currentBlockCompletion:
|
|
124
|
-
fetchError:
|
|
125
|
-
getRowsParams:
|
|
120
|
+
})), h.startRow === 0 && (p.value = g.data), f.resolve(!0);
|
|
121
|
+
}, O = ({
|
|
122
|
+
blockIndex: d,
|
|
123
|
+
currentBlockCompletion: f,
|
|
124
|
+
fetchError: h,
|
|
125
|
+
getRowsParams: r
|
|
126
126
|
}) => {
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
127
|
+
s.value = h, r.failCallback(), m(d, f);
|
|
128
|
+
}, x = () => {
|
|
129
|
+
const d = e.value;
|
|
130
|
+
if (!d)
|
|
131
131
|
throw new Error("TableDataGrid requires a fetcher in infinite mode");
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
async getRows(
|
|
136
|
-
if (!
|
|
137
|
-
|
|
132
|
+
S = d, T = a?.value;
|
|
133
|
+
const f = o.value + 1;
|
|
134
|
+
return o.value = f, l.clear(), n.clear(), p.value = void 0, s.value = void 0, v.value = 0, R(), {
|
|
135
|
+
async getRows(h) {
|
|
136
|
+
if (!w(f)) {
|
|
137
|
+
h.failCallback();
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
const {
|
|
141
|
-
blockIndex:
|
|
141
|
+
blockIndex: r,
|
|
142
142
|
pageSize: g
|
|
143
|
-
} =
|
|
144
|
-
startRow:
|
|
145
|
-
endRow:
|
|
146
|
-
}),
|
|
147
|
-
if (await
|
|
148
|
-
blockIndex:
|
|
149
|
-
currentBlockCompletion:
|
|
150
|
-
datasourceId:
|
|
151
|
-
}) !== "ready" || !
|
|
152
|
-
|
|
143
|
+
} = ze({
|
|
144
|
+
startRow: h.startRow,
|
|
145
|
+
endRow: h.endRow
|
|
146
|
+
}), D = C(r);
|
|
147
|
+
if (await K({
|
|
148
|
+
blockIndex: r,
|
|
149
|
+
currentBlockCompletion: D,
|
|
150
|
+
datasourceId: f
|
|
151
|
+
}) !== "ready" || !w(f)) {
|
|
152
|
+
h.failCallback(), m(r, D);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
G();
|
|
156
156
|
try {
|
|
157
|
-
const
|
|
157
|
+
const U = r > 0 ? l.get(r - 1) : void 0, L = await d({
|
|
158
158
|
mode: "infinite",
|
|
159
159
|
pageSize: g,
|
|
160
|
-
cursor:
|
|
160
|
+
cursor: U,
|
|
161
161
|
// Always read the latest sort, not a stale one.
|
|
162
162
|
sort: t?.value
|
|
163
163
|
});
|
|
164
|
-
if (!
|
|
165
|
-
|
|
164
|
+
if (!w(f)) {
|
|
165
|
+
h.failCallback(), m(r, D);
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
blockIndex:
|
|
170
|
-
currentBlockCompletion:
|
|
171
|
-
getRowsParams:
|
|
168
|
+
F({
|
|
169
|
+
blockIndex: r,
|
|
170
|
+
currentBlockCompletion: D,
|
|
171
|
+
getRowsParams: h,
|
|
172
172
|
pageSize: g,
|
|
173
|
-
result:
|
|
173
|
+
result: L
|
|
174
174
|
});
|
|
175
|
-
} catch (
|
|
176
|
-
if (!
|
|
177
|
-
|
|
175
|
+
} catch (U) {
|
|
176
|
+
if (!w(f)) {
|
|
177
|
+
h.failCallback(), m(r, D);
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
blockIndex:
|
|
182
|
-
currentBlockCompletion:
|
|
183
|
-
fetchError:
|
|
184
|
-
getRowsParams:
|
|
180
|
+
O({
|
|
181
|
+
blockIndex: r,
|
|
182
|
+
currentBlockCompletion: D,
|
|
183
|
+
fetchError: U,
|
|
184
|
+
getRowsParams: h
|
|
185
185
|
});
|
|
186
186
|
} finally {
|
|
187
|
-
|
|
187
|
+
w(f) && i();
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
},
|
|
192
|
-
|
|
191
|
+
}, N = () => {
|
|
192
|
+
c.value = x();
|
|
193
193
|
};
|
|
194
194
|
return A(
|
|
195
|
-
[e, () =>
|
|
195
|
+
[e, () => a?.value],
|
|
196
196
|
() => {
|
|
197
|
-
|
|
197
|
+
N();
|
|
198
198
|
},
|
|
199
199
|
{ immediate: !0 }
|
|
200
200
|
), {
|
|
201
|
-
datasource:
|
|
202
|
-
data:
|
|
203
|
-
error:
|
|
204
|
-
isFetching:
|
|
201
|
+
datasource: W(c),
|
|
202
|
+
data: fe(p),
|
|
203
|
+
error: W(s),
|
|
204
|
+
isFetching: W(b)
|
|
205
205
|
};
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
206
|
+
}, ce = (e, a) => {
|
|
207
|
+
const t = Reflect.get(a, e.key);
|
|
208
|
+
return e.valueFormatter ? e.valueFormatter(t, a) : String(t ?? "");
|
|
209
|
+
}, q = (e) => typeof e != "number" ? null : Number.isFinite(e) ? e : null, le = (e, a) => e.reduce(
|
|
210
|
+
(t, l) => {
|
|
211
|
+
const n = q(Reflect.get(l, a.key));
|
|
212
|
+
return n === null ? t : {
|
|
213
|
+
sum: t.sum + n,
|
|
214
|
+
max: Math.max(t.max, n)
|
|
215
|
+
};
|
|
216
|
+
},
|
|
217
|
+
{ sum: 0, max: 0 }
|
|
218
|
+
), Me = (e, a) => {
|
|
219
|
+
const t = (a ?? []).filter((o) => Number.isFinite(o.value) && e >= o.value);
|
|
220
|
+
if (!t.length)
|
|
221
|
+
return;
|
|
222
|
+
const l = Math.max(...t.map((o) => o.value));
|
|
223
|
+
return t.filter((o) => o.value === l).some((o) => o.type === "error") ? "error" : "warning";
|
|
224
|
+
}, _e = (e, a, t) => {
|
|
225
|
+
if (e === null)
|
|
226
|
+
return 0;
|
|
227
|
+
const l = t === "relative" ? a.sum : a.max;
|
|
228
|
+
return !l || l <= 0 ? 0 : Math.min(Math.max(e / l, 0), 1);
|
|
229
|
+
}, Be = (e, a = "en-US") => {
|
|
230
|
+
const t = new Intl.NumberFormat(a, { maximumFractionDigits: 2 }), l = t.format(e);
|
|
231
|
+
return e > 0 && e < 0.01 ? `< ${t.format(0.01)} %` : `${l} %`;
|
|
232
|
+
}, de = ({
|
|
233
|
+
value: e,
|
|
234
|
+
stats: a,
|
|
235
|
+
header: t,
|
|
236
|
+
locale: l
|
|
237
|
+
}) => {
|
|
238
|
+
if (e === null || a.sum <= 0)
|
|
239
|
+
return;
|
|
240
|
+
const n = e / a.sum * 100;
|
|
241
|
+
return t.percentageFormatter?.(n) ?? Be(n, l);
|
|
242
|
+
}, oe = (e, a) => a !== void 0 && a.length > (e?.length ?? -1) ? a : e, Ue = ({
|
|
243
|
+
rows: e,
|
|
244
|
+
header: a,
|
|
245
|
+
stats: t,
|
|
246
|
+
locale: l
|
|
247
|
+
}) => e.reduce(
|
|
248
|
+
(n, o) => ({
|
|
249
|
+
value: oe(n.value, ce(a, o)) ?? "",
|
|
250
|
+
relative: a.showPercentage ? oe(n.relative, de({
|
|
251
|
+
value: q(Reflect.get(o, a.key)),
|
|
252
|
+
stats: t,
|
|
253
|
+
header: a,
|
|
254
|
+
locale: l
|
|
255
|
+
})) : void 0
|
|
256
|
+
}),
|
|
257
|
+
{ value: "" }
|
|
258
|
+
), Ve = ["data-threshold"], $e = { class: "table-data-grid-cell-label-track" }, Ae = { class: "table-data-grid-cell-label" }, Le = {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: "table-data-grid-cell-relative",
|
|
261
|
+
"data-testid": "table-data-grid-cell-relative"
|
|
262
|
+
}, Pe = {
|
|
263
|
+
key: 0,
|
|
264
|
+
"aria-hidden": "true",
|
|
265
|
+
class: "table-data-grid-cell-label table-data-grid-cell-label-sizer"
|
|
266
|
+
}, We = ["data-text"], je = ["data-text"], qe = ["data-threshold"], He = /* @__PURE__ */ re({
|
|
210
267
|
name: "TableDataGridCellRenderer",
|
|
211
268
|
__name: "TableDataGridCellRenderer",
|
|
212
269
|
props: {
|
|
213
270
|
params: {}
|
|
214
271
|
},
|
|
215
|
-
setup(e, { expose:
|
|
216
|
-
const t =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}), p =
|
|
220
|
-
|
|
272
|
+
setup(e, { expose: a }) {
|
|
273
|
+
const t = _(e.params), l = M(null), n = M(!1), o = u(() => t.value.headerDef ?? {
|
|
274
|
+
key: "",
|
|
275
|
+
label: ""
|
|
276
|
+
}), c = u(() => t.value.context?.presentation), p = u(() => t.value.context?.cells?.tooltipTarget?.value ?? "body"), s = u(() => {
|
|
277
|
+
const r = t.value;
|
|
278
|
+
return r.valueFormatted !== void 0 && r.valueFormatted !== null ? String(r.valueFormatted) : String(r.value ?? "");
|
|
279
|
+
}), v = u(() => t.value.value), b = u(() => q(v.value)), S = u(() => c.value?.stats[o.value.key]), T = u(() => c.value?.mode === "unpaginated"), w = u(() => T.value && o.value.showPercentage && S.value ? de({
|
|
280
|
+
value: b.value,
|
|
281
|
+
stats: S.value,
|
|
282
|
+
header: o.value,
|
|
283
|
+
locale: c.value?.locale ?? "en-US"
|
|
284
|
+
}) : void 0), R = u(() => T.value && !!o.value.bar && (b.value !== null || v.value === null || v.value === void 0)), G = u(() => R.value && S.value ? _e(b.value, S.value, o.value.bar) * 100 : 0), i = u(() => R.value ? c.value?.labelSizers[o.value.key] : void 0), C = u(() => o.value.thresholds?.length && b.value !== null ? Me(b.value, o.value.thresholds) : void 0), m = u(() => ({
|
|
285
|
+
column: o.value,
|
|
221
286
|
refreshCell: () => {
|
|
222
|
-
const
|
|
223
|
-
|
|
287
|
+
const r = t.value.node;
|
|
288
|
+
r && t.value.api.refreshCells({ force: !0, rowNodes: [r] });
|
|
224
289
|
},
|
|
225
290
|
row: t.value.data ?? {},
|
|
226
291
|
rowIndex: t.value.node?.rowIndex ?? 0,
|
|
227
292
|
rowValue: t.value.value,
|
|
228
293
|
selected: t.value.node?.isSelected() ?? !1
|
|
229
|
-
})),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
294
|
+
})), K = (r, { slots: g }) => {
|
|
295
|
+
const D = t.value.colDef?.colId, B = t.value.context?.cells?.slots;
|
|
296
|
+
return !D || D === "cell-icon" || !B?.[D] ? g.default?.() : he(
|
|
297
|
+
"span",
|
|
298
|
+
{ class: "table-data-grid-cell-slot-content" },
|
|
299
|
+
j(B, D, m.value, () => g.default?.() ?? [])
|
|
300
|
+
);
|
|
301
|
+
}, F = () => {
|
|
302
|
+
const r = t.value.context?.cells?.slots;
|
|
303
|
+
return r?.["cell-icon"] ? j(r, "cell-icon", m.value) : null;
|
|
304
|
+
};
|
|
305
|
+
let O, x, N = !1;
|
|
306
|
+
const d = () => {
|
|
307
|
+
const r = l.value;
|
|
308
|
+
n.value = !!r && r.scrollWidth > r.clientWidth;
|
|
309
|
+
}, f = () => {
|
|
310
|
+
N || (x !== void 0 && cancelAnimationFrame(x), x = requestAnimationFrame(() => {
|
|
311
|
+
x = void 0, d();
|
|
237
312
|
}));
|
|
238
|
-
},
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
313
|
+
}, h = (r) => {
|
|
314
|
+
if (O?.disconnect(), r) {
|
|
315
|
+
O?.observe(r);
|
|
316
|
+
const g = r.closest(".ag-cell");
|
|
317
|
+
g && O?.observe(g);
|
|
243
318
|
}
|
|
244
|
-
|
|
319
|
+
f();
|
|
245
320
|
};
|
|
246
|
-
return
|
|
247
|
-
|
|
248
|
-
}), A(l,
|
|
249
|
-
|
|
250
|
-
}),
|
|
251
|
-
refresh(
|
|
252
|
-
return t.value =
|
|
321
|
+
return se(() => {
|
|
322
|
+
O = new ResizeObserver(f), h(l.value);
|
|
323
|
+
}), A(l, h), ge(() => {
|
|
324
|
+
N = !0, O?.disconnect(), x !== void 0 && cancelAnimationFrame(x);
|
|
325
|
+
}), a({
|
|
326
|
+
refresh(r) {
|
|
327
|
+
return t.value = r, Ce(f), !0;
|
|
253
328
|
}
|
|
254
|
-
}), (
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
329
|
+
}), (r, g) => {
|
|
330
|
+
const D = ie("KTooltip");
|
|
331
|
+
return E(), I("span", {
|
|
332
|
+
class: ue(["table-data-grid-cell-renderer", {
|
|
333
|
+
"table-data-grid-cell-renderer--bar": R.value,
|
|
334
|
+
"table-data-grid-cell-renderer--percentage": !!w.value,
|
|
335
|
+
[`table-data-grid-cell-renderer--text-${C.value}`]: !R.value && !!C.value
|
|
336
|
+
}]),
|
|
337
|
+
"data-threshold": C.value
|
|
338
|
+
}, [
|
|
339
|
+
V("span", $e, [
|
|
340
|
+
V("span", Ae, [
|
|
341
|
+
(E(), Q(ee(F))),
|
|
342
|
+
(E(), Q(ee(K), null, {
|
|
343
|
+
default: te(() => [
|
|
344
|
+
J(D, {
|
|
345
|
+
class: "table-data-grid-cell-tooltip",
|
|
346
|
+
disabled: !n.value,
|
|
347
|
+
"kpop-attributes": { popoverDelay: 400 },
|
|
348
|
+
"max-width": "300",
|
|
349
|
+
placement: "bottom-start",
|
|
350
|
+
target: p.value,
|
|
351
|
+
text: s.value
|
|
352
|
+
}, {
|
|
353
|
+
default: te(() => [
|
|
354
|
+
V("span", {
|
|
355
|
+
ref_key: "contentElement",
|
|
356
|
+
ref: l,
|
|
357
|
+
class: "table-data-grid-cell-content"
|
|
358
|
+
}, ae(s.value), 513)
|
|
359
|
+
]),
|
|
360
|
+
_: 1
|
|
361
|
+
}, 8, ["disabled", "target", "text"])
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
})),
|
|
365
|
+
w.value ? (E(), I("span", Le, "(" + ae(w.value) + ")", 1)) : P("", !0)
|
|
272
366
|
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
367
|
+
i.value ? (E(), I("span", Pe, [
|
|
368
|
+
V("span", {
|
|
369
|
+
class: "table-data-grid-cell-sizer-value",
|
|
370
|
+
"data-text": i.value.value
|
|
371
|
+
}, null, 8, We),
|
|
372
|
+
i.value.relative ? (E(), I("span", {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "table-data-grid-cell-sizer-relative",
|
|
375
|
+
"data-text": `(${i.value.relative})`
|
|
376
|
+
}, null, 8, je)) : P("", !0)
|
|
377
|
+
])) : P("", !0)
|
|
378
|
+
]),
|
|
379
|
+
R.value ? (E(), I("span", {
|
|
380
|
+
key: 0,
|
|
381
|
+
class: "table-data-grid-cell-bar",
|
|
382
|
+
"data-testid": "table-data-grid-cell-bar",
|
|
383
|
+
"data-threshold": C.value
|
|
384
|
+
}, [
|
|
385
|
+
V("span", {
|
|
386
|
+
class: "table-data-grid-cell-bar-fill",
|
|
387
|
+
"data-testid": "table-data-grid-cell-bar-fill",
|
|
388
|
+
style: pe({ width: `${G.value}%` })
|
|
389
|
+
}, null, 4)
|
|
390
|
+
], 8, qe)) : P("", !0)
|
|
391
|
+
], 10, Ve);
|
|
276
392
|
};
|
|
277
393
|
}
|
|
278
|
-
}),
|
|
394
|
+
}), Qe = ({
|
|
279
395
|
headers: e,
|
|
280
|
-
slots:
|
|
281
|
-
initialSort: t
|
|
396
|
+
slots: a,
|
|
397
|
+
initialSort: t,
|
|
398
|
+
mode: l,
|
|
399
|
+
rows: n,
|
|
400
|
+
locale: o,
|
|
401
|
+
tooltipTarget: c
|
|
282
402
|
}) => {
|
|
283
|
-
const l =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
403
|
+
const p = l ?? "infinite", s = /* @__PURE__ */ new Set(), v = (i) => !!(i.showPercentage || i.bar || i.thresholds?.length);
|
|
404
|
+
A([e, () => n?.value], () => {
|
|
405
|
+
e.value.forEach((i) => {
|
|
406
|
+
if (!v(i))
|
|
407
|
+
return;
|
|
408
|
+
let C;
|
|
409
|
+
if (p === "infinite" && (i.showPercentage || i.bar) ? C = "percentage and bar presentation is only supported in unpaginated mode" : p === "unpaginated" && n?.value?.some((K) => {
|
|
410
|
+
const F = Reflect.get(K, i.key);
|
|
411
|
+
return F != null && q(F) === null;
|
|
412
|
+
}) && (C = "contains non-finite or nonnumeric values; numeric presentation skips those values"), !C)
|
|
413
|
+
return;
|
|
414
|
+
const m = `${i.key}:${C}`;
|
|
415
|
+
s.has(m) || (s.add(m), console.warn(`[TableDataGrid] Column "${i.key}" ${C}.`));
|
|
416
|
+
});
|
|
417
|
+
}, { deep: !0, immediate: !0 });
|
|
418
|
+
const S = u(() => {
|
|
419
|
+
if (p !== "unpaginated")
|
|
420
|
+
return {};
|
|
421
|
+
const i = n?.value ?? [];
|
|
422
|
+
return Object.fromEntries(
|
|
423
|
+
e.value.filter((C) => C.showPercentage || C.bar).map((C) => [C.key, le(i, C)])
|
|
424
|
+
);
|
|
425
|
+
}), T = u(() => {
|
|
426
|
+
if (p !== "unpaginated")
|
|
427
|
+
return {};
|
|
428
|
+
const i = n?.value ?? [], C = o?.value ?? "en-US";
|
|
429
|
+
return Object.fromEntries(
|
|
430
|
+
e.value.filter((m) => m.bar).map((m) => [m.key, Ue({
|
|
431
|
+
rows: i,
|
|
432
|
+
header: m,
|
|
433
|
+
stats: S.value[m.key] ?? le(i, m),
|
|
434
|
+
locale: C
|
|
435
|
+
})])
|
|
436
|
+
);
|
|
437
|
+
}), w = u(() => ({
|
|
438
|
+
cells: { slots: a, tooltipTarget: c },
|
|
439
|
+
presentation: {
|
|
440
|
+
mode: p,
|
|
441
|
+
locale: o?.value ?? "en-US",
|
|
442
|
+
stats: S.value,
|
|
443
|
+
labelSizers: T.value
|
|
444
|
+
}
|
|
445
|
+
})), R = (i) => {
|
|
446
|
+
const C = t?.sortColumnKey === i.key;
|
|
287
447
|
return {
|
|
288
|
-
colId:
|
|
448
|
+
colId: i.key,
|
|
289
449
|
// Columns with no explicit width constraint share remaining space equally.
|
|
290
|
-
flex: !
|
|
291
|
-
headerName:
|
|
292
|
-
maxWidth:
|
|
293
|
-
minWidth:
|
|
294
|
-
sortable:
|
|
295
|
-
unSortIcon:
|
|
296
|
-
...
|
|
297
|
-
valueGetter: (
|
|
298
|
-
|
|
299
|
-
|
|
450
|
+
flex: !i.width && !i.maxWidth ? 1 : void 0,
|
|
451
|
+
headerName: i.label,
|
|
452
|
+
maxWidth: i.maxWidth,
|
|
453
|
+
minWidth: i.minWidth,
|
|
454
|
+
sortable: i.sortable ?? !1,
|
|
455
|
+
unSortIcon: i.showSortIcon,
|
|
456
|
+
...C ? { initialSort: t?.sortColumnOrder, initialSortIndex: 0 } : {},
|
|
457
|
+
valueGetter: (m) => m.data?.[i.key],
|
|
458
|
+
valueFormatter: (m) => m.data ? ce(i, m.data) : String(m.value ?? ""),
|
|
459
|
+
width: i.width,
|
|
460
|
+
cellRenderer: He,
|
|
300
461
|
// custom params passed to the cell renderer.
|
|
301
|
-
cellRendererParams: { headerDef:
|
|
462
|
+
cellRendererParams: { headerDef: i }
|
|
302
463
|
};
|
|
303
464
|
};
|
|
304
465
|
return {
|
|
305
|
-
columnDefs:
|
|
306
|
-
gridContext:
|
|
466
|
+
columnDefs: u(() => e.value.map(R)),
|
|
467
|
+
gridContext: w
|
|
307
468
|
};
|
|
308
|
-
},
|
|
469
|
+
}, H = ({
|
|
309
470
|
config: e,
|
|
310
|
-
headers:
|
|
471
|
+
headers: a,
|
|
311
472
|
pageSize: t
|
|
312
473
|
}) => {
|
|
313
|
-
const l = new Set(
|
|
474
|
+
const l = new Set(a.filter((o) => o.sortable).map((o) => o.key)), n = e?.sortColumnKey && l.has(e.sortColumnKey) ? e.sortColumnKey : void 0;
|
|
314
475
|
return {
|
|
315
|
-
sortColumnKey:
|
|
316
|
-
sortColumnOrder:
|
|
317
|
-
pageSize: e?.pageSize ?? t
|
|
476
|
+
sortColumnKey: n,
|
|
477
|
+
sortColumnOrder: n ? e?.sortColumnOrder : void 0,
|
|
478
|
+
pageSize: e?.pageSize ?? t,
|
|
479
|
+
...e?.fitToContent !== void 0 ? { fitToContent: e.fitToContent } : {}
|
|
318
480
|
};
|
|
319
|
-
},
|
|
481
|
+
}, ne = (e, a) => e.sortColumnKey === a.sortColumnKey && e.sortColumnOrder === a.sortColumnOrder && e.pageSize === a.pageSize && e.fitToContent === a.fitToContent, Je = ({
|
|
320
482
|
headers: e,
|
|
321
|
-
pageSize:
|
|
483
|
+
pageSize: a,
|
|
322
484
|
tableConfig: t,
|
|
323
485
|
emitTableConfigUpdate: l,
|
|
324
|
-
onExternalConfigChange:
|
|
486
|
+
onExternalConfigChange: n
|
|
325
487
|
}) => {
|
|
326
|
-
const
|
|
327
|
-
|
|
488
|
+
const o = u(() => t.value ? H({ config: t.value, headers: e.value, pageSize: a.value }) : void 0), c = M(
|
|
489
|
+
o.value ?? H({ config: void 0, headers: e.value, pageSize: a.value })
|
|
328
490
|
);
|
|
329
|
-
A(
|
|
330
|
-
|
|
491
|
+
A(o, (b) => {
|
|
492
|
+
b && !ne(b, c.value) && (c.value = b, n?.(b));
|
|
331
493
|
});
|
|
332
|
-
const p = (
|
|
333
|
-
const
|
|
334
|
-
config: { ...
|
|
494
|
+
const p = (b) => {
|
|
495
|
+
const S = H({
|
|
496
|
+
config: { ...c.value, ...b },
|
|
335
497
|
headers: e.value,
|
|
336
|
-
pageSize:
|
|
498
|
+
pageSize: a.value
|
|
337
499
|
});
|
|
338
|
-
|
|
339
|
-
},
|
|
340
|
-
sortColumnKey:
|
|
341
|
-
sortColumnOrder:
|
|
342
|
-
})),
|
|
500
|
+
ne(S, c.value) || (c.value = S, l(S));
|
|
501
|
+
}, s = u(() => ({
|
|
502
|
+
sortColumnKey: c.value.sortColumnKey,
|
|
503
|
+
sortColumnOrder: c.value.sortColumnOrder
|
|
504
|
+
})), v = u(() => t.value?.pageSize ?? a.value);
|
|
343
505
|
return {
|
|
344
|
-
activeTableConfig:
|
|
345
|
-
activeSort:
|
|
346
|
-
activePageSize:
|
|
506
|
+
activeTableConfig: W(c),
|
|
507
|
+
activeSort: s,
|
|
508
|
+
activePageSize: v,
|
|
347
509
|
patchTableConfig: p
|
|
348
510
|
};
|
|
349
|
-
},
|
|
511
|
+
}, Xe = ({
|
|
350
512
|
cellClick: e,
|
|
351
|
-
headers:
|
|
513
|
+
headers: a,
|
|
352
514
|
rowClick: t
|
|
353
515
|
}) => {
|
|
354
|
-
const l =
|
|
355
|
-
|
|
356
|
-
)),
|
|
357
|
-
const
|
|
358
|
-
return
|
|
359
|
-
},
|
|
360
|
-
const
|
|
361
|
-
return !!(
|
|
516
|
+
const l = u(() => new Set(
|
|
517
|
+
a.value.filter((s) => s.disableRowClick).map((s) => s.key)
|
|
518
|
+
)), n = (s) => {
|
|
519
|
+
const v = s.event?.target;
|
|
520
|
+
return v instanceof Element ? v.closest(".ag-cell")?.getAttribute("col-id") ?? void 0 : void 0;
|
|
521
|
+
}, o = (s) => {
|
|
522
|
+
const v = n(s);
|
|
523
|
+
return !!(v && l.value.has(v));
|
|
362
524
|
};
|
|
363
525
|
return {
|
|
364
|
-
onCellClick: (
|
|
365
|
-
const
|
|
366
|
-
!
|
|
367
|
-
columnKey:
|
|
368
|
-
row:
|
|
369
|
-
value:
|
|
526
|
+
onCellClick: (s) => {
|
|
527
|
+
const v = s.colDef.colId;
|
|
528
|
+
!s.data || !v || e({
|
|
529
|
+
columnKey: v,
|
|
530
|
+
row: s.data,
|
|
531
|
+
value: s.value
|
|
370
532
|
});
|
|
371
533
|
},
|
|
372
|
-
onRowClick: (
|
|
373
|
-
|
|
534
|
+
onRowClick: (s) => {
|
|
535
|
+
s.data && !o(s) && t(s.data, s);
|
|
374
536
|
}
|
|
375
537
|
};
|
|
376
|
-
},
|
|
538
|
+
}, Ye = ({
|
|
377
539
|
activeSort: e,
|
|
378
|
-
emitSort:
|
|
540
|
+
emitSort: a,
|
|
379
541
|
patchTableConfig: t
|
|
380
542
|
}) => {
|
|
381
|
-
const l = (
|
|
382
|
-
|
|
383
|
-
state:
|
|
543
|
+
const l = (o, c) => {
|
|
544
|
+
o.applyColumnState({
|
|
545
|
+
state: c.sortColumnKey ? [{ colId: c.sortColumnKey, sort: c.sortColumnOrder ?? null, sortIndex: 0 }] : [],
|
|
384
546
|
defaultState: { sort: null, sortIndex: null }
|
|
385
547
|
});
|
|
386
548
|
};
|
|
387
|
-
return { onSortChanged: (
|
|
388
|
-
const
|
|
389
|
-
|
|
549
|
+
return { onSortChanged: (o) => {
|
|
550
|
+
const c = o.api.getColumnState().filter((v) => v.sort).sort((v, b) => (v.sortIndex ?? 0) - (b.sortIndex ?? 0)), p = c[c.length - 1], s = p ? { sortColumnKey: p.colId, sortColumnOrder: p.sort } : { sortColumnKey: void 0, sortColumnOrder: void 0 };
|
|
551
|
+
s.sortColumnKey === e.value.sortColumnKey && s.sortColumnOrder === e.value.sortColumnOrder || (a(s), t(s), c.length > 1 && l(o.api, s));
|
|
390
552
|
}, applySortToGrid: l };
|
|
391
|
-
},
|
|
392
|
-
emptyState:
|
|
393
|
-
errorState:
|
|
553
|
+
}, Ze = { title: "No Data", message: "There is no data to display." }, et = { title: "An error occurred", message: "Data cannot be displayed due to an error." }, tt = {
|
|
554
|
+
emptyState: Ze,
|
|
555
|
+
errorState: et
|
|
394
556
|
};
|
|
395
|
-
function
|
|
396
|
-
const e =
|
|
557
|
+
function at() {
|
|
558
|
+
const e = xe("en-us", tt);
|
|
397
559
|
return {
|
|
398
560
|
i18n: e,
|
|
399
|
-
i18nT:
|
|
561
|
+
i18nT: Fe(e)
|
|
400
562
|
// Translation component <i18n-t>
|
|
401
563
|
};
|
|
402
564
|
}
|
|
403
|
-
const
|
|
404
|
-
class: "kong-ui-public-table-data-grid",
|
|
405
|
-
"data-testid": "table-data-grid"
|
|
406
|
-
}, Ge = {
|
|
565
|
+
const lt = {
|
|
407
566
|
key: 0,
|
|
408
567
|
class: "table-error-state",
|
|
409
568
|
"data-testid": "table-error-state"
|
|
410
|
-
},
|
|
569
|
+
}, ot = {
|
|
411
570
|
key: 1,
|
|
412
571
|
class: "table-empty-state",
|
|
413
572
|
"data-testid": "table-empty-state"
|
|
414
|
-
},
|
|
573
|
+
}, nt = /* @__PURE__ */ re({
|
|
415
574
|
__name: "TableDataGrid",
|
|
416
575
|
props: {
|
|
417
576
|
headers: {},
|
|
@@ -424,105 +583,124 @@ const xe = {
|
|
|
424
583
|
rows: {}
|
|
425
584
|
},
|
|
426
585
|
emits: ["grid:ready", "state", "row:click", "cell:click", "sort", "update:tableConfig"],
|
|
427
|
-
setup(e, { emit:
|
|
428
|
-
|
|
429
|
-
const t = e.mode ?? "infinite", l =
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
586
|
+
setup(e, { emit: a }) {
|
|
587
|
+
we.registerModules([De, Re, Te]);
|
|
588
|
+
const t = e.mode ?? "infinite", l = a, { i18n: n } = at(), { t: o } = n, c = be(), p = _(), s = ye("rootElement"), v = _("body"), b = () => {
|
|
589
|
+
const y = document.fullscreenElement;
|
|
590
|
+
v.value = y instanceof HTMLElement && y.contains(s.value ?? null) ? y : "body";
|
|
591
|
+
};
|
|
592
|
+
se(() => {
|
|
593
|
+
b(), document.addEventListener("fullscreenchange", b);
|
|
594
|
+
}), Se(() => {
|
|
595
|
+
document.removeEventListener("fullscreenchange", b);
|
|
596
|
+
});
|
|
597
|
+
const { activeTableConfig: S, activeSort: T, activePageSize: w, patchTableConfig: R } = Je({
|
|
598
|
+
headers: z(() => e.headers),
|
|
599
|
+
pageSize: z(() => e.pageSize),
|
|
600
|
+
tableConfig: z(() => e.tableConfig),
|
|
601
|
+
emitTableConfigUpdate: (y) => l("update:tableConfig", y),
|
|
602
|
+
onExternalConfigChange: (y) => {
|
|
603
|
+
p.value && i(p.value, y);
|
|
436
604
|
}
|
|
437
|
-
}), { onSortChanged:
|
|
438
|
-
activeSort:
|
|
439
|
-
emitSort: (
|
|
440
|
-
patchTableConfig:
|
|
441
|
-
}), { onCellClick:
|
|
442
|
-
cellClick: (
|
|
443
|
-
headers:
|
|
444
|
-
rowClick: (
|
|
445
|
-
}),
|
|
605
|
+
}), { onSortChanged: G, applySortToGrid: i } = Ye({
|
|
606
|
+
activeSort: T,
|
|
607
|
+
emitSort: (y) => l("sort", y),
|
|
608
|
+
patchTableConfig: R
|
|
609
|
+
}), C = u(() => t === "unpaginated" && !!S.value.fitToContent), { onCellClick: m, onRowClick: K } = Xe({
|
|
610
|
+
cellClick: (y) => l("cell:click", y),
|
|
611
|
+
headers: z(() => e.headers),
|
|
612
|
+
rowClick: (y, Y) => l("row:click", y, Y)
|
|
613
|
+
}), F = {
|
|
446
614
|
resizable: !1,
|
|
447
615
|
sortable: !1,
|
|
448
616
|
suppressMovable: !0
|
|
449
|
-
},
|
|
450
|
-
|
|
617
|
+
}, O = u(() => S.value.sortColumnKey), x = u(() => S.value.sortColumnOrder), N = u(() => [
|
|
618
|
+
w.value,
|
|
451
619
|
e.refreshKey,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
]),
|
|
455
|
-
fetcher:
|
|
456
|
-
resetKey:
|
|
457
|
-
sort:
|
|
458
|
-
}) : void 0,
|
|
459
|
-
headers:
|
|
460
|
-
|
|
461
|
-
|
|
620
|
+
O.value,
|
|
621
|
+
x.value
|
|
622
|
+
]), d = t === "infinite" ? Ne({
|
|
623
|
+
fetcher: z(() => e.fetcher),
|
|
624
|
+
resetKey: N,
|
|
625
|
+
sort: T
|
|
626
|
+
}) : void 0, f = d?.datasource, h = u(() => d ? d.data.value : e.rows), r = u(() => d?.isFetching.value ?? !1), g = u(() => e.rows ? Array.from(e.rows) : void 0), { columnDefs: D, gridContext: B } = Qe({
|
|
627
|
+
headers: z(() => e.headers),
|
|
628
|
+
locale: u(() => n.locale),
|
|
629
|
+
mode: t,
|
|
630
|
+
rows: g,
|
|
631
|
+
slots: c,
|
|
632
|
+
tooltipTarget: v,
|
|
633
|
+
initialSort: T.value
|
|
462
634
|
}), {
|
|
463
|
-
fetchState:
|
|
464
|
-
hasData:
|
|
465
|
-
state:
|
|
466
|
-
} =
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
),
|
|
471
|
-
|
|
472
|
-
emitState: (
|
|
473
|
-
fetchLifecycleState:
|
|
474
|
-
hasData:
|
|
635
|
+
fetchState: U,
|
|
636
|
+
hasData: L,
|
|
637
|
+
state: X
|
|
638
|
+
} = Ie(
|
|
639
|
+
h,
|
|
640
|
+
z(() => d?.error.value),
|
|
641
|
+
r
|
|
642
|
+
), ve = u(() => X.value === U.SUCCESS && !L.value);
|
|
643
|
+
d && Ke({
|
|
644
|
+
emitState: (y) => l("state", y),
|
|
645
|
+
fetchLifecycleState: X,
|
|
646
|
+
hasData: L
|
|
475
647
|
});
|
|
476
|
-
const
|
|
477
|
-
|
|
648
|
+
const me = (y) => {
|
|
649
|
+
p.value = y.api, l("grid:ready", y.api);
|
|
478
650
|
};
|
|
479
|
-
return (
|
|
480
|
-
const
|
|
481
|
-
return
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
651
|
+
return (y, Y) => {
|
|
652
|
+
const Z = ie("KEmptyState");
|
|
653
|
+
return E(), I("div", {
|
|
654
|
+
ref_key: "rootElement",
|
|
655
|
+
ref: s,
|
|
656
|
+
class: ue(["kong-ui-public-table-data-grid", { "fit-to-content": C.value }]),
|
|
657
|
+
"data-testid": "table-data-grid"
|
|
658
|
+
}, [
|
|
659
|
+
e.error ? (E(), I("div", lt, [
|
|
660
|
+
j(y.$slots, "error-state", {}, () => [
|
|
661
|
+
J(Z, {
|
|
485
662
|
"icon-variant": "error",
|
|
486
|
-
message:
|
|
487
|
-
title:
|
|
663
|
+
message: k(o)("errorState.message"),
|
|
664
|
+
title: k(o)("errorState.title")
|
|
488
665
|
}, null, 8, ["message", "title"])
|
|
489
666
|
], !0)
|
|
490
|
-
])) :
|
|
491
|
-
j(
|
|
492
|
-
|
|
493
|
-
message:
|
|
494
|
-
title:
|
|
667
|
+
])) : ve.value ? (E(), I("div", ot, [
|
|
668
|
+
j(y.$slots, "empty-state", {}, () => [
|
|
669
|
+
J(Z, {
|
|
670
|
+
message: k(o)("emptyState.message"),
|
|
671
|
+
title: k(o)("emptyState.title")
|
|
495
672
|
}, null, 8, ["message", "title"])
|
|
496
673
|
], !0)
|
|
497
|
-
])) : (
|
|
674
|
+
])) : (E(), Q(k(ke), {
|
|
498
675
|
key: 2,
|
|
499
|
-
"cache-block-size":
|
|
676
|
+
"cache-block-size": k(t) === "infinite" ? k(w) : void 0,
|
|
500
677
|
class: "table-data-grid-grid",
|
|
501
|
-
"column-defs":
|
|
502
|
-
context:
|
|
503
|
-
datasource:
|
|
504
|
-
"default-col-def":
|
|
505
|
-
"
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
"row-
|
|
678
|
+
"column-defs": k(D),
|
|
679
|
+
context: k(B),
|
|
680
|
+
datasource: k(t) === "infinite" ? k(f) : void 0,
|
|
681
|
+
"default-col-def": F,
|
|
682
|
+
"dom-layout": C.value ? "autoHeight" : "normal",
|
|
683
|
+
"infinite-initial-row-count": k(t) === "infinite" ? 1 : void 0,
|
|
684
|
+
loading: r.value,
|
|
685
|
+
"row-data": k(t) === "unpaginated" ? g.value : void 0,
|
|
686
|
+
"row-model-type": k(t) === "unpaginated" ? "clientSide" : "infinite",
|
|
509
687
|
"suppress-cell-focus": !0,
|
|
510
688
|
"suppress-multi-sort": !0,
|
|
511
|
-
theme:
|
|
512
|
-
onCellClicked:
|
|
513
|
-
onGridReady:
|
|
514
|
-
onRowClicked:
|
|
515
|
-
onSortChanged:
|
|
516
|
-
}, null, 8, ["cache-block-size", "column-defs", "context", "datasource", "infinite-initial-row-count", "loading", "row-data", "row-model-type", "theme", "onCellClicked", "onRowClicked", "onSortChanged"]))
|
|
517
|
-
]);
|
|
689
|
+
theme: k(Ee),
|
|
690
|
+
onCellClicked: k(m),
|
|
691
|
+
onGridReady: me,
|
|
692
|
+
onRowClicked: k(K),
|
|
693
|
+
onSortChanged: k(G)
|
|
694
|
+
}, null, 8, ["cache-block-size", "column-defs", "context", "datasource", "dom-layout", "infinite-initial-row-count", "loading", "row-data", "row-model-type", "theme", "onCellClicked", "onRowClicked", "onSortChanged"]))
|
|
695
|
+
], 2);
|
|
518
696
|
};
|
|
519
697
|
}
|
|
520
|
-
}),
|
|
698
|
+
}), rt = (e, a) => {
|
|
521
699
|
const t = e.__vccOpts || e;
|
|
522
|
-
for (const [l,
|
|
523
|
-
t[l] =
|
|
700
|
+
for (const [l, n] of a)
|
|
701
|
+
t[l] = n;
|
|
524
702
|
return t;
|
|
525
|
-
},
|
|
703
|
+
}, dt = /* @__PURE__ */ rt(nt, [["__scopeId", "data-v-29905891"]]);
|
|
526
704
|
export {
|
|
527
|
-
|
|
705
|
+
dt as TableDataGrid
|
|
528
706
|
};
|