@vaadin/vaadin-crud
Advanced tools
Comparing version 1.1.0-alpha5 to 1.1.0-beta1
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-crud", | ||
"version": "1.1.0-alpha5", | ||
"version": "1.1.0-beta1", | ||
"main": "vaadin-crud.js", | ||
@@ -16,0 +16,0 @@ "author": "Vaadin Ltd", |
@@ -179,3 +179,3 @@ /** | ||
<vaadin-dialog-layout theme\$="[[theme]]" id="dialog" no-close-on-outside-click="[[__isDirty]]" no-close-on-esc="[[__isDirty]]" opened="{{editorOpened}}" editor-position\$="{{editorPosition}}" mobile="[[__mobile]]" theme="crud"> | ||
<h3 slot="header">[[__editorHeader]]</h3> | ||
<h3 slot="header">[[__computeEditorHeader(__isNew, i18n.newItem, i18n.editItem)]]</h3> | ||
<div id="editor"> | ||
@@ -208,3 +208,3 @@ <slot name="form"> | ||
static get version() { | ||
return '1.1.0-alpha5'; | ||
return '1.1.0-beta1'; | ||
} | ||
@@ -394,3 +394,2 @@ | ||
__isNew: Boolean, | ||
__editorHeader: String, | ||
__mobileMediaQuery: { | ||
@@ -430,2 +429,6 @@ value: '(max-width: 600px), (max-height: 600px)' | ||
__computeEditorHeader(isNew, newItem, editItem) { | ||
return isNew ? newItem : editItem; | ||
} | ||
__onI18Change(i18n, grid) { | ||
@@ -457,3 +460,2 @@ if (grid) { | ||
} else { | ||
this.__editorHeader = this.__isNew ? this.i18n.newItem : this.i18n.editItem; | ||
this.__onFormChange(this._form); | ||
@@ -567,6 +569,5 @@ } | ||
} | ||
if (item) { | ||
this.__edit(item); | ||
} else { | ||
} else if (!this.__keepOpened) { | ||
this.__closeEditor(); | ||
@@ -576,3 +577,3 @@ } | ||
__confirmBeforeChangingEditedItem(item) { | ||
__confirmBeforeChangingEditedItem(item, keepOpened) { | ||
if ( | ||
@@ -586,4 +587,5 @@ this.editorOpened && // Editor opened | ||
event.preventDefault(); // prevent editor to get closed | ||
if (item) { | ||
if (item || keepOpened) { | ||
this.__edit(item); | ||
this.__clearItemAndKeepEditorOpened(item, keepOpened); | ||
} else { | ||
@@ -597,5 +599,15 @@ this.__closeEditor(); | ||
this.__edit(item); | ||
this.__clearItemAndKeepEditorOpened(item, keepOpened); | ||
} | ||
} | ||
__clearItemAndKeepEditorOpened(item, keepOpened) { | ||
if (!item) { | ||
setTimeout(() => { | ||
this.__keepOpened = keepOpened; | ||
this.editedItem = this._grid.activeItem = undefined; | ||
}); | ||
} | ||
} | ||
__createDataProviderProxy(dataProvider) { | ||
@@ -646,3 +658,5 @@ return (params, callback) => { | ||
this.__isNew = this.__isNew || this.items && this.items.indexOf(item) < 0; | ||
this.editorOpened = !!item; | ||
if (item) { | ||
this.editorOpened = true; | ||
} | ||
} | ||
@@ -674,3 +688,3 @@ | ||
// Delay changing the item in order not to modify editor while closing | ||
setTimeout(() => this.editedItem = this._grid.activeItem = undefined); | ||
setTimeout(() => this.__clearItemAndKeepEditorOpened(null, false)); | ||
} | ||
@@ -681,3 +695,3 @@ | ||
if (event.composedPath().filter(e => e.nodeType == 1 && e.hasAttribute('new-button'))[0]) { | ||
this.__openEditor('new'); | ||
this.__confirmBeforeChangingEditedItem(null, true); | ||
} | ||
@@ -684,0 +698,0 @@ } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
76946
1662
1