@akveo/nga-theme
Version:
@akveo/nga-theme
159 lines • 6.5 kB
JavaScript
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, Input, HostBinding, } from '@angular/core';
import { convertToBoolProperty } from '../helpers';
/**
* Action item, display a link with an icon, or any other content provided instead.
*/
var NgaActionComponent = (function () {
function NgaActionComponent() {
this.disabledValue = false;
}
Object.defineProperty(NgaActionComponent.prototype, "disabled", {
/**
* Disables the item (changes item opacity and mouse cursor)
* @type boolean
*/
set: function (val) {
this.disabledValue = convertToBoolProperty(val);
},
enumerable: true,
configurable: true
});
return NgaActionComponent;
}());
__decorate([
HostBinding('class.disabled'),
__metadata("design:type", Boolean)
], NgaActionComponent.prototype, "disabledValue", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NgaActionComponent.prototype, "icon", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NgaActionComponent.prototype, "disabled", null);
NgaActionComponent = __decorate([
Component({
selector: 'nga-action',
template: "\n <a href=\"#\" *ngIf=\"icon; else showContent\" (click)=\"$event.preventDefault()\">\n <i class=\"control-icon {{ icon }}\"></i>\n </a>\n <ng-template #showContent>\n <ng-content></ng-content>\n </ng-template>\n ",
})
], NgaActionComponent);
export { NgaActionComponent };
/**
* Shows a a horizontal list of actions, available in multiple sizes
* Aligns items vertically.
*
* @theme
* $nga-actions-size-small: 1.5rem !default;
* $nga-actions-size-medium: 2.5rem !default;
* $nga-actions-size-large: 4rem !default;
* $nga-actions-color: $nga-color-inverse !default;
* $nga-actions-background: transparent !default;
* $nga-actions-color-inverse: $nga-color-default !default;
* $nga-actions-background-inverse: $nga-background-inverse !default;
*/
var NgaActionsComponent = NgaActionsComponent_1 = (function () {
function NgaActionsComponent() {
}
Object.defineProperty(NgaActionsComponent.prototype, "small", {
get: function () {
return this.sizeValue === NgaActionsComponent_1.SIZE_SMALL;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgaActionsComponent.prototype, "medium", {
get: function () {
return this.sizeValue === NgaActionsComponent_1.SIZE_MEDIUM;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgaActionsComponent.prototype, "large", {
get: function () {
return this.sizeValue === NgaActionsComponent_1.SIZE_LARGE;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgaActionsComponent.prototype, "size", {
/**
* Size of the component, small|medium|large
* @type string
*/
set: function (val) {
this.sizeValue = val;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgaActionsComponent.prototype, "inverse", {
/**
* Makes colors inverse based on current theme
* @type boolean
*/
set: function (val) {
this.inverseValue = convertToBoolProperty(val);
},
enumerable: true,
configurable: true
});
return NgaActionsComponent;
}());
NgaActionsComponent.SIZE_SMALL = 'small';
NgaActionsComponent.SIZE_MEDIUM = 'medium';
NgaActionsComponent.SIZE_LARGE = 'large';
__decorate([
HostBinding('class.inverse'),
__metadata("design:type", Boolean)
], NgaActionsComponent.prototype, "inverseValue", void 0);
__decorate([
HostBinding('class.small'),
__metadata("design:type", Object),
__metadata("design:paramtypes", [])
], NgaActionsComponent.prototype, "small", null);
__decorate([
HostBinding('class.medium'),
__metadata("design:type", Object),
__metadata("design:paramtypes", [])
], NgaActionsComponent.prototype, "medium", null);
__decorate([
HostBinding('class.large'),
__metadata("design:type", Object),
__metadata("design:paramtypes", [])
], NgaActionsComponent.prototype, "large", null);
__decorate([
Input(),
__metadata("design:type", String),
__metadata("design:paramtypes", [String])
], NgaActionsComponent.prototype, "size", null);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NgaActionsComponent.prototype, "inverse", null);
NgaActionsComponent = NgaActionsComponent_1 = __decorate([
Component({
selector: 'nga-actions',
styles: [":host{display:flex;align-items:center}:host /deep/ nga-action{display:flex;flex-wrap:wrap;align-items:center}:host /deep/ nga-action:first-child{border-left:none !important}:host /deep/ nga-action i.control-icon:hover{cursor:pointer}:host /deep/ nga-action.disabled{cursor:not-allowed}:host /deep/ nga-action.disabled>*{opacity:0.5}:host /deep/ nga-action.disabled a,:host /deep/ nga-action.disabled i{cursor:not-allowed !important} "],
template: "\n <ng-content select=\"nga-action\"></ng-content>\n ",
})
], NgaActionsComponent);
export { NgaActionsComponent };
var NgaActionsComponent_1;
//# sourceMappingURL=actions.component.js.map