@astral/ui 4.4.1 → 4.6.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 (343) hide show
  1. package/components/DataGrid/Head/Head.js +5 -4
  2. package/components/DataGrid/HeadCell/styles.js +5 -0
  3. package/components/DataGrid/types.d.ts +4 -0
  4. package/components/DataGridColumnHintIcon/DataGridColumnHintIcon.d.ts +4 -0
  5. package/components/DataGridColumnHintIcon/DataGridColumnHintIcon.js +6 -0
  6. package/components/DataGridColumnHintIcon/index.d.ts +1 -0
  7. package/components/DataGridColumnHintIcon/index.js +1 -0
  8. package/components/HintIcon/HintIcon.d.ts +2 -35
  9. package/components/HintIcon/HintIcon.js +2 -2
  10. package/components/HintIcon/Icon/Icon.d.ts +4 -5
  11. package/components/HintIcon/Icon/Icon.js +2 -1
  12. package/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.d.ts +3 -1
  13. package/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.js +4 -1
  14. package/components/HintIcon/Icon/useLogic/useLogic.d.ts +3 -3
  15. package/components/HintIcon/Icon/useLogic/useLogic.js +5 -2
  16. package/components/HintIcon/constants.d.ts +3 -0
  17. package/components/HintIcon/constants.js +4 -0
  18. package/components/HintIcon/index.d.ts +2 -0
  19. package/components/HintIcon/index.js +1 -0
  20. package/components/HintIcon/styles.d.ts +0 -6
  21. package/components/HintIcon/styles.js +0 -7
  22. package/components/HintIcon/types.d.ts +38 -0
  23. package/components/HintIcon/useLogic/useLogic.d.ts +3 -2
  24. package/components/HintIcon/useLogic/useLogic.js +4 -2
  25. package/components/Tree/MultipleTreeList/MultipleTreeList.d.ts +2 -2
  26. package/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
  27. package/components/Tree/MultipleTreeList/TreeItem/TreeItem.d.ts +10 -6
  28. package/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +3 -2
  29. package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +3 -2
  30. package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +24 -18
  31. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.d.ts +2 -1
  32. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.js +2 -1
  33. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
  34. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
  35. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
  36. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +22 -0
  37. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
  38. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +1 -0
  39. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
  40. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +6 -0
  41. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
  42. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.js +1 -0
  43. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.d.ts +5 -0
  44. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.js +14 -0
  45. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.d.ts +1 -0
  46. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.js +1 -0
  47. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.d.ts +3 -0
  48. package/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.js +3 -0
  49. package/components/Tree/MultipleTreeList/types.d.ts +8 -4
  50. package/components/TreeAsyncAutocomplete/types.d.ts +14 -2
  51. package/components/TreeLikeAsyncAutocomplete/Input/Input.d.ts +3 -0
  52. package/components/TreeLikeAsyncAutocomplete/Input/Input.js +20 -0
  53. package/components/TreeLikeAsyncAutocomplete/Input/constants.d.ts +1 -0
  54. package/components/TreeLikeAsyncAutocomplete/Input/constants.js +1 -0
  55. package/components/TreeLikeAsyncAutocomplete/Input/index.d.ts +1 -0
  56. package/components/TreeLikeAsyncAutocomplete/Input/index.js +1 -0
  57. package/components/TreeLikeAsyncAutocomplete/Input/styles.d.ts +11 -0
  58. package/components/TreeLikeAsyncAutocomplete/Input/styles.js +27 -0
  59. package/components/TreeLikeAsyncAutocomplete/Input/types.d.ts +7 -0
  60. package/components/TreeLikeAsyncAutocomplete/Input/types.js +1 -0
  61. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.d.ts +1 -0
  62. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.js +1 -0
  63. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +18 -0
  64. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +50 -0
  65. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.d.ts +13 -0
  66. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +6 -0
  67. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.d.ts +1 -0
  68. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.js +1 -0
  69. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.d.ts +5 -0
  70. package/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.js +10 -0
  71. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.d.ts +2 -0
  72. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.js +4 -0
  73. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.d.ts +1 -0
  74. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.js +1 -0
  75. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.d.ts +5 -0
  76. package/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.js +8 -0
  77. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.d.ts +2 -0
  78. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.js +6 -0
  79. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.d.ts +1 -0
  80. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.js +1 -0
  81. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.d.ts +5 -0
  82. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +8 -0
  83. package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.d.ts +3 -0
  84. package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +33 -0
  85. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.d.ts +2 -0
  86. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.js +6 -0
  87. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.d.ts +1 -0
  88. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.js +1 -0
  89. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.d.ts +5 -0
  90. package/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.js +8 -0
  91. package/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.d.ts +1 -0
  92. package/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.js +1 -0
  93. package/components/TreeLikeAsyncAutocomplete/OptionsModal/index.d.ts +1 -0
  94. package/components/TreeLikeAsyncAutocomplete/OptionsModal/index.js +1 -0
  95. package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +19 -0
  96. package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +48 -0
  97. package/components/TreeLikeAsyncAutocomplete/OptionsModal/types.d.ts +69 -0
  98. package/components/TreeLikeAsyncAutocomplete/OptionsModal/types.js +1 -0
  99. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.d.ts +1 -0
  100. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.js +1 -0
  101. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +27 -0
  102. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +92 -0
  103. package/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.d.ts +3 -0
  104. package/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.js +9 -0
  105. package/components/TreeLikeAsyncAutocomplete/constants.d.ts +2 -0
  106. package/components/TreeLikeAsyncAutocomplete/constants.js +2 -0
  107. package/components/TreeLikeAsyncAutocomplete/index.d.ts +2 -0
  108. package/components/TreeLikeAsyncAutocomplete/index.js +1 -0
  109. package/components/TreeLikeAsyncAutocomplete/types.d.ts +69 -0
  110. package/components/TreeLikeAsyncAutocomplete/types.js +1 -0
  111. package/components/TreeLikeAsyncAutocomplete/useLogic/index.d.ts +1 -0
  112. package/components/TreeLikeAsyncAutocomplete/useLogic/index.js +1 -0
  113. package/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.d.ts +626 -0
  114. package/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.js +82 -0
  115. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.d.ts +3 -0
  116. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.js +12 -0
  117. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.d.ts +1 -0
  118. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.js +1 -0
  119. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.d.ts +1 -0
  120. package/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.js +1 -0
  121. package/components/TreeLikeList/TreeItem/TreeItem.d.ts +3 -51
  122. package/components/TreeLikeList/TreeItem/TreeItem.js +3 -2
  123. package/components/TreeLikeList/TreeItem/types.d.ts +56 -0
  124. package/components/TreeLikeList/TreeItem/types.js +1 -0
  125. package/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +4 -3
  126. package/components/TreeLikeList/TreeItem/useLogic/useLogic.js +22 -13
  127. package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.d.ts +6 -0
  128. package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.js +8 -0
  129. package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.d.ts +1 -0
  130. package/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.js +1 -0
  131. package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.d.ts +6 -0
  132. package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.js +15 -0
  133. package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.d.ts +1 -0
  134. package/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.js +1 -0
  135. package/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
  136. package/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
  137. package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
  138. package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +22 -0
  139. package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
  140. package/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +1 -0
  141. package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.d.ts +5 -0
  142. package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.js +10 -0
  143. package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.d.ts +1 -0
  144. package/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.js +1 -0
  145. package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
  146. package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +6 -0
  147. package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
  148. package/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.js +1 -0
  149. package/components/TreeLikeList/TreeItem/useLogic/utils/index.d.ts +7 -0
  150. package/components/TreeLikeList/TreeItem/useLogic/utils/index.js +7 -0
  151. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.d.ts +1 -0
  152. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.js +1 -0
  153. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.d.ts +5 -0
  154. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.js +10 -0
  155. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.d.ts +1 -0
  156. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.js +1 -0
  157. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.d.ts +5 -0
  158. package/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.js +11 -0
  159. package/components/TreeLikeList/TreeLikeList.d.ts +2 -3
  160. package/components/TreeLikeList/TreeLikeList.js +1 -1
  161. package/components/TreeLikeList/index.d.ts +1 -0
  162. package/components/TreeLikeList/types.d.ts +8 -4
  163. package/components/TreeLikeList/useLogic/useLogic.d.ts +3 -3
  164. package/components/TreeLikeList/useLogic/useLogic.js +3 -2
  165. package/components/TreeLikeList/useLogic/utils/getChainsId/getChainsId.js +17 -10
  166. package/components/index.d.ts +1 -0
  167. package/components/index.js +1 -0
  168. package/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.d.ts +13 -0
  169. package/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.js +13 -0
  170. package/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +0 -0
  171. package/hook-form/FormTreeLikeAsyncAutocomplete/index.js +1 -0
  172. package/node/components/DataGrid/Head/Head.js +4 -3
  173. package/node/components/DataGrid/HeadCell/styles.js +5 -0
  174. package/node/components/DataGrid/types.d.ts +4 -0
  175. package/node/components/DataGridColumnHintIcon/DataGridColumnHintIcon.d.ts +4 -0
  176. package/node/components/DataGridColumnHintIcon/DataGridColumnHintIcon.js +10 -0
  177. package/node/components/DataGridColumnHintIcon/index.d.ts +1 -0
  178. package/node/components/DataGridColumnHintIcon/index.js +17 -0
  179. package/node/components/HintIcon/HintIcon.d.ts +2 -35
  180. package/node/components/HintIcon/HintIcon.js +2 -2
  181. package/node/components/HintIcon/Icon/Icon.d.ts +4 -5
  182. package/node/components/HintIcon/Icon/Icon.js +2 -1
  183. package/node/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.d.ts +3 -1
  184. package/node/components/HintIcon/Icon/useLogic/hooks/useIconColor/useIconColor.js +4 -1
  185. package/node/components/HintIcon/Icon/useLogic/useLogic.d.ts +3 -3
  186. package/node/components/HintIcon/Icon/useLogic/useLogic.js +5 -2
  187. package/node/components/HintIcon/constants.d.ts +3 -0
  188. package/node/components/HintIcon/constants.js +5 -1
  189. package/node/components/HintIcon/index.d.ts +2 -0
  190. package/node/components/HintIcon/index.js +3 -0
  191. package/node/components/HintIcon/styles.d.ts +0 -6
  192. package/node/components/HintIcon/styles.js +1 -8
  193. package/node/components/HintIcon/types.d.ts +38 -0
  194. package/node/components/HintIcon/useLogic/useLogic.d.ts +3 -2
  195. package/node/components/HintIcon/useLogic/useLogic.js +4 -2
  196. package/node/components/Tree/MultipleTreeList/MultipleTreeList.d.ts +2 -2
  197. package/node/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
  198. package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.d.ts +10 -6
  199. package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +3 -2
  200. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +3 -2
  201. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +23 -17
  202. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.d.ts +2 -1
  203. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsIndeterminate/checkIsIndeterminate.js +2 -1
  204. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
  205. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
  206. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
  207. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +26 -0
  208. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
  209. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +17 -0
  210. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
  211. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +10 -0
  212. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
  213. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getIdFromValue/index.js +17 -0
  214. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.d.ts +5 -0
  215. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/getItemsToAdd.js +18 -0
  216. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.d.ts +1 -0
  217. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/getItemsToAdd/index.js +17 -0
  218. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.d.ts +3 -0
  219. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/utils/index.js +7 -1
  220. package/node/components/Tree/MultipleTreeList/types.d.ts +8 -4
  221. package/node/components/TreeAsyncAutocomplete/types.d.ts +14 -2
  222. package/node/components/TreeLikeAsyncAutocomplete/Input/Input.d.ts +3 -0
  223. package/node/components/TreeLikeAsyncAutocomplete/Input/Input.js +23 -0
  224. package/node/components/TreeLikeAsyncAutocomplete/Input/constants.d.ts +1 -0
  225. package/node/components/TreeLikeAsyncAutocomplete/Input/constants.js +4 -0
  226. package/node/components/TreeLikeAsyncAutocomplete/Input/index.d.ts +1 -0
  227. package/node/components/TreeLikeAsyncAutocomplete/Input/index.js +17 -0
  228. package/node/components/TreeLikeAsyncAutocomplete/Input/styles.d.ts +11 -0
  229. package/node/components/TreeLikeAsyncAutocomplete/Input/styles.js +30 -0
  230. package/node/components/TreeLikeAsyncAutocomplete/Input/types.d.ts +7 -0
  231. package/node/components/TreeLikeAsyncAutocomplete/Input/types.js +2 -0
  232. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.d.ts +1 -0
  233. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/index.js +17 -0
  234. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +18 -0
  235. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +54 -0
  236. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.d.ts +13 -0
  237. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +10 -0
  238. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.d.ts +1 -0
  239. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/index.js +17 -0
  240. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.d.ts +5 -0
  241. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/ErrorMessage/styles.js +13 -0
  242. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.d.ts +2 -0
  243. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/Loader.js +8 -0
  244. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.d.ts +1 -0
  245. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/index.js +17 -0
  246. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.d.ts +5 -0
  247. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/Loader/styles.js +11 -0
  248. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.d.ts +2 -0
  249. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/NoData.js +10 -0
  250. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.d.ts +1 -0
  251. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/index.js +17 -0
  252. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.d.ts +5 -0
  253. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +11 -0
  254. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.d.ts +3 -0
  255. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +37 -0
  256. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.d.ts +2 -0
  257. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/SearchSuggestion.js +10 -0
  258. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.d.ts +1 -0
  259. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/index.js +17 -0
  260. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.d.ts +5 -0
  261. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/SearchSuggestion/styles.js +11 -0
  262. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.d.ts +1 -0
  263. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/constants.js +4 -0
  264. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/index.d.ts +1 -0
  265. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/index.js +17 -0
  266. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +19 -0
  267. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +51 -0
  268. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/types.d.ts +69 -0
  269. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/types.js +2 -0
  270. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.d.ts +1 -0
  271. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/index.js +17 -0
  272. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +27 -0
  273. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +96 -0
  274. package/node/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.d.ts +3 -0
  275. package/node/components/TreeLikeAsyncAutocomplete/TreeLikeAsyncAutocomplete.js +12 -0
  276. package/node/components/TreeLikeAsyncAutocomplete/constants.d.ts +2 -0
  277. package/node/components/TreeLikeAsyncAutocomplete/constants.js +5 -0
  278. package/node/components/TreeLikeAsyncAutocomplete/index.d.ts +2 -0
  279. package/node/components/TreeLikeAsyncAutocomplete/index.js +17 -0
  280. package/node/components/TreeLikeAsyncAutocomplete/types.d.ts +69 -0
  281. package/node/components/TreeLikeAsyncAutocomplete/types.js +2 -0
  282. package/node/components/TreeLikeAsyncAutocomplete/useLogic/index.d.ts +1 -0
  283. package/node/components/TreeLikeAsyncAutocomplete/useLogic/index.js +17 -0
  284. package/node/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.d.ts +626 -0
  285. package/node/components/TreeLikeAsyncAutocomplete/useLogic/useLogic.js +86 -0
  286. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.d.ts +3 -0
  287. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/deepMultipleFind.js +16 -0
  288. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.d.ts +1 -0
  289. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/deepMultipleFind/index.js +17 -0
  290. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.d.ts +1 -0
  291. package/node/components/TreeLikeAsyncAutocomplete/useLogic/utils/index.js +5 -0
  292. package/node/components/TreeLikeList/TreeItem/TreeItem.d.ts +3 -51
  293. package/node/components/TreeLikeList/TreeItem/TreeItem.js +3 -2
  294. package/node/components/TreeLikeList/TreeItem/types.d.ts +56 -0
  295. package/node/components/TreeLikeList/TreeItem/types.js +2 -0
  296. package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +4 -3
  297. package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.js +21 -12
  298. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.d.ts +6 -0
  299. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/addItem.js +12 -0
  300. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.d.ts +1 -0
  301. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItem/index.js +5 -0
  302. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.d.ts +6 -0
  303. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/addItemsByIds.js +19 -0
  304. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.d.ts +1 -0
  305. package/node/components/TreeLikeList/TreeItem/useLogic/utils/addItemsByIds/index.js +5 -0
  306. package/node/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.d.ts +2 -1
  307. package/node/components/TreeLikeList/TreeItem/useLogic/utils/checkIsSelected/checkIsSelected.js +2 -1
  308. package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.d.ts +5 -0
  309. package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/findObjectsByIds.js +26 -0
  310. package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.d.ts +1 -0
  311. package/node/components/TreeLikeList/TreeItem/useLogic/utils/findObjectsByIds/index.js +5 -0
  312. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.d.ts +5 -0
  313. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/getCurrentValueIds.js +14 -0
  314. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.d.ts +1 -0
  315. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getCurrentValueIds/index.js +5 -0
  316. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.d.ts +5 -0
  317. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/getIdFromValue.js +10 -0
  318. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.d.ts +1 -0
  319. package/node/components/TreeLikeList/TreeItem/useLogic/utils/getIdFromValue/index.js +17 -0
  320. package/node/components/TreeLikeList/TreeItem/useLogic/utils/index.d.ts +7 -0
  321. package/node/components/TreeLikeList/TreeItem/useLogic/utils/index.js +15 -1
  322. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.d.ts +1 -0
  323. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/index.js +5 -0
  324. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.d.ts +5 -0
  325. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItem/removeItem.js +14 -0
  326. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.d.ts +1 -0
  327. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/index.js +5 -0
  328. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.d.ts +5 -0
  329. package/node/components/TreeLikeList/TreeItem/useLogic/utils/removeItemsByIds/removeItemsByIds.js +15 -0
  330. package/node/components/TreeLikeList/TreeLikeList.d.ts +2 -3
  331. package/node/components/TreeLikeList/TreeLikeList.js +1 -1
  332. package/node/components/TreeLikeList/index.d.ts +1 -0
  333. package/node/components/TreeLikeList/types.d.ts +8 -4
  334. package/node/components/TreeLikeList/useLogic/useLogic.d.ts +3 -3
  335. package/node/components/TreeLikeList/useLogic/useLogic.js +3 -2
  336. package/node/components/TreeLikeList/useLogic/utils/getChainsId/getChainsId.js +17 -10
  337. package/node/components/index.d.ts +1 -0
  338. package/node/components/index.js +4 -2
  339. package/node/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.d.ts +13 -0
  340. package/node/hook-form/FormTreeLikeAsyncAutocomplete/FormTreeLikeAsyncAutocomplete.js +17 -0
  341. package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +0 -0
  342. package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.js +1 -0
  343. package/package.json +15 -1
@@ -1,15 +1,15 @@
1
1
  import { type FunctionComponent } from 'react';
2
2
  import type { TreeListData } from '../types';
3
- export type MultipleValue = string[] | undefined;
3
+ export type MultipleValue = TreeListData[] | string[] | undefined;
4
4
  export type DisabledItemValue = string | {
5
5
  id: string;
6
6
  disabledReason?: string;
7
7
  };
8
- export type MultipleTreeListProps = {
8
+ export type MultipleTreeListProps<TValue extends MultipleValue = string[]> = {
9
9
  /**
10
10
  * Выбранные значения
11
11
  */
12
- value?: MultipleValue;
12
+ value?: TValue;
13
13
  /**
14
14
  * Данные, которые необходимо отобразить в виде дерева.
15
15
  */
@@ -39,5 +39,9 @@ export type MultipleTreeListProps = {
39
39
  /**
40
40
  * Функция, которая запускается при изменении состояния.
41
41
  */
42
- onChange: (value: MultipleValue) => void;
42
+ onChange: (value: TValue) => void;
43
+ /**
44
+ * Переключает компонент в режим работы с объектами а не с id элементов
45
+ */
46
+ isObjectMode?: boolean;
43
47
  };
@@ -1,5 +1,8 @@
1
1
  import type { TreeListData } from '../Tree';
2
2
  import type { TreeAutocompleteProps } from '../TreeAutocomplete';
3
+ /**
4
+ * Значение элемента дерева для TreeAsyncAutocomplete
5
+ */
3
6
  export type TreeAsyncAutocompleteValue = Omit<TreeListData, 'label' | 'note' | 'children'> & {
4
7
  /**
5
8
  * Заголовок элемента дерева
@@ -14,12 +17,21 @@ export type TreeAsyncAutocompleteValue = Omit<TreeListData, 'label' | 'note' | '
14
17
  */
15
18
  children?: TreeAsyncAutocompleteValue[];
16
19
  };
20
+ /**
21
+ * Результат функции загрузки опций
22
+ */
17
23
  export type FetchOptionsResult = {
18
24
  /**
19
25
  * Элементы дерева
20
26
  */
21
27
  options: TreeAsyncAutocompleteValue[];
28
+ /**
29
+ * Метаданные результата загрузки
30
+ */
22
31
  meta?: {
32
+ /**
33
+ * Флаг, указывающий, что все данные загружены
34
+ */
23
35
  isAllDataLoaded: boolean;
24
36
  };
25
37
  };
@@ -47,13 +59,13 @@ export type TreeAsyncAutocompleteProps = Omit<TreeAutocompleteProps, 'options' |
47
59
  * @example
48
60
  ```typescript
49
61
  * const fetchOptions = async (search: string, signal?: AbortSignal) => {
50
- * const response = await fetch(`/api/nodes/search?query=${search}`, {
62
+ * const response = await fetch(`/api/options/search?query=${search}`, {
51
63
  * signal
52
64
  * });
53
65
  * const data = await response.json();
54
66
  *
55
67
  * return {
56
- * nodes: data.items,
68
+ * options: data.items,
57
69
  * meta: {
58
70
  * isAllDataLoaded: data.isAllDataLoaded,
59
71
  * }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { InputProps } from './types';
3
+ export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { CrossOutlineMd, DownOutlineMd } from '../../../icons';
4
+ import { IconButton } from '../../IconButton';
5
+ import { Loader } from '../../Loader';
6
+ import { CLEAR_TEXT } from './constants';
7
+ import { IconWrapper, StyledTagsList, StyledTextField } from './styles';
8
+ import { useLogic } from './useLogic';
9
+ const ClearButton = ({ disabled, onClick }) => (_jsx(IconButton, { variant: "text", color: "grey", disabled: disabled, onClick: onClick, title: CLEAR_TEXT, "aria-label": CLEAR_TEXT, children: _jsx(CrossOutlineMd, {}) }));
10
+ export const Input = forwardRef(({ disabled, onChange: propsOnChange, value, inputRef, hideHelperText = false, onClick, isLoading, ...restProps }, forwardedRef) => {
11
+ const { isVisibleClearButton, onChange, isVisibleTagsList, textFieldProps, onClearAll, } = useLogic({
12
+ inputRef,
13
+ value,
14
+ onChange: propsOnChange,
15
+ disabled,
16
+ onClick,
17
+ isLoading,
18
+ });
19
+ return (_jsx(StyledTextField, { ...restProps, hideHelperText: hideHelperText, ref: forwardedRef, disabled: disabled, inputProps: { readOnly: true }, ...textFieldProps, startAdornment: isVisibleTagsList && (_jsx(StyledTagsList, { data: value, keyId: "id", isDisabled: disabled, getOptionLabel: (option) => option.label, onClick: onClick, onChange: onChange })), endAdornment: _jsxs(IconWrapper, { children: [isVisibleClearButton && (_jsx(ClearButton, { disabled: disabled, onClick: onClearAll })), isLoading ? (_jsx(Loader, { size: "small" })) : (_jsx(IconButton, { variant: "text", color: "grey", disabled: disabled, children: _jsx(DownOutlineMd, {}) }))] }) }));
20
+ });
@@ -0,0 +1 @@
1
+ export declare const CLEAR_TEXT = "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C";
@@ -0,0 +1 @@
1
+ export const CLEAR_TEXT = 'Очистить';
@@ -0,0 +1 @@
1
+ export * from './Input';
@@ -0,0 +1 @@
1
+ export * from './Input';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledTextField: import("@emotion/styled").StyledComponent<Omit<import("../../TextField").TextFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ } & {
5
+ $isHidden: boolean;
6
+ }, {}, {}>;
7
+ export declare const StyledTagsList: <TData extends import("../../TagsList").TagValue>(props: import("../../TagsList").TagsListProps<TData>) => JSX.Element;
8
+ export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,27 @@
1
+ import { formControlClasses, inputBaseClasses } from '@mui/material';
2
+ import { loaderClassnames } from '../../Loader';
3
+ import { svgIconClassnames } from '../../SvgIcon';
4
+ import { styled } from '../../styles';
5
+ import { TagsList } from '../../TagsList';
6
+ import { TextField } from '../../TextField';
7
+ export const StyledTextField = styled(TextField, {
8
+ shouldForwardProp: (prop) => !['$isHidden'].includes(prop),
9
+ }) `
10
+ .${inputBaseClasses.input} {
11
+ width: ${({ $isHidden }) => $isHidden && 0};
12
+ }
13
+
14
+ &.${formControlClasses.root} .${inputBaseClasses.adornedEnd} .${loaderClassnames.root} .${svgIconClassnames.root} {
15
+ width: 100%;
16
+ height: 100%;
17
+ }
18
+ `;
19
+ export const StyledTagsList = styled(TagsList) `
20
+ overflow: hidden;
21
+
22
+ width: 100%;
23
+ `;
24
+ export const IconWrapper = styled.div `
25
+ display: flex;
26
+ gap: ${({ theme }) => theme.spacing(1)};
27
+ `;
@@ -0,0 +1,7 @@
1
+ import type { TextFieldProps } from '../../TextField';
2
+ import type { TreeLikeAsyncAutocompleteValue } from '../types';
3
+ export type InputProps = Omit<TextFieldProps, 'onChange' | 'value'> & {
4
+ onChange?: (value?: TreeLikeAsyncAutocompleteValue) => void;
5
+ value?: TreeLikeAsyncAutocompleteValue;
6
+ isLoading?: boolean;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,18 @@
1
+ import { type MouseEvent, type SyntheticEvent } from 'react';
2
+ import { type TreeLikeAsyncAutocompleteValue } from '../../types';
3
+ import type { InputProps } from '../types';
4
+ type UseLogicParams = Pick<InputProps, 'value' | 'disabled' | 'inputRef' | 'onChange' | 'isLoading' | 'onClick'>;
5
+ export declare const useLogic: ({ value, disabled, isLoading, inputRef: externalInputRef, onChange: propsOnChange, onClick: propsOnClick, }: UseLogicParams) => {
6
+ isVisibleClearButton: boolean;
7
+ onClearAll: (event: SyntheticEvent<HTMLButtonElement>) => void;
8
+ onChange: (newValue: TreeLikeAsyncAutocompleteValue | undefined) => void;
9
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
10
+ isVisibleTagsList: boolean;
11
+ textFieldProps: {
12
+ value: string;
13
+ $isHidden: boolean;
14
+ inputRef: import("react").RefObject<HTMLInputElement>;
15
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
16
+ };
17
+ };
18
+ export {};
@@ -0,0 +1,50 @@
1
+ import { useEffect, useRef, } from 'react';
2
+ import { useForwardedRef } from '../../../hooks';
3
+ export const useLogic = ({ value, disabled, isLoading, inputRef: externalInputRef, onChange: propsOnChange, onClick: propsOnClick, }) => {
4
+ const inputRef = useForwardedRef(externalInputRef);
5
+ const prevValue = useRef(undefined);
6
+ useEffect(() => {
7
+ if (value && !prevValue.current) {
8
+ prevValue.current = value;
9
+ }
10
+ if (!value && prevValue.current) {
11
+ inputRef.current?.focus();
12
+ prevValue.current = undefined;
13
+ }
14
+ }, [value]);
15
+ const prepareValue = () => {
16
+ if (!value || (Array.isArray(value) && !value.length)) {
17
+ return '';
18
+ }
19
+ return value.map((item) => item.label).join(', ');
20
+ };
21
+ const preparedValue = prepareValue();
22
+ const hasValue = Boolean(preparedValue);
23
+ const onChange = (newValue) => {
24
+ propsOnChange?.(newValue);
25
+ };
26
+ const onClearAll = (event) => {
27
+ event.stopPropagation();
28
+ onChange?.([]);
29
+ inputRef.current?.focus();
30
+ };
31
+ const onClick = (event) => {
32
+ if (!isLoading) {
33
+ propsOnClick?.(event);
34
+ }
35
+ };
36
+ const isVisibleClearButton = !disabled && !isLoading && Boolean(value?.length);
37
+ return {
38
+ isVisibleClearButton,
39
+ onClearAll,
40
+ onChange,
41
+ onClick,
42
+ isVisibleTagsList: hasValue,
43
+ textFieldProps: {
44
+ value: preparedValue,
45
+ $isHidden: hasValue,
46
+ inputRef,
47
+ onClick,
48
+ },
49
+ };
50
+ };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ /**
4
+ * Текст ошибки при загрузке данных
5
+ */
6
+ loadingErrorMsg?: string;
7
+ /**
8
+ * Функция обработки нажатия на кнопку "Повторить запрос"
9
+ */
10
+ onRetry?: () => void;
11
+ };
12
+ export declare const ErrorMessage: ({ loadingErrorMsg, onRetry, }: Props) => JSX.Element;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '../../../Button';
3
+ import { Typography } from '../../../Typography';
4
+ import { Wrapper } from './styles';
5
+ const DEFAULT_ERROR_MSG = 'Не удалось загрузить данные';
6
+ export const ErrorMessage = ({ loadingErrorMsg = DEFAULT_ERROR_MSG, onRetry, }) => (_jsxs(Wrapper, { children: [_jsx(Typography, { color: "textSecondary", children: loadingErrorMsg }), onRetry && _jsx(Button, { onClick: onRetry, children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" })] }));
@@ -0,0 +1 @@
1
+ export * from './ErrorMessage';
@@ -0,0 +1 @@
1
+ export * from './ErrorMessage';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,10 @@
1
+ import { styled } from '../../../styles';
2
+ export const Wrapper = styled.div `
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: ${({ theme }) => theme.spacing(3)};
6
+ align-items: center;
7
+ justify-content: center;
8
+
9
+ height: 100%;
10
+ `;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Loader: () => JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Loader as AstralUILoader } from '../../../Loader';
3
+ import { Wrapper } from './styles';
4
+ export const Loader = () => (_jsx(Wrapper, { children: _jsx(AstralUILoader, {}) }));
@@ -0,0 +1 @@
1
+ export * from './Loader';
@@ -0,0 +1 @@
1
+ export * from './Loader';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,8 @@
1
+ import { styled } from '../../../styles';
2
+ export const Wrapper = styled.div `
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+
7
+ height: 100%;
8
+ `;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const NoData: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Typography } from '../../../Typography';
3
+ import { Wrapper } from './styles';
4
+ export const NoData = () => {
5
+ return (_jsx(Wrapper, { children: _jsx(Typography, { color: "textSecondary", children: "\u041F\u043E \u0432\u0432\u0435\u0434\u0435\u043D\u043D\u043E\u043C\u0443 \u0437\u0430\u043F\u0440\u043E\u0441\u0443 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E" }) }));
6
+ };
@@ -0,0 +1 @@
1
+ export * from './NoData';
@@ -0,0 +1 @@
1
+ export * from './NoData';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,8 @@
1
+ import { styled } from '../../../styles';
2
+ export const Wrapper = styled.div `
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+
7
+ height: 100%;
8
+ `;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { OptionsModalProps } from './types';
3
+ export declare const OptionsModal: (props: OptionsModalProps) => JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '../../Button';
3
+ import { Dialog } from '../../Dialog';
4
+ import { DialogActions } from '../../DialogActions';
5
+ import { Paper } from '../../Paper';
6
+ import { TreeLikeList } from '../../TreeLikeList';
7
+ import { Typography } from '../../Typography';
8
+ import { SEARCH_FIELD_HELPER_TEXT } from './constants';
9
+ import { ErrorMessage } from './ErrorMessage';
10
+ import { Loader } from './Loader';
11
+ import { NoData } from './NoData';
12
+ import { SearchSuggestion } from './SearchSuggestion';
13
+ import { StyledDialogContent, StyledSearchField, TreeListWrapper, UserHintWrapper, } from './styles';
14
+ import { useLogic } from './useLogic';
15
+ export const OptionsModal = (props) => {
16
+ const { isNoResult, searchFieldProps, modalProps, treeListProps, cancelButtonProps, confirmButtonProps, handleRetry, isShowUserHint, isShowModalLoader, isShowSearchFieldLoader, isShowSearchSuggestion, isLoadingError, treeProps, loadingErrorMsg, } = useLogic(props);
17
+ const renderComponent = () => {
18
+ if (isShowSearchSuggestion) {
19
+ return _jsx(SearchSuggestion, {});
20
+ }
21
+ if (isShowModalLoader) {
22
+ return _jsx(Loader, {});
23
+ }
24
+ if (isLoadingError) {
25
+ return (_jsx(ErrorMessage, { loadingErrorMsg: loadingErrorMsg, onRetry: handleRetry }));
26
+ }
27
+ if (isNoResult) {
28
+ return _jsx(NoData, {});
29
+ }
30
+ return (_jsx(TreeLikeList, { ...treeProps, ...treeListProps }));
31
+ };
32
+ return (_jsxs(Dialog, { ...modalProps, children: [_jsxs(StyledDialogContent, { "$size": modalProps.size, children: [_jsx(StyledSearchField, { fullWidth: true, ...searchFieldProps, isLoading: isShowSearchFieldLoader, helperText: SEARCH_FIELD_HELPER_TEXT }), _jsx(Paper, { variant: "outlined", children: _jsxs(TreeListWrapper, { children: [renderComponent(), isShowUserHint && (_jsx(UserHintWrapper, { children: _jsx(Typography, { variant: "caption", color: "grey", colorIntensity: "600", children: "\u0423\u0442\u043E\u0447\u043D\u0438\u0442\u0435 \u0437\u0430\u043F\u0440\u043E\u0441 \u0434\u043B\u044F \u0431\u043E\u043B\u0435\u0435 \u043B\u0443\u0447\u0448\u0435\u0433\u043E \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430 \u043F\u043E\u0438\u0441\u043A\u0430" }) }))] }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
33
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SearchSuggestion: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Typography } from '../../../Typography';
3
+ import { Wrapper } from './styles';
4
+ export const SearchSuggestion = () => {
5
+ return (_jsx(Wrapper, { children: _jsx(Typography, { color: "textSecondary", children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u0439\u0442\u0435 \u0432\u0432\u043E\u0434\u0438\u0442\u044C \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430" }) }));
6
+ };
@@ -0,0 +1 @@
1
+ export * from './SearchSuggestion';
@@ -0,0 +1 @@
1
+ export * from './SearchSuggestion';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,8 @@
1
+ import { styled } from '../../../styles';
2
+ export const Wrapper = styled.div `
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+
7
+ height: 100%;
8
+ `;
@@ -0,0 +1 @@
1
+ export declare const SEARCH_FIELD_HELPER_TEXT = "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u043E\u0447\u043D\u044B\u0439 \u0437\u0430\u043F\u0440\u043E\u0441 \u0434\u043B\u044F \u043B\u0443\u0447\u0448\u0435\u0433\u043E \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430 \u043F\u043E\u0438\u0441\u043A\u0430";
@@ -0,0 +1 @@
1
+ export const SEARCH_FIELD_HELPER_TEXT = 'Введите точный запрос для лучшего результата поиска';
@@ -0,0 +1 @@
1
+ export * from './OptionsModal';
@@ -0,0 +1 @@
1
+ export * from './OptionsModal';
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export declare const StyledDialogContent: import("@emotion/styled").StyledComponent<import("../../DialogContent").DialogContentProps & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ } & {
6
+ $size: Size;
7
+ }, {}, {}>;
8
+ export declare const TreeListWrapper: import("@emotion/styled").StyledComponent<{
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ export declare const StyledSearchField: import("@emotion/styled").StyledComponent<Omit<import("../../SearchField").SearchFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
13
+ theme?: import("@emotion/react").Theme | undefined;
14
+ }, {}, {}>;
15
+ export declare const UserHintWrapper: import("@emotion/styled").StyledComponent<{
16
+ theme?: import("@emotion/react").Theme | undefined;
17
+ as?: import("react").ElementType<any> | undefined;
18
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
19
+ export {};
@@ -0,0 +1,48 @@
1
+ import { formHelperTextClasses } from '@mui/material';
2
+ import { DIALOG_SIZES } from '../../Dialog';
3
+ import { DialogContent } from '../../DialogContent';
4
+ import { SearchField } from '../../SearchField';
5
+ import { styled } from '../../styles';
6
+ import { treeListClassnames } from '../../Tree';
7
+ export const StyledDialogContent = styled(DialogContent, {
8
+ shouldForwardProp: (prop) => !['$size'].includes(prop),
9
+ }) `
10
+ display: grid;
11
+ grid-template-columns: 100%;
12
+ grid-template-rows: max-content 1fr;
13
+ gap: ${({ theme }) => theme.spacing(4)};
14
+
15
+ width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
16
+ height: ${({ $size }) => ($size === 'md' ? '500px' : `calc(${DIALOG_SIZES[$size].minWidth} - 50px)`)};
17
+ padding-bottom: ${({ theme }) => theme.spacing(4)};
18
+
19
+ ${({ theme }) => theme.breakpoints.down('sm')} {
20
+ width: auto;
21
+ }
22
+ `;
23
+ export const TreeListWrapper = styled.div `
24
+ overflow: auto;
25
+
26
+ height: 100%;
27
+
28
+ & .${treeListClassnames.list} {
29
+ width: auto;
30
+ min-width: max-content;
31
+ }
32
+ `;
33
+ export const StyledSearchField = styled(SearchField) `
34
+ & .${formHelperTextClasses.root} {
35
+ display: flex;
36
+
37
+ margin-top: ${({ theme }) => theme.spacing(2)};
38
+
39
+ color: ${({ theme }) => theme.palette.grey[500]};
40
+ }
41
+ `;
42
+ export const UserHintWrapper = styled.div `
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+
47
+ height: 36px;
48
+ `;
@@ -0,0 +1,69 @@
1
+ import type { DialogProps } from '../../Dialog';
2
+ import type { TreeListProps } from '../../Tree';
3
+ import type { TreeLikeAsyncAutocompleteValue } from '../types';
4
+ export type OptionsModalProps = {
5
+ /**
6
+ * Если true, модальное окно будет открыто
7
+ */
8
+ isOpen: boolean;
9
+ /**
10
+ * Флаг, определяющий отображение состояния загрузки в модальном окне.
11
+ */
12
+ isLoadingModal: boolean;
13
+ /**
14
+ * Функция определения необходимости показа подсказки пользователю
15
+ */
16
+ onShowUserHint?: (options: TreeLikeAsyncAutocompleteValue) => boolean;
17
+ /**
18
+ * Опции, которые необходимо отобразить в виде дерева.
19
+ */
20
+ options: TreeLikeAsyncAutocompleteValue;
21
+ /**
22
+ * Выбранное значения
23
+ */
24
+ initialValue?: TreeLikeAsyncAutocompleteValue;
25
+ /**
26
+ * Флаг загрузки options
27
+ * Если true, вместо дерева options будет отображен лоадер
28
+ */
29
+ isLoading?: boolean;
30
+ /**
31
+ * Флаг ошибки загрузки options
32
+ * Если true, вместо дерева options будет отображен плейсхолдер с ошибкой
33
+ */
34
+ isLoadingError?: boolean;
35
+ /**
36
+ * Текст ошибки при загрузке данных
37
+ */
38
+ loadingErrorMsg?: string;
39
+ /**
40
+ * Предназначен для конфигурации древовидного списка
41
+ */
42
+ treeProps?: Pick<TreeListProps, 'disabledItems' | 'renderItem'>;
43
+ /**
44
+ * Параметры предназначены для конфигурации модального окна
45
+ */
46
+ dialogProps: Omit<DialogProps, 'open' | 'onChange' | 'disableRestoreFocus'>;
47
+ /**
48
+ * Функция обработки нажатия на кнопку "Повторить запрос"
49
+ */
50
+ onRetry?: (search?: string) => void;
51
+ /**
52
+ * Функция, которая запускается при выборе item
53
+ */
54
+ onChange?: (newValue?: TreeLikeAsyncAutocompleteValue) => void;
55
+ /**
56
+ * Функция обработки изменения поля ввода
57
+ */
58
+ onInputChange: (value: string) => void;
59
+ /**
60
+ * Метаданные опций
61
+ */
62
+ meta?: {
63
+ isAllDataLoaded?: boolean;
64
+ };
65
+ /**
66
+ * Минимальное количество символов для выполнения запроса
67
+ */
68
+ minSymbolsToFetch?: number;
69
+ };
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';