@steroidsjs/bootstrap 3.0.0-beta.38 → 3.0.0-beta.39
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/FieldLayout/FieldLayoutView.js +7 -11
- package/form/FieldLayout/FieldLayoutView.scss +2 -1
- package/form/FieldList/FieldListView.js +1 -1
- package/form/FileField/FileFieldView.js +1 -1
- package/form/Form/FormView.js +1 -4
- package/form/Form/FormView.scss +1 -10
- package/form/ReCaptchaField/ReCaptchaFieldView.js +2 -2
- package/form/SwitcherField/SwitcherFieldView.js +1 -1
- package/list/Grid/GridView.js +1 -1
- package/nav/Nav/NavIconView.js +1 -1
- package/nav/Nav/NavListView.js +1 -1
- package/nav/Nav/NavTabsView.js +1 -1
- package/package.json +3 -3
|
@@ -32,22 +32,18 @@ var hooks_1 = require("@steroidsjs/core/hooks");
|
|
|
32
32
|
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
33
33
|
function FieldLayoutView(props) {
|
|
34
34
|
var bem = (0, hooks_1.useBem)('FieldLayoutView');
|
|
35
|
-
return (React.createElement("div", { className: bem
|
|
36
|
-
|
|
37
|
-
}), 'form-group', props.layout.className, props.layout.layout === 'horizontal' && 'row', props.layout.layout === 'inline' && 'form-inline mb-0'), style: props.layout.style },
|
|
38
|
-
props.label && (React.createElement("label", { htmlFor: props.id, className: bem(bem.element('label', {
|
|
35
|
+
return (React.createElement("div", { className: bem.block() },
|
|
36
|
+
props.label && (React.createElement("label", { htmlFor: props.id, className: bem.element('label', {
|
|
39
37
|
required: props.required,
|
|
40
38
|
size: props.size
|
|
41
|
-
})
|
|
42
|
-
React.createElement("div", { className: bem
|
|
39
|
+
}) }, props.label + ':')),
|
|
40
|
+
React.createElement("div", { className: bem.element('field') },
|
|
43
41
|
props.children,
|
|
44
|
-
!(0, isEmpty_1["default"])(props.errors) && (React.createElement("div", { className: bem
|
|
42
|
+
!(0, isEmpty_1["default"])(props.errors) && (React.createElement("div", { className: bem.element('invalid-feedback') }, props.errors.filter(function (error) { return typeof error === 'string'; }).map(function (error, index) { return (React.createElement("div", { key: index, className: bem.element('error-message') },
|
|
45
43
|
React.createElement(Icon_1["default"], { name: "error", className: bem.element('icon_error'), tabIndex: -1 }),
|
|
46
44
|
React.createElement("span", { className: bem.element('error-text', {
|
|
47
|
-
size:
|
|
45
|
+
size: props.size || 'md'
|
|
48
46
|
}) }, error))); }))),
|
|
49
|
-
(0, isEmpty_1["default"])(props.errors) && props.
|
|
50
|
-
size: props.size
|
|
51
|
-
})) }, props.hint)))));
|
|
47
|
+
(0, isEmpty_1["default"])(props.errors) && props.hint && (React.createElement("div", { className: bem.element('hint', { size: props.size }) }, props.hint)))));
|
|
52
48
|
}
|
|
53
49
|
exports["default"] = FieldLayoutView;
|
|
@@ -39,7 +39,7 @@ function FieldListView(props) {
|
|
|
39
39
|
React.createElement("tbody", null, props.children),
|
|
40
40
|
React.createElement("tfoot", null,
|
|
41
41
|
React.createElement("tr", null,
|
|
42
|
-
React.createElement("td", { colSpan: props.items.length }, props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false,
|
|
42
|
+
React.createElement("td", { colSpan: props.items.length }, props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false, color: 'secondary', className: bem.element('button-add'), onClick: function (e) {
|
|
43
43
|
e.preventDefault();
|
|
44
44
|
props.onAdd();
|
|
45
45
|
} }, __('Добавить ещё')))))))));
|
|
@@ -48,7 +48,7 @@ function FileFieldView(props) {
|
|
|
48
48
|
return (React.createElement("div", { className: bem.block() },
|
|
49
49
|
React.createElement("div", { className: bem(bem.element('files')) }, props.items.map(function (item) { return (React.createElement(FileItemView, __assign({ key: item.uid }, item, props.itemProps))); })),
|
|
50
50
|
React.createElement("div", { className: bem.element('button') },
|
|
51
|
-
React.createElement(ButtonComponent, __assign({}, props.buttonProps, {
|
|
51
|
+
React.createElement(ButtonComponent, __assign({}, props.buttonProps, { label: null }),
|
|
52
52
|
React.createElement(Icon_1["default"], { className: bem.element('button-icon'), name: props.imagesOnly ? 'file-image' : 'upload' }),
|
|
53
53
|
React.createElement("span", { className: bem.element('button-label') }, props.buttonProps.label)))));
|
|
54
54
|
}
|
package/form/Form/FormView.js
CHANGED
|
@@ -58,10 +58,7 @@ function FormView(props) {
|
|
|
58
58
|
}, 10);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
return (React.createElement("form", { ref: formRef, className: bem(bem.block(
|
|
62
|
-
inline: props.layout.layout === 'inline',
|
|
63
|
-
vertical: props.layout.layout === 'vertical'
|
|
64
|
-
}), props.className), onSubmit: props.onSubmit, style: props.style },
|
|
61
|
+
return (React.createElement("form", { ref: formRef, className: bem(bem.block(), props.className), onSubmit: props.onSubmit, style: props.style },
|
|
65
62
|
props.children,
|
|
66
63
|
(props.fields || []).map(function (field, index) { return (React.createElement(Field_1["default"], __assign({ key: index }, ((0, isString_1["default"])(field) ? { attribute: field } : field)))); }),
|
|
67
64
|
props.submitLabel && (React.createElement(Button_1["default"], { type: 'submit', label: props.submitLabel }))));
|
package/form/Form/FormView.scss
CHANGED
|
@@ -31,9 +31,9 @@ function ReCaptchaFieldView(props) {
|
|
|
31
31
|
return (React.createElement("div", { className: bem.block() },
|
|
32
32
|
React.createElement("small", { className: 'text-muted' },
|
|
33
33
|
__('This site is protected by reCAPTCHA and the Google') + ' ',
|
|
34
|
-
React.createElement(nav_1.Link, { url: 'https://policies.google.com/privacy', target: '_blank', label: __('Privacy Policy')
|
|
34
|
+
React.createElement(nav_1.Link, { url: 'https://policies.google.com/privacy', target: '_blank', label: __('Privacy Policy') }),
|
|
35
35
|
' ' + __('and') + ' ',
|
|
36
|
-
React.createElement(nav_1.Link, { url: 'https://policies.google.com/terms', target: '_blank', label: __('Terms of Service')
|
|
36
|
+
React.createElement(nav_1.Link, { url: 'https://policies.google.com/terms', target: '_blank', label: __('Terms of Service') }),
|
|
37
37
|
' ' + __('apply'),
|
|
38
38
|
".")));
|
|
39
39
|
}
|
|
@@ -45,6 +45,6 @@ function SwitcherFieldView(props) {
|
|
|
45
45
|
var bem = (0, hooks_1.useBem)('SwitcherFieldView');
|
|
46
46
|
return (React.createElement("div", { className: bem(bem.block({
|
|
47
47
|
size: props.size
|
|
48
|
-
}), props.className, 'btn-group') }, props.items.map(function (item) { return (React.createElement(Button_1["default"], __assign({ key: String(item[props.primaryKey]) }, props.buttonProps, { className: bem((0, get_1["default"])(props, 'buttonProps.className'), props.hoveredId === item[props.primaryKey] && 'hover', props.selectedIds.includes(item[props.primaryKey]) && 'active'), disabled: props.disabled, onClick: function () { return props.onItemSelect(item[props.primaryKey]); }, onMouseOver: function () { return props.onItemHover(item[props.primaryKey]); }
|
|
48
|
+
}), props.className, 'btn-group') }, props.items.map(function (item) { return (React.createElement(Button_1["default"], __assign({ key: String(item[props.primaryKey]) }, props.buttonProps, { className: bem((0, get_1["default"])(props, 'buttonProps.className'), props.hoveredId === item[props.primaryKey] && 'hover', props.selectedIds.includes(item[props.primaryKey]) && 'active'), disabled: props.disabled, onClick: function () { return props.onItemSelect(item[props.primaryKey]); }, onMouseOver: function () { return props.onItemHover(item[props.primaryKey]); } }), item.label)); })));
|
|
49
49
|
}
|
|
50
50
|
exports["default"] = SwitcherFieldView;
|
package/list/Grid/GridView.js
CHANGED
|
@@ -58,7 +58,7 @@ function GridView(props) {
|
|
|
58
58
|
var fields = (0, keyBy_1["default"])(props.searchForm.fields.map(function (column) { return (0, isString_1["default"])(column) ? { attribute: column } : column; }), 'attribute');
|
|
59
59
|
return (React.createElement("tr", null, props.columns.map(function (column, columnIndex) {
|
|
60
60
|
var _a;
|
|
61
|
-
return (React.createElement("td", { key: columnIndex, className: column.headerClassName }, column.attribute && fields[column.attribute] && (React.createElement(Field_1["default"], __assign({
|
|
61
|
+
return (React.createElement("td", { key: columnIndex, className: column.headerClassName }, column.attribute && fields[column.attribute] && (React.createElement(Field_1["default"], __assign({ size: (_a = props.searchForm) === null || _a === void 0 ? void 0 : _a.size }, fields[column.attribute])))));
|
|
62
62
|
})));
|
|
63
63
|
}, [props.searchForm, props.columns]);
|
|
64
64
|
var renderSortButton = (0, react_1.useCallback)(function (attribute, direction) {
|
package/nav/Nav/NavIconView.js
CHANGED
|
@@ -43,7 +43,7 @@ var hooks_1 = require("@steroidsjs/core/hooks");
|
|
|
43
43
|
function NavIconView(props) {
|
|
44
44
|
var bem = (0, hooks_1.useBem)('NavIconView');
|
|
45
45
|
return (React.createElement("div", { className: bem(bem.block(), props.className) },
|
|
46
|
-
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); }
|
|
46
|
+
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 }))); }),
|
|
47
47
|
props.children));
|
|
48
48
|
}
|
|
49
49
|
exports["default"] = NavIconView;
|
package/nav/Nav/NavListView.js
CHANGED
|
@@ -47,7 +47,7 @@ function NavListView(props) {
|
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
49
|
return items.map(function (item, index) { return (React.createElement("li", { key: index, className: bem('nav-item', bem.element('item'), props.navClassName) },
|
|
50
|
-
React.createElement(Link_1["default"], __assign({ onClick: function () { return props.onClick(item, index); }
|
|
50
|
+
React.createElement(Link_1["default"], __assign({ onClick: function () { return props.onClick(item, index); } }, item, { key: item.id || index, className: bem(item.isActive && 'active', bem.element('item-link'), item.className) })),
|
|
51
51
|
item.items && item.items.length > 0 && (React.createElement("ul", { className: bem('nav flex-column', bem.element('sub-list')) }, renderItems(item.items))))); });
|
|
52
52
|
};
|
|
53
53
|
return (React.createElement("ul", { className: bem('nav flex-column', bem.block(), props.className) },
|
package/nav/Nav/NavTabsView.js
CHANGED
|
@@ -44,7 +44,7 @@ function NavTabsView(props) {
|
|
|
44
44
|
var bem = (0, hooks_1.useBem)('NavTabsView');
|
|
45
45
|
return (React.createElement("div", { className: bem(bem.block(), props.className) },
|
|
46
46
|
React.createElement("div", { className: bem('nav nav-tabs', !props.children && 'mb-3') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: 'nav-item' },
|
|
47
|
-
React.createElement(Button_1["default"], __assign({ link: true, onClick: function () { return props.onClick(item, index); }
|
|
47
|
+
React.createElement(Button_1["default"], __assign({ link: true, onClick: function () { return props.onClick(item, index); } }, item, { className: bem('nav-link', item.isActive && 'active', item.className) })))); })),
|
|
48
48
|
props.children));
|
|
49
49
|
}
|
|
50
50
|
exports["default"] = NavTabsView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.39",
|
|
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 || >=3.0.0-beta.
|
|
38
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.18",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.4",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"typescript": "^4.9.5"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.
|
|
56
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.18"
|
|
57
57
|
}
|
|
58
58
|
}
|