@epam/ai-dial-ui-kit 0.16.0-dev.49 → 0.16.0-dev.50

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,172 +1,176 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { themeBalham as Ae, colorSchemeDark as De, colorSchemeLight as Ge } from "../../../node_modules/ag-grid-community/dist/package/main.esm.js";
3
- import { AgGridReact as Le } from "../../../node_modules/ag-grid-react/dist/package/index.esm.js";
4
- import { IconZoomCancel as be } from "@tabler/icons-react";
5
- import { useState as we, useRef as b, useId as Oe, useCallback as s, useMemo as m, useEffect as g } from "react";
6
- import { useIsMobileScreen as ye } from "../../../hooks/use-is-mobile-screen.js";
2
+ import { themeBalham as Te, colorSchemeDark as Ge, colorSchemeLight as Le } from "../../../node_modules/ag-grid-community/dist/package/main.esm.js";
3
+ import { AgGridReact as be } from "../../../node_modules/ag-grid-react/dist/package/index.esm.js";
4
+ import { IconZoomCancel as we } from "@tabler/icons-react";
5
+ import { useState as Oe, useRef as b, useId as ye, useCallback as s, useMemo as m, useEffect as _ } from "react";
6
+ import { useIsMobileScreen as He } from "../../../hooks/use-is-mobile-screen.js";
7
7
  import { useIsTabletScreen as ve } from "../../../hooks/use-is-tablet-screen.js";
8
- import { GridSelectionMode as Y } from "../../../models/selection-mode.js";
9
- import { DropdownTrigger as He } from "../../../types/dropdown.js";
10
- import { GridAppearance as ee, GridColorScheme as re } from "../../../types/grid.js";
8
+ import { GridSelectionMode as ee } from "../../../models/selection-mode.js";
9
+ import { DropdownTrigger as xe } from "../../../types/dropdown.js";
10
+ import { GridAppearance as re, GridColorScheme as te } from "../../../types/grid.js";
11
11
  import { debounceFn as ke } from "../../../utils/debounce.js";
12
- import { baseColumnComparator as xe, omitUndefined as We } from "../../../utils/grid-comparators.js";
13
- import { registerAgGridModulesOnce as ze } from "../../../utils/grid-registration.js";
14
- import { mergeClasses as te } from "../../../utils/merge-classes.js";
15
- import { Dropdown as Pe } from "../Dropdown/Dropdown.js";
12
+ import { baseColumnComparator as We, omitUndefined as ze } from "../../../utils/grid-comparators.js";
13
+ import { registerAgGridModulesOnce as Pe } from "../../../utils/grid-registration.js";
14
+ import { mergeClasses as w } from "../../../utils/merge-classes.js";
15
+ import { Dropdown as Ue } from "../Dropdown/Dropdown.js";
16
16
  import { EllipsisTooltip as Fe } from "../EllipsisTooltip/EllipsisTooltip.js";
17
- import { NoDataContent as Ue } from "../NoDataContent/NoDataContent.js";
17
+ import { NoDataContent as Me } from "../NoDataContent/NoDataContent.js";
18
18
  import { SelectionCell as Be } from "./components/SelectionCell.js";
19
- import { SelectionHeader as Me } from "./components/SelectionHeader.js";
20
- import { GRID_THEME_PARAMS as w, SelectionEventSourceType as S, GRID_ROW_SELECT_CLASS as Ve, GRID_HEADER_SELECT_CLASS as je, ROW_HEIGHT as oe, GRID_CHAT_CLASS as Je, GRID_WITHOUT_HEADER_BORDERS_CLASS as Ze, GRID_SELECTION_VISIBLE_CLASS as $e, GRID_WITH_SELECTION_CLASS as qe, GRID_ROOT_CLASS as Ke } from "./constants.js";
19
+ import { SelectionHeader as Ve } from "./components/SelectionHeader.js";
20
+ import { GRID_THEME_PARAMS as O, SelectionEventSourceType as p, GRID_ROW_SELECT_CLASS as je, GRID_HEADER_SELECT_CLASS as Je, ROW_HEIGHT as oe, GRID_CHAT_CLASS as Ye, GRID_WITHOUT_HEADER_BORDERS_CLASS as Ze, GRID_SELECTION_VISIBLE_CLASS as $e, GRID_WITH_SELECTION_CLASS as qe, GRID_ROOT_CLASS as Ke } from "./constants.js";
21
21
  import { SELECTION_COL_DEF as Qe } from "./renderers/constants.js";
22
- const Xe = "dial-kit-grid-selection", Ye = 150, er = 100, Nr = ({
23
- columnDefs: _,
24
- rowData: c,
25
- additionalGridOptions: O,
22
+ const Xe = "dial-kit-grid-selection", er = 150, rr = 100, tr = ["rightAligned", "numericColumn"], ne = (f) => [f?.type ?? []].flat().some((a) => tr.includes(a)), Ar = ({
23
+ columnDefs: f,
24
+ rowData: a,
25
+ additionalGridOptions: y,
26
26
  getContextMenuItems: N,
27
- className: ne,
28
- ariaLabel: ie = "Data grid",
27
+ className: ie,
28
+ ariaLabel: se = "Data grid",
29
29
  wrapCustomCellRenderers: I = !0,
30
- disabledRowIds: p,
31
- selectedRowIds: l,
32
- onSelectionChange: y,
33
- onGridApiChange: se,
30
+ disabledRowIds: C,
31
+ selectedRowIds: c,
32
+ onSelectionChange: H,
33
+ onGridApiChange: ae,
34
34
  getRowId: v,
35
- alternateOddRowColors: H = !1,
35
+ alternateOddRowColors: x = !1,
36
36
  filterPlaceholder: k = "Enter value",
37
- emptyStateIcon: x,
38
- emptyStateTitle: W = "No results found",
39
- emptyStateDescription: z = "Sorry, we couldn't find any results for your search.",
40
- loading: P = !1,
37
+ emptyStateIcon: W,
38
+ emptyStateTitle: z = "No results found",
39
+ emptyStateDescription: P = "Sorry, we couldn't find any results for your search.",
40
+ loading: U = !1,
41
41
  wrapperBorder: F = !0,
42
- withoutHeaderBorders: ae = !1,
43
- allowDisabledContextMenu: U = !1,
42
+ withoutHeaderBorders: le = !1,
43
+ allowDisabledContextMenu: M = !1,
44
44
  selectionMode: n,
45
45
  selectRowLabel: B,
46
- selectAllLabel: M = "Select all rows",
47
- colorScheme: T = re.Light,
48
- appearance: le = ee.Default
46
+ selectAllLabel: V = "Select all rows",
47
+ colorScheme: A = te.Light,
48
+ appearance: ce = re.Default
49
49
  }) => {
50
- ze();
51
- const [t, ce] = we(), de = ye(), ue = ve(), A = b(/* @__PURE__ */ new Set()), V = b(
50
+ Pe();
51
+ const [t, de] = Oe(), ue = He(), me = ve(), D = b(/* @__PURE__ */ new Set()), j = b(
52
52
  void 0
53
- ), j = `dial-kit-grid-selection-${Oe()}`, d = b({
53
+ ), J = `dial-kit-grid-selection-${ye()}`, d = b({
54
54
  getRowId: v,
55
55
  getContextMenuItems: N,
56
- onSelectionChange: y,
56
+ onSelectionChange: H,
57
57
  selectRowLabel: B,
58
58
  wrapCustomCellRenderers: I
59
59
  });
60
60
  d.current = {
61
61
  getRowId: v,
62
62
  getContextMenuItems: N,
63
- onSelectionChange: y,
63
+ onSelectionChange: H,
64
64
  selectRowLabel: B,
65
65
  wrapCustomCellRenderers: I
66
66
  };
67
- const a = s((e) => {
67
+ const l = s((e) => {
68
68
  const r = d.current.getRowId;
69
69
  return r ? r(e) : String(e.id ?? JSON.stringify(e));
70
- }, []), J = !!N, Z = !!I, D = le === ee.Chat, me = m(
71
- () => Ae.withPart(
72
- T === re.Dark ? De : Ge
70
+ }, []), Y = !!N, Z = !!I, T = ce === re.Chat, fe = m(
71
+ () => Te.withPart(
72
+ A === te.Dark ? Ge : Le
73
73
  ).withParams({
74
- ...w,
74
+ ...O,
75
75
  // The shared params pin `browserColorScheme` to light and are applied
76
76
  // after the part, so the chosen scheme is set again here.
77
- browserColorScheme: T,
78
- oddRowBackgroundColor: H ? w.oddRowBackgroundColor : w.backgroundColor,
77
+ browserColorScheme: A,
78
+ oddRowBackgroundColor: x ? O.oddRowBackgroundColor : O.backgroundColor,
79
79
  // The Chat table is a borderless card whose row dividers stop at the
80
80
  // cell padding, so `styles/grid.scss` draws them instead. Its header
81
81
  // and row cells take 12px on each side, not Balham's 8px.
82
- ...D ? {
82
+ ...T ? {
83
83
  wrapperBorder: !1,
84
84
  rowBorder: !1,
85
85
  cellHorizontalPadding: 12
86
86
  } : { wrapperBorder: F }
87
87
  }),
88
- [H, T, F, D]
89
- ), fe = s((e) => {
88
+ [x, A, F, T]
89
+ ), Se = s((e) => {
90
90
  e.api.sizeColumnsToFit();
91
- }, []), Se = de || ue || (l?.size ?? 0) > 0, u = s(
92
- (e) => !!e && !!p?.has(a(e)),
93
- [p, a]
94
- ), C = s(
95
- (e, r, i) => J ? /* @__PURE__ */ o(
96
- Pe,
91
+ }, []), pe = ue || me || (c?.size ?? 0) > 0, u = s(
92
+ (e) => !!e && !!C?.has(l(e)),
93
+ [C, l]
94
+ ), h = s(
95
+ (e, r, i) => Y ? /* @__PURE__ */ o(
96
+ Ue,
97
97
  {
98
- trigger: [He.ContextMenu],
98
+ trigger: [xe.ContextMenu],
99
99
  items: e.data ? d.current.getContextMenuItems?.(e.data) ?? [] : [],
100
100
  anchorToMouse: !0,
101
101
  matchReferenceWidth: !0,
102
- className: te(
102
+ className: w(
103
103
  "size-full",
104
- i && "cursor-not-allowed opacity-75"
104
+ i && "cursor-not-allowed opacity-75",
105
+ ne(e.colDef) && "text-end"
105
106
  ),
106
- disabled: i && !U,
107
+ disabled: i && !M,
107
108
  children: /* @__PURE__ */ o("span", { className: "block min-w-0 max-w-full flex-1", children: r })
108
109
  }
109
110
  ) : r,
110
- [J, U]
111
+ [Y, M]
111
112
  ), G = s(
112
113
  (e) => {
113
114
  if (!e.data) return null;
114
115
  const r = u(e.data);
115
- return C(
116
+ return h(
116
117
  e,
117
118
  /* @__PURE__ */ o(
118
119
  Fe,
119
120
  {
120
121
  text: e.value == null ? "" : String(e.value),
121
- className: "max-w-full dial-small-text text-primary",
122
+ className: w(
123
+ "max-w-full dial-small-text text-primary",
124
+ ne(e.colDef) && "text-end"
125
+ ),
122
126
  hideTooltip: r
123
127
  }
124
128
  ),
125
129
  r
126
130
  );
127
131
  },
128
- [u, C]
129
- ), h = s(
130
- (e) => e === S.API || e === S.ROW_DATA_CHANGED,
132
+ [u, h]
133
+ ), R = s(
134
+ (e) => e === p.API || e === p.ROW_DATA_CHANGED,
131
135
  []
132
- ), pe = m(
136
+ ), Ce = m(
133
137
  () => ke((e) => {
134
- const i = (e.selectedNodes ?? []).map((Q) => Q.data), f = new Set(i.map(a));
135
- A.current = f, V.current = e.source, !h(e.source) && d.current.onSelectionChange?.(f, i);
136
- }, er),
137
- [h, a]
138
+ const i = (e.selectedNodes ?? []).map((Q) => Q.data), S = new Set(i.map(l));
139
+ D.current = S, j.current = e.source, !R(e.source) && d.current.onSelectionChange?.(S, i);
140
+ }, rr),
141
+ [R, l]
138
142
  ), L = m(() => {
139
143
  if (n)
140
144
  return {
141
145
  ...Qe,
142
146
  colId: Xe,
143
147
  headerName: "",
144
- headerClass: je,
145
- cellClass: Ve,
146
- headerComponent: n === Y.MULTIPLE ? Me : void 0,
147
- headerComponentParams: { label: M },
148
+ headerClass: Je,
149
+ cellClass: je,
150
+ headerComponent: n === ee.MULTIPLE ? Ve : void 0,
151
+ headerComponentParams: { label: V },
148
152
  cellRenderer: (e) => {
149
153
  if (!e.data) return null;
150
- const r = a(e.data);
154
+ const r = l(e.data);
151
155
  return /* @__PURE__ */ o(
152
156
  Be,
153
157
  {
154
158
  params: e,
155
159
  mode: n,
156
160
  rowId: r,
157
- radioName: j,
161
+ radioName: J,
158
162
  label: d.current.selectRowLabel?.(e.data) ?? "Select row",
159
- disabled: p?.has(r)
163
+ disabled: C?.has(r)
160
164
  }
161
165
  );
162
166
  }
163
167
  };
164
168
  }, [
165
169
  n,
166
- M,
167
- a,
168
- p,
169
- j
170
+ V,
171
+ l,
172
+ C,
173
+ J
170
174
  ]), $ = s(
171
175
  (e) => {
172
176
  if (!e.cellRenderer)
@@ -174,23 +178,23 @@ const Xe = "dial-kit-grid-selection", Ye = 150, er = 100, Nr = ({
174
178
  const r = d.current.wrapCustomCellRenderers;
175
179
  if (!(typeof r == "function" ? r(e) : !!r))
176
180
  return e;
177
- const f = e.cellRenderer;
181
+ const S = e.cellRenderer;
178
182
  return { ...e, cellRenderer: (E) => {
179
- const Ie = u(E.data), X = typeof f == "function" ? f : void 0, Te = X ? /* @__PURE__ */ o(X, { ...E }) : G(E);
180
- return C(E, Te, Ie);
183
+ const Ae = u(E.data), X = typeof S == "function" ? S : void 0, De = X ? /* @__PURE__ */ o(X, { ...E }) : G(E);
184
+ return h(E, De, Ae);
181
185
  } };
182
186
  },
183
- [u, G, C]
184
- ), Ce = m(() => {
185
- const e = Z ? (_ ?? []).map($) : _ ?? [];
187
+ [u, G, h]
188
+ ), he = m(() => {
189
+ const e = Z ? (f ?? []).map($) : f ?? [];
186
190
  return L ? [L, ...e] : e;
187
- }, [_, Z, $, L]), {
191
+ }, [f, Z, $, L]), {
188
192
  defaultColDef: q,
189
- rowSelection: R,
190
- ...he
191
- } = O ?? {}, Re = m(
193
+ rowSelection: g,
194
+ ...Re
195
+ } = y ?? {}, ge = m(
192
196
  () => ({
193
- minWidth: Ye,
197
+ minWidth: er,
194
198
  resizable: !0,
195
199
  sortable: !0,
196
200
  floatingFilter: !0,
@@ -199,28 +203,28 @@ const Xe = "dial-kit-grid-selection", Ye = 150, er = 100, Nr = ({
199
203
  filterPlaceholder: k,
200
204
  buttons: ["reset"]
201
205
  },
202
- comparator: xe,
203
- ...We(q)
206
+ comparator: We,
207
+ ...ze(q)
204
208
  }),
205
209
  [k, q]
206
210
  ), Ee = (e) => {
207
- e.api.sizeColumnsToFit(), ce(e.api), O?.onGridReady?.(e), se?.(e.api);
211
+ e.api.sizeColumnsToFit(), de(e.api), y?.onGridReady?.(e), ae?.(e.api);
208
212
  };
209
- g(() => {
210
- t && c && t.setGridOption("rowData", c);
211
- }, [t, c]);
212
- const ge = s(
213
+ _(() => {
214
+ t && a && t.setGridOption("rowData", a);
215
+ }, [t, a]);
216
+ const _e = s(
213
217
  () => /* @__PURE__ */ o(
214
- Ue,
218
+ Me,
215
219
  {
216
220
  live: !0,
217
- title: W,
218
- description: z,
219
- icon: x ?? /* @__PURE__ */ o(be, { size: 100, stroke: 0.5, "aria-hidden": "true" })
221
+ title: z,
222
+ description: P,
223
+ icon: W ?? /* @__PURE__ */ o(we, { size: 100, stroke: 0.5, "aria-hidden": "true" })
220
224
  }
221
225
  ),
222
- [W, z, x]
223
- ), K = typeof R == "object" ? R : void 0, _e = m(() => n ? {
226
+ [z, P, W]
227
+ ), K = typeof g == "object" ? g : void 0, Ne = m(() => n ? {
224
228
  isRowSelectable: (e) => !u(e.data),
225
229
  /*
226
230
  Merged, not replaced, the way `defaultColDef` is: a consumer reaching
@@ -232,80 +236,80 @@ const Xe = "dial-kit-grid-selection", Ye = 150, er = 100, Nr = ({
232
236
  `selectionMode` owns the mode, because it also decides whether the
233
237
  selection column draws checkboxes or radios.
234
238
  */
235
- mode: n === Y.SINGLE ? "singleRow" : "multiRow",
239
+ mode: n === ee.SINGLE ? "singleRow" : "multiRow",
236
240
  // The controls live in this component's own selection column, so
237
241
  // ag-Grid's inputs are switched off and only its behaviour is used.
238
242
  checkboxes: !1,
239
243
  headerCheckbox: !1
240
- } : R, [
241
- R,
244
+ } : g, [
245
+ g,
242
246
  K,
243
247
  u,
244
248
  n
245
249
  ]);
246
- g(() => {
247
- t && c && A.current.size && A.current.forEach((e) => {
250
+ _(() => {
251
+ t && a && D.current.size && D.current.forEach((e) => {
248
252
  const r = t.getRowNode(e);
249
- r && !r.isSelected() && r.setSelected(!0, !1, S.API);
253
+ r && !r.isSelected() && r.setSelected(!0, !1, p.API);
250
254
  });
251
- }, [t, c]), g(() => {
252
- t && l && (t.deselectAll("all", S.API), l.forEach((e) => {
255
+ }, [t, a]), _(() => {
256
+ t && c && (t.deselectAll("all", p.API), c.forEach((e) => {
253
257
  const r = t.getRowNode(e);
254
- r && !r.isSelected() && r.setSelected(!0, !1, S.API);
258
+ r && !r.isSelected() && r.setSelected(!0, !1, p.API);
255
259
  }));
256
- }, [t, l]);
257
- const Ne = s(
258
- (e) => e.data ? a(e.data) : "",
259
- [a]
260
+ }, [t, c]);
261
+ const Ie = s(
262
+ (e) => e.data ? l(e.data) : "",
263
+ [l]
260
264
  );
261
- return g(() => {
262
- const e = h(
263
- V.current
265
+ return _(() => {
266
+ const e = R(
267
+ j.current
264
268
  );
265
- if (t && l?.size && e) {
266
- const r = Array.from(l)[0];
269
+ if (t && c?.size && e) {
270
+ const r = Array.from(c)[0];
267
271
  if (r) {
268
272
  const i = t.getRowNode(r);
269
273
  i && t.ensureNodeVisible(i);
270
274
  }
271
275
  }
272
- }, [t, h, l]), /* @__PURE__ */ o(
276
+ }, [t, R, c]), /* @__PURE__ */ o(
273
277
  "div",
274
278
  {
275
- className: te(
279
+ className: w(
276
280
  Ke,
277
281
  "size-full",
278
282
  n && qe,
279
- n && Se && $e,
280
- ae && Ze,
281
- D && Je,
282
- ne
283
+ n && pe && $e,
284
+ le && Ze,
285
+ T && Ye,
286
+ ie
283
287
  ),
284
288
  role: "region",
285
- "aria-label": ie,
286
- "aria-busy": P,
289
+ "aria-label": se,
290
+ "aria-busy": U,
287
291
  children: /* @__PURE__ */ o("div", { className: "h-full overflow-x-auto", children: /* @__PURE__ */ o(
288
- Le,
292
+ be,
289
293
  {
290
294
  rowModelType: "clientSide",
291
295
  headerHeight: oe,
292
296
  rowHeight: oe,
293
297
  cellSelection: !1,
294
- theme: me,
298
+ theme: fe,
295
299
  autoSizeStrategy: { type: "fitGridWidth" },
296
- columnDefs: Ce,
297
- defaultColDef: Re,
298
- onGridSizeChanged: fe,
300
+ columnDefs: he,
301
+ defaultColDef: ge,
302
+ onGridSizeChanged: Se,
299
303
  onGridReady: Ee,
300
- loading: P,
304
+ loading: U,
301
305
  suppressCellFocus: !0,
302
306
  suppressDragLeaveHidesColumns: !0,
303
- noRowsOverlayComponent: ge,
304
- rowData: c,
305
- rowSelection: _e,
306
- onSelectionChanged: pe,
307
- getRowId: Ne,
308
- ...he
307
+ noRowsOverlayComponent: _e,
308
+ rowData: a,
309
+ rowSelection: Ne,
310
+ onSelectionChanged: Ce,
311
+ getRowId: Ie,
312
+ ...Re
309
313
  }
310
314
  ) })
311
315
  }
@@ -313,5 +317,5 @@ const Xe = "dial-kit-grid-selection", Ye = 150, er = 100, Nr = ({
313
317
  };
314
318
  export {
315
319
  Xe as GRID_SELECTION_COLUMN_ID,
316
- Nr as Grid
320
+ Ar as Grid
317
321
  };
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.16.0-dev.49",
3
- "generatedAt": "2026-10-27T09:16:10.434Z",
2
+ "version": "0.16.0-dev.50",
3
+ "generatedAt": "2026-10-27T10:32:17.686Z",
4
4
  "kit": {
5
5
  "name": "@epam/ai-dial-ui-kit",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",