diff --git a/packages/button/dist/amd/index.js b/packages/button/dist/amd/index.js index 01c9c1a2..7b4ba6c0 100644 --- a/packages/button/dist/amd/index.js +++ b/packages/button/dist/amd/index.js @@ -1,153 +1,146 @@ define('@aurelia-ux/button', ['exports', 'aurelia-templating', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_BUTTON_VIEW = " "; + var UX_BUTTON_VIEW = " "; -var UxButton = /** @class */ (function () { - function UxButton(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - UxButton.prototype.bind = function () { - if (core.normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - }; - UxButton.prototype.typeChanged = function (newValue) { - var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - (_a = this.button.classList).remove.apply(_a, typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.sizeChanged = function (newValue) { - var sizeClasses = ['small', 'medium', 'large']; - (_a = this.button.classList).remove.apply(_a, sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.effectChanged = function (newValue) { - var effectClasses = ['ripple', 'none']; - (_a = this.button.classList).remove.apply(_a, effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; + var UxButton = /** @class */ (function () { + function UxButton(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.disabled = false; + this.ripple = null; } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxButton.prototype.disabledChanged = function (newValue) { - if (core.normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - }; - UxButton.prototype.onMouseDown = function (e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core.PaperRipple(); - this.button.appendChild(this.ripple.$); + UxButton.prototype.bind = function () { + if (core.normalizeBooleanAttribute('disabled', this.disabled)) { + this.button.setAttribute('disabled', ''); } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; + this.themeChanged(this.theme); + this.typeChanged(this.type); + this.sizeChanged(this.size); + this.effectChanged(this.effect); + }; + UxButton.prototype.typeChanged = function (newValue) { + var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; + (_a = this.button.classList).remove.apply(_a, typeClasses); + if (newValue == null || typeClasses.includes(newValue) === false) { + newValue = 'raised'; } - this.ripple.downAction(e); - } - return true; - }; - UxButton.prototype.onMouseUp = function () { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); + this.button.classList.add(newValue); + var _a; + }; + UxButton.prototype.sizeChanged = function (newValue) { + var sizeClasses = ['small', 'medium', 'large']; + (_a = this.button.classList).remove.apply(_a, sizeClasses); + if (newValue == null || sizeClasses.includes(newValue) === false) { + newValue = 'medium'; + } + this.button.classList.add(newValue); + var _a; + }; + UxButton.prototype.effectChanged = function (newValue) { + var effectClasses = ['ripple', 'none']; + (_a = this.button.classList).remove.apply(_a, effectClasses); + if (newValue == null || effectClasses.includes(newValue) === false) { + newValue = 'ripple'; + } + this.button.classList.add(newValue); + var _a; + }; + UxButton.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'button'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxButton.prototype.disabledChanged = function (newValue) { + if (core.normalizeBooleanAttribute('disabled', newValue)) { + this.button.setAttribute('disabled', ''); + } + else { + this.button.removeAttribute('disabled'); + } + }; + UxButton.prototype.onMouseDown = function (e) { + if (this.button.classList.contains('ripple')) { + if (this.ripple === null) { + this.ripple = new core.PaperRipple(); + this.button.appendChild(this.ripple.$); + } + if (this.button.classList.contains('fab')) { + this.ripple.center = true; + this.ripple.round = true; + } + this.ripple.downAction(e); + } + return true; + }; + UxButton.prototype.onMouseUp = function () { + if (this.button.classList.contains('ripple') && this.ripple !== null) { + this.ripple.upAction(); + } + return true; + }; + __decorate([ + aureliaTemplating.bindable + ], UxButton.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxButton.prototype, "size", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxButton.prototype, "effect", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxButton.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxButton.prototype, "theme", void 0); + UxButton = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-button'), + aureliaTemplating.inlineView(UX_BUTTON_VIEW) + ], UxButton); + return UxButton; + }()); + + var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}"; + + var UxButtonTheme = /** @class */ (function () { + function UxButtonTheme() { + this.themeKey = 'button'; } - return true; - }; - __decorate([ - aureliaTemplating.bindable - ], UxButton.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxButton.prototype, "size", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxButton.prototype, "effect", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxButton.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxButton.prototype, "theme", void 0); - UxButton = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-button'), - aureliaTemplating.inlineView(UX_BUTTON_VIEW) - ], UxButton); - return UxButton; -}()); - -var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}" + return UxButtonTheme; + }()); -var UxButtonTheme = /** @class */ (function () { - function UxButtonTheme() { - this.themeKey = 'button'; + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-button-css'); + config.globalResources(UxButton); } - return UxButtonTheme; -}()); - -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-button-css'); - config.globalResources(UxButton); -} -exports.configure = configure; -exports.UxButtonTheme = UxButtonTheme; + exports.configure = configure; + exports.UxButtonTheme = UxButtonTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/button/dist/amd/ux-button.js b/packages/button/dist/amd/ux-button.js deleted file mode 100644 index 66829188..00000000 --- a/packages/button/dist/amd/ux-button.js +++ /dev/null @@ -1,109 +0,0 @@ -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", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxButton = /** @class */ (function () { - function UxButton(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - UxButton.prototype.bind = function () { - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - }; - UxButton.prototype.typeChanged = function (newValue) { - var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - (_a = this.button.classList).remove.apply(_a, typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.sizeChanged = function (newValue) { - var sizeClasses = ['small', 'medium', 'large']; - (_a = this.button.classList).remove.apply(_a, sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.effectChanged = function (newValue) { - var effectClasses = ['ripple', 'none']; - (_a = this.button.classList).remove.apply(_a, effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxButton.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - }; - UxButton.prototype.onMouseDown = function (e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - this.button.appendChild(this.ripple.$); - } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; - } - this.ripple.downAction(e); - } - return true; - }; - UxButton.prototype.onMouseUp = function () { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); - } - return true; - }; - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "size", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "theme", void 0); - UxButton = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-button') - ], UxButton); - return UxButton; - }()); - exports.UxButton = UxButton; -}); diff --git a/packages/button/dist/commonjs/index.js b/packages/button/dist/commonjs/index.js index e685539c..5a9b66d8 100644 --- a/packages/button/dist/commonjs/index.js +++ b/packages/button/dist/commonjs/index.js @@ -21,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -138,7 +131,7 @@ var UxButton = /** @class */ (function () { return UxButton; }()); -var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}" +var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}"; var UxButtonTheme = /** @class */ (function () { function UxButtonTheme() { diff --git a/packages/button/dist/commonjs/ux-button.js b/packages/button/dist/commonjs/ux-button.js deleted file mode 100644 index ca3b8e57..00000000 --- a/packages/button/dist/commonjs/ux-button.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxButton = /** @class */ (function () { - function UxButton(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - UxButton.prototype.bind = function () { - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - }; - UxButton.prototype.typeChanged = function (newValue) { - var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - (_a = this.button.classList).remove.apply(_a, typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.sizeChanged = function (newValue) { - var sizeClasses = ['small', 'medium', 'large']; - (_a = this.button.classList).remove.apply(_a, sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.effectChanged = function (newValue) { - var effectClasses = ['ripple', 'none']; - (_a = this.button.classList).remove.apply(_a, effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxButton.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - }; - UxButton.prototype.onMouseDown = function (e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - this.button.appendChild(this.ripple.$); - } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; - } - this.ripple.downAction(e); - } - return true; - }; - UxButton.prototype.onMouseUp = function () { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); - } - return true; - }; - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "size", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "theme", void 0); - UxButton = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-button') - ], UxButton); - return UxButton; -}()); -exports.UxButton = UxButton; diff --git a/packages/button/dist/es2015/index.js b/packages/button/dist/es2015/index.js index e2ce20f7..e792b814 100644 --- a/packages/button/dist/es2015/index.js +++ b/packages/button/dist/es2015/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -130,7 +123,7 @@ UxButton = __decorate([ inlineView(UX_BUTTON_VIEW) ], UxButton); -var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}" +var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}"; class UxButtonTheme { constructor() { diff --git a/packages/button/dist/es2015/ux-button.js b/packages/button/dist/es2015/ux-button.js deleted file mode 100644 index 0266ea47..00000000 --- a/packages/button/dist/es2015/ux-button.js +++ /dev/null @@ -1,104 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -let UxButton = class UxButton { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - bind() { - if (normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - } - typeChanged(newValue) { - const typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - this.button.classList.remove(...typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - } - sizeChanged(newValue) { - const sizeClasses = ['small', 'medium', 'large']; - this.button.classList.remove(...sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - } - effectChanged(newValue) { - const effectClasses = ['ripple', 'none']; - this.button.classList.remove(...effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; - } - this.button.classList.add(newValue); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - disabledChanged(newValue) { - if (normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - } - onMouseDown(e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - this.button.appendChild(this.ripple.$); - } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; - } - this.ripple.downAction(e); - } - return true; - } - onMouseUp() { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); - } - return true; - } -}; -__decorate([ - bindable -], UxButton.prototype, "type", void 0); -__decorate([ - bindable -], UxButton.prototype, "size", void 0); -__decorate([ - bindable -], UxButton.prototype, "effect", void 0); -__decorate([ - bindable -], UxButton.prototype, "disabled", void 0); -__decorate([ - bindable -], UxButton.prototype, "theme", void 0); -UxButton = __decorate([ - inject(Element, StyleEngine), - customElement('ux-button') -], UxButton); -export { UxButton }; diff --git a/packages/button/dist/native-modules/index.js b/packages/button/dist/native-modules/index.js index fb8aa964..f746eed6 100644 --- a/packages/button/dist/native-modules/index.js +++ b/packages/button/dist/native-modules/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -134,7 +127,7 @@ var UxButton = /** @class */ (function () { return UxButton; }()); -var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}" +var css = "ux-button{display:inline-block;position:relative}ux-button>button{display:flex;align-items:center;justify-content:center;width:100%;border:0;outline:0;cursor:pointer;text-align:center;font-family:inherit;font-family:var(--ux-theme--button-font-family, inherit);font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);flex-wrap:nowrap;overflow:hidden}ux-button>button::-moz-focus-inner{border:0}ux-button>button.raised,ux-button>button.flat{min-width:88px;padding:0 16px 0 16px;border-radius:2px}ux-button>button.text{padding:0 16px 0 16px;border-radius:2px}ux-button>button.raised.small,ux-button>button.outline.small,ux-button>button.flat.small,ux-button>button.text.small{font-size:13px;height:32px;line-height:32px}ux-button>button.raised.medium,ux-button>button.outline.medium,ux-button>button.flat.medium,ux-button>button.text.medium{font-size:14px;height:36px;line-height:36px}ux-button>button.raised.large,ux-button>button.outline.large,ux-button>button.flat.large,ux-button>button.text.large{font-size:16px;height:42px;line-height:42px}ux-button>button.outline{border:1px solid;border-radius:4px}ux-button>button.outline:focus{border:1px solid #3f51b5;border:1px solid var(--ux-design--primary, #3F51B5)}ux-button>button.flat,ux-button>button.raised,ux-button>button.fab{background-color:#3f51b5;background-color:var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff))}ux-button.accent>button.flat,ux-button.accent>button.raised,ux-button.accent>button.fab{background-color:#ff4081;background-color:var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff))}ux-button>button.raised{transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.raised:disabled,ux-button>button.fab:disabled{background-color:#9e9e9e;background-color:var(--ux-theme--button-background-disabled, #9E9E9E);color:#cfd8dc;color:var(--ux-theme--button-foreground-disabled, #CFD8DC)}ux-button>button.raised:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.raised:disabled:active,ux-button>button.fab:disabled:active{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.flat:focus,ux-button>button.raised:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}ux-button>button.raised:disabled:focus,ux-button>button.fab:disabled:focus{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12));transition-delay:0s}ux-button>button.text{background-color:transparent;background-color:var(--ux-theme--button-flat-background, transparent);color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5))}ux-button.accent>button.text{background-color:transparent;background-color:var(--ux-theme--button-accent-flat-background, transparent);color:#ff4081;color:var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081))}ux-button>button.text,ux-button>button.outline{color:inherit;background-color:transparent}ux-button>button.flat.disabled{opacity:.74}ux-button>button.fab{border-radius:50%;overflow:hidden;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);transition-delay:.2s;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-button>button.fab.small{width:40px;height:40px}ux-button>button.fab.medium{width:56px;height:56px}ux-button>button.fab.large{width:64px;height:64px}ux-button>button.fab:active{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2));transition-delay:0s}ux-button>button.fab:focus{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36));transition-delay:0s}"; var UxButtonTheme = /** @class */ (function () { function UxButtonTheme() { diff --git a/packages/button/dist/native-modules/ux-button.js b/packages/button/dist/native-modules/ux-button.js deleted file mode 100644 index 7e829f4b..00000000 --- a/packages/button/dist/native-modules/ux-button.js +++ /dev/null @@ -1,108 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -var UxButton = /** @class */ (function () { - function UxButton(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - UxButton.prototype.bind = function () { - if (normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - }; - UxButton.prototype.typeChanged = function (newValue) { - var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - (_a = this.button.classList).remove.apply(_a, typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.sizeChanged = function (newValue) { - var sizeClasses = ['small', 'medium', 'large']; - (_a = this.button.classList).remove.apply(_a, sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.effectChanged = function (newValue) { - var effectClasses = ['ripple', 'none']; - (_a = this.button.classList).remove.apply(_a, effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxButton.prototype.disabledChanged = function (newValue) { - if (normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - }; - UxButton.prototype.onMouseDown = function (e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - this.button.appendChild(this.ripple.$); - } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; - } - this.ripple.downAction(e); - } - return true; - }; - UxButton.prototype.onMouseUp = function () { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); - } - return true; - }; - __decorate([ - bindable - ], UxButton.prototype, "type", void 0); - __decorate([ - bindable - ], UxButton.prototype, "size", void 0); - __decorate([ - bindable - ], UxButton.prototype, "effect", void 0); - __decorate([ - bindable - ], UxButton.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxButton.prototype, "theme", void 0); - UxButton = __decorate([ - inject(Element, StyleEngine), - customElement('ux-button') - ], UxButton); - return UxButton; -}()); -export { UxButton }; diff --git a/packages/button/dist/system/ux-button.css b/packages/button/dist/system/ux-button.css deleted file mode 100644 index e8a71a5f..00000000 --- a/packages/button/dist/system/ux-button.css +++ /dev/null @@ -1,198 +0,0 @@ -ux-button { - display: inline-block; - position: relative; -} - -ux-button>button { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - border: 0; - outline: none; - cursor: pointer; - text-align: center; - font-family: inherit; - font-family: var(--ux-theme--button-font-family, inherit); - font-weight: 500; - font-weight: var(--ux-theme--button-font-weight, 500); - text-transform: uppercase; - text-transform: var(--ux-theme--button-text-transform, uppercase); - letter-spacing: 0.5px; - letter-spacing: var(--ux-theme--button-letter-spacing, 0.5px); - flex-wrap: nowrap; - overflow: hidden; -} - -ux-button>button::-moz-focus-inner { - border: none; -} - -ux-button>button.raised, -ux-button>button.flat { - min-width: 88px; - padding: 0 16px 0 16px; - border-radius: 2px; -} - -ux-button>button.text { - padding: 0 16px 0 16px; - border-radius: 2px; -} - -ux-button>button.raised.small, -ux-button>button.outline.small, -ux-button>button.flat.small, -ux-button>button.text.small { - font-size: 13px; - height: 32px; - line-height: 32px; -} - -ux-button>button.raised.medium, -ux-button>button.outline.medium, -ux-button>button.flat.medium, -ux-button>button.text.medium { - font-size: 14px; - height: 36px; - line-height: 36px; -} - -ux-button>button.raised.large, -ux-button>button.outline.large, -ux-button>button.flat.large, -ux-button>button.text.large { - font-size: 16px; - height: 42px; - line-height: 42px; -} - -ux-button>button.outline { - border: 1px solid; - border-radius: 4px; -} - -ux-button>button.outline:focus { - border: 1px solid #3F51B5; - border: 1px solid var(--ux-design--primary, #3F51B5); -} - -ux-button>button.flat, -ux-button>button.raised, -ux-button>button.fab { - background-color: #3F51B5; - background-color: var(--ux-theme--button-background, var(--ux-design--primary, #3F51B5)); - color: #fff; - color: var(--ux-theme--button-foreground, var(--ux-design--primary-foreground, #fff)); -} - -ux-button.accent>button.flat, -ux-button.accent>button.raised, -ux-button.accent>button.fab { - background-color: #FF4081; - background-color: var(--ux-theme--button-accent-background, var(--ux-design--accent, #FF4081)); - color: #fff; - color: var(--ux-theme--button-accent-foreground, var(--ux-design--accent-foreground, #fff)); -} - -ux-button>button.raised { - transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); - transition-delay: 0.2s; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); - box-shadow: var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)); -} - -ux-button>button.raised:disabled, -ux-button>button.fab:disabled { - background-color: #9E9E9E; - background-color: var(--ux-theme--button-background-disabled, #9E9E9E); - color: #CFD8DC; - color: var(--ux-theme--button-foreground-disabled, #CFD8DC); -} - -ux-button>button.raised:active { - box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2); - box-shadow: var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2)); - transition-delay: 0s; -} - -ux-button>button.raised:disabled:active, -ux-button>button.fab:disabled:active { - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); - box-shadow: var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)); - transition-delay: 0s; -} - -ux-button>button.flat:focus, -ux-button>button.raised:focus { - box-shadow: 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36); - box-shadow: var(--ux-design--elevationFocus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36)); - transition-delay: 0s; -} - -ux-button>button.raised:disabled:focus, -ux-button>button.fab:disabled:focus { - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); - box-shadow: var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)); - transition-delay: 0s; -} - -ux-button>button.text { - background-color: transparent; - background-color: var(--ux-theme--button-flat-background, transparent); - color: #3F51B5; - color: var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5)); -} - -ux-button.accent>button.text { - background-color: transparent; - background-color: var(--ux-theme--button-accent-flat-background, transparent); - color: #FF4081; - color: var(--ux-theme--button-accent-flat-foreground, var(--ux-design--accent, #FF4081)); -} - -ux-button>button.text, -ux-button>button.outline { - color: inherit; - background-color: transparent; -} - -ux-button>button.flat.disabled { - opacity: .74; -} - -ux-button>button.fab { - border-radius: 50%; - overflow: hidden; - transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); - transition-delay: 0.2s; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); - box-shadow: var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)); -} - -ux-button>button.fab.small { - width: 40px; - height: 40px; -} - -ux-button>button.fab.medium { - width: 56px; - height: 56px; -} - -ux-button>button.fab.large { - width: 64px; - height: 64px; -} - -ux-button>button.fab:active { - box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2); - box-shadow: var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2)); - transition-delay: 0s; -} - -ux-button>button.fab:focus { - box-shadow: 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36); - box-shadow: var(--ux-design--elevation-focus, 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36)); - transition-delay: 0s; -} diff --git a/packages/button/dist/system/ux-button.js b/packages/button/dist/system/ux-button.js deleted file mode 100644 index d94f808c..00000000 --- a/packages/button/dist/system/ux-button.js +++ /dev/null @@ -1,125 +0,0 @@ -System.register(["aurelia-templating", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_dependency_injection_1, core_1, UxButton; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxButton = /** @class */ (function () { - function UxButton(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.ripple = null; - } - UxButton.prototype.bind = function () { - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.button.setAttribute('disabled', ''); - } - this.themeChanged(this.theme); - this.typeChanged(this.type); - this.sizeChanged(this.size); - this.effectChanged(this.effect); - }; - UxButton.prototype.typeChanged = function (newValue) { - var typeClasses = ['text', 'flat', 'outline', 'raised', 'fab']; - (_a = this.button.classList).remove.apply(_a, typeClasses); - if (newValue == null || typeClasses.includes(newValue) === false) { - newValue = 'raised'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.sizeChanged = function (newValue) { - var sizeClasses = ['small', 'medium', 'large']; - (_a = this.button.classList).remove.apply(_a, sizeClasses); - if (newValue == null || sizeClasses.includes(newValue) === false) { - newValue = 'medium'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.effectChanged = function (newValue) { - var effectClasses = ['ripple', 'none']; - (_a = this.button.classList).remove.apply(_a, effectClasses); - if (newValue == null || effectClasses.includes(newValue) === false) { - newValue = 'ripple'; - } - this.button.classList.add(newValue); - var _a; - }; - UxButton.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'button'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxButton.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.button.setAttribute('disabled', ''); - } - else { - this.button.removeAttribute('disabled'); - } - }; - UxButton.prototype.onMouseDown = function (e) { - if (this.button.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - this.button.appendChild(this.ripple.$); - } - if (this.button.classList.contains('fab')) { - this.ripple.center = true; - this.ripple.round = true; - } - this.ripple.downAction(e); - } - return true; - }; - UxButton.prototype.onMouseUp = function () { - if (this.button.classList.contains('ripple') && this.ripple !== null) { - this.ripple.upAction(); - } - return true; - }; - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "size", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxButton.prototype, "theme", void 0); - UxButton = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-button') - ], UxButton); - return UxButton; - }()); - exports_1("UxButton", UxButton); - } - }; -}); diff --git a/packages/card/dist/amd/index.js b/packages/card/dist/amd/index.js index 72b1c51e..f36097fd 100644 --- a/packages/card/dist/amd/index.js +++ b/packages/card/dist/amd/index.js @@ -1,77 +1,70 @@ define('@aurelia-ux/card', ['exports', 'aurelia-dependency-injection', 'aurelia-templating', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaDependencyInjection, aureliaTemplating, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_CARD_VIEW = " "; + var UX_CARD_VIEW = " "; -var UxCard = /** @class */ (function () { - function UxCard(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxCard.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); + var UxCard = /** @class */ (function () { + function UxCard(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; } - }; - UxCard.prototype.themeChanged = function (newValue) { - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aureliaTemplating.bindable - ], UxCard.prototype, "theme", void 0); - UxCard = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-card'), - aureliaTemplating.inlineView(UX_CARD_VIEW) - ], UxCard); - return UxCard; -}()); - -var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}" + UxCard.prototype.bind = function () { + if (this.theme != null) { + this.themeChanged(this.theme); + } + }; + UxCard.prototype.themeChanged = function (newValue) { + this.styleEngine.applyTheme(newValue, this.element); + }; + __decorate([ + aureliaTemplating.bindable + ], UxCard.prototype, "theme", void 0); + UxCard = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-card'), + aureliaTemplating.inlineView(UX_CARD_VIEW) + ], UxCard); + return UxCard; + }()); + + var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}"; + + var UxCardTheme = /** @class */ (function () { + function UxCardTheme() { + this.themeKey = 'card'; + } + return UxCardTheme; + }()); -var UxCardTheme = /** @class */ (function () { - function UxCardTheme() { - this.themeKey = 'card'; + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-card-css'); + config.globalResources(UxCard); } - return UxCardTheme; -}()); - -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-card-css'); - config.globalResources(UxCard); -} -exports.configure = configure; -exports.UxCardTheme = UxCardTheme; + exports.configure = configure; + exports.UxCardTheme = UxCardTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/card/dist/amd/ux-card.js b/packages/card/dist/amd/ux-card.js deleted file mode 100644 index 65e59c46..00000000 --- a/packages/card/dist/amd/ux-card.js +++ /dev/null @@ -1,33 +0,0 @@ -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-dependency-injection", "aurelia-templating", "@aurelia-ux/core"], function (require, exports, aurelia_dependency_injection_1, aurelia_templating_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxCard = /** @class */ (function () { - function UxCard(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxCard.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxCard.prototype.themeChanged = function (newValue) { - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCard.prototype, "theme", void 0); - UxCard = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-card') - ], UxCard); - return UxCard; - }()); - exports.UxCard = UxCard; -}); diff --git a/packages/card/dist/commonjs/index.js b/packages/card/dist/commonjs/index.js index d061dc1a..ebf259f7 100644 --- a/packages/card/dist/commonjs/index.js +++ b/packages/card/dist/commonjs/index.js @@ -21,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -62,7 +55,7 @@ var UxCard = /** @class */ (function () { return UxCard; }()); -var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}" +var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}"; var UxCardTheme = /** @class */ (function () { function UxCardTheme() { diff --git a/packages/card/dist/commonjs/ux-card.js b/packages/card/dist/commonjs/ux-card.js deleted file mode 100644 index e010bbf3..00000000 --- a/packages/card/dist/commonjs/ux-card.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var aurelia_templating_1 = require("aurelia-templating"); -var core_1 = require("@aurelia-ux/core"); -var UxCard = /** @class */ (function () { - function UxCard(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxCard.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxCard.prototype.themeChanged = function (newValue) { - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCard.prototype, "theme", void 0); - UxCard = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-card') - ], UxCard); - return UxCard; -}()); -exports.UxCard = UxCard; diff --git a/packages/card/dist/es2015/index.js b/packages/card/dist/es2015/index.js index f6c1b5d8..ebd25e14 100644 --- a/packages/card/dist/es2015/index.js +++ b/packages/card/dist/es2015/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -57,7 +50,7 @@ UxCard = __decorate([ inlineView(UX_CARD_VIEW) ], UxCard); -var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}" +var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}"; class UxCardTheme { constructor() { diff --git a/packages/card/dist/es2015/ux-card.js b/packages/card/dist/es2015/ux-card.js deleted file mode 100644 index 20b0a3d2..00000000 --- a/packages/card/dist/es2015/ux-card.js +++ /dev/null @@ -1,31 +0,0 @@ -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; -}; -import { inject } from 'aurelia-dependency-injection'; -import { bindable, customElement } from 'aurelia-templating'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxCard = class UxCard { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - bind() { - if (this.theme != null) { - this.themeChanged(this.theme); - } - } - themeChanged(newValue) { - this.styleEngine.applyTheme(newValue, this.element); - } -}; -__decorate([ - bindable -], UxCard.prototype, "theme", void 0); -UxCard = __decorate([ - inject(Element, StyleEngine), - customElement('ux-card') -], UxCard); -export { UxCard }; diff --git a/packages/card/dist/native-modules/index.js b/packages/card/dist/native-modules/index.js index 7236c275..d8fe84af 100644 --- a/packages/card/dist/native-modules/index.js +++ b/packages/card/dist/native-modules/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -58,7 +51,7 @@ var UxCard = /** @class */ (function () { return UxCard; }()); -var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}" +var css = "ux-card{display:flex;position:relative;flex-direction:column;box-sizing:border-box;padding:0;border-radius:2px;background-color:#fff;background-color:var(--ux-theme--card-background, var(--ux-design--control-background, #fff));color:#212121;color:var(--ux-theme--card-foreground, var(--ux-design--control-foreground, #212121));box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:var(--ux-design--elevation2dp, 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12))}ux-card ux-card-header,ux-card ux-card-content{padding:16px}ux-card ux-card-header{display:flex;flex-direction:column}ux-card ux-card-header ux-card-header-row{display:flex}ux-card ux-card-header ux-card-title{display:flex;flex-direction:column;font-family:Roboto,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;text-decoration:inherit;text-transform:inherit;font-size:24px;letter-spacing:normal;line-height:24px;margin:0;color:inherit;color:var(--ux-theme--card-title-foreground, inherit)}ux-card ux-card-header ux-card-title[size=small]{font-size:20px;line-height:20px}ux-card ux-card-header ux-card-sub-title{padding-top:8px;font-size:14px;line-height:14px;color:inherit;color:var(--ux-theme--card-sub-title-foreground, inherit);opacity:.8;opacity:var(--ux-theme--card-sub-title-opacity, 0.8)}ux-card ux-card-header[color=primary]{color:#3f51b5;background-color:var(--ux-theme--card-primary-header-background, var(--ux-design--primary, #3F51B5));color:#fff;color:var(--ux-theme--card-primary-header-foreground, var(--ux-design--primary-foreground, #fff))}ux-card ux-card-header[color=accent]{background-color:#ff4081;background-color:var(--ux-theme--card-accent-header-background, var(--ux-design--accent, #ff4081));color:#fff;color:var(--ux-theme--card-accent-header-foreground, var(--ux-design--accent-foreground, #fff))}ux-card ux-card-header[color=primary]+ux-card-content,ux-card ux-card-header[color=accent]+ux-card-content{padding-top:16px}ux-card ux-card-header+ux-card-content{padding-top:0}ux-card ux-card-content:last-child{padding-bottom:24px}ux-card ux-card-action-row{display:flex;margin:8px;flex-wrap:nowrap}ux-card>img{width:100%}ux-card ux-card-footer{padding:8px;display:flex;flex-direction:row;align-items:center;margin-top:auto}ux-card ux-card-footer.align-end{justify-content:flex-end}ux-card .ux-card__action{font-size:14px;height:36px;line-height:36px;color:#3f51b5;color:var(--ux-theme--button-flat-foreground, var(--ux-design--primary, #3F51B5));min-width:88px;padding:0 8px;border-radius:2px;font-weight:500;cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;font-weight:500;font-weight:var(--ux-theme--button-font-weight, 500);text-transform:uppercase;text-transform:var(--ux-theme--button-text-transform, uppercase);letter-spacing:.5px;letter-spacing:var(--ux-theme--button-letter-spacing, 0.5px);user-select:none;-moz-user-select:none;-webkit-user-select:none}ux-card ux-card-footer .ux-card__action:first-child{padding-left:0}ux-card ux-card-footer .ux-card__action:last-child{padding-right:0}ux-card ux-card-spacer{flex:1}ux-grid>ux-card{grid-column:span 12;max-width:100%}ux-grid>ux-card[xs=\"0\"]{display:none}ux-grid>ux-card[xs=\"1\"]{grid-column:span 1}ux-grid>ux-card[xs=\"2\"]{grid-column:span 2}ux-grid>ux-card[xs=\"3\"]{grid-column:span 3}ux-grid>ux-card[xs=\"4\"]{grid-column:span 4}ux-grid>ux-card[xs=\"5\"]{grid-column:span 5}ux-grid>ux-card[xs=\"6\"]{grid-column:span 6}ux-grid>ux-card[xs=\"7\"]{grid-column:span 7}ux-grid>ux-card[xs=\"8\"]{grid-column:span 8}ux-grid>ux-card[xs=\"9\"]{grid-column:span 9}ux-grid>ux-card[xs=\"10\"]{grid-column:span 10}ux-grid>ux-card[xs=\"11\"]{grid-column:span 11}ux-grid>ux-card[xs=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xs=\"-1\"]{order:-1}ux-grid>ux-card[order-xs=\"0\"]{order:0}ux-grid>ux-card[order-xs=\"1\"]{order:1}ux-grid>ux-card[order-xs=\"2\"]{order:2}ux-grid>ux-card[order-xs=\"3\"]{order:3}ux-grid>ux-card[order-xs=\"4\"]{order:4}ux-grid>ux-card[order-xs=\"5\"]{order:5}ux-grid>ux-card[order-xs=\"6\"]{order:6}ux-grid>ux-card[order-xs=\"7\"]{order:7}ux-grid>ux-card[order-xs=\"8\"]{order:8}ux-grid>ux-card[order-xs=\"9\"]{order:9}ux-grid>ux-card[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-card[sm=\"0\"]{display:none}ux-grid>ux-card[sm=\"1\"]{grid-column:span 1}ux-grid>ux-card[sm=\"2\"]{grid-column:span 2}ux-grid>ux-card[sm=\"3\"]{grid-column:span 3}ux-grid>ux-card[sm=\"4\"]{grid-column:span 4}ux-grid>ux-card[sm=\"5\"]{grid-column:span 5}ux-grid>ux-card[sm=\"6\"]{grid-column:span 6}ux-grid>ux-card[sm=\"7\"]{grid-column:span 7}ux-grid>ux-card[sm=\"8\"]{grid-column:span 8}ux-grid>ux-card[sm=\"9\"]{grid-column:span 9}ux-grid>ux-card[sm=\"10\"]{grid-column:span 10}ux-grid>ux-card[sm=\"11\"]{grid-column:span 11}ux-grid>ux-card[sm=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-sm=\"-1\"]{order:-1}ux-grid>ux-card[order-sm=\"0\"]{order:0}ux-grid>ux-card[order-sm=\"1\"]{order:1}ux-grid>ux-card[order-sm=\"2\"]{order:2}ux-grid>ux-card[order-sm=\"3\"]{order:3}ux-grid>ux-card[order-sm=\"4\"]{order:4}ux-grid>ux-card[order-sm=\"5\"]{order:5}ux-grid>ux-card[order-sm=\"6\"]{order:6}ux-grid>ux-card[order-sm=\"7\"]{order:7}ux-grid>ux-card[order-sm=\"8\"]{order:8}ux-grid>ux-card[order-sm=\"9\"]{order:9}ux-grid>ux-card[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid>ux-card[md=\"0\"]{display:none}ux-grid>ux-card[md=\"1\"]{grid-column:span 1}ux-grid>ux-card[md=\"2\"]{grid-column:span 2}ux-grid>ux-card[md=\"3\"]{grid-column:span 3}ux-grid>ux-card[md=\"4\"]{grid-column:span 4}ux-grid>ux-card[md=\"5\"]{grid-column:span 5}ux-grid>ux-card[md=\"6\"]{grid-column:span 6}ux-grid>ux-card[md=\"7\"]{grid-column:span 7}ux-grid>ux-card[md=\"8\"]{grid-column:span 8}ux-grid>ux-card[md=\"9\"]{grid-column:span 9}ux-grid>ux-card[md=\"10\"]{grid-column:span 10}ux-grid>ux-card[md=\"11\"]{grid-column:span 11}ux-grid>ux-card[md=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-md=\"-1\"]{order:-1}ux-grid>ux-card[order-md=\"0\"]{order:0}ux-grid>ux-card[order-md=\"1\"]{order:1}ux-grid>ux-card[order-md=\"2\"]{order:2}ux-grid>ux-card[order-md=\"3\"]{order:3}ux-grid>ux-card[order-md=\"4\"]{order:4}ux-grid>ux-card[order-md=\"5\"]{order:5}ux-grid>ux-card[order-md=\"6\"]{order:6}ux-grid>ux-card[order-md=\"7\"]{order:7}ux-grid>ux-card[order-md=\"8\"]{order:8}ux-grid>ux-card[order-md=\"9\"]{order:9}ux-grid>ux-card[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid>ux-card[lg=\"0\"]{display:none}ux-grid>ux-card[lg=\"1\"]{grid-column:span 1}ux-grid>ux-card[lg=\"2\"]{grid-column:span 2}ux-grid>ux-card[lg=\"3\"]{grid-column:span 3}ux-grid>ux-card[lg=\"4\"]{grid-column:span 4}ux-grid>ux-card[lg=\"5\"]{grid-column:span 5}ux-grid>ux-card[lg=\"6\"]{grid-column:span 6}ux-grid>ux-card[lg=\"7\"]{grid-column:span 7}ux-grid>ux-card[lg=\"8\"]{grid-column:span 8}ux-grid>ux-card[lg=\"9\"]{grid-column:span 9}ux-grid>ux-card[lg=\"10\"]{grid-column:span 10}ux-grid>ux-card[lg=\"11\"]{grid-column:span 11}ux-grid>ux-card[lg=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-lg=\"-1\"]{order:-1}ux-grid>ux-card[order-lg=\"0\"]{order:0}ux-grid>ux-card[order-lg=\"1\"]{order:1}ux-grid>ux-card[order-lg=\"2\"]{order:2}ux-grid>ux-card[order-lg=\"3\"]{order:3}ux-grid>ux-card[order-lg=\"4\"]{order:4}ux-grid>ux-card[order-lg=\"5\"]{order:5}ux-grid>ux-card[order-lg=\"6\"]{order:6}ux-grid>ux-card[order-lg=\"7\"]{order:7}ux-grid>ux-card[order-lg=\"8\"]{order:8}ux-grid>ux-card[order-lg=\"9\"]{order:9}ux-grid>ux-card[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid>ux-card[xl=\"0\"]{display:none}ux-grid>ux-card[xl=\"1\"]{grid-column:span 1}ux-grid>ux-card[xl=\"2\"]{grid-column:span 2}ux-grid>ux-card[xl=\"3\"]{grid-column:span 3}ux-grid>ux-card[xl=\"4\"]{grid-column:span 4}ux-grid>ux-card[xl=\"5\"]{grid-column:span 5}ux-grid>ux-card[xl=\"6\"]{grid-column:span 6}ux-grid>ux-card[xl=\"7\"]{grid-column:span 7}ux-grid>ux-card[xl=\"8\"]{grid-column:span 8}ux-grid>ux-card[xl=\"9\"]{grid-column:span 9}ux-grid>ux-card[xl=\"10\"]{grid-column:span 10}ux-grid>ux-card[xl=\"11\"]{grid-column:span 11}ux-grid>ux-card[xl=\"12\"]{grid-column:span 12}ux-grid>ux-card[order-xl=\"-1\"]{order:-1}ux-grid>ux-card[order-xl=\"0\"]{order:0}ux-grid>ux-card[order-xl=\"1\"]{order:1}ux-grid>ux-card[order-xl=\"2\"]{order:2}ux-grid>ux-card[order-xl=\"3\"]{order:3}ux-grid>ux-card[order-xl=\"4\"]{order:4}ux-grid>ux-card[order-xl=\"5\"]{order:5}ux-grid>ux-card[order-xl=\"6\"]{order:6}ux-grid>ux-card[order-xl=\"7\"]{order:7}ux-grid>ux-card[order-xl=\"8\"]{order:8}ux-grid>ux-card[order-xl=\"9\"]{order:9}ux-grid>ux-card[order-xl=\"10\"]{order:10}}"; var UxCardTheme = /** @class */ (function () { function UxCardTheme() { diff --git a/packages/card/dist/native-modules/ux-card.js b/packages/card/dist/native-modules/ux-card.js deleted file mode 100644 index 154aad60..00000000 --- a/packages/card/dist/native-modules/ux-card.js +++ /dev/null @@ -1,32 +0,0 @@ -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; -}; -import { inject } from 'aurelia-dependency-injection'; -import { bindable, customElement } from 'aurelia-templating'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxCard = /** @class */ (function () { - function UxCard(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxCard.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxCard.prototype.themeChanged = function (newValue) { - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - bindable - ], UxCard.prototype, "theme", void 0); - UxCard = __decorate([ - inject(Element, StyleEngine), - customElement('ux-card') - ], UxCard); - return UxCard; -}()); -export { UxCard }; diff --git a/packages/card/dist/system/ux-card.js b/packages/card/dist/system/ux-card.js deleted file mode 100644 index 3b47ad86..00000000 --- a/packages/card/dist/system/ux-card.js +++ /dev/null @@ -1,49 +0,0 @@ -System.register(["aurelia-dependency-injection", "aurelia-templating", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_dependency_injection_1, aurelia_templating_1, core_1, UxCard; - return { - setters: [ - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxCard = /** @class */ (function () { - function UxCard(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxCard.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxCard.prototype.themeChanged = function (newValue) { - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCard.prototype, "theme", void 0); - UxCard = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-card') - ], UxCard); - return UxCard; - }()); - exports_1("UxCard", UxCard); - } - }; -}); diff --git a/packages/checkbox/dist/amd/index.js b/packages/checkbox/dist/amd/index.js index 8dccdcd4..c6616c24 100644 --- a/packages/checkbox/dist/amd/index.js +++ b/packages/checkbox/dist/amd/index.js @@ -1,221 +1,214 @@ define('@aurelia-ux/checkbox', ['exports', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-pal', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaBinding, aureliaDependencyInjection, core, aureliaPal, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_CHECKBOX_VIEW = " "; + var UX_CHECKBOX_VIEW = " "; -var UxCheckbox = /** @class */ (function () { - function UxCheckbox(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - Object.defineProperty(UxCheckbox.prototype, "isDisabled", { - get: function () { - return core.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxCheckbox.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } + var UxCheckbox = /** @class */ (function () { + function UxCheckbox(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.ignoreValueChanges = false; + this.disabled = false; + this.effect = 'ripple'; + this.ripple = null; + Object.setPrototypeOf(element, uxCheckboxElementProto); } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); + Object.defineProperty(UxCheckbox.prototype, "isDisabled", { + get: function () { + return core.normalizeBooleanAttribute('disabled', this.disabled); + }, + enumerable: true, + configurable: true + }); + UxCheckbox.prototype.bind = function () { + var element = this.element; + var checkbox = this.checkbox; + if (element.hasAttribute('id')) { + var attributeValue = element.getAttribute('id'); + if (attributeValue != null) { + checkbox.setAttribute('id', attributeValue); + } } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; + if (element.hasAttribute('tabindex')) { + var attributeValue = element.getAttribute('tabindex'); + if (attributeValue != null) { + checkbox.setAttribute('tabindex', attributeValue); + } } - } - this.themeChanged(this.theme); - }; - UxCheckbox.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxCheckbox.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxCheckbox.prototype.getChecked = function () { - return this.checked; - }; - UxCheckbox.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxCheckbox.prototype.getIndeterminate = function () { - return this.indeterminate; - }; - UxCheckbox.prototype.setIndeterminate = function (value) { - this.indeterminate = !!value; - }; - UxCheckbox.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxCheckbox.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxCheckbox.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); + if (element.hasAttribute('checked')) { + var attributeValue = element.getAttribute('checked'); + if (attributeValue || attributeValue === '') { + element.checked = true; } } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aureliaTemplating.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aureliaTemplating.bindable - ], UxCheckbox.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCheckbox.prototype, "effect", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCheckbox.prototype, "id", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCheckbox.prototype, "theme", void 0); - __decorate([ - aureliaBinding.observable() - ], UxCheckbox.prototype, "value", void 0); - __decorate([ - aureliaBinding.computedFrom('disabled') - ], UxCheckbox.prototype, "isDisabled", null); - UxCheckbox = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-checkbox'), - aureliaTemplating.inlineView(UX_CHECKBOX_VIEW) - ], UxCheckbox); - return UxCheckbox; -}()); -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); + this.themeChanged(this.theme); + }; + UxCheckbox.prototype.attached = function () { + this.checkbox.addEventListener('change', stopEvent); + }; + UxCheckbox.prototype.detached = function () { + this.checkbox.removeEventListener('change', stopEvent); + }; + UxCheckbox.prototype.getChecked = function () { + return this.checked; + }; + UxCheckbox.prototype.setChecked = function (value) { + var oldValue = this.checked; + var newValue = !!value; + if (newValue !== oldValue) { + this.checked = newValue; + this.ignoreValueChanges = true; + this.value = newValue; + this.ignoreValueChanges = false; + this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); + } + }; + UxCheckbox.prototype.getIndeterminate = function () { + return this.indeterminate; + }; + UxCheckbox.prototype.setIndeterminate = function (value) { + this.indeterminate = !!value; + }; + UxCheckbox.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'checkbox'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxCheckbox.prototype.valueChanged = function (newValue) { + if (this.ignoreValueChanges) { + return; + } + this.setChecked(newValue); + }; + UxCheckbox.prototype.onMouseDown = function (e) { + var _this = this; + if (e.button !== 0 || this.isDisabled) { + return; + } + if (this.element.classList.contains('ripple')) { + if (this.ripple === null) { + this.ripple = new core.PaperRipple(); + var container = this.element.querySelector('.ripplecontainer'); + if (container != null) { + container.appendChild(this.ripple.$); + } + } + this.ripple.center = true; + this.ripple.round = true; + this.ripple.downAction(e); + var winEvents_1 = new aureliaTemplating.ElementEvents(window); + var upAction = function () { + _this.ripple.upAction(); + winEvents_1.disposeAll(); + }; + winEvents_1.subscribe('blur', upAction); + winEvents_1.subscribe('mouseup', upAction, true); + } + e.preventDefault(); + }; + __decorate([ + aureliaTemplating.bindable + ], UxCheckbox.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCheckbox.prototype, "effect", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCheckbox.prototype, "id", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCheckbox.prototype, "theme", void 0); + __decorate([ + aureliaBinding.observable() + ], UxCheckbox.prototype, "value", void 0); + __decorate([ + aureliaBinding.computedFrom('disabled') + ], UxCheckbox.prototype, "isDisabled", null); + UxCheckbox = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-checkbox'), + aureliaTemplating.inlineView(UX_CHECKBOX_VIEW) + ], UxCheckbox); + return UxCheckbox; + }()); + function stopEvent(e) { + e.stopPropagation(); + } + var getVm = function (_) { return _.au.controller.viewModel; }; + var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { + type: { + value: 'checkbox', }, - set: function (value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get: function () { - return getVm(this).getIndeterminate(); + checked: { + get: function () { + return getVm(this).getChecked(); + }, + set: function (value) { + getVm(this).setChecked(value); + } }, - set: function (value) { - getVm(this).setIndeterminate(value); + indeterminate: { + get: function () { + return getVm(this).getIndeterminate(); + }, + set: function (value) { + getVm(this).setIndeterminate(value); + } } - } -}); + }); -var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" + var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; -var UxCheckboxTheme = /** @class */ (function () { - function UxCheckboxTheme() { - this.themeKey = 'checkbox'; - } - return UxCheckboxTheme; -}()); + var UxCheckboxTheme = /** @class */ (function () { + function UxCheckboxTheme() { + this.themeKey = 'checkbox'; + } + return UxCheckboxTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-checkbox-css'); - config.container.get(core.AureliaUX).registerUxElementConfig(uxCheckBoxConfig); - config.globalResources(UxCheckbox); -} -var uxCheckBoxConfig = { - tagName: 'ux-checkbox', - properties: { - checked: { - defaultBindingMode: aureliaFramework.bindingMode.twoWay, - getObserver: function (element, _, observerLocator) { - return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-checkbox-css'); + config.container.get(core.AureliaUX).registerUxElementConfig(uxCheckBoxConfig); + config.globalResources(UxCheckbox); + } + var uxCheckBoxConfig = { + tagName: 'ux-checkbox', + properties: { + checked: { + defaultBindingMode: aureliaFramework.bindingMode.twoWay, + getObserver: function (element, _, observerLocator) { + return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + } } } - } -}; + }; -exports.configure = configure; -exports.UxCheckbox = UxCheckbox; -exports.UxCheckboxTheme = UxCheckboxTheme; + exports.configure = configure; + exports.UxCheckbox = UxCheckbox; + exports.UxCheckboxTheme = UxCheckboxTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/checkbox/dist/amd/ux-checkbox.js b/packages/checkbox/dist/amd/ux-checkbox.js deleted file mode 100644 index ba4ab5da..00000000 --- a/packages/checkbox/dist/amd/ux-checkbox.js +++ /dev/null @@ -1,164 +0,0 @@ -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", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-pal"], function (require, exports, aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_pal_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxCheckbox = /** @class */ (function () { - function UxCheckbox(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - Object.defineProperty(UxCheckbox.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxCheckbox.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - }; - UxCheckbox.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxCheckbox.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxCheckbox.prototype.getChecked = function () { - return this.checked; - }; - UxCheckbox.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxCheckbox.prototype.getIndeterminate = function () { - return this.indeterminate; - }; - UxCheckbox.prototype.setIndeterminate = function (value) { - this.indeterminate = !!value; - }; - UxCheckbox.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxCheckbox.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxCheckbox.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_templating_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable() - ], UxCheckbox.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxCheckbox.prototype, "isDisabled", null); - UxCheckbox = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-checkbox') - ], UxCheckbox); - return UxCheckbox; - }()); - exports.UxCheckbox = UxCheckbox; - function stopEvent(e) { - e.stopPropagation(); - } - var getVm = function (_) { return _.au.controller.viewModel; }; - var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get: function () { - return getVm(this).getIndeterminate(); - }, - set: function (value) { - getVm(this).setIndeterminate(value); - } - } - }); -}); diff --git a/packages/checkbox/dist/commonjs/index.js b/packages/checkbox/dist/commonjs/index.js index a4a82d2a..a9d00e3d 100644 --- a/packages/checkbox/dist/commonjs/index.js +++ b/packages/checkbox/dist/commonjs/index.js @@ -23,13 +23,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -195,7 +188,7 @@ var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxCheckboxTheme = /** @class */ (function () { function UxCheckboxTheme() { diff --git a/packages/checkbox/dist/commonjs/ux-checkbox.js b/packages/checkbox/dist/commonjs/ux-checkbox.js deleted file mode 100644 index 055406fb..00000000 --- a/packages/checkbox/dist/commonjs/ux-checkbox.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var aurelia_pal_1 = require("aurelia-pal"); -var UxCheckbox = /** @class */ (function () { - function UxCheckbox(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - Object.defineProperty(UxCheckbox.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxCheckbox.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - }; - UxCheckbox.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxCheckbox.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxCheckbox.prototype.getChecked = function () { - return this.checked; - }; - UxCheckbox.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxCheckbox.prototype.getIndeterminate = function () { - return this.indeterminate; - }; - UxCheckbox.prototype.setIndeterminate = function (value) { - this.indeterminate = !!value; - }; - UxCheckbox.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxCheckbox.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxCheckbox.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_templating_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable() - ], UxCheckbox.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxCheckbox.prototype, "isDisabled", null); - UxCheckbox = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-checkbox') - ], UxCheckbox); - return UxCheckbox; -}()); -exports.UxCheckbox = UxCheckbox; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get: function () { - return getVm(this).getIndeterminate(); - }, - set: function (value) { - getVm(this).setIndeterminate(value); - } - } -}); diff --git a/packages/checkbox/dist/es2015/index.js b/packages/checkbox/dist/es2015/index.js index 1937db92..c6899118 100644 --- a/packages/checkbox/dist/es2015/index.js +++ b/packages/checkbox/dist/es2015/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -185,7 +178,7 @@ const uxCheckboxElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; class UxCheckboxTheme { constructor() { diff --git a/packages/checkbox/dist/es2015/ux-checkbox.js b/packages/checkbox/dist/es2015/ux-checkbox.js deleted file mode 100644 index 52266358..00000000 --- a/packages/checkbox/dist/es2015/ux-checkbox.js +++ /dev/null @@ -1,159 +0,0 @@ -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; -}; -import { customElement, bindable, ElementEvents } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute, } from '@aurelia-ux/core'; -import { DOM } from 'aurelia-pal'; -let UxCheckbox = class UxCheckbox { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - get isDisabled() { - return normalizeBooleanAttribute('disabled', this.disabled); - } - bind() { - const element = this.element; - const checkbox = this.checkbox; - if (element.hasAttribute('id')) { - const attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - const attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - const attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - } - attached() { - this.checkbox.addEventListener('change', stopEvent); - } - detached() { - this.checkbox.removeEventListener('change', stopEvent); - } - getChecked() { - return this.checked; - } - setChecked(value) { - const oldValue = this.checked; - const newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - getIndeterminate() { - return this.indeterminate; - } - setIndeterminate(value) { - this.indeterminate = !!value; - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - valueChanged(newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - } - onMouseDown(e) { - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - const container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - const winEvents = new ElementEvents(window); - const upAction = () => { - this.ripple.upAction(); - winEvents.disposeAll(); - }; - winEvents.subscribe('blur', upAction); - winEvents.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - } -}; -__decorate([ - bindable -], UxCheckbox.prototype, "disabled", void 0); -__decorate([ - bindable -], UxCheckbox.prototype, "effect", void 0); -__decorate([ - bindable -], UxCheckbox.prototype, "id", void 0); -__decorate([ - bindable -], UxCheckbox.prototype, "theme", void 0); -__decorate([ - observable() -], UxCheckbox.prototype, "value", void 0); -__decorate([ - computedFrom('disabled') -], UxCheckbox.prototype, "isDisabled", null); -UxCheckbox = __decorate([ - inject(Element, StyleEngine), - customElement('ux-checkbox') -], UxCheckbox); -export { UxCheckbox }; -function stopEvent(e) { - e.stopPropagation(); -} -const getVm = (_) => _.au.controller.viewModel; -const uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get() { - return getVm(this).getChecked(); - }, - set(value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get() { - return getVm(this).getIndeterminate(); - }, - set(value) { - getVm(this).setIndeterminate(value); - } - } -}); diff --git a/packages/checkbox/dist/native-modules/index.js b/packages/checkbox/dist/native-modules/index.js index 1a24994f..94db5812 100644 --- a/packages/checkbox/dist/native-modules/index.js +++ b/packages/checkbox/dist/native-modules/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -191,7 +184,7 @@ var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-checkbox{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-checkbox>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-checkbox>input:disabled{cursor:default}ux-checkbox>.checkbox{border:solid 2px #616161;border:var(--ux-theme--checkbox-border, solid 2px #616161);border-radius:3px;display:block;position:relative;box-sizing:border-box;width:100%;height:100%}ux-checkbox input:hover:not(:disabled)~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081));border-radius:3px}ux-checkbox input:checked~.checkbox{border:solid 2px #ff4081;border:var(--ux-theme--checkbox-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-checkbox>.checkbox>.background-box{transform:scale3d(0,0,0);transition:100ms;background-color:#ff4081;background-color:var(--ux-theme--checkbox-checked-background, var(--ux-design--accent, #FF4081));height:inherit;width:inherit}ux-checkbox input:checked~.checkbox>.background-box{transform:none}ux-checkbox>.checkbox>.background-box>svg{fill:#fff;fill:var(--ux-theme--checkbox-checkmark-color, #fff);width:20px;height:20px}ux-checkbox.disabled{pointer-events:none;cursor:default}ux-checkbox.disabled>.checkbox:hover{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B);border-radius:3px}ux-checkbox input:disabled~.checkbox{border:solid 2px #607d8b;border:var(--ux-theme--checkbox-disabled-border, solid 2px #607D8B)}ux-checkbox input:checked:disabled~.checkbox>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--checkbox-disabled-background, #9E9E9E)}ux-checkbox input:disabled~.checkbox>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--checkbox-disabled-foreground, #E0E0E0)}ux-checkbox .ripplecontainer{position:relative;width:0;height:0}ux-checkbox .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-checkbox .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-checkbox input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-checkbox input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxCheckboxTheme = /** @class */ (function () { function UxCheckboxTheme() { diff --git a/packages/checkbox/dist/native-modules/ux-checkbox.js b/packages/checkbox/dist/native-modules/ux-checkbox.js deleted file mode 100644 index 2685983e..00000000 --- a/packages/checkbox/dist/native-modules/ux-checkbox.js +++ /dev/null @@ -1,165 +0,0 @@ -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; -}; -import { customElement, bindable, ElementEvents } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute, } from '@aurelia-ux/core'; -import { DOM } from 'aurelia-pal'; -var UxCheckbox = /** @class */ (function () { - function UxCheckbox(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - Object.defineProperty(UxCheckbox.prototype, "isDisabled", { - get: function () { - return normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxCheckbox.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - }; - UxCheckbox.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxCheckbox.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxCheckbox.prototype.getChecked = function () { - return this.checked; - }; - UxCheckbox.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxCheckbox.prototype.getIndeterminate = function () { - return this.indeterminate; - }; - UxCheckbox.prototype.setIndeterminate = function (value) { - this.indeterminate = !!value; - }; - UxCheckbox.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxCheckbox.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxCheckbox.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - bindable - ], UxCheckbox.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxCheckbox.prototype, "effect", void 0); - __decorate([ - bindable - ], UxCheckbox.prototype, "id", void 0); - __decorate([ - bindable - ], UxCheckbox.prototype, "theme", void 0); - __decorate([ - observable() - ], UxCheckbox.prototype, "value", void 0); - __decorate([ - computedFrom('disabled') - ], UxCheckbox.prototype, "isDisabled", null); - UxCheckbox = __decorate([ - inject(Element, StyleEngine), - customElement('ux-checkbox') - ], UxCheckbox); - return UxCheckbox; -}()); -export { UxCheckbox }; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get: function () { - return getVm(this).getIndeterminate(); - }, - set: function (value) { - getVm(this).setIndeterminate(value); - } - } -}); diff --git a/packages/checkbox/dist/system/ux-checkbox.js b/packages/checkbox/dist/system/ux-checkbox.js deleted file mode 100644 index 50a17170..00000000 --- a/packages/checkbox/dist/system/ux-checkbox.js +++ /dev/null @@ -1,186 +0,0 @@ -System.register(["aurelia-templating", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-pal"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function stopEvent(e) { - e.stopPropagation(); - } - var aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_pal_1, UxCheckbox, getVm, uxCheckboxElementProto; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - } - ], - execute: function () { - UxCheckbox = /** @class */ (function () { - function UxCheckbox(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.ignoreValueChanges = false; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxCheckboxElementProto); - } - Object.defineProperty(UxCheckbox.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxCheckbox.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - }; - UxCheckbox.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxCheckbox.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxCheckbox.prototype.getChecked = function () { - return this.checked; - }; - UxCheckbox.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxCheckbox.prototype.getIndeterminate = function () { - return this.indeterminate; - }; - UxCheckbox.prototype.setIndeterminate = function (value) { - this.indeterminate = !!value; - }; - UxCheckbox.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'checkbox'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxCheckbox.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxCheckbox.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_templating_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxCheckbox.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable() - ], UxCheckbox.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxCheckbox.prototype, "isDisabled", null); - UxCheckbox = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-checkbox') - ], UxCheckbox); - return UxCheckbox; - }()); - exports_1("UxCheckbox", UxCheckbox); - getVm = function (_) { return _.au.controller.viewModel; }; - uxCheckboxElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - }, - indeterminate: { - get: function () { - return getVm(this).getIndeterminate(); - }, - set: function (value) { - getVm(this).setIndeterminate(value); - } - } - }); - } - }; -}); diff --git a/packages/chip-input/dist/amd/index.js b/packages/chip-input/dist/amd/index.js index 0e973cbf..7e2b986e 100644 --- a/packages/chip-input/dist/amd/index.js +++ b/packages/chip-input/dist/amd/index.js @@ -1,324 +1,317 @@ define('@aurelia-ux/chip-input', ['exports', 'aurelia-templating', 'aurelia-pal', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaPal, aureliaBinding, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + function __decorate(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; + } + var UX_TAG_VIEW = " "; - - - - -function __decorate(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; -} - -var UX_TAG_VIEW = " "; - -var UxTag = /** @class */ (function () { - function UxTag(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxTag.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxTag.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; + var UxTag = /** @class */ (function () { + function UxTag(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.value = undefined; } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTag.prototype.closeTag = function () { - var closeEvent = aureliaPal.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aureliaTemplating.bindable - ], UxTag.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTag.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) - ], UxTag.prototype, "value", void 0); - UxTag = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-tag'), - aureliaTemplating.inlineView(UX_TAG_VIEW) - ], UxTag); - return UxTag; -}()); + UxTag.prototype.bind = function () { + this.themeChanged(this.theme); + }; + UxTag.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'tag'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxTag.prototype.closeTag = function () { + var closeEvent = aureliaPal.DOM.createCustomEvent('close', { bubbles: false }); + this.element.dispatchEvent(closeEvent); + }; + __decorate([ + aureliaTemplating.bindable + ], UxTag.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTag.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) + ], UxTag.prototype, "value", void 0); + UxTag = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-tag'), + aureliaTemplating.inlineView(UX_TAG_VIEW) + ], UxTag); + return UxTag; + }()); -var UX_CHIP_VIEW = " "; + var UX_CHIP_VIEW = " "; -var UxChip = /** @class */ (function () { - function UxChip(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxChip.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxChip.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; + var UxChip = /** @class */ (function () { + function UxChip(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.value = undefined; } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxChip.prototype.closeChip = function () { - var closeEvent = aureliaPal.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aureliaTemplating.bindable - ], UxChip.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxChip.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) - ], UxChip.prototype, "value", void 0); - UxChip = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-chip'), - aureliaTemplating.inlineView(UX_CHIP_VIEW) - ], UxChip); - return UxChip; -}()); + UxChip.prototype.bind = function () { + this.themeChanged(this.theme); + }; + UxChip.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'chip'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxChip.prototype.closeChip = function () { + var closeEvent = aureliaPal.DOM.createCustomEvent('close', { bubbles: false }); + this.element.dispatchEvent(closeEvent); + }; + __decorate([ + aureliaTemplating.bindable + ], UxChip.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxChip.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) + ], UxChip.prototype, "value", void 0); + UxChip = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-chip'), + aureliaTemplating.inlineView(UX_CHIP_VIEW) + ], UxChip); + return UxChip; + }()); -var UX_CHIP_INPUT_VIEW = " "; + var UX_CHIP_INPUT_VIEW = " "; -var UxChipInput = /** @class */ (function () { - function UxChipInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - UxChipInput.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - var attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); + var UxChipInput = /** @class */ (function () { + function UxChipInput(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.disabled = false; + this.readonly = false; + this.separator = ', '; + this.value = undefined; + this.chips = new Array(); } - if (core.normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (core.normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - }; - UxChipInput.prototype.attached = function () { - var _this = this; - var blurEvent = aureliaPal.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.detached = function () { - var _this = this; - var blurEvent = aureliaPal.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.handleKeyup = function (event) { - var key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - var chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; + UxChipInput.prototype.bind = function () { + this.themeChanged(this.theme); + if (this.element.hasAttribute('placeholder')) { + var attributeValue = this.element.getAttribute('placeholder'); + if (attributeValue) { + this.textbox.setAttribute('placeholder', attributeValue); + this.element.removeAttribute('placeholder'); } } - } - }; - UxChipInput.prototype.addChip = function () { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); + if (this.value) { + this.chips = this.value.split(this.separator); } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - }; - UxChipInput.prototype.editChip = function (value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - }; - UxChipInput.prototype.removeChip = function (value) { - var chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - }; - UxChipInput.prototype.chipsChanged = function () { - var chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - }; - UxChipInput.prototype.valueChanged = function (newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - }; - UxChipInput.prototype.disabledChanged = function (newValue) { - if (core.normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.readonlyChanged = function (newValue) { - if (core.normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aureliaTemplating.bindable - ], UxChipInput.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxChipInput.prototype, "readonly", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxChipInput.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxChipInput.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxChipInput.prototype, "separator", void 0); - __decorate([ - aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) - ], UxChipInput.prototype, "value", void 0); - __decorate([ - aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) - ], UxChipInput.prototype, "chips", void 0); - UxChipInput = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-chip-input'), - aureliaTemplating.inlineView(UX_CHIP_INPUT_VIEW) - ], UxChipInput); - return UxChipInput; -}()); + if (core.normalizeBooleanAttribute('disabled', this.disabled)) { + this.textbox.setAttribute('disabled', ''); + this.chiprepeat.removeAttribute('deletable'); + this.tagrepeat.removeAttribute('deletable'); + } + if (core.normalizeBooleanAttribute('readonly', this.readonly)) { + this.textbox.setAttribute('readonly', ''); + this.chiprepeat.removeAttribute('deletable'); + this.tagrepeat.removeAttribute('deletable'); + } + }; + UxChipInput.prototype.attached = function () { + var _this = this; + var blurEvent = aureliaPal.DOM.createCustomEvent('blur', { bubbles: true }); + this.textbox.addEventListener('focus', function () { + _this.element.classList.add('focused'); + }); + this.textbox.addEventListener('blur', function () { + _this.addChip(); + _this.element.classList.remove('focused'); + _this.element.dispatchEvent(blurEvent); + }); + }; + UxChipInput.prototype.detached = function () { + var _this = this; + var blurEvent = aureliaPal.DOM.createCustomEvent('blur', { bubbles: true }); + this.textbox.removeEventListener('focus', function () { + _this.element.classList.add('focused'); + }); + this.textbox.removeEventListener('blur', function () { + _this.addChip(); + _this.element.classList.remove('focused'); + _this.element.dispatchEvent(blurEvent); + }); + }; + UxChipInput.prototype.handleKeyup = function (event) { + var key = event.which || event.keyCode; + if (key === 13) { + this.addChip(); + } + if (key === 37) { + if (this.chips && this.textbox.value === '') { + var chip = this.chips.pop(); + if (chip !== undefined) { + this.textbox.value = chip; + } + } + } + }; + UxChipInput.prototype.addChip = function () { + if (this.textbox.value.length) { + if (!this.chips) { + this.chips = new Array(); + } + this.chips.push(this.textbox.value); + this.textbox.value = ''; + this.chipsChanged(); + } + }; + UxChipInput.prototype.editChip = function (value) { + if (this.textbox.value.length === 0) { + this.removeChip(value); + this.textbox.value = value; + this.chipsChanged(); + } + }; + UxChipInput.prototype.removeChip = function (value) { + var chipIndex = this.chips.indexOf(value, 0); + if (chipIndex > -1) { + this.chips.splice(chipIndex, 1); + this.chipsChanged(); + } + }; + UxChipInput.prototype.chipsChanged = function () { + var chipValue = this.chips.join(this.separator); + if (chipValue === '') { + chipValue = null; + } + if (chipValue !== this.value) { + this.value = chipValue; + } + }; + UxChipInput.prototype.valueChanged = function (newValue) { + if (newValue && newValue !== this.chips.join(this.separator)) { + this.chips = newValue.split(this.separator); + } + }; + UxChipInput.prototype.disabledChanged = function (newValue) { + if (core.normalizeBooleanAttribute('disabled', newValue)) { + this.textbox.setAttribute('disabled', ''); + this.chiprepeat.removeAttribute('deletable'); + this.tagrepeat.removeAttribute('deletable'); + } + else { + this.textbox.removeAttribute('disabled'); + this.chiprepeat.setAttribute('deletable', ''); + this.tagrepeat.setAttribute('deletable', ''); + } + }; + UxChipInput.prototype.readonlyChanged = function (newValue) { + if (core.normalizeBooleanAttribute('readonly', newValue)) { + this.textbox.setAttribute('readonly', ''); + this.chiprepeat.removeAttribute('deletable'); + this.tagrepeat.removeAttribute('deletable'); + } + else { + this.textbox.removeAttribute('readonly'); + this.chiprepeat.setAttribute('deletable', ''); + this.tagrepeat.setAttribute('deletable', ''); + } + }; + UxChipInput.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'chip-input'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + __decorate([ + aureliaTemplating.bindable + ], UxChipInput.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxChipInput.prototype, "readonly", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxChipInput.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxChipInput.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxChipInput.prototype, "separator", void 0); + __decorate([ + aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) + ], UxChipInput.prototype, "value", void 0); + __decorate([ + aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) + ], UxChipInput.prototype, "chips", void 0); + UxChipInput = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-chip-input'), + aureliaTemplating.inlineView(UX_CHIP_INPUT_VIEW) + ], UxChipInput); + return UxChipInput; + }()); -var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" + var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; -var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}" + var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}"; -var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" + var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; -var UxChipInputTheme = /** @class */ (function () { - function UxChipInputTheme() { - this.themeKey = 'chip-input'; - } - return UxChipInputTheme; -}()); + var UxChipInputTheme = /** @class */ (function () { + function UxChipInputTheme() { + this.themeKey = 'chip-input'; + } + return UxChipInputTheme; + }()); -var UxTagTheme = /** @class */ (function () { - function UxTagTheme() { - this.themeKey = 'tag'; - } - return UxTagTheme; -}()); + var UxTagTheme = /** @class */ (function () { + function UxTagTheme() { + this.themeKey = 'tag'; + } + return UxTagTheme; + }()); -var UxChipTheme = /** @class */ (function () { - function UxChipTheme() { - this.themeKey = 'chip'; - } - return UxChipTheme; -}()); + var UxChipTheme = /** @class */ (function () { + function UxChipTheme() { + this.themeKey = 'chip'; + } + return UxChipTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(tagCss + chipCss + chipInputCss, undefined, undefined, 'ux-chip-input-css'); - config.globalResources([ - UxTag, - UxChip, - UxChipInput, - ]); -} + function configure(config) { + aureliaFramework.DOM.injectStyles(tagCss + chipCss + chipInputCss, undefined, undefined, 'ux-chip-input-css'); + config.globalResources([ + UxTag, + UxChip, + UxChipInput, + ]); + } -exports.configure = configure; -exports.UxChip = UxChip; -exports.UxTag = UxTag; -exports.UxChipInput = UxChipInput; -exports.UxChipInputTheme = UxChipInputTheme; -exports.UxTagTheme = UxTagTheme; -exports.UxChipTheme = UxChipTheme; + exports.configure = configure; + exports.UxChip = UxChip; + exports.UxTag = UxTag; + exports.UxChipInput = UxChipInput; + exports.UxChipInputTheme = UxChipInputTheme; + exports.UxTagTheme = UxTagTheme; + exports.UxChipTheme = UxChipTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/chip-input/dist/amd/ux-chip-input.js b/packages/chip-input/dist/amd/ux-chip-input.js deleted file mode 100644 index b76c0fba..00000000 --- a/packages/chip-input/dist/amd/ux-chip-input.js +++ /dev/null @@ -1,177 +0,0 @@ -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", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxChipInput = /** @class */ (function () { - function UxChipInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - UxChipInput.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - var attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); - } - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (core_1.normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - }; - UxChipInput.prototype.attached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.detached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.handleKeyup = function (event) { - var key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - var chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; - } - } - } - }; - UxChipInput.prototype.addChip = function () { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); - } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - }; - UxChipInput.prototype.editChip = function (value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - }; - UxChipInput.prototype.removeChip = function (value) { - var chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - }; - UxChipInput.prototype.chipsChanged = function () { - var chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - }; - UxChipInput.prototype.valueChanged = function (newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - }; - UxChipInput.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.readonlyChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "separator", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "value", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "chips", void 0); - UxChipInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip-input') - ], UxChipInput); - return UxChipInput; - }()); - exports.UxChipInput = UxChipInput; -}); diff --git a/packages/chip-input/dist/amd/ux-chip.js b/packages/chip-input/dist/amd/ux-chip.js deleted file mode 100644 index f263b19f..00000000 --- a/packages/chip-input/dist/amd/ux-chip.js +++ /dev/null @@ -1,45 +0,0 @@ -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", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxChip = /** @class */ (function () { - function UxChip(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxChip.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxChip.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxChip.prototype.closeChip = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChip.prototype, "value", void 0); - UxChip = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip') - ], UxChip); - return UxChip; - }()); - exports.UxChip = UxChip; -}); diff --git a/packages/chip-input/dist/amd/ux-tag.js b/packages/chip-input/dist/amd/ux-tag.js deleted file mode 100644 index a6bb40d1..00000000 --- a/packages/chip-input/dist/amd/ux-tag.js +++ /dev/null @@ -1,45 +0,0 @@ -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", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxTag = /** @class */ (function () { - function UxTag(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxTag.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxTag.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTag.prototype.closeTag = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxTag.prototype, "value", void 0); - UxTag = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-tag') - ], UxTag); - return UxTag; - }()); - exports.UxTag = UxTag; -}); diff --git a/packages/chip-input/dist/commonjs/index.js b/packages/chip-input/dist/commonjs/index.js index 391ce51d..d3131e6f 100644 --- a/packages/chip-input/dist/commonjs/index.js +++ b/packages/chip-input/dist/commonjs/index.js @@ -23,13 +23,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -284,11 +277,11 @@ var UxChipInput = /** @class */ (function () { return UxChipInput; }()); -var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; -var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}" +var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}"; -var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; var UxChipInputTheme = /** @class */ (function () { function UxChipInputTheme() { diff --git a/packages/chip-input/dist/commonjs/ux-chip-input.js b/packages/chip-input/dist/commonjs/ux-chip-input.js deleted file mode 100644 index 6bed380f..00000000 --- a/packages/chip-input/dist/commonjs/ux-chip-input.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxChipInput = /** @class */ (function () { - function UxChipInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - UxChipInput.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - var attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); - } - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (core_1.normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - }; - UxChipInput.prototype.attached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.detached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.handleKeyup = function (event) { - var key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - var chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; - } - } - } - }; - UxChipInput.prototype.addChip = function () { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); - } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - }; - UxChipInput.prototype.editChip = function (value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - }; - UxChipInput.prototype.removeChip = function (value) { - var chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - }; - UxChipInput.prototype.chipsChanged = function () { - var chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - }; - UxChipInput.prototype.valueChanged = function (newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - }; - UxChipInput.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.readonlyChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "separator", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "value", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "chips", void 0); - UxChipInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip-input') - ], UxChipInput); - return UxChipInput; -}()); -exports.UxChipInput = UxChipInput; diff --git a/packages/chip-input/dist/commonjs/ux-chip.js b/packages/chip-input/dist/commonjs/ux-chip.js deleted file mode 100644 index 16506aa7..00000000 --- a/packages/chip-input/dist/commonjs/ux-chip.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxChip = /** @class */ (function () { - function UxChip(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxChip.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxChip.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxChip.prototype.closeChip = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChip.prototype, "value", void 0); - UxChip = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip') - ], UxChip); - return UxChip; -}()); -exports.UxChip = UxChip; diff --git a/packages/chip-input/dist/commonjs/ux-tag.js b/packages/chip-input/dist/commonjs/ux-tag.js deleted file mode 100644 index 839b8c5e..00000000 --- a/packages/chip-input/dist/commonjs/ux-tag.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxTag = /** @class */ (function () { - function UxTag(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxTag.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxTag.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTag.prototype.closeTag = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxTag.prototype, "value", void 0); - UxTag = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-tag') - ], UxTag); - return UxTag; -}()); -exports.UxTag = UxTag; diff --git a/packages/chip-input/dist/es2015/index.js b/packages/chip-input/dist/es2015/index.js index 2ad3d4d8..70992cfc 100644 --- a/packages/chip-input/dist/es2015/index.js +++ b/packages/chip-input/dist/es2015/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -275,11 +268,11 @@ UxChipInput = __decorate([ inlineView(UX_CHIP_INPUT_VIEW) ], UxChipInput); -var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; -var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}" +var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}"; -var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; class UxChipInputTheme { constructor() { diff --git a/packages/chip-input/dist/es2015/ux-chip-input.js b/packages/chip-input/dist/es2015/ux-chip-input.js deleted file mode 100644 index 87a0381f..00000000 --- a/packages/chip-input/dist/es2015/ux-chip-input.js +++ /dev/null @@ -1,175 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, normalizeBooleanAttribute } from '@aurelia-ux/core'; -let UxChipInput = class UxChipInput { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - bind() { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - const attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); - } - if (normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - } - attached() { - const blurEvent = DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', () => { - this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', () => { - this.addChip(); - this.element.classList.remove('focused'); - this.element.dispatchEvent(blurEvent); - }); - } - detached() { - const blurEvent = DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', () => { - this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', () => { - this.addChip(); - this.element.classList.remove('focused'); - this.element.dispatchEvent(blurEvent); - }); - } - handleKeyup(event) { - const key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - const chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; - } - } - } - } - addChip() { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); - } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - } - editChip(value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - } - removeChip(value) { - const chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - } - chipsChanged() { - let chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - } - valueChanged(newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - } - disabledChanged(newValue) { - if (normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - } - readonlyChanged(newValue) { - if (normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - } -}; -__decorate([ - bindable -], UxChipInput.prototype, "disabled", void 0); -__decorate([ - bindable -], UxChipInput.prototype, "readonly", void 0); -__decorate([ - bindable -], UxChipInput.prototype, "theme", void 0); -__decorate([ - bindable -], UxChipInput.prototype, "type", void 0); -__decorate([ - bindable -], UxChipInput.prototype, "separator", void 0); -__decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) -], UxChipInput.prototype, "value", void 0); -__decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) -], UxChipInput.prototype, "chips", void 0); -UxChipInput = __decorate([ - inject(Element, StyleEngine), - customElement('ux-chip-input') -], UxChipInput); -export { UxChipInput }; diff --git a/packages/chip-input/dist/es2015/ux-chip.js b/packages/chip-input/dist/es2015/ux-chip.js deleted file mode 100644 index 35adfbba..00000000 --- a/packages/chip-input/dist/es2015/ux-chip.js +++ /dev/null @@ -1,45 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxChip = class UxChip { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - bind() { - this.themeChanged(this.theme); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - closeChip() { - const closeEvent = DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - } -}; -__decorate([ - bindable -], UxChip.prototype, "theme", void 0); -__decorate([ - bindable -], UxChip.prototype, "type", void 0); -__decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) -], UxChip.prototype, "value", void 0); -UxChip = __decorate([ - inject(Element, StyleEngine), - customElement('ux-chip') -], UxChip); -export { UxChip }; diff --git a/packages/chip-input/dist/es2015/ux-tag.js b/packages/chip-input/dist/es2015/ux-tag.js deleted file mode 100644 index 7cdd7745..00000000 --- a/packages/chip-input/dist/es2015/ux-tag.js +++ /dev/null @@ -1,45 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxTag = class UxTag { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - bind() { - this.themeChanged(this.theme); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - closeTag() { - const closeEvent = DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - } -}; -__decorate([ - bindable -], UxTag.prototype, "theme", void 0); -__decorate([ - bindable -], UxTag.prototype, "type", void 0); -__decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) -], UxTag.prototype, "value", void 0); -UxTag = __decorate([ - inject(Element, StyleEngine), - customElement('ux-tag') -], UxTag); -export { UxTag }; diff --git a/packages/chip-input/dist/native-modules/index.js b/packages/chip-input/dist/native-modules/index.js index 6885c859..ba5c96e4 100644 --- a/packages/chip-input/dist/native-modules/index.js +++ b/packages/chip-input/dist/native-modules/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -280,11 +273,11 @@ var UxChipInput = /** @class */ (function () { return UxChipInput; }()); -var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var chipCss = "ux-chip{display:inline-flex;align-items:center;font-size:14px;height:32px;border-radius:100px;background-color:#ff4081;background-color:var(--ux-theme--chip-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--chip-foreground, var(--ux-design--accent-foreground, #FFF))}ux-chip:focus{outline:0;box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2);box-shadow:var(--ux-design--elevation4dp, 0 4px 5px 0 rgba(0, 0, 0, 0.14),0 1px 10px 0 rgba(0, 0, 0, 0.12),0 2px 4px -1px rgba(0, 0, 0, 0.2))}ux-chip>span{margin:0 12px}ux-chip>span.close{display:none}ux-chip[deletable]>span{margin-right:0}ux-chip[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;color:#eee;color:var(--ux-theme--chip-delete-foreground, #EEEEEE);background-color:#9e9e9e;background-color:var(--ux-theme--chip-delete-background, #9E9E9E);height:24px;width:24px;border-radius:24px;cursor:pointer}ux-chip[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; -var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}" +var chipInputCss = "ux-chip-input{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;width:100%}ux-chip-input>ux-chip,ux-chip-input>ux-tag{margin-right:6px;cursor:default}ux-chip-input>input{align-self:stretch;background:0 0;border:0;flex-grow:1;min-width:180px;color:inherit;color:var(--ux-theme--chip-input-foreground, inherit)}ux-chip-input>input:focus{outline:0}ux-chip-input>input+div.bottom-border{align-self:flex-end;background-color:#9e9e9e;background-color:var(--ux-theme--chip-input-bottom-border, #9E9E9E);height:1px;margin-top:2px;margin-bottom:4px;transition:background-color 250ms ease;width:100%}ux-chip-input:hover>div.bottom-border,ux-chip-input>input:focus+div.bottom-border{background-color:#ff4081;background-color:var(--ux-design--accent, #FF4081)}ux-chip-input>input:focus+div.bottom-border{height:2px;margin-bottom:3px}"; -var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}" +var tagCss = "ux-tag{display:inline-flex;align-items:center;font-size:14px;height:24px;border-radius:2px;background-color:#ff4081;background-color:var(--ux-theme--tag-background, var(--ux-design--accent, #FF4081));color:#fff;color:var(--ux-theme--tag-foreground, var(--ux-design--accent-foreground, #FFF))}ux-tag>span{margin:0 8px}ux-tag>span.close{display:none}ux-tag[deletable]>span{margin-right:0}ux-tag[deletable]>span.close{display:inline-flex;justify-content:center;align-items:center;margin:0 4px;cursor:pointer}ux-tag[deletable]>span.close::before{content:'+';font-size:24px;transform:rotate(45deg)}"; var UxChipInputTheme = /** @class */ (function () { function UxChipInputTheme() { diff --git a/packages/chip-input/dist/native-modules/ux-chip-input.js b/packages/chip-input/dist/native-modules/ux-chip-input.js deleted file mode 100644 index 207877fa..00000000 --- a/packages/chip-input/dist/native-modules/ux-chip-input.js +++ /dev/null @@ -1,178 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, normalizeBooleanAttribute } from '@aurelia-ux/core'; -var UxChipInput = /** @class */ (function () { - function UxChipInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - UxChipInput.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - var attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); - } - if (normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - }; - UxChipInput.prototype.attached = function () { - var _this = this; - var blurEvent = DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.detached = function () { - var _this = this; - var blurEvent = DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.handleKeyup = function (event) { - var key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - var chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; - } - } - } - }; - UxChipInput.prototype.addChip = function () { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); - } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - }; - UxChipInput.prototype.editChip = function (value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - }; - UxChipInput.prototype.removeChip = function (value) { - var chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - }; - UxChipInput.prototype.chipsChanged = function () { - var chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - }; - UxChipInput.prototype.valueChanged = function (newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - }; - UxChipInput.prototype.disabledChanged = function (newValue) { - if (normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.readonlyChanged = function (newValue) { - if (normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - bindable - ], UxChipInput.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxChipInput.prototype, "readonly", void 0); - __decorate([ - bindable - ], UxChipInput.prototype, "theme", void 0); - __decorate([ - bindable - ], UxChipInput.prototype, "type", void 0); - __decorate([ - bindable - ], UxChipInput.prototype, "separator", void 0); - __decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) - ], UxChipInput.prototype, "value", void 0); - __decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) - ], UxChipInput.prototype, "chips", void 0); - UxChipInput = __decorate([ - inject(Element, StyleEngine), - customElement('ux-chip-input') - ], UxChipInput); - return UxChipInput; -}()); -export { UxChipInput }; diff --git a/packages/chip-input/dist/native-modules/ux-chip.js b/packages/chip-input/dist/native-modules/ux-chip.js deleted file mode 100644 index f7c0fdb1..00000000 --- a/packages/chip-input/dist/native-modules/ux-chip.js +++ /dev/null @@ -1,46 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxChip = /** @class */ (function () { - function UxChip(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxChip.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxChip.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxChip.prototype.closeChip = function () { - var closeEvent = DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - bindable - ], UxChip.prototype, "theme", void 0); - __decorate([ - bindable - ], UxChip.prototype, "type", void 0); - __decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) - ], UxChip.prototype, "value", void 0); - UxChip = __decorate([ - inject(Element, StyleEngine), - customElement('ux-chip') - ], UxChip); - return UxChip; -}()); -export { UxChip }; diff --git a/packages/chip-input/dist/native-modules/ux-tag.js b/packages/chip-input/dist/native-modules/ux-tag.js deleted file mode 100644 index 6f93e58c..00000000 --- a/packages/chip-input/dist/native-modules/ux-tag.js +++ /dev/null @@ -1,46 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxTag = /** @class */ (function () { - function UxTag(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxTag.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxTag.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTag.prototype.closeTag = function () { - var closeEvent = DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - bindable - ], UxTag.prototype, "theme", void 0); - __decorate([ - bindable - ], UxTag.prototype, "type", void 0); - __decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) - ], UxTag.prototype, "value", void 0); - UxTag = __decorate([ - inject(Element, StyleEngine), - customElement('ux-tag') - ], UxTag); - return UxTag; -}()); -export { UxTag }; diff --git a/packages/chip-input/dist/system/ux-chip-input.js b/packages/chip-input/dist/system/ux-chip-input.js deleted file mode 100644 index 3fb4091d..00000000 --- a/packages/chip-input/dist/system/ux-chip-input.js +++ /dev/null @@ -1,199 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, UxChipInput; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxChipInput = /** @class */ (function () { - function UxChipInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.readonly = false; - this.separator = ', '; - this.value = undefined; - this.chips = new Array(); - } - UxChipInput.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.element.hasAttribute('placeholder')) { - var attributeValue = this.element.getAttribute('placeholder'); - if (attributeValue) { - this.textbox.setAttribute('placeholder', attributeValue); - this.element.removeAttribute('placeholder'); - } - } - if (this.value) { - this.chips = this.value.split(this.separator); - } - if (core_1.normalizeBooleanAttribute('disabled', this.disabled)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - if (core_1.normalizeBooleanAttribute('readonly', this.readonly)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - }; - UxChipInput.prototype.attached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.addEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.addEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.detached = function () { - var _this = this; - var blurEvent = aurelia_pal_1.DOM.createCustomEvent('blur', { bubbles: true }); - this.textbox.removeEventListener('focus', function () { - _this.element.classList.add('focused'); - }); - this.textbox.removeEventListener('blur', function () { - _this.addChip(); - _this.element.classList.remove('focused'); - _this.element.dispatchEvent(blurEvent); - }); - }; - UxChipInput.prototype.handleKeyup = function (event) { - var key = event.which || event.keyCode; - if (key === 13) { - this.addChip(); - } - if (key === 37) { - if (this.chips && this.textbox.value === '') { - var chip = this.chips.pop(); - if (chip !== undefined) { - this.textbox.value = chip; - } - } - } - }; - UxChipInput.prototype.addChip = function () { - if (this.textbox.value.length) { - if (!this.chips) { - this.chips = new Array(); - } - this.chips.push(this.textbox.value); - this.textbox.value = ''; - this.chipsChanged(); - } - }; - UxChipInput.prototype.editChip = function (value) { - if (this.textbox.value.length === 0) { - this.removeChip(value); - this.textbox.value = value; - this.chipsChanged(); - } - }; - UxChipInput.prototype.removeChip = function (value) { - var chipIndex = this.chips.indexOf(value, 0); - if (chipIndex > -1) { - this.chips.splice(chipIndex, 1); - this.chipsChanged(); - } - }; - UxChipInput.prototype.chipsChanged = function () { - var chipValue = this.chips.join(this.separator); - if (chipValue === '') { - chipValue = null; - } - if (chipValue !== this.value) { - this.value = chipValue; - } - }; - UxChipInput.prototype.valueChanged = function (newValue) { - if (newValue && newValue !== this.chips.join(this.separator)) { - this.chips = newValue.split(this.separator); - } - }; - UxChipInput.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue)) { - this.textbox.setAttribute('disabled', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('disabled'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.readonlyChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('readonly', newValue)) { - this.textbox.setAttribute('readonly', ''); - this.chiprepeat.removeAttribute('deletable'); - this.tagrepeat.removeAttribute('deletable'); - } - else { - this.textbox.removeAttribute('readonly'); - this.chiprepeat.setAttribute('deletable', ''); - this.tagrepeat.setAttribute('deletable', ''); - } - }; - UxChipInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip-input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChipInput.prototype, "separator", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "value", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChipInput.prototype, "chips", void 0); - UxChipInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip-input') - ], UxChipInput); - return UxChipInput; - }()); - exports_1("UxChipInput", UxChipInput); - } - }; -}); diff --git a/packages/chip-input/dist/system/ux-chip.js b/packages/chip-input/dist/system/ux-chip.js deleted file mode 100644 index ef38b188..00000000 --- a/packages/chip-input/dist/system/ux-chip.js +++ /dev/null @@ -1,67 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, UxChip; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxChip = /** @class */ (function () { - function UxChip(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxChip.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxChip.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'chip'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxChip.prototype.closeChip = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxChip.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxChip.prototype, "value", void 0); - UxChip = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-chip') - ], UxChip); - return UxChip; - }()); - exports_1("UxChip", UxChip); - } - }; -}); diff --git a/packages/chip-input/dist/system/ux-tag.js b/packages/chip-input/dist/system/ux-tag.js deleted file mode 100644 index e3592ec3..00000000 --- a/packages/chip-input/dist/system/ux-tag.js +++ /dev/null @@ -1,67 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, UxTag; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxTag = /** @class */ (function () { - function UxTag(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.value = undefined; - } - UxTag.prototype.bind = function () { - this.themeChanged(this.theme); - }; - UxTag.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'tag'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTag.prototype.closeTag = function () { - var closeEvent = aurelia_pal_1.DOM.createCustomEvent('close', { bubbles: false }); - this.element.dispatchEvent(closeEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTag.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxTag.prototype, "value", void 0); - UxTag = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-tag') - ], UxTag); - return UxTag; - }()); - exports_1("UxTag", UxTag); - } - }; -}); diff --git a/packages/components/package.json b/packages/components/package.json index 37d302bc..10df1d17 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,4 +1,3 @@ -<<<<<<< HEAD { "name": "@aurelia-ux/components", "version": "0.11.1", @@ -168,174 +167,3 @@ } } } -======= -{ - "name": "@aurelia-ux/components", - "version": "0.10.1", - "description": "Official components made with Aurelia UX", - "keywords": [ - "aurelia", - "styles", - "components", - "ux" - ], - "homepage": "http://aurelia.io", - "bugs": { - "url": "https://github.com/aurelia/ux/issues" - }, - "license": "MIT", - "author": "Rob Eisenberg (http://robeisenberg.com/)", - "contributors": [ - "Zach Hollingshead " - ], - "main": "dist/commonjs/index.js", - "typings": "dist/commonjs/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/aurelia/ux" - }, - "scripts": { - "lint": "cross-env tslint --project tsconfig.json", - "test": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start --single-run", - "develop": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start", - "prebuild:amd": "cross-env rimraf dist/amd", - "build:amd": "cross-env tsc --project tsconfig.json --outDir dist/amd --module amd", - "postbuild:amd": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/amd", - "prebuild:commonjs": "cross-env rimraf dist/commonjs", - "build:commonjs": "cross-env tsc --project tsconfig.json --outDir dist/commonjs --module commonjs", - "postbuild:commonjs": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/commonjs", - "prebuild:es2015": "cross-env rimraf dist/es2015", - "build:es2015": "cross-env tsc --project tsconfig.json --outDir dist/es2015 --module es2015 --target es2015", - "postbuild:es2015": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/es2015", - "prebuild:native-modules": "cross-env rimraf dist/native-modules", - "build:native-modules": "cross-env tsc --project tsconfig.json --outDir dist/native-modules --module es2015", - "postbuild:native-modules": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/native-modules", - "prebuild:system": "cross-env rimraf dist/system", - "build:system": "cross-env tsc --project tsconfig.json --outDir dist/system --module system", - "postbuild:system": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/system", - "prebuild": "cross-env rimraf dist", - "build": "concurrently \"npm run build:amd\" \"npm run build:commonjs\" \"npm run build:es2015\" \"npm run build:native-modules\" \"npm run build:system\"", - "predoc": "cross-env rimraf doc/api.json && rimraf dist/doc-temp && tsc --project tsconfig.json --outFile dist/doc-temp/aurelia-ux.js && node doc/shape-defs && copyfiles tsconfig.json dist/doc-temp", - "doc": "cross-env typedoc --json doc/api.json --excludeExternals --includeDeclarations --mode modules --target ES6 --name aurelia-ux-docs dist/doc-temp/", - "postdoc": "cross-env node doc/shape-doc && rimraf dist/doc-temp", - "changelog": "cross-env conventional-changelog -p ux -i doc/CHANGELOG.md -s", - "bump-version": "npm --no-git-tag-version version", - "preprepare-release": "cross-env npm run test", - "prepare-release": "cross-env npm run changelog && npm run build && npm run doc" - }, - "jspm": { - "registry": "npm", - "jspmPackage": true, - "main": "index", - "format": "amd", - "directories": { - "dist": "dist/amd" - }, - "peerDependencies": { - "aurelia-binding": "^1.0.0 || ^2.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-task-queue": "^1.0.0", - "aurelia-templating": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-templating-binding": "^1.0.0", - "aurelia-framework": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-path": "^1.0.0", - "@aurelia-ux/core": "^0.4.0" - }, - "dependencies": { - "aurelia-binding": "^1.0.0 || ^2.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-task-queue": "^1.0.0", - "aurelia-templating": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-templating-binding": "^1.0.0", - "aurelia-framework": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-path": "^1.0.0", - "@aurelia-ux/button": "^0.6.0", - "@aurelia-ux/checkbox": "^0.6.1", - "@aurelia-ux/chip-input": "^0.6.0", - "@aurelia-ux/core": "^0.6.0", - "@aurelia-ux/datepicker": "^0.6.0", - "@aurelia-ux/grid": "^0.6.1", - "@aurelia-ux/form": "^0.6.0", - "@aurelia-ux/input": "^0.6.0", - "@aurelia-ux/input-info": "^0.6.0", - "@aurelia-ux/list": "^0.6.0", - "@aurelia-ux/radio": "^0.6.0", - "@aurelia-ux/switch": "^0.6.0", - "@aurelia-ux/textarea": "^0.6.0" - }, - "devDependencies": {} - }, - "dependencies": { - "@aurelia-ux/button": "^0.10.1", - "@aurelia-ux/card": "^0.10.1", - "@aurelia-ux/checkbox": "^0.10.1", - "@aurelia-ux/chip-input": "^0.10.1", - "@aurelia-ux/core": "^0.10.1", - "@aurelia-ux/datepicker": "^0.10.1", - "@aurelia-ux/form": "^0.10.1", - "@aurelia-ux/grid": "^0.10.1", - "@aurelia-ux/input": "^0.10.1", - "@aurelia-ux/input-info": "^0.10.1", - "@aurelia-ux/list": "^0.10.1", - "@aurelia-ux/radio": "^0.10.1", - "@aurelia-ux/select": "^0.10.1", - "@aurelia-ux/switch": "^0.10.1", - "@aurelia-ux/textarea": "^0.10.1", - "aurelia-framework": "^1.3.0-rc.2" - }, - "devDependencies": { - "@types/jasmine": "^2.8.6", - "@types/karma": "^1.7.3", - "@types/node": "^7.0.11", - "@types/webpack": "^3.8.8", - "aurelia-bootstrapper": "^2.1.1", - "aurelia-pal-browser": "^1.2.0", - "aurelia-pal-nodejs": "^1.0.0-beta.1.0.0", - "aurelia-polyfills": "^1.2.1", - "aurelia-testing": "^1.0.0-beta.3.0.1", - "aurelia-webpack-plugin": "^3.0.0-rc.1", - "concurrently": "^3.4.0", - "conventional-changelog-cli": "^1.3.1", - "copyfiles": "^1.2.0", - "cross-env": "^3.2.4", - "istanbul-instrumenter-loader": "^3.0.0", - "jasmine-core": "^2.99.1", - "karma": "^1.7.1", - "karma-chrome-launcher": "^2.0.0", - "karma-coverage": "^1.1.1", - "karma-coverage-istanbul-reporter": "^1.4.1", - "karma-ie-launcher": "^1.0.0", - "karma-jasmine": "^1.1.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^2.0.13", - "path": "^0.12.7", - "requirejs": "^2.3.3", - "requirejs-text": "^2.0.15", - "rimraf": "^2.6.1", - "ts-loader": "^4.0.1", - "ts-node": "^5.0.1", - "tsconfig-paths": "^3.1.1", - "tslint": "^4.4.2", - "typedoc": "^0.9.0", - "typescript": "^2.2.1", - "webpack": "^4.0.1" - }, - "aurelia": { - "build": { - "resources": [] - }, - "documentation": { - "articles": [] - } - } -} ->>>>>>> refactor(All): move build to rollup, update core deps diff --git a/packages/core/dist/amd/effects/paper-ripple.css b/packages/core/dist/amd/effects/paper-ripple.css deleted file mode 100644 index 701d4dbd..00000000 --- a/packages/core/dist/amd/effects/paper-ripple.css +++ /dev/null @@ -1,59 +0,0 @@ -.paper-ripple { - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - border-radius: inherit; - overflow: hidden; - pointer-events: none; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - pointer-events: none; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__wave { - opacity: 0; -} - -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave { - overflow: hidden; -} - -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - border-radius: 50%; -} - -.paper-ripple .paper-ripple__background { - will-change: opacity, background-color; -} - -.paper-ripple .paper-ripple__wave { - will-change: opacity, transform; -} - -.paper-ripple .paper-ripple__wave-container { - will-change: transform; -} - -.paper-ripple--round .paper-ripple__background, -.paper-ripple--round .paper-ripple__waves { - border-radius: 50%; -} - -.paper-ripple--round .paper-ripple__wave-container { - overflow: hidden; -} diff --git a/packages/core/dist/amd/index.js b/packages/core/dist/amd/index.js index b0abe433..1e769d7f 100644 --- a/packages/core/dist/amd/index.js +++ b/packages/core/dist/amd/index.js @@ -1,5 +1,5 @@ -define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia-pal', 'aurelia-logging', 'aurelia-loader', 'aurelia-binding', 'aurelia-framework', 'aurelia-templating-binding'], function (exports, aureliaDependencyInjection, aureliaPal, aureliaLogging, aureliaLoader, aureliaBinding, aureliaFramework, aureliaTemplatingBinding) { 'use strict'; - +define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia-pal', 'aurelia-logging', 'aurelia-loader', 'aurelia-binding', 'aurelia-framework', 'aurelia-templating-binding'], function (exports, aureliaDependencyInjection, aureliaPal, aureliaLogging, aureliaLoader, aureliaBinding, aureliaFramework, aureliaTemplatingBinding) { 'use strict'; + /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -20,8 +20,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- 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; - } - + } + var swatches = { red: { p50: '#FFEBEE', @@ -317,8 +317,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- }, black: '#000000', white: '#FFFFFF' - }; - + }; + var shadows = { depth_0: 'none', depth_2dp: '0 2px 2px 0 rgba(0, 0, 0, 0.14),' + @@ -344,8 +344,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- '0 24px 38px 3px rgba(0, 0, 0, 0.2)', depth_focus: '0 0 8px rgba(0,0,0,.18),' + '0 8px 16px rgba(0,0,0,.36)' - }; - + }; + var IOSDesign = /** @class */ (function () { function IOSDesign() { this.type = 'ios'; @@ -376,8 +376,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- this.elevationFocus = shadows.depth_focus; } return IOSDesign; - }()); - + }()); + var IOS = /** @class */ (function () { function IOS(design) { this.design = design; @@ -387,8 +387,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(IOSDesign) ], IOS); return IOS; - }()); - + }()); + var MaterialDesign = /** @class */ (function () { function MaterialDesign() { this.type = 'material'; @@ -419,8 +419,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- this.elevationFocus = shadows.depth_focus; } return MaterialDesign; - }()); - + }()); + var Android = /** @class */ (function () { function Android(design) { this.design = design; @@ -430,8 +430,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(MaterialDesign) ], Android); return Android; - }()); - + }()); + var Cordova = /** @class */ (function () { function Cordova(container) { this.container = container; @@ -467,8 +467,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(aureliaDependencyInjection.Container) ], Cordova); return Cordova; - }()); - + }()); + var Web = /** @class */ (function () { function Web(design) { this.design = design; @@ -483,8 +483,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(MaterialDesign) ], Web); return Web; - }()); - + }()); + var Electron = /** @class */ (function () { function Electron() { this.type = 'electron'; @@ -504,8 +504,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(MaterialDesign) ], Electron); return Electron; - }()); - + }()); + var GlobalStyleEngine = /** @class */ (function () { function GlobalStyleEngine() { this.logger = aureliaLogging.getLogger('aurelia-ux'); @@ -565,8 +565,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- this.styleTag.innerHTML = innerHtml; }; return GlobalStyleEngine; - }()); - + }()); + var UXConfiguration = /** @class */ (function () { function UXConfiguration(loader, globalStyleEngine) { this.loader = loader; @@ -595,8 +595,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(aureliaLoader.Loader, GlobalStyleEngine) ], UXConfiguration); return UXConfiguration; - }()); - + }()); + var DesignProcessor = /** @class */ (function () { function DesignProcessor(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -650,8 +650,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- function kebabCase(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); - } - + } + var AureliaUX = /** @class */ (function () { function AureliaUX(use, container, designProcessor, observerLocator) { this.use = use; @@ -749,8 +749,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(UXConfiguration, aureliaDependencyInjection.Container, DesignProcessor, aureliaFramework.ObserverLocator) ], AureliaUX); return AureliaUX; - }()); - + }()); + var BooleanBB = /** @class */ (function () { function BooleanBB() { } @@ -786,8 +786,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- throw new Error(msg); }; return BooleanAttributeObserver; - }()); - + }()); + function processDesignAttributes(_, __, node, attributes, ___) { var prefix = 'material-'; // TODO: get this from somewhere var length = prefix.length; @@ -801,8 +801,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- } // tslint:enable:prefer-const return true; - } - + } + /** * Provides the utilities for getting element's metrics. */ @@ -877,8 +877,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- return x >= l && x <= l + w && y >= t && y <= t + h; }; return ElementRect; - }()); - + }()); + // tslint:disable:variable-name var _window = aureliaPal.PLATFORM.global; var _doc = _window.document; @@ -1172,8 +1172,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- */ PaperWave.MAX_RADIUS = 300; return PaperWave; - }()); - + }()); + /** * Provides all the logic to produce ripple visual effect. * Other elements can use it to simulate rippling effect emanating from the point of contact. @@ -1358,8 +1358,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- return this; }; return PaperRipple; - }()); - + }()); + /** * @description This function will ensure that we propertly treat a potential string value for a boolean attribute * as the boolean representation @@ -1385,8 +1385,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- ret = value; } return ret; - } - + } + var StyleController = /** @class */ (function () { function StyleController(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -1464,8 +1464,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- function kebabCase$1(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); - } - + } + var StyleEngine = /** @class */ (function () { function StyleEngine(styleController) { this.styleController = styleController; @@ -1514,8 +1514,8 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- aureliaDependencyInjection.inject(StyleController) ], StyleEngine); return StyleEngine; - }()); - + }()); + var uxCorePromise; function configure(config, callback) { if (uxCorePromise) { @@ -1531,19 +1531,19 @@ define('@aurelia-ux/core', ['exports', 'aurelia-dependency-injection', 'aurelia- ux.use.defaultConfiguration(); return uxCorePromise = ux.start(config); } - } - - exports.configure = configure; - exports.swatches = swatches; - exports.shadows = shadows; - exports.processDesignAttributes = processDesignAttributes; - exports.PaperRipple = PaperRipple; - exports.normalizeBooleanAttribute = normalizeBooleanAttribute; - exports.StyleEngine = StyleEngine; - exports.GlobalStyleEngine = GlobalStyleEngine; - exports.AureliaUX = AureliaUX; - exports.UXConfiguration = UXConfiguration; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}); + } + + exports.configure = configure; + exports.swatches = swatches; + exports.shadows = shadows; + exports.processDesignAttributes = processDesignAttributes; + exports.PaperRipple = PaperRipple; + exports.normalizeBooleanAttribute = normalizeBooleanAttribute; + exports.StyleEngine = StyleEngine; + exports.GlobalStyleEngine = GlobalStyleEngine; + exports.AureliaUX = AureliaUX; + exports.UXConfiguration = UXConfiguration; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}); diff --git a/packages/core/dist/amd/styles/normalize.css b/packages/core/dist/amd/styles/normalize.css deleted file mode 100644 index 11e309e9..00000000 --- a/packages/core/dist/amd/styles/normalize.css +++ /dev/null @@ -1,341 +0,0 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/packages/core/dist/commonjs/effects/paper-ripple.css b/packages/core/dist/commonjs/effects/paper-ripple.css deleted file mode 100644 index 701d4dbd..00000000 --- a/packages/core/dist/commonjs/effects/paper-ripple.css +++ /dev/null @@ -1,59 +0,0 @@ -.paper-ripple { - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - border-radius: inherit; - overflow: hidden; - pointer-events: none; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - pointer-events: none; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__wave { - opacity: 0; -} - -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave { - overflow: hidden; -} - -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - border-radius: 50%; -} - -.paper-ripple .paper-ripple__background { - will-change: opacity, background-color; -} - -.paper-ripple .paper-ripple__wave { - will-change: opacity, transform; -} - -.paper-ripple .paper-ripple__wave-container { - will-change: transform; -} - -.paper-ripple--round .paper-ripple__background, -.paper-ripple--round .paper-ripple__waves { - border-radius: 50%; -} - -.paper-ripple--round .paper-ripple__wave-container { - overflow: hidden; -} diff --git a/packages/core/dist/commonjs/index.js b/packages/core/dist/commonjs/index.js index dfc58334..9374c718 100644 --- a/packages/core/dist/commonjs/index.js +++ b/packages/core/dist/commonjs/index.js @@ -1,15 +1,15 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var aureliaDependencyInjection = require('aurelia-dependency-injection'); -var aureliaPal = require('aurelia-pal'); -var aureliaLogging = require('aurelia-logging'); -var aureliaLoader = require('aurelia-loader'); -var aureliaBinding = require('aurelia-binding'); -var aureliaFramework = require('aurelia-framework'); -var aureliaTemplatingBinding = require('aurelia-templating-binding'); - +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var aureliaDependencyInjection = require('aurelia-dependency-injection'); +var aureliaPal = require('aurelia-pal'); +var aureliaLogging = require('aurelia-logging'); +var aureliaLoader = require('aurelia-loader'); +var aureliaBinding = require('aurelia-binding'); +var aureliaFramework = require('aurelia-framework'); +var aureliaTemplatingBinding = require('aurelia-templating-binding'); + /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -30,8 +30,8 @@ function __decorate(decorators, target, key, desc) { 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; -} - +} + var swatches = { red: { p50: '#FFEBEE', @@ -327,8 +327,8 @@ var swatches = { }, black: '#000000', white: '#FFFFFF' -}; - +}; + var shadows = { depth_0: 'none', depth_2dp: '0 2px 2px 0 rgba(0, 0, 0, 0.14),' + @@ -354,8 +354,8 @@ var shadows = { '0 24px 38px 3px rgba(0, 0, 0, 0.2)', depth_focus: '0 0 8px rgba(0,0,0,.18),' + '0 8px 16px rgba(0,0,0,.36)' -}; - +}; + var IOSDesign = /** @class */ (function () { function IOSDesign() { this.type = 'ios'; @@ -386,8 +386,8 @@ var IOSDesign = /** @class */ (function () { this.elevationFocus = shadows.depth_focus; } return IOSDesign; -}()); - +}()); + var IOS = /** @class */ (function () { function IOS(design) { this.design = design; @@ -397,8 +397,8 @@ var IOS = /** @class */ (function () { aureliaDependencyInjection.inject(IOSDesign) ], IOS); return IOS; -}()); - +}()); + var MaterialDesign = /** @class */ (function () { function MaterialDesign() { this.type = 'material'; @@ -429,8 +429,8 @@ var MaterialDesign = /** @class */ (function () { this.elevationFocus = shadows.depth_focus; } return MaterialDesign; -}()); - +}()); + var Android = /** @class */ (function () { function Android(design) { this.design = design; @@ -440,8 +440,8 @@ var Android = /** @class */ (function () { aureliaDependencyInjection.inject(MaterialDesign) ], Android); return Android; -}()); - +}()); + var Cordova = /** @class */ (function () { function Cordova(container) { this.container = container; @@ -477,8 +477,8 @@ var Cordova = /** @class */ (function () { aureliaDependencyInjection.inject(aureliaDependencyInjection.Container) ], Cordova); return Cordova; -}()); - +}()); + var Web = /** @class */ (function () { function Web(design) { this.design = design; @@ -493,8 +493,8 @@ var Web = /** @class */ (function () { aureliaDependencyInjection.inject(MaterialDesign) ], Web); return Web; -}()); - +}()); + var Electron = /** @class */ (function () { function Electron() { this.type = 'electron'; @@ -514,8 +514,8 @@ var Electron = /** @class */ (function () { aureliaDependencyInjection.inject(MaterialDesign) ], Electron); return Electron; -}()); - +}()); + var GlobalStyleEngine = /** @class */ (function () { function GlobalStyleEngine() { this.logger = aureliaLogging.getLogger('aurelia-ux'); @@ -575,8 +575,8 @@ var GlobalStyleEngine = /** @class */ (function () { this.styleTag.innerHTML = innerHtml; }; return GlobalStyleEngine; -}()); - +}()); + var UXConfiguration = /** @class */ (function () { function UXConfiguration(loader, globalStyleEngine) { this.loader = loader; @@ -605,8 +605,8 @@ var UXConfiguration = /** @class */ (function () { aureliaDependencyInjection.inject(aureliaLoader.Loader, GlobalStyleEngine) ], UXConfiguration); return UXConfiguration; -}()); - +}()); + var DesignProcessor = /** @class */ (function () { function DesignProcessor(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -660,8 +660,8 @@ var DesignProcessor = /** @class */ (function () { function kebabCase(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); -} - +} + var AureliaUX = /** @class */ (function () { function AureliaUX(use, container, designProcessor, observerLocator) { this.use = use; @@ -759,8 +759,8 @@ var AureliaUX = /** @class */ (function () { aureliaDependencyInjection.inject(UXConfiguration, aureliaDependencyInjection.Container, DesignProcessor, aureliaFramework.ObserverLocator) ], AureliaUX); return AureliaUX; -}()); - +}()); + var BooleanBB = /** @class */ (function () { function BooleanBB() { } @@ -796,8 +796,8 @@ var BooleanAttributeObserver = /** @class */ (function () { throw new Error(msg); }; return BooleanAttributeObserver; -}()); - +}()); + function processDesignAttributes(_, __, node, attributes, ___) { var prefix = 'material-'; // TODO: get this from somewhere var length = prefix.length; @@ -811,8 +811,8 @@ function processDesignAttributes(_, __, node, attributes, ___) { } // tslint:enable:prefer-const return true; -} - +} + /** * Provides the utilities for getting element's metrics. */ @@ -887,8 +887,8 @@ var ElementRect = /** @class */ (function () { return x >= l && x <= l + w && y >= t && y <= t + h; }; return ElementRect; -}()); - +}()); + // tslint:disable:variable-name var _window = aureliaPal.PLATFORM.global; var _doc = _window.document; @@ -1182,8 +1182,8 @@ var PaperWave = /** @class */ (function () { */ PaperWave.MAX_RADIUS = 300; return PaperWave; -}()); - +}()); + /** * Provides all the logic to produce ripple visual effect. * Other elements can use it to simulate rippling effect emanating from the point of contact. @@ -1368,8 +1368,8 @@ var PaperRipple = /** @class */ (function () { return this; }; return PaperRipple; -}()); - +}()); + /** * @description This function will ensure that we propertly treat a potential string value for a boolean attribute * as the boolean representation @@ -1395,8 +1395,8 @@ function normalizeBooleanAttribute(attributeName, value) { ret = value; } return ret; -} - +} + var StyleController = /** @class */ (function () { function StyleController(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -1474,8 +1474,8 @@ var StyleController = /** @class */ (function () { function kebabCase$1(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); -} - +} + var StyleEngine = /** @class */ (function () { function StyleEngine(styleController) { this.styleController = styleController; @@ -1524,8 +1524,8 @@ var StyleEngine = /** @class */ (function () { aureliaDependencyInjection.inject(StyleController) ], StyleEngine); return StyleEngine; -}()); - +}()); + var uxCorePromise; function configure(config, callback) { if (uxCorePromise) { @@ -1541,15 +1541,15 @@ function configure(config, callback) { ux.use.defaultConfiguration(); return uxCorePromise = ux.start(config); } -} - -exports.configure = configure; -exports.swatches = swatches; -exports.shadows = shadows; -exports.processDesignAttributes = processDesignAttributes; -exports.PaperRipple = PaperRipple; -exports.normalizeBooleanAttribute = normalizeBooleanAttribute; -exports.StyleEngine = StyleEngine; -exports.GlobalStyleEngine = GlobalStyleEngine; -exports.AureliaUX = AureliaUX; -exports.UXConfiguration = UXConfiguration; +} + +exports.configure = configure; +exports.swatches = swatches; +exports.shadows = shadows; +exports.processDesignAttributes = processDesignAttributes; +exports.PaperRipple = PaperRipple; +exports.normalizeBooleanAttribute = normalizeBooleanAttribute; +exports.StyleEngine = StyleEngine; +exports.GlobalStyleEngine = GlobalStyleEngine; +exports.AureliaUX = AureliaUX; +exports.UXConfiguration = UXConfiguration; diff --git a/packages/core/dist/commonjs/styles/normalize.css b/packages/core/dist/commonjs/styles/normalize.css deleted file mode 100644 index 11e309e9..00000000 --- a/packages/core/dist/commonjs/styles/normalize.css +++ /dev/null @@ -1,341 +0,0 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/packages/core/dist/es2015/effects/paper-ripple.css b/packages/core/dist/es2015/effects/paper-ripple.css deleted file mode 100644 index 701d4dbd..00000000 --- a/packages/core/dist/es2015/effects/paper-ripple.css +++ /dev/null @@ -1,59 +0,0 @@ -.paper-ripple { - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - border-radius: inherit; - overflow: hidden; - pointer-events: none; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - pointer-events: none; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__wave { - opacity: 0; -} - -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave { - overflow: hidden; -} - -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - border-radius: 50%; -} - -.paper-ripple .paper-ripple__background { - will-change: opacity, background-color; -} - -.paper-ripple .paper-ripple__wave { - will-change: opacity, transform; -} - -.paper-ripple .paper-ripple__wave-container { - will-change: transform; -} - -.paper-ripple--round .paper-ripple__background, -.paper-ripple--round .paper-ripple__waves { - border-radius: 50%; -} - -.paper-ripple--round .paper-ripple__wave-container { - overflow: hidden; -} diff --git a/packages/core/dist/es2015/styles/normalize.css b/packages/core/dist/es2015/styles/normalize.css deleted file mode 100644 index 11e309e9..00000000 --- a/packages/core/dist/es2015/styles/normalize.css +++ /dev/null @@ -1,341 +0,0 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/packages/core/dist/native-modules/effects/paper-ripple.css b/packages/core/dist/native-modules/effects/paper-ripple.css deleted file mode 100644 index 701d4dbd..00000000 --- a/packages/core/dist/native-modules/effects/paper-ripple.css +++ /dev/null @@ -1,59 +0,0 @@ -.paper-ripple { - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - border-radius: inherit; - overflow: hidden; - pointer-events: none; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - pointer-events: none; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.paper-ripple .paper-ripple__background, -.paper-ripple .paper-ripple__wave { - opacity: 0; -} - -.paper-ripple .paper-ripple__waves, -.paper-ripple .paper-ripple__wave { - overflow: hidden; -} - -.paper-ripple .paper-ripple__wave-container, -.paper-ripple .paper-ripple__wave { - border-radius: 50%; -} - -.paper-ripple .paper-ripple__background { - will-change: opacity, background-color; -} - -.paper-ripple .paper-ripple__wave { - will-change: opacity, transform; -} - -.paper-ripple .paper-ripple__wave-container { - will-change: transform; -} - -.paper-ripple--round .paper-ripple__background, -.paper-ripple--round .paper-ripple__waves { - border-radius: 50%; -} - -.paper-ripple--round .paper-ripple__wave-container { - overflow: hidden; -} diff --git a/packages/core/dist/native-modules/index.js b/packages/core/dist/native-modules/index.js index 9711f008..6b194127 100644 --- a/packages/core/dist/native-modules/index.js +++ b/packages/core/dist/native-modules/index.js @@ -1,11 +1,11 @@ -import { inject, Container } from 'aurelia-dependency-injection'; -import { DOM, PLATFORM } from 'aurelia-pal'; -import { getLogger } from 'aurelia-logging'; -import { Loader } from 'aurelia-loader'; -import { ObserverLocator, bindingBehavior } from 'aurelia-binding'; -import { ObserverLocator as ObserverLocator$1 } from 'aurelia-framework'; -import { SyntaxInterpreter } from 'aurelia-templating-binding'; - +import { inject, Container } from 'aurelia-dependency-injection'; +import { DOM, PLATFORM } from 'aurelia-pal'; +import { getLogger } from 'aurelia-logging'; +import { Loader } from 'aurelia-loader'; +import { ObserverLocator, bindingBehavior } from 'aurelia-binding'; +import { ObserverLocator as ObserverLocator$1 } from 'aurelia-framework'; +import { SyntaxInterpreter } from 'aurelia-templating-binding'; + /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -26,8 +26,8 @@ function __decorate(decorators, target, key, desc) { 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; -} - +} + var swatches = { red: { p50: '#FFEBEE', @@ -323,8 +323,8 @@ var swatches = { }, black: '#000000', white: '#FFFFFF' -}; - +}; + var shadows = { depth_0: 'none', depth_2dp: '0 2px 2px 0 rgba(0, 0, 0, 0.14),' + @@ -350,8 +350,8 @@ var shadows = { '0 24px 38px 3px rgba(0, 0, 0, 0.2)', depth_focus: '0 0 8px rgba(0,0,0,.18),' + '0 8px 16px rgba(0,0,0,.36)' -}; - +}; + var IOSDesign = /** @class */ (function () { function IOSDesign() { this.type = 'ios'; @@ -382,8 +382,8 @@ var IOSDesign = /** @class */ (function () { this.elevationFocus = shadows.depth_focus; } return IOSDesign; -}()); - +}()); + var IOS = /** @class */ (function () { function IOS(design) { this.design = design; @@ -393,8 +393,8 @@ var IOS = /** @class */ (function () { inject(IOSDesign) ], IOS); return IOS; -}()); - +}()); + var MaterialDesign = /** @class */ (function () { function MaterialDesign() { this.type = 'material'; @@ -425,8 +425,8 @@ var MaterialDesign = /** @class */ (function () { this.elevationFocus = shadows.depth_focus; } return MaterialDesign; -}()); - +}()); + var Android = /** @class */ (function () { function Android(design) { this.design = design; @@ -436,8 +436,8 @@ var Android = /** @class */ (function () { inject(MaterialDesign) ], Android); return Android; -}()); - +}()); + var Cordova = /** @class */ (function () { function Cordova(container) { this.container = container; @@ -473,8 +473,8 @@ var Cordova = /** @class */ (function () { inject(Container) ], Cordova); return Cordova; -}()); - +}()); + var Web = /** @class */ (function () { function Web(design) { this.design = design; @@ -489,8 +489,8 @@ var Web = /** @class */ (function () { inject(MaterialDesign) ], Web); return Web; -}()); - +}()); + var Electron = /** @class */ (function () { function Electron() { this.type = 'electron'; @@ -510,8 +510,8 @@ var Electron = /** @class */ (function () { inject(MaterialDesign) ], Electron); return Electron; -}()); - +}()); + var GlobalStyleEngine = /** @class */ (function () { function GlobalStyleEngine() { this.logger = getLogger('aurelia-ux'); @@ -571,8 +571,8 @@ var GlobalStyleEngine = /** @class */ (function () { this.styleTag.innerHTML = innerHtml; }; return GlobalStyleEngine; -}()); - +}()); + var UXConfiguration = /** @class */ (function () { function UXConfiguration(loader, globalStyleEngine) { this.loader = loader; @@ -601,8 +601,8 @@ var UXConfiguration = /** @class */ (function () { inject(Loader, GlobalStyleEngine) ], UXConfiguration); return UXConfiguration; -}()); - +}()); + var DesignProcessor = /** @class */ (function () { function DesignProcessor(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -656,8 +656,8 @@ var DesignProcessor = /** @class */ (function () { function kebabCase(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); -} - +} + var AureliaUX = /** @class */ (function () { function AureliaUX(use, container, designProcessor, observerLocator) { this.use = use; @@ -755,8 +755,8 @@ var AureliaUX = /** @class */ (function () { inject(UXConfiguration, Container, DesignProcessor, ObserverLocator$1) ], AureliaUX); return AureliaUX; -}()); - +}()); + var BooleanBB = /** @class */ (function () { function BooleanBB() { } @@ -792,8 +792,8 @@ var BooleanAttributeObserver = /** @class */ (function () { throw new Error(msg); }; return BooleanAttributeObserver; -}()); - +}()); + function processDesignAttributes(_, __, node, attributes, ___) { var prefix = 'material-'; // TODO: get this from somewhere var length = prefix.length; @@ -807,8 +807,8 @@ function processDesignAttributes(_, __, node, attributes, ___) { } // tslint:enable:prefer-const return true; -} - +} + /** * Provides the utilities for getting element's metrics. */ @@ -883,8 +883,8 @@ var ElementRect = /** @class */ (function () { return x >= l && x <= l + w && y >= t && y <= t + h; }; return ElementRect; -}()); - +}()); + // tslint:disable:variable-name var _window = PLATFORM.global; var _doc = _window.document; @@ -1178,8 +1178,8 @@ var PaperWave = /** @class */ (function () { */ PaperWave.MAX_RADIUS = 300; return PaperWave; -}()); - +}()); + /** * Provides all the logic to produce ripple visual effect. * Other elements can use it to simulate rippling effect emanating from the point of contact. @@ -1364,8 +1364,8 @@ var PaperRipple = /** @class */ (function () { return this; }; return PaperRipple; -}()); - +}()); + /** * @description This function will ensure that we propertly treat a potential string value for a boolean attribute * as the boolean representation @@ -1391,8 +1391,8 @@ function normalizeBooleanAttribute(attributeName, value) { ret = value; } return ret; -} - +} + var StyleController = /** @class */ (function () { function StyleController(observerLocator, globalStyleEngine) { this.observerLocator = observerLocator; @@ -1470,8 +1470,8 @@ var StyleController = /** @class */ (function () { function kebabCase$1(value) { value = value.charAt(0).toLowerCase() + value.slice(1); return value.replace(/([A-Z])/g, function (match) { return "-" + match[0].toLowerCase(); }); -} - +} + var StyleEngine = /** @class */ (function () { function StyleEngine(styleController) { this.styleController = styleController; @@ -1520,8 +1520,8 @@ var StyleEngine = /** @class */ (function () { inject(StyleController) ], StyleEngine); return StyleEngine; -}()); - +}()); + var uxCorePromise; function configure(config, callback) { if (uxCorePromise) { @@ -1537,6 +1537,6 @@ function configure(config, callback) { ux.use.defaultConfiguration(); return uxCorePromise = ux.start(config); } -} - -export { configure, swatches, shadows, processDesignAttributes, PaperRipple, normalizeBooleanAttribute, StyleEngine, GlobalStyleEngine, AureliaUX, UXConfiguration }; +} + +export { configure, swatches, shadows, processDesignAttributes, PaperRipple, normalizeBooleanAttribute, StyleEngine, GlobalStyleEngine, AureliaUX, UXConfiguration }; diff --git a/packages/core/dist/native-modules/styles/normalize.css b/packages/core/dist/native-modules/styles/normalize.css deleted file mode 100644 index 11e309e9..00000000 --- a/packages/core/dist/native-modules/styles/normalize.css +++ /dev/null @@ -1,341 +0,0 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/packages/datepicker/dist/amd/index.js b/packages/datepicker/dist/amd/index.js index aa684a7f..7035f377 100644 --- a/packages/datepicker/dist/amd/index.js +++ b/packages/datepicker/dist/amd/index.js @@ -1,498 +1,491 @@ define('@aurelia-ux/datepicker', ['exports', 'moment', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, moment_, aureliaTemplating, aureliaBinding, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ - - - - - - -function __decorate(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; -} - -var moment = moment_; -var DatetimeUtility = /** @class */ (function () { - function DatetimeUtility() { + function __decorate(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; } - /** - * Checks to see if a date is beyond the min or max set date - * @param date The date to check - */ - DatetimeUtility.dateOutOfRange = function (date, minDate, maxDate, config) { - var result = false; - if (minDate != null && date.isBefore(minDate, 'day')) { - result = true; - } - if (maxDate != null && date.isAfter(maxDate, 'day')) { - result = true; + + var moment = moment_; + var DatetimeUtility = /** @class */ (function () { + function DatetimeUtility() { } - if (config && config.calendarSettings) { - var settings = config.calendarSettings; - if (settings.disableDays != null) { - if (settings.disableDays.some(function (disabledDate) { - var disabledYear = date.year(); - if (disabledDate.year != null) { - disabledYear = disabledDate.year; - } - var parsedVal = moment({ day: disabledDate.day, month: disabledDate.month, year: disabledYear }); - if (parsedVal.isValid() && parsedVal.isSame(date, 'day')) { - return true; + /** + * Checks to see if a date is beyond the min or max set date + * @param date The date to check + */ + DatetimeUtility.dateOutOfRange = function (date, minDate, maxDate, config) { + var result = false; + if (minDate != null && date.isBefore(minDate, 'day')) { + result = true; + } + if (maxDate != null && date.isAfter(maxDate, 'day')) { + result = true; + } + if (config && config.calendarSettings) { + var settings = config.calendarSettings; + if (settings.disableDays != null) { + if (settings.disableDays.some(function (disabledDate) { + var disabledYear = date.year(); + if (disabledDate.year != null) { + disabledYear = disabledDate.year; + } + var parsedVal = moment({ day: disabledDate.day, month: disabledDate.month, year: disabledYear }); + if (parsedVal.isValid() && parsedVal.isSame(date, 'day')) { + return true; + } + return false; + })) { + result = true; } - return false; - })) { - result = true; } - } - if (settings.disableWeekdays != null) { - if (settings.disableWeekdays.some(function (disabledDay) { - return disabledDay.toString() === date.day().toString(); - })) { - result = true; + if (settings.disableWeekdays != null) { + if (settings.disableWeekdays.some(function (disabledDay) { + return disabledDay.toString() === date.day().toString(); + })) { + result = true; + } } } - } - return result; - }; - return DatetimeUtility; -}()); + return result; + }; + return DatetimeUtility; + }()); -var UX_CALENDAR_VIEW = " "; + var UX_CALENDAR_VIEW = " "; -var moment$1 = moment_; -var UxCalendar = /** @class */ (function () { - function UxCalendar(resources) { - this.resources = resources; - this.theme = null; - this.weekdays = moment$1.weekdays(); - this.calendarRows = new Array(); - } - UxCalendar.prototype.bind = function () { - this.displayMonth = this.value.clone(); - }; - UxCalendar.prototype.previousMonth = function () { - this.displayMonth = this.displayMonth.clone().subtract(1, 'month'); - }; - UxCalendar.prototype.nextMonth = function () { - this.displayMonth = this.displayMonth.clone().add(1, 'month'); - }; - UxCalendar.prototype.changeCalendarSelection = function (newDate) { - var modifiedDate = this.value.clone() - .set('date', newDate.date()) - .set('month', newDate.month()) - .set('year', newDate.year()); - if (this.isValidDate(modifiedDate)) { - return; + var moment$1 = moment_; + var UxCalendar = /** @class */ (function () { + function UxCalendar(resources) { + this.resources = resources; + this.theme = null; + this.weekdays = moment$1.weekdays(); + this.calendarRows = new Array(); } - this.value = modifiedDate; - }; - UxCalendar.prototype.displayMonthChanged = function (newDate) { - this.calendarRows = new Array(); - var clonedDate = newDate.clone(); - var firstDay = clonedDate.startOf('month').weekday(); - var daysInMonth = newDate.daysInMonth(); - var currentWeek = new Array(); - while (currentWeek.length < firstDay) { - currentWeek.push(null); - } - for (var index = 0; index < daysInMonth; index++) { - currentWeek.push(clonedDate.clone().add(index, 'days')); - if (currentWeek.length === 7) { - this.calendarRows.push(currentWeek); - currentWeek = new Array(); + UxCalendar.prototype.bind = function () { + this.displayMonth = this.value.clone(); + }; + UxCalendar.prototype.previousMonth = function () { + this.displayMonth = this.displayMonth.clone().subtract(1, 'month'); + }; + UxCalendar.prototype.nextMonth = function () { + this.displayMonth = this.displayMonth.clone().add(1, 'month'); + }; + UxCalendar.prototype.changeCalendarSelection = function (newDate) { + var modifiedDate = this.value.clone() + .set('date', newDate.date()) + .set('month', newDate.month()) + .set('year', newDate.year()); + if (this.isValidDate(modifiedDate)) { + return; } - } - if (currentWeek.length > 0) { - while (currentWeek.length < 7) { + this.value = modifiedDate; + }; + UxCalendar.prototype.displayMonthChanged = function (newDate) { + this.calendarRows = new Array(); + var clonedDate = newDate.clone(); + var firstDay = clonedDate.startOf('month').weekday(); + var daysInMonth = newDate.daysInMonth(); + var currentWeek = new Array(); + while (currentWeek.length < firstDay) { currentWeek.push(null); } - this.calendarRows.push(currentWeek); - } - }; - UxCalendar.prototype.isValidDate = function (date) { - return DatetimeUtility.dateOutOfRange(date, this.minDate, this.maxDate, this.config); - }; - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "weekdays", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "minDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "maxDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "value", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxCalendar.prototype, "config", void 0); - __decorate([ - aureliaBinding.observable - ], UxCalendar.prototype, "displayMonth", void 0); - UxCalendar = __decorate([ - aureliaDependencyInjection.inject(aureliaTemplating.ViewResources), - aureliaTemplating.customElement('ux-calendar'), - aureliaTemplating.inlineView(UX_CALENDAR_VIEW) - ], UxCalendar); - return UxCalendar; -}()); + for (var index = 0; index < daysInMonth; index++) { + currentWeek.push(clonedDate.clone().add(index, 'days')); + if (currentWeek.length === 7) { + this.calendarRows.push(currentWeek); + currentWeek = new Array(); + } + } + if (currentWeek.length > 0) { + while (currentWeek.length < 7) { + currentWeek.push(null); + } + this.calendarRows.push(currentWeek); + } + }; + UxCalendar.prototype.isValidDate = function (date) { + return DatetimeUtility.dateOutOfRange(date, this.minDate, this.maxDate, this.config); + }; + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "weekdays", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "minDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "maxDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "value", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxCalendar.prototype, "config", void 0); + __decorate([ + aureliaBinding.observable + ], UxCalendar.prototype, "displayMonth", void 0); + UxCalendar = __decorate([ + aureliaDependencyInjection.inject(aureliaTemplating.ViewResources), + aureliaTemplating.customElement('ux-calendar'), + aureliaTemplating.inlineView(UX_CALENDAR_VIEW) + ], UxCalendar); + return UxCalendar; + }()); -var UX_DATEPICKER_VIEW = " "; + var UX_DATEPICKER_VIEW = " "; -var moment$2 = moment_; -var UxDatepicker = /** @class */ (function () { - function UxDatepicker(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' + var moment$2 = moment_; + var UxDatepicker = /** @class */ (function () { + function UxDatepicker(element, resources, styleEngine) { + this.element = element; + this.resources = resources; + this.styleEngine = styleEngine; + this.display = 'month'; + this.type = 'datetime'; + this.formatters = { + date: 'L', + time: 'LT', + datetime: 'L LT' + }; + this.parsers = { + time: ['h:m a', 'H:m'] + }; + this.showDialog = false; + } + UxDatepicker.prototype.bind = function () { + if (this.initialDate != null) { + var dateParse = moment$2(this.initialDate); + if (dateParse.isValid()) { + this.initialDate = dateParse; + } + } + else { + this.initialDate = moment$2(); + } + if (this.minDate != null) { + var dateParse = moment$2(this.minDate); + this.minDate = dateParse.isValid() ? dateParse : null; + } + if (this.maxDate != null) { + var dateParse = moment$2(this.maxDate); + this.maxDate = dateParse.isValid() ? dateParse : null; + } + if (this.minTime != null) { + var dateParse = moment$2(this.minTime, this.parsers.time); + this.minTime = dateParse.isValid() ? dateParse : null; + } + if (this.maxTime != null) { + var dateParse = moment$2(this.maxTime, this.parsers.time); + this.maxTime = dateParse.isValid() ? dateParse : null; + } + this.valueChanged(this.value); + this.themeChanged(this.theme); }; - this.parsers = { - time: ['h:m a', 'H:m'] + UxDatepicker.prototype.toggleDialog = function (display) { + if (this.showDialog) { + this.showDialog = false; + return; + } + this.display = display; + this.showDialog = true; }; - this.showDialog = false; - } - UxDatepicker.prototype.bind = function () { - if (this.initialDate != null) { - var dateParse = moment$2(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; + UxDatepicker.prototype.changeTextboxValue = function () { + if (!this.textboxValue) { + this.value = null; + return; + } + var parseValue; + parseValue = this.type === 'time' ? moment$2(this.textboxValue, this.parsers.time) : moment$2(this.textboxValue); + if (parseValue.isValid() && + DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { + this.value = parseValue.toDate(); + } + else { + this.value = null; + this.textboxValue = ''; + } + }; + UxDatepicker.prototype.valueChanged = function (newValue) { + if (newValue == null) { + return; + } + if (this.type.toLowerCase() === 'datetime') { + this.textboxValue = moment$2(newValue).format(this.formatters.datetime); + } + if (this.type.toLowerCase() === 'date') { + this.textboxValue = moment$2(newValue).format(this.formatters.date); + } + if (this.type.toLowerCase() === 'time') { + this.textboxValue = moment$2(newValue).format(this.formatters.time); } - } - else { - this.initialDate = moment$2(); - } - if (this.minDate != null) { - var dateParse = moment$2(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - var dateParse = moment$2(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - var dateParse = moment$2(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - var dateParse = moment$2(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - }; - UxDatepicker.prototype.toggleDialog = function (display) { - if (this.showDialog) { this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - }; - UxDatepicker.prototype.changeTextboxValue = function () { - if (!this.textboxValue) { - this.value = null; - return; - } - var parseValue; - parseValue = this.type === 'time' ? moment$2(this.textboxValue, this.parsers.time) : moment$2(this.textboxValue); - if (parseValue.isValid() && - DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - }; - UxDatepicker.prototype.valueChanged = function (newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment$2(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment$2(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment$2(newValue).format(this.formatters.time); - } - this.showDialog = false; - }; - UxDatepicker.prototype.minDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment$2 === false) { - var dateParse = moment$2(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment$2 === false) { - var dateParse = moment$2(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.minTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment$2 === false) { - var dateParse = moment$2(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment$2 === false) { - var dateParse = moment$2(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "display", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "initialDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "minTime", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "maxTime", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "minDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "maxDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "placeholder", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "config", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "formatters", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxDatepicker.prototype, "parsers", void 0); - __decorate([ - aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) - ], UxDatepicker.prototype, "value", void 0); - UxDatepicker = __decorate([ - aureliaDependencyInjection.inject(Element, aureliaTemplating.ViewResources, core.StyleEngine), - aureliaTemplating.customElement('ux-datepicker'), - aureliaTemplating.inlineView(UX_DATEPICKER_VIEW) - ], UxDatepicker); - return UxDatepicker; -}()); + }; + UxDatepicker.prototype.minDateChanged = function (newValue) { + if (newValue != null && newValue instanceof moment$2 === false) { + var dateParse = moment$2(newValue); + this.minDate = dateParse.isValid() ? dateParse : null; + } + }; + UxDatepicker.prototype.maxDateChanged = function (newValue) { + if (newValue != null && newValue instanceof moment$2 === false) { + var dateParse = moment$2(newValue); + this.maxDate = dateParse.isValid() ? dateParse : null; + } + }; + UxDatepicker.prototype.minTimeChanged = function (newValue) { + if (newValue != null && newValue instanceof moment$2 === false) { + var dateParse = moment$2(newValue, this.parsers.time); + this.minTime = dateParse.isValid() ? dateParse : null; + } + }; + UxDatepicker.prototype.maxTimeChanged = function (newValue) { + if (newValue != null && newValue instanceof moment$2 === false) { + var dateParse = moment$2(newValue, this.parsers.time); + this.maxTime = dateParse.isValid() ? dateParse : null; + } + }; + UxDatepicker.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'datepicker'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "display", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "initialDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "minTime", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "maxTime", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "minDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "maxDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "placeholder", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "config", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "formatters", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxDatepicker.prototype, "parsers", void 0); + __decorate([ + aureliaTemplating.bindable({ defaultBindingMode: aureliaBinding.bindingMode.twoWay }) + ], UxDatepicker.prototype, "value", void 0); + UxDatepicker = __decorate([ + aureliaDependencyInjection.inject(Element, aureliaTemplating.ViewResources, core.StyleEngine), + aureliaTemplating.customElement('ux-datepicker'), + aureliaTemplating.inlineView(UX_DATEPICKER_VIEW) + ], UxDatepicker); + return UxDatepicker; + }()); -var UX_PICKER_DIALOG_VIEW = " "; + var UX_PICKER_DIALOG_VIEW = " "; -var moment$3 = moment_; -var UxPickerDialog = /** @class */ (function () { - function UxPickerDialog(resources) { - this.resources = resources; - this.theme = null; - this.type = 'datetime'; - this.display = 'month'; - } - UxPickerDialog.prototype.bind = function () { - if (this.value != null) { - this.selectedDate = moment$3(this.value); + var moment$3 = moment_; + var UxPickerDialog = /** @class */ (function () { + function UxPickerDialog(resources) { + this.resources = resources; + this.theme = null; + this.type = 'datetime'; + this.display = 'month'; } - else { - this.selectedDate = this.initialDate; - if (this.minDate != null && this.selectedDate.isBefore(this.minDate)) { - this.selectedDate = moment$3(this.minDate).clone(); + UxPickerDialog.prototype.bind = function () { + if (this.value != null) { + this.selectedDate = moment$3(this.value); } - if (this.maxDate != null && this.selectedDate.isBefore(this.maxDate)) { - this.selectedDate = moment$3(this.minDate).clone(); + else { + this.selectedDate = this.initialDate; + if (this.minDate != null && this.selectedDate.isBefore(this.minDate)) { + this.selectedDate = moment$3(this.minDate).clone(); + } + if (this.maxDate != null && this.selectedDate.isBefore(this.maxDate)) { + this.selectedDate = moment$3(this.minDate).clone(); + } } - } - }; - UxPickerDialog.prototype.valueChanged = function (newDate) { - this.selectedDate = moment$3(newDate); - }; - UxPickerDialog.prototype.selectDate = function () { - if (this.selectedDate != null) { - this.value = this.selectedDate.toDate(); - } - }; - UxPickerDialog.prototype.changeView = function (view) { - this.display = view; - }; - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "type", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "display", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "weekdays", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "config", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "initialDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "minDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "maxDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "value", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxPickerDialog.prototype, "closeDialog", void 0); - UxPickerDialog = __decorate([ - aureliaDependencyInjection.inject(aureliaTemplating.ViewResources), - aureliaTemplating.customElement('ux-picker-dialog'), - aureliaTemplating.inlineView(UX_PICKER_DIALOG_VIEW) - ], UxPickerDialog); - return UxPickerDialog; -}()); + }; + UxPickerDialog.prototype.valueChanged = function (newDate) { + this.selectedDate = moment$3(newDate); + }; + UxPickerDialog.prototype.selectDate = function () { + if (this.selectedDate != null) { + this.value = this.selectedDate.toDate(); + } + }; + UxPickerDialog.prototype.changeView = function (view) { + this.display = view; + }; + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "type", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "display", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "weekdays", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "config", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "initialDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "minDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "maxDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "value", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxPickerDialog.prototype, "closeDialog", void 0); + UxPickerDialog = __decorate([ + aureliaDependencyInjection.inject(aureliaTemplating.ViewResources), + aureliaTemplating.customElement('ux-picker-dialog'), + aureliaTemplating.inlineView(UX_PICKER_DIALOG_VIEW) + ], UxPickerDialog); + return UxPickerDialog; + }()); -var UX_YEAR_LIST_VIEW = " "; + var UX_YEAR_LIST_VIEW = " "; -var UxYearList = /** @class */ (function () { - function UxYearList(element, resources) { - this.element = element; - this.resources = resources; - this.theme = null; - this.today = new Date(); - this.today.setHours(0, 0, 0, 0); - } - UxYearList.prototype.attached = function () { - this.scrollToActive(); - }; - UxYearList.prototype.selectYear = function (year) { - this.value = this.value.clone().set('year', year); - }; - Object.defineProperty(UxYearList.prototype, "yearList", { - get: function () { - var yearList = []; - var min = 1900; - var max = 2100; - if (this.minDate) { - min = this.minDate.year(); - } - if (this.maxDate) { - max = this.maxDate.year(); + var UxYearList = /** @class */ (function () { + function UxYearList(element, resources) { + this.element = element; + this.resources = resources; + this.theme = null; + this.today = new Date(); + this.today.setHours(0, 0, 0, 0); + } + UxYearList.prototype.attached = function () { + this.scrollToActive(); + }; + UxYearList.prototype.selectYear = function (year) { + this.value = this.value.clone().set('year', year); + }; + Object.defineProperty(UxYearList.prototype, "yearList", { + get: function () { + var yearList = []; + var min = 1900; + var max = 2100; + if (this.minDate) { + min = this.minDate.year(); + } + if (this.maxDate) { + max = this.maxDate.year(); + } + while (min <= max) { + yearList.push(min); + min++; + } + return yearList; + }, + enumerable: true, + configurable: true + }); + UxYearList.prototype.scrollToActive = function () { + var selected = this.element.querySelector('div.selected'); + if (selected == null && this.element.children.length > 5) { + selected = this.element.children[Math.round(this.element.children.length / 2)]; } - while (min <= max) { - yearList.push(min); - min++; + if (selected != null) { + selected.scrollIntoView(); } - return yearList; - }, - enumerable: true, - configurable: true - }); - UxYearList.prototype.scrollToActive = function () { - var selected = this.element.querySelector('div.selected'); - if (selected == null && this.element.children.length > 5) { - selected = this.element.children[Math.round(this.element.children.length / 2)]; - } - if (selected != null) { - selected.scrollIntoView(); - } - }; - __decorate([ - aureliaTemplating.bindable - ], UxYearList.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxYearList.prototype, "minDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxYearList.prototype, "maxDate", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxYearList.prototype, "value", void 0); - __decorate([ - aureliaBinding.computedFrom('minDate', 'maxDate') - ], UxYearList.prototype, "yearList", null); - UxYearList = __decorate([ - aureliaDependencyInjection.inject(Element, aureliaTemplating.ViewResources), - aureliaTemplating.customElement('ux-year-list'), - aureliaTemplating.inlineView(UX_YEAR_LIST_VIEW) - ], UxYearList); - return UxYearList; -}()); + }; + __decorate([ + aureliaTemplating.bindable + ], UxYearList.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxYearList.prototype, "minDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxYearList.prototype, "maxDate", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxYearList.prototype, "value", void 0); + __decorate([ + aureliaBinding.computedFrom('minDate', 'maxDate') + ], UxYearList.prototype, "yearList", null); + UxYearList = __decorate([ + aureliaDependencyInjection.inject(Element, aureliaTemplating.ViewResources), + aureliaTemplating.customElement('ux-year-list'), + aureliaTemplating.inlineView(UX_YEAR_LIST_VIEW) + ], UxYearList); + return UxYearList; + }()); -var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}" + var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}"; -var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}" + var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}"; -var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}" + var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}"; -var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}" + var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}"; -var UxDatepickerTheme = /** @class */ (function () { - function UxDatepickerTheme() { - this.themeKey = 'datepicker'; - } - return UxDatepickerTheme; -}()); + var UxDatepickerTheme = /** @class */ (function () { + function UxDatepickerTheme() { + this.themeKey = 'datepicker'; + } + return UxDatepickerTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(cldCss + dpCss + pdCss + ylCss, undefined, undefined, 'ux-datepicker-css'); - config.globalResources([ - UxCalendar, - UxDatepicker, - UxPickerDialog, - UxYearList - ]); -} + function configure(config) { + aureliaFramework.DOM.injectStyles(cldCss + dpCss + pdCss + ylCss, undefined, undefined, 'ux-datepicker-css'); + config.globalResources([ + UxCalendar, + UxDatepicker, + UxPickerDialog, + UxYearList + ]); + } -exports.configure = configure; -exports.UxDatepickerTheme = UxDatepickerTheme; + exports.configure = configure; + exports.UxDatepickerTheme = UxDatepickerTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/datepicker/dist/amd/ux-datepicker.js b/packages/datepicker/dist/amd/ux-datepicker.js deleted file mode 100644 index 3f59c29c..00000000 --- a/packages/datepicker/dist/amd/ux-datepicker.js +++ /dev/null @@ -1,171 +0,0 @@ -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", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "./resources/datetime-utility", "moment"], function (require, exports, aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, datetime_utility_1, moment) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxDatepicker = /** @class */ (function () { - function UxDatepicker(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' - }; - this.parsers = { - time: ['h:m a', 'H:m'] - }; - this.showDialog = false; - } - UxDatepicker.prototype.bind = function () { - if (this.initialDate != null) { - var dateParse = moment(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; - } - } - else { - this.initialDate = moment(); - } - if (this.minDate != null) { - var dateParse = moment(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - var dateParse = moment(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - var dateParse = moment(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - var dateParse = moment(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - }; - UxDatepicker.prototype.toggleDialog = function (display) { - if (this.showDialog) { - this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - }; - UxDatepicker.prototype.changeTextboxValue = function () { - if (!this.textboxValue) { - this.value = null; - return; - } - var parseValue; - parseValue = this.type === 'time' ? moment(this.textboxValue, this.parsers.time) : moment(this.textboxValue); - if (parseValue.isValid() && - datetime_utility_1.DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - }; - UxDatepicker.prototype.valueChanged = function (newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment(newValue).format(this.formatters.time); - } - this.showDialog = false; - }; - UxDatepicker.prototype.minDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.minTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "display", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "initialDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "placeholder", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "config", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "formatters", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "parsers", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxDatepicker.prototype, "value", void 0); - UxDatepicker = __decorate([ - aurelia_dependency_injection_1.inject(Element, aurelia_templating_1.ViewResources, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-datepicker') - ], UxDatepicker); - return UxDatepicker; - }()); - exports.UxDatepicker = UxDatepicker; -}); diff --git a/packages/datepicker/dist/commonjs/index.js b/packages/datepicker/dist/commonjs/index.js index 0553b738..37454ac1 100644 --- a/packages/datepicker/dist/commonjs/index.js +++ b/packages/datepicker/dist/commonjs/index.js @@ -23,13 +23,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -474,13 +467,13 @@ var UxYearList = /** @class */ (function () { return UxYearList; }()); -var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}" +var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}"; -var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}" +var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}"; -var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}" +var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}"; -var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}" +var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}"; var UxDatepickerTheme = /** @class */ (function () { function UxDatepickerTheme() { diff --git a/packages/datepicker/dist/commonjs/ux-datepicker.js b/packages/datepicker/dist/commonjs/ux-datepicker.js deleted file mode 100644 index 3c1436c5..00000000 --- a/packages/datepicker/dist/commonjs/ux-datepicker.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var datetime_utility_1 = require("./resources/datetime-utility"); -var moment = require("moment"); -var UxDatepicker = /** @class */ (function () { - function UxDatepicker(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' - }; - this.parsers = { - time: ['h:m a', 'H:m'] - }; - this.showDialog = false; - } - UxDatepicker.prototype.bind = function () { - if (this.initialDate != null) { - var dateParse = moment(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; - } - } - else { - this.initialDate = moment(); - } - if (this.minDate != null) { - var dateParse = moment(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - var dateParse = moment(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - var dateParse = moment(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - var dateParse = moment(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - }; - UxDatepicker.prototype.toggleDialog = function (display) { - if (this.showDialog) { - this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - }; - UxDatepicker.prototype.changeTextboxValue = function () { - if (!this.textboxValue) { - this.value = null; - return; - } - var parseValue; - parseValue = this.type === 'time' ? moment(this.textboxValue, this.parsers.time) : moment(this.textboxValue); - if (parseValue.isValid() && - datetime_utility_1.DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - }; - UxDatepicker.prototype.valueChanged = function (newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment(newValue).format(this.formatters.time); - } - this.showDialog = false; - }; - UxDatepicker.prototype.minDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.minTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "display", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "initialDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "placeholder", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "config", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "formatters", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "parsers", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxDatepicker.prototype, "value", void 0); - UxDatepicker = __decorate([ - aurelia_dependency_injection_1.inject(Element, aurelia_templating_1.ViewResources, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-datepicker') - ], UxDatepicker); - return UxDatepicker; -}()); -exports.UxDatepicker = UxDatepicker; diff --git a/packages/datepicker/dist/es2015/index.js b/packages/datepicker/dist/es2015/index.js index e6d267bd..33294098 100644 --- a/packages/datepicker/dist/es2015/index.js +++ b/packages/datepicker/dist/es2015/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -457,13 +450,13 @@ UxYearList = __decorate([ inlineView(UX_YEAR_LIST_VIEW) ], UxYearList); -var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}" +var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}"; -var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}" +var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}"; -var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}" +var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}"; -var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}" +var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}"; class UxDatepickerTheme { constructor() { diff --git a/packages/datepicker/dist/es2015/ux-datepicker.js b/packages/datepicker/dist/es2015/ux-datepicker.js deleted file mode 100644 index 2735500b..00000000 --- a/packages/datepicker/dist/es2015/ux-datepicker.js +++ /dev/null @@ -1,172 +0,0 @@ -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; -}; -import { customElement, bindable, ViewResources } from 'aurelia-templating'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -import { DatetimeUtility } from './resources/datetime-utility'; -import * as moment from 'moment'; -let UxDatepicker = class UxDatepicker { - constructor(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' - }; - this.parsers = { - time: ['h:m a', 'H:m'] - }; - this.showDialog = false; - } - bind() { - if (this.initialDate != null) { - const dateParse = moment(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; - } - } - else { - this.initialDate = moment(); - } - if (this.minDate != null) { - const dateParse = moment(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - const dateParse = moment(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - const dateParse = moment(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - const dateParse = moment(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - } - toggleDialog(display) { - if (this.showDialog) { - this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - } - changeTextboxValue() { - if (!this.textboxValue) { - this.value = null; - return; - } - let parseValue; - parseValue = this.type === 'time' ? moment(this.textboxValue, this.parsers.time) : moment(this.textboxValue); - if (parseValue.isValid() && - DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - } - valueChanged(newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment(newValue).format(this.formatters.time); - } - this.showDialog = false; - } - minDateChanged(newValue) { - if (newValue != null && newValue instanceof moment === false) { - const dateParse = moment(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - } - maxDateChanged(newValue) { - if (newValue != null && newValue instanceof moment === false) { - const dateParse = moment(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - } - minTimeChanged(newValue) { - if (newValue != null && newValue instanceof moment === false) { - const dateParse = moment(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - } - maxTimeChanged(newValue) { - if (newValue != null && newValue instanceof moment === false) { - const dateParse = moment(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - } -}; -__decorate([ - bindable -], UxDatepicker.prototype, "theme", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "display", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "type", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "initialDate", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "minTime", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "maxTime", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "minDate", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "maxDate", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "placeholder", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "config", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "formatters", void 0); -__decorate([ - bindable -], UxDatepicker.prototype, "parsers", void 0); -__decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) -], UxDatepicker.prototype, "value", void 0); -UxDatepicker = __decorate([ - inject(Element, ViewResources, StyleEngine), - customElement('ux-datepicker') -], UxDatepicker); -export { UxDatepicker }; diff --git a/packages/datepicker/dist/native-modules/index.js b/packages/datepicker/dist/native-modules/index.js index 1b1a244e..65ba70a3 100644 --- a/packages/datepicker/dist/native-modules/index.js +++ b/packages/datepicker/dist/native-modules/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -470,13 +463,13 @@ var UxYearList = /** @class */ (function () { return UxYearList; }()); -var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}" +var cldCss = "ux-calendar{display:block;height:260px;display:flex;flex-direction:column}ux-calendar div.calendar-row{display:flex;align-items:center;justify-content:space-around;height:2em}ux-calendar .calendar-row.weekdays{color:#e0e0e0;color:var(--ux-theme--datepicker-weekday-foreground, #E0E0E0)}ux-calendar .calendar-row .day{width:100%;display:flex;justify-content:center}ux-calendar div.day-highlight{width:1.9em;height:1.9em;border-radius:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}ux-calendar div.day-highlight.selected{color:#fff;color:var(--ux-theme--datepicker-selected-day-foreground, var(--ux-design--accent-foreground, #FFF));background-color:#ff4081;background-color:var(--ux-theme--datepicker-selected-day-background, var(--ux-design--accent, #FF4081))}ux-calendar div.day-highlight.out-of-range{color:#757575;color:var(--ux-theme--datepicker-out-of-range-foreground, #757575);cursor:default}ux-calendar div.month-display{display:flex;justify-content:space-between;align-items:center}ux-calendar div.month-display svg{fill:currentColor;width:24px;height:24px}"; -var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}" +var dpCss = "ux-datepicker{display:flex;position:relative}ux-datepicker>ux-button>button.icon{color:#333;color:var(--ux-theme-datepicker-foreground, #333)}ux-datepicker>.overlay:not(:empty){position:fixed;left:0;top:0;width:100%;height:100%;z-index:80;display:flex;align-items:center;justify-content:center;animation-name:datepicker-background-fade-in;animation-duration:250ms;background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}ux-datepicker>ux-button svg{fill:currentColor;fill:var(--ux-theme--datepicker-calendar-icon, currentColor);width:24px;height:24px}@keyframes datepicker-background-fade-in{0%{background-color:transparent}to{background-color:rgba(0,0,0,.25);background-color:var(--ux-theme--datepicker-overlay, rgba(0, 0, 0, 0.25))}}"; -var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}" +var pdCss = "ux-picker-dialog{color:#262626;color:var(--ux-design--control-foreground, #262626);background-color:#fff;background-color:var(--ux-design--control-background, #FFF);width:300px;user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;animation-duration:250ms;animation-name:datepicker-dialog-grow}ux-picker-dialog header{width:auto;height:124px;padding:16px 24px;box-sizing:border-box;color:#fff;color:var(--ux-theme--datepicker-header-foreground, var(--ux-design--primary-foreground, #FFF));background:#3f51b5;background:var(--ux-theme--datepicker-header-background, var(--ux-design--primary, #3F51B5))}ux-picker-dialog header>div.year,ux-picker-dialog header>div.date{opacity:.7;cursor:pointer}ux-picker-dialog header div.year{font-size:1.1em}ux-picker-dialog header div.year.active{opacity:1}ux-picker-dialog header div.date{font-size:2em;font-weight:400}ux-picker-dialog header div.date.active{opacity:1}ux-picker-dialog footer{display:flex;justify-content:flex-end}@keyframes datepicker-dialog-grow{0%{transform:scale3d(0,0,0)}to{transform:scale3d(1,1,1)}}"; -var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}" +var ylCss = "ux-year-list{display:block;height:260px;overflow-y:auto;text-align:center}ux-year-list>.years{font-size:1em;cursor:pointer;margin:24px 0}ux-year-list>.years.selected{font-size:1.75em;color:#ff4081;color:var(--ux-design--accent, #FF4081)}"; var UxDatepickerTheme = /** @class */ (function () { function UxDatepickerTheme() { diff --git a/packages/datepicker/dist/native-modules/ux-datepicker.js b/packages/datepicker/dist/native-modules/ux-datepicker.js deleted file mode 100644 index 7584eeb5..00000000 --- a/packages/datepicker/dist/native-modules/ux-datepicker.js +++ /dev/null @@ -1,173 +0,0 @@ -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; -}; -import { customElement, bindable, ViewResources } from 'aurelia-templating'; -import { bindingMode } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -import { DatetimeUtility } from './resources/datetime-utility'; -import * as moment from 'moment'; -var UxDatepicker = /** @class */ (function () { - function UxDatepicker(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' - }; - this.parsers = { - time: ['h:m a', 'H:m'] - }; - this.showDialog = false; - } - UxDatepicker.prototype.bind = function () { - if (this.initialDate != null) { - var dateParse = moment(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; - } - } - else { - this.initialDate = moment(); - } - if (this.minDate != null) { - var dateParse = moment(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - var dateParse = moment(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - var dateParse = moment(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - var dateParse = moment(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - }; - UxDatepicker.prototype.toggleDialog = function (display) { - if (this.showDialog) { - this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - }; - UxDatepicker.prototype.changeTextboxValue = function () { - if (!this.textboxValue) { - this.value = null; - return; - } - var parseValue; - parseValue = this.type === 'time' ? moment(this.textboxValue, this.parsers.time) : moment(this.textboxValue); - if (parseValue.isValid() && - DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - }; - UxDatepicker.prototype.valueChanged = function (newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment(newValue).format(this.formatters.time); - } - this.showDialog = false; - }; - UxDatepicker.prototype.minDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.minTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - bindable - ], UxDatepicker.prototype, "theme", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "display", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "type", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "initialDate", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "minTime", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "maxTime", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "minDate", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "maxDate", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "placeholder", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "config", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "formatters", void 0); - __decorate([ - bindable - ], UxDatepicker.prototype, "parsers", void 0); - __decorate([ - bindable({ defaultBindingMode: bindingMode.twoWay }) - ], UxDatepicker.prototype, "value", void 0); - UxDatepicker = __decorate([ - inject(Element, ViewResources, StyleEngine), - customElement('ux-datepicker') - ], UxDatepicker); - return UxDatepicker; -}()); -export { UxDatepicker }; diff --git a/packages/datepicker/dist/system/ux-datepicker.js b/packages/datepicker/dist/system/ux-datepicker.js deleted file mode 100644 index 9fb1634e..00000000 --- a/packages/datepicker/dist/system/ux-datepicker.js +++ /dev/null @@ -1,196 +0,0 @@ -System.register(["aurelia-templating", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "./resources/datetime-utility", "moment"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, datetime_utility_1, moment, UxDatepicker; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (datetime_utility_1_1) { - datetime_utility_1 = datetime_utility_1_1; - }, - function (moment_1) { - moment = moment_1; - } - ], - execute: function () { - UxDatepicker = /** @class */ (function () { - function UxDatepicker(element, resources, styleEngine) { - this.element = element; - this.resources = resources; - this.styleEngine = styleEngine; - this.display = 'month'; - this.type = 'datetime'; - this.formatters = { - date: 'L', - time: 'LT', - datetime: 'L LT' - }; - this.parsers = { - time: ['h:m a', 'H:m'] - }; - this.showDialog = false; - } - UxDatepicker.prototype.bind = function () { - if (this.initialDate != null) { - var dateParse = moment(this.initialDate); - if (dateParse.isValid()) { - this.initialDate = dateParse; - } - } - else { - this.initialDate = moment(); - } - if (this.minDate != null) { - var dateParse = moment(this.minDate); - this.minDate = dateParse.isValid() ? dateParse : null; - } - if (this.maxDate != null) { - var dateParse = moment(this.maxDate); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - if (this.minTime != null) { - var dateParse = moment(this.minTime, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - if (this.maxTime != null) { - var dateParse = moment(this.maxTime, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - this.valueChanged(this.value); - this.themeChanged(this.theme); - }; - UxDatepicker.prototype.toggleDialog = function (display) { - if (this.showDialog) { - this.showDialog = false; - return; - } - this.display = display; - this.showDialog = true; - }; - UxDatepicker.prototype.changeTextboxValue = function () { - if (!this.textboxValue) { - this.value = null; - return; - } - var parseValue; - parseValue = this.type === 'time' ? moment(this.textboxValue, this.parsers.time) : moment(this.textboxValue); - if (parseValue.isValid() && - datetime_utility_1.DatetimeUtility.dateOutOfRange(parseValue, this.minDate, this.maxDate, this.config) === false) { - this.value = parseValue.toDate(); - } - else { - this.value = null; - this.textboxValue = ''; - } - }; - UxDatepicker.prototype.valueChanged = function (newValue) { - if (newValue == null) { - return; - } - if (this.type.toLowerCase() === 'datetime') { - this.textboxValue = moment(newValue).format(this.formatters.datetime); - } - if (this.type.toLowerCase() === 'date') { - this.textboxValue = moment(newValue).format(this.formatters.date); - } - if (this.type.toLowerCase() === 'time') { - this.textboxValue = moment(newValue).format(this.formatters.time); - } - this.showDialog = false; - }; - UxDatepicker.prototype.minDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.minDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxDateChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue); - this.maxDate = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.minTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.minTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.maxTimeChanged = function (newValue) { - if (newValue != null && newValue instanceof moment === false) { - var dateParse = moment(newValue, this.parsers.time); - this.maxTime = dateParse.isValid() ? dateParse : null; - } - }; - UxDatepicker.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'datepicker'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "display", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "type", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "initialDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxTime", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "minDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "maxDate", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "placeholder", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "config", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "formatters", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxDatepicker.prototype, "parsers", void 0); - __decorate([ - aurelia_templating_1.bindable({ defaultBindingMode: aurelia_binding_1.bindingMode.twoWay }) - ], UxDatepicker.prototype, "value", void 0); - UxDatepicker = __decorate([ - aurelia_dependency_injection_1.inject(Element, aurelia_templating_1.ViewResources, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-datepicker') - ], UxDatepicker); - return UxDatepicker; - }()); - exports_1("UxDatepicker", UxDatepicker); - } - }; -}); diff --git a/packages/form/dist/amd/index.js b/packages/form/dist/amd/index.js index c81beb8d..87afdb6e 100644 --- a/packages/form/dist/amd/index.js +++ b/packages/form/dist/amd/index.js @@ -1,183 +1,176 @@ define('@aurelia-ux/form', ['exports', 'aurelia-templating', 'aurelia-dependency-injection', 'aurelia-pal', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaDependencyInjection, aureliaPal, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} - -var UX_FIELD_VIEW = " "; - -var UxField = /** @class */ (function () { - function UxField(element) { - this.element = element; + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; } - UxField.prototype.attached = function () { - if (this.label && !this.element.querySelector('label')) { - this.labelElement = document.createElement('label'); - this.labelElement.textContent = this.label; - this.element.insertBefore(this.labelElement, this.element.firstChild); - } - }; - UxField.prototype.labelChanged = function (newValue) { - if (this.labelElement != null) { - this.labelElement.textContent = newValue; - } - }; - __decorate([ - aureliaTemplating.bindable - ], UxField.prototype, "label", void 0); - UxField = __decorate([ - aureliaDependencyInjection.inject(Element), - aureliaTemplating.customElement('ux-field'), - aureliaTemplating.inlineView(UX_FIELD_VIEW) - ], UxField); - return UxField; -}()); -var UX_FORM_VIEW = " "; + var UX_FIELD_VIEW = " "; -var UxForm = /** @class */ (function () { - function UxForm(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - UxForm.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); + var UxField = /** @class */ (function () { + function UxField(element) { + this.element = element; } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; + UxField.prototype.attached = function () { + if (this.label && !this.element.querySelector('label')) { + this.labelElement = document.createElement('label'); + this.labelElement.textContent = this.label; + this.element.insertBefore(this.labelElement, this.element.firstChild); + } + }; + UxField.prototype.labelChanged = function (newValue) { + if (this.labelElement != null) { + this.labelElement.textContent = newValue; + } + }; + __decorate([ + aureliaTemplating.bindable + ], UxField.prototype, "label", void 0); + UxField = __decorate([ + aureliaDependencyInjection.inject(Element), + aureliaTemplating.customElement('ux-field'), + aureliaTemplating.inlineView(UX_FIELD_VIEW) + ], UxField); + return UxField; + }()); + + var UX_FORM_VIEW = " "; + + var UxForm = /** @class */ (function () { + function UxForm(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.bindSubmitToEnter = false; } - }; - UxForm.prototype.attached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', function (e) { - var canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - _this.submitForm(); - } - }); + UxForm.prototype.bind = function () { + if (this.theme != null) { + this.themeChanged(this.theme); + } + if (this.submitOnEnter !== undefined) { + this.bindSubmitToEnter = true; + } + }; + UxForm.prototype.attached = function () { + var _this = this; + if (this.bindSubmitToEnter) { + this.element.addEventListener('keyup', function (e) { + var canSubmit = true; + if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { + canSubmit = false; + } + if (e.keyCode === 13 && canSubmit) { + _this.submitForm(); + } + }); + } + }; + UxForm.prototype.detached = function () { + var _this = this; + if (this.bindSubmitToEnter) { + this.element.removeEventListener('keyup', function (e) { + if (e.keyCode === 13) { + _this.submitForm(); + } + }); + } + }; + UxForm.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'form'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxForm.prototype.submitForm = function () { + var submitEvent = aureliaPal.DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); + this.element.dispatchEvent(submitEvent); + }; + __decorate([ + aureliaTemplating.bindable + ], UxForm.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxForm.prototype, "submitOnEnter", void 0); + UxForm = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-form'), + aureliaTemplating.inlineView(UX_FORM_VIEW) + ], UxForm); + return UxForm; + }()); + + var UxSubmitCustomAttribute = /** @class */ (function () { + function UxSubmitCustomAttribute(element) { + this.element = element; + this.canSubmit = false; } - }; - UxForm.prototype.detached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', function (e) { - if (e.keyCode === 13) { - _this.submitForm(); + UxSubmitCustomAttribute.prototype.attached = function () { + var _this = this; + var currentParent = this.element.parentElement; + while (currentParent != null) { + if (currentParent.tagName === 'UX-FORM') { + this.canSubmit = true; + this.submitEvent = aureliaPal.DOM.createCustomEvent('submit', { bubbles: true }); + this.element.addEventListener('mouseup', function () { + _this.element.dispatchEvent(_this.submitEvent); + }); + break; } - }); - } - }; - UxForm.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxForm.prototype.submitForm = function () { - var submitEvent = aureliaPal.DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - }; - __decorate([ - aureliaTemplating.bindable - ], UxForm.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxForm.prototype, "submitOnEnter", void 0); - UxForm = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-form'), - aureliaTemplating.inlineView(UX_FORM_VIEW) - ], UxForm); - return UxForm; -}()); - -var UxSubmitCustomAttribute = /** @class */ (function () { - function UxSubmitCustomAttribute(element) { - this.element = element; - this.canSubmit = false; - } - UxSubmitCustomAttribute.prototype.attached = function () { - var _this = this; - var currentParent = this.element.parentElement; - while (currentParent != null) { - if (currentParent.tagName === 'UX-FORM') { - this.canSubmit = true; - this.submitEvent = aureliaPal.DOM.createCustomEvent('submit', { bubbles: true }); - this.element.addEventListener('mouseup', function () { + currentParent = currentParent.parentElement; + } + }; + UxSubmitCustomAttribute.prototype.detached = function () { + var _this = this; + if (this.canSubmit) { + this.element.removeEventListener('mouseup', function () { _this.element.dispatchEvent(_this.submitEvent); }); - break; } - currentParent = currentParent.parentElement; + }; + UxSubmitCustomAttribute = __decorate([ + aureliaDependencyInjection.inject(Element), + aureliaTemplating.customAttribute('ux-submit') + ], UxSubmitCustomAttribute); + return UxSubmitCustomAttribute; + }()); + + var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}"; + + var UxFormTheme = /** @class */ (function () { + function UxFormTheme() { + this.themeKey = 'form'; } - }; - UxSubmitCustomAttribute.prototype.detached = function () { - var _this = this; - if (this.canSubmit) { - this.element.removeEventListener('mouseup', function () { - _this.element.dispatchEvent(_this.submitEvent); - }); - } - }; - UxSubmitCustomAttribute = __decorate([ - aureliaDependencyInjection.inject(Element), - aureliaTemplating.customAttribute('ux-submit') - ], UxSubmitCustomAttribute); - return UxSubmitCustomAttribute; -}()); - -var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}" - -var UxFormTheme = /** @class */ (function () { - function UxFormTheme() { - this.themeKey = 'form'; + return UxFormTheme; + }()); + + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-form-css'); + config.globalResources([ + UxField, + UxForm, + UxSubmitCustomAttribute, + ]); } - return UxFormTheme; -}()); - -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-form-css'); - config.globalResources([ - UxField, - UxForm, - UxSubmitCustomAttribute, - ]); -} -exports.configure = configure; -exports.UxFormTheme = UxFormTheme; + exports.configure = configure; + exports.UxFormTheme = UxFormTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/form/dist/amd/ux-form.js b/packages/form/dist/amd/ux-form.js deleted file mode 100644 index d0d9bcc2..00000000 --- a/packages/form/dist/amd/ux-form.js +++ /dev/null @@ -1,71 +0,0 @@ -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", "aurelia-pal", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxForm = /** @class */ (function () { - function UxForm(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - UxForm.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; - } - }; - UxForm.prototype.attached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', function (e) { - var canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.detached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', function (e) { - if (e.keyCode === 13) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxForm.prototype.submitForm = function () { - var submitEvent = aurelia_pal_1.DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "submitOnEnter", void 0); - UxForm = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-form') - ], UxForm); - return UxForm; - }()); - exports.UxForm = UxForm; -}); diff --git a/packages/form/dist/commonjs/index.js b/packages/form/dist/commonjs/index.js index f2b74073..d415a2c7 100644 --- a/packages/form/dist/commonjs/index.js +++ b/packages/form/dist/commonjs/index.js @@ -22,13 +22,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -165,7 +158,7 @@ var UxSubmitCustomAttribute = /** @class */ (function () { return UxSubmitCustomAttribute; }()); -var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}" +var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}"; var UxFormTheme = /** @class */ (function () { function UxFormTheme() { diff --git a/packages/form/dist/commonjs/ux-form.js b/packages/form/dist/commonjs/ux-form.js deleted file mode 100644 index 996a575d..00000000 --- a/packages/form/dist/commonjs/ux-form.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxForm = /** @class */ (function () { - function UxForm(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - UxForm.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; - } - }; - UxForm.prototype.attached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', function (e) { - var canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.detached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', function (e) { - if (e.keyCode === 13) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxForm.prototype.submitForm = function () { - var submitEvent = aurelia_pal_1.DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "submitOnEnter", void 0); - UxForm = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-form') - ], UxForm); - return UxForm; -}()); -exports.UxForm = UxForm; diff --git a/packages/form/dist/es2015/index.js b/packages/form/dist/es2015/index.js index cf55fc18..54e0e6c0 100644 --- a/packages/form/dist/es2015/index.js +++ b/packages/form/dist/es2015/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -154,7 +147,7 @@ UxSubmitCustomAttribute = __decorate([ customAttribute('ux-submit') ], UxSubmitCustomAttribute); -var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}" +var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}"; class UxFormTheme { constructor() { diff --git a/packages/form/dist/es2015/ux-form.js b/packages/form/dist/es2015/ux-form.js deleted file mode 100644 index 1a5bbcfc..00000000 --- a/packages/form/dist/es2015/ux-form.js +++ /dev/null @@ -1,68 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxForm = class UxForm { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - bind() { - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; - } - } - attached() { - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', (e) => { - let canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - this.submitForm(); - } - }); - } - } - detached() { - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', (e) => { - if (e.keyCode === 13) { - this.submitForm(); - } - }); - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - submitForm() { - const submitEvent = DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - } -}; -__decorate([ - bindable -], UxForm.prototype, "theme", void 0); -__decorate([ - bindable -], UxForm.prototype, "submitOnEnter", void 0); -UxForm = __decorate([ - inject(Element, StyleEngine), - customElement('ux-form') -], UxForm); -export { UxForm }; diff --git a/packages/form/dist/native-modules/index.js b/packages/form/dist/native-modules/index.js index 65d97fa3..a378139b 100644 --- a/packages/form/dist/native-modules/index.js +++ b/packages/form/dist/native-modules/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -161,7 +154,7 @@ var UxSubmitCustomAttribute = /** @class */ (function () { return UxSubmitCustomAttribute; }()); -var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}" +var css = "ux-form{display:flex;flex-direction:column;width:100%}ux-form .form-row{display:flex;flex-direction:row}ux-form .form-row>*{margin-left:8px;margin-right:8px}ux-form .form-row>:last-child{margin-right:0}ux-form .form-row>:first-child{margin-left:0}ux-form ux-field{display:flex;flex-direction:column;width:100%;margin-top:16px}ux-form ux-field>label{font-size:14px;font-size:var(--ux-theme--form-label-font-size, 14px);color:inherit;color:var(--ux-theme--form-label-color, inherit)}"; var UxFormTheme = /** @class */ (function () { function UxFormTheme() { diff --git a/packages/form/dist/native-modules/ux-form.js b/packages/form/dist/native-modules/ux-form.js deleted file mode 100644 index f465fa2b..00000000 --- a/packages/form/dist/native-modules/ux-form.js +++ /dev/null @@ -1,71 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxForm = /** @class */ (function () { - function UxForm(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - UxForm.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; - } - }; - UxForm.prototype.attached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', function (e) { - var canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.detached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', function (e) { - if (e.keyCode === 13) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxForm.prototype.submitForm = function () { - var submitEvent = DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - }; - __decorate([ - bindable - ], UxForm.prototype, "theme", void 0); - __decorate([ - bindable - ], UxForm.prototype, "submitOnEnter", void 0); - UxForm = __decorate([ - inject(Element, StyleEngine), - customElement('ux-form') - ], UxForm); - return UxForm; -}()); -export { UxForm }; diff --git a/packages/form/dist/system/ux-form.js b/packages/form/dist/system/ux-form.js deleted file mode 100644 index f1bbe8fa..00000000 --- a/packages/form/dist/system/ux-form.js +++ /dev/null @@ -1,90 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_pal_1, aurelia_dependency_injection_1, core_1, UxForm; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxForm = /** @class */ (function () { - function UxForm(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.bindSubmitToEnter = false; - } - UxForm.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.submitOnEnter !== undefined) { - this.bindSubmitToEnter = true; - } - }; - UxForm.prototype.attached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.addEventListener('keyup', function (e) { - var canSubmit = true; - if (e.srcElement != null && e.srcElement.tagName === 'TEXTAREA') { - canSubmit = false; - } - if (e.keyCode === 13 && canSubmit) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.detached = function () { - var _this = this; - if (this.bindSubmitToEnter) { - this.element.removeEventListener('keyup', function (e) { - if (e.keyCode === 13) { - _this.submitForm(); - } - }); - } - }; - UxForm.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'form'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxForm.prototype.submitForm = function () { - var submitEvent = aurelia_pal_1.DOM.createCustomEvent('submit', { bubbles: true, target: this.element }); - this.element.dispatchEvent(submitEvent); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxForm.prototype, "submitOnEnter", void 0); - UxForm = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-form') - ], UxForm); - return UxForm; - }()); - exports_1("UxForm", UxForm); - } - }; -}); diff --git a/packages/grid/dist/amd/index.js b/packages/grid/dist/amd/index.js index c449b058..dc539a05 100644 --- a/packages/grid/dist/amd/index.js +++ b/packages/grid/dist/amd/index.js @@ -1,137 +1,130 @@ define('@aurelia-ux/grid', ['exports', 'aurelia-templating', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-pal', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaDependencyInjection, core, aureliaPal, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} - -var UX_GRID_VIEW = " "; - -var UxGrid = /** @class */ (function () { - function UxGrid(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; } - UxGrid.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - }; - UxGrid.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxGrid.prototype.columnsChanged = function (newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); - } - }; - __decorate([ - aureliaTemplating.bindable - ], UxGrid.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxGrid.prototype, "columns", void 0); - UxGrid = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-grid'), - aureliaTemplating.inlineView(UX_GRID_VIEW) - ], UxGrid); - return UxGrid; -}()); - -var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}" -var UxGridTheme = /** @class */ (function () { - function UxGridTheme() { - this.themeKey = 'grid'; - } - return UxGridTheme; -}()); + var UX_GRID_VIEW = " "; -/** Utility class that assists with designing a responsive site. */ -var UxResponsiveUtilities = /** @class */ (function () { - function UxResponsiveUtilities() { - var _this = this; - /** Visible on screens smaller than 480px. */ - this.xs = false; - /** Visible on screens larger than 480px, and smaller than 960px. */ - this.sm = false; - /** Visible on screens larger than 960px, and smaller than 1280px. */ - this.md = false; - /** Visible on screens larger than 1280px, and smaller than 1925px. */ - this.lg = false; - /** Visible on screens larger than 1925px. */ - this.xl = false; - this.updating = false; - this.resizeHandler = function () { return _this.onResize(); }; - this.calculateResponsiveValues = function () { - _this.height = aureliaPal.PLATFORM.global.innerHeight; - _this.width = aureliaPal.PLATFORM.global.innerWidth; - _this.xs = _this.width <= 480; - _this.sm = _this.width > 480 && _this.width <= 960; - _this.md = _this.width > 960 && _this.width <= 1280; - _this.lg = _this.width > 1280 && _this.width <= 1925; - _this.xl = _this.width > 1925; - _this.updating = false; - }; - aureliaPal.PLATFORM.global.addEventListener('resize', this.resizeHandler); - this.calculateResponsiveValues(); - } - UxResponsiveUtilities.prototype.onResize = function () { - if (this.updating) { - return; + var UxGrid = /** @class */ (function () { + function UxGrid(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; } - this.updating = true; - if (aureliaPal.PLATFORM.global.requestAnimationFrame) { - aureliaPal.PLATFORM.global.requestAnimationFrame(this.calculateResponsiveValues); + UxGrid.prototype.bind = function () { + this.themeChanged(this.theme); + if (this.columns != null) { + this.columnsChanged(this.columns); + } + }; + UxGrid.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'grid'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxGrid.prototype.columnsChanged = function (newValue) { + if (newValue != null) { + this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); + } + }; + __decorate([ + aureliaTemplating.bindable + ], UxGrid.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxGrid.prototype, "columns", void 0); + UxGrid = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-grid'), + aureliaTemplating.inlineView(UX_GRID_VIEW) + ], UxGrid); + return UxGrid; + }()); + + var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}"; + + var UxGridTheme = /** @class */ (function () { + function UxGridTheme() { + this.themeKey = 'grid'; } - else { - setTimeout(this.calculateResponsiveValues, 100); + return UxGridTheme; + }()); + + /** Utility class that assists with designing a responsive site. */ + var UxResponsiveUtilities = /** @class */ (function () { + function UxResponsiveUtilities() { + var _this = this; + /** Visible on screens smaller than 480px. */ + this.xs = false; + /** Visible on screens larger than 480px, and smaller than 960px. */ + this.sm = false; + /** Visible on screens larger than 960px, and smaller than 1280px. */ + this.md = false; + /** Visible on screens larger than 1280px, and smaller than 1925px. */ + this.lg = false; + /** Visible on screens larger than 1925px. */ + this.xl = false; + this.updating = false; + this.resizeHandler = function () { return _this.onResize(); }; + this.calculateResponsiveValues = function () { + _this.height = aureliaPal.PLATFORM.global.innerHeight; + _this.width = aureliaPal.PLATFORM.global.innerWidth; + _this.xs = _this.width <= 480; + _this.sm = _this.width > 480 && _this.width <= 960; + _this.md = _this.width > 960 && _this.width <= 1280; + _this.lg = _this.width > 1280 && _this.width <= 1925; + _this.xl = _this.width > 1925; + _this.updating = false; + }; + aureliaPal.PLATFORM.global.addEventListener('resize', this.resizeHandler); + this.calculateResponsiveValues(); } - }; - UxResponsiveUtilities.prototype.dispose = function () { - aureliaPal.PLATFORM.global.removeEventListener('resize', this.resizeHandler); - }; - return UxResponsiveUtilities; -}()); + UxResponsiveUtilities.prototype.onResize = function () { + if (this.updating) { + return; + } + this.updating = true; + if (aureliaPal.PLATFORM.global.requestAnimationFrame) { + aureliaPal.PLATFORM.global.requestAnimationFrame(this.calculateResponsiveValues); + } + else { + setTimeout(this.calculateResponsiveValues, 100); + } + }; + UxResponsiveUtilities.prototype.dispose = function () { + aureliaPal.PLATFORM.global.removeEventListener('resize', this.resizeHandler); + }; + return UxResponsiveUtilities; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-grid-css'); - config.globalResources(UxGrid); -} + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-grid-css'); + config.globalResources(UxGrid); + } -exports.configure = configure; -exports.UxGridTheme = UxGridTheme; -exports.UxResponsiveUtilities = UxResponsiveUtilities; + exports.configure = configure; + exports.UxGridTheme = UxGridTheme; + exports.UxResponsiveUtilities = UxResponsiveUtilities; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/grid/dist/amd/ux-grid.js b/packages/grid/dist/amd/ux-grid.js deleted file mode 100644 index b6666a07..00000000 --- a/packages/grid/dist/amd/ux-grid.js +++ /dev/null @@ -1,45 +0,0 @@ -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", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxGrid = /** @class */ (function () { - function UxGrid(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxGrid.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - }; - UxGrid.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxGrid.prototype.columnsChanged = function (newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "columns", void 0); - UxGrid = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-grid') - ], UxGrid); - return UxGrid; - }()); - exports.UxGrid = UxGrid; -}); diff --git a/packages/grid/dist/commonjs/index.js b/packages/grid/dist/commonjs/index.js index 0c067fb7..938adf48 100644 --- a/packages/grid/dist/commonjs/index.js +++ b/packages/grid/dist/commonjs/index.js @@ -22,13 +22,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -75,7 +68,7 @@ var UxGrid = /** @class */ (function () { return UxGrid; }()); -var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}" +var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}"; var UxGridTheme = /** @class */ (function () { function UxGridTheme() { diff --git a/packages/grid/dist/commonjs/ux-grid.js b/packages/grid/dist/commonjs/ux-grid.js deleted file mode 100644 index b10dc60b..00000000 --- a/packages/grid/dist/commonjs/ux-grid.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxGrid = /** @class */ (function () { - function UxGrid(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxGrid.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - }; - UxGrid.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxGrid.prototype.columnsChanged = function (newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "columns", void 0); - UxGrid = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-grid') - ], UxGrid); - return UxGrid; -}()); -exports.UxGrid = UxGrid; diff --git a/packages/grid/dist/es2015/index.js b/packages/grid/dist/es2015/index.js index 7f92ee16..6ed21946 100644 --- a/packages/grid/dist/es2015/index.js +++ b/packages/grid/dist/es2015/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -70,7 +63,7 @@ UxGrid = __decorate([ inlineView(UX_GRID_VIEW) ], UxGrid); -var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}" +var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}"; class UxGridTheme { constructor() { diff --git a/packages/grid/dist/es2015/ux-grid.js b/packages/grid/dist/es2015/ux-grid.js deleted file mode 100644 index 2e96a2c7..00000000 --- a/packages/grid/dist/es2015/ux-grid.js +++ /dev/null @@ -1,43 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxGrid = class UxGrid { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - bind() { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - columnsChanged(newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', `repeat(${newValue}, 1fr)`); - } - } -}; -__decorate([ - bindable -], UxGrid.prototype, "theme", void 0); -__decorate([ - bindable -], UxGrid.prototype, "columns", void 0); -UxGrid = __decorate([ - inject(Element, StyleEngine), - customElement('ux-grid') -], UxGrid); -export { UxGrid }; diff --git a/packages/grid/dist/native-modules/index.js b/packages/grid/dist/native-modules/index.js index f432fb83..ff759732 100644 --- a/packages/grid/dist/native-modules/index.js +++ b/packages/grid/dist/native-modules/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -71,7 +64,7 @@ var UxGrid = /** @class */ (function () { return UxGrid; }()); -var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}" +var css = "ux-grid{display:grid;grid-template-columns:repeat(12,1fr);grid-gap:16px;grid-gap:var(--ux-theme--grid-gutter-spacing, 16px);margin-left:auto;margin-right:auto;padding:16px;padding:var(--ux-theme--grid-outer-padding, 16px);box-sizing:border-box;width:100%;align-items:stretch;max-width:none}ux-grid+ux-grid{padding-top:0}ux-grid.remove-padding,ux-grid[remove-padding]{padding:0}ux-grid.align-cells-top,ux-grid[align-cells-top]{align-items:flex-start}ux-grid.align-cells-middle,ux-grid[align-cells-middle]{align-items:center}ux-grid.align-cells-bottom,ux-grid[align-cells-bottom]{align-items:flex-end}ux-grid>ux-grid-cell.align-self-top,ux-grid>ux-grid-cell[align-self-top]{align-self:flex-start}ux-grid>ux-grid-cell.align-self-middle,ux-grid>ux-grid-cell[align-self-middle]{align-self:center}ux-grid>ux-grid-cell.align-self-bottom,ux-grid>ux-grid-cell[align-self-bottom]{align-self:flex-end}ux-grid>ux-grid-cell.align-self-stretch,ux-grid>ux-grid-cell[align-self-stretch]{align-self:stretch}ux-grid>ux-grid-cell{display:block;grid-column:span 12;max-width:100%}ux-grid>ux-grid-cell[xs=\"0\"]{display:none}ux-grid>ux-grid-cell[xs=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xs=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xs=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xs=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xs=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xs=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xs=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xs=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xs=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xs=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xs=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xs=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xs=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xs=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xs=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xs=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xs=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xs=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xs=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xs=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xs=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xs=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xs=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xs=\"10\"]{order:10}@media (min-width:480px){ux-grid>ux-grid-cell[sm=\"0\"]{display:none}ux-grid>ux-grid-cell[sm=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[sm=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[sm=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[sm=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[sm=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[sm=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[sm=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[sm=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[sm=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[sm=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[sm=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[sm=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-sm=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-sm=\"0\"]{order:0}ux-grid>ux-grid-cell[order-sm=\"1\"]{order:1}ux-grid>ux-grid-cell[order-sm=\"2\"]{order:2}ux-grid>ux-grid-cell[order-sm=\"3\"]{order:3}ux-grid>ux-grid-cell[order-sm=\"4\"]{order:4}ux-grid>ux-grid-cell[order-sm=\"5\"]{order:5}ux-grid>ux-grid-cell[order-sm=\"6\"]{order:6}ux-grid>ux-grid-cell[order-sm=\"7\"]{order:7}ux-grid>ux-grid-cell[order-sm=\"8\"]{order:8}ux-grid>ux-grid-cell[order-sm=\"9\"]{order:9}ux-grid>ux-grid-cell[order-sm=\"10\"]{order:10}}@media (min-width:960px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(960px - 32px)}ux-grid>ux-grid-cell[md=\"0\"]{display:none}ux-grid>ux-grid-cell[md=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[md=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[md=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[md=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[md=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[md=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[md=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[md=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[md=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[md=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[md=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[md=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-md=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-md=\"0\"]{order:0}ux-grid>ux-grid-cell[order-md=\"1\"]{order:1}ux-grid>ux-grid-cell[order-md=\"2\"]{order:2}ux-grid>ux-grid-cell[order-md=\"3\"]{order:3}ux-grid>ux-grid-cell[order-md=\"4\"]{order:4}ux-grid>ux-grid-cell[order-md=\"5\"]{order:5}ux-grid>ux-grid-cell[order-md=\"6\"]{order:6}ux-grid>ux-grid-cell[order-md=\"7\"]{order:7}ux-grid>ux-grid-cell[order-md=\"8\"]{order:8}ux-grid>ux-grid-cell[order-md=\"9\"]{order:9}ux-grid>ux-grid-cell[order-md=\"10\"]{order:10}}@media (min-width:1280px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1280px - 32px)}ux-grid>ux-grid-cell[lg=\"0\"]{display:none}ux-grid>ux-grid-cell[lg=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[lg=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[lg=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[lg=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[lg=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[lg=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[lg=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[lg=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[lg=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[lg=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[lg=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[lg=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-lg=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-lg=\"0\"]{order:0}ux-grid>ux-grid-cell[order-lg=\"1\"]{order:1}ux-grid>ux-grid-cell[order-lg=\"2\"]{order:2}ux-grid>ux-grid-cell[order-lg=\"3\"]{order:3}ux-grid>ux-grid-cell[order-lg=\"4\"]{order:4}ux-grid>ux-grid-cell[order-lg=\"5\"]{order:5}ux-grid>ux-grid-cell[order-lg=\"6\"]{order:6}ux-grid>ux-grid-cell[order-lg=\"7\"]{order:7}ux-grid>ux-grid-cell[order-lg=\"8\"]{order:8}ux-grid>ux-grid-cell[order-lg=\"9\"]{order:9}ux-grid>ux-grid-cell[order-lg=\"10\"]{order:10}}@media (min-width:1925px){ux-grid.fixed,ux-grid[fixed]{max-width:calc(1920px - 32px)}ux-grid>ux-grid-cell[xl=\"0\"]{display:none}ux-grid>ux-grid-cell[xl=\"1\"]{grid-column:span 1}ux-grid>ux-grid-cell[xl=\"2\"]{grid-column:span 2}ux-grid>ux-grid-cell[xl=\"3\"]{grid-column:span 3}ux-grid>ux-grid-cell[xl=\"4\"]{grid-column:span 4}ux-grid>ux-grid-cell[xl=\"5\"]{grid-column:span 5}ux-grid>ux-grid-cell[xl=\"6\"]{grid-column:span 6}ux-grid>ux-grid-cell[xl=\"7\"]{grid-column:span 7}ux-grid>ux-grid-cell[xl=\"8\"]{grid-column:span 8}ux-grid>ux-grid-cell[xl=\"9\"]{grid-column:span 9}ux-grid>ux-grid-cell[xl=\"10\"]{grid-column:span 10}ux-grid>ux-grid-cell[xl=\"11\"]{grid-column:span 11}ux-grid>ux-grid-cell[xl=\"12\"]{grid-column:span 12}ux-grid>ux-grid-cell[order-xl=\"-1\"]{order:-1}ux-grid>ux-grid-cell[order-xl=\"0\"]{order:0}ux-grid>ux-grid-cell[order-xl=\"1\"]{order:1}ux-grid>ux-grid-cell[order-xl=\"2\"]{order:2}ux-grid>ux-grid-cell[order-xl=\"3\"]{order:3}ux-grid>ux-grid-cell[order-xl=\"4\"]{order:4}ux-grid>ux-grid-cell[order-xl=\"5\"]{order:5}ux-grid>ux-grid-cell[order-xl=\"6\"]{order:6}ux-grid>ux-grid-cell[order-xl=\"7\"]{order:7}ux-grid>ux-grid-cell[order-xl=\"8\"]{order:8}ux-grid>ux-grid-cell[order-xl=\"9\"]{order:9}ux-grid>ux-grid-cell[order-xl=\"10\"]{order:10}}"; var UxGridTheme = /** @class */ (function () { function UxGridTheme() { diff --git a/packages/grid/dist/native-modules/ux-grid.js b/packages/grid/dist/native-modules/ux-grid.js deleted file mode 100644 index b58c1470..00000000 --- a/packages/grid/dist/native-modules/ux-grid.js +++ /dev/null @@ -1,44 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxGrid = /** @class */ (function () { - function UxGrid(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxGrid.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - }; - UxGrid.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxGrid.prototype.columnsChanged = function (newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); - } - }; - __decorate([ - bindable - ], UxGrid.prototype, "theme", void 0); - __decorate([ - bindable - ], UxGrid.prototype, "columns", void 0); - UxGrid = __decorate([ - inject(Element, StyleEngine), - customElement('ux-grid') - ], UxGrid); - return UxGrid; -}()); -export { UxGrid }; diff --git a/packages/grid/dist/system/ux-grid.js b/packages/grid/dist/system/ux-grid.js deleted file mode 100644 index 61e8696b..00000000 --- a/packages/grid/dist/system/ux-grid.js +++ /dev/null @@ -1,61 +0,0 @@ -System.register(["aurelia-templating", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_dependency_injection_1, core_1, UxGrid; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxGrid = /** @class */ (function () { - function UxGrid(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxGrid.prototype.bind = function () { - this.themeChanged(this.theme); - if (this.columns != null) { - this.columnsChanged(this.columns); - } - }; - UxGrid.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'grid'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxGrid.prototype.columnsChanged = function (newValue) { - if (newValue != null) { - this.element.style.setProperty('grid-template-columns', "repeat(" + newValue + ", 1fr)"); - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxGrid.prototype, "columns", void 0); - UxGrid = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-grid') - ], UxGrid); - return UxGrid; - }()); - exports_1("UxGrid", UxGrid); - } - }; -}); diff --git a/packages/input-info/dist/amd/index.js b/packages/input-info/dist/amd/index.js index 4e11d576..0d3b9ccb 100644 --- a/packages/input-info/dist/amd/index.js +++ b/packages/input-info/dist/amd/index.js @@ -1,97 +1,90 @@ define('@aurelia-ux/input-info', ['exports', 'aurelia-templating', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_INPUT_INFO_VIEW = " "; + var UX_INPUT_INFO_VIEW = " "; -var UxInputInfo = /** @class */ (function () { - function UxInputInfo(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - UxInputInfo.prototype.bind = function () { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - }; - UxInputInfo.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; + var UxInputInfo = /** @class */ (function () { + function UxInputInfo(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.uxInputCounter = null; } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInputInfo.prototype.findAndSetTarget = function (element) { - var inputElement = element.previousElementSibling; - if (!inputElement) { - return; + UxInputInfo.prototype.bind = function () { + if (this.target === undefined) { + this.findAndSetTarget(this.element); + } + this.themeChanged(this.theme); + }; + UxInputInfo.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'input-info'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxInputInfo.prototype.findAndSetTarget = function (element) { + var inputElement = element.previousElementSibling; + if (!inputElement) { + return; + } + if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { + this.target = inputElement.au.controller.viewModel; + } + }; + __decorate([ + aureliaTemplating.bindable + ], UxInputInfo.prototype, "target", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInputInfo.prototype, "uxInputCounter", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInputInfo.prototype, "theme", void 0); + UxInputInfo = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-input-info'), + aureliaTemplating.inlineView(UX_INPUT_INFO_VIEW) + ], UxInputInfo); + return UxInputInfo; + }()); + + var UxInputInfoTheme = /** @class */ (function () { + function UxInputInfoTheme() { + this.themeKey = 'input-info'; } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - }; - __decorate([ - aureliaTemplating.bindable - ], UxInputInfo.prototype, "target", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInputInfo.prototype, "uxInputCounter", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInputInfo.prototype, "theme", void 0); - UxInputInfo = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-input-info'), - aureliaTemplating.inlineView(UX_INPUT_INFO_VIEW) - ], UxInputInfo); - return UxInputInfo; -}()); - -var UxInputInfoTheme = /** @class */ (function () { - function UxInputInfoTheme() { - this.themeKey = 'input-info'; - } - return UxInputInfoTheme; -}()); + return UxInputInfoTheme; + }()); -var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}" + var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}"; -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, false, 'ux-input-info-css'); - config.globalResources(UxInputInfo); -} + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, false, 'ux-input-info-css'); + config.globalResources(UxInputInfo); + } -exports.configure = configure; -exports.UxInputInfoTheme = UxInputInfoTheme; + exports.configure = configure; + exports.UxInputInfoTheme = UxInputInfoTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/input-info/dist/amd/ux-input-info.js b/packages/input-info/dist/amd/ux-input-info.js deleted file mode 100644 index c986be00..00000000 --- a/packages/input-info/dist/amd/ux-input-info.js +++ /dev/null @@ -1,53 +0,0 @@ -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", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxInputInfo = /** @class */ (function () { - function UxInputInfo(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - UxInputInfo.prototype.bind = function () { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - }; - UxInputInfo.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInputInfo.prototype.findAndSetTarget = function (element) { - var inputElement = element.previousElementSibling; - if (!inputElement) { - return; - } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "target", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "uxInputCounter", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "theme", void 0); - UxInputInfo = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input-info') - ], UxInputInfo); - return UxInputInfo; - }()); - exports.UxInputInfo = UxInputInfo; -}); diff --git a/packages/input-info/dist/commonjs/index.js b/packages/input-info/dist/commonjs/index.js index 40b2cdcb..1915fb3c 100644 --- a/packages/input-info/dist/commonjs/index.js +++ b/packages/input-info/dist/commonjs/index.js @@ -21,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -89,7 +82,7 @@ var UxInputInfoTheme = /** @class */ (function () { return UxInputInfoTheme; }()); -var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}" +var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}"; function configure(config) { aureliaFramework.DOM.injectStyles(css, undefined, false, 'ux-input-info-css'); diff --git a/packages/input-info/dist/commonjs/ux-input-info.js b/packages/input-info/dist/commonjs/ux-input-info.js deleted file mode 100644 index 8e862392..00000000 --- a/packages/input-info/dist/commonjs/ux-input-info.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxInputInfo = /** @class */ (function () { - function UxInputInfo(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - UxInputInfo.prototype.bind = function () { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - }; - UxInputInfo.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInputInfo.prototype.findAndSetTarget = function (element) { - var inputElement = element.previousElementSibling; - if (!inputElement) { - return; - } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "target", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "uxInputCounter", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "theme", void 0); - UxInputInfo = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input-info') - ], UxInputInfo); - return UxInputInfo; -}()); -exports.UxInputInfo = UxInputInfo; diff --git a/packages/input-info/dist/es2015/index.js b/packages/input-info/dist/es2015/index.js index 599d8aa4..3af74c78 100644 --- a/packages/input-info/dist/es2015/index.js +++ b/packages/input-info/dist/es2015/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -83,7 +76,7 @@ class UxInputInfoTheme { } } -var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}" +var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}"; function configure(config) { DOM.injectStyles(css, undefined, false, 'ux-input-info-css'); diff --git a/packages/input-info/dist/es2015/ux-input-info.js b/packages/input-info/dist/es2015/ux-input-info.js deleted file mode 100644 index 39cf60e6..00000000 --- a/packages/input-info/dist/es2015/ux-input-info.js +++ /dev/null @@ -1,51 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxInputInfo = class UxInputInfo { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - bind() { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - findAndSetTarget(element) { - const inputElement = element.previousElementSibling; - if (!inputElement) { - return; - } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - } -}; -__decorate([ - bindable -], UxInputInfo.prototype, "target", void 0); -__decorate([ - bindable -], UxInputInfo.prototype, "uxInputCounter", void 0); -__decorate([ - bindable -], UxInputInfo.prototype, "theme", void 0); -UxInputInfo = __decorate([ - inject(Element, StyleEngine), - customElement('ux-input-info') -], UxInputInfo); -export { UxInputInfo }; diff --git a/packages/input-info/dist/native-modules/index.js b/packages/input-info/dist/native-modules/index.js index 5f94f169..a77cb1d3 100644 --- a/packages/input-info/dist/native-modules/index.js +++ b/packages/input-info/dist/native-modules/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -85,7 +78,7 @@ var UxInputInfoTheme = /** @class */ (function () { return UxInputInfoTheme; }()); -var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}" +var css = "ux-input-info{display:flex;font-size:14px;width:100%;color:#909090;color:var(--ux-theme--input-info-foreground, #909090)}ux-input-info>.hint-text,ux-input-info>.error-text{flex-grow:1}ux-input-info>.hint-text:first-child,ux-input-info>.error-text:first-child{display:block}ux-input-info>.hint-text,ux-input-info>.error-text{display:none}ux-input-info>.counter{transition:250ms;flex-wrap:nowrap;display:flex}ux-input.focused+ux-input-info>.counter{color:#ff4081;color:var(--ux-design--accent, #FF4081)}ux-input>input[disabled]+ux-input-info{display:none}.has-error+ux-input-info{color:#f44336;color:var(--ux-theme--input-info-error, #F44336)}"; function configure(config) { DOM.injectStyles(css, undefined, false, 'ux-input-info-css'); diff --git a/packages/input-info/dist/native-modules/ux-input-info.js b/packages/input-info/dist/native-modules/ux-input-info.js deleted file mode 100644 index 3c8bdb24..00000000 --- a/packages/input-info/dist/native-modules/ux-input-info.js +++ /dev/null @@ -1,52 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxInputInfo = /** @class */ (function () { - function UxInputInfo(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - UxInputInfo.prototype.bind = function () { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - }; - UxInputInfo.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInputInfo.prototype.findAndSetTarget = function (element) { - var inputElement = element.previousElementSibling; - if (!inputElement) { - return; - } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - }; - __decorate([ - bindable - ], UxInputInfo.prototype, "target", void 0); - __decorate([ - bindable - ], UxInputInfo.prototype, "uxInputCounter", void 0); - __decorate([ - bindable - ], UxInputInfo.prototype, "theme", void 0); - UxInputInfo = __decorate([ - inject(Element, StyleEngine), - customElement('ux-input-info') - ], UxInputInfo); - return UxInputInfo; -}()); -export { UxInputInfo }; diff --git a/packages/input-info/dist/system/ux-input-info.js b/packages/input-info/dist/system/ux-input-info.js deleted file mode 100644 index 7bc2c8d7..00000000 --- a/packages/input-info/dist/system/ux-input-info.js +++ /dev/null @@ -1,69 +0,0 @@ -System.register(["aurelia-templating", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_dependency_injection_1, core_1, UxInputInfo; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxInputInfo = /** @class */ (function () { - function UxInputInfo(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.uxInputCounter = null; - } - UxInputInfo.prototype.bind = function () { - if (this.target === undefined) { - this.findAndSetTarget(this.element); - } - this.themeChanged(this.theme); - }; - UxInputInfo.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input-info'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInputInfo.prototype.findAndSetTarget = function (element) { - var inputElement = element.previousElementSibling; - if (!inputElement) { - return; - } - if (inputElement.nodeName === 'UX-INPUT' || inputElement.nodeName === 'UX-TEXTAREA') { - this.target = inputElement.au.controller.viewModel; - } - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "target", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "uxInputCounter", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInputInfo.prototype, "theme", void 0); - UxInputInfo = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input-info') - ], UxInputInfo); - return UxInputInfo; - }()); - exports_1("UxInputInfo", UxInputInfo); - } - }; -}); diff --git a/packages/input/dist/amd/index.js b/packages/input/dist/amd/index.js index 47dffa0c..835c35b1 100644 --- a/packages/input/dist/amd/index.js +++ b/packages/input/dist/amd/index.js @@ -1,264 +1,255 @@ define('@aurelia-ux/input', ['exports', 'aurelia-templating', 'aurelia-pal', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaPal, aureliaBinding, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}" - -var UxInputTheme = /** @class */ (function () { - function UxInputTheme() { - this.themeKey = 'input'; - } - return UxInputTheme; -}()); - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} - -var UX_INPUT_VIEW = " "; - -var UxInput = /** @class */ (function () { - function UxInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - UxInput.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - var attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - }; - UxInput.prototype.attached = function () { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - }; - UxInput.prototype.detached = function () { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - }; - UxInput.prototype.getValue = function () { - return this.value; - }; - UxInput.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxInput.prototype.processRawValue = function (rawValue) { - var newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - }; - UxInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInput.prototype.focusedChanged = function (focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - }; - UxInput.prototype.typeChanged = function (newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - }; - UxInput.prototype.rawValueChanged = function (newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - }; - UxInput.prototype.focusInput = function () { - this.textbox.focus(); - }; - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "autofocus", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "maxlength", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "minlength", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "min", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "max", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "readonly", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "theme", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "label", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxInput.prototype, "type", void 0); - __decorate([ - aureliaBinding.observable - ], UxInput.prototype, "rawValue", void 0); - __decorate([ - aureliaBinding.observable - ], UxInput.prototype, "focused", void 0); - UxInput = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-input'), - aureliaTemplating.inlineView(UX_INPUT_VIEW) - ], UxInput); - return UxInput; -}()); -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } -}); - -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-input-css'); - config.container.get(core.AureliaUX).registerUxElementConfig(uxInputConfig); - config.globalResources([ - aureliaFramework.PLATFORM.moduleName('@aurelia-ux/input/ux-input') - ]); -} -var uxInputConfig = { - tagName: 'ux-input', - properties: { - value: { - defaultBindingMode: aureliaFramework.bindingMode.twoWay, - getObserver: function (element) { - return new aureliaBinding.ValueAttributeObserver(element, 'value', new aureliaBinding.EventSubscriber(['change'])); - } - } - } -}; - -exports.configure = configure; -exports.UxInputTheme = UxInputTheme; -exports.UxInput = UxInput; - -Object.defineProperty(exports, '__esModule', { value: true }); + var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}"; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } + + var UX_INPUT_VIEW = " "; + + var UxInput = /** @class */ (function () { + function UxInput(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.autofocus = null; + this.disabled = false; + this.readonly = false; + this.rawValue = ''; + this.focused = false; + this.value = undefined; + Object.setPrototypeOf(element, uxInputElementProto); + } + UxInput.prototype.bind = function () { + var element = this.element; + var textbox = this.textbox; + if (this.autofocus || this.autofocus === '') { + this.focused = true; + } + if (element.hasAttribute('id')) { + var attributeValue = element.getAttribute('id'); + if (attributeValue) { + element.removeAttribute('id'); + textbox.setAttribute('id', attributeValue); + } + } + if (element.hasAttribute('placeholder')) { + var attributeValue = element.getAttribute('placeholder'); + if (attributeValue) { + this.label = attributeValue; + } + } + if (element.hasAttribute('step')) { + var attributeValue = element.getAttribute('step'); + if (attributeValue) { + textbox.setAttribute('step', attributeValue); + element.removeAttribute('step'); + } + } + if ([ + 'text', + 'password', + 'number', + 'email', + 'url', + 'tel', + 'search' + ].includes(this.type)) { + textbox.setAttribute('type', this.type); + } + if (this.min) { + textbox.setAttribute('min', this.min.toString()); + } + if (this.max) { + textbox.setAttribute('max', this.max.toString()); + } + if (this.minlength) { + textbox.setAttribute('minlength', this.minlength.toString()); + } + if (this.maxlength) { + textbox.setAttribute('maxlength', this.maxlength.toString()); + } + this.themeChanged(this.theme); + }; + UxInput.prototype.attached = function () { + this.textbox.addEventListener('change', stopEvent); + this.textbox.addEventListener('input', stopEvent); + }; + UxInput.prototype.detached = function () { + this.textbox.removeEventListener('change', stopEvent); + this.textbox.removeEventListener('input', stopEvent); + }; + UxInput.prototype.getValue = function () { + return this.value; + }; + UxInput.prototype.setValue = function (value) { + var oldValue = this.value; + var newValue = this.processRawValue(value); + if (oldValue !== newValue) { + this.value = newValue; + this.ignoreRawChanges = true; + this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); + this.ignoreRawChanges = false; + this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); + } + }; + UxInput.prototype.processRawValue = function (rawValue) { + var newValue = rawValue; + if (this.type === 'number') { + newValue = rawValue === '' ? NaN : Number(rawValue); + if (isNaN(newValue)) { + newValue = null; + } + else { + if (this.min !== undefined && this.min > newValue) { + newValue = this.min; + } + if (this.max !== undefined && newValue > this.max) { + newValue = this.max; + } + } + } + return newValue; + }; + UxInput.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'input'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxInput.prototype.focusedChanged = function (focused) { + if (focused === true) { + this.element.classList.add('ux-input--focused'); + } + else { + this.element.classList.remove('ux-input--focused'); + } + this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); + }; + UxInput.prototype.typeChanged = function (newValue) { + if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { + this.type = 'text'; + } + }; + UxInput.prototype.rawValueChanged = function (newValue) { + if (newValue.length > 0) { + this.element.classList.add('ux-input--has-value'); + } + else { + this.element.classList.remove('ux-input--has-value'); + } + if (this.ignoreRawChanges) { + return; + } + this.setValue(newValue); + }; + UxInput.prototype.focusInput = function () { + this.textbox.focus(); + }; + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "autofocus", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "maxlength", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "minlength", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "min", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "max", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "readonly", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "theme", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "label", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxInput.prototype, "type", void 0); + __decorate([ + aureliaBinding.observable + ], UxInput.prototype, "rawValue", void 0); + __decorate([ + aureliaBinding.observable + ], UxInput.prototype, "focused", void 0); + UxInput = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-input'), + aureliaTemplating.inlineView(UX_INPUT_VIEW) + ], UxInput); + return UxInput; + }()); + function stopEvent(e) { + e.stopPropagation(); + } + var getVm = function (_) { return _.au.controller.viewModel; }; + var uxInputElementProto = Object.create(HTMLElement.prototype, { + value: { + get: function () { + return getVm(this).getValue(); + }, + set: function (value) { + getVm(this).setValue(value); + } + } + }); + + var UxInputTheme = /** @class */ (function () { + function UxInputTheme() { + this.themeKey = 'input'; + } + return UxInputTheme; + }()); + + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-input-css'); + config.container.get(core.AureliaUX).registerUxElementConfig(uxInputConfig); + config.globalResources(UxInput); + } + var uxInputConfig = { + tagName: 'ux-input', + properties: { + value: { + defaultBindingMode: aureliaFramework.bindingMode.twoWay, + getObserver: function (element) { + return new aureliaBinding.ValueAttributeObserver(element, 'value', new aureliaBinding.EventSubscriber(['change'])); + } + } + } + }; + + exports.configure = configure; + exports.UxInputTheme = UxInputTheme; + exports.UxInput = UxInput; + + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/input/dist/amd/ux-input-theme.d.ts b/packages/input/dist/amd/ux-input-theme.d.ts deleted file mode 100644 index 56aee272..00000000 --- a/packages/input/dist/amd/ux-input-theme.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { UxTheme } from '@aurelia-ux/core'; -export declare class UxInputTheme implements UxTheme { - themeKey: string; - foreground: string; - foregroundLabel: string; - background: string; - backgroundHover: string; - fontSize: string; - letterSpacing: string; - labelFontSize: string; - labelLetterSpacing: string; - border: string; - borderHover: string; - borderFocus: string; - borderRadius: string; - borderBottom: string; - borderBottomHover: string; - borderBottomFocus: string; - diabledForeground: string; - disabledBackground: string; - disabledBorder: string; - error: string; -} diff --git a/packages/input/dist/amd/ux-input.d.ts b/packages/input/dist/amd/ux-input.d.ts deleted file mode 100644 index 4ee7e0c9..00000000 --- a/packages/input/dist/amd/ux-input.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StyleEngine, UxComponent } from '@aurelia-ux/core'; -import { UxInputTheme } from './ux-input-theme'; -export interface UxInputElement extends HTMLElement { - value: any; -} -export declare class UxInput implements UxComponent { - private element; - styleEngine: StyleEngine; - private ignoreRawChanges; - autofocus: null; - disabled: any; - maxlength: number; - minlength: number; - min: number; - max: number; - readonly: any; - theme: UxInputTheme; - label: any; - type: any; - rawValue: string; - focused: boolean; - value: any; - textbox: HTMLInputElement; - constructor(element: UxInputElement, styleEngine: StyleEngine); - bind(): void; - attached(): void; - detached(): void; - getValue(): any; - setValue(value: any): void; - private processRawValue(rawValue); - themeChanged(newValue: any): void; - focusedChanged(focused: boolean): void; - typeChanged(newValue: any): void; - rawValueChanged(newValue: string): void; - focusInput(): void; -} diff --git a/packages/input/dist/amd/ux-input.html b/packages/input/dist/amd/ux-input.html deleted file mode 100644 index 699449b6..00000000 --- a/packages/input/dist/amd/ux-input.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/input/dist/amd/ux-input.js b/packages/input/dist/amd/ux-input.js deleted file mode 100644 index e14eee0b..00000000 --- a/packages/input/dist/amd/ux-input.js +++ /dev/null @@ -1,205 +0,0 @@ -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", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxInput = /** @class */ (function () { - function UxInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - UxInput.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - var attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - }; - UxInput.prototype.attached = function () { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - }; - UxInput.prototype.detached = function () { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - }; - UxInput.prototype.getValue = function () { - return this.value; - }; - UxInput.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxInput.prototype.processRawValue = function (rawValue) { - var newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - }; - UxInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInput.prototype.focusedChanged = function (focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - }; - UxInput.prototype.typeChanged = function (newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - }; - UxInput.prototype.rawValueChanged = function (newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - }; - UxInput.prototype.focusInput = function () { - this.textbox.focus(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "min", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "max", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "label", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "type", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "rawValue", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "focused", void 0); - UxInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input') - ], UxInput); - return UxInput; - }()); - exports.UxInput = UxInput; - function stopEvent(e) { - e.stopPropagation(); - } - var getVm = function (_) { return _.au.controller.viewModel; }; - var uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } - }); -}); diff --git a/packages/input/dist/commonjs/index.js b/packages/input/dist/commonjs/index.js index a89dd1de..65ae2b69 100644 --- a/packages/input/dist/commonjs/index.js +++ b/packages/input/dist/commonjs/index.js @@ -9,14 +9,7 @@ var aureliaDependencyInjection = require('aurelia-dependency-injection'); var core = require('@aurelia-ux/core'); var aureliaFramework = require('aurelia-framework'); -var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}" - -var UxInputTheme = /** @class */ (function () { - function UxInputTheme() { - this.themeKey = 'input'; - } - return UxInputTheme; -}()); +var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -32,13 +25,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -245,12 +231,17 @@ var uxInputElementProto = Object.create(HTMLElement.prototype, { } }); +var UxInputTheme = /** @class */ (function () { + function UxInputTheme() { + this.themeKey = 'input'; + } + return UxInputTheme; +}()); + function configure(config) { aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-input-css'); config.container.get(core.AureliaUX).registerUxElementConfig(uxInputConfig); - config.globalResources([ - aureliaFramework.PLATFORM.moduleName('@aurelia-ux/input/ux-input') - ]); + config.globalResources(UxInput); } var uxInputConfig = { tagName: 'ux-input', diff --git a/packages/input/dist/commonjs/ux-input-theme.d.ts b/packages/input/dist/commonjs/ux-input-theme.d.ts deleted file mode 100644 index 56aee272..00000000 --- a/packages/input/dist/commonjs/ux-input-theme.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { UxTheme } from '@aurelia-ux/core'; -export declare class UxInputTheme implements UxTheme { - themeKey: string; - foreground: string; - foregroundLabel: string; - background: string; - backgroundHover: string; - fontSize: string; - letterSpacing: string; - labelFontSize: string; - labelLetterSpacing: string; - border: string; - borderHover: string; - borderFocus: string; - borderRadius: string; - borderBottom: string; - borderBottomHover: string; - borderBottomFocus: string; - diabledForeground: string; - disabledBackground: string; - disabledBorder: string; - error: string; -} diff --git a/packages/input/dist/commonjs/ux-input.html b/packages/input/dist/commonjs/ux-input.html deleted file mode 100644 index 699449b6..00000000 --- a/packages/input/dist/commonjs/ux-input.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/input/dist/commonjs/ux-input.js b/packages/input/dist/commonjs/ux-input.js deleted file mode 100644 index b1f70414..00000000 --- a/packages/input/dist/commonjs/ux-input.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxInput = /** @class */ (function () { - function UxInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - UxInput.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - var attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - }; - UxInput.prototype.attached = function () { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - }; - UxInput.prototype.detached = function () { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - }; - UxInput.prototype.getValue = function () { - return this.value; - }; - UxInput.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxInput.prototype.processRawValue = function (rawValue) { - var newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - }; - UxInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInput.prototype.focusedChanged = function (focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - }; - UxInput.prototype.typeChanged = function (newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - }; - UxInput.prototype.rawValueChanged = function (newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - }; - UxInput.prototype.focusInput = function () { - this.textbox.focus(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "min", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "max", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "label", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "type", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "rawValue", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "focused", void 0); - UxInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input') - ], UxInput); - return UxInput; -}()); -exports.UxInput = UxInput; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/input/dist/es2015/index.js b/packages/input/dist/es2015/index.js index 7e699ae3..196676ac 100644 --- a/packages/input/dist/es2015/index.js +++ b/packages/input/dist/es2015/index.js @@ -3,15 +3,9 @@ import { DOM } from 'aurelia-pal'; import { observable, ValueAttributeObserver, EventSubscriber } from 'aurelia-binding'; import { inject } from 'aurelia-dependency-injection'; import { StyleEngine, AureliaUX } from '@aurelia-ux/core'; -import { PLATFORM, bindingMode, DOM as DOM$1 } from 'aurelia-framework'; +import { bindingMode, DOM as DOM$1 } from 'aurelia-framework'; -var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}" - -class UxInputTheme { - constructor() { - this.themeKey = 'input'; - } -} +var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -27,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -239,12 +226,16 @@ const uxInputElementProto = Object.create(HTMLElement.prototype, { } }); +class UxInputTheme { + constructor() { + this.themeKey = 'input'; + } +} + function configure(config) { DOM$1.injectStyles(css, undefined, undefined, 'ux-input-css'); config.container.get(AureliaUX).registerUxElementConfig(uxInputConfig); - config.globalResources([ - PLATFORM.moduleName('@aurelia-ux/input/ux-input') - ]); + config.globalResources(UxInput); } const uxInputConfig = { tagName: 'ux-input', diff --git a/packages/input/dist/es2015/ux-input-theme.d.ts b/packages/input/dist/es2015/ux-input-theme.d.ts deleted file mode 100644 index 56aee272..00000000 --- a/packages/input/dist/es2015/ux-input-theme.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { UxTheme } from '@aurelia-ux/core'; -export declare class UxInputTheme implements UxTheme { - themeKey: string; - foreground: string; - foregroundLabel: string; - background: string; - backgroundHover: string; - fontSize: string; - letterSpacing: string; - labelFontSize: string; - labelLetterSpacing: string; - border: string; - borderHover: string; - borderFocus: string; - borderRadius: string; - borderBottom: string; - borderBottomHover: string; - borderBottomFocus: string; - diabledForeground: string; - disabledBackground: string; - disabledBorder: string; - error: string; -} diff --git a/packages/input/dist/es2015/ux-input.d.ts b/packages/input/dist/es2015/ux-input.d.ts deleted file mode 100644 index 4ee7e0c9..00000000 --- a/packages/input/dist/es2015/ux-input.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StyleEngine, UxComponent } from '@aurelia-ux/core'; -import { UxInputTheme } from './ux-input-theme'; -export interface UxInputElement extends HTMLElement { - value: any; -} -export declare class UxInput implements UxComponent { - private element; - styleEngine: StyleEngine; - private ignoreRawChanges; - autofocus: null; - disabled: any; - maxlength: number; - minlength: number; - min: number; - max: number; - readonly: any; - theme: UxInputTheme; - label: any; - type: any; - rawValue: string; - focused: boolean; - value: any; - textbox: HTMLInputElement; - constructor(element: UxInputElement, styleEngine: StyleEngine); - bind(): void; - attached(): void; - detached(): void; - getValue(): any; - setValue(value: any): void; - private processRawValue(rawValue); - themeChanged(newValue: any): void; - focusedChanged(focused: boolean): void; - typeChanged(newValue: any): void; - rawValueChanged(newValue: string): void; - focusInput(): void; -} diff --git a/packages/input/dist/es2015/ux-input.html b/packages/input/dist/es2015/ux-input.html deleted file mode 100644 index 699449b6..00000000 --- a/packages/input/dist/es2015/ux-input.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/input/dist/es2015/ux-input.js b/packages/input/dist/es2015/ux-input.js deleted file mode 100644 index 5b51e2b6..00000000 --- a/packages/input/dist/es2015/ux-input.js +++ /dev/null @@ -1,205 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxInput = class UxInput { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - bind() { - const element = this.element; - const textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - const attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - const attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - const attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - } - attached() { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - } - detached() { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - } - getValue() { - return this.value; - } - setValue(value) { - const oldValue = this.value; - const newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - processRawValue(rawValue) { - let newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - focusedChanged(focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - } - typeChanged(newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - } - rawValueChanged(newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - } - focusInput() { - this.textbox.focus(); - } -}; -__decorate([ - bindable -], UxInput.prototype, "autofocus", void 0); -__decorate([ - bindable -], UxInput.prototype, "disabled", void 0); -__decorate([ - bindable -], UxInput.prototype, "maxlength", void 0); -__decorate([ - bindable -], UxInput.prototype, "minlength", void 0); -__decorate([ - bindable -], UxInput.prototype, "min", void 0); -__decorate([ - bindable -], UxInput.prototype, "max", void 0); -__decorate([ - bindable -], UxInput.prototype, "readonly", void 0); -__decorate([ - bindable -], UxInput.prototype, "theme", void 0); -__decorate([ - bindable -], UxInput.prototype, "label", void 0); -__decorate([ - bindable -], UxInput.prototype, "type", void 0); -__decorate([ - observable -], UxInput.prototype, "rawValue", void 0); -__decorate([ - observable -], UxInput.prototype, "focused", void 0); -UxInput = __decorate([ - inject(Element, StyleEngine), - customElement('ux-input') -], UxInput); -export { UxInput }; -function stopEvent(e) { - e.stopPropagation(); -} -const getVm = (_) => _.au.controller.viewModel; -const uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get() { - return getVm(this).getValue(); - }, - set(value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/input/dist/native-modules/index.js b/packages/input/dist/native-modules/index.js index 4f3e47d0..3cd1a2bc 100644 --- a/packages/input/dist/native-modules/index.js +++ b/packages/input/dist/native-modules/index.js @@ -3,16 +3,9 @@ import { DOM } from 'aurelia-pal'; import { observable, ValueAttributeObserver, EventSubscriber } from 'aurelia-binding'; import { inject } from 'aurelia-dependency-injection'; import { StyleEngine, AureliaUX } from '@aurelia-ux/core'; -import { PLATFORM, bindingMode, DOM as DOM$1 } from 'aurelia-framework'; +import { bindingMode, DOM as DOM$1 } from 'aurelia-framework'; -var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}" - -var UxInputTheme = /** @class */ (function () { - function UxInputTheme() { - this.themeKey = 'input'; - } - return UxInputTheme; -}()); +var css = "ux-input{display:flex;width:100%;height:56px;margin-top:8px;padding:0 16px;align-items:center;box-sizing:border-box;position:relative;cursor:text;color:inherit;color:var(--ux-theme--input-foreground, inherit);background-color:#00000011;background-color:var(--ux-theme--input-background, #00000011);border-radius:4px 4px 0 0;border-radius:var(--ux-theme--input-border-radius, 4px 4px 0 0)}ux-input:hover{background-color:#00000027;background-color:var(--ux-theme--input-background-hover, #00000027)}ux-input>input{width:100%;box-sizing:border-box;font-size:inherit;font-size:var(--ux-theme--input-font-size, inherit);letter-spacing:inherit;letter-spacing:var(--ux-theme--input-letter-spacing, inherit);padding:6px 0 4px 0;padding-right:0;padding-left:0;border:0;color:inherit;background-color:transparent;outline:0;padding-left:0;padding-right:0}ux-input label{position:absolute;cursor:text;font-size:13px;font-size:var(--ux-theme--input-label-font-size, 13px);letter-spacing:.5px;letter-spacing:var(--ux-theme--input-label-letter-spacing, 0.5px);transition:transform ease 150ms}ux-input.ux-input--focused label{color:#4043ff;color:var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.ux-input--has-value label,ux-input.ux-input--focused label{transform:translateY(-1.3em)}ux-input [slot=leading-icon]{margin-left:-8px;margin-right:8px}ux-input [slot=trailing-icon]{margin-left:8px;margin-right:-8px}ux-input.ux-input--has-value>[slot=leading-icon]~label,ux-input.ux-input--focused>[slot=leading-icon]~label{transform:translateX(24px) translateY(-1.3em)}ux-input [slot=leading-icon]~label{transform:translateX(24px)}ux-input :not(input){color:#555;color:var(--ux-theme--input-foreground-label, #555)}.ux-input__border-bottom{height:1px;background-color:#00000066;background-color:var(--ux-theme--input-border-bottom, #00000066);position:absolute;bottom:0;left:0;right:0}ux-input:hover .ux-input__border-bottom{background-color:#00000066;background-color:var(--ux-theme--input-border-bottom-hover, #00000066)}.ux-input__border-bottom-active{height:2px;background-color:#4043ff;background-color:var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff));position:absolute;bottom:0;left:0;right:0;transform:scalex(0);transition:transform ease 150ms}ux-input input:focus~.ux-input__border-bottom-active{transform:scaleX(1)}ux-input.has-error input{box-shadow:none}ux-input.has-error .ux-input__border-bottom,ux-input.has-error .ux-input__border-bottom-active{background-color:#f44336;background-color:var(--ux-theme--input-error, #F44336)}ux-input.has-error>:not(input){color:#f44336;color:var(--ux-theme--input-error, #F44336)}ux-input[disabled],ux-input[readonly]{background-color:#e1e1e1;background-color:var(--ux-theme--input-disabled-background, #e1e1e1)}ux-input[disabled],ux-input[disabled] label,ux-input[disabled]:hover,ux-input[disabled]:focus,ux-input[readonly],ux-input[readonly] label,ux-input[readonly]:hover,ux-input[readonly]:focus{color:#989898;color:var(--ux-theme--input-disabled-foreground, #989898)}ux-input[disabled] .ux-input__border-bottom,ux-input[disabled]:hover .ux-input__border-bottom,ux-input[disabled]:focus .ux-input__border-bottom,ux-input[readonly] .ux-input__border-bottom,ux-input[readonly]:hover .ux-input__border-bottom,ux-input[readonly]:focus .ux-input__border-bottom{background-color:#989898;background-color:var(--ux-theme--input-disabled-border, #989898)}ux-input.outline{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border, #00000066);border-radius:6px}ux-input.outline .ux-input__border-bottom,ux-input.outline .ux-input__border-bottom-active{display:none}ux-input.outline:hover{border:1px solid #00000066;border:1px solid var(--ux-theme--input-border-hover, #00000066)}ux-input.outline.ux-input--focused{border:2px solid #4043ff;border:2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff))}ux-input.outline.ux-input--has-value label,ux-input.outline.ux-input--focused label{transform:translateX(0) translateY(-2.1em);padding-left:4px;padding-right:4px}ux-input.outline.has-error{border-color:#f44336;border-color:var(--ux-theme--input-error, #F44336)}"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -28,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -241,12 +227,17 @@ var uxInputElementProto = Object.create(HTMLElement.prototype, { } }); +var UxInputTheme = /** @class */ (function () { + function UxInputTheme() { + this.themeKey = 'input'; + } + return UxInputTheme; +}()); + function configure(config) { DOM$1.injectStyles(css, undefined, undefined, 'ux-input-css'); config.container.get(AureliaUX).registerUxElementConfig(uxInputConfig); - config.globalResources([ - PLATFORM.moduleName('@aurelia-ux/input/ux-input') - ]); + config.globalResources(UxInput); } var uxInputConfig = { tagName: 'ux-input', diff --git a/packages/input/dist/native-modules/ux-input-theme.d.ts b/packages/input/dist/native-modules/ux-input-theme.d.ts deleted file mode 100644 index 56aee272..00000000 --- a/packages/input/dist/native-modules/ux-input-theme.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { UxTheme } from '@aurelia-ux/core'; -export declare class UxInputTheme implements UxTheme { - themeKey: string; - foreground: string; - foregroundLabel: string; - background: string; - backgroundHover: string; - fontSize: string; - letterSpacing: string; - labelFontSize: string; - labelLetterSpacing: string; - border: string; - borderHover: string; - borderFocus: string; - borderRadius: string; - borderBottom: string; - borderBottomHover: string; - borderBottomFocus: string; - diabledForeground: string; - disabledBackground: string; - disabledBorder: string; - error: string; -} diff --git a/packages/input/dist/native-modules/ux-input.d.ts b/packages/input/dist/native-modules/ux-input.d.ts deleted file mode 100644 index 4ee7e0c9..00000000 --- a/packages/input/dist/native-modules/ux-input.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StyleEngine, UxComponent } from '@aurelia-ux/core'; -import { UxInputTheme } from './ux-input-theme'; -export interface UxInputElement extends HTMLElement { - value: any; -} -export declare class UxInput implements UxComponent { - private element; - styleEngine: StyleEngine; - private ignoreRawChanges; - autofocus: null; - disabled: any; - maxlength: number; - minlength: number; - min: number; - max: number; - readonly: any; - theme: UxInputTheme; - label: any; - type: any; - rawValue: string; - focused: boolean; - value: any; - textbox: HTMLInputElement; - constructor(element: UxInputElement, styleEngine: StyleEngine); - bind(): void; - attached(): void; - detached(): void; - getValue(): any; - setValue(value: any): void; - private processRawValue(rawValue); - themeChanged(newValue: any): void; - focusedChanged(focused: boolean): void; - typeChanged(newValue: any): void; - rawValueChanged(newValue: string): void; - focusInput(): void; -} diff --git a/packages/input/dist/native-modules/ux-input.html b/packages/input/dist/native-modules/ux-input.html deleted file mode 100644 index 699449b6..00000000 --- a/packages/input/dist/native-modules/ux-input.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/input/dist/native-modules/ux-input.js b/packages/input/dist/native-modules/ux-input.js deleted file mode 100644 index 7d5dd498..00000000 --- a/packages/input/dist/native-modules/ux-input.js +++ /dev/null @@ -1,206 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxInput = /** @class */ (function () { - function UxInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - UxInput.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - var attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - }; - UxInput.prototype.attached = function () { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - }; - UxInput.prototype.detached = function () { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - }; - UxInput.prototype.getValue = function () { - return this.value; - }; - UxInput.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxInput.prototype.processRawValue = function (rawValue) { - var newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - }; - UxInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInput.prototype.focusedChanged = function (focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - }; - UxInput.prototype.typeChanged = function (newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - }; - UxInput.prototype.rawValueChanged = function (newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - }; - UxInput.prototype.focusInput = function () { - this.textbox.focus(); - }; - __decorate([ - bindable - ], UxInput.prototype, "autofocus", void 0); - __decorate([ - bindable - ], UxInput.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxInput.prototype, "maxlength", void 0); - __decorate([ - bindable - ], UxInput.prototype, "minlength", void 0); - __decorate([ - bindable - ], UxInput.prototype, "min", void 0); - __decorate([ - bindable - ], UxInput.prototype, "max", void 0); - __decorate([ - bindable - ], UxInput.prototype, "readonly", void 0); - __decorate([ - bindable - ], UxInput.prototype, "theme", void 0); - __decorate([ - bindable - ], UxInput.prototype, "label", void 0); - __decorate([ - bindable - ], UxInput.prototype, "type", void 0); - __decorate([ - observable - ], UxInput.prototype, "rawValue", void 0); - __decorate([ - observable - ], UxInput.prototype, "focused", void 0); - UxInput = __decorate([ - inject(Element, StyleEngine), - customElement('ux-input') - ], UxInput); - return UxInput; -}()); -export { UxInput }; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/input/dist/system/ux-input-theme.d.ts b/packages/input/dist/system/ux-input-theme.d.ts deleted file mode 100644 index 56aee272..00000000 --- a/packages/input/dist/system/ux-input-theme.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { UxTheme } from '@aurelia-ux/core'; -export declare class UxInputTheme implements UxTheme { - themeKey: string; - foreground: string; - foregroundLabel: string; - background: string; - backgroundHover: string; - fontSize: string; - letterSpacing: string; - labelFontSize: string; - labelLetterSpacing: string; - border: string; - borderHover: string; - borderFocus: string; - borderRadius: string; - borderBottom: string; - borderBottomHover: string; - borderBottomFocus: string; - diabledForeground: string; - disabledBackground: string; - disabledBorder: string; - error: string; -} diff --git a/packages/input/dist/system/ux-input.css b/packages/input/dist/system/ux-input.css deleted file mode 100644 index bbc7ccf4..00000000 --- a/packages/input/dist/system/ux-input.css +++ /dev/null @@ -1,191 +0,0 @@ -ux-input { - display: flex; - width: 100%; - height: 56px; - margin-top: 8px; - padding: 0 16px; - align-items: center; - box-sizing: border-box; - position: relative; - cursor: text; - color: inherit; - color: var(--ux-theme--input-foreground, inherit); - background-color: #00000011; - background-color: var(--ux-theme--input-background, #00000011); - border-radius: 4px 4px 0 0; - border-radius: var(--ux-theme--input-border-radius, 4px 4px 0 0); -} - -ux-input:hover { - background-color: #00000027; - background-color: var(--ux-theme--input-background-hover, #00000027); -} - -ux-input>input { - width: 100%; - box-sizing: border-box; - font-size: inherit; - font-size: var(--ux-theme--input-font-size, inherit); - letter-spacing: inherit; - letter-spacing: var(--ux-theme--input-letter-spacing, inherit); - padding: 6px 0 4px 0; - padding-right: 0px; - padding-left: 0px; - border: 0; - color: inherit; - background-color: transparent; - outline: none; - padding-left: 0; - padding-right: 0; -} - -ux-input label { - position: absolute; - cursor: text; - font-size: 13px; - font-size: var(--ux-theme--input-label-font-size, 13px); - letter-spacing: 0.5px; - letter-spacing: var(--ux-theme--input-label-letter-spacing, 0.5px); - transition: transform ease 150ms; -} - -ux-input.ux-input--focused label { - color: #4043ff; - color: var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff)); -} - -ux-input.ux-input--has-value label, -ux-input.ux-input--focused label { - transform: translateY(-1.3em); -} - -ux-input [slot="leading-icon"] { - margin-left: -8px; - margin-right: 8px; -} - -ux-input [slot="trailing-icon"] { - margin-left: 8px; - margin-right: -8px; -} - -ux-input.ux-input--has-value>[slot="leading-icon"]~label, -ux-input.ux-input--focused>[slot="leading-icon"]~label { - transform: translateX(24px) translateY(-1.3em); -} - -ux-input [slot="leading-icon"]~label { - transform: translateX(24px); -} - -ux-input :not(input) { - color: #555; - color: var(--ux-theme--input-foreground-label, #555); -} - -.ux-input__border-bottom { - height: 1px; - background-color: #00000066; - background-color: var(--ux-theme--input-border-bottom, #00000066); - position: absolute; - bottom: 0; - left: 0; - right: 0; -} - -ux-input:hover .ux-input__border-bottom { - background-color: #00000066; - background-color: var(--ux-theme--input-border-bottom-hover, #00000066); -} - -.ux-input__border-bottom-active { - height: 2px; - background-color: #4043ff; - background-color: var(--ux-theme--input-border-bottom-focus, var(--ux-design--primary, #4043ff)); - position: absolute; - bottom: 0; - left: 0; - right: 0; - transform: scalex(0); - transition: transform ease 150ms; -} - -ux-input input:focus~.ux-input__border-bottom-active { - transform: scaleX(1); -} - -ux-input.has-error input { - box-shadow: none; -} - -ux-input.has-error .ux-input__border-bottom, -ux-input.has-error .ux-input__border-bottom-active { - background-color: #F44336; - background-color: var(--ux-theme--input-error, #F44336); -} - -ux-input.has-error> :not(input) { - color: #F44336; - color: var(--ux-theme--input-error, #F44336); -} - -ux-input[disabled], -ux-input[readonly] { - background-color: #e1e1e1; - background-color: var(--ux-theme--input-disabled-background, #e1e1e1); -} - -ux-input[disabled], -ux-input[disabled] label, -ux-input[disabled]:hover, -ux-input[disabled]:focus, -ux-input[readonly], -ux-input[readonly] label, -ux-input[readonly]:hover, -ux-input[readonly]:focus { - color: #989898; - color: var(--ux-theme--input-disabled-foreground, #989898); -} - -ux-input[disabled] .ux-input__border-bottom, -ux-input[disabled]:hover .ux-input__border-bottom, -ux-input[disabled]:focus .ux-input__border-bottom, -ux-input[readonly] .ux-input__border-bottom, -ux-input[readonly]:hover .ux-input__border-bottom, -ux-input[readonly]:focus .ux-input__border-bottom { - background-color: #989898; - background-color: var(--ux-theme--input-disabled-border, #989898); -} - -ux-input.outline { - border: 1px solid #00000066; - border: 1px solid var(--ux-theme--input-border, #00000066); - border-radius: 6px; -} - -ux-input.outline .ux-input__border-bottom, -ux-input.outline .ux-input__border-bottom-active { - display: none; -} - -ux-input.outline:hover { - border: 1px solid #00000066; - border: 1px solid var(--ux-theme--input-border-hover, #00000066); -} - -ux-input.outline.ux-input--focused { - border: 2px solid #4043ff; - border: 2px solid var(--ux-theme--input-border-focus, var(--ux-design--primary, #4043ff)); -} - -ux-input.outline.ux-input--has-value label, -ux-input.outline.ux-input--focused label { - transform: translateX(0) translateY(-2.1em); - padding-left: 4px; - padding-right: 4px; -} - -ux-input.outline.has-error { - border-color: #F44336; - border-color: var(--ux-theme--input-error, #F44336); -} diff --git a/packages/input/dist/system/ux-input.d.ts b/packages/input/dist/system/ux-input.d.ts deleted file mode 100644 index 4ee7e0c9..00000000 --- a/packages/input/dist/system/ux-input.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StyleEngine, UxComponent } from '@aurelia-ux/core'; -import { UxInputTheme } from './ux-input-theme'; -export interface UxInputElement extends HTMLElement { - value: any; -} -export declare class UxInput implements UxComponent { - private element; - styleEngine: StyleEngine; - private ignoreRawChanges; - autofocus: null; - disabled: any; - maxlength: number; - minlength: number; - min: number; - max: number; - readonly: any; - theme: UxInputTheme; - label: any; - type: any; - rawValue: string; - focused: boolean; - value: any; - textbox: HTMLInputElement; - constructor(element: UxInputElement, styleEngine: StyleEngine); - bind(): void; - attached(): void; - detached(): void; - getValue(): any; - setValue(value: any): void; - private processRawValue(rawValue); - themeChanged(newValue: any): void; - focusedChanged(focused: boolean): void; - typeChanged(newValue: any): void; - rawValueChanged(newValue: string): void; - focusInput(): void; -} diff --git a/packages/input/dist/system/ux-input.html b/packages/input/dist/system/ux-input.html deleted file mode 100644 index 699449b6..00000000 --- a/packages/input/dist/system/ux-input.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/input/dist/system/ux-input.js b/packages/input/dist/system/ux-input.js deleted file mode 100644 index 9c33b6b8..00000000 --- a/packages/input/dist/system/ux-input.js +++ /dev/null @@ -1,227 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function stopEvent(e) { - e.stopPropagation(); - } - var aurelia_templating_1, aurelia_pal_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, UxInput, getVm, uxInputElementProto; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxInput = /** @class */ (function () { - function UxInput(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.disabled = false; - this.readonly = false; - this.rawValue = ''; - this.focused = false; - this.value = undefined; - Object.setPrototypeOf(element, uxInputElementProto); - } - UxInput.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.autofocus || this.autofocus === '') { - this.focused = true; - } - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue) { - element.removeAttribute('id'); - textbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - this.label = attributeValue; - } - } - if (element.hasAttribute('step')) { - var attributeValue = element.getAttribute('step'); - if (attributeValue) { - textbox.setAttribute('step', attributeValue); - element.removeAttribute('step'); - } - } - if ([ - 'text', - 'password', - 'number', - 'email', - 'url', - 'tel', - 'search' - ].includes(this.type)) { - textbox.setAttribute('type', this.type); - } - if (this.min) { - textbox.setAttribute('min', this.min.toString()); - } - if (this.max) { - textbox.setAttribute('max', this.max.toString()); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - this.themeChanged(this.theme); - }; - UxInput.prototype.attached = function () { - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - }; - UxInput.prototype.detached = function () { - this.textbox.removeEventListener('change', stopEvent); - this.textbox.removeEventListener('input', stopEvent); - }; - UxInput.prototype.getValue = function () { - return this.value; - }; - UxInput.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = this.processRawValue(value); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null || newValue === undefined ? '' : newValue.toString(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxInput.prototype.processRawValue = function (rawValue) { - var newValue = rawValue; - if (this.type === 'number') { - newValue = rawValue === '' ? NaN : Number(rawValue); - if (isNaN(newValue)) { - newValue = null; - } - else { - if (this.min !== undefined && this.min > newValue) { - newValue = this.min; - } - if (this.max !== undefined && newValue > this.max) { - newValue = this.max; - } - } - } - return newValue; - }; - UxInput.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'input'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxInput.prototype.focusedChanged = function (focused) { - if (focused === true) { - this.element.classList.add('ux-input--focused'); - } - else { - this.element.classList.remove('ux-input--focused'); - } - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focused ? 'focus' : 'blur', { bubbles: false })); - }; - UxInput.prototype.typeChanged = function (newValue) { - if (newValue !== 'text' && newValue !== 'password' && newValue !== 'number') { - this.type = 'text'; - } - }; - UxInput.prototype.rawValueChanged = function (newValue) { - if (newValue.length > 0) { - this.element.classList.add('ux-input--has-value'); - } - else { - this.element.classList.remove('ux-input--has-value'); - } - if (this.ignoreRawChanges) { - return; - } - this.setValue(newValue); - }; - UxInput.prototype.focusInput = function () { - this.textbox.focus(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "min", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "max", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "theme", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "label", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxInput.prototype, "type", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "rawValue", void 0); - __decorate([ - aurelia_binding_1.observable - ], UxInput.prototype, "focused", void 0); - UxInput = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-input') - ], UxInput); - return UxInput; - }()); - exports_1("UxInput", UxInput); - getVm = function (_) { return _.au.controller.viewModel; }; - uxInputElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } - }); - } - }; -}); diff --git a/packages/list/dist/amd/index.js b/packages/list/dist/amd/index.js index a18ed031..3f6708d1 100644 --- a/packages/list/dist/amd/index.js +++ b/packages/list/dist/amd/index.js @@ -1,99 +1,92 @@ define('@aurelia-ux/list', ['exports', 'aurelia-templating', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_LIST_VIEW = " "; + var UX_LIST_VIEW = " "; -var UxList = /** @class */ (function () { - function UxList(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxList.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); + var UxList = /** @class */ (function () { + function UxList(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; } - }; - UxList.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; + UxList.prototype.bind = function () { + if (this.theme != null) { + this.themeChanged(this.theme); + } + }; + UxList.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'list'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + __decorate([ + aureliaTemplating.bindable + ], UxList.prototype, "theme", void 0); + UxList = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-list'), + aureliaTemplating.inlineView(UX_LIST_VIEW) + ], UxList); + return UxList; + }()); + + var UX_LIST_ITEM_VIEW = " "; + + var UxListItem = /** @class */ (function () { + function UxListItem() { + this.theme = null; } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aureliaTemplating.bindable - ], UxList.prototype, "theme", void 0); - UxList = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-list'), - aureliaTemplating.inlineView(UX_LIST_VIEW) - ], UxList); - return UxList; -}()); - -var UX_LIST_ITEM_VIEW = " "; - -var UxListItem = /** @class */ (function () { - function UxListItem() { - this.theme = null; - } - __decorate([ - aureliaTemplating.bindable - ], UxListItem.prototype, "theme", void 0); - UxListItem = __decorate([ - aureliaTemplating.customElement('ux-list-item'), - aureliaTemplating.inlineView(UX_LIST_ITEM_VIEW) - ], UxListItem); - return UxListItem; -}()); - -var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}" - -var UxListTheme = /** @class */ (function () { - function UxListTheme() { - this.themeKey = 'list'; + __decorate([ + aureliaTemplating.bindable + ], UxListItem.prototype, "theme", void 0); + UxListItem = __decorate([ + aureliaTemplating.customElement('ux-list-item'), + aureliaTemplating.inlineView(UX_LIST_ITEM_VIEW) + ], UxListItem); + return UxListItem; + }()); + + var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}"; + + var UxListTheme = /** @class */ (function () { + function UxListTheme() { + this.themeKey = 'list'; + } + return UxListTheme; + }()); + + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-list-css'); + config.globalResources([ + UxList, + UxListItem + ]); } - return UxListTheme; -}()); - -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-list-css'); - config.globalResources([ - UxList, - UxListItem - ]); -} -exports.configure = configure; -exports.UxListTheme = UxListTheme; + exports.configure = configure; + exports.UxListTheme = UxListTheme; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/list/dist/amd/ux-list.js b/packages/list/dist/amd/ux-list.js deleted file mode 100644 index f07cc242..00000000 --- a/packages/list/dist/amd/ux-list.js +++ /dev/null @@ -1,36 +0,0 @@ -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", "aurelia-dependency-injection", "@aurelia-ux/core"], function (require, exports, aurelia_templating_1, aurelia_dependency_injection_1, core_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxList = /** @class */ (function () { - function UxList(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxList.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxList.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxList.prototype, "theme", void 0); - UxList = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-list') - ], UxList); - return UxList; - }()); - exports.UxList = UxList; -}); diff --git a/packages/list/dist/commonjs/index.js b/packages/list/dist/commonjs/index.js index b718c82e..61bbc4c8 100644 --- a/packages/list/dist/commonjs/index.js +++ b/packages/list/dist/commonjs/index.js @@ -21,13 +21,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -81,7 +74,7 @@ var UxListItem = /** @class */ (function () { return UxListItem; }()); -var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}" +var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}"; var UxListTheme = /** @class */ (function () { function UxListTheme() { diff --git a/packages/list/dist/commonjs/ux-list.js b/packages/list/dist/commonjs/ux-list.js deleted file mode 100644 index 38c1c68c..00000000 --- a/packages/list/dist/commonjs/ux-list.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var UxList = /** @class */ (function () { - function UxList(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxList.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxList.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxList.prototype, "theme", void 0); - UxList = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-list') - ], UxList); - return UxList; -}()); -exports.UxList = UxList; diff --git a/packages/list/dist/es2015/index.js b/packages/list/dist/es2015/index.js index 5144389a..7ef4569a 100644 --- a/packages/list/dist/es2015/index.js +++ b/packages/list/dist/es2015/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -75,7 +68,7 @@ UxListItem = __decorate([ inlineView(UX_LIST_ITEM_VIEW) ], UxListItem); -var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}" +var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}"; class UxListTheme { constructor() { diff --git a/packages/list/dist/es2015/ux-list.js b/packages/list/dist/es2015/ux-list.js deleted file mode 100644 index 0fc3db33..00000000 --- a/packages/list/dist/es2015/ux-list.js +++ /dev/null @@ -1,34 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -let UxList = class UxList { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - bind() { - if (this.theme != null) { - this.themeChanged(this.theme); - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; - } - this.styleEngine.applyTheme(newValue, this.element); - } -}; -__decorate([ - bindable -], UxList.prototype, "theme", void 0); -UxList = __decorate([ - inject(Element, StyleEngine), - customElement('ux-list') -], UxList); -export { UxList }; diff --git a/packages/list/dist/native-modules/index.js b/packages/list/dist/native-modules/index.js index 593ccfe8..a6222baa 100644 --- a/packages/list/dist/native-modules/index.js +++ b/packages/list/dist/native-modules/index.js @@ -17,13 +17,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -77,7 +70,7 @@ var UxListItem = /** @class */ (function () { return UxListItem; }()); -var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}" +var css = "ux-list{display:block;background-color:transparent;background-color:var(--ux-theme--list-background, transparent)}ux-list>.ux-list-item,ux-list>ux-list-item{display:flex;align-items:center;padding:16px;font-size:16px;color:inherit;color:var(--ux-theme--list-foreground, inherit);text-decoration:none}ux-list>.ux-list-item>.detail,ux-list>ux-list-item>.detail{margin-right:32px}ux-list>.ux-list-item>.detail.avatar,ux-list>ux-list-item>.detail.avatar{width:40px;height:40px;border-radius:50%;margin-right:16px}ux-list>.ux-list-item>.action-item,ux-list>ux-list-item>.action-item{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding-right:0;padding-left:16px}ux-list>.ux-list-item>.list-content,ux-list>ux-list-item>.list-content{display:flex;flex-direction:column;flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.03em}ux-list>.ux-list-item>a.list-content,ux-list>ux-list-item>a.list-content{margin:-16px;padding:16px;text-decoration:none}ux-list>.ux-list-item>.list-content>.secondary,ux-list>ux-list-item>.list-content>.secondary{font-size:14px;color:#888;color:var(--ux-theme--list-secondary-foreground, #888)}ux-list[type=two-line]>.ux-list-item>.list-content,ux-list[type=two-line]>ux-list-item{overflow:inherit;text-overflow:inherit;white-space:inherit}ux-list[type=two-line]>.ux-list-item>.list-content>.secondary,ux-list[type=two-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ux-list[type=three-line]>.ux-list-item,ux-list[type=three-line]>ux-list-item{align-items:flex-start}ux-list[type=three-line]>.ux-list-item>.list-content>.secondary,ux-list[type=three-line]>ux-list-item>.list-content>.secondary{overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.2;height:2.4em}"; var UxListTheme = /** @class */ (function () { function UxListTheme() { diff --git a/packages/list/dist/native-modules/ux-list.js b/packages/list/dist/native-modules/ux-list.js deleted file mode 100644 index 974cdb58..00000000 --- a/packages/list/dist/native-modules/ux-list.js +++ /dev/null @@ -1,35 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -var UxList = /** @class */ (function () { - function UxList(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxList.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxList.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - bindable - ], UxList.prototype, "theme", void 0); - UxList = __decorate([ - inject(Element, StyleEngine), - customElement('ux-list') - ], UxList); - return UxList; -}()); -export { UxList }; diff --git a/packages/list/dist/system/ux-list.js b/packages/list/dist/system/ux-list.js deleted file mode 100644 index f9f9d84c..00000000 --- a/packages/list/dist/system/ux-list.js +++ /dev/null @@ -1,52 +0,0 @@ -System.register(["aurelia-templating", "aurelia-dependency-injection", "@aurelia-ux/core"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - var aurelia_templating_1, aurelia_dependency_injection_1, core_1, UxList; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - } - ], - execute: function () { - UxList = /** @class */ (function () { - function UxList(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - } - UxList.prototype.bind = function () { - if (this.theme != null) { - this.themeChanged(this.theme); - } - }; - UxList.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'list'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxList.prototype, "theme", void 0); - UxList = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-list') - ], UxList); - return UxList; - }()); - exports_1("UxList", UxList); - } - }; -}); diff --git a/packages/radio/dist/amd/index.js b/packages/radio/dist/amd/index.js index 4f868caa..0b9b80d5 100644 --- a/packages/radio/dist/amd/index.js +++ b/packages/radio/dist/amd/index.js @@ -1,212 +1,205 @@ define('@aurelia-ux/radio', ['exports', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaBinding, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} - -var UX_RADIO_VIEW = " "; - -var UxRadio = /** @class */ (function () { - function UxRadio(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; } - Object.defineProperty(UxRadio.prototype, "isDisabled", { - get: function () { - return core.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxRadio.prototype.bind = function () { - var element = this.element; - var radio = this.radio; - if (element.hasAttribute('id')) { - var id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } + + var UX_RADIO_VIEW = " "; + + var UxRadio = /** @class */ (function () { + function UxRadio(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.disabled = false; + this.effect = 'ripple'; + this.checked = false; + this.ripple = null; + Object.setPrototypeOf(element, uxRadioElementProto); } - if (element.hasAttribute('tabindex')) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); + Object.defineProperty(UxRadio.prototype, "isDisabled", { + get: function () { + return core.normalizeBooleanAttribute('disabled', this.disabled); + }, + enumerable: true, + configurable: true + }); + UxRadio.prototype.bind = function () { + var element = this.element; + var radio = this.radio; + if (element.hasAttribute('id')) { + var id = element.id; + if (id != null) { + radio.setAttribute('id', id); + element.removeAttribute('id'); + } } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - }; - UxRadio.prototype.attached = function () { - this.radio.addEventListener('change', stopEvent); - }; - UxRadio.prototype.detached = function () { - this.radio.removeEventListener('change', stopEvent); - }; - UxRadio.prototype.getChecked = function () { - return this.checked; - }; - UxRadio.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; + if (element.hasAttribute('tabindex')) { + var tabIndex = element.getAttribute('tabindex'); + if (tabIndex != null) { + radio.setAttribute('tabindex', tabIndex); + element.removeAttribute('tabindex'); + } } - this.ignoreValueChanges = false; - this.element.dispatchEvent(aureliaFramework.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxRadio.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxRadio.prototype.valueChanged = function (value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - }; - UxRadio.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); + if (element.hasAttribute('checked')) { + element.checked = true; + } + if (this.checked) { + radio.checked = true; + } + this.themeChanged(this.theme); + }; + UxRadio.prototype.attached = function () { + this.radio.addEventListener('change', stopEvent); + }; + UxRadio.prototype.detached = function () { + this.radio.removeEventListener('change', stopEvent); + }; + UxRadio.prototype.getChecked = function () { + return this.checked; + }; + UxRadio.prototype.setChecked = function (value) { + var oldValue = this.checked; + var newValue = value; + if (newValue !== oldValue) { + this.checked = newValue; + this.ignoreValueChanges = true; + this.value = newValue; + if (this.radio) { + this.radio.checked = !!newValue; } + this.ignoreValueChanges = false; + this.element.dispatchEvent(aureliaFramework.DOM.createCustomEvent('change', { bubbles: true })); } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aureliaFramework.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aureliaTemplating.bindable - ], UxRadio.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxRadio.prototype, "effect", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxRadio.prototype, "id", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxRadio.prototype, "theme", void 0); - __decorate([ - aureliaBinding.observable({ initializer: function () { return false; } }) - ], UxRadio.prototype, "value", void 0); - __decorate([ - aureliaBinding.computedFrom('disabled') - ], UxRadio.prototype, "isDisabled", null); - UxRadio = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-radio'), - aureliaTemplating.inlineView(UX_RADIO_VIEW) - ], UxRadio); - return UxRadio; -}()); -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get: function () { - return getVm(this).getChecked(); + }; + UxRadio.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'radio'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxRadio.prototype.valueChanged = function (value) { + if (this.ignoreValueChanges) { + return; + } + this.setChecked(value); + }; + UxRadio.prototype.onMouseDown = function (e) { + var _this = this; + if (e.button !== 0 || this.isDisabled) { + return; + } + if (this.element.classList.contains('ripple')) { + if (this.ripple === null) { + this.ripple = new core.PaperRipple(); + var container = this.element.querySelector('.ripplecontainer'); + if (container != null) { + container.appendChild(this.ripple.$); + } + } + this.ripple.center = true; + this.ripple.round = true; + this.ripple.downAction(e); + var winEvents_1 = new aureliaFramework.ElementEvents(window); + var upAction = function () { + _this.ripple.upAction(); + winEvents_1.disposeAll(); + }; + winEvents_1.subscribe('blur', upAction); + winEvents_1.subscribe('mouseup', upAction, true); + } + e.preventDefault(); + }; + __decorate([ + aureliaTemplating.bindable + ], UxRadio.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxRadio.prototype, "effect", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxRadio.prototype, "id", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxRadio.prototype, "theme", void 0); + __decorate([ + aureliaBinding.observable({ initializer: function () { return false; } }) + ], UxRadio.prototype, "value", void 0); + __decorate([ + aureliaBinding.computedFrom('disabled') + ], UxRadio.prototype, "isDisabled", null); + UxRadio = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-radio'), + aureliaTemplating.inlineView(UX_RADIO_VIEW) + ], UxRadio); + return UxRadio; + }()); + function stopEvent(e) { + e.stopPropagation(); + } + var getVm = function (_) { return _.au.controller.viewModel; }; + var uxRadioElementProto = Object.create(HTMLElement.prototype, { + type: { + value: 'radio', }, - set: function (value) { - getVm(this).setChecked(value); + checked: { + get: function () { + return getVm(this).getChecked(); + }, + set: function (value) { + getVm(this).setChecked(value); + } } - } -}); + }); -var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" + var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; -var UxRadioTheme = /** @class */ (function () { - function UxRadioTheme() { - this.themeKey = 'radio'; - } - return UxRadioTheme; -}()); + var UxRadioTheme = /** @class */ (function () { + function UxRadioTheme() { + this.themeKey = 'radio'; + } + return UxRadioTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-radio-css'); - config.container.get(core.AureliaUX).registerUxElementConfig(uxRadioConfig); - config.globalResources(UxRadio); -} -var uxRadioConfig = { - tagName: 'ux-radio', - properties: { - checked: { - defaultBindingMode: aureliaFramework.bindingMode.twoWay, - getObserver: function (element, _, observerLocator) { - return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-radio-css'); + config.container.get(core.AureliaUX).registerUxElementConfig(uxRadioConfig); + config.globalResources(UxRadio); + } + var uxRadioConfig = { + tagName: 'ux-radio', + properties: { + checked: { + defaultBindingMode: aureliaFramework.bindingMode.twoWay, + getObserver: function (element, _, observerLocator) { + return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + } } } - } -}; + }; -exports.configure = configure; -exports.UxRadioTheme = UxRadioTheme; -exports.UxRadio = UxRadio; + exports.configure = configure; + exports.UxRadioTheme = UxRadioTheme; + exports.UxRadio = UxRadio; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/radio/dist/amd/ux-radio.js b/packages/radio/dist/amd/ux-radio.js deleted file mode 100644 index c2145e66..00000000 --- a/packages/radio/dist/amd/ux-radio.js +++ /dev/null @@ -1,155 +0,0 @@ -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", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (require, exports, aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxRadio = /** @class */ (function () { - function UxRadio(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); - } - Object.defineProperty(UxRadio.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxRadio.prototype.bind = function () { - var element = this.element; - var radio = this.radio; - if (element.hasAttribute('id')) { - var id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } - } - if (element.hasAttribute('tabindex')) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); - } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - }; - UxRadio.prototype.attached = function () { - this.radio.addEventListener('change', stopEvent); - }; - UxRadio.prototype.detached = function () { - this.radio.removeEventListener('change', stopEvent); - }; - UxRadio.prototype.getChecked = function () { - return this.checked; - }; - UxRadio.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; - } - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxRadio.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxRadio.prototype.valueChanged = function (value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - }; - UxRadio.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxRadio.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxRadio.prototype, "isDisabled", null); - UxRadio = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-radio') - ], UxRadio); - return UxRadio; - }()); - exports.UxRadio = UxRadio; - function stopEvent(e) { - e.stopPropagation(); - } - var getVm = function (_) { return _.au.controller.viewModel; }; - var uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } - }); -}); diff --git a/packages/radio/dist/commonjs/index.js b/packages/radio/dist/commonjs/index.js index bddba2a4..0db0f578 100644 --- a/packages/radio/dist/commonjs/index.js +++ b/packages/radio/dist/commonjs/index.js @@ -22,13 +22,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -185,7 +178,7 @@ var uxRadioElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxRadioTheme = /** @class */ (function () { function UxRadioTheme() { diff --git a/packages/radio/dist/commonjs/ux-radio.js b/packages/radio/dist/commonjs/ux-radio.js deleted file mode 100644 index 1c1b4594..00000000 --- a/packages/radio/dist/commonjs/ux-radio.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var aurelia_framework_1 = require("aurelia-framework"); -var UxRadio = /** @class */ (function () { - function UxRadio(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); - } - Object.defineProperty(UxRadio.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxRadio.prototype.bind = function () { - var element = this.element; - var radio = this.radio; - if (element.hasAttribute('id')) { - var id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } - } - if (element.hasAttribute('tabindex')) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); - } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - }; - UxRadio.prototype.attached = function () { - this.radio.addEventListener('change', stopEvent); - }; - UxRadio.prototype.detached = function () { - this.radio.removeEventListener('change', stopEvent); - }; - UxRadio.prototype.getChecked = function () { - return this.checked; - }; - UxRadio.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; - } - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxRadio.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxRadio.prototype.valueChanged = function (value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - }; - UxRadio.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxRadio.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxRadio.prototype, "isDisabled", null); - UxRadio = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-radio') - ], UxRadio); - return UxRadio; -}()); -exports.UxRadio = UxRadio; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/radio/dist/es2015/index.js b/packages/radio/dist/es2015/index.js index 47e45e56..0709e8c2 100644 --- a/packages/radio/dist/es2015/index.js +++ b/packages/radio/dist/es2015/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -175,7 +168,7 @@ const uxRadioElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; class UxRadioTheme { constructor() { diff --git a/packages/radio/dist/es2015/ux-radio.js b/packages/radio/dist/es2015/ux-radio.js deleted file mode 100644 index fdcb139d..00000000 --- a/packages/radio/dist/es2015/ux-radio.js +++ /dev/null @@ -1,150 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -import { ElementEvents, DOM } from 'aurelia-framework'; -let UxRadio = class UxRadio { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); - } - get isDisabled() { - return normalizeBooleanAttribute('disabled', this.disabled); - } - bind() { - const element = this.element; - const radio = this.radio; - if (element.hasAttribute('id')) { - const id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } - } - if (element.hasAttribute('tabindex')) { - const tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); - } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - } - attached() { - this.radio.addEventListener('change', stopEvent); - } - detached() { - this.radio.removeEventListener('change', stopEvent); - } - getChecked() { - return this.checked; - } - setChecked(value) { - const oldValue = this.checked; - const newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; - } - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - valueChanged(value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - } - onMouseDown(e) { - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - const container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - const winEvents = new ElementEvents(window); - const upAction = () => { - this.ripple.upAction(); - winEvents.disposeAll(); - }; - winEvents.subscribe('blur', upAction); - winEvents.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - } -}; -__decorate([ - bindable -], UxRadio.prototype, "disabled", void 0); -__decorate([ - bindable -], UxRadio.prototype, "effect", void 0); -__decorate([ - bindable -], UxRadio.prototype, "id", void 0); -__decorate([ - bindable -], UxRadio.prototype, "theme", void 0); -__decorate([ - observable({ initializer: () => false }) -], UxRadio.prototype, "value", void 0); -__decorate([ - computedFrom('disabled') -], UxRadio.prototype, "isDisabled", null); -UxRadio = __decorate([ - inject(Element, StyleEngine), - customElement('ux-radio') -], UxRadio); -export { UxRadio }; -function stopEvent(e) { - e.stopPropagation(); -} -const getVm = (_) => _.au.controller.viewModel; -const uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get() { - return getVm(this).getChecked(); - }, - set(value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/radio/dist/native-modules/index.js b/packages/radio/dist/native-modules/index.js index 0c81ede4..2d512b6b 100644 --- a/packages/radio/dist/native-modules/index.js +++ b/packages/radio/dist/native-modules/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -181,7 +174,7 @@ var uxRadioElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-radio{display:inline-block;outline:0;height:24px;width:24px;box-sizing:border-box;position:relative}ux-radio>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-radio>input:disabled{cursor:default}ux-radio>.radio{width:24px;height:24px;border:solid 2px #455a64;border:var(--ux-theme--checkbox-border, solid 2px #455A64);border-radius:50%;display:inline-flex;box-sizing:border-box;cursor:pointer;align-items:center;justify-content:center}ux-radio input:hover:not(:disabled)~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio input:checked~.radio{border:solid 2px #ff4081;border:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border:var(--ux-theme--radio-hover-border, solid 2px var(--ux-design--accent, #FF4081))}ux-radio>.radio>.background-box{width:100%;height:100%;background-color:#ff4081;background-color:var(--ux-theme--radio-checked-background, var(--ux-design--accent, #FF4081));border-radius:50%;transform:scale3d(0,0,0);transition:150ms}ux-radio input:checked~.radio>.background-box{transform:scale3d(.75,.75,.75)}ux-radio>.radio>.background-box>svg{fill:#fff;fill:var(--ux-theme--radio-checkmark-color, #FFF)}ux-radio.disabled{pointer-events:none;cursor:default}ux-radio input:disabled~.radio:hover{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:disabled~.radio{border:solid 2px #9e9e9e;border:var(--ux-theme--radio-disabled-border, solid 2px #9E9E9E)}ux-radio input:checked:disabled~.radio>.background-box{background-color:#9e9e9e;background-color:var(--ux-theme--radio-disabled-background, #9E9E9E)}ux-radio input:disabled~.radio>.background-box::after{border-color:#e0e0e0;border-color:var(--ux-theme--radio-disabled-foreground, #E0E0E0)}ux-radio .ripplecontainer{position:relative;width:0;height:0}ux-radio .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-radio .ripplecontainer>.ripple{position:absolute;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0)}ux-radio input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-radio input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxRadioTheme = /** @class */ (function () { function UxRadioTheme() { diff --git a/packages/radio/dist/native-modules/ux-radio.js b/packages/radio/dist/native-modules/ux-radio.js deleted file mode 100644 index 990c30bb..00000000 --- a/packages/radio/dist/native-modules/ux-radio.js +++ /dev/null @@ -1,156 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -import { ElementEvents, DOM } from 'aurelia-framework'; -var UxRadio = /** @class */ (function () { - function UxRadio(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); - } - Object.defineProperty(UxRadio.prototype, "isDisabled", { - get: function () { - return normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxRadio.prototype.bind = function () { - var element = this.element; - var radio = this.radio; - if (element.hasAttribute('id')) { - var id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } - } - if (element.hasAttribute('tabindex')) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); - } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - }; - UxRadio.prototype.attached = function () { - this.radio.addEventListener('change', stopEvent); - }; - UxRadio.prototype.detached = function () { - this.radio.removeEventListener('change', stopEvent); - }; - UxRadio.prototype.getChecked = function () { - return this.checked; - }; - UxRadio.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; - } - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxRadio.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxRadio.prototype.valueChanged = function (value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - }; - UxRadio.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - bindable - ], UxRadio.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxRadio.prototype, "effect", void 0); - __decorate([ - bindable - ], UxRadio.prototype, "id", void 0); - __decorate([ - bindable - ], UxRadio.prototype, "theme", void 0); - __decorate([ - observable({ initializer: function () { return false; } }) - ], UxRadio.prototype, "value", void 0); - __decorate([ - computedFrom('disabled') - ], UxRadio.prototype, "isDisabled", null); - UxRadio = __decorate([ - inject(Element, StyleEngine), - customElement('ux-radio') - ], UxRadio); - return UxRadio; -}()); -export { UxRadio }; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/radio/dist/system/ux-radio.js b/packages/radio/dist/system/ux-radio.js deleted file mode 100644 index 91a546a5..00000000 --- a/packages/radio/dist/system/ux-radio.js +++ /dev/null @@ -1,177 +0,0 @@ -System.register(["aurelia-templating", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function stopEvent(e) { - e.stopPropagation(); - } - var aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1, UxRadio, getVm, uxRadioElementProto; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (aurelia_framework_1_1) { - aurelia_framework_1 = aurelia_framework_1_1; - } - ], - execute: function () { - UxRadio = /** @class */ (function () { - function UxRadio(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.checked = false; - this.ripple = null; - Object.setPrototypeOf(element, uxRadioElementProto); - } - Object.defineProperty(UxRadio.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxRadio.prototype.bind = function () { - var element = this.element; - var radio = this.radio; - if (element.hasAttribute('id')) { - var id = element.id; - if (id != null) { - radio.setAttribute('id', id); - element.removeAttribute('id'); - } - } - if (element.hasAttribute('tabindex')) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex != null) { - radio.setAttribute('tabindex', tabIndex); - element.removeAttribute('tabindex'); - } - } - if (element.hasAttribute('checked')) { - element.checked = true; - } - if (this.checked) { - radio.checked = true; - } - this.themeChanged(this.theme); - }; - UxRadio.prototype.attached = function () { - this.radio.addEventListener('change', stopEvent); - }; - UxRadio.prototype.detached = function () { - this.radio.removeEventListener('change', stopEvent); - }; - UxRadio.prototype.getChecked = function () { - return this.checked; - }; - UxRadio.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - if (this.radio) { - this.radio.checked = !!newValue; - } - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxRadio.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'radio'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxRadio.prototype.valueChanged = function (value) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(value); - }; - UxRadio.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxRadio.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxRadio.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxRadio.prototype, "isDisabled", null); - UxRadio = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-radio') - ], UxRadio); - return UxRadio; - }()); - exports_1("UxRadio", UxRadio); - getVm = function (_) { return _.au.controller.viewModel; }; - uxRadioElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'radio', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } - }); - } - }; -}); diff --git a/packages/select/dist/amd/ux-select.js b/packages/select/dist/amd/ux-select.js deleted file mode 100644 index f6f72b4f..00000000 --- a/packages/select/dist/amd/ux-select.js +++ /dev/null @@ -1,489 +0,0 @@ -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-framework", "aurelia-logging", "@aurelia-ux/core", "./util"], function (require, exports, aurelia_framework_1, aurelia_logging_1, core_1, util_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UP = 38; - // const RIGHT = 39; - var DOWN = 40; - // const LEFT = 37; - // const ESC = 27; - var ENTER = 13; - var SPACE = 32; - var logger = aurelia_logging_1.getLogger('ux-select'); - var invalidMultipleValueMsg = 'Only null or Array instances can be bound to a multi-select'; - var selectArrayContext = 'context:ux-select'; - var UxSelect = /** @class */ (function () { - function UxSelect(element, styleEngine, observerLocator, taskQueue) { - this.element = element; - this.styleEngine = styleEngine; - this.observerLocator = observerLocator; - this.taskQueue = taskQueue; - this.selectedOption = null; - this.ignoreSelectEvent = true; - // Only chrome persist the element prototype when cloning with clone node - Object.setPrototypeOf(element, UxSelectElementProto); - } - UxSelect.prototype.bind = function () { - if (util_1.bool(this.autofocus)) { - // setTimeout(focusEl, 0, this.button); - } - if (this.isMultiple) { - if (!this.value) { - this.value = []; - } - else if (!Array.isArray(this.value)) { - throw new Error(invalidMultipleValueMsg); - } - } - if (!this.winEvents) { - this.winEvents = new aurelia_framework_1.ElementEvents(window); - } - // Initially Synchronize options with value of this element - this.taskQueue.queueMicroTask(this); - }; - UxSelect.prototype.unbind = function () { - this.winEvents.disposeAll(); - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - this.selectedOption = null; - }; - UxSelect.prototype.resolveDisplayValue = function () { - var value = this.value; - this.displayValue = Array.isArray(value) ? value.slice().sort().join(', ') : value; - }; - UxSelect.prototype.synchronizeOptions = function () { - var value = this.value; - var isArray = Array.isArray(value); - var options = this.options; - var matcher = this.element.matcher || defaultMatcher; - var i = options.length; - this.ignoreSelectEvent = true; - var _loop_1 = function () { - var option = options[i]; - var optionValue = option.value; - if (isArray) { - option.selected = value.findIndex(function (item) { return !!matcher(optionValue, item); }) !== -1; - return "continue"; - } - option.selected = !!matcher(optionValue, value); - }; - while (i--) { - _loop_1(); - } - this.ignoreSelectEvent = false; - }; - UxSelect.prototype.synchronizeValue = function () { - var options = this.options; - var ii = options.length; - var count = 0; - var optionValues = []; - // extract value from ux-option - for (var i = 0; i < ii; i++) { - var option = options[i]; - if (!option.selected) { - continue; - } - optionValues.push(option.value); - count++; - } - if (this.isMultiple) { - // multi-select - if (Array.isArray(this.value)) { - var selectValues = this.value; - var matcher_1 = this.element.matcher || defaultMatcher; - // remove items that are no longer selected. - var i = 0; - var _loop_2 = function () { - var a = selectValues[i]; - if (optionValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.splice(i, 1); - } - else { - i++; - } - }; - while (i < selectValues.length) { - _loop_2(); - } - // add items that have been selected. - i = 0; - var _loop_3 = function () { - var a = optionValues[i]; - if (selectValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.push(a); - } - i++; - }; - while (i < optionValues.length) { - _loop_3(); - } - this.resolveDisplayValue(); - return; // don't notify. - } - } - else { - // single-select - // tslint:disable-next-line:prefer-conditional-expression - if (count === 0) { - optionValues = null; - } - else { - optionValues = optionValues[0]; - } - this.setValue(optionValues); - } - }; - UxSelect.prototype.setupListAnchor = function () { - var _this = this; - this.calcAnchorPosition(); - this.winEvents.subscribe('wheel', function (e) { - if (_this.expanded) { - if (e.target === aurelia_framework_1.PLATFORM.global || !_this.optionWrapperEl.contains(e.target)) { - _this.collapse(); - } - } - }, true); - }; - UxSelect.prototype.unsetupListAnchor = function () { - this.listAnchor = null; - this.winEvents.disposeAll(); - }; - UxSelect.prototype.calcAnchorPosition = function () { - var elDim = this.container.getBoundingClientRect(); - var offsetY = (48 - elDim.height) / 2; - this.listAnchor = { x: elDim.left, y: elDim.top - offsetY }; - }; - UxSelect.prototype.onKeyboardSelect = function () { - if (!this.expanded) { - return; - } - var focusedOption = this.focusedUxOption; - if (this.isMultiple) { - if (!focusedOption) { - return; - } - focusedOption.selected = !focusedOption.selected; - } - else { - this.collapse(); - } - }; - UxSelect.prototype.call = function () { - this.synchronizeOptions(); - }; - UxSelect.prototype.getValue = function () { - return this.value; - }; - UxSelect.prototype.setValue = function (newValue) { - if (newValue !== null && newValue !== undefined && this.isMultiple && !Array.isArray(newValue)) { - throw new Error('Only null, undenfined or Array instances can be bound to a multi-select.'); - } - if (this.value === newValue) { - return; - } - // unsubscribe from old array. - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - if (this.isMultiple) { - // subscribe to new array. - if (Array.isArray(newValue)) { - this.arrayObserver = this.observerLocator.getArrayObserver(newValue); - this.arrayObserver.subscribe(selectArrayContext, this); - } - } - if (newValue !== this.value) { - this.value = newValue; - this.resolveDisplayValue(); - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSelect.prototype.expand = function () { - var _this = this; - if (this.expanded) { - return; - } - if (this.isExpanding) { - return; - } - this.isExpanding = true; - this.optionWrapperEl.classList.add('open'); - setTimeout(function () { - _this.optionCtEl.classList.add('open'); - _this.isExpanding = false; - _this.expanded = true; - _this.setFocusedOption(_this.selectedOption); - }, this.theme.listTransition); - this.setupListAnchor(); - }; - UxSelect.prototype.collapse = function () { - var _this = this; - if (this.isCollapsing) { - return; - } - this.isCollapsing = true; - this.optionCtEl.classList.remove('open'); - setTimeout(function () { - _this.optionWrapperEl.classList.remove('open'); - _this.isCollapsing = false; - _this.expanded = false; - _this.setFocusedOption(null); - _this.unsetupListAnchor(); - }, this.theme.listTransition); - }; - UxSelect.prototype.setFocusedOption = function (focusedOption) { - var oldFocusedOption = this.focusedUxOption; - if (focusedOption !== oldFocusedOption) { - if (oldFocusedOption) { - oldFocusedOption.focused = false; - } - if (focusedOption) { - focusedOption.focused = true; - focusedOption.wave(); - focusedOption.scrollIntoView({ block: 'nearest', inline: 'nearest' }); - } - this.focusedUxOption = focusedOption; - } - }; - UxSelect.prototype.moveSelectedIndex = function (offset) { - var currentIndex = 0; - var options = this.options; - if (this.focusedUxOption) { - currentIndex = options.indexOf(this.focusedUxOption); - } - else if (this.selectedOption) { - currentIndex = options.indexOf(this.selectedOption); - } - var nextIndex = currentIndex + offset; - if (nextIndex > options.length - 1) { - nextIndex = options.length - 1; - } - if (nextIndex < 0) { - nextIndex = 0; - } - var focusedOption = options[nextIndex]; - if (focusedOption.disabled) { - if (offset > 0) { - if (nextIndex === options.length - 1) { - return; - } - this.moveSelectedIndex(offset + 1); - } - else { - if (nextIndex < 0) { - return; - } - this.moveSelectedIndex(offset - 1); - } - return; - } - this.setFocusedOption(focusedOption); - focusedOption.focused = true; - if (this.isMultiple) { - // empty - } - else { - this.ignoreSelectEvent = true; - if (this.selectedOption) { - this.selectedOption.selected = false; - } - this.selectedOption = focusedOption; - this.selectedOption.selected = true; - this.ignoreSelectEvent = false; - this.setValue(this.selectedOption.value); - } - }; - UxSelect.prototype.onTriggerClick = function () { - if (!this.isDisabled) { - if (this.expanded) { - return; - } - this.expand(); - } - }; - UxSelect.prototype.onBlur = function () { - if (!this.element.contains(aurelia_framework_1.DOM.activeElement)) { - this.collapse(); - } - }; - UxSelect.prototype.onSelect = function (e) { - e.stopPropagation(); - if (this.ignoreSelectEvent) { - return; - } - var newSelection = e.detail; - var lastSelection = this.selectedOption; - if (this.isMultiple) { - this.synchronizeValue(); - } - else { - this.ignoreSelectEvent = true; - if (lastSelection) { - lastSelection.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = newSelection; - this.setValue(newSelection.value); - if (this.expanded) { - this.collapse(); - } - } - }; - UxSelect.prototype.onKeyDown = function (key) { - if (this.isDisabled) { - return; - } - // tslint:disable-next-line:switch-default - switch (key) { - case UP: - case DOWN: - this.moveSelectedIndex(key === UP ? -1 : 1); - break; - case ENTER: - case SPACE: - this.onKeyboardSelect(); - break; - } - return true; - }; - UxSelect.prototype.themeChanged = function (newValue) { - if (newValue && !newValue.themeKey) { - newValue.themeKey = 'ux-select'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSelect.prototype.multipleChanged = function (newValue, oldValue) { - newValue = util_1.bool(newValue); - oldValue = util_1.bool(oldValue); - var hasChanged = newValue !== oldValue; - if (hasChanged) { - this.ignoreSelectEvent = true; - for (var _i = 0, _a = this.options; _i < _a.length; _i++) { - var opt = _a[_i]; - opt.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = null; - this.setValue(newValue - ? [] // Changing from single to multiple = reset value to empty array - : null // Changing from multiple to single = reset value to null - ); - } - }; - Object.defineProperty(UxSelect.prototype, "options", { - get: function () { - if (!this.optionCtEl) { - return []; - } - var result = []; - var children = this.optionCtEl.children; - var ii = children.length; - for (var i = 0; ii > i; ++i) { - var element = children[i]; - if (element.nodeName === 'UX-OPTION') { - result.push(element); - } - else if (element.nodeName === 'UX-OPTGROUP') { - var groupOptions = element.options; - var jj = groupOptions.length; - for (var j = 0; jj > j; ++j) { - result.push(groupOptions[j]); - } - } - } - return result; - }, - enumerable: true, - configurable: true - }); - UxSelect.prototype.getOptions = function () { - return this.options; - }; - Object.defineProperty(UxSelect.prototype, "isMultiple", { - get: function () { - return util_1.bool(this.multiple); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(UxSelect.prototype, "isDisabled", { - get: function () { - return util_1.bool(this.disabled); - }, - enumerable: true, - configurable: true - }); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "autofocus", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "disabled", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "multiple", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "placeholder", void 0); - __decorate([ - aurelia_framework_1.computedFrom('multiple') - ], UxSelect.prototype, "isMultiple", null); - __decorate([ - aurelia_framework_1.computedFrom('disabled') - ], UxSelect.prototype, "isDisabled", null); - UxSelect = __decorate([ - aurelia_framework_1.inject(Element, core_1.StyleEngine, aurelia_framework_1.ObserverLocator, aurelia_framework_1.TaskQueue), - aurelia_framework_1.processContent(extractUxOption), - aurelia_framework_1.customElement('ux-select') - // @inlineView(UX_SELECT_VIEW) - ], UxSelect); - return UxSelect; - }()); - exports.UxSelect = UxSelect; - function extractUxOption(_, __, node) { - if (node.hasAttribute('containerless')) { - logger.warn('cannot use containerless on . Consider using as-element instead.'); - node.removeAttribute('containerless'); - } - var currentChild = node.firstChild; - while (currentChild) { - var nextSibling = currentChild.nextSibling; - if (currentChild.nodeName === 'UX-OPTION' || currentChild.nodeName === 'UX-OPTGROUP') { - currentChild = nextSibling; - continue; - } - node.removeChild(currentChild); - currentChild = nextSibling; - } - return true; - } - var UxSelectElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return util_1.getAuViewModel(this).getValue(); - }, - set: function (v) { - return util_1.getAuViewModel(this).setValue(v); - } - }, - options: { - get: function () { - return util_1.getAuViewModel(this).getOptions(); - } - } - }); - function defaultMatcher(a, b) { - return a === b; - } -}); diff --git a/packages/select/dist/commonjs/ux-select.js b/packages/select/dist/commonjs/ux-select.js deleted file mode 100644 index 7be18ab3..00000000 --- a/packages/select/dist/commonjs/ux-select.js +++ /dev/null @@ -1,491 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_framework_1 = require("aurelia-framework"); -var aurelia_logging_1 = require("aurelia-logging"); -var core_1 = require("@aurelia-ux/core"); -var util_1 = require("./util"); -var UP = 38; -// const RIGHT = 39; -var DOWN = 40; -// const LEFT = 37; -// const ESC = 27; -var ENTER = 13; -var SPACE = 32; -var logger = aurelia_logging_1.getLogger('ux-select'); -var invalidMultipleValueMsg = 'Only null or Array instances can be bound to a multi-select'; -var selectArrayContext = 'context:ux-select'; -var UxSelect = /** @class */ (function () { - function UxSelect(element, styleEngine, observerLocator, taskQueue) { - this.element = element; - this.styleEngine = styleEngine; - this.observerLocator = observerLocator; - this.taskQueue = taskQueue; - this.selectedOption = null; - this.ignoreSelectEvent = true; - // Only chrome persist the element prototype when cloning with clone node - Object.setPrototypeOf(element, UxSelectElementProto); - } - UxSelect.prototype.bind = function () { - if (util_1.bool(this.autofocus)) { - // setTimeout(focusEl, 0, this.button); - } - if (this.isMultiple) { - if (!this.value) { - this.value = []; - } - else if (!Array.isArray(this.value)) { - throw new Error(invalidMultipleValueMsg); - } - } - if (!this.winEvents) { - this.winEvents = new aurelia_framework_1.ElementEvents(window); - } - // Initially Synchronize options with value of this element - this.taskQueue.queueMicroTask(this); - }; - UxSelect.prototype.unbind = function () { - this.winEvents.disposeAll(); - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - this.selectedOption = null; - }; - UxSelect.prototype.resolveDisplayValue = function () { - var value = this.value; - this.displayValue = Array.isArray(value) ? value.slice().sort().join(', ') : value; - }; - UxSelect.prototype.synchronizeOptions = function () { - var value = this.value; - var isArray = Array.isArray(value); - var options = this.options; - var matcher = this.element.matcher || defaultMatcher; - var i = options.length; - this.ignoreSelectEvent = true; - var _loop_1 = function () { - var option = options[i]; - var optionValue = option.value; - if (isArray) { - option.selected = value.findIndex(function (item) { return !!matcher(optionValue, item); }) !== -1; - return "continue"; - } - option.selected = !!matcher(optionValue, value); - }; - while (i--) { - _loop_1(); - } - this.ignoreSelectEvent = false; - }; - UxSelect.prototype.synchronizeValue = function () { - var options = this.options; - var ii = options.length; - var count = 0; - var optionValues = []; - // extract value from ux-option - for (var i = 0; i < ii; i++) { - var option = options[i]; - if (!option.selected) { - continue; - } - optionValues.push(option.value); - count++; - } - if (this.isMultiple) { - // multi-select - if (Array.isArray(this.value)) { - var selectValues = this.value; - var matcher_1 = this.element.matcher || defaultMatcher; - // remove items that are no longer selected. - var i = 0; - var _loop_2 = function () { - var a = selectValues[i]; - if (optionValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.splice(i, 1); - } - else { - i++; - } - }; - while (i < selectValues.length) { - _loop_2(); - } - // add items that have been selected. - i = 0; - var _loop_3 = function () { - var a = optionValues[i]; - if (selectValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.push(a); - } - i++; - }; - while (i < optionValues.length) { - _loop_3(); - } - this.resolveDisplayValue(); - return; // don't notify. - } - } - else { - // single-select - // tslint:disable-next-line:prefer-conditional-expression - if (count === 0) { - optionValues = null; - } - else { - optionValues = optionValues[0]; - } - this.setValue(optionValues); - } - }; - UxSelect.prototype.setupListAnchor = function () { - var _this = this; - this.calcAnchorPosition(); - this.winEvents.subscribe('wheel', function (e) { - if (_this.expanded) { - if (e.target === aurelia_framework_1.PLATFORM.global || !_this.optionWrapperEl.contains(e.target)) { - _this.collapse(); - } - } - }, true); - }; - UxSelect.prototype.unsetupListAnchor = function () { - this.listAnchor = null; - this.winEvents.disposeAll(); - }; - UxSelect.prototype.calcAnchorPosition = function () { - var elDim = this.container.getBoundingClientRect(); - var offsetY = (48 - elDim.height) / 2; - this.listAnchor = { x: elDim.left, y: elDim.top - offsetY }; - }; - UxSelect.prototype.onKeyboardSelect = function () { - if (!this.expanded) { - return; - } - var focusedOption = this.focusedUxOption; - if (this.isMultiple) { - if (!focusedOption) { - return; - } - focusedOption.selected = !focusedOption.selected; - } - else { - this.collapse(); - } - }; - UxSelect.prototype.call = function () { - this.synchronizeOptions(); - }; - UxSelect.prototype.getValue = function () { - return this.value; - }; - UxSelect.prototype.setValue = function (newValue) { - if (newValue !== null && newValue !== undefined && this.isMultiple && !Array.isArray(newValue)) { - throw new Error('Only null, undenfined or Array instances can be bound to a multi-select.'); - } - if (this.value === newValue) { - return; - } - // unsubscribe from old array. - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - if (this.isMultiple) { - // subscribe to new array. - if (Array.isArray(newValue)) { - this.arrayObserver = this.observerLocator.getArrayObserver(newValue); - this.arrayObserver.subscribe(selectArrayContext, this); - } - } - if (newValue !== this.value) { - this.value = newValue; - this.resolveDisplayValue(); - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSelect.prototype.expand = function () { - var _this = this; - if (this.expanded) { - return; - } - if (this.isExpanding) { - return; - } - this.isExpanding = true; - this.optionWrapperEl.classList.add('open'); - setTimeout(function () { - _this.optionCtEl.classList.add('open'); - _this.isExpanding = false; - _this.expanded = true; - _this.setFocusedOption(_this.selectedOption); - }, this.theme.listTransition); - this.setupListAnchor(); - }; - UxSelect.prototype.collapse = function () { - var _this = this; - if (this.isCollapsing) { - return; - } - this.isCollapsing = true; - this.optionCtEl.classList.remove('open'); - setTimeout(function () { - _this.optionWrapperEl.classList.remove('open'); - _this.isCollapsing = false; - _this.expanded = false; - _this.setFocusedOption(null); - _this.unsetupListAnchor(); - }, this.theme.listTransition); - }; - UxSelect.prototype.setFocusedOption = function (focusedOption) { - var oldFocusedOption = this.focusedUxOption; - if (focusedOption !== oldFocusedOption) { - if (oldFocusedOption) { - oldFocusedOption.focused = false; - } - if (focusedOption) { - focusedOption.focused = true; - focusedOption.wave(); - focusedOption.scrollIntoView({ block: 'nearest', inline: 'nearest' }); - } - this.focusedUxOption = focusedOption; - } - }; - UxSelect.prototype.moveSelectedIndex = function (offset) { - var currentIndex = 0; - var options = this.options; - if (this.focusedUxOption) { - currentIndex = options.indexOf(this.focusedUxOption); - } - else if (this.selectedOption) { - currentIndex = options.indexOf(this.selectedOption); - } - var nextIndex = currentIndex + offset; - if (nextIndex > options.length - 1) { - nextIndex = options.length - 1; - } - if (nextIndex < 0) { - nextIndex = 0; - } - var focusedOption = options[nextIndex]; - if (focusedOption.disabled) { - if (offset > 0) { - if (nextIndex === options.length - 1) { - return; - } - this.moveSelectedIndex(offset + 1); - } - else { - if (nextIndex < 0) { - return; - } - this.moveSelectedIndex(offset - 1); - } - return; - } - this.setFocusedOption(focusedOption); - focusedOption.focused = true; - if (this.isMultiple) { - // empty - } - else { - this.ignoreSelectEvent = true; - if (this.selectedOption) { - this.selectedOption.selected = false; - } - this.selectedOption = focusedOption; - this.selectedOption.selected = true; - this.ignoreSelectEvent = false; - this.setValue(this.selectedOption.value); - } - }; - UxSelect.prototype.onTriggerClick = function () { - if (!this.isDisabled) { - if (this.expanded) { - return; - } - this.expand(); - } - }; - UxSelect.prototype.onBlur = function () { - if (!this.element.contains(aurelia_framework_1.DOM.activeElement)) { - this.collapse(); - } - }; - UxSelect.prototype.onSelect = function (e) { - e.stopPropagation(); - if (this.ignoreSelectEvent) { - return; - } - var newSelection = e.detail; - var lastSelection = this.selectedOption; - if (this.isMultiple) { - this.synchronizeValue(); - } - else { - this.ignoreSelectEvent = true; - if (lastSelection) { - lastSelection.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = newSelection; - this.setValue(newSelection.value); - if (this.expanded) { - this.collapse(); - } - } - }; - UxSelect.prototype.onKeyDown = function (key) { - if (this.isDisabled) { - return; - } - // tslint:disable-next-line:switch-default - switch (key) { - case UP: - case DOWN: - this.moveSelectedIndex(key === UP ? -1 : 1); - break; - case ENTER: - case SPACE: - this.onKeyboardSelect(); - break; - } - return true; - }; - UxSelect.prototype.themeChanged = function (newValue) { - if (newValue && !newValue.themeKey) { - newValue.themeKey = 'ux-select'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSelect.prototype.multipleChanged = function (newValue, oldValue) { - newValue = util_1.bool(newValue); - oldValue = util_1.bool(oldValue); - var hasChanged = newValue !== oldValue; - if (hasChanged) { - this.ignoreSelectEvent = true; - for (var _i = 0, _a = this.options; _i < _a.length; _i++) { - var opt = _a[_i]; - opt.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = null; - this.setValue(newValue - ? [] // Changing from single to multiple = reset value to empty array - : null // Changing from multiple to single = reset value to null - ); - } - }; - Object.defineProperty(UxSelect.prototype, "options", { - get: function () { - if (!this.optionCtEl) { - return []; - } - var result = []; - var children = this.optionCtEl.children; - var ii = children.length; - for (var i = 0; ii > i; ++i) { - var element = children[i]; - if (element.nodeName === 'UX-OPTION') { - result.push(element); - } - else if (element.nodeName === 'UX-OPTGROUP') { - var groupOptions = element.options; - var jj = groupOptions.length; - for (var j = 0; jj > j; ++j) { - result.push(groupOptions[j]); - } - } - } - return result; - }, - enumerable: true, - configurable: true - }); - UxSelect.prototype.getOptions = function () { - return this.options; - }; - Object.defineProperty(UxSelect.prototype, "isMultiple", { - get: function () { - return util_1.bool(this.multiple); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(UxSelect.prototype, "isDisabled", { - get: function () { - return util_1.bool(this.disabled); - }, - enumerable: true, - configurable: true - }); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "autofocus", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "disabled", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "multiple", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "placeholder", void 0); - __decorate([ - aurelia_framework_1.computedFrom('multiple') - ], UxSelect.prototype, "isMultiple", null); - __decorate([ - aurelia_framework_1.computedFrom('disabled') - ], UxSelect.prototype, "isDisabled", null); - UxSelect = __decorate([ - aurelia_framework_1.inject(Element, core_1.StyleEngine, aurelia_framework_1.ObserverLocator, aurelia_framework_1.TaskQueue), - aurelia_framework_1.processContent(extractUxOption), - aurelia_framework_1.customElement('ux-select') - // @inlineView(UX_SELECT_VIEW) - ], UxSelect); - return UxSelect; -}()); -exports.UxSelect = UxSelect; -function extractUxOption(_, __, node) { - if (node.hasAttribute('containerless')) { - logger.warn('cannot use containerless on . Consider using as-element instead.'); - node.removeAttribute('containerless'); - } - var currentChild = node.firstChild; - while (currentChild) { - var nextSibling = currentChild.nextSibling; - if (currentChild.nodeName === 'UX-OPTION' || currentChild.nodeName === 'UX-OPTGROUP') { - currentChild = nextSibling; - continue; - } - node.removeChild(currentChild); - currentChild = nextSibling; - } - return true; -} -var UxSelectElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return util_1.getAuViewModel(this).getValue(); - }, - set: function (v) { - return util_1.getAuViewModel(this).setValue(v); - } - }, - options: { - get: function () { - return util_1.getAuViewModel(this).getOptions(); - } - } -}); -function defaultMatcher(a, b) { - return a === b; -} diff --git a/packages/select/dist/es2015/ux-select.js b/packages/select/dist/es2015/ux-select.js deleted file mode 100644 index c3335438..00000000 --- a/packages/select/dist/es2015/ux-select.js +++ /dev/null @@ -1,465 +0,0 @@ -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; -}; -import { customElement, bindable, computedFrom, DOM, processContent, ElementEvents, inject, PLATFORM, ObserverLocator, TaskQueue, } from 'aurelia-framework'; -import { getLogger } from 'aurelia-logging'; -import { StyleEngine } from '@aurelia-ux/core'; -import { getAuViewModel, bool } from './util'; -const UP = 38; -// const RIGHT = 39; -const DOWN = 40; -// const LEFT = 37; -// const ESC = 27; -const ENTER = 13; -const SPACE = 32; -const logger = getLogger('ux-select'); -const invalidMultipleValueMsg = 'Only null or Array instances can be bound to a multi-select'; -const selectArrayContext = 'context:ux-select'; -let UxSelect = -// @inlineView(UX_SELECT_VIEW) -class UxSelect { - constructor(element, styleEngine, observerLocator, taskQueue) { - this.element = element; - this.styleEngine = styleEngine; - this.observerLocator = observerLocator; - this.taskQueue = taskQueue; - this.selectedOption = null; - this.ignoreSelectEvent = true; - // Only chrome persist the element prototype when cloning with clone node - Object.setPrototypeOf(element, UxSelectElementProto); - } - bind() { - if (bool(this.autofocus)) { - // setTimeout(focusEl, 0, this.button); - } - if (this.isMultiple) { - if (!this.value) { - this.value = []; - } - else if (!Array.isArray(this.value)) { - throw new Error(invalidMultipleValueMsg); - } - } - if (!this.winEvents) { - this.winEvents = new ElementEvents(window); - } - // Initially Synchronize options with value of this element - this.taskQueue.queueMicroTask(this); - } - unbind() { - this.winEvents.disposeAll(); - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - this.selectedOption = null; - } - resolveDisplayValue() { - const value = this.value; - this.displayValue = Array.isArray(value) ? value.slice().sort().join(', ') : value; - } - synchronizeOptions() { - const value = this.value; - const isArray = Array.isArray(value); - const options = this.options; - const matcher = this.element.matcher || defaultMatcher; - let i = options.length; - this.ignoreSelectEvent = true; - while (i--) { - const option = options[i]; - const optionValue = option.value; - if (isArray) { - option.selected = value.findIndex((item) => !!matcher(optionValue, item)) !== -1; - continue; - } - option.selected = !!matcher(optionValue, value); - } - this.ignoreSelectEvent = false; - } - synchronizeValue() { - const options = this.options; - const ii = options.length; - let count = 0; - let optionValues = []; - // extract value from ux-option - for (let i = 0; i < ii; i++) { - const option = options[i]; - if (!option.selected) { - continue; - } - optionValues.push(option.value); - count++; - } - if (this.isMultiple) { - // multi-select - if (Array.isArray(this.value)) { - const selectValues = this.value; - const matcher = this.element.matcher || defaultMatcher; - // remove items that are no longer selected. - let i = 0; - while (i < selectValues.length) { - const a = selectValues[i]; - if (optionValues.findIndex(b => matcher(a, b)) === -1) { - selectValues.splice(i, 1); - } - else { - i++; - } - } - // add items that have been selected. - i = 0; - while (i < optionValues.length) { - const a = optionValues[i]; - if (selectValues.findIndex(b => matcher(a, b)) === -1) { - selectValues.push(a); - } - i++; - } - this.resolveDisplayValue(); - return; // don't notify. - } - } - else { - // single-select - // tslint:disable-next-line:prefer-conditional-expression - if (count === 0) { - optionValues = null; - } - else { - optionValues = optionValues[0]; - } - this.setValue(optionValues); - } - } - setupListAnchor() { - this.calcAnchorPosition(); - this.winEvents.subscribe('wheel', (e) => { - if (this.expanded) { - if (e.target === PLATFORM.global || !this.optionWrapperEl.contains(e.target)) { - this.collapse(); - } - } - }, true); - } - unsetupListAnchor() { - this.listAnchor = null; - this.winEvents.disposeAll(); - } - calcAnchorPosition() { - const elDim = this.container.getBoundingClientRect(); - const offsetY = (48 - elDim.height) / 2; - this.listAnchor = { x: elDim.left, y: elDim.top - offsetY }; - } - onKeyboardSelect() { - if (!this.expanded) { - return; - } - const focusedOption = this.focusedUxOption; - if (this.isMultiple) { - if (!focusedOption) { - return; - } - focusedOption.selected = !focusedOption.selected; - } - else { - this.collapse(); - } - } - call() { - this.synchronizeOptions(); - } - getValue() { - return this.value; - } - setValue(newValue) { - if (newValue !== null && newValue !== undefined && this.isMultiple && !Array.isArray(newValue)) { - throw new Error('Only null, undenfined or Array instances can be bound to a multi-select.'); - } - if (this.value === newValue) { - return; - } - // unsubscribe from old array. - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - if (this.isMultiple) { - // subscribe to new array. - if (Array.isArray(newValue)) { - this.arrayObserver = this.observerLocator.getArrayObserver(newValue); - this.arrayObserver.subscribe(selectArrayContext, this); - } - } - if (newValue !== this.value) { - this.value = newValue; - this.resolveDisplayValue(); - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - expand() { - if (this.expanded) { - return; - } - if (this.isExpanding) { - return; - } - this.isExpanding = true; - this.optionWrapperEl.classList.add('open'); - setTimeout(() => { - this.optionCtEl.classList.add('open'); - this.isExpanding = false; - this.expanded = true; - this.setFocusedOption(this.selectedOption); - }, this.theme.listTransition); - this.setupListAnchor(); - } - collapse() { - if (this.isCollapsing) { - return; - } - this.isCollapsing = true; - this.optionCtEl.classList.remove('open'); - setTimeout(() => { - this.optionWrapperEl.classList.remove('open'); - this.isCollapsing = false; - this.expanded = false; - this.setFocusedOption(null); - this.unsetupListAnchor(); - }, this.theme.listTransition); - } - setFocusedOption(focusedOption) { - const oldFocusedOption = this.focusedUxOption; - if (focusedOption !== oldFocusedOption) { - if (oldFocusedOption) { - oldFocusedOption.focused = false; - } - if (focusedOption) { - focusedOption.focused = true; - focusedOption.wave(); - focusedOption.scrollIntoView({ block: 'nearest', inline: 'nearest' }); - } - this.focusedUxOption = focusedOption; - } - } - moveSelectedIndex(offset) { - let currentIndex = 0; - const options = this.options; - if (this.focusedUxOption) { - currentIndex = options.indexOf(this.focusedUxOption); - } - else if (this.selectedOption) { - currentIndex = options.indexOf(this.selectedOption); - } - let nextIndex = currentIndex + offset; - if (nextIndex > options.length - 1) { - nextIndex = options.length - 1; - } - if (nextIndex < 0) { - nextIndex = 0; - } - const focusedOption = options[nextIndex]; - if (focusedOption.disabled) { - if (offset > 0) { - if (nextIndex === options.length - 1) { - return; - } - this.moveSelectedIndex(offset + 1); - } - else { - if (nextIndex < 0) { - return; - } - this.moveSelectedIndex(offset - 1); - } - return; - } - this.setFocusedOption(focusedOption); - focusedOption.focused = true; - if (this.isMultiple) { - // empty - } - else { - this.ignoreSelectEvent = true; - if (this.selectedOption) { - this.selectedOption.selected = false; - } - this.selectedOption = focusedOption; - this.selectedOption.selected = true; - this.ignoreSelectEvent = false; - this.setValue(this.selectedOption.value); - } - } - onTriggerClick() { - if (!this.isDisabled) { - if (this.expanded) { - return; - } - this.expand(); - } - } - onBlur() { - if (!this.element.contains(DOM.activeElement)) { - this.collapse(); - } - } - onSelect(e) { - e.stopPropagation(); - if (this.ignoreSelectEvent) { - return; - } - const newSelection = e.detail; - const lastSelection = this.selectedOption; - if (this.isMultiple) { - this.synchronizeValue(); - } - else { - this.ignoreSelectEvent = true; - if (lastSelection) { - lastSelection.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = newSelection; - this.setValue(newSelection.value); - if (this.expanded) { - this.collapse(); - } - } - } - onKeyDown(key) { - if (this.isDisabled) { - return; - } - // tslint:disable-next-line:switch-default - switch (key) { - case UP: - case DOWN: - this.moveSelectedIndex(key === UP ? -1 : 1); - break; - case ENTER: - case SPACE: - this.onKeyboardSelect(); - break; - } - return true; - } - themeChanged(newValue) { - if (newValue && !newValue.themeKey) { - newValue.themeKey = 'ux-select'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - multipleChanged(newValue, oldValue) { - newValue = bool(newValue); - oldValue = bool(oldValue); - const hasChanged = newValue !== oldValue; - if (hasChanged) { - this.ignoreSelectEvent = true; - for (const opt of this.options) { - opt.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = null; - this.setValue(newValue - ? [] // Changing from single to multiple = reset value to empty array - : null // Changing from multiple to single = reset value to null - ); - } - } - get options() { - if (!this.optionCtEl) { - return []; - } - const result = []; - const children = this.optionCtEl.children; - const ii = children.length; - for (let i = 0; ii > i; ++i) { - const element = children[i]; - if (element.nodeName === 'UX-OPTION') { - result.push(element); - } - else if (element.nodeName === 'UX-OPTGROUP') { - const groupOptions = element.options; - const jj = groupOptions.length; - for (let j = 0; jj > j; ++j) { - result.push(groupOptions[j]); - } - } - } - return result; - } - getOptions() { - return this.options; - } - get isMultiple() { - return bool(this.multiple); - } - get isDisabled() { - return bool(this.disabled); - } -}; -__decorate([ - bindable() -], UxSelect.prototype, "theme", void 0); -__decorate([ - bindable() -], UxSelect.prototype, "autofocus", void 0); -__decorate([ - bindable({ defaultValue: false }) -], UxSelect.prototype, "disabled", void 0); -__decorate([ - bindable({ defaultValue: false }) -], UxSelect.prototype, "multiple", void 0); -__decorate([ - bindable() -], UxSelect.prototype, "placeholder", void 0); -__decorate([ - computedFrom('multiple') -], UxSelect.prototype, "isMultiple", null); -__decorate([ - computedFrom('disabled') -], UxSelect.prototype, "isDisabled", null); -UxSelect = __decorate([ - inject(Element, StyleEngine, ObserverLocator, TaskQueue), - processContent(extractUxOption), - customElement('ux-select') - // @inlineView(UX_SELECT_VIEW) -], UxSelect); -export { UxSelect }; -function extractUxOption(_, __, node) { - if (node.hasAttribute('containerless')) { - logger.warn('cannot use containerless on . Consider using as-element instead.'); - node.removeAttribute('containerless'); - } - let currentChild = node.firstChild; - while (currentChild) { - const nextSibling = currentChild.nextSibling; - if (currentChild.nodeName === 'UX-OPTION' || currentChild.nodeName === 'UX-OPTGROUP') { - currentChild = nextSibling; - continue; - } - node.removeChild(currentChild); - currentChild = nextSibling; - } - return true; -} -const UxSelectElementProto = Object.create(HTMLElement.prototype, { - value: { - get() { - return getAuViewModel(this).getValue(); - }, - set(v) { - return getAuViewModel(this).setValue(v); - } - }, - options: { - get() { - return getAuViewModel(this).getOptions(); - } - } -}); -function defaultMatcher(a, b) { - return a === b; -} diff --git a/packages/select/dist/native-modules/ux-select.js b/packages/select/dist/native-modules/ux-select.js deleted file mode 100644 index 9e4b5233..00000000 --- a/packages/select/dist/native-modules/ux-select.js +++ /dev/null @@ -1,489 +0,0 @@ -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; -}; -import { customElement, bindable, computedFrom, DOM, processContent, ElementEvents, inject, PLATFORM, ObserverLocator, TaskQueue, } from 'aurelia-framework'; -import { getLogger } from 'aurelia-logging'; -import { StyleEngine } from '@aurelia-ux/core'; -import { getAuViewModel, bool } from './util'; -var UP = 38; -// const RIGHT = 39; -var DOWN = 40; -// const LEFT = 37; -// const ESC = 27; -var ENTER = 13; -var SPACE = 32; -var logger = getLogger('ux-select'); -var invalidMultipleValueMsg = 'Only null or Array instances can be bound to a multi-select'; -var selectArrayContext = 'context:ux-select'; -var UxSelect = /** @class */ (function () { - function UxSelect(element, styleEngine, observerLocator, taskQueue) { - this.element = element; - this.styleEngine = styleEngine; - this.observerLocator = observerLocator; - this.taskQueue = taskQueue; - this.selectedOption = null; - this.ignoreSelectEvent = true; - // Only chrome persist the element prototype when cloning with clone node - Object.setPrototypeOf(element, UxSelectElementProto); - } - UxSelect.prototype.bind = function () { - if (bool(this.autofocus)) { - // setTimeout(focusEl, 0, this.button); - } - if (this.isMultiple) { - if (!this.value) { - this.value = []; - } - else if (!Array.isArray(this.value)) { - throw new Error(invalidMultipleValueMsg); - } - } - if (!this.winEvents) { - this.winEvents = new ElementEvents(window); - } - // Initially Synchronize options with value of this element - this.taskQueue.queueMicroTask(this); - }; - UxSelect.prototype.unbind = function () { - this.winEvents.disposeAll(); - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - this.selectedOption = null; - }; - UxSelect.prototype.resolveDisplayValue = function () { - var value = this.value; - this.displayValue = Array.isArray(value) ? value.slice().sort().join(', ') : value; - }; - UxSelect.prototype.synchronizeOptions = function () { - var value = this.value; - var isArray = Array.isArray(value); - var options = this.options; - var matcher = this.element.matcher || defaultMatcher; - var i = options.length; - this.ignoreSelectEvent = true; - var _loop_1 = function () { - var option = options[i]; - var optionValue = option.value; - if (isArray) { - option.selected = value.findIndex(function (item) { return !!matcher(optionValue, item); }) !== -1; - return "continue"; - } - option.selected = !!matcher(optionValue, value); - }; - while (i--) { - _loop_1(); - } - this.ignoreSelectEvent = false; - }; - UxSelect.prototype.synchronizeValue = function () { - var options = this.options; - var ii = options.length; - var count = 0; - var optionValues = []; - // extract value from ux-option - for (var i = 0; i < ii; i++) { - var option = options[i]; - if (!option.selected) { - continue; - } - optionValues.push(option.value); - count++; - } - if (this.isMultiple) { - // multi-select - if (Array.isArray(this.value)) { - var selectValues = this.value; - var matcher_1 = this.element.matcher || defaultMatcher; - // remove items that are no longer selected. - var i = 0; - var _loop_2 = function () { - var a = selectValues[i]; - if (optionValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.splice(i, 1); - } - else { - i++; - } - }; - while (i < selectValues.length) { - _loop_2(); - } - // add items that have been selected. - i = 0; - var _loop_3 = function () { - var a = optionValues[i]; - if (selectValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.push(a); - } - i++; - }; - while (i < optionValues.length) { - _loop_3(); - } - this.resolveDisplayValue(); - return; // don't notify. - } - } - else { - // single-select - // tslint:disable-next-line:prefer-conditional-expression - if (count === 0) { - optionValues = null; - } - else { - optionValues = optionValues[0]; - } - this.setValue(optionValues); - } - }; - UxSelect.prototype.setupListAnchor = function () { - var _this = this; - this.calcAnchorPosition(); - this.winEvents.subscribe('wheel', function (e) { - if (_this.expanded) { - if (e.target === PLATFORM.global || !_this.optionWrapperEl.contains(e.target)) { - _this.collapse(); - } - } - }, true); - }; - UxSelect.prototype.unsetupListAnchor = function () { - this.listAnchor = null; - this.winEvents.disposeAll(); - }; - UxSelect.prototype.calcAnchorPosition = function () { - var elDim = this.container.getBoundingClientRect(); - var offsetY = (48 - elDim.height) / 2; - this.listAnchor = { x: elDim.left, y: elDim.top - offsetY }; - }; - UxSelect.prototype.onKeyboardSelect = function () { - if (!this.expanded) { - return; - } - var focusedOption = this.focusedUxOption; - if (this.isMultiple) { - if (!focusedOption) { - return; - } - focusedOption.selected = !focusedOption.selected; - } - else { - this.collapse(); - } - }; - UxSelect.prototype.call = function () { - this.synchronizeOptions(); - }; - UxSelect.prototype.getValue = function () { - return this.value; - }; - UxSelect.prototype.setValue = function (newValue) { - if (newValue !== null && newValue !== undefined && this.isMultiple && !Array.isArray(newValue)) { - throw new Error('Only null, undenfined or Array instances can be bound to a multi-select.'); - } - if (this.value === newValue) { - return; - } - // unsubscribe from old array. - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - if (this.isMultiple) { - // subscribe to new array. - if (Array.isArray(newValue)) { - this.arrayObserver = this.observerLocator.getArrayObserver(newValue); - this.arrayObserver.subscribe(selectArrayContext, this); - } - } - if (newValue !== this.value) { - this.value = newValue; - this.resolveDisplayValue(); - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSelect.prototype.expand = function () { - var _this = this; - if (this.expanded) { - return; - } - if (this.isExpanding) { - return; - } - this.isExpanding = true; - this.optionWrapperEl.classList.add('open'); - setTimeout(function () { - _this.optionCtEl.classList.add('open'); - _this.isExpanding = false; - _this.expanded = true; - _this.setFocusedOption(_this.selectedOption); - }, this.theme.listTransition); - this.setupListAnchor(); - }; - UxSelect.prototype.collapse = function () { - var _this = this; - if (this.isCollapsing) { - return; - } - this.isCollapsing = true; - this.optionCtEl.classList.remove('open'); - setTimeout(function () { - _this.optionWrapperEl.classList.remove('open'); - _this.isCollapsing = false; - _this.expanded = false; - _this.setFocusedOption(null); - _this.unsetupListAnchor(); - }, this.theme.listTransition); - }; - UxSelect.prototype.setFocusedOption = function (focusedOption) { - var oldFocusedOption = this.focusedUxOption; - if (focusedOption !== oldFocusedOption) { - if (oldFocusedOption) { - oldFocusedOption.focused = false; - } - if (focusedOption) { - focusedOption.focused = true; - focusedOption.wave(); - focusedOption.scrollIntoView({ block: 'nearest', inline: 'nearest' }); - } - this.focusedUxOption = focusedOption; - } - }; - UxSelect.prototype.moveSelectedIndex = function (offset) { - var currentIndex = 0; - var options = this.options; - if (this.focusedUxOption) { - currentIndex = options.indexOf(this.focusedUxOption); - } - else if (this.selectedOption) { - currentIndex = options.indexOf(this.selectedOption); - } - var nextIndex = currentIndex + offset; - if (nextIndex > options.length - 1) { - nextIndex = options.length - 1; - } - if (nextIndex < 0) { - nextIndex = 0; - } - var focusedOption = options[nextIndex]; - if (focusedOption.disabled) { - if (offset > 0) { - if (nextIndex === options.length - 1) { - return; - } - this.moveSelectedIndex(offset + 1); - } - else { - if (nextIndex < 0) { - return; - } - this.moveSelectedIndex(offset - 1); - } - return; - } - this.setFocusedOption(focusedOption); - focusedOption.focused = true; - if (this.isMultiple) { - // empty - } - else { - this.ignoreSelectEvent = true; - if (this.selectedOption) { - this.selectedOption.selected = false; - } - this.selectedOption = focusedOption; - this.selectedOption.selected = true; - this.ignoreSelectEvent = false; - this.setValue(this.selectedOption.value); - } - }; - UxSelect.prototype.onTriggerClick = function () { - if (!this.isDisabled) { - if (this.expanded) { - return; - } - this.expand(); - } - }; - UxSelect.prototype.onBlur = function () { - if (!this.element.contains(DOM.activeElement)) { - this.collapse(); - } - }; - UxSelect.prototype.onSelect = function (e) { - e.stopPropagation(); - if (this.ignoreSelectEvent) { - return; - } - var newSelection = e.detail; - var lastSelection = this.selectedOption; - if (this.isMultiple) { - this.synchronizeValue(); - } - else { - this.ignoreSelectEvent = true; - if (lastSelection) { - lastSelection.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = newSelection; - this.setValue(newSelection.value); - if (this.expanded) { - this.collapse(); - } - } - }; - UxSelect.prototype.onKeyDown = function (key) { - if (this.isDisabled) { - return; - } - // tslint:disable-next-line:switch-default - switch (key) { - case UP: - case DOWN: - this.moveSelectedIndex(key === UP ? -1 : 1); - break; - case ENTER: - case SPACE: - this.onKeyboardSelect(); - break; - } - return true; - }; - UxSelect.prototype.themeChanged = function (newValue) { - if (newValue && !newValue.themeKey) { - newValue.themeKey = 'ux-select'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSelect.prototype.multipleChanged = function (newValue, oldValue) { - newValue = bool(newValue); - oldValue = bool(oldValue); - var hasChanged = newValue !== oldValue; - if (hasChanged) { - this.ignoreSelectEvent = true; - for (var _i = 0, _a = this.options; _i < _a.length; _i++) { - var opt = _a[_i]; - opt.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = null; - this.setValue(newValue - ? [] // Changing from single to multiple = reset value to empty array - : null // Changing from multiple to single = reset value to null - ); - } - }; - Object.defineProperty(UxSelect.prototype, "options", { - get: function () { - if (!this.optionCtEl) { - return []; - } - var result = []; - var children = this.optionCtEl.children; - var ii = children.length; - for (var i = 0; ii > i; ++i) { - var element = children[i]; - if (element.nodeName === 'UX-OPTION') { - result.push(element); - } - else if (element.nodeName === 'UX-OPTGROUP') { - var groupOptions = element.options; - var jj = groupOptions.length; - for (var j = 0; jj > j; ++j) { - result.push(groupOptions[j]); - } - } - } - return result; - }, - enumerable: true, - configurable: true - }); - UxSelect.prototype.getOptions = function () { - return this.options; - }; - Object.defineProperty(UxSelect.prototype, "isMultiple", { - get: function () { - return bool(this.multiple); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(UxSelect.prototype, "isDisabled", { - get: function () { - return bool(this.disabled); - }, - enumerable: true, - configurable: true - }); - __decorate([ - bindable() - ], UxSelect.prototype, "theme", void 0); - __decorate([ - bindable() - ], UxSelect.prototype, "autofocus", void 0); - __decorate([ - bindable({ defaultValue: false }) - ], UxSelect.prototype, "disabled", void 0); - __decorate([ - bindable({ defaultValue: false }) - ], UxSelect.prototype, "multiple", void 0); - __decorate([ - bindable() - ], UxSelect.prototype, "placeholder", void 0); - __decorate([ - computedFrom('multiple') - ], UxSelect.prototype, "isMultiple", null); - __decorate([ - computedFrom('disabled') - ], UxSelect.prototype, "isDisabled", null); - UxSelect = __decorate([ - inject(Element, StyleEngine, ObserverLocator, TaskQueue), - processContent(extractUxOption), - customElement('ux-select') - // @inlineView(UX_SELECT_VIEW) - ], UxSelect); - return UxSelect; -}()); -export { UxSelect }; -function extractUxOption(_, __, node) { - if (node.hasAttribute('containerless')) { - logger.warn('cannot use containerless on . Consider using as-element instead.'); - node.removeAttribute('containerless'); - } - var currentChild = node.firstChild; - while (currentChild) { - var nextSibling = currentChild.nextSibling; - if (currentChild.nodeName === 'UX-OPTION' || currentChild.nodeName === 'UX-OPTGROUP') { - currentChild = nextSibling; - continue; - } - node.removeChild(currentChild); - currentChild = nextSibling; - } - return true; -} -var UxSelectElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getAuViewModel(this).getValue(); - }, - set: function (v) { - return getAuViewModel(this).setValue(v); - } - }, - options: { - get: function () { - return getAuViewModel(this).getOptions(); - } - } -}); -function defaultMatcher(a, b) { - return a === b; -} diff --git a/packages/select/dist/system/ux-select.js b/packages/select/dist/system/ux-select.js deleted file mode 100644 index a8f7abdb..00000000 --- a/packages/select/dist/system/ux-select.js +++ /dev/null @@ -1,508 +0,0 @@ -System.register(["aurelia-framework", "aurelia-logging", "@aurelia-ux/core", "./util"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function extractUxOption(_, __, node) { - if (node.hasAttribute('containerless')) { - logger.warn('cannot use containerless on . Consider using as-element instead.'); - node.removeAttribute('containerless'); - } - var currentChild = node.firstChild; - while (currentChild) { - var nextSibling = currentChild.nextSibling; - if (currentChild.nodeName === 'UX-OPTION' || currentChild.nodeName === 'UX-OPTGROUP') { - currentChild = nextSibling; - continue; - } - node.removeChild(currentChild); - currentChild = nextSibling; - } - return true; - } - function defaultMatcher(a, b) { - return a === b; - } - var aurelia_framework_1, aurelia_logging_1, core_1, util_1, UP, DOWN, ENTER, SPACE, logger, invalidMultipleValueMsg, selectArrayContext, UxSelect, UxSelectElementProto; - return { - setters: [ - function (aurelia_framework_1_1) { - aurelia_framework_1 = aurelia_framework_1_1; - }, - function (aurelia_logging_1_1) { - aurelia_logging_1 = aurelia_logging_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (util_1_1) { - util_1 = util_1_1; - } - ], - execute: function () { - UP = 38; - // const RIGHT = 39; - DOWN = 40; - // const LEFT = 37; - // const ESC = 27; - ENTER = 13; - SPACE = 32; - logger = aurelia_logging_1.getLogger('ux-select'); - invalidMultipleValueMsg = 'Only null or Array instances can be bound to a multi-select'; - selectArrayContext = 'context:ux-select'; - UxSelect = /** @class */ (function () { - function UxSelect(element, styleEngine, observerLocator, taskQueue) { - this.element = element; - this.styleEngine = styleEngine; - this.observerLocator = observerLocator; - this.taskQueue = taskQueue; - this.selectedOption = null; - this.ignoreSelectEvent = true; - // Only chrome persist the element prototype when cloning with clone node - Object.setPrototypeOf(element, UxSelectElementProto); - } - UxSelect.prototype.bind = function () { - if (util_1.bool(this.autofocus)) { - // setTimeout(focusEl, 0, this.button); - } - if (this.isMultiple) { - if (!this.value) { - this.value = []; - } - else if (!Array.isArray(this.value)) { - throw new Error(invalidMultipleValueMsg); - } - } - if (!this.winEvents) { - this.winEvents = new aurelia_framework_1.ElementEvents(window); - } - // Initially Synchronize options with value of this element - this.taskQueue.queueMicroTask(this); - }; - UxSelect.prototype.unbind = function () { - this.winEvents.disposeAll(); - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - this.selectedOption = null; - }; - UxSelect.prototype.resolveDisplayValue = function () { - var value = this.value; - this.displayValue = Array.isArray(value) ? value.slice().sort().join(', ') : value; - }; - UxSelect.prototype.synchronizeOptions = function () { - var value = this.value; - var isArray = Array.isArray(value); - var options = this.options; - var matcher = this.element.matcher || defaultMatcher; - var i = options.length; - this.ignoreSelectEvent = true; - var _loop_1 = function () { - var option = options[i]; - var optionValue = option.value; - if (isArray) { - option.selected = value.findIndex(function (item) { return !!matcher(optionValue, item); }) !== -1; - return "continue"; - } - option.selected = !!matcher(optionValue, value); - }; - while (i--) { - _loop_1(); - } - this.ignoreSelectEvent = false; - }; - UxSelect.prototype.synchronizeValue = function () { - var options = this.options; - var ii = options.length; - var count = 0; - var optionValues = []; - // extract value from ux-option - for (var i = 0; i < ii; i++) { - var option = options[i]; - if (!option.selected) { - continue; - } - optionValues.push(option.value); - count++; - } - if (this.isMultiple) { - // multi-select - if (Array.isArray(this.value)) { - var selectValues = this.value; - var matcher_1 = this.element.matcher || defaultMatcher; - // remove items that are no longer selected. - var i = 0; - var _loop_2 = function () { - var a = selectValues[i]; - if (optionValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.splice(i, 1); - } - else { - i++; - } - }; - while (i < selectValues.length) { - _loop_2(); - } - // add items that have been selected. - i = 0; - var _loop_3 = function () { - var a = optionValues[i]; - if (selectValues.findIndex(function (b) { return matcher_1(a, b); }) === -1) { - selectValues.push(a); - } - i++; - }; - while (i < optionValues.length) { - _loop_3(); - } - this.resolveDisplayValue(); - return; // don't notify. - } - } - else { - // single-select - // tslint:disable-next-line:prefer-conditional-expression - if (count === 0) { - optionValues = null; - } - else { - optionValues = optionValues[0]; - } - this.setValue(optionValues); - } - }; - UxSelect.prototype.setupListAnchor = function () { - var _this = this; - this.calcAnchorPosition(); - this.winEvents.subscribe('wheel', function (e) { - if (_this.expanded) { - if (e.target === aurelia_framework_1.PLATFORM.global || !_this.optionWrapperEl.contains(e.target)) { - _this.collapse(); - } - } - }, true); - }; - UxSelect.prototype.unsetupListAnchor = function () { - this.listAnchor = null; - this.winEvents.disposeAll(); - }; - UxSelect.prototype.calcAnchorPosition = function () { - var elDim = this.container.getBoundingClientRect(); - var offsetY = (48 - elDim.height) / 2; - this.listAnchor = { x: elDim.left, y: elDim.top - offsetY }; - }; - UxSelect.prototype.onKeyboardSelect = function () { - if (!this.expanded) { - return; - } - var focusedOption = this.focusedUxOption; - if (this.isMultiple) { - if (!focusedOption) { - return; - } - focusedOption.selected = !focusedOption.selected; - } - else { - this.collapse(); - } - }; - UxSelect.prototype.call = function () { - this.synchronizeOptions(); - }; - UxSelect.prototype.getValue = function () { - return this.value; - }; - UxSelect.prototype.setValue = function (newValue) { - if (newValue !== null && newValue !== undefined && this.isMultiple && !Array.isArray(newValue)) { - throw new Error('Only null, undenfined or Array instances can be bound to a multi-select.'); - } - if (this.value === newValue) { - return; - } - // unsubscribe from old array. - if (this.arrayObserver) { - this.arrayObserver.unsubscribe(selectArrayContext, this); - this.arrayObserver = null; - } - if (this.isMultiple) { - // subscribe to new array. - if (Array.isArray(newValue)) { - this.arrayObserver = this.observerLocator.getArrayObserver(newValue); - this.arrayObserver.subscribe(selectArrayContext, this); - } - } - if (newValue !== this.value) { - this.value = newValue; - this.resolveDisplayValue(); - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSelect.prototype.expand = function () { - var _this = this; - if (this.expanded) { - return; - } - if (this.isExpanding) { - return; - } - this.isExpanding = true; - this.optionWrapperEl.classList.add('open'); - setTimeout(function () { - _this.optionCtEl.classList.add('open'); - _this.isExpanding = false; - _this.expanded = true; - _this.setFocusedOption(_this.selectedOption); - }, this.theme.listTransition); - this.setupListAnchor(); - }; - UxSelect.prototype.collapse = function () { - var _this = this; - if (this.isCollapsing) { - return; - } - this.isCollapsing = true; - this.optionCtEl.classList.remove('open'); - setTimeout(function () { - _this.optionWrapperEl.classList.remove('open'); - _this.isCollapsing = false; - _this.expanded = false; - _this.setFocusedOption(null); - _this.unsetupListAnchor(); - }, this.theme.listTransition); - }; - UxSelect.prototype.setFocusedOption = function (focusedOption) { - var oldFocusedOption = this.focusedUxOption; - if (focusedOption !== oldFocusedOption) { - if (oldFocusedOption) { - oldFocusedOption.focused = false; - } - if (focusedOption) { - focusedOption.focused = true; - focusedOption.wave(); - focusedOption.scrollIntoView({ block: 'nearest', inline: 'nearest' }); - } - this.focusedUxOption = focusedOption; - } - }; - UxSelect.prototype.moveSelectedIndex = function (offset) { - var currentIndex = 0; - var options = this.options; - if (this.focusedUxOption) { - currentIndex = options.indexOf(this.focusedUxOption); - } - else if (this.selectedOption) { - currentIndex = options.indexOf(this.selectedOption); - } - var nextIndex = currentIndex + offset; - if (nextIndex > options.length - 1) { - nextIndex = options.length - 1; - } - if (nextIndex < 0) { - nextIndex = 0; - } - var focusedOption = options[nextIndex]; - if (focusedOption.disabled) { - if (offset > 0) { - if (nextIndex === options.length - 1) { - return; - } - this.moveSelectedIndex(offset + 1); - } - else { - if (nextIndex < 0) { - return; - } - this.moveSelectedIndex(offset - 1); - } - return; - } - this.setFocusedOption(focusedOption); - focusedOption.focused = true; - if (this.isMultiple) { - // empty - } - else { - this.ignoreSelectEvent = true; - if (this.selectedOption) { - this.selectedOption.selected = false; - } - this.selectedOption = focusedOption; - this.selectedOption.selected = true; - this.ignoreSelectEvent = false; - this.setValue(this.selectedOption.value); - } - }; - UxSelect.prototype.onTriggerClick = function () { - if (!this.isDisabled) { - if (this.expanded) { - return; - } - this.expand(); - } - }; - UxSelect.prototype.onBlur = function () { - if (!this.element.contains(aurelia_framework_1.DOM.activeElement)) { - this.collapse(); - } - }; - UxSelect.prototype.onSelect = function (e) { - e.stopPropagation(); - if (this.ignoreSelectEvent) { - return; - } - var newSelection = e.detail; - var lastSelection = this.selectedOption; - if (this.isMultiple) { - this.synchronizeValue(); - } - else { - this.ignoreSelectEvent = true; - if (lastSelection) { - lastSelection.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = newSelection; - this.setValue(newSelection.value); - if (this.expanded) { - this.collapse(); - } - } - }; - UxSelect.prototype.onKeyDown = function (key) { - if (this.isDisabled) { - return; - } - // tslint:disable-next-line:switch-default - switch (key) { - case UP: - case DOWN: - this.moveSelectedIndex(key === UP ? -1 : 1); - break; - case ENTER: - case SPACE: - this.onKeyboardSelect(); - break; - } - return true; - }; - UxSelect.prototype.themeChanged = function (newValue) { - if (newValue && !newValue.themeKey) { - newValue.themeKey = 'ux-select'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSelect.prototype.multipleChanged = function (newValue, oldValue) { - newValue = util_1.bool(newValue); - oldValue = util_1.bool(oldValue); - var hasChanged = newValue !== oldValue; - if (hasChanged) { - this.ignoreSelectEvent = true; - for (var _i = 0, _a = this.options; _i < _a.length; _i++) { - var opt = _a[_i]; - opt.selected = false; - } - this.ignoreSelectEvent = false; - this.selectedOption = null; - this.setValue(newValue - ? [] // Changing from single to multiple = reset value to empty array - : null // Changing from multiple to single = reset value to null - ); - } - }; - Object.defineProperty(UxSelect.prototype, "options", { - get: function () { - if (!this.optionCtEl) { - return []; - } - var result = []; - var children = this.optionCtEl.children; - var ii = children.length; - for (var i = 0; ii > i; ++i) { - var element = children[i]; - if (element.nodeName === 'UX-OPTION') { - result.push(element); - } - else if (element.nodeName === 'UX-OPTGROUP') { - var groupOptions = element.options; - var jj = groupOptions.length; - for (var j = 0; jj > j; ++j) { - result.push(groupOptions[j]); - } - } - } - return result; - }, - enumerable: true, - configurable: true - }); - UxSelect.prototype.getOptions = function () { - return this.options; - }; - Object.defineProperty(UxSelect.prototype, "isMultiple", { - get: function () { - return util_1.bool(this.multiple); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(UxSelect.prototype, "isDisabled", { - get: function () { - return util_1.bool(this.disabled); - }, - enumerable: true, - configurable: true - }); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "autofocus", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "disabled", void 0); - __decorate([ - aurelia_framework_1.bindable({ defaultValue: false }) - ], UxSelect.prototype, "multiple", void 0); - __decorate([ - aurelia_framework_1.bindable() - ], UxSelect.prototype, "placeholder", void 0); - __decorate([ - aurelia_framework_1.computedFrom('multiple') - ], UxSelect.prototype, "isMultiple", null); - __decorate([ - aurelia_framework_1.computedFrom('disabled') - ], UxSelect.prototype, "isDisabled", null); - UxSelect = __decorate([ - aurelia_framework_1.inject(Element, core_1.StyleEngine, aurelia_framework_1.ObserverLocator, aurelia_framework_1.TaskQueue), - aurelia_framework_1.processContent(extractUxOption), - aurelia_framework_1.customElement('ux-select') - // @inlineView(UX_SELECT_VIEW) - ], UxSelect); - return UxSelect; - }()); - exports_1("UxSelect", UxSelect); - UxSelectElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return util_1.getAuViewModel(this).getValue(); - }, - set: function (v) { - return util_1.getAuViewModel(this).setValue(v); - } - }, - options: { - get: function () { - return util_1.getAuViewModel(this).getOptions(); - } - } - }); - } - }; -}); diff --git a/packages/switch/dist/amd/index.js b/packages/switch/dist/amd/index.js index 684bbbce..d43426b8 100644 --- a/packages/switch/dist/amd/index.js +++ b/packages/switch/dist/amd/index.js @@ -1,215 +1,208 @@ define('@aurelia-ux/switch', ['exports', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework'], function (exports, aureliaTemplating, aureliaBinding, aureliaDependencyInjection, core, aureliaFramework) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; + } -var UX_SWITCH_VIEW = " "; + var UX_SWITCH_VIEW = " "; -var UxSwitch = /** @class */ (function () { - function UxSwitch(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - Object.defineProperty(UxSwitch.prototype, "isDisabled", { - get: function () { - return core.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxSwitch.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } + var UxSwitch = /** @class */ (function () { + function UxSwitch(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.disabled = false; + this.effect = 'ripple'; + this.ripple = null; + Object.setPrototypeOf(element, uxSwitchElementProto); } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); + Object.defineProperty(UxSwitch.prototype, "isDisabled", { + get: function () { + return core.normalizeBooleanAttribute('disabled', this.disabled); + }, + enumerable: true, + configurable: true + }); + UxSwitch.prototype.bind = function () { + var element = this.element; + var checkbox = this.checkbox; + if (element.hasAttribute('id')) { + var attributeValue = element.getAttribute('id'); + if (attributeValue != null) { + checkbox.setAttribute('id', attributeValue); + } } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; + if (element.hasAttribute('tabindex')) { + var attributeValue = element.getAttribute('tabindex'); + if (attributeValue != null) { + checkbox.setAttribute('tabindex', attributeValue); + } } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - }; - UxSwitch.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxSwitch.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxSwitch.prototype.getChecked = function () { - return this.checked; - }; - UxSwitch.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aureliaFramework.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSwitch.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxSwitch.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSwitch.prototype.disabledChanged = function (newValue) { - if (core.normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - }; - UxSwitch.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); + if (element.hasAttribute('checked')) { + var attributeValue = element.getAttribute('checked'); + if (attributeValue || attributeValue === '') { + element.checked = true; } } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aureliaFramework.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aureliaTemplating.bindable - ], UxSwitch.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxSwitch.prototype, "effect", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxSwitch.prototype, "id", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxSwitch.prototype, "theme", void 0); - __decorate([ - aureliaBinding.observable({ initializer: function () { return false; } }) - ], UxSwitch.prototype, "value", void 0); - __decorate([ - aureliaBinding.computedFrom('disabled') - ], UxSwitch.prototype, "isDisabled", null); - UxSwitch = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-switch'), - aureliaTemplating.inlineView(UX_SWITCH_VIEW) - ], UxSwitch); - return UxSwitch; -}()); -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); + this.themeChanged(this.theme); + this.disabledChanged(this.disabled); + }; + UxSwitch.prototype.attached = function () { + this.checkbox.addEventListener('change', stopEvent); + }; + UxSwitch.prototype.detached = function () { + this.checkbox.removeEventListener('change', stopEvent); + }; + UxSwitch.prototype.getChecked = function () { + return this.checked; + }; + UxSwitch.prototype.setChecked = function (value) { + var oldValue = this.checked; + var newValue = !!value; + if (newValue !== oldValue) { + this.checked = newValue; + this.ignoreValueChanges = true; + this.value = newValue; + this.ignoreValueChanges = false; + this.element.dispatchEvent(aureliaFramework.DOM.createCustomEvent('change', { bubbles: true })); + } + }; + UxSwitch.prototype.valueChanged = function (newValue) { + if (this.ignoreValueChanges) { + return; + } + this.setChecked(newValue); + }; + UxSwitch.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'switch'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxSwitch.prototype.disabledChanged = function (newValue) { + if (core.normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { + this.checkbox.setAttribute('disabled', ''); + } + else if (this.element.classList.contains('disabled')) { + this.checkbox.removeAttribute('disabled'); + } + }; + UxSwitch.prototype.onMouseDown = function (e) { + var _this = this; + if (e.button !== 0 || this.isDisabled) { + return; + } + if (this.element.classList.contains('ripple')) { + if (this.ripple === null) { + this.ripple = new core.PaperRipple(); + var container = this.element.querySelector('.ripplecontainer'); + if (container != null) { + container.appendChild(this.ripple.$); + } + } + this.ripple.center = true; + this.ripple.round = true; + this.ripple.downAction(e); + var winEvents_1 = new aureliaFramework.ElementEvents(window); + var upAction = function () { + _this.ripple.upAction(); + winEvents_1.disposeAll(); + }; + winEvents_1.subscribe('blur', upAction); + winEvents_1.subscribe('mouseup', upAction, true); + } + e.preventDefault(); + }; + __decorate([ + aureliaTemplating.bindable + ], UxSwitch.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxSwitch.prototype, "effect", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxSwitch.prototype, "id", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxSwitch.prototype, "theme", void 0); + __decorate([ + aureliaBinding.observable({ initializer: function () { return false; } }) + ], UxSwitch.prototype, "value", void 0); + __decorate([ + aureliaBinding.computedFrom('disabled') + ], UxSwitch.prototype, "isDisabled", null); + UxSwitch = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-switch'), + aureliaTemplating.inlineView(UX_SWITCH_VIEW) + ], UxSwitch); + return UxSwitch; + }()); + function stopEvent(e) { + e.stopPropagation(); + } + var getVm = function (_) { return _.au.controller.viewModel; }; + var uxSwitchElementProto = Object.create(HTMLElement.prototype, { + type: { + value: 'checkbox', }, - set: function (value) { - getVm(this).setChecked(value); + checked: { + get: function () { + return getVm(this).getChecked(); + }, + set: function (value) { + getVm(this).setChecked(value); + } } - } -}); + }); -var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" + var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; -var UxSwitchTheme = /** @class */ (function () { - function UxSwitchTheme() { - this.themeKey = 'switch'; - } - return UxSwitchTheme; -}()); + var UxSwitchTheme = /** @class */ (function () { + function UxSwitchTheme() { + this.themeKey = 'switch'; + } + return UxSwitchTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-switch-css'); - config.container.get(core.AureliaUX).registerUxElementConfig(uxSwitchConfig); - config.globalResources(UxSwitch); -} -var uxSwitchConfig = { - tagName: 'ux-switch', - properties: { - checked: { - defaultBindingMode: aureliaFramework.bindingMode.twoWay, - getObserver: function (element, _, observerLocator) { - return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-switch-css'); + config.container.get(core.AureliaUX).registerUxElementConfig(uxSwitchConfig); + config.globalResources(UxSwitch); + } + var uxSwitchConfig = { + tagName: 'ux-switch', + properties: { + checked: { + defaultBindingMode: aureliaFramework.bindingMode.twoWay, + getObserver: function (element, _, observerLocator) { + return new aureliaBinding.CheckedObserver(element, new aureliaBinding.EventSubscriber(['change']), observerLocator); + } } } - } -}; + }; -exports.configure = configure; -exports.UxSwitchTheme = UxSwitchTheme; -exports.UxSwitch = UxSwitch; + exports.configure = configure; + exports.UxSwitchTheme = UxSwitchTheme; + exports.UxSwitch = UxSwitch; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/switch/dist/amd/ux-switch.js b/packages/switch/dist/amd/ux-switch.js deleted file mode 100644 index 413bb638..00000000 --- a/packages/switch/dist/amd/ux-switch.js +++ /dev/null @@ -1,158 +0,0 @@ -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", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (require, exports, aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxSwitch = /** @class */ (function () { - function UxSwitch(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - Object.defineProperty(UxSwitch.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxSwitch.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - }; - UxSwitch.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxSwitch.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxSwitch.prototype.getChecked = function () { - return this.checked; - }; - UxSwitch.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSwitch.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxSwitch.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSwitch.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - }; - UxSwitch.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxSwitch.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxSwitch.prototype, "isDisabled", null); - UxSwitch = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-switch') - ], UxSwitch); - return UxSwitch; - }()); - exports.UxSwitch = UxSwitch; - function stopEvent(e) { - e.stopPropagation(); - } - var getVm = function (_) { return _.au.controller.viewModel; }; - var uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } - }); -}); diff --git a/packages/switch/dist/commonjs/index.js b/packages/switch/dist/commonjs/index.js index 60431965..5ddafa15 100644 --- a/packages/switch/dist/commonjs/index.js +++ b/packages/switch/dist/commonjs/index.js @@ -22,13 +22,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -188,7 +181,7 @@ var uxSwitchElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxSwitchTheme = /** @class */ (function () { function UxSwitchTheme() { diff --git a/packages/switch/dist/commonjs/ux-switch.js b/packages/switch/dist/commonjs/ux-switch.js deleted file mode 100644 index cc26ff7b..00000000 --- a/packages/switch/dist/commonjs/ux-switch.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_binding_1 = require("aurelia-binding"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var aurelia_framework_1 = require("aurelia-framework"); -var UxSwitch = /** @class */ (function () { - function UxSwitch(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - Object.defineProperty(UxSwitch.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxSwitch.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - }; - UxSwitch.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxSwitch.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxSwitch.prototype.getChecked = function () { - return this.checked; - }; - UxSwitch.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSwitch.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxSwitch.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSwitch.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - }; - UxSwitch.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxSwitch.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxSwitch.prototype, "isDisabled", null); - UxSwitch = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-switch') - ], UxSwitch); - return UxSwitch; -}()); -exports.UxSwitch = UxSwitch; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/switch/dist/es2015/index.js b/packages/switch/dist/es2015/index.js index 556e6aa2..5d64a8e5 100644 --- a/packages/switch/dist/es2015/index.js +++ b/packages/switch/dist/es2015/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -178,7 +171,7 @@ const uxSwitchElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; class UxSwitchTheme { constructor() { diff --git a/packages/switch/dist/es2015/ux-switch.js b/packages/switch/dist/es2015/ux-switch.js deleted file mode 100644 index bca883e9..00000000 --- a/packages/switch/dist/es2015/ux-switch.js +++ /dev/null @@ -1,153 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -import { DOM, ElementEvents } from 'aurelia-framework'; -let UxSwitch = class UxSwitch { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - get isDisabled() { - return normalizeBooleanAttribute('disabled', this.disabled); - } - bind() { - const element = this.element; - const checkbox = this.checkbox; - if (element.hasAttribute('id')) { - const attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - const attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - const attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - } - attached() { - this.checkbox.addEventListener('change', stopEvent); - } - detached() { - this.checkbox.removeEventListener('change', stopEvent); - } - getChecked() { - return this.checked; - } - setChecked(value) { - const oldValue = this.checked; - const newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - valueChanged(newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - disabledChanged(newValue) { - if (normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - } - onMouseDown(e) { - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - const container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - const winEvents = new ElementEvents(window); - const upAction = () => { - this.ripple.upAction(); - winEvents.disposeAll(); - }; - winEvents.subscribe('blur', upAction); - winEvents.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - } -}; -__decorate([ - bindable -], UxSwitch.prototype, "disabled", void 0); -__decorate([ - bindable -], UxSwitch.prototype, "effect", void 0); -__decorate([ - bindable -], UxSwitch.prototype, "id", void 0); -__decorate([ - bindable -], UxSwitch.prototype, "theme", void 0); -__decorate([ - observable({ initializer: () => false }) -], UxSwitch.prototype, "value", void 0); -__decorate([ - computedFrom('disabled') -], UxSwitch.prototype, "isDisabled", null); -UxSwitch = __decorate([ - inject(Element, StyleEngine), - customElement('ux-switch') -], UxSwitch); -export { UxSwitch }; -function stopEvent(e) { - e.stopPropagation(); -} -const getVm = (_) => _.au.controller.viewModel; -const uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get() { - return getVm(this).getChecked(); - }, - set(value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/switch/dist/native-modules/index.js b/packages/switch/dist/native-modules/index.js index d0996543..a20659f5 100644 --- a/packages/switch/dist/native-modules/index.js +++ b/packages/switch/dist/native-modules/index.js @@ -18,13 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -184,7 +177,7 @@ var uxSwitchElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}" +var css = "ux-switch{display:inline-block;position:relative;cursor:pointer}ux-switch>input{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;width:100%;height:100%;cursor:pointer;z-index:1}ux-switch>input:disabled{cursor:default}ux-switch .track{margin:6px 5px;height:12px;width:32px;border:0;border-radius:6px;background-color:#e0e0e0;background-color:var(--ux-theme--switch-track, #E0E0E0);transition:background-color 150ms ease-in-out;position:relative}ux-switch input:disabled~.track,ux-switch input:disabled:checked~.track{background-color:#9e9e9e;background-color:var(--ux-theme--switch-track-disabled, #9E9E9E)}ux-switch input:disabled~.track .indicator,ux-switch input:disabled:checked~.track .indicator{background-color:#e0e0e0;background-color:var(--ux-theme--switch-indicator-disabled, #E0E0E0)}ux-switch input:checked~.track{background-color:#ff80ab;background-color:var(--ux-theme--switch-track-active, var(--ux-design--accent-light, #FF80AB))}ux-switch:focus{outline:0}ux-switch .track .indicator{position:relative;left:-3px;top:-3px;height:18px;width:18px;background-color:#fff;background-color:var(--ux-theme--switch-indicator, #FFF);border-radius:50%;box-shadow:0 1px 4px 0 rgba(0,0,0,.6);transition:left .1s ease-in-out,background-color .1s ease-in-out}ux-switch input:checked~.track .indicator{left:calc(100% - 14px);background-color:#ff80ab;background-color:var(--ux-theme--switch-indicator-active, var(--ux-design--accent, #F48FB1));box-shadow:0 2px 5px 0 rgba(0,0,0,.4)}ux-switch .ripplecontainer{position:relative;width:0;height:0}ux-switch .ripplecontainer>.paper-ripple{top:auto;left:auto;right:-36px;bottom:-36px;width:50px;height:50px;border-radius:50%}ux-switch .ripplecontainer>.ripple{position:absolute;bottom:-37px;width:50px;height:50px;border-radius:50%;pointer-events:none;background-color:rgba(0,0,0,.22);transition:transform 100ms ease-in-out;transform:scale3d(0,0,0);left:-6px}ux-switch input:focus~.ripplecontainer>.ripple{transform:scale3d(1,1,1)}ux-switch input:disabled:focus~.ripplecontainer>.ripple{transform:scale3d(0,0,0)}"; var UxSwitchTheme = /** @class */ (function () { function UxSwitchTheme() { diff --git a/packages/switch/dist/native-modules/ux-switch.js b/packages/switch/dist/native-modules/ux-switch.js deleted file mode 100644 index a8bd2908..00000000 --- a/packages/switch/dist/native-modules/ux-switch.js +++ /dev/null @@ -1,159 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { computedFrom, observable } from 'aurelia-binding'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine, PaperRipple, normalizeBooleanAttribute } from '@aurelia-ux/core'; -import { DOM, ElementEvents } from 'aurelia-framework'; -var UxSwitch = /** @class */ (function () { - function UxSwitch(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - Object.defineProperty(UxSwitch.prototype, "isDisabled", { - get: function () { - return normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxSwitch.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - }; - UxSwitch.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxSwitch.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxSwitch.prototype.getChecked = function () { - return this.checked; - }; - UxSwitch.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSwitch.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxSwitch.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSwitch.prototype.disabledChanged = function (newValue) { - if (normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - }; - UxSwitch.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - bindable - ], UxSwitch.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxSwitch.prototype, "effect", void 0); - __decorate([ - bindable - ], UxSwitch.prototype, "id", void 0); - __decorate([ - bindable - ], UxSwitch.prototype, "theme", void 0); - __decorate([ - observable({ initializer: function () { return false; } }) - ], UxSwitch.prototype, "value", void 0); - __decorate([ - computedFrom('disabled') - ], UxSwitch.prototype, "isDisabled", null); - UxSwitch = __decorate([ - inject(Element, StyleEngine), - customElement('ux-switch') - ], UxSwitch); - return UxSwitch; -}()); -export { UxSwitch }; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } -}); diff --git a/packages/switch/dist/system/ux-switch.js b/packages/switch/dist/system/ux-switch.js deleted file mode 100644 index fea8fc6c..00000000 --- a/packages/switch/dist/system/ux-switch.js +++ /dev/null @@ -1,180 +0,0 @@ -System.register(["aurelia-templating", "aurelia-binding", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function stopEvent(e) { - e.stopPropagation(); - } - var aurelia_templating_1, aurelia_binding_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1, UxSwitch, getVm, uxSwitchElementProto; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (aurelia_framework_1_1) { - aurelia_framework_1 = aurelia_framework_1_1; - } - ], - execute: function () { - UxSwitch = /** @class */ (function () { - function UxSwitch(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.disabled = false; - this.effect = 'ripple'; - this.ripple = null; - Object.setPrototypeOf(element, uxSwitchElementProto); - } - Object.defineProperty(UxSwitch.prototype, "isDisabled", { - get: function () { - return core_1.normalizeBooleanAttribute('disabled', this.disabled); - }, - enumerable: true, - configurable: true - }); - UxSwitch.prototype.bind = function () { - var element = this.element; - var checkbox = this.checkbox; - if (element.hasAttribute('id')) { - var attributeValue = element.getAttribute('id'); - if (attributeValue != null) { - checkbox.setAttribute('id', attributeValue); - } - } - if (element.hasAttribute('tabindex')) { - var attributeValue = element.getAttribute('tabindex'); - if (attributeValue != null) { - checkbox.setAttribute('tabindex', attributeValue); - } - } - if (element.hasAttribute('checked')) { - var attributeValue = element.getAttribute('checked'); - if (attributeValue || attributeValue === '') { - element.checked = true; - } - } - this.themeChanged(this.theme); - this.disabledChanged(this.disabled); - }; - UxSwitch.prototype.attached = function () { - this.checkbox.addEventListener('change', stopEvent); - }; - UxSwitch.prototype.detached = function () { - this.checkbox.removeEventListener('change', stopEvent); - }; - UxSwitch.prototype.getChecked = function () { - return this.checked; - }; - UxSwitch.prototype.setChecked = function (value) { - var oldValue = this.checked; - var newValue = !!value; - if (newValue !== oldValue) { - this.checked = newValue; - this.ignoreValueChanges = true; - this.value = newValue; - this.ignoreValueChanges = false; - this.element.dispatchEvent(aurelia_framework_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxSwitch.prototype.valueChanged = function (newValue) { - if (this.ignoreValueChanges) { - return; - } - this.setChecked(newValue); - }; - UxSwitch.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'switch'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxSwitch.prototype.disabledChanged = function (newValue) { - if (core_1.normalizeBooleanAttribute('disabled', newValue) && !this.element.classList.contains('disabled')) { - this.checkbox.setAttribute('disabled', ''); - } - else if (this.element.classList.contains('disabled')) { - this.checkbox.removeAttribute('disabled'); - } - }; - UxSwitch.prototype.onMouseDown = function (e) { - var _this = this; - if (e.button !== 0 || this.isDisabled) { - return; - } - if (this.element.classList.contains('ripple')) { - if (this.ripple === null) { - this.ripple = new core_1.PaperRipple(); - var container = this.element.querySelector('.ripplecontainer'); - if (container != null) { - container.appendChild(this.ripple.$); - } - } - this.ripple.center = true; - this.ripple.round = true; - this.ripple.downAction(e); - var winEvents_1 = new aurelia_framework_1.ElementEvents(window); - var upAction = function () { - _this.ripple.upAction(); - winEvents_1.disposeAll(); - }; - winEvents_1.subscribe('blur', upAction); - winEvents_1.subscribe('mouseup', upAction, true); - } - e.preventDefault(); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "effect", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "id", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxSwitch.prototype, "theme", void 0); - __decorate([ - aurelia_binding_1.observable({ initializer: function () { return false; } }) - ], UxSwitch.prototype, "value", void 0); - __decorate([ - aurelia_binding_1.computedFrom('disabled') - ], UxSwitch.prototype, "isDisabled", null); - UxSwitch = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-switch') - ], UxSwitch); - return UxSwitch; - }()); - exports_1("UxSwitch", UxSwitch); - getVm = function (_) { return _.au.controller.viewModel; }; - uxSwitchElementProto = Object.create(HTMLElement.prototype, { - type: { - value: 'checkbox', - }, - checked: { - get: function () { - return getVm(this).getChecked(); - }, - set: function (value) { - getVm(this).setChecked(value); - } - } - }); - } - }; -}); diff --git a/packages/textarea/dist/amd/index.js b/packages/textarea/dist/amd/index.js index 9760e511..31ec74c9 100644 --- a/packages/textarea/dist/amd/index.js +++ b/packages/textarea/dist/amd/index.js @@ -1,216 +1,209 @@ define('@aurelia-ux/textarea', ['exports', 'aurelia-templating', 'aurelia-pal', 'aurelia-dependency-injection', '@aurelia-ux/core', 'aurelia-framework', 'aurelia-binding'], function (exports, aureliaTemplating, aureliaPal, aureliaDependencyInjection, core, aureliaFramework, aureliaBinding) { 'use strict'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - - -function __decorate(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; -} - -var UX_TEXTAREA_VIEW = " "; - -var UxTextArea = /** @class */ (function () { - function UxTextArea(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(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; } - UxTextArea.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; + + var UX_TEXTAREA_VIEW = " "; + + var UxTextArea = /** @class */ (function () { + function UxTextArea(element, styleEngine) { + this.element = element; + this.styleEngine = styleEngine; + this.autofocus = null; + this.autoResize = false; + this.disabled = false; + this.focus = false; + this.readonly = false; + this.value = undefined; + Object.setPrototypeOf(element, uxTextAreaElementProto); } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); + UxTextArea.prototype.bind = function () { + var element = this.element; + var textbox = this.textbox; + if (this.theme != null) { + this.themeChanged(this.theme); } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - }; - UxTextArea.prototype.attached = function () { - var textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - }; - UxTextArea.prototype.detached = function () { - var textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - }; - UxTextArea.prototype.getValue = function () { - return this.value; - }; - UxTextArea.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); + if (this.autofocus || this.autofocus === '') { + this.focus = true; + } + if (element.hasAttribute('placeholder')) { + var attributeValue = element.getAttribute('placeholder'); + if (attributeValue) { + textbox.setAttribute('placeholder', attributeValue); + element.removeAttribute('placeholder'); + } + } + if (this.cols) { + textbox.setAttribute('cols', this.cols.toString()); + element.removeAttribute('cols'); + } + if (this.rows) { + textbox.setAttribute('rows', this.rows.toString()); + element.removeAttribute('rows'); + } + if (this.minlength) { + textbox.setAttribute('minlength', this.minlength.toString()); + } + if (this.maxlength) { + textbox.setAttribute('maxlength', this.maxlength.toString()); + } + }; + UxTextArea.prototype.attached = function () { + var textbox = this.textbox; + this.isAttached = true; + this.textbox.addEventListener('change', stopEvent); + this.textbox.addEventListener('input', stopEvent); this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxTextArea.prototype.rawValueChanged = function (rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - }; - UxTextArea.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTextArea.prototype.fitTextContent = function () { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; - } - }; - UxTextArea.prototype.focusChanged = function (focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - }; - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "autofocus", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "autoResize", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "cols", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "disabled", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "focus", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "maxlength", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "minlength", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "readonly", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "rows", void 0); - __decorate([ - aureliaTemplating.bindable - ], UxTextArea.prototype, "theme", void 0); - __decorate([ - aureliaFramework.observable({ initializer: function () { return ''; } }) - ], UxTextArea.prototype, "rawValue", void 0); - UxTextArea = __decorate([ - aureliaDependencyInjection.inject(Element, core.StyleEngine), - aureliaTemplating.customElement('ux-textarea'), - aureliaTemplating.inlineView(UX_TEXTAREA_VIEW) - ], UxTextArea); - return UxTextArea; -}()); -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } + textbox.addEventListener('change', stopEvent); + textbox.addEventListener('input', stopEvent); + }; + UxTextArea.prototype.detached = function () { + var textbox = this.textbox; + this.isAttached = false; + textbox.removeEventListener('change', stopEvent); + textbox.removeEventListener('input', stopEvent); + }; + UxTextArea.prototype.getValue = function () { + return this.value; + }; + UxTextArea.prototype.setValue = function (value) { + var oldValue = this.value; + var newValue = value === null || value === undefined ? null : value.toString(); + if (oldValue !== newValue) { + this.value = newValue; + this.ignoreRawChanges = true; + this.rawValue = newValue === null ? '' : newValue.toString(); + this.fitTextContent(); + this.ignoreRawChanges = false; + this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent('change', { bubbles: true })); + } + }; + UxTextArea.prototype.rawValueChanged = function (rawValue) { + if (this.ignoreRawChanges) { + return; + } + this.setValue(rawValue); + }; + UxTextArea.prototype.themeChanged = function (newValue) { + if (newValue != null && newValue.themeKey == null) { + newValue.themeKey = 'textarea'; + } + this.styleEngine.applyTheme(newValue, this.element); + }; + UxTextArea.prototype.fitTextContent = function () { + if (this.isAttached && (this.autoResize || this.autoResize === '')) { + this.textbox.style.height = 'auto'; + this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; + } + }; + UxTextArea.prototype.focusChanged = function (focus) { + focus = focus || focus === '' ? true : false; + this.element.dispatchEvent(aureliaPal.DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); + }; + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "autofocus", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "autoResize", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "cols", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "disabled", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "focus", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "maxlength", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "minlength", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "readonly", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "rows", void 0); + __decorate([ + aureliaTemplating.bindable + ], UxTextArea.prototype, "theme", void 0); + __decorate([ + aureliaFramework.observable({ initializer: function () { return ''; } }) + ], UxTextArea.prototype, "rawValue", void 0); + UxTextArea = __decorate([ + aureliaDependencyInjection.inject(Element, core.StyleEngine), + aureliaTemplating.customElement('ux-textarea'), + aureliaTemplating.inlineView(UX_TEXTAREA_VIEW) + ], UxTextArea); + return UxTextArea; + }()); + function stopEvent(e) { + e.stopPropagation(); } -}); + var getVm = function (_) { return _.au.controller.viewModel; }; + var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { + value: { + get: function () { + return getVm(this).getValue(); + }, + set: function (value) { + getVm(this).setValue(value); + } + } + }); -var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}" + var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}"; -var UxTextAreaTheme = /** @class */ (function () { - function UxTextAreaTheme() { - this.themeKey = 'textarea'; - } - return UxTextAreaTheme; -}()); + var UxTextAreaTheme = /** @class */ (function () { + function UxTextAreaTheme() { + this.themeKey = 'textarea'; + } + return UxTextAreaTheme; + }()); -function configure(config) { - aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-textarea-css'); - config.container.get(core.AureliaUX).registerUxElementConfig(uxTextAreaConfig); - config.globalResources(UxTextArea); -} -var uxTextAreaConfig = { - tagName: 'ux-textarea', - properties: { - value: { - defaultBindingMode: aureliaFramework.bindingMode.twoWay, - getObserver: function (element) { - return new aureliaBinding.ValueAttributeObserver(element, 'value', new aureliaBinding.EventSubscriber(['change'])); + function configure(config) { + aureliaFramework.DOM.injectStyles(css, undefined, undefined, 'ux-textarea-css'); + config.container.get(core.AureliaUX).registerUxElementConfig(uxTextAreaConfig); + config.globalResources(UxTextArea); + } + var uxTextAreaConfig = { + tagName: 'ux-textarea', + properties: { + value: { + defaultBindingMode: aureliaFramework.bindingMode.twoWay, + getObserver: function (element) { + return new aureliaBinding.ValueAttributeObserver(element, 'value', new aureliaBinding.EventSubscriber(['change'])); + } } } - } -}; + }; -exports.configure = configure; -exports.UxTextAreaTheme = UxTextAreaTheme; -exports.UxTextArea = UxTextArea; + exports.configure = configure; + exports.UxTextAreaTheme = UxTextAreaTheme; + exports.UxTextArea = UxTextArea; -Object.defineProperty(exports, '__esModule', { value: true }); + Object.defineProperty(exports, '__esModule', { value: true }); }); diff --git a/packages/textarea/dist/amd/ux-textarea.js b/packages/textarea/dist/amd/ux-textarea.js deleted file mode 100644 index 2fce9920..00000000 --- a/packages/textarea/dist/amd/ux-textarea.js +++ /dev/null @@ -1,159 +0,0 @@ -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", "aurelia-pal", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (require, exports, aurelia_templating_1, aurelia_pal_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var UxTextArea = /** @class */ (function () { - function UxTextArea(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); - } - UxTextArea.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); - } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - }; - UxTextArea.prototype.attached = function () { - var textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - }; - UxTextArea.prototype.detached = function () { - var textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - }; - UxTextArea.prototype.getValue = function () { - return this.value; - }; - UxTextArea.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); - this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxTextArea.prototype.rawValueChanged = function (rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - }; - UxTextArea.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTextArea.prototype.fitTextContent = function () { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; - } - }; - UxTextArea.prototype.focusChanged = function (focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autoResize", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "cols", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "focus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "rows", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.observable({ initializer: function () { return ''; } }) - ], UxTextArea.prototype, "rawValue", void 0); - UxTextArea = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-textarea') - ], UxTextArea); - return UxTextArea; - }()); - exports.UxTextArea = UxTextArea; - function stopEvent(e) { - e.stopPropagation(); - } - var getVm = function (_) { return _.au.controller.viewModel; }; - var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } - }); -}); diff --git a/packages/textarea/dist/commonjs/index.js b/packages/textarea/dist/commonjs/index.js index 1cd420b4..5230b7a6 100644 --- a/packages/textarea/dist/commonjs/index.js +++ b/packages/textarea/dist/commonjs/index.js @@ -23,13 +23,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -190,7 +183,7 @@ var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}" +var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}"; var UxTextAreaTheme = /** @class */ (function () { function UxTextAreaTheme() { diff --git a/packages/textarea/dist/commonjs/ux-textarea.js b/packages/textarea/dist/commonjs/ux-textarea.js deleted file mode 100644 index c5c4a86b..00000000 --- a/packages/textarea/dist/commonjs/ux-textarea.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -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; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_pal_1 = require("aurelia-pal"); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -var core_1 = require("@aurelia-ux/core"); -var aurelia_framework_1 = require("aurelia-framework"); -var UxTextArea = /** @class */ (function () { - function UxTextArea(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); - } - UxTextArea.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); - } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - }; - UxTextArea.prototype.attached = function () { - var textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - }; - UxTextArea.prototype.detached = function () { - var textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - }; - UxTextArea.prototype.getValue = function () { - return this.value; - }; - UxTextArea.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); - this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxTextArea.prototype.rawValueChanged = function (rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - }; - UxTextArea.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTextArea.prototype.fitTextContent = function () { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; - } - }; - UxTextArea.prototype.focusChanged = function (focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autoResize", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "cols", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "focus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "rows", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.observable({ initializer: function () { return ''; } }) - ], UxTextArea.prototype, "rawValue", void 0); - UxTextArea = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-textarea') - ], UxTextArea); - return UxTextArea; -}()); -exports.UxTextArea = UxTextArea; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/textarea/dist/es2015/index.js b/packages/textarea/dist/es2015/index.js index 13a26650..9aa98ebc 100644 --- a/packages/textarea/dist/es2015/index.js +++ b/packages/textarea/dist/es2015/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -185,7 +178,7 @@ const uxTextAreaElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}" +var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}"; class UxTextAreaTheme { constructor() { diff --git a/packages/textarea/dist/es2015/ux-textarea.js b/packages/textarea/dist/es2015/ux-textarea.js deleted file mode 100644 index 06a682bb..00000000 --- a/packages/textarea/dist/es2015/ux-textarea.js +++ /dev/null @@ -1,159 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -import { observable } from 'aurelia-framework'; -let UxTextArea = class UxTextArea { - constructor(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); - } - bind() { - const element = this.element; - const textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; - } - if (element.hasAttribute('placeholder')) { - const attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); - } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - } - attached() { - const textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - } - detached() { - const textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - } - getValue() { - return this.value; - } - setValue(value) { - const oldValue = this.value; - const newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); - this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - } - rawValueChanged(rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - } - themeChanged(newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - } - fitTextContent() { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = `${this.textbox.scrollHeight + 2}px`; - } - } - focusChanged(focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - } -}; -__decorate([ - bindable -], UxTextArea.prototype, "autofocus", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "autoResize", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "cols", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "disabled", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "focus", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "maxlength", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "minlength", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "readonly", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "rows", void 0); -__decorate([ - bindable -], UxTextArea.prototype, "theme", void 0); -__decorate([ - observable({ initializer: () => '' }) -], UxTextArea.prototype, "rawValue", void 0); -UxTextArea = __decorate([ - inject(Element, StyleEngine), - customElement('ux-textarea') -], UxTextArea); -export { UxTextArea }; -function stopEvent(e) { - e.stopPropagation(); -} -const getVm = (_) => _.au.controller.viewModel; -const uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get() { - return getVm(this).getValue(); - }, - set(value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/textarea/dist/native-modules/index.js b/packages/textarea/dist/native-modules/index.js index c4ca9f10..38c4a9f6 100644 --- a/packages/textarea/dist/native-modules/index.js +++ b/packages/textarea/dist/native-modules/index.js @@ -19,13 +19,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/* global Reflect, Promise */ - - - - - - function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -186,7 +179,7 @@ var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { } }); -var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}" +var css = "ux-textarea{display:block;width:100%}ux-textarea>textarea{width:100%;padding:6px 0 4px 0;margin-bottom:4px;border:0;outline:0;resize:none;padding-left:0;padding-right:0;transition:border-color 250ms ease;color:inherit;color:var(--ux-theme--textarea-foreground, inherit);background-color:transparent;background-color:var(--ux-theme--textarea-background, transparent);border-bottom:1px solid #9e9e9e;border-bottom:var(--ux-theme--textarea-border-bottom, 1px solid #9E9E9E)}ux-textarea>textarea:hover,ux-textarea>textarea:focus{border-bottom:1px solid #ff4081;border-bottom:var(--ux-theme--textarea-border-bottom-focus, 1px solid var(--ux-design--accent, #FF4081))}ux-textarea>textarea:focus{border-bottom-width:2px;padding-bottom:3px}ux-textarea>textarea[disabled],ux-textarea>textarea[disabled]:hover,ux-textarea>textarea[disabled]:focus,ux-textarea>textarea[readonly],ux-textarea>textarea[readonly]:hover,ux-textarea>textarea[readonly]:focus{color:#a4a4a4;color:var(--ux-theme--textarea-disabled-foreground, #A4A4A4);border-bottom:1px dashed #a4a4a4;border-bottom:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #A4A4A4)}ux-textarea.show-grip>ux-textarea>textarea{resize:both}ux-textarea.full-width>ux-textarea>textarea{padding:20px 8px;margin-bottom:0;font-size:16px;color:#232323;color:var(--ux-theme--textarea-full-width-foreground, #232323);border:1px solid #eee;border:var(--ux-theme--textarea-full-width-border, 1px solid #EEEEEE);background-color:#fff;background-color:var(--ux-theme--textarea-full-width-background, #FFF)}ux-textarea.full-width>ux-textarea>textarea[disabled] ux-textarea.full-width>ux-textarea>textarea[disabled]:hover,ux-textarea.full-width>ux-textarea>textarea[disabled]:focus,ux-textarea.full-width>ux-textarea>textarea[readonly],ux-textarea.full-width>ux-textarea>textarea[readonly]:hover,ux-textarea.full-width>ux-textarea>textarea[readonly]:focus{background-color:#eee;background-color:var(--ux-theme--textarea-full-width-background-disabled, #EEEEEE);border:1px dashed #e0e0e0;border:var(--ux-theme--textarea-disabled-border-bottom, 1px dashed #E0E0E0);color:#e0e0e0;color:var(--ux-theme--textarea-disabled-foreground, #E0E0E0)}ux-textarea.has-error ux-textarea>textarea{border-bottom-color:#f44336;border-bottom-color:var(--ux-theme--textarea-error, #F44336)}ux-textarea.full-width.has-error ux-textarea>textarea{border-color:#f44336;border-color:var(--ux-theme--textarea-error, #F44336)}"; var UxTextAreaTheme = /** @class */ (function () { function UxTextAreaTheme() { diff --git a/packages/textarea/dist/native-modules/ux-textarea.js b/packages/textarea/dist/native-modules/ux-textarea.js deleted file mode 100644 index e63ca3e8..00000000 --- a/packages/textarea/dist/native-modules/ux-textarea.js +++ /dev/null @@ -1,160 +0,0 @@ -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; -}; -import { customElement, bindable } from 'aurelia-templating'; -import { DOM } from 'aurelia-pal'; -import { inject } from 'aurelia-dependency-injection'; -import { StyleEngine } from '@aurelia-ux/core'; -import { observable } from 'aurelia-framework'; -var UxTextArea = /** @class */ (function () { - function UxTextArea(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); - } - UxTextArea.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); - } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - }; - UxTextArea.prototype.attached = function () { - var textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - }; - UxTextArea.prototype.detached = function () { - var textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - }; - UxTextArea.prototype.getValue = function () { - return this.value; - }; - UxTextArea.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); - this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxTextArea.prototype.rawValueChanged = function (rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - }; - UxTextArea.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTextArea.prototype.fitTextContent = function () { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; - } - }; - UxTextArea.prototype.focusChanged = function (focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - }; - __decorate([ - bindable - ], UxTextArea.prototype, "autofocus", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "autoResize", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "cols", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "disabled", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "focus", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "maxlength", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "minlength", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "readonly", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "rows", void 0); - __decorate([ - bindable - ], UxTextArea.prototype, "theme", void 0); - __decorate([ - observable({ initializer: function () { return ''; } }) - ], UxTextArea.prototype, "rawValue", void 0); - UxTextArea = __decorate([ - inject(Element, StyleEngine), - customElement('ux-textarea') - ], UxTextArea); - return UxTextArea; -}()); -export { UxTextArea }; -function stopEvent(e) { - e.stopPropagation(); -} -var getVm = function (_) { return _.au.controller.viewModel; }; -var uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } -}); diff --git a/packages/textarea/dist/system/ux-textarea.js b/packages/textarea/dist/system/ux-textarea.js deleted file mode 100644 index 5260f70d..00000000 --- a/packages/textarea/dist/system/ux-textarea.js +++ /dev/null @@ -1,181 +0,0 @@ -System.register(["aurelia-templating", "aurelia-pal", "aurelia-dependency-injection", "@aurelia-ux/core", "aurelia-framework"], function (exports_1, context_1) { - "use strict"; - 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; - }; - var __moduleName = context_1 && context_1.id; - function stopEvent(e) { - e.stopPropagation(); - } - var aurelia_templating_1, aurelia_pal_1, aurelia_dependency_injection_1, core_1, aurelia_framework_1, UxTextArea, getVm, uxTextAreaElementProto; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, - function (core_1_1) { - core_1 = core_1_1; - }, - function (aurelia_framework_1_1) { - aurelia_framework_1 = aurelia_framework_1_1; - } - ], - execute: function () { - UxTextArea = /** @class */ (function () { - function UxTextArea(element, styleEngine) { - this.element = element; - this.styleEngine = styleEngine; - this.autofocus = null; - this.autoResize = false; - this.disabled = false; - this.focus = false; - this.readonly = false; - this.value = undefined; - Object.setPrototypeOf(element, uxTextAreaElementProto); - } - UxTextArea.prototype.bind = function () { - var element = this.element; - var textbox = this.textbox; - if (this.theme != null) { - this.themeChanged(this.theme); - } - if (this.autofocus || this.autofocus === '') { - this.focus = true; - } - if (element.hasAttribute('placeholder')) { - var attributeValue = element.getAttribute('placeholder'); - if (attributeValue) { - textbox.setAttribute('placeholder', attributeValue); - element.removeAttribute('placeholder'); - } - } - if (this.cols) { - textbox.setAttribute('cols', this.cols.toString()); - element.removeAttribute('cols'); - } - if (this.rows) { - textbox.setAttribute('rows', this.rows.toString()); - element.removeAttribute('rows'); - } - if (this.minlength) { - textbox.setAttribute('minlength', this.minlength.toString()); - } - if (this.maxlength) { - textbox.setAttribute('maxlength', this.maxlength.toString()); - } - }; - UxTextArea.prototype.attached = function () { - var textbox = this.textbox; - this.isAttached = true; - this.textbox.addEventListener('change', stopEvent); - this.textbox.addEventListener('input', stopEvent); - this.fitTextContent(); - textbox.addEventListener('change', stopEvent); - textbox.addEventListener('input', stopEvent); - }; - UxTextArea.prototype.detached = function () { - var textbox = this.textbox; - this.isAttached = false; - textbox.removeEventListener('change', stopEvent); - textbox.removeEventListener('input', stopEvent); - }; - UxTextArea.prototype.getValue = function () { - return this.value; - }; - UxTextArea.prototype.setValue = function (value) { - var oldValue = this.value; - var newValue = value === null || value === undefined ? null : value.toString(); - if (oldValue !== newValue) { - this.value = newValue; - this.ignoreRawChanges = true; - this.rawValue = newValue === null ? '' : newValue.toString(); - this.fitTextContent(); - this.ignoreRawChanges = false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent('change', { bubbles: true })); - } - }; - UxTextArea.prototype.rawValueChanged = function (rawValue) { - if (this.ignoreRawChanges) { - return; - } - this.setValue(rawValue); - }; - UxTextArea.prototype.themeChanged = function (newValue) { - if (newValue != null && newValue.themeKey == null) { - newValue.themeKey = 'textarea'; - } - this.styleEngine.applyTheme(newValue, this.element); - }; - UxTextArea.prototype.fitTextContent = function () { - if (this.isAttached && (this.autoResize || this.autoResize === '')) { - this.textbox.style.height = 'auto'; - this.textbox.style.height = this.textbox.scrollHeight + 2 + "px"; - } - }; - UxTextArea.prototype.focusChanged = function (focus) { - focus = focus || focus === '' ? true : false; - this.element.dispatchEvent(aurelia_pal_1.DOM.createCustomEvent(focus ? 'focus' : 'blur', { bubbles: true })); - }; - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autofocus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "autoResize", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "cols", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "disabled", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "focus", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "maxlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "minlength", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "readonly", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "rows", void 0); - __decorate([ - aurelia_templating_1.bindable - ], UxTextArea.prototype, "theme", void 0); - __decorate([ - aurelia_framework_1.observable({ initializer: function () { return ''; } }) - ], UxTextArea.prototype, "rawValue", void 0); - UxTextArea = __decorate([ - aurelia_dependency_injection_1.inject(Element, core_1.StyleEngine), - aurelia_templating_1.customElement('ux-textarea') - ], UxTextArea); - return UxTextArea; - }()); - exports_1("UxTextArea", UxTextArea); - getVm = function (_) { return _.au.controller.viewModel; }; - uxTextAreaElementProto = Object.create(HTMLElement.prototype, { - value: { - get: function () { - return getVm(this).getValue(); - }, - set: function (value) { - getVm(this).setValue(value); - } - } - }); - } - }; -});