1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.PanelView2 = void 0;
|
19 | var tslib_1 = require("tslib");
|
20 | var React = tslib_1.__importStar(require("react"));
|
21 | var common_1 = require("../../common");
|
22 | var buttons_1 = require("../button/buttons");
|
23 | var text_1 = require("../text/text");
|
24 |
|
25 | var PanelView2 = function (props) {
|
26 | var handleClose = React.useCallback(function () { return props.onClose(props.panel); }, [props.onClose, props.panel]);
|
27 | var maybeBackButton = props.previousPanel === undefined ? null : (React.createElement(buttons_1.Button, { "aria-label": "Back", className: common_1.Classes.PANEL_STACK_HEADER_BACK, icon: "chevron-left", minimal: true, onClick: handleClose, small: true, text: props.previousPanel.title, title: props.previousPanel.htmlTitle }));
|
28 |
|
29 |
|
30 |
|
31 | var PanelWrapper = React.useMemo(function () { return function () {
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | return props.panel.renderPanel(tslib_1.__assign({ closePanel: handleClose, openPanel: props.onOpen }, props.panel.props));
|
37 | }; }, [props.panel, props.onOpen]);
|
38 | return (React.createElement("div", { className: common_1.Classes.PANEL_STACK2_VIEW },
|
39 | props.showHeader && (React.createElement("div", { className: common_1.Classes.PANEL_STACK2_HEADER },
|
40 | React.createElement("span", null, maybeBackButton),
|
41 | React.createElement(text_1.Text, { className: common_1.Classes.HEADING, ellipsize: true, title: props.panel.htmlTitle }, props.panel.title),
|
42 | React.createElement("span", null))),
|
43 | React.createElement(PanelWrapper, null)));
|
44 | };
|
45 | exports.PanelView2 = PanelView2;
|
46 | exports.PanelView2.displayName = "".concat(common_1.DISPLAYNAME_PREFIX, ".PanelView2");
|
47 |
|
\ | No newline at end of file |