@ctlyst.id/internal-ui 5.4.5 → 5.4.6
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 +8 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -860,19 +860,18 @@ var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
860
860
|
var CheckboxComponent = (0, import_react13.forwardRef)(
|
861
861
|
({ isError = false, animated = false, helpText, errorText, boxProps, children, isDisabled, throttleTime, ...rest }, ref) => {
|
862
862
|
const { state } = (0, import_react13.useCheckbox)(rest);
|
863
|
-
const [isChecked, setIsChecked] = (0, import_react14.useState)(!!rest.isChecked);
|
864
|
-
(0, import_react14.useEffect)(() => {
|
865
|
-
setIsChecked(!!rest.isChecked);
|
866
|
-
}, [rest.isChecked]);
|
867
863
|
const throttleFn = (0, import_react14.useCallback)(
|
868
|
-
throttle((
|
864
|
+
throttle((event) => {
|
865
|
+
var _a;
|
866
|
+
return (_a = rest.onChange) == null ? void 0 : _a.call(rest, event);
|
867
|
+
}, throttleTime),
|
869
868
|
[]
|
870
869
|
);
|
871
870
|
const handleOnChange = (0, import_react14.useCallback)(
|
872
871
|
(event) => {
|
873
|
-
|
874
|
-
|
875
|
-
|
872
|
+
var _a;
|
873
|
+
if (throttleTime) throttleFn(event);
|
874
|
+
else (_a = rest.onChange) == null ? void 0 : _a.call(rest, event);
|
876
875
|
},
|
877
876
|
[rest.onChange]
|
878
877
|
);
|
@@ -890,7 +889,7 @@ var CheckboxComponent = (0, import_react13.forwardRef)(
|
|
890
889
|
variant,
|
891
890
|
ref,
|
892
891
|
...rest,
|
893
|
-
isChecked,
|
892
|
+
isChecked: rest.isChecked,
|
894
893
|
onChange: handleOnChange,
|
895
894
|
isDisabled,
|
896
895
|
color: "white",
|