@vendasta/store
Version:
Components and data for Store
45 lines (44 loc) • 5.73 kB
JavaScript
import { Component, EventEmitter, Input, Output } from '@angular/core';
var VaHeaderContainerComponent = /** @class */ (function () {
function VaHeaderContainerComponent() {
this.prerequisiteSelected = new EventEmitter();
this.actionSelected = new EventEmitter();
this.pricingActionSelected = new EventEmitter();
}
VaHeaderContainerComponent.prototype.onActionSelected = function () {
this.actionSelected.emit();
};
VaHeaderContainerComponent.prototype.onPrerequisiteSelected = function () {
this.prerequisiteSelected.emit();
};
VaHeaderContainerComponent.decorators = [
{ type: Component, args: [{
selector: 'va-header-container',
template: "<div class=\"header-container\"> <div class=\"product-overview\"> <div class=\"product-id\"> <va-icon [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"120\"></va-icon> <div class=\"product-id-text\"> <h1 [ngClass]=\"{'stencil-title stencil-shimmer': !title, 'product-title': title}\"> {{ title }} </h1> <span [ngClass]=\"{'stencil-tagline stencil-shimmer': !title && !tagline, 'tagline': tagline}\"> {{ tagline }} </span> <div *ngIf=\"prerequisite\" class=\"prerequisite\"> <span class=\"requires-text\">Requires </span> <span>{{ prerequisite }}</span> </div> <mat-chip-list> <mat-chip *ngFor=\"let chip of chipLabels\">{{ chip }}</mat-chip> </mat-chip-list> </div> </div> <div class=\"pricing\"> <button *ngIf=\"showAction\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!actionEnabled\" (click)=\"onActionSelected()\"> {{ actionLabel }} </button> <div *ngIf=\"prerequisiteLabel\" class=\"addon-enable\" (click)=\"onPrerequisiteSelected()\"> Enabled with {{prerequisiteLabel}} </div> <div *ngIf=\"showPricing\" class=\"price-box\"> <div *ngIf=\"pricing?.prices?.length\" class=\"wholesale-price\">{{ pricingLabel }}</div> <va-pricing [pricing]=\"pricing\"></va-pricing> </div> <p *ngIf=\"pricingActionEnabled\" class=\"pricing-action-container\"> <a (click)=\"pricingActionSelected.emit()\"><mat-icon>local_offer</mat-icon>{{ pricingActionLabel }}</a> </p> </div> </div> </div> ",
styles: [":host { font-size: 16px; } .product-title { font-size: 24px; } @media screen and (min-width: 600px) { .product-title { font-size: 32px; } } .product-overview { display: flex; flex-wrap: wrap; border-bottom: 1px solid #e0e0e0; } .product-overview h1 { margin: 0; font-weight: normal; line-height: 1.2; } .product-overview mat-chip { margin-bottom: 3px; } .product-id { display: flex; width: 100%; padding: 24px; flex-grow: 1; } .product-id va-icon { margin-right: 20px; } @media screen and (max-width: 600px) { .product-id va-icon ::ng-deep .va-icon-container { width: 40px !important; height: 40px !important; } .product-id va-icon ::ng-deep .va-icon-container span { line-height: 40px !important; font-size: 15px !important; } } .product-id .product-id-text { display: flex; flex-direction: column; justify-content: center; } .product-id span { overflow: hidden; } .product-id .tagline { color: #616161; margin: 0.5em 0 1em; font-size: 16px; } @media screen and (min-width: 600px) { .product-id .tagline { font-size: 20px; } } @media screen and (min-width: 600px) { .product-id { width: 66%; padding-right: 20px; } } .product-id .prerequisite { margin: 0.5em 0 1em; font-size: 14px; } .product-id .requires-text { color: #9e9e9e; } .inline-link { display: inline-flex !important; color: #1e88e5; cursor: pointer; padding-top: 5px; } .pricing { display: flex; flex-direction: column; width: 100%; padding: 0 24px 24px; color: #616161; } @media screen and (min-width: 600px) { .pricing { width: 34%; padding-top: 24px; padding-left: 20px; } } .pricing span { display: block; } .pricing span:nth-child(2) { margin: 0.5em 0 1em; } .pricing .price { font-size: 24px; font-weight: bold; line-height: 1; color: #4caf50; } .pricing .price-box { padding-top: 10px; } .pricing .pricing-action-container { margin: 8px 0px; } .pricing .pricing-action-container mat-icon { vertical-align: middle; margin-right: 6px; } .pricing .pricing-action-container a { cursor: pointer; } .app-enable-button { height: inherit; color: #ffffff; background-color: #4caf50; font-size: 20px; padding: 14px 16px; line-height: 1; } .addon-enable { height: inherit; background-color: #e0e0e0; font-size: 14px; padding: 14px 16px; line-height: 1; color: #1e88e5; cursor: pointer; text-align: center; } .wholesale-price { margin-top: 0; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid #e0e0e0; } .stencil-title { height: 32px; width: 200px; margin-bottom: 5px !important; } .stencil-tagline { height: 32px; width: 250px; } "]
},] },
];
/** @nocollapse */
VaHeaderContainerComponent.ctorParameters = function () { return []; };
VaHeaderContainerComponent.propDecorators = {
'iconUrl': [{ type: Input },],
'title': [{ type: Input },],
'tagline': [{ type: Input },],
'prerequisite': [{ type: Input },],
'chipLabels': [{ type: Input },],
'pricing': [{ type: Input },],
'pricingLabel': [{ type: Input },],
'pricingActionLabel': [{ type: Input },],
'pricingActionEnabled': [{ type: Input },],
'actionEnabled': [{ type: Input },],
'actionLabel': [{ type: Input },],
'showAction': [{ type: Input },],
'showPricing': [{ type: Input },],
'prerequisiteLabel': [{ type: Input },],
'prerequisiteSelected': [{ type: Output },],
'actionSelected': [{ type: Output },],
'pricingActionSelected': [{ type: Output },],
};
return VaHeaderContainerComponent;
}());
export { VaHeaderContainerComponent };