@veloceapps/sdk 8.0.0-77 → 8.0.0-79

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