@steroidsjs/bootstrap 3.0.42 → 3.0.44
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.
|
@@ -37,17 +37,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
exports.__esModule = true;
|
|
40
|
-
var
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
41
41
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
42
42
|
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
43
43
|
function TextFieldView(props) {
|
|
44
44
|
var bem = (0, hooks_1.useBem)('TextFieldView');
|
|
45
|
-
|
|
45
|
+
/*
|
|
46
|
+
В хуке устанавливается высота текстового поля, равная высоте введенного текста
|
|
47
|
+
*/
|
|
48
|
+
(0, react_1.useEffect)(function () {
|
|
49
|
+
if (props.autoHeight) {
|
|
50
|
+
var inputElement = props.inputProps.ref.current;
|
|
51
|
+
if (!inputElement) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
var inputElementComputedStyles = window.getComputedStyle(inputElement);
|
|
55
|
+
// Получаем числовое значение ширины верхней и нижней границ
|
|
56
|
+
var borderTopWidth = parseInt(inputElementComputedStyles.borderTopWidth, 10);
|
|
57
|
+
var borderBottomWidth = parseInt(inputElementComputedStyles.borderBottomWidth, 10);
|
|
58
|
+
/**
|
|
59
|
+
* Сброс высоты до значения по умолчанию.
|
|
60
|
+
* Необходимо для корректного расчета текущей высоты содержимого:
|
|
61
|
+
* - если текст из поля убирают, высота поля уменьшится до минимально установленного значения
|
|
62
|
+
* - если текст добавляют, высота подстроится под высоту текущего контента
|
|
63
|
+
*/
|
|
64
|
+
inputElement.style.height = 'auto';
|
|
65
|
+
inputElement.style.height = "".concat(inputElement.scrollHeight + borderTopWidth + borderBottomWidth, "px");
|
|
66
|
+
}
|
|
67
|
+
}, [props.inputProps.ref, props.inputProps.value, props.autoHeight]);
|
|
68
|
+
return (react_1["default"].createElement("div", { className: bem(bem.block({
|
|
46
69
|
hasErrors: !!props.errors,
|
|
47
70
|
filled: !!props.inputProps.value,
|
|
48
71
|
size: props.size
|
|
49
72
|
}), props.className) },
|
|
50
|
-
|
|
51
|
-
props.showClear && (
|
|
73
|
+
react_1["default"].createElement("textarea", __assign({ className: bem.element('textarea'), id: props.id }, props.inputProps)),
|
|
74
|
+
props.showClear && (react_1["default"].createElement(Icon_1["default"], { className: bem.element('clear'), name: "cross_8x8", onClick: props.onClear }))));
|
|
52
75
|
}
|
|
53
76
|
exports["default"] = TextFieldView;
|
package/icons/svgs/burger.svg
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
<svg width="24" height="
|
|
2
|
-
<
|
|
3
|
-
<path d="M5
|
|
4
|
-
<path d="M5
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="Icons/Icons24Ñ…24/Black/burger & menu/Menu">
|
|
3
|
+
<path id="Vector 7" d="M5 7H19" stroke="#323232" stroke-linecap="round"/>
|
|
4
|
+
<path id="Vector 8" d="M5 12H19" stroke="#323232" stroke-linecap="round"/>
|
|
5
|
+
<path id="Vector 9" d="M5 17H19" stroke="#323232" stroke-linecap="round"/>
|
|
6
|
+
</g>
|
|
5
7
|
</svg>
|
package/list/List/ListView.js
CHANGED
|
@@ -25,8 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
var React = __importStar(require("react"));
|
|
27
27
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
28
|
+
var react_1 = require("react");
|
|
28
29
|
function ListView(props) {
|
|
29
30
|
var bem = (0, hooks_1.useBem)('ListView');
|
|
31
|
+
var infiniteScroll = (0, react_1.useMemo)(function () { return props.renderInfiniteScroll(); }, [props]);
|
|
32
|
+
var loading = (0, react_1.useMemo)(function () { return props.renderLoading(); }, [props]);
|
|
30
33
|
if (!props.list) {
|
|
31
34
|
return null;
|
|
32
35
|
}
|
|
@@ -44,6 +47,8 @@ function ListView(props) {
|
|
|
44
47
|
renderPagination(['top', 'both'].includes(props.paginationPosition) && props.renderPagination(), ['top', 'both'].includes(props.paginationSizePosition) && props.renderPaginationSize(), ['top', 'both'].includes(props.layoutNamesPosition) && props.renderLayoutNames()),
|
|
45
48
|
React.createElement("div", { className: bem(bem.element('content'), props.contentClassName) }, props.content),
|
|
46
49
|
renderPagination(['bottom', 'both'].includes(props.paginationPosition) && props.renderPagination(), ['bottom', 'both'].includes(props.paginationSizePosition) && props.renderPaginationSize(), ['bottom', 'both'].includes(props.layoutNamesPosition) && props.renderLayoutNames()),
|
|
47
|
-
props.renderLoading() || props.renderEmpty()
|
|
50
|
+
props.renderLoading() || props.renderEmpty(),
|
|
51
|
+
!loading && infiniteScroll && (React.createElement("tr", { className: bem.element('infinite-scroll') },
|
|
52
|
+
React.createElement("td", null, infiniteScroll)))));
|
|
48
53
|
}
|
|
49
54
|
exports["default"] = ListView;
|
package/list/List/ListView.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.44",
|
|
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.89",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.6",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|