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,104 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
3
|
+
import {FormArray, FormBuilder, FormControl, FormGroup} from '@angular/forms';
|
|
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
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-cedar-input-checkbox',
|
|
10
|
+
templateUrl: './cedar-input-checkbox.component.html',
|
|
11
|
+
styleUrls: ['./cedar-input-checkbox.component.scss'],
|
|
12
|
+
encapsulation: ViewEncapsulation.None
|
|
13
|
+
})
|
|
14
|
+
export class CedarInputCheckboxComponent extends CedarUIComponent implements OnInit {
|
|
15
|
+
component: FieldComponent;
|
|
16
|
+
options: FormGroup;
|
|
17
|
+
@Input() handlerContext: HandlerContext;
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
fb: FormBuilder,
|
|
22
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
23
|
+
) {
|
|
24
|
+
super();
|
|
25
|
+
this.options = fb.group({
|
|
26
|
+
// initialize checked box value holder
|
|
27
|
+
checkedChoices: new FormArray([])
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ngOnInit(): void {
|
|
32
|
+
for (const choice of this.component.choiceInfo.choices) {
|
|
33
|
+
const fc = new FormControl();
|
|
34
|
+
this.options.addControl(this.getFormControlName(choice.label), fc);
|
|
35
|
+
}
|
|
36
|
+
this.populateValuesOnLoad();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
40
|
+
this.component = componentToRender;
|
|
41
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
inputChanged(event): void {
|
|
45
|
+
this.setInput(event.target.checked, event.target.value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
setCurrentValue(currentValue: any): void {
|
|
49
|
+
const arrVal = currentValue as Array<string>;
|
|
50
|
+
|
|
51
|
+
for (const choice of this.component.choiceInfo.choices) {
|
|
52
|
+
if (arrVal.indexOf(choice.label) >= 0) {
|
|
53
|
+
this.setInput(true, choice.label);
|
|
54
|
+
} else {
|
|
55
|
+
this.setInput(false, choice.label);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getFormControlName(val): string {
|
|
61
|
+
return val.replace(/\s+/g, '');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private populateValuesOnLoad(): void {
|
|
65
|
+
for (const choice of this.component.choiceInfo.choices) {
|
|
66
|
+
this.setInput(choice.selectedByDefault, choice.label);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private setInput(isChecked, val): void {
|
|
71
|
+
const formArray: FormArray = this.options.get('checkedChoices') as FormArray;
|
|
72
|
+
|
|
73
|
+
/* Selected */
|
|
74
|
+
if (isChecked) {
|
|
75
|
+
// Add a new control in the arrayForm
|
|
76
|
+
if (formArray.value.indexOf(val) < 0) {
|
|
77
|
+
formArray.push(new FormControl(val));
|
|
78
|
+
}
|
|
79
|
+
this.options.get(this.getFormControlName(val)).setValue('checked');
|
|
80
|
+
}
|
|
81
|
+
/* unselected */
|
|
82
|
+
else {
|
|
83
|
+
// find the unselected element
|
|
84
|
+
let i = 0;
|
|
85
|
+
|
|
86
|
+
formArray.controls.forEach((ctrl: FormControl) => {
|
|
87
|
+
if (ctrl.value === val) {
|
|
88
|
+
// Remove the unselected element from the arrayForm
|
|
89
|
+
formArray.removeAt(i);
|
|
90
|
+
this.options.get(this.getFormControlName(val)).setValue(null);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
i++;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Keep the values in the original sort order
|
|
98
|
+
const sortingArr = this.component.choiceInfo.choices.map(a => a.label);
|
|
99
|
+
formArray.value.sort((a, b) => sortingArr.indexOf(a) - sortingArr.indexOf(b));
|
|
100
|
+
|
|
101
|
+
this.handlerContext.changeListValue(this.component, formArray.value);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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"
|
|
5
|
+
#autoCompleteInput="matAutocompleteTrigger"
|
|
6
|
+
[formControl]="inputValueControl"
|
|
7
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
8
|
+
[matAutocomplete]="auto"
|
|
9
|
+
(input)="inputChanged($event)"
|
|
10
|
+
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}">
|
|
11
|
+
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption>
|
|
12
|
+
<mat-option *ngFor="let option of filteredOptions | async" [value]="option.prefLabel"
|
|
13
|
+
(onSelectionChange)="onSelectionChange(option)"
|
|
14
|
+
>{{option.prefLabel}}</mat-option>
|
|
15
|
+
</mat-autocomplete>
|
|
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 tabindex="0" align="start" *ngIf="inputValueControl.getError('required')" class="mat-error">{{'Validation.Required' | translate}}</mat-error>
|
|
20
|
+
</mat-form-field>
|
|
21
|
+
</form>
|
|
22
|
+
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
import {CedarInputControlledComponent} from './cedar-input-controlled.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarInputControlledComponent', () => {
|
|
5
|
+
let component: CedarInputControlledComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarInputControlledComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [CedarInputControlledComponent]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarInputControlledComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {AfterViewInit, Component, Input, OnInit, ViewChild, 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 {Observable} from 'rxjs';
|
|
10
|
+
import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
|
|
11
|
+
import {IntegratedSearchResponseItem} from '../../../shared/models/rest/integrated-search/integrated-search-response-item';
|
|
12
|
+
import {JsonSchema} from '../../../shared/models/json-schema.model';
|
|
13
|
+
import {ControlledFieldDataService} from '../../../shared/service/controlled-field-data.service';
|
|
14
|
+
import {MessageHandlerService} from '../../../shared/service/message-handler.service';
|
|
15
|
+
import {MatAutocompleteTrigger} from '@angular/material/autocomplete';
|
|
16
|
+
export class TextFieldErrorStateMatcher implements ErrorStateMatcher {
|
|
17
|
+
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
18
|
+
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
selector: 'app-cedar-input-controlled',
|
|
24
|
+
templateUrl: './cedar-input-controlled.component.html',
|
|
25
|
+
styleUrls: ['./cedar-input-controlled.component.scss'],
|
|
26
|
+
encapsulation: ViewEncapsulation.None
|
|
27
|
+
})
|
|
28
|
+
export class CedarInputControlledComponent extends CedarUIComponent implements OnInit, AfterViewInit {
|
|
29
|
+
@ViewChild('autoCompleteInput', { static: false, read: MatAutocompleteTrigger }) trigger: MatAutocompleteTrigger;
|
|
30
|
+
selectedData = new FormControl();
|
|
31
|
+
component: FieldComponent;
|
|
32
|
+
options: FormGroup;
|
|
33
|
+
inputValueControl = new FormControl(null, null);
|
|
34
|
+
errorStateMatcher = new TextFieldErrorStateMatcher();
|
|
35
|
+
@Input() handlerContext: HandlerContext;
|
|
36
|
+
model: IntegratedSearchResponseItem = null;
|
|
37
|
+
|
|
38
|
+
filteredOptions: Observable<IntegratedSearchResponseItem[]>;
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
fb: FormBuilder,
|
|
42
|
+
public cds: ComponentDataService,
|
|
43
|
+
private activeComponentRegistry: ActiveComponentRegistryService,
|
|
44
|
+
private controlledFieldDataService: ControlledFieldDataService,
|
|
45
|
+
private messageHandlerService: MessageHandlerService
|
|
46
|
+
) {
|
|
47
|
+
super();
|
|
48
|
+
this.options = fb.group({
|
|
49
|
+
inputValue: this.inputValueControl,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ngOnInit(): void {
|
|
54
|
+
const validators: any[] = [];
|
|
55
|
+
|
|
56
|
+
if (this.component.valueInfo.requiredValue) {
|
|
57
|
+
validators.push(Validators.required);
|
|
58
|
+
}
|
|
59
|
+
this.inputValueControl = new FormControl(null, validators);
|
|
60
|
+
|
|
61
|
+
if (this.component.valueInfo.defaultValue &&
|
|
62
|
+
typeof this.component.valueInfo.defaultValue === 'object' &&
|
|
63
|
+
(this.component.valueInfo.defaultValue as object).hasOwnProperty(JsonSchema.termUri)) {
|
|
64
|
+
this.setValueUIAndModel(this.component.valueInfo.defaultValue ? this.component.valueInfo.defaultValue[JsonSchema.termUri] : null,
|
|
65
|
+
this.component.valueInfo.defaultValue ? this.component.valueInfo.defaultValue[JsonSchema.rdfsLabel] : null);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.filteredOptions = this.inputValueControl.valueChanges
|
|
69
|
+
.pipe(
|
|
70
|
+
startWith(''),
|
|
71
|
+
debounceTime(400),
|
|
72
|
+
distinctUntilChanged(),
|
|
73
|
+
switchMap(val => {
|
|
74
|
+
return this.filter(val || '');
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
ngAfterViewInit(): void {
|
|
80
|
+
this.trigger.panelClosingActions
|
|
81
|
+
.subscribe(e => {
|
|
82
|
+
if (!e){
|
|
83
|
+
this.clearValue();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
filter(val: string): Observable<IntegratedSearchResponseItem[]> {
|
|
89
|
+
return this.controlledFieldDataService.getData(val, this.component).pipe(
|
|
90
|
+
map(response => {
|
|
91
|
+
if (response == null) {
|
|
92
|
+
return null;
|
|
93
|
+
} else if (response.collection) {
|
|
94
|
+
return response.collection.filter(option => {
|
|
95
|
+
return option.prefLabel.toLowerCase().indexOf(val.toLowerCase()) === 0;
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
if (!val) {
|
|
99
|
+
val = 'empty string';
|
|
100
|
+
}
|
|
101
|
+
this.messageHandlerService.errorObject(val, response);
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
108
|
+
this.component = componentToRender;
|
|
109
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
onSelectionChange(option: IntegratedSearchResponseItem): void {
|
|
113
|
+
this.handlerContext.changeControlledValue(this.component, option[JsonSchema.atId], option.prefLabel);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
inputChanged(event): void {
|
|
117
|
+
if (!(event.target as HTMLTextAreaElement).value) {
|
|
118
|
+
this.clearValue();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
setCurrentValue(currentValue: any): void {
|
|
123
|
+
this.inputValueControl.setValue(currentValue);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
clearValue(): void {
|
|
127
|
+
this.inputValueControl.setValue(null);
|
|
128
|
+
this.handlerContext.changeControlledValue(this.component, null, null);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private setValueUIAndModel(atId: string, prefLabel: string): void {
|
|
132
|
+
this.inputValueControl.setValue(prefLabel);
|
|
133
|
+
this.handlerContext.changeControlledValue(this.component, atId, prefLabel);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<app-date-picker *ngIf="showDatePicker()"
|
|
2
|
+
[dateFormat]="dateFormat()"
|
|
3
|
+
(dateChangedEvent)="dateInputChanged($event)"
|
|
4
|
+
[dateMonthYear]="dateMonthYearControl"
|
|
5
|
+
[required]="required"
|
|
6
|
+
xmlns="http://www.w3.org/1999/html"></app-date-picker>
|
|
7
|
+
<ng-container *ngIf="showTimePicker()">
|
|
8
|
+
<div>
|
|
9
|
+
<!-- <mat-label>Select Time</mat-label>-->
|
|
10
|
+
<ngx-mat-timepicker
|
|
11
|
+
(ngModelChange)="timeInputChanged($event)"
|
|
12
|
+
(input)="timeInputChanged($event)"
|
|
13
|
+
[(ngModel)]="timePickerTime"
|
|
14
|
+
[showSpinners]="true"
|
|
15
|
+
[enableMeridian]="enableMeridian()"
|
|
16
|
+
[disableMinute]="disableMinute()"
|
|
17
|
+
[showSeconds]="showSeconds()">
|
|
18
|
+
</ngx-mat-timepicker>
|
|
19
|
+
</div>
|
|
20
|
+
</ng-container>
|
|
21
|
+
<ng-container *ngIf="showDecimalSeconds()">
|
|
22
|
+
<mat-form-field>
|
|
23
|
+
<!-- <mat-label>Select Decimal Seconds</mat-label>-->
|
|
24
|
+
<input matInput type="number"
|
|
25
|
+
(input)="decimalSecondsChanged($event)"
|
|
26
|
+
[(ngModel)]="decimalSeconds"
|
|
27
|
+
name="decimalSeconds"
|
|
28
|
+
attr.aria-label="{{'Generic.SelectDecimalSeconds' | translate}}">
|
|
29
|
+
</mat-form-field>
|
|
30
|
+
</ng-container>
|
|
31
|
+
<ng-container *ngIf="showTimezonePicker()">
|
|
32
|
+
<app-timezone-picker
|
|
33
|
+
[(ngModel)]="timezone"
|
|
34
|
+
(ngModelChange)="timezoneInputChanged($event)"
|
|
35
|
+
customPlaceholderText="{{'Generic.SelectTimeZone' | translate}}"
|
|
36
|
+
customNotFoundText="{{'Generic.NoTimeZoneFound' | translate}}"
|
|
37
|
+
[getUserZone]="setDefaultZone"
|
|
38
|
+
[clearable]="false"
|
|
39
|
+
></app-timezone-picker>
|
|
40
|
+
</ng-container>
|
|
41
|
+
<!--<p class="info-box">-->
|
|
42
|
+
<!-- DateTime is: {{datetimeParsed.toDateRepresentation()}}<br/>-->
|
|
43
|
+
<!-- Stored as: {{datetimeParsed.toStorageRepresentation()}}-->
|
|
44
|
+
<!--</p>-->
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {CedarInputDatetimeComponent} from './cedar-input-datetime.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarInputDatetimeComponent', () => {
|
|
6
|
+
let component: CedarInputDatetimeComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarInputDatetimeComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CedarInputDatetimeComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarInputDatetimeComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|