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
package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation, ViewChild} from '@angular/core';
|
|
2
|
+
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
|
|
3
|
+
import {ErrorStateMatcher} from '@angular/material/core';
|
|
4
|
+
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
5
|
+
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
6
|
+
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
7
|
+
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
8
|
+
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
9
|
+
export class TextFieldErrorStateMatcher implements ErrorStateMatcher {
|
|
10
|
+
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
11
|
+
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-cedar-input-select',
|
|
16
|
+
templateUrl: './cedar-input-select.component.html',
|
|
17
|
+
styleUrls: ['./cedar-input-select.component.scss'],
|
|
18
|
+
encapsulation: ViewEncapsulation.None
|
|
19
|
+
})
|
|
20
|
+
export class CedarInputSelectComponent extends CedarUIComponent implements OnInit {
|
|
21
|
+
@ViewChild('inputSelect') selectElement;
|
|
22
|
+
readonly ITEM_ID_FIELD = 'id';
|
|
23
|
+
readonly ITEM_TEXT_FIELD = 'label';
|
|
24
|
+
|
|
25
|
+
component: FieldComponent;
|
|
26
|
+
dropdownList = [];
|
|
27
|
+
selectedItems: any;
|
|
28
|
+
options: FormGroup;
|
|
29
|
+
inputValueControl = new FormControl(null, null);
|
|
30
|
+
errorStateMatcher = new TextFieldErrorStateMatcher();
|
|
31
|
+
selections: string[];
|
|
32
|
+
maxSelections: number;
|
|
33
|
+
@Input() handlerContext: HandlerContext;
|
|
34
|
+
|
|
35
|
+
constructor(private activeComponentRegistry: ActiveComponentRegistryService, public cds: ComponentDataService, fb: FormBuilder) {
|
|
36
|
+
super();
|
|
37
|
+
this.options = fb.group({
|
|
38
|
+
inputValue: this.inputValueControl,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
ngOnInit(): void {
|
|
42
|
+
this.populateItemsOnLoad();
|
|
43
|
+
const validators: any[] = [];
|
|
44
|
+
|
|
45
|
+
if (this.component.valueInfo.requiredValue) {
|
|
46
|
+
validators.push(Validators.required);
|
|
47
|
+
}
|
|
48
|
+
this.inputValueControl = new FormControl(null, validators);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
52
|
+
this.component = componentToRender;
|
|
53
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
54
|
+
this.maxSelections = this.component.multiInfo.maxItems;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
inputChanged(): void {
|
|
58
|
+
const values = this.inputValueControl.value || [];
|
|
59
|
+
if ( this.maxSelections === undefined || (values && values.length <= this.maxSelections) ){
|
|
60
|
+
this.selections = values;
|
|
61
|
+
} else {
|
|
62
|
+
this.inputValueControl.setValue(this.selections);
|
|
63
|
+
}
|
|
64
|
+
// close dropdown if max selections reached
|
|
65
|
+
if (this.selectElement && this.maxSelections !== undefined && (values && values.length === this.maxSelections)){
|
|
66
|
+
this.selectElement.close();
|
|
67
|
+
}
|
|
68
|
+
this.changeValue(this.selections);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setCurrentValue(currentValue: any): void {
|
|
72
|
+
this.inputValueControl.setValue(currentValue);
|
|
73
|
+
}
|
|
74
|
+
private populateItemsOnLoad(): void {
|
|
75
|
+
const multi = this.component.choiceInfo.multipleChoice;
|
|
76
|
+
if (multi) {
|
|
77
|
+
this.selectedItems = [];
|
|
78
|
+
}
|
|
79
|
+
for (const choice of this.component.choiceInfo.choices) {
|
|
80
|
+
const entry = {};
|
|
81
|
+
entry[this.ITEM_ID_FIELD] = choice.label;
|
|
82
|
+
entry[this.ITEM_TEXT_FIELD] = choice.label;
|
|
83
|
+
this.dropdownList.push(entry);
|
|
84
|
+
|
|
85
|
+
if (choice.selectedByDefault) {
|
|
86
|
+
if (multi) {
|
|
87
|
+
this.selectedItems.push(entry);
|
|
88
|
+
} else {
|
|
89
|
+
this.selectedItems = entry;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.inputChanged();
|
|
94
|
+
}
|
|
95
|
+
clearValue($event): void {
|
|
96
|
+
$event.stopPropagation();
|
|
97
|
+
this.inputValueControl.setValue([]);
|
|
98
|
+
this.changeValue([]);
|
|
99
|
+
}
|
|
100
|
+
changeValue(values): void{
|
|
101
|
+
const multi = this.component.choiceInfo.multipleChoice;
|
|
102
|
+
if (multi) {
|
|
103
|
+
this.handlerContext.changeListValue(this.component, values);
|
|
104
|
+
} else {
|
|
105
|
+
this.handlerContext.changeValue(this.component, values[0]);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<form class="form-container" [formGroup]="options">
|
|
2
|
+
<mat-form-field class="full-width">
|
|
3
|
+
<!-- <mat-label>{{cds.getRenderingLabelForComponent(component)}}</mat-label>-->
|
|
4
|
+
<input matInput type="text" *ngIf="component.basicInfo.inputType==inputText"
|
|
5
|
+
[formControl]="inputValueControl"
|
|
6
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
7
|
+
(input)="inputChanged($event)"
|
|
8
|
+
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}">
|
|
9
|
+
<textarea matInput type="text" *ngIf="component.basicInfo.inputType==inputTextarea"
|
|
10
|
+
cdkTextareaAutosize
|
|
11
|
+
cdkAutosizeMinRows="6"
|
|
12
|
+
[formControl]="inputValueControl"
|
|
13
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
14
|
+
(input)="inputChanged($event)"
|
|
15
|
+
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}"></textarea>
|
|
16
|
+
<button type="button" tabindex="0" mat-button *ngIf="inputValueControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearValue()">
|
|
17
|
+
<mat-icon>close</mat-icon>
|
|
18
|
+
</button>
|
|
19
|
+
<mat-error *ngIf="inputValueControl.getError('minlength')">{{'Validation.Text.MinLength' | translate: {constraintMinLength} }}</mat-error>
|
|
20
|
+
<mat-error *ngIf="inputValueControl.getError('maxlength')">{{'Validation.Text.MaxLength' | translate: {constraintMaxLength} }}</mat-error>
|
|
21
|
+
<mat-error *ngIf="inputValueControl.hasError('required')">{{'Validation.Required' | translate}}</mat-error>
|
|
22
|
+
<mat-hint align="end">{{getCharCountHint()}}</mat-hint>
|
|
23
|
+
</mat-form-field>
|
|
24
|
+
</form>
|
|
25
|
+
|
package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.scss
ADDED
|
File without changes
|
package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.spec.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {CedarInputTextComponent} from './cedar-input-text.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarInputTextComponent', () => {
|
|
6
|
+
let component: CedarInputTextComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarInputTextComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CedarInputTextComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarInputTextComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
3
|
+
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
|
|
4
|
+
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
5
|
+
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
6
|
+
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
7
|
+
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
8
|
+
import {ErrorStateMatcher} from '@angular/material/core';
|
|
9
|
+
import {InputType} from '../../../shared/models/input-type.model';
|
|
10
|
+
|
|
11
|
+
export class TextFieldErrorStateMatcher implements ErrorStateMatcher {
|
|
12
|
+
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
13
|
+
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'app-cedar-input-text',
|
|
19
|
+
templateUrl: './cedar-input-text.component.html',
|
|
20
|
+
styleUrls: ['./cedar-input-text.component.scss'],
|
|
21
|
+
encapsulation: ViewEncapsulation.None
|
|
22
|
+
})
|
|
23
|
+
export class CedarInputTextComponent extends CedarUIComponent implements OnInit {
|
|
24
|
+
|
|
25
|
+
component: FieldComponent;
|
|
26
|
+
options: FormGroup;
|
|
27
|
+
inputValueControl = new FormControl(null, null);
|
|
28
|
+
errorStateMatcher = new TextFieldErrorStateMatcher();
|
|
29
|
+
constraintMinLength = null;
|
|
30
|
+
constraintMaxLength = null;
|
|
31
|
+
@Input() handlerContext: HandlerContext;
|
|
32
|
+
inputText = InputType.text;
|
|
33
|
+
inputTextarea = InputType.textarea;
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
fb: FormBuilder,
|
|
37
|
+
public cds: ComponentDataService,
|
|
38
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
39
|
+
) {
|
|
40
|
+
super();
|
|
41
|
+
this.options = fb.group({
|
|
42
|
+
inputValue: this.inputValueControl,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnInit(): void {
|
|
47
|
+
const validators: any[] = [];
|
|
48
|
+
|
|
49
|
+
this.constraintMinLength = this.component.valueInfo.minLength;
|
|
50
|
+
|
|
51
|
+
if (this.constraintMinLength != null) {
|
|
52
|
+
validators.push(Validators.minLength(this.constraintMinLength));
|
|
53
|
+
}
|
|
54
|
+
this.constraintMaxLength = this.component.valueInfo.maxLength;
|
|
55
|
+
|
|
56
|
+
if (this.constraintMaxLength != null) {
|
|
57
|
+
validators.push(Validators.maxLength(this.constraintMaxLength));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (this.component.valueInfo.requiredValue) {
|
|
61
|
+
validators.push(Validators.required);
|
|
62
|
+
}
|
|
63
|
+
this.inputValueControl = new FormControl(null, validators);
|
|
64
|
+
|
|
65
|
+
if (this.component.valueInfo.defaultValue != null) {
|
|
66
|
+
this.setValueUIAndModel(this.component.valueInfo.defaultValue);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
71
|
+
this.component = componentToRender;
|
|
72
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
inputChanged($event: Event): void {
|
|
76
|
+
let val = ($event.target as HTMLTextAreaElement).value;
|
|
77
|
+
|
|
78
|
+
if (val.length === 0) {
|
|
79
|
+
val = null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.handlerContext.changeValue(this.component, val);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
setCurrentValue(currentValue: any): void {
|
|
86
|
+
this.inputValueControl.setValue(currentValue);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
clearValue(): void {
|
|
90
|
+
this.setValueUIAndModel(null);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private setValueUIAndModel(value: string): void {
|
|
94
|
+
this.inputValueControl.setValue(value);
|
|
95
|
+
this.handlerContext.changeValue(this.component, value);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
getCharCountHint(): string {
|
|
99
|
+
let len = 0;
|
|
100
|
+
if (this.inputValueControl.value != null) {
|
|
101
|
+
len = this.inputValueControl.value.length;
|
|
102
|
+
}
|
|
103
|
+
let s = '' + len;
|
|
104
|
+
let min = null;
|
|
105
|
+
let max = null;
|
|
106
|
+
if (this.component.valueInfo.minLength != null) {
|
|
107
|
+
min = this.component.valueInfo.minLength;
|
|
108
|
+
}
|
|
109
|
+
if (this.component.valueInfo.maxLength != null) {
|
|
110
|
+
max = this.component.valueInfo.maxLength;
|
|
111
|
+
}
|
|
112
|
+
if (min != null || max != null) {
|
|
113
|
+
s += ' / ';
|
|
114
|
+
if (min != null) {
|
|
115
|
+
s += min + ' ';
|
|
116
|
+
}
|
|
117
|
+
s += ' - ';
|
|
118
|
+
if (max != null) {
|
|
119
|
+
s += max;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return s;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<mat-card class="child-component-card image-component">
|
|
2
|
+
<div role="img" attr.aria-label="{{component.labelInfo.description}}">
|
|
3
|
+
<img mat-card-image src="{{component.contentInfo.content}}" alt="{{component.labelInfo.description}}" />
|
|
4
|
+
</div>
|
|
5
|
+
<mat-card-content>
|
|
6
|
+
{{component.labelInfo.description}}
|
|
7
|
+
</mat-card-content>
|
|
8
|
+
</mat-card>
|
package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.scss
ADDED
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
import {CedarStaticImageComponent} from './cedar-static-image.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarStaticImageComponent', () => {
|
|
5
|
+
let component: CedarStaticImageComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarStaticImageComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [CedarStaticImageComponent]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarStaticImageComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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-image',
|
|
11
|
+
templateUrl: './cedar-static-image.component.html',
|
|
12
|
+
styleUrls: ['./cedar-static-image.component.scss'],
|
|
13
|
+
encapsulation: ViewEncapsulation.None
|
|
14
|
+
})
|
|
15
|
+
export class CedarStaticImageComponent extends CedarUIComponent implements OnInit {
|
|
16
|
+
|
|
17
|
+
component: StaticFieldComponent;
|
|
18
|
+
@Input() handlerContext: HandlerContext;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
fb: FormBuilder,
|
|
22
|
+
public cds: ComponentDataService,
|
|
23
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
24
|
+
) {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ngOnInit(): void {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Input() set componentToRender(componentToRender: StaticFieldComponent) {
|
|
32
|
+
this.component = componentToRender;
|
|
33
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setCurrentValue(currentValue: any): void {
|
|
37
|
+
// DO NOTHING
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<div class="pager-container page-break-paginator-container">
|
|
2
|
+
<span class="page-break-label">{{'Generic.Page' | translate}}:</span>
|
|
3
|
+
<div class="pager-chips">
|
|
4
|
+
<mat-chip-list>
|
|
5
|
+
<mat-chip *ngFor="let pageNumber of pageBreakPaginatorService.allPageIndices()"
|
|
6
|
+
[selected]="pageNumber == pageBreakPaginatorService.currentPageBreakIndex"
|
|
7
|
+
(click)="pageBreakPaginatorService.page(pageNumber)"
|
|
8
|
+
selectable="true"
|
|
9
|
+
>{{pageNumber + 1}}</mat-chip>
|
|
10
|
+
</mat-chip-list>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="page-break-pager">
|
|
13
|
+
<mat-paginator [length]="pageBreakPaginatorService.numPages()"
|
|
14
|
+
[hidePageSize]="true"
|
|
15
|
+
[pageSize]="1"
|
|
16
|
+
[pageIndex]="pageBreakPaginatorService.currentPageBreakIndex"
|
|
17
|
+
(page)="paginatorChanged($event)">
|
|
18
|
+
</mat-paginator>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.page-break-paginator-container {
|
|
2
|
+
margin-top: 0;
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
|
|
5
|
+
.pager-chips {
|
|
6
|
+
margin-right: 0;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.page-break-pager {
|
|
11
|
+
.mat-paginator {
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.mat-paginator-range-label {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.page-break-label {
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
margin-right: 20px;
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CedarStaticPageBreakComponent } from './cedar-static-page-break.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarStaticPageBreakComponent', () => {
|
|
6
|
+
let component: CedarStaticPageBreakComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarStaticPageBreakComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ CedarStaticPageBreakComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarStaticPageBreakComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {Component, Injectable, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {DataContext} from '../../../shared/util/data-context';
|
|
3
|
+
import {MatPaginatorIntl} from '@angular/material/paginator';
|
|
4
|
+
import {PageBreakPaginatorService} from '../../../shared/service/page-break-paginator.service';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class CustomMatPaginatorIntl extends MatPaginatorIntl {
|
|
8
|
+
getRangeLabel = (page: number, pageSize: number, length: number) => {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'app-cedar-static-page-break',
|
|
15
|
+
templateUrl: './cedar-static-page-break.component.html',
|
|
16
|
+
styleUrls: ['./cedar-static-page-break.component.scss'],
|
|
17
|
+
encapsulation: ViewEncapsulation.None,
|
|
18
|
+
providers: [{provide: MatPaginatorIntl, useClass: CustomMatPaginatorIntl}]
|
|
19
|
+
})
|
|
20
|
+
export class CedarStaticPageBreakComponent implements OnInit {
|
|
21
|
+
|
|
22
|
+
@Input() dataContext: DataContext;
|
|
23
|
+
@Input() pageBreakPaginatorService: PageBreakPaginatorService;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ngOnInit(): void {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
paginatorChanged(event): void {
|
|
33
|
+
this.pageBreakPaginatorService.page(event.pageIndex);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {CedarStaticRichTextComponent} from './cedar-static-rich-text.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarStaticRichTextComponent', () => {
|
|
6
|
+
let component: CedarStaticRichTextComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarStaticRichTextComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CedarStaticRichTextComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarStaticRichTextComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {StaticFieldComponent} from '../../../shared/models/static/static-field-component.model';
|
|
3
|
+
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
4
|
+
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
5
|
+
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-cedar-static-rich-text',
|
|
9
|
+
templateUrl: './cedar-static-rich-text.component.html',
|
|
10
|
+
styleUrls: ['./cedar-static-rich-text.component.scss'],
|
|
11
|
+
encapsulation: ViewEncapsulation.None
|
|
12
|
+
})
|
|
13
|
+
export class CedarStaticRichTextComponent extends CedarUIComponent implements OnInit {
|
|
14
|
+
|
|
15
|
+
component: StaticFieldComponent;
|
|
16
|
+
@Input() handlerContext: HandlerContext;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
constructor(private activeComponentRegistry: ActiveComponentRegistryService) {
|
|
20
|
+
super();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
ngOnInit(): void {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Input() set componentToRender(componentToRender: StaticFieldComponent) {
|
|
27
|
+
this.component = componentToRender;
|
|
28
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setCurrentValue(currentValue: any): void {
|
|
32
|
+
// not applicable to rich text component
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<mat-card class="child-component-card section-break-component">
|
|
2
|
+
<div class="form-container">
|
|
3
|
+
<mat-card-header>
|
|
4
|
+
<h1>{{cds.getRenderingLabelForComponent(component)}}</h1>
|
|
5
|
+
<mat-icon matTooltip="{{component.labelInfo.description}}" class="icon-help">help</mat-icon>
|
|
6
|
+
</mat-card-header>
|
|
7
|
+
</div>
|
|
8
|
+
</mat-card>
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
import {CedarStaticSectionBreakComponent} from './cedar-static-section-break.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarStaticSectionBreakComponent', () => {
|
|
5
|
+
let component: CedarStaticSectionBreakComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarStaticSectionBreakComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [CedarStaticSectionBreakComponent]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarStaticSectionBreakComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
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-section-break',
|
|
11
|
+
templateUrl: './cedar-static-section-break.component.html',
|
|
12
|
+
styleUrls: ['./cedar-static-section-break.component.scss'],
|
|
13
|
+
encapsulation: ViewEncapsulation.None
|
|
14
|
+
})
|
|
15
|
+
export class CedarStaticSectionBreakComponent extends CedarUIComponent implements OnInit {
|
|
16
|
+
|
|
17
|
+
component: StaticFieldComponent;
|
|
18
|
+
@Input() handlerContext: HandlerContext;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
fb: FormBuilder,
|
|
22
|
+
public cds: ComponentDataService,
|
|
23
|
+
private activeComponentRegistry: ActiveComponentRegistryService) {
|
|
24
|
+
super();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ngOnInit(): void {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Input() set componentToRender(componentToRender: StaticFieldComponent) {
|
|
31
|
+
this.component = componentToRender;
|
|
32
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
setCurrentValue(currentValue: any): void {
|
|
36
|
+
// DO NOTHING
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<mat-card class="child-component-card youtube-component">
|
|
2
|
+
<youtube-player [videoId]="component.contentInfo.content" [height]="videoHeight" [width]="videoWidth" aria-label="component.contentInfo.content"></youtube-player>
|
|
3
|
+
<mat-card-content>
|
|
4
|
+
{{component.labelInfo.description}}
|
|
5
|
+
</mat-card-content>
|
|
6
|
+
</mat-card>
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
import {CedarStaticYoutubeComponent} from './cedar-static-youtube.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarStaticYoutubeComponent', () => {
|
|
5
|
+
let component: CedarStaticYoutubeComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarStaticYoutubeComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [CedarStaticYoutubeComponent]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarStaticYoutubeComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|