ywana-core8 0.0.763 → 0.0.764

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.umd.js CHANGED
@@ -1493,7 +1493,6 @@
1493
1493
  function clear() {
1494
1494
  if (onChange) onChange(id, "");
1495
1495
  }
1496
-
1497
1496
  var labelStyle = label ? "" : "no-label";
1498
1497
  var style = "textarea " + labelStyle + " textarea-" + type;
1499
1498
  var labelTxt = /*#__PURE__*/React__default["default"].createElement(Text, null, label);
@@ -2166,6 +2165,20 @@
2166
2165
  format = _ref7.format,
2167
2166
  maxDecimals = _ref7.maxDecimals;
2168
2167
 
2168
+ function formatNumber(number) {
2169
+ if (number === null) return "null";
2170
+ var result = number.toLocaleString('es-ES', {
2171
+ minimumFractionDigits: 2,
2172
+ maximumFractionDigits: 2
2173
+ }); // thousands separator is a dot
2174
+
2175
+ var parts = result.toString().split(",");
2176
+ var numberPart = parts[0];
2177
+ var decimalPart = parts[1];
2178
+ var thousands = /\B(?=(\d{3})+(?!\d))/g;
2179
+ return numberPart.replace(thousands, ".") + (decimalPart ? "," + decimalPart : "");
2180
+ }
2181
+
2169
2182
  if (format) {
2170
2183
  switch (format) {
2171
2184
  case FORMATS$1.CURRENCY:
@@ -2180,17 +2193,22 @@
2180
2193
  minimumFractionDigits: 2
2181
2194
  }));
2182
2195
 
2196
+ case "ES_es":
2197
+ var decimals = maxDecimals ? maxDecimals : 2;
2198
+ if (typeof value === "string") value = parseFloat(value);
2199
+ return value && !isNaN(value) ? /*#__PURE__*/React__default["default"].createElement("span", null, formatNumber(value.toFixed(decimals))) : "";
2200
+
2183
2201
  default:
2184
2202
  return /*#__PURE__*/React__default["default"].createElement("span", null, value);
2185
2203
  }
2186
2204
  } else {
2187
- var decimals = maxDecimals ? maxDecimals : 2;
2205
+ var _decimals = maxDecimals ? maxDecimals : 2;
2188
2206
 
2189
2207
  if (typeof value === "string") {
2190
2208
  value = parseFloat(value);
2191
2209
  }
2192
2210
 
2193
- return value && !isNaN(value) ? /*#__PURE__*/React__default["default"].createElement("span", null, value.toFixed(decimals)) : "";
2211
+ return value && !isNaN(value) ? /*#__PURE__*/React__default["default"].createElement("span", null, value.toFixed(_decimals)) : "";
2194
2212
  }
2195
2213
  };
2196
2214
  /**