@steroidsjs/bootstrap 2.1.0-beta.6 → 2.1.3
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/Button/ButtonView.scss +1 -1
- package/form/DateField/DateFieldView.scss +2 -3
- package/form/DateTimeField/DateTimeFieldView.scss +1 -1
- 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 +9 -7
- package/form/FieldList/FieldListView.scss +1 -6
- package/form/ImageField/ImageFieldModalView.js +1 -1
- package/form/ImageField/ImageFieldView.d.ts +1 -1
- package/form/ImageField/ImageFieldView.js +10 -10
- package/form/NumberField/NumberFieldView.js +10 -12
- package/layout/Tooltip/TooltipView.scss +1 -0
- package/nav/Breadcrubms/BreadcrumbsView.d.ts +1 -2
- package/nav/Breadcrubms/BreadcrumbsView.js +1 -1
- package/nav/Breadcrubms/BreadcrumbsView.scss +1 -0
- package/nav/Nav/NavIconView.js +1 -1
- package/package.json +2 -2
- package/scss/variables/colors.scss +38 -38
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.DateFieldView {
|
|
2
2
|
$root: &;
|
|
3
3
|
|
|
4
|
-
padding:
|
|
4
|
+
padding-right: 8px;
|
|
5
5
|
position: relative;
|
|
6
6
|
|
|
7
7
|
background-color: $white;
|
|
@@ -46,8 +46,7 @@
|
|
|
46
46
|
border: none;
|
|
47
47
|
outline: none;
|
|
48
48
|
background-color: transparent;
|
|
49
|
-
|
|
50
|
-
padding: 10px 5px;
|
|
49
|
+
padding: $input-padding-y $input-padding-x;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
&__icon-container {
|
|
@@ -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,21 +21,23 @@ 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 },
|
|
27
|
-
React.createElement("table", { className: bem(bem.element('table'), 'table', props.size && 'table-' + props.size) },
|
|
28
|
+
React.createElement("table", { className: bem(bem.element('table'), 'table', props.size && 'table-' + props.size, props.tableClassName) },
|
|
28
29
|
React.createElement("thead", null,
|
|
29
30
|
React.createElement("tr", null,
|
|
30
31
|
props.items.map(function (field, rowIndex) { return (React.createElement("th", { key: rowIndex, className: bem(bem.element('table-cell-header'), field.headerClassName) }, field.label)); }),
|
|
31
32
|
props.showRemove && (
|
|
32
33
|
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
33
34
|
React.createElement("th", null)))),
|
|
34
|
-
React.createElement("tbody", null, props.children)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
React.createElement("tbody", null, props.children),
|
|
36
|
+
React.createElement("tfoot", null,
|
|
37
|
+
React.createElement("tr", null,
|
|
38
|
+
React.createElement("td", { colSpan: props.items.length }, props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false, layout: false, color: 'secondary', className: bem.element('button-add'), onClick: function (e) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
props.onAdd();
|
|
41
|
+
} }, __('Добавить ещё')))))))));
|
|
39
42
|
}
|
|
40
43
|
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;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IImageFieldViewProps } from
|
|
2
|
+
import { IImageFieldViewProps } from "@steroidsjs/core/ui/form/ImageField/ImageField";
|
|
3
3
|
export default function ImageFieldView(props: IImageFieldViewProps): JSX.Element;
|
|
@@ -26,18 +26,18 @@ var React = __importStar(require("react"));
|
|
|
26
26
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
27
27
|
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/icon/Icon"));
|
|
28
28
|
function ImageFieldView(props) {
|
|
29
|
-
var bem = hooks_1.useBem(
|
|
29
|
+
var bem = hooks_1.useBem("ImageFieldView");
|
|
30
30
|
var item = props.item;
|
|
31
|
-
return (React.createElement("div", { className: bem.block() }, !item.image ? (React.createElement("button", { className: bem.element(
|
|
32
|
-
loading: item.progress
|
|
31
|
+
return (React.createElement("div", { className: bem.block() }, !item || !item.image ? (React.createElement("button", { className: bem.element("button", {
|
|
32
|
+
loading: item ? item.progress : false
|
|
33
33
|
}), onClick: props.onClick },
|
|
34
|
-
!item.progress ? (React.createElement(Icon_1["default"], { className: bem.element(
|
|
35
|
-
React.createElement("div", { className: bem.element(
|
|
36
|
-
width: item.progress.percent + "%"
|
|
34
|
+
!item || !item.progress ? (React.createElement(Icon_1["default"], { className: bem.element("button-icon"), name: 'plus' })) : (React.createElement("div", { className: bem.element("progress-bar") },
|
|
35
|
+
React.createElement("div", { className: bem.element("progress-slider"), style: {
|
|
36
|
+
width: (item ? item.progress.percent : 0) + "%"
|
|
37
37
|
} }))),
|
|
38
|
-
React.createElement("span", { className: bem.element(
|
|
39
|
-
React.createElement("img", { className: bem.element(
|
|
40
|
-
React.createElement("div", { className: bem.element(
|
|
41
|
-
React.createElement(Icon_1["default"], { className: bem.element(
|
|
38
|
+
React.createElement("span", { className: bem.element("button-label") }, !item || !item.progress ? props.label : "Uploading..."))) : (React.createElement("div", { className: bem.element("content") },
|
|
39
|
+
React.createElement("img", { className: bem.element("image"), src: item.image.url, width: item.image.width, height: item.image.height, alt: item.title }),
|
|
40
|
+
React.createElement("div", { className: bem.element("image-controls") },
|
|
41
|
+
React.createElement(Icon_1["default"], { className: bem.element("delete-icon"), name: 'trash', onClick: item.onRemove }))))));
|
|
42
42
|
}
|
|
43
43
|
exports["default"] = ImageFieldView;
|
|
@@ -36,16 +36,14 @@ var hooks_1 = require("@steroidsjs/core/hooks");
|
|
|
36
36
|
function NumberFieldView(props) {
|
|
37
37
|
// Input ref
|
|
38
38
|
var inputRef = react_1.useRef(null);
|
|
39
|
-
|
|
40
|
-
var _a = react_1.useState(null), value = _a[0], setValue = _a[1];
|
|
41
|
-
var onStepUp = function () {
|
|
39
|
+
var onStepUp = react_1.useCallback(function () {
|
|
42
40
|
inputRef.current.stepUp();
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
var onStepDown = function () {
|
|
41
|
+
props.inputProps.onChange(inputRef.current.value);
|
|
42
|
+
}, [inputRef.current]);
|
|
43
|
+
var onStepDown = react_1.useCallback(function () {
|
|
46
44
|
inputRef.current.stepDown();
|
|
47
|
-
|
|
48
|
-
};
|
|
45
|
+
props.inputProps.onChange(inputRef.current.value);
|
|
46
|
+
}, [inputRef.current]);
|
|
49
47
|
var bem = hooks_1.useBem('NumberFieldView');
|
|
50
48
|
return (React.createElement("div", { className: bem(bem.block({
|
|
51
49
|
disabled: props.inputProps.disabled
|
|
@@ -55,13 +53,13 @@ function NumberFieldView(props) {
|
|
|
55
53
|
}), !!props.errors && 'is-invalid') }, props.inputProps)),
|
|
56
54
|
!props.disabled && !props.errors && (React.createElement("div", { className: bem.element('arrows-container') },
|
|
57
55
|
React.createElement("button", { className: bem.element('arrow', {
|
|
58
|
-
disabled: props.inputProps.max && value >= props.inputProps.max
|
|
59
|
-
}), onClick: onStepUp },
|
|
56
|
+
disabled: props.inputProps.max && props.inputProps.value >= props.inputProps.max
|
|
57
|
+
}), type: 'button', onClick: onStepUp },
|
|
60
58
|
React.createElement("svg", { viewBox: '64 64 896 896', width: '1em', height: '1em' },
|
|
61
59
|
React.createElement("path", { d: 'M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140\n 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1\n 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z' }))),
|
|
62
60
|
React.createElement("button", { className: bem.element('arrow', {
|
|
63
|
-
disabled: props.inputProps.min && value <= props.inputProps.min
|
|
64
|
-
}), onClick: onStepDown },
|
|
61
|
+
disabled: props.inputProps.min && props.inputProps.value <= props.inputProps.min
|
|
62
|
+
}), type: 'button', onClick: onStepDown },
|
|
65
63
|
React.createElement("svg", { viewBox: '64 64 896 896', width: '1em', height: '1em' },
|
|
66
64
|
React.createElement("path", { d: 'M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5\n 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39\n 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z' })))))));
|
|
67
65
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IBemHocOutput } from '@steroidsjs/core/hoc/bem';
|
|
3
2
|
import { IBreadcrumbsViewProps } from '@steroidsjs/core/ui/nav/Breadcrumbs/Breadcrumbs';
|
|
4
|
-
export default function BreadcrumbsView(props: IBreadcrumbsViewProps
|
|
3
|
+
export default function BreadcrumbsView(props: IBreadcrumbsViewProps): JSX.Element;
|
|
@@ -32,7 +32,7 @@ function BreadcrumbsView(props) {
|
|
|
32
32
|
React.createElement("ol", { className: bem.element('list') }, items.map(function (item, index) {
|
|
33
33
|
var isLastItem = items.length === index + 1;
|
|
34
34
|
return (React.createElement("li", { key: item.id || index, className: bem.element('item') },
|
|
35
|
-
!isLastItem && item.id && (React.createElement(Link_1["default"], { toRoute: item.id, href: item.id }, item.title)),
|
|
35
|
+
!isLastItem && item.id && (React.createElement(Link_1["default"], { toRoute: item.id, toRouteParams: props.routeParams, href: item.id }, item.title)),
|
|
36
36
|
(isLastItem || !item.id) && (React.createElement("span", null, props.pageTitle || item.title))));
|
|
37
37
|
}))));
|
|
38
38
|
}
|
package/nav/Nav/NavIconView.js
CHANGED
|
@@ -39,7 +39,7 @@ var hooks_1 = require("@steroidsjs/core/hooks");
|
|
|
39
39
|
function NavIconView(props) {
|
|
40
40
|
var bem = hooks_1.useBem('NavIconView');
|
|
41
41
|
return (React.createElement("div", { className: bem(bem.block(), props.className) },
|
|
42
|
-
props.items.map(function (item, index) { return (React.createElement(Button_1["default"], __assign({ icon: props.icon ? props.icon : 'circle-notch', key: item.id || index, link: true, onClick: function () { return props.onClick(item, index); } }, item, { label: null, hint: item.hint || item.label || null }))); }),
|
|
42
|
+
props.items.map(function (item, index) { return (React.createElement(Button_1["default"], __assign({ icon: props.icon ? props.icon : 'circle-notch', key: item.id || index, link: true, onClick: function () { return props.onClick(item, index); }, layout: false }, item, { label: null, hint: item.hint || item.label || null }))); }),
|
|
43
43
|
props.children));
|
|
44
44
|
}
|
|
45
45
|
exports["default"] = NavIconView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
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.
|
|
22
|
+
"@steroidsjs/core": "^2.2.9",
|
|
23
23
|
"bootstrap": "^4.5.2",
|
|
24
24
|
"lodash": "^4.17.20",
|
|
25
25
|
"lodash-es": "^4.17.20",
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
$primary: #651FFF;
|
|
2
|
-
$primary-dark:
|
|
3
|
-
$primary-light:
|
|
1
|
+
$primary: #651FFF !default;
|
|
2
|
+
$primary-dark: darken($primary, 25) !default;
|
|
3
|
+
$primary-light: lighten($primary, 50) !default;
|
|
4
4
|
|
|
5
|
-
$secondary: #97A7C8;
|
|
6
|
-
$secondary-dark:
|
|
7
|
-
$secondary-light:
|
|
5
|
+
$secondary: #97A7C8 !default;
|
|
6
|
+
$secondary-dark: darken($secondary, 25) !default;
|
|
7
|
+
$secondary-light: lighten($secondary, 50) !default;
|
|
8
8
|
|
|
9
|
-
$
|
|
10
|
-
$
|
|
11
|
-
$
|
|
9
|
+
$success: #64D03E !default;
|
|
10
|
+
$success-dark: darken($success, 25) !default;
|
|
11
|
+
$success-light: lighten($success, 50) !default;
|
|
12
12
|
|
|
13
|
-
$
|
|
14
|
-
$
|
|
15
|
-
$
|
|
13
|
+
$danger: #FF4557 !default;
|
|
14
|
+
$danger-dark: darken($danger, 25) !default;
|
|
15
|
+
$danger-light: lighten($danger, 50) !default;
|
|
16
16
|
|
|
17
|
-
$
|
|
18
|
-
$
|
|
19
|
-
$
|
|
17
|
+
$warning: #fad826 !default;
|
|
18
|
+
$warning-dark: darken($warning, 25) !default;
|
|
19
|
+
$warning-light: lighten($warning, 50) !default;
|
|
20
20
|
|
|
21
|
-
$
|
|
22
|
-
$
|
|
23
|
-
$
|
|
21
|
+
$info: #39bbd8 !default;
|
|
22
|
+
$info-dark: darken($info, 25) !default;
|
|
23
|
+
$info-light: lighten($info, 50) !default;
|
|
24
24
|
|
|
25
|
-
$
|
|
26
|
-
$
|
|
27
|
-
$
|
|
25
|
+
$light: #f8f9fa !default;
|
|
26
|
+
$light-dark: darken($light, 25) !default;
|
|
27
|
+
$light-light: lighten($light, 50) !default;
|
|
28
28
|
|
|
29
|
-
$
|
|
30
|
-
$
|
|
31
|
-
$
|
|
29
|
+
$dark: #343a40 !default;
|
|
30
|
+
$dark-dark: darken($dark, 25) !default;
|
|
31
|
+
$dark-light: lighten($dark, 50) !default;
|
|
32
32
|
|
|
33
|
-
$
|
|
34
|
-
$
|
|
35
|
-
$
|
|
33
|
+
$heading: #152536 !default;
|
|
34
|
+
$body: #68717A !default;
|
|
35
|
+
$white: #FFFFFF !default;
|
|
36
36
|
|
|
37
37
|
$color-themes: () !default;
|
|
38
38
|
$color-themes: map-merge(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
(
|
|
40
|
+
"primary": ("color": $primary, "color-dark": $primary-dark, "color-light": $primary-light, "text-color": $white),
|
|
41
|
+
"secondary": ("color": $secondary, "color-dark": $secondary-dark, "color-light": $secondary-light, "text-color": $white),
|
|
42
|
+
"success": ("color": $success, "color-dark": $success-dark, "color-light": $success-light, "text-color": $white),
|
|
43
|
+
"danger": ("color": $danger, "color-dark": $danger-dark, "color-light": $danger-light, "text-color": $white),
|
|
44
|
+
"warning": ("color": $warning, "color-dark": $warning-dark, "color-light": $warning-light, "text-color": $dark),
|
|
45
|
+
"info": ("color": $info, "color-dark": $info-dark, "color-light": $info-light, "text-color": $white),
|
|
46
|
+
"light": ("color": $light, "color-dark": $light-dark, "color-light": $light-light, "text-color": $dark),
|
|
47
|
+
"dark": ("color": $dark, "color-dark": $dark-dark, "color-light": $dark-light, "text-color": $white)
|
|
48
|
+
),
|
|
49
|
+
$color-themes
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
$grey-light: #D9D9D9;
|