@gisce/react-ooui 1.1.25 → 1.1.26
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 +1 -2
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +518 -510
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +13 -13
- package/dist/react-ooui.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/iconMapper.ts +13 -2
- package/src/stories/containers/Notebook.stories.tsx +27 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@gisce/ooui": "^0.17.12",
|
|
40
40
|
"@gisce/react-formiga-table": "^0.5.0",
|
|
41
41
|
"@monaco-editor/react": "^4.4.5",
|
|
42
|
-
"@tabler/icons": "^
|
|
42
|
+
"@tabler/icons-react": "^2.11.0",
|
|
43
43
|
"antd": "^4.12.3",
|
|
44
44
|
"buffer": "^6.0.3",
|
|
45
45
|
"fiber-diagram": "github:gisce/fiber-diagram",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as AntIcons from "@ant-design/icons";
|
|
3
|
-
import * as TablerIcons from "@tabler/icons";
|
|
3
|
+
import * as TablerIcons from "@tabler/icons-react";
|
|
4
|
+
import Icon from "@ant-design/icons";
|
|
4
5
|
|
|
5
6
|
type TablerKey = keyof typeof TablerIcons;
|
|
6
7
|
type AntKey = keyof typeof AntIcons;
|
|
@@ -131,7 +132,17 @@ function getIconForKey(key: string) {
|
|
|
131
132
|
|
|
132
133
|
const tablerKey: TablerKey = `Icon${IconCamelCase}` as any;
|
|
133
134
|
if (TablerIcons[tablerKey]) {
|
|
134
|
-
|
|
135
|
+
const TablerIcon = () =>
|
|
136
|
+
React.createElement(TablerIcons[tablerKey] as any, {
|
|
137
|
+
fill: "transparent",
|
|
138
|
+
height: 17,
|
|
139
|
+
width: 17,
|
|
140
|
+
});
|
|
141
|
+
const CustomIcon = () =>
|
|
142
|
+
React.createElement(Icon, {
|
|
143
|
+
component: TablerIcon,
|
|
144
|
+
});
|
|
145
|
+
return CustomIcon;
|
|
135
146
|
}
|
|
136
147
|
|
|
137
148
|
return undefined;
|
|
@@ -167,3 +167,30 @@ export const IconTabs = (): React.ReactElement => {
|
|
|
167
167
|
</LocaleProvider>
|
|
168
168
|
);
|
|
169
169
|
};
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
export const IconTablerTabs = (): React.ReactElement => {
|
|
173
|
+
|
|
174
|
+
const arch = `<form>
|
|
175
|
+
<notebook name="notebook">
|
|
176
|
+
<page string="Home" icon="bolt">
|
|
177
|
+
<field name="name" />
|
|
178
|
+
</page>
|
|
179
|
+
<page string="Attributes" icon="address-book">
|
|
180
|
+
<field name="surname" />
|
|
181
|
+
</page>
|
|
182
|
+
</notebook>
|
|
183
|
+
</form>`;
|
|
184
|
+
|
|
185
|
+
const formOoui = new FormOoui(fields);
|
|
186
|
+
formOoui.parse(arch);
|
|
187
|
+
const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<LocaleProvider lang="en_US">
|
|
191
|
+
<Form>
|
|
192
|
+
<Notebook ooui={notebookOoui} />
|
|
193
|
+
</Form>
|
|
194
|
+
</LocaleProvider>
|
|
195
|
+
);
|
|
196
|
+
};
|