@itcase/ui 1.2.2 → 1.2.4
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/{Input-C7gBdx1m.js → Input-BSpFMsrf.js} +5 -5
- package/dist/{Input-BQ6Plt1n.js → Input-UkM-ag48.js} +5 -5
- package/dist/cjs/components/Choice.js +13 -13
- package/dist/cjs/components/DadataHintField.js +1 -1
- package/dist/cjs/components/DatePicker.js +15 -13
- package/dist/cjs/components/Input.js +1 -1
- package/dist/components/Choice.js +13 -13
- package/dist/components/DadataHintField.js +1 -1
- package/dist/components/DatePicker.js +15 -13
- package/dist/components/Input.js +1 -1
- package/dist/css/components/Choice/Choice.css +32 -16
- package/dist/css/components/Choice/css/__item/choice__item.css +5 -5
- package/dist/types/components/Accordion/Accordion.interface.d.ts +3 -3
- package/dist/types/components/Choice/Choice.interface.d.ts +9 -8
- package/dist/types/components/DatePicker/DatePicker.interface.d.ts +8 -7
- package/dist/types/components/Input/Input.interface.d.ts +1 -0
- package/dist/types/types/componentProps/sizeInterface.d.ts +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ var inputConfig = {
|
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
var Input = React.forwardRef(function Input(props, ref) {
|
|
20
|
-
var id = props.id, isDisabled = props.isDisabled, appearance = props.appearance, className = props.className, dataTestId = props.dataTestId, index = props.index, name = props.name, placeholder = props.placeholder, state = props.state, type = props.type, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
20
|
+
var id = props.id, isDisabled = props.isDisabled, appearance = props.appearance, autocomplete = props.autocomplete, className = props.className, dataTestId = props.dataTestId, index = props.index, name = props.name, placeholder = props.placeholder, state = props.state, type = props.type, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
21
21
|
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
22
22
|
prefix: 'fill_',
|
|
23
23
|
propsKey: 'fill',
|
|
@@ -85,9 +85,7 @@ var Input = React.forwardRef(function Input(props, ref) {
|
|
|
85
85
|
// prettier-ignore
|
|
86
86
|
var appearanceConfig = (appearance && inputConfig.appearance && inputConfig.appearance[appearance]);
|
|
87
87
|
var stateConfig = state && inputConfig.state && inputConfig.state[state];
|
|
88
|
-
return (jsxRuntime.jsx("input", {
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
index: index, placeholder: placeholder, ref: ref, type: type, value: value, className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || weightClass) && 'text', caretClass, !isDisabled ? fillClass : fillDisabledClass, shapeClass ||
|
|
88
|
+
return (jsxRuntime.jsx("input", { className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || weightClass) && 'text', caretClass, !isDisabled ? fillClass : fillDisabledClass, shapeClass ||
|
|
91
89
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
92
90
|
"input_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), textSizeClass ||
|
|
93
91
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textSize) &&
|
|
@@ -127,7 +125,9 @@ var Input = React.forwardRef(function Input(props, ref) {
|
|
|
127
125
|
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
128
126
|
: textColorDisabledClass ||
|
|
129
127
|
((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.textColor) &&
|
|
130
|
-
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())),
|
|
128
|
+
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())), ref: ref, autocomplete: autocomplete, "data-test-id": dataTestId || (name ? "".concat(name, "Input") : 'input'), disabled: isDisabled, id: String(id),
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
index: index, placeholder: placeholder, type: type, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }));
|
|
131
131
|
});
|
|
132
132
|
Input.defaultProps = {
|
|
133
133
|
size: 'm',
|
|
@@ -15,7 +15,7 @@ var inputConfig = {
|
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
var Input = React.forwardRef(function Input(props, ref) {
|
|
18
|
-
var id = props.id, isDisabled = props.isDisabled, appearance = props.appearance, className = props.className, dataTestId = props.dataTestId, index = props.index, name = props.name, placeholder = props.placeholder, state = props.state, type = props.type, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
18
|
+
var id = props.id, isDisabled = props.isDisabled, appearance = props.appearance, autocomplete = props.autocomplete, className = props.className, dataTestId = props.dataTestId, index = props.index, name = props.name, placeholder = props.placeholder, state = props.state, type = props.type, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
19
19
|
var fillClass = useDeviceTargetClass(props, {
|
|
20
20
|
prefix: 'fill_',
|
|
21
21
|
propsKey: 'fill',
|
|
@@ -83,9 +83,7 @@ var Input = React.forwardRef(function Input(props, ref) {
|
|
|
83
83
|
// prettier-ignore
|
|
84
84
|
var appearanceConfig = (appearance && inputConfig.appearance && inputConfig.appearance[appearance]);
|
|
85
85
|
var stateConfig = state && inputConfig.state && inputConfig.state[state];
|
|
86
|
-
return (jsx("input", {
|
|
87
|
-
// @ts-ignore
|
|
88
|
-
index: index, placeholder: placeholder, ref: ref, type: type, value: value, className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || weightClass) && 'text', caretClass, !isDisabled ? fillClass : fillDisabledClass, shapeClass ||
|
|
86
|
+
return (jsx("input", { className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || weightClass) && 'text', caretClass, !isDisabled ? fillClass : fillDisabledClass, shapeClass ||
|
|
89
87
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
90
88
|
"input_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), textSizeClass ||
|
|
91
89
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textSize) &&
|
|
@@ -125,7 +123,9 @@ var Input = React.forwardRef(function Input(props, ref) {
|
|
|
125
123
|
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
126
124
|
: textColorDisabledClass ||
|
|
127
125
|
((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.textColor) &&
|
|
128
|
-
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())),
|
|
126
|
+
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())), ref: ref, autocomplete: autocomplete, "data-test-id": dataTestId || (name ? "".concat(name, "Input") : 'input'), disabled: isDisabled, id: String(id),
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
index: index, placeholder: placeholder, type: type, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }));
|
|
129
129
|
});
|
|
130
130
|
Input.defaultProps = {
|
|
131
131
|
size: 'm',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-CKiUdo7p.js');
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var clsx = require('clsx');
|
|
@@ -19,7 +20,6 @@ require('lodash/maxBy');
|
|
|
19
20
|
require('lodash/upperFirst');
|
|
20
21
|
require('../hooks/styleAttributes.js');
|
|
21
22
|
require('../../Link-DQxoFKhI.js');
|
|
22
|
-
require('../../tslib.es6-CKiUdo7p.js');
|
|
23
23
|
require('../../Tooltip-DkTKx9n-.js');
|
|
24
24
|
require('../../Title-zwP6c2U2.js');
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ var choiceConfig = {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
var Choice = React.forwardRef(function Choice(props, ref) {
|
|
33
|
-
var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
33
|
+
var gap = props.gap, _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
34
34
|
var controlRef = React.useRef(null);
|
|
35
35
|
var optionsRefs = React.useMemo(function () { return new Map(options.map(function (item) { return [item.value, React.createRef()]; })); }, [options]);
|
|
36
36
|
var onChange = React.useCallback(function (event, item) {
|
|
@@ -75,22 +75,22 @@ var Choice = React.forwardRef(function Choice(props, ref) {
|
|
|
75
75
|
});
|
|
76
76
|
// prettier-ignore
|
|
77
77
|
var appearanceConfig = (appearance && choiceConfig.appearance && choiceConfig.appearance[appearance]);
|
|
78
|
-
return (jsxRuntime.jsx("div", {
|
|
78
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'choice', shapeClass ||
|
|
79
79
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
80
|
-
"choice_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()),
|
|
81
|
-
? fillClass ||
|
|
82
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
83
|
-
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
84
|
-
: fillDisabledClass, borderColorClass ||
|
|
80
|
+
"choice_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), borderColorClass ||
|
|
85
81
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
|
|
86
82
|
"border-color_".concat(appearanceConfig.borderColor)
|
|
87
83
|
.replace(/([A-Z])/g, '-$1')
|
|
88
|
-
.toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), children: isLoading ? (jsxRuntime.jsx(Loader.Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsxRuntime.jsx("div", { className: "choice__wrapper", children: options.map(function (item) { return (jsxRuntime.jsxs("div", {
|
|
84
|
+
.toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsxRuntime.jsx(Loader.Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsxRuntime.jsx("div", { className: "choice__wrapper", style: tslib_es6.__assign({}, (gap && { gap: gap })), children: options.map(function (item) { return (jsxRuntime.jsxs("div", { className: clsx('choice__item', !isDisabled
|
|
85
|
+
? fillClass ||
|
|
86
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
87
|
+
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
88
|
+
: fillDisabledClass, !isDisabled &&
|
|
89
89
|
(fillHoverClass ||
|
|
90
90
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fillHover) &&
|
|
91
|
-
"
|
|
91
|
+
"fill_hover_".concat(appearanceConfig.fillHover)
|
|
92
92
|
.replace(/([A-Z])/g, '-$1')
|
|
93
|
-
.toLowerCase())), item.value !== active.value && isDisabled && 'choice__item_state_disabled', item.value === active.value
|
|
93
|
+
.toLowerCase())), item.value !== (active === null || active === void 0 ? void 0 : active.value) && isDisabled && 'choice__item_state_disabled', item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
94
94
|
? !isDisabled
|
|
95
95
|
? fillActiveClass ||
|
|
96
96
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fillActive) &&
|
|
@@ -100,13 +100,13 @@ var Choice = React.forwardRef(function Choice(props, ref) {
|
|
|
100
100
|
: fillActiveDisabledClass
|
|
101
101
|
: !isDisabled
|
|
102
102
|
? fillClass
|
|
103
|
-
: fillDisabledClass, item.value === active.value && isDisabled && 'choice__item_active_state_disabled', item.value === active.value && 'choice__item_active'), children: [jsxRuntime.jsx("input", { checked: item.value === active
|
|
103
|
+
: fillDisabledClass, item.value === (active === null || active === void 0 ? void 0 : active.value) && isDisabled && 'choice__item_active_state_disabled', item.value === (active === null || active === void 0 ? void 0 : active.value) && 'choice__item_active'), ref: optionsRefs.get(item.value), children: [jsxRuntime.jsx("input", { className: "choice__item-radio", name: name, checked: item.value === (active === null || active === void 0 ? void 0 : active.value), disabled: isDisabled, id: "".concat(name, "-").concat(item.value), type: isCheckbox ? 'checkbox' : 'radio', value: item.value, onChange: function (event) { return onChange(event, item); } }), jsxRuntime.jsxs("label", { className: clsx('choice__item-label', isDisabled && 'choice__item-label_state_disabled'), htmlFor: "".concat(name, "-").concat(item.value), children: [before, item.label && (jsxRuntime.jsx(Text.Text, { size: labelTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextSize), textWeight: labelTextWeight, textColor: item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
104
104
|
? !isDisabled
|
|
105
105
|
? labelTextActiveColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextActiveColor)
|
|
106
106
|
: labelTextActiveColorDisabled
|
|
107
107
|
: !isDisabled
|
|
108
108
|
? labelTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextColor)
|
|
109
|
-
: labelTextColorDisabled, children: item.label })), (icon || activeIcon) && (jsxRuntime.jsx(Icon.Icon, {
|
|
109
|
+
: labelTextColorDisabled, children: item.label })), (icon || activeIcon) && (jsxRuntime.jsx(Icon.Icon, { className: "choice__item-icon", iconFillDisabled: isDisabled ? iconFillDisabled : undefined, iconSize: iconSize, SvgImage: item.value === (active === null || active === void 0 ? void 0 : active.value) ? activeIcon : icon, iconFill: item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
110
110
|
? activeIconItemFill || item.activeIconItemFill
|
|
111
111
|
: iconItemFill || item.iconItemFill })), after] })] }, item.value)); }) })) }));
|
|
112
112
|
});
|
|
@@ -5,7 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var reactDadata = require('react-dadata');
|
|
8
|
-
var Input = require('../../Input-
|
|
8
|
+
var Input = require('../../Input-BSpFMsrf.js');
|
|
9
9
|
require('../hooks/useDeviceTargetClass.js');
|
|
10
10
|
require('lodash/castArray');
|
|
11
11
|
require('lodash/camelCase');
|
|
@@ -6,9 +6,10 @@ var React = require('react');
|
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var DatePicker = require('react-datepicker');
|
|
8
8
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
9
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
9
10
|
var Button = require('../../Button-D4y0v6YL.js');
|
|
10
11
|
var Icon = require('../../Icon-Cq4hPF2D.js');
|
|
11
|
-
var Input = require('../../Input-
|
|
12
|
+
var Input = require('../../Input-BSpFMsrf.js');
|
|
12
13
|
var Label = require('../../Label-CpSzGRtr.js');
|
|
13
14
|
var Text = require('../../Text-_YhyTsQ1.js');
|
|
14
15
|
require('lodash/castArray');
|
|
@@ -17,7 +18,6 @@ require('../context/UIContext.js');
|
|
|
17
18
|
require('prop-types');
|
|
18
19
|
require('../hooks/useMediaQueries.js');
|
|
19
20
|
require('react-responsive');
|
|
20
|
-
require('../hooks/useStyles.js');
|
|
21
21
|
require('lodash/maxBy');
|
|
22
22
|
require('lodash/upperFirst');
|
|
23
23
|
require('../hooks/styleAttributes.js');
|
|
@@ -1071,9 +1071,9 @@ const ru = {
|
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
1073
|
function DatePickerInput(props) {
|
|
1074
|
-
var className = props.className,
|
|
1074
|
+
var className = props.className, clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datePickerProps = props.datePickerProps, endValue = props.endValue, inputProps = props.inputProps, labelTextSize = props.labelTextSize, value = props.value, onChange = props.onChange;
|
|
1075
1075
|
var widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
1076
|
-
prefix: '
|
|
1076
|
+
prefix: 'datepicker_width_',
|
|
1077
1077
|
propsKey: 'width',
|
|
1078
1078
|
});
|
|
1079
1079
|
var datepickerRef = React.useRef(null);
|
|
@@ -1107,7 +1107,7 @@ function DatePickerInput(props) {
|
|
|
1107
1107
|
setEndDate(newEndDate);
|
|
1108
1108
|
}, [onChange]);
|
|
1109
1109
|
var renderDayContents = React.useCallback(function (day, date) {
|
|
1110
|
-
return (jsxRuntime.jsx(Button.Button, { className: "react-datepicker__day-button",
|
|
1110
|
+
return (jsxRuntime.jsx(Button.Button, { className: "react-datepicker__day-button", labelTextColor: datePickerProps.dayTextColor, labelTextSize: datePickerProps.dayTextSize, label: date.getDate().toString(), shape: datePickerProps.dayTextShape, size: datePickerProps.daySize }));
|
|
1111
1111
|
}, [
|
|
1112
1112
|
datePickerProps.daySize,
|
|
1113
1113
|
datePickerProps.dayTextColor,
|
|
@@ -1115,7 +1115,7 @@ function DatePickerInput(props) {
|
|
|
1115
1115
|
datePickerProps.dayTextSize,
|
|
1116
1116
|
]);
|
|
1117
1117
|
var renderCustomHeader = React.useCallback(function (_a) {
|
|
1118
|
-
var
|
|
1118
|
+
var decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, monthDate = _a.monthDate;
|
|
1119
1119
|
return (jsxRuntime.jsxs("div", { className: "react-datepicker__header--div", children: [datePickerProps.iconLeft && (jsxRuntime.jsx(Icon.Icon, { className: "react-datepicker__icon", fill: datePickerProps.iconFill, fillHover: datePickerProps.iconFillHover, fillSize: datePickerProps.iconFillSize, iconFill: datePickerProps.iconItemFill, shape: datePickerProps.iconShape, size: datePickerProps.iconSize, SvgImage: datePickerProps.iconLeft, onClick: decreaseMonth })), jsxRuntime.jsxs("div", { className: "react-datepicker__data", children: [jsxRuntime.jsx(Text.Text, { className: "react-datepicker__month", size: datePickerProps.monthTextSize, textColor: datePickerProps.monthTextColor, textWeight: datePickerProps.monthTextWeight, children: monthDate.toLocaleString('ru-RU', { month: 'long' }) }), jsxRuntime.jsx(Text.Text, { className: "react-datepicker__year", size: datePickerProps.yearTextSize, textColor: datePickerProps.yearTextColor, textWeight: datePickerProps.yearTextWeight, children: monthDate.toLocaleString('ru-RU', { year: 'numeric' }) })] }), datePickerProps.iconRight && (jsxRuntime.jsx(Icon.Icon, { className: "react-datepicker__icon", fill: datePickerProps.iconFill, fillHover: datePickerProps.iconFillHover, fillSize: datePickerProps.iconFillSize, iconFill: datePickerProps.iconItemFill, shape: datePickerProps.iconShape, size: datePickerProps.iconSize, SvgImage: datePickerProps.iconRight, onClick: increaseMonth }))] }));
|
|
1120
1120
|
}, [
|
|
1121
1121
|
datePickerProps.iconFill,
|
|
@@ -1139,12 +1139,14 @@ function DatePickerInput(props) {
|
|
|
1139
1139
|
React.useEffect(function () {
|
|
1140
1140
|
setEndDate(end);
|
|
1141
1141
|
}, [end]);
|
|
1142
|
-
|
|
1142
|
+
// @ts-expect-error
|
|
1143
|
+
var datePickerStyles = useStyles.useStyles(props).styles;
|
|
1144
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.monthsShown) && 'datepicker_type_multiple-months', (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.customTimeInput) && 'datepicker_type_button', widthClass), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, tslib_es6.__assign({ ref: datepickerRef, endDate: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectsRange) ? endDate : undefined, locale: ru, minDate: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.disablePastDays) ? new Date() : undefined, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: startDate, startDate: startDate, customInput: jsxRuntime.jsx(DatePickerCustomInput, { labelTextSize: labelTextSize, clearIcon: clearIcon, clearIconFill: clearIconFill, clearIconFillHover: clearIconFillHover, clearIconFillSize: clearIconFillSize, clearIconItemFill: clearIconItemFill, clearIconItemFillHover: clearIconItemFillHover, clearIconShape: clearIconShape, clearIconSize: clearIconSize, clearIconSrc: clearIconSrc, clearLabel: clearLabel, clearLabelTextColor: clearLabelTextColor, clearLabelTextColorHover: clearLabelTextColorHover, clearLabelTextSize: clearLabelTextSize, datepickerRef: datepickerRef, inputIcon: datePickerProps.inputIcon, inputIconFill: datePickerProps.inputIconFill, inputIconFillHover: datePickerProps.inputIconFillHover, inputIconFillSize: datePickerProps.inputIconFillSize, inputIconItemFill: datePickerProps.inputIconItemFill, inputIconShape: datePickerProps.inputIconShape, inputIconSize: datePickerProps.inputIconSize, inputIconSrc: datePickerProps.inputIconSrc, inputProps: inputProps, isClearable: datePickerProps.isClearable }), popperClassName: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.popper) && "react-datepicker-popper-".concat(datePickerProps.popper), onChange: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectsRange) ? handleChange : onChange }, datePickerProps, {
|
|
1143
1145
|
// Important for use custom clear button
|
|
1144
1146
|
isClearable: false })) }));
|
|
1145
1147
|
}
|
|
1146
1148
|
var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
1147
|
-
var isClearable = props.isClearable,
|
|
1149
|
+
var isClearable = props.isClearable, inputIcon = props.inputIcon, inputProps = props.inputProps, value = props.value;
|
|
1148
1150
|
var multipleValue = React.useMemo(function () {
|
|
1149
1151
|
if (value) {
|
|
1150
1152
|
var twoDates = value.split(' - ');
|
|
@@ -1152,22 +1154,22 @@ var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
|
1152
1154
|
}
|
|
1153
1155
|
return '';
|
|
1154
1156
|
}, [value]);
|
|
1155
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(Input.Input, tslib_es6.__assign({}, props, inputProps, { ref: ref, value: multipleValue })), inputIcon && jsxRuntime.jsx(DatePickerInputIcon, tslib_es6.__assign({}, props)), isClearable && jsxRuntime.jsx(DatePickerClearButton, tslib_es6.__assign({}, props))] }));
|
|
1157
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(Input.Input, tslib_es6.__assign({}, props, inputProps, { ref: ref, autocomplete: "off", value: multipleValue })), inputIcon && jsxRuntime.jsx(DatePickerInputIcon, tslib_es6.__assign({}, props)), isClearable && jsxRuntime.jsx(DatePickerClearButton, tslib_es6.__assign({}, props))] }));
|
|
1156
1158
|
});
|
|
1157
1159
|
DatePickerCustomInput.displayName = 'DatePickerCustomInput';
|
|
1158
1160
|
function DatePickerClearButton(props) {
|
|
1159
|
-
var
|
|
1161
|
+
var clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datepickerRef = props.datepickerRef;
|
|
1160
1162
|
var onClick = React.useCallback(function (event) {
|
|
1161
1163
|
var _a, _b;
|
|
1162
1164
|
(_a = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _a === void 0 ? void 0 : _a.onClearClick(event);
|
|
1163
1165
|
(_b = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _b === void 0 ? void 0 : _b.handleFocus(event);
|
|
1164
1166
|
}, []);
|
|
1165
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [clearLabel && (jsxRuntime.jsx(Label.Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'),
|
|
1167
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [clearLabel && (jsxRuntime.jsx(Label.Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'), labelTextColor: clearLabelTextColor, labelTextSize: clearLabelTextSize, label: clearLabel, labelTextColorHover: clearLabelTextColorHover, onClick: onClick })), (clearIcon || clearIconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: clsx('react-datepicker__clear-icon', 'cursor_type_pointer'), fill: clearIconFill, fillHover: clearIconFillHover, fillSize: clearIconFillSize, iconFill: clearIconItemFill, iconFillHover: clearIconItemFillHover, imageSrc: clearIconSrc, shape: clearIconShape, size: clearIconSize, SvgImage: clearIcon, onClick: onClick }))] }));
|
|
1166
1168
|
}
|
|
1167
1169
|
DatePickerClearButton.displayName = 'DatePickerClearButton';
|
|
1168
1170
|
function DatePickerInputIcon(props) {
|
|
1169
|
-
var inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize,
|
|
1170
|
-
return (jsxRuntime.jsx(Icon.Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, size: inputIconSize, onClick: function () { return onClick && onClick(); }
|
|
1171
|
+
var inputIcon = props.inputIcon, inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize, inputIconItemFill = props.inputIconItemFill, inputIconShape = props.inputIconShape, inputIconSize = props.inputIconSize, inputIconSrc = props.inputIconSrc, onClick = props.onClick;
|
|
1172
|
+
return (jsxRuntime.jsx(Icon.Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, size: inputIconSize, SvgImage: inputIcon, onClick: function () { return onClick && onClick(); } }));
|
|
1171
1173
|
}
|
|
1172
1174
|
DatePickerInputIcon.displayName = 'DatePickerInputIcon';
|
|
1173
1175
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as __assign } from '../tslib.es6-S-VPg1Cw.js';
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import React, { useRef, useMemo, createRef, useCallback } from 'react';
|
|
3
4
|
import clsx from 'clsx';
|
|
@@ -17,7 +18,6 @@ import 'lodash/maxBy';
|
|
|
17
18
|
import 'lodash/upperFirst';
|
|
18
19
|
import '../hooks/styleAttributes.js';
|
|
19
20
|
import '../Link-Bqu5amIb.js';
|
|
20
|
-
import '../tslib.es6-S-VPg1Cw.js';
|
|
21
21
|
import '../Tooltip-DJufHBiQ.js';
|
|
22
22
|
import '../Title-BfSFPJtJ.js';
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ var choiceConfig = {
|
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
var Choice = React.forwardRef(function Choice(props, ref) {
|
|
31
|
-
var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
31
|
+
var gap = props.gap, _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
32
32
|
var controlRef = useRef(null);
|
|
33
33
|
var optionsRefs = useMemo(function () { return new Map(options.map(function (item) { return [item.value, createRef()]; })); }, [options]);
|
|
34
34
|
var onChange = useCallback(function (event, item) {
|
|
@@ -73,22 +73,22 @@ var Choice = React.forwardRef(function Choice(props, ref) {
|
|
|
73
73
|
});
|
|
74
74
|
// prettier-ignore
|
|
75
75
|
var appearanceConfig = (appearance && choiceConfig.appearance && choiceConfig.appearance[appearance]);
|
|
76
|
-
return (jsx("div", {
|
|
76
|
+
return (jsx("div", { className: clsx(className, 'choice', shapeClass ||
|
|
77
77
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
78
|
-
"choice_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()),
|
|
79
|
-
? fillClass ||
|
|
80
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
81
|
-
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
82
|
-
: fillDisabledClass, borderColorClass ||
|
|
78
|
+
"choice_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), borderColorClass ||
|
|
83
79
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
|
|
84
80
|
"border-color_".concat(appearanceConfig.borderColor)
|
|
85
81
|
.replace(/([A-Z])/g, '-$1')
|
|
86
|
-
.toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), children: isLoading ? (jsx(Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsx("div", { className: "choice__wrapper", children: options.map(function (item) { return (jsxs("div", {
|
|
82
|
+
.toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsx(Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsx("div", { className: "choice__wrapper", style: __assign({}, (gap && { gap: gap })), children: options.map(function (item) { return (jsxs("div", { className: clsx('choice__item', !isDisabled
|
|
83
|
+
? fillClass ||
|
|
84
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
85
|
+
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase())
|
|
86
|
+
: fillDisabledClass, !isDisabled &&
|
|
87
87
|
(fillHoverClass ||
|
|
88
88
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fillHover) &&
|
|
89
|
-
"
|
|
89
|
+
"fill_hover_".concat(appearanceConfig.fillHover)
|
|
90
90
|
.replace(/([A-Z])/g, '-$1')
|
|
91
|
-
.toLowerCase())), item.value !== active.value && isDisabled && 'choice__item_state_disabled', item.value === active.value
|
|
91
|
+
.toLowerCase())), item.value !== (active === null || active === void 0 ? void 0 : active.value) && isDisabled && 'choice__item_state_disabled', item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
92
92
|
? !isDisabled
|
|
93
93
|
? fillActiveClass ||
|
|
94
94
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fillActive) &&
|
|
@@ -98,13 +98,13 @@ var Choice = React.forwardRef(function Choice(props, ref) {
|
|
|
98
98
|
: fillActiveDisabledClass
|
|
99
99
|
: !isDisabled
|
|
100
100
|
? fillClass
|
|
101
|
-
: fillDisabledClass, item.value === active.value && isDisabled && 'choice__item_active_state_disabled', item.value === active.value && 'choice__item_active'), children: [jsx("input", { checked: item.value === active
|
|
101
|
+
: fillDisabledClass, item.value === (active === null || active === void 0 ? void 0 : active.value) && isDisabled && 'choice__item_active_state_disabled', item.value === (active === null || active === void 0 ? void 0 : active.value) && 'choice__item_active'), ref: optionsRefs.get(item.value), children: [jsx("input", { className: "choice__item-radio", name: name, checked: item.value === (active === null || active === void 0 ? void 0 : active.value), disabled: isDisabled, id: "".concat(name, "-").concat(item.value), type: isCheckbox ? 'checkbox' : 'radio', value: item.value, onChange: function (event) { return onChange(event, item); } }), jsxs("label", { className: clsx('choice__item-label', isDisabled && 'choice__item-label_state_disabled'), htmlFor: "".concat(name, "-").concat(item.value), children: [before, item.label && (jsx(Text, { size: labelTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextSize), textWeight: labelTextWeight, textColor: item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
102
102
|
? !isDisabled
|
|
103
103
|
? labelTextActiveColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextActiveColor)
|
|
104
104
|
: labelTextActiveColorDisabled
|
|
105
105
|
: !isDisabled
|
|
106
106
|
? labelTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextColor)
|
|
107
|
-
: labelTextColorDisabled, children: item.label })), (icon || activeIcon) && (jsx(Icon, {
|
|
107
|
+
: labelTextColorDisabled, children: item.label })), (icon || activeIcon) && (jsx(Icon, { className: "choice__item-icon", iconFillDisabled: isDisabled ? iconFillDisabled : undefined, iconSize: iconSize, SvgImage: item.value === (active === null || active === void 0 ? void 0 : active.value) ? activeIcon : icon, iconFill: item.value === (active === null || active === void 0 ? void 0 : active.value)
|
|
108
108
|
? activeIconItemFill || item.activeIconItemFill
|
|
109
109
|
: iconItemFill || item.iconItemFill })), after] })] }, item.value)); }) })) }));
|
|
110
110
|
});
|
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { PartySuggestions } from 'react-dadata';
|
|
6
|
-
import { I as Input } from '../Input-
|
|
6
|
+
import { I as Input } from '../Input-UkM-ag48.js';
|
|
7
7
|
import '../hooks/useDeviceTargetClass.js';
|
|
8
8
|
import 'lodash/castArray';
|
|
9
9
|
import 'lodash/camelCase';
|
|
@@ -4,9 +4,10 @@ import React, { useMemo, useCallback, useRef, useState, useEffect } from 'react'
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import DatePicker from 'react-datepicker';
|
|
6
6
|
import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
|
|
7
|
+
import { useStyles } from '../hooks/useStyles.js';
|
|
7
8
|
import { B as Button } from '../Button-BJWuO5uR.js';
|
|
8
9
|
import { I as Icon } from '../Icon-fTLfvlsK.js';
|
|
9
|
-
import { I as Input } from '../Input-
|
|
10
|
+
import { I as Input } from '../Input-UkM-ag48.js';
|
|
10
11
|
import { L as Label } from '../Label-BA_CnRBq.js';
|
|
11
12
|
import { T as Text } from '../Text-CG3xPG27.js';
|
|
12
13
|
import 'lodash/castArray';
|
|
@@ -15,7 +16,6 @@ import '../context/UIContext.js';
|
|
|
15
16
|
import 'prop-types';
|
|
16
17
|
import '../hooks/useMediaQueries.js';
|
|
17
18
|
import 'react-responsive';
|
|
18
|
-
import '../hooks/useStyles.js';
|
|
19
19
|
import 'lodash/maxBy';
|
|
20
20
|
import 'lodash/upperFirst';
|
|
21
21
|
import '../hooks/styleAttributes.js';
|
|
@@ -1069,9 +1069,9 @@ const ru = {
|
|
|
1069
1069
|
};
|
|
1070
1070
|
|
|
1071
1071
|
function DatePickerInput(props) {
|
|
1072
|
-
var className = props.className,
|
|
1072
|
+
var className = props.className, clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datePickerProps = props.datePickerProps, endValue = props.endValue, inputProps = props.inputProps, labelTextSize = props.labelTextSize, value = props.value, onChange = props.onChange;
|
|
1073
1073
|
var widthClass = useDeviceTargetClass(props, {
|
|
1074
|
-
prefix: '
|
|
1074
|
+
prefix: 'datepicker_width_',
|
|
1075
1075
|
propsKey: 'width',
|
|
1076
1076
|
});
|
|
1077
1077
|
var datepickerRef = useRef(null);
|
|
@@ -1105,7 +1105,7 @@ function DatePickerInput(props) {
|
|
|
1105
1105
|
setEndDate(newEndDate);
|
|
1106
1106
|
}, [onChange]);
|
|
1107
1107
|
var renderDayContents = useCallback(function (day, date) {
|
|
1108
|
-
return (jsx(Button, { className: "react-datepicker__day-button",
|
|
1108
|
+
return (jsx(Button, { className: "react-datepicker__day-button", labelTextColor: datePickerProps.dayTextColor, labelTextSize: datePickerProps.dayTextSize, label: date.getDate().toString(), shape: datePickerProps.dayTextShape, size: datePickerProps.daySize }));
|
|
1109
1109
|
}, [
|
|
1110
1110
|
datePickerProps.daySize,
|
|
1111
1111
|
datePickerProps.dayTextColor,
|
|
@@ -1113,7 +1113,7 @@ function DatePickerInput(props) {
|
|
|
1113
1113
|
datePickerProps.dayTextSize,
|
|
1114
1114
|
]);
|
|
1115
1115
|
var renderCustomHeader = useCallback(function (_a) {
|
|
1116
|
-
var
|
|
1116
|
+
var decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, monthDate = _a.monthDate;
|
|
1117
1117
|
return (jsxs("div", { className: "react-datepicker__header--div", children: [datePickerProps.iconLeft && (jsx(Icon, { className: "react-datepicker__icon", fill: datePickerProps.iconFill, fillHover: datePickerProps.iconFillHover, fillSize: datePickerProps.iconFillSize, iconFill: datePickerProps.iconItemFill, shape: datePickerProps.iconShape, size: datePickerProps.iconSize, SvgImage: datePickerProps.iconLeft, onClick: decreaseMonth })), jsxs("div", { className: "react-datepicker__data", children: [jsx(Text, { className: "react-datepicker__month", size: datePickerProps.monthTextSize, textColor: datePickerProps.monthTextColor, textWeight: datePickerProps.monthTextWeight, children: monthDate.toLocaleString('ru-RU', { month: 'long' }) }), jsx(Text, { className: "react-datepicker__year", size: datePickerProps.yearTextSize, textColor: datePickerProps.yearTextColor, textWeight: datePickerProps.yearTextWeight, children: monthDate.toLocaleString('ru-RU', { year: 'numeric' }) })] }), datePickerProps.iconRight && (jsx(Icon, { className: "react-datepicker__icon", fill: datePickerProps.iconFill, fillHover: datePickerProps.iconFillHover, fillSize: datePickerProps.iconFillSize, iconFill: datePickerProps.iconItemFill, shape: datePickerProps.iconShape, size: datePickerProps.iconSize, SvgImage: datePickerProps.iconRight, onClick: increaseMonth }))] }));
|
|
1118
1118
|
}, [
|
|
1119
1119
|
datePickerProps.iconFill,
|
|
@@ -1137,12 +1137,14 @@ function DatePickerInput(props) {
|
|
|
1137
1137
|
useEffect(function () {
|
|
1138
1138
|
setEndDate(end);
|
|
1139
1139
|
}, [end]);
|
|
1140
|
-
|
|
1140
|
+
// @ts-expect-error
|
|
1141
|
+
var datePickerStyles = useStyles(props).styles;
|
|
1142
|
+
return (jsx("div", { className: clsx(className, 'datepicker', (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.monthsShown) && 'datepicker_type_multiple-months', (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.customTimeInput) && 'datepicker_type_button', widthClass), style: datePickerStyles, children: jsx(DatePicker, __assign({ ref: datepickerRef, endDate: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectsRange) ? endDate : undefined, locale: ru, minDate: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.disablePastDays) ? new Date() : undefined, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: startDate, startDate: startDate, customInput: jsx(DatePickerCustomInput, { labelTextSize: labelTextSize, clearIcon: clearIcon, clearIconFill: clearIconFill, clearIconFillHover: clearIconFillHover, clearIconFillSize: clearIconFillSize, clearIconItemFill: clearIconItemFill, clearIconItemFillHover: clearIconItemFillHover, clearIconShape: clearIconShape, clearIconSize: clearIconSize, clearIconSrc: clearIconSrc, clearLabel: clearLabel, clearLabelTextColor: clearLabelTextColor, clearLabelTextColorHover: clearLabelTextColorHover, clearLabelTextSize: clearLabelTextSize, datepickerRef: datepickerRef, inputIcon: datePickerProps.inputIcon, inputIconFill: datePickerProps.inputIconFill, inputIconFillHover: datePickerProps.inputIconFillHover, inputIconFillSize: datePickerProps.inputIconFillSize, inputIconItemFill: datePickerProps.inputIconItemFill, inputIconShape: datePickerProps.inputIconShape, inputIconSize: datePickerProps.inputIconSize, inputIconSrc: datePickerProps.inputIconSrc, inputProps: inputProps, isClearable: datePickerProps.isClearable }), popperClassName: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.popper) && "react-datepicker-popper-".concat(datePickerProps.popper), onChange: (datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectsRange) ? handleChange : onChange }, datePickerProps, {
|
|
1141
1143
|
// Important for use custom clear button
|
|
1142
1144
|
isClearable: false })) }));
|
|
1143
1145
|
}
|
|
1144
1146
|
var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
1145
|
-
var isClearable = props.isClearable,
|
|
1147
|
+
var isClearable = props.isClearable, inputIcon = props.inputIcon, inputProps = props.inputProps, value = props.value;
|
|
1146
1148
|
var multipleValue = useMemo(function () {
|
|
1147
1149
|
if (value) {
|
|
1148
1150
|
var twoDates = value.split(' - ');
|
|
@@ -1150,22 +1152,22 @@ var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
|
1150
1152
|
}
|
|
1151
1153
|
return '';
|
|
1152
1154
|
}, [value]);
|
|
1153
|
-
return (jsxs(React.Fragment, { children: [jsx(Input, __assign({}, props, inputProps, { ref: ref, value: multipleValue })), inputIcon && jsx(DatePickerInputIcon, __assign({}, props)), isClearable && jsx(DatePickerClearButton, __assign({}, props))] }));
|
|
1155
|
+
return (jsxs(React.Fragment, { children: [jsx(Input, __assign({}, props, inputProps, { ref: ref, autocomplete: "off", value: multipleValue })), inputIcon && jsx(DatePickerInputIcon, __assign({}, props)), isClearable && jsx(DatePickerClearButton, __assign({}, props))] }));
|
|
1154
1156
|
});
|
|
1155
1157
|
DatePickerCustomInput.displayName = 'DatePickerCustomInput';
|
|
1156
1158
|
function DatePickerClearButton(props) {
|
|
1157
|
-
var
|
|
1159
|
+
var clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datepickerRef = props.datepickerRef;
|
|
1158
1160
|
var onClick = useCallback(function (event) {
|
|
1159
1161
|
var _a, _b;
|
|
1160
1162
|
(_a = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _a === void 0 ? void 0 : _a.onClearClick(event);
|
|
1161
1163
|
(_b = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _b === void 0 ? void 0 : _b.handleFocus(event);
|
|
1162
1164
|
}, []);
|
|
1163
|
-
return (jsxs(React.Fragment, { children: [clearLabel && (jsx(Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'),
|
|
1165
|
+
return (jsxs(React.Fragment, { children: [clearLabel && (jsx(Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'), labelTextColor: clearLabelTextColor, labelTextSize: clearLabelTextSize, label: clearLabel, labelTextColorHover: clearLabelTextColorHover, onClick: onClick })), (clearIcon || clearIconSrc) && (jsx(Icon, { className: clsx('react-datepicker__clear-icon', 'cursor_type_pointer'), fill: clearIconFill, fillHover: clearIconFillHover, fillSize: clearIconFillSize, iconFill: clearIconItemFill, iconFillHover: clearIconItemFillHover, imageSrc: clearIconSrc, shape: clearIconShape, size: clearIconSize, SvgImage: clearIcon, onClick: onClick }))] }));
|
|
1164
1166
|
}
|
|
1165
1167
|
DatePickerClearButton.displayName = 'DatePickerClearButton';
|
|
1166
1168
|
function DatePickerInputIcon(props) {
|
|
1167
|
-
var inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize,
|
|
1168
|
-
return (jsx(Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, size: inputIconSize, onClick: function () { return onClick && onClick(); }
|
|
1169
|
+
var inputIcon = props.inputIcon, inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize, inputIconItemFill = props.inputIconItemFill, inputIconShape = props.inputIconShape, inputIconSize = props.inputIconSize, inputIconSrc = props.inputIconSrc, onClick = props.onClick;
|
|
1170
|
+
return (jsx(Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, size: inputIconSize, SvgImage: inputIcon, onClick: function () { return onClick && onClick(); } }));
|
|
1169
1171
|
}
|
|
1170
1172
|
DatePickerInputIcon.displayName = 'DatePickerInputIcon';
|
|
1171
1173
|
|
package/dist/components/Input.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
min-width: 30px;
|
|
3
3
|
position: relative;
|
|
4
4
|
display: flex;
|
|
5
|
-
&:hover {
|
|
5
|
+
/* &:hover {
|
|
6
6
|
background: var(--choice-item-background-hover);
|
|
7
|
-
}
|
|
7
|
+
} */
|
|
8
8
|
&:not(:last-child) {
|
|
9
|
-
border-right: 1px solid var(--choice-border-color);
|
|
9
|
+
border-right: var(--chioce-item-border-right, 1px solid var(--choice-border-color));
|
|
10
10
|
}
|
|
11
11
|
&_state_disabled {
|
|
12
|
-
background: var(--choice-item-state-disabled-background, #
|
|
12
|
+
background: var(--choice-item-state-disabled-background, #ececec);
|
|
13
13
|
&:hover {
|
|
14
|
-
background: var(--choice-item-state-disabled-background, #
|
|
14
|
+
background: var(--choice-item-state-disabled-background, #ececec);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
&_active {
|
|
@@ -48,6 +48,33 @@
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
.choice {
|
|
52
|
+
position: relative;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
&__wrapper {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: flex;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.choice {
|
|
62
|
+
&_set {
|
|
63
|
+
&_form {
|
|
64
|
+
^^&__item {
|
|
65
|
+
min-width: auto;
|
|
66
|
+
border: 1px solid var(--color-surface-border-tertiary);
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
&-label {
|
|
69
|
+
flex-direction: row-reverse;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 4px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
51
78
|
.choice {
|
|
52
79
|
&_shape {
|
|
53
80
|
&_rounded {
|
|
@@ -74,18 +101,7 @@
|
|
|
74
101
|
}
|
|
75
102
|
}
|
|
76
103
|
|
|
77
|
-
.choice {
|
|
78
|
-
position: relative;
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
&__wrapper {
|
|
82
|
-
position: relative;
|
|
83
|
-
display: flex;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
104
|
:root {
|
|
88
|
-
|
|
89
105
|
--choice-item-background-hover: var(--color-surface-secondary);
|
|
90
106
|
|
|
91
107
|
--choice-item-background-active: var(--color-surface-active);
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
min-width: 30px;
|
|
3
3
|
position: relative;
|
|
4
4
|
display: flex;
|
|
5
|
-
&:hover {
|
|
5
|
+
/* &:hover {
|
|
6
6
|
background: var(--choice-item-background-hover);
|
|
7
|
-
}
|
|
7
|
+
} */
|
|
8
8
|
&:not(:last-child) {
|
|
9
|
-
border-right: 1px solid var(--choice-border-color);
|
|
9
|
+
border-right: var(--chioce-item-border-right, 1px solid var(--choice-border-color));
|
|
10
10
|
}
|
|
11
11
|
&_state_disabled {
|
|
12
|
-
background: var(--choice-item-state-disabled-background, #
|
|
12
|
+
background: var(--choice-item-state-disabled-background, #ececec);
|
|
13
13
|
&:hover {
|
|
14
|
-
background: var(--choice-item-state-disabled-background, #
|
|
14
|
+
background: var(--choice-item-state-disabled-background, #ececec);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
&_active {
|
|
@@ -10,11 +10,11 @@ interface iAccordionItemEventData {
|
|
|
10
10
|
interface iAccordionProps extends iStyleAttributes {
|
|
11
11
|
borderColor?: tBorderColorProps;
|
|
12
12
|
children?: Element | React.ReactNode;
|
|
13
|
-
className
|
|
13
|
+
className?: string;
|
|
14
14
|
direction?: tDirectionProps;
|
|
15
15
|
fill?: tFillProps;
|
|
16
16
|
height?: tHeightProps;
|
|
17
|
-
initial
|
|
17
|
+
initial?: any;
|
|
18
18
|
items?: {
|
|
19
19
|
id: number | string;
|
|
20
20
|
content?: ReactNode;
|
|
@@ -23,7 +23,7 @@ interface iAccordionProps extends iStyleAttributes {
|
|
|
23
23
|
shape?: tShapeProps;
|
|
24
24
|
style?: CSSProperties;
|
|
25
25
|
width?: tWidthProps;
|
|
26
|
-
isMultiple
|
|
26
|
+
isMultiple?: boolean;
|
|
27
27
|
onClickItem?: (T: iAccordionItemEventData) => void;
|
|
28
28
|
}
|
|
29
29
|
interface iAccordionItemProps extends iStyleAttributes {
|
|
@@ -19,8 +19,8 @@ interface iChoiceThemeColor {
|
|
|
19
19
|
labelTextActiveColorDisabled?: tTextColorProps;
|
|
20
20
|
labelTextColor?: tTextColorProps;
|
|
21
21
|
labelTextColorDisabled?: tTextColorProps;
|
|
22
|
-
labelTextWeight?: tTextWeightProps;
|
|
23
22
|
labelTextSize?: tTextSizeProps;
|
|
23
|
+
labelTextWeight?: tTextWeightProps;
|
|
24
24
|
shape?: tShapeProps;
|
|
25
25
|
}
|
|
26
26
|
type tChoiceAppearance = {
|
|
@@ -31,29 +31,30 @@ interface iChoiceConfig {
|
|
|
31
31
|
setAppearance: (newComponent: tChoiceAppearance) => void;
|
|
32
32
|
}
|
|
33
33
|
interface iChoiceProps extends iChoiceThemeColor, iStyleAttributes {
|
|
34
|
-
appearance?: tAppearanceKeysDefault;
|
|
35
34
|
active: {
|
|
36
35
|
value: ReactNode;
|
|
37
36
|
};
|
|
38
37
|
activeIcon?: ReactNode;
|
|
39
38
|
activeIconItemFill?: tItemColorProps;
|
|
40
39
|
after?: ReactNode;
|
|
40
|
+
appearance?: tAppearanceKeysDefault;
|
|
41
41
|
before?: ReactNode;
|
|
42
42
|
className?: string;
|
|
43
|
+
gap?: string;
|
|
43
44
|
icon?: ReactNode;
|
|
44
|
-
isDisabled?: boolean;
|
|
45
|
-
isCheckbox?: boolean;
|
|
46
|
-
isLoading?: boolean;
|
|
47
45
|
name?: string;
|
|
48
46
|
options: {
|
|
49
|
-
value: string;
|
|
50
|
-
label: ReactNode;
|
|
51
47
|
activeIconItemFill: tItemColorProps;
|
|
52
48
|
iconItemFill: tItemColorProps;
|
|
49
|
+
label: ReactNode;
|
|
50
|
+
value: string;
|
|
53
51
|
}[];
|
|
54
|
-
set?: string;
|
|
55
52
|
size?: sizeOptionPropsType;
|
|
56
53
|
type?: string;
|
|
54
|
+
isCheckbox?: boolean;
|
|
55
|
+
isDisabled?: boolean;
|
|
56
|
+
isLoading?: boolean;
|
|
57
|
+
set?: string;
|
|
57
58
|
setActiveSegment?: (item: any, isChecked?: boolean) => void;
|
|
58
59
|
}
|
|
59
60
|
export type { iChoiceThemeColor, tChoiceAppearance, iChoiceConfig, iChoiceProps };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DatePickerProps } from 'react-datepicker';
|
|
3
|
-
import {
|
|
3
|
+
import { iconFillSizePropsType, iconSizePropsType, tFillHoverProps, tFillProps, tItemColorProps, tShapeProps, tSizeProps, tTextColorHoverProps, tTextColorProps, tTextSizeProps, tTextWeightProps } from '../../types';
|
|
4
4
|
import { iInputProps } from '../Input/Input.interface';
|
|
5
5
|
interface IDatePickerProps extends DatePickerProps {
|
|
6
|
-
daySize?: tSizeProps;
|
|
7
|
-
monthsShown?: boolean;
|
|
8
|
-
isClearable?: boolean;
|
|
9
|
-
selectsRange?: boolean;
|
|
10
6
|
customTimeInput?: ReactNode;
|
|
7
|
+
daySize?: tSizeProps;
|
|
11
8
|
dayTextColor?: tTextColorProps;
|
|
12
9
|
dayTextShape?: tShapeProps;
|
|
13
10
|
dayTextSize?: tTextSizeProps;
|
|
@@ -28,13 +25,17 @@ interface IDatePickerProps extends DatePickerProps {
|
|
|
28
25
|
inputIconShape?: tShapeProps;
|
|
29
26
|
inputIconSize?: iconSizePropsType;
|
|
30
27
|
inputIconSrc?: string;
|
|
31
|
-
|
|
28
|
+
monthsShown?: number;
|
|
32
29
|
monthTextColor?: tTextColorProps;
|
|
33
30
|
monthTextSize?: tTextSizeProps;
|
|
34
31
|
monthTextWeight?: tTextWeightProps;
|
|
32
|
+
popper?: string;
|
|
33
|
+
selectsRange?: boolean;
|
|
35
34
|
yearTextColor?: tTextColorProps;
|
|
36
35
|
yearTextSize?: tTextSizeProps;
|
|
37
36
|
yearTextWeight?: tTextWeightProps;
|
|
37
|
+
isClearable?: boolean;
|
|
38
|
+
isStartDefaultNull?: boolean;
|
|
38
39
|
}
|
|
39
40
|
export interface IDatePickerInputProps {
|
|
40
41
|
className?: string;
|
|
@@ -82,9 +83,9 @@ export interface IDatePickerCustomInput {
|
|
|
82
83
|
inputIconSize?: iconSizePropsType;
|
|
83
84
|
inputIconSrc?: string;
|
|
84
85
|
inputProps?: iInputProps;
|
|
85
|
-
isClearable?: boolean;
|
|
86
86
|
labelTextSize?: tTextSizeProps;
|
|
87
87
|
value?: string;
|
|
88
|
+
isClearable?: boolean;
|
|
88
89
|
}
|
|
89
90
|
export interface IDatePickerInputIcon {
|
|
90
91
|
inputIcon?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type sizeOptionPropsType = 'compact' | 'normal' | 'regular' | '
|
|
1
|
+
export type sizeOptionPropsType = 'any' | 'compact' | 'l' | 'large' | 'm' | 'normal' | 'regular' | 's' | 'tiny' | 'xl' | 'xs' | 'xxl';
|