@gisce/react-ooui 1.2.0-rc.9 → 1.2.0-rc.91

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 (355) 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/filesHelper.d.ts.map +1 -1
  42. package/dist/helpers/formHelper.d.ts +5 -3
  43. package/dist/helpers/formHelper.d.ts.map +1 -1
  44. package/dist/helpers/iconMapper.d.ts +11 -2
  45. package/dist/helpers/iconMapper.d.ts.map +1 -1
  46. package/dist/helpers/one2manyHelper.d.ts +12 -4
  47. package/dist/helpers/one2manyHelper.d.ts.map +1 -1
  48. package/dist/helpers/searchHelper.d.ts +1 -1
  49. package/dist/helpers/searchHelper.d.ts.map +1 -1
  50. package/dist/helpers/treeHelper.d.ts +1 -1
  51. package/dist/helpers/treeHelper.d.ts.map +1 -1
  52. package/dist/hooks/useExport.d.ts +44 -0
  53. package/dist/hooks/useExport.d.ts.map +1 -0
  54. package/dist/index.d.ts +4 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/locales/ca_ES.d.ts +2 -0
  57. package/dist/locales/ca_ES.d.ts.map +1 -1
  58. package/dist/locales/en_US.d.ts +2 -0
  59. package/dist/locales/en_US.d.ts.map +1 -1
  60. package/dist/locales/es_ES.d.ts +2 -0
  61. package/dist/locales/es_ES.d.ts.map +1 -1
  62. package/dist/react-ooui.es.js +9360 -29063
  63. package/dist/react-ooui.es.js.map +1 -1
  64. package/dist/react-ooui.umd.js +16 -265
  65. package/dist/react-ooui.umd.js.map +1 -1
  66. package/dist/style.css +1 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/index.d.ts.map +1 -1
  69. package/dist/ui/ActionErrorDialog.d.ts.map +1 -1
  70. package/dist/ui/ErrorAlert.d.ts +6 -0
  71. package/dist/ui/ErrorAlert.d.ts.map +1 -0
  72. package/dist/ui/FavouriteButton.d.ts +2 -2
  73. package/dist/ui/FavouriteButton.d.ts.map +1 -1
  74. package/dist/ui/GoToResourceModal.d.ts +2 -2
  75. package/dist/ui/GoToResourceModal.d.ts.map +1 -1
  76. package/dist/ui/TitleHeader.d.ts +2 -2
  77. package/dist/ui/TitleHeader.d.ts.map +1 -1
  78. package/dist/views/ActionView.d.ts.map +1 -1
  79. package/dist/views/CurrentTabContent.d.ts +2 -2
  80. package/dist/views/CurrentTabContent.d.ts.map +1 -1
  81. package/dist/views/RootView.d.ts.map +1 -1
  82. package/dist/views/TabContent.d.ts +1 -1
  83. package/dist/views/TabContent.d.ts.map +1 -1
  84. package/dist/views/TabSelector.d.ts +2 -2
  85. package/dist/views/TabSelector.d.ts.map +1 -1
  86. package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
  87. package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
  88. package/dist/views/actionViews/FormActionView.d.ts +2 -2
  89. package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
  90. package/dist/views/actionViews/GraphActionView.d.ts +2 -2
  91. package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
  92. package/dist/views/actionViews/TreeActionView.d.ts +2 -2
  93. package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
  94. package/dist/views/tabs/Tab.d.ts +2 -2
  95. package/dist/views/tabs/Tab.d.ts.map +1 -1
  96. package/dist/widgets/WidgetFactory.d.ts.map +1 -1
  97. package/dist/widgets/base/Binary.d.ts +3 -3
  98. package/dist/widgets/base/Binary.d.ts.map +1 -1
  99. package/dist/widgets/base/Boolean.d.ts +2 -2
  100. package/dist/widgets/base/Boolean.d.ts.map +1 -1
  101. package/dist/widgets/base/Button.d.ts +2 -2
  102. package/dist/widgets/base/Button.d.ts.map +1 -1
  103. package/dist/widgets/base/Char.d.ts +2 -2
  104. package/dist/widgets/base/Char.d.ts.map +1 -1
  105. package/dist/widgets/base/Date.d.ts +2 -2
  106. package/dist/widgets/base/Date.d.ts.map +1 -1
  107. package/dist/widgets/base/DateTime.d.ts +2 -2
  108. package/dist/widgets/base/DateTime.d.ts.map +1 -1
  109. package/dist/widgets/base/Email.d.ts +2 -2
  110. package/dist/widgets/base/Email.d.ts.map +1 -1
  111. package/dist/widgets/base/Float.d.ts +2 -2
  112. package/dist/widgets/base/Float.d.ts.map +1 -1
  113. package/dist/widgets/base/FloatTime.d.ts +1 -1
  114. package/dist/widgets/base/FloatTime.d.ts.map +1 -1
  115. package/dist/widgets/base/Image.d.ts +3 -3
  116. package/dist/widgets/base/Image.d.ts.map +1 -1
  117. package/dist/widgets/base/Integer.d.ts +2 -2
  118. package/dist/widgets/base/Integer.d.ts.map +1 -1
  119. package/dist/widgets/base/Label.d.ts +2 -2
  120. package/dist/widgets/base/Label.d.ts.map +1 -1
  121. package/dist/widgets/base/LinkInput.d.ts +2 -2
  122. package/dist/widgets/base/LinkInput.d.ts.map +1 -1
  123. package/dist/widgets/base/MultiSelection.d.ts +3 -3
  124. package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
  125. package/dist/widgets/base/ProgressBar.d.ts +3 -3
  126. package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
  127. package/dist/widgets/base/Reference.d.ts +1 -1
  128. package/dist/widgets/base/Reference.d.ts.map +1 -1
  129. package/dist/widgets/base/ReferenceTree.d.ts +8 -0
  130. package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
  131. package/dist/widgets/base/Selection.d.ts +3 -3
  132. package/dist/widgets/base/Selection.d.ts.map +1 -1
  133. package/dist/widgets/base/Separator.d.ts +2 -2
  134. package/dist/widgets/base/Separator.d.ts.map +1 -1
  135. package/dist/widgets/base/Text.d.ts +2 -2
  136. package/dist/widgets/base/Text.d.ts.map +1 -1
  137. package/dist/widgets/base/Url.d.ts +2 -2
  138. package/dist/widgets/base/Url.d.ts.map +1 -1
  139. package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
  140. package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
  141. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
  142. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
  143. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
  144. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
  145. package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
  146. package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
  147. package/dist/widgets/base/one2many/One2many.d.ts +2 -2
  148. package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
  149. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
  150. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
  151. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
  152. package/dist/widgets/containers/Group.d.ts.map +1 -1
  153. package/dist/widgets/custom/Avatar.d.ts +10 -0
  154. package/dist/widgets/custom/Avatar.d.ts.map +1 -0
  155. package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
  156. package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
  157. package/dist/widgets/custom/CodeEditor.d.ts +2 -2
  158. package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
  159. package/dist/widgets/custom/FiberGrid.d.ts +3 -3
  160. package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
  161. package/dist/widgets/custom/Indicator.d.ts +2 -2
  162. package/dist/widgets/custom/Indicator.d.ts.map +1 -1
  163. package/dist/widgets/custom/Markdown.d.ts +5 -0
  164. package/dist/widgets/custom/Markdown.d.ts.map +1 -0
  165. package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
  166. package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
  167. package/dist/widgets/custom/Radio.d.ts +3 -3
  168. package/dist/widgets/custom/Radio.d.ts.map +1 -1
  169. package/dist/widgets/custom/Steps.d.ts +3 -3
  170. package/dist/widgets/custom/Steps.d.ts.map +1 -1
  171. package/dist/widgets/custom/Switch.d.ts +2 -2
  172. package/dist/widgets/custom/Switch.d.ts.map +1 -1
  173. package/dist/widgets/custom/Tag.d.ts +5 -0
  174. package/dist/widgets/custom/Tag.d.ts.map +1 -0
  175. package/dist/widgets/custom/Tags.d.ts +3 -3
  176. package/dist/widgets/custom/Tags.d.ts.map +1 -1
  177. package/dist/widgets/custom/Timeline.d.ts +3 -3
  178. package/dist/widgets/custom/Timeline.d.ts.map +1 -1
  179. package/dist/widgets/modals/ExportModal.d.ts +4 -3
  180. package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
  181. package/dist/widgets/modals/FormModal.d.ts +2 -2
  182. package/dist/widgets/modals/FormModal.d.ts.map +1 -1
  183. package/dist/widgets/modals/SearchModal.d.ts +2 -2
  184. package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
  185. package/dist/widgets/modals/TranslationModal.d.ts +2 -2
  186. package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
  187. package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -1
  188. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
  189. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
  190. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
  191. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
  192. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
  193. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
  194. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
  195. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
  196. package/dist/widgets/views/Form.d.ts.map +1 -1
  197. package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
  198. package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
  199. package/dist/widgets/views/Graph/GraphDefaults.d.ts +36 -0
  200. package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -1
  201. package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
  202. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
  203. package/dist/widgets/views/SearchTree.d.ts.map +1 -1
  204. package/dist/widgets/views/Tree.d.ts +2 -0
  205. package/dist/widgets/views/Tree.d.ts.map +1 -1
  206. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
  207. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
  208. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
  209. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
  210. package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
  211. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
  212. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +3 -2
  213. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
  214. package/package.json +14 -15
  215. package/src/__tests__/iconMapper.test.ts +20 -5
  216. package/src/__tests__/searchFilterHelper.spec.ts +7 -7
  217. package/src/actionbar/AttachmentsButton.tsx +22 -24
  218. package/src/actionbar/AttachmentsButtonWrapper.tsx +15 -12
  219. package/src/actionbar/ButtonWithBadge.tsx +5 -2
  220. package/src/actionbar/ChangeViewButton.tsx +13 -7
  221. package/src/actionbar/FormActionBar.tsx +73 -11
  222. package/src/actionbar/SearchBar.tsx +8 -4
  223. package/src/actionbar/TreeActionBar.tsx +99 -97
  224. package/src/common/DatePicker.tsx +18 -13
  225. package/src/context/ActionViewContext.tsx +7 -4
  226. package/src/context/ConfigContext.tsx +9 -0
  227. package/src/context/ContentRootContext.tsx +111 -76
  228. package/src/context/FormContext.tsx +1 -4
  229. package/src/helpers/errorHelper.ts +27 -0
  230. package/src/helpers/filesHelper.ts +2 -3
  231. package/src/helpers/formHelper.ts +26 -5
  232. package/src/helpers/iconMapper.ts +141 -108
  233. package/src/helpers/one2manyHelper.ts +94 -39
  234. package/src/helpers/searchHelper.ts +8 -7
  235. package/src/helpers/treeHelper.ts +17 -5
  236. package/src/hooks/useExport.ts +439 -0
  237. package/src/index.ts +6 -0
  238. package/src/locales/ca_ES.tsx +2 -0
  239. package/src/locales/en_US.tsx +2 -0
  240. package/src/locales/es_ES.tsx +2 -0
  241. package/src/stories/Binary.stories.tsx +4 -1
  242. package/src/stories/Boolean.stories.tsx +4 -1
  243. package/src/stories/Button.stories.tsx +4 -1
  244. package/src/stories/Char.stories.tsx +4 -1
  245. package/src/stories/FiberGrid.stories.tsx +4 -1
  246. package/src/stories/Float.stories.tsx +4 -1
  247. package/src/stories/FloatTime.stories.tsx +4 -1
  248. package/src/stories/Image.stories.tsx +4 -1
  249. package/src/stories/Integer.stories.tsx +4 -1
  250. package/src/stories/Label.stories.tsx +11 -9
  251. package/src/stories/Many2one.stories.tsx +4 -1
  252. package/src/stories/One2many.stories.tsx +4 -1
  253. package/src/stories/ProgressBar.stories.tsx +4 -1
  254. package/src/stories/Reference.stories.tsx +4 -1
  255. package/src/stories/Selection.stories.tsx +4 -1
  256. package/src/stories/Separator.stories.tsx +37 -1
  257. package/src/stories/Text.stories.tsx +4 -1
  258. package/src/stories/containers/Group.stories.tsx +28 -1
  259. package/src/stories/containers/NewLine.stories.tsx +4 -1
  260. package/src/stories/containers/Notebook.stories.tsx +31 -1
  261. package/src/stories/custom/Avatar.stories.tsx +27 -0
  262. package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
  263. package/src/stories/custom/CodeEditor.stories.tsx +4 -1
  264. package/src/stories/custom/Indicator.stories.tsx +4 -1
  265. package/src/stories/custom/Markdown.stories.tsx +42 -0
  266. package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
  267. package/src/stories/custom/Radio.stories.tsx +4 -1
  268. package/src/stories/custom/Steps.stories.tsx +4 -1
  269. package/src/stories/custom/Switch.stories.tsx +4 -1
  270. package/src/stories/custom/Tag.stories.tsx +60 -0
  271. package/src/stories/custom/Tags.stories.tsx +4 -1
  272. package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
  273. package/src/stories/mocks/models/company.ts +2 -2
  274. package/src/stories/mocks/models/crm_case.ts +7 -10
  275. package/src/stories/ui/ActionBar.stories.tsx +2 -1
  276. package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
  277. package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
  278. package/src/stories/views/SearchTree.stories.tsx +3 -1
  279. package/src/stories/views/Tab.stories.tsx +3 -1
  280. package/src/stories/views/TabsAndContent.stories.tsx +3 -1
  281. package/src/stories/views/Tree.stories.jsx +20 -6
  282. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
  283. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
  284. package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
  285. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
  286. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
  287. package/src/types/index.ts +1 -0
  288. package/src/ui/ActionErrorDialog.tsx +4 -21
  289. package/src/ui/ErrorAlert.tsx +37 -0
  290. package/src/ui/FavouriteButton.tsx +20 -9
  291. package/src/ui/GoToResourceModal.tsx +3 -3
  292. package/src/ui/TitleHeader.tsx +18 -4
  293. package/src/views/ActionView.tsx +6 -2
  294. package/src/views/RootView.tsx +7 -1
  295. package/src/views/actionViews/GraphActionView.tsx +1 -0
  296. package/src/views/actionViews/TreeActionView.tsx +10 -1
  297. package/src/views/tabs/Tab.tsx +12 -6
  298. package/src/widgets/WidgetFactory.tsx +6 -0
  299. package/src/widgets/base/Binary.tsx +8 -5
  300. package/src/widgets/base/Boolean.tsx +8 -7
  301. package/src/widgets/base/Char.tsx +14 -12
  302. package/src/widgets/base/Float.tsx +11 -5
  303. package/src/widgets/base/FloatTime.tsx +9 -5
  304. package/src/widgets/base/Integer.tsx +10 -5
  305. package/src/widgets/base/Label.tsx +12 -12
  306. package/src/widgets/base/LinkInput.tsx +11 -6
  307. package/src/widgets/base/MultiSelection.tsx +6 -2
  308. package/src/widgets/base/Reference.tsx +13 -3
  309. package/src/widgets/base/ReferenceTree.tsx +62 -0
  310. package/src/widgets/base/Selection.tsx +6 -2
  311. package/src/widgets/base/Separator.tsx +11 -3
  312. package/src/widgets/base/Text.tsx +14 -12
  313. package/src/widgets/base/many2one/Many2one.tsx +27 -33
  314. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
  315. package/src/widgets/base/many2one/Many2oneTree.tsx +18 -0
  316. package/src/widgets/base/one2many/One2manyInput.tsx +82 -28
  317. package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
  318. package/src/widgets/containers/Group.tsx +7 -4
  319. package/src/widgets/custom/Avatar.tsx +33 -0
  320. package/src/widgets/custom/ButtonGroup.tsx +31 -21
  321. package/src/widgets/custom/FiberGrid.tsx +2 -5
  322. package/src/widgets/custom/Indicator.tsx +16 -15
  323. package/src/widgets/custom/Markdown.tsx +22 -0
  324. package/src/widgets/custom/MultiCheckbox.tsx +1 -0
  325. package/src/widgets/custom/Tag.tsx +24 -0
  326. package/src/widgets/custom/Tags.tsx +27 -28
  327. package/src/widgets/custom/Timeline.tsx +9 -3
  328. package/src/widgets/modals/ExportModal.tsx +33 -134
  329. package/src/widgets/modals/FormModal.tsx +3 -3
  330. package/src/widgets/modals/SearchModal.tsx +29 -31
  331. package/src/widgets/modals/TranslationModal.tsx +3 -3
  332. package/src/widgets/views/Dashboard/Dashboard.tsx +15 -4
  333. package/src/widgets/views/Dashboard/DashboardTree.tsx +1 -0
  334. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
  335. package/src/widgets/views/Form.tsx +41 -39
  336. package/src/widgets/views/Graph/GraphChart.tsx +6 -1
  337. package/src/widgets/views/Graph/GraphDefaults.ts +113 -0
  338. package/src/widgets/views/Graph/GraphIndicator.tsx +19 -7
  339. package/src/widgets/views/SearchTree.tsx +3 -0
  340. package/src/widgets/views/Tree.tsx +118 -26
  341. package/src/widgets/views/searchFilter/SearchField.tsx +9 -23
  342. package/src/widgets/views/searchFilter/SearchFilter.tsx +17 -8
  343. package/dist/Config.d.ts +0 -6
  344. package/dist/Config.d.ts.map +0 -1
  345. package/dist/helpers/icons/antd_icons.d.ts +0 -4
  346. package/dist/helpers/icons/antd_icons.d.ts.map +0 -1
  347. package/dist/helpers/icons/tabler_icons.d.ts +0 -4
  348. package/dist/helpers/icons/tabler_icons.d.ts.map +0 -1
  349. package/dist/main.css +0 -1
  350. package/dist/ui/Fieldset.d.ts +0 -8
  351. package/dist/ui/Fieldset.d.ts.map +0 -1
  352. package/src/Config.ts +0 -4
  353. package/src/helpers/icons/antd_icons.ts +0 -1583
  354. package/src/helpers/icons/tabler_icons.ts +0 -5367
  355. package/src/ui/Fieldset.tsx +0 -31
@@ -1,10 +1,13 @@
1
1
  import React, { useContext } from "react";
2
- import { Row, Col, Typography } from "antd";
2
+ import { Row, Col, Typography, theme } from "antd";
3
3
  import {
4
4
  ActionViewContext,
5
5
  ActionViewContextType,
6
6
  } from "@/context/ActionViewContext";
7
7
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
8
+ import { CopyOutlined } from "@ant-design/icons";
9
+
10
+ const { useToken } = theme;
8
11
 
9
12
  const { Title, Text } = Typography;
10
13
 
@@ -25,6 +28,7 @@ function TitleHeader(props: Props) {
25
28
  selectedRowItems,
26
29
  } = useContext(ActionViewContext) as ActionViewContextType;
27
30
  const { t } = useContext(LocaleContext) as LocaleContextType;
31
+ const { token } = useToken();
28
32
 
29
33
  function getSummary() {
30
34
  if (currentView?.type === "form") {
@@ -35,7 +39,13 @@ function TitleHeader(props: Props) {
35
39
  if (totalItems === 0) {
36
40
  return (
37
41
  <>
38
- {t("editingDocument")} (id: <Text copyable>{currentId}</Text>)
42
+ {t("editingDocument")} (id:{" "}
43
+ <Text
44
+ copyable={{ icon: <CopyOutlined style={{ color: "red" }} /> }}
45
+ >
46
+ {currentId}
47
+ </Text>
48
+ )
39
49
  </>
40
50
  );
41
51
  }
@@ -74,8 +84,12 @@ function TitleHeader(props: Props) {
74
84
  return (
75
85
  <div style={{ position: "sticky", top: 80, zIndex: 3 }}>
76
86
  <Row
77
- className="rounded shadow-md bg-blueGray-100"
78
- style={{ padding: "1em" }}
87
+ className="shadow-md"
88
+ style={{
89
+ padding: "1em",
90
+ borderRadius: token.borderRadius,
91
+ backgroundColor: token.colorPrimaryBg,
92
+ }}
79
93
  align="middle"
80
94
  >
81
95
  <Col flex={2}>
@@ -107,6 +107,7 @@ function ActionView(props: Props, ref: any) {
107
107
  tabs,
108
108
  activeKey,
109
109
  openAction,
110
+ onRemoveTab,
110
111
  } = tabManagerContext || {};
111
112
 
112
113
  useHotkeys(
@@ -240,8 +241,9 @@ function ActionView(props: Props, ref: any) {
240
241
 
241
242
  if (!currentViewToAssign) {
242
243
  showErrorDialog(
243
- "Error determining the first view to show.\nPlease, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action"
244
+ `Error determining the first view to show for model ${model}.\nPlease, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`
244
245
  );
246
+ onRemoveTab?.(tabKey);
245
247
  }
246
248
 
247
249
  setCurrentView(currentViewToAssign);
@@ -279,7 +281,9 @@ function ActionView(props: Props, ref: any) {
279
281
  }, [tabs, activeKey]);
280
282
 
281
283
  async function canWeClose() {
282
- if (currentView!.type === "form") {
284
+ if (!currentView) {
285
+ return true;
286
+ } else if (currentView!.type === "form") {
283
287
  return await (formRef.current as any).cancelUnsavedChanges();
284
288
  } else {
285
289
  return true;
@@ -250,6 +250,7 @@ function RootView(props: RootViewProps, ref: any) {
250
250
  fields,
251
251
  values: { ...values, ...globalValues },
252
252
  }),
253
+ fields,
253
254
  context: { ...rootContext, ...parsedContext },
254
255
  })
255
256
  : [];
@@ -437,6 +438,11 @@ function RootView(props: RootViewProps, ref: any) {
437
438
  },
438
439
  });
439
440
  } else {
441
+ const formattedInitialView =
442
+ initialView && Array.isArray(initialView.id)
443
+ ? { ...initialView, id: initialView.id[0] }
444
+ : initialView;
445
+
440
446
  addNewTab({
441
447
  title,
442
448
  action: {
@@ -454,7 +460,7 @@ function RootView(props: RootViewProps, ref: any) {
454
460
  context={{ ...rootContext, ...context }}
455
461
  domain={domain}
456
462
  setCanWeClose={registerViewCloseFn}
457
- initialView={initialView}
463
+ initialView={formattedInitialView}
458
464
  res_id={res_id}
459
465
  formDefaultValues={values}
460
466
  formForcedValues={forced_values}
@@ -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
  `;