kui-complex 0.0.145 → 0.0.147
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/ButtonSelect/cjs/index.js +1 -1
- package/ButtonSelect/cjs/index.js.map +1 -1
- package/ButtonSelect/index.js +1 -1
- package/ButtonSelect/index.js.map +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
- package/CalendarHeaderWithSelect/index.js +1 -1
- package/CalendarHeaderWithSelect/index.js.map +1 -1
- package/DesktopInputWithMonthPicker/cjs/index.js +11 -8
- package/DesktopInputWithMonthPicker/cjs/index.js.map +1 -1
- package/DesktopInputWithMonthPicker/index.js +13 -10
- package/DesktopInputWithMonthPicker/index.js.map +1 -1
- package/InputSelect/cjs/index.js +1 -1
- package/InputSelect/cjs/index.js.map +1 -1
- package/InputSelect/index.js +1 -1
- package/InputSelect/index.js.map +1 -1
- package/InputSelectWithController/cjs/index.js +1 -1
- package/InputSelectWithController/cjs/index.js.map +1 -1
- package/InputSelectWithController/index.js +1 -1
- package/InputSelectWithController/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +1 -1
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/index.d.ts +1 -1
- package/InputWithDatePicker/index.js +1 -1
- package/InputWithDatePicker/index.js.map +1 -1
- package/InputWithMonthPicker/cjs/index.js +11 -8
- package/InputWithMonthPicker/cjs/index.js.map +1 -1
- package/InputWithMonthPicker/index.js +13 -10
- package/InputWithMonthPicker/index.js.map +1 -1
- package/SelectMonth/cjs/index.js +1 -1
- package/SelectMonth/cjs/index.js.map +1 -1
- package/SelectMonth/index.js +1 -1
- package/SelectMonth/index.js.map +1 -1
- package/SelectYear/cjs/index.js +1 -1
- package/SelectYear/cjs/index.js.map +1 -1
- package/SelectYear/index.js +1 -1
- package/SelectYear/index.js.map +1 -1
- package/cjs/index.js +12 -9
- package/cjs/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +13 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ declare const InputWithDatePicker: React.ForwardRefExoticComponent<Pick<{
|
|
|
189
189
|
} | undefined;
|
|
190
190
|
defaultValue?: Date | undefined;
|
|
191
191
|
name?: string | undefined;
|
|
192
|
-
datePickerProps?: react_datepicker.ReactDatePickerProps<never, undefined
|
|
192
|
+
datePickerProps?: Partial<react_datepicker.ReactDatePickerProps<never, undefined>> | undefined;
|
|
193
193
|
form: any;
|
|
194
194
|
onChange?: ((date: DateTime | null) => void) | undefined;
|
|
195
195
|
footerLabel?: string | undefined;
|
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import classNames from 'classnames';
|
|
|
12
12
|
import { HalfArrowIcon, PrevArrowIcon, NextArrowIcon, CalendarIcon, ArrowBackIcon, ArrowNextIcon, ClosedEyeIcon, OpenEyeIcon, CheckIcon, PlusIcon, FileIcon, EditIcon, TrashIcon } from 'kui-icon';
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
import DatePicker from 'react-datepicker';
|
|
15
|
-
import {
|
|
15
|
+
import { useController, Controller, useWatch } from 'react-hook-form';
|
|
16
16
|
import { scroller, Events, Link as Link$1, animateScroll, Element } from 'react-scroll';
|
|
17
17
|
import { DateTime } from 'luxon';
|
|
18
18
|
import ru from 'date-fns/locale/ru';
|
|
@@ -332,7 +332,7 @@ var InputSelect = forwardRef(function (_a, ref) {
|
|
|
332
332
|
var _b;
|
|
333
333
|
var options = _a.options, name = _a.name, handleChange = _a.handleChange; _a.form; var valueProp = _a.value, inputProps = __rest(_a, ["options", "name", "handleChange", "form", "value"]);
|
|
334
334
|
var _c = useState(valueProp), value = _c[0], setValue = _c[1];
|
|
335
|
-
var selectedLabel = (_b = options.find(function (option) { return String(option.value) === String(value); })) === null || _b === void 0 ? void 0 : _b.label;
|
|
335
|
+
var selectedLabel = ((_b = options.find(function (option) { return String(option.value) === String(value); })) === null || _b === void 0 ? void 0 : _b.label) || "";
|
|
336
336
|
var handleSelect = function (option) {
|
|
337
337
|
setValue(option.value);
|
|
338
338
|
if (handleChange) {
|
|
@@ -441,19 +441,22 @@ var StyledHeader = styled(Grid)(templateObject_2$i || (templateObject_2$i = __ma
|
|
|
441
441
|
var templateObject_1$u, templateObject_2$i;
|
|
442
442
|
|
|
443
443
|
var DesktopInputWithMonthPicker = forwardRef(function (_a, ref) {
|
|
444
|
+
var _b;
|
|
444
445
|
var name = _a.name, form = _a.form, disabled = _a.disabled, datePickerProps = _a.datePickerProps, onChange = _a.onChange, otherProps = __rest(_a, ["name", "form", "disabled", "datePickerProps", "onChange"]);
|
|
445
|
-
var
|
|
446
|
-
var
|
|
446
|
+
var _c = useState(), changedValue = _c[0], setChangedValue = _c[1];
|
|
447
|
+
var _d = useController({
|
|
448
|
+
name: name,
|
|
449
|
+
control: form.control,
|
|
450
|
+
}), field = _d.field, fieldState = _d.fieldState;
|
|
451
|
+
var handleChange = function (date) {
|
|
447
452
|
field.onChange(date);
|
|
448
|
-
setChangedValue(date);
|
|
449
453
|
if (onChange)
|
|
450
454
|
onChange(date);
|
|
451
455
|
};
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
} }) })));
|
|
456
|
+
useEffect(function () {
|
|
457
|
+
setChangedValue(field.value);
|
|
458
|
+
}, [field.value]);
|
|
459
|
+
return (jsx(Wrapper$4, __assign({ ref: ref }, { children: jsx(DatePicker, __assign({ selected: field.value, onChange: handleChange, disabled: disabled, customInput: jsx(InputForDatepicker, __assign({ mask: "00.0000", name: name, disabled: disabled, message: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message }, otherProps), changedValue), showMonthYearPicker: true, dateFormat: "MM.yyyy", popperPlacement: "bottom-end", calendarContainer: MonthPickerContainer, renderCustomHeader: function (props) { return (jsx(MonthPickerHeader, __assign({}, props))); } }, datePickerProps)) })));
|
|
457
460
|
});
|
|
458
461
|
var Wrapper$4 = styled.div(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n @media (max-width: 600px) {\n display: none;\n }\n"], ["\n @media (max-width: 600px) {\n display: none;\n }\n"])));
|
|
459
462
|
var templateObject_1$t;
|