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/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cedar-embeddable-editor",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng serve",
|
|
7
|
+
"build": "ng build",
|
|
8
|
+
"test": "ng test",
|
|
9
|
+
"lint": "ng lint",
|
|
10
|
+
"e2e": "ng e2e"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@angular-devkit/schematics": "^13.0.4",
|
|
14
|
+
"@angular-material-components/datetime-picker": "^8.0.0",
|
|
15
|
+
"@angular/animations": "~14.2.3",
|
|
16
|
+
"@angular/cdk": "^14.2.7",
|
|
17
|
+
"@angular/common": "~14.2.12",
|
|
18
|
+
"@angular/compiler": "~14.2.3",
|
|
19
|
+
"@angular/core": "~14.2.3",
|
|
20
|
+
"@angular/elements": "^14.2.3",
|
|
21
|
+
"@angular/forms": "~14.2.3",
|
|
22
|
+
"@angular/material": "^14.2.7",
|
|
23
|
+
"@angular/material-moment-adapter": "^14.2.3",
|
|
24
|
+
"@angular/platform-browser": "~14.2.3",
|
|
25
|
+
"@angular/platform-browser-dynamic": "~14.2.3",
|
|
26
|
+
"@angular/router": "~14.2.3",
|
|
27
|
+
"@angular/youtube-player": "^14.2.7",
|
|
28
|
+
"@ng-select/ng-select": "^9.1.0",
|
|
29
|
+
"@ngx-translate/core": "^11.0.1",
|
|
30
|
+
"@ngx-translate/http-loader": "^4.0.0",
|
|
31
|
+
"@webcomponents/custom-elements": "^1.4.3",
|
|
32
|
+
"lodash-es": "^4.17.15",
|
|
33
|
+
"moment": "^2.29.1",
|
|
34
|
+
"moment-timezone": "^0.5.34",
|
|
35
|
+
"ngx-mat-select-search": "^4.0.2",
|
|
36
|
+
"rxjs": "~6.5.5",
|
|
37
|
+
"tslib": "^2.0.0",
|
|
38
|
+
"zone.js": "~0.11.4"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@angular-devkit/build-angular": "^14.2.3",
|
|
42
|
+
"@angular/cli": "~14.2.10",
|
|
43
|
+
"@angular/compiler-cli": "~14.2.3",
|
|
44
|
+
"@types/jasmine": "~3.5.0",
|
|
45
|
+
"@types/jasminewd2": "~2.0.3",
|
|
46
|
+
"@types/lodash-es": "^4.17.3",
|
|
47
|
+
"@types/node": "^12.11.1",
|
|
48
|
+
"codelyzer": "^6.0.2",
|
|
49
|
+
"jasmine-core": "~2.99.1",
|
|
50
|
+
"jasmine-spec-reporter": "~4.2.1",
|
|
51
|
+
"karma": "~6.4.1",
|
|
52
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
53
|
+
"karma-coverage-istanbul-reporter": "~3.0.2",
|
|
54
|
+
"karma-jasmine": "~3.3.0",
|
|
55
|
+
"karma-jasmine-html-reporter": "^0.2.2",
|
|
56
|
+
"protractor": "~7.0.0",
|
|
57
|
+
"ts-node": "~8.3.0",
|
|
58
|
+
"tslint": "~6.1.0",
|
|
59
|
+
"typescript": "~4.8.3"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {Component, OnInit} from '@angular/core';
|
|
2
|
+
import {TranslateService} from '@ngx-translate/core';
|
|
3
|
+
import {LocalSettingsService} from './modules/shared/service/local-settings.service';
|
|
4
|
+
import {environment} from '../environments/environment';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-component-dev',
|
|
8
|
+
templateUrl: './app.component.html',
|
|
9
|
+
styleUrls: ['./app.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class AppComponentDev implements OnInit {
|
|
12
|
+
|
|
13
|
+
ceeConfig = {
|
|
14
|
+
showTemplateUpload: true,
|
|
15
|
+
templateUploadBaseUrl: 'http://localhost:8000',
|
|
16
|
+
// templateUploadBaseUrl: 'https://api-php.cee.metadatacenter.orgx',
|
|
17
|
+
templateUploadEndpoint: '/upload.php',
|
|
18
|
+
templateDownloadEndpoint: '/download.php',
|
|
19
|
+
templateUploadParamName: '3520cf061bba4919a8ea4b74a07af01b',
|
|
20
|
+
templateDownloadParamName: '9ff482bacac84c499655ab58efdf590a',
|
|
21
|
+
|
|
22
|
+
showDataSaver: true,
|
|
23
|
+
dataSaverEndpointUrl: 'http://localhost:8000/datasave.php',
|
|
24
|
+
|
|
25
|
+
sampleTemplateLocationPrefix: 'http://localhost:4240/cedar-embeddable-editor-sample-templates/',
|
|
26
|
+
// sampleTemplateLocationPrefix: 'https://component.staging.metadatacenter.org/cedar-embeddable-editor-sample-templates/',
|
|
27
|
+
loadSampleTemplateName: '45',
|
|
28
|
+
showSampleTemplateLinks: true,
|
|
29
|
+
expandedSampleTemplateLinks: true,
|
|
30
|
+
showTemplateRenderingRepresentation: true,
|
|
31
|
+
showHeader: true,
|
|
32
|
+
showFooter: false,
|
|
33
|
+
|
|
34
|
+
// terminologyProxyUrl: 'https://api-php.cee.metadatacenter.orgx/index.php',
|
|
35
|
+
// terminologyProxyUrl: 'http://localhost:8000/index.php',
|
|
36
|
+
terminologyProxyUrl: 'https://terminology.metadatacenter.orgx/bioportal/integrated-search',
|
|
37
|
+
showInstanceDataCore: true,
|
|
38
|
+
expandedInstanceDataCore: false,
|
|
39
|
+
showMultiInstanceInfo: true,
|
|
40
|
+
expandedMultiInstanceInfo: false,
|
|
41
|
+
collapseStaticComponents: true,
|
|
42
|
+
|
|
43
|
+
showStaticText: true,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
languages = {
|
|
47
|
+
selected: 'en',
|
|
48
|
+
options: [{value: 'en', viewValue: 'en'}, {value: 'hu', viewValue: 'hu'}]
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
constructor(
|
|
53
|
+
) {
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ngOnInit(): void {
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// getCurrentLanguageCode() {
|
|
60
|
+
// return this.translateService.currentLang;
|
|
61
|
+
// }
|
|
62
|
+
//
|
|
63
|
+
// switchLanguage($event: any, language: string) {
|
|
64
|
+
// $event.preventDefault();
|
|
65
|
+
// this.translateService.use(language);
|
|
66
|
+
// this.localSettings.setLanguage(language);
|
|
67
|
+
// }
|
|
68
|
+
//
|
|
69
|
+
// setLanguage(language: string) {
|
|
70
|
+
// this.translateService.use(language);
|
|
71
|
+
// this.localSettings.setLanguage(language);
|
|
72
|
+
// }
|
|
73
|
+
|
|
74
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {Component, OnInit} from '@angular/core';
|
|
2
|
+
import {LocalSettingsService} from './modules/shared/service/local-settings.service';
|
|
3
|
+
import {TranslateService} from '@ngx-translate/core';
|
|
4
|
+
import {environment} from '../environments/environment';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-component-prod',
|
|
8
|
+
templateUrl: './app.component.html',
|
|
9
|
+
styleUrls: ['./app.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class AppComponentProd implements OnInit {
|
|
12
|
+
|
|
13
|
+
ceeConfig = {
|
|
14
|
+
showTemplateUpload: true,
|
|
15
|
+
templateUploadBaseUrl: 'http://localhost:8000',
|
|
16
|
+
// templateUploadBaseUrl: 'https://api-php.cee.metadatacenter.orgx',
|
|
17
|
+
templateUploadEndpoint: '/upload.php',
|
|
18
|
+
templateDownloadEndpoint: '/download.php',
|
|
19
|
+
templateUploadParamName: '3520cf061bba4919a8ea4b74a07af01b',
|
|
20
|
+
templateDownloadParamName: '9ff482bacac84c499655ab58efdf590a',
|
|
21
|
+
|
|
22
|
+
showDataSaver: true,
|
|
23
|
+
dataSaverEndpointUrl: 'http://localhost:8000/datasave.php',
|
|
24
|
+
|
|
25
|
+
sampleTemplateLocationPrefix: 'https://component.metadatacenter.orgx/cedar-embeddable-editor-sample-templates/',
|
|
26
|
+
// sampleTemplateLocationPrefix: 'https://component.staging.metadatacenter.org/cedar-embeddable-editor-sample-templates/',
|
|
27
|
+
loadSampleTemplateName: '45',
|
|
28
|
+
showSampleTemplateLinks: true,
|
|
29
|
+
expandedSampleTemplateLinks: true,
|
|
30
|
+
showTemplateRenderingRepresentation: true,
|
|
31
|
+
showHeader: false,
|
|
32
|
+
showFooter: false,
|
|
33
|
+
|
|
34
|
+
// terminologyProxyUrl: 'https://api-php.cee.metadatacenter.orgx/index.php',
|
|
35
|
+
// terminologyProxyUrl: 'http://localhost:8000/index.php',
|
|
36
|
+
terminologyProxyUrl: 'https://terminology.metadatacenter.org/bioportal/integrated-search',
|
|
37
|
+
showInstanceDataCore: true,
|
|
38
|
+
expandedInstanceDataCore: false,
|
|
39
|
+
showMultiInstanceInfo: true,
|
|
40
|
+
expandedMultiInstanceInfo: false,
|
|
41
|
+
collapseStaticComponents: true,
|
|
42
|
+
|
|
43
|
+
showStaticText: true,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
languages = {
|
|
48
|
+
selected: 'en',
|
|
49
|
+
options: [{value: 'en', viewValue: 'en'}, {value: 'hu', viewValue: 'hu'}]
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
constructor(
|
|
54
|
+
) {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ngOnInit(): void {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// getCurrentLanguageCode() {
|
|
61
|
+
// return this.translateService.currentLang;
|
|
62
|
+
// }
|
|
63
|
+
//
|
|
64
|
+
// switchLanguage($event: any, language: string) {
|
|
65
|
+
// $event.preventDefault();
|
|
66
|
+
// this.translateService.use(language);
|
|
67
|
+
// this.localSettings.setLanguage(language);
|
|
68
|
+
// }
|
|
69
|
+
//
|
|
70
|
+
// setLanguage(language: string) {
|
|
71
|
+
// this.translateService.use(language);
|
|
72
|
+
// this.localSettings.setLanguage(language);
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@angular/material/prebuilt-themes/indigo-pink.css";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {BrowserModule} from '@angular/platform-browser';
|
|
2
|
+
import {Injector, NgModule} from '@angular/core';
|
|
3
|
+
import {createCustomElement} from '@angular/elements';
|
|
4
|
+
import {HttpClient, HttpClientModule} from '@angular/common/http';
|
|
5
|
+
import {AppComponentDev} from './app.component.dev';
|
|
6
|
+
import {SharedModule} from './modules/shared/shared.module';
|
|
7
|
+
import {JsonPipe} from '@angular/common';
|
|
8
|
+
import {InputTypesModule} from './modules/input-types/input-types.module';
|
|
9
|
+
import {
|
|
10
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
11
|
+
} from './modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component';
|
|
12
|
+
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
|
13
|
+
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
|
|
14
|
+
|
|
15
|
+
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
|
16
|
+
return new TranslateHttpLoader(http, '/assets/i18n-cee/');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@NgModule({
|
|
20
|
+
declarations: [
|
|
21
|
+
AppComponentDev
|
|
22
|
+
],
|
|
23
|
+
imports: [
|
|
24
|
+
BrowserModule,
|
|
25
|
+
HttpClientModule,
|
|
26
|
+
SharedModule,
|
|
27
|
+
InputTypesModule,
|
|
28
|
+
TranslateModule.forRoot({
|
|
29
|
+
loader: {
|
|
30
|
+
provide: TranslateLoader,
|
|
31
|
+
useFactory: HttpLoaderFactory,
|
|
32
|
+
deps: [HttpClient]
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
providers: [
|
|
37
|
+
JsonPipe
|
|
38
|
+
],
|
|
39
|
+
bootstrap: [
|
|
40
|
+
AppComponentDev
|
|
41
|
+
],
|
|
42
|
+
exports: [],
|
|
43
|
+
entryComponents: [
|
|
44
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
export class AppModuleDev {
|
|
48
|
+
|
|
49
|
+
constructor(private injector: Injector) {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ngDoBootstrap(): void {
|
|
53
|
+
const cedarCustomElement = createCustomElement(CedarEmbeddableMetadataEditorWrapperComponent, {
|
|
54
|
+
injector: this.injector
|
|
55
|
+
});
|
|
56
|
+
customElements.define('cedar-embeddable-editor', cedarCustomElement);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {BrowserModule} from '@angular/platform-browser';
|
|
2
|
+
import {Injector, NgModule} from '@angular/core';
|
|
3
|
+
import {createCustomElement} from '@angular/elements';
|
|
4
|
+
import {HttpClient, HttpClientModule} from '@angular/common/http';
|
|
5
|
+
import {AppComponentProd} from './app.component.prod';
|
|
6
|
+
import {SharedModule} from './modules/shared/shared.module';
|
|
7
|
+
import {JsonPipe} from '@angular/common';
|
|
8
|
+
import {InputTypesModule} from './modules/input-types/input-types.module';
|
|
9
|
+
import {
|
|
10
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
11
|
+
} from './modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component';
|
|
12
|
+
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
|
13
|
+
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
|
|
14
|
+
|
|
15
|
+
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
|
16
|
+
return new TranslateHttpLoader(http, '/assets/i18n-cee/');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@NgModule({
|
|
20
|
+
declarations: [
|
|
21
|
+
AppComponentProd
|
|
22
|
+
],
|
|
23
|
+
imports: [
|
|
24
|
+
BrowserModule,
|
|
25
|
+
HttpClientModule,
|
|
26
|
+
SharedModule,
|
|
27
|
+
InputTypesModule,
|
|
28
|
+
TranslateModule.forRoot({
|
|
29
|
+
loader: {
|
|
30
|
+
provide: TranslateLoader,
|
|
31
|
+
useFactory: HttpLoaderFactory,
|
|
32
|
+
deps: [HttpClient]
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
providers: [
|
|
37
|
+
JsonPipe
|
|
38
|
+
],
|
|
39
|
+
bootstrap: [],
|
|
40
|
+
exports: [],
|
|
41
|
+
entryComponents: [
|
|
42
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
export class AppModuleProd {
|
|
46
|
+
|
|
47
|
+
constructor(private injector: Injector) {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ngDoBootstrap(): void {
|
|
51
|
+
const cedarCustomElement = createCustomElement(CedarEmbeddableMetadataEditorWrapperComponent, {
|
|
52
|
+
injector: this.injector
|
|
53
|
+
});
|
|
54
|
+
customElements.define('cedar-embeddable-editor', cedarCustomElement);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
import {CedarFooBarComponent} from './cedar-foo-bar.component';
|
|
3
|
+
|
|
4
|
+
describe('CedarFooBarComponent', () => {
|
|
5
|
+
let component: CedarFooBarComponent;
|
|
6
|
+
let fixture: ComponentFixture<CedarFooBarComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [CedarFooBarComponent]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CedarFooBarComponent);
|
|
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 {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
|
+
import {StaticFieldComponent} from '../../../shared/models/static/static-field-component.model';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-cedar-foo-bar',
|
|
10
|
+
templateUrl: './cedar-foo-bar.component.html',
|
|
11
|
+
styleUrls: ['./cedar-foo-bar.component.scss'],
|
|
12
|
+
encapsulation: ViewEncapsulation.None
|
|
13
|
+
})
|
|
14
|
+
export class CedarFooBarComponent extends CedarUIComponent implements OnInit {
|
|
15
|
+
|
|
16
|
+
component: StaticFieldComponent;
|
|
17
|
+
@Input() handlerContext: HandlerContext;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
fb: FormBuilder,
|
|
21
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
this.activeComponentRegistry = activeComponentRegistry;
|
|
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,25 @@
|
|
|
1
|
+
<form class="form-container" [formGroup]="options">
|
|
2
|
+
<mat-form-field class="half-width-with-margin">
|
|
3
|
+
<mat-label>{{'Generic.Name' | translate}}</mat-label>
|
|
4
|
+
<input matInput type="text" placeholder="{{'Generic.AttributeName' | translate}}"
|
|
5
|
+
[formControl]="nameInputControl"
|
|
6
|
+
(input)="nameChanged($event)"
|
|
7
|
+
(blur)="nameChanged($event)"
|
|
8
|
+
attr.aria-label="{{'Generic.AttributeName' | translate}}">
|
|
9
|
+
<button type="button" mat-button *ngIf="nameInputControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearName()">
|
|
10
|
+
<mat-icon>close</mat-icon>
|
|
11
|
+
</button>
|
|
12
|
+
</mat-form-field>
|
|
13
|
+
|
|
14
|
+
<mat-form-field class="half-width">
|
|
15
|
+
<mat-label>{{'Generic.Value' | translate}}</mat-label>
|
|
16
|
+
<input matInput type="text" placeholder="{{'Generic.AttributeValue' | translate}}"
|
|
17
|
+
[formControl]="valueInputControl"
|
|
18
|
+
(input)="valueChanged($event)"
|
|
19
|
+
attr.aria-label="{{'Generic.AttributeName' | translate}}">
|
|
20
|
+
<button type="button" mat-button *ngIf="valueInputControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearValue()">
|
|
21
|
+
<mat-icon>close</mat-icon>
|
|
22
|
+
</button>
|
|
23
|
+
</mat-form-field>
|
|
24
|
+
</form>
|
|
25
|
+
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {CedarInputAttributeValueComponent} from './cedar-input-attribute-value.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarInputAttributeValueComponent', () => {
|
|
6
|
+
let component: CedarInputAttributeValueComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarInputAttributeValueComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CedarInputAttributeValueComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarInputAttributeValueComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
3
|
+
import {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
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-cedar-input-attribute-value',
|
|
11
|
+
templateUrl: './cedar-input-attribute-value.component.html',
|
|
12
|
+
styleUrls: ['./cedar-input-attribute-value.component.scss'],
|
|
13
|
+
encapsulation: ViewEncapsulation.None
|
|
14
|
+
})
|
|
15
|
+
export class CedarInputAttributeValueComponent extends CedarUIComponent implements OnInit {
|
|
16
|
+
|
|
17
|
+
component: FieldComponent;
|
|
18
|
+
options: FormGroup;
|
|
19
|
+
nameInputControl = new FormControl(null, null);
|
|
20
|
+
valueInputControl = new FormControl(null, null);
|
|
21
|
+
@Input() handlerContext: HandlerContext;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
fb: FormBuilder,
|
|
25
|
+
private activeComponentRegistry: ActiveComponentRegistryService
|
|
26
|
+
) {
|
|
27
|
+
super();
|
|
28
|
+
this.options = fb.group({
|
|
29
|
+
nameInputValue: this.nameInputControl,
|
|
30
|
+
valueInputValue: this.valueInputControl,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
38
|
+
this.component = componentToRender;
|
|
39
|
+
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
nameChanged($event: Event): void {
|
|
43
|
+
let name: string = null;
|
|
44
|
+
|
|
45
|
+
if ($event) {
|
|
46
|
+
name = ($event.target as HTMLTextAreaElement).value;
|
|
47
|
+
} else {
|
|
48
|
+
name = this.nameInputControl.value;
|
|
49
|
+
}
|
|
50
|
+
const value = this.valueInputControl.value;
|
|
51
|
+
this.handlerContext.changeAttributeValue(this.component, name, value);
|
|
52
|
+
this.activeComponentRegistry.updateViewToModel(this.component, this.handlerContext);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
valueChanged($event: Event): void {
|
|
56
|
+
let value: string = null;
|
|
57
|
+
|
|
58
|
+
if ($event) {
|
|
59
|
+
value = ($event.target as HTMLTextAreaElement).value;
|
|
60
|
+
} else {
|
|
61
|
+
value = this.valueInputControl.value;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (value && value.length === 0) {
|
|
65
|
+
value = null;
|
|
66
|
+
}
|
|
67
|
+
const name = this.nameInputControl.value;
|
|
68
|
+
this.handlerContext.changeAttributeValue(this.component, name, value);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setCurrentValue(currentValue: any): void {
|
|
72
|
+
this.nameInputControl.setValue(Object.keys(currentValue)[0]);
|
|
73
|
+
this.valueInputControl.setValue(Object.values(currentValue)[0]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
deleteCurrentValue(): void {
|
|
77
|
+
const name = this.nameInputControl.value;
|
|
78
|
+
this.handlerContext.deleteAttributeValue(this.component, name);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
clearName(): void {
|
|
82
|
+
this.nameInputControl.setValue(null);
|
|
83
|
+
this.handlerContext.changeAttributeValue(this.component, null, this.valueInputControl.value);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
clearValue(): void {
|
|
87
|
+
this.valueInputControl.setValue(null);
|
|
88
|
+
this.handlerContext.changeAttributeValue(this.component, this.nameInputControl.value, null);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<form class="form-container" [formGroup]="options">
|
|
2
|
+
<div *ngFor="let choice of component.choiceInfo.choices">
|
|
3
|
+
<mat-checkbox (input)="inputChanged($event)"
|
|
4
|
+
[formControlName]="getFormControlName(choice.label)"
|
|
5
|
+
[value]="choice.label"
|
|
6
|
+
>{{choice.label}}</mat-checkbox>
|
|
7
|
+
</div>
|
|
8
|
+
</form>
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {CedarInputCheckboxComponent} from './cedar-input-checkbox.component';
|
|
4
|
+
|
|
5
|
+
describe('CedarInputCheckboxComponent', () => {
|
|
6
|
+
let component: CedarInputCheckboxComponent;
|
|
7
|
+
let fixture: ComponentFixture<CedarInputCheckboxComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CedarInputCheckboxComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(CedarInputCheckboxComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|