superdesk-ui-framework 3.0.30 → 3.0.32
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-typescript/components/Modal.tsx +6 -4
- package/app-typescript/components/TreeSelect.tsx +5 -5
- package/dist/examples.bundle.js +171 -170
- package/dist/superdesk-ui.bundle.js +158 -157
- package/dist/vendor.bundle.js +2 -2
- package/package.json +1 -1
- package/react/components/Modal.d.ts +3 -3
- package/react/components/Modal.js +3 -1
- package/react/components/TreeSelect.js +4 -5
@@ -4,6 +4,8 @@ interface IProps {
|
|
4
4
|
className?: string;
|
5
5
|
theme?: string;
|
6
6
|
visible?: boolean;
|
7
|
+
zIndex?: number;
|
8
|
+
closeOnEscape?: boolean;
|
7
9
|
contentBg?: 'default' | 'medium' | 'dark';
|
8
10
|
contentPadding?: 'none' | 'small' | 'medium' | 'large';
|
9
11
|
size?: 'small' | 'medium' | 'large' | 'x-large';
|
@@ -12,10 +14,8 @@ interface IProps {
|
|
12
14
|
maximizable?: boolean;
|
13
15
|
headerTemplate?: JSX.Element | string;
|
14
16
|
footerTemplate?: JSX.Element | string;
|
15
|
-
closeOnEscape?: boolean;
|
16
|
-
zIndex?: number;
|
17
17
|
onShow?(): void;
|
18
|
-
onHide(): void;
|
18
|
+
onHide?(): void;
|
19
19
|
}
|
20
20
|
export declare class Modal extends React.Component<IProps, {}> {
|
21
21
|
render(): JSX.Element;
|
@@ -45,6 +45,7 @@ exports.Modal = void 0;
|
|
45
45
|
var React = __importStar(require("react"));
|
46
46
|
var dialog_1 = require("@superdesk/primereact/dialog");
|
47
47
|
var classnames_1 = __importDefault(require("classnames"));
|
48
|
+
var lodash_1 = require("lodash");
|
48
49
|
var Modal = /** @class */ (function (_super) {
|
49
50
|
__extends(Modal, _super);
|
50
51
|
function Modal() {
|
@@ -52,6 +53,7 @@ var Modal = /** @class */ (function (_super) {
|
|
52
53
|
}
|
53
54
|
Modal.prototype.render = function () {
|
54
55
|
var _a;
|
56
|
+
var _b;
|
55
57
|
var classes = (0, classnames_1.default)((_a = {},
|
56
58
|
_a["p-dialog-content--".concat(this.props.size)] = this.props.size,
|
57
59
|
_a['p-dialog-content-bg--default'] = this.props.contentBg === undefined,
|
@@ -60,7 +62,7 @@ var Modal = /** @class */ (function (_super) {
|
|
60
62
|
_a["p-dialog-content--".concat(this.props.contentPadding)] = this.props.contentPadding,
|
61
63
|
_a), this.props.className);
|
62
64
|
return (React.createElement("div", { style: { display: 'content' }, "data-theme": this.props.theme !== 'dark' ? null : 'dark-ui' },
|
63
|
-
React.createElement(dialog_1.Dialog, { id: this.props.id, visible: this.props.visible, header: this.props.headerTemplate, footer: this.props.footerTemplate, closeOnEscape: this.props.closeOnEscape, maximized: this.props.maximized, maximizable: this.props.maximizable, contentClassName: classes, onShow: this.props.onShow, onHide: this.props.onHide, zIndex: this.props.zIndex ? this.props.zIndex : 1000, position: this.props.position }, this.props.children)));
|
65
|
+
React.createElement(dialog_1.Dialog, { id: this.props.id, visible: this.props.visible, header: this.props.headerTemplate, footer: this.props.footerTemplate, closeOnEscape: this.props.closeOnEscape, maximized: this.props.maximized, maximizable: this.props.maximizable, contentClassName: classes, onShow: this.props.onShow, onHide: (_b = this.props.onHide) !== null && _b !== void 0 ? _b : lodash_1.noop, zIndex: this.props.zIndex ? this.props.zIndex : 1000, position: this.props.position, closable: this.props.onHide != null ? true : false }, this.props.children)));
|
64
66
|
};
|
65
67
|
return Modal;
|
66
68
|
}(React.Component));
|
@@ -80,11 +80,9 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
80
80
|
_this.componentDidMount = function () {
|
81
81
|
_this.recursion(_this.state.options);
|
82
82
|
document.addEventListener("mousedown", function (event) {
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
if ((_this.dropdownRef.current && !_this.dropdownRef.current.contains(event.target))
|
87
|
-
&& (_this.openDropdownRef.current && !_this.openDropdownRef.current.contains(event.target))) {
|
83
|
+
var _a, _b;
|
84
|
+
if ((((_a = _this.dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) !== true)
|
85
|
+
&& (((_b = _this.openDropdownRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) !== true)) {
|
88
86
|
_this.setState({ openDropdown: false });
|
89
87
|
}
|
90
88
|
});
|
@@ -93,6 +91,7 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
93
91
|
keyboardNavigation(e, _this.ref.current, _this.categoryButtonRef.current ? _this.buttonFocus : _this.inputFocus);
|
94
92
|
if (e.key === 'Backspace') {
|
95
93
|
_this.backButton();
|
94
|
+
_this.backButtonValue();
|
96
95
|
var buttonTarget = _this.state.buttonTarget;
|
97
96
|
var className = buttonTarget.pop();
|
98
97
|
if (className != null) {
|