@gisce/react-ooui 1.2.0-rc.79 → 1.2.0-rc.81

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 (253) 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 +2 -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/ConfigContext.d.ts +7 -0
  33. package/dist/context/ConfigContext.d.ts.map +1 -0
  34. package/dist/context/ContentRootContext.d.ts.map +1 -1
  35. package/dist/helpers/iconMapper.d.ts +10 -5
  36. package/dist/helpers/iconMapper.d.ts.map +1 -1
  37. package/dist/index.d.ts +2 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/react-ooui.es.js +19554 -19286
  40. package/dist/react-ooui.es.js.map +1 -1
  41. package/dist/react-ooui.umd.js +170 -69
  42. package/dist/react-ooui.umd.js.map +1 -1
  43. package/dist/ui/ErrorAlert.d.ts +2 -2
  44. package/dist/ui/ErrorAlert.d.ts.map +1 -1
  45. package/dist/ui/FavouriteButton.d.ts +2 -2
  46. package/dist/ui/FavouriteButton.d.ts.map +1 -1
  47. package/dist/ui/GoToResourceModal.d.ts +2 -2
  48. package/dist/ui/GoToResourceModal.d.ts.map +1 -1
  49. package/dist/ui/TitleHeader.d.ts +2 -2
  50. package/dist/ui/TitleHeader.d.ts.map +1 -1
  51. package/dist/views/CurrentTabContent.d.ts +2 -2
  52. package/dist/views/CurrentTabContent.d.ts.map +1 -1
  53. package/dist/views/TabContent.d.ts +1 -1
  54. package/dist/views/TabContent.d.ts.map +1 -1
  55. package/dist/views/TabSelector.d.ts +2 -2
  56. package/dist/views/TabSelector.d.ts.map +1 -1
  57. package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
  58. package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
  59. package/dist/views/actionViews/FormActionView.d.ts +2 -2
  60. package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
  61. package/dist/views/actionViews/GraphActionView.d.ts +2 -2
  62. package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
  63. package/dist/views/actionViews/TreeActionView.d.ts +2 -2
  64. package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
  65. package/dist/views/tabs/Tab.d.ts +2 -2
  66. package/dist/views/tabs/Tab.d.ts.map +1 -1
  67. package/dist/widgets/base/Binary.d.ts +3 -3
  68. package/dist/widgets/base/Binary.d.ts.map +1 -1
  69. package/dist/widgets/base/Boolean.d.ts +2 -2
  70. package/dist/widgets/base/Boolean.d.ts.map +1 -1
  71. package/dist/widgets/base/Button.d.ts +2 -2
  72. package/dist/widgets/base/Button.d.ts.map +1 -1
  73. package/dist/widgets/base/Char.d.ts +2 -2
  74. package/dist/widgets/base/Char.d.ts.map +1 -1
  75. package/dist/widgets/base/Date.d.ts +2 -2
  76. package/dist/widgets/base/Date.d.ts.map +1 -1
  77. package/dist/widgets/base/DateTime.d.ts +2 -2
  78. package/dist/widgets/base/DateTime.d.ts.map +1 -1
  79. package/dist/widgets/base/Email.d.ts +2 -2
  80. package/dist/widgets/base/Email.d.ts.map +1 -1
  81. package/dist/widgets/base/Float.d.ts +2 -2
  82. package/dist/widgets/base/Float.d.ts.map +1 -1
  83. package/dist/widgets/base/FloatTime.d.ts +1 -1
  84. package/dist/widgets/base/FloatTime.d.ts.map +1 -1
  85. package/dist/widgets/base/Image.d.ts +3 -3
  86. package/dist/widgets/base/Image.d.ts.map +1 -1
  87. package/dist/widgets/base/Integer.d.ts +2 -2
  88. package/dist/widgets/base/Integer.d.ts.map +1 -1
  89. package/dist/widgets/base/Label.d.ts +2 -2
  90. package/dist/widgets/base/Label.d.ts.map +1 -1
  91. package/dist/widgets/base/LinkInput.d.ts +2 -2
  92. package/dist/widgets/base/LinkInput.d.ts.map +1 -1
  93. package/dist/widgets/base/MultiSelection.d.ts +3 -3
  94. package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
  95. package/dist/widgets/base/ProgressBar.d.ts +3 -3
  96. package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
  97. package/dist/widgets/base/Reference.d.ts +1 -1
  98. package/dist/widgets/base/Reference.d.ts.map +1 -1
  99. package/dist/widgets/base/Selection.d.ts +3 -3
  100. package/dist/widgets/base/Selection.d.ts.map +1 -1
  101. package/dist/widgets/base/Separator.d.ts +2 -2
  102. package/dist/widgets/base/Separator.d.ts.map +1 -1
  103. package/dist/widgets/base/Text.d.ts +2 -2
  104. package/dist/widgets/base/Text.d.ts.map +1 -1
  105. package/dist/widgets/base/Url.d.ts +2 -2
  106. package/dist/widgets/base/Url.d.ts.map +1 -1
  107. package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
  108. package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
  109. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
  110. package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
  111. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
  112. package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
  113. package/dist/widgets/base/one2many/One2many.d.ts +2 -2
  114. package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
  115. package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
  116. package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
  117. package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
  118. package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
  119. package/dist/widgets/custom/CodeEditor.d.ts +2 -2
  120. package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
  121. package/dist/widgets/custom/FiberGrid.d.ts +3 -3
  122. package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
  123. package/dist/widgets/custom/Indicator.d.ts +2 -2
  124. package/dist/widgets/custom/Indicator.d.ts.map +1 -1
  125. package/dist/widgets/custom/Markdown.d.ts +3 -3
  126. package/dist/widgets/custom/Markdown.d.ts.map +1 -1
  127. package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
  128. package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
  129. package/dist/widgets/custom/Radio.d.ts +3 -3
  130. package/dist/widgets/custom/Radio.d.ts.map +1 -1
  131. package/dist/widgets/custom/Steps.d.ts +3 -3
  132. package/dist/widgets/custom/Steps.d.ts.map +1 -1
  133. package/dist/widgets/custom/Switch.d.ts +2 -2
  134. package/dist/widgets/custom/Switch.d.ts.map +1 -1
  135. package/dist/widgets/custom/Tag.d.ts +3 -3
  136. package/dist/widgets/custom/Tag.d.ts.map +1 -1
  137. package/dist/widgets/custom/Tags.d.ts +3 -3
  138. package/dist/widgets/custom/Tags.d.ts.map +1 -1
  139. package/dist/widgets/custom/Timeline.d.ts +3 -3
  140. package/dist/widgets/custom/Timeline.d.ts.map +1 -1
  141. package/dist/widgets/modals/ExportModal.d.ts +2 -2
  142. package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
  143. package/dist/widgets/modals/FormModal.d.ts +2 -2
  144. package/dist/widgets/modals/FormModal.d.ts.map +1 -1
  145. package/dist/widgets/modals/SearchModal.d.ts +2 -2
  146. package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
  147. package/dist/widgets/modals/TranslationModal.d.ts +2 -2
  148. package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
  149. package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
  150. package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
  151. package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
  152. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
  153. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
  154. package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
  155. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
  156. package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
  157. package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
  158. package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
  159. package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
  160. package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
  161. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
  162. package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
  163. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
  164. package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
  165. package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
  166. package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
  167. package/dist/widgets/views/searchFilter/SearchFilter.d.ts +2 -2
  168. package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
  169. package/package.json +5 -9
  170. package/src/__tests__/searchFilterHelper.spec.ts +7 -7
  171. package/src/actionbar/AttachmentsButton.tsx +22 -24
  172. package/src/actionbar/ButtonWithBadge.tsx +5 -2
  173. package/src/actionbar/ChangeViewButton.tsx +10 -2
  174. package/src/actionbar/TreeActionBar.tsx +82 -75
  175. package/src/common/DatePicker.tsx +14 -10
  176. package/src/context/ConfigContext.tsx +9 -0
  177. package/src/context/ContentRootContext.tsx +46 -48
  178. package/src/helpers/iconMapper.ts +13 -7
  179. package/src/index.ts +2 -0
  180. package/src/stories/Binary.stories.tsx +4 -1
  181. package/src/stories/Boolean.stories.tsx +4 -1
  182. package/src/stories/Button.stories.tsx +4 -1
  183. package/src/stories/Char.stories.tsx +4 -1
  184. package/src/stories/FiberGrid.stories.tsx +4 -1
  185. package/src/stories/Float.stories.tsx +4 -1
  186. package/src/stories/FloatTime.stories.tsx +4 -1
  187. package/src/stories/Image.stories.tsx +4 -1
  188. package/src/stories/Integer.stories.tsx +4 -1
  189. package/src/stories/Label.stories.tsx +4 -1
  190. package/src/stories/Many2one.stories.tsx +4 -1
  191. package/src/stories/One2many.stories.tsx +4 -1
  192. package/src/stories/ProgressBar.stories.tsx +4 -1
  193. package/src/stories/Reference.stories.tsx +4 -1
  194. package/src/stories/Selection.stories.tsx +4 -1
  195. package/src/stories/Separator.stories.tsx +4 -1
  196. package/src/stories/Text.stories.tsx +4 -1
  197. package/src/stories/containers/Group.stories.tsx +4 -1
  198. package/src/stories/containers/NewLine.stories.tsx +4 -1
  199. package/src/stories/containers/Notebook.stories.tsx +4 -1
  200. package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
  201. package/src/stories/custom/CodeEditor.stories.tsx +4 -1
  202. package/src/stories/custom/Indicator.stories.tsx +4 -1
  203. package/src/stories/custom/Markdown.stories.tsx +4 -1
  204. package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
  205. package/src/stories/custom/Radio.stories.tsx +4 -1
  206. package/src/stories/custom/Steps.stories.tsx +4 -1
  207. package/src/stories/custom/Switch.stories.tsx +4 -1
  208. package/src/stories/custom/Tag.stories.tsx +4 -1
  209. package/src/stories/custom/Tags.stories.tsx +4 -1
  210. package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
  211. package/src/stories/ui/ActionBar.stories.tsx +2 -1
  212. package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
  213. package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
  214. package/src/stories/views/SearchTree.stories.tsx +3 -1
  215. package/src/stories/views/Tab.stories.tsx +3 -1
  216. package/src/stories/views/TabsAndContent.stories.tsx +3 -1
  217. package/src/stories/views/Tree.stories.jsx +4 -1
  218. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
  219. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
  220. package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
  221. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
  222. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
  223. package/src/ui/FavouriteButton.tsx +16 -5
  224. package/src/ui/GoToResourceModal.tsx +3 -3
  225. package/src/ui/TitleHeader.tsx +18 -4
  226. package/src/views/tabs/Tab.tsx +12 -6
  227. package/src/widgets/base/Binary.tsx +8 -5
  228. package/src/widgets/base/Boolean.tsx +8 -7
  229. package/src/widgets/base/Char.tsx +14 -12
  230. package/src/widgets/base/Float.tsx +11 -5
  231. package/src/widgets/base/FloatTime.tsx +9 -5
  232. package/src/widgets/base/Integer.tsx +9 -5
  233. package/src/widgets/base/Label.tsx +6 -2
  234. package/src/widgets/base/LinkInput.tsx +11 -6
  235. package/src/widgets/base/MultiSelection.tsx +6 -2
  236. package/src/widgets/base/Selection.tsx +6 -2
  237. package/src/widgets/base/Text.tsx +14 -12
  238. package/src/widgets/base/many2one/Many2one.tsx +15 -12
  239. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
  240. package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
  241. package/src/widgets/custom/FiberGrid.tsx +1 -4
  242. package/src/widgets/custom/Indicator.tsx +16 -15
  243. package/src/widgets/modals/FormModal.tsx +3 -3
  244. package/src/widgets/modals/SearchModal.tsx +29 -31
  245. package/src/widgets/modals/TranslationModal.tsx +3 -3
  246. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
  247. package/src/widgets/views/Graph/GraphDefaults.ts +3 -3
  248. package/src/widgets/views/Tree.tsx +4 -4
  249. package/src/widgets/views/searchFilter/SearchFilter.tsx +5 -2
  250. package/dist/Config.d.ts +0 -6
  251. package/dist/Config.d.ts.map +0 -1
  252. package/src/Config.ts +0 -4
  253. /package/dist/{main.css → style.css} +0 -0
@@ -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);
@@ -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, "");
@@ -33,6 +36,7 @@ export const Integer = (props: IntegerProps) => {
33
36
  defaultValue={0}
34
37
  onBlur={elementHasLostFocus}
35
38
  precision={0}
39
+ style={requiredStyle}
36
40
  />
37
41
  </Field>
38
42
  );
@@ -1,10 +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
6
  import { Interweave } from "interweave";
7
7
  const { Text, Title } = Typography;
8
+ const { useToken } = theme;
8
9
 
9
10
  type Props = WidgetProps & {
10
11
  align?: "left" | "center" | "right";
@@ -25,6 +26,7 @@ const Label = (props: Props) => {
25
26
  const labelText = addColon && label.length > 1 ? label + " :" : label;
26
27
  const responsiveAlign = responsiveBehaviour ? "left" : "right";
27
28
  const labelAlgin = align ? align : fieldForLabel ? responsiveAlign : "left";
29
+ const { token } = useToken();
28
30
 
29
31
  const TextType = labelSize === undefined ? Text : Title;
30
32
 
@@ -34,7 +36,9 @@ const Label = (props: Props) => {
34
36
  >
35
37
  {tooltip && (
36
38
  <Tooltip title={tooltip}>
37
- <QuestionCircleOutlined className="pr-1 text-xs text-blue-400" />
39
+ <QuestionCircleOutlined className="pr-1 text-xs" style={{
40
+ color: token.colorPrimary
41
+ }} />
38
42
  </Tooltip>
39
43
  )}
40
44
  <span className="pr-2">
@@ -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
  `;
@@ -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
  `;
@@ -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,13 +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
- elementHasLostFocus,
84
- } = formContext || {};
84
+ const { domain, getValues, getFields, getContext, elementHasLostFocus } =
85
+ formContext || {};
85
86
  const transformedDomain = useRef<any[]>([]);
86
87
  const [searchDomain, setSearchDomain] = useState<any>([]);
87
88
 
@@ -244,7 +245,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
244
245
  value={inputText}
245
246
  disabled={readOnly}
246
247
  onChange={onValueStringChange}
247
- className={requiredClass}
248
+ style={requiredStyle}
248
249
  onBlur={onElementLostFocus}
249
250
  onKeyDown={onKeyDown}
250
251
  suffix={
@@ -263,6 +264,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
263
264
  onClick={() => {
264
265
  setShowFormModal(true);
265
266
  }}
267
+ style={{ borderTopRightRadius: 0, borderBottomRightRadius: 0 }}
266
268
  tabIndex={-1}
267
269
  />
268
270
  </Col>
@@ -274,6 +276,7 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
274
276
  searchButtonTappedRef.current = true;
275
277
  tryFetchFirstResultOrShowSearch(text);
276
278
  }}
279
+ style={{ borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }}
277
280
  tabIndex={-1}
278
281
  />
279
282
  </Col>
@@ -315,6 +318,6 @@ export const Many2oneInput: React.FC<Many2oneInputProps> = (
315
318
 
316
319
  const RequiredInput = styled(Input)`
317
320
  .ant-input {
318
- background-color: ${Config.requiredColor};
321
+ background-color: ${mapToken.colorPrimaryBg};
319
322
  }
320
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
  };