@itcase/ui 1.8.142 → 1.8.144
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_CiH9nFzY.js → DatePicker_cjs_BOPN9WVz.js} +25 -8
- package/dist/{DatePicker_es_DngPNvEg.js → DatePicker_es_-aO8EkK8.js} +25 -8
- package/dist/cjs/components/DatePeriod.js +1 -1
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/components/Response.js +7 -0
- package/dist/cjs/components/Select.js +5 -5
- package/dist/cjs/components/Switch.js +2 -2
- package/dist/components/DatePeriod.js +1 -1
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/Response.js +7 -0
- package/dist/components/Select.js +5 -5
- package/dist/components/Switch.js +2 -2
- package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +1 -0
- package/dist/types/components/Response/Response.constant.d.ts +6 -0
- package/dist/types/components/Select/appearance/selectSize.d.ts +2 -2
- package/package.json +6 -6
|
@@ -94,11 +94,11 @@ const datePickerConfig = {
|
|
|
94
94
|
};
|
|
95
95
|
function DatePickerInput(props) {
|
|
96
96
|
const { className, datePickerProps = {}, endValue, inputProps = {}, value, onChange, } = props;
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(datePickerProps.appearance, datePickerConfig);
|
|
97
|
+
const { appearance, customTimeInput, disablePastDays, monthsShown, selectsRange, showWeekPicker, } = datePickerProps;
|
|
98
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, datePickerConfig);
|
|
100
99
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
101
100
|
const { daySize, dayTextColor, dayTextShape, dayTextSize, iconFill, iconFillHover, iconFillSize, iconItemFill, iconLeft, iconRight, iconShape, monthTextColor, monthTextSize, monthTextWeight, popper, popperPlacement, sizeClass, widthClass, yearTextColor, yearTextSize, yearTextWeight, isClearable, } = propsGenerator;
|
|
101
|
+
const datepickerRef = React.useRef(null);
|
|
102
102
|
const [dateStart, dateEnd] = React.useMemo(() => {
|
|
103
103
|
let dateStart;
|
|
104
104
|
if (value) {
|
|
@@ -126,10 +126,27 @@ function DatePickerInput(props) {
|
|
|
126
126
|
}
|
|
127
127
|
return [dateStart, dateEnd];
|
|
128
128
|
}, [value, endValue]);
|
|
129
|
-
const handleChange = React.useCallback((
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
const handleChange = React.useCallback((selected) => {
|
|
130
|
+
const valuesList = Array.isArray(selected) ? selected : [selected];
|
|
131
|
+
const [selectedDateStart, selectedDateEnd] = valuesList;
|
|
132
|
+
if (selectedDateStart && showWeekPicker) {
|
|
133
|
+
// "getDay" return from 0(sunday) to 6 (saturday).
|
|
134
|
+
// When 0(sunday) - we set as 7(end of week from 1(monday))
|
|
135
|
+
const weekDayIndex = selectedDateStart.getDay() || 7;
|
|
136
|
+
// Collect monday of week from selected date
|
|
137
|
+
const mondayDate = new Date(selectedDateStart);
|
|
138
|
+
mondayDate.setDate(selectedDateStart.getDate() - (weekDayIndex - 1));
|
|
139
|
+
// Collect sunday of week from selected date
|
|
140
|
+
const sundayDate = new Date(mondayDate);
|
|
141
|
+
sundayDate.setDate(mondayDate.getDate() + 6);
|
|
142
|
+
// Selected date can be wednesday, but for week picker
|
|
143
|
+
// we return start and end of selected week.
|
|
144
|
+
onChange(mondayDate, sundayDate);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
onChange(selectedDateStart, selectedDateEnd);
|
|
148
|
+
}
|
|
149
|
+
}, [showWeekPicker, onChange]);
|
|
133
150
|
const renderDayContents = React.useCallback((day, date) => {
|
|
134
151
|
return (jsxRuntime.jsx(Button.Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
135
152
|
}, [daySize, dayTextColor, dayTextShape, dayTextSize]);
|
|
@@ -149,7 +166,7 @@ function DatePickerInput(props) {
|
|
|
149
166
|
yearTextWeight,
|
|
150
167
|
]);
|
|
151
168
|
const { styles: datePickerStyles } = useStyles.useStyles(props);
|
|
152
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && `datepicker_size_${sizeClass}`, widthClass && `datepicker_width_${widthClass}`), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, { ref: datepickerRef, 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-${popper}`, popperPlacement: popperPlacement, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange:
|
|
169
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && `datepicker_size_${sizeClass}`, widthClass && `datepicker_width_${widthClass}`), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, { ref: datepickerRef, 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-${popper}`, popperPlacement: popperPlacement, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: handleChange, ...datePickerProps,
|
|
153
170
|
// Important for use custom clear button
|
|
154
171
|
isClearable: false }) }));
|
|
155
172
|
}
|
|
@@ -92,11 +92,11 @@ const datePickerConfig = {
|
|
|
92
92
|
};
|
|
93
93
|
function DatePickerInput(props) {
|
|
94
94
|
const { className, datePickerProps = {}, endValue, inputProps = {}, value, onChange, } = props;
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const appearanceConfig = useAppearanceConfig(datePickerProps.appearance, datePickerConfig);
|
|
95
|
+
const { appearance, customTimeInput, disablePastDays, monthsShown, selectsRange, showWeekPicker, } = datePickerProps;
|
|
96
|
+
const appearanceConfig = useAppearanceConfig(appearance, datePickerConfig);
|
|
98
97
|
const propsGenerator = useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
99
98
|
const { daySize, dayTextColor, dayTextShape, dayTextSize, iconFill, iconFillHover, iconFillSize, iconItemFill, iconLeft, iconRight, iconShape, monthTextColor, monthTextSize, monthTextWeight, popper, popperPlacement, sizeClass, widthClass, yearTextColor, yearTextSize, yearTextWeight, isClearable, } = propsGenerator;
|
|
99
|
+
const datepickerRef = useRef(null);
|
|
100
100
|
const [dateStart, dateEnd] = useMemo(() => {
|
|
101
101
|
let dateStart;
|
|
102
102
|
if (value) {
|
|
@@ -124,10 +124,27 @@ function DatePickerInput(props) {
|
|
|
124
124
|
}
|
|
125
125
|
return [dateStart, dateEnd];
|
|
126
126
|
}, [value, endValue]);
|
|
127
|
-
const handleChange = useCallback((
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
const handleChange = useCallback((selected) => {
|
|
128
|
+
const valuesList = Array.isArray(selected) ? selected : [selected];
|
|
129
|
+
const [selectedDateStart, selectedDateEnd] = valuesList;
|
|
130
|
+
if (selectedDateStart && showWeekPicker) {
|
|
131
|
+
// "getDay" return from 0(sunday) to 6 (saturday).
|
|
132
|
+
// When 0(sunday) - we set as 7(end of week from 1(monday))
|
|
133
|
+
const weekDayIndex = selectedDateStart.getDay() || 7;
|
|
134
|
+
// Collect monday of week from selected date
|
|
135
|
+
const mondayDate = new Date(selectedDateStart);
|
|
136
|
+
mondayDate.setDate(selectedDateStart.getDate() - (weekDayIndex - 1));
|
|
137
|
+
// Collect sunday of week from selected date
|
|
138
|
+
const sundayDate = new Date(mondayDate);
|
|
139
|
+
sundayDate.setDate(mondayDate.getDate() + 6);
|
|
140
|
+
// Selected date can be wednesday, but for week picker
|
|
141
|
+
// we return start and end of selected week.
|
|
142
|
+
onChange(mondayDate, sundayDate);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
onChange(selectedDateStart, selectedDateEnd);
|
|
146
|
+
}
|
|
147
|
+
}, [showWeekPicker, onChange]);
|
|
131
148
|
const renderDayContents = useCallback((day, date) => {
|
|
132
149
|
return (jsx(Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
133
150
|
}, [daySize, dayTextColor, dayTextShape, dayTextSize]);
|
|
@@ -147,7 +164,7 @@ function DatePickerInput(props) {
|
|
|
147
164
|
yearTextWeight,
|
|
148
165
|
]);
|
|
149
166
|
const { styles: datePickerStyles } = useStyles(props);
|
|
150
|
-
return (jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && `datepicker_size_${sizeClass}`, widthClass && `datepicker_width_${widthClass}`), style: datePickerStyles, children: jsx(DatePicker, { ref: datepickerRef, 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-${popper}`, popperPlacement: popperPlacement, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange:
|
|
167
|
+
return (jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && `datepicker_size_${sizeClass}`, widthClass && `datepicker_width_${widthClass}`), style: datePickerStyles, children: jsx(DatePicker, { ref: datepickerRef, 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-${popper}`, popperPlacement: popperPlacement, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: handleChange, ...datePickerProps,
|
|
151
168
|
// Important for use custom clear button
|
|
152
169
|
isClearable: false }) }));
|
|
153
170
|
}
|
|
@@ -4,7 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var common = require('@itcase/common');
|
|
7
|
-
var DatePicker = require('../../
|
|
7
|
+
var DatePicker = require('../../DatePicker_cjs_BOPN9WVz.js');
|
|
8
8
|
var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
9
9
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
10
10
|
var ChipsGroup = require('../../ChipsGroup_cjs_BNfzAmhc.js');
|
|
@@ -299,6 +299,13 @@ const RESPONSE_MESSAGES = {
|
|
|
299
299
|
secondaryButtonAppearance: 'surfaceSecondary sizeXXL solid rounded',
|
|
300
300
|
secondaryButtonLabel: 'Отмена',
|
|
301
301
|
},
|
|
302
|
+
fail: {
|
|
303
|
+
appearance: 'fail ghost',
|
|
304
|
+
// code: '500',
|
|
305
|
+
imageSrc: index.responseIcon.Fail,
|
|
306
|
+
primaryButtonAppearance: 'surfaceSecondary sizeXXL solid rounded',
|
|
307
|
+
primaryButtonLabel: 'ОК',
|
|
308
|
+
},
|
|
302
309
|
empty: {
|
|
303
310
|
appearance: 'empty ghost',
|
|
304
311
|
title: 'Список пуст',
|
|
@@ -217,8 +217,8 @@ const selectAppearanceShape = {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
const selectAppearanceSize = {
|
|
220
|
-
|
|
221
|
-
size: '
|
|
220
|
+
sizeXL: {
|
|
221
|
+
size: 'xl',
|
|
222
222
|
textLoadingMessageAppearance: 'sizeM',
|
|
223
223
|
badgeSize: 'm',
|
|
224
224
|
badgeTextSize: 'm',
|
|
@@ -236,8 +236,8 @@ const selectAppearanceSize = {
|
|
|
236
236
|
optionTextSize: 'm',
|
|
237
237
|
placeholderTextSize: 'm',
|
|
238
238
|
},
|
|
239
|
-
|
|
240
|
-
size: '
|
|
239
|
+
sizeL: {
|
|
240
|
+
size: 'l',
|
|
241
241
|
textLoadingMessageAppearance: 'sizeM',
|
|
242
242
|
badgeSize: 'm',
|
|
243
243
|
badgeTextSize: 'm',
|
|
@@ -575,7 +575,7 @@ const SelectContainer = React.forwardRef(function SelectContainer(props, ref) {
|
|
|
575
575
|
Placeholder: SelectPlaceholder,
|
|
576
576
|
SingleValue: SelectSingleValue,
|
|
577
577
|
ValueContainer: SelectValueContainer,
|
|
578
|
-
}, defaultValue: defaultValue || initialValue, dividerDirection: dividerDirection, dividerFill: dividerFill, dividerSize: dividerSize, dropdownFillHover: dropdownFillHover, dropdownIcon: dropdownIcon, dropdownIconFill: dropdownIconFill, dropdownIconShape: dropdownIconShape, filterOption: filterOption, groupFill: groupFillClass, groupTextColor: groupTextColorClass, groupTextSize: groupTextSizeClass, groupTextWeight: groupTextWeightClass, hideSelectedOptions: hideSelectedOptions ?? false, inputAfter: inputAfter, inputBefore: inputBefore, inputCaretColor: inputCaretColorClass, inputShape: shapeClass, inputShapeStrength: shapeStrengthClass, inputTextColor: inputTextColorClass, inputTextSize: inputTextSizeClass, instanceId: instanceId, loaderAppearance: loaderAppearance, loadingMessageText: loadingMessageText, loadingMessageTextColor: loadingMessageTextColor, loadingMessageTextSize: loadingMessageTextSize, menuAfter: menuAfter, menuBefore: menuBefore, menuFill: menuFillClass, menuIsOpen: menuIsOpen, menuItemSize: menuItemSize, menuShape: shapeClass, menuShapeStrength: shapeStrengthClass, multipleItemFill: multipleItemFill, multipleItemFillHover: multipleItemFillHover, multipleItemIcon: multipleItemIcon, multipleItemIconFill: multipleItemIconFill, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass && `border-color_${optionBorderClass}`, noOptionBorderType: optionBorderTypeClass && `border_type_${optionBorderTypeClass}`, noOptionsFill: optionFillClass && `fill_${optionFillClass}`, noOptionsSearchText: noOptionsSearchText, noOptionsText: noOptionsText, noOptionsTextColor: noOptionsTextColorClass, noOptionsTextSize: noOptionsTextSizeClass, optionAfter: optionAfter, optionBefore: optionBefore, optionBorder: optionBorderClass, optionBorderType: optionBorderTypeClass, optionFill: optionFillClass, optionFillActive: optionFillActiveClass, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillActiveHover: optionFillActiveHoverClass, optionFillDisabled: optionFillDisabledClass, optionFillHover: optionFillHoverClass, options: options, optionSelectedIcon: optionSelectedIcon, optionSelectedIconFillIcon: optionSelectedIconFillIcon, optionSelectedIconSize: optionSelectedIconSize, optionSelectedIconSrc: optionSelectedIconSrc, optionShape: shapeClass, optionShapeStrength: shapeStrengthClass, optionTextColor: optionTextColorClass, optionTextColorActive: optionTextColorActiveClass, optionTextColorDisabled: optionTextColorDisabled, optionTextSize: optionTextSizeClass, placeholder: placeholder, placeholderTextColor: placeholderTextColor, placeholderTextSize: placeholderTextSize, showBadge: showBadge, showDivider: showDivider, styles: clearStyle, value: value, before: before, after: after, openMenuOnClick: openMenuOnClick, closeMenuOnSelect: closeMenuOnSelect ?? true, isDisabled: isDisabled, isClearable: isClearable ?? false, isLoading: isLoading, isMulti: isMulti, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
578
|
+
}, defaultValue: defaultValue || initialValue, dividerDirection: dividerDirection, dividerFill: dividerFill, dividerSize: dividerSize, dropdownFillHover: dropdownFillHover, dropdownIcon: dropdownIcon, dropdownIconFill: dropdownIconFill, dropdownIconShape: dropdownIconShape, filterOption: filterOption, groupFill: groupFillClass, groupTextColor: groupTextColorClass, groupTextSize: groupTextSizeClass, groupTextWeight: groupTextWeightClass, hideSelectedOptions: hideSelectedOptions ?? false, inputAfter: inputAfter, inputBefore: inputBefore, inputCaretColor: inputCaretColorClass, inputShape: shapeClass, inputShapeStrength: shapeStrengthClass, inputTextColor: inputTextColorClass, inputTextSize: inputTextSizeClass, instanceId: instanceId, loaderAppearance: loaderAppearance, loadingMessageText: loadingMessageText, loadingMessageTextColor: loadingMessageTextColor, loadingMessageTextSize: loadingMessageTextSize, menuAfter: menuAfter, menuBefore: menuBefore, menuFill: menuFillClass, menuIsOpen: menuIsOpen, menuItemSize: menuItemSize, menuShape: shapeClass, menuShapeStrength: shapeStrengthClass, multipleItemFill: multipleItemFill, multipleItemFillHover: multipleItemFillHover, multipleItemIcon: multipleItemIcon, multipleItemIconFill: multipleItemIconFill, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass && `border-color_${optionBorderClass}`, noOptionBorderType: optionBorderTypeClass && `border_type_${optionBorderTypeClass}`, noOptionsFill: optionFillClass && `fill_${optionFillClass}`, noOptionsSearchText: noOptionsSearchText, noOptionsText: noOptionsText, noOptionsTextColor: noOptionsTextColorClass, noOptionsTextSize: noOptionsTextSizeClass, optionAfter: optionAfter, optionBefore: optionBefore, optionBorder: optionBorderClass, optionBorderType: optionBorderTypeClass, optionFill: optionFillClass, optionFillActive: optionFillActiveClass, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillActiveHover: optionFillActiveHoverClass, optionFillDisabled: optionFillDisabledClass, optionFillHover: optionFillHoverClass, options: options, optionSelectedIcon: optionSelectedIcon, optionSelectedIconFillIcon: optionSelectedIconFillIcon, optionSelectedIconSize: optionSelectedIconSize, optionSelectedIconSrc: optionSelectedIconSrc, optionShape: shapeClass, optionShapeStrength: shapeStrengthClass, optionTextColor: optionTextColorClass, optionTextColorActive: optionTextColorActiveClass, optionTextColorDisabled: optionTextColorDisabled, optionTextSize: optionTextSizeClass, placeholder: placeholder, placeholderTextColor: placeholderTextColor, placeholderTextSize: placeholderTextSize, showBadge: showBadge, showDivider: showDivider, styles: clearStyle, value: value, before: before, after: after, openMenuOnClick: openMenuOnClick, closeMenuOnSelect: closeMenuOnSelect ?? true, isDisabled: isDisabled, isClearable: isClearable ?? false, isLoading: isLoading, isMulti: isMulti ?? false, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
579
579
|
});
|
|
580
580
|
|
|
581
581
|
exports.Select = SelectContainer;
|
|
@@ -130,8 +130,8 @@ const Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
130
130
|
const { id, className, appearance, align = 'left', title, desc, isDisabled, isActive, onChange, } = props;
|
|
131
131
|
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, switchConfig, isDisabled);
|
|
132
132
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
133
|
-
const { size, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, fillToggleActiveClass, fillToggleActiveHoverClass, fillToggleClass, fillToggleHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, } = propsGenerator;
|
|
134
|
-
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, align && `switch_align_${align}`, size && `switch_size_${size}`), children: [jsxRuntime.jsxs("div", { className: "switch__wrapper", 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",
|
|
133
|
+
const { size, fillActiveClass, fillActiveHoverClass, fillClass, widthClass, fillHoverClass, fillToggleActiveClass, fillToggleActiveHoverClass, fillToggleClass, fillToggleHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, } = propsGenerator;
|
|
134
|
+
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, widthClass && `width_${widthClass}`, align && `switch_align_${align}`, size && `switch_size_${size}`), children: [jsxRuntime.jsxs("div", { className: "switch__wrapper", 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",
|
|
135
135
|
// @ts-expect-error
|
|
136
136
|
ref: ref, disabled: isDisabled && 'disabled', checked: isActive && 'checked', onChange: onChange }), jsxRuntime.jsx("div", { className: clsx('switch__bg', !isActive
|
|
137
137
|
? fillClass && `fill_${fillClass}`
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
5
|
-
import { D as DatePickerInput } from '../
|
|
5
|
+
import { D as DatePickerInput } from '../DatePicker_es_-aO8EkK8.js';
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_UTiUhYs7.js';
|
|
@@ -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_-aO8EkK8.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -297,6 +297,13 @@ const RESPONSE_MESSAGES = {
|
|
|
297
297
|
secondaryButtonAppearance: 'surfaceSecondary sizeXXL solid rounded',
|
|
298
298
|
secondaryButtonLabel: 'Отмена',
|
|
299
299
|
},
|
|
300
|
+
fail: {
|
|
301
|
+
appearance: 'fail ghost',
|
|
302
|
+
// code: '500',
|
|
303
|
+
imageSrc: responseIcon.Fail,
|
|
304
|
+
primaryButtonAppearance: 'surfaceSecondary sizeXXL solid rounded',
|
|
305
|
+
primaryButtonLabel: 'ОК',
|
|
306
|
+
},
|
|
300
307
|
empty: {
|
|
301
308
|
appearance: 'empty ghost',
|
|
302
309
|
title: 'Список пуст',
|
|
@@ -215,8 +215,8 @@ const selectAppearanceShape = {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
const selectAppearanceSize = {
|
|
218
|
-
|
|
219
|
-
size: '
|
|
218
|
+
sizeXL: {
|
|
219
|
+
size: 'xl',
|
|
220
220
|
textLoadingMessageAppearance: 'sizeM',
|
|
221
221
|
badgeSize: 'm',
|
|
222
222
|
badgeTextSize: 'm',
|
|
@@ -234,8 +234,8 @@ const selectAppearanceSize = {
|
|
|
234
234
|
optionTextSize: 'm',
|
|
235
235
|
placeholderTextSize: 'm',
|
|
236
236
|
},
|
|
237
|
-
|
|
238
|
-
size: '
|
|
237
|
+
sizeL: {
|
|
238
|
+
size: 'l',
|
|
239
239
|
textLoadingMessageAppearance: 'sizeM',
|
|
240
240
|
badgeSize: 'm',
|
|
241
241
|
badgeTextSize: 'm',
|
|
@@ -573,7 +573,7 @@ const SelectContainer = React.forwardRef(function SelectContainer(props, ref) {
|
|
|
573
573
|
Placeholder: SelectPlaceholder,
|
|
574
574
|
SingleValue: SelectSingleValue,
|
|
575
575
|
ValueContainer: SelectValueContainer,
|
|
576
|
-
}, defaultValue: defaultValue || initialValue, dividerDirection: dividerDirection, dividerFill: dividerFill, dividerSize: dividerSize, dropdownFillHover: dropdownFillHover, dropdownIcon: dropdownIcon, dropdownIconFill: dropdownIconFill, dropdownIconShape: dropdownIconShape, filterOption: filterOption, groupFill: groupFillClass, groupTextColor: groupTextColorClass, groupTextSize: groupTextSizeClass, groupTextWeight: groupTextWeightClass, hideSelectedOptions: hideSelectedOptions ?? false, inputAfter: inputAfter, inputBefore: inputBefore, inputCaretColor: inputCaretColorClass, inputShape: shapeClass, inputShapeStrength: shapeStrengthClass, inputTextColor: inputTextColorClass, inputTextSize: inputTextSizeClass, instanceId: instanceId, loaderAppearance: loaderAppearance, loadingMessageText: loadingMessageText, loadingMessageTextColor: loadingMessageTextColor, loadingMessageTextSize: loadingMessageTextSize, menuAfter: menuAfter, menuBefore: menuBefore, menuFill: menuFillClass, menuIsOpen: menuIsOpen, menuItemSize: menuItemSize, menuShape: shapeClass, menuShapeStrength: shapeStrengthClass, multipleItemFill: multipleItemFill, multipleItemFillHover: multipleItemFillHover, multipleItemIcon: multipleItemIcon, multipleItemIconFill: multipleItemIconFill, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass && `border-color_${optionBorderClass}`, noOptionBorderType: optionBorderTypeClass && `border_type_${optionBorderTypeClass}`, noOptionsFill: optionFillClass && `fill_${optionFillClass}`, noOptionsSearchText: noOptionsSearchText, noOptionsText: noOptionsText, noOptionsTextColor: noOptionsTextColorClass, noOptionsTextSize: noOptionsTextSizeClass, optionAfter: optionAfter, optionBefore: optionBefore, optionBorder: optionBorderClass, optionBorderType: optionBorderTypeClass, optionFill: optionFillClass, optionFillActive: optionFillActiveClass, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillActiveHover: optionFillActiveHoverClass, optionFillDisabled: optionFillDisabledClass, optionFillHover: optionFillHoverClass, options: options, optionSelectedIcon: optionSelectedIcon, optionSelectedIconFillIcon: optionSelectedIconFillIcon, optionSelectedIconSize: optionSelectedIconSize, optionSelectedIconSrc: optionSelectedIconSrc, optionShape: shapeClass, optionShapeStrength: shapeStrengthClass, optionTextColor: optionTextColorClass, optionTextColorActive: optionTextColorActiveClass, optionTextColorDisabled: optionTextColorDisabled, optionTextSize: optionTextSizeClass, placeholder: placeholder, placeholderTextColor: placeholderTextColor, placeholderTextSize: placeholderTextSize, showBadge: showBadge, showDivider: showDivider, styles: clearStyle, value: value, before: before, after: after, openMenuOnClick: openMenuOnClick, closeMenuOnSelect: closeMenuOnSelect ?? true, isDisabled: isDisabled, isClearable: isClearable ?? false, isLoading: isLoading, isMulti: isMulti, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
576
|
+
}, defaultValue: defaultValue || initialValue, dividerDirection: dividerDirection, dividerFill: dividerFill, dividerSize: dividerSize, dropdownFillHover: dropdownFillHover, dropdownIcon: dropdownIcon, dropdownIconFill: dropdownIconFill, dropdownIconShape: dropdownIconShape, filterOption: filterOption, groupFill: groupFillClass, groupTextColor: groupTextColorClass, groupTextSize: groupTextSizeClass, groupTextWeight: groupTextWeightClass, hideSelectedOptions: hideSelectedOptions ?? false, inputAfter: inputAfter, inputBefore: inputBefore, inputCaretColor: inputCaretColorClass, inputShape: shapeClass, inputShapeStrength: shapeStrengthClass, inputTextColor: inputTextColorClass, inputTextSize: inputTextSizeClass, instanceId: instanceId, loaderAppearance: loaderAppearance, loadingMessageText: loadingMessageText, loadingMessageTextColor: loadingMessageTextColor, loadingMessageTextSize: loadingMessageTextSize, menuAfter: menuAfter, menuBefore: menuBefore, menuFill: menuFillClass, menuIsOpen: menuIsOpen, menuItemSize: menuItemSize, menuShape: shapeClass, menuShapeStrength: shapeStrengthClass, multipleItemFill: multipleItemFill, multipleItemFillHover: multipleItemFillHover, multipleItemIcon: multipleItemIcon, multipleItemIconFill: multipleItemIconFill, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass && `border-color_${optionBorderClass}`, noOptionBorderType: optionBorderTypeClass && `border_type_${optionBorderTypeClass}`, noOptionsFill: optionFillClass && `fill_${optionFillClass}`, noOptionsSearchText: noOptionsSearchText, noOptionsText: noOptionsText, noOptionsTextColor: noOptionsTextColorClass, noOptionsTextSize: noOptionsTextSizeClass, optionAfter: optionAfter, optionBefore: optionBefore, optionBorder: optionBorderClass, optionBorderType: optionBorderTypeClass, optionFill: optionFillClass, optionFillActive: optionFillActiveClass, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillActiveHover: optionFillActiveHoverClass, optionFillDisabled: optionFillDisabledClass, optionFillHover: optionFillHoverClass, options: options, optionSelectedIcon: optionSelectedIcon, optionSelectedIconFillIcon: optionSelectedIconFillIcon, optionSelectedIconSize: optionSelectedIconSize, optionSelectedIconSrc: optionSelectedIconSrc, optionShape: shapeClass, optionShapeStrength: shapeStrengthClass, optionTextColor: optionTextColorClass, optionTextColorActive: optionTextColorActiveClass, optionTextColorDisabled: optionTextColorDisabled, optionTextSize: optionTextSizeClass, placeholder: placeholder, placeholderTextColor: placeholderTextColor, placeholderTextSize: placeholderTextSize, showBadge: showBadge, showDivider: showDivider, styles: clearStyle, value: value, before: before, after: after, openMenuOnClick: openMenuOnClick, closeMenuOnSelect: closeMenuOnSelect ?? true, isDisabled: isDisabled, isClearable: isClearable ?? false, isLoading: isLoading, isMulti: isMulti ?? false, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
577
577
|
});
|
|
578
578
|
|
|
579
579
|
export { SelectContainer as Select, SelectClearIndicator, SelectControl, SelectDropdownIndicator, SelectGroupHeading, SelectIndicatorsContainer, SelectInput, SelectMenu, SelectMultiValueContainer, SelectMultiValueLabel, SelectMultiValueRemove, SelectOption, SelectPlaceholder, SelectSingleValue, SelectValueContainer, selectConfig };
|
|
@@ -128,8 +128,8 @@ const Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
128
128
|
const { id, className, appearance, align = 'left', title, desc, isDisabled, isActive, onChange, } = props;
|
|
129
129
|
const appearanceConfig = useAppearanceConfig(appearance, switchConfig, isDisabled);
|
|
130
130
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
131
|
-
const { size, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, fillToggleActiveClass, fillToggleActiveHoverClass, fillToggleClass, fillToggleHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, } = propsGenerator;
|
|
132
|
-
return (jsxs("div", { className: clsx('switch', className, align && `switch_align_${align}`, size && `switch_size_${size}`), children: [jsxs("div", { className: "switch__wrapper", 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",
|
|
131
|
+
const { size, fillActiveClass, fillActiveHoverClass, fillClass, widthClass, fillHoverClass, fillToggleActiveClass, fillToggleActiveHoverClass, fillToggleClass, fillToggleHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, } = propsGenerator;
|
|
132
|
+
return (jsxs("div", { className: clsx('switch', className, widthClass && `width_${widthClass}`, align && `switch_align_${align}`, size && `switch_size_${size}`), children: [jsxs("div", { className: "switch__wrapper", 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",
|
|
133
133
|
// @ts-expect-error
|
|
134
134
|
ref: ref, disabled: isDisabled && 'disabled', checked: isActive && 'checked', onChange: onChange }), jsx("div", { className: clsx('switch__bg', !isActive
|
|
135
135
|
? fillClass && `fill_${fillClass}`
|
|
@@ -40,6 +40,12 @@ declare const RESPONSE_MESSAGES: {
|
|
|
40
40
|
secondaryButtonAppearance: string;
|
|
41
41
|
secondaryButtonLabel: string;
|
|
42
42
|
};
|
|
43
|
+
fail: {
|
|
44
|
+
appearance: string;
|
|
45
|
+
imageSrc: any;
|
|
46
|
+
primaryButtonAppearance: string;
|
|
47
|
+
primaryButtonLabel: string;
|
|
48
|
+
};
|
|
43
49
|
empty: {
|
|
44
50
|
appearance: string;
|
|
45
51
|
title: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const selectAppearanceSize: {
|
|
2
|
-
|
|
2
|
+
sizeXL: {
|
|
3
3
|
size: string;
|
|
4
4
|
textLoadingMessageAppearance: string;
|
|
5
5
|
badgeSize: string;
|
|
@@ -18,7 +18,7 @@ declare const selectAppearanceSize: {
|
|
|
18
18
|
optionTextSize: string;
|
|
19
19
|
placeholderTextSize: string;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
sizeL: {
|
|
22
22
|
size: string;
|
|
23
23
|
textLoadingMessageAppearance: string;
|
|
24
24
|
badgeSize: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.144",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -103,17 +103,17 @@
|
|
|
103
103
|
"@emotion/is-prop-valid": "^1.4.0",
|
|
104
104
|
"@itcase/common": "^1.2.32",
|
|
105
105
|
"@itcase/icons": "^1.2.23",
|
|
106
|
-
"@itcase/storybook-config": "^1.2.
|
|
106
|
+
"@itcase/storybook-config": "^1.2.13",
|
|
107
107
|
"@itcase/tokens-am": "^1.1.20",
|
|
108
108
|
"@itcase/tokens-baikal": "^1.1.17",
|
|
109
109
|
"@itcase/tokens-palette": "^1.1.20",
|
|
110
110
|
"clsx": "^2.1.1",
|
|
111
111
|
"date-fns": "^4.1.0",
|
|
112
|
-
"framer-motion": "^12.23.
|
|
112
|
+
"framer-motion": "^12.23.19",
|
|
113
113
|
"js-cookie": "^3.0.5",
|
|
114
114
|
"lodash": "^4.17.21",
|
|
115
115
|
"luxon": "^3.7.2",
|
|
116
|
-
"motion": "^12.23.
|
|
116
|
+
"motion": "^12.23.19",
|
|
117
117
|
"rc-slider": "^11.1.9",
|
|
118
118
|
"react": "^18.3.1",
|
|
119
119
|
"react-dadata": "^2.27.4",
|
|
@@ -171,13 +171,13 @@
|
|
|
171
171
|
"lint-staged": "^16.2.0",
|
|
172
172
|
"prettier": "^3.6.2",
|
|
173
173
|
"react-docgen-typescript": "^2.4.0",
|
|
174
|
-
"rollup": "^4.52.
|
|
174
|
+
"rollup": "^4.52.2",
|
|
175
175
|
"rollup-plugin-copy": "^3.5.0",
|
|
176
176
|
"rollup-plugin-dts": "^6.2.3",
|
|
177
177
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
178
178
|
"rollup-preserve-directives": "^1.1.3",
|
|
179
179
|
"semantic-release": "^24.2.9",
|
|
180
|
-
"storybook": "^9.1.
|
|
180
|
+
"storybook": "^9.1.8",
|
|
181
181
|
"stylelint": "^16.24.0",
|
|
182
182
|
"typescript": "^5.9.2"
|
|
183
183
|
}
|