@fctc/sme-widget-ui 1.5.2 → 1.5.4

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
@@ -18175,6 +18175,10 @@ var BinaryField = (props) => {
18175
18175
  "label",
18176
18176
  {
18177
18177
  htmlFor: inputId,
18178
+ style: {
18179
+ width: "128px",
18180
+ height: "128px"
18181
+ },
18178
18182
  className: `relative p-2 flex h-32 w-32 cursor-pointer items-center justify-center rounded-lg border border-gray-300 hover:border-gray-500 bg-white transition-colors duration-300 ${readonly && "pointer-events-none"}`,
18179
18183
  children: [
18180
18184
  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
@@ -32993,13 +32997,16 @@ var FloatField = (props) => {
32993
32997
  value !== void 0 && value !== null ? formatFloatNumber(value) : ""
32994
32998
  );
32995
32999
  (0, import_react55.useEffect)(() => {
32996
- if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
33000
+ if (propValue !== void 0 && propValue !== null && propValue !== parseFloat(inputValue?.replace(/,/g, ""))) {
33001
+ setInputValue(formatFloatNumber(propValue));
33002
+ clearErrors(name2);
33003
+ } else if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32997
33004
  setInputValue(formatFloatNumber(value));
32998
33005
  clearErrors(name2);
32999
33006
  } else if (value === null || value === void 0) {
33000
33007
  setInputValue("");
33001
33008
  }
33002
- }, [value, name2, clearErrors]);
33009
+ }, [value, name2, clearErrors, propValue]);
33003
33010
  const isDirtyRef = (0, import_react55.useRef)(false);
33004
33011
  const inputRef = (0, import_react55.useRef)(null);
33005
33012
  const lastCommittedValueRef = (0, import_react55.useRef)(null);
package/dist/index.mjs CHANGED
@@ -18056,6 +18056,10 @@ var BinaryField = (props) => {
18056
18056
  "label",
18057
18057
  {
18058
18058
  htmlFor: inputId,
18059
+ style: {
18060
+ width: "128px",
18061
+ height: "128px"
18062
+ },
18059
18063
  className: `relative p-2 flex h-32 w-32 cursor-pointer items-center justify-center rounded-lg border border-gray-300 hover:border-gray-500 bg-white transition-colors duration-300 ${readonly && "pointer-events-none"}`,
18060
18064
  children: [
18061
18065
  /* @__PURE__ */ jsx69(
@@ -32874,13 +32878,16 @@ var FloatField = (props) => {
32874
32878
  value !== void 0 && value !== null ? formatFloatNumber(value) : ""
32875
32879
  );
32876
32880
  useEffect17(() => {
32877
- if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32881
+ if (propValue !== void 0 && propValue !== null && propValue !== parseFloat(inputValue?.replace(/,/g, ""))) {
32882
+ setInputValue(formatFloatNumber(propValue));
32883
+ clearErrors(name2);
32884
+ } else if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32878
32885
  setInputValue(formatFloatNumber(value));
32879
32886
  clearErrors(name2);
32880
32887
  } else if (value === null || value === void 0) {
32881
32888
  setInputValue("");
32882
32889
  }
32883
- }, [value, name2, clearErrors]);
32890
+ }, [value, name2, clearErrors, propValue]);
32884
32891
  const isDirtyRef = useRef15(false);
32885
32892
  const inputRef = useRef15(null);
32886
32893
  const lastCommittedValueRef = useRef15(null);
package/dist/widgets.js CHANGED
@@ -17801,6 +17801,10 @@ var BinaryField = (props) => {
17801
17801
  "label",
17802
17802
  {
17803
17803
  htmlFor: inputId,
17804
+ style: {
17805
+ width: "128px",
17806
+ height: "128px"
17807
+ },
17804
17808
  className: `relative p-2 flex h-32 w-32 cursor-pointer items-center justify-center rounded-lg border border-gray-300 hover:border-gray-500 bg-white transition-colors duration-300 ${readonly && "pointer-events-none"}`,
17805
17809
  children: [
17806
17810
  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
@@ -32619,13 +32623,16 @@ var FloatField = (props) => {
32619
32623
  value !== void 0 && value !== null ? formatFloatNumber(value) : ""
32620
32624
  );
32621
32625
  (0, import_react55.useEffect)(() => {
32622
- if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32626
+ if (propValue !== void 0 && propValue !== null && propValue !== parseFloat(inputValue?.replace(/,/g, ""))) {
32627
+ setInputValue(formatFloatNumber(propValue));
32628
+ clearErrors(name2);
32629
+ } else if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32623
32630
  setInputValue(formatFloatNumber(value));
32624
32631
  clearErrors(name2);
32625
32632
  } else if (value === null || value === void 0) {
32626
32633
  setInputValue("");
32627
32634
  }
32628
- }, [value, name2, clearErrors]);
32635
+ }, [value, name2, clearErrors, propValue]);
32629
32636
  const isDirtyRef = (0, import_react55.useRef)(false);
32630
32637
  const inputRef = (0, import_react55.useRef)(null);
32631
32638
  const lastCommittedValueRef = (0, import_react55.useRef)(null);
package/dist/widgets.mjs CHANGED
@@ -17738,6 +17738,10 @@ var BinaryField = (props) => {
17738
17738
  "label",
17739
17739
  {
17740
17740
  htmlFor: inputId,
17741
+ style: {
17742
+ width: "128px",
17743
+ height: "128px"
17744
+ },
17741
17745
  className: `relative p-2 flex h-32 w-32 cursor-pointer items-center justify-center rounded-lg border border-gray-300 hover:border-gray-500 bg-white transition-colors duration-300 ${readonly && "pointer-events-none"}`,
17742
17746
  children: [
17743
17747
  /* @__PURE__ */ jsx69(
@@ -32556,13 +32560,16 @@ var FloatField = (props) => {
32556
32560
  value !== void 0 && value !== null ? formatFloatNumber(value) : ""
32557
32561
  );
32558
32562
  useEffect17(() => {
32559
- if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32563
+ if (propValue !== void 0 && propValue !== null && propValue !== parseFloat(inputValue?.replace(/,/g, ""))) {
32564
+ setInputValue(formatFloatNumber(propValue));
32565
+ clearErrors(name2);
32566
+ } else if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
32560
32567
  setInputValue(formatFloatNumber(value));
32561
32568
  clearErrors(name2);
32562
32569
  } else if (value === null || value === void 0) {
32563
32570
  setInputValue("");
32564
32571
  }
32565
- }, [value, name2, clearErrors]);
32572
+ }, [value, name2, clearErrors, propValue]);
32566
32573
  const isDirtyRef = useRef15(false);
32567
32574
  const inputRef = useRef15(null);
32568
32575
  const lastCommittedValueRef = useRef15(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",