cedar-embeddable-editor 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +18 -0
- package/.editorconfig +16 -0
- package/README.md +302 -0
- package/angular.json +153 -0
- package/cedar-embeddable-editor-0.9.0.tgz +0 -0
- package/e2e/protractor.conf.js +36 -0
- package/e2e/src/app.e2e-spec.ts +23 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.json +14 -0
- package/karma.conf.js +32 -0
- package/license.txt +26 -0
- package/package.json +61 -0
- package/src/app/app.component.dev.ts +74 -0
- package/src/app/app.component.html +5 -0
- package/src/app/app.component.prod.ts +76 -0
- package/src/app/app.component.scss +1 -0
- package/src/app/app.module.dev.ts +58 -0
- package/src/app/app.module.prod.ts +56 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.html +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.ts +104 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.html +22 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.ts +135 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.html +44 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.ts +451 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts +92 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.html +18 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.scss +5 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.ts +78 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts +169 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.ts +94 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.html +19 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts +108 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.ts +125 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts +40 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.html +20 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.scss +24 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.ts +36 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.html +2 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.ts +35 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.html +6 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.ts +42 -0
- package/src/app/modules/input-types/input-types.module.ts +139 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.html +13 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.scss +12 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts +42 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.html +117 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.scss +5 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.ts +101 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.html +22 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.scss +23 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.spec.ts +24 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.ts +139 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.html +56 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.scss +13 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.ts +184 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.html +15 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.scss +2 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.ts +240 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.html +35 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.scss +41 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.ts +282 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.html +46 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.scss +7 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.ts +100 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.ts +16 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.spec.ts +54 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.html +26 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.scss +55 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.spec.ts +25 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.html +42 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.scss +31 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.spec.ts +177 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.ts +145 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.service.ts +21 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.html +1 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.scss +0 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.spec.ts +59 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.ts +139 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.ts +17 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.module.ts +35 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.type.ts +24 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.html +18 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.scss +0 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.spec.ts +23 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.ts +10 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.html +16 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.ts +89 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.html +19 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.ts +66 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.service.ts +175 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.html +98 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.scss +0 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.spec.ts +25 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.ts +36 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.html +17 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.scss +110 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.ts +16 -0
- package/src/app/modules/shared/components/static-header/static-header.component.html +10 -0
- package/src/app/modules/shared/components/static-header/static-header.component.scss +13 -0
- package/src/app/modules/shared/components/static-header/static-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-header/static-header.component.ts +21 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.html +16 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.scss +0 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.ts +251 -0
- package/src/app/modules/shared/factory/template-representation.factory.ts +323 -0
- package/src/app/modules/shared/handler/component-type.handler.ts +51 -0
- package/src/app/modules/shared/handler/data-object-builder.handler.ts +159 -0
- package/src/app/modules/shared/handler/data-object-data-value.handler.ts +270 -0
- package/src/app/modules/shared/handler/data-object-structure.handler.ts +145 -0
- package/src/app/modules/shared/handler/multi-instance-object.handler.ts +317 -0
- package/src/app/modules/shared/models/cedar-input-template.model.ts +3 -0
- package/src/app/modules/shared/models/cedar-model.model.ts +48 -0
- package/src/app/modules/shared/models/component/cedar-component.model.ts +16 -0
- package/src/app/modules/shared/models/component/component-representation.model.ts +30 -0
- package/src/app/modules/shared/models/component/element-component.model.ts +11 -0
- package/src/app/modules/shared/models/component/field-component.model.ts +23 -0
- package/src/app/modules/shared/models/component/multi-component.model.ts +10 -0
- package/src/app/modules/shared/models/component/null-component.model.ts +20 -0
- package/src/app/modules/shared/models/component/single-component.model.ts +6 -0
- package/src/app/modules/shared/models/element/abstract-element-component.model.ts +26 -0
- package/src/app/modules/shared/models/element/multi-element-component.model.ts +19 -0
- package/src/app/modules/shared/models/element/single-element-component.model.ts +16 -0
- package/src/app/modules/shared/models/enum/data-object-building-mode.model.ts +6 -0
- package/src/app/modules/shared/models/field/abstract-field-component.model.ts +28 -0
- package/src/app/modules/shared/models/field/multi-field-component.model.ts +21 -0
- package/src/app/modules/shared/models/field/single-field-component.model.ts +18 -0
- package/src/app/modules/shared/models/info/basic-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/choice-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/choice-option.model.ts +6 -0
- package/src/app/modules/shared/models/info/content-info.model.ts +5 -0
- package/src/app/modules/shared/models/info/controlled-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/current-multi-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/label-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/multi-info.model.ts +10 -0
- package/src/app/modules/shared/models/info/multi-instance-info.model.ts +20 -0
- package/src/app/modules/shared/models/info/multi-instance-object-info.model.ts +30 -0
- package/src/app/modules/shared/models/info/number-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/value-info.model.ts +9 -0
- package/src/app/modules/shared/models/input-type.model.ts +21 -0
- package/src/app/modules/shared/models/instance-extract-data.model.ts +3 -0
- package/src/app/modules/shared/models/instance-full-data.model.ts +5 -0
- package/src/app/modules/shared/models/javascript-types.model.ts +7 -0
- package/src/app/modules/shared/models/json-schema.model.ts +39 -0
- package/src/app/modules/shared/models/numbers.model.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-parameter-object.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-value-constraints.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request.ts +9 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response-item.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response.ts +13 -0
- package/src/app/modules/shared/models/static/static-field-component.model.ts +24 -0
- package/src/app/modules/shared/models/template/cedar-template.model.ts +24 -0
- package/src/app/modules/shared/models/template/empty-template.model.ts +5 -0
- package/src/app/modules/shared/models/template/null-template.model.ts +23 -0
- package/src/app/modules/shared/models/template/template-component.model.ts +12 -0
- package/src/app/modules/shared/models/temporal.model.ts +13 -0
- package/src/app/modules/shared/models/ui/cedar-ui-component.model.ts +17 -0
- package/src/app/modules/shared/models/xsd.model.ts +11 -0
- package/src/app/modules/shared/pipe/keep-html.pipe.ts +13 -0
- package/src/app/modules/shared/pipe/rdf.pipe.ts +10 -0
- package/src/app/modules/shared/service/active-component-registry.service.ts +134 -0
- package/src/app/modules/shared/service/component-data.service.ts +25 -0
- package/src/app/modules/shared/service/controlled-field-data.service.ts +37 -0
- package/src/app/modules/shared/service/date-time/custom-date-adapter.ts +19 -0
- package/src/app/modules/shared/service/date-time/date-time.service.ts +30 -0
- package/src/app/modules/shared/service/local-settings.service.ts +22 -0
- package/src/app/modules/shared/service/message-handler.service.ts +35 -0
- package/src/app/modules/shared/service/page-break-paginator.service.ts +78 -0
- package/src/app/modules/shared/shared.module.ts +97 -0
- package/src/app/modules/shared/util/data-context.ts +42 -0
- package/src/app/modules/shared/util/data-object-util.ts +102 -0
- package/src/app/modules/shared/util/handler-context.ts +81 -0
- package/src/app/modules/shared/util/template-object-util.ts +21 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/i18n-cee/en.json +86 -0
- package/src/assets/i18n-cee/hu.json +86 -0
- package/src/assets/images/bmir-logo.png +0 -0
- package/src/assets/images/cedar-logo-80x80.png +0 -0
- package/src/environments/environment.prod.ts +5 -0
- package/src/environments/environment.ts +18 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +16 -0
- package/src/main.ts +28 -0
- package/src/polyfills.ts +65 -0
- package/src/styles-own.scss +352 -0
- package/src/styles.scss +116 -0
- package/src/test.ts +25 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.base.json +20 -0
- package/tsconfig.json +20 -0
- package/tsconfig.spec.json +18 -0
- package/tslint.json +152 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {FormBuilder} from '@angular/forms';
|
|
3
|
+
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
4
|
+
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
5
|
+
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
6
|
+
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
7
|
+
import {StaticFieldComponent} from '../../../shared/models/static/static-field-component.model';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-cedar-static-youtube',
|
|
11
|
+
templateUrl: './cedar-static-youtube.component.html',
|
|
12
|
+
styleUrls: ['./cedar-static-youtube.component.scss'],
|
|
13
|
+
encapsulation: ViewEncapsulation.None
|
|
14
|
+
})
|
|
15
|
+
export class CedarStaticYoutubeComponent extends CedarUIComponent implements OnInit {
|
|
16
|
+
|
|
17
|
+
component: StaticFieldComponent;
|
|
18
|
+
@Input() handlerContext: HandlerContext;
|
|
19
|
+
videoHeight: number = null;
|
|
20
|
+
videoWidth: number = null;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
fb: FormBuilder,
|
|
24
|
+
public cds: ComponentDataService,
|
|
25
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
26
|
+
) {
|
|
27
|
+
super();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ngOnInit(): void {
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Input() set componentToRender(componentToRender: StaticFieldComponent) {
|
|
34
|
+
this.component = componentToRender;
|
|
35
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
setCurrentValue(currentValue: any): void {
|
|
39
|
+
// DO NOTHING
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {NgModule} from '@angular/core';
|
|
2
|
+
import {MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule} from '@angular/material/form-field';
|
|
3
|
+
import {BrowserModule} from '@angular/platform-browser';
|
|
4
|
+
import {HttpClientModule} from '@angular/common/http';
|
|
5
|
+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
6
|
+
import {MatCardModule} from '@angular/material/card';
|
|
7
|
+
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|
8
|
+
import {MatInputModule} from '@angular/material/input';
|
|
9
|
+
import {MatCheckboxModule} from '@angular/material/checkbox';
|
|
10
|
+
import {MatRadioModule} from '@angular/material/radio';
|
|
11
|
+
import {MatIconModule} from '@angular/material/icon';
|
|
12
|
+
import {MatExpansionModule} from '@angular/material/expansion';
|
|
13
|
+
import {MatButtonModule} from '@angular/material/button';
|
|
14
|
+
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
15
|
+
import {ClipboardModule} from '@angular/cdk/clipboard';
|
|
16
|
+
import {MatToolbarModule} from '@angular/material/toolbar';
|
|
17
|
+
import {MatRippleModule} from '@angular/material/core';
|
|
18
|
+
import {MatPaginatorModule} from '@angular/material/paginator';
|
|
19
|
+
import {MatChipsModule} from '@angular/material/chips';
|
|
20
|
+
import {MatGridListModule} from '@angular/material/grid-list';
|
|
21
|
+
import {MatDatepickerModule} from '@angular/material/datepicker';
|
|
22
|
+
import {MatNativeDateModule} from '@angular/material/core';
|
|
23
|
+
import {MatSelectModule} from '@angular/material/select';
|
|
24
|
+
import {NgxMatDatetimePickerModule, NgxMatNativeDateModule, NgxMatTimepickerModule} from '@angular-material-components/datetime-picker';
|
|
25
|
+
import {NgSelectModule} from '@ng-select/ng-select';
|
|
26
|
+
import {CedarInputEmailComponent} from './components/cedar-input-email/cedar-input-email.component';
|
|
27
|
+
import {CedarInputCheckboxComponent} from './components/cedar-input-checkbox/cedar-input-checkbox.component';
|
|
28
|
+
import {CedarInputSelectComponent} from './components/cedar-input-select/cedar-input-select.component';
|
|
29
|
+
import {CedarInputAttributeValueComponent} from './components/cedar-input-attribute-value/cedar-input-attribute-value.component';
|
|
30
|
+
import {CedarInputMultipleChoiceComponent} from './components/cedar-input-multiple-choice/cedar-input-multiple-choice.component';
|
|
31
|
+
import {CedarInputDatetimeComponent} from './components/cedar-input-datetime/cedar-input-datetime.component';
|
|
32
|
+
import {CedarInputLinkComponent} from './components/cedar-input-link/cedar-input-link.component';
|
|
33
|
+
import {CedarInputNumericComponent} from './components/cedar-input-numeric/cedar-input-numeric.component';
|
|
34
|
+
import {CedarInputTextComponent} from './components/cedar-input-text/cedar-input-text.component';
|
|
35
|
+
import {CedarInputPhoneComponent} from './components/cedar-input-phone/cedar-input-phone.component';
|
|
36
|
+
import {CedarStaticRichTextComponent} from './components/cedar-static-rich-text/cedar-static-rich-text.component';
|
|
37
|
+
import {CedarStaticSectionBreakComponent} from './components/cedar-static-section-break/cedar-static-section-break.component';
|
|
38
|
+
import {CedarStaticPageBreakComponent} from './components/cedar-static-page-break/cedar-static-page-break.component';
|
|
39
|
+
import {CedarStaticImageComponent} from './components/cedar-static-image/cedar-static-image.component';
|
|
40
|
+
import {CedarStaticYoutubeComponent} from './components/cedar-static-youtube/cedar-static-youtube.component';
|
|
41
|
+
import {YouTubePlayerModule} from '@angular/youtube-player';
|
|
42
|
+
import {CedarFooBarComponent} from './components/cedar-foo-bar/cedar-foo-bar.component';
|
|
43
|
+
import {CedarInputControlledComponent} from './components/cedar-input-controlled/cedar-input-controlled.component';
|
|
44
|
+
import {MatAutocompleteModule} from '@angular/material/autocomplete';
|
|
45
|
+
import {EscapeHtmlPipe} from '../shared/pipe/keep-html.pipe';
|
|
46
|
+
import {DatePickerComponent} from '../shared/components/date-picker/date-picker.component';
|
|
47
|
+
import {TimezonePickerComponent} from '../shared/components/timezone-picker/timezone-picker.component';
|
|
48
|
+
import {MatFileUploadModule} from '../shared/components/file-uploader/mat-file-upload.module';
|
|
49
|
+
import {FileUploaderComponent} from '../shared/components/file-uploader/file-uploader.component';
|
|
50
|
+
import {TranslateModule} from '@ngx-translate/core';
|
|
51
|
+
|
|
52
|
+
@NgModule({
|
|
53
|
+
imports: [
|
|
54
|
+
BrowserModule,
|
|
55
|
+
HttpClientModule,
|
|
56
|
+
BrowserAnimationsModule,
|
|
57
|
+
MatAutocompleteModule,
|
|
58
|
+
MatCardModule,
|
|
59
|
+
MatFormFieldModule,
|
|
60
|
+
ReactiveFormsModule,
|
|
61
|
+
MatFormFieldModule,
|
|
62
|
+
MatInputModule,
|
|
63
|
+
MatCheckboxModule,
|
|
64
|
+
MatRadioModule,
|
|
65
|
+
MatIconModule,
|
|
66
|
+
MatExpansionModule,
|
|
67
|
+
MatButtonModule,
|
|
68
|
+
MatTooltipModule,
|
|
69
|
+
ClipboardModule,
|
|
70
|
+
MatToolbarModule,
|
|
71
|
+
MatRippleModule,
|
|
72
|
+
MatPaginatorModule,
|
|
73
|
+
MatChipsModule,
|
|
74
|
+
MatGridListModule,
|
|
75
|
+
MatDatepickerModule,
|
|
76
|
+
MatNativeDateModule,
|
|
77
|
+
NgxMatDatetimePickerModule,
|
|
78
|
+
NgxMatTimepickerModule,
|
|
79
|
+
NgxMatNativeDateModule,
|
|
80
|
+
NgSelectModule,
|
|
81
|
+
MatFileUploadModule,
|
|
82
|
+
YouTubePlayerModule,
|
|
83
|
+
FormsModule,
|
|
84
|
+
MatSelectModule,
|
|
85
|
+
TranslateModule
|
|
86
|
+
],
|
|
87
|
+
declarations: [
|
|
88
|
+
CedarFooBarComponent,
|
|
89
|
+
CedarInputTextComponent,
|
|
90
|
+
CedarInputPhoneComponent,
|
|
91
|
+
CedarInputControlledComponent,
|
|
92
|
+
CedarInputNumericComponent,
|
|
93
|
+
CedarInputEmailComponent,
|
|
94
|
+
CedarInputCheckboxComponent,
|
|
95
|
+
CedarInputSelectComponent,
|
|
96
|
+
CedarInputAttributeValueComponent,
|
|
97
|
+
CedarInputMultipleChoiceComponent,
|
|
98
|
+
CedarInputDatetimeComponent,
|
|
99
|
+
CedarInputLinkComponent,
|
|
100
|
+
CedarStaticRichTextComponent,
|
|
101
|
+
CedarStaticSectionBreakComponent,
|
|
102
|
+
CedarStaticPageBreakComponent,
|
|
103
|
+
CedarStaticImageComponent,
|
|
104
|
+
CedarStaticYoutubeComponent,
|
|
105
|
+
DatePickerComponent,
|
|
106
|
+
TimezonePickerComponent,
|
|
107
|
+
FileUploaderComponent,
|
|
108
|
+
EscapeHtmlPipe
|
|
109
|
+
],
|
|
110
|
+
providers: [
|
|
111
|
+
MatDatepickerModule,
|
|
112
|
+
MatNativeDateModule,
|
|
113
|
+
{provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: {appearance: 'outline'}}
|
|
114
|
+
],
|
|
115
|
+
exports: [
|
|
116
|
+
// FooBar is needed because the first component gets exported without style otherwise
|
|
117
|
+
CedarFooBarComponent,
|
|
118
|
+
CedarInputTextComponent,
|
|
119
|
+
CedarInputPhoneComponent,
|
|
120
|
+
CedarInputControlledComponent,
|
|
121
|
+
CedarInputNumericComponent,
|
|
122
|
+
CedarInputEmailComponent,
|
|
123
|
+
CedarInputCheckboxComponent,
|
|
124
|
+
CedarInputSelectComponent,
|
|
125
|
+
CedarInputAttributeValueComponent,
|
|
126
|
+
CedarInputMultipleChoiceComponent,
|
|
127
|
+
CedarInputDatetimeComponent,
|
|
128
|
+
CedarInputLinkComponent,
|
|
129
|
+
CedarStaticRichTextComponent,
|
|
130
|
+
CedarStaticSectionBreakComponent,
|
|
131
|
+
CedarStaticPageBreakComponent,
|
|
132
|
+
CedarStaticImageComponent,
|
|
133
|
+
CedarStaticYoutubeComponent,
|
|
134
|
+
EscapeHtmlPipe,
|
|
135
|
+
FileUploaderComponent
|
|
136
|
+
]
|
|
137
|
+
})
|
|
138
|
+
export class InputTypesModule {
|
|
139
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="flex-container">
|
|
2
|
+
<div *ngIf="shouldRenderRequiredMark">
|
|
3
|
+
{{cds.getRenderingLabelForComponent(component)}}
|
|
4
|
+
<sup style="font-size: medium; color: red" aria-label="required"><b>*</b></sup>
|
|
5
|
+
</div>
|
|
6
|
+
<div *ngIf="!shouldRenderRequiredMark">{{cds.getRenderingLabelForComponent(component)}}</div>
|
|
7
|
+
<div class="flex-child" *ngIf="component.isMultiPage()">
|
|
8
|
+
({{multiComponent.multiInfo.getSafeMinItems()}} .. <span *ngIf="multiComponent.multiInfo.maxItems">{{multiComponent.multiInfo.maxItems}}</span><span *ngIf="!multiComponent.multiInfo.maxItems" matTooltip="{{'Generic.Infinite' | translate}}">∞</span>)
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<mat-icon *ngIf="component.labelInfo.description" matTooltip="{{component.labelInfo.description}}" matTooltipClass="tooltip" matTooltipPosition="right" aria-hidden="false" aria-labelledby="description" class="icon-help" role="tooltip" inline="false">help</mat-icon>
|
|
12
|
+
<span id="Description of {{cds.getRenderingLabelForComponent(component)}}" class="cdk-visually-hidden">{{component.labelInfo.description}}</span>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CedarComponentHeaderComponent } from './cedar-component-header.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarComponentHeaderComponent', () => {
|
|
6
|
+
let component: CedarComponentHeaderComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarComponentHeaderComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async() => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ CedarComponentHeaderComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarComponentHeaderComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {CedarComponent} from '../../models/component/cedar-component.model';
|
|
3
|
+
import {ComponentDataService} from '../../service/component-data.service';
|
|
4
|
+
import {MultiComponent} from '../../models/component/multi-component.model';
|
|
5
|
+
import {ComponentTypeHandler} from '../../handler/component-type.handler';
|
|
6
|
+
import {SingleFieldComponent} from '../../models/field/single-field-component.model';
|
|
7
|
+
import {FieldComponent} from '../../models/component/field-component.model';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-cedar-component-header',
|
|
11
|
+
templateUrl: './cedar-component-header.component.html',
|
|
12
|
+
styleUrls: ['./cedar-component-header.component.scss'],
|
|
13
|
+
encapsulation: ViewEncapsulation.None
|
|
14
|
+
})
|
|
15
|
+
export class CedarComponentHeaderComponent implements OnInit {
|
|
16
|
+
|
|
17
|
+
component: CedarComponent;
|
|
18
|
+
multiComponent: MultiComponent;
|
|
19
|
+
shouldRenderRequiredMark = false;
|
|
20
|
+
|
|
21
|
+
constructor(public cds: ComponentDataService) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
ngOnInit(): void {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Input() set componentToRender(componentToRender: CedarComponent) {
|
|
28
|
+
this.component = componentToRender;
|
|
29
|
+
if (ComponentTypeHandler.isMulti(componentToRender)) {
|
|
30
|
+
this.multiComponent = componentToRender as MultiComponent;
|
|
31
|
+
} else {
|
|
32
|
+
this.multiComponent = null;
|
|
33
|
+
}
|
|
34
|
+
if (this.component instanceof SingleFieldComponent){
|
|
35
|
+
const fieldComp = this.component as unknown as FieldComponent;
|
|
36
|
+
if (fieldComp.valueInfo.requiredValue){
|
|
37
|
+
this.shouldRenderRequiredMark = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<ng-container *ngIf="iterableComponent">
|
|
2
|
+
<mat-accordion multi>
|
|
3
|
+
<mat-expansion-panel (opened)="panelOpenState = true"
|
|
4
|
+
(closed)="panelOpenState = false; allExpanded = false" [expanded]="panelOpenState">
|
|
5
|
+
<mat-expansion-panel-header>
|
|
6
|
+
<mat-panel-title>
|
|
7
|
+
<app-cedar-component-header *ngIf="!iterableComponent.linkedStaticFieldComponent"
|
|
8
|
+
[componentToRender]="iterableComponent"
|
|
9
|
+
></app-cedar-component-header>
|
|
10
|
+
</mat-panel-title>
|
|
11
|
+
</mat-expansion-panel-header>
|
|
12
|
+
<app-cedar-multi-pager *ngIf="iterableComponent.isMulti()"
|
|
13
|
+
[componentToRender]="iterableAsMultiComponent"
|
|
14
|
+
[handlerContext]="handlerContext"
|
|
15
|
+
[isAlignedUp]=true>
|
|
16
|
+
</app-cedar-multi-pager>
|
|
17
|
+
<mat-card-content *ngIf="shouldRenderContentOfIterable(iterableComponent)">
|
|
18
|
+
<ng-container *ngIf="iterableComponent.linkedStaticFieldComponent">
|
|
19
|
+
<!-- These are the collapsed static components before elements -->
|
|
20
|
+
<app-cedar-static-image *ngIf="iterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.image"
|
|
21
|
+
[componentToRender]="iterableComponent.linkedStaticFieldComponent"
|
|
22
|
+
[handlerContext]="handlerContext"></app-cedar-static-image>
|
|
23
|
+
<app-cedar-static-youtube *ngIf="iterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.youtube"
|
|
24
|
+
[componentToRender]="iterableComponent.linkedStaticFieldComponent"
|
|
25
|
+
[handlerContext]="handlerContext"></app-cedar-static-youtube>
|
|
26
|
+
<app-cedar-static-rich-text *ngIf="iterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.richText"
|
|
27
|
+
[componentToRender]="iterableComponent.linkedStaticFieldComponent"
|
|
28
|
+
[handlerContext]="handlerContext"></app-cedar-static-rich-text>
|
|
29
|
+
</ng-container>
|
|
30
|
+
<ng-container *ngFor="let childComponent of iterableComponent.children">
|
|
31
|
+
<app-cedar-component-renderer
|
|
32
|
+
[componentToRender]="childComponent"
|
|
33
|
+
[handlerContext]="handlerContext"
|
|
34
|
+
[allExpanded]="allExpanded"
|
|
35
|
+
></app-cedar-component-renderer>
|
|
36
|
+
</ng-container>
|
|
37
|
+
</mat-card-content>
|
|
38
|
+
</mat-expansion-panel>
|
|
39
|
+
</mat-accordion>
|
|
40
|
+
</ng-container>
|
|
41
|
+
<ng-container *ngIf="nonIterableComponent">
|
|
42
|
+
<mat-card class="child-component-card non-iterable-component">
|
|
43
|
+
<mat-card-content *ngIf="shouldRenderContentOfNonIterable(nonIterableComponent)">
|
|
44
|
+
<app-cedar-component-header *ngIf="!nonIterableComponent.linkedStaticFieldComponent"
|
|
45
|
+
[componentToRender]="nonIterableComponent"
|
|
46
|
+
></app-cedar-component-header>
|
|
47
|
+
<app-cedar-multi-pager *ngIf="nonIterableComponent.isMultiPage()"
|
|
48
|
+
[componentToRender]="nonIterableComponent"
|
|
49
|
+
[handlerContext]="handlerContext"
|
|
50
|
+
[isAlignedUp]=false>
|
|
51
|
+
></app-cedar-multi-pager>
|
|
52
|
+
<ng-container tabIndex="0" *ngIf="nonIterableComponent.linkedStaticFieldComponent && showStaticText">
|
|
53
|
+
<!-- These are the collapsed static components before fields-->
|
|
54
|
+
<app-cedar-static-image *ngIf="nonIterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.image"
|
|
55
|
+
[componentToRender]="nonIterableComponent.linkedStaticFieldComponent"
|
|
56
|
+
[handlerContext]="handlerContext"></app-cedar-static-image>
|
|
57
|
+
<app-cedar-static-youtube *ngIf="nonIterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.youtube"
|
|
58
|
+
[componentToRender]="nonIterableComponent.linkedStaticFieldComponent"
|
|
59
|
+
[handlerContext]="handlerContext"></app-cedar-static-youtube>
|
|
60
|
+
<app-cedar-static-rich-text *ngIf="nonIterableComponent.linkedStaticFieldComponent.basicInfo.inputType==InputType.richText"
|
|
61
|
+
[componentToRender]="nonIterableComponent.linkedStaticFieldComponent"
|
|
62
|
+
[handlerContext]="handlerContext"></app-cedar-static-rich-text>
|
|
63
|
+
</ng-container>
|
|
64
|
+
<!-- These are the regular components -->
|
|
65
|
+
<app-cedar-input-numeric *ngIf="nonIterableComponent.basicInfo.inputType==InputType.numeric"
|
|
66
|
+
[componentToRender]="nonIterableComponent"
|
|
67
|
+
[handlerContext]="handlerContext"></app-cedar-input-numeric>
|
|
68
|
+
<app-cedar-input-text *ngIf="nonIterableComponent.basicInfo.inputType==InputType.text ||
|
|
69
|
+
nonIterableComponent.basicInfo.inputType==InputType.textarea"
|
|
70
|
+
[componentToRender]="nonIterableComponent"
|
|
71
|
+
[handlerContext]="handlerContext"></app-cedar-input-text>
|
|
72
|
+
<app-cedar-input-controlled *ngIf="nonIterableComponent.basicInfo.inputType==InputType.controlled"
|
|
73
|
+
[componentToRender]="nonIterableComponent"
|
|
74
|
+
[handlerContext]="handlerContext"></app-cedar-input-controlled>
|
|
75
|
+
<app-cedar-input-email *ngIf="nonIterableComponent.basicInfo.inputType==InputType.email"
|
|
76
|
+
[componentToRender]="nonIterableComponent"
|
|
77
|
+
[handlerContext]="handlerContext"></app-cedar-input-email>
|
|
78
|
+
<app-cedar-input-checkbox *ngIf="nonIterableComponent.basicInfo.inputType==InputType.checkbox"
|
|
79
|
+
[componentToRender]="nonIterableComponent"
|
|
80
|
+
[handlerContext]="handlerContext"></app-cedar-input-checkbox>
|
|
81
|
+
<app-cedar-input-select *ngIf="nonIterableComponent.basicInfo.inputType==InputType.list"
|
|
82
|
+
[componentToRender]="nonIterableComponent"
|
|
83
|
+
[handlerContext]="handlerContext"></app-cedar-input-select>
|
|
84
|
+
<app-cedar-input-attribute-value *ngIf="nonIterableComponent.basicInfo.inputType==InputType.attributeValue"
|
|
85
|
+
[componentToRender]="nonIterableComponent"
|
|
86
|
+
[handlerContext]="handlerContext"></app-cedar-input-attribute-value>
|
|
87
|
+
<app-cedar-input-multiple-choice *ngIf="nonIterableComponent.basicInfo.inputType==InputType.radio"
|
|
88
|
+
[componentToRender]="nonIterableComponent"
|
|
89
|
+
[handlerContext]="handlerContext"></app-cedar-input-multiple-choice>
|
|
90
|
+
<app-cedar-input-datetime *ngIf="nonIterableComponent.basicInfo.inputType==InputType.temporal"
|
|
91
|
+
[componentToRender]="nonIterableComponent"
|
|
92
|
+
[handlerContext]="handlerContext"></app-cedar-input-datetime>
|
|
93
|
+
<app-cedar-input-link *ngIf="nonIterableComponent.basicInfo.inputType==InputType.link"
|
|
94
|
+
[componentToRender]="nonIterableComponent"
|
|
95
|
+
[handlerContext]="handlerContext"></app-cedar-input-link>
|
|
96
|
+
<app-cedar-input-phone *ngIf="nonIterableComponent.basicInfo.inputType==InputType.phoneNumber"
|
|
97
|
+
[componentToRender]="nonIterableComponent"
|
|
98
|
+
[handlerContext]="handlerContext"></app-cedar-input-phone>
|
|
99
|
+
</mat-card-content>
|
|
100
|
+
</mat-card>
|
|
101
|
+
</ng-container>
|
|
102
|
+
<ng-container *ngIf="staticComponent">
|
|
103
|
+
<!-- This is the normal section break -->
|
|
104
|
+
<app-cedar-static-section-break *ngIf="staticComponent.basicInfo.inputType==InputType.sectionBreak"
|
|
105
|
+
[componentToRender]="staticComponent"
|
|
106
|
+
[handlerContext]="handlerContext"></app-cedar-static-section-break>
|
|
107
|
+
<!-- These are the non-collapsed static components -->
|
|
108
|
+
<app-cedar-static-image *ngIf="staticComponent.basicInfo.inputType==InputType.image"
|
|
109
|
+
[componentToRender]="staticComponent"
|
|
110
|
+
[handlerContext]="handlerContext"></app-cedar-static-image>
|
|
111
|
+
<app-cedar-static-youtube *ngIf="staticComponent.basicInfo.inputType==InputType.youtube"
|
|
112
|
+
[componentToRender]="staticComponent"
|
|
113
|
+
[handlerContext]="handlerContext"></app-cedar-static-youtube>
|
|
114
|
+
<app-cedar-static-rich-text *ngIf="staticComponent.basicInfo.inputType==InputType.richText"
|
|
115
|
+
[componentToRender]="staticComponent"
|
|
116
|
+
[handlerContext]="handlerContext"></app-cedar-static-rich-text>
|
|
117
|
+
</ng-container>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CedarComponentRendererComponent } from './cedar-component-renderer.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarComponentRendererComponent', () => {
|
|
6
|
+
let component: CedarComponentRendererComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarComponentRendererComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ CedarComponentRendererComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarComponentRendererComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {CedarComponent} from '../../models/component/cedar-component.model';
|
|
3
|
+
import {ElementComponent} from '../../models/component/element-component.model';
|
|
4
|
+
import {SingleElementComponent} from '../../models/element/single-element-component.model';
|
|
5
|
+
import {MultiElementComponent} from '../../models/element/multi-element-component.model';
|
|
6
|
+
import {CedarTemplate} from '../../models/template/cedar-template.model';
|
|
7
|
+
import {FieldComponent} from '../../models/component/field-component.model';
|
|
8
|
+
import {MultiFieldComponent} from '../../models/field/multi-field-component.model';
|
|
9
|
+
import {SingleFieldComponent} from '../../models/field/single-field-component.model';
|
|
10
|
+
import {MultiInfo} from '../../models/info/multi-info.model';
|
|
11
|
+
import {HandlerContext} from '../../util/handler-context';
|
|
12
|
+
import {StaticFieldComponent} from '../../models/static/static-field-component.model';
|
|
13
|
+
import {InputType} from '../../models/input-type.model';
|
|
14
|
+
import {MultiComponent} from '../../models/component/multi-component.model';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'app-cedar-component-renderer',
|
|
18
|
+
templateUrl: './cedar-component-renderer.component.html',
|
|
19
|
+
styleUrls: ['./cedar-component-renderer.component.scss'],
|
|
20
|
+
encapsulation: ViewEncapsulation.None
|
|
21
|
+
})
|
|
22
|
+
export class CedarComponentRendererComponent implements OnInit {
|
|
23
|
+
|
|
24
|
+
protected readonly InputType = InputType;
|
|
25
|
+
|
|
26
|
+
private component: CedarComponent;
|
|
27
|
+
iterableComponent: ElementComponent;
|
|
28
|
+
nonIterableComponent: FieldComponent;
|
|
29
|
+
iterableAsMultiComponent: MultiComponent;
|
|
30
|
+
staticComponent: StaticFieldComponent;
|
|
31
|
+
multiInfo: MultiInfo;
|
|
32
|
+
panelOpenState: boolean;
|
|
33
|
+
@Input() handlerContext: HandlerContext;
|
|
34
|
+
@Input() showStaticText: boolean;
|
|
35
|
+
// tslint:disable-next-line:variable-name
|
|
36
|
+
private _allExpanded = false;
|
|
37
|
+
@Input()
|
|
38
|
+
get allExpanded(): boolean {
|
|
39
|
+
return this._allExpanded;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set allExpanded(allExpanded: boolean) {
|
|
43
|
+
this.panelOpenState = allExpanded;
|
|
44
|
+
this._allExpanded = allExpanded;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
constructor() {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ngOnInit(): void {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Input() set componentToRender(componentToRender: CedarComponent) {
|
|
54
|
+
this.component = componentToRender;
|
|
55
|
+
this.iterableComponent = null;
|
|
56
|
+
this.nonIterableComponent = null;
|
|
57
|
+
this.iterableAsMultiComponent = null;
|
|
58
|
+
if (componentToRender instanceof SingleElementComponent ||
|
|
59
|
+
componentToRender instanceof MultiElementComponent ||
|
|
60
|
+
componentToRender instanceof CedarTemplate) {
|
|
61
|
+
this.iterableComponent = componentToRender as ElementComponent;
|
|
62
|
+
if (componentToRender instanceof MultiElementComponent) {
|
|
63
|
+
this.multiInfo = (componentToRender as MultiElementComponent).multiInfo;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (componentToRender instanceof SingleFieldComponent ||
|
|
67
|
+
componentToRender instanceof MultiFieldComponent) {
|
|
68
|
+
this.nonIterableComponent = componentToRender as FieldComponent;
|
|
69
|
+
if (componentToRender instanceof MultiFieldComponent) {
|
|
70
|
+
this.multiInfo = (componentToRender as MultiFieldComponent).multiInfo;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (componentToRender instanceof StaticFieldComponent) {
|
|
74
|
+
this.staticComponent = componentToRender as StaticFieldComponent;
|
|
75
|
+
}
|
|
76
|
+
if (this.iterableComponent != null && this.iterableComponent.isMulti()) {
|
|
77
|
+
this.iterableAsMultiComponent = this.iterableComponent as unknown as MultiComponent;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
shouldRenderContentOfIterable(iterableComponent: ElementComponent): boolean {
|
|
82
|
+
if (iterableComponent.isMulti()) {
|
|
83
|
+
const multiElement: MultiElementComponent = iterableComponent as MultiElementComponent;
|
|
84
|
+
if (!this.handlerContext.multiInstanceObjectService.hasMultiInstances(multiElement)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
shouldRenderContentOfNonIterable(nonIterableComponent: FieldComponent): boolean {
|
|
92
|
+
if (nonIterableComponent.isMulti()) {
|
|
93
|
+
const multiField: MultiFieldComponent = nonIterableComponent as MultiFieldComponent;
|
|
94
|
+
if (!this.handlerContext.multiInstanceObjectService.hasMultiInstances(multiField)) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div class="flex-container-data-saver">
|
|
2
|
+
<div class="flex-child1" *ngIf="showProgress || showSuccess || showError">
|
|
3
|
+
<div *ngIf="showProgress" class="notify-progress"><mat-spinner [diameter]="16" class="notify-progress-icon"></mat-spinner>{{progressMessage}}</div>
|
|
4
|
+
<div *ngIf="showSuccess" class="notify-success">{{successMessage}}
|
|
5
|
+
<button type="button" class="close" (click)="clearSuccess()">
|
|
6
|
+
<span aria-hidden="true">×</span>
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
<div *ngIf="showError" class="notify-error">{{errorMessage}}
|
|
10
|
+
<button type="button" class="close" (click)="clearError()">
|
|
11
|
+
<span aria-hidden="true">×</span>
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex-child2">
|
|
16
|
+
<button mat-raised-button color="primary" class="metadata-save-button" (click)="saveTemplate($event)">{{'Generic.SAVE' | translate}}</button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.flex-container-data-saver {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: right;
|
|
5
|
+
margin-bottom: 20px;
|
|
6
|
+
|
|
7
|
+
.flex-child1 {
|
|
8
|
+
flex: 1 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.flex-child2 {
|
|
12
|
+
width: 170px;
|
|
13
|
+
text-align: right;
|
|
14
|
+
margin-right: 17px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.metadata-save-button {
|
|
19
|
+
padding: 8px 50px !important;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { CedarDataSaverComponent } from './cedar-data-saver.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarDataSaverComponent', () => {
|
|
5
|
+
let component: CedarDataSaverComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarDataSaverComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async() => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ CedarDataSaverComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarDataSaverComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|