@veloceapps/sdk 7.0.0-8 → 7.0.1-0
Sign up to get free protection for your applications and to get access to all the features.
- package/cms/README.md +45 -0
- package/cms/cms.actions.d.ts +10 -0
- package/cms/components/element-children/element-children.component.d.ts +1 -1
- package/cms/components/element-drop-handle/element-drop-handle.component.d.ts +1 -1
- package/cms/components/element-renderer/element-renderer.component.d.ts +1 -1
- package/cms/components/plugin.component.d.ts +2 -2
- package/cms/components/preview/preview.component.d.ts +4 -3
- package/cms/directives/custom-template.directive.d.ts +1 -1
- package/cms/modules/federated/federated-host.directive.d.ts +8 -0
- package/cms/modules/federated/federated.component.d.ts +5 -7
- package/cms/modules/federated/federated.module.d.ts +4 -3
- package/cms/modules/federated/federated.types.d.ts +1 -5
- package/cms/modules/migrations/types/migrations.types.d.ts +1 -1
- package/cms/plugins/configuration.plugin.d.ts +1 -1
- package/cms/plugins/io.plugin.d.ts +1 -1
- package/cms/plugins/region.plugin.d.ts +1 -1
- package/cms/plugins/script.plugin.d.ts +1 -1
- package/cms/services/templates.service.d.ts +1 -1
- package/cms/types/common.types.d.ts +2 -2
- package/cms/types/elements.types.d.ts +1 -1
- package/cms/types/integration.types.d.ts +1 -1
- package/cms/types/layouts.types.d.ts +1 -1
- package/cms/utils/element.utils.d.ts +2 -2
- package/cms/vendor-map.d.ts +2 -1
- package/core/README.md +5 -0
- package/core/modules/flow-configuration/types/update.types.d.ts +2 -2
- package/core/services/metric-calculation/metric-calculation.types.d.ts +1 -1
- package/core/types/ui-definition.types.d.ts +2 -2
- package/esm2020/cms/cms.actions.mjs +56 -0
- package/esm2020/cms/components/element-children/element-children.component.mjs +35 -0
- package/esm2020/cms/components/element-children/element-children.module.mjs +20 -0
- package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +28 -0
- package/esm2020/cms/components/element-drop-handle/element-drop-handle.module.mjs +19 -0
- package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +160 -0
- package/{esm2015/cms/components/element-renderer/element-renderer.module.js → esm2020/cms/components/element-renderer/element-renderer.module.mjs} +5 -5
- package/esm2020/cms/components/element.component.mjs +45 -0
- package/esm2020/cms/components/plugin.component.mjs +17 -0
- package/esm2020/cms/components/preview/preview.component.mjs +103 -0
- package/esm2020/cms/components/preview/preview.module.mjs +24 -0
- package/esm2020/cms/directives/custom-template.directive.mjs +26 -0
- package/esm2020/cms/engine/models/entity.mjs +17 -0
- package/esm2020/cms/launcher.module.mjs +24 -0
- package/esm2020/cms/modules/federated/federated-host.directive.mjs +16 -0
- package/esm2020/cms/modules/federated/federated.component.mjs +64 -0
- package/esm2020/cms/modules/federated/federated.module.mjs +20 -0
- package/esm2020/cms/modules/federated/federated.types.mjs +2 -0
- package/esm2020/cms/modules/migrations/migrations.mjs +15 -0
- package/{esm2015/cms/modules/migrations/migrations.module.js → esm2020/cms/modules/migrations/migrations.module.mjs} +5 -5
- package/esm2020/cms/modules/migrations/services/migrations.service.mjs +43 -0
- package/{esm2015/cms/modules/runtime/runtime.module.js → esm2020/cms/modules/runtime/runtime.module.mjs} +6 -6
- package/esm2020/cms/modules/runtime/services/compilation.service.mjs +83 -0
- package/esm2020/cms/modules/runtime/services/runtime-editor.service.mjs +28 -0
- package/esm2020/cms/modules/runtime/services/runtime.service.mjs +74 -0
- package/esm2020/cms/plugins/configuration.plugin.mjs +105 -0
- package/esm2020/cms/plugins/io.plugin.mjs +36 -0
- package/esm2020/cms/plugins/region.plugin.mjs +58 -0
- package/esm2020/cms/plugins/script.plugin.mjs +65 -0
- package/{esm2015/cms/services/element-context.service.js → esm2020/cms/services/element-context.service.mjs} +4 -4
- package/esm2020/cms/services/integration.state.mjs +40 -0
- package/esm2020/cms/services/io-provider.service.mjs +50 -0
- package/esm2020/cms/services/resources.service.mjs +49 -0
- package/{esm2015/cms/services/templates.service.js → esm2020/cms/services/templates.service.mjs} +4 -4
- package/esm2020/cms/utils/element.utils.mjs +160 -0
- package/esm2020/cms/utils/elements-resolver.mjs +189 -0
- package/esm2020/cms/utils/path.utils.mjs +53 -0
- package/esm2020/cms/utils/ui-definition.utils.mjs +87 -0
- package/esm2020/cms/vendor-map.mjs +67 -0
- package/esm2020/core/core.module.mjs +18 -0
- package/{esm2015/core/modules/configuration/configuration.module.js → esm2020/core/modules/configuration/configuration.module.mjs} +6 -6
- package/esm2020/core/modules/configuration/helpers.mjs +18 -0
- package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +106 -0
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +183 -0
- package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +50 -0
- package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +18 -0
- package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +150 -0
- package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +129 -0
- package/esm2020/core/services/context.service.mjs +64 -0
- package/esm2020/core/services/metric-calculation/metric-calculation.service.mjs +85 -0
- package/esm2020/core/services/product-images.service.mjs +31 -0
- package/esm2020/core/services/quote-draft.service.mjs +232 -0
- package/esm2020/core/utils/line-item.utils.mjs +161 -0
- package/esm2020/core/utils/line-item.worker.mjs +19 -0
- package/esm2020/runtime/components/component-preview/component-preview.component.mjs +125 -0
- package/esm2020/runtime/components/section-renderer/section-renderer.component.mjs +67 -0
- package/esm2020/runtime/components/ui-runtime/runtime.component.mjs +440 -0
- package/esm2020/runtime/components/ui-runtime-preview/runtime-preview.component.mjs +108 -0
- package/esm2020/runtime/execution/components/children-placeholder/children-placeholder.component.mjs +60 -0
- package/esm2020/runtime/execution/components/context-provider/context-provider.component.mjs +39 -0
- package/esm2020/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.mjs +67 -0
- package/esm2020/runtime/execution/components/federated/federated.component.mjs +74 -0
- package/esm2020/runtime/execution/components/velo-attribute/velo-attribute.component.mjs +60 -0
- package/esm2020/runtime/execution/components/velo-multiselect/velo-multiselect.component.mjs +130 -0
- package/esm2020/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.mjs +72 -0
- package/esm2020/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.mjs +97 -0
- package/esm2020/runtime/execution/components/velo-port-radio/velo-port-radio.component.mjs +142 -0
- package/esm2020/runtime/execution/components/velo-type/velo-type.component.mjs +119 -0
- package/esm2020/runtime/execution/directives/section-script.directive.mjs +247 -0
- package/esm2020/runtime/execution/directives/sf-query.directive.mjs +35 -0
- package/esm2020/runtime/execution/directives/velo-attribute.directive.mjs +88 -0
- package/esm2020/runtime/execution/directives/velo-port.directive.mjs +376 -0
- package/esm2020/runtime/execution/directives/vl-approval.directive.mjs +23 -0
- package/esm2020/runtime/execution/directives/vl-document-attachments.directive.mjs +36 -0
- package/esm2020/runtime/execution/directives/vl-document-templates.directive.mjs +60 -0
- package/esm2020/runtime/execution/directives/vl-quote.directive.mjs +42 -0
- package/esm2020/runtime/execution/directives/vl-ramp.directive.mjs +55 -0
- package/esm2020/runtime/execution/runtime-execution.module.mjs +133 -0
- package/esm2020/runtime/execution/utils/federated.util.mjs +32 -0
- package/esm2020/runtime/runtime.module.mjs +74 -0
- package/esm2020/runtime/services/cart.service.mjs +29 -0
- package/{esm2015/runtime/services/collapsible-state.service.js → esm2020/runtime/services/collapsible-state.service.mjs} +4 -4
- package/esm2020/runtime/services/configuration.service.mjs +119 -0
- package/{esm2015/runtime/services/current-state.service.js → esm2020/runtime/services/current-state.service.mjs} +4 -4
- package/{esm2015/runtime/services/form-scope.service.js → esm2020/runtime/services/form-scope.service.mjs} +4 -4
- package/esm2020/runtime/services/product-model-cache.service.mjs +31 -0
- package/esm2020/runtime/services/runtime-context.service.mjs +57 -0
- package/esm2020/runtime/services/runtime-form.service.mjs +219 -0
- package/esm2020/runtime/services/runtime.service.mjs +115 -0
- package/{esm2015/runtime/services/section-helper.service.js → esm2020/runtime/services/section-helper.service.mjs} +4 -4
- package/{esm2015/runtime/services/section-scope.service.js → esm2020/runtime/services/section-scope.service.mjs} +4 -4
- package/{esm2015/runtime/services/section-store.service.js → esm2020/runtime/services/section-store.service.mjs} +4 -4
- package/esm2020/runtime/services/section.service.mjs +117 -0
- package/esm2020/runtime/types/script-registry.types.mjs +51 -0
- package/esm2020/runtime/utils/line-item.util.mjs +270 -0
- package/esm2020/src/components/dialog/dialog.component.mjs +36 -0
- package/esm2020/src/components/dialog/dialog.module.mjs +19 -0
- package/esm2020/src/components/doc-gen/doc-gen.component.mjs +107 -0
- package/esm2020/src/components/doc-gen/doc-gen.module.mjs +19 -0
- package/esm2020/src/components/header/cart-overlay/cart-preview.component.mjs +120 -0
- package/{esm2015/src/components/header/cart-overlay/cart-preview.module.js → esm2020/src/components/header/cart-overlay/cart-preview.module.mjs} +11 -13
- package/esm2020/src/components/header/header.component.mjs +333 -0
- package/{esm2015/src/components/header/header.module.js → esm2020/src/components/header/header.module.mjs} +12 -14
- package/esm2020/src/components/header/metrics/metrics.component.mjs +227 -0
- package/{esm2015/src/components/header/metrics/metrics.module.js → esm2020/src/components/header/metrics/metrics.module.mjs} +17 -19
- package/{esm2015/src/flow-routing.module.js → esm2020/src/flow-routing.module.mjs} +12 -14
- package/esm2020/src/flow.component.mjs +45 -0
- package/esm2020/src/flow.module.mjs +58 -0
- package/esm2020/src/guards/context.guard.mjs +93 -0
- package/esm2020/src/guards/product-unload.guard.mjs +46 -0
- package/esm2020/src/guards/root.guard.mjs +42 -0
- package/esm2020/src/pages/assets/assets.component.mjs +111 -0
- package/esm2020/src/pages/assets/assets.module.mjs +20 -0
- package/esm2020/src/pages/catalog/catalog.component.mjs +111 -0
- package/esm2020/src/pages/catalog/catalog.module.mjs +20 -0
- package/esm2020/src/pages/debug/debug.component.mjs +62 -0
- package/{esm2015/src/pages/debug/debug.module.js → esm2020/src/pages/debug/debug.module.mjs} +12 -14
- package/esm2020/src/pages/empty-account/empty-account.component.mjs +12 -0
- package/esm2020/src/pages/empty-account/empty-account.module.mjs +20 -0
- package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +137 -0
- package/esm2020/src/pages/legacy-product/legacy-product.module.mjs +19 -0
- package/esm2020/src/pages/product/product.component.mjs +94 -0
- package/esm2020/src/pages/product/product.module.mjs +20 -0
- package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +25 -0
- package/esm2020/src/pages/record-not-found/record-not-found.module.mjs +20 -0
- package/esm2020/src/pages/remote/remote.component.mjs +342 -0
- package/esm2020/src/pages/remote/remote.module.mjs +20 -0
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +111 -0
- package/esm2020/src/pages/shopping-cart/shopping-cart.module.mjs +20 -0
- package/esm2020/src/resolvers/flow.resolver.mjs +70 -0
- package/esm2020/src/resolvers/quote.resolver.mjs +90 -0
- package/esm2020/src/services/doc-gen.service.mjs +33 -0
- package/esm2020/src/services/flow-dialog.service.mjs +126 -0
- package/esm2020/src/services/flow-router.service.mjs +144 -0
- package/esm2020/src/services/flow.service.mjs +86 -0
- package/esm2020/src/utils/flow.utils.mjs +21 -0
- package/fesm2015/{veloceapps-sdk-cms.js → veloceapps-sdk-cms.mjs} +178 -207
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -0
- package/fesm2015/{veloceapps-sdk-core.js → veloceapps-sdk-core.mjs} +76 -76
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -0
- package/fesm2015/{veloceapps-sdk-runtime.js → veloceapps-sdk-runtime.mjs} +242 -370
- package/fesm2015/veloceapps-sdk-runtime.mjs.map +1 -0
- package/fesm2015/veloceapps-sdk.mjs +2877 -0
- package/fesm2015/veloceapps-sdk.mjs.map +1 -0
- package/fesm2020/veloceapps-sdk-cms.mjs +2036 -0
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -0
- package/fesm2020/veloceapps-sdk-core.mjs +1289 -0
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -0
- package/fesm2020/veloceapps-sdk-runtime.mjs +3764 -0
- package/fesm2020/veloceapps-sdk-runtime.mjs.map +1 -0
- package/fesm2020/veloceapps-sdk.mjs +2857 -0
- package/fesm2020/veloceapps-sdk.mjs.map +1 -0
- package/package.json +59 -33
- package/runtime/README.md +5 -0
- package/runtime/components/component-preview/component-preview.component.d.ts +2 -2
- package/runtime/components/section-renderer/section-renderer.component.d.ts +1 -1
- package/runtime/components/ui-runtime/runtime.component.d.ts +1 -1
- package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +1 -1
- package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +2 -2
- package/runtime/execution/components/context-provider/context-provider.component.d.ts +1 -1
- package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +1 -1
- package/runtime/execution/components/federated/federated.component.d.ts +1 -1
- package/runtime/execution/components/velo-attribute/velo-attribute.component.d.ts +1 -1
- package/runtime/execution/components/velo-multiselect/velo-multiselect.component.d.ts +1 -1
- package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +1 -1
- package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +1 -1
- package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +1 -1
- package/runtime/execution/components/velo-type/velo-type.component.d.ts +1 -1
- package/runtime/execution/directives/section-script.directive.d.ts +1 -1
- package/runtime/execution/directives/sf-query.directive.d.ts +1 -1
- package/runtime/execution/directives/velo-attribute.directive.d.ts +1 -1
- package/runtime/execution/directives/velo-port.directive.d.ts +6 -6
- package/runtime/execution/directives/vl-approval.directive.d.ts +1 -1
- package/runtime/execution/directives/vl-document-attachments.directive.d.ts +1 -1
- package/runtime/execution/directives/vl-document-templates.directive.d.ts +1 -1
- package/runtime/execution/directives/vl-quote.directive.d.ts +1 -1
- package/runtime/execution/directives/vl-ramp.directive.d.ts +1 -1
- package/runtime/execution/runtime-execution.module.d.ts +3 -5
- package/runtime/execution/utils/federated.util.d.ts +1 -1
- package/runtime/runtime.module.d.ts +3 -5
- package/runtime/services/section.service.d.ts +1 -1
- package/src/components/dialog/dialog.component.d.ts +1 -1
- package/src/components/doc-gen/doc-gen.component.d.ts +1 -1
- package/src/components/header/cart-overlay/cart-preview.component.d.ts +2 -2
- package/src/components/header/header.component.d.ts +1 -1
- package/src/components/header/metrics/metrics.component.d.ts +1 -1
- package/src/flow.component.d.ts +1 -1
- 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 +5 -3
- package/src/pages/empty-account/empty-account.component.d.ts +1 -1
- package/src/pages/legacy-product/legacy-product.component.d.ts +1 -1
- package/src/pages/legacy-product/legacy-product.module.d.ts +1 -2
- package/src/pages/product/product.component.d.ts +1 -1
- package/src/pages/record-not-found/record-not-found.component.d.ts +1 -1
- package/src/pages/remote/remote.component.d.ts +1 -1
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +1 -1
- package/bundles/veloceapps-sdk-cms.umd.js +0 -2531
- package/bundles/veloceapps-sdk-cms.umd.js.map +0 -1
- package/bundles/veloceapps-sdk-core.umd.js +0 -1916
- package/bundles/veloceapps-sdk-core.umd.js.map +0 -1
- package/bundles/veloceapps-sdk-runtime.umd.js +0 -4415
- package/bundles/veloceapps-sdk-runtime.umd.js.map +0 -1
- package/bundles/veloceapps-sdk.umd.js +0 -3583
- package/bundles/veloceapps-sdk.umd.js.map +0 -1
- package/cms/modules/federated/federated.utils.d.ts +0 -1
- package/cms/package.json +0 -10
- package/cms/veloceapps-sdk-cms.d.ts +0 -5
- package/core/package.json +0 -10
- package/core/veloceapps-sdk-core.d.ts +0 -5
- package/esm2015/cms/cms.actions.js +0 -42
- package/esm2015/cms/components/element-children/element-children.component.js +0 -39
- package/esm2015/cms/components/element-children/element-children.module.js +0 -20
- package/esm2015/cms/components/element-drop-handle/element-drop-handle.component.js +0 -32
- package/esm2015/cms/components/element-drop-handle/element-drop-handle.module.js +0 -19
- package/esm2015/cms/components/element-renderer/element-renderer.component.js +0 -169
- package/esm2015/cms/components/element.component.js +0 -44
- package/esm2015/cms/components/plugin.component.js +0 -16
- package/esm2015/cms/components/preview/preview.component.js +0 -93
- package/esm2015/cms/components/preview/preview.module.js +0 -24
- package/esm2015/cms/directives/custom-template.directive.js +0 -25
- package/esm2015/cms/engine/models/entity.js +0 -18
- package/esm2015/cms/launcher.module.js +0 -24
- package/esm2015/cms/modules/federated/federated.component.js +0 -82
- package/esm2015/cms/modules/federated/federated.module.js +0 -19
- package/esm2015/cms/modules/federated/federated.types.js +0 -2
- package/esm2015/cms/modules/federated/federated.utils.js +0 -37
- package/esm2015/cms/modules/migrations/migrations.js +0 -11
- package/esm2015/cms/modules/migrations/services/migrations.service.js +0 -43
- package/esm2015/cms/modules/runtime/services/compilation.service.js +0 -84
- package/esm2015/cms/modules/runtime/services/runtime-editor.service.js +0 -27
- package/esm2015/cms/modules/runtime/services/runtime.service.js +0 -74
- package/esm2015/cms/plugins/configuration.plugin.js +0 -106
- package/esm2015/cms/plugins/io.plugin.js +0 -37
- package/esm2015/cms/plugins/region.plugin.js +0 -58
- package/esm2015/cms/plugins/script.plugin.js +0 -66
- package/esm2015/cms/services/integration.state.js +0 -40
- package/esm2015/cms/services/io-provider.service.js +0 -51
- package/esm2015/cms/services/resources.service.js +0 -50
- package/esm2015/cms/utils/element.utils.js +0 -157
- package/esm2015/cms/utils/elements-resolver.js +0 -163
- package/esm2015/cms/utils/path.utils.js +0 -56
- package/esm2015/cms/utils/ui-definition.utils.js +0 -82
- package/esm2015/cms/vendor-map.js +0 -51
- package/esm2015/core/core.module.js +0 -18
- package/esm2015/core/modules/configuration/helpers.js +0 -10
- package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +0 -87
- package/esm2015/core/modules/configuration/services/configuration.service.js +0 -177
- package/esm2015/core/modules/configuration/services/runtime-context.service.js +0 -51
- package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +0 -18
- package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +0 -150
- package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +0 -129
- package/esm2015/core/services/context.service.js +0 -53
- package/esm2015/core/services/metric-calculation/metric-calculation.service.js +0 -83
- package/esm2015/core/services/product-images.service.js +0 -30
- package/esm2015/core/services/quote-draft.service.js +0 -217
- package/esm2015/core/utils/line-item.utils.js +0 -143
- package/esm2015/core/utils/line-item.worker.js +0 -19
- package/esm2015/runtime/components/component-preview/component-preview.component.js +0 -125
- package/esm2015/runtime/components/section-renderer/section-renderer.component.js +0 -71
- package/esm2015/runtime/components/ui-runtime/runtime.component.js +0 -429
- package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +0 -109
- package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +0 -68
- package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +0 -36
- package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +0 -72
- package/esm2015/runtime/execution/components/federated/federated.component.js +0 -81
- package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +0 -65
- package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +0 -136
- package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +0 -80
- package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +0 -101
- package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +0 -150
- package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +0 -121
- package/esm2015/runtime/execution/directives/section-script.directive.js +0 -242
- package/esm2015/runtime/execution/directives/sf-query.directive.js +0 -34
- package/esm2015/runtime/execution/directives/velo-attribute.directive.js +0 -86
- package/esm2015/runtime/execution/directives/velo-port.directive.js +0 -373
- package/esm2015/runtime/execution/directives/vl-approval.directive.js +0 -22
- package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +0 -35
- package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +0 -59
- package/esm2015/runtime/execution/directives/vl-quote.directive.js +0 -41
- package/esm2015/runtime/execution/directives/vl-ramp.directive.js +0 -51
- package/esm2015/runtime/execution/runtime-execution.module.js +0 -163
- package/esm2015/runtime/execution/utils/federated.util.js +0 -37
- package/esm2015/runtime/runtime.module.js +0 -104
- package/esm2015/runtime/services/cart.service.js +0 -27
- package/esm2015/runtime/services/configuration.service.js +0 -101
- package/esm2015/runtime/services/product-model-cache.service.js +0 -30
- package/esm2015/runtime/services/runtime-context.service.js +0 -56
- package/esm2015/runtime/services/runtime-form.service.js +0 -224
- package/esm2015/runtime/services/runtime.service.js +0 -108
- package/esm2015/runtime/services/section.service.js +0 -124
- package/esm2015/runtime/types/script-registry.types.js +0 -51
- package/esm2015/runtime/utils/line-item.util.js +0 -273
- package/esm2015/src/components/dialog/dialog.component.js +0 -40
- package/esm2015/src/components/dialog/dialog.module.js +0 -19
- package/esm2015/src/components/doc-gen/doc-gen.component.js +0 -109
- package/esm2015/src/components/doc-gen/doc-gen.module.js +0 -19
- package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +0 -122
- package/esm2015/src/components/header/header.component.js +0 -336
- package/esm2015/src/components/header/metrics/metrics.component.js +0 -232
- package/esm2015/src/flow.component.js +0 -45
- package/esm2015/src/flow.module.js +0 -60
- package/esm2015/src/guards/context.guard.js +0 -84
- package/esm2015/src/guards/product-unload.guard.js +0 -43
- package/esm2015/src/guards/root.guard.js +0 -41
- package/esm2015/src/pages/assets/assets.component.js +0 -117
- package/esm2015/src/pages/assets/assets.module.js +0 -20
- package/esm2015/src/pages/catalog/catalog.component.js +0 -117
- package/esm2015/src/pages/catalog/catalog.module.js +0 -20
- package/esm2015/src/pages/debug/debug.component.js +0 -61
- package/esm2015/src/pages/empty-account/empty-account.component.js +0 -17
- package/esm2015/src/pages/empty-account/empty-account.module.js +0 -20
- package/esm2015/src/pages/legacy-product/legacy-product.component.js +0 -132
- package/esm2015/src/pages/legacy-product/legacy-product.module.js +0 -21
- package/esm2015/src/pages/product/product.component.js +0 -101
- package/esm2015/src/pages/product/product.module.js +0 -20
- package/esm2015/src/pages/record-not-found/record-not-found.component.js +0 -29
- package/esm2015/src/pages/record-not-found/record-not-found.module.js +0 -20
- package/esm2015/src/pages/remote/remote.component.js +0 -350
- package/esm2015/src/pages/remote/remote.module.js +0 -20
- package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +0 -117
- package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +0 -20
- package/esm2015/src/resolvers/flow.resolver.js +0 -62
- package/esm2015/src/resolvers/quote.resolver.js +0 -88
- package/esm2015/src/services/doc-gen.service.js +0 -33
- package/esm2015/src/services/flow-dialog.service.js +0 -124
- package/esm2015/src/services/flow-router.service.js +0 -144
- package/esm2015/src/services/flow.service.js +0 -84
- package/esm2015/src/utils/flow.utils.js +0 -22
- package/fesm2015/veloceapps-sdk-cms.js.map +0 -1
- package/fesm2015/veloceapps-sdk-core.js.map +0 -1
- package/fesm2015/veloceapps-sdk-runtime.js.map +0 -1
- package/fesm2015/veloceapps-sdk.js +0 -2953
- package/fesm2015/veloceapps-sdk.js.map +0 -1
- package/runtime/package.json +0 -10
- package/runtime/veloceapps-sdk-runtime.d.ts +0 -5
- package/veloceapps-sdk.d.ts +0 -5
- /package/{esm2015/cms/cms.default.js → esm2020/cms/cms.default.mjs} +0 -0
- /package/{esm2015/cms/cms.elements.js → esm2020/cms/cms.elements.mjs} +0 -0
- /package/{esm2015/cms/cms.layouts.js → esm2020/cms/cms.layouts.mjs} +0 -0
- /package/{esm2015/cms/components/index.js → esm2020/cms/components/index.mjs} +0 -0
- /package/{esm2015/cms/components/preview/index.js → esm2020/cms/components/preview/index.mjs} +0 -0
- /package/{esm2015/cms/components/preview/preview.types.js → esm2020/cms/components/preview/preview.types.mjs} +0 -0
- /package/{esm2015/cms/decorators/element.decorator.js → esm2020/cms/decorators/element.decorator.mjs} +0 -0
- /package/{esm2015/cms/decorators/index.js → esm2020/cms/decorators/index.mjs} +0 -0
- /package/{esm2015/cms/engine/models/plugin.js → esm2020/cms/engine/models/plugin.mjs} +0 -0
- /package/{esm2015/cms/index.js → esm2020/cms/index.mjs} +0 -0
- /package/{esm2015/cms/injection-tokens.js → esm2020/cms/injection-tokens.mjs} +0 -0
- /package/{esm2015/cms/modules/federated/default-options.js → esm2020/cms/modules/federated/default-options.mjs} +0 -0
- /package/{esm2015/cms/modules/federated/export.js → esm2020/cms/modules/federated/export.mjs} +0 -0
- /package/{esm2015/cms/modules/migrations/index.js → esm2020/cms/modules/migrations/index.mjs} +0 -0
- /package/{esm2015/cms/modules/migrations/types/migrations.types.js → esm2020/cms/modules/migrations/types/migrations.types.mjs} +0 -0
- /package/{esm2015/cms/modules/runtime/index.js → esm2020/cms/modules/runtime/index.mjs} +0 -0
- /package/{esm2015/cms/modules/runtime/tokens.js → esm2020/cms/modules/runtime/tokens.mjs} +0 -0
- /package/{esm2015/cms/modules/runtime/types/compilation.types.js → esm2020/cms/modules/runtime/types/compilation.types.mjs} +0 -0
- /package/{esm2015/cms/modules/runtime/types/runtime.actions.js → esm2020/cms/modules/runtime/types/runtime.actions.mjs} +0 -0
- /package/{esm2015/cms/services/index.js → esm2020/cms/services/index.mjs} +0 -0
- /package/{esm2015/cms/types/common.types.js → esm2020/cms/types/common.types.mjs} +0 -0
- /package/{esm2015/cms/types/configuration.types.js → esm2020/cms/types/configuration.types.mjs} +0 -0
- /package/{esm2015/cms/types/elements.types.js → esm2020/cms/types/elements.types.mjs} +0 -0
- /package/{esm2015/cms/types/index.js → esm2020/cms/types/index.mjs} +0 -0
- /package/{esm2015/cms/types/integration.types.js → esm2020/cms/types/integration.types.mjs} +0 -0
- /package/{esm2015/cms/types/layouts.types.js → esm2020/cms/types/layouts.types.mjs} +0 -0
- /package/{esm2015/cms/types/path.types.js → esm2020/cms/types/path.types.mjs} +0 -0
- /package/{esm2015/cms/utils/index.js → esm2020/cms/utils/index.mjs} +0 -0
- /package/{esm2015/cms/veloceapps-sdk-cms.js → esm2020/cms/veloceapps-sdk-cms.mjs} +0 -0
- /package/{esm2015/core/index.js → esm2020/core/index.mjs} +0 -0
- /package/{esm2015/core/modules/configuration/index.js → esm2020/core/modules/configuration/index.mjs} +0 -0
- /package/{esm2015/core/modules/configuration/types/configuration-runtime.types.js → esm2020/core/modules/configuration/types/configuration-runtime.types.mjs} +0 -0
- /package/{esm2015/core/modules/flow-configuration/index.js → esm2020/core/modules/flow-configuration/index.mjs} +0 -0
- /package/{esm2015/core/modules/flow-configuration/types/update.types.js → esm2020/core/modules/flow-configuration/types/update.types.mjs} +0 -0
- /package/{esm2015/core/modules/index.js → esm2020/core/modules/index.mjs} +0 -0
- /package/{esm2015/core/services/index.js → esm2020/core/services/index.mjs} +0 -0
- /package/{esm2015/core/services/metric-calculation/metric-calculation.types.js → esm2020/core/services/metric-calculation/metric-calculation.types.mjs} +0 -0
- /package/{esm2015/core/services/metric-calculation/metric-calculation.utils.js → esm2020/core/services/metric-calculation/metric-calculation.utils.mjs} +0 -0
- /package/{esm2015/core/types/index.js → esm2020/core/types/index.mjs} +0 -0
- /package/{esm2015/core/types/runtime.types.js → esm2020/core/types/runtime.types.mjs} +0 -0
- /package/{esm2015/core/types/ui-definition.types.js → esm2020/core/types/ui-definition.types.mjs} +0 -0
- /package/{esm2015/core/utils/index.js → esm2020/core/utils/index.mjs} +0 -0
- /package/{esm2015/core/utils/ui-definition.utils.js → esm2020/core/utils/ui-definition.utils.mjs} +0 -0
- /package/{esm2015/core/veloceapps-sdk-core.js → esm2020/core/veloceapps-sdk-core.mjs} +0 -0
- /package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- /package/{esm2015/runtime/components/index.js → esm2020/runtime/components/index.mjs} +0 -0
- /package/{esm2015/runtime/index.js → esm2020/runtime/index.mjs} +0 -0
- /package/{esm2015/runtime/services/index.js → esm2020/runtime/services/index.mjs} +0 -0
- /package/{esm2015/runtime/types/bound-data.types.js → esm2020/runtime/types/bound-data.types.mjs} +0 -0
- /package/{esm2015/runtime/types/index.js → esm2020/runtime/types/index.mjs} +0 -0
- /package/{esm2015/runtime/types/quote-states.types.js → esm2020/runtime/types/quote-states.types.mjs} +0 -0
- /package/{esm2015/runtime/types/runtime.types.js → esm2020/runtime/types/runtime.types.mjs} +0 -0
- /package/{esm2015/runtime/utils/section.utils.js → esm2020/runtime/utils/section.utils.mjs} +0 -0
- /package/{esm2015/runtime/utils/sections-binder.helper.js → esm2020/runtime/utils/sections-binder.helper.mjs} +0 -0
- /package/{esm2015/runtime/veloceapps-sdk-runtime.js → esm2020/runtime/veloceapps-sdk-runtime.mjs} +0 -0
- /package/{esm2015/src/components/dialog/dialog.types.js → esm2020/src/components/dialog/dialog.types.mjs} +0 -0
- /package/{esm2015/src/components/header/header.types.js → esm2020/src/components/header/header.types.mjs} +0 -0
- /package/{esm2015/src/components/header/metrics/index.js → esm2020/src/components/header/metrics/index.mjs} +0 -0
- /package/{esm2015/src/components/header/metrics/metrics.definitions.js → esm2020/src/components/header/metrics/metrics.definitions.mjs} +0 -0
- /package/{esm2015/src/constants.js → esm2020/src/constants.mjs} +0 -0
- /package/{esm2015/src/guards/index.js → esm2020/src/guards/index.mjs} +0 -0
- /package/{esm2015/src/index.js → esm2020/src/index.mjs} +0 -0
- /package/{esm2015/src/pages/remote/remote.types.js → esm2020/src/pages/remote/remote.types.mjs} +0 -0
- /package/{esm2015/src/services/index.js → esm2020/src/services/index.mjs} +0 -0
- /package/{esm2015/src/types/context-route.types.js → esm2020/src/types/context-route.types.mjs} +0 -0
- /package/{esm2015/src/types/flow-customization.types.js → esm2020/src/types/flow-customization.types.mjs} +0 -0
- /package/{esm2015/src/types/index.js → esm2020/src/types/index.mjs} +0 -0
- /package/{esm2015/src/types/metrics.types.js → esm2020/src/types/metrics.types.mjs} +0 -0
- /package/{esm2015/src/types/route.types.js → esm2020/src/types/route.types.mjs} +0 -0
- /package/{esm2015/src/utils/index.js → esm2020/src/utils/index.mjs} +0 -0
- /package/{esm2015/veloceapps-sdk.js → esm2020/veloceapps-sdk.mjs} +0 -0
@@ -1,2531 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('lodash'), require('rfc6902'), require('@veloceapps/sdk/core'), require('primeng/api'), require('@veloceapps/components'), require('@veloceapps/core'), require('@angular/common'), require('ngx-drag-drop'), require('@veloceapps/api'), require('primeng/dynamicdialog'), require('@angular/cdk/drag-drop'), require('@angular/cdk/scrolling'), require('@angular/forms'), require('@babel/standalone'), require('rxjs/operators')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@veloceapps/sdk/cms', ['exports', '@angular/core', 'rxjs', 'lodash', 'rfc6902', '@veloceapps/sdk/core', 'primeng/api', '@veloceapps/components', '@veloceapps/core', '@angular/common', 'ngx-drag-drop', '@veloceapps/api', 'primeng/dynamicdialog', '@angular/cdk/drag-drop', '@angular/cdk/scrolling', '@angular/forms', '@babel/standalone', 'rxjs/operators'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloceapps = global.veloceapps || {}, global.veloceapps.sdk = global.veloceapps.sdk || {}, global.veloceapps.sdk.cms = {}), global.ng.core, global.rxjs, global.lodash, global.rfc6902, global.veloceapps.sdk.core, global["primeng/api"], global["@veloceapps/components"], global["@veloceapps/core"], global.ng.common, global["ngx-drag-drop"], global["@veloceapps/api"], global["primeng/dynamicdialog"], global.ng.cdk.dragDrop, global.ng.cdk.scrolling, global.ng.forms, global["@babel/standalone"], global.rxjs.operators));
|
5
|
-
})(this, (function (exports, i0, rxjs, lodash, rfc6902, i2, i3, i1, core, i7, i2$1, api, dynamicdialog, dragDrop, scrolling, angularForms, standalone, rxjsOperators) { 'use strict';
|
6
|
-
|
7
|
-
function _interopNamespace(e) {
|
8
|
-
if (e && e.__esModule) return e;
|
9
|
-
var n = Object.create(null);
|
10
|
-
if (e) {
|
11
|
-
Object.keys(e).forEach(function (k) {
|
12
|
-
if (k !== 'default') {
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
15
|
-
enumerable: true,
|
16
|
-
get: function () { return e[k]; }
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|
21
|
-
n["default"] = e;
|
22
|
-
return Object.freeze(n);
|
23
|
-
}
|
24
|
-
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
26
|
-
var rxjs__namespace = /*#__PURE__*/_interopNamespace(rxjs);
|
27
|
-
var lodash__namespace = /*#__PURE__*/_interopNamespace(lodash);
|
28
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
29
|
-
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
30
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
31
|
-
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
32
|
-
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
33
|
-
var angularForms__namespace = /*#__PURE__*/_interopNamespace(angularForms);
|
34
|
-
var rxjsOperators__namespace = /*#__PURE__*/_interopNamespace(rxjsOperators);
|
35
|
-
|
36
|
-
exports.FlowAction = void 0;
|
37
|
-
(function (FlowAction) {
|
38
|
-
FlowAction["FLOW_CONFIGURE_PRODUCT"] = "FLOW_CONFIGURE_PRODUCT";
|
39
|
-
FlowAction["FLOW_NAVIGATE_BACK"] = "FLOW_NAVIGATE_BACK";
|
40
|
-
FlowAction["FLOW_NAVIGATE_TO_CATALOG"] = "FLOW_NAVIGATE_TO_CATALOG";
|
41
|
-
FlowAction["FLOW_APPLY_PRODUCT_CONFIGURATION"] = "FLOW_APPLY_PRODUCT_CONFIGURATION";
|
42
|
-
FlowAction["FLOW_OPEN_DOC_GEN"] = "FLOW_OPEN_DOC_GEN";
|
43
|
-
FlowAction["FLOW_CLOSE_DOC_GEN"] = "FLOW_CLOSE_DOC_GEN";
|
44
|
-
FlowAction["FLOW_SWITCH_OBJECT"] = "FLOW_SWITCH_OBJECT";
|
45
|
-
FlowAction["REMOTE_APPLY"] = "REMOTE_APPLY";
|
46
|
-
FlowAction["REMOTE_CANCEL"] = "REMOTE_CANCEL";
|
47
|
-
})(exports.FlowAction || (exports.FlowAction = {}));
|
48
|
-
var ConfigureProductAction = function (_a) {
|
49
|
-
var lineItemId = _a.lineItemId, productId = _a.productId;
|
50
|
-
return ({
|
51
|
-
type: exports.FlowAction.FLOW_CONFIGURE_PRODUCT,
|
52
|
-
payload: { lineItemId: lineItemId, productId: productId },
|
53
|
-
});
|
54
|
-
};
|
55
|
-
var NavigateBackAction = function () { return ({
|
56
|
-
type: exports.FlowAction.FLOW_NAVIGATE_BACK,
|
57
|
-
}); };
|
58
|
-
var NavigateToCatalogAction = function () { return ({
|
59
|
-
type: exports.FlowAction.FLOW_NAVIGATE_TO_CATALOG,
|
60
|
-
}); };
|
61
|
-
var ApplyProductConfigurationAction = function () { return ({
|
62
|
-
type: exports.FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION,
|
63
|
-
}); };
|
64
|
-
var OpenDocGenAction = function () { return ({
|
65
|
-
type: exports.FlowAction.FLOW_OPEN_DOC_GEN,
|
66
|
-
}); };
|
67
|
-
var CloseDocGenAction = function () { return ({
|
68
|
-
type: exports.FlowAction.FLOW_CLOSE_DOC_GEN,
|
69
|
-
}); };
|
70
|
-
var RemoteApplyAction = function () { return ({
|
71
|
-
type: exports.FlowAction.REMOTE_APPLY,
|
72
|
-
}); };
|
73
|
-
var RemoteCancelAction = function () { return ({
|
74
|
-
type: exports.FlowAction.REMOTE_CANCEL,
|
75
|
-
}); };
|
76
|
-
var SwitchObjectAction = function (payload) { return ({
|
77
|
-
type: exports.FlowAction.FLOW_SWITCH_OBJECT,
|
78
|
-
payload: payload,
|
79
|
-
}); };
|
80
|
-
|
81
|
-
var cmsActions = /*#__PURE__*/Object.freeze({
|
82
|
-
__proto__: null,
|
83
|
-
get FlowAction () { return exports.FlowAction; },
|
84
|
-
ConfigureProductAction: ConfigureProductAction,
|
85
|
-
NavigateBackAction: NavigateBackAction,
|
86
|
-
NavigateToCatalogAction: NavigateToCatalogAction,
|
87
|
-
ApplyProductConfigurationAction: ApplyProductConfigurationAction,
|
88
|
-
OpenDocGenAction: OpenDocGenAction,
|
89
|
-
CloseDocGenAction: CloseDocGenAction,
|
90
|
-
RemoteApplyAction: RemoteApplyAction,
|
91
|
-
RemoteCancelAction: RemoteCancelAction,
|
92
|
-
SwitchObjectAction: SwitchObjectAction
|
93
|
-
});
|
94
|
-
|
95
|
-
/******************************************************************************
|
96
|
-
Copyright (c) Microsoft Corporation.
|
97
|
-
|
98
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
99
|
-
purpose with or without fee is hereby granted.
|
100
|
-
|
101
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
102
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
103
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
104
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
105
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
106
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
107
|
-
PERFORMANCE OF THIS SOFTWARE.
|
108
|
-
***************************************************************************** */
|
109
|
-
/* global Reflect, Promise */
|
110
|
-
var extendStatics = function (d, b) {
|
111
|
-
extendStatics = Object.setPrototypeOf ||
|
112
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
113
|
-
function (d, b) { for (var p in b)
|
114
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
115
|
-
d[p] = b[p]; };
|
116
|
-
return extendStatics(d, b);
|
117
|
-
};
|
118
|
-
function __extends(d, b) {
|
119
|
-
if (typeof b !== "function" && b !== null)
|
120
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
121
|
-
extendStatics(d, b);
|
122
|
-
function __() { this.constructor = d; }
|
123
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
124
|
-
}
|
125
|
-
var __assign = function () {
|
126
|
-
__assign = Object.assign || function __assign(t) {
|
127
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
128
|
-
s = arguments[i];
|
129
|
-
for (var p in s)
|
130
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
131
|
-
t[p] = s[p];
|
132
|
-
}
|
133
|
-
return t;
|
134
|
-
};
|
135
|
-
return __assign.apply(this, arguments);
|
136
|
-
};
|
137
|
-
function __rest(s, e) {
|
138
|
-
var t = {};
|
139
|
-
for (var p in s)
|
140
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
141
|
-
t[p] = s[p];
|
142
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
143
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
144
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
145
|
-
t[p[i]] = s[p[i]];
|
146
|
-
}
|
147
|
-
return t;
|
148
|
-
}
|
149
|
-
function __decorate(decorators, target, key, desc) {
|
150
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
151
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
152
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
153
|
-
else
|
154
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
155
|
-
if (d = decorators[i])
|
156
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
157
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
158
|
-
}
|
159
|
-
function __param(paramIndex, decorator) {
|
160
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
161
|
-
}
|
162
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
163
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
164
|
-
throw new TypeError("Function expected"); return f; }
|
165
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
166
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
167
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
168
|
-
var _, done = false;
|
169
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
170
|
-
var context = {};
|
171
|
-
for (var p in contextIn)
|
172
|
-
context[p] = p === "access" ? {} : contextIn[p];
|
173
|
-
for (var p in contextIn.access)
|
174
|
-
context.access[p] = contextIn.access[p];
|
175
|
-
context.addInitializer = function (f) { if (done)
|
176
|
-
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
177
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
178
|
-
if (kind === "accessor") {
|
179
|
-
if (result === void 0)
|
180
|
-
continue;
|
181
|
-
if (result === null || typeof result !== "object")
|
182
|
-
throw new TypeError("Object expected");
|
183
|
-
if (_ = accept(result.get))
|
184
|
-
descriptor.get = _;
|
185
|
-
if (_ = accept(result.set))
|
186
|
-
descriptor.set = _;
|
187
|
-
if (_ = accept(result.init))
|
188
|
-
initializers.push(_);
|
189
|
-
}
|
190
|
-
else if (_ = accept(result)) {
|
191
|
-
if (kind === "field")
|
192
|
-
initializers.push(_);
|
193
|
-
else
|
194
|
-
descriptor[key] = _;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
if (target)
|
198
|
-
Object.defineProperty(target, contextIn.name, descriptor);
|
199
|
-
done = true;
|
200
|
-
}
|
201
|
-
;
|
202
|
-
function __runInitializers(thisArg, initializers, value) {
|
203
|
-
var useValue = arguments.length > 2;
|
204
|
-
for (var i = 0; i < initializers.length; i++) {
|
205
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
206
|
-
}
|
207
|
-
return useValue ? value : void 0;
|
208
|
-
}
|
209
|
-
;
|
210
|
-
function __propKey(x) {
|
211
|
-
return typeof x === "symbol" ? x : "".concat(x);
|
212
|
-
}
|
213
|
-
;
|
214
|
-
function __setFunctionName(f, name, prefix) {
|
215
|
-
if (typeof name === "symbol")
|
216
|
-
name = name.description ? "[".concat(name.description, "]") : "";
|
217
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
218
|
-
}
|
219
|
-
;
|
220
|
-
function __metadata(metadataKey, metadataValue) {
|
221
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
222
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
223
|
-
}
|
224
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
225
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
226
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
227
|
-
function fulfilled(value) { try {
|
228
|
-
step(generator.next(value));
|
229
|
-
}
|
230
|
-
catch (e) {
|
231
|
-
reject(e);
|
232
|
-
} }
|
233
|
-
function rejected(value) { try {
|
234
|
-
step(generator["throw"](value));
|
235
|
-
}
|
236
|
-
catch (e) {
|
237
|
-
reject(e);
|
238
|
-
} }
|
239
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
240
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
241
|
-
});
|
242
|
-
}
|
243
|
-
function __generator(thisArg, body) {
|
244
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
245
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
246
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
247
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
248
|
-
function step(op) {
|
249
|
-
if (f)
|
250
|
-
throw new TypeError("Generator is already executing.");
|
251
|
-
while (g && (g = 0, op[0] && (_ = 0)), _)
|
252
|
-
try {
|
253
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
254
|
-
return t;
|
255
|
-
if (y = 0, t)
|
256
|
-
op = [op[0] & 2, t.value];
|
257
|
-
switch (op[0]) {
|
258
|
-
case 0:
|
259
|
-
case 1:
|
260
|
-
t = op;
|
261
|
-
break;
|
262
|
-
case 4:
|
263
|
-
_.label++;
|
264
|
-
return { value: op[1], done: false };
|
265
|
-
case 5:
|
266
|
-
_.label++;
|
267
|
-
y = op[1];
|
268
|
-
op = [0];
|
269
|
-
continue;
|
270
|
-
case 7:
|
271
|
-
op = _.ops.pop();
|
272
|
-
_.trys.pop();
|
273
|
-
continue;
|
274
|
-
default:
|
275
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
276
|
-
_ = 0;
|
277
|
-
continue;
|
278
|
-
}
|
279
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
280
|
-
_.label = op[1];
|
281
|
-
break;
|
282
|
-
}
|
283
|
-
if (op[0] === 6 && _.label < t[1]) {
|
284
|
-
_.label = t[1];
|
285
|
-
t = op;
|
286
|
-
break;
|
287
|
-
}
|
288
|
-
if (t && _.label < t[2]) {
|
289
|
-
_.label = t[2];
|
290
|
-
_.ops.push(op);
|
291
|
-
break;
|
292
|
-
}
|
293
|
-
if (t[2])
|
294
|
-
_.ops.pop();
|
295
|
-
_.trys.pop();
|
296
|
-
continue;
|
297
|
-
}
|
298
|
-
op = body.call(thisArg, _);
|
299
|
-
}
|
300
|
-
catch (e) {
|
301
|
-
op = [6, e];
|
302
|
-
y = 0;
|
303
|
-
}
|
304
|
-
finally {
|
305
|
-
f = t = 0;
|
306
|
-
}
|
307
|
-
if (op[0] & 5)
|
308
|
-
throw op[1];
|
309
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
310
|
-
}
|
311
|
-
}
|
312
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
313
|
-
if (k2 === undefined)
|
314
|
-
k2 = k;
|
315
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
316
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
317
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
318
|
-
}
|
319
|
-
Object.defineProperty(o, k2, desc);
|
320
|
-
}) : (function (o, m, k, k2) {
|
321
|
-
if (k2 === undefined)
|
322
|
-
k2 = k;
|
323
|
-
o[k2] = m[k];
|
324
|
-
});
|
325
|
-
function __exportStar(m, o) {
|
326
|
-
for (var p in m)
|
327
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
328
|
-
__createBinding(o, m, p);
|
329
|
-
}
|
330
|
-
function __values(o) {
|
331
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
332
|
-
if (m)
|
333
|
-
return m.call(o);
|
334
|
-
if (o && typeof o.length === "number")
|
335
|
-
return {
|
336
|
-
next: function () {
|
337
|
-
if (o && i >= o.length)
|
338
|
-
o = void 0;
|
339
|
-
return { value: o && o[i++], done: !o };
|
340
|
-
}
|
341
|
-
};
|
342
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
343
|
-
}
|
344
|
-
function __read(o, n) {
|
345
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
346
|
-
if (!m)
|
347
|
-
return o;
|
348
|
-
var i = m.call(o), r, ar = [], e;
|
349
|
-
try {
|
350
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
351
|
-
ar.push(r.value);
|
352
|
-
}
|
353
|
-
catch (error) {
|
354
|
-
e = { error: error };
|
355
|
-
}
|
356
|
-
finally {
|
357
|
-
try {
|
358
|
-
if (r && !r.done && (m = i["return"]))
|
359
|
-
m.call(i);
|
360
|
-
}
|
361
|
-
finally {
|
362
|
-
if (e)
|
363
|
-
throw e.error;
|
364
|
-
}
|
365
|
-
}
|
366
|
-
return ar;
|
367
|
-
}
|
368
|
-
/** @deprecated */
|
369
|
-
function __spread() {
|
370
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
371
|
-
ar = ar.concat(__read(arguments[i]));
|
372
|
-
return ar;
|
373
|
-
}
|
374
|
-
/** @deprecated */
|
375
|
-
function __spreadArrays() {
|
376
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
377
|
-
s += arguments[i].length;
|
378
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
379
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
380
|
-
r[k] = a[j];
|
381
|
-
return r;
|
382
|
-
}
|
383
|
-
function __spreadArray(to, from, pack) {
|
384
|
-
if (pack || arguments.length === 2)
|
385
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
386
|
-
if (ar || !(i in from)) {
|
387
|
-
if (!ar)
|
388
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
389
|
-
ar[i] = from[i];
|
390
|
-
}
|
391
|
-
}
|
392
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
393
|
-
}
|
394
|
-
function __await(v) {
|
395
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
396
|
-
}
|
397
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
398
|
-
if (!Symbol.asyncIterator)
|
399
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
400
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
401
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
402
|
-
function verb(n) { if (g[n])
|
403
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
404
|
-
function resume(n, v) { try {
|
405
|
-
step(g[n](v));
|
406
|
-
}
|
407
|
-
catch (e) {
|
408
|
-
settle(q[0][3], e);
|
409
|
-
} }
|
410
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
411
|
-
function fulfill(value) { resume("next", value); }
|
412
|
-
function reject(value) { resume("throw", value); }
|
413
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
414
|
-
resume(q[0][0], q[0][1]); }
|
415
|
-
}
|
416
|
-
function __asyncDelegator(o) {
|
417
|
-
var i, p;
|
418
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
419
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
420
|
-
}
|
421
|
-
function __asyncValues(o) {
|
422
|
-
if (!Symbol.asyncIterator)
|
423
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
424
|
-
var m = o[Symbol.asyncIterator], i;
|
425
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
426
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
427
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
428
|
-
}
|
429
|
-
function __makeTemplateObject(cooked, raw) {
|
430
|
-
if (Object.defineProperty) {
|
431
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
432
|
-
}
|
433
|
-
else {
|
434
|
-
cooked.raw = raw;
|
435
|
-
}
|
436
|
-
return cooked;
|
437
|
-
}
|
438
|
-
;
|
439
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
440
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
441
|
-
}) : function (o, v) {
|
442
|
-
o["default"] = v;
|
443
|
-
};
|
444
|
-
function __importStar(mod) {
|
445
|
-
if (mod && mod.__esModule)
|
446
|
-
return mod;
|
447
|
-
var result = {};
|
448
|
-
if (mod != null)
|
449
|
-
for (var k in mod)
|
450
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
451
|
-
__createBinding(result, mod, k);
|
452
|
-
__setModuleDefault(result, mod);
|
453
|
-
return result;
|
454
|
-
}
|
455
|
-
function __importDefault(mod) {
|
456
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
457
|
-
}
|
458
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
459
|
-
if (kind === "a" && !f)
|
460
|
-
throw new TypeError("Private accessor was defined without a getter");
|
461
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
462
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
463
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
464
|
-
}
|
465
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
466
|
-
if (kind === "m")
|
467
|
-
throw new TypeError("Private method is not writable");
|
468
|
-
if (kind === "a" && !f)
|
469
|
-
throw new TypeError("Private accessor was defined without a setter");
|
470
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
471
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
472
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
473
|
-
}
|
474
|
-
function __classPrivateFieldIn(state, receiver) {
|
475
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
476
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
477
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
478
|
-
}
|
479
|
-
|
480
|
-
var DEFAULT_PLUGINS_TOKEN = new i0.InjectionToken('DEFAULT_PLUGINS_TOKEN');
|
481
|
-
var UI_DEFINITION_METADATA = new i0.InjectionToken('UI_DEFINITION_METADATA_TOKEN');
|
482
|
-
var ELEMENT_METADATA = new i0.InjectionToken('ELEMENT_METADATA_TOKEN');
|
483
|
-
var SHARED_ELEMENT_METADATA = new i0.InjectionToken('SHARED_ELEMENT_METADATA_TOKEN');
|
484
|
-
var ELEMENT_CONFIG = new i0.InjectionToken('ELEMENT_CONFIG_TOKEN');
|
485
|
-
var VENDOR_MAP = new i0.InjectionToken('VENDOR_MAP');
|
486
|
-
|
487
|
-
var cmsInjectionTokens = /*#__PURE__*/Object.freeze({
|
488
|
-
__proto__: null,
|
489
|
-
DEFAULT_PLUGINS_TOKEN: DEFAULT_PLUGINS_TOKEN,
|
490
|
-
UI_DEFINITION_METADATA: UI_DEFINITION_METADATA,
|
491
|
-
ELEMENT_METADATA: ELEMENT_METADATA,
|
492
|
-
SHARED_ELEMENT_METADATA: SHARED_ELEMENT_METADATA,
|
493
|
-
ELEMENT_CONFIG: ELEMENT_CONFIG,
|
494
|
-
VENDOR_MAP: VENDOR_MAP
|
495
|
-
});
|
496
|
-
|
497
|
-
var Entity = /** @class */ (function () {
|
498
|
-
function Entity(injector) {
|
499
|
-
this.injector = injector;
|
500
|
-
this.plugins = [];
|
501
|
-
this.config = this.injector.get(ELEMENT_CONFIG);
|
502
|
-
this.defaultPlugins = this.injector.get(DEFAULT_PLUGINS_TOKEN);
|
503
|
-
}
|
504
|
-
Entity.prototype.initPlugins = function () {
|
505
|
-
var _this = this;
|
506
|
-
var _a;
|
507
|
-
this.defaultPlugins.forEach(function (plugin) { return _this.registerPlugin(new plugin(_this)); });
|
508
|
-
(_a = this.config.plugins) === null || _a === void 0 ? void 0 : _a.forEach(function (plugin) { return _this.registerPlugin(new plugin(_this)); });
|
509
|
-
};
|
510
|
-
Entity.prototype.registerPlugin = function (plugin) {
|
511
|
-
this.plugins.push(plugin);
|
512
|
-
};
|
513
|
-
return Entity;
|
514
|
-
}());
|
515
|
-
|
516
|
-
exports.ElementComponent = /** @class */ (function (_super) {
|
517
|
-
__extends(ElementComponent, _super);
|
518
|
-
function ElementComponent(injector) {
|
519
|
-
var _this = _super.call(this, injector) || this;
|
520
|
-
_this.injector = injector;
|
521
|
-
_this.model$ = new rxjs.BehaviorSubject(undefined);
|
522
|
-
_super.prototype.initPlugins.call(_this);
|
523
|
-
return _this;
|
524
|
-
}
|
525
|
-
ElementComponent.prototype.ngOnChanges = function (changes) {
|
526
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngOnChanges) === null || _a === void 0 ? void 0 : _a.call(plugin, changes); });
|
527
|
-
};
|
528
|
-
ElementComponent.prototype.ngOnInit = function () {
|
529
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngOnInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
530
|
-
};
|
531
|
-
ElementComponent.prototype.ngDoCheck = function () {
|
532
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngDoCheck) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
533
|
-
};
|
534
|
-
ElementComponent.prototype.ngAfterContentInit = function () {
|
535
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngAfterContentInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
536
|
-
};
|
537
|
-
ElementComponent.prototype.ngAfterViewInit = function () {
|
538
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngAfterViewInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
539
|
-
};
|
540
|
-
ElementComponent.prototype.ngAfterViewChecked = function () {
|
541
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngAfterViewChecked) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
542
|
-
};
|
543
|
-
ElementComponent.prototype.ngOnDestroy = function () {
|
544
|
-
this.plugins.forEach(function (plugin) { var _a; return (_a = plugin.ngOnDestroy) === null || _a === void 0 ? void 0 : _a.call(plugin); });
|
545
|
-
};
|
546
|
-
return ElementComponent;
|
547
|
-
}(Entity));
|
548
|
-
exports.ElementComponent = __decorate([
|
549
|
-
i0.Component({
|
550
|
-
template: '',
|
551
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
552
|
-
jit: true,
|
553
|
-
}),
|
554
|
-
__param(0, i0.Inject(i0.Injector))
|
555
|
-
], exports.ElementComponent);
|
556
|
-
|
557
|
-
function getElementUniqueName(collection, name, comparator) {
|
558
|
-
var result = '';
|
559
|
-
var index = 0;
|
560
|
-
while (!result) {
|
561
|
-
var candidate = name + (index ? " (" + index + ")" : '');
|
562
|
-
var exists = collection.some(comparator(candidate));
|
563
|
-
if (!exists) {
|
564
|
-
result = candidate;
|
565
|
-
}
|
566
|
-
else {
|
567
|
-
index++;
|
568
|
-
}
|
569
|
-
}
|
570
|
-
return result;
|
571
|
-
}
|
572
|
-
var insertElementAt = function (source, target, parentPath, index) {
|
573
|
-
var result = __spreadArray([], __read(source));
|
574
|
-
var name = getElementUniqueName(result, target.name, function (name) { return function (el) { return el.name === name; }; });
|
575
|
-
var path = parentPath ? parentPath + "/" + name : name;
|
576
|
-
result.splice(index, 0, Object.assign(Object.assign({}, target), { path: path, name: name }));
|
577
|
-
return result;
|
578
|
-
};
|
579
|
-
var insertElement = function (source, target, path, index) {
|
580
|
-
if (!path) {
|
581
|
-
return insertElementAt(source, target, '', index);
|
582
|
-
}
|
583
|
-
return source.map(function (element) {
|
584
|
-
var _a;
|
585
|
-
if (element.path === path) {
|
586
|
-
return Object.assign(Object.assign({}, element), { children: insertElementAt(element.children, target, element.path, index) });
|
587
|
-
}
|
588
|
-
else if ((_a = element.path) === null || _a === void 0 ? void 0 : _a.startsWith(path)) {
|
589
|
-
return Object.assign(Object.assign({}, element), { children: insertElement(element.children, target, path, index) });
|
590
|
-
}
|
591
|
-
else {
|
592
|
-
return element;
|
593
|
-
}
|
594
|
-
});
|
595
|
-
};
|
596
|
-
var removeElement = function (source, path) {
|
597
|
-
return source.reduce(function (trunk, element) {
|
598
|
-
if (path === element.path) {
|
599
|
-
return trunk;
|
600
|
-
}
|
601
|
-
if (element.path) {
|
602
|
-
if (path.startsWith(element.path)) {
|
603
|
-
trunk.push(Object.assign(Object.assign({}, element), { children: removeElement(element.children, path) }));
|
604
|
-
}
|
605
|
-
else {
|
606
|
-
trunk.push(element);
|
607
|
-
}
|
608
|
-
}
|
609
|
-
return trunk;
|
610
|
-
}, []);
|
611
|
-
};
|
612
|
-
var findElementByPath = function (source, path) {
|
613
|
-
var e_1, _b;
|
614
|
-
try {
|
615
|
-
for (var source_1 = __values(source), source_1_1 = source_1.next(); !source_1_1.done; source_1_1 = source_1.next()) {
|
616
|
-
var el = source_1_1.value;
|
617
|
-
if (el.path === path) {
|
618
|
-
return el;
|
619
|
-
}
|
620
|
-
if (el.path && path.startsWith(el.path)) {
|
621
|
-
var found = findElementByPath(el.children, path);
|
622
|
-
if (found) {
|
623
|
-
return found;
|
624
|
-
}
|
625
|
-
}
|
626
|
-
}
|
627
|
-
}
|
628
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
629
|
-
finally {
|
630
|
-
try {
|
631
|
-
if (source_1_1 && !source_1_1.done && (_b = source_1.return)) _b.call(source_1);
|
632
|
-
}
|
633
|
-
finally { if (e_1) throw e_1.error; }
|
634
|
-
}
|
635
|
-
return;
|
636
|
-
};
|
637
|
-
var findElementByModule = function (elements, module, elementName) {
|
638
|
-
var e_2, _b;
|
639
|
-
try {
|
640
|
-
for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
|
641
|
-
var el = elements_1_1.value;
|
642
|
-
if (el.module === module && el.name === elementName) {
|
643
|
-
return el;
|
644
|
-
}
|
645
|
-
var child = findElementByModule(el.children, module, elementName);
|
646
|
-
if (child) {
|
647
|
-
return child;
|
648
|
-
}
|
649
|
-
}
|
650
|
-
}
|
651
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
652
|
-
finally {
|
653
|
-
try {
|
654
|
-
if (elements_1_1 && !elements_1_1.done && (_b = elements_1.return)) _b.call(elements_1);
|
655
|
-
}
|
656
|
-
finally { if (e_2) throw e_2.error; }
|
657
|
-
}
|
658
|
-
return;
|
659
|
-
};
|
660
|
-
|
661
|
-
var parseBoundPath = function (path) {
|
662
|
-
var _a, _b;
|
663
|
-
var regexp = new RegExp("(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)", 'g');
|
664
|
-
var blocks = (_b = (_a = path.match(regexp)) === null || _a === void 0 ? void 0 : _a.map(function (match) {
|
665
|
-
var _e = __read(lodash.compact(match.split('/')), 3), type = _e[0], property = _e[1], name = _e[2];
|
666
|
-
return { type: type, property: property, name: name };
|
667
|
-
})) !== null && _b !== void 0 ? _b : [];
|
668
|
-
return blocks;
|
669
|
-
};
|
670
|
-
var parsePath = function (path) {
|
671
|
-
var _a, _b, _c, _d;
|
672
|
-
var segments = path.split('/');
|
673
|
-
var module;
|
674
|
-
var variable;
|
675
|
-
if ((_a = segments[0]) === null || _a === void 0 ? void 0 : _a.startsWith('@')) {
|
676
|
-
module = (_b = segments.shift()) === null || _b === void 0 ? void 0 : _b.substring(1);
|
677
|
-
}
|
678
|
-
if (((_c = segments[segments.length - 1]) === null || _c === void 0 ? void 0 : _c[0]) === ':') {
|
679
|
-
variable = (_d = segments.pop()) === null || _d === void 0 ? void 0 : _d.substring(1);
|
680
|
-
}
|
681
|
-
var isAbsolute = !segments[0];
|
682
|
-
var nonEmptySegments = segments.filter(Boolean);
|
683
|
-
if (!isAbsolute && nonEmptySegments[0] === '.') {
|
684
|
-
nonEmptySegments.shift();
|
685
|
-
}
|
686
|
-
return {
|
687
|
-
isAbsolute: isAbsolute,
|
688
|
-
segments: nonEmptySegments,
|
689
|
-
module: module,
|
690
|
-
variable: variable,
|
691
|
-
};
|
692
|
-
};
|
693
|
-
var getAbsolutePath = function (elements, subject, path) {
|
694
|
-
var _a, _b, _c;
|
695
|
-
if (path.module) {
|
696
|
-
return (_a = findElementByModule(elements, path.module, path.segments[0])) === null || _a === void 0 ? void 0 : _a.path;
|
697
|
-
}
|
698
|
-
var subjectSegments = (_c = (_b = subject.path) === null || _b === void 0 ? void 0 : _b.split('/')) !== null && _c !== void 0 ? _c : [];
|
699
|
-
var segments = __spreadArray([], __read(path.segments));
|
700
|
-
if (path.isAbsolute) {
|
701
|
-
return segments.join('/');
|
702
|
-
}
|
703
|
-
while (segments.length) {
|
704
|
-
var segment = segments.shift();
|
705
|
-
if (segment === '..') {
|
706
|
-
subjectSegments.pop();
|
707
|
-
}
|
708
|
-
else if (segment) {
|
709
|
-
subjectSegments.push(segment);
|
710
|
-
}
|
711
|
-
}
|
712
|
-
return subjectSegments.join('/');
|
713
|
-
};
|
714
|
-
|
715
|
-
var CMS_COMPILATION_SERVICE = new i0.InjectionToken('VENDOR_MAP');
|
716
|
-
|
717
|
-
var RuntimeService = /** @class */ (function () {
|
718
|
-
function RuntimeService(injector) {
|
719
|
-
this.injector = injector;
|
720
|
-
this.modules = [];
|
721
|
-
this.componentFactories = {};
|
722
|
-
this.applicationTree = [];
|
723
|
-
this.isInitialized$ = new rxjs.BehaviorSubject(false);
|
724
|
-
this.updated$ = new rxjs.Subject();
|
725
|
-
this.compilationService = this.injector.get(CMS_COMPILATION_SERVICE);
|
726
|
-
}
|
727
|
-
RuntimeService.prototype.initialize$ = function (uiDefinition, config) {
|
728
|
-
var _this = this;
|
729
|
-
this.config = config;
|
730
|
-
if (!uiDefinition) {
|
731
|
-
return rxjs.of([]);
|
732
|
-
}
|
733
|
-
return this.compilationService.compileUIDefinition$(uiDefinition).pipe(rxjs.map(function (result) {
|
734
|
-
_this.applicationTree = result.elements;
|
735
|
-
_this.addComponentFactories(result.module.componentFactories);
|
736
|
-
return result.elements;
|
737
|
-
}), rxjs.tap(function () { return _this.isInitialized$.next(true); }));
|
738
|
-
};
|
739
|
-
RuntimeService.prototype.applyPatch$ = function (patch) {
|
740
|
-
var _this = this;
|
741
|
-
var observable$ = rxjs.of(undefined);
|
742
|
-
patch.forEach(function (operation) {
|
743
|
-
switch (operation.op) {
|
744
|
-
case 'add': {
|
745
|
-
observable$ = observable$.pipe(rxjs.switchMap(function () { return _this.addElement$(operation); }));
|
746
|
-
break;
|
747
|
-
}
|
748
|
-
case 'remove': {
|
749
|
-
observable$ = observable$.pipe(rxjs.map(function () { return _this.deleteElement(operation); }));
|
750
|
-
break;
|
751
|
-
}
|
752
|
-
default:
|
753
|
-
observable$ = rxjs.of();
|
754
|
-
}
|
755
|
-
});
|
756
|
-
return observable$.pipe(rxjs.tap(function () { return _this.updated$.next(); }));
|
757
|
-
};
|
758
|
-
RuntimeService.prototype.getCompiledElement$ = function (path) {
|
759
|
-
var _this = this;
|
760
|
-
return this.updated$.pipe(rxjs.startWith(undefined), rxjs.map(function () { return findElementByPath(_this.applicationTree, path); }), rxjs.distinctUntilChanged());
|
761
|
-
};
|
762
|
-
RuntimeService.prototype.clear = function () {
|
763
|
-
this.compilationService.clearModuleCache(this.modules);
|
764
|
-
this.modules = [];
|
765
|
-
this.applicationTree = [];
|
766
|
-
this.componentFactories = {};
|
767
|
-
this.isInitialized$.next(false);
|
768
|
-
};
|
769
|
-
RuntimeService.prototype.addElement$ = function (operation) {
|
770
|
-
var _this = this;
|
771
|
-
return this.compilationService.compileElement$(operation.value).pipe(rxjs.map(function (result) {
|
772
|
-
_this.addComponentFactories(result.module.componentFactories);
|
773
|
-
rfc6902.applyPatch(_this.applicationTree, [Object.assign(Object.assign({}, operation), { value: result.elements[0] })]);
|
774
|
-
}));
|
775
|
-
};
|
776
|
-
RuntimeService.prototype.deleteElement = function (operation) {
|
777
|
-
rfc6902.applyPatch(this.applicationTree, [operation]);
|
778
|
-
};
|
779
|
-
RuntimeService.prototype.addComponentFactories = function (list) {
|
780
|
-
var _this = this;
|
781
|
-
list.forEach(function (item) { return (_this.componentFactories[item.componentType.path] = item); });
|
782
|
-
};
|
783
|
-
return RuntimeService;
|
784
|
-
}());
|
785
|
-
RuntimeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
786
|
-
RuntimeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService });
|
787
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService, decorators: [{
|
788
|
-
type: i0.Injectable
|
789
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
|
790
|
-
|
791
|
-
var IOProviderService = /** @class */ (function () {
|
792
|
-
function IOProviderService(runtimeService) {
|
793
|
-
this.runtimeService = runtimeService;
|
794
|
-
this.inputs = {};
|
795
|
-
}
|
796
|
-
IOProviderService.prototype.connect = function (el, name, target) {
|
797
|
-
var _a;
|
798
|
-
return (_a = this.resolveTarget(el, name, target)) === null || _a === void 0 ? void 0 : _a.asObservable();
|
799
|
-
};
|
800
|
-
IOProviderService.prototype.provide = function (el, name, target) {
|
801
|
-
return this.resolveTarget(el, name, target);
|
802
|
-
};
|
803
|
-
IOProviderService.prototype.resolveTarget = function (el, name, target) {
|
804
|
-
var _a, _b;
|
805
|
-
var isHost = !target;
|
806
|
-
if (isHost) {
|
807
|
-
return this.createSubjectSafe((_a = el.path) !== null && _a !== void 0 ? _a : '', name);
|
808
|
-
}
|
809
|
-
var elPath = parsePath(target);
|
810
|
-
var pathIsValue = elPath.segments.length === 1 && elPath.segments[0].startsWith('"') && elPath.segments[0].endsWith('"');
|
811
|
-
var finalName = (_b = elPath.variable) !== null && _b !== void 0 ? _b : name;
|
812
|
-
var value = pathIsValue ? new rxjs.BehaviorSubject(elPath.segments[0].slice(1, -1)) : undefined;
|
813
|
-
var absolutePath = !pathIsValue ? getAbsolutePath(this.runtimeService.applicationTree, el, elPath) : el.path;
|
814
|
-
return this.createSubjectSafe(absolutePath !== null && absolutePath !== void 0 ? absolutePath : '', finalName, value);
|
815
|
-
};
|
816
|
-
IOProviderService.prototype.createSubjectSafe = function (path, name, subject) {
|
817
|
-
var _this = this;
|
818
|
-
if (!this.inputs[path]) {
|
819
|
-
this.inputs[path] = {};
|
820
|
-
}
|
821
|
-
var subjectAlreadyExists = Boolean(this.inputs[path][name]);
|
822
|
-
if (!this.inputs[path][name]) {
|
823
|
-
this.inputs[path][name] = subject !== null && subject !== void 0 ? subject : new rxjs.BehaviorSubject(undefined);
|
824
|
-
}
|
825
|
-
if (subject && subjectAlreadyExists) {
|
826
|
-
// push delayed value to workaround 'changed after it was checked' issue
|
827
|
-
setTimeout(function () { return _this.inputs[path][name].next(subject.value); });
|
828
|
-
}
|
829
|
-
return this.inputs[path][name];
|
830
|
-
};
|
831
|
-
return IOProviderService;
|
832
|
-
}());
|
833
|
-
IOProviderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService, deps: [{ token: RuntimeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
834
|
-
IOProviderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService });
|
835
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService, decorators: [{
|
836
|
-
type: i0.Injectable
|
837
|
-
}], ctorParameters: function () { return [{ type: RuntimeService }]; } });
|
838
|
-
|
839
|
-
var TemplatesService = /** @class */ (function () {
|
840
|
-
function TemplatesService() {
|
841
|
-
this.templates = {};
|
842
|
-
}
|
843
|
-
TemplatesService.prototype.register = function (name, templateRef) {
|
844
|
-
this.ensureStorage(name);
|
845
|
-
this.templates[name].next(templateRef);
|
846
|
-
};
|
847
|
-
TemplatesService.prototype.get = function (name) {
|
848
|
-
this.ensureStorage(name);
|
849
|
-
return this.templates[name].value;
|
850
|
-
};
|
851
|
-
TemplatesService.prototype.get$ = function (name) {
|
852
|
-
this.ensureStorage(name);
|
853
|
-
return this.templates[name].asObservable();
|
854
|
-
};
|
855
|
-
TemplatesService.prototype.ensureStorage = function (name) {
|
856
|
-
if (!this.templates[name]) {
|
857
|
-
this.templates[name] = new rxjs.BehaviorSubject(undefined);
|
858
|
-
}
|
859
|
-
};
|
860
|
-
return TemplatesService;
|
861
|
-
}());
|
862
|
-
TemplatesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
863
|
-
TemplatesService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService });
|
864
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService, decorators: [{
|
865
|
-
type: i0.Injectable
|
866
|
-
}] });
|
867
|
-
|
868
|
-
var InitAction = { type: 'INIT' };
|
869
|
-
var ClearAction = { type: 'CLEAR' };
|
870
|
-
var IntegrationState = /** @class */ (function () {
|
871
|
-
function IntegrationState() {
|
872
|
-
this.stateSubj$ = new rxjs.BehaviorSubject({});
|
873
|
-
this.action$ = new rxjs.BehaviorSubject(InitAction);
|
874
|
-
}
|
875
|
-
Object.defineProperty(IntegrationState.prototype, "state$", {
|
876
|
-
get: function () {
|
877
|
-
return this.stateSubj$.asObservable();
|
878
|
-
},
|
879
|
-
enumerable: false,
|
880
|
-
configurable: true
|
881
|
-
});
|
882
|
-
Object.defineProperty(IntegrationState.prototype, "state", {
|
883
|
-
get: function () {
|
884
|
-
return this.stateSubj$.getValue();
|
885
|
-
},
|
886
|
-
enumerable: false,
|
887
|
-
configurable: true
|
888
|
-
});
|
889
|
-
IntegrationState.prototype.patchState = function (update) {
|
890
|
-
this.stateSubj$.next(Object.assign(Object.assign({}, this.stateSubj$.getValue()), update));
|
891
|
-
};
|
892
|
-
IntegrationState.prototype.dispatch = function (action) {
|
893
|
-
this.action$.next(action);
|
894
|
-
};
|
895
|
-
IntegrationState.prototype.listen$ = function (actionType) {
|
896
|
-
return this.action$.pipe(rxjs.filter(function (action) { return action.type === actionType; }), rxjs.map(function (action) { return action.payload; }));
|
897
|
-
};
|
898
|
-
IntegrationState.prototype.listenAll$ = function () {
|
899
|
-
return this.action$.asObservable();
|
900
|
-
};
|
901
|
-
IntegrationState.prototype.clear = function () {
|
902
|
-
this.stateSubj$.next({});
|
903
|
-
this.action$.next(ClearAction);
|
904
|
-
};
|
905
|
-
return IntegrationState;
|
906
|
-
}());
|
907
|
-
IntegrationState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
908
|
-
IntegrationState.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, providedIn: 'root' });
|
909
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, decorators: [{
|
910
|
-
type: i0.Injectable,
|
911
|
-
args: [{ providedIn: 'root' }]
|
912
|
-
}] });
|
913
|
-
|
914
|
-
var ResourcesService = /** @class */ (function () {
|
915
|
-
function ResourcesService() {
|
916
|
-
this.scripts = new Map();
|
917
|
-
this.loaded$ = new rxjs.ReplaySubject();
|
918
|
-
}
|
919
|
-
ResourcesService.prototype.loadScript = function (url) {
|
920
|
-
var _this = this;
|
921
|
-
var loaded = this.scripts.get(url);
|
922
|
-
if (loaded === true) {
|
923
|
-
return rxjs.of(rxjs.noop());
|
924
|
-
}
|
925
|
-
if (loaded == null) {
|
926
|
-
this.scripts.set(url, false);
|
927
|
-
var script = document.createElement('script');
|
928
|
-
script.src = url;
|
929
|
-
script.onload = function () {
|
930
|
-
_this.scripts.set(url, true);
|
931
|
-
_this.loaded$.next();
|
932
|
-
};
|
933
|
-
document.body.appendChild(script);
|
934
|
-
}
|
935
|
-
return this.loaded$.pipe(rxjs.filter(function () { return _this.scripts.get(url) === true; }), rxjs.take(1));
|
936
|
-
};
|
937
|
-
ResourcesService.prototype.loadStyles = function (url) {
|
938
|
-
var _a, _b;
|
939
|
-
var previewEl = document.querySelector('vl-cms-preview');
|
940
|
-
var rootEl = (_b = (_a = previewEl === null || previewEl === void 0 ? void 0 : previewEl.shadowRoot) !== null && _a !== void 0 ? _a : previewEl) !== null && _b !== void 0 ? _b : document.body;
|
941
|
-
return new rxjs.Observable(function (subscriber) {
|
942
|
-
var link = document.createElement('link');
|
943
|
-
link.rel = 'stylesheet';
|
944
|
-
link.type = 'text/css';
|
945
|
-
link.href = url;
|
946
|
-
link.media = 'all';
|
947
|
-
link.onload = function () {
|
948
|
-
subscriber.next();
|
949
|
-
subscriber.complete();
|
950
|
-
};
|
951
|
-
rootEl.appendChild(link);
|
952
|
-
});
|
953
|
-
};
|
954
|
-
return ResourcesService;
|
955
|
-
}());
|
956
|
-
ResourcesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ResourcesService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
957
|
-
ResourcesService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ResourcesService, providedIn: 'root' });
|
958
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ResourcesService, decorators: [{
|
959
|
-
type: i0.Injectable,
|
960
|
-
args: [{ providedIn: 'root' }]
|
961
|
-
}] });
|
962
|
-
|
963
|
-
var ElementContextService = /** @class */ (function () {
|
964
|
-
function ElementContextService() {
|
965
|
-
}
|
966
|
-
return ElementContextService;
|
967
|
-
}());
|
968
|
-
ElementContextService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
969
|
-
ElementContextService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService });
|
970
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService, decorators: [{
|
971
|
-
type: i0.Injectable
|
972
|
-
}] });
|
973
|
-
|
974
|
-
var ElementRendererComponent = /** @class */ (function () {
|
975
|
-
function ElementRendererComponent(parentInjector, runtimeService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
|
976
|
-
this.parentInjector = parentInjector;
|
977
|
-
this.runtimeService = runtimeService;
|
978
|
-
this.elementContext = elementContext;
|
979
|
-
this.ioProviderService = ioProviderService;
|
980
|
-
this.configurationService = configurationService;
|
981
|
-
this.elementRef = elementRef;
|
982
|
-
this.cdr = cdr;
|
983
|
-
this.refs = {};
|
984
|
-
this.destroy$ = new rxjs.Subject();
|
985
|
-
}
|
986
|
-
ElementRendererComponent.prototype.ngOnInit = function () {
|
987
|
-
this.elementContext.metadata = this.meta;
|
988
|
-
this.factory = this.meta.path ? this.runtimeService.componentFactories[this.meta.path] : undefined;
|
989
|
-
this.createComponents();
|
990
|
-
};
|
991
|
-
ElementRendererComponent.prototype.ngOnDestroy = function () {
|
992
|
-
this.destroyComponents();
|
993
|
-
this.destroy$.next();
|
994
|
-
this.destroy$.complete();
|
995
|
-
};
|
996
|
-
ElementRendererComponent.prototype.createComponents = function () {
|
997
|
-
var modelMeta = this.meta.model;
|
998
|
-
if (!modelMeta) {
|
999
|
-
this.refs[core.UUID.UUID()] = this.createComponent();
|
1000
|
-
return;
|
1001
|
-
}
|
1002
|
-
if (modelMeta.lineItem) {
|
1003
|
-
this.createFromLineItem(modelMeta.lineItem);
|
1004
|
-
}
|
1005
|
-
else if (modelMeta.path) {
|
1006
|
-
this.createFromPath(modelMeta.path);
|
1007
|
-
}
|
1008
|
-
};
|
1009
|
-
ElementRendererComponent.prototype.createFromPath = function (path) {
|
1010
|
-
var _this = this;
|
1011
|
-
var array$ = this.ioProviderService.connect(this.meta, 'children$', path);
|
1012
|
-
array$ === null || array$ === void 0 ? void 0 : array$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function (children) {
|
1013
|
-
if (!lodash.isArray(children)) {
|
1014
|
-
return;
|
1015
|
-
}
|
1016
|
-
_this.processChildren(children);
|
1017
|
-
});
|
1018
|
-
};
|
1019
|
-
ElementRendererComponent.prototype.getModelComponent = function () {
|
1020
|
-
var component = null;
|
1021
|
-
var injector = this.parentInjector;
|
1022
|
-
while (!component) {
|
1023
|
-
var parentComp = injector.get(ElementRendererComponent, null);
|
1024
|
-
if (parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) {
|
1025
|
-
component = parentComp;
|
1026
|
-
break;
|
1027
|
-
}
|
1028
|
-
if (parentComp) {
|
1029
|
-
injector = parentComp.parentInjector;
|
1030
|
-
}
|
1031
|
-
else {
|
1032
|
-
break;
|
1033
|
-
}
|
1034
|
-
}
|
1035
|
-
return component;
|
1036
|
-
};
|
1037
|
-
ElementRendererComponent.prototype.createFromLineItem = function (path) {
|
1038
|
-
var _this = this;
|
1039
|
-
var _a, _b;
|
1040
|
-
var parentComp = this.getModelComponent();
|
1041
|
-
var parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
|
1042
|
-
var pathBlocks = parseBoundPath(path).reverse();
|
1043
|
-
var _c = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {}, property = _c.property, name = _c.name;
|
1044
|
-
var finalPath = pathBlocks[0];
|
1045
|
-
var children$ = this.getParentLineItem$(parentComp).pipe(rxjs.map(function (model) {
|
1046
|
-
var _a;
|
1047
|
-
if (!model) {
|
1048
|
-
return [];
|
1049
|
-
}
|
1050
|
-
if (property === 'ports' && !finalPath.property && parentPath !== path) {
|
1051
|
-
return (_a = model.lineItems.filter(function (_c) {
|
1052
|
-
var port = _c.port;
|
1053
|
-
return port === name;
|
1054
|
-
})) !== null && _a !== void 0 ? _a : [];
|
1055
|
-
}
|
1056
|
-
return [model];
|
1057
|
-
}));
|
1058
|
-
children$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function (children) {
|
1059
|
-
_this.processChildren(children);
|
1060
|
-
});
|
1061
|
-
};
|
1062
|
-
ElementRendererComponent.prototype.processChildren = function (children) {
|
1063
|
-
var _this = this;
|
1064
|
-
var refs = children.reduce(function (acc, data, index) {
|
1065
|
-
var _c;
|
1066
|
-
var _a;
|
1067
|
-
var key = String((_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : core.UUID.UUID());
|
1068
|
-
var existingRef = _this.refs[key];
|
1069
|
-
var ref = existingRef !== null && existingRef !== void 0 ? existingRef : _this.createComponent(data, index);
|
1070
|
-
if (existingRef) {
|
1071
|
-
_this.updateComponent(existingRef, data, index);
|
1072
|
-
}
|
1073
|
-
return ref ? Object.assign(Object.assign({}, acc), (_c = {}, _c[key] = ref, _c)) : acc;
|
1074
|
-
}, {});
|
1075
|
-
var existingKeys = Object.keys(this.refs);
|
1076
|
-
var newKeys = Object.keys(refs);
|
1077
|
-
lodash.pull.apply(void 0, __spreadArray([existingKeys], __read(newKeys))).forEach(function (key) {
|
1078
|
-
_this.destroyComponent(key);
|
1079
|
-
});
|
1080
|
-
this.refs = refs;
|
1081
|
-
this.cdr.detectChanges();
|
1082
|
-
};
|
1083
|
-
ElementRendererComponent.prototype.getParentLineItem$ = function (parentComp) {
|
1084
|
-
var _this = this;
|
1085
|
-
var _a;
|
1086
|
-
var parentRefs = Object.values((_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.refs) !== null && _a !== void 0 ? _a : {});
|
1087
|
-
var parentRef = parentRefs.find(function (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); });
|
1088
|
-
var parentModel$ = parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance.model$;
|
1089
|
-
return parentModel$ !== null && parentModel$ !== void 0 ? parentModel$ : this.configurationService.get();
|
1090
|
-
};
|
1091
|
-
ElementRendererComponent.prototype.createComponent = function (data, index) {
|
1092
|
-
var _a, _b;
|
1093
|
-
if (!this.factory) {
|
1094
|
-
return;
|
1095
|
-
}
|
1096
|
-
var componentRef = (_a = this.el) === null || _a === void 0 ? void 0 : _a.createComponent(this.factory, index);
|
1097
|
-
if (componentRef) {
|
1098
|
-
componentRef.location.nativeElement.setAttribute('name', this.meta.name);
|
1099
|
-
componentRef.location.nativeElement.setAttribute('path', this.meta.path);
|
1100
|
-
(_b = componentRef.instance) === null || _b === void 0 ? void 0 : _b.model$.next(data);
|
1101
|
-
}
|
1102
|
-
return componentRef;
|
1103
|
-
};
|
1104
|
-
ElementRendererComponent.prototype.updateComponent = function (ref, data, index) {
|
1105
|
-
ref.instance.model$.next(data);
|
1106
|
-
if (this.el && this.el.indexOf(ref.hostView) !== index) {
|
1107
|
-
this.el.move(ref.hostView, index);
|
1108
|
-
}
|
1109
|
-
};
|
1110
|
-
ElementRendererComponent.prototype.destroyComponent = function (key) {
|
1111
|
-
var _a;
|
1112
|
-
(_a = this.refs[key]) === null || _a === void 0 ? void 0 : _a.destroy();
|
1113
|
-
delete this.refs[key];
|
1114
|
-
};
|
1115
|
-
ElementRendererComponent.prototype.destroyComponents = function () {
|
1116
|
-
Object.values(this.refs).forEach(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.destroy(); });
|
1117
|
-
this.refs = {};
|
1118
|
-
};
|
1119
|
-
return ElementRendererComponent;
|
1120
|
-
}());
|
1121
|
-
ElementRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererComponent, deps: [{ token: i0__namespace.Injector, skipSelf: true }, { token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2__namespace.ConfigurationService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
1122
|
-
ElementRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
1123
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererComponent, decorators: [{
|
1124
|
-
type: i0.Component,
|
1125
|
-
args: [{
|
1126
|
-
selector: 'vl-cms-element-renderer',
|
1127
|
-
templateUrl: './element-renderer.component.html',
|
1128
|
-
styleUrls: ['./element-renderer.component.scss'],
|
1129
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1130
|
-
providers: [ElementContextService],
|
1131
|
-
}]
|
1132
|
-
}], ctorParameters: function () {
|
1133
|
-
return [{ type: i0__namespace.Injector, decorators: [{
|
1134
|
-
type: i0.SkipSelf
|
1135
|
-
}] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2__namespace.ConfigurationService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }];
|
1136
|
-
}, propDecorators: { el: [{
|
1137
|
-
type: i0.ViewChild,
|
1138
|
-
args: ['el', { read: i0.ViewContainerRef, static: true }]
|
1139
|
-
}], meta: [{
|
1140
|
-
type: i0.Input
|
1141
|
-
}] } });
|
1142
|
-
|
1143
|
-
var PreviewComponent = /** @class */ (function () {
|
1144
|
-
function PreviewComponent(runtimeService, configurationService, messageService, configurationRuntimeService, integrationState, cdr) {
|
1145
|
-
var _this = this;
|
1146
|
-
this.runtimeService = runtimeService;
|
1147
|
-
this.configurationService = configurationService;
|
1148
|
-
this.messageService = messageService;
|
1149
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
1150
|
-
this.integrationState = integrationState;
|
1151
|
-
this.cdr = cdr;
|
1152
|
-
this.state$ = new rxjs.BehaviorSubject({ loading: true, failure: false });
|
1153
|
-
this.elements = [];
|
1154
|
-
this.destroy$ = new rxjs.Subject();
|
1155
|
-
this.runtimeService.updated$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function () { return _this.cdr.detectChanges(); });
|
1156
|
-
}
|
1157
|
-
PreviewComponent.prototype.ngOnInit = function () {
|
1158
|
-
var _a;
|
1159
|
-
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.clearStateOnInit) {
|
1160
|
-
this.integrationState.clear();
|
1161
|
-
}
|
1162
|
-
this.startPreview();
|
1163
|
-
};
|
1164
|
-
PreviewComponent.prototype.ngOnDestroy = function () {
|
1165
|
-
this.destroy$.next();
|
1166
|
-
this.destroy$.complete();
|
1167
|
-
this.configurationService.reset();
|
1168
|
-
this.runtimeService.clear();
|
1169
|
-
};
|
1170
|
-
PreviewComponent.prototype.initializeConfiguration$ = function () {
|
1171
|
-
var _this = this;
|
1172
|
-
var isAlreadyInitialized = this.configurationRuntimeService.isInitialized;
|
1173
|
-
if (!this.uiDefinition || this.uiDefinition.type !== 'CONFIGURATION' || isAlreadyInitialized) {
|
1174
|
-
return rxjs.of({});
|
1175
|
-
}
|
1176
|
-
if (!this.modelId) {
|
1177
|
-
console.warn("No modelId is given for uiDefinition with '" + this.uiDefinition.type + "' type");
|
1178
|
-
return rxjs.of({});
|
1179
|
-
}
|
1180
|
-
// If still not initialized - init configuration in Test mode
|
1181
|
-
return this.configurationRuntimeService
|
1182
|
-
.initTestMode(this.modelId, this.uiDefinition)
|
1183
|
-
.pipe(rxjs.switchMap(function () { return _this.configurationService.configure(); }));
|
1184
|
-
};
|
1185
|
-
PreviewComponent.prototype.startPreview = function () {
|
1186
|
-
var _this = this;
|
1187
|
-
if (!this.uiDefinition) {
|
1188
|
-
return;
|
1189
|
-
}
|
1190
|
-
rxjs.forkJoin([this.runtimeService.initialize$(this.uiDefinition, this.config), this.initializeConfiguration$()])
|
1191
|
-
.pipe(rxjs.tap(function (_c) {
|
1192
|
-
var _d = __read(_c, 1), elements = _d[0];
|
1193
|
-
_this.elements = elements;
|
1194
|
-
_this.state$.next({ loading: false, failure: false });
|
1195
|
-
}), rxjs.catchError(function (error) {
|
1196
|
-
var _a, _b;
|
1197
|
-
console.error(error);
|
1198
|
-
if (!((_b = (_a = _this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
|
1199
|
-
_this.messageService.add({ severity: 'error', summary: error });
|
1200
|
-
}
|
1201
|
-
_this.state$.next({ loading: false, failure: true });
|
1202
|
-
return rxjs.of();
|
1203
|
-
}), rxjs.takeUntil(this.destroy$))
|
1204
|
-
.subscribe();
|
1205
|
-
};
|
1206
|
-
return PreviewComponent;
|
1207
|
-
}());
|
1208
|
-
PreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewComponent, deps: [{ token: RuntimeService }, { token: i2__namespace.ConfigurationService }, { token: i3__namespace.MessageService }, { token: i2__namespace.ConfigurationRuntimeService }, { token: IntegrationState }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
1209
|
-
PreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", config: "config" }, providers: [IOProviderService, TemplatesService], ngImport: i0__namespace, 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: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.ShadowDom });
|
1210
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewComponent, decorators: [{
|
1211
|
-
type: i0.Component,
|
1212
|
-
args: [{
|
1213
|
-
selector: 'vl-cms-preview',
|
1214
|
-
templateUrl: './preview.component.html',
|
1215
|
-
styleUrls: ['./preview.component.scss'],
|
1216
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1217
|
-
providers: [IOProviderService, TemplatesService],
|
1218
|
-
// use shadow DOM to prevent UI from being affected by global styles
|
1219
|
-
encapsulation: i0.ViewEncapsulation.ShadowDom,
|
1220
|
-
}]
|
1221
|
-
}], ctorParameters: function () { return [{ type: RuntimeService }, { type: i2__namespace.ConfigurationService }, { type: i3__namespace.MessageService }, { type: i2__namespace.ConfigurationRuntimeService }, { type: IntegrationState }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { modelId: [{
|
1222
|
-
type: i0.Input
|
1223
|
-
}], uiDefinition: [{
|
1224
|
-
type: i0.Input
|
1225
|
-
}], config: [{
|
1226
|
-
type: i0.Input
|
1227
|
-
}] } });
|
1228
|
-
|
1229
|
-
var RuntimeEditorService = /** @class */ (function () {
|
1230
|
-
function RuntimeEditorService(runtimeService) {
|
1231
|
-
var _this = this;
|
1232
|
-
this.runtimeService = runtimeService;
|
1233
|
-
this.editorModeSubj$ = new rxjs.BehaviorSubject(false);
|
1234
|
-
this.dragMode$ = new rxjs.BehaviorSubject(false);
|
1235
|
-
this.elementDropped$ = new rxjs.ReplaySubject();
|
1236
|
-
this.elementDeleted$ = new rxjs.ReplaySubject();
|
1237
|
-
this.editorMode$ = this.editorModeSubj$.asObservable();
|
1238
|
-
this.runtimeService.isInitialized$.subscribe(function () { var _a; return _this.editorModeSubj$.next(Boolean((_a = _this.runtimeService.config) === null || _a === void 0 ? void 0 : _a.uiBuilderMode)); });
|
1239
|
-
}
|
1240
|
-
RuntimeEditorService.prototype.applyPatch$ = function (patch) {
|
1241
|
-
return this.runtimeService.applyPatch$(patch);
|
1242
|
-
};
|
1243
|
-
RuntimeEditorService.prototype.toggleEditorMode = function () {
|
1244
|
-
this.editorModeSubj$.next(!this.editorModeSubj$.value);
|
1245
|
-
};
|
1246
|
-
return RuntimeEditorService;
|
1247
|
-
}());
|
1248
|
-
RuntimeEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService, deps: [{ token: RuntimeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1249
|
-
RuntimeEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService });
|
1250
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService, decorators: [{
|
1251
|
-
type: i0.Injectable
|
1252
|
-
}], ctorParameters: function () { return [{ type: RuntimeService }]; } });
|
1253
|
-
|
1254
|
-
var ElementDropHandleComponent = /** @class */ (function () {
|
1255
|
-
function ElementDropHandleComponent(runtimeService) {
|
1256
|
-
this.runtimeService = runtimeService;
|
1257
|
-
}
|
1258
|
-
ElementDropHandleComponent.prototype.handleDrop = function (e) {
|
1259
|
-
this.runtimeService.elementDropped$.next({
|
1260
|
-
element: e.data,
|
1261
|
-
index: this.index,
|
1262
|
-
path: this.parentPath,
|
1263
|
-
});
|
1264
|
-
};
|
1265
|
-
return ElementDropHandleComponent;
|
1266
|
-
}());
|
1267
|
-
ElementDropHandleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleComponent, deps: [{ token: RuntimeEditorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
1268
|
-
ElementDropHandleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: { index: "index", parentPath: "parentPath" }, ngImport: i0__namespace, template: "<div class=\"container\" dndDropzone (dndDrop)=\"handleDrop($event)\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{width:0;position:relative}.container{width:40px;height:100%;position:absolute;transform:translate(-50%);display:flex;justify-content:center;align-items:center}.handle{display:none;background:red;height:calc(100% - 10px);width:2px;pointer-events:none}.container.dndDragover .handle{display:block}\n"], directives: [{ type: i2__namespace$1.DndDropzoneDirective, selector: "[dndDropzone]", inputs: ["dndDropzone", "dndEffectAllowed", "dndAllowExternal", "dndHorizontal", "dndDragoverClass", "dndDropzoneDisabledClass", "dndDisableIf", "dndDisableDropIf"], outputs: ["dndDragover", "dndDrop"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
1269
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleComponent, decorators: [{
|
1270
|
-
type: i0.Component,
|
1271
|
-
args: [{
|
1272
|
-
selector: 'vl-element-drop-handle',
|
1273
|
-
templateUrl: './element-drop-handle.component.html',
|
1274
|
-
styleUrls: ['./element-drop-handle.component.scss'],
|
1275
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1276
|
-
}]
|
1277
|
-
}], ctorParameters: function () { return [{ type: RuntimeEditorService }]; }, propDecorators: { index: [{
|
1278
|
-
type: i0.Input
|
1279
|
-
}], parentPath: [{
|
1280
|
-
type: i0.Input
|
1281
|
-
}] } });
|
1282
|
-
|
1283
|
-
var ElementDropHandleModule = /** @class */ (function () {
|
1284
|
-
function ElementDropHandleModule() {
|
1285
|
-
}
|
1286
|
-
return ElementDropHandleModule;
|
1287
|
-
}());
|
1288
|
-
ElementDropHandleModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1289
|
-
ElementDropHandleModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, declarations: [ElementDropHandleComponent], imports: [i7.CommonModule, i2$1.DndModule], exports: [ElementDropHandleComponent] });
|
1290
|
-
ElementDropHandleModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, imports: [[i7.CommonModule, i2$1.DndModule]] });
|
1291
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, decorators: [{
|
1292
|
-
type: i0.NgModule,
|
1293
|
-
args: [{
|
1294
|
-
declarations: [ElementDropHandleComponent],
|
1295
|
-
imports: [i7.CommonModule, i2$1.DndModule],
|
1296
|
-
exports: [ElementDropHandleComponent],
|
1297
|
-
}]
|
1298
|
-
}] });
|
1299
|
-
|
1300
|
-
var ElementRendererModule = /** @class */ (function () {
|
1301
|
-
function ElementRendererModule() {
|
1302
|
-
}
|
1303
|
-
return ElementRendererModule;
|
1304
|
-
}());
|
1305
|
-
ElementRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1306
|
-
ElementRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, declarations: [ElementRendererComponent], exports: [ElementRendererComponent] });
|
1307
|
-
ElementRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule });
|
1308
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, decorators: [{
|
1309
|
-
type: i0.NgModule,
|
1310
|
-
args: [{
|
1311
|
-
declarations: [ElementRendererComponent],
|
1312
|
-
exports: [ElementRendererComponent],
|
1313
|
-
}]
|
1314
|
-
}] });
|
1315
|
-
|
1316
|
-
var ElementChildrenComponent = /** @class */ (function () {
|
1317
|
-
function ElementChildrenComponent(elementContext, runtimeService, runtimeEditorService, cdr) {
|
1318
|
-
var _this = this;
|
1319
|
-
var _a, _b;
|
1320
|
-
this.elementContext = elementContext;
|
1321
|
-
this.runtimeService = runtimeService;
|
1322
|
-
this.runtimeEditorService = runtimeEditorService;
|
1323
|
-
this.cdr = cdr;
|
1324
|
-
this.destroyed$ = new rxjs.Subject();
|
1325
|
-
var path = (_b = (_a = this.elementContext) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.path;
|
1326
|
-
this.metadata$ = path ? this.runtimeService.getCompiledElement$(path) : rxjs.of(undefined);
|
1327
|
-
this.dragMode$ = rxjs.combineLatest([this.runtimeEditorService.editorMode$, this.runtimeEditorService.dragMode$]).pipe(rxjs.map(function (flags) { return flags.every(Boolean); }));
|
1328
|
-
this.runtimeService.updated$.pipe(rxjs.takeUntil(this.destroyed$)).subscribe(function () { return _this.cdr.detectChanges(); });
|
1329
|
-
}
|
1330
|
-
ElementChildrenComponent.prototype.ngOnDestroy = function () {
|
1331
|
-
this.destroyed$.next();
|
1332
|
-
this.destroyed$.complete();
|
1333
|
-
};
|
1334
|
-
return ElementChildrenComponent;
|
1335
|
-
}());
|
1336
|
-
ElementChildrenComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenComponent, deps: [{ token: ElementContextService }, { token: RuntimeService }, { token: RuntimeEditorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
1337
|
-
ElementChildrenComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementChildrenComponent, selector: "element-children", ngImport: i0__namespace, template: "<ng-container *ngIf=\"metadata$ | async as metadata\">\n <vl-element-drop-handle *ngIf=\"dragMode$ | async\" [index]=\"0\" [parentPath]=\"metadata.path\"></vl-element-drop-handle>\n <ng-container *ngFor=\"let child of metadata.children; let i = index\">\n <vl-cms-element-renderer [meta]=\"child\"></vl-cms-element-renderer>\n <vl-element-drop-handle\n *ngIf=\"dragMode$ | async\"\n [index]=\"i + 1\"\n [parentPath]=\"metadata.path\"\n ></vl-element-drop-handle>\n </ng-container>\n</ng-container>\n", styles: [":host{display:contents}\n"], components: [{ type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: ["index", "parentPath"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
1338
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenComponent, decorators: [{
|
1339
|
-
type: i0.Component,
|
1340
|
-
args: [{
|
1341
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
1342
|
-
selector: 'element-children',
|
1343
|
-
templateUrl: 'element-children.component.html',
|
1344
|
-
styleUrls: ['./element-children.component.scss'],
|
1345
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1346
|
-
}]
|
1347
|
-
}], ctorParameters: function () { return [{ type: ElementContextService }, { type: RuntimeService }, { type: RuntimeEditorService }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
1348
|
-
|
1349
|
-
var ElementChildrenModule = /** @class */ (function () {
|
1350
|
-
function ElementChildrenModule() {
|
1351
|
-
}
|
1352
|
-
return ElementChildrenModule;
|
1353
|
-
}());
|
1354
|
-
ElementChildrenModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1355
|
-
ElementChildrenModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, declarations: [ElementChildrenComponent], imports: [i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule], exports: [ElementChildrenComponent] });
|
1356
|
-
ElementChildrenModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, imports: [[i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule]] });
|
1357
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, decorators: [{
|
1358
|
-
type: i0.NgModule,
|
1359
|
-
args: [{
|
1360
|
-
declarations: [ElementChildrenComponent],
|
1361
|
-
imports: [i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule],
|
1362
|
-
exports: [ElementChildrenComponent],
|
1363
|
-
}]
|
1364
|
-
}] });
|
1365
|
-
|
1366
|
-
var PreviewModule = /** @class */ (function () {
|
1367
|
-
function PreviewModule() {
|
1368
|
-
}
|
1369
|
-
return PreviewModule;
|
1370
|
-
}());
|
1371
|
-
PreviewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1372
|
-
PreviewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, declarations: [PreviewComponent], imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule], exports: [PreviewComponent] });
|
1373
|
-
PreviewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, providers: [IntegrationState], imports: [[i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule]] });
|
1374
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, decorators: [{
|
1375
|
-
type: i0.NgModule,
|
1376
|
-
args: [{
|
1377
|
-
declarations: [PreviewComponent],
|
1378
|
-
imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule],
|
1379
|
-
providers: [IntegrationState],
|
1380
|
-
exports: [PreviewComponent],
|
1381
|
-
}]
|
1382
|
-
}] });
|
1383
|
-
|
1384
|
-
function ElementDefinition(definition) {
|
1385
|
-
return function (constructor) {
|
1386
|
-
return constructor;
|
1387
|
-
};
|
1388
|
-
}
|
1389
|
-
|
1390
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
1391
|
-
var CustomTemplateDirective = /** @class */ (function () {
|
1392
|
-
function CustomTemplateDirective(templateRef, templatesService) {
|
1393
|
-
this.templateRef = templateRef;
|
1394
|
-
this.templatesService = templatesService;
|
1395
|
-
}
|
1396
|
-
CustomTemplateDirective.prototype.ngAfterViewInit = function () {
|
1397
|
-
if (!this.customTemplate) {
|
1398
|
-
return;
|
1399
|
-
}
|
1400
|
-
this.templatesService.register(this.customTemplate, this.templateRef);
|
1401
|
-
};
|
1402
|
-
return CustomTemplateDirective;
|
1403
|
-
}());
|
1404
|
-
CustomTemplateDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomTemplateDirective, deps: [{ token: i0__namespace.TemplateRef }, { token: TemplatesService }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1405
|
-
CustomTemplateDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0__namespace });
|
1406
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomTemplateDirective, decorators: [{
|
1407
|
-
type: i0.Directive,
|
1408
|
-
args: [{ selector: '[customTemplate]' }]
|
1409
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
|
1410
|
-
type: i0.Input
|
1411
|
-
}] } });
|
1412
|
-
|
1413
|
-
var IOPlugin = /** @class */ (function () {
|
1414
|
-
function IOPlugin(host) {
|
1415
|
-
var _this = this;
|
1416
|
-
var _a, _b;
|
1417
|
-
this.host = host;
|
1418
|
-
var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
|
1419
|
-
var inputProvider = this.host.injector.get(IOProviderService);
|
1420
|
-
var inputs = Object.entries((_a = elementMetadata.inputs) !== null && _a !== void 0 ? _a : {});
|
1421
|
-
var outputs = Object.entries((_b = elementMetadata.outputs) !== null && _b !== void 0 ? _b : {});
|
1422
|
-
inputs.forEach(function (_c) {
|
1423
|
-
var _d = __read(_c, 2), key = _d[0], path = _d[1];
|
1424
|
-
var _a;
|
1425
|
-
if (path && typeof path !== 'string') {
|
1426
|
-
console.error("The value of '" + key + "' input should be a string");
|
1427
|
-
}
|
1428
|
-
if (((_a = elementMetadata.outputs) === null || _a === void 0 ? void 0 : _a[key]) !== undefined) {
|
1429
|
-
console.warn("'" + key + "' appears both in inputs and outputs. To prevent inconsistent behavior please keep them unique ");
|
1430
|
-
}
|
1431
|
-
_this.host[key] = inputProvider.connect(elementMetadata, key, path);
|
1432
|
-
});
|
1433
|
-
outputs.forEach(function (_c) {
|
1434
|
-
var _d = __read(_c, 2), key = _d[0], path = _d[1];
|
1435
|
-
if (path && typeof path !== 'string') {
|
1436
|
-
console.error("The value of '" + key + "' output should be a string");
|
1437
|
-
}
|
1438
|
-
_this.host[key] = inputProvider.provide(elementMetadata, key, path);
|
1439
|
-
});
|
1440
|
-
}
|
1441
|
-
return IOPlugin;
|
1442
|
-
}());
|
1443
|
-
IOPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1444
|
-
IOPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: IOPlugin, ngImport: i0__namespace });
|
1445
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOPlugin, decorators: [{
|
1446
|
-
type: i0.Directive
|
1447
|
-
}], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
|
1448
|
-
|
1449
|
-
var RegionPlugin = /** @class */ (function () {
|
1450
|
-
function RegionPlugin(host) {
|
1451
|
-
var _this = this;
|
1452
|
-
this.host = host;
|
1453
|
-
this.destroy$ = new rxjs.Subject();
|
1454
|
-
this.metadata = this.host.injector.get(ELEMENT_METADATA);
|
1455
|
-
this.document = this.host.injector.get(i7.DOCUMENT);
|
1456
|
-
this.el = this.host.injector.get(i0.ElementRef);
|
1457
|
-
var runtimeEditorService = this.host.injector.get(RuntimeEditorService);
|
1458
|
-
runtimeEditorService.editorMode$
|
1459
|
-
.pipe(rxjs.tap(function (editMode) {
|
1460
|
-
var _a;
|
1461
|
-
_this.el.nativeElement.style.outline = editMode ? 'solid 1px #dce5ef' : '';
|
1462
|
-
if (editMode && !_this.metadata.children.length) {
|
1463
|
-
_this.addRegionName();
|
1464
|
-
}
|
1465
|
-
else {
|
1466
|
-
(_a = _this.regionNameEl) === null || _a === void 0 ? void 0 : _a.remove();
|
1467
|
-
}
|
1468
|
-
}), rxjs.takeUntil(this.destroy$))
|
1469
|
-
.subscribe();
|
1470
|
-
}
|
1471
|
-
RegionPlugin.prototype.ngOnDestroy = function () {
|
1472
|
-
this.destroy$.next();
|
1473
|
-
this.destroy$.complete();
|
1474
|
-
};
|
1475
|
-
RegionPlugin.prototype.addRegionName = function () {
|
1476
|
-
if (this.regionNameEl) {
|
1477
|
-
this.regionNameEl.remove();
|
1478
|
-
}
|
1479
|
-
this.regionNameEl = this.document.createElement('div');
|
1480
|
-
this.regionNameEl.innerHTML = this.metadata.name;
|
1481
|
-
lodash.merge(this.regionNameEl.style, {
|
1482
|
-
width: '100%',
|
1483
|
-
height: '100%',
|
1484
|
-
display: 'flex',
|
1485
|
-
justifyContent: 'center',
|
1486
|
-
alignItems: 'center',
|
1487
|
-
color: '#AEB5BD',
|
1488
|
-
pointerEvents: 'none',
|
1489
|
-
userSelect: 'none',
|
1490
|
-
});
|
1491
|
-
this.el.nativeElement.append(this.regionNameEl);
|
1492
|
-
};
|
1493
|
-
return RegionPlugin;
|
1494
|
-
}());
|
1495
|
-
RegionPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegionPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1496
|
-
RegionPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: RegionPlugin, ngImport: i0__namespace });
|
1497
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegionPlugin, decorators: [{
|
1498
|
-
type: i0.Directive
|
1499
|
-
}], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
|
1500
|
-
|
1501
|
-
var ScriptPlugin = /** @class */ (function () {
|
1502
|
-
function ScriptPlugin(host) {
|
1503
|
-
var _this = this;
|
1504
|
-
this.host = host;
|
1505
|
-
this.normalizeImports = function (script, elementPath) {
|
1506
|
-
var regexp = new RegExp("import([ \\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t\"'\\{\\}]+[ \\n\\t]*,?)+\\})?[ \\n\\t]*)from[ \\n\\t]*(['\"])([^'\"\\n]+)(?:['\"]);", 'g');
|
1507
|
-
var result = script.replace(regexp, function (match, g1, g2, src) {
|
1508
|
-
var imports = g1
|
1509
|
-
.trim()
|
1510
|
-
.slice(1, -1)
|
1511
|
-
.split(',')
|
1512
|
-
.map(function (item) { return item.trim(); });
|
1513
|
-
imports.forEach(function (item) {
|
1514
|
-
var _a;
|
1515
|
-
if (!((_a = _this.vendorMap[src]) === null || _a === void 0 ? void 0 : _a[item])) {
|
1516
|
-
throw new Error("Failed to import " + item + " from '" + src + "' in " + elementPath + "/script.ts");
|
1517
|
-
}
|
1518
|
-
});
|
1519
|
-
return "const " + g1 + " = vendor['" + src + "'];";
|
1520
|
-
});
|
1521
|
-
return result;
|
1522
|
-
};
|
1523
|
-
this.document = this.host.injector.get(i7.DOCUMENT);
|
1524
|
-
this.vendorMap = this.host.injector.get(VENDOR_MAP);
|
1525
|
-
var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
|
1526
|
-
var sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
|
1527
|
-
this.addScript(sharedElementMetadata);
|
1528
|
-
this.addScript(elementMetadata);
|
1529
|
-
}
|
1530
|
-
ScriptPlugin.prototype.addScript = function (metadata) {
|
1531
|
-
var _a;
|
1532
|
-
if (!(metadata === null || metadata === void 0 ? void 0 : metadata.script)) {
|
1533
|
-
return;
|
1534
|
-
}
|
1535
|
-
var id = btoa(core.UUID.UUID());
|
1536
|
-
var script = this.document.createElement('script');
|
1537
|
-
script.type = "text/javascript";
|
1538
|
-
var scriptContent = this.normalizeImports(metadata.script, (_a = metadata.path) !== null && _a !== void 0 ? _a : metadata.name);
|
1539
|
-
var classMatch = /export class (\S+)/.exec(scriptContent);
|
1540
|
-
var className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
|
1541
|
-
if (!classMatch || !className) {
|
1542
|
-
console.error("Script doesn't have exported class");
|
1543
|
-
return;
|
1544
|
-
}
|
1545
|
-
scriptContent = scriptContent.replace(classMatch[0], "class " + className);
|
1546
|
-
script.text = "var " + id + " = function(vendor) {" + scriptContent + "\n return " + className + "; };";
|
1547
|
-
this.document.body.appendChild(script);
|
1548
|
-
var ScriptClass = window[id](this.vendorMap);
|
1549
|
-
if (ScriptClass instanceof Object) {
|
1550
|
-
this.host.registerPlugin(new ScriptClass(this.host));
|
1551
|
-
}
|
1552
|
-
this.document.body.removeChild(script);
|
1553
|
-
};
|
1554
|
-
return ScriptPlugin;
|
1555
|
-
}());
|
1556
|
-
ScriptPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ScriptPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1557
|
-
ScriptPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ScriptPlugin, ngImport: i0__namespace });
|
1558
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ScriptPlugin, decorators: [{
|
1559
|
-
type: i0.Directive
|
1560
|
-
}], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
|
1561
|
-
|
1562
|
-
/*
|
1563
|
-
* ScriptPlugin must always be the last plugin in the list to make sure user code is running after all pre-initializers.
|
1564
|
-
*/
|
1565
|
-
var CONFIG = {
|
1566
|
-
CUSTOM: {
|
1567
|
-
component: exports.ElementComponent,
|
1568
|
-
plugins: [IOPlugin, ScriptPlugin],
|
1569
|
-
},
|
1570
|
-
CONTAINER: {
|
1571
|
-
component: exports.ElementComponent,
|
1572
|
-
defaultTemplate: '<element-children></element-children>',
|
1573
|
-
plugins: [ScriptPlugin],
|
1574
|
-
},
|
1575
|
-
SERVICE: {
|
1576
|
-
component: exports.ElementComponent,
|
1577
|
-
plugins: [IOPlugin, ScriptPlugin],
|
1578
|
-
suppressTemplate: true,
|
1579
|
-
suppressStyles: true,
|
1580
|
-
},
|
1581
|
-
REFERENCE: {
|
1582
|
-
component: exports.ElementComponent,
|
1583
|
-
plugins: [IOPlugin, ScriptPlugin],
|
1584
|
-
suppressTemplate: true,
|
1585
|
-
},
|
1586
|
-
PAGE: {
|
1587
|
-
component: exports.ElementComponent,
|
1588
|
-
defaultTemplate: '<element-children></element-children>',
|
1589
|
-
plugins: [IOPlugin, ScriptPlugin],
|
1590
|
-
},
|
1591
|
-
REGION: {
|
1592
|
-
component: exports.ElementComponent,
|
1593
|
-
defaultTemplate: '<element-children></element-children>',
|
1594
|
-
plugins: [IOPlugin, ScriptPlugin, RegionPlugin],
|
1595
|
-
},
|
1596
|
-
};
|
1597
|
-
|
1598
|
-
var EXPORTED_CLASS_REGEX = /export class (\S+)/;
|
1599
|
-
var METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|\r\n|.)*export class/g;
|
1600
|
-
var UiBuildError = /** @class */ (function (_super) {
|
1601
|
-
__extends(UiBuildError, _super);
|
1602
|
-
function UiBuildError(message, affectedMetadata) {
|
1603
|
-
var _this = _super.call(this, message) || this;
|
1604
|
-
_this.name = _this.constructor.name;
|
1605
|
-
_this.affectedMetadata = affectedMetadata;
|
1606
|
-
return _this;
|
1607
|
-
}
|
1608
|
-
return UiBuildError;
|
1609
|
-
}(Error));
|
1610
|
-
var elementToMetadata = function (el, parentPath) {
|
1611
|
-
var _a;
|
1612
|
-
var script = el.script && window.atob(el.script);
|
1613
|
-
var template = el.template && window.atob(el.template);
|
1614
|
-
var styles = el.styles && window.atob(el.styles);
|
1615
|
-
var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
|
1616
|
-
if (!exportedClassName) {
|
1617
|
-
throw new Error("Script doesn't have exported class");
|
1618
|
-
}
|
1619
|
-
var elementMetadata = extractElementMetadata(script || '');
|
1620
|
-
var path = (parentPath ? parentPath + '/' : '') + elementMetadata.name;
|
1621
|
-
return Object.assign(Object.assign({}, elementMetadata), { path: path, script: script === null || script === void 0 ? void 0 : script.replace(METADATA_DECORATOR_REGEX, 'export class'), template: template, styles: styles, children: el.children.map(function (child) { return elementToMetadata(child, path); }) });
|
1622
|
-
};
|
1623
|
-
var metadataToElement = function (metadata, recursive) {
|
1624
|
-
if (recursive === void 0) { recursive = true; }
|
1625
|
-
var cleanMetadata = lodash.omit(metadata, [
|
1626
|
-
'path',
|
1627
|
-
'template',
|
1628
|
-
'styles',
|
1629
|
-
'script',
|
1630
|
-
'metadata',
|
1631
|
-
]);
|
1632
|
-
var elMetadata = Object.assign(Object.assign({}, cleanMetadata), { children: metadata.children.map(function (_e) {
|
1633
|
-
var name = _e.name;
|
1634
|
-
return name;
|
1635
|
-
}) });
|
1636
|
-
var normalizedElMetadata = normalizeElementMetadata(elMetadata);
|
1637
|
-
if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
|
1638
|
-
throw new UiBuildError("'" + metadata.name + "' component script is missing an exported class", metadata);
|
1639
|
-
}
|
1640
|
-
var script = metadata.script &&
|
1641
|
-
window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, "@ElementDefinition(" + stringifyElementMetadata(normalizedElMetadata) + ")\nexport class Script"));
|
1642
|
-
var template = metadata.template && window.btoa(metadata.template);
|
1643
|
-
var styles = metadata.styles && window.btoa(metadata.styles);
|
1644
|
-
return {
|
1645
|
-
script: script,
|
1646
|
-
template: template,
|
1647
|
-
styles: styles,
|
1648
|
-
children: recursive ? metadata.children.map(function (meta) { return metadataToElement(meta); }) : [],
|
1649
|
-
};
|
1650
|
-
};
|
1651
|
-
var normalizeElementMetadata = function (elementMetadata) {
|
1652
|
-
var _a, _b, _c, _d;
|
1653
|
-
var metadata = Object.assign({}, elementMetadata);
|
1654
|
-
// model
|
1655
|
-
var _e = (_a = metadata.model) !== null && _a !== void 0 ? _a : {}, lineItem = _e.lineItem, path = _e.path;
|
1656
|
-
var model = lineItem ? { lineItem: lineItem } : path ? { path: path } : undefined;
|
1657
|
-
if (model) {
|
1658
|
-
metadata.model = model;
|
1659
|
-
}
|
1660
|
-
else {
|
1661
|
-
delete metadata.model;
|
1662
|
-
}
|
1663
|
-
// module
|
1664
|
-
if (!metadata.module) {
|
1665
|
-
delete metadata.module;
|
1666
|
-
}
|
1667
|
-
// reference
|
1668
|
-
if (!metadata.reference) {
|
1669
|
-
delete metadata.reference;
|
1670
|
-
}
|
1671
|
-
// inputs
|
1672
|
-
var inputs = Object.entries((_b = metadata.inputs) !== null && _b !== void 0 ? _b : {}).reduce(function (acc, _e) {
|
1673
|
-
var _f;
|
1674
|
-
var _g = __read(_e, 2), key = _g[0], value = _g[1];
|
1675
|
-
return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
|
1676
|
-
}, {});
|
1677
|
-
if (inputs && Object.keys(inputs).length > 0) {
|
1678
|
-
metadata.inputs = inputs;
|
1679
|
-
}
|
1680
|
-
else {
|
1681
|
-
delete metadata.inputs;
|
1682
|
-
}
|
1683
|
-
// outputs
|
1684
|
-
var outputs = Object.entries((_c = metadata.outputs) !== null && _c !== void 0 ? _c : {}).reduce(function (acc, _e) {
|
1685
|
-
var _f;
|
1686
|
-
var _g = __read(_e, 2), key = _g[0], value = _g[1];
|
1687
|
-
return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
|
1688
|
-
}, {});
|
1689
|
-
if (outputs && Object.keys(outputs).length > 0) {
|
1690
|
-
metadata.outputs = outputs;
|
1691
|
-
}
|
1692
|
-
else {
|
1693
|
-
delete metadata.outputs;
|
1694
|
-
}
|
1695
|
-
// children
|
1696
|
-
if (!((_d = metadata.children) === null || _d === void 0 ? void 0 : _d.length)) {
|
1697
|
-
delete metadata.children;
|
1698
|
-
}
|
1699
|
-
// isShared
|
1700
|
-
if (!metadata.isShared) {
|
1701
|
-
delete metadata.isShared;
|
1702
|
-
}
|
1703
|
-
// configuredStyles
|
1704
|
-
if (!metadata.configuredStyles) {
|
1705
|
-
delete metadata.configuredStyles;
|
1706
|
-
}
|
1707
|
-
return metadata;
|
1708
|
-
};
|
1709
|
-
var extractElementMetadata = function (script) {
|
1710
|
-
var _a;
|
1711
|
-
var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
|
1712
|
-
// need to reset regex last index to prevent null result for next execution
|
1713
|
-
METADATA_DECORATOR_REGEX.lastIndex = 0;
|
1714
|
-
return new Function("return " + metadataString)();
|
1715
|
-
};
|
1716
|
-
var extendElementMetadata = function (script, extend) {
|
1717
|
-
var _a;
|
1718
|
-
var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
|
1719
|
-
// need to reset regex last index to prevent null result for next execution
|
1720
|
-
METADATA_DECORATOR_REGEX.lastIndex = 0;
|
1721
|
-
if (!metadataString) {
|
1722
|
-
return script;
|
1723
|
-
}
|
1724
|
-
var updated = Object.assign(Object.assign({}, new Function("return " + metadataString)()), extend);
|
1725
|
-
return script.replace(metadataString, stringifyElementMetadata(updated));
|
1726
|
-
};
|
1727
|
-
var getElementConfig = function (type) {
|
1728
|
-
return CONFIG[type];
|
1729
|
-
};
|
1730
|
-
var doesElementSupportIO = function (type) {
|
1731
|
-
var _a, _b;
|
1732
|
-
return (_b = (_a = getElementConfig(type).plugins) === null || _a === void 0 ? void 0 : _a.includes(IOPlugin)) !== null && _b !== void 0 ? _b : false;
|
1733
|
-
};
|
1734
|
-
function stringifyElementMetadata(elementMetadata) {
|
1735
|
-
var cleaned = JSON.stringify(elementMetadata, null, 2);
|
1736
|
-
return cleaned.replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, function (match) {
|
1737
|
-
return match.replace(/"/g, '');
|
1738
|
-
});
|
1739
|
-
}
|
1740
|
-
var isValidScript = function (script) {
|
1741
|
-
var _a;
|
1742
|
-
if (!script) {
|
1743
|
-
return false;
|
1744
|
-
}
|
1745
|
-
var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
|
1746
|
-
if (!exportedClassName) {
|
1747
|
-
return false;
|
1748
|
-
}
|
1749
|
-
var meta = extractElementMetadata(script);
|
1750
|
-
if (!meta.name || !meta.type) {
|
1751
|
-
return false;
|
1752
|
-
}
|
1753
|
-
return true;
|
1754
|
-
};
|
1755
|
-
function flattenElements(elements) {
|
1756
|
-
return lodash.flatten(elements.map(function (el) { return __spreadArray([el], __read(flattenElements(el.children))); }));
|
1757
|
-
}
|
1758
|
-
function isSharedElement(el) {
|
1759
|
-
return Boolean(el.isShared) && el.type !== 'REFERENCE';
|
1760
|
-
}
|
1761
|
-
|
1762
|
-
var ConfigurationPlugin = /** @class */ (function () {
|
1763
|
-
function ConfigurationPlugin(host) {
|
1764
|
-
var _this = this;
|
1765
|
-
var _a, _b;
|
1766
|
-
this.host = host;
|
1767
|
-
this.destroy$ = new rxjs.Subject();
|
1768
|
-
this.elementMetadata = this.host.injector.get(ELEMENT_METADATA);
|
1769
|
-
this.configurationService = this.host.injector.get(i2.ConfigurationService);
|
1770
|
-
if ((_a = this.elementMetadata.model) === null || _a === void 0 ? void 0 : _a.lineItem) {
|
1771
|
-
this.host.model$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function (model) { return (_this.modelSnapshot = model); });
|
1772
|
-
var pathBlocks = parseBoundPath((_b = this.elementMetadata.model) === null || _b === void 0 ? void 0 : _b.lineItem);
|
1773
|
-
var _c = pathBlocks.reverse()[0], type = _c.type, property = _c.property, name = _c.name;
|
1774
|
-
this.host.boundName = name !== null && name !== void 0 ? name : type;
|
1775
|
-
this.register(type, property, name);
|
1776
|
-
}
|
1777
|
-
}
|
1778
|
-
ConfigurationPlugin.prototype.ngOnDestroy = function () {
|
1779
|
-
this.destroy$.next();
|
1780
|
-
this.destroy$.complete();
|
1781
|
-
};
|
1782
|
-
ConfigurationPlugin.prototype.register = function (type, property, name) {
|
1783
|
-
if (!type) {
|
1784
|
-
return;
|
1785
|
-
}
|
1786
|
-
if (!property) {
|
1787
|
-
this.registerType();
|
1788
|
-
}
|
1789
|
-
else if (property === 'ports' && name) {
|
1790
|
-
this.registerPort(name);
|
1791
|
-
}
|
1792
|
-
else if (property === 'attributes' && name) {
|
1793
|
-
this.registerAttribute(name);
|
1794
|
-
}
|
1795
|
-
};
|
1796
|
-
ConfigurationPlugin.prototype.registerType = function () {
|
1797
|
-
var _this = this;
|
1798
|
-
var remove = function () {
|
1799
|
-
var rootLineItem = _this.configurationService.getSnapshot();
|
1800
|
-
if (!rootLineItem || !_this.modelSnapshot) {
|
1801
|
-
return;
|
1802
|
-
}
|
1803
|
-
_this.configurationService.patch(new i2.LineItemWorker(rootLineItem).remove(_this.modelSnapshot.id).li);
|
1804
|
-
};
|
1805
|
-
var updateQty = function (qty) {
|
1806
|
-
var rootLineItem = _this.configurationService.getSnapshot();
|
1807
|
-
if (!rootLineItem || !_this.modelSnapshot) {
|
1808
|
-
return;
|
1809
|
-
}
|
1810
|
-
_this.configurationService.patch(new i2.LineItemWorker(rootLineItem).replace(Object.assign(Object.assign({}, _this.modelSnapshot), { qty: qty })).li);
|
1811
|
-
};
|
1812
|
-
this.typeHost.remove = remove;
|
1813
|
-
this.typeHost.updateQty = updateQty;
|
1814
|
-
};
|
1815
|
-
ConfigurationPlugin.prototype.registerPort = function (name) {
|
1816
|
-
var _this = this;
|
1817
|
-
var model$ = this.host.model$;
|
1818
|
-
var portItems$ = model$.pipe(rxjs.map(function (model) { var _a; return (_a = model === null || model === void 0 ? void 0 : model.lineItems.filter(function (li) { return li.port === _this.host.boundName; })) !== null && _a !== void 0 ? _a : []; }));
|
1819
|
-
var portDomain$ = model$.pipe(rxjs.map(function (model) { return model === null || model === void 0 ? void 0 : model.portDomains[_this.host.boundName]; }));
|
1820
|
-
var add = function (type, attributes) {
|
1821
|
-
if (attributes === void 0) { attributes = []; }
|
1822
|
-
if (!_this.modelSnapshot) {
|
1823
|
-
return;
|
1824
|
-
}
|
1825
|
-
var portDomain = _this.modelSnapshot.portDomains[name];
|
1826
|
-
if (!portDomain) {
|
1827
|
-
return;
|
1828
|
-
}
|
1829
|
-
var generated = i2.generateLineItem(portDomain.name, type, _this.modelSnapshot.id, attributes);
|
1830
|
-
_this.configurationService.patch(new i2.LineItemWorker(_this.modelSnapshot).insert(_this.modelSnapshot.id, generated).li);
|
1831
|
-
};
|
1832
|
-
this.portHost.portItems$ = portItems$;
|
1833
|
-
this.portHost.portDomain$ = portDomain$;
|
1834
|
-
this.portHost.addPortItem = add;
|
1835
|
-
};
|
1836
|
-
ConfigurationPlugin.prototype.registerAttribute = function (name) {
|
1837
|
-
var _this = this;
|
1838
|
-
if (!this.host.model$) {
|
1839
|
-
return;
|
1840
|
-
}
|
1841
|
-
var value$ = this.host.model$.pipe(rxjs.map(function (model) { var _a; return i2.getAttributeValue((_a = model === null || model === void 0 ? void 0 : model.attributes) !== null && _a !== void 0 ? _a : [], name); }));
|
1842
|
-
var patch = function (value) {
|
1843
|
-
if (!_this.modelSnapshot) {
|
1844
|
-
return;
|
1845
|
-
}
|
1846
|
-
_this.configurationService.patch(new i2.LineItemWorker(_this.modelSnapshot).patchAttribute([{ name: name, value: value }]).li);
|
1847
|
-
};
|
1848
|
-
this.attributeHost.value$ = value$;
|
1849
|
-
this.attributeHost.patch = patch;
|
1850
|
-
};
|
1851
|
-
Object.defineProperty(ConfigurationPlugin.prototype, "attributeHost", {
|
1852
|
-
get: function () {
|
1853
|
-
return this.host;
|
1854
|
-
},
|
1855
|
-
enumerable: false,
|
1856
|
-
configurable: true
|
1857
|
-
});
|
1858
|
-
Object.defineProperty(ConfigurationPlugin.prototype, "typeHost", {
|
1859
|
-
get: function () {
|
1860
|
-
return this.host;
|
1861
|
-
},
|
1862
|
-
enumerable: false,
|
1863
|
-
configurable: true
|
1864
|
-
});
|
1865
|
-
Object.defineProperty(ConfigurationPlugin.prototype, "portHost", {
|
1866
|
-
get: function () {
|
1867
|
-
return this.host;
|
1868
|
-
},
|
1869
|
-
enumerable: false,
|
1870
|
-
configurable: true
|
1871
|
-
});
|
1872
|
-
return ConfigurationPlugin;
|
1873
|
-
}());
|
1874
|
-
ConfigurationPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ConfigurationPlugin, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1875
|
-
ConfigurationPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ConfigurationPlugin, ngImport: i0__namespace });
|
1876
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ConfigurationPlugin, decorators: [{
|
1877
|
-
type: i0.Directive
|
1878
|
-
}], ctorParameters: function () { return [{ type: undefined }]; } });
|
1879
|
-
|
1880
|
-
var DEFAULT_PLUGINS = {
|
1881
|
-
CONFIGURATION: [ConfigurationPlugin],
|
1882
|
-
DEFAULT: [],
|
1883
|
-
};
|
1884
|
-
|
1885
|
-
var LAYOUT = {
|
1886
|
-
LAYOUT_1: {
|
1887
|
-
styles: "\n/* start of LAYOUT_1 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"header\" auto\n \"main\" 1fr\n \"footer\" auto\n / 1fr;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n min-height: 80px;\n grid-area: header;\n }\n\n &:nth-child(2) > vl-element {\n grid-area: main;\n }\n\n &:nth-child(3) > vl-element {\n min-height: 80px;\n grid-area: footer;\n }\n}\n/* end of LAYOUT_1 styles */\n",
|
1888
|
-
},
|
1889
|
-
LAYOUT_2: {
|
1890
|
-
styles: "\n/* start of LAYOUT_2 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"header header\" auto\n \"left right\" 1fr\n \"footer footer\" auto\n / 1fr 1fr;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n min-height: 80px;\n grid-area: header;\n }\n\n &:nth-child(2) > vl-element {\n grid-area: left;\n }\n\n &:nth-child(3) > vl-element {\n grid-area: right;\n }\n\n &:nth-child(4) > vl-element {\n min-height: 80px;\n grid-area: footer;\n }\n}\n/* end of LAYOUT_2 styles */\n",
|
1891
|
-
},
|
1892
|
-
LAYOUT_3: {
|
1893
|
-
styles: "\n/* start of LAYOUT_3 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"main\" 1fr\n \"footer\" auto\n / 1fr;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n grid-area: main;\n }\n\n &:nth-child(2) > vl-element {\n min-height: 80px;\n grid-area: footer;\n }\n}\n/* end of LAYOUT_3 styles */\n",
|
1894
|
-
},
|
1895
|
-
LAYOUT_4: {
|
1896
|
-
styles: "\n/* start of LAYOUT_4 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"left right\" 1fr\n \"footer footer\" auto\n / auto auto;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n grid-area: left;\n }\n\n &:nth-child(2) > vl-element {\n grid-area: right;\n }\n\n &:nth-child(3) > vl-element {\n min-height: 80px;\n grid-area: footer;\n }\n}\n/* end of LAYOUT_4 styles */\n",
|
1897
|
-
},
|
1898
|
-
LAYOUT_5: {
|
1899
|
-
styles: "\n/* start of LAYOUT_5 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"header\" auto\n \"main\" 1fr\n / 1fr;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n min-height: 80px;\n grid-area: header;\n }\n\n &:nth-child(2) > vl-element {\n grid-area: main;\n }\n}\n/* end of LAYOUT_5 styles */\n",
|
1900
|
-
},
|
1901
|
-
LAYOUT_6: {
|
1902
|
-
styles: "\n/* start of LAYOUT_6 styles */\n:host {\n height: 100%;\n display: grid;\n grid:\n \"main\" 1fr\n / 1fr;\n gap: 10px;\n padding: 10px;\n}\n\n:host ::ng-deep element-children > vl-cms-element-renderer {\n &:nth-child(1) > vl-element {\n grid-area: main;\n }\n}\n/* end of LAYOUT_6 styles */\n",
|
1903
|
-
},
|
1904
|
-
};
|
1905
|
-
|
1906
|
-
var VELOCE_LIBS = {
|
1907
|
-
'@veloceapps/core': {
|
1908
|
-
isDefined: core.isDefined,
|
1909
|
-
Operator: core.Operator,
|
1910
|
-
Predicate: core.Predicate,
|
1911
|
-
parseJsonSafely: core.parseJsonSafely,
|
1912
|
-
},
|
1913
|
-
'@veloceapps/components': {
|
1914
|
-
ToastService: i1.ToastService,
|
1915
|
-
},
|
1916
|
-
'@veloceapps/api': {
|
1917
|
-
SalesforceApiService: api.SalesforceApiService,
|
1918
|
-
QuoteApiService: api.QuoteApiService,
|
1919
|
-
DocumentTemplatesApiService: api.DocumentTemplatesApiService,
|
1920
|
-
DocumentAttachmentApiService: api.DocumentAttachmentApiService,
|
1921
|
-
RampApiService: api.RampApiService,
|
1922
|
-
CatalogApiService: api.CatalogApiService,
|
1923
|
-
DeltaApiService: api.DeltaApiService,
|
1924
|
-
PicklistsApiService: api.PicklistsApiService,
|
1925
|
-
PriceApiService: api.PriceApiService,
|
1926
|
-
ShoppingCartSettingsApiService: api.ShoppingCartSettingsApiService,
|
1927
|
-
ConfigurationSettingsApiService: api.ConfigurationSettingsApiService,
|
1928
|
-
GuidedSellingApiService: api.GuidedSellingApiService,
|
1929
|
-
},
|
1930
|
-
'@veloceapps/sdk/core': Object.assign({ ConfigurationService: i2.ConfigurationService, QuoteDraftService: i2.QuoteDraftService, FlowConfigurationService: i2.FlowConfigurationService, LineItemWorker: i2.LineItemWorker, ProductImagesService: i2.ProductImagesService, ContextService: i2.ContextService }, i2.lineItemUtils),
|
1931
|
-
'@veloceapps/sdk/cms': Object.assign(Object.assign(Object.assign({}, cmsInjectionTokens), cmsActions), { TemplatesService: TemplatesService, IntegrationState: IntegrationState, ResourcesService: ResourcesService }),
|
1932
|
-
};
|
1933
|
-
var VELOCE_LIBS_BACKWARDS_COMPATIBLE = Object.entries(VELOCE_LIBS).reduce(function (trunk, _a) {
|
1934
|
-
var _b;
|
1935
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
1936
|
-
return (Object.assign(Object.assign({}, trunk), (_b = {}, _b[key.replace('@veloceapps/', '@veloce/')] = value, _b)));
|
1937
|
-
}, {});
|
1938
|
-
var vendorMap = Object.assign(Object.assign(Object.assign({}, VELOCE_LIBS), VELOCE_LIBS_BACKWARDS_COMPATIBLE), { '@angular/core': i0__namespace, '@angular/forms': angularForms__namespace, rxjs: rxjs__namespace, 'rxjs/operators': rxjsOperators__namespace, lodash: lodash__namespace });
|
1939
|
-
|
1940
|
-
var ElementsResolver = /** @class */ (function () {
|
1941
|
-
function ElementsResolver(uiDef, elements, sharedElements) {
|
1942
|
-
var _this = this;
|
1943
|
-
if (sharedElements === void 0) { sharedElements = []; }
|
1944
|
-
this.uiDef = uiDef;
|
1945
|
-
this.renderableElements = [];
|
1946
|
-
this.sharedElements = [];
|
1947
|
-
var transpiledElements = this.transpileScripts(elements);
|
1948
|
-
var transpiledSharedElements = this.transpileScripts(sharedElements);
|
1949
|
-
this.sharedElements = this.flattenElements(transpiledElements)
|
1950
|
-
.filter(function (el) { return _this.isSharedElement(el); })
|
1951
|
-
.concat(transpiledSharedElements);
|
1952
|
-
this.elements = transpiledElements.map(function (el) { return _this.processElementMetadata(el); }).filter(core.isDefined);
|
1953
|
-
this.renderableElements = this.getRenderableElements(this.elements);
|
1954
|
-
}
|
1955
|
-
ElementsResolver.prototype.addElement = function (element) {
|
1956
|
-
var _this = this;
|
1957
|
-
if (element.isShared) {
|
1958
|
-
return;
|
1959
|
-
}
|
1960
|
-
var transpiledElements = this.transpileScripts([element]);
|
1961
|
-
this.elements = transpiledElements.map(function (el) { return _this.processElementMetadata(el); }).filter(core.isDefined);
|
1962
|
-
this.renderableElements = this.getRenderableElements(this.elements);
|
1963
|
-
};
|
1964
|
-
ElementsResolver.prototype.getNgComponents = function () {
|
1965
|
-
var _this = this;
|
1966
|
-
return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(core.isDefined);
|
1967
|
-
};
|
1968
|
-
ElementsResolver.prototype.transpile = function (el) {
|
1969
|
-
var _a;
|
1970
|
-
if (!el.script) {
|
1971
|
-
return;
|
1972
|
-
}
|
1973
|
-
var transformed = standalone.transform(el.script, {
|
1974
|
-
filename: el.name + '.ts',
|
1975
|
-
presets: ['typescript'],
|
1976
|
-
sourceMaps: 'inline',
|
1977
|
-
});
|
1978
|
-
return (_a = transformed.code) !== null && _a !== void 0 ? _a : undefined;
|
1979
|
-
};
|
1980
|
-
ElementsResolver.prototype.transpileScripts = function (elements) {
|
1981
|
-
var _this = this;
|
1982
|
-
return elements.map(function (el) { return (Object.assign(Object.assign({}, el), { script: _this.transpile(el), children: _this.transpileScripts(el.children) })); });
|
1983
|
-
};
|
1984
|
-
ElementsResolver.prototype.flattenElements = function (elements) {
|
1985
|
-
var _this = this;
|
1986
|
-
return lodash.flatten(elements.map(function (el) { return __spreadArray([el], __read(_this.flattenElements(el.children))); }));
|
1987
|
-
};
|
1988
|
-
ElementsResolver.prototype.isSharedElement = function (el) {
|
1989
|
-
return Boolean(el.isShared) && el.type !== 'REFERENCE';
|
1990
|
-
};
|
1991
|
-
ElementsResolver.prototype.getRenderableElements = function (elements) {
|
1992
|
-
var e_1, _c;
|
1993
|
-
var _this = this;
|
1994
|
-
var renderable = [];
|
1995
|
-
try {
|
1996
|
-
for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
|
1997
|
-
var el = elements_1_1.value;
|
1998
|
-
if (!this.isSharedElement(el)) {
|
1999
|
-
var children = el.children.filter(function (child) { return !_this.isSharedElement(child); });
|
2000
|
-
var renderableChildren = this.getRenderableElements(children);
|
2001
|
-
renderable.push.apply(renderable, __spreadArray([Object.assign(Object.assign({}, el), { children: children })], __read(renderableChildren)));
|
2002
|
-
}
|
2003
|
-
}
|
2004
|
-
}
|
2005
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
2006
|
-
finally {
|
2007
|
-
try {
|
2008
|
-
if (elements_1_1 && !elements_1_1.done && (_c = elements_1.return)) _c.call(elements_1);
|
2009
|
-
}
|
2010
|
-
finally { if (e_1) throw e_1.error; }
|
2011
|
-
}
|
2012
|
-
return renderable;
|
2013
|
-
};
|
2014
|
-
ElementsResolver.prototype.getSharedElement = function (element) {
|
2015
|
-
if (!element.reference) {
|
2016
|
-
return;
|
2017
|
-
}
|
2018
|
-
return this.sharedElements.find(function (el) { return element.reference === el.name; });
|
2019
|
-
};
|
2020
|
-
ElementsResolver.prototype.resolveElementTemplate = function (element) {
|
2021
|
-
var config = CONFIG[element.type];
|
2022
|
-
var template = !config.suppressTemplate ? element.template : '';
|
2023
|
-
return template || config.defaultTemplate || '';
|
2024
|
-
};
|
2025
|
-
ElementsResolver.prototype.resolveElementStyles = function (element) {
|
2026
|
-
var _a;
|
2027
|
-
var config = CONFIG[element.type];
|
2028
|
-
var styles = !config.suppressStyles ? (_a = element.styles) !== null && _a !== void 0 ? _a : '' : '';
|
2029
|
-
var layout = element.layout && LAYOUT[element.layout];
|
2030
|
-
if (layout === null || layout === void 0 ? void 0 : layout.styles) {
|
2031
|
-
styles += layout.styles;
|
2032
|
-
}
|
2033
|
-
return styles;
|
2034
|
-
};
|
2035
|
-
ElementsResolver.prototype.processElementMetadata = function (sourceElement) {
|
2036
|
-
var _this = this;
|
2037
|
-
var _a, _b;
|
2038
|
-
var finalElement;
|
2039
|
-
if (sourceElement.type === 'REFERENCE') {
|
2040
|
-
var sharedElement = this.getSharedElement(sourceElement);
|
2041
|
-
if (!sharedElement) {
|
2042
|
-
console.warn("Shared element \"" + sourceElement.reference + "\" not found");
|
2043
|
-
return;
|
2044
|
-
}
|
2045
|
-
finalElement = Object.assign(Object.assign({}, sourceElement), { children: this.getSharedChildren(sharedElement.children, sourceElement.path), type: sharedElement.type, template: sharedElement.template, styles: ((_a = sharedElement.styles) !== null && _a !== void 0 ? _a : '') + '\n' + ((_b = sourceElement.styles) !== null && _b !== void 0 ? _b : ''), inputs: Object.assign(Object.assign({}, sharedElement.inputs), sourceElement.inputs), outputs: Object.assign(Object.assign({}, sharedElement.outputs), sourceElement.outputs) });
|
2046
|
-
}
|
2047
|
-
else {
|
2048
|
-
finalElement = sourceElement;
|
2049
|
-
delete sourceElement.reference;
|
2050
|
-
}
|
2051
|
-
finalElement.template = this.resolveElementTemplate(finalElement);
|
2052
|
-
finalElement.styles = this.resolveElementStyles(finalElement);
|
2053
|
-
return Object.assign(Object.assign({}, finalElement), { children: finalElement.children.map(function (child) { return _this.processElementMetadata(child); }).filter(core.isDefined) });
|
2054
|
-
};
|
2055
|
-
ElementsResolver.prototype.getSharedChildren = function (children, parentPath) {
|
2056
|
-
var _this = this;
|
2057
|
-
return children.map(function (c) {
|
2058
|
-
if (!c.path) {
|
2059
|
-
return c;
|
2060
|
-
}
|
2061
|
-
var _c = __read(c.path.split('/').reverse(), 1), elName = _c[0];
|
2062
|
-
var path = parentPath + '/' + elName;
|
2063
|
-
return Object.assign(Object.assign({}, c), { path: path, children: _this.getSharedChildren(c.children, path) });
|
2064
|
-
});
|
2065
|
-
};
|
2066
|
-
ElementsResolver.prototype.resolveElement = function (element) {
|
2067
|
-
var _a;
|
2068
|
-
var config = CONFIG[element.type];
|
2069
|
-
var defaultPlugins = (_a = DEFAULT_PLUGINS[this.uiDef.type]) !== null && _a !== void 0 ? _a : [];
|
2070
|
-
if (!config) {
|
2071
|
-
console.warn("Unknown element type \"" + element.type + "\"");
|
2072
|
-
return;
|
2073
|
-
}
|
2074
|
-
var styles = this.getElementStyles(element);
|
2075
|
-
var component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (styles ? { styles: [styles] } : {})), { providers: [
|
2076
|
-
{ provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
|
2077
|
-
{ provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
|
2078
|
-
{ provide: ELEMENT_METADATA, useValue: element },
|
2079
|
-
{ provide: SHARED_ELEMENT_METADATA, useValue: this.getSharedElement(element) },
|
2080
|
-
{ provide: ELEMENT_CONFIG, useValue: config },
|
2081
|
-
{ provide: VENDOR_MAP, useValue: vendorMap },
|
2082
|
-
] });
|
2083
|
-
var cmp = i0.Component(component)(/** @class */ (function (_super) {
|
2084
|
-
__extends(C, _super);
|
2085
|
-
function C() {
|
2086
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
2087
|
-
}
|
2088
|
-
return C;
|
2089
|
-
}(config.component)));
|
2090
|
-
lodash.set(cmp, 'path', element.path);
|
2091
|
-
return cmp;
|
2092
|
-
};
|
2093
|
-
ElementsResolver.prototype.getElementStyles = function (element) {
|
2094
|
-
var result = '';
|
2095
|
-
var configuredStyles = this.convertInlineStylesToCSS(element.configuredStyles);
|
2096
|
-
if (configuredStyles) {
|
2097
|
-
// order is important: styles written by user in CSS code should has higher priority
|
2098
|
-
result += configuredStyles;
|
2099
|
-
}
|
2100
|
-
if (element.styles) {
|
2101
|
-
result += element.styles;
|
2102
|
-
}
|
2103
|
-
return result || undefined;
|
2104
|
-
};
|
2105
|
-
ElementsResolver.prototype.convertInlineStylesToCSS = function (styles) {
|
2106
|
-
if (!styles) {
|
2107
|
-
return '';
|
2108
|
-
}
|
2109
|
-
var entries = Object.entries(styles);
|
2110
|
-
var result = ':host {\n';
|
2111
|
-
entries.forEach(function (_c) {
|
2112
|
-
var _d = __read(_c, 2), style = _d[0], value = _d[1];
|
2113
|
-
result += " " + lodash.kebabCase(style) + ":" + value + ";\n";
|
2114
|
-
});
|
2115
|
-
result += '}\n';
|
2116
|
-
return result;
|
2117
|
-
};
|
2118
|
-
return ElementsResolver;
|
2119
|
-
}());
|
2120
|
-
|
2121
|
-
var defaultOptions = {
|
2122
|
-
suppressLoading: false,
|
2123
|
-
loadingLabel: 'LOADING',
|
2124
|
-
};
|
2125
|
-
|
2126
|
-
var moduleMap = {};
|
2127
|
-
function loadRemoteEntry(remoteEntry) {
|
2128
|
-
return new Promise(function (resolve, reject) {
|
2129
|
-
if (moduleMap[remoteEntry]) {
|
2130
|
-
resolve();
|
2131
|
-
return;
|
2132
|
-
}
|
2133
|
-
var script = document.createElement('script');
|
2134
|
-
script.src = remoteEntry;
|
2135
|
-
script.onerror = reject;
|
2136
|
-
script.onload = function () {
|
2137
|
-
moduleMap[remoteEntry] = true;
|
2138
|
-
resolve(); // window is the global namespace
|
2139
|
-
};
|
2140
|
-
document.body.append(script);
|
2141
|
-
});
|
2142
|
-
}
|
2143
|
-
function lookupExposedModule(remoteName, exposedModule) {
|
2144
|
-
return __awaiter(this, void 0, void 0, function () {
|
2145
|
-
var container, factory, Module;
|
2146
|
-
return __generator(this, function (_a) {
|
2147
|
-
switch (_a.label) {
|
2148
|
-
case 0:
|
2149
|
-
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
2150
|
-
return [4 /*yield*/, __webpack_init_sharing__('default')];
|
2151
|
-
case 1:
|
2152
|
-
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
2153
|
-
_a.sent();
|
2154
|
-
container = window[remoteName];
|
2155
|
-
// Initialize the container, it may provide shared modules
|
2156
|
-
return [4 /*yield*/, container.init(__webpack_share_scopes__.default)];
|
2157
|
-
case 2:
|
2158
|
-
// Initialize the container, it may provide shared modules
|
2159
|
-
_a.sent();
|
2160
|
-
return [4 /*yield*/, container.get(exposedModule)];
|
2161
|
-
case 3:
|
2162
|
-
factory = _a.sent();
|
2163
|
-
Module = factory();
|
2164
|
-
return [2 /*return*/, Module];
|
2165
|
-
}
|
2166
|
-
});
|
2167
|
-
});
|
2168
|
-
}
|
2169
|
-
function loadRemoteModule(remoteEntry, remoteName, exposedModule) {
|
2170
|
-
return __awaiter(this, void 0, void 0, function () {
|
2171
|
-
return __generator(this, function (_a) {
|
2172
|
-
switch (_a.label) {
|
2173
|
-
case 0: return [4 /*yield*/, loadRemoteEntry(remoteEntry)];
|
2174
|
-
case 1:
|
2175
|
-
_a.sent();
|
2176
|
-
return [4 /*yield*/, lookupExposedModule(remoteName, exposedModule)];
|
2177
|
-
case 2: return [2 /*return*/, _a.sent()];
|
2178
|
-
}
|
2179
|
-
});
|
2180
|
-
});
|
2181
|
-
}
|
2182
|
-
|
2183
|
-
var FederatedComponent = /** @class */ (function () {
|
2184
|
-
function FederatedComponent(injector, compiler, appRef, renderer) {
|
2185
|
-
this.injector = injector;
|
2186
|
-
this.compiler = compiler;
|
2187
|
-
this.appRef = appRef;
|
2188
|
-
this.renderer = renderer;
|
2189
|
-
this.isLoading$ = new rxjs.BehaviorSubject(false);
|
2190
|
-
// configs
|
2191
|
-
this.suppressLoading = defaultOptions.suppressLoading;
|
2192
|
-
this.loadingLabel = defaultOptions.loadingLabel;
|
2193
|
-
}
|
2194
|
-
FederatedComponent.prototype.ngOnChanges = function (changes) {
|
2195
|
-
var _a, _b, _c, _d;
|
2196
|
-
if (changes.data && this.instance) {
|
2197
|
-
this.instance.data = this.data;
|
2198
|
-
}
|
2199
|
-
if (changes.options) {
|
2200
|
-
this.suppressLoading = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.suppressLoading) !== null && _b !== void 0 ? _b : defaultOptions.suppressLoading;
|
2201
|
-
this.loadingLabel = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.loadingLabel) !== null && _d !== void 0 ? _d : defaultOptions.loadingLabel;
|
2202
|
-
}
|
2203
|
-
};
|
2204
|
-
FederatedComponent.prototype.ngOnInit = function () {
|
2205
|
-
this.isLoading$.next(true);
|
2206
|
-
};
|
2207
|
-
FederatedComponent.prototype.ngAfterViewInit = function () {
|
2208
|
-
var _this = this;
|
2209
|
-
var _a, _b, _c, _d, _e, _f;
|
2210
|
-
var remoteEntry = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.remoteEntry) !== null && _b !== void 0 ? _b : this.remoteEntry;
|
2211
|
-
var remoteName = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.remoteName) !== null && _d !== void 0 ? _d : this.remoteName;
|
2212
|
-
var exposedModule = (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.exposedModule) !== null && _f !== void 0 ? _f : this.exposedModule;
|
2213
|
-
if (!remoteEntry || !remoteName || !exposedModule) {
|
2214
|
-
return;
|
2215
|
-
}
|
2216
|
-
loadRemoteModule(remoteEntry, remoteName, exposedModule).then(function (federated) {
|
2217
|
-
_this.compiler.compileModuleAsync(federated[exposedModule]).then(function (moduleFactory) {
|
2218
|
-
var _a, _b, _c;
|
2219
|
-
var rootModuleRef = moduleFactory.create(_this.injector);
|
2220
|
-
var rootComponentFactory = rootModuleRef.componentFactoryResolver.resolveComponentFactory(federated[exposedModule].rootComponent);
|
2221
|
-
var node = document.createElement('div');
|
2222
|
-
var _g = rootComponentFactory.create(_this.injector, [], node), instance = _g.instance, hostView = _g.hostView;
|
2223
|
-
_this.instance = instance;
|
2224
|
-
_this.instance.data = _this.data;
|
2225
|
-
_this.renderer.appendChild((_a = _this.moduleHostRef) === null || _a === void 0 ? void 0 : _a.nativeElement, node);
|
2226
|
-
_this.appRef.attachView(hostView);
|
2227
|
-
(_c = (_b = _this.options) === null || _b === void 0 ? void 0 : _b.onReady) === null || _c === void 0 ? void 0 : _c.call(_b);
|
2228
|
-
_this.isLoading$.next(false);
|
2229
|
-
});
|
2230
|
-
});
|
2231
|
-
};
|
2232
|
-
return FederatedComponent;
|
2233
|
-
}());
|
2234
|
-
FederatedComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedComponent, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.Compiler }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
2235
|
-
FederatedComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", options: "options" }, viewQueries: [{ propertyName: "moduleHostRef", first: true, predicate: ["moduleHost"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div #moduleHost></div>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"], components: [{ type: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
2236
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedComponent, decorators: [{
|
2237
|
-
type: i0.Component,
|
2238
|
-
args: [{
|
2239
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
2240
|
-
selector: 'veloce-host-federated',
|
2241
|
-
templateUrl: './federated.component.html',
|
2242
|
-
styleUrls: ['./federated.component.scss'],
|
2243
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
2244
|
-
}]
|
2245
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.Compiler }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { moduleHostRef: [{
|
2246
|
-
type: i0.ViewChild,
|
2247
|
-
args: ['moduleHost', { static: false }]
|
2248
|
-
}], remoteEntry: [{
|
2249
|
-
type: i0.Input
|
2250
|
-
}], remoteName: [{
|
2251
|
-
type: i0.Input
|
2252
|
-
}], exposedModule: [{
|
2253
|
-
type: i0.Input
|
2254
|
-
}], data: [{
|
2255
|
-
type: i0.Input
|
2256
|
-
}], options: [{
|
2257
|
-
type: i0.Input
|
2258
|
-
}] } });
|
2259
|
-
|
2260
|
-
var FederatedModule = /** @class */ (function () {
|
2261
|
-
function FederatedModule() {
|
2262
|
-
}
|
2263
|
-
return FederatedModule;
|
2264
|
-
}());
|
2265
|
-
FederatedModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2266
|
-
FederatedModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, declarations: [FederatedComponent], imports: [i7.CommonModule, i1.LoaderModule], exports: [FederatedComponent] });
|
2267
|
-
FederatedModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, imports: [[i7.CommonModule, i1.LoaderModule]] });
|
2268
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, decorators: [{
|
2269
|
-
type: i0.NgModule,
|
2270
|
-
args: [{
|
2271
|
-
declarations: [FederatedComponent],
|
2272
|
-
imports: [i7.CommonModule, i1.LoaderModule],
|
2273
|
-
exports: [FederatedComponent],
|
2274
|
-
}]
|
2275
|
-
}] });
|
2276
|
-
|
2277
|
-
var CompilationService = /** @class */ (function () {
|
2278
|
-
function CompilationService(compiler) {
|
2279
|
-
this.compiler = compiler;
|
2280
|
-
}
|
2281
|
-
CompilationService.prototype.compileUIDefinition$ = function (uiDefinition) {
|
2282
|
-
var _this = this;
|
2283
|
-
return rxjs.of([]).pipe(rxjs.switchMap(function () {
|
2284
|
-
var children = uiDefinition.children, pages = uiDefinition.pages, components = uiDefinition.components, uiDefinitionMeta = __rest(uiDefinition, ["children", "pages", "components"]);
|
2285
|
-
_this.uiDefinitionMeta = uiDefinitionMeta;
|
2286
|
-
var elements = __spreadArray(__spreadArray([], __read((children !== null && children !== void 0 ? children : []))), __read((pages !== null && pages !== void 0 ? pages : [])));
|
2287
|
-
var sharedElements = components !== null && components !== void 0 ? components : [];
|
2288
|
-
var metadata = elements.map(function (element) { return elementToMetadata(element); });
|
2289
|
-
var sharedMetadata = sharedElements.map(function (element) { return elementToMetadata(element); });
|
2290
|
-
_this.elementsResolver = new ElementsResolver(uiDefinition, metadata, sharedMetadata);
|
2291
|
-
var module = _this.getModule(_this.elementsResolver.getNgComponents());
|
2292
|
-
return rxjs.combineLatest([
|
2293
|
-
rxjs.from(_this.compiler.compileModuleAndAllComponentsAsync(module)),
|
2294
|
-
rxjs.of(_this.elementsResolver),
|
2295
|
-
]);
|
2296
|
-
}), rxjs.map(function (_b) {
|
2297
|
-
var _c = __read(_b, 2), module = _c[0], elementsResolver = _c[1];
|
2298
|
-
return ({ module: module, elements: elementsResolver.elements });
|
2299
|
-
}));
|
2300
|
-
};
|
2301
|
-
CompilationService.prototype.compileElement$ = function (element) {
|
2302
|
-
var _this = this;
|
2303
|
-
if (!this.uiDefinitionMeta) {
|
2304
|
-
throw 'No UI Definition context';
|
2305
|
-
}
|
2306
|
-
return rxjs.of(this.uiDefinitionMeta).pipe(rxjs.switchMap(function (uiDefinition) {
|
2307
|
-
var _a;
|
2308
|
-
var elementsResolver = (_a = _this.elementsResolver) !== null && _a !== void 0 ? _a : new ElementsResolver(uiDefinition, []);
|
2309
|
-
elementsResolver.addElement(element);
|
2310
|
-
var module = _this.getModule(elementsResolver.getNgComponents());
|
2311
|
-
return rxjs.combineLatest([rxjs.from(_this.compiler.compileModuleAndAllComponentsAsync(module)), rxjs.of(elementsResolver)]);
|
2312
|
-
}), rxjs.map(function (_b) {
|
2313
|
-
var _c = __read(_b, 2), module = _c[0], elementsResolver = _c[1];
|
2314
|
-
return ({ module: module, elements: elementsResolver.elements });
|
2315
|
-
}));
|
2316
|
-
};
|
2317
|
-
CompilationService.prototype.clearModuleCache = function (modules) {
|
2318
|
-
var _this = this;
|
2319
|
-
modules.forEach(function (module) { return _this.compiler.clearCacheFor(module); });
|
2320
|
-
this.uiDefinitionMeta = undefined;
|
2321
|
-
};
|
2322
|
-
CompilationService.prototype.getModule = function (components) {
|
2323
|
-
var staticComponents = [
|
2324
|
-
ElementChildrenComponent,
|
2325
|
-
ElementRendererComponent,
|
2326
|
-
ElementDropHandleComponent,
|
2327
|
-
CustomTemplateDirective,
|
2328
|
-
];
|
2329
|
-
var DynamicModule = /** @class */ (function () {
|
2330
|
-
function DynamicModule() {
|
2331
|
-
}
|
2332
|
-
return DynamicModule;
|
2333
|
-
}());
|
2334
|
-
DynamicModule = __decorate([
|
2335
|
-
i0.NgModule({
|
2336
|
-
imports: [
|
2337
|
-
i7.CommonModule,
|
2338
|
-
angularForms.FormsModule,
|
2339
|
-
angularForms.ReactiveFormsModule,
|
2340
|
-
FederatedModule,
|
2341
|
-
dragDrop.DragDropModule,
|
2342
|
-
i2$1.DndModule,
|
2343
|
-
scrolling.ScrollingModule,
|
2344
|
-
],
|
2345
|
-
declarations: __spreadArray(__spreadArray([], __read(staticComponents)), __read(components)),
|
2346
|
-
jit: true,
|
2347
|
-
})
|
2348
|
-
], DynamicModule);
|
2349
|
-
return DynamicModule;
|
2350
|
-
};
|
2351
|
-
return CompilationService;
|
2352
|
-
}());
|
2353
|
-
CompilationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService, deps: [{ token: i0__namespace.Compiler }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
2354
|
-
CompilationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService });
|
2355
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService, decorators: [{
|
2356
|
-
type: i0.Injectable
|
2357
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Compiler }]; } });
|
2358
|
-
|
2359
|
-
var RuntimeModule = /** @class */ (function () {
|
2360
|
-
function RuntimeModule() {
|
2361
|
-
}
|
2362
|
-
return RuntimeModule;
|
2363
|
-
}());
|
2364
|
-
RuntimeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2365
|
-
RuntimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, imports: [i7.CommonModule, core.CoreModule] });
|
2366
|
-
RuntimeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, providers: [
|
2367
|
-
dynamicdialog.DialogService,
|
2368
|
-
RuntimeService,
|
2369
|
-
RuntimeEditorService,
|
2370
|
-
{ provide: CMS_COMPILATION_SERVICE, useClass: CompilationService },
|
2371
|
-
], imports: [[i7.CommonModule, core.CoreModule]] });
|
2372
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, decorators: [{
|
2373
|
-
type: i0.NgModule,
|
2374
|
-
args: [{
|
2375
|
-
imports: [i7.CommonModule, core.CoreModule],
|
2376
|
-
providers: [
|
2377
|
-
dynamicdialog.DialogService,
|
2378
|
-
RuntimeService,
|
2379
|
-
RuntimeEditorService,
|
2380
|
-
{ provide: CMS_COMPILATION_SERVICE, useClass: CompilationService },
|
2381
|
-
],
|
2382
|
-
}]
|
2383
|
-
}] });
|
2384
|
-
|
2385
|
-
var LauncherModule = /** @class */ (function () {
|
2386
|
-
function LauncherModule() {
|
2387
|
-
}
|
2388
|
-
return LauncherModule;
|
2389
|
-
}());
|
2390
|
-
LauncherModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2391
|
-
LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule], exports: [PreviewModule] });
|
2392
|
-
LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, providers: [IntegrationState, dynamicdialog.DialogService, ResourcesService], imports: [[i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule], PreviewModule] });
|
2393
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, decorators: [{
|
2394
|
-
type: i0.NgModule,
|
2395
|
-
args: [{
|
2396
|
-
imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule],
|
2397
|
-
providers: [IntegrationState, dynamicdialog.DialogService, ResourcesService],
|
2398
|
-
exports: [PreviewModule],
|
2399
|
-
}]
|
2400
|
-
}] });
|
2401
|
-
|
2402
|
-
var migrations = {
|
2403
|
-
2: function () {
|
2404
|
-
throw 'Migration from Legacy UI definition is not possible';
|
2405
|
-
},
|
2406
|
-
3: function (uiDef) {
|
2407
|
-
var _a;
|
2408
|
-
var children = (_a = uiDef.children) !== null && _a !== void 0 ? _a : [];
|
2409
|
-
return Object.assign(Object.assign({}, uiDef), { children: undefined, pages: children, version: 3 });
|
2410
|
-
},
|
2411
|
-
};
|
2412
|
-
|
2413
|
-
var MigrationsService = /** @class */ (function () {
|
2414
|
-
function MigrationsService(toastService) {
|
2415
|
-
this.toastService = toastService;
|
2416
|
-
}
|
2417
|
-
MigrationsService.prototype.migrateUIDefinition = function (uiDef) {
|
2418
|
-
var e_1, _a;
|
2419
|
-
var currentVersion = uiDef.version;
|
2420
|
-
var targetVersion = i2.UI_DEFINITION_VERSION;
|
2421
|
-
var migrateVersions = Object.keys(migrations)
|
2422
|
-
.reduce(function (acc, version) {
|
2423
|
-
var v = Number(version);
|
2424
|
-
if (v > currentVersion && v <= targetVersion) {
|
2425
|
-
acc.push(v);
|
2426
|
-
}
|
2427
|
-
return acc;
|
2428
|
-
}, [])
|
2429
|
-
.sort();
|
2430
|
-
try {
|
2431
|
-
var result = lodash.cloneDeep(uiDef);
|
2432
|
-
try {
|
2433
|
-
for (var migrateVersions_1 = __values(migrateVersions), migrateVersions_1_1 = migrateVersions_1.next(); !migrateVersions_1_1.done; migrateVersions_1_1 = migrateVersions_1.next()) {
|
2434
|
-
var version = migrateVersions_1_1.value;
|
2435
|
-
result = migrations[version](result);
|
2436
|
-
}
|
2437
|
-
}
|
2438
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
2439
|
-
finally {
|
2440
|
-
try {
|
2441
|
-
if (migrateVersions_1_1 && !migrateVersions_1_1.done && (_a = migrateVersions_1.return)) _a.call(migrateVersions_1);
|
2442
|
-
}
|
2443
|
-
finally { if (e_1) throw e_1.error; }
|
2444
|
-
}
|
2445
|
-
return result;
|
2446
|
-
}
|
2447
|
-
catch (e) {
|
2448
|
-
this.toastService.add({ summary: String(e), severity: i1.ToastType.error });
|
2449
|
-
return;
|
2450
|
-
}
|
2451
|
-
};
|
2452
|
-
return MigrationsService;
|
2453
|
-
}());
|
2454
|
-
MigrationsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, deps: [{ token: i1__namespace.ToastService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
2455
|
-
MigrationsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, providedIn: 'root' });
|
2456
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, decorators: [{
|
2457
|
-
type: i0.Injectable,
|
2458
|
-
args: [{ providedIn: 'root' }]
|
2459
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.ToastService }]; } });
|
2460
|
-
|
2461
|
-
var MigrationsModule = /** @class */ (function () {
|
2462
|
-
function MigrationsModule() {
|
2463
|
-
}
|
2464
|
-
return MigrationsModule;
|
2465
|
-
}());
|
2466
|
-
MigrationsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2467
|
-
MigrationsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule });
|
2468
|
-
MigrationsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, providers: [MigrationsService] });
|
2469
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, decorators: [{
|
2470
|
-
type: i0.NgModule,
|
2471
|
-
args: [{
|
2472
|
-
providers: [MigrationsService],
|
2473
|
-
}]
|
2474
|
-
}] });
|
2475
|
-
|
2476
|
-
/**
|
2477
|
-
* Generated bundle index. Do not edit.
|
2478
|
-
*/
|
2479
|
-
|
2480
|
-
exports.ApplyProductConfigurationAction = ApplyProductConfigurationAction;
|
2481
|
-
exports.CloseDocGenAction = CloseDocGenAction;
|
2482
|
-
exports.ConfigureProductAction = ConfigureProductAction;
|
2483
|
-
exports.DEFAULT_PLUGINS_TOKEN = DEFAULT_PLUGINS_TOKEN;
|
2484
|
-
exports.ELEMENT_CONFIG = ELEMENT_CONFIG;
|
2485
|
-
exports.ELEMENT_METADATA = ELEMENT_METADATA;
|
2486
|
-
exports.ElementDefinition = ElementDefinition;
|
2487
|
-
exports.ElementsResolver = ElementsResolver;
|
2488
|
-
exports.IntegrationState = IntegrationState;
|
2489
|
-
exports.LauncherModule = LauncherModule;
|
2490
|
-
exports.MigrationsModule = MigrationsModule;
|
2491
|
-
exports.MigrationsService = MigrationsService;
|
2492
|
-
exports.NavigateBackAction = NavigateBackAction;
|
2493
|
-
exports.NavigateToCatalogAction = NavigateToCatalogAction;
|
2494
|
-
exports.OpenDocGenAction = OpenDocGenAction;
|
2495
|
-
exports.PreviewComponent = PreviewComponent;
|
2496
|
-
exports.PreviewModule = PreviewModule;
|
2497
|
-
exports.RemoteApplyAction = RemoteApplyAction;
|
2498
|
-
exports.RemoteCancelAction = RemoteCancelAction;
|
2499
|
-
exports.ResourcesService = ResourcesService;
|
2500
|
-
exports.RuntimeEditorService = RuntimeEditorService;
|
2501
|
-
exports.RuntimeModule = RuntimeModule;
|
2502
|
-
exports.SHARED_ELEMENT_METADATA = SHARED_ELEMENT_METADATA;
|
2503
|
-
exports.SwitchObjectAction = SwitchObjectAction;
|
2504
|
-
exports.TemplatesService = TemplatesService;
|
2505
|
-
exports.UI_DEFINITION_METADATA = UI_DEFINITION_METADATA;
|
2506
|
-
exports.UiBuildError = UiBuildError;
|
2507
|
-
exports.VENDOR_MAP = VENDOR_MAP;
|
2508
|
-
exports.doesElementSupportIO = doesElementSupportIO;
|
2509
|
-
exports.elementToMetadata = elementToMetadata;
|
2510
|
-
exports.extendElementMetadata = extendElementMetadata;
|
2511
|
-
exports.extractElementMetadata = extractElementMetadata;
|
2512
|
-
exports.findElementByModule = findElementByModule;
|
2513
|
-
exports.findElementByPath = findElementByPath;
|
2514
|
-
exports.flattenElements = flattenElements;
|
2515
|
-
exports.getAbsolutePath = getAbsolutePath;
|
2516
|
-
exports.getElementConfig = getElementConfig;
|
2517
|
-
exports.getElementUniqueName = getElementUniqueName;
|
2518
|
-
exports.insertElement = insertElement;
|
2519
|
-
exports.isSharedElement = isSharedElement;
|
2520
|
-
exports.isValidScript = isValidScript;
|
2521
|
-
exports.metadataToElement = metadataToElement;
|
2522
|
-
exports.normalizeElementMetadata = normalizeElementMetadata;
|
2523
|
-
exports.parseBoundPath = parseBoundPath;
|
2524
|
-
exports.parsePath = parsePath;
|
2525
|
-
exports.removeElement = removeElement;
|
2526
|
-
exports.stringifyElementMetadata = stringifyElementMetadata;
|
2527
|
-
|
2528
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
2529
|
-
|
2530
|
-
}));
|
2531
|
-
//# sourceMappingURL=veloceapps-sdk-cms.umd.js.map
|