@steroidsjs/bootstrap 2.1.0-beta.7 → 2.1.1
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/form/DropDownField/DropDownFieldView.js +8 -15
- package/form/DropDownField/DropDownFieldView.scss +0 -1
- package/form/FieldList/FieldListItemView.d.ts +1 -1
- package/form/FieldList/FieldListItemView.js +1 -1
- package/form/FieldList/FieldListView.js +2 -2
- package/form/FieldList/FieldListView.scss +1 -6
- package/form/ImageField/ImageFieldModalView.js +1 -1
- package/layout/Tooltip/TooltipView.scss +1 -0
- package/package.json +2 -2
|
@@ -31,23 +31,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
31
31
|
};
|
|
32
32
|
exports.__esModule = true;
|
|
33
33
|
var React = __importStar(require("react"));
|
|
34
|
+
var react_1 = require("react");
|
|
34
35
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
35
36
|
function DropDownFieldView(props) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
componentDidUpdate(prevProps) {
|
|
42
|
-
// Auto focus on search
|
|
43
|
-
if (props.searchAutoFocus && props.autoComplete && !prevProps.isOpened && props.isOpened) {
|
|
44
|
-
const element: any = findDOMNode(this);
|
|
45
|
-
const input = element.querySelector('.' + props.bem.element('search-input'));
|
|
46
|
-
if (input) {
|
|
47
|
-
input.focus();
|
|
48
|
-
}
|
|
37
|
+
var inputRef = react_1.useRef(null);
|
|
38
|
+
// Auto focus on search
|
|
39
|
+
react_1.useEffect(function () {
|
|
40
|
+
if (props.isSearchAutoFocus && props.isAutoComplete && props.isOpened && (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) {
|
|
41
|
+
inputRef.current.focus();
|
|
49
42
|
}
|
|
50
|
-
}
|
|
43
|
+
}, [props.isAutoComplete, props.isOpened, props.isSearchAutoFocus]);
|
|
51
44
|
var bem = hooks_1.useBem('DropDownFieldView');
|
|
52
45
|
return (React.createElement("div", { ref: props.forwardedRef, className: bem(bem.block({ size: props.size }), props.className), style: props.style },
|
|
53
46
|
React.createElement("div", { className: bem.element('selected-items', {
|
|
@@ -79,7 +72,7 @@ function DropDownFieldView(props) {
|
|
|
79
72
|
props.showReset && props.selectedIds.length > 0 && (React.createElement("button", { className: bem.element('reset'), onClick: props.onReset, "aria-label": __('Сбросить') })),
|
|
80
73
|
props.isOpened && (React.createElement("div", { className: bem.element('drop-down') },
|
|
81
74
|
props.isAutoComplete && (React.createElement("div", { className: bem.element('search') },
|
|
82
|
-
React.createElement("input", __assign({}, props.searchInputProps, { onChange: function (e) { return props.searchInputProps.onChange(e.target.value); }, className: bem('form-control', 'form-control-' + props.size, bem.element('search-input'), props.searchInputProps.className) })))),
|
|
75
|
+
React.createElement("input", __assign({}, props.searchInputProps, { ref: inputRef, onChange: function (e) { return props.searchInputProps.onChange(e.target.value); }, className: bem('form-control', 'form-control-' + props.size, bem.element('search-input'), props.searchInputProps.className) })))),
|
|
83
76
|
React.createElement("div", { className: bem.element('drop-down-list') }, props.items.map(function (item) { return (React.createElement("button", { key: String(item[props.primaryKey]), type: 'button', className: bem.element('drop-down-item', {
|
|
84
77
|
hover: props.hoveredId === item[props.primaryKey],
|
|
85
78
|
select: props.selectedIds.includes(item[props.primaryKey])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IFieldListItemViewProps } from '@steroidsjs/core/ui/form/FieldList/FieldList';
|
|
3
|
-
declare const _default: React.
|
|
3
|
+
declare const _default: React.MemoExoticComponent<(props: IFieldListItemViewProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -33,7 +33,7 @@ exports.__esModule = true;
|
|
|
33
33
|
var React = __importStar(require("react"));
|
|
34
34
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
35
35
|
var form_1 = require("@steroidsjs/core/ui/form");
|
|
36
|
-
exports["default"] = React.memo(function
|
|
36
|
+
exports["default"] = React.memo(function (props) {
|
|
37
37
|
var bem = hooks_1.useBem('FieldListItemView');
|
|
38
38
|
return (React.createElement("tr", null,
|
|
39
39
|
props.items.map(function (field, index) { return (React.createElement("td", { key: index, className: bem(bem.element('table-cell'), field.className) },
|
|
@@ -21,6 +21,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
21
21
|
exports.__esModule = true;
|
|
22
22
|
var React = __importStar(require("react"));
|
|
23
23
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
24
|
+
var form_1 = require("@steroidsjs/core/ui/form");
|
|
24
25
|
function FieldListView(props) {
|
|
25
26
|
var bem = hooks_1.useBem('FieldListView');
|
|
26
27
|
return (React.createElement("div", { className: bem(bem.block(), props.className), style: props.style, ref: props.forwardedRef },
|
|
@@ -32,10 +33,9 @@ function FieldListView(props) {
|
|
|
32
33
|
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
33
34
|
React.createElement("th", null)))),
|
|
34
35
|
React.createElement("tbody", null, props.children)),
|
|
35
|
-
props.showAdd && !props.disabled && (React.createElement(
|
|
36
|
+
props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false, layout: false, color: 'secondary', className: bem.element('button-add'), onClick: function (e) {
|
|
36
37
|
e.preventDefault();
|
|
37
38
|
props.onAdd();
|
|
38
39
|
} }, __('Добавить ещё')))));
|
|
39
40
|
}
|
|
40
41
|
exports["default"] = FieldListView;
|
|
41
|
-
;
|
|
@@ -50,6 +50,6 @@ function ImageFieldModalView(props) {
|
|
|
50
50
|
}
|
|
51
51
|
}] },
|
|
52
52
|
React.createElement("div", { className: 'mb-3' },
|
|
53
|
-
React.createElement(react_image_crop_1["default"], __assign({}, props.crop.reactImageCropProps, { className: bem.element('crop'), src: props.image.url, crop: crop, onChange: setCrop })))));
|
|
53
|
+
React.createElement(react_image_crop_1["default"], __assign({}, props.crop.reactImageCropProps, { className: bem.element('crop'), src: props.image && props.image.url, crop: crop, onChange: setCrop })))));
|
|
54
54
|
}
|
|
55
55
|
exports["default"] = ImageFieldModalView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@ckeditor/ckeditor5-react": "^3.0.2",
|
|
21
21
|
"@steroidsjs/ckeditor5": "^27.0.2-rc.2",
|
|
22
|
-
"@steroidsjs/core": "^2.1.
|
|
22
|
+
"@steroidsjs/core": "^2.1.1",
|
|
23
23
|
"bootstrap": "^4.5.2",
|
|
24
24
|
"lodash": "^4.17.20",
|
|
25
25
|
"lodash-es": "^4.17.20",
|