superdesk-ui-framework 3.0.56 → 3.0.58
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/app/styles/_sd-tag-input.scss +7 -2
- package/app-typescript/components/Button.tsx +1 -1
- package/app-typescript/components/RadioButtonGroup.tsx +9 -1
- package/app-typescript/components/TreeMenu.tsx +460 -0
- package/app-typescript/components/TreeSelect/KeyboardNavigation.tsx +63 -0
- package/app-typescript/components/TreeSelect/TreeSelect.tsx +2 -65
- package/app-typescript/components/TreeSelect/TreeSelectItem.tsx +15 -7
- package/dist/examples.bundle.js +2252 -1630
- package/dist/react/Index.tsx +5 -0
- package/dist/react/TreeMenu.tsx +277 -0
- package/dist/superdesk-ui.bundle.css +6 -3
- package/dist/superdesk-ui.bundle.js +865 -835
- package/dist/vendor.bundle.js +18 -18
- package/examples/pages/react/Index.tsx +5 -0
- package/examples/pages/react/TreeMenu.tsx +277 -0
- package/package.json +1 -1
- package/react/components/Button.js +1 -1
- package/react/components/RadioButtonGroup.js +6 -2
- package/react/components/TreeSelect/KeyboardNavigation.d.ts +1 -0
- package/react/components/TreeSelect/KeyboardNavigation.js +64 -0
- package/react/components/TreeSelect/TreeSelect.js +3 -53
- package/react/components/TreeSelect/TreeSelectItem.d.ts +2 -1
- package/react/components/TreeSelect/TreeSelectItem.js +10 -7
@@ -55,25 +55,28 @@ var TreeSelectItem = /** @class */ (function (_super) {
|
|
55
55
|
var _this = this;
|
56
56
|
return (React.createElement("li", { className: 'suggestion-item suggestion-item--multi-select', onClick: function (event) {
|
57
57
|
var _a, _b;
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
if (!_this.props.disabledItem) {
|
59
|
+
(_b = (_a = _this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
60
|
+
event.preventDefault();
|
61
|
+
event.stopPropagation();
|
62
|
+
_this.props.handleTree(event, _this.props.option);
|
63
|
+
}
|
62
64
|
} },
|
63
65
|
React.createElement("button", {
|
64
66
|
// the className is generated in order to focus the element later
|
65
|
-
className: "suggestion-item--btn ".concat(getPrefixedItemId(this.props.getId(this.props.option.value)))
|
67
|
+
className: "suggestion-item--btn ".concat(getPrefixedItemId(this.props.getId(this.props.option.value)))
|
68
|
+
+ (this.props.disabledItem ? ' suggestion-item--disabled' : ''), onKeyDown: function (event) {
|
66
69
|
var _a, _b;
|
67
70
|
if (event.key === 'Enter' && _this.props.option.children) {
|
68
71
|
(_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a);
|
69
72
|
}
|
70
|
-
} },
|
73
|
+
}, disabled: this.props.disabledItem },
|
71
74
|
(this.props.getBorderColor && !this.props.allowMultiple)
|
72
75
|
&& React.createElement("div", { className: "item-border", style: {
|
73
76
|
backgroundColor: this.props.getBorderColor(this.props.option.value),
|
74
77
|
} }),
|
75
78
|
React.createElement("span", { className: 'suggestion-item--bgcolor'
|
76
|
-
+ (this.props.selectedItem ? ' suggestion-item--
|
79
|
+
+ (this.props.selectedItem ? ' suggestion-item--selected' : ''), style: (this.props.getBackgroundColor && this.props.option.value)
|
77
80
|
? {
|
78
81
|
backgroundColor: this.props.getBackgroundColor(this.props.option.value),
|
79
82
|
color: (0, Label_1.getTextColor)(this.props.getBackgroundColor(this.props.option.value)),
|