cedar-embeddable-editor 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +18 -0
- package/.editorconfig +16 -0
- package/README.md +302 -0
- package/angular.json +153 -0
- package/cedar-embeddable-editor-0.9.0.tgz +0 -0
- package/e2e/protractor.conf.js +36 -0
- package/e2e/src/app.e2e-spec.ts +23 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.json +14 -0
- package/karma.conf.js +32 -0
- package/license.txt +26 -0
- package/package.json +61 -0
- package/src/app/app.component.dev.ts +74 -0
- package/src/app/app.component.html +5 -0
- package/src/app/app.component.prod.ts +76 -0
- package/src/app/app.component.scss +1 -0
- package/src/app/app.module.dev.ts +58 -0
- package/src/app/app.module.prod.ts +56 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.html +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.ts +104 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.html +22 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.ts +135 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.html +44 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.ts +451 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts +92 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.html +18 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.scss +5 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.ts +78 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts +169 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.ts +94 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.html +19 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts +108 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.ts +125 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts +40 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.html +20 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.scss +24 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.ts +36 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.html +2 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.ts +35 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.html +6 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.ts +42 -0
- package/src/app/modules/input-types/input-types.module.ts +139 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.html +13 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.scss +12 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts +42 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.html +117 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.scss +5 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.ts +101 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.html +22 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.scss +23 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.spec.ts +24 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.ts +139 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.html +56 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.scss +13 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.ts +184 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.html +15 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.scss +2 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.ts +240 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.html +35 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.scss +41 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.ts +282 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.html +46 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.scss +7 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.ts +100 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.ts +16 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.spec.ts +54 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.html +26 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.scss +55 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.spec.ts +25 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.html +42 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.scss +31 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.spec.ts +177 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.ts +145 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.service.ts +21 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.html +1 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.scss +0 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.spec.ts +59 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.ts +139 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.ts +17 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.module.ts +35 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.type.ts +24 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.html +18 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.scss +0 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.spec.ts +23 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.ts +10 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.html +16 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.ts +89 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.html +19 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.ts +66 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.service.ts +175 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.html +98 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.scss +0 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.spec.ts +25 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.ts +36 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.html +17 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.scss +110 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.ts +16 -0
- package/src/app/modules/shared/components/static-header/static-header.component.html +10 -0
- package/src/app/modules/shared/components/static-header/static-header.component.scss +13 -0
- package/src/app/modules/shared/components/static-header/static-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-header/static-header.component.ts +21 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.html +16 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.scss +0 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.ts +251 -0
- package/src/app/modules/shared/factory/template-representation.factory.ts +323 -0
- package/src/app/modules/shared/handler/component-type.handler.ts +51 -0
- package/src/app/modules/shared/handler/data-object-builder.handler.ts +159 -0
- package/src/app/modules/shared/handler/data-object-data-value.handler.ts +270 -0
- package/src/app/modules/shared/handler/data-object-structure.handler.ts +145 -0
- package/src/app/modules/shared/handler/multi-instance-object.handler.ts +317 -0
- package/src/app/modules/shared/models/cedar-input-template.model.ts +3 -0
- package/src/app/modules/shared/models/cedar-model.model.ts +48 -0
- package/src/app/modules/shared/models/component/cedar-component.model.ts +16 -0
- package/src/app/modules/shared/models/component/component-representation.model.ts +30 -0
- package/src/app/modules/shared/models/component/element-component.model.ts +11 -0
- package/src/app/modules/shared/models/component/field-component.model.ts +23 -0
- package/src/app/modules/shared/models/component/multi-component.model.ts +10 -0
- package/src/app/modules/shared/models/component/null-component.model.ts +20 -0
- package/src/app/modules/shared/models/component/single-component.model.ts +6 -0
- package/src/app/modules/shared/models/element/abstract-element-component.model.ts +26 -0
- package/src/app/modules/shared/models/element/multi-element-component.model.ts +19 -0
- package/src/app/modules/shared/models/element/single-element-component.model.ts +16 -0
- package/src/app/modules/shared/models/enum/data-object-building-mode.model.ts +6 -0
- package/src/app/modules/shared/models/field/abstract-field-component.model.ts +28 -0
- package/src/app/modules/shared/models/field/multi-field-component.model.ts +21 -0
- package/src/app/modules/shared/models/field/single-field-component.model.ts +18 -0
- package/src/app/modules/shared/models/info/basic-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/choice-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/choice-option.model.ts +6 -0
- package/src/app/modules/shared/models/info/content-info.model.ts +5 -0
- package/src/app/modules/shared/models/info/controlled-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/current-multi-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/label-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/multi-info.model.ts +10 -0
- package/src/app/modules/shared/models/info/multi-instance-info.model.ts +20 -0
- package/src/app/modules/shared/models/info/multi-instance-object-info.model.ts +30 -0
- package/src/app/modules/shared/models/info/number-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/value-info.model.ts +9 -0
- package/src/app/modules/shared/models/input-type.model.ts +21 -0
- package/src/app/modules/shared/models/instance-extract-data.model.ts +3 -0
- package/src/app/modules/shared/models/instance-full-data.model.ts +5 -0
- package/src/app/modules/shared/models/javascript-types.model.ts +7 -0
- package/src/app/modules/shared/models/json-schema.model.ts +39 -0
- package/src/app/modules/shared/models/numbers.model.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-parameter-object.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-value-constraints.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request.ts +9 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response-item.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response.ts +13 -0
- package/src/app/modules/shared/models/static/static-field-component.model.ts +24 -0
- package/src/app/modules/shared/models/template/cedar-template.model.ts +24 -0
- package/src/app/modules/shared/models/template/empty-template.model.ts +5 -0
- package/src/app/modules/shared/models/template/null-template.model.ts +23 -0
- package/src/app/modules/shared/models/template/template-component.model.ts +12 -0
- package/src/app/modules/shared/models/temporal.model.ts +13 -0
- package/src/app/modules/shared/models/ui/cedar-ui-component.model.ts +17 -0
- package/src/app/modules/shared/models/xsd.model.ts +11 -0
- package/src/app/modules/shared/pipe/keep-html.pipe.ts +13 -0
- package/src/app/modules/shared/pipe/rdf.pipe.ts +10 -0
- package/src/app/modules/shared/service/active-component-registry.service.ts +134 -0
- package/src/app/modules/shared/service/component-data.service.ts +25 -0
- package/src/app/modules/shared/service/controlled-field-data.service.ts +37 -0
- package/src/app/modules/shared/service/date-time/custom-date-adapter.ts +19 -0
- package/src/app/modules/shared/service/date-time/date-time.service.ts +30 -0
- package/src/app/modules/shared/service/local-settings.service.ts +22 -0
- package/src/app/modules/shared/service/message-handler.service.ts +35 -0
- package/src/app/modules/shared/service/page-break-paginator.service.ts +78 -0
- package/src/app/modules/shared/shared.module.ts +97 -0
- package/src/app/modules/shared/util/data-context.ts +42 -0
- package/src/app/modules/shared/util/data-object-util.ts +102 -0
- package/src/app/modules/shared/util/handler-context.ts +81 -0
- package/src/app/modules/shared/util/template-object-util.ts +21 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/i18n-cee/en.json +86 -0
- package/src/assets/i18n-cee/hu.json +86 -0
- package/src/assets/images/bmir-logo.png +0 -0
- package/src/assets/images/cedar-logo-80x80.png +0 -0
- package/src/environments/environment.prod.ts +5 -0
- package/src/environments/environment.ts +18 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +16 -0
- package/src/main.ts +28 -0
- package/src/polyfills.ts +65 -0
- package/src/styles-own.scss +352 -0
- package/src/styles.scss +116 -0
- package/src/test.ts +25 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.base.json +20 -0
- package/tsconfig.json +20 -0
- package/tsconfig.spec.json +18 -0
- package/tslint.json +152 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {Injectable} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Injectable({
|
|
4
|
+
providedIn: 'root'
|
|
5
|
+
})
|
|
6
|
+
export class DateTimeService {
|
|
7
|
+
private formatString: string;
|
|
8
|
+
private localeString: string;
|
|
9
|
+
|
|
10
|
+
public constructor() {
|
|
11
|
+
this.formatString = 'LL';
|
|
12
|
+
this.localeString = 'en-US';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public get format(): string {
|
|
16
|
+
return this.formatString;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public set format(value: string) {
|
|
20
|
+
this.formatString = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public get locale(): string {
|
|
24
|
+
return this.localeString;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public set locale(value: string) {
|
|
28
|
+
this.localeString = value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {Injectable} from '@angular/core';
|
|
2
|
+
import {environment} from '../../../../environments/environment';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root'
|
|
6
|
+
})
|
|
7
|
+
export class LocalSettingsService {
|
|
8
|
+
|
|
9
|
+
// keys
|
|
10
|
+
private static LANGUAGE = 'language';
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public setLanguage(language: string): void {
|
|
16
|
+
localStorage.setItem(LocalSettingsService.LANGUAGE, language);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public getLanguage(): string {
|
|
20
|
+
return localStorage.getItem(LocalSettingsService.LANGUAGE) ?? environment.defaultLanguage;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {Injectable} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Injectable({
|
|
4
|
+
providedIn: 'root',
|
|
5
|
+
})
|
|
6
|
+
export class MessageHandlerService {
|
|
7
|
+
|
|
8
|
+
private eventHandler = null;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
injectEventHandler(value: object): void {
|
|
14
|
+
this.eventHandler = value;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
trace(label: string): void {
|
|
18
|
+
console.log('TRACE: ' + label);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
traceObject(label: string, value: object): void {
|
|
22
|
+
console.log('TRACE: ' + label);
|
|
23
|
+
console.log(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
error(label: string): void {
|
|
27
|
+
console.error('ERROR: ' + label);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
errorObject(label: string, value: object): void {
|
|
31
|
+
console.error('ERROR: ' + label);
|
|
32
|
+
console.error(value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {CedarComponent} from '../models/component/cedar-component.model';
|
|
2
|
+
|
|
3
|
+
export class PageBreakPaginatorService {
|
|
4
|
+
|
|
5
|
+
currentPageBreakIndex: number;
|
|
6
|
+
pageBreakChildren: Array<CedarComponent[]>;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
reset(pbChildren: Array<CedarComponent[]>): void {
|
|
10
|
+
this.pageBreakChildren = pbChildren;
|
|
11
|
+
this.currentPageBreakIndex = 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
numPages(): number {
|
|
15
|
+
return this.pageBreakChildren.length;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
allPageIndices(): number[] {
|
|
19
|
+
return this.pageBreakChildren.map((_, i) => i);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
currentPage(): CedarComponent[] {
|
|
23
|
+
return this.page(this.currentPageBreakIndex);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
currentPageSize(): number {
|
|
27
|
+
return this.currentPage().length;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
page(pageNum: number): CedarComponent[] {
|
|
31
|
+
if (pageNum >= 0 && pageNum < this.pageBreakChildren.length) {
|
|
32
|
+
this.currentPageBreakIndex = pageNum;
|
|
33
|
+
return this.curPage();
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
hasPreviousPage(): boolean {
|
|
39
|
+
return (this.currentPageBreakIndex > 0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
previousPage(): CedarComponent[] {
|
|
43
|
+
if (this.hasPreviousPage()) {
|
|
44
|
+
this.currentPageBreakIndex--;
|
|
45
|
+
return this.curPage();
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
decrementPage(): void {
|
|
51
|
+
if (this.currentPageBreakIndex > 0) {
|
|
52
|
+
this.currentPageBreakIndex--;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
hasNextPage(): boolean {
|
|
57
|
+
return (this.currentPageBreakIndex < this.pageBreakChildren.length - 1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
nextPage(): CedarComponent[] {
|
|
61
|
+
if (this.hasNextPage()) {
|
|
62
|
+
this.currentPageBreakIndex++;
|
|
63
|
+
return this.curPage();
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
incrementPage(): void {
|
|
69
|
+
if (this.currentPageBreakIndex < this.pageBreakChildren.length - 1) {
|
|
70
|
+
this.currentPageBreakIndex++;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private curPage(): CedarComponent[] {
|
|
75
|
+
return this.pageBreakChildren[this.currentPageBreakIndex];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {NgModule} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
import {RdfPipe} from './pipe/rdf.pipe';
|
|
4
|
+
import {CedarComponentHeaderComponent} from './components/cedar-component-header/cedar-component-header.component';
|
|
5
|
+
import {MatCardModule} from '@angular/material/card';
|
|
6
|
+
import {MatIconModule} from '@angular/material/icon';
|
|
7
|
+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
8
|
+
import {MatFormFieldModule} from '@angular/material/form-field';
|
|
9
|
+
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|
10
|
+
import {MatInputModule} from '@angular/material/input';
|
|
11
|
+
import {MatExpansionModule} from '@angular/material/expansion';
|
|
12
|
+
import {MatButtonModule} from '@angular/material/button';
|
|
13
|
+
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
14
|
+
import {ClipboardModule} from '@angular/cdk/clipboard';
|
|
15
|
+
import {MatToolbarModule} from '@angular/material/toolbar';
|
|
16
|
+
import {MatRippleModule} from '@angular/material/core';
|
|
17
|
+
import {MatPaginatorModule} from '@angular/material/paginator';
|
|
18
|
+
import {MatChipsModule} from '@angular/material/chips';
|
|
19
|
+
import {MatGridListModule} from '@angular/material/grid-list';
|
|
20
|
+
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
|
21
|
+
import {MatListModule} from '@angular/material/list';
|
|
22
|
+
import {MatSelectModule} from '@angular/material/select';
|
|
23
|
+
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
|
24
|
+
import {NgSelectModule} from '@ng-select/ng-select';
|
|
25
|
+
import {
|
|
26
|
+
CedarEmbeddableMetadataEditorComponent
|
|
27
|
+
} from './components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component';
|
|
28
|
+
import {CedarComponentRendererComponent} from './components/cedar-component-renderer/cedar-component-renderer.component';
|
|
29
|
+
import {CedarDataSaverComponent} from './components/cedar-data-saver/cedar-data-saver.component';
|
|
30
|
+
import {StaticFooterComponent} from './components/static-footer/static-footer.component';
|
|
31
|
+
import {StaticHeaderComponent} from './components/static-header/static-header.component';
|
|
32
|
+
import {SourcePanelsComponent} from './components/source-panels/source-panels.component';
|
|
33
|
+
import {CedarMultiPagerComponent} from './components/cedar-multi-pager/cedar-multi-pager.component';
|
|
34
|
+
import {InputTypesModule} from '../input-types/input-types.module';
|
|
35
|
+
import {
|
|
36
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
37
|
+
} from './components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component';
|
|
38
|
+
import {SampleTemplatesComponent} from './components/sample-templates/sample-templates.component';
|
|
39
|
+
import {SampleTemplateSelectComponent} from './components/sample-templates/sample-template-select/sample-template-select.component';
|
|
40
|
+
import {PreferencesMenu} from './components/preferences-menu/preferences-menu.component';
|
|
41
|
+
import {MatMenuModule} from '@angular/material/menu';
|
|
42
|
+
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
|
43
|
+
import {TranslateModule} from '@ngx-translate/core';
|
|
44
|
+
|
|
45
|
+
@NgModule({
|
|
46
|
+
imports: [
|
|
47
|
+
CommonModule,
|
|
48
|
+
MatCardModule,
|
|
49
|
+
MatIconModule,
|
|
50
|
+
BrowserAnimationsModule,
|
|
51
|
+
MatFormFieldModule,
|
|
52
|
+
ReactiveFormsModule,
|
|
53
|
+
MatFormFieldModule,
|
|
54
|
+
MatInputModule,
|
|
55
|
+
MatExpansionModule,
|
|
56
|
+
MatButtonModule,
|
|
57
|
+
MatTooltipModule,
|
|
58
|
+
ClipboardModule,
|
|
59
|
+
MatToolbarModule,
|
|
60
|
+
MatRippleModule,
|
|
61
|
+
MatPaginatorModule,
|
|
62
|
+
MatChipsModule,
|
|
63
|
+
MatGridListModule,
|
|
64
|
+
MatProgressSpinnerModule,
|
|
65
|
+
MatListModule,
|
|
66
|
+
MatSelectModule,
|
|
67
|
+
NgxMatSelectSearchModule,
|
|
68
|
+
NgSelectModule,
|
|
69
|
+
InputTypesModule,
|
|
70
|
+
FormsModule,
|
|
71
|
+
MatMenuModule,
|
|
72
|
+
MatSlideToggleModule,
|
|
73
|
+
TranslateModule,
|
|
74
|
+
],
|
|
75
|
+
declarations: [
|
|
76
|
+
RdfPipe,
|
|
77
|
+
CedarComponentHeaderComponent,
|
|
78
|
+
CedarEmbeddableMetadataEditorComponent,
|
|
79
|
+
CedarEmbeddableMetadataEditorWrapperComponent,
|
|
80
|
+
SampleTemplatesComponent,
|
|
81
|
+
SampleTemplateSelectComponent,
|
|
82
|
+
CedarComponentRendererComponent,
|
|
83
|
+
CedarDataSaverComponent,
|
|
84
|
+
StaticFooterComponent,
|
|
85
|
+
StaticHeaderComponent,
|
|
86
|
+
SourcePanelsComponent,
|
|
87
|
+
CedarMultiPagerComponent,
|
|
88
|
+
PreferencesMenu
|
|
89
|
+
],
|
|
90
|
+
providers: [],
|
|
91
|
+
exports: [
|
|
92
|
+
RdfPipe,
|
|
93
|
+
CedarEmbeddableMetadataEditorWrapperComponent,
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
export class SharedModule {
|
|
97
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {CedarInputTemplate} from '../models/cedar-input-template.model';
|
|
2
|
+
import {TemplateComponent} from '../models/template/template-component.model';
|
|
3
|
+
import {MultiInstanceInfo} from '../models/info/multi-instance-info.model';
|
|
4
|
+
import {TemplateRepresentationFactory} from '../factory/template-representation.factory';
|
|
5
|
+
import {InstanceExtractData} from '../models/instance-extract-data.model';
|
|
6
|
+
import {InstanceFullData} from '../models/instance-full-data.model';
|
|
7
|
+
import {HandlerContext} from './handler-context';
|
|
8
|
+
import {MultiInstanceObjectHandler} from '../handler/multi-instance-object.handler';
|
|
9
|
+
import {DataObjectBuilderHandler} from '../handler/data-object-builder.handler';
|
|
10
|
+
import {PageBreakPaginatorService} from '../service/page-break-paginator.service';
|
|
11
|
+
|
|
12
|
+
export class DataContext {
|
|
13
|
+
|
|
14
|
+
templateInput: CedarInputTemplate = null;
|
|
15
|
+
templateRepresentation: TemplateComponent = null;
|
|
16
|
+
instanceExtractData: InstanceExtractData = null;
|
|
17
|
+
instanceFullData: InstanceFullData = null;
|
|
18
|
+
multiInstanceData: MultiInstanceInfo = null;
|
|
19
|
+
savedTemplateID: string;
|
|
20
|
+
templateInfo: object;
|
|
21
|
+
|
|
22
|
+
public constructor() {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set externalTemplateInfo(templateInfo: object) {
|
|
26
|
+
this.templateInfo = templateInfo;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
setInputTemplate(value: object, handlerContext: HandlerContext,
|
|
30
|
+
pageBreakPaginatorService: PageBreakPaginatorService, collapseStaticComponents: boolean): void {
|
|
31
|
+
this.templateInput = value as CedarInputTemplate;
|
|
32
|
+
this.templateRepresentation = TemplateRepresentationFactory.create(this.templateInput, collapseStaticComponents);
|
|
33
|
+
pageBreakPaginatorService.reset(this.templateRepresentation.pageBreakChildren);
|
|
34
|
+
const multiInstanceObjectService: MultiInstanceObjectHandler = handlerContext.multiInstanceObjectService;
|
|
35
|
+
const dataObjectService: DataObjectBuilderHandler = handlerContext.dataObjectBuilderService;
|
|
36
|
+
this.instanceExtractData = dataObjectService.buildNewExtractDataObject(this.templateRepresentation, this.templateInput);
|
|
37
|
+
this.instanceFullData = dataObjectService.buildNewFullDataObject(this.templateRepresentation, this.templateInput);
|
|
38
|
+
this.multiInstanceData = multiInstanceObjectService.buildNewOrFromMetadata(this.templateRepresentation);
|
|
39
|
+
this.savedTemplateID = null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {JsonSchema} from '../models/json-schema.model';
|
|
2
|
+
import {CedarModel} from '../models/cedar-model.model';
|
|
3
|
+
import {JavascriptTypes} from '../models/javascript-types.model';
|
|
4
|
+
import {TemplateObjectUtil} from './template-object-util';
|
|
5
|
+
import {DataObjectBuildingMode} from '../models/enum/data-object-building-mode.model';
|
|
6
|
+
|
|
7
|
+
export class DataObjectUtil {
|
|
8
|
+
|
|
9
|
+
static getEmptyValueWrapper(templateJsonObj: object, buildingMode: DataObjectBuildingMode): object {
|
|
10
|
+
const obj = {};
|
|
11
|
+
if (!TemplateObjectUtil.hasControlledInfo(templateJsonObj) ) {
|
|
12
|
+
obj[JsonSchema.atValue] = null;
|
|
13
|
+
}
|
|
14
|
+
if (buildingMode === DataObjectBuildingMode.INCLUDE_CONTEXT) {
|
|
15
|
+
this.injectAtTypeIfAvailable(obj, templateJsonObj);
|
|
16
|
+
}
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static getEmptyObject(): object {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static getEmptyList(): [] {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private static injectAtTypeIfAvailable(obj: object, templateJsonObj: object): void {
|
|
29
|
+
if (templateJsonObj != null) {
|
|
30
|
+
if (templateJsonObj.hasOwnProperty(CedarModel.valueConstraints)) {
|
|
31
|
+
const vc = templateJsonObj[CedarModel.valueConstraints];
|
|
32
|
+
if (vc.hasOwnProperty(CedarModel.numberType)) {
|
|
33
|
+
obj[JsonSchema.atType] = vc[CedarModel.numberType];
|
|
34
|
+
} else if (vc.hasOwnProperty(CedarModel.temporalType)) {
|
|
35
|
+
obj[JsonSchema.atType] = vc[CedarModel.temporalType];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static convertTemplateContextNode(propsContextProp: object): object {
|
|
42
|
+
let ret = null;
|
|
43
|
+
if (propsContextProp[CedarModel.type] === 'string' && propsContextProp[CedarModel.format] === 'uri') {
|
|
44
|
+
ret = propsContextProp[CedarModel.enum][0];
|
|
45
|
+
} else if (propsContextProp[CedarModel.type] === 'object' && propsContextProp.hasOwnProperty(JsonSchema.properties)) {
|
|
46
|
+
ret = {};
|
|
47
|
+
ret[JsonSchema.atType] = propsContextProp[JsonSchema.properties][JsonSchema.atType][CedarModel.enum][0];
|
|
48
|
+
} else if (propsContextProp.hasOwnProperty(CedarModel.enum)) {
|
|
49
|
+
ret = propsContextProp[CedarModel.enum][0];
|
|
50
|
+
}
|
|
51
|
+
return ret;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static getSafeSubTemplate(templateJsonObj: object, targetName: string): object {
|
|
55
|
+
let subTemplate: object = null;
|
|
56
|
+
if (templateJsonObj != null) {
|
|
57
|
+
subTemplate = templateJsonObj[JsonSchema.properties][targetName];
|
|
58
|
+
if (subTemplate[CedarModel.type] === JavascriptTypes.array) {
|
|
59
|
+
subTemplate = subTemplate[CedarModel.items];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return subTemplate;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Generating a RFC4122 version 4 compliant GUID
|
|
66
|
+
static generateGUID(): string {
|
|
67
|
+
let d = Date.now();
|
|
68
|
+
const guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
69
|
+
const r = (d + Math.random() * 16) % 16 | 0;
|
|
70
|
+
d = Math.floor(d / 16);
|
|
71
|
+
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
|
72
|
+
});
|
|
73
|
+
return guid;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static arraysEqual(arr1, arr2): boolean {
|
|
77
|
+
// if the other array is a falsy value, return
|
|
78
|
+
if (!arr2) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// compare lengths - can save a lot of time
|
|
83
|
+
if (arr1.length !== arr2.length) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
for (let i = 0, l = arr1.length; i < l; i++) {
|
|
88
|
+
// Check if we have nested arrays
|
|
89
|
+
if (arr1[i] instanceof Array && arr2[i] instanceof Array) {
|
|
90
|
+
// recurse into the nested arrays
|
|
91
|
+
if (!arr1[i].equals(arr2[i])) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
} else if (arr1[i] !== arr2[i]) {
|
|
95
|
+
// Warning - two different object instances will never be equal: {x:20} != {x:20}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {MultiComponent} from '../models/component/multi-component.model';
|
|
2
|
+
import {DataContext} from './data-context';
|
|
3
|
+
import {MultiInstanceObjectHandler} from '../handler/multi-instance-object.handler';
|
|
4
|
+
import {DataObjectBuilderHandler} from '../handler/data-object-builder.handler';
|
|
5
|
+
import {FieldComponent} from '../models/component/field-component.model';
|
|
6
|
+
import {DataObjectDataValueHandler} from '../handler/data-object-data-value.handler';
|
|
7
|
+
import {DataObjectStructureHandler} from '../handler/data-object-structure.handler';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class HandlerContext {
|
|
11
|
+
|
|
12
|
+
readonly dataObjectBuilderService: DataObjectBuilderHandler = null;
|
|
13
|
+
readonly multiInstanceObjectService: MultiInstanceObjectHandler = null;
|
|
14
|
+
readonly dataObjectManipulationService: DataObjectStructureHandler = null;
|
|
15
|
+
readonly dataObjectDataValueHandler: DataObjectDataValueHandler = null;
|
|
16
|
+
readonly dataContext: DataContext = null;
|
|
17
|
+
|
|
18
|
+
public constructor(dataContext: DataContext) {
|
|
19
|
+
this.dataObjectBuilderService = new DataObjectBuilderHandler();
|
|
20
|
+
this.multiInstanceObjectService = new MultiInstanceObjectHandler();
|
|
21
|
+
this.dataObjectBuilderService.injectMultiInstanceService(this.multiInstanceObjectService);
|
|
22
|
+
this.dataObjectManipulationService = new DataObjectStructureHandler();
|
|
23
|
+
this.dataObjectDataValueHandler = new DataObjectDataValueHandler();
|
|
24
|
+
this.dataContext = dataContext;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
addMultiInstance(component: MultiComponent): void {
|
|
28
|
+
this.dataObjectManipulationService.multiInstanceItemAdd(this.dataContext, component, this.multiInstanceObjectService);
|
|
29
|
+
this.multiInstanceObjectService.multiInstanceItemAdd(component);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
copyMultiInstance(component: MultiComponent): void {
|
|
33
|
+
const multiInfo = this.multiInstanceObjectService.getMultiInstanceInfoForComponent(component);
|
|
34
|
+
|
|
35
|
+
// nothing to copy from, create new
|
|
36
|
+
if (multiInfo.currentIndex < 0) {
|
|
37
|
+
this.addMultiInstance(component);
|
|
38
|
+
} else {
|
|
39
|
+
this.dataObjectManipulationService.multiInstanceItemCopy(this.dataContext, component, this.multiInstanceObjectService);
|
|
40
|
+
this.multiInstanceObjectService.multiInstanceItemCopy(component);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
deleteMultiInstance(component: MultiComponent): void {
|
|
45
|
+
this.dataObjectManipulationService.multiInstanceItemDelete(this.dataContext, component, this.multiInstanceObjectService);
|
|
46
|
+
this.multiInstanceObjectService.multiInstanceItemDelete(component);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getDataObjectNodeByPath(path: string[]): object {
|
|
50
|
+
return this.dataObjectManipulationService.getDataPathNodeRecursively(this.dataContext.instanceExtractData, this.dataContext.templateRepresentation, path, this.multiInstanceObjectService);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
getParentDataObjectNodeByPath(path: string[]): object {
|
|
54
|
+
return this.dataObjectManipulationService.getParentDataPathNodeRecursively(this.dataContext.instanceExtractData, null, this.dataContext.templateRepresentation, path, this.multiInstanceObjectService);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setCurrentIndex(component: MultiComponent, idx: number): void {
|
|
58
|
+
this.multiInstanceObjectService.setCurrentIndex(component, idx);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
changeValue(component: FieldComponent, value: string): void {
|
|
62
|
+
this.dataObjectDataValueHandler.changeValue(this.dataContext, component, this.multiInstanceObjectService, value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
changeListValue(component: FieldComponent, value: string[]): void {
|
|
66
|
+
this.dataObjectDataValueHandler.changeListValue(this.dataContext, component, this.multiInstanceObjectService, value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
changeAttributeValue(component: FieldComponent, key: string, value: string): void {
|
|
70
|
+
this.dataObjectDataValueHandler.changeAttributeValue(this.dataContext, component, this.multiInstanceObjectService, key, value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
deleteAttributeValue(component: FieldComponent, key: string): void {
|
|
74
|
+
this.dataObjectDataValueHandler.deleteAttributeValue(this.dataContext, component, this.multiInstanceObjectService, key);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
changeControlledValue(component: FieldComponent, atId: string, prefLabel: string): void {
|
|
78
|
+
this.dataObjectDataValueHandler.changeControlledValue(this.dataContext, component, this.multiInstanceObjectService, atId, prefLabel);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {CedarModel} from '../models/cedar-model.model';
|
|
2
|
+
|
|
3
|
+
export class TemplateObjectUtil {
|
|
4
|
+
|
|
5
|
+
static hasControlledInfo(dataNode: object): boolean {
|
|
6
|
+
if (TemplateObjectUtil.hasValueConstraints(dataNode)) {
|
|
7
|
+
const vc: object = dataNode[CedarModel.valueConstraints];
|
|
8
|
+
const hasOntologies = vc.hasOwnProperty(CedarModel.ontologies) && vc[CedarModel.ontologies].length > 0;
|
|
9
|
+
const hasValueSets = vc.hasOwnProperty(CedarModel.valueSets) && vc[CedarModel.valueSets].length > 0;
|
|
10
|
+
const hasClasses = vc.hasOwnProperty(CedarModel.classes) && vc[CedarModel.classes].length > 0;
|
|
11
|
+
const hasBranches = vc.hasOwnProperty(CedarModel.branches) && vc[CedarModel.branches].length > 0;
|
|
12
|
+
return hasOntologies || hasValueSets || hasClasses || hasBranches;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static hasValueConstraints(dataNode: object): boolean {
|
|
18
|
+
return dataNode != null && dataNode.hasOwnProperty(CedarModel.valueConstraints);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App": {
|
|
3
|
+
"Title": "CEDAR Embeddable Editor",
|
|
4
|
+
"Maintained": "CEDAR is maintained by the Stanford Center for Biomedical Informatics Research.",
|
|
5
|
+
"Contact": "Contact CEDAR"
|
|
6
|
+
},
|
|
7
|
+
"Generic": {
|
|
8
|
+
"BMIR": "BMIR",
|
|
9
|
+
"SAVE": "SAVE",
|
|
10
|
+
"Infinite": "Infinite",
|
|
11
|
+
"ExpandAll": "Expand All",
|
|
12
|
+
"CollapseAll": "Collapse All",
|
|
13
|
+
"Copy": "Copy",
|
|
14
|
+
"Page": "Page",
|
|
15
|
+
"Name": "Name",
|
|
16
|
+
"Value": "Value",
|
|
17
|
+
"AttributeName": "Attribute Name",
|
|
18
|
+
"AttributeValue": "Attribute Value",
|
|
19
|
+
"AllValues": "All Values",
|
|
20
|
+
"Clear": "Clear",
|
|
21
|
+
"SelectDecimalSeconds": "Select Decimal Seconds",
|
|
22
|
+
"SelectTimeZone": "Select Time Zone",
|
|
23
|
+
"NoTimeZoneFound": "No Time Zone Found",
|
|
24
|
+
"SelectYear": "Select Year",
|
|
25
|
+
"SelectYearAndMonth": "Select Year and Month",
|
|
26
|
+
"SelectDate": "Select Date",
|
|
27
|
+
"NumberOnly": "Number Only",
|
|
28
|
+
"CedarLogo": "Cedar Logo"
|
|
29
|
+
},
|
|
30
|
+
"Process": {
|
|
31
|
+
"Initializing": "CEDAR Embeddable Editor initializing..."
|
|
32
|
+
},
|
|
33
|
+
"Multi": {
|
|
34
|
+
"NoInstancesYet": "No instances yet",
|
|
35
|
+
"AddEmptyAfter": "Add empty after current",
|
|
36
|
+
"AddCloneAfter": "Add clone after current",
|
|
37
|
+
"DeleteCurrent": "Delete current"
|
|
38
|
+
},
|
|
39
|
+
"Error": {
|
|
40
|
+
"ValueRequired": "The value is required"
|
|
41
|
+
},
|
|
42
|
+
"Extra": {
|
|
43
|
+
"SampleTemplate": {
|
|
44
|
+
"Title": "Sample templates",
|
|
45
|
+
"Select": "Select template",
|
|
46
|
+
"Find": "Find template...",
|
|
47
|
+
"FindNoMatch": "No matching templates found"
|
|
48
|
+
},
|
|
49
|
+
"JsonLD": {
|
|
50
|
+
"InstanceCore": "JSON-LD - Instance - Core",
|
|
51
|
+
"Instance": "JSON-LD - Instance"
|
|
52
|
+
},
|
|
53
|
+
"JsonSchemaTemplate": "JSON Schema - Template",
|
|
54
|
+
"TemplateRendering": "Template Rendering Data",
|
|
55
|
+
"MultiInstance": "Multi-Instance Information"
|
|
56
|
+
},
|
|
57
|
+
"Uploader": {
|
|
58
|
+
"DragAndDrop": "Drag and drop your own CEDAR template here or",
|
|
59
|
+
"Browse": "Browse for file",
|
|
60
|
+
"Error": "Upload of {{fileName}} failed' with an error: {{responseMessage}}",
|
|
61
|
+
"Success": "'Upload of {{fileName}} succeeded"
|
|
62
|
+
},
|
|
63
|
+
"Saver": {
|
|
64
|
+
"Error": "Error saving metadata"
|
|
65
|
+
},
|
|
66
|
+
"Validation": {
|
|
67
|
+
"Required": "The value is required.",
|
|
68
|
+
"Text": {
|
|
69
|
+
"MinLength": "Value should be at least {{constraintMinLength}} chars long.",
|
|
70
|
+
"MaxLength": "Value should be at most {{constraintMaxLength}} chars long."
|
|
71
|
+
},
|
|
72
|
+
"Select": {
|
|
73
|
+
"MaxSelection": "Select up to {{maxSelections}}"
|
|
74
|
+
},
|
|
75
|
+
"Email": {
|
|
76
|
+
"Invalid": "Value should be a valid email address."
|
|
77
|
+
},
|
|
78
|
+
"Link": {
|
|
79
|
+
"Invalid": "Value should be a valid URL."
|
|
80
|
+
},
|
|
81
|
+
"Numeric": {
|
|
82
|
+
"MinValue": "Value should be at least {{constraintMinValue}}.",
|
|
83
|
+
"MaxValue": "Value should be at most {{constraintMaxValue}}."
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|