@apexcura/ui-components 0.0.15-Beta97 → 0.0.15-Beta99

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
@@ -1730,17 +1730,19 @@ var DivContainer = (props) => {
1730
1730
  var import_react39 = __toESM(require("react"));
1731
1731
  var import_antd22 = require("antd");
1732
1732
  var ColorPickerElement = (props) => {
1733
- const [color, setColor] = (0, import_react39.useState)(props.value);
1733
+ const [val, setVal] = (0, import_react39.useState)(props.value);
1734
+ (0, import_react39.useEffect)(() => {
1735
+ setVal(props.value);
1736
+ }, [props.value]);
1734
1737
  const onHandleChange = (value, hex) => {
1735
- setColor(hex);
1736
- props.onChange && props.onChange(color && color);
1738
+ props.onChange && props.onChange(hex);
1737
1739
  };
1738
1740
  return /* @__PURE__ */ import_react39.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react39.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react39.default.createElement("br", null), /* @__PURE__ */ import_react39.default.createElement(
1739
1741
  import_antd22.ColorPicker,
1740
1742
  {
1741
1743
  className: props.className,
1742
1744
  showText: true,
1743
- value: color,
1745
+ value: val,
1744
1746
  onChange: onHandleChange
1745
1747
  }
1746
1748
  ));
package/dist/index.mjs CHANGED
@@ -1681,20 +1681,22 @@ var DivContainer = (props) => {
1681
1681
  };
1682
1682
 
1683
1683
  // src/Components/ColorPickerElement.tsx
1684
- import React38, { useState as useState11 } from "react";
1684
+ import React38, { useEffect as useEffect6, useState as useState11 } from "react";
1685
1685
  import { ColorPicker } from "antd";
1686
1686
  var ColorPickerElement = (props) => {
1687
- const [color, setColor] = useState11(props.value);
1687
+ const [val, setVal] = useState11(props.value);
1688
+ useEffect6(() => {
1689
+ setVal(props.value);
1690
+ }, [props.value]);
1688
1691
  const onHandleChange = (value, hex) => {
1689
- setColor(hex);
1690
- props.onChange && props.onChange(color && color);
1692
+ props.onChange && props.onChange(hex);
1691
1693
  };
1692
1694
  return /* @__PURE__ */ React38.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React38.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React38.createElement("br", null), /* @__PURE__ */ React38.createElement(
1693
1695
  ColorPicker,
1694
1696
  {
1695
1697
  className: props.className,
1696
1698
  showText: true,
1697
- value: color,
1699
+ value: val,
1698
1700
  onChange: onHandleChange
1699
1701
  }
1700
1702
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.15-Beta97",
3
+ "version": "0.0.15-Beta99",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",