UNPKG

@aurelia-mdc-web/list

Version:

Wrapper for Material Components Web List

43 lines 1.88 kB
define(["require", "exports", "tslib", "aurelia-framework"], function (require, exports, tslib_1, aurelia_framework_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MdcListItemLeading = void 0; /** * Optional, marks the leading control or media element * @selector [mdc-list-item-leading] */ var MdcListItemLeading = /** @class */ (function () { function MdcListItemLeading(root) { this.root = root; } MdcListItemLeading.prototype.attached = function () { var _a, _b; var value = this.value; if (!value) { if (this.root.classList.contains('mdc-checkbox')) { value = 'checkbox'; } else if (this.root.classList.contains('mdc-radio')) { value = 'radio'; } else if (this.root.classList.contains('mdc-switch')) { value = 'switch'; } else if (this.root.classList.contains('material-icons')) { value = 'icon'; } else if (this.root.tagName === 'IMG') { value = 'image'; } } (_b = (_a = this.root.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.classList.add("mdc-list-item--with-leading-".concat(value)); }; MdcListItemLeading = tslib_1.__decorate([ (0, aurelia_framework_1.customAttribute)('mdc-list-item-leading'), tslib_1.__metadata("design:paramtypes", [Element]) ], MdcListItemLeading); return MdcListItemLeading; }()); exports.MdcListItemLeading = MdcListItemLeading; }); //# sourceMappingURL=mdc-list-item-leading.js.map