@vaadin/grid 24.3.0-alpha1 → 24.3.0-alpha11
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.
- package/package.json +12 -12
- package/src/lit-all-imports.js +14 -0
- package/src/vaadin-grid-a11y-mixin.js +1 -1
- package/src/vaadin-grid-active-item-mixin.js +1 -0
- package/src/vaadin-grid-array-data-provider-mixin.js +14 -17
- package/src/vaadin-grid-column-group-mixin.d.ts +20 -0
- package/src/vaadin-grid-column-group-mixin.js +364 -0
- package/src/vaadin-grid-column-group.d.ts +4 -14
- package/src/vaadin-grid-column-group.js +5 -355
- package/src/vaadin-grid-column-mixin.d.ts +170 -0
- package/src/vaadin-grid-column-mixin.js +958 -0
- package/src/vaadin-grid-column.d.ts +11 -138
- package/src/vaadin-grid-column.js +5 -876
- package/src/vaadin-grid-data-provider-mixin.d.ts +6 -5
- package/src/vaadin-grid-data-provider-mixin.js +62 -12
- package/src/vaadin-grid-drag-and-drop-mixin.js +17 -5
- package/src/vaadin-grid-dynamic-columns-mixin.js +22 -17
- package/src/vaadin-grid-filter-column-mixin.d.ts +22 -0
- package/src/vaadin-grid-filter-column-mixin.js +106 -0
- package/src/vaadin-grid-filter-column.d.ts +9 -11
- package/src/vaadin-grid-filter-column.js +3 -90
- package/src/vaadin-grid-filter-element-mixin.d.ts +34 -0
- package/src/vaadin-grid-filter-element-mixin.js +108 -0
- package/src/vaadin-grid-filter-mixin.js +4 -4
- package/src/vaadin-grid-filter.d.ts +4 -21
- package/src/vaadin-grid-filter.js +5 -84
- package/src/vaadin-grid-helpers.js +94 -0
- package/src/vaadin-grid-keyboard-navigation-mixin.js +26 -6
- package/src/vaadin-grid-mixin.js +37 -46
- package/src/vaadin-grid-row-details-mixin.js +14 -8
- package/src/vaadin-grid-scroll-mixin.js +9 -3
- package/src/vaadin-grid-selection-column-base-mixin.js +12 -4
- package/src/vaadin-grid-selection-column-mixin.d.ts +24 -0
- package/src/vaadin-grid-selection-column-mixin.js +194 -0
- package/src/vaadin-grid-selection-column.d.ts +13 -17
- package/src/vaadin-grid-selection-column.js +4 -186
- package/src/vaadin-grid-selection-mixin.js +4 -3
- package/src/vaadin-grid-sort-column-mixin.d.ts +36 -0
- package/src/vaadin-grid-sort-column-mixin.js +101 -0
- package/src/vaadin-grid-sort-column.d.ts +8 -26
- package/src/vaadin-grid-sort-column.js +3 -87
- package/src/vaadin-grid-sorter-mixin.d.ts +44 -0
- package/src/vaadin-grid-sorter-mixin.js +200 -0
- package/src/vaadin-grid-sorter.d.ts +3 -32
- package/src/vaadin-grid-sorter.js +5 -181
- package/src/vaadin-grid-styles.js +341 -345
- package/src/vaadin-grid-styling-mixin.js +8 -2
- package/src/vaadin-grid-tree-column-mixin.d.ts +18 -0
- package/src/vaadin-grid-tree-column-mixin.js +99 -0
- package/src/vaadin-grid-tree-column.d.ts +9 -7
- package/src/vaadin-grid-tree-column.js +3 -82
- package/src/vaadin-grid-tree-toggle-mixin.d.ts +39 -0
- package/src/vaadin-grid-tree-toggle-mixin.js +153 -0
- package/src/vaadin-grid-tree-toggle.d.ts +4 -27
- package/src/vaadin-grid-tree-toggle.js +9 -141
- package/src/vaadin-grid.d.ts +3 -0
- package/src/vaadin-grid.js +7 -2
- package/src/vaadin-lit-grid-column-group.js +28 -0
- package/src/vaadin-lit-grid-column.js +30 -0
- package/src/vaadin-lit-grid-filter-column.js +28 -0
- package/src/vaadin-lit-grid-filter.js +35 -0
- package/src/vaadin-lit-grid-selection-column.js +28 -0
- package/src/vaadin-lit-grid-sort-column.js +28 -0
- package/src/vaadin-lit-grid-sorter.js +42 -0
- package/src/vaadin-lit-grid-tree-column.js +28 -0
- package/src/vaadin-lit-grid-tree-toggle.js +39 -0
- package/src/vaadin-lit-grid.js +63 -0
- package/theme/lumo/lit-all-imports.js +11 -0
- package/theme/lumo/vaadin-grid-sorter-styles.js +1 -1
- package/theme/lumo/vaadin-grid-styles.js +15 -14
- package/theme/lumo/vaadin-lit-grid-column-group.js +1 -0
- package/theme/lumo/vaadin-lit-grid-column.js +1 -0
- package/theme/lumo/vaadin-lit-grid-filter-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-filter.js +3 -0
- package/theme/lumo/vaadin-lit-grid-selection-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-sort-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-sorter.js +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-toggle.js +2 -0
- package/theme/lumo/vaadin-lit-grid.js +2 -0
- package/theme/material/lit-all-imports.js +11 -0
- package/theme/material/vaadin-grid-styles.js +15 -10
- package/theme/material/vaadin-lit-grid-column-group.js +1 -0
- package/theme/material/vaadin-lit-grid-column.js +1 -0
- package/theme/material/vaadin-lit-grid-filter-column.js +2 -0
- package/theme/material/vaadin-lit-grid-filter.js +3 -0
- package/theme/material/vaadin-lit-grid-selection-column.js +2 -0
- package/theme/material/vaadin-lit-grid-sort-column.js +2 -0
- package/theme/material/vaadin-lit-grid-sorter.js +2 -0
- package/theme/material/vaadin-lit-grid-tree-column.js +2 -0
- package/theme/material/vaadin-lit-grid-tree-toggle.js +2 -0
- package/theme/material/vaadin-lit-grid.js +2 -0
- package/vaadin-lit-grid-column-group.d.ts +1 -0
- package/vaadin-lit-grid-column-group.js +3 -0
- package/vaadin-lit-grid-column.d.ts +1 -0
- package/vaadin-lit-grid-column.js +3 -0
- package/vaadin-lit-grid-filter-column.d.ts +1 -0
- package/vaadin-lit-grid-filter-column.js +3 -0
- package/vaadin-lit-grid-filter.d.ts +1 -0
- package/vaadin-lit-grid-filter.js +3 -0
- package/vaadin-lit-grid-selection-column.d.ts +1 -0
- package/vaadin-lit-grid-selection-column.js +3 -0
- package/vaadin-lit-grid-sort-column.d.ts +1 -0
- package/vaadin-lit-grid-sort-column.js +3 -0
- package/vaadin-lit-grid-sorter.d.ts +1 -0
- package/vaadin-lit-grid-sorter.js +3 -0
- package/vaadin-lit-grid-tree-column.d.ts +1 -0
- package/vaadin-lit-grid-tree-column.js +3 -0
- package/vaadin-lit-grid-tree-toggle.d.ts +1 -0
- package/vaadin-lit-grid-tree-toggle.js +3 -0
- package/vaadin-lit-grid.d.ts +2 -0
- package/vaadin-lit-grid.js +4 -0
- package/web-types.json +331 -126
- package/web-types.lit.json +114 -58
package/src/vaadin-grid.js
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-grid-column.js';
|
|
7
|
-
import './vaadin-grid-styles.js';
|
|
8
7
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
9
8
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
10
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
12
|
import { GridMixin } from './vaadin-grid-mixin.js';
|
|
13
|
+
import { gridStyles } from './vaadin-grid-styles.js';
|
|
14
|
+
|
|
15
|
+
registerStyles('vaadin-grid', gridStyles, { moduleId: 'vaadin-grid-styles' });
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* `<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the
|
|
@@ -154,6 +156,8 @@ import { GridMixin } from './vaadin-grid-mixin.js';
|
|
|
154
156
|
* Part name | Description
|
|
155
157
|
* ---------------------------|----------------
|
|
156
158
|
* `row` | Row in the internal table
|
|
159
|
+
* `body-row` | Body row in the internal table
|
|
160
|
+
* `collapsed-row` | Collapsed row
|
|
157
161
|
* `expanded-row` | Expanded row
|
|
158
162
|
* `selected-row` | Selected row
|
|
159
163
|
* `details-opened-row` | Row with details open
|
|
@@ -183,6 +187,7 @@ import { GridMixin } from './vaadin-grid-mixin.js';
|
|
|
183
187
|
* `last-footer-row-cell` | Cell in the last footer row
|
|
184
188
|
* `loading-row-cell` | Cell in a row that is waiting for data from data provider
|
|
185
189
|
* `selected-row-cell` | Cell in a selected row
|
|
190
|
+
* `collapsed-row-cell` | Cell in a collapsed row
|
|
186
191
|
* `expanded-row-cell` | Cell in an expanded row
|
|
187
192
|
* `details-opened-row-cell` | Cell in an row with details open
|
|
188
193
|
* `dragstart-row-cell` | Cell in a row that user started to drag (set for one frame)
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { GridColumnGroupMixin } from './vaadin-grid-column-group-mixin.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-column-group>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridColumnGroup extends GridColumnGroupMixin(PolylitMixin(LitElement)) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-column-group';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridColumnGroup);
|
|
27
|
+
|
|
28
|
+
export { GridColumnGroup };
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { GridColumnMixin } from './vaadin-grid-column-mixin.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridColumn extends GridColumnMixin(PolylitMixin(LitElement)) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridColumn);
|
|
27
|
+
|
|
28
|
+
export { GridColumn };
|
|
29
|
+
|
|
30
|
+
export { ColumnBaseMixin } from './vaadin-grid-column-mixin.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
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 './vaadin-lit-grid-filter.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridFilterColumnMixin } from './vaadin-grid-filter-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-filter-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridFilterColumn extends GridFilterColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-filter-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridFilterColumn);
|
|
27
|
+
|
|
28
|
+
export { GridFilterColumn };
|
|
@@ -0,0 +1,35 @@
|
|
|
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 '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-filter>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-filter';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`<slot></slot>`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
defineCustomElement(GridFilter);
|
|
34
|
+
|
|
35
|
+
export { GridFilter };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 '@vaadin/checkbox/src/vaadin-lit-checkbox.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridSelectionColumnMixin } from './vaadin-grid-selection-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-selection-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridSelectionColumn extends GridSelectionColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-selection-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridSelectionColumn);
|
|
27
|
+
|
|
28
|
+
export { GridSelectionColumn };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridSortColumnMixin } from './vaadin-grid-sort-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-sort-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridSortColumn extends GridSortColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-sort-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridSortColumn);
|
|
27
|
+
|
|
28
|
+
export { GridSortColumn };
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { html, LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-sorter>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-sorter';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`
|
|
30
|
+
<div part="content">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="indicators">
|
|
34
|
+
<span part="order">${this._getDisplayOrder(this._order)}</span>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
defineCustomElement(GridSorter);
|
|
41
|
+
|
|
42
|
+
export { GridSorter };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 './vaadin-lit-grid-tree-toggle.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridTreeColumnMixin } from './vaadin-grid-tree-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-tree-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridTreeColumn extends GridTreeColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-tree-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridTreeColumn);
|
|
27
|
+
|
|
28
|
+
export { GridTreeColumn };
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { html, LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-tree-toggle>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridTreeToggle extends GridTreeToggleMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-tree-toggle';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`
|
|
30
|
+
<span id="level-spacer"></span>
|
|
31
|
+
<span part="toggle"></span>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
defineCustomElement(GridTreeToggle);
|
|
38
|
+
|
|
39
|
+
export { GridTreeToggle };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid-column.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { isIOS, isSafari } from '@vaadin/component-base/src/browser-utils.js';
|
|
9
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
+
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { GridMixin } from './vaadin-grid-mixin.js';
|
|
14
|
+
import { gridStyles } from './vaadin-grid-styles.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* LitElement based version of `<vaadin-grid>` web component.
|
|
18
|
+
*
|
|
19
|
+
* ## Disclaimer
|
|
20
|
+
*
|
|
21
|
+
* This component is an experiment not intended for publishing to npm.
|
|
22
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
23
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
24
|
+
*/
|
|
25
|
+
class Grid extends GridMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
26
|
+
static get is() {
|
|
27
|
+
return 'vaadin-grid';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static get styles() {
|
|
31
|
+
return gridStyles;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @protected */
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
37
|
+
<div
|
|
38
|
+
id="scroller"
|
|
39
|
+
safari="${isSafari}"
|
|
40
|
+
ios="${isIOS}"
|
|
41
|
+
?loading="${this.loading}"
|
|
42
|
+
column-reordering-allowed="${this.columnReorderingAllowed}"
|
|
43
|
+
>
|
|
44
|
+
<table id="table" role="treegrid" aria-multiselectable="true" tabindex="0">
|
|
45
|
+
<caption id="sizer" part="row"></caption>
|
|
46
|
+
<thead id="header" role="rowgroup"></thead>
|
|
47
|
+
<tbody id="items" role="rowgroup"></tbody>
|
|
48
|
+
<tfoot id="footer" role="rowgroup"></tfoot>
|
|
49
|
+
</table>
|
|
50
|
+
|
|
51
|
+
<div part="reorder-ghost"></div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<slot name="tooltip"></slot>
|
|
55
|
+
|
|
56
|
+
<div id="focusexit" tabindex="0"></div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
defineCustomElement(Grid);
|
|
62
|
+
|
|
63
|
+
export { Grid };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './vaadin-lit-grid-column-group.js';
|
|
2
|
+
import './vaadin-lit-grid-column.js';
|
|
3
|
+
import './vaadin-lit-grid-filter.js';
|
|
4
|
+
import './vaadin-lit-grid-filter-column.js';
|
|
5
|
+
import './vaadin-lit-grid-selection-column.js';
|
|
6
|
+
import './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import './vaadin-lit-grid-sort-column.js';
|
|
8
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
9
|
+
import './vaadin-lit-grid-tree-column.js';
|
|
10
|
+
import './vaadin-lit-grid.js';
|
|
11
|
+
import '../../src/lit-all-imports.js';
|
|
@@ -4,7 +4,7 @@ import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
|
4
4
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
5
5
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
6
6
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
7
|
-
import '@vaadin/checkbox/theme/lumo/vaadin-checkbox.js';
|
|
7
|
+
import '@vaadin/checkbox/theme/lumo/vaadin-checkbox-styles.js';
|
|
8
8
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
9
|
|
|
10
10
|
registerStyles(
|
|
@@ -21,7 +21,8 @@ registerStyles(
|
|
|
21
21
|
-webkit-tap-highlight-color: transparent;
|
|
22
22
|
-webkit-font-smoothing: antialiased;
|
|
23
23
|
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
|
|
24
|
+
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
25
|
+
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
25
26
|
/* For internal use only */
|
|
26
27
|
--_lumo-grid-border-color: var(--lumo-contrast-20pct);
|
|
27
28
|
--_lumo-grid-secondary-border-color: var(--lumo-contrast-10pct);
|
|
@@ -43,12 +44,15 @@ registerStyles(
|
|
|
43
44
|
|
|
44
45
|
[part~='cell'] {
|
|
45
46
|
min-height: var(--lumo-size-m);
|
|
46
|
-
background-color: var(--lumo-base-color);
|
|
47
|
+
background-color: var(--vaadin-grid-cell-background, var(--lumo-base-color));
|
|
48
|
+
cursor: default;
|
|
49
|
+
--_cell-padding: var(--vaadin-grid-cell-padding, var(--_cell-default-padding));
|
|
50
|
+
--_cell-default-padding: var(--lumo-space-xs) var(--lumo-space-m);
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
[part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
50
|
-
cursor:
|
|
51
|
-
padding: var(--
|
|
54
|
+
cursor: inherit;
|
|
55
|
+
padding: var(--_cell-padding);
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/* Apply row borders by default and introduce the "no-row-borders" variant */
|
|
@@ -79,7 +83,7 @@ registerStyles(
|
|
|
79
83
|
position: absolute;
|
|
80
84
|
inset: 0;
|
|
81
85
|
pointer-events: none;
|
|
82
|
-
box-shadow: inset 0 0 0
|
|
86
|
+
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
:host([navigating]) [part~='row']:focus::before {
|
|
@@ -94,7 +98,7 @@ registerStyles(
|
|
|
94
98
|
z-index: 100;
|
|
95
99
|
inset: 0;
|
|
96
100
|
pointer-events: none;
|
|
97
|
-
box-shadow: inset 0 0 0
|
|
101
|
+
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
[part~='row'][dragover] {
|
|
@@ -187,14 +191,14 @@ registerStyles(
|
|
|
187
191
|
|
|
188
192
|
/* Headers and footers */
|
|
189
193
|
|
|
190
|
-
[part~='header-cell']
|
|
191
|
-
[part~='footer-cell']
|
|
194
|
+
[part~='header-cell'],
|
|
195
|
+
[part~='footer-cell'],
|
|
192
196
|
[part~='reorder-ghost'] {
|
|
193
197
|
font-size: var(--lumo-font-size-s);
|
|
194
198
|
font-weight: 500;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
[part~='footer-cell']
|
|
201
|
+
[part~='footer-cell'] {
|
|
198
202
|
font-weight: 400;
|
|
199
203
|
}
|
|
200
204
|
|
|
@@ -331,16 +335,13 @@ registerStyles(
|
|
|
331
335
|
|
|
332
336
|
:host([theme~='compact']) [part~='cell'] {
|
|
333
337
|
min-height: var(--lumo-size-s);
|
|
338
|
+
--_cell-default-padding: var(--lumo-space-xs) var(--lumo-space-s);
|
|
334
339
|
}
|
|
335
340
|
|
|
336
341
|
:host([theme~='compact']) [part~='first-row'] [part~='cell']:not([part~='details-cell']) {
|
|
337
342
|
min-height: calc(var(--lumo-size-s) - var(--_lumo-grid-border-width));
|
|
338
343
|
}
|
|
339
344
|
|
|
340
|
-
:host([theme~='compact']) [part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
341
|
-
padding: var(--lumo-space-xs) var(--lumo-space-s);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
345
|
/* Wrap cell contents */
|
|
345
346
|
|
|
346
347
|
:host([theme~='wrap-cell-content']) [part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './vaadin-lit-grid-column-group.js';
|
|
2
|
+
import './vaadin-lit-grid-column.js';
|
|
3
|
+
import './vaadin-lit-grid-filter.js';
|
|
4
|
+
import './vaadin-lit-grid-filter-column.js';
|
|
5
|
+
import './vaadin-lit-grid-selection-column.js';
|
|
6
|
+
import './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import './vaadin-lit-grid-sort-column.js';
|
|
8
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
9
|
+
import './vaadin-lit-grid-tree-column.js';
|
|
10
|
+
import './vaadin-lit-grid.js';
|
|
11
|
+
import '../../src/lit-all-imports.js';
|
|
@@ -20,19 +20,21 @@ registerStyles(
|
|
|
20
20
|
[part~='cell'] {
|
|
21
21
|
min-height: 48px;
|
|
22
22
|
-webkit-tap-highlight-color: transparent;
|
|
23
|
+
--_cell-padding: var(--vaadin-grid-cell-padding, var(--_cell-default-padding));
|
|
24
|
+
--_cell-default-padding: 8px 16px;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
[part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
26
|
-
padding:
|
|
28
|
+
padding: var(--_cell-padding);
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
[part~='details-cell']
|
|
30
|
-
padding: 14px 16px;
|
|
31
|
+
[part~='details-cell'] {
|
|
32
|
+
--_cell-default-padding: 14px 16px;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
[part~='header-cell'],
|
|
34
36
|
[part~='footer-cell'] {
|
|
35
|
-
background-color: var(--material-background-color);
|
|
37
|
+
background-color: var(--vaadin-grid-cell-background, var(--material-background-color));
|
|
36
38
|
color: var(--material-secondary-text-color);
|
|
37
39
|
font-size: var(--material-caption-font-size);
|
|
38
40
|
font-weight: 500;
|
|
@@ -53,15 +55,18 @@ registerStyles(
|
|
|
53
55
|
/* Body rows/cells */
|
|
54
56
|
|
|
55
57
|
[part~='body-cell'] {
|
|
56
|
-
background-color: var(--material-background-color);
|
|
58
|
+
background-color: var(--vaadin-grid-cell-background, var(--material-background-color));
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
[part~='row']:hover > [part~='body-cell'] {
|
|
60
|
-
background:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
background: var(
|
|
63
|
+
--vaadin-grid-cell-background,
|
|
64
|
+
linear-gradient(
|
|
65
|
+
var(--_material-grid-row-hover-background-color, rgba(0, 0, 0, 0.04)),
|
|
66
|
+
var(--_material-grid-row-hover-background-color, rgba(0, 0, 0, 0.04))
|
|
67
|
+
)
|
|
68
|
+
var(--material-background-color)
|
|
69
|
+
);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
@media (hover: none) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column.js';
|