linear-react-components-ui 1.1.8 → 1.1.10
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/lib/inputs/date/index.js
CHANGED
|
@@ -135,8 +135,10 @@ const DatePicker = props => {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
const setValue = (
|
|
138
|
+
const setValue = function () {
|
|
139
139
|
var _inputRef$current2;
|
|
140
|
+
let valueParam = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
141
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
140
142
|
if (showCalendar && setFocusOnSelect) (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
141
143
|
if (props.onComplete) props.onComplete(e, valueParam);
|
|
142
144
|
if (props.onChange) onInputChange({
|
|
@@ -228,11 +230,11 @@ const DatePicker = props => {
|
|
|
228
230
|
if (onDenied && onDenied.unvisible) return null;
|
|
229
231
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({}, props, {
|
|
230
232
|
value: !valueState ? ' ' : valueState.format(_helpers.PT_BR_FORMAT),
|
|
231
|
-
isDateField: true,
|
|
232
233
|
mask: "00/00/0000",
|
|
233
|
-
onComplete:
|
|
234
|
-
if (
|
|
235
|
-
|
|
234
|
+
onComplete: e => {
|
|
235
|
+
if (e) {
|
|
236
|
+
var _e$target;
|
|
237
|
+
setValue((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.maskedValue, e);
|
|
236
238
|
}
|
|
237
239
|
},
|
|
238
240
|
onBlur: onInputBlur,
|
|
@@ -241,7 +243,7 @@ const DatePicker = props => {
|
|
|
241
243
|
},
|
|
242
244
|
onKeyDown: onInputKeyDown,
|
|
243
245
|
onChange: (e, __, date) => {
|
|
244
|
-
if (date) onInputChange(e,
|
|
246
|
+
if (date) onInputChange(e, e.target.value);
|
|
245
247
|
},
|
|
246
248
|
inputRef: el => {
|
|
247
249
|
inputRef.current = el;
|
|
@@ -48,6 +48,7 @@ declare const getMaskOptions: ({ isDateField, placeholderChar, min, max, lazy, r
|
|
|
48
48
|
placeholderChar: string;
|
|
49
49
|
min: any;
|
|
50
50
|
max: any;
|
|
51
|
+
lazy: boolean | undefined;
|
|
51
52
|
};
|
|
52
53
|
declare function CPFValidation(cpf?: string, returnMessage?: (msg: string) => void): void | "CPF inválido";
|
|
53
54
|
declare function CNPJValidation(cnpj?: string, returnMessage?: (msg: string) => void): void | "CNPJ inválido";
|