@vaadin/grid 24.2.0-beta3 → 24.2.0-beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +10 -10
  2. package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
  3. package/src/vaadin-grid-column-group.d.ts +14 -4
  4. package/src/vaadin-grid-column-group.js +355 -5
  5. package/src/vaadin-grid-column.d.ts +138 -11
  6. package/src/vaadin-grid-column.js +876 -3
  7. package/src/vaadin-grid-data-provider-mixin.d.ts +30 -6
  8. package/src/vaadin-grid-data-provider-mixin.js +241 -100
  9. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  10. package/src/vaadin-grid-filter.d.ts +21 -4
  11. package/src/vaadin-grid-filter.js +84 -5
  12. package/src/vaadin-grid-keyboard-navigation-mixin.js +2 -2
  13. package/src/vaadin-grid-mixin.js +10 -10
  14. package/src/vaadin-grid-scroll-mixin.js +1 -1
  15. package/src/vaadin-grid-sorter.d.ts +32 -3
  16. package/src/vaadin-grid-sorter.js +181 -5
  17. package/src/vaadin-grid-tree-column.d.ts +7 -9
  18. package/src/vaadin-grid-tree-column.js +82 -3
  19. package/src/vaadin-grid-tree-toggle.d.ts +27 -4
  20. package/src/vaadin-grid-tree-toggle.js +141 -9
  21. package/web-types.json +98 -98
  22. package/web-types.lit.json +42 -42
  23. package/src/vaadin-grid-column-group-mixin.d.ts +0 -20
  24. package/src/vaadin-grid-column-group-mixin.js +0 -369
  25. package/src/vaadin-grid-column-mixin.d.ts +0 -156
  26. package/src/vaadin-grid-column-mixin.js +0 -887
  27. package/src/vaadin-grid-filter-element-mixin.d.ts +0 -34
  28. package/src/vaadin-grid-filter-element-mixin.js +0 -99
  29. package/src/vaadin-grid-sorter-mixin.d.ts +0 -44
  30. package/src/vaadin-grid-sorter-mixin.js +0 -198
  31. package/src/vaadin-grid-tree-column-mixin.d.ts +0 -19
  32. package/src/vaadin-grid-tree-column-mixin.js +0 -92
  33. package/src/vaadin-grid-tree-toggle-mixin.d.ts +0 -39
  34. package/src/vaadin-grid-tree-toggle-mixin.js +0 -151
@@ -1,156 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { Constructor } from '@open-wc/dedupe-mixin';
7
- import type { GridItemModel } from './vaadin-grid.js';
8
-
9
- export type GridBodyRenderer<TItem, Column extends GridColumnMixin<TItem, Column>> = (
10
- root: HTMLElement,
11
- column: Column,
12
- model: GridItemModel<TItem>,
13
- ) => void;
14
-
15
- export type GridColumnTextAlign = 'center' | 'end' | 'start' | null;
16
-
17
- export type GridHeaderFooterRenderer<TItem, Column extends ColumnBaseMixinClass<TItem, Column>> = (
18
- root: HTMLElement,
19
- column: Column,
20
- ) => void;
21
-
22
- export declare function ColumnBaseMixin<
23
- TItem,
24
- Column extends GridColumnMixin<TItem, Column>,
25
- T extends Constructor<HTMLElement>,
26
- >(base: T): Constructor<ColumnBaseMixinClass<TItem, Column>> & T;
27
-
28
- export declare class ColumnBaseMixinClass<TItem, Column extends ColumnBaseMixinClass<TItem, Column>> {
29
- /**
30
- * When set to true, the column is user-resizable.
31
- */
32
- resizable: boolean | null | undefined;
33
-
34
- /**
35
- * When true, the column is frozen. When a column inside of a column group is frozen,
36
- * all of the sibling columns inside the group will get frozen also.
37
- */
38
- frozen: boolean;
39
-
40
- /**
41
- * When true, the column is frozen to end of grid.
42
- *
43
- * When a column inside of a column group is frozen to end, all of the sibling columns
44
- * inside the group will get frozen to end also.
45
- *
46
- * Column can not be set as `frozen` and `frozenToEnd` at the same time.
47
- * @attr {boolean} frozen-to-end
48
- */
49
- frozenToEnd: boolean;
50
-
51
- /**
52
- * When true, the cells for this column will be rendered with the `role` attribute
53
- * set as `rowheader`, instead of the `gridcell` role value used by default.
54
- *
55
- * When a column is set as row header, its cells will be announced by screen readers
56
- * while navigating to help user identify the current row as uniquely as possible.
57
- *
58
- * @attr {boolean} row-header
59
- */
60
- rowHeader: boolean;
61
-
62
- /**
63
- * When set to true, the cells for this column are hidden.
64
- */
65
- hidden: boolean;
66
-
67
- /**
68
- * Text content to display in the header cell of the column.
69
- */
70
- header: string | null | undefined;
71
-
72
- /**
73
- * Aligns the columns cell content horizontally.
74
- * Supported values: "start", "center" and "end".
75
- * @attr {start|center|end} text-align
76
- */
77
- textAlign: GridColumnTextAlign | null | undefined;
78
-
79
- /**
80
- * Custom function for rendering the header content.
81
- * Receives two arguments:
82
- *
83
- * - `root` The header cell content DOM element. Append your content to it.
84
- * - `column` The `<vaadin-grid-column>` element.
85
- */
86
- headerRenderer: GridHeaderFooterRenderer<TItem, Column> | null | undefined;
87
-
88
- /**
89
- * Custom function for rendering the footer content.
90
- * Receives two arguments:
91
- *
92
- * - `root` The footer cell content DOM element. Append your content to it.
93
- * - `column` The `<vaadin-grid-column>` element.
94
- */
95
- footerRenderer: GridHeaderFooterRenderer<TItem, Column> | null | undefined;
96
- }
97
-
98
- export interface GridColumnMixin<TItem, Column extends GridColumnMixinClass<TItem, Column>>
99
- extends GridColumnMixinClass<TItem, Column> {}
100
-
101
- export declare class GridColumnMixinClass<
102
- TItem,
103
- Column extends GridColumnMixinClass<TItem, Column>,
104
- > extends ColumnBaseMixinClass<TItem, Column> {
105
- /**
106
- * Width of the cells for this column.
107
- */
108
- width: string | null | undefined;
109
-
110
- /**
111
- * Flex grow ratio for the cell widths. When set to 0, cell width is fixed.
112
- * @attr {number} flex-grow
113
- */
114
- flexGrow: number;
115
-
116
- /**
117
- * Custom function for rendering the cell content.
118
- * Receives three arguments:
119
- *
120
- * - `root` The cell content DOM element. Append your content to it.
121
- * - `column` The `<vaadin-grid-column>` element.
122
- * - `model` The object with the properties related with
123
- * the rendered item, contains:
124
- * - `model.index` The index of the item.
125
- * - `model.item` The item.
126
- * - `model.expanded` Sublevel toggle state.
127
- * - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
128
- * - `model.selected` Selected state.
129
- * - `model.detailsOpened` Details opened state.
130
- */
131
- renderer: GridBodyRenderer<TItem, Column> | null | undefined;
132
-
133
- /**
134
- * Path to an item sub-property whose value gets displayed in the column body cells.
135
- * The property name is also shown in the column header if an explicit header or renderer isn't defined.
136
- */
137
- path: string | null | undefined;
138
-
139
- /**
140
- * Automatically sets the width of the column based on the column contents when this is set to `true`.
141
- *
142
- * For performance reasons the column width is calculated automatically only once when the grid items
143
- * are rendered for the first time and the calculation only considers the rows which are currently
144
- * rendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell
145
- * content changes, the column width might not match the contents anymore.
146
- *
147
- * Hidden columns are ignored in the calculation and their widths are not automatically updated when
148
- * you show a column that was initially hidden.
149
- *
150
- * You can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.
151
- *
152
- * The column width may still grow larger when `flexGrow` is not 0.
153
- * @attr {boolean} auto-width
154
- */
155
- autoWidth: boolean;
156
- }