@scoped-vaadin/grid
Version:
A free, flexible and high-quality Web Component for showing large amounts of tabular data
831 lines • 74.6 kB
JSON
{
"$schema": "https://json.schemastore.org/web-types",
"name": "@scoped-vaadin/grid",
"version": "24.6.2",
"description-markup": "markdown",
"framework": "lit",
"framework-config": {
"enable-when": {
"node-packages": [
"lit"
]
}
},
"contributions": {
"html": {
"elements": [
{
"name": "vaadin24-grid-column-group",
"description": "A `<vaadin24-grid-column-group>` is used to make groups of columns in `<vaadin24-grid>` and\nto configure additional headers and footers.\n\nGroups can be nested to create complex header and footer configurations.\n\n#### Example:\n```html\n<vaadin24-grid-column-group resizable id=\"columnGroup\">\n <vaadin24-grid-column id=\"column1\"></vaadin24-grid-column>\n <vaadin24-grid-column id=\"column2\"></vaadin24-grid-column>\n</vaadin24-grid-column-group>\n```\n```js\nconst columnGroup = document.querySelector('#columnGroup');\ncolumnGroup.headerRenderer = (root, columnGroup) => {\n root.textContent = 'header';\n}\n\nconst column1 = document.querySelector('#column1');\ncolumn1.headerRenderer = (root, column) => { ... };\ncolumn1.renderer = (root, column, model) => { ... };\n\nconst column2 = document.querySelector('#column2');\ncolumn2.headerRenderer = (root, column) => { ... };\ncolumn2.renderer = (root, column, model) => { ... };\n```",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text content to display in the header cell of the column.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-column",
"description": "A `<vaadin24-grid-column>` is used to configure how a column in `<vaadin24-grid>`\nshould look like.\n\nSee [`<vaadin24-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin24-grid-column>`.",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoWidth",
"description": "Automatically sets the width of the column based on the column contents when this is set to `true`.\n\nFor performance reasons the column width is calculated automatically only once when the grid items\nare rendered for the first time and the calculation only considers the rows which are currently\nrendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell\ncontent changes, the column width might not match the contents anymore.\n\nHidden columns are ignored in the calculation and their widths are not automatically updated when\nyou show a column that was initially hidden.\n\nYou can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.\n\nThe column width may still grow larger when `flexGrow` is not 0.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text content to display in the header cell of the column.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".width",
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
"value": {
"kind": "expression"
}
},
{
"name": ".flexGrow",
"description": "Flex grow ratio for the cell widths. When set to 0, cell width is fixed.",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
"value": {
"kind": "expression"
}
},
{
"name": ".path",
"description": "Path to an item sub-property whose value gets displayed in the column body cells.\nThe property name is also shown in the column header if an explicit header or renderer isn't defined.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-filter",
"description": "`<vaadin24-grid-filter>` is a helper element for the `<vaadin24-grid>` that provides out-of-the-box UI controls,\nand handlers for filtering the grid data.\n\n#### Example:\n```html\n<vaadin24-grid-column id=\"column\"></vaadin24-grid-column>\n```\n```js\nconst column = document.querySelector('#column');\ncolumn.headerRenderer = (root, column) => {\n let filter = root.firstElementChild;\n if (!filter) {\n filter = document.createElement('vaadin24-grid-filter');\n root.appendChild(filter);\n }\n filter.path = 'name.first';\n};\ncolumn.renderer = (root, column, model) => {\n root.textContent = model.item.name.first;\n};\n```",
"extension": true,
"attributes": [
{
"name": ".path",
"description": "JS Path of the property in the item used for filtering the data.",
"value": {
"kind": "expression"
}
},
{
"name": ".value",
"description": "Current filter value.",
"value": {
"kind": "expression"
}
},
{
"name": "@value-changed",
"description": "Fired when the `value` property changes.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-filter-column",
"description": "`<vaadin24-grid-filter-column>` is a helper element for the `<vaadin24-grid>`\nthat provides default header renderer and functionality for filtering.\n\n#### Example:\n```html\n<vaadin24-grid items=\"[[items]]\">\n <vaadin24-grid-filter-column path=\"name.first\"></vaadin24-grid-filter-column>\n\n <vaadin24-grid-column>\n ...\n```",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoWidth",
"description": "Automatically sets the width of the column based on the column contents when this is set to `true`.\n\nFor performance reasons the column width is calculated automatically only once when the grid items\nare rendered for the first time and the calculation only considers the rows which are currently\nrendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell\ncontent changes, the column width might not match the contents anymore.\n\nHidden columns are ignored in the calculation and their widths are not automatically updated when\nyou show a column that was initially hidden.\n\nYou can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.\n\nThe column width may still grow larger when `flexGrow` is not 0.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text to display as the label of the column filter text-field.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".width",
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
"value": {
"kind": "expression"
}
},
{
"name": ".flexGrow",
"description": "Flex grow ratio for the cell widths. When set to 0, cell width is fixed.",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
"value": {
"kind": "expression"
}
},
{
"name": ".path",
"description": "JS Path of the property in the item used for filtering the data.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-selection-column",
"description": "`<vaadin24-grid-selection-column>` is a helper element for the `<vaadin24-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin24-grid items=\"[[items]]\">\n <vaadin24-grid-selection-column frozen auto-select></vaadin24-grid-selection-column>\n\n <vaadin24-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin24-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/24.6.2/#/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__",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoWidth",
"description": "Override `autoWidth` to enable auto-width",
"value": {
"kind": "expression"
}
},
{
"name": "?selectAll",
"description": "When true, all the items are selected.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoSelect",
"description": "When true, the active gets automatically selected.",
"value": {
"kind": "expression"
}
},
{
"name": "?dragSelect",
"description": "When true, rows can be selected by dragging over the selection column.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text content to display in the header cell of the column.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".width",
"description": "Width of the cells for this column.",
"value": {
"kind": "expression"
}
},
{
"name": ".flexGrow",
"description": "Flex grow ratio for the cell widths. When set to 0, cell width is fixed.",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
"value": {
"kind": "expression"
}
},
{
"name": ".path",
"description": "Path to an item sub-property whose value gets displayed in the column body cells.\nThe property name is also shown in the column header if an explicit header or renderer isn't defined.",
"value": {
"kind": "expression"
}
},
{
"name": "@select-all-changed",
"description": "Fired when the `selectAll` property changes.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-sorter",
"description": "`<vaadin24-grid-sorter>` is a helper element for the `<vaadin24-grid>` that provides out-of-the-box UI controls,\nvisual feedback, and handlers for sorting the grid data.\n\n#### Example:\n```html\n<vaadin24-grid-column id=\"column\"></vaadin24-grid-column>\n```\n```js\nconst column = document.querySelector('#column');\ncolumn.renderer = (root, column, model) => {\n let sorter = root.firstElementChild;\n if (!sorter) {\n sorter = document.createElement('vaadin24-grid-sorter');\n root.appendChild(sorter);\n }\n sorter.path = 'name.first';\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------------|----------------\n`content` | The slotted content wrapper\n`indicators` | The internal sorter indicators.\n`order` | The internal sorter order\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-------------|-------------|------------\n`direction` | Sort direction of a sorter | :host",
"extension": true,
"attributes": [
{
"name": ".path",
"description": "JS Path of the property in the item used for sorting the data.",
"value": {
"kind": "expression"
}
},
{
"name": ".direction",
"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.",
"value": {
"kind": "expression"
}
},
{
"name": "@direction-changed",
"description": "Fired when the `direction` property changes.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-sort-column",
"description": "`<vaadin24-grid-sort-column>` is a helper element for the `<vaadin24-grid>`\nthat provides default header renderer and functionality for sorting.\n\n#### Example:\n```html\n<vaadin24-grid items=\"[[items]]\">\n <vaadin24-grid-sort-column path=\"name.first\" direction=\"asc\"></vaadin24-grid-sort-column>\n\n <vaadin24-grid-column>\n ...\n```",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoWidth",
"description": "Automatically sets the width of the column based on the column contents when this is set to `true`.\n\nFor performance reasons the column width is calculated automatically only once when the grid items\nare rendered for the first time and the calculation only considers the rows which are currently\nrendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell\ncontent changes, the column width might not match the contents anymore.\n\nHidden columns are ignored in the calculation and their widths are not automatically updated when\nyou show a column that was initially hidden.\n\nYou can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.\n\nThe column width may still grow larger when `flexGrow` is not 0.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text content to display in the header cell of the column.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".width",
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
"value": {
"kind": "expression"
}
},
{
"name": ".flexGrow",
"description": "Flex grow ratio for the cell widths. When set to 0, cell width is fixed.",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
"value": {
"kind": "expression"
}
},
{
"name": ".path",
"description": "JS Path of the property in the item used for sorting the data.",
"value": {
"kind": "expression"
}
},
{
"name": ".direction",
"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.",
"value": {
"kind": "expression"
}
},
{
"name": "@direction-changed",
"description": "Fired when the `direction` property changes.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-tree-toggle",
"description": "`<vaadin24-grid-tree-toggle>` is a helper element for the `<vaadin24-grid>`\nthat provides toggle and level display functionality for the item tree.\n\n#### Example:\n```html\n<vaadin24-grid-column id=\"column\"></vaadin24-grid-column>\n```\n```js\nconst column = document.querySelector('#column');\ncolumn.renderer = (root, column, model) => {\n let treeToggle = root.firstElementChild;\n if (!treeToggle) {\n treeToggle = document.createElement('vaadin24-grid-tree-toggle');\n treeToggle.addEventListener('expanded-changed', () => { ... });\n root.appendChild(treeToggle);\n }\n treeToggle.leaf = !model.item.hasChildren;\n treeToggle.level = level;\n treeToggle.expanded = expanded;\n treeToggle.textContent = model.item.name;\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---|---\n`toggle` | The tree toggle icon\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n---|---|---\n`expanded` | When present, the toggle is expanded | :host\n`leaf` | When present, the toggle is not expandable, i. e., the current item is a leaf | :host\n\nThe following custom CSS properties are available on\nthe `<vaadin24-grid-tree-toggle>` element:\n\nCustom CSS property | Description | Default\n---|---|---\n`--vaadin-grid-tree-toggle-level-offset` | Visual offset step for each tree sublevel | `1em`",
"extension": true,
"attributes": [
{
"name": "?leaf",
"description": "Hides the toggle icon and disables toggling a tree sublevel.",
"value": {
"kind": "expression"
}
},
{
"name": "?expanded",
"description": "Sublevel toggle state.",
"value": {
"kind": "expression"
}
},
{
"name": ".level",
"description": "Current level of the tree represented with a horizontal offset\nof the toggle button.",
"value": {
"kind": "expression"
}
},
{
"name": "@expanded-changed",
"description": "Fired when the `expanded` property changes.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid-tree-column",
"description": "`<vaadin24-grid-tree-column>` is a helper element for the `<vaadin24-grid>`\nthat provides default renderer and functionality for toggling tree/hierarchical items.\n\n#### Example:\n```html\n<vaadin24-grid items=\"[[items]]\">\n <vaadin24-grid-tree-column path=\"name.first\"></vaadin24-grid-tree-column>\n\n <vaadin24-grid-column>\n ...\n```",
"extension": true,
"attributes": [
{
"name": "?resizable",
"description": "When set to true, the column is user-resizable.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozen",
"description": "When true, the column is frozen. When a column inside of a column group is frozen,\nall of the sibling columns inside the group will get frozen also.",
"value": {
"kind": "expression"
}
},
{
"name": "?frozenToEnd",
"description": "When true, the column is frozen to end of grid.\n\nWhen a column inside of a column group is frozen to end, all of the sibling columns\ninside the group will get frozen to end also.\n\nColumn can not be set as `frozen` and `frozenToEnd` at the same time.",
"value": {
"kind": "expression"
}
},
{
"name": "?rowHeader",
"description": "When true, the cells for this column will be rendered with the `role` attribute\nset as `rowheader`, instead of the `gridcell` role value used by default.\n\nWhen a column is set as row header, its cells will be announced by screen readers\nwhile navigating to help user identify the current row as uniquely as possible.",
"value": {
"kind": "expression"
}
},
{
"name": "?hidden",
"description": "When set to true, the cells for this column are hidden.",
"value": {
"kind": "expression"
}
},
{
"name": "?autoWidth",
"description": "Automatically sets the width of the column based on the column contents when this is set to `true`.\n\nFor performance reasons the column width is calculated automatically only once when the grid items\nare rendered for the first time and the calculation only considers the rows which are currently\nrendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell\ncontent changes, the column width might not match the contents anymore.\n\nHidden columns are ignored in the calculation and their widths are not automatically updated when\nyou show a column that was initially hidden.\n\nYou can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.\n\nThe column width may still grow larger when `flexGrow` is not 0.",
"value": {
"kind": "expression"
}
},
{
"name": ".header",
"description": "Text content to display in the header cell of the column.",
"value": {
"kind": "expression"
}
},
{
"name": ".textAlign",
"description": "Aligns the columns cell content horizontally.\nSupported values: \"start\", \"center\" and \"end\".",
"value": {
"kind": "expression"
}
},
{
"name": ".headerPartName",
"description": "Custom part name for the header cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerPartName",
"description": "Custom part name for the footer cell.",
"value": {
"kind": "expression"
}
},
{
"name": ".headerRenderer",
"description": "Custom function for rendering the header content.\nReceives two arguments:\n\n- `root` The header cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".footerRenderer",
"description": "Custom function for rendering the footer content.\nReceives two arguments:\n\n- `root` The footer cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.",
"value": {
"kind": "expression"
}
},
{
"name": ".width",
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
"value": {
"kind": "expression"
}
},
{
"name": ".flexGrow",
"description": "Flex grow ratio for the cell widths. When set to 0, cell width is fixed.",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin24-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
"value": {
"kind": "expression"
}
},
{
"name": ".path",
"description": "JS Path of the property in the item used as text content for the tree toggle.",
"value": {
"kind": "expression"
}
}
]
},
{
"name": "vaadin24-grid",
"description": "`<vaadin24-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/24.6.2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin24-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/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<vaadin24-grid>\n <vaadin24-grid-column path=\"name.first\" header=\"First name\"></vaadin24-grid-column>\n <vaadin24-grid-column path=\"name.last\" header=\"Last name\"></vaadin24-grid-column>\n <vaadin24-grid-column path=\"email\"></vaadin24-grid-column>\n</vaadin24-grid>\n```\n\nFor custom content `vaadin24-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<vaadin24-grid>\n <vaadin24-grid-column></vaadin24-grid-column>\n <vaadin24-grid-column></vaadin24-grid-column>\n <vaadin24-grid-column></vaadin24-grid-column>\n</vaadin24-grid>\n```\n```js\nconst grid = document.querySelector('vaadin24-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin24-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\nThe following helper elements can be used for further customization:\n- [`<vaadin24-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid-column-group)\n- [`<vaadin24-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid-filter)\n- [`<vaadin24-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid-sorter)\n- [`<vaadin24-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin24-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/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.html` bundle.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin24-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.6.2/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin24-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/24.6.2/#/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?pag