UNPKG

aurelia-materialize-bridge

Version:
103 lines 4.98 kB
System.register(["tslib", "../aurelia"], function (exports_1, context_1) { "use strict"; var tslib_1, au, MdModal; var __moduleName = context_1 && context_1.id; return { setters: [ function (tslib_1_1) { tslib_1 = tslib_1_1; }, function (au_1) { au = au_1; } ], execute: function () { MdModal = /** @class */ (function () { function MdModal(element) { this.element = element; this.log = au.getLogger("md-modal"); this.attributeManager = new au.AttributeManager(this.element); } MdModal.prototype.fixedFooterChanged = function () { if (this.element) { this.element.classList.toggle("modal-fixed-footer", this.fixedFooter); } }; MdModal.prototype.attached = function () { var _this = this; var options = { opacity: this.opacity, inDuration: this.inDuration, outDuration: this.outDuration, preventScrolling: this.preventScrolling, dismissible: this.dismissible, startingTop: this.startingTop, endingTop: this.endingTop, onOpenStart: function () { return au.fireMaterializeEvent(_this.element, "open-start"); }, onOpenEnd: function () { return au.fireMaterializeEvent(_this.element, "open-end"); }, onCloseStart: function () { return au.fireMaterializeEvent(_this.element, "close-start"); }, onCloseEnd: function () { return au.fireMaterializeEvent(_this.element, "close-end"); } }; this.log.debug("modal options: ", options); au.cleanOptions(options); this.attributeManager.addClasses("modal"); this.instance = new M.Modal(this.element, options); }; MdModal.prototype.detached = function () { this.instance.destroy(); this.attributeManager.removeClasses("modal"); }; MdModal.prototype.open = function () { this.instance.open(); }; MdModal.prototype.close = function () { this.instance.close(); }; tslib_1.__decorate([ au.ato.bindable.numberMd, tslib_1.__metadata("design:type", Number) ], MdModal.prototype, "opacity", void 0); tslib_1.__decorate([ au.ato.bindable.numberMd, tslib_1.__metadata("design:type", Number) ], MdModal.prototype, "inDuration", void 0); tslib_1.__decorate([ au.ato.bindable.numberMd, tslib_1.__metadata("design:type", Number) ], MdModal.prototype, "outDuration", void 0); tslib_1.__decorate([ au.ato.bindable.booleanMd, tslib_1.__metadata("design:type", Boolean) ], MdModal.prototype, "preventScrolling", void 0); tslib_1.__decorate([ au.ato.bindable.booleanMd, tslib_1.__metadata("design:type", Boolean) ], MdModal.prototype, "dismissible", void 0); tslib_1.__decorate([ au.ato.bindable.stringMd, tslib_1.__metadata("design:type", String) ], MdModal.prototype, "startingTop", void 0); tslib_1.__decorate([ au.ato.bindable.stringMd, tslib_1.__metadata("design:type", String) ], MdModal.prototype, "endingTop", void 0); tslib_1.__decorate([ au.ato.bindable.booleanMd, tslib_1.__metadata("design:type", Boolean) ], MdModal.prototype, "fixedFooter", void 0); tslib_1.__decorate([ au.ato.bindable.booleanMd, tslib_1.__metadata("design:type", Boolean) ], MdModal.prototype, "bottomSheet", void 0); MdModal = tslib_1.__decorate([ au.customAttribute("md-modal"), au.autoinject, tslib_1.__metadata("design:paramtypes", [Element]) ], MdModal); return MdModal; }()); exports_1("MdModal", MdModal); } }; }); //# sourceMappingURL=modal.js.map