Panel

The panel component extends the modal dialog.

JavaScript

var Components = require("gd-sprest-bs").Components;

// Create the panel
var el = document.querySelector("#panel");
var panel = Components.Panel({
    el: el,
    type: Components.PanelTypes.Large,
    modalProps: {
        button: { text: "Show Panel" },
        id: "my-panel",
        title: "Panel Demo",
        onRenderBody: function(el) {
            // Render the body
        }
    }
});

TypeScript

import { Components } from "gd-sprest-bs";

// Create the panel
let el = document.querySelector("#panel");
let panel = Components.Panel({
    el: el,
    type: Components.PanelTypes.Large,
    modalProps: {
        button: { text: "Show Panel" },
        id: "my-panel",
        title: "Panel Demo",
        onRenderBody: (el) => {
            // Render the body
        }
    }
});

Web Component

// Return the panel properties return { type: $REST.Components.PanelTypes.Large, modalProps: { button: { text: "Show Panel" }, id: "my-wc-panel", title: "Panel Demo", onRenderBody: function(el) { // Render the body } } };
<script type="text/javascript" src="https://unpkg.com/gd-sprest-bs/wc/dist/gd-sprest-bs.js"></script>
<bs-panel>
    // Return the panel properties
    return {
        type: $REST.Components.PanelTypes.Large,
        modalProps: {
            button: { text: "Show Panel" },
            id: "my-panel",
            title: "Panel Demo",
            onRenderBody: function(el) {
                // Render the body
            }
        }
    };
</bs-panel>

References

Panel(props:IPanelProps):IPanel

PanelTypes

Name Value
Full 1
Large 2
Medium 3
Small 4
XLarge 5

IPanel

Name Returns Description
el Element The jquery element.
modal IModal The modal instance.
hide () => void Hides the panel.
show () => void Shows the panel.

IPanelProps

Name Type Description
className string The class name to apply to panel.
el HTMLElement The element to render the panel to.
modalProps IModalProps The modal properties.
type number The panel type. Reference the PanelTypes enumerator