@infomaximum/ui-kit 0.15.8 → 0.16.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 (296) hide show
  1. package/dist/components/BaseTooltip/BaseTooltip.js +4 -4
  2. package/dist/components/ConfigProvider/ConfigProvider.js +4 -2
  3. package/dist/components/ConfigProvider/ConfigProvider.types.d.ts +2 -3
  4. package/dist/components/ConfigProvider/contexts/ConfigContext.d.ts +2 -2
  5. package/dist/components/ConfigProvider/contexts/ConfigContext.types.d.ts +3 -1
  6. package/dist/components/ConfigProvider/contexts/index.d.ts +2 -1
  7. package/dist/components/ConfigProvider/hooks/useConfig/useConfig.d.ts +2 -2
  8. package/dist/components/ConfigProvider/index.d.ts +1 -1
  9. package/dist/components/Empty/Empty.js +3 -1
  10. package/dist/components/Empty/Empty.types.d.ts +5 -0
  11. package/dist/components/Radio/components/RadioInternal/RadioInternal.types.d.ts +1 -1
  12. package/dist/components/Table/Table.d.ts +7 -0
  13. package/dist/components/Table/Table.js +218 -0
  14. package/dist/components/Table/Table.styles.d.ts +12 -0
  15. package/dist/components/Table/Table.styles.js +62 -0
  16. package/dist/components/Table/Table.tokens.d.ts +19 -0
  17. package/dist/components/Table/Table.tokens.js +20 -0
  18. package/dist/components/Table/Table.types.d.ts +48 -0
  19. package/dist/components/Table/components/Body/Body.d.ts +5 -0
  20. package/dist/components/Table/components/Body/Body.js +56 -0
  21. package/dist/components/Table/components/Body/Body.styles.d.ts +4 -0
  22. package/dist/components/Table/components/Body/Body.styles.js +6 -0
  23. package/dist/components/Table/components/Body/Body.types.d.ts +6 -0
  24. package/dist/components/Table/components/Body/components/BodyCell/BodyCell.d.ts +3 -0
  25. package/dist/components/Table/components/Body/components/BodyCell/BodyCell.js +117 -0
  26. package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.d.ts +27 -0
  27. package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.js +32 -0
  28. package/dist/components/Table/components/Body/components/BodyCell/BodyCell.types.d.ts +12 -0
  29. package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.d.ts +3 -0
  30. package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.js +35 -0
  31. package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.types.d.ts +2 -0
  32. package/dist/components/Table/components/Body/components/BodyRow/BodyRow.d.ts +3 -0
  33. package/dist/components/Table/components/Body/components/BodyRow/BodyRow.js +41 -0
  34. package/dist/components/Table/components/Body/components/BodyRow/BodyRow.types.d.ts +8 -0
  35. package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.d.ts +3 -0
  36. package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.js +33 -0
  37. package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.styles.d.ts +10 -0
  38. package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.styles.js +14 -0
  39. package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.types.d.ts +6 -0
  40. package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.d.ts +5 -0
  41. package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.js +87 -0
  42. package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.types.d.ts +2 -0
  43. package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.d.ts +4 -0
  44. package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.js +13 -0
  45. package/dist/components/Table/components/Cell/Cell.d.ts +3 -0
  46. package/dist/components/Table/components/Cell/Cell.js +25 -0
  47. package/dist/components/Table/components/Cell/Cell.styles.d.ts +28 -0
  48. package/dist/components/Table/components/Cell/Cell.styles.js +31 -0
  49. package/dist/components/Table/components/Cell/Cell.types.d.ts +16 -0
  50. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.d.ts +3 -0
  51. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.js +69 -0
  52. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.d.ts +15 -0
  53. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.js +26 -0
  54. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.types.d.ts +2 -0
  55. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.utils.d.ts +7 -0
  56. package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.utils.js +17 -0
  57. package/dist/components/Table/components/FixedHeader/FixedHeader.d.ts +2 -0
  58. package/dist/components/Table/components/FixedHeader/FixedHeader.js +25 -0
  59. package/dist/components/Table/components/FixedHeader/FixedHeader.types.d.ts +6 -0
  60. package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.d.ts +3 -0
  61. package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.js +33 -0
  62. package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.types.d.ts +2 -0
  63. package/dist/components/Table/components/Header/Header.d.ts +3 -0
  64. package/dist/components/Table/components/Header/Header.js +23 -0
  65. package/dist/components/Table/components/Header/Header.styles.d.ts +4 -0
  66. package/dist/components/Table/components/Header/Header.styles.js +6 -0
  67. package/dist/components/Table/components/Header/Header.types.d.ts +15 -0
  68. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.d.ts +3 -0
  69. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.js +63 -0
  70. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.d.ts +21 -0
  71. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.js +25 -0
  72. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.types.d.ts +6 -0
  73. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.utils.d.ts +2 -0
  74. package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.utils.js +4 -0
  75. package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.d.ts +3 -0
  76. package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.js +34 -0
  77. package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.styles.d.ts +6 -0
  78. package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.styles.js +8 -0
  79. package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.types.d.ts +6 -0
  80. package/dist/components/Table/components/Header/utils/index.d.ts +1 -0
  81. package/dist/components/Table/components/Header/utils/parseHeaderRows/parseHeaderRows.d.ts +4 -0
  82. package/dist/components/Table/components/Header/utils/parseHeaderRows/parseHeaderRows.js +50 -0
  83. package/dist/components/Table/contexts/index.d.ts +3 -0
  84. package/dist/components/Table/contexts/tableContext/TableContext.d.ts +3 -0
  85. package/dist/components/Table/contexts/tableContext/TableContext.js +21 -0
  86. package/dist/components/Table/contexts/tableContext/TableContext.types.d.ts +27 -0
  87. package/dist/components/Table/contexts/tableContext/useTableContext/useTableContext.d.ts +2 -0
  88. package/dist/components/Table/contexts/tableContext/useTableContext/useTableContext.js +8 -0
  89. package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.d.ts +3 -0
  90. package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.js +23 -0
  91. package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.styles.d.ts +19 -0
  92. package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.styles.js +22 -0
  93. package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.types.d.ts +3 -0
  94. package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.d.ts +3 -0
  95. package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.js +24 -0
  96. package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.types.d.ts +5 -0
  97. package/dist/components/Table/features/tableExpand/contexts/index.d.ts +3 -0
  98. package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.d.ts +2 -0
  99. package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.js +9 -0
  100. package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.types.d.ts +7 -0
  101. package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/useTableExpandedContext/useTableExpandedContext.d.ts +1 -0
  102. package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/useTableExpandedContext/useTableExpandedContext.js +8 -0
  103. package/dist/components/Table/features/tableExpand/hooks/index.d.ts +2 -0
  104. package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.d.ts +6 -0
  105. package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.js +38 -0
  106. package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.types.d.ts +3 -0
  107. package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.d.ts +8 -0
  108. package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.js +26 -0
  109. package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.types.d.ts +3 -0
  110. package/dist/components/Table/features/tableExpand/index.d.ts +4 -0
  111. package/dist/components/Table/features/tableExpand/types.d.ts +16 -0
  112. package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.d.ts +3 -0
  113. package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.js +78 -0
  114. package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.types.d.ts +4 -0
  115. package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.utils.d.ts +3 -0
  116. package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.utils.js +20 -0
  117. package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.d.ts +2 -0
  118. package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.js +73 -0
  119. package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.types.d.ts +5 -0
  120. package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.d.ts +3 -0
  121. package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.js +43 -0
  122. package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.types.d.ts +4 -0
  123. package/dist/components/Table/features/tableRowSelection/contexts/index.d.ts +3 -0
  124. package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.d.ts +2 -0
  125. package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.js +20 -0
  126. package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.types.d.ts +18 -0
  127. package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/useTableRowSelectionContext/useTableRowSelectionContext.d.ts +1 -0
  128. package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/useTableRowSelectionContext/useTableRowSelectionContext.js +8 -0
  129. package/dist/components/Table/features/tableRowSelection/hooks/index.d.ts +4 -0
  130. package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.d.ts +2 -0
  131. package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.js +32 -0
  132. package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.types.d.ts +4 -0
  133. package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.d.ts +19 -0
  134. package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.js +126 -0
  135. package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.types.d.ts +8 -0
  136. package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.utils.d.ts +2 -0
  137. package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.utils.js +13 -0
  138. package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.d.ts +6 -0
  139. package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js +59 -0
  140. package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.types.d.ts +3 -0
  141. package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.utils.d.ts +1 -0
  142. package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.utils.js +12 -0
  143. package/dist/components/Table/features/tableRowSelection/index.d.ts +5 -0
  144. package/dist/components/Table/features/tableRowSelection/styles.d.ts +16 -0
  145. package/dist/components/Table/features/tableRowSelection/styles.js +25 -0
  146. package/dist/components/Table/features/tableRowSelection/types.d.ts +24 -0
  147. package/dist/components/Table/features/tableRowSelection/utils/const.d.ts +1 -0
  148. package/dist/components/Table/features/tableRowSelection/utils/const.js +4 -0
  149. package/dist/components/Table/features/tableRowSelection/utils/index.d.ts +1 -0
  150. package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.d.ts +3 -0
  151. package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.js +75 -0
  152. package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.styles.d.ts +7 -0
  153. package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.styles.js +9 -0
  154. package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.types.d.ts +6 -0
  155. package/dist/components/Table/features/tableSort/components/SortButton/SortButton.d.ts +2 -0
  156. package/dist/components/Table/features/tableSort/components/SortButton/SortButton.js +27 -0
  157. package/dist/components/Table/features/tableSort/components/SortButton/SortButton.styles.d.ts +17 -0
  158. package/dist/components/Table/features/tableSort/components/SortButton/SortButton.styles.js +20 -0
  159. package/dist/components/Table/features/tableSort/components/SortButton/SortButton.types.d.ts +4 -0
  160. package/dist/components/Table/features/tableSort/hooks/index.d.ts +5 -0
  161. package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.d.ts +6 -0
  162. package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.js +47 -0
  163. package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.types.d.ts +7 -0
  164. package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.utils.d.ts +2 -0
  165. package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.utils.js +9 -0
  166. package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.d.ts +5 -0
  167. package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.js +39 -0
  168. package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.types.d.ts +4 -0
  169. package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.d.ts +9 -0
  170. package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.js +54 -0
  171. package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.types.d.ts +14 -0
  172. package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.d.ts +5 -0
  173. package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.js +47 -0
  174. package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.styles.d.ts +6 -0
  175. package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.styles.js +8 -0
  176. package/dist/components/Table/features/tableSort/icons/ArrowFilled.d.ts +2 -0
  177. package/dist/components/Table/features/tableSort/icons/ArrowFilled.js +12 -0
  178. package/dist/components/Table/features/tableSort/icons/index.d.ts +1 -0
  179. package/dist/components/Table/features/tableSort/index.d.ts +5 -0
  180. package/dist/components/Table/features/tableSort/types.d.ts +10 -0
  181. package/dist/components/Table/features/tableSort/utils/const.d.ts +4 -0
  182. package/dist/components/Table/features/tableSort/utils/const.js +8 -0
  183. package/dist/components/Table/features/tableSort/utils/getSortFunction/getSortFunction.d.ts +2 -0
  184. package/dist/components/Table/features/tableSort/utils/getSortFunction/getSortFunction.js +9 -0
  185. package/dist/components/Table/features/tableSort/utils/getSortFunction/index.d.ts +1 -0
  186. package/dist/components/Table/features/tableSort/utils/getSortedData/getSortedData.d.ts +3 -0
  187. package/dist/components/Table/features/tableSort/utils/getSortedData/getSortedData.js +48 -0
  188. package/dist/components/Table/features/tableSort/utils/getSortedData/index.d.ts +1 -0
  189. package/dist/components/Table/features/tableSort/utils/index.d.ts +2 -0
  190. package/dist/components/Table/features/tableStaticContext/contexts/index.d.ts +1 -0
  191. package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.d.ts +21 -0
  192. package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.js +29 -0
  193. package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.types.d.ts +24 -0
  194. package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.d.ts +2 -0
  195. package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js +8 -0
  196. package/dist/components/Table/features/tableStaticContext/hocs/index.d.ts +1 -0
  197. package/dist/components/Table/features/tableStaticContext/hocs/withTableStaticContext.d.ts +3 -0
  198. package/dist/components/Table/features/tableStaticContext/hocs/withTableStaticContext.js +15 -0
  199. package/dist/components/Table/features/tableStaticContext/index.d.ts +2 -0
  200. package/dist/components/Table/features/typedEventBus/hooks.d.ts +3 -0
  201. package/dist/components/Table/features/typedEventBus/hooks.js +8 -0
  202. package/dist/components/Table/features/typedEventBus/index.d.ts +2 -0
  203. package/dist/components/Table/features/typedEventBus/types.d.ts +22 -0
  204. package/dist/components/Table/forStories/components.d.ts +2 -0
  205. package/dist/components/Table/forStories/example_1.d.ts +11 -0
  206. package/dist/components/Table/forStories/example_2.d.ts +11 -0
  207. package/dist/components/Table/forStories/example_3.d.ts +10 -0
  208. package/dist/components/Table/forStories/example_4.d.ts +10 -0
  209. package/dist/components/Table/forStories/example_5.d.ts +9 -0
  210. package/dist/components/Table/forStories/example_6.d.ts +9 -0
  211. package/dist/components/Table/forStories/example_7.d.ts +9 -0
  212. package/dist/components/Table/forStories/index.d.ts +7 -0
  213. package/dist/components/Table/hooks/useBodyCellRender/index.d.ts +1 -0
  214. package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.d.ts +4 -0
  215. package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.js +27 -0
  216. package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.types.d.ts +7 -0
  217. package/dist/components/Table/hooks/useBodyFlattenData/index.d.ts +1 -0
  218. package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.d.ts +5 -0
  219. package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.js +31 -0
  220. package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.types.d.ts +11 -0
  221. package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.utils.d.ts +3 -0
  222. package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.utils.js +19 -0
  223. package/dist/components/Table/hooks/useCellFixedInfo/index.d.ts +3 -0
  224. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.d.ts +12 -0
  225. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.js +117 -0
  226. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.d.ts +26 -0
  227. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.js +33 -0
  228. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.types.d.ts +19 -0
  229. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.d.ts +9 -0
  230. package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.js +75 -0
  231. package/dist/components/Table/hooks/useCellHover/index.d.ts +1 -0
  232. package/dist/components/Table/hooks/useCellHover/useCellHover.d.ts +8 -0
  233. package/dist/components/Table/hooks/useCellHover/useCellHover.js +34 -0
  234. package/dist/components/Table/hooks/useCellHover/useCellHover.types.d.ts +5 -0
  235. package/dist/components/Table/hooks/useCellHover/useCellHover.utils.d.ts +1 -0
  236. package/dist/components/Table/hooks/useCellHover/useCellHover.utils.js +7 -0
  237. package/dist/components/Table/hooks/useTableColumns/index.d.ts +1 -0
  238. package/dist/components/Table/hooks/useTableColumns/useTableColumns.d.ts +7 -0
  239. package/dist/components/Table/hooks/useTableColumns/useTableColumns.js +39 -0
  240. package/dist/components/Table/hooks/useTableColumns/useTableColumns.types.d.ts +4 -0
  241. package/dist/components/Table/hooks/useTableColumns/useTableColumns.utils.d.ts +2 -0
  242. package/dist/components/Table/hooks/useTableColumns/useTableColumns.utils.js +24 -0
  243. package/dist/components/Table/hooks/useTableComponents/index.d.ts +1 -0
  244. package/dist/components/Table/hooks/useTableComponents/useTableComponents.d.ts +6 -0
  245. package/dist/components/Table/hooks/useTableComponents/useTableComponents.js +14 -0
  246. package/dist/components/Table/hooks/useTableComponents/useTableComponents.types.d.ts +3 -0
  247. package/dist/components/Table/hooks/useTableVisualParamsChange/index.d.ts +1 -0
  248. package/dist/components/Table/hooks/useTableVisualParamsChange/types.d.ts +4 -0
  249. package/dist/components/Table/hooks/useTableVisualParamsChange/useTableVisualParamsChange.d.ts +12 -0
  250. package/dist/components/Table/hooks/useTableVisualParamsChange/useTableVisualParamsChange.js +116 -0
  251. package/dist/components/Table/hooks/useTableVisualParamsChange/utils.d.ts +3 -0
  252. package/dist/components/Table/hooks/useTableVisualParamsChange/utils.js +35 -0
  253. package/dist/components/Table/index.d.ts +2 -0
  254. package/dist/components/Table/interfaces/tableColumns.types.d.ts +45 -0
  255. package/dist/components/Table/interfaces/tableComponents.types.d.ts +28 -0
  256. package/dist/components/Table/utils/getRowKey/getRowKey.d.ts +2 -0
  257. package/dist/components/Table/utils/getRowKey/getRowKey.js +4 -0
  258. package/dist/components/Table/utils/getRowKey/index.d.ts +2 -0
  259. package/dist/components/Table/utils/getRowKey/types.d.ts +2 -0
  260. package/dist/components/Table/utils/index.d.ts +2 -0
  261. package/dist/components/Table/utils/ref/index.d.ts +1 -0
  262. package/dist/components/Table/utils/ref/ref.d.ts +5 -0
  263. package/dist/components/Table/utils/ref/ref.js +16 -0
  264. package/dist/components/Table/utils/ref/types.d.ts +10 -0
  265. package/dist/hooks/useEvent/index.d.ts +1 -0
  266. package/dist/hooks/useEvent/useEvent.d.ts +2 -0
  267. package/dist/hooks/useEvent/useEvent.js +9 -0
  268. package/dist/hooks/useEvent/useEvent.types.d.ts +1 -0
  269. package/dist/hooks/useFirstMount/index.d.ts +1 -0
  270. package/dist/hooks/useFirstMount/useFirstMount.d.ts +1 -0
  271. package/dist/hooks/useFirstMount/useFirstMount.js +12 -0
  272. package/dist/hooks/useStatic/index.d.ts +1 -0
  273. package/dist/hooks/useStatic/useStatic.d.ts +1 -0
  274. package/dist/hooks/useStatic/useStatic.js +8 -0
  275. package/dist/index.d.ts +1 -0
  276. package/dist/index.js +2 -0
  277. package/dist/utils/eventBus/context/EventBusContext.d.ts +2 -0
  278. package/dist/utils/eventBus/context/EventBusContext.js +5 -0
  279. package/dist/utils/eventBus/context/EventBusContext.types.d.ts +5 -0
  280. package/dist/utils/eventBus/eventBus.d.ts +10 -0
  281. package/dist/utils/eventBus/eventBus.js +47 -0
  282. package/dist/utils/eventBus/hocs/withEventBus/index.d.ts +1 -0
  283. package/dist/utils/eventBus/hocs/withEventBus/withEventBus.d.ts +2 -0
  284. package/dist/utils/eventBus/hocs/withEventBus/withEventBus.js +15 -0
  285. package/dist/utils/eventBus/hooks/useEmitter/useEmitter.d.ts +2 -0
  286. package/dist/utils/eventBus/hooks/useEmitter/useEmitter.js +8 -0
  287. package/dist/utils/eventBus/hooks/useEventBus/useEventBus.d.ts +3 -0
  288. package/dist/utils/eventBus/hooks/useEventBus/useEventBus.js +12 -0
  289. package/dist/utils/eventBus/hooks/useSubscribe/useSubscribe.d.ts +3 -0
  290. package/dist/utils/eventBus/hooks/useSubscribe/useSubscribe.js +18 -0
  291. package/dist/utils/eventBus/index.d.ts +6 -0
  292. package/dist/utils/eventBus/provider/EventBusProvider.d.ts +3 -0
  293. package/dist/utils/eventBus/provider/EventBusProvider.js +16 -0
  294. package/dist/utils/eventBus/provider/EventBusProvider.types.d.ts +6 -0
  295. package/dist/utils/eventBus/types.d.ts +6 -0
  296. package/package.json +7 -6
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { DefaultRecord } from 'components/Table/Table.types';
3
+ import { HeaderCell } from 'components/Table/components/Header/Header.types';
4
+ export interface HeaderCellWithSortProps<Record extends DefaultRecord> extends PropsWithChildren {
5
+ cell: HeaderCell<Record>;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { SortButtonProps } from './SortButton.types';
2
+ export declare const SortButton: <Record>(props: SortButtonProps<Record>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
+ import { sortButtonStyle, getAscendArrowStyle, getDescendArrowStyle } from "./SortButton.styles.js";
3
+ import { useTheme } from "../../../../../../hooks/useTheme/useTheme.js";
4
+ import { useSortState } from "../../hooks/useSortState/useSortState.js";
5
+ import { ArrowFilled } from "../../icons/ArrowFilled.js";
6
+ const SortButtonComponent = (props) => {
7
+ const {
8
+ column
9
+ } = props;
10
+ const theme = useTheme();
11
+ const {
12
+ sortOrder,
13
+ sortDirections
14
+ } = useSortState({
15
+ column
16
+ });
17
+ const hasAscendOrder = sortDirections.includes("ascend");
18
+ const hasDescendOrder = sortDirections.includes("descend");
19
+ return /* @__PURE__ */ jsxs("span", { className: "column-sorter-inner", "aria-hidden": "true", css: sortButtonStyle(theme), children: [
20
+ hasAscendOrder && /* @__PURE__ */ jsx(ArrowFilled, { css: getAscendArrowStyle(sortOrder)(theme) }),
21
+ hasDescendOrder && /* @__PURE__ */ jsx(ArrowFilled, { css: getDescendArrowStyle(sortOrder)(theme) })
22
+ ] });
23
+ };
24
+ const SortButton = SortButtonComponent;
25
+ export {
26
+ SortButton
27
+ };
@@ -0,0 +1,17 @@
1
+ import { Theme } from 'themes';
2
+ import { SortOrder } from '../../types';
3
+ export declare const sortButtonStyle: (theme: Theme) => {
4
+ readonly display: "inline-flex";
5
+ readonly flexDirection: "column";
6
+ readonly rowGap: 2;
7
+ readonly paddingInline: 3.5;
8
+ readonly paddingBlock: 4;
9
+ readonly color: `rgba(${number}, ${number}, ${number}, 0.3)`;
10
+ };
11
+ export declare const getAscendArrowStyle: (sortOrder: SortOrder) => (theme: Theme) => {
12
+ color: "#0CB3B3" | undefined;
13
+ };
14
+ export declare const getDescendArrowStyle: (sortOrder: SortOrder) => (theme: Theme) => {
15
+ color: "#0CB3B3" | undefined;
16
+ transform: string;
17
+ };
@@ -0,0 +1,20 @@
1
+ const sortButtonStyle = (theme) => ({
2
+ display: "inline-flex",
3
+ flexDirection: "column",
4
+ rowGap: theme.x05,
5
+ paddingInline: 3.5,
6
+ paddingBlock: theme.paddingXS,
7
+ color: theme.textIcon
8
+ });
9
+ const getAscendArrowStyle = (sortOrder) => (theme) => ({
10
+ color: sortOrder === "ascend" ? theme.primaryBase : void 0
11
+ });
12
+ const getDescendArrowStyle = (sortOrder) => (theme) => ({
13
+ color: sortOrder === "descend" ? theme.primaryBase : void 0,
14
+ transform: "rotate(180deg)"
15
+ });
16
+ export {
17
+ getAscendArrowStyle,
18
+ getDescendArrowStyle,
19
+ sortButtonStyle
20
+ };
@@ -0,0 +1,4 @@
1
+ import { Columns } from 'components/Table/interfaces/tableColumns.types';
2
+ export interface SortButtonProps<Record> {
3
+ column: Columns<Record>[number];
4
+ }
@@ -0,0 +1,5 @@
1
+ export { useTableSort } from './useTableSort/useTableSort';
2
+ export type { SorterResult } from './useTableSort/useTableSort.types';
3
+ export { useTransformColumns } from './useTransformColumns/useTransformColumns';
4
+ export { useHeaderCellSort } from './useHeaderCellSort/useHeaderCellSort';
5
+ export { useSortState } from './useSortState/useSortState';
@@ -0,0 +1,6 @@
1
+ import { UseHeaderCellSortOptions } from './useHeaderCellSort.types';
2
+ import { DefaultRecord } from 'components/Table/Table.types';
3
+ export declare const useHeaderCellSort: <Record extends DefaultRecord>(options: UseHeaderCellSortOptions<Record>) => {
4
+ onClick: import('react').MouseEventHandler<HTMLTableCellElement>;
5
+ onKeyDown: import('react').KeyboardEventHandler<HTMLTableCellElement>;
6
+ };
@@ -0,0 +1,47 @@
1
+ import { nextSortDirection } from "./useHeaderCellSort.utils.js";
2
+ import { useSortState } from "../useSortState/useSortState.js";
3
+ import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
4
+ import { getRefValue } from "../../../../utils/ref/ref.js";
5
+ const useHeaderCellSort = (options) => {
6
+ const {
7
+ column,
8
+ onClick,
9
+ onKeyDown
10
+ } = options;
11
+ const staticContextRef = useTableStaticContext();
12
+ const columnKey = column.key;
13
+ const {
14
+ sortOrder,
15
+ sortDirections
16
+ } = useSortState({
17
+ column
18
+ });
19
+ const nextSortOrder = nextSortDirection(sortDirections, sortOrder);
20
+ const handleClick = (e) => {
21
+ const triggerSorter = getRefValue(staticContextRef, "triggerSorter");
22
+ triggerSorter({
23
+ column,
24
+ key: columnKey,
25
+ sortOrder: nextSortOrder
26
+ });
27
+ onClick == null ? void 0 : onClick(e);
28
+ };
29
+ const handleKeyDown = (e) => {
30
+ if (e.code === "Enter") {
31
+ const triggerSorter = getRefValue(staticContextRef, "triggerSorter");
32
+ triggerSorter({
33
+ column,
34
+ key: columnKey,
35
+ sortOrder: nextSortOrder
36
+ });
37
+ }
38
+ onKeyDown == null ? void 0 : onKeyDown(e);
39
+ };
40
+ return {
41
+ onClick: handleClick,
42
+ onKeyDown: handleKeyDown
43
+ };
44
+ };
45
+ export {
46
+ useHeaderCellSort
47
+ };
@@ -0,0 +1,7 @@
1
+ import { Column } from 'components/Table/interfaces/tableColumns.types';
2
+ import { KeyboardEventHandler, MouseEventHandler } from 'react';
3
+ export interface UseHeaderCellSortOptions<Record> {
4
+ column: Column<Record>;
5
+ onClick: MouseEventHandler<HTMLTableCellElement> | undefined;
6
+ onKeyDown: KeyboardEventHandler<HTMLTableCellElement> | undefined;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { SortOrder } from '../../types';
2
+ export declare const nextSortDirection: (sortDirections: SortOrder[], current: SortOrder | null) => SortOrder;
@@ -0,0 +1,9 @@
1
+ const nextSortDirection = (sortDirections, current) => {
2
+ if (!current) {
3
+ return sortDirections[0];
4
+ }
5
+ return sortDirections[sortDirections.indexOf(current) + 1];
6
+ };
7
+ export {
8
+ nextSortDirection
9
+ };
@@ -0,0 +1,5 @@
1
+ import { UseSortStateOptions } from './useSortState.types';
2
+ export declare const useSortState: <Record>(options: UseSortStateOptions<Record>) => {
3
+ sortOrder: import('../..').SortOrder;
4
+ sortDirections: import('../..').SortOrder[];
5
+ };
@@ -0,0 +1,39 @@
1
+ import { useState } from "react";
2
+ import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
3
+ import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
4
+ import { getRefValue } from "../../../../utils/ref/ref.js";
5
+ import { useSubscribe } from "../../../typedEventBus/hooks.js";
6
+ const useSortState = (options) => {
7
+ const {
8
+ column
9
+ } = options;
10
+ const {
11
+ sortDirections: columnSortDirections,
12
+ key: columnKey
13
+ } = column;
14
+ const {
15
+ sortDirections: tableSortDirections
16
+ } = useTableContext();
17
+ const sortDirections = columnSortDirections || tableSortDirections;
18
+ const staticContextRef = useTableStaticContext();
19
+ const [sortOrder, setSortOrder] = useState(() => {
20
+ const sortState = getRefValue(staticContextRef, "sortState");
21
+ if (!sortState) {
22
+ return;
23
+ }
24
+ return sortState.key === columnKey ? sortState.sortOrder : void 0;
25
+ });
26
+ useSubscribe("sort", (value) => {
27
+ const {
28
+ sortState
29
+ } = value;
30
+ setSortOrder(sortState ? sortState.key === columnKey ? sortState.sortOrder : void 0 : void 0);
31
+ }, false, [columnKey]);
32
+ return {
33
+ sortOrder,
34
+ sortDirections
35
+ };
36
+ };
37
+ export {
38
+ useSortState
39
+ };
@@ -0,0 +1,4 @@
1
+ import { Columns } from 'components/Table/interfaces/tableColumns.types';
2
+ export interface UseSortStateOptions<Record> {
3
+ column: Columns<Record>[number];
4
+ }
@@ -0,0 +1,9 @@
1
+ import { UseTableSortOptions } from './useTableSort.types';
2
+ import { DefaultRecord } from 'components/Table/Table.types';
3
+ import { SortState } from '../../types';
4
+ export declare const useTableSort: <Record extends DefaultRecord>(options: UseTableSortOptions<Record>) => {
5
+ triggerSorter: (sortState: SortState<Record>) => void;
6
+ sortState: SortState<Record> | undefined;
7
+ sortedData: Record[];
8
+ hasData: boolean;
9
+ };
@@ -0,0 +1,54 @@
1
+ import { useState, useMemo } from "react";
2
+ import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
3
+ import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
4
+ import { getRefValue } from "../../../../utils/ref/ref.js";
5
+ import { useEmitter } from "../../../typedEventBus/hooks.js";
6
+ import { useFirstMountLayoutEffect } from "../../../../../../hooks/useFirstMountLayoutEffect/useFirstMountLayoutEffect.js";
7
+ import { getSortedData } from "../../utils/getSortedData/getSortedData.js";
8
+ const useTableSort = (options) => {
9
+ const {
10
+ onChange,
11
+ dataSource
12
+ } = options;
13
+ const staticContextRef = useTableStaticContext();
14
+ const [sortState, setSortState] = useState(() => getRefValue(staticContextRef, "initialSortState"));
15
+ const emitSort = useEvent(useEmitter("sort"));
16
+ useFirstMountLayoutEffect((firstMount) => {
17
+ if (firstMount) {
18
+ return;
19
+ }
20
+ emitSort({
21
+ sortState
22
+ });
23
+ }, [emitSort, sortState]);
24
+ const sortedData = useMemo(() => getSortedData(dataSource, sortState), [dataSource, sortState]);
25
+ const hasData = Boolean(sortedData.length);
26
+ const triggerSorter = (sortState2) => {
27
+ setSortState(sortState2);
28
+ const {
29
+ key,
30
+ column,
31
+ sortOrder
32
+ } = sortState2;
33
+ onChange == null ? void 0 : onChange(sortOrder ? {
34
+ columnKey: key,
35
+ column,
36
+ field: column.dataIndex,
37
+ order: sortOrder
38
+ } : {
39
+ columnKey: void 0,
40
+ column: void 0,
41
+ field: void 0,
42
+ order: void 0
43
+ });
44
+ };
45
+ return {
46
+ triggerSorter,
47
+ sortState,
48
+ sortedData,
49
+ hasData
50
+ };
51
+ };
52
+ export {
53
+ useTableSort
54
+ };
@@ -0,0 +1,14 @@
1
+ import { Column } from 'components/Table/interfaces/tableColumns.types';
2
+ import { DefaultRecord, Key, TableProps } from 'components/Table/Table.types';
3
+ import { SortOrder } from '../../types';
4
+ import { PropertyPath } from 'lodash-es';
5
+ export interface UseTableSortOptions<Record extends DefaultRecord> {
6
+ onChange: TableProps<Record>["onChange"];
7
+ dataSource: TableProps<Record>["dataSource"];
8
+ }
9
+ export interface SorterResult<Record> {
10
+ column?: Column<Record>;
11
+ order?: SortOrder;
12
+ field?: PropertyPath;
13
+ columnKey?: Key;
14
+ }
@@ -0,0 +1,5 @@
1
+ import { DefaultRecord } from 'components/Table/Table.types';
2
+ import { ColumnsTransformer } from 'components/Table/interfaces/tableColumns.types';
3
+ export declare const useTransformColumns: <Record extends DefaultRecord>() => {
4
+ transformColumns: ColumnsTransformer<Record>;
5
+ };
@@ -0,0 +1,47 @@
1
+ import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { SortButton } from "../../components/SortButton/SortButton.js";
4
+ import { sorterTitleWrapperStyle } from "./useTransformColumns.styles.js";
5
+ import { useTheme } from "../../../../../../hooks/useTheme/useTheme.js";
6
+ import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
7
+ import { getRefValue, updateRefValue } from "../../../../utils/ref/ref.js";
8
+ const useTransformColumns = () => {
9
+ const theme = useTheme();
10
+ const staticContextRef = useTableStaticContext();
11
+ const transformColumns = useCallback((columns) => {
12
+ function processColumns(columns2) {
13
+ return columns2.map((_column) => {
14
+ const column = {
15
+ ..._column
16
+ };
17
+ if (column.sorter) {
18
+ column.title = /* @__PURE__ */ jsxs("div", { css: sorterTitleWrapperStyle(theme), children: [
19
+ column.title,
20
+ /* @__PURE__ */ jsx(SortButton, { column })
21
+ ] });
22
+ const initialSortState = getRefValue(staticContextRef, "initialSortState");
23
+ if (!initialSortState && column.defaultSortOrder) {
24
+ updateRefValue(staticContextRef, {
25
+ initialSortState: {
26
+ column,
27
+ key: column.key,
28
+ sortOrder: column.defaultSortOrder
29
+ }
30
+ });
31
+ }
32
+ }
33
+ if ("children" in column) {
34
+ column.children = processColumns(column.children);
35
+ }
36
+ return column;
37
+ });
38
+ }
39
+ return processColumns(columns);
40
+ }, [staticContextRef, theme]);
41
+ return {
42
+ transformColumns
43
+ };
44
+ };
45
+ export {
46
+ useTransformColumns
47
+ };
@@ -0,0 +1,6 @@
1
+ import { Theme } from 'themes';
2
+ export declare const sorterTitleWrapperStyle: (theme: Theme) => {
3
+ display: string;
4
+ columnGap: 4;
5
+ alignItems: string;
6
+ };
@@ -0,0 +1,8 @@
1
+ const sorterTitleWrapperStyle = (theme) => ({
2
+ display: "flex",
3
+ columnGap: theme.spaceXS,
4
+ alignItems: "center"
5
+ });
6
+ export {
7
+ sorterTitleWrapperStyle
8
+ };
@@ -0,0 +1,2 @@
1
+ import { IconComponentProps } from '@infomaximum/icons';
2
+ export declare const ArrowFilled: import('react').ForwardRefExoticComponent<Omit<Partial<IconComponentProps>, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { Icon } from "@infomaximum/icons";
3
+ import { forwardRef } from "react";
4
+ const Arrow = (props) => {
5
+ return /* @__PURE__ */ jsx("svg", { ...props, width: "9", height: "5", viewBox: "0 0 9 5", children: /* @__PURE__ */ jsx("path", { d: "M7.9,5 H1.1 C0.7,5,0.5,4.5,0.8,4.2 l3.4,-3.8 c0.2,-0.2,0.5,-0.2,0.7,0 l3.4,3.8 C8.5,4.5,8.3,5,7.9,5 Z" }) });
6
+ };
7
+ const ArrowFilled = forwardRef((props, ref) => {
8
+ return /* @__PURE__ */ jsx(Icon, { component: Arrow, name: "arrow", ref, ...props });
9
+ });
10
+ export {
11
+ ArrowFilled
12
+ };
@@ -0,0 +1 @@
1
+ export { ArrowFilled } from './ArrowFilled';
@@ -0,0 +1,5 @@
1
+ export { defaultSortDirections, defaultRowSelectionColumnWidth, defaultIndentSize, getSortFunction, } from './utils';
2
+ export { useTableSort, useTransformColumns, type SorterResult, useHeaderCellSort, useSortState, } from './hooks';
3
+ export type { SortState, SortOrder, CompareFn } from './types';
4
+ export { ArrowFilled } from './icons';
5
+ export { HeaderCellWithSort } from './components/HeaderCellWithSort/HeaderCellWithSort';
@@ -0,0 +1,10 @@
1
+ import { Column } from 'components/Table/interfaces/tableColumns.types';
2
+ import { Key } from 'components/Table/Table.types';
3
+ export type SortOrder = "descend" | "ascend" | undefined;
4
+ export type CompareFn<Record> = (a: Record, b: Record, sortOrder?: SortOrder) => number;
5
+ export type Sorter<Record> = boolean | CompareFn<Record>;
6
+ export interface SortState<Record> {
7
+ column: Column<Record>;
8
+ key: Key;
9
+ sortOrder: SortOrder;
10
+ }
@@ -0,0 +1,4 @@
1
+ import { SortOrder } from '../types';
2
+ export declare const defaultSortDirections: SortOrder[];
3
+ export declare const defaultRowSelectionColumnWidth = 36;
4
+ export declare const defaultIndentSize = 16;
@@ -0,0 +1,8 @@
1
+ const defaultSortDirections = ["ascend", "descend"];
2
+ const defaultRowSelectionColumnWidth = 36;
3
+ const defaultIndentSize = 16;
4
+ export {
5
+ defaultIndentSize,
6
+ defaultRowSelectionColumnWidth,
7
+ defaultSortDirections
8
+ };
@@ -0,0 +1,2 @@
1
+ import { Sorter } from '../../types';
2
+ export declare const getSortFunction: <Record>(sorter?: Sorter<Record>) => false | import('../..').CompareFn<Record>;
@@ -0,0 +1,9 @@
1
+ const getSortFunction = (sorter) => {
2
+ if (typeof sorter === "function") {
3
+ return sorter;
4
+ }
5
+ return false;
6
+ };
7
+ export {
8
+ getSortFunction
9
+ };
@@ -0,0 +1 @@
1
+ export { getSortFunction } from './getSortFunction';
@@ -0,0 +1,3 @@
1
+ import { DefaultRecord } from 'components/Table/Table.types';
2
+ import { SortState } from '../../types';
3
+ export declare const getSortedData: <Record extends DefaultRecord<Record>>(data: readonly Record[], sortState: SortState<Record> | undefined) => Record[];
@@ -0,0 +1,48 @@
1
+ import { getSortFunction } from "../getSortFunction/getSortFunction.js";
2
+ const getSortedData = (data, sortState) => {
3
+ const innerSorterStates = sortState ? [sortState] : [];
4
+ const cloneData = data.slice();
5
+ const runningSorters = innerSorterStates.filter(({
6
+ column: {
7
+ sorter
8
+ },
9
+ sortOrder
10
+ }) => {
11
+ const sortFn = getSortFunction(sorter);
12
+ return sortFn && sortOrder;
13
+ });
14
+ if (!runningSorters.length) {
15
+ return cloneData;
16
+ }
17
+ return cloneData.sort((record1, record2) => {
18
+ for (let i = 0; i < runningSorters.length; i += 1) {
19
+ const sorterState = runningSorters[i];
20
+ const {
21
+ column: {
22
+ sorter
23
+ },
24
+ sortOrder
25
+ } = sorterState;
26
+ const compareFn = getSortFunction(sorter);
27
+ if (compareFn && sortOrder) {
28
+ const compareResult = compareFn(record1, record2, sortOrder);
29
+ if (compareResult !== 0) {
30
+ return sortOrder === "ascend" ? compareResult : -compareResult;
31
+ }
32
+ }
33
+ }
34
+ return 0;
35
+ }).map((record) => {
36
+ const subRecords = record.children;
37
+ if (subRecords) {
38
+ return {
39
+ ...record,
40
+ children: getSortedData(subRecords, sortState)
41
+ };
42
+ }
43
+ return record;
44
+ });
45
+ };
46
+ export {
47
+ getSortedData
48
+ };
@@ -0,0 +1 @@
1
+ export { getSortedData } from './getSortedData';
@@ -0,0 +1,2 @@
1
+ export { defaultSortDirections, defaultRowSelectionColumnWidth, defaultIndentSize } from './const';
2
+ export { getSortFunction } from './getSortFunction';
@@ -0,0 +1 @@
1
+ export { useTableStaticContext } from './tableStaticContext/useTableStaticContext/useTableStaticContext';
@@ -0,0 +1,21 @@
1
+ import { TableStaticContextValue } from './TableStaticContext.types';
2
+ import { DefaultRecord } from 'components/Table/Table.types';
3
+ export declare const initialTableStaticContextValue: {
4
+ readonly staticSelectedKeySet: Set<import('react').Key>;
5
+ readonly triggerSorter: (...args: any[]) => void;
6
+ readonly sortState: undefined;
7
+ readonly colsWidthsMap: Map<any, any>;
8
+ readonly isTableFirstMount: true;
9
+ readonly measureCellsInfo: {
10
+ readonly start: readonly [];
11
+ readonly end: readonly [];
12
+ readonly widths: readonly [];
13
+ };
14
+ readonly scrollableTableSectionInfo: {
15
+ readonly clientWidth: 0;
16
+ readonly horizontalScrollPositionRange: readonly [0, 0];
17
+ readonly verticalScrollBarWidth: 0;
18
+ };
19
+ readonly initialSortState: undefined;
20
+ };
21
+ export declare const createTableStaticContext: <Record extends DefaultRecord>() => import('react').Context<TableStaticContextValue<Record>>;
@@ -0,0 +1,29 @@
1
+ import { createContext } from "react";
2
+ import { noop, once } from "lodash-es";
3
+ const initialTableStaticContextValue = {
4
+ staticSelectedKeySet: /* @__PURE__ */ new Set(),
5
+ triggerSorter: noop,
6
+ sortState: void 0,
7
+ colsWidthsMap: /* @__PURE__ */ new Map(),
8
+ isTableFirstMount: true,
9
+ measureCellsInfo: {
10
+ start: [],
11
+ end: [],
12
+ widths: []
13
+ },
14
+ scrollableTableSectionInfo: {
15
+ clientWidth: 0,
16
+ horizontalScrollPositionRange: [0, 0],
17
+ verticalScrollBarWidth: 0
18
+ },
19
+ initialSortState: void 0
20
+ };
21
+ const createTableStaticContext = once(() => {
22
+ return createContext({
23
+ current: initialTableStaticContextValue
24
+ });
25
+ });
26
+ export {
27
+ createTableStaticContext,
28
+ initialTableStaticContextValue
29
+ };
@@ -0,0 +1,24 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { DefaultRecord, Key } from 'components/Table/Table.types';
3
+ import { ColumnKey, OffsetWidth } from 'components/Table/components/Body/components/MeasureRow/MeasureRow';
4
+ import { SortState } from 'components/Table/features/tableSort';
5
+ export type TableStaticValue<Record extends DefaultRecord> = {
6
+ staticSelectedKeySet: Set<Key>;
7
+ scrollableTableSectionInfo: {
8
+ horizontalScrollPositionRange: readonly [number, number];
9
+ verticalScrollBarWidth: number;
10
+ clientWidth: number;
11
+ };
12
+ measureCellsInfo: {
13
+ start: readonly number[];
14
+ end: readonly number[];
15
+ widths: readonly number[];
16
+ };
17
+ colsWidthsMap: Map<ColumnKey, OffsetWidth>;
18
+ isTableFirstMount: boolean;
19
+ initialSortState: SortState<Record> | undefined;
20
+ sortState: SortState<Record> | undefined;
21
+ triggerSorter: (sortState: SortState<Record>) => void;
22
+ };
23
+ export interface TableStaticContextValue<Record extends DefaultRecord> extends MutableRefObject<TableStaticValue<Record>> {
24
+ }
@@ -0,0 +1,2 @@
1
+ import { DefaultRecord } from 'components/Table/Table.types';
2
+ export declare const useTableStaticContext: <Record extends DefaultRecord>() => import('../TableStaticContext.types').TableStaticContextValue<Record>;
@@ -0,0 +1,8 @@
1
+ import { useContext } from "react";
2
+ import { createTableStaticContext } from "../TableStaticContext.js";
3
+ const useTableStaticContext = () => {
4
+ return useContext(createTableStaticContext());
5
+ };
6
+ export {
7
+ useTableStaticContext
8
+ };
@@ -0,0 +1 @@
1
+ export { withTableStaticContext } from './withTableStaticContext';
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { DefaultRecord } from 'components/Table/Table.types';
3
+ export declare const withTableStaticContext: <T extends FC<any>, Record extends DefaultRecord>(Component: T) => import('react').ForwardRefExoticComponent<Omit<any, "ref"> & import('react').RefAttributes<unknown>>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef, useRef } from "react";
3
+ import { useStatic } from "../../../../../hooks/useStatic/useStatic.js";
4
+ import { initialTableStaticContextValue, createTableStaticContext } from "../contexts/tableStaticContext/TableStaticContext.js";
5
+ const withTableStaticContext = (Component) => {
6
+ const WithTableStaticContext = forwardRef((props, ref) => {
7
+ const TableStaticContext = useStatic(() => createTableStaticContext());
8
+ const tableStaticContextValueRef = useRef(initialTableStaticContextValue);
9
+ return /* @__PURE__ */ jsx(TableStaticContext.Provider, { value: tableStaticContextValueRef, children: /* @__PURE__ */ jsx(Component, { ref, ...props }) });
10
+ });
11
+ return WithTableStaticContext;
12
+ };
13
+ export {
14
+ withTableStaticContext
15
+ };
@@ -0,0 +1,2 @@
1
+ export { withTableStaticContext } from './hocs';
2
+ export { useTableStaticContext } from './contexts';