@steroidsjs/bootstrap 2.1.13 → 2.1.16

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.
@@ -21,6 +21,7 @@
21
21
 
22
22
  cursor: pointer;
23
23
  transition: color .1s ease-in;
24
+
24
25
  &:hover, &:active, &:focus {
25
26
  color: $calendar-primary-color;
26
27
  }
@@ -37,24 +38,27 @@
37
38
  fill: rgba(0, 0, 0, 0.25);
38
39
  transition: fill .1s ease-in;
39
40
  }
40
- &_one-arrow.IconView svg{
41
+
42
+ &_one-arrow.IconView svg {
41
43
  width: 8px;
42
44
  }
43
45
 
44
46
  &:hover svg {
45
- fill: rgba(0,0,0,.7);
47
+ fill: rgba(0, 0, 0, .7);
46
48
  }
47
49
  }
48
50
 
49
51
  &__selected-month, &__selected-year {
50
52
  font-size: 16px;
51
53
  }
54
+
52
55
  &__selected-month {
53
56
  margin-right: 5px;
54
57
  }
55
58
 
56
59
  // Panel changing Month/Year
57
60
 
61
+
58
62
  &__panel {
59
63
  z-index: 10;
60
64
  position: absolute;
@@ -63,67 +67,67 @@
63
67
  right: 0;
64
68
  bottom: 50px;
65
69
  background-color: $white;
66
- display: flex;
70
+
71
+ display: grid;
72
+ grid-template-columns: 1fr 1fr 1fr;
73
+ grid-template-rows: 0fr 1fr;
74
+ gap: 0 0;
75
+ grid-template-areas:
76
+ "HeaderMonths HeaderMonths HeaderYears"
77
+ "Months1stCol Months2ndCol YearsCol";
67
78
 
68
79
  &_full-height {
69
80
  bottom: 0;
70
81
  }
82
+ }
71
83
 
72
- &-inner {
73
- width: 100%;
74
- display: grid;
75
- grid-template-columns: 1fr 1fr 1fr;
76
- grid-template-rows: 0fr 1fr;
77
- gap: 0 0;
78
- grid-template-areas:
79
- "HeaderMonths HeaderMonths HeaderYears"
80
- "Months1stCol Months2ndCol YearsCol";
81
- }
84
+ &__panel-header {
85
+ padding: 5px;
82
86
 
83
- &-header {
84
- padding: 5px;
87
+ text-align: center;
88
+ border-bottom: 1px solid $border-color;
89
+ background-color: $calendar-primary-light-color;
85
90
 
86
- text-align: center;
87
- border-bottom: 1px solid $border-color;
88
- background-color: $calendar-primary-light-color;
91
+ &_months {
92
+ grid-area: HeaderMonths;
93
+ border-right: 1px solid $border-color;
94
+ }
89
95
 
90
- &_months {
91
- grid-area: HeaderMonths;
92
- border-right: 1px solid $border-color;
93
- }
94
- &_years {
95
- grid-area: HeaderYears;
96
- }
96
+ &_years {
97
+ grid-area: HeaderYears;
97
98
  }
99
+ }
98
100
 
99
- &-column-months {
100
- border-right: 1px solid $border-color;
101
+ &__panel-column-months {
102
+ border-right: 1px solid $border-color;
101
103
 
102
- &_first {
103
- grid-area: Months1stCol;
104
- }
105
- &_second {
106
- grid-area: Months2ndCol;
107
- }
104
+ &_first {
105
+ grid-area: Months1stCol;
108
106
  }
109
- &-column-years {
110
- height: 100%;
111
- grid-area: YearsCol;
112
- overflow: auto;
107
+
108
+ &_second {
109
+ grid-area: Months2ndCol;
113
110
  }
111
+ }
114
112
 
115
- &-cell {
116
- padding: 5px 15px;
117
- cursor: pointer;
113
+ &__panel-column-years {
114
+ height: 100%;
115
+ grid-area: YearsCol;
116
+ overflow: auto;
117
+ }
118
+
119
+ &__panel-cell {
120
+ padding: 5px 15px;
121
+ cursor: pointer;
122
+
123
+ &_selected {
124
+ background-color: $calendar-primary-light-color;
125
+ }
118
126
 
119
- &_selected {
120
- background-color: $calendar-primary-light-color;
121
- }
127
+ transition: background-color .1s ease-in;
122
128
 
123
- transition: background-color .1s ease-in;
124
- &:hover {
125
- background-color: $calendar-secondary-light-color;
126
- }
129
+ &:hover {
130
+ background-color: $calendar-secondary-light-color;
127
131
  }
128
132
  }
129
133
  }
@@ -18,21 +18,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  exports.__esModule = true;
25
+ var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
22
26
  var React = __importStar(require("react"));
23
27
  var react_use_1 = require("react-use");
24
28
  var hooks_1 = require("@steroidsjs/core/hooks");
25
29
  require("./DropDownView.scss");
30
+ var react_1 = require("react");
26
31
  function DropDownView(props) {
27
32
  var _a;
28
33
  var bem = hooks_1.useBem('DropDownView');
34
+ var ui = hooks_1.useComponents().ui;
29
35
  react_use_1.useMount(function () {
30
36
  props.calculatePosition(props.forwardedRef.current.getBoundingClientRect());
31
37
  });
38
+ var contentProps = react_1.useMemo(function () { return ({
39
+ onClose: props.onClose
40
+ }); }, [props.onClose]);
41
+ var content = props.content();
42
+ if (isFunction_1["default"](content)) {
43
+ content = ui.renderView(content, contentProps);
44
+ }
32
45
  return (React.createElement("div", { ref: props.forwardedRef, className: bem(bem.block((_a = {
33
46
  show: props.isComponentVisible
34
47
  },
35
48
  _a["position-" + props.position] = !!props.position,
36
- _a)), props.className), style: props.style }, props.content()));
49
+ _a)), props.className), style: props.style }, content));
37
50
  }
38
51
  exports["default"] = DropDownView;
@@ -38,9 +38,23 @@ var isString_1 = __importDefault(require("lodash-es/isString"));
38
38
  var hooks_1 = require("@steroidsjs/core/hooks");
39
39
  var Field_1 = __importDefault(require("@steroidsjs/core/ui/form/Field"));
40
40
  var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
41
+ var react_use_1 = require("react-use");
42
+ var react_1 = require("react");
41
43
  function FormView(props) {
42
44
  var bem = hooks_1.useBem('FormView');
43
- return (React.createElement("form", { className: bem(bem.block({
45
+ var formRef = react_1.useRef(null);
46
+ // Auto focus
47
+ react_use_1.useMount(function () {
48
+ if (props.autoFocus) {
49
+ var inputEl_1 = formRef.current.querySelector('input:not([type=hidden])');
50
+ setTimeout(function () {
51
+ if (inputEl_1 && inputEl_1.focus) {
52
+ inputEl_1.focus();
53
+ }
54
+ }, 10);
55
+ }
56
+ });
57
+ return (React.createElement("form", { ref: formRef, className: bem(bem.block({
44
58
  border: props.isBordered,
45
59
  inline: props.layout.layout === 'inline'
46
60
  }), props.className, props.layout.layout === 'horizontal' && 'form-horizontal'), onSubmit: props.onSubmit, style: props.style },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "2.1.13",
3
+ "version": "2.1.16",
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.2.40",
22
+ "@steroidsjs/core": "^2.2.57",
23
23
  "bootstrap": "^4.5.2",
24
24
  "lodash": "^4.17.20",
25
25
  "lodash-es": "^4.17.20",