@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
@@ -0,0 +1,22 @@
1
+ import Field from "@/common/Field";
2
+ import ReactMarkdown from "react-markdown";
3
+ import React from "react";
4
+ import {WidgetProps} from "@/types";
5
+
6
+ export const Markdown = (props: WidgetProps) => {
7
+ return (
8
+ <Field {...props}>
9
+ <MarkdownInput {...props} />
10
+ </Field>
11
+ );
12
+ };
13
+
14
+ export const MarkdownInput = (props: any) => {
15
+ const {value, ooui} = props;
16
+ return (
17
+ <div style={{height: ooui.height ? ooui.height + 'px' : '100%', overflow: 'auto'}}>
18
+ <ReactMarkdown children={value} className="ant-typography"/>
19
+ </div>
20
+
21
+ )
22
+ }
@@ -62,6 +62,7 @@ export const MultiCheckboxInput = (props: MultiCheckboxInputProps) => {
62
62
  fields: formContext?.getFields(),
63
63
  values: formContext.getPlainValues(),
64
64
  }),
65
+ fields: formContext?.getFields(),
65
66
  context: formContext.getContext(),
66
67
  });
67
68
  params = [...params, ...evaluatedDomain];
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import Field from "@/common/Field";
3
+ import { WidgetProps } from "@/types";
4
+ import { Tag as AntdTag } from 'antd';
5
+ import { colorFromString } from "@/helpers/formHelper";
6
+
7
+ export const Tag = (props: WidgetProps) => {
8
+ return (
9
+ <Field {...props}>
10
+ <TagInput {...props}/>
11
+ </Field>
12
+ );
13
+ };
14
+
15
+ export const TagInput = (props: any) => {
16
+ const {ooui, value} = props;
17
+ if (!value) {
18
+ return null
19
+ }
20
+ const color = ooui.colors === "auto" ? colorFromString(value) : ooui.colors[value]
21
+ return (
22
+ <AntdTag color={color}>{ooui.selectionValues.get(value)}</AntdTag>
23
+ );
24
+ }
@@ -23,7 +23,7 @@ export const Tags = (props: TagsProps) => {
23
23
 
24
24
  return (
25
25
  <Field type={"array"} {...props}>
26
- <TagsInput ooui={ooui} />
26
+ <TagsInput ooui={ooui} />
27
27
  </Field>
28
28
  );
29
29
  };
@@ -31,16 +31,15 @@ export const Tags = (props: TagsProps) => {
31
31
  export const TagsInput = (props: TagsInputProps) => {
32
32
  const { value, ooui, onChange } = props;
33
33
  const { items = [] } = value || {};
34
- const itemsToShow = items.filter(
35
- (item) => item.operation !== "pendingRemove"
36
- ).map((item) => item.id) as number[];
34
+ const itemsToShow = items
35
+ .filter((item) => item.operation !== "pendingRemove")
36
+ .map((item) => item.id) as number[];
37
37
 
38
38
  const [options, setOptions] = useState<any[]>([]);
39
39
  const [error, setError] = useState<string>();
40
40
  const [isLoadingOptions, setIsLoadingOptions] = useState<boolean>(false);
41
41
  const { relation, context, readOnly, field } = ooui;
42
42
 
43
-
44
43
  const formContext = useContext(FormContext) as FormContextType;
45
44
  const { getContext } = formContext || {};
46
45
 
@@ -62,16 +61,16 @@ export const TagsInput = (props: TagsInputProps) => {
62
61
  params = [["id", "in", itemsToShow]];
63
62
  }
64
63
  if (ooui.domain) {
65
- const evaluatedDomain = await ConnectionProvider.getHandler().evalDomain(
66
- {
64
+ const evaluatedDomain =
65
+ await ConnectionProvider.getHandler().evalDomain({
67
66
  domain: ooui.domain,
68
67
  values: transformPlainMany2Ones({
69
68
  fields: formContext?.getFields(),
70
69
  values: formContext.getPlainValues(),
71
70
  }),
72
- context: formContext.getContext(),
73
- }
74
- );
71
+ fields: formContext?.getFields(),
72
+ context: formContext.getContext(),
73
+ });
75
74
  params = [...params, ...evaluatedDomain];
76
75
  }
77
76
 
@@ -81,18 +80,17 @@ export const TagsInput = (props: TagsInputProps) => {
81
80
  fields: [field],
82
81
  context: { ...getContext?.(), ...context },
83
82
  });
84
- const options = optionsRead.map((item:any) => {
83
+ const options = optionsRead.map((item: any) => {
85
84
  const value = item[field];
86
85
  let formattedValue = value;
87
86
  if (Array.isArray(value)) {
88
87
  formattedValue = value[1];
89
88
  }
90
- return {label: formattedValue, value: item.id}
89
+ return { label: formattedValue, value: item.id };
91
90
  });
92
91
  setOptions(options);
93
-
94
92
  } catch (err) {
95
- setError(err as any)
93
+ setError(err as any);
96
94
  } finally {
97
95
  setIsLoadingOptions(false);
98
96
  }
@@ -104,19 +102,21 @@ export const TagsInput = (props: TagsInputProps) => {
104
102
  if (item.operation == "pendingRemove") {
105
103
  return {
106
104
  ...item,
107
- operation: "pendingLink"
108
- }
105
+ operation: "pendingLink",
106
+ };
109
107
  } else {
110
- return item
108
+ return item;
111
109
  }
112
110
  } else {
113
- return {id: item.id, operation: 'pendingRemove'}
111
+ return { id: item.id, operation: "pendingRemove" };
114
112
  }
115
- })
116
- const currentIds = newItems.map(item => item.id)
117
- ids.filter(id => !currentIds.includes(id)).map((id) => {
118
- newItems.push({id, operation: 'pendingLink'});
119
113
  });
114
+ const currentIds = newItems.map((item) => item.id);
115
+ ids
116
+ .filter((id) => !currentIds.includes(id))
117
+ .map((id) => {
118
+ newItems.push({ id, operation: "pendingLink" });
119
+ });
120
120
  triggerChange(newItems);
121
121
  };
122
122
 
@@ -130,10 +130,11 @@ export const TagsInput = (props: TagsInputProps) => {
130
130
  <AntTag
131
131
  color={colorFromString(label)}
132
132
  onMouseDown={onPreventMouseDown}
133
- style={{margin: '5px'}}
133
+ style={{ margin: "5px" }}
134
134
  closable={closable}
135
- onClose={onClose}>
136
- {label}
135
+ onClose={onClose}
136
+ >
137
+ {label}
137
138
  </AntTag>
138
139
  );
139
140
  };
@@ -154,10 +155,8 @@ export const TagsInput = (props: TagsInputProps) => {
154
155
  options={options}
155
156
  onChange={onChangeSelected}
156
157
  loading={isLoadingOptions}
157
- >
158
- </Select>
158
+ ></Select>
159
159
  </div>
160
160
  </>
161
161
  );
162
-
163
162
  };
@@ -105,12 +105,18 @@ export const TimelineInput = (props: TimelineInputProps) => {
105
105
  setError(undefined);
106
106
 
107
107
  try {
108
- const itemsWithValues = await readObjectValues({
109
- treeFields: views.get("tree").fields,
110
- formFields: views.get("form").fields,
108
+ const [itemsWithValues] = await readObjectValues({
109
+ treeView: {
110
+ fields: views.get("tree").fields,
111
+ arch: views.get("tree").arch
112
+ },
113
+ formView: {
114
+ fields: views.get("form").fields,
115
+ },
111
116
  model: relation,
112
117
  items,
113
118
  context: { ...getContext?.(), ...context },
119
+ currentView: "form",
114
120
  });
115
121
 
116
122
  triggerChange(itemsWithValues);
@@ -3,22 +3,20 @@ import {
3
3
  ExportModal as ExportModalFmg,
4
4
  Locale,
5
5
  } from "@gisce/react-formiga-components";
6
- import { ExportOptions } from "@gisce/react-formiga-components/dist/components/other/ExportModal/ExportModal.types";
7
- import React, { useCallback, useRef } from "react";
8
- import showInfo from "@/ui/InfoDialog";
9
- import { tForLang } from "@/context/LocaleContext";
10
- import { getMimeType, openBase64InNewTab } from "@/helpers/filesHelper";
6
+ import React from "react";
7
+ import { useExport } from "@/hooks/useExport";
11
8
 
12
9
  export type ExportModalProps = {
13
10
  visible: boolean;
14
11
  locale: string;
15
12
  onClose: () => void;
16
- selectedRegistersToExport?: number;
13
+ selectedRegistersToExport?: any[];
17
14
  totalRegisters: number;
18
15
  model: string;
19
16
  domain: any[];
20
17
  limit?: number;
21
18
  context?: any;
19
+ visibleRegisters: number;
22
20
  };
23
21
 
24
22
  export const ExportModal = (props: ExportModalProps) => {
@@ -32,145 +30,46 @@ export const ExportModal = (props: ExportModalProps) => {
32
30
  totalRegisters,
33
31
  domain,
34
32
  limit,
33
+ visibleRegisters,
35
34
  } = props;
36
- const fields = useRef<any>({});
37
35
 
38
- const onSucceed = useCallback(
39
- async (options: ExportOptions) => {
40
- if (options.selectedKeys.length === 0) {
41
- showInfo(tForLang("selectAtLeastOneField", locale));
42
- return;
43
- }
44
-
45
- const { datas } = await ConnectionProvider.getHandler().exportData({
46
- model,
47
- fields: options.selectedKeys,
48
- domain: options.registersAmount === "all" ? [] : domain,
49
- limit: options.registersAmount === "all" ? undefined : limit,
50
- context,
51
- format: options.exportType,
52
- });
53
-
54
- onClose();
55
-
56
- await new Promise((resolve) => setTimeout(resolve, 200));
57
-
58
- const fileType: any = await getMimeType(datas);
59
- openBase64InNewTab(datas, fileType.mime);
60
- },
61
- [locale, model, domain, limit, context, onClose]
62
- );
63
-
64
- const onGetFields = useCallback(async () => {
65
- const viewData = await ConnectionProvider.getHandler().getFields({
66
- model,
67
- context,
68
- fields: [],
69
- });
70
- fields.current["/"] = viewData;
71
- return convertToExportField({ fields: viewData });
72
- }, [model, context, fields]);
73
-
74
- const onGetFieldChilds = useCallback(
75
- async ({ key, title }: any) => {
76
- let fieldDefinition;
77
-
78
- const sanitizedKey =
79
- key.split("/")[key.split("/").length - 1] === "id"
80
- ? key.split("/").slice(0, -1).join("/")
81
- : key;
82
-
83
- if (sanitizedKey.indexOf("/") === -1) {
84
- fieldDefinition = fields.current["/"];
85
- } else {
86
- fieldDefinition = fields.current[getParentKey(sanitizedKey)];
87
- }
88
-
89
- const optsForField = fieldDefinition[getChildKey(sanitizedKey)];
90
- const relation = optsForField.relation;
91
- const viewData = await ConnectionProvider.getHandler().getFields({
92
- model: relation,
93
- context,
94
- fields: [],
95
- });
96
-
97
- fields.current[sanitizedKey] = viewData;
98
-
99
- return convertToExportField({
100
- fields: viewData,
101
- parentTitle: title,
102
- parentKey: sanitizedKey,
103
- });
104
- },
105
- [fields, model, context]
106
- );
36
+ const {
37
+ onExport,
38
+ onGetFieldChilds,
39
+ onGetFields,
40
+ onGetPredefinedExports,
41
+ onSavePredefinedExport,
42
+ onRemovePredefinedExport,
43
+ } = useExport({
44
+ model,
45
+ context,
46
+ domain,
47
+ limit,
48
+ selectedRegistersToExport,
49
+ onClose,
50
+ locale,
51
+ });
107
52
 
108
53
  return (
109
54
  <ExportModalFmg
110
55
  visible={visible}
111
56
  locale={locale as Locale}
112
- onSucceed={onSucceed}
57
+ onSucceed={onExport}
113
58
  onCancel={onClose}
114
- selectedRegistersToExport={selectedRegistersToExport}
59
+ selectedRegistersToExport={
60
+ selectedRegistersToExport &&
61
+ selectedRegistersToExport.length &&
62
+ selectedRegistersToExport.length > 0
63
+ ? selectedRegistersToExport.length
64
+ : undefined
65
+ }
115
66
  totalRegisters={totalRegisters}
116
67
  onGetFieldChilds={onGetFieldChilds}
117
68
  onGetFields={onGetFields}
69
+ visibleRegisters={visibleRegisters}
70
+ onGetPredefinedExports={onGetPredefinedExports}
71
+ onSavePredefinedExport={onSavePredefinedExport}
72
+ onRemovePredefinedExport={onRemovePredefinedExport}
118
73
  />
119
74
  );
120
75
  };
121
-
122
- const convertToExportField = ({
123
- fields,
124
- parentKey,
125
- parentTitle,
126
- }: {
127
- fields: any;
128
- parentTitle?: string;
129
- parentKey?: string;
130
- }) => {
131
- const exportFields = [];
132
-
133
- for (const key of Object.keys(fields)) {
134
- const valuesForField = fields[key];
135
-
136
- if (valuesForField.relation && valuesForField.is_function === true) {
137
- continue;
138
- }
139
-
140
- const relationField =
141
- valuesForField.type === "many2one" ||
142
- valuesForField.type === "one2many" ||
143
- valuesForField.type === "many2many";
144
-
145
- let newKey = `${parentKey ? parentKey + "/" : ""}${key}`;
146
-
147
- if (relationField) {
148
- newKey += "/id";
149
- }
150
-
151
- exportFields.push({
152
- key: newKey,
153
- title: `${parentTitle ? parentTitle + "/" : ""}${valuesForField.string}`,
154
- tooltip: valuesForField.help,
155
- required: valuesForField.required,
156
- isLeaf: !relationField,
157
- });
158
- }
159
- return exportFields;
160
- };
161
-
162
- const getParentKey = (key: string) => {
163
- if (key.indexOf("/") === -1) {
164
- return key;
165
- }
166
- const items = key.split("/");
167
- return items.slice(0, -1).join("/");
168
- };
169
-
170
- const getChildKey = (key: string) => {
171
- if (key.indexOf("/") === -1) {
172
- return key;
173
- }
174
- const items = key.split("/");
175
- return items[items.length - 1];
176
- };
@@ -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