@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,6 +1,7 @@
1
1
  import React from "react";
2
- import { Divider } from "antd";
2
+ import { Divider, Space } from "antd";
3
3
  import { Separator as SeparatorOoui } from "@gisce/ooui";
4
+ import iconMapper from "@/helpers/iconMapper";
4
5
 
5
6
  type Props = {
6
7
  ooui: SeparatorOoui;
@@ -8,11 +9,18 @@ type Props = {
8
9
 
9
10
  export const Separator = (props: Props) => {
10
11
  const { ooui } = props;
11
- const { label } = ooui;
12
+ const { label, icon } = ooui;
13
+ const Icon : React.ElementType | undefined = iconMapper(icon || "");
14
+
12
15
 
13
16
  return (
14
17
  <Divider orientation="left" className="text-sm">
15
- {label}
18
+ { (Icon || label) &&
19
+ <Space>
20
+ {Icon ? <Icon /> : null}
21
+ {label}
22
+ </Space>
23
+ }
16
24
  </Divider>
17
25
  );
18
26
  };
@@ -1,7 +1,6 @@
1
- import React, { useContext, useState } from "react";
2
- import { Input, Row } from "antd";
1
+ import React, { CSSProperties, useContext, useState } from "react";
2
+ import { Input, Row, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
- import Config from "@/Config";
5
4
  import { Text as TextOoui } from "@gisce/ooui";
6
5
  import { TranslationModal } from "../modals/TranslationModal";
7
6
  import { FormContext, FormContextType } from "@/context/FormContext";
@@ -9,6 +8,7 @@ import ButtonWithTooltip from "@/common/ButtonWithTooltip";
9
8
  import { TranslationOutlined } from "@ant-design/icons";
10
9
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
11
10
  import showInfo from "@/ui/InfoDialog";
11
+ const { useToken } = theme;
12
12
 
13
13
  const { TextArea } = Input;
14
14
 
@@ -19,8 +19,11 @@ type Props = {
19
19
  const Text = (props: Props) => {
20
20
  const { ooui } = props;
21
21
  const { id, readOnly, required, height, translatable } = ooui;
22
- const requiredClass =
23
- required && !readOnly ? Config.requiredClass : undefined;
22
+ const { token } = useToken();
23
+ const requiredStyle =
24
+ required && !readOnly
25
+ ? { backgroundColor: token.colorPrimaryBg }
26
+ : undefined;
24
27
  const formContext = useContext(FormContext) as FormContextType;
25
28
  const { elementHasLostFocus } = formContext || {};
26
29
 
@@ -29,14 +32,13 @@ const Text = (props: Props) => {
29
32
  {translatable ? (
30
33
  <TranslatableText
31
34
  field={id}
32
- requiredClass={requiredClass}
33
35
  height={height}
36
+ requiredStyle={requiredStyle}
34
37
  />
35
38
  ) : (
36
39
  <TextArea
37
40
  disabled={readOnly || translatable}
38
- className={requiredClass}
39
- style={{ height: height ? height + "px" : "100%" }}
41
+ style={{ height: height ? height + "px" : "100%", ...requiredStyle }}
40
42
  rows={4}
41
43
  onBlur={elementHasLostFocus}
42
44
  />
@@ -48,13 +50,13 @@ const Text = (props: Props) => {
48
50
  const TranslatableText = ({
49
51
  value,
50
52
  field,
51
- requiredClass,
53
+ requiredStyle,
52
54
  onChange,
53
55
  height,
54
56
  }: {
55
57
  value?: string;
56
58
  field: string;
57
- requiredClass: string | undefined;
59
+ requiredStyle: CSSProperties | undefined;
58
60
  height: number | undefined;
59
61
  onChange?: (value: string) => void;
60
62
  }) => {
@@ -80,9 +82,9 @@ const TranslatableText = ({
80
82
  }}
81
83
  style={{
82
84
  height: height ? height + "px" : "100%",
85
+ ...requiredStyle
83
86
  }}
84
87
  id={field}
85
- className={requiredClass}
86
88
  rows={4}
87
89
  onBlur={elementHasLostFocus}
88
90
  />
@@ -128,10 +130,10 @@ const TranslatableText = ({
128
130
  style={{
129
131
  height: height ? height + "px" : "100%",
130
132
  cursor: "pointer",
133
+ ...requiredStyle
131
134
  }}
132
135
  id={field}
133
136
  disabled={true}
134
- className={requiredClass}
135
137
  rows={4}
136
138
  onBlur={elementHasLostFocus}
137
139
  />
@@ -6,13 +6,17 @@ import {
6
6
  LoadingOutlined,
7
7
  } from "@ant-design/icons";
8
8
  import styled from "styled-components";
9
+ import { theme } from "antd";
10
+
11
+ const { defaultAlgorithm, defaultSeed } = theme;
12
+
13
+ const mapToken = defaultAlgorithm(defaultSeed);
9
14
 
10
15
  import {
11
16
  Many2one as Many2oneOoui,
12
17
  transformDomainForChildWidget,
13
18
  } from "@gisce/ooui";
14
19
  import Field from "@/common/Field";
15
- import Config from "@/Config";
16
20
  import { SearchModal } from "@/widgets/modals/SearchModal";
17
21
  import { FormModal } from "@/widgets/modals/FormModal";
18
22
  import ConnectionProvider from "@/ConnectionProvider";
@@ -65,8 +69,10 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
65
69
  id: fieldName,
66
70
  domain: widgetDomain,
67
71
  } = ooui;
68
- const requiredClass =
69
- required && !readOnly ? Config.requiredClass : undefined;
72
+ const requiredStyle =
73
+ required && !readOnly
74
+ ? { backgroundColor: mapToken.colorPrimaryBg }
75
+ : undefined;
70
76
  const [showSearchModal, setShowSearchModal] = useState<boolean>(false);
71
77
  const [showFormModal, setShowFormModal] = useState<boolean>(false);
72
78
  const [searching, setSearching] = useState<boolean>(false);
@@ -75,14 +81,8 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
75
81
  const [inputText, setInputText] = useState<string>("");
76
82
  const inputTextRef = useRef<string>();
77
83
  const formContext = useContext(FormContext) as FormContextType;
78
- const {
79
- domain,
80
- getValues,
81
- getFields,
82
- getContext,
83
- setOriginalValue,
84
- elementHasLostFocus,
85
- } = formContext || {};
84
+ const { domain, getValues, getFields, getContext, elementHasLostFocus } =
85
+ formContext || {};
86
86
  const transformedDomain = useRef<any[]>([]);
87
87
  const [searchDomain, setSearchDomain] = useState<any>([]);
88
88
 
@@ -132,13 +132,12 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
132
132
  if (transformedDomain.current && transformedDomain.current.length > 0) {
133
133
  tryFetchFirstResultOrShowSearch(inputTextRef.current as string);
134
134
  } else {
135
- const results: any[] = await ConnectionProvider.getHandler().nameSearch(
136
- {
135
+ const results: any[] =
136
+ await ConnectionProvider.getHandler().nameSearch({
137
137
  model: relation,
138
138
  payload: inputTextRef.current as string,
139
139
  context: { ...getContext?.(), ...context },
140
- }
141
- );
140
+ });
142
141
 
143
142
  if (results.length === 1) {
144
143
  inputTextRef.current = undefined;
@@ -167,7 +166,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
167
166
  });
168
167
 
169
168
  if (resultIds.length === 1) {
170
- fetchNameAndUpdate(resultIds[0], true);
169
+ fetchNameAndUpdate(resultIds[0]);
171
170
  } else {
172
171
  setSearchText(text);
173
172
  setShowSearchModal(true);
@@ -179,10 +178,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
179
178
  setShowSearchModal(true);
180
179
  };
181
180
 
182
- const fetchNameAndUpdate = async (
183
- id: number,
184
- mustUpdateOriginalForm?: boolean
185
- ) => {
181
+ const fetchNameAndUpdate = async (id: number) => {
186
182
  setSearching(true);
187
183
 
188
184
  try {
@@ -194,10 +190,6 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
194
190
  });
195
191
 
196
192
  triggerChange([id, value[0][1]]);
197
-
198
- if (mustUpdateOriginalForm) {
199
- setOriginalValue(ooui.id, [id, value[0][1]]);
200
- }
201
193
  } catch (err) {
202
194
  showErrorDialog(err);
203
195
  } finally {
@@ -207,16 +199,16 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
207
199
 
208
200
  async function parseDomain() {
209
201
  if (widgetDomain) {
210
- transformedDomain.current = await ConnectionProvider.getHandler().evalDomain(
211
- {
202
+ transformedDomain.current =
203
+ await ConnectionProvider.getHandler().evalDomain({
212
204
  domain: widgetDomain,
213
205
  values: transformPlainMany2Ones({
214
206
  fields: getFields(),
215
207
  values: getValues(),
216
208
  }),
209
+ fields: getFields(),
217
210
  context: getContext(),
218
- }
219
- );
211
+ });
220
212
  }
221
213
 
222
214
  if (domain && domain.length > 0) {
@@ -232,7 +224,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
232
224
  }
233
225
 
234
226
  async function onKeyDown(event: any) {
235
- if (event.code === "Enter") {
227
+ if (event.keyCode === 13) {
236
228
  event.preventDefault();
237
229
  event.stopPropagation();
238
230
  await onElementLostFocus();
@@ -253,7 +245,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
253
245
  value={inputText}
254
246
  disabled={readOnly}
255
247
  onChange={onValueStringChange}
256
- className={requiredClass}
248
+ style={requiredStyle}
257
249
  onBlur={onElementLostFocus}
258
250
  onKeyDown={onKeyDown}
259
251
  suffix={
@@ -272,6 +264,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
272
264
  onClick={() => {
273
265
  setShowFormModal(true);
274
266
  }}
267
+ style={{ borderTopRightRadius: 0, borderBottomRightRadius: 0 }}
275
268
  tabIndex={-1}
276
269
  />
277
270
  </Col>
@@ -283,6 +276,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
283
276
  searchButtonTappedRef.current = true;
284
277
  tryFetchFirstResultOrShowSearch(text);
285
278
  }}
279
+ style={{ borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }}
286
280
  tabIndex={-1}
287
281
  />
288
282
  </Col>
@@ -324,6 +318,6 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
324
318
 
325
319
  const RequiredInput = styled(Input)`
326
320
  .ant-input {
327
- background-color: ${Config.requiredColor};
321
+ background-color: ${mapToken.colorPrimaryBg};
328
322
  }
329
323
  `;
@@ -14,10 +14,10 @@ export const Many2oneSuffixModal = (props: Props) => {
14
14
  const { t } = useContext(LocaleContext) as LocaleContextType;
15
15
 
16
16
  return (
17
- <Modal
17
+ (<Modal
18
18
  title={t("selectAction")}
19
19
  centered
20
- visible={visible}
20
+ open={visible}
21
21
  footer={null}
22
22
  destroyOnClose
23
23
  onCancel={onCancel}
@@ -37,6 +37,6 @@ export const Many2oneSuffixModal = (props: Props) => {
37
37
  );
38
38
  })}
39
39
  </Space>
40
- </Modal>
40
+ </Modal>)
41
41
  );
42
42
  };
@@ -0,0 +1,18 @@
1
+ import { Space } from "antd";
2
+ import React from "react";
3
+ import { Many2oneSuffix } from "./Many2oneSuffix";
4
+
5
+ export type Many2oneTreeProps = { m2oField: any };
6
+
7
+ export const Many2oneTree = (props: Many2oneTreeProps): React.ReactElement => {
8
+ const { m2oField } = props;
9
+ if (!m2oField) {
10
+ return <></>;
11
+ }
12
+ return (
13
+ <Space>
14
+ <>{m2oField.value}</>
15
+ <Many2oneSuffix id={m2oField.id} model={m2oField.model} />
16
+ </Space>
17
+ );
18
+ };
@@ -1,4 +1,10 @@
1
- import React, { useState, useRef, useContext, useEffect } from "react";
1
+ import React, {
2
+ useState,
3
+ useRef,
4
+ useContext,
5
+ useEffect,
6
+ useCallback,
7
+ } from "react";
2
8
  import { One2many as One2manyOoui } from "@gisce/ooui";
3
9
  import { Alert, Spin } from "antd";
4
10
  import { Form } from "@/index";
@@ -25,7 +31,7 @@ import { One2manyTopBar } from "@/widgets/base/one2many/One2manyTopBar";
25
31
  import { readObjectValues, getNextPendingId } from "@/helpers/one2manyHelper";
26
32
  import { SearchModal } from "@/widgets/modals/SearchModal";
27
33
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
28
- import { sortResults } from "@/helpers/treeHelper";
34
+ import { getColorMap, getTree, sortResults } from "@/helpers/treeHelper";
29
35
  import { transformPlainMany2Ones } from "@/helpers/formHelper";
30
36
 
31
37
  type One2manyValue = {
@@ -83,7 +89,6 @@ const One2manyInput: React.FC<One2manyInputProps> = (
83
89
  formContext || {};
84
90
  const { lang, t } = useContext(LocaleContext) as LocaleContextType;
85
91
 
86
- const formRef = useRef();
87
92
  const [formHasChanges, setFormHasChanges] = useState<boolean>(false);
88
93
  const [isLoading, setIsLoading] = useState<boolean>(false);
89
94
  const [error, setError] = useState<string>();
@@ -96,6 +101,7 @@ const One2manyInput: React.FC<One2manyInputProps> = (
96
101
  const transformedDomain = useRef<any[]>([]);
97
102
  const [sorter, setSorter] = useState<any>();
98
103
  const originalSortItemIds = useRef<number[]>();
104
+ const [colorsForResults, setColorsForResults] = useState<any>(undefined);
99
105
 
100
106
  const {
101
107
  readOnly,
@@ -106,14 +112,31 @@ const One2manyInput: React.FC<One2manyInputProps> = (
106
112
  const isMany2many = ooui.type === "many2many";
107
113
  const { id: fieldName } = ooui;
108
114
  const itemsToShow = items.filter(
109
- (item) => item.values && item.operation !== "pendingRemove"
115
+ (item) =>
116
+ (item.values || item.treeValues) && item.operation !== "pendingRemove"
110
117
  );
118
+ const previousCurrentView = useRef<ViewType>();
111
119
 
112
120
  useEffect(() => {
113
- if (items.some((item) => !item.values)) {
121
+ if (previousCurrentView.current !== currentView) {
122
+ previousCurrentView.current = currentView;
123
+ fetchDataIfNeeded();
124
+ return;
125
+ }
126
+
127
+ fetchDataIfNeeded();
128
+ }, [items, currentView]);
129
+
130
+ const fetchDataIfNeeded = useCallback(() => {
131
+ if (currentView === "form" && items.some((item) => !item.values)) {
132
+ fetchData();
133
+ } else if (
134
+ currentView === "tree" &&
135
+ items.some((item) => !item.treeValues)
136
+ ) {
114
137
  fetchData();
115
138
  }
116
- }, [items]);
139
+ }, [items, currentView]);
117
140
 
118
141
  useEffect(() => {
119
142
  parseDomain();
@@ -133,25 +156,36 @@ const One2manyInput: React.FC<One2manyInputProps> = (
133
156
  }
134
157
  };
135
158
 
136
- const fetchOriginalItemsFromApi = async () => {
159
+ const fetchOriginalItemsFromApi = async (mode?: ViewType) => {
137
160
  setIsLoading(true);
138
161
  setFormHasChanges(false);
139
162
  setError(undefined);
140
163
 
141
164
  try {
142
- const itemsWithValues = await readObjectValues({
143
- treeFields: views.get("tree").fields,
144
- formFields: views.get("form")?.fields || {},
165
+ const [itemsWithValues, evaluatedColorsForTree] = await readObjectValues({
166
+ treeView: {
167
+ arch: views.get("tree")?.arch,
168
+ fields: views.get("tree")?.fields,
169
+ },
170
+ formView: {
171
+ fields: views.get("form")?.fields || {},
172
+ },
145
173
  model: relation,
146
174
  items,
147
175
  context: { ...getContext?.(), ...context },
176
+ currentView: mode || currentView,
148
177
  });
149
178
 
150
179
  if (!originalSortItemIds.current) {
151
180
  originalSortItemIds.current = itemsWithValues.map((item) => item.id!);
152
181
  }
153
182
 
183
+ if ((currentView || mode) === "tree" && evaluatedColorsForTree) {
184
+ setColorsForResults(evaluatedColorsForTree);
185
+ }
186
+
154
187
  triggerChange(itemsWithValues);
188
+ return itemsWithValues;
155
189
  } catch (err) {
156
190
  setError(err as any);
157
191
  } finally {
@@ -168,6 +202,7 @@ const One2manyInput: React.FC<One2manyInputProps> = (
168
202
  fields: getFields(),
169
203
  values: getValues(),
170
204
  }),
205
+ fields: getFields(),
171
206
  context: getContext(),
172
207
  }),
173
208
  widgetFieldName: fieldName,
@@ -437,10 +472,19 @@ const One2manyInput: React.FC<One2manyInputProps> = (
437
472
  }
438
473
  };
439
474
 
440
- const onTreeRowClicked = (record: any) => {
475
+ const onTreeRowClicked = async (record: any) => {
441
476
  const { id: itemId } = record;
477
+
478
+ let itemsToLoadFrom: One2manyItem[] | undefined = items;
479
+
480
+ // We should fetch the form data if needed in order to get the form values
481
+ const modalItem = items.find((item) => item.id === itemId);
482
+ if (modalItem?.values === undefined) {
483
+ itemsToLoadFrom = await fetchOriginalItemsFromApi("form");
484
+ }
485
+
442
486
  // We show the detail for the clicked item in a Form modal
443
- setModalItem(items.find((item) => item.id === itemId));
487
+ setModalItem(itemsToLoadFrom!.find((item) => item.id === itemId));
444
488
  setContinuousEntryMode(false);
445
489
  setShowFormModal(true);
446
490
  };
@@ -506,12 +550,18 @@ const One2manyInput: React.FC<One2manyInputProps> = (
506
550
  return t("noCurrentEntries");
507
551
  }
508
552
 
553
+ if (
554
+ currentView !== previousCurrentView.current &&
555
+ items.some((item) => !item.values)
556
+ ) {
557
+ return <Spin />;
558
+ }
559
+
509
560
  return (
510
561
  <Form
511
562
  formView={views.get("form")}
512
563
  values={itemsToShow[itemIndex]?.values}
513
564
  parentContext={{ ...getContext?.(), ...context }}
514
- ref={formRef}
515
565
  model={relation}
516
566
  id={itemsToShow[itemIndex]?.id}
517
567
  submitMode={"values"}
@@ -542,16 +592,20 @@ const One2manyInput: React.FC<One2manyInputProps> = (
542
592
  );
543
593
  }
544
594
 
545
- const resultsToShow = sorter
546
- ? sortResults({
547
- resultsToSort: itemsToShow.map((item) => item.treeValues),
548
- sorter,
549
- fields: {
550
- ...views.get("tree").fields,
551
- ...(views.get("form")?.fields || {}),
552
- },
553
- })
554
- : itemsToShow.map((item) => item.treeValues);
595
+ let resultsToShow = [];
596
+
597
+ if (itemsToShow.some((item) => item.treeValues)) {
598
+ resultsToShow = sorter
599
+ ? sortResults({
600
+ resultsToSort: itemsToShow.map((item) => item.treeValues),
601
+ sorter,
602
+ fields: {
603
+ ...views.get("tree").fields,
604
+ ...(views.get("form")?.fields || {}),
605
+ },
606
+ })
607
+ : itemsToShow.map((item) => item.treeValues);
608
+ }
555
609
 
556
610
  if (currentView === "tree") {
557
611
  return (
@@ -573,6 +627,8 @@ const One2manyInput: React.FC<One2manyInputProps> = (
573
627
  }}
574
628
  sorter={sorter}
575
629
  onChangeSort={setSorter}
630
+ context={{ ...getContext?.(), ...context }}
631
+ colorsForResults={colorsForResults}
576
632
  />
577
633
  );
578
634
  }
@@ -11,6 +11,8 @@ import {
11
11
  ApiOutlined,
12
12
  } from "@ant-design/icons";
13
13
  import { ViewType } from "@/types";
14
+ import { theme } from "antd";
15
+ const { useToken } = theme;
14
16
 
15
17
  type One2manyTopBarProps = {
16
18
  title: string;
@@ -49,6 +51,7 @@ export const One2manyTopBar = (props: One2manyTopBarProps) => {
49
51
  showCreateButton,
50
52
  showToggleButton,
51
53
  } = props;
54
+ const { token } = useToken();
52
55
 
53
56
  function separator() {
54
57
  return <div className="inline-block w-3" />;
@@ -56,7 +59,13 @@ export const One2manyTopBar = (props: One2manyTopBarProps) => {
56
59
 
57
60
  function title() {
58
61
  return (
59
- <div className="flex flex-grow h-8 text-gray-200 bg-gray-700">
62
+ <div
63
+ className="flex flex-grow h-8 text-white"
64
+ style={{
65
+ borderRadius: token.borderRadius,
66
+ backgroundColor: token.colorPrimaryActive,
67
+ }}
68
+ >
60
69
  <div className="flex flex-col items-center justify-center h-full">
61
70
  <span className="pl-2 font-bold">{titleString}</span>
62
71
  </div>
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import { Group as GroupOoui } from "@gisce/ooui";
3
3
  import Container from "./Container";
4
- import Fieldset from "@/ui/Fieldset";
4
+ import { FieldSet } from "@gisce/react-formiga-components";
5
+ import { Space } from "antd";
6
+ import iconMapper from "@/helpers/iconMapper";
5
7
 
6
8
  type Props = {
7
9
  ooui: GroupOoui;
@@ -11,16 +13,17 @@ type Props = {
11
13
 
12
14
  function Group(props: Props): React.ReactElement {
13
15
  const { ooui, showLabel = true, responsiveBehaviour } = props;
16
+ const icon: React.ElementType | undefined = iconMapper(ooui.icon || "");
14
17
 
15
18
  return (
16
19
  <>
17
- {ooui.label && showLabel ? (
18
- <Fieldset label={ooui.label}>
20
+ {(ooui.label || icon) && showLabel ? (
21
+ <FieldSet label={ooui.label} icon={icon}>
19
22
  <Container
20
23
  container={ooui!.container}
21
24
  responsiveBehaviour={responsiveBehaviour}
22
25
  />
23
- </Fieldset>
26
+ </FieldSet>
24
27
  ) : (
25
28
  <Container
26
29
  container={ooui!.container}
@@ -83,7 +83,7 @@ export const ButtonGroup = (props: ButtonGroupProps) => {
83
83
  type={primary ? "primary" : undefined}
84
84
  //danger={danger ? true : undefined} This works but typescript
85
85
  // doesn't accept
86
- overlay={<Items ooui={secondaryButtons} />}
86
+ overlay={Items({ooui: secondaryButtons})}
87
87
  >
88
88
  {getButtonIcon()}
89
89
  {caption}
@@ -2,14 +2,11 @@ import React from "react";
2
2
  import Field from "@/common/Field";
3
3
  import { Char as CharOoui } from "@gisce/ooui";
4
4
  import { WidgetProps } from "@/types";
5
- import Config from "@/Config";
6
5
  import { GridUi } from "fiber-diagram";
7
6
 
8
7
  export const FiberGrid = (props: WidgetProps) => {
9
8
  const { ooui } = props;
10
- const { id, readOnly, required } = ooui as CharOoui;
11
- // const requiredClass =
12
- // required && !readOnly ? Config.requiredClass : undefined;
9
+ const { required } = ooui as CharOoui;
13
10
 
14
11
  return (
15
12
  <Field required={required} {...props}>
@@ -1,14 +1,15 @@
1
1
  import React from "react";
2
- import { Tooltip } from "antd";
2
+ import { Tooltip, theme } from "antd";
3
3
  import { Statistic, Card } from "antd";
4
4
  import { Indicator as IndicatorOoui } from "@gisce/ooui";
5
5
  import { WidgetProps } from "@/types";
6
6
  import Field from "@/common/Field";
7
- import {QuestionCircleOutlined} from "@ant-design/icons";
7
+ import { QuestionCircleOutlined } from "@ant-design/icons";
8
8
  import iconMapper from "@/helpers/iconMapper";
9
+ const { useToken } = theme;
9
10
 
10
11
  type IndicatorProps = WidgetProps & {
11
- ooui: IndicatorOoui
12
+ ooui: IndicatorOoui;
12
13
  value?: number;
13
14
  };
14
15
 
@@ -25,18 +26,22 @@ export const Indicator = (props: IndicatorProps) => {
25
26
  type IndicatorInputProps = {
26
27
  ooui: IndicatorOoui;
27
28
  value?: any;
28
- }
29
+ };
29
30
 
30
31
  const IndicatorInput = (props: IndicatorInputProps) => {
32
+ const { token } = useToken();
31
33
  const { ooui, value } = props;
32
34
  const title = (
33
35
  <>
34
36
  <span>{ooui.label} </span>
35
- {ooui.tooltip &&
37
+ {ooui.tooltip && (
36
38
  <Tooltip title={ooui.tooltip}>
37
- <QuestionCircleOutlined className="pr-1 text-xs text-blue-400"/>
39
+ <QuestionCircleOutlined
40
+ className="pr-1 text-xs"
41
+ style={{ color: token.colorPrimaryBg }}
42
+ />
38
43
  </Tooltip>
39
- }
44
+ )}
40
45
  </>
41
46
  );
42
47
  const Icon: React.ElementType = iconMapper(ooui.icon) as any;
@@ -49,18 +54,14 @@ const IndicatorInput = (props: IndicatorInputProps) => {
49
54
  const field = (
50
55
  <Statistic
51
56
  title={title}
52
- prefix={Icon && <Icon/>}
57
+ prefix={Icon && <Icon />}
53
58
  suffix={ooui.suffix}
54
59
  value={formattedValue}
55
60
  />
56
- )
61
+ );
57
62
  if (ooui.card) {
58
- return (
59
- <Card>
60
- {field}
61
- </Card>
62
- );
63
+ return <Card>{field}</Card>;
63
64
  } else {
64
65
  return field;
65
66
  }
66
- }
67
+ };