@steroidsjs/bootstrap 3.0.5 → 3.0.6
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.
|
@@ -10,7 +10,7 @@ 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,
|
|
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: props.hasIconExpandOnly, withoutPointerOnLabel: props.hasOnlyLeafCheckboxes && checkbox.hasItems && !checkbox.isOpened }, props.renderCheckbox({
|
|
14
14
|
id: props.hasOnlyLeafCheckboxes && checkbox.hasItems ? null : "".concat(prefix, "_").concat(checkbox.id),
|
|
15
15
|
label: checkbox.label,
|
|
16
16
|
inputProps: {
|
|
@@ -18,7 +18,10 @@ function CheckboxTreeFieldView(props) {
|
|
|
18
18
|
type: 'checkbox',
|
|
19
19
|
checked: props.selectedIds.includes(checkbox.id),
|
|
20
20
|
onChange: function () {
|
|
21
|
-
props.
|
|
21
|
+
var isOpenedLabel = props.hasOnlyLeafCheckboxes && (checkbox.isOpened || !checkbox.hasItems);
|
|
22
|
+
if (isOpenedLabel || !props.hasOnlyLeafCheckboxes) {
|
|
23
|
+
props.onItemSelect(checkbox);
|
|
24
|
+
}
|
|
22
25
|
},
|
|
23
26
|
disabled: checkbox.disabled,
|
|
24
27
|
required: checkbox.required
|
|
@@ -47,12 +47,7 @@ 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: function (e) {
|
|
51
|
-
props.item.onClick(e);
|
|
52
|
-
if (!props.hasIconExpandOnly && props.onNestedItemClick) {
|
|
53
|
-
props.onNestedItemClick();
|
|
54
|
-
}
|
|
55
|
-
},
|
|
50
|
+
onClick: function (e) { return props.item.onClick(e); },
|
|
56
51
|
onKeyDown: function (e) { return e.key === 'Enter' && props.item.onClick(e); },
|
|
57
52
|
role: 'button',
|
|
58
53
|
tabIndex: 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
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.
|
|
38
|
+
"@steroidsjs/core": "^3.0.6",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.6",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|