cedar-embeddable-editor 0.9.0 → 0.9.2
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/assets/fonts/MaterialIcons-Regular.eot +0 -0
- package/assets/fonts/MaterialIcons-Regular.ttf +0 -0
- package/assets/fonts/MaterialIcons-Regular.woff +0 -0
- package/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/{src/index.html → index.html} +3 -3
- package/main.js +9417 -0
- package/main.js.map +1 -0
- package/package.json +1 -1
- package/polyfills.js +4345 -0
- package/polyfills.js.map +1 -0
- package/runtime.js +205 -0
- package/runtime.js.map +1 -0
- package/scripts.js +48 -0
- package/scripts.js.map +1 -0
- package/styles.css +5019 -0
- package/styles.css.map +1 -0
- package/vendor.js +189695 -0
- package/vendor.js.map +1 -0
- package/.browserslistrc +0 -18
- package/.editorconfig +0 -16
- package/README.md +0 -302
- package/angular.json +0 -153
- package/cedar-embeddable-editor-0.9.0.tgz +0 -0
- package/e2e/protractor.conf.js +0 -36
- package/e2e/src/app.e2e-spec.ts +0 -23
- package/e2e/src/app.po.ts +0 -11
- package/e2e/tsconfig.json +0 -14
- package/karma.conf.js +0 -32
- package/license.txt +0 -26
- package/src/app/app.component.dev.ts +0 -74
- package/src/app/app.component.html +0 -5
- package/src/app/app.component.prod.ts +0 -76
- package/src/app/app.component.scss +0 -1
- package/src/app/app.module.dev.ts +0 -58
- package/src/app/app.module.prod.ts +0 -56
- 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 +0 -24
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.ts +0 -39
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.html +0 -25
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.ts +0 -91
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.html +0 -8
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.ts +0 -104
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.html +0 -22
- 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 +0 -24
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.ts +0 -135
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.html +0 -44
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.ts +0 -451
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.html +0 -16
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts +0 -91
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html +0 -16
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts +0 -92
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.html +0 -18
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.scss +0 -5
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.spec.ts +0 -25
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.ts +0 -78
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.html +0 -15
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts +0 -169
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html +0 -15
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.ts +0 -94
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.html +0 -19
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts +0 -108
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html +0 -25
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.ts +0 -125
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html +0 -8
- 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 +0 -24
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts +0 -40
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.html +0 -20
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.scss +0 -24
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.spec.ts +0 -25
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.ts +0 -36
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.html +0 -2
- 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 +0 -25
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.ts +0 -35
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.html +0 -8
- 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 +0 -24
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.ts +0 -39
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.html +0 -6
- 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 +0 -24
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.ts +0 -42
- package/src/app/modules/input-types/input-types.module.ts +0 -139
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.html +0 -13
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.scss +0 -12
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.spec.ts +0 -25
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts +0 -42
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.html +0 -117
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.scss +0 -5
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.spec.ts +0 -25
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.ts +0 -101
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.html +0 -22
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.scss +0 -23
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.spec.ts +0 -24
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.ts +0 -139
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.html +0 -56
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.scss +0 -13
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.spec.ts +0 -25
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.ts +0 -184
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.html +0 -15
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.scss +0 -2
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.spec.ts +0 -25
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.ts +0 -240
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.html +0 -35
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.scss +0 -41
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.spec.ts +0 -25
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.ts +0 -282
- package/src/app/modules/shared/components/date-picker/date-picker.component.html +0 -46
- package/src/app/modules/shared/components/date-picker/date-picker.component.scss +0 -7
- package/src/app/modules/shared/components/date-picker/date-picker.component.spec.ts +0 -25
- package/src/app/modules/shared/components/date-picker/date-picker.component.ts +0 -100
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.spec.ts +0 -33
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.ts +0 -16
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.spec.ts +0 -54
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.ts +0 -67
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.html +0 -26
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.scss +0 -55
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.spec.ts +0 -25
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.ts +0 -67
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.html +0 -42
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.scss +0 -31
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.spec.ts +0 -177
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.ts +0 -145
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.service.ts +0 -21
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.html +0 -1
- 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 +0 -59
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.ts +0 -139
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.spec.ts +0 -33
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.ts +0 -17
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.module.ts +0 -35
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.type.ts +0 -24
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.html +0 -18
- 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 +0 -23
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.ts +0 -10
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.html +0 -16
- 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 +0 -25
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.ts +0 -89
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.html +0 -19
- 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 +0 -25
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.ts +0 -66
- package/src/app/modules/shared/components/sample-templates/sample-templates.service.ts +0 -175
- package/src/app/modules/shared/components/source-panels/source-panels.component.html +0 -98
- 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 +0 -25
- package/src/app/modules/shared/components/source-panels/source-panels.component.ts +0 -36
- package/src/app/modules/shared/components/static-footer/static-footer.component.html +0 -17
- package/src/app/modules/shared/components/static-footer/static-footer.component.scss +0 -110
- package/src/app/modules/shared/components/static-footer/static-footer.component.spec.ts +0 -25
- package/src/app/modules/shared/components/static-footer/static-footer.component.ts +0 -16
- package/src/app/modules/shared/components/static-header/static-header.component.html +0 -10
- package/src/app/modules/shared/components/static-header/static-header.component.scss +0 -13
- package/src/app/modules/shared/components/static-header/static-header.component.spec.ts +0 -25
- package/src/app/modules/shared/components/static-header/static-header.component.ts +0 -21
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.html +0 -16
- 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 +0 -25
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.ts +0 -251
- package/src/app/modules/shared/factory/template-representation.factory.ts +0 -323
- package/src/app/modules/shared/handler/component-type.handler.ts +0 -51
- package/src/app/modules/shared/handler/data-object-builder.handler.ts +0 -159
- package/src/app/modules/shared/handler/data-object-data-value.handler.ts +0 -270
- package/src/app/modules/shared/handler/data-object-structure.handler.ts +0 -145
- package/src/app/modules/shared/handler/multi-instance-object.handler.ts +0 -317
- package/src/app/modules/shared/models/cedar-input-template.model.ts +0 -3
- package/src/app/modules/shared/models/cedar-model.model.ts +0 -48
- package/src/app/modules/shared/models/component/cedar-component.model.ts +0 -16
- package/src/app/modules/shared/models/component/component-representation.model.ts +0 -30
- package/src/app/modules/shared/models/component/element-component.model.ts +0 -11
- package/src/app/modules/shared/models/component/field-component.model.ts +0 -23
- package/src/app/modules/shared/models/component/multi-component.model.ts +0 -10
- package/src/app/modules/shared/models/component/null-component.model.ts +0 -20
- package/src/app/modules/shared/models/component/single-component.model.ts +0 -6
- package/src/app/modules/shared/models/element/abstract-element-component.model.ts +0 -26
- package/src/app/modules/shared/models/element/multi-element-component.model.ts +0 -19
- package/src/app/modules/shared/models/element/single-element-component.model.ts +0 -16
- package/src/app/modules/shared/models/enum/data-object-building-mode.model.ts +0 -6
- package/src/app/modules/shared/models/field/abstract-field-component.model.ts +0 -28
- package/src/app/modules/shared/models/field/multi-field-component.model.ts +0 -21
- package/src/app/modules/shared/models/field/single-field-component.model.ts +0 -18
- package/src/app/modules/shared/models/info/basic-info.model.ts +0 -8
- package/src/app/modules/shared/models/info/choice-info.model.ts +0 -9
- package/src/app/modules/shared/models/info/choice-option.model.ts +0 -6
- package/src/app/modules/shared/models/info/content-info.model.ts +0 -5
- package/src/app/modules/shared/models/info/controlled-info.model.ts +0 -8
- package/src/app/modules/shared/models/info/current-multi-info.model.ts +0 -7
- package/src/app/modules/shared/models/info/label-info.model.ts +0 -7
- package/src/app/modules/shared/models/info/multi-info.model.ts +0 -10
- package/src/app/modules/shared/models/info/multi-instance-info.model.ts +0 -20
- package/src/app/modules/shared/models/info/multi-instance-object-info.model.ts +0 -30
- package/src/app/modules/shared/models/info/number-info.model.ts +0 -9
- package/src/app/modules/shared/models/info/value-info.model.ts +0 -9
- package/src/app/modules/shared/models/input-type.model.ts +0 -21
- package/src/app/modules/shared/models/instance-extract-data.model.ts +0 -3
- package/src/app/modules/shared/models/instance-full-data.model.ts +0 -5
- package/src/app/modules/shared/models/javascript-types.model.ts +0 -7
- package/src/app/modules/shared/models/json-schema.model.ts +0 -39
- package/src/app/modules/shared/models/numbers.model.ts +0 -10
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-parameter-object.ts +0 -8
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-value-constraints.ts +0 -8
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request.ts +0 -9
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response-item.ts +0 -10
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response.ts +0 -13
- package/src/app/modules/shared/models/static/static-field-component.model.ts +0 -24
- package/src/app/modules/shared/models/template/cedar-template.model.ts +0 -24
- package/src/app/modules/shared/models/template/empty-template.model.ts +0 -5
- package/src/app/modules/shared/models/template/null-template.model.ts +0 -23
- package/src/app/modules/shared/models/template/template-component.model.ts +0 -12
- package/src/app/modules/shared/models/temporal.model.ts +0 -13
- package/src/app/modules/shared/models/ui/cedar-ui-component.model.ts +0 -17
- package/src/app/modules/shared/models/xsd.model.ts +0 -11
- package/src/app/modules/shared/pipe/keep-html.pipe.ts +0 -13
- package/src/app/modules/shared/pipe/rdf.pipe.ts +0 -10
- package/src/app/modules/shared/service/active-component-registry.service.ts +0 -134
- package/src/app/modules/shared/service/component-data.service.ts +0 -25
- package/src/app/modules/shared/service/controlled-field-data.service.ts +0 -37
- package/src/app/modules/shared/service/date-time/custom-date-adapter.ts +0 -19
- package/src/app/modules/shared/service/date-time/date-time.service.ts +0 -30
- package/src/app/modules/shared/service/local-settings.service.ts +0 -22
- package/src/app/modules/shared/service/message-handler.service.ts +0 -35
- package/src/app/modules/shared/service/page-break-paginator.service.ts +0 -78
- package/src/app/modules/shared/shared.module.ts +0 -97
- package/src/app/modules/shared/util/data-context.ts +0 -42
- package/src/app/modules/shared/util/data-object-util.ts +0 -102
- package/src/app/modules/shared/util/handler-context.ts +0 -81
- package/src/app/modules/shared/util/template-object-util.ts +0 -21
- package/src/assets/.gitkeep +0 -0
- package/src/environments/environment.prod.ts +0 -5
- package/src/environments/environment.ts +0 -18
- package/src/main.ts +0 -28
- package/src/polyfills.ts +0 -65
- package/src/styles-own.scss +0 -352
- package/src/styles.scss +0 -116
- package/src/test.ts +0 -25
- package/tsconfig.app.json +0 -16
- package/tsconfig.base.json +0 -20
- package/tsconfig.json +0 -20
- package/tsconfig.spec.json +0 -18
- package/tslint.json +0 -152
- /package/{src/assets/fonts/MaterialIcons-Regular.eot → MaterialIcons-Regular.eot} +0 -0
- /package/{src/assets/fonts/MaterialIcons-Regular.ttf → MaterialIcons-Regular.ttf} +0 -0
- /package/{src/assets/fonts/MaterialIcons-Regular.woff → MaterialIcons-Regular.woff} +0 -0
- /package/{src/assets/fonts/MaterialIcons-Regular.woff2 → MaterialIcons-Regular.woff2} +0 -0
- /package/{src/assets → assets}/i18n-cee/en.json +0 -0
- /package/{src/assets → assets}/i18n-cee/hu.json +0 -0
- /package/{src/assets → assets}/images/bmir-logo.png +0 -0
- /package/{src/assets → assets}/images/cedar-logo-80x80.png +0 -0
- /package/{src/favicon.ico → favicon.ico} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "@angular/material/prebuilt-themes/indigo-pink.css";
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.spec.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|