@itcase/ui 1.8.37 → 1.8.38
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/{DatePicker_cjs_CmqgSNw7.js → DatePicker_cjs_DKoF73mp.js} +14 -14
- package/dist/{DatePicker_es_mk9wFTe9.js → DatePicker_es_CdEYxtwj.js} +14 -14
- package/dist/cjs/components/DatePeriod.js +21 -17
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/components/Notification.js +0 -1
- package/dist/cjs/components/Switch.js +0 -1
- package/dist/components/DatePeriod.js +21 -17
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/Notification.js +0 -1
- package/dist/components/Switch.js +0 -1
- package/package.json +1 -1
|
@@ -100,35 +100,35 @@ function DatePickerInput(props) {
|
|
|
100
100
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
101
101
|
var daySize = propsGenerator.daySize, dayTextColor = propsGenerator.dayTextColor, dayTextShape = propsGenerator.dayTextShape, dayTextSize = propsGenerator.dayTextSize, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconLeft = propsGenerator.iconLeft, iconRight = propsGenerator.iconRight, iconShape = propsGenerator.iconShape, monthTextColor = propsGenerator.monthTextColor, monthTextSize = propsGenerator.monthTextSize, monthTextWeight = propsGenerator.monthTextWeight, popper = propsGenerator.popper, popperPlacement = propsGenerator.popperPlacement, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, yearTextColor = propsGenerator.yearTextColor, yearTextSize = propsGenerator.yearTextSize, yearTextWeight = propsGenerator.yearTextWeight, isClearable = propsGenerator.isClearable;
|
|
102
102
|
var _d = React.useMemo(function () {
|
|
103
|
-
var
|
|
103
|
+
var dateStart;
|
|
104
104
|
if (value) {
|
|
105
105
|
if (typeof value === 'string') {
|
|
106
|
-
|
|
106
|
+
dateStart = new Date(value);
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
|
-
|
|
109
|
+
dateStart = value;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
|
|
113
|
+
dateStart = undefined;
|
|
114
114
|
}
|
|
115
|
-
var
|
|
115
|
+
var dateEnd;
|
|
116
116
|
if (endValue) {
|
|
117
117
|
if (typeof endValue === 'string') {
|
|
118
|
-
|
|
118
|
+
dateEnd = new Date(endValue);
|
|
119
119
|
}
|
|
120
120
|
else {
|
|
121
|
-
|
|
121
|
+
dateEnd = endValue;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
|
-
|
|
125
|
+
dateEnd = undefined;
|
|
126
126
|
}
|
|
127
|
-
return [
|
|
128
|
-
}, [value, endValue]),
|
|
129
|
-
var handleChange = React.useCallback(function (
|
|
130
|
-
var
|
|
131
|
-
onChange(
|
|
127
|
+
return [dateStart, dateEnd];
|
|
128
|
+
}, [value, endValue]), dateStart = _d[0], dateEnd = _d[1];
|
|
129
|
+
var handleChange = React.useCallback(function (valuesList) {
|
|
130
|
+
var newDateStart = valuesList[0], newDateEnd = valuesList[1];
|
|
131
|
+
onChange(newDateStart, newDateEnd);
|
|
132
132
|
}, [onChange]);
|
|
133
133
|
var renderDayContents = React.useCallback(function (day, date) {
|
|
134
134
|
return (jsxRuntime.jsx(Button.Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
@@ -152,7 +152,7 @@ function DatePickerInput(props) {
|
|
|
152
152
|
yearTextWeight,
|
|
153
153
|
]);
|
|
154
154
|
var datePickerStyles = useStyles.useStyles(props).styles;
|
|
155
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, tslib_es6.__assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsxRuntime.jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ?
|
|
155
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, tslib_es6.__assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsxRuntime.jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ? dateEnd : undefined, locale: locale.ru, popperClassName: popper && "react-datepicker-popper-".concat(popper), popperPlacement: popperPlacement, ref: datepickerRef, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: selectsRange ? handleChange : onChange }, datePickerProps, {
|
|
156
156
|
// Important for use custom clear button
|
|
157
157
|
isClearable: false })) }));
|
|
158
158
|
}
|
|
@@ -98,35 +98,35 @@ function DatePickerInput(props) {
|
|
|
98
98
|
var propsGenerator = useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
99
99
|
var daySize = propsGenerator.daySize, dayTextColor = propsGenerator.dayTextColor, dayTextShape = propsGenerator.dayTextShape, dayTextSize = propsGenerator.dayTextSize, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconLeft = propsGenerator.iconLeft, iconRight = propsGenerator.iconRight, iconShape = propsGenerator.iconShape, monthTextColor = propsGenerator.monthTextColor, monthTextSize = propsGenerator.monthTextSize, monthTextWeight = propsGenerator.monthTextWeight, popper = propsGenerator.popper, popperPlacement = propsGenerator.popperPlacement, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, yearTextColor = propsGenerator.yearTextColor, yearTextSize = propsGenerator.yearTextSize, yearTextWeight = propsGenerator.yearTextWeight, isClearable = propsGenerator.isClearable;
|
|
100
100
|
var _d = useMemo(function () {
|
|
101
|
-
var
|
|
101
|
+
var dateStart;
|
|
102
102
|
if (value) {
|
|
103
103
|
if (typeof value === 'string') {
|
|
104
|
-
|
|
104
|
+
dateStart = new Date(value);
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
|
|
107
|
+
dateStart = value;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
|
-
|
|
111
|
+
dateStart = undefined;
|
|
112
112
|
}
|
|
113
|
-
var
|
|
113
|
+
var dateEnd;
|
|
114
114
|
if (endValue) {
|
|
115
115
|
if (typeof endValue === 'string') {
|
|
116
|
-
|
|
116
|
+
dateEnd = new Date(endValue);
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
|
-
|
|
119
|
+
dateEnd = endValue;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
|
|
123
|
+
dateEnd = undefined;
|
|
124
124
|
}
|
|
125
|
-
return [
|
|
126
|
-
}, [value, endValue]),
|
|
127
|
-
var handleChange = useCallback(function (
|
|
128
|
-
var
|
|
129
|
-
onChange(
|
|
125
|
+
return [dateStart, dateEnd];
|
|
126
|
+
}, [value, endValue]), dateStart = _d[0], dateEnd = _d[1];
|
|
127
|
+
var handleChange = useCallback(function (valuesList) {
|
|
128
|
+
var newDateStart = valuesList[0], newDateEnd = valuesList[1];
|
|
129
|
+
onChange(newDateStart, newDateEnd);
|
|
130
130
|
}, [onChange]);
|
|
131
131
|
var renderDayContents = useCallback(function (day, date) {
|
|
132
132
|
return (jsx(Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
@@ -150,7 +150,7 @@ function DatePickerInput(props) {
|
|
|
150
150
|
yearTextWeight,
|
|
151
151
|
]);
|
|
152
152
|
var datePickerStyles = useStyles(props).styles;
|
|
153
|
-
return (jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsx(DatePicker, __assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ?
|
|
153
|
+
return (jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsx(DatePicker, __assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ? dateEnd : undefined, locale: ru, popperClassName: popper && "react-datepicker-popper-".concat(popper), popperPlacement: popperPlacement, ref: datepickerRef, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: selectsRange ? handleChange : onChange }, datePickerProps, {
|
|
154
154
|
// Important for use custom clear button
|
|
155
155
|
isClearable: false })) }));
|
|
156
156
|
}
|
|
@@ -4,9 +4,8 @@ var tslib_es6 = require('../../tslib.es6_cjs_CCZ3TN_7.js');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
|
-
var luxon = require('luxon');
|
|
8
7
|
var common = require('@itcase/common');
|
|
9
|
-
var DatePicker = require('../../
|
|
8
|
+
var DatePicker = require('../../DatePicker_cjs_DKoF73mp.js');
|
|
10
9
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
10
|
var ChipsGroup = require('../../ChipsGroup_cjs_DrOhD-Fc.js');
|
|
12
11
|
require('date-fns/locale');
|
|
@@ -78,7 +77,7 @@ var datePeriodConfig = {
|
|
|
78
77
|
},
|
|
79
78
|
};
|
|
80
79
|
function DatePeriod(props) {
|
|
81
|
-
var className = props.className, appearance = props.appearance, _a = props.datePeriodIntervalsList, datePeriodIntervalsList = _a === void 0 ? Object.values(common.DATE_PERIOD_INTERVALS) : _a, datePeriodValueEnd = props.datePeriodValueEnd, datePeriodValueStart = props.datePeriodValueStart,
|
|
80
|
+
var className = props.className, appearance = props.appearance, _a = props.datePeriodIntervalsList, datePeriodIntervalsList = _a === void 0 ? Object.values(common.DATE_PERIOD_INTERVALS) : _a, datePeriodValueEnd = props.datePeriodValueEnd, datePeriodValueStart = props.datePeriodValueStart, monthsShown = props.monthsShown, isSkeleton = props.isSkeleton, onChangeDatePeriod = props.onChangeDatePeriod, onKeyDown = props.onKeyDown;
|
|
82
81
|
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
83
82
|
var _a;
|
|
84
83
|
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = datePeriodConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
@@ -88,18 +87,7 @@ function DatePeriod(props) {
|
|
|
88
87
|
var onClickPeriodChips = React.useCallback(function (selectedPeriodItem) {
|
|
89
88
|
var dateStartIso = selectedPeriodItem.dateIntervalsList[0];
|
|
90
89
|
var dateEndIso = selectedPeriodItem.dateIntervalsList[1];
|
|
91
|
-
onChangeDatePeriod(dateStartIso, dateEndIso);
|
|
92
|
-
}, [onChangeDatePeriod]);
|
|
93
|
-
var onChangeDatePicker = React.useCallback(function (dateStart, dateEnd) {
|
|
94
|
-
var dateStartIso = null;
|
|
95
|
-
var dateEndIso = null;
|
|
96
|
-
if (dateStart) {
|
|
97
|
-
dateStartIso = luxon.DateTime.fromJSDate(dateStart).toISODate();
|
|
98
|
-
}
|
|
99
|
-
if (dateEnd) {
|
|
100
|
-
dateEndIso = luxon.DateTime.fromJSDate(dateEnd).toISODate();
|
|
101
|
-
}
|
|
102
|
-
onChangeDatePeriod(dateStartIso, dateEndIso);
|
|
90
|
+
onChangeDatePeriod(new Date(dateStartIso), new Date(dateEndIso));
|
|
103
91
|
}, [onChangeDatePeriod]);
|
|
104
92
|
var checkIsChipsActive = React.useCallback(function (targetPeriodItem) {
|
|
105
93
|
var dateStartIso = targetPeriodItem.dateIntervalsList[0];
|
|
@@ -107,14 +95,28 @@ function DatePeriod(props) {
|
|
|
107
95
|
return (dateStartIso === datePeriodValueStart &&
|
|
108
96
|
dateEndIso === datePeriodValueEnd);
|
|
109
97
|
}, [datePeriodValueEnd, datePeriodValueStart]);
|
|
98
|
+
// const onChangeDatePicker = useCallback(
|
|
99
|
+
// (dateStart: Date | null, dateEnd: Date | null) => {
|
|
100
|
+
// let dateStartIso = null
|
|
101
|
+
// let dateEndIso = null
|
|
102
|
+
// if (dateStart) {
|
|
103
|
+
// dateStartIso = DateTime.fromJSDate(dateStart).toISODate()
|
|
104
|
+
// }
|
|
105
|
+
// if (dateEnd) {
|
|
106
|
+
// dateEndIso = DateTime.fromJSDate(dateEnd).toISODate()
|
|
107
|
+
// }
|
|
108
|
+
// onChangeDatePeriod(dateStartIso, dateEndIso)
|
|
109
|
+
// },
|
|
110
|
+
// [onChangeDatePeriod],
|
|
111
|
+
// )
|
|
110
112
|
return (jsxRuntime.jsx("div", { className: clsx(className, 'date-period', shapeClass && "date-period_shape_".concat(shapeClass), sizeClass && "date-period_size_".concat(sizeClass), isSkeleton && "date-period_skeleton", fillClass && "fill_".concat(fillClass), 'cursor_type_pointer'), children: jsxRuntime.jsxs(ChipsGroup.ChipsGroup, { direction: "horizontal", children: [datePeriodIntervalsList.map(function (datePeriodItem) { return (jsxRuntime.jsx(ChipsGroup.Chips, { appearance: "".concat(chipsAppearance, " ").concat(chipsAppearanceSize), label: datePeriodItem.label, shape: chipsShape, isActive: checkIsChipsActive(datePeriodItem), onClick: function () { return onClickPeriodChips(datePeriodItem); } }, datePeriodItem.value)); }), jsxRuntime.jsx(DatePicker.DatePickerInput, { datePickerProps: {
|
|
111
113
|
appearance: "".concat(datePickerAppearance, " ").concat(datePickerAppearanceSize),
|
|
112
114
|
dateFormat: 'dd/MM/yyyy',
|
|
115
|
+
monthsShown: monthsShown,
|
|
113
116
|
selectsRange: true,
|
|
114
117
|
showWeekNumbers: true,
|
|
115
118
|
isClearable: false,
|
|
116
119
|
isStartDefaultNull: true,
|
|
117
|
-
monthsShown: monthsShown,
|
|
118
120
|
onKeyDown: onKeyDown,
|
|
119
121
|
}, endValue: datePeriodValueEnd, inputProps: {
|
|
120
122
|
className: "date-period__datepicker-input date-period__datepicker-input_size_".concat(datePickerInputSize),
|
|
@@ -122,7 +124,9 @@ function DatePeriod(props) {
|
|
|
122
124
|
fillHover: datePickerInputFillHover,
|
|
123
125
|
textSize: datePickerInputTextSize,
|
|
124
126
|
placeholder: 'Выбрать период',
|
|
125
|
-
}, value: datePeriodValueStart,
|
|
127
|
+
}, value: datePeriodValueStart,
|
|
128
|
+
// onChange={onChangeDatePicker}
|
|
129
|
+
onChange: onChangeDatePeriod })] }) }));
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
exports.DatePeriod = DatePeriod;
|
|
@@ -145,7 +145,6 @@ function NotificationWrapper(props) {
|
|
|
145
145
|
var notifications = Notifications.useNotifications();
|
|
146
146
|
var hideNotifications = Notifications.useNotificationsAPI().hideNotifications;
|
|
147
147
|
var className = props.className, close = props.close;
|
|
148
|
-
console.log(notifications);
|
|
149
148
|
return (jsxRuntime.jsx("div", { className: clsx('notification', className), children: jsxRuntime.jsx("div", { className: "notification__wrapper", children: notifications.map(function (notification, i) { return (jsxRuntime.jsx(Notification, { id: notification.id, appearance: notification.appearance, title: notification.title, status: notification.status, text: notification.text, close: close, onClickClose: hideNotifications }, i)); }) }) }));
|
|
150
149
|
}
|
|
151
150
|
|
|
@@ -125,7 +125,6 @@ var Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
125
125
|
}, {});
|
|
126
126
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
127
127
|
var size = propsGenerator.size, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, fillToggleActiveClass = propsGenerator.fillToggleActiveClass, fillToggleActiveHoverClass = propsGenerator.fillToggleActiveHoverClass, fillToggleClass = propsGenerator.fillToggleClass, fillToggleHoverClass = propsGenerator.fillToggleHoverClass, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize;
|
|
128
|
-
console.log(checked);
|
|
129
128
|
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxRuntime.jsxs("div", { className: 'switch__item', children: [jsxRuntime.jsx("input", { id: id, className: "switch__checkbox", type: "checkbox", disabled: disabled, checked: checked || isActive,
|
|
130
129
|
// @ts-expect-error
|
|
131
130
|
ref: ref, onChange: onChange }), jsxRuntime.jsx("div", { className: clsx('switch__bg', !checked
|
|
@@ -2,9 +2,8 @@ import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { DateTime } from 'luxon';
|
|
6
5
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
7
|
-
import { D as DatePickerInput } from '../
|
|
6
|
+
import { D as DatePickerInput } from '../DatePicker_es_CdEYxtwj.js';
|
|
8
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
8
|
import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_B9m4l0wN.js';
|
|
10
9
|
import 'date-fns/locale';
|
|
@@ -76,7 +75,7 @@ var datePeriodConfig = {
|
|
|
76
75
|
},
|
|
77
76
|
};
|
|
78
77
|
function DatePeriod(props) {
|
|
79
|
-
var className = props.className, appearance = props.appearance, _a = props.datePeriodIntervalsList, datePeriodIntervalsList = _a === void 0 ? Object.values(DATE_PERIOD_INTERVALS) : _a, datePeriodValueEnd = props.datePeriodValueEnd, datePeriodValueStart = props.datePeriodValueStart,
|
|
78
|
+
var className = props.className, appearance = props.appearance, _a = props.datePeriodIntervalsList, datePeriodIntervalsList = _a === void 0 ? Object.values(DATE_PERIOD_INTERVALS) : _a, datePeriodValueEnd = props.datePeriodValueEnd, datePeriodValueStart = props.datePeriodValueStart, monthsShown = props.monthsShown, isSkeleton = props.isSkeleton, onChangeDatePeriod = props.onChangeDatePeriod, onKeyDown = props.onKeyDown;
|
|
80
79
|
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
81
80
|
var _a;
|
|
82
81
|
return (__assign(__assign({}, resultConfig), (_a = datePeriodConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
@@ -86,18 +85,7 @@ function DatePeriod(props) {
|
|
|
86
85
|
var onClickPeriodChips = useCallback(function (selectedPeriodItem) {
|
|
87
86
|
var dateStartIso = selectedPeriodItem.dateIntervalsList[0];
|
|
88
87
|
var dateEndIso = selectedPeriodItem.dateIntervalsList[1];
|
|
89
|
-
onChangeDatePeriod(dateStartIso, dateEndIso);
|
|
90
|
-
}, [onChangeDatePeriod]);
|
|
91
|
-
var onChangeDatePicker = useCallback(function (dateStart, dateEnd) {
|
|
92
|
-
var dateStartIso = null;
|
|
93
|
-
var dateEndIso = null;
|
|
94
|
-
if (dateStart) {
|
|
95
|
-
dateStartIso = DateTime.fromJSDate(dateStart).toISODate();
|
|
96
|
-
}
|
|
97
|
-
if (dateEnd) {
|
|
98
|
-
dateEndIso = DateTime.fromJSDate(dateEnd).toISODate();
|
|
99
|
-
}
|
|
100
|
-
onChangeDatePeriod(dateStartIso, dateEndIso);
|
|
88
|
+
onChangeDatePeriod(new Date(dateStartIso), new Date(dateEndIso));
|
|
101
89
|
}, [onChangeDatePeriod]);
|
|
102
90
|
var checkIsChipsActive = useCallback(function (targetPeriodItem) {
|
|
103
91
|
var dateStartIso = targetPeriodItem.dateIntervalsList[0];
|
|
@@ -105,14 +93,28 @@ function DatePeriod(props) {
|
|
|
105
93
|
return (dateStartIso === datePeriodValueStart &&
|
|
106
94
|
dateEndIso === datePeriodValueEnd);
|
|
107
95
|
}, [datePeriodValueEnd, datePeriodValueStart]);
|
|
96
|
+
// const onChangeDatePicker = useCallback(
|
|
97
|
+
// (dateStart: Date | null, dateEnd: Date | null) => {
|
|
98
|
+
// let dateStartIso = null
|
|
99
|
+
// let dateEndIso = null
|
|
100
|
+
// if (dateStart) {
|
|
101
|
+
// dateStartIso = DateTime.fromJSDate(dateStart).toISODate()
|
|
102
|
+
// }
|
|
103
|
+
// if (dateEnd) {
|
|
104
|
+
// dateEndIso = DateTime.fromJSDate(dateEnd).toISODate()
|
|
105
|
+
// }
|
|
106
|
+
// onChangeDatePeriod(dateStartIso, dateEndIso)
|
|
107
|
+
// },
|
|
108
|
+
// [onChangeDatePeriod],
|
|
109
|
+
// )
|
|
108
110
|
return (jsx("div", { className: clsx(className, 'date-period', shapeClass && "date-period_shape_".concat(shapeClass), sizeClass && "date-period_size_".concat(sizeClass), isSkeleton && "date-period_skeleton", fillClass && "fill_".concat(fillClass), 'cursor_type_pointer'), children: jsxs(ChipsGroup, { direction: "horizontal", children: [datePeriodIntervalsList.map(function (datePeriodItem) { return (jsx(Chips, { appearance: "".concat(chipsAppearance, " ").concat(chipsAppearanceSize), label: datePeriodItem.label, shape: chipsShape, isActive: checkIsChipsActive(datePeriodItem), onClick: function () { return onClickPeriodChips(datePeriodItem); } }, datePeriodItem.value)); }), jsx(DatePickerInput, { datePickerProps: {
|
|
109
111
|
appearance: "".concat(datePickerAppearance, " ").concat(datePickerAppearanceSize),
|
|
110
112
|
dateFormat: 'dd/MM/yyyy',
|
|
113
|
+
monthsShown: monthsShown,
|
|
111
114
|
selectsRange: true,
|
|
112
115
|
showWeekNumbers: true,
|
|
113
116
|
isClearable: false,
|
|
114
117
|
isStartDefaultNull: true,
|
|
115
|
-
monthsShown: monthsShown,
|
|
116
118
|
onKeyDown: onKeyDown,
|
|
117
119
|
}, endValue: datePeriodValueEnd, inputProps: {
|
|
118
120
|
className: "date-period__datepicker-input date-period__datepicker-input_size_".concat(datePickerInputSize),
|
|
@@ -120,7 +122,9 @@ function DatePeriod(props) {
|
|
|
120
122
|
fillHover: datePickerInputFillHover,
|
|
121
123
|
textSize: datePickerInputTextSize,
|
|
122
124
|
placeholder: 'Выбрать период',
|
|
123
|
-
}, value: datePeriodValueStart,
|
|
125
|
+
}, value: datePeriodValueStart,
|
|
126
|
+
// onChange={onChangeDatePicker}
|
|
127
|
+
onChange: onChangeDatePeriod })] }) }));
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
export { DatePeriod, datePeriodAppearance, datePeriodConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../
|
|
1
|
+
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_CdEYxtwj.js';
|
|
2
2
|
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -143,7 +143,6 @@ function NotificationWrapper(props) {
|
|
|
143
143
|
var notifications = useNotifications();
|
|
144
144
|
var hideNotifications = useNotificationsAPI().hideNotifications;
|
|
145
145
|
var className = props.className, close = props.close;
|
|
146
|
-
console.log(notifications);
|
|
147
146
|
return (jsx("div", { className: clsx('notification', className), children: jsx("div", { className: "notification__wrapper", children: notifications.map(function (notification, i) { return (jsx(Notification, { id: notification.id, appearance: notification.appearance, title: notification.title, status: notification.status, text: notification.text, close: close, onClickClose: hideNotifications }, i)); }) }) }));
|
|
148
147
|
}
|
|
149
148
|
|
|
@@ -123,7 +123,6 @@ var Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
123
123
|
}, {});
|
|
124
124
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
125
125
|
var size = propsGenerator.size, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, fillToggleActiveClass = propsGenerator.fillToggleActiveClass, fillToggleActiveHoverClass = propsGenerator.fillToggleActiveHoverClass, fillToggleClass = propsGenerator.fillToggleClass, fillToggleHoverClass = propsGenerator.fillToggleHoverClass, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize;
|
|
126
|
-
console.log(checked);
|
|
127
126
|
return (jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsx(Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxs("div", { className: 'switch__item', children: [jsx("input", { id: id, className: "switch__checkbox", type: "checkbox", disabled: disabled, checked: checked || isActive,
|
|
128
127
|
// @ts-expect-error
|
|
129
128
|
ref: ref, onChange: onChange }), jsx("div", { className: clsx('switch__bg', !checked
|