UNPKG

ngx-obelisco-example

Version:

Componentes funcionales y reutilizables para Angular.

50 lines 15.2 kB
import { Component, ContentChild, ElementRef, Input } from '@angular/core'; import { OCustomContentDirective } from 'ngx-obelisco-example/directives'; import * as i0 from "@angular/core"; import * as i1 from "@angular/platform-browser"; import * as i2 from "@angular/common"; import * as i3 from "./o-highlighted-title/o-highlighted-title.component"; import * as i4 from "./o-highlighted-footer/o-highlighted-footer.component"; import * as i5 from "./o-highlighted-description/o-highlighted-description.component"; import * as i6 from "./o-highlighted-image/o-highlighted-image.component"; import * as i7 from "./o-highlighted-video/o-highlighted-video.component"; export class OHighlightedComponent { constructor(sanitizer) { this.sanitizer = sanitizer; this.isBgLight = false; this.type = 'banner'; this.customClasses = ''; } sanitizeUrl(url) { return this.sanitizer.bypassSecurityTrustResourceUrl(url); } } OHighlightedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OHighlightedComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); OHighlightedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: OHighlightedComponent, selector: "o-highlighted", inputs: { isBgLight: "isBgLight", type: "type", customClasses: "customClasses", title: "title", description: "description", image: "image", video: "video", iframe: "iframe" }, queries: [{ propertyName: "oCustomContent", first: true, predicate: OCustomContentDirective, descendants: true, static: true }, { propertyName: "children", first: true, predicate: ["children"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-template #highlightedContent>\r\n <ng-content select=\"o-highlighted-image\"></ng-content>\r\n <ng-content select=\"o-highlighted-video\"></ng-content>\r\n <o-highlighted-image *ngIf=\"image\" [image]=\"image\"></o-highlighted-image>\r\n <o-highlighted-video *ngIf=\"video\" [video]=\"video\"></o-highlighted-video>\r\n <o-highlighted-video *ngIf=\"iframe\" [iframe]=\"iframe\"></o-highlighted-video>\r\n\r\n <div class=\"card-body\">\r\n <ng-container *ngIf=\"!oCustomContent\">\r\n <ng-content select=\"o-highlighted-header\"></ng-content>\r\n <o-highlighted-title *ngIf=\"title\">{{ title }}</o-highlighted-title>\r\n\r\n <ng-content select=\"o-highlighted-content\"></ng-content>\r\n <o-highlighted-description *ngIf=\"description\">{{ description }}</o-highlighted-description>\r\n\r\n <ng-content select=\"o-highlighted-footer\"></ng-content>\r\n <o-highlighted-footer *ngIf=\"children\"><ng-content></ng-content></o-highlighted-footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"oCustomContent\" [ngTemplateOutlet]=\"oCustomContent.template\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-container *ngIf=\"type === 'banner'\">\r\n <div class=\"panel-horizontal-content\" [class.bg-light]=\"isBgLight\" [ngClass]=\"customClasses\">\r\n <div class=\"card card-simple panel-horizontal\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"type === 'grouping'\">\r\n <div class=\"card card-simple panel-vertical\" [ngClass]=\"customClasses\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"type === 'lateral'\">\r\n <div class=\"card card-simple panel-lateral\" [ngClass]=\"customClasses\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n</ng-container>\r\n", styles: ["::ng-deep .card.panel-horizontal .card-body .panel-footer o-access,.card.panel-vertical .card-body .panel-footer o-access,.card.panel-lateral .card-body .panel-footer o-access{width:100%;max-width:340px}::ng-deep .card.panel-lateral .card-body .panel-footer o-button,::ng-deep .card.panel-lateral .card-body .panel-footer o-access{width:100%}::ng-deep .panel-horizontal-content .card.panel-horizontal o-highlighted-image,::ng-deep .panel-horizontal-content .card.panel-horizontal o-highlighted-video{flex-shrink:0}::ng-deep .card-deck.max-cards-2.card-column .card.panel-horizontal o-access,::ng-deep .card-deck.max-cards-2.card-column .card.panel-vertical o-access,::ng-deep .card-deck.max-cards-2.card-column .card.panel-lateral o-access{width:100%;max-width:340px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.OHighlightedTitleComponent, selector: "o-highlighted-title", inputs: ["customClasses"] }, { kind: "component", type: i4.OHighlightedFooterComponent, selector: "o-highlighted-footer", inputs: ["customClasses"] }, { kind: "component", type: i5.OHighlightedDescriptionComponent, selector: "o-highlighted-description", inputs: ["customClasses"] }, { kind: "component", type: i6.OHighlightedImageComponent, selector: "o-highlighted-image", inputs: ["image", "customClasses"] }, { kind: "component", type: i7.OHighlightedVideoComponent, selector: "o-highlighted-video", inputs: ["video", "iframe", "customClasses"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OHighlightedComponent, decorators: [{ type: Component, args: [{ selector: 'o-highlighted', template: "<ng-template #highlightedContent>\r\n <ng-content select=\"o-highlighted-image\"></ng-content>\r\n <ng-content select=\"o-highlighted-video\"></ng-content>\r\n <o-highlighted-image *ngIf=\"image\" [image]=\"image\"></o-highlighted-image>\r\n <o-highlighted-video *ngIf=\"video\" [video]=\"video\"></o-highlighted-video>\r\n <o-highlighted-video *ngIf=\"iframe\" [iframe]=\"iframe\"></o-highlighted-video>\r\n\r\n <div class=\"card-body\">\r\n <ng-container *ngIf=\"!oCustomContent\">\r\n <ng-content select=\"o-highlighted-header\"></ng-content>\r\n <o-highlighted-title *ngIf=\"title\">{{ title }}</o-highlighted-title>\r\n\r\n <ng-content select=\"o-highlighted-content\"></ng-content>\r\n <o-highlighted-description *ngIf=\"description\">{{ description }}</o-highlighted-description>\r\n\r\n <ng-content select=\"o-highlighted-footer\"></ng-content>\r\n <o-highlighted-footer *ngIf=\"children\"><ng-content></ng-content></o-highlighted-footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"oCustomContent\" [ngTemplateOutlet]=\"oCustomContent.template\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-container *ngIf=\"type === 'banner'\">\r\n <div class=\"panel-horizontal-content\" [class.bg-light]=\"isBgLight\" [ngClass]=\"customClasses\">\r\n <div class=\"card card-simple panel-horizontal\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"type === 'grouping'\">\r\n <div class=\"card card-simple panel-vertical\" [ngClass]=\"customClasses\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"type === 'lateral'\">\r\n <div class=\"card card-simple panel-lateral\" [ngClass]=\"customClasses\">\r\n <ng-container *ngTemplateOutlet=\"highlightedContent\"></ng-container>\r\n </div>\r\n</ng-container>\r\n", styles: ["::ng-deep .card.panel-horizontal .card-body .panel-footer o-access,.card.panel-vertical .card-body .panel-footer o-access,.card.panel-lateral .card-body .panel-footer o-access{width:100%;max-width:340px}::ng-deep .card.panel-lateral .card-body .panel-footer o-button,::ng-deep .card.panel-lateral .card-body .panel-footer o-access{width:100%}::ng-deep .panel-horizontal-content .card.panel-horizontal o-highlighted-image,::ng-deep .panel-horizontal-content .card.panel-horizontal o-highlighted-video{flex-shrink:0}::ng-deep .card-deck.max-cards-2.card-column .card.panel-horizontal o-access,::ng-deep .card-deck.max-cards-2.card-column .card.panel-vertical o-access,::ng-deep .card-deck.max-cards-2.card-column .card.panel-lateral o-access{width:100%;max-width:340px}\n"] }] }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; }, propDecorators: { isBgLight: [{ type: Input }], type: [{ type: Input }], customClasses: [{ type: Input }], title: [{ type: Input }], description: [{ type: Input }], image: [{ type: Input }], video: [{ type: Input }], iframe: [{ type: Input }], oCustomContent: [{ type: ContentChild, args: [OCustomContentDirective, { static: true }] }], children: [{ type: ContentChild, args: ['children', { read: ElementRef }] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiby1oaWdobGlnaHRlZC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtb2JlbGlzY28vaGlnaGxpZ2h0ZWQvby1oaWdobGlnaHRlZC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtb2JlbGlzY28vaGlnaGxpZ2h0ZWQvby1oaWdobGlnaHRlZC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRzNFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDOzs7Ozs7Ozs7QUFPMUUsTUFBTSxPQUFPLHFCQUFxQjtJQWNoQyxZQUFvQixTQUF1QjtRQUF2QixjQUFTLEdBQVQsU0FBUyxDQUFjO1FBYjNCLGNBQVMsR0FBYSxLQUFLLENBQUM7UUFDNUIsU0FBSSxHQUFxQixRQUFRLENBQUM7UUFDbEMsa0JBQWEsR0FBVyxFQUFFLENBQUM7SUFXRyxDQUFDO0lBRS9DLFdBQVcsQ0FBQyxHQUFXO1FBQ3JCLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyw4QkFBOEIsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUM1RCxDQUFDOztrSEFsQlUscUJBQXFCO3NHQUFyQixxQkFBcUIsaVJBV2xCLHVCQUF1QixnSUFDSC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