@dile/crud
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -98,5 +98,2 @@ import { LitElement, html, css } from 'lit'; | ||
} | ||
if(!this.actionLabel) { | ||
this.actionLabel = capitalizeFirstLetter(this.operation); | ||
} | ||
} | ||
@@ -109,7 +106,13 @@ | ||
actionLabelComputed(label, translations, operation) { | ||
if(label) { | ||
return label; | ||
} | ||
if(! translations) { | ||
return operation == 'insert' ? 'Insert' : 'Update'; | ||
} | ||
if(operation == 'insert') { | ||
return label ? label : translations?.insert_label ? translations.insert_label : 'Insert'; | ||
return translations.insert_label; | ||
} | ||
if(operation == 'update') { | ||
return label ? label : translations?.update_label ? translations.update_label : 'Update'; | ||
return translations.update_label; | ||
} | ||
@@ -119,2 +122,9 @@ return translations.send_label; | ||
cancelLabelComputed(label, translations) { | ||
if(label) { | ||
return label; | ||
} | ||
return translations ? translations.cancel_label : 'Cancel'; | ||
} | ||
render() { | ||
@@ -142,3 +152,3 @@ return html` | ||
? html`<a href="#" @click=${this.doCancel}><dile-icon @click=${this.doAction} .icon=${this.cancelIcon} class="cancelIcon"></dile-icon></a>` | ||
: html`<dile-button class="cancel_button" @click=${this.doCancel}>${this.translations.cancel_label}</dile-button>` | ||
: html`<dile-button class="cancel_button" @click=${this.doCancel}>${this.cancelLabelComputed(this.cancelLabel, this.translations)}</dile-button>` | ||
: '' | ||
@@ -145,0 +155,0 @@ } |
@@ -40,3 +40,3 @@ import { LitElement, html, css } from 'lit'; | ||
sendDataAsFormData | ||
language="es" | ||
language="${this.language}" | ||
@save-success=${this.imageSaveSuccess} | ||
@@ -43,0 +43,0 @@ .responseAdapter=${this.responseAdapter} |
{ | ||
"name": "@dile/crud", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Components to create a generic crud system based on Web Components and Lit", | ||
@@ -34,3 +34,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "9514bd93f87c3237a41056fb6bb59025088f230e" | ||
"gitHead": "74907e7bdaa0bd1656d1db1b8b2845208aa91698" | ||
} |
128373
3890