@veloceapps/sdk 11.0.0-2 → 11.0.0-20
Sign up to get free protection for your applications and to get access to all the features.
- package/cms/cms.actions.d.ts +92 -29
- package/cms/components/element-renderer/element-renderer.component.d.ts +3 -10
- package/cms/services/element-context.service.d.ts +0 -1
- package/cms/types/common.types.d.ts +2 -0
- package/cms/types/index.d.ts +0 -1
- package/cms/utils/path.utils.d.ts +1 -2
- package/cms/vendor-map.d.ts +19 -40
- package/core/index.d.ts +0 -1
- package/core/modules/configuration/index.d.ts +1 -4
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +3 -22
- package/core/modules/configuration/services/configuration-state.service.d.ts +8 -8
- package/core/modules/configuration/services/configuration.service.d.ts +23 -47
- package/core/modules/flow-configuration/index.d.ts +0 -3
- package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +10 -39
- package/core/services/catalog-products.service.d.ts +11 -0
- package/core/services/flow-info.service.d.ts +25 -11
- package/core/services/flow-state-configuration.service.d.ts +2 -8
- package/core/services/flow-state.service.d.ts +13 -22
- package/core/services/index.d.ts +2 -3
- package/core/services/integration.state.d.ts +1 -1
- package/core/services/sales-transaction.service.d.ts +30 -0
- package/core/types/flow-state.types.d.ts +2 -2
- package/core/types/index.d.ts +0 -1
- package/core/utils/index.d.ts +2 -2
- package/core/utils/transaction-item.utils.d.ts +7 -0
- package/core/utils/transaction-item.worker.d.ts +8 -0
- package/esm2020/cms/cms.actions.mjs +93 -71
- package/esm2020/cms/cms.default.mjs +2 -3
- package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +7 -64
- package/esm2020/cms/components/preview/preview.component.mjs +3 -3
- package/esm2020/cms/services/element-context.service.mjs +1 -1
- package/esm2020/cms/types/common.types.mjs +1 -1
- package/esm2020/cms/types/index.mjs +1 -2
- package/esm2020/cms/utils/element.utils.mjs +3 -3
- package/esm2020/cms/utils/path.utils.mjs +1 -10
- package/esm2020/cms/vendor-map.mjs +12 -17
- package/esm2020/core/core.module.mjs +9 -7
- package/esm2020/core/index.mjs +1 -2
- package/esm2020/core/modules/configuration/configuration.module.mjs +3 -4
- package/esm2020/core/modules/configuration/index.mjs +2 -5
- package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +9 -102
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +60 -76
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +96 -225
- package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +3 -4
- package/esm2020/core/modules/flow-configuration/index.mjs +1 -4
- package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +33 -126
- package/esm2020/core/services/catalog-products.service.mjs +25 -0
- package/esm2020/core/services/flow-info.service.mjs +77 -29
- package/esm2020/core/services/flow-state-configuration.service.mjs +10 -25
- package/esm2020/core/services/flow-state.service.mjs +62 -169
- package/esm2020/core/services/index.mjs +3 -4
- package/esm2020/core/services/integration.state.mjs +2 -2
- package/esm2020/core/services/sales-transaction.service.mjs +68 -0
- package/esm2020/core/types/flow-state.types.mjs +1 -1
- package/esm2020/core/types/index.mjs +1 -2
- package/esm2020/core/utils/index.mjs +3 -3
- package/esm2020/core/utils/transaction-item.utils.mjs +60 -0
- package/esm2020/core/utils/transaction-item.worker.mjs +16 -0
- package/esm2020/src/components/flow-header/flow-header.component.mjs +3 -6
- package/esm2020/src/components/guided-selling/guided-selling.component.mjs +3 -6
- package/esm2020/src/flow-routing.module.mjs +11 -41
- package/esm2020/src/flow.component.mjs +5 -5
- package/esm2020/src/guards/flow.guard.mjs +13 -14
- package/esm2020/src/guards/product-unload.guard.mjs +7 -9
- package/esm2020/src/index.mjs +1 -3
- package/esm2020/src/pages/assets/assets.component.mjs +3 -3
- package/esm2020/src/pages/catalog/catalog.component.mjs +3 -3
- package/esm2020/src/pages/debug/debug.component.mjs +12 -21
- package/esm2020/src/pages/product/product.component.mjs +12 -82
- package/esm2020/src/pages/product/product.module.mjs +5 -5
- package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +5 -6
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +3 -3
- package/esm2020/src/resolvers/flow.resolver.mjs +10 -18
- package/esm2020/src/resolvers/sales-transaction.resolver.mjs +83 -0
- package/esm2020/src/resolvers/ui-definition.resolver.mjs +42 -0
- package/esm2020/src/services/flow-dialog.service.mjs +8 -8
- package/esm2020/src/services/flow-router.service.mjs +16 -33
- package/esm2020/src/services/flow.service.mjs +13 -54
- package/esm2020/src/types/index.mjs +2 -3
- package/esm2020/src/types/route.types.mjs +1 -1
- package/fesm2015/veloceapps-sdk-cms.mjs +126 -268
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +712 -1644
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +167 -758
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +114 -262
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +758 -1725
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +167 -752
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/flow-header/flow-header.component.d.ts +1 -1
- package/src/components/guided-selling/guided-selling.component.d.ts +1 -1
- package/src/flow-routing.module.d.ts +1 -2
- package/src/flow.component.d.ts +2 -2
- package/src/guards/product-unload.guard.d.ts +5 -6
- package/src/index.d.ts +0 -2
- package/src/pages/assets/assets.component.d.ts +1 -1
- package/src/pages/catalog/catalog.component.d.ts +1 -1
- package/src/pages/debug/debug.component.d.ts +1 -4
- package/src/pages/product/product.component.d.ts +5 -14
- package/src/pages/product/product.module.d.ts +1 -1
- package/src/pages/record-not-found/record-not-found.component.d.ts +2 -3
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +1 -1
- package/src/resolvers/flow.resolver.d.ts +5 -6
- package/src/resolvers/sales-transaction.resolver.d.ts +18 -0
- package/src/resolvers/ui-definition.resolver.d.ts +3 -0
- package/src/services/flow-dialog.service.d.ts +5 -4
- package/src/services/flow-router.service.d.ts +4 -6
- package/src/services/flow.service.d.ts +2 -7
- package/src/types/index.d.ts +1 -2
- package/src/types/route.types.d.ts +0 -5
- package/cms/plugins/configuration.plugin.d.ts +0 -23
- package/cms/types/configuration.types.d.ts +0 -21
- package/core/modules/configuration/helpers.d.ts +0 -6
- package/core/modules/configuration/services/runtime-context.service.d.ts +0 -12
- package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -6
- package/core/modules/flow-configuration/services/flow-update.service.d.ts +0 -13
- package/core/modules/flow-configuration/types/update.types.d.ts +0 -12
- package/core/services/context.service.d.ts +0 -23
- package/core/services/quote-draft.service.d.ts +0 -50
- package/core/types/runtime.types.d.ts +0 -30
- package/core/utils/line-item.utils.d.ts +0 -25
- package/core/utils/line-item.worker.d.ts +0 -9
- package/esm2020/cms/plugins/configuration.plugin.mjs +0 -109
- package/esm2020/cms/types/configuration.types.mjs +0 -2
- package/esm2020/core/modules/configuration/helpers.mjs +0 -73
- package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +0 -43
- package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +0 -2
- package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +0 -138
- package/esm2020/core/modules/flow-configuration/types/update.types.mjs +0 -2
- package/esm2020/core/services/context.service.mjs +0 -91
- package/esm2020/core/services/quote-draft.service.mjs +0 -192
- package/esm2020/core/types/runtime.types.mjs +0 -16
- package/esm2020/core/utils/line-item.utils.mjs +0 -187
- package/esm2020/core/utils/line-item.worker.mjs +0 -19
- package/esm2020/src/guards/context.guard.mjs +0 -91
- package/esm2020/src/guards/index.mjs +0 -2
- package/esm2020/src/pages/remote/remote.component.mjs +0 -342
- package/esm2020/src/pages/remote/remote.module.mjs +0 -20
- package/esm2020/src/pages/remote/remote.types.mjs +0 -2
- package/esm2020/src/resolvers/quote.resolver.mjs +0 -82
- package/esm2020/src/types/context-route.types.mjs +0 -2
- package/esm2020/src/types/metrics.types.mjs +0 -2
- package/esm2020/src/utils/flow.utils.mjs +0 -25
- package/esm2020/src/utils/index.mjs +0 -2
- package/src/guards/context.guard.d.ts +0 -19
- package/src/guards/index.d.ts +0 -1
- package/src/pages/remote/remote.component.d.ts +0 -46
- package/src/pages/remote/remote.module.d.ts +0 -10
- package/src/pages/remote/remote.types.d.ts +0 -4
- package/src/resolvers/quote.resolver.d.ts +0 -19
- package/src/types/context-route.types.d.ts +0 -5
- package/src/types/metrics.types.d.ts +0 -5
- package/src/utils/flow.utils.d.ts +0 -8
- package/src/utils/index.d.ts +0 -1
@@ -1,27 +1,28 @@
|
|
1
1
|
import * as i2 from '@veloceapps/sdk/core';
|
2
|
-
import { IntegrationState, ConfigurationService, ConfigurationStateService,
|
2
|
+
import { IntegrationState, ConfigurationService, ConfigurationStateService, FlowConfigurationService, FlowStateService, FlowStateConfigurationService, TransactionItemWorker, ProductImagesService, RuntimeSettingsService, ActionCodePipe, DatePipe, NumberPipe, PricePipe, SalesTransactionService, SdkPipesModule, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
|
3
3
|
export { IntegrationState } from '@veloceapps/sdk/core';
|
4
4
|
import { __decorate, __param, __metadata } from 'tslib';
|
5
5
|
import * as i0 from '@angular/core';
|
6
|
-
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef,
|
6
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef, ViewChild, Input, ViewEncapsulation, NgModule, inject, ElementRef, Directive, ApplicationRef, createComponent, EventEmitter, createNgModule } from '@angular/core';
|
7
7
|
import * as rxjs from 'rxjs';
|
8
8
|
import { BehaviorSubject, Subject, map, distinctUntilChanged, of, tap, switchMap, startWith, takeUntil, combineLatest, catchError, ReplaySubject, noop, filter, take, Observable, from } from 'rxjs';
|
9
9
|
import * as i3 from '@veloceapps/components';
|
10
10
|
import { ToastType, LetDirectiveModule, LoaderModule, ToastService, HiddenTextTooltipModule, ErrorTooltipModule } from '@veloceapps/components';
|
11
|
-
import lodash, { cloneDeep,
|
11
|
+
import lodash, { cloneDeep, isArray, pull, merge, omit, flatten, kebabCase, set } from 'lodash';
|
12
12
|
import { applyPatch } from 'rfc6902';
|
13
|
-
import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely,
|
13
|
+
import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, parseJwt, TokenInfoService, CoreModule } from '@veloceapps/core';
|
14
14
|
import * as i4 from '@angular/common';
|
15
15
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
16
16
|
import * as i2$1 from 'ngx-drag-drop';
|
17
17
|
import { DndModule } from 'ngx-drag-drop';
|
18
|
-
import { SalesforceApiService,
|
18
|
+
import { SalesforceApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ShoppingCartSettingsApiService, ConfigurationSettingsApiService, GuidedSellingApiService, ContractedPriceApiService, ApiModule } from '@veloceapps/api';
|
19
19
|
import { DialogService } from 'primeng/dynamicdialog';
|
20
20
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
21
21
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
22
22
|
import * as angularForms from '@angular/forms';
|
23
23
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
24
24
|
import { DataSource } from '@angular/cdk/collections';
|
25
|
+
import { SalesTransactionApiService } from '@veloceapps/api/v2';
|
25
26
|
import * as rxjsOperators from 'rxjs/operators';
|
26
27
|
import * as sass from 'sass';
|
27
28
|
import { transform } from '@babel/standalone';
|
@@ -44,58 +45,79 @@ var FlowAction;
|
|
44
45
|
FlowAction.SUBMIT_GUIDED_SELLING = '[FLOW]_SUBMIT_GUIDED_SELLING';
|
45
46
|
FlowAction.CLOSE_GUIDED_SELLING = '[FLOW]_CLOSE_GUIDED_SELLING';
|
46
47
|
FlowAction.OPEN_DIALOG = '[FLOW]_OPEN_DIALOG';
|
47
|
-
FlowAction.ConfigureProductAction = ({
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
48
|
+
FlowAction.ConfigureProductAction = ({ transactionItemId, productId, }) => {
|
49
|
+
return {
|
50
|
+
type: FlowAction.FLOW_CONFIGURE_PRODUCT,
|
51
|
+
payload: { transactionItemId, productId },
|
52
|
+
};
|
53
|
+
};
|
54
|
+
FlowAction.NavigateBackAction = () => {
|
55
|
+
return {
|
56
|
+
type: FlowAction.FLOW_NAVIGATE_BACK,
|
57
|
+
};
|
58
|
+
};
|
59
|
+
FlowAction.NavigateToAction = (path, productId, transactionItemId) => ({
|
55
60
|
type: FlowAction.FLOW_NAVIGATE_TO,
|
56
|
-
payload: { path, productId,
|
61
|
+
payload: { path, productId, transactionItemId },
|
57
62
|
});
|
58
63
|
FlowAction.NavigateToCatalogAction = () => ({
|
59
64
|
type: FlowAction.FLOW_NAVIGATE_TO_CATALOG,
|
60
65
|
});
|
61
|
-
FlowAction.NavigateToShoppingCartAction = () =>
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
FlowAction.
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
}
|
66
|
+
FlowAction.NavigateToShoppingCartAction = () => {
|
67
|
+
return {
|
68
|
+
type: FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART,
|
69
|
+
};
|
70
|
+
};
|
71
|
+
FlowAction.ApplyProductConfigurationAction = () => {
|
72
|
+
return {
|
73
|
+
type: FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION,
|
74
|
+
};
|
75
|
+
};
|
76
|
+
FlowAction.RemoteApplyAction = () => {
|
77
|
+
return {
|
78
|
+
type: FlowAction.REMOTE_APPLY,
|
79
|
+
};
|
80
|
+
};
|
81
|
+
FlowAction.RemoteCancelAction = () => {
|
82
|
+
return {
|
83
|
+
type: FlowAction.REMOTE_CANCEL,
|
84
|
+
};
|
85
|
+
};
|
86
|
+
FlowAction.SwitchObjectAction = (payload) => {
|
87
|
+
return {
|
88
|
+
type: FlowAction.FLOW_SWITCH_OBJECT,
|
89
|
+
payload,
|
90
|
+
};
|
91
|
+
};
|
92
|
+
FlowAction.OpenGuidedSelling = (payload) => {
|
93
|
+
return {
|
94
|
+
type: FlowAction.OPEN_GUIDED_SELLING,
|
95
|
+
payload,
|
96
|
+
};
|
97
|
+
};
|
98
|
+
FlowAction.CloseGuidedSelling = (payload) => {
|
99
|
+
return {
|
100
|
+
type: FlowAction.CLOSE_GUIDED_SELLING,
|
101
|
+
payload,
|
102
|
+
};
|
103
|
+
};
|
104
|
+
FlowAction.SubmitGuidedSelling = (payload) => {
|
105
|
+
return {
|
106
|
+
type: FlowAction.SUBMIT_GUIDED_SELLING,
|
107
|
+
payload,
|
108
|
+
};
|
109
|
+
};
|
110
|
+
FlowAction.OpenDialog = (dialog) => {
|
111
|
+
return {
|
112
|
+
type: FlowAction.OPEN_DIALOG,
|
113
|
+
payload: { dialog },
|
114
|
+
};
|
115
|
+
};
|
93
116
|
})(FlowAction || (FlowAction = {}));
|
94
117
|
var CmsAction;
|
95
118
|
(function (CmsAction) {
|
96
119
|
CmsAction.GO_TO_PAGE = '[CMS]_GO_TO_PAGE';
|
97
120
|
CmsAction.UPDATE_CUSTOMIZATION = '[CMS]_UPDATE_CUSTOMIZATION';
|
98
|
-
CmsAction.EMIT_CUSTOMIZATION_CHANGES = '[CMS]_EMIT_CUSTOMIZATION_CHANGES';
|
99
121
|
CmsAction.SHOW_OVERLAY = '[CMS]_SHOW_OVERLAY';
|
100
122
|
CmsAction.HIDE_OVERLAY = '[CMS]_HIDE_OVERLAY';
|
101
123
|
CmsAction.HIDE_ALL_OVERLAYS = '[CMS]_HIDE_ALL_OVERLAYS';
|
@@ -104,56 +126,57 @@ var CmsAction;
|
|
104
126
|
*
|
105
127
|
* @param pageName name of the page
|
106
128
|
*/
|
107
|
-
CmsAction.GoToPage = (pageName) =>
|
108
|
-
|
109
|
-
|
110
|
-
|
129
|
+
CmsAction.GoToPage = (pageName) => {
|
130
|
+
return {
|
131
|
+
type: CmsAction.GO_TO_PAGE,
|
132
|
+
payload: { pageName },
|
133
|
+
};
|
134
|
+
};
|
111
135
|
/**
|
112
136
|
* Update UI definition customization state
|
113
137
|
*
|
114
138
|
* @param pageName name of the page
|
115
139
|
*/
|
116
|
-
CmsAction.UpdateCustomization = (value) =>
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
*
|
123
|
-
* @param changes - object with customization page changes
|
124
|
-
*/
|
125
|
-
CmsAction.EmitCustomizationChanges = (changes) => ({
|
126
|
-
type: CmsAction.EMIT_CUSTOMIZATION_CHANGES,
|
127
|
-
payload: { changes },
|
128
|
-
});
|
140
|
+
CmsAction.UpdateCustomization = (value) => {
|
141
|
+
return {
|
142
|
+
type: CmsAction.UPDATE_CUSTOMIZATION,
|
143
|
+
payload: { value },
|
144
|
+
};
|
145
|
+
};
|
129
146
|
/**
|
130
147
|
* Show an Overlay on the selected page
|
131
148
|
*
|
132
149
|
* @param name - name of the overlay
|
133
150
|
* @returns void
|
134
151
|
*/
|
135
|
-
CmsAction.ShowOverlay = (name) =>
|
136
|
-
|
137
|
-
|
138
|
-
|
152
|
+
CmsAction.ShowOverlay = (name) => {
|
153
|
+
return {
|
154
|
+
type: CmsAction.SHOW_OVERLAY,
|
155
|
+
payload: { name },
|
156
|
+
};
|
157
|
+
};
|
139
158
|
/**
|
140
159
|
* Hide an Overlay on the selected page
|
141
160
|
*
|
142
161
|
* @param name - name of the overlay
|
143
162
|
* @returns void
|
144
163
|
*/
|
145
|
-
CmsAction.HideOverlay = (name) =>
|
146
|
-
|
147
|
-
|
148
|
-
|
164
|
+
CmsAction.HideOverlay = (name) => {
|
165
|
+
return {
|
166
|
+
type: CmsAction.HIDE_OVERLAY,
|
167
|
+
payload: { name },
|
168
|
+
};
|
169
|
+
};
|
149
170
|
/**
|
150
171
|
* Hide all Overlays on the selected page
|
151
172
|
*
|
152
173
|
* @returns void
|
153
174
|
*/
|
154
|
-
CmsAction.HideAllOverlays = () =>
|
155
|
-
|
156
|
-
|
175
|
+
CmsAction.HideAllOverlays = () => {
|
176
|
+
return {
|
177
|
+
type: CmsAction.HIDE_ALL_OVERLAYS,
|
178
|
+
};
|
179
|
+
};
|
157
180
|
})(CmsAction || (CmsAction = {}));
|
158
181
|
|
159
182
|
var cmsActions = /*#__PURE__*/Object.freeze({
|
@@ -664,14 +687,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
664
687
|
type: Injectable
|
665
688
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2.IntegrationState }]; } });
|
666
689
|
|
667
|
-
const parseBoundPath = (path) => {
|
668
|
-
const regexp = new RegExp(`(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)`, 'g');
|
669
|
-
const blocks = path.match(regexp)?.map(match => {
|
670
|
-
const [type, property, name] = compact(match.split('/'));
|
671
|
-
return { type: type ?? '', property, name };
|
672
|
-
}) ?? [];
|
673
|
-
return blocks;
|
674
|
-
};
|
675
690
|
const parsePath = (path) => {
|
676
691
|
const segments = path.split('/');
|
677
692
|
let module;
|
@@ -800,13 +815,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
800
815
|
}] });
|
801
816
|
|
802
817
|
class ElementRendererComponent {
|
803
|
-
constructor(
|
804
|
-
this.parentInjector = parentInjector;
|
818
|
+
constructor(runtimeService, elementContext, ioProviderService, cdr) {
|
805
819
|
this.runtimeService = runtimeService;
|
806
820
|
this.elementContext = elementContext;
|
807
821
|
this.ioProviderService = ioProviderService;
|
808
|
-
this.configurationService = configurationService;
|
809
|
-
this.elementRef = elementRef;
|
810
822
|
this.cdr = cdr;
|
811
823
|
this.refs = {};
|
812
824
|
this.destroy$ = new Subject();
|
@@ -830,10 +842,7 @@ class ElementRendererComponent {
|
|
830
842
|
this.refs[UUID.UUID()] = this.createComponent();
|
831
843
|
return;
|
832
844
|
}
|
833
|
-
if (modelMeta.
|
834
|
-
this.createFromLineItem(modelMeta.lineItem);
|
835
|
-
}
|
836
|
-
else if (modelMeta.path) {
|
845
|
+
if (modelMeta.path) {
|
837
846
|
this.createFromPath(modelMeta.path);
|
838
847
|
}
|
839
848
|
}
|
@@ -846,43 +855,6 @@ class ElementRendererComponent {
|
|
846
855
|
this.processChildren(children);
|
847
856
|
});
|
848
857
|
}
|
849
|
-
getModelComponent() {
|
850
|
-
let component = null;
|
851
|
-
let injector = this.parentInjector;
|
852
|
-
while (!component) {
|
853
|
-
const parentComp = injector.get(ElementRendererComponent, null);
|
854
|
-
if (parentComp?.meta.model) {
|
855
|
-
component = parentComp;
|
856
|
-
break;
|
857
|
-
}
|
858
|
-
if (parentComp) {
|
859
|
-
injector = parentComp.parentInjector;
|
860
|
-
}
|
861
|
-
else {
|
862
|
-
break;
|
863
|
-
}
|
864
|
-
}
|
865
|
-
return component;
|
866
|
-
}
|
867
|
-
createFromLineItem(path) {
|
868
|
-
const parentComp = this.getModelComponent();
|
869
|
-
const parentPath = parentComp?.meta.model?.lineItem;
|
870
|
-
const pathBlocks = parseBoundPath(path).reverse();
|
871
|
-
const { property, name } = pathBlocks[1] ?? {};
|
872
|
-
const finalPath = pathBlocks[0];
|
873
|
-
const children$ = this.getParentLineItem$(parentComp).pipe(map(model => {
|
874
|
-
if (!model) {
|
875
|
-
return [];
|
876
|
-
}
|
877
|
-
if (property === 'ports' && !finalPath?.property && parentPath !== path) {
|
878
|
-
return model.lineItems.filter(({ port }) => port === name) ?? [];
|
879
|
-
}
|
880
|
-
return [model];
|
881
|
-
}));
|
882
|
-
children$.pipe(takeUntil(this.destroy$)).subscribe(children => {
|
883
|
-
this.processChildren(children);
|
884
|
-
});
|
885
|
-
}
|
886
858
|
processChildren(children) {
|
887
859
|
this.runtimeService.moduleRefs[0]?.injector.runInContext(() => {
|
888
860
|
const refs = children.reduce((acc, data, index) => {
|
@@ -903,15 +875,6 @@ class ElementRendererComponent {
|
|
903
875
|
this.cdr.detectChanges();
|
904
876
|
});
|
905
877
|
}
|
906
|
-
getParentLineItem$(parentComp) {
|
907
|
-
const parentRefs = Object.values(parentComp?.refs ?? {});
|
908
|
-
const parentRef = parentRefs.find(ref => ref?.location.nativeElement?.contains(this.elementRef.nativeElement));
|
909
|
-
let parentModel$;
|
910
|
-
if (parentRef?.instance instanceof ElementComponent) {
|
911
|
-
parentModel$ = parentRef?.instance.model$;
|
912
|
-
}
|
913
|
-
return parentModel$ ?? this.configurationService.get();
|
914
|
-
}
|
915
878
|
createComponent(data, index) {
|
916
879
|
if (!this.type) {
|
917
880
|
return;
|
@@ -944,14 +907,12 @@ class ElementRendererComponent {
|
|
944
907
|
this.refs = {};
|
945
908
|
}
|
946
909
|
}
|
947
|
-
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, deps: [{ token:
|
910
|
+
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, deps: [{ token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
948
911
|
ElementRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
949
912
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, decorators: [{
|
950
913
|
type: Component,
|
951
914
|
args: [{ selector: 'vl-cms-element-renderer', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ElementContextService], template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"] }]
|
952
|
-
}], ctorParameters: function () { return [{ type: i0.
|
953
|
-
type: SkipSelf
|
954
|
-
}] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2.ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
|
915
|
+
}], ctorParameters: function () { return [{ type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
|
955
916
|
type: ViewChild,
|
956
917
|
args: ['el', { read: ViewContainerRef, static: true }]
|
957
918
|
}], meta: [{
|
@@ -980,7 +941,7 @@ class PreviewComponent {
|
|
980
941
|
}
|
981
942
|
ngOnInit() {
|
982
943
|
if (this.config?.clearStateOnInit) {
|
983
|
-
this.integrationState.
|
944
|
+
this.integrationState.reset();
|
984
945
|
}
|
985
946
|
this.startPreview();
|
986
947
|
}
|
@@ -1587,14 +1548,14 @@ function getError(token, self, reason) {
|
|
1587
1548
|
return new Error(`Injecting "${token}" in "/${self.path}": ${reason}`);
|
1588
1549
|
}
|
1589
1550
|
|
1590
|
-
const
|
1551
|
+
const vendorMap = {
|
1591
1552
|
'@veloceapps/core': {
|
1592
1553
|
isDefined,
|
1593
1554
|
Operator,
|
1594
1555
|
Predicate,
|
1595
1556
|
parseJsonSafely,
|
1596
|
-
ConfigurationContextMode,
|
1597
1557
|
parseJwt,
|
1558
|
+
TokenInfoService,
|
1598
1559
|
},
|
1599
1560
|
'@veloceapps/components': {
|
1600
1561
|
ToastService,
|
@@ -1602,7 +1563,6 @@ const VELOCE_LIBS = {
|
|
1602
1563
|
},
|
1603
1564
|
'@veloceapps/api': {
|
1604
1565
|
SalesforceApiService,
|
1605
|
-
QuoteApiService,
|
1606
1566
|
DocumentAttachmentApiService,
|
1607
1567
|
RampApiService,
|
1608
1568
|
CatalogApiService,
|
@@ -1614,23 +1574,24 @@ const VELOCE_LIBS = {
|
|
1614
1574
|
GuidedSellingApiService,
|
1615
1575
|
ContractedPriceApiService,
|
1616
1576
|
},
|
1577
|
+
'@veloceapps/api/v2': {
|
1578
|
+
SalesTransactionApiService,
|
1579
|
+
},
|
1617
1580
|
'@veloceapps/sdk/core': {
|
1618
1581
|
ConfigurationService,
|
1619
1582
|
ConfigurationStateService,
|
1620
|
-
QuoteDraftService,
|
1621
1583
|
FlowConfigurationService,
|
1622
1584
|
IntegrationState,
|
1623
1585
|
FlowStateService,
|
1624
1586
|
FlowStateConfigurationService,
|
1625
|
-
|
1587
|
+
TransactionItemWorker,
|
1626
1588
|
ProductImagesService,
|
1627
|
-
ContextService,
|
1628
1589
|
RuntimeSettingsService,
|
1629
1590
|
ActionCodePipe,
|
1630
1591
|
DatePipe,
|
1631
1592
|
NumberPipe,
|
1632
1593
|
PricePipe,
|
1633
|
-
|
1594
|
+
SalesTransactionService,
|
1634
1595
|
},
|
1635
1596
|
'@veloceapps/sdk/cms': {
|
1636
1597
|
...cmsInjectionTokens,
|
@@ -1640,12 +1601,6 @@ const VELOCE_LIBS = {
|
|
1640
1601
|
ResourcesService,
|
1641
1602
|
cmsInject,
|
1642
1603
|
},
|
1643
|
-
};
|
1644
|
-
const VELOCE_LIBS_BACKWARDS_COMPATIBLE = Object.entries(VELOCE_LIBS).reduce((trunk, [key, value]) => ({ ...trunk, [key.replace('@veloceapps/', '@veloce/')]: value }), {});
|
1645
|
-
const vendorMap = {
|
1646
|
-
...VELOCE_LIBS,
|
1647
|
-
// TODO: remove when projects/demos are migrated to @veloceapps organization libraries
|
1648
|
-
...VELOCE_LIBS_BACKWARDS_COMPATIBLE,
|
1649
1604
|
'@angular/core': i0,
|
1650
1605
|
'@angular/forms': angularForms,
|
1651
1606
|
'@angular/cdk/collections': {
|
@@ -1857,8 +1812,8 @@ const metadataToElement = (metadata, recursive = true) => {
|
|
1857
1812
|
const normalizeElementMetadata = (elementMetadata) => {
|
1858
1813
|
const metadata = { ...elementMetadata };
|
1859
1814
|
// model
|
1860
|
-
const {
|
1861
|
-
const model =
|
1815
|
+
const { path } = metadata.model ?? {};
|
1816
|
+
const model = path ? { path } : undefined;
|
1862
1817
|
if (model) {
|
1863
1818
|
metadata.model = model;
|
1864
1819
|
}
|
@@ -2007,111 +1962,8 @@ class ElementMetadataWorker {
|
|
2007
1962
|
}
|
2008
1963
|
}
|
2009
1964
|
|
2010
|
-
class ConfigurationPlugin {
|
2011
|
-
constructor(host) {
|
2012
|
-
this.host = host;
|
2013
|
-
this.destroy$ = new Subject();
|
2014
|
-
this.elementMetadata = this.host.injector.get(ELEMENT_METADATA);
|
2015
|
-
this.configurationService = this.host.injector.get(ConfigurationService);
|
2016
|
-
if (this.elementMetadata.model?.lineItem) {
|
2017
|
-
this.host.model$.pipe(takeUntil(this.destroy$)).subscribe(model => (this.modelSnapshot = model));
|
2018
|
-
const pathBlocks = parseBoundPath(this.elementMetadata.model?.lineItem);
|
2019
|
-
const firstPathBlock = pathBlocks.reverse()[0];
|
2020
|
-
if (!firstPathBlock) {
|
2021
|
-
return;
|
2022
|
-
}
|
2023
|
-
const { type, property, name } = firstPathBlock;
|
2024
|
-
this.host.boundName = name ?? type;
|
2025
|
-
this.register(type, property, name);
|
2026
|
-
}
|
2027
|
-
}
|
2028
|
-
ngOnDestroy() {
|
2029
|
-
this.destroy$.next();
|
2030
|
-
this.destroy$.complete();
|
2031
|
-
}
|
2032
|
-
register(type, property, name) {
|
2033
|
-
if (!type) {
|
2034
|
-
return;
|
2035
|
-
}
|
2036
|
-
if (!property) {
|
2037
|
-
this.registerType();
|
2038
|
-
}
|
2039
|
-
else if (property === 'ports' && name) {
|
2040
|
-
this.registerPort(name);
|
2041
|
-
}
|
2042
|
-
else if (property === 'attributes' && name) {
|
2043
|
-
this.registerAttribute(name);
|
2044
|
-
}
|
2045
|
-
}
|
2046
|
-
registerType() {
|
2047
|
-
const remove = () => {
|
2048
|
-
const rootLineItem = this.configurationService.getSnapshot();
|
2049
|
-
if (!rootLineItem || !this.modelSnapshot) {
|
2050
|
-
return;
|
2051
|
-
}
|
2052
|
-
this.configurationService.patch(new LineItemWorker(rootLineItem).remove(this.modelSnapshot.id).li);
|
2053
|
-
};
|
2054
|
-
const updateQty = (qty) => {
|
2055
|
-
const rootLineItem = this.configurationService.getSnapshot();
|
2056
|
-
if (!rootLineItem || !this.modelSnapshot) {
|
2057
|
-
return;
|
2058
|
-
}
|
2059
|
-
this.configurationService.patch(new LineItemWorker(rootLineItem).replace({ ...this.modelSnapshot, qty }).li);
|
2060
|
-
};
|
2061
|
-
this.typeHost.remove = remove;
|
2062
|
-
this.typeHost.updateQty = updateQty;
|
2063
|
-
}
|
2064
|
-
registerPort(name) {
|
2065
|
-
const model$ = this.host.model$;
|
2066
|
-
const portItems$ = model$.pipe(map(model => model?.lineItems.filter(li => li.port === this.host.boundName) ?? []));
|
2067
|
-
const portDomain$ = model$.pipe(map(model => model?.portDomains[this.host.boundName]));
|
2068
|
-
const add = (type, attributes = []) => {
|
2069
|
-
if (!this.modelSnapshot) {
|
2070
|
-
return;
|
2071
|
-
}
|
2072
|
-
const portDomain = this.modelSnapshot.portDomains[name];
|
2073
|
-
if (!portDomain) {
|
2074
|
-
return;
|
2075
|
-
}
|
2076
|
-
const generated = generateLineItem(portDomain.name, type, this.modelSnapshot.id, attributes);
|
2077
|
-
this.configurationService.patch(new LineItemWorker(this.modelSnapshot).insert(this.modelSnapshot.id, generated).li);
|
2078
|
-
};
|
2079
|
-
this.portHost.portItems$ = portItems$;
|
2080
|
-
this.portHost.portDomain$ = portDomain$;
|
2081
|
-
this.portHost.addPortItem = add;
|
2082
|
-
}
|
2083
|
-
registerAttribute(name) {
|
2084
|
-
if (!this.host.model$) {
|
2085
|
-
return;
|
2086
|
-
}
|
2087
|
-
const value$ = this.host.model$.pipe(map(model => getAttributeValue(model?.attributes ?? [], name)));
|
2088
|
-
const patch = (value) => {
|
2089
|
-
if (!this.modelSnapshot) {
|
2090
|
-
return;
|
2091
|
-
}
|
2092
|
-
this.configurationService.patch(new LineItemWorker(this.modelSnapshot).patchAttribute([{ name, value }]).li);
|
2093
|
-
};
|
2094
|
-
this.attributeHost.value$ = value$;
|
2095
|
-
this.attributeHost.patch = patch;
|
2096
|
-
}
|
2097
|
-
get attributeHost() {
|
2098
|
-
return this.host;
|
2099
|
-
}
|
2100
|
-
get typeHost() {
|
2101
|
-
return this.host;
|
2102
|
-
}
|
2103
|
-
get portHost() {
|
2104
|
-
return this.host;
|
2105
|
-
}
|
2106
|
-
}
|
2107
|
-
ConfigurationPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationPlugin, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
2108
|
-
ConfigurationPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: ConfigurationPlugin, ngImport: i0 });
|
2109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationPlugin, decorators: [{
|
2110
|
-
type: Directive
|
2111
|
-
}], ctorParameters: function () { return [{ type: undefined }]; } });
|
2112
|
-
|
2113
1965
|
const DEFAULT_PLUGINS = {
|
2114
|
-
CONFIGURATION: [
|
1966
|
+
CONFIGURATION: [],
|
2115
1967
|
DEFAULT: [],
|
2116
1968
|
};
|
2117
1969
|
|
@@ -2751,5 +2603,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
2751
2603
|
* Generated bundle index. Do not edit.
|
2752
2604
|
*/
|
2753
2605
|
|
2754
|
-
export { CmsAction, DEFAULT_ELEMENT, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementMetadataWorker, ElementsResolver, FlowAction, LAYOUT, LauncherModule, MigrationsModule, MigrationsService, PreviewComponent, PreviewModule, ResourcesService, RuntimeEditorService, RuntimeModule, RuntimeService, SHARED_ELEMENT_METADATA, STARTING_PAGE_LAYOUT, STARTING_PAGE_NAME, STARTING_PAGE_STYLES, STARTING_PAGE_TYPE, TemplatesService, TranspilationWorker, UI_DEFINITION_METADATA, UiBuildError, atobSafe, btoaSafe, cmsInject, constructPage, constructPageChildren, constructRegion, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElement, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementAngularIOs, getElementConfig, insertElement, isElementAngularIO, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata,
|
2606
|
+
export { CmsAction, DEFAULT_ELEMENT, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementMetadataWorker, ElementsResolver, FlowAction, LAYOUT, LauncherModule, MigrationsModule, MigrationsService, PreviewComponent, PreviewModule, ResourcesService, RuntimeEditorService, RuntimeModule, RuntimeService, SHARED_ELEMENT_METADATA, STARTING_PAGE_LAYOUT, STARTING_PAGE_NAME, STARTING_PAGE_STYLES, STARTING_PAGE_TYPE, TemplatesService, TranspilationWorker, UI_DEFINITION_METADATA, UiBuildError, atobSafe, btoaSafe, cmsInject, constructPage, constructPageChildren, constructRegion, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElement, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementAngularIOs, getElementConfig, insertElement, isElementAngularIO, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata, parsePath, removeElement, stringifyElementMetadata, toElementAngularIO };
|
2755
2607
|
//# sourceMappingURL=veloceapps-sdk-cms.mjs.map
|