@gisce/react-ooui 1.1.28 → 1.1.30
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.map +1 -1
- package/dist/react-ooui.es.js +10 -15
- 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 +1 -1
- package/src/__tests__/iconMapper.test.ts +11 -0
- package/src/helpers/iconMapper.ts +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconMapper.d.ts","sourceRoot":"","sources":["iconMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;8BAqGzB,MAAM;AAA3B,
|
|
1
|
+
{"version":3,"file":"iconMapper.d.ts","sourceRoot":"","sources":["iconMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;8BAqGzB,MAAM;AAA3B,wBAWE"}
|
package/dist/react-ooui.es.js
CHANGED
|
@@ -529,13 +529,7 @@ const {
|
|
|
529
529
|
STOCK_CLEAR: "CloseSquare",
|
|
530
530
|
STOCK_UNINDENT: "AlignLeft",
|
|
531
531
|
STOCK_PREFERENCES: "Setting"
|
|
532
|
-
}, iconMapper = (e) => {
|
|
533
|
-
if (e.indexOf("gtk-") !== -1) {
|
|
534
|
-
const r = `STOCK_${e.replace("gtk-", "").replace(/\-/g, "_").toUpperCase()}`;
|
|
535
|
-
return getIconForKey(iconMapping[r]);
|
|
536
|
-
}
|
|
537
|
-
return iconMapping.hasOwnProperty(e) ? getIconForKey(iconMapping[e]) : getIconForKey(e);
|
|
538
|
-
};
|
|
532
|
+
}, iconMapper = (e) => (e.indexOf("gtk-") !== -1 && (e = `STOCK_${e.replace("gtk-", "").replace(/\-/g, "_").toUpperCase()}`), iconMapping.hasOwnProperty(e) ? getIconForKey(iconMapping[e]) : getIconForKey(e));
|
|
539
533
|
function toCamelCase(e) {
|
|
540
534
|
return `${e.split("-").map(
|
|
541
535
|
(t) => t.replace(
|
|
@@ -545,19 +539,20 @@ function toCamelCase(e) {
|
|
|
545
539
|
).join("")}`;
|
|
546
540
|
}
|
|
547
541
|
function getIconForKey(e) {
|
|
548
|
-
e.
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
542
|
+
let t = e.charAt(0).toUpperCase() + e.slice(1);
|
|
543
|
+
t.indexOf("-") !== -1 && (t = toCamelCase(t));
|
|
544
|
+
const r = `${t}Outlined`;
|
|
545
|
+
if (AntIcons[r])
|
|
546
|
+
return AntIcons[r];
|
|
547
|
+
const n = `Icon${t}`;
|
|
548
|
+
if (TablerIcons[n]) {
|
|
549
|
+
const a = () => React__default.createElement(TablerIcons[n], {
|
|
555
550
|
fill: "transparent",
|
|
556
551
|
height: 17,
|
|
557
552
|
width: 17
|
|
558
553
|
});
|
|
559
554
|
return () => React__default.createElement(AntIcons__default, {
|
|
560
|
-
component:
|
|
555
|
+
component: a
|
|
561
556
|
});
|
|
562
557
|
}
|
|
563
558
|
}
|