@rio-cloud/rio-uikit 2.3.0-beta.2 → 2.3.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.
Files changed (160) hide show
  1. package/Marker.js +9 -5
  2. package/Table.js +10 -9
  3. package/TableNext.js +10 -9
  4. package/TableRowActionsDropdown.d.ts +2 -0
  5. package/TableRowActionsDropdown.js +5 -0
  6. package/TableRowActionsDropdown.js.map +1 -0
  7. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.d.ts +38 -3
  8. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js +104 -109
  9. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js.map +1 -1
  10. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.d.ts +24 -5
  11. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js +60 -56
  12. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js.map +1 -1
  13. package/components/datepicker/DayPicker.js +72 -70
  14. package/components/datepicker/DayPicker.js.map +1 -1
  15. package/components/datepicker/DayPickerDropdown.d.ts +1 -0
  16. package/components/datepicker/DayPickerDropdown.js +61 -48
  17. package/components/datepicker/DayPickerDropdown.js.map +1 -1
  18. package/components/datepicker/useStackedDayPickerCalendars.js +26 -26
  19. package/components/datepicker/useStackedDayPickerCalendars.js.map +1 -1
  20. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  21. package/components/dropdown/ButtonDropdown.js +82 -80
  22. package/components/dropdown/ButtonDropdown.js.map +1 -1
  23. package/components/listMenu/ListMenu.d.ts +8 -0
  24. package/components/listMenu/ListMenu.js +74 -66
  25. package/components/listMenu/ListMenu.js.map +1 -1
  26. package/components/map/components/Map.js +207 -156
  27. package/components/map/components/Map.js.map +1 -1
  28. package/components/map/components/MapContext.d.ts +3 -0
  29. package/components/map/components/MapContext.js +9 -6
  30. package/components/map/components/MapContext.js.map +1 -1
  31. package/components/map/components/features/MapZoom.js +19 -19
  32. package/components/map/components/features/MapZoom.js.map +1 -1
  33. package/components/map/components/features/Route.d.ts +65 -1
  34. package/components/map/components/features/Route.js +184 -98
  35. package/components/map/components/features/Route.js.map +1 -1
  36. package/components/map/components/features/basics/Marker.d.ts +21 -1
  37. package/components/map/components/features/basics/Marker.js +99 -40
  38. package/components/map/components/features/basics/Marker.js.map +1 -1
  39. package/components/map/components/features/basics/Polygon.d.ts +24 -1
  40. package/components/map/components/features/basics/Polygon.js +72 -19
  41. package/components/map/components/features/basics/Polygon.js.map +1 -1
  42. package/components/map/components/features/basics/Polyline.d.ts +29 -0
  43. package/components/map/components/features/basics/Polyline.js +69 -39
  44. package/components/map/components/features/basics/Polyline.js.map +1 -1
  45. package/components/map/components/features/layers/MarkerLayer.js +8 -8
  46. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  47. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js +13 -6
  48. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  49. package/components/map/utils/clustering.d.ts +1 -1
  50. package/components/map/utils/clustering.js +30 -30
  51. package/components/map/utils/clustering.js.map +1 -1
  52. package/components/map/utils/mapTypes.d.ts +141 -0
  53. package/components/map/utils/mapTypes.js.map +1 -1
  54. package/components/map/utils/mapUtils.d.ts +2 -0
  55. package/components/map/utils/mapUtils.js +4 -0
  56. package/components/map/utils/mapUtils.js.map +1 -1
  57. package/components/mapMarker/ClusterMapMarker.d.ts +2 -0
  58. package/components/mapMarker/ClusterMapMarker.js.map +1 -1
  59. package/components/mapMarker/SingleMapMarker.d.ts +2 -0
  60. package/components/mapMarker/SingleMapMarker.js.map +1 -1
  61. package/components/selects/ClearButton.js +9 -7
  62. package/components/selects/ClearButton.js.map +1 -1
  63. package/components/table/Table.d.ts +3 -1
  64. package/components/table/Table.js +239 -216
  65. package/components/table/Table.js.map +1 -1
  66. package/components/table/Table.types.d.ts +62 -4
  67. package/components/table/TableColumn.d.ts +8 -1
  68. package/components/table/TableColumn.js +66 -64
  69. package/components/table/TableColumn.js.map +1 -1
  70. package/components/table/TableExpandedRow.d.ts +4 -0
  71. package/components/table/TableExpandedRow.js +70 -67
  72. package/components/table/TableExpandedRow.js.map +1 -1
  73. package/components/table/TableGroupRow.d.ts +3 -1
  74. package/components/table/TableGroupRow.js +15 -14
  75. package/components/table/TableGroupRow.js.map +1 -1
  76. package/components/table/TableHeader.d.ts +9 -0
  77. package/components/table/TableHeader.js +110 -81
  78. package/components/table/TableHeader.js.map +1 -1
  79. package/components/table/TableHeaderColumn.d.ts +11 -1
  80. package/components/table/TableHeaderColumn.js +63 -58
  81. package/components/table/TableHeaderColumn.js.map +1 -1
  82. package/components/table/TableRow.d.ts +12 -0
  83. package/components/table/TableRow.js +78 -74
  84. package/components/table/TableRow.js.map +1 -1
  85. package/components/table/TableRowActionsDropdown.d.ts +11 -0
  86. package/components/table/TableRowActionsDropdown.js +22 -0
  87. package/components/table/TableRowActionsDropdown.js.map +1 -0
  88. package/components/table/TableStickyRowButton.d.ts +25 -0
  89. package/components/table/TableStickyRowButton.js +32 -0
  90. package/components/table/TableStickyRowButton.js.map +1 -0
  91. package/components/table/TableToolbar.d.ts +24 -3
  92. package/components/table/TableToolbar.js +78 -37
  93. package/components/table/TableToolbar.js.map +1 -1
  94. package/components/table/TableViewToggles.js +5 -5
  95. package/components/table/TableViewToggles.js.map +1 -1
  96. package/components/table/context/TableInteractionContext.d.ts +3 -0
  97. package/components/table/context/TableInteractionContext.js.map +1 -1
  98. package/components/table/context/TableLayoutContext.d.ts +1 -0
  99. package/components/table/context/TableLayoutContext.js.map +1 -1
  100. package/components/table/context/TableRenderContext.d.ts +1 -0
  101. package/components/table/context/TableRenderContext.js.map +1 -1
  102. package/components/table/layout/useHorizontalSectionSync.d.ts +2 -1
  103. package/components/table/layout/useHorizontalSectionSync.js +32 -31
  104. package/components/table/layout/useHorizontalSectionSync.js.map +1 -1
  105. package/components/table/layout/useMeasuredColumnMaxWidths.js +52 -54
  106. package/components/table/layout/useMeasuredColumnMaxWidths.js.map +1 -1
  107. package/components/table/layout/useTableLayout.d.ts +6 -2
  108. package/components/table/layout/useTableLayout.js +61 -48
  109. package/components/table/layout/useTableLayout.js.map +1 -1
  110. package/components/table/layout/useTableVirtualization.js +51 -56
  111. package/components/table/layout/useTableVirtualization.js.map +1 -1
  112. package/components/table/model/resolveResponsiveViewType.d.ts +2 -0
  113. package/components/table/model/resolveResponsiveViewType.js +27 -0
  114. package/components/table/model/resolveResponsiveViewType.js.map +1 -0
  115. package/components/table/render/header/TableDraggableHeaderCell.js +38 -36
  116. package/components/table/render/header/TableDraggableHeaderCell.js.map +1 -1
  117. package/components/table/render/header/TableHeader.types.d.ts +2 -0
  118. package/components/table/render/header/TableHeaderCellContent.js +16 -16
  119. package/components/table/render/header/TableHeaderCellContent.js.map +1 -1
  120. package/components/table/render/header/TableHeaderSelectionCell.d.ts +1 -0
  121. package/components/table/render/header/TableHeaderSelectionCell.js +13 -12
  122. package/components/table/render/header/TableHeaderSelectionCell.js.map +1 -1
  123. package/components/table/render/header/TableStaticHeaderCell.js +31 -29
  124. package/components/table/render/header/TableStaticHeaderCell.js.map +1 -1
  125. package/components/table/render/header/resolveHeaderCellClassName.d.ts +1 -0
  126. package/components/table/render/header/resolveHeaderCellClassName.js +10 -9
  127. package/components/table/render/header/resolveHeaderCellClassName.js.map +1 -1
  128. package/components/table/runtime/useResolvedRenderColumns.d.ts +4 -4
  129. package/components/table/runtime/useResolvedRenderColumns.js +13 -13
  130. package/components/table/runtime/useResolvedRenderColumns.js.map +1 -1
  131. package/components/table/runtime/useResolvedRenderHeader.d.ts +1 -1
  132. package/components/table/runtime/useResolvedRenderHeader.js.map +1 -1
  133. package/components/table/runtime/useResponsiveResolvedViewType.d.ts +23 -0
  134. package/components/table/runtime/useResponsiveResolvedViewType.js +22 -0
  135. package/components/table/runtime/useResponsiveResolvedViewType.js.map +1 -0
  136. package/components/table/selection/useInternalTableSelectionState.d.ts +2 -0
  137. package/components/table/selection/useInternalTableSelectionState.js +27 -17
  138. package/components/table/selection/useInternalTableSelectionState.js.map +1 -1
  139. package/components/table/selection/useTableSelection.d.ts +5 -1
  140. package/components/table/selection/useTableSelection.js +37 -26
  141. package/components/table/selection/useTableSelection.js.map +1 -1
  142. package/components/table/shared/parsePixelSize.d.ts +2 -0
  143. package/components/table/shared/parsePixelSize.js +13 -0
  144. package/components/table/shared/parsePixelSize.js.map +1 -0
  145. package/hooks/useDraggableElement.d.ts +27 -5
  146. package/hooks/useDraggableElement.js +100 -23
  147. package/hooks/useDraggableElement.js.map +1 -1
  148. package/hooks/usePopperDropdown.d.ts +1 -0
  149. package/hooks/usePopperDropdown.js +15 -12
  150. package/hooks/usePopperDropdown.js.map +1 -1
  151. package/hooks/useResizeObserver.d.ts +25 -6
  152. package/hooks/useResizeObserver.js +20 -18
  153. package/hooks/useResizeObserver.js.map +1 -1
  154. package/package.json +10 -10
  155. package/utils/analytics/createAnalyticsOverlayTooltip.js.map +1 -1
  156. package/utils/init/initConfig.js +5 -5
  157. package/utils/init/initConfig.js.map +1 -1
  158. package/version.d.ts +1 -1
  159. package/version.js +2 -2
  160. package/version.js.map +1 -1
@@ -7,6 +7,7 @@ export type TableViewType = 'TABLE' | 'SINGLE_CARD' | 'MULTI_CARDS';
7
7
  export type TableSortDirection = 'asc' | 'desc';
8
8
  export type TableRowId = string | number;
9
9
  export type TableRowData = Record<string, unknown>;
10
+ export type TableStickyReference = 'applicationLayout' | 'container';
10
11
  export type TableCardsStyleSettings = {
11
12
  /**
12
13
  * Minimum card width for `MULTI_CARDS` view.
@@ -33,6 +34,16 @@ export type TableCardsStyleSettings = {
33
34
  */
34
35
  contentClassName?: string;
35
36
  };
37
+ export type TableResponsiveBreakpoint = {
38
+ /**
39
+ * Switch to `MULTI_CARDS` below this rendered table width.
40
+ */
41
+ cards?: number | string;
42
+ /**
43
+ * Switch to `SINGLE_CARD` below this rendered table width.
44
+ */
45
+ list?: number | string;
46
+ };
36
47
  /**
37
48
  * High-level animation settings for expanded table rows.
38
49
  *
@@ -55,7 +66,16 @@ export type TableStickyColumns = {
55
66
  */
56
67
  left?: 1;
57
68
  /**
58
- * Aligns footer cells with the sticky left column behavior.
69
+ * Number of currently rightmost visible data columns to keep sticky in `TABLE` view.
70
+ *
71
+ * This is position-based and follows column reordering.
72
+ * Selection columns and group rows are ignored.
73
+ *
74
+ * The public API currently supports `1`.
75
+ */
76
+ right?: 1;
77
+ /**
78
+ * Aligns footer cells with the sticky column behavior.
59
79
  *
60
80
  * By default, the footer stays independent so it can still span the selection column
61
81
  * or the full table width for summary and batch-action use cases.
@@ -161,6 +181,7 @@ export type TableColumn<RowType extends TableRowData> = TableColumnDefinition<Ro
161
181
  export type TableRowClassName<RowType extends TableRowData> = string | ((row: RowType, rowIndex: number) => string);
162
182
  export type TableCellClassName<RowType extends TableRowData> = (row: RowType, column: TableColumnDefinition<RowType>, rowIndex: number, columnIndex: number) => string;
163
183
  export type TableRowAnimationProps<RowType extends TableRowData> = MotionProps | ((row: RowType, rowIndex: number) => MotionProps);
184
+ export type TableRowSelectable<RowType extends TableRowData> = (row: RowType, rowIndex: number) => boolean;
164
185
  export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLDivElement>, 'draggable' | 'onClick'> & {
165
186
  /**
166
187
  * Row key accessor for resolving a stable unique row id.
@@ -183,6 +204,24 @@ export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLD
183
204
  * Card width configuration for `MULTI_CARDS` view.
184
205
  */
185
206
  cardsStyle?: TableCardsStyleSettings;
207
+ /**
208
+ * Automatically switches `TABLE` view when the rendered table width changes.
209
+ *
210
+ * Use `cards` to switch to `MULTI_CARDS` and `list` to switch to `SINGLE_CARD`.
211
+ * The object may contain either key or both.
212
+ *
213
+ * Accepts pixel numbers or CSS length values such as `720`, `'720px'`, or `'50vw'`.
214
+ */
215
+ responsiveBreakpoint?: TableResponsiveBreakpoint;
216
+ /**
217
+ * Called whenever the effective rendered view changes after applying responsive breakpoint logic.
218
+ *
219
+ * This can differ from `viewType` when `responsiveBreakpoint` forces an automatic switch.
220
+ * In controlled setups, you can use this callback to keep the external `viewType` state in sync.
221
+ *
222
+ * Only used when `responsiveBreakpoint` is provided.
223
+ */
224
+ onViewTypeChange?: (viewType: TableViewType) => void;
186
225
  /**
187
226
  * Compact row/cell spacing like old `table-condensed`.
188
227
  *
@@ -246,16 +285,27 @@ export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLD
246
285
  * @default '1px'
247
286
  */
248
287
  rowSeparatorWidth?: number | string;
288
+ /**
289
+ * Controls which scroll context sticky headers and sticky rows align to in `TABLE` view.
290
+ *
291
+ * Use `applicationLayout` when the page scroll happens in the default app body.
292
+ * Use `container` when the table sits inside its own explicit overflow container.
293
+ *
294
+ * Sticky rows inside `TableBody maxHeight` continue to pin within that internal body scroller.
295
+ *
296
+ * @default 'applicationLayout'
297
+ */
298
+ stickyReference?: TableStickyReference;
249
299
  /**
250
300
  * Sticky column behavior in `TABLE` view.
251
301
  *
252
- * `left` is position-based and follows column reordering.
302
+ * `left` and `right` are position-based and follow column reordering.
253
303
  * Selection columns and group rows are ignored.
254
304
  *
255
- * The public API currently supports `left: 1`.
305
+ * The public API currently supports `left: 1` and `right: 1`.
256
306
  *
257
307
  * @example
258
- * stickyColumns={{ left: 1, footer: true }}
308
+ * stickyColumns={{ left: 1, right: 1, footer: true }}
259
309
  */
260
310
  stickyColumns?: TableStickyColumns;
261
311
  /**
@@ -315,6 +365,14 @@ export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLD
315
365
  * Called when checkbox selection changes.
316
366
  */
317
367
  onSelectionChange?: (rowIds: TableRowId[]) => void;
368
+ /**
369
+ * Hides selection checkboxes for rows marked with `selectable={false}`.
370
+ *
371
+ * Those rows stay interactive for hover, click handling, and active-row state.
372
+ *
373
+ * @default false
374
+ */
375
+ hideSelectionCheckboxesForExcludedRows?: boolean;
318
376
  /**
319
377
  * Currently selected row keys for multi-selection use cases.
320
378
  */
@@ -11,7 +11,14 @@ export type TableColumnProps = TableHtmlAttributes & {
11
11
  children?: ReactNode;
12
12
  /**
13
13
  * Optional explicit column key.
14
- * If omitted, the cell is matched by its position inside `<TableRow>`.
14
+ *
15
+ * In `TableBody`, this should usually match the `columnKey` of the corresponding
16
+ * `TableHeaderColumn` for the same data column. If omitted, the cell is matched by its position inside
17
+ * the current row.
18
+ *
19
+ * Position-based matching is mainly useful for simple rows that mirror the header
20
+ * order exactly. For spanned cells, reordered columns, or more complex row layouts,
21
+ * prefer an explicit `columnKey`.
15
22
  */
16
23
  columnKey?: string;
17
24
  /**
@@ -1,35 +1,35 @@
1
- import { jsx as u, jsxs as F } from "react/jsx-runtime";
2
- import a from "../../utils/classNames.js";
3
- import { getVerticalAlignClassName as K, getHorizontalAlignClassName as I } from "./shared/getAlignClassName.js";
4
- import L from "./shared/getCellContentOverflowClassName.js";
5
- import { resolveAriaSpan as V, resolveAriaColIndex as R } from "./shared/resolveTableAria.js";
6
- import { useOptionalTableInteractionContext as j } from "./context/TableInteractionContext.js";
7
- import { useOptionalTableLayoutContext as H } from "./context/TableLayoutContext.js";
8
- import { useOptionalTableRenderConfigContext as P } from "./context/TableRenderConfigContext.js";
9
- import { useOptionalTableSection as $, useTableRowContext as q } from "./context/TableStructureContext.js";
10
- import { useOptionalTableRenderContext as E } from "./context/TableRenderContext.js";
11
- const oe = (T) => {
1
+ import { jsx as b, jsxs as j } from "react/jsx-runtime";
2
+ import c from "../../utils/classNames.js";
3
+ import { getVerticalAlignClassName as I, getHorizontalAlignClassName as L } from "./shared/getAlignClassName.js";
4
+ import T from "./shared/getCellContentOverflowClassName.js";
5
+ import { resolveAriaSpan as H, resolveAriaColIndex as D } from "./shared/resolveTableAria.js";
6
+ import { useOptionalTableInteractionContext as P } from "./context/TableInteractionContext.js";
7
+ import { useOptionalTableLayoutContext as $ } from "./context/TableLayoutContext.js";
8
+ import { useOptionalTableRenderConfigContext as q } from "./context/TableRenderConfigContext.js";
9
+ import { useOptionalTableSection as E, useTableRowContext as G } from "./context/TableStructureContext.js";
10
+ import { useOptionalTableRenderContext as J } from "./context/TableRenderContext.js";
11
+ const ne = (F) => {
12
12
  const {
13
- children: h,
13
+ children: f,
14
14
  className: g,
15
- colSpan: b = 1,
16
- columnKey: o,
17
- horizontalAlign: D,
18
- overflow: p = "hidden",
19
- preventRowClick: s = !1,
20
- value: x,
21
- verticalAlign: M,
22
- ...v
23
- } = T, n = P(), t = E(), r = j(), f = H(), y = $(), i = q(), c = y === "body", m = y === "footer";
24
- if (!t || !n || !r || !f || t.columns.length === 0 || !c && !m || c && !i)
15
+ colSpan: h = 1,
16
+ columnKey: t,
17
+ horizontalAlign: M,
18
+ overflow: y = "hidden",
19
+ preventRowClick: m = !1,
20
+ value: p,
21
+ verticalAlign: W,
22
+ ...x
23
+ } = F, n = q(), o = J(), d = P(), i = $(), v = E(), a = G(), s = v === "body", r = v === "footer";
24
+ if (!o || !n || !d || !i || o.columns.length === 0 || !s && !r || s && !a)
25
25
  return null;
26
- const N = o !== void 0 ? t.columnIndexByKey.get(o) : void 0, d = i?.nextColumnIndex(N, b) ?? N ?? -1;
27
- if (d < 0)
26
+ const N = t !== void 0 ? o.columnIndexByKey.get(t) : void 0, u = a?.nextColumnIndex(N, h) ?? N ?? -1;
27
+ if (u < 0)
28
28
  return null;
29
- const e = t.columns[d], l = d + 1, W = l + (r.showSelectionColumn ? 1 : 0), w = D ?? e?.horizontalAlign, z = M ?? e?.verticalAlign, A = c && i?.rowData && n.cellClassName?.(
30
- i.rowData,
31
- t.columnDefinitionsByKey.get(e?.columnKey ?? o ?? "") ?? {
32
- key: e?.columnKey ?? o ?? String(l),
29
+ const e = o.columns[u], l = u + 1, B = l + (d.showSelectionColumn ? 1 : 0), w = M ?? e?.horizontalAlign, k = W ?? e?.verticalAlign, S = s && a?.rowData && n.cellClassName?.(
30
+ a.rowData,
31
+ o.columnDefinitionsByKey.get(e?.columnKey ?? t ?? "") ?? {
32
+ key: e?.columnKey ?? t ?? String(l),
33
33
  label: e?.label ?? "",
34
34
  icon: e?.icon,
35
35
  filter: e?.filter,
@@ -45,64 +45,66 @@ const oe = (T) => {
45
45
  hideOnMobile: e?.hideOnMobile,
46
46
  sortable: e?.sortable
47
47
  },
48
- i.rowIndex,
49
- d
50
- ), S = f.stickyLeftColumnCount ?? 0, k = S > 0 && l <= S, O = e?.mobileLabel ?? (typeof e?.label == "string" ? e.label : ""), C = (B) => {
51
- B.stopPropagation();
48
+ a.rowIndex,
49
+ u
50
+ ), z = i.stickyLeftColumnCount ?? 0, A = i.stickyRightColumnCount ?? 0, R = z > 0 && l <= z, O = A > 0 && l > o.columns.length - A, K = e?.mobileLabel ?? (typeof e?.label == "string" ? e.label : ""), C = (V) => {
51
+ V.stopPropagation();
52
52
  };
53
- return m && (t.renderDraft.hasFooterCells = !0), n.isTableView ? /* @__PURE__ */ u(
53
+ return r && (o.renderDraft.hasFooterCells = !0), n.isTableView ? /* @__PURE__ */ b(
54
54
  "div",
55
55
  {
56
- ...v,
57
- className: a(
56
+ ...x,
57
+ className: c(
58
58
  "table-cell",
59
- m && "table-footer-cell",
60
- c && k && "table-cell-sticky-left-column",
61
- m && f.stickyFooter && k && "table-footer-cell-sticky-left-column",
62
- I(w),
63
- K(z),
59
+ r && "table-footer-cell",
60
+ s && R && "table-cell-sticky-left-column",
61
+ s && O && "table-cell-sticky-right-column",
62
+ r && i.stickyFooter && R && "table-footer-cell-sticky-left-column",
63
+ r && i.stickyFooter && O && "table-footer-cell-sticky-right-column",
64
+ L(w),
65
+ I(k),
64
66
  e?.hideOnMobile && "table-hide-mobile",
65
- A,
67
+ S,
66
68
  g
67
69
  ),
68
- "data-column": e?.columnKey ?? o ?? l,
70
+ "data-column": e?.columnKey ?? t ?? l,
69
71
  role: "cell",
70
- "aria-colindex": R(l, r.showSelectionColumn),
71
- "aria-colspan": V(b),
72
- onClick: s ? C : void 0,
73
- onKeyDown: s ? C : void 0,
74
- style: { gridColumn: `${W} / span ${b}` },
75
- children: /* @__PURE__ */ u("div", { className: a("table-cell-content", L(p)), children: x ?? h ?? "" })
72
+ "aria-colindex": D(l, d.showSelectionColumn),
73
+ "aria-colspan": H(h),
74
+ onClick: m ? C : void 0,
75
+ onKeyDown: m ? C : void 0,
76
+ style: { gridColumn: `${B} / span ${h}`, gridRow: "1 / span 1" },
77
+ children: /* @__PURE__ */ b("div", { className: c("table-cell-content", T(y)), children: p ?? f ?? "" })
76
78
  }
77
- ) : /* @__PURE__ */ F(
79
+ ) : /* @__PURE__ */ j(
78
80
  "div",
79
81
  {
80
- ...v,
81
- className: a(
82
+ ...x,
83
+ className: c(
82
84
  "table-cell",
83
85
  n.cardClasses.cellClassName,
84
- I(w),
85
- K(z),
86
+ L(w),
87
+ I(k),
86
88
  e?.hideOnMobile && "table-hide-mobile",
87
- A,
89
+ S,
88
90
  g
89
91
  ),
90
- "data-column": e?.columnKey ?? o ?? l,
92
+ "data-column": e?.columnKey ?? t ?? l,
91
93
  role: "cell",
92
- "aria-colindex": R(l, r.showSelectionColumn),
93
- onClick: s ? C : void 0,
94
- onKeyDown: s ? C : void 0,
94
+ "aria-colindex": D(l, d.showSelectionColumn),
95
+ onClick: m ? C : void 0,
96
+ onKeyDown: m ? C : void 0,
95
97
  children: [
96
- O && /* @__PURE__ */ u("div", { className: a("table-cell-label", n.cardClasses.labelClassName), children: O }),
97
- /* @__PURE__ */ u(
98
+ K && /* @__PURE__ */ b("div", { className: c("table-cell-label", n.cardClasses.labelClassName), children: K }),
99
+ /* @__PURE__ */ b(
98
100
  "div",
99
101
  {
100
- className: a(
102
+ className: c(
101
103
  "table-cell-content",
102
104
  n.cardClasses.contentClassName,
103
- L(p)
105
+ T(y)
104
106
  ),
105
- children: x ?? h ?? ""
107
+ children: p ?? f ?? ""
106
108
  }
107
109
  )
108
110
  ]
@@ -110,6 +112,6 @@ const oe = (T) => {
110
112
  );
111
113
  };
112
114
  export {
113
- oe as default
115
+ ne as default
114
116
  };
115
117
  //# sourceMappingURL=TableColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableColumn.js","sources":["../../../src/components/table/TableColumn.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { getHorizontalAlignClassName, getVerticalAlignClassName } from './shared/getAlignClassName';\nimport getCellContentOverflowClassName from './shared/getCellContentOverflowClassName';\nimport { resolveAriaColIndex, resolveAriaSpan } from './shared/resolveTableAria';\nimport type { TableCellOverflow, TableHorizontalAlign, TableHtmlAttributes, TableVerticalAlign } from './Table.types';\nimport { useOptionalTableInteractionContext } from './context/TableInteractionContext';\nimport { useOptionalTableLayoutContext } from './context/TableLayoutContext';\nimport { useOptionalTableRenderConfigContext } from './context/TableRenderConfigContext';\nimport { useOptionalTableSection, useTableRowContext } from './context/TableStructureContext';\nimport { useOptionalTableRenderContext } from './context/TableRenderContext';\n\nexport type TableColumnProps = TableHtmlAttributes & {\n /**\n * `TableColumn` may be rendered directly inside `TableFooter`.\n *\n * In `TableBody`, columns must be rendered inside a row component such as\n * `TableRow` or `TableExpandedRow`. Direct `TableColumn` children of\n * `TableBody` are ignored.\n */\n children?: ReactNode;\n\n /**\n * Optional explicit column key.\n * If omitted, the cell is matched by its position inside `<TableRow>`.\n */\n columnKey?: string;\n\n /**\n * Optional explicit value.\n */\n value?: ReactNode;\n\n /**\n * Additional classes for this cell only.\n */\n className?: string;\n\n /**\n * Horizontal alignment override for this cell.\n */\n horizontalAlign?: TableHorizontalAlign;\n\n /**\n * Vertical alignment override for this cell.\n */\n verticalAlign?: TableVerticalAlign;\n\n /**\n * Overflow behavior for the cell content wrapper.\n *\n * @default 'hidden'\n */\n overflow?: TableCellOverflow;\n\n /**\n * Number of columns this cell should span.\n *\n * Currently used by header and footer-style declarative table sections.\n */\n colSpan?: number;\n\n /**\n * Prevents clicks and keyboard interactions inside this cell from triggering the parent row click handler.\n *\n * Useful for interactive cell content such as dropdowns, inputs, or buttons.\n *\n * @default false\n */\n preventRowClick?: boolean;\n};\n\nconst TableColumn = (props: TableColumnProps) => {\n const {\n children,\n className,\n colSpan = 1,\n columnKey,\n horizontalAlign,\n overflow = 'hidden',\n preventRowClick = false,\n value,\n verticalAlign,\n ...remainingProps\n } = props;\n\n const renderConfigContext = useOptionalTableRenderConfigContext();\n const renderContext = useOptionalTableRenderContext();\n const interactionContext = useOptionalTableInteractionContext();\n const layoutContext = useOptionalTableLayoutContext();\n const section = useOptionalTableSection();\n const rowContext = useTableRowContext();\n\n const isBodySection = section === 'body';\n const isFooterSection = section === 'footer';\n\n if (\n !renderContext ||\n !renderConfigContext ||\n !interactionContext ||\n !layoutContext ||\n renderContext.columns.length === 0 ||\n (!isBodySection && !isFooterSection)\n ) {\n return null;\n }\n\n if (isBodySection && !rowContext) {\n return null;\n }\n\n const explicitColumnIndex = columnKey !== undefined ? renderContext.columnIndexByKey.get(columnKey) : undefined;\n const columnIndex = rowContext?.nextColumnIndex(explicitColumnIndex, colSpan) ?? explicitColumnIndex ?? -1;\n\n if (columnIndex < 0) {\n return null;\n }\n\n const renderColumn = renderContext.columns[columnIndex];\n const baseColumnStart = columnIndex + 1;\n const resolvedColumnStart = baseColumnStart + (interactionContext.showSelectionColumn ? 1 : 0);\n const resolvedHorizontalAlign = horizontalAlign ?? renderColumn?.horizontalAlign;\n const resolvedVerticalAlign = verticalAlign ?? renderColumn?.verticalAlign;\n\n const resolvedCellClassName =\n isBodySection &&\n rowContext?.rowData &&\n renderConfigContext.cellClassName?.(\n rowContext.rowData,\n renderContext.columnDefinitionsByKey.get(renderColumn?.columnKey ?? columnKey ?? '') ?? {\n key: renderColumn?.columnKey ?? columnKey ?? String(baseColumnStart),\n label: renderColumn?.label ?? '',\n icon: renderColumn?.icon,\n filter: renderColumn?.filter,\n hideLabel: renderColumn?.hideLabel,\n width: renderColumn?.width,\n minResizeWidth: renderColumn?.minResizeWidth,\n maxResizeWidth: renderColumn?.maxResizeWidth,\n draggable: renderColumn?.draggable,\n resizeable: renderColumn?.resizeable,\n horizontalAlign: renderColumn?.horizontalAlign,\n className: undefined,\n headerClassName: renderColumn?.headerClassName,\n hideOnMobile: renderColumn?.hideOnMobile,\n sortable: renderColumn?.sortable,\n },\n rowContext.rowIndex,\n columnIndex\n );\n\n const stickyLeftColumns = layoutContext.stickyLeftColumnCount ?? 0;\n const isStickyLeftColumn = stickyLeftColumns > 0 && baseColumnStart <= stickyLeftColumns;\n\n const mobileLabel =\n renderColumn?.mobileLabel ?? (typeof renderColumn?.label === 'string' ? renderColumn.label : '');\n\n const handleCellInteraction = (event: KeyboardEvent<HTMLDivElement> | MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n if (isFooterSection) {\n renderContext.renderDraft.hasFooterCells = true;\n }\n\n if (renderConfigContext.isTableView) {\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n isFooterSection && 'table-footer-cell',\n isBodySection && isStickyLeftColumn && 'table-cell-sticky-left-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyLeftColumn &&\n 'table-footer-cell-sticky-left-column',\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n aria-colspan={resolveAriaSpan(colSpan)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n style={{ gridColumn: `${resolvedColumnStart} / span ${colSpan}` }}\n >\n <div className={classNames('table-cell-content', getCellContentOverflowClassName(overflow))}>\n {value ?? children ?? ''}\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n renderConfigContext.cardClasses.cellClassName,\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n >\n {mobileLabel && (\n <div className={classNames('table-cell-label', renderConfigContext.cardClasses.labelClassName)}>\n {mobileLabel}\n </div>\n )}\n <div\n className={classNames(\n 'table-cell-content',\n renderConfigContext.cardClasses.contentClassName,\n getCellContentOverflowClassName(overflow)\n )}\n >\n {value ?? children ?? ''}\n </div>\n </div>\n );\n};\n\nexport default TableColumn;\n"],"names":["TableColumn","props","children","className","colSpan","columnKey","horizontalAlign","overflow","preventRowClick","value","verticalAlign","remainingProps","renderConfigContext","useOptionalTableRenderConfigContext","renderContext","useOptionalTableRenderContext","interactionContext","useOptionalTableInteractionContext","layoutContext","useOptionalTableLayoutContext","section","useOptionalTableSection","rowContext","useTableRowContext","isBodySection","isFooterSection","explicitColumnIndex","columnIndex","renderColumn","baseColumnStart","resolvedColumnStart","resolvedHorizontalAlign","resolvedVerticalAlign","resolvedCellClassName","stickyLeftColumns","isStickyLeftColumn","mobileLabel","handleCellInteraction","event","jsx","classNames","getHorizontalAlignClassName","getVerticalAlignClassName","resolveAriaColIndex","resolveAriaSpan","getCellContentOverflowClassName","jsxs"],"mappings":";;;;;;;;;;AAyEA,MAAMA,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,iBAAAC,IAAkB;AAAA,IAClB,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHV,GAEEW,I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K;AAAA,QACA9B;AAAA,MAAA;AAAA,MAEJ,eAAayB,GAAc,aAAavB,KAAawB;AAAA,MACrD,MAAK;AAAA,MACL,iBAAec,EAAoBd,GAAiBb,EAAmB,mBAAmB;AAAA,MAC1F,SAASR,IAAkB6B,IAAwB;AAAA,MACnD,WAAW7B,IAAkB6B,IAAwB;AAAA,MAEpD,UAAA;AAAA,QAAAD,KACG,gBAAAG,EAAC,SAAI,WAAWC,EAAW,oBAAoB5B,EAAoB,YAAY,cAAc,GACxF,UAAAwB,EAAA,CACL;AAAA,QAEJ,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAWC;AAAA,cACP;AAAA,cACA5B,EAAoB,YAAY;AAAA,cAChCiC,EAAgCtC,CAAQ;AAAA,YAAA;AAAA,YAG3C,eAASL,KAAY;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"TableColumn.js","sources":["../../../src/components/table/TableColumn.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { getHorizontalAlignClassName, getVerticalAlignClassName } from './shared/getAlignClassName';\nimport getCellContentOverflowClassName from './shared/getCellContentOverflowClassName';\nimport { resolveAriaColIndex, resolveAriaSpan } from './shared/resolveTableAria';\nimport type { TableCellOverflow, TableHorizontalAlign, TableHtmlAttributes, TableVerticalAlign } from './Table.types';\nimport { useOptionalTableInteractionContext } from './context/TableInteractionContext';\nimport { useOptionalTableLayoutContext } from './context/TableLayoutContext';\nimport { useOptionalTableRenderConfigContext } from './context/TableRenderConfigContext';\nimport { useOptionalTableSection, useTableRowContext } from './context/TableStructureContext';\nimport { useOptionalTableRenderContext } from './context/TableRenderContext';\n\nexport type TableColumnProps = TableHtmlAttributes & {\n /**\n * `TableColumn` may be rendered directly inside `TableFooter`.\n *\n * In `TableBody`, columns must be rendered inside a row component such as\n * `TableRow` or `TableExpandedRow`. Direct `TableColumn` children of\n * `TableBody` are ignored.\n */\n children?: ReactNode;\n\n /**\n * Optional explicit column key.\n *\n * In `TableBody`, this should usually match the `columnKey` of the corresponding\n * `TableHeaderColumn` for the same data column. If omitted, the cell is matched by its position inside\n * the current row.\n *\n * Position-based matching is mainly useful for simple rows that mirror the header\n * order exactly. For spanned cells, reordered columns, or more complex row layouts,\n * prefer an explicit `columnKey`.\n */\n columnKey?: string;\n\n /**\n * Optional explicit value.\n */\n value?: ReactNode;\n\n /**\n * Additional classes for this cell only.\n */\n className?: string;\n\n /**\n * Horizontal alignment override for this cell.\n */\n horizontalAlign?: TableHorizontalAlign;\n\n /**\n * Vertical alignment override for this cell.\n */\n verticalAlign?: TableVerticalAlign;\n\n /**\n * Overflow behavior for the cell content wrapper.\n *\n * @default 'hidden'\n */\n overflow?: TableCellOverflow;\n\n /**\n * Number of columns this cell should span.\n *\n * Currently used by header and footer-style declarative table sections.\n */\n colSpan?: number;\n\n /**\n * Prevents clicks and keyboard interactions inside this cell from triggering the parent row click handler.\n *\n * Useful for interactive cell content such as dropdowns, inputs, or buttons.\n *\n * @default false\n */\n preventRowClick?: boolean;\n};\n\nconst TableColumn = (props: TableColumnProps) => {\n const {\n children,\n className,\n colSpan = 1,\n columnKey,\n horizontalAlign,\n overflow = 'hidden',\n preventRowClick = false,\n value,\n verticalAlign,\n ...remainingProps\n } = props;\n\n const renderConfigContext = useOptionalTableRenderConfigContext();\n const renderContext = useOptionalTableRenderContext();\n const interactionContext = useOptionalTableInteractionContext();\n const layoutContext = useOptionalTableLayoutContext();\n const section = useOptionalTableSection();\n const rowContext = useTableRowContext();\n\n const isBodySection = section === 'body';\n const isFooterSection = section === 'footer';\n\n if (\n !renderContext ||\n !renderConfigContext ||\n !interactionContext ||\n !layoutContext ||\n renderContext.columns.length === 0 ||\n (!isBodySection && !isFooterSection)\n ) {\n return null;\n }\n\n if (isBodySection && !rowContext) {\n return null;\n }\n\n const explicitColumnIndex = columnKey !== undefined ? renderContext.columnIndexByKey.get(columnKey) : undefined;\n const columnIndex = rowContext?.nextColumnIndex(explicitColumnIndex, colSpan) ?? explicitColumnIndex ?? -1;\n\n if (columnIndex < 0) {\n return null;\n }\n\n const renderColumn = renderContext.columns[columnIndex];\n const baseColumnStart = columnIndex + 1;\n const resolvedColumnStart = baseColumnStart + (interactionContext.showSelectionColumn ? 1 : 0);\n const resolvedHorizontalAlign = horizontalAlign ?? renderColumn?.horizontalAlign;\n const resolvedVerticalAlign = verticalAlign ?? renderColumn?.verticalAlign;\n\n const resolvedCellClassName =\n isBodySection &&\n rowContext?.rowData &&\n renderConfigContext.cellClassName?.(\n rowContext.rowData,\n renderContext.columnDefinitionsByKey.get(renderColumn?.columnKey ?? columnKey ?? '') ?? {\n key: renderColumn?.columnKey ?? columnKey ?? String(baseColumnStart),\n label: renderColumn?.label ?? '',\n icon: renderColumn?.icon,\n filter: renderColumn?.filter,\n hideLabel: renderColumn?.hideLabel,\n width: renderColumn?.width,\n minResizeWidth: renderColumn?.minResizeWidth,\n maxResizeWidth: renderColumn?.maxResizeWidth,\n draggable: renderColumn?.draggable,\n resizeable: renderColumn?.resizeable,\n horizontalAlign: renderColumn?.horizontalAlign,\n className: undefined,\n headerClassName: renderColumn?.headerClassName,\n hideOnMobile: renderColumn?.hideOnMobile,\n sortable: renderColumn?.sortable,\n },\n rowContext.rowIndex,\n columnIndex\n );\n\n const stickyLeftColumns = layoutContext.stickyLeftColumnCount ?? 0;\n const stickyRightColumns = layoutContext.stickyRightColumnCount ?? 0;\n const isStickyLeftColumn = stickyLeftColumns > 0 && baseColumnStart <= stickyLeftColumns;\n const isStickyRightColumn =\n stickyRightColumns > 0 && baseColumnStart > renderContext.columns.length - stickyRightColumns;\n\n const mobileLabel =\n renderColumn?.mobileLabel ?? (typeof renderColumn?.label === 'string' ? renderColumn.label : '');\n\n const handleCellInteraction = (event: KeyboardEvent<HTMLDivElement> | MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n if (isFooterSection) {\n renderContext.renderDraft.hasFooterCells = true;\n }\n\n if (renderConfigContext.isTableView) {\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n isFooterSection && 'table-footer-cell',\n isBodySection && isStickyLeftColumn && 'table-cell-sticky-left-column',\n isBodySection && isStickyRightColumn && 'table-cell-sticky-right-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyLeftColumn &&\n 'table-footer-cell-sticky-left-column',\n isFooterSection &&\n layoutContext.stickyFooter &&\n isStickyRightColumn &&\n 'table-footer-cell-sticky-right-column',\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n aria-colspan={resolveAriaSpan(colSpan)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n style={{ gridColumn: `${resolvedColumnStart} / span ${colSpan}`, gridRow: '1 / span 1' }}\n >\n <div className={classNames('table-cell-content', getCellContentOverflowClassName(overflow))}>\n {value ?? children ?? ''}\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...remainingProps}\n className={classNames(\n 'table-cell',\n renderConfigContext.cardClasses.cellClassName,\n getHorizontalAlignClassName(resolvedHorizontalAlign),\n getVerticalAlignClassName(resolvedVerticalAlign),\n renderColumn?.hideOnMobile && 'table-hide-mobile',\n resolvedCellClassName,\n className\n )}\n data-column={renderColumn?.columnKey ?? columnKey ?? baseColumnStart}\n role='cell'\n aria-colindex={resolveAriaColIndex(baseColumnStart, interactionContext.showSelectionColumn)}\n onClick={preventRowClick ? handleCellInteraction : undefined}\n onKeyDown={preventRowClick ? handleCellInteraction : undefined}\n >\n {mobileLabel && (\n <div className={classNames('table-cell-label', renderConfigContext.cardClasses.labelClassName)}>\n {mobileLabel}\n </div>\n )}\n <div\n className={classNames(\n 'table-cell-content',\n renderConfigContext.cardClasses.contentClassName,\n getCellContentOverflowClassName(overflow)\n )}\n >\n {value ?? children ?? ''}\n </div>\n </div>\n );\n};\n\nexport default TableColumn;\n"],"names":["TableColumn","props","children","className","colSpan","columnKey","horizontalAlign","overflow","preventRowClick","value","verticalAlign","remainingProps","renderConfigContext","useOptionalTableRenderConfigContext","renderContext","useOptionalTableRenderContext","interactionContext","useOptionalTableInteractionContext","layoutContext","useOptionalTableLayoutContext","section","useOptionalTableSection","rowContext","useTableRowContext","isBodySection","isFooterSection","explicitColumnIndex","columnIndex","renderColumn","baseColumnStart","resolvedColumnStart","resolvedHorizontalAlign","resolvedVerticalAlign","resolvedCellClassName","stickyLeftColumns","stickyRightColumns","isStickyLeftColumn","isStickyRightColumn","mobileLabel","handleCellInteraction","event","jsx","classNames","getHorizontalAlignClassName","getVerticalAlignClassName","resolveAriaColIndex","resolveAriaSpan","getCellContentOverflowClassName","jsxs"],"mappings":";;;;;;;;;;AAgFA,MAAMA,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,iBAAAC,IAAkB;AAAA,IAClB,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHV,GAEEW,IAAsBC,EAAA,GACtBC,IAAgBC,EAAA,GAChBC,IAAqBC,EAAA,GACrBC,IAAgBC,EAAA,GAChBC,IAAUC,EAAA,GACVC,IAAaC,EAAA,GAEbC,IAAgBJ,MAAY,QAC5BK,IAAkBL,MAAY;AAapC,MAVI,CAACN,KACD,CAACF,KACD,CAACI,KACD,CAACE,KACDJ,EAAc,QAAQ,WAAW,KAChC,CAACU,KAAiB,CAACC,KAKpBD,KAAiB,CAACF;AAClB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B,GAAiBb,EAAmB,mBAAmB;AAAA,MAC1F,SAASR,IAAkB+B,IAAwB;AAAA,MACnD,WAAW/B,IAAkB+B,IAAwB;AAAA,MAEpD,UAAA;AAAA,QAAAD,KACG,gBAAAG,EAAC,SAAI,WAAWC,EAAW,oBAAoB9B,EAAoB,YAAY,cAAc,GACxF,UAAA0B,EAAA,CACL;AAAA,QAEJ,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAWC;AAAA,cACP;AAAA,cACA9B,EAAoB,YAAY;AAAA,cAChCmC,EAAgCxC,CAAQ;AAAA,YAAA;AAAA,YAG3C,eAASL,KAAY;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -9,6 +9,10 @@ export type TableExpandedRowProps<RowType extends TableRowData> = TableHtmlAttri
9
9
  * Optional class names only for this expanded row.
10
10
  */
11
11
  className?: string;
12
+ /**
13
+ * Excludes this row from table selection while keeping the row interactive.
14
+ */
15
+ selectable?: boolean;
12
16
  /**
13
17
  * Disable table hover styling for this row.
14
18
  */
@@ -1,41 +1,41 @@
1
- import { jsx as s, jsxs as _, Fragment as M } from "react/jsx-runtime";
2
- import { useReducedMotion as j, motion as B } from "motion/react";
3
- import { useRef as F, useState as H, useMemo as U } from "react";
4
- import L from "../checkbox/Checkbox.js";
5
- import A from "../../utils/classNames.js";
6
- import { resolveRowKey as W, resolveRowClassName as X } from "./model/resolveRowMeta.js";
7
- import { useOptionalTableInteractionContext as q } from "./context/TableInteractionContext.js";
8
- import { useOptionalTableRenderConfigContext as z } from "./context/TableRenderConfigContext.js";
9
- import { useOptionalTableSection as G, useTableBodyContext as J, extractTableHtmlAttributes as I, TableRowContext as Q } from "./context/TableStructureContext.js";
10
- import { useOptionalTableRenderContext as Y } from "./context/TableRenderContext.js";
11
- import { getInteractiveRowProps as Z } from "./shared/getInteractiveRowProps.js";
12
- const u = 0.18, $ = (C) => {
13
- const { isSelected: b, isTableView: m, onToggleSelection: x, cardCellClassName: R } = C;
1
+ import { jsx as s, jsxs as M, Fragment as j } from "react/jsx-runtime";
2
+ import { useReducedMotion as B, motion as H } from "motion/react";
3
+ import { useRef as U, useState as L, useMemo as W } from "react";
4
+ import X from "../checkbox/Checkbox.js";
5
+ import P from "../../utils/classNames.js";
6
+ import { resolveRowKey as q, resolveRowClassName as z } from "./model/resolveRowMeta.js";
7
+ import { useOptionalTableInteractionContext as G } from "./context/TableInteractionContext.js";
8
+ import { useOptionalTableRenderConfigContext as J } from "./context/TableRenderConfigContext.js";
9
+ import { useOptionalTableSection as Q, useTableBodyContext as Y, extractTableHtmlAttributes as A, TableRowContext as Z } from "./context/TableStructureContext.js";
10
+ import { useOptionalTableRenderContext as $ } from "./context/TableRenderContext.js";
11
+ import { getInteractiveRowProps as ee } from "./shared/getInteractiveRowProps.js";
12
+ const p = 0.18, oe = (b) => {
13
+ const { isSelected: C, isSelectable: u, hideSelectionControl: R, isTableView: x, onToggleSelection: h, cardCellClassName: r } = b;
14
14
  return /* @__PURE__ */ s(
15
15
  "div",
16
16
  {
17
- className: A("table-cell table-selection-cell", !m && R),
17
+ className: P("table-cell table-selection-cell", !x && r),
18
18
  role: "cell",
19
19
  "aria-colindex": 1,
20
- style: m ? { gridColumn: "1 / span 1" } : void 0,
21
- onClick: (a) => a.stopPropagation(),
22
- onKeyDown: (a) => a.stopPropagation(),
23
- children: /* @__PURE__ */ s("div", { className: "table-selection-control", children: /* @__PURE__ */ s(L, { checked: b, onChange: x }) })
20
+ style: x ? { gridColumn: "1 / span 1", gridRow: "1 / span 1" } : void 0,
21
+ onClick: (e) => e.stopPropagation(),
22
+ onKeyDown: (e) => e.stopPropagation(),
23
+ children: !R && /* @__PURE__ */ s("div", { className: "table-selection-control", children: /* @__PURE__ */ s(X, { checked: C, disabled: !u, onChange: h }) })
24
24
  }
25
25
  );
26
- }, me = (C) => {
27
- const { children: b, className: m, noHover: x, parentKey: R, ...a } = C, e = z(), l = Y(), o = q(), P = G(), y = J(), w = F(0);
28
- w.current = 0;
29
- const [S, g] = H(!0), f = j(), D = U(
30
- () => f ? {
26
+ }, pe = (b) => {
27
+ const { children: C, className: u, noHover: R, parentKey: x, selectable: h, ...r } = b, e = J(), l = $(), o = G(), k = Q(), y = Y(), m = U(0);
28
+ m.current = 0;
29
+ const [D, f] = L(!0), v = B(), O = W(
30
+ () => v ? {
31
31
  initial: { opacity: 0 },
32
32
  animate: {
33
33
  opacity: 1,
34
- transition: { duration: u, ease: "easeInOut" }
34
+ transition: { duration: p, ease: "easeInOut" }
35
35
  },
36
36
  exit: {
37
37
  opacity: 0,
38
- transition: { duration: u, ease: "easeInOut" }
38
+ transition: { duration: p, ease: "easeInOut" }
39
39
  }
40
40
  } : {
41
41
  initial: { opacity: 0, height: 0, y: -8 },
@@ -43,108 +43,111 @@ const u = 0.18, $ = (C) => {
43
43
  opacity: 1,
44
44
  height: "auto",
45
45
  y: 0,
46
- transition: { duration: u, ease: "easeOut" }
46
+ transition: { duration: p, ease: "easeOut" }
47
47
  },
48
48
  exit: {
49
49
  opacity: 0,
50
50
  height: 0,
51
51
  y: -8,
52
- transition: { duration: u, ease: "easeInOut" }
52
+ transition: { duration: p, ease: "easeInOut" }
53
53
  }
54
54
  },
55
- [f]
55
+ [v]
56
56
  );
57
- if (!l || !e || !o || l.columns.length === 0 || P !== "body" || !y)
57
+ if (!l || !e || !o || l.columns.length === 0 || k !== "body" || !y)
58
58
  return null;
59
- const c = a, n = y.nextRowIndex(), t = W(c, n, e.rowKey), k = typeof e.rowAnimationProps == "function" ? e.rowAnimationProps(c, n) : e.rowAnimationProps, i = Z({
59
+ const c = r, n = y.nextRowIndex(), t = q(c, n, e.rowKey), K = typeof e.rowAnimationProps == "function" ? e.rowAnimationProps(c, n) : e.rowAnimationProps, i = ee({
60
60
  isClickable: o.isClickable,
61
- onRowClick: (r, d) => {
62
- o.onRowClick?.(r, d), o.onActiveRowChange?.(
61
+ onRowClick: (a, d) => {
62
+ o.onRowClick?.(a, d), o.onActiveRowChange?.(
63
63
  o.activeRowId === t ? void 0 : t,
64
- r,
64
+ a,
65
65
  d
66
66
  );
67
67
  },
68
68
  row: c,
69
69
  rowIndex: n
70
70
  });
71
- let p;
72
- e.expandedRowAnimation !== !1 && (p = {
73
- ...D,
74
- ...k
71
+ let w;
72
+ e.expandedRowAnimation !== !1 && (w = {
73
+ ...O,
74
+ ...K
75
75
  });
76
- const h = o.selectedRowIdSet.has(t), v = A(
76
+ const g = o.selectableRowIdSet.has(t), S = g && o.selectedRowIdSet.has(t), T = P(
77
77
  "table-row",
78
78
  "table-row-expanded-data",
79
79
  !e.isTableView && "divider-y-1 divider-color-lighter divider-style-solid",
80
80
  o.activeRowId === t && "table-row-active",
81
- h && "table-row-selected",
81
+ S && "table-row-selected",
82
82
  i.isClickableClassName,
83
- x && "table-row-no-hover",
83
+ R && "table-row-no-hover",
84
84
  !e.isTableView && e.cardClasses.rowClassName,
85
- m,
86
- X(e.rowClassName, c, n)
87
- ), O = o.showSelectionColumn && /* @__PURE__ */ s(
88
- $,
85
+ u,
86
+ z(e.rowClassName, c, n)
87
+ ), E = o.showSelectionColumn && /* @__PURE__ */ s(
88
+ oe,
89
89
  {
90
- isSelected: h,
90
+ isSelected: S,
91
+ isSelectable: g,
92
+ hideSelectionControl: !g && o.hideSelectionCheckboxesForExcludedRows,
91
93
  isTableView: e.isTableView,
92
94
  onToggleSelection: () => o.onToggleRowSelection?.(t),
93
95
  cardCellClassName: e.cardClasses.cellClassName
94
96
  }
95
- ), T = /* @__PURE__ */ _(M, { children: [
96
- O,
97
- b
98
- ] }), K = {
99
- ...I(a),
100
- className: v,
97
+ ), I = /* @__PURE__ */ M(j, { children: [
98
+ E,
99
+ C
100
+ ] }), V = {
101
+ ...A(r),
102
+ className: T,
101
103
  "data-index": n,
102
104
  "data-row-id": String(t),
103
105
  onClick: i.onClick,
104
106
  onKeyDown: i.onKeyDown,
105
107
  role: "row",
106
108
  tabIndex: i.tabIndex
107
- }, E = {
108
- ...I(a),
109
- className: v,
109
+ }, _ = {
110
+ ...A(r),
111
+ className: T,
110
112
  "data-index": n,
111
113
  "data-row-id": String(t),
112
114
  onClick: i.onClick,
113
115
  onKeyDown: i.onKeyDown,
114
116
  role: "row",
115
117
  tabIndex: i.tabIndex,
116
- onAnimationStart: () => g(!0),
117
- onAnimationComplete: () => g(!1),
118
- ...p,
118
+ onAnimationStart: () => f(!0),
119
+ onAnimationComplete: () => f(!1),
120
+ ...w,
119
121
  style: {
120
- ...p?.style ?? {},
121
- overflow: S ? "hidden" : "visible"
122
+ ...w?.style ?? {},
123
+ overflow: D ? "hidden" : "visible"
122
124
  }
123
125
  }, N = /* @__PURE__ */ s(
124
- Q.Provider,
126
+ Z.Provider,
125
127
  {
126
128
  value: {
127
- nextColumnIndex: (r, d = 1) => {
128
- if (r !== void 0 && r >= 0)
129
- return w.current = r + d, r;
130
- const V = w.current;
131
- return w.current += d, V;
129
+ nextColumnIndex: (a, d = 1) => {
130
+ if (a !== void 0 && a >= 0)
131
+ return m.current = a + d, a;
132
+ const F = m.current;
133
+ return m.current += d, F;
132
134
  },
133
135
  rowIndex: n,
134
136
  rowId: t,
135
137
  rowData: c
136
138
  },
137
- children: p ? /* @__PURE__ */ s(B.div, { ...E, children: T }) : /* @__PURE__ */ s("div", { ...K, children: T })
139
+ children: w ? /* @__PURE__ */ s(H.div, { ..._, children: I }) : /* @__PURE__ */ s("div", { ...V, children: I })
138
140
  }
139
141
  );
140
142
  return l.renderDraft.hasExpandableRows = !0, l.renderDraft.bodyRows.push({
141
143
  rowId: t,
142
144
  rowIndex: n,
143
145
  kind: "expanded",
146
+ selectable: h !== !1,
144
147
  render: () => N
145
148
  }), l.isRegisteringBodyRows ? null : N;
146
149
  };
147
150
  export {
148
- me as default
151
+ pe as default
149
152
  };
150
153
  //# sourceMappingURL=TableExpandedRow.js.map