@trafilea/afrodita-components 6.8.10 → 6.8.11

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/build/index.js CHANGED
@@ -18692,11 +18692,18 @@ var ClubRadioGroupInput = function (_a) {
18692
18692
  }) }), void 0));
18693
18693
  };
18694
18694
 
18695
- function formatDate(date) {
18695
+ function formatDate(date, format) {
18696
18696
  var day = date.getDate();
18697
18697
  var month = date.getMonth() + 1;
18698
18698
  var year = date.getFullYear();
18699
- return month < 10 ? "".concat(day, "/0").concat(month, "/").concat(year) : "".concat(day, "/").concat(month, "/").concat(year);
18699
+ switch (format !== null && format !== void 0 ? format : 'DDMMYY') {
18700
+ case 'DDMMYY':
18701
+ return "".concat(day < 10 ? "0".concat(day) : day, "/").concat(month < 10 ? "0".concat(month) : month, "/").concat(year);
18702
+ case 'MMDDYY':
18703
+ return "".concat(month < 10 ? "0".concat(month) : month, "/").concat(day < 10 ? "0".concat(day) : day, "/").concat(year);
18704
+ case 'YYMMDD':
18705
+ return "".concat(year, "/").concat(month < 10 ? "0".concat(month) : month, "/").concat(day < 10 ? "0".concat(day) : day);
18706
+ }
18700
18707
  }
18701
18708
 
18702
18709
  var Container$h = newStyled.div(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"], ["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"])));
@@ -18767,10 +18774,10 @@ var HelpfulText = newStyled.div(templateObject_17 || (templateObject_17 = __make
18767
18774
  var HelpfulTexti = newStyled.i(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n content: '\f164';\n"], ["\n content: '\\f164';\n"])));
18768
18775
  var ButtonSecondaryWrapper = newStyled(ButtonSecondary)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n margin-right: 15px;\n"], ["\n margin-right: 15px;\n"])));
18769
18776
  var Review = function (_a) {
18770
- var reviewId = _a.reviewId, reviewerName = _a.reviewerName, date = _a.date, rating = _a.rating, stars = _a.stars, title = _a.title, description = _a.description, images = _a.images, reviewVariant = _a.reviewVariant, onClickImage = _a.onClickImage, helpfulActionText = _a.helpfulActionText, helpfulAction = _a.helpfulAction, helpfulCount = _a.helpfulCount, _b = _a.hasTextWhenHelpfulCount0, hasTextWhenHelpfulCount0 = _b === void 0 ? false : _b;
18777
+ var reviewId = _a.reviewId, reviewerName = _a.reviewerName, date = _a.date, _b = _a.dateFormat, dateFormat = _b === void 0 ? 'DDMMYY' : _b, rating = _a.rating, stars = _a.stars, title = _a.title, description = _a.description, images = _a.images, reviewVariant = _a.reviewVariant, onClickImage = _a.onClickImage, helpfulActionText = _a.helpfulActionText, helpfulAction = _a.helpfulAction, helpfulCount = _a.helpfulCount, _c = _a.hasTextWhenHelpfulCount0, hasTextWhenHelpfulCount0 = _c === void 0 ? false : _c;
18771
18778
  var randomId = Math.random().toString(36).substring(7);
18772
- var _c = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _c[0], setShowMoreMobile = _c[1];
18773
- var _d = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _d[0], setShowMoreDesktop = _d[1];
18779
+ var _d = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _d[0], setShowMoreMobile = _d[1];
18780
+ var _e = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _e[0], setShowMoreDesktop = _e[1];
18774
18781
  React$2.useEffect(function () {
18775
18782
  var seeMoreElements = document.querySelectorAll("#see-more-".concat(randomId));
18776
18783
  var showAllDescription = function () {
@@ -18786,7 +18793,7 @@ var Review = function (_a) {
18786
18793
  });
18787
18794
  };
18788
18795
  }, [randomId]);
18789
- return (jsxRuntime.jsxs(Container$g, { children: [jsxRuntime.jsxs(Heading, { children: [jsxRuntime.jsx(ReviewerName, { children: reviewerName }, void 0), jsxRuntime.jsx(DateText, { children: formatDate(date) }, void 0)] }, void 0), jsxRuntime.jsx(StarList, { starsNumber: 5, rating: rating, fill: stars.color, size: stars.size }, void 0), jsxRuntime.jsxs(Content, __assign$1({ "data-testid": "review-content" }, { children: [jsxRuntime.jsxs(ReviewContainer, { children: [jsxRuntime.jsx(ReviewTitle, { children: title }, void 0), jsxRuntime.jsx(ReviewDescriptionMobile, { dangerouslySetInnerHTML: {
18796
+ return (jsxRuntime.jsxs(Container$g, { children: [jsxRuntime.jsxs(Heading, { children: [jsxRuntime.jsx(ReviewerName, { children: reviewerName }, void 0), jsxRuntime.jsx(DateText, { children: formatDate(date, dateFormat) }, void 0)] }, void 0), jsxRuntime.jsx(StarList, { starsNumber: 5, rating: rating, fill: stars.color, size: stars.size }, void 0), jsxRuntime.jsxs(Content, __assign$1({ "data-testid": "review-content" }, { children: [jsxRuntime.jsxs(ReviewContainer, { children: [jsxRuntime.jsx(ReviewTitle, { children: title }, void 0), jsxRuntime.jsx(ReviewDescriptionMobile, { dangerouslySetInnerHTML: {
18790
18797
  __html: showMoreMobile
18791
18798
  ? "".concat(description.slice(0, REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), "... <a id=\"see-more-").concat(randomId, "\" class=\"see-more\">See more</a>")
18792
18799
  : description,