@steroidsjs/bootstrap 3.0.3 → 3.0.5

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.
@@ -51,6 +51,8 @@ function CheckboxFieldView(props) {
51
51
  React.createElement("input", __assign({ className: bem.element('input', {
52
52
  hasCustomColor: !!props.color
53
53
  }), id: props.id || id, disabled: props.disabled, required: props.required }, props.inputProps)),
54
- React.createElement("label", { className: bem.element('label'), htmlFor: props.id || id }, props.label && (React.createElement("span", { className: bem.element('label-text', { required: props.required }) }, props.label)))));
54
+ React.createElement("label", { className: bem.element('label', {
55
+ 'has-label-only': !props.id
56
+ }), htmlFor: props.id || id }, props.label && (React.createElement("span", { className: bem.element('label-text', { required: props.required }) }, props.label)))));
55
57
  }
56
58
  exports["default"] = CheckboxFieldView;
@@ -146,7 +146,6 @@ $disabled-text-color: var(--disabled-text-color);
146
146
  background-color: var(--checkbox-custom-color);
147
147
  }
148
148
 
149
-
150
149
  //FOCUS
151
150
  &:focus + #{$root}__label::after {
152
151
  opacity: 0;
@@ -232,3 +231,35 @@ $disabled-text-color: var(--disabled-text-color);
232
231
  color: variables.$danger;
233
232
  }
234
233
  }
234
+
235
+ .CheckboxFieldView:has(.CheckboxFieldView__label_has-label-only) .CheckboxFieldView {
236
+ $root: &;
237
+
238
+ &__label {
239
+ &::before,
240
+ &::after {
241
+ display: none;
242
+ }
243
+
244
+ &-text {
245
+ margin-left: 0 !important;
246
+ }
247
+ }
248
+
249
+ &_size {
250
+ &_sm, &_md, &_lg {
251
+ #{$root}__label {
252
+ &::before {
253
+ display: none;
254
+ }
255
+ &::after {
256
+ display: none;
257
+ }
258
+
259
+ #{$root}__label-text {
260
+ margin-left: 0;
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
@@ -48,7 +48,7 @@ function CheckboxListFieldView(props) {
48
48
  },
49
49
  disabled: props.disabled
50
50
  },
51
- size: props.size,
51
+ size: checkbox.size || props.size,
52
52
  color: checkbox.color,
53
53
  required: checkbox.required
54
54
  }); })));
@@ -10,8 +10,8 @@ var TreeItemView_1 = __importDefault(require("../../nav/TreeItem/TreeItemView"))
10
10
  function CheckboxTreeFieldView(props) {
11
11
  var bem = (0, useBem_1["default"])('CheckboxTreeFieldView');
12
12
  var prefix = (0, hooks_1.useUniqueId)('checkbox');
13
- return (react_1["default"].createElement("div", { className: bem.block() }, props.items.map(function (checkbox) { return (react_1["default"].createElement(TreeItemView_1["default"], { key: checkbox.uniqueId, item: checkbox, levelPadding: props.levelPadding, hasIconExpandOnly: true }, props.renderCheckbox({
14
- id: "".concat(prefix, "_").concat(checkbox.id),
13
+ return (react_1["default"].createElement("div", { className: bem.block() }, props.items.map(function (checkbox) { return (react_1["default"].createElement(TreeItemView_1["default"], { key: checkbox.uniqueId, item: checkbox, levelPadding: props.levelPadding, onNestedItemClick: function () { return props.onItemSelect(checkbox); }, hasIconExpandOnly: !props.hasOnlyLeafCheckboxes && checkbox.hasItems, withoutPointerOnLabel: props.hasOnlyLeafCheckboxes && checkbox.hasItems }, props.renderCheckbox({
14
+ id: props.hasOnlyLeafCheckboxes && checkbox.hasItems ? null : "".concat(prefix, "_").concat(checkbox.id),
15
15
  label: checkbox.label,
16
16
  inputProps: {
17
17
  name: "".concat(prefix, "_").concat(checkbox.id),
@@ -3,3 +3,9 @@
3
3
  flex-flow: column nowrap;
4
4
  gap: 8px;
5
5
  }
6
+
7
+ .CheckboxTreeFieldView:has(.TreeItemView_without-pointer-on-label) .TreeItemView_without-pointer-on-label {
8
+ .CheckboxFieldView__label {
9
+ cursor: default;
10
+ }
11
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  @use "../../scss/variables";
3
2
 
4
3
  :root {
@@ -15,7 +14,6 @@ $background-th: var(--background-th);
15
14
  $background-td-alternating: var(--background-td-alternating);
16
15
 
17
16
  .FieldListView {
18
- overflow-x: auto;
19
17
  table {
20
18
  width: 100%;
21
19
  background-color: transparent;
@@ -23,7 +21,20 @@ $background-td-alternating: var(--background-td-alternating);
23
21
  border-collapse: separate;
24
22
  border-radius: 10px;
25
23
  border-spacing: 0;
26
- overflow: hidden;
24
+ }
25
+
26
+ thead tr:first-child {
27
+ th:first-child {
28
+ border-radius: 10px 0 0 0;
29
+ -moz-border-radius: 10px 0 0 0;
30
+ -webkit-border-radius: 10px 0 0 0;
31
+ }
32
+
33
+ th:last-child {
34
+ border-radius: 0 10px 0 0;
35
+ -moz-border-radius: 0 10px 0 0;
36
+ -webkit-border-radius: 0 10px 0 0;
37
+ }
27
38
  }
28
39
 
29
40
  th:not(:last-child),
@@ -43,10 +54,6 @@ $background-td-alternating: var(--background-td-alternating);
43
54
  border-bottom: 1px solid variables.$gray-dark;
44
55
  }
45
56
 
46
- tfoot > tr > td {
47
- border-top: 1px solid variables.$gray-dark;
48
- }
49
-
50
57
  tr td {
51
58
  padding: 12px;
52
59
  }
@@ -62,7 +69,11 @@ $background-td-alternating: var(--background-td-alternating);
62
69
 
63
70
  td {
64
71
  background: variables.$element-background-color;
65
- overflow: hidden;
72
+ }
73
+
74
+ tfoot > tr > td {
75
+ border-top: 1px solid variables.$gray-dark;
76
+ border-radius: 0 0 10px 10px;
66
77
  }
67
78
 
68
79
  &_hasAlternatingColors {
@@ -86,3 +97,17 @@ $background-td-alternating: var(--background-td-alternating);
86
97
  margin-bottom: 0;
87
98
  }
88
99
  }
100
+
101
+ .FieldListView:not(:has(tfoot)) {
102
+ tbody tr:last-child td:first-child {
103
+ border-radius: 0 0 0 10px !important;
104
+ -moz-border-radius: 0 0 0 10px !important;
105
+ -webkit-border-radius: 0 0 0 10px !important;
106
+ }
107
+
108
+ tbody tr:last-child td:last-child {
109
+ border-radius: 0 0 10px 0 !important;
110
+ -moz-border-radius: 0 0 10px 0 !important;
111
+ -webkit-border-radius: 0 0 10px 0 !important;
112
+ }
113
+ }
@@ -60,8 +60,8 @@ function FormView(props) {
60
60
  });
61
61
  return (React.createElement("form", { ref: formRef, className: bem(bem.block(), props.className), onSubmit: props.onSubmit, style: props.style },
62
62
  props.children,
63
- (props.fields || []).map(function (field, index) { return (React.createElement(Field_1["default"], __assign({ key: index }, ((0, isString_1["default"])(field) ? { attribute: field } : field)))); }),
63
+ (props.fields || []).map(function (field, index) { return (React.createElement(Field_1["default"], __assign({ key: index }, ((0, isString_1["default"])(field) ? { attribute: field } : field), { size: field.size || props.size || null }))); }),
64
64
  props.buttons,
65
- props.submitLabel && (React.createElement(Button_1["default"], { type: 'submit', label: props.submitLabel }))));
65
+ props.submitLabel && (React.createElement(Button_1["default"], __assign({ type: 'submit', label: props.submitLabel }, props.submitButtonProps)))));
66
66
  }
67
67
  exports["default"] = React.memo(FormView);
@@ -48,7 +48,7 @@ function RadioListFieldView(props) {
48
48
  },
49
49
  disabled: props.disabled
50
50
  },
51
- size: props.size,
51
+ size: radio.size || props.size,
52
52
  required: radio.required
53
53
  }); })));
54
54
  }
package/index.scss CHANGED
@@ -53,7 +53,6 @@
53
53
  @include meta.load-css('form/ImageField/ImageFieldView');
54
54
  @include meta.load-css('form/FileField/FileFieldItemView');
55
55
  @include meta.load-css('form/FieldSet/FieldSetView');
56
- @include meta.load-css('form/Form/FormView');
57
56
  @include meta.load-css('form/WizardForm/WizardFormView');
58
57
  @include meta.load-css('form/HtmlField/HtmlFieldView');
59
58
  @include meta.load-css('form/InputField/InputFieldView');
@@ -77,7 +77,7 @@ function HeaderView(props) {
77
77
  return (React.createElement("header", { className: bem(bem.block({
78
78
  size: props.size
79
79
  }), props.className), style: props.style },
80
- props.logo && (React.createElement(nav_1.Link, __assign({ className: bem.element('logo'), toRoute: 'root', size: props.size }, props.logo.linkProps),
80
+ props.logo && (React.createElement(nav_1.Link, __assign({ className: bem(bem.element('logo'), props.logo.className), toRoute: 'root', size: props.size }, props.logo.linkProps),
81
81
  props.logo.icon && ((0, renderIcon_1["default"])(props.logo.icon, {
82
82
  className: bem.element('logo-image')
83
83
  })),
@@ -47,18 +47,24 @@ function TreeItemView(props) {
47
47
  var bem = (0, useBem_1["default"])('TreeItemView');
48
48
  var paddingBasedOnIcon = props.item.hasItems ? PADDING_WITH_ICON : PADDING_WITHOUT_ICON;
49
49
  var onExpandProps = (0, react_1.useMemo)(function () { return ({
50
- onClick: props.item.onClick,
50
+ onClick: function (e) {
51
+ props.item.onClick(e);
52
+ if (!props.hasIconExpandOnly && props.onNestedItemClick) {
53
+ props.onNestedItemClick();
54
+ }
55
+ },
51
56
  onKeyDown: function (e) { return e.key === 'Enter' && props.item.onClick(e); },
52
57
  role: 'button',
53
58
  tabIndex: 0
54
- }); }, [props.item]);
59
+ }); }, [props]);
55
60
  return (React.createElement("div", __assign({ key: props.item.uniqueId, className: bem(bem.block({
56
61
  selected: props.item.isSelected,
57
62
  opened: props.item.isOpened,
58
- 'has-items': props.item.hasItems || props.hideIcon,
63
+ 'has-items': !props.hasIconExpandOnly && (props.item.hasItems || props.hideIcon),
59
64
  level: props.item.level,
60
65
  disabled: props.item.disabled,
61
- 'hide-icon': props.hideIcon
66
+ 'hide-icon': props.hideIcon,
67
+ 'without-pointer-on-label': props.hasIconExpandOnly && props.withoutPointerOnLabel
62
68
  }), props.className), style: {
63
69
  paddingLeft: !props.hideIcon && "".concat(props.item.level * props.levelPadding + paddingBasedOnIcon, "px")
64
70
  } }, (!props.hasIconExpandOnly && onExpandProps)),
@@ -52,7 +52,7 @@ $grid-icon-color: var(--grid-icon-color);
52
52
  &__icon {
53
53
  min-width: 24px;
54
54
  min-height: 24px;
55
-
55
+ cursor: pointer;
56
56
  transform: rotate(0);
57
57
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
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",
38
+ "@steroidsjs/core": "^3.0.5",
39
39
  "@steroidsjs/eslint-config": "^2.1.6",
40
40
  "@types/enzyme": "^3.10.8",
41
41
  "@types/googlemaps": "^3.43.3",
@@ -1,4 +0,0 @@
1
- .FormView {
2
- display: flex;
3
- flex-flow: column nowrap;
4
- }