@gisce/react-ooui 1.5.1 → 2.0.0-alpha.1

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 (392) hide show
  1. package/package.json +73 -42
  2. package/src/actionbar/FormActionBar.tsx +1 -1
  3. package/src/actionbar/TreeActionBar.tsx +1 -1
  4. package/src/common/DatePicker.tsx +2 -2
  5. package/src/common/SelectAllRecordsRow.tsx +4 -5
  6. package/src/context/ContentRootContext.tsx +61 -54
  7. package/src/context/TabManagerContext.tsx +3 -4
  8. package/src/helpers/dynamicColumnsHelper.ts +1 -1
  9. package/src/helpers/filesHelper.ts +7 -7
  10. package/src/helpers/formHelper.ts +23 -24
  11. package/src/helpers/one2manyHelper.ts +6 -6
  12. package/src/helpers/searchHelper.ts +8 -5
  13. package/src/helpers/treeHelper.ts +7 -7
  14. package/src/helpers/viewHelper.ts +2 -2
  15. package/src/hooks/useExport.ts +2 -3
  16. package/src/hooks/useSearch.ts +8 -8
  17. package/src/index.ts +4 -0
  18. package/src/stories/Binary.stories.tsx +0 -3
  19. package/src/stories/Boolean.stories.tsx +0 -3
  20. package/src/stories/Button.stories.tsx +8 -14
  21. package/src/stories/Char.stories.tsx +0 -3
  22. package/src/stories/FiberGrid.stories.tsx +0 -3
  23. package/src/stories/Float.stories.tsx +0 -3
  24. package/src/stories/FloatTime.stories.tsx +0 -3
  25. package/src/stories/Image.stories.tsx +0 -3
  26. package/src/stories/Integer.stories.tsx +0 -3
  27. package/src/stories/Label.stories.tsx +0 -3
  28. package/src/stories/Many2one.stories.tsx +0 -3
  29. package/src/stories/One2many.stories.tsx +4 -11
  30. package/src/stories/ProgressBar.stories.tsx +0 -3
  31. package/src/stories/Reference.stories.tsx +0 -3
  32. package/src/stories/Selection.stories.tsx +0 -3
  33. package/src/stories/Separator.stories.tsx +3 -7
  34. package/src/stories/Text.stories.tsx +0 -3
  35. package/src/stories/containers/Group.stories.tsx +0 -5
  36. package/src/stories/containers/NewLine.stories.tsx +0 -4
  37. package/src/stories/containers/Notebook.stories.tsx +0 -5
  38. package/src/stories/custom/Avatar.stories.tsx +0 -1
  39. package/src/stories/custom/ButtonGroup.stories.tsx +36 -23
  40. package/src/stories/custom/CodeEditor.stories.tsx +1 -4
  41. package/src/stories/custom/Indicator.stories.tsx +3 -11
  42. package/src/stories/custom/Markdown.stories.tsx +2 -6
  43. package/src/stories/custom/MultiCheckbox.stories.tsx +20 -15
  44. package/src/stories/custom/Radio.stories.tsx +13 -16
  45. package/src/stories/custom/Steps.stories.tsx +7 -5
  46. package/src/stories/custom/Switch.stories.tsx +0 -3
  47. package/src/stories/custom/Tag.stories.tsx +17 -11
  48. package/src/stories/custom/Tags.stories.tsx +20 -16
  49. package/src/stories/forms/PreferencesForm.stories.tsx +0 -4
  50. package/src/stories/ui/ActionBar.stories.tsx +0 -3
  51. package/src/stories/ui/FavouriteButton.stories.tsx +0 -3
  52. package/src/stories/ui/GoToResourceModal.stories.tsx +0 -3
  53. package/src/stories/views/SearchTree.stories.tsx +43 -89
  54. package/src/stories/views/Tab.stories.tsx +0 -3
  55. package/src/stories/views/TabsAndContent.stories.tsx +0 -3
  56. package/src/stories/views/Tree.stories.jsx +0 -4
  57. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +0 -3
  58. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +0 -3
  59. package/src/stories/views/searchFilter/PairFields.stories.tsx +0 -3
  60. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +0 -4
  61. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +0 -4
  62. package/src/types/index.ts +94 -43
  63. package/src/ui/FavouriteButton.tsx +2 -3
  64. package/src/views/ActionView.tsx +12 -11
  65. package/src/views/RootView.tsx +5 -6
  66. package/src/widgets/base/Binary.tsx +2 -2
  67. package/src/widgets/base/Boolean.tsx +1 -2
  68. package/src/widgets/base/Float.tsx +1 -1
  69. package/src/widgets/base/Integer.tsx +2 -2
  70. package/src/widgets/base/Label.tsx +9 -9
  71. package/src/widgets/base/LinkInput.tsx +6 -1
  72. package/src/widgets/base/MultiSelection.tsx +1 -2
  73. package/src/widgets/base/Selection.tsx +11 -5
  74. package/src/widgets/base/Time.tsx +13 -12
  75. package/src/widgets/base/many2one/Many2one.tsx +7 -8
  76. package/src/widgets/base/many2one/Many2oneSuffix.tsx +23 -12
  77. package/src/widgets/base/one2many/One2manyInput.tsx +13 -14
  78. package/src/widgets/containers/Notebook.tsx +9 -2
  79. package/src/widgets/custom/ButtonGroup.tsx +13 -10
  80. package/src/widgets/custom/CodeEditor.tsx +7 -3
  81. package/src/widgets/custom/Comments.tsx +76 -70
  82. package/src/widgets/custom/Indicator.tsx +1 -2
  83. package/src/widgets/custom/MultiCheckbox.tsx +2 -2
  84. package/src/widgets/custom/Tag.tsx +20 -16
  85. package/src/widgets/custom/Tags.tsx +3 -3
  86. package/src/widgets/custom/Timeline.tsx +6 -6
  87. package/src/widgets/views/Dashboard/DashboardTree.tsx +2 -2
  88. package/src/widgets/views/DashboardGrid/DashboardGrid.types.ts +1 -1
  89. package/src/widgets/views/Form.tsx +9 -10
  90. package/src/widgets/views/Graph/GraphIndicator.tsx +7 -7
  91. package/src/widgets/views/SearchTree.tsx +2 -2
  92. package/src/widgets/views/Tree.tsx +15 -16
  93. package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +1 -3
  94. package/dist/ConnectionProvider.d.ts +0 -7
  95. package/dist/ConnectionProvider.d.ts.map +0 -1
  96. package/dist/actionbar/ActionButton.d.ts +0 -13
  97. package/dist/actionbar/ActionButton.d.ts.map +0 -1
  98. package/dist/actionbar/AttachmentsButton.d.ts +0 -12
  99. package/dist/actionbar/AttachmentsButton.d.ts.map +0 -1
  100. package/dist/actionbar/AttachmentsButtonWrapper.d.ts +0 -19
  101. package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +0 -1
  102. package/dist/actionbar/ButtonWithBadge.d.ts +0 -8
  103. package/dist/actionbar/ButtonWithBadge.d.ts.map +0 -1
  104. package/dist/actionbar/ChangeViewButton.d.ts +0 -13
  105. package/dist/actionbar/ChangeViewButton.d.ts.map +0 -1
  106. package/dist/actionbar/DashboardActionBar.d.ts +0 -4
  107. package/dist/actionbar/DashboardActionBar.d.ts.map +0 -1
  108. package/dist/actionbar/DropdownButton.d.ts +0 -12
  109. package/dist/actionbar/DropdownButton.d.ts.map +0 -1
  110. package/dist/actionbar/FormActionBar.d.ts +0 -6
  111. package/dist/actionbar/FormActionBar.d.ts.map +0 -1
  112. package/dist/actionbar/GraphActionBar.d.ts +0 -6
  113. package/dist/actionbar/GraphActionBar.d.ts.map +0 -1
  114. package/dist/actionbar/NewButton.d.ts +0 -7
  115. package/dist/actionbar/NewButton.d.ts.map +0 -1
  116. package/dist/actionbar/SearchBar.d.ts +0 -9
  117. package/dist/actionbar/SearchBar.d.ts.map +0 -1
  118. package/dist/actionbar/TreeActionBar.d.ts +0 -9
  119. package/dist/actionbar/TreeActionBar.d.ts.map +0 -1
  120. package/dist/common/ButtonWithTooltip.d.ts +0 -8
  121. package/dist/common/ButtonWithTooltip.d.ts.map +0 -1
  122. package/dist/common/DatePicker.d.ts +0 -20
  123. package/dist/common/DatePicker.d.ts.map +0 -1
  124. package/dist/common/Field.d.ts +0 -14
  125. package/dist/common/Field.d.ts.map +0 -1
  126. package/dist/common/SelectAllRecordsRow.d.ts +0 -10
  127. package/dist/common/SelectAllRecordsRow.d.ts.map +0 -1
  128. package/dist/context/ActionViewContext.d.ts +0 -65
  129. package/dist/context/ActionViewContext.d.ts.map +0 -1
  130. package/dist/context/ConfigContext.d.ts +0 -7
  131. package/dist/context/ConfigContext.d.ts.map +0 -1
  132. package/dist/context/ContentRootContext.d.ts +0 -19
  133. package/dist/context/ContentRootContext.d.ts.map +0 -1
  134. package/dist/context/DashboardActionContext.d.ts +0 -19
  135. package/dist/context/DashboardActionContext.d.ts.map +0 -1
  136. package/dist/context/FormContext.d.ts +0 -35
  137. package/dist/context/FormContext.d.ts.map +0 -1
  138. package/dist/context/FormModalContext.d.ts +0 -11
  139. package/dist/context/FormModalContext.d.ts.map +0 -1
  140. package/dist/context/LocaleContext.d.ts +0 -14
  141. package/dist/context/LocaleContext.d.ts.map +0 -1
  142. package/dist/context/One2manyContext.d.ts +0 -17
  143. package/dist/context/One2manyContext.d.ts.map +0 -1
  144. package/dist/context/TabManagerContext.d.ts +0 -50
  145. package/dist/context/TabManagerContext.d.ts.map +0 -1
  146. package/dist/helpers/containerHelper.d.ts +0 -22
  147. package/dist/helpers/containerHelper.d.ts.map +0 -1
  148. package/dist/helpers/dynamicColumnsHelper.d.ts +0 -8
  149. package/dist/helpers/dynamicColumnsHelper.d.ts.map +0 -1
  150. package/dist/helpers/errorHelper.d.ts +0 -6
  151. package/dist/helpers/errorHelper.d.ts.map +0 -1
  152. package/dist/helpers/filesHelper.d.ts +0 -8
  153. package/dist/helpers/filesHelper.d.ts.map +0 -1
  154. package/dist/helpers/formHelper.d.ts +0 -36
  155. package/dist/helpers/formHelper.d.ts.map +0 -1
  156. package/dist/helpers/iconMapper.d.ts +0 -13
  157. package/dist/helpers/iconMapper.d.ts.map +0 -1
  158. package/dist/helpers/logInfoHelper.d.ts +0 -3
  159. package/dist/helpers/logInfoHelper.d.ts.map +0 -1
  160. package/dist/helpers/one2manyHelper.d.ts +0 -37
  161. package/dist/helpers/one2manyHelper.d.ts.map +0 -1
  162. package/dist/helpers/searchHelper.d.ts +0 -6
  163. package/dist/helpers/searchHelper.d.ts.map +0 -1
  164. package/dist/helpers/timeHelper.d.ts +0 -4
  165. package/dist/helpers/timeHelper.d.ts.map +0 -1
  166. package/dist/helpers/treeHelper.d.ts +0 -23
  167. package/dist/helpers/treeHelper.d.ts.map +0 -1
  168. package/dist/helpers/viewHelper.d.ts +0 -10
  169. package/dist/helpers/viewHelper.d.ts.map +0 -1
  170. package/dist/hooks/useExport.d.ts +0 -44
  171. package/dist/hooks/useExport.d.ts.map +0 -1
  172. package/dist/hooks/useSearch.d.ts +0 -56
  173. package/dist/hooks/useSearch.d.ts.map +0 -1
  174. package/dist/hooks/useWindowDimensions.d.ts +0 -7
  175. package/dist/hooks/useWindowDimensions.d.ts.map +0 -1
  176. package/dist/index.d.ts +0 -57
  177. package/dist/index.d.ts.map +0 -1
  178. package/dist/locales/ca_ES.d.ts +0 -93
  179. package/dist/locales/ca_ES.d.ts.map +0 -1
  180. package/dist/locales/en_US.d.ts +0 -93
  181. package/dist/locales/en_US.d.ts.map +0 -1
  182. package/dist/locales/es_ES.d.ts +0 -93
  183. package/dist/locales/es_ES.d.ts.map +0 -1
  184. package/dist/react-ooui.es.js +0 -11763
  185. package/dist/react-ooui.es.js.map +0 -1
  186. package/dist/react-ooui.umd.js +0 -42
  187. package/dist/react-ooui.umd.js.map +0 -1
  188. package/dist/style.css +0 -1
  189. package/dist/types/index.d.ts +0 -256
  190. package/dist/types/index.d.ts.map +0 -1
  191. package/dist/ui/ActionErrorDialog.d.ts +0 -3
  192. package/dist/ui/ActionErrorDialog.d.ts.map +0 -1
  193. package/dist/ui/ConfirmDialog.d.ts +0 -7
  194. package/dist/ui/ConfirmDialog.d.ts.map +0 -1
  195. package/dist/ui/ErrorAlert.d.ts +0 -6
  196. package/dist/ui/ErrorAlert.d.ts.map +0 -1
  197. package/dist/ui/FavouriteButton.d.ts +0 -26
  198. package/dist/ui/FavouriteButton.d.ts.map +0 -1
  199. package/dist/ui/FormErrorsDialog.d.ts +0 -3
  200. package/dist/ui/FormErrorsDialog.d.ts.map +0 -1
  201. package/dist/ui/GenericErrorDialog.d.ts +0 -3
  202. package/dist/ui/GenericErrorDialog.d.ts.map +0 -1
  203. package/dist/ui/GoToResourceModal.d.ts +0 -10
  204. package/dist/ui/GoToResourceModal.d.ts.map +0 -1
  205. package/dist/ui/InfoDialog.d.ts +0 -3
  206. package/dist/ui/InfoDialog.d.ts.map +0 -1
  207. package/dist/ui/RefreshItemDialog.d.ts +0 -7
  208. package/dist/ui/RefreshItemDialog.d.ts.map +0 -1
  209. package/dist/ui/RemoveItemDialog.d.ts +0 -6
  210. package/dist/ui/RemoveItemDialog.d.ts.map +0 -1
  211. package/dist/ui/TitleHeader.d.ts +0 -8
  212. package/dist/ui/TitleHeader.d.ts.map +0 -1
  213. package/dist/ui/UnlinkItemDialog.d.ts +0 -6
  214. package/dist/ui/UnlinkItemDialog.d.ts.map +0 -1
  215. package/dist/ui/UnsavedChangesDialog.d.ts +0 -7
  216. package/dist/ui/UnsavedChangesDialog.d.ts.map +0 -1
  217. package/dist/ui/WarningDialog.d.ts +0 -3
  218. package/dist/ui/WarningDialog.d.ts.map +0 -1
  219. package/dist/views/ActionView.d.ts +0 -22
  220. package/dist/views/ActionView.d.ts.map +0 -1
  221. package/dist/views/CurrentTabContent.d.ts +0 -4
  222. package/dist/views/CurrentTabContent.d.ts.map +0 -1
  223. package/dist/views/RootView.d.ts +0 -14
  224. package/dist/views/RootView.d.ts.map +0 -1
  225. package/dist/views/TabContent.d.ts +0 -8
  226. package/dist/views/TabContent.d.ts.map +0 -1
  227. package/dist/views/TabSelector.d.ts +0 -4
  228. package/dist/views/TabSelector.d.ts.map +0 -1
  229. package/dist/views/Welcome.d.ts +0 -4
  230. package/dist/views/Welcome.d.ts.map +0 -1
  231. package/dist/views/actionViews/DashboardActionView.d.ts +0 -7
  232. package/dist/views/actionViews/DashboardActionView.d.ts.map +0 -1
  233. package/dist/views/actionViews/FormActionView.d.ts +0 -18
  234. package/dist/views/actionViews/FormActionView.d.ts.map +0 -1
  235. package/dist/views/actionViews/GraphActionView.d.ts +0 -13
  236. package/dist/views/actionViews/GraphActionView.d.ts.map +0 -1
  237. package/dist/views/actionViews/TreeActionView.d.ts +0 -20
  238. package/dist/views/actionViews/TreeActionView.d.ts.map +0 -1
  239. package/dist/views/tabs/Tab.d.ts +0 -11
  240. package/dist/views/tabs/Tab.d.ts.map +0 -1
  241. package/dist/widgets/WidgetFactory.d.ts +0 -4
  242. package/dist/widgets/WidgetFactory.d.ts.map +0 -1
  243. package/dist/widgets/base/Binary.d.ts +0 -14
  244. package/dist/widgets/base/Binary.d.ts.map +0 -1
  245. package/dist/widgets/base/Boolean.d.ts +0 -4
  246. package/dist/widgets/base/Boolean.d.ts.map +0 -1
  247. package/dist/widgets/base/Button.d.ts +0 -8
  248. package/dist/widgets/base/Button.d.ts.map +0 -1
  249. package/dist/widgets/base/Char.d.ts +0 -8
  250. package/dist/widgets/base/Char.d.ts.map +0 -1
  251. package/dist/widgets/base/Date.d.ts +0 -5
  252. package/dist/widgets/base/Date.d.ts.map +0 -1
  253. package/dist/widgets/base/DateTime.d.ts +0 -5
  254. package/dist/widgets/base/DateTime.d.ts.map +0 -1
  255. package/dist/widgets/base/Email.d.ts +0 -4
  256. package/dist/widgets/base/Email.d.ts.map +0 -1
  257. package/dist/widgets/base/Float.d.ts +0 -4
  258. package/dist/widgets/base/Float.d.ts.map +0 -1
  259. package/dist/widgets/base/FloatTime.d.ts +0 -12
  260. package/dist/widgets/base/FloatTime.d.ts.map +0 -1
  261. package/dist/widgets/base/Image.d.ts +0 -14
  262. package/dist/widgets/base/Image.d.ts.map +0 -1
  263. package/dist/widgets/base/Integer.d.ts +0 -8
  264. package/dist/widgets/base/Integer.d.ts.map +0 -1
  265. package/dist/widgets/base/Label.d.ts +0 -9
  266. package/dist/widgets/base/Label.d.ts.map +0 -1
  267. package/dist/widgets/base/LinkInput.d.ts +0 -12
  268. package/dist/widgets/base/LinkInput.d.ts.map +0 -1
  269. package/dist/widgets/base/MultiSelection.d.ts +0 -10
  270. package/dist/widgets/base/MultiSelection.d.ts.map +0 -1
  271. package/dist/widgets/base/ProgressBar.d.ts +0 -7
  272. package/dist/widgets/base/ProgressBar.d.ts.map +0 -1
  273. package/dist/widgets/base/Reference.d.ts +0 -16
  274. package/dist/widgets/base/Reference.d.ts.map +0 -1
  275. package/dist/widgets/base/ReferenceTree.d.ts +0 -8
  276. package/dist/widgets/base/ReferenceTree.d.ts.map +0 -1
  277. package/dist/widgets/base/Selection.d.ts +0 -10
  278. package/dist/widgets/base/Selection.d.ts.map +0 -1
  279. package/dist/widgets/base/Separator.d.ts +0 -8
  280. package/dist/widgets/base/Separator.d.ts.map +0 -1
  281. package/dist/widgets/base/Text.d.ts +0 -8
  282. package/dist/widgets/base/Text.d.ts.map +0 -1
  283. package/dist/widgets/base/Time.d.ts +0 -12
  284. package/dist/widgets/base/Time.d.ts.map +0 -1
  285. package/dist/widgets/base/Url.d.ts +0 -4
  286. package/dist/widgets/base/Url.d.ts.map +0 -1
  287. package/dist/widgets/base/many2one/Many2one.d.ts +0 -16
  288. package/dist/widgets/base/many2one/Many2one.d.ts.map +0 -1
  289. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +0 -9
  290. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +0 -1
  291. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +0 -10
  292. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +0 -1
  293. package/dist/widgets/base/many2one/Many2oneTree.d.ts +0 -6
  294. package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +0 -1
  295. package/dist/widgets/base/one2many/One2many.d.ts +0 -8
  296. package/dist/widgets/base/one2many/One2many.d.ts.map +0 -1
  297. package/dist/widgets/base/one2many/One2manyInput.d.ts +0 -23
  298. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +0 -1
  299. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +0 -23
  300. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +0 -1
  301. package/dist/widgets/containers/Container.d.ts +0 -9
  302. package/dist/widgets/containers/Container.d.ts.map +0 -1
  303. package/dist/widgets/containers/Group.d.ts +0 -10
  304. package/dist/widgets/containers/Group.d.ts.map +0 -1
  305. package/dist/widgets/containers/Notebook.d.ts +0 -9
  306. package/dist/widgets/containers/Notebook.d.ts.map +0 -1
  307. package/dist/widgets/custom/Avatar.d.ts +0 -10
  308. package/dist/widgets/custom/Avatar.d.ts.map +0 -1
  309. package/dist/widgets/custom/ButtonGroup.d.ts +0 -8
  310. package/dist/widgets/custom/ButtonGroup.d.ts.map +0 -1
  311. package/dist/widgets/custom/CodeEditor.d.ts +0 -9
  312. package/dist/widgets/custom/CodeEditor.d.ts.map +0 -1
  313. package/dist/widgets/custom/Comments.d.ts +0 -35
  314. package/dist/widgets/custom/Comments.d.ts.map +0 -1
  315. package/dist/widgets/custom/FiberGrid.d.ts +0 -10
  316. package/dist/widgets/custom/FiberGrid.d.ts.map +0 -1
  317. package/dist/widgets/custom/Indicator.d.ts +0 -10
  318. package/dist/widgets/custom/Indicator.d.ts.map +0 -1
  319. package/dist/widgets/custom/Markdown.d.ts +0 -5
  320. package/dist/widgets/custom/Markdown.d.ts.map +0 -1
  321. package/dist/widgets/custom/MultiCheckbox.d.ts +0 -14
  322. package/dist/widgets/custom/MultiCheckbox.d.ts.map +0 -1
  323. package/dist/widgets/custom/Radio.d.ts +0 -10
  324. package/dist/widgets/custom/Radio.d.ts.map +0 -1
  325. package/dist/widgets/custom/Steps.d.ts +0 -13
  326. package/dist/widgets/custom/Steps.d.ts.map +0 -1
  327. package/dist/widgets/custom/Switch.d.ts +0 -4
  328. package/dist/widgets/custom/Switch.d.ts.map +0 -1
  329. package/dist/widgets/custom/Tag.d.ts +0 -7
  330. package/dist/widgets/custom/Tag.d.ts.map +0 -1
  331. package/dist/widgets/custom/Tags.d.ts +0 -15
  332. package/dist/widgets/custom/Tags.d.ts.map +0 -1
  333. package/dist/widgets/custom/Timeline.d.ts +0 -16
  334. package/dist/widgets/custom/Timeline.d.ts.map +0 -1
  335. package/dist/widgets/modals/ExportModal.d.ts +0 -15
  336. package/dist/widgets/modals/ExportModal.d.ts.map +0 -1
  337. package/dist/widgets/modals/FormModal.d.ts +0 -12
  338. package/dist/widgets/modals/FormModal.d.ts.map +0 -1
  339. package/dist/widgets/modals/SearchModal.d.ts +0 -13
  340. package/dist/widgets/modals/SearchModal.d.ts.map +0 -1
  341. package/dist/widgets/modals/TranslationModal.d.ts +0 -12
  342. package/dist/widgets/modals/TranslationModal.d.ts.map +0 -1
  343. package/dist/widgets/views/Dashboard/Dashboard.d.ts +0 -5
  344. package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +0 -1
  345. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +0 -4
  346. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +0 -1
  347. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +0 -19
  348. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +0 -1
  349. package/dist/widgets/views/Dashboard/dashboardHelper.d.ts +0 -6
  350. package/dist/widgets/views/Dashboard/dashboardHelper.d.ts.map +0 -1
  351. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +0 -4
  352. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +0 -1
  353. package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts +0 -6
  354. package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts.map +0 -1
  355. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +0 -4
  356. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +0 -1
  357. package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts +0 -11
  358. package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts.map +0 -1
  359. package/dist/widgets/views/DashboardGrid/index.d.ts +0 -5
  360. package/dist/widgets/views/DashboardGrid/index.d.ts.map +0 -1
  361. package/dist/widgets/views/Form.d.ts +0 -29
  362. package/dist/widgets/views/Form.d.ts.map +0 -1
  363. package/dist/widgets/views/Graph/Graph.d.ts +0 -11
  364. package/dist/widgets/views/Graph/Graph.d.ts.map +0 -1
  365. package/dist/widgets/views/Graph/GraphChart.d.ts +0 -11
  366. package/dist/widgets/views/Graph/GraphChart.d.ts.map +0 -1
  367. package/dist/widgets/views/Graph/GraphDefaults.d.ts +0 -83
  368. package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +0 -1
  369. package/dist/widgets/views/Graph/GraphIndicator.d.ts +0 -17
  370. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +0 -1
  371. package/dist/widgets/views/Graph/useGraphData.d.ts +0 -20
  372. package/dist/widgets/views/Graph/useGraphData.d.ts.map +0 -1
  373. package/dist/widgets/views/SearchTree.d.ts +0 -24
  374. package/dist/widgets/views/SearchTree.d.ts.map +0 -1
  375. package/dist/widgets/views/Tree.d.ts +0 -32
  376. package/dist/widgets/views/Tree.d.ts.map +0 -1
  377. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +0 -4
  378. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +0 -1
  379. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +0 -4
  380. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +0 -1
  381. package/dist/widgets/views/searchFilter/PairFields.d.ts +0 -4
  382. package/dist/widgets/views/searchFilter/PairFields.d.ts.map +0 -1
  383. package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts +0 -10
  384. package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts.map +0 -1
  385. package/dist/widgets/views/searchFilter/SearchField.d.ts +0 -8
  386. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +0 -1
  387. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +0 -20
  388. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +0 -1
  389. package/dist/widgets/views/searchFilter/SearchParams.d.ts +0 -7
  390. package/dist/widgets/views/searchFilter/SearchParams.d.ts.map +0 -1
  391. package/src/tailwind.css +0 -8
  392. package/src/tailwind.generated.css +0 -168533
package/package.json CHANGED
@@ -1,34 +1,33 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.5.1",
3
+ "version": "2.0.0-alpha.1",
4
+ "engines": {
5
+ "node": "20.5.0"
6
+ },
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
4
10
  "files": [
5
11
  "dist",
6
12
  "src",
7
13
  "README.md"
8
14
  ],
9
- "main": "./dist/react-ooui.umd.js",
10
15
  "module": "./dist/react-ooui.es.js",
11
16
  "types": "./dist/index.d.ts",
12
17
  "exports": {
13
18
  ".": {
14
- "import": "./dist/react-ooui.es.js",
15
- "require": "./dist/react-ooui.umd.js"
19
+ "import": "./dist/react-ooui.es.js"
16
20
  }
17
21
  },
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
22
  "scripts": {
22
- "preminor": "npm version preminor --preid rc",
23
- "prerelease": "npm version prerelease --preid rc",
24
- "prepatch": "npm version prepatch --preid rc",
25
- "premajor": "npm version premajor --preid rc",
26
- "start": "while :; do tsc && vite build --watch --force; done",
27
- "build:tailwind": "postcss src/tailwind.css -o src/tailwind.generated.css",
28
- "build": "tsc && vite build",
29
- "test": "jest",
30
- "storybook": "start-storybook -p 6006",
31
- "build-storybook": "build-storybook"
23
+ "preinstall": "npx only-allow npm",
24
+ "build": "tsc --noEmit && vite build",
25
+ "preview": "npm run build && vite preview",
26
+ "dev:vite": "while :; do tsc && vite build --watch --force; done",
27
+ "dev:tsc": "tsc --noEmit --watch",
28
+ "prepare": "husky install",
29
+ "start": "concurrently npm:dev:*",
30
+ "check": "lint-staged"
32
31
  },
33
32
  "dependencies": {
34
33
  "@ant-design/plots": "^1.0.9",
@@ -49,51 +48,83 @@
49
48
  "react-hotkeys-hook": "^3.4.4",
50
49
  "react-markdown": "^8.0.7",
51
50
  "react-measure": "^2.5.2",
51
+ "styled-components": "5.3.5",
52
52
  "use-deep-compare-effect": "^1.8.1",
53
53
  "uuid": "^3.4.0",
54
54
  "validator": "^13.6.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@babel/core": "^7.19.1",
58
- "@storybook/addon-actions": "^6.5.12",
59
- "@storybook/addon-essentials": "^6.5.12",
60
- "@storybook/addon-interactions": "^6.5.12",
61
- "@storybook/addon-knobs": "^6.4.0",
62
- "@storybook/addon-links": "^6.5.12",
63
- "@storybook/builder-vite": "^0.2.2",
64
- "@storybook/react": "^6.5.12",
65
- "@storybook/testing-library": "^0.0.13",
66
- "@tailwindcss/postcss7-compat": "^2.0.2",
67
- "@types/jest": "^26.0.15",
57
+ "@semantic-release/exec": "6.0.3",
58
+ "@semantic-release/git": "10.0.1",
59
+ "@semantic-release/npm": "10.0.4",
68
60
  "@types/lodash": "^4.14.170",
69
61
  "@types/md5": "^2.3.2",
70
- "@types/node": "^12.0.0",
71
62
  "@types/react": "^17.0.1",
72
63
  "@types/react-dom": "^17.0.1",
73
64
  "@types/react-grid-layout": "^1.3.2",
74
65
  "@types/react-measure": "^2.0.7",
75
66
  "@types/react-responsive": "^8.0.2",
67
+ "@types/rollup-plugin-peer-deps-external": "^2.2.2",
76
68
  "@types/scroll-into-view": "^1.16.0",
77
69
  "@types/styled-components": "^5.1.7",
78
70
  "@types/uuid": "^8.3.1",
79
71
  "@types/validator": "^13.6.3",
80
- "@vitejs/plugin-react": "^2.1.0",
81
- "autoprefixer": "^9.8.6",
82
- "babel-loader": "^8.2.5",
83
- "jest": "^26.6.3",
84
- "jest-enzyme": "^7.1.2",
85
- "postcss": "^7.0.35",
86
- "postcss-cli": "^7.1.0",
72
+ "@typescript-eslint/eslint-plugin": "5.59.0",
73
+ "@typescript-eslint/parser": "5.59.0",
74
+ "@vitejs/plugin-react-swc": "3.3.2",
75
+ "concurrently": "8.2.0",
76
+ "eslint": "8.51.0",
77
+ "eslint-config-prettier": "8.5.0",
78
+ "eslint-config-standard-with-typescript": "24.0.0",
79
+ "eslint-plugin-import": "2.28.0",
80
+ "eslint-plugin-n": "15.6.0",
81
+ "eslint-plugin-promise": "6.1.1",
82
+ "eslint-plugin-react": "7.33.1",
83
+ "eslint-plugin-react-hooks": "4.6.0",
84
+ "husky": "8.0.3",
85
+ "lint-staged": "13.2.3",
86
+ "only-allow": "1.1.1",
87
+ "prettier": "3.0.1",
87
88
  "rollup-plugin-peer-deps-external": "^2.2.4",
88
- "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
89
- "ts-jest": "^26.4.4",
90
- "typescript": "^4.0.3",
91
- "vite": "^3.1.0",
92
- "vite-plugin-dts": "^1.0.3"
89
+ "semantic-release": "21.0.7",
90
+ "typescript": "^5.0.4",
91
+ "vite": "4.4.8",
92
+ "vite-plugin-dts": "^3.6.0",
93
+ "vite-plugin-package-version": "1.0.2",
94
+ "vite-tsconfig-paths": "3.5.0"
93
95
  },
94
96
  "peerDependencies": {
95
97
  "react": "^17.0.1",
96
98
  "react-dom": "^17.0.1",
97
- "styled-components": "^5.2.1"
99
+ "styled-components": "5.3.5"
100
+ },
101
+ "lint-staged": {
102
+ "src/**/*.{js,jsx,ts,tsx}": "eslint --fix",
103
+ "src/**/*.{js,jsx,ts,tsx,json,css,md}": "prettier --write"
104
+ },
105
+ "release": {
106
+ "branches": [
107
+ "master",
108
+ {
109
+ "name": "develop",
110
+ "prerelease": "rc"
111
+ },
112
+ {
113
+ "name": "alpha",
114
+ "prerelease": true
115
+ }
116
+ ],
117
+ "plugins": [
118
+ "@semantic-release/commit-analyzer",
119
+ "@semantic-release/release-notes-generator",
120
+ [
121
+ "@semantic-release/npm",
122
+ {
123
+ "npmPublish": true
124
+ }
125
+ ],
126
+ "@semantic-release/github",
127
+ "@semantic-release/git"
128
+ ]
98
129
  }
99
130
  }
@@ -141,7 +141,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
141
141
  try {
142
142
  setRemovingItem?.(true);
143
143
 
144
- await ConnectionProvider.getHandler().delete({
144
+ await ConnectionProvider.getHandler().deleteObjects({
145
145
  model: currentModel!,
146
146
  ids: [currentId!],
147
147
  });
@@ -92,7 +92,7 @@ function TreeActionBar(props: Props) {
92
92
  try {
93
93
  setRemovingItem?.(true);
94
94
 
95
- await ConnectionProvider.getHandler().delete({
95
+ await ConnectionProvider.getHandler().deleteObjects({
96
96
  model: currentModel!,
97
97
  ids: selectedRowItems!.map((item) => item.id),
98
98
  });
@@ -5,9 +5,9 @@ import Field from "@/common/Field";
5
5
  import { WidgetProps } from "@/types";
6
6
  import { Date as DateOoui } from "@gisce/ooui";
7
7
  import dayjs from "dayjs";
8
- const { useToken } = theme;
9
8
  import weekday from "dayjs/plugin/weekday";
10
9
  import localeData from "dayjs/plugin/localeData";
10
+ const { useToken } = theme;
11
11
  dayjs.extend(weekday);
12
12
  dayjs.extend(localeData);
13
13
 
@@ -47,7 +47,7 @@ interface DatePickerInputProps {
47
47
  }
48
48
 
49
49
  const DatePickerInput: React.FC<DatePickerInputProps> = (
50
- props: DatePickerInputProps
50
+ props: DatePickerInputProps,
51
51
  ) => {
52
52
  const { value, onChange, ooui, showTime } = props;
53
53
  const { id, readOnly, required } = ooui as DateOoui;
@@ -1,6 +1,5 @@
1
1
  import styled from "styled-components";
2
- import { useContext, useState } from "react";
3
- import React from "react";
2
+ import React, { useContext, useState } from "react";
4
3
  import { Spin } from "antd";
5
4
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
6
5
  import Link from "antd/es/typography/Link";
@@ -60,7 +59,7 @@ export const SelectAllRecordsRow = ({
60
59
  <span>
61
60
  {translations.recordsSelected.replace(
62
61
  "{numberOfSelectedRows}",
63
- numberOfVisibleSelectedRows.toString()
62
+ numberOfVisibleSelectedRows.toString(),
64
63
  ) + " "}
65
64
 
66
65
  {loading ? (
@@ -69,7 +68,7 @@ export const SelectAllRecordsRow = ({
69
68
  <Link onClick={handleClick} style={{ fontWeight: 600 }}>
70
69
  {translations.selectAllRecords.replace(
71
70
  "{totalRecords}",
72
- totalRecords.toString()
71
+ totalRecords.toString(),
73
72
  )}
74
73
  </Link>
75
74
  )}
@@ -80,7 +79,7 @@ export const SelectAllRecordsRow = ({
80
79
  <span style={{ fontWeight: 600 }}>
81
80
  {translations.allRecordsSelected.replace(
82
81
  "{totalRecords}",
83
- numberOfRealSelectedRows.toString()
82
+ numberOfRealSelectedRows.toString(),
84
83
  ) + " "}
85
84
  </span>
86
85
  );
@@ -59,14 +59,14 @@ const callRefreshValues = async (fns: any[]) => {
59
59
 
60
60
  const ContentRootProvider = (
61
61
  props: ContentRootProviderProps,
62
- ref: any
62
+ ref: any,
63
63
  ): any => {
64
64
  const { children, globalValues = {} } = props;
65
65
  const reportInProgressInterval = useRef<any>();
66
66
  const waitingForReport = useRef<boolean>();
67
67
  const [reportGenerating, setReportGenerating] = useState<boolean>(false);
68
68
  const tabManagerContext = useContext(
69
- TabManagerContext
69
+ TabManagerContext,
70
70
  ) as TabManagerContextType;
71
71
  const { openAction } = tabManagerContext || {};
72
72
  const onRefreshParentValues = useRef<any>([]);
@@ -82,7 +82,7 @@ const ContentRootProvider = (
82
82
  const [actionModalOptions, setActionModalOptions] = useState<ActionModalOpts>(
83
83
  {
84
84
  context: {},
85
- }
85
+ },
86
86
  );
87
87
 
88
88
  async function generateReport(options: GenerateReportOptions) {
@@ -103,7 +103,7 @@ const ContentRootProvider = (
103
103
 
104
104
  const { ids } = datas || {};
105
105
 
106
- let idsToExecute = ids || [];
106
+ const idsToExecute = ids || [];
107
107
 
108
108
  const reportContextParsed =
109
109
  typeof reportContext === "string"
@@ -182,9 +182,12 @@ const ContentRootProvider = (
182
182
  context,
183
183
  });
184
184
  } else if (type === "ir.actions.act_window") {
185
- return await runAction({actionData, fields, values, context});
185
+ return await runAction({ actionData, fields, values, context });
186
186
  } else if (type === "ir.actions.act_url") {
187
- window.open(stringFormat(actionData.url, {...values, context}), "_blank");
187
+ window.open(
188
+ stringFormat(actionData.url, { ...values, context }),
189
+ "_blank",
190
+ );
188
191
  } else {
189
192
  showErrorDialog(`${type} action not supported`);
190
193
  return {};
@@ -275,7 +278,7 @@ const ContentRootProvider = (
275
278
  context: mergedContext,
276
279
  domain: parsedDomain,
277
280
  model: actionData.res_model,
278
- views: views,
281
+ views,
279
282
  title: actionData.name,
280
283
  initialView,
281
284
  action_id: actionData.id,
@@ -346,52 +349,54 @@ const ContentRootProvider = (
346
349
  });
347
350
  }
348
351
 
349
- return (<>
350
- <ContentRootContext.Provider
351
- value={{
352
- processAction,
353
- globalValues,
354
- }}
355
- >
356
- <>
357
- {children}
358
- <Modal
359
- title={t("generatingReport")}
360
- open={reportGenerating}
361
- footer={null}
362
- closable={false}
363
- centered
364
- maskClosable={false}
365
- >
366
- <Spin />
367
- </Modal>
368
- <FormModal
369
- buttonModal
370
- parentContext={actionModalOptions.context}
371
- model={actionModalOptions.model!}
372
- formView={actionModalOptions.formView}
373
- visible={actionModalVisible}
374
- onSubmitSucceed={onFormModalSucceed}
375
- onCancel={() => {
376
- callRefreshValues(onRefreshParentValues.current);
377
- onRefreshParentValues.current = [];
378
- setActionModalVisible(false);
379
- setActionModalOptions({
380
- domain: undefined,
381
- model: undefined,
382
- context: {},
383
- formView: undefined,
384
- actionData: undefined,
385
- });
386
- }}
387
- showFooter={false}
388
- actionDomain={actionModalOptions.domain}
389
- isMenuAction={actionModalOptions?.actionData !== undefined}
390
- actionData={actionModalOptions?.actionData}
391
- />
392
- </>
393
- </ContentRootContext.Provider>
394
- </>);
352
+ return (
353
+ <>
354
+ <ContentRootContext.Provider
355
+ value={{
356
+ processAction,
357
+ globalValues,
358
+ }}
359
+ >
360
+ <>
361
+ {children}
362
+ <Modal
363
+ title={t("generatingReport")}
364
+ open={reportGenerating}
365
+ footer={null}
366
+ closable={false}
367
+ centered
368
+ maskClosable={false}
369
+ >
370
+ <Spin />
371
+ </Modal>
372
+ <FormModal
373
+ buttonModal
374
+ parentContext={actionModalOptions.context}
375
+ model={actionModalOptions.model!}
376
+ formView={actionModalOptions.formView}
377
+ visible={actionModalVisible}
378
+ onSubmitSucceed={onFormModalSucceed}
379
+ onCancel={() => {
380
+ callRefreshValues(onRefreshParentValues.current);
381
+ onRefreshParentValues.current = [];
382
+ setActionModalVisible(false);
383
+ setActionModalOptions({
384
+ domain: undefined,
385
+ model: undefined,
386
+ context: {},
387
+ formView: undefined,
388
+ actionData: undefined,
389
+ });
390
+ }}
391
+ showFooter={false}
392
+ actionDomain={actionModalOptions.domain}
393
+ isMenuAction={actionModalOptions?.actionData !== undefined}
394
+ actionData={actionModalOptions?.actionData}
395
+ />
396
+ </>
397
+ </ContentRootContext.Provider>
398
+ </>
399
+ );
395
400
  };
396
401
 
397
402
  async function getViewsAndInitialView({
@@ -439,7 +444,9 @@ async function getViewsAndInitialView({
439
444
  };
440
445
  } else if (!view_id) {
441
446
  const type = view_mode.split(",")[0];
442
- const [retrievedViewId] = retriedViewData.find(([_, viewType]) => viewType === type)!;
447
+ const [retrievedViewId] = retriedViewData.find(
448
+ ([_, viewType]) => viewType === type,
449
+ )!;
443
450
  initialView = { id: retrievedViewId, type };
444
451
  } else {
445
452
  initialView = {
@@ -20,7 +20,7 @@ export type TabManagerContextType = {
20
20
  domain: any;
21
21
  context: any;
22
22
  model: string;
23
- views: Array<any>;
23
+ views: any[];
24
24
  title: string;
25
25
  target: string;
26
26
  initialView: InitialViewData;
@@ -69,9 +69,8 @@ export type TabManagerContextType = {
69
69
  setCurrentId?: (id?: number) => void;
70
70
  };
71
71
 
72
- export const TabManagerContext = React.createContext<TabManagerContextType | null>(
73
- null
74
- );
72
+ export const TabManagerContext =
73
+ React.createContext<TabManagerContextType | null>(null);
75
74
 
76
75
  type TabManagerProviderProps = TabManagerContextType & {
77
76
  children: React.ReactNode;
@@ -23,7 +23,7 @@ export const calculateColumnsWidth = (
23
23
  maxWidthPerCell = 500
24
24
  ) => {
25
25
  if (columns.length === 0) {
26
- return columns;
26
+ return { columns };
27
27
  }
28
28
 
29
29
  // First we calculate the width for each column
@@ -8,7 +8,7 @@ export function getFilesize(base64string: string) {
8
8
 
9
9
  export async function getMimeType(base64string: string) {
10
10
  const mimeInfo = await fileTypeFromBuffer(
11
- Buffer.from(base64string, "base64")
11
+ Buffer.from(base64string, "base64"),
12
12
  );
13
13
  if (!mimeInfo) {
14
14
  return {
@@ -29,13 +29,13 @@ export const toBase64 = (file: File): Promise<string> =>
29
29
  });
30
30
 
31
31
  export function openBase64InNewTab(data: string, mimeType: string) {
32
- var byteCharacters = atob(data);
33
- var byteNumbers = new Array(byteCharacters.length);
34
- for (var i = 0; i < byteCharacters.length; i++) {
32
+ const byteCharacters = atob(data);
33
+ const byteNumbers = new Array(byteCharacters.length);
34
+ for (let i = 0; i < byteCharacters.length; i++) {
35
35
  byteNumbers[i] = byteCharacters.charCodeAt(i);
36
36
  }
37
- var byteArray = new Uint8Array(byteNumbers);
38
- var file = new Blob([byteArray], { type: mimeType + ";base64" });
39
- var fileURL = URL.createObjectURL(file);
37
+ const byteArray = new Uint8Array(byteNumbers);
38
+ const file = new Blob([byteArray], { type: mimeType + ";base64" });
39
+ const fileURL = URL.createObjectURL(file);
40
40
  window.open(fileURL);
41
41
  }
@@ -57,7 +57,7 @@ export const getTouchedValues = ({
57
57
 
58
58
  const nonOriginalItems =
59
59
  target[key]?.items?.filter(
60
- (item: One2manyItem) => item.operation !== "original"
60
+ (item: One2manyItem) => item.operation !== "original",
61
61
  ) || [];
62
62
 
63
63
  if (nonOriginalItems.length > 0) {
@@ -203,7 +203,7 @@ export const mergeSearchFields = (searchFields: any[]) => {
203
203
 
204
204
  mergedSearchFields.primary = mergedSearchFields.primary.concat(sf.primary);
205
205
  mergedSearchFields.secondary = mergedSearchFields.secondary.concat(
206
- sf.secondary
206
+ sf.secondary,
207
207
  );
208
208
  });
209
209
 
@@ -224,7 +224,7 @@ export const transformPlainMany2Ones = ({
224
224
  values: any;
225
225
  fields: any;
226
226
  }) => {
227
- let reformattedValues: { [key: string]: any } = {};
227
+ const reformattedValues: { [key: string]: any } = {};
228
228
 
229
229
  Object.keys(values).forEach((key) => {
230
230
  const value = values[key];
@@ -245,30 +245,29 @@ export const transformPlainMany2Ones = ({
245
245
  return reformattedValues;
246
246
  };
247
247
 
248
-
249
248
  export const colorFromString = (text: string) => {
250
249
  let hash = 0;
251
- text = text.toString().padEnd(10, '0');
250
+ text = text.toString().padEnd(10, "0");
252
251
  for (let i = 0; i < text.length; i++) {
253
252
  hash = text.charCodeAt(i) + ((hash << 5) - hash);
254
253
  }
255
- let hexColour = '#';
254
+ let hexColour = "#";
256
255
  for (let i = 0; i < 3; i++) {
257
- var value = (hash >> (i * 8)) & 0xFF;
258
- hexColour += ('00' + value.toString(16)).slice(-2);
256
+ const value = (hash >> (i * 8)) & 0xff;
257
+ hexColour += ("00" + value.toString(16)).slice(-2);
259
258
  }
260
259
  return hexColour;
261
- }
260
+ };
262
261
 
263
262
  export const colorTextFromBackground = (color: string) => {
264
263
  function getRGB(c: string): number {
265
- return parseInt(c, 16) || parseInt(c)
264
+ return parseInt(c, 16) || parseInt(c);
266
265
  }
267
266
 
268
- function getsRGB(c: string ) {
267
+ function getsRGB(c: string) {
269
268
  return getRGB(c) / 255 <= 0.03928
270
269
  ? getRGB(c) / 255 / 12.92
271
- : Math.pow((getRGB(c) / 255 + 0.055) / 1.055, 2.4)
270
+ : Math.pow((getRGB(c) / 255 + 0.055) / 1.055, 2.4);
272
271
  }
273
272
 
274
273
  function getLuminance(hexColor: string) {
@@ -276,27 +275,27 @@ export const colorTextFromBackground = (color: string) => {
276
275
  0.2126 * getsRGB(hexColor.substr(1, 2)) +
277
276
  0.7152 * getsRGB(hexColor.substr(3, 2)) +
278
277
  0.0722 * getsRGB(hexColor.substr(-2))
279
- )
278
+ );
280
279
  }
281
280
 
282
281
  function getContrast(f: string, b: string) {
283
- const L1 = getLuminance(f)
284
- const L2 = getLuminance(b)
285
- return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05)
282
+ const L1 = getLuminance(f);
283
+ const L2 = getLuminance(b);
284
+ return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05);
286
285
  }
287
286
 
288
287
  function getTextColor(bgColor: string) {
289
- const whiteContrast = getContrast(bgColor, '#ffffff')
290
- const blackContrast = getContrast(bgColor, '#000000')
288
+ const whiteContrast = getContrast(bgColor, "#ffffff");
289
+ const blackContrast = getContrast(bgColor, "#000000");
291
290
 
292
- return whiteContrast > blackContrast ? '#ffffff' : '#000000'
291
+ return whiteContrast > blackContrast ? "#ffffff" : "#000000";
293
292
  }
294
293
 
295
294
  return getTextColor(color);
296
-
297
- }
298
-
295
+ };
299
296
 
300
297
  export const stringFormat = (text: string, values: any): string => {
301
- return text.replace(/\{([^}]+)\}/g, (match, key) => values[key] !== undefined ? values[key] : match);
302
- }
298
+ return text.replace(/\{([^}]+)\}/g, (match, key) =>
299
+ values[key] !== undefined ? values[key] : match,
300
+ );
301
+ };
@@ -18,7 +18,7 @@ type ReadObjectValuesOptions = {
18
18
  };
19
19
 
20
20
  const readObjectValues = async (
21
- options: ReadObjectValuesOptions
21
+ options: ReadObjectValuesOptions,
22
22
  ): Promise<[One2manyItem[], any]> => {
23
23
  const {
24
24
  items,
@@ -30,7 +30,7 @@ const readObjectValues = async (
30
30
  } = options;
31
31
 
32
32
  const temporalItems: One2manyItem = items.filter(
33
- (item) => item.operation !== "original"
33
+ (item) => item.operation !== "original",
34
34
  );
35
35
 
36
36
  // We get a number array of id's
@@ -43,8 +43,8 @@ const readObjectValues = async (
43
43
  tree: treeView.fields,
44
44
  };
45
45
 
46
- let values = [],
47
- evaluatedColorsForTree;
46
+ let values = [];
47
+ let evaluatedColorsForTree;
48
48
 
49
49
  if (currentView === "tree" && treeView?.arch) {
50
50
  const colors = getTree(treeView as TreeView)?.colors;
@@ -85,7 +85,7 @@ const readObjectValues = async (
85
85
  // We fill the values property of the One2manyItem with the retrieved values from the API
86
86
  const originalItemsWithFetchedValues: One2manyItem[] = items.map((item) => {
87
87
  const fetchedItemValues = filteredValues.find(
88
- (itemValues: any) => itemValues.id === item.id
88
+ (itemValues: any) => itemValues.id === item.id,
89
89
  );
90
90
 
91
91
  const itemWithFetchedValues = {
@@ -177,7 +177,7 @@ const convertToPlain2ManyValues = (values: any, fields: any) => {
177
177
  values[key]?.items
178
178
  ) {
179
179
  result[key] = values[key].items.filter(
180
- (item: One2manyItem) => item.operation !== "pendingRemove"
180
+ (item: One2manyItem) => item.operation !== "pendingRemove",
181
181
  );
182
182
  } else {
183
183
  result[key] = values[key];
@@ -8,7 +8,10 @@ const convertBooleanParamIfNeeded = (value: any) => {
8
8
  export const getParamsForFields = (values: any, widgetContainer: any) => {
9
9
  const filteredValues = removeUndefinedFields(values);
10
10
  const groupedDateTime = groupDateTimeValuesIfNeeded(filteredValues);
11
- const groupedValues = ungroupDateValuesIfNeeded(groupedDateTime, widgetContainer);
11
+ const groupedValues = ungroupDateValuesIfNeeded(
12
+ groupedDateTime,
13
+ widgetContainer,
14
+ );
12
15
 
13
16
  const params = [
14
17
  ...Object.keys(groupedValues).map((key) => {
@@ -64,7 +67,7 @@ const getParamForField = (key: string, value: any, widgetContainer: any) => {
64
67
  key,
65
68
  "in",
66
69
  value.map((valueEntry: string) =>
67
- convertBooleanParamIfNeeded(valueEntry)
70
+ convertBooleanParamIfNeeded(valueEntry),
68
71
  ),
69
72
  ];
70
73
  } else {
@@ -83,7 +86,7 @@ const removeDateTimeSingleFields = (values: any) => {
83
86
  Object.keys(newValues).forEach(
84
87
  (key) =>
85
88
  (key.indexOf("#time") !== -1 || key.indexOf("#date") !== -1) &&
86
- delete newValues[key]
89
+ delete newValues[key],
87
90
  );
88
91
  return newValues;
89
92
  };
@@ -133,7 +136,7 @@ const ungroupDateValuesIfNeeded = (values: any, widgetContainer: any) => {
133
136
  return widget && widget.type === "date";
134
137
  });
135
138
 
136
- let newValues: any = { ...values };
139
+ const newValues: any = { ...values };
137
140
 
138
141
  dateFields.forEach((key) => {
139
142
  delete newValues[key];
@@ -156,7 +159,7 @@ export const removeUndefinedFields = (values: any) => {
156
159
  (newValues[key] === undefined ||
157
160
  newValues[key] === null ||
158
161
  newValues[key] === "") &&
159
- delete newValues[key]
162
+ delete newValues[key],
160
163
  );
161
164
  return newValues;
162
165
  };