Skip to content

Commit

Permalink
Generate correct Variant classes. (#4402)
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore authored and Denis committed Jul 17, 2018
1 parent 0a2147a commit c0ef030
Show file tree
Hide file tree
Showing 53 changed files with 802 additions and 823 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"name": "item",
"type": [
"STRING",
"OBJECT",
"OBJECT"
],
"objectType": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"name": "detail.value",
"type": [
"OBJECT",
"STRING"
"OBJECT"
],
"objectType": [],
"description": "the selected item. Type is the same as the type of `items`."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
"name": "detail.value",
"type": [
"OBJECT",
"STRING"
"OBJECT"
],
"objectType": [],
"description": "the selected item. Type is the same as the type of `items`."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@
],
"variants": {
"lumo": [
"no-border",
"no-row-borders",
"column-borders",
"row-stripes",
"compact",
"wrap-cell-content"
],
"material": [
"column-dividers"
]
},
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Polymer element.\n\n### Quick Start\n\nUse the [`<vaadin-grid-column>`](#/elements/vaadin-grid-column) element to configure the grid columns.\n\nThen assign an array to the [`items`](#/elements/vaadin-grid#property-items) property to visualize your data.\n\n#### Example:\n```html\n<vaadin-grid items='[{\"name\": \"John\", \"surname\": \"Lennon\", \"role\": \"singer\"},\n{\"name\": \"Ringo\", \"surname\": \"Starr\", \"role\": \"drums\"}]'>\n <vaadin-grid-column>\n <template class=\"header\">Name</template>\n <template>[[item.name]]</template>\n </vaadin-grid-column>\n <vaadin-grid-column>\n <template class=\"header\">Surname</template>\n <template>[[item.surname]]</template>\n </vaadin-grid-column>\n <vaadin-grid-column>\n <template class=\"header\">Role</template>\n <template>[[item.role]]</template>\n </vaadin-grid-column>\n</vaadin-grid>\n```\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](#/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\nA column template can be decorated with one the following class names to specify its purpose\n- `header`: Marks a header template\n- `footer`: Marks a footer template\n- `row-details`: Marks a row details template\n\nThe following built-in template variables can be bound to inside the column templates:\n- `[[index]]`: Number representing the row index\n- `[[item]]` and it's sub-properties: Data object (provided by a data provider / items array)\n- `{{selected}}`: True if the item is selected (can be two-way bound)\n- `{{detailsOpened}}`: True if the item has row details opened (can be two-way bound)\n- `{{expanded}}`: True if the item has tree sublevel expanded (can be two-way bound)\n- `[[level]]`: Number of the tree sublevel of the item, first level-items have 0\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`](#/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`](#/elements/vaadin-grid#property-dataProvider) in\nthe API reference below for the detailed data provider arguments description,\nand the “Assigning Data” page in the demos.\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 = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(\n response.employees, // requested page of items\n response.totalSize // total number of items\n );\n };\n xhr.open('GET', url, true);\n xhr.send();\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 = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(response.employees);\n };\n xhr.open('GET', url, true);\n xhr.send();\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`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`resize-handle` | Handle for resizing the columns\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`, `left`, `right` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`last-frozen` | Last frozen cell | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | 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\nSee [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{
"name": "to",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -127,7 +127,7 @@
{
"name": "from",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -144,7 +144,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand Down Expand Up @@ -184,7 +184,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -209,7 +209,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand Down Expand Up @@ -242,7 +242,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -267,7 +267,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -284,7 +284,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand Down Expand Up @@ -325,7 +325,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand All @@ -342,7 +342,7 @@
{
"name": "path",
"type": [
"STRING",
"OBJECT",
"OBJECT",
"OBJECT"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@
"Vaadin.ThemableMixin",
"Vaadin.ControlStateMixin"
],
"variants": {},
"variants": {
"lumo": [
"small",
"align-center",
"align-right"
],
"material": [
"always-float-label"
]
},
"description": "`<vaadin-text-area>` is a Polymer 2 element for text area control in forms.\n\n```html\n<vaadin-text-area label=\"Add description\">\n</vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-area label=\"Add description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`value` | The text value element inside the `input-field` element\n`error-message` | The error message element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-------------|-------------|------------\n`disabled` | Set to a disabled text field | :host\n`has-value` | Set when the element has a value | :host\n`has-label` | Set when the element has a label | :host\n`invalid` | Set when the element is invalid | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set to a readonly text field | :host\n\nSee [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)"
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
"small",
"align-center",
"align-right"
],
"material": [
"always-float-label"
]
},
"description": "`<vaadin-text-field>` is a Polymer 2 element for text field control in forms.\n\n```html\n<vaadin-text-field label=\"First Name\">\n</vaadin-text-field>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-field>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-field label=\"Email address\">\n <div slot=\"prefix\">Sent to:</div>\n <div slot=\"suffix\">@vaadin.com</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------|-------------|-------------\n`--vaadin-text-field-default-width` | Set the default width of the input field | `12em`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`value` | The text value element inside the `input-field` element\n`error-message` | The error message element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-------------|-------------|------------\n`disabled` | Set to a disabled text field | :host\n`has-value` | Set when the element has a value | :host\n`has-label` | Set when the element has a label | :host\n`invalid` | Set when the element is invalid | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set to a readonly text field | :host\n\nSee [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
package com.vaadin.flow.component.button;

import javax.annotation.Generated;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import com.vaadin.flow.component.ClickNotifier;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.ClickNotifier;
import com.vaadin.flow.component.HasText;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.HasTheme;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.dom.Element;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@
package com.vaadin.flow.component.checkbox;

import javax.annotation.Generated;

import com.vaadin.flow.component.AbstractSinglePropertyField;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.ClickNotifier;
import com.vaadin.flow.component.Synchronize;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.Synchronize;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.shared.Registration;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.component.AbstractSinglePropertyField;

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
package com.vaadin.flow.component.checkbox;

import javax.annotation.Generated;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import com.vaadin.flow.component.AbstractSinglePropertyField;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.HasTheme;
import com.vaadin.flow.component.NotSupported;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import com.vaadin.flow.component.Synchronize;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.component.NotSupported;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.shared.Registration;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.component.AbstractSinglePropertyField;

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,24 @@
package com.vaadin.flow.component.combobox;

import javax.annotation.Generated;

import com.vaadin.flow.component.AbstractSinglePropertyField;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.EventData;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.NotSupported;
import com.vaadin.flow.component.Synchronize;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.HasValue;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.Synchronize;
import elemental.json.JsonArray;
import com.vaadin.flow.component.NotSupported;
import com.vaadin.flow.component.EventData;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.shared.Registration;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.dom.Element;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.shared.Registration;

import elemental.json.JsonArray;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.component.AbstractSinglePropertyField;

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
package com.vaadin.flow.component.combobox;

import javax.annotation.Generated;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;

import com.vaadin.flow.component.HasStyle;
import elemental.json.JsonObject;
import com.vaadin.flow.component.Component;

/**
* <p>
Expand Down Expand Up @@ -130,25 +128,10 @@ protected void setIndex(double index) {
*
* @return the {@code item} property from the webcomponent
*/
protected JsonObject getItemObjectJsonObject() {
protected JsonObject getItemJsonObject() {
return (JsonObject) getElement().getPropertyRaw("item");
}

/**
* <p>
* Description copied from corresponding location in WebComponent:
* </p>
* <p>
* The item to render
* </p>
*
* @param item
* the String value to set
*/
protected void setItem(String item) {
getElement().setProperty("item", item == null ? "" : item);
}

/**
* <p>
* Description copied from corresponding location in WebComponent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,21 @@
package com.vaadin.flow.component.combobox;

import javax.annotation.Generated;

import com.vaadin.flow.component.AbstractSinglePropertyField;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.EventData;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.NotSupported;
import com.vaadin.flow.component.Synchronize;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.shared.Registration;

import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.Synchronize;
import elemental.json.JsonArray;
import elemental.json.JsonObject;
import com.vaadin.flow.component.NotSupported;
import com.vaadin.flow.component.DomEvent;
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.shared.Registration;
import com.vaadin.flow.component.EventData;
import com.vaadin.flow.function.SerializableFunction;
import com.vaadin.flow.function.SerializableBiFunction;
import com.vaadin.flow.component.AbstractSinglePropertyField;

/**
* <p>
Expand Down
Loading

0 comments on commit c0ef030

Please sign in to comment.