@koalarx/ui
Version:
Koala UI is a Design System developed in Angular whose objective is to facilitate and make your development faster and simpler, making this framework your greatest ally.
116 lines (111 loc) • 10.2 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, ViewChild, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@angular/router';
import { RouterModule } from '@angular/router';
import * as i3 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i4 from '@koalarx/ui/icon';
import { KoalaIconModule } from '@koalarx/ui/icon';
import { MatButtonModule } from '@angular/material/button';
class FolderComponent {
constructor() {
this.titlePage = 'Title';
this.customFolderFontColor = '#212121';
this.customFolderBackgroudColor = '#FFF';
}
ngOnInit() {
this.setCustomBackgroundColor();
}
ngOnChanges(changes) {
if (changes.customBackgroudColor || changes.customFolderFontColor) {
this.setCustomBackgroundColor();
}
}
getKoalaIcon() {
return this.titleIcon;
}
setCustomBackgroundColor() {
var _a, _b, _c;
if (this.customFolderBackgroudColor) {
const folder = (_a = this.folder) === null || _a === void 0 ? void 0 : _a.nativeElement;
folder.style.background = this.customFolderBackgroudColor;
}
if (this.customFolderFontColor) {
const folderTitle = (_b = this.folderTitle) === null || _b === void 0 ? void 0 : _b.nativeElement;
folderTitle.style.color = this.customFolderFontColor;
const folderIconTitle = (_c = this.folderTitle) === null || _c === void 0 ? void 0 : _c.nativeElement;
folderIconTitle.style.color = this.customFolderFontColor;
setTimeout(() => {
if (this.folderNavigateHistory) {
const folderNavigateHistory = this.folderNavigateHistory.nativeElement;
folderNavigateHistory.style.color = this.customFolderFontColor;
}
}, 50);
}
}
}
FolderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FolderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
FolderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FolderComponent, selector: "koala-folder-page", inputs: { titlePage: "titlePage", titleIcon: "titleIcon", koalaIcon: "koalaIcon", customFolderFontColor: "customFolderFontColor", customFolderBackgroudColor: "customFolderBackgroudColor", navigateHistory: "navigateHistory" }, viewQueries: [{ propertyName: "folder", first: true, predicate: ["folder"], descendants: true, static: true }, { propertyName: "folderTitle", first: true, predicate: ["folderTitle"], descendants: true, static: true }, { propertyName: "folderNavigateHistory", first: true, predicate: ["folderNavigateHistory"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #folder class=\"folder-list\">\n <h1 #folderTitle>\n <mat-icon #folderIconTitle *ngIf=\"titleIcon && !koalaIcon\">{{titleIcon}}</mat-icon>\n <koala-icon *ngIf=\"titleIcon && koalaIcon\" [size]=\"20\" [color]=\"customFolderFontColor\" [icon]=\"getKoalaIcon()\"></koala-icon>\n {{titlePage}}\n </h1>\n <ul #folderNavigateHistory class=\"navigate-history\" *ngIf=\"navigateHistory\">\n <li *ngFor=\"let item of navigateHistory\">\n <a [style]=\"'color: ' + customFolderFontColor\" [ngClass]=\"{'disabled': !item.routerLink}\" [routerLink]=\"item.routerLink\">{{item.name}}</a>\n </li>\n </ul>\n <nav class=\"menu-folder\">\n <ng-content select=\"[menu-page]\"></ng-content>\n </nav>\n\n <div class=\"content\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n\n</div>\n", styles: [".folder-list{position:relative;background-size:cover;width:100%;height:160px;box-sizing:border-box}.folder-list h1{padding:0;margin:0;position:absolute;top:20px;left:20px;font-size:1.2em;font-family:OpenSans,sans-serif;font-weight:700;display:flex;align-items:center}.folder-list h1 mat-icon,.folder-list h1 koala-icon{margin-right:10px}nav.menu-folder{position:absolute;right:0;top:20px;z-index:4;padding:7px 30px}.content{position:relative;display:block;height:calc(100vh - 155px);overflow-x:hidden;top:85px;margin:0 auto;padding:3px 0}.navigate-history{position:absolute;top:45px;display:flex;align-items:center;list-style:none;padding:5px 20px;margin:0;font-size:0}.navigate-history li a{font-size:12px;text-decoration:none}.navigate-history li a.disabled{cursor:default;opacity:.8;pointer-events:none}.navigate-history li:after{content:\">\";padding:0 5px;font-size:12px;color:inherit}.navigate-history li:last-child:after{content:\"\";padding:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.IconComponent, selector: "koala-icon", inputs: ["color", "icon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FolderComponent, decorators: [{
type: Component,
args: [{ selector: 'koala-folder-page', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #folder class=\"folder-list\">\n <h1 #folderTitle>\n <mat-icon #folderIconTitle *ngIf=\"titleIcon && !koalaIcon\">{{titleIcon}}</mat-icon>\n <koala-icon *ngIf=\"titleIcon && koalaIcon\" [size]=\"20\" [color]=\"customFolderFontColor\" [icon]=\"getKoalaIcon()\"></koala-icon>\n {{titlePage}}\n </h1>\n <ul #folderNavigateHistory class=\"navigate-history\" *ngIf=\"navigateHistory\">\n <li *ngFor=\"let item of navigateHistory\">\n <a [style]=\"'color: ' + customFolderFontColor\" [ngClass]=\"{'disabled': !item.routerLink}\" [routerLink]=\"item.routerLink\">{{item.name}}</a>\n </li>\n </ul>\n <nav class=\"menu-folder\">\n <ng-content select=\"[menu-page]\"></ng-content>\n </nav>\n\n <div class=\"content\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n\n</div>\n", styles: [".folder-list{position:relative;background-size:cover;width:100%;height:160px;box-sizing:border-box}.folder-list h1{padding:0;margin:0;position:absolute;top:20px;left:20px;font-size:1.2em;font-family:OpenSans,sans-serif;font-weight:700;display:flex;align-items:center}.folder-list h1 mat-icon,.folder-list h1 koala-icon{margin-right:10px}nav.menu-folder{position:absolute;right:0;top:20px;z-index:4;padding:7px 30px}.content{position:relative;display:block;height:calc(100vh - 155px);overflow-x:hidden;top:85px;margin:0 auto;padding:3px 0}.navigate-history{position:absolute;top:45px;display:flex;align-items:center;list-style:none;padding:5px 20px;margin:0;font-size:0}.navigate-history li a{font-size:12px;text-decoration:none}.navigate-history li a.disabled{cursor:default;opacity:.8;pointer-events:none}.navigate-history li:after{content:\">\";padding:0 5px;font-size:12px;color:inherit}.navigate-history li:last-child:after{content:\"\";padding:0}\n"] }]
}], propDecorators: { titlePage: [{
type: Input
}], titleIcon: [{
type: Input
}], koalaIcon: [{
type: Input
}], customFolderFontColor: [{
type: Input
}], customFolderBackgroudColor: [{
type: Input
}], navigateHistory: [{
type: Input
}], folder: [{
type: ViewChild,
args: ['folder', { static: true }]
}], folderTitle: [{
type: ViewChild,
args: ['folderTitle', { static: true }]
}], folderNavigateHistory: [{
type: ViewChild,
args: ['folderNavigateHistory', { static: false }]
}] } });
class KoalaFolderPageModule {
}
KoalaFolderPageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaFolderPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
KoalaFolderPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: KoalaFolderPageModule, declarations: [FolderComponent], imports: [CommonModule,
RouterModule,
MatButtonModule,
MatIconModule,
KoalaIconModule], exports: [FolderComponent] });
KoalaFolderPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaFolderPageModule, imports: [CommonModule,
RouterModule,
MatButtonModule,
MatIconModule,
KoalaIconModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaFolderPageModule, decorators: [{
type: NgModule,
args: [{
declarations: [
FolderComponent
],
exports: [
FolderComponent
],
imports: [
CommonModule,
RouterModule,
MatButtonModule,
MatIconModule,
KoalaIconModule
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FolderComponent, KoalaFolderPageModule };
//# sourceMappingURL=koalarx-ui-folder-page.mjs.map