@vaadin/grid 24.2.3 → 24.3.0-alpha10

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