@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,39 @@
1
+ import { useMemo } from "react";
2
+ import { flatColumns } from "./useTableColumns.utils.js";
3
+ import { useTransformColumns } from "../../features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js";
4
+ import { useTransformColumns as useTransformColumns$1 } from "../../features/tableSort/hooks/useTransformColumns/useTransformColumns.js";
5
+ const emptyColumnKey = "__EMPTY_COLUMN";
6
+ const useTableColumns = (options) => {
7
+ const {
8
+ columns: columnsProp,
9
+ rowSelection
10
+ } = options;
11
+ const {
12
+ transformColumns: rowSelectionTransformColumns
13
+ } = useTransformColumns({
14
+ rowSelection
15
+ });
16
+ const {
17
+ transformColumns: sorterTransformColumns
18
+ } = useTransformColumns$1();
19
+ const columns = useMemo(() => {
20
+ const transformers = [sorterTransformColumns, rowSelectionTransformColumns];
21
+ const resultColumns = transformers.reduce((transformedColumns, transformer) => transformer(transformedColumns), [...columnsProp]);
22
+ if (!resultColumns.length) {
23
+ resultColumns.push({
24
+ key: emptyColumnKey
25
+ });
26
+ }
27
+ return resultColumns;
28
+ }, [columnsProp, rowSelectionTransformColumns, sorterTransformColumns]);
29
+ const flattedColumns = useMemo(() => flatColumns(columns), [columns]);
30
+ const isAllColumnsFixedStart = useMemo(() => flattedColumns.every((col) => col.fixed === "start"), [flattedColumns]);
31
+ return {
32
+ columns,
33
+ flattedColumns,
34
+ isAllColumnsFixedStart
35
+ };
36
+ };
37
+ export {
38
+ useTableColumns
39
+ };
@@ -0,0 +1,4 @@
1
+ import { UseTransformColumnsOptions } from 'components/Table/features/tableRowSelection';
2
+ import { DefaultRecord, TableProps } from '../../Table.types';
3
+ export interface UseTableColumnsOptions<Record extends DefaultRecord> extends Pick<TableProps<Record>, "columns">, UseTransformColumnsOptions<Record> {
4
+ }
@@ -0,0 +1,2 @@
1
+ import { Column, Columns } from 'components/Table/interfaces/tableColumns.types';
2
+ export declare const flatColumns: <Record>(columns: Columns<Record>) => Column<Record>[];
@@ -0,0 +1,24 @@
1
+ const flatColumns = (columns) => {
2
+ return columns.reduce((acc, column) => {
3
+ const {
4
+ fixed
5
+ } = column;
6
+ const subColumns = "children" in column ? column.children : [];
7
+ if (subColumns.length > 0) {
8
+ return [...acc, ...flatColumns(subColumns).map((subColumn) => {
9
+ const clonedSubColumn = {
10
+ ...subColumn
11
+ };
12
+ const resultFixed = subColumn.fixed ?? fixed;
13
+ if (resultFixed) {
14
+ clonedSubColumn.fixed = resultFixed;
15
+ }
16
+ return clonedSubColumn;
17
+ })];
18
+ }
19
+ return [...acc, column];
20
+ }, []);
21
+ };
22
+ export {
23
+ flatColumns
24
+ };
@@ -0,0 +1 @@
1
+ export { useTableComponents } from './useTableComponents';
@@ -0,0 +1,6 @@
1
+ import { PropertyPath } from 'lodash-es';
2
+ import { UseTableComponentsOptions } from './useTableComponents.types';
3
+ import { CustomizedComponent } from 'components/Table/interfaces/tableComponents.types';
4
+ export declare const useTableComponents: (options: UseTableComponentsOptions) => {
5
+ getComponent: <T extends CustomizedComponent>(path: PropertyPath, defaultComponent: T) => T;
6
+ };
@@ -0,0 +1,14 @@
1
+ import { useCallback } from "react";
2
+ import { get } from "lodash-es";
3
+ const useTableComponents = (options) => {
4
+ const {
5
+ components
6
+ } = options;
7
+ const getComponent = useCallback((path, defaultComponent) => get(components, path, defaultComponent), [components]);
8
+ return {
9
+ getComponent
10
+ };
11
+ };
12
+ export {
13
+ useTableComponents
14
+ };
@@ -0,0 +1,3 @@
1
+ import { TableProps } from '../../Table.types';
2
+ export interface UseTableComponentsOptions extends Pick<TableProps, "components"> {
3
+ }
@@ -0,0 +1 @@
1
+ export { useTableVisualParamsChange } from './useTableVisualParamsChange';
@@ -0,0 +1,4 @@
1
+ import { DefaultRecord, TableProps } from 'components/Table/Table.types';
2
+ export interface UseTableVisualParamsChangeOptions<Record extends DefaultRecord> extends Pick<TableProps<Record>, "onScroll"> {
3
+ fixColumn?: boolean;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { UIEventHandler } from 'react';
2
+ import { UseTableVisualParamsChangeOptions } from './types';
3
+ import { OnResize } from 'rc-resize-observer';
4
+ import { DefaultRecord } from 'components/Table/Table.types';
5
+ export declare const useTableVisualParamsChange: <Record extends DefaultRecord>(options: UseTableVisualParamsChangeOptions<Record>) => {
6
+ onTableContentScroll: UIEventHandler<HTMLDivElement>;
7
+ onResize: OnResize;
8
+ onTableHeaderScroll: UIEventHandler<HTMLDivElement>;
9
+ onTableBodyScroll: UIEventHandler<HTMLDivElement>;
10
+ scrollableTableSectionRef: import('react').RefObject<HTMLDivElement>;
11
+ tableHeaderRef: import('react').RefObject<HTMLDivElement>;
12
+ };
@@ -0,0 +1,116 @@
1
+ import { useRef, useLayoutEffect, useCallback } from "react";
2
+ import { useEvent } from "../../../../hooks/useEvent/useEvent.js";
3
+ import "rc-resize-observer";
4
+ import { getVerticalScrollBarWidth, forceScroll, getHorizontalScrollPositionRange } from "./utils.js";
5
+ import { useTableStaticContext } from "../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
6
+ import { useEmitter } from "../../features/typedEventBus/hooks.js";
7
+ import { updateRefValue, getRefValue } from "../../utils/ref/ref.js";
8
+ const useTableVisualParamsChange = (options) => {
9
+ const {
10
+ fixColumn,
11
+ onScroll
12
+ } = options;
13
+ const staticContextRef = useTableStaticContext();
14
+ const tableHeaderRef = useRef(null);
15
+ const scrollableTableSectionRef = useRef(null);
16
+ const emitTableVisualParamsChange = useEvent(useEmitter("table-visual-params:change"));
17
+ useLayoutEffect(() => {
18
+ const scrollableTableSection = scrollableTableSectionRef.current;
19
+ if (!scrollableTableSection) {
20
+ return;
21
+ }
22
+ const horizontalScrollPositionRange = getHorizontalScrollPositionRange(scrollableTableSection);
23
+ const verticalScrollBarWidth = getVerticalScrollBarWidth(scrollableTableSection);
24
+ const {
25
+ clientWidth
26
+ } = scrollableTableSection;
27
+ updateRefValue(staticContextRef, {
28
+ scrollableTableSectionInfo: {
29
+ horizontalScrollPositionRange,
30
+ clientWidth,
31
+ verticalScrollBarWidth
32
+ }
33
+ });
34
+ const measureCellsInfo = getRefValue(staticContextRef, "measureCellsInfo");
35
+ emitTableVisualParamsChange({
36
+ horizontalScrollPositionRange,
37
+ verticalScrollBarWidth,
38
+ clientWidth,
39
+ measureCellsInfo
40
+ });
41
+ }, [emitTableVisualParamsChange, staticContextRef]);
42
+ const handleTableHeaderScroll = useCallback((e) => {
43
+ const {
44
+ scrollLeft
45
+ } = e.currentTarget;
46
+ forceScroll(scrollLeft, scrollableTableSectionRef.current);
47
+ }, []);
48
+ const prevScrollTopRef = useRef(0);
49
+ const handleTableContentScroll = (e) => {
50
+ const {
51
+ currentTarget
52
+ } = e;
53
+ const horizontalScrollPositionRange = getHorizontalScrollPositionRange(currentTarget);
54
+ updateRefValue(staticContextRef, {
55
+ "scrollableTableSectionInfo.horizontalScrollPositionRange": horizontalScrollPositionRange
56
+ });
57
+ const {
58
+ scrollLeft,
59
+ scrollTop
60
+ } = currentTarget;
61
+ if (prevScrollTopRef.current !== scrollTop) {
62
+ prevScrollTopRef.current = scrollTop;
63
+ return;
64
+ }
65
+ forceScroll(scrollLeft, tableHeaderRef.current);
66
+ if (!fixColumn) {
67
+ return;
68
+ }
69
+ emitTableVisualParamsChange({
70
+ horizontalScrollPositionRange
71
+ });
72
+ };
73
+ const firstCallRef = useRef(true);
74
+ const handleResize = useCallback(() => {
75
+ if (firstCallRef.current) {
76
+ firstCallRef.current = false;
77
+ return;
78
+ }
79
+ const scrollableTableSection = scrollableTableSectionRef.current;
80
+ if (!scrollableTableSection) {
81
+ return;
82
+ }
83
+ const horizontalScrollPositionRange = getHorizontalScrollPositionRange(scrollableTableSection);
84
+ const verticalScrollBarWidth = getVerticalScrollBarWidth(scrollableTableSection);
85
+ const {
86
+ clientWidth
87
+ } = scrollableTableSection;
88
+ updateRefValue(staticContextRef, {
89
+ scrollableTableSectionInfo: {
90
+ horizontalScrollPositionRange,
91
+ clientWidth,
92
+ verticalScrollBarWidth
93
+ }
94
+ });
95
+ emitTableVisualParamsChange({
96
+ horizontalScrollPositionRange,
97
+ verticalScrollBarWidth,
98
+ clientWidth
99
+ });
100
+ }, [emitTableVisualParamsChange, staticContextRef]);
101
+ const handleTableBodyScroll = (e) => {
102
+ handleTableContentScroll(e);
103
+ onScroll == null ? void 0 : onScroll(e);
104
+ };
105
+ return {
106
+ onTableContentScroll: handleTableContentScroll,
107
+ onResize: handleResize,
108
+ onTableHeaderScroll: handleTableHeaderScroll,
109
+ onTableBodyScroll: handleTableBodyScroll,
110
+ scrollableTableSectionRef,
111
+ tableHeaderRef
112
+ };
113
+ };
114
+ export {
115
+ useTableVisualParamsChange
116
+ };
@@ -0,0 +1,3 @@
1
+ export declare const forceScroll: (scrollLeft: number, target: HTMLElement | null) => void;
2
+ export declare const getHorizontalScrollPositionRange: (el: HTMLElement) => readonly [number, number];
3
+ export declare const getVerticalScrollBarWidth: (el: HTMLElement) => number;
@@ -0,0 +1,35 @@
1
+ const forceScroll = (scrollLeft, target) => {
2
+ if (!target || target.scrollLeft === scrollLeft) {
3
+ return;
4
+ }
5
+ target.scrollLeft = scrollLeft;
6
+ if (target.scrollLeft !== scrollLeft) {
7
+ setTimeout(() => {
8
+ target.scrollLeft = scrollLeft;
9
+ }, 0);
10
+ }
11
+ };
12
+ const getHorizontalScrollPositionRange = (el) => {
13
+ const {
14
+ scrollLeft,
15
+ scrollWidth,
16
+ clientWidth
17
+ } = el;
18
+ return [scrollLeft, scrollWidth - clientWidth];
19
+ };
20
+ const getVerticalScrollBarWidth = (el) => {
21
+ const {
22
+ offsetWidth,
23
+ clientWidth
24
+ } = el;
25
+ const {
26
+ borderLeftWidth,
27
+ borderRightWidth
28
+ } = getComputedStyle(el);
29
+ return offsetWidth - clientWidth - parseInt(borderLeftWidth) - parseInt(borderRightWidth);
30
+ };
31
+ export {
32
+ forceScroll,
33
+ getHorizontalScrollPositionRange,
34
+ getVerticalScrollBarWidth
35
+ };
@@ -0,0 +1,2 @@
1
+ export { Table } from './Table';
2
+ export type { TableProps } from './Table.types';
@@ -0,0 +1,45 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { PropertyPath } from 'lodash-es';
3
+ import { GetComponentProps, GetSingleComponentProps } from './tableComponents.types';
4
+ import { Key } from '../Table.types';
5
+ import { CompareFn, SortOrder } from '../features/tableSort';
6
+ export type ColScopeType = "col" | "colgroup";
7
+ export type RowScopeType = "row" | "rowgroup";
8
+ export type ScopeType = ColScopeType | RowScopeType;
9
+ export type AlignType = "start" | "end" | "left" | "right" | "center" | "justify" | "match-parent";
10
+ interface BaseColumn<Record> {
11
+ key: Key;
12
+ dataIndex?: PropertyPath;
13
+ title?: ReactNode;
14
+ fixed?: "start" | "end";
15
+ onHeaderCell?: GetSingleComponentProps<Columns<Record>[number]>;
16
+ rowScope?: RowScopeType;
17
+ align?: CSSProperties["textAlign"];
18
+ ellipsis?: CellEllipsisType;
19
+ render?: (value: any, record: Record, index: number) => ReactNode;
20
+ sorter?: boolean | CompareFn<Record>;
21
+ defaultSortOrder?: SortOrder;
22
+ sortDirections?: SortOrder[];
23
+ colSpan?: number;
24
+ rowSpan?: number;
25
+ }
26
+ export type CellEllipsisType = {
27
+ showTitle?: boolean;
28
+ } | boolean;
29
+ interface ColumnWithChildrenForbidden {
30
+ onCell?: never;
31
+ }
32
+ export interface ColumnWithChildren<Record> extends BaseColumn<Record>, ColumnWithChildrenForbidden {
33
+ children: Columns<Record>;
34
+ }
35
+ export interface Column<Record> extends BaseColumn<Record> {
36
+ onCell?: GetComponentProps<Record>;
37
+ width?: number | string;
38
+ minWidth?: number | string;
39
+ }
40
+ export type Columns<Record> = readonly (ColumnWithChildren<Record> | Column<Record>)[];
41
+ export type Writable<T> = {
42
+ -readonly [P in keyof T]: T[P];
43
+ };
44
+ export type ColumnsTransformer<Record> = (columns: Writable<Columns<Record>>) => Writable<Columns<Record>>;
45
+ export {};
@@ -0,0 +1,28 @@
1
+ import { ComponentType, CSSProperties, HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ import { CSSInterpolation } from '@emotion/serialize';
3
+ export type CustomizedComponent = keyof JSX.IntrinsicElements | ComponentType;
4
+ export interface TableComponents<C extends CustomizedComponent = CustomizedComponent> {
5
+ table?: C;
6
+ header?: {
7
+ table?: C;
8
+ wrapper?: C;
9
+ row?: C;
10
+ cell?: C;
11
+ };
12
+ body?: {
13
+ wrapper?: C;
14
+ row?: C;
15
+ cell?: C;
16
+ };
17
+ }
18
+ type OverrideAlign<T extends {
19
+ align?: unknown;
20
+ }> = Omit<T, "align"> & {
21
+ align?: CSSProperties["textAlign"];
22
+ };
23
+ type WithCss<T> = T & {
24
+ css?: CSSInterpolation;
25
+ };
26
+ export type GetSingleComponentProps<Data, R extends HTMLAttributes<HTMLElement> = OverrideAlign<ThHTMLAttributes<HTMLTableCellElement>>> = (data: Data) => WithCss<R>;
27
+ export type GetComponentProps<Data, R extends HTMLAttributes<HTMLElement> = OverrideAlign<TdHTMLAttributes<HTMLTableCellElement>>> = (data: Data, index: number) => WithCss<R>;
28
+ export {};
@@ -0,0 +1,2 @@
1
+ import { DefaultRecord } from '../../Table.types';
2
+ export declare const getRowKey: <T extends DefaultRecord>(record: T) => import('react').Key;
@@ -0,0 +1,4 @@
1
+ const getRowKey = (record) => record.key;
2
+ export {
3
+ getRowKey
4
+ };
@@ -0,0 +1,2 @@
1
+ export { getRowKey } from './getRowKey';
2
+ export type { GetRowKey } from './types';
@@ -0,0 +1,2 @@
1
+ import { DefaultRecord, Key } from 'components/Table/Table.types';
2
+ export type GetRowKey<Record extends DefaultRecord> = (record: Record) => Key;
@@ -0,0 +1,2 @@
1
+ export { updateRefValue, getRefValue } from './ref';
2
+ export { getRowKey, type GetRowKey } from './getRowKey';
@@ -0,0 +1 @@
1
+ export { updateRefValue, getRefValue } from './ref';
@@ -0,0 +1,5 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { NestedKeyOf, NestedValueOf, Updates } from './types';
3
+ export declare const updateRefValue: <T extends object>(ref: MutableRefObject<T>, updates: Updates<T>) => void;
4
+ export declare function getRefValue<T extends object>(ref: MutableRefObject<T>): T;
5
+ export declare function getRefValue<T extends object, K extends NestedKeyOf<T>>(ref: MutableRefObject<T>, key: K): NestedValueOf<T, K>;
@@ -0,0 +1,16 @@
1
+ import { set, isUndefined, get } from "lodash-es";
2
+ const updateRefValue = (ref, updates) => {
3
+ Object.entries(updates).forEach(([key, value]) => {
4
+ set(ref.current, key, value);
5
+ });
6
+ };
7
+ function getRefValue(ref, key) {
8
+ if (isUndefined(key)) {
9
+ return ref.current;
10
+ }
11
+ return get(ref.current, key);
12
+ }
13
+ export {
14
+ getRefValue,
15
+ updateRefValue
16
+ };
@@ -0,0 +1,10 @@
1
+ export type Updates<T> = Partial<{
2
+ [K in NestedKeyOf<T>]: NestedValueOf<T, K>;
3
+ }>;
4
+ type Decrement<N extends number> = N extends 0 ? 0 : Tuple<N> extends [unknown, ...infer Rest] ? Rest["length"] : 0;
5
+ type Tuple<N extends number, Acc extends unknown[] = []> = Acc["length"] extends N ? Acc : Tuple<N, [unknown, ...Acc]>;
6
+ export type NestedKeyOf<ObjectType, Depth extends number = 2> = Decrement<Depth> extends infer PrevDepth extends number ? Depth extends 0 ? never : ObjectType extends readonly unknown[] ? never : ObjectType extends object ? {
7
+ [Key in keyof ObjectType]: `${Key & string}` | `${Key & string}.${NestedKeyOf<ObjectType[Key], PrevDepth>}`;
8
+ }[keyof ObjectType] : never : never;
9
+ export type NestedValueOf<ObjectType, Property extends string> = Property extends `${infer Key}.${infer Rest}` ? Key extends keyof ObjectType ? NestedValueOf<ObjectType[Key], Rest> : never : Property extends keyof ObjectType ? ObjectType[Property] : never;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { useEvent } from './useEvent';
@@ -0,0 +1,2 @@
1
+ import { Callback } from './useEvent.types';
2
+ export declare const useEvent: <Args extends readonly unknown[], Return>(callback: Callback<Args, Return>) => Callback<Args, Return>;
@@ -0,0 +1,9 @@
1
+ import { useRef, useCallback } from "react";
2
+ const useEvent = (callback) => {
3
+ const callbackRef = useRef(callback);
4
+ callbackRef.current = callback;
5
+ return useCallback((...args) => callbackRef.current(...args), []);
6
+ };
7
+ export {
8
+ useEvent
9
+ };
@@ -0,0 +1 @@
1
+ export type Callback<Args extends readonly unknown[], Return> = (...args: Args) => Return;
@@ -0,0 +1 @@
1
+ export { useFirstMount } from './useFirstMount';
@@ -0,0 +1 @@
1
+ export declare const useFirstMount: () => boolean;
@@ -0,0 +1,12 @@
1
+ import { useRef } from "react";
2
+ const useFirstMount = () => {
3
+ const firstMountRef = useRef(true);
4
+ if (firstMountRef.current) {
5
+ firstMountRef.current = false;
6
+ return true;
7
+ }
8
+ return firstMountRef.current;
9
+ };
10
+ export {
11
+ useFirstMount
12
+ };
@@ -0,0 +1 @@
1
+ export { useStatic } from './useStatic';
@@ -0,0 +1 @@
1
+ export declare const useStatic: <T>(init: () => T) => T;
@@ -0,0 +1,8 @@
1
+ import { useRef } from "react";
2
+ const useStatic = (init) => {
3
+ const ref = useRef(null);
4
+ return ref.current || (ref.current = init());
5
+ };
6
+ export {
7
+ useStatic
8
+ };
package/dist/index.d.ts CHANGED
@@ -49,4 +49,5 @@ export { type EmptyProps, Empty } from './components/Empty';
49
49
  export { type SegmentedProps, type SegmentedLabeledOption, Segmented, } from './components/Segmented';
50
50
  export { ContextIsolator } from './components/ContextIsolator';
51
51
  export { type SpinProps, Spin } from './components/Spin';
52
+ export { type TableProps, Table } from './components/Table';
52
53
  export * from 'react-intersection-observer/test-utils';
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ import { Empty } from "./components/Empty/Empty.js";
37
37
  import { Segmented } from "./components/Segmented/Segmented.js";
38
38
  import { ContextIsolator } from "./components/ContextIsolator/ContextIsolator.js";
39
39
  import { Spin } from "./components/Spin/Spin.js";
40
+ import { Table } from "./components/Table/Table.js";
40
41
  export {
41
42
  Alert,
42
43
  Avatar,
@@ -60,6 +61,7 @@ export {
60
61
  Select,
61
62
  Spin,
62
63
  Switch,
64
+ Table,
63
65
  Tabs,
64
66
  Tag,
65
67
  ThemeProvider,
@@ -0,0 +1,2 @@
1
+ import { EventBusContextValue } from './EventBusContext.types';
2
+ export declare const EventBusContext: import('react').Context<EventBusContextValue | null>;
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ const EventBusContext = createContext(null);
3
+ export {
4
+ EventBusContext
5
+ };
@@ -0,0 +1,5 @@
1
+ import { EventBus } from '../eventBus';
2
+ import { EventMap } from '../types';
3
+ export type EventBusContextValue<EM extends EventMap = EventMap> = {
4
+ bus: EventBus<EM>;
5
+ };
@@ -0,0 +1,10 @@
1
+ import { EventCallback, EventMap } from './types';
2
+ export declare class EventBus<EM extends EventMap> {
3
+ private subscribers;
4
+ on<K extends keyof EM>(event: K, callback: EventCallback<EM[K]>): () => void;
5
+ off<K extends keyof EM>(event: K, callback: EventCallback<EM[K]>): void;
6
+ emit<K extends keyof EM>(event: K, payload: EM[K]): void;
7
+ subscriberCount<K extends keyof EM>(event: K): number;
8
+ clearEvent<K extends keyof EM>(event: K): void;
9
+ clearAll(): void;
10
+ }
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ class EventBus {
5
+ constructor() {
6
+ __publicField(this, "subscribers", {});
7
+ }
8
+ on(event, callback) {
9
+ if (!this.subscribers[event]) {
10
+ this.subscribers[event] = [];
11
+ }
12
+ this.subscribers[event].push(callback);
13
+ return () => this.off(event, callback);
14
+ }
15
+ off(event, callback) {
16
+ if (!this.subscribers[event]) {
17
+ return;
18
+ }
19
+ this.subscribers[event] = this.subscribers[event].filter((cb) => cb !== callback);
20
+ if (this.subscribers[event].length === 0) {
21
+ delete this.subscribers[event];
22
+ }
23
+ }
24
+ emit(event, payload) {
25
+ var _a;
26
+ (_a = this.subscribers[event]) == null ? void 0 : _a.forEach((callback) => {
27
+ try {
28
+ callback(payload);
29
+ } catch (error) {
30
+ console.error(`Ошибка в обработчике события для события ${String(event)}:`, error);
31
+ }
32
+ });
33
+ }
34
+ subscriberCount(event) {
35
+ var _a;
36
+ return ((_a = this.subscribers[event]) == null ? void 0 : _a.length) || 0;
37
+ }
38
+ clearEvent(event) {
39
+ delete this.subscribers[event];
40
+ }
41
+ clearAll() {
42
+ this.subscribers = {};
43
+ }
44
+ }
45
+ export {
46
+ EventBus
47
+ };
@@ -0,0 +1 @@
1
+ export { withEventBus } from './withEventBus';
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const withEventBus: <T extends FC<any>>(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 } from "react";
3
+ import { useStatic } from "../../../../hooks/useStatic/useStatic.js";
4
+ import { EventBus } from "../../eventBus.js";
5
+ import { EventBusProvider } from "../../provider/EventBusProvider.js";
6
+ const withEventBus = (Component) => {
7
+ const WithEventBus = forwardRef((props, ref) => {
8
+ const eventBus = useStatic(() => new EventBus());
9
+ return /* @__PURE__ */ jsx(EventBusProvider, { bus: eventBus, children: /* @__PURE__ */ jsx(Component, { ref, ...props }) });
10
+ });
11
+ return WithEventBus;
12
+ };
13
+ export {
14
+ withEventBus
15
+ };
@@ -0,0 +1,2 @@
1
+ import { EventMap } from '../../types';
2
+ export declare const defineTypedEmitterHook: <EM extends EventMap>() => <K extends keyof EM>(event: K) => (payload: EM[K]) => void;
@@ -0,0 +1,8 @@
1
+ import { useEventBus } from "../useEventBus/useEventBus.js";
2
+ const defineTypedEmitterHook = () => (event) => {
3
+ const bus = useEventBus();
4
+ return (payload) => bus.emit(event, payload);
5
+ };
6
+ export {
7
+ defineTypedEmitterHook
8
+ };
@@ -0,0 +1,3 @@
1
+ import { EventMap } from '../../types';
2
+ import { EventBus } from '../../eventBus';
3
+ export declare const useEventBus: <EM extends EventMap>() => EventBus<EM>;
@@ -0,0 +1,12 @@
1
+ import { useContext } from "react";
2
+ import { EventBusContext } from "../../context/EventBusContext.js";
3
+ const useEventBus = () => {
4
+ const context = useContext(EventBusContext);
5
+ if (!context) {
6
+ throw new Error("useEventBus должен использоваться внутри EventBusProvider");
7
+ }
8
+ return context.bus;
9
+ };
10
+ export {
11
+ useEventBus
12
+ };