UNPKG

azure-devops-ui

Version:

React components for building web UI in Azure DevOps

1 lines 2.15 kB
import{__assign,__extends}from"tslib";import"../../CommonImports";import"../../Core/core.css";import"./Dialog.css";import*as React from"react";import{PanelCloseButtonSize}from"../../Components/Panel/Panel.Props";import{TitleSize}from"../../Header";import{PanelFooter,PanelHeader}from"../../Panel";import{SurfaceContext}from"../../Surface";import{css}from"../../Util";import{CustomDialog}from"./CustomDialog";var dialogId=1,DialogInternal=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dialogId="dialog-".concat(dialogId++),e}return __extends(e,t),e.prototype.render=function(){var t=this,e=this.props,o=e.ariaDescribedBy,a=e.ariaLabel,i=e.ariaLabelledBy,s=e.blurDismiss,l=e.calloutClassName,r=e.calloutContentClassName,n=e.className,m=e.contentJustification,c=e.contentLocation,u=e.contentSize,d=e.defaultActiveElement,p=e.escDismiss,f=e.enterPrimary,C=e.footerButtonProps,g=e.lightDismiss,b=e.modal,P=e.onDismiss,D=e.overlay,h=e.resizable,e=e.showCloseButton,z=__assign({},this.props.titleProps),S=this.props.id||this.dialogId,y=z.id||(z.text?"".concat(S,"-title"):void 0);return z.id=y,void 0===z.size&&(z.size=TitleSize.Small),React.createElement(CustomDialog,{ariaDescribedBy:o,ariaLabel:a,ariaLabelledBy:i||y,blurDismiss:s,calloutClassName:l,calloutContentClassName:r,contentLocation:c,contentJustification:m,className:css("bolt-dialog",n),defaultActiveElement:d,escDismiss:p,id:S,lightDismiss:g,modal:b,onDismiss:P,overlay:D,contentSize:u,resizable:h,enterPrimary:f,primaryButtonProps:null==C?void 0:C.find(function(e){return e.primary})},React.createElement(PanelHeader,{onDismiss:P,closeButtonSize:PanelCloseButtonSize.small,showCloseButton:e,showSeparator:!1,titleProps:z}),React.createElement(SurfaceContext.Consumer,null,function(e){return React.createElement("div",{className:css("bolt-dialog-content flex-column flex-grow",!C&&"bolt-dialog-content-bottom-padding",e.horizontalClassName)},t.props.children)}),C&&React.createElement(PanelFooter,{className:css(h&&"bolt-dialog-resizable-footer"),showSeparator:!1,buttonProps:C}))},e.defaultProps={showCloseButton:!1},e}(React.Component);export{DialogInternal};