@vendasta/store
Version:
Components and data for Store
40 lines (39 loc) • 2.24 kB
JavaScript
import { Component, Input } from '@angular/core';
var ListStencilComponent = /** @class */ (function () {
function ListStencilComponent() {
this.showHeader = true;
this.numRows = 3;
this.rowHeight = '51px'; // defaults to height of partner center business tab height (95px for marketplace)
this.sidePadding = '17px'; // defaults to padding on partner center business padding (38px for marketplace)
this.rows = []; // this is to turn the number of rows into an arbitrary list so we can loop through them
}
ListStencilComponent.prototype.ngOnInit = function () {
for (var n = 0; n < this.numRows; n++) {
this.rows.push(n);
}
// if you think this is gross i agree
// if you think this is gross and actually have a solution hit me up otherwise just enjoy the magic.
// determine the height of each row for the table
this.listItemRowStyles = {
'height': "" + this.rowHeight,
'padding': "0 " + this.sidePadding
};
};
ListStencilComponent.decorators = [
{ type: Component, args: [{
selector: 'list-stencil',
template: "\n <mat-card class=\"list-container\">\n <div *ngIf=\"showHeader\" class=\"list-header stencil-shimmer\" style=\"\"></div>\n <div *ngFor=\"let _ of rows\">\n <div class=\"list-item-row\" [ngStyle]=\"listItemRowStyles\">\n <div class=\"stencil-shimmer\" style=\"margin: 0; padding: 0; width: 100%; height: 80%;\"></div>\n </div>\n </div>\n </mat-card>\n ",
styles: ["\n .list-container { padding: 0; }\n .list-header { height: 40px; }\n .list-item-row { height: 50px; display: flex; justify-content: space-between; align-items: center; }\n "]
},] },
];
/** @nocollapse */
ListStencilComponent.ctorParameters = function () { return []; };
ListStencilComponent.propDecorators = {
'showHeader': [{ type: Input },],
'numRows': [{ type: Input },],
'rowHeight': [{ type: Input },],
'sidePadding': [{ type: Input },],
};
return ListStencilComponent;
}());
export { ListStencilComponent };