@semcore/data-table 4.50.2 → 4.51.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/components/AccordionRows/AccordionRows.js +177 -0
  3. package/lib/cjs/components/AccordionRows/AccordionRows.js.map +1 -0
  4. package/lib/cjs/components/Body/Body.js +445 -0
  5. package/lib/cjs/components/Body/Body.js.map +1 -0
  6. package/lib/cjs/components/Body/Body.types.js +2 -0
  7. package/lib/cjs/components/Body/Body.types.js.map +1 -0
  8. package/lib/cjs/components/Body/Cell.js +205 -0
  9. package/lib/cjs/components/Body/Cell.js.map +1 -0
  10. package/lib/cjs/components/Body/Cell.types.js +2 -0
  11. package/lib/cjs/components/Body/Cell.types.js.map +1 -0
  12. package/lib/cjs/components/Body/LimitOverlay.js +191 -0
  13. package/lib/cjs/components/Body/LimitOverlay.js.map +1 -0
  14. package/lib/cjs/components/Body/MergedCells.js +31 -0
  15. package/lib/cjs/components/Body/MergedCells.js.map +1 -0
  16. package/lib/cjs/components/Body/Row.js +630 -0
  17. package/lib/cjs/components/Body/Row.js.map +1 -0
  18. package/lib/cjs/components/Body/Row.types.js +2 -0
  19. package/lib/cjs/components/Body/Row.types.js.map +1 -0
  20. package/lib/cjs/components/Body/RowGroup.js +118 -0
  21. package/lib/cjs/components/Body/RowGroup.js.map +1 -0
  22. package/lib/cjs/components/Body/style.shadow.css +367 -0
  23. package/lib/cjs/components/DataTable/DataTable.js +1303 -0
  24. package/lib/cjs/components/DataTable/DataTable.js.map +1 -0
  25. package/lib/cjs/components/DataTable/DataTable.types.js +2 -0
  26. package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -0
  27. package/lib/cjs/components/DataTable/ScrollBars.js +63 -0
  28. package/lib/cjs/components/DataTable/ScrollBars.js.map +1 -0
  29. package/lib/cjs/components/DataTable/dataTable.shadow.css +43 -0
  30. package/lib/cjs/components/Head/Column.js +350 -0
  31. package/lib/cjs/components/Head/Column.js.map +1 -0
  32. package/lib/cjs/components/Head/Column.types.js +2 -0
  33. package/lib/cjs/components/Head/Column.types.js.map +1 -0
  34. package/lib/cjs/components/Head/Group.js +116 -0
  35. package/lib/cjs/components/Head/Group.js.map +1 -0
  36. package/lib/cjs/components/Head/Group.type.js +2 -0
  37. package/lib/cjs/components/Head/Group.type.js.map +1 -0
  38. package/lib/cjs/components/Head/Head.js +350 -0
  39. package/lib/cjs/components/Head/Head.js.map +1 -0
  40. package/lib/cjs/components/Head/Head.types.js +2 -0
  41. package/lib/cjs/components/Head/Head.types.js.map +1 -0
  42. package/lib/cjs/components/Head/style.shadow.css +292 -0
  43. package/lib/cjs/components/RowSelector/RowsSelector.js +132 -0
  44. package/lib/cjs/components/RowSelector/RowsSelector.js.map +1 -0
  45. package/lib/cjs/components/RowSelector/SRAnnouncer.js +62 -0
  46. package/lib/cjs/components/RowSelector/SRAnnouncer.js.map +1 -0
  47. package/lib/cjs/components/RowSelector/SRReactiveAnnouncer.js +39 -0
  48. package/lib/cjs/components/RowSelector/SRReactiveAnnouncer.js.map +1 -0
  49. package/lib/cjs/enhancers/focusableCell.js +76 -0
  50. package/lib/cjs/enhancers/focusableCell.js.map +1 -0
  51. package/lib/cjs/index.js +38 -15
  52. package/lib/cjs/index.js.map +1 -1
  53. package/lib/cjs/store/SelectableRows.js +211 -0
  54. package/lib/cjs/store/SelectableRows.js.map +1 -0
  55. package/lib/cjs/style/scroll-shadows.shadow.css +50 -5
  56. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
  57. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  58. package/lib/cjs/translations/de.json +6 -1
  59. package/lib/cjs/translations/en.json +6 -1
  60. package/lib/cjs/translations/es.json +6 -1
  61. package/lib/cjs/translations/fr.json +6 -1
  62. package/lib/cjs/translations/it.json +6 -1
  63. package/lib/cjs/translations/ja.json +6 -1
  64. package/lib/cjs/translations/ko.json +6 -1
  65. package/lib/cjs/translations/nl.json +6 -1
  66. package/lib/cjs/translations/pl.json +6 -1
  67. package/lib/cjs/translations/pt.json +6 -1
  68. package/lib/cjs/translations/sv.json +6 -1
  69. package/lib/cjs/translations/tr.json +6 -1
  70. package/lib/cjs/translations/vi.json +6 -1
  71. package/lib/cjs/translations/zh.json +6 -1
  72. package/lib/es6/components/AccordionRows/AccordionRows.js +171 -0
  73. package/lib/es6/components/AccordionRows/AccordionRows.js.map +1 -0
  74. package/lib/es6/components/Body/Body.js +439 -0
  75. package/lib/es6/components/Body/Body.js.map +1 -0
  76. package/lib/es6/components/Body/Body.types.js +2 -0
  77. package/lib/es6/components/Body/Body.types.js.map +1 -0
  78. package/lib/es6/components/Body/Cell.js +199 -0
  79. package/lib/es6/components/Body/Cell.js.map +1 -0
  80. package/lib/es6/components/Body/Cell.types.js +2 -0
  81. package/lib/es6/components/Body/Cell.types.js.map +1 -0
  82. package/lib/es6/components/Body/LimitOverlay.js +184 -0
  83. package/lib/es6/components/Body/LimitOverlay.js.map +1 -0
  84. package/lib/es6/components/Body/MergedCells.js +24 -0
  85. package/lib/es6/components/Body/MergedCells.js.map +1 -0
  86. package/lib/es6/components/Body/Row.js +624 -0
  87. package/lib/es6/components/Body/Row.js.map +1 -0
  88. package/lib/es6/components/Body/Row.types.js +2 -0
  89. package/lib/es6/components/Body/Row.types.js.map +1 -0
  90. package/lib/es6/components/Body/RowGroup.js +111 -0
  91. package/lib/es6/components/Body/RowGroup.js.map +1 -0
  92. package/lib/es6/components/Body/style.shadow.css +367 -0
  93. package/lib/es6/components/DataTable/DataTable.js +1298 -0
  94. package/lib/es6/components/DataTable/DataTable.js.map +1 -0
  95. package/lib/es6/components/DataTable/DataTable.types.js +2 -0
  96. package/lib/es6/components/DataTable/DataTable.types.js.map +1 -0
  97. package/lib/es6/components/DataTable/ScrollBars.js +57 -0
  98. package/lib/es6/components/DataTable/ScrollBars.js.map +1 -0
  99. package/lib/es6/components/DataTable/dataTable.shadow.css +43 -0
  100. package/lib/es6/components/Head/Column.js +344 -0
  101. package/lib/es6/components/Head/Column.js.map +1 -0
  102. package/lib/es6/components/Head/Column.types.js +2 -0
  103. package/lib/es6/components/Head/Column.types.js.map +1 -0
  104. package/lib/es6/components/Head/Group.js +111 -0
  105. package/lib/es6/components/Head/Group.js.map +1 -0
  106. package/lib/es6/components/Head/Group.type.js +2 -0
  107. package/lib/es6/components/Head/Group.type.js.map +1 -0
  108. package/lib/es6/components/Head/Head.js +345 -0
  109. package/lib/es6/components/Head/Head.js.map +1 -0
  110. package/lib/es6/components/Head/Head.types.js +2 -0
  111. package/lib/es6/components/Head/Head.types.js.map +1 -0
  112. package/lib/es6/components/Head/style.shadow.css +292 -0
  113. package/lib/es6/components/RowSelector/RowsSelector.js +125 -0
  114. package/lib/es6/components/RowSelector/RowsSelector.js.map +1 -0
  115. package/lib/es6/components/RowSelector/SRAnnouncer.js +55 -0
  116. package/lib/es6/components/RowSelector/SRAnnouncer.js.map +1 -0
  117. package/lib/es6/components/RowSelector/SRReactiveAnnouncer.js +32 -0
  118. package/lib/es6/components/RowSelector/SRReactiveAnnouncer.js.map +1 -0
  119. package/lib/es6/enhancers/focusableCell.js +69 -0
  120. package/lib/es6/enhancers/focusableCell.js.map +1 -0
  121. package/lib/es6/index.js +7 -2
  122. package/lib/es6/index.js.map +1 -1
  123. package/lib/es6/store/SelectableRows.js +204 -0
  124. package/lib/es6/store/SelectableRows.js.map +1 -0
  125. package/lib/es6/style/scroll-shadows.shadow.css +50 -5
  126. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  127. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  128. package/lib/es6/translations/de.json +6 -1
  129. package/lib/es6/translations/en.json +6 -1
  130. package/lib/es6/translations/es.json +6 -1
  131. package/lib/es6/translations/fr.json +6 -1
  132. package/lib/es6/translations/it.json +6 -1
  133. package/lib/es6/translations/ja.json +6 -1
  134. package/lib/es6/translations/ko.json +6 -1
  135. package/lib/es6/translations/nl.json +6 -1
  136. package/lib/es6/translations/pl.json +6 -1
  137. package/lib/es6/translations/pt.json +6 -1
  138. package/lib/es6/translations/sv.json +6 -1
  139. package/lib/es6/translations/tr.json +6 -1
  140. package/lib/es6/translations/vi.json +6 -1
  141. package/lib/es6/translations/zh.json +6 -1
  142. package/lib/esm/components/AccordionRows/AccordionRows.mjs +155 -0
  143. package/lib/esm/components/Body/Body.mjs +395 -0
  144. package/lib/esm/components/Body/Cell.mjs +192 -0
  145. package/lib/esm/components/Body/LimitOverlay.mjs +179 -0
  146. package/lib/esm/components/Body/MergedCells.mjs +27 -0
  147. package/lib/esm/components/Body/Row.mjs +556 -0
  148. package/lib/esm/components/Body/RowGroup.mjs +113 -0
  149. package/lib/esm/components/Body/style.shadow.css +367 -0
  150. package/lib/esm/components/DataTable/DataTable.mjs +1216 -0
  151. package/lib/esm/components/DataTable/ScrollBars.mjs +61 -0
  152. package/lib/esm/components/DataTable/dataTable.shadow.css +43 -0
  153. package/lib/esm/components/Head/Column.mjs +321 -0
  154. package/lib/esm/components/Head/Group.mjs +111 -0
  155. package/lib/esm/components/Head/Head.mjs +307 -0
  156. package/lib/esm/components/Head/style.shadow.css +292 -0
  157. package/lib/esm/components/RowSelector/RowsSelector.mjs +105 -0
  158. package/lib/esm/components/RowSelector/SRAnnouncer.mjs +51 -0
  159. package/lib/esm/components/RowSelector/SRReactiveAnnouncer.mjs +31 -0
  160. package/lib/esm/enhancers/focusableCell.mjs +72 -0
  161. package/lib/esm/index.mjs +12 -5
  162. package/lib/esm/store/SelectableRows.mjs +201 -0
  163. package/lib/esm/style/scroll-shadows.shadow.css +50 -5
  164. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  165. package/lib/esm/translations/de.json.mjs +6 -1
  166. package/lib/esm/translations/en.json.mjs +6 -1
  167. package/lib/esm/translations/es.json.mjs +6 -1
  168. package/lib/esm/translations/fr.json.mjs +6 -1
  169. package/lib/esm/translations/it.json.mjs +6 -1
  170. package/lib/esm/translations/ja.json.mjs +6 -1
  171. package/lib/esm/translations/ko.json.mjs +6 -1
  172. package/lib/esm/translations/nl.json.mjs +6 -1
  173. package/lib/esm/translations/pl.json.mjs +6 -1
  174. package/lib/esm/translations/pt.json.mjs +6 -1
  175. package/lib/esm/translations/sv.json.mjs +6 -1
  176. package/lib/esm/translations/tr.json.mjs +6 -1
  177. package/lib/esm/translations/vi.json.mjs +6 -1
  178. package/lib/esm/translations/zh.json.mjs +6 -1
  179. package/lib/types/components/AccordionRows/AccordionRows.d.ts +41 -0
  180. package/lib/types/components/Body/Body.d.ts +6 -0
  181. package/lib/types/components/Body/Body.types.d.ts +87 -0
  182. package/lib/types/components/Body/Cell.d.ts +1 -0
  183. package/lib/types/components/Body/Cell.types.d.ts +36 -0
  184. package/lib/types/components/Body/LimitOverlay.d.ts +17 -0
  185. package/lib/types/components/Body/MergedCells.d.ts +17 -0
  186. package/lib/types/components/Body/Row.d.ts +47 -0
  187. package/lib/types/components/Body/Row.types.d.ts +74 -0
  188. package/lib/types/components/Body/RowGroup.d.ts +19 -0
  189. package/lib/types/components/DataTable/DataTable.d.ts +14 -0
  190. package/lib/types/components/DataTable/DataTable.types.d.ts +202 -0
  191. package/lib/types/components/DataTable/ScrollBars.d.ts +11 -0
  192. package/lib/types/components/Head/Column.d.ts +39 -0
  193. package/lib/types/components/Head/Column.types.d.ts +85 -0
  194. package/lib/types/components/Head/Group.d.ts +15 -0
  195. package/lib/types/components/Head/Group.type.d.ts +18 -0
  196. package/lib/types/components/Head/Head.d.ts +9 -0
  197. package/lib/types/components/Head/Head.types.d.ts +58 -0
  198. package/lib/types/components/RowSelector/RowsSelector.d.ts +32 -0
  199. package/lib/types/components/RowSelector/SRAnnouncer.d.ts +10 -0
  200. package/lib/types/components/RowSelector/SRReactiveAnnouncer.d.ts +8 -0
  201. package/lib/types/enhancers/focusableCell.d.ts +9 -0
  202. package/lib/types/index.d.ts +10 -2
  203. package/lib/types/store/SelectableRows.d.ts +60 -0
  204. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +70 -0
  205. package/package.json +6 -6
  206. package/lib/cjs/Body.js +0 -477
  207. package/lib/cjs/Body.js.map +0 -1
  208. package/lib/cjs/DataTable.js +0 -629
  209. package/lib/cjs/DataTable.js.map +0 -1
  210. package/lib/cjs/Head.js +0 -398
  211. package/lib/cjs/Head.js.map +0 -1
  212. package/lib/cjs/style/data-table.shadow.css +0 -413
  213. package/lib/cjs/types.js +0 -4
  214. package/lib/cjs/types.js.map +0 -1
  215. package/lib/cjs/utils.js +0 -57
  216. package/lib/cjs/utils.js.map +0 -1
  217. package/lib/es6/Body.js +0 -469
  218. package/lib/es6/Body.js.map +0 -1
  219. package/lib/es6/DataTable.js +0 -619
  220. package/lib/es6/DataTable.js.map +0 -1
  221. package/lib/es6/Head.js +0 -390
  222. package/lib/es6/Head.js.map +0 -1
  223. package/lib/es6/style/data-table.shadow.css +0 -413
  224. package/lib/es6/types.js +0 -2
  225. package/lib/es6/types.js.map +0 -1
  226. package/lib/es6/utils.js +0 -48
  227. package/lib/es6/utils.js.map +0 -1
  228. package/lib/esm/Body.mjs +0 -430
  229. package/lib/esm/DataTable.mjs +0 -589
  230. package/lib/esm/Head.mjs +0 -368
  231. package/lib/esm/style/data-table.shadow.css +0 -413
  232. package/lib/esm/utils.mjs +0 -52
  233. package/lib/types/Body.d.ts +0 -61
  234. package/lib/types/DataTable.d.ts +0 -205
  235. package/lib/types/Head.d.ts +0 -45
  236. package/lib/types/types.d.ts +0 -73
  237. package/lib/types/utils.d.ts +0 -4
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "Umożliwia sortowanie";
2
2
  const pl = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "Pokaż szczegóły",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "Ukryj szczegóły",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "Wszystkie przedmioty",
7
+ "DataTable.allItemsSelected:aria-live": "Wszystkie przedmioty wybrane",
8
+ "DataTable.allItemsDeselected:aria-live": "Wszystkie przedmioty odznaczone"
4
9
  };
5
10
  export {
6
11
  pl as default,
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "Classificável";
2
2
  const pt = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "Exibir detalhes",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "Ocultar detalhes",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "Todos os itens",
7
+ "DataTable.allItemsSelected:aria-live": "Todos os itens selecionados",
8
+ "DataTable.allItemsDeselected:aria-live": "Todos os itens desmarcados"
4
9
  };
5
10
  export {
6
11
  pt as default,
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "Sorterbar";
2
2
  const sv = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "Visa detaljer",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "Dölj detaljer",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "Alla objekt",
7
+ "DataTable.allItemsSelected:aria-live": "Alla objekt valda",
8
+ "DataTable.allItemsDeselected:aria-live": "Alla objekt avmarkerade"
4
9
  };
5
10
  export {
6
11
  sv as default,
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "Sıralanabilir";
2
2
  const tr = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "Detayları göster",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "Detayları gizle",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "Tüm öğeler",
7
+ "DataTable.allItemsSelected:aria-live": "Tüm öğeler seçildi",
8
+ "DataTable.allItemsDeselected:aria-live": "Tüm öğeler seçilmedi"
4
9
  };
5
10
  export {
6
11
  tr as default,
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "Có thể sắp xếp";
2
2
  const vi = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "Hiển thị chi tiết",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "Ẩn bớt",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "Tất cả các mục",
7
+ "DataTable.allItemsSelected:aria-live": "Tất cả các mục đã được chọn",
8
+ "DataTable.allItemsDeselected:aria-live": "Tất cả các mục đã được bỏ chọn"
4
9
  };
5
10
  export {
6
11
  vi as default,
@@ -1,6 +1,11 @@
1
1
  const sortableColumn = "可排序";
2
2
  const zh = {
3
- sortableColumn
3
+ sortableColumn,
4
+ "DataTable.Cell.AccordionToggle.expand:aria-label": "显示详细信息",
5
+ "DataTable.Cell.AccordionToggle.collapse:aria-label": "隐藏详细信息",
6
+ "DataTable.Header.selectAllCheckbox:aria-label": "所有项目",
7
+ "DataTable.allItemsSelected:aria-live": "所有项目已选择",
8
+ "DataTable.allItemsDeselected:aria-live": "所有项目已取消选择"
4
9
  };
5
10
  export {
6
11
  zh as default,
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import type { CellRenderProps } from '../Body/Body.types';
3
+ import type { DataTableCellProps } from '../Body/Cell.types';
4
+ import type { DTRow, DTRows } from '../Body/Row.types';
5
+ import type { DataTableData, DataTableProps, DataRowItem, DTUse } from '../DataTable/DataTable.types';
6
+ import type { DTColumn } from '../Head/Column.types';
7
+ type AccordionRowsProps<Data extends DataTableData, UniqKeyType> = {
8
+ accordionId: string;
9
+ expanded: boolean;
10
+ expandedForAnimation: boolean;
11
+ tableRef: React.RefObject<HTMLDivElement>;
12
+ use: DTUse;
13
+ columns: DTColumn[];
14
+ row: DTRow<UniqKeyType> | DTRow<UniqKeyType>[];
15
+ rows: DTRows<UniqKeyType>;
16
+ flatRows: DTRow<UniqKeyType>[];
17
+ rowIndex: number;
18
+ gridRowIndex: number;
19
+ accordionDuration: number | [number, number];
20
+ accordionAnimationRows: number;
21
+ sideIndents: 'wide' | undefined;
22
+ getFixedStyle: (cell: Pick<DTColumn, 'name' | 'fixed'>) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];
23
+ onCellClick: DataTableCellProps<Data, UniqKeyType>['onClick'];
24
+ renderCell: ((props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | Record<string, any>) | undefined;
25
+ rawData: DataRowItem[];
26
+ shadowVertical: '' | 'end' | 'start' | 'median' | undefined;
27
+ variant: DataTableProps<any, any, any>['variant'];
28
+ limit: DataTableProps<any, any, any>['limit'];
29
+ } & {
30
+ 'aria-level': number;
31
+ };
32
+ type State = {
33
+ maxHeight: number;
34
+ };
35
+ export declare class AccordionRows<Data extends DataTableData, UniqKeyType> extends React.PureComponent<AccordionRowsProps<Data, UniqKeyType>, State> {
36
+ accordionRowsRef: React.RefObject<HTMLDivElement>;
37
+ state: State;
38
+ componentDidUpdate(prevProps: Readonly<AccordionRowsProps<Data, UniqKeyType>>): void;
39
+ render(): React.ReactNode;
40
+ }
41
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { DataTableBodyType } from './Body.types';
2
+ import type { DataTableRowType } from './Row.types';
3
+ export declare const INDEX_OFFSET = 2;
4
+ export declare const Body: DataTableBodyType & {
5
+ Row: DataTableRowType;
6
+ };
@@ -0,0 +1,87 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import type * as React from 'react';
3
+ import type { DataTableCellProps, Theme } from './Cell.types';
4
+ import type { DTRow, RowPropsInner } from './Row.types';
5
+ import type { ISelectedRows } from '../../store/SelectableRows';
6
+ import type { ACCORDION } from '../DataTable/DataTable';
7
+ import type { DataRowItem, DTUse, VirtualScroll, DataTableProps, DataTableData } from '../DataTable/DataTable.types';
8
+ import type { DTColumn } from '../Head/Column.types';
9
+ export type CellRenderProps<Data extends DataRowItem, UniqKeyType> = {
10
+ /** The column key for the cell data */
11
+ dataKey: string;
12
+ /** The complete row data object */
13
+ row: DTRow<UniqKeyType>;
14
+ /** The column configuration object */
15
+ column: DTColumn;
16
+ /** Zero-based row index in the table */
17
+ rowIndex: number;
18
+ /** Zero-based column index in the table */
19
+ columnIndex: number;
20
+ /** The name/key of the column */
21
+ columnName: string | typeof ACCORDION;
22
+ /** Cell value */
23
+ value: string | React.ReactElement;
24
+ /** Function that returns the default cell rendering */
25
+ defaultRender: () => React.ReactNode;
26
+ /** Indicates if this cell spans multiple rows */
27
+ isMergedRows: boolean;
28
+ /** Indicates if this cell spans multiple columns */
29
+ isMergedColumns: boolean;
30
+ /** The original unprocessed row data */
31
+ rawData: Data;
32
+ /** Flag to show is the cell is in the accordion row */
33
+ isAccordionRow: boolean;
34
+ /** Zero-based accordion row index */
35
+ accordionRowIndex?: number;
36
+ };
37
+ export type DataTableBodyProps<Data extends DataTableData, UniqKeyType> = {
38
+ renderCell?: (props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | (Record<string, any> & {
39
+ theme?: Theme;
40
+ });
41
+ rowProps?: (row: DTRow<UniqKeyType>, rowIndex: number) => (Record<string, any> & {
42
+ theme?: Theme;
43
+ }) | undefined;
44
+ };
45
+ export type BodyPropsInner<Data extends DataTableData, UniqKeyType> = DataTableBodyProps<Data, UniqKeyType> & {
46
+ rows: Array<DTRow<UniqKeyType> | DTRow<UniqKeyType>[]>;
47
+ flatRows: DTRow<UniqKeyType>[];
48
+ columns: DTColumn[];
49
+ use: DTUse;
50
+ compact: boolean;
51
+ gridTemplateColumns: string[];
52
+ gridTemplateAreas: string[];
53
+ loading?: boolean;
54
+ headerHeight: number;
55
+ getI18nText: (key: string) => string;
56
+ expandedRows: Set<UniqKeyType>;
57
+ onExpandRow: (row: DTRow<UniqKeyType>) => void;
58
+ spinnerRef: React.RefObject<HTMLDivElement>;
59
+ tableContainerRef: React.RefObject<HTMLDivElement>;
60
+ tableRef: React.RefObject<HTMLDivElement>;
61
+ scrollAreaRef: React.RefObject<HTMLDivElement>;
62
+ scrollTop: number;
63
+ scrollDirection: 'down' | 'up';
64
+ virtualScroll?: VirtualScroll;
65
+ hasGroups: boolean;
66
+ uid: string;
67
+ rowProps?: (row: DTRow<UniqKeyType>, rowIndex: number) => Record<string, any> | undefined;
68
+ renderCell?: (props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | Record<string, any>;
69
+ onBackFromAccordion: (colName: string) => void;
70
+ stickyHeader?: boolean;
71
+ selectedRows?: UniqKeyType[] | ISelectedRows<UniqKeyType>;
72
+ onSelectRow?: (isSelect: boolean, selectedRowIndex: number, row: DTRow<UniqKeyType>, event?: React.SyntheticEvent<HTMLElement>) => void;
73
+ renderEmptyData: () => React.ReactNode;
74
+ sideIndents?: 'wide';
75
+ getFixedStyle: (cell: Pick<DTColumn, 'name' | 'fixed'>) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];
76
+ accordionDuration: number | [number, number];
77
+ onCellClick: DataTableCellProps<Data, UniqKeyType>['onClick'];
78
+ rawData: DataRowItem[];
79
+ accordionMode?: DataTableProps<any, any, any>['accordionMode'];
80
+ shadowVertical?: '' | 'end' | 'start' | 'median';
81
+ renderCellOverlay?: () => React.ReactNode;
82
+ limit?: DataTableProps<any, any, any>['limit'];
83
+ variant?: DataTableProps<any, any, any>['variant'];
84
+ totalRows?: number;
85
+ accordionAnimationRows: RowPropsInner<Data, UniqKeyType>['accordionAnimationRows'];
86
+ };
87
+ export type DataTableBodyType = (<Data extends DataTableData, UniqKeyType, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', DataTableBodyProps<Data, UniqKeyType>>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableBodyProps<any, any>>;
@@ -0,0 +1 @@
1
+ export declare const Cell: import("@semcore/core").Intergalactic.Component<"div", {}, {}, never[]>;
@@ -0,0 +1,36 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import type { CSSProperties, HTMLAttributes } from 'react';
3
+ import type { BodyPropsInner } from './Body.types';
4
+ import type { DTRow, DTRows } from './Row.types';
5
+ import type { DataTableData, DTUse } from '../DataTable/DataTable.types';
6
+ import type { DTColumn } from '../Head/Column.types';
7
+ export type Theme = 'muted' | 'info' | 'success' | 'warning' | 'danger';
8
+ export type DataTableCellProps<Data extends DataTableData, UniqKeyType> = Intergalactic.InternalTypings.EfficientOmit<HTMLAttributes<HTMLDivElement>, 'onClick'> & {
9
+ id: string;
10
+ accordionId: string;
11
+ row: DTRow<UniqKeyType>;
12
+ rowIndex: number;
13
+ column: DTColumn;
14
+ columnIndex: number;
15
+ gridRowIndex: number;
16
+ children?: React.ReactNode;
17
+ expanded?: boolean;
18
+ withAccordion?: boolean;
19
+ accordionRowIndex?: number;
20
+ rows: DTRows<UniqKeyType>;
21
+ use: DTUse;
22
+ style?: CSSProperties;
23
+ virtualScroll: boolean;
24
+ tableRef: React.RefObject<HTMLDivElement>;
25
+ accordionDuration?: number | [number, number];
26
+ onClick: (e: React.SyntheticEvent<HTMLElement>, opt: {
27
+ rowIndex: number;
28
+ colIndex: number;
29
+ row?: DTRow<UniqKeyType>;
30
+ }) => void;
31
+ flatRows: DTRow<UniqKeyType>[];
32
+ shadowVertical?: BodyPropsInner<Data, UniqKeyType>;
33
+ withoutBorder?: boolean;
34
+ } & {
35
+ 'data-aria-level'?: number;
36
+ };
@@ -0,0 +1,17 @@
1
+ import { type Intergalactic } from '@semcore/core';
2
+ import * as React from 'react';
3
+ import type { DTRow, DTRows } from './Row.types';
4
+ import type { DataTableProps } from '../DataTable/DataTable.types';
5
+ import type { DTColumn } from '../Head/Column.types';
6
+ type LimitOverlayProps<UniqKeyType> = {
7
+ columns: DTColumn[];
8
+ rows: DTRows<UniqKeyType>;
9
+ limit: Exclude<DataTableProps<any, any, any>['limit'], undefined>;
10
+ flatRows: DTRow<UniqKeyType>[];
11
+ hasGroups: boolean;
12
+ tableRef: React.RefObject<HTMLDivElement>;
13
+ scrollAreaRef: React.RefObject<HTMLDivElement>;
14
+ };
15
+ type LimitOverlayType = (<UniqKeyType, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', LimitOverlayProps<UniqKeyType>>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', LimitOverlayProps<any>>;
16
+ export declare const LimitOverlay: LimitOverlayType;
17
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { DTRows } from './Row.types';
2
+ export declare class MergedRowsCell {
3
+ readonly value: any;
4
+ readonly rowsCount: number;
5
+ readonly accordion?: React.ReactNode | DTRows<any>;
6
+ constructor(value: any, rowsCount: number, accordion?: React.ReactNode | DTRows<any>);
7
+ }
8
+ export declare class MergedColumnsCell {
9
+ readonly value: any;
10
+ readonly columnsCount: number;
11
+ readonly dataKey: string;
12
+ readonly accordion?: React.ReactNode | DTRows<any>;
13
+ constructor(value: any, options: {
14
+ size: number;
15
+ dataKey: string;
16
+ }, accordion?: React.ReactNode | DTRows<any>);
17
+ }
@@ -0,0 +1,47 @@
1
+ import { Component } from '@semcore/core';
2
+ import * as React from 'react';
3
+ import type { DataTableCellProps } from './Cell.types';
4
+ import { MergedColumnsCell, MergedRowsCell } from './MergedCells';
5
+ import type { DataTableRowProps, DataTableRowType, DTRow, DTRows, RowPropsInner } from './Row.types';
6
+ import type { DataTableData, DTValue } from '../DataTable/DataTable.types';
7
+ type State<UniqKeyType> = {
8
+ expandedForAnimation: boolean;
9
+ accordionRows?: DTRows<UniqKeyType>;
10
+ accordionComponent?: React.ReactNode;
11
+ };
12
+ export declare class RowRoot<Data extends DataTableData, UniqKeyType> extends Component<DataTableRowProps<Data, UniqKeyType>, [], {}, RowPropsInner<Data, UniqKeyType>, State<UniqKeyType>> {
13
+ static displayName: string;
14
+ static style: {
15
+ [key: string]: string;
16
+ };
17
+ static defaultProps: {
18
+ 'aria-level': undefined;
19
+ };
20
+ private cellName;
21
+ private closeAccordionTimeout;
22
+ private openAccordionTimeout;
23
+ rowElementRef: React.RefObject<HTMLDivElement>;
24
+ state: State<UniqKeyType>;
25
+ constructor(props: DataTableRowProps<Data, UniqKeyType>);
26
+ componentDidMount(): void;
27
+ componentDidUpdate(prevProps: DataTableRowProps<Data, UniqKeyType>): void;
28
+ componentWillUnmount(): void;
29
+ setAccordion(): void;
30
+ cellHasAccordion(cellValue?: DTValue | MergedColumnsCell | MergedRowsCell): cellValue is DTValue;
31
+ handleBackFromAccordion: (e: React.KeyboardEvent) => void;
32
+ handleExpandRow: (row: DTRow<UniqKeyType>, index: number) => void;
33
+ closeAccordion: (row: DTRow<UniqKeyType>, closeDuration: number) => void;
34
+ handleClickRow(row: DTRow<UniqKeyType>): (e: React.SyntheticEvent) => void;
35
+ handleClickCell: (e: React.SyntheticEvent<HTMLElement>, opt: {
36
+ row: DTRow<UniqKeyType>;
37
+ rowIndex: number;
38
+ }) => void;
39
+ getCellProps(props: DataTableCellProps<Data, UniqKeyType>): Record<string, any>;
40
+ get isRowHidden(): true | undefined;
41
+ render(): React.ReactNode;
42
+ private isReactNode;
43
+ }
44
+ export declare const Row: DataTableRowType & {
45
+ Cell: any;
46
+ };
47
+ export {};
@@ -0,0 +1,74 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import type * as React from 'react';
3
+ import type { CellRenderProps } from './Body.types';
4
+ import type { DataTableCellProps, Theme } from './Cell.types';
5
+ import type { MergedColumnsCell, MergedRowsCell } from './MergedCells';
6
+ import type { RowRoot } from './Row';
7
+ import type { ISelectedRows } from '../../store/SelectableRows';
8
+ import type { ACCORDION, GRID_ROW_INDEX, IS_EMPTY_DATA_ROW, ROW_GROUP, ROW_INDEX, UNIQ_ROW_KEY } from '../DataTable/DataTable';
9
+ import type { DTValue, DTUse, DataTableData, VirtualScroll, DataRowItem, DataTableProps } from '../DataTable/DataTable.types';
10
+ import type { DTColumn } from '../Head/Column.types';
11
+ export type DTRow<UniqKeyType> = {
12
+ [UNIQ_ROW_KEY]: UniqKeyType;
13
+ [IS_EMPTY_DATA_ROW]?: boolean;
14
+ [GRID_ROW_INDEX]: number;
15
+ [ROW_INDEX]: number;
16
+ [key: string]: DTValue | MergedRowsCell | MergedColumnsCell;
17
+ [ACCORDION]?: React.ReactNode | DTRows<UniqKeyType>;
18
+ [ROW_GROUP]?: Set<UniqKeyType>;
19
+ };
20
+ export type DTRows<UniqKeyType> = Array<DTRow<UniqKeyType> | DTRow<UniqKeyType>[]>;
21
+ export type DataTableRowProps<Data extends DataTableData, UniqKeyType> = {
22
+ row: DTRow<UniqKeyType>;
23
+ mergedRow?: boolean;
24
+ isAccordionRow?: boolean;
25
+ accordionRowIndex?: DataTableCellProps<Data, UniqKeyType>['accordionRowIndex'];
26
+ isNonInteractive?: boolean;
27
+ componentRef?: (component: RowRoot<Data, UniqKeyType> | null) => void;
28
+ accordionIndex?: number;
29
+ theme?: Theme;
30
+ };
31
+ export type RowPropsInner<Data extends DataTableData, UniqKeyType> = JSX.IntrinsicElements['div'] & {
32
+ use: DTUse;
33
+ /**
34
+ * Flag to show is row in a merged list or not.
35
+ */
36
+ mergedRow?: boolean;
37
+ columns: DTColumn[];
38
+ row: DTRow<UniqKeyType> | DTRow<UniqKeyType>[];
39
+ rows: DTRows<UniqKeyType>;
40
+ flatRows: DTRow<UniqKeyType>[];
41
+ rowIndex: number;
42
+ gridRowIndex: number;
43
+ onExpandRow: (expandedRow: DTRow<UniqKeyType>) => void;
44
+ gridTemplateAreas: string[];
45
+ gridTemplateColumns: string[];
46
+ selectedRows?: UniqKeyType[] | ISelectedRows<UniqKeyType>;
47
+ onSelectRow?: (isSelect: boolean, selectedRowIndex: number, row: DTRow<UniqKeyType>, event?: React.SyntheticEvent<HTMLElement>) => void;
48
+ inert?: '';
49
+ accordionDuration: number | [number, number];
50
+ accordionAnimationRows: number;
51
+ onBackFromAccordion: (colName: string) => void;
52
+ scrollAreaRef: React.RefObject<HTMLDivElement>;
53
+ uid: string;
54
+ sideIndents?: 'wide';
55
+ getFixedStyle: (cell: Pick<DTColumn, 'name' | 'fixed'>) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];
56
+ renderCell?: (props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | Record<string, any>;
57
+ getI18nText: (key: string) => string;
58
+ virtualScroll?: VirtualScroll;
59
+ tableRef: React.RefObject<HTMLDivElement>;
60
+ onCellClick: DataTableCellProps<Data, UniqKeyType>['onClick'];
61
+ rawData: DataRowItem[];
62
+ shadowVertical?: '' | 'end' | 'start' | 'median';
63
+ expandedRows: Set<UniqKeyType>;
64
+ accordionMode?: DataTableProps<any, any, any>['accordionMode'];
65
+ rowsHeightMap: Map<number, [number, number, HTMLElement]>;
66
+ setRowHeight: (index: number, row: DTRow<UniqKeyType>) => void;
67
+ componentsMap: Map<UniqKeyType, RowRoot<Data, UniqKeyType>>;
68
+ calculateAriaRowIndex: () => void;
69
+ variant: DataTableProps<any, any, any>['variant'];
70
+ limit: DataTableProps<any, any, any>['limit'];
71
+ totalRows?: number;
72
+ hasGroups: boolean;
73
+ };
74
+ export type DataTableRowType = (<Data extends DataTableData, UniqKeyType, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', DataTableRowProps<Data, UniqKeyType> & Partial<RowPropsInner<Data, UniqKeyType>>>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableRowProps<any, any>>;
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import type { ISelectedRows } from '../../store/SelectableRows';
3
+ import type { RowRoot } from '../Body/Row';
4
+ import type { DTRow } from '../Body/Row.types';
5
+ import type { DataTableData } from '../DataTable/DataTable.types';
6
+ import type { DTColumn } from '../Head/Column.types';
7
+ type RowGroupProps<Data extends DataTableData, UniqKeyType> = {
8
+ rows: DTRow<UniqKeyType>[];
9
+ selectedRows?: UniqKeyType[] | ISelectedRows<UniqKeyType>;
10
+ columns: DTColumn[];
11
+ startIndex: number;
12
+ rowIndex: number;
13
+ handleRef: (index: number, row: DTRow<UniqKeyType>) => (node: HTMLElement | null) => void;
14
+ handleComponentRef: (row: DTRow<UniqKeyType>) => (component: RowRoot<Data, UniqKeyType> | null) => void;
15
+ };
16
+ export declare class RowGroup<Data extends DataTableData, UniqKeyType> extends React.PureComponent<RowGroupProps<Data, UniqKeyType>> {
17
+ render(): React.ReactNode;
18
+ }
19
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { DataTableType } from './DataTable.types';
2
+ import { Body } from '../Body/Body';
3
+ import { Head } from '../Head/Head';
4
+ export declare const ACCORDION: unique symbol;
5
+ export declare const ROW_GROUP: unique symbol;
6
+ export declare const UNIQ_ROW_KEY: unique symbol;
7
+ export declare const IS_EMPTY_DATA_ROW: unique symbol;
8
+ export declare const SELECT_ALL = "SELECT_ALL_ROWS";
9
+ export declare const ROW_INDEX: unique symbol;
10
+ export declare const GRID_ROW_INDEX: unique symbol;
11
+ export declare const DataTable: DataTableType & {
12
+ Head: typeof Head;
13
+ Body: typeof Body;
14
+ };
@@ -0,0 +1,202 @@
1
+ import type { BoxProps } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import type Tooltip from '@semcore/tooltip';
4
+ import type * as React from 'react';
5
+ import type { ACCORDION, ROW_GROUP, UNIQ_ROW_KEY } from './DataTable';
6
+ import type { ISelectedRows } from '../../store/SelectableRows';
7
+ import type { DataTableBodyProps } from '../Body/Body.types';
8
+ import type { DTRow, RowPropsInner } from '../Body/Row.types';
9
+ import type { DataTableColumnProps } from '../Head/Column.types';
10
+ import type { DataTableHeadProps } from '../Head/Head.types';
11
+ /**
12
+ * Datatable must have an accessible name (aria-table-name).
13
+ * It should describe table content.
14
+ */
15
+ export type DataTableAriaProps = Intergalactic.RequireAtLeastOne<{
16
+ 'aria-label'?: string;
17
+ 'aria-labelledby'?: string;
18
+ 'title'?: string;
19
+ }>;
20
+ export type SortDirection = 'asc' | 'desc';
21
+ export type DataTableSort<Column> = [sortBy: Column, sortDirection: SortDirection];
22
+ export type DataTableChangeSort<Column> = (sort: [sortBy: Column, sortDirection: SortDirection], e?: React.SyntheticEvent) => void;
23
+ export type DataRowItem = {
24
+ [key: string]: DTValue | undefined | null;
25
+ [ACCORDION]?: React.ReactNode | DataTableData;
26
+ [ROW_GROUP]?: DataTableData;
27
+ [UNIQ_ROW_KEY]?: string;
28
+ };
29
+ export interface DTValue {
30
+ toString(): string;
31
+ [ACCORDION]?: React.ReactNode;
32
+ }
33
+ export type DataTableData = DataRowItem[];
34
+ export type DTUse = 'primary' | 'secondary';
35
+ export type Sizes = Partial<Pick<BoxProps, 'w' | 'wMax' | 'wMin' | 'h' | 'hMax' | 'hMin'>>;
36
+ export type DataTableProps<Data extends DataTableData, UniqKey extends (Data[number] extends {
37
+ [ROW_GROUP]: DataTableData;
38
+ } ? keyof Data[number][typeof ROW_GROUP][number] : keyof Data[number]), UniqKeyType extends (Data[number] extends {
39
+ [ROW_GROUP]: DataTableData;
40
+ } ? Data[number][typeof ROW_GROUP][number][UniqKey] : Data[number][UniqKey])> = DataTableAriaProps & Sizes & {
41
+ /** Data for table */
42
+ data: Data;
43
+ /** Count of total rows if table using virtual scroll. Needs for accessibility */
44
+ totalRows?: number;
45
+ /** Table theme according to visual hierarchy on the page
46
+ * @default primary
47
+ * */
48
+ use?: DTUse;
49
+ /** Active sort object */
50
+ sort?: DataTableSort<keyof Data[0]>;
51
+ /** Handler call when request will change sort */
52
+ onSortChange?: DataTableChangeSort<keyof Data[0]>;
53
+ /**
54
+ * Value to describe width for each column. Could be overridden in the column.gtcWidth property.
55
+ * Use `auto` to automatically fit the table to the content,
56
+ * `1fr` for equal-width columns or any other value for the grid-template-column css property.
57
+ * @default auto
58
+ */
59
+ defaultGridTemplateColumnWidth?: string;
60
+ /**
61
+ * Flag for compact view (smaller horizontal paddings)
62
+ */
63
+ compact?: boolean;
64
+ /**
65
+ * Size of paddings for the first and last columns in the table
66
+ */
67
+ sideIndents?: 'wide';
68
+ /**
69
+ * Flag for showing spinner on table body
70
+ */
71
+ loading?: boolean;
72
+ children?: never;
73
+ /**
74
+ * Set of expanded rows (uniq id from them)
75
+ * This is mutable! variable because of table performance. Don't change the link on it.
76
+ */
77
+ expandedRows?: Set<UniqKeyType>;
78
+ /** Configuration for virtual scroll */
79
+ virtualScroll?: VirtualScroll;
80
+ /** Configuration for table columns including headers, sorting, and layout */
81
+ columns: ColumnsConfig;
82
+ /** Configuration for sticky headers, height, scroll bars, etc. */
83
+ headerProps?: DataTableHeadProps;
84
+ /** Function to add custom props to rows */
85
+ rowProps?: DataTableBodyProps<Data, UniqKeyType>['rowProps'];
86
+ /** Custom cell renderer function */
87
+ renderCell?: DataTableBodyProps<Data, UniqKeyType>['renderCell'];
88
+ /**
89
+ * Name of a unique key for each row data item
90
+ */
91
+ uniqueRowKey?: UniqKey;
92
+ /**
93
+ * For custom empty data widget.
94
+ */
95
+ renderEmptyData?: () => React.ReactNode;
96
+ /**
97
+ * For adding an overlay over table cells.
98
+ */
99
+ renderCellOverlay?: () => React.ReactNode;
100
+ /**
101
+ * Duration for collapse/expand accordion rows in tables in ms.
102
+ * @default 200
103
+ */
104
+ accordionDuration?: number | [number, number];
105
+ /**
106
+ * List of animated rows in accordion.
107
+ * @default 20
108
+ */
109
+ accordionAnimationRows?: RowPropsInner<Data, UniqKeyType>['accordionAnimationRows'];
110
+ /**
111
+ * Whether multiple accordion items can be open at a time, or only one.
112
+ * @default 'independent'
113
+ */
114
+ accordionMode?: 'toggle' | 'independent';
115
+ /**
116
+ * Handle open/close accordion.
117
+ * Work only with table-in-table accordions. In accordions with custom components use mount/unmount hooks in components.
118
+ */
119
+ onAccordionToggle?: (type: 'open' | 'close', uniqRowKey: UniqKeyType, rowIndex: number) => void;
120
+ /** Defines a limit configuration */
121
+ limit?: {
122
+ /**
123
+ * Start limit from this row
124
+ * @default 0
125
+ */
126
+ fromRow?: number;
127
+ /**
128
+ * Start limit from this column
129
+ * @default 0
130
+ */
131
+ fromColumn?: number;
132
+ /** Limit overlay */
133
+ renderOverlay: () => React.ReactNode;
134
+ };
135
+ /**
136
+ * Visual variant that adapts the table styling to different usage contexts
137
+ * @default 'default'
138
+ */
139
+ variant?: 'default' | 'card';
140
+ /**
141
+ * Handle change expanded rows
142
+ */
143
+ onExpandedRowsChange?: (expandedRows: Set<UniqKeyType>) => void;
144
+ /**
145
+ * Handling table container resizing.
146
+ */
147
+ onResize?: ResizeObserverCallback;
148
+ } & ({
149
+ /**
150
+ * List of selected rows (uniqIds from a data array)
151
+ * @deprecated use ISelectedRows for this property instead of an array.
152
+ */
153
+ selectedRows?: UniqKeyType[];
154
+ /** Callback when row selection changes */
155
+ onSelectedRowsChange?: (selectedRows: UniqKeyType[], event?: React.SyntheticEvent<HTMLElement>, opts?: {
156
+ selectedRowIndex: number;
157
+ isSelected: boolean;
158
+ row: DTRow<UniqKeyType>;
159
+ }) => void;
160
+ } | {
161
+ /**
162
+ * Entity of selected rows (uniq id from them)
163
+ * This is mutable! variable because of table performance. Don't change the link on it.
164
+ */
165
+ selectedRows?: ISelectedRows<UniqKeyType>;
166
+ });
167
+ export type ColumnItemConfig = Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentProps<'div' | typeof Tooltip, 'div', DataTableColumnProps, {}, [
168
+ ]>, 'children'> & {
169
+ children: React.ReactNode | React.FC;
170
+ };
171
+ export type ColumnGroupConfig = {
172
+ /**
173
+ * Name of column for mapping with data.
174
+ *
175
+ * Necessary to set a unique name for a group. (It will use as a React key).
176
+ *
177
+ * Note: Column names cannot contain the "/" character as it is reserved
178
+ * as a separator for merged columns. Column names are also used to generate
179
+ * CSS variable names for grid layout, so they must be valid CSS identifiers.
180
+ * Use letters, numbers, hyphens, and underscores only.
181
+ */
182
+ name: string;
183
+ borders?: 'both' | 'left' | 'right';
184
+ fixed?: 'left' | 'right';
185
+ children: React.ReactNode;
186
+ columns: ColumnItemConfig[];
187
+ };
188
+ export type ColumnsConfig = Array<ColumnItemConfig | ColumnGroupConfig>;
189
+ export type VirtualScroll = boolean | {
190
+ rowsBuffer?: number;
191
+ aproxRowsOnPage?: number;
192
+ } | {
193
+ rowHeight: number;
194
+ rowsBuffer?: number;
195
+ };
196
+ export type RowIndex = number;
197
+ export type ColIndex = number;
198
+ export type DataTableType = (<Data extends DataTableData, UniqKey extends (Data[number] extends {
199
+ [ROW_GROUP]: DataTableData;
200
+ } ? keyof Data[number][typeof ROW_GROUP][number] : keyof Data[number]), UniqKeyType extends (Data[number] extends {
201
+ [ROW_GROUP]: DataTableData;
202
+ } ? Data[number][typeof ROW_GROUP][number][UniqKey] : Data[number][UniqKey]), Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentProps<Tag, 'div', DataTableProps<Data, UniqKey, UniqKeyType>>, 'tag' | 'children'>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableProps<any, any, any>>;