@apexcura/ui-components 0.0.14-Beta42 → 0.0.14-Beta44

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 CHANGED
@@ -72,6 +72,7 @@ var TextElement = (props) => {
72
72
  placeholder: props.placeholder,
73
73
  allowClear: true,
74
74
  id: props.name,
75
+ value: props.value,
75
76
  prefix: props.prefix,
76
77
  type: props.type,
77
78
  status: props.status,
@@ -131,8 +132,7 @@ var NumberElement = (props) => {
131
132
  {
132
133
  placeholder: props.placeholder,
133
134
  addonBefore: props.addonBefore,
134
- allowClear: true,
135
- defaultValue: props.defaultValue,
135
+ value: props.value,
136
136
  disabled: props.disabled,
137
137
  id: props.name,
138
138
  prefix: props.prefix,
@@ -379,6 +379,7 @@ var import_react11 = __toESM(require("react"));
379
379
  var ButtonElement = (props) => {
380
380
  const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
381
381
  const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
382
+ const [originalFillColors, setOriginalFillColors] = (0, import_react11.useState)([]);
382
383
  (0, import_react11.useEffect)(() => {
383
384
  if (props.icon) {
384
385
  fetch(props.icon).then((response) => response.text()).then((data) => {
@@ -395,7 +396,11 @@ var ButtonElement = (props) => {
395
396
  const computedColor = getComputedStyle(tempSpan).color;
396
397
  document.body.removeChild(tempSpan);
397
398
  const paths = svgElement.querySelectorAll("path");
398
- paths.forEach((path) => path.setAttribute("fill", computedColor));
399
+ paths.forEach((path) => {
400
+ const originalFill = path.getAttribute("fill");
401
+ path.setAttribute("fill", computedColor);
402
+ setOriginalFillColors((prev) => [...prev, originalFill || ""]);
403
+ });
399
404
  }
400
405
  if (hoverColorClass) {
401
406
  const tempSpan = document.createElement("span");
@@ -422,7 +427,9 @@ var ButtonElement = (props) => {
422
427
  tempDiv.innerHTML = prevSvgContent;
423
428
  const svgElement = tempDiv.querySelector("svg");
424
429
  const paths = svgElement?.querySelectorAll("path");
425
- paths?.forEach((path) => path.setAttribute("fill", hoverColor));
430
+ paths?.forEach((path, index) => {
431
+ path.setAttribute("fill", hoverColor);
432
+ });
426
433
  return tempDiv.innerHTML;
427
434
  });
428
435
  }
@@ -435,7 +442,10 @@ var ButtonElement = (props) => {
435
442
  tempDiv.innerHTML = prevSvgContent;
436
443
  const svgElement = tempDiv.querySelector("svg");
437
444
  const paths = svgElement?.querySelectorAll("path");
438
- paths?.forEach((path) => path.removeAttribute("fill"));
445
+ paths?.forEach((path, index) => {
446
+ const originalFill = originalFillColors[index];
447
+ path.setAttribute("fill", originalFill);
448
+ });
439
449
  return tempDiv.innerHTML;
440
450
  });
441
451
  }
package/dist/index.mjs CHANGED
@@ -13,6 +13,7 @@ var TextElement = (props) => {
13
13
  placeholder: props.placeholder,
14
14
  allowClear: true,
15
15
  id: props.name,
16
+ value: props.value,
16
17
  prefix: props.prefix,
17
18
  type: props.type,
18
19
  status: props.status,
@@ -72,8 +73,7 @@ var NumberElement = (props) => {
72
73
  {
73
74
  placeholder: props.placeholder,
74
75
  addonBefore: props.addonBefore,
75
- allowClear: true,
76
- defaultValue: props.defaultValue,
76
+ value: props.value,
77
77
  disabled: props.disabled,
78
78
  id: props.name,
79
79
  prefix: props.prefix,
@@ -320,6 +320,7 @@ import React11, { useEffect, useState as useState4 } from "react";
320
320
  var ButtonElement = (props) => {
321
321
  const [svgContent, setSvgContent] = useState4(null);
322
322
  const [hoverColor, setHoverColor] = useState4(null);
323
+ const [originalFillColors, setOriginalFillColors] = useState4([]);
323
324
  useEffect(() => {
324
325
  if (props.icon) {
325
326
  fetch(props.icon).then((response) => response.text()).then((data) => {
@@ -336,7 +337,11 @@ var ButtonElement = (props) => {
336
337
  const computedColor = getComputedStyle(tempSpan).color;
337
338
  document.body.removeChild(tempSpan);
338
339
  const paths = svgElement.querySelectorAll("path");
339
- paths.forEach((path) => path.setAttribute("fill", computedColor));
340
+ paths.forEach((path) => {
341
+ const originalFill = path.getAttribute("fill");
342
+ path.setAttribute("fill", computedColor);
343
+ setOriginalFillColors((prev) => [...prev, originalFill || ""]);
344
+ });
340
345
  }
341
346
  if (hoverColorClass) {
342
347
  const tempSpan = document.createElement("span");
@@ -363,7 +368,9 @@ var ButtonElement = (props) => {
363
368
  tempDiv.innerHTML = prevSvgContent;
364
369
  const svgElement = tempDiv.querySelector("svg");
365
370
  const paths = svgElement?.querySelectorAll("path");
366
- paths?.forEach((path) => path.setAttribute("fill", hoverColor));
371
+ paths?.forEach((path, index) => {
372
+ path.setAttribute("fill", hoverColor);
373
+ });
367
374
  return tempDiv.innerHTML;
368
375
  });
369
376
  }
@@ -376,7 +383,10 @@ var ButtonElement = (props) => {
376
383
  tempDiv.innerHTML = prevSvgContent;
377
384
  const svgElement = tempDiv.querySelector("svg");
378
385
  const paths = svgElement?.querySelectorAll("path");
379
- paths?.forEach((path) => path.removeAttribute("fill"));
386
+ paths?.forEach((path, index) => {
387
+ const originalFill = originalFillColors[index];
388
+ path.setAttribute("fill", originalFill);
389
+ });
380
390
  return tempDiv.innerHTML;
381
391
  });
382
392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta42",
3
+ "version": "0.0.14-Beta44",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",