@fctc/sme-widget-ui 2.3.1 → 2.3.2
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 +32 -46
- package/dist/index.mjs +32 -46
- package/dist/widgets.js +32 -46
- package/dist/widgets.mjs +32 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31996,6 +31996,8 @@ var FloatField = (props) => {
|
|
|
31996
31996
|
const [inputValue, setInputValue] = (0, import_react58.useState)(
|
|
31997
31997
|
value !== void 0 && value !== null ? formatFloatNumber(value) : ""
|
|
31998
31998
|
);
|
|
31999
|
+
const isDirtyRef = (0, import_react58.useRef)(false);
|
|
32000
|
+
const lastCommittedValueRef = (0, import_react58.useRef)(null);
|
|
31999
32001
|
(0, import_react58.useEffect)(() => {
|
|
32000
32002
|
if (isDirtyRef.current) return;
|
|
32001
32003
|
const numericInput = parseFloat(inputValue?.replace(/,/g, ""));
|
|
@@ -32009,42 +32011,33 @@ var FloatField = (props) => {
|
|
|
32009
32011
|
setInputValue("");
|
|
32010
32012
|
}
|
|
32011
32013
|
}, [value, name2, clearErrors, propValue]);
|
|
32012
|
-
const isDirtyRef = (0, import_react58.useRef)(false);
|
|
32013
|
-
const inputRef = (0, import_react58.useRef)(null);
|
|
32014
|
-
const lastCommittedValueRef = (0, import_react58.useRef)(null);
|
|
32015
32014
|
const handleInputChange = (e3) => {
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
if (
|
|
32019
|
-
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32032
|
-
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
|
|
32038
|
-
isDirtyRef.current = true;
|
|
32039
|
-
}
|
|
32040
|
-
} else {
|
|
32041
|
-
onChange2(null);
|
|
32042
|
-
clearErrors(name2);
|
|
32043
|
-
}
|
|
32015
|
+
let newValue = e3.target.value;
|
|
32016
|
+
if (!/^[0-9.,]*$/.test(newValue)) return;
|
|
32017
|
+
if (newValue === ".") {
|
|
32018
|
+
newValue = "0.";
|
|
32019
|
+
}
|
|
32020
|
+
if (inputValue.startsWith("0") && !inputValue?.includes(".")) {
|
|
32021
|
+
newValue = newValue.replace(/^0+/, "");
|
|
32022
|
+
console.log("newValue", newValue);
|
|
32023
|
+
}
|
|
32024
|
+
if (inputValue === "0" && newValue === "0.") {
|
|
32025
|
+
newValue = "0.";
|
|
32026
|
+
}
|
|
32027
|
+
setInputValue(newValue);
|
|
32028
|
+
const parsedValue = parseFloat(
|
|
32029
|
+
newValue.replace(/,/g, "").replace(",", ".")
|
|
32030
|
+
);
|
|
32031
|
+
if (!isNaN(parsedValue)) {
|
|
32032
|
+
onChange2(parsedValue);
|
|
32033
|
+
clearErrors(name2);
|
|
32034
|
+
isDirtyRef.current = true;
|
|
32035
|
+
} else {
|
|
32036
|
+
onChange2(null);
|
|
32044
32037
|
}
|
|
32045
32038
|
};
|
|
32046
32039
|
const handleInputMouseLeave = () => {
|
|
32047
|
-
if (isDirtyRef
|
|
32040
|
+
if (!isDirtyRef.current) return;
|
|
32048
32041
|
const rawValue = inputValue.replace(/,/g, "");
|
|
32049
32042
|
const parsedValue = parseFloat(rawValue);
|
|
32050
32043
|
if (rawValue === "" || rawValue === ".") {
|
|
@@ -32066,18 +32059,12 @@ var FloatField = (props) => {
|
|
|
32066
32059
|
setInputValue("");
|
|
32067
32060
|
lastCommittedValueRef.current = null;
|
|
32068
32061
|
} else {
|
|
32069
|
-
|
|
32070
|
-
|
|
32071
|
-
|
|
32072
|
-
|
|
32073
|
-
|
|
32074
|
-
|
|
32075
|
-
onChange2(parsedValue);
|
|
32076
|
-
setInputValue(formattedValue);
|
|
32077
|
-
handleOnchange?.(name2 ?? "", parsedValue);
|
|
32078
|
-
clearErrors(name2);
|
|
32079
|
-
lastCommittedValueRef.current = parsedValue;
|
|
32080
|
-
}
|
|
32062
|
+
const formattedValue = formatFloatNumber(parsedValue);
|
|
32063
|
+
setInputValue(formattedValue);
|
|
32064
|
+
onChange2(parsedValue);
|
|
32065
|
+
handleOnchange?.(name2 ?? "", parsedValue);
|
|
32066
|
+
clearErrors(name2);
|
|
32067
|
+
lastCommittedValueRef.current = parsedValue;
|
|
32081
32068
|
}
|
|
32082
32069
|
} else {
|
|
32083
32070
|
setError(name2, {
|
|
@@ -32093,7 +32080,6 @@ var FloatField = (props) => {
|
|
|
32093
32080
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
32094
32081
|
"input",
|
|
32095
32082
|
{
|
|
32096
|
-
ref: inputRef,
|
|
32097
32083
|
value: inputValue,
|
|
32098
32084
|
onChange: !readonly ? handleInputChange : void 0,
|
|
32099
32085
|
onMouseLeave: !readonly ? handleInputMouseLeave : void 0,
|
|
@@ -32106,7 +32092,7 @@ var FloatField = (props) => {
|
|
|
32106
32092
|
className: `w-full h-full ring-0 focus:ring-0 focus:!outline-none outline-0 px-3 py-[12px] text-sm font-normal gap-2 opacity-100 leading-[1.5] resize-none overflow-hidden
|
|
32107
32093
|
${readonly ? "cursor-not-allowed border border-[rgba(66,66,66,0.12)] text-[#5c5a5a]" : "cursor-pointer border border-[rgba(66,66,66,0.12)] text-[#525866]"}
|
|
32108
32094
|
${!isEditTable ? isForm ? "bg-white border-input-primary rounded-[10px]" : "" : `border-transparent bg-transparent ${readonly ? "" : "border-b-primary"}`}
|
|
32109
|
-
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747]
|
|
32095
|
+
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747] hover:border-b-[1px] hover:border-[#de4747]"}
|
|
32110
32096
|
`
|
|
32111
32097
|
}
|
|
32112
32098
|
),
|
package/dist/index.mjs
CHANGED
|
@@ -31870,6 +31870,8 @@ var FloatField = (props) => {
|
|
|
31870
31870
|
const [inputValue, setInputValue] = useState18(
|
|
31871
31871
|
value !== void 0 && value !== null ? formatFloatNumber(value) : ""
|
|
31872
31872
|
);
|
|
31873
|
+
const isDirtyRef = useRef15(false);
|
|
31874
|
+
const lastCommittedValueRef = useRef15(null);
|
|
31873
31875
|
useEffect19(() => {
|
|
31874
31876
|
if (isDirtyRef.current) return;
|
|
31875
31877
|
const numericInput = parseFloat(inputValue?.replace(/,/g, ""));
|
|
@@ -31883,42 +31885,33 @@ var FloatField = (props) => {
|
|
|
31883
31885
|
setInputValue("");
|
|
31884
31886
|
}
|
|
31885
31887
|
}, [value, name2, clearErrors, propValue]);
|
|
31886
|
-
const isDirtyRef = useRef15(false);
|
|
31887
|
-
const inputRef = useRef15(null);
|
|
31888
|
-
const lastCommittedValueRef = useRef15(null);
|
|
31889
31888
|
const handleInputChange = (e3) => {
|
|
31890
|
-
|
|
31891
|
-
|
|
31892
|
-
if (
|
|
31893
|
-
|
|
31894
|
-
|
|
31895
|
-
|
|
31896
|
-
|
|
31897
|
-
|
|
31898
|
-
|
|
31899
|
-
|
|
31900
|
-
|
|
31901
|
-
|
|
31902
|
-
|
|
31903
|
-
|
|
31904
|
-
|
|
31905
|
-
|
|
31906
|
-
|
|
31907
|
-
|
|
31908
|
-
|
|
31909
|
-
|
|
31910
|
-
|
|
31911
|
-
|
|
31912
|
-
isDirtyRef.current = true;
|
|
31913
|
-
}
|
|
31914
|
-
} else {
|
|
31915
|
-
onChange2(null);
|
|
31916
|
-
clearErrors(name2);
|
|
31917
|
-
}
|
|
31889
|
+
let newValue = e3.target.value;
|
|
31890
|
+
if (!/^[0-9.,]*$/.test(newValue)) return;
|
|
31891
|
+
if (newValue === ".") {
|
|
31892
|
+
newValue = "0.";
|
|
31893
|
+
}
|
|
31894
|
+
if (inputValue.startsWith("0") && !inputValue?.includes(".")) {
|
|
31895
|
+
newValue = newValue.replace(/^0+/, "");
|
|
31896
|
+
console.log("newValue", newValue);
|
|
31897
|
+
}
|
|
31898
|
+
if (inputValue === "0" && newValue === "0.") {
|
|
31899
|
+
newValue = "0.";
|
|
31900
|
+
}
|
|
31901
|
+
setInputValue(newValue);
|
|
31902
|
+
const parsedValue = parseFloat(
|
|
31903
|
+
newValue.replace(/,/g, "").replace(",", ".")
|
|
31904
|
+
);
|
|
31905
|
+
if (!isNaN(parsedValue)) {
|
|
31906
|
+
onChange2(parsedValue);
|
|
31907
|
+
clearErrors(name2);
|
|
31908
|
+
isDirtyRef.current = true;
|
|
31909
|
+
} else {
|
|
31910
|
+
onChange2(null);
|
|
31918
31911
|
}
|
|
31919
31912
|
};
|
|
31920
31913
|
const handleInputMouseLeave = () => {
|
|
31921
|
-
if (isDirtyRef
|
|
31914
|
+
if (!isDirtyRef.current) return;
|
|
31922
31915
|
const rawValue = inputValue.replace(/,/g, "");
|
|
31923
31916
|
const parsedValue = parseFloat(rawValue);
|
|
31924
31917
|
if (rawValue === "" || rawValue === ".") {
|
|
@@ -31940,18 +31933,12 @@ var FloatField = (props) => {
|
|
|
31940
31933
|
setInputValue("");
|
|
31941
31934
|
lastCommittedValueRef.current = null;
|
|
31942
31935
|
} else {
|
|
31943
|
-
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
onChange2(parsedValue);
|
|
31950
|
-
setInputValue(formattedValue);
|
|
31951
|
-
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31952
|
-
clearErrors(name2);
|
|
31953
|
-
lastCommittedValueRef.current = parsedValue;
|
|
31954
|
-
}
|
|
31936
|
+
const formattedValue = formatFloatNumber(parsedValue);
|
|
31937
|
+
setInputValue(formattedValue);
|
|
31938
|
+
onChange2(parsedValue);
|
|
31939
|
+
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31940
|
+
clearErrors(name2);
|
|
31941
|
+
lastCommittedValueRef.current = parsedValue;
|
|
31955
31942
|
}
|
|
31956
31943
|
} else {
|
|
31957
31944
|
setError(name2, {
|
|
@@ -31967,7 +31954,6 @@ var FloatField = (props) => {
|
|
|
31967
31954
|
/* @__PURE__ */ jsx92(
|
|
31968
31955
|
"input",
|
|
31969
31956
|
{
|
|
31970
|
-
ref: inputRef,
|
|
31971
31957
|
value: inputValue,
|
|
31972
31958
|
onChange: !readonly ? handleInputChange : void 0,
|
|
31973
31959
|
onMouseLeave: !readonly ? handleInputMouseLeave : void 0,
|
|
@@ -31980,7 +31966,7 @@ var FloatField = (props) => {
|
|
|
31980
31966
|
className: `w-full h-full ring-0 focus:ring-0 focus:!outline-none outline-0 px-3 py-[12px] text-sm font-normal gap-2 opacity-100 leading-[1.5] resize-none overflow-hidden
|
|
31981
31967
|
${readonly ? "cursor-not-allowed border border-[rgba(66,66,66,0.12)] text-[#5c5a5a]" : "cursor-pointer border border-[rgba(66,66,66,0.12)] text-[#525866]"}
|
|
31982
31968
|
${!isEditTable ? isForm ? "bg-white border-input-primary rounded-[10px]" : "" : `border-transparent bg-transparent ${readonly ? "" : "border-b-primary"}`}
|
|
31983
|
-
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747]
|
|
31969
|
+
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747] hover:border-b-[1px] hover:border-[#de4747]"}
|
|
31984
31970
|
`
|
|
31985
31971
|
}
|
|
31986
31972
|
),
|
package/dist/widgets.js
CHANGED
|
@@ -31245,6 +31245,8 @@ var FloatField = (props) => {
|
|
|
31245
31245
|
const [inputValue, setInputValue] = (0, import_react58.useState)(
|
|
31246
31246
|
value !== void 0 && value !== null ? formatFloatNumber(value) : ""
|
|
31247
31247
|
);
|
|
31248
|
+
const isDirtyRef = (0, import_react58.useRef)(false);
|
|
31249
|
+
const lastCommittedValueRef = (0, import_react58.useRef)(null);
|
|
31248
31250
|
(0, import_react58.useEffect)(() => {
|
|
31249
31251
|
if (isDirtyRef.current) return;
|
|
31250
31252
|
const numericInput = parseFloat(inputValue?.replace(/,/g, ""));
|
|
@@ -31258,42 +31260,33 @@ var FloatField = (props) => {
|
|
|
31258
31260
|
setInputValue("");
|
|
31259
31261
|
}
|
|
31260
31262
|
}, [value, name2, clearErrors, propValue]);
|
|
31261
|
-
const isDirtyRef = (0, import_react58.useRef)(false);
|
|
31262
|
-
const inputRef = (0, import_react58.useRef)(null);
|
|
31263
|
-
const lastCommittedValueRef = (0, import_react58.useRef)(null);
|
|
31264
31263
|
const handleInputChange = (e3) => {
|
|
31265
|
-
|
|
31266
|
-
|
|
31267
|
-
if (
|
|
31268
|
-
|
|
31269
|
-
|
|
31270
|
-
|
|
31271
|
-
|
|
31272
|
-
|
|
31273
|
-
|
|
31274
|
-
|
|
31275
|
-
|
|
31276
|
-
|
|
31277
|
-
|
|
31278
|
-
|
|
31279
|
-
|
|
31280
|
-
|
|
31281
|
-
|
|
31282
|
-
|
|
31283
|
-
|
|
31284
|
-
|
|
31285
|
-
|
|
31286
|
-
|
|
31287
|
-
isDirtyRef.current = true;
|
|
31288
|
-
}
|
|
31289
|
-
} else {
|
|
31290
|
-
onChange2(null);
|
|
31291
|
-
clearErrors(name2);
|
|
31292
|
-
}
|
|
31264
|
+
let newValue = e3.target.value;
|
|
31265
|
+
if (!/^[0-9.,]*$/.test(newValue)) return;
|
|
31266
|
+
if (newValue === ".") {
|
|
31267
|
+
newValue = "0.";
|
|
31268
|
+
}
|
|
31269
|
+
if (inputValue.startsWith("0") && !inputValue?.includes(".")) {
|
|
31270
|
+
newValue = newValue.replace(/^0+/, "");
|
|
31271
|
+
console.log("newValue", newValue);
|
|
31272
|
+
}
|
|
31273
|
+
if (inputValue === "0" && newValue === "0.") {
|
|
31274
|
+
newValue = "0.";
|
|
31275
|
+
}
|
|
31276
|
+
setInputValue(newValue);
|
|
31277
|
+
const parsedValue = parseFloat(
|
|
31278
|
+
newValue.replace(/,/g, "").replace(",", ".")
|
|
31279
|
+
);
|
|
31280
|
+
if (!isNaN(parsedValue)) {
|
|
31281
|
+
onChange2(parsedValue);
|
|
31282
|
+
clearErrors(name2);
|
|
31283
|
+
isDirtyRef.current = true;
|
|
31284
|
+
} else {
|
|
31285
|
+
onChange2(null);
|
|
31293
31286
|
}
|
|
31294
31287
|
};
|
|
31295
31288
|
const handleInputMouseLeave = () => {
|
|
31296
|
-
if (isDirtyRef
|
|
31289
|
+
if (!isDirtyRef.current) return;
|
|
31297
31290
|
const rawValue = inputValue.replace(/,/g, "");
|
|
31298
31291
|
const parsedValue = parseFloat(rawValue);
|
|
31299
31292
|
if (rawValue === "" || rawValue === ".") {
|
|
@@ -31315,18 +31308,12 @@ var FloatField = (props) => {
|
|
|
31315
31308
|
setInputValue("");
|
|
31316
31309
|
lastCommittedValueRef.current = null;
|
|
31317
31310
|
} else {
|
|
31318
|
-
|
|
31319
|
-
|
|
31320
|
-
|
|
31321
|
-
|
|
31322
|
-
|
|
31323
|
-
|
|
31324
|
-
onChange2(parsedValue);
|
|
31325
|
-
setInputValue(formattedValue);
|
|
31326
|
-
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31327
|
-
clearErrors(name2);
|
|
31328
|
-
lastCommittedValueRef.current = parsedValue;
|
|
31329
|
-
}
|
|
31311
|
+
const formattedValue = formatFloatNumber(parsedValue);
|
|
31312
|
+
setInputValue(formattedValue);
|
|
31313
|
+
onChange2(parsedValue);
|
|
31314
|
+
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31315
|
+
clearErrors(name2);
|
|
31316
|
+
lastCommittedValueRef.current = parsedValue;
|
|
31330
31317
|
}
|
|
31331
31318
|
} else {
|
|
31332
31319
|
setError(name2, {
|
|
@@ -31342,7 +31329,6 @@ var FloatField = (props) => {
|
|
|
31342
31329
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
31343
31330
|
"input",
|
|
31344
31331
|
{
|
|
31345
|
-
ref: inputRef,
|
|
31346
31332
|
value: inputValue,
|
|
31347
31333
|
onChange: !readonly ? handleInputChange : void 0,
|
|
31348
31334
|
onMouseLeave: !readonly ? handleInputMouseLeave : void 0,
|
|
@@ -31355,7 +31341,7 @@ var FloatField = (props) => {
|
|
|
31355
31341
|
className: `w-full h-full ring-0 focus:ring-0 focus:!outline-none outline-0 px-3 py-[12px] text-sm font-normal gap-2 opacity-100 leading-[1.5] resize-none overflow-hidden
|
|
31356
31342
|
${readonly ? "cursor-not-allowed border border-[rgba(66,66,66,0.12)] text-[#5c5a5a]" : "cursor-pointer border border-[rgba(66,66,66,0.12)] text-[#525866]"}
|
|
31357
31343
|
${!isEditTable ? isForm ? "bg-white border-input-primary rounded-[10px]" : "" : `border-transparent bg-transparent ${readonly ? "" : "border-b-primary"}`}
|
|
31358
|
-
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747]
|
|
31344
|
+
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747] hover:border-b-[1px] hover:border-[#de4747]"}
|
|
31359
31345
|
`
|
|
31360
31346
|
}
|
|
31361
31347
|
),
|
package/dist/widgets.mjs
CHANGED
|
@@ -31183,6 +31183,8 @@ var FloatField = (props) => {
|
|
|
31183
31183
|
const [inputValue, setInputValue] = useState18(
|
|
31184
31184
|
value !== void 0 && value !== null ? formatFloatNumber(value) : ""
|
|
31185
31185
|
);
|
|
31186
|
+
const isDirtyRef = useRef15(false);
|
|
31187
|
+
const lastCommittedValueRef = useRef15(null);
|
|
31186
31188
|
useEffect19(() => {
|
|
31187
31189
|
if (isDirtyRef.current) return;
|
|
31188
31190
|
const numericInput = parseFloat(inputValue?.replace(/,/g, ""));
|
|
@@ -31196,42 +31198,33 @@ var FloatField = (props) => {
|
|
|
31196
31198
|
setInputValue("");
|
|
31197
31199
|
}
|
|
31198
31200
|
}, [value, name2, clearErrors, propValue]);
|
|
31199
|
-
const isDirtyRef = useRef15(false);
|
|
31200
|
-
const inputRef = useRef15(null);
|
|
31201
|
-
const lastCommittedValueRef = useRef15(null);
|
|
31202
31201
|
const handleInputChange = (e3) => {
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
if (
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
|
|
31212
|
-
|
|
31213
|
-
|
|
31214
|
-
|
|
31215
|
-
|
|
31216
|
-
|
|
31217
|
-
|
|
31218
|
-
|
|
31219
|
-
|
|
31220
|
-
|
|
31221
|
-
|
|
31222
|
-
|
|
31223
|
-
|
|
31224
|
-
|
|
31225
|
-
isDirtyRef.current = true;
|
|
31226
|
-
}
|
|
31227
|
-
} else {
|
|
31228
|
-
onChange2(null);
|
|
31229
|
-
clearErrors(name2);
|
|
31230
|
-
}
|
|
31202
|
+
let newValue = e3.target.value;
|
|
31203
|
+
if (!/^[0-9.,]*$/.test(newValue)) return;
|
|
31204
|
+
if (newValue === ".") {
|
|
31205
|
+
newValue = "0.";
|
|
31206
|
+
}
|
|
31207
|
+
if (inputValue.startsWith("0") && !inputValue?.includes(".")) {
|
|
31208
|
+
newValue = newValue.replace(/^0+/, "");
|
|
31209
|
+
console.log("newValue", newValue);
|
|
31210
|
+
}
|
|
31211
|
+
if (inputValue === "0" && newValue === "0.") {
|
|
31212
|
+
newValue = "0.";
|
|
31213
|
+
}
|
|
31214
|
+
setInputValue(newValue);
|
|
31215
|
+
const parsedValue = parseFloat(
|
|
31216
|
+
newValue.replace(/,/g, "").replace(",", ".")
|
|
31217
|
+
);
|
|
31218
|
+
if (!isNaN(parsedValue)) {
|
|
31219
|
+
onChange2(parsedValue);
|
|
31220
|
+
clearErrors(name2);
|
|
31221
|
+
isDirtyRef.current = true;
|
|
31222
|
+
} else {
|
|
31223
|
+
onChange2(null);
|
|
31231
31224
|
}
|
|
31232
31225
|
};
|
|
31233
31226
|
const handleInputMouseLeave = () => {
|
|
31234
|
-
if (isDirtyRef
|
|
31227
|
+
if (!isDirtyRef.current) return;
|
|
31235
31228
|
const rawValue = inputValue.replace(/,/g, "");
|
|
31236
31229
|
const parsedValue = parseFloat(rawValue);
|
|
31237
31230
|
if (rawValue === "" || rawValue === ".") {
|
|
@@ -31253,18 +31246,12 @@ var FloatField = (props) => {
|
|
|
31253
31246
|
setInputValue("");
|
|
31254
31247
|
lastCommittedValueRef.current = null;
|
|
31255
31248
|
} else {
|
|
31256
|
-
|
|
31257
|
-
|
|
31258
|
-
|
|
31259
|
-
|
|
31260
|
-
|
|
31261
|
-
|
|
31262
|
-
onChange2(parsedValue);
|
|
31263
|
-
setInputValue(formattedValue);
|
|
31264
|
-
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31265
|
-
clearErrors(name2);
|
|
31266
|
-
lastCommittedValueRef.current = parsedValue;
|
|
31267
|
-
}
|
|
31249
|
+
const formattedValue = formatFloatNumber(parsedValue);
|
|
31250
|
+
setInputValue(formattedValue);
|
|
31251
|
+
onChange2(parsedValue);
|
|
31252
|
+
handleOnchange?.(name2 ?? "", parsedValue);
|
|
31253
|
+
clearErrors(name2);
|
|
31254
|
+
lastCommittedValueRef.current = parsedValue;
|
|
31268
31255
|
}
|
|
31269
31256
|
} else {
|
|
31270
31257
|
setError(name2, {
|
|
@@ -31280,7 +31267,6 @@ var FloatField = (props) => {
|
|
|
31280
31267
|
/* @__PURE__ */ jsx92(
|
|
31281
31268
|
"input",
|
|
31282
31269
|
{
|
|
31283
|
-
ref: inputRef,
|
|
31284
31270
|
value: inputValue,
|
|
31285
31271
|
onChange: !readonly ? handleInputChange : void 0,
|
|
31286
31272
|
onMouseLeave: !readonly ? handleInputMouseLeave : void 0,
|
|
@@ -31293,7 +31279,7 @@ var FloatField = (props) => {
|
|
|
31293
31279
|
className: `w-full h-full ring-0 focus:ring-0 focus:!outline-none outline-0 px-3 py-[12px] text-sm font-normal gap-2 opacity-100 leading-[1.5] resize-none overflow-hidden
|
|
31294
31280
|
${readonly ? "cursor-not-allowed border border-[rgba(66,66,66,0.12)] text-[#5c5a5a]" : "cursor-pointer border border-[rgba(66,66,66,0.12)] text-[#525866]"}
|
|
31295
31281
|
${!isEditTable ? isForm ? "bg-white border-input-primary rounded-[10px]" : "" : `border-transparent bg-transparent ${readonly ? "" : "border-b-primary"}`}
|
|
31296
|
-
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747]
|
|
31282
|
+
${error2 && isEditTable && "focus:border-b-[1px] focus:border-[#de4747] hover:border-b-[1px] hover:border-[#de4747]"}
|
|
31297
31283
|
`
|
|
31298
31284
|
}
|
|
31299
31285
|
),
|