@colisweb/rescript-toolkit 2.22.1 → 2.24.0
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/package.json
CHANGED
|
@@ -42,6 +42,18 @@ let make = (
|
|
|
42
42
|
~color=#primary,
|
|
43
43
|
) => {
|
|
44
44
|
let (isChecked, setIsChecked) = React.useState(() => checked->Option.getWithDefault(false))
|
|
45
|
+
let previousChecked = Toolkit__Hooks.usePrevious(checked)
|
|
46
|
+
|
|
47
|
+
React.useEffect2(() => {
|
|
48
|
+
checked->Option.forEach(checked => {
|
|
49
|
+
switch (previousChecked, checked) {
|
|
50
|
+
| (Some(Some(c1)), c2) if c1 != c2 => setIsChecked(_ => c2)
|
|
51
|
+
| _ => ()
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
None
|
|
56
|
+
}, (checked, previousChecked))
|
|
45
57
|
|
|
46
58
|
<label
|
|
47
59
|
ref=?switchRef
|
|
@@ -5908,3 +5908,15 @@ module AiFillEye = {
|
|
|
5908
5908
|
@module("react-icons/ai") @react.component
|
|
5909
5909
|
external make: (~size: int=?) => React.element = "AiFillEye"
|
|
5910
5910
|
}
|
|
5911
|
+
|
|
5912
|
+
module FaCalendarCheck = {
|
|
5913
|
+
@module("react-icons/fa") @react.component
|
|
5914
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
5915
|
+
"FaCalendarCheck"
|
|
5916
|
+
}
|
|
5917
|
+
|
|
5918
|
+
module FaUserCog = {
|
|
5919
|
+
@module("react-icons/fa") @react.component
|
|
5920
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
5921
|
+
"FaUserCog"
|
|
5922
|
+
}
|