Skip to content

Commit

Permalink
chore(all): prepare release 2.0.0-rc.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 19, 2019
1 parent 29911c3 commit 0daf84e
Show file tree
Hide file tree
Showing 49 changed files with 1,164 additions and 512 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-dialog",
"version": "2.0.0-rc.3",
"version": "2.0.0-rc.4",
"description": "A dialog plugin for Aurelia.",
"keywords": [
"aurelia",
Expand Down
35 changes: 13 additions & 22 deletions dist/amd/dialog-renderer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-pal", "aurelia-dependency-injection"], function (require, exports, aurelia_pal_1, aurelia_dependency_injection_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
Expand Down Expand Up @@ -64,13 +58,12 @@ define(["require", "exports", "aurelia-pal", "aurelia-dependency-injection"], fu
var DialogRenderer = /** @class */ (function () {
function DialogRenderer() {
}
DialogRenderer_1 = DialogRenderer;
DialogRenderer.keyboardEventHandler = function (e) {
var key = getActionKey(e);
if (!key) {
return;
}
var top = DialogRenderer_1.dialogControllers[DialogRenderer_1.dialogControllers.length - 1];
var top = DialogRenderer.dialogControllers[DialogRenderer.dialogControllers.length - 1];
if (!top || !top.settings.keyboard) {
return;
}
Expand All @@ -84,18 +77,18 @@ define(["require", "exports", "aurelia-pal", "aurelia-dependency-injection"], fu
}
};
DialogRenderer.trackController = function (dialogController) {
if (!DialogRenderer_1.dialogControllers.length) {
aurelia_pal_1.DOM.addEventListener('keyup', DialogRenderer_1.keyboardEventHandler, false);
if (!DialogRenderer.dialogControllers.length) {
aurelia_pal_1.DOM.addEventListener(dialogController.settings.keyEvent || 'keyup', DialogRenderer.keyboardEventHandler, false);
}
DialogRenderer_1.dialogControllers.push(dialogController);
DialogRenderer.dialogControllers.push(dialogController);
};
DialogRenderer.untrackController = function (dialogController) {
var i = DialogRenderer_1.dialogControllers.indexOf(dialogController);
var i = DialogRenderer.dialogControllers.indexOf(dialogController);
if (i !== -1) {
DialogRenderer_1.dialogControllers.splice(i, 1);
DialogRenderer.dialogControllers.splice(i, 1);
}
if (!DialogRenderer_1.dialogControllers.length) {
aurelia_pal_1.DOM.removeEventListener('keyup', DialogRenderer_1.keyboardEventHandler, false);
if (!DialogRenderer.dialogControllers.length) {
aurelia_pal_1.DOM.removeEventListener(dialogController.settings.keyEvent || 'keyup', DialogRenderer.keyboardEventHandler, false);
}
};
DialogRenderer.prototype.getOwnElements = function (parent, selector) {
Expand Down Expand Up @@ -135,7 +128,7 @@ define(["require", "exports", "aurelia-pal", "aurelia-dependency-injection"], fu
this.host.removeChild(this.dialogOverlay);
this.host.removeChild(this.dialogContainer);
dialogController.controller.detached();
if (!DialogRenderer_1.dialogControllers.length) {
if (!DialogRenderer.dialogControllers.length) {
this.host.classList.remove('ux-dialog-open');
}
};
Expand Down Expand Up @@ -211,23 +204,21 @@ define(["require", "exports", "aurelia-pal", "aurelia-dependency-injection"], fu
else if (!settings.centerHorizontalOnly) {
this.centerDialog();
}
DialogRenderer_1.trackController(dialogController);
DialogRenderer.trackController(dialogController);
this.setupClickHandling(dialogController);
return this.awaitTransition(function () { return _this.setAsActive(); }, dialogController.settings.ignoreTransitions);
};
DialogRenderer.prototype.hideDialog = function (dialogController) {
var _this = this;
this.clearClickHandling();
DialogRenderer_1.untrackController(dialogController);
DialogRenderer.untrackController(dialogController);
return this.awaitTransition(function () { return _this.setAsInactive(); }, dialogController.settings.ignoreTransitions)
.then(function () { _this.detach(dialogController); });
};
var DialogRenderer_1;
DialogRenderer.dialogControllers = [];
DialogRenderer = DialogRenderer_1 = __decorate([
aurelia_dependency_injection_1.transient()
], DialogRenderer);
return DialogRenderer;
}());
exports.DialogRenderer = DialogRenderer;
// avoid unnecessary code
aurelia_dependency_injection_1.transient()(DialogRenderer);
});
8 changes: 8 additions & 0 deletions dist/amd/dialog-settings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Container } from 'aurelia-dependency-injection';
import { ViewStrategy } from 'aurelia-templating';
export declare type ActionKey = 'Escape' | 'Enter';
export declare type KeyEventType = 'keyup' | 'keydown';
/**
* All available dialog settings.
*/
Expand Down Expand Up @@ -44,6 +45,13 @@ export interface DialogSettings {
* Using the array format allows combining the ESC and ENTER keys.
*/
keyboard?: boolean | ActionKey | ActionKey[];
/**
* Determines which type of keyevent should be used to listen for
* ENTER and ESC keys
*
* Default: keyup
*/
keyEvent?: KeyEventType;
/**
* When set to "true" allows for the dismissal of the dialog by clicking outside of it.
*/
Expand Down
24 changes: 12 additions & 12 deletions dist/amd/resources/attach-focus.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-binding", "aurelia-templating", "aurelia-pal"], function (require, exports, aurelia_binding_1, aurelia_templating_1, aurelia_pal_1) {
define(["require", "exports", "aurelia-pal"], function (require, exports, aurelia_pal_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AttachFocus = /** @class */ (function () {
function AttachFocus(element) {
this.element = element;
this.value = true;
}
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
AttachFocus.inject = function () {
return [aurelia_pal_1.DOM.Element];
};
AttachFocus.prototype.attached = function () {
if (this.value === '' || (this.value && this.value !== 'false')) {
this.element.focus();
Expand All @@ -20,11 +21,10 @@ define(["require", "exports", "aurelia-binding", "aurelia-templating", "aurelia-
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
AttachFocus.inject = [aurelia_pal_1.DOM.Element];
AttachFocus = __decorate([
aurelia_templating_1.customAttribute('attach-focus', aurelia_binding_1.bindingMode.oneTime)
], AttachFocus);
AttachFocus.$resource = {
type: 'attribute',
name: 'attach-focus'
};
return AttachFocus;
}());
exports.AttachFocus = AttachFocus;
Expand Down
20 changes: 9 additions & 11 deletions dist/amd/resources/ux-dialog-body.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-templating"], function (require, exports, aurelia_templating_1) {
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var UxDialogBody = /** @class */ (function () {
function UxDialogBody() {
}
UxDialogBody = __decorate([
aurelia_templating_1.customElement('ux-dialog-body'),
aurelia_templating_1.inlineView("\n <template>\n <slot></slot>\n </template>\n")
], UxDialogBody);
/**
* @internal
*/
UxDialogBody.$view = "<template><slot></slot></template>";
/**
* @internal
*/
UxDialogBody.$resource = 'ux-dialog-body';
return UxDialogBody;
}());
exports.UxDialogBody = UxDialogBody;
Expand Down
6 changes: 6 additions & 0 deletions dist/amd/resources/ux-dialog-footer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { DialogController } from '../dialog-controller';
export declare class UxDialogFooter {
controller: DialogController;
static isCancelButton(value: string): boolean;
/**
* @bindable
*/
buttons: any[];
/**
* @bindable
*/
useDefaultButtons: boolean;
constructor(controller: DialogController);
close(buttonValue: string): void;
Expand Down
41 changes: 21 additions & 20 deletions dist/amd/resources/ux-dialog-footer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-templating", "../dialog-controller"], function (require, exports, aurelia_templating_1, dialog_controller_1) {
define(["require", "exports", "../dialog-controller"], function (require, exports, dialog_controller_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
Expand All @@ -13,15 +7,20 @@ define(["require", "exports", "aurelia-templating", "../dialog-controller"], fun
var UxDialogFooter = /** @class */ (function () {
function UxDialogFooter(controller) {
this.controller = controller;
/**
* @bindable
*/
this.buttons = [];
/**
* @bindable
*/
this.useDefaultButtons = false;
}
UxDialogFooter_1 = UxDialogFooter;
UxDialogFooter.isCancelButton = function (value) {
return value === 'Cancel';
};
UxDialogFooter.prototype.close = function (buttonValue) {
if (UxDialogFooter_1.isCancelButton(buttonValue)) {
if (UxDialogFooter.isCancelButton(buttonValue)) {
this.controller.cancel(buttonValue);
}
else {
Expand All @@ -33,22 +32,24 @@ define(["require", "exports", "aurelia-templating", "../dialog-controller"], fun
this.buttons = ['Cancel', 'Ok'];
}
};
var UxDialogFooter_1;
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
UxDialogFooter.inject = [dialog_controller_1.DialogController];
__decorate([
aurelia_templating_1.bindable
], UxDialogFooter.prototype, "buttons", void 0);
__decorate([
aurelia_templating_1.bindable
], UxDialogFooter.prototype, "useDefaultButtons", void 0);
UxDialogFooter = UxDialogFooter_1 = __decorate([
aurelia_templating_1.customElement('ux-dialog-footer'),
aurelia_templating_1.inlineView("\n <template>\n <slot></slot>\n <template if.bind=\"buttons.length > 0\">\n <button type=\"button\"\n class=\"btn btn-default\"\n repeat.for=\"button of buttons\"\n click.trigger=\"close(button)\">\n ${button}\n </button>\n </template>\n </template>\n")
], UxDialogFooter);
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
UxDialogFooter.$view = "<template>\n <slot></slot>\n <template if.bind=\"buttons.length > 0\">\n <button type=\"button\"\n class=\"btn btn-default\"\n repeat.for=\"button of buttons\"\n click.trigger=\"close(button)\">\n ${button}\n </button>\n </template>\n </template>";
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
UxDialogFooter.$resource = {
name: 'ux-dialog-footer',
bindables: ['buttons', 'useDefaultButtons']
};
return UxDialogFooter;
}());
exports.UxDialogFooter = UxDialogFooter;
Expand Down
3 changes: 3 additions & 0 deletions dist/amd/resources/ux-dialog-header.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { ComponentBind } from 'aurelia-templating';
import { DialogController } from '../dialog-controller';
export declare class UxDialogHeader implements ComponentBind {
controller: DialogController;
/**
* @bindable
*/
showCloseButton: boolean | undefined;
constructor(controller: DialogController);
bind(): void;
Expand Down
28 changes: 14 additions & 14 deletions dist/amd/resources/ux-dialog-header.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-templating", "../dialog-controller"], function (require, exports, aurelia_templating_1, dialog_controller_1) {
define(["require", "exports", "../dialog-controller"], function (require, exports, dialog_controller_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var UxDialogHeader = /** @class */ (function () {
Expand All @@ -21,13 +15,19 @@ define(["require", "exports", "aurelia-templating", "../dialog-controller"], fun
*/
// tslint:disable-next-line:member-ordering
UxDialogHeader.inject = [dialog_controller_1.DialogController];
__decorate([
aurelia_templating_1.bindable()
], UxDialogHeader.prototype, "showCloseButton", void 0);
UxDialogHeader = __decorate([
aurelia_templating_1.customElement('ux-dialog-header'),
aurelia_templating_1.inlineView("\n <template>\n <button\n type=\"button\"\n class=\"dialog-close\"\n aria-label=\"Close\"\n if.bind=\"showCloseButton\"\n click.trigger=\"controller.cancel()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n\n <div class=\"dialog-header-content\">\n <slot></slot>\n </div>\n </template>\n")
], UxDialogHeader);
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
UxDialogHeader.$view = "<template>\n <button\n type=\"button\"\n class=\"dialog-close\"\n aria-label=\"Close\"\n if.bind=\"showCloseButton\"\n click.trigger=\"controller.cancel()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n\n <div class=\"dialog-header-content\">\n <slot></slot>\n </div>\n </template>";
/**
* @internal
*/
// tslint:disable-next-line:member-ordering
UxDialogHeader.$resource = {
name: 'ux-dialog-header',
bindables: ['showCloseButton']
};
return UxDialogHeader;
}());
exports.UxDialogHeader = UxDialogHeader;
Expand Down
20 changes: 9 additions & 11 deletions dist/amd/resources/ux-dialog.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "aurelia-templating"], function (require, exports, aurelia_templating_1) {
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var UxDialog = /** @class */ (function () {
function UxDialog() {
}
UxDialog = __decorate([
aurelia_templating_1.customElement('ux-dialog'),
aurelia_templating_1.inlineView("\n <template>\n <slot></slot>\n </template>\n")
], UxDialog);
/**
* @internal
*/
UxDialog.$view = "<template><slot></slot></template>";
/**
* @internal
*/
UxDialog.$resource = 'ux-dialog';
return UxDialog;
}());
exports.UxDialog = UxDialog;
Expand Down
Loading

0 comments on commit 0daf84e

Please sign in to comment.