@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
@@ -113,6 +113,7 @@ export const GraphActionView = (props: GraphActionViewProps) => {
113
113
  formView.search_fields,
114
114
  treeView.search_fields,
115
115
  ])}
116
+ formXml={formView.arch}
116
117
  limit={limit!}
117
118
  onClear={clear}
118
119
  offset={offset}
@@ -2,7 +2,11 @@ import TreeActionBar from "@/actionbar/TreeActionBar";
2
2
  import { FormView, TreeView, View } from "@/types";
3
3
  import TitleHeader from "@/ui/TitleHeader";
4
4
  import SearchTree from "@/widgets/views/SearchTree";
5
- import React from "react";
5
+ import React, { useContext } from "react";
6
+ import {
7
+ ActionViewContext,
8
+ ActionViewContextType,
9
+ } from "@/context/ActionViewContext";
6
10
 
7
11
  export type TreeActionViewProps = {
8
12
  formView?: FormView;
@@ -38,6 +42,10 @@ export const TreeActionView = (props: TreeActionViewProps) => {
38
42
  searchTreeNameSearch,
39
43
  } = props;
40
44
 
45
+ const { currentView, setPreviousView } = useContext(
46
+ ActionViewContext
47
+ ) as ActionViewContextType;
48
+
41
49
  if (!visible) {
42
50
  return null;
43
51
  }
@@ -66,6 +74,7 @@ export const TreeActionView = (props: TreeActionViewProps) => {
66
74
  const itemIndex = results.findIndex((item: any) => {
67
75
  return item.id === id;
68
76
  });
77
+ setPreviousView?.(currentView);
69
78
  setCurrentItemIndex(itemIndex);
70
79
  const formView = availableViews.find(
71
80
  (v) => v.type === "form"
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import { CloseOutlined } from "@ant-design/icons";
3
+ import { theme } from "antd";
4
+ const { useToken } = theme;
3
5
 
4
6
  type TabProps = {
5
7
  tabKey: string;
@@ -11,8 +13,8 @@ type TabProps = {
11
13
 
12
14
  function Tab(props: TabProps) {
13
15
  const { label, onClose, tabKey, isActive, onSelected } = props;
14
-
15
- const bgColor = isActive ? "#ffffff" : "#F1F5F9";
16
+ const { token } = useToken();
17
+ const bgColor = isActive ? token.colorBgContainer : token.colorPrimaryBg;
16
18
 
17
19
  return (
18
20
  <div
@@ -32,14 +34,14 @@ function Tab(props: TabProps) {
32
34
  flexDirection: "row",
33
35
  alignItems: "center",
34
36
  justifyContent: "center",
35
- borderTopLeftRadius: 8,
36
- borderTopRightRadius: 8,
37
+ borderTopLeftRadius: token.borderRadius,
38
+ borderTopRightRadius: token.borderRadius,
37
39
  marginLeft: 2,
38
40
  }}
39
41
  >
40
42
  <div
41
43
  style={{
42
- color: isActive ? "#001529" : "#ADB0B3",
44
+ color: isActive ? token.colorPrimaryActive : token.colorPrimaryBorder,
43
45
  userSelect: "none",
44
46
  height: 40,
45
47
  display: "flex",
@@ -63,7 +65,11 @@ function Tab(props: TabProps) {
63
65
  }}
64
66
  >
65
67
  <CloseOutlined
66
- style={{ color: isActive ? "#001529" : "#ADB0B3" }}
68
+ style={{
69
+ color: isActive
70
+ ? token.colorPrimaryActive
71
+ : token.colorPrimaryBorder,
72
+ }}
67
73
  onClick={(e) => {
68
74
  e.stopPropagation();
69
75
  onClose(tabKey);
@@ -26,9 +26,11 @@ import {
26
26
  FloatTime,
27
27
  ProgressBar,
28
28
  MultiCheckbox,
29
+ Markdown,
29
30
  Radio,
30
31
  Switch,
31
32
  Steps,
33
+ Tag,
32
34
  CodeEditor,
33
35
  } from "@/index";
34
36
  import { Image } from "./base/Image";
@@ -99,8 +101,12 @@ const getWidgetType = (type: string) => {
99
101
  return Indicator;
100
102
  case "tags":
101
103
  return Tags;
104
+ case "tag":
105
+ return Tag;
102
106
  case "multicheckbox":
103
107
  return MultiCheckbox;
108
+ case "markdown":
109
+ return Markdown;
104
110
  case "radio":
105
111
  return Radio;
106
112
  case "switch":
@@ -1,8 +1,8 @@
1
1
  import React, { useRef, useContext } from "react";
2
- import { Row, Col, Button, Input, Space } from "antd";
2
+ import { Row, Col, Button, Input, Space, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
4
  import { Binary as BinaryOoui } from "@gisce/ooui";
5
- import Config from "@/Config";
5
+ const { useToken } = theme;
6
6
  import ButtonWithTooltip from "@/common/ButtonWithTooltip";
7
7
  import {
8
8
  FolderOpenOutlined,
@@ -44,8 +44,11 @@ interface BinaryInputProps {
44
44
  export const BinaryInput = (props: BinaryInputProps) => {
45
45
  const { ooui, value, onChange } = props;
46
46
  const { readOnly, required, filenameField } = ooui as BinaryOoui;
47
- const requiredClass =
48
- required && !readOnly ? Config.requiredClass : undefined;
47
+ const { token } = useToken();
48
+ const requiredStyle =
49
+ required && !readOnly
50
+ ? { backgroundColor: token.colorPrimaryBg }
51
+ : undefined;
49
52
  const inputFile = useRef(null);
50
53
  const { setFieldValue, getFieldValue } =
51
54
  (useContext(FormContext) as FormContextType) || {};
@@ -104,7 +107,7 @@ export const BinaryInput = (props: BinaryInputProps) => {
104
107
  <Input
105
108
  type="text"
106
109
  disabled={true}
107
- className={requiredClass}
110
+ style={requiredStyle}
108
111
  value={filesize}
109
112
  />
110
113
  </Col>
@@ -4,17 +4,18 @@ import styled from "styled-components";
4
4
 
5
5
  import Field from "@/common/Field";
6
6
  import { WidgetProps } from "@/types";
7
- import Config from "@/Config";
7
+ import { theme } from "antd";
8
+
9
+ const { defaultAlgorithm, defaultSeed } = theme;
10
+
11
+ const mapToken = defaultAlgorithm(defaultSeed);
8
12
 
9
13
  export const Boolean = (props: WidgetProps) => {
10
14
  const { ooui } = props;
11
15
  const { id, readOnly, required } = ooui;
12
16
 
13
17
  return (
14
- <Field
15
- {...props}
16
- valuePropName="checked"
17
- >
18
+ <Field {...props} valuePropName="checked">
18
19
  <BooleanInput id={id} readOnly={readOnly} required={required} />
19
20
  </Field>
20
21
  );
@@ -35,10 +36,10 @@ const BooleanInput = (props: any) => {
35
36
 
36
37
  const RequiredCheckbox = styled(AntCheckbox)`
37
38
  .ant-checkbox-inner {
38
- background-color: ${Config.requiredColor};
39
+ background-color: ${mapToken.colorPrimaryBg};
39
40
  }
40
41
 
41
42
  .ant-checkbox-checked .ant-checkbox-inner {
42
- background-color: #089cff;
43
+ background-color: ${mapToken.colorPrimary};
43
44
  }
44
45
  `;
@@ -1,15 +1,15 @@
1
- import React, { useContext, useState } from "react";
2
- import { Col, Input, Row } from "antd";
1
+ import React, { CSSProperties, useContext, useState } from "react";
2
+ import { Col, Input, Row, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
4
  import { Char as CharOoui } from "@gisce/ooui";
5
5
  import { WidgetProps } from "@/types";
6
- import Config from "@/Config";
7
6
  import { TranslationModal } from "../modals/TranslationModal";
8
7
  import { FormContext, FormContextType } from "@/context/FormContext";
9
8
  import ButtonWithTooltip from "@/common/ButtonWithTooltip";
10
9
  import { TranslationOutlined } from "@ant-design/icons";
11
10
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
12
11
  import showInfo from "@/ui/InfoDialog";
12
+ const { useToken } = theme;
13
13
 
14
14
  type CharProps = WidgetProps & {
15
15
  isSearchField?: boolean;
@@ -18,8 +18,11 @@ type CharProps = WidgetProps & {
18
18
  export const Char = (props: CharProps) => {
19
19
  const { ooui, isSearchField = false } = props;
20
20
  const { id, readOnly, isPassword, required, translatable } = ooui as CharOoui;
21
- const requiredClass =
22
- required && !readOnly ? Config.requiredClass : undefined;
21
+ const { token } = useToken();
22
+ const requiredStyle =
23
+ required && !readOnly
24
+ ? { backgroundColor: token.colorPrimaryBg }
25
+ : undefined;
23
26
  const formContext = useContext(FormContext) as FormContextType;
24
27
  const { elementHasLostFocus } = formContext || {};
25
28
 
@@ -27,7 +30,7 @@ export const Char = (props: CharProps) => {
27
30
  <Input
28
31
  disabled={readOnly || (translatable && !isSearchField)}
29
32
  id={id}
30
- className={requiredClass}
33
+ style={requiredStyle}
31
34
  maxLength={(ooui as CharOoui).size}
32
35
  onBlur={elementHasLostFocus}
33
36
  />
@@ -44,7 +47,7 @@ export const Char = (props: CharProps) => {
44
47
  }
45
48
 
46
49
  if (translatable && !readOnly && !isSearchField) {
47
- input = <TranslatableChar field={id} requiredClass={requiredClass} />;
50
+ input = <TranslatableChar field={id} requiredStyle={requiredStyle} />;
48
51
  }
49
52
 
50
53
  return (
@@ -57,12 +60,12 @@ export const Char = (props: CharProps) => {
57
60
  const TranslatableChar = ({
58
61
  value,
59
62
  field,
60
- requiredClass,
63
+ requiredStyle,
61
64
  onChange,
62
65
  }: {
63
66
  value?: string;
64
67
  field: string;
65
- requiredClass: string | undefined;
68
+ requiredStyle: CSSProperties | undefined;
66
69
  onChange?: (value: string) => void;
67
70
  }) => {
68
71
  const formContext = useContext(FormContext) as FormContextType;
@@ -84,7 +87,7 @@ const TranslatableChar = ({
84
87
  <Input
85
88
  value={value}
86
89
  id={field}
87
- className={requiredClass}
90
+ style={requiredStyle}
88
91
  onChange={(event: any) => {
89
92
  onChange?.(event.target.value);
90
93
  }}
@@ -129,12 +132,11 @@ const TranslatableChar = ({
129
132
  value={value}
130
133
  disabled={true}
131
134
  id={field}
132
- className={requiredClass}
133
135
  onChange={(event: any) => {
134
136
  onChange?.(event.target.value);
135
137
  }}
136
138
  onBlur={elementHasLostFocus}
137
- style={{ cursor: "pointer" }}
139
+ style={{ cursor: "pointer", ...requiredStyle }}
138
140
  />
139
141
  </div>
140
142
  <TranslationModal
@@ -1,16 +1,21 @@
1
1
  import React, { useContext } from "react";
2
- import { InputNumber } from "antd";
2
+ import { InputNumber, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
4
  import { Float as FloatOoui } from "@gisce/ooui";
5
5
  import { WidgetProps } from "@/types";
6
- import Config from "@/Config";
6
+ const { useToken } = theme;
7
+
7
8
  import { FormContext, FormContextType } from "@/context/FormContext";
8
9
 
9
10
  export const Float = (props: WidgetProps) => {
10
11
  const { ooui } = props;
11
12
  const { id, decimalDigits, readOnly, required } = ooui as FloatOoui;
12
- const requiredClass =
13
- required && !readOnly ? Config.requiredClass : undefined;
13
+ const { token } = useToken();
14
+
15
+ const requiredStyle =
16
+ required && !readOnly
17
+ ? { backgroundColor: token.colorPrimaryBg }
18
+ : undefined;
14
19
  const formContext = useContext(FormContext) as FormContextType;
15
20
  const { elementHasLostFocus } = formContext || {};
16
21
 
@@ -18,7 +23,8 @@ export const Float = (props: WidgetProps) => {
18
23
  <Field required={required} type={"number"} {...props}>
19
24
  <InputNumber
20
25
  disabled={readOnly}
21
- className={"w-full " + requiredClass}
26
+ className={"w-full"}
27
+ style={requiredStyle}
22
28
  id={id}
23
29
  precision={decimalDigits}
24
30
  formatter={(value) => {
@@ -1,11 +1,11 @@
1
1
  import React, { useContext, useEffect, useRef, useState } from "react";
2
- import { Input } from "antd";
2
+ import { Input, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
4
  import { Float as FloatOoui } from "@gisce/ooui";
5
5
  import { WidgetProps } from "@/types";
6
- import Config from "@/Config";
7
6
  import { parseFloatToString, parseStringToFloat } from "@/helpers/timeHelper";
8
7
  import { FormContext, FormContextType } from "@/context/FormContext";
8
+ const { useToken } = theme;
9
9
 
10
10
  export const FloatTime = (props: WidgetProps) => {
11
11
  const { ooui } = props;
@@ -29,8 +29,11 @@ export const FloatTimeInput: React.FC<FloatTimeInputProps> = (
29
29
  ) => {
30
30
  const { ooui, value, onChange } = props;
31
31
  const { id, readOnly, required } = ooui as FloatOoui;
32
- const requiredClass =
33
- required && !readOnly ? Config.requiredClass : undefined;
32
+ const { token } = useToken();
33
+ const requiredStyle =
34
+ required && !readOnly
35
+ ? { backgroundColor: token.colorPrimaryBg }
36
+ : undefined;
34
37
  const inputTextRef = useRef<string>();
35
38
  const [inputText, setInputText] = useState<string>();
36
39
  const formContext = useContext(FormContext) as FormContextType;
@@ -59,7 +62,8 @@ export const FloatTimeInput: React.FC<FloatTimeInputProps> = (
59
62
  <Input
60
63
  value={inputText}
61
64
  disabled={readOnly}
62
- className={"w-full " + requiredClass}
65
+ className={"w-full"}
66
+ style={requiredStyle}
63
67
  id={id}
64
68
  placeholder={"00:00"}
65
69
  onChange={onValueStringChange}
@@ -1,9 +1,9 @@
1
1
  import React, { useContext } from "react";
2
- import { InputNumber } from "antd";
2
+ import { InputNumber, theme } from "antd";
3
3
  import Field from "@/common/Field";
4
4
  import { WidgetProps } from "@/types";
5
- import Config from "@/Config";
6
5
  import { FormContext, FormContextType } from "@/context/FormContext";
6
+ const { useToken } = theme;
7
7
 
8
8
  type IntegerProps = WidgetProps & {
9
9
  onChange?: (newValue: number) => void;
@@ -12,8 +12,11 @@ type IntegerProps = WidgetProps & {
12
12
  export const Integer = (props: IntegerProps) => {
13
13
  const { ooui, onChange } = props;
14
14
  const { id, readOnly, required } = ooui;
15
- const requiredClass =
16
- required && !readOnly ? Config.requiredClass : undefined;
15
+ const { token } = useToken();
16
+ const requiredStyle =
17
+ required && !readOnly
18
+ ? { backgroundColor: token.colorPrimaryBg }
19
+ : undefined;
17
20
  const formContext = useContext(FormContext) as FormContextType;
18
21
  const { elementHasLostFocus } = formContext || {};
19
22
 
@@ -21,7 +24,7 @@ export const Integer = (props: IntegerProps) => {
21
24
  <Field required={required} type={"number"} {...props}>
22
25
  <InputNumber
23
26
  id={id}
24
- className={"w-full " + requiredClass}
27
+ className={"w-full "}
25
28
  disabled={readOnly}
26
29
  formatter={(value) => {
27
30
  return `${value}`.replace(/[^0-9\-]+/g, "");
@@ -32,6 +35,8 @@ export const Integer = (props: IntegerProps) => {
32
35
  }}
33
36
  defaultValue={0}
34
37
  onBlur={elementHasLostFocus}
38
+ precision={0}
39
+ style={requiredStyle}
35
40
  />
36
41
  </Field>
37
42
  );
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
- import { Tooltip, Typography } from "antd";
2
+ import { Tooltip, Typography, theme } from "antd";
3
3
  import { WidgetProps } from "@/types";
4
4
  import { QuestionCircleOutlined } from "@ant-design/icons";
5
5
  import { Label as LabelOoui } from "@gisce/ooui";
6
+ import { Interweave } from "interweave";
6
7
  const { Text, Title } = Typography;
8
+ const { useToken } = theme;
7
9
 
8
10
  type Props = WidgetProps & {
9
11
  align?: "left" | "center" | "right";
@@ -18,19 +20,15 @@ const alignClass = {
18
20
 
19
21
  const Label = (props: Props) => {
20
22
  const { ooui, align, responsiveBehaviour } = props;
21
- const {
22
- label,
23
- tooltip,
24
- fieldForLabel,
25
- labelSize,
26
- labelType,
27
- } = ooui as LabelOoui;
23
+ const { label, tooltip, fieldForLabel, labelSize, labelType } =
24
+ ooui as LabelOoui;
28
25
  const addColon = fieldForLabel !== null ? true : false;
29
26
  const labelText = addColon && label.length > 1 ? label + " :" : label;
30
27
  const responsiveAlign = responsiveBehaviour ? "left" : "right";
31
28
  const labelAlgin = align ? align : fieldForLabel ? responsiveAlign : "left";
29
+ const { token } = useToken();
32
30
 
33
- const TextType = labelSize === "text" ? Text : Title;
31
+ const TextType = labelSize === undefined ? Text : Title;
34
32
 
35
33
  return (
36
34
  <div
@@ -38,15 +36,17 @@ const Label = (props: Props) => {
38
36
  >
39
37
  {tooltip && (
40
38
  <Tooltip title={tooltip}>
41
- <QuestionCircleOutlined className="pr-1 text-xs text-blue-400" />
39
+ <QuestionCircleOutlined className="pr-1 text-xs" style={{
40
+ color: token.colorPrimary
41
+ }} />
42
42
  </Tooltip>
43
43
  )}
44
44
  <span className="pr-2">
45
45
  <TextType
46
- level={labelSize !== "text" ? ((labelSize as string) as any) : null}
46
+ level={labelSize}
47
47
  type={labelType as any}
48
48
  >
49
- {labelText}
49
+ <Interweave content={labelText} />
50
50
  </TextType>
51
51
  </span>
52
52
  </div>
@@ -1,9 +1,9 @@
1
1
  import React, { useContext, useEffect, useState } from "react";
2
- import { Input, Button, Row, Col } from "antd";
2
+ import { Input, Button, Row, Col, theme } from "antd";
3
3
  import { Char as CharOoui } from "@gisce/ooui";
4
- import Config from "@/Config";
5
4
  import { EditOutlined, CheckOutlined } from "@ant-design/icons";
6
5
  import { FormContext, FormContextType } from "@/context/FormContext";
6
+ const { useToken } = theme;
7
7
 
8
8
  interface LinkInputProps {
9
9
  ooui: CharOoui;
@@ -16,8 +16,11 @@ interface LinkInputProps {
16
16
  export const LinkInput = (props: LinkInputProps) => {
17
17
  const { ooui, value, onChange, valueValidator, linkPrefix = "" } = props;
18
18
  const { id, readOnly, required } = ooui as CharOoui;
19
- const requiredClass =
20
- required && !readOnly ? Config.requiredClass : undefined;
19
+ const { token } = useToken();
20
+ const requiredStyle =
21
+ required && !readOnly
22
+ ? { backgroundColor: token.colorPrimaryBg }
23
+ : undefined;
21
24
  const formContext = useContext(FormContext) as FormContextType;
22
25
  const { elementHasLostFocus } = formContext || {};
23
26
 
@@ -52,6 +55,7 @@ export const LinkInput = (props: LinkInputProps) => {
52
55
  setShowInput(false);
53
56
  }
54
57
  }}
58
+ style={{ borderTopRightRadius: 0, borderBottomRightRadius: 0 }}
55
59
  tabIndex={-1}
56
60
  />
57
61
  ) : (
@@ -61,6 +65,7 @@ export const LinkInput = (props: LinkInputProps) => {
61
65
  setEditMode(true);
62
66
  setShowInput(true);
63
67
  }}
68
+ style={{ borderTopRightRadius: 0, borderBottomRightRadius: 0 }}
64
69
  tabIndex={-1}
65
70
  />
66
71
  )}
@@ -69,9 +74,9 @@ export const LinkInput = (props: LinkInputProps) => {
69
74
  <Col flex="auto">
70
75
  {showInput ? (
71
76
  <Input
77
+ style={{ borderTopLeftRadius: 0, borderBottomLeftRadius: 0, ...requiredStyle }}
72
78
  id={id}
73
79
  onChange={onValueStringChange}
74
- className={requiredClass}
75
80
  value={value}
76
81
  onBlur={() => {
77
82
  if (valueValidator(value)) {
@@ -84,7 +89,7 @@ export const LinkInput = (props: LinkInputProps) => {
84
89
  ) : (
85
90
  <a
86
91
  href={`${linkPrefix}${value}`}
87
- style={{ color: "#1890ff", paddingRight: 15 }}
92
+ style={{ color: token.colorPrimary, paddingRight: 15 }}
88
93
  target="_blank"
89
94
  >
90
95
  {value}
@@ -5,7 +5,11 @@ import styled from "styled-components";
5
5
  import Field from "@/common/Field";
6
6
  import { Selection as SelectionOoui } from "@gisce/ooui";
7
7
  import { WidgetProps } from "@/types";
8
- import Config from "@/Config";
8
+ import { theme } from "antd";
9
+
10
+ const { defaultAlgorithm, defaultSeed } = theme;
11
+
12
+ const mapToken = defaultAlgorithm(defaultSeed);
9
13
 
10
14
  const { Option } = Select;
11
15
 
@@ -82,6 +86,6 @@ export const MultiSelectionInput = (props: SelectionInputProps) => {
82
86
 
83
87
  const RequiredSelect = styled(Select)`
84
88
  &.ant-select:not(.ant-select-customize-input) .ant-select-selector {
85
- background-color: ${Config.requiredColor};
89
+ background-color: ${mapToken.colorPrimaryBg};
86
90
  }
87
91
  `;
@@ -49,6 +49,8 @@ export const ReferenceInput: React.FC<ReferenceInputProps> = (
49
49
 
50
50
  useEffect(() => {
51
51
  if (!value) {
52
+ setSelectionValue(undefined);
53
+ setMany2oneValue([]);
52
54
  return;
53
55
  }
54
56
 
@@ -73,8 +75,16 @@ export const ReferenceInput: React.FC<ReferenceInputProps> = (
73
75
  }
74
76
  onChange={(changedValue: string) => {
75
77
  setSelectionValue(changedValue);
76
- setMany2oneValue([]);
77
- onChange?.(undefined);
78
+ let m2oValue = many2oneValue[0] || 0;
79
+ if (changedValue !== selectionValue) {
80
+ setMany2oneValue([]);
81
+ m2oValue = 0;
82
+ }
83
+ const referenceValue = `${changedValue},${m2oValue}`;
84
+ if (referenceValue === value) {
85
+ return;
86
+ }
87
+ onChange?.(referenceValue);
78
88
  }}
79
89
  value={selectionValue}
80
90
  />
@@ -92,7 +102,7 @@ export const ReferenceInput: React.FC<ReferenceInputProps> = (
92
102
  value={many2oneValue}
93
103
  onChange={(changedValue: any[]) => {
94
104
  setMany2oneValue(changedValue);
95
- const referenceValue = `${selectionValue},${changedValue[0]}`;
105
+ const referenceValue = `${selectionValue},${changedValue[0] || 0}`;
96
106
  if (referenceValue === value) {
97
107
  return;
98
108
  }
@@ -0,0 +1,62 @@
1
+ import ConnectionProvider from "@/ConnectionProvider";
2
+ import { Space } from "antd";
3
+ import React, { useCallback, useEffect, useState } from "react";
4
+ import { Many2oneSuffix } from "./many2one/Many2oneSuffix";
5
+ import { LoadingOutlined } from "@ant-design/icons";
6
+
7
+ export type ReferenceTreeProps = {
8
+ value: string;
9
+ context?: any;
10
+ selectionValues?: any;
11
+ };
12
+
13
+ export const ReferenceTree = (
14
+ props: ReferenceTreeProps
15
+ ): React.ReactElement => {
16
+ const { value, context, selectionValues } = props;
17
+ const [name, setName] = useState();
18
+ const [loading, setLoading] = useState(false);
19
+
20
+ const [model, id] = value ? value.split(",") : [];
21
+ const intId = parseInt(id);
22
+
23
+ const fetchName = useCallback(async () => {
24
+ if (!value) {
25
+ return;
26
+ }
27
+ if (value && name) {
28
+ return;
29
+ }
30
+ setLoading(true);
31
+ const nameResponse = await ConnectionProvider.getHandler().execute({
32
+ action: "name_get",
33
+ payload: [intId],
34
+ model,
35
+ context,
36
+ });
37
+ setName(nameResponse[0][1]);
38
+ setLoading(false);
39
+ }, [value, name]);
40
+
41
+ useEffect(() => {
42
+ fetchName();
43
+ }, [value]);
44
+
45
+ if (!value && !loading) {
46
+ return <></>;
47
+ }
48
+
49
+ if (loading) {
50
+ return <LoadingOutlined />;
51
+ }
52
+
53
+ const selectionDescription = selectionValues.get(model);
54
+
55
+ return (
56
+ <Space>
57
+ <>{`${selectionDescription}:`}</>
58
+ <>{name}</>
59
+ <Many2oneSuffix id={intId} model={model} />
60
+ </Space>
61
+ );
62
+ };
@@ -5,7 +5,11 @@ import styled from "styled-components";
5
5
  import Field from "@/common/Field";
6
6
  import { Selection as SelectionOoui } from "@gisce/ooui";
7
7
  import { WidgetProps } from "@/types";
8
- import Config from "@/Config";
8
+ import { theme } from "antd";
9
+
10
+ const { defaultAlgorithm, defaultSeed } = theme;
11
+
12
+ const mapToken = defaultAlgorithm(defaultSeed);
9
13
 
10
14
  const { Option } = Select;
11
15
 
@@ -56,6 +60,6 @@ export const SelectionInput = (props: SelectionInputProps) => {
56
60
 
57
61
  const RequiredSelect = styled(Select)`
58
62
  &.ant-select:not(.ant-select-customize-input) .ant-select-selector {
59
- background-color: ${Config.requiredColor};
63
+ background-color: ${mapToken.colorPrimaryBg};
60
64
  }
61
65
  `;