@commercetools-uikit/time-field 14.0.1 → 14.0.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/README.md
CHANGED
|
@@ -56,9 +56,9 @@ export default Example;
|
|
|
56
56
|
| `name` | `string` | | | Used as HTML name of the input component. |
|
|
57
57
|
| `autoComplete` | `string` | | | Used as HTML autocomplete of the input component. |
|
|
58
58
|
| `value` | `string` | ✅ | | Value of the input |
|
|
59
|
-
| `onChange` | `
|
|
60
|
-
| `onBlur` | `
|
|
61
|
-
| `onFocus` | `
|
|
59
|
+
| `onChange` | `ChangeEventHandler` | | | Called with an event holding the new value. |
|
|
60
|
+
| `onBlur` | `FocusEventHandler` | | | Called when input is blurred |
|
|
61
|
+
| `onFocus` | `FocusEventHandler` | | | Called when input is focused |
|
|
62
62
|
| `isAutofocussed` | `boolean` | | | Focus the input on initial render |
|
|
63
63
|
| `isDisabled` | `boolean` | | | Indicates that the input cannot be modified (e.g not authorized, or changes currently saving). |
|
|
64
64
|
| `isReadOnly` | `boolean` | | | Indicates that the input is read only (no changes allowed). |
|
|
@@ -78,24 +78,6 @@ export default Example;
|
|
|
78
78
|
(key: string, error?: boolean) => ReactNode;
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
### Signature `onChange`
|
|
82
|
-
|
|
83
|
-
```ts
|
|
84
|
-
(event: TEvent) => void
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Signature `onBlur`
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
(event: TEvent) => void
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Signature `onFocus`
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
(event: TEvent) => void
|
|
97
|
-
```
|
|
98
|
-
|
|
99
81
|
### Signature `onInfoButtonClick`
|
|
100
82
|
|
|
101
83
|
```ts
|
|
@@ -97,7 +97,7 @@ var TimeField = /*#__PURE__*/function (_Component) {
|
|
|
97
97
|
var hasError = this.props.touched && hasErrors(this.props.errors);
|
|
98
98
|
|
|
99
99
|
if (!this.props.isReadOnly) {
|
|
100
|
-
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.onChange === 'function', 'TimeField: `onChange` is required when is not read only.') : void 0;
|
|
100
|
+
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.onChange === 'function', 'TimeField: `onChange` is required when field is not read only.') : void 0;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
if (this.props.hintIcon) {
|
|
@@ -176,7 +176,7 @@ TimeField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
176
176
|
name: _pt__default["default"].string,
|
|
177
177
|
autoComplete: _pt__default["default"].string,
|
|
178
178
|
value: _pt__default["default"].string.isRequired,
|
|
179
|
-
onChange: _pt__default["default"].func
|
|
179
|
+
onChange: _pt__default["default"].func,
|
|
180
180
|
onBlur: _pt__default["default"].func,
|
|
181
181
|
onFocus: _pt__default["default"].func,
|
|
182
182
|
isAutofocussed: _pt__default["default"].bool,
|
|
@@ -193,7 +193,7 @@ TimeField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
193
193
|
var TimeField$1 = TimeField;
|
|
194
194
|
|
|
195
195
|
// NOTE: This string will be replaced on build time with the package version.
|
|
196
|
-
var version = "14.0.
|
|
196
|
+
var version = "14.0.2";
|
|
197
197
|
|
|
198
198
|
exports["default"] = TimeField$1;
|
|
199
199
|
exports.version = version;
|
|
@@ -165,7 +165,7 @@ TimeField.propTypes = {};
|
|
|
165
165
|
var TimeField$1 = TimeField;
|
|
166
166
|
|
|
167
167
|
// NOTE: This string will be replaced on build time with the package version.
|
|
168
|
-
var version = "14.0.
|
|
168
|
+
var version = "14.0.2";
|
|
169
169
|
|
|
170
170
|
exports["default"] = TimeField$1;
|
|
171
171
|
exports.version = version;
|
|
@@ -72,7 +72,7 @@ var TimeField = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
var hasError = this.props.touched && hasErrors(this.props.errors);
|
|
73
73
|
|
|
74
74
|
if (!this.props.isReadOnly) {
|
|
75
|
-
process.env.NODE_ENV !== "production" ? warning(typeof this.props.onChange === 'function', 'TimeField: `onChange` is required when is not read only.') : void 0;
|
|
75
|
+
process.env.NODE_ENV !== "production" ? warning(typeof this.props.onChange === 'function', 'TimeField: `onChange` is required when field is not read only.') : void 0;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
if (this.props.hintIcon) {
|
|
@@ -151,7 +151,7 @@ TimeField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
151
151
|
name: _pt.string,
|
|
152
152
|
autoComplete: _pt.string,
|
|
153
153
|
value: _pt.string.isRequired,
|
|
154
|
-
onChange: _pt.func
|
|
154
|
+
onChange: _pt.func,
|
|
155
155
|
onBlur: _pt.func,
|
|
156
156
|
onFocus: _pt.func,
|
|
157
157
|
isAutofocussed: _pt.bool,
|
|
@@ -168,6 +168,6 @@ TimeField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
168
168
|
var TimeField$1 = TimeField;
|
|
169
169
|
|
|
170
170
|
// NOTE: This string will be replaced on build time with the package version.
|
|
171
|
-
var version = "14.0.
|
|
171
|
+
var version = "14.0.2";
|
|
172
172
|
|
|
173
173
|
export { TimeField$1 as default, version };
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import { Component, type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
declare type TEvent = {
|
|
3
|
-
target: {
|
|
4
|
-
id?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
value?: unknown;
|
|
7
|
-
};
|
|
8
|
-
persist?: () => void;
|
|
9
|
-
};
|
|
1
|
+
import { Component, type ChangeEventHandler, type FocusEventHandler, type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';
|
|
10
2
|
declare type TFieldErrors = Record<string, boolean>;
|
|
11
3
|
declare type TCustomFormErrors<Values> = {
|
|
12
4
|
[K in keyof Values]?: TFieldErrors;
|
|
@@ -21,9 +13,9 @@ declare type TTimeFieldProps = {
|
|
|
21
13
|
name?: string;
|
|
22
14
|
autoComplete?: string;
|
|
23
15
|
value: string;
|
|
24
|
-
onChange
|
|
25
|
-
onBlur?:
|
|
26
|
-
onFocus?:
|
|
16
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
17
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
18
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
27
19
|
isAutofocussed?: boolean;
|
|
28
20
|
isDisabled?: boolean;
|
|
29
21
|
isReadOnly?: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/time-field",
|
|
3
3
|
"description": "A controlled date input component for single date.",
|
|
4
|
-
"version": "14.0.
|
|
4
|
+
"version": "14.0.2",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@commercetools-uikit/constraints": "14.0.1",
|
|
25
25
|
"@commercetools-uikit/design-system": "14.0.0",
|
|
26
26
|
"@commercetools-uikit/field-errors": "14.0.1",
|
|
27
|
-
"@commercetools-uikit/field-label": "14.0.
|
|
27
|
+
"@commercetools-uikit/field-label": "14.0.2",
|
|
28
28
|
"@commercetools-uikit/spacings-stack": "14.0.1",
|
|
29
|
-
"@commercetools-uikit/time-input": "14.0.
|
|
29
|
+
"@commercetools-uikit/time-input": "14.0.2",
|
|
30
30
|
"@commercetools-uikit/utils": "14.0.1",
|
|
31
31
|
"@emotion/react": "^11.4.0",
|
|
32
32
|
"@emotion/styled": "^11.3.0",
|