@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
58 lines • 4.39 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import React from 'react';
import { Button, Modal, ModalBody, ModalFooter, ModalHeader, } from '@momentum-ui/react-collaboration';
var ModalDefault = /** @class */ (function (_super) {
__extends(ModalDefault, _super);
function ModalDefault() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.state = {
showModal: false,
showModal2: false,
};
return _this;
}
ModalDefault.prototype.render = function () {
var _this = this;
return (React.createElement("div", { className: "row" },
React.createElement("div", { className: "docs-example docs-example--spacing" },
React.createElement(Button, { children: "Default/Medium Modal", onClick: function () { return _this.setState({ showModal: true }); }, ariaLabel: "Open Modal", color: "primary", id: "default-1" }),
React.createElement(Button, { children: "Default/Medium Modal with Message", onClick: function () { return _this.setState({ showModal2: true }); }, ariaLabel: "Open Modal 2", color: "primary", id: "default-2" }),
React.createElement(Modal, { applicationId: "app", onHide: function () { return _this.setState({ showModal: false }); }, show: this.state.showModal, ref: function (modal1) { return (_this.modal1 = modal1); }, renderTo: "theme-provider", htmlId: "modal1", backdropClickExit: true },
React.createElement(ModalHeader, { headerLabel: "Default Modal", showCloseButton: true }),
React.createElement(ModalBody, null,
React.createElement("form", { ref: function (form1) { return (_this.form1 = form1); } })),
React.createElement(ModalFooter, null,
React.createElement(Button, { children: "Cancel", onClick: function () { return _this.modal1.closeModal(); }, ariaLabel: "Close Modal", color: "default" }),
React.createElement(Button, { children: "OK", type: "submit", onClick: function (e) {
e.preventDefault();
_this.modal1.closeModal();
}, ariaLabel: "Submit Form", color: "blue" }))),
React.createElement(Modal, { applicationId: "app", onHide: function () { return _this.setState({ showModal2: false }); }, show: this.state.showModal2, ref: function (modal2) { return (_this.modal2 = modal2); }, renderTo: "theme-provider", htmlId: "modal2", backdropClickExit: true },
React.createElement(ModalHeader, { headerLabel: "Default Modal", message: "To create a meeting invite manually, copy and paste the meeting information and people into your email calendar invite.", showCloseButton: true }),
React.createElement(ModalBody, null,
React.createElement("form", { ref: function (form1) { return (_this.form1 = form1); } })),
React.createElement(ModalFooter, null,
React.createElement(Button, { children: "Cancel", onClick: function () { return _this.modal2.closeModal(); }, ariaLabel: "Close Modal", color: "default" }),
React.createElement(Button, { children: "OK", type: "submit", onClick: function (e) {
e.preventDefault();
_this.modal2.closeModal();
}, ariaLabel: "Submit Form", color: "blue" }))))));
};
return ModalDefault;
}(React.PureComponent));
export default ModalDefault;
//# sourceMappingURL=Default.js.map