pb-sxp-ui 1.5.0 → 1.5.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/pb-ui.js CHANGED
@@ -9198,7 +9198,7 @@
9198
9198
  * @Author: binruan@chatlabs.com
9199
9199
  * @Date: 2024-03-20 14:56:16
9200
9200
  * @LastEditors: binruan@chatlabs.com
9201
- * @LastEditTime: 2024-09-12 15:50:11
9201
+ * @LastEditTime: 2024-09-13 15:06:44
9202
9202
  * @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
9203
9203
  *
9204
9204
  */
@@ -9231,7 +9231,7 @@
9231
9231
  let text = '';
9232
9232
  let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
9233
9233
  let currency = (product === null || product === void 0 ? void 0 : product.currency) ? (_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : '' : '$';
9234
- const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice || (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) !== 'none';
9234
+ const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice;
9235
9235
  let decPic = price.toString();
9236
9236
  if (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) {
9237
9237
  decPic = price === null || price === void 0 ? void 0 : price.toFixed(2);
@@ -9245,7 +9245,7 @@
9245
9245
  let startIndex = 0;
9246
9246
  let endIndex = decInd !== null && decInd !== void 0 ? decInd : text === null || text === void 0 ? void 0 : text.length;
9247
9247
  if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) === '.') {
9248
- text = text === null || text === void 0 ? void 0 : text.replace(/,/g, function (match, index) {
9248
+ text = text === null || text === void 0 ? void 0 : text.replace(/\,/g, function (match, index) {
9249
9249
  if (index >= startIndex && index < endIndex) {
9250
9250
  return '.';
9251
9251
  }
@@ -9261,8 +9261,16 @@
9261
9261
  else {
9262
9262
  text = `${(priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) ? price === null || price === void 0 ? void 0 : price.toFixed(2) : price}`;
9263
9263
  }
9264
- if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.decimalPoint) === ',' && decInd > 0 && decInd + 1 < (text === null || text === void 0 ? void 0 : text.length)) {
9265
- text = text.slice(0, decInd + 1) + ',' + text.slice(decInd + 2);
9264
+ if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.decimalPoint) === ',' && decInd > 0) {
9265
+ // text = text.slice(0, decInd) + ',' + text.slice(decInd + 1);
9266
+ text = text = text === null || text === void 0 ? void 0 : text.replace(/\./g, function (match, index) {
9267
+ if (index >= decInd && index < (text === null || text === void 0 ? void 0 : text.length)) {
9268
+ return ',';
9269
+ }
9270
+ else {
9271
+ return match;
9272
+ }
9273
+ });
9266
9274
  }
9267
9275
  if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
9268
9276
  text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;