@ceed/cds 1.5.6-next.1 → 1.5.6-next.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/hooks/use-controlled-state/index.d.ts +1 -3
- package/dist/index.cjs +5 -9
- package/dist/index.js +5 -9
- package/framer/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void,
|
|
2
|
-
disableStrict?: boolean;
|
|
3
|
-
}): [T, (value: T | ((prev: T) => T)) => void, boolean];
|
|
1
|
+
export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void): [T, (value: T | ((prev: T) => T)) => void, boolean];
|
package/dist/index.cjs
CHANGED
|
@@ -406,7 +406,7 @@ var IconButton_default = IconButton;
|
|
|
406
406
|
|
|
407
407
|
// src/hooks/use-controlled-state/index.ts
|
|
408
408
|
var import_react5 = require("react");
|
|
409
|
-
function useControlledState(controlledValue, defaultValue, onChange
|
|
409
|
+
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
410
410
|
const { current: isControlled } = (0, import_react5.useRef)(controlledValue !== void 0);
|
|
411
411
|
const [internalValue, setInternalValue] = (0, import_react5.useState)(
|
|
412
412
|
controlledValue ?? defaultValue
|
|
@@ -2350,8 +2350,7 @@ var DatePicker = (0, import_react19.forwardRef)(
|
|
|
2350
2350
|
(0, import_react19.useCallback)(
|
|
2351
2351
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
2352
2352
|
[props.name, onChange]
|
|
2353
|
-
)
|
|
2354
|
-
{ disableStrict: true }
|
|
2353
|
+
)
|
|
2355
2354
|
);
|
|
2356
2355
|
const [displayValue, setDisplayValue] = (0, import_react19.useState)(
|
|
2357
2356
|
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
@@ -4128,8 +4127,7 @@ var DateRangePicker = (0, import_react26.forwardRef)(
|
|
|
4128
4127
|
(0, import_react26.useCallback)(
|
|
4129
4128
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4130
4129
|
[props.name, onChange]
|
|
4131
|
-
)
|
|
4132
|
-
{ disableStrict: true }
|
|
4130
|
+
)
|
|
4133
4131
|
);
|
|
4134
4132
|
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
4135
4133
|
const open = Boolean(anchorEl);
|
|
@@ -4632,8 +4630,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4632
4630
|
(0, import_react33.useCallback)(
|
|
4633
4631
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4634
4632
|
[props.name, onChange]
|
|
4635
|
-
)
|
|
4636
|
-
{ disableStrict: true }
|
|
4633
|
+
)
|
|
4637
4634
|
);
|
|
4638
4635
|
const getFormattedDisplayValue = (0, import_react33.useCallback)(
|
|
4639
4636
|
(inputValue) => {
|
|
@@ -4926,8 +4923,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4926
4923
|
(0, import_react34.useCallback)(
|
|
4927
4924
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4928
4925
|
[props.name, onChange]
|
|
4929
|
-
)
|
|
4930
|
-
{ disableStrict: true }
|
|
4926
|
+
)
|
|
4931
4927
|
);
|
|
4932
4928
|
const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
|
|
4933
4929
|
const open = Boolean(anchorEl);
|
package/dist/index.js
CHANGED
|
@@ -325,7 +325,7 @@ var IconButton_default = IconButton;
|
|
|
325
325
|
|
|
326
326
|
// src/hooks/use-controlled-state/index.ts
|
|
327
327
|
import { useState, useCallback, useEffect, useRef } from "react";
|
|
328
|
-
function useControlledState(controlledValue, defaultValue, onChange
|
|
328
|
+
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
329
329
|
const { current: isControlled } = useRef(controlledValue !== void 0);
|
|
330
330
|
const [internalValue, setInternalValue] = useState(
|
|
331
331
|
controlledValue ?? defaultValue
|
|
@@ -2312,8 +2312,7 @@ var DatePicker = forwardRef6(
|
|
|
2312
2312
|
useCallback7(
|
|
2313
2313
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
2314
2314
|
[props.name, onChange]
|
|
2315
|
-
)
|
|
2316
|
-
{ disableStrict: true }
|
|
2315
|
+
)
|
|
2317
2316
|
);
|
|
2318
2317
|
const [displayValue, setDisplayValue] = useState5(
|
|
2319
2318
|
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
@@ -4104,8 +4103,7 @@ var DateRangePicker = forwardRef8(
|
|
|
4104
4103
|
useCallback10(
|
|
4105
4104
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4106
4105
|
[props.name, onChange]
|
|
4107
|
-
)
|
|
4108
|
-
{ disableStrict: true }
|
|
4106
|
+
)
|
|
4109
4107
|
);
|
|
4110
4108
|
const [anchorEl, setAnchorEl] = useState7(null);
|
|
4111
4109
|
const open = Boolean(anchorEl);
|
|
@@ -4628,8 +4626,7 @@ var MonthPicker = forwardRef9(
|
|
|
4628
4626
|
useCallback11(
|
|
4629
4627
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4630
4628
|
[props.name, onChange]
|
|
4631
|
-
)
|
|
4632
|
-
{ disableStrict: true }
|
|
4629
|
+
)
|
|
4633
4630
|
);
|
|
4634
4631
|
const getFormattedDisplayValue = useCallback11(
|
|
4635
4632
|
(inputValue) => {
|
|
@@ -4930,8 +4927,7 @@ var MonthRangePicker = forwardRef10(
|
|
|
4930
4927
|
useCallback12(
|
|
4931
4928
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4932
4929
|
[props.name, onChange]
|
|
4933
|
-
)
|
|
4934
|
-
{ disableStrict: true }
|
|
4930
|
+
)
|
|
4935
4931
|
);
|
|
4936
4932
|
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4937
4933
|
const open = Boolean(anchorEl);
|