/**
@license
Copyright (c) 2018 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
export const StylingMixin=e=>class StylingMixin extends e{static get properties(){return{cellClassNameGenerator:Function}}static get observers(){return["__cellClassNameGeneratorChanged(cellClassNameGenerator)"]}__cellClassNameGeneratorChanged(e){this.generateCellClassNames()}generateCellClassNames(){Array.from(this.$.items.children).filter((e=>!e.hidden)).forEach((e=>this._generateCellClassNames(e,this.__getRowModel(e))))}_generateCellClassNames(e,s){Array.from(e.children).forEach((e=>{if(e.__generatedClasses&&e.__generatedClasses.forEach((s=>e.classList.remove(s))),this.cellClassNameGenerator){const a=this.cellClassNameGenerator(e._column,s);e.__generatedClasses=a&&a.split(" ").filter((e=>e.length>0)),e.__generatedClasses&&e.__generatedClasses.forEach((s=>e.classList.add(s)))}}))}};