@licklist/design 0.44.486-dev.75 → 0.44.486-dev.76

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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CAepC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACvB,MAAM,EAAE,kBACC,cAAc,KAC7B,MAUF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,UAC/B,MAAM,EAAE,kBACC,cAAc,KAC7B,CAAC,MAAM,EAAE,MAAM,CAejB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;gBAEA,MAAM;eACP,MAAM;iBACJ,MAAM;CAuBpB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CAepC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACvB,MAAM,EAAE,kBACC,cAAc,KAC7B,MAUF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,UAC/B,MAAM,EAAE,kBACC,cAAc,KAC7B,CAAC,MAAM,EAAE,MAAM,CAejB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;gBAEA,MAAM;eACP,MAAM;iBACJ,MAAM;CAmBpB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("@licklist/core/dist/Config"),e=require("luxon");var o=300,a=function(t,r){return t.reduce((function(t,e){var o;return t+Object.values(null!==(o=r.views[e])&&void 0!==o?o:{}).reduce((function(t,r){return t+(r.pageViews||0)}),0)}),0)},n=function(t,r){var e=0,o=0;return t.forEach((function(t){var a;return Object.values(null!==(a=r.productCategorySummary[t])&&void 0!==a?a:{}).forEach((function(t){var r,a=t.totalPerCategory,n=t.productsSummary;o+=a||0,e+=null!==(r=null==n?void 0:n.reduce((function(t,r){return t+r.productsSold}),0))&&void 0!==r?r:0}))})),[e,o]};exports.EVENT_DESCRIPTION_SIZE=o,exports.calculateTotalSoldAndAmount=n,exports.calculateTotalViews=a,exports.formatContent=function(t,r){return t?t.length>r?"".concat(t.slice(0,r),"..."):t:""},exports.formatContentWithoutTags=function(t,r){if(void 0===r&&(r=o),!t)return"";if(t<r)return t;var e=t.replace(/<[^>]*>/g,"").trim().replace(/&nbsp;|[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g," ").slice(0,r).split(" "),a=String(t).indexOf(e[e.length-2]);return t.slice(0,a).concat("...")},exports.getStatisticInfo=function(o,u){var i;if(!o)return{totalViews:0,totalSold:0,totalAmount:0};var l=e.DateTime.fromISO(u).toUTC().toFormat(r.DATE_FORMAT),c=e.DateTime.fromISO(u).toUTC().toFormat(r.DATE_TIME_FULL_FORMAT),s=Object.values(null!==(i=o.relativeDays)&&void 0!==i?i:{}),d=a(t.__spreadArray([],t.__read(new Set(t.__spreadArray([l],t.__read(s),!1))),!1),o),_=t.__read(n(t.__spreadArray([],t.__read(new Set(t.__spreadArray([c],t.__read(s),!1))),!1),o),2);return{totalViews:d,totalSold:_[0],totalAmount:_[1]}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=require("@licklist/core/dist/Config"),r=require("luxon");var o=300,n=function(t,e){return t.reduce((function(t,r){var o;return t+Object.values(null!==(o=e.views[r])&&void 0!==o?o:{}).reduce((function(t,e){return t+(e.pageViews||0)}),0)}),0)},u=function(t,e){var r=0,o=0;return t.forEach((function(t){var n;return Object.values(null!==(n=e.productCategorySummary[t])&&void 0!==n?n:{}).forEach((function(t){var e,n=t.totalPerCategory,u=t.productsSummary;o+=n||0,r+=null!==(e=null==u?void 0:u.reduce((function(t,e){return t+e.productsSold}),0))&&void 0!==e?e:0}))})),[r,o]};exports.EVENT_DESCRIPTION_SIZE=o,exports.calculateTotalSoldAndAmount=u,exports.calculateTotalViews=n,exports.formatContent=function(t,e){return t?t.length>e?"".concat(t.slice(0,e),"..."):t:""},exports.formatContentWithoutTags=function(t,e){if(void 0===e&&(e=o),!t)return"";if(t<e)return t;var r=t.replace(/<[^>]*>/g,"").trim().replace(/&nbsp;|[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g," ").slice(0,e).split(" "),n=String(t).indexOf(r[r.length-2]);return t.slice(0,n).concat("...")},exports.getStatisticInfo=function(o,a){if(!o)return{totalViews:0,totalSold:0,totalAmount:0};var i=r.DateTime.fromISO(a).toUTC().toFormat(e.DATE_FORMAT),l=r.DateTime.fromISO(a).toUTC().toFormat(e.DATE_TIME_FULL_FORMAT),c=n([i],o),s=t.__read(u([l],o),2);return{totalViews:c,totalSold:s[0],totalAmount:s[1]}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.75",
3
+ "version": "0.44.486-dev.76",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -104,14 +104,10 @@ export const getStatisticInfo = (
104
104
  const summaryFormattedDate = DateTime.fromISO(date)
105
105
  .toUTC()
106
106
  .toFormat(DATE_TIME_FULL_FORMAT);
107
- const relatedDays = Object.values(eventStatistic.relativeDays ?? {});
108
107
 
109
- const totalViews = calculateTotalViews(
110
- [...new Set([viewsFormattedDate, ...relatedDays])],
111
- eventStatistic
112
- );
108
+ const totalViews = calculateTotalViews([viewsFormattedDate], eventStatistic);
113
109
  const [totalSold, totalAmount] = calculateTotalSoldAndAmount(
114
- [...new Set([summaryFormattedDate, ...relatedDays])],
110
+ [summaryFormattedDate],
115
111
  eventStatistic
116
112
  );
117
113