@veloceapps/sdk 8.0.0-78 → 8.0.0-79

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. package/README.md +0 -1
  2. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +5 -5
  3. package/esm2020/core/modules/configuration/services/configuration.service.mjs +3 -3
  4. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +6 -6
  5. package/esm2020/src/flow-routing.module.mjs +1 -18
  6. package/esm2020/src/pages/product/product.component.mjs +2 -3
  7. package/esm2020/src/pages/remote/remote.component.mjs +5 -6
  8. package/fesm2015/veloceapps-sdk-core.mjs +16 -15
  9. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  10. package/fesm2015/veloceapps-sdk.mjs +8 -160
  11. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  12. package/fesm2020/veloceapps-sdk-core.mjs +9 -9
  13. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  14. package/fesm2020/veloceapps-sdk.mjs +6 -161
  15. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  16. package/package.json +1 -9
  17. package/src/flow-routing.module.d.ts +6 -7
  18. package/esm2020/runtime/components/component-preview/component-preview.component.mjs +0 -125
  19. package/esm2020/runtime/components/index.mjs +0 -5
  20. package/esm2020/runtime/components/section-renderer/section-renderer.component.mjs +0 -67
  21. package/esm2020/runtime/components/ui-runtime/runtime.component.mjs +0 -440
  22. package/esm2020/runtime/components/ui-runtime-preview/runtime-preview.component.mjs +0 -108
  23. package/esm2020/runtime/execution/components/children-placeholder/children-placeholder.component.mjs +0 -60
  24. package/esm2020/runtime/execution/components/context-provider/context-provider.component.mjs +0 -39
  25. package/esm2020/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.mjs +0 -67
  26. package/esm2020/runtime/execution/components/federated/federated.component.mjs +0 -74
  27. package/esm2020/runtime/execution/components/velo-attribute/velo-attribute.component.mjs +0 -60
  28. package/esm2020/runtime/execution/components/velo-multiselect/velo-multiselect.component.mjs +0 -130
  29. package/esm2020/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.mjs +0 -72
  30. package/esm2020/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.mjs +0 -97
  31. package/esm2020/runtime/execution/components/velo-port-radio/velo-port-radio.component.mjs +0 -142
  32. package/esm2020/runtime/execution/components/velo-type/velo-type.component.mjs +0 -119
  33. package/esm2020/runtime/execution/directives/section-script.directive.mjs +0 -247
  34. package/esm2020/runtime/execution/directives/sf-query.directive.mjs +0 -35
  35. package/esm2020/runtime/execution/directives/velo-attribute.directive.mjs +0 -88
  36. package/esm2020/runtime/execution/directives/velo-port.directive.mjs +0 -376
  37. package/esm2020/runtime/execution/directives/vl-approval.directive.mjs +0 -23
  38. package/esm2020/runtime/execution/directives/vl-document-attachments.directive.mjs +0 -36
  39. package/esm2020/runtime/execution/directives/vl-document-templates.directive.mjs +0 -60
  40. package/esm2020/runtime/execution/directives/vl-quote.directive.mjs +0 -42
  41. package/esm2020/runtime/execution/directives/vl-ramp.directive.mjs +0 -55
  42. package/esm2020/runtime/execution/runtime-execution.module.mjs +0 -133
  43. package/esm2020/runtime/execution/utils/federated.util.mjs +0 -32
  44. package/esm2020/runtime/index.mjs +0 -5
  45. package/esm2020/runtime/runtime.module.mjs +0 -74
  46. package/esm2020/runtime/services/cart.service.mjs +0 -29
  47. package/esm2020/runtime/services/collapsible-state.service.mjs +0 -34
  48. package/esm2020/runtime/services/configuration.service.mjs +0 -119
  49. package/esm2020/runtime/services/current-state.service.mjs +0 -17
  50. package/esm2020/runtime/services/form-scope.service.mjs +0 -30
  51. package/esm2020/runtime/services/index.mjs +0 -4
  52. package/esm2020/runtime/services/product-model-cache.service.mjs +0 -31
  53. package/esm2020/runtime/services/runtime-context.service.mjs +0 -60
  54. package/esm2020/runtime/services/runtime-form.service.mjs +0 -219
  55. package/esm2020/runtime/services/runtime.service.mjs +0 -115
  56. package/esm2020/runtime/services/section-helper.service.mjs +0 -27
  57. package/esm2020/runtime/services/section-scope.service.mjs +0 -36
  58. package/esm2020/runtime/services/section-store.service.mjs +0 -22
  59. package/esm2020/runtime/services/section.service.mjs +0 -117
  60. package/esm2020/runtime/types/bound-data.types.mjs +0 -7
  61. package/esm2020/runtime/types/index.mjs +0 -3
  62. package/esm2020/runtime/types/quote-states.types.mjs +0 -2
  63. package/esm2020/runtime/types/runtime.types.mjs +0 -2
  64. package/esm2020/runtime/types/script-registry.types.mjs +0 -51
  65. package/esm2020/runtime/utils/line-item.util.mjs +0 -270
  66. package/esm2020/runtime/utils/section.utils.mjs +0 -26
  67. package/esm2020/runtime/utils/sections-binder.helper.mjs +0 -105
  68. package/esm2020/runtime/veloceapps-sdk-runtime.mjs +0 -5
  69. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +0 -137
  70. package/esm2020/src/pages/legacy-product/legacy-product.module.mjs +0 -19
  71. package/fesm2015/veloceapps-sdk-runtime.mjs +0 -3770
  72. package/fesm2015/veloceapps-sdk-runtime.mjs.map +0 -1
  73. package/fesm2020/veloceapps-sdk-runtime.mjs +0 -3767
  74. package/fesm2020/veloceapps-sdk-runtime.mjs.map +0 -1
  75. package/runtime/README.md +0 -5
  76. package/runtime/components/component-preview/component-preview.component.d.ts +0 -27
  77. package/runtime/components/index.d.ts +0 -4
  78. package/runtime/components/section-renderer/section-renderer.component.d.ts +0 -25
  79. package/runtime/components/ui-runtime/runtime.component.d.ts +0 -53
  80. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +0 -27
  81. package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +0 -30
  82. package/runtime/execution/components/context-provider/context-provider.component.d.ts +0 -14
  83. package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +0 -25
  84. package/runtime/execution/components/federated/federated.component.d.ts +0 -36
  85. package/runtime/execution/components/velo-attribute/velo-attribute.component.d.ts +0 -19
  86. package/runtime/execution/components/velo-multiselect/velo-multiselect.component.d.ts +0 -35
  87. package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +0 -22
  88. package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +0 -22
  89. package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +0 -28
  90. package/runtime/execution/components/velo-type/velo-type.component.d.ts +0 -31
  91. package/runtime/execution/directives/section-script.directive.d.ts +0 -59
  92. package/runtime/execution/directives/sf-query.directive.d.ts +0 -15
  93. package/runtime/execution/directives/velo-attribute.directive.d.ts +0 -26
  94. package/runtime/execution/directives/velo-port.directive.d.ts +0 -74
  95. package/runtime/execution/directives/vl-approval.directive.d.ts +0 -10
  96. package/runtime/execution/directives/vl-document-attachments.directive.d.ts +0 -15
  97. package/runtime/execution/directives/vl-document-templates.directive.d.ts +0 -33
  98. package/runtime/execution/directives/vl-quote.directive.d.ts +0 -14
  99. package/runtime/execution/directives/vl-ramp.directive.d.ts +0 -15
  100. package/runtime/execution/runtime-execution.module.d.ts +0 -25
  101. package/runtime/execution/utils/federated.util.d.ts +0 -6
  102. package/runtime/index.d.ts +0 -4
  103. package/runtime/runtime.module.d.ts +0 -16
  104. package/runtime/services/cart.service.d.ts +0 -15
  105. package/runtime/services/collapsible-state.service.d.ts +0 -15
  106. package/runtime/services/configuration.service.d.ts +0 -20
  107. package/runtime/services/current-state.service.d.ts +0 -8
  108. package/runtime/services/form-scope.service.d.ts +0 -20
  109. package/runtime/services/index.d.ts +0 -3
  110. package/runtime/services/product-model-cache.service.d.ts +0 -14
  111. package/runtime/services/runtime-context.service.d.ts +0 -16
  112. package/runtime/services/runtime-form.service.d.ts +0 -24
  113. package/runtime/services/runtime.service.d.ts +0 -44
  114. package/runtime/services/section-helper.service.d.ts +0 -8
  115. package/runtime/services/section-scope.service.d.ts +0 -14
  116. package/runtime/services/section-store.service.d.ts +0 -11
  117. package/runtime/services/section.service.d.ts +0 -30
  118. package/runtime/types/bound-data.types.d.ts +0 -13
  119. package/runtime/types/index.d.ts +0 -2
  120. package/runtime/types/quote-states.types.d.ts +0 -6
  121. package/runtime/types/runtime.types.d.ts +0 -19
  122. package/runtime/types/script-registry.types.d.ts +0 -13
  123. package/runtime/utils/line-item.util.d.ts +0 -34
  124. package/runtime/utils/section.utils.d.ts +0 -2
  125. package/runtime/utils/sections-binder.helper.d.ts +0 -16
  126. package/src/pages/legacy-product/legacy-product.component.d.ts +0 -37
  127. package/src/pages/legacy-product/legacy-product.module.d.ts +0 -9
@@ -1,3770 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, ViewContainerRef, Component, Input, ViewChild, Inject, EventEmitter, TemplateRef, ChangeDetectionStrategy, Output, Directive, HostBinding, NgModule, ViewChildren, ViewEncapsulation } from '@angular/core';
3
- import * as i4 from '@angular/forms';
4
- import { FormGroup, FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import * as i7 from '@veloceapps/core';
6
- import { EntityUtil, UUID, SectionPathUtil, TypeValidators, ConfigurationMode, RuntimeModel, isLegacyUIDefinition, OrderByPipe, PricingUtils, PagedEntity, CoreModule, SalesforceIdUtils, SearchFilterPipe, ConfigurationContextMode } from '@veloceapps/core';
7
- import * as i2 from '@veloceapps/sdk/core';
8
- import { RuntimeMode, RuntimeStep, SdkCoreModule } from '@veloceapps/sdk/core';
9
- import * as rxjs from 'rxjs';
10
- import { Subject, BehaviorSubject, of, merge, combineLatest } from 'rxjs';
11
- import * as _ from 'lodash';
12
- import { keys, isUndefined, isNull, isString, isDate, set, values } from 'lodash';
13
- import * as rxjsOperators from 'rxjs/operators';
14
- import { map, take, tap, shareReplay, takeUntil } from 'rxjs/operators';
15
- import * as i10 from '@veloceapps/components';
16
- import { ConfirmationComponent, LoaderModule } from '@veloceapps/components';
17
- import * as i1 from '@veloceapps/api';
18
- import { ApiModule } from '@veloceapps/api';
19
- import * as i3 from 'primeng/dynamicdialog';
20
- import { DialogService } from 'primeng/dynamicdialog';
21
- import * as i3$1 from 'primeng/api';
22
- import { MessageService } from 'primeng/api';
23
- import { __awaiter, __decorate } from 'tslib';
24
- import { ScrollingModule as ScrollingModule$1 } from '@angular/cdk-experimental/scrolling';
25
- import { ScrollingModule } from '@angular/cdk/scrolling';
26
- import * as i3$2 from '@angular/common';
27
- import { CurrencyPipe, DOCUMENT, CommonModule, DatePipe } from '@angular/common';
28
- import '@angular/compiler';
29
- import { TemplatePortal } from '@angular/cdk/portal';
30
- import * as i1$1 from '@angular/cdk/overlay';
31
- import * as moment from 'moment';
32
- import { HttpErrorResponse } from '@angular/common/http';
33
-
34
- class CollapsibleStateService {
35
- constructor() {
36
- this._collapsedSections = {}; // By Line Item Id
37
- this.collapseSectionSubject = new Subject();
38
- this.collapseSectionEvent = this.collapseSectionSubject.asObservable();
39
- }
40
- toggleCollapse(sectionId, silently) {
41
- this._collapsedSections[sectionId] = !this.isCollapsedSection(sectionId);
42
- if (!silently) {
43
- this.collapseSectionSubject.next([sectionId, this._collapsedSections[sectionId]]);
44
- }
45
- }
46
- collapse(sectionId) {
47
- this._collapsedSections[sectionId] = true;
48
- }
49
- expand(sectionId) {
50
- this._collapsedSections[sectionId] = false;
51
- }
52
- clearState(sectionId) {
53
- delete this._collapsedSections[sectionId];
54
- }
55
- isCollapsedSection(sectionId) {
56
- return this._collapsedSections[sectionId];
57
- }
58
- }
59
- CollapsibleStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CollapsibleStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
60
- CollapsibleStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CollapsibleStateService });
61
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CollapsibleStateService, decorators: [{
62
- type: Injectable
63
- }], ctorParameters: function () { return []; } });
64
-
65
- class ScriptRegistry {
66
- constructor() {
67
- this.store = new Map();
68
- this.scope = new Map();
69
- }
70
- exists(scriptId) {
71
- const sectionIds = this.store.get(scriptId);
72
- return !EntityUtil.isEmpty(sectionIds);
73
- }
74
- isRegistered(scriptId, sectionId) {
75
- const sectionIds = this.store.get(scriptId);
76
- return !EntityUtil.isEmpty(sectionIds) && (sectionIds === null || sectionIds === void 0 ? void 0 : sectionIds.findIndex(entryId => entryId === sectionId)) !== -1;
77
- }
78
- doRegister(scriptId, sectionId) {
79
- const sectionIds = this.store.get(scriptId);
80
- if (!EntityUtil.isPresent(sectionIds)) {
81
- this.store.set(scriptId, [sectionId]);
82
- }
83
- else if ((sectionIds === null || sectionIds === void 0 ? void 0 : sectionIds.findIndex(entryId => entryId === sectionId)) === -1) {
84
- sectionIds.push(sectionId);
85
- }
86
- }
87
- unRegister(scriptId, sectionId) {
88
- const sectionIds = this.store.get(scriptId);
89
- if (!sectionIds) {
90
- return;
91
- }
92
- const index = sectionIds === null || sectionIds === void 0 ? void 0 : sectionIds.findIndex(entryId => entryId === sectionId);
93
- if (index !== -1) {
94
- sectionIds.splice(index, 1);
95
- // Remove orphan
96
- if (sectionIds.length < 1) {
97
- this.store.delete(scriptId);
98
- }
99
- }
100
- }
101
- hasGlobalForScript(globalId) {
102
- return this.scope.has(globalId);
103
- }
104
- getGlobalForScript(globalId) {
105
- return this.scope.get(globalId);
106
- }
107
- setGlobalForScript(globalId, globalVariable) {
108
- this.scope.set(globalId, globalVariable);
109
- }
110
- removeGlobalForScript(globalId) {
111
- this.scope.delete(globalId);
112
- }
113
- }
114
-
115
- // TODO ALE RENAME TO SESSION SCOPE
116
- class FormScopeService {
117
- constructor() {
118
- this.scriptRegistry = new ScriptRegistry();
119
- this.scriptSessionScope = {};
120
- this.formSubmitSubject = new Subject();
121
- this._form = new FormGroup({});
122
- this.formSubmitEvent = this.formSubmitSubject.asObservable();
123
- }
124
- get form() {
125
- return this._form;
126
- }
127
- set form(value) {
128
- this._form = value;
129
- }
130
- publishFormUpdate(value) {
131
- this.formSubmitSubject.next(value);
132
- }
133
- }
134
- FormScopeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormScopeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
135
- FormScopeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormScopeService });
136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormScopeService, decorators: [{
137
- type: Injectable
138
- }], ctorParameters: function () { return []; } });
139
-
140
- var BoundDataType;
141
- (function (BoundDataType) {
142
- BoundDataType[BoundDataType["TYPE"] = 0] = "TYPE";
143
- BoundDataType[BoundDataType["ATTRIBUTE"] = 1] = "ATTRIBUTE";
144
- BoundDataType[BoundDataType["PORT"] = 2] = "PORT";
145
- })(BoundDataType || (BoundDataType = {}));
146
-
147
- class LineItemPath {
148
- set relativePath(relativePath) {
149
- this._relativePath = relativePath.toLowerCase();
150
- }
151
- get relativePath() {
152
- return this._relativePath;
153
- }
154
- set abstractPath(abstractPath) {
155
- this._abstractPath = abstractPath.toLowerCase();
156
- }
157
- get abstractPath() {
158
- return this._abstractPath || this.path;
159
- }
160
- set relativeAbstractPath(relativeAbstractPath) {
161
- this._relativeAbstractPath = relativeAbstractPath.toLowerCase();
162
- }
163
- constructor(path) {
164
- this._relativePath = '';
165
- this._relativeAbstractPath = '';
166
- this._abstractPath = '';
167
- this.path = path.toLowerCase();
168
- }
169
- isEqualTo(sectionPath) {
170
- if (!sectionPath || !this.path || !sectionPath.path) {
171
- return false;
172
- }
173
- const otherPath = sectionPath.path.toLowerCase();
174
- const isEqual = this.path === otherPath || this._relativePath === otherPath || this._relativeAbstractPath === otherPath;
175
- //TODO ALE SORT OUT SEARCH
176
- if (!isEqual) {
177
- const abstractPathMatch = this._abstractPath === sectionPath.abstractPath.toLowerCase();
178
- const relativePathMatch = this._relativePath
179
- ? this._relativePath === sectionPath.relativePath.toLowerCase()
180
- : false;
181
- const relativeAbstractPathMatch = this._relativeAbstractPath && sectionPath.relativeAbstractPath
182
- ? sectionPath.relativeAbstractPath.toLowerCase() === sectionPath.relativePath.toLowerCase() &&
183
- this._relativeAbstractPath === sectionPath.relativePath.toLowerCase()
184
- : false;
185
- return abstractPathMatch && (relativePathMatch || relativeAbstractPathMatch);
186
- }
187
- return isEqual;
188
- }
189
- }
190
- class LineItemUtil {
191
- static removeDeletedItems(original) {
192
- var _a;
193
- const root = EntityUtil.clone(original);
194
- if (root) {
195
- let items = [root];
196
- for (let i = 0; i < items.length; i++) {
197
- const item = items[i];
198
- item.lineItems = ((_a = item.lineItems) !== null && _a !== void 0 ? _a : []).filter(l => l.actionCode !== 'DELETE');
199
- items = items.concat(item.lineItems);
200
- }
201
- }
202
- return root;
203
- }
204
- static replaceLineItemKeys(rootLineItem) {
205
- const replaceFn = (item) => {
206
- item.id = item.id ? 'DUMMY-' + item.id : item.id;
207
- item.rootId = item.rootId ? 'DUMMY-' + item.rootId : item.rootId;
208
- item.parentId = item.parentId ? 'DUMMY-' + item.parentId : item.parentId;
209
- item.offeringInstanceId = item.offeringInstanceId ? 'DUMMY-' + item.offeringInstanceId : void 0;
210
- item.offeringItemId = item.offeringItemId ? 'DUMMY-' + item.offeringItemId : void 0;
211
- item.rampInstanceId = item.rampInstanceId ? 'DUMMY-' + item.rampInstanceId : void 0;
212
- };
213
- const traverseFn = (lineItem, callbackFn) => {
214
- if (lineItem.lineItems && lineItem.lineItems.length > 0) {
215
- lineItem.lineItems.forEach(childLineItem => {
216
- callbackFn.apply(null, [childLineItem]);
217
- traverseFn.apply(null, [childLineItem, callbackFn]);
218
- });
219
- }
220
- };
221
- replaceFn.apply(null, [rootLineItem]);
222
- // rootLineItem.rootId = rootLineItem.id;
223
- traverseFn.apply(null, [rootLineItem, replaceFn]);
224
- }
225
- static enrichPricingInfo(source, pricingDto) {
226
- var _a;
227
- const result = Object.assign({}, source);
228
- if (pricingDto) {
229
- result.productName = ((_a = pricingDto.properties) === null || _a === void 0 ? void 0 : _a['displayName']) || pricingDto.productName;
230
- result.type = pricingDto.type;
231
- result.rootId = pricingDto.rootId;
232
- result.assetId = pricingDto.assetId;
233
- result.openOrderLineItemId = pricingDto.openOrderLineItemId;
234
- result.activated = pricingDto.activated;
235
- result.actionCode = pricingDto.actionCode;
236
- result.serviceStartDate = pricingDto.serviceStartDate;
237
- result.effectiveDate = pricingDto.effectiveDate;
238
- result.startDate = pricingDto.startDate;
239
- result.endDate = pricingDto.endDate;
240
- result.offeringId = pricingDto.offeringId;
241
- result.offeringItemId = pricingDto.offeringItemId;
242
- result.offeringInstanceId = pricingDto.offeringInstanceId;
243
- result.rampInstanceId = pricingDto.rampInstanceId;
244
- result.planId = pricingDto.planId;
245
- if (!result.chargeItems) {
246
- result.chargeItems = pricingDto.chargeItems;
247
- }
248
- result.chargeGroupItems = [];
249
- }
250
- if (source.lineItems && source.lineItems.length > 0) {
251
- result.lineItems = [];
252
- source.lineItems.forEach((childSource) => {
253
- const childDto = pricingDto && pricingDto.lineItems && pricingDto.lineItems.find(c => childSource.id === c.id);
254
- const childItem = LineItemUtil.enrichPricingInfo(childSource, childDto);
255
- result.lineItems.push(childItem);
256
- });
257
- }
258
- return result;
259
- }
260
- static getLineItemPath(lineItem, rootLineItem) {
261
- let path;
262
- if (!lineItem.parentId) {
263
- path = new LineItemPath('/' + lineItem.type);
264
- path.abstractPath = path.path;
265
- path.relativePath = path.path;
266
- path.relativeAbstractPath = path.path;
267
- }
268
- else {
269
- //TOODO ALE SORT OUT PATENT ITEM
270
- const parentItem = EntityUtil.findByFieldHierarchically('id', lineItem.parentId, [rootLineItem], 'lineItems');
271
- const portType = lineItem.port && (parentItem === null || parentItem === void 0 ? void 0 : parentItem.portDomains[lineItem.port].type);
272
- const parentPath = parentItem && LineItemUtil.getLineItemPath(parentItem, rootLineItem);
273
- if (parentPath) {
274
- path = new LineItemPath(parentPath.path + '/ports/' + lineItem.port + '/' + lineItem.type);
275
- path.abstractPath = parentPath.abstractPath + '/ports/' + (lineItem.port + '/' + portType);
276
- path.relativePath = '/' + lineItem.type;
277
- path.relativeAbstractPath = '/' + portType;
278
- }
279
- else {
280
- throw 'Could not construct line item path';
281
- }
282
- }
283
- return path;
284
- }
285
- static findById(parentId, lineItems) {
286
- return EntityUtil.findByFieldHierarchically('id', parentId, lineItems, 'lineItems');
287
- }
288
- static countAttributeValues(scale, attributeDomain) {
289
- const precision = LineItemUtil.precision(scale);
290
- let count = 0;
291
- attributeDomain.forEach(d => (count += d.max - d.min + precision));
292
- return count;
293
- }
294
- static precision(scale) {
295
- if (!scale) {
296
- return 1;
297
- }
298
- let s = '1';
299
- while (s.length < scale) {
300
- s = '0' + s;
301
- }
302
- return Number('0.' + s);
303
- }
304
- static splitDomainToValues(scale, attributeDomain) {
305
- const precision = this.precision(scale);
306
- let values = [];
307
- attributeDomain.forEach(interval => (values = values.concat(LineItemUtil.splitIntervalToValues(precision, interval))));
308
- return values;
309
- }
310
- static splitIntervalToValues(precision, interval) {
311
- const values = [];
312
- for (let i = interval.min; i <= interval.max; i += precision) {
313
- values.push(i);
314
- }
315
- return values;
316
- }
317
- static findLineItemsByPath(runtimeModel, lineItem, path) {
318
- if (!runtimeModel.isEquals(lineItem.type, path.types[0])) {
319
- return [];
320
- }
321
- let lineItems = [lineItem];
322
- for (let i = 1; i < path.types.length; i++) {
323
- const portName = path.ports[i - 1];
324
- const typeName = path.types[i];
325
- lineItems = LineItemUtil.findLineItemChildren(runtimeModel, lineItems, portName, typeName);
326
- }
327
- return lineItems;
328
- }
329
- static findLineItemChildren(runtimeModel, lineItems, portName, typeName) {
330
- var _a;
331
- const result = [];
332
- for (const lineItem of lineItems) {
333
- for (const childItem of lineItem.lineItems) {
334
- if (((_a = childItem.port) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === portName.toLowerCase() &&
335
- runtimeModel.isEquals(childItem.type, typeName)) {
336
- result.push(childItem);
337
- }
338
- }
339
- }
340
- return result;
341
- }
342
- static findLineItemsByType(runtimeModel, lineItem, typeName) {
343
- const result = [];
344
- let lineItems = [lineItem];
345
- for (let i = 0; i < lineItems.length; i++) {
346
- const lineItem = lineItems[i];
347
- if (runtimeModel.isEquals(lineItem.type, typeName)) {
348
- result.push(lineItem);
349
- }
350
- lineItems = lineItems.concat(lineItem.lineItems);
351
- }
352
- return result;
353
- }
354
- static findLineItemForValue(model, valueOption) {
355
- if (!EntityUtil.isPresent(model) || !EntityUtil.isPresent(model.lineItems)) {
356
- return;
357
- }
358
- return model.lineItems.find(li => li.type && li.type.toLowerCase() === valueOption.toLowerCase());
359
- }
360
- // TODO: add Product typings
361
- static create(product, qty) {
362
- var _a;
363
- return {
364
- id: UUID.UUID(),
365
- type: product.typeName,
366
- name: ((_a = product.properties) === null || _a === void 0 ? void 0 : _a.displayName) || product.name,
367
- productName: product.name,
368
- productId: product.id,
369
- cfgStatus: 'User',
370
- actionCode: 'ADD',
371
- qty: qty || 1,
372
- };
373
- }
374
- static upsert(value, collection) {
375
- const index = collection.findIndex(item => item.id === value.id);
376
- if (index > -1) {
377
- collection[index] = value;
378
- }
379
- else {
380
- collection.push(value);
381
- }
382
- }
383
- static compareSortOrder(a, b) {
384
- const orderA = Number(a.properties['SortOrder']);
385
- const orderB = Number(b.properties['SortOrder']);
386
- if (!orderA && !orderB) {
387
- return LineItemUtil.compareProductName(a, b);
388
- }
389
- if (!orderA) {
390
- return 1;
391
- }
392
- else if (!orderB) {
393
- return -1;
394
- }
395
- const result = orderA - orderB;
396
- if (result === 0) {
397
- return LineItemUtil.compareProductName(a, b);
398
- }
399
- return result;
400
- }
401
- static sort(lineItems) {
402
- if (lineItems) {
403
- lineItems.sort((a, b) => LineItemUtil.compareSortOrder(a, b));
404
- lineItems.forEach(i => LineItemUtil.sort(i.lineItems));
405
- }
406
- }
407
- static compareProductName(a, b) {
408
- var _a, _b;
409
- if (a.productName) {
410
- return ((_a = a.productName) !== null && _a !== void 0 ? _a : '').localeCompare((_b = b.productName) !== null && _b !== void 0 ? _b : '');
411
- }
412
- else if (b.productName) {
413
- return 1;
414
- }
415
- return 0;
416
- }
417
- }
418
-
419
- class SectionsBinderHelper {
420
- static setLineItemsPath(runtimeModel, rootLineItem, sections, sourceSections, filterFn, pricingEnabled) {
421
- const filtered = sections.filter(filterFn);
422
- filtered.forEach(section => {
423
- const path = section.boundData.path;
424
- let foundLineItems;
425
- if (path.relative) {
426
- foundLineItems = LineItemUtil.findLineItemsByType(runtimeModel, rootLineItem, path.types[0]);
427
- }
428
- else {
429
- const remainder = rootLineItem.path ? SectionPathUtil.cut(runtimeModel, path, rootLineItem.path) : undefined;
430
- if (!remainder) {
431
- return [];
432
- }
433
- foundLineItems = LineItemUtil.findLineItemsByPath(runtimeModel, rootLineItem, remainder);
434
- }
435
- if (section.boundData.entityType === BoundDataType[BoundDataType.TYPE]) {
436
- SectionsBinderHelper.bindMatchingLineItems(runtimeModel, foundLineItems, section, sections, sourceSections, pricingEnabled);
437
- }
438
- else if (section.boundData.entityType === BoundDataType[BoundDataType.ATTRIBUTE]) {
439
- foundLineItems = foundLineItems.filter(item => item.attributes &&
440
- item.attributes.findIndex(a => a.name.toLowerCase() === section.boundData.name.toLowerCase()) !== -1);
441
- foundLineItems.forEach(lineItem => {
442
- SectionsBinderHelper.bindLineItem(section, sections, sourceSections, lineItem, pricingEnabled);
443
- });
444
- }
445
- else if (section.boundData.entityType === BoundDataType[BoundDataType.PORT]) {
446
- foundLineItems = foundLineItems.filter(item => item.portDomains && item.portDomains[section.boundData.name]);
447
- SectionsBinderHelper.bindMatchingLineItems(runtimeModel, foundLineItems, section, sections, sourceSections, pricingEnabled);
448
- }
449
- return;
450
- });
451
- return sections;
452
- }
453
- static isAddAllowed(model, portName, quantityToAdd = 1) {
454
- const quantity = this.getQuantity(model, portName);
455
- return quantity + quantityToAdd <= +this.getPortMax(model, portName);
456
- }
457
- static isRemoveAllowed(model, portName, quantityToRemove = 1) {
458
- const quantity = this.getQuantity(model, portName);
459
- return quantity - quantityToRemove >= +this.getPortMin(model, portName);
460
- }
461
- static getMaxAllowed(lineItem, portName) {
462
- return +this.getPortMax(lineItem, portName) - this.getQuantity(lineItem, portName);
463
- }
464
- static getQuantityGroupByValue(model, portName) {
465
- const quantities = {};
466
- if (model && portName) {
467
- model.lineItems
468
- .filter(li => li.port === portName)
469
- .forEach(li => {
470
- let quantity = (EntityUtil.isPresent(li.qty) && li.qty) || 1;
471
- if (EntityUtil.isPresent(quantities[li.type])) {
472
- quantity += quantities[li.type];
473
- }
474
- quantities[li.type] = quantity;
475
- });
476
- }
477
- return quantities;
478
- }
479
- static bindMatchingLineItems(runtimeModel, foundLineItems, section, sections, sourceSections, pricingEnabled) {
480
- foundLineItems.forEach(lineItem => {
481
- const boundSection = SectionsBinderHelper.bindLineItem(section, sections, sourceSections, lineItem, pricingEnabled);
482
- SectionsBinderHelper.setLineItemsPath(runtimeModel, lineItem, sections, sourceSections, (sec) => {
483
- return sec.boundData && sec.parentId === boundSection.id;
484
- }, pricingEnabled);
485
- });
486
- }
487
- static bindLineItem(section, sections, sourceSections, lineItem, pricingEnabled) {
488
- const boundSection = section.model ? SectionsBinderHelper.doClone(section, sections, sourceSections) : section;
489
- boundSection.model = lineItem;
490
- boundSection.pricingEnabled = pricingEnabled;
491
- return boundSection;
492
- }
493
- static doClone(source, sections, sourceSections, parent) {
494
- const sourceClass = sourceSections.find(s => s.classId === source.classId);
495
- const clone = EntityUtil.clone(sourceClass);
496
- clone.id = UUID.UUID();
497
- clone.parentId = parent ? parent.id : source.parentId;
498
- sections.splice(sections.findIndex(s => s.id === source.id) + 1, 0, clone);
499
- sourceSections
500
- .filter(s => s.parentId === sourceClass.id)
501
- .forEach(s => SectionsBinderHelper.doClone(s, sections, sourceSections, clone));
502
- return clone;
503
- }
504
- static getQuantity(model, portName) {
505
- let quantity = 0;
506
- model.lineItems
507
- .filter(li => li.port === portName)
508
- .forEach(li => {
509
- quantity += li.qty;
510
- });
511
- return quantity;
512
- }
513
- static getPortMax(model, portName) {
514
- return model.portDomains[portName].maxCard;
515
- }
516
- static getPortMin(model, portName) {
517
- return model.portDomains[portName].minCard;
518
- }
519
- }
520
-
521
- class RuntimeFormService {
522
- constructor() {
523
- this.sections = [];
524
- }
525
- initForm(sections, solutionLineItem) {
526
- this.sections = sections;
527
- this.solutionLineItem = solutionLineItem;
528
- const form = new FormGroup({});
529
- sections
530
- .filter(section => section.model && section.template && section.boundData)
531
- .forEach(section => {
532
- this.populateSectionValue(section);
533
- this.populateSectionPrice(section);
534
- this.populateFormControls(section, form);
535
- });
536
- return form;
537
- }
538
- populateSectionValue(section) {
539
- var _a, _b, _c, _d, _e, _f, _g;
540
- let value;
541
- let valueOptions = [];
542
- let displayValues = {};
543
- let properties = {};
544
- if (FormServiceUtils.isPortSection(section)) {
545
- const portDomain = (_a = section.model) === null || _a === void 0 ? void 0 : _a.portDomains[section.boundData.name];
546
- valueOptions = (_b = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.map(dt => dt.name)) !== null && _b !== void 0 ? _b : [];
547
- properties =
548
- (_c = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.reduce(function (map, dt) {
549
- map[dt.name] = dt.properties;
550
- return map;
551
- }, {})) !== null && _c !== void 0 ? _c : {};
552
- displayValues =
553
- (_d = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.reduce(function (map, dt) {
554
- map[dt.name] = dt.displayName;
555
- return map;
556
- }, {})) !== null && _d !== void 0 ? _d : {};
557
- value = (_e = section.model) === null || _e === void 0 ? void 0 : _e.lineItems.map(li => li.type);
558
- }
559
- if (FormServiceUtils.isAttributeSection(section)) {
560
- const attribute = (_f = section.model) === null || _f === void 0 ? void 0 : _f.attributes.find(attr => attr.name.toLowerCase() === section.boundData.name.toLowerCase());
561
- if (attribute) {
562
- value = attribute.value;
563
- }
564
- const attributeDomain = (_g = section.model) === null || _g === void 0 ? void 0 : _g.attributeDomains[section.boundData.name];
565
- if (!(attribute === null || attribute === void 0 ? void 0 : attribute.type.match('GENERIC|BOOLEAN')) && attributeDomain) {
566
- const count = attribute && attribute.scale != null
567
- ? LineItemUtil.countAttributeValues(attribute.scale, attributeDomain)
568
- : undefined;
569
- if (attribute && attribute.scale != null && count && count <= 100) {
570
- valueOptions = LineItemUtil.splitDomainToValues(attribute.scale, attributeDomain);
571
- }
572
- else {
573
- valueOptions = attributeDomain;
574
- }
575
- }
576
- else if (attributeDomain) {
577
- valueOptions = attributeDomain;
578
- }
579
- }
580
- if (!EntityUtil.isPresent(value)) {
581
- value = '';
582
- }
583
- section.sectionValue = {
584
- value,
585
- valueOptions,
586
- displayValues,
587
- properties,
588
- };
589
- }
590
- populateSectionPrice(section) {
591
- var _a;
592
- const priceValue = { priceOptions: {} };
593
- if (FormServiceUtils.isPortSection(section)) {
594
- const portDomain = (_a = section.model) === null || _a === void 0 ? void 0 : _a.portDomains[section.boundData.name];
595
- if (portDomain) {
596
- portDomain.domainTypes.forEach(dt => {
597
- if (dt.recommendedPrices && dt.recommendedPrices.length > 0) {
598
- priceValue.priceOptions[dt.name] = dt.recommendedPrices;
599
- }
600
- else {
601
- delete priceValue.priceOptions[dt.name];
602
- }
603
- });
604
- }
605
- }
606
- section.priceValue = priceValue;
607
- }
608
- populateFormControls(section, form) {
609
- form.controls[section.id] = this.createFormControl(section);
610
- if (FormServiceUtils.isPortSection(section) || FormServiceUtils.isTypeSection(section)) {
611
- form.controls[section.id.concat('qty')] = this.createQtyControl(section);
612
- }
613
- }
614
- createFormControl(section) {
615
- var _a;
616
- const value = FormServiceUtils.isPortSection(section) ? void 0 : (_a = section.sectionValue) === null || _a === void 0 ? void 0 : _a.value;
617
- return new FormControl(value, this.getFormControlValidators(section));
618
- }
619
- createQtyControl(section) {
620
- var _a, _b, _c;
621
- const isTypeSection = FormServiceUtils.isTypeSection(section);
622
- const validators = [];
623
- const maxAllowed = this.getMaxAllowed(section);
624
- //TODO TEMPORARY SOLUTION (WILL BE DISABLED ONCE RADIO CONTROLS IMPLEMENTED)
625
- if (maxAllowed > 0) {
626
- validators.push(this.getQuantityValidator(maxAllowed, isTypeSection ? (_b = (_a = section.model) === null || _a === void 0 ? void 0 : _a.qty) !== null && _b !== void 0 ? _b : 0 : 0));
627
- }
628
- const qtyValue = isTypeSection ? (_c = section.model) === null || _c === void 0 ? void 0 : _c.qty : 1;
629
- return new FormControl(qtyValue, validators);
630
- }
631
- getMaxAllowed(section) {
632
- let lineItem = section.model;
633
- let portName = section.boundData.name;
634
- if (FormServiceUtils.isTypeSection(section)) {
635
- if (section.model && EntityUtil.isPresent(section.model.parentId) && this.solutionLineItem) {
636
- if (section.model.parentId) {
637
- lineItem = LineItemUtil.findById(section.model.parentId, [this.solutionLineItem]);
638
- }
639
- portName = section.model.port;
640
- }
641
- else {
642
- return 0;
643
- }
644
- }
645
- if (!lineItem) {
646
- return 0;
647
- }
648
- return SectionsBinderHelper.getMaxAllowed(lineItem, portName);
649
- }
650
- //TODO ALE TO SUPPORT EMPTY VALUES FOR INTERVAL ATTRIBUTES OUT OF DOMAIN
651
- getFormControlValidators(section) {
652
- if (!FormServiceUtils.isAttributeSection(section)) {
653
- return null;
654
- }
655
- const validators = [];
656
- const parentLineItem = section.model && this.solutionLineItem && FormServiceUtils.findParent(section.model.id, [this.solutionLineItem]);
657
- const attribute = parentLineItem &&
658
- parentLineItem.attributes.find(attr => attr.name.toLowerCase() === section.boundData.name.toLowerCase());
659
- if (!attribute || !attribute.type) {
660
- return null;
661
- }
662
- const primitiveTypesValidators = {
663
- INT: TypeValidators.integerValidator(),
664
- 'DOUBLE|DECIMAL': TypeValidators.decimalValidator(10),
665
- };
666
- keys(primitiveTypesValidators).forEach(types => {
667
- if (types.match(attribute.type)) {
668
- const validator = primitiveTypesValidators[types];
669
- validators.push(validator);
670
- }
671
- });
672
- if (!attribute.type.match('GENERIC|BOOLEAN|MULTIPLE')) {
673
- const sectionLabel = section.label;
674
- const intervalValidator = function (control) {
675
- var _a;
676
- if (isUndefined(control.value) || isNull(control.value) || isNaN(+control.value)) {
677
- return { interval: { message: sectionLabel + ' is not in domain' } };
678
- }
679
- if (!isUndefined(control.value) && isString(control.value) && control.value.length === 0) {
680
- return null;
681
- }
682
- const attributeDomain = (_a = section.model) === null || _a === void 0 ? void 0 : _a.attributeDomains[section.boundData.name];
683
- const valid = attributeDomain === null || attributeDomain === void 0 ? void 0 : attributeDomain.some(valueOption => {
684
- const min = +valueOption.min;
685
- const max = +valueOption.max;
686
- return +control.value <= max && +control.value >= min;
687
- });
688
- if (!valid) {
689
- return { interval: { message: sectionLabel + ' is not in domain' } };
690
- }
691
- return null;
692
- };
693
- validators.push(intervalValidator);
694
- }
695
- if (section.required) {
696
- validators.push(TypeValidators.requiredValidator(section.label + ' is required '));
697
- }
698
- return validators.length !== 0 ? validators : null;
699
- }
700
- getQuantityValidator(max, originalQty) {
701
- return (control) => {
702
- if (!control.value) {
703
- return { quantity: { message: 'Required' } };
704
- }
705
- else if (isNaN(+control.value) || +control.value < 1) {
706
- return { quantity: { message: 'Invalid value' } };
707
- }
708
- else if (+control.value > max + originalQty) {
709
- return { quantity: { message: 'Max quantity ' + (max + originalQty) } };
710
- }
711
- else {
712
- return null;
713
- }
714
- };
715
- }
716
- }
717
- RuntimeFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
718
- RuntimeFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeFormService });
719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeFormService, decorators: [{
720
- type: Injectable
721
- }] });
722
- class FormServiceUtils {
723
- static isPortSection(section) {
724
- return section && section.boundData && section.boundData.entityType === BoundDataType[BoundDataType.PORT];
725
- }
726
- static isTypeSection(section) {
727
- return section && section.boundData && section.boundData.entityType === BoundDataType[BoundDataType.TYPE];
728
- }
729
- static isAttributeSection(section) {
730
- return section && section.boundData && section.boundData.entityType === BoundDataType[BoundDataType.ATTRIBUTE];
731
- }
732
- static findParent(parentId, lineItems) {
733
- return EntityUtil.findByFieldHierarchically('id', parentId, lineItems, 'lineItems');
734
- }
735
- }
736
-
737
- class ConfigurationService {
738
- constructor(configurationApiService, contextService, dialogService) {
739
- this.configurationApiService = configurationApiService;
740
- this.contextService = contextService;
741
- this.dialogService = dialogService;
742
- }
743
- configure(runtimeContext, states, resolve) {
744
- var _a;
745
- const lineItem = (states && states.configurableRamp) || this.getDefaultLineItem(runtimeContext);
746
- const configurationMode = resolve ? ConfigurationMode.RESOLVE : ConfigurationMode.SEARCH;
747
- const configurationRequest = this.createRequest(lineItem, runtimeContext, configurationMode);
748
- configurationRequest.lineItems = states.currentState || [];
749
- configurationRequest.asset = states.asset;
750
- const runtimeModel = runtimeContext.runtimeModel;
751
- const pricingEnabled = (_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.pricingEnabled;
752
- return this.configurationApiService
753
- .configureLineItem({
754
- configurationRequest,
755
- runtimeModel,
756
- pricingEnabled,
757
- })
758
- .pipe(map(({ lineItem, context, deletedLineItems }) => {
759
- if (context) {
760
- this.contextService.update({ properties: context.properties });
761
- }
762
- if (deletedLineItems === null || deletedLineItems === void 0 ? void 0 : deletedLineItems.length) {
763
- this.showInactiveProductsConfirmation();
764
- }
765
- return lineItem;
766
- }));
767
- }
768
- createRequest(lineItem, runtimeContext, configurationMode) {
769
- var _a, _b, _c, _d, _e;
770
- if (runtimeContext.runtimeMode === RuntimeMode.TEST) {
771
- const properties = Object.assign(Object.assign({}, runtimeContext.properties), { ModelId: runtimeContext.modelId, RuntimeMode: 'TEST', PricingEnabled: String((_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.pricingEnabled), StartDate: (_c = (_b = runtimeContext.properties) === null || _b === void 0 ? void 0 : _b.StartDate) !== null && _c !== void 0 ? _c : new Date().toISOString().substring(0, 10), PriceListId: (_d = runtimeContext.uiDefinition) === null || _d === void 0 ? void 0 : _d.priceList });
772
- this.contextService.update({ properties });
773
- }
774
- else {
775
- const context = this.contextService.resolve();
776
- if (context.properties && ((_e = runtimeContext.properties) === null || _e === void 0 ? void 0 : _e.StartDate)) {
777
- this.contextService.update({
778
- properties: Object.assign(Object.assign({}, context.properties), runtimeContext.properties),
779
- });
780
- }
781
- }
782
- return {
783
- lineItem,
784
- mode: configurationMode,
785
- step: runtimeContext.invocationContext && runtimeContext.invocationContext.runtimeStep,
786
- attributeDomainMode: 'ALL',
787
- context: this.contextService.resolve(),
788
- };
789
- }
790
- getDefaultLineItem(context) {
791
- var _a, _b, _c, _d;
792
- const id = UUID.UUID();
793
- const lineItem = Object.assign({ id, type: (_b = (_a = context.uiDefinition) === null || _a === void 0 ? void 0 : _a.rootType) !== null && _b !== void 0 ? _b : '', cfgStatus: 'Default', qty: 1, productName: ((_c = context.properties) === null || _c === void 0 ? void 0 : _c['displayName']) || context.productName, productId: (_d = context.productId) !== null && _d !== void 0 ? _d : '', offeringId: context.offeringId }, (context.offeringId
794
- ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }
795
- : {}));
796
- return lineItem;
797
- }
798
- showInactiveProductsConfirmation() {
799
- const confirmationConfig = {
800
- title: ' ',
801
- description: 'This quote contains inactive products. Do you want to remove them?',
802
- primaryButtonLabel: 'Remove products',
803
- secondaryButtonLabel: 'Back to Quote',
804
- };
805
- this.dialogService
806
- .open(ConfirmationComponent, {
807
- dismissableMask: false,
808
- closeOnEscape: false,
809
- closable: false,
810
- showHeader: true,
811
- header: `Inactive Products in Quote`,
812
- width: '440px',
813
- data: { confirmationConfig },
814
- })
815
- .onClose.subscribe(result => {
816
- if (!result) {
817
- const context = this.contextService.resolve();
818
- window['VELO_BACK_FN'].apply(null, [context.headerId]);
819
- }
820
- });
821
- }
822
- }
823
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.ConfigurationApiService }, { token: i2.ContextService }, { token: i3.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
824
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
825
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, decorators: [{
826
- type: Injectable
827
- }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: i2.ContextService }, { type: i3.DialogService }]; } });
828
-
829
- class RuntimeService {
830
- constructor(configurationService, contextService, messageService) {
831
- this.configurationService = configurationService;
832
- this.contextService = contextService;
833
- this.messageService = messageService;
834
- this.solutionReadySubject = new Subject();
835
- this.onSolutionReadyEvent = this.solutionReadySubject.asObservable();
836
- this.solutionUpdateStartedSubject = new Subject();
837
- this.onSolutionUpdateStartedEvent = this.solutionUpdateStartedSubject.asObservable();
838
- this.solutionUpdatedSubject = new Subject();
839
- this.onSolutionUpdatedEvent = this.solutionUpdatedSubject.asObservable();
840
- this.solutionProcessedSubject = new Subject();
841
- this.onSolutionProcessed = this.solutionProcessedSubject.asObservable();
842
- this.solutionStopSubject = new Subject();
843
- this.onSolutionStopEvent = this.solutionStopSubject.asObservable();
844
- this.solutionCancelSubject = new Subject();
845
- this.onSolutionCancelEvent = this.solutionCancelSubject.asObservable();
846
- this.uiRefreshSubject = new Subject();
847
- this.onUIRefreshEvent = this.uiRefreshSubject.asObservable();
848
- }
849
- displayErrorMessage(error) {
850
- var _a;
851
- this.messageService.add({
852
- severity: 'error',
853
- summary: ((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error),
854
- });
855
- }
856
- startRuntime(context, states, resolve) {
857
- this.setRuntimeContext(context);
858
- this.setRuntimeStep(RuntimeStep.START);
859
- this.configurationService
860
- .configure(context, states, resolve)
861
- .pipe(take(1))
862
- .subscribe(lineItem => {
863
- this.solutionReadySubject.next(lineItem);
864
- }, error => {
865
- this.displayErrorMessage(error);
866
- this.solutionUpdatedSubject.next(error);
867
- });
868
- }
869
- updateRuntime(states, configurationContextProperties) {
870
- if (!this.runtimeContext) {
871
- return;
872
- }
873
- this.solutionUpdateStartedSubject.next();
874
- this.setRuntimeStep(RuntimeStep.UPDATE);
875
- this.updateRuntimeContext(configurationContextProperties);
876
- this.configurationService
877
- .configure(this.runtimeContext, states)
878
- .pipe(take(1))
879
- .subscribe(lineItem => {
880
- const context = this.contextService.resolve();
881
- this.updateRuntimeContext(context.properties);
882
- this.solutionUpdatedSubject.next(lineItem);
883
- }, error => {
884
- this.displayErrorMessage(error);
885
- this.solutionUpdatedSubject.next(error);
886
- });
887
- }
888
- stopRuntime(solutionLineItem) {
889
- this.solutionStopSubject.next(solutionLineItem);
890
- }
891
- cancelRuntime() {
892
- this.solutionCancelSubject.next();
893
- }
894
- setRuntimeContext(runtimeContext) {
895
- this.runtimeContext = runtimeContext;
896
- }
897
- getRuntimeContext() {
898
- return this.runtimeContext;
899
- }
900
- solutionProcessed(lineItem) {
901
- this.solutionProcessedSubject.next(lineItem);
902
- }
903
- refreshUI(uiDefinition) {
904
- if (!this.runtimeContext) {
905
- return;
906
- }
907
- this.runtimeContext = Object.assign(Object.assign({}, this.runtimeContext), { uiDefinition });
908
- this.uiRefreshSubject.next();
909
- }
910
- updateRuntimeContext(configurationContextProperties) {
911
- if (!this.runtimeContext || !configurationContextProperties) {
912
- return;
913
- }
914
- this.runtimeContext = Object.assign(Object.assign({}, this.runtimeContext), { properties: configurationContextProperties });
915
- }
916
- setRuntimeStep(runtimeStep) {
917
- if (!this.runtimeContext) {
918
- return;
919
- }
920
- this.runtimeContext.invocationContext = Object.assign(Object.assign({}, this.runtimeContext.invocationContext), { runtimeStep });
921
- }
922
- }
923
- RuntimeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeService, deps: [{ token: ConfigurationService }, { token: i2.ContextService }, { token: i3$1.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
924
- RuntimeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeService });
925
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeService, decorators: [{
926
- type: Injectable
927
- }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: i2.ContextService }, { type: i3$1.MessageService }]; } });
928
-
929
- class ShoppingCartService {
930
- constructor(priceApiService, contextService, quoteService) {
931
- this.priceApiService = priceApiService;
932
- this.contextService = contextService;
933
- this.quoteService = quoteService;
934
- }
935
- setCartExternally(currentState) {
936
- const context = this.contextService.resolve();
937
- return this.priceApiService.calculate({ context, currentState }).pipe(take(1), tap(({ lineItems }) => {
938
- this.quoteService.setCurrentLineItemState(lineItems);
939
- }));
940
- }
941
- getCurrentState() {
942
- return this.quoteService.currentState;
943
- }
944
- }
945
- ShoppingCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartService, deps: [{ token: i1.PriceApiService }, { token: i2.ContextService }, { token: i2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Injectable });
946
- ShoppingCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartService });
947
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartService, decorators: [{
948
- type: Injectable
949
- }], ctorParameters: function () { return [{ type: i1.PriceApiService }, { type: i2.ContextService }, { type: i2.QuoteDraftService }]; } });
950
-
951
- class CurrentStateService {
952
- constructor() {
953
- this.currentState = [];
954
- }
955
- update(state) {
956
- this.currentState = state;
957
- }
958
- }
959
- CurrentStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CurrentStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
960
- CurrentStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CurrentStateService, providedIn: 'root' });
961
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CurrentStateService, decorators: [{
962
- type: Injectable,
963
- args: [{ providedIn: 'root' }]
964
- }] });
965
-
966
- class ProductModelCacheService {
967
- constructor(productModelApiService) {
968
- this.productModelApiService = productModelApiService;
969
- this.cachedModel = new Map();
970
- }
971
- getProductModel(currentModelId, version) {
972
- if (!this.cachedModel.has(currentModelId) || version) {
973
- this.clearCache();
974
- this.cachedModel.set(currentModelId, this.productModelApiService.load(currentModelId, version).pipe(shareReplay(1)));
975
- }
976
- return this.cachedModel.get(currentModelId);
977
- }
978
- getCachedModel() {
979
- const ids = Array.from(this.cachedModel.keys());
980
- return this.cachedModel.get(ids[0]);
981
- }
982
- clearCache() {
983
- this.cachedModel.clear();
984
- }
985
- }
986
- ProductModelCacheService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelCacheService, deps: [{ token: i1.ProductModelApiService }], target: i0.ɵɵFactoryTarget.Injectable });
987
- ProductModelCacheService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelCacheService });
988
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelCacheService, decorators: [{
989
- type: Injectable
990
- }], ctorParameters: function () { return [{ type: i1.ProductModelApiService }]; } });
991
-
992
- class RuntimeContextService {
993
- constructor(configurationApiService, messageService, contextService) {
994
- this.configurationApiService = configurationApiService;
995
- this.messageService = messageService;
996
- this.contextService = contextService;
997
- }
998
- getRuntimeContext(productId, offeringId) {
999
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1000
- var _a;
1001
- const uiDefinition = this.getUIDefinition(runtimeData);
1002
- const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
1003
- const { productName, properties } = (_a = Array.from(runtimeModel.components.values()).find(c => c.productId === productId)) !== null && _a !== void 0 ? _a : {};
1004
- return {
1005
- modelId: runtimeData.modelId,
1006
- uiDefinition: uiDefinition,
1007
- runtimeModel: runtimeModel,
1008
- runtimeMode: RuntimeMode.PROD,
1009
- productId: productId,
1010
- productType: (properties === null || properties === void 0 ? void 0 : properties['displayName']) || productName,
1011
- offeringId: offeringId,
1012
- properties: {
1013
- PricingEnabled: uiDefinition.pricingEnabled ? 'true' : 'false',
1014
- },
1015
- };
1016
- }));
1017
- }
1018
- getUIDefinition(runtimeData) {
1019
- const { uiDefinitionId } = this.contextService.resolve();
1020
- const findByFn = (uiDef) => uiDefinitionId ? uiDefinitionId === uiDef.id : uiDef.primary;
1021
- const uiDefinitions = runtimeData.uiDefinitions
1022
- .map(({ source }) => source)
1023
- .filter((uiDefinition) => isLegacyUIDefinition(uiDefinition));
1024
- const uiDefinition = uiDefinitions.find(findByFn) || (uiDefinitions.length === 1 && Object.assign({}, uiDefinitions[0]));
1025
- if (!uiDefinition) {
1026
- const errMsg = `Unable to find ${uiDefinitionId ? uiDefinitionId : 'Default'} UI`;
1027
- this.messageService.add({
1028
- severity: 'error',
1029
- summary: 'ERROR',
1030
- });
1031
- throw new Error(errMsg);
1032
- }
1033
- SectionPathUtil.updateSectionsPath(uiDefinition.sections);
1034
- return uiDefinition;
1035
- }
1036
- }
1037
- RuntimeContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, deps: [{ token: i1.ConfigurationApiService }, { token: i3$1.MessageService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
1038
- RuntimeContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService });
1039
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, decorators: [{
1040
- type: Injectable
1041
- }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: i3$1.MessageService }, { type: i2.ContextService }]; } });
1042
-
1043
- class SectionStoreService {
1044
- constructor() {
1045
- this._componentFactories = [];
1046
- }
1047
- set componentFactories(data) {
1048
- this._componentFactories = data;
1049
- }
1050
- get componentFactories() {
1051
- return this._componentFactories;
1052
- }
1053
- getComponentFactory(section) {
1054
- return this.componentFactories.find(f => f.selector === section.dynamicSelector);
1055
- }
1056
- }
1057
- SectionStoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionStoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1058
- SectionStoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionStoreService });
1059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionStoreService, decorators: [{
1060
- type: Injectable
1061
- }] });
1062
-
1063
- class SectionScopeService {
1064
- constructor() {
1065
- this.indent = 1;
1066
- this.templates = new BehaviorSubject([]);
1067
- }
1068
- get section() {
1069
- return this._section;
1070
- }
1071
- set section(value) {
1072
- this._section = value;
1073
- this.indent = this.getIndent(value);
1074
- }
1075
- getIndent(section) {
1076
- if (!section || !section.parentId) {
1077
- return 1;
1078
- }
1079
- else {
1080
- let current = section;
1081
- let indent = 1;
1082
- while (current && current.parent) {
1083
- current = current.parent;
1084
- indent++;
1085
- }
1086
- return indent;
1087
- }
1088
- }
1089
- }
1090
- SectionScopeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionScopeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1091
- SectionScopeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionScopeService });
1092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionScopeService, decorators: [{
1093
- type: Injectable
1094
- }] });
1095
-
1096
- class ExecutionSectionRendererComponent {
1097
- set section(value) {
1098
- this._section = value;
1099
- this.sectionScope.section = value;
1100
- }
1101
- get section() {
1102
- return this._section;
1103
- }
1104
- constructor(_injector, _m, sectionScope, sectionStore) {
1105
- this._injector = _injector;
1106
- this._m = _m;
1107
- this.sectionScope = sectionScope;
1108
- this.sectionStore = sectionStore;
1109
- this.componentRef = null;
1110
- }
1111
- ngOnInit() {
1112
- this.renderSection();
1113
- }
1114
- ngAfterViewInit() {
1115
- var _a, _b;
1116
- if (this.componentRef) {
1117
- this.sectionScope.templates.next((_b = (_a = this.componentRef.instance['templates']) === null || _a === void 0 ? void 0 : _a.toArray()) !== null && _b !== void 0 ? _b : []);
1118
- }
1119
- }
1120
- ngOnDestroy() {
1121
- if (this.componentRef) {
1122
- this.componentRef.destroy();
1123
- this.componentRef = null;
1124
- }
1125
- }
1126
- renderSection() {
1127
- var _a;
1128
- if (this.componentRef) {
1129
- this.componentRef.destroy();
1130
- this.componentRef = null;
1131
- }
1132
- const componentFactory = this.sectionStore.getComponentFactory(this._section);
1133
- if (!componentFactory) {
1134
- return;
1135
- }
1136
- this.componentRef = componentFactory.create(this._injector, [], null, this._m);
1137
- this.componentRef.location.nativeElement.setAttribute('sectionId', `${(_a = this._section.model) === null || _a === void 0 ? void 0 : _a.id}${this._section.label}`);
1138
- this.componentRef.instance['form'] = this.form;
1139
- this.componentRef.instance['section'] = this.section;
1140
- this.container.insert(this.componentRef.hostView);
1141
- }
1142
- }
1143
- ExecutionSectionRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ExecutionSectionRendererComponent, deps: [{ token: i0.Injector }, { token: i0.NgModuleRef }, { token: SectionScopeService }, { token: SectionStoreService }], target: i0.ɵɵFactoryTarget.Component });
1144
- ExecutionSectionRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ExecutionSectionRendererComponent, selector: "section-renderer", inputs: { section: "section", form: "form" }, providers: [SectionScopeService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #container></ng-template>", styles: [":host{display:contents}\n"] });
1145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ExecutionSectionRendererComponent, decorators: [{
1146
- type: Component,
1147
- args: [{ selector: 'section-renderer', providers: [SectionScopeService], template: "<ng-template #container></ng-template>", styles: [":host{display:contents}\n"] }]
1148
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.NgModuleRef }, { type: SectionScopeService }, { type: SectionStoreService }]; }, propDecorators: { section: [{
1149
- type: Input
1150
- }], form: [{
1151
- type: Input
1152
- }], container: [{
1153
- type: ViewChild,
1154
- args: ['container', { read: ViewContainerRef, static: true }]
1155
- }] } });
1156
-
1157
- class ChildrenPlaceholderComponent {
1158
- constructor(sectionScope, formScope, collapsibleState) {
1159
- this.sectionScope = sectionScope;
1160
- this.formScope = formScope;
1161
- this.collapsibleState = collapsibleState;
1162
- this._children = [];
1163
- this.collapsed = false;
1164
- }
1165
- ngOnInit() {
1166
- this.section = this.sectionScope.section;
1167
- this.form = this.formScope.form;
1168
- this.collapsed = this.section.model ? this.collapsibleState.isCollapsedSection(this.section.model.id) : true;
1169
- this.sub = this.collapsibleState.collapseSectionEvent.subscribe(e => {
1170
- var _a;
1171
- const lineItemId = e[0];
1172
- if (((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.id) === lineItemId) {
1173
- this.collapsed = e[1];
1174
- }
1175
- });
1176
- this.setChildren();
1177
- }
1178
- ngOnChanges(changes) {
1179
- var _a, _b;
1180
- if (!this.children || ((_a = changes['children']) === null || _a === void 0 ? void 0 : _a.currentValue) !== ((_b = changes['children']) === null || _b === void 0 ? void 0 : _b.previousValue)) {
1181
- this.setChildren();
1182
- }
1183
- }
1184
- setChildren() {
1185
- this._children = this.children ? this.children : this.section.children;
1186
- }
1187
- ngOnDestroy() {
1188
- this.sub.unsubscribe();
1189
- }
1190
- }
1191
- ChildrenPlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChildrenPlaceholderComponent, deps: [{ token: SectionScopeService }, { token: FormScopeService }, { token: CollapsibleStateService }], target: i0.ɵɵFactoryTarget.Component });
1192
- ChildrenPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ChildrenPlaceholderComponent, selector: "children-placeholder", inputs: { children: "children" }, providers: [OrderByPipe], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!collapsed\">\n <ng-container *ngFor=\"let child of _children\">\n <section-renderer [section]=\"child\" [form]=\"form\" *ngIf=\"!child.hidden\"></section-renderer>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ExecutionSectionRendererComponent, selector: "section-renderer", inputs: ["section", "form"] }] });
1193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChildrenPlaceholderComponent, decorators: [{
1194
- type: Component,
1195
- args: [{ selector: 'children-placeholder', providers: [OrderByPipe], template: "<ng-container *ngIf=\"!collapsed\">\n <ng-container *ngFor=\"let child of _children\">\n <section-renderer [section]=\"child\" [form]=\"form\" *ngIf=\"!child.hidden\"></section-renderer>\n </ng-container>\n</ng-container>\n" }]
1196
- }], ctorParameters: function () { return [{ type: SectionScopeService }, { type: FormScopeService }, { type: CollapsibleStateService }]; }, propDecorators: { children: [{
1197
- type: Input
1198
- }] } });
1199
- class TemplateComponent extends ChildrenPlaceholderComponent {
1200
- }
1201
- TemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TemplateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1202
- TemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TemplateComponent, selector: "template-component", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!collapsed\">\n <ng-container *ngFor=\"let child of _children\">\n <section-renderer [section]=\"child\" [form]=\"form\" *ngIf=\"!child.hidden\"></section-renderer>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ExecutionSectionRendererComponent, selector: "section-renderer", inputs: ["section", "form"] }] });
1203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TemplateComponent, decorators: [{
1204
- type: Component,
1205
- args: [{ selector: 'template-component', template: "<ng-container *ngIf=\"!collapsed\">\n <ng-container *ngFor=\"let child of _children\">\n <section-renderer [section]=\"child\" [form]=\"form\" *ngIf=\"!child.hidden\"></section-renderer>\n </ng-container>\n</ng-container>\n" }]
1206
- }] });
1207
-
1208
- class ContextProviderComponent {
1209
- constructor(runtimeService) {
1210
- this.runtimeService = runtimeService;
1211
- this.types = [];
1212
- this.products = {};
1213
- }
1214
- ngOnInit() {
1215
- const context = this.runtimeService.getRuntimeContext();
1216
- if (!context) {
1217
- return;
1218
- }
1219
- this.runtimeService.setRuntimeContext(Object.assign(Object.assign({}, context), { runtimeModel: RuntimeModel.create(this.types, this.products) }));
1220
- }
1221
- }
1222
- ContextProviderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextProviderComponent, deps: [{ token: RuntimeService }], target: i0.ɵɵFactoryTarget.Component });
1223
- ContextProviderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ContextProviderComponent, selector: "vl-context-provider", inputs: { types: "types", products: "products" }, ngImport: i0, template: '', isInline: true });
1224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextProviderComponent, decorators: [{
1225
- type: Component,
1226
- args: [{
1227
- selector: 'vl-context-provider',
1228
- template: '',
1229
- }]
1230
- }], ctorParameters: function () {
1231
- return [{ type: RuntimeService, decorators: [{
1232
- type: Inject,
1233
- args: [RuntimeService]
1234
- }] }];
1235
- }, propDecorators: { types: [{
1236
- type: Input
1237
- }], products: [{
1238
- type: Input
1239
- }] } });
1240
-
1241
- const moduleMap = {};
1242
- function loadRemoteEntry(remoteEntry) {
1243
- return new Promise((resolve, reject) => {
1244
- if (moduleMap[remoteEntry]) {
1245
- resolve();
1246
- return;
1247
- }
1248
- const script = document.createElement('script');
1249
- script.src = remoteEntry;
1250
- script.onerror = reject;
1251
- script.onload = () => {
1252
- moduleMap[remoteEntry] = true;
1253
- resolve(); // window is the global namespace
1254
- };
1255
- document.body.append(script);
1256
- });
1257
- }
1258
- function lookupExposedModule(remoteName, exposedModule) {
1259
- return __awaiter(this, void 0, void 0, function* () {
1260
- // Initializes the share scope. This fills it with known provided modules from this build and all remotes
1261
- yield __webpack_init_sharing__('default');
1262
- const container = window[remoteName]; // or get the container somewhere else
1263
- // Initialize the container, it may provide shared modules
1264
- yield container.init(__webpack_share_scopes__.default);
1265
- const factory = yield container.get(exposedModule);
1266
- const Module = factory();
1267
- return Module;
1268
- });
1269
- }
1270
- function loadRemoteModule(options) {
1271
- return __awaiter(this, void 0, void 0, function* () {
1272
- yield loadRemoteEntry(options.remoteEntry);
1273
- return yield lookupExposedModule(options.remoteName, options.exposedModule);
1274
- });
1275
- }
1276
-
1277
- var IntegrationEvent;
1278
- (function (IntegrationEvent) {
1279
- IntegrationEvent["Init"] = "Init";
1280
- })(IntegrationEvent || (IntegrationEvent = {}));
1281
- class FederatedComponent {
1282
- constructor(injector, compiler, appRef, renderer) {
1283
- this.injector = injector;
1284
- this.compiler = compiler;
1285
- this.appRef = appRef;
1286
- this.renderer = renderer;
1287
- this.integrationEvent = new EventEmitter();
1288
- this.moduleReady = false;
1289
- }
1290
- ngAfterViewInit() {
1291
- if (!this.remoteEntry || !this.remoteName || !this.exposedModule) {
1292
- return;
1293
- }
1294
- loadRemoteModule({
1295
- remoteEntry: this.remoteEntry,
1296
- remoteName: this.remoteName,
1297
- exposedModule: this.exposedModule,
1298
- }).then(federated => {
1299
- this.compiler.compileModuleAsync(federated[this.exposedModule]).then(moduleFactory => {
1300
- var _a;
1301
- const rootModuleRef = moduleFactory.create(this.injector);
1302
- const rootComponentFactory = rootModuleRef.componentFactoryResolver.resolveComponentFactory(federated[this.exposedModule].rootComponent);
1303
- const node = document.createElement('div');
1304
- const { instance, hostView } = rootComponentFactory.create(this.injector, [], node);
1305
- this.instance = instance;
1306
- this.instance.data = this.data;
1307
- this.instance.eventData = this.eventData;
1308
- this.instance.integrationEvent = this.integrationEvent;
1309
- this.renderer.appendChild((_a = this.moduleHostRef) === null || _a === void 0 ? void 0 : _a.nativeElement, node);
1310
- this.appRef.attachView(hostView);
1311
- });
1312
- });
1313
- }
1314
- ngOnChanges(changes) {
1315
- if (!this.instance) {
1316
- return;
1317
- }
1318
- this.instance.ngOnChanges(changes);
1319
- }
1320
- }
1321
- FederatedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FederatedComponent, deps: [{ token: i0.Injector }, { token: i0.Compiler }, { token: i0.ApplicationRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1322
- FederatedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", eventData: "eventData" }, outputs: { integrationEvent: "integrationEvent" }, viewQueries: [{ propertyName: "federatedComponent", first: true, predicate: ["federatedComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "foo", first: true, predicate: ["foo"], descendants: true, read: TemplateRef }, { propertyName: "moduleHostRef", first: true, predicate: ["moduleHost"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #moduleHost></div>\n", styles: [":host{display:block}div{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FederatedComponent, decorators: [{
1324
- type: Component,
1325
- args: [{ selector: 'veloce-host-federated', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #moduleHost></div>\n", styles: [":host{display:block}div{height:100%}\n"] }]
1326
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }, { type: i0.ApplicationRef }, { type: i0.Renderer2 }]; }, propDecorators: { federatedComponent: [{
1327
- type: ViewChild,
1328
- args: ['federatedComponent', { read: ViewContainerRef }]
1329
- }], foo: [{
1330
- type: ViewChild,
1331
- args: ['foo', { read: TemplateRef }]
1332
- }], moduleHostRef: [{
1333
- type: ViewChild,
1334
- args: ['moduleHost', { static: false }]
1335
- }], remoteEntry: [{
1336
- type: Input
1337
- }], remoteName: [{
1338
- type: Input
1339
- }], exposedModule: [{
1340
- type: Input
1341
- }], data: [{
1342
- type: Input
1343
- }], eventData: [{
1344
- type: Input
1345
- }], integrationEvent: [{
1346
- type: Output
1347
- }] } });
1348
-
1349
- //TODO ALE WE ARE EXTENDING COMPONENT HERE IN PORTS WE ARE EXTENDING DEDICATED CLASS!! TYPES HANDLER IS NO IMPLEMENTED YET
1350
- class VeloAttributeDirective {
1351
- constructor(formScope, sectionScope) {
1352
- this.formScope = formScope;
1353
- this.sectionScope = sectionScope;
1354
- this.valueQuantities = {};
1355
- this.form = this.formScope.form;
1356
- this.section = this.sectionScope.section;
1357
- }
1358
- ngOnInit() {
1359
- this.initQuantity();
1360
- }
1361
- handleChange(valueOption) {
1362
- const updateData = {
1363
- id: this.section.id,
1364
- action: 'update',
1365
- valueOption,
1366
- };
1367
- this.formScope.publishFormUpdate(updateData);
1368
- }
1369
- handleChangDate(valueOption) {
1370
- const oldValue = this.form.controls[this.section.id].value || '';
1371
- const newValue = isDate(valueOption) ? valueOption.toLocaleDateString('en-us') : '';
1372
- if (oldValue !== newValue) {
1373
- this.handleChange(newValue);
1374
- }
1375
- }
1376
- handleRemove() {
1377
- const updateData = {
1378
- id: this.section.id,
1379
- action: 'remove',
1380
- };
1381
- this.formScope.publishFormUpdate(updateData);
1382
- }
1383
- // TODO ALE THIS IS SPECIFIC STEPPER FUNCTIONS
1384
- nextVal() {
1385
- const currentIndex = this.getCurrentValueIndex();
1386
- const nextValIndex = currentIndex + 1;
1387
- if (currentIndex != -1 &&
1388
- this.section.sectionValue &&
1389
- this.section.sectionValue.valueOptions.length >= nextValIndex) {
1390
- this.handleChange(this.section.sectionValue.valueOptions[nextValIndex]);
1391
- }
1392
- }
1393
- prevVal() {
1394
- const currentIndex = this.getCurrentValueIndex();
1395
- const prevValIndex = currentIndex - 1;
1396
- if (currentIndex != -1 &&
1397
- this.section.sectionValue &&
1398
- this.section.sectionValue.valueOptions.length >= prevValIndex) {
1399
- this.handleChange(this.section.sectionValue.valueOptions[prevValIndex]);
1400
- }
1401
- }
1402
- initQuantity() {
1403
- this.valueQuantities = this.section.model
1404
- ? SectionsBinderHelper.getQuantityGroupByValue(this.section.model, this.section.boundData.name)
1405
- : {};
1406
- }
1407
- getCurrentValueIndex() {
1408
- const index = -1;
1409
- const valueOptions = this.section.sectionValue && this.section.sectionValue.valueOptions;
1410
- const currentValue = this.form.controls[this.section.id].value;
1411
- if (valueOptions && EntityUtil.isPresent(currentValue)) {
1412
- return valueOptions.findIndex(valueOption => currentValue === valueOption);
1413
- }
1414
- return index;
1415
- }
1416
- }
1417
- VeloAttributeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloAttributeDirective, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Directive });
1418
- VeloAttributeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VeloAttributeDirective, selector: "velo-attribute-directive", exportAs: ["attributeApi"], ngImport: i0 });
1419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloAttributeDirective, decorators: [{
1420
- type: Directive,
1421
- args: [{
1422
- // eslint-disable-next-line @angular-eslint/directive-selector
1423
- selector: 'velo-attribute-directive',
1424
- exportAs: 'attributeApi',
1425
- }]
1426
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
1427
-
1428
- class MultiselectComponent {
1429
- constructor(elRef, viewContainerRef, overlay) {
1430
- this.elRef = elRef;
1431
- this.viewContainerRef = viewContainerRef;
1432
- this.overlay = overlay;
1433
- this.selectionChange = new EventEmitter();
1434
- this.selected = [];
1435
- this.displayValue = '';
1436
- this.touched = false;
1437
- this.disabled = false;
1438
- this.opened = false;
1439
- this.onChange = () => {
1440
- return;
1441
- };
1442
- this.onTouched = () => {
1443
- return;
1444
- };
1445
- }
1446
- ngOnDestroy() {
1447
- this.destroyDropdown();
1448
- }
1449
- writeValue(selected) {
1450
- this.selected = selected;
1451
- this.getDisplayValue();
1452
- }
1453
- registerOnChange(onChange) {
1454
- this.onChange = onChange;
1455
- }
1456
- registerOnTouched(onTouched) {
1457
- this.onTouched = onTouched;
1458
- }
1459
- setDisabledState(disabled) {
1460
- this.disabled = disabled;
1461
- }
1462
- handleSelection(value) {
1463
- const selectedItem = this.selected.find(item => item === value);
1464
- if (selectedItem) {
1465
- this.selected = this.selected.filter(item => item !== value);
1466
- }
1467
- else {
1468
- this.selected = [...this.selected, value];
1469
- }
1470
- this.getDisplayValue();
1471
- this.selectionChange.emit(this.selected);
1472
- this.onChange(this.selected);
1473
- }
1474
- toggleOpened() {
1475
- this.opened ? this.destroyDropdown() : this.openDropdown();
1476
- }
1477
- getDisplayValue() {
1478
- const joinedValue = this.selected.join(', ');
1479
- this.displayValue = joinedValue.length > 24 ? `${this.selected.length} options selected` : joinedValue;
1480
- }
1481
- openDropdown() {
1482
- this.opened = true;
1483
- this.overlayRef = this.overlay.create({
1484
- hasBackdrop: true,
1485
- backdropClass: 'cdk-overlay-transparent-backdrop',
1486
- scrollStrategy: this.overlay.scrollStrategies.close(),
1487
- positionStrategy: this.overlay
1488
- .position()
1489
- .flexibleConnectedTo(this.elRef)
1490
- .withPositions([
1491
- {
1492
- originX: 'end',
1493
- originY: 'bottom',
1494
- overlayX: 'end',
1495
- overlayY: 'top',
1496
- offsetY: 8,
1497
- },
1498
- ]),
1499
- });
1500
- const templatePortal = new TemplatePortal(this.overlayTemplate, this.viewContainerRef);
1501
- this.overlayRef.attach(templatePortal);
1502
- this.dropdownClosingActionsSub = this.dropdownClosingActions().subscribe(() => this.destroyDropdown());
1503
- }
1504
- dropdownClosingActions() {
1505
- if (!this.overlayRef) {
1506
- return of();
1507
- }
1508
- const backdropClick$ = this.overlayRef.backdropClick();
1509
- const detachment$ = this.overlayRef.detachments();
1510
- return merge(backdropClick$, detachment$);
1511
- }
1512
- destroyDropdown() {
1513
- var _a;
1514
- if (!this.overlayRef || !this.opened) {
1515
- return;
1516
- }
1517
- (_a = this.dropdownClosingActionsSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1518
- this.opened = false;
1519
- this.overlayRef.detach();
1520
- }
1521
- }
1522
- MultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MultiselectComponent, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i1$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
1523
- MultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MultiselectComponent, selector: "velo-multiselect", inputs: { options: "options" }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "class.opened": "this.opened" } }, providers: [
1524
- {
1525
- provide: NG_VALUE_ACCESSOR,
1526
- multi: true,
1527
- useExisting: MultiselectComponent,
1528
- },
1529
- ], viewQueries: [{ propertyName: "overlayTemplate", first: true, predicate: ["overlayTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"value-wrapper\" (click)=\"toggleOpened()\">\n <span class=\"value\">{{ displayValue }}</span>\n <i class=\"fa fa-chevron-down\"></i>\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"dropdown\">\n <div class=\"checkbox-select\" *ngFor=\"let option of options\">\n <label>\n <input\n type=\"checkbox\"\n [checked]=\"selected.includes(option)\"\n (change)=\"handleSelection(option)\"\n [value]=\"option\"\n />\n\n <i class=\"input-helper\"></i>\n {{ option }}\n </label>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:block;width:172px}:host[disabled] .value-wrapper{pointer-events:none;background:rgba(0,0,0,.06);border-color:#0003}:host.opened .value-wrapper{border-color:#0e8fff}:host.opened i{transform:rotate(180deg)}:host .value-wrapper{cursor:pointer;display:flex;align-items:center;justify-content:space-between;height:34px;padding:0 10px;border:1px solid #ddd;border-radius:3px;background:#fff}:host .value-wrapper .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown{width:172px;max-height:200px;background:#fff;border:1px solid #ddd;border-radius:3px;overflow:auto}.dropdown .checkbox-select{padding:0 10px;width:100%}.dropdown .checkbox-select label{width:100%;height:36px;line-height:36px}.dropdown .checkbox-select .input-helper:before{top:10px}.dropdown .checkbox-select .input-helper:after{top:12px}.dropdown .checkbox-select:hover{background:#d5dddf}\n"], dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1530
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MultiselectComponent, decorators: [{
1531
- type: Component,
1532
- args: [{ selector: 'velo-multiselect', providers: [
1533
- {
1534
- provide: NG_VALUE_ACCESSOR,
1535
- multi: true,
1536
- useExisting: MultiselectComponent,
1537
- },
1538
- ], template: "<div class=\"value-wrapper\" (click)=\"toggleOpened()\">\n <span class=\"value\">{{ displayValue }}</span>\n <i class=\"fa fa-chevron-down\"></i>\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"dropdown\">\n <div class=\"checkbox-select\" *ngFor=\"let option of options\">\n <label>\n <input\n type=\"checkbox\"\n [checked]=\"selected.includes(option)\"\n (change)=\"handleSelection(option)\"\n [value]=\"option\"\n />\n\n <i class=\"input-helper\"></i>\n {{ option }}\n </label>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:block;width:172px}:host[disabled] .value-wrapper{pointer-events:none;background:rgba(0,0,0,.06);border-color:#0003}:host.opened .value-wrapper{border-color:#0e8fff}:host.opened i{transform:rotate(180deg)}:host .value-wrapper{cursor:pointer;display:flex;align-items:center;justify-content:space-between;height:34px;padding:0 10px;border:1px solid #ddd;border-radius:3px;background:#fff}:host .value-wrapper .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown{width:172px;max-height:200px;background:#fff;border:1px solid #ddd;border-radius:3px;overflow:auto}.dropdown .checkbox-select{padding:0 10px;width:100%}.dropdown .checkbox-select label{width:100%;height:36px;line-height:36px}.dropdown .checkbox-select .input-helper:before{top:10px}.dropdown .checkbox-select .input-helper:after{top:12px}.dropdown .checkbox-select:hover{background:#d5dddf}\n"] }]
1539
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1$1.Overlay }]; }, propDecorators: { options: [{
1540
- type: Input
1541
- }], selectionChange: [{
1542
- type: Output
1543
- }], overlayTemplate: [{
1544
- type: ViewChild,
1545
- args: ['overlayTemplate']
1546
- }], opened: [{
1547
- type: HostBinding,
1548
- args: ['class.opened']
1549
- }] } });
1550
-
1551
- class VeloAttributeComponent extends VeloAttributeDirective {
1552
- constructor(formScope, sectionScope) {
1553
- var _a, _b;
1554
- super(formScope, sectionScope);
1555
- this.controlName = this.section.id;
1556
- this.displayName = this.getDisplayName();
1557
- this.isMultiselect =
1558
- ((_b = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.attributes.find(attr => attr.name === this.section.boundData.entity.name)) === null || _b === void 0 ? void 0 : _b.type) ===
1559
- 'MULTIPLE';
1560
- }
1561
- getValueOptions(valueOptions) {
1562
- return this.isBooleanType(valueOptions) ? [0, 1] : valueOptions;
1563
- }
1564
- getValueText(valueOptions, value) {
1565
- if (this.isBooleanType(valueOptions)) {
1566
- return value === 0 ? 'False' : 'True';
1567
- }
1568
- return value;
1569
- }
1570
- handleMultiselectChange(value) {
1571
- var _a;
1572
- const formControl = this.form.get(this.controlName);
1573
- if (!formControl) {
1574
- return;
1575
- }
1576
- const currentValue = (_a = formControl.value) !== null && _a !== void 0 ? _a : [];
1577
- const newValue = currentValue.includes(value) ? currentValue.filter(v => v !== value) : [...currentValue, value];
1578
- formControl.setValue(newValue);
1579
- super.handleChange();
1580
- }
1581
- handleMultipleDropdownChange(event) {
1582
- const formControl = this.form.get(this.controlName);
1583
- if (!formControl) {
1584
- return;
1585
- }
1586
- formControl.setValue(event);
1587
- super.handleChange();
1588
- }
1589
- isBooleanType(value) {
1590
- return Array.isArray(value) && value.length === 1 && value[0].min === 0 && value[0].max === 1;
1591
- }
1592
- getDisplayName() {
1593
- var _a, _b;
1594
- return ((((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.properties) && this.section.model.properties['displayName']) || ((_b = this.section.model) === null || _b === void 0 ? void 0 : _b.type) || '');
1595
- }
1596
- }
1597
- VeloAttributeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloAttributeComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
1598
- VeloAttributeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloAttributeComponent, selector: "velo-attribute", usesInheritance: true, ngImport: i0, template: "<div class=\"form-group div-inline\" [formGroup]=\"form\">\n <div class=\"input-form-input div-inline\" [class.input-form-input--required]=\"section.required\">\n <label>\n <ng-container *ngIf=\"section.required\"> * </ng-container>\n\n {{ section.label }}\n </label>\n <div [ngSwitch]=\"section.controlType\" class=\"form-control-wrapper\">\n <div *ngSwitchCase=\"'DROPDOWN'\">\n <select\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n class=\"form-control\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <option\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions) || []\"\n [ngValue]=\"valueOption\"\n >\n {{ getValueText(section.sectionValue?.valueOptions, valueOption) }}\n </option>\n </select>\n </div>\n\n <div *ngSwitchCase=\"'MULTISELECT'\">\n <velo-multiselect\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [options]=\"getValueOptions(section.sectionValue?.valueOptions)\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n (selectionChange)=\"handleMultipleDropdownChange($event)\"\n ></velo-multiselect>\n </div>\n\n <div *ngSwitchCase=\"'RADIO'\">\n <div\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions)\"\n class=\"radio-button\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <label>\n <input\n type=\"radio\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [value]=\"valueOption\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n <i class=\"input-helper\"></i>\n {{ getValueText(section.sectionValue?.valueOptions, valueOption) }}\n </label>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'CHECKBOX'\">\n <ng-container *ngIf=\"!isMultiselect; else multiselect\">\n <div class=\"checkbox-select\" [attr.disabled]=\"section.readOnly ? true : null\">\n <label>\n <input\n type=\"checkbox\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [checked]=\"section.sectionValue?.value === 1\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n\n <i class=\"input-helper\"></i>\n &nbsp;\n </label>\n </div>\n </ng-container>\n\n <ng-template #multiselect>\n <div\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions)\"\n class=\"checkbox-select\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <label>\n <input\n type=\"checkbox\"\n [id]=\"controlName\"\n [checked]=\"section.sectionValue?.value.includes(valueOption)\"\n (change)=\"handleMultiselectChange(valueOption)\"\n [value]=\"valueOption\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n\n <i class=\"input-helper\"></i>\n {{ valueOption }}\n </label>\n </div>\n </ng-template>\n </div>\n\n <div *ngSwitchCase=\"'DATE'\">\n <input\n type=\"text\"\n class=\"form-control\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n (bsValueChange)=\"handleChangDate($event)\"\n bsDatepicker\n />\n </div>\n\n <div *ngSwitchDefault>\n <input\n type=\"text\"\n class=\"form-control\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n (blur)=\"form.controls[controlName].dirty && handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n </div>\n\n <!-- Add validation messages -->\n <!-- <div validation-messages [form]=\"form\" [controlId]=\"controlName\" [showForPristine]=\"true\"></div> -->\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MultiselectComponent, selector: "velo-multiselect", inputs: ["options"], outputs: ["selectionChange"] }] });
1599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloAttributeComponent, decorators: [{
1600
- type: Component,
1601
- args: [{ selector: 'velo-attribute', template: "<div class=\"form-group div-inline\" [formGroup]=\"form\">\n <div class=\"input-form-input div-inline\" [class.input-form-input--required]=\"section.required\">\n <label>\n <ng-container *ngIf=\"section.required\"> * </ng-container>\n\n {{ section.label }}\n </label>\n <div [ngSwitch]=\"section.controlType\" class=\"form-control-wrapper\">\n <div *ngSwitchCase=\"'DROPDOWN'\">\n <select\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n class=\"form-control\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <option\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions) || []\"\n [ngValue]=\"valueOption\"\n >\n {{ getValueText(section.sectionValue?.valueOptions, valueOption) }}\n </option>\n </select>\n </div>\n\n <div *ngSwitchCase=\"'MULTISELECT'\">\n <velo-multiselect\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [options]=\"getValueOptions(section.sectionValue?.valueOptions)\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n (selectionChange)=\"handleMultipleDropdownChange($event)\"\n ></velo-multiselect>\n </div>\n\n <div *ngSwitchCase=\"'RADIO'\">\n <div\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions)\"\n class=\"radio-button\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <label>\n <input\n type=\"radio\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [value]=\"valueOption\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n <i class=\"input-helper\"></i>\n {{ getValueText(section.sectionValue?.valueOptions, valueOption) }}\n </label>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'CHECKBOX'\">\n <ng-container *ngIf=\"!isMultiselect; else multiselect\">\n <div class=\"checkbox-select\" [attr.disabled]=\"section.readOnly ? true : null\">\n <label>\n <input\n type=\"checkbox\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [checked]=\"section.sectionValue?.value === 1\"\n (change)=\"handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n\n <i class=\"input-helper\"></i>\n &nbsp;\n </label>\n </div>\n </ng-container>\n\n <ng-template #multiselect>\n <div\n *ngFor=\"let valueOption of getValueOptions(section.sectionValue?.valueOptions)\"\n class=\"checkbox-select\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n >\n <label>\n <input\n type=\"checkbox\"\n [id]=\"controlName\"\n [checked]=\"section.sectionValue?.value.includes(valueOption)\"\n (change)=\"handleMultiselectChange(valueOption)\"\n [value]=\"valueOption\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n\n <i class=\"input-helper\"></i>\n {{ valueOption }}\n </label>\n </div>\n </ng-template>\n </div>\n\n <div *ngSwitchCase=\"'DATE'\">\n <input\n type=\"text\"\n class=\"form-control\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n (bsValueChange)=\"handleChangDate($event)\"\n bsDatepicker\n />\n </div>\n\n <div *ngSwitchDefault>\n <input\n type=\"text\"\n class=\"form-control\"\n [id]=\"controlName\"\n [formControlName]=\"controlName\"\n (blur)=\"form.controls[controlName].dirty && handleChange()\"\n [attr.disabled]=\"section.readOnly ? true : null\"\n />\n </div>\n\n <!-- Add validation messages -->\n <!-- <div validation-messages [form]=\"form\" [controlId]=\"controlName\" [showForPristine]=\"true\"></div> -->\n </div>\n </div>\n</div>\n" }]
1602
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
1603
-
1604
- class VeloPortCheckBoxComponent {
1605
- constructor(formScope, sectionScope) {
1606
- var _a;
1607
- this.formScope = formScope;
1608
- this.sectionScope = sectionScope;
1609
- this.showSelectAll = false;
1610
- this.form = this.formScope.form;
1611
- this.section = this.sectionScope.section;
1612
- this.controlName = this.section.id;
1613
- (_a = this.section.sectionValue) === null || _a === void 0 ? void 0 : _a.valueOptions.forEach(item => {
1614
- if (this.hasValueFor(item)) {
1615
- this.form.controls[this.controlName].setValue(item);
1616
- }
1617
- });
1618
- }
1619
- handleChange(valueOption) {
1620
- const updateData = {
1621
- id: this.section.id,
1622
- action: this.hasValueFor(valueOption)
1623
- ? 'remove'
1624
- : this.section.model && SectionsBinderHelper.isAddAllowed(this.section.model, this.section.boundData.name)
1625
- ? 'create'
1626
- : 'update',
1627
- valueOption,
1628
- };
1629
- this.formScope.publishFormUpdate(updateData);
1630
- }
1631
- hasValueFor(valueOption) {
1632
- return !!this.findLineItemForValue(valueOption);
1633
- }
1634
- selectAllChange() {
1635
- var _a;
1636
- const portDomain = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.portDomains[this.section.boundData.name];
1637
- const updateData = {
1638
- id: this.section.id,
1639
- action: 'upsert',
1640
- selectedValueOptions: this.isAllSelected() ? [] : portDomain ? portDomain.domainTypes.map(t => t.name) : [],
1641
- };
1642
- this.formScope.publishFormUpdate(updateData);
1643
- }
1644
- isAllSelected() {
1645
- var _a, _b;
1646
- const selected = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems.filter(li => li.port && li.port === this.section.boundData.name);
1647
- const portDomain = (_b = this.section.model) === null || _b === void 0 ? void 0 : _b.portDomains[this.section.boundData.name];
1648
- return portDomain ? portDomain.domainTypes.length === (selected === null || selected === void 0 ? void 0 : selected.length) : false;
1649
- }
1650
- getMessages(valueOption) {
1651
- var _a, _b, _c;
1652
- if ((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems) {
1653
- return (_c = (_b = this.findLineItemForValue(valueOption)) === null || _b === void 0 ? void 0 : _b.messages) !== null && _c !== void 0 ? _c : [];
1654
- }
1655
- return [];
1656
- }
1657
- findLineItemForValue(valueOption) {
1658
- var _a;
1659
- return (((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems) &&
1660
- this.section.model.lineItems.find(li => li.type && li.type.toLowerCase() === valueOption.toLowerCase()));
1661
- }
1662
- }
1663
- VeloPortCheckBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortCheckBoxComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
1664
- VeloPortCheckBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloPortCheckBoxComponent, selector: "velo-port-checkbox", inputs: { showSelectAll: "showSelectAll" }, ngImport: i0, template: "<div [formGroup]=\"form\">\n <!--TODO ALE replace divs with ng-templates-->\n <div *ngIf=\"showSelectAll\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-checkbox collapsed\">\n <div class=\"box-title\">\n <div class=\"header clearfix\">\n <div class=\"checkbox-select\">\n <label>\n <input type=\"checkbox\" (change)=\"selectAllChange()\" [checked]=\"isAllSelected()\" />\n\n <i class=\"input-helper\"></i>\n Select All\n </label>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngFor=\"let valueOption of section.sectionValue?.valueOptions\">\n <div class=\"unchecked\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-checkbox collapsed\">\n <div class=\"box-title\" (click)=\"handleChange(valueOption)\">\n <div class=\"header clearfix\">\n <div class=\"checkbox-select\">\n <label>\n <input\n type=\"checkbox\"\n [class.checkbox--checked]=\"valueOption === form.controls[controlName].value\"\n />\n\n <i class=\"input-helper\"></i>\n {{section.sectionValue?.displayValues?.[valueOption] || valueOption}}\n </label>\n </div>\n </div>\n\n <div class=\"box-actions\" *ngIf=\"hasValueFor(valueOption)\">\n <ng-template #msgTemplate>\n <div class=\"runtime-info-message\">\n <ul class=\"message-text\">\n <li *ngFor=\"let message of getMessages(valueOption)\">{{ message }}</li>\n </ul>\n </div>\n </ng-template>\n <!-- removed dependency: ngx-bootstrap -->\n <!-- <div\n class=\"box-action-button\"\n *ngIf=\"getMessages(valueOption).length > 0\"\n [popover]=\"msgTemplate\"\n placement=\"left\"\n container=\"body\"\n [isOpen]=\"true\"\n >\n <a href=\"javascript:void(0);\">\n <i class=\"fa fa-info check-icon\"></i>\n </a>\n </div> -->\n </div>\n </div>\n <div class=\"box-content-wrapper\">\n <div class=\"box-content\">&nbsp;</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
1665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortCheckBoxComponent, decorators: [{
1666
- type: Component,
1667
- args: [{ selector: 'velo-port-checkbox', template: "<div [formGroup]=\"form\">\n <!--TODO ALE replace divs with ng-templates-->\n <div *ngIf=\"showSelectAll\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-checkbox collapsed\">\n <div class=\"box-title\">\n <div class=\"header clearfix\">\n <div class=\"checkbox-select\">\n <label>\n <input type=\"checkbox\" (change)=\"selectAllChange()\" [checked]=\"isAllSelected()\" />\n\n <i class=\"input-helper\"></i>\n Select All\n </label>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngFor=\"let valueOption of section.sectionValue?.valueOptions\">\n <div class=\"unchecked\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-checkbox collapsed\">\n <div class=\"box-title\" (click)=\"handleChange(valueOption)\">\n <div class=\"header clearfix\">\n <div class=\"checkbox-select\">\n <label>\n <input\n type=\"checkbox\"\n [class.checkbox--checked]=\"valueOption === form.controls[controlName].value\"\n />\n\n <i class=\"input-helper\"></i>\n {{section.sectionValue?.displayValues?.[valueOption] || valueOption}}\n </label>\n </div>\n </div>\n\n <div class=\"box-actions\" *ngIf=\"hasValueFor(valueOption)\">\n <ng-template #msgTemplate>\n <div class=\"runtime-info-message\">\n <ul class=\"message-text\">\n <li *ngFor=\"let message of getMessages(valueOption)\">{{ message }}</li>\n </ul>\n </div>\n </ng-template>\n <!-- removed dependency: ngx-bootstrap -->\n <!-- <div\n class=\"box-action-button\"\n *ngIf=\"getMessages(valueOption).length > 0\"\n [popover]=\"msgTemplate\"\n placement=\"left\"\n container=\"body\"\n [isOpen]=\"true\"\n >\n <a href=\"javascript:void(0);\">\n <i class=\"fa fa-info check-icon\"></i>\n </a>\n </div> -->\n </div>\n </div>\n <div class=\"box-content-wrapper\">\n <div class=\"box-content\">&nbsp;</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n<ng-content></ng-content>\n" }]
1668
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; }, propDecorators: { showSelectAll: [{
1669
- type: Input
1670
- }] } });
1671
-
1672
- class VeloPortDropdownComponent {
1673
- constructor(formScope, sectionScope) {
1674
- var _a;
1675
- this.formScope = formScope;
1676
- this.sectionScope = sectionScope;
1677
- this.prices = {};
1678
- this.form = this.formScope.form;
1679
- this.section = this.sectionScope.section;
1680
- this.controlName = this.section.id;
1681
- this.qtyControlName = this.section.id + 'qty';
1682
- if (this.section.pricingEnabled) {
1683
- (_a = this.section.sectionValue) === null || _a === void 0 ? void 0 : _a.valueOptions.forEach(valueOption => {
1684
- this.prices[valueOption] = this.findPriceItemsForValue(valueOption);
1685
- });
1686
- }
1687
- }
1688
- isAddAllowed() {
1689
- if (!EntityUtil.isPresent(this.form.controls[this.controlName].value)) {
1690
- return false;
1691
- }
1692
- return this.section.model
1693
- ? SectionsBinderHelper.isAddAllowed(this.section.model, this.section.boundData.name)
1694
- : false;
1695
- }
1696
- handleCreate() {
1697
- if (this.form.invalid || !this.isAddAllowed()) {
1698
- return;
1699
- }
1700
- const updateData = {
1701
- id: this.section.id,
1702
- action: 'create',
1703
- };
1704
- this.formScope.publishFormUpdate(updateData);
1705
- }
1706
- findPriceItemsForValue(valueOption) {
1707
- var _a;
1708
- let prices = [];
1709
- if (valueOption) {
1710
- const portDomain = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.portDomains[this.section.boundData.name];
1711
- const domainType = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.find(d => d.name.toLowerCase() === valueOption.toLowerCase());
1712
- if (domainType && domainType.recommendedPrices) {
1713
- prices = domainType.recommendedPrices;
1714
- }
1715
- }
1716
- const oneTime = {
1717
- chargeMethod: 'ONE_TIME',
1718
- netPrice: 0,
1719
- listPrice: 0,
1720
- chargeType: '',
1721
- };
1722
- const recurring = {
1723
- chargeMethod: 'RECURRING',
1724
- netPrice: 0,
1725
- listPrice: 0,
1726
- chargeType: '',
1727
- };
1728
- prices.forEach(p => {
1729
- if (p.chargeMethod === oneTime.chargeMethod) {
1730
- this.add(oneTime, p);
1731
- }
1732
- if (p.chargeMethod === recurring.chargeMethod) {
1733
- this.add(recurring, p);
1734
- }
1735
- });
1736
- const result = [];
1737
- if (oneTime.listPrice > 0) {
1738
- result.push(oneTime);
1739
- }
1740
- if (recurring.listPrice > 0) {
1741
- result.push(recurring);
1742
- }
1743
- return result;
1744
- }
1745
- add(target, src) {
1746
- target.netPrice = target.netPrice + src.netPrice;
1747
- target.listPrice = target.listPrice + src.listPrice;
1748
- if (src.explanation) {
1749
- target.explanation = src.explanation;
1750
- }
1751
- }
1752
- }
1753
- VeloPortDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortDropdownComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
1754
- VeloPortDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloPortDropdownComponent, selector: "velo-port-dropdown", ngImport: i0, template: "<div class=\"form-group col-md-12\" [formGroup]=\"form\">\n <div class=\"input-form-input div-inline\">\n <label [for]=\"controlName\">{{ section.label }}</label>\n <div class=\"form-control-wrapper\">\n <select [id]=\"controlName\" [formControlName]=\"controlName\" class=\"form-control\">\n <option *ngFor=\"let valueOption of section.sectionValue?.valueOptions\" [ngValue]=\"valueOption\">\n {{section.sectionValue?.displayValues?.[valueOption] || valueOption}}\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <span>${{ prices[valueOption][0].netPrice }}</span>\n <span *ngIf=\"prices[valueOption].length > 1\">\n <span>, </span>\n <span>${{ prices[valueOption][1].netPrice }}</span>\n </span>\n </span>\n </option>\n </select>\n </div>\n </div>\n <div class=\"input-form-input div-inline quantity-form-input\">\n <label [for]=\"qtyControlName\"> Quantity </label>\n <div class=\"form-control-wrapper\">\n <input [id]=\"qtyControlName\" [formControlName]=\"qtyControlName\" type=\"text\" class=\"form-control\" size=\"3\" />\n\n <div\n class=\"validation-message\"\n [hidden]=\"form.controls[qtyControlName].valid || form.controls[qtyControlName].pristine\"\n >\n <div *ngFor=\"let key of form.controls[qtyControlName].errors | values\">\n <span> {{form.controls[qtyControlName]?.errors?.[key].message}}</span>\n </div>\n </div>\n\n <a href=\"javascript:void(0);\" (click)=\"handleCreate()\">\n <div class=\"add-config-control\" [attr.disabled]=\"form.valid && isAddAllowed() ? null : true\">\n <i class=\"fa fa-plus plus-icon\"></i>\n </div>\n </a>\n </div>\n </div>\n</div>\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i7.ValuesPipe, name: "values" }] });
1755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortDropdownComponent, decorators: [{
1756
- type: Component,
1757
- args: [{ selector: 'velo-port-dropdown', template: "<div class=\"form-group col-md-12\" [formGroup]=\"form\">\n <div class=\"input-form-input div-inline\">\n <label [for]=\"controlName\">{{ section.label }}</label>\n <div class=\"form-control-wrapper\">\n <select [id]=\"controlName\" [formControlName]=\"controlName\" class=\"form-control\">\n <option *ngFor=\"let valueOption of section.sectionValue?.valueOptions\" [ngValue]=\"valueOption\">\n {{section.sectionValue?.displayValues?.[valueOption] || valueOption}}\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <span>${{ prices[valueOption][0].netPrice }}</span>\n <span *ngIf=\"prices[valueOption].length > 1\">\n <span>, </span>\n <span>${{ prices[valueOption][1].netPrice }}</span>\n </span>\n </span>\n </option>\n </select>\n </div>\n </div>\n <div class=\"input-form-input div-inline quantity-form-input\">\n <label [for]=\"qtyControlName\"> Quantity </label>\n <div class=\"form-control-wrapper\">\n <input [id]=\"qtyControlName\" [formControlName]=\"qtyControlName\" type=\"text\" class=\"form-control\" size=\"3\" />\n\n <div\n class=\"validation-message\"\n [hidden]=\"form.controls[qtyControlName].valid || form.controls[qtyControlName].pristine\"\n >\n <div *ngFor=\"let key of form.controls[qtyControlName].errors | values\">\n <span> {{form.controls[qtyControlName]?.errors?.[key].message}}</span>\n </div>\n </div>\n\n <a href=\"javascript:void(0);\" (click)=\"handleCreate()\">\n <div class=\"add-config-control\" [attr.disabled]=\"form.valid && isAddAllowed() ? null : true\">\n <i class=\"fa fa-plus plus-icon\"></i>\n </div>\n </a>\n </div>\n </div>\n</div>\n<ng-content></ng-content>\n" }]
1758
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
1759
-
1760
- class VeloPortRadioComponent {
1761
- constructor(formScope, sectionScope) {
1762
- this.formScope = formScope;
1763
- this.sectionScope = sectionScope;
1764
- this.prices = {};
1765
- this.form = this.formScope.form;
1766
- this.section = this.sectionScope.section;
1767
- this.controlName = this.section.id;
1768
- }
1769
- ngOnInit() {
1770
- var _a;
1771
- this.initPriceItems();
1772
- (_a = this.section.sectionValue) === null || _a === void 0 ? void 0 : _a.valueOptions.forEach(item => {
1773
- if (this.hasValueFor(item)) {
1774
- this.form.controls[this.controlName].setValue(item);
1775
- }
1776
- });
1777
- }
1778
- handleChange(event, valueOption) {
1779
- event.preventDefault();
1780
- event.stopPropagation();
1781
- const updateData = {
1782
- id: this.section.id,
1783
- action: this.hasPreviousValue() ? 'update' : 'create',
1784
- valueOption,
1785
- };
1786
- this.form.controls[this.controlName].setValue(valueOption);
1787
- this.form.controls[this.controlName].markAsDirty();
1788
- this.formScope.publishFormUpdate(updateData);
1789
- }
1790
- hasValueFor(valueOption) {
1791
- return !!this.findLineItemForValue(valueOption);
1792
- }
1793
- getMessages(valueOption) {
1794
- var _a;
1795
- const lineItem = this.findLineItemForValue(valueOption);
1796
- if (((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems) && lineItem) {
1797
- return lineItem.messages;
1798
- }
1799
- return [];
1800
- }
1801
- toString(price) {
1802
- let result = '';
1803
- if (price.listPrice > price.netPrice) {
1804
- result += '<strike>' + price.listPrice + '</strike>';
1805
- }
1806
- result += price.netPrice;
1807
- if (price.explanation) {
1808
- result += '(' + price.explanation + ')';
1809
- }
1810
- return result;
1811
- }
1812
- hasPreviousValue() {
1813
- var _a;
1814
- const previous = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems.filter(li => li.port && li.port === this.section.boundData.name);
1815
- return previous ? previous.length > 0 : false;
1816
- }
1817
- findLineItemForValue(valueOption) {
1818
- return this.section.model ? LineItemUtil.findLineItemForValue(this.section.model, valueOption) : undefined;
1819
- }
1820
- initPriceItems() {
1821
- var _a;
1822
- this.prices = {};
1823
- if (this.section.pricingEnabled) {
1824
- (_a = this.section.sectionValue) === null || _a === void 0 ? void 0 : _a.valueOptions.forEach(valueOption => {
1825
- this.prices[valueOption] = this.findPriceItemsForValue(valueOption);
1826
- });
1827
- }
1828
- }
1829
- findPriceItemsForValue(valueOption) {
1830
- var _a, _b;
1831
- let prices = [];
1832
- if (valueOption) {
1833
- const lineItem = ((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.lineItems) &&
1834
- this.section.model.lineItems.find(li => li.type && li.type.toLowerCase() === valueOption.toLowerCase());
1835
- if (lineItem && lineItem.chargeItems) {
1836
- prices = lineItem.chargeItems.map(pi => {
1837
- const price = {
1838
- listPrice: pi.listPrice,
1839
- netPrice: pi.netPrice,
1840
- chargeMethod: pi.chargeMethod,
1841
- chargeType: pi.chargeType,
1842
- };
1843
- return price;
1844
- });
1845
- }
1846
- else {
1847
- const portDomain = (_b = this.section.model) === null || _b === void 0 ? void 0 : _b.portDomains[this.section.boundData.name];
1848
- const domainType = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.find(d => d.name.toLowerCase() === valueOption.toLowerCase());
1849
- if (domainType && domainType.recommendedPrices) {
1850
- prices = domainType.recommendedPrices;
1851
- }
1852
- }
1853
- }
1854
- const oneTime = {
1855
- chargeMethod: 'ONE_TIME',
1856
- netPrice: 0,
1857
- listPrice: 0,
1858
- chargeType: '',
1859
- };
1860
- const recurring = {
1861
- chargeMethod: 'RECURRING',
1862
- netPrice: 0,
1863
- listPrice: 0,
1864
- chargeType: '',
1865
- };
1866
- prices.forEach(p => {
1867
- if (p.chargeMethod === oneTime.chargeMethod) {
1868
- this.add(oneTime, p);
1869
- }
1870
- if (p.chargeMethod === recurring.chargeMethod) {
1871
- this.add(recurring, p);
1872
- }
1873
- });
1874
- const result = [];
1875
- if (oneTime.listPrice > 0) {
1876
- result.push(oneTime);
1877
- }
1878
- if (recurring.listPrice > 0) {
1879
- result.push(recurring);
1880
- }
1881
- return result;
1882
- }
1883
- add(target, src) {
1884
- target.netPrice = target.netPrice + src.netPrice;
1885
- target.listPrice = target.listPrice + src.listPrice;
1886
- if (src.explanation) {
1887
- target.explanation = src.explanation;
1888
- }
1889
- }
1890
- }
1891
- VeloPortRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortRadioComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
1892
- VeloPortRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloPortRadioComponent, selector: "velo-port-radio", ngImport: i0, template: "<div [formGroup]=\"form\">\n <!--TODO ALE replace divs with ng-templates-->\n <ng-container *ngFor=\"let valueOption of section.sectionValue?.valueOptions\">\n <div class=\"unchecked\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-radio\">\n <div class=\"box-title\" (click)=\"handleChange($event, valueOption)\">\n <div class=\"header clearfix\">\n <div class=\"radio-button\">\n <label>\n <input type=\"radio\" [id]=\"controlName\" [value]=\"valueOption\" [formControlName]=\"controlName\" />\n\n <i class=\"input-helper\"></i>\n\n {{ section.sectionValue?.displayValues?.[valueOption] || valueOption }}\n\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <span>${{ prices[valueOption][0].netPrice }}</span>\n\n <span *ngIf=\"prices[valueOption].length > 1\">\n <span>, </span>\n\n <span>${{ prices[valueOption][1].netPrice }}</span>\n </span>\n </span>\n </label>\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <div>{{ prices[valueOption][0].explanation }}</div>\n\n <span *ngIf=\"prices[valueOption].length > 1 && prices[valueOption][1].explanation\">\n <div>{{ prices[valueOption][1].explanation }}</div>\n </span>\n </span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
1893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortRadioComponent, decorators: [{
1894
- type: Component,
1895
- args: [{ selector: 'velo-port-radio', template: "<div [formGroup]=\"form\">\n <!--TODO ALE replace divs with ng-templates-->\n <ng-container *ngFor=\"let valueOption of section.sectionValue?.valueOptions\">\n <div class=\"unchecked\">\n <div class=\"row no-gutter clearfix\">\n <div class=\"col-md-12\">\n <div class=\"content\">\n <div class=\"container-box container-box-bordered container-box-radio\">\n <div class=\"box-title\" (click)=\"handleChange($event, valueOption)\">\n <div class=\"header clearfix\">\n <div class=\"radio-button\">\n <label>\n <input type=\"radio\" [id]=\"controlName\" [value]=\"valueOption\" [formControlName]=\"controlName\" />\n\n <i class=\"input-helper\"></i>\n\n {{ section.sectionValue?.displayValues?.[valueOption] || valueOption }}\n\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <span>${{ prices[valueOption][0].netPrice }}</span>\n\n <span *ngIf=\"prices[valueOption].length > 1\">\n <span>, </span>\n\n <span>${{ prices[valueOption][1].netPrice }}</span>\n </span>\n </span>\n </label>\n <span *ngIf=\"prices[valueOption] && prices[valueOption].length > 0\">\n <div>{{ prices[valueOption][0].explanation }}</div>\n\n <span *ngIf=\"prices[valueOption].length > 1 && prices[valueOption][1].explanation\">\n <div>{{ prices[valueOption][1].explanation }}</div>\n </span>\n </span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-content></ng-content>\n" }]
1896
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
1897
-
1898
- class VeloTypeComponent {
1899
- constructor(formScope, collapsibleState, sectionScope, messageService) {
1900
- var _a, _b;
1901
- this.formScope = formScope;
1902
- this.collapsibleState = collapsibleState;
1903
- this.sectionScope = sectionScope;
1904
- this.messageService = messageService;
1905
- this.messageBucketId = 'ui-runtime';
1906
- this.indent = 1;
1907
- this.prices = [];
1908
- this.form = this.formScope.form;
1909
- this.section = this.sectionScope.section;
1910
- this.indent = this.sectionScope.indent;
1911
- this.controlName = this.section.id;
1912
- this.qtyControlName = this.section.id + 'qty';
1913
- this.displayName =
1914
- (((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.properties) && this.section.model.properties['displayName']) ||
1915
- ((_b = this.section.model) === null || _b === void 0 ? void 0 : _b.type) ||
1916
- '';
1917
- }
1918
- ngOnInit() {
1919
- var _a, _b;
1920
- if (this.section.pricingEnabled) {
1921
- this.prices = this.getPrices();
1922
- }
1923
- if (this.section.controlType === 'MESSAGE') {
1924
- this.messageService.clear(this.messageBucketId);
1925
- (_b = (_a = this.section.model) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b.forEach(message => {
1926
- this.messageService.add({ key: this.messageBucketId, summary: message });
1927
- });
1928
- }
1929
- }
1930
- handleRemove() {
1931
- const updateData = {
1932
- id: this.section.id,
1933
- action: 'remove',
1934
- };
1935
- this.formScope.publishFormUpdate(updateData);
1936
- }
1937
- handleQuantityUpdate() {
1938
- const updateData = {
1939
- id: this.section.id,
1940
- action: 'qtyUpdate',
1941
- };
1942
- this.formScope.publishFormUpdate(updateData);
1943
- }
1944
- toggleCollapse() {
1945
- if (this.section.model) {
1946
- this.collapsibleState.toggleCollapse(this.section.model.id);
1947
- }
1948
- }
1949
- getPrices() {
1950
- var _a;
1951
- let prices = [];
1952
- if ((_a = this.section.model) === null || _a === void 0 ? void 0 : _a.chargeItems) {
1953
- prices = this.section.model.chargeItems.map(pi => {
1954
- const price = {
1955
- listPrice: pi.listPrice,
1956
- netPrice: pi.netPrice,
1957
- chargeMethod: pi.chargeMethod,
1958
- chargeType: pi.chargeType,
1959
- };
1960
- return price;
1961
- });
1962
- }
1963
- const oneTime = {
1964
- chargeMethod: 'ONE_TIME',
1965
- netPrice: 0,
1966
- listPrice: 0,
1967
- chargeType: '',
1968
- };
1969
- const recurring = {
1970
- chargeMethod: 'RECURRING',
1971
- netPrice: 0,
1972
- listPrice: 0,
1973
- chargeType: '',
1974
- };
1975
- prices.forEach(p => {
1976
- if (p.chargeMethod === oneTime.chargeMethod) {
1977
- this.add(oneTime, p);
1978
- }
1979
- if (p.chargeMethod === recurring.chargeMethod) {
1980
- this.add(recurring, p);
1981
- }
1982
- });
1983
- const result = [];
1984
- if (oneTime.listPrice > 0) {
1985
- result.push(oneTime);
1986
- }
1987
- if (recurring.listPrice > 0) {
1988
- result.push(recurring);
1989
- }
1990
- return result;
1991
- }
1992
- add(target, src) {
1993
- target.netPrice = target.netPrice + src.netPrice;
1994
- target.listPrice = target.listPrice + src.listPrice;
1995
- if (src.explanation) {
1996
- target.explanation = src.explanation;
1997
- }
1998
- }
1999
- }
2000
- VeloTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloTypeComponent, deps: [{ token: FormScopeService }, { token: CollapsibleStateService }, { token: SectionScopeService }, { token: i3$1.MessageService }], target: i0.ɵɵFactoryTarget.Component });
2001
- VeloTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloTypeComponent, selector: "velo-type", ngImport: i0, template: "<div class=\"container-box div-block collapsed container-box-bordered\" [formGroup]=\"form\">\n <div class=\"box-title\">\n <div class=\"header clearfix\">\n <div>\n <div class=\"header-label div-inline\">\n {{ displayName }}\n <span *ngIf=\"prices.length > 0\">\n <span>${{ prices[0].netPrice }}</span>\n <span *ngIf=\"prices.length > 1\">\n <span>, </span>\n <span>${{ prices[1].netPrice }}</span>\n </span>\n </span>\n </div>\n\n <div class=\"header-qty-container input-form-input\">\n <input\n [id]=\"qtyControlName\"\n [formControlName]=\"qtyControlName\"\n (blur)=\"form.controls[qtyControlName].valid && handleQuantityUpdate()\"\n type=\"text\"\n class=\"form-control\"\n size=\"3\"\n />\n <div class=\"validation-message\">\n <div *ngFor=\"let key of form.controls[qtyControlName].errors | values\">\n <span>\n {{ form.controls[qtyControlName]?.errors?.[key].message }}\n </span>\n </div>\n <span *ngIf=\"form.controls[qtyControlName].valid\"> &nbsp; </span>\n </div>\n <span *ngIf=\"prices.length > 0\">\n <div>{{ prices[0].explanation }}</div>\n <span *ngIf=\"prices.length > 1 && prices[1].explanation\">\n <div>{{ prices[1].explanation }}</div>\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"box-actions\">\n <ng-container *ngIf=\"section.controlType !== 'MESSAGE'\">\n <ng-template #msgTemplate>\n <div class=\"runtime-info-message\">\n <ul class=\"message-text\">\n <li *ngFor=\"let message of section.model?.messages\">{{ message }}</li>\n </ul>\n </div>\n </ng-template>\n\n <!-- removed dependency: ngx-bootstrap -->\n <!-- <div\n class=\"box-action-button\"\n *ngIf=\"(section.model?.messages?.length ?? 0) > 0\"\n [popover]=\"msgTemplate\"\n placement=\"left\"\n container=\"body\"\n [isOpen]=\"true\"\n >\n <a href=\"javascript:void(0);\">\n <i class=\"fa fa-info check-icon\"></i>\n </a>\n </div> -->\n </ng-container>\n\n <div\n class=\"box-action-button\"\n (click)=\"toggleCollapse()\"\n [hidden]=\"!section.children || section.children.length < 1\"\n >\n <a><i class=\"fa fa-chevron-down check-icon\"></i></a>\n </div>\n\n <div class=\"box-action-button\" (click)=\"handleRemove()\">\n <a><i class=\"fa fa-trash-o check-icon\"></i></a>\n </div>\n </div>\n </div>\n\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i7.ValuesPipe, name: "values" }] });
2002
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloTypeComponent, decorators: [{
2003
- type: Component,
2004
- args: [{ selector: 'velo-type', template: "<div class=\"container-box div-block collapsed container-box-bordered\" [formGroup]=\"form\">\n <div class=\"box-title\">\n <div class=\"header clearfix\">\n <div>\n <div class=\"header-label div-inline\">\n {{ displayName }}\n <span *ngIf=\"prices.length > 0\">\n <span>${{ prices[0].netPrice }}</span>\n <span *ngIf=\"prices.length > 1\">\n <span>, </span>\n <span>${{ prices[1].netPrice }}</span>\n </span>\n </span>\n </div>\n\n <div class=\"header-qty-container input-form-input\">\n <input\n [id]=\"qtyControlName\"\n [formControlName]=\"qtyControlName\"\n (blur)=\"form.controls[qtyControlName].valid && handleQuantityUpdate()\"\n type=\"text\"\n class=\"form-control\"\n size=\"3\"\n />\n <div class=\"validation-message\">\n <div *ngFor=\"let key of form.controls[qtyControlName].errors | values\">\n <span>\n {{ form.controls[qtyControlName]?.errors?.[key].message }}\n </span>\n </div>\n <span *ngIf=\"form.controls[qtyControlName].valid\"> &nbsp; </span>\n </div>\n <span *ngIf=\"prices.length > 0\">\n <div>{{ prices[0].explanation }}</div>\n <span *ngIf=\"prices.length > 1 && prices[1].explanation\">\n <div>{{ prices[1].explanation }}</div>\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"box-actions\">\n <ng-container *ngIf=\"section.controlType !== 'MESSAGE'\">\n <ng-template #msgTemplate>\n <div class=\"runtime-info-message\">\n <ul class=\"message-text\">\n <li *ngFor=\"let message of section.model?.messages\">{{ message }}</li>\n </ul>\n </div>\n </ng-template>\n\n <!-- removed dependency: ngx-bootstrap -->\n <!-- <div\n class=\"box-action-button\"\n *ngIf=\"(section.model?.messages?.length ?? 0) > 0\"\n [popover]=\"msgTemplate\"\n placement=\"left\"\n container=\"body\"\n [isOpen]=\"true\"\n >\n <a href=\"javascript:void(0);\">\n <i class=\"fa fa-info check-icon\"></i>\n </a>\n </div> -->\n </ng-container>\n\n <div\n class=\"box-action-button\"\n (click)=\"toggleCollapse()\"\n [hidden]=\"!section.children || section.children.length < 1\"\n >\n <a><i class=\"fa fa-chevron-down check-icon\"></i></a>\n </div>\n\n <div class=\"box-action-button\" (click)=\"handleRemove()\">\n <a><i class=\"fa fa-trash-o check-icon\"></i></a>\n </div>\n </div>\n </div>\n\n <ng-content></ng-content>\n</div>\n" }]
2005
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: CollapsibleStateService }, { type: SectionScopeService }, { type: i3$1.MessageService }]; } });
2006
-
2007
- class SfQueryDirective {
2008
- constructor(apiService) {
2009
- this.apiService = apiService;
2010
- }
2011
- query(searchRequest, objectName) {
2012
- return this.apiService.query(searchRequest, objectName).toPromise();
2013
- }
2014
- describe(objectName, fieldName) {
2015
- return this.apiService.describe(objectName, fieldName).toPromise();
2016
- }
2017
- describe2(objectName, fieldsNames) {
2018
- return this.apiService.describe2(objectName, fieldsNames).toPromise();
2019
- }
2020
- apexGetRequest(path, params) {
2021
- return this.apiService.apexGetRequest(path, params).toPromise();
2022
- }
2023
- apexPostRequest(path, body) {
2024
- return this.apiService.apexPostRequest(path, body).toPromise();
2025
- }
2026
- }
2027
- SfQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SfQueryDirective, deps: [{ token: i1.SalesforceApiService }], target: i0.ɵɵFactoryTarget.Directive });
2028
- SfQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SfQueryDirective, selector: "sf-query", exportAs: ["sfApi"], ngImport: i0 });
2029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SfQueryDirective, decorators: [{
2030
- type: Directive,
2031
- args: [{
2032
- // eslint-disable-next-line @angular-eslint/directive-selector
2033
- selector: 'sf-query',
2034
- exportAs: 'sfApi',
2035
- }]
2036
- }], ctorParameters: function () { return [{ type: i1.SalesforceApiService }]; } });
2037
-
2038
- class SectionHelperService {
2039
- static findSectionForValue(section, valueOption) {
2040
- if (!EntityUtil.isPresent(section) || !EntityUtil.isPresent(section.children) || EntityUtil.isBlank(valueOption)) {
2041
- return;
2042
- }
2043
- const found = EntityUtil.filterHierarchically(section.children, 'children', ({ model }) => model && model.type.toLowerCase() === valueOption.toLowerCase());
2044
- return found && found.pop();
2045
- }
2046
- getTotalPrices(section) {
2047
- if (!section || !section.model || !section.model.chargeGroupItems) {
2048
- return new Map();
2049
- }
2050
- return PricingUtils.sumPriceByProperty(section.model.chargeGroupItems, 'netPrice', [
2051
- 'chargeMethod',
2052
- 'sellingFrequency',
2053
- ]);
2054
- }
2055
- }
2056
- SectionHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2057
- SectionHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionHelperService });
2058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionHelperService, decorators: [{
2059
- type: Injectable
2060
- }] });
2061
-
2062
- class SectionContextAware {
2063
- constructor(formScope, sectionScope) {
2064
- this.formScope = formScope;
2065
- this.sectionScope = sectionScope;
2066
- }
2067
- ngOnInit() {
2068
- this.form = this.formScope.form;
2069
- this.section = this.sectionScope.section;
2070
- this.initControlNames();
2071
- }
2072
- initControlNames() {
2073
- this.controlName = this.section.id;
2074
- this.qtyControlName = this.section.id + 'qty';
2075
- }
2076
- //TODO ALE CONSIDER STORE INSTEAD OF CALCULATE EVERY TIME
2077
- isAddAllowed(quantityToAdd = 1) {
2078
- return this.section.model
2079
- ? SectionsBinderHelper.isAddAllowed(this.section.model, this.section.boundData.name, quantityToAdd)
2080
- : false;
2081
- }
2082
- isRemoveAllowed(quantityToRemove = 1) {
2083
- return this.section.model
2084
- ? SectionsBinderHelper.isRemoveAllowed(this.section.model, this.section.boundData.name, quantityToRemove)
2085
- : false;
2086
- }
2087
- handleCreate(valueOption) {
2088
- if (!this.isAddAllowed()) {
2089
- return;
2090
- }
2091
- const updateData = {
2092
- id: this.section.id,
2093
- action: 'create',
2094
- valueOption: EntityUtil.isPresent(valueOption) ? valueOption : void 0,
2095
- };
2096
- this.formScope.publishFormUpdate(updateData);
2097
- }
2098
- handleChange(valueOption) {
2099
- const updateData = {
2100
- id: this.section.id,
2101
- action: 'update',
2102
- valueOption: EntityUtil.isPresent(valueOption) ? valueOption : void 0,
2103
- };
2104
- this.formScope.publishFormUpdate(updateData);
2105
- }
2106
- handleQtyChange(valueOption) {
2107
- const updateData = {
2108
- id: this.section.id,
2109
- action: 'qtyUpdate',
2110
- valueOption: valueOption,
2111
- };
2112
- this.formScope.publishFormUpdate(updateData);
2113
- }
2114
- handleRemove(valueOption) {
2115
- const updateData = {
2116
- id: this.section.id,
2117
- action: 'remove',
2118
- valueOption: valueOption,
2119
- };
2120
- this.formScope.publishFormUpdate(updateData);
2121
- }
2122
- handleCopy(valueOption) {
2123
- const updateData = {
2124
- id: this.section.id,
2125
- action: 'copy',
2126
- valueOption: valueOption,
2127
- };
2128
- this.formScope.publishFormUpdate(updateData);
2129
- }
2130
- }
2131
- SectionContextAware.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionContextAware, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Directive });
2132
- SectionContextAware.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SectionContextAware, ngImport: i0 });
2133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionContextAware, decorators: [{
2134
- type: Directive
2135
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
2136
- class LineItemDirective {
2137
- constructor(formScope, sectionScope, configurationService) {
2138
- this.formScope = formScope;
2139
- this.sectionScope = sectionScope;
2140
- this.configurationService = configurationService;
2141
- }
2142
- ngOnInit() {
2143
- this.section = this.sectionScope.section;
2144
- this.lineItem = this.section.model;
2145
- }
2146
- handlePatch(rootLineItem) {
2147
- const updateData = {
2148
- id: this.sectionScope.section.id,
2149
- action: 'patch',
2150
- valueOption: rootLineItem,
2151
- };
2152
- this.formScope.publishFormUpdate(updateData);
2153
- }
2154
- configure(runtimeContext, configurableRamp) {
2155
- return this.configurationService
2156
- .configure(runtimeContext, { configurableRamp })
2157
- .pipe(take(1))
2158
- .toPromise();
2159
- }
2160
- }
2161
- LineItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LineItemDirective, deps: [{ token: FormScopeService }, { token: SectionScopeService }, { token: ConfigurationService }], target: i0.ɵɵFactoryTarget.Directive });
2162
- LineItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: LineItemDirective, selector: "line-item", exportAs: ["liApi"], ngImport: i0 });
2163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LineItemDirective, decorators: [{
2164
- type: Directive,
2165
- args: [{
2166
- // eslint-disable-next-line @angular-eslint/directive-selector
2167
- selector: 'line-item',
2168
- exportAs: 'liApi',
2169
- }]
2170
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }, { type: ConfigurationService }]; } });
2171
- class VeloPortDirective extends SectionContextAware {
2172
- constructor(formScope, sectionScope) {
2173
- super(formScope, sectionScope);
2174
- this.valueQuantities = {};
2175
- }
2176
- handlePriceAdjustment(action, valueOption, amount) {
2177
- const updateData = {
2178
- id: this.section.id,
2179
- action,
2180
- valueOption,
2181
- options: { amount },
2182
- };
2183
- this.formScope.publishFormUpdate(updateData);
2184
- }
2185
- ngOnInit() {
2186
- super.ngOnInit();
2187
- this.initQuantity();
2188
- }
2189
- handleUpsert(valueOption, event) {
2190
- if (EntityUtil.isPresent(this.valueQuantities[valueOption]) && EntityUtil.isPresent(event)) {
2191
- event === null || event === void 0 ? void 0 : event.preventDefault();
2192
- return;
2193
- }
2194
- else if (Object.keys(this.valueQuantities).length > 0) {
2195
- this.handleChange(valueOption);
2196
- }
2197
- else {
2198
- this.handleCreate(valueOption);
2199
- }
2200
- }
2201
- isActive(valueOption) {
2202
- return EntityUtil.isPresent(this.valueQuantities[valueOption]);
2203
- }
2204
- initQuantity() {
2205
- this.valueQuantities = this.section.model
2206
- ? SectionsBinderHelper.getQuantityGroupByValue(this.section.model, this.section.boundData.name)
2207
- : {};
2208
- }
2209
- //Quantity Stepper Functions
2210
- handleNextVal(valueOption) {
2211
- let initQty = this.valueQuantities[valueOption] || 0;
2212
- if (this.isAddAllowed()) {
2213
- if (initQty > 0) {
2214
- const typeSection = SectionHelperService.findSectionForValue(this.section, valueOption);
2215
- if (typeSection) {
2216
- this.form.controls[typeSection.id + 'qty'].setValue(++initQty);
2217
- this.handleQtyChange(valueOption);
2218
- }
2219
- }
2220
- else {
2221
- this.handleCreate(valueOption);
2222
- }
2223
- }
2224
- }
2225
- handlePrevVal(valueOption) {
2226
- let initQty = this.valueQuantities[valueOption] || 0;
2227
- if (this.isRemoveAllowed()) {
2228
- if (initQty < 2) {
2229
- this.handleRemove(valueOption);
2230
- }
2231
- else {
2232
- const typeSection = SectionHelperService.findSectionForValue(this.section, valueOption);
2233
- if (typeSection) {
2234
- this.form.controls[typeSection.id + 'qty'].setValue(--initQty);
2235
- this.handleQtyChange(valueOption);
2236
- }
2237
- }
2238
- }
2239
- }
2240
- handleManualQtyChange(valueOption, qtyVal) {
2241
- const initQty = this.valueQuantities[valueOption] || 0;
2242
- if (isNaN(+qtyVal) || +qtyVal < 0 || initQty === +qtyVal) {
2243
- return;
2244
- }
2245
- const newQty = +qtyVal;
2246
- if (initQty === 0) {
2247
- if (this.isAddAllowed(newQty)) {
2248
- this.form.controls[this.qtyControlName].setValue(newQty);
2249
- this.handleCreate(valueOption);
2250
- }
2251
- }
2252
- else if (newQty === 0) {
2253
- if (this.isRemoveAllowed()) {
2254
- this.handleRemove(valueOption);
2255
- }
2256
- }
2257
- else {
2258
- const typeSection = SectionHelperService.findSectionForValue(this.section, valueOption);
2259
- if (typeSection) {
2260
- const dif = newQty - initQty;
2261
- const isAllowed = dif > 0 ? this.isAddAllowed(dif) : this.isRemoveAllowed(dif * -1);
2262
- if (isAllowed) {
2263
- this.form.controls[typeSection.id + 'qty'].setValue(newQty);
2264
- this.handleQtyChange(valueOption);
2265
- }
2266
- }
2267
- }
2268
- }
2269
- handleNetPriceAdjustment(valueOption, amount) {
2270
- this.handlePriceAdjustment('adjustNetPrice', valueOption, amount);
2271
- }
2272
- handleListPriceAdjustment(valueOption, amount) {
2273
- this.handlePriceAdjustment('adjustListPrice', valueOption, amount);
2274
- }
2275
- }
2276
- VeloPortDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortDirective, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Directive });
2277
- VeloPortDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VeloPortDirective, selector: "velo-port", exportAs: ["portApi"], usesInheritance: true, ngImport: i0 });
2278
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloPortDirective, decorators: [{
2279
- type: Directive,
2280
- args: [{
2281
- // eslint-disable-next-line @angular-eslint/directive-selector
2282
- selector: 'velo-port',
2283
- exportAs: 'portApi',
2284
- }]
2285
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
2286
- class VeloDropdownComponent extends SectionContextAware {
2287
- constructor(formScope, sectionScope) {
2288
- super(formScope, sectionScope);
2289
- }
2290
- }
2291
- VeloDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloDropdownComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
2292
- VeloDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloDropdownComponent, selector: "velo-dropdown", usesInheritance: true, ngImport: i0, template: `
2293
- <div class="input-form-input div-inline" [formGroup]="form">
2294
- <label [for]="controlName">{{ section.label }}</label>
2295
- <div class="form-control-wrapper">
2296
- <select [id]="controlName" [formControlName]="controlName" class="form-control">
2297
- <option *ngFor="let valueOption of section.sectionValue?.valueOptions" [ngValue]="valueOption">
2298
- {{ section.sectionValue?.displayValues?.[valueOption] || valueOption }}
2299
- </option>
2300
- </select>
2301
- </div>
2302
- </div>
2303
- `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
2304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloDropdownComponent, decorators: [{
2305
- type: Component,
2306
- args: [{
2307
- // moduleId: module.id,
2308
- // eslint-disable-next-line @angular-eslint/component-selector
2309
- selector: 'velo-dropdown',
2310
- template: `
2311
- <div class="input-form-input div-inline" [formGroup]="form">
2312
- <label [for]="controlName">{{ section.label }}</label>
2313
- <div class="form-control-wrapper">
2314
- <select [id]="controlName" [formControlName]="controlName" class="form-control">
2315
- <option *ngFor="let valueOption of section.sectionValue?.valueOptions" [ngValue]="valueOption">
2316
- {{ section.sectionValue?.displayValues?.[valueOption] || valueOption }}
2317
- </option>
2318
- </select>
2319
- </div>
2320
- </div>
2321
- `,
2322
- }]
2323
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
2324
- class VeloQuantityComponent extends SectionContextAware {
2325
- constructor(formScope, sectionScope) {
2326
- super(formScope, sectionScope);
2327
- }
2328
- }
2329
- VeloQuantityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloQuantityComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
2330
- VeloQuantityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloQuantityComponent, selector: "velo-quantity", usesInheritance: true, ngImport: i0, template: `
2331
- <div class="input-form-input div-inline quantity-form-input" [formGroup]="form">
2332
- <label [for]="qtyControlName"> Quantity </label>
2333
- <div class="form-control-wrapper">
2334
- <input
2335
- [id]="controlName"
2336
- [formControlName]="qtyControlName"
2337
- [attr.disabled]="isAddAllowed() === true ? null : true"
2338
- type="text"
2339
- class="form-control"
2340
- size="3"
2341
- />
2342
-
2343
- <div
2344
- class="validation-message"
2345
- [hidden]="form.controls[qtyControlName].valid || form.controls[qtyControlName].pristine"
2346
- >
2347
- <div *ngFor="let key of form.controls[qtyControlName].errors | values">
2348
- <span> {{ form.controls[qtyControlName].errors?.[key].message }}</span>
2349
- </div>
2350
- </div>
2351
- </div>
2352
- </div>
2353
- `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i7.ValuesPipe, name: "values" }] });
2354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloQuantityComponent, decorators: [{
2355
- type: Component,
2356
- args: [{
2357
- // moduleId: module.id,
2358
- // eslint-disable-next-line @angular-eslint/component-selector
2359
- selector: 'velo-quantity',
2360
- template: `
2361
- <div class="input-form-input div-inline quantity-form-input" [formGroup]="form">
2362
- <label [for]="qtyControlName"> Quantity </label>
2363
- <div class="form-control-wrapper">
2364
- <input
2365
- [id]="controlName"
2366
- [formControlName]="qtyControlName"
2367
- [attr.disabled]="isAddAllowed() === true ? null : true"
2368
- type="text"
2369
- class="form-control"
2370
- size="3"
2371
- />
2372
-
2373
- <div
2374
- class="validation-message"
2375
- [hidden]="form.controls[qtyControlName].valid || form.controls[qtyControlName].pristine"
2376
- >
2377
- <div *ngFor="let key of form.controls[qtyControlName].errors | values">
2378
- <span> {{ form.controls[qtyControlName].errors?.[key].message }}</span>
2379
- </div>
2380
- </div>
2381
- </div>
2382
- </div>
2383
- `,
2384
- }]
2385
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
2386
- class VeloQuantityButtonComponent extends SectionContextAware {
2387
- constructor(formScope, sectionScope) {
2388
- super(formScope, sectionScope);
2389
- }
2390
- }
2391
- VeloQuantityButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloQuantityButtonComponent, deps: [{ token: FormScopeService }, { token: SectionScopeService }], target: i0.ɵɵFactoryTarget.Component });
2392
- VeloQuantityButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VeloQuantityButtonComponent, selector: "velo-quantity-button", usesInheritance: true, ngImport: i0, template: `
2393
- <div class="input-form-input div-inline quantity-form-input">
2394
- <div class="form-control-wrapper">
2395
- <a href="javascript:void(0);" (click)="handleCreate()">
2396
- <div class="add-config-control" [attr.disabled]="isAddAllowed() === true ? null : true">
2397
- <i class="fa fa-plus plus-icon"></i>
2398
- </div>
2399
- </a>
2400
- </div>
2401
- </div>
2402
- `, isInline: true });
2403
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloQuantityButtonComponent, decorators: [{
2404
- type: Component,
2405
- args: [{
2406
- // moduleId: module.id,
2407
- // eslint-disable-next-line @angular-eslint/component-selector
2408
- selector: 'velo-quantity-button',
2409
- template: `
2410
- <div class="input-form-input div-inline quantity-form-input">
2411
- <div class="form-control-wrapper">
2412
- <a href="javascript:void(0);" (click)="handleCreate()">
2413
- <div class="add-config-control" [attr.disabled]="isAddAllowed() === true ? null : true">
2414
- <i class="fa fa-plus plus-icon"></i>
2415
- </div>
2416
- </a>
2417
- </div>
2418
- </div>
2419
- `,
2420
- }]
2421
- }], ctorParameters: function () { return [{ type: FormScopeService }, { type: SectionScopeService }]; } });
2422
-
2423
- class VlApprovalDirective {
2424
- constructor(repo) {
2425
- this.repo = repo;
2426
- }
2427
- submitQuote(quoteDraft) {
2428
- return this.repo.submitQuote(quoteDraft).toPromise();
2429
- }
2430
- }
2431
- VlApprovalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlApprovalDirective, deps: [{ token: i1.QuoteApiService }], target: i0.ɵɵFactoryTarget.Directive });
2432
- VlApprovalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VlApprovalDirective, selector: "vl-approval", exportAs: ["approvalApi"], ngImport: i0 });
2433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlApprovalDirective, decorators: [{
2434
- type: Directive,
2435
- args: [{
2436
- // eslint-disable-next-line @angular-eslint/directive-selector
2437
- selector: 'vl-approval',
2438
- exportAs: 'approvalApi',
2439
- }]
2440
- }], ctorParameters: function () { return [{ type: i1.QuoteApiService }]; } });
2441
-
2442
- class VlDocumentAttachmentsDirective {
2443
- constructor(service) {
2444
- this.service = service;
2445
- }
2446
- getAttachments(searchRequest) {
2447
- return this.service.getAttachments(searchRequest).toPromise();
2448
- }
2449
- createAttachment(attachment, file, reportProgress) {
2450
- const observable = this.service.createAttachment(attachment, file, reportProgress);
2451
- return reportProgress ? observable : observable.toPromise();
2452
- }
2453
- updateAttachment(id, attachment) {
2454
- return this.service.updateAttachment(id, attachment).toPromise();
2455
- }
2456
- getAttachmentFile(id, isPreventDownload) {
2457
- return this.service.getAttachmentFile(id, isPreventDownload).toPromise();
2458
- }
2459
- removeAttachment(id) {
2460
- return this.service.removeAttachment(id).toPromise();
2461
- }
2462
- }
2463
- VlDocumentAttachmentsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlDocumentAttachmentsDirective, deps: [{ token: i1.DocumentAttachmentApiService }], target: i0.ɵɵFactoryTarget.Directive });
2464
- VlDocumentAttachmentsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VlDocumentAttachmentsDirective, selector: "vl-document-attachments", exportAs: ["documentAttachmentsApi"], ngImport: i0 });
2465
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlDocumentAttachmentsDirective, decorators: [{
2466
- type: Directive,
2467
- args: [{
2468
- // eslint-disable-next-line @angular-eslint/directive-selector
2469
- selector: 'vl-document-attachments',
2470
- exportAs: 'documentAttachmentsApi',
2471
- }]
2472
- }], ctorParameters: function () { return [{ type: i1.DocumentAttachmentApiService }]; } });
2473
-
2474
- class VlDocumentTemplatesDirective {
2475
- constructor(documentTemplatesApiService) {
2476
- this.documentTemplatesApiService = documentTemplatesApiService;
2477
- /**
2478
- * @deprecated Use `generateDocument` instead
2479
- */
2480
- // eslint-disable-next-line @typescript-eslint/member-ordering
2481
- this.generateDocumentNew = this.generateDocument;
2482
- }
2483
- getTemplates(tag) {
2484
- return this.documentTemplatesApiService.getTemplates(tag).toPromise();
2485
- }
2486
- upsertTemplate(template, templateFile) {
2487
- return this.documentTemplatesApiService
2488
- .upsertTemplate(template, templateFile)
2489
- .toPromise();
2490
- }
2491
- removeTemplate(id) {
2492
- return this.documentTemplatesApiService.removeTemplate(id).toPromise();
2493
- }
2494
- cloneTemplate(id) {
2495
- return this.documentTemplatesApiService.cloneTemplate(id).toPromise();
2496
- }
2497
- downloadTemplate(id) {
2498
- return this.documentTemplatesApiService.downloadTemplateFile(id).toPromise();
2499
- }
2500
- generateDocument(template, quoteDraft, params) {
2501
- return this.documentTemplatesApiService.generateDocument(template, quoteDraft, params).pipe(take(1));
2502
- }
2503
- generateDocumentData(template, quoteDraft, params) {
2504
- return this.documentTemplatesApiService.generateDocumentData(template, quoteDraft, params).pipe(take(1));
2505
- }
2506
- getAttachments(searchRequest) {
2507
- return this.documentTemplatesApiService.getAttachments(searchRequest).toPromise();
2508
- }
2509
- getAttachmentFile(id) {
2510
- return this.documentTemplatesApiService.getAttachmentFile(id).toPromise();
2511
- }
2512
- createAttachment(attachment, file) {
2513
- return this.documentTemplatesApiService.createAttachment(attachment, file).toPromise();
2514
- }
2515
- removeAttachment(id) {
2516
- return this.documentTemplatesApiService.removeAttachment(id).toPromise();
2517
- }
2518
- }
2519
- VlDocumentTemplatesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlDocumentTemplatesDirective, deps: [{ token: i1.DocumentTemplatesApiService }], target: i0.ɵɵFactoryTarget.Directive });
2520
- VlDocumentTemplatesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VlDocumentTemplatesDirective, selector: "[vlQuoteTemplates]", exportAs: ["quoteTemplateApi"], ngImport: i0 });
2521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlDocumentTemplatesDirective, decorators: [{
2522
- type: Directive,
2523
- args: [{
2524
- selector: '[vlQuoteTemplates]',
2525
- exportAs: 'quoteTemplateApi',
2526
- }]
2527
- }], ctorParameters: function () { return [{ type: i1.DocumentTemplatesApiService }]; } });
2528
-
2529
- class VlQuoteDirective {
2530
- constructor(quoteApiService, runtimeService) {
2531
- this.quoteApiService = quoteApiService;
2532
- this.runtimeService = runtimeService;
2533
- }
2534
- getQuote(quoteId) {
2535
- return this.quoteApiService.getQuoteDraft(quoteId).toPromise();
2536
- }
2537
- upsertQuote(quoteDraft) {
2538
- return this.quoteApiService.upsertQuote(quoteDraft).toPromise();
2539
- }
2540
- configureQuote(quoteDraft, rootLineItemId) {
2541
- var _a;
2542
- const rootLineItem = EntityUtil.findById(rootLineItemId, quoteDraft.currentState);
2543
- const asset = (_a = quoteDraft.initialState) === null || _a === void 0 ? void 0 : _a.find(a => a.id === rootLineItem.assetId);
2544
- const { context } = quoteDraft;
2545
- const states = {
2546
- configurableRamp: LineItemUtil.removeDeletedItems(rootLineItem),
2547
- currentState: quoteDraft.currentState,
2548
- asset,
2549
- };
2550
- this.runtimeService.updateRuntime(states, context.properties);
2551
- }
2552
- }
2553
- VlQuoteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlQuoteDirective, deps: [{ token: i1.QuoteApiService }, { token: RuntimeService }], target: i0.ɵɵFactoryTarget.Directive });
2554
- VlQuoteDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VlQuoteDirective, selector: "vl-quote", exportAs: ["quoteApi"], ngImport: i0 });
2555
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlQuoteDirective, decorators: [{
2556
- type: Directive,
2557
- args: [{
2558
- // eslint-disable-next-line @angular-eslint/directive-selector
2559
- selector: 'vl-quote',
2560
- exportAs: 'quoteApi',
2561
- }]
2562
- }], ctorParameters: function () { return [{ type: i1.QuoteApiService }, { type: RuntimeService }]; } });
2563
-
2564
- class VlRampDirective {
2565
- constructor(contextService, rampApiService, priceApiService) {
2566
- this.contextService = contextService;
2567
- this.rampApiService = rampApiService;
2568
- this.priceApiService = priceApiService;
2569
- }
2570
- createRamp(sourceItems, currentRamps, term) {
2571
- const context = this.contextService.resolve();
2572
- return this.rampApiService
2573
- .next({
2574
- context,
2575
- sourceItems,
2576
- currentItems: currentRamps || [],
2577
- term,
2578
- })
2579
- .pipe(tap(data => {
2580
- if (data.context) {
2581
- this.contextService.update({
2582
- properties: Object.assign({}, data.context.properties),
2583
- });
2584
- }
2585
- }))
2586
- .toPromise();
2587
- }
2588
- calculateRampTermByEndDate(lineItem, endDate) {
2589
- return this.priceApiService
2590
- .getSellingTermByEndDate(lineItem.planId, lineItem.offeringId, lineItem.startDate, endDate, lineItem.sellingFrequencyUnit, lineItem.sellingFrequencyDuration)
2591
- .toPromise();
2592
- }
2593
- calculateRampTermByTerm(lineItem, term) {
2594
- return this.priceApiService
2595
- .getSellingTermByTerm(lineItem.planId, lineItem.offeringId, lineItem.startDate, term, lineItem.sellingFrequencyUnit, lineItem.sellingFrequencyDuration)
2596
- .toPromise();
2597
- }
2598
- }
2599
- VlRampDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlRampDirective, deps: [{ token: i2.ContextService }, { token: i1.RampApiService }, { token: i1.PriceApiService }], target: i0.ɵɵFactoryTarget.Directive });
2600
- VlRampDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: VlRampDirective, selector: "vl-ramp", exportAs: ["rampApi"], ngImport: i0 });
2601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VlRampDirective, decorators: [{
2602
- type: Directive,
2603
- args: [{
2604
- // eslint-disable-next-line @angular-eslint/directive-selector
2605
- selector: 'vl-ramp',
2606
- exportAs: 'rampApi',
2607
- }]
2608
- }], ctorParameters: function () { return [{ type: i2.ContextService }, { type: i1.RampApiService }, { type: i1.PriceApiService }]; } });
2609
-
2610
- const SHA1$1 = UUID.SHA1();
2611
- const SCRIPT_GLOBAL_NAME = `$velo`;
2612
- class SectionScriptDirective {
2613
- constructor(_document, sfQueryDirective, lineItemDirective, quoteDirective, documentTemplatesDirective, rampDirective, approvalDirective, documentAttachmentsDirective, formScope, sectionScope, renderer, formBuilder, runtimeService, cdr, cartService, contextService, currentStateService, quoteService) {
2614
- this._document = _document;
2615
- this.sfQueryDirective = sfQueryDirective;
2616
- this.lineItemDirective = lineItemDirective;
2617
- this.quoteDirective = quoteDirective;
2618
- this.documentTemplatesDirective = documentTemplatesDirective;
2619
- this.rampDirective = rampDirective;
2620
- this.approvalDirective = approvalDirective;
2621
- this.documentAttachmentsDirective = documentAttachmentsDirective;
2622
- this.formScope = formScope;
2623
- this.sectionScope = sectionScope;
2624
- this.renderer = renderer;
2625
- this.formBuilder = formBuilder;
2626
- this.runtimeService = runtimeService;
2627
- this.cdr = cdr;
2628
- this.cartService = cartService;
2629
- this.contextService = contextService;
2630
- this.currentStateService = currentStateService;
2631
- this.quoteService = quoteService;
2632
- this.scriptId = '';
2633
- this.sessionScope = {};
2634
- }
2635
- ngOnInit() {
2636
- if (!this.scriptExists()) {
2637
- return;
2638
- }
2639
- this.scriptId = this.generateScriptId();
2640
- this.registry = this.getScriptRegistry();
2641
- this.sessionScope = this.getSessionScope();
2642
- if (!this.registry.exists(this.scriptId)) {
2643
- this.appendScriptElementToDom();
2644
- }
2645
- this.initScript();
2646
- this.registry.doRegister(this.scriptId, this.sectionScope.section.id);
2647
- }
2648
- ngAfterViewInit() {
2649
- var _a;
2650
- const sharedScriptGlobal = (_a = this.registry) === null || _a === void 0 ? void 0 : _a.getGlobalForScript(this.sectionScope.section.id);
2651
- if (sharedScriptGlobal) {
2652
- this.methodApply('afterViewInit', sharedScriptGlobal);
2653
- }
2654
- }
2655
- ngOnDestroy() {
2656
- if (!this.scriptId) {
2657
- return;
2658
- }
2659
- this.registry.unRegister(this.scriptId, this.sectionScope.section.id);
2660
- if (!this.registry.exists(this.scriptId)) {
2661
- this.removeScript();
2662
- this.registry.removeGlobalForScript(this.scriptId);
2663
- }
2664
- }
2665
- get scope() {
2666
- if (!this.scriptId || !this.sectionScope.section) {
2667
- return {};
2668
- }
2669
- return Object.assign({}, this.registry.getGlobalForScript(this.sectionScope.section.id) || {}, this.sessionScope);
2670
- }
2671
- scriptExists() {
2672
- var _a, _b, _c, _d;
2673
- return ((_d = (_c = (_b = (_a = this.sectionScope) === null || _a === void 0 ? void 0 : _a.section) === null || _b === void 0 ? void 0 : _b.script) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
2674
- }
2675
- encodeScriptBody() {
2676
- return this.sectionScope.section.script ? atob(this.sectionScope.section.script) : '';
2677
- }
2678
- generateScriptId() {
2679
- return '_' + SHA1$1.hex(this.encodeScriptBody());
2680
- }
2681
- getScriptRegistry() {
2682
- return this.formScope.scriptRegistry;
2683
- }
2684
- getSessionScope() {
2685
- return this.formScope.scriptSessionScope;
2686
- }
2687
- initScript() {
2688
- let sharedScriptGlobal = this.registry.getGlobalForScript(this.sectionScope.section.id);
2689
- if (!EntityUtil.isPresent(sharedScriptGlobal)) {
2690
- sharedScriptGlobal = {};
2691
- this.registry.setGlobalForScript(this.sectionScope.section.id, sharedScriptGlobal);
2692
- }
2693
- this.methodApply('init', sharedScriptGlobal);
2694
- }
2695
- removeScript() {
2696
- const sharedScriptGlobal = this.registry.getGlobalForScript(this.sectionScope.section.id);
2697
- this.methodApply('destroy', sharedScriptGlobal);
2698
- this.removeScriptElementFromDom();
2699
- }
2700
- appendScriptElementToDom() {
2701
- const script = this.scriptFromTemplate(this.encodeScriptBody(), this.scriptId, this.sectionScope.section);
2702
- this.scriptElement = this.renderer.createElement('script');
2703
- this.scriptElement.type = `text/javascript`;
2704
- this.scriptElement.text = script;
2705
- this.scriptElement.setAttribute('id', this.scriptId);
2706
- this.renderer.appendChild(this._document.body, this.scriptElement);
2707
- }
2708
- removeScriptElementFromDom() {
2709
- if (!this.scriptElement) {
2710
- this.scriptElement = this._document.getElementById(this.scriptId);
2711
- }
2712
- this.scriptElement.remove();
2713
- }
2714
- scriptFromTemplate(scriptBody, scriptId, section) {
2715
- return `var ${scriptId} = (function (${SCRIPT_GLOBAL_NAME}, form, { section, templates }, sessionScope, formBuilder, runtimeContext, cdr, apis) {
2716
- ${SCRIPT_GLOBAL_NAME}["form"] = form;
2717
- ${SCRIPT_GLOBAL_NAME}["section"] = section;
2718
- ${SCRIPT_GLOBAL_NAME}["templates"] = templates;
2719
- ${SCRIPT_GLOBAL_NAME}["sessionScope"] = sessionScope;
2720
- ${SCRIPT_GLOBAL_NAME}["formBuilder"] = formBuilder;
2721
- ${SCRIPT_GLOBAL_NAME}["runtimeContext"] = runtimeContext;
2722
- ${SCRIPT_GLOBAL_NAME}["cdr"] = cdr;
2723
- ${SCRIPT_GLOBAL_NAME}["apis"] = apis;
2724
-
2725
- ${scriptBody}
2726
- return ${SCRIPT_GLOBAL_NAME};
2727
- });
2728
-
2729
- //# sourceURL=${_.kebabCase(section.label)}.js`;
2730
- }
2731
- methodApply(methodName, sharedScriptGlobal) {
2732
- const args = [
2733
- sharedScriptGlobal,
2734
- this.formScope.form,
2735
- this.sectionScope,
2736
- this.sessionScope,
2737
- this.formBuilder,
2738
- this.runtimeService.getRuntimeContext(),
2739
- this.cdr,
2740
- this.getExposedApis(),
2741
- ];
2742
- const fnInit = window[`${this.scriptId}`](...args);
2743
- fnInit && fnInit[methodName] && fnInit[methodName].apply();
2744
- }
2745
- getExposedApis() {
2746
- return {
2747
- 'sf-query': this.sfQueryDirective,
2748
- 'line-item': this.lineItemDirective,
2749
- 'quote-directive': this.quoteDirective,
2750
- 'templates-directive': this.documentTemplatesDirective,
2751
- 'attachments-directive': this.documentAttachmentsDirective,
2752
- 'ramp-directive': this.rampDirective,
2753
- 'approval-directive': this.approvalDirective,
2754
- entityUtil: EntityUtil,
2755
- moment,
2756
- lodash: _,
2757
- rxjs: Object.assign(Object.assign({}, rxjsOperators), rxjs),
2758
- PagedEntity,
2759
- pipes: {
2760
- currency: CurrencyPipe,
2761
- },
2762
- solutionUpdateStarted: this.runtimeService.onSolutionUpdateStartedEvent,
2763
- solutionUpdated: this.runtimeService.onSolutionProcessed,
2764
- cartService: this.cartService,
2765
- configurationContextService: this.contextService,
2766
- quoteDraft: this.quoteService.quoteDraft,
2767
- currentStateService: this.currentStateService,
2768
- };
2769
- }
2770
- }
2771
- SectionScriptDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionScriptDirective, deps: [{ token: DOCUMENT }, { token: SfQueryDirective }, { token: LineItemDirective }, { token: VlQuoteDirective }, { token: VlDocumentTemplatesDirective }, { token: VlRampDirective }, { token: VlApprovalDirective }, { token: VlDocumentAttachmentsDirective }, { token: FormScopeService }, { token: SectionScopeService }, { token: i0.Renderer2 }, { token: i4.FormBuilder }, { token: RuntimeService }, { token: i0.ChangeDetectorRef }, { token: ShoppingCartService }, { token: i2.ContextService }, { token: CurrentStateService }, { token: i2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Directive });
2772
- SectionScriptDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SectionScriptDirective, selector: "section-script", providers: [
2773
- SfQueryDirective,
2774
- LineItemDirective,
2775
- VlQuoteDirective,
2776
- VlDocumentTemplatesDirective,
2777
- VlRampDirective,
2778
- VlApprovalDirective,
2779
- VlDocumentAttachmentsDirective,
2780
- ], exportAs: ["scriptApi"], ngImport: i0 });
2781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionScriptDirective, decorators: [{
2782
- type: Directive,
2783
- args: [{
2784
- // eslint-disable-next-line @angular-eslint/directive-selector
2785
- selector: 'section-script',
2786
- exportAs: 'scriptApi',
2787
- providers: [
2788
- SfQueryDirective,
2789
- LineItemDirective,
2790
- VlQuoteDirective,
2791
- VlDocumentTemplatesDirective,
2792
- VlRampDirective,
2793
- VlApprovalDirective,
2794
- VlDocumentAttachmentsDirective,
2795
- ],
2796
- }]
2797
- }], ctorParameters: function () {
2798
- return [{ type: Document, decorators: [{
2799
- type: Inject,
2800
- args: [DOCUMENT]
2801
- }] }, { type: SfQueryDirective, decorators: [{
2802
- type: Inject,
2803
- args: [SfQueryDirective]
2804
- }] }, { type: LineItemDirective, decorators: [{
2805
- type: Inject,
2806
- args: [LineItemDirective]
2807
- }] }, { type: VlQuoteDirective, decorators: [{
2808
- type: Inject,
2809
- args: [VlQuoteDirective]
2810
- }] }, { type: VlDocumentTemplatesDirective, decorators: [{
2811
- type: Inject,
2812
- args: [VlDocumentTemplatesDirective]
2813
- }] }, { type: VlRampDirective, decorators: [{
2814
- type: Inject,
2815
- args: [VlRampDirective]
2816
- }] }, { type: VlApprovalDirective, decorators: [{
2817
- type: Inject,
2818
- args: [VlApprovalDirective]
2819
- }] }, { type: VlDocumentAttachmentsDirective, decorators: [{
2820
- type: Inject,
2821
- args: [VlDocumentAttachmentsDirective]
2822
- }] }, { type: FormScopeService }, { type: SectionScopeService }, { type: i0.Renderer2 }, { type: i4.FormBuilder }, { type: RuntimeService }, { type: i0.ChangeDetectorRef }, { type: ShoppingCartService }, { type: i2.ContextService }, { type: CurrentStateService }, { type: i2.QuoteDraftService }];
2823
- } });
2824
-
2825
- class RuntimeExecutionModule {
2826
- }
2827
- RuntimeExecutionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeExecutionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2828
- RuntimeExecutionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: RuntimeExecutionModule, declarations: [ExecutionSectionRendererComponent,
2829
- ChildrenPlaceholderComponent,
2830
- SectionScriptDirective,
2831
- VeloPortDirective,
2832
- LineItemDirective,
2833
- VeloDropdownComponent,
2834
- VeloQuantityButtonComponent,
2835
- VeloQuantityComponent,
2836
- VeloAttributeDirective,
2837
- MultiselectComponent,
2838
- VeloAttributeComponent,
2839
- VeloPortRadioComponent,
2840
- VeloTypeComponent,
2841
- VeloPortDropdownComponent,
2842
- VeloPortCheckBoxComponent,
2843
- FederatedComponent,
2844
- TemplateComponent,
2845
- ContextProviderComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule], exports: [FormsModule,
2846
- ReactiveFormsModule,
2847
- ChildrenPlaceholderComponent,
2848
- SectionScriptDirective,
2849
- LineItemDirective,
2850
- VeloPortDirective,
2851
- VeloAttributeDirective,
2852
- MultiselectComponent,
2853
- VeloAttributeComponent,
2854
- VeloPortRadioComponent,
2855
- VeloTypeComponent,
2856
- VeloPortDropdownComponent,
2857
- VeloPortCheckBoxComponent,
2858
- FederatedComponent,
2859
- TemplateComponent,
2860
- ContextProviderComponent] });
2861
- RuntimeExecutionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeExecutionModule, providers: [
2862
- ShoppingCartService,
2863
- RuntimeService,
2864
- ConfigurationService,
2865
- RuntimeContextService,
2866
- RuntimeFormService,
2867
- CurrentStateService,
2868
- ProductModelCacheService,
2869
- DatePipe,
2870
- SectionStoreService,
2871
- ], imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule, FormsModule,
2872
- ReactiveFormsModule] });
2873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeExecutionModule, decorators: [{
2874
- type: NgModule,
2875
- args: [{
2876
- declarations: [
2877
- ExecutionSectionRendererComponent,
2878
- ChildrenPlaceholderComponent,
2879
- SectionScriptDirective,
2880
- VeloPortDirective,
2881
- LineItemDirective,
2882
- VeloDropdownComponent,
2883
- VeloQuantityButtonComponent,
2884
- VeloQuantityComponent,
2885
- VeloAttributeDirective,
2886
- MultiselectComponent,
2887
- VeloAttributeComponent,
2888
- VeloPortRadioComponent,
2889
- VeloTypeComponent,
2890
- VeloPortDropdownComponent,
2891
- VeloPortCheckBoxComponent,
2892
- FederatedComponent,
2893
- TemplateComponent,
2894
- ContextProviderComponent,
2895
- ],
2896
- providers: [
2897
- ShoppingCartService,
2898
- RuntimeService,
2899
- ConfigurationService,
2900
- RuntimeContextService,
2901
- RuntimeFormService,
2902
- CurrentStateService,
2903
- ProductModelCacheService,
2904
- DatePipe,
2905
- SectionStoreService,
2906
- ],
2907
- imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule],
2908
- exports: [
2909
- FormsModule,
2910
- ReactiveFormsModule,
2911
- ChildrenPlaceholderComponent,
2912
- SectionScriptDirective,
2913
- LineItemDirective,
2914
- VeloPortDirective,
2915
- VeloAttributeDirective,
2916
- MultiselectComponent,
2917
- VeloAttributeComponent,
2918
- VeloPortRadioComponent,
2919
- VeloTypeComponent,
2920
- VeloPortDropdownComponent,
2921
- VeloPortCheckBoxComponent,
2922
- FederatedComponent,
2923
- TemplateComponent,
2924
- ContextProviderComponent,
2925
- ],
2926
- }]
2927
- }] });
2928
-
2929
- const SHA1 = UUID.SHA1();
2930
- class BaseSectionComponent {
2931
- }
2932
- BaseSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2933
- BaseSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: BaseSectionComponent, selector: "ng-component", inputs: { form: "form", section: "section" }, viewQueries: [{ propertyName: "templates", predicate: ["customTemplate"], descendants: true }], ngImport: i0, template: '', isInline: true });
2934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseSectionComponent, decorators: [{
2935
- type: Component,
2936
- args: [{ template: '' }]
2937
- }], propDecorators: { form: [{
2938
- type: Input
2939
- }], section: [{
2940
- type: Input
2941
- }], templates: [{
2942
- type: ViewChildren,
2943
- args: ['customTemplate']
2944
- }] } });
2945
- class SectionsService {
2946
- constructor(compiler, m, sectionStore) {
2947
- this.compiler = compiler;
2948
- this.m = m;
2949
- this.sectionStore = sectionStore;
2950
- this.moduleType = null;
2951
- this.moduleInstance = null;
2952
- }
2953
- compileModule(sections, isViewEncapsulated) {
2954
- const uniqueSections = this.getUniqueSections(sections);
2955
- this.moduleType = this.getModuleType(uniqueSections, isViewEncapsulated);
2956
- this.moduleInstance = this.compiler.compileModuleAndAllComponentsSync(this.moduleType);
2957
- this.sectionStore.componentFactories = this.moduleInstance.componentFactories;
2958
- }
2959
- destroy() {
2960
- if (this.moduleInstance) {
2961
- this.sectionStore.componentFactories = [];
2962
- this.moduleInstance = null;
2963
- }
2964
- if (this.moduleType) {
2965
- this.compiler.clearCacheFor(this.moduleType);
2966
- this.moduleType = null;
2967
- }
2968
- }
2969
- getDecoratedComponents(sections, isViewEncapsulated = false) {
2970
- const result = [];
2971
- sections.forEach(section => {
2972
- var _a;
2973
- const transpiledTemplate = this.getTranspiledTemplate(section);
2974
- const DynamicComponent = Component({
2975
- selector: section.dynamicSelector,
2976
- template: transpiledTemplate,
2977
- styles: [atob(section.styles || '')],
2978
- providers: [SectionHelperService],
2979
- encapsulation: isViewEncapsulated ? ViewEncapsulation.ShadowDom : ViewEncapsulation.Emulated,
2980
- jit: true,
2981
- })(class C extends BaseSectionComponent {
2982
- });
2983
- this.applySelectorField(DynamicComponent, (_a = section.dynamicSelector) !== null && _a !== void 0 ? _a : '');
2984
- result.push(DynamicComponent);
2985
- });
2986
- return result;
2987
- }
2988
- getModuleType(sections, isViewEncapsulated) {
2989
- const decoratedComponents = this.getDecoratedComponents(sections, isViewEncapsulated);
2990
- let DynamicModule = class DynamicModule {
2991
- };
2992
- DynamicModule = __decorate([
2993
- NgModule({
2994
- imports: [CommonModule, RuntimeExecutionModule, CoreModule, ScrollingModule, ScrollingModule$1],
2995
- declarations: [decoratedComponents],
2996
- jit: true,
2997
- })
2998
- ], DynamicModule);
2999
- return DynamicModule;
3000
- }
3001
- applySelectorField(target, dynamicSelector) {
3002
- set(target, '$$dynamicSelector', dynamicSelector);
3003
- }
3004
- getUniqueSections(sections) {
3005
- const uniqueSections = {};
3006
- sections.forEach(section => {
3007
- section.hash = SHA1.hex(section.template);
3008
- const existingSection = section.hash ? uniqueSections[section.hash] : undefined;
3009
- if (existingSection && existingSection.template === section.template) {
3010
- section.dynamicSelector = existingSection.dynamicSelector;
3011
- }
3012
- else if (section.hash) {
3013
- section.dynamicSelector = `section-${section.id}`;
3014
- uniqueSections[section.hash] = section;
3015
- }
3016
- });
3017
- return values(uniqueSections);
3018
- }
3019
- getTranspiledTemplate(section) {
3020
- let template = section.template ? atob(section.template) : '';
3021
- if (!EntityUtil.isEmpty(section.script) && template.indexOf('<section-script') === -1) {
3022
- template = `<section-script></section-script>`.concat(template);
3023
- }
3024
- return template;
3025
- }
3026
- }
3027
- SectionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionsService, deps: [{ token: i0.Compiler }, { token: i0.NgModuleRef }, { token: SectionStoreService }], target: i0.ɵɵFactoryTarget.Injectable });
3028
- SectionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionsService });
3029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionsService, decorators: [{
3030
- type: Injectable
3031
- }], ctorParameters: function () { return [{ type: i0.Compiler }, { type: i0.NgModuleRef }, { type: SectionStoreService }]; } });
3032
-
3033
- class SectionRendererComponent {
3034
- set section(value) {
3035
- this._section = value;
3036
- this.sectionScope.section = value;
3037
- }
3038
- get section() {
3039
- return this._section;
3040
- }
3041
- constructor(_injector, _m, sectionScope, sectionStore) {
3042
- this._injector = _injector;
3043
- this._m = _m;
3044
- this.sectionScope = sectionScope;
3045
- this.sectionStore = sectionStore;
3046
- this.componentRef = null;
3047
- }
3048
- ngOnInit() {
3049
- this.renderSection();
3050
- }
3051
- ngAfterViewInit() {
3052
- var _a, _b;
3053
- if (this.componentRef) {
3054
- this.sectionScope.templates.next((_b = (_a = this.componentRef.instance['templates']) === null || _a === void 0 ? void 0 : _a.toArray()) !== null && _b !== void 0 ? _b : []);
3055
- }
3056
- }
3057
- ngOnDestroy() {
3058
- if (this.componentRef) {
3059
- this.componentRef.destroy();
3060
- this.componentRef = null;
3061
- }
3062
- }
3063
- renderSection() {
3064
- var _a;
3065
- if (this.componentRef) {
3066
- this.componentRef.destroy();
3067
- this.componentRef = null;
3068
- }
3069
- const componentFactory = this.sectionStore.getComponentFactory(this._section);
3070
- if (!componentFactory) {
3071
- return;
3072
- }
3073
- this.componentRef = componentFactory.create(this._injector, [], null, this._m);
3074
- this.componentRef.location.nativeElement.setAttribute('sectionId', `${(_a = this._section.model) === null || _a === void 0 ? void 0 : _a.id}${this._section.label}`);
3075
- this.componentRef.instance['form'] = this.form;
3076
- this.componentRef.instance['section'] = this.section;
3077
- this.container.insert(this.componentRef.hostView);
3078
- }
3079
- }
3080
- SectionRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionRendererComponent, deps: [{ token: i0.Injector }, { token: i0.NgModuleRef }, { token: SectionScopeService }, { token: SectionStoreService }], target: i0.ɵɵFactoryTarget.Component });
3081
- SectionRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SectionRendererComponent, selector: "vl-section-renderer", inputs: { section: "section", form: "form" }, providers: [SectionScopeService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #container></ng-template>", styles: [":host{display:contents}\n"] });
3082
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SectionRendererComponent, decorators: [{
3083
- type: Component,
3084
- args: [{ selector: 'vl-section-renderer', providers: [SectionScopeService], template: "<ng-template #container></ng-template>", styles: [":host{display:contents}\n"] }]
3085
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.NgModuleRef }, { type: SectionScopeService }, { type: SectionStoreService }]; }, propDecorators: { section: [{
3086
- type: Input
3087
- }], form: [{
3088
- type: Input
3089
- }], container: [{
3090
- type: ViewChild,
3091
- args: ['container', { read: ViewContainerRef, static: true }]
3092
- }] } });
3093
-
3094
- const defaultTemplate = btoa('<template-component></template-component>');
3095
- class ComponentPreviewComponent {
3096
- constructor(sectionsService, runtimeFormService, formScope, runtimeService, cdr) {
3097
- this.sectionsService = sectionsService;
3098
- this.runtimeFormService = runtimeFormService;
3099
- this.formScope = formScope;
3100
- this.runtimeService = runtimeService;
3101
- this.cdr = cdr;
3102
- this.form = new FormGroup({});
3103
- this.showPreview = false;
3104
- this.isNoPreviewAvailable = false;
3105
- this.isPreviewFailed = false;
3106
- }
3107
- ngOnChanges(changes) {
3108
- if (changes['data']) {
3109
- this.sectionsService.destroy();
3110
- this.showPreview = false;
3111
- this.isNoPreviewAvailable = false;
3112
- this.isPreviewFailed = false;
3113
- setTimeout(() => {
3114
- var _a, _b;
3115
- try {
3116
- this.runPreview(this.data);
3117
- this.cdr.detectChanges();
3118
- }
3119
- catch (e) {
3120
- console.error((_b = (_a = e === null || e === void 0 ? void 0 : e.stack) !== null && _a !== void 0 ? _a : e === null || e === void 0 ? void 0 : e.error) !== null && _b !== void 0 ? _b : 'Error occured');
3121
- this.showPreview = false;
3122
- this.isPreviewFailed = true;
3123
- this.cdr.detectChanges();
3124
- }
3125
- });
3126
- }
3127
- }
3128
- runPreview(data) {
3129
- var _a;
3130
- const section = data.section && JSON.parse(data.section);
3131
- if (!section) {
3132
- this.isNoPreviewAvailable = true;
3133
- return;
3134
- }
3135
- const model = Object.assign(Object.assign({}, ((_a = section === null || section === void 0 ? void 0 : section.model) !== null && _a !== void 0 ? _a : {
3136
- attributes: [],
3137
- lineItems: [],
3138
- })), { id: UUID.UUID() });
3139
- const componentSection = Object.assign(Object.assign({}, section), { script: data.componentScript ? btoa(data.componentScript) : '', styles: data.componentStyles ? btoa(data.componentStyles) : '', template: data.componentTemplate ? btoa(data.componentTemplate) : '', properties: data.componentProperties ? JSON.stringify(data.componentProperties) : {}, id: UUID.UUID(), model });
3140
- const storySection = {
3141
- id: UUID.UUID(),
3142
- template: data.template ? btoa(data.template) : defaultTemplate,
3143
- styles: data.styles ? btoa(data.styles) : '',
3144
- script: data.script ? btoa(data.script) : '',
3145
- children: [componentSection],
3146
- model,
3147
- };
3148
- const sections = [storySection, componentSection];
3149
- this.form = this.formScope.form = this.runtimeFormService.initForm(sections, model);
3150
- this.createRuntimeContext(componentSection);
3151
- this.sectionsService.compileModule(sections);
3152
- this.section = storySection;
3153
- this.showPreview = true;
3154
- }
3155
- createRuntimeContext(section) {
3156
- const runtimeModel = RuntimeModel.create([], {});
3157
- const rootType = Array.from(runtimeModel.components.values()).find(c => {
3158
- var _a;
3159
- return ((_a = section.model) === null || _a === void 0 ? void 0 : _a.type) &&
3160
- runtimeModel.isEquals(c.typeName, section.model.type) &&
3161
- EntityUtil.isPresent(c.productId);
3162
- });
3163
- const contextProductId = rootType ? rootType.productId : undefined;
3164
- const context = {
3165
- modelId: '',
3166
- runtimeModel,
3167
- runtimeMode: RuntimeMode.TEST,
3168
- productId: contextProductId,
3169
- properties: {},
3170
- };
3171
- this.runtimeService.setRuntimeContext(context);
3172
- }
3173
- }
3174
- ComponentPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ComponentPreviewComponent, deps: [{ token: SectionsService }, { token: RuntimeFormService }, { token: FormScopeService }, { token: RuntimeService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3175
- ComponentPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ComponentPreviewComponent, selector: "vl-component-preview", inputs: { data: "data" }, providers: [
3176
- SectionsService,
3177
- FormScopeService,
3178
- CollapsibleStateService,
3179
- RuntimeFormService,
3180
- FormScopeService,
3181
- RuntimeService,
3182
- ], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"showPreview\">\n <vl-section-renderer [section]=\"section!\" [form]=\"form\"></vl-section-renderer>\n</ng-container>\n\n<span class=\"info\" *ngIf=\"isNoPreviewAvailable\">No preview available</span>\n<span class=\"info error\" *ngIf=\"isPreviewFailed\">Preview has failed</span>\n", styles: ["body.veloce-apex-index,body.veloce-index,body.sfdcBody{overflow:hidden;margin:0;padding:0}:host ::ng-deep .velo-app .modal.in .modal-dialog.runtime-modal{margin-left:5%;margin-right:5%;padding:0;position:relative;width:auto}:host ::ng-deep .modal-body.runtime-modal.main-container{height:100%;margin:0;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .content-wrapper{display:flex;flex-direction:column;height:100%}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper{display:flex;flex-direction:column;flex-grow:1;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid{height:100%;margin:0;padding:0;overflow:auto}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal .form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid section-script>:first-child{height:100%}:host ::ng-deep .runtime-modal .modal-content,:host ::ng-deep .gu-mirror .modal-content{background-color:--vl-input-background}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a{color:#333333b3;font-weight:600;text-transform:uppercase;letter-spacing:.85px;font-size:10px}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active{color:#333}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.disabled,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.disabled{color:#33333380}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active:after,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active:after{background-color:#f36;bottom:-1px;content:\"\";height:1px;left:0;position:absolute;width:100%}:host ::ng-deep .runtime-modal .modal-content .modal-header,:host ::ng-deep .gu-mirror .modal-content .modal-header{background:transparent;color:#fff}:host ::ng-deep .runtime-modal .runtime-group-divider,:host ::ng-deep .gu-mirror .runtime-group-divider{border-bottom:1px solid #e5e5e5}:host ::ng-deep .runtime-modal .input-form-input,:host ::ng-deep .gu-mirror .input-form-input{position:relative;padding-left:0;padding-top:0}:host ::ng-deep .runtime-modal .input-form-input--required>label,:host ::ng-deep .gu-mirror .input-form-input--required>label{color:#ff4233;font-weight:700}:host ::ng-deep .form-control-wrapper{position:relative}:host ::ng-deep .add-config-control:hover{background-color:#e96099;color:#fff;border:1px solid transparent}:host ::ng-deep .remove-config-control:hover{background-color:#828c9e;color:#fff}:host ::ng-deep .add-config-control[disabled],:host ::ng-deep .remove-config-control[disabled]{background-color:transparent;color:#ccc;border:1px dashed #ccc}:host ::ng-deep .add-config-control[disabled]:hover,:host ::ng-deep .remove-config-control[disabled]:hover{cursor:default}:host ::ng-deep .add-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;border-radius:50%;float:left;position:absolute;top:0;right:-57px;z-index:500;background-color:#e3337c;color:#fff;border:1px solid #e3337c;transition:all .5s ease 0s}:host ::ng-deep .add-config-control .plus-icon{line-height:36px}:host ::ng-deep .remove-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;margin-right:25px;border-radius:50%;float:left;position:absolute;top:33px;right:51px;z-index:500;background-color:transparent;color:#687285;border:1px solid transparent;transition:all .5s ease 0s}:host ::ng-deep .remove-config-control .plus-icon{line-height:36px}:host ::ng-deep .sidebar .new-wrapper{min-height:96px;margin-bottom:25px}:host ::ng-deep .sidebar .new-wrapper .add-container .add-card{left:0;margin-left:15px}:host ::ng-deep .ui-settings{height:100%;display:flex;flex-direction:column}:host ::ng-deep .runtime-modal .form-horizontal form,:host ::ng-deep .gu-mirror form{margin:0}:host ::ng-deep .runtime-modal .form-horizontal .form-group,:host ::ng-deep .gu-mirror .form-group{margin:0;padding:0}:host ::ng-deep .runtime-modal .form-horizontal .control.form-group,:host ::ng-deep .gu-mirror .control.form-group{margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .form-control-wrapper,:host ::ng-deep .gu-mirror .form-control-wrapper{min-width:172px;margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper{min-width:50px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper .form-control,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper .form-control{width:50px}:host ::ng-deep .runtime-left-side{height:calc(100% - 97px);background:#fff;padding:48px 56px 0}:host ::ng-deep .ui-controls-group{margin-left:-8px;margin-right:-8px}:host ::ng-deep .ui-controls-group .ui-control-type:hover{border-color:#3384ff}:host ::ng-deep .ui-controls-group .ui-control-type{position:relative;min-width:140px;float:left;border-radius:3px;border:1px solid #c4c4c4;background-color:#fff;width:calc(50% - 16px);padding:12px 13px;margin-bottom:16px;margin-right:8px;margin-left:8px;cursor:pointer}:host ::ng-deep .ui-controls-group .ui-control-type span{padding-left:3px}:host ::ng-deep .sidebar-header{letter-spacing:-.5px;padding-bottom:24px;padding-top:0;line-height:32px;font-size:24px;font-weight:700;color:#333}:host ::ng-deep .sidebar-header small{display:block;color:#333;font-size:11px;font-weight:300;line-height:20px;margin:0}:host ::ng-deep .sidebar-menu-list{color:#333333b3;margin:0;width:100%;list-style:none;font-size:12px}:host ::ng-deep .sidebar-menu-list li.active a,:host ::ng-deep .sidebar-menu-list li.active i{color:#005ee3}:host ::ng-deep .sidebar-menu-list li:hover{cursor:pointer}:host ::ng-deep .sidebar-menu-list li{text-align:right;padding-left:16px}:host ::ng-deep .sidebar-menu-list li a{padding:0 8px;margin-left:-8px;cursor:pointer;white-space:nowrap;color:inherit;font-weight:700;display:inline-block;line-height:32px}:host ::ng-deep .sidebar-menu-list li i{display:none;padding-right:5px}:host ::ng-deep .runtime-builder-content{min-height:100%}:host ::ng-deep .runtime-builder-content .input-form{margin:0;padding:18px 11px 0}:host ::ng-deep .runtime-builder-content .input-form .form-group{border:3px dashed transparent}:host ::ng-deep .runtime-builder-content .input-form .form-group:hover{border:3px dashed #dedede}:host ::ng-deep .runtime-right-side{background:#fff}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background:#fff;position:relative;display:inline-block;padding-right:16px;text-transform:uppercase;font-size:10px;letter-spacing:.2px}:host ::ng-deep .sidebar-section:before{content:\" \";position:absolute;top:50%;left:0;right:0;border-top:1px solid #e6e6e6}:host ::ng-deep .sidebar-section{position:relative;margin-top:16px;margin-bottom:16px}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background-color:var(--vl-input-background);position:relative;display:inline-block;padding-right:16px;padding-left:8px;text-transform:uppercase;font-size:6px;letter-spacing:.2px}:host ::ng-deep .section-wrapper{top:-21px;position:absolute;right:0;left:12px}:host ::ng-deep .container-box.container-box-bordered{border:1px solid rgba(0,0,0,.2);margin-bottom:25px;padding-left:25px}:host ::ng-deep .container-box.container-box-radio{margin-left:0}:host ::ng-deep .container-box.container-box-radio:hover,:host ::ng-deep .container-box.container-box-checkbox:hover{cursor:pointer}:host ::ng-deep .container-box{position:relative;overflow:auto;border:1px solid transparent;background:var(--vl-input-background)}:host ::ng-deep .container-box .container-box{border:1px solid rgba(0,0,0,.2);margin-left:25px;margin-right:25px;margin-bottom:25px}:host ::ng-deep .container-box .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box .box-title .header .header-label{color:#333;margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-label small{padding-left:21px;color:#757575;font-weight:400;font-size:10px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-qty-container,:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{display:table-cell;vertical-align:middle;height:75px;padding-left:21px}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control,:host ::ng-deep .container-box .box-title .header .radio-button .form-control,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control{height:auto;color:#333;width:50px;border:1px solid #dddddd}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control:focus,:host ::ng-deep .container-box .box-title .header .radio-button .form-control:focus,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control:focus{border:1px solid #c4c4c4}:host ::ng-deep .container-box .box-title .header .header-qty-container .validation-message,:host ::ng-deep .container-box .box-title .header .radio-button .validation-message,:host ::ng-deep .container-box .box-title .header .checkbox-select .validation-message{position:absolute;margin-top:3px}:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{padding-left:0;vertical-align:middle}:host ::ng-deep .container-box .box-content{padding:25px 0 25px 33px}:host ::ng-deep .container-box .timeline-item{clear:both;display:block;width:100%;position:relative}:host ::ng-deep .container-box .timeline-item:before{display:block!important;content:\"\";position:absolute;left:25px;top:-25px;bottom:25px;width:1px;border-left:1px dashed rgba(0,0,0,.2)}:host ::ng-deep .container-box .timeline-item .icon{background:#90c7ec;width:35px;height:35px;border-radius:50%;position:absolute;left:24px;top:4px}:host ::ng-deep .container-box .timeline-item .icon .fa.fa-upload{left:11px;top:10px}:host ::ng-deep .container-box .timeline-item .icon .fa{color:#fff;position:absolute}:host ::ng-deep .container-box .timeline-item .message .content{float:left;width:80%}:host ::ng-deep .container-box .container-group-control{background:transparent;text-transform:uppercase}:host ::ng-deep .container-box-custom{margin-bottom:25px}:host ::ng-deep .unchecked .container-box{border-color:#0003}:host ::ng-deep .unchecked .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .unchecked.timeline-item .icon-circle{background-color:#6e6e6e}:host ::ng-deep .collapsed .box-content-wrapper{opacity:0;display:none;transition:max-height .3s .1s}:host ::ng-deep .box-content-wrapper{transition:opacity .5s .1s;display:block;opacity:1}:host ::ng-deep .box-actions{position:absolute;right:25px;z-index:2;top:21px;opacity:1;transition:height .3s ease-out,opacity .5s .1s}:host ::ng-deep .box-action-button{height:32px;width:32px;line-height:32px;font-size:12px;text-align:center;float:left;margin-left:5px;border-radius:50%;transition:all .25s ease 0s}:host ::ng-deep .box-action-button a{color:#0000008a}:host ::ng-deep .box-action-button .check-icon{line-height:32px}:host ::ng-deep .box-actions-group{top:18px;right:45px}:host ::ng-deep .box-action-button:hover,:host ::ng-deep .box-action-button:focus{background-color:#0000001a;cursor:pointer;outline:none}:host ::ng-deep .box-action-button:active{background-color:#0003;cursor:pointer}:host ::ng-deep .box-action-button.active{background-color:#0000001a}:host ::ng-deep .div-block{clear:both;display:block}:host ::ng-deep .div-inline{float:left}:host ::ng-deep .checkbox-select{position:relative;display:block}:host ::ng-deep .checkbox-select label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .checkbox-select input[type=checkbox]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .checkbox-select .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:2px;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .checkbox-select .input-helper:after{font-weight:100;line-height:12px;font-size:10px;color:#fff;font-family:FontAwesome;position:absolute;content:\"\\f00c\";width:12px;height:12px;background:#0065ff;border-radius:0;top:1px;left:2px;transform:scale(0);transition:all;transition-duration:.15s}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:before,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:after,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button{position:relative;display:block}:host ::ng-deep .radio-button label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .radio-button input[type=radio]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .radio-button .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:50%;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button .input-helper:after{position:absolute;content:\"\";width:6px;height:6px;background:var(--vl-primary-color);border-radius:50%;top:4px;left:5px;transform:scale(0);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .form-control-wrapper .checkbox-select,:host ::ng-deep .form-control-wrapper .radio-button{padding-top:10px}:host ::ng-deep .shopping-bag-sidebar.open{transform:translate3d(-100%,0,0)}:host ::ng-deep .shopping-bag-sidebar{position:fixed;top:0;bottom:0;z-index:1051;width:420px;right:-420px;background-color:#2a2b30;transition:.3s transform}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart{color:#abacae;position:absolute;top:20%;width:50px;height:50px;line-height:50px;text-align:center;right:100%;left:auto;background:#2a2b30;border-radius:3px 0 0 3px;display:block}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:before{font-family:FontAwesome;content:\"\\f291\"}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:hover{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:active,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:focus,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:visited{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .cart-count{font-size:9px;font-weight:700;line-height:15px;position:absolute;top:50%;right:8px;width:15px;height:15px;margin:-16px 0 0;text-align:center;color:#fff;border-radius:50%;background:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-container{overflow:auto;display:block;height:100%;padding:0 25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item{color:#abacae;background-color:#000;position:relative;overflow:auto;margin-bottom:10px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title{position:relative;padding-right:25px;padding-left:25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .header{float:left;color:#abacae;margin:0;line-height:48px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-actions{height:48px;float:right;top:0}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-action-button{height:32px;width:32px;line-height:32px;font-size:10px;font-weight:700;margin-top:8px;text-align:center;transition:all .25s ease 0s;color:#fff;background-color:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-title{color:#cecece;font-size:11px;text-transform:uppercase;line-height:64px;font-weight:600;padding-top:0;margin-top:25px;margin-bottom:25px;text-align:right}:host ::ng-deep .container-box.hovered:before,:host ::ng-deep .box-title.hovered:before,:host ::ng-deep .container-box.selected:before,:host ::ng-deep .box-title.selected:before{inset:0}:host ::ng-deep .selectable{position:relative;cursor:pointer}:host ::ng-deep .container-box.hovered:before{border-color:transparent}:host ::ng-deep .container-box.hovered{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box.selected:before{border-color:transparent}:host ::ng-deep .container-box.selected{border-color:var(--vl-primary-color)}:host ::ng-deep .hovered:before{display:block!important;position:absolute;content:\" \";inset:-15px 15px 15px -15px;border:1px solid var(--vl-primary-color)}:host ::ng-deep .hovered .box-action-button{opacity:1!important}:host ::ng-deep .opacity-1{opacity:1!important}:host ::ng-deep .overflow-y--auto{overflow-y:auto}:host ::ng-deep .gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80)}:host ::ng-deep .gu-hide{display:none!important}:host ::ng-deep .gu-unselectable{-webkit-user-select:none!important;user-select:none!important}:host ::ng-deep .gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}:host ::ng-deep .top-nav-msg{margin-top:-30px}:host ::ng-deep .runtime-info-message ul{margin-bottom:0;list-style:none}:host ::ng-deep .runtime-info-message ul li{margin-bottom:10px}:host ::ng-deep .runtime-info-message ul li:last-child{margin-bottom:0}:host ::ng-deep .runtime-info-message .message-text{font-family:Open Sans,Tahoma,sans-serif!important;overflow:hidden;padding:0;font-size:11px}:host ::ng-deep .runtime-attributes-popover .popover-arrow{display:none}:host ::ng-deep .runtime-attributes-popover .popover-content{padding:0}:host ::ng-deep .runtime-attributes-popover .runtime-content-wrapper{padding:0}:host ::ng-deep .runtime-attributes-popover .container-box-custom{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form{margin:0;padding:0}:host ::ng-deep .runtime-attributes-popover .input-form form{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form form .div-inline{display:block;float:none}:host ::ng-deep .runtime-attributes-popover .input-form form .form-group{padding:0;margin:0}:host ::ng-deep .runtime-attributes-popover .container-box .box-content{padding:0}:host ::ng-deep .v-custom-title,:host ::ng-deep .v-custom-description,:host ::ng-deep .v-custom-image{display:none}:host ::ng-deep .dropdown{position:relative}:host ::ng-deep .dropdown-toggle:focus{outline:0}:host ::ng-deep .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d}:host ::ng-deep .dropdown-menu.pull-right{right:0;left:auto}:host ::ng-deep .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}:host ::ng-deep .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}:host ::ng-deep .dropdown-menu>li>a:hover,:host ::ng-deep .dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}:host ::ng-deep .dropdown-menu>.active>a,:host ::ng-deep .dropdown-menu>.active>a:hover,:host ::ng-deep .dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}:host ::ng-deep .dropdown-menu>.disabled>a,:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{color:#777}:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}:host ::ng-deep .open>.dropdown-menu{display:block}:host ::ng-deep .open>a{outline:0}:host ::ng-deep .dropdown-menu-right{right:0;left:auto}:host ::ng-deep .dropdown-menu-left{right:auto;left:0}:host ::ng-deep .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}:host ::ng-deep .dropdown-backdrop{position:fixed;inset:0;z-index:990}\n", ".info{color:var(--vl-text-color-secondary);font-weight:300;font-size:13px;line-height:20px}.info.error{color:var(--vl-error-color)}\n"], dependencies: [{ kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SectionRendererComponent, selector: "vl-section-renderer", inputs: ["section", "form"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ComponentPreviewComponent, decorators: [{
3184
- type: Component,
3185
- args: [{ selector: 'vl-component-preview', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
3186
- SectionsService,
3187
- FormScopeService,
3188
- CollapsibleStateService,
3189
- RuntimeFormService,
3190
- FormScopeService,
3191
- RuntimeService,
3192
- ], template: "<ng-container *ngIf=\"showPreview\">\n <vl-section-renderer [section]=\"section!\" [form]=\"form\"></vl-section-renderer>\n</ng-container>\n\n<span class=\"info\" *ngIf=\"isNoPreviewAvailable\">No preview available</span>\n<span class=\"info error\" *ngIf=\"isPreviewFailed\">Preview has failed</span>\n", styles: ["body.veloce-apex-index,body.veloce-index,body.sfdcBody{overflow:hidden;margin:0;padding:0}:host ::ng-deep .velo-app .modal.in .modal-dialog.runtime-modal{margin-left:5%;margin-right:5%;padding:0;position:relative;width:auto}:host ::ng-deep .modal-body.runtime-modal.main-container{height:100%;margin:0;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .content-wrapper{display:flex;flex-direction:column;height:100%}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper{display:flex;flex-direction:column;flex-grow:1;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid{height:100%;margin:0;padding:0;overflow:auto}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal .form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid section-script>:first-child{height:100%}:host ::ng-deep .runtime-modal .modal-content,:host ::ng-deep .gu-mirror .modal-content{background-color:--vl-input-background}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a{color:#333333b3;font-weight:600;text-transform:uppercase;letter-spacing:.85px;font-size:10px}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active{color:#333}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.disabled,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.disabled{color:#33333380}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active:after,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active:after{background-color:#f36;bottom:-1px;content:\"\";height:1px;left:0;position:absolute;width:100%}:host ::ng-deep .runtime-modal .modal-content .modal-header,:host ::ng-deep .gu-mirror .modal-content .modal-header{background:transparent;color:#fff}:host ::ng-deep .runtime-modal .runtime-group-divider,:host ::ng-deep .gu-mirror .runtime-group-divider{border-bottom:1px solid #e5e5e5}:host ::ng-deep .runtime-modal .input-form-input,:host ::ng-deep .gu-mirror .input-form-input{position:relative;padding-left:0;padding-top:0}:host ::ng-deep .runtime-modal .input-form-input--required>label,:host ::ng-deep .gu-mirror .input-form-input--required>label{color:#ff4233;font-weight:700}:host ::ng-deep .form-control-wrapper{position:relative}:host ::ng-deep .add-config-control:hover{background-color:#e96099;color:#fff;border:1px solid transparent}:host ::ng-deep .remove-config-control:hover{background-color:#828c9e;color:#fff}:host ::ng-deep .add-config-control[disabled],:host ::ng-deep .remove-config-control[disabled]{background-color:transparent;color:#ccc;border:1px dashed #ccc}:host ::ng-deep .add-config-control[disabled]:hover,:host ::ng-deep .remove-config-control[disabled]:hover{cursor:default}:host ::ng-deep .add-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;border-radius:50%;float:left;position:absolute;top:0;right:-57px;z-index:500;background-color:#e3337c;color:#fff;border:1px solid #e3337c;transition:all .5s ease 0s}:host ::ng-deep .add-config-control .plus-icon{line-height:36px}:host ::ng-deep .remove-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;margin-right:25px;border-radius:50%;float:left;position:absolute;top:33px;right:51px;z-index:500;background-color:transparent;color:#687285;border:1px solid transparent;transition:all .5s ease 0s}:host ::ng-deep .remove-config-control .plus-icon{line-height:36px}:host ::ng-deep .sidebar .new-wrapper{min-height:96px;margin-bottom:25px}:host ::ng-deep .sidebar .new-wrapper .add-container .add-card{left:0;margin-left:15px}:host ::ng-deep .ui-settings{height:100%;display:flex;flex-direction:column}:host ::ng-deep .runtime-modal .form-horizontal form,:host ::ng-deep .gu-mirror form{margin:0}:host ::ng-deep .runtime-modal .form-horizontal .form-group,:host ::ng-deep .gu-mirror .form-group{margin:0;padding:0}:host ::ng-deep .runtime-modal .form-horizontal .control.form-group,:host ::ng-deep .gu-mirror .control.form-group{margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .form-control-wrapper,:host ::ng-deep .gu-mirror .form-control-wrapper{min-width:172px;margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper{min-width:50px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper .form-control,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper .form-control{width:50px}:host ::ng-deep .runtime-left-side{height:calc(100% - 97px);background:#fff;padding:48px 56px 0}:host ::ng-deep .ui-controls-group{margin-left:-8px;margin-right:-8px}:host ::ng-deep .ui-controls-group .ui-control-type:hover{border-color:#3384ff}:host ::ng-deep .ui-controls-group .ui-control-type{position:relative;min-width:140px;float:left;border-radius:3px;border:1px solid #c4c4c4;background-color:#fff;width:calc(50% - 16px);padding:12px 13px;margin-bottom:16px;margin-right:8px;margin-left:8px;cursor:pointer}:host ::ng-deep .ui-controls-group .ui-control-type span{padding-left:3px}:host ::ng-deep .sidebar-header{letter-spacing:-.5px;padding-bottom:24px;padding-top:0;line-height:32px;font-size:24px;font-weight:700;color:#333}:host ::ng-deep .sidebar-header small{display:block;color:#333;font-size:11px;font-weight:300;line-height:20px;margin:0}:host ::ng-deep .sidebar-menu-list{color:#333333b3;margin:0;width:100%;list-style:none;font-size:12px}:host ::ng-deep .sidebar-menu-list li.active a,:host ::ng-deep .sidebar-menu-list li.active i{color:#005ee3}:host ::ng-deep .sidebar-menu-list li:hover{cursor:pointer}:host ::ng-deep .sidebar-menu-list li{text-align:right;padding-left:16px}:host ::ng-deep .sidebar-menu-list li a{padding:0 8px;margin-left:-8px;cursor:pointer;white-space:nowrap;color:inherit;font-weight:700;display:inline-block;line-height:32px}:host ::ng-deep .sidebar-menu-list li i{display:none;padding-right:5px}:host ::ng-deep .runtime-builder-content{min-height:100%}:host ::ng-deep .runtime-builder-content .input-form{margin:0;padding:18px 11px 0}:host ::ng-deep .runtime-builder-content .input-form .form-group{border:3px dashed transparent}:host ::ng-deep .runtime-builder-content .input-form .form-group:hover{border:3px dashed #dedede}:host ::ng-deep .runtime-right-side{background:#fff}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background:#fff;position:relative;display:inline-block;padding-right:16px;text-transform:uppercase;font-size:10px;letter-spacing:.2px}:host ::ng-deep .sidebar-section:before{content:\" \";position:absolute;top:50%;left:0;right:0;border-top:1px solid #e6e6e6}:host ::ng-deep .sidebar-section{position:relative;margin-top:16px;margin-bottom:16px}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background-color:var(--vl-input-background);position:relative;display:inline-block;padding-right:16px;padding-left:8px;text-transform:uppercase;font-size:6px;letter-spacing:.2px}:host ::ng-deep .section-wrapper{top:-21px;position:absolute;right:0;left:12px}:host ::ng-deep .container-box.container-box-bordered{border:1px solid rgba(0,0,0,.2);margin-bottom:25px;padding-left:25px}:host ::ng-deep .container-box.container-box-radio{margin-left:0}:host ::ng-deep .container-box.container-box-radio:hover,:host ::ng-deep .container-box.container-box-checkbox:hover{cursor:pointer}:host ::ng-deep .container-box{position:relative;overflow:auto;border:1px solid transparent;background:var(--vl-input-background)}:host ::ng-deep .container-box .container-box{border:1px solid rgba(0,0,0,.2);margin-left:25px;margin-right:25px;margin-bottom:25px}:host ::ng-deep .container-box .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box .box-title .header .header-label{color:#333;margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-label small{padding-left:21px;color:#757575;font-weight:400;font-size:10px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-qty-container,:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{display:table-cell;vertical-align:middle;height:75px;padding-left:21px}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control,:host ::ng-deep .container-box .box-title .header .radio-button .form-control,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control{height:auto;color:#333;width:50px;border:1px solid #dddddd}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control:focus,:host ::ng-deep .container-box .box-title .header .radio-button .form-control:focus,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control:focus{border:1px solid #c4c4c4}:host ::ng-deep .container-box .box-title .header .header-qty-container .validation-message,:host ::ng-deep .container-box .box-title .header .radio-button .validation-message,:host ::ng-deep .container-box .box-title .header .checkbox-select .validation-message{position:absolute;margin-top:3px}:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{padding-left:0;vertical-align:middle}:host ::ng-deep .container-box .box-content{padding:25px 0 25px 33px}:host ::ng-deep .container-box .timeline-item{clear:both;display:block;width:100%;position:relative}:host ::ng-deep .container-box .timeline-item:before{display:block!important;content:\"\";position:absolute;left:25px;top:-25px;bottom:25px;width:1px;border-left:1px dashed rgba(0,0,0,.2)}:host ::ng-deep .container-box .timeline-item .icon{background:#90c7ec;width:35px;height:35px;border-radius:50%;position:absolute;left:24px;top:4px}:host ::ng-deep .container-box .timeline-item .icon .fa.fa-upload{left:11px;top:10px}:host ::ng-deep .container-box .timeline-item .icon .fa{color:#fff;position:absolute}:host ::ng-deep .container-box .timeline-item .message .content{float:left;width:80%}:host ::ng-deep .container-box .container-group-control{background:transparent;text-transform:uppercase}:host ::ng-deep .container-box-custom{margin-bottom:25px}:host ::ng-deep .unchecked .container-box{border-color:#0003}:host ::ng-deep .unchecked .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .unchecked.timeline-item .icon-circle{background-color:#6e6e6e}:host ::ng-deep .collapsed .box-content-wrapper{opacity:0;display:none;transition:max-height .3s .1s}:host ::ng-deep .box-content-wrapper{transition:opacity .5s .1s;display:block;opacity:1}:host ::ng-deep .box-actions{position:absolute;right:25px;z-index:2;top:21px;opacity:1;transition:height .3s ease-out,opacity .5s .1s}:host ::ng-deep .box-action-button{height:32px;width:32px;line-height:32px;font-size:12px;text-align:center;float:left;margin-left:5px;border-radius:50%;transition:all .25s ease 0s}:host ::ng-deep .box-action-button a{color:#0000008a}:host ::ng-deep .box-action-button .check-icon{line-height:32px}:host ::ng-deep .box-actions-group{top:18px;right:45px}:host ::ng-deep .box-action-button:hover,:host ::ng-deep .box-action-button:focus{background-color:#0000001a;cursor:pointer;outline:none}:host ::ng-deep .box-action-button:active{background-color:#0003;cursor:pointer}:host ::ng-deep .box-action-button.active{background-color:#0000001a}:host ::ng-deep .div-block{clear:both;display:block}:host ::ng-deep .div-inline{float:left}:host ::ng-deep .checkbox-select{position:relative;display:block}:host ::ng-deep .checkbox-select label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .checkbox-select input[type=checkbox]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .checkbox-select .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:2px;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .checkbox-select .input-helper:after{font-weight:100;line-height:12px;font-size:10px;color:#fff;font-family:FontAwesome;position:absolute;content:\"\\f00c\";width:12px;height:12px;background:#0065ff;border-radius:0;top:1px;left:2px;transform:scale(0);transition:all;transition-duration:.15s}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:before,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:after,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button{position:relative;display:block}:host ::ng-deep .radio-button label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .radio-button input[type=radio]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .radio-button .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:50%;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button .input-helper:after{position:absolute;content:\"\";width:6px;height:6px;background:var(--vl-primary-color);border-radius:50%;top:4px;left:5px;transform:scale(0);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .form-control-wrapper .checkbox-select,:host ::ng-deep .form-control-wrapper .radio-button{padding-top:10px}:host ::ng-deep .shopping-bag-sidebar.open{transform:translate3d(-100%,0,0)}:host ::ng-deep .shopping-bag-sidebar{position:fixed;top:0;bottom:0;z-index:1051;width:420px;right:-420px;background-color:#2a2b30;transition:.3s transform}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart{color:#abacae;position:absolute;top:20%;width:50px;height:50px;line-height:50px;text-align:center;right:100%;left:auto;background:#2a2b30;border-radius:3px 0 0 3px;display:block}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:before{font-family:FontAwesome;content:\"\\f291\"}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:hover{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:active,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:focus,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:visited{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .cart-count{font-size:9px;font-weight:700;line-height:15px;position:absolute;top:50%;right:8px;width:15px;height:15px;margin:-16px 0 0;text-align:center;color:#fff;border-radius:50%;background:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-container{overflow:auto;display:block;height:100%;padding:0 25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item{color:#abacae;background-color:#000;position:relative;overflow:auto;margin-bottom:10px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title{position:relative;padding-right:25px;padding-left:25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .header{float:left;color:#abacae;margin:0;line-height:48px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-actions{height:48px;float:right;top:0}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-action-button{height:32px;width:32px;line-height:32px;font-size:10px;font-weight:700;margin-top:8px;text-align:center;transition:all .25s ease 0s;color:#fff;background-color:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-title{color:#cecece;font-size:11px;text-transform:uppercase;line-height:64px;font-weight:600;padding-top:0;margin-top:25px;margin-bottom:25px;text-align:right}:host ::ng-deep .container-box.hovered:before,:host ::ng-deep .box-title.hovered:before,:host ::ng-deep .container-box.selected:before,:host ::ng-deep .box-title.selected:before{inset:0}:host ::ng-deep .selectable{position:relative;cursor:pointer}:host ::ng-deep .container-box.hovered:before{border-color:transparent}:host ::ng-deep .container-box.hovered{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box.selected:before{border-color:transparent}:host ::ng-deep .container-box.selected{border-color:var(--vl-primary-color)}:host ::ng-deep .hovered:before{display:block!important;position:absolute;content:\" \";inset:-15px 15px 15px -15px;border:1px solid var(--vl-primary-color)}:host ::ng-deep .hovered .box-action-button{opacity:1!important}:host ::ng-deep .opacity-1{opacity:1!important}:host ::ng-deep .overflow-y--auto{overflow-y:auto}:host ::ng-deep .gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80)}:host ::ng-deep .gu-hide{display:none!important}:host ::ng-deep .gu-unselectable{-webkit-user-select:none!important;user-select:none!important}:host ::ng-deep .gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}:host ::ng-deep .top-nav-msg{margin-top:-30px}:host ::ng-deep .runtime-info-message ul{margin-bottom:0;list-style:none}:host ::ng-deep .runtime-info-message ul li{margin-bottom:10px}:host ::ng-deep .runtime-info-message ul li:last-child{margin-bottom:0}:host ::ng-deep .runtime-info-message .message-text{font-family:Open Sans,Tahoma,sans-serif!important;overflow:hidden;padding:0;font-size:11px}:host ::ng-deep .runtime-attributes-popover .popover-arrow{display:none}:host ::ng-deep .runtime-attributes-popover .popover-content{padding:0}:host ::ng-deep .runtime-attributes-popover .runtime-content-wrapper{padding:0}:host ::ng-deep .runtime-attributes-popover .container-box-custom{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form{margin:0;padding:0}:host ::ng-deep .runtime-attributes-popover .input-form form{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form form .div-inline{display:block;float:none}:host ::ng-deep .runtime-attributes-popover .input-form form .form-group{padding:0;margin:0}:host ::ng-deep .runtime-attributes-popover .container-box .box-content{padding:0}:host ::ng-deep .v-custom-title,:host ::ng-deep .v-custom-description,:host ::ng-deep .v-custom-image{display:none}:host ::ng-deep .dropdown{position:relative}:host ::ng-deep .dropdown-toggle:focus{outline:0}:host ::ng-deep .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d}:host ::ng-deep .dropdown-menu.pull-right{right:0;left:auto}:host ::ng-deep .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}:host ::ng-deep .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}:host ::ng-deep .dropdown-menu>li>a:hover,:host ::ng-deep .dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}:host ::ng-deep .dropdown-menu>.active>a,:host ::ng-deep .dropdown-menu>.active>a:hover,:host ::ng-deep .dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}:host ::ng-deep .dropdown-menu>.disabled>a,:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{color:#777}:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}:host ::ng-deep .open>.dropdown-menu{display:block}:host ::ng-deep .open>a{outline:0}:host ::ng-deep .dropdown-menu-right{right:0;left:auto}:host ::ng-deep .dropdown-menu-left{right:auto;left:0}:host ::ng-deep .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}:host ::ng-deep .dropdown-backdrop{position:fixed;inset:0;z-index:990}\n", ".info{color:var(--vl-text-color-secondary);font-weight:300;font-size:13px;line-height:20px}.info.error{color:var(--vl-error-color)}\n"] }]
3193
- }], ctorParameters: function () { return [{ type: SectionsService }, { type: RuntimeFormService }, { type: FormScopeService }, { type: RuntimeService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { data: [{
3194
- type: Input
3195
- }] } });
3196
-
3197
- const getSectionTree = (src) => {
3198
- const sections = EntityUtil.clone(src);
3199
- const sectionIdMap = new Map();
3200
- sections.forEach(section => sectionIdMap.set(section.id, section));
3201
- const sectionTree = [];
3202
- sections.forEach(section => {
3203
- if (section.parentId) {
3204
- const parentSection = sectionIdMap.get(section.parentId);
3205
- if (parentSection) {
3206
- const sectionFromMap = sectionIdMap.get(section.id);
3207
- if (sectionFromMap) {
3208
- parentSection.addChild(sectionFromMap);
3209
- }
3210
- }
3211
- }
3212
- else {
3213
- const s = sectionIdMap.get(section.id);
3214
- if (s) {
3215
- sectionTree.push(s);
3216
- }
3217
- }
3218
- });
3219
- return sectionTree;
3220
- };
3221
-
3222
- class RuntimeComponent {
3223
- constructor(sectionsService, formScope, collapsibleState, formService, runtimeService, messageService, contextService, orderByPipe, searchFilterPipe, cdr) {
3224
- this.sectionsService = sectionsService;
3225
- this.formScope = formScope;
3226
- this.collapsibleState = collapsibleState;
3227
- this.formService = formService;
3228
- this.runtimeService = runtimeService;
3229
- this.messageService = messageService;
3230
- this.contextService = contextService;
3231
- this.orderByPipe = orderByPipe;
3232
- this.searchFilterPipe = searchFilterPipe;
3233
- this.cdr = cdr;
3234
- this.messageBucketId = 'ui.runtime';
3235
- this.sortedSections = [];
3236
- this.staticSections = [];
3237
- this.form = new FormGroup({});
3238
- this.solutionIsReady = false;
3239
- this.unsubscribe = new Subject();
3240
- this.solutionUpdated = new EventEmitter();
3241
- }
3242
- adjustPrice(valueOption, section, solutionLineItem, patch) {
3243
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3244
- if (!parentLineItem) {
3245
- return;
3246
- }
3247
- parentLineItem.lineItems = parentLineItem.lineItems.map(lineItem => {
3248
- const { productId, chargeItems } = lineItem;
3249
- if (productId !== valueOption) {
3250
- return lineItem;
3251
- }
3252
- const chargeItem = chargeItems.shift();
3253
- const updatedChargeItem = Object.assign(Object.assign({}, chargeItem), patch);
3254
- return Object.assign(Object.assign({}, lineItem), { chargeItems: [updatedChargeItem, ...chargeItems] });
3255
- });
3256
- this.updateRuntime(solutionLineItem);
3257
- }
3258
- ngOnInit() {
3259
- this.formScope.formSubmitEvent.pipe(takeUntil(this.unsubscribe)).subscribe((e) => {
3260
- var _a, _b, _c, _d, _e, _f;
3261
- try {
3262
- this.form.updateValueAndValidity();
3263
- const solutionLineItem = EntityUtil.clone(this.solutionLineItem);
3264
- const section = this.findSection(e.id);
3265
- if (!section) {
3266
- throw 'Section not found';
3267
- }
3268
- const entityType = section.boundData.entityType;
3269
- if (entityType === BoundDataType[BoundDataType.PORT] || entityType === BoundDataType[BoundDataType.TYPE]) {
3270
- if (e.action === 'patch' && EntityUtil.isPresent(e.valueOption)) {
3271
- const valueOption = e['valueOption'];
3272
- if (!((_a = section.model) === null || _a === void 0 ? void 0 : _a.parentId)) {
3273
- this.collapsibleState.clearState(section.id);
3274
- this.updateRuntime(valueOption);
3275
- }
3276
- else {
3277
- const parentLineItem = LineItemUtil.findById(section.model.parentId, [solutionLineItem]);
3278
- if (parentLineItem) {
3279
- const indx = parentLineItem.lineItems.findIndex(item => { var _a; return item.id === ((_a = section.model) === null || _a === void 0 ? void 0 : _a.id); });
3280
- parentLineItem.lineItems.splice(indx, 1, valueOption);
3281
- this.collapsibleState.clearState(section.id);
3282
- this.updateRuntime(solutionLineItem);
3283
- }
3284
- }
3285
- }
3286
- }
3287
- if (entityType === BoundDataType[BoundDataType.PORT]) {
3288
- if (e.action === 'upsert') {
3289
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3290
- if (parentLineItem) {
3291
- parentLineItem.lineItems.forEach(i => {
3292
- if (e.selectedValueOptions &&
3293
- e.selectedValueOptions.findIndex(v => v.toLowerCase() === i.type.toLowerCase()) < 0) {
3294
- this.updateCardinalityVariable(parentLineItem, i, 0);
3295
- }
3296
- });
3297
- const lineItems = parentLineItem === null || parentLineItem === void 0 ? void 0 : parentLineItem.lineItems.filter(i => e.selectedValueOptions &&
3298
- e.selectedValueOptions.findIndex(v => v.toLowerCase() === i.type.toLowerCase()) > -1);
3299
- (_b = e.selectedValueOptions) === null || _b === void 0 ? void 0 : _b.forEach(v => {
3300
- if ((lineItems === null || lineItems === void 0 ? void 0 : lineItems.findIndex(item => item.type.toLowerCase() === v.toLowerCase())) === -1) {
3301
- const lineItem = this.createLineItem(section, v, parentLineItem);
3302
- this.updateCardinalityVariable(parentLineItem, lineItem);
3303
- lineItems.push(lineItem);
3304
- }
3305
- });
3306
- this.updateRuntime(solutionLineItem);
3307
- }
3308
- }
3309
- if (e.action === 'create') {
3310
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3311
- if (parentLineItem) {
3312
- const valueOption = e.valueOption;
3313
- const lineItem = this.createLineItem(section, valueOption, parentLineItem);
3314
- parentLineItem.lineItems.push(lineItem);
3315
- this.updateCardinalityVariable(parentLineItem, lineItem);
3316
- this.updateRuntime(solutionLineItem);
3317
- }
3318
- }
3319
- if (e.action === 'copy') {
3320
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3321
- if (parentLineItem) {
3322
- const valueOption = e.valueOption;
3323
- const lineItemToCopy = parentLineItem.lineItems.find(li => li.id === valueOption);
3324
- if (lineItemToCopy) {
3325
- const lineItem = Object.assign(Object.assign({}, lineItemToCopy), { id: '' });
3326
- parentLineItem.lineItems.push(lineItem);
3327
- this.updateCardinalityVariable(parentLineItem, lineItem);
3328
- this.updateRuntime(solutionLineItem);
3329
- }
3330
- }
3331
- }
3332
- if (e.action === 'update') {
3333
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3334
- if (parentLineItem) {
3335
- //Assuming that radio control is the only control, that 'updates' values
3336
- const previous = (_c = section.model) === null || _c === void 0 ? void 0 : _c.lineItems.filter(li => li.port && li.port === section.boundData.name)[0];
3337
- if (previous) {
3338
- this.updateCardinalityVariable(parentLineItem, previous, 0);
3339
- }
3340
- const index = parentLineItem.lineItems.findIndex(li => li.id === (previous === null || previous === void 0 ? void 0 : previous.id));
3341
- const lineItem = {
3342
- id: UUID.UUID(),
3343
- qty: previous === null || previous === void 0 ? void 0 : previous.qty,
3344
- port: previous === null || previous === void 0 ? void 0 : previous.port,
3345
- type: EntityUtil.isPresent(e.valueOption) ? e.valueOption : this.form.controls[e.id].value,
3346
- cfgStatus: 'New',
3347
- parentId: previous === null || previous === void 0 ? void 0 : previous.parentId,
3348
- };
3349
- this.updateCardinalityVariable(parentLineItem, lineItem);
3350
- parentLineItem.lineItems[index] = lineItem;
3351
- this.updateRuntime(solutionLineItem);
3352
- }
3353
- }
3354
- if (e.action === 'remove') {
3355
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3356
- if (parentLineItem &&
3357
- SectionsBinderHelper.isRemoveAllowed(parentLineItem, section.boundData.name, (_d = section.model) === null || _d === void 0 ? void 0 : _d.qty)) {
3358
- const index = parentLineItem.lineItems.findIndex(item => { var _a; return item.type.toLowerCase() === ((_a = e.valueOption) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
3359
- if (index > -1) {
3360
- const removed = parentLineItem.lineItems.splice(index, 1)[0];
3361
- this.updateCardinalityVariable(parentLineItem, removed, 0);
3362
- this.updateRuntime(solutionLineItem);
3363
- }
3364
- }
3365
- }
3366
- if (e.action === 'qtyUpdate') {
3367
- const typeSection = e.valueOption
3368
- ? SectionHelperService.findSectionForValue(section, e.valueOption)
3369
- : undefined;
3370
- const typeLineItem = (typeSection === null || typeSection === void 0 ? void 0 : typeSection.model) && LineItemUtil.findById(typeSection.model.id, [solutionLineItem]);
3371
- if (typeSection && typeLineItem) {
3372
- typeLineItem.qty = +this.form.controls[typeSection.id + 'qty'].value;
3373
- typeLineItem.cfgStatus = 'User';
3374
- this.updateRuntime(solutionLineItem);
3375
- }
3376
- }
3377
- if (e.action === 'adjustNetPrice') {
3378
- const { valueOption, options } = e;
3379
- const { amount } = options !== null && options !== void 0 ? options : {};
3380
- const priceAdjustment = {
3381
- type: 'OVERRIDE_AMOUNT',
3382
- explanation: 'Manual net price adjustment',
3383
- formula: '',
3384
- amount,
3385
- };
3386
- this.adjustPrice(valueOption, section, solutionLineItem, { priceAdjustment });
3387
- }
3388
- if (e.action === 'adjustListPrice') {
3389
- const { valueOption, options } = e;
3390
- const { amount } = options !== null && options !== void 0 ? options : {};
3391
- const listPriceAdjustment = {
3392
- type: 'OVERRIDE_AMOUNT',
3393
- explanation: 'Manual list price adjustment',
3394
- formula: '',
3395
- amount,
3396
- };
3397
- this.adjustPrice(valueOption, section, solutionLineItem, { listPriceAdjustment });
3398
- }
3399
- }
3400
- if (entityType === BoundDataType[BoundDataType.TYPE]) {
3401
- if (e.action === 'remove') {
3402
- const parentLineItem = ((_e = section.model) === null || _e === void 0 ? void 0 : _e.parentId) && LineItemUtil.findById(section.model.parentId, [solutionLineItem]);
3403
- if (parentLineItem &&
3404
- section.model &&
3405
- section.model.port &&
3406
- SectionsBinderHelper.isRemoveAllowed(parentLineItem, section.model.port, (_f = section.model) === null || _f === void 0 ? void 0 : _f.qty)) {
3407
- const index = parentLineItem.lineItems.findIndex(item => { var _a; return item.id === ((_a = section.model) === null || _a === void 0 ? void 0 : _a.id); });
3408
- if (index > -1) {
3409
- const removed = parentLineItem.lineItems.splice(index, 1)[0];
3410
- this.updateCardinalityVariable(parentLineItem, removed, 0);
3411
- this.collapsibleState.clearState(section.id);
3412
- this.updateRuntime(solutionLineItem);
3413
- }
3414
- }
3415
- }
3416
- if (e.action === 'qtyUpdate') {
3417
- const typeLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3418
- if (typeLineItem) {
3419
- const qty = +this.form.controls[e.id + 'qty'].value;
3420
- if (typeLineItem.parentId) {
3421
- const parentLineItem = LineItemUtil.findById(typeLineItem.parentId, [solutionLineItem]);
3422
- if (parentLineItem) {
3423
- this.updateCardinalityVariable(parentLineItem, typeLineItem, qty);
3424
- }
3425
- }
3426
- typeLineItem.qty = qty;
3427
- typeLineItem.cfgStatus = 'User';
3428
- this.updateRuntime(solutionLineItem);
3429
- }
3430
- }
3431
- }
3432
- if (entityType === BoundDataType[BoundDataType.ATTRIBUTE]) {
3433
- if (e.action === 'update') {
3434
- const parentLineItem = section.model && LineItemUtil.findById(section.model.id, [solutionLineItem]);
3435
- const attribute = parentLineItem === null || parentLineItem === void 0 ? void 0 : parentLineItem.attributes.find(attr => attr.name.toLowerCase() === section.boundData.name.toLowerCase());
3436
- if (attribute) {
3437
- //Explicitly set value always win
3438
- let value = typeof e.valueOption !== 'undefined' ? e.valueOption : this.form.controls[e.id].value;
3439
- if (attribute.type === 'BOOLEAN') {
3440
- value = value ? 1 : 0;
3441
- }
3442
- attribute.value = value;
3443
- attribute.cfgStatus = 'User';
3444
- this.updateRuntime(solutionLineItem);
3445
- }
3446
- }
3447
- }
3448
- }
3449
- catch (e) {
3450
- console.log(e);
3451
- this.messageService.add({ key: this.messageBucketId, summary: `Configuration failed ${e === null || e === void 0 ? void 0 : e.message}` });
3452
- }
3453
- });
3454
- this.runtimeService.onSolutionReadyEvent
3455
- .pipe(takeUntil(this.unsubscribe))
3456
- .subscribe(lineItem => this.onSolutionReady(lineItem));
3457
- this.runtimeService.onSolutionUpdatedEvent
3458
- .pipe(takeUntil(this.unsubscribe))
3459
- .subscribe((data) => {
3460
- if (!(data instanceof HttpErrorResponse)) {
3461
- return this.handleSolutionUpdate(data);
3462
- }
3463
- this.handleSolutionFailedUpdate(data);
3464
- });
3465
- this.runtimeService.onUIRefreshEvent.pipe(takeUntil(this.unsubscribe)).subscribe(() => {
3466
- var _a;
3467
- const { uiDefinition } = (_a = this.runtimeService.getRuntimeContext()) !== null && _a !== void 0 ? _a : {};
3468
- this.runtimeContext.uiDefinition = uiDefinition;
3469
- this.formScope.scriptSessionScope = {};
3470
- this.startRuntime();
3471
- });
3472
- }
3473
- onSolutionReady(lineItem) {
3474
- var _a;
3475
- const context = this.runtimeService.getRuntimeContext();
3476
- const configurationContext = this.contextService.resolve();
3477
- const mergeContext = Object.assign(Object.assign({}, context), { properties: Object.assign(Object.assign({}, context.properties), configurationContext.properties) });
3478
- const accountId = (_a = mergeContext.properties) === null || _a === void 0 ? void 0 : _a.AccountId;
3479
- if (accountId && accountId.length === 15) {
3480
- this.runtimeContext = Object.assign(Object.assign({}, mergeContext), { properties: Object.assign(Object.assign({}, mergeContext.properties), { AccountId: SalesforceIdUtils.generateId18FromId15(accountId) }) });
3481
- }
3482
- else {
3483
- this.runtimeContext = mergeContext;
3484
- }
3485
- this.solutionLineItem = lineItem;
3486
- this.runtimeService.setRuntimeContext(this.runtimeContext);
3487
- this.startRuntime();
3488
- }
3489
- handleSolutionUpdate(updatedLineItem) {
3490
- this.solutionLineItem = updatedLineItem;
3491
- this.processSolution(true);
3492
- this.runtimeService.solutionProcessed(this.solutionLineItem);
3493
- this.cdr.detectChanges();
3494
- }
3495
- handleSolutionFailedUpdate(error) {
3496
- var _a;
3497
- const hasErrorMessage = EntityUtil.isPresent(error.error) && EntityUtil.isPresent(error.error.message);
3498
- const message = hasErrorMessage ? error.error.message : 'Configuration failed';
3499
- const { isHandlingConfigurationErrors } = (_a = this.runtimeContext.uiDefinition) !== null && _a !== void 0 ? _a : {};
3500
- if (isHandlingConfigurationErrors) {
3501
- this.messageService.add({ key: this.messageBucketId, summary: message });
3502
- }
3503
- this.solutionLineItem = Object.assign(Object.assign({}, this.solutionLineItem), { messages: [...this.solutionLineItem.messages, `E:${message}`] });
3504
- this.processSolution(true, true);
3505
- this.runtimeService.solutionProcessed(this.solutionLineItem);
3506
- this.cdr.detectChanges();
3507
- }
3508
- updateCardinalityVariable(parent, updated, newQuantity) {
3509
- var _a;
3510
- const portDomain = updated.port ? parent.portDomains[updated.port] : undefined;
3511
- const domainType = portDomain === null || portDomain === void 0 ? void 0 : portDomain.domainTypes.find(t => t.name === updated.type);
3512
- const cardinality = (_a = domainType === null || domainType === void 0 ? void 0 : domainType.cardinality) !== null && _a !== void 0 ? _a : 0;
3513
- let qty;
3514
- if (!Number.isFinite(domainType === null || domainType === void 0 ? void 0 : domainType.cardinality)) {
3515
- qty = Number.isFinite(newQuantity) ? newQuantity : updated.qty;
3516
- }
3517
- else {
3518
- qty = EntityUtil.isPresent(newQuantity)
3519
- ? cardinality - updated.qty + newQuantity
3520
- : cardinality + updated.qty;
3521
- }
3522
- const cardinalityName = '#CV-' + updated.type + '@' + updated.port;
3523
- let cardinalityVariable = parent.attributes.find(a => a.name === cardinalityName);
3524
- if (!cardinalityVariable) {
3525
- cardinalityVariable = {
3526
- id: UUID.UUID(),
3527
- name: cardinalityName,
3528
- };
3529
- parent.attributes.push(cardinalityVariable);
3530
- }
3531
- cardinalityVariable.value = qty;
3532
- cardinalityVariable.cfgStatus = 'User';
3533
- }
3534
- createLineItem(section, valueOption, parentLineItem) {
3535
- return {
3536
- qty: +this.form.controls[section.id + 'qty'].value,
3537
- port: section.boundData.name,
3538
- type: EntityUtil.isPresent(valueOption) ? valueOption : this.form.controls[section.id].value,
3539
- cfgStatus: 'New',
3540
- parentId: parentLineItem === null || parentLineItem === void 0 ? void 0 : parentLineItem.id,
3541
- };
3542
- }
3543
- ngOnDestroy() {
3544
- this.unsubscribe.next();
3545
- this.sectionsService.destroy();
3546
- }
3547
- startRuntime() {
3548
- var _a, _b, _c;
3549
- const uiDefinition = this.runtimeContext.uiDefinition;
3550
- const defaultTab = (_a = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.tabs) === null || _a === void 0 ? void 0 : _a.find(tab => tab.isDefault);
3551
- this.activeUITab = EntityUtil.isPresent(defaultTab) ? defaultTab : (_b = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.tabs) === null || _b === void 0 ? void 0 : _b[0];
3552
- this.sectionsService.compileModule((_c = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.sections) !== null && _c !== void 0 ? _c : [], uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.isViewEncapsulated);
3553
- this.processSolution();
3554
- this.solutionIsReady = true;
3555
- this.cdr.detectChanges();
3556
- }
3557
- updateRuntime(lineItem) {
3558
- this.solutionUpdated.emit(lineItem);
3559
- }
3560
- addToCart() {
3561
- const lineItem = EntityUtil.clone(this.solutionLineItem);
3562
- this.runtimeService.stopRuntime(lineItem);
3563
- }
3564
- processSolution(isUpdate, isError) {
3565
- var _a, _b, _c, _d, _e, _f;
3566
- //1. Bind sections to solution
3567
- let sections = (_b = EntityUtil.clone((_a = this.runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.sections)) !== null && _b !== void 0 ? _b : [];
3568
- const sourceSections = (_d = EntityUtil.clone((_c = this.runtimeContext.uiDefinition) === null || _c === void 0 ? void 0 : _c.sections)) !== null && _d !== void 0 ? _d : [];
3569
- this.updateLineItemsSectionPath(this.solutionLineItem);
3570
- SectionsBinderHelper.setLineItemsPath(this.runtimeContext.runtimeModel, this.solutionLineItem, sections, sourceSections, (sec) => !sec.parentId && sec.boundData, (_f = (_e = this.runtimeContext.uiDefinition) === null || _e === void 0 ? void 0 : _e.pricingEnabled) !== null && _f !== void 0 ? _f : false);
3571
- sections = sections.filter(s => s.model && s.template);
3572
- //2. Init form
3573
- this.form = this.formService.initForm(sections, this.solutionLineItem);
3574
- this.formScope.form = this.form;
3575
- this.sortedSections = this.filterAndSort(getSectionTree(sections.filter(s => !s.isStatic)));
3576
- if (!isUpdate) {
3577
- this.staticSections = this.filterAndSort(getSectionTree(sections.filter(s => s.isStatic)));
3578
- }
3579
- if (!isError) {
3580
- this.messageService.clear(this.messageBucketId);
3581
- }
3582
- }
3583
- hideModal() {
3584
- this.runtimeService.cancelRuntime();
3585
- }
3586
- updateLineItemsSectionPath(lineItem, parent) {
3587
- const path = {
3588
- types: parent ? parent.types.concat([lineItem.type]) : [lineItem.type],
3589
- ports: parent ? parent.ports.concat(lineItem.port ? [lineItem.port] : []) : [],
3590
- };
3591
- lineItem.path = path;
3592
- for (const child of lineItem.lineItems) {
3593
- this.updateLineItemsSectionPath(child, lineItem.path);
3594
- }
3595
- }
3596
- filterAndSort(sections) {
3597
- var _a;
3598
- const filtered = this.searchFilterPipe.transform(sections, (_a = this.activeUITab) === null || _a === void 0 ? void 0 : _a.id, 'page');
3599
- const ordered = this.orderByPipe.transform(filtered, 'order', 'asc');
3600
- return ordered;
3601
- }
3602
- findSection(id) {
3603
- return EntityUtil.findByFieldHierarchically('id', id, [...this.sortedSections, ...this.staticSections], 'children');
3604
- }
3605
- }
3606
- RuntimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeComponent, deps: [{ token: SectionsService }, { token: FormScopeService }, { token: CollapsibleStateService }, { token: RuntimeFormService }, { token: RuntimeService }, { token: MessageService }, { token: i2.ContextService }, { token: i7.OrderByPipe }, { token: i7.SearchFilterPipe }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3607
- RuntimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RuntimeComponent, selector: "vl-runtime", outputs: { solutionUpdated: "solutionUpdated" }, providers: [FormScopeService, CollapsibleStateService, OrderByPipe, SearchFilterPipe], ngImport: i0, template: "<vl-loader label=\"Loading UI\" *ngIf=\"!solutionIsReady; else content\"></vl-loader>\n\n<ng-template #content>\n <div\n class=\"sidebar-tabs\"\n [ngClass]=\"{ hidden: !runtimeContext?.uiDefinition?.defaultPanels }\"\n #uiTabs=\"sidebarTabs\"\n sidebarTabs=\"{{ activeUITab?.id }}\"\n id=\"vl-default-sidebar-tabs\"\n >\n <ul>\n <li\n *ngFor=\"let tab of runtimeContext?.uiDefinition?.tabs | orderBy: 'order':'asc'\"\n [ngClass]=\"{ active: uiTabs.activeTab === tab.id }\"\n (click)=\"uiTabs.switchTab(tab.id)\"\n >\n <a href=\"javascript:void(0);\">{{ tab.name }}</a>\n </li>\n </ul>\n </div>\n\n <div class=\"sections-wrapper\">\n <form role=\"form\" name=\"form\" class=\"form-horizontal\" [formGroup]=\"form\" novalidate autocomplete=\"off\">\n <ng-container *ngFor=\"let section of staticSections; let i = index\">\n <ng-container *ngIf=\"section.model && section.template && !section.hidden\">\n <vl-section-renderer [section]=\"section\" [form]=\"form\"></vl-section-renderer>\n </ng-container>\n </ng-container>\n\n <ng-container *ngFor=\"let section of sortedSections; let i = index\">\n <ng-container *ngIf=\"section.model && section.template && !section.hidden\">\n <vl-section-renderer [section]=\"section\" [form]=\"form\"></vl-section-renderer>\n </ng-container>\n </ng-container>\n </form>\n\n <div\n class=\"modal-footer\"\n *ngIf=\"runtimeContext?.runtimeMode === 1\"\n id=\"vl-runtime-default-footer\"\n [ngClass]=\"{ hidden: !runtimeContext?.uiDefinition?.defaultPanels }\"\n >\n <div class=\"col-md-12 input-form-input\">\n <a href=\"javascript:void(0);\" class=\"btn btn-default\" (click)=\"form.valid && addToCart()\" id=\"add-to-cart-btn\"\n >Add to cart</a\n >\n <a href=\"javascript:void(0);\" class=\"btn btn-link\" (click)=\"hideModal()\" id=\"cancel-btn\">Cancel</a>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["body.veloce-apex-index,body.veloce-index,body.sfdcBody{overflow:hidden;margin:0;padding:0}:host ::ng-deep .velo-app .modal.in .modal-dialog.runtime-modal{margin-left:5%;margin-right:5%;padding:0;position:relative;width:auto}:host ::ng-deep .modal-body.runtime-modal.main-container{height:100%;margin:0;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .content-wrapper{display:flex;flex-direction:column;height:100%}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper{display:flex;flex-direction:column;flex-grow:1;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid{height:100%;margin:0;padding:0;overflow:auto}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal .form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid section-script>:first-child{height:100%}:host ::ng-deep .runtime-modal .modal-content,:host ::ng-deep .gu-mirror .modal-content{background-color:--vl-input-background}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a{color:#333333b3;font-weight:600;text-transform:uppercase;letter-spacing:.85px;font-size:10px}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active{color:#333}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.disabled,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.disabled{color:#33333380}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active:after,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active:after{background-color:#f36;bottom:-1px;content:\"\";height:1px;left:0;position:absolute;width:100%}:host ::ng-deep .runtime-modal .modal-content .modal-header,:host ::ng-deep .gu-mirror .modal-content .modal-header{background:transparent;color:#fff}:host ::ng-deep .runtime-modal .runtime-group-divider,:host ::ng-deep .gu-mirror .runtime-group-divider{border-bottom:1px solid #e5e5e5}:host ::ng-deep .runtime-modal .input-form-input,:host ::ng-deep .gu-mirror .input-form-input{position:relative;padding-left:0;padding-top:0}:host ::ng-deep .runtime-modal .input-form-input--required>label,:host ::ng-deep .gu-mirror .input-form-input--required>label{color:#ff4233;font-weight:700}:host ::ng-deep .form-control-wrapper{position:relative}:host ::ng-deep .add-config-control:hover{background-color:#e96099;color:#fff;border:1px solid transparent}:host ::ng-deep .remove-config-control:hover{background-color:#828c9e;color:#fff}:host ::ng-deep .add-config-control[disabled],:host ::ng-deep .remove-config-control[disabled]{background-color:transparent;color:#ccc;border:1px dashed #ccc}:host ::ng-deep .add-config-control[disabled]:hover,:host ::ng-deep .remove-config-control[disabled]:hover{cursor:default}:host ::ng-deep .add-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;border-radius:50%;float:left;position:absolute;top:0;right:-57px;z-index:500;background-color:#e3337c;color:#fff;border:1px solid #e3337c;transition:all .5s ease 0s}:host ::ng-deep .add-config-control .plus-icon{line-height:36px}:host ::ng-deep .remove-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;margin-right:25px;border-radius:50%;float:left;position:absolute;top:33px;right:51px;z-index:500;background-color:transparent;color:#687285;border:1px solid transparent;transition:all .5s ease 0s}:host ::ng-deep .remove-config-control .plus-icon{line-height:36px}:host ::ng-deep .sidebar .new-wrapper{min-height:96px;margin-bottom:25px}:host ::ng-deep .sidebar .new-wrapper .add-container .add-card{left:0;margin-left:15px}:host ::ng-deep .ui-settings{height:100%;display:flex;flex-direction:column}:host ::ng-deep .runtime-modal .form-horizontal form,:host ::ng-deep .gu-mirror form{margin:0}:host ::ng-deep .runtime-modal .form-horizontal .form-group,:host ::ng-deep .gu-mirror .form-group{margin:0;padding:0}:host ::ng-deep .runtime-modal .form-horizontal .control.form-group,:host ::ng-deep .gu-mirror .control.form-group{margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .form-control-wrapper,:host ::ng-deep .gu-mirror .form-control-wrapper{min-width:172px;margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper{min-width:50px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper .form-control,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper .form-control{width:50px}:host ::ng-deep .runtime-left-side{height:calc(100% - 97px);background:#fff;padding:48px 56px 0}:host ::ng-deep .ui-controls-group{margin-left:-8px;margin-right:-8px}:host ::ng-deep .ui-controls-group .ui-control-type:hover{border-color:#3384ff}:host ::ng-deep .ui-controls-group .ui-control-type{position:relative;min-width:140px;float:left;border-radius:3px;border:1px solid #c4c4c4;background-color:#fff;width:calc(50% - 16px);padding:12px 13px;margin-bottom:16px;margin-right:8px;margin-left:8px;cursor:pointer}:host ::ng-deep .ui-controls-group .ui-control-type span{padding-left:3px}:host ::ng-deep .sidebar-header{letter-spacing:-.5px;padding-bottom:24px;padding-top:0;line-height:32px;font-size:24px;font-weight:700;color:#333}:host ::ng-deep .sidebar-header small{display:block;color:#333;font-size:11px;font-weight:300;line-height:20px;margin:0}:host ::ng-deep .sidebar-menu-list{color:#333333b3;margin:0;width:100%;list-style:none;font-size:12px}:host ::ng-deep .sidebar-menu-list li.active a,:host ::ng-deep .sidebar-menu-list li.active i{color:#005ee3}:host ::ng-deep .sidebar-menu-list li:hover{cursor:pointer}:host ::ng-deep .sidebar-menu-list li{text-align:right;padding-left:16px}:host ::ng-deep .sidebar-menu-list li a{padding:0 8px;margin-left:-8px;cursor:pointer;white-space:nowrap;color:inherit;font-weight:700;display:inline-block;line-height:32px}:host ::ng-deep .sidebar-menu-list li i{display:none;padding-right:5px}:host ::ng-deep .runtime-builder-content{min-height:100%}:host ::ng-deep .runtime-builder-content .input-form{margin:0;padding:18px 11px 0}:host ::ng-deep .runtime-builder-content .input-form .form-group{border:3px dashed transparent}:host ::ng-deep .runtime-builder-content .input-form .form-group:hover{border:3px dashed #dedede}:host ::ng-deep .runtime-right-side{background:#fff}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background:#fff;position:relative;display:inline-block;padding-right:16px;text-transform:uppercase;font-size:10px;letter-spacing:.2px}:host ::ng-deep .sidebar-section:before{content:\" \";position:absolute;top:50%;left:0;right:0;border-top:1px solid #e6e6e6}:host ::ng-deep .sidebar-section{position:relative;margin-top:16px;margin-bottom:16px}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background-color:var(--vl-input-background);position:relative;display:inline-block;padding-right:16px;padding-left:8px;text-transform:uppercase;font-size:6px;letter-spacing:.2px}:host ::ng-deep .section-wrapper{top:-21px;position:absolute;right:0;left:12px}:host ::ng-deep .container-box.container-box-bordered{border:1px solid rgba(0,0,0,.2);margin-bottom:25px;padding-left:25px}:host ::ng-deep .container-box.container-box-radio{margin-left:0}:host ::ng-deep .container-box.container-box-radio:hover,:host ::ng-deep .container-box.container-box-checkbox:hover{cursor:pointer}:host ::ng-deep .container-box{position:relative;overflow:auto;border:1px solid transparent;background:var(--vl-input-background)}:host ::ng-deep .container-box .container-box{border:1px solid rgba(0,0,0,.2);margin-left:25px;margin-right:25px;margin-bottom:25px}:host ::ng-deep .container-box .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box .box-title .header .header-label{color:#333;margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-label small{padding-left:21px;color:#757575;font-weight:400;font-size:10px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-qty-container,:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{display:table-cell;vertical-align:middle;height:75px;padding-left:21px}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control,:host ::ng-deep .container-box .box-title .header .radio-button .form-control,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control{height:auto;color:#333;width:50px;border:1px solid #dddddd}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control:focus,:host ::ng-deep .container-box .box-title .header .radio-button .form-control:focus,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control:focus{border:1px solid #c4c4c4}:host ::ng-deep .container-box .box-title .header .header-qty-container .validation-message,:host ::ng-deep .container-box .box-title .header .radio-button .validation-message,:host ::ng-deep .container-box .box-title .header .checkbox-select .validation-message{position:absolute;margin-top:3px}:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{padding-left:0;vertical-align:middle}:host ::ng-deep .container-box .box-content{padding:25px 0 25px 33px}:host ::ng-deep .container-box .timeline-item{clear:both;display:block;width:100%;position:relative}:host ::ng-deep .container-box .timeline-item:before{display:block!important;content:\"\";position:absolute;left:25px;top:-25px;bottom:25px;width:1px;border-left:1px dashed rgba(0,0,0,.2)}:host ::ng-deep .container-box .timeline-item .icon{background:#90c7ec;width:35px;height:35px;border-radius:50%;position:absolute;left:24px;top:4px}:host ::ng-deep .container-box .timeline-item .icon .fa.fa-upload{left:11px;top:10px}:host ::ng-deep .container-box .timeline-item .icon .fa{color:#fff;position:absolute}:host ::ng-deep .container-box .timeline-item .message .content{float:left;width:80%}:host ::ng-deep .container-box .container-group-control{background:transparent;text-transform:uppercase}:host ::ng-deep .container-box-custom{margin-bottom:25px}:host ::ng-deep .unchecked .container-box{border-color:#0003}:host ::ng-deep .unchecked .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .unchecked.timeline-item .icon-circle{background-color:#6e6e6e}:host ::ng-deep .collapsed .box-content-wrapper{opacity:0;display:none;transition:max-height .3s .1s}:host ::ng-deep .box-content-wrapper{transition:opacity .5s .1s;display:block;opacity:1}:host ::ng-deep .box-actions{position:absolute;right:25px;z-index:2;top:21px;opacity:1;transition:height .3s ease-out,opacity .5s .1s}:host ::ng-deep .box-action-button{height:32px;width:32px;line-height:32px;font-size:12px;text-align:center;float:left;margin-left:5px;border-radius:50%;transition:all .25s ease 0s}:host ::ng-deep .box-action-button a{color:#0000008a}:host ::ng-deep .box-action-button .check-icon{line-height:32px}:host ::ng-deep .box-actions-group{top:18px;right:45px}:host ::ng-deep .box-action-button:hover,:host ::ng-deep .box-action-button:focus{background-color:#0000001a;cursor:pointer;outline:none}:host ::ng-deep .box-action-button:active{background-color:#0003;cursor:pointer}:host ::ng-deep .box-action-button.active{background-color:#0000001a}:host ::ng-deep .div-block{clear:both;display:block}:host ::ng-deep .div-inline{float:left}:host ::ng-deep .checkbox-select{position:relative;display:block}:host ::ng-deep .checkbox-select label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .checkbox-select input[type=checkbox]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .checkbox-select .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:2px;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .checkbox-select .input-helper:after{font-weight:100;line-height:12px;font-size:10px;color:#fff;font-family:FontAwesome;position:absolute;content:\"\\f00c\";width:12px;height:12px;background:#0065ff;border-radius:0;top:1px;left:2px;transform:scale(0);transition:all;transition-duration:.15s}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:before,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:after,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button{position:relative;display:block}:host ::ng-deep .radio-button label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .radio-button input[type=radio]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .radio-button .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:50%;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button .input-helper:after{position:absolute;content:\"\";width:6px;height:6px;background:var(--vl-primary-color);border-radius:50%;top:4px;left:5px;transform:scale(0);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .form-control-wrapper .checkbox-select,:host ::ng-deep .form-control-wrapper .radio-button{padding-top:10px}:host ::ng-deep .shopping-bag-sidebar.open{transform:translate3d(-100%,0,0)}:host ::ng-deep .shopping-bag-sidebar{position:fixed;top:0;bottom:0;z-index:1051;width:420px;right:-420px;background-color:#2a2b30;transition:.3s transform}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart{color:#abacae;position:absolute;top:20%;width:50px;height:50px;line-height:50px;text-align:center;right:100%;left:auto;background:#2a2b30;border-radius:3px 0 0 3px;display:block}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:before{font-family:FontAwesome;content:\"\\f291\"}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:hover{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:active,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:focus,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:visited{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .cart-count{font-size:9px;font-weight:700;line-height:15px;position:absolute;top:50%;right:8px;width:15px;height:15px;margin:-16px 0 0;text-align:center;color:#fff;border-radius:50%;background:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-container{overflow:auto;display:block;height:100%;padding:0 25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item{color:#abacae;background-color:#000;position:relative;overflow:auto;margin-bottom:10px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title{position:relative;padding-right:25px;padding-left:25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .header{float:left;color:#abacae;margin:0;line-height:48px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-actions{height:48px;float:right;top:0}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-action-button{height:32px;width:32px;line-height:32px;font-size:10px;font-weight:700;margin-top:8px;text-align:center;transition:all .25s ease 0s;color:#fff;background-color:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-title{color:#cecece;font-size:11px;text-transform:uppercase;line-height:64px;font-weight:600;padding-top:0;margin-top:25px;margin-bottom:25px;text-align:right}:host ::ng-deep .container-box.hovered:before,:host ::ng-deep .box-title.hovered:before,:host ::ng-deep .container-box.selected:before,:host ::ng-deep .box-title.selected:before{inset:0}:host ::ng-deep .selectable{position:relative;cursor:pointer}:host ::ng-deep .container-box.hovered:before{border-color:transparent}:host ::ng-deep .container-box.hovered{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box.selected:before{border-color:transparent}:host ::ng-deep .container-box.selected{border-color:var(--vl-primary-color)}:host ::ng-deep .hovered:before{display:block!important;position:absolute;content:\" \";inset:-15px 15px 15px -15px;border:1px solid var(--vl-primary-color)}:host ::ng-deep .hovered .box-action-button{opacity:1!important}:host ::ng-deep .opacity-1{opacity:1!important}:host ::ng-deep .overflow-y--auto{overflow-y:auto}:host ::ng-deep .gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80)}:host ::ng-deep .gu-hide{display:none!important}:host ::ng-deep .gu-unselectable{-webkit-user-select:none!important;user-select:none!important}:host ::ng-deep .gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}:host ::ng-deep .top-nav-msg{margin-top:-30px}:host ::ng-deep .runtime-info-message ul{margin-bottom:0;list-style:none}:host ::ng-deep .runtime-info-message ul li{margin-bottom:10px}:host ::ng-deep .runtime-info-message ul li:last-child{margin-bottom:0}:host ::ng-deep .runtime-info-message .message-text{font-family:Open Sans,Tahoma,sans-serif!important;overflow:hidden;padding:0;font-size:11px}:host ::ng-deep .runtime-attributes-popover .popover-arrow{display:none}:host ::ng-deep .runtime-attributes-popover .popover-content{padding:0}:host ::ng-deep .runtime-attributes-popover .runtime-content-wrapper{padding:0}:host ::ng-deep .runtime-attributes-popover .container-box-custom{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form{margin:0;padding:0}:host ::ng-deep .runtime-attributes-popover .input-form form{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form form .div-inline{display:block;float:none}:host ::ng-deep .runtime-attributes-popover .input-form form .form-group{padding:0;margin:0}:host ::ng-deep .runtime-attributes-popover .container-box .box-content{padding:0}:host ::ng-deep .v-custom-title,:host ::ng-deep .v-custom-description,:host ::ng-deep .v-custom-image{display:none}:host ::ng-deep .dropdown{position:relative}:host ::ng-deep .dropdown-toggle:focus{outline:0}:host ::ng-deep .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d}:host ::ng-deep .dropdown-menu.pull-right{right:0;left:auto}:host ::ng-deep .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}:host ::ng-deep .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}:host ::ng-deep .dropdown-menu>li>a:hover,:host ::ng-deep .dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}:host ::ng-deep .dropdown-menu>.active>a,:host ::ng-deep .dropdown-menu>.active>a:hover,:host ::ng-deep .dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}:host ::ng-deep .dropdown-menu>.disabled>a,:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{color:#777}:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}:host ::ng-deep .open>.dropdown-menu{display:block}:host ::ng-deep .open>a{outline:0}:host ::ng-deep .dropdown-menu-right{right:0;left:auto}:host ::ng-deep .dropdown-menu-left{right:auto;left:0}:host ::ng-deep .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}:host ::ng-deep .dropdown-backdrop{position:fixed;inset:0;z-index:990}\n", ":host{height:100%;display:flex;flex-direction:column}.sections-wrapper,form{flex-grow:1;display:flex;flex-direction:column}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i3$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i7.SidebarTabsDirective, selector: "[sidebarTabs]", inputs: ["sidebarTabs"], exportAs: ["sidebarTabs"] }, { kind: "component", type: i10.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: SectionRendererComponent, selector: "vl-section-renderer", inputs: ["section", "form"] }, { kind: "pipe", type: i7.OrderByPipe, name: "orderBy" }] });
3608
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeComponent, decorators: [{
3609
- type: Component,
3610
- args: [{ selector: 'vl-runtime', providers: [FormScopeService, CollapsibleStateService, OrderByPipe, SearchFilterPipe], template: "<vl-loader label=\"Loading UI\" *ngIf=\"!solutionIsReady; else content\"></vl-loader>\n\n<ng-template #content>\n <div\n class=\"sidebar-tabs\"\n [ngClass]=\"{ hidden: !runtimeContext?.uiDefinition?.defaultPanels }\"\n #uiTabs=\"sidebarTabs\"\n sidebarTabs=\"{{ activeUITab?.id }}\"\n id=\"vl-default-sidebar-tabs\"\n >\n <ul>\n <li\n *ngFor=\"let tab of runtimeContext?.uiDefinition?.tabs | orderBy: 'order':'asc'\"\n [ngClass]=\"{ active: uiTabs.activeTab === tab.id }\"\n (click)=\"uiTabs.switchTab(tab.id)\"\n >\n <a href=\"javascript:void(0);\">{{ tab.name }}</a>\n </li>\n </ul>\n </div>\n\n <div class=\"sections-wrapper\">\n <form role=\"form\" name=\"form\" class=\"form-horizontal\" [formGroup]=\"form\" novalidate autocomplete=\"off\">\n <ng-container *ngFor=\"let section of staticSections; let i = index\">\n <ng-container *ngIf=\"section.model && section.template && !section.hidden\">\n <vl-section-renderer [section]=\"section\" [form]=\"form\"></vl-section-renderer>\n </ng-container>\n </ng-container>\n\n <ng-container *ngFor=\"let section of sortedSections; let i = index\">\n <ng-container *ngIf=\"section.model && section.template && !section.hidden\">\n <vl-section-renderer [section]=\"section\" [form]=\"form\"></vl-section-renderer>\n </ng-container>\n </ng-container>\n </form>\n\n <div\n class=\"modal-footer\"\n *ngIf=\"runtimeContext?.runtimeMode === 1\"\n id=\"vl-runtime-default-footer\"\n [ngClass]=\"{ hidden: !runtimeContext?.uiDefinition?.defaultPanels }\"\n >\n <div class=\"col-md-12 input-form-input\">\n <a href=\"javascript:void(0);\" class=\"btn btn-default\" (click)=\"form.valid && addToCart()\" id=\"add-to-cart-btn\"\n >Add to cart</a\n >\n <a href=\"javascript:void(0);\" class=\"btn btn-link\" (click)=\"hideModal()\" id=\"cancel-btn\">Cancel</a>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["body.veloce-apex-index,body.veloce-index,body.sfdcBody{overflow:hidden;margin:0;padding:0}:host ::ng-deep .velo-app .modal.in .modal-dialog.runtime-modal{margin-left:5%;margin-right:5%;padding:0;position:relative;width:auto}:host ::ng-deep .modal-body.runtime-modal.main-container{height:100%;margin:0;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .content-wrapper{display:flex;flex-direction:column;height:100%}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper{display:flex;flex-direction:column;flex-grow:1;padding:0}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid{height:100%;margin:0;padding:0;overflow:auto}:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid .input-form.form-horizontal .form-horizontal,:host ::ng-deep .modal-body.runtime-modal.main-container .sections-wrapper .modal-body.runtime-modal.container-fluid section-script>:first-child{height:100%}:host ::ng-deep .runtime-modal .modal-content,:host ::ng-deep .gu-mirror .modal-content{background-color:--vl-input-background}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a{color:#333333b3;font-weight:600;text-transform:uppercase;letter-spacing:.85px;font-size:10px}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active{color:#333}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.disabled,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.disabled{color:#33333380}:host ::ng-deep .runtime-modal .modal-content .modal-header-menu ul li a.active:after,:host ::ng-deep .gu-mirror .modal-content .modal-header-menu ul li a.active:after{background-color:#f36;bottom:-1px;content:\"\";height:1px;left:0;position:absolute;width:100%}:host ::ng-deep .runtime-modal .modal-content .modal-header,:host ::ng-deep .gu-mirror .modal-content .modal-header{background:transparent;color:#fff}:host ::ng-deep .runtime-modal .runtime-group-divider,:host ::ng-deep .gu-mirror .runtime-group-divider{border-bottom:1px solid #e5e5e5}:host ::ng-deep .runtime-modal .input-form-input,:host ::ng-deep .gu-mirror .input-form-input{position:relative;padding-left:0;padding-top:0}:host ::ng-deep .runtime-modal .input-form-input--required>label,:host ::ng-deep .gu-mirror .input-form-input--required>label{color:#ff4233;font-weight:700}:host ::ng-deep .form-control-wrapper{position:relative}:host ::ng-deep .add-config-control:hover{background-color:#e96099;color:#fff;border:1px solid transparent}:host ::ng-deep .remove-config-control:hover{background-color:#828c9e;color:#fff}:host ::ng-deep .add-config-control[disabled],:host ::ng-deep .remove-config-control[disabled]{background-color:transparent;color:#ccc;border:1px dashed #ccc}:host ::ng-deep .add-config-control[disabled]:hover,:host ::ng-deep .remove-config-control[disabled]:hover{cursor:default}:host ::ng-deep .add-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;border-radius:50%;float:left;position:absolute;top:0;right:-57px;z-index:500;background-color:#e3337c;color:#fff;border:1px solid #e3337c;transition:all .5s ease 0s}:host ::ng-deep .add-config-control .plus-icon{line-height:36px}:host ::ng-deep .remove-config-control{height:36px;width:36px;line-height:36px;font-size:14px;text-align:center;margin-right:25px;border-radius:50%;float:left;position:absolute;top:33px;right:51px;z-index:500;background-color:transparent;color:#687285;border:1px solid transparent;transition:all .5s ease 0s}:host ::ng-deep .remove-config-control .plus-icon{line-height:36px}:host ::ng-deep .sidebar .new-wrapper{min-height:96px;margin-bottom:25px}:host ::ng-deep .sidebar .new-wrapper .add-container .add-card{left:0;margin-left:15px}:host ::ng-deep .ui-settings{height:100%;display:flex;flex-direction:column}:host ::ng-deep .runtime-modal .form-horizontal form,:host ::ng-deep .gu-mirror form{margin:0}:host ::ng-deep .runtime-modal .form-horizontal .form-group,:host ::ng-deep .gu-mirror .form-group{margin:0;padding:0}:host ::ng-deep .runtime-modal .form-horizontal .control.form-group,:host ::ng-deep .gu-mirror .control.form-group{margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .form-control-wrapper,:host ::ng-deep .gu-mirror .form-control-wrapper{min-width:172px;margin-bottom:25px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper{min-width:50px}:host ::ng-deep .runtime-modal .form-horizontal .quantity-form-input .form-control-wrapper .form-control,:host ::ng-deep .gu-mirror .quantity-form-input .form-control-wrapper .form-control{width:50px}:host ::ng-deep .runtime-left-side{height:calc(100% - 97px);background:#fff;padding:48px 56px 0}:host ::ng-deep .ui-controls-group{margin-left:-8px;margin-right:-8px}:host ::ng-deep .ui-controls-group .ui-control-type:hover{border-color:#3384ff}:host ::ng-deep .ui-controls-group .ui-control-type{position:relative;min-width:140px;float:left;border-radius:3px;border:1px solid #c4c4c4;background-color:#fff;width:calc(50% - 16px);padding:12px 13px;margin-bottom:16px;margin-right:8px;margin-left:8px;cursor:pointer}:host ::ng-deep .ui-controls-group .ui-control-type span{padding-left:3px}:host ::ng-deep .sidebar-header{letter-spacing:-.5px;padding-bottom:24px;padding-top:0;line-height:32px;font-size:24px;font-weight:700;color:#333}:host ::ng-deep .sidebar-header small{display:block;color:#333;font-size:11px;font-weight:300;line-height:20px;margin:0}:host ::ng-deep .sidebar-menu-list{color:#333333b3;margin:0;width:100%;list-style:none;font-size:12px}:host ::ng-deep .sidebar-menu-list li.active a,:host ::ng-deep .sidebar-menu-list li.active i{color:#005ee3}:host ::ng-deep .sidebar-menu-list li:hover{cursor:pointer}:host ::ng-deep .sidebar-menu-list li{text-align:right;padding-left:16px}:host ::ng-deep .sidebar-menu-list li a{padding:0 8px;margin-left:-8px;cursor:pointer;white-space:nowrap;color:inherit;font-weight:700;display:inline-block;line-height:32px}:host ::ng-deep .sidebar-menu-list li i{display:none;padding-right:5px}:host ::ng-deep .runtime-builder-content{min-height:100%}:host ::ng-deep .runtime-builder-content .input-form{margin:0;padding:18px 11px 0}:host ::ng-deep .runtime-builder-content .input-form .form-group{border:3px dashed transparent}:host ::ng-deep .runtime-builder-content .input-form .form-group:hover{border:3px dashed #dedede}:host ::ng-deep .runtime-right-side{background:#fff}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background:#fff;position:relative;display:inline-block;padding-right:16px;text-transform:uppercase;font-size:10px;letter-spacing:.2px}:host ::ng-deep .sidebar-section:before{content:\" \";position:absolute;top:50%;left:0;right:0;border-top:1px solid #e6e6e6}:host ::ng-deep .sidebar-section{position:relative;margin-top:16px;margin-bottom:16px}:host ::ng-deep .sidebar-section .section-title{color:#a1a1a1;background-color:var(--vl-input-background);position:relative;display:inline-block;padding-right:16px;padding-left:8px;text-transform:uppercase;font-size:6px;letter-spacing:.2px}:host ::ng-deep .section-wrapper{top:-21px;position:absolute;right:0;left:12px}:host ::ng-deep .container-box.container-box-bordered{border:1px solid rgba(0,0,0,.2);margin-bottom:25px;padding-left:25px}:host ::ng-deep .container-box.container-box-radio{margin-left:0}:host ::ng-deep .container-box.container-box-radio:hover,:host ::ng-deep .container-box.container-box-checkbox:hover{cursor:pointer}:host ::ng-deep .container-box{position:relative;overflow:auto;border:1px solid transparent;background:var(--vl-input-background)}:host ::ng-deep .container-box .container-box{border:1px solid rgba(0,0,0,.2);margin-left:25px;margin-right:25px;margin-bottom:25px}:host ::ng-deep .container-box .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box .box-title .header .header-label{color:#333;margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-label small{padding-left:21px;color:#757575;font-weight:400;font-size:10px;line-height:75px}:host ::ng-deep .container-box .box-title .header .header-qty-container,:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{display:table-cell;vertical-align:middle;height:75px;padding-left:21px}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control,:host ::ng-deep .container-box .box-title .header .radio-button .form-control,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control{height:auto;color:#333;width:50px;border:1px solid #dddddd}:host ::ng-deep .container-box .box-title .header .header-qty-container .form-control:focus,:host ::ng-deep .container-box .box-title .header .radio-button .form-control:focus,:host ::ng-deep .container-box .box-title .header .checkbox-select .form-control:focus{border:1px solid #c4c4c4}:host ::ng-deep .container-box .box-title .header .header-qty-container .validation-message,:host ::ng-deep .container-box .box-title .header .radio-button .validation-message,:host ::ng-deep .container-box .box-title .header .checkbox-select .validation-message{position:absolute;margin-top:3px}:host ::ng-deep .container-box .box-title .header .radio-button,:host ::ng-deep .container-box .box-title .header .checkbox-select{padding-left:0;vertical-align:middle}:host ::ng-deep .container-box .box-content{padding:25px 0 25px 33px}:host ::ng-deep .container-box .timeline-item{clear:both;display:block;width:100%;position:relative}:host ::ng-deep .container-box .timeline-item:before{display:block!important;content:\"\";position:absolute;left:25px;top:-25px;bottom:25px;width:1px;border-left:1px dashed rgba(0,0,0,.2)}:host ::ng-deep .container-box .timeline-item .icon{background:#90c7ec;width:35px;height:35px;border-radius:50%;position:absolute;left:24px;top:4px}:host ::ng-deep .container-box .timeline-item .icon .fa.fa-upload{left:11px;top:10px}:host ::ng-deep .container-box .timeline-item .icon .fa{color:#fff;position:absolute}:host ::ng-deep .container-box .timeline-item .message .content{float:left;width:80%}:host ::ng-deep .container-box .container-group-control{background:transparent;text-transform:uppercase}:host ::ng-deep .container-box-custom{margin-bottom:25px}:host ::ng-deep .unchecked .container-box{border-color:#0003}:host ::ng-deep .unchecked .container-box:hover{border-color:var(--vl-primary-color)}:host ::ng-deep .unchecked.timeline-item .icon-circle{background-color:#6e6e6e}:host ::ng-deep .collapsed .box-content-wrapper{opacity:0;display:none;transition:max-height .3s .1s}:host ::ng-deep .box-content-wrapper{transition:opacity .5s .1s;display:block;opacity:1}:host ::ng-deep .box-actions{position:absolute;right:25px;z-index:2;top:21px;opacity:1;transition:height .3s ease-out,opacity .5s .1s}:host ::ng-deep .box-action-button{height:32px;width:32px;line-height:32px;font-size:12px;text-align:center;float:left;margin-left:5px;border-radius:50%;transition:all .25s ease 0s}:host ::ng-deep .box-action-button a{color:#0000008a}:host ::ng-deep .box-action-button .check-icon{line-height:32px}:host ::ng-deep .box-actions-group{top:18px;right:45px}:host ::ng-deep .box-action-button:hover,:host ::ng-deep .box-action-button:focus{background-color:#0000001a;cursor:pointer;outline:none}:host ::ng-deep .box-action-button:active{background-color:#0003;cursor:pointer}:host ::ng-deep .box-action-button.active{background-color:#0000001a}:host ::ng-deep .div-block{clear:both;display:block}:host ::ng-deep .div-inline{float:left}:host ::ng-deep .checkbox-select{position:relative;display:block}:host ::ng-deep .checkbox-select label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .checkbox-select input[type=checkbox]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .checkbox-select .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:2px;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .checkbox-select .input-helper:after{font-weight:100;line-height:12px;font-size:10px;color:#fff;font-family:FontAwesome;position:absolute;content:\"\\f00c\";width:12px;height:12px;background:#0065ff;border-radius:0;top:1px;left:2px;transform:scale(0);transition:all;transition-duration:.15s}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:before,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .checkbox-select input[type=checkbox]:checked+.input-helper:after,:host ::ng-deep .checkbox-select input[type=checkbox].checkbox--checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button{position:relative;display:block}:host ::ng-deep .radio-button label{color:#333;margin:0;line-height:16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px;padding-left:25px;position:relative;min-height:16px;cursor:pointer}:host ::ng-deep .radio-button input[type=radio]{position:absolute;width:16px;height:16px;top:0;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);margin:0;line-height:normal}:host ::ng-deep .radio-button .input-helper:before{position:absolute;content:\"\";top:-1px;width:12px;height:12px;border-radius:50%;left:0;border:2px solid rgba(0,0,0,.54);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button .input-helper:after{position:absolute;content:\"\";width:6px;height:6px;background:var(--vl-primary-color);border-radius:50%;top:4px;left:5px;transform:scale(0);transition:all;transition-duration:.25s}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:before{border-color:var(--vl-primary-color)}:host ::ng-deep .radio-button input[type=radio]:checked+.input-helper:after{transform:scale(1)}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:before,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:before{border-color:#0003}:host ::ng-deep .radio-button[disabled] input[type=radio]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=radio]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .radio-button[disabled] input[type=checkbox]+.input-helper:after,:host ::ng-deep .checkbox-select[disabled] input[type=checkbox]+.input-helper:after{background:rgba(0,0,0,.2)}:host ::ng-deep .form-control-wrapper .checkbox-select,:host ::ng-deep .form-control-wrapper .radio-button{padding-top:10px}:host ::ng-deep .shopping-bag-sidebar.open{transform:translate3d(-100%,0,0)}:host ::ng-deep .shopping-bag-sidebar{position:fixed;top:0;bottom:0;z-index:1051;width:420px;right:-420px;background-color:#2a2b30;transition:.3s transform}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart{color:#abacae;position:absolute;top:20%;width:50px;height:50px;line-height:50px;text-align:center;right:100%;left:auto;background:#2a2b30;border-radius:3px 0 0 3px;display:block}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:before{font-family:FontAwesome;content:\"\\f291\"}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:hover{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:active,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:focus,:host ::ng-deep .shopping-bag-sidebar .close-shopping-cart:visited{text-decoration:none;color:#abacae}:host ::ng-deep .shopping-bag-sidebar .cart-count{font-size:9px;font-weight:700;line-height:15px;position:absolute;top:50%;right:8px;width:15px;height:15px;margin:-16px 0 0;text-align:center;color:#fff;border-radius:50%;background:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-container{overflow:auto;display:block;height:100%;padding:0 25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item{color:#abacae;background-color:#000;position:relative;overflow:auto;margin-bottom:10px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title{position:relative;padding-right:25px;padding-left:25px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .header{float:left;color:#abacae;margin:0;line-height:48px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.2px}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-actions{height:48px;float:right;top:0}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-item .item-title .box-action-button{height:32px;width:32px;line-height:32px;font-size:10px;font-weight:700;margin-top:8px;text-align:center;transition:all .25s ease 0s;color:#fff;background-color:var(--vl-primary-color)}:host ::ng-deep .shopping-bag-sidebar .shopping-bag-title{color:#cecece;font-size:11px;text-transform:uppercase;line-height:64px;font-weight:600;padding-top:0;margin-top:25px;margin-bottom:25px;text-align:right}:host ::ng-deep .container-box.hovered:before,:host ::ng-deep .box-title.hovered:before,:host ::ng-deep .container-box.selected:before,:host ::ng-deep .box-title.selected:before{inset:0}:host ::ng-deep .selectable{position:relative;cursor:pointer}:host ::ng-deep .container-box.hovered:before{border-color:transparent}:host ::ng-deep .container-box.hovered{border-color:var(--vl-primary-color)}:host ::ng-deep .container-box.selected:before{border-color:transparent}:host ::ng-deep .container-box.selected{border-color:var(--vl-primary-color)}:host ::ng-deep .hovered:before{display:block!important;position:absolute;content:\" \";inset:-15px 15px 15px -15px;border:1px solid var(--vl-primary-color)}:host ::ng-deep .hovered .box-action-button{opacity:1!important}:host ::ng-deep .opacity-1{opacity:1!important}:host ::ng-deep .overflow-y--auto{overflow-y:auto}:host ::ng-deep .gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80)}:host ::ng-deep .gu-hide{display:none!important}:host ::ng-deep .gu-unselectable{-webkit-user-select:none!important;user-select:none!important}:host ::ng-deep .gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}:host ::ng-deep .top-nav-msg{margin-top:-30px}:host ::ng-deep .runtime-info-message ul{margin-bottom:0;list-style:none}:host ::ng-deep .runtime-info-message ul li{margin-bottom:10px}:host ::ng-deep .runtime-info-message ul li:last-child{margin-bottom:0}:host ::ng-deep .runtime-info-message .message-text{font-family:Open Sans,Tahoma,sans-serif!important;overflow:hidden;padding:0;font-size:11px}:host ::ng-deep .runtime-attributes-popover .popover-arrow{display:none}:host ::ng-deep .runtime-attributes-popover .popover-content{padding:0}:host ::ng-deep .runtime-attributes-popover .runtime-content-wrapper{padding:0}:host ::ng-deep .runtime-attributes-popover .container-box-custom{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form{margin:0;padding:0}:host ::ng-deep .runtime-attributes-popover .input-form form{margin-bottom:0}:host ::ng-deep .runtime-attributes-popover .input-form form .div-inline{display:block;float:none}:host ::ng-deep .runtime-attributes-popover .input-form form .form-group{padding:0;margin:0}:host ::ng-deep .runtime-attributes-popover .container-box .box-content{padding:0}:host ::ng-deep .v-custom-title,:host ::ng-deep .v-custom-description,:host ::ng-deep .v-custom-image{display:none}:host ::ng-deep .dropdown{position:relative}:host ::ng-deep .dropdown-toggle:focus{outline:0}:host ::ng-deep .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d}:host ::ng-deep .dropdown-menu.pull-right{right:0;left:auto}:host ::ng-deep .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}:host ::ng-deep .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}:host ::ng-deep .dropdown-menu>li>a:hover,:host ::ng-deep .dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}:host ::ng-deep .dropdown-menu>.active>a,:host ::ng-deep .dropdown-menu>.active>a:hover,:host ::ng-deep .dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}:host ::ng-deep .dropdown-menu>.disabled>a,:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{color:#777}:host ::ng-deep .dropdown-menu>.disabled>a:hover,:host ::ng-deep .dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}:host ::ng-deep .open>.dropdown-menu{display:block}:host ::ng-deep .open>a{outline:0}:host ::ng-deep .dropdown-menu-right{right:0;left:auto}:host ::ng-deep .dropdown-menu-left{right:auto;left:0}:host ::ng-deep .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}:host ::ng-deep .dropdown-backdrop{position:fixed;inset:0;z-index:990}\n", ":host{height:100%;display:flex;flex-direction:column}.sections-wrapper,form{flex-grow:1;display:flex;flex-direction:column}.hidden{display:none}\n"] }]
3611
- }], ctorParameters: function () {
3612
- return [{ type: SectionsService }, { type: FormScopeService }, { type: CollapsibleStateService }, { type: RuntimeFormService }, { type: RuntimeService }, { type: i3$1.MessageService, decorators: [{
3613
- type: Inject,
3614
- args: [MessageService]
3615
- }] }, { type: i2.ContextService }, { type: i7.OrderByPipe }, { type: i7.SearchFilterPipe }, { type: i0.ChangeDetectorRef }];
3616
- }, propDecorators: { solutionUpdated: [{
3617
- type: Output
3618
- }] } });
3619
-
3620
- class RuntimePreviewComponent {
3621
- set uiDefinition(value) {
3622
- this._uiDefinition = value;
3623
- this.initDefinition(value);
3624
- }
3625
- constructor(runtimeService, modelCacheService, configurationApiService, contextService) {
3626
- this.runtimeService = runtimeService;
3627
- this.modelCacheService = modelCacheService;
3628
- this.configurationApiService = configurationApiService;
3629
- this.contextService = contextService;
3630
- this.destroy$ = new Subject();
3631
- }
3632
- ngOnInit() {
3633
- if (!this.modelId) {
3634
- return;
3635
- }
3636
- this.modelCacheService
3637
- .getProductModel(this.modelId)
3638
- .pipe(takeUntil(this.destroy$))
3639
- .subscribe(container => {
3640
- this.productModelContainer = container;
3641
- if (this._uiDefinition) {
3642
- this.initDefinition(this._uiDefinition);
3643
- }
3644
- });
3645
- }
3646
- ngOnDestroy() {
3647
- this.destroy$.next();
3648
- this.destroy$.complete();
3649
- }
3650
- initDefinition(uiDefinition) {
3651
- if (!this.productModelContainer) {
3652
- return;
3653
- }
3654
- const initialisedUiDefinition = EntityUtil.clone(uiDefinition);
3655
- const externals = this.productModelContainer.main.externals;
3656
- if (externals) {
3657
- initialisedUiDefinition.externals = externals.reduce((trunk, variable) => {
3658
- var _a, _b;
3659
- return Object.assign(Object.assign({}, trunk), { [variable.name]: (_b = (_a = initialisedUiDefinition.externals) === null || _a === void 0 ? void 0 : _a[variable.name]) !== null && _b !== void 0 ? _b : '' });
3660
- }, {});
3661
- }
3662
- else {
3663
- delete initialisedUiDefinition.externals;
3664
- }
3665
- this.initialisedUiDefinition = initialisedUiDefinition;
3666
- this.launchRuntime();
3667
- }
3668
- onSolutionUpdated(lineItem) {
3669
- this.runtimeService.updateRuntime({ configurableRamp: lineItem });
3670
- }
3671
- launchRuntime() {
3672
- if (!this.modelId || !this.initialisedUiDefinition) {
3673
- return;
3674
- }
3675
- SectionPathUtil.updateSectionsPath(this.initialisedUiDefinition.sections);
3676
- const uiDefinition = EntityUtil.clone(this.initialisedUiDefinition);
3677
- combineLatest([
3678
- this.configurationApiService.getRuntimeDataByModelId(this.modelId),
3679
- this.contextService.create('TestId', ConfigurationContextMode.TEST),
3680
- ]).subscribe(([runtimeData]) => {
3681
- var _a;
3682
- const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
3683
- const rootType = Array.from(runtimeModel.components.values()).find(c => uiDefinition.rootType &&
3684
- runtimeModel.isEquals(c.typeName, uiDefinition.rootType) &&
3685
- EntityUtil.isPresent(c.productId));
3686
- if (rootType === null || rootType === void 0 ? void 0 : rootType.typeName) {
3687
- uiDefinition.rootType = rootType.typeName;
3688
- }
3689
- const contextProductId = rootType ? rootType.productId : undefined;
3690
- const context = {
3691
- modelId: (_a = this.modelId) !== null && _a !== void 0 ? _a : '',
3692
- uiDefinition: uiDefinition,
3693
- runtimeModel,
3694
- runtimeMode: RuntimeMode.TEST,
3695
- productId: contextProductId,
3696
- properties: uiDefinition.externals,
3697
- };
3698
- this.runtimeService.startRuntime(context, {});
3699
- });
3700
- }
3701
- }
3702
- RuntimePreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimePreviewComponent, deps: [{ token: RuntimeService }, { token: ProductModelCacheService }, { token: i1.ConfigurationApiService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Component });
3703
- RuntimePreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RuntimePreviewComponent, selector: "vl-runtime-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition" }, ngImport: i0, template: "<vl-runtime (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: RuntimeComponent, selector: "vl-runtime", outputs: ["solutionUpdated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimePreviewComponent, decorators: [{
3705
- type: Component,
3706
- args: [{ selector: 'vl-runtime-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-runtime (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{flex-grow:1}\n"] }]
3707
- }], ctorParameters: function () { return [{ type: RuntimeService }, { type: ProductModelCacheService }, { type: i1.ConfigurationApiService }, { type: i2.ContextService }]; }, propDecorators: { modelId: [{
3708
- type: Input
3709
- }], uiDefinition: [{
3710
- type: Input
3711
- }] } });
3712
-
3713
- class RuntimeModule {
3714
- }
3715
- RuntimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3716
- RuntimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: RuntimeModule, declarations: [RuntimeComponent, RuntimePreviewComponent, SectionRendererComponent, ComponentPreviewComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule], exports: [FormsModule,
3717
- ReactiveFormsModule,
3718
- RuntimeComponent,
3719
- RuntimePreviewComponent,
3720
- SectionRendererComponent,
3721
- ComponentPreviewComponent] });
3722
- RuntimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeModule, providers: [
3723
- ShoppingCartService,
3724
- RuntimeService,
3725
- ConfigurationService,
3726
- RuntimeContextService,
3727
- RuntimeFormService,
3728
- CurrentStateService,
3729
- ProductModelCacheService,
3730
- DatePipe,
3731
- SectionsService,
3732
- SectionStoreService,
3733
- DialogService,
3734
- ], imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule, FormsModule,
3735
- ReactiveFormsModule] });
3736
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeModule, decorators: [{
3737
- type: NgModule,
3738
- args: [{
3739
- declarations: [RuntimeComponent, RuntimePreviewComponent, SectionRendererComponent, ComponentPreviewComponent],
3740
- providers: [
3741
- ShoppingCartService,
3742
- RuntimeService,
3743
- ConfigurationService,
3744
- RuntimeContextService,
3745
- RuntimeFormService,
3746
- CurrentStateService,
3747
- ProductModelCacheService,
3748
- DatePipe,
3749
- SectionsService,
3750
- SectionStoreService,
3751
- DialogService,
3752
- ],
3753
- imports: [CommonModule, FormsModule, ReactiveFormsModule, CoreModule, ApiModule, LoaderModule, SdkCoreModule],
3754
- exports: [
3755
- FormsModule,
3756
- ReactiveFormsModule,
3757
- RuntimeComponent,
3758
- RuntimePreviewComponent,
3759
- SectionRendererComponent,
3760
- ComponentPreviewComponent,
3761
- ],
3762
- }]
3763
- }] });
3764
-
3765
- /**
3766
- * Generated bundle index. Do not edit.
3767
- */
3768
-
3769
- export { ComponentPreviewComponent, CurrentStateService, RuntimeComponent, RuntimeContextService, RuntimeModule, RuntimePreviewComponent, RuntimeService, SectionRendererComponent };
3770
- //# sourceMappingURL=veloceapps-sdk-runtime.mjs.map