@alfresco/adf-core 8.4.0-19895101753 → 8.4.0-19926859239
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.
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -23059,7 +23059,17 @@ const ADF_AMOUNT_SETTINGS = new InjectionToken('adf-amount-settings');
|
|
|
23059
23059
|
class AmountWidgetComponent extends WidgetComponent {
|
|
23060
23060
|
static { this.DEFAULT_CURRENCY = '$'; }
|
|
23061
23061
|
get placeholder() {
|
|
23062
|
-
|
|
23062
|
+
if (!this.showPlaceholder)
|
|
23063
|
+
return '';
|
|
23064
|
+
if (!this.enableDisplayBasedOnLocale)
|
|
23065
|
+
return this.field.placeholder;
|
|
23066
|
+
if (this.checkIfEmptyStringOrOnlySpaces(this.field.placeholder))
|
|
23067
|
+
return this.field.placeholder;
|
|
23068
|
+
const stringConvertedToNumber = Number(this.field.placeholder);
|
|
23069
|
+
if (isNaN(stringConvertedToNumber)) {
|
|
23070
|
+
return this.field.placeholder;
|
|
23071
|
+
}
|
|
23072
|
+
return this.currencyPipe.transform(this.field.placeholder, this.currency, this.currencyDisplay, this.showDecimalDigits, this.locale);
|
|
23063
23073
|
}
|
|
23064
23074
|
constructor(formService, settings, currencyPipe, translationService) {
|
|
23065
23075
|
super(formService);
|
|
@@ -23121,6 +23131,10 @@ class AmountWidgetComponent extends WidgetComponent {
|
|
|
23121
23131
|
this.amountWidgetValue = hasValue ? this.valueAsNumber.toString() : null;
|
|
23122
23132
|
}
|
|
23123
23133
|
}
|
|
23134
|
+
checkIfEmptyStringOrOnlySpaces(placeholder) {
|
|
23135
|
+
const regexpOnlySpaces = /^\s*$/;
|
|
23136
|
+
return !placeholder || regexpOnlySpaces.test(placeholder);
|
|
23137
|
+
}
|
|
23124
23138
|
onFieldChangedAmountWidget() {
|
|
23125
23139
|
this.field.value = this.amountWidgetValue;
|
|
23126
23140
|
super.onFieldChanged(this.field);
|