All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.vaadin-grid-styling-mixin.d.ts Maven / Gradle / Ivy

Go to download

A free, flexible and high-quality Web Component for showing large amounts of tabular data

The newest version!
/**
 * @license
 * Copyright (c) 2016 - 2024 Vaadin Ltd.
 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
 */
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { GridItemModel } from './vaadin-grid.js';
import type { GridColumn } from './vaadin-grid-column.js';

export type GridCellPartNameGenerator = (column: GridColumn, model: GridItemModel) => string;

/**
 * @deprecated Use `GridCellPartNameGenerator` type and `cellPartNameGenerator` API instead.
 */
export type GridCellClassNameGenerator = GridCellPartNameGenerator;

export declare function StylingMixin>(
  base: T,
): Constructor> & T;

export declare class StylingMixinClass {
  /**
   * A function that allows generating CSS class names for grid cells
   * based on their row and column. The return value should be the generated
   * class name as a string, or multiple class names separated by whitespace
   * characters.
   *
   * Receives two arguments:
   * - `column` The `` element (`undefined` for details-cell).
   * - `model` The object with the properties related with
   *   the rendered item, contains:
   *   - `model.index` The index of the item.
   *   - `model.item` The item.
   *   - `model.expanded` Sublevel toggle state.
   *   - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
   *   - `model.selected` Selected state.
   *
   * @deprecated Use `cellPartNameGenerator` instead.
   */
  cellClassNameGenerator: GridCellClassNameGenerator | null | undefined;

  /**
   * A function that allows generating CSS `part` names for grid cells in Shadow DOM based
   * on their row and column, for styling from outside using the `::part()` selector.
   *
   * The return value should be the generated part name as a string, or multiple part names
   * separated by whitespace characters.
   *
   * Receives two arguments:
   * - `column` The `` element (`undefined` for details-cell).
   * - `model` The object with the properties related with
   *   the rendered item, contains:
   *   - `model.index` The index of the item.
   *   - `model.item` The item.
   *   - `model.expanded` Sublevel toggle state.
   *   - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
   *   - `model.selected` Selected state.
   */
  cellPartNameGenerator: GridCellPartNameGenerator | null | undefined;

  /**
   * Runs the `cellClassNameGenerator` for the visible cells.
   * If the generator depends on varying conditions, you need to
   * call this function manually in order to update the styles when
   * the conditions change.
   *
   * @deprecated Use `cellPartNameGenerator` and `generateCellPartNames()` instead.
   */
  generateCellClassNames(): void;

  /**
   * Runs the `cellPastNameGenerator` for the visible cells.
   * If the generator depends on varying conditions, you need to
   * call this function manually in order to update the styles when
   * the conditions change.
   */
  generateCellPartNames(): void;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy