@steroidsjs/bootstrap 3.0.30 → 3.0.34
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/CheckboxListField/CheckboxListFieldView.js +1 -1
- 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 +54 -35
- package/form/DropDownField/DropDownFieldView.scss +57 -45
- package/form/InputField/InputFieldView.js +4 -4
- package/form/InputField/InputFieldView.scss +128 -174
- package/form/RadioField/RadioFieldView.d.ts +2 -2
- package/form/RadioListField/RadioListFieldView.d.ts +2 -2
- package/form/RadioListField/RadioListFieldView.js +1 -1
- package/form/SwitcherField/SwitcherFieldView.d.ts +2 -2
- package/form/SwitcherField/SwitcherFieldView.js +17 -35
- package/form/SwitcherField/SwitcherFieldView.scss +63 -69
- package/form/SwitcherListField/SwitcherListFieldView.d.ts +3 -0
- package/form/SwitcherListField/SwitcherListFieldView.js +54 -0
- package/form/SwitcherListField/SwitcherListFieldView.scss +9 -0
- 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/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.scss +1 -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
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/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -164,6 +164,9 @@ exports["default"] = {
|
|
|
164
164
|
'form.SwitcherFieldView': {
|
|
165
165
|
lazy: function () { return require('./form/SwitcherField/SwitcherFieldView')["default"]; }
|
|
166
166
|
},
|
|
167
|
+
'form.SwitcherListFieldView': {
|
|
168
|
+
lazy: function () { return require('./form/SwitcherListField/SwitcherListFieldView')["default"]; }
|
|
169
|
+
},
|
|
167
170
|
'form.TextFieldView': {
|
|
168
171
|
lazy: function () { return require('./form/TextField/TextFieldView')["default"]; }
|
|
169
172
|
},
|
package/index.scss
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
@include meta.load-css('form/ReCaptchaField/ReCaptchaFieldView');
|
|
66
66
|
@include meta.load-css('form/SliderField/SliderFieldView');
|
|
67
67
|
@include meta.load-css('form/SwitcherField/SwitcherFieldView');
|
|
68
|
+
@include meta.load-css('form/SwitcherListField/SwitcherListFieldView');
|
|
68
69
|
@include meta.load-css('form/TextField/TextFieldView');
|
|
69
70
|
@include meta.load-css('form/TimeField/TimeFieldView');
|
|
70
71
|
@include meta.load-css('form/TimeField/TimePanelView');
|
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
|
}
|
package/modal/Modal/ModalView.js
CHANGED
|
@@ -42,14 +42,16 @@ var react_modal_1 = __importDefault(require("react-modal"));
|
|
|
42
42
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
43
43
|
var content_1 = require("@steroidsjs/core/ui/content");
|
|
44
44
|
var form_1 = require("@steroidsjs/core/ui/form");
|
|
45
|
+
var hooks_2 = require("../../hooks");
|
|
45
46
|
function ModalView(props) {
|
|
46
47
|
var bem = (0, hooks_1.useBem)('ModalView');
|
|
48
|
+
(0, hooks_2.useHideScroll)();
|
|
47
49
|
var overrideDefaultClasses = {
|
|
48
50
|
base: bem.block('overlay'),
|
|
49
51
|
afterOpen: 'ModalView_overlay-after',
|
|
50
52
|
beforeClose: 'ModalView_overlay-before'
|
|
51
53
|
};
|
|
52
|
-
return (React.createElement(react_modal_1["default"], __assign({}, props, { ariaHideApp: false,
|
|
54
|
+
return (React.createElement(react_modal_1["default"], __assign({}, props, { ariaHideApp: false, className: bem(bem.element('body', { size: props.size }), props.className), closeTimeoutMS: props.closeTimeoutMs, isOpen: !props.isClosing, onRequestClose: props.onClose, overlayClassName: overrideDefaultClasses, shouldCloseOnEsc: props.shouldCloseOnEsc, shouldCloseOnOverlayClick: props.shouldCloseOnOverlayClick }),
|
|
53
55
|
React.createElement("div", { className: bem.element('header') },
|
|
54
56
|
React.createElement("span", { className: bem.element('title') }, props.title),
|
|
55
57
|
React.createElement(content_1.Icon, { name: 'cross_12x12', className: bem.element('close'), onClick: props.onClose })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-use": "^17.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@steroidsjs/core": "3.0.
|
|
38
|
+
"@steroidsjs/core": "3.0.59",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.6",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|