@gisce/react-ooui 1.2.0-rc.35 → 1.2.0-rc.36
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/actionbar/TreeActionBar.d.ts.map +1 -1
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +25 -26
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +2 -2
- package/dist/react-ooui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/iconMapper.test.ts +20 -5
- package/src/actionbar/TreeActionBar.tsx +16 -17
- package/src/helpers/iconMapper.ts +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeActionBar.d.ts","sourceRoot":"","sources":["TreeActionBar.tsx"],"names":[],"mappings":";AAiCA,aAAK,KAAK,GAAG;IACX,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"TreeActionBar.d.ts","sourceRoot":"","sources":["TreeActionBar.tsx"],"names":[],"mappings":";AAiCA,aAAK,KAAK,GAAG;IACX,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,KAAK,eAiUlC;AAMD,eAAe,aAAa,CAAC"}
|
|
@@ -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
|
@@ -542,20 +542,19 @@ const {
|
|
|
542
542
|
STOCK_CLEAR: "CloseSquare",
|
|
543
543
|
STOCK_UNINDENT: "AlignLeft",
|
|
544
544
|
STOCK_PREFERENCES: "Setting"
|
|
545
|
-
}, iconMapper = (e) => {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
return iconMapping.hasOwnProperty(e) ? getIconForKey(iconMapping[e]) : getIconForKey(e);
|
|
551
|
-
};
|
|
552
|
-
function getIconForKey(e) {
|
|
553
|
-
const r = `${e.split("-").map(
|
|
554
|
-
(s) => s.replace(
|
|
545
|
+
}, iconMapper = (e) => (e.indexOf("gtk-") !== -1 && (e = `STOCK_${e.replace("gtk-", "").replace(/\-/g, "_").toUpperCase()}`), iconMapping.hasOwnProperty(e) ? getIconForKey(iconMapping[e]) : getIconForKey(e));
|
|
546
|
+
function toCamelCase(e) {
|
|
547
|
+
return `${e.split("-").map(
|
|
548
|
+
(r) => r.replace(
|
|
555
549
|
/\w\S*/g,
|
|
556
|
-
(
|
|
550
|
+
(a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase()
|
|
557
551
|
)
|
|
558
|
-
).join("")}
|
|
552
|
+
).join("")}`;
|
|
553
|
+
}
|
|
554
|
+
function getIconForKey(e) {
|
|
555
|
+
let r = e.charAt(0).toUpperCase() + e.slice(1);
|
|
556
|
+
r.indexOf("-") !== -1 && (r = toCamelCase(r));
|
|
557
|
+
const a = `${r}Outlined`;
|
|
559
558
|
if (AntIcons[a])
|
|
560
559
|
return AntIcons[a];
|
|
561
560
|
const o = `Icon${r}`;
|
|
@@ -27185,9 +27184,22 @@ function TreeActionBar(e) {
|
|
|
27185
27184
|
onSearch: (oe) => {
|
|
27186
27185
|
oe && oe.trim().length > 0 ? S == null || S(oe) : S == null || S(void 0);
|
|
27187
27186
|
}
|
|
27187
|
+
}), !M && /* @__PURE__ */ jsx(ButtonWithBadge, {
|
|
27188
|
+
icon: /* @__PURE__ */ jsx(FilterOutlined, {
|
|
27189
|
+
style: {
|
|
27190
|
+
color: v ? "white" : void 0
|
|
27191
|
+
}
|
|
27192
|
+
}),
|
|
27193
|
+
tooltip: W("advanced_search"),
|
|
27194
|
+
type: v ? "primary" : "default",
|
|
27195
|
+
onClick: () => {
|
|
27196
|
+
C == null || C(!v);
|
|
27197
|
+
},
|
|
27198
|
+
disabled: c || u || x,
|
|
27199
|
+
badgeNumber: g == null ? void 0 : g.length
|
|
27188
27200
|
}), separator$1(), /* @__PURE__ */ jsx(NewButton, {
|
|
27189
27201
|
disabled: x
|
|
27190
|
-
}),
|
|
27202
|
+
}), /* @__PURE__ */ jsx(ActionButton, {
|
|
27191
27203
|
icon: /* @__PURE__ */ jsx(CopyOutlined$4, {}),
|
|
27192
27204
|
tooltip: W("duplicate"),
|
|
27193
27205
|
disabled: !s || (s == null ? void 0 : s.length) !== 1 || c || x,
|
|
@@ -27200,19 +27212,6 @@ function TreeActionBar(e) {
|
|
|
27200
27212
|
loading: u,
|
|
27201
27213
|
onClick: re
|
|
27202
27214
|
}), separator$1()]
|
|
27203
|
-
}), !M && /* @__PURE__ */ jsx(ButtonWithBadge, {
|
|
27204
|
-
icon: /* @__PURE__ */ jsx(FilterOutlined, {
|
|
27205
|
-
style: {
|
|
27206
|
-
color: v ? "white" : void 0
|
|
27207
|
-
}
|
|
27208
|
-
}),
|
|
27209
|
-
tooltip: W("advanced_search"),
|
|
27210
|
-
type: v ? "primary" : "default",
|
|
27211
|
-
onClick: () => {
|
|
27212
|
-
C == null || C(!v);
|
|
27213
|
-
},
|
|
27214
|
-
disabled: c || u || x,
|
|
27215
|
-
badgeNumber: g == null ? void 0 : g.length
|
|
27216
27215
|
}), /* @__PURE__ */ jsx(ActionButton, {
|
|
27217
27216
|
icon: /* @__PURE__ */ jsx(InfoCircleOutlined$4, {}),
|
|
27218
27217
|
tooltip: W("showLogs"),
|