@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
@@ -11,6 +11,8 @@ import {
11
11
  ApiOutlined,
12
12
  } from "@ant-design/icons";
13
13
  import { ViewType } from "@/types";
14
+ import { theme } from "antd";
15
+ const { useToken } = theme;
14
16
 
15
17
  type One2manyTopBarProps = {
16
18
  title: string;
@@ -49,6 +51,7 @@ export const One2manyTopBar = (props: One2manyTopBarProps) => {
49
51
  showCreateButton,
50
52
  showToggleButton,
51
53
  } = props;
54
+ const { token } = useToken();
52
55
 
53
56
  function separator() {
54
57
  return <div className="inline-block w-3" />;
@@ -56,7 +59,13 @@ export const One2manyTopBar = (props: One2manyTopBarProps) => {
56
59
 
57
60
  function title() {
58
61
  return (
59
- <div className="flex flex-grow h-8 text-gray-200 bg-gray-700">
62
+ <div
63
+ className="flex flex-grow h-8 text-white"
64
+ style={{
65
+ borderRadius: token.borderRadius,
66
+ backgroundColor: token.colorPrimaryActive,
67
+ }}
68
+ >
60
69
  <div className="flex flex-col items-center justify-center h-full">
61
70
  <span className="pl-2 font-bold">{titleString}</span>
62
71
  </div>
@@ -2,14 +2,11 @@ import React from "react";
2
2
  import Field from "@/common/Field";
3
3
  import { Char as CharOoui } from "@gisce/ooui";
4
4
  import { WidgetProps } from "@/types";
5
- import Config from "@/Config";
6
5
  import { GridUi } from "fiber-diagram";
7
6
 
8
7
  export const FiberGrid = (props: WidgetProps) => {
9
8
  const { ooui } = props;
10
- const { id, readOnly, required } = ooui as CharOoui;
11
- // const requiredClass =
12
- // required && !readOnly ? Config.requiredClass : undefined;
9
+ const { required } = ooui as CharOoui;
13
10
 
14
11
  return (
15
12
  <Field required={required} {...props}>
@@ -1,14 +1,15 @@
1
1
  import React from "react";
2
- import { Tooltip } from "antd";
2
+ import { Tooltip, theme } from "antd";
3
3
  import { Statistic, Card } from "antd";
4
4
  import { Indicator as IndicatorOoui } from "@gisce/ooui";
5
5
  import { WidgetProps } from "@/types";
6
6
  import Field from "@/common/Field";
7
- import {QuestionCircleOutlined} from "@ant-design/icons";
7
+ import { QuestionCircleOutlined } from "@ant-design/icons";
8
8
  import iconMapper from "@/helpers/iconMapper";
9
+ const { useToken } = theme;
9
10
 
10
11
  type IndicatorProps = WidgetProps & {
11
- ooui: IndicatorOoui
12
+ ooui: IndicatorOoui;
12
13
  value?: number;
13
14
  };
14
15
 
@@ -25,18 +26,22 @@ export const Indicator = (props: IndicatorProps) => {
25
26
  type IndicatorInputProps = {
26
27
  ooui: IndicatorOoui;
27
28
  value?: any;
28
- }
29
+ };
29
30
 
30
31
  const IndicatorInput = (props: IndicatorInputProps) => {
32
+ const { token } = useToken();
31
33
  const { ooui, value } = props;
32
34
  const title = (
33
35
  <>
34
36
  <span>{ooui.label} </span>
35
- {ooui.tooltip &&
37
+ {ooui.tooltip && (
36
38
  <Tooltip title={ooui.tooltip}>
37
- <QuestionCircleOutlined className="pr-1 text-xs text-blue-400"/>
39
+ <QuestionCircleOutlined
40
+ className="pr-1 text-xs"
41
+ style={{ color: token.colorPrimaryBg }}
42
+ />
38
43
  </Tooltip>
39
- }
44
+ )}
40
45
  </>
41
46
  );
42
47
  const Icon: React.ElementType = iconMapper(ooui.icon) as any;
@@ -49,18 +54,14 @@ const IndicatorInput = (props: IndicatorInputProps) => {
49
54
  const field = (
50
55
  <Statistic
51
56
  title={title}
52
- prefix={Icon && <Icon/>}
57
+ prefix={Icon && <Icon />}
53
58
  suffix={ooui.suffix}
54
59
  value={formattedValue}
55
60
  />
56
- )
61
+ );
57
62
  if (ooui.card) {
58
- return (
59
- <Card>
60
- {field}
61
- </Card>
62
- );
63
+ return <Card>{field}</Card>;
63
64
  } else {
64
65
  return field;
65
66
  }
66
- }
67
+ };
@@ -96,12 +96,12 @@ export const FormModal = (props: FormModalProps) => {
96
96
  }
97
97
 
98
98
  return (
99
- <FormModalProvider setTitle={setFormTitle}>
99
+ (<FormModalProvider setTitle={setFormTitle}>
100
100
  <Modal
101
101
  title={isMenuAction ? header() : formTitle}
102
102
  centered
103
103
  width={modalWidth}
104
- visible={visible}
104
+ open={visible}
105
105
  footer={null}
106
106
  destroyOnClose
107
107
  onCancel={onCancel}
@@ -115,6 +115,6 @@ export const FormModal = (props: FormModalProps) => {
115
115
  {...rest}
116
116
  />
117
117
  </Modal>
118
- </FormModalProvider>
118
+ </FormModalProvider>)
119
119
  );
120
120
  };
@@ -98,35 +98,33 @@ export const SearchModal = (props: SearchSelectionProps) => {
98
98
  );
99
99
  };
100
100
 
101
- return (
102
- <>
103
- <Modal
104
- title={t("search")}
105
- centered
106
- width={modalWidth}
107
- visible={visible && !showCreateModal}
108
- closable={true}
109
- onCancel={onCloseModal}
110
- footer={null}
111
- destroyOnClose
112
- maskClosable={false}
113
- >
114
- {content()}
115
- </Modal>
116
- <FormModal
117
- model={model}
118
- visible={showCreateModal}
119
- parentContext={context}
120
- onSubmitSucceed={(id?: number) => {
121
- setShowCreateModal(false);
122
- onCloseModal();
123
- onSelectValues([id!]);
124
- }}
125
- onCancel={() => {
126
- setShowCreateModal(false);
127
- onCloseModal();
128
- }}
129
- />
130
- </>
131
- );
101
+ return (<>
102
+ <Modal
103
+ title={t("search")}
104
+ centered
105
+ width={modalWidth}
106
+ open={visible && !showCreateModal}
107
+ closable={true}
108
+ onCancel={onCloseModal}
109
+ footer={null}
110
+ destroyOnClose
111
+ maskClosable={false}
112
+ >
113
+ {content()}
114
+ </Modal>
115
+ <FormModal
116
+ model={model}
117
+ visible={showCreateModal}
118
+ parentContext={context}
119
+ onSubmitSucceed={(id?: number) => {
120
+ setShowCreateModal(false);
121
+ onCloseModal();
122
+ onSelectValues([id!]);
123
+ }}
124
+ onCancel={() => {
125
+ setShowCreateModal(false);
126
+ onCloseModal();
127
+ }}
128
+ />
129
+ </>);
132
130
  };
@@ -185,11 +185,11 @@ export const TranslationModal = (props: TranslationModalProps) => {
185
185
  }
186
186
 
187
187
  return (
188
- <Modal
188
+ (<Modal
189
189
  title={t("translate")}
190
190
  centered
191
191
  width={modalWidth}
192
- visible={visible}
192
+ open={visible}
193
193
  closable={true}
194
194
  onCancel={onCloseModal}
195
195
  footer={null}
@@ -197,6 +197,6 @@ export const TranslationModal = (props: TranslationModalProps) => {
197
197
  maskClosable={false}
198
198
  >
199
199
  {content()}
200
- </Modal>
200
+ </Modal>)
201
201
  );
202
202
  };
@@ -1,17 +1,18 @@
1
1
  import React from "react";
2
2
  import { DashboardGridItemProps } from "./DashboardGridItem.types";
3
3
  import { ExportOutlined } from "@ant-design/icons";
4
- import { Row, Col } from "antd";
5
- import { Typography } from "antd";
4
+ import { Row, Col, Typography, theme } from "antd";
5
+ const { useToken } = theme;
6
6
 
7
7
  const { Text } = Typography;
8
8
 
9
9
  export const DashboardGridItem = (props: DashboardGridItemProps) => {
10
- const { id, title, children, action, openAction } = props;
10
+ const { title, children, action, openAction } = props;
11
+ const { token } = useToken();
11
12
 
12
13
  return (
13
14
  <div
14
- className={"shadow-md rounded"}
15
+ className={"shadow-md"}
15
16
  style={{
16
17
  height: "100%",
17
18
  display: "flex",
@@ -19,12 +20,15 @@ export const DashboardGridItem = (props: DashboardGridItemProps) => {
19
20
  overflow: "hidden",
20
21
  border: "1px solid #eee",
21
22
  backgroundColor: "white",
23
+ borderRadius: token.borderRadius,
22
24
  }}
23
25
  >
24
26
  <Row
25
- className="bg-blueGray-100"
26
27
  align="middle"
27
- style={{ borderBottom: "1px solid #ddd" }}
28
+ style={{
29
+ borderBottom: "1px solid #ddd",
30
+ backgroundColor: token.colorPrimaryBg,
31
+ }}
28
32
  wrap={false}
29
33
  >
30
34
  <Col
@@ -1,4 +1,4 @@
1
- import moment from "moment";
1
+ import dayjs from "dayjs";
2
2
 
3
3
  const formatter = (graphType: "pie" | "default" | "barGrouped") => {
4
4
  return (object: any) => {
@@ -24,7 +24,7 @@ const axisFormatter = (value: any) => {
24
24
  if (dateType === null) {
25
25
  return value;
26
26
  }
27
- return moment(value, (dateFormats.input as any)[dateType]).format(
27
+ return dayjs(value, (dateFormats.input as any)[dateType]).format(
28
28
  (dateFormats.output as any)[dateType]
29
29
  );
30
30
  } else {
@@ -154,7 +154,7 @@ const dateFormats = {
154
154
 
155
155
  function getDateType(dateString: string): string | null {
156
156
  for (const format in dateFormats.input) {
157
- const isValidFormat = moment(
157
+ const isValidFormat = dayjs(
158
158
  dateString,
159
159
  (dateFormats.input as any)[format],
160
160
  true
@@ -22,7 +22,7 @@ import {
22
22
  } from "@/context/ActionViewContext";
23
23
  import { Many2oneTree } from "../base/many2one/Many2oneTree";
24
24
  import { ReferenceTree } from "../base/ReferenceTree";
25
- import moment from "moment";
25
+ import dayjs from "dayjs";
26
26
  import { DatePickerConfig } from "@/common/DatePicker";
27
27
 
28
28
  type Props = {
@@ -71,7 +71,7 @@ const textComponentFn = (value: any): React.ReactElement => {
71
71
  const dateComponentFn = (value: any): React.ReactElement => {
72
72
  if (!value || (value && value.length === 0)) return <></>;
73
73
 
74
- const formattedValue = moment(
74
+ const formattedValue = dayjs(
75
75
  value,
76
76
  DatePickerConfig.date.dateInternalFormat
77
77
  ).format(DatePickerConfig.date.dateDisplayFormat);
@@ -80,7 +80,7 @@ const dateComponentFn = (value: any): React.ReactElement => {
80
80
 
81
81
  const dateTimeComponentFn = (value: any): React.ReactElement => {
82
82
  if (!value || (value && value.length === 0)) return <></>;
83
- const formattedValue = moment(
83
+ const formattedValue = dayjs(
84
84
  value,
85
85
  DatePickerConfig.time.dateInternalFormat
86
86
  ).format(DatePickerConfig.time.dateDisplayFormat);
@@ -302,7 +302,7 @@ function Tree(props: Props): React.ReactElement {
302
302
  });
303
303
 
304
304
  return (
305
- <div className="p-1 pb-0 pl-2 mt-2 bg-gray-50">{summary.join(", ")}</div>
305
+ <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
306
306
  );
307
307
  }
308
308
 
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
- import { Form, Row, Col, Alert } from "antd";
2
+ import { Form, Row, Col, Alert, theme } from "antd";
3
3
  import useDeepCompareEffect from "use-deep-compare-effect";
4
4
 
5
5
  import {
@@ -15,6 +15,7 @@ import { SearchParams } from "./SearchParams";
15
15
 
16
16
  import { getParamsForFields } from "@/helpers/searchHelper";
17
17
  import Measure from "react-measure";
18
+ const { useToken } = theme;
18
19
 
19
20
  type Props = {
20
21
  fields: any;
@@ -55,6 +56,7 @@ function SearchFilter(props: Props) {
55
56
  const [advancedSearchFields, setAdvancedSearchFields] = useState<Container>();
56
57
  const [advancedFilter, setAdvancedFilter] = useState(false);
57
58
  const sfo = useRef<SearchFilterOoui>();
59
+ const { token } = useToken();
58
60
 
59
61
  const [form] = Form.useForm();
60
62
 
@@ -118,7 +120,8 @@ function SearchFilter(props: Props) {
118
120
  <div ref={measureRef}>
119
121
  <div style={{ display: searchVisible ? "block" : "none" }}>
120
122
  <Form
121
- className="p-3 rounded shadow-md bg-gray-50"
123
+ className="p-3 shadow-md"
124
+ style={{ borderRadius: token.borderRadius }}
122
125
  form={form}
123
126
  onFinish={onFinish}
124
127
  initialValues={{ offset, limit }}
package/dist/Config.d.ts DELETED
@@ -1,6 +0,0 @@
1
- declare const _default: {
2
- requiredClass: string;
3
- requiredColor: string;
4
- };
5
- export default _default;
6
- //# sourceMappingURL=Config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["Config.ts"],"names":[],"mappings":";;;;AAAA,wBAGE"}
package/src/Config.ts DELETED
@@ -1,4 +0,0 @@
1
- export default {
2
- requiredClass: "bg-blue-100",
3
- requiredColor: "#DBEAFE",
4
- };
File without changes