indicator-ui 0.0.109 → 0.0.111
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
|
@@ -8571,8 +8571,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8571
8571
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
8572
8572
|
/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/lib */ "./src/lib/index.ts");
|
|
8573
8573
|
/* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/ui */ "./src/ui/index.ts");
|
|
8574
|
-
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../consts */ "./src/ui/FormBuilder/consts/index.ts");
|
|
8575
|
-
|
|
8576
8574
|
|
|
8577
8575
|
|
|
8578
8576
|
|
|
@@ -8673,6 +8671,10 @@ const getOnChange = (schema, keyWay, additionProps) => {
|
|
|
8673
8671
|
serializeValue ? additionProps.setValue(serializeValue(data), keyWay) : additionProps.setValue(data, keyWay);
|
|
8674
8672
|
};
|
|
8675
8673
|
};
|
|
8674
|
+
const getValueProcess = (schema, keyWay, additionProps) => {
|
|
8675
|
+
const deserializeValue = schema.props.deserializeValue;
|
|
8676
|
+
return deserializeValue ? deserializeValue(additionProps.getValue(keyWay)) : additionProps.getValue(keyWay);
|
|
8677
|
+
};
|
|
8676
8678
|
const inputFieldComponent = (schema, key, additionProps) => {
|
|
8677
8679
|
let onChange = undefined;
|
|
8678
8680
|
let value = undefined;
|
|
@@ -8681,16 +8683,15 @@ const inputFieldComponent = (schema, key, additionProps) => {
|
|
|
8681
8683
|
let onBlur = undefined;
|
|
8682
8684
|
let keyWay = getKeyWay(schema, additionProps);
|
|
8683
8685
|
if (keyWay) {
|
|
8684
|
-
|
|
8685
|
-
value = deserializeValue ? deserializeValue(additionProps.getValue(keyWay)) : additionProps.getValue(keyWay);
|
|
8686
|
+
value = getValueProcess(schema, keyWay, additionProps);
|
|
8686
8687
|
onChange = getOnChange(schema, keyWay, additionProps);
|
|
8687
8688
|
isError = additionProps.isErrorField(keyWay);
|
|
8688
8689
|
isErrorHintText = additionProps.getErrorMessage(keyWay);
|
|
8689
8690
|
onBlur = getOnBlurValidation(schema, additionProps, keyWay);
|
|
8690
8691
|
// Поиск инициализированных полей
|
|
8691
|
-
const initFields = additionProps.getPrivateRefStoreValue(
|
|
8692
|
+
const initFields = additionProps.getPrivateRefStoreValue(_ui__WEBPACK_IMPORTED_MODULE_3__.INIT_FIELDS_NAME) || [];
|
|
8692
8693
|
if (!initFields.find(item => JSON.stringify(item) === JSON.stringify(keyWay))) {
|
|
8693
|
-
additionProps.addPrivateRefStoreValue([...initFields, keyWay],
|
|
8694
|
+
additionProps.addPrivateRefStoreValue([...initFields, keyWay], _ui__WEBPACK_IMPORTED_MODULE_3__.INIT_FIELDS_NAME);
|
|
8694
8695
|
onChange(value !== undefined ? value : schema.props.defaultValue);
|
|
8695
8696
|
}
|
|
8696
8697
|
}
|
|
@@ -9041,6 +9042,11 @@ function DateField({ value, disabled, required, isError, onChange, onFocus, date
|
|
|
9041
9042
|
}
|
|
9042
9043
|
};
|
|
9043
9044
|
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: {
|
|
9045
|
+
YYYY: {
|
|
9046
|
+
mask: react_imask__WEBPACK_IMPORTED_MODULE_2__.IMask.MaskedRange,
|
|
9047
|
+
from: minYear, // минимальный год
|
|
9048
|
+
to: maxYear, // максимальный год
|
|
9049
|
+
},
|
|
9044
9050
|
yyyy: {
|
|
9045
9051
|
mask: react_imask__WEBPACK_IMPORTED_MODULE_2__.IMask.MaskedRange,
|
|
9046
9052
|
from: minYear, // минимальный год
|
|
@@ -9091,8 +9097,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9091
9097
|
|
|
9092
9098
|
|
|
9093
9099
|
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)(
|
|
9095
|
-
const isInputTime = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(
|
|
9100
|
+
const isInputDate = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(value != undefined);
|
|
9101
|
+
const isInputTime = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(value != undefined);
|
|
9096
9102
|
const getDateValue = () => {
|
|
9097
9103
|
if (value === undefined)
|
|
9098
9104
|
return undefined;
|
|
@@ -9106,9 +9112,11 @@ function DateTimeField({ value, fieldConfig = 'datetime', onChange, dateFormat =
|
|
|
9106
9112
|
if (outFormat === 'iso-8601') {
|
|
9107
9113
|
onChange(newValue.toISOString());
|
|
9108
9114
|
}
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9115
|
+
else {
|
|
9116
|
+
const res = (0,_lib__WEBPACK_IMPORTED_MODULE_3__.saveFormatDate)(newValue, { to: outFormat });
|
|
9117
|
+
if (res != null && typeof res === 'string') {
|
|
9118
|
+
onChange(res);
|
|
9119
|
+
}
|
|
9112
9120
|
}
|
|
9113
9121
|
}
|
|
9114
9122
|
};
|