@licklist/design 0.44.550-dev.3 → 0.44.550-dev.4

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;CAmBpB,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;CA2BpB,CAAC"}
@@ -1 +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]}};
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,n=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)},u=function(t,r){var e=0,o=0;return t.forEach((function(t){var n;return Object.values(null!==(n=r.productCategorySummary[t])&&void 0!==n?n:{}).forEach((function(t){var r,n=t.totalPerCategory,u=t.productsSummary;o+=n||0,e+=null!==(r=null==u?void 0:u.reduce((function(t,r){return t+r.productsSold}),0))&&void 0!==r?r:0}))})),[e,o]};exports.EVENT_DESCRIPTION_SIZE=o,exports.calculateTotalSoldAndAmount=u,exports.calculateTotalViews=n,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(" "),n=String(t).indexOf(e[e.length-2]);return t.slice(0,n).concat("...")},exports.getStatisticInfo=function(o,a){var i,l;if(!o)return{totalViews:0,totalSold:0,totalAmount:0};var c=e.DateTime.fromISO(a).toUTC().toFormat(r.DATE_FORMAT),s=e.DateTime.fromISO(a).toUTC().toFormat(r.DATE_FORMAT),d=null!==(l=null===(i=Object.keys(null==o?void 0:o.productCategorySummary))||void 0===i?void 0:i.filter((function(t){return e.DateTime.fromFormat(t,r.DATE_TIME_FULL_FORMAT).toFormat(r.DATE_FORMAT)===s})))&&void 0!==l?l:[],f=n([c],o),m=t.__read(u(d,o),2);return{totalViews:f,totalSold:m[0],totalAmount:m[1]}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.550-dev.3",
3
+ "version": "0.44.550-dev.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -103,11 +103,19 @@ export const getStatisticInfo = (
103
103
  .toFormat(DATE_FORMAT);
104
104
  const summaryFormattedDate = DateTime.fromISO(date)
105
105
  .toUTC()
106
- .toFormat(DATE_TIME_FULL_FORMAT);
106
+ .toFormat(DATE_FORMAT);
107
+
108
+ const summaryDays =
109
+ Object.keys(eventStatistic?.productCategorySummary)?.filter(
110
+ (date) =>
111
+ DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
112
+ DATE_FORMAT
113
+ ) === summaryFormattedDate
114
+ ) ?? [];
107
115
 
108
116
  const totalViews = calculateTotalViews([viewsFormattedDate], eventStatistic);
109
117
  const [totalSold, totalAmount] = calculateTotalSoldAndAmount(
110
- [summaryFormattedDate],
118
+ summaryDays,
111
119
  eventStatistic
112
120
  );
113
121