@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.
@@ -59,7 +59,7 @@
59
59
 
60
60
  &_link {
61
61
  justify-content: flex-start;
62
- background-color: #fff;
62
+ background-color: transparent;
63
63
  }
64
64
 
65
65
  &__icon {
@@ -1,7 +1,7 @@
1
1
  .DateFieldView {
2
2
  $root: &;
3
3
 
4
- padding: 0 8px;
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 {
@@ -53,7 +53,7 @@
53
53
  outline: none;
54
54
  background-color: transparent;
55
55
 
56
- padding: 10px 5px;
56
+ padding: $input-padding-y $input-padding-x;
57
57
  }
58
58
 
59
59
  &__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
- /* TODO Move to core component
37
- static defaultProps = {
38
- searchAutoFocus: true,
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])
@@ -21,7 +21,6 @@
21
21
  background-clip: padding-box;
22
22
 
23
23
  background-color: #fff;
24
- box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
25
24
  border: 1px solid $border-default;
26
25
  border-radius: 0.25rem;
27
26
  color: $heading;
@@ -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.NamedExoticComponent<IFieldListItemViewProps>;
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 FieldListItemView(props) {
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
- props.showAdd && !props.disabled && (React.createElement("button", { className: bem.element('link-add'), onClick: function (e) {
36
- e.preventDefault();
37
- props.onAdd();
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
- ;
@@ -25,13 +25,8 @@
25
25
  color: $danger;
26
26
  }
27
27
 
28
- &__link-add {
28
+ &__button-add {
29
29
  margin-left: 0.75rem;
30
- border-bottom: 1px dashed $link-color;
31
-
32
- &:hover {
33
- text-decoration: none;
34
- }
35
30
  }
36
31
 
37
32
  .FileFieldView__files {
@@ -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 '@steroidsjs/core/ui/form/ImageField/ImageField';
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('ImageFieldView');
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('button', {
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('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.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('button-label') }, !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 }))))));
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
- // Value state
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
- setValue(inputRef.current.value);
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
- setValue(inputRef.current.value);
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
  }
@@ -15,6 +15,7 @@ $tooltip-arrow-offset-vertical-bottom: 7px;
15
15
  transform: translate(0,0);
16
16
  opacity: 0;
17
17
  transition: opacity .15s ease-in, transform .15s ease-in;
18
+ z-index: 150;
18
19
 
19
20
  &_show {
20
21
  opacity: 1;
@@ -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 & IBemHocOutput): JSX.Element;
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
  }
@@ -4,6 +4,7 @@
4
4
  &__list {
5
5
  display: flex;
6
6
  list-style: none;
7
+ padding: 0;
7
8
  }
8
9
 
9
10
  &__item {
@@ -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.0-beta.6",
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.1.0-beta.27",
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: #410FAD;
3
- $primary-light: #D8CCF7;
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: #596886;
7
- $secondary-light: #E3EAF9;
5
+ $secondary: #97A7C8 !default;
6
+ $secondary-dark: darken($secondary, 25) !default;
7
+ $secondary-light: lighten($secondary, 50) !default;
8
8
 
9
- $heading: #152536;
10
- $body: #68717A;
11
- $white: #FFFFFF;
9
+ $success: #64D03E !default;
10
+ $success-dark: darken($success, 25) !default;
11
+ $success-light: lighten($success, 50) !default;
12
12
 
13
- $success: #64D03E;
14
- $success-dark: #218838;
15
- $success-light: #ABED94;
13
+ $danger: #FF4557 !default;
14
+ $danger-dark: darken($danger, 25) !default;
15
+ $danger-light: lighten($danger, 50) !default;
16
16
 
17
- $danger: #FF4557;
18
- $danger-dark: #DA2839;
19
- $danger-light: #ff99a3;
17
+ $warning: #fad826 !default;
18
+ $warning-dark: darken($warning, 25) !default;
19
+ $warning-light: lighten($warning, 50) !default;
20
20
 
21
- $warning: #fad826;
22
- $warning-dark: #dcc131;
23
- $warning-light: #fff3b2;
21
+ $info: #39bbd8 !default;
22
+ $info-dark: darken($info, 25) !default;
23
+ $info-light: lighten($info, 50) !default;
24
24
 
25
- $info: #39bbd8;
26
- $info-dark: #2796af;
27
- $info-light: #a7efff;
25
+ $light: #f8f9fa !default;
26
+ $light-dark: darken($light, 25) !default;
27
+ $light-light: lighten($light, 50) !default;
28
28
 
29
- $light: #f8f9fa;
30
- $light-dark: #e2e6ea;
31
- $light-light: #fafafa;
29
+ $dark: #343a40 !default;
30
+ $dark-dark: darken($dark, 25) !default;
31
+ $dark-light: lighten($dark, 50) !default;
32
32
 
33
- $dark: #343a40;
34
- $dark-dark: #1a1c1e;
35
- $dark-light: #acacac;
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
- "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
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;