@colijnit/configurator 1.0.13 → 1.0.17
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/builder.d.ts +12 -11
- package/app/components/answers/answer/answer.component.d.ts +0 -1
- package/app/services/configurator.service.d.ts +9 -14
- package/app/services/locator.service.d.ts +4 -0
- package/bundles/colijnit-configurator.umd.js +207 -76
- package/bundles/colijnit-configurator.umd.js.map +1 -1
- package/bundles/colijnit-configurator.umd.min.js +2 -2
- package/bundles/colijnit-configurator.umd.min.js.map +1 -1
- package/colijnit-configurator.d.ts +6 -7
- package/colijnit-configurator.metadata.json +1 -1
- package/esm2015/app/builder.js +67 -25
- package/esm2015/app/components/answers/answer/answer.component.js +26 -17
- package/esm2015/app/components/answers/answers.component.js +16 -13
- package/esm2015/app/components/selections/selections.component.js +45 -25
- package/esm2015/app/services/configurator.service.js +36 -21
- package/esm2015/app/services/image-cache.service.js +3 -1
- package/esm2015/app/services/locator.service.js +10 -0
- package/esm2015/colijnit-configurator.js +7 -8
- package/esm2015/public_api.js +2 -1
- package/esm5/app/builder.js +116 -34
- package/esm5/app/components/answers/answer/answer.component.js +20 -10
- package/esm5/app/components/answers/answers.component.js +3 -3
- package/esm5/app/components/selections/selections.component.js +4 -4
- package/esm5/app/services/configurator.service.js +55 -22
- package/esm5/app/services/image-cache.service.js +3 -1
- package/esm5/app/services/locator.service.js +13 -0
- package/esm5/colijnit-configurator.js +7 -8
- package/esm5/public_api.js +2 -1
- package/fesm2015/colijnit-configurator.js +192 -96
- package/fesm2015/colijnit-configurator.js.map +1 -1
- package/fesm5/colijnit-configurator.js +203 -68
- package/fesm5/colijnit-configurator.js.map +1 -1
- package/package.json +2 -2
- package/public_api.d.ts +1 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from 'tslib';
|
|
2
|
-
import { Mesh, ObjectLoader, Camera, Group, TextureLoader, RepeatWrapping, Object3D, Box3, Vector3, Vector2, Euler, Quaternion, Color, Texture, sRGBEncoding, MeshPhongMaterial, MeshStandardMaterial } from 'three';
|
|
2
|
+
import { Mesh, ObjectLoader, Camera, Group, TextureLoader, RepeatWrapping, Object3D, Box3, Vector3, Vector2, Euler, Quaternion, Color, Texture, sRGBEncoding, MeshPhongMaterial, MeshStandardMaterial, Scene } from 'three';
|
|
3
|
+
import { Options } from '@colijnit/configuratorapi/build/model/options';
|
|
3
4
|
import { DecoNode } from '@colijnit/configuratorapi/build/model/deco-node';
|
|
4
5
|
import { BusinessObjectFactory } from '@colijnit/configuratorapi/build/service/business-object-factory';
|
|
5
6
|
import { Selection } from '@colijnit/configuratorapi/build/model/selection';
|
|
@@ -8,8 +9,11 @@ import axios from 'axios';
|
|
|
8
9
|
import { DecoNodeKind } from '@colijnit/configuratorapi/build/enum/deco-node-kind.enum';
|
|
9
10
|
import * as JSZip from 'jszip';
|
|
10
11
|
import { Article } from '@colijnit/configuratorapi/build/model/article';
|
|
11
|
-
import { ɵɵdefineInjectable,
|
|
12
|
+
import { Injectable, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, EventEmitter, Input, Output, Component, Directive, ElementRef, NgModule } from '@angular/core';
|
|
12
13
|
import { Configurator } from '@colijnit/configuratorapi/build/configurator';
|
|
14
|
+
import { notNill } from '@colijnit/configuratorapi/build/utils/function/not-nill.function';
|
|
15
|
+
import { NodeType } from '@colijnit/configuratorapi/build/enum/node-type.enum';
|
|
16
|
+
import { isNill } from '@colijnit/configuratorapi/build/utils/function/is-nill.function';
|
|
13
17
|
import { BehaviorSubject } from 'rxjs';
|
|
14
18
|
import { CommonModule } from '@angular/common';
|
|
15
19
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
@@ -1080,21 +1084,22 @@ class VariationHelper {
|
|
|
1080
1084
|
}
|
|
1081
1085
|
}
|
|
1082
1086
|
|
|
1087
|
+
let ServiceLocator = class ServiceLocator {
|
|
1088
|
+
};
|
|
1089
|
+
ServiceLocator.injector = undefined;
|
|
1090
|
+
ServiceLocator = __decorate([
|
|
1091
|
+
Injectable()
|
|
1092
|
+
], ServiceLocator);
|
|
1093
|
+
|
|
1083
1094
|
let ConfiguratorService = class ConfiguratorService {
|
|
1084
|
-
constructor() {
|
|
1085
|
-
this.
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
}
|
|
1090
|
-
ngOnDestroy() {
|
|
1091
|
-
this._subs.forEach((subscription) => {
|
|
1092
|
-
subscription.unsubscribe();
|
|
1093
|
-
});
|
|
1095
|
+
constructor(_injector) {
|
|
1096
|
+
this._injector = _injector;
|
|
1097
|
+
if (!ServiceLocator.injector) {
|
|
1098
|
+
ServiceLocator.injector = _injector;
|
|
1099
|
+
}
|
|
1094
1100
|
}
|
|
1095
1101
|
initApi(options) {
|
|
1096
1102
|
this._configuratorApi = new Configurator(options);
|
|
1097
|
-
this._subs.push(this._configuratorApi.selectionsReceived.subscribe(selections => this.selectionsReceived.next(selections)), this._configuratorApi.answersReceived.subscribe(answers => this.answersReceived.next(answers)), this._configuratorApi.questionReceived.subscribe(question => this.questionReceived.next(question)));
|
|
1098
1103
|
}
|
|
1099
1104
|
initNodeInstance(goodId) {
|
|
1100
1105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1116,9 +1121,14 @@ let ConfiguratorService = class ConfiguratorService {
|
|
|
1116
1121
|
return yield this._configuratorApi.getArticleQuickSel(goodId, showLoader);
|
|
1117
1122
|
});
|
|
1118
1123
|
}
|
|
1119
|
-
getSelections(showLoader = false) {
|
|
1124
|
+
getSelections(showLoader = false, publicationCode = 2) {
|
|
1120
1125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1121
|
-
|
|
1126
|
+
const selections = yield this._configuratorApi.getSelections(showLoader);
|
|
1127
|
+
selections.resultObjects.filter((s) => {
|
|
1128
|
+
(isNill(s.hierarchicalPublicationCode) || ((s.hierarchicalPublicationCode & publicationCode) > 0)) && ((s.nodeType === NodeType.Question && (((s.questionPublicationCode & publicationCode) > 0) || isNill(s.questionPublicationCode))) ||
|
|
1129
|
+
(s.nodeType === NodeType.Answer && (((s.answerPublicationCode & publicationCode) > 0) || isNill(s.answerPublicationCode))));
|
|
1130
|
+
});
|
|
1131
|
+
return selections;
|
|
1122
1132
|
});
|
|
1123
1133
|
}
|
|
1124
1134
|
getDecos(showLoader = false) {
|
|
@@ -1126,9 +1136,15 @@ let ConfiguratorService = class ConfiguratorService {
|
|
|
1126
1136
|
return yield this._configuratorApi.getDecos(showLoader);
|
|
1127
1137
|
});
|
|
1128
1138
|
}
|
|
1129
|
-
getQuestionAndAnswers(showLoader = false) {
|
|
1139
|
+
getQuestionAndAnswers(showLoader = false, publicationCode = 2) {
|
|
1130
1140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1131
|
-
|
|
1141
|
+
const questionAndAnswers = yield this._configuratorApi.getQuestionAndAnswers(showLoader);
|
|
1142
|
+
questionAndAnswers.answers.filter((answer) => {
|
|
1143
|
+
(notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & publicationCode) === 0) ||
|
|
1144
|
+
(answer.type === NodeType.Question && (answer.questionPublicationCode & publicationCode) === 0 && notNill(answer.questionPublicationCode)) ||
|
|
1145
|
+
(answer.type === NodeType.Answer && (answer.publicationCode & publicationCode) === 0 && notNill(answer.publicationCode));
|
|
1146
|
+
});
|
|
1147
|
+
return questionAndAnswers;
|
|
1132
1148
|
});
|
|
1133
1149
|
}
|
|
1134
1150
|
getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
|
|
@@ -1140,13 +1156,20 @@ let ConfiguratorService = class ConfiguratorService {
|
|
|
1140
1156
|
});
|
|
1141
1157
|
}
|
|
1142
1158
|
selectSelection(selection, showLoader = false) {
|
|
1143
|
-
this
|
|
1159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1160
|
+
return yield this._configuratorApi.selectSelection(selection, showLoader);
|
|
1161
|
+
});
|
|
1144
1162
|
}
|
|
1145
1163
|
selectAnswer(answer, showLoader = false) {
|
|
1146
|
-
this
|
|
1164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1165
|
+
return yield this._configuratorApi.selectAnswer(answer, showLoader);
|
|
1166
|
+
});
|
|
1147
1167
|
}
|
|
1148
1168
|
};
|
|
1149
|
-
ConfiguratorService
|
|
1169
|
+
ConfiguratorService.ctorParameters = () => [
|
|
1170
|
+
{ type: Injector }
|
|
1171
|
+
];
|
|
1172
|
+
ConfiguratorService.ɵprov = ɵɵdefineInjectable({ factory: function ConfiguratorService_Factory() { return new ConfiguratorService(ɵɵinject(INJECTOR)); }, token: ConfiguratorService, providedIn: "root" });
|
|
1150
1173
|
ConfiguratorService = __decorate([
|
|
1151
1174
|
Injectable({
|
|
1152
1175
|
providedIn: 'root'
|
|
@@ -1154,52 +1177,56 @@ ConfiguratorService = __decorate([
|
|
|
1154
1177
|
], ConfiguratorService);
|
|
1155
1178
|
|
|
1156
1179
|
let Builder = class Builder {
|
|
1157
|
-
constructor(
|
|
1158
|
-
this._configuratorService = _configuratorService;
|
|
1180
|
+
constructor(scene, options, useInAngular) {
|
|
1159
1181
|
this.selectionsReceived = new BehaviorSubject([]);
|
|
1160
1182
|
this.answersReceived = new BehaviorSubject([]);
|
|
1161
|
-
this.
|
|
1183
|
+
this.modelLoaded = new BehaviorSubject(null);
|
|
1162
1184
|
this._selections = [];
|
|
1185
|
+
this._answers = [];
|
|
1163
1186
|
this._decos = [];
|
|
1164
1187
|
this._placedAdjustables = [];
|
|
1165
1188
|
this._placedAddables = [];
|
|
1166
1189
|
this._adjustables = [];
|
|
1167
1190
|
this._addables = [];
|
|
1168
1191
|
this._articleCache = new Map();
|
|
1169
|
-
this._subs = [];
|
|
1170
1192
|
this._boFactory = new BusinessObjectFactory();
|
|
1171
1193
|
this._threedUtils = new ThreedUtils();
|
|
1172
1194
|
this._variationHelper = new VariationHelper();
|
|
1173
|
-
this._subs.push(this._configuratorService.selectionsReceived.subscribe(selections => this.selectionsReceived.next(selections)), this._configuratorService.answersReceived.subscribe(answers => this.answersReceived.next(answers)), this._configuratorService.questionReceived.subscribe(question => this.questionReceived.next(question)));
|
|
1174
|
-
}
|
|
1175
|
-
init(scene, options) {
|
|
1176
1195
|
if (!scene) {
|
|
1177
1196
|
throw 'No scene object provided!';
|
|
1178
1197
|
}
|
|
1179
1198
|
if (!options) {
|
|
1180
1199
|
throw 'No connection options provided!';
|
|
1181
1200
|
}
|
|
1182
|
-
if (
|
|
1183
|
-
this._configuratorService =
|
|
1201
|
+
if (useInAngular) {
|
|
1202
|
+
this._configuratorService = ServiceLocator.injector.get(ConfiguratorService);
|
|
1203
|
+
}
|
|
1204
|
+
else {
|
|
1205
|
+
this._configuratorService = new ConfiguratorService(undefined);
|
|
1184
1206
|
}
|
|
1185
1207
|
this._configuratorService.initApi(options);
|
|
1186
1208
|
this._scene = scene;
|
|
1187
1209
|
}
|
|
1188
|
-
buildModel(
|
|
1210
|
+
buildModel(sku, instanceId, goodId) {
|
|
1189
1211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1190
|
-
if (!this._scene
|
|
1212
|
+
if (!this._scene) {
|
|
1191
1213
|
return;
|
|
1192
1214
|
}
|
|
1193
1215
|
try {
|
|
1194
|
-
yield this.
|
|
1216
|
+
yield this._setInstanceId(sku, instanceId, goodId);
|
|
1217
|
+
yield this._prepareConfiguration(this._sku, this._goodId);
|
|
1195
1218
|
if (this._source) {
|
|
1196
|
-
yield this._configuratorService.setInstanceToConfigure(
|
|
1219
|
+
yield this._configuratorService.setInstanceToConfigure(this._instanceId);
|
|
1197
1220
|
const promises = [];
|
|
1198
|
-
promises.push(this.
|
|
1221
|
+
promises.push(this.getQuestionAndAnswers());
|
|
1222
|
+
promises.push(this._getSelections(this._instanceId));
|
|
1199
1223
|
promises.push(this._getDecos());
|
|
1200
1224
|
yield Promise.all(promises);
|
|
1225
|
+
if (this._answers.length > 0) {
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1201
1228
|
this._linkSelectionsAndDecos();
|
|
1202
|
-
return this._build(
|
|
1229
|
+
return this._build(this._instanceId);
|
|
1203
1230
|
}
|
|
1204
1231
|
else {
|
|
1205
1232
|
throw 'GLB source not found!';
|
|
@@ -1218,15 +1245,46 @@ let Builder = class Builder {
|
|
|
1218
1245
|
this._variationHelper.clearCache();
|
|
1219
1246
|
}
|
|
1220
1247
|
selectSelection(selection) {
|
|
1221
|
-
this
|
|
1248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1249
|
+
yield this._configuratorService.selectSelection(selection, false);
|
|
1250
|
+
this.getQuestionAndAnswers();
|
|
1251
|
+
});
|
|
1222
1252
|
}
|
|
1223
|
-
getQuestionAndAnswers() {
|
|
1253
|
+
getQuestionAndAnswers(publicationCode) {
|
|
1224
1254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1225
|
-
|
|
1255
|
+
const questionsAndAnswers = yield this._configuratorService.getQuestionAndAnswers(false, publicationCode);
|
|
1256
|
+
this._answers = questionsAndAnswers.answers;
|
|
1257
|
+
this.answersReceived.next(questionsAndAnswers.answers);
|
|
1226
1258
|
});
|
|
1227
1259
|
}
|
|
1228
1260
|
selectAnswer(answer) {
|
|
1229
|
-
this
|
|
1261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1262
|
+
yield this._configuratorService.selectAnswer(answer, false);
|
|
1263
|
+
this.modelLoaded.next(yield this.buildModel());
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
_setInstanceId(sku, instanceId, goodId) {
|
|
1267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1268
|
+
if (!instanceId && !this._instanceId) {
|
|
1269
|
+
if (!goodId) {
|
|
1270
|
+
goodId = yield this._getGoodIdFromSku(sku);
|
|
1271
|
+
}
|
|
1272
|
+
this._goodId = goodId;
|
|
1273
|
+
const result = yield this.initNodeInstance(this._goodId);
|
|
1274
|
+
if (result && result.resultObject) {
|
|
1275
|
+
this._instanceId = result.resultObject;
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
throw 'Failed to initialize node instance';
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
else if (!this._instanceId) {
|
|
1282
|
+
this._instanceId = instanceId;
|
|
1283
|
+
}
|
|
1284
|
+
if (!this._sku) {
|
|
1285
|
+
this._sku = sku;
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1230
1288
|
}
|
|
1231
1289
|
_prepareConfiguration(sku, goodId) {
|
|
1232
1290
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1487,13 +1545,15 @@ let Builder = class Builder {
|
|
|
1487
1545
|
return article;
|
|
1488
1546
|
});
|
|
1489
1547
|
}
|
|
1490
|
-
_getSelections(instanceId) {
|
|
1548
|
+
_getSelections(instanceId, publicationCode) {
|
|
1491
1549
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1492
|
-
this._selections
|
|
1493
|
-
const selectionResponse = yield this._configuratorService.getSelections(false);
|
|
1550
|
+
this._selections = [];
|
|
1551
|
+
const selectionResponse = yield this._configuratorService.getSelections(false, publicationCode);
|
|
1494
1552
|
if (selectionResponse.resultObjects && selectionResponse.resultObjects.length > 0) {
|
|
1495
1553
|
this._selections = this._boFactory.makeBOArrayFromRawBackendDataArray(Selection, selectionResponse.resultObjects);
|
|
1496
1554
|
this._selections.forEach(s => s.instanceId = instanceId);
|
|
1555
|
+
// const filtered: Selection[] = this._selections.filter(s => s.nodeType !== NodeType.Article && s.presentationLevel === 1);
|
|
1556
|
+
this.selectionsReceived.next(this._selections);
|
|
1497
1557
|
}
|
|
1498
1558
|
else {
|
|
1499
1559
|
throw 'No selections found!';
|
|
@@ -1502,7 +1562,7 @@ let Builder = class Builder {
|
|
|
1502
1562
|
}
|
|
1503
1563
|
_getDecos() {
|
|
1504
1564
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1505
|
-
this._decos
|
|
1565
|
+
this._decos = [];
|
|
1506
1566
|
const decosResponse = yield this._configuratorService.getDecos(false);
|
|
1507
1567
|
if (decosResponse.resultObjects && decosResponse.resultObjects.length > 0) {
|
|
1508
1568
|
this._decos = this._boFactory.makeBOArrayFromRawBackendDataArray(DecoNode, decosResponse.resultObjects);
|
|
@@ -1567,7 +1627,9 @@ let Builder = class Builder {
|
|
|
1567
1627
|
}
|
|
1568
1628
|
};
|
|
1569
1629
|
Builder.ctorParameters = () => [
|
|
1570
|
-
{ type:
|
|
1630
|
+
{ type: Scene },
|
|
1631
|
+
{ type: Options },
|
|
1632
|
+
{ type: Boolean }
|
|
1571
1633
|
];
|
|
1572
1634
|
Builder = __decorate([
|
|
1573
1635
|
Injectable()
|
|
@@ -1592,21 +1654,24 @@ AnswersComponent = __decorate([
|
|
|
1592
1654
|
Component({
|
|
1593
1655
|
selector: "answers",
|
|
1594
1656
|
template: `
|
|
1595
|
-
<
|
|
1596
|
-
<div class="answers-
|
|
1657
|
+
<div class="ione-configurator">
|
|
1658
|
+
<div class="rp-answers-slideout">
|
|
1597
1659
|
<h2 class="answers-title" [textContent]="selectionTitle"></h2>
|
|
1598
|
-
<
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1660
|
+
<div class="answers-container" visibilityObserverMaster>
|
|
1661
|
+
<answer *ngFor="let answer of answers"
|
|
1662
|
+
(click)="answerClick.emit(answer)"
|
|
1663
|
+
[answer]="answer"
|
|
1664
|
+
visibilityObserver
|
|
1665
|
+
#intersection="intersection"
|
|
1666
|
+
[observerEnabled]="true"
|
|
1667
|
+
[showing]="intersection.isIntersecting"
|
|
1668
|
+
></answer>
|
|
1669
|
+
</div>
|
|
1670
|
+
|
|
1606
1671
|
</div>
|
|
1607
|
-
</
|
|
1672
|
+
</div>
|
|
1608
1673
|
`,
|
|
1609
|
-
styles: ["
|
|
1674
|
+
styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]
|
|
1610
1675
|
})
|
|
1611
1676
|
], AnswersComponent);
|
|
1612
1677
|
|
|
@@ -1645,6 +1710,8 @@ let ImageCacheService = ImageCacheService_1 = class ImageCacheService {
|
|
|
1645
1710
|
const base64 = ImageCacheService_1._handleResponseData(includeMimeType, thumb, responseData);
|
|
1646
1711
|
this._imageCache.set(object.nodeId, base64);
|
|
1647
1712
|
resolve(base64);
|
|
1713
|
+
}).catch(() => {
|
|
1714
|
+
reject();
|
|
1648
1715
|
});
|
|
1649
1716
|
}
|
|
1650
1717
|
else {
|
|
@@ -1670,19 +1737,23 @@ ImageCacheService = ImageCacheService_1 = __decorate([
|
|
|
1670
1737
|
let AnswerComponent = class AnswerComponent {
|
|
1671
1738
|
constructor(_imageCacheService) {
|
|
1672
1739
|
this._imageCacheService = _imageCacheService;
|
|
1673
|
-
this.thumbnailLoaded = false;
|
|
1674
1740
|
}
|
|
1675
1741
|
set showing(value) {
|
|
1676
|
-
|
|
1742
|
+
this.answer.imageData = '';
|
|
1743
|
+
if (value && this.answer.answer !== 'Skip / Cancel') {
|
|
1677
1744
|
this._loadThumbnail(this.answer);
|
|
1678
1745
|
}
|
|
1746
|
+
else {
|
|
1747
|
+
this.answer.imageData = null;
|
|
1748
|
+
}
|
|
1679
1749
|
}
|
|
1680
1750
|
ngOnInit() {
|
|
1681
1751
|
}
|
|
1682
1752
|
_loadThumbnail(answer) {
|
|
1683
|
-
this
|
|
1684
|
-
answer.
|
|
1685
|
-
|
|
1753
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1754
|
+
yield this._imageCacheService.getImageForSelectionOrAnswer(answer).then((imageSrc) => {
|
|
1755
|
+
answer.imageData = imageSrc === "" ? null : imageSrc;
|
|
1756
|
+
});
|
|
1686
1757
|
});
|
|
1687
1758
|
}
|
|
1688
1759
|
};
|
|
@@ -1699,17 +1770,22 @@ AnswerComponent = __decorate([
|
|
|
1699
1770
|
Component({
|
|
1700
1771
|
selector: 'answer',
|
|
1701
1772
|
template: `
|
|
1702
|
-
<
|
|
1703
|
-
<div class="
|
|
1704
|
-
<div class="
|
|
1705
|
-
<
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
<div class="answer"
|
|
1773
|
+
<div class="ione-configurator">
|
|
1774
|
+
<div class="answer-wrapper">
|
|
1775
|
+
<div class="answer-content" @answerAppear>
|
|
1776
|
+
<div class="answer-thumbnail">
|
|
1777
|
+
<rp-loader *ngIf="answer.imageData === ''"></rp-loader>
|
|
1778
|
+
<img *ngIf="answer.imageData !== '' && answer.imageData !== null" class="answer-img" [src]="answer.imageData">
|
|
1779
|
+
</div>
|
|
1780
|
+
<div class="answer-title-wrapper">
|
|
1781
|
+
<span class="answer-title" [textContent]="answer.commercialAnswer"></span>
|
|
1782
|
+
</div>
|
|
1783
|
+
<div class="price">
|
|
1784
|
+
<span class="price-value"></span>
|
|
1785
|
+
</div>
|
|
1710
1786
|
</div>
|
|
1711
1787
|
</div>
|
|
1712
|
-
</
|
|
1788
|
+
</div>
|
|
1713
1789
|
`,
|
|
1714
1790
|
animations: [
|
|
1715
1791
|
trigger('answerAppear', [
|
|
@@ -1718,7 +1794,7 @@ AnswerComponent = __decorate([
|
|
|
1718
1794
|
transition('void <=> *', animate(500))
|
|
1719
1795
|
])
|
|
1720
1796
|
],
|
|
1721
|
-
styles: [".answer{font-size:12px;position:relative;overflow:hidden;cursor:pointer}
|
|
1797
|
+
styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]
|
|
1722
1798
|
})
|
|
1723
1799
|
], AnswerComponent);
|
|
1724
1800
|
|
|
@@ -1913,7 +1989,7 @@ let SelectionsComponent = class SelectionsComponent {
|
|
|
1913
1989
|
if (this.selectionViewModels.length > 0) {
|
|
1914
1990
|
this.selectionViewModels.forEach((viewModel) => __awaiter(this, void 0, void 0, function* () {
|
|
1915
1991
|
yield this._imageCacheService.getImageForSelectionOrAnswer(viewModel.selection).then((imageSrc) => {
|
|
1916
|
-
viewModel.thumbnail = imageSrc;
|
|
1992
|
+
viewModel.thumbnail = imageSrc === "" ? null : imageSrc;
|
|
1917
1993
|
});
|
|
1918
1994
|
}));
|
|
1919
1995
|
}
|
|
@@ -1949,33 +2025,53 @@ SelectionsComponent = __decorate([
|
|
|
1949
2025
|
Component({
|
|
1950
2026
|
selector: "selections",
|
|
1951
2027
|
template: `
|
|
1952
|
-
<
|
|
1953
|
-
<div class="selections-
|
|
1954
|
-
<
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
<div class="
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
>
|
|
1970
|
-
<
|
|
1971
|
-
<
|
|
2028
|
+
<div class="ione-configurator">
|
|
2029
|
+
<div class="rp-selections-summary">
|
|
2030
|
+
<header class="drawer__header">
|
|
2031
|
+
<h2 class="mat-title" [textContent]="'Configuratie'"></h2>
|
|
2032
|
+
<!--<button>-->
|
|
2033
|
+
<!---->
|
|
2034
|
+
<!--</button>-->
|
|
2035
|
+
</header>
|
|
2036
|
+
<div class="selections-content">
|
|
2037
|
+
<ng-container *ngFor="let selectionViewModel of selectionViewModels">
|
|
2038
|
+
|
|
2039
|
+
<div class="co-summary-line" (click)="selectSelection(selectionViewModel.selection, $event)">
|
|
2040
|
+
<div class="selection-thumbnail">
|
|
2041
|
+
<rp-loader *ngIf="selectionViewModel.thumbnail === ''"></rp-loader>
|
|
2042
|
+
<img visibilityObserver *ngIf="selectionViewModel.thumbnail !== '' && selectionViewModel.thumbnail !== null" class="selection-img" [src]="selectionViewModel.thumbnail">
|
|
2043
|
+
</div>
|
|
2044
|
+
<div class="titles">
|
|
2045
|
+
<div class="title-wrapper">
|
|
2046
|
+
<label class="question" [textContent]="selectionViewModel.selection.question"></label>
|
|
2047
|
+
<span class="answer" [textContent]="selectionViewModel.selection.answer"></span>
|
|
2048
|
+
<div *ngIf="selectionViewModel.children.length > 0 && selectionViewModel.expanded" @showHideChildren>
|
|
2049
|
+
<div class="child-selection" *ngFor="let selection of selectionViewModel.children"
|
|
2050
|
+
(click)="selectSelection(selection, $event)"
|
|
2051
|
+
>
|
|
2052
|
+
<label class="question" [textContent]="selection.commercialQuestion"></label>
|
|
2053
|
+
<span class="answer" [textContent]="selection.answer"></span>
|
|
2054
|
+
</div>
|
|
2055
|
+
</div>
|
|
2056
|
+
</div>
|
|
2057
|
+
</div>
|
|
2058
|
+
|
|
2059
|
+
<div class="price-wrapper">
|
|
2060
|
+
<span class="price-value"></span>
|
|
2061
|
+
</div>
|
|
2062
|
+
|
|
2063
|
+
<div class="collapse-wrapper">
|
|
2064
|
+
<div class="collapse-content">
|
|
2065
|
+
<div class="collapse-handle" [class.expanded]="selectionViewModel.expanded"
|
|
2066
|
+
*ngIf="selectionViewModel.children.length > 0" (click)="expandClicked(selectionViewModel, $event)"></div>
|
|
1972
2067
|
</div>
|
|
1973
2068
|
</div>
|
|
1974
2069
|
</div>
|
|
1975
|
-
|
|
2070
|
+
|
|
2071
|
+
</ng-container>
|
|
1976
2072
|
</div>
|
|
1977
2073
|
</div>
|
|
1978
|
-
</
|
|
2074
|
+
</div>
|
|
1979
2075
|
`,
|
|
1980
2076
|
animations: [
|
|
1981
2077
|
trigger('showHideChildren', [
|
|
@@ -1984,7 +2080,7 @@ SelectionsComponent = __decorate([
|
|
|
1984
2080
|
transition('void <=> *', animate(200))
|
|
1985
2081
|
])
|
|
1986
2082
|
],
|
|
1987
|
-
styles: ["
|
|
2083
|
+
styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]
|
|
1988
2084
|
})
|
|
1989
2085
|
], SelectionsComponent);
|
|
1990
2086
|
|
|
@@ -2009,5 +2105,5 @@ SelectionsModule = __decorate([
|
|
|
2009
2105
|
* Generated bundle index. Do not edit.
|
|
2010
2106
|
*/
|
|
2011
2107
|
|
|
2012
|
-
export { AnswersComponent, AnswersModule, Builder, SelectionsComponent, SelectionsModule,
|
|
2108
|
+
export { AnswersComponent, AnswersModule, Builder, ConfiguratorService, SelectionsComponent, SelectionsModule, SharedModule as ɵa, LoaderComponent as ɵb, AnswerComponent as ɵc, ImageCacheService as ɵd, VisibilityObserverDirective as ɵe, VisibilityObserverMasterDirective as ɵf };
|
|
2013
2109
|
//# sourceMappingURL=colijnit-configurator.js.map
|