@colijnit/product 259.1.1 → 259.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/app/components/image-carousel/image-carousel.component.d.ts +6 -1
- package/app/components/product-documents/product-documents.component.d.ts +1 -1
- package/app/components/product-related/product-related.component.d.ts +1 -0
- package/app/service/product-connector-adapter.service.d.ts +5 -0
- package/app/service/product-connector.service.d.ts +3 -0
- package/bundles/colijnit-product.umd.js +115 -59
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/components/image-carousel/image-carousel.component.js +83 -37
- package/esm2015/app/components/product-documents/product-documents.component.js +1 -1
- package/esm2015/app/components/product-related/product-related.component.js +8 -10
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-connector-adapter.service.js +11 -1
- package/esm2015/app/service/product-connector.service.js +6 -1
- package/fesm2015/colijnit-product.js +107 -47
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
-
import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
|
|
2
|
+
import { CoDocument } from '@colijnit/mainapi/build/model/co-document.bo';
|
|
3
3
|
import { ProductConnectorService } from '../../service/product-connector.service';
|
|
4
4
|
import { ProductEventService } from '../../service/product-event.service';
|
|
5
5
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
|
@@ -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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
|
|
1
|
+
import { CoDocument } from '@colijnit/mainapi/build/model/co-document.bo';
|
|
2
2
|
import { IconEnum } from '../../enum/icon.enum';
|
|
3
3
|
import { IconCacheService } from '../../service/icon-cache.service';
|
|
4
4
|
export declare class ProductDocumentsComponent {
|
|
@@ -16,6 +16,7 @@ export declare class ProductRelatedComponent {
|
|
|
16
16
|
createFrozenArticle: boolean;
|
|
17
17
|
set articles(value: ArticleListObject[]);
|
|
18
18
|
get articles(): ArticleListObject[];
|
|
19
|
+
imageData: string;
|
|
19
20
|
private _articles;
|
|
20
21
|
constructor(_iOne: ProductConnectorService, _appEventService: ProductEventService, _productConnectorAdapterService: ProductConnectorAdapterService, _settingsService: ProductSettingsService);
|
|
21
22
|
handleContentClick(article: ArticleListObject): void;
|
|
@@ -8,13 +8,17 @@ import { Options } from '@colijnit/ioneconnector/build/model/options';
|
|
|
8
8
|
import { DeliveryPrognosis } from '@colijnit/articleapi/build/model/delivery-prognosis';
|
|
9
9
|
import { DocumentContent } from '@colijnit/articleapi/build/model/document-content';
|
|
10
10
|
import { Transaction } from '@colijnit/transactionapi/build/transaction';
|
|
11
|
+
import { MainApi } from '@colijnit/mainapi';
|
|
11
12
|
import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/article-list-object-extended.bo';
|
|
12
13
|
import { ProductEventService } from './product-event.service';
|
|
14
|
+
import { CoDocument } from '@colijnit/mainapi/build/model/co-document.bo';
|
|
15
|
+
import { ImageContent } from '@colijnit/mainapi/build/model/image-content.bo';
|
|
13
16
|
export declare class ProductConnectorAdapterService implements OnDestroy {
|
|
14
17
|
private _eventService;
|
|
15
18
|
readonly showLoader: Subject<boolean>;
|
|
16
19
|
articleConnector?: Articles;
|
|
17
20
|
transactionConnector: Transaction;
|
|
21
|
+
mainConnector: MainApi;
|
|
18
22
|
private _boFactory;
|
|
19
23
|
private _subs;
|
|
20
24
|
constructor(_eventService: ProductEventService);
|
|
@@ -35,4 +39,5 @@ export declare class ProductConnectorAdapterService implements OnDestroy {
|
|
|
35
39
|
getSuperArticle(id: string, branch?: string): Promise<SuperArticle>;
|
|
36
40
|
getDocumentContent(docId: number, thumbnail?: boolean): Promise<DocumentContent>;
|
|
37
41
|
addWebSessionTransactionLine(transactionUuid: string, sku: string, quantity: number): Promise<string>;
|
|
42
|
+
getImageForCoDocument(document: CoDocument, thumb: boolean): Promise<ImageContent>;
|
|
38
43
|
}
|
|
@@ -8,6 +8,8 @@ import { ConfiguratorStatisticsEnvironment } from '@colijnit/articleapi/build/mo
|
|
|
8
8
|
import { DeliveryPrognosis } from '@colijnit/articleapi/build/model/delivery-prognosis';
|
|
9
9
|
import { DocumentContent } from '@colijnit/articleapi/build/model/document-content';
|
|
10
10
|
import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/article-list-object-extended.bo';
|
|
11
|
+
import { CoDocument } from '@colijnit/mainapi/build/model/co-document.bo';
|
|
12
|
+
import { ImageContent } from '@colijnit/mainapi/build/model/image-content.bo';
|
|
11
13
|
export declare class ProductConnectorService implements OnDestroy {
|
|
12
14
|
private _adapterService;
|
|
13
15
|
private _settingsService;
|
|
@@ -36,5 +38,6 @@ export declare class ProductConnectorService implements OnDestroy {
|
|
|
36
38
|
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
37
39
|
getGeneratedArtDirectly(goodId: number, showLoader?: boolean): Promise<number>;
|
|
38
40
|
addWebSessionTransactionLine(transactionUuid: string, sku: string, quantity: number): Promise<string>;
|
|
41
|
+
getImageForCoDocument(document: CoDocument, thumb?: boolean): Promise<ImageContent>;
|
|
39
42
|
onShowLoaderChange(showLoader: boolean): void;
|
|
40
43
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@colijnit/ioneconnector/build/model/options'), require('@colijnit/articleapi/build/model/article-full-object'), require('@colijnit/articleapi/build/model/super-article'), require('@colijnit/articleapi/build/articles'), require('@colijnit/articleapi/build/model/delivery-prognosis'), require('@colijnit/articleapi/build/model/document-content'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@colijnit/transactionapi/build/transaction'), require('@colijnit/mainapi'), require('@colijnit/transactionapi/build/model/transaction-info-response.bo'), require('@colijnit/articleapi/build/model/article-list-object-extended.bo'), require('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/animations'), require('@angular/platform-browser'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document'), require('@colijnit/articleapi/build/model/configurator-statistics-environment'), require('@colijnit/corecomponents_v12')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@colijnit/ioneconnector/build/model/options', '@colijnit/articleapi/build/model/article-full-object', '@colijnit/articleapi/build/model/super-article', '@colijnit/articleapi/build/articles', '@colijnit/articleapi/build/model/delivery-prognosis', '@colijnit/articleapi/build/model/document-content', '@colijnit/ioneconnector/build/service/business-object-factory', '@colijnit/transactionapi/build/transaction', '@colijnit/mainapi', '@colijnit/transactionapi/build/model/transaction-info-response.bo', '@colijnit/articleapi/build/model/article-list-object-extended.bo', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/common', '@angular/animations', '@angular/platform-browser', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document', '@colijnit/articleapi/build/model/configurator-statistics-environment', '@colijnit/corecomponents_v12'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.transaction, global.mainapi, global.transactionInfoResponse_bo, global.articleListObjectExtended_bo, global.ng.common.http, global.stringUtils, global.ng.common, global.ng.animations, global.ng.platformBrowser, global.corecomponents, global.
|
|
5
|
-
})(this, (function (exports, i0, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, transactionInfoResponse_bo, articleListObjectExtended_bo, i1, stringUtils, common, animations, i1$1, corecomponents,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@colijnit/ioneconnector/build/model/options'), require('@colijnit/articleapi/build/model/article-full-object'), require('@colijnit/articleapi/build/model/super-article'), require('@colijnit/articleapi/build/articles'), require('@colijnit/articleapi/build/model/delivery-prognosis'), require('@colijnit/articleapi/build/model/document-content'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@colijnit/transactionapi/build/transaction'), require('@colijnit/mainapi'), require('@colijnit/transactionapi/build/model/transaction-info-response.bo'), require('@colijnit/articleapi/build/model/article-list-object-extended.bo'), require('@colijnit/mainapi/build/model/image-content.bo'), require('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/animations'), require('@angular/platform-browser'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document.bo'), require('@colijnit/articleapi/build/model/configurator-statistics-environment'), require('@colijnit/corecomponents_v12')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@colijnit/ioneconnector/build/model/options', '@colijnit/articleapi/build/model/article-full-object', '@colijnit/articleapi/build/model/super-article', '@colijnit/articleapi/build/articles', '@colijnit/articleapi/build/model/delivery-prognosis', '@colijnit/articleapi/build/model/document-content', '@colijnit/ioneconnector/build/service/business-object-factory', '@colijnit/transactionapi/build/transaction', '@colijnit/mainapi', '@colijnit/transactionapi/build/model/transaction-info-response.bo', '@colijnit/articleapi/build/model/article-list-object-extended.bo', '@colijnit/mainapi/build/model/image-content.bo', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/common', '@angular/animations', '@angular/platform-browser', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document.bo', '@colijnit/articleapi/build/model/configurator-statistics-environment', '@colijnit/corecomponents_v12'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.transaction, global.mainapi, global.transactionInfoResponse_bo, global.articleListObjectExtended_bo, global.imageContent_bo, global.ng.common.http, global.stringUtils, global.ng.common, global.ng.animations, global.ng.platformBrowser, global.corecomponents, global.coDocument_bo, global.configuratorStatisticsEnvironment, global.corecomponents_v12));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, transactionInfoResponse_bo, articleListObjectExtended_bo, imageContent_bo, i1, stringUtils, common, animations, i1$1, corecomponents, coDocument_bo, configuratorStatisticsEnvironment, corecomponents_v12) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -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 = "259.1.
|
|
35
|
-
this.publishDate = "9-
|
|
34
|
+
this.symVer = "259.1.3";
|
|
35
|
+
this.publishDate = "29-9-2025 15:45:45";
|
|
36
36
|
}
|
|
37
37
|
return Version;
|
|
38
38
|
}());
|
|
@@ -608,6 +608,7 @@
|
|
|
608
608
|
case 1:
|
|
609
609
|
_a.sent();
|
|
610
610
|
this.transactionConnector = new transaction.Transaction(options);
|
|
611
|
+
this.mainConnector = new mainapi.MainApi(options);
|
|
611
612
|
this._subs.push(
|
|
612
613
|
// @ts-ignore
|
|
613
614
|
this.articleConnector.showLoader.subscribe(function (value) { return _this.showLoader.next(value); }));
|
|
@@ -856,6 +857,22 @@
|
|
|
856
857
|
});
|
|
857
858
|
});
|
|
858
859
|
};
|
|
860
|
+
ProductConnectorAdapterService.prototype.getImageForCoDocument = function (document, thumb) {
|
|
861
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
862
|
+
var response;
|
|
863
|
+
return __generator(this, function (_a) {
|
|
864
|
+
switch (_a.label) {
|
|
865
|
+
case 0: return [4 /*yield*/, this.mainConnector.getImageForCoDocument(document, thumb)];
|
|
866
|
+
case 1:
|
|
867
|
+
response = _a.sent();
|
|
868
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
869
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(imageContent_bo.ImageContent, response.resultObject)];
|
|
870
|
+
}
|
|
871
|
+
return [2 /*return*/];
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
});
|
|
875
|
+
};
|
|
859
876
|
return ProductConnectorAdapterService;
|
|
860
877
|
}());
|
|
861
878
|
ProductConnectorAdapterService.decorators = [
|
|
@@ -1330,6 +1347,14 @@
|
|
|
1330
1347
|
});
|
|
1331
1348
|
});
|
|
1332
1349
|
};
|
|
1350
|
+
ProductConnectorService.prototype.getImageForCoDocument = function (document, thumb) {
|
|
1351
|
+
if (thumb === void 0) { thumb = false; }
|
|
1352
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1353
|
+
return __generator(this, function (_a) {
|
|
1354
|
+
return [2 /*return*/, this._adapterService.getImageForCoDocument(document, thumb)];
|
|
1355
|
+
});
|
|
1356
|
+
});
|
|
1357
|
+
};
|
|
1333
1358
|
ProductConnectorService.prototype.onShowLoaderChange = function (showLoader) {
|
|
1334
1359
|
this._shouldShowLoader = showLoader;
|
|
1335
1360
|
};
|
|
@@ -2059,6 +2084,7 @@
|
|
|
2059
2084
|
this._appEventService = _appEventService;
|
|
2060
2085
|
this._changeDetector = _changeDetector;
|
|
2061
2086
|
this._domSanitizer = _domSanitizer;
|
|
2087
|
+
this.isPopupOpen = false;
|
|
2062
2088
|
this.showRefresh = false;
|
|
2063
2089
|
this.resizing = false;
|
|
2064
2090
|
this.imageViewModels = [];
|
|
@@ -2076,7 +2102,7 @@
|
|
|
2076
2102
|
}, 10000);
|
|
2077
2103
|
}), this._appEventService.onDraftRenderImageReceived.subscribe(function (event) {
|
|
2078
2104
|
if (event && event.detail) {
|
|
2079
|
-
if (_this._images[0] instanceof
|
|
2105
|
+
if (_this._images[0] instanceof coDocument_bo.CoDocument) {
|
|
2080
2106
|
_this._images.unshift(event.detail);
|
|
2081
2107
|
}
|
|
2082
2108
|
else {
|
|
@@ -2088,6 +2114,12 @@
|
|
|
2088
2114
|
_this._changeDetector.detectChanges();
|
|
2089
2115
|
}));
|
|
2090
2116
|
}
|
|
2117
|
+
// Close on ESC
|
|
2118
|
+
ImageCarouselComponent.prototype.onEsc = function () {
|
|
2119
|
+
if (this.isPopupOpen) {
|
|
2120
|
+
this.closePopup();
|
|
2121
|
+
}
|
|
2122
|
+
};
|
|
2091
2123
|
Object.defineProperty(ImageCarouselComponent.prototype, "images", {
|
|
2092
2124
|
get: function () {
|
|
2093
2125
|
return this._images;
|
|
@@ -2143,15 +2175,16 @@
|
|
|
2143
2175
|
};
|
|
2144
2176
|
ImageCarouselComponent.prototype.handleShowImage = function (imageViewModel) {
|
|
2145
2177
|
if (imageViewModel && imageViewModel.originalSource) {
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
popupWindow.document.write("<img src=" + imageViewModel.originalSource + " alt=\"Image\" style=\"width:100%; height:auto;\">");
|
|
2150
|
-
popupWindow.document.write('</body></html>');
|
|
2151
|
-
// Close the document to render the popup window
|
|
2152
|
-
popupWindow.document.close();
|
|
2178
|
+
this.selectedImage = imageViewModel;
|
|
2179
|
+
this.isPopupOpen = true;
|
|
2180
|
+
this._changeDetector.markForCheck();
|
|
2153
2181
|
}
|
|
2154
2182
|
};
|
|
2183
|
+
ImageCarouselComponent.prototype.closePopup = function () {
|
|
2184
|
+
this.isPopupOpen = false;
|
|
2185
|
+
this.selectedImage = undefined;
|
|
2186
|
+
this._changeDetector.markForCheck();
|
|
2187
|
+
};
|
|
2155
2188
|
ImageCarouselComponent.prototype._filterValidImages = function (value) {
|
|
2156
2189
|
if (!value) {
|
|
2157
2190
|
return [];
|
|
@@ -2196,39 +2229,54 @@
|
|
|
2196
2229
|
ImageCarouselComponent.prototype._resizeAndSanitizeSource = function (source, imageViewModel) {
|
|
2197
2230
|
var _this = this;
|
|
2198
2231
|
var resizeCanvas = document.createElement('canvas');
|
|
2199
|
-
var
|
|
2200
|
-
var
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
+
var ctx = resizeCanvas.getContext('2d');
|
|
2233
|
+
var img = document.createElement('img');
|
|
2234
|
+
img.crossOrigin = 'anonymous';
|
|
2235
|
+
img.onload = function () {
|
|
2236
|
+
ctx.imageSmoothingEnabled = true;
|
|
2237
|
+
ctx.imageSmoothingQuality = 'high';
|
|
2238
|
+
var ow = img.width;
|
|
2239
|
+
var oh = img.height;
|
|
2240
|
+
var aspect = ow / oh;
|
|
2241
|
+
var newW = _this._resizeCanvasHeight;
|
|
2242
|
+
var newH = _this._resizeCanvasHeight;
|
|
2243
|
+
if (ow > oh) {
|
|
2244
|
+
newH = _this._resizeCanvasHeight / aspect;
|
|
2245
|
+
}
|
|
2246
|
+
else {
|
|
2247
|
+
newW = _this._resizeCanvasHeight * aspect;
|
|
2248
|
+
}
|
|
2249
|
+
resizeCanvas.width = Math.round(newW);
|
|
2250
|
+
resizeCanvas.height = Math.round(newH);
|
|
2251
|
+
// Ensure transparent background before drawing
|
|
2252
|
+
ctx.clearRect(0, 0, resizeCanvas.width, resizeCanvas.height);
|
|
2253
|
+
ctx.drawImage(img, 0, 0, resizeCanvas.width, resizeCanvas.height);
|
|
2254
|
+
var mime = _this._detectPreferredMime(source);
|
|
2255
|
+
var resizedSource = mime === 'image/jpeg'
|
|
2256
|
+
? resizeCanvas.toDataURL('image/jpeg', 0.92) // only if original was JPEG
|
|
2257
|
+
: resizeCanvas.toDataURL(mime); // PNG/WebP keep alpha
|
|
2258
|
+
imageViewModel.source = _this._domSanitizer.bypassSecurityTrustUrl(resizedSource);
|
|
2259
|
+
imageViewModel.originalSource = source;
|
|
2260
|
+
_this._changeDetector.detectChanges();
|
|
2261
|
+
};
|
|
2262
|
+
img.src = source;
|
|
2263
|
+
};
|
|
2264
|
+
ImageCarouselComponent.prototype._detectPreferredMime = function (source) {
|
|
2265
|
+
// Data URI check
|
|
2266
|
+
var m = source.match(/^data:(image\/[a-zA-Z+.-]+);base64,/);
|
|
2267
|
+
if (m) {
|
|
2268
|
+
var t = m[1].toLowerCase();
|
|
2269
|
+
if (t === 'image/png' || t === 'image/webp' || t === 'image/jpeg')
|
|
2270
|
+
return t;
|
|
2271
|
+
}
|
|
2272
|
+
var lower = source.toLowerCase();
|
|
2273
|
+
if (lower.endsWith('.png'))
|
|
2274
|
+
return 'image/png';
|
|
2275
|
+
if (lower.endsWith('.webp'))
|
|
2276
|
+
return 'image/webp';
|
|
2277
|
+
if (lower.endsWith('.jpg') || lower.endsWith('.jpeg'))
|
|
2278
|
+
return 'image/jpeg';
|
|
2279
|
+
return 'image/png';
|
|
2232
2280
|
};
|
|
2233
2281
|
ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
|
|
2234
2282
|
if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
|
|
@@ -2247,9 +2295,9 @@
|
|
|
2247
2295
|
ImageCarouselComponent.decorators = [
|
|
2248
2296
|
{ type: i0.Component, args: [{
|
|
2249
2297
|
selector: 'app-image-carousel',
|
|
2250
|
-
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 ",
|
|
2298
|
+
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 ",
|
|
2251
2299
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2252
|
-
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"]
|
|
2300
|
+
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"]
|
|
2253
2301
|
},] }
|
|
2254
2302
|
];
|
|
2255
2303
|
ImageCarouselComponent.ctorParameters = function () { return [
|
|
@@ -2260,6 +2308,7 @@
|
|
|
2260
2308
|
]; };
|
|
2261
2309
|
ImageCarouselComponent.propDecorators = {
|
|
2262
2310
|
carousel: [{ type: i0.ViewChild, args: ['carousel', { read: i0.ElementRef },] }],
|
|
2311
|
+
onEsc: [{ type: i0.HostListener, args: ['document:keydown.escape',] }],
|
|
2263
2312
|
showRefresh: [{ type: i0.Input }],
|
|
2264
2313
|
images: [{ type: i0.Input }],
|
|
2265
2314
|
handleWindowResize: [{ type: i0.HostListener, args: ['window:resize',] }],
|
|
@@ -2744,6 +2793,7 @@
|
|
|
2744
2793
|
this._settingsService = _settingsService;
|
|
2745
2794
|
this.isSmallModus = true;
|
|
2746
2795
|
this.createFrozenArticle = true;
|
|
2796
|
+
this.imageData = '';
|
|
2747
2797
|
this._articles = [];
|
|
2748
2798
|
}
|
|
2749
2799
|
Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
|
|
@@ -2825,22 +2875,28 @@
|
|
|
2825
2875
|
};
|
|
2826
2876
|
ProductRelatedComponent.prototype._loadImages = function () {
|
|
2827
2877
|
var _this = this;
|
|
2828
|
-
this._articles.forEach(function (a) {
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2878
|
+
this._articles.forEach(function (a) { return __awaiter(_this, void 0, void 0, function () {
|
|
2879
|
+
var imageContent;
|
|
2880
|
+
return __generator(this, function (_a) {
|
|
2881
|
+
switch (_a.label) {
|
|
2882
|
+
case 0:
|
|
2883
|
+
if (!a.image) return [3 /*break*/, 2];
|
|
2884
|
+
return [4 /*yield*/, this._iOne.getImageForCoDocument(a.image, false)];
|
|
2885
|
+
case 1:
|
|
2886
|
+
imageContent = _a.sent();
|
|
2887
|
+
this.imageData = imageContent.image;
|
|
2888
|
+
_a.label = 2;
|
|
2889
|
+
case 2: return [2 /*return*/];
|
|
2890
|
+
}
|
|
2891
|
+
});
|
|
2892
|
+
}); });
|
|
2837
2893
|
};
|
|
2838
2894
|
return ProductRelatedComponent;
|
|
2839
2895
|
}());
|
|
2840
2896
|
ProductRelatedComponent.decorators = [
|
|
2841
2897
|
{ type: i0.Component, args: [{
|
|
2842
2898
|
selector: 'app-product-related',
|
|
2843
|
-
template: "\n <div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let article of articles\">\n <co-article-tile\n [imageData]=\"
|
|
2899
|
+
template: "\n <div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let article of articles\">\n <co-article-tile\n [imageData]=\"imageData\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [hasCartButton]=\"true\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n (cartButtonClick)=\"handleAddToCartClick(article)\"\n (configureButtonClick)=\"handleContentClick(article)\"\n (threeDButtonClick)=\"handleThreeDButtonClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n </div>\n ",
|
|
2844
2900
|
styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row;flex:1;min-width:25%}.article-wrapper ::ng-deep co-tile{transition:all .14s ease-out;border:1px solid transparent;padding:10px 20px;display:flex;flex-direction:column;color:#171721;justify-content:space-between}.article-wrapper ::ng-deep co-tile .price{display:block}.article-wrapper ::ng-deep co-tile .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;height:30px}.article-wrapper ::ng-deep co-tile .tile-bottom{display:flex;flex-direction:column;grid-gap:5px;gap:5px}.article-wrapper ::ng-deep co-tile:hover{border:1px solid #DCE4EA}.article-wrapper ::ng-deep co-tile .tile-extra-bottom co-button co-icon{width:24px;height:24px}.article-wrapper ::ng-deep co-tile .tile-extra-bottom co-button co-icon svg [fill]{fill:#fff}.article-wrapper ::ng-deep co-tile.small{max-width:189px;width:100%;height:100%;cursor:pointer}.article-wrapper ::ng-deep co-tile.small:hover .tile-bottom .left-buttons{margin:0!important}.article-wrapper ::ng-deep co-tile.small .tile-wrapper{outline:none!important;padding-bottom:0;overflow:hidden;grid-gap:10px;gap:10px;display:flex;flex-direction:column}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-extra-bottom ::ng-deep co-button.card-button.mini{pointer-events:all;padding:0!important;font-size:0;width:42px;height:42px;text-align:center;margin:0;border-radius:100%;background:#3E7EFF;cursor:pointer;place-content:center;color:#fff}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-extra-bottom ::ng-deep co-button.card-button.mini ::ng-deep co-icon{width:30px;height:30px}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom{outline:none!important;background:transparent!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}\n"]
|
|
2845
2901
|
},] }
|
|
2846
2902
|
];
|