@@ -12,30 +12,6 @@ export const StylingMixin = (superClass) =>
1212 class StylingMixin extends superClass {
1313 static get properties ( ) {
1414 return {
15- /**
16- * A function that allows generating CSS class names for grid cells
17- * based on their row and column. The return value should be the generated
18- * class name as a string, or multiple class names separated by whitespace
19- * characters.
20- *
21- * Receives two arguments:
22- * - `column` The `<vaadin-grid-column>` element (`undefined` for details-cell).
23- * - `model` The object with the properties related with
24- * the rendered item, contains:
25- * - `model.index` The index of the item.
26- * - `model.item` The item.
27- * - `model.expanded` Sublevel toggle state.
28- * - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
29- * - `model.selected` Selected state.
30- *
31- * @type {GridCellClassNameGenerator | null | undefined }
32- * @deprecated Use `cellPartNameGenerator` instead.
33- */
34- cellClassNameGenerator : {
35- type : Function ,
36- sync : true ,
37- } ,
38-
3915 /**
4016 * A function that allows generating CSS `part` names for grid cells in Shadow DOM based
4117 * on their row and column, for styling from outside using the `::part()` selector.
@@ -63,38 +39,14 @@ export const StylingMixin = (superClass) =>
6339 }
6440
6541 static get observers ( ) {
66- return [
67- '__cellClassNameGeneratorChanged(cellClassNameGenerator)' ,
68- '__cellPartNameGeneratorChanged(cellPartNameGenerator)' ,
69- ] ;
70- }
71-
72- /** @private */
73- __cellClassNameGeneratorChanged ( ) {
74- this . generateCellClassNames ( ) ;
42+ return [ '__cellPartNameGeneratorChanged(cellPartNameGenerator)' ] ;
7543 }
7644
7745 /** @private */
7846 __cellPartNameGeneratorChanged ( ) {
7947 this . generateCellPartNames ( ) ;
8048 }
8149
82- /**
83- * Runs the `cellClassNameGenerator` for the visible cells.
84- * If the generator depends on varying conditions, you need to
85- * call this function manually in order to update the styles when
86- * the conditions change.
87- *
88- * @deprecated Use `cellPartNameGenerator` and `generateCellPartNames()` instead.
89- */
90- generateCellClassNames ( ) {
91- iterateChildren ( this . $ . items , ( row ) => {
92- if ( ! row . hidden ) {
93- this . _generateCellClassNames ( row , this . __getRowModel ( row ) ) ;
94- }
95- } ) ;
96- }
97-
9850 /**
9951 * Runs the `cellPartNameGenerator` for the visible cells.
10052 * If the generator depends on varying conditions, you need to
@@ -109,22 +61,6 @@ export const StylingMixin = (superClass) =>
10961 } ) ;
11062 }
11163
112- /** @private */
113- _generateCellClassNames ( row , model ) {
114- iterateRowCells ( row , ( cell ) => {
115- if ( cell . __generatedClasses ) {
116- cell . __generatedClasses . forEach ( ( className ) => cell . classList . remove ( className ) ) ;
117- }
118- if ( this . cellClassNameGenerator && ! row . hasAttribute ( 'loading' ) ) {
119- const result = this . cellClassNameGenerator ( cell . _column , model ) ;
120- cell . __generatedClasses = result && result . split ( ' ' ) . filter ( ( className ) => className . length > 0 ) ;
121- if ( cell . __generatedClasses ) {
122- cell . __generatedClasses . forEach ( ( className ) => cell . classList . add ( className ) ) ;
123- }
124- }
125- } ) ;
126- }
127-
12864 /** @private */
12965 _generateCellPartNames ( row , model ) {
13066 iterateRowCells ( row , ( cell ) => {
0 commit comments