@veloceapps/sdk 1.0.2 → 2.0.1
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 +504 -326
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk-runtime.umd.js +146 -146
- package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/cms/injection-tokens.d.ts +1 -0
- package/cms/plugins/script.plugin.d.ts +2 -0
- package/cms/services/dynamic-module.service.d.ts +4 -0
- package/cms/services/io-provider.service.d.ts +3 -0
- package/cms/services/launcher.service.d.ts +0 -2
- package/cms/types/common.types.d.ts +31 -11
- package/cms/utils/element.utils.d.ts +1 -0
- package/cms/utils/elements-resolver.d.ts +17 -0
- package/cms/utils/path.utils.d.ts +4 -0
- package/esm2015/cms/cms.elements.js +6 -2
- package/esm2015/cms/components/element-children/element-children.component.js +3 -3
- package/esm2015/cms/components/element-children/element-children.module.js +4 -4
- package/esm2015/cms/components/element-renderer/element-renderer.component.js +5 -5
- package/esm2015/cms/components/element-renderer/element-renderer.module.js +4 -4
- package/esm2015/cms/components/plugin.component.js +3 -3
- package/esm2015/cms/components/preview/preview.component.js +3 -3
- package/esm2015/cms/components/preview/preview.module.js +4 -4
- package/esm2015/cms/directives/custom-template.directive.js +3 -3
- package/esm2015/cms/injection-tokens.js +2 -1
- package/esm2015/cms/launcher.module.js +4 -4
- package/esm2015/cms/modules/configuration/configuration.module.js +4 -4
- package/esm2015/cms/modules/configuration/services/configuration.service.js +3 -3
- package/esm2015/cms/plugins/configuration.plugin.js +3 -3
- package/esm2015/cms/plugins/io.plugin.js +3 -3
- package/esm2015/cms/plugins/script.plugin.js +31 -24
- package/esm2015/cms/services/dynamic-module.service.js +15 -4
- package/esm2015/cms/services/element-context.service.js +3 -3
- package/esm2015/cms/services/io-provider.service.js +17 -17
- package/esm2015/cms/services/launcher.service.js +12 -49
- package/esm2015/cms/services/templates.service.js +3 -3
- package/esm2015/cms/types/common.types.js +1 -1
- package/esm2015/cms/utils/element.utils.js +22 -1
- package/esm2015/cms/utils/elements-resolver.js +88 -0
- package/esm2015/cms/utils/path.utils.js +52 -0
- package/esm2015/runtime/components/component-preview/component-preview.component.js +3 -3
- package/esm2015/runtime/components/section-renderer/section-renderer.component.js +3 -3
- package/esm2015/runtime/components/ui-runtime/runtime.component.js +3 -3
- package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +3 -3
- package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +6 -6
- package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +3 -3
- package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +3 -3
- package/esm2015/runtime/execution/components/federated/federated.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +3 -3
- package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +3 -3
- package/esm2015/runtime/execution/directives/section-script.directive.js +3 -3
- package/esm2015/runtime/execution/directives/sf-query.directive.js +3 -3
- package/esm2015/runtime/execution/directives/velo-attribute.directive.js +3 -3
- package/esm2015/runtime/execution/directives/velo-port.directive.js +18 -18
- package/esm2015/runtime/execution/directives/vl-approval.directive.js +3 -3
- package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +3 -3
- package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +3 -3
- package/esm2015/runtime/execution/directives/vl-quote.directive.js +3 -3
- package/esm2015/runtime/execution/directives/vl-ramp.directive.js +3 -3
- package/esm2015/runtime/execution/runtime-execution.module.js +4 -4
- package/esm2015/runtime/runtime.module.js +4 -4
- package/esm2015/runtime/services/cart.service.js +3 -3
- package/esm2015/runtime/services/collapsible-state.service.js +3 -3
- package/esm2015/runtime/services/configuration.service.js +3 -3
- package/esm2015/runtime/services/context.service.js +3 -3
- package/esm2015/runtime/services/current-state.service.js +3 -3
- package/esm2015/runtime/services/flow.service.js +3 -3
- package/esm2015/runtime/services/form-scope.service.js +3 -3
- package/esm2015/runtime/services/product-model-cache.service.js +3 -3
- package/esm2015/runtime/services/quote.service.js +3 -3
- package/esm2015/runtime/services/runtime-context.service.js +3 -3
- package/esm2015/runtime/services/runtime-form.service.js +3 -3
- package/esm2015/runtime/services/runtime.service.js +3 -3
- package/esm2015/runtime/services/section-helper.service.js +3 -3
- package/esm2015/runtime/services/section-scope.service.js +3 -3
- package/esm2015/runtime/services/section-store.service.js +3 -3
- package/esm2015/runtime/services/section.service.js +6 -6
- package/fesm2015/veloce-sdk-cms.js +447 -302
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk-runtime.js +146 -146
- package/fesm2015/veloce-sdk-runtime.js.map +1 -1
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param, __rest } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable,
|
|
3
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef, SkipSelf, ViewChild, Input, Directive, NgModule } from '@angular/core';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
5
|
import { BehaviorSubject, combineLatest, of, shareReplay, throwError, Subject, takeUntil, map as map$1, from, tap as tap$1, forkJoin, catchError as catchError$1 } from 'rxjs';
|
|
6
6
|
import { EntityUtil, UUID, ConfigurationMode, ConfigurationContextMode, RuntimeModel, CoreModule } from '@veloce/core';
|
|
@@ -9,7 +9,7 @@ import { RuntimeMode, RuntimeStep, ContextService } from '@veloce/sdk/runtime';
|
|
|
9
9
|
import * as rxjsOperators from 'rxjs/operators';
|
|
10
10
|
import { first, switchMap, catchError, map, tap } from 'rxjs/operators';
|
|
11
11
|
import * as lodash from 'lodash';
|
|
12
|
-
import { compact, sortBy, isArray, pull,
|
|
12
|
+
import { compact, sortBy, isArray, pull, flatten, set } from 'lodash';
|
|
13
13
|
import * as i1 from '@veloce/api';
|
|
14
14
|
import { ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloce/api';
|
|
15
15
|
import * as i3 from 'primeng/api';
|
|
@@ -24,6 +24,7 @@ import { LoaderModule } from '@veloce/components';
|
|
|
24
24
|
const DEFAULT_PLUGINS_TOKEN = new InjectionToken('DEFAULT_PLUGINS_TOKEN');
|
|
25
25
|
const UI_DEFINITION_METADATA = new InjectionToken('UI_DEFINITION_METADATA_TOKEN');
|
|
26
26
|
const ELEMENT_METADATA = new InjectionToken('ELEMENT_METADATA_TOKEN');
|
|
27
|
+
const SHARED_ELEMENT_METADATA = new InjectionToken('SHARED_ELEMENT_METADATA_TOKEN');
|
|
27
28
|
const ELEMENT_CONFIG = new InjectionToken('ELEMENT_CONFIG_TOKEN');
|
|
28
29
|
|
|
29
30
|
var vlInjectionTokens = /*#__PURE__*/Object.freeze({
|
|
@@ -31,6 +32,7 @@ var vlInjectionTokens = /*#__PURE__*/Object.freeze({
|
|
|
31
32
|
DEFAULT_PLUGINS_TOKEN: DEFAULT_PLUGINS_TOKEN,
|
|
32
33
|
UI_DEFINITION_METADATA: UI_DEFINITION_METADATA,
|
|
33
34
|
ELEMENT_METADATA: ELEMENT_METADATA,
|
|
35
|
+
SHARED_ELEMENT_METADATA: SHARED_ELEMENT_METADATA,
|
|
34
36
|
ELEMENT_CONFIG: ELEMENT_CONFIG
|
|
35
37
|
});
|
|
36
38
|
|
|
@@ -313,14 +315,98 @@ class ConfigurationService {
|
|
|
313
315
|
};
|
|
314
316
|
}
|
|
315
317
|
}
|
|
316
|
-
ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
317
|
-
ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
318
|
+
ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.ConfigurationApiService }, { token: i2.ContextService }, { token: i1.ConfigurationApiService }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
319
|
+
ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationService });
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationService, decorators: [{
|
|
319
321
|
type: Injectable
|
|
320
322
|
}], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: i2.ContextService }, { type: i1.ConfigurationApiService }, { type: i3.MessageService }]; } });
|
|
321
323
|
|
|
322
|
-
|
|
324
|
+
const parsePath = (path) => {
|
|
325
|
+
var _a, _b, _c, _d;
|
|
326
|
+
const segments = path.split('/');
|
|
327
|
+
let module;
|
|
328
|
+
let variable;
|
|
329
|
+
if ((_a = segments[0]) === null || _a === void 0 ? void 0 : _a.startsWith('@')) {
|
|
330
|
+
module = (_b = segments.shift()) === null || _b === void 0 ? void 0 : _b.substring(1);
|
|
331
|
+
}
|
|
332
|
+
if (((_c = segments[segments.length - 1]) === null || _c === void 0 ? void 0 : _c[0]) === ':') {
|
|
333
|
+
variable = (_d = segments.pop()) === null || _d === void 0 ? void 0 : _d.substring(1);
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
segments,
|
|
337
|
+
module,
|
|
338
|
+
variable,
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
const findElementByModule = (elements, module, elementName) => {
|
|
342
|
+
for (const el of elements) {
|
|
343
|
+
if (el.module === module && el.name === elementName) {
|
|
344
|
+
return el;
|
|
345
|
+
}
|
|
346
|
+
const child = findElementByModule(el.children, module, elementName);
|
|
347
|
+
if (child) {
|
|
348
|
+
return child;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return;
|
|
352
|
+
};
|
|
353
|
+
const getAbsolutePath = (elements, subject, path) => {
|
|
354
|
+
var _a, _b, _c, _d;
|
|
355
|
+
if (path.module) {
|
|
356
|
+
return (_a = findElementByModule(elements, path.module, path.segments[0])) === null || _a === void 0 ? void 0 : _a.path;
|
|
357
|
+
}
|
|
358
|
+
const subjectSegments = (_c = (_b = subject.path) === null || _b === void 0 ? void 0 : _b.split('/')) !== null && _c !== void 0 ? _c : [];
|
|
359
|
+
const isRelativePath = ((_d = path.segments[0]) === null || _d === void 0 ? void 0 : _d[0]) === '.';
|
|
360
|
+
if (!isRelativePath) {
|
|
361
|
+
return path.segments.join('/');
|
|
362
|
+
}
|
|
363
|
+
const segments = [...path.segments];
|
|
364
|
+
while (segments.length) {
|
|
365
|
+
const segment = segments.shift();
|
|
366
|
+
if (segment === '..') {
|
|
367
|
+
subjectSegments.pop();
|
|
368
|
+
}
|
|
369
|
+
else if (segment) {
|
|
370
|
+
subjectSegments.push(segment);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return subjectSegments.join('/');
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
class DynamicModuleService {
|
|
323
377
|
constructor() {
|
|
378
|
+
this._elementsTree = [];
|
|
379
|
+
this._componentFactories = [];
|
|
380
|
+
}
|
|
381
|
+
set componentFactories(data) {
|
|
382
|
+
this._componentFactories = data;
|
|
383
|
+
}
|
|
384
|
+
get componentFactories() {
|
|
385
|
+
return this._componentFactories;
|
|
386
|
+
}
|
|
387
|
+
getComponentFactory(element) {
|
|
388
|
+
return this.componentFactories.find(f => f.componentType.path === element.path);
|
|
389
|
+
}
|
|
390
|
+
get elementsTree() {
|
|
391
|
+
return this._elementsTree;
|
|
392
|
+
}
|
|
393
|
+
set elementsTree(tree) {
|
|
394
|
+
this._elementsTree = tree;
|
|
395
|
+
}
|
|
396
|
+
clear() {
|
|
397
|
+
this._elementsTree = [];
|
|
398
|
+
this.componentFactories = [];
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
DynamicModuleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicModuleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
402
|
+
DynamicModuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicModuleService });
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicModuleService, decorators: [{
|
|
404
|
+
type: Injectable
|
|
405
|
+
}] });
|
|
406
|
+
|
|
407
|
+
class IOProviderService {
|
|
408
|
+
constructor(dynamicModuleService) {
|
|
409
|
+
this.dynamicModuleService = dynamicModuleService;
|
|
324
410
|
this.inputs = {};
|
|
325
411
|
}
|
|
326
412
|
connect(el, name, target) {
|
|
@@ -333,18 +419,15 @@ class IOProviderService {
|
|
|
333
419
|
resolveTarget(el, name, target) {
|
|
334
420
|
var _a, _b;
|
|
335
421
|
const isHost = !target;
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
const finalName = optionalName !== null && optionalName !== void 0 ? optionalName : name;
|
|
339
|
-
return this.createSubjectSafe(path, finalName);
|
|
340
|
-
}
|
|
341
|
-
const path = (_b = el.path) !== null && _b !== void 0 ? _b : '';
|
|
342
|
-
const modulePath = el.module ? `[${el.module}]${el.name}` : undefined;
|
|
343
|
-
const subject = this.createSubjectSafe(path, name);
|
|
344
|
-
if (modulePath) {
|
|
345
|
-
this.createSubjectSafe(modulePath, name, subject);
|
|
422
|
+
if (isHost) {
|
|
423
|
+
return this.createSubjectSafe((_a = el.path) !== null && _a !== void 0 ? _a : '', name);
|
|
346
424
|
}
|
|
347
|
-
|
|
425
|
+
const elPath = parsePath(target);
|
|
426
|
+
const pathIsValue = elPath.segments.length === 1 && elPath.segments[0].startsWith('"') && elPath.segments[0].endsWith('"');
|
|
427
|
+
const finalName = (_b = elPath.variable) !== null && _b !== void 0 ? _b : name;
|
|
428
|
+
const value = pathIsValue ? new BehaviorSubject(elPath.segments[0].slice(1, -1)) : undefined;
|
|
429
|
+
const absolutePath = !pathIsValue ? getAbsolutePath(this.dynamicModuleService.elementsTree, el, elPath) : el.path;
|
|
430
|
+
return this.createSubjectSafe(absolutePath !== null && absolutePath !== void 0 ? absolutePath : '', finalName, value);
|
|
348
431
|
}
|
|
349
432
|
createSubjectSafe(path, name, subject) {
|
|
350
433
|
if (!this.inputs[path]) {
|
|
@@ -356,11 +439,11 @@ class IOProviderService {
|
|
|
356
439
|
return this.inputs[path][name];
|
|
357
440
|
}
|
|
358
441
|
}
|
|
359
|
-
IOProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
360
|
-
IOProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
442
|
+
IOProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IOProviderService, deps: [{ token: DynamicModuleService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
443
|
+
IOProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IOProviderService });
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IOProviderService, decorators: [{
|
|
362
445
|
type: Injectable
|
|
363
|
-
}] });
|
|
446
|
+
}], ctorParameters: function () { return [{ type: DynamicModuleService }]; } });
|
|
364
447
|
|
|
365
448
|
class TemplatesService {
|
|
366
449
|
constructor() {
|
|
@@ -373,9 +456,9 @@ class TemplatesService {
|
|
|
373
456
|
return this.templates[name];
|
|
374
457
|
}
|
|
375
458
|
}
|
|
376
|
-
TemplatesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
377
|
-
TemplatesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
459
|
+
TemplatesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplatesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
460
|
+
TemplatesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplatesService });
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplatesService, decorators: [{
|
|
379
462
|
type: Injectable
|
|
380
463
|
}] });
|
|
381
464
|
|
|
@@ -395,6 +478,27 @@ const elementToMetadata = (el, parentPath) => {
|
|
|
395
478
|
return Object.assign(Object.assign({}, elementMetadata), { path, script: script === null || script === void 0 ? void 0 : script.replace(METADATA_DECORATOR_REGEX, 'export class'), template,
|
|
396
479
|
styles, children: el.children.map(child => elementToMetadata(child, path)) });
|
|
397
480
|
};
|
|
481
|
+
const metadataToElement = (metadata) => {
|
|
482
|
+
const elMetadata = {
|
|
483
|
+
name: metadata.name,
|
|
484
|
+
type: metadata.type,
|
|
485
|
+
model: metadata.model,
|
|
486
|
+
module: metadata.module,
|
|
487
|
+
inputs: metadata.inputs,
|
|
488
|
+
outputs: metadata.outputs,
|
|
489
|
+
children: metadata.children.map(({ name }) => name),
|
|
490
|
+
};
|
|
491
|
+
const script = metadata.script &&
|
|
492
|
+
window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, `@ElementDefinition(${JSON.stringify(elMetadata)}) export class Script `));
|
|
493
|
+
const template = metadata.template && window.btoa(metadata.template);
|
|
494
|
+
const styles = metadata.styles && window.btoa(metadata.styles);
|
|
495
|
+
return {
|
|
496
|
+
script,
|
|
497
|
+
template,
|
|
498
|
+
styles,
|
|
499
|
+
children: metadata.children.map(meta => metadataToElement(meta)),
|
|
500
|
+
};
|
|
501
|
+
};
|
|
398
502
|
const extractElementMetadata = (script) => {
|
|
399
503
|
var _a;
|
|
400
504
|
const metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
|
|
@@ -414,6 +518,187 @@ const extendElementMetadata = (script, extend) => {
|
|
|
414
518
|
return script.replace(metadataString, JSON.stringify(updated));
|
|
415
519
|
};
|
|
416
520
|
|
|
521
|
+
class ElementContextService {
|
|
522
|
+
}
|
|
523
|
+
ElementContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
524
|
+
ElementContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementContextService });
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementContextService, decorators: [{
|
|
526
|
+
type: Injectable
|
|
527
|
+
}] });
|
|
528
|
+
|
|
529
|
+
class ElementRendererComponent {
|
|
530
|
+
constructor(parentInjector, dynamicModuleService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
|
|
531
|
+
this.parentInjector = parentInjector;
|
|
532
|
+
this.dynamicModuleService = dynamicModuleService;
|
|
533
|
+
this.elementContext = elementContext;
|
|
534
|
+
this.ioProviderService = ioProviderService;
|
|
535
|
+
this.configurationService = configurationService;
|
|
536
|
+
this.elementRef = elementRef;
|
|
537
|
+
this.cdr = cdr;
|
|
538
|
+
this.refs = {};
|
|
539
|
+
this.destroy$ = new Subject();
|
|
540
|
+
}
|
|
541
|
+
ngOnInit() {
|
|
542
|
+
this.elementContext.metadata = this.meta;
|
|
543
|
+
this.factory = this.dynamicModuleService.getComponentFactory(this.meta);
|
|
544
|
+
this.createComponents();
|
|
545
|
+
}
|
|
546
|
+
ngOnDestroy() {
|
|
547
|
+
this.destroyComponents();
|
|
548
|
+
this.destroy$.next();
|
|
549
|
+
this.destroy$.complete();
|
|
550
|
+
}
|
|
551
|
+
createComponents() {
|
|
552
|
+
const modelMeta = this.meta.model;
|
|
553
|
+
if (!modelMeta) {
|
|
554
|
+
this.refs[UUID.UUID()] = this.createComponent();
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
if (modelMeta.lineItem) {
|
|
558
|
+
this.createFromLineItem(modelMeta.lineItem);
|
|
559
|
+
}
|
|
560
|
+
else if (modelMeta.path) {
|
|
561
|
+
this.createFromPath(modelMeta.path);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
createFromPath(path) {
|
|
565
|
+
const array$ = this.ioProviderService.connect(this.meta, 'children$', path);
|
|
566
|
+
array$ === null || array$ === void 0 ? void 0 : array$.pipe(takeUntil(this.destroy$)).subscribe(children => {
|
|
567
|
+
if (!isArray(children)) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
this.processChildren(children);
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
createFromLineItem(path) {
|
|
574
|
+
var _a, _b;
|
|
575
|
+
const parentComp = this.parentInjector.get(ElementRendererComponent, null);
|
|
576
|
+
const parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
|
|
577
|
+
const pathBlocks = parseBoundPath(path).reverse();
|
|
578
|
+
const { property, name } = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {};
|
|
579
|
+
const finalPath = pathBlocks[0];
|
|
580
|
+
const children$ = this.getParentLineItem$(parentComp).pipe(map$1(model => {
|
|
581
|
+
var _a;
|
|
582
|
+
if (property === 'ports' && !finalPath.property && parentPath !== path) {
|
|
583
|
+
return (_a = model.lineItems.filter(({ port }) => port === name)) !== null && _a !== void 0 ? _a : [];
|
|
584
|
+
}
|
|
585
|
+
return [model];
|
|
586
|
+
}));
|
|
587
|
+
children$.pipe(takeUntil(this.destroy$)).subscribe(children => {
|
|
588
|
+
this.processChildren(children);
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
processChildren(children) {
|
|
592
|
+
const refs = children.reduce((acc, data) => {
|
|
593
|
+
var _a;
|
|
594
|
+
const key = String((_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : UUID.UUID());
|
|
595
|
+
const ref = this.refs[key] ? this.updateComponent(key, data) : this.createComponent(data);
|
|
596
|
+
return ref ? Object.assign(Object.assign({}, acc), { [key]: ref }) : acc;
|
|
597
|
+
}, {});
|
|
598
|
+
const existingKeys = Object.keys(this.refs);
|
|
599
|
+
const newKeys = Object.keys(refs);
|
|
600
|
+
pull(existingKeys, ...newKeys).forEach(key => {
|
|
601
|
+
this.destroyComponent(key);
|
|
602
|
+
});
|
|
603
|
+
this.refs = refs;
|
|
604
|
+
this.cdr.detectChanges();
|
|
605
|
+
}
|
|
606
|
+
getParentLineItem$(parentComp) {
|
|
607
|
+
var _a;
|
|
608
|
+
const parentRefs = Object.values((_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.refs) !== null && _a !== void 0 ? _a : {});
|
|
609
|
+
const parentRef = parentRefs.find(ref => { var _a; return (_a = ref === null || ref === void 0 ? void 0 : ref.location.nativeElement) === null || _a === void 0 ? void 0 : _a.contains(this.elementRef.nativeElement); });
|
|
610
|
+
const parentModel$ = parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance.model$;
|
|
611
|
+
return parentModel$ !== null && parentModel$ !== void 0 ? parentModel$ : this.configurationService.get();
|
|
612
|
+
}
|
|
613
|
+
createComponent(data) {
|
|
614
|
+
var _a, _b;
|
|
615
|
+
if (!this.factory) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const componentRef = (_a = this.el) === null || _a === void 0 ? void 0 : _a.createComponent(this.factory);
|
|
619
|
+
if (componentRef) {
|
|
620
|
+
componentRef.location.nativeElement.setAttribute('name', this.meta.name);
|
|
621
|
+
componentRef.location.nativeElement.setAttribute('path', this.meta.path);
|
|
622
|
+
(_b = componentRef.instance) === null || _b === void 0 ? void 0 : _b.model$.next(data);
|
|
623
|
+
}
|
|
624
|
+
return componentRef;
|
|
625
|
+
}
|
|
626
|
+
updateComponent(key, data) {
|
|
627
|
+
const ref = this.refs[key];
|
|
628
|
+
ref === null || ref === void 0 ? void 0 : ref.instance.model$.next(data);
|
|
629
|
+
return ref;
|
|
630
|
+
}
|
|
631
|
+
destroyComponent(key) {
|
|
632
|
+
var _a;
|
|
633
|
+
(_a = this.refs[key]) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
634
|
+
delete this.refs[key];
|
|
635
|
+
}
|
|
636
|
+
destroyComponents() {
|
|
637
|
+
Object.values(this.refs).forEach(ref => ref === null || ref === void 0 ? void 0 : ref.destroy());
|
|
638
|
+
this.refs = {};
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: ConfigurationService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
642
|
+
ElementRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 });
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererComponent, decorators: [{
|
|
644
|
+
type: Component,
|
|
645
|
+
args: [{
|
|
646
|
+
selector: 'vl-cms-element-renderer',
|
|
647
|
+
templateUrl: './element-renderer.component.html',
|
|
648
|
+
styleUrls: ['./element-renderer.component.scss'],
|
|
649
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
650
|
+
providers: [ElementContextService],
|
|
651
|
+
}]
|
|
652
|
+
}], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
|
|
653
|
+
type: SkipSelf
|
|
654
|
+
}] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
|
|
655
|
+
type: ViewChild,
|
|
656
|
+
args: ['el', { read: ViewContainerRef, static: true }]
|
|
657
|
+
}], meta: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}] } });
|
|
660
|
+
|
|
661
|
+
class ElementChildrenComponent {
|
|
662
|
+
constructor(elementContext) {
|
|
663
|
+
this.elementContext = elementContext;
|
|
664
|
+
this.metadata = this.elementContext.metadata;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
ElementChildrenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenComponent, deps: [{ token: ElementContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
668
|
+
ElementChildrenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ElementChildrenComponent, selector: "element-children", ngImport: i0, template: "<ng-container *ngIf=\"metadata?.children.length\">\n <ng-container *ngFor=\"let child of metadata.children\">\n <vl-cms-element-renderer [meta]=\"child\"></vl-cms-element-renderer>\n </ng-container>\n</ng-container>\n", styles: [":host{display:contents}\n"], components: [{ type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenComponent, decorators: [{
|
|
670
|
+
type: Component,
|
|
671
|
+
args: [{
|
|
672
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
673
|
+
selector: 'element-children',
|
|
674
|
+
templateUrl: 'element-children.component.html',
|
|
675
|
+
styleUrls: ['./element-children.component.scss'],
|
|
676
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
677
|
+
}]
|
|
678
|
+
}], ctorParameters: function () { return [{ type: ElementContextService }]; } });
|
|
679
|
+
|
|
680
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
681
|
+
class CustomTemplateDirective {
|
|
682
|
+
constructor(templateRef, templatesService) {
|
|
683
|
+
this.templateRef = templateRef;
|
|
684
|
+
this.templatesService = templatesService;
|
|
685
|
+
}
|
|
686
|
+
ngAfterViewInit() {
|
|
687
|
+
if (!this.customTemplate) {
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
this.templatesService.register(this.customTemplate, this.templateRef);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
CustomTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: TemplatesService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
694
|
+
CustomTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0 });
|
|
695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomTemplateDirective, decorators: [{
|
|
696
|
+
type: Directive,
|
|
697
|
+
args: [{ selector: '[customTemplate]' }]
|
|
698
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
|
|
699
|
+
type: Input
|
|
700
|
+
}] } });
|
|
701
|
+
|
|
417
702
|
class ConfigurationPlugin {
|
|
418
703
|
constructor(host) {
|
|
419
704
|
this.host = host;
|
|
@@ -498,9 +783,9 @@ class ConfigurationPlugin {
|
|
|
498
783
|
return this.host;
|
|
499
784
|
}
|
|
500
785
|
}
|
|
501
|
-
ConfigurationPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
502
|
-
ConfigurationPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
786
|
+
ConfigurationPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationPlugin, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
787
|
+
ConfigurationPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ConfigurationPlugin, ngImport: i0 });
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationPlugin, decorators: [{
|
|
504
789
|
type: Directive
|
|
505
790
|
}], ctorParameters: function () { return [{ type: undefined }]; } });
|
|
506
791
|
|
|
@@ -513,6 +798,7 @@ var vlCmsModules = /*#__PURE__*/Object.freeze({
|
|
|
513
798
|
var vlCmsUtils = /*#__PURE__*/Object.freeze({
|
|
514
799
|
__proto__: null,
|
|
515
800
|
elementToMetadata: elementToMetadata,
|
|
801
|
+
metadataToElement: metadataToElement,
|
|
516
802
|
extractElementMetadata: extractElementMetadata,
|
|
517
803
|
extendElementMetadata: extendElementMetadata,
|
|
518
804
|
parseBoundPath: parseBoundPath,
|
|
@@ -545,34 +831,41 @@ const normalizeImports = (script) => {
|
|
|
545
831
|
class ScriptPlugin {
|
|
546
832
|
constructor(host) {
|
|
547
833
|
this.host = host;
|
|
548
|
-
|
|
834
|
+
this.document = this.host.injector.get(DOCUMENT);
|
|
549
835
|
const elementMetadata = this.host.injector.get(ELEMENT_METADATA);
|
|
836
|
+
const sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
|
|
837
|
+
if (sharedElementMetadata === null || sharedElementMetadata === void 0 ? void 0 : sharedElementMetadata.script) {
|
|
838
|
+
this.addScript(sharedElementMetadata.script);
|
|
839
|
+
}
|
|
550
840
|
if (elementMetadata.script) {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
841
|
+
this.addScript(elementMetadata.script);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
addScript(scriptStr) {
|
|
845
|
+
const id = btoa(UUID.UUID());
|
|
846
|
+
const script = this.document.createElement('script');
|
|
847
|
+
script.type = `text/javascript`;
|
|
848
|
+
let scriptContent = normalizeImports(scriptStr);
|
|
849
|
+
const classMatch = /export class (\S+)/.exec(scriptContent);
|
|
850
|
+
const className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
|
|
851
|
+
if (!classMatch || !className) {
|
|
852
|
+
console.error("Script doesn't have exported class");
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
scriptContent = scriptContent.replace(classMatch[0], `class ${className}`);
|
|
856
|
+
script.text = `var ${id} = function(vendor) {${scriptContent}
|
|
563
857
|
return ${className}; };`;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
document.body.removeChild(script);
|
|
858
|
+
this.document.body.appendChild(script);
|
|
859
|
+
const ScriptClass = window[id](vendorMap);
|
|
860
|
+
if (ScriptClass instanceof Object) {
|
|
861
|
+
this.host.registerPlugin(new ScriptClass(this.host));
|
|
570
862
|
}
|
|
863
|
+
this.document.body.removeChild(script);
|
|
571
864
|
}
|
|
572
865
|
}
|
|
573
|
-
ScriptPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
574
|
-
ScriptPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
866
|
+
ScriptPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ScriptPlugin, deps: [{ token: ElementComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
867
|
+
ScriptPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ScriptPlugin, ngImport: i0 });
|
|
868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ScriptPlugin, decorators: [{
|
|
576
869
|
type: Directive
|
|
577
870
|
}], ctorParameters: function () { return [{ type: ElementComponent }]; } });
|
|
578
871
|
|
|
@@ -607,9 +900,9 @@ class IOPlugin {
|
|
|
607
900
|
});
|
|
608
901
|
}
|
|
609
902
|
}
|
|
610
|
-
IOPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
611
|
-
IOPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
903
|
+
IOPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IOPlugin, deps: [{ token: ElementComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
904
|
+
IOPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: IOPlugin, ngImport: i0 });
|
|
905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IOPlugin, decorators: [{
|
|
613
906
|
type: Directive
|
|
614
907
|
}], ctorParameters: function () { return [{ type: ElementComponent }]; } });
|
|
615
908
|
|
|
@@ -621,214 +914,99 @@ const CONFIG = {
|
|
|
621
914
|
CONTAINER: {
|
|
622
915
|
component: ElementComponent,
|
|
623
916
|
template: '<element-children></element-children>',
|
|
624
|
-
plugins: [],
|
|
917
|
+
plugins: [IOPlugin],
|
|
625
918
|
},
|
|
626
919
|
SERVICE: {
|
|
627
920
|
component: ElementComponent,
|
|
628
921
|
plugins: [IOPlugin],
|
|
629
922
|
},
|
|
923
|
+
REFERENCE: {
|
|
924
|
+
component: ElementComponent,
|
|
925
|
+
plugins: [IOPlugin],
|
|
926
|
+
},
|
|
630
927
|
};
|
|
631
928
|
|
|
632
|
-
class
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
get componentFactories() {
|
|
648
|
-
return this._componentFactories;
|
|
929
|
+
class ElementsResolver {
|
|
930
|
+
constructor(uiDef, elements) {
|
|
931
|
+
this.uiDef = uiDef;
|
|
932
|
+
this.renderableElements = [];
|
|
933
|
+
this.sharedElements = [];
|
|
934
|
+
this.elements = this.transpileScripts(elements);
|
|
935
|
+
const flatElements = this.flattenElements(this.elements);
|
|
936
|
+
for (const el of flatElements) {
|
|
937
|
+
if (this.isSharedElement(el)) {
|
|
938
|
+
this.sharedElements.push(el);
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
941
|
+
this.renderableElements.push(el);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
649
944
|
}
|
|
650
|
-
|
|
651
|
-
|
|
945
|
+
transpile(el) {
|
|
946
|
+
var _a;
|
|
947
|
+
if (!el.script) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
const transformed = transform(el.script, {
|
|
951
|
+
filename: el.name + '.ts',
|
|
952
|
+
presets: ['typescript'],
|
|
953
|
+
sourceMaps: 'inline',
|
|
954
|
+
});
|
|
955
|
+
return (_a = transformed.code) !== null && _a !== void 0 ? _a : undefined;
|
|
652
956
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
DynamicModuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DynamicModuleService });
|
|
656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DynamicModuleService, decorators: [{
|
|
657
|
-
type: Injectable
|
|
658
|
-
}] });
|
|
659
|
-
|
|
660
|
-
class ElementRendererComponent {
|
|
661
|
-
constructor(parentInjector, dynamicModuleService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
|
|
662
|
-
this.parentInjector = parentInjector;
|
|
663
|
-
this.dynamicModuleService = dynamicModuleService;
|
|
664
|
-
this.elementContext = elementContext;
|
|
665
|
-
this.ioProviderService = ioProviderService;
|
|
666
|
-
this.configurationService = configurationService;
|
|
667
|
-
this.elementRef = elementRef;
|
|
668
|
-
this.cdr = cdr;
|
|
669
|
-
this.refs = {};
|
|
670
|
-
this.destroy$ = new Subject();
|
|
957
|
+
transpileScripts(elements) {
|
|
958
|
+
return elements.map(el => (Object.assign(Object.assign({}, el), { script: this.transpile(el), children: this.transpileScripts(el.children) })));
|
|
671
959
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
this.factory = this.dynamicModuleService.getComponentFactory(this.meta);
|
|
675
|
-
this.createComponents();
|
|
960
|
+
flattenElements(elements) {
|
|
961
|
+
return flatten(elements.map(el => [el, ...this.flattenElements(el.children)]));
|
|
676
962
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
this.destroy$.next();
|
|
680
|
-
this.destroy$.complete();
|
|
963
|
+
isSharedElement(el) {
|
|
964
|
+
return Boolean(el.reference) && el.type !== 'REFERENCE';
|
|
681
965
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
if (!modelMeta) {
|
|
685
|
-
this.refs[UUID.UUID()] = this.createComponent();
|
|
966
|
+
getSharedElement(element) {
|
|
967
|
+
if (element.type !== 'REFERENCE') {
|
|
686
968
|
return;
|
|
687
969
|
}
|
|
688
|
-
|
|
689
|
-
this.createFromLineItem(modelMeta.lineItem);
|
|
690
|
-
}
|
|
691
|
-
else if (modelMeta.path) {
|
|
692
|
-
this.createFromPath(modelMeta.path);
|
|
693
|
-
}
|
|
970
|
+
return this.sharedElements.find(el => element.reference === el.name);
|
|
694
971
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
972
|
+
processElementMetadata(element, sharedElement) {
|
|
973
|
+
if (element.type === 'REFERENCE') {
|
|
974
|
+
if (!sharedElement) {
|
|
975
|
+
console.warn(`Shared element "${element.reference}" not found`);
|
|
699
976
|
return;
|
|
700
977
|
}
|
|
701
|
-
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
createFromLineItem(path) {
|
|
705
|
-
var _a, _b;
|
|
706
|
-
const parentComp = this.parentInjector.get(ElementRendererComponent, null);
|
|
707
|
-
const parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
|
|
708
|
-
const pathBlocks = parseBoundPath(path).reverse();
|
|
709
|
-
const { property, name } = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {};
|
|
710
|
-
const finalPath = pathBlocks[0];
|
|
711
|
-
const children$ = this.getParentLineItem$(parentComp).pipe(map$1(model => {
|
|
712
|
-
var _a;
|
|
713
|
-
if (property === 'ports' && !finalPath.property && parentPath !== path) {
|
|
714
|
-
return (_a = model.lineItems.filter(({ port }) => port === name)) !== null && _a !== void 0 ? _a : [];
|
|
715
|
-
}
|
|
716
|
-
return [model];
|
|
717
|
-
}));
|
|
718
|
-
children$.pipe(takeUntil(this.destroy$)).subscribe(children => {
|
|
719
|
-
this.processChildren(children);
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
processChildren(children) {
|
|
723
|
-
const refs = children.reduce((acc, data) => {
|
|
724
|
-
var _a;
|
|
725
|
-
const key = String((_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : UUID.UUID());
|
|
726
|
-
const ref = this.refs[key] ? this.updateComponent(key, data) : this.createComponent(data);
|
|
727
|
-
return ref ? Object.assign(Object.assign({}, acc), { [key]: ref }) : acc;
|
|
728
|
-
}, {});
|
|
729
|
-
const existingKeys = Object.keys(this.refs);
|
|
730
|
-
const newKeys = Object.keys(refs);
|
|
731
|
-
pull(existingKeys, ...newKeys).forEach(key => {
|
|
732
|
-
this.destroyComponent(key);
|
|
733
|
-
});
|
|
734
|
-
this.refs = refs;
|
|
735
|
-
this.cdr.markForCheck();
|
|
736
|
-
}
|
|
737
|
-
getParentLineItem$(parentComp) {
|
|
738
|
-
var _a;
|
|
739
|
-
const parentRefs = Object.values((_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.refs) !== null && _a !== void 0 ? _a : {});
|
|
740
|
-
const parentRef = parentRefs.find(ref => { var _a; return (_a = ref === null || ref === void 0 ? void 0 : ref.location.nativeElement) === null || _a === void 0 ? void 0 : _a.contains(this.elementRef.nativeElement); });
|
|
741
|
-
const parentModel$ = parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance.model$;
|
|
742
|
-
return parentModel$ !== null && parentModel$ !== void 0 ? parentModel$ : this.configurationService.get();
|
|
978
|
+
return Object.assign(Object.assign({}, element), { type: sharedElement.type, template: sharedElement.template, styles: sharedElement.styles, inputs: Object.assign(Object.assign({}, sharedElement.inputs), element.inputs), outputs: Object.assign(Object.assign({}, sharedElement.outputs), element.outputs) });
|
|
979
|
+
}
|
|
980
|
+
return element;
|
|
743
981
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
982
|
+
resolveElement(sourceElement) {
|
|
983
|
+
const sharedElement = this.getSharedElement(sourceElement);
|
|
984
|
+
const element = this.processElementMetadata(sourceElement, sharedElement);
|
|
985
|
+
if (!element) {
|
|
747
986
|
return;
|
|
748
987
|
}
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
(_b = componentRef.instance) === null || _b === void 0 ? void 0 : _b.model$.next(data);
|
|
754
|
-
}
|
|
755
|
-
return componentRef;
|
|
756
|
-
}
|
|
757
|
-
updateComponent(key, data) {
|
|
758
|
-
const ref = this.refs[key];
|
|
759
|
-
ref === null || ref === void 0 ? void 0 : ref.instance.model$.next(data);
|
|
760
|
-
return ref;
|
|
761
|
-
}
|
|
762
|
-
destroyComponent(key) {
|
|
763
|
-
var _a;
|
|
764
|
-
(_a = this.refs[key]) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
765
|
-
delete this.refs[key];
|
|
766
|
-
}
|
|
767
|
-
destroyComponents() {
|
|
768
|
-
Object.values(this.refs).forEach(ref => ref === null || ref === void 0 ? void 0 : ref.destroy());
|
|
769
|
-
this.refs = {};
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: ConfigurationService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
773
|
-
ElementRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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 });
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementRendererComponent, decorators: [{
|
|
775
|
-
type: Component,
|
|
776
|
-
args: [{
|
|
777
|
-
selector: 'vl-cms-element-renderer',
|
|
778
|
-
templateUrl: './element-renderer.component.html',
|
|
779
|
-
styleUrls: ['./element-renderer.component.scss'],
|
|
780
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
781
|
-
providers: [ElementContextService],
|
|
782
|
-
}]
|
|
783
|
-
}], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
|
|
784
|
-
type: SkipSelf
|
|
785
|
-
}] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
|
|
786
|
-
type: ViewChild,
|
|
787
|
-
args: ['el', { read: ViewContainerRef, static: true }]
|
|
788
|
-
}], meta: [{
|
|
789
|
-
type: Input
|
|
790
|
-
}] } });
|
|
791
|
-
|
|
792
|
-
class ElementChildrenComponent {
|
|
793
|
-
constructor(elementContext) {
|
|
794
|
-
this.elementContext = elementContext;
|
|
795
|
-
this.metadata = this.elementContext.metadata;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
ElementChildrenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementChildrenComponent, deps: [{ token: ElementContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
799
|
-
ElementChildrenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ElementChildrenComponent, selector: "element-children", ngImport: i0, template: "<ng-container *ngIf=\"metadata?.children.length\">\n <ng-container *ngFor=\"let child of metadata.children\">\n <vl-cms-element-renderer [meta]=\"child\"></vl-cms-element-renderer>\n </ng-container>\n</ng-container>\n", styles: [":host{display:contents}\n"], components: [{ type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
800
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementChildrenComponent, decorators: [{
|
|
801
|
-
type: Component,
|
|
802
|
-
args: [{
|
|
803
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
804
|
-
selector: 'element-children',
|
|
805
|
-
templateUrl: 'element-children.component.html',
|
|
806
|
-
styleUrls: ['./element-children.component.scss'],
|
|
807
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
808
|
-
}]
|
|
809
|
-
}], ctorParameters: function () { return [{ type: ElementContextService }]; } });
|
|
810
|
-
|
|
811
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
812
|
-
class CustomTemplateDirective {
|
|
813
|
-
constructor(templateRef, templatesService) {
|
|
814
|
-
this.templateRef = templateRef;
|
|
815
|
-
this.templatesService = templatesService;
|
|
816
|
-
}
|
|
817
|
-
ngAfterViewInit() {
|
|
818
|
-
if (!this.customTemplate) {
|
|
988
|
+
const config = CONFIG[element.type];
|
|
989
|
+
const defaultPlugins = DEFAULT_PLUGINS[this.uiDef.type];
|
|
990
|
+
if (!config) {
|
|
991
|
+
console.warn(`Unknown element type "${element.type}"`);
|
|
819
992
|
return;
|
|
820
993
|
}
|
|
821
|
-
|
|
994
|
+
const component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template || config.template || '' }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
|
|
995
|
+
{ provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
|
|
996
|
+
{ provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
|
|
997
|
+
{ provide: ELEMENT_METADATA, useValue: element },
|
|
998
|
+
{ provide: SHARED_ELEMENT_METADATA, useValue: sharedElement },
|
|
999
|
+
{ provide: ELEMENT_CONFIG, useValue: config },
|
|
1000
|
+
] });
|
|
1001
|
+
const cmp = Component(component)(class C extends config.component {
|
|
1002
|
+
});
|
|
1003
|
+
set(cmp, 'path', element.path);
|
|
1004
|
+
return cmp;
|
|
1005
|
+
}
|
|
1006
|
+
getNgComponents() {
|
|
1007
|
+
return this.renderableElements.map(el => this.resolveElement(el)).filter(Boolean);
|
|
822
1008
|
}
|
|
823
1009
|
}
|
|
824
|
-
CustomTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CustomTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: TemplatesService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
825
|
-
CustomTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0 });
|
|
826
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CustomTemplateDirective, decorators: [{
|
|
827
|
-
type: Directive,
|
|
828
|
-
args: [{ selector: '[customTemplate]' }]
|
|
829
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
|
|
830
|
-
type: Input
|
|
831
|
-
}] } });
|
|
832
1010
|
|
|
833
1011
|
class LauncherService {
|
|
834
1012
|
constructor(compiler, dynamicModuleService) {
|
|
@@ -836,8 +1014,7 @@ class LauncherService {
|
|
|
836
1014
|
this.dynamicModuleService = dynamicModuleService;
|
|
837
1015
|
}
|
|
838
1016
|
compileModule(elements, uiDefs) {
|
|
839
|
-
|
|
840
|
-
this.module = this.getModule(transformedElements, uiDefs);
|
|
1017
|
+
this.module = this.getModule(elements, uiDefs);
|
|
841
1018
|
return from(this.compiler.compileModuleAndAllComponentsAsync(this.module)).pipe(tap$1(m => {
|
|
842
1019
|
this.dynamicModuleService.componentFactories = m.componentFactories;
|
|
843
1020
|
this.moduleInstance = m;
|
|
@@ -845,7 +1022,7 @@ class LauncherService {
|
|
|
845
1022
|
}
|
|
846
1023
|
destroy() {
|
|
847
1024
|
if (this.moduleInstance) {
|
|
848
|
-
this.dynamicModuleService.
|
|
1025
|
+
this.dynamicModuleService.clear();
|
|
849
1026
|
this.moduleInstance = undefined;
|
|
850
1027
|
}
|
|
851
1028
|
if (this.module) {
|
|
@@ -853,57 +1030,25 @@ class LauncherService {
|
|
|
853
1030
|
this.module = undefined;
|
|
854
1031
|
}
|
|
855
1032
|
}
|
|
856
|
-
|
|
857
|
-
const config = CONFIG[element.type];
|
|
858
|
-
const defaultPlugins = DEFAULT_PLUGINS[uiDefs.type];
|
|
859
|
-
if (!config) {
|
|
860
|
-
console.warn(`Unknown element type "${element.type}"`);
|
|
861
|
-
return;
|
|
862
|
-
}
|
|
863
|
-
const cmp = Component(Object.assign(Object.assign({ selector: 'vl-element', template: element.template || config.template || '' }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
|
|
864
|
-
{ provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
|
|
865
|
-
{ provide: UI_DEFINITION_METADATA, useValue: uiDefs },
|
|
866
|
-
{ provide: ELEMENT_METADATA, useValue: element },
|
|
867
|
-
{ provide: ELEMENT_CONFIG, useValue: config },
|
|
868
|
-
] }))(class C extends config.component {
|
|
869
|
-
});
|
|
870
|
-
set(cmp, 'path', element.path);
|
|
871
|
-
return cmp;
|
|
872
|
-
}
|
|
873
|
-
getModule(elements, uiDefs) {
|
|
1033
|
+
getModule(elements, uiDef) {
|
|
874
1034
|
const staticComponents = [ElementChildrenComponent, ElementRendererComponent, CustomTemplateDirective];
|
|
875
|
-
const
|
|
1035
|
+
const elementsResolver = new ElementsResolver(uiDef, elements);
|
|
1036
|
+
this.dynamicModuleService.elementsTree = elementsResolver.elements;
|
|
876
1037
|
let DynamicModule = class DynamicModule {
|
|
877
1038
|
};
|
|
878
1039
|
DynamicModule = __decorate([
|
|
879
1040
|
NgModule({
|
|
880
1041
|
imports: [CommonModule, ReactiveFormsModule],
|
|
881
|
-
declarations: [...staticComponents, ...
|
|
1042
|
+
declarations: [...staticComponents, ...elementsResolver.getNgComponents()],
|
|
882
1043
|
jit: true,
|
|
883
1044
|
})
|
|
884
1045
|
], DynamicModule);
|
|
885
1046
|
return DynamicModule;
|
|
886
1047
|
}
|
|
887
|
-
transformElements(elements) {
|
|
888
|
-
return flatten(elements.map(el => {
|
|
889
|
-
var _a;
|
|
890
|
-
const children = this.transformElements(el.children);
|
|
891
|
-
if (!el.script) {
|
|
892
|
-
return [el, ...children];
|
|
893
|
-
}
|
|
894
|
-
const transformed = transform(el.script, {
|
|
895
|
-
filename: el.name + '.ts',
|
|
896
|
-
presets: ['typescript'],
|
|
897
|
-
sourceMaps: 'inline',
|
|
898
|
-
});
|
|
899
|
-
const script = (_a = transformed.code) !== null && _a !== void 0 ? _a : undefined;
|
|
900
|
-
return [Object.assign(Object.assign({}, el), { script }), ...children];
|
|
901
|
-
}));
|
|
902
|
-
}
|
|
903
1048
|
}
|
|
904
|
-
LauncherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
905
|
-
LauncherService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
906
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1049
|
+
LauncherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherService, deps: [{ token: i0.Compiler }, { token: DynamicModuleService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1050
|
+
LauncherService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherService });
|
|
1051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherService, decorators: [{
|
|
907
1052
|
type: Injectable
|
|
908
1053
|
}], ctorParameters: function () { return [{ type: i0.Compiler }, { type: DynamicModuleService }]; } });
|
|
909
1054
|
|
|
@@ -951,9 +1096,9 @@ class PreviewComponent {
|
|
|
951
1096
|
.subscribe();
|
|
952
1097
|
}
|
|
953
1098
|
}
|
|
954
|
-
PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
955
|
-
PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1099
|
+
PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewComponent, deps: [{ token: LauncherService }, { token: ConfigurationService }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1100
|
+
PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition" }, providers: [IOProviderService, ConfigurationService, TemplatesService], ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-element-renderer *ngFor=\"let el of elements\" [meta]=\"el\"></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: i4.LoaderComponent, selector: "vl-loader", inputs: ["label"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewComponent, decorators: [{
|
|
957
1102
|
type: Component,
|
|
958
1103
|
args: [{
|
|
959
1104
|
selector: 'vl-cms-preview',
|
|
@@ -970,10 +1115,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
970
1115
|
|
|
971
1116
|
class ElementRendererModule {
|
|
972
1117
|
}
|
|
973
|
-
ElementRendererModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
974
|
-
ElementRendererModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
975
|
-
ElementRendererModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1118
|
+
ElementRendererModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1119
|
+
ElementRendererModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererModule, declarations: [ElementRendererComponent], exports: [ElementRendererComponent] });
|
|
1120
|
+
ElementRendererModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererModule });
|
|
1121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementRendererModule, decorators: [{
|
|
977
1122
|
type: NgModule,
|
|
978
1123
|
args: [{
|
|
979
1124
|
declarations: [ElementRendererComponent],
|
|
@@ -983,10 +1128,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
983
1128
|
|
|
984
1129
|
class ElementChildrenModule {
|
|
985
1130
|
}
|
|
986
|
-
ElementChildrenModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
987
|
-
ElementChildrenModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
988
|
-
ElementChildrenModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
989
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1131
|
+
ElementChildrenModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1132
|
+
ElementChildrenModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenModule, declarations: [ElementChildrenComponent], imports: [ElementRendererModule], exports: [ElementChildrenComponent] });
|
|
1133
|
+
ElementChildrenModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenModule, imports: [[ElementRendererModule]] });
|
|
1134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ElementChildrenModule, decorators: [{
|
|
990
1135
|
type: NgModule,
|
|
991
1136
|
args: [{
|
|
992
1137
|
declarations: [ElementChildrenComponent],
|
|
@@ -997,10 +1142,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
997
1142
|
|
|
998
1143
|
class PreviewModule {
|
|
999
1144
|
}
|
|
1000
|
-
PreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
1001
|
-
PreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
1002
|
-
PreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
1003
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1145
|
+
PreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1146
|
+
PreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewModule, declarations: [PreviewComponent], imports: [CommonModule, LoaderModule, ElementRendererModule, ElementChildrenModule], exports: [PreviewComponent] });
|
|
1147
|
+
PreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewModule, imports: [[CommonModule, LoaderModule, ElementRendererModule, ElementChildrenModule]] });
|
|
1148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PreviewModule, decorators: [{
|
|
1004
1149
|
type: NgModule,
|
|
1005
1150
|
args: [{
|
|
1006
1151
|
declarations: [PreviewComponent],
|
|
@@ -1017,10 +1162,10 @@ function ElementDefinition(definition) {
|
|
|
1017
1162
|
|
|
1018
1163
|
class ConfigurationModule {
|
|
1019
1164
|
}
|
|
1020
|
-
ConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
1021
|
-
ConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
1022
|
-
ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
1023
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1165
|
+
ConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1166
|
+
ConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationModule });
|
|
1167
|
+
ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationModule, providers: [ContextService, ContextApiService, ProductModelApiService, ConfigurationApiService] });
|
|
1168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationModule, decorators: [{
|
|
1024
1169
|
type: NgModule,
|
|
1025
1170
|
args: [{
|
|
1026
1171
|
providers: [ContextService, ContextApiService, ProductModelApiService, ConfigurationApiService],
|
|
@@ -1029,10 +1174,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
1029
1174
|
|
|
1030
1175
|
class LauncherModule {
|
|
1031
1176
|
}
|
|
1032
|
-
LauncherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
1033
|
-
LauncherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
1034
|
-
LauncherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
1035
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1177
|
+
LauncherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1178
|
+
LauncherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherModule, imports: [CommonModule, CoreModule, ConfigurationModule] });
|
|
1179
|
+
LauncherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherModule, providers: [LauncherService, DynamicModuleService], imports: [[CommonModule, CoreModule, ConfigurationModule]] });
|
|
1180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LauncherModule, decorators: [{
|
|
1036
1181
|
type: NgModule,
|
|
1037
1182
|
args: [{
|
|
1038
1183
|
imports: [CommonModule, CoreModule, ConfigurationModule],
|
|
@@ -1044,5 +1189,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
1044
1189
|
* Generated bundle index. Do not edit.
|
|
1045
1190
|
*/
|
|
1046
1191
|
|
|
1047
|
-
export { ConfigurationService, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, LauncherModule, LauncherService, LineItemWorker, PreviewComponent, PreviewModule, TemplatesService, UI_DEFINITION_METADATA, elementToMetadata, extendElementMetadata, extractElementMetadata, findLineItem, generateLineItem, getAttributeValue, getAttributes, getDefaultLineItem, getRecommendedPrices, insertLineItem, mapAttributes, parseBoundPath, patchAttributes, removeLineItem, replaceLineItem, upsertAttributes };
|
|
1192
|
+
export { ConfigurationService, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, LauncherModule, LauncherService, LineItemWorker, PreviewComponent, PreviewModule, SHARED_ELEMENT_METADATA, TemplatesService, UI_DEFINITION_METADATA, elementToMetadata, extendElementMetadata, extractElementMetadata, findLineItem, generateLineItem, getAttributeValue, getAttributes, getDefaultLineItem, getRecommendedPrices, insertLineItem, mapAttributes, metadataToElement, parseBoundPath, patchAttributes, removeLineItem, replaceLineItem, upsertAttributes };
|
|
1048
1193
|
//# sourceMappingURL=veloce-sdk-cms.js.map
|