UNPKG

@talend/react-bootstrap

Version:

Bootstrap 3 components built with React

54 lines 1.58 kB
import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import { bsClass, bsSizes, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils'; import { Size } from './utils/StyleConfig'; import { jsx as _jsx } from "react/jsx-runtime"; const propTypes = { /** * A css class to apply to the Modal dialog DOM node. */ dialogClassName: PropTypes.string }; class ModalDialog extends React.Component { render() { const { dialogClassName, className, style, children, onMouseDownDialog, ...props } = this.props; const [bsProps, elementProps] = splitBsProps(props); const bsClassName = prefix(bsProps); const modalStyle = { display: 'block', ...style }; const dialogClasses = { ...getClassSet(bsProps), [bsClassName]: false, [prefix(bsProps, 'dialog')]: true }; return /*#__PURE__*/_jsx("div", { ...elementProps, tabIndex: "-1", role: "dialog", style: modalStyle, className: classNames(className, bsClassName), children: /*#__PURE__*/_jsx("div", { className: classNames(dialogClassName, dialogClasses), onMouseDown: onMouseDownDialog, children: /*#__PURE__*/_jsx("div", { className: prefix(bsProps, 'content'), role: "document", children: children }) }) }); } } ModalDialog.propTypes = propTypes; export default bsClass('modal', bsSizes([Size.LARGE, Size.SMALL], ModalDialog)); //# sourceMappingURL=ModalDialog.js.map