@gisce/react-ooui 2.0.0-alpha.6 → 2.0.0-alpha.61

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 (424) hide show
  1. package/dist/ConnectionProvider.d.ts +7 -0
  2. package/dist/ConnectionProvider.d.ts.map +1 -0
  3. package/dist/actionbar/ActionButton.d.ts +12 -0
  4. package/dist/actionbar/ActionButton.d.ts.map +1 -0
  5. package/dist/actionbar/AttachmentsButton.d.ts +11 -0
  6. package/dist/actionbar/AttachmentsButton.d.ts.map +1 -0
  7. package/dist/actionbar/AttachmentsButtonWrapper.d.ts +18 -0
  8. package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -0
  9. package/dist/actionbar/ButtonWithBadge.d.ts +7 -0
  10. package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -0
  11. package/dist/actionbar/ChangeViewButton.d.ts +12 -0
  12. package/dist/actionbar/ChangeViewButton.d.ts.map +1 -0
  13. package/dist/actionbar/DashboardActionBar.d.ts +3 -0
  14. package/dist/actionbar/DashboardActionBar.d.ts.map +1 -0
  15. package/dist/actionbar/DropdownButton.d.ts +13 -0
  16. package/dist/actionbar/DropdownButton.d.ts.map +1 -0
  17. package/dist/actionbar/FormActionBar.d.ts +5 -0
  18. package/dist/actionbar/FormActionBar.d.ts.map +1 -0
  19. package/dist/actionbar/GraphActionBar.d.ts +5 -0
  20. package/dist/actionbar/GraphActionBar.d.ts.map +1 -0
  21. package/dist/actionbar/NewButton.d.ts +6 -0
  22. package/dist/actionbar/NewButton.d.ts.map +1 -0
  23. package/dist/actionbar/SearchBar.d.ts +8 -0
  24. package/dist/actionbar/SearchBar.d.ts.map +1 -0
  25. package/dist/actionbar/TreeActionBar.d.ts +8 -0
  26. package/dist/actionbar/TreeActionBar.d.ts.map +1 -0
  27. package/dist/common/ButtonWithTooltip.d.ts +7 -0
  28. package/dist/common/ButtonWithTooltip.d.ts.map +1 -0
  29. package/dist/common/DatePicker.d.ts +19 -0
  30. package/dist/common/DatePicker.d.ts.map +1 -0
  31. package/dist/common/Field.d.ts +14 -0
  32. package/dist/common/Field.d.ts.map +1 -0
  33. package/dist/common/SelectAllRecordsRow.d.ts +9 -0
  34. package/dist/common/SelectAllRecordsRow.d.ts.map +1 -0
  35. package/dist/common/TimePicker.d.ts +10 -0
  36. package/dist/common/TimePicker.d.ts.map +1 -0
  37. package/dist/context/ActionViewContext.d.ts +65 -0
  38. package/dist/context/ActionViewContext.d.ts.map +1 -0
  39. package/dist/context/ConfigContext.d.ts +15 -0
  40. package/dist/context/ConfigContext.d.ts.map +1 -0
  41. package/dist/context/ContentRootContext.d.ts +19 -0
  42. package/dist/context/ContentRootContext.d.ts.map +1 -0
  43. package/dist/context/DashboardActionContext.d.ts +19 -0
  44. package/dist/context/DashboardActionContext.d.ts.map +1 -0
  45. package/dist/context/FormContext.d.ts +35 -0
  46. package/dist/context/FormContext.d.ts.map +1 -0
  47. package/dist/context/FormModalContext.d.ts +11 -0
  48. package/dist/context/FormModalContext.d.ts.map +1 -0
  49. package/dist/context/LocaleContext.d.ts +14 -0
  50. package/dist/context/LocaleContext.d.ts.map +1 -0
  51. package/dist/context/One2manyContext.d.ts +17 -0
  52. package/dist/context/One2manyContext.d.ts.map +1 -0
  53. package/dist/context/TabManagerContext.d.ts +50 -0
  54. package/dist/context/TabManagerContext.d.ts.map +1 -0
  55. package/dist/helpers/containerHelper.d.ts +22 -0
  56. package/dist/helpers/containerHelper.d.ts.map +1 -0
  57. package/dist/helpers/dayjs.d.ts +3 -0
  58. package/dist/helpers/dayjs.d.ts.map +1 -0
  59. package/dist/helpers/dynamicColumnsHelper.d.ts +16 -0
  60. package/dist/helpers/dynamicColumnsHelper.d.ts.map +1 -0
  61. package/dist/helpers/errorHelper.d.ts +6 -0
  62. package/dist/helpers/errorHelper.d.ts.map +1 -0
  63. package/dist/helpers/filesHelper.d.ts +8 -0
  64. package/dist/helpers/filesHelper.d.ts.map +1 -0
  65. package/dist/helpers/formHelper.d.ts +36 -0
  66. package/dist/helpers/formHelper.d.ts.map +1 -0
  67. package/dist/helpers/iconMapper.d.ts +13 -0
  68. package/dist/helpers/iconMapper.d.ts.map +1 -0
  69. package/dist/helpers/logInfoHelper.d.ts +3 -0
  70. package/dist/helpers/logInfoHelper.d.ts.map +1 -0
  71. package/dist/helpers/one2manyHelper.d.ts +37 -0
  72. package/dist/helpers/one2manyHelper.d.ts.map +1 -0
  73. package/dist/helpers/searchHelper.d.ts +6 -0
  74. package/dist/helpers/searchHelper.d.ts.map +1 -0
  75. package/dist/helpers/timeHelper.d.ts +4 -0
  76. package/dist/helpers/timeHelper.d.ts.map +1 -0
  77. package/dist/helpers/treeHelper.d.ts +23 -0
  78. package/dist/helpers/treeHelper.d.ts.map +1 -0
  79. package/dist/helpers/viewHelper.d.ts +10 -0
  80. package/dist/helpers/viewHelper.d.ts.map +1 -0
  81. package/dist/hooks/useEffectDebugger.d.ts +3 -0
  82. package/dist/hooks/useEffectDebugger.d.ts.map +1 -0
  83. package/dist/hooks/useExport.d.ts +44 -0
  84. package/dist/hooks/useExport.d.ts.map +1 -0
  85. package/dist/hooks/useFetchViews.d.ts +1 -0
  86. package/dist/hooks/useFetchViews.d.ts.map +1 -0
  87. package/dist/hooks/useSearch.d.ts +56 -0
  88. package/dist/hooks/useSearch.d.ts.map +1 -0
  89. package/dist/hooks/useWindowDimensions.d.ts +7 -0
  90. package/dist/hooks/useWindowDimensions.d.ts.map +1 -0
  91. package/dist/index.d.ts +59 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/locales/ca_ES.d.ts +94 -0
  94. package/dist/locales/ca_ES.d.ts.map +1 -0
  95. package/dist/locales/en_US.d.ts +94 -0
  96. package/dist/locales/en_US.d.ts.map +1 -0
  97. package/dist/locales/es_ES.d.ts +94 -0
  98. package/dist/locales/es_ES.d.ts.map +1 -0
  99. package/dist/react-ooui.es.js +10077 -0
  100. package/dist/react-ooui.es.js.map +1 -0
  101. package/dist/style.css +1 -0
  102. package/dist/types/index.d.ts +258 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/ui/ActionErrorDialog.d.ts +3 -0
  105. package/dist/ui/ActionErrorDialog.d.ts.map +1 -0
  106. package/dist/ui/ConfirmDialog.d.ts +7 -0
  107. package/dist/ui/ConfirmDialog.d.ts.map +1 -0
  108. package/dist/ui/ErrorAlert.d.ts +5 -0
  109. package/dist/ui/ErrorAlert.d.ts.map +1 -0
  110. package/dist/ui/FavouriteButton.d.ts +25 -0
  111. package/dist/ui/FavouriteButton.d.ts.map +1 -0
  112. package/dist/ui/FormErrorsDialog.d.ts +3 -0
  113. package/dist/ui/FormErrorsDialog.d.ts.map +1 -0
  114. package/dist/ui/GenericErrorDialog.d.ts +3 -0
  115. package/dist/ui/GenericErrorDialog.d.ts.map +1 -0
  116. package/dist/ui/GoToResourceModal.d.ts +9 -0
  117. package/dist/ui/GoToResourceModal.d.ts.map +1 -0
  118. package/dist/ui/InfoDialog.d.ts +3 -0
  119. package/dist/ui/InfoDialog.d.ts.map +1 -0
  120. package/dist/ui/RefreshItemDialog.d.ts +7 -0
  121. package/dist/ui/RefreshItemDialog.d.ts.map +1 -0
  122. package/dist/ui/RemoveItemDialog.d.ts +6 -0
  123. package/dist/ui/RemoveItemDialog.d.ts.map +1 -0
  124. package/dist/ui/TitleHeader.d.ts +7 -0
  125. package/dist/ui/TitleHeader.d.ts.map +1 -0
  126. package/dist/ui/UnlinkItemDialog.d.ts +6 -0
  127. package/dist/ui/UnlinkItemDialog.d.ts.map +1 -0
  128. package/dist/ui/UnsavedChangesDialog.d.ts +7 -0
  129. package/dist/ui/UnsavedChangesDialog.d.ts.map +1 -0
  130. package/dist/ui/WarningDialog.d.ts +3 -0
  131. package/dist/ui/WarningDialog.d.ts.map +1 -0
  132. package/dist/views/ActionView.d.ts +22 -0
  133. package/dist/views/ActionView.d.ts.map +1 -0
  134. package/dist/views/CurrentTabContent.d.ts +3 -0
  135. package/dist/views/CurrentTabContent.d.ts.map +1 -0
  136. package/dist/views/RootView.d.ts +14 -0
  137. package/dist/views/RootView.d.ts.map +1 -0
  138. package/dist/views/TabContent.d.ts +8 -0
  139. package/dist/views/TabContent.d.ts.map +1 -0
  140. package/dist/views/TabSelector.d.ts +3 -0
  141. package/dist/views/TabSelector.d.ts.map +1 -0
  142. package/dist/views/Welcome.d.ts +4 -0
  143. package/dist/views/Welcome.d.ts.map +1 -0
  144. package/dist/views/actionViews/DashboardActionView.d.ts +7 -0
  145. package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -0
  146. package/dist/views/actionViews/FormActionView.d.ts +17 -0
  147. package/dist/views/actionViews/FormActionView.d.ts.map +1 -0
  148. package/dist/views/actionViews/GraphActionView.d.ts +12 -0
  149. package/dist/views/actionViews/GraphActionView.d.ts.map +1 -0
  150. package/dist/views/actionViews/TreeActionView.d.ts +19 -0
  151. package/dist/views/actionViews/TreeActionView.d.ts.map +1 -0
  152. package/dist/views/tabs/Tab.d.ts +10 -0
  153. package/dist/views/tabs/Tab.d.ts.map +1 -0
  154. package/dist/widgets/WidgetFactory.d.ts +4 -0
  155. package/dist/widgets/WidgetFactory.d.ts.map +1 -0
  156. package/dist/widgets/base/Binary.d.ts +13 -0
  157. package/dist/widgets/base/Binary.d.ts.map +1 -0
  158. package/dist/widgets/base/Boolean.d.ts +3 -0
  159. package/dist/widgets/base/Boolean.d.ts.map +1 -0
  160. package/dist/widgets/base/Button.d.ts +7 -0
  161. package/dist/widgets/base/Button.d.ts.map +1 -0
  162. package/dist/widgets/base/Char.d.ts +7 -0
  163. package/dist/widgets/base/Char.d.ts.map +1 -0
  164. package/dist/widgets/base/Date.d.ts +4 -0
  165. package/dist/widgets/base/Date.d.ts.map +1 -0
  166. package/dist/widgets/base/DateTime.d.ts +4 -0
  167. package/dist/widgets/base/DateTime.d.ts.map +1 -0
  168. package/dist/widgets/base/Email.d.ts +3 -0
  169. package/dist/widgets/base/Email.d.ts.map +1 -0
  170. package/dist/widgets/base/Float.d.ts +3 -0
  171. package/dist/widgets/base/Float.d.ts.map +1 -0
  172. package/dist/widgets/base/FloatTime.d.ts +12 -0
  173. package/dist/widgets/base/FloatTime.d.ts.map +1 -0
  174. package/dist/widgets/base/Image.d.ts +13 -0
  175. package/dist/widgets/base/Image.d.ts.map +1 -0
  176. package/dist/widgets/base/Integer.d.ts +7 -0
  177. package/dist/widgets/base/Integer.d.ts.map +1 -0
  178. package/dist/widgets/base/Label.d.ts +8 -0
  179. package/dist/widgets/base/Label.d.ts.map +1 -0
  180. package/dist/widgets/base/LinkInput.d.ts +11 -0
  181. package/dist/widgets/base/LinkInput.d.ts.map +1 -0
  182. package/dist/widgets/base/MultiSelection.d.ts +9 -0
  183. package/dist/widgets/base/MultiSelection.d.ts.map +1 -0
  184. package/dist/widgets/base/ProgressBar.d.ts +6 -0
  185. package/dist/widgets/base/ProgressBar.d.ts.map +1 -0
  186. package/dist/widgets/base/Reference.d.ts +16 -0
  187. package/dist/widgets/base/Reference.d.ts.map +1 -0
  188. package/dist/widgets/base/ReferenceTree.d.ts +8 -0
  189. package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
  190. package/dist/widgets/base/Selection.d.ts +9 -0
  191. package/dist/widgets/base/Selection.d.ts.map +1 -0
  192. package/dist/widgets/base/Separator.d.ts +7 -0
  193. package/dist/widgets/base/Separator.d.ts.map +1 -0
  194. package/dist/widgets/base/Text.d.ts +7 -0
  195. package/dist/widgets/base/Text.d.ts.map +1 -0
  196. package/dist/widgets/base/Time.d.ts +11 -0
  197. package/dist/widgets/base/Time.d.ts.map +1 -0
  198. package/dist/widgets/base/Url.d.ts +3 -0
  199. package/dist/widgets/base/Url.d.ts.map +1 -0
  200. package/dist/widgets/base/many2one/Many2one.d.ts +16 -0
  201. package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -0
  202. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +8 -0
  203. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -0
  204. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +9 -0
  205. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -0
  206. package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
  207. package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
  208. package/dist/widgets/base/one2many/One2many.d.ts +7 -0
  209. package/dist/widgets/base/one2many/One2many.d.ts.map +1 -0
  210. package/dist/widgets/base/one2many/One2manyInput.d.ts +23 -0
  211. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -0
  212. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +22 -0
  213. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -0
  214. package/dist/widgets/containers/Container.d.ts +9 -0
  215. package/dist/widgets/containers/Container.d.ts.map +1 -0
  216. package/dist/widgets/containers/Group.d.ts +10 -0
  217. package/dist/widgets/containers/Group.d.ts.map +1 -0
  218. package/dist/widgets/containers/Notebook.d.ts +9 -0
  219. package/dist/widgets/containers/Notebook.d.ts.map +1 -0
  220. package/dist/widgets/custom/Avatar.d.ts +10 -0
  221. package/dist/widgets/custom/Avatar.d.ts.map +1 -0
  222. package/dist/widgets/custom/ButtonGroup.d.ts +7 -0
  223. package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -0
  224. package/dist/widgets/custom/CodeEditor.d.ts +8 -0
  225. package/dist/widgets/custom/CodeEditor.d.ts.map +1 -0
  226. package/dist/widgets/custom/Comments.d.ts +34 -0
  227. package/dist/widgets/custom/Comments.d.ts.map +1 -0
  228. package/dist/widgets/custom/FiberGrid.d.ts +9 -0
  229. package/dist/widgets/custom/FiberGrid.d.ts.map +1 -0
  230. package/dist/widgets/custom/Indicator.d.ts +9 -0
  231. package/dist/widgets/custom/Indicator.d.ts.map +1 -0
  232. package/dist/widgets/custom/Markdown.d.ts +4 -0
  233. package/dist/widgets/custom/Markdown.d.ts.map +1 -0
  234. package/dist/widgets/custom/MultiCheckbox.d.ts +13 -0
  235. package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -0
  236. package/dist/widgets/custom/Radio.d.ts +9 -0
  237. package/dist/widgets/custom/Radio.d.ts.map +1 -0
  238. package/dist/widgets/custom/Steps.d.ts +12 -0
  239. package/dist/widgets/custom/Steps.d.ts.map +1 -0
  240. package/dist/widgets/custom/Switch.d.ts +3 -0
  241. package/dist/widgets/custom/Switch.d.ts.map +1 -0
  242. package/dist/widgets/custom/Tag.d.ts +6 -0
  243. package/dist/widgets/custom/Tag.d.ts.map +1 -0
  244. package/dist/widgets/custom/Tags.d.ts +14 -0
  245. package/dist/widgets/custom/Tags.d.ts.map +1 -0
  246. package/dist/widgets/custom/Timeline.d.ts +15 -0
  247. package/dist/widgets/custom/Timeline.d.ts.map +1 -0
  248. package/dist/widgets/modals/ExportModal.d.ts +14 -0
  249. package/dist/widgets/modals/ExportModal.d.ts.map +1 -0
  250. package/dist/widgets/modals/FormModal.d.ts +11 -0
  251. package/dist/widgets/modals/FormModal.d.ts.map +1 -0
  252. package/dist/widgets/modals/SearchModal.d.ts +12 -0
  253. package/dist/widgets/modals/SearchModal.d.ts.map +1 -0
  254. package/dist/widgets/modals/TranslationModal.d.ts +11 -0
  255. package/dist/widgets/modals/TranslationModal.d.ts.map +1 -0
  256. package/dist/widgets/views/Dashboard/Dashboard.d.ts +5 -0
  257. package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -0
  258. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +3 -0
  259. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -0
  260. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +18 -0
  261. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -0
  262. package/dist/widgets/views/Dashboard/dashboardHelper.d.ts +6 -0
  263. package/dist/widgets/views/Dashboard/dashboardHelper.d.ts.map +1 -0
  264. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +3 -0
  265. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -0
  266. package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts +6 -0
  267. package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts.map +1 -0
  268. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +3 -0
  269. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -0
  270. package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts +11 -0
  271. package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts.map +1 -0
  272. package/dist/widgets/views/DashboardGrid/index.d.ts +5 -0
  273. package/dist/widgets/views/DashboardGrid/index.d.ts.map +1 -0
  274. package/dist/widgets/views/Form.d.ts +29 -0
  275. package/dist/widgets/views/Form.d.ts.map +1 -0
  276. package/dist/widgets/views/Graph/Graph.d.ts +11 -0
  277. package/dist/widgets/views/Graph/Graph.d.ts.map +1 -0
  278. package/dist/widgets/views/Graph/GraphChart.d.ts +10 -0
  279. package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -0
  280. package/dist/widgets/views/Graph/GraphDefaults.d.ts +83 -0
  281. package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -0
  282. package/dist/widgets/views/Graph/GraphIndicator.d.ts +16 -0
  283. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -0
  284. package/dist/widgets/views/Graph/useGraphData.d.ts +20 -0
  285. package/dist/widgets/views/Graph/useGraphData.d.ts.map +1 -0
  286. package/dist/widgets/views/SearchTree.d.ts +24 -0
  287. package/dist/widgets/views/SearchTree.d.ts.map +1 -0
  288. package/dist/widgets/views/Tree/Tree.d.ts +33 -0
  289. package/dist/widgets/views/Tree/Tree.d.ts.map +1 -0
  290. package/dist/widgets/views/Tree/index.d.ts +2 -0
  291. package/dist/widgets/views/Tree/index.d.ts.map +1 -0
  292. package/dist/widgets/views/Tree/treeComponents.d.ts +131 -0
  293. package/dist/widgets/views/Tree/treeComponents.d.ts.map +1 -0
  294. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +3 -0
  295. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -0
  296. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +3 -0
  297. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -0
  298. package/dist/widgets/views/searchFilter/PairFields.d.ts +4 -0
  299. package/dist/widgets/views/searchFilter/PairFields.d.ts.map +1 -0
  300. package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts +10 -0
  301. package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts.map +1 -0
  302. package/dist/widgets/views/searchFilter/SearchField.d.ts +7 -0
  303. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -0
  304. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +19 -0
  305. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -0
  306. package/dist/widgets/views/searchFilter/SearchParams.d.ts +7 -0
  307. package/dist/widgets/views/searchFilter/SearchParams.d.ts.map +1 -0
  308. package/package.json +43 -18
  309. package/src/ConnectionProvider.ts +1 -1
  310. package/src/__tests__/iconMapper.test.ts +4 -4
  311. package/src/actionbar/AttachmentsButton.tsx +25 -23
  312. package/src/actionbar/AttachmentsButtonWrapper.tsx +2 -2
  313. package/src/actionbar/ButtonWithBadge.tsx +4 -2
  314. package/src/actionbar/ChangeViewButton.tsx +1 -1
  315. package/src/actionbar/DashboardActionBar.tsx +2 -6
  316. package/src/actionbar/DropdownButton.tsx +100 -37
  317. package/src/actionbar/FormActionBar.tsx +22 -16
  318. package/src/actionbar/NewButton.tsx +1 -1
  319. package/src/actionbar/TreeActionBar.tsx +86 -79
  320. package/src/common/DatePicker.tsx +4 -5
  321. package/src/common/Field.tsx +2 -1
  322. package/src/common/TimePicker.tsx +38 -0
  323. package/src/context/ActionViewContext.tsx +8 -4
  324. package/src/context/ConfigContext.tsx +22 -3
  325. package/src/context/DashboardActionContext.tsx +2 -3
  326. package/src/context/FormModalContext.tsx +2 -3
  327. package/src/context/LocaleContext.tsx +1 -1
  328. package/src/context/One2manyContext.tsx +3 -4
  329. package/src/helpers/containerHelper.ts +1 -1
  330. package/src/helpers/dayjs.ts +21 -0
  331. package/src/helpers/dynamicColumnsHelper.ts +2 -2
  332. package/src/helpers/iconMapper.ts +5 -5
  333. package/src/helpers/logInfoHelper.tsx +8 -6
  334. package/src/helpers/timeHelper.ts +2 -2
  335. package/src/helpers/{treeHelper.ts → treeHelper.tsx} +26 -4
  336. package/src/hooks/useEffectDebugger.ts +2 -2
  337. package/src/hooks/useExport.ts +9 -8
  338. package/src/hooks/useWindowDimensions.ts +1 -1
  339. package/src/index.ts +1 -1
  340. package/src/locales/ca_ES.tsx +1 -0
  341. package/src/locales/en_US.tsx +1 -0
  342. package/src/locales/es_ES.tsx +2 -0
  343. package/src/stories/Char.stories.tsx +27 -0
  344. package/src/stories/Time.stories.tsx +2 -3
  345. package/src/stories/Utils.stories.tsx +1 -3
  346. package/src/stories/containers/Group.stories.tsx +2 -3
  347. package/src/stories/containers/Notebook.stories.tsx +0 -6
  348. package/src/stories/custom/Avatar.stories.tsx +2 -6
  349. package/src/stories/custom/Comments.stories.tsx +32 -25
  350. package/src/stories/forms/FormWithLinks.stories.tsx +1 -2
  351. package/src/stories/forms/ModContractForm.stories.tsx +1 -0
  352. package/src/stories/forms/PreferencesForm.stories.tsx +1 -2
  353. package/src/stories/mocks/mockProvider.ts +5 -2
  354. package/src/stories/mocks/models/attachment.ts +1 -2
  355. package/src/stories/mocks/models/butlleti.ts +249 -297
  356. package/src/stories/mocks/models/company.ts +2 -4
  357. package/src/stories/mocks/models/cups.ts +18 -1
  358. package/src/stories/mocks/models/document.ts +2 -4
  359. package/src/stories/mocks/models/factura.ts +14 -28
  360. package/src/stories/mocks/models/form_with_gridfiber.ts +2 -4
  361. package/src/stories/mocks/models/hist_autoconsum.ts +2 -4
  362. package/src/stories/mocks/models/lead.ts +8 -16
  363. package/src/stories/mocks/models/modcontractual.ts +229 -83
  364. package/src/stories/mocks/models/partner.ts +20 -40
  365. package/src/stories/mocks/models/polissa.ts +6 -12
  366. package/src/stories/mocks/models/res_partner_category.ts +3 -3
  367. package/src/stories/mocks/models/signatura.ts +135 -195
  368. package/src/stories/mocks/models/switching.ts +2 -4
  369. package/src/stories/ui/GoToResourceModal.stories.tsx +3 -2
  370. package/src/stories/views/Tree.stories.jsx +3 -5
  371. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +15 -30
  372. package/src/types/index.ts +2 -1
  373. package/src/ui/ConfirmDialog.tsx +1 -1
  374. package/src/ui/GoToResourceModal.tsx +8 -7
  375. package/src/ui/TitleHeader.tsx +8 -1
  376. package/src/views/ActionView.tsx +41 -30
  377. package/src/views/CurrentTabContent.tsx +1 -1
  378. package/src/views/TabContent.tsx +1 -1
  379. package/src/views/TabSelector.tsx +1 -1
  380. package/src/views/actionViews/DashboardActionView.tsx +7 -2
  381. package/src/views/actionViews/GraphActionView.tsx +1 -1
  382. package/src/views/actionViews/TreeActionView.tsx +2 -2
  383. package/src/widgets/WidgetFactory.tsx +1 -1
  384. package/src/widgets/base/Button.tsx +1 -1
  385. package/src/widgets/base/Float.tsx +0 -1
  386. package/src/widgets/base/FloatTime.tsx +1 -1
  387. package/src/widgets/base/Integer.tsx +0 -1
  388. package/src/widgets/base/Reference.tsx +1 -1
  389. package/src/widgets/base/ReferenceTree.tsx +1 -1
  390. package/src/widgets/base/Separator.tsx +3 -4
  391. package/src/widgets/base/Time.tsx +5 -7
  392. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +2 -2
  393. package/src/widgets/base/one2many/One2many.tsx +2 -2
  394. package/src/widgets/base/one2many/One2manyInput.tsx +6 -5
  395. package/src/widgets/custom/Avatar.tsx +15 -7
  396. package/src/widgets/custom/Comments.tsx +4 -7
  397. package/src/widgets/custom/Markdown.tsx +18 -8
  398. package/src/widgets/custom/MultiCheckbox.tsx +1 -1
  399. package/src/widgets/custom/Radio.tsx +2 -4
  400. package/src/widgets/custom/Steps.tsx +10 -9
  401. package/src/widgets/custom/Switch.tsx +1 -5
  402. package/src/widgets/custom/Tags.tsx +1 -1
  403. package/src/widgets/modals/FormModal.tsx +5 -2
  404. package/src/widgets/modals/SearchModal.tsx +33 -33
  405. package/src/widgets/modals/TranslationModal.tsx +3 -3
  406. package/src/widgets/views/Dashboard/Dashboard.tsx +3 -3
  407. package/src/widgets/views/Dashboard/DashboardTree.tsx +3 -1
  408. package/src/widgets/views/DashboardGrid/DashboardGrid.tsx +3 -3
  409. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +2 -2
  410. package/src/widgets/views/Form.tsx +2 -2
  411. package/src/widgets/views/Graph/Graph.tsx +1 -1
  412. package/src/widgets/views/Graph/GraphChart.tsx +2 -2
  413. package/src/widgets/views/Graph/GraphDefaults.ts +3 -3
  414. package/src/widgets/views/Graph/useGraphData.tsx +1 -1
  415. package/src/widgets/views/SearchTree.tsx +23 -13
  416. package/src/widgets/views/Tree/Tree.tsx +295 -0
  417. package/src/widgets/views/Tree/index.ts +1 -0
  418. package/src/widgets/views/Tree/treeComponents.tsx +276 -0
  419. package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +34 -8
  420. package/src/widgets/views/searchFilter/SearchBottomBar.tsx +4 -8
  421. package/src/widgets/views/searchFilter/SearchField.tsx +5 -1
  422. package/src/widgets/views/searchFilter/SearchFilter.tsx +3 -2
  423. package/src/widgets/views/searchFilter/SearchParams.tsx +7 -4
  424. package/src/widgets/views/Tree.tsx +0 -412
@@ -0,0 +1,295 @@
1
+ import { memo, useContext, useEffect, useMemo, useRef, useState } from "react";
2
+ import { Pagination as AntPagination, Row, Col, Spin, Badge } from "antd";
3
+ import {
4
+ getTree,
5
+ getTableColumns,
6
+ getTableItems,
7
+ hasActualValues,
8
+ } from "@/helpers/treeHelper";
9
+ import { Tree as TreeOoui } from "@gisce/ooui";
10
+ import { TreeView } from "@/types";
11
+ import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
12
+ import { calculateColumnsWidth } from "@/helpers/dynamicColumnsHelper";
13
+ import { Table as GisceTable } from "@gisce/react-formiga-table";
14
+ import {
15
+ PlusSquareOutlined,
16
+ MinusSquareOutlined,
17
+ LoadingOutlined,
18
+ } from "@ant-design/icons";
19
+ import {
20
+ ActionViewContext,
21
+ ActionViewContextType,
22
+ } from "@/context/ActionViewContext";
23
+ import { SelectAllRecordsRow } from "@/common/SelectAllRecordsRow";
24
+ import { COLUMN_COMPONENTS } from "./treeComponents";
25
+ import ErrorBoundary from "antd/es/alert/ErrorBoundary";
26
+
27
+ type Props = {
28
+ total?: number;
29
+ limit: number;
30
+ page?: number;
31
+ loading: boolean;
32
+ treeView: TreeView;
33
+ results: any[];
34
+ showPagination?: boolean;
35
+ onRequestPageChange?: (page: number, pageSize?: number) => void;
36
+ onRowClicked?: (record: any) => void;
37
+ onRowSelectionChange?: (selectedRowKeys: any[]) => void;
38
+ selectedRowKeys?: number[];
39
+ scrollY?: number;
40
+ colorsForResults?: { [key: number]: string };
41
+ statusForResults?: { [key: number]: string };
42
+ onChangeSort?: (results: any) => void;
43
+ sorter?: any;
44
+ onFetchChildrenForRecord?: (item: any) => Promise<any[]>;
45
+ childField?: string;
46
+ rootTree?: boolean;
47
+ context?: any;
48
+ readonly?: boolean;
49
+ onSelectAllRecords?: () => Promise<void>;
50
+ };
51
+ export const Tree = memo((props: Props) => {
52
+ const {
53
+ page = 1,
54
+ limit,
55
+ total,
56
+ treeView,
57
+ results,
58
+ onRequestPageChange,
59
+ loading,
60
+ onRowClicked,
61
+ showPagination = true,
62
+ selectedRowKeys = [],
63
+ onRowSelectionChange,
64
+ scrollY,
65
+ colorsForResults = {},
66
+ statusForResults = {},
67
+ onChangeSort,
68
+ sorter,
69
+ onFetchChildrenForRecord,
70
+ childField,
71
+ rootTree = false,
72
+ context,
73
+ readonly,
74
+ onSelectAllRecords,
75
+ } = props;
76
+
77
+ const [items, setItems] = useState<any[]>([]);
78
+
79
+ const errorInParseColors = useRef<boolean>(false);
80
+
81
+ const [treeOoui, setTreeOoui] = useState<TreeOoui>();
82
+
83
+ const { t } = useContext(LocaleContext) as LocaleContextType;
84
+ const internalLimit = useRef(limit);
85
+
86
+ const actionViewContext = useContext(
87
+ ActionViewContext,
88
+ ) as ActionViewContextType;
89
+ const { title = undefined, setTitle = undefined } =
90
+ (rootTree ? actionViewContext : {}) || {};
91
+
92
+ const columns = useMemo(() => {
93
+ if (!treeOoui) {
94
+ return undefined;
95
+ }
96
+
97
+ return getTableColumns(
98
+ treeOoui,
99
+ {
100
+ ...COLUMN_COMPONENTS,
101
+ },
102
+ context,
103
+ );
104
+ }, [context, treeOoui]);
105
+
106
+ useEffect(() => {
107
+ const treeOoui = getTree(treeView);
108
+ setTreeOoui(treeOoui);
109
+ if (treeOoui.string && title !== treeOoui.string) {
110
+ setTitle?.(treeOoui.string);
111
+ }
112
+ // eslint-disable-next-line react-hooks/exhaustive-deps
113
+ }, [treeView, title]);
114
+
115
+ useEffect(() => {
116
+ if (!treeOoui) {
117
+ return;
118
+ }
119
+ errorInParseColors.current = false;
120
+ const items = getTableItems(treeOoui, results);
121
+ setItems(items);
122
+ // eslint-disable-next-line react-hooks/exhaustive-deps
123
+ }, [results]);
124
+
125
+ useEffect(() => {
126
+ internalLimit.current = limit;
127
+ }, [limit]);
128
+
129
+ const from = (page - 1) * internalLimit.current + 1;
130
+ const to = from - 1 + items.length;
131
+ const summary =
132
+ total === undefined
133
+ ? null
134
+ : total === 0
135
+ ? t("no_results")
136
+ : t("summary")
137
+ .replace("{from}", from?.toString())
138
+ .replace("{to}", to?.toString())
139
+ .replace("{total}", total?.toString());
140
+
141
+ const pagination = useMemo(() => {
142
+ if (!showPagination || treeView.isExpandable) {
143
+ return null;
144
+ }
145
+
146
+ const numberOfVisibleSelectedRows = items?.filter(
147
+ (entry) => selectedRowKeys && selectedRowKeys.includes(entry.id),
148
+ ).length;
149
+
150
+ return loading ? null : total === undefined ? (
151
+ <Spin className="pb-4" />
152
+ ) : (
153
+ <Row align="bottom" className="pb-4">
154
+ <Col span={onSelectAllRecords ? 8 : 12}>
155
+ <AntPagination
156
+ total={total}
157
+ pageSize={
158
+ internalLimit.current === 0 ? total : internalLimit.current
159
+ }
160
+ current={page}
161
+ showSizeChanger={false}
162
+ onChange={onRequestPageChange}
163
+ />
164
+ </Col>
165
+ {onSelectAllRecords && (
166
+ <Col span={8} className="text-center">
167
+ <SelectAllRecordsRow
168
+ numberOfVisibleSelectedRows={numberOfVisibleSelectedRows}
169
+ numberOfRealSelectedRows={selectedRowKeys?.length || 0}
170
+ numberOfTotalRows={items.length}
171
+ totalRecords={total || 0}
172
+ onSelectAllRecords={onSelectAllRecords}
173
+ />
174
+ </Col>
175
+ )}
176
+ <Col span={onSelectAllRecords ? 8 : 12} className="text-right">
177
+ {summary}
178
+ </Col>
179
+ </Row>
180
+ );
181
+ }, [
182
+ items,
183
+ loading,
184
+ onRequestPageChange,
185
+ onSelectAllRecords,
186
+ page,
187
+ selectedRowKeys,
188
+ showPagination,
189
+ summary,
190
+ total,
191
+ treeView.isExpandable,
192
+ ]);
193
+
194
+ const sums = useMemo(() => {
195
+ if (!treeOoui) {
196
+ return null;
197
+ }
198
+ const sumFields = treeOoui.columns
199
+ .filter((it) => it.sum !== undefined)
200
+ .map((it) => {
201
+ return { label: it.sum, field: it.id };
202
+ });
203
+
204
+ if (!sumFields || sumFields.length === 0) {
205
+ return null;
206
+ }
207
+
208
+ const summary: string[] = [];
209
+ const sumItems =
210
+ selectedRowKeys?.length > 0
211
+ ? items.filter((result: any) => {
212
+ return selectedRowKeys.includes(result.id);
213
+ })
214
+ : items;
215
+
216
+ sumFields.forEach((sumField) => {
217
+ const total = sumItems.reduce((prev, current) => {
218
+ if (current[sumField.field] && !isNaN(current[sumField.field]))
219
+ return prev + current[sumField.field];
220
+ else return prev;
221
+ }, 0);
222
+
223
+ summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
224
+ });
225
+
226
+ return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
227
+ }, [items, selectedRowKeys, treeOoui]);
228
+
229
+ const dataTable = useMemo(() => {
230
+ if (treeOoui !== null && columns && columns.length > 0) {
231
+ const maxWidthPerCell = 600;
232
+ return calculateColumnsWidth(columns, items, maxWidthPerCell);
233
+ }
234
+ return undefined;
235
+ }, [columns, items, treeOoui]);
236
+
237
+ const adjustedHeight = useMemo(() => {
238
+ if (scrollY && treeOoui?.columns.some((it: any) => it.sum !== undefined)) {
239
+ return scrollY - 30;
240
+ }
241
+ return scrollY;
242
+ }, [scrollY, treeOoui?.columns]);
243
+
244
+ if (treeOoui === null || !dataTable || dataTable?.columns?.length === 0) {
245
+ return <Spin style={{ padding: "2rem" }} />;
246
+ }
247
+
248
+ return (
249
+ <ErrorBoundary>
250
+ {pagination}
251
+ <GisceTable
252
+ height={adjustedHeight!}
253
+ columns={dataTable.columns}
254
+ dataSource={items}
255
+ loading={loading}
256
+ loadingComponent={<Spin />}
257
+ onRowStyle={(record: any) => {
258
+ if (colorsForResults![record.id]) {
259
+ return { color: colorsForResults![record.id] };
260
+ }
261
+ return undefined;
262
+ }}
263
+ onRowStatus={
264
+ hasActualValues(statusForResults)
265
+ ? (record: any) => {
266
+ if (statusForResults![record.id]) {
267
+ return <Badge color={statusForResults[record.id]} />;
268
+ }
269
+ return undefined;
270
+ }
271
+ : undefined
272
+ }
273
+ onRowDoubleClick={onRowClicked}
274
+ onRowSelectionChange={onRowSelectionChange}
275
+ onChangeSort={onChangeSort}
276
+ sorter={sorter}
277
+ readonly={readonly}
278
+ expandableOpts={
279
+ onFetchChildrenForRecord
280
+ ? {
281
+ expandIcon: PlusSquareOutlined,
282
+ collapseIcon: MinusSquareOutlined,
283
+ loadingIcon: LoadingOutlined,
284
+ onFetchChildrenForRecord,
285
+ childField: childField!,
286
+ }
287
+ : undefined
288
+ }
289
+ />
290
+ {sums}
291
+ </ErrorBoundary>
292
+ );
293
+ });
294
+
295
+ Tree.displayName = "Tree";
@@ -0,0 +1 @@
1
+ export * from "./Tree";
@@ -0,0 +1,276 @@
1
+ import { ReactElement, useCallback, useEffect, useMemo, useState } from "react";
2
+ import { Checkbox, Spin } from "antd";
3
+ import { parseFloatToString } from "@/helpers/timeHelper";
4
+ import { ProgressBarInput } from "../../base/ProgressBar";
5
+ import { One2manyValue } from "../../base/one2many/One2manyInput";
6
+ import { Interweave } from "interweave";
7
+ import { Many2oneTree } from "../../base/many2one/Many2oneTree";
8
+ import { ReferenceTree } from "../../base/ReferenceTree";
9
+ import dayjs from "@/helpers/dayjs";
10
+ import Avatar from "../../custom/Avatar";
11
+ import { CustomTag, TagInput } from "../../custom/Tag";
12
+ import { DatePickerConfig } from "@/common/DatePicker";
13
+ import ConnectionProvider from "@/ConnectionProvider";
14
+ import { colorFromString } from "@/helpers/formHelper";
15
+
16
+ export const BooleanComponent = ({
17
+ value,
18
+ }: {
19
+ value: boolean;
20
+ }): ReactElement => {
21
+ return useMemo(
22
+ () => (
23
+ <div
24
+ style={{
25
+ display: "flex",
26
+ justifyContent: "center",
27
+ alignContent: "center",
28
+ }}
29
+ >
30
+ <Checkbox checked={value} disabled />
31
+ </div>
32
+ ),
33
+ [value],
34
+ );
35
+ };
36
+
37
+ export const Many2OneComponent = ({ value }: { value: any }): ReactElement => {
38
+ return useMemo(() => <Many2oneTree m2oField={value} />, [value]);
39
+ };
40
+
41
+ export const TextComponent = ({ value }: { value: any }): ReactElement => {
42
+ return useMemo(
43
+ () => (
44
+ <Interweave
45
+ content={value?.toString().replace(/(?:\r\n|\r|\n)/g, "<br>")}
46
+ />
47
+ ),
48
+ [value],
49
+ );
50
+ };
51
+
52
+ export const DateComponent = ({ value }: { value: any }): ReactElement => {
53
+ return useMemo(() => {
54
+ if (!value || (value && value.length === 0)) return <></>;
55
+
56
+ const formattedValue = dayjs(
57
+ value,
58
+ DatePickerConfig.date.dateInternalFormat,
59
+ ).format(DatePickerConfig.date.dateDisplayFormat);
60
+ return <>{formattedValue}</>;
61
+ }, [value]);
62
+ };
63
+
64
+ export const DateTimeComponent = ({ value }: { value: any }): ReactElement => {
65
+ return useMemo(() => {
66
+ if (!value || (value && value.length === 0)) return <></>;
67
+ const formattedValue = dayjs(
68
+ value,
69
+ DatePickerConfig.time.dateInternalFormat,
70
+ ).format(DatePickerConfig.time.dateDisplayFormat);
71
+ return <>{formattedValue}</>;
72
+ }, [value]);
73
+ };
74
+
75
+ export const One2ManyComponent = ({
76
+ value,
77
+ }: {
78
+ value: One2manyValue;
79
+ }): ReactElement => {
80
+ return useMemo(() => {
81
+ const length = Array.isArray(value?.items) ? value?.items.length : 0;
82
+ return <>{`( ${length} )`}</>;
83
+ }, [value]);
84
+ };
85
+
86
+ export const ProgressBarComponent = ({
87
+ value,
88
+ }: {
89
+ value: any;
90
+ }): ReactElement => {
91
+ return useMemo(() => <ProgressBarInput value={value} />, [value]);
92
+ };
93
+
94
+ export const FloatTimeComponent = ({ value }: { value: any }): ReactElement => {
95
+ return useMemo(() => <>{parseFloatToString(value)}</>, [value]);
96
+ };
97
+
98
+ export const NumberComponent = ({ value }: { value: number }): ReactElement => {
99
+ return useMemo(
100
+ () => <div style={{ textAlign: "right" }}>{value}</div>,
101
+ [value],
102
+ );
103
+ };
104
+
105
+ export const ImageComponent = ({ value }: { value: string }): ReactElement => {
106
+ return useMemo(
107
+ () => (
108
+ <img
109
+ src={`data:image/*;base64,${value}`}
110
+ style={{ maxWidth: "50px", padding: "5px" }}
111
+ />
112
+ ),
113
+ [value],
114
+ );
115
+ };
116
+
117
+ export const TagComponent = ({
118
+ value,
119
+ key,
120
+ ooui,
121
+ context,
122
+ }: {
123
+ value: any;
124
+ key: string;
125
+ ooui: any;
126
+ context: any;
127
+ }): ReactElement => {
128
+ return useMemo(() => <TagInput ooui={ooui} value={value} />, [ooui, value]);
129
+ };
130
+
131
+ export const SelectionComponent = ({
132
+ value,
133
+ key,
134
+ ooui,
135
+ context,
136
+ }: {
137
+ value: any;
138
+ key: string;
139
+ ooui: any;
140
+ context: any;
141
+ }): ReactElement => {
142
+ return useMemo(() => <>{ooui.selectionValues.get(value)}</>, [ooui, value]);
143
+ };
144
+
145
+ export const ReferenceComponent = ({
146
+ value,
147
+ key,
148
+ ooui,
149
+ context,
150
+ }: {
151
+ value: any;
152
+ key: string;
153
+ ooui: any;
154
+ context: any;
155
+ }): ReactElement => {
156
+ return useMemo(
157
+ () => (
158
+ <ReferenceTree
159
+ value={value}
160
+ selectionValues={ooui.selectionValues}
161
+ context={context}
162
+ />
163
+ ),
164
+ [context, ooui.selectionValues, value],
165
+ );
166
+ };
167
+
168
+ export const AvatarComponent = ({
169
+ value,
170
+ key,
171
+ ooui,
172
+ context,
173
+ }: {
174
+ value: any;
175
+ key: string;
176
+ ooui: any;
177
+ context: any;
178
+ }): ReactElement => {
179
+ return useMemo(() => <Avatar ooui={ooui} value={value} />, [ooui, value]);
180
+ };
181
+
182
+ export const TagsComponent = ({
183
+ value,
184
+ key,
185
+ ooui,
186
+ context,
187
+ }: {
188
+ value: any;
189
+ key: string;
190
+ ooui: any;
191
+ context: any;
192
+ }): ReactElement => {
193
+ const [values, setValues] = useState<Array<{ id: number; name: string }>>([]);
194
+ const [loading, setLoading] = useState<boolean>(false);
195
+ const { relation, field } = ooui;
196
+
197
+ const loadValues = useCallback(async () => {
198
+ try {
199
+ setLoading(true);
200
+ const optionsRead = await ConnectionProvider.getHandler().search({
201
+ model: relation,
202
+ params: [["id", "in", value.items.map((v: any) => v.id)]],
203
+ fields: [field],
204
+ context,
205
+ });
206
+ setValues(
207
+ optionsRead.map((i: any) => {
208
+ const { id, name } = i;
209
+ return { id, name };
210
+ }),
211
+ );
212
+ } catch (error) {
213
+ console.error("Error loading data", error);
214
+ } finally {
215
+ setLoading(false);
216
+ }
217
+ }, [context, field, relation, value.items]);
218
+
219
+ useEffect(() => {
220
+ if (value?.items && value?.items.length > 0) {
221
+ loadValues();
222
+ }
223
+ // eslint-disable-next-line react-hooks/exhaustive-deps
224
+ }, [value?.items]);
225
+
226
+ const tags = useMemo(
227
+ () =>
228
+ values.map((entry) => {
229
+ const { id, name } = entry;
230
+ const color = colorFromString(name);
231
+ return (
232
+ <CustomTag key={`${id}`} color={color}>
233
+ {name}
234
+ </CustomTag>
235
+ );
236
+ }),
237
+ [values],
238
+ );
239
+
240
+ return useMemo(() => {
241
+ if (loading) {
242
+ return <Spin />;
243
+ }
244
+ return (
245
+ <div
246
+ style={{
247
+ maxWidth: "300px",
248
+ whiteSpace: "break-spaces",
249
+ lineHeight: "30px",
250
+ }}
251
+ >
252
+ {tags}
253
+ </div>
254
+ );
255
+ }, [tags, loading]);
256
+ };
257
+
258
+ export const COLUMN_COMPONENTS = {
259
+ boolean: BooleanComponent,
260
+ many2one: Many2OneComponent,
261
+ text: TextComponent,
262
+ one2many: One2ManyComponent,
263
+ many2many: One2ManyComponent,
264
+ progressbar: ProgressBarComponent,
265
+ float_time: FloatTimeComponent,
266
+ image: ImageComponent,
267
+ integer: NumberComponent,
268
+ float: NumberComponent,
269
+ reference: ReferenceComponent,
270
+ tag: TagComponent,
271
+ selection: SelectionComponent,
272
+ date: DateComponent,
273
+ datetime: DateTimeComponent,
274
+ avatar: AvatarComponent,
275
+ tags: TagsComponent,
276
+ };
@@ -1,10 +1,9 @@
1
- import { DatePicker, TimePicker, Row, Col } from "antd";
2
-
3
- import React from "react";
1
+ import { DatePicker, Row, Col } from "antd";
4
2
  import Field from "@/common/Field";
5
3
  import { Field as FieldOoui, Label as LabelOoui } from "@gisce/ooui";
6
4
  import { WidgetProps } from "@/types";
7
5
  import Label from "@/widgets/base/Label";
6
+ import { TimePicker } from "../../../common/TimePicker";
8
7
 
9
8
  export const DateTimeRangePicker = (props: WidgetProps) => {
10
9
  const { ooui, showLabel = false } = props;
@@ -48,14 +47,41 @@ export const DateTimeRangePicker = (props: WidgetProps) => {
48
47
  </Col>
49
48
  <Col>
50
49
  <Field {...props} ooui={fields[1]} showLabel={false}>
51
- <TimePicker.RangePicker
52
- className="w-60"
53
- allowEmpty={[true, true]}
54
- format={"HH:mm"}
55
- ></TimePicker.RangePicker>
50
+ <TimeRangePicker />
56
51
  </Field>
57
52
  </Col>
58
53
  </Row>
59
54
  </>
60
55
  );
61
56
  };
57
+
58
+ const TimeRangePicker = ({
59
+ value,
60
+ onChange,
61
+ }: {
62
+ value?: any;
63
+ onChange?: (newValue: any) => void;
64
+ }) => {
65
+ return (
66
+ <div style={{ marginTop: 5 }}>
67
+ <TimePicker
68
+ placeholder="Start time"
69
+ format={"HH:mm"}
70
+ style={{ width: 115, marginRight: 10 }}
71
+ value={value?.[0]}
72
+ onChange={(newValue) => {
73
+ onChange?.([newValue, value?.[1]]);
74
+ }}
75
+ />
76
+ <TimePicker
77
+ placeholder="End time"
78
+ style={{ width: 115 }}
79
+ format={"HH:mm"}
80
+ value={value?.[1]}
81
+ onChange={(newValue) => {
82
+ onChange?.([value?.[0], newValue]);
83
+ }}
84
+ />
85
+ </div>
86
+ );
87
+ };
@@ -1,4 +1,4 @@
1
- import React, { useContext } from "react";
1
+ import { ReactElement, useContext } from "react";
2
2
 
3
3
  import { Row, Col, Button } from "antd";
4
4
  import {
@@ -17,13 +17,9 @@ type Props = {
17
17
  onClear: () => void;
18
18
  };
19
19
 
20
- export function SearchBottomBar(props: Props): React.ReactElement {
21
- const {
22
- onAdvancedFilterToggle,
23
- advancedFilter,
24
- onClear,
25
- isSearching,
26
- } = props;
20
+ export function SearchBottomBar(props: Props): ReactElement {
21
+ const { onAdvancedFilterToggle, advancedFilter, onClear, isSearching } =
22
+ props;
27
23
 
28
24
  const { t } = useContext(LocaleContext) as LocaleContextType;
29
25
 
@@ -8,7 +8,11 @@ import { PairFields } from "./PairFields";
8
8
 
9
9
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
10
10
 
11
- import { Field, SearchFieldTypes, Selection as SelectionOoui } from "@gisce/ooui";
11
+ import {
12
+ Field,
13
+ SearchFieldTypes,
14
+ Selection as SelectionOoui,
15
+ } from "@gisce/ooui";
12
16
  import { MultiSelection } from "@/widgets/base/MultiSelection";
13
17
 
14
18
  type Props = {
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, useState } from "react";
1
+ import { useEffect, useRef, useState } from "react";
2
2
  import { Form, Row, Col, Alert, theme } from "antd";
3
3
  import useDeepCompareEffect from "use-deep-compare-effect";
4
4
 
@@ -60,6 +60,7 @@ function SearchFilter(props: Props) {
60
60
 
61
61
  useEffect(() => {
62
62
  form.setFieldsValue(searchValues);
63
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
64
  }, [searchValues]);
64
65
 
65
66
  const getRowsAndCols = () => {
@@ -101,7 +102,7 @@ function SearchFilter(props: Props) {
101
102
  delete values.limit;
102
103
  const newParams = getParamsForFields(
103
104
  values,
104
- sfo.current?._advancedSearchContainer
105
+ sfo.current?._advancedSearchContainer,
105
106
  );
106
107
 
107
108
  onSubmit({ params: newParams, offset, limit, searchValues: values });