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