@3mo/standard-dialogs
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -17,4 +17,4 @@ import { __decorate } from "tslib"; | ||
heading=${heading} | ||
primaryButtonText=${primaryButtonText !== null && primaryButtonText !== void 0 ? primaryButtonText : t('OK')} | ||
secondaryButtonText=${secondaryButtonText !== null && secondaryButtonText !== void 0 ? secondaryButtonText : t('Cancel')} | ||
primaryButtonText=${primaryButtonText ?? t('OK')} | ||
secondaryButtonText=${secondaryButtonText ?? t('Cancel')} | ||
?blocking=${blocking} | ||
@@ -21,0 +21,0 @@ size=${ifDefined(size)} |
@@ -11,3 +11,3 @@ import { __decorate } from "tslib"; | ||
heading=${heading} | ||
primaryButtonText=${primaryButtonText !== null && primaryButtonText !== void 0 ? primaryButtonText : t('OK')} | ||
primaryButtonText=${primaryButtonText ?? t('OK')} | ||
?blocking=${blocking} | ||
@@ -14,0 +14,0 @@ size=${ifDefined(size)} |
@@ -13,9 +13,8 @@ var DialogDeletion_1; | ||
super(...arguments); | ||
this.primaryAction = () => { var _a, _b, _c; return (_c = (_b = (_a = this.parameters).deletionAction) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : Promise.resolve(); }; | ||
this.primaryAction = () => this.parameters.deletionAction?.() ?? Promise.resolve(); | ||
} | ||
async confirm() { | ||
var _a, _b; | ||
if (DialogDeletion_1.deletionConfirmation.value === false) { | ||
try { | ||
await ((_b = (_a = this.parameters).deletionAction) === null || _b === void 0 ? void 0 : _b.call(_a)); | ||
await this.parameters.deletionAction?.(); | ||
return; | ||
@@ -22,0 +21,0 @@ } |
@@ -20,5 +20,4 @@ import { __decorate } from "tslib"; | ||
constructor() { | ||
var _a; | ||
super(...arguments); | ||
this.value = (_a = this.parameters.value) !== null && _a !== void 0 ? _a : ''; | ||
this.value = this.parameters.value ?? ''; | ||
this.primaryAction = () => this.value; | ||
@@ -31,3 +30,3 @@ } | ||
heading=${heading} | ||
primaryButtonText=${primaryButtonText !== null && primaryButtonText !== void 0 ? primaryButtonText : t('Apply')} | ||
primaryButtonText=${primaryButtonText ?? t('Apply')} | ||
?blocking=${blocking} | ||
@@ -45,6 +44,5 @@ size=${ifDefined(size)} | ||
get textFieldTemplate() { | ||
var _a, _b; | ||
return this.parameters.isTextArea ? html ` | ||
<mo-field-text-area id='inputElement' data-focus | ||
label=${(_a = this.parameters.inputLabel) !== null && _a !== void 0 ? _a : t('Input')} | ||
<mo-field-text-area id='inputElement' autofocus | ||
label=${this.parameters.inputLabel ?? t('Input')} | ||
value=${this.value} | ||
@@ -54,4 +52,4 @@ @input=${(e) => this.value = e.detail} | ||
` : html ` | ||
<mo-field-text id='inputElement' data-focus | ||
label=${(_b = this.parameters.inputLabel) !== null && _b !== void 0 ? _b : t('Input')} | ||
<mo-field-text id='inputElement' autofocus | ||
label=${this.parameters.inputLabel ?? t('Input')} | ||
value=${this.value} | ||
@@ -58,0 +56,0 @@ @input=${(e) => this.value = e.detail} |
@@ -12,4 +12,4 @@ import { __decorate } from "tslib"; | ||
size=${ifDefined(size)} | ||
primaryButtonText=${primaryButtonText !== null && primaryButtonText !== void 0 ? primaryButtonText : t('OK')} | ||
secondaryButtonText=${secondaryButtonText !== null && secondaryButtonText !== void 0 ? secondaryButtonText : t('Cancel')} | ||
primaryButtonText=${primaryButtonText ?? t('OK')} | ||
secondaryButtonText=${secondaryButtonText ?? t('Cancel')} | ||
?blocking=${blocking} | ||
@@ -16,0 +16,0 @@ primaryOnEnter |
{ | ||
"name": "@3mo/standard-dialogs", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A package containing standard dialogs for web applications.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
115357
279