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