@aurelia-mdc-web/list
Version:
Wrapper for Material Components Web List
45 lines • 1.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MdcListItemTrailing = void 0;
var tslib_1 = require("tslib");
var aurelia_framework_1 = require("aurelia-framework");
/**
* Optional, marks the trailing control element
* @selector [mdc-list-item-trailing]
*/
var MdcListItemTrailing = /** @class */ (function () {
function MdcListItemTrailing(root) {
this.root = root;
}
MdcListItemTrailing.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('mdc-icon-button')) {
value = undefined;
}
else if (this.root.classList.contains('material-icons')) {
value = 'icon';
}
}
if (value !== undefined) {
(_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-trailing-".concat(value));
}
};
MdcListItemTrailing = tslib_1.__decorate([
(0, aurelia_framework_1.customAttribute)('mdc-list-item-trailing'),
tslib_1.__metadata("design:paramtypes", [Element])
], MdcListItemTrailing);
return MdcListItemTrailing;
}());
exports.MdcListItemTrailing = MdcListItemTrailing;
//# sourceMappingURL=mdc-list-item-trailing.js.map