@vaadin/vaadin-crud
Advanced tools
Comparing version 1.2.1 to 1.3.0-alpha1
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-crud", | ||
"version": "1.2.1", | ||
"version": "1.3.0-alpha1", | ||
"main": "vaadin-crud.js", | ||
@@ -22,3 +22,5 @@ "author": "Vaadin Ltd", | ||
"files": [ | ||
"vaadin-crud.html", | ||
"vaadin-*.d.ts", | ||
"vaadin-*.js", | ||
"@types", | ||
"src", | ||
@@ -36,18 +38,18 @@ "theme" | ||
"@polymer/iron-media-query": "^3.0.0", | ||
"@vaadin/vaadin-themable-mixin": "^1.4.4", | ||
"@vaadin/vaadin-element-mixin": "^2.3.2", | ||
"@vaadin/vaadin-themable-mixin": "^1.6.1", | ||
"@vaadin/vaadin-element-mixin": "^2.4.1", | ||
"@vaadin/vaadin-lumo-styles": "^1.6.0", | ||
"@vaadin/vaadin-material-styles": "^1.3.2", | ||
"@vaadin/vaadin-dialog": "^2.4.0", | ||
"@vaadin/vaadin-grid": "^5.6.0", | ||
"@vaadin/vaadin-form-layout": "^2.2.0", | ||
"@vaadin/vaadin-text-field": "^2.6.0", | ||
"@vaadin/vaadin-button": "^2.3.0", | ||
"@vaadin/vaadin-confirm-dialog": "^1.2.0", | ||
"@vaadin/vaadin-dialog": "^2.5.0-alpha1", | ||
"@vaadin/vaadin-grid": "^5.7.0-alpha2", | ||
"@vaadin/vaadin-form-layout": "^2.3.0-alpha1", | ||
"@vaadin/vaadin-text-field": "^2.7.0-alpha1", | ||
"@vaadin/vaadin-button": "^2.4.0-alpha1", | ||
"@vaadin/vaadin-confirm-dialog": "^1.3.0-alpha1", | ||
"@vaadin/vaadin-license-checker": "^2.1.0" | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"devDependencies": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"devDependencies": { | ||
"@polymer/iron-component-page": "^4.0.0", | ||
@@ -57,5 +59,5 @@ "@webcomponents/webcomponentsjs": "^2.0.0", | ||
"@vaadin/vaadin-demo-helpers": "^3.1.0", | ||
"@vaadin/vaadin-combo-box": "^v5.1.0", | ||
"@vaadin/vaadin-notification": "v1.5.0" | ||
"@vaadin/vaadin-combo-box": "^5.3.0-alpha1", | ||
"@vaadin/vaadin-notification": "^1.6.0-alpha1" | ||
} | ||
} |
@@ -19,2 +19,5 @@ /** | ||
* a `<vaadin-crud>` to enable editing. | ||
* | ||
* @extends PolymerElement | ||
* @mixes ThemableMixin | ||
*/ | ||
@@ -36,3 +39,3 @@ class CrudEditElement extends ThemableMixin(PolymerElement) { | ||
/** @private */ | ||
/** @protected */ | ||
ready() { | ||
@@ -45,2 +48,3 @@ super.ready(); | ||
/** @private */ | ||
__onClick(e) { | ||
@@ -60,3 +64,8 @@ const tr = e.target.parentElement.assignedSlot.parentElement.parentElement; | ||
} | ||
window.customElements.define(CrudEditElement.is, CrudEditElement); | ||
export { CrudEditColumnElement }; | ||
customElements.define(CrudEditColumnElement.is, CrudEditColumnElement); | ||
/** | ||
@@ -77,5 +86,5 @@ * `<vaadin-crud-edit-column>` is a helper element for the `<vaadin-grid>` | ||
* | ||
* @extends PolymerElement | ||
* @extends GridColumnElement | ||
*/ | ||
class CrudEditColumnElement extends (class extends GridColumnElement {}) { | ||
class CrudEditColumnElement extends GridColumnElement { | ||
static get template() { | ||
@@ -133,5 +142,1 @@ return html` | ||
} | ||
customElements.define(CrudEditColumnElement.is, CrudEditColumnElement); | ||
export { CrudEditColumnElement }; |
@@ -19,6 +19,6 @@ /** | ||
* | ||
* @extends PolymerElement | ||
* @mixes Crud.IncludedMixin | ||
* @extends FormLayoutElement | ||
* @mixes IncludedMixin | ||
*/ | ||
class CrudFormElement extends IncludedMixin(class extends FormLayoutElement {}) { | ||
class CrudFormElement extends IncludedMixin(FormLayoutElement) { | ||
static get is() { | ||
@@ -32,2 +32,3 @@ return 'vaadin-crud-form'; | ||
* The item being edited. | ||
* @type {CrudItem | undefined} | ||
*/ | ||
@@ -46,2 +47,4 @@ item: Object | ||
* If not called, the method will be executed the first time an item is assigned. | ||
* @param {!CrudItem} object | ||
* @protected | ||
*/ | ||
@@ -55,2 +58,3 @@ _configure(object) { | ||
/** @private */ | ||
__onItemChange(item) { | ||
@@ -62,2 +66,3 @@ if (!this._fields) { | ||
/** @private */ | ||
__createField(parent, path, type) { | ||
@@ -73,2 +78,3 @@ const field = document.createElement('vaadin-text-field'); | ||
/** @private */ | ||
__createFields(parent, object, path) { | ||
@@ -91,2 +97,3 @@ Object.keys(object).forEach(prop => { | ||
/** @private */ | ||
__capitalize(path) { | ||
@@ -96,2 +103,3 @@ return path.toLowerCase().replace(/([^\w]+)/g, ' ').trim().replace(/^./, c => c.toUpperCase()); | ||
/** @private */ | ||
__set(path, val, obj) { | ||
@@ -98,0 +106,0 @@ if (obj && path) { |
@@ -23,6 +23,6 @@ /** | ||
* | ||
* @extends PolymerElement | ||
* @mixes Crud.IncludedMixin | ||
* @extends GridElement | ||
* @mixes IncludedMixin | ||
*/ | ||
class CrudGridElement extends IncludedMixin(class extends GridElement {}) { | ||
class CrudGridElement extends IncludedMixin(GridElement) { | ||
static get is() { | ||
@@ -38,2 +38,3 @@ return 'vaadin-crud-grid'; | ||
noFilter: Boolean, | ||
/** | ||
@@ -43,2 +44,3 @@ * Disable sorting in the generated columns. | ||
noSort: Boolean, | ||
/** | ||
@@ -48,2 +50,4 @@ * Do not add headers to columns. | ||
noHead: Boolean, | ||
/** @private */ | ||
__hideEditColumn: Boolean | ||
@@ -60,2 +64,3 @@ }; | ||
/** @private */ | ||
__onItemsChange(items) { | ||
@@ -67,2 +72,3 @@ if ((!this.dataProvider || this.dataProvider == this._arrayDataProvider) && !this.include && items && items[0]) { | ||
/** @private */ | ||
__onHideEditColumnChange(hideEditColumn) { | ||
@@ -74,2 +80,3 @@ if (this.firstChild) { | ||
/** @private */ | ||
__toggleEditColumn() { | ||
@@ -84,2 +91,3 @@ const el = this.querySelector('vaadin-crud-edit-column'); | ||
/** @private */ | ||
__dataProviderWrapper(params, callback) { | ||
@@ -113,2 +121,3 @@ this.__dataProvider(params, (items, size) => { | ||
* Method will be executed when items or dataProvider is assigned. | ||
* @private | ||
*/ | ||
@@ -121,2 +130,3 @@ _configure(item) { | ||
/** @private */ | ||
__createColumn(parent, path) { | ||
@@ -169,2 +179,3 @@ const col = document.createElement('vaadin-grid-column'); | ||
/** @private */ | ||
__createColumns(parent, object, path) { | ||
@@ -189,2 +200,3 @@ if (typeof object === 'object') { | ||
/** @private */ | ||
__createGroup(parent, path, object) { | ||
@@ -197,2 +209,3 @@ const grp = document.createElement('vaadin-grid-column-group'); | ||
/** @private */ | ||
__capitalize(path) { | ||
@@ -202,2 +215,3 @@ return path.toLowerCase().replace(/([^\w]+)/g, ' ').trim().replace(/^./, c => c.toUpperCase()); | ||
/** @private */ | ||
__set(path, val, obj) { | ||
@@ -204,0 +218,0 @@ if (obj && path) { |
@@ -19,3 +19,3 @@ /** | ||
* | ||
* @type{String|RegExp} | ||
* @type {string | RegExp} | ||
*/ | ||
@@ -26,2 +26,3 @@ exclude: { | ||
}, | ||
/** | ||
@@ -32,3 +33,3 @@ * A list of item properties that should be mapped to form fields. | ||
* | ||
* @type{String|Array} | ||
* @type {string | !Array<string> | undefined} | ||
*/ | ||
@@ -41,2 +42,3 @@ include: { | ||
/** @private */ | ||
__onExcludeChange(exclude) { | ||
@@ -48,2 +50,3 @@ if (typeof exclude == 'string') { | ||
/** @private */ | ||
__onIncludeChange(include) { | ||
@@ -50,0 +53,0 @@ if (typeof include == 'string') { |
@@ -206,3 +206,3 @@ /** | ||
static get version() { | ||
return '1.2.1'; | ||
return '1.3.0-alpha1'; | ||
} | ||
@@ -212,3 +212,6 @@ | ||
return { | ||
/** A reference to the grid used for displaying the item list */ | ||
/** | ||
* A reference to the grid used for displaying the item list | ||
* @private | ||
*/ | ||
_grid: { | ||
@@ -218,3 +221,7 @@ type: HTMLElement, | ||
}, | ||
/** A reference to the editor component which will be teleported to the dialog */ | ||
/** | ||
* A reference to the editor component which will be teleported to the dialog | ||
* @private | ||
*/ | ||
_form: { | ||
@@ -224,4 +231,6 @@ type: HTMLElement, | ||
}, | ||
/** | ||
* An array containing the items which will be stamped to the column template instances. | ||
* @type {Array<!CrudItem> | undefined} | ||
*/ | ||
@@ -233,4 +242,6 @@ items: { | ||
}, | ||
/** | ||
* The item being edited in the dialog. | ||
* @type {CrudItem | undefined} | ||
*/ | ||
@@ -241,2 +252,3 @@ editedItem: { | ||
}, | ||
/** | ||
@@ -249,3 +261,4 @@ * Sets how editor will be presented on desktop screen. | ||
* - `aside` - form will open on the grid side (_right_, if lft and _left_ if rtl) | ||
*/ | ||
* @type {!CrudEditorPosition} | ||
*/ | ||
editorPosition: { | ||
@@ -257,5 +270,7 @@ type: String, | ||
}, | ||
/** | ||
* Enables user to click on row to edit it. | ||
* Note: When enabled, autogenerated grid won't show the edit column. | ||
* @type {boolean} | ||
*/ | ||
@@ -266,2 +281,3 @@ editOnClick: { | ||
}, | ||
/** | ||
@@ -278,2 +294,3 @@ * Function that provides items lazily. Receives arguments `params`, `callback` | ||
* - `size` Total number of items | ||
* @type {CrudDataProvider | undefined} | ||
*/ | ||
@@ -284,10 +301,13 @@ dataProvider: { | ||
}, | ||
/** | ||
* Disable filtering when grid is autofonfigured. | ||
* Disable filtering when grid is autoconfigured. | ||
*/ | ||
noFilter: Boolean, | ||
/** | ||
* Disable sorting when grid is autofonfigured. | ||
* Disable sorting when grid is autoconfigured. | ||
*/ | ||
noSort: Boolean, | ||
/** | ||
@@ -297,2 +317,3 @@ * Remove grid headers when it is autoconfigured. | ||
noHead: Boolean, | ||
/** | ||
@@ -308,2 +329,3 @@ * A comma-separated list of fields to include in the generated grid and the generated editor. | ||
include: String, | ||
/** | ||
@@ -317,2 +339,3 @@ * A comma-separated list of fields to be excluded from the generated grid and the generated editor. | ||
exclude: String, | ||
/** | ||
@@ -326,2 +349,3 @@ * Reflects the opened status of the editor. | ||
}, | ||
/** | ||
@@ -336,2 +360,3 @@ * Number of items in the data set which is reported by the grid. | ||
}, | ||
/** | ||
@@ -371,3 +396,3 @@ * The object used to localize this component. | ||
* | ||
* @type {!CrudI18n} | ||
* @default {English/US} | ||
@@ -406,7 +431,15 @@ */ | ||
}, | ||
/** @private */ | ||
__isDirty: Boolean, | ||
/** @private */ | ||
__isNew: Boolean, | ||
/** @private */ | ||
__mobileMediaQuery: { | ||
value: '(max-width: 600px), (max-height: 600px)' | ||
}, | ||
/** @private */ | ||
__mobile: { | ||
@@ -426,5 +459,3 @@ type: Boolean, | ||
/** | ||
* @protected | ||
*/ | ||
/** @protected */ | ||
static _finalizeClass() { | ||
@@ -447,2 +478,3 @@ super._finalizeClass(); | ||
/** @protected */ | ||
ready() { | ||
@@ -458,2 +490,3 @@ super.ready(); | ||
/** @private */ | ||
__computeEditorHeader(isNew, newItem, editItem) { | ||
@@ -463,2 +496,3 @@ return isNew ? newItem : editItem; | ||
/** @private */ | ||
__onI18Change(i18n, grid) { | ||
@@ -475,2 +509,3 @@ if (grid) { | ||
/** @private */ | ||
__onEditorPositionChange(editorPosition, currentEditorPosition) { | ||
@@ -483,2 +518,3 @@ if (CrudElement._isValidEditorPosition(editorPosition)) { | ||
/** @private */ | ||
static _isValidEditorPosition(editorPosition) { | ||
@@ -488,2 +524,3 @@ return ['bottom', 'aside'].indexOf(editorPosition) != -1; | ||
/** @private */ | ||
__onOpenedChanged(opened, old) { | ||
@@ -499,2 +536,3 @@ if (!opened && old) { | ||
/** @private */ | ||
__mobileChanged() { | ||
@@ -504,2 +542,3 @@ this.__toggleToolbar(); | ||
/** @private */ | ||
__toggleToolbar() { | ||
@@ -512,2 +551,3 @@ // Hide toolbar to give more room for the editor when it's positioned below the grid | ||
/** @private */ | ||
__onDomChange(nodes) { | ||
@@ -528,2 +568,3 @@ nodes.forEach(node => { | ||
/** @private */ | ||
__onCrudGridEdit(e) { | ||
@@ -534,2 +575,3 @@ e.stopPropagation(); | ||
/** @private */ | ||
__onFormChanges(e) { | ||
@@ -539,2 +581,3 @@ this.__isDirty = true; | ||
/** @private */ | ||
__onGridSizeChanges(e) { | ||
@@ -544,2 +587,3 @@ this._setSize(this._grid.size); | ||
/** @private */ | ||
__onGridChange(grid, old) { | ||
@@ -561,2 +605,3 @@ if (old) { | ||
/** @private */ | ||
__onFormChange(form, old) { | ||
@@ -585,2 +630,3 @@ if (old && old.parentElement) { | ||
/** @private */ | ||
__onDataProviderChange(dataProvider) { | ||
@@ -592,2 +638,3 @@ if (this._grid) { | ||
/** @private */ | ||
__onEditOnClickChange(rowToEditChange, _grid) { | ||
@@ -605,2 +652,3 @@ if (!_grid) { | ||
/** @private */ | ||
__editOnClickListener(event) { | ||
@@ -619,2 +667,3 @@ const item = event.detail.value; | ||
/** @private */ | ||
__confirmBeforeChangingEditedItem(item, keepOpened) { | ||
@@ -644,2 +693,3 @@ if ( | ||
/** @private */ | ||
__clearItemAndKeepEditorOpened(item, keepOpened) { | ||
@@ -654,2 +704,3 @@ if (!item) { | ||
/** @private */ | ||
__createDataProviderProxy(dataProvider) { | ||
@@ -669,2 +720,3 @@ return (params, callback) => { | ||
/** @private */ | ||
__onItemsChange(items) { | ||
@@ -680,2 +732,3 @@ if (this.items && this.items[0]) { | ||
/** @private */ | ||
__onItemChange(item, old) { | ||
@@ -707,3 +760,7 @@ if (!this._form) { | ||
/** A reference to all fields inside the [`_form`](#/elements/vaadin-crud#property-_form) element */ | ||
/** | ||
* A reference to all fields inside the [`_form`](#/elements/vaadin-crud#property-_form) element | ||
* @return {!Array<!HTMLElement>} | ||
* @protected | ||
*/ | ||
get _fields() { | ||
@@ -716,2 +773,3 @@ if (!this.__fields || !this.__fields.length) { | ||
/** @private */ | ||
__validate() { | ||
@@ -721,2 +779,3 @@ return this._fields.every(e => (e.validate || e.checkValidity).call(e)); | ||
/** @private */ | ||
__setHighlightedItem(item) { | ||
@@ -728,2 +787,3 @@ if (this._grid === this.$.grid) { | ||
/** @private */ | ||
__closeEditor() { | ||
@@ -738,2 +798,3 @@ this.editorOpened = false; | ||
/** @private */ | ||
__new(event) { | ||
@@ -746,2 +807,3 @@ // This allows listening to parent element and fire only when clicking on default or custom new-button. | ||
/** @private */ | ||
__edit(item) { | ||
@@ -755,2 +817,3 @@ if (this.editedItem === item) { | ||
/** @private */ | ||
__openEditor(type, item) { | ||
@@ -767,2 +830,3 @@ this.__isDirty = false; | ||
/** @private */ | ||
__save() { | ||
@@ -794,2 +858,3 @@ if (!this.__validate()) { | ||
/** @private */ | ||
__cancel() { | ||
@@ -803,2 +868,3 @@ if (this.__isDirty) { | ||
/** @private */ | ||
__confirmCancel() { | ||
@@ -811,2 +877,3 @@ const evt = this.dispatchEvent(new CustomEvent('cancel', {detail: {item: this.editedItem}, cancelable: true})); | ||
/** @private */ | ||
__delete() { | ||
@@ -816,2 +883,3 @@ this.$.confirmDelete.opened = true; | ||
/** @private */ | ||
__confirmDelete() { | ||
@@ -828,3 +896,6 @@ const evt = this.dispatchEvent(new CustomEvent('delete', {detail: {item: this.editedItem}, cancelable: true})); | ||
// Utility method for setting nested values in JSON objects but initializing empty keys unless `Polymer.Base.set` | ||
/** | ||
* Utility method for setting nested values in JSON objects but initializing empty keys unless `Polymer.Base.set` | ||
* @private | ||
*/ | ||
__set(path, val, obj) { | ||
@@ -845,2 +916,3 @@ if (obj && path) { | ||
*/ | ||
/** | ||
@@ -851,2 +923,3 @@ * Fired when user wants to create a new item. | ||
*/ | ||
/** | ||
@@ -859,2 +932,3 @@ * Fired when user wants to delete item. If the default is prevented, then | ||
*/ | ||
/** | ||
@@ -868,2 +942,3 @@ * Fired when user discards edition. If the default is prevented, then | ||
*/ | ||
/** | ||
@@ -870,0 +945,0 @@ * Fired when user wants to save a new or an existing item. If the default is prevented, then |
import './theme/lumo/vaadin-crud.js'; | ||
export * from './src/vaadin-crud.js'; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
94738
22
2218
1