UNPKG

azure-devops-ui

Version:

React components for building web UI in Azure DevOps

1 lines 1.44 kB
import{__assign,__extends}from"tslib";import"../../CommonImports";import"../../Core/core.css";import"./Panel.css";import*as React from"react";import{CustomPanel}from"./CustomPanel";import{PanelContent}from"./PanelContent";import{PanelFooter}from"./PanelFooter";import{PanelHeader}from"./PanelHeader";import{PanelOverlay}from"./PanelOverlay";var panelId=1,Panel=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.customPanelRef=React.createRef(),e.panelId="panel-".concat(panelId++),e}return __extends(e,t),e.prototype.render=function(){var e=this.props,t=e.backButtonProps,o=e.description,n=e.descriptionItem,r=e.footerButtonProps,a=e.onDismiss,s=e.overlayContent,i=e.showSeparator,l=e.titleProps,l=void 0===l?{}:l,m=e.id||this.panelId,c=l.id||(l.text?"".concat(m,"-title"):void 0);return React.createElement(CustomPanel,__assign({ariaLabelledBy:c},e,{id:m,lightDismiss:!s&&e.lightDismiss,ref:this.customPanelRef}),React.createElement(PanelHeader,{backButtonProps:t,description:n||o,onDismiss:a,showSeparator:i,titleProps:__assign({id:c},l)}),React.createElement(PanelContent,{className:e.contentClassName},e.children),r&&React.createElement(PanelFooter,{showSeparator:i,buttonProps:r}),s&&React.createElement(PanelOverlay,{overlayContent:s}))},e.prototype.animateOut=function(){return this.customPanelRef.current?this.customPanelRef.current.animateOut():Promise.resolve()},e}(React.Component);export{Panel};