@dile/crud 0.6.2 → 0.6.4

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.
@@ -70,6 +70,7 @@ export class DileAjaxForm extends DileI18nMixin(LitElement) {
70
70
  inline: { type: Boolean, reflect: true },
71
71
  actionIcon: { type: Object },
72
72
  cancelIcon: { type: Object },
73
+ disableClearAfterInsert: { type: Boolean },
73
74
  };
74
75
  }
75
76
 
@@ -140,12 +141,12 @@ export class DileAjaxForm extends DileI18nMixin(LitElement) {
140
141
  return html`
141
142
  <div class="actions">
142
143
  ${this.actionIcon
143
- ? html`<a href="#" @click=${this.doAction}><dile-icon .icon=${this.actionIcon} class="actionIcon"></dile-icon></a>`
144
- : html`<dile-button @click=${this.doAction}>${this.actionLabelComputed(this.actionLabel, this.translations, this.operation)}</dile-button>`
144
+ ? html`<a href="#" @click=${this.doActionHandler}><dile-icon .icon=${this.actionIcon} class="actionIcon"></dile-icon></a>`
145
+ : html`<dile-button @click=${this.doActionHandler}>${this.actionLabelComputed(this.actionLabel, this.translations, this.operation)}</dile-button>`
145
146
  }
146
147
  ${this.showCancelButton ?
147
148
  this.cancelIcon
148
- ? html`<a href="#" @click=${this.doCancel}><dile-icon @click=${this.doAction} .icon=${this.cancelIcon} class="cancelIcon"></dile-icon></a>`
149
+ ? html`<a href="#" @click=${this.doCancel}><dile-icon @click=${this.doActionHandler} .icon=${this.cancelIcon} class="cancelIcon"></dile-icon></a>`
149
150
  : html`<dile-button class="cancel_button" @click=${this.doCancel}>${this.cancelLabelComputed(this.cancelLabel, this.translations)}</dile-button>`
150
151
  : ''
151
152
  }
@@ -185,8 +186,12 @@ export class DileAjaxForm extends DileI18nMixin(LitElement) {
185
186
  })
186
187
  }
187
188
 
188
- doAction(e) {
189
+ doActionHandler(e) {
189
190
  e.preventDefault();
191
+ this.doAction();
192
+ }
193
+
194
+ doAction() {
190
195
  this.feedback.clear();
191
196
  this.ajaxsave.data = this.form.getData();
192
197
  this.ajaxsave.generateRequest();
@@ -244,7 +249,7 @@ export class DileAjaxForm extends DileI18nMixin(LitElement) {
244
249
  let data = this.responseAdapter.getData();
245
250
  let msg = this._customSuccessMessage();
246
251
  this.feedback.positiveFeedbackWithDelay(msg, 5000);
247
- if(this.operation == 'insert') {
252
+ if(this.operation == 'insert' && !this.disableClearAfterInsert) {
248
253
  this.clearForm();
249
254
  }
250
255
  this.dispatchEvent(new CustomEvent('save-success', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "d94902b30818bfc992fad827660631d31a6eaa39"
34
+ "gitHead": "7678b4a06e0e73fda2c43ca034f4c7f223e5f1cf"
35
35
  }