indicator-ui 0.0.108 → 0.0.110

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/dist/index.js CHANGED
@@ -9041,6 +9041,11 @@ function DateField({ value, disabled, required, isError, onChange, onFocus, date
9041
9041
  }
9042
9042
  };
9043
9043
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FlexField__WEBPACK_IMPORTED_MODULE_4__.FlexField, { value: dateValue, onChange: handleChange, disabled: disabled, isError: isError, onFocus: onFocus, onBlur: onBlur, mask: dateFormat, blocks: {
9044
+ YYYY: {
9045
+ mask: react_imask__WEBPACK_IMPORTED_MODULE_2__.IMask.MaskedRange,
9046
+ from: minYear, // минимальный год
9047
+ to: maxYear, // максимальный год
9048
+ },
9044
9049
  yyyy: {
9045
9050
  mask: react_imask__WEBPACK_IMPORTED_MODULE_2__.IMask.MaskedRange,
9046
9051
  from: minYear, // минимальный год
@@ -9091,8 +9096,8 @@ __webpack_require__.r(__webpack_exports__);
9091
9096
 
9092
9097
 
9093
9098
  function DateTimeField({ value, fieldConfig = 'datetime', onChange, dateFormat = 'dd.MM.yyyy', timeFormat = 'HH:mm', outFormat = 'iso-8601', additionStyle, ...props }) {
9094
- const isInputDate = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
9095
- const isInputTime = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
9099
+ const isInputDate = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(value != undefined);
9100
+ const isInputTime = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(value != undefined);
9096
9101
  const getDateValue = () => {
9097
9102
  if (value === undefined)
9098
9103
  return undefined;
@@ -9106,9 +9111,11 @@ function DateTimeField({ value, fieldConfig = 'datetime', onChange, dateFormat =
9106
9111
  if (outFormat === 'iso-8601') {
9107
9112
  onChange(newValue.toISOString());
9108
9113
  }
9109
- const res = (0,_lib__WEBPACK_IMPORTED_MODULE_3__.saveFormatDate)(newValue, { to: outFormat });
9110
- if (res != null && typeof res === 'string') {
9111
- onChange(res);
9114
+ else {
9115
+ const res = (0,_lib__WEBPACK_IMPORTED_MODULE_3__.saveFormatDate)(newValue, { to: outFormat });
9116
+ if (res != null && typeof res === 'string') {
9117
+ onChange(res);
9118
+ }
9112
9119
  }
9113
9120
  }
9114
9121
  };
@@ -9657,9 +9664,7 @@ __webpack_require__.r(__webpack_exports__);
9657
9664
  /* harmony import */ var _InputFields__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../InputFields */ "./src/ui/InputFields/index.ts");
9658
9665
 
9659
9666
 
9660
- function InputField({ type, offWrapper,
9661
- // className = InputFieldStyle,
9662
- ...props }) {
9667
+ function InputField({ type, offWrapper, ...props }) {
9663
9668
  const getField = () => {
9664
9669
  switch (type) {
9665
9670
  case 'select':
@@ -9670,6 +9675,12 @@ function InputField({ type, offWrapper,
9670
9675
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.SwitcherField, { ...props });
9671
9676
  case 'textarea':
9672
9677
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.TextareaField, { ...props });
9678
+ case 'date':
9679
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.DateTimeField, { fieldConfig: 'date', ...props });
9680
+ case 'time':
9681
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.DateTimeField, { fieldConfig: 'time', ...props });
9682
+ case 'datetime':
9683
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.DateTimeField, { fieldConfig: 'datetime', ...props });
9673
9684
  default:
9674
9685
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InputFields__WEBPACK_IMPORTED_MODULE_1__.FlexField, { ...props, type: type });
9675
9686
  }