@steroidsjs/bootstrap 3.0.30 → 3.0.32
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/content/Accordion/AccordionItemView.js +0 -1
- package/content/Accordion/AccordionItemView.scss +56 -7
- package/content/Accordion/AccordionView.scss +2 -0
- package/content/Calendar/CalendarView.js +8 -3
- package/content/Calendar/CalendarView.scss +2 -2
- package/form/DateRangeField/DateRangeFieldView.js +10 -1
- package/form/DateRangeField/DateRangeFieldView.scss +54 -0
- package/form/DateRangeField/views/RangeButtons/RangeButtons.d.ts +11 -0
- package/form/DateRangeField/views/RangeButtons/RangeButtons.js +60 -0
- package/form/DateRangeField/views/RangeButtons/RangeButtons.scss +126 -0
- package/form/DateRangeField/views/RangeButtons/consts.d.ts +34 -0
- package/form/DateRangeField/views/RangeButtons/consts.js +71 -0
- package/form/DateRangeField/views/RangeButtons/index.d.ts +2 -0
- package/form/DateRangeField/views/RangeButtons/index.js +7 -0
- package/form/DateRangeField/views/RangeButtons/utils.d.ts +14 -0
- package/form/DateRangeField/views/RangeButtons/utils.js +36 -0
- package/form/DateTimeRangeField/DateTimeRangeFieldView.js +12 -3
- package/form/DateTimeRangeField/DateTimeRangeFieldView.scss +54 -0
- package/form/DropDownField/DropDownFieldView.js +3 -2
- package/form/DropDownField/DropDownFieldView.scss +12 -0
- package/form/InputField/InputFieldView.js +4 -4
- package/form/InputField/InputFieldView.scss +128 -174
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +8 -0
- package/hooks/useHideScroll.d.ts +1 -0
- package/hooks/useHideScroll.js +37 -0
- package/icons/index.js +2 -0
- package/icons/svgs/long-arrow-alt-down.svg +3 -0
- package/icons/svgs/long-arrow-alt-up.svg +3 -0
- package/list/Grid/GridView.js +2 -3
- package/list/Grid/GridView.scss +46 -0
- package/modal/Modal/ModalView.js +3 -1
- package/modal/Modal/ModalView.scss +0 -5
- package/package.json +2 -2
- package/scss/normalize.scss +5 -0
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
@use "../../scss/variables";
|
|
3
3
|
@use '../../scss/mixins';
|
|
4
4
|
|
|
5
|
+
$positions: (
|
|
6
|
+
top: (
|
|
7
|
+
direction: column,
|
|
8
|
+
responsive: top
|
|
9
|
+
),
|
|
10
|
+
bottom: (
|
|
11
|
+
direction: column-reverse,
|
|
12
|
+
responsive: bottom
|
|
13
|
+
),
|
|
14
|
+
left: (
|
|
15
|
+
direction: row,
|
|
16
|
+
responsive: left
|
|
17
|
+
),
|
|
18
|
+
right: (
|
|
19
|
+
direction: row-reverse,
|
|
20
|
+
responsive: right
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
$all-directions: top, bottom, left, right;
|
|
5
25
|
|
|
6
26
|
.DateTimeRangeFieldView {
|
|
7
27
|
$root: &;
|
|
@@ -44,4 +64,38 @@
|
|
|
44
64
|
@include mixins.calendar-border();
|
|
45
65
|
background-color: variables.$element-background-color;
|
|
46
66
|
}
|
|
67
|
+
|
|
68
|
+
&__calendar-wrapper {
|
|
69
|
+
display: flex;
|
|
70
|
+
width: min-content;
|
|
71
|
+
|
|
72
|
+
&_position {
|
|
73
|
+
@each $pos, $config in $positions {
|
|
74
|
+
&_#{$pos} {
|
|
75
|
+
flex-direction: map-get($config, direction);
|
|
76
|
+
align-items: center;
|
|
77
|
+
|
|
78
|
+
@media (max-width: variables.$tablet-width) {
|
|
79
|
+
flex-direction: map-get($config, responsive);
|
|
80
|
+
align-items: center;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
@each $dir1 in $all-directions {
|
|
85
|
+
@each $dir2 in $all-directions {
|
|
86
|
+
@if $dir1 != $dir2 {
|
|
87
|
+
&_#{$dir1}-#{$dir2} {
|
|
88
|
+
flex-direction: map-get(map-get($positions, $dir1), direction);
|
|
89
|
+
align-items: center;
|
|
90
|
+
|
|
91
|
+
@media (max-width: variables.$tablet-width) {
|
|
92
|
+
flex-direction: map-get(map-get($positions, $dir2), direction);
|
|
93
|
+
align-items: center;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
47
101
|
}
|
|
@@ -73,7 +73,8 @@ function DropDownFieldView(props) {
|
|
|
73
73
|
renderPlaceholder(),
|
|
74
74
|
React.createElement("span", { className: bem.element('selected-items') }, props.showEllipses
|
|
75
75
|
? (0, utils_1.getSelectedItemsLabel)(props.selectedItems)
|
|
76
|
-
: (0, utils_1.getSelectedItemsCount)(props.selectedItems))
|
|
76
|
+
: (0, utils_1.getSelectedItemsCount)(props.selectedItems)),
|
|
77
|
+
React.createElement("input", { className: bem.element('input'), ref: props.inputRef })),
|
|
77
78
|
props.showReset && props.selectedIds.length > 0 && (React.createElement(Icon_1["default"], { name: "cross_8x8", className: bem.element('icon-close'), tabIndex: -1, onClick: props.onReset, "aria-label": __('Сбросить') })),
|
|
78
79
|
React.createElement(Icon_1["default"], { name: 'arrow_down_24x24', className: bem.element('icon-chevron'), tabIndex: -1, onClick: props.onOpen }),
|
|
79
80
|
props.isOpened && (React.createElement("div", { className: bem.element('drop-down') },
|
|
@@ -81,7 +82,7 @@ function DropDownFieldView(props) {
|
|
|
81
82
|
size: props.size
|
|
82
83
|
}) },
|
|
83
84
|
React.createElement(Icon_1["default"], { name: 'search', className: bem.element('search-icon') }),
|
|
84
|
-
React.createElement("input", __assign({}, props.searchInputProps, { ref: props.
|
|
85
|
+
React.createElement("input", __assign({}, props.searchInputProps, { ref: props.autoCompleteInputForwardedRef, onChange: function (e) { return props.searchInputProps.onChange(e.target.value); }, className: bem(bem.element('search-input'), props.searchInputProps.className) })))),
|
|
85
86
|
React.createElement("div", { className: bem.element('drop-down-list') },
|
|
86
87
|
props.multiple
|
|
87
88
|
&& props.itemToSelectAll
|
|
@@ -435,4 +435,16 @@ $drop-down-color-themes: map.merge(
|
|
|
435
435
|
border-color: transparent;
|
|
436
436
|
pointer-events: none;
|
|
437
437
|
}
|
|
438
|
+
|
|
439
|
+
&__input {
|
|
440
|
+
position: absolute;
|
|
441
|
+
width: 100%;
|
|
442
|
+
height: 100%;
|
|
443
|
+
top: 0;
|
|
444
|
+
left: 0;
|
|
445
|
+
opacity: 0;
|
|
446
|
+
cursor: default;
|
|
447
|
+
pointer-events: none;
|
|
448
|
+
user-select: none;
|
|
449
|
+
}
|
|
438
450
|
}
|
|
@@ -58,9 +58,9 @@ function InputFieldView(props) {
|
|
|
58
58
|
hasTextAddonBefore: !!props.textBefore,
|
|
59
59
|
hasTextAddonAfter: !!props.textAfter
|
|
60
60
|
}), props.className), style: props.style },
|
|
61
|
-
props.addonBefore && (React.createElement("span", { className: bem.element('addon-before') }, props.addonBefore)),
|
|
62
61
|
props.textBefore && (React.createElement("span", { className: bem.element('text-before') }, props.textBefore)),
|
|
63
62
|
React.createElement("div", { className: bem.element('input-wrapper') },
|
|
63
|
+
props.addonBefore && (React.createElement("span", { className: bem.element('addon-before') }, props.addonBefore)),
|
|
64
64
|
props.leadIcon && (0, renderIcon_1["default"])(props.leadIcon, {
|
|
65
65
|
className: bem.element('lead-icon'),
|
|
66
66
|
tabIndex: -1
|
|
@@ -72,8 +72,8 @@ function InputFieldView(props) {
|
|
|
72
72
|
: (React.createElement("input", __assign({ className: bem(bem.element('input', {
|
|
73
73
|
size: props.size
|
|
74
74
|
})) }, props.inputProps, { type: props.inputProps.type, placeholder: props.placeholder, disabled: props.disabled, required: props.required, id: props.id, ref: props.inputRef }))),
|
|
75
|
-
!props.disabled && props.showClear && !props.maskProps && !!props.inputProps.value && (React.createElement(Icon_1["default"], { name: 'cross_8x8', className: bem.element('icon-clear'), tabIndex: -1, onClick: props.onClear }))
|
|
76
|
-
|
|
77
|
-
props.
|
|
75
|
+
!props.disabled && props.showClear && !props.maskProps && !!props.inputProps.value && (React.createElement(Icon_1["default"], { name: 'cross_8x8', className: bem.element('icon-clear'), tabIndex: -1, onClick: props.onClear })),
|
|
76
|
+
props.addonAfter && (React.createElement("span", { className: bem.element('addon-after') }, props.addonAfter))),
|
|
77
|
+
props.textAfter && (React.createElement("span", { className: bem.element('text-after') }, props.textAfter))));
|
|
78
78
|
}
|
|
79
79
|
exports["default"] = InputFieldView;
|
|
@@ -24,16 +24,74 @@ $lead-icon-disabled-color: var(--lead-icon-disabled-color);
|
|
|
24
24
|
flex-flow: row nowrap;
|
|
25
25
|
align-items: center;
|
|
26
26
|
|
|
27
|
-
height:
|
|
27
|
+
height: var(--input-height);
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
font-family: variables.$font-family-nunito;
|
|
30
31
|
font-weight: variables.$font-weight-sm;
|
|
31
32
|
line-height: 24px;
|
|
32
33
|
|
|
34
|
+
color: variables.$text-color;
|
|
35
|
+
border-radius: var(--border-radius);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
--input-height: #{variables.$input-height-sm};
|
|
39
|
+
|
|
40
|
+
--border-radius: #{variables.$radius-small};
|
|
41
|
+
|
|
42
|
+
--colored-border-radius: 12px;
|
|
43
|
+
|
|
44
|
+
--addon-padding: 5px 8px;
|
|
45
|
+
|
|
46
|
+
--input-font-size: #{variables.$font-size-sm};
|
|
47
|
+
|
|
48
|
+
//Sizes
|
|
49
|
+
&_size {
|
|
50
|
+
&_lg {
|
|
51
|
+
--input-height: #{variables.$input-height-lg};
|
|
52
|
+
--border-radius: #{variables.$radius-large};
|
|
53
|
+
--colored-border-radius: 16px;
|
|
54
|
+
--addon-padding: 16px;
|
|
55
|
+
--input-font-size: #{variables.$font-size-lg};
|
|
56
|
+
--input-border-radius: #{variables.$radius-large};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&_md {
|
|
60
|
+
--input-height: #{variables.$input-height-md};
|
|
61
|
+
--border-radius: #{variables.$radius-large};
|
|
62
|
+
--colored-border-radius: 16px;
|
|
63
|
+
--addon-padding: 11px 12px;
|
|
64
|
+
--input-font-size: #{variables.$font-size-base};
|
|
65
|
+
--input-border-radius: #{variables.$radius-large};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
33
69
|
&__input-wrapper {
|
|
70
|
+
display: flex;
|
|
71
|
+
|
|
34
72
|
position: relative;
|
|
35
73
|
width: 100%;
|
|
36
74
|
height: 100%;
|
|
75
|
+
|
|
76
|
+
&::before {
|
|
77
|
+
content: '';
|
|
78
|
+
position: absolute;
|
|
79
|
+
z-index: 2;
|
|
80
|
+
top: 0;
|
|
81
|
+
left: 0;
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
transform: translate(calc(var(--input-wrapper-border-width) * -1), calc(var(--input-wrapper-border-width) * -1));
|
|
87
|
+
opacity: var(--input-wrapper-border-opacity);
|
|
88
|
+
transition: opacity 150ms ease-in-out;
|
|
89
|
+
|
|
90
|
+
border-radius: var(--colored-border-radius);
|
|
91
|
+
border-width: var(--input-wrapper-border-width);
|
|
92
|
+
border-color: var(--input-wrapper-border-color);
|
|
93
|
+
border-style: solid;
|
|
94
|
+
}
|
|
37
95
|
}
|
|
38
96
|
|
|
39
97
|
&__input {
|
|
@@ -47,170 +105,34 @@ $lead-icon-disabled-color: var(--lead-icon-disabled-color);
|
|
|
47
105
|
outline: none;
|
|
48
106
|
|
|
49
107
|
background-color: variables.$element-field-background-color;
|
|
50
|
-
border:
|
|
51
|
-
border-
|
|
108
|
+
border-width: var(--input-border-width);
|
|
109
|
+
border-color: var(--input-border-color);
|
|
110
|
+
border-top-left-radius: var(--input-left-border-radius);
|
|
111
|
+
border-bottom-left-radius: var(--input-left-border-radius);
|
|
112
|
+
border-top-right-radius: var(--input-right-border-radius);
|
|
113
|
+
border-bottom-right-radius: var(--input-right-border-radius);
|
|
114
|
+
border-style: solid;
|
|
52
115
|
|
|
53
116
|
white-space: nowrap; /* Запретить перенос текста */
|
|
54
117
|
overflow: hidden; /* Скрыть содержимое, выходящее за границы ячейки */
|
|
55
118
|
text-overflow: ellipsis; /* Добавить многоточие, если текст обрезается */
|
|
56
119
|
|
|
120
|
+
font-size: var(--input-font-size);
|
|
121
|
+
|
|
57
122
|
&::placeholder {
|
|
58
123
|
color: variables.$element-placeholder-color;
|
|
59
124
|
font-size: inherit;
|
|
60
125
|
}
|
|
61
126
|
|
|
62
|
-
&:not(:disabled):focus {
|
|
63
|
-
border-color: transparent;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//Statements
|
|
68
|
-
&::before {
|
|
69
|
-
content: '';
|
|
70
|
-
position: absolute;
|
|
71
|
-
z-index: 2;
|
|
72
|
-
top: 0;
|
|
73
|
-
left: 0;
|
|
74
|
-
width: 100%;
|
|
75
|
-
height: 100%;
|
|
76
|
-
|
|
77
|
-
pointer-events: none;
|
|
78
|
-
transform: translate(-1px, -1px);
|
|
79
|
-
opacity: 0;
|
|
80
|
-
transition: opacity 150ms ease-in-out;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&:not(#{$root}_disabled):focus-within::before {
|
|
84
|
-
border: 4px solid variables.$primary-light;
|
|
85
|
-
transform: translateX(-4px) translateY(-4px);
|
|
86
|
-
opacity: 1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&:not(#{$root}_disabled):active {
|
|
90
|
-
#{$root}__input {
|
|
91
|
-
border-color: transparent;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&::before {
|
|
95
|
-
transform: translate(-1px, -1px);
|
|
96
|
-
border: 1px solid variables.$primary;
|
|
97
|
-
opacity: 1;
|
|
98
|
-
}
|
|
99
127
|
}
|
|
100
128
|
|
|
101
129
|
&_disabled {
|
|
102
130
|
#{$root}__input {
|
|
103
131
|
background-color: variables.$element-background-color-disabled;
|
|
104
|
-
border-color: transparent;
|
|
105
132
|
cursor: not-allowed;
|
|
106
133
|
}
|
|
107
134
|
}
|
|
108
135
|
|
|
109
|
-
&_hasError {
|
|
110
|
-
#{$root}__input {
|
|
111
|
-
border-color: transparent;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
&::before {
|
|
116
|
-
border: 1px solid variables.$danger;
|
|
117
|
-
border-radius: 16px;
|
|
118
|
-
transform: translateX(-1px) translateY(-1px);
|
|
119
|
-
opacity: 1;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
//Sizes
|
|
124
|
-
&_size {
|
|
125
|
-
&_lg {
|
|
126
|
-
color: variables.$text-color;
|
|
127
|
-
height: variables.$input-height-lg;
|
|
128
|
-
border-radius: variables.$radius-large;
|
|
129
|
-
|
|
130
|
-
#{$root}__input {
|
|
131
|
-
font-size: variables.$font-size-lg;
|
|
132
|
-
border-radius: variables.$radius-large;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
#{$root}__addon-before,
|
|
136
|
-
#{$root}__addon-after {
|
|
137
|
-
padding: 16px;
|
|
138
|
-
}
|
|
139
|
-
#{$root}__text-before,
|
|
140
|
-
#{$root}__text-after {
|
|
141
|
-
padding: 16px 3px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&::before {
|
|
145
|
-
border-radius: variables.$radius-large;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&:focus-within::before {
|
|
149
|
-
border-radius: 16px;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&_md {
|
|
154
|
-
color: variables.$text-color;
|
|
155
|
-
height: variables.$input-height-md;
|
|
156
|
-
border-radius: variables.$radius-large;
|
|
157
|
-
|
|
158
|
-
#{$root}__input {
|
|
159
|
-
border-radius: variables.$radius-large;
|
|
160
|
-
font-size: variables.$font-size-base;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
#{$root}__addon-before,
|
|
164
|
-
#{$root}__addon-after,
|
|
165
|
-
#{$root}__text-before,
|
|
166
|
-
#{$root}__text-after {
|
|
167
|
-
padding: 11px 12px;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
#{$root}__text-before,
|
|
171
|
-
#{$root}__text-after {
|
|
172
|
-
padding: 11px 3px;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
&::before {
|
|
176
|
-
border-radius: variables.$radius-medium;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
&:focus-within::before {
|
|
180
|
-
border-radius: 16px;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
&_sm {
|
|
185
|
-
color: variables.$text-color;
|
|
186
|
-
height: variables.$input-height-sm;
|
|
187
|
-
border-radius: variables.$radius-small;
|
|
188
|
-
|
|
189
|
-
#{$root}__input {
|
|
190
|
-
font-size: variables.$font-size-sm;
|
|
191
|
-
border-radius: variables.$radius-small;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
#{$root}__addon-before,
|
|
195
|
-
#{$root}__addon-after {
|
|
196
|
-
padding: 5px 8px;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
#{$root}__text-before,
|
|
200
|
-
#{$root}__text-after {
|
|
201
|
-
padding: 5px 3px;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&::before {
|
|
205
|
-
border-radius: variables.$radius-small;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&:focus-within::before {
|
|
209
|
-
border-radius: 12px;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
136
|
//LEAD ICON
|
|
215
137
|
&_hasLeadIcon {
|
|
216
138
|
#{$root}__input {
|
|
@@ -279,49 +201,81 @@ $lead-icon-disabled-color: var(--lead-icon-disabled-color);
|
|
|
279
201
|
}
|
|
280
202
|
}
|
|
281
203
|
|
|
282
|
-
&_hasAddonBefore {
|
|
283
|
-
#{$root}__input {
|
|
284
|
-
border-top-left-radius: 0;
|
|
285
|
-
border-bottom-left-radius: 0;
|
|
286
|
-
border: none;
|
|
287
|
-
}
|
|
288
|
-
&::before {
|
|
289
|
-
border: 1px solid variables.$element-border-color;
|
|
290
|
-
opacity: 1;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
&_hasAddonAfter {
|
|
295
|
-
#{$root}__input {
|
|
296
|
-
border-top-right-radius: 0;
|
|
297
|
-
border-bottom-right-radius: 0;
|
|
298
|
-
}
|
|
299
|
-
&::before {
|
|
300
|
-
border: 1px solid variables.$element-border-color;
|
|
301
|
-
opacity: 1;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
204
|
&__text-before,
|
|
306
205
|
&__text-after {
|
|
307
206
|
flex-shrink: 0;
|
|
207
|
+
padding: 0 6px;
|
|
308
208
|
}
|
|
309
209
|
|
|
310
210
|
&__addon-before,
|
|
311
211
|
&__addon-after {
|
|
312
212
|
flex-shrink: 0;
|
|
313
|
-
padding:
|
|
213
|
+
padding: var(--addon-padding);
|
|
314
214
|
background-color: variables.$element-background-color-disabled;
|
|
315
215
|
color: variables.$text-color;
|
|
316
216
|
}
|
|
317
217
|
|
|
218
|
+
// BORDERS
|
|
219
|
+
--input-border-radius: #{variables.$radius-small};
|
|
220
|
+
--input-border-width: 1px;
|
|
221
|
+
--input-border-color: #{variables.$element-border-color};
|
|
222
|
+
--input-left-border-radius: var(--input-border-radius);
|
|
223
|
+
--input-right-border-radius: var(--input-border-radius);
|
|
224
|
+
|
|
225
|
+
--input-wrapper-border-width: 1px;
|
|
226
|
+
--input-wrapper-border-color: transparent;
|
|
227
|
+
--input-wrapper-border-opacity: 0;
|
|
228
|
+
|
|
229
|
+
&_hasError {
|
|
230
|
+
--input-wrapper-border-width: 1px;
|
|
231
|
+
--input-wrapper-border-color: #{variables.$danger};
|
|
232
|
+
--input-wrapper-border-opacity: 1;
|
|
233
|
+
|
|
234
|
+
--input-border-color: transparent;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&_hasAddon {
|
|
238
|
+
--input-wrapper-border-width: 1px;
|
|
239
|
+
--input-wrapper-border-color: #{variables.$element-border-color};
|
|
240
|
+
--input-wrapper-border-opacity: 1;
|
|
241
|
+
|
|
242
|
+
--input-border-width: 0px;
|
|
243
|
+
}
|
|
244
|
+
&_hasAddonBefore {
|
|
245
|
+
--input-left-border-radius: 0;
|
|
246
|
+
}
|
|
247
|
+
&_hasAddonAfter {
|
|
248
|
+
--input-right-border-radius: 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&:not(&_disabled) {
|
|
252
|
+
&:focus-within {
|
|
253
|
+
--input-wrapper-border-width: 4px;
|
|
254
|
+
--input-wrapper-border-color: #{variables.$primary-light};
|
|
255
|
+
--input-wrapper-border-opacity: 1;
|
|
256
|
+
|
|
257
|
+
--input-border-color: transparent;
|
|
258
|
+
}
|
|
259
|
+
&:active {
|
|
260
|
+
--input-wrapper-border-width: 1px;
|
|
261
|
+
--input-wrapper-border-color: #{variables.$primary};
|
|
262
|
+
--input-wrapper-border-opacity: 1;
|
|
263
|
+
|
|
264
|
+
--input-border-color: transparent;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&_disabled {
|
|
269
|
+
--input-border-color: transparent;
|
|
270
|
+
}
|
|
271
|
+
|
|
318
272
|
&__addon-before {
|
|
319
|
-
border-top-left-radius:
|
|
320
|
-
border-bottom-left-radius:
|
|
273
|
+
border-top-left-radius: var(--input-border-radius);
|
|
274
|
+
border-bottom-left-radius: var(--input-border-radius);
|
|
321
275
|
}
|
|
322
276
|
|
|
323
277
|
&__addon-after {
|
|
324
|
-
border-top-right-radius:
|
|
325
|
-
border-bottom-right-radius:
|
|
278
|
+
border-top-right-radius: var(--input-border-radius);
|
|
279
|
+
border-bottom-right-radius: var(--input-border-radius);
|
|
326
280
|
}
|
|
327
281
|
}
|
package/hooks/index.d.ts
ADDED
package/hooks/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.useHideScroll = void 0;
|
|
7
|
+
var useHideScroll_1 = __importDefault(require("./useHideScroll"));
|
|
8
|
+
exports.useHideScroll = useHideScroll_1["default"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useHideScroll(): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
var react_use_1 = require("react-use");
|
|
5
|
+
var onlyNumbersRegExp = /^\D/g;
|
|
6
|
+
/*
|
|
7
|
+
* Хук устанавливает padding-right для body при открытии модальных окон.
|
|
8
|
+
* Помогает избежать нежелательного смещения контента, когда для body задается свойство overflow: hidden (убирается скролл)
|
|
9
|
+
* */
|
|
10
|
+
var BODY_HIDE_SCROLL_CLASS_NAME = 'body-hide-scroll';
|
|
11
|
+
function useHideScroll() {
|
|
12
|
+
var defaultPadding = (0, react_1.useRef)(null);
|
|
13
|
+
(0, react_use_1.useMount)(function () {
|
|
14
|
+
if (process.env.IS_SSR) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
var fullWindowWidth = window.innerWidth; // полная ширина окна;
|
|
18
|
+
var windowWidthWithoutScrollbar = document.documentElement.clientWidth; // ширина окна за вычетом скролла
|
|
19
|
+
defaultPadding.current = document.body.style.paddingRight;
|
|
20
|
+
if (windowWidthWithoutScrollbar < fullWindowWidth) {
|
|
21
|
+
var defaultPaddingInt = defaultPadding.current
|
|
22
|
+
? Number(defaultPadding.current.replace(onlyNumbersRegExp, ''))
|
|
23
|
+
: 0;
|
|
24
|
+
var paddingRight = "".concat(fullWindowWidth - windowWidthWithoutScrollbar + defaultPaddingInt, "px");
|
|
25
|
+
document.body.style.paddingRight = paddingRight;
|
|
26
|
+
document.body.classList.add(BODY_HIDE_SCROLL_CLASS_NAME);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
(0, react_use_1.useUnmount)(function () {
|
|
30
|
+
if (process.env.IS_SSR) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
document.body.style.paddingRight = defaultPadding.current;
|
|
34
|
+
document.body.classList.remove(BODY_HIDE_SCROLL_CLASS_NAME);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports["default"] = useHideScroll;
|
package/icons/index.js
CHANGED
package/list/Grid/GridView.js
CHANGED
|
@@ -62,9 +62,8 @@ function GridView(props) {
|
|
|
62
62
|
})));
|
|
63
63
|
}, [props.searchForm, props.columns]);
|
|
64
64
|
var renderSortButton = (0, react_1.useCallback)(function (attribute, direction) {
|
|
65
|
-
var _a;
|
|
66
65
|
var sortKey = (direction === 'desc' ? '-' : '') + attribute;
|
|
67
|
-
var isActive = [].concat((
|
|
66
|
+
var isActive = [].concat((props === null || props === void 0 ? void 0 : props.sort) || []).includes(sortKey);
|
|
68
67
|
return (React.createElement(Button_1["default"], { icon: direction === 'asc' ? 'long-arrow-alt-up' : 'long-arrow-alt-down', className: bem.element('sort-button', {
|
|
69
68
|
'is-active': isActive
|
|
70
69
|
}), link: true, onClick: function (e) {
|
|
@@ -86,7 +85,7 @@ function GridView(props) {
|
|
|
86
85
|
React.createElement("thead", null,
|
|
87
86
|
React.createElement("tr", null, props.columns.map(function (column, columnIndex) { return (React.createElement("th", { key: columnIndex, className: column.headerClassName },
|
|
88
87
|
column.label,
|
|
89
|
-
column.sortable && column.attribute && (React.createElement("span",
|
|
88
|
+
column.sortable && column.attribute && (React.createElement("span", { className: bem.element('sort-buttons') },
|
|
90
89
|
column.label && React.createElement("span", null, "\u00A0"),
|
|
91
90
|
renderSortButton(column.attribute, 'asc'),
|
|
92
91
|
renderSortButton(column.attribute, 'desc'))))); })),
|
package/list/Grid/GridView.scss
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
--grid-td-background-color: #FFFFFF;
|
|
8
8
|
--grid-td-alternating-color: var(--additional-light-gray);
|
|
9
|
+
|
|
10
|
+
--sort-button-color: var(--graphite);
|
|
11
|
+
--sort-button-color-active: var(--graphite-dark);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
html[data-theme="dark"] {
|
|
@@ -14,6 +17,10 @@ html[data-theme="dark"] {
|
|
|
14
17
|
|
|
15
18
|
--grid-td-background-color: var(--graphite);
|
|
16
19
|
--grid-td-alternating-color: var(--graphite-dark);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
--sort-button-color: var(--secondary-dark);
|
|
23
|
+
--sort-button-color-active: var(--secondary);
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
$grid-header-background-color: var(--grid-header-background-color);
|
|
@@ -97,6 +104,13 @@ $grid-td-alternating-color: var(--grid-td-alternating-color);
|
|
|
97
104
|
td:not(#{$root}__column_isDiagram) {
|
|
98
105
|
padding: 24px 16px;
|
|
99
106
|
}
|
|
107
|
+
|
|
108
|
+
&:has(#{$root}__sort-buttons) {
|
|
109
|
+
th {
|
|
110
|
+
position: relative;
|
|
111
|
+
padding: 24px 30px 24px 16px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
&_md {
|
|
@@ -109,6 +123,13 @@ $grid-td-alternating-color: var(--grid-td-alternating-color);
|
|
|
109
123
|
td:not(#{$root}__column_isDiagram) {
|
|
110
124
|
padding: 21px 12px;
|
|
111
125
|
}
|
|
126
|
+
|
|
127
|
+
&:has(#{$root}__sort-buttons) {
|
|
128
|
+
th {
|
|
129
|
+
position: relative;
|
|
130
|
+
padding: 21px 30px 21px 12px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
112
133
|
}
|
|
113
134
|
|
|
114
135
|
&_sm {
|
|
@@ -121,6 +142,13 @@ $grid-td-alternating-color: var(--grid-td-alternating-color);
|
|
|
121
142
|
td:not(#{$root}__column_isDiagram) {
|
|
122
143
|
padding: 16px 8px;
|
|
123
144
|
}
|
|
145
|
+
|
|
146
|
+
&:has(#{$root}__sort-buttons) {
|
|
147
|
+
th {
|
|
148
|
+
position: relative;
|
|
149
|
+
padding: 16px 30px 16px 8px;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
124
152
|
}
|
|
125
153
|
}
|
|
126
154
|
|
|
@@ -171,4 +199,22 @@ $grid-td-alternating-color: var(--grid-td-alternating-color);
|
|
|
171
199
|
width: 100%;
|
|
172
200
|
}
|
|
173
201
|
}
|
|
202
|
+
|
|
203
|
+
&__sort-buttons {
|
|
204
|
+
position: absolute;
|
|
205
|
+
right: 5px;
|
|
206
|
+
top: 50%;
|
|
207
|
+
transform: translateY(-50%);
|
|
208
|
+
}
|
|
209
|
+
&__sort-button {
|
|
210
|
+
path {
|
|
211
|
+
stroke: var(--sort-button-color);
|
|
212
|
+
}
|
|
213
|
+
&_is-active {
|
|
214
|
+
path {
|
|
215
|
+
stroke: var(--sort-button-color-active);
|
|
216
|
+
stroke-width: 2px;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
174
220
|
}
|