@commercetools-uikit/time-input 13.0.2 → 14.0.1
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
|
@@ -43,6 +43,8 @@ export default Example;
|
|
|
43
43
|
| Props | Type | Required | Default | Description |
|
|
44
44
|
| ---------------------- | ----------------------------------------------------------------------------------------------------- | :------: | --------- | ---------------------------------------------------------------------------------------------- |
|
|
45
45
|
| `id` | `string` | | | Used as HTML id property. An id is auto-generated when it is not specified. |
|
|
46
|
+
| `aria-invalid` | `boolean` | | | Indicate if the value entered in the input is invalid. |
|
|
47
|
+
| `aria-errormessage` | `string` | | | HTML ID of an element containing an error message related to the input. |
|
|
46
48
|
| `horizontalConstraint` | `union`<br/>Possible values:<br/>`, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'` | | `'scale'` | Horizontal size limit of the input fields. |
|
|
47
49
|
| `name` | `string` | | | Used as HTML name of the input component. |
|
|
48
50
|
| `autoComplete` | `string` | | | Used as HTML autocomplete of the input component. |
|
|
@@ -214,7 +214,10 @@ var TimeInputBody = function TimeInputBody(props) {
|
|
|
214
214
|
/* ARIA */
|
|
215
215
|
"aria-readonly": props.isReadOnly,
|
|
216
216
|
contentEditable: !props.isReadOnly
|
|
217
|
-
}
|
|
217
|
+
}, !props.isReadOnly ? {
|
|
218
|
+
'aria-invalid': props['aria-invalid'],
|
|
219
|
+
'aria-errormessage': props['aria-errormessage']
|
|
220
|
+
} : {})), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(ClearSection, {
|
|
218
221
|
isDisabled: props.isDisabled,
|
|
219
222
|
hasError: props.hasError,
|
|
220
223
|
isReadOnly: props.isReadOnly,
|
|
@@ -312,7 +315,7 @@ var TimeInput = function TimeInput(props) {
|
|
|
312
315
|
|
|
313
316
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
314
317
|
max: props.horizontalConstraint,
|
|
315
|
-
children: jsxRuntime.jsx(TimeInputBody$1, _objectSpread({
|
|
318
|
+
children: jsxRuntime.jsx(TimeInputBody$1, _objectSpread(_objectSpread({
|
|
316
319
|
id: id,
|
|
317
320
|
name: props.name,
|
|
318
321
|
autoComplete: props.autoComplete,
|
|
@@ -326,12 +329,18 @@ var TimeInput = function TimeInput(props) {
|
|
|
326
329
|
isReadOnly: props.isReadOnly,
|
|
327
330
|
onClear: onClear,
|
|
328
331
|
placeholder: typeof props.placeholder === 'string' ? props.placeholder : intl.formatMessage(messages.placeholder)
|
|
329
|
-
}, utils.filterDataAttributes(props))
|
|
332
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
333
|
+
/* ARIA */
|
|
334
|
+
"aria-invalid": props['aria-invalid'],
|
|
335
|
+
"aria-errormessage": props['aria-errormessage']
|
|
336
|
+
}))
|
|
330
337
|
});
|
|
331
338
|
};
|
|
332
339
|
|
|
333
340
|
TimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
334
341
|
id: _pt__default["default"].string,
|
|
342
|
+
'aria-invalid': _pt__default["default"].bool,
|
|
343
|
+
'aria-errormessage': _pt__default["default"].string,
|
|
335
344
|
horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
336
345
|
name: _pt__default["default"].string,
|
|
337
346
|
autoComplete: _pt__default["default"].string,
|
|
@@ -383,7 +392,7 @@ TimeInput.toLocaleTime = function (time, locale) {
|
|
|
383
392
|
var TimeInput$1 = TimeInput;
|
|
384
393
|
|
|
385
394
|
// NOTE: This string will be replaced on build time with the package version.
|
|
386
|
-
var version = "
|
|
395
|
+
var version = "14.0.1";
|
|
387
396
|
|
|
388
397
|
exports["default"] = TimeInput$1;
|
|
389
398
|
exports.version = version;
|
|
@@ -195,7 +195,10 @@ var TimeInputBody = function TimeInputBody(props) {
|
|
|
195
195
|
/* ARIA */
|
|
196
196
|
"aria-readonly": props.isReadOnly,
|
|
197
197
|
contentEditable: !props.isReadOnly
|
|
198
|
-
}
|
|
198
|
+
}, !props.isReadOnly ? {
|
|
199
|
+
'aria-invalid': props['aria-invalid'],
|
|
200
|
+
'aria-errormessage': props['aria-errormessage']
|
|
201
|
+
} : {})), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(ClearSection, {
|
|
199
202
|
isDisabled: props.isDisabled,
|
|
200
203
|
hasError: props.hasError,
|
|
201
204
|
isReadOnly: props.isReadOnly,
|
|
@@ -291,7 +294,7 @@ var TimeInput = function TimeInput(props) {
|
|
|
291
294
|
|
|
292
295
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
293
296
|
max: props.horizontalConstraint,
|
|
294
|
-
children: jsxRuntime.jsx(TimeInputBody$1, _objectSpread({
|
|
297
|
+
children: jsxRuntime.jsx(TimeInputBody$1, _objectSpread(_objectSpread({
|
|
295
298
|
id: id,
|
|
296
299
|
name: props.name,
|
|
297
300
|
autoComplete: props.autoComplete,
|
|
@@ -305,7 +308,11 @@ var TimeInput = function TimeInput(props) {
|
|
|
305
308
|
isReadOnly: props.isReadOnly,
|
|
306
309
|
onClear: onClear,
|
|
307
310
|
placeholder: typeof props.placeholder === 'string' ? props.placeholder : intl.formatMessage(messages.placeholder)
|
|
308
|
-
}, utils.filterDataAttributes(props))
|
|
311
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
312
|
+
/* ARIA */
|
|
313
|
+
"aria-invalid": props['aria-invalid'],
|
|
314
|
+
"aria-errormessage": props['aria-errormessage']
|
|
315
|
+
}))
|
|
309
316
|
});
|
|
310
317
|
};
|
|
311
318
|
|
|
@@ -348,7 +355,7 @@ TimeInput.toLocaleTime = function (time, locale) {
|
|
|
348
355
|
var TimeInput$1 = TimeInput;
|
|
349
356
|
|
|
350
357
|
// NOTE: This string will be replaced on build time with the package version.
|
|
351
|
-
var version = "
|
|
358
|
+
var version = "14.0.1";
|
|
352
359
|
|
|
353
360
|
exports["default"] = TimeInput$1;
|
|
354
361
|
exports.version = version;
|
|
@@ -192,7 +192,10 @@ var TimeInputBody = function TimeInputBody(props) {
|
|
|
192
192
|
/* ARIA */
|
|
193
193
|
"aria-readonly": props.isReadOnly,
|
|
194
194
|
contentEditable: !props.isReadOnly
|
|
195
|
-
}
|
|
195
|
+
}, !props.isReadOnly ? {
|
|
196
|
+
'aria-invalid': props['aria-invalid'],
|
|
197
|
+
'aria-errormessage': props['aria-errormessage']
|
|
198
|
+
} : {})), !props.isDisabled && !props.isReadOnly && jsx(ClearSection, {
|
|
196
199
|
isDisabled: props.isDisabled,
|
|
197
200
|
hasError: props.hasError,
|
|
198
201
|
isReadOnly: props.isReadOnly,
|
|
@@ -290,7 +293,7 @@ var TimeInput = function TimeInput(props) {
|
|
|
290
293
|
|
|
291
294
|
return jsx(Constraints.Horizontal, {
|
|
292
295
|
max: props.horizontalConstraint,
|
|
293
|
-
children: jsx(TimeInputBody$1, _objectSpread({
|
|
296
|
+
children: jsx(TimeInputBody$1, _objectSpread(_objectSpread({
|
|
294
297
|
id: id,
|
|
295
298
|
name: props.name,
|
|
296
299
|
autoComplete: props.autoComplete,
|
|
@@ -304,12 +307,18 @@ var TimeInput = function TimeInput(props) {
|
|
|
304
307
|
isReadOnly: props.isReadOnly,
|
|
305
308
|
onClear: onClear,
|
|
306
309
|
placeholder: typeof props.placeholder === 'string' ? props.placeholder : intl.formatMessage(messages.placeholder)
|
|
307
|
-
}, filterDataAttributes(props))
|
|
310
|
+
}, filterDataAttributes(props)), {}, {
|
|
311
|
+
/* ARIA */
|
|
312
|
+
"aria-invalid": props['aria-invalid'],
|
|
313
|
+
"aria-errormessage": props['aria-errormessage']
|
|
314
|
+
}))
|
|
308
315
|
});
|
|
309
316
|
};
|
|
310
317
|
|
|
311
318
|
TimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
312
319
|
id: _pt.string,
|
|
320
|
+
'aria-invalid': _pt.bool,
|
|
321
|
+
'aria-errormessage': _pt.string,
|
|
313
322
|
horizontalConstraint: _pt.oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
314
323
|
name: _pt.string,
|
|
315
324
|
autoComplete: _pt.string,
|
|
@@ -361,6 +370,6 @@ TimeInput.toLocaleTime = function (time, locale) {
|
|
|
361
370
|
var TimeInput$1 = TimeInput;
|
|
362
371
|
|
|
363
372
|
// NOTE: This string will be replaced on build time with the package version.
|
|
364
|
-
var version = "
|
|
373
|
+
var version = "14.0.1";
|
|
365
374
|
|
|
366
375
|
export { TimeInput$1 as default, version };
|
|
@@ -8,6 +8,8 @@ declare type TEvent = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare type TTimeInputProps = {
|
|
10
10
|
id?: string;
|
|
11
|
+
'aria-invalid'?: boolean;
|
|
12
|
+
'aria-errormessage'?: string;
|
|
11
13
|
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
12
14
|
name?: string;
|
|
13
15
|
autoComplete?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/time-input",
|
|
3
3
|
"description": "The TimeInput component allows the user to select a time.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.1",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"directory": "packages/components/inputs/time-input"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
|
-
"keywords": ["javascript", "design
|
|
12
|
+
"keywords": ["javascript", "typescript", "design-system", "react", "uikit"],
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
@@ -19,25 +19,24 @@
|
|
|
19
19
|
"module": "dist/commercetools-uikit-time-input.esm.js",
|
|
20
20
|
"files": ["dist"],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@babel/runtime": "7.17.2",
|
|
23
|
-
"@babel/runtime-corejs3": "7.17.2",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "
|
|
25
|
-
"@commercetools-uikit/constraints": "
|
|
26
|
-
"@commercetools-uikit/design-system": "
|
|
27
|
-
"@commercetools-uikit/hooks": "
|
|
28
|
-
"@commercetools-uikit/icons": "
|
|
29
|
-
"@commercetools-uikit/input-utils": "
|
|
30
|
-
"@commercetools-uikit/spacings-inline": "
|
|
31
|
-
"@commercetools-uikit/utils": "
|
|
22
|
+
"@babel/runtime": "^7.17.2",
|
|
23
|
+
"@babel/runtime-corejs3": "^7.17.2",
|
|
24
|
+
"@commercetools-uikit/accessible-button": "14.0.1",
|
|
25
|
+
"@commercetools-uikit/constraints": "14.0.1",
|
|
26
|
+
"@commercetools-uikit/design-system": "14.0.0",
|
|
27
|
+
"@commercetools-uikit/hooks": "14.0.1",
|
|
28
|
+
"@commercetools-uikit/icons": "14.0.1",
|
|
29
|
+
"@commercetools-uikit/input-utils": "14.0.1",
|
|
30
|
+
"@commercetools-uikit/spacings-inline": "14.0.1",
|
|
31
|
+
"@commercetools-uikit/utils": "14.0.1",
|
|
32
32
|
"@emotion/is-prop-valid": "1.1.2",
|
|
33
33
|
"@emotion/react": "^11.4.0",
|
|
34
34
|
"@emotion/styled": "^11.3.0",
|
|
35
|
-
"prop-types": "15.8.1"
|
|
36
|
-
"react-required-if": "1.0.3"
|
|
35
|
+
"prop-types": "15.8.1"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"react": "17.0.2",
|
|
40
|
-
"react-intl": "5.24.6"
|
|
39
|
+
"react-intl": "^5.24.6"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"react": "17.x",
|