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