@apexcura/ui-components 0.0.14-Beta35 → 0.0.14-Beta37
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/index.js +10 -8
- package/dist/index.mjs +10 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -380,22 +380,24 @@ var ButtonElement = (props) => {
|
|
|
380
380
|
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
381
381
|
(0, import_react11.useEffect)(() => {
|
|
382
382
|
if (props.icon) {
|
|
383
|
-
fetch(props.icon).then((response) => response.text()).then((data) =>
|
|
383
|
+
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
384
|
+
let modifiedData = data.replace(/<svg/g, `<svg class="${props.iconsClassName || ""}"`);
|
|
385
|
+
setSvgContent(modifiedData);
|
|
386
|
+
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
384
387
|
}
|
|
385
388
|
}, [props.icon]);
|
|
386
|
-
console.log(svgContent);
|
|
387
389
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
388
390
|
"button",
|
|
389
391
|
{
|
|
390
392
|
onClick: () => props.onClick && props.onClick(),
|
|
391
393
|
className: `${props.className ? props.className : ""}`
|
|
392
394
|
},
|
|
393
|
-
svgContent ? (
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
395
|
+
svgContent ? /* @__PURE__ */ import_react11.default.createElement(
|
|
396
|
+
"span",
|
|
397
|
+
{
|
|
398
|
+
className: props.iconsClassName,
|
|
399
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
400
|
+
}
|
|
399
401
|
) : props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon }),
|
|
400
402
|
props.label
|
|
401
403
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -321,22 +321,24 @@ var ButtonElement = (props) => {
|
|
|
321
321
|
const [svgContent, setSvgContent] = useState4(null);
|
|
322
322
|
useEffect(() => {
|
|
323
323
|
if (props.icon) {
|
|
324
|
-
fetch(props.icon).then((response) => response.text()).then((data) =>
|
|
324
|
+
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
325
|
+
let modifiedData = data.replace(/<svg/g, `<svg class="${props.iconsClassName || ""}"`);
|
|
326
|
+
setSvgContent(modifiedData);
|
|
327
|
+
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
325
328
|
}
|
|
326
329
|
}, [props.icon]);
|
|
327
|
-
console.log(svgContent);
|
|
328
330
|
return /* @__PURE__ */ React11.createElement(
|
|
329
331
|
"button",
|
|
330
332
|
{
|
|
331
333
|
onClick: () => props.onClick && props.onClick(),
|
|
332
334
|
className: `${props.className ? props.className : ""}`
|
|
333
335
|
},
|
|
334
|
-
svgContent ? (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
svgContent ? /* @__PURE__ */ React11.createElement(
|
|
337
|
+
"span",
|
|
338
|
+
{
|
|
339
|
+
className: props.iconsClassName,
|
|
340
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
341
|
+
}
|
|
340
342
|
) : props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon }),
|
|
341
343
|
props.label
|
|
342
344
|
);
|