jupiter-dynamic-forms 1.19.0 → 1.19.1

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/dist/index.mjs CHANGED
@@ -1749,7 +1749,7 @@ const field$1 = {
1749
1749
  enterDecimalValue: "Enter decimal value",
1750
1750
  enterNumberOfShares: "Enter number of shares",
1751
1751
  yearFormat: "YYYY",
1752
- enterPercentage: "Enter percentage",
1752
+ enterPercentage: "e.g. 0.25 for 25% or 0.2550 for 25.50%",
1753
1753
  emailPlaceholder: "email@example.com",
1754
1754
  urlPlaceholder: "https://example.com",
1755
1755
  phonePlaceholder: "+1 (555) 000-0000",
@@ -1924,7 +1924,7 @@ const field = {
1924
1924
  enterDecimalValue: "Voer decimale waarde in",
1925
1925
  enterNumberOfShares: "Voer aantal aandelen in",
1926
1926
  yearFormat: "JJJJ",
1927
- enterPercentage: "Voer percentage in",
1927
+ enterPercentage: "bijv. 0,25 voor 25% of 0,2550 voor 25,50%",
1928
1928
  emailPlaceholder: "email@voorbeeld.nl",
1929
1929
  urlPlaceholder: "https://voorbeeld.nl",
1930
1930
  phonePlaceholder: "+31 (0)20 123 4567",
@@ -3230,7 +3230,9 @@ let JupiterFormField = class extends LitElement {
3230
3230
  }));
3231
3231
  }
3232
3232
  _handleBlur() {
3233
+ let userTypedNewValue = false;
3233
3234
  if (this._isNumericField() && this._numericDraftValue !== null) {
3235
+ userTypedNewValue = true;
3234
3236
  const raw = this._numericDraftValue;
3235
3237
  if (raw === "" || this._isIntermediateNumericValue(raw)) {
3236
3238
  this.value = null;
@@ -3240,7 +3242,7 @@ let JupiterFormField = class extends LitElement {
3240
3242
  }
3241
3243
  this._numericDraftValue = null;
3242
3244
  }
3243
- if (this._isPercentItemType() && this.value !== null && this.value !== void 0) {
3245
+ if (this._isPercentItemType() && userTypedNewValue && this.value !== null && this.value !== void 0) {
3244
3246
  const numVal = Number(this.value);
3245
3247
  if (!isNaN(numVal) && Math.abs(numVal) > 1) {
3246
3248
  this.value = numVal / 100;