@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
24 lines (23 loc) • 1.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PopupPanel = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const clsx_1 = tslib_1.__importDefault(require("clsx"));
const ButtonInfo_1 = require("../../Buttons/ButtonInfo");
const Flex_1 = require("../../../../components/Flex");
const PopupPanel = (props) => {
const baseClassName = 'ab-Adaptable-Popup__Panel';
return (React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('twa:flex-1 twa:flex twa:flex-col twa:gap-3 twa:p-1', props.className, baseClassName, props.scrollable === false ? 'twa:overflow-hidden' : 'twa:overflow-auto') },
React.createElement("div", { className: `${baseClassName}__Header twa:flex` },
React.createElement(Flex_1.Flex, { alignItems: "center" },
React.createElement(Flex_1.Box, { className: "twa:mr-0", "data-name": "space-before" }),
React.createElement("div", { className: `${baseClassName}__Header__Title` }, props.headerText),
React.createElement(Flex_1.Box, { className: "twa:mr-2", "data-name": "space-after" }),
props.infoLink != null && !props.infoLinkDisabled && (React.createElement(ButtonInfo_1.ButtonInfo, { tone: "none", variant: "text", iconSize: 24, onClick: () => window.open(props.infoLink, '_blank' // <- opens the link in a new tab or window.
) }))),
React.createElement(Flex_1.Box, { className: "twa:flex-1" }),
props.button),
React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('twa:w-full twa:flex twa:flex-col twa:flex-1 twa:min-h-0', `${baseClassName}__Body`, props.bodyClassName) }, props.children)));
};
exports.PopupPanel = PopupPanel;