From db9a5bae584a74911ab9ddc7ec0ed2007b039b4e Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 6 Jan 2020 20:48:57 -0800 Subject: [PATCH] chore(all): prepare release 2.0.0 --- bower.json | 2 +- dist/amd/aurelia-dialog.js | 46 +++++++------- dist/amd/{dialog-controller.js => chunk.js} | 2 +- dist/amd/chunk.js.map | 1 + dist/amd/dialog-controller.js.map | 1 - dist/amd/native-dialog-renderer.js | 14 +++-- dist/amd/native-dialog-renderer.js.map | 2 +- dist/amd/ux-dialog-footer.js | 4 +- dist/amd/ux-dialog-header.js | 4 +- dist/amd/ux-dialog-renderer.js | 20 +++--- dist/amd/ux-dialog-renderer.js.map | 2 +- dist/commonjs/aurelia-dialog.js | 62 +++++++++---------- .../{dialog-controller.js => chunk.js} | 2 +- dist/commonjs/chunk.js.map | 1 + dist/commonjs/dialog-controller.js.map | 1 - dist/commonjs/native-dialog-renderer.js | 14 +++-- dist/commonjs/native-dialog-renderer.js.map | 2 +- dist/commonjs/ux-dialog-footer.js | 4 +- dist/commonjs/ux-dialog-header.js | 4 +- dist/commonjs/ux-dialog-renderer.js | 20 +++--- dist/commonjs/ux-dialog-renderer.js.map | 2 +- dist/es2015/aurelia-dialog.js | 4 +- .../es2015/{dialog-controller.js => chunk.js} | 4 +- dist/es2015/chunk.js.map | 1 + dist/es2015/dialog-controller.js.map | 1 - dist/es2015/native-dialog-renderer.js | 14 +++-- dist/es2015/native-dialog-renderer.js.map | 2 +- dist/es2015/ux-dialog-footer.js | 2 +- dist/es2015/ux-dialog-header.js | 2 +- dist/es2015/ux-dialog-renderer.js | 20 +++--- dist/es2015/ux-dialog-renderer.js.map | 2 +- dist/es2017/aurelia-dialog.js | 4 +- .../es2017/{dialog-controller.js => chunk.js} | 4 +- dist/es2017/chunk.js.map | 1 + dist/es2017/dialog-controller.js.map | 1 - dist/es2017/native-dialog-renderer.js | 14 +++-- dist/es2017/native-dialog-renderer.js.map | 2 +- dist/es2017/ux-dialog-footer.js | 2 +- dist/es2017/ux-dialog-header.js | 2 +- dist/es2017/ux-dialog-renderer.js | 20 +++--- dist/es2017/ux-dialog-renderer.js.map | 2 +- dist/native-modules/aurelia-dialog.js | 4 +- .../{dialog-controller.js => chunk.js} | 4 +- dist/native-modules/chunk.js.map | 1 + dist/native-modules/dialog-controller.js.map | 1 - dist/native-modules/native-dialog-renderer.js | 14 +++-- .../native-dialog-renderer.js.map | 2 +- dist/native-modules/ux-dialog-footer.js | 2 +- dist/native-modules/ux-dialog-header.js | 2 +- dist/native-modules/ux-dialog-renderer.js | 20 +++--- dist/native-modules/ux-dialog-renderer.js.map | 2 +- dist/system/attach-focus.js | 2 +- dist/system/aurelia-dialog.js | 18 +++--- .../system/{dialog-controller.js => chunk.js} | 14 ++--- dist/system/chunk.js.map | 1 + dist/system/default-styles.js | 2 +- dist/system/dialog-controller.js.map | 1 - dist/system/native-dialog-renderer.js | 16 ++--- dist/system/native-dialog-renderer.js.map | 2 +- dist/system/ux-dialog-body.js | 2 +- dist/system/ux-dialog-footer.js | 4 +- dist/system/ux-dialog-header.js | 4 +- dist/system/ux-dialog-renderer.js | 22 ++++--- dist/system/ux-dialog-renderer.js.map | 2 +- dist/system/ux-dialog.js | 2 +- dist/types/dialog-settings.d.ts | 9 ++- .../renderers/native-dialog-renderer.d.ts | 2 +- dist/types/renderers/ux-dialog-renderer.d.ts | 6 +- dist/umd-es2015/aurelia-dialog.js | 34 +++++----- dist/umd-es2015/aurelia-dialog.js.map | 2 +- dist/umd/aurelia-dialog.js | 34 +++++----- dist/umd/aurelia-dialog.js.map | 2 +- doc/CHANGELOG.md | 5 ++ package-lock.json | 2 +- package.json | 2 +- 75 files changed, 300 insertions(+), 256 deletions(-) rename dist/amd/{dialog-controller.js => chunk.js} (96%) create mode 100644 dist/amd/chunk.js.map delete mode 100644 dist/amd/dialog-controller.js.map rename dist/commonjs/{dialog-controller.js => chunk.js} (96%) create mode 100644 dist/commonjs/chunk.js.map delete mode 100644 dist/commonjs/dialog-controller.js.map rename dist/es2015/{dialog-controller.js => chunk.js} (92%) create mode 100644 dist/es2015/chunk.js.map delete mode 100644 dist/es2015/dialog-controller.js.map rename dist/es2017/{dialog-controller.js => chunk.js} (92%) create mode 100644 dist/es2017/chunk.js.map delete mode 100644 dist/es2017/dialog-controller.js.map rename dist/native-modules/{dialog-controller.js => chunk.js} (93%) create mode 100644 dist/native-modules/chunk.js.map delete mode 100644 dist/native-modules/dialog-controller.js.map rename dist/system/{dialog-controller.js => chunk.js} (91%) create mode 100644 dist/system/chunk.js.map delete mode 100644 dist/system/dialog-controller.js.map diff --git a/bower.json b/bower.json index 19be1a5..347a583 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-dialog", - "version": "2.0.0-rc.8", + "version": "2.0.0", "description": "A dialog plugin for Aurelia.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-dialog.js b/dist/amd/aurelia-dialog.js index fa4286d..2c2bfc2 100644 --- a/dist/amd/aurelia-dialog.js +++ b/dist/amd/aurelia-dialog.js @@ -1,4 +1,4 @@ -define(['require', 'exports', './dialog-controller', 'aurelia-pal', 'aurelia-dependency-injection', 'aurelia-templating'], function (require, exports, dialogController, aureliaPal, aureliaDependencyInjection, aureliaTemplating) { 'use strict'; +define(['require', 'exports', './chunk', 'aurelia-pal', 'aurelia-dependency-injection', 'aurelia-templating'], function (require, exports, __chunk_1, aureliaPal, aureliaDependencyInjection, aureliaTemplating) { 'use strict'; var DefaultDialogSettings = (function () { function DefaultDialogSettings() { @@ -50,7 +50,7 @@ define(['require', 'exports', './dialog-controller', 'aurelia-pal', 'aurelia-dep .then(function (_a) { var rendererImpl = _a[0], $cssText = _a[1]; var fwConfig = _this.fwConfig; - fwConfig.transient(dialogController.Renderer, rendererImpl); + fwConfig.transient(__chunk_1.Renderer, rendererImpl); if ($cssText) { aureliaPal.DOM.injectStyles($cssText); } @@ -133,25 +133,25 @@ define(['require', 'exports', './dialog-controller', 'aurelia-pal', 'aurelia-dep if (!rejectOnCancel) { return { wasCancelled: true }; } - throw dialogController.createDialogCancelError(); + throw __chunk_1.createDialogCancelError(); }; - DialogService.prototype.composeAndShowDialog = function (compositionContext, dialogController$1) { + DialogService.prototype.composeAndShowDialog = function (compositionContext, dialogController) { var _this = this; if (!compositionContext.viewModel) { - compositionContext.bindingContext = { controller: dialogController$1 }; + compositionContext.bindingContext = { controller: dialogController }; } return this.compositionEngine .compose(compositionContext) .then(function (controller) { - dialogController$1.controller = controller; - return dialogController$1.renderer - .showDialog(dialogController$1) + dialogController.controller = controller; + return dialogController.renderer + .showDialog(dialogController) .then(function () { - _this.controllers.push(dialogController$1); + _this.controllers.push(dialogController); _this.hasActiveDialog = _this.hasOpenDialog = !!_this.controllers.length; }, function (reason) { if (controller.viewModel) { - dialogController.invokeLifecycle(controller.viewModel, 'deactivate'); + __chunk_1.invokeLifecycle(controller.viewModel, 'deactivate'); } return Promise.reject(reason); }); @@ -184,25 +184,25 @@ define(['require', 'exports', './dialog-controller', 'aurelia-pal', 'aurelia-dep resolveCloseResult = resolve; rejectCloseResult = reject; }); - var dialogController$1 = childContainer.invoke(dialogController.DialogController, [settings, resolveCloseResult, rejectCloseResult]); - childContainer.registerInstance(dialogController.DialogController, dialogController$1); + var dialogController = childContainer.invoke(__chunk_1.DialogController, [settings, resolveCloseResult, rejectCloseResult]); + childContainer.registerInstance(__chunk_1.DialogController, dialogController); closeResult.then(function () { - removeController(_this, dialogController$1); + removeController(_this, dialogController); }, function () { - removeController(_this, dialogController$1); + removeController(_this, dialogController); }); - var compositionContext = this.createCompositionContext(childContainer, dialogController$1.renderer.getDialogContainer(), dialogController$1.settings); + var compositionContext = this.createCompositionContext(childContainer, dialogController.renderer.getDialogContainer(), dialogController.settings); var openResult = this.ensureViewModel(compositionContext).then(function (compositionContext) { if (!compositionContext.viewModel) { return true; } - return dialogController.invokeLifecycle(compositionContext.viewModel, 'canActivate', dialogController$1.settings.model); + return __chunk_1.invokeLifecycle(compositionContext.viewModel, 'canActivate', dialogController.settings.model); }).then(function (canActivate) { if (!canActivate) { - return _this._cancelOperation(dialogController$1.settings.rejectOnCancel); + return _this._cancelOperation(dialogController.settings.rejectOnCancel); } - return _this.composeAndShowDialog(compositionContext, dialogController$1) - .then(function () { return ({ controller: dialogController$1, closeResult: closeResult, wasCancelled: false }); }); + return _this.composeAndShowDialog(compositionContext, dialogController) + .then(function () { return ({ controller: dialogController, closeResult: closeResult, wasCancelled: false }); }); }); return asDialogOpenPromise(openResult); }; @@ -247,10 +247,10 @@ define(['require', 'exports', './dialog-controller', 'aurelia-pal', 'aurelia-dep return applyConfig(); } - exports.DialogController = dialogController.DialogController; - exports.Renderer = dialogController.Renderer; - exports.createDialogCancelError = dialogController.createDialogCancelError; - exports.createDialogCloseError = dialogController.createDialogCloseError; + exports.DialogController = __chunk_1.DialogController; + exports.Renderer = __chunk_1.Renderer; + exports.createDialogCancelError = __chunk_1.createDialogCancelError; + exports.createDialogCloseError = __chunk_1.createDialogCloseError; exports.DefaultDialogSettings = DefaultDialogSettings; exports.DialogConfiguration = DialogConfiguration; exports.DialogService = DialogService; diff --git a/dist/amd/dialog-controller.js b/dist/amd/chunk.js similarity index 96% rename from dist/amd/dialog-controller.js rename to dist/amd/chunk.js index 0aa1524..7ba02c0 100644 --- a/dist/amd/dialog-controller.js +++ b/dist/amd/chunk.js @@ -115,4 +115,4 @@ define(['exports'], function (exports) { 'use strict'; exports.invokeLifecycle = invokeLifecycle; }); -//# sourceMappingURL=dialog-controller.js.map +//# sourceMappingURL=chunk.js.map diff --git a/dist/amd/chunk.js.map b/dist/amd/chunk.js.map new file mode 100644 index 0000000..966138b --- /dev/null +++ b/dist/amd/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/amd/dialog-controller.js.map b/dist/amd/dialog-controller.js.map deleted file mode 100644 index 1e2e721..0000000 --- a/dist/amd/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/amd/native-dialog-renderer.js b/dist/amd/native-dialog-renderer.js index 9a1343a..54cf2de 100644 --- a/dist/amd/native-dialog-renderer.js +++ b/dist/amd/native-dialog-renderer.js @@ -127,14 +127,16 @@ define(['exports', 'aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-r e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - NativeDialogRenderer.prototype.clearEventHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + NativeDialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; NativeDialogRenderer.prototype.awaitTransition = function (setActiveInactive, ignore) { var _this = this; @@ -182,7 +184,7 @@ define(['exports', 'aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-r }; NativeDialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/amd/native-dialog-renderer.js.map b/dist/amd/native-dialog-renderer.js.map index 828651e..f04d6b6 100644 --- a/dist/amd/native-dialog-renderer.js.map +++ b/dist/amd/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/amd/ux-dialog-footer.js b/dist/amd/ux-dialog-footer.js index 6831141..ae0164f 100644 --- a/dist/amd/ux-dialog-footer.js +++ b/dist/amd/ux-dialog-footer.js @@ -1,4 +1,4 @@ -define(['exports', './dialog-controller'], function (exports, dialogController) { 'use strict'; +define(['exports', './chunk'], function (exports, __chunk_1) { 'use strict'; var UxDialogFooter = (function () { function UxDialogFooter(controller) { @@ -22,7 +22,7 @@ define(['exports', './dialog-controller'], function (exports, dialogController) this.buttons = ['Cancel', 'Ok']; } }; - UxDialogFooter.inject = [dialogController.DialogController]; + UxDialogFooter.inject = [__chunk_1.DialogController]; UxDialogFooter.$view = ""; UxDialogFooter.$resource = { name: 'ux-dialog-footer', diff --git a/dist/amd/ux-dialog-header.js b/dist/amd/ux-dialog-header.js index f8af30b..358a5f9 100644 --- a/dist/amd/ux-dialog-header.js +++ b/dist/amd/ux-dialog-header.js @@ -1,4 +1,4 @@ -define(['exports', './dialog-controller'], function (exports, dialogController) { 'use strict'; +define(['exports', './chunk'], function (exports, __chunk_1) { 'use strict'; var UxDialogHeader = (function () { function UxDialogHeader(controller) { @@ -9,7 +9,7 @@ define(['exports', './dialog-controller'], function (exports, dialogController) this.showCloseButton = !this.controller.settings.lock; } }; - UxDialogHeader.inject = [dialogController.DialogController]; + UxDialogHeader.inject = [__chunk_1.DialogController]; UxDialogHeader.$view = ""; UxDialogHeader.$resource = { name: 'ux-dialog-header', diff --git a/dist/amd/ux-dialog-renderer.js b/dist/amd/ux-dialog-renderer.js index 6b5a09d..34a79e4 100644 --- a/dist/amd/ux-dialog-renderer.js +++ b/dist/amd/ux-dialog-renderer.js @@ -113,7 +113,7 @@ define(['exports', 'aurelia-pal', 'aurelia-dependency-injection'], function (exp var dialogOverlay = this.dialogOverlay = aureliaPal.DOM.createElement(overlayTagName); var zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; var host = this.host; @@ -149,19 +149,21 @@ define(['exports', 'aurelia-pal', 'aurelia-dependency-injection'], function (exp this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); }; - DialogRenderer.prototype.setupClickHandling = function (dialogController) { + DialogRenderer.prototype.setupEventHandling = function (dialogController) { this.stopPropagation = function (e) { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = function (e) { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - DialogRenderer.prototype.clearClickHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + DialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; DialogRenderer.prototype.centerDialog = function () { var child = this.dialogContainer.children[0]; @@ -213,12 +215,12 @@ define(['exports', 'aurelia-pal', 'aurelia-dependency-injection'], function (exp this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions); }; DialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/amd/ux-dialog-renderer.js.map b/dist/amd/ux-dialog-renderer.js.map index 4ca5274..0e95e25 100644 --- a/dist/amd/ux-dialog-renderer.js.map +++ b/dist/amd/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/commonjs/aurelia-dialog.js b/dist/commonjs/aurelia-dialog.js index 63f0eaf..b05ef8e 100644 --- a/dist/commonjs/aurelia-dialog.js +++ b/dist/commonjs/aurelia-dialog.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); -var dialogController = require('./dialog-controller.js'); +var __chunk_1 = require('./chunk.js'); var aureliaPal = require('aurelia-pal'); var aureliaDependencyInjection = require('aurelia-dependency-injection'); var aureliaTemplating = require('aurelia-templating'); @@ -20,17 +20,17 @@ var DefaultDialogSettings = (function () { }()); var RENDERRERS = { - ux: function () { return new Promise(function (resolve) { resolve(require('./ux-dialog-renderer.js')); }).then(function (m) { return m.DialogRenderer; }); }, - native: function () { return new Promise(function (resolve) { resolve(require('./native-dialog-renderer.js')); }).then(function (m) { return m.NativeDialogRenderer; }); } + ux: function () { return Promise.resolve(require('./ux-dialog-renderer.js')).then(function (m) { return m.DialogRenderer; }); }, + native: function () { return Promise.resolve(require('./native-dialog-renderer.js')).then(function (m) { return m.NativeDialogRenderer; }); } }; var DEFAULT_RESOURCES = { - 'ux-dialog': function () { return new Promise(function (resolve) { resolve(require('./ux-dialog.js')); }).then(function (m) { return m.UxDialog; }); }, - 'ux-dialog-header': function () { return new Promise(function (resolve) { resolve(require('./ux-dialog-header.js')); }).then(function (m) { return m.UxDialogHeader; }); }, - 'ux-dialog-body': function () { return new Promise(function (resolve) { resolve(require('./ux-dialog-body.js')); }).then(function (m) { return m.UxDialogBody; }); }, - 'ux-dialog-footer': function () { return new Promise(function (resolve) { resolve(require('./ux-dialog-footer.js')); }).then(function (m) { return m.UxDialogFooter; }); }, - 'attach-focus': function () { return new Promise(function (resolve) { resolve(require('./attach-focus.js')); }).then(function (m) { return m.AttachFocus; }); } + 'ux-dialog': function () { return Promise.resolve(require('./ux-dialog.js')).then(function (m) { return m.UxDialog; }); }, + 'ux-dialog-header': function () { return Promise.resolve(require('./ux-dialog-header.js')).then(function (m) { return m.UxDialogHeader; }); }, + 'ux-dialog-body': function () { return Promise.resolve(require('./ux-dialog-body.js')).then(function (m) { return m.UxDialogBody; }); }, + 'ux-dialog-footer': function () { return Promise.resolve(require('./ux-dialog-footer.js')).then(function (m) { return m.UxDialogFooter; }); }, + 'attach-focus': function () { return Promise.resolve(require('./attach-focus.js')).then(function (m) { return m.AttachFocus; }); } }; -var DEFAULT_CSS_TEXT = function () { return new Promise(function (resolve) { resolve(require('./default-styles.js')); }).then(function (cssM) { return cssM['default']; }); }; +var DEFAULT_CSS_TEXT = function () { return Promise.resolve(require('./default-styles.js')).then(function (cssM) { return cssM['default']; }); }; var DialogConfiguration = (function () { function DialogConfiguration(frameworkConfiguration, applySetter) { var _this = this; @@ -57,7 +57,7 @@ var DialogConfiguration = (function () { .then(function (_a) { var rendererImpl = _a[0], $cssText = _a[1]; var fwConfig = _this.fwConfig; - fwConfig.transient(dialogController.Renderer, rendererImpl); + fwConfig.transient(__chunk_1.Renderer, rendererImpl); if ($cssText) { aureliaPal.DOM.injectStyles($cssText); } @@ -140,25 +140,25 @@ var DialogService = (function () { if (!rejectOnCancel) { return { wasCancelled: true }; } - throw dialogController.createDialogCancelError(); + throw __chunk_1.createDialogCancelError(); }; - DialogService.prototype.composeAndShowDialog = function (compositionContext, dialogController$1) { + DialogService.prototype.composeAndShowDialog = function (compositionContext, dialogController) { var _this = this; if (!compositionContext.viewModel) { - compositionContext.bindingContext = { controller: dialogController$1 }; + compositionContext.bindingContext = { controller: dialogController }; } return this.compositionEngine .compose(compositionContext) .then(function (controller) { - dialogController$1.controller = controller; - return dialogController$1.renderer - .showDialog(dialogController$1) + dialogController.controller = controller; + return dialogController.renderer + .showDialog(dialogController) .then(function () { - _this.controllers.push(dialogController$1); + _this.controllers.push(dialogController); _this.hasActiveDialog = _this.hasOpenDialog = !!_this.controllers.length; }, function (reason) { if (controller.viewModel) { - dialogController.invokeLifecycle(controller.viewModel, 'deactivate'); + __chunk_1.invokeLifecycle(controller.viewModel, 'deactivate'); } return Promise.reject(reason); }); @@ -191,25 +191,25 @@ var DialogService = (function () { resolveCloseResult = resolve; rejectCloseResult = reject; }); - var dialogController$1 = childContainer.invoke(dialogController.DialogController, [settings, resolveCloseResult, rejectCloseResult]); - childContainer.registerInstance(dialogController.DialogController, dialogController$1); + var dialogController = childContainer.invoke(__chunk_1.DialogController, [settings, resolveCloseResult, rejectCloseResult]); + childContainer.registerInstance(__chunk_1.DialogController, dialogController); closeResult.then(function () { - removeController(_this, dialogController$1); + removeController(_this, dialogController); }, function () { - removeController(_this, dialogController$1); + removeController(_this, dialogController); }); - var compositionContext = this.createCompositionContext(childContainer, dialogController$1.renderer.getDialogContainer(), dialogController$1.settings); + var compositionContext = this.createCompositionContext(childContainer, dialogController.renderer.getDialogContainer(), dialogController.settings); var openResult = this.ensureViewModel(compositionContext).then(function (compositionContext) { if (!compositionContext.viewModel) { return true; } - return dialogController.invokeLifecycle(compositionContext.viewModel, 'canActivate', dialogController$1.settings.model); + return __chunk_1.invokeLifecycle(compositionContext.viewModel, 'canActivate', dialogController.settings.model); }).then(function (canActivate) { if (!canActivate) { - return _this._cancelOperation(dialogController$1.settings.rejectOnCancel); + return _this._cancelOperation(dialogController.settings.rejectOnCancel); } - return _this.composeAndShowDialog(compositionContext, dialogController$1) - .then(function () { return ({ controller: dialogController$1, closeResult: closeResult, wasCancelled: false }); }); + return _this.composeAndShowDialog(compositionContext, dialogController) + .then(function () { return ({ controller: dialogController, closeResult: closeResult, wasCancelled: false }); }); }); return asDialogOpenPromise(openResult); }; @@ -254,10 +254,10 @@ function configure(frameworkConfig, callback) { return applyConfig(); } -exports.DialogController = dialogController.DialogController; -exports.Renderer = dialogController.Renderer; -exports.createDialogCancelError = dialogController.createDialogCancelError; -exports.createDialogCloseError = dialogController.createDialogCloseError; +exports.DialogController = __chunk_1.DialogController; +exports.Renderer = __chunk_1.Renderer; +exports.createDialogCancelError = __chunk_1.createDialogCancelError; +exports.createDialogCloseError = __chunk_1.createDialogCloseError; exports.DefaultDialogSettings = DefaultDialogSettings; exports.DialogConfiguration = DialogConfiguration; exports.DialogService = DialogService; diff --git a/dist/commonjs/dialog-controller.js b/dist/commonjs/chunk.js similarity index 96% rename from dist/commonjs/dialog-controller.js rename to dist/commonjs/chunk.js index 5ae6e58..7d6512e 100644 --- a/dist/commonjs/dialog-controller.js +++ b/dist/commonjs/chunk.js @@ -113,4 +113,4 @@ exports.Renderer = Renderer; exports.createDialogCancelError = createDialogCancelError; exports.createDialogCloseError = createDialogCloseError; exports.invokeLifecycle = invokeLifecycle; -//# sourceMappingURL=dialog-controller.js.map +//# sourceMappingURL=chunk.js.map diff --git a/dist/commonjs/chunk.js.map b/dist/commonjs/chunk.js.map new file mode 100644 index 0000000..6755ad8 --- /dev/null +++ b/dist/commonjs/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/commonjs/dialog-controller.js.map b/dist/commonjs/dialog-controller.js.map deleted file mode 100644 index cb741d6..0000000 --- a/dist/commonjs/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/commonjs/native-dialog-renderer.js b/dist/commonjs/native-dialog-renderer.js index f1e6b3a..8be04a8 100644 --- a/dist/commonjs/native-dialog-renderer.js +++ b/dist/commonjs/native-dialog-renderer.js @@ -131,14 +131,16 @@ var NativeDialogRenderer = (function () { e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - NativeDialogRenderer.prototype.clearEventHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + NativeDialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; NativeDialogRenderer.prototype.awaitTransition = function (setActiveInactive, ignore) { var _this = this; @@ -186,7 +188,7 @@ var NativeDialogRenderer = (function () { }; NativeDialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/commonjs/native-dialog-renderer.js.map b/dist/commonjs/native-dialog-renderer.js.map index 828651e..f04d6b6 100644 --- a/dist/commonjs/native-dialog-renderer.js.map +++ b/dist/commonjs/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/commonjs/ux-dialog-footer.js b/dist/commonjs/ux-dialog-footer.js index 81ad5c1..2f5a6f3 100644 --- a/dist/commonjs/ux-dialog-footer.js +++ b/dist/commonjs/ux-dialog-footer.js @@ -1,6 +1,6 @@ 'use strict'; -var dialogController = require('./dialog-controller.js'); +var __chunk_1 = require('./chunk.js'); var UxDialogFooter = (function () { function UxDialogFooter(controller) { @@ -24,7 +24,7 @@ var UxDialogFooter = (function () { this.buttons = ['Cancel', 'Ok']; } }; - UxDialogFooter.inject = [dialogController.DialogController]; + UxDialogFooter.inject = [__chunk_1.DialogController]; UxDialogFooter.$view = ""; UxDialogFooter.$resource = { name: 'ux-dialog-footer', diff --git a/dist/commonjs/ux-dialog-header.js b/dist/commonjs/ux-dialog-header.js index f719262..c9c72af 100644 --- a/dist/commonjs/ux-dialog-header.js +++ b/dist/commonjs/ux-dialog-header.js @@ -1,6 +1,6 @@ 'use strict'; -var dialogController = require('./dialog-controller.js'); +var __chunk_1 = require('./chunk.js'); var UxDialogHeader = (function () { function UxDialogHeader(controller) { @@ -11,7 +11,7 @@ var UxDialogHeader = (function () { this.showCloseButton = !this.controller.settings.lock; } }; - UxDialogHeader.inject = [dialogController.DialogController]; + UxDialogHeader.inject = [__chunk_1.DialogController]; UxDialogHeader.$view = ""; UxDialogHeader.$resource = { name: 'ux-dialog-header', diff --git a/dist/commonjs/ux-dialog-renderer.js b/dist/commonjs/ux-dialog-renderer.js index 0caee40..c55ed31 100644 --- a/dist/commonjs/ux-dialog-renderer.js +++ b/dist/commonjs/ux-dialog-renderer.js @@ -116,7 +116,7 @@ var DialogRenderer = (function () { var dialogOverlay = this.dialogOverlay = aureliaPal.DOM.createElement(overlayTagName); var zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; var host = this.host; @@ -152,19 +152,21 @@ var DialogRenderer = (function () { this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); }; - DialogRenderer.prototype.setupClickHandling = function (dialogController) { + DialogRenderer.prototype.setupEventHandling = function (dialogController) { this.stopPropagation = function (e) { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = function (e) { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - DialogRenderer.prototype.clearClickHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + DialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; DialogRenderer.prototype.centerDialog = function () { var child = this.dialogContainer.children[0]; @@ -216,12 +218,12 @@ var DialogRenderer = (function () { this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions); }; DialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/commonjs/ux-dialog-renderer.js.map b/dist/commonjs/ux-dialog-renderer.js.map index 7592c61..6950d97 100644 --- a/dist/commonjs/ux-dialog-renderer.js.map +++ b/dist/commonjs/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2015/aurelia-dialog.js b/dist/es2015/aurelia-dialog.js index 182a6f3..39daa3e 100644 --- a/dist/es2015/aurelia-dialog.js +++ b/dist/es2015/aurelia-dialog.js @@ -1,5 +1,5 @@ -import { R as Renderer, c as createDialogCancelError, i as invokeLifecycle, D as DialogController } from './dialog-controller.js'; -export { D as DialogController, R as Renderer, c as createDialogCancelError, a as createDialogCloseError } from './dialog-controller.js'; +import { a as Renderer, b as createDialogCancelError, c as invokeLifecycle, d as DialogController } from './chunk.js'; +export { d as DialogController, a as Renderer, b as createDialogCancelError, e as createDialogCloseError } from './chunk.js'; import { DOM } from 'aurelia-pal'; import { Container } from 'aurelia-dependency-injection'; import { ViewSlot, CompositionEngine } from 'aurelia-templating'; diff --git a/dist/es2015/dialog-controller.js b/dist/es2015/chunk.js similarity index 92% rename from dist/es2015/dialog-controller.js rename to dist/es2015/chunk.js index d68c0cb..3722c2c 100644 --- a/dist/es2015/dialog-controller.js +++ b/dist/es2015/chunk.js @@ -99,5 +99,5 @@ class DialogController { } DialogController.inject = [Renderer]; -export { DialogController as D, Renderer as R, createDialogCloseError as a, createDialogCancelError as c, invokeLifecycle as i }; -//# sourceMappingURL=dialog-controller.js.map +export { Renderer as a, createDialogCancelError as b, invokeLifecycle as c, DialogController as d, createDialogCloseError as e }; +//# sourceMappingURL=chunk.js.map diff --git a/dist/es2015/chunk.js.map b/dist/es2015/chunk.js.map new file mode 100644 index 0000000..cf52679 --- /dev/null +++ b/dist/es2015/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2015/dialog-controller.js.map b/dist/es2015/dialog-controller.js.map deleted file mode 100644 index 7d6ad93..0000000 --- a/dist/es2015/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2015/native-dialog-renderer.js b/dist/es2015/native-dialog-renderer.js index cd2fd0e..d8373a8 100644 --- a/dist/es2015/native-dialog-renderer.js +++ b/dist/es2015/native-dialog-renderer.js @@ -127,14 +127,16 @@ let NativeDialogRenderer = NativeDialogRenderer_1 = class NativeDialogRenderer { e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearEventHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } awaitTransition(setActiveInactive, ignore) { return new Promise(resolve => { @@ -179,7 +181,7 @@ let NativeDialogRenderer = NativeDialogRenderer_1 = class NativeDialogRenderer { return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); diff --git a/dist/es2015/native-dialog-renderer.js.map b/dist/es2015/native-dialog-renderer.js.map index aae4e80..59ad5fc 100644 --- a/dist/es2015/native-dialog-renderer.js.map +++ b/dist/es2015/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2015/ux-dialog-footer.js b/dist/es2015/ux-dialog-footer.js index a9015ba..fecfa7c 100644 --- a/dist/es2015/ux-dialog-footer.js +++ b/dist/es2015/ux-dialog-footer.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; class UxDialogFooter { constructor(controller) { diff --git a/dist/es2015/ux-dialog-header.js b/dist/es2015/ux-dialog-header.js index 7c61667..bec4d64 100644 --- a/dist/es2015/ux-dialog-header.js +++ b/dist/es2015/ux-dialog-header.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; class UxDialogHeader { constructor(controller) { diff --git a/dist/es2015/ux-dialog-renderer.js b/dist/es2015/ux-dialog-renderer.js index 38ddc77..0e3d3aa 100644 --- a/dist/es2015/ux-dialog-renderer.js +++ b/dist/es2015/ux-dialog-renderer.js @@ -112,7 +112,7 @@ class DialogRenderer { const dialogOverlay = this.dialogOverlay = DOM.createElement(overlayTagName); const zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; const host = this.host; @@ -148,19 +148,21 @@ class DialogRenderer { this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); } - setupClickHandling(dialogController) { + setupEventHandling(dialogController) { this.stopPropagation = e => { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = e => { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearClickHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } centerDialog() { const child = this.dialogContainer.children[0]; @@ -210,11 +212,11 @@ class DialogRenderer { this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); diff --git a/dist/es2015/ux-dialog-renderer.js.map b/dist/es2015/ux-dialog-renderer.js.map index e21afb6..b0570b3 100644 --- a/dist/es2015/ux-dialog-renderer.js.map +++ b/dist/es2015/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2017/aurelia-dialog.js b/dist/es2017/aurelia-dialog.js index 182a6f3..39daa3e 100644 --- a/dist/es2017/aurelia-dialog.js +++ b/dist/es2017/aurelia-dialog.js @@ -1,5 +1,5 @@ -import { R as Renderer, c as createDialogCancelError, i as invokeLifecycle, D as DialogController } from './dialog-controller.js'; -export { D as DialogController, R as Renderer, c as createDialogCancelError, a as createDialogCloseError } from './dialog-controller.js'; +import { a as Renderer, b as createDialogCancelError, c as invokeLifecycle, d as DialogController } from './chunk.js'; +export { d as DialogController, a as Renderer, b as createDialogCancelError, e as createDialogCloseError } from './chunk.js'; import { DOM } from 'aurelia-pal'; import { Container } from 'aurelia-dependency-injection'; import { ViewSlot, CompositionEngine } from 'aurelia-templating'; diff --git a/dist/es2017/dialog-controller.js b/dist/es2017/chunk.js similarity index 92% rename from dist/es2017/dialog-controller.js rename to dist/es2017/chunk.js index d68c0cb..3722c2c 100644 --- a/dist/es2017/dialog-controller.js +++ b/dist/es2017/chunk.js @@ -99,5 +99,5 @@ class DialogController { } DialogController.inject = [Renderer]; -export { DialogController as D, Renderer as R, createDialogCloseError as a, createDialogCancelError as c, invokeLifecycle as i }; -//# sourceMappingURL=dialog-controller.js.map +export { Renderer as a, createDialogCancelError as b, invokeLifecycle as c, DialogController as d, createDialogCloseError as e }; +//# sourceMappingURL=chunk.js.map diff --git a/dist/es2017/chunk.js.map b/dist/es2017/chunk.js.map new file mode 100644 index 0000000..cf52679 --- /dev/null +++ b/dist/es2017/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2017/dialog-controller.js.map b/dist/es2017/dialog-controller.js.map deleted file mode 100644 index 7d6ad93..0000000 --- a/dist/es2017/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2017/native-dialog-renderer.js b/dist/es2017/native-dialog-renderer.js index cd2fd0e..d8373a8 100644 --- a/dist/es2017/native-dialog-renderer.js +++ b/dist/es2017/native-dialog-renderer.js @@ -127,14 +127,16 @@ let NativeDialogRenderer = NativeDialogRenderer_1 = class NativeDialogRenderer { e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearEventHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } awaitTransition(setActiveInactive, ignore) { return new Promise(resolve => { @@ -179,7 +181,7 @@ let NativeDialogRenderer = NativeDialogRenderer_1 = class NativeDialogRenderer { return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); diff --git a/dist/es2017/native-dialog-renderer.js.map b/dist/es2017/native-dialog-renderer.js.map index aae4e80..59ad5fc 100644 --- a/dist/es2017/native-dialog-renderer.js.map +++ b/dist/es2017/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es2017/ux-dialog-footer.js b/dist/es2017/ux-dialog-footer.js index a9015ba..fecfa7c 100644 --- a/dist/es2017/ux-dialog-footer.js +++ b/dist/es2017/ux-dialog-footer.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; class UxDialogFooter { constructor(controller) { diff --git a/dist/es2017/ux-dialog-header.js b/dist/es2017/ux-dialog-header.js index 7c61667..bec4d64 100644 --- a/dist/es2017/ux-dialog-header.js +++ b/dist/es2017/ux-dialog-header.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; class UxDialogHeader { constructor(controller) { diff --git a/dist/es2017/ux-dialog-renderer.js b/dist/es2017/ux-dialog-renderer.js index 38ddc77..0e3d3aa 100644 --- a/dist/es2017/ux-dialog-renderer.js +++ b/dist/es2017/ux-dialog-renderer.js @@ -112,7 +112,7 @@ class DialogRenderer { const dialogOverlay = this.dialogOverlay = DOM.createElement(overlayTagName); const zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; const host = this.host; @@ -148,19 +148,21 @@ class DialogRenderer { this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); } - setupClickHandling(dialogController) { + setupEventHandling(dialogController) { this.stopPropagation = e => { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = e => { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearClickHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } centerDialog() { const child = this.dialogContainer.children[0]; @@ -210,11 +212,11 @@ class DialogRenderer { this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); diff --git a/dist/es2017/ux-dialog-renderer.js.map b/dist/es2017/ux-dialog-renderer.js.map index e21afb6..b0570b3 100644 --- a/dist/es2017/ux-dialog-renderer.js.map +++ b/dist/es2017/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/native-modules/aurelia-dialog.js b/dist/native-modules/aurelia-dialog.js index 13f0111..23a256a 100644 --- a/dist/native-modules/aurelia-dialog.js +++ b/dist/native-modules/aurelia-dialog.js @@ -1,5 +1,5 @@ -import { R as Renderer, c as createDialogCancelError, i as invokeLifecycle, D as DialogController } from './dialog-controller.js'; -export { D as DialogController, R as Renderer, c as createDialogCancelError, a as createDialogCloseError } from './dialog-controller.js'; +import { a as Renderer, b as createDialogCancelError, c as invokeLifecycle, d as DialogController } from './chunk.js'; +export { d as DialogController, a as Renderer, b as createDialogCancelError, e as createDialogCloseError } from './chunk.js'; import { DOM } from 'aurelia-pal'; import { Container } from 'aurelia-dependency-injection'; import { ViewSlot, CompositionEngine } from 'aurelia-templating'; diff --git a/dist/native-modules/dialog-controller.js b/dist/native-modules/chunk.js similarity index 93% rename from dist/native-modules/dialog-controller.js rename to dist/native-modules/chunk.js index 354a73d..cd6556c 100644 --- a/dist/native-modules/dialog-controller.js +++ b/dist/native-modules/chunk.js @@ -106,5 +106,5 @@ var DialogController = (function () { return DialogController; }()); -export { DialogController as D, Renderer as R, createDialogCloseError as a, createDialogCancelError as c, invokeLifecycle as i }; -//# sourceMappingURL=dialog-controller.js.map +export { Renderer as a, createDialogCancelError as b, invokeLifecycle as c, DialogController as d, createDialogCloseError as e }; +//# sourceMappingURL=chunk.js.map diff --git a/dist/native-modules/chunk.js.map b/dist/native-modules/chunk.js.map new file mode 100644 index 0000000..1bb564f --- /dev/null +++ b/dist/native-modules/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/native-modules/dialog-controller.js.map b/dist/native-modules/dialog-controller.js.map deleted file mode 100644 index 0ee5c84..0000000 --- a/dist/native-modules/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/native-modules/native-dialog-renderer.js b/dist/native-modules/native-dialog-renderer.js index 326b068..fc7d588 100644 --- a/dist/native-modules/native-dialog-renderer.js +++ b/dist/native-modules/native-dialog-renderer.js @@ -129,14 +129,16 @@ var NativeDialogRenderer = (function () { e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - NativeDialogRenderer.prototype.clearEventHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + NativeDialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; NativeDialogRenderer.prototype.awaitTransition = function (setActiveInactive, ignore) { var _this = this; @@ -184,7 +186,7 @@ var NativeDialogRenderer = (function () { }; NativeDialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/native-modules/native-dialog-renderer.js.map b/dist/native-modules/native-dialog-renderer.js.map index 9eab04a..828651e 100644 --- a/dist/native-modules/native-dialog-renderer.js.map +++ b/dist/native-modules/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/native-modules/ux-dialog-footer.js b/dist/native-modules/ux-dialog-footer.js index c23eff5..c4f125f 100644 --- a/dist/native-modules/ux-dialog-footer.js +++ b/dist/native-modules/ux-dialog-footer.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; var UxDialogFooter = (function () { function UxDialogFooter(controller) { diff --git a/dist/native-modules/ux-dialog-header.js b/dist/native-modules/ux-dialog-header.js index 6507d8a..a1e3d88 100644 --- a/dist/native-modules/ux-dialog-header.js +++ b/dist/native-modules/ux-dialog-header.js @@ -1,4 +1,4 @@ -import { D as DialogController } from './dialog-controller.js'; +import { d as DialogController } from './chunk.js'; var UxDialogHeader = (function () { function UxDialogHeader(controller) { diff --git a/dist/native-modules/ux-dialog-renderer.js b/dist/native-modules/ux-dialog-renderer.js index 61e1065..54a77be 100644 --- a/dist/native-modules/ux-dialog-renderer.js +++ b/dist/native-modules/ux-dialog-renderer.js @@ -114,7 +114,7 @@ var DialogRenderer = (function () { var dialogOverlay = this.dialogOverlay = DOM.createElement(overlayTagName); var zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; var host = this.host; @@ -150,19 +150,21 @@ var DialogRenderer = (function () { this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); }; - DialogRenderer.prototype.setupClickHandling = function (dialogController) { + DialogRenderer.prototype.setupEventHandling = function (dialogController) { this.stopPropagation = function (e) { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = function (e) { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - DialogRenderer.prototype.clearClickHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + DialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; DialogRenderer.prototype.centerDialog = function () { var child = this.dialogContainer.children[0]; @@ -214,12 +216,12 @@ var DialogRenderer = (function () { this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions); }; DialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/native-modules/ux-dialog-renderer.js.map b/dist/native-modules/ux-dialog-renderer.js.map index 2eab2b6..59ae5e0 100644 --- a/dist/native-modules/ux-dialog-renderer.js.map +++ b/dist/native-modules/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/system/attach-focus.js b/dist/system/attach-focus.js index d413a4a..479fa77 100644 --- a/dist/system/attach-focus.js +++ b/dist/system/attach-focus.js @@ -1,4 +1,4 @@ -System.register(['aurelia-pal'], function (exports) { +System.register(['aurelia-pal'], function (exports, module) { 'use strict'; var DOM; return { diff --git a/dist/system/aurelia-dialog.js b/dist/system/aurelia-dialog.js index f1b5134..5d4db94 100644 --- a/dist/system/aurelia-dialog.js +++ b/dist/system/aurelia-dialog.js @@ -1,17 +1,17 @@ -System.register(['./dialog-controller.js', 'aurelia-pal', 'aurelia-dependency-injection', 'aurelia-templating'], function (exports, module) { +System.register(['./chunk.js', 'aurelia-pal', 'aurelia-dependency-injection', 'aurelia-templating'], function (exports, module) { 'use strict'; var Renderer, createDialogCancelError, invokeLifecycle, DialogController, DOM, Container, ViewSlot, CompositionEngine; return { setters: [function (module) { - Renderer = module.R; - createDialogCancelError = module.c; - invokeLifecycle = module.i; - DialogController = module.D; + Renderer = module.a; + createDialogCancelError = module.b; + invokeLifecycle = module.c; + DialogController = module.d; var _setter = {}; - _setter.DialogController = module.D; - _setter.Renderer = module.R; - _setter.createDialogCancelError = module.c; - _setter.createDialogCloseError = module.a; + _setter.DialogController = module.d; + _setter.Renderer = module.a; + _setter.createDialogCancelError = module.b; + _setter.createDialogCloseError = module.e; exports(_setter); }, function (module) { DOM = module.DOM; diff --git a/dist/system/dialog-controller.js b/dist/system/chunk.js similarity index 91% rename from dist/system/dialog-controller.js rename to dist/system/chunk.js index 4d9dca8..69ee1b4 100644 --- a/dist/system/dialog-controller.js +++ b/dist/system/chunk.js @@ -1,15 +1,15 @@ -System.register([], function (exports) { +System.register([], function (exports, module) { 'use strict'; return { execute: function () { exports({ - a: createDialogCloseError, - c: createDialogCancelError, - i: invokeLifecycle + b: createDialogCancelError, + c: invokeLifecycle, + e: createDialogCloseError }); - var Renderer = exports('R', (function () { + var Renderer = exports('a', (function () { function Renderer() { } Renderer.prototype.getDialogContainer = function () { @@ -52,7 +52,7 @@ System.register([], function (exports) { return Promise.resolve(true); } - var DialogController = exports('D', (function () { + var DialogController = exports('d', (function () { function DialogController(renderer, settings, resolve, reject) { this.resolve = resolve; this.reject = reject; @@ -120,4 +120,4 @@ System.register([], function (exports) { } }; }); -//# sourceMappingURL=dialog-controller.js.map +//# sourceMappingURL=chunk.js.map diff --git a/dist/system/chunk.js.map b/dist/system/chunk.js.map new file mode 100644 index 0000000..c97eef8 --- /dev/null +++ b/dist/system/chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/system/default-styles.js b/dist/system/default-styles.js index 7903a27..82e1e96 100644 --- a/dist/system/default-styles.js +++ b/dist/system/default-styles.js @@ -1,4 +1,4 @@ -System.register([], function (exports) { +System.register([], function (exports, module) { 'use strict'; return { execute: function () { diff --git a/dist/system/dialog-controller.js.map b/dist/system/dialog-controller.js.map deleted file mode 100644 index 39b6a5d..0000000 --- a/dist/system/dialog-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dialog-controller.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/system/native-dialog-renderer.js b/dist/system/native-dialog-renderer.js index be7b5c6..a6ec005 100644 --- a/dist/system/native-dialog-renderer.js +++ b/dist/system/native-dialog-renderer.js @@ -1,4 +1,4 @@ -System.register(['aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-renderer.js'], function (exports) { +System.register(['aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-renderer.js'], function (exports, module) { 'use strict'; var DOM, transient, transitionEvent, hasTransition; return { @@ -139,14 +139,16 @@ System.register(['aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-ren e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - NativeDialogRenderer.prototype.clearEventHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + NativeDialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; NativeDialogRenderer.prototype.awaitTransition = function (setActiveInactive, ignore) { var _this = this; @@ -194,7 +196,7 @@ System.register(['aurelia-pal', 'aurelia-dependency-injection', './ux-dialog-ren }; NativeDialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/system/native-dialog-renderer.js.map b/dist/system/native-dialog-renderer.js.map index c82395e..c430ebc 100644 --- a/dist/system/native-dialog-renderer.js.map +++ b/dist/system/native-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"native-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/system/ux-dialog-body.js b/dist/system/ux-dialog-body.js index 7a37de8..2c5f834 100644 --- a/dist/system/ux-dialog-body.js +++ b/dist/system/ux-dialog-body.js @@ -1,4 +1,4 @@ -System.register([], function (exports) { +System.register([], function (exports, module) { 'use strict'; return { execute: function () { diff --git a/dist/system/ux-dialog-footer.js b/dist/system/ux-dialog-footer.js index a181228..73c1014 100644 --- a/dist/system/ux-dialog-footer.js +++ b/dist/system/ux-dialog-footer.js @@ -1,9 +1,9 @@ -System.register(['./dialog-controller.js'], function (exports) { +System.register(['./chunk.js'], function (exports, module) { 'use strict'; var DialogController; return { setters: [function (module) { - DialogController = module.D; + DialogController = module.d; }], execute: function () { diff --git a/dist/system/ux-dialog-header.js b/dist/system/ux-dialog-header.js index 1a39b7f..582f243 100644 --- a/dist/system/ux-dialog-header.js +++ b/dist/system/ux-dialog-header.js @@ -1,9 +1,9 @@ -System.register(['./dialog-controller.js'], function (exports) { +System.register(['./chunk.js'], function (exports, module) { 'use strict'; var DialogController; return { setters: [function (module) { - DialogController = module.D; + DialogController = module.d; }], execute: function () { diff --git a/dist/system/ux-dialog-renderer.js b/dist/system/ux-dialog-renderer.js index 9d52675..9b04e1d 100644 --- a/dist/system/ux-dialog-renderer.js +++ b/dist/system/ux-dialog-renderer.js @@ -1,4 +1,4 @@ -System.register(['aurelia-pal', 'aurelia-dependency-injection'], function (exports) { +System.register(['aurelia-pal', 'aurelia-dependency-injection'], function (exports, module) { 'use strict'; var DOM, transient; return { @@ -122,7 +122,7 @@ System.register(['aurelia-pal', 'aurelia-dependency-injection'], function (expor var dialogOverlay = this.dialogOverlay = DOM.createElement(overlayTagName); var zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; var host = this.host; @@ -158,19 +158,21 @@ System.register(['aurelia-pal', 'aurelia-dependency-injection'], function (expor this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); }; - DialogRenderer.prototype.setupClickHandling = function (dialogController) { + DialogRenderer.prototype.setupEventHandling = function (dialogController) { this.stopPropagation = function (e) { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = function (e) { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - DialogRenderer.prototype.clearClickHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + DialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; DialogRenderer.prototype.centerDialog = function () { var child = this.dialogContainer.children[0]; @@ -222,12 +224,12 @@ System.register(['aurelia-pal', 'aurelia-dependency-injection'], function (expor this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions); }; DialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/system/ux-dialog-renderer.js.map b/dist/system/ux-dialog-renderer.js.map index 6c422f5..13a9830 100644 --- a/dist/system/ux-dialog-renderer.js.map +++ b/dist/system/ux-dialog-renderer.js.map @@ -1 +1 @@ -{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ux-dialog-renderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/system/ux-dialog.js b/dist/system/ux-dialog.js index f8491ed..e71ef09 100644 --- a/dist/system/ux-dialog.js +++ b/dist/system/ux-dialog.js @@ -1,4 +1,4 @@ -System.register([], function (exports) { +System.register([], function (exports, module) { 'use strict'; return { execute: function () { diff --git a/dist/types/dialog-settings.d.ts b/dist/types/dialog-settings.d.ts index addc912..1ffef42 100644 --- a/dist/types/dialog-settings.d.ts +++ b/dist/types/dialog-settings.d.ts @@ -2,6 +2,7 @@ import { Container } from 'aurelia-dependency-injection'; import { ViewStrategy } from 'aurelia-templating'; export declare type ActionKey = 'Escape' | 'Enter'; export declare type KeyEventType = 'keyup' | 'keydown'; +export declare type MouseEventType = 'click' | 'mouseup' | 'mousedown'; /** * All available dialog settings. */ @@ -46,12 +47,18 @@ export interface DialogSettings { */ keyboard?: boolean | ActionKey | ActionKey[]; /** - * Determines which type of keyevent should be used to listen for + * Determines which type of key event should be used to listen for * ENTER and ESC keys * * Default: keyup */ keyEvent?: KeyEventType; + /** + * Determines which type of mouse event should be used for closing the dialog + * + * Default: click + */ + mouseEvent?: MouseEventType; /** * When set to "true" allows for the dismissal of the dialog by clicking outside of it. */ diff --git a/dist/types/renderers/native-dialog-renderer.d.ts b/dist/types/renderers/native-dialog-renderer.d.ts index 20353b6..9133d0a 100644 --- a/dist/types/renderers/native-dialog-renderer.d.ts +++ b/dist/types/renderers/native-dialog-renderer.d.ts @@ -1,5 +1,5 @@ -import { Renderer } from '../renderer'; import { DialogController } from '../dialog-controller'; +import { Renderer } from '../renderer'; export declare class NativeDialogRenderer implements Renderer { static dialogControllers: DialogController[]; static keyboardEventHandler(e: KeyboardEvent): void; diff --git a/dist/types/renderers/ux-dialog-renderer.d.ts b/dist/types/renderers/ux-dialog-renderer.d.ts index f806451..c8215b5 100644 --- a/dist/types/renderers/ux-dialog-renderer.d.ts +++ b/dist/types/renderers/ux-dialog-renderer.d.ts @@ -1,5 +1,5 @@ -import { Renderer } from '../renderer'; import { DialogController } from '../dialog-controller'; +import { Renderer } from '../renderer'; export declare const transitionEvent: () => string; export declare const hasTransition: (element: Element) => boolean; export declare class DialogRenderer implements Renderer { @@ -19,8 +19,8 @@ export declare class DialogRenderer implements Renderer { private detach; private setAsActive; private setAsInactive; - private setupClickHandling; - private clearClickHandling; + private setupEventHandling; + private clearEventHandling; private centerDialog; private awaitTransition; getDialogContainer(): Element; diff --git a/dist/umd-es2015/aurelia-dialog.js b/dist/umd-es2015/aurelia-dialog.js index f3fec29..1ee1aa2 100644 --- a/dist/umd-es2015/aurelia-dialog.js +++ b/dist/umd-es2015/aurelia-dialog.js @@ -454,7 +454,7 @@ const dialogOverlay = this.dialogOverlay = aureliaPal.DOM.createElement(overlayTagName); const zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; const host = this.host; @@ -490,19 +490,21 @@ this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); } - setupClickHandling(dialogController) { + setupEventHandling(dialogController) { this.stopPropagation = e => { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = e => { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearClickHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } centerDialog() { const child = this.dialogContainer.children[0]; @@ -552,11 +554,11 @@ this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); @@ -697,14 +699,16 @@ e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); } - clearEventHandling() { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + clearEventHandling(dialogController) { + const mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); } awaitTransition(setActiveInactive, ignore) { return new Promise(resolve => { @@ -749,7 +753,7 @@ return this.awaitTransition(() => this.setAsActive(), dialogController.settings.ignoreTransitions); } hideDialog(dialogController) { - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(() => this.setAsInactive(), dialogController.settings.ignoreTransitions) .then(() => { this.detach(dialogController); }); diff --git a/dist/umd-es2015/aurelia-dialog.js.map b/dist/umd-es2015/aurelia-dialog.js.map index 73bc7f3..0236f0a 100644 --- a/dist/umd-es2015/aurelia-dialog.js.map +++ b/dist/umd-es2015/aurelia-dialog.js.map @@ -1 +1 @@ -{"version":3,"file":"aurelia-dialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"aurelia-dialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/umd/aurelia-dialog.js b/dist/umd/aurelia-dialog.js index 9877b54..03aeda2 100644 --- a/dist/umd/aurelia-dialog.js +++ b/dist/umd/aurelia-dialog.js @@ -472,7 +472,7 @@ var dialogOverlay = this.dialogOverlay = aureliaPal.DOM.createElement(overlayTagName); var zIndex = typeof dialogController.settings.startingZIndex === 'number' ? dialogController.settings.startingZIndex + '' - : null; + : 'auto'; dialogOverlay.style.zIndex = zIndex; dialogContainer.style.zIndex = zIndex; var host = this.host; @@ -508,19 +508,21 @@ this.dialogOverlay.classList.remove('active'); this.dialogContainer.classList.remove('active'); }; - DialogRenderer.prototype.setupClickHandling = function (dialogController) { + DialogRenderer.prototype.setupEventHandling = function (dialogController) { this.stopPropagation = function (e) { e._aureliaDialogHostClicked = true; }; this.closeDialogClick = function (e) { if (dialogController.settings.overlayDismiss && !e._aureliaDialogHostClicked) { dialogController.cancel(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); - this.anchor.addEventListener('click', this.stopPropagation); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - DialogRenderer.prototype.clearClickHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); - this.anchor.removeEventListener('click', this.stopPropagation); + DialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; DialogRenderer.prototype.centerDialog = function () { var child = this.dialogContainer.children[0]; @@ -572,12 +574,12 @@ this.centerDialog(); } DialogRenderer.trackController(dialogController); - this.setupClickHandling(dialogController); + this.setupEventHandling(dialogController); return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions); }; DialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearClickHandling(); + this.clearEventHandling(dialogController); DialogRenderer.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); @@ -721,14 +723,16 @@ e.preventDefault(); } }; - this.dialogContainer.addEventListener('click', this.closeDialogClick); + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.addEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.addEventListener('cancel', this.dialogCancel); - this.anchor.addEventListener('click', this.stopPropagation); + this.anchor.addEventListener(mouseEvent, this.stopPropagation); }; - NativeDialogRenderer.prototype.clearEventHandling = function () { - this.dialogContainer.removeEventListener('click', this.closeDialogClick); + NativeDialogRenderer.prototype.clearEventHandling = function (dialogController) { + var mouseEvent = dialogController.settings.mouseEvent || 'click'; + this.dialogContainer.removeEventListener(mouseEvent, this.closeDialogClick); this.dialogContainer.removeEventListener('cancel', this.dialogCancel); - this.anchor.removeEventListener('click', this.stopPropagation); + this.anchor.removeEventListener(mouseEvent, this.stopPropagation); }; NativeDialogRenderer.prototype.awaitTransition = function (setActiveInactive, ignore) { var _this = this; @@ -776,7 +780,7 @@ }; NativeDialogRenderer.prototype.hideDialog = function (dialogController) { var _this = this; - this.clearEventHandling(); + this.clearEventHandling(dialogController); NativeDialogRenderer_1.untrackController(dialogController); return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions) .then(function () { _this.detach(dialogController); }); diff --git a/dist/umd/aurelia-dialog.js.map b/dist/umd/aurelia-dialog.js.map index f93184a..e9ff1ac 100644 --- a/dist/umd/aurelia-dialog.js.map +++ b/dist/umd/aurelia-dialog.js.map @@ -1 +1 @@ -{"version":3,"file":"aurelia-dialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"aurelia-dialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 2603688..dfbded4 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,8 @@ + +# [2.0.0](https://github.com/aurelia/dialog/compare/2.0.0-rc.8...2.0.0) (2020-01-07) + +* Fix dialog mouse event bug + # [2.0.0-rc.8](https://github.com/aurelia/dialog/compare/2.0.0-rc.7...2.0.0-rc.8) (2019-09-19) diff --git a/package-lock.json b/package-lock.json index 3e011a8..2da3ba1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aurelia-dialog", - "version": "2.0.0-rc.8", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8de5dcc..555ada5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-dialog", - "version": "2.0.0-rc.8", + "version": "2.0.0", "description": "A dialog plugin for Aurelia.", "keywords": [ "aurelia",