@nuskin/product-components 3.1.2 → 3.1.5
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 +21 -0
- package/components/NsProductCard.vue +9 -2
- package/components/NsProductCardBase.vue +2 -1
- package/components/NsProductOffer.vue +5 -2
- package/index.js +3 -1
- package/mixins/NsProductMixin.js +50 -48
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [3.1.5](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.4...v3.1.5) (2022-06-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Fix
|
|
5
|
+
|
|
6
|
+
* Add full path to vue component ([22e30d6](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/22e30d697bcb0fc837f6981cc28fa7dc9f4caa6c))
|
|
7
|
+
|
|
8
|
+
## [3.1.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.3...v3.1.4) (2022-06-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Fix
|
|
12
|
+
|
|
13
|
+
* Update so that personal offer works with no active flag set (#CX12-5158) ([fc85155](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/fc851553e9af0a1c49758b54bc464095f97390a8)), closes [#CX12-5158](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX12-5158)
|
|
14
|
+
|
|
15
|
+
## [3.1.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.2...v3.1.3) (2022-06-07)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Fix
|
|
19
|
+
|
|
20
|
+
* 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)
|
|
21
|
+
|
|
1
22
|
## [3.1.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.1.1...v3.1.2) (2022-05-19)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -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);
|
|
@@ -264,7 +264,10 @@ export default {
|
|
|
264
264
|
return (this.offer || {}).pitchID || this.offerId || this.queryOfferId;
|
|
265
265
|
},
|
|
266
266
|
isPersonalOffer() {
|
|
267
|
-
return
|
|
267
|
+
return (
|
|
268
|
+
!!this.localOfferId &&
|
|
269
|
+
((this.offer || {}).active === undefined || !!(this.offer || {}).active)
|
|
270
|
+
);
|
|
268
271
|
},
|
|
269
272
|
disableAddAll() {
|
|
270
273
|
return this.offerLoading || this.totalProductQuantity === 0;
|
|
@@ -498,7 +501,7 @@ export default {
|
|
|
498
501
|
|
|
499
502
|
if (
|
|
500
503
|
!responseObject ||
|
|
501
|
-
|
|
504
|
+
responseObject.active === false ||
|
|
502
505
|
responseObject.isDeleted ||
|
|
503
506
|
(responseObject.expirationDate &&
|
|
504
507
|
new Date(responseObject.expirationDate).getTime() <=
|
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.vue";
|
|
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
|
};
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -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 &&
|
|
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
|
/**
|