UNPKG

@aliretail/react-materials-components

Version:
76 lines (68 loc) 2.45 kB
import _Dialog from "@alifd/next/es/dialog"; import _Button from "@alifd/next/es/button"; import _Icon from "@alifd/next/es/icon"; import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; import * as React from 'react'; import * as PropTypes from 'prop-types'; var SuccessDialog = /*#__PURE__*/function (_React$Component) { _inheritsLoose(SuccessDialog, _React$Component); function SuccessDialog() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.state = {}; return _this; } var _proto = SuccessDialog.prototype; _proto.render = function render() { var _this$props = this.props, title = _this$props.title, message = _this$props.message, _this$props$dataSourc = _this$props.dataSource, dataSource = _this$props$dataSourc === void 0 ? [] : _this$props$dataSourc, visible = _this$props.visible; var footer = /*#__PURE__*/React.createElement("div", null); return /*#__PURE__*/React.createElement(_Dialog, { footer: footer, visible: visible, closeable: "mask", className: "aliretail-successDialog" }, /*#__PURE__*/React.createElement("div", { className: "aliretail-dialogContent" }, /*#__PURE__*/React.createElement("div", { className: "iconHeadStyle" }, /*#__PURE__*/React.createElement(_Icon, { type: "success-filling", className: "iconStyle" })), /*#__PURE__*/React.createElement("div", { className: "dialog-content-title" }, title), /*#__PURE__*/React.createElement("div", { className: "dialog-content-message" }, message), /*#__PURE__*/React.createElement("div", { className: "dialog-content-buttons" }, dataSource.length > 0 && dataSource.map(function (t, i) { return /*#__PURE__*/React.createElement(_Button, { key: i, type: t.type, className: "buttonStyle", onClick: t.onClick }, t.text); })))); }; return SuccessDialog; }(React.Component); SuccessDialog.propTypes = { visible: PropTypes.bool, title: PropTypes.string, message: PropTypes.string, dataSource: PropTypes.array }; SuccessDialog.defaultProps = { visible: false, title: '', message: '', dataSource: [] }; export default SuccessDialog;