@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
33 lines • 2.52 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IframeModal = void 0;
const react_1 = __importDefault(require("react"));
const constants_1 = require("../../configuration/constants");
const SimpleDialog_1 = __importDefault(require("../Dialog/SimpleDialog"));
const Iframe_1 = require("./Iframe");
/** Modal that contains an iframe and supports full screen mode. */
const IframeModal = (_a) => {
var { title, src, className = "", startFullscreen = false, compIframeProps = {}, htmlIframeProps = {}, headerOptions, size = "large" } = _a, otherSimpleDialogProps = __rest(_a, ["title", "src", "className", "startFullscreen", "compIframeProps", "htmlIframeProps", "headerOptions", "size"]);
const { useViewportHeight, useAvailableSpace, useContentHeight, ref } = compIframeProps, otherCompIframeProps = __rest(compIframeProps, ["useViewportHeight", "useAvailableSpace", "useContentHeight", "ref"]);
const internalRef = react_1.default.useRef(null);
const iframeRef = ref !== null && ref !== void 0 ? ref : internalRef;
return (react_1.default.createElement(SimpleDialog_1.default, Object.assign({ hasBorder: true, title: title, headerOptions: headerOptions, className: `${constants_1.CLASSPREFIX}-iframemodal` + (className ? ` ${className}` : ""), showFullScreenToggler: true, startInFullScreenMode: startFullscreen }, otherSimpleDialogProps),
react_1.default.createElement(Iframe_1.Iframe, Object.assign({ title: title, src: src, useAvailableSpace: !useViewportHeight && !useContentHeight ? true : useAvailableSpace, useContentHeight: useContentHeight, useViewportHeight: useViewportHeight, htmlIframeProps: htmlIframeProps }, otherCompIframeProps, { ref: ref !== null && ref !== void 0 ? ref : iframeRef }))));
};
exports.IframeModal = IframeModal;
exports.default = exports.IframeModal;
//# sourceMappingURL=IframeModal.js.map