@commercetools-uikit/time-input 15.11.2 → 15.13.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.
@@ -208,7 +208,7 @@ var TimeInputBody = /*#__PURE__*/react$1.forwardRef(function (props, ref) {
208
208
  }, !props.isReadOnly ? {
209
209
  'aria-invalid': props['aria-invalid'],
210
210
  'aria-errormessage': props['aria-errormessage']
211
- } : {})), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(ClearSection, {
211
+ } : {})), !props.isDisabled && !props.isReadOnly && Boolean(props.value) && jsxRuntime.jsx(ClearSection, {
212
212
  isDisabled: props.isDisabled,
213
213
  hasError: props.hasError,
214
214
  isReadOnly: props.isReadOnly,
@@ -283,6 +283,7 @@ var TimeInput = function TimeInput(props) {
283
283
  var id = hooks.useFieldId(props.id, sequentialId);
284
284
  var intl = reactIntl.useIntl();
285
285
  var element = react$1.useRef(null);
286
+ var onChange = props.onChange;
286
287
 
287
288
  if (!props.isReadOnly) {
288
289
  process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'TimeInput: `onChange` is required when input is not read only.') : void 0;
@@ -299,7 +300,13 @@ var TimeInput = function TimeInput(props) {
299
300
  if (element.current) {
300
301
  dispatchReactChangeEvent(element.current, '');
301
302
  }
302
- }, []); // if locale has changed trigger a new change event
303
+
304
+ onChange === null || onChange === void 0 ? void 0 : onChange({
305
+ target: {
306
+ value: ''
307
+ }
308
+ });
309
+ }, [onChange]); // if locale has changed trigger a new change event
303
310
 
304
311
  react$1.useEffect(function () {
305
312
  if (element.current) {
@@ -316,7 +323,7 @@ var TimeInput = function TimeInput(props) {
316
323
  name: props.name,
317
324
  autoComplete: props.autoComplete,
318
325
  value: props.value,
319
- onChange: props.onChange,
326
+ onChange: onChange,
320
327
  onBlur: handleBlur,
321
328
  onFocus: props.onFocus,
322
329
  isAutofocussed: props.isAutofocussed,
@@ -388,7 +395,7 @@ TimeInput.toLocaleTime = function (time, locale) {
388
395
  var TimeInput$1 = TimeInput;
389
396
 
390
397
  // NOTE: This string will be replaced on build time with the package version.
391
- var version = "15.11.2";
398
+ var version = "15.13.0";
392
399
 
393
400
  exports["default"] = TimeInput$1;
394
401
  exports.version = version;
@@ -189,7 +189,7 @@ var TimeInputBody = /*#__PURE__*/react$1.forwardRef(function (props, ref) {
189
189
  }, !props.isReadOnly ? {
190
190
  'aria-invalid': props['aria-invalid'],
191
191
  'aria-errormessage': props['aria-errormessage']
192
- } : {})), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(ClearSection, {
192
+ } : {})), !props.isDisabled && !props.isReadOnly && Boolean(props.value) && jsxRuntime.jsx(ClearSection, {
193
193
  isDisabled: props.isDisabled,
194
194
  hasError: props.hasError,
195
195
  isReadOnly: props.isReadOnly,
@@ -264,6 +264,7 @@ var TimeInput = function TimeInput(props) {
264
264
  var id = hooks.useFieldId(props.id, sequentialId);
265
265
  var intl = reactIntl.useIntl();
266
266
  var element = react$1.useRef(null);
267
+ var onChange = props.onChange;
267
268
 
268
269
  if (!props.isReadOnly) ;
269
270
 
@@ -278,7 +279,13 @@ var TimeInput = function TimeInput(props) {
278
279
  if (element.current) {
279
280
  dispatchReactChangeEvent(element.current, '');
280
281
  }
281
- }, []); // if locale has changed trigger a new change event
282
+
283
+ onChange === null || onChange === void 0 ? void 0 : onChange({
284
+ target: {
285
+ value: ''
286
+ }
287
+ });
288
+ }, [onChange]); // if locale has changed trigger a new change event
282
289
 
283
290
  react$1.useEffect(function () {
284
291
  if (element.current) {
@@ -295,7 +302,7 @@ var TimeInput = function TimeInput(props) {
295
302
  name: props.name,
296
303
  autoComplete: props.autoComplete,
297
304
  value: props.value,
298
- onChange: props.onChange,
305
+ onChange: onChange,
299
306
  onBlur: handleBlur,
300
307
  onFocus: props.onFocus,
301
308
  isAutofocussed: props.isAutofocussed,
@@ -351,7 +358,7 @@ TimeInput.toLocaleTime = function (time, locale) {
351
358
  var TimeInput$1 = TimeInput;
352
359
 
353
360
  // NOTE: This string will be replaced on build time with the package version.
354
- var version = "15.11.2";
361
+ var version = "15.13.0";
355
362
 
356
363
  exports["default"] = TimeInput$1;
357
364
  exports.version = version;
@@ -186,7 +186,7 @@ var TimeInputBody = /*#__PURE__*/forwardRef(function (props, ref) {
186
186
  }, !props.isReadOnly ? {
187
187
  'aria-invalid': props['aria-invalid'],
188
188
  'aria-errormessage': props['aria-errormessage']
189
- } : {})), !props.isDisabled && !props.isReadOnly && jsx(ClearSection, {
189
+ } : {})), !props.isDisabled && !props.isReadOnly && Boolean(props.value) && jsx(ClearSection, {
190
190
  isDisabled: props.isDisabled,
191
191
  hasError: props.hasError,
192
192
  isReadOnly: props.isReadOnly,
@@ -261,6 +261,7 @@ var TimeInput = function TimeInput(props) {
261
261
  var id = useFieldId(props.id, sequentialId);
262
262
  var intl = useIntl();
263
263
  var element = useRef(null);
264
+ var onChange = props.onChange;
264
265
 
265
266
  if (!props.isReadOnly) {
266
267
  process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'TimeInput: `onChange` is required when input is not read only.') : void 0;
@@ -277,7 +278,13 @@ var TimeInput = function TimeInput(props) {
277
278
  if (element.current) {
278
279
  dispatchReactChangeEvent(element.current, '');
279
280
  }
280
- }, []); // if locale has changed trigger a new change event
281
+
282
+ onChange === null || onChange === void 0 ? void 0 : onChange({
283
+ target: {
284
+ value: ''
285
+ }
286
+ });
287
+ }, [onChange]); // if locale has changed trigger a new change event
281
288
 
282
289
  useEffect(function () {
283
290
  if (element.current) {
@@ -294,7 +301,7 @@ var TimeInput = function TimeInput(props) {
294
301
  name: props.name,
295
302
  autoComplete: props.autoComplete,
296
303
  value: props.value,
297
- onChange: props.onChange,
304
+ onChange: onChange,
298
305
  onBlur: handleBlur,
299
306
  onFocus: props.onFocus,
300
307
  isAutofocussed: props.isAutofocussed,
@@ -366,6 +373,6 @@ TimeInput.toLocaleTime = function (time, locale) {
366
373
  var TimeInput$1 = TimeInput;
367
374
 
368
375
  // NOTE: This string will be replaced on build time with the package version.
369
- var version = "15.11.2";
376
+ var version = "15.13.0";
370
377
 
371
378
  export { TimeInput$1 as default, version };
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": "15.11.2",
4
+ "version": "15.13.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,19 +19,19 @@
19
19
  "module": "dist/commercetools-uikit-time-input.esm.js",
20
20
  "files": ["dist"],
21
21
  "dependencies": {
22
- "@babel/runtime": "^7.19.0",
23
- "@babel/runtime-corejs3": "^7.19.1",
24
- "@commercetools-uikit/accessible-button": "15.11.2",
25
- "@commercetools-uikit/constraints": "15.11.2",
26
- "@commercetools-uikit/design-system": "15.11.2",
27
- "@commercetools-uikit/hooks": "15.11.2",
28
- "@commercetools-uikit/icons": "15.11.2",
29
- "@commercetools-uikit/input-utils": "15.11.2",
30
- "@commercetools-uikit/spacings-inline": "15.11.2",
31
- "@commercetools-uikit/utils": "15.11.2",
22
+ "@babel/runtime": "^7.20.13",
23
+ "@babel/runtime-corejs3": "^7.20.13",
24
+ "@commercetools-uikit/accessible-button": "15.13.0",
25
+ "@commercetools-uikit/constraints": "15.13.0",
26
+ "@commercetools-uikit/design-system": "15.13.0",
27
+ "@commercetools-uikit/hooks": "15.13.0",
28
+ "@commercetools-uikit/icons": "15.13.0",
29
+ "@commercetools-uikit/input-utils": "15.13.0",
30
+ "@commercetools-uikit/spacings-inline": "15.13.0",
31
+ "@commercetools-uikit/utils": "15.13.0",
32
32
  "@emotion/is-prop-valid": "1.2.0",
33
- "@emotion/react": "^11.4.0",
34
- "@emotion/styled": "^11.3.0",
33
+ "@emotion/react": "^11.10.5",
34
+ "@emotion/styled": "^11.10.5",
35
35
  "prop-types": "15.8.1"
36
36
  },
37
37
  "devDependencies": {