@nuskin/product-components 3.1.2 → 3.1.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.1.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.2...v3.1.3) (2022-06-07)
2
+
3
+
4
+ ### Fix
5
+
6
+ * several fixes/tweaks to get product cards to work for the exclusive offer app (#CX15-5006) ([ef742b2](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/ef742b25147e030740f2bedfe456b36af881c8bd)), closes [#CX15-5006](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-5006)
7
+
1
8
  ## [3.1.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.1...v3.1.2) (2022-05-19)
2
9
 
3
10
 
@@ -29,6 +29,7 @@
29
29
  :max-price="maxPrice"
30
30
  :mobile-side-by-side="mobileSideBySide"
31
31
  :no-action="noAction"
32
+ :show-action="showAction"
32
33
  :original-price="originalPrice"
33
34
  :original-price-label="originalPriceLabel"
34
35
  :original-price-type="originalPriceType"
@@ -58,7 +59,9 @@
58
59
  @add-to-adr="handleAddToAdr"
59
60
  @card-click="handleCardClick"
60
61
  @favorite-click="handleFavoriteClick"
61
- />
62
+ >
63
+ <slot />
64
+ </NsProductCardBase>
62
65
  </template>
63
66
 
64
67
  <script>
@@ -114,7 +117,11 @@ export default {
114
117
  /**
115
118
  * Won't show the Action area on hover
116
119
  */
117
- noAction: Boolean
120
+ noAction: Boolean,
121
+ /**
122
+ * Force the Action area to always show
123
+ */
124
+ showAction: Boolean
118
125
  },
119
126
  data() {
120
127
  return {
@@ -15,6 +15,7 @@
15
15
  @mouseleave="closeAction"
16
16
  @click="handleCardClick"
17
17
  >
18
+ <slot />
18
19
  <!-- EXCLUSIVE OFFER ICON & LABEL -->
19
20
  <div v-if="isExclusive && !hideExclusiveIcon" :class="$style.exclusive">
20
21
  <NsIcon
@@ -403,7 +404,7 @@ export default {
403
404
  );
404
405
  },
405
406
  showSkuPrices() {
406
- return !this.isBaseSku && !this.noAction;
407
+ return !this.isBaseSku && (!this.noAction || this.forcesv);
407
408
  },
408
409
  showExclusiveOfferLabel() {
409
410
  return !(this.hideExclusiveTextOnMobile || this.useMobileSideBySide);
package/index.js CHANGED
@@ -33,6 +33,7 @@ import NsProductList from "./components/NsProductList.vue";
33
33
  import NsProductListSortable from "./components/NsProductListSortable.vue";
34
34
  import NsProductLine from "./components/NsProductLine.vue";
35
35
  import NsProductOffer from "./components/NsProductOffer.vue";
36
+ import NsProductQuantitySelector from "./components/NsProductQuantitySelector";
36
37
 
37
38
  export {
38
39
  // Services
@@ -52,5 +53,6 @@ export {
52
53
  NsProductList,
53
54
  NsProductListSortable,
54
55
  NsProductLine,
55
- NsProductOffer
56
+ NsProductOffer,
57
+ NsProductQuantitySelector
56
58
  };
@@ -258,8 +258,10 @@ const NsProductMixin = {
258
258
  return !this.hideVariantSelector && (this.isBaseSku || this.isVariantSku);
259
259
  },
260
260
  showExclusiveOfferMessage() {
261
- return (
262
- this.isExclusive && !this.userIsQualified && this.exclusiveOfferMessage
261
+ return !!(
262
+ this.isExclusive &&
263
+ !this.userIsQualified &&
264
+ this.exclusiveOfferMessage
263
265
  );
264
266
  },
265
267
  showOriginalCrossedOut() {
@@ -584,6 +586,52 @@ const NsProductMixin = {
584
586
  return;
585
587
  }
586
588
 
589
+ if (this.product.status === ProductStatus.ReleasedForSale) {
590
+ if (this.maxQuantity > 0) {
591
+ this.enable();
592
+ this.statusMessageKey = "releasedForSale";
593
+
594
+ if (
595
+ this.product.backOrderDate &&
596
+ this.localTranslations.backOrderedWithDate
597
+ ) {
598
+ this.statusMessage = this.localTranslations.backOrderedWithDate.replace(
599
+ "%date%",
600
+ dateFormatter.getCountryFormattedDate(
601
+ this.product.backOrderDate,
602
+ this.locale
603
+ )
604
+ );
605
+ this.statusMessageKey = "backOrderedWithDate";
606
+ }
607
+ } else {
608
+ this.disable();
609
+
610
+ if (!this.isExclusive) {
611
+ if (this.product.availableQuantity > 0) {
612
+ this.statusMessage = this.localTranslations.reachedPurchaseLimit;
613
+ this.statusMessageKey = "reachedPurchaseLimit";
614
+ } else {
615
+ this.statusMessage = this.localTranslations.outOfStock;
616
+ this.statusMessageKey = "outOfStock";
617
+ }
618
+ }
619
+ }
620
+ } else {
621
+ this.disable();
622
+
623
+ if (this.product.status === ProductStatus.Discontinued) {
624
+ this.statusMessage = this.localTranslations.discontinued;
625
+ this.statusMessageKey = "discontinued";
626
+ } else if (this.product.status === ProductStatus.NotReleasedForSale) {
627
+ this.statusMessage = this.localTranslations.notReleasedForSale;
628
+ this.statusMessageKey = "notReleasedForSale";
629
+ } else if (this.product.status === ProductStatus.StopStatus) {
630
+ this.statusMessage = this.localTranslations.stopStatus;
631
+ this.statusMessageKey = "stopStatus";
632
+ }
633
+ }
634
+
587
635
  this.exclusiveOfferMessage = "";
588
636
  if (this.isExclusive) {
589
637
  if (this.isLoggedIn) {
@@ -632,52 +680,6 @@ const NsProductMixin = {
632
680
  this.exclusiveOfferMessage = this.localTranslations.exclusiveOfferMessage;
633
681
  }
634
682
  }
635
-
636
- if (this.product.status === ProductStatus.ReleasedForSale) {
637
- if (this.maxQuantity > 0) {
638
- this.enable();
639
- this.statusMessageKey = "releasedForSale";
640
-
641
- if (
642
- this.product.backOrderDate &&
643
- this.localTranslations.backOrderedWithDate
644
- ) {
645
- this.statusMessage = this.localTranslations.backOrderedWithDate.replace(
646
- "%date%",
647
- dateFormatter.getCountryFormattedDate(
648
- this.product.backOrderDate,
649
- this.locale
650
- )
651
- );
652
- this.statusMessageKey = "backOrderedWithDate";
653
- }
654
- } else {
655
- this.disable();
656
-
657
- if (!this.isExclusive) {
658
- if (this.product.availableQuantity > 0) {
659
- this.statusMessage = this.localTranslations.reachedPurchaseLimit;
660
- this.statusMessageKey = "reachedPurchaseLimit";
661
- } else {
662
- this.statusMessage = this.localTranslations.outOfStock;
663
- this.statusMessageKey = "outOfStock";
664
- }
665
- }
666
- }
667
- } else {
668
- this.disable();
669
-
670
- if (this.product.status === ProductStatus.Discontinued) {
671
- this.statusMessage = this.localTranslations.discontinued;
672
- this.statusMessageKey = "discontinued";
673
- } else if (this.product.status === ProductStatus.NotReleasedForSale) {
674
- this.statusMessage = this.localTranslations.notReleasedForSale;
675
- this.statusMessageKey = "notReleasedForSale";
676
- } else if (this.product.status === ProductStatus.StopStatus) {
677
- this.statusMessage = this.localTranslations.stopStatus;
678
- this.statusMessageKey = "stopStatus";
679
- }
680
- }
681
683
  },
682
684
 
683
685
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {