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