@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.
- package/README.md +0 -6
- package/dist/actionbar/ActionButton.d.ts +2 -2
- package/dist/actionbar/ActionButton.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButton.d.ts +2 -2
- package/dist/actionbar/AttachmentsButton.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +2 -2
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -1
- package/dist/actionbar/ButtonWithBadge.d.ts +2 -2
- package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -1
- package/dist/actionbar/ChangeViewButton.d.ts +2 -2
- package/dist/actionbar/ChangeViewButton.d.ts.map +1 -1
- package/dist/actionbar/DashboardActionBar.d.ts +2 -2
- package/dist/actionbar/DashboardActionBar.d.ts.map +1 -1
- package/dist/actionbar/DropdownButton.d.ts +2 -2
- package/dist/actionbar/DropdownButton.d.ts.map +1 -1
- package/dist/actionbar/FormActionBar.d.ts +2 -2
- package/dist/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/actionbar/GraphActionBar.d.ts +2 -2
- package/dist/actionbar/GraphActionBar.d.ts.map +1 -1
- package/dist/actionbar/NewButton.d.ts +2 -2
- package/dist/actionbar/NewButton.d.ts.map +1 -1
- package/dist/actionbar/SearchBar.d.ts +2 -2
- package/dist/actionbar/SearchBar.d.ts.map +1 -1
- package/dist/actionbar/TreeActionBar.d.ts +2 -2
- package/dist/actionbar/TreeActionBar.d.ts.map +1 -1
- package/dist/common/ButtonWithTooltip.d.ts +2 -2
- package/dist/common/ButtonWithTooltip.d.ts.map +1 -1
- package/dist/common/DatePicker.d.ts +2 -2
- package/dist/common/DatePicker.d.ts.map +1 -1
- package/dist/common/Field.d.ts +1 -1
- package/dist/common/Field.d.ts.map +1 -1
- package/dist/context/ConfigContext.d.ts +7 -0
- package/dist/context/ConfigContext.d.ts.map +1 -0
- package/dist/context/ContentRootContext.d.ts.map +1 -1
- package/dist/helpers/iconMapper.d.ts +10 -5
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react-ooui.es.js +19554 -19286
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +170 -69
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/ui/ErrorAlert.d.ts +2 -2
- package/dist/ui/ErrorAlert.d.ts.map +1 -1
- package/dist/ui/FavouriteButton.d.ts +2 -2
- package/dist/ui/FavouriteButton.d.ts.map +1 -1
- package/dist/ui/GoToResourceModal.d.ts +2 -2
- package/dist/ui/GoToResourceModal.d.ts.map +1 -1
- package/dist/ui/TitleHeader.d.ts +2 -2
- package/dist/ui/TitleHeader.d.ts.map +1 -1
- package/dist/views/CurrentTabContent.d.ts +2 -2
- package/dist/views/CurrentTabContent.d.ts.map +1 -1
- package/dist/views/TabContent.d.ts +1 -1
- package/dist/views/TabContent.d.ts.map +1 -1
- package/dist/views/TabSelector.d.ts +2 -2
- package/dist/views/TabSelector.d.ts.map +1 -1
- package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
- package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
- package/dist/views/actionViews/FormActionView.d.ts +2 -2
- package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
- package/dist/views/actionViews/GraphActionView.d.ts +2 -2
- package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
- package/dist/views/actionViews/TreeActionView.d.ts +2 -2
- package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
- package/dist/views/tabs/Tab.d.ts +2 -2
- package/dist/views/tabs/Tab.d.ts.map +1 -1
- package/dist/widgets/base/Binary.d.ts +3 -3
- package/dist/widgets/base/Binary.d.ts.map +1 -1
- package/dist/widgets/base/Boolean.d.ts +2 -2
- package/dist/widgets/base/Boolean.d.ts.map +1 -1
- package/dist/widgets/base/Button.d.ts +2 -2
- package/dist/widgets/base/Button.d.ts.map +1 -1
- package/dist/widgets/base/Char.d.ts +2 -2
- package/dist/widgets/base/Char.d.ts.map +1 -1
- package/dist/widgets/base/Date.d.ts +2 -2
- package/dist/widgets/base/Date.d.ts.map +1 -1
- package/dist/widgets/base/DateTime.d.ts +2 -2
- package/dist/widgets/base/DateTime.d.ts.map +1 -1
- package/dist/widgets/base/Email.d.ts +2 -2
- package/dist/widgets/base/Email.d.ts.map +1 -1
- package/dist/widgets/base/Float.d.ts +2 -2
- package/dist/widgets/base/Float.d.ts.map +1 -1
- package/dist/widgets/base/FloatTime.d.ts +1 -1
- package/dist/widgets/base/FloatTime.d.ts.map +1 -1
- package/dist/widgets/base/Image.d.ts +3 -3
- package/dist/widgets/base/Image.d.ts.map +1 -1
- package/dist/widgets/base/Integer.d.ts +2 -2
- package/dist/widgets/base/Integer.d.ts.map +1 -1
- package/dist/widgets/base/Label.d.ts +2 -2
- package/dist/widgets/base/Label.d.ts.map +1 -1
- package/dist/widgets/base/LinkInput.d.ts +2 -2
- package/dist/widgets/base/LinkInput.d.ts.map +1 -1
- package/dist/widgets/base/MultiSelection.d.ts +3 -3
- package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
- package/dist/widgets/base/ProgressBar.d.ts +3 -3
- package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
- package/dist/widgets/base/Reference.d.ts +1 -1
- package/dist/widgets/base/Reference.d.ts.map +1 -1
- package/dist/widgets/base/Selection.d.ts +3 -3
- package/dist/widgets/base/Selection.d.ts.map +1 -1
- package/dist/widgets/base/Separator.d.ts +2 -2
- package/dist/widgets/base/Separator.d.ts.map +1 -1
- package/dist/widgets/base/Text.d.ts +2 -2
- package/dist/widgets/base/Text.d.ts.map +1 -1
- package/dist/widgets/base/Url.d.ts +2 -2
- package/dist/widgets/base/Url.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
- package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
- package/dist/widgets/base/one2many/One2many.d.ts +2 -2
- package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
- package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
- package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
- package/dist/widgets/custom/CodeEditor.d.ts +2 -2
- package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
- package/dist/widgets/custom/FiberGrid.d.ts +3 -3
- package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
- package/dist/widgets/custom/Indicator.d.ts +2 -2
- package/dist/widgets/custom/Indicator.d.ts.map +1 -1
- package/dist/widgets/custom/Markdown.d.ts +3 -3
- package/dist/widgets/custom/Markdown.d.ts.map +1 -1
- package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
- package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
- package/dist/widgets/custom/Radio.d.ts +3 -3
- package/dist/widgets/custom/Radio.d.ts.map +1 -1
- package/dist/widgets/custom/Steps.d.ts +3 -3
- package/dist/widgets/custom/Steps.d.ts.map +1 -1
- package/dist/widgets/custom/Switch.d.ts +2 -2
- package/dist/widgets/custom/Switch.d.ts.map +1 -1
- package/dist/widgets/custom/Tag.d.ts +3 -3
- package/dist/widgets/custom/Tag.d.ts.map +1 -1
- package/dist/widgets/custom/Tags.d.ts +3 -3
- package/dist/widgets/custom/Tags.d.ts.map +1 -1
- package/dist/widgets/custom/Timeline.d.ts +3 -3
- package/dist/widgets/custom/Timeline.d.ts.map +1 -1
- package/dist/widgets/modals/ExportModal.d.ts +2 -2
- package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
- package/dist/widgets/modals/FormModal.d.ts +2 -2
- package/dist/widgets/modals/FormModal.d.ts.map +1 -1
- package/dist/widgets/modals/SearchModal.d.ts +2 -2
- package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
- package/dist/widgets/modals/TranslationModal.d.ts +2 -2
- package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
- package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
- package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
- package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
- package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
- package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +2 -2
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
- package/package.json +5 -9
- package/src/__tests__/searchFilterHelper.spec.ts +7 -7
- package/src/actionbar/AttachmentsButton.tsx +22 -24
- package/src/actionbar/ButtonWithBadge.tsx +5 -2
- package/src/actionbar/ChangeViewButton.tsx +10 -2
- package/src/actionbar/TreeActionBar.tsx +82 -75
- package/src/common/DatePicker.tsx +14 -10
- package/src/context/ConfigContext.tsx +9 -0
- package/src/context/ContentRootContext.tsx +46 -48
- package/src/helpers/iconMapper.ts +13 -7
- package/src/index.ts +2 -0
- package/src/stories/Binary.stories.tsx +4 -1
- package/src/stories/Boolean.stories.tsx +4 -1
- package/src/stories/Button.stories.tsx +4 -1
- package/src/stories/Char.stories.tsx +4 -1
- package/src/stories/FiberGrid.stories.tsx +4 -1
- package/src/stories/Float.stories.tsx +4 -1
- package/src/stories/FloatTime.stories.tsx +4 -1
- package/src/stories/Image.stories.tsx +4 -1
- package/src/stories/Integer.stories.tsx +4 -1
- package/src/stories/Label.stories.tsx +4 -1
- package/src/stories/Many2one.stories.tsx +4 -1
- package/src/stories/One2many.stories.tsx +4 -1
- package/src/stories/ProgressBar.stories.tsx +4 -1
- package/src/stories/Reference.stories.tsx +4 -1
- package/src/stories/Selection.stories.tsx +4 -1
- package/src/stories/Separator.stories.tsx +4 -1
- package/src/stories/Text.stories.tsx +4 -1
- package/src/stories/containers/Group.stories.tsx +4 -1
- package/src/stories/containers/NewLine.stories.tsx +4 -1
- package/src/stories/containers/Notebook.stories.tsx +4 -1
- package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
- package/src/stories/custom/CodeEditor.stories.tsx +4 -1
- package/src/stories/custom/Indicator.stories.tsx +4 -1
- package/src/stories/custom/Markdown.stories.tsx +4 -1
- package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
- package/src/stories/custom/Radio.stories.tsx +4 -1
- package/src/stories/custom/Steps.stories.tsx +4 -1
- package/src/stories/custom/Switch.stories.tsx +4 -1
- package/src/stories/custom/Tag.stories.tsx +4 -1
- package/src/stories/custom/Tags.stories.tsx +4 -1
- package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
- package/src/stories/ui/ActionBar.stories.tsx +2 -1
- package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
- package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
- package/src/stories/views/SearchTree.stories.tsx +3 -1
- package/src/stories/views/Tab.stories.tsx +3 -1
- package/src/stories/views/TabsAndContent.stories.tsx +3 -1
- package/src/stories/views/Tree.stories.jsx +4 -1
- package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
- package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
- package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
- package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
- package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
- package/src/ui/FavouriteButton.tsx +16 -5
- package/src/ui/GoToResourceModal.tsx +3 -3
- package/src/ui/TitleHeader.tsx +18 -4
- package/src/views/tabs/Tab.tsx +12 -6
- package/src/widgets/base/Binary.tsx +8 -5
- package/src/widgets/base/Boolean.tsx +8 -7
- package/src/widgets/base/Char.tsx +14 -12
- package/src/widgets/base/Float.tsx +11 -5
- package/src/widgets/base/FloatTime.tsx +9 -5
- package/src/widgets/base/Integer.tsx +9 -5
- package/src/widgets/base/Label.tsx +6 -2
- package/src/widgets/base/LinkInput.tsx +11 -6
- package/src/widgets/base/MultiSelection.tsx +6 -2
- package/src/widgets/base/Selection.tsx +6 -2
- package/src/widgets/base/Text.tsx +14 -12
- package/src/widgets/base/many2one/Many2one.tsx +15 -12
- package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
- package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
- package/src/widgets/custom/FiberGrid.tsx +1 -4
- package/src/widgets/custom/Indicator.tsx +16 -15
- package/src/widgets/modals/FormModal.tsx +3 -3
- package/src/widgets/modals/SearchModal.tsx +29 -31
- package/src/widgets/modals/TranslationModal.tsx +3 -3
- package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
- package/src/widgets/views/Graph/GraphDefaults.ts +3 -3
- package/src/widgets/views/Tree.tsx +4 -4
- package/src/widgets/views/searchFilter/SearchFilter.tsx +5 -2
- package/dist/Config.d.ts +0 -6
- package/dist/Config.d.ts.map +0 -1
- package/src/Config.ts +0 -4
- /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.
|
|
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.
|
|
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": "^
|
|
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": "^
|
|
73
|
-
"@types/react-dom": "^
|
|
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
|
|
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": [
|
|
76
|
+
"dateField#date": [dayjs("2021-01-01"), dayjs("2021-01-02")],
|
|
77
77
|
"dateField#time": [
|
|
78
|
-
|
|
79
|
-
|
|
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: [
|
|
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": [
|
|
367
|
-
"field#time": [
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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:
|
|
24
|
-
color:
|
|
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={{
|
|
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={{
|
|
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
|
-
|
|
322
|
-
|
|
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
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
|
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
|
|
51
|
-
|
|
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:
|
|
73
|
+
? { defaultValue: dayjs("00:00:00", "HH:mm:ss") }
|
|
70
74
|
: undefined;
|
|
71
75
|
const dateValue = value
|
|
72
|
-
?
|
|
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
|
-
|
|
94
|
+
/>
|
|
91
95
|
);
|
|
92
96
|
};
|
|
93
97
|
|
|
@@ -344,54 +344,52 @@ const ContentRootProvider = (
|
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
return (
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
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 (
|
|
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],
|
|
113
|
+
return getIconForKey(iconMapping[key], props);
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
return getIconForKey(key,
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5
|
+
|
|
6
|
+
// import "antd/dist/antd.css";
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
import LocaleProvider from "../context/LocaleContext";
|
|
7
10
|
|
|
8
11
|
export default {
|