@veloceapps/sdk 5.0.10 → 5.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/veloce-sdk-cms.umd.js +39 -10
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk-core.umd.js.map +1 -1
- package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +6 -3
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/cms/components/element-renderer/element-renderer.component.d.ts +1 -0
- package/cms/utils/elements-resolver.d.ts +1 -0
- package/cms/vendor-map.d.ts +116 -124
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +1 -1
- package/esm2015/cms/components/element-renderer/element-renderer.component.js +23 -2
- package/esm2015/cms/components/element.component.js +1 -1
- package/esm2015/cms/components/preview/preview.component.js +1 -1
- package/esm2015/cms/decorators/element.decorator.js +1 -1
- package/esm2015/cms/directives/custom-template.directive.js +1 -1
- package/esm2015/cms/engine/models/entity.js +1 -1
- package/esm2015/cms/modules/federated/federated.component.js +1 -1
- package/esm2015/cms/modules/federated/federated.utils.js +1 -1
- package/esm2015/cms/plugins/configuration.plugin.js +1 -1
- package/esm2015/cms/plugins/script.plugin.js +1 -1
- package/esm2015/cms/services/dynamic-module.service.js +1 -1
- package/esm2015/cms/services/element-context.service.js +1 -1
- package/esm2015/cms/services/integration.state.js +1 -1
- package/esm2015/cms/services/launcher.service.js +1 -1
- package/esm2015/cms/services/templates.service.js +1 -1
- package/esm2015/cms/utils/element.utils.js +1 -1
- package/esm2015/cms/utils/elements-resolver.js +18 -10
- package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +1 -1
- package/esm2015/core/modules/configuration/services/configuration.service.js +1 -1
- package/esm2015/core/modules/configuration/services/runtime-context.service.js +1 -1
- package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +1 -1
- package/esm2015/core/services/context.service.js +1 -1
- package/esm2015/core/services/quote-draft.service.js +1 -1
- package/esm2015/core/utils/line-item.utils.js +1 -1
- package/esm2015/runtime/components/component-preview/component-preview.component.js +1 -1
- package/esm2015/runtime/components/section-renderer/section-renderer.component.js +1 -1
- package/esm2015/runtime/components/ui-runtime/runtime.component.js +1 -1
- package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +1 -1
- package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +1 -1
- package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +1 -1
- package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +1 -1
- package/esm2015/runtime/execution/components/federated/federated.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +1 -1
- package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +1 -1
- package/esm2015/runtime/execution/directives/section-script.directive.js +1 -1
- package/esm2015/runtime/execution/directives/sf-query.directive.js +1 -1
- package/esm2015/runtime/execution/directives/velo-attribute.directive.js +1 -1
- package/esm2015/runtime/execution/directives/velo-port.directive.js +1 -1
- package/esm2015/runtime/execution/directives/vl-approval.directive.js +1 -1
- package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +1 -1
- package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +1 -1
- package/esm2015/runtime/execution/directives/vl-quote.directive.js +1 -1
- package/esm2015/runtime/execution/directives/vl-ramp.directive.js +1 -1
- package/esm2015/runtime/execution/utils/federated.util.js +1 -1
- package/esm2015/runtime/services/cart.service.js +1 -1
- package/esm2015/runtime/services/collapsible-state.service.js +1 -1
- package/esm2015/runtime/services/configuration.service.js +1 -1
- package/esm2015/runtime/services/current-state.service.js +1 -1
- package/esm2015/runtime/services/form-scope.service.js +1 -1
- package/esm2015/runtime/services/product-model-cache.service.js +1 -1
- package/esm2015/runtime/services/runtime-context.service.js +1 -1
- package/esm2015/runtime/services/runtime-form.service.js +2 -2
- package/esm2015/runtime/services/runtime.service.js +1 -1
- package/esm2015/runtime/services/section-helper.service.js +1 -1
- package/esm2015/runtime/services/section-scope.service.js +1 -1
- package/esm2015/runtime/services/section-store.service.js +1 -1
- package/esm2015/runtime/services/section.service.js +1 -1
- package/esm2015/runtime/types/script-registry.types.js +1 -1
- package/esm2015/runtime/utils/line-item.util.js +1 -1
- package/esm2015/runtime/utils/sections-binder.helper.js +1 -1
- package/esm2015/src/components/dialog/dialog.component.js +1 -1
- package/esm2015/src/components/doc-gen/doc-gen.component.js +2 -2
- package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +2 -2
- package/esm2015/src/components/header/header.component.js +1 -1
- package/esm2015/src/components/header/metrics/metrics.component.js +2 -2
- package/esm2015/src/components/header/metrics/metrics.module.js +10 -7
- package/esm2015/src/flow-routing.module.js +1 -1
- package/esm2015/src/flow.component.js +1 -1
- package/esm2015/src/guards/product-unload.guard.js +1 -1
- package/esm2015/src/guards/root.guard.js +1 -1
- package/esm2015/src/pages/catalog/catalog.component.js +1 -1
- package/esm2015/src/pages/debug/debug.component.js +1 -1
- package/esm2015/src/pages/legacy-product/legacy-product.component.js +1 -1
- package/esm2015/src/pages/product/product.component.js +1 -1
- package/esm2015/src/pages/record-not-found/record-not-found.component.js +1 -1
- package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +1 -1
- package/esm2015/src/resolvers/flow.resolver.js +1 -1
- package/esm2015/src/resolvers/quote.resolver.js +1 -1
- package/esm2015/src/services/flow-router.service.js +1 -1
- package/fesm2015/veloce-sdk-cms.js +39 -10
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk-core.js.map +1 -1
- package/fesm2015/veloce-sdk-runtime.js +1 -1
- package/fesm2015/veloce-sdk-runtime.js.map +1 -1
- package/fesm2015/veloce-sdk.js +7 -4
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/runtime/services/runtime-form.service.d.ts +3 -3
- package/runtime/utils/line-item.util.d.ts +1 -1
- package/src/components/header/metrics/metrics.module.d.ts +1 -1
- package/src/guards/product-unload.guard.d.ts +2 -1
- package/src/resolvers/flow.resolver.d.ts +1 -1
@@ -654,15 +654,36 @@ class ElementRendererComponent {
|
|
654
654
|
this.processChildren(children);
|
655
655
|
});
|
656
656
|
}
|
657
|
+
getModelComponent() {
|
658
|
+
let component = null;
|
659
|
+
let injector = this.parentInjector;
|
660
|
+
while (!component) {
|
661
|
+
const parentComp = injector.get(ElementRendererComponent, null);
|
662
|
+
if (parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) {
|
663
|
+
component = parentComp;
|
664
|
+
break;
|
665
|
+
}
|
666
|
+
if (parentComp) {
|
667
|
+
injector = parentComp.parentInjector;
|
668
|
+
}
|
669
|
+
else {
|
670
|
+
break;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
return component;
|
674
|
+
}
|
657
675
|
createFromLineItem(path) {
|
658
676
|
var _a, _b;
|
659
|
-
const parentComp = this.
|
677
|
+
const parentComp = this.getModelComponent();
|
660
678
|
const parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
|
661
679
|
const pathBlocks = parseBoundPath(path).reverse();
|
662
680
|
const { property, name } = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {};
|
663
681
|
const finalPath = pathBlocks[0];
|
664
682
|
const children$ = this.getParentLineItem$(parentComp).pipe(map(model => {
|
665
683
|
var _a;
|
684
|
+
if (!model) {
|
685
|
+
return [];
|
686
|
+
}
|
666
687
|
if (property === 'ports' && !finalPath.property && parentPath !== path) {
|
667
688
|
return (_a = model.lineItems.filter(({ port }) => port === name)) !== null && _a !== void 0 ? _a : [];
|
668
689
|
}
|
@@ -1178,12 +1199,8 @@ class ElementsResolver {
|
|
1178
1199
|
console.warn(`Unknown element type "${element.type}"`);
|
1179
1200
|
return;
|
1180
1201
|
}
|
1181
|
-
const
|
1182
|
-
|
1183
|
-
// order is important: styles written by user in CSS code should has higher priority
|
1184
|
-
element.styles = configuredStyles + element.styles;
|
1185
|
-
}
|
1186
|
-
const component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
|
1202
|
+
const styles = this.getElementStyles(element);
|
1203
|
+
const component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (styles ? { styles: [styles] } : {})), { providers: [
|
1187
1204
|
{ provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
|
1188
1205
|
{ provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
|
1189
1206
|
{ provide: ELEMENT_METADATA, useValue: element },
|
@@ -1196,16 +1213,28 @@ class ElementsResolver {
|
|
1196
1213
|
set(cmp, 'path', element.path);
|
1197
1214
|
return cmp;
|
1198
1215
|
}
|
1216
|
+
getElementStyles(element) {
|
1217
|
+
let result = '';
|
1218
|
+
const configuredStyles = this.convertInlineStylesToCSS(element.configuredStyles);
|
1219
|
+
if (configuredStyles) {
|
1220
|
+
// order is important: styles written by user in CSS code should has higher priority
|
1221
|
+
result += configuredStyles;
|
1222
|
+
}
|
1223
|
+
if (element.styles) {
|
1224
|
+
result += element.styles;
|
1225
|
+
}
|
1226
|
+
return result || undefined;
|
1227
|
+
}
|
1199
1228
|
convertInlineStylesToCSS(styles) {
|
1200
1229
|
if (!styles) {
|
1201
1230
|
return '';
|
1202
1231
|
}
|
1203
1232
|
const entries = Object.entries(styles);
|
1204
|
-
let result = ':host {';
|
1233
|
+
let result = ':host {\n';
|
1205
1234
|
entries.forEach(([style, value]) => {
|
1206
|
-
result +=
|
1235
|
+
result += ` ${kebabCase(style)}:${value};\n`;
|
1207
1236
|
});
|
1208
|
-
result += '}';
|
1237
|
+
result += '}\n';
|
1209
1238
|
return result;
|
1210
1239
|
}
|
1211
1240
|
}
|