@colijnit/product 258.1.5 → 258.1.6
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/app/components/image-carousel/image-carousel.component.d.ts +5 -0
- package/app/components/product-addtocart/product-addtocart.component.d.ts +5 -1
- package/app/components/product-page/product-page.component.d.ts +1 -0
- package/app/service/product-connector-adapter.service.d.ts +1 -0
- package/app/service/product-connector.service.d.ts +2 -0
- package/bundles/colijnit-product.umd.js +166 -67
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product-258.1.5.tgz +0 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/components/image-carousel/image-carousel.component.js +82 -36
- package/esm2015/app/components/product-addtocart/product-addtocart.component.js +38 -8
- package/esm2015/app/components/product-info-tabs/product-info-tabs.component.js +2 -2
- package/esm2015/app/components/product-page/product-page.component.js +19 -6
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-connector-adapter.service.js +9 -1
- package/esm2015/app/service/product-connector.service.js +5 -1
- package/fesm2015/colijnit-product.js +151 -51
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,9 @@ export declare class ImageCarouselComponent implements OnDestroy {
|
|
|
14
14
|
private _changeDetector;
|
|
15
15
|
private _domSanitizer;
|
|
16
16
|
carousel: ElementRef;
|
|
17
|
+
isPopupOpen: boolean;
|
|
18
|
+
selectedImage?: ImageViewModel;
|
|
19
|
+
onEsc(): void;
|
|
17
20
|
showRefresh: boolean;
|
|
18
21
|
set images(value: (CoDocument | string)[]);
|
|
19
22
|
get images(): (CoDocument | string)[];
|
|
@@ -36,8 +39,10 @@ export declare class ImageCarouselComponent implements OnDestroy {
|
|
|
36
39
|
handleThumbClick(index: number): void;
|
|
37
40
|
onForceRenderImage(): void;
|
|
38
41
|
handleShowImage(imageViewModel: ImageViewModel): void;
|
|
42
|
+
closePopup(): void;
|
|
39
43
|
private _filterValidImages;
|
|
40
44
|
private _loadAndRescaleImages;
|
|
41
45
|
private _resizeAndSanitizeSource;
|
|
46
|
+
private _detectPreferredMime;
|
|
42
47
|
private _scrollCarouselToIndex;
|
|
43
48
|
}
|
|
@@ -6,11 +6,13 @@ import { ProductEventService } from '../../service/product-event.service';
|
|
|
6
6
|
import { ArticleFullObject } from '@colijnit/articleapi/build/model/article-full-object';
|
|
7
7
|
import { ProductSettingsService } from '../../service/product-settings.service';
|
|
8
8
|
import { ExternalSource } from '@colijnit/articleapi/build/model/external-source.bo';
|
|
9
|
+
import { ProductConnectorAdapterService } from '../../service/product-connector-adapter.service';
|
|
9
10
|
export declare class ProductAddtocartComponent implements OnInit, OnDestroy {
|
|
10
11
|
iconCache: IconCacheService;
|
|
11
12
|
private _ioneControllerService;
|
|
12
13
|
private _appEventService;
|
|
13
14
|
private _settingsService;
|
|
15
|
+
private _productConnectorAdapterService;
|
|
14
16
|
readonly icon: typeof IconEnum;
|
|
15
17
|
addToCartButton: ElementRef;
|
|
16
18
|
article: ArticleFullObject;
|
|
@@ -29,10 +31,12 @@ export declare class ProductAddtocartComponent implements OnInit, OnDestroy {
|
|
|
29
31
|
showRelatedPopup: EventEmitter<boolean>;
|
|
30
32
|
showQuoteButton: boolean;
|
|
31
33
|
private _quantity;
|
|
32
|
-
constructor(iconCache: IconCacheService, _ioneControllerService: ProductConnectorService, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
|
|
34
|
+
constructor(iconCache: IconCacheService, _ioneControllerService: ProductConnectorService, _appEventService: ProductEventService, _settingsService: ProductSettingsService, _productConnectorAdapterService: ProductConnectorAdapterService);
|
|
33
35
|
ngOnInit(): void;
|
|
34
36
|
ngOnDestroy(): void;
|
|
35
37
|
handleAddToCartClick(quantity: number): Promise<void>;
|
|
36
38
|
handleAddToQuoteClick(quantity: number): Promise<void>;
|
|
39
|
+
private _handleGeneratedArticleDirectly;
|
|
40
|
+
private _getGeneratedArtDirectly;
|
|
37
41
|
private _getJSONFromArticleObject;
|
|
38
42
|
}
|
|
@@ -51,6 +51,7 @@ export declare class ProductPageComponent implements OnInit, OnDestroy, AfterVie
|
|
|
51
51
|
private _currentView;
|
|
52
52
|
private _subs;
|
|
53
53
|
private _settings;
|
|
54
|
+
private _pageLoadedSubscription;
|
|
54
55
|
constructor(_ione: ProductConnectorService, _renderer: Renderer2, _changeDetector: ChangeDetectorRef, iconCache: IconCacheService, settingsService: ProductSettingsService, appEventService: ProductEventService);
|
|
55
56
|
ngOnInit(): void;
|
|
56
57
|
ngAfterViewInit(): void;
|
|
@@ -29,6 +29,7 @@ export declare class ProductConnectorAdapterService implements OnDestroy {
|
|
|
29
29
|
getDeliveryDate2(goodId: number): Promise<DeliveryPrognosis>;
|
|
30
30
|
getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
31
31
|
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, instanceId?: any, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
32
|
+
getGeneratedArtDirectly(goodId: number, showLoader: boolean): Promise<number>;
|
|
32
33
|
getGoodIdFromArticleNr(sku: string): Promise<number>;
|
|
33
34
|
getArticleFullObject(goodId: number, showLoader?: boolean): Promise<ArticleFullObject>;
|
|
34
35
|
getSuperArticle(id: string, branch?: string): Promise<SuperArticle>;
|
|
@@ -13,6 +13,7 @@ export declare class ProductConnectorService implements OnDestroy {
|
|
|
13
13
|
private _settingsService;
|
|
14
14
|
get shouldShowLoader(): boolean;
|
|
15
15
|
controllerInitialized: BehaviorSubject<boolean>;
|
|
16
|
+
articleLoaded: BehaviorSubject<boolean>;
|
|
16
17
|
private _shouldShowLoader;
|
|
17
18
|
private _initializing;
|
|
18
19
|
private _initialized;
|
|
@@ -33,6 +34,7 @@ export declare class ProductConnectorService implements OnDestroy {
|
|
|
33
34
|
getDeliveryDate2(goodId: number): Promise<DeliveryPrognosis>;
|
|
34
35
|
getSuperArticle(id: string): Promise<SuperArticle>;
|
|
35
36
|
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
37
|
+
getGeneratedArtDirectly(goodId: number, showLoader?: boolean): Promise<number>;
|
|
36
38
|
addWebSessionTransactionLine(transactionUuid: string, sku: string, quantity: number): Promise<string>;
|
|
37
39
|
onShowLoaderChange(showLoader: boolean): void;
|
|
38
40
|
}
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
function Version() {
|
|
32
32
|
this.name = "@colijnit/product";
|
|
33
33
|
this.description = "Product detail page project for iOne";
|
|
34
|
-
this.symVer = "258.1.
|
|
35
|
-
this.publishDate = "
|
|
34
|
+
this.symVer = "258.1.6";
|
|
35
|
+
this.publishDate = "22-8-2025 14:23:38";
|
|
36
36
|
}
|
|
37
37
|
return Version;
|
|
38
38
|
}());
|
|
@@ -750,6 +750,17 @@
|
|
|
750
750
|
});
|
|
751
751
|
});
|
|
752
752
|
};
|
|
753
|
+
ProductConnectorAdapterService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
|
|
754
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
755
|
+
var _this = this;
|
|
756
|
+
return __generator(this, function (_a) {
|
|
757
|
+
return [2 /*return*/, this.articleConnector.getGeneratedArtDirectly(goodId, showLoader).catch(function (messages) {
|
|
758
|
+
_this._eventService.errorMessage.next(messages);
|
|
759
|
+
return null;
|
|
760
|
+
})];
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
};
|
|
753
764
|
ProductConnectorAdapterService.prototype.getGoodIdFromArticleNr = function (sku) {
|
|
754
765
|
return __awaiter(this, void 0, void 0, function () {
|
|
755
766
|
var response;
|
|
@@ -1197,6 +1208,7 @@
|
|
|
1197
1208
|
this._adapterService = _adapterService;
|
|
1198
1209
|
this._settingsService = _settingsService;
|
|
1199
1210
|
this.controllerInitialized = new rxjs.BehaviorSubject(false);
|
|
1211
|
+
this.articleLoaded = new rxjs.BehaviorSubject(false);
|
|
1200
1212
|
this._initializing = false;
|
|
1201
1213
|
this._initialized = false;
|
|
1202
1214
|
this.connectorOptions = new options.Options();
|
|
@@ -1304,6 +1316,10 @@
|
|
|
1304
1316
|
if (showLoader === void 0) { showLoader = true; }
|
|
1305
1317
|
return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, this._instanceId, configuratorStatistics);
|
|
1306
1318
|
};
|
|
1319
|
+
ProductConnectorService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
|
|
1320
|
+
if (showLoader === void 0) { showLoader = true; }
|
|
1321
|
+
return this._adapterService.getGeneratedArtDirectly(goodId, showLoader);
|
|
1322
|
+
};
|
|
1307
1323
|
ProductConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
|
|
1308
1324
|
return __awaiter(this, void 0, void 0, function () {
|
|
1309
1325
|
return __generator(this, function (_a) {
|
|
@@ -1671,9 +1687,19 @@
|
|
|
1671
1687
|
if (_this.selections.nativeElement) {
|
|
1672
1688
|
_this.selections.nativeElement.forceRenderImage();
|
|
1673
1689
|
}
|
|
1674
|
-
}), this.settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }), this.
|
|
1675
|
-
|
|
1676
|
-
|
|
1690
|
+
}), this.settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }), this._pageLoadedSubscription = rxjs.combineLatest([
|
|
1691
|
+
this._ione.controllerInitialized,
|
|
1692
|
+
this._ione.articleLoaded
|
|
1693
|
+
]).subscribe(function (_a) {
|
|
1694
|
+
var _b = __read(_a, 2), initialized = _b[0], articleLoaded = _b[1];
|
|
1695
|
+
if (initialized && articleLoaded) {
|
|
1696
|
+
_this.settingsLoaded = initialized;
|
|
1697
|
+
}
|
|
1698
|
+
}),
|
|
1699
|
+
// this._ione.controllerInitialized.subscribe((initialized: boolean) => {
|
|
1700
|
+
// this.settingsLoaded = initialized;
|
|
1701
|
+
// }),
|
|
1702
|
+
this.appEventService.onAnswersAvailable.subscribe(function (answers) {
|
|
1677
1703
|
if (answers && _this.configurable) {
|
|
1678
1704
|
_this.showAddToCart = false;
|
|
1679
1705
|
}
|
|
@@ -1773,6 +1799,7 @@
|
|
|
1773
1799
|
if (this._initializedSub) {
|
|
1774
1800
|
this._initializedSub.unsubscribe();
|
|
1775
1801
|
}
|
|
1802
|
+
this._pageLoadedSubscription.unsubscribe();
|
|
1776
1803
|
this.configurator = undefined;
|
|
1777
1804
|
this.selections = undefined;
|
|
1778
1805
|
this.fullscreenbutton = undefined;
|
|
@@ -1808,7 +1835,8 @@
|
|
|
1808
1835
|
this._ione.getFullArticle(this._sku).then(function (article) {
|
|
1809
1836
|
_this.article = article;
|
|
1810
1837
|
if (_this.article) {
|
|
1811
|
-
_this.configurable = _this.article.goodType === 'B';
|
|
1838
|
+
_this.configurable = _this.article.goodType === 'B' && (_this.article.isConfigurable || _this.article.isConfigurable === undefined);
|
|
1839
|
+
// this.configurable = this.article.goodType === 'B';
|
|
1812
1840
|
if (_this.configurable) {
|
|
1813
1841
|
_this.showAddToCart = false;
|
|
1814
1842
|
_this.currentView = SelectorType.TwoD;
|
|
@@ -1825,6 +1853,7 @@
|
|
|
1825
1853
|
});
|
|
1826
1854
|
_this._changeDetector.detectChanges();
|
|
1827
1855
|
}
|
|
1856
|
+
_this._ione.articleLoaded.next(true);
|
|
1828
1857
|
});
|
|
1829
1858
|
}
|
|
1830
1859
|
return [2 /*return*/];
|
|
@@ -1846,7 +1875,7 @@
|
|
|
1846
1875
|
ProductPageComponent.decorators = [
|
|
1847
1876
|
{ type: i0.Component, args: [{
|
|
1848
1877
|
selector: 'app-product-page',
|
|
1849
|
-
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator\r\n #configurator\r\n class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n </threed-configurator>\r\n </ng-container>\r\n\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\"\r\n [class.show-selections]=\"configuring\"\r\n [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n (onAnswersAvailable)=\"appEventService.onAnswersAvailable.next($event.detail)\"\r\n (onReadyToRender)=\"appEventService.onReadyToRender.next($event.detail)\"\r\n (onRenderImageReceived)=\"appEventService.onRenderImageReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n (showRelatedPopup)=\"handlePopUpChange($event)\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n [label]=\"'RELATED_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"4\"\r\n [isSmallModus]=\"false\"\r\n [label]=\"'ALTERNATIVE_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"showRelatedProductsPopup\">\r\n <co-product-dialog\r\n [mainArticle]=\"article\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n (closeRelatedPopup)=\"handlePopUpChange($event)\"\r\n >\r\n </co-product-dialog>\r\n\r\n <!-- <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"-->\r\n <!-- [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>-->\r\n </div>\r\n\r\n\r\n </div>\r\n</ng-container>\r\n",
|
|
1878
|
+
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded && this.configurable\">\r\n <threed-configurator\r\n #configurator\r\n class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n </threed-configurator>\r\n </ng-container>\r\n\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\"\r\n [class.show-selections]=\"configuring\"\r\n [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n (onAnswersAvailable)=\"appEventService.onAnswersAvailable.next($event.detail)\"\r\n (onReadyToRender)=\"appEventService.onReadyToRender.next($event.detail)\"\r\n (onRenderImageReceived)=\"appEventService.onRenderImageReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n (showRelatedPopup)=\"handlePopUpChange($event)\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\" *ngIf=\"article\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n [label]=\"'RELATED_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"4\"\r\n [isSmallModus]=\"false\"\r\n [label]=\"'ALTERNATIVE_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"showRelatedProductsPopup\">\r\n <co-product-dialog\r\n [mainArticle]=\"article\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n (closeRelatedPopup)=\"handlePopUpChange($event)\"\r\n >\r\n </co-product-dialog>\r\n\r\n <!-- <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"-->\r\n <!-- [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>-->\r\n </div>\r\n\r\n\r\n </div>\r\n</ng-container>\r\n",
|
|
1850
1879
|
animations: [
|
|
1851
1880
|
animations.trigger('toggleFullScreen', [
|
|
1852
1881
|
animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
|
|
@@ -2029,6 +2058,7 @@
|
|
|
2029
2058
|
this._appEventService = _appEventService;
|
|
2030
2059
|
this._changeDetector = _changeDetector;
|
|
2031
2060
|
this._domSanitizer = _domSanitizer;
|
|
2061
|
+
this.isPopupOpen = false;
|
|
2032
2062
|
this.showRefresh = false;
|
|
2033
2063
|
this.resizing = false;
|
|
2034
2064
|
this.imageViewModels = [];
|
|
@@ -2058,6 +2088,12 @@
|
|
|
2058
2088
|
_this._changeDetector.detectChanges();
|
|
2059
2089
|
}));
|
|
2060
2090
|
}
|
|
2091
|
+
// Close on ESC
|
|
2092
|
+
ImageCarouselComponent.prototype.onEsc = function () {
|
|
2093
|
+
if (this.isPopupOpen) {
|
|
2094
|
+
this.closePopup();
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2061
2097
|
Object.defineProperty(ImageCarouselComponent.prototype, "images", {
|
|
2062
2098
|
get: function () {
|
|
2063
2099
|
return this._images;
|
|
@@ -2113,15 +2149,16 @@
|
|
|
2113
2149
|
};
|
|
2114
2150
|
ImageCarouselComponent.prototype.handleShowImage = function (imageViewModel) {
|
|
2115
2151
|
if (imageViewModel && imageViewModel.originalSource) {
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
popupWindow.document.write("<img src=" + imageViewModel.originalSource + " alt=\"Image\" style=\"width:100%; height:auto;\">");
|
|
2120
|
-
popupWindow.document.write('</body></html>');
|
|
2121
|
-
// Close the document to render the popup window
|
|
2122
|
-
popupWindow.document.close();
|
|
2152
|
+
this.selectedImage = imageViewModel;
|
|
2153
|
+
this.isPopupOpen = true;
|
|
2154
|
+
this._changeDetector.markForCheck();
|
|
2123
2155
|
}
|
|
2124
2156
|
};
|
|
2157
|
+
ImageCarouselComponent.prototype.closePopup = function () {
|
|
2158
|
+
this.isPopupOpen = false;
|
|
2159
|
+
this.selectedImage = undefined;
|
|
2160
|
+
this._changeDetector.markForCheck();
|
|
2161
|
+
};
|
|
2125
2162
|
ImageCarouselComponent.prototype._filterValidImages = function (value) {
|
|
2126
2163
|
if (!value) {
|
|
2127
2164
|
return [];
|
|
@@ -2166,39 +2203,54 @@
|
|
|
2166
2203
|
ImageCarouselComponent.prototype._resizeAndSanitizeSource = function (source, imageViewModel) {
|
|
2167
2204
|
var _this = this;
|
|
2168
2205
|
var resizeCanvas = document.createElement('canvas');
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2206
|
+
var ctx = resizeCanvas.getContext('2d');
|
|
2207
|
+
var img = document.createElement('img');
|
|
2208
|
+
img.crossOrigin = 'anonymous';
|
|
2209
|
+
img.onload = function () {
|
|
2210
|
+
ctx.imageSmoothingEnabled = true;
|
|
2211
|
+
ctx.imageSmoothingQuality = 'high';
|
|
2212
|
+
var ow = img.width;
|
|
2213
|
+
var oh = img.height;
|
|
2214
|
+
var aspect = ow / oh;
|
|
2215
|
+
var newW = _this._resizeCanvasHeight;
|
|
2216
|
+
var newH = _this._resizeCanvasHeight;
|
|
2217
|
+
if (ow > oh) {
|
|
2218
|
+
newH = _this._resizeCanvasHeight / aspect;
|
|
2219
|
+
}
|
|
2220
|
+
else {
|
|
2221
|
+
newW = _this._resizeCanvasHeight * aspect;
|
|
2222
|
+
}
|
|
2223
|
+
resizeCanvas.width = Math.round(newW);
|
|
2224
|
+
resizeCanvas.height = Math.round(newH);
|
|
2225
|
+
// Ensure transparent background before drawing
|
|
2226
|
+
ctx.clearRect(0, 0, resizeCanvas.width, resizeCanvas.height);
|
|
2227
|
+
ctx.drawImage(img, 0, 0, resizeCanvas.width, resizeCanvas.height);
|
|
2228
|
+
var mime = _this._detectPreferredMime(source);
|
|
2229
|
+
var resizedSource = mime === 'image/jpeg'
|
|
2230
|
+
? resizeCanvas.toDataURL('image/jpeg', 0.92) // only if original was JPEG
|
|
2231
|
+
: resizeCanvas.toDataURL(mime); // PNG/WebP keep alpha
|
|
2232
|
+
imageViewModel.source = _this._domSanitizer.bypassSecurityTrustUrl(resizedSource);
|
|
2233
|
+
imageViewModel.originalSource = source;
|
|
2234
|
+
_this._changeDetector.detectChanges();
|
|
2235
|
+
};
|
|
2236
|
+
img.src = source;
|
|
2237
|
+
};
|
|
2238
|
+
ImageCarouselComponent.prototype._detectPreferredMime = function (source) {
|
|
2239
|
+
// Data URI check
|
|
2240
|
+
var m = source.match(/^data:(image\/[a-zA-Z+.-]+);base64,/);
|
|
2241
|
+
if (m) {
|
|
2242
|
+
var t = m[1].toLowerCase();
|
|
2243
|
+
if (t === 'image/png' || t === 'image/webp' || t === 'image/jpeg')
|
|
2244
|
+
return t;
|
|
2245
|
+
}
|
|
2246
|
+
var lower = source.toLowerCase();
|
|
2247
|
+
if (lower.endsWith('.png'))
|
|
2248
|
+
return 'image/png';
|
|
2249
|
+
if (lower.endsWith('.webp'))
|
|
2250
|
+
return 'image/webp';
|
|
2251
|
+
if (lower.endsWith('.jpg') || lower.endsWith('.jpeg'))
|
|
2252
|
+
return 'image/jpeg';
|
|
2253
|
+
return 'image/png';
|
|
2202
2254
|
};
|
|
2203
2255
|
ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
|
|
2204
2256
|
if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
|
|
@@ -2217,9 +2269,9 @@
|
|
|
2217
2269
|
ImageCarouselComponent.decorators = [
|
|
2218
2270
|
{ type: i0.Component, args: [{
|
|
2219
2271
|
selector: 'app-image-carousel',
|
|
2220
|
-
template: "\n <div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"true\" *ngIf=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"imageViewModels[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\" (click)=\"handleShowImage(imageViewModels[0])\">\n <img [src]=\"imageViewModels[0].source\">\n </div>\n <div *ngFor=\"let imageViewModel of imageViewModels.slice(1); let index = index\" class=\"carousel-item\"\n [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\" (click)=\"handleShowImage(imageViewModel)\">\n <img [src]=\"imageViewModel.source\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"imageViewModels && imageViewModels.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <!--\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n -->\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"imageViewModels && imageViewModels.length > 1\">\n <div *ngFor=\"let imageViewModel of imageViewModels; let index = index\" class=\"carousel-thumb\"\n [class.active]=\"index === currentIndex\">\n <img [src]=\"imageViewModel.source\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n </div>\n ",
|
|
2272
|
+
template: "\n <div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"true\" *ngIf=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"imageViewModels[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\" (click)=\"handleShowImage(imageViewModels[0])\">\n <img [src]=\"imageViewModels[0].source\">\n </div>\n <div *ngFor=\"let imageViewModel of imageViewModels.slice(1); let index = index\" class=\"carousel-item\"\n [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\" (click)=\"handleShowImage(imageViewModel)\">\n <img [src]=\"imageViewModel.source\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"imageViewModels && imageViewModels.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <!--\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n -->\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"imageViewModels && imageViewModels.length > 1\">\n <div *ngFor=\"let imageViewModel of imageViewModels; let index = index\" class=\"carousel-thumb\"\n [class.active]=\"index === currentIndex\">\n <img [src]=\"imageViewModel.source\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n </div>\n <!-- Modal (real popup) -->\n <div\n class=\"image-modal\"\n *ngIf=\"isPopupOpen\"\n (click)=\"closePopup()\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Image preview\"\n >\n <div class=\"image-modal__content\" (click)=\"$event.stopPropagation()\">\n <button\n class=\"image-modal__close\"\n type=\"button\"\n aria-label=\"Close\"\n (click)=\"closePopup()\"\n >\n \u00D7\n </button>\n\n <img [src]=\"selectedImage?.originalSource\" alt=\"Image preview\" />\n </div>\n </div>\n ",
|
|
2221
2273
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2222
|
-
styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{animation:spin 1s linear infinite}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74B77F;transition:all .2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;cursor:zoom-in;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:all .2s ease;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}@media screen and (max-width: 650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"]
|
|
2274
|
+
styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{animation:spin 1s linear infinite}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74B77F;transition:all .2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;cursor:zoom-in;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:all .2s ease;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}.image-modal{position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:1000}.image-modal__content{position:relative;max-width:90vw;max-height:90vh}.image-modal__content img{max-width:90vw;max-height:90vh;-o-object-fit:contain;object-fit:contain;display:block}.image-modal__close{position:fixed;top:15px;right:30px;background:transparent;border:none;color:#fff;font-size:60px;line-height:1;cursor:pointer}@media screen and (max-width: 650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"]
|
|
2223
2275
|
},] }
|
|
2224
2276
|
];
|
|
2225
2277
|
ImageCarouselComponent.ctorParameters = function () { return [
|
|
@@ -2230,6 +2282,7 @@
|
|
|
2230
2282
|
]; };
|
|
2231
2283
|
ImageCarouselComponent.propDecorators = {
|
|
2232
2284
|
carousel: [{ type: i0.ViewChild, args: ['carousel', { read: i0.ElementRef },] }],
|
|
2285
|
+
onEsc: [{ type: i0.HostListener, args: ['document:keydown.escape',] }],
|
|
2233
2286
|
showRefresh: [{ type: i0.Input }],
|
|
2234
2287
|
images: [{ type: i0.Input }],
|
|
2235
2288
|
handleWindowResize: [{ type: i0.HostListener, args: ['window:resize',] }],
|
|
@@ -2487,11 +2540,12 @@
|
|
|
2487
2540
|
];
|
|
2488
2541
|
|
|
2489
2542
|
var ProductAddtocartComponent = /** @class */ (function () {
|
|
2490
|
-
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
|
|
2543
|
+
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService, _productConnectorAdapterService) {
|
|
2491
2544
|
this.iconCache = iconCache;
|
|
2492
2545
|
this._ioneControllerService = _ioneControllerService;
|
|
2493
2546
|
this._appEventService = _appEventService;
|
|
2494
2547
|
this._settingsService = _settingsService;
|
|
2548
|
+
this._productConnectorAdapterService = _productConnectorAdapterService;
|
|
2495
2549
|
this.icon = IconEnum;
|
|
2496
2550
|
this.createFrozenArticle = true;
|
|
2497
2551
|
this.configurable = false;
|
|
@@ -2537,36 +2591,50 @@
|
|
|
2537
2591
|
return __generator(this, function (_a) {
|
|
2538
2592
|
switch (_a.label) {
|
|
2539
2593
|
case 0:
|
|
2540
|
-
if (!this.createFrozenArticle) return [3 /*break*/,
|
|
2541
|
-
if (!(this.article.goodType === 'B')) return [3 /*break*/,
|
|
2594
|
+
if (!this.createFrozenArticle) return [3 /*break*/, 10];
|
|
2595
|
+
if (!(this.article.goodType === 'B')) return [3 /*break*/, 5];
|
|
2596
|
+
if (!this.article.isConfigurable) return [3 /*break*/, 2];
|
|
2542
2597
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2543
2598
|
case 1:
|
|
2544
2599
|
article = _a.sent();
|
|
2545
2600
|
if (article) {
|
|
2546
2601
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2547
2602
|
}
|
|
2548
|
-
return [3 /*break*/,
|
|
2549
|
-
case 2:
|
|
2603
|
+
return [3 /*break*/, 4];
|
|
2604
|
+
case 2: return [4 /*yield*/, this._handleGeneratedArticleDirectly(quantity)];
|
|
2605
|
+
case 3:
|
|
2606
|
+
_a.sent();
|
|
2607
|
+
_a.label = 4;
|
|
2608
|
+
case 4: return [3 /*break*/, 9];
|
|
2609
|
+
case 5:
|
|
2550
2610
|
article = void 0;
|
|
2551
|
-
if (!!!this.externalSource) return [3 /*break*/,
|
|
2611
|
+
if (!!!this.externalSource) return [3 /*break*/, 7];
|
|
2552
2612
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2553
|
-
case
|
|
2613
|
+
case 6:
|
|
2554
2614
|
article = _a.sent();
|
|
2555
|
-
return [3 /*break*/,
|
|
2556
|
-
case
|
|
2615
|
+
return [3 /*break*/, 8];
|
|
2616
|
+
case 7:
|
|
2557
2617
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2558
|
-
_a.label =
|
|
2559
|
-
case
|
|
2618
|
+
_a.label = 8;
|
|
2619
|
+
case 8:
|
|
2560
2620
|
if (article) {
|
|
2561
2621
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2562
2622
|
}
|
|
2563
|
-
_a.label =
|
|
2564
|
-
case
|
|
2565
|
-
case
|
|
2623
|
+
_a.label = 9;
|
|
2624
|
+
case 9: return [3 /*break*/, 14];
|
|
2625
|
+
case 10:
|
|
2626
|
+
if (!(this.article.goodType === 'B')) return [3 /*break*/, 13];
|
|
2627
|
+
if (!!this.article.isConfigurable) return [3 /*break*/, 12];
|
|
2628
|
+
return [4 /*yield*/, this._handleGeneratedArticleDirectly(quantity)];
|
|
2629
|
+
case 11:
|
|
2630
|
+
_a.sent();
|
|
2631
|
+
_a.label = 12;
|
|
2632
|
+
case 12: return [3 /*break*/, 14];
|
|
2633
|
+
case 13:
|
|
2566
2634
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2567
2635
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2568
|
-
_a.label =
|
|
2569
|
-
case
|
|
2636
|
+
_a.label = 14;
|
|
2637
|
+
case 14: return [2 /*return*/];
|
|
2570
2638
|
}
|
|
2571
2639
|
});
|
|
2572
2640
|
});
|
|
@@ -2586,6 +2654,36 @@
|
|
|
2586
2654
|
});
|
|
2587
2655
|
});
|
|
2588
2656
|
};
|
|
2657
|
+
ProductAddtocartComponent.prototype._handleGeneratedArticleDirectly = function (quantity) {
|
|
2658
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2659
|
+
var generatedGoodId, articleFull, article;
|
|
2660
|
+
return __generator(this, function (_a) {
|
|
2661
|
+
switch (_a.label) {
|
|
2662
|
+
case 0: return [4 /*yield*/, this._getGeneratedArtDirectly(this.article.goodId)];
|
|
2663
|
+
case 1:
|
|
2664
|
+
generatedGoodId = _a.sent();
|
|
2665
|
+
if (!generatedGoodId) return [3 /*break*/, 3];
|
|
2666
|
+
return [4 /*yield*/, this._productConnectorAdapterService.getArticleFullObject(generatedGoodId, true)];
|
|
2667
|
+
case 2:
|
|
2668
|
+
articleFull = _a.sent();
|
|
2669
|
+
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(articleFull);
|
|
2670
|
+
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2671
|
+
_a.label = 3;
|
|
2672
|
+
case 3: return [2 /*return*/];
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
});
|
|
2676
|
+
};
|
|
2677
|
+
ProductAddtocartComponent.prototype._getGeneratedArtDirectly = function (goodId) {
|
|
2678
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2679
|
+
return __generator(this, function (_a) {
|
|
2680
|
+
switch (_a.label) {
|
|
2681
|
+
case 0: return [4 /*yield*/, this._ioneControllerService.getGeneratedArtDirectly(goodId, true)];
|
|
2682
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2683
|
+
}
|
|
2684
|
+
});
|
|
2685
|
+
});
|
|
2686
|
+
};
|
|
2589
2687
|
ProductAddtocartComponent.prototype._getJSONFromArticleObject = function (article) {
|
|
2590
2688
|
return __awaiter(this, void 0, void 0, function () {
|
|
2591
2689
|
var configuratorStatistics;
|
|
@@ -2618,7 +2716,8 @@
|
|
|
2618
2716
|
{ type: IconCacheService },
|
|
2619
2717
|
{ type: ProductConnectorService },
|
|
2620
2718
|
{ type: ProductEventService },
|
|
2621
|
-
{ type: ProductSettingsService }
|
|
2719
|
+
{ type: ProductSettingsService },
|
|
2720
|
+
{ type: ProductConnectorAdapterService }
|
|
2622
2721
|
]; };
|
|
2623
2722
|
ProductAddtocartComponent.propDecorators = {
|
|
2624
2723
|
addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],
|
|
@@ -3019,7 +3118,7 @@
|
|
|
3019
3118
|
this.updateHeight(tabIndex);
|
|
3020
3119
|
};
|
|
3021
3120
|
ProductInfoTabsComponent.prototype.updateHeight = function (tabIndex) {
|
|
3022
|
-
if (this.tabContent.nativeElement.children.length > 0) {
|
|
3121
|
+
if (this.tabContent && this.tabContent.nativeElement.children.length > 0) {
|
|
3023
3122
|
if (this.tabContent.nativeElement.children[tabIndex] !== undefined) {
|
|
3024
3123
|
this.activeTabHeight = this.tabContent.nativeElement.children[tabIndex].offsetHeight;
|
|
3025
3124
|
}
|