@geneui/components 2.16.0-canary-36aab18-26082024 → 2.16.0-canary-12a636d-09092024

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/Range/index.js CHANGED
@@ -2,7 +2,7 @@ import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
2
2
  import React__default, { useState, useRef, useCallback } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classnames } from '../index-031ff73c.js';
5
- import { c as createSliderWithTooltip, R as Range } from '../rangeAndSlider-693a3d41.js';
5
+ import { c as createSliderWithTooltip, R as Range } from '../rangeAndSlider-63c5d423.js';
6
6
  import useWidth from '../hooks/useWidth.js';
7
7
  import '../dateValidation-67caec66.js';
8
8
  import 'react-dom';
package/Slider/index.js CHANGED
@@ -2,7 +2,7 @@ import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
2
2
  import React__default, { useState, useRef, useCallback, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classnames } from '../index-031ff73c.js';
5
- import { c as createSliderWithTooltip, S as Slider } from '../rangeAndSlider-693a3d41.js';
5
+ import { c as createSliderWithTooltip, S as Slider } from '../rangeAndSlider-63c5d423.js';
6
6
  import useWidth from '../hooks/useWidth.js';
7
7
  import '../dateValidation-67caec66.js';
8
8
  import 'react-dom';
@@ -263,7 +263,7 @@ function TimePicker(_ref) {
263
263
  setInputValue(time);
264
264
  handleChange(e, time);
265
265
  }, [hour, minute, second, separator, showSeconds, handleChange, combinedValue]);
266
- const handleInputChange = useCallback(e => {
266
+ const handleInputChange = e => {
267
267
  const {
268
268
  value
269
269
  } = e.target;
@@ -273,8 +273,6 @@ function TimePicker(_ref) {
273
273
  const timeParts = replacedValue.split(separator);
274
274
  const lastChar = replacedValue[replacedValue.length - 1];
275
275
  const secondLastChar = replacedValue[replacedValue.length - 2];
276
-
277
- // Checking if last and second last chars are same and equal to separator then return
278
276
  if (lastChar === separator && lastChar === secondLastChar) return;
279
277
  if (value === '') {
280
278
  setHour('');
@@ -314,9 +312,6 @@ function TimePicker(_ref) {
314
312
  outOfRange = true;
315
313
  }
316
314
  }
317
-
318
- // Make field valid when after typing field pass validation
319
- // but we must set error only when user click outside or onBlur event fires
320
315
  !checkTimeValidation(timeParts[0], false) && setHourFieldError(false);
321
316
  !checkMinuteValidation(timeParts[1], false) && setMinuteFieldError(false);
322
317
  (!showSeconds || !checkSecondValidation(timeParts[2], false)) && setSecondFieldError(false);
@@ -324,36 +319,46 @@ function TimePicker(_ref) {
324
319
  setInputValue(replacedValue);
325
320
  onChange(e);
326
321
  }
327
- }, [numberRegExp, separator, showSeconds, checkTimeValidation, checkMinuteValidation, checkSecondValidation, handleChange, hourFormat, onChange]);
322
+ };
328
323
  useEffect(() => {
329
324
  if ((disabled || readOnly) && childRef.current) {
330
325
  childRef.current.toggleOpen(true);
331
326
  }
332
327
  }, [disabled, readOnly]);
333
328
  useEffect(() => {
334
- // if hour format changes, convert value to that format
335
- const formattedHour = convertToFormat(hour, hourFormat);
336
- setHour(formattedHour);
337
- setInputValue(combinedValue(formattedHour, minute, second, false));
338
- }, [combinedValue, hour, hourFormat, minute, second]);
329
+ if (hour) {
330
+ const formattedHour = convertToFormat(hour, hourFormat);
331
+ setHour(formattedHour);
332
+ setInputValue(combinedValue(formattedHour, minute, second, false));
333
+ }
334
+ }, [hourFormat]);
335
+ useEffect(() => {
336
+ if (minute) {
337
+ const formattedMinute = convertToFormat(minute, minuteFormat);
338
+ setMinute(formattedMinute);
339
+ setInputValue(combinedValue(hour, formattedMinute, second, false));
340
+ }
341
+ }, [minuteFormat]);
339
342
  useEffect(() => {
340
- // if minute format changes, convert value to that format
341
- const formattedMinute = convertToFormat(minute, minuteFormat);
342
- setMinute(formattedMinute);
343
- setInputValue(combinedValue(hour, formattedMinute, second, false));
344
- }, [combinedValue, hour, minute, minuteFormat, second]);
343
+ if (second) {
344
+ const formattedSecond = convertToFormat(second, secondFormat);
345
+ setSecond(formattedSecond);
346
+ setInputValue(combinedValue(hour, minute, formattedSecond, false));
347
+ }
348
+ }, [secondFormat]);
345
349
  useEffect(() => {
346
- // if second format changes, convert value to that format
347
- const formattedSecond = convertToFormat(second, secondFormat);
348
- setSecond(formattedSecond);
349
- setInputValue(combinedValue(hour, minute, formattedSecond, false));
350
- }, [combinedValue, hour, minute, second, secondFormat]);
350
+ if (!inputValue) return;
351
+ const [splitHour, splitMinute, splitSecond] = inputValue.split(separator);
352
+ !showSeconds && setSecond('');
353
+ showSeconds && (inputValue || hour) && !second && setSecond(convertToFormat(second, secondFormat));
354
+ setInputValue(combinedValue(splitHour, splitMinute, splitSecond));
355
+ }, [showSeconds]);
351
356
  useEffect(() => {
352
357
  if (value) {
353
- const timeParts = value.split(separator);
354
- timeParts[0] && setHour(timeParts[0]);
355
- timeParts[1] && setMinute(timeParts[1]);
356
- showSeconds && timeParts[2] && setSecond(timeParts[2]);
358
+ const [splitHour, splitMinute, splitSecond] = value.split(separator);
359
+ splitHour && setHour(splitHour);
360
+ splitMinute && setMinute(splitMinute);
361
+ showSeconds && splitSecond && setSecond(splitSecond);
357
362
  setInputValue(value);
358
363
  }
359
364
  }, [value, separator, showSeconds]);
package/index.js CHANGED
@@ -140,7 +140,7 @@ import './localization-4ba17032.js';
140
140
  import './Popover-f4d1cac0.js';
141
141
  import './index-122432cd.js';
142
142
  import './debounce-4419bc2f.js';
143
- import './rangeAndSlider-693a3d41.js';
143
+ import './rangeAndSlider-63c5d423.js';
144
144
  import './index-45eafea6.js';
145
145
  import './react-lifecycles-compat.es-6e1f3768.js';
146
146
  import './SuggestionList/index.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@geneui/components",
3
3
  "description": "The Gene UI components library designed for BI tools",
4
- "version": "2.16.0-canary-36aab18-26082024",
4
+ "version": "2.16.0-canary-12a636d-09092024",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {
@@ -251,20 +251,12 @@ var _cof = function (it) {
251
251
  return toString$2.call(it).slice(8, -1);
252
252
  };
253
253
 
254
- var _iobject;
255
- var hasRequired_iobject;
256
-
257
- function require_iobject () {
258
- if (hasRequired_iobject) return _iobject;
259
- hasRequired_iobject = 1;
260
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
261
- var cof = _cof;
262
- // eslint-disable-next-line no-prototype-builtins
263
- _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
264
- return cof(it) == 'String' ? it.split('') : Object(it);
265
- };
266
- return _iobject;
267
- }
254
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
255
+ var cof$2 = _cof;
256
+ // eslint-disable-next-line no-prototype-builtins
257
+ var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
258
+ return cof$2(it) == 'String' ? it.split('') : Object(it);
259
+ };
268
260
 
269
261
  // 7.2.1 RequireObjectCoercible(argument)
270
262
  var _defined = function (it) {
@@ -273,7 +265,7 @@ var _defined = function (it) {
273
265
  };
274
266
 
275
267
  // to indexed object, toObject with fallback for non-array-like ES3 strings
276
- var IObject = require_iobject();
268
+ var IObject = _iobject;
277
269
  var defined$2 = _defined;
278
270
  var _toIobject = function (it) {
279
271
  return IObject(defined$2(it));
@@ -446,7 +438,7 @@ function require_objectAssign () {
446
438
  var gOPS = _objectGops;
447
439
  var pIE = require_objectPie();
448
440
  var toObject = _toObject;
449
- var IObject = require_iobject();
441
+ var IObject = _iobject;
450
442
  var $assign = Object.assign;
451
443
 
452
444
  // should work with symbols and should have deterministic property order (V8 bug)