@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.2.0-rc.79",
3
+ "version": "1.2.0-rc.81",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -13,10 +13,6 @@
13
13
  ".": {
14
14
  "import": "./dist/react-ooui.es.js",
15
15
  "require": "./dist/react-ooui.umd.js"
16
- },
17
- "./dist/main.css": {
18
- "import": "./dist/main.css",
19
- "require": "./dist/main.css"
20
16
  }
21
17
  },
22
18
  "publishConfig": {
@@ -37,11 +33,11 @@
37
33
  "dependencies": {
38
34
  "@ant-design/plots": "^1.0.9",
39
35
  "@gisce/ooui": "^0.19.4",
40
- "@gisce/react-formiga-components": "^1.0.9-rc.20",
36
+ "@gisce/react-formiga-components": "^1.0.9-rc.21",
41
37
  "@gisce/react-formiga-table": "^0.5.0",
42
38
  "@monaco-editor/react": "^4.4.5",
43
39
  "@tabler/icons-react": "^2.11.0",
44
- "antd": "^4.24.3",
40
+ "antd": "^5.5.2",
45
41
  "buffer": "^6.0.3",
46
42
  "fiber-diagram": "github:gisce/fiber-diagram",
47
43
  "file-type": "^16.5.0",
@@ -69,8 +65,8 @@
69
65
  "@types/jest": "^26.0.15",
70
66
  "@types/lodash": "^4.14.170",
71
67
  "@types/node": "^12.0.0",
72
- "@types/react": "^16.9.53",
73
- "@types/react-dom": "^16.9.8",
68
+ "@types/react": "^17.0.1",
69
+ "@types/react-dom": "^17.0.1",
74
70
  "@types/react-grid-layout": "^1.3.2",
75
71
  "@types/react-measure": "^2.0.7",
76
72
  "@types/react-responsive": "^8.0.2",
@@ -3,7 +3,7 @@ import {
3
3
  groupDateTimeValuesIfNeeded,
4
4
  getParamsForFields,
5
5
  } from "../helpers/searchFilterHelper";
6
- import moment from "moment";
6
+ import dayjs from "dayjs";
7
7
 
8
8
  describe("A SearchFilterHelper instance", () => {
9
9
  describe("removeUndefinedFields method", () => {
@@ -73,10 +73,10 @@ describe("A SearchFilterHelper instance", () => {
73
73
  const object = {
74
74
  charValue: "test",
75
75
  floatValue: 0.5,
76
- "dateField#date": [moment("2021-01-01"), moment("2021-01-02")],
76
+ "dateField#date": [dayjs("2021-01-01"), dayjs("2021-01-02")],
77
77
  "dateField#time": [
78
- moment("1970-01-01 00:00"),
79
- moment("1970-01-01 04:00"),
78
+ dayjs("1970-01-01 00:00"),
79
+ dayjs("1970-01-01 04:00"),
80
80
  ],
81
81
  };
82
82
 
@@ -338,7 +338,7 @@ describe("A SearchFilterHelper instance", () => {
338
338
  },
339
339
  };
340
340
  const values = {
341
- field: [moment("2021-01-01"), moment("2021-01-02")],
341
+ field: [dayjs("2021-01-01"), dayjs("2021-01-02")],
342
342
  };
343
343
  const params = getParamsForFields(values, fields);
344
344
  expect(Array.isArray(params)).toBeTruthy();
@@ -363,8 +363,8 @@ describe("A SearchFilterHelper instance", () => {
363
363
  },
364
364
  };
365
365
  const values = {
366
- "field#date": [moment("2021-01-01"), moment("2021-01-02")],
367
- "field#time": [moment("1970-01-01 03:31"), moment("1970-01-01 03:32")],
366
+ "field#date": [dayjs("2021-01-01"), dayjs("2021-01-02")],
367
+ "field#time": [dayjs("1970-01-01 03:31"), dayjs("1970-01-01 03:32")],
368
368
  };
369
369
  const params = getParamsForFields(values, fields);
370
370
  expect(Array.isArray(params)).toBeTruthy();
@@ -103,30 +103,28 @@ function AttachmentsButton(props: AttachmentsButtonProps) {
103
103
  preloadAttachments();
104
104
  }, [preloadAttachments]);
105
105
 
106
- return (
107
- <>
108
- <AttachmentsButtonWrapper
109
- numberOfAttachments={attachments.length}
110
- attachments={preloadedAttachments}
111
- disabled={disabled}
112
- loading={preloading}
113
- onAddNewAttachment={onAddNewAttachment}
114
- onListAllAttachments={onListAllAttachments}
115
- onopenAttachmentLink={openAttachmentLink}
116
- onOpenAttachmentDetail={openAttachmentDetail}
117
- />
118
- <Modal
119
- title={t("downloadingAttachment")}
120
- visible={downloading}
121
- footer={null}
122
- closable={false}
123
- centered
124
- maskClosable={false}
125
- >
126
- <Spin />
127
- </Modal>
128
- </>
129
- );
106
+ return (<>
107
+ <AttachmentsButtonWrapper
108
+ numberOfAttachments={attachments.length}
109
+ attachments={preloadedAttachments}
110
+ disabled={disabled}
111
+ loading={preloading}
112
+ onAddNewAttachment={onAddNewAttachment}
113
+ onListAllAttachments={onListAllAttachments}
114
+ onopenAttachmentLink={openAttachmentLink}
115
+ onOpenAttachmentDetail={openAttachmentDetail}
116
+ />
117
+ <Modal
118
+ title={t("downloadingAttachment")}
119
+ open={downloading}
120
+ footer={null}
121
+ closable={false}
122
+ centered
123
+ maskClosable={false}
124
+ >
125
+ <Spin />
126
+ </Modal>
127
+ </>);
130
128
  }
131
129
 
132
130
  export default AttachmentsButton;
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import ButtonWithTooltip, {Props as ButtonWithTooltipProps } from "@/common/ButtonWithTooltip";
3
+ import { theme } from 'antd';
4
+ const { useToken } = theme;
3
5
 
4
6
  type Props = ButtonWithTooltipProps & {
5
7
  badgeNumber?: number;
@@ -7,6 +9,7 @@ type Props = ButtonWithTooltipProps & {
7
9
 
8
10
  function ButtonWithBadge(props: Props) {
9
11
  const { badgeNumber = 0, ...restProps } = props;
12
+ const { token } = useToken();
10
13
 
11
14
  return (
12
15
  <div style={{ position: "relative" }}>
@@ -20,8 +23,8 @@ function ButtonWithBadge(props: Props) {
20
23
  borderRadius: "50%",
21
24
  fontSize: "12px",
22
25
  textAlign: "center",
23
- background: "#1890FF",
24
- color: "#fefefe",
26
+ background: token.colorPrimaryBg,
27
+ color: token.colorPrimaryHover,
25
28
  }}
26
29
  >
27
30
  {badgeNumber}
@@ -106,7 +106,11 @@ function ChangeViewButton(props: Props) {
106
106
  <ButtonWithTooltip
107
107
  tooltip={previousView ? t("viewAs") + " " + t(previousView.type) : ""}
108
108
  icon={getIconForView(previousView)}
109
- style={{ width: 50 }}
109
+ style={{
110
+ width: 50,
111
+ borderTopRightRadius: 0,
112
+ borderBottomRightRadius: 0,
113
+ }}
110
114
  onClick={() => {
111
115
  handleMenuClick({ key: previousView?.view_id });
112
116
  }}
@@ -117,7 +121,11 @@ function ChangeViewButton(props: Props) {
117
121
  disabled={disabled || availableViews.length === 1}
118
122
  >
119
123
  <Button
120
- style={{ width: 25 }}
124
+ style={{
125
+ width: 25,
126
+ borderTopLeftRadius: 0,
127
+ borderBottomLeftRadius: 0,
128
+ }}
121
129
  icon={<DownOutlined style={{ fontSize: "0.5em" }} />}
122
130
  onClick={(e) => e.preventDefault()}
123
131
  ></Button>
@@ -30,6 +30,7 @@ import { showLogInfo } from "@/helpers/logInfoHelper";
30
30
  import SearchBar from "./SearchBar";
31
31
  import { ExportModal } from "..";
32
32
  import { mergeParams } from "@/helpers/searchHelper";
33
+ import { ConfigContext } from "@/context/ConfigContext";
33
34
 
34
35
  type Props = {
35
36
  parentContext?: any;
@@ -65,7 +66,7 @@ function TreeActionBar(props: Props) {
65
66
  } = useContext(ActionViewContext) as ActionViewContextType;
66
67
 
67
68
  const { parentContext = {}, treeExpandable, toolbar } = props;
68
-
69
+ const { previewFeatures } = useContext(ConfigContext);
69
70
  const { t, lang } = useContext(LocaleContext) as LocaleContextType;
70
71
  const contentRootContext = useContext(
71
72
  ContentRootContext
@@ -278,84 +279,90 @@ function TreeActionBar(props: Props) {
278
279
  });
279
280
  }}
280
281
  />
281
- {separator()}
282
- <DropdownButton
283
- icon={
284
- <Icon
285
- component={() => (
286
- <svg
287
- xmlns="http://www.w3.org/2000/svg"
288
- className="icon icon-tabler icon-tabler-database-export"
289
- width="1em"
290
- height="1em"
291
- viewBox="0 0 24 24"
292
- strokeWidth="1.5"
293
- fill="none"
294
- stroke="currentColor"
295
- strokeLinecap="round"
296
- strokeLinejoin="round"
297
- >
298
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
299
- <ellipse cx="12" cy="6" rx="8" ry="3" />
300
- <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
301
- <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
302
- </svg>
303
- )}
304
- />
305
- }
306
- tooltip={t("export")}
307
- items={[
308
- {
309
- id: "print_screen",
310
- name: t("printScreen"),
311
- },
312
- {
313
- id: "export",
314
- name: t("advancedExport"),
315
- },
316
- ]}
317
- onItemClick={(itemClicked: any) => {
318
- if (itemClicked.id === "print_screen") {
319
- let idsToExport = selectedRowItems?.map((item) => item.id) || [];
320
282
 
321
- if (idsToExport.length === 0) {
322
- idsToExport = results?.map((item) => item.id) || [];
283
+ {previewFeatures && (
284
+ <>
285
+ {separator()}
286
+ <DropdownButton
287
+ icon={
288
+ <Icon
289
+ component={() => (
290
+ <svg
291
+ xmlns="http://www.w3.org/2000/svg"
292
+ className="icon icon-tabler icon-tabler-database-export"
293
+ width="1em"
294
+ height="1em"
295
+ viewBox="0 0 24 24"
296
+ strokeWidth="1.5"
297
+ fill="none"
298
+ stroke="currentColor"
299
+ strokeLinecap="round"
300
+ strokeLinejoin="round"
301
+ >
302
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
303
+ <ellipse cx="12" cy="6" rx="8" ry="3" />
304
+ <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
305
+ <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
306
+ </svg>
307
+ )}
308
+ />
323
309
  }
324
-
325
- runAction({
326
- id: -1,
327
- model: currentModel,
328
- report_name: "printscreen.list",
329
- type: "ir.actions.report.xml",
330
- datas: {
331
- model: currentModel,
332
- ids: idsToExport,
310
+ tooltip={t("export")}
311
+ items={[
312
+ {
313
+ id: "print_screen",
314
+ name: t("printScreen"),
333
315
  },
334
- });
335
- return;
336
- }
316
+ {
317
+ id: "export",
318
+ name: t("advancedExport"),
319
+ },
320
+ ]}
321
+ onItemClick={(itemClicked: any) => {
322
+ if (itemClicked.id === "print_screen") {
323
+ let idsToExport =
324
+ selectedRowItems?.map((item) => item.id) || [];
337
325
 
338
- setExportModalVisible(true);
339
- }}
340
- disabled={
341
- duplicatingItem || removingItem || treeIsLoading || hasNameSearch
342
- }
343
- />
344
- <ExportModal
345
- visible={exportModalVisible}
346
- locale={lang}
347
- onClose={() => setExportModalVisible(false)}
348
- model={currentModel!}
349
- domain={mergeParams(
350
- searchTreeRef?.current?.getDomain() || [],
351
- searchParams || []
352
- )}
353
- limit={limit}
354
- totalRegisters={totalItems || 0}
355
- selectedRegistersToExport={selectedRowItems}
356
- visibleRegisters={results?.length || 0}
357
- context={parentContext}
358
- />
326
+ if (idsToExport.length === 0) {
327
+ idsToExport = results?.map((item) => item.id) || [];
328
+ }
329
+
330
+ runAction({
331
+ id: -1,
332
+ model: currentModel,
333
+ report_name: "printscreen.list",
334
+ type: "ir.actions.report.xml",
335
+ datas: {
336
+ model: currentModel,
337
+ ids: idsToExport,
338
+ },
339
+ });
340
+ return;
341
+ }
342
+
343
+ setExportModalVisible(true);
344
+ }}
345
+ disabled={
346
+ duplicatingItem || removingItem || treeIsLoading || hasNameSearch
347
+ }
348
+ />
349
+ <ExportModal
350
+ visible={exportModalVisible}
351
+ locale={lang}
352
+ onClose={() => setExportModalVisible(false)}
353
+ model={currentModel!}
354
+ domain={mergeParams(
355
+ searchTreeRef?.current?.getDomain() || [],
356
+ searchParams || []
357
+ )}
358
+ limit={limit}
359
+ totalRegisters={totalItems || 0}
360
+ selectedRegistersToExport={selectedRowItems}
361
+ visibleRegisters={results?.length || 0}
362
+ context={parentContext}
363
+ />
364
+ </>
365
+ )}
359
366
  </Space>
360
367
  );
361
368
  }
@@ -1,11 +1,11 @@
1
- import { DatePicker as AntDatePicker } from "antd";
1
+ import { DatePicker as AntDatePicker, theme } from "antd";
2
2
 
3
3
  import React from "react";
4
4
  import Field from "@/common/Field";
5
5
  import { WidgetProps } from "@/types";
6
- import Config from "@/Config";
7
6
  import { Date as DateOoui } from "@gisce/ooui";
8
- import moment from "moment";
7
+ import dayjs from "dayjs";
8
+ const { useToken } = theme;
9
9
 
10
10
  type DatePickerProps = WidgetProps & {
11
11
  showTime?: boolean;
@@ -47,8 +47,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
47
47
  ) => {
48
48
  const { value, onChange, ooui, showTime } = props;
49
49
  const { id, readOnly, required } = ooui as DateOoui;
50
- const requiredClass =
51
- required && !readOnly ? Config.requiredClass : undefined;
50
+ const { token } = useToken();
51
+
52
+ const requiredStyle =
53
+ required && !readOnly
54
+ ? { backgroundColor: token.colorPrimaryBg }
55
+ : undefined;
52
56
 
53
57
  const mode = showTime ? "time" : "date";
54
58
 
@@ -66,15 +70,15 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
66
70
  };
67
71
 
68
72
  const showTimeParms = showTime
69
- ? { defaultValue: moment("00:00:00", "HH:mm:ss") }
73
+ ? { defaultValue: dayjs("00:00:00", "HH:mm:ss") }
70
74
  : undefined;
71
75
  const dateValue = value
72
- ? moment(value, DatePickerConfig[mode].dateInternalFormat)
76
+ ? dayjs(value, DatePickerConfig[mode].dateInternalFormat)
73
77
  : undefined;
74
78
 
75
79
  return (
76
80
  <AntDatePicker
77
- style={{ width: "100%" }}
81
+ style={{ width: "100%", ...requiredStyle }}
78
82
  placeholder={
79
83
  showTime
80
84
  ? DatePickerConfig.time.placeholder
@@ -82,12 +86,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
82
86
  }
83
87
  disabled={readOnly}
84
88
  id={id}
89
+ picker={showTime ? "time" : "date"}
85
90
  showTime={showTimeParms}
86
- className={requiredClass}
87
91
  format={DatePickerConfig[mode].dateDisplayFormat}
88
92
  value={dateValue}
89
93
  onChange={onValueStringChange}
90
- ></AntDatePicker>
94
+ />
91
95
  );
92
96
  };
93
97
 
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+
3
+ interface ConfigContextProps {
4
+ previewFeatures: boolean;
5
+ }
6
+
7
+ export const ConfigContext = React.createContext<ConfigContextProps>({
8
+ previewFeatures: false,
9
+ });
@@ -344,54 +344,52 @@ const ContentRootProvider = (
344
344
  });
345
345
  }
346
346
 
347
- return (
348
- <>
349
- <ContentRootContext.Provider
350
- value={{
351
- processAction,
352
- globalValues,
353
- }}
354
- >
355
- <>
356
- {children}
357
- <Modal
358
- title={t("generatingReport")}
359
- visible={reportGenerating}
360
- footer={null}
361
- closable={false}
362
- centered
363
- maskClosable={false}
364
- >
365
- <Spin />
366
- </Modal>
367
- <FormModal
368
- buttonModal
369
- parentContext={actionModalOptions.context}
370
- model={actionModalOptions.model!}
371
- formView={actionModalOptions.formView}
372
- visible={actionModalVisible}
373
- onSubmitSucceed={onFormModalSucceed}
374
- onCancel={() => {
375
- callRefreshValues(onRefreshParentValues.current);
376
- onRefreshParentValues.current = [];
377
- setActionModalVisible(false);
378
- setActionModalOptions({
379
- domain: undefined,
380
- model: undefined,
381
- context: {},
382
- formView: undefined,
383
- actionData: undefined,
384
- });
385
- }}
386
- showFooter={false}
387
- actionDomain={actionModalOptions.domain}
388
- isMenuAction={actionModalOptions?.actionData !== undefined}
389
- actionData={actionModalOptions?.actionData}
390
- />
391
- </>
392
- </ContentRootContext.Provider>
393
- </>
394
- );
347
+ return (<>
348
+ <ContentRootContext.Provider
349
+ value={{
350
+ processAction,
351
+ globalValues,
352
+ }}
353
+ >
354
+ <>
355
+ {children}
356
+ <Modal
357
+ title={t("generatingReport")}
358
+ open={reportGenerating}
359
+ footer={null}
360
+ closable={false}
361
+ centered
362
+ maskClosable={false}
363
+ >
364
+ <Spin />
365
+ </Modal>
366
+ <FormModal
367
+ buttonModal
368
+ parentContext={actionModalOptions.context}
369
+ model={actionModalOptions.model!}
370
+ formView={actionModalOptions.formView}
371
+ visible={actionModalVisible}
372
+ onSubmitSucceed={onFormModalSucceed}
373
+ onCancel={() => {
374
+ callRefreshValues(onRefreshParentValues.current);
375
+ onRefreshParentValues.current = [];
376
+ setActionModalVisible(false);
377
+ setActionModalOptions({
378
+ domain: undefined,
379
+ model: undefined,
380
+ context: {},
381
+ formView: undefined,
382
+ actionData: undefined,
383
+ });
384
+ }}
385
+ showFooter={false}
386
+ actionDomain={actionModalOptions.domain}
387
+ isMenuAction={actionModalOptions?.actionData !== undefined}
388
+ actionData={actionModalOptions?.actionData}
389
+ />
390
+ </>
391
+ </ContentRootContext.Provider>
392
+ </>);
395
393
  };
396
394
 
397
395
  async function getViewsAndInitialView({
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { CSSProperties } from "react";
2
2
  import * as AntIcons from "@ant-design/icons";
3
3
  import * as TablerIcons from "@tabler/icons-react";
4
4
  import Icon from "@ant-design/icons";
@@ -100,17 +100,20 @@ const iconMapping: { [key: string]: string } = {
100
100
  STOCK_PREFERENCES: "Setting",
101
101
  };
102
102
 
103
- export default (key: string, className?: any) => {
103
+ export default (
104
+ key: string,
105
+ props?: { className?: any; style: CSSProperties }
106
+ ) => {
104
107
  if (key.indexOf("gtk-") !== -1) {
105
108
  const rootIcon = key.replace("gtk-", "").replace(/\-/g, "_");
106
109
  key = `STOCK_${rootIcon.toUpperCase()}`;
107
110
  }
108
111
 
109
112
  if (iconMapping.hasOwnProperty(key)) {
110
- return getIconForKey(iconMapping[key], className);
113
+ return getIconForKey(iconMapping[key], props);
111
114
  }
112
115
 
113
- return getIconForKey(key, className);
116
+ return getIconForKey(key, props);
114
117
  };
115
118
 
116
119
  function toCamelCase(key: string): string {
@@ -125,7 +128,10 @@ function toCamelCase(key: string): string {
125
128
  .join("")}`;
126
129
  }
127
130
 
128
- function getIconForKey(key: string, className?: any) {
131
+ function getIconForKey(
132
+ key: string,
133
+ props?: { className?: any; style: CSSProperties }
134
+ ) {
129
135
  let IconCamelCase = key.charAt(0).toUpperCase() + key.slice(1); // Capitalize first letter
130
136
  if (IconCamelCase.indexOf("-") !== -1) {
131
137
  IconCamelCase = toCamelCase(IconCamelCase);
@@ -135,7 +141,7 @@ function getIconForKey(key: string, className?: any) {
135
141
  if (AntIcons[antKey]) {
136
142
  return () =>
137
143
  React.createElement(AntIcons[antKey] as any, {
138
- className,
144
+ ...props,
139
145
  });
140
146
  }
141
147
 
@@ -150,7 +156,7 @@ function getIconForKey(key: string, className?: any) {
150
156
  const CustomIcon = () =>
151
157
  React.createElement(Icon, {
152
158
  component: TablerIcon,
153
- className,
159
+ ...props,
154
160
  });
155
161
  return CustomIcon;
156
162
  }
package/src/index.ts CHANGED
@@ -79,6 +79,7 @@ import TabSelector from "./views/TabSelector";
79
79
  import CurrentTabContent from "./views/CurrentTabContent";
80
80
  import ContentRootProvider from "./context/ContentRootContext";
81
81
  import FavouriteButton from "./ui/FavouriteButton";
82
+ import { ConfigContext } from "./context/ConfigContext";
82
83
 
83
84
  export {
84
85
  Button,
@@ -155,4 +156,5 @@ export {
155
156
  Steps,
156
157
  CodeEditor,
157
158
  ExportModal,
159
+ ConfigContext,
158
160
  };
@@ -2,7 +2,10 @@ import React, { useState } from "react";
2
2
 
3
3
  import { BinaryInput } from "../widgets/base/Binary";
4
4
  import { Binary as BinaryOoui } from "@gisce/ooui";
5
- import "antd/dist/antd.css";
5
+
6
+ // import "antd/dist/antd.css";
7
+
8
+
6
9
  import LocaleProvider from "../context/LocaleContext";
7
10
 
8
11
  export default {
@@ -2,7 +2,10 @@ import React from "react";
2
2
 
3
3
  import { Boolean } from "..";
4
4
  import { Boolean as BooleanOoui } from "@gisce/ooui";
5
- import "antd/dist/antd.css";
5
+
6
+ // import "antd/dist/antd.css";
7
+
8
+
6
9
  import LocaleProvider from "../context/LocaleContext";
7
10
 
8
11
  export default {
@@ -2,7 +2,10 @@ import React from "react";
2
2
 
3
3
  import { Button } from "..";
4
4
  import { Button as ButtonOoui } from "@gisce/ooui";
5
- import "antd/dist/antd.css";
5
+
6
+ // import "antd/dist/antd.css";
7
+
8
+
6
9
  import LocaleProvider from "../context/LocaleContext";
7
10
 
8
11
  export default {