@vaadin/grid 25.1.0-beta2 → 25.1.0-beta3
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/custom-elements.json +50 -38
- package/package.json +13 -13
- package/src/vaadin-grid-column-mixin.js +0 -9
- package/src/vaadin-grid-column-reordering-mixin.js +17 -1
- package/src/vaadin-grid-column-resizing-mixin.js +4 -8
- package/src/vaadin-grid-drag-and-drop-mixin.js +3 -6
- package/src/vaadin-grid-dynamic-columns-mixin.js +5 -9
- package/src/vaadin-grid-keyboard-navigation-mixin.js +14 -25
- package/src/vaadin-grid-mixin.js +1 -0
- package/src/vaadin-grid-scroll-mixin.js +2 -1
- package/src/vaadin-grid-sort-column-mixin.js +0 -1
- package/src/vaadin-grid-sorter-mixin.js +3 -2
- package/web-types.json +32 -24
- package/web-types.lit.json +4 -4
package/custom-elements.json
CHANGED
|
@@ -495,7 +495,7 @@
|
|
|
495
495
|
"name": "textAlign",
|
|
496
496
|
"privacy": "public",
|
|
497
497
|
"type": {
|
|
498
|
-
"text": "
|
|
498
|
+
"text": "string"
|
|
499
499
|
},
|
|
500
500
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
501
501
|
"attribute": "text-align",
|
|
@@ -649,7 +649,7 @@
|
|
|
649
649
|
{
|
|
650
650
|
"name": "text-align",
|
|
651
651
|
"type": {
|
|
652
|
-
"text": "
|
|
652
|
+
"text": "string"
|
|
653
653
|
},
|
|
654
654
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
655
655
|
"fieldName": "textAlign",
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
"name": "textAlign",
|
|
862
862
|
"privacy": "public",
|
|
863
863
|
"type": {
|
|
864
|
-
"text": "
|
|
864
|
+
"text": "string"
|
|
865
865
|
},
|
|
866
866
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
867
867
|
"attribute": "text-align",
|
|
@@ -1039,7 +1039,7 @@
|
|
|
1039
1039
|
{
|
|
1040
1040
|
"name": "text-align",
|
|
1041
1041
|
"type": {
|
|
1042
|
-
"text": "
|
|
1042
|
+
"text": "string"
|
|
1043
1043
|
},
|
|
1044
1044
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1045
1045
|
"fieldName": "textAlign",
|
|
@@ -1198,7 +1198,7 @@
|
|
|
1198
1198
|
"name": "textAlign",
|
|
1199
1199
|
"privacy": "public",
|
|
1200
1200
|
"type": {
|
|
1201
|
-
"text": "
|
|
1201
|
+
"text": "string"
|
|
1202
1202
|
},
|
|
1203
1203
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1204
1204
|
"attribute": "text-align"
|
|
@@ -1289,7 +1289,7 @@
|
|
|
1289
1289
|
{
|
|
1290
1290
|
"name": "text-align",
|
|
1291
1291
|
"type": {
|
|
1292
|
-
"text": "
|
|
1292
|
+
"text": "string"
|
|
1293
1293
|
},
|
|
1294
1294
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1295
1295
|
"fieldName": "textAlign"
|
|
@@ -1492,7 +1492,7 @@
|
|
|
1492
1492
|
"name": "textAlign",
|
|
1493
1493
|
"privacy": "public",
|
|
1494
1494
|
"type": {
|
|
1495
|
-
"text": "
|
|
1495
|
+
"text": "string"
|
|
1496
1496
|
},
|
|
1497
1497
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1498
1498
|
"attribute": "text-align",
|
|
@@ -1669,7 +1669,7 @@
|
|
|
1669
1669
|
{
|
|
1670
1670
|
"name": "text-align",
|
|
1671
1671
|
"type": {
|
|
1672
|
-
"text": "
|
|
1672
|
+
"text": "string"
|
|
1673
1673
|
},
|
|
1674
1674
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1675
1675
|
"fieldName": "textAlign",
|
|
@@ -2025,7 +2025,7 @@
|
|
|
2025
2025
|
"name": "textAlign",
|
|
2026
2026
|
"privacy": "public",
|
|
2027
2027
|
"type": {
|
|
2028
|
-
"text": "
|
|
2028
|
+
"text": "string"
|
|
2029
2029
|
},
|
|
2030
2030
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
2031
2031
|
"attribute": "text-align",
|
|
@@ -2238,7 +2238,7 @@
|
|
|
2238
2238
|
{
|
|
2239
2239
|
"name": "text-align",
|
|
2240
2240
|
"type": {
|
|
2241
|
-
"text": "
|
|
2241
|
+
"text": "string"
|
|
2242
2242
|
},
|
|
2243
2243
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
2244
2244
|
"fieldName": "textAlign",
|
|
@@ -2528,7 +2528,7 @@
|
|
|
2528
2528
|
"name": "dropMode",
|
|
2529
2529
|
"privacy": "public",
|
|
2530
2530
|
"type": {
|
|
2531
|
-
"text": "
|
|
2531
|
+
"text": "string"
|
|
2532
2532
|
},
|
|
2533
2533
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
2534
2534
|
"attribute": "drop-mode"
|
|
@@ -2569,7 +2569,7 @@
|
|
|
2569
2569
|
{
|
|
2570
2570
|
"name": "drop-mode",
|
|
2571
2571
|
"type": {
|
|
2572
|
-
"text": "
|
|
2572
|
+
"text": "string"
|
|
2573
2573
|
},
|
|
2574
2574
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
2575
2575
|
"fieldName": "dropMode"
|
|
@@ -2952,7 +2952,7 @@
|
|
|
2952
2952
|
"name": "textAlign",
|
|
2953
2953
|
"privacy": "public",
|
|
2954
2954
|
"type": {
|
|
2955
|
-
"text": "
|
|
2955
|
+
"text": "string"
|
|
2956
2956
|
},
|
|
2957
2957
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
2958
2958
|
"attribute": "text-align",
|
|
@@ -3161,7 +3161,7 @@
|
|
|
3161
3161
|
{
|
|
3162
3162
|
"name": "text-align",
|
|
3163
3163
|
"type": {
|
|
3164
|
-
"text": "
|
|
3164
|
+
"text": "string"
|
|
3165
3165
|
},
|
|
3166
3166
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
3167
3167
|
"fieldName": "textAlign",
|
|
@@ -3947,7 +3947,7 @@
|
|
|
3947
3947
|
"name": "columnRendering",
|
|
3948
3948
|
"privacy": "public",
|
|
3949
3949
|
"type": {
|
|
3950
|
-
"text": "
|
|
3950
|
+
"text": "string"
|
|
3951
3951
|
},
|
|
3952
3952
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
3953
3953
|
"attribute": "column-rendering",
|
|
@@ -4049,7 +4049,7 @@
|
|
|
4049
4049
|
"name": "dropMode",
|
|
4050
4050
|
"privacy": "public",
|
|
4051
4051
|
"type": {
|
|
4052
|
-
"text": "
|
|
4052
|
+
"text": "string"
|
|
4053
4053
|
},
|
|
4054
4054
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
4055
4055
|
"attribute": "drop-mode",
|
|
@@ -4486,7 +4486,7 @@
|
|
|
4486
4486
|
{
|
|
4487
4487
|
"name": "column-rendering",
|
|
4488
4488
|
"type": {
|
|
4489
|
-
"text": "
|
|
4489
|
+
"text": "string"
|
|
4490
4490
|
},
|
|
4491
4491
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
4492
4492
|
"fieldName": "columnRendering",
|
|
@@ -4546,7 +4546,7 @@
|
|
|
4546
4546
|
{
|
|
4547
4547
|
"name": "drop-mode",
|
|
4548
4548
|
"type": {
|
|
4549
|
-
"text": "
|
|
4549
|
+
"text": "string"
|
|
4550
4550
|
},
|
|
4551
4551
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
4552
4552
|
"fieldName": "dropMode",
|
|
@@ -4942,7 +4942,7 @@
|
|
|
4942
4942
|
"name": "columnRendering",
|
|
4943
4943
|
"privacy": "public",
|
|
4944
4944
|
"type": {
|
|
4945
|
-
"text": "
|
|
4945
|
+
"text": "string"
|
|
4946
4946
|
},
|
|
4947
4947
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
4948
4948
|
"attribute": "column-rendering"
|
|
@@ -4966,7 +4966,7 @@
|
|
|
4966
4966
|
{
|
|
4967
4967
|
"name": "column-rendering",
|
|
4968
4968
|
"type": {
|
|
4969
|
-
"text": "
|
|
4969
|
+
"text": "string"
|
|
4970
4970
|
},
|
|
4971
4971
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
4972
4972
|
"fieldName": "columnRendering"
|
|
@@ -5573,7 +5573,7 @@
|
|
|
5573
5573
|
"name": "textAlign",
|
|
5574
5574
|
"privacy": "public",
|
|
5575
5575
|
"type": {
|
|
5576
|
-
"text": "
|
|
5576
|
+
"text": "string"
|
|
5577
5577
|
},
|
|
5578
5578
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
5579
5579
|
"attribute": "text-align",
|
|
@@ -5827,7 +5827,7 @@
|
|
|
5827
5827
|
{
|
|
5828
5828
|
"name": "text-align",
|
|
5829
5829
|
"type": {
|
|
5830
|
-
"text": "
|
|
5830
|
+
"text": "string"
|
|
5831
5831
|
},
|
|
5832
5832
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
5833
5833
|
"fieldName": "textAlign",
|
|
@@ -5962,7 +5962,7 @@
|
|
|
5962
5962
|
"name": "direction",
|
|
5963
5963
|
"privacy": "public",
|
|
5964
5964
|
"type": {
|
|
5965
|
-
"text": "
|
|
5965
|
+
"text": "string"
|
|
5966
5966
|
},
|
|
5967
5967
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
5968
5968
|
"attribute": "direction"
|
|
@@ -5982,7 +5982,7 @@
|
|
|
5982
5982
|
{
|
|
5983
5983
|
"name": "direction",
|
|
5984
5984
|
"type": {
|
|
5985
|
-
"text": "
|
|
5985
|
+
"text": "string"
|
|
5986
5986
|
},
|
|
5987
5987
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
5988
5988
|
"fieldName": "direction"
|
|
@@ -6042,7 +6042,7 @@
|
|
|
6042
6042
|
"name": "direction",
|
|
6043
6043
|
"privacy": "public",
|
|
6044
6044
|
"type": {
|
|
6045
|
-
"text": "
|
|
6045
|
+
"text": "string"
|
|
6046
6046
|
},
|
|
6047
6047
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6048
6048
|
"attribute": "direction",
|
|
@@ -6239,7 +6239,7 @@
|
|
|
6239
6239
|
"name": "textAlign",
|
|
6240
6240
|
"privacy": "public",
|
|
6241
6241
|
"type": {
|
|
6242
|
-
"text": "
|
|
6242
|
+
"text": "string"
|
|
6243
6243
|
},
|
|
6244
6244
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
6245
6245
|
"attribute": "text-align",
|
|
@@ -6300,7 +6300,7 @@
|
|
|
6300
6300
|
{
|
|
6301
6301
|
"name": "direction",
|
|
6302
6302
|
"type": {
|
|
6303
|
-
"text": "
|
|
6303
|
+
"text": "string"
|
|
6304
6304
|
},
|
|
6305
6305
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6306
6306
|
"fieldName": "direction",
|
|
@@ -6469,7 +6469,7 @@
|
|
|
6469
6469
|
{
|
|
6470
6470
|
"name": "text-align",
|
|
6471
6471
|
"type": {
|
|
6472
|
-
"text": "
|
|
6472
|
+
"text": "string"
|
|
6473
6473
|
},
|
|
6474
6474
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
6475
6475
|
"fieldName": "textAlign",
|
|
@@ -6616,7 +6616,7 @@
|
|
|
6616
6616
|
"name": "direction",
|
|
6617
6617
|
"privacy": "public",
|
|
6618
6618
|
"type": {
|
|
6619
|
-
"text": "
|
|
6619
|
+
"text": "string"
|
|
6620
6620
|
},
|
|
6621
6621
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6622
6622
|
"attribute": "direction"
|
|
@@ -6625,6 +6625,9 @@
|
|
|
6625
6625
|
"kind": "field",
|
|
6626
6626
|
"name": "path",
|
|
6627
6627
|
"privacy": "public",
|
|
6628
|
+
"type": {
|
|
6629
|
+
"text": "string"
|
|
6630
|
+
},
|
|
6628
6631
|
"description": "JS Path of the property in the item used for sorting the data.",
|
|
6629
6632
|
"attribute": "path"
|
|
6630
6633
|
}
|
|
@@ -6641,13 +6644,16 @@
|
|
|
6641
6644
|
{
|
|
6642
6645
|
"name": "direction",
|
|
6643
6646
|
"type": {
|
|
6644
|
-
"text": "
|
|
6647
|
+
"text": "string"
|
|
6645
6648
|
},
|
|
6646
6649
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6647
6650
|
"fieldName": "direction"
|
|
6648
6651
|
},
|
|
6649
6652
|
{
|
|
6650
6653
|
"name": "path",
|
|
6654
|
+
"type": {
|
|
6655
|
+
"text": "string"
|
|
6656
|
+
},
|
|
6651
6657
|
"description": "JS Path of the property in the item used for sorting the data.",
|
|
6652
6658
|
"fieldName": "path"
|
|
6653
6659
|
}
|
|
@@ -6684,7 +6690,7 @@
|
|
|
6684
6690
|
"name": "direction",
|
|
6685
6691
|
"privacy": "public",
|
|
6686
6692
|
"type": {
|
|
6687
|
-
"text": "
|
|
6693
|
+
"text": "string"
|
|
6688
6694
|
},
|
|
6689
6695
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6690
6696
|
"attribute": "direction",
|
|
@@ -6697,6 +6703,9 @@
|
|
|
6697
6703
|
"kind": "field",
|
|
6698
6704
|
"name": "path",
|
|
6699
6705
|
"privacy": "public",
|
|
6706
|
+
"type": {
|
|
6707
|
+
"text": "string"
|
|
6708
|
+
},
|
|
6700
6709
|
"description": "JS Path of the property in the item used for sorting the data.",
|
|
6701
6710
|
"attribute": "path",
|
|
6702
6711
|
"inheritedFrom": {
|
|
@@ -6757,7 +6766,7 @@
|
|
|
6757
6766
|
{
|
|
6758
6767
|
"name": "direction",
|
|
6759
6768
|
"type": {
|
|
6760
|
-
"text": "
|
|
6769
|
+
"text": "string"
|
|
6761
6770
|
},
|
|
6762
6771
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
6763
6772
|
"fieldName": "direction",
|
|
@@ -6768,6 +6777,9 @@
|
|
|
6768
6777
|
},
|
|
6769
6778
|
{
|
|
6770
6779
|
"name": "path",
|
|
6780
|
+
"type": {
|
|
6781
|
+
"text": "string"
|
|
6782
|
+
},
|
|
6771
6783
|
"description": "JS Path of the property in the item used for sorting the data.",
|
|
6772
6784
|
"fieldName": "path",
|
|
6773
6785
|
"inheritedFrom": {
|
|
@@ -7101,7 +7113,7 @@
|
|
|
7101
7113
|
"name": "textAlign",
|
|
7102
7114
|
"privacy": "public",
|
|
7103
7115
|
"type": {
|
|
7104
|
-
"text": "
|
|
7116
|
+
"text": "string"
|
|
7105
7117
|
},
|
|
7106
7118
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
7107
7119
|
"attribute": "text-align",
|
|
@@ -7310,7 +7322,7 @@
|
|
|
7310
7322
|
{
|
|
7311
7323
|
"name": "text-align",
|
|
7312
7324
|
"type": {
|
|
7313
|
-
"text": "
|
|
7325
|
+
"text": "string"
|
|
7314
7326
|
},
|
|
7315
7327
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
7316
7328
|
"fieldName": "textAlign",
|
|
@@ -7683,7 +7695,7 @@
|
|
|
7683
7695
|
"name": "columnRendering",
|
|
7684
7696
|
"privacy": "public",
|
|
7685
7697
|
"type": {
|
|
7686
|
-
"text": "
|
|
7698
|
+
"text": "string"
|
|
7687
7699
|
},
|
|
7688
7700
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
7689
7701
|
"attribute": "column-rendering",
|
|
@@ -7785,7 +7797,7 @@
|
|
|
7785
7797
|
"name": "dropMode",
|
|
7786
7798
|
"privacy": "public",
|
|
7787
7799
|
"type": {
|
|
7788
|
-
"text": "
|
|
7800
|
+
"text": "string"
|
|
7789
7801
|
},
|
|
7790
7802
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
7791
7803
|
"attribute": "drop-mode",
|
|
@@ -8370,7 +8382,7 @@
|
|
|
8370
8382
|
{
|
|
8371
8383
|
"name": "column-rendering",
|
|
8372
8384
|
"type": {
|
|
8373
|
-
"text": "
|
|
8385
|
+
"text": "string"
|
|
8374
8386
|
},
|
|
8375
8387
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
8376
8388
|
"fieldName": "columnRendering",
|
|
@@ -8430,7 +8442,7 @@
|
|
|
8430
8442
|
{
|
|
8431
8443
|
"name": "drop-mode",
|
|
8432
8444
|
"type": {
|
|
8433
|
-
"text": "
|
|
8445
|
+
"text": "string"
|
|
8434
8446
|
},
|
|
8435
8447
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
8436
8448
|
"fieldName": "dropMode",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-beta3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,26 +45,26 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
48
|
-
"@vaadin/a11y-base": "25.1.0-
|
|
49
|
-
"@vaadin/checkbox": "25.1.0-
|
|
50
|
-
"@vaadin/component-base": "25.1.0-
|
|
51
|
-
"@vaadin/lit-renderer": "25.1.0-
|
|
52
|
-
"@vaadin/text-field": "25.1.0-
|
|
53
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
48
|
+
"@vaadin/a11y-base": "25.1.0-beta3",
|
|
49
|
+
"@vaadin/checkbox": "25.1.0-beta3",
|
|
50
|
+
"@vaadin/component-base": "25.1.0-beta3",
|
|
51
|
+
"@vaadin/lit-renderer": "25.1.0-beta3",
|
|
52
|
+
"@vaadin/text-field": "25.1.0-beta3",
|
|
53
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-beta3",
|
|
54
54
|
"lit": "^3.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@vaadin/aura": "25.1.0-
|
|
58
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
59
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
57
|
+
"@vaadin/aura": "25.1.0-beta3",
|
|
58
|
+
"@vaadin/chai-plugins": "25.1.0-beta3",
|
|
59
|
+
"@vaadin/test-runner-commands": "25.1.0-beta3",
|
|
60
60
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
61
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
62
|
-
"sinon": "^21.0.
|
|
61
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-beta3",
|
|
62
|
+
"sinon": "^21.0.2"
|
|
63
63
|
},
|
|
64
64
|
"customElements": "custom-elements.json",
|
|
65
65
|
"web-types": [
|
|
66
66
|
"web-types.json",
|
|
67
67
|
"web-types.lit.json"
|
|
68
68
|
],
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4251850231a42298fda23b83928da588831cdb5d"
|
|
70
70
|
}
|
|
@@ -97,7 +97,6 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
97
97
|
* Aligns the columns cell content horizontally.
|
|
98
98
|
* Supported values: "start", "center" and "end".
|
|
99
99
|
* @attr {start|center|end} text-align
|
|
100
|
-
* @type {GridColumnTextAlign | null | undefined}
|
|
101
100
|
*/
|
|
102
101
|
textAlign: {
|
|
103
102
|
type: String,
|
|
@@ -269,7 +268,6 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
269
268
|
'_frozenToEndChanged(frozenToEnd, _headerCell, _footerCell, _cells)',
|
|
270
269
|
'_flexGrowChanged(flexGrow, _headerCell, _footerCell, _cells)',
|
|
271
270
|
'_textAlignChanged(textAlign, _cells, _headerCell, _footerCell)',
|
|
272
|
-
'_orderChanged(_order, _headerCell, _footerCell, _cells)',
|
|
273
271
|
'_lastFrozenChanged(_lastFrozen)',
|
|
274
272
|
'_firstFrozenToEndChanged(_firstFrozenToEnd)',
|
|
275
273
|
'_onRendererOrBindingChanged(_renderer, _cells, _bodyContentHidden, path)',
|
|
@@ -378,13 +376,6 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
378
376
|
});
|
|
379
377
|
}
|
|
380
378
|
|
|
381
|
-
/** @private */
|
|
382
|
-
_orderChanged(order) {
|
|
383
|
-
this._allCells.forEach((cell) => {
|
|
384
|
-
cell.style.order = order;
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
|
|
388
379
|
/** @private */
|
|
389
380
|
_widthChanged(width) {
|
|
390
381
|
if (this.parentElement && this.parentElement._columnPropChanged) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
7
7
|
import { addListener } from '@vaadin/component-base/src/gestures.js';
|
|
8
|
-
import { iterateChildren, updateColumnOrders } from './vaadin-grid-helpers.js';
|
|
8
|
+
import { getBodyRowCells, iterateChildren, updateColumnOrders } from './vaadin-grid-helpers.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @polymerMixin
|
|
@@ -407,12 +407,28 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
/**
|
|
410
|
+
* Swaps column orders and physically reorders cells in all rows.
|
|
410
411
|
* @param {!GridColumn} column1
|
|
411
412
|
* @param {!GridColumn} column2
|
|
412
413
|
* @protected
|
|
413
414
|
*/
|
|
414
415
|
_swapColumnOrders(column1, column2) {
|
|
416
|
+
// Swap order values and determine which column should come first
|
|
415
417
|
[column1._order, column2._order] = [column2._order, column1._order];
|
|
418
|
+
const [firstColumn, secondColumn] = column1._order < column2._order ? [column1, column2] : [column2, column1];
|
|
419
|
+
|
|
420
|
+
// Reorder cells in all rows (header, footer, body, sizer)
|
|
421
|
+
[...this.$.header.children, ...this.$.footer.children, ...this.$.items.children, this.$.sizer].forEach((row) => {
|
|
422
|
+
const cells = getBodyRowCells(row);
|
|
423
|
+
const firstColumnCells = cells.filter((cell) => firstColumn.contains(cell._column));
|
|
424
|
+
const secondColumnFirstCell = cells.find((cell) => secondColumn.contains(cell._column));
|
|
425
|
+
firstColumnCells.forEach((cell) => secondColumnFirstCell.before(cell));
|
|
426
|
+
// row.__cells are out of sync with the actual cell order after the move, and must be updated
|
|
427
|
+
if (row.__cells) {
|
|
428
|
+
row.__cells = row.__cells.toSorted((a, b) => a._column._order - b._column._order);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
|
|
416
432
|
this._debounceUpdateFrozenColumn();
|
|
417
433
|
this._updateFirstAndLastColumn();
|
|
418
434
|
}
|
|
@@ -96,14 +96,10 @@ export const ColumnResizingMixin = (superClass) =>
|
|
|
96
96
|
column.flexGrow = 0;
|
|
97
97
|
}
|
|
98
98
|
// Fix width and flex-grow for all preceding columns
|
|
99
|
-
columnRowCells
|
|
100
|
-
.
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
-
cell._column.width = `${cell.offsetWidth}px`;
|
|
104
|
-
cell._column.flexGrow = 0;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
99
|
+
columnRowCells.slice(0, columnRowCells.indexOf(targetCell)).forEach((cell) => {
|
|
100
|
+
cell._column.width = `${cell.offsetWidth}px`;
|
|
101
|
+
cell._column.flexGrow = 0;
|
|
102
|
+
});
|
|
107
103
|
|
|
108
104
|
const cellFrozenToEnd = this._frozenToEndCells[0];
|
|
109
105
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { isChrome, isSafari } from '@vaadin/component-base/src/browser-utils.js';
|
|
7
7
|
import {
|
|
8
|
+
getBodyRowCells,
|
|
8
9
|
iterateChildren,
|
|
9
10
|
iterateRowCells,
|
|
10
11
|
updateBooleanRowStates,
|
|
@@ -41,7 +42,6 @@ export const DragAndDropMixin = (superClass) =>
|
|
|
41
42
|
* - `on-top-or-between`: The drop event can happen either on top of or between Grid rows.
|
|
42
43
|
* - `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.
|
|
43
44
|
* @attr {between|on-top|on-top-or-between|on-grid} drop-mode
|
|
44
|
-
* @type {GridDropMode | null | undefined}
|
|
45
45
|
*/
|
|
46
46
|
dropMode: {
|
|
47
47
|
type: String,
|
|
@@ -446,11 +446,8 @@ export const DragAndDropMixin = (superClass) =>
|
|
|
446
446
|
__formatDefaultTransferData(rows) {
|
|
447
447
|
return rows
|
|
448
448
|
.map((row) => {
|
|
449
|
-
return
|
|
450
|
-
.filter((cell) => !cell.hidden
|
|
451
|
-
.sort((a, b) => {
|
|
452
|
-
return a._column._order > b._column._order ? 1 : -1;
|
|
453
|
-
})
|
|
449
|
+
return getBodyRowCells(row)
|
|
450
|
+
.filter((cell) => !cell.hidden)
|
|
454
451
|
.map((cell) => cell._content.textContent.trim())
|
|
455
452
|
.filter((content) => content)
|
|
456
453
|
.join('\t');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { microTask, timeOut } from '@vaadin/component-base/src/async.js';
|
|
7
7
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
8
|
-
import { ColumnObserver, updateCellState } from './vaadin-grid-helpers.js';
|
|
8
|
+
import { ColumnObserver, getBodyRowCells, updateCellState } from './vaadin-grid-helpers.js';
|
|
9
9
|
|
|
10
10
|
function arrayEquals(arr1, arr2) {
|
|
11
11
|
if (!arr1 || !arr2 || arr1.length !== arr2.length) {
|
|
@@ -156,14 +156,10 @@ export const DynamicColumnsMixin = (superClass) =>
|
|
|
156
156
|
* @protected
|
|
157
157
|
*/
|
|
158
158
|
_updateFirstAndLastColumnForRow(row) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.forEach((cell, cellIndex, children) => {
|
|
164
|
-
updateCellState(cell, 'first-column', cellIndex === 0);
|
|
165
|
-
updateCellState(cell, 'last-column', cellIndex === children.length - 1);
|
|
166
|
-
});
|
|
159
|
+
getBodyRowCells(row).forEach((cell, cellIndex, cells) => {
|
|
160
|
+
updateCellState(cell, 'first-column', cellIndex === 0);
|
|
161
|
+
updateCellState(cell, 'last-column', cellIndex === cells.length - 1);
|
|
162
|
+
});
|
|
167
163
|
}
|
|
168
164
|
|
|
169
165
|
/**
|
|
@@ -390,15 +390,13 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
390
390
|
this.collapseItem(activeRow._item);
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
} else {
|
|
393
|
+
} else if (activeCell === activeRow.firstElementChild || isDetailsCell(activeCell)) {
|
|
394
394
|
// In cell focus mode
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
395
|
+
|
|
396
|
+
// "If focus is on the first cell in a row and row focus is supported, moves focus to the row."
|
|
397
|
+
this.__rowFocusMode = true;
|
|
398
|
+
this._onRowNavigation(activeRow, 0);
|
|
399
|
+
return;
|
|
402
400
|
}
|
|
403
401
|
}
|
|
404
402
|
|
|
@@ -523,15 +521,8 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
523
521
|
return;
|
|
524
522
|
}
|
|
525
523
|
|
|
526
|
-
let columnIndex = [...activeRow.children].indexOf(activeCell);
|
|
527
|
-
if (this.$.items.contains(activeCell)) {
|
|
528
|
-
// lazy column rendering may be enabled, so we need use the always visible sizer cells to find the column index
|
|
529
|
-
columnIndex = [...this.$.sizer.children].findIndex((sizerCell) => sizerCell._column === activeCell._column);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
524
|
const isCurrentCellRowDetails = isDetailsCell(activeCell);
|
|
533
525
|
const activeRowGroup = activeRow.parentNode;
|
|
534
|
-
const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex);
|
|
535
526
|
|
|
536
527
|
// _focusedColumnOrder is memoized - this is to ensure predictable
|
|
537
528
|
// navigation when entering and leaving detail and column group cells.
|
|
@@ -539,9 +530,9 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
539
530
|
if (isCurrentCellRowDetails) {
|
|
540
531
|
this._focusedColumnOrder = 0;
|
|
541
532
|
} else {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
533
|
+
// Use the cell's column order directly instead of indexing into _getColumns,
|
|
534
|
+
// since cells may be physically reordered and DOM order doesn't match _columnTree order
|
|
535
|
+
this._focusedColumnOrder = activeCell._column._order;
|
|
545
536
|
}
|
|
546
537
|
}
|
|
547
538
|
|
|
@@ -576,15 +567,12 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
576
567
|
this._focusedColumnOrder = undefined;
|
|
577
568
|
}
|
|
578
569
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return acc;
|
|
582
|
-
}, {});
|
|
583
|
-
const dstColumnIndex = columnIndexByOrder[dstSortedColumnOrders[dstOrderedColumnIndex]];
|
|
570
|
+
// Get the target column from the sorted column orders
|
|
571
|
+
const dstColumn = dstColumns.find((col) => col._order === dstSortedColumnOrders[dstOrderedColumnIndex]);
|
|
584
572
|
|
|
585
573
|
let dstCell;
|
|
586
574
|
if (this.$.items.contains(activeCell)) {
|
|
587
|
-
const dstSizerCell = this.$.sizer.children
|
|
575
|
+
const dstSizerCell = [...this.$.sizer.children].find((cell) => cell._column === dstColumn);
|
|
588
576
|
if (this._lazyColumns) {
|
|
589
577
|
// If the column is not in the viewport, scroll it into view.
|
|
590
578
|
if (!this.__isColumnInViewport(dstSizerCell._column)) {
|
|
@@ -598,7 +586,8 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
598
586
|
// Ensure correct horizontal scroll position once the destination cell is available.
|
|
599
587
|
this._scrollHorizontallyToCell(dstCell);
|
|
600
588
|
} else {
|
|
601
|
-
|
|
589
|
+
// For header/footer, find the cell whose column contains the target column
|
|
590
|
+
dstCell = [...dstRow.children].find((cell) => cell._column.contains(dstColumn));
|
|
602
591
|
this._scrollHorizontallyToCell(dstCell);
|
|
603
592
|
}
|
|
604
593
|
|
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -55,7 +55,6 @@ export const ScrollMixin = (superClass) =>
|
|
|
55
55
|
* and thus not rendered.
|
|
56
56
|
*
|
|
57
57
|
* @attr {eager|lazy} column-rendering
|
|
58
|
-
* @type {!ColumnRendering}
|
|
59
58
|
*/
|
|
60
59
|
columnRendering: {
|
|
61
60
|
type: String,
|
|
@@ -207,6 +206,8 @@ export const ScrollMixin = (superClass) =>
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
this._scrollHorizontallyToCell(column._headerCell);
|
|
209
|
+
// Update cell position synchronously
|
|
210
|
+
this.__updateHorizontalScrollPosition();
|
|
210
211
|
// Synchronously update cells when using lazy column rendering
|
|
211
212
|
this.__updateColumnsBodyContentHidden();
|
|
212
213
|
}
|
|
@@ -23,7 +23,6 @@ export const GridSortColumnMixin = (superClass) =>
|
|
|
23
23
|
* How to sort the data.
|
|
24
24
|
* Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
|
|
25
25
|
* descending direction, or `null` for not sorting the data.
|
|
26
|
-
* @type {GridSorterDirection | undefined}
|
|
27
26
|
*/
|
|
28
27
|
direction: {
|
|
29
28
|
type: String,
|
|
@@ -16,13 +16,14 @@ export const GridSorterMixin = (superClass) =>
|
|
|
16
16
|
/**
|
|
17
17
|
* JS Path of the property in the item used for sorting the data.
|
|
18
18
|
*/
|
|
19
|
-
path:
|
|
19
|
+
path: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* How to sort the data.
|
|
23
25
|
* Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
|
|
24
26
|
* descending direction, or `null` for not sorting the data.
|
|
25
|
-
* @type {GridSorterDirection | undefined}
|
|
26
27
|
*/
|
|
27
28
|
direction: {
|
|
28
29
|
type: String,
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/grid",
|
|
4
|
-
"version": "25.1.0-
|
|
4
|
+
"version": "25.1.0-beta3",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
104
104
|
"value": {
|
|
105
105
|
"type": [
|
|
106
|
-
"
|
|
106
|
+
"string",
|
|
107
107
|
"null",
|
|
108
108
|
"undefined"
|
|
109
109
|
]
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
239
239
|
"value": {
|
|
240
240
|
"type": [
|
|
241
|
-
"
|
|
241
|
+
"string",
|
|
242
242
|
"null",
|
|
243
243
|
"undefined"
|
|
244
244
|
]
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
"name": "vaadin-grid-column",
|
|
253
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-
|
|
253
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
254
254
|
"attributes": [
|
|
255
255
|
{
|
|
256
256
|
"name": "auto-width",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
379
379
|
"value": {
|
|
380
380
|
"type": [
|
|
381
|
-
"
|
|
381
|
+
"string",
|
|
382
382
|
"null",
|
|
383
383
|
"undefined"
|
|
384
384
|
]
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
569
569
|
"value": {
|
|
570
570
|
"type": [
|
|
571
|
-
"
|
|
571
|
+
"string",
|
|
572
572
|
"null",
|
|
573
573
|
"undefined"
|
|
574
574
|
]
|
|
@@ -790,7 +790,7 @@
|
|
|
790
790
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
791
791
|
"value": {
|
|
792
792
|
"type": [
|
|
793
|
-
"
|
|
793
|
+
"string",
|
|
794
794
|
"null",
|
|
795
795
|
"undefined"
|
|
796
796
|
]
|
|
@@ -980,7 +980,7 @@
|
|
|
980
980
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
981
981
|
"value": {
|
|
982
982
|
"type": [
|
|
983
|
-
"
|
|
983
|
+
"string",
|
|
984
984
|
"null",
|
|
985
985
|
"undefined"
|
|
986
986
|
]
|
|
@@ -1003,7 +1003,7 @@
|
|
|
1003
1003
|
},
|
|
1004
1004
|
{
|
|
1005
1005
|
"name": "vaadin-grid-selection-column",
|
|
1006
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-
|
|
1006
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
1007
1007
|
"attributes": [
|
|
1008
1008
|
{
|
|
1009
1009
|
"name": "auto-select",
|
|
@@ -1164,7 +1164,7 @@
|
|
|
1164
1164
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1165
1165
|
"value": {
|
|
1166
1166
|
"type": [
|
|
1167
|
-
"
|
|
1167
|
+
"string",
|
|
1168
1168
|
"null",
|
|
1169
1169
|
"undefined"
|
|
1170
1170
|
]
|
|
@@ -1387,7 +1387,7 @@
|
|
|
1387
1387
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1388
1388
|
"value": {
|
|
1389
1389
|
"type": [
|
|
1390
|
-
"
|
|
1390
|
+
"string",
|
|
1391
1391
|
"null",
|
|
1392
1392
|
"undefined"
|
|
1393
1393
|
]
|
|
@@ -1422,7 +1422,8 @@
|
|
|
1422
1422
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
1423
1423
|
"value": {
|
|
1424
1424
|
"type": [
|
|
1425
|
-
"
|
|
1425
|
+
"string",
|
|
1426
|
+
"null",
|
|
1426
1427
|
"undefined"
|
|
1427
1428
|
]
|
|
1428
1429
|
}
|
|
@@ -1457,7 +1458,8 @@
|
|
|
1457
1458
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
1458
1459
|
"value": {
|
|
1459
1460
|
"type": [
|
|
1460
|
-
"
|
|
1461
|
+
"string",
|
|
1462
|
+
"null",
|
|
1461
1463
|
"undefined"
|
|
1462
1464
|
]
|
|
1463
1465
|
}
|
|
@@ -1502,7 +1504,8 @@
|
|
|
1502
1504
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
1503
1505
|
"value": {
|
|
1504
1506
|
"type": [
|
|
1505
|
-
"
|
|
1507
|
+
"string",
|
|
1508
|
+
"null",
|
|
1506
1509
|
"undefined"
|
|
1507
1510
|
]
|
|
1508
1511
|
}
|
|
@@ -1622,7 +1625,7 @@
|
|
|
1622
1625
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1623
1626
|
"value": {
|
|
1624
1627
|
"type": [
|
|
1625
|
-
"
|
|
1628
|
+
"string",
|
|
1626
1629
|
"null",
|
|
1627
1630
|
"undefined"
|
|
1628
1631
|
]
|
|
@@ -1669,7 +1672,8 @@
|
|
|
1669
1672
|
"description": "How to sort the data.\nPossible values are `asc` to use an ascending algorithm, `desc` to sort the data in\ndescending direction, or `null` for not sorting the data.",
|
|
1670
1673
|
"value": {
|
|
1671
1674
|
"type": [
|
|
1672
|
-
"
|
|
1675
|
+
"string",
|
|
1676
|
+
"null",
|
|
1673
1677
|
"undefined"
|
|
1674
1678
|
]
|
|
1675
1679
|
}
|
|
@@ -1822,7 +1826,7 @@
|
|
|
1822
1826
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
1823
1827
|
"value": {
|
|
1824
1828
|
"type": [
|
|
1825
|
-
"
|
|
1829
|
+
"string",
|
|
1826
1830
|
"null",
|
|
1827
1831
|
"undefined"
|
|
1828
1832
|
]
|
|
@@ -2071,7 +2075,7 @@
|
|
|
2071
2075
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
2072
2076
|
"value": {
|
|
2073
2077
|
"type": [
|
|
2074
|
-
"
|
|
2078
|
+
"string",
|
|
2075
2079
|
"null",
|
|
2076
2080
|
"undefined"
|
|
2077
2081
|
]
|
|
@@ -2261,7 +2265,7 @@
|
|
|
2261
2265
|
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
|
|
2262
2266
|
"value": {
|
|
2263
2267
|
"type": [
|
|
2264
|
-
"
|
|
2268
|
+
"string",
|
|
2265
2269
|
"null",
|
|
2266
2270
|
"undefined"
|
|
2267
2271
|
]
|
|
@@ -2284,7 +2288,7 @@
|
|
|
2284
2288
|
},
|
|
2285
2289
|
{
|
|
2286
2290
|
"name": "vaadin-grid",
|
|
2287
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`header-row` | Header row in the internal table\n`footer-row` | Footer row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2291
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`header-row` | Header row in the internal table\n`footer-row` | Footer row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2288
2292
|
"attributes": [
|
|
2289
2293
|
{
|
|
2290
2294
|
"name": "accessible-name",
|
|
@@ -2313,7 +2317,9 @@
|
|
|
2313
2317
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
2314
2318
|
"value": {
|
|
2315
2319
|
"type": [
|
|
2316
|
-
"
|
|
2320
|
+
"string",
|
|
2321
|
+
"null",
|
|
2322
|
+
"undefined"
|
|
2317
2323
|
]
|
|
2318
2324
|
}
|
|
2319
2325
|
},
|
|
@@ -2333,7 +2339,7 @@
|
|
|
2333
2339
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
2334
2340
|
"value": {
|
|
2335
2341
|
"type": [
|
|
2336
|
-
"
|
|
2342
|
+
"string",
|
|
2337
2343
|
"null",
|
|
2338
2344
|
"undefined"
|
|
2339
2345
|
]
|
|
@@ -2488,7 +2494,9 @@
|
|
|
2488
2494
|
"description": "Allows you to choose between modes for rendering columns in the grid:\n\n\"eager\" (default): All columns are rendered upfront, regardless of their visibility within the viewport.\nThis mode should generally be preferred, as it avoids the limitations imposed by the \"lazy\" mode.\nUse this mode unless the grid has a large number of columns and performance outweighs the limitations\nin priority.\n\n\"lazy\": Optimizes the rendering of cells when there are multiple columns in the grid by virtualizing\nhorizontal scrolling. In this mode, body cells are rendered only when their corresponding columns are\ninside the visible viewport.\n\nUsing \"lazy\" rendering should be used only if you're dealing with a large number of columns and performance\nis your highest priority. For most use cases, the default \"eager\" mode is recommended due to the\nlimitations imposed by the \"lazy\" mode.\n\nWhen using the \"lazy\" mode, keep the following limitations in mind:\n\n- Row Height: When only a number of columns are visible at once, the height of a row can only be that of\nthe highest cell currently visible on that row. Make sure each cell on a single row has the same height\nas all other cells on that row. If row cells have different heights, users may experience jumpiness when\nscrolling the grid horizontally as lazily rendered cells with different heights are scrolled into view.\n\n- Auto-width Columns: For the columns that are initially outside the visible viewport but still use auto-width,\nonly the header content is taken into account when calculating the column width because the body cells\nof the columns outside the viewport are not initially rendered.\n\n- Screen Reader Compatibility: Screen readers may not be able to associate the focused cells with the correct\nheaders when only a subset of the body cells on a row is rendered.\n\n- Keyboard Navigation: Tabbing through focusable elements inside the grid body may not work as expected because\nsome of the columns that would include focusable elements in the body cells may be outside the visible viewport\nand thus not rendered.",
|
|
2489
2495
|
"value": {
|
|
2490
2496
|
"type": [
|
|
2491
|
-
"
|
|
2497
|
+
"string",
|
|
2498
|
+
"null",
|
|
2499
|
+
"undefined"
|
|
2492
2500
|
]
|
|
2493
2501
|
}
|
|
2494
2502
|
},
|
|
@@ -2550,7 +2558,7 @@
|
|
|
2550
2558
|
"description": "Defines the locations within the Grid row where an element can be dropped.\n\nPossible values are:\n- `between`: The drop event can happen between Grid rows.\n- `on-top`: The drop event can happen on top of Grid rows.\n- `on-top-or-between`: The drop event can happen either on top of or between Grid rows.\n- `on-grid`: The drop event will not happen on any specific row, it will show the drop target outline around the whole grid.",
|
|
2551
2559
|
"value": {
|
|
2552
2560
|
"type": [
|
|
2553
|
-
"
|
|
2561
|
+
"string",
|
|
2554
2562
|
"null",
|
|
2555
2563
|
"undefined"
|
|
2556
2564
|
]
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/grid",
|
|
4
|
-
"version": "25.1.0-
|
|
4
|
+
"version": "25.1.0-beta3",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-grid-column",
|
|
103
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-
|
|
103
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"name": "vaadin-grid-selection-column",
|
|
369
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-
|
|
369
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
370
370
|
"extension": true,
|
|
371
371
|
"attributes": [
|
|
372
372
|
{
|
|
@@ -828,7 +828,7 @@
|
|
|
828
828
|
},
|
|
829
829
|
{
|
|
830
830
|
"name": "vaadin-grid",
|
|
831
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta2/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`header-row` | Header row in the internal table\n`footer-row` | Footer row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
831
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.1.0-beta3/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`header-row` | Header row in the internal table\n`footer-row` | Footer row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
832
832
|
"extension": true,
|
|
833
833
|
"attributes": [
|
|
834
834
|
{
|