pb-sxp-ui 1.7.7 → 1.7.9

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.
@@ -81,8 +81,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
81
81
  path = `${path}?${queryString}`;
82
82
  }
83
83
  if (options.type === 'beacon' && navigator.sendBeacon) {
84
+ const query = qs.stringify(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }));
85
+ if (query) {
86
+ path = (options === null || options === void 0 ? void 0 : options.query) ? `${path}&${query}` : `${path}?${query}`;
87
+ }
84
88
  return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
85
- JSON.stringify(Object.assign(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }), options.body))
89
+ JSON.stringify(Object.assign({}, options.body))
86
90
  ], { type: 'application/json;charset=UTF-8' }));
87
91
  }
88
92
  return window
@@ -232,7 +236,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
232
236
  try {
233
237
  let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
234
238
  if (replaceValue) {
235
- if (prop.indexOf('currency') &&
239
+ if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
236
240
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
237
241
  typeof replaceValue === 'string') {
238
242
  replaceValue = (_a = replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.split('-')) === null || _a === void 0 ? void 0 : _a[0];
@@ -84,8 +84,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
84
84
  path = `${path}?${queryString}`;
85
85
  }
86
86
  if (options.type === 'beacon' && navigator.sendBeacon) {
87
+ const query = qs_1.default.stringify(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }));
88
+ if (query) {
89
+ path = (options === null || options === void 0 ? void 0 : options.query) ? `${path}&${query}` : `${path}?${query}`;
90
+ }
87
91
  return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
88
- JSON.stringify(Object.assign(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }), options.body))
92
+ JSON.stringify(Object.assign({}, options.body))
89
93
  ], { type: 'application/json;charset=UTF-8' }));
90
94
  }
91
95
  return window
@@ -235,7 +239,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
235
239
  try {
236
240
  let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
237
241
  if (replaceValue) {
238
- if (prop.indexOf('currency') &&
242
+ if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
239
243
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
240
244
  typeof replaceValue === 'string') {
241
245
  replaceValue = (_a = replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.split('-')) === null || _a === void 0 ? void 0 : _a[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",