@gisce/react-ooui 1.1.25-rc.1 → 1.1.25
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/dist/helpers/iconMapper.d.ts +3 -1
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +10021 -13490
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +23 -23
- package/dist/react-ooui.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/iconMapper.ts +113 -107
- package/dist/helpers/icons/antd_icons.d.ts +0 -4
- package/dist/helpers/icons/antd_icons.d.ts.map +0 -1
- package/dist/helpers/icons/tabler_icons.d.ts +0 -4
- package/dist/helpers/icons/tabler_icons.d.ts.map +0 -1
- package/src/helpers/icons/antd_icons.ts +0 -1583
- package/src/helpers/icons/tabler_icons.ts +0 -5367
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "1.1.25
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/plots": "^1.0.9",
|
|
39
|
-
"@gisce/ooui": "^0.17.
|
|
39
|
+
"@gisce/ooui": "^0.17.12",
|
|
40
40
|
"@gisce/react-formiga-table": "^0.5.0",
|
|
41
41
|
"@monaco-editor/react": "^4.4.5",
|
|
42
42
|
"@tabler/icons": "^1.96.0",
|
|
@@ -1,111 +1,119 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { TablerIcons } from "./icons/tabler_icons";
|
|
2
|
+
import * as AntIcons from "@ant-design/icons";
|
|
3
|
+
import * as TablerIcons from "@tabler/icons";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"terp-
|
|
11
|
-
"terp-
|
|
12
|
-
"terp-
|
|
13
|
-
"terp-
|
|
14
|
-
"terp-
|
|
15
|
-
"terp-
|
|
16
|
-
"terp-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
5
|
+
type TablerKey = keyof typeof TablerIcons;
|
|
6
|
+
type AntKey = keyof typeof AntIcons;
|
|
7
|
+
|
|
8
|
+
const iconMapping: { [key: string]: string } = {
|
|
9
|
+
"terp-purchase": "ShoppingCart",
|
|
10
|
+
"terp-graph": "PieChart",
|
|
11
|
+
"terp-crm": "Contacts",
|
|
12
|
+
"terp-hr": "Friends",
|
|
13
|
+
"terp-account": "BuildingBank",
|
|
14
|
+
"terp-project": "Checklist",
|
|
15
|
+
"terp-administration": "Adjustments",
|
|
16
|
+
"terp-partner": "Team",
|
|
17
|
+
"terp-mrp": "Build",
|
|
18
|
+
"terp-product": "Shopping",
|
|
19
|
+
STOCK_JUSTIFY_FILL: "UnorderedList",
|
|
20
|
+
STOCK_INDENT: "IndentIncrease",
|
|
21
|
+
STOCK_HELP: "Question",
|
|
22
|
+
STOCK_GO_UP: "ArrowUp",
|
|
23
|
+
STOCK_SORT_DESCENDING: "SortDescending",
|
|
24
|
+
STOCK_ADD: "Plus",
|
|
25
|
+
STOCK_GOTO_LAST: "FastForward",
|
|
26
|
+
STOCK_FIND: "Search",
|
|
27
|
+
STOCK_PROPERTIES: "Control",
|
|
28
|
+
STOCK_DIALOG_INFO: "Info",
|
|
29
|
+
STOCK_FLOPPY: "Usb",
|
|
30
|
+
STOCK_JUSTIFY_CENTER: "AlignCenter",
|
|
31
|
+
STOCK_GO_BACK: "ArrowLeft",
|
|
32
|
+
STOCK_UNDERLINE: "Underline",
|
|
33
|
+
STOCK_BOLD: "Bold",
|
|
34
|
+
STOCK_APPLY: "Check",
|
|
35
|
+
STOCK_ZOOM_OUT: "ZoomOut",
|
|
36
|
+
STOCK_STRIKETHROUGH: "Strikethrough",
|
|
37
|
+
STOCK_MEDIA_REWIND: "Backward",
|
|
38
|
+
STOCK_PRINT: "Printer",
|
|
39
|
+
STOCK_NO: "Close",
|
|
40
|
+
STOCK_GOTO_FIRST: "FastBackward",
|
|
41
|
+
STOCK_CLOSE: "Close",
|
|
42
|
+
STOCK_REMOVE: "Minus",
|
|
43
|
+
STOCK_CUT: "Scissor",
|
|
44
|
+
STOCK_DIALOG_AUTHENTICATION: "Safety",
|
|
45
|
+
STOCK_ZOOM_FIT: "Expand",
|
|
46
|
+
STOCK_JUMP_TO: "Select",
|
|
47
|
+
STOCK_HARDDISK: "Hdd",
|
|
48
|
+
STOCK_SAVE_AS: "Save",
|
|
49
|
+
STOCK_UNDO: "Undo",
|
|
50
|
+
STOCK_JUSTIFY_RIGHT: "AlignRight",
|
|
51
|
+
STOCK_DIALOG_ERROR: "CloseCircle",
|
|
52
|
+
STOCK_INDEX: "Profile",
|
|
53
|
+
STOCK_GOTO_BOTTOM: "VerticalAlignBottom",
|
|
54
|
+
STOCK_MEDIA_NEXT: "StepForward",
|
|
55
|
+
STOCK_REDO: "Redo",
|
|
56
|
+
STOCK_COPY: "Copy",
|
|
57
|
+
STOCK_MEDIA_PAUSE: "Pause",
|
|
58
|
+
STOCK_GO_FORWARD: "ArrowRight",
|
|
59
|
+
STOCK_UNDELETE: "Undo",
|
|
60
|
+
STOCK_EXECUTE: "Setting",
|
|
61
|
+
STOCK_SAVE: "Save",
|
|
62
|
+
STOCK_DIALOG_QUESTION: "QuestionCircle",
|
|
63
|
+
STOCK_SORT_ASCENDING: "SortAscending",
|
|
64
|
+
STOCK_REFRESH: "Reload",
|
|
65
|
+
STOCK_MEDIA_FORWARD: "Forward",
|
|
66
|
+
STOCK_STOP: "Border",
|
|
67
|
+
STOCK_PRINT_PREVIEW: "Printer",
|
|
68
|
+
STOCK_HOME: "Home",
|
|
69
|
+
STOCK_PASTE: "CarryOut",
|
|
70
|
+
STOCK_ZOOM_100: "ZoomIn",
|
|
71
|
+
STOCK_FIND_AND_REPLACE: "FileSearch",
|
|
72
|
+
STOCK_DIALOG_WARNING: "Warning",
|
|
73
|
+
STOCK_ZOOM_IN: "ZoomIn",
|
|
74
|
+
STOCK_CONVERT: "Export",
|
|
75
|
+
STOCK_ITALIC: "Italic",
|
|
76
|
+
STOCK_YES: "Check",
|
|
77
|
+
STOCK_MEDIA_PLAY: "PlayCircle",
|
|
78
|
+
STOCK_MEDIA_RECORD: "VideoCamera",
|
|
79
|
+
STOCK_MEDIA_PREVIOUS: "StepBackward",
|
|
80
|
+
STOCK_NEW: "FileAdd",
|
|
81
|
+
STOCK_CANCEL: "Close",
|
|
82
|
+
STOCK_DISCONNECT: "Api",
|
|
83
|
+
STOCK_JUSTIFY_LEFT: "AlignLeft",
|
|
84
|
+
STOCK_FILE: "File",
|
|
85
|
+
STOCK_QUIT: "Logout",
|
|
86
|
+
STOCK_EDIT: "Edit",
|
|
87
|
+
STOCK_CONNECT: "Api",
|
|
88
|
+
STOCK_GO_DOWN: "CaretDown",
|
|
89
|
+
STOCK_NETWORK: "Apartment",
|
|
90
|
+
STOCK_OK: "Check",
|
|
91
|
+
STOCK_GOTO_TOP: "VerticalAlignTop",
|
|
92
|
+
STOCK_ABOUT: "Star",
|
|
93
|
+
STOCK_COLOR_PICKER: "Aim",
|
|
94
|
+
STOCK_SELECT_FONT: "FontSize",
|
|
95
|
+
STOCK_DELETE: "Delete",
|
|
96
|
+
STOCK_DND: "FileText",
|
|
97
|
+
STOCK_CLEAR: "CloseSquare",
|
|
98
|
+
STOCK_UNINDENT: "AlignLeft",
|
|
99
|
+
STOCK_PREFERENCES: "Setting",
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
export default (key: string)
|
|
102
|
+
export default (key: string) => {
|
|
101
103
|
if (key.indexOf("gtk-") !== -1) {
|
|
102
104
|
const rootIcon = key.replace("gtk-", "").replace("-", "_");
|
|
103
105
|
const newKey = `STOCK_${rootIcon.toUpperCase()}`;
|
|
104
|
-
return iconMapping[newKey];
|
|
106
|
+
return getIconForKey(iconMapping[newKey]);
|
|
105
107
|
}
|
|
108
|
+
|
|
106
109
|
if (iconMapping.hasOwnProperty(key)) {
|
|
107
|
-
return iconMapping[key];
|
|
110
|
+
return getIconForKey(iconMapping[key]);
|
|
108
111
|
}
|
|
112
|
+
|
|
113
|
+
return getIconForKey(key);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function getIconForKey(key: string) {
|
|
109
117
|
const IconCamelCase = `${key
|
|
110
118
|
.split("-")
|
|
111
119
|
.map((word) =>
|
|
@@ -116,17 +124,15 @@ export default (key: string): React.ElementType | undefined => {
|
|
|
116
124
|
)
|
|
117
125
|
.join("")}`;
|
|
118
126
|
|
|
119
|
-
const antKey = `${IconCamelCase}Outlined
|
|
120
|
-
if (
|
|
121
|
-
return
|
|
127
|
+
const antKey: AntKey = `${IconCamelCase}Outlined` as any;
|
|
128
|
+
if (AntIcons[antKey]) {
|
|
129
|
+
return AntIcons[antKey];
|
|
122
130
|
}
|
|
123
131
|
|
|
124
|
-
const tablerKey = `Icon${IconCamelCase}
|
|
125
|
-
if (TablerIcons
|
|
126
|
-
|
|
127
|
-
React.createElement(Icon, { component: TablerIcons[tablerKey] });
|
|
128
|
-
return CustomIcon;
|
|
132
|
+
const tablerKey: TablerKey = `Icon${IconCamelCase}` as any;
|
|
133
|
+
if (TablerIcons[tablerKey]) {
|
|
134
|
+
return TablerIcons[tablerKey];
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
return undefined;
|
|
132
|
-
}
|
|
138
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"antd_icons.d.ts","sourceRoot":"","sources":["antd_icons.ts"],"names":[],"mappings":"AAwxBA,eAAO,MAAM,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAsxB1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tabler_icons.d.ts","sourceRoot":"","sources":["tabler_icons.ts"],"names":[],"mappings":"AA4nFA,eAAO,MAAM,WAAW,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CA0nF7C,CAAC"}
|