@gisce/react-ooui 1.2.0-rc.8 → 1.2.0-rc.82

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 (347) 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/formHelper.d.ts +5 -3
  42. package/dist/helpers/formHelper.d.ts.map +1 -1
  43. package/dist/helpers/iconMapper.d.ts +11 -2
  44. package/dist/helpers/iconMapper.d.ts.map +1 -1
  45. package/dist/helpers/one2manyHelper.d.ts +12 -4
  46. package/dist/helpers/one2manyHelper.d.ts.map +1 -1
  47. package/dist/helpers/searchHelper.d.ts +1 -1
  48. package/dist/helpers/searchHelper.d.ts.map +1 -1
  49. package/dist/helpers/treeHelper.d.ts +1 -1
  50. package/dist/helpers/treeHelper.d.ts.map +1 -1
  51. package/dist/hooks/useExport.d.ts +44 -0
  52. package/dist/hooks/useExport.d.ts.map +1 -0
  53. package/dist/index.d.ts +4 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/locales/ca_ES.d.ts +2 -0
  56. package/dist/locales/ca_ES.d.ts.map +1 -1
  57. package/dist/locales/en_US.d.ts +2 -0
  58. package/dist/locales/en_US.d.ts.map +1 -1
  59. package/dist/locales/es_ES.d.ts +2 -0
  60. package/dist/locales/es_ES.d.ts.map +1 -1
  61. package/dist/react-ooui.es.js +25826 -27484
  62. package/dist/react-ooui.es.js.map +1 -1
  63. package/dist/react-ooui.umd.js +180 -215
  64. package/dist/react-ooui.umd.js.map +1 -1
  65. package/dist/types/index.d.ts +1 -0
  66. package/dist/types/index.d.ts.map +1 -1
  67. package/dist/ui/ActionErrorDialog.d.ts.map +1 -1
  68. package/dist/ui/ErrorAlert.d.ts +6 -0
  69. package/dist/ui/ErrorAlert.d.ts.map +1 -0
  70. package/dist/ui/FavouriteButton.d.ts +2 -2
  71. package/dist/ui/FavouriteButton.d.ts.map +1 -1
  72. package/dist/ui/GoToResourceModal.d.ts +2 -2
  73. package/dist/ui/GoToResourceModal.d.ts.map +1 -1
  74. package/dist/ui/TitleHeader.d.ts +2 -2
  75. package/dist/ui/TitleHeader.d.ts.map +1 -1
  76. package/dist/views/ActionView.d.ts.map +1 -1
  77. package/dist/views/CurrentTabContent.d.ts +2 -2
  78. package/dist/views/CurrentTabContent.d.ts.map +1 -1
  79. package/dist/views/RootView.d.ts.map +1 -1
  80. package/dist/views/TabContent.d.ts +1 -1
  81. package/dist/views/TabContent.d.ts.map +1 -1
  82. package/dist/views/TabSelector.d.ts +2 -2
  83. package/dist/views/TabSelector.d.ts.map +1 -1
  84. package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
  85. package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
  86. package/dist/views/actionViews/FormActionView.d.ts +2 -2
  87. package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
  88. package/dist/views/actionViews/GraphActionView.d.ts +2 -2
  89. package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
  90. package/dist/views/actionViews/TreeActionView.d.ts +2 -2
  91. package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
  92. package/dist/views/tabs/Tab.d.ts +2 -2
  93. package/dist/views/tabs/Tab.d.ts.map +1 -1
  94. package/dist/widgets/WidgetFactory.d.ts.map +1 -1
  95. package/dist/widgets/base/Binary.d.ts +3 -3
  96. package/dist/widgets/base/Binary.d.ts.map +1 -1
  97. package/dist/widgets/base/Boolean.d.ts +2 -2
  98. package/dist/widgets/base/Boolean.d.ts.map +1 -1
  99. package/dist/widgets/base/Button.d.ts +2 -2
  100. package/dist/widgets/base/Button.d.ts.map +1 -1
  101. package/dist/widgets/base/Char.d.ts +2 -2
  102. package/dist/widgets/base/Char.d.ts.map +1 -1
  103. package/dist/widgets/base/Date.d.ts +2 -2
  104. package/dist/widgets/base/Date.d.ts.map +1 -1
  105. package/dist/widgets/base/DateTime.d.ts +2 -2
  106. package/dist/widgets/base/DateTime.d.ts.map +1 -1
  107. package/dist/widgets/base/Email.d.ts +2 -2
  108. package/dist/widgets/base/Email.d.ts.map +1 -1
  109. package/dist/widgets/base/Float.d.ts +2 -2
  110. package/dist/widgets/base/Float.d.ts.map +1 -1
  111. package/dist/widgets/base/FloatTime.d.ts +1 -1
  112. package/dist/widgets/base/FloatTime.d.ts.map +1 -1
  113. package/dist/widgets/base/Image.d.ts +3 -3
  114. package/dist/widgets/base/Image.d.ts.map +1 -1
  115. package/dist/widgets/base/Integer.d.ts +2 -2
  116. package/dist/widgets/base/Integer.d.ts.map +1 -1
  117. package/dist/widgets/base/Label.d.ts +2 -2
  118. package/dist/widgets/base/Label.d.ts.map +1 -1
  119. package/dist/widgets/base/LinkInput.d.ts +2 -2
  120. package/dist/widgets/base/LinkInput.d.ts.map +1 -1
  121. package/dist/widgets/base/MultiSelection.d.ts +3 -3
  122. package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
  123. package/dist/widgets/base/ProgressBar.d.ts +3 -3
  124. package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
  125. package/dist/widgets/base/Reference.d.ts +1 -1
  126. package/dist/widgets/base/Reference.d.ts.map +1 -1
  127. package/dist/widgets/base/ReferenceTree.d.ts +8 -0
  128. package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
  129. package/dist/widgets/base/Selection.d.ts +3 -3
  130. package/dist/widgets/base/Selection.d.ts.map +1 -1
  131. package/dist/widgets/base/Separator.d.ts +2 -2
  132. package/dist/widgets/base/Separator.d.ts.map +1 -1
  133. package/dist/widgets/base/Text.d.ts +2 -2
  134. package/dist/widgets/base/Text.d.ts.map +1 -1
  135. package/dist/widgets/base/Url.d.ts +2 -2
  136. package/dist/widgets/base/Url.d.ts.map +1 -1
  137. package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
  138. package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
  139. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
  140. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
  141. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
  142. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
  143. package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
  144. package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
  145. package/dist/widgets/base/one2many/One2many.d.ts +2 -2
  146. package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
  147. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
  148. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
  149. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
  150. package/dist/widgets/containers/Group.d.ts.map +1 -1
  151. package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
  152. package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
  153. package/dist/widgets/custom/CodeEditor.d.ts +2 -2
  154. package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
  155. package/dist/widgets/custom/FiberGrid.d.ts +3 -3
  156. package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
  157. package/dist/widgets/custom/Indicator.d.ts +2 -2
  158. package/dist/widgets/custom/Indicator.d.ts.map +1 -1
  159. package/dist/widgets/custom/Markdown.d.ts +5 -0
  160. package/dist/widgets/custom/Markdown.d.ts.map +1 -0
  161. package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
  162. package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
  163. package/dist/widgets/custom/Radio.d.ts +3 -3
  164. package/dist/widgets/custom/Radio.d.ts.map +1 -1
  165. package/dist/widgets/custom/Steps.d.ts +3 -3
  166. package/dist/widgets/custom/Steps.d.ts.map +1 -1
  167. package/dist/widgets/custom/Switch.d.ts +2 -2
  168. package/dist/widgets/custom/Switch.d.ts.map +1 -1
  169. package/dist/widgets/custom/Tag.d.ts +5 -0
  170. package/dist/widgets/custom/Tag.d.ts.map +1 -0
  171. package/dist/widgets/custom/Tags.d.ts +3 -3
  172. package/dist/widgets/custom/Tags.d.ts.map +1 -1
  173. package/dist/widgets/custom/Timeline.d.ts +3 -3
  174. package/dist/widgets/custom/Timeline.d.ts.map +1 -1
  175. package/dist/widgets/modals/ExportModal.d.ts +4 -3
  176. package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
  177. package/dist/widgets/modals/FormModal.d.ts +2 -2
  178. package/dist/widgets/modals/FormModal.d.ts.map +1 -1
  179. package/dist/widgets/modals/SearchModal.d.ts +2 -2
  180. package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
  181. package/dist/widgets/modals/TranslationModal.d.ts +2 -2
  182. package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
  183. package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -1
  184. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
  185. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
  186. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
  187. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
  188. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
  189. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
  190. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
  191. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
  192. package/dist/widgets/views/Form.d.ts.map +1 -1
  193. package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
  194. package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
  195. package/dist/widgets/views/Graph/GraphDefaults.d.ts +36 -0
  196. package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -1
  197. package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
  198. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
  199. package/dist/widgets/views/SearchTree.d.ts.map +1 -1
  200. package/dist/widgets/views/Tree.d.ts +2 -0
  201. package/dist/widgets/views/Tree.d.ts.map +1 -1
  202. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
  203. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
  204. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
  205. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
  206. package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
  207. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
  208. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +3 -2
  209. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
  210. package/package.json +11 -13
  211. package/src/__tests__/iconMapper.test.ts +20 -5
  212. package/src/__tests__/searchFilterHelper.spec.ts +7 -7
  213. package/src/actionbar/AttachmentsButton.tsx +22 -24
  214. package/src/actionbar/AttachmentsButtonWrapper.tsx +15 -12
  215. package/src/actionbar/ButtonWithBadge.tsx +5 -2
  216. package/src/actionbar/ChangeViewButton.tsx +13 -7
  217. package/src/actionbar/FormActionBar.tsx +73 -11
  218. package/src/actionbar/TreeActionBar.tsx +99 -97
  219. package/src/common/DatePicker.tsx +18 -13
  220. package/src/context/ActionViewContext.tsx +7 -4
  221. package/src/context/ConfigContext.tsx +9 -0
  222. package/src/context/ContentRootContext.tsx +123 -81
  223. package/src/context/FormContext.tsx +1 -4
  224. package/src/helpers/errorHelper.ts +27 -0
  225. package/src/helpers/formHelper.ts +26 -5
  226. package/src/helpers/iconMapper.ts +141 -108
  227. package/src/helpers/one2manyHelper.ts +94 -39
  228. package/src/helpers/searchHelper.ts +8 -7
  229. package/src/helpers/treeHelper.ts +17 -5
  230. package/src/hooks/useExport.ts +439 -0
  231. package/src/index.ts +6 -0
  232. package/src/locales/ca_ES.tsx +2 -0
  233. package/src/locales/en_US.tsx +2 -0
  234. package/src/locales/es_ES.tsx +2 -0
  235. package/src/stories/Binary.stories.tsx +4 -1
  236. package/src/stories/Boolean.stories.tsx +4 -1
  237. package/src/stories/Button.stories.tsx +4 -1
  238. package/src/stories/Char.stories.tsx +4 -1
  239. package/src/stories/FiberGrid.stories.tsx +4 -1
  240. package/src/stories/Float.stories.tsx +4 -1
  241. package/src/stories/FloatTime.stories.tsx +4 -1
  242. package/src/stories/Image.stories.tsx +4 -1
  243. package/src/stories/Integer.stories.tsx +4 -1
  244. package/src/stories/Label.stories.tsx +11 -9
  245. package/src/stories/Many2one.stories.tsx +4 -1
  246. package/src/stories/One2many.stories.tsx +4 -1
  247. package/src/stories/ProgressBar.stories.tsx +4 -1
  248. package/src/stories/Reference.stories.tsx +4 -1
  249. package/src/stories/Selection.stories.tsx +4 -1
  250. package/src/stories/Separator.stories.tsx +37 -1
  251. package/src/stories/Text.stories.tsx +4 -1
  252. package/src/stories/containers/Group.stories.tsx +28 -1
  253. package/src/stories/containers/NewLine.stories.tsx +4 -1
  254. package/src/stories/containers/Notebook.stories.tsx +31 -1
  255. package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
  256. package/src/stories/custom/CodeEditor.stories.tsx +4 -1
  257. package/src/stories/custom/Indicator.stories.tsx +4 -1
  258. package/src/stories/custom/Markdown.stories.tsx +42 -0
  259. package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
  260. package/src/stories/custom/Radio.stories.tsx +4 -1
  261. package/src/stories/custom/Steps.stories.tsx +4 -1
  262. package/src/stories/custom/Switch.stories.tsx +4 -1
  263. package/src/stories/custom/Tag.stories.tsx +60 -0
  264. package/src/stories/custom/Tags.stories.tsx +4 -1
  265. package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
  266. package/src/stories/mocks/models/company.ts +2 -2
  267. package/src/stories/mocks/models/crm_case.ts +7 -10
  268. package/src/stories/ui/ActionBar.stories.tsx +2 -1
  269. package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
  270. package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
  271. package/src/stories/views/SearchTree.stories.tsx +3 -1
  272. package/src/stories/views/Tab.stories.tsx +3 -1
  273. package/src/stories/views/TabsAndContent.stories.tsx +3 -1
  274. package/src/stories/views/Tree.stories.jsx +9 -6
  275. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
  276. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
  277. package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
  278. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
  279. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
  280. package/src/types/index.ts +1 -0
  281. package/src/ui/ActionErrorDialog.tsx +4 -21
  282. package/src/ui/ErrorAlert.tsx +37 -0
  283. package/src/ui/FavouriteButton.tsx +20 -9
  284. package/src/ui/GoToResourceModal.tsx +3 -3
  285. package/src/ui/TitleHeader.tsx +18 -4
  286. package/src/views/ActionView.tsx +6 -2
  287. package/src/views/RootView.tsx +7 -1
  288. package/src/views/actionViews/GraphActionView.tsx +1 -0
  289. package/src/views/actionViews/TreeActionView.tsx +10 -1
  290. package/src/views/tabs/Tab.tsx +12 -6
  291. package/src/widgets/WidgetFactory.tsx +6 -0
  292. package/src/widgets/base/Binary.tsx +8 -5
  293. package/src/widgets/base/Boolean.tsx +8 -7
  294. package/src/widgets/base/Char.tsx +14 -12
  295. package/src/widgets/base/Float.tsx +11 -5
  296. package/src/widgets/base/FloatTime.tsx +9 -5
  297. package/src/widgets/base/Integer.tsx +10 -5
  298. package/src/widgets/base/Label.tsx +12 -12
  299. package/src/widgets/base/LinkInput.tsx +11 -6
  300. package/src/widgets/base/MultiSelection.tsx +6 -2
  301. package/src/widgets/base/Reference.tsx +13 -3
  302. package/src/widgets/base/ReferenceTree.tsx +62 -0
  303. package/src/widgets/base/Selection.tsx +6 -2
  304. package/src/widgets/base/Separator.tsx +11 -3
  305. package/src/widgets/base/Text.tsx +14 -12
  306. package/src/widgets/base/many2one/Many2one.tsx +25 -31
  307. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
  308. package/src/widgets/base/many2one/Many2oneTree.tsx +18 -0
  309. package/src/widgets/base/one2many/One2manyInput.tsx +79 -23
  310. package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
  311. package/src/widgets/containers/Group.tsx +7 -4
  312. package/src/widgets/custom/ButtonGroup.tsx +1 -1
  313. package/src/widgets/custom/FiberGrid.tsx +1 -4
  314. package/src/widgets/custom/Indicator.tsx +16 -15
  315. package/src/widgets/custom/Markdown.tsx +22 -0
  316. package/src/widgets/custom/MultiCheckbox.tsx +1 -0
  317. package/src/widgets/custom/Tag.tsx +24 -0
  318. package/src/widgets/custom/Tags.tsx +27 -28
  319. package/src/widgets/custom/Timeline.tsx +9 -3
  320. package/src/widgets/modals/ExportModal.tsx +33 -134
  321. package/src/widgets/modals/FormModal.tsx +3 -3
  322. package/src/widgets/modals/SearchModal.tsx +29 -31
  323. package/src/widgets/modals/TranslationModal.tsx +3 -3
  324. package/src/widgets/views/Dashboard/Dashboard.tsx +15 -4
  325. package/src/widgets/views/Dashboard/DashboardTree.tsx +1 -0
  326. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
  327. package/src/widgets/views/Form.tsx +41 -39
  328. package/src/widgets/views/Graph/GraphChart.tsx +6 -1
  329. package/src/widgets/views/Graph/GraphDefaults.ts +113 -0
  330. package/src/widgets/views/Graph/GraphIndicator.tsx +19 -7
  331. package/src/widgets/views/SearchTree.tsx +3 -0
  332. package/src/widgets/views/Tree.tsx +112 -26
  333. package/src/widgets/views/searchFilter/SearchField.tsx +9 -23
  334. package/src/widgets/views/searchFilter/SearchFilter.tsx +17 -8
  335. package/dist/Config.d.ts +0 -6
  336. package/dist/Config.d.ts.map +0 -1
  337. package/dist/helpers/icons/antd_icons.d.ts +0 -4
  338. package/dist/helpers/icons/antd_icons.d.ts.map +0 -1
  339. package/dist/helpers/icons/tabler_icons.d.ts +0 -4
  340. package/dist/helpers/icons/tabler_icons.d.ts.map +0 -1
  341. package/dist/ui/Fieldset.d.ts +0 -8
  342. package/dist/ui/Fieldset.d.ts.map +0 -1
  343. package/src/Config.ts +0 -4
  344. package/src/helpers/icons/antd_icons.ts +0 -1583
  345. package/src/helpers/icons/tabler_icons.ts +0 -5367
  346. package/src/ui/Fieldset.tsx +0 -31
  347. /package/dist/{main.css → style.css} +0 -0
@@ -1,5 +1,5 @@
1
- import React, { useContext } from "react";
2
- import { Space, Spin } from "antd";
1
+ import React, { useContext, useEffect, useRef } from "react";
2
+ import { Space, Spin, message } from "antd";
3
3
  import {
4
4
  SaveOutlined,
5
5
  RightOutlined,
@@ -63,7 +63,6 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
63
63
  attachments,
64
64
  formRef,
65
65
  setFormHasChanges,
66
- searchTreeRef,
67
66
  previousView,
68
67
  setPreviousView,
69
68
  goToResourceId,
@@ -331,11 +330,19 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
331
330
  disabled={mustDisableButtons}
332
331
  tooltip={t("actions")}
333
332
  items={toolbar?.action}
334
- onItemClick={(action: any) => {
333
+ onItemClick={async (action: any) => {
335
334
  if (!action) {
336
335
  return;
337
336
  }
338
337
 
338
+ const result = await saveDocument({
339
+ onFormSave,
340
+ });
341
+
342
+ if (!result.succeed) {
343
+ return;
344
+ }
345
+
339
346
  runAction(action);
340
347
  }}
341
348
  />
@@ -344,14 +351,24 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
344
351
  disabled={mustDisableButtons}
345
352
  tooltip={t("reports")}
346
353
  items={toolbar?.print}
347
- onItemClick={(report: any) => {
354
+ onItemClick={async (report: any) => {
348
355
  if (!report) {
349
356
  return;
350
357
  }
358
+ const result = await saveDocument({
359
+ onFormSave,
360
+ });
361
+
362
+ if (!result.succeed) {
363
+ return;
364
+ }
351
365
 
352
366
  runAction({
353
367
  ...report,
354
- datas: { ...(report.datas || {}), ids: [currentId as number] },
368
+ datas: {
369
+ ...(report.datas || {}),
370
+ ids: [result.currentId as number],
371
+ },
355
372
  });
356
373
  }}
357
374
  />
@@ -365,6 +382,14 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
365
382
  return;
366
383
  }
367
384
 
385
+ const result = await saveDocument({
386
+ onFormSave,
387
+ });
388
+
389
+ if (!result.succeed) {
390
+ return;
391
+ }
392
+
368
393
  openRelate({
369
394
  relateData: relate,
370
395
  values: (formRef.current as any).getValues(),
@@ -377,8 +402,16 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
377
402
  <AttachmentsButton
378
403
  disabled={mustDisableButtons}
379
404
  attachments={attachments}
380
- onAddNewAttachment={() => {
381
- const res_id = currentId as number;
405
+ onAddNewAttachment={async () => {
406
+ const result = await saveDocument({
407
+ onFormSave,
408
+ });
409
+
410
+ if (!result.succeed) {
411
+ return;
412
+ }
413
+
414
+ const res_id = result.currentId as number;
382
415
  const res_model = currentModel as string;
383
416
  openDefaultActionForModel({
384
417
  model: "ir.attachment",
@@ -392,8 +425,16 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
392
425
  initialViewType: "form",
393
426
  });
394
427
  }}
395
- onListAllAttachments={() => {
396
- const res_id = currentId as number;
428
+ onListAllAttachments={async () => {
429
+ const result = await saveDocument({
430
+ onFormSave,
431
+ });
432
+
433
+ if (!result.succeed) {
434
+ return;
435
+ }
436
+
437
+ const res_id = result.currentId as number;
397
438
  const res_model = currentModel as string;
398
439
  openDefaultActionForModel({
399
440
  model: "ir.attachment",
@@ -404,7 +445,15 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
404
445
  initialViewType: "tree",
405
446
  });
406
447
  }}
407
- onViewAttachmentDetails={(attachment: Attachment) => {
448
+ onViewAttachmentDetails={async (attachment: Attachment) => {
449
+ const result = await saveDocument({
450
+ onFormSave,
451
+ });
452
+
453
+ if (!result.succeed) {
454
+ return;
455
+ }
456
+
408
457
  openDefaultActionForModel({
409
458
  model: "ir.attachment",
410
459
  res_id: attachment.id,
@@ -420,4 +469,17 @@ function separator() {
420
469
  return <div className="inline-block w-2" />;
421
470
  }
422
471
 
472
+ async function saveDocument({
473
+ onFormSave,
474
+ }: {
475
+ onFormSave?: () => Promise<{ succeed: boolean; id: number }>;
476
+ }): Promise<{ succeed: boolean; currentId?: number }> {
477
+ const result = await onFormSave?.();
478
+ if (result?.succeed) {
479
+ return { succeed: true, currentId: result.id };
480
+ } else {
481
+ return { succeed: false, currentId: undefined };
482
+ }
483
+ }
484
+
423
485
  export default FormActionBar;
@@ -30,6 +30,7 @@ import { showLogInfo } from "@/helpers/logInfoHelper";
30
30
  import SearchBar from "./SearchBar";
31
31
  import { ExportModal } from "..";
32
32
  import { mergeParams } from "@/helpers/searchHelper";
33
+ import { ConfigContext } from "@/context/ConfigContext";
33
34
 
34
35
  type Props = {
35
36
  parentContext?: any;
@@ -61,10 +62,11 @@ function TreeActionBar(props: Props) {
61
62
  previousView,
62
63
  results,
63
64
  limit,
65
+ totalItems,
64
66
  } = useContext(ActionViewContext) as ActionViewContextType;
65
67
 
66
68
  const { parentContext = {}, treeExpandable, toolbar } = props;
67
-
69
+ const { previewFeatures } = useContext(ConfigContext);
68
70
  const { t, lang } = useContext(LocaleContext) as LocaleContextType;
69
71
  const contentRootContext = useContext(
70
72
  ContentRootContext
@@ -162,9 +164,24 @@ function TreeActionBar(props: Props) {
162
164
  }
163
165
  }}
164
166
  />
167
+ {!treeExpandable && (
168
+ <ButtonWithBadge
169
+ icon={
170
+ <FilterOutlined
171
+ style={{ color: searchVisible ? "white" : undefined }}
172
+ />
173
+ }
174
+ tooltip={t("advanced_search")}
175
+ type={searchVisible ? "primary" : "default"}
176
+ onClick={() => {
177
+ setSearchVisible?.(!searchVisible);
178
+ }}
179
+ disabled={duplicatingItem || removingItem || treeIsLoading}
180
+ badgeNumber={searchParams?.length}
181
+ />
182
+ )}
165
183
  {separator()}
166
184
  <NewButton disabled={treeIsLoading} />
167
- {separator()}
168
185
  <ActionButton
169
186
  icon={<CopyOutlined />}
170
187
  tooltip={t("duplicate")}
@@ -190,22 +207,6 @@ function TreeActionBar(props: Props) {
190
207
  {separator()}
191
208
  </>
192
209
  )}
193
- {!treeExpandable && (
194
- <ButtonWithBadge
195
- icon={
196
- <FilterOutlined
197
- style={{ color: searchVisible ? "white" : undefined }}
198
- />
199
- }
200
- tooltip={t("advanced_search")}
201
- type={searchVisible ? "primary" : "default"}
202
- onClick={() => {
203
- setSearchVisible?.(!searchVisible);
204
- }}
205
- disabled={duplicatingItem || removingItem || treeIsLoading}
206
- badgeNumber={searchParams?.length}
207
- />
208
- )}
209
210
  <ActionButton
210
211
  icon={<InfoCircleOutlined />}
211
212
  tooltip={t("showLogs")}
@@ -278,89 +279,90 @@ function TreeActionBar(props: Props) {
278
279
  });
279
280
  }}
280
281
  />
281
- {separator()}
282
- <DropdownButton
283
- icon={
284
- <Icon
285
- component={() => (
286
- <svg
287
- xmlns="http://www.w3.org/2000/svg"
288
- className="icon icon-tabler icon-tabler-database-export"
289
- width="1em"
290
- height="1em"
291
- viewBox="0 0 24 24"
292
- stroke-width="1.5"
293
- fill="none"
294
- stroke="currentColor"
295
- stroke-linecap="round"
296
- stroke-linejoin="round"
297
- >
298
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
299
- <ellipse cx="12" cy="6" rx="8" ry="3" />
300
- <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
301
- <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
302
- </svg>
303
- )}
304
- />
305
- }
306
- tooltip={t("export")}
307
- items={[
308
- {
309
- id: "print_screen",
310
- name: t("printScreen"),
311
- },
312
- {
313
- id: "export",
314
- name: t("advancedExport"),
315
- },
316
- ]}
317
- onItemClick={(itemClicked: any) => {
318
- if (itemClicked.id === "print_screen") {
319
- let idsToExport = selectedRowItems?.map((item) => item.id) || [];
320
282
 
321
- if (idsToExport.length === 0) {
322
- idsToExport = results?.map((item) => item.id) || [];
283
+ {previewFeatures && (
284
+ <>
285
+ {separator()}
286
+ <DropdownButton
287
+ icon={
288
+ <Icon
289
+ component={() => (
290
+ <svg
291
+ xmlns="http://www.w3.org/2000/svg"
292
+ className="icon icon-tabler icon-tabler-database-export"
293
+ width="1em"
294
+ height="1em"
295
+ viewBox="0 0 24 24"
296
+ strokeWidth="1.5"
297
+ fill="none"
298
+ stroke="currentColor"
299
+ strokeLinecap="round"
300
+ strokeLinejoin="round"
301
+ >
302
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
303
+ <ellipse cx="12" cy="6" rx="8" ry="3" />
304
+ <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
305
+ <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
306
+ </svg>
307
+ )}
308
+ />
323
309
  }
324
-
325
- runAction({
326
- id: -1,
327
- model: currentModel,
328
- report_name: "printscreen.list",
329
- type: "ir.actions.report.xml",
330
- datas: {
331
- model: currentModel,
332
- ids: idsToExport,
310
+ tooltip={t("export")}
311
+ items={[
312
+ {
313
+ id: "print_screen",
314
+ name: t("printScreen"),
333
315
  },
334
- });
335
- return;
336
- }
316
+ {
317
+ id: "export",
318
+ name: t("advancedExport"),
319
+ },
320
+ ]}
321
+ onItemClick={(itemClicked: any) => {
322
+ if (itemClicked.id === "print_screen") {
323
+ let idsToExport =
324
+ selectedRowItems?.map((item) => item.id) || [];
337
325
 
338
- setExportModalVisible(true);
339
- }}
340
- disabled={
341
- duplicatingItem || removingItem || treeIsLoading || hasNameSearch
342
- }
343
- />
344
- <ExportModal
345
- visible={exportModalVisible}
346
- locale={lang}
347
- onClose={() => setExportModalVisible(false)}
348
- model={currentModel!}
349
- domain={mergeParams(
350
- searchTreeRef?.current?.getDomain() || [],
351
- searchParams || []
352
- )}
353
- limit={limit}
354
- totalRegisters={results?.length || 0}
355
- selectedRegistersToExport={
356
- selectedRowItems &&
357
- selectedRowItems.length &&
358
- selectedRowItems.length > 0
359
- ? selectedRowItems.length
360
- : undefined
361
- }
362
- context={parentContext}
363
- />
326
+ if (idsToExport.length === 0) {
327
+ idsToExport = results?.map((item) => item.id) || [];
328
+ }
329
+
330
+ runAction({
331
+ id: -1,
332
+ model: currentModel,
333
+ report_name: "printscreen.list",
334
+ type: "ir.actions.report.xml",
335
+ datas: {
336
+ model: currentModel,
337
+ ids: idsToExport,
338
+ },
339
+ });
340
+ return;
341
+ }
342
+
343
+ setExportModalVisible(true);
344
+ }}
345
+ disabled={
346
+ duplicatingItem || removingItem || treeIsLoading || hasNameSearch
347
+ }
348
+ />
349
+ <ExportModal
350
+ visible={exportModalVisible}
351
+ locale={lang}
352
+ onClose={() => setExportModalVisible(false)}
353
+ model={currentModel!}
354
+ domain={mergeParams(
355
+ searchTreeRef?.current?.getDomain() || [],
356
+ searchParams || []
357
+ )}
358
+ limit={limit}
359
+ totalRegisters={totalItems || 0}
360
+ selectedRegistersToExport={selectedRowItems}
361
+ visibleRegisters={results?.length || 0}
362
+ context={parentContext}
363
+ />
364
+ </>
365
+ )}
364
366
  </Space>
365
367
  );
366
368
  }
@@ -1,28 +1,29 @@
1
- import { DatePicker as AntDatePicker } from "antd";
1
+ import { DatePicker as AntDatePicker, theme } from "antd";
2
2
 
3
3
  import React from "react";
4
4
  import Field from "@/common/Field";
5
5
  import { WidgetProps } from "@/types";
6
- import Config from "@/Config";
7
6
  import { Date as DateOoui } from "@gisce/ooui";
8
- import moment from "moment";
7
+ import dayjs from "dayjs";
8
+ const { useToken } = theme;
9
9
 
10
10
  type DatePickerProps = WidgetProps & {
11
11
  showTime?: boolean;
12
12
  };
13
13
 
14
- const DatePickerConfig = {
14
+ export const DatePickerConfig = {
15
15
  date: {
16
16
  placeholder: "__/__/____",
17
- dateDisplayFormat: "YYYY-MM-DD",
17
+ dateDisplayFormat: "DD/MM/YYYY",
18
18
  dateInternalFormat: "YYYY-MM-DD",
19
19
  },
20
20
  time: {
21
21
  placeholder: "__/__/____ __:__:__",
22
- dateDisplayFormat: "YYYY-MM-DD HH:mm:ss",
22
+ dateDisplayFormat: "DD/MM/YYYY HH:mm:ss",
23
23
  dateInternalFormat: "YYYY-MM-DD HH:mm:ss",
24
24
  },
25
25
  };
26
+
26
27
  const DatePicker = (props: DatePickerProps) => {
27
28
  const { ooui, showTime = false } = props;
28
29
  const { required } = ooui;
@@ -46,8 +47,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
46
47
  ) => {
47
48
  const { value, onChange, ooui, showTime } = props;
48
49
  const { id, readOnly, required } = ooui as DateOoui;
49
- const requiredClass =
50
- required && !readOnly ? Config.requiredClass : undefined;
50
+ const { token } = useToken();
51
+
52
+ const requiredStyle =
53
+ required && !readOnly
54
+ ? { backgroundColor: token.colorPrimaryBg }
55
+ : undefined;
51
56
 
52
57
  const mode = showTime ? "time" : "date";
53
58
 
@@ -65,15 +70,15 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
65
70
  };
66
71
 
67
72
  const showTimeParms = showTime
68
- ? { defaultValue: moment("00:00:00", "HH:mm:ss") }
73
+ ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") }
69
74
  : undefined;
70
75
  const dateValue = value
71
- ? moment(value, DatePickerConfig[mode].dateInternalFormat)
76
+ ? dayjs(value, DatePickerConfig[mode].dateInternalFormat)
72
77
  : undefined;
73
78
 
74
79
  return (
75
80
  <AntDatePicker
76
- style={{ width: "100%" }}
81
+ style={{ width: "100%", ...requiredStyle }}
77
82
  placeholder={
78
83
  showTime
79
84
  ? DatePickerConfig.time.placeholder
@@ -81,12 +86,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
81
86
  }
82
87
  disabled={readOnly}
83
88
  id={id}
89
+ picker={showTime ? "time" : "date"}
84
90
  showTime={showTimeParms}
85
- className={requiredClass}
86
91
  format={DatePickerConfig[mode].dateDisplayFormat}
87
92
  value={dateValue}
88
93
  onChange={onValueStringChange}
89
- ></AntDatePicker>
94
+ />
90
95
  );
91
96
  };
92
97
 
@@ -11,7 +11,7 @@ export type ActionViewContextType = {
11
11
  setFormIsSaving?: (value: boolean) => void;
12
12
  formHasChanges?: boolean;
13
13
  setFormHasChanges?: (value: boolean) => void;
14
- onFormSave?: () => void;
14
+ onFormSave?: () => Promise<{ succeed: boolean; id: number }>;
15
15
  formRef?: any;
16
16
  searchTreeRef?: any;
17
17
  onNewClicked: () => void;
@@ -53,6 +53,7 @@ export type ActionViewContextType = {
53
53
  setSearchValues?: (value: any) => void;
54
54
  limit?: number;
55
55
  setLimit?: (value: number) => void;
56
+ setTitle?: (value: string) => void;
56
57
  };
57
58
 
58
59
  export const ActionViewContext =
@@ -66,7 +67,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
66
67
  const {
67
68
  children,
68
69
  currentView,
69
- title,
70
+ title: titleProps,
70
71
  setCurrentView,
71
72
  availableViews,
72
73
  formRef,
@@ -106,6 +107,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
106
107
  const [limit, setLimit] = useState<number>(
107
108
  limitProps !== undefined ? limitProps : DEFAULT_SEARCH_LIMIT
108
109
  );
110
+ const [title, setTitle] = useState<string>(titleProps);
109
111
 
110
112
  useEffect(() => {
111
113
  if (results && results.length > 0 && !currentItemIndex) {
@@ -139,8 +141,8 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
139
141
  }
140
142
  }, [currentView]);
141
143
 
142
- const callOnFormSave = () => {
143
- (formRef.current as any)?.submitForm();
144
+ const callOnFormSave = async () => {
145
+ return await (formRef.current as any)?.submitForm();
144
146
  };
145
147
 
146
148
  return (
@@ -196,6 +198,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
196
198
  setSearchValues,
197
199
  limit,
198
200
  setLimit,
201
+ setTitle,
199
202
  }}
200
203
  >
201
204
  {children}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+
3
+ interface ConfigContextProps {
4
+ previewFeatures: boolean;
5
+ }
6
+
7
+ export const ConfigContext = React.createContext<ConfigContextProps>({
8
+ previewFeatures: false,
9
+ });