@clayui/time-picker 3.95.0 → 3.96.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/lib/index.js +4 -4
- package/package.json +4 -4
- package/src/index.tsx +2 -2
package/lib/index.js
CHANGED
|
@@ -116,7 +116,7 @@ var ClayTimePicker = function ClayTimePicker(_ref) {
|
|
|
116
116
|
value = _ref.value,
|
|
117
117
|
values = _ref.values;
|
|
118
118
|
|
|
119
|
-
var
|
|
119
|
+
var _useControlledState = (0, _shared.useControlledState)({
|
|
120
120
|
defaultName: 'defaultValue',
|
|
121
121
|
defaultValue: defaultValue,
|
|
122
122
|
handleName: 'onChange',
|
|
@@ -124,9 +124,9 @@ var ClayTimePicker = function ClayTimePicker(_ref) {
|
|
|
124
124
|
onChange: onChange !== null && onChange !== void 0 ? onChange : onInputChange,
|
|
125
125
|
value: value !== null && value !== void 0 ? value : values
|
|
126
126
|
}),
|
|
127
|
-
|
|
128
|
-
internalValue =
|
|
129
|
-
setValue =
|
|
127
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
128
|
+
internalValue = _useControlledState2[0],
|
|
129
|
+
setValue = _useControlledState2[1];
|
|
130
130
|
|
|
131
131
|
var useConfig = config[use12Hours ? 'use12Hours' : 'use24Hours'];
|
|
132
132
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clayui/time-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.96.0",
|
|
4
4
|
"description": "ClayTimePicker component",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": "https://github.com/liferay/clay",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@clayui/button": "^3.92.0",
|
|
26
|
-
"@clayui/form": "^3.
|
|
26
|
+
"@clayui/form": "^3.96.0",
|
|
27
27
|
"@clayui/icon": "^3.56.0",
|
|
28
|
-
"@clayui/shared": "^3.
|
|
28
|
+
"@clayui/shared": "^3.96.0",
|
|
29
29
|
"classnames": "^2.2.6"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"browserslist": [
|
|
37
37
|
"extends browserslist-config-clay"
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "4b068cc052987f0a95dc6ca3e5f985b5a52236c6"
|
|
40
40
|
}
|
package/src/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import ClayButton from '@clayui/button';
|
|
7
7
|
import {ClayInput} from '@clayui/form';
|
|
8
8
|
import ClayIcon from '@clayui/icon';
|
|
9
|
-
import {FocusScope, InternalDispatch,
|
|
9
|
+
import {FocusScope, InternalDispatch, useControlledState} from '@clayui/shared';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import React, {useEffect, useRef, useState} from 'react';
|
|
12
12
|
|
|
@@ -190,7 +190,7 @@ const ClayTimePicker = ({
|
|
|
190
190
|
value,
|
|
191
191
|
values,
|
|
192
192
|
}: IProps) => {
|
|
193
|
-
const [internalValue, setValue] =
|
|
193
|
+
const [internalValue, setValue] = useControlledState({
|
|
194
194
|
defaultName: 'defaultValue',
|
|
195
195
|
defaultValue,
|
|
196
196
|
handleName: 'onChange',
|