@lablup/ui-common 0.2.0-alpha.17 → 0.2.0-alpha.19

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 (173) hide show
  1. package/README.md +3 -2
  2. package/astryx/components/Board.doc.mjs +122 -0
  3. package/astryx/components/Board.tsx +3 -0
  4. package/astryx/components/Form.doc.mjs +1 -1
  5. package/astryx/docs/ui-common.doc.mjs +1 -1
  6. package/dist/assets/components/Board/Board.css +2 -0
  7. package/dist/assets/components/Form/FormItemVisual.css +1 -1
  8. package/dist/astryx/DateInput/tokens.stylex.d.ts +1 -0
  9. package/dist/astryx/DateInput/tokens.stylex.js +1 -0
  10. package/dist/astryx/Icon/IconSize.stylex.d.ts +1 -0
  11. package/dist/astryx/Icon/IconSize.stylex.js +1 -0
  12. package/dist/astryx/Indicator/indicator.markers.stylex.d.ts +1 -0
  13. package/dist/astryx/Indicator/indicator.markers.stylex.js +1 -0
  14. package/dist/astryx/Layer/layerAnimations.stylex.d.ts +1 -0
  15. package/dist/astryx/Layer/layerAnimations.stylex.js +1 -0
  16. package/dist/astryx/Layer/layerTextReset.stylex.d.ts +1 -0
  17. package/dist/astryx/Layer/layerTextReset.stylex.js +1 -0
  18. package/dist/astryx/Layer/layerViewportInset.stylex.d.ts +1 -0
  19. package/dist/astryx/Layer/layerViewportInset.stylex.js +1 -0
  20. package/dist/astryx/Layout/container.stylex.d.ts +1 -0
  21. package/dist/astryx/Layout/container.stylex.js +1 -0
  22. package/dist/astryx/Layout/edgeCompensation.stylex.d.ts +1 -0
  23. package/dist/astryx/Layout/edgeCompensation.stylex.js +1 -0
  24. package/dist/astryx/Layout/padding.stylex.d.ts +1 -0
  25. package/dist/astryx/Layout/padding.stylex.js +1 -0
  26. package/dist/astryx/Markdown/plugin-renderer.d.ts +1 -0
  27. package/dist/astryx/Markdown/plugin-renderer.js +1 -0
  28. package/dist/astryx/NavItem/navItemStyles.stylex.d.ts +1 -0
  29. package/dist/astryx/NavItem/navItemStyles.stylex.js +1 -0
  30. package/dist/astryx/Selector/selectorPresentation.stylex.d.ts +1 -0
  31. package/dist/astryx/Selector/selectorPresentation.stylex.js +1 -0
  32. package/dist/astryx/Stack/stack.stylex.d.ts +1 -0
  33. package/dist/astryx/Stack/stack.stylex.js +1 -0
  34. package/dist/astryx/Stack/stackItem.stylex.d.ts +1 -0
  35. package/dist/astryx/Stack/stackItem.stylex.js +1 -0
  36. package/dist/astryx/Text/text.stylex.d.ts +1 -0
  37. package/dist/astryx/Text/text.stylex.js +1 -0
  38. package/dist/astryx/theme/dataTokens.stylex.d.ts +1 -0
  39. package/dist/astryx/theme/dataTokens.stylex.js +1 -0
  40. package/dist/astryx/theme/neutral/fonts.css +3 -0
  41. package/dist/astryx/utils/focusOutline.stylex.d.ts +1 -0
  42. package/dist/astryx/utils/focusOutline.stylex.js +1 -0
  43. package/dist/astryx/utils/interactionOverlay.stylex.d.ts +1 -0
  44. package/dist/astryx/utils/interactionOverlay.stylex.js +1 -0
  45. package/dist/components/Board/Board.d.ts +102 -0
  46. package/dist/components/Board/Board.messages.d.ts +62 -0
  47. package/dist/components/Board/Board.messages.js +68 -0
  48. package/dist/components/Board/Board.messages.js.map +1 -0
  49. package/dist/components/Board/Board2.js +607 -0
  50. package/dist/components/Board/Board2.js.map +1 -0
  51. package/dist/components/Board/engine.d.ts +60 -0
  52. package/dist/components/Board/engine.js +397 -0
  53. package/dist/components/Board/engine.js.map +1 -0
  54. package/dist/components/Board/index.d.ts +4 -0
  55. package/dist/components/Board/index.js +3 -0
  56. package/dist/components/Board/layout.d.ts +81 -0
  57. package/dist/components/Board/layout.js +67 -0
  58. package/dist/components/Board/layout.js.map +1 -0
  59. package/dist/components/Board/scroll.d.ts +38 -0
  60. package/dist/components/Board/scroll.js +42 -0
  61. package/dist/components/Board/scroll.js.map +1 -0
  62. package/dist/components/DataGrid/DataGrid2.js +128 -128
  63. package/dist/components/DataGrid/DataGrid2.js.map +1 -1
  64. package/dist/components/Form/FormItem.d.ts +6 -1
  65. package/dist/components/Form/FormItem.js +68 -67
  66. package/dist/components/Form/FormItem.js.map +1 -1
  67. package/dist/components/Form/FormItemVisual.d.ts +7 -0
  68. package/dist/components/Form/FormItemVisual2.js +60 -55
  69. package/dist/components/Form/FormItemVisual2.js.map +1 -1
  70. package/dist/components/NotificationStack/NotificationStack2.js +1 -0
  71. package/dist/components/NotificationStack/NotificationStack2.js.map +1 -1
  72. package/dist/components/PageHeader/PageHeader2.js +4 -4
  73. package/dist/components/PagedSelector/PagedSelector.d.ts +1 -1
  74. package/dist/components/PagedSelector/PagedSelector2.js +37 -37
  75. package/dist/components/PagedSelector/PagedSelector2.js.map +1 -1
  76. package/dist/components/SelectionLabel/SelectionLabel.js +4 -4
  77. package/dist/forks/ComplexSelector/ComplexSelector.d.ts +82 -6
  78. package/dist/forks/ComplexSelector/ComplexSelector.js +170 -114
  79. package/dist/forks/ComplexSelector/ComplexSelector.js.map +1 -1
  80. package/dist/forks/ComplexSelector/ComplexSelector.styles.d.ts +40 -0
  81. package/dist/forks/ComplexSelector/ComplexSelector.styles.js +46 -6
  82. package/dist/forks/ComplexSelector/ComplexSelector.styles.js.map +1 -1
  83. package/dist/forks/ComplexSelector/index.d.ts +1 -1
  84. package/dist/forks/Drawer/Drawer.d.ts +21 -3
  85. package/dist/forks/Drawer/Drawer.js +70 -65
  86. package/dist/forks/Drawer/Drawer.js.map +1 -1
  87. package/dist/forks/Drawer/Drawer.styles.d.ts +16 -0
  88. package/dist/forks/Drawer/Drawer.styles.js +16 -0
  89. package/dist/forks/Drawer/Drawer.styles.js.map +1 -1
  90. package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -1
  91. package/dist/forks/Tour/Tour.js +38 -40
  92. package/dist/forks/Tour/Tour.js.map +1 -1
  93. package/dist/forks/Tour/TourContext.js.map +1 -1
  94. package/dist/forks/Tour/TourStep.js.map +1 -1
  95. package/dist/forks/Tour/TourStep.styles.js.map +1 -1
  96. package/dist/forks/Tour/useTour.js.map +1 -1
  97. package/dist/i18n/catalog.js +27 -25
  98. package/dist/i18n/catalog.js.map +1 -1
  99. package/dist/i18n/locales/de-DE.js +60 -0
  100. package/dist/i18n/locales/de-DE.js.map +1 -1
  101. package/dist/i18n/locales/el-GR.js +60 -0
  102. package/dist/i18n/locales/el-GR.js.map +1 -1
  103. package/dist/i18n/locales/es-ES.js +60 -0
  104. package/dist/i18n/locales/es-ES.js.map +1 -1
  105. package/dist/i18n/locales/fi-FI.js +60 -0
  106. package/dist/i18n/locales/fi-FI.js.map +1 -1
  107. package/dist/i18n/locales/fr-FR.js +60 -0
  108. package/dist/i18n/locales/fr-FR.js.map +1 -1
  109. package/dist/i18n/locales/id-ID.js +60 -0
  110. package/dist/i18n/locales/id-ID.js.map +1 -1
  111. package/dist/i18n/locales/it-IT.js +60 -0
  112. package/dist/i18n/locales/it-IT.js.map +1 -1
  113. package/dist/i18n/locales/ja-JP.js +60 -0
  114. package/dist/i18n/locales/ja-JP.js.map +1 -1
  115. package/dist/i18n/locales/ko-KR.js +60 -0
  116. package/dist/i18n/locales/ko-KR.js.map +1 -1
  117. package/dist/i18n/locales/mn-MN.js +60 -0
  118. package/dist/i18n/locales/mn-MN.js.map +1 -1
  119. package/dist/i18n/locales/ms-MY.js +60 -0
  120. package/dist/i18n/locales/ms-MY.js.map +1 -1
  121. package/dist/i18n/locales/pl-PL.js +60 -0
  122. package/dist/i18n/locales/pl-PL.js.map +1 -1
  123. package/dist/i18n/locales/pt-BR.js +60 -0
  124. package/dist/i18n/locales/pt-BR.js.map +1 -1
  125. package/dist/i18n/locales/pt-PT.js +60 -0
  126. package/dist/i18n/locales/pt-PT.js.map +1 -1
  127. package/dist/i18n/locales/ru-RU.js +60 -0
  128. package/dist/i18n/locales/ru-RU.js.map +1 -1
  129. package/dist/i18n/locales/th-TH.js +60 -0
  130. package/dist/i18n/locales/th-TH.js.map +1 -1
  131. package/dist/i18n/locales/tr-TR.js +60 -0
  132. package/dist/i18n/locales/tr-TR.js.map +1 -1
  133. package/dist/i18n/locales/vi-VN.js +60 -0
  134. package/dist/i18n/locales/vi-VN.js.map +1 -1
  135. package/dist/i18n/locales/zh-CN.js +60 -0
  136. package/dist/i18n/locales/zh-CN.js.map +1 -1
  137. package/dist/i18n/locales/zh-TW.js +60 -0
  138. package/dist/i18n/locales/zh-TW.js.map +1 -1
  139. package/dist/index.d.ts +7 -5
  140. package/dist/index.js +61 -59
  141. package/dist/instance.js +2 -2
  142. package/dist/locales/en.generated.js +34 -0
  143. package/dist/locales/en.json +136 -0
  144. package/dist/locales/pseudo.generated.js +34 -0
  145. package/dist/locales/pseudo.json +102 -0
  146. package/dist/theme/lablup/built/lablup.d.ts +3 -3
  147. package/dist/theme/lablup/built/lablup.js +24 -5
  148. package/dist/theme/lablup/built/lablup.variants.d.ts +2 -2
  149. package/dist/theme/lablup/built/theme.css +70 -63
  150. package/dist/theme/lablup/built/theme.css.d.ts +9 -0
  151. package/dist/ui-common-locales/de-DE.json +60 -0
  152. package/dist/ui-common-locales/el-GR.json +60 -0
  153. package/dist/ui-common-locales/en.json +60 -0
  154. package/dist/ui-common-locales/es-ES.json +60 -0
  155. package/dist/ui-common-locales/fi-FI.json +60 -0
  156. package/dist/ui-common-locales/fr-FR.json +60 -0
  157. package/dist/ui-common-locales/id-ID.json +60 -0
  158. package/dist/ui-common-locales/it-IT.json +60 -0
  159. package/dist/ui-common-locales/ja-JP.json +60 -0
  160. package/dist/ui-common-locales/ko-KR.json +60 -0
  161. package/dist/ui-common-locales/mn-MN.json +60 -0
  162. package/dist/ui-common-locales/ms-MY.json +60 -0
  163. package/dist/ui-common-locales/pl-PL.json +60 -0
  164. package/dist/ui-common-locales/pt-BR.json +60 -0
  165. package/dist/ui-common-locales/pt-PT.json +60 -0
  166. package/dist/ui-common-locales/ru-RU.json +60 -0
  167. package/dist/ui-common-locales/th-TH.json +60 -0
  168. package/dist/ui-common-locales/tr-TR.json +60 -0
  169. package/dist/ui-common-locales/vi-VN.json +60 -0
  170. package/dist/ui-common-locales/zh-CN.json +60 -0
  171. package/dist/ui-common-locales/zh-TW.json +60 -0
  172. package/exports.customs.json +1 -0
  173. package/package.json +86 -6
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid2.js","names":[],"sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/**\n * DataGrid\n *\n * Astryx `Table` with the pieces a list page needs around it: a page bar with\n * a range line, client or server sorting, row selection by key, resizable\n * and pinnable columns, expandable rows, per-user column settings (visibility,\n * order, width) and a CSV export picker.\n *\n * Rows are sliced to the page unless `pagination.totalItems` says the caller\n * already sliced them. Sorting is client-side for columns with `compare`,\n * otherwise it only reports `onSortChange`. Column settings live in one\n * overrides record (`hidden`, `order`, `width` per column key) that a product\n * persists as it likes.\n *\n * Plugin order matters: Astryx runs columnSettings, sort, selection, then\n * unknown names in insertion order. `resize` / `sticky` / `scrollX` /\n * `scrollY` / `cellRow` / `expansion` read the final column list, and\n * `scrollY` runs before `cellRow` so a column's `getCellProps` wins.\n *\n * @example\n * <DataGrid\n * data={users}\n * idKey=\"id\"\n * columns={[\n * { key: \"name\", header: \"Name\", renderCell: (u) => u.name, sortKey: \"name\" },\n * { key: \"email\", header: \"Email\", renderCell: (u) => u.email },\n * ]}\n * sort={sort}\n * onSortChange={setSort}\n * pagination={{ page, pageSize, totalItems, onChange: setPage }}\n * />\n */\nimport {\n isValidElement,\n type Key,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type TdHTMLAttributes,\n} from \"react\";\nimport { EmptyState } from \"@astryxdesign/core/EmptyState\";\nimport { Button } from \"@astryxdesign/core/Button\";\nimport { Icon } from \"@astryxdesign/core/Icon\";\nimport { IconButton } from \"@astryxdesign/core/IconButton\";\nimport { Pagination, type PaginationProps } from \"@astryxdesign/core/Pagination\";\nimport { HStack, VStack } from \"@astryxdesign/core/Stack\";\nimport {\n Table,\n pixel,\n proportional,\n useTableColumnResize,\n useTableColumnSettings,\n useTableSelection,\n useTableSortable,\n useTableStickyColumns,\n type TableColumn,\n type TablePlugin,\n type TableProps,\n type TableSortState,\n} from \"@astryxdesign/core/Table\";\nimport { Text } from \"@astryxdesign/core/Text\";\nimport { ChevronDown, ChevronRight, FileDown, Inbox, Settings } from \"lucide-react\";\n\nimport { useUicTranslator } from \"../../i18n/useUicTranslator\";\nimport {\n DataGridExportModal,\n type DataGridExportModalProps,\n} from \"./DataGridExportModal\";\nimport {\n DataGridSettingsModal,\n type DataGridSettingsModalProps,\n type DataGridSettingsResult,\n} from \"./DataGridSettingsModal\";\nimport { nodeToPlainText } from \"./nodeToPlainText\";\nimport \"./DataGrid.css\";\n\n/** A row identity, as `idKey` returns it. */\nexport type DataGridKey = Key;\n\nexport type DataGridSortDirection = \"ascending\" | \"descending\";\n\n/** The active sort: one column, by its `sortKey`. */\nexport interface DataGridSort {\n sortKey: string;\n direction: DataGridSortDirection;\n}\n\nexport interface DataGridColumn<T> {\n /** Stable identity: column settings, widths and pinning use it. */\n key: string;\n /** Header content. It is clipped to the column width. */\n header?: ReactNode;\n /** Caption above the header, for a column that belongs to a group. */\n groupHeader?: ReactNode;\n /**\n * Plain-text name in the settings and export dialogs. Default: the text of\n * `groupHeader` and `header` joined with \" / \", else the key.\n */\n label?: string;\n /** Cell content. `index` is the row's position on the current page. */\n renderCell?: (item: T, index: number) => ReactNode;\n /** Width in pixels. A resized width replaces it. Without one the column flexes. */\n width?: number;\n /** Lower bound, in pixels, of a flexing column. */\n minWidth?: number;\n align?: \"start\" | \"center\" | \"end\";\n /** Makes the column sortable. The sort state names it by this key. */\n sortKey?: string;\n /**\n * Sorts the rows on the client when this column is sorted. Compare in\n * ascending order; the grid reverses the result for descending.\n */\n compare?: (a: T, b: T, direction: DataGridSortDirection) => number;\n /**\n * Pins the column to an edge. Only the contiguous run of pinned columns at\n * each edge of the displayed order is pinned.\n */\n pin?: \"start\" | \"end\";\n /** Column settings cannot hide it. */\n isAlwaysVisible?: boolean;\n /** Hidden until the user shows it in the column settings. */\n isHiddenByDefault?: boolean;\n /** Fields this column exports as. Without them it cannot be exported. */\n exportKeys?: ReadonlyArray<string>;\n /** Extra attributes for this column's body cells. */\n getCellProps?: (item: T, index: number) => TdHTMLAttributes<HTMLTableCellElement>;\n}\n\n/** Per-column settings a user changed, keyed by column key. */\nexport interface DataGridColumnOverride {\n hidden?: boolean;\n /** Display position. Lower comes first. Set only after a reorder. */\n order?: number;\n /** Resized width in pixels. */\n width?: number;\n}\n\nexport type DataGridColumnOverrides = Record<string, DataGridColumnOverride>;\n\nexport interface DataGridColumnSettings {\n /** Controlled overrides. */\n overrides?: DataGridColumnOverrides;\n /** Initial overrides when uncontrolled; always merged under `overrides`. */\n defaultOverrides?: DataGridColumnOverrides;\n onOverridesChange?: (overrides: DataGridColumnOverrides) => void;\n /** Whether the settings dialog lets the user reorder columns. Default: true */\n isReorderable?: boolean;\n /** Strings of the settings dialog. */\n modalProps?: Pick<\n DataGridSettingsModalProps,\n \"title\" | \"subtitle\" | \"searchLabel\" | \"noMatchText\" | \"applyLabel\" | \"cancelLabel\"\n >;\n}\n\nexport interface DataGridCsvExport {\n /** Export keys the backend can produce. Columns asking for others are disabled. */\n supportedKeys: ReadonlyArray<string>;\n /** Runs the export with the chosen keys. The dialog closes when it resolves. */\n onExport: (keys: string[]) => Promise<void>;\n /** A warning above the column list, e.g. that the export is truncated. */\n notice?: ReactNode;\n /** Strings of the export dialog. */\n modalProps?: Pick<\n DataGridExportModalProps,\n \"title\" | \"subtitle\" | \"searchLabel\" | \"noMatchText\" | \"exportLabel\" | \"cancelLabel\"\n >;\n}\n\nexport interface DataGridSelection<T> {\n /** The selected row keys. Selection is controlled. */\n selectedKeys?: ReadonlyArray<DataGridKey>;\n onChange?: (keys: string[], items: T[]) => void;\n /** Whether a row's checkbox is enabled. Select-all leaves a disabled row as it is. */\n getIsItemEnabled?: (item: T) => boolean;\n /** Accessible name of a row's checkbox. Default: the row key. */\n getRowLabel?: (item: T) => string;\n /** Select-all keeps keys of rows on other pages. Default: false */\n isPreservingOtherPages?: boolean;\n}\n\nexport interface DataGridExpansion<T> {\n renderExpandedRow: (item: T, index: number) => ReactNode;\n getIsRowExpandable?: (item: T) => boolean;\n /** Controlled expanded row keys. */\n expandedKeys?: ReadonlyArray<DataGridKey>;\n defaultExpandedKeys?: ReadonlyArray<DataGridKey>;\n onExpandedKeysChange?: (keys: ReadonlyArray<DataGridKey>) => void;\n /** Header content of the expand-button column. */\n columnHeader?: ReactNode;\n /** Width in pixels of the expand-button column. */\n columnWidth?: number;\n}\n\nexport interface DataGridPagination extends Omit<\n PaginationProps,\n | \"page\"\n | \"totalItems\"\n | \"onChange\"\n | \"onPageSizeChange\"\n | \"label\"\n | \"ref\"\n | \"totalPages\"\n | \"hasMore\"\n> {\n /** Controlled page, 1-based. */\n page?: number;\n defaultPage?: number;\n defaultPageSize?: number;\n /**\n * Total row count. Without it the grid pages `data` itself; a total larger\n * than `data` declares the rows already sliced to the page.\n */\n totalItems?: number;\n onChange?: (page: number, pageSize: number) => void;\n /** Whether the bar offers a page-size choice. Default: true */\n hasPageSizeSelector?: boolean;\n /** Hides the page bar while every row fits on one page. Default: false */\n isHiddenOnSinglePage?: boolean;\n /** Content at the end of the bar. */\n endContent?: ReactNode;\n}\n\ntype AnyRow = Record<string, unknown>;\n\nexport interface DataGridProps<T extends object = AnyRow> extends Omit<\n TableProps<AnyRow>,\n | \"data\"\n | \"columns\"\n | \"idKey\"\n | \"rowIndexStart\"\n | \"rowCount\"\n | \"children\"\n | \"scrollWrapper\"\n | \"ref\"\n | \"emptyState\"\n | \"className\"\n | \"style\"\n | \"plugins\"\n | \"onChange\"\n> {\n data?: ReadonlyArray<T>;\n columns?: ReadonlyArray<DataGridColumn<T>>;\n /**\n * Row identity: a field name or a function. A missing field falls back to\n * the row's `key`, then its `id`, then its position.\n */\n idKey?: string | ((item: T) => DataGridKey);\n /** Dims the rows and blocks input while data is refetched. */\n isLoading?: boolean;\n /** Drag-to-resize column borders. Default: true */\n isResizable?: boolean;\n /** Controlled sort; `null` for none. */\n sort?: DataGridSort | null;\n defaultSort?: DataGridSort | null;\n onSortChange?: (sort: DataGridSort | null) => void;\n selection?: DataGridSelection<T>;\n /** The page bar. `false` shows every row and no bar. */\n pagination?: false | DataGridPagination;\n /** Enables the column settings button and persists resized widths. */\n columnSettings?: DataGridColumnSettings;\n /** Enables the CSV export button. */\n csvExport?: DataGridCsvExport;\n expansion?: DataGridExpansion<T>;\n /**\n * Shown in place of the rows when there are none. A string gets the default\n * icon and layout, a node is rendered as is, `false` shows nothing. Default:\n * the catalog's `uic.DataGrid.noData`.\n */\n emptyState?: ReactNode | false;\n /** Extra attributes for a body row. */\n getRowProps?: (\n item: T,\n index: number | undefined,\n ) => HTMLAttributes<HTMLTableRowElement>;\n /**\n * Scrolls horizontally with the table at this width (at least the\n * container's). Columns without a width then size to their content.\n */\n scrollWidth?: number | string;\n /** Caps the rows' height and makes the header sticky. */\n maxHeight?: number | string;\n /** Hides the header row, and with it sorting and select-all. */\n isHeaderHidden?: boolean;\n /** Accessible name of the expand buttons. Default: the catalog's `uic.DataGrid.expandRow` */\n expandRowLabel?: string;\n /** Shown when the page lies past the last one. Default: the catalog's `uic.DataGrid.invalidPage` */\n invalidPageText?: string;\n /** Default: the catalog's `uic.DataGrid.goToFirstPage` */\n goToFirstPageLabel?: string;\n /** Accessible name of the page navigation. Default: the catalog's `uic.DataGrid.pagination` */\n paginationLabel?: string;\n /** The range line beside the page navigation. Default: the catalog's `uic.DataGrid.range` */\n renderRange?: (range: { start: number; end: number; total: number }) => ReactNode;\n /** Default: the catalog's `uic.DataGrid.settings` */\n settingsLabel?: string;\n /** Default: the catalog's `uic.DataGrid.exportCsv` */\n exportLabel?: string;\n className?: string;\n style?: CSSProperties;\n}\n\nconst EXPAND_COLUMN_KEY = \"__uic_expand__\";\n/** Key of the checkbox column Astryx's selection plugin injects; not exported by Astryx. */\nconst SELECTION_COLUMN_KEY = \"__xds_selection\";\n/**\n * Measured column widths, in pixels. Selection: Astryx's 24px first-column\n * inset + the 20px checkbox + an 8px trailing pad (the plugin's own 36 lets\n * the checkbox overhang its cell). Expand: the same inset + the 24px button +\n * 8px, or an 8px lead-in instead of the inset behind a selection column.\n */\nconst SELECTION_COLUMN_WIDTH = 52;\nconst EXPAND_COLUMN_WIDTH_FIRST = 56;\nconst EXPAND_COLUMN_WIDTH_AFTER_SELECTION = 40;\nconst MIN_COLUMN_WIDTH = 60;\nconst DETAIL_ROW_MARKER = \"__uic_detail_for__\";\nconst DEFAULT_PAGE_SIZE = 10;\nconst DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50];\n\nconst EMPTY_STATE_ICON = <Icon icon={Inbox} size=\"lg\" color=\"secondary\" />;\n\nconst X_HEADER_RELEASE: CSSProperties = { width: \"auto\", maxWidth: \"none\" };\nconst X_BODY_RELEASE: CSSProperties = { maxWidth: \"none\" };\n// Inline beats the sticky-header rule's z 2 for pinned header cells.\nconst Y_PINNED_HEADER_STACK: CSSProperties = { zIndex: 3 };\n\nconst isDetailRow = (item: unknown): item is AnyRow =>\n !!item && typeof item === \"object\" && DETAIL_ROW_MARKER in item;\n\nconst toCssLength = (value: number | string): string =>\n typeof value === \"number\" ? `${value}px` : value;\n\nfunction mergeCellStyle<P extends { htmlProps: { style?: CSSProperties } }>(\n props: P,\n extra: CSSProperties,\n): P {\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n style: props.htmlProps.style ? { ...props.htmlProps.style, ...extra } : extra,\n },\n };\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/** The label a column carries in the settings and export dialogs. */\nexport function dataGridColumnLabel<T>(column: DataGridColumn<T>): string {\n if (column.label) return column.label;\n const own = nodeToPlainText(column.header).trim();\n const group = nodeToPlainText(column.groupHeader).trim();\n const label = group && own ? `${group} / ${own}` : own || group;\n return label || column.key;\n}\n\n/** Whether a column shows, given the user's overrides. */\n/**\n * The overrides record a settings dialog result writes. `defaultOverrides`\n * stays merged under it key by key, and a key it holds replaces the default's\n * entry whole. So a column is left out only while its default (natural, then\n * `defaultOverrides`) already renders what the user chose, and an entry that\n * is written states everything that differs from the natural column:\n * otherwise re-showing a column the defaults hide, or restoring the natural\n * order over a reordering default, would bring the default back.\n *\n * @internal Exported for tests.\n */\nexport function dataGridSettingsToOverrides({\n columns,\n result,\n defaultOverrides = {},\n overrides,\n isReorderable,\n}: {\n columns: ReadonlyArray<Pick<DataGridColumn<never>, \"key\" | \"isHiddenByDefault\">>;\n result: DataGridSettingsResult;\n defaultOverrides?: DataGridColumnOverrides;\n /** The overrides in effect, defaults merged; their widths are kept. */\n overrides: DataGridColumnOverrides;\n isReorderable: boolean;\n}): DataGridColumnOverrides {\n const naturalOrder = columns.map((column) => column.key);\n // A default order is only undone by stating every column's position.\n const writesOrder =\n isReorderable &&\n (result.columnOrder.length !== naturalOrder.length ||\n result.columnOrder.some((key, index) => key !== naturalOrder[index]) ||\n columns.some((column) => defaultOverrides[column.key]?.order !== undefined));\n const next: DataGridColumnOverrides = {};\n for (const column of columns) {\n const fallback = defaultOverrides[column.key];\n const naturalHidden = !!column.isHiddenByDefault;\n const defaultHidden = fallback?.hidden ?? naturalHidden;\n const hidden = !result.selectedColumnKeys.includes(column.key);\n const override: DataGridColumnOverride = {};\n if (hidden !== naturalHidden || hidden !== defaultHidden) override.hidden = hidden;\n if (writesOrder) {\n const orderIndex = result.columnOrder.indexOf(column.key);\n if (orderIndex !== -1) override.order = orderIndex;\n }\n // A settings change must not reset resized widths.\n const width = overrides[column.key]?.width;\n if (typeof width === \"number\") override.width = width;\n const matchesDefault =\n hidden === defaultHidden &&\n override.order === fallback?.order &&\n override.width === fallback?.width;\n if (!matchesDefault && Object.keys(override).length > 0)\n next[column.key] = override;\n }\n return next;\n}\n\nexport function isDataGridColumnVisible<T>(\n column: Pick<DataGridColumn<T>, \"key\" | \"isAlwaysVisible\" | \"isHiddenByDefault\">,\n overrides?: DataGridColumnOverrides,\n): boolean {\n if (column.isAlwaysVisible) return true;\n const hidden = overrides?.[column.key]?.hidden;\n return hidden !== undefined ? !hidden : !column.isHiddenByDefault;\n}\n\n/** Controlled when `value` is not undefined; the setter writes state only when uncontrolled. */\nfunction useControllableState<V>(value: V | undefined, initial: () => V) {\n const [state, setState] = useState<V>(initial);\n const isControlled = value !== undefined;\n const current = isControlled ? value : state;\n const set = (next: V) => {\n if (!isControlled) setState(next);\n };\n return [current, set] as const;\n}\n\nexport function DataGrid<T extends object = AnyRow>({\n data,\n columns = [],\n idKey = \"id\",\n isLoading = false,\n isResizable = true,\n sort: sortProp,\n defaultSort,\n onSortChange,\n selection,\n pagination,\n columnSettings,\n csvExport,\n expansion,\n emptyState,\n getRowProps,\n scrollWidth,\n maxHeight,\n isHeaderHidden = false,\n expandRowLabel,\n invalidPageText,\n goToFirstPageLabel,\n paginationLabel,\n renderRange,\n settingsLabel,\n exportLabel,\n density = \"compact\",\n dividers = \"rows\",\n hasHover = true,\n textOverflow = \"truncate\",\n className,\n style,\n ...tableProps\n}: DataGridProps<T>): ReactElement {\n const t = useUicTranslator();\n\n const isScrollX = scrollWidth !== undefined;\n const isScrollY = maxHeight !== undefined;\n\n const [isSettingsOpen, setIsSettingsOpen] = useState(false);\n const [isExportOpen, setIsExportOpen] = useState(false);\n\n /* ---- column overrides (visibility / order / width) ------------------- */\n\n const [storedOverrides, setStoredOverrides] = useState<DataGridColumnOverrides>(\n () => columnSettings?.defaultOverrides ?? {},\n );\n const isOverridesControlled = columnSettings?.overrides !== undefined;\n const ownOverrides = isOverridesControlled\n ? (columnSettings?.overrides ?? {})\n : storedOverrides;\n const setOverrides = (next: DataGridColumnOverrides) => {\n if (!isOverridesControlled) setStoredOverrides(next);\n columnSettings?.onOverridesChange?.(next);\n };\n const overrides: DataGridColumnOverrides = {\n ...(columnSettings?.defaultOverrides ?? {}),\n ...ownOverrides,\n };\n const isReorderable = !!columnSettings && columnSettings.isReorderable !== false;\n\n /* ---- resized widths ---------------------------------------------------- */\n\n // With columnSettings a width rides in the overrides record, so a resize\n // persists like a visibility change; without it the width is local state.\n const [localWidths, setLocalWidths] = useState<Record<string, number>>({});\n const columnWidths: Record<string, number> = {};\n if (columnSettings) {\n for (const [key, override] of Object.entries(overrides)) {\n if (typeof override?.width === \"number\") columnWidths[key] = override.width;\n }\n } else {\n Object.assign(columnWidths, localWidths);\n }\n\n const handleResizeEnd = (updates: Record<string, number>) => {\n if (!columnSettings) {\n setLocalWidths((prev) => ({ ...prev, ...updates }));\n return;\n }\n const next: DataGridColumnOverrides = { ...ownOverrides };\n for (const [key, width] of Object.entries(updates)) {\n if (key === EXPAND_COLUMN_KEY) continue;\n next[key] = { ...next[key], width };\n }\n setOverrides(next);\n };\n\n /* ---- row keys ---------------------------------------------------------- */\n\n const getRowKey = (item: T): string => {\n if (typeof idKey === \"function\") return String(idKey(item));\n const row = item as AnyRow;\n const direct = row[idKey];\n if (direct != null) return String(direct);\n const fallback = row.key ?? row.id;\n if (fallback != null) return String(fallback);\n return `__row_${data ? data.indexOf(item) : -1}`;\n };\n\n /* ---- sort -------------------------------------------------------------- */\n\n const [activeSort, setActiveSort] = useControllableState<DataGridSort | null>(\n sortProp,\n () => defaultSort ?? null,\n );\n\n const sortedRows = ((): T[] => {\n const source = data ? [...data] : [];\n if (!activeSort) return source;\n const compare = columns.find(\n (column) => column.sortKey === activeSort.sortKey && column.compare,\n )?.compare;\n if (!compare) return source;\n const { direction } = activeSort;\n return source.sort((a, b) =>\n direction === \"descending\" ? -compare(a, b, direction) : compare(a, b, direction),\n );\n })();\n\n /* ---- pagination -------------------------------------------------------- */\n\n const pager = pagination === false ? undefined : (pagination ?? {});\n const [currentPage, setCurrentPage] = useControllableState<number>(\n pager?.page,\n () => pager?.defaultPage ?? 1,\n );\n const [pageSize, setPageSize] = useControllableState<number>(\n pager?.pageSize,\n () => pager?.defaultPageSize ?? DEFAULT_PAGE_SIZE,\n );\n\n // Astryx's Pagination answers a page-size pick with onPageSizeChange(size)\n // and then onChange(1) in the same event, still closing over the old size.\n // Forwarding the second call would undo the pick on a controlled grid, so it\n // is dropped; a microtask clears the flag.\n const isPageSizeChangingRef = useRef(false);\n\n const total = pager?.totalItems ?? sortedRows.length;\n const lastPage = Math.max(1, Math.ceil(total / pageSize));\n const activePage = clamp(currentPage, 1, lastPage);\n const isPageOutOfRange =\n !!pager && total > 0 && (currentPage < 1 || currentPage > lastPage);\n // A total above the rows in hand means they are already one page.\n const isServerSliced = total > sortedRows.length;\n const pagedRows =\n pager && !isServerSliced && sortedRows.length > pageSize\n ? sortedRows.slice((activePage - 1) * pageSize, activePage * pageSize)\n : sortedRows;\n const rows = isPageOutOfRange ? [] : pagedRows;\n\n /* ---- expansion --------------------------------------------------------- */\n\n const [storedExpandedKeys, setStoredExpandedKeys] = useState<DataGridKey[]>(() => [\n ...(expansion?.defaultExpandedKeys ?? []),\n ]);\n const expandedKeys = expansion?.expandedKeys ?? storedExpandedKeys;\n const expandedKeySet = new Set(expandedKeys.map(String));\n const hasExpansion = !!expansion;\n const expandColumnWidth =\n expansion?.columnWidth ??\n (selection ? EXPAND_COLUMN_WIDTH_AFTER_SELECTION : EXPAND_COLUMN_WIDTH_FIRST);\n const detailInsetStart = (selection ? SELECTION_COLUMN_WIDTH : 0) + expandColumnWidth;\n\n const toggleExpanded = (key: string) => {\n const next = expandedKeySet.has(key)\n ? expandedKeys.filter((k) => String(k) !== key)\n : [...expandedKeys, key];\n if (!expansion?.expandedKeys) setStoredExpandedKeys(next);\n expansion?.onExpandedKeysChange?.(next);\n };\n\n const rowIndexByKey = new Map<string, number>();\n rows.forEach((item, index) => rowIndexByKey.set(getRowKey(item), index));\n\n // Each expanded row is followed by a marker row the expansion plugin turns\n // into one full-width cell.\n const tableData: AnyRow[] = [];\n for (const item of rows) {\n tableData.push(item as AnyRow);\n if (!hasExpansion) continue;\n const key = getRowKey(item);\n if (expandedKeySet.has(key) && (expansion?.getIsRowExpandable?.(item) ?? true)) {\n tableData.push({ [DETAIL_ROW_MARKER]: key, id: `${key}__detail` });\n }\n }\n\n // From every row, not the page: selection resolves keys on other pages too.\n const itemByKey = new Map<string, T>();\n sortedRows.forEach((item) => itemByKey.set(getRowKey(item), item));\n\n /* ---- Astryx columns ---------------------------------------------------- */\n\n const tableColumns: TableColumn<AnyRow>[] = [];\n if (hasExpansion) {\n tableColumns.push({\n key: EXPAND_COLUMN_KEY,\n header: expansion?.columnHeader ?? \"\",\n width: pixel(expandColumnWidth),\n resizable: false,\n renderCell: (row) => {\n if (isDetailRow(row)) return null;\n const item = row as T;\n if (!(expansion?.getIsRowExpandable?.(item) ?? true)) return null;\n const key = getRowKey(item);\n return (\n <IconButton\n label={expandRowLabel ?? t(\"uic.DataGrid.expandRow\")}\n icon={expandedKeySet.has(key) ? <ChevronDown /> : <ChevronRight />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => toggleExpanded(key)}\n />\n );\n },\n });\n }\n\n for (const column of columns) {\n const width = columnWidths[column.key] ?? column.width;\n const header = (\n <span className=\"uic-data-grid__clip\">\n {column.groupHeader == null ? (\n column.header\n ) : (\n <VStack gap={0} align=\"start\">\n <Text type=\"supporting\" color=\"secondary\">\n {column.groupHeader}\n </Text>\n <span>{column.header}</span>\n </VStack>\n )}\n </span>\n );\n tableColumns.push({\n key: column.key,\n header,\n align: column.align === \"start\" ? undefined : column.align,\n sortable: column.sortKey ? { sortKey: column.sortKey } : false,\n resizable: isResizable,\n // In scroll-x mode a width-less column takes no width, so its content sizes it.\n width:\n width != null\n ? pixel(width)\n : isScrollX\n ? undefined\n : proportional(\n 1,\n typeof column.minWidth === \"number\"\n ? { minWidth: column.minWidth }\n : undefined,\n ),\n renderCell: (row) => {\n if (isDetailRow(row)) return null;\n const item = row as T;\n const content = column.renderCell\n ? column.renderCell(item, rowIndexByKey.get(getRowKey(item)) ?? 0)\n : defaultCell(row[column.key]);\n if (textOverflow !== \"truncate\" || content == null) return content;\n return <span className=\"uic-data-grid__clip\">{content}</span>;\n },\n });\n }\n\n /* ---- visibility + order ------------------------------------------------ */\n\n const visibleColumns = columnSettings\n ? columns.filter((column) => isDataGridColumnVisible(column, overrides))\n : [...columns];\n const orderedColumns = isReorderable\n ? visibleColumns\n .map((column, index) => ({ column, index }))\n .sort(\n (a, b) =>\n (overrides[a.column.key]?.order ?? Number.MAX_SAFE_INTEGER) -\n (overrides[b.column.key]?.order ?? Number.MAX_SAFE_INTEGER) ||\n a.index - b.index,\n )\n .map(({ column }) => column)\n : visibleColumns;\n const activeColumnKeys = [\n ...(hasExpansion ? [EXPAND_COLUMN_KEY] : []),\n ...orderedColumns.map((column) => column.key),\n ];\n\n const columnSettingsPlugin = useTableColumnSettings<AnyRow>({\n columns: [\n ...(hasExpansion\n ? [{ key: EXPAND_COLUMN_KEY, label: \"\", isAlwaysVisible: true }]\n : []),\n ...columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n isAlwaysVisible: !!column.isAlwaysVisible,\n })),\n ],\n activeColumnKeys,\n // The settings dialog owns the write path (it keeps `order` and `width`).\n onChangeActiveColumnKeys: () => {},\n });\n\n /* ---- pinning ----------------------------------------------------------- */\n\n const startKeys: string[] = [];\n for (const column of orderedColumns) {\n if (column.pin === \"start\") startKeys.push(column.key);\n else break;\n }\n const endKeys: string[] = [];\n for (const column of [...orderedColumns].reverse()) {\n if (column.pin === \"end\") endKeys.unshift(column.key);\n else break;\n }\n const stickyConfig = {\n startKeys:\n startKeys.length === 0\n ? undefined\n : [\n ...(selection ? [SELECTION_COLUMN_KEY] : []),\n ...(hasExpansion ? [EXPAND_COLUMN_KEY] : []),\n ...startKeys,\n ],\n endKeys: endKeys.length === 0 ? undefined : endKeys,\n };\n const stickyPlugin = useTableStickyColumns<AnyRow>(\n stickyConfig.startKeys || stickyConfig.endKeys ? stickyConfig : {},\n );\n\n /* ---- per-cell / per-row attributes -------------------------------------- */\n\n const columnByKey = new Map(columns.map((column) => [column.key, column]));\n\n const cellRowPlugin: TablePlugin<AnyRow> = {\n transformBodyCell: (props, column, row) => {\n if (isDetailRow(row)) return props;\n const item = row as T;\n const extra = columnByKey\n .get(column.key)\n ?.getCellProps?.(item, rowIndexByKey.get(getRowKey(item)) ?? 0);\n if (!extra) return props;\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n ...extra,\n style: { ...props.htmlProps.style, ...extra.style },\n },\n };\n },\n transformBodyRow: (props, row) => {\n if (!getRowProps || isDetailRow(row)) return props;\n const item = row as T;\n const extra = getRowProps(item, rowIndexByKey.get(getRowKey(item)));\n if (!extra) return props;\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n ...extra,\n style: { ...props.htmlProps.style, ...extra.style },\n },\n };\n },\n };\n\n // Astryx clips cells with `max-width: 0`; scroll-x releases width-less columns only.\n const scrollXPlugin: TablePlugin<AnyRow> = {\n transformHeaderCell: (props, column) =>\n column.width != null ? props : mergeCellStyle(props, X_HEADER_RELEASE),\n transformBodyCell: (props, column) =>\n column.width != null ? props : mergeCellStyle(props, X_BODY_RELEASE),\n };\n\n const pinnedKeys = new Set([\n ...(stickyConfig.startKeys ?? []),\n ...(stickyConfig.endKeys ?? []),\n ]);\n const scrollYPlugin: TablePlugin<AnyRow> = {\n transformHeaderCell: (props, column) =>\n pinnedKeys.has(column.key) ? mergeCellStyle(props, Y_PINNED_HEADER_STACK) : props,\n };\n\n /* ---- sorting ----------------------------------------------------------- */\n\n const sortState: TableSortState = activeSort\n ? [{ sortKey: activeSort.sortKey, direction: activeSort.direction }]\n : [];\n\n const sortPlugin = useTableSortable<AnyRow>({\n sort: sortState,\n allowUnsortedState: true,\n onSortChange: (next) => {\n const first = next[0];\n const nextSort: DataGridSort | null = first\n ? { sortKey: first.sortKey, direction: first.direction }\n : null;\n setActiveSort(nextSort);\n onSortChange?.(nextSort);\n },\n });\n\n /* ---- selection --------------------------------------------------------- */\n\n const selectedKeySet = new Set((selection?.selectedKeys ?? []).map(String));\n const emitSelection = (keys: string[]) => {\n const items = keys\n .map((key) => itemByKey.get(key))\n .filter((item) => item !== undefined);\n selection?.onChange?.(keys, items);\n };\n const isRowSelected = (item: T) => selectedKeySet.has(getRowKey(item));\n const isRowEnabled = (item: T) => selection?.getIsItemEnabled?.(item) ?? true;\n // Select-all acts on the enabled rows only; a disabled row keeps its state.\n const enabledRows = rows.filter(isRowEnabled);\n\n const selectionPlugin = useTableSelection<AnyRow>({\n getIsItemSelectable: (row) => !isDetailRow(row),\n getIsItemSelected: (row) => !isDetailRow(row) && isRowSelected(row as T),\n getIsItemEnabled: (row) => !isDetailRow(row) && isRowEnabled(row as T),\n getRowLabel: (row) =>\n isDetailRow(row)\n ? \"\"\n : (selection?.getRowLabel?.(row as T) ?? getRowKey(row as T)),\n getIsAllSelected: () => enabledRows.length > 0 && enabledRows.every(isRowSelected),\n getIsIndeterminate: () =>\n enabledRows.some(isRowSelected) && !enabledRows.every(isRowSelected),\n onSelectItem: ({ item, isSelected }) => {\n if (isDetailRow(item)) return;\n const key = getRowKey(item as T);\n const next = new Set(selectedKeySet);\n if (isSelected) next.add(key);\n else next.delete(key);\n emitSelection([...next]);\n },\n onSelectAll: ({ isAllSelected }) => {\n const next = new Set(selection?.isPreservingOtherPages ? selectedKeySet : []);\n for (const item of rows) {\n const key = getRowKey(item);\n const isSelected = isRowEnabled(item) ? isAllSelected : isRowSelected(item);\n if (isSelected) next.add(key);\n else next.delete(key);\n }\n emitSelection([...next]);\n },\n });\n\n const selectionWidthPlugin: TablePlugin<AnyRow> = {\n transformColumns: (cols) =>\n cols.map((column) =>\n column.key === SELECTION_COLUMN_KEY\n ? { ...column, width: pixel(SELECTION_COLUMN_WIDTH) }\n : column,\n ),\n };\n\n /* ---- resize ------------------------------------------------------------ */\n\n const resizePlugin = useTableColumnResize<AnyRow>({\n columns: tableColumns,\n columnWidths,\n minWidth: MIN_COLUMN_WIDTH,\n onColumnResizeEnd: handleResizeEnd,\n });\n\n /* ---- expansion --------------------------------------------------------- */\n\n const renderedColumnCount = activeColumnKeys.length + (selection ? 1 : 0);\n const expansionPlugin: TablePlugin<AnyRow> = {\n transformBodyRow: (props, row) => {\n if (!isDetailRow(row)) return props;\n const parentKey = String(row[DETAIL_ROW_MARKER]);\n const item = itemByKey.get(parentKey);\n if (!item) return props;\n return {\n ...props,\n children: (\n <td\n colSpan={renderedColumnCount}\n className=\"uic-data-grid__detail\"\n style={{ paddingInlineStart: detailInsetStart }}\n >\n {expansion?.renderExpandedRow(item, rowIndexByKey.get(parentKey) ?? 0)}\n </td>\n ),\n };\n },\n };\n\n const plugins: Record<string, TablePlugin<AnyRow>> = {\n columnSettings: columnSettingsPlugin,\n sort: sortPlugin,\n };\n if (selection) {\n plugins.selection = selectionPlugin;\n plugins.selectionWidth = selectionWidthPlugin;\n }\n if (isResizable) plugins.resize = resizePlugin;\n plugins.sticky = stickyPlugin;\n if (isScrollX) plugins.scrollX = scrollXPlugin;\n // Without pinned columns the sticky header is pure CSS.\n if (isScrollY && pinnedKeys.size > 0) plugins.scrollY = scrollYPlugin;\n plugins.cellRow = cellRowPlugin;\n if (hasExpansion) plugins.expansion = expansionPlugin;\n\n /* ---- bottom bar -------------------------------------------------------- */\n\n const {\n page: _page,\n defaultPage: _defaultPage,\n defaultPageSize: _defaultPageSize,\n totalItems: _totalItems,\n onChange: _onChange,\n hasPageSizeSelector = true,\n isHiddenOnSinglePage = false,\n endContent,\n pageSizeOptions,\n size: pagerSize = \"sm\",\n ...paginationRest\n } = pager ?? {};\n\n const rangeStart = total === 0 ? 0 : (activePage - 1) * pageSize + 1;\n const rangeEnd = Math.min(activePage * pageSize, total);\n const isPagerVisible = !!pager && !(isHiddenOnSinglePage && total <= pageSize);\n const hasBottomBar = isPagerVisible || !!columnSettings || !!csvExport;\n\n const emptyStateNode = isPageOutOfRange ? (\n // The way back outranks any empty state the caller gave.\n <EmptyState\n isCompact\n icon={EMPTY_STATE_ICON}\n title={invalidPageText ?? t(\"uic.DataGrid.invalidPage\")}\n actions={\n <Button\n variant=\"primary\"\n label={goToFirstPageLabel ?? t(\"uic.DataGrid.goToFirstPage\")}\n onClick={() => {\n setCurrentPage(1);\n pager?.onChange?.(1, pageSize);\n }}\n />\n }\n />\n ) : emptyState === false ? (\n false\n ) : emptyState == null || typeof emptyState === \"string\" ? (\n <EmptyState\n isCompact\n icon={EMPTY_STATE_ICON}\n title={emptyState ?? t(\"uic.DataGrid.noData\")}\n />\n ) : (\n emptyState\n );\n\n const applySettings = (result: DataGridSettingsResult) => {\n setIsSettingsOpen(false);\n setOverrides(\n dataGridSettingsToOverrides({\n columns,\n result,\n defaultOverrides: columnSettings?.defaultOverrides,\n overrides,\n isReorderable,\n }),\n );\n };\n\n return (\n <div\n className={[\"uic-data-grid\", className].filter(Boolean).join(\" \")}\n style={style}\n >\n <div\n aria-busy={isLoading || undefined}\n className={[\n \"uic-data-grid__body\",\n isLoading && \"uic-data-grid__body--loading\",\n isHeaderHidden && \"uic-data-grid__body--no-header\",\n dividers !== \"grid\" && \"uic-data-grid__body--header-split\",\n isScrollX && \"uic-data-grid__body--scroll-x\",\n isScrollY && \"uic-data-grid__body--scroll-y\",\n ]\n .filter(Boolean)\n .join(\" \")}\n style={\n {\n ...(isScrollX\n ? { \"--data-grid-scroll-width\": toCssLength(scrollWidth) }\n : null),\n ...(isScrollY\n ? { \"--data-grid-max-height\": toCssLength(maxHeight) }\n : null),\n } as CSSProperties\n }\n >\n <Table<AnyRow>\n {...tableProps}\n data={tableData}\n columns={tableColumns}\n idKey={(row: AnyRow) =>\n isDetailRow(row)\n ? `${String(row[DETAIL_ROW_MARKER])}__detail`\n : getRowKey(row as T)\n }\n density={density}\n dividers={dividers}\n hasHover={hasHover}\n textOverflow={textOverflow}\n emptyState={emptyStateNode}\n rowCount={total || undefined}\n rowIndexStart={pager ? (activePage - 1) * pageSize + 1 : undefined}\n plugins={plugins}\n />\n </div>\n\n {hasBottomBar ? (\n <HStack justify=\"end\" align=\"center\" gap={2} className=\"uic-data-grid__footer\">\n {isPagerVisible ? (\n <>\n <Text type=\"supporting\" color=\"secondary\">\n {renderRange\n ? renderRange({ start: rangeStart, end: rangeEnd, total })\n : t(\"uic.DataGrid.range\", {\n start: rangeStart,\n end: rangeEnd,\n total,\n })}\n </Text>\n <Pagination\n variant=\"pages\"\n {...paginationRest}\n page={activePage}\n pageSize={pageSize}\n totalItems={total}\n // Astryx shows the size choice exactly when options are passed.\n pageSizeOptions={\n hasPageSizeSelector\n ? (pageSizeOptions ?? DEFAULT_PAGE_SIZE_OPTIONS)\n : undefined\n }\n size={pagerSize}\n label={paginationLabel ?? t(\"uic.DataGrid.pagination\")}\n onChange={(page) => {\n if (isPageSizeChangingRef.current) return;\n setCurrentPage(page);\n pager?.onChange?.(page, pageSize);\n }}\n onPageSizeChange={(nextSize) => {\n isPageSizeChangingRef.current = true;\n queueMicrotask(() => {\n isPageSizeChangingRef.current = false;\n });\n setCurrentPage(1);\n setPageSize(nextSize);\n pager?.onChange?.(1, nextSize);\n }}\n />\n </>\n ) : null}\n {columnSettings ? (\n <IconButton\n label={settingsLabel ?? t(\"uic.DataGrid.settings\")}\n icon={<Settings />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsSettingsOpen(true)}\n />\n ) : null}\n {csvExport ? (\n <IconButton\n label={exportLabel ?? t(\"uic.DataGrid.exportCsv\")}\n icon={<FileDown />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsExportOpen(true)}\n />\n ) : null}\n {pager ? endContent : null}\n </HStack>\n ) : null}\n\n {columnSettings ? (\n <DataGridSettingsModal\n {...columnSettings.modalProps}\n isOpen={isSettingsOpen}\n onOpenChange={setIsSettingsOpen}\n columns={columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n isAlwaysVisible: !!column.isAlwaysVisible,\n }))}\n visibleColumnKeys={orderedColumns.map((column) => column.key)}\n isReorderable={isReorderable}\n onApply={applySettings}\n />\n ) : null}\n\n {csvExport ? (\n <DataGridExportModal\n {...csvExport.modalProps}\n isOpen={isExportOpen}\n onOpenChange={setIsExportOpen}\n columns={columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n exportKeys: column.exportKeys ?? [],\n }))}\n supportedKeys={csvExport.supportedKeys}\n notice={csvExport.notice}\n onExport={async (keys) => {\n await csvExport.onExport(keys);\n setIsExportOpen(false);\n }}\n />\n ) : null}\n </div>\n );\n}\n\nfunction defaultCell(value: unknown): ReactNode {\n if (value == null || value === \"\") return null;\n if (isValidElement(value)) return value;\n return String(value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgTA,IAAM,IAAoB,kBAEpB,KAAuB,mBAOvB,KAAyB,IACzB,KAA4B,IAC5B,KAAsC,IACtC,KAAmB,IACnB,IAAoB,sBACpB,KAAoB,IACpB,KAA4B;CAAC;CAAI;CAAI;AAAE,GAEvC,KAAmB,kBAAC,GAAD;CAAM,MAAM;CAAO,MAAK;CAAK,OAAM;AAAa,CAAA,GAEnE,KAAkC;CAAE,OAAO;CAAQ,UAAU;AAAO,GACpE,KAAgC,EAAE,UAAU,OAAO,GAEnD,KAAuC,EAAE,QAAQ,EAAE,GAEnD,KAAe,MACnB,CAAC,CAAC,KAAQ,OAAO,KAAS,YAAY,KAAqB,GAEvD,MAAe,MACnB,OAAO,KAAU,WAAW,GAAG,EAAM,MAAM;AAE7C,SAAS,EACP,GACA,GACG;CACH,OAAO;EACL,GAAG;EACH,WAAW;GACT,GAAG,EAAM;GACT,OAAO,EAAM,UAAU,QAAQ;IAAE,GAAG,EAAM,UAAU;IAAO,GAAG;GAAM,IAAI;EAC1E;CACF;AACF;AAEA,SAAS,GAAM,GAAe,GAAa,GAAqB;CAC9D,OAAO,KAAK,IAAI,KAAK,IAAI,GAAO,CAAG,GAAG,CAAG;AAC3C;AAGA,SAAgB,EAAuB,GAAmC;CACxE,IAAI,EAAO,OAAO,OAAO,EAAO;CAChC,IAAM,IAAM,EAAgB,EAAO,MAAM,CAAC,CAAC,KAAK,GAC1C,IAAQ,EAAgB,EAAO,WAAW,CAAC,CAAC,KAAK;CA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AAD,CAAW,CAAA;MACjB,SAAQ;MACR,MAAK;MACL,eAAe,GAAgB,EAAI;KACpC,CAAA,IACC;KACH,IAAQ,KAAa;IAChB;GACN,CAAA,IAAA;GAEH,IACC,kBAAC,GAAD;IACE,GAAI,EAAe;IACnB,QAAQ;IACR,cAAc;IACd,SAAS,EAAQ,KAAK,OAAY;KAChC,KAAK,EAAO;KACZ,OAAO,EAAoB,CAAM;KACjC,iBAAiB,CAAC,CAAC,EAAO;IAC5B,EAAE;IACF,mBAAmB,EAAe,KAAK,MAAW,EAAO,GAAG;IAC7C;IACf,SAAS;GACV,CAAA,IACC;GAEH,IACC,kBAAC,GAAD;IACE,GAAI,EAAU;IACd,QAAQ;IACR,cAAc;IACd,SAAS,EAAQ,KAAK,OAAY;KAChC,KAAK,EAAO;KACZ,OAAO,EAAoB,CAAM;KACjC,YAAY,EAAO,cAAc,CAAC;IACpC,EAAE;IACF,eAAe,EAAU;IACzB,QAAQ,EAAU;IAClB,UAAU,OAAO,MAAS;KAExB,AADA,MAAM,EAAU,SAAS,CAAI,GAC7B,GAAgB,EAAK;IACvB;GACD,CAAA,IACC;EACD;;AAET;AAEA,SAAS,GAAY,GAA2B;CAG9C,OAFI,KAAS,QAAQ,MAAU,KAAW,OACtC,EAAe,CAAK,IAAU,IAC3B,OAAO,CAAK;AACrB"}
1
+ {"version":3,"file":"DataGrid2.js","names":[],"sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/**\n * DataGrid\n *\n * Astryx `Table` with the pieces a list page needs around it: a page bar with\n * a range line, client or server sorting, row selection by key, resizable\n * and pinnable columns, expandable rows, per-user column settings (visibility,\n * order, width) and a CSV export picker.\n *\n * Rows are sliced to the page unless `pagination.totalItems` says the caller\n * already sliced them. Sorting is client-side for columns with `compare`,\n * otherwise it only reports `onSortChange`. Column settings live in one\n * overrides record (`hidden`, `order`, `width` per column key) that a product\n * persists as it likes.\n *\n * Plugin order matters: Astryx runs columnSettings, sort, selection, then\n * unknown names in insertion order. `resize` / `sticky` / `scrollX` /\n * `scrollY` / `cellRow` / `expansion` read the final column list, and\n * `scrollY` runs before `cellRow` so a column's `getCellProps` wins.\n *\n * @example\n * <DataGrid\n * data={users}\n * idKey=\"id\"\n * columns={[\n * { key: \"name\", header: \"Name\", renderCell: (u) => u.name, sortKey: \"name\" },\n * { key: \"email\", header: \"Email\", renderCell: (u) => u.email },\n * ]}\n * sort={sort}\n * onSortChange={setSort}\n * pagination={{ page, pageSize, totalItems, onChange: setPage }}\n * />\n */\nimport {\n isValidElement,\n type Key,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type TdHTMLAttributes,\n} from \"react\";\nimport { EmptyState } from \"@astryxdesign/core/EmptyState\";\nimport { Button } from \"@astryxdesign/core/Button\";\nimport { Icon } from \"@astryxdesign/core/Icon\";\nimport { IconButton } from \"@astryxdesign/core/IconButton\";\nimport { Pagination, type PaginationProps } from \"@astryxdesign/core/Pagination\";\nimport { HStack, VStack } from \"@astryxdesign/core/Stack\";\nimport {\n Table,\n pixel,\n proportional,\n useTableColumnResize,\n useTableColumnSettings,\n useTableSelection,\n useTableSortable,\n useTableStickyColumns,\n type TableColumn,\n type TablePlugin,\n type TableProps,\n type TableSortState,\n} from \"@astryxdesign/core/Table\";\nimport { Text } from \"@astryxdesign/core/Text\";\nimport { ChevronDown, ChevronRight, FileDown, Inbox, Settings } from \"lucide-react\";\n\nimport { useUicTranslator } from \"../../i18n/useUicTranslator\";\nimport {\n DataGridExportModal,\n type DataGridExportModalProps,\n} from \"./DataGridExportModal\";\nimport {\n DataGridSettingsModal,\n type DataGridSettingsModalProps,\n type DataGridSettingsResult,\n} from \"./DataGridSettingsModal\";\nimport { nodeToPlainText } from \"./nodeToPlainText\";\nimport \"./DataGrid.css\";\n\n/** A row identity, as `idKey` returns it. */\nexport type DataGridKey = Key;\n\nexport type DataGridSortDirection = \"ascending\" | \"descending\";\n\n/** The active sort: one column, by its `sortKey`. */\nexport interface DataGridSort {\n sortKey: string;\n direction: DataGridSortDirection;\n}\n\nexport interface DataGridColumn<T> {\n /** Stable identity: column settings, widths and pinning use it. */\n key: string;\n /** Header content. It is clipped to the column width. */\n header?: ReactNode;\n /** Caption above the header, for a column that belongs to a group. */\n groupHeader?: ReactNode;\n /**\n * Plain-text name in the settings and export dialogs. Default: the text of\n * `groupHeader` and `header` joined with \" / \", else the key.\n */\n label?: string;\n /** Cell content. `index` is the row's position on the current page. */\n renderCell?: (item: T, index: number) => ReactNode;\n /** Width in pixels. A resized width replaces it. Without one the column flexes. */\n width?: number;\n /** Lower bound, in pixels, of a flexing column. */\n minWidth?: number;\n align?: \"start\" | \"center\" | \"end\";\n /** Makes the column sortable. The sort state names it by this key. */\n sortKey?: string;\n /**\n * Sorts the rows on the client when this column is sorted. Compare in\n * ascending order; the grid reverses the result for descending.\n */\n compare?: (a: T, b: T, direction: DataGridSortDirection) => number;\n /**\n * Pins the column to an edge. Only the contiguous run of pinned columns at\n * each edge of the displayed order is pinned.\n */\n pin?: \"start\" | \"end\";\n /** Column settings cannot hide it. */\n isAlwaysVisible?: boolean;\n /** Hidden until the user shows it in the column settings. */\n isHiddenByDefault?: boolean;\n /** Fields this column exports as. Without them it cannot be exported. */\n exportKeys?: ReadonlyArray<string>;\n /** Extra attributes for this column's body cells. */\n getCellProps?: (item: T, index: number) => TdHTMLAttributes<HTMLTableCellElement>;\n}\n\n/** Per-column settings a user changed, keyed by column key. */\nexport interface DataGridColumnOverride {\n hidden?: boolean;\n /** Display position. Lower comes first. Set only after a reorder. */\n order?: number;\n /** Resized width in pixels. */\n width?: number;\n}\n\nexport type DataGridColumnOverrides = Record<string, DataGridColumnOverride>;\n\nexport interface DataGridColumnSettings {\n /** Controlled overrides. */\n overrides?: DataGridColumnOverrides;\n /** Initial overrides when uncontrolled; always merged under `overrides`. */\n defaultOverrides?: DataGridColumnOverrides;\n onOverridesChange?: (overrides: DataGridColumnOverrides) => void;\n /** Whether the settings dialog lets the user reorder columns. Default: true */\n isReorderable?: boolean;\n /** Strings of the settings dialog. */\n modalProps?: Pick<\n DataGridSettingsModalProps,\n \"title\" | \"subtitle\" | \"searchLabel\" | \"noMatchText\" | \"applyLabel\" | \"cancelLabel\"\n >;\n}\n\nexport interface DataGridCsvExport {\n /** Export keys the backend can produce. Columns asking for others are disabled. */\n supportedKeys: ReadonlyArray<string>;\n /** Runs the export with the chosen keys. The dialog closes when it resolves. */\n onExport: (keys: string[]) => Promise<void>;\n /** A warning above the column list, e.g. that the export is truncated. */\n notice?: ReactNode;\n /** Strings of the export dialog. */\n modalProps?: Pick<\n DataGridExportModalProps,\n \"title\" | \"subtitle\" | \"searchLabel\" | \"noMatchText\" | \"exportLabel\" | \"cancelLabel\"\n >;\n}\n\nexport interface DataGridSelection<T> {\n /** The selected row keys. Selection is controlled. */\n selectedKeys?: ReadonlyArray<DataGridKey>;\n onChange?: (keys: string[], items: T[]) => void;\n /** Whether a row's checkbox is enabled. Select-all leaves a disabled row as it is. */\n getIsItemEnabled?: (item: T) => boolean;\n /** Accessible name of a row's checkbox. Default: the row key. */\n getRowLabel?: (item: T) => string;\n /** Select-all keeps keys of rows on other pages. Default: false */\n isPreservingOtherPages?: boolean;\n}\n\nexport interface DataGridExpansion<T> {\n renderExpandedRow: (item: T, index: number) => ReactNode;\n getIsRowExpandable?: (item: T) => boolean;\n /** Controlled expanded row keys. */\n expandedKeys?: ReadonlyArray<DataGridKey>;\n defaultExpandedKeys?: ReadonlyArray<DataGridKey>;\n onExpandedKeysChange?: (keys: ReadonlyArray<DataGridKey>) => void;\n /** Header content of the expand-button column. */\n columnHeader?: ReactNode;\n /** Width in pixels of the expand-button column. */\n columnWidth?: number;\n}\n\nexport interface DataGridPagination extends Omit<\n PaginationProps,\n | \"page\"\n | \"totalItems\"\n | \"onChange\"\n | \"onPageSizeChange\"\n | \"label\"\n | \"ref\"\n | \"totalPages\"\n | \"hasMore\"\n> {\n /** Controlled page, 1-based. */\n page?: number;\n defaultPage?: number;\n defaultPageSize?: number;\n /**\n * Total row count. Without it the grid pages `data` itself; a total larger\n * than `data` declares the rows already sliced to the page.\n */\n totalItems?: number;\n onChange?: (page: number, pageSize: number) => void;\n /** Whether the bar offers a page-size choice. Default: true */\n hasPageSizeSelector?: boolean;\n /** Hides the page bar while every row fits on one page. Default: false */\n isHiddenOnSinglePage?: boolean;\n /** Content at the end of the bar. */\n endContent?: ReactNode;\n}\n\ntype AnyRow = Record<string, unknown>;\n\nexport interface DataGridProps<T extends object = AnyRow> extends Omit<\n TableProps<AnyRow>,\n | \"data\"\n | \"columns\"\n | \"idKey\"\n | \"rowIndexStart\"\n | \"rowCount\"\n | \"children\"\n | \"scrollWrapper\"\n | \"ref\"\n | \"emptyState\"\n | \"className\"\n | \"style\"\n | \"plugins\"\n | \"onChange\"\n> {\n data?: ReadonlyArray<T>;\n columns?: ReadonlyArray<DataGridColumn<T>>;\n /**\n * Row identity: a field name or a function. A missing field falls back to\n * the row's `key`, then its `id`, then its position.\n */\n idKey?: string | ((item: T) => DataGridKey);\n /** Dims the rows and blocks input while data is refetched. */\n isLoading?: boolean;\n /** Drag-to-resize column borders. Default: true */\n isResizable?: boolean;\n /** Controlled sort; `null` for none. */\n sort?: DataGridSort | null;\n defaultSort?: DataGridSort | null;\n onSortChange?: (sort: DataGridSort | null) => void;\n selection?: DataGridSelection<T>;\n /** The page bar. `false` shows every row and no bar. */\n pagination?: false | DataGridPagination;\n /** Enables the column settings button and persists resized widths. */\n columnSettings?: DataGridColumnSettings;\n /** Enables the CSV export button. */\n csvExport?: DataGridCsvExport;\n expansion?: DataGridExpansion<T>;\n /**\n * Shown in place of the rows when there are none. A string gets the default\n * icon and layout, a node is rendered as is, `false` shows nothing. Default:\n * the catalog's `uic.DataGrid.noData`.\n */\n emptyState?: ReactNode | false;\n /** Extra attributes for a body row. */\n getRowProps?: (\n item: T,\n index: number | undefined,\n ) => HTMLAttributes<HTMLTableRowElement>;\n /**\n * Scrolls horizontally with the table at this width (at least the\n * container's). Columns without a width then size to their content.\n */\n scrollWidth?: number | string;\n /** Caps the rows' height and makes the header sticky. */\n maxHeight?: number | string;\n /** Hides the header row, and with it sorting and select-all. */\n isHeaderHidden?: boolean;\n /** Accessible name of the expand buttons. Default: the catalog's `uic.DataGrid.expandRow` */\n expandRowLabel?: string;\n /** Shown when the page lies past the last one. Default: the catalog's `uic.DataGrid.invalidPage` */\n invalidPageText?: string;\n /** Default: the catalog's `uic.DataGrid.goToFirstPage` */\n goToFirstPageLabel?: string;\n /** Accessible name of the page navigation. Default: the catalog's `uic.DataGrid.pagination` */\n paginationLabel?: string;\n /** The range line beside the page navigation. Default: the catalog's `uic.DataGrid.range` */\n renderRange?: (range: { start: number; end: number; total: number }) => ReactNode;\n /** Default: the catalog's `uic.DataGrid.settings` */\n settingsLabel?: string;\n /** Default: the catalog's `uic.DataGrid.exportCsv` */\n exportLabel?: string;\n className?: string;\n style?: CSSProperties;\n}\n\nconst EXPAND_COLUMN_KEY = \"__uic_expand__\";\n/** Key of the checkbox column Astryx's selection plugin injects; not exported by Astryx. */\nconst SELECTION_COLUMN_KEY = \"__xds_selection\";\n/**\n * Measured column widths, in pixels. Selection: Astryx's 24px first-column\n * inset + the 20px checkbox + an 8px trailing pad (the plugin's own 36 lets\n * the checkbox overhang its cell). Expand: the same inset + the 24px button +\n * 8px, or an 8px lead-in instead of the inset behind a selection column.\n */\nconst SELECTION_COLUMN_WIDTH = 52;\nconst EXPAND_COLUMN_WIDTH_FIRST = 56;\nconst EXPAND_COLUMN_WIDTH_AFTER_SELECTION = 40;\nconst MIN_COLUMN_WIDTH = 60;\nconst DETAIL_ROW_MARKER = \"__uic_detail_for__\";\nconst DEFAULT_PAGE_SIZE = 10;\nconst DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50];\n\nconst EMPTY_STATE_ICON = <Icon icon={Inbox} size=\"lg\" color=\"secondary\" />;\n\nconst X_HEADER_RELEASE: CSSProperties = { width: \"auto\", maxWidth: \"none\" };\nconst X_BODY_RELEASE: CSSProperties = { maxWidth: \"none\" };\n// Inline beats the sticky-header rule's z 2 for pinned header cells.\nconst Y_PINNED_HEADER_STACK: CSSProperties = { zIndex: 3 };\n\nconst isDetailRow = (item: unknown): item is AnyRow =>\n !!item && typeof item === \"object\" && DETAIL_ROW_MARKER in item;\n\nconst toCssLength = (value: number | string): string =>\n typeof value === \"number\" ? `${value}px` : value;\n\nfunction mergeCellStyle<P extends { htmlProps: { style?: CSSProperties } }>(\n props: P,\n extra: CSSProperties,\n): P {\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n style: props.htmlProps.style ? { ...props.htmlProps.style, ...extra } : extra,\n },\n };\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/** The label a column carries in the settings and export dialogs. */\nexport function dataGridColumnLabel<T>(column: DataGridColumn<T>): string {\n if (column.label) return column.label;\n const own = nodeToPlainText(column.header).trim();\n const group = nodeToPlainText(column.groupHeader).trim();\n const label = group && own ? `${group} / ${own}` : own || group;\n return label || column.key;\n}\n\n/** Whether a column shows, given the user's overrides. */\n/**\n * The overrides record a settings dialog result writes. `defaultOverrides`\n * stays merged under it key by key, and a key it holds replaces the default's\n * entry whole. So a column is left out only while its default (natural, then\n * `defaultOverrides`) already renders what the user chose, and an entry that\n * is written states everything that differs from the natural column:\n * otherwise re-showing a column the defaults hide, or restoring the natural\n * order over a reordering default, would bring the default back.\n *\n * @internal Exported for tests.\n */\nexport function dataGridSettingsToOverrides({\n columns,\n result,\n defaultOverrides = {},\n overrides,\n isReorderable,\n}: {\n columns: ReadonlyArray<Pick<DataGridColumn<never>, \"key\" | \"isHiddenByDefault\">>;\n result: DataGridSettingsResult;\n defaultOverrides?: DataGridColumnOverrides;\n /** The overrides in effect, defaults merged; their widths are kept. */\n overrides: DataGridColumnOverrides;\n isReorderable: boolean;\n}): DataGridColumnOverrides {\n const naturalOrder = columns.map((column) => column.key);\n // A default order is only undone by stating every column's position.\n const writesOrder =\n isReorderable &&\n (result.columnOrder.length !== naturalOrder.length ||\n result.columnOrder.some((key, index) => key !== naturalOrder[index]) ||\n columns.some((column) => defaultOverrides[column.key]?.order !== undefined));\n const next: DataGridColumnOverrides = {};\n for (const column of columns) {\n const fallback = defaultOverrides[column.key];\n const naturalHidden = !!column.isHiddenByDefault;\n const defaultHidden = fallback?.hidden ?? naturalHidden;\n const hidden = !result.selectedColumnKeys.includes(column.key);\n const override: DataGridColumnOverride = {};\n if (hidden !== naturalHidden || hidden !== defaultHidden) override.hidden = hidden;\n if (writesOrder) {\n const orderIndex = result.columnOrder.indexOf(column.key);\n if (orderIndex !== -1) override.order = orderIndex;\n }\n // A settings change must not reset resized widths.\n const width = overrides[column.key]?.width;\n if (typeof width === \"number\") override.width = width;\n const matchesDefault =\n hidden === defaultHidden &&\n override.order === fallback?.order &&\n override.width === fallback?.width;\n if (!matchesDefault && Object.keys(override).length > 0)\n next[column.key] = override;\n }\n return next;\n}\n\nexport function isDataGridColumnVisible<T>(\n column: Pick<DataGridColumn<T>, \"key\" | \"isAlwaysVisible\" | \"isHiddenByDefault\">,\n overrides?: DataGridColumnOverrides,\n): boolean {\n if (column.isAlwaysVisible) return true;\n const hidden = overrides?.[column.key]?.hidden;\n return hidden !== undefined ? !hidden : !column.isHiddenByDefault;\n}\n\n/** Controlled when `value` is not undefined; the setter writes state only when uncontrolled. */\nfunction useControllableState<V>(value: V | undefined, initial: () => V) {\n const [state, setState] = useState<V>(initial);\n const isControlled = value !== undefined;\n const current = isControlled ? value : state;\n const set = (next: V) => {\n if (!isControlled) setState(next);\n };\n return [current, set] as const;\n}\n\nexport function DataGrid<T extends object = AnyRow>({\n data,\n columns = [],\n idKey = \"id\",\n isLoading = false,\n isResizable = true,\n sort: sortProp,\n defaultSort,\n onSortChange,\n selection,\n pagination,\n columnSettings,\n csvExport,\n expansion,\n emptyState,\n getRowProps,\n scrollWidth,\n maxHeight,\n isHeaderHidden = false,\n expandRowLabel,\n invalidPageText,\n goToFirstPageLabel,\n paginationLabel,\n renderRange,\n settingsLabel,\n exportLabel,\n density = \"compact\",\n dividers = \"rows\",\n hasHover = true,\n textOverflow = \"truncate\",\n className,\n style,\n ...tableProps\n}: DataGridProps<T>): ReactElement {\n const t = useUicTranslator();\n\n const isScrollX = scrollWidth !== undefined;\n const isScrollY = maxHeight !== undefined;\n\n const [isSettingsOpen, setIsSettingsOpen] = useState(false);\n const [isExportOpen, setIsExportOpen] = useState(false);\n\n /* ---- column overrides (visibility / order / width) ------------------- */\n\n const [storedOverrides, setStoredOverrides] = useState<DataGridColumnOverrides>(\n () => columnSettings?.defaultOverrides ?? {},\n );\n const isOverridesControlled = columnSettings?.overrides !== undefined;\n const ownOverrides = isOverridesControlled\n ? (columnSettings?.overrides ?? {})\n : storedOverrides;\n const setOverrides = (next: DataGridColumnOverrides) => {\n if (!isOverridesControlled) setStoredOverrides(next);\n columnSettings?.onOverridesChange?.(next);\n };\n const overrides: DataGridColumnOverrides = {\n ...(columnSettings?.defaultOverrides ?? {}),\n ...ownOverrides,\n };\n const isReorderable = !!columnSettings && columnSettings.isReorderable !== false;\n\n /* ---- resized widths ---------------------------------------------------- */\n\n // With columnSettings a width rides in the overrides record, so a resize\n // persists like a visibility change; without it the width is local state.\n const [localWidths, setLocalWidths] = useState<Record<string, number>>({});\n const columnWidths: Record<string, number> = {};\n if (columnSettings) {\n for (const [key, override] of Object.entries(overrides)) {\n if (typeof override?.width === \"number\") columnWidths[key] = override.width;\n }\n } else {\n Object.assign(columnWidths, localWidths);\n }\n\n const handleResizeEnd = (updates: Record<string, number>) => {\n if (!columnSettings) {\n setLocalWidths((prev) => ({ ...prev, ...updates }));\n return;\n }\n const next: DataGridColumnOverrides = { ...ownOverrides };\n for (const [key, width] of Object.entries(updates)) {\n if (key === EXPAND_COLUMN_KEY) continue;\n next[key] = { ...next[key], width };\n }\n setOverrides(next);\n };\n\n /* ---- row keys ---------------------------------------------------------- */\n\n const getRowKey = (item: T): string => {\n if (typeof idKey === \"function\") return String(idKey(item));\n const row = item as AnyRow;\n const direct = row[idKey];\n if (direct != null) return String(direct);\n const fallback = row.key ?? row.id;\n if (fallback != null) return String(fallback);\n return `__row_${data ? data.indexOf(item) : -1}`;\n };\n\n /* ---- sort -------------------------------------------------------------- */\n\n const [activeSort, setActiveSort] = useControllableState<DataGridSort | null>(\n sortProp,\n () => defaultSort ?? null,\n );\n\n const sortedRows = ((): T[] => {\n const source = data ? [...data] : [];\n if (!activeSort) return source;\n const compare = columns.find(\n (column) => column.sortKey === activeSort.sortKey && column.compare,\n )?.compare;\n if (!compare) return source;\n const { direction } = activeSort;\n return source.sort((a, b) =>\n direction === \"descending\" ? -compare(a, b, direction) : compare(a, b, direction),\n );\n })();\n\n /* ---- pagination -------------------------------------------------------- */\n\n const pager = pagination === false ? undefined : (pagination ?? {});\n const [currentPage, setCurrentPage] = useControllableState<number>(\n pager?.page,\n () => pager?.defaultPage ?? 1,\n );\n const [pageSize, setPageSize] = useControllableState<number>(\n pager?.pageSize,\n () => pager?.defaultPageSize ?? DEFAULT_PAGE_SIZE,\n );\n\n // Astryx's Pagination answers a page-size pick with onPageSizeChange(size)\n // and then onChange(1) in the same event, still closing over the old size.\n // Forwarding the second call would undo the pick on a controlled grid, so it\n // is dropped; a microtask clears the flag.\n const isPageSizeChangingRef = useRef(false);\n\n const total = pager?.totalItems ?? sortedRows.length;\n const lastPage = Math.max(1, Math.ceil(total / pageSize));\n const activePage = clamp(currentPage, 1, lastPage);\n const isPageOutOfRange =\n !!pager && total > 0 && (currentPage < 1 || currentPage > lastPage);\n // A total above the rows in hand means they are already one page.\n const isServerSliced = total > sortedRows.length;\n const pagedRows =\n pager && !isServerSliced && sortedRows.length > pageSize\n ? sortedRows.slice((activePage - 1) * pageSize, activePage * pageSize)\n : sortedRows;\n const rows = isPageOutOfRange ? [] : pagedRows;\n\n /* ---- expansion --------------------------------------------------------- */\n\n const [storedExpandedKeys, setStoredExpandedKeys] = useState<DataGridKey[]>(() => [\n ...(expansion?.defaultExpandedKeys ?? []),\n ]);\n const expandedKeys = expansion?.expandedKeys ?? storedExpandedKeys;\n const expandedKeySet = new Set(expandedKeys.map(String));\n const hasExpansion = !!expansion;\n const expandColumnWidth =\n expansion?.columnWidth ??\n (selection ? EXPAND_COLUMN_WIDTH_AFTER_SELECTION : EXPAND_COLUMN_WIDTH_FIRST);\n const detailInsetStart = (selection ? SELECTION_COLUMN_WIDTH : 0) + expandColumnWidth;\n\n const toggleExpanded = (key: string) => {\n const next = expandedKeySet.has(key)\n ? expandedKeys.filter((k) => String(k) !== key)\n : [...expandedKeys, key];\n if (!expansion?.expandedKeys) setStoredExpandedKeys(next);\n expansion?.onExpandedKeysChange?.(next);\n };\n\n const rowIndexByKey = new Map<string, number>();\n rows.forEach((item, index) => rowIndexByKey.set(getRowKey(item), index));\n\n // Each expanded row is followed by a marker row the expansion plugin turns\n // into one full-width cell.\n const tableData: AnyRow[] = [];\n for (const item of rows) {\n tableData.push(item as AnyRow);\n if (!hasExpansion) continue;\n const key = getRowKey(item);\n if (expandedKeySet.has(key) && (expansion?.getIsRowExpandable?.(item) ?? true)) {\n tableData.push({ [DETAIL_ROW_MARKER]: key, id: `${key}__detail` });\n }\n }\n\n // From every row, not the page: selection resolves keys on other pages too.\n const itemByKey = new Map<string, T>();\n sortedRows.forEach((item) => itemByKey.set(getRowKey(item), item));\n\n /* ---- Astryx columns ---------------------------------------------------- */\n\n const tableColumns: TableColumn<AnyRow>[] = [];\n if (hasExpansion) {\n tableColumns.push({\n key: EXPAND_COLUMN_KEY,\n header: expansion?.columnHeader ?? \"\",\n width: pixel(expandColumnWidth),\n resizable: false,\n renderCell: (row) => {\n if (isDetailRow(row)) return null;\n const item = row as T;\n if (!(expansion?.getIsRowExpandable?.(item) ?? true)) return null;\n const key = getRowKey(item);\n return (\n <IconButton\n label={expandRowLabel ?? t(\"uic.DataGrid.expandRow\")}\n icon={expandedKeySet.has(key) ? <ChevronDown /> : <ChevronRight />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => toggleExpanded(key)}\n />\n );\n },\n });\n }\n\n for (const column of columns) {\n const width = columnWidths[column.key] ?? column.width;\n const header = (\n <span className=\"uic-data-grid__clip\">\n {column.groupHeader == null ? (\n column.header\n ) : (\n <VStack gap={0} align=\"start\">\n <Text type=\"supporting\" color=\"secondary\">\n {column.groupHeader}\n </Text>\n <span>{column.header}</span>\n </VStack>\n )}\n </span>\n );\n tableColumns.push({\n key: column.key,\n header,\n align: column.align === \"start\" ? undefined : column.align,\n sortable: column.sortKey ? { sortKey: column.sortKey } : false,\n resizable: isResizable,\n // In scroll-x mode a width-less column takes no width, so its content sizes it.\n width:\n width != null\n ? pixel(width)\n : isScrollX\n ? undefined\n : proportional(\n 1,\n typeof column.minWidth === \"number\"\n ? { minWidth: column.minWidth }\n : undefined,\n ),\n renderCell: (row) => {\n if (isDetailRow(row)) return null;\n const item = row as T;\n const content = column.renderCell\n ? column.renderCell(item, rowIndexByKey.get(getRowKey(item)) ?? 0)\n : defaultCell(row[column.key]);\n if (textOverflow !== \"truncate\" || content == null) return content;\n return <span className=\"uic-data-grid__clip\">{content}</span>;\n },\n });\n }\n\n /* ---- visibility + order ------------------------------------------------ */\n\n const visibleColumns = columnSettings\n ? columns.filter((column) => isDataGridColumnVisible(column, overrides))\n : [...columns];\n const orderedColumns = isReorderable\n ? visibleColumns\n .map((column, index) => ({ column, index }))\n .sort(\n (a, b) =>\n (overrides[a.column.key]?.order ?? Number.MAX_SAFE_INTEGER) -\n (overrides[b.column.key]?.order ?? Number.MAX_SAFE_INTEGER) ||\n a.index - b.index,\n )\n .map(({ column }) => column)\n : visibleColumns;\n const activeColumnKeys = [\n ...(hasExpansion ? [EXPAND_COLUMN_KEY] : []),\n ...orderedColumns.map((column) => column.key),\n ];\n\n const columnSettingsPlugin = useTableColumnSettings<AnyRow>({\n columns: [\n ...(hasExpansion\n ? [{ key: EXPAND_COLUMN_KEY, label: \"\", isAlwaysVisible: true }]\n : []),\n ...columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n isAlwaysVisible: !!column.isAlwaysVisible,\n })),\n ],\n activeColumnKeys,\n // The settings dialog owns the write path (it keeps `order` and `width`).\n onChangeActiveColumnKeys: () => {},\n });\n\n /* ---- pinning ----------------------------------------------------------- */\n\n const startKeys: string[] = [];\n for (const column of orderedColumns) {\n if (column.pin === \"start\") startKeys.push(column.key);\n else break;\n }\n const endKeys: string[] = [];\n for (const column of [...orderedColumns].reverse()) {\n if (column.pin === \"end\") endKeys.unshift(column.key);\n else break;\n }\n const stickyConfig = {\n startKeys:\n startKeys.length === 0\n ? undefined\n : [\n ...(selection ? [SELECTION_COLUMN_KEY] : []),\n ...(hasExpansion ? [EXPAND_COLUMN_KEY] : []),\n ...startKeys,\n ],\n endKeys: endKeys.length === 0 ? undefined : endKeys,\n };\n const stickyPlugin = useTableStickyColumns<AnyRow>(\n stickyConfig.startKeys || stickyConfig.endKeys ? stickyConfig : {},\n );\n\n /* ---- per-cell / per-row attributes -------------------------------------- */\n\n const columnByKey = new Map(columns.map((column) => [column.key, column]));\n\n const cellRowPlugin: TablePlugin<AnyRow> = {\n transformBodyCell: (props, column, row) => {\n if (isDetailRow(row)) return props;\n const item = row as T;\n const extra = columnByKey\n .get(column.key)\n ?.getCellProps?.(item, rowIndexByKey.get(getRowKey(item)) ?? 0);\n if (!extra) return props;\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n ...extra,\n style: { ...props.htmlProps.style, ...extra.style },\n },\n };\n },\n transformBodyRow: (props, row) => {\n if (!getRowProps || isDetailRow(row)) return props;\n const item = row as T;\n const extra = getRowProps(item, rowIndexByKey.get(getRowKey(item)));\n if (!extra) return props;\n return {\n ...props,\n htmlProps: {\n ...props.htmlProps,\n ...extra,\n style: { ...props.htmlProps.style, ...extra.style },\n },\n };\n },\n };\n\n // Astryx clips cells with `max-width: 0`; scroll-x releases width-less columns only.\n const scrollXPlugin: TablePlugin<AnyRow> = {\n transformHeaderCell: (props, column) =>\n column.width != null ? props : mergeCellStyle(props, X_HEADER_RELEASE),\n transformBodyCell: (props, column) =>\n column.width != null ? props : mergeCellStyle(props, X_BODY_RELEASE),\n };\n\n const pinnedKeys = new Set([\n ...(stickyConfig.startKeys ?? []),\n ...(stickyConfig.endKeys ?? []),\n ]);\n const scrollYPlugin: TablePlugin<AnyRow> = {\n transformHeaderCell: (props, column) =>\n pinnedKeys.has(column.key) ? mergeCellStyle(props, Y_PINNED_HEADER_STACK) : props,\n };\n\n /* ---- sorting ----------------------------------------------------------- */\n\n const sortState: TableSortState = activeSort\n ? [{ sortKey: activeSort.sortKey, direction: activeSort.direction }]\n : [];\n\n const sortPlugin = useTableSortable<AnyRow>({\n sort: sortState,\n allowUnsortedState: true,\n onSortChange: (next) => {\n const first = next[0];\n const nextSort: DataGridSort | null = first\n ? { sortKey: first.sortKey, direction: first.direction }\n : null;\n setActiveSort(nextSort);\n onSortChange?.(nextSort);\n },\n });\n\n /* ---- selection --------------------------------------------------------- */\n\n const selectedKeySet = new Set((selection?.selectedKeys ?? []).map(String));\n const emitSelection = (keys: string[]) => {\n const items = keys\n .map((key) => itemByKey.get(key))\n .filter((item) => item !== undefined);\n selection?.onChange?.(keys, items);\n };\n const isRowSelected = (item: T) => selectedKeySet.has(getRowKey(item));\n const isRowEnabled = (item: T) => selection?.getIsItemEnabled?.(item) ?? true;\n // Select-all acts on the enabled rows only; a disabled row keeps its state.\n const enabledRows = rows.filter(isRowEnabled);\n\n const selectionPlugin = useTableSelection<AnyRow>({\n getIsItemSelectable: (row) => !isDetailRow(row),\n getIsItemSelected: (row) => !isDetailRow(row) && isRowSelected(row as T),\n getIsItemEnabled: (row) => !isDetailRow(row) && isRowEnabled(row as T),\n getRowLabel: (row) =>\n isDetailRow(row)\n ? \"\"\n : (selection?.getRowLabel?.(row as T) ?? getRowKey(row as T)),\n getIsAllSelected: () => enabledRows.length > 0 && enabledRows.every(isRowSelected),\n getIsIndeterminate: () =>\n enabledRows.some(isRowSelected) && !enabledRows.every(isRowSelected),\n onSelectItem: ({ item, isSelected }) => {\n if (isDetailRow(item)) return;\n const key = getRowKey(item as T);\n const next = new Set(selectedKeySet);\n if (isSelected) next.add(key);\n else next.delete(key);\n emitSelection([...next]);\n },\n onSelectAll: ({ isAllSelected }) => {\n const next = new Set(selection?.isPreservingOtherPages ? selectedKeySet : []);\n for (const item of rows) {\n const key = getRowKey(item);\n const isSelected = isRowEnabled(item) ? isAllSelected : isRowSelected(item);\n if (isSelected) next.add(key);\n else next.delete(key);\n }\n emitSelection([...next]);\n },\n });\n\n const selectionWidthPlugin: TablePlugin<AnyRow> = {\n transformColumns: (cols) =>\n cols.map((column) =>\n column.key === SELECTION_COLUMN_KEY\n ? { ...column, width: pixel(SELECTION_COLUMN_WIDTH) }\n : column,\n ),\n };\n\n /* ---- resize ------------------------------------------------------------ */\n\n const resizePlugin = useTableColumnResize<AnyRow>({\n columns: tableColumns,\n columnWidths,\n minWidth: MIN_COLUMN_WIDTH,\n onColumnResizeEnd: handleResizeEnd,\n });\n\n /* ---- expansion --------------------------------------------------------- */\n\n const renderedColumnCount = activeColumnKeys.length + (selection ? 1 : 0);\n const expansionPlugin: TablePlugin<AnyRow> = {\n transformBodyRow: (props, row) => {\n if (!isDetailRow(row)) return props;\n const parentKey = String(row[DETAIL_ROW_MARKER]);\n const item = itemByKey.get(parentKey);\n if (!item) return props;\n return {\n ...props,\n children: (\n <td\n colSpan={renderedColumnCount}\n className=\"uic-data-grid__detail\"\n style={{ paddingInlineStart: detailInsetStart }}\n >\n {expansion?.renderExpandedRow(item, rowIndexByKey.get(parentKey) ?? 0)}\n </td>\n ),\n };\n },\n };\n\n const plugins: Record<string, TablePlugin<AnyRow>> = {\n columnSettings: columnSettingsPlugin,\n sort: sortPlugin,\n };\n if (selection) {\n plugins.selection = selectionPlugin;\n plugins.selectionWidth = selectionWidthPlugin;\n }\n if (isResizable) plugins.resize = resizePlugin;\n plugins.sticky = stickyPlugin;\n if (isScrollX) plugins.scrollX = scrollXPlugin;\n // Without pinned columns the sticky header is pure CSS.\n if (isScrollY && pinnedKeys.size > 0) plugins.scrollY = scrollYPlugin;\n plugins.cellRow = cellRowPlugin;\n if (hasExpansion) plugins.expansion = expansionPlugin;\n\n /* ---- bottom bar -------------------------------------------------------- */\n\n const {\n page: _page,\n defaultPage: _defaultPage,\n defaultPageSize: _defaultPageSize,\n totalItems: _totalItems,\n onChange: _onChange,\n hasPageSizeSelector = true,\n isHiddenOnSinglePage = false,\n endContent,\n pageSizeOptions,\n size: pagerSize = \"sm\",\n ...paginationRest\n } = pager ?? {};\n\n const rangeStart = total === 0 ? 0 : (activePage - 1) * pageSize + 1;\n const rangeEnd = Math.min(activePage * pageSize, total);\n const isPagerVisible = !!pager && !(isHiddenOnSinglePage && total <= pageSize);\n const hasBottomBar = isPagerVisible || !!columnSettings || !!csvExport;\n\n const emptyStateNode = isPageOutOfRange ? (\n // The way back outranks any empty state the caller gave.\n <EmptyState\n isCompact\n icon={EMPTY_STATE_ICON}\n title={invalidPageText ?? t(\"uic.DataGrid.invalidPage\")}\n actions={\n <Button\n variant=\"primary\"\n label={goToFirstPageLabel ?? t(\"uic.DataGrid.goToFirstPage\")}\n onClick={() => {\n setCurrentPage(1);\n pager?.onChange?.(1, pageSize);\n }}\n />\n }\n />\n ) : emptyState === false ? (\n false\n ) : emptyState == null || typeof emptyState === \"string\" ? (\n <EmptyState\n isCompact\n icon={EMPTY_STATE_ICON}\n title={emptyState ?? t(\"uic.DataGrid.noData\")}\n />\n ) : (\n emptyState\n );\n\n const applySettings = (result: DataGridSettingsResult) => {\n setIsSettingsOpen(false);\n setOverrides(\n dataGridSettingsToOverrides({\n columns,\n result,\n defaultOverrides: columnSettings?.defaultOverrides,\n overrides,\n isReorderable,\n }),\n );\n };\n\n return (\n <div\n className={[\"uic-data-grid\", className].filter(Boolean).join(\" \")}\n style={style}\n >\n <div\n aria-busy={isLoading || undefined}\n className={[\n \"uic-data-grid__body\",\n isLoading && \"uic-data-grid__body--loading\",\n isHeaderHidden && \"uic-data-grid__body--no-header\",\n dividers !== \"grid\" && \"uic-data-grid__body--header-split\",\n isScrollX && \"uic-data-grid__body--scroll-x\",\n isScrollY && \"uic-data-grid__body--scroll-y\",\n ]\n .filter(Boolean)\n .join(\" \")}\n style={\n {\n ...(isScrollX\n ? { \"--data-grid-scroll-width\": toCssLength(scrollWidth) }\n : null),\n ...(isScrollY\n ? { \"--data-grid-max-height\": toCssLength(maxHeight) }\n : null),\n } as CSSProperties\n }\n >\n <Table<AnyRow>\n {...tableProps}\n data={tableData}\n columns={tableColumns}\n idKey={(row: AnyRow) =>\n isDetailRow(row)\n ? `${String(row[DETAIL_ROW_MARKER])}__detail`\n : getRowKey(row as T)\n }\n density={density}\n dividers={dividers}\n hasHover={hasHover}\n textOverflow={textOverflow}\n emptyState={emptyStateNode}\n rowCount={total || undefined}\n rowIndexStart={pager ? (activePage - 1) * pageSize + 1 : undefined}\n plugins={plugins}\n />\n </div>\n\n {hasBottomBar ? (\n <HStack justify=\"end\" align=\"center\" gap={2} className=\"uic-data-grid__footer\">\n {isPagerVisible ? (\n <>\n <Text type=\"supporting\" color=\"secondary\">\n {renderRange\n ? renderRange({ start: rangeStart, end: rangeEnd, total })\n : t(\"uic.DataGrid.range\", {\n start: rangeStart,\n end: rangeEnd,\n total,\n })}\n </Text>\n <Pagination\n variant=\"pages\"\n {...paginationRest}\n page={activePage}\n pageSize={pageSize}\n totalItems={total}\n // Astryx shows the size choice exactly when options are passed.\n pageSizeOptions={\n hasPageSizeSelector\n ? (pageSizeOptions ?? DEFAULT_PAGE_SIZE_OPTIONS)\n : undefined\n }\n size={pagerSize}\n label={paginationLabel ?? t(\"uic.DataGrid.pagination\")}\n onChange={(page) => {\n if (isPageSizeChangingRef.current) return;\n setCurrentPage(page);\n pager?.onChange?.(page, pageSize);\n }}\n onPageSizeChange={(nextSize) => {\n isPageSizeChangingRef.current = true;\n queueMicrotask(() => {\n isPageSizeChangingRef.current = false;\n });\n setCurrentPage(1);\n setPageSize(nextSize);\n pager?.onChange?.(1, nextSize);\n }}\n />\n </>\n ) : null}\n {columnSettings ? (\n <IconButton\n label={settingsLabel ?? t(\"uic.DataGrid.settings\")}\n icon={<Settings />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsSettingsOpen(true)}\n />\n ) : null}\n {csvExport ? (\n <IconButton\n label={exportLabel ?? t(\"uic.DataGrid.exportCsv\")}\n icon={<FileDown />}\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsExportOpen(true)}\n />\n ) : null}\n {pager ? endContent : null}\n </HStack>\n ) : null}\n\n {columnSettings ? (\n <DataGridSettingsModal\n {...columnSettings.modalProps}\n isOpen={isSettingsOpen}\n onOpenChange={setIsSettingsOpen}\n columns={columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n isAlwaysVisible: !!column.isAlwaysVisible,\n }))}\n visibleColumnKeys={orderedColumns.map((column) => column.key)}\n isReorderable={isReorderable}\n onApply={applySettings}\n />\n ) : null}\n\n {csvExport ? (\n <DataGridExportModal\n {...csvExport.modalProps}\n isOpen={isExportOpen}\n onOpenChange={setIsExportOpen}\n columns={columns.map((column) => ({\n key: column.key,\n label: dataGridColumnLabel(column),\n exportKeys: column.exportKeys ?? [],\n }))}\n supportedKeys={csvExport.supportedKeys}\n notice={csvExport.notice}\n onExport={async (keys) => {\n await csvExport.onExport(keys);\n setIsExportOpen(false);\n }}\n />\n ) : null}\n </div>\n );\n}\n\nfunction defaultCell(value: unknown): ReactNode {\n if (value == null || value === \"\") return null;\n if (isValidElement(value)) return value;\n return String(value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgTA,IAAM,IAAoB,kBAEpB,KAAuB,mBAOvB,KAAyB,IACzB,KAA4B,IAC5B,KAAsC,IACtC,KAAmB,IACnB,IAAoB,sBACpB,KAAoB,IACpB,KAA4B;CAAC;CAAI;CAAI;AAAE,GAEvC,KAAmB,kBAAC,GAAD;CAAM,MAAM;CAAO,MAAK;CAAK,O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EAAO,cAAc,CAAC;IACpC,EAAE;IACF,eAAe,EAAU;IACzB,QAAQ,EAAU;IAClB,UAAU,OAAO,MAAS;KAExB,AADA,MAAM,EAAU,SAAS,CAAI,GAC7B,GAAgB,EAAK;IACvB;GACD,CAAA,IACC;EACD;;AAET;AAEA,SAAS,GAAY,GAA2B;CAG9C,OAFI,KAAS,QAAQ,MAAU,KAAW,OACtC,EAAe,CAAK,IAAU,IAC3B,OAAO,CAAK;AACrB"}
@@ -14,6 +14,11 @@ export interface FormItemProps<Values = any> extends Omit<FieldProps, "children"
14
14
  * overlay and are ignored.
15
15
  */
16
16
  tooltip?: React.ReactNode | FormItemTooltipConfig;
17
+ /**
18
+ * Actions for the label row: far end in vertical layout, right after the
19
+ * label in horizontal / inline layout. Needs a `label`.
20
+ */
21
+ labelExtra?: React.ReactNode;
17
22
  extra?: React.ReactNode;
18
23
  /** `false` also suppresses meta bubbling to an ancestor item. */
19
24
  help?: React.ReactNode;
@@ -47,7 +52,7 @@ export interface FormItemTooltipConfig {
47
52
  declare const FormItem: <Values>(props: FormItemProps<Values>) => React.JSX.Element;
48
53
  /** Errors/warnings of the nearest enclosing `Form.Item`. */
49
54
  export declare const useFormItemStatus: () => {
50
- status: "" | "success" | "error" | "warning" | "validating" | undefined;
55
+ status: "" | "error" | "success" | "warning" | "validating" | undefined;
51
56
  errors: React.ReactNode[];
52
57
  warnings: React.ReactNode[];
53
58
  };
@@ -2,17 +2,17 @@ import { useUicTranslator as e } from "../../i18n/useUicTranslator.js";
2
2
  import { FieldContext as t, FormConfigContext as n, FormItemInputContext as r, FormItemLayoutContext as i, ListContext as a, NoStyleItemContext as o } from "./context.js";
3
3
  import { toArray as s } from "./namePath.js";
4
4
  import c from "./Field.js";
5
- import { FormItemVisual as ee } from "./FormItemVisual2.js";
6
- import * as l from "react";
7
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { FormItemVisual as l } from "./FormItemVisual2.js";
6
+ import * as u from "react";
7
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
8
  //#region src/components/Form/FormItem.tsx
9
- var te = "__SPLIT__", p = ["parentNode"];
10
- function m(e, t) {
9
+ var ee = "__SPLIT__", m = ["parentNode"];
10
+ function h(e, t) {
11
11
  if (!e.length) return;
12
12
  let n = e.join("_");
13
- return t ? `${t}_${n}` : p.includes(n) ? `form_item_${n}` : n;
13
+ return t ? `${t}_${n}` : m.includes(n) ? `form_item_${n}` : n;
14
14
  }
15
- function h() {
15
+ function g() {
16
16
  return {
17
17
  errors: [],
18
18
  warnings: [],
@@ -22,115 +22,116 @@ function h() {
22
22
  validated: !1
23
23
  };
24
24
  }
25
- function ne(e, t, n, r, i) {
25
+ function te(e, t, n, r, i) {
26
26
  return i === void 0 ? n.validating ? "validating" : e.length ? "error" : t.length ? "warning" : n.touched || r && n.validated ? "success" : "" : i;
27
27
  }
28
- var g = (e) => !!e && typeof e == "object" && !l.isValidElement(e) && "title" in e;
29
- function re(e) {
30
- return g(e) ? e.title : e;
28
+ var _ = (e) => !!e && typeof e == "object" && !u.isValidElement(e) && "title" in e;
29
+ function ne(e) {
30
+ return _(e) ? e.title : e;
31
31
  }
32
- function _(e) {
33
- return g(e) ? e.icon : void 0;
32
+ function re(e) {
33
+ return _(e) ? e.icon : void 0;
34
34
  }
35
- var v = (u) => {
36
- let { name: f, label: p, tooltip: g, extra: v, help: y, required: b, noStyle: x, hidden: S, layout: oe, className: se, style: ce, hasFeedback: C, validateStatus: le, children: w, rules: T, dependencies: E, shouldUpdate: D, messageVariables: O, trigger: k = "onChange", validateTrigger: A, colon: ue, labelAlign: de, labelCol: j, wrapperCol: M, labelWrap: fe, htmlFor: N, fieldKey: pe, id: me, __values: he, ...P } = u, F = l.useContext(t), { optionalLabel: I } = l.useContext(n), L = e(), { layout: R, requiredMark: z, name: ge, disabled: _e, size: ve, colon: ye, labelAlign: be, labelCol: B, wrapperCol: xe, labelWrap: Se } = l.useContext(i), V = l.useContext(o), Ce = l.useContext(a), we = oe || R, Te = j ?? B, H = M ?? xe, Ee = p === null && !j && !M && B?.span !== void 0 && B.span < 24 ? {
37
- ...H,
35
+ var v = (d) => {
36
+ let { name: p, label: m, tooltip: _, labelExtra: v, extra: y, help: b, required: x, noStyle: S, hidden: C, layout: oe, className: se, style: ce, hasFeedback: w, validateStatus: le, children: T, rules: E, dependencies: D, shouldUpdate: O, messageVariables: k, trigger: A = "onChange", validateTrigger: j, colon: ue, labelAlign: de, labelCol: M, wrapperCol: N, labelWrap: fe, htmlFor: pe, fieldKey: me, id: he, __values: ge, ...P } = d, F = u.useContext(t), { optionalLabel: I } = u.useContext(n), L = e(), { layout: R, requiredMark: z, name: _e, disabled: ve, size: ye, colon: be, labelAlign: xe, labelCol: B, wrapperCol: V, labelWrap: Se } = u.useContext(i), H = u.useContext(o), Ce = u.useContext(a), we = oe || R, Te = M ?? B, U = N ?? V, Ee = m === null && !M && !N && B?.span !== void 0 && B.span < 24 ? {
37
+ ...U,
38
38
  offset: B.span
39
- } : H, U = A === void 0 ? F.validateTrigger : A, [W, De] = l.useState(h), [G, Oe] = l.useState({}), K = l.useRef(null), q = (e) => {
39
+ } : U, W = j === void 0 ? F.validateTrigger : j, [G, De] = u.useState(g), [K, Oe] = u.useState({}), q = u.useRef(null), ke = (e) => {
40
40
  let t = Ce?.getKey(e.name);
41
- if (De(e.destroy ? h() : e), x && y !== !1 && V) {
41
+ if (De(e.destroy ? g() : e), S && b !== !1 && H) {
42
42
  let n = e.name;
43
- if (e.destroy) n = K.current || n;
43
+ if (e.destroy) n = q.current || n;
44
44
  else if (t !== void 0) {
45
45
  let [e, r] = t;
46
- n = [e, ...r], K.current = n;
46
+ n = [e, ...r], q.current = n;
47
47
  }
48
- V(e, n);
48
+ H(e, n);
49
49
  }
50
- }, ke = (e, t) => {
50
+ }, Ae = (e, t) => {
51
51
  Oe((n) => {
52
- let r = { ...n }, i = [...e.name.slice(0, -1), ...t].join(te);
52
+ let r = { ...n }, i = [...e.name.slice(0, -1), ...t].join(ee);
53
53
  return e.destroy ? delete r[i] : r[i] = e, r;
54
54
  });
55
- }, J = [...W.errors, ...Object.values(G).flatMap((e) => e.errors ?? [])], Y = [...W.warnings, ...Object.values(G).flatMap((e) => e.warnings ?? [])], X = (e, t, n, i) => {
55
+ }, J = [...G.errors, ...Object.values(K).flatMap((e) => e.errors ?? [])], Y = [...G.warnings, ...Object.values(K).flatMap((e) => e.warnings ?? [])], X = (e, t, n, i) => {
56
56
  let a = {
57
- status: ne(J, Y, W, C, le),
57
+ status: te(J, Y, G, w, le),
58
58
  errors: J,
59
59
  warnings: Y,
60
- hasFeedback: C,
60
+ hasFeedback: w,
61
61
  isFormItemInput: !0
62
62
  };
63
- if (x && !S) return /* @__PURE__ */ d(r.Provider, {
63
+ if (S && !C) return /* @__PURE__ */ f(r.Provider, {
64
64
  value: a,
65
65
  children: e
66
66
  });
67
- let s = z === !1 ? "hidden" : z === "optional" || typeof z == "function" ? "optional" : void 0, c = b === void 0 ? !!n : b, l = ae(p, c, z, I ?? L("uic.Form.optional"));
68
- return /* @__PURE__ */ d(r.Provider, {
67
+ let s = z === !1 ? "hidden" : z === "optional" || typeof z == "function" ? "optional" : void 0, c = x === void 0 ? !!n : x, u = ae(m, c, z, I ?? L("uic.Form.optional"));
68
+ return /* @__PURE__ */ f(r.Provider, {
69
69
  value: a,
70
- children: /* @__PURE__ */ d(ee, {
71
- label: l,
72
- labelTitle: typeof p == "string" ? p : void 0,
73
- tooltip: re(g),
74
- tooltipIcon: _(g),
75
- extra: v,
76
- help: y,
70
+ children: /* @__PURE__ */ f(l, {
71
+ label: u,
72
+ labelTitle: typeof m == "string" ? m : void 0,
73
+ tooltip: ne(_),
74
+ tooltipIcon: re(_),
75
+ labelExtra: v,
76
+ extra: y,
77
+ help: b,
77
78
  required: c,
78
79
  requiredMarkType: s,
79
80
  layout: we,
80
- size: ve,
81
- colon: ue ?? ye,
82
- labelAlign: de ?? be,
81
+ size: ye,
82
+ colon: ue ?? be,
83
+ labelAlign: de ?? xe,
83
84
  labelCol: Te,
84
85
  wrapperCol: Ee,
85
86
  labelWrap: fe ?? Se,
86
87
  status: a.status,
87
- hasFeedback: C,
88
+ hasFeedback: w,
88
89
  className: se,
89
90
  style: ce,
90
- hidden: S,
91
+ hidden: C,
91
92
  fieldId: t,
92
93
  fieldHandle: i,
93
- htmlFor: N,
94
+ htmlFor: pe,
94
95
  errors: J,
95
96
  warnings: Y,
96
- children: /* @__PURE__ */ d(o.Provider, {
97
- value: ke,
97
+ children: /* @__PURE__ */ f(o.Provider, {
98
+ value: Ae,
98
99
  children: e
99
100
  })
100
101
  })
101
102
  });
102
- }, Z = f != null, Q = typeof w == "function";
103
- if (!Z && !Q && !E) return X(w);
103
+ }, Z = p != null, Q = typeof T == "function";
104
+ if (!Z && !Q && !D) return X(T);
104
105
  let $ = {};
105
- return typeof p == "string" ? $.label = p : f && ($.label = String(f)), O && ($ = {
106
+ return typeof m == "string" ? $.label = m : p && ($.label = String(p)), k && ($ = {
106
107
  ...$,
107
- ...O
108
- }), /* @__PURE__ */ d(c, {
108
+ ...k
109
+ }), /* @__PURE__ */ f(c, {
109
110
  ...P,
110
- name: f,
111
- rules: T,
112
- dependencies: E,
113
- shouldUpdate: D,
111
+ name: p,
112
+ rules: E,
113
+ dependencies: D,
114
+ shouldUpdate: O,
114
115
  messageVariables: $,
115
- trigger: k,
116
- validateTrigger: U,
117
- onMetaChange: q,
116
+ trigger: A,
117
+ validateTrigger: W,
118
+ onMetaChange: ke,
118
119
  children: (e, t, n) => {
119
- let r = s(f).length ? t.name : [], i = m(r, ge), a = b === void 0 ? ie(T, n) : b, o = null;
120
- if (Q && (D || E) && !Z) o = w(n);
121
- else if (l.isValidElement(w)) {
122
- let t = w, n = {
120
+ let r = s(p).length ? t.name : [], i = h(r, _e), a = x === void 0 ? ie(E, n) : x, o = null;
121
+ if (Q && (O || D) && !Z) o = T(n);
122
+ else if (u.isValidElement(T)) {
123
+ let t = T, n = {
123
124
  ...t.props,
124
125
  ...e
125
126
  };
126
- n.id ||= i, r.length && (n["data-uic-field-id"] = r.join("_")), _e && n.disabled === void 0 && (n.disabled = !0);
127
+ n.id ||= i, r.length && (n["data-uic-field-id"] = r.join("_")), ve && n.disabled === void 0 && (n.disabled = !0);
127
128
  let c = [];
128
- (y || J.length > 0) && c.push(`${i}_help`), v && c.push(`${i}_extra`), c.length && (n["aria-describedby"] = c.join(" ")), J.length > 0 && (n["aria-invalid"] = "true"), a && (n["aria-required"] = "true"), (/* @__PURE__ */ new Set([...s(k), ...s(U)])).forEach((r) => {
129
+ (b || J.length > 0) && c.push(`${i}_help`), y && c.push(`${i}_extra`), c.length && (n["aria-describedby"] = c.join(" ")), J.length > 0 && (n["aria-invalid"] = "true"), a && (n["aria-required"] = "true"), (/* @__PURE__ */ new Set([...s(A), ...s(W)])).forEach((r) => {
129
130
  n[r] = (...n) => {
130
131
  e[r]?.(...n), t.props[r]?.(...n);
131
132
  };
132
- }), o = l.cloneElement(t, n);
133
- } else o = w;
133
+ }), o = u.cloneElement(t, n);
134
+ } else o = T;
134
135
  return X(o, i, a, r.length ? r.join("_") : void 0);
135
136
  }
136
137
  });
@@ -145,13 +146,13 @@ function ie(e, t) {
145
146
  });
146
147
  }
147
148
  function ae(e, t, n, r) {
148
- return e == null ? e : typeof n == "function" ? n(e, { required: t }) : n === "optional" && !t ? /* @__PURE__ */ f(u, { children: [e, /* @__PURE__ */ d("span", {
149
+ return e == null ? e : typeof n == "function" ? n(e, { required: t }) : n === "optional" && !t ? /* @__PURE__ */ p(d, { children: [e, /* @__PURE__ */ f("span", {
149
150
  className: "uic-form-item__optional",
150
151
  children: r
151
152
  })] }) : e;
152
153
  }
153
154
  var y = () => {
154
- let { status: e, errors: t = [], warnings: n = [] } = l.useContext(r);
155
+ let { status: e, errors: t = [], warnings: n = [] } = u.useContext(r);
155
156
  return {
156
157
  status: e,
157
158
  errors: t,
@@ -159,6 +160,6 @@ var y = () => {
159
160
  };
160
161
  };
161
162
  //#endregion
162
- export { v as default, m as getFieldId, y as useFormItemStatus };
163
+ export { v as default, h as getFieldId, y as useFormItemStatus };
163
164
 
164
165
  //# sourceMappingURL=FormItem.js.map