@gisce/react-ooui 1.2.0-rc.9 → 1.2.0-rc.91

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 (355) hide show
  1. package/README.md +0 -6
  2. package/dist/actionbar/ActionButton.d.ts +2 -2
  3. package/dist/actionbar/ActionButton.d.ts.map +1 -1
  4. package/dist/actionbar/AttachmentsButton.d.ts +2 -2
  5. package/dist/actionbar/AttachmentsButton.d.ts.map +1 -1
  6. package/dist/actionbar/AttachmentsButtonWrapper.d.ts +2 -2
  7. package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -1
  8. package/dist/actionbar/ButtonWithBadge.d.ts +2 -2
  9. package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -1
  10. package/dist/actionbar/ChangeViewButton.d.ts +2 -2
  11. package/dist/actionbar/ChangeViewButton.d.ts.map +1 -1
  12. package/dist/actionbar/DashboardActionBar.d.ts +2 -2
  13. package/dist/actionbar/DashboardActionBar.d.ts.map +1 -1
  14. package/dist/actionbar/DropdownButton.d.ts +2 -2
  15. package/dist/actionbar/DropdownButton.d.ts.map +1 -1
  16. package/dist/actionbar/FormActionBar.d.ts +2 -2
  17. package/dist/actionbar/FormActionBar.d.ts.map +1 -1
  18. package/dist/actionbar/GraphActionBar.d.ts +2 -2
  19. package/dist/actionbar/GraphActionBar.d.ts.map +1 -1
  20. package/dist/actionbar/NewButton.d.ts +2 -2
  21. package/dist/actionbar/NewButton.d.ts.map +1 -1
  22. package/dist/actionbar/SearchBar.d.ts +2 -2
  23. package/dist/actionbar/SearchBar.d.ts.map +1 -1
  24. package/dist/actionbar/TreeActionBar.d.ts +2 -2
  25. package/dist/actionbar/TreeActionBar.d.ts.map +1 -1
  26. package/dist/common/ButtonWithTooltip.d.ts +2 -2
  27. package/dist/common/ButtonWithTooltip.d.ts.map +1 -1
  28. package/dist/common/DatePicker.d.ts +14 -2
  29. package/dist/common/DatePicker.d.ts.map +1 -1
  30. package/dist/common/Field.d.ts +1 -1
  31. package/dist/common/Field.d.ts.map +1 -1
  32. package/dist/context/ActionViewContext.d.ts +5 -1
  33. package/dist/context/ActionViewContext.d.ts.map +1 -1
  34. package/dist/context/ConfigContext.d.ts +7 -0
  35. package/dist/context/ConfigContext.d.ts.map +1 -0
  36. package/dist/context/ContentRootContext.d.ts.map +1 -1
  37. package/dist/context/FormContext.d.ts +4 -2
  38. package/dist/context/FormContext.d.ts.map +1 -1
  39. package/dist/helpers/errorHelper.d.ts +6 -0
  40. package/dist/helpers/errorHelper.d.ts.map +1 -0
  41. package/dist/helpers/filesHelper.d.ts.map +1 -1
  42. package/dist/helpers/formHelper.d.ts +5 -3
  43. package/dist/helpers/formHelper.d.ts.map +1 -1
  44. package/dist/helpers/iconMapper.d.ts +11 -2
  45. package/dist/helpers/iconMapper.d.ts.map +1 -1
  46. package/dist/helpers/one2manyHelper.d.ts +12 -4
  47. package/dist/helpers/one2manyHelper.d.ts.map +1 -1
  48. package/dist/helpers/searchHelper.d.ts +1 -1
  49. package/dist/helpers/searchHelper.d.ts.map +1 -1
  50. package/dist/helpers/treeHelper.d.ts +1 -1
  51. package/dist/helpers/treeHelper.d.ts.map +1 -1
  52. package/dist/hooks/useExport.d.ts +44 -0
  53. package/dist/hooks/useExport.d.ts.map +1 -0
  54. package/dist/index.d.ts +4 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/locales/ca_ES.d.ts +2 -0
  57. package/dist/locales/ca_ES.d.ts.map +1 -1
  58. package/dist/locales/en_US.d.ts +2 -0
  59. package/dist/locales/en_US.d.ts.map +1 -1
  60. package/dist/locales/es_ES.d.ts +2 -0
  61. package/dist/locales/es_ES.d.ts.map +1 -1
  62. package/dist/react-ooui.es.js +9360 -29063
  63. package/dist/react-ooui.es.js.map +1 -1
  64. package/dist/react-ooui.umd.js +16 -265
  65. package/dist/react-ooui.umd.js.map +1 -1
  66. package/dist/style.css +1 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/index.d.ts.map +1 -1
  69. package/dist/ui/ActionErrorDialog.d.ts.map +1 -1
  70. package/dist/ui/ErrorAlert.d.ts +6 -0
  71. package/dist/ui/ErrorAlert.d.ts.map +1 -0
  72. package/dist/ui/FavouriteButton.d.ts +2 -2
  73. package/dist/ui/FavouriteButton.d.ts.map +1 -1
  74. package/dist/ui/GoToResourceModal.d.ts +2 -2
  75. package/dist/ui/GoToResourceModal.d.ts.map +1 -1
  76. package/dist/ui/TitleHeader.d.ts +2 -2
  77. package/dist/ui/TitleHeader.d.ts.map +1 -1
  78. package/dist/views/ActionView.d.ts.map +1 -1
  79. package/dist/views/CurrentTabContent.d.ts +2 -2
  80. package/dist/views/CurrentTabContent.d.ts.map +1 -1
  81. package/dist/views/RootView.d.ts.map +1 -1
  82. package/dist/views/TabContent.d.ts +1 -1
  83. package/dist/views/TabContent.d.ts.map +1 -1
  84. package/dist/views/TabSelector.d.ts +2 -2
  85. package/dist/views/TabSelector.d.ts.map +1 -1
  86. package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
  87. package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
  88. package/dist/views/actionViews/FormActionView.d.ts +2 -2
  89. package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
  90. package/dist/views/actionViews/GraphActionView.d.ts +2 -2
  91. package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
  92. package/dist/views/actionViews/TreeActionView.d.ts +2 -2
  93. package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
  94. package/dist/views/tabs/Tab.d.ts +2 -2
  95. package/dist/views/tabs/Tab.d.ts.map +1 -1
  96. package/dist/widgets/WidgetFactory.d.ts.map +1 -1
  97. package/dist/widgets/base/Binary.d.ts +3 -3
  98. package/dist/widgets/base/Binary.d.ts.map +1 -1
  99. package/dist/widgets/base/Boolean.d.ts +2 -2
  100. package/dist/widgets/base/Boolean.d.ts.map +1 -1
  101. package/dist/widgets/base/Button.d.ts +2 -2
  102. package/dist/widgets/base/Button.d.ts.map +1 -1
  103. package/dist/widgets/base/Char.d.ts +2 -2
  104. package/dist/widgets/base/Char.d.ts.map +1 -1
  105. package/dist/widgets/base/Date.d.ts +2 -2
  106. package/dist/widgets/base/Date.d.ts.map +1 -1
  107. package/dist/widgets/base/DateTime.d.ts +2 -2
  108. package/dist/widgets/base/DateTime.d.ts.map +1 -1
  109. package/dist/widgets/base/Email.d.ts +2 -2
  110. package/dist/widgets/base/Email.d.ts.map +1 -1
  111. package/dist/widgets/base/Float.d.ts +2 -2
  112. package/dist/widgets/base/Float.d.ts.map +1 -1
  113. package/dist/widgets/base/FloatTime.d.ts +1 -1
  114. package/dist/widgets/base/FloatTime.d.ts.map +1 -1
  115. package/dist/widgets/base/Image.d.ts +3 -3
  116. package/dist/widgets/base/Image.d.ts.map +1 -1
  117. package/dist/widgets/base/Integer.d.ts +2 -2
  118. package/dist/widgets/base/Integer.d.ts.map +1 -1
  119. package/dist/widgets/base/Label.d.ts +2 -2
  120. package/dist/widgets/base/Label.d.ts.map +1 -1
  121. package/dist/widgets/base/LinkInput.d.ts +2 -2
  122. package/dist/widgets/base/LinkInput.d.ts.map +1 -1
  123. package/dist/widgets/base/MultiSelection.d.ts +3 -3
  124. package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
  125. package/dist/widgets/base/ProgressBar.d.ts +3 -3
  126. package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
  127. package/dist/widgets/base/Reference.d.ts +1 -1
  128. package/dist/widgets/base/Reference.d.ts.map +1 -1
  129. package/dist/widgets/base/ReferenceTree.d.ts +8 -0
  130. package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
  131. package/dist/widgets/base/Selection.d.ts +3 -3
  132. package/dist/widgets/base/Selection.d.ts.map +1 -1
  133. package/dist/widgets/base/Separator.d.ts +2 -2
  134. package/dist/widgets/base/Separator.d.ts.map +1 -1
  135. package/dist/widgets/base/Text.d.ts +2 -2
  136. package/dist/widgets/base/Text.d.ts.map +1 -1
  137. package/dist/widgets/base/Url.d.ts +2 -2
  138. package/dist/widgets/base/Url.d.ts.map +1 -1
  139. package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
  140. package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
  141. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
  142. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
  143. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
  144. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
  145. package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
  146. package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
  147. package/dist/widgets/base/one2many/One2many.d.ts +2 -2
  148. package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
  149. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
  150. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
  151. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
  152. package/dist/widgets/containers/Group.d.ts.map +1 -1
  153. package/dist/widgets/custom/Avatar.d.ts +10 -0
  154. package/dist/widgets/custom/Avatar.d.ts.map +1 -0
  155. package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
  156. package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
  157. package/dist/widgets/custom/CodeEditor.d.ts +2 -2
  158. package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
  159. package/dist/widgets/custom/FiberGrid.d.ts +3 -3
  160. package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
  161. package/dist/widgets/custom/Indicator.d.ts +2 -2
  162. package/dist/widgets/custom/Indicator.d.ts.map +1 -1
  163. package/dist/widgets/custom/Markdown.d.ts +5 -0
  164. package/dist/widgets/custom/Markdown.d.ts.map +1 -0
  165. package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
  166. package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
  167. package/dist/widgets/custom/Radio.d.ts +3 -3
  168. package/dist/widgets/custom/Radio.d.ts.map +1 -1
  169. package/dist/widgets/custom/Steps.d.ts +3 -3
  170. package/dist/widgets/custom/Steps.d.ts.map +1 -1
  171. package/dist/widgets/custom/Switch.d.ts +2 -2
  172. package/dist/widgets/custom/Switch.d.ts.map +1 -1
  173. package/dist/widgets/custom/Tag.d.ts +5 -0
  174. package/dist/widgets/custom/Tag.d.ts.map +1 -0
  175. package/dist/widgets/custom/Tags.d.ts +3 -3
  176. package/dist/widgets/custom/Tags.d.ts.map +1 -1
  177. package/dist/widgets/custom/Timeline.d.ts +3 -3
  178. package/dist/widgets/custom/Timeline.d.ts.map +1 -1
  179. package/dist/widgets/modals/ExportModal.d.ts +4 -3
  180. package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
  181. package/dist/widgets/modals/FormModal.d.ts +2 -2
  182. package/dist/widgets/modals/FormModal.d.ts.map +1 -1
  183. package/dist/widgets/modals/SearchModal.d.ts +2 -2
  184. package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
  185. package/dist/widgets/modals/TranslationModal.d.ts +2 -2
  186. package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
  187. package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -1
  188. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
  189. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
  190. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
  191. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
  192. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
  193. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
  194. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
  195. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
  196. package/dist/widgets/views/Form.d.ts.map +1 -1
  197. package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
  198. package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
  199. package/dist/widgets/views/Graph/GraphDefaults.d.ts +36 -0
  200. package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -1
  201. package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
  202. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
  203. package/dist/widgets/views/SearchTree.d.ts.map +1 -1
  204. package/dist/widgets/views/Tree.d.ts +2 -0
  205. package/dist/widgets/views/Tree.d.ts.map +1 -1
  206. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
  207. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
  208. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
  209. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
  210. package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
  211. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
  212. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +3 -2
  213. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
  214. package/package.json +14 -15
  215. package/src/__tests__/iconMapper.test.ts +20 -5
  216. package/src/__tests__/searchFilterHelper.spec.ts +7 -7
  217. package/src/actionbar/AttachmentsButton.tsx +22 -24
  218. package/src/actionbar/AttachmentsButtonWrapper.tsx +15 -12
  219. package/src/actionbar/ButtonWithBadge.tsx +5 -2
  220. package/src/actionbar/ChangeViewButton.tsx +13 -7
  221. package/src/actionbar/FormActionBar.tsx +73 -11
  222. package/src/actionbar/SearchBar.tsx +8 -4
  223. package/src/actionbar/TreeActionBar.tsx +99 -97
  224. package/src/common/DatePicker.tsx +18 -13
  225. package/src/context/ActionViewContext.tsx +7 -4
  226. package/src/context/ConfigContext.tsx +9 -0
  227. package/src/context/ContentRootContext.tsx +111 -76
  228. package/src/context/FormContext.tsx +1 -4
  229. package/src/helpers/errorHelper.ts +27 -0
  230. package/src/helpers/filesHelper.ts +2 -3
  231. package/src/helpers/formHelper.ts +26 -5
  232. package/src/helpers/iconMapper.ts +141 -108
  233. package/src/helpers/one2manyHelper.ts +94 -39
  234. package/src/helpers/searchHelper.ts +8 -7
  235. package/src/helpers/treeHelper.ts +17 -5
  236. package/src/hooks/useExport.ts +439 -0
  237. package/src/index.ts +6 -0
  238. package/src/locales/ca_ES.tsx +2 -0
  239. package/src/locales/en_US.tsx +2 -0
  240. package/src/locales/es_ES.tsx +2 -0
  241. package/src/stories/Binary.stories.tsx +4 -1
  242. package/src/stories/Boolean.stories.tsx +4 -1
  243. package/src/stories/Button.stories.tsx +4 -1
  244. package/src/stories/Char.stories.tsx +4 -1
  245. package/src/stories/FiberGrid.stories.tsx +4 -1
  246. package/src/stories/Float.stories.tsx +4 -1
  247. package/src/stories/FloatTime.stories.tsx +4 -1
  248. package/src/stories/Image.stories.tsx +4 -1
  249. package/src/stories/Integer.stories.tsx +4 -1
  250. package/src/stories/Label.stories.tsx +11 -9
  251. package/src/stories/Many2one.stories.tsx +4 -1
  252. package/src/stories/One2many.stories.tsx +4 -1
  253. package/src/stories/ProgressBar.stories.tsx +4 -1
  254. package/src/stories/Reference.stories.tsx +4 -1
  255. package/src/stories/Selection.stories.tsx +4 -1
  256. package/src/stories/Separator.stories.tsx +37 -1
  257. package/src/stories/Text.stories.tsx +4 -1
  258. package/src/stories/containers/Group.stories.tsx +28 -1
  259. package/src/stories/containers/NewLine.stories.tsx +4 -1
  260. package/src/stories/containers/Notebook.stories.tsx +31 -1
  261. package/src/stories/custom/Avatar.stories.tsx +27 -0
  262. package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
  263. package/src/stories/custom/CodeEditor.stories.tsx +4 -1
  264. package/src/stories/custom/Indicator.stories.tsx +4 -1
  265. package/src/stories/custom/Markdown.stories.tsx +42 -0
  266. package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
  267. package/src/stories/custom/Radio.stories.tsx +4 -1
  268. package/src/stories/custom/Steps.stories.tsx +4 -1
  269. package/src/stories/custom/Switch.stories.tsx +4 -1
  270. package/src/stories/custom/Tag.stories.tsx +60 -0
  271. package/src/stories/custom/Tags.stories.tsx +4 -1
  272. package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
  273. package/src/stories/mocks/models/company.ts +2 -2
  274. package/src/stories/mocks/models/crm_case.ts +7 -10
  275. package/src/stories/ui/ActionBar.stories.tsx +2 -1
  276. package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
  277. package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
  278. package/src/stories/views/SearchTree.stories.tsx +3 -1
  279. package/src/stories/views/Tab.stories.tsx +3 -1
  280. package/src/stories/views/TabsAndContent.stories.tsx +3 -1
  281. package/src/stories/views/Tree.stories.jsx +20 -6
  282. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
  283. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
  284. package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
  285. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
  286. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
  287. package/src/types/index.ts +1 -0
  288. package/src/ui/ActionErrorDialog.tsx +4 -21
  289. package/src/ui/ErrorAlert.tsx +37 -0
  290. package/src/ui/FavouriteButton.tsx +20 -9
  291. package/src/ui/GoToResourceModal.tsx +3 -3
  292. package/src/ui/TitleHeader.tsx +18 -4
  293. package/src/views/ActionView.tsx +6 -2
  294. package/src/views/RootView.tsx +7 -1
  295. package/src/views/actionViews/GraphActionView.tsx +1 -0
  296. package/src/views/actionViews/TreeActionView.tsx +10 -1
  297. package/src/views/tabs/Tab.tsx +12 -6
  298. package/src/widgets/WidgetFactory.tsx +6 -0
  299. package/src/widgets/base/Binary.tsx +8 -5
  300. package/src/widgets/base/Boolean.tsx +8 -7
  301. package/src/widgets/base/Char.tsx +14 -12
  302. package/src/widgets/base/Float.tsx +11 -5
  303. package/src/widgets/base/FloatTime.tsx +9 -5
  304. package/src/widgets/base/Integer.tsx +10 -5
  305. package/src/widgets/base/Label.tsx +12 -12
  306. package/src/widgets/base/LinkInput.tsx +11 -6
  307. package/src/widgets/base/MultiSelection.tsx +6 -2
  308. package/src/widgets/base/Reference.tsx +13 -3
  309. package/src/widgets/base/ReferenceTree.tsx +62 -0
  310. package/src/widgets/base/Selection.tsx +6 -2
  311. package/src/widgets/base/Separator.tsx +11 -3
  312. package/src/widgets/base/Text.tsx +14 -12
  313. package/src/widgets/base/many2one/Many2one.tsx +27 -33
  314. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
  315. package/src/widgets/base/many2one/Many2oneTree.tsx +18 -0
  316. package/src/widgets/base/one2many/One2manyInput.tsx +82 -28
  317. package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
  318. package/src/widgets/containers/Group.tsx +7 -4
  319. package/src/widgets/custom/Avatar.tsx +33 -0
  320. package/src/widgets/custom/ButtonGroup.tsx +31 -21
  321. package/src/widgets/custom/FiberGrid.tsx +2 -5
  322. package/src/widgets/custom/Indicator.tsx +16 -15
  323. package/src/widgets/custom/Markdown.tsx +22 -0
  324. package/src/widgets/custom/MultiCheckbox.tsx +1 -0
  325. package/src/widgets/custom/Tag.tsx +24 -0
  326. package/src/widgets/custom/Tags.tsx +27 -28
  327. package/src/widgets/custom/Timeline.tsx +9 -3
  328. package/src/widgets/modals/ExportModal.tsx +33 -134
  329. package/src/widgets/modals/FormModal.tsx +3 -3
  330. package/src/widgets/modals/SearchModal.tsx +29 -31
  331. package/src/widgets/modals/TranslationModal.tsx +3 -3
  332. package/src/widgets/views/Dashboard/Dashboard.tsx +15 -4
  333. package/src/widgets/views/Dashboard/DashboardTree.tsx +1 -0
  334. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
  335. package/src/widgets/views/Form.tsx +41 -39
  336. package/src/widgets/views/Graph/GraphChart.tsx +6 -1
  337. package/src/widgets/views/Graph/GraphDefaults.ts +113 -0
  338. package/src/widgets/views/Graph/GraphIndicator.tsx +19 -7
  339. package/src/widgets/views/SearchTree.tsx +3 -0
  340. package/src/widgets/views/Tree.tsx +118 -26
  341. package/src/widgets/views/searchFilter/SearchField.tsx +9 -23
  342. package/src/widgets/views/searchFilter/SearchFilter.tsx +17 -8
  343. package/dist/Config.d.ts +0 -6
  344. package/dist/Config.d.ts.map +0 -1
  345. package/dist/helpers/icons/antd_icons.d.ts +0 -4
  346. package/dist/helpers/icons/antd_icons.d.ts.map +0 -1
  347. package/dist/helpers/icons/tabler_icons.d.ts +0 -4
  348. package/dist/helpers/icons/tabler_icons.d.ts.map +0 -1
  349. package/dist/main.css +0 -1
  350. package/dist/ui/Fieldset.d.ts +0 -8
  351. package/dist/ui/Fieldset.d.ts.map +0 -1
  352. package/src/Config.ts +0 -4
  353. package/src/helpers/icons/antd_icons.ts +0 -1583
  354. package/src/helpers/icons/tabler_icons.ts +0 -5367
  355. package/src/ui/Fieldset.tsx +0 -31
@@ -96,12 +96,12 @@ export const FormModal = (props: FormModalProps) => {
96
96
  }
97
97
 
98
98
  return (
99
- <FormModalProvider setTitle={setFormTitle}>
99
+ (<FormModalProvider setTitle={setFormTitle}>
100
100
  <Modal
101
101
  title={isMenuAction ? header() : formTitle}
102
102
  centered
103
103
  width={modalWidth}
104
- visible={visible}
104
+ open={visible}
105
105
  footer={null}
106
106
  destroyOnClose
107
107
  onCancel={onCancel}
@@ -115,6 +115,6 @@ export const FormModal = (props: FormModalProps) => {
115
115
  {...rest}
116
116
  />
117
117
  </Modal>
118
- </FormModalProvider>
118
+ </FormModalProvider>)
119
119
  );
120
120
  };
@@ -98,35 +98,33 @@ export const SearchModal = (props: SearchSelectionProps) => {
98
98
  );
99
99
  };
100
100
 
101
- return (
102
- <>
103
- <Modal
104
- title={t("search")}
105
- centered
106
- width={modalWidth}
107
- visible={visible && !showCreateModal}
108
- closable={true}
109
- onCancel={onCloseModal}
110
- footer={null}
111
- destroyOnClose
112
- maskClosable={false}
113
- >
114
- {content()}
115
- </Modal>
116
- <FormModal
117
- model={model}
118
- visible={showCreateModal}
119
- parentContext={context}
120
- onSubmitSucceed={(id?: number) => {
121
- setShowCreateModal(false);
122
- onCloseModal();
123
- onSelectValues([id!]);
124
- }}
125
- onCancel={() => {
126
- setShowCreateModal(false);
127
- onCloseModal();
128
- }}
129
- />
130
- </>
131
- );
101
+ return (<>
102
+ <Modal
103
+ title={t("search")}
104
+ centered
105
+ width={modalWidth}
106
+ open={visible && !showCreateModal}
107
+ closable={true}
108
+ onCancel={onCloseModal}
109
+ footer={null}
110
+ destroyOnClose
111
+ maskClosable={false}
112
+ >
113
+ {content()}
114
+ </Modal>
115
+ <FormModal
116
+ model={model}
117
+ visible={showCreateModal}
118
+ parentContext={context}
119
+ onSubmitSucceed={(id?: number) => {
120
+ setShowCreateModal(false);
121
+ onCloseModal();
122
+ onSelectValues([id!]);
123
+ }}
124
+ onCancel={() => {
125
+ setShowCreateModal(false);
126
+ onCloseModal();
127
+ }}
128
+ />
129
+ </>);
132
130
  };
@@ -185,11 +185,11 @@ export const TranslationModal = (props: TranslationModalProps) => {
185
185
  }
186
186
 
187
187
  return (
188
- <Modal
188
+ (<Modal
189
189
  title={t("translate")}
190
190
  centered
191
191
  width={modalWidth}
192
- visible={visible}
192
+ open={visible}
193
193
  closable={true}
194
194
  onCancel={onCloseModal}
195
195
  footer={null}
@@ -197,6 +197,6 @@ export const TranslationModal = (props: TranslationModalProps) => {
197
197
  maskClosable={false}
198
198
  >
199
199
  {content()}
200
- </Modal>
200
+ </Modal>)
201
201
  );
202
202
  };
@@ -105,13 +105,19 @@ function Dashboard(props: DashboardProps, ref: any) {
105
105
  })) as FormView
106
106
  ).fields;
107
107
 
108
- return await readObjectValues({
109
- treeFields: itemsFields.current,
110
- formFields: itemsFields.current,
108
+ const [results] = await readObjectValues({
109
+ treeView: {
110
+ fields: itemsFields.current,
111
+ },
112
+ formView: {
113
+ fields: itemsFields.current,
114
+ },
111
115
  model,
112
116
  items,
113
117
  context,
118
+ currentView: "form",
114
119
  });
120
+ return results;
115
121
  }
116
122
 
117
123
  async function fetchValues(view: FormView) {
@@ -214,6 +220,7 @@ function Dashboard(props: DashboardProps, ref: any) {
214
220
  }
215
221
 
216
222
  if (error) {
223
+ console.log(error);
217
224
  return (
218
225
  <Alert className="mt-10 mb-20" message={error} type="error" banner />
219
226
  );
@@ -308,6 +315,10 @@ function Dashboard(props: DashboardProps, ref: any) {
308
315
  />
309
316
  );
310
317
  } else if (initialView !== undefined) {
318
+ const formattedInitialView =
319
+ initialView && Array.isArray(initialView.id)
320
+ ? { ...initialView, id: initialView.id[0] }
321
+ : initialView;
311
322
  childContent = (
312
323
  <ActionView
313
324
  action_id={actionId}
@@ -319,7 +330,7 @@ function Dashboard(props: DashboardProps, ref: any) {
319
330
  context={context}
320
331
  domain={domain}
321
332
  setCanWeClose={() => {}}
322
- initialView={initialView}
333
+ initialView={formattedInitialView}
323
334
  limit={limit}
324
335
  />
325
336
  );
@@ -219,6 +219,7 @@ function DashboardTree(props: Props) {
219
219
  });
220
220
  setResults(sortedResults);
221
221
  }}
222
+ context={parentContext}
222
223
  />
223
224
  </div>
224
225
  );
@@ -1,17 +1,18 @@
1
1
  import React from "react";
2
2
  import { DashboardGridItemProps } from "./DashboardGridItem.types";
3
3
  import { ExportOutlined } from "@ant-design/icons";
4
- import { Row, Col } from "antd";
5
- import { Typography } from "antd";
4
+ import { Row, Col, Typography, theme } from "antd";
5
+ const { useToken } = theme;
6
6
 
7
7
  const { Text } = Typography;
8
8
 
9
9
  export const DashboardGridItem = (props: DashboardGridItemProps) => {
10
- const { id, title, children, action, openAction } = props;
10
+ const { title, children, action, openAction } = props;
11
+ const { token } = useToken();
11
12
 
12
13
  return (
13
14
  <div
14
- className={"shadow-md rounded"}
15
+ className={"shadow-md"}
15
16
  style={{
16
17
  height: "100%",
17
18
  display: "flex",
@@ -19,12 +20,15 @@ export const DashboardGridItem = (props: DashboardGridItemProps) => {
19
20
  overflow: "hidden",
20
21
  border: "1px solid #eee",
21
22
  backgroundColor: "white",
23
+ borderRadius: token.borderRadius,
22
24
  }}
23
25
  >
24
26
  <Row
25
- className="bg-blueGray-100"
26
27
  align="middle"
27
- style={{ borderBottom: "1px solid #ddd" }}
28
+ style={{
29
+ borderBottom: "1px solid #ddd",
30
+ backgroundColor: token.colorPrimaryBg,
31
+ }}
28
32
  wrap={false}
29
33
  >
30
34
  <Col
@@ -15,6 +15,7 @@ import {
15
15
  Row,
16
16
  Alert,
17
17
  Spin,
18
+ message,
18
19
  } from "antd";
19
20
  import Measure from "react-measure";
20
21
  import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
@@ -54,6 +55,8 @@ import {
54
55
  ContentRootContextType,
55
56
  } from "@/context/ContentRootContext";
56
57
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
58
+ import { convertToPlain2ManyValues } from "@/helpers/one2manyHelper";
59
+ import { ErrorAlert } from "@/ui/ErrorAlert";
57
60
 
58
61
  export type FormProps = {
59
62
  model: string;
@@ -105,7 +108,7 @@ function Form(props: FormProps, ref: any) {
105
108
  defaultValues,
106
109
  forcedValues = {},
107
110
  } = props;
108
- const { lang } = useContext(LocaleContext) as LocaleContextType;
111
+ const { t, lang } = useContext(LocaleContext) as LocaleContextType;
109
112
 
110
113
  const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
111
114
  const [error, setError] = useState<string>();
@@ -126,7 +129,8 @@ function Form(props: FormProps, ref: any) {
126
129
  const responsiveBehaviour = containerWidth < WIDTH_BREAKPOINT;
127
130
 
128
131
  const formContext = useContext(FormContext) as FormContextType;
129
- const { activeId: parentId } = formContext || {};
132
+ const { activeId: parentId, getPlainValues: getParentPlainValues } =
133
+ formContext || {};
130
134
 
131
135
  const actionViewContext = useContext(
132
136
  ActionViewContext
@@ -137,6 +141,8 @@ function Form(props: FormProps, ref: any) {
137
141
  setCurrentId = undefined,
138
142
  setFormIsLoading = undefined,
139
143
  setAttachments = undefined,
144
+ title = undefined,
145
+ setTitle = undefined,
140
146
  } = (rootForm ? actionViewContext : {}) || {};
141
147
 
142
148
  const contentRootContext = useContext(
@@ -342,6 +348,7 @@ function Form(props: FormProps, ref: any) {
342
348
  await antForm.validateFields();
343
349
  return false;
344
350
  } catch (verror) {
351
+ message.error(t("fillRequiredFields"));
345
352
  return true;
346
353
  }
347
354
  }
@@ -398,13 +405,11 @@ function Form(props: FormProps, ref: any) {
398
405
  if (valuesProps) {
399
406
  values = valuesProps;
400
407
  } else {
401
- ({
402
- values,
403
- defaultGetCalled: hasDefaultGetCalled,
404
- } = await fetchValuesFromApi({
405
- fields: _fields,
406
- arch: _arch!,
407
- }));
408
+ ({ values, defaultGetCalled: hasDefaultGetCalled } =
409
+ await fetchValuesFromApi({
410
+ fields: _fields,
411
+ arch: _arch!,
412
+ }));
408
413
  }
409
414
 
410
415
  if (actionDomain) {
@@ -428,11 +433,6 @@ function Form(props: FormProps, ref: any) {
428
433
  }
429
434
  };
430
435
 
431
- function setOriginalValue(field: string, value: any) {
432
- originalFormValues.current[field] = value;
433
- setFormHasChanges?.(formHasChanges());
434
- }
435
-
436
436
  const cancelUnsavedChanges = async () => {
437
437
  return new Promise(async (resolve) => {
438
438
  if (formHasChanges()) {
@@ -455,15 +455,13 @@ function Form(props: FormProps, ref: any) {
455
455
 
456
456
  const getFormView = async (): Promise<FormView> => {
457
457
  if (getDataFromAction) {
458
- const action = await ConnectionProvider.getHandler().getActionStringForModel(
459
- model
460
- );
461
- const viewsForAction = await ConnectionProvider.getHandler().getViewsForAction(
462
- {
458
+ const action =
459
+ await ConnectionProvider.getHandler().getActionStringForModel(model);
460
+ const viewsForAction =
461
+ await ConnectionProvider.getHandler().getViewsForAction({
463
462
  action,
464
463
  context: parentContext,
465
- }
466
- );
464
+ });
467
465
  return viewsForAction.views.get("form");
468
466
  }
469
467
 
@@ -609,13 +607,13 @@ function Form(props: FormProps, ref: any) {
609
607
  formSubmitting.current = false;
610
608
  setFormHasChanges?.(false);
611
609
  onCancel?.();
612
- return true;
610
+ return { succeed: true, id: getCurrentId()! };
613
611
  }
614
612
 
615
613
  if (await checkIfFormHasErrors()) {
616
614
  formSubmitting.current = false;
617
615
  formErrorsDialog(lang);
618
- return false;
616
+ return { succeed: false, id: getCurrentId()! };
619
617
  }
620
618
 
621
619
  setIsSubmitting(true);
@@ -635,11 +633,13 @@ function Form(props: FormProps, ref: any) {
635
633
 
636
634
  await fetchValues();
637
635
  submitSucceed = true;
636
+ message.success(t("savedRegisters"));
638
637
  } catch (err) {
639
638
  formSubmitting.current = false;
640
639
  setIsSubmitting(false);
641
640
  setFormIsSaving?.(false);
642
641
  onSubmitError?.(err);
642
+ message.error(t("errorWhileSavingForm"));
643
643
  setError(err?.message ? err.message : err);
644
644
  } finally {
645
645
  formSubmitting.current = false;
@@ -647,7 +647,7 @@ function Form(props: FormProps, ref: any) {
647
647
  setIsSubmitting(false);
648
648
  }
649
649
 
650
- return submitSucceed;
650
+ return { succeed: submitSucceed, id: getCurrentId()! };
651
651
  };
652
652
 
653
653
  const parseForm = ({
@@ -663,13 +663,20 @@ function Form(props: FormProps, ref: any) {
663
663
  // TODO: Here we must inject `values` to the ooui parser in order to evaluate arch+values and get the new form container
664
664
  ooui.parse(arch, {
665
665
  readOnly,
666
- values: {
667
- ...values,
668
- ...getAdditionalValues(),
669
- },
666
+ values: convertToPlain2ManyValues(
667
+ {
668
+ ...values,
669
+ ...getAdditionalValues(),
670
+ },
671
+ fields
672
+ ),
670
673
  });
671
674
  setFormOoui(ooui);
672
675
 
676
+ if (ooui.string && ooui.string !== title) {
677
+ setTitle?.(ooui.string);
678
+ }
679
+
673
680
  if (formModalContext && ooui.string)
674
681
  formModalContext.setTitle?.(ooui.string);
675
682
  };
@@ -695,7 +702,7 @@ function Form(props: FormProps, ref: any) {
695
702
  if (
696
703
  checkFieldsType({
697
704
  changedFields,
698
- fields,
705
+ formOoui: formOoui!,
699
706
  types: [
700
707
  "text",
701
708
  "codeeditor",
@@ -756,6 +763,7 @@ function Form(props: FormProps, ref: any) {
756
763
  ...formOoui?.context,
757
764
  },
758
765
  },
766
+ parentValues: getParentPlainValues?.(),
759
767
  onChangeFieldActionArgs: onChangeFieldAction.args,
760
768
  });
761
769
 
@@ -943,7 +951,9 @@ function Form(props: FormProps, ref: any) {
943
951
  }
944
952
 
945
953
  try {
946
- await submitForm({ callOnSubmitSucceed: false });
954
+ if (formHasChanges() || getCurrentId() === undefined) {
955
+ await submitForm({ callOnSubmitSucceed: false });
956
+ }
947
957
 
948
958
  if (type === "object") {
949
959
  await runObjectButton({ action, context });
@@ -983,7 +993,6 @@ function Form(props: FormProps, ref: any) {
983
993
  getFieldValue={getFieldValue}
984
994
  executeButtonAction={executeButtonAction}
985
995
  getContext={getContext}
986
- setOriginalValue={setOriginalValue}
987
996
  submitForm={submitForm}
988
997
  fetchValues={fetchValues}
989
998
  formHasChanges={formHasChanges}
@@ -1053,14 +1062,7 @@ function Form(props: FormProps, ref: any) {
1053
1062
  >
1054
1063
  {({ measureRef }) => (
1055
1064
  <div className="pb-2" ref={measureRef}>
1056
- {error && (
1057
- <Alert
1058
- className="mt-10 mb-20"
1059
- message={JSON.stringify(error)}
1060
- type="error"
1061
- banner
1062
- />
1063
- )}
1065
+ {error && <ErrorAlert className="mt-5 mb-10" error={error} />}
1064
1066
  {content()}
1065
1067
  {showFooter && footer()}
1066
1068
  </div>
@@ -57,7 +57,12 @@ export const GraphChart = (props: GraphChartProps) => {
57
57
  return (
58
58
  <div style={{ padding: "1rem" }}>
59
59
  <p style={{ textAlign: "right" }}>
60
- {`${t("totalRegisters")} ${evaluatedEntries?.length}`}
60
+ {`${t("totalRegisters")} ${evaluatedEntries?.length?.toLocaleString(
61
+ "es-ES",
62
+ {
63
+ useGrouping: true,
64
+ }
65
+ )}`}
61
66
  </p>
62
67
  <Chart
63
68
  {...getGraphProps({
@@ -1,13 +1,67 @@
1
+ import dayjs from "dayjs";
2
+
3
+ const formatter = (graphType: "pie" | "default" | "barGrouped") => {
4
+ return (object: any) => {
5
+ const formattedValue = object.value.toLocaleString("es-ES", {
6
+ useGrouping: true,
7
+ });
8
+ const name = graphType === "pie" ? object.x : object.type;
9
+ return { name, value: formattedValue };
10
+ };
11
+ };
12
+
13
+ const axisFormatter = (value: any) => {
14
+ if (typeof value === "string" && stringIsValidNumeric(value)) {
15
+ return parseFloat(value).toLocaleString("es-ES", {
16
+ useGrouping: true,
17
+ });
18
+ } else if (isNumber(value)) {
19
+ return value.toLocaleString("es-ES", {
20
+ useGrouping: true,
21
+ });
22
+ } else if (isValidDateString(value)) {
23
+ const dateType = getDateType(value);
24
+ if (dateType === null) {
25
+ return value;
26
+ }
27
+ return dayjs(value, (dateFormats.input as any)[dateType]).format(
28
+ (dateFormats.output as any)[dateType]
29
+ );
30
+ } else {
31
+ return value;
32
+ }
33
+ };
34
+
35
+ const stringIsValidNumeric = (value: string) => {
36
+ const regex = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
37
+ return regex.test(value);
38
+ };
39
+
40
+ const isNumber = (value: any) => {
41
+ return typeof value === "number" && !isNaN(value);
42
+ };
43
+
1
44
  const DefaultGraphOptions = {
2
45
  default: {
3
46
  padding: "auto",
4
47
  xAxis: {
5
48
  tickCount: 5,
49
+ label: {
50
+ formatter: axisFormatter,
51
+ },
52
+ },
53
+ yAxis: {
54
+ label: {
55
+ formatter: axisFormatter,
56
+ },
6
57
  },
7
58
  legend: {
8
59
  maxWidthRatio: 0.5,
9
60
  maxItemWidth: 1000,
10
61
  },
62
+ tooltip: {
63
+ formatter: formatter("default"),
64
+ },
11
65
  },
12
66
  pie: {
13
67
  appendPadding: 10,
@@ -25,6 +79,9 @@ const DefaultGraphOptions = {
25
79
  maxWidthRatio: 0.5,
26
80
  maxItemWidth: 1000,
27
81
  },
82
+ tooltip: {
83
+ formatter: formatter("pie"),
84
+ },
28
85
  interactions: [
29
86
  {
30
87
  type: "element-active",
@@ -37,6 +94,19 @@ const DefaultGraphOptions = {
37
94
  maxWidthRatio: 0.5,
38
95
  maxItemWidth: 1000,
39
96
  },
97
+ tooltip: {
98
+ formatter: formatter("barGrouped"),
99
+ },
100
+ xAxis: {
101
+ label: {
102
+ formatter: axisFormatter,
103
+ },
104
+ },
105
+ yAxis: {
106
+ label: {
107
+ formatter: axisFormatter,
108
+ },
109
+ },
40
110
  label: {
41
111
  position: "middle",
42
112
  layout: [
@@ -54,4 +124,47 @@ const DefaultGraphOptions = {
54
124
  },
55
125
  };
56
126
 
127
+ function isValidDateString(variable: any): boolean {
128
+ // Check if the variable is defined and is a string
129
+ if (typeof variable !== "string" || variable === undefined) {
130
+ return false;
131
+ }
132
+
133
+ // Check if the string is a valid date
134
+ const date = new Date(variable);
135
+ return date.toString() !== "Invalid Date";
136
+ }
137
+
138
+ const dateFormats = {
139
+ input: {
140
+ hours: "YYYY-MM-DD HH:mm",
141
+ days: "YYYY-MM-DD",
142
+ weeks: "YYYY-[W]WW",
143
+ months: "YYYY-MM",
144
+ years: "YYYY",
145
+ },
146
+ output: {
147
+ hours: "DD/MM/YYYY HH:mm",
148
+ days: "DD/MM/YYYY",
149
+ weeks: "[W]WW/YYYY",
150
+ months: "MM/YYYY",
151
+ years: "YYYY",
152
+ },
153
+ };
154
+
155
+ function getDateType(dateString: string): string | null {
156
+ for (const format in dateFormats.input) {
157
+ const isValidFormat = dayjs(
158
+ dateString,
159
+ (dateFormats.input as any)[format],
160
+ true
161
+ ).isValid();
162
+ if (isValidFormat) {
163
+ return format;
164
+ }
165
+ }
166
+
167
+ return null;
168
+ }
169
+
57
170
  export default DefaultGraphOptions;
@@ -273,7 +273,11 @@ function CommonIndicator({
273
273
  ? minFontSize
274
274
  : height * fontGrowFactor;
275
275
 
276
- let finalValue = total ? `${value}/${total}` : `${value}`;
276
+ const localeValue = value?.toLocaleString("es-ES", {
277
+ useGrouping: true,
278
+ });
279
+
280
+ let finalValue = total ? `${localeValue}/${total}` : `${localeValue}`;
277
281
 
278
282
  if (suffix) {
279
283
  finalValue += " " + suffix;
@@ -342,13 +346,23 @@ function PercentageIndicator({
342
346
  ? minFontSize
343
347
  : twoLinesHeight * fontGrowFactor;
344
348
 
345
- let finalValue = total ? `${value}/${total}` : `${value}`;
349
+ const localeValue = value?.toLocaleString("es-ES", {
350
+ useGrouping: true,
351
+ });
352
+
353
+ let finalValue = total
354
+ ? `${localeValue}/${total?.toLocaleString("es-ES", {
355
+ useGrouping: true,
356
+ })}`
357
+ : `${localeValue}`;
346
358
 
347
359
  if (suffix) {
348
360
  finalValue += " " + suffix;
349
361
  }
350
362
 
351
- const percentValue = `${percent}%`;
363
+ const percentValue = `${percent?.toLocaleString("es-ES", {
364
+ useGrouping: true,
365
+ })}%`;
352
366
 
353
367
  let tw = getTextWidth(
354
368
  percentValue,
@@ -382,10 +396,8 @@ function PercentageIndicator({
382
396
  >
383
397
  <Row align={"middle"}>
384
398
  {IconElement && (
385
- <Col>
386
- <IconElement
387
- style={{ fontSize: fontSize * 1, color, paddingRight: "10px" }}
388
- />
399
+ <Col style={{ fontSize: fontSize * 1, color, paddingRight: "10px" }}>
400
+ <IconElement />
389
401
  </Col>
390
402
  )}
391
403
  <Col>
@@ -295,6 +295,7 @@ function SearchTree(props: Props, ref: any) {
295
295
  formView.search_fields,
296
296
  treeView.search_fields,
297
297
  ])}
298
+ formXml={formView.arch}
298
299
  onClear={clear}
299
300
  limit={limit}
300
301
  offset={offset}
@@ -307,6 +308,7 @@ function SearchTree(props: Props, ref: any) {
307
308
  searchValues={searchValues}
308
309
  />
309
310
  <Tree
311
+ context={parentContext}
310
312
  total={totalItems}
311
313
  limit={limit}
312
314
  page={page}
@@ -327,6 +329,7 @@ function SearchTree(props: Props, ref: any) {
327
329
  treeView.isExpandable ? fetchChildrenForRecord : undefined
328
330
  }
329
331
  childField={treeView.field_parent}
332
+ rootTree={rootTree}
330
333
  />
331
334
  </>
332
335
  );