cedar-embeddable-editor 0.9.1 → 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,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import {DatePickerComponent} from './date-picker.component';
|
|
4
|
-
|
|
5
|
-
describe('DatePickerComponent', () => {
|
|
6
|
-
let component: DatePickerComponent;
|
|
7
|
-
let fixture: ComponentFixture<DatePickerComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [DatePickerComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(DatePickerComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
|
2
|
-
import {FormControl, Validators} from '@angular/forms';
|
|
3
|
-
import {DateAdapter} from '@angular/material/core';
|
|
4
|
-
import {MatDatepicker} from '@angular/material/datepicker';
|
|
5
|
-
|
|
6
|
-
// Depending on whether rollup is used, moment needs to be imported differently.
|
|
7
|
-
// Since Moment.js doesn't have a default export, we normally need to import using the `* as`
|
|
8
|
-
// syntax. However, rollup creates a synthetic default module and we thus need to import it using
|
|
9
|
-
// the `default as` syntax.
|
|
10
|
-
import * as _moment from 'moment';
|
|
11
|
-
// tslint:disable-next-line:no-duplicate-imports
|
|
12
|
-
import {default as _rollupMoment, Moment} from 'moment';
|
|
13
|
-
import {CustomDateAdapter} from '../../service/date-time/custom-date-adapter';
|
|
14
|
-
import {DateTimeService} from '../../service/date-time/date-time.service';
|
|
15
|
-
|
|
16
|
-
const moment = _rollupMoment || _moment;
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'app-date-picker',
|
|
20
|
-
templateUrl: './date-picker.component.html',
|
|
21
|
-
styleUrls: ['./date-picker.component.scss'],
|
|
22
|
-
providers: [
|
|
23
|
-
// DateTimeService is added as a provider to allow it
|
|
24
|
-
// to be injected as a new instance per component, rather
|
|
25
|
-
// than a Singleton instance
|
|
26
|
-
DateTimeService,
|
|
27
|
-
CustomDateAdapter, // so we could inject services to 'CustomDateAdapter'
|
|
28
|
-
{provide: DateAdapter, useClass: CustomDateAdapter} // Parse MatDatePicker format
|
|
29
|
-
]
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
export class DatePickerComponent implements OnInit {
|
|
33
|
-
static readonly YEAR_FORMAT = 'YYYY';
|
|
34
|
-
static readonly YEAR_MONTH_FORMAT = 'MM/YYYY';
|
|
35
|
-
static readonly YEAR_MONTH_DAY_FORMAT = 'MM/DD/YYYY';
|
|
36
|
-
yearFormat = DatePickerComponent.YEAR_FORMAT;
|
|
37
|
-
yearMonthFormat = DatePickerComponent.YEAR_MONTH_FORMAT;
|
|
38
|
-
yearMonthDayFormat = DatePickerComponent.YEAR_MONTH_DAY_FORMAT;
|
|
39
|
-
|
|
40
|
-
@Input() dateMonthYear: FormControl;
|
|
41
|
-
@Input() dateFormat = DatePickerComponent.YEAR_FORMAT;
|
|
42
|
-
@Input() required: boolean;
|
|
43
|
-
@Output() dateChangedEvent = new EventEmitter<Moment>();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
public constructor(private _dateTimeService: DateTimeService) {
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public ngOnInit(): void {
|
|
50
|
-
const validators: any[] = [];
|
|
51
|
-
this._dateTimeService.format = this.dateFormat;
|
|
52
|
-
const m = moment();
|
|
53
|
-
|
|
54
|
-
switch (this.dateFormat) {
|
|
55
|
-
case this.yearMonthFormat:
|
|
56
|
-
m.set('date', 1);
|
|
57
|
-
break;
|
|
58
|
-
case this.yearFormat:
|
|
59
|
-
m.set('date', 1);
|
|
60
|
-
m.set('month', 0);
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
if (this.required) {
|
|
64
|
-
validators.push(Validators.required);
|
|
65
|
-
}
|
|
66
|
-
this.dateMonthYear = new FormControl(null, validators);
|
|
67
|
-
this.dateChangedEvent.emit(this.dateMonthYear.value);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
chosenYearHandler(normalizedYear: Moment, datepicker: MatDatepicker<Moment>): void {
|
|
71
|
-
if (this.dateMonthYear.value == null){
|
|
72
|
-
this.dateMonthYear.setValue(moment());
|
|
73
|
-
}
|
|
74
|
-
const ctrlValue = this.dateMonthYear.value;
|
|
75
|
-
ctrlValue.year(normalizedYear.year());
|
|
76
|
-
this.dateMonthYear.setValue(ctrlValue);
|
|
77
|
-
if (this.dateFormat === this.yearFormat) {
|
|
78
|
-
datepicker.close();
|
|
79
|
-
this.dateChangedEvent.emit(this.dateMonthYear.value);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
chosenMonthHandler(normalizedMonth: Moment, datepicker: MatDatepicker<Moment>): void {
|
|
84
|
-
const ctrlValue = this.dateMonthYear.value;
|
|
85
|
-
ctrlValue.month(normalizedMonth.month());
|
|
86
|
-
this.dateMonthYear.setValue(ctrlValue);
|
|
87
|
-
|
|
88
|
-
if (this.dateFormat === this.yearMonthFormat) {
|
|
89
|
-
datepicker.close();
|
|
90
|
-
}
|
|
91
|
-
this.dateChangedEvent.emit(this.dateMonthYear.value);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
chosenDateHandler(event): void {
|
|
95
|
-
if (event) {
|
|
96
|
-
this.dateChangedEvent.emit(event.value);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BytesPipe } from './bytes.pipe';
|
|
2
|
-
|
|
3
|
-
describe('BytesPipe', () => {
|
|
4
|
-
const pipe = new BytesPipe();
|
|
5
|
-
|
|
6
|
-
it('transforms NAN to -', () => {
|
|
7
|
-
expect(pipe.transform(NaN)).toBe('-');
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('transforms 0 to 0', () => {
|
|
11
|
-
expect(pipe.transform(0)).toBe('0');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('transforms 1024 to 1.0 KB', () => {
|
|
15
|
-
expect(pipe.transform(1024)).toBe('1.0 KB');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('transforms 1024*1024 to 1.0 MB', () => {
|
|
19
|
-
expect(pipe.transform(1024 * 1024)).toBe('1.0 MB');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('transforms 1024*1024*1024 to 1.0 GB', () => {
|
|
23
|
-
expect(pipe.transform(1024 * 1024 * 1024)).toBe('1.0 GB');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('transforms 1024*1024*1024*1024 to 1.0 TB', () => {
|
|
27
|
-
expect(pipe.transform(1024 * 1024 * 1024 * 1024)).toBe('1.0 TB');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('transforms 1024*1024*1024*1024*1024 to 1.0 PB', () => {
|
|
31
|
-
expect(pipe.transform(1024 * 1024 * 1024 * 1024 * 1024)).toBe('1.0 PB');
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {Pipe, PipeTransform} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Pipe({name: 'bytes'})
|
|
4
|
-
export class BytesPipe implements PipeTransform {
|
|
5
|
-
public transform(bytes: number): string {
|
|
6
|
-
if (isNaN(parseFloat('' + bytes)) || !isFinite(bytes)) {
|
|
7
|
-
return '-';
|
|
8
|
-
}
|
|
9
|
-
if (bytes <= 0) {
|
|
10
|
-
return '0';
|
|
11
|
-
}
|
|
12
|
-
const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
13
|
-
const num = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
14
|
-
return (bytes / Math.pow(1024, Math.floor(num))).toFixed(1) + ' ' + units[num];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import { IInput } from '../mat-file-upload.type';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
|
|
7
|
-
import { FileUploadInputForDirective } from './file-upload-input-for.directive';
|
|
8
|
-
import { Component } from '@angular/core';
|
|
9
|
-
@Component({
|
|
10
|
-
template: ` <div
|
|
11
|
-
[fileUploadInputFor]="fileUploadQueue"
|
|
12
|
-
class="upload-drop-zone"
|
|
13
|
-
>
|
|
14
|
-
Just drag and drop files here
|
|
15
|
-
</div>`,
|
|
16
|
-
})
|
|
17
|
-
class FileDropComponent {}
|
|
18
|
-
export class StubMatFileUploadQueueService {
|
|
19
|
-
inputValueSubject = new BehaviorSubject<IInput>(null);
|
|
20
|
-
inputValue$ = this.inputValueSubject.asObservable();
|
|
21
|
-
|
|
22
|
-
initialize(input: IInput): void {
|
|
23
|
-
this.inputValueSubject.next(input);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getInputValue(): IInput {
|
|
27
|
-
return this.inputValueSubject.getValue();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class StubFile {
|
|
32
|
-
name = 'testName';
|
|
33
|
-
size = 1024;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
describe('FileUploadInputForDirective', () => {
|
|
37
|
-
let component: FileDropComponent;
|
|
38
|
-
let fixture;
|
|
39
|
-
|
|
40
|
-
beforeEach(async () => {
|
|
41
|
-
await TestBed.configureTestingModule({
|
|
42
|
-
imports: [CommonModule],
|
|
43
|
-
declarations: [FileUploadInputForDirective, FileDropComponent],
|
|
44
|
-
}).compileComponents();
|
|
45
|
-
fixture = TestBed.createComponent(FileDropComponent);
|
|
46
|
-
component = fixture.componentInstance;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe('', () => {
|
|
50
|
-
it('should create', () => {
|
|
51
|
-
expect(component).toBeTruthy();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {Directive, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A material design file upload queue component.
|
|
5
|
-
*/
|
|
6
|
-
@Directive({
|
|
7
|
-
selector: 'input[fileUploadInputFor], div[fileUploadInputFor], mat-card[fileUploadInputFor]',
|
|
8
|
-
})
|
|
9
|
-
export class FileUploadInputForDirective {
|
|
10
|
-
|
|
11
|
-
private _queue: any = null;
|
|
12
|
-
private _element: HTMLElement;
|
|
13
|
-
@Output() public onFileSelected: EventEmitter<File[]> = new EventEmitter<File[]>();
|
|
14
|
-
@HostBinding('class.fileover') fileOver: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(private element: ElementRef) {
|
|
18
|
-
this._element = this.element.nativeElement;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@Input('fileUploadInputFor')
|
|
22
|
-
set fileUploadQueue(value: any) {
|
|
23
|
-
if (value) {
|
|
24
|
-
this._queue = value;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@HostListener('change')
|
|
29
|
-
public onChange(): any {
|
|
30
|
-
const files = this.element.nativeElement.files;
|
|
31
|
-
this.onFileSelected.emit(files);
|
|
32
|
-
|
|
33
|
-
for (let i = 0; i < files.length; i++) {
|
|
34
|
-
this._queue.add(files[i]);
|
|
35
|
-
}
|
|
36
|
-
this.element.nativeElement.value = '';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@HostListener('drop', ['$event'])
|
|
40
|
-
public onDrop(event: any): any {
|
|
41
|
-
const files = event.dataTransfer.files;
|
|
42
|
-
this.onFileSelected.emit(files);
|
|
43
|
-
|
|
44
|
-
for (let i = 0; i < files.length; i++) {
|
|
45
|
-
this._queue.add(files[i]);
|
|
46
|
-
}
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
event.stopPropagation();
|
|
49
|
-
this.element.nativeElement.value = '';
|
|
50
|
-
this.fileOver = false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@HostListener('dragover', ['$event'])
|
|
54
|
-
public onDropOver(event: any): any {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
event.stopPropagation();
|
|
57
|
-
this.fileOver = true;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@HostListener('dragleave', ['$event'])
|
|
61
|
-
public onDragLeave(event): void {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
event.stopPropagation();
|
|
64
|
-
this.fileOver = false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<input type="file" #singleFile id="singleFile"
|
|
2
|
-
[fileUploadInputFor]="fileUploadQueue"
|
|
3
|
-
[multiple]="false" [accept]="'.json'" style="display: none;"/>
|
|
4
|
-
<div *ngIf="showSuccess" class="notify-success template-card status-box">{{successMessage}}
|
|
5
|
-
<button type="button" class="close" (click)="clearSuccess()">
|
|
6
|
-
<span aria-hidden="true">×</span>
|
|
7
|
-
</button>
|
|
8
|
-
</div>
|
|
9
|
-
<div *ngIf="showError" class="notify-error template-card status-box">{{errorMessage}}
|
|
10
|
-
<button type="button" class="close" (click)="clearError()">
|
|
11
|
-
<span aria-hidden="true">×</span>
|
|
12
|
-
</button>
|
|
13
|
-
</div>
|
|
14
|
-
<mat-card class="template-card container" [fileUploadInputFor]="fileUploadQueue" appDnd>
|
|
15
|
-
<h3><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAABoElEQVRoge2YPU7DQBCFP/HT01DFEQ1Q01NxAw7BMSgoKZE4RWSlInABEnMELkCJJWJKpJjCtmSCDbvr2fXfPmnkaLUzb15mNLs2eHh4jBpLIK2wVWlPZGG9bEudhHdq1s9r1lPLv1Vy0ELxr7QFbf66ivQOgxGyV7P+AmxcJtIxfg9riPg563vL78dvW/BTy8MxVKdGAIRAQvUNVtISYA6c6AhRmRoBEDsQsG0xMJEUEuZ7HnQCN8AEWOScM1WniP9fbIp2ciGiwDTn/JAM2tahWck7mAOxTkjbdy0xqLTN6Fvr1iWZytQyrUgK3Bj4NeUVD1j4mVamc0JMxWjxqkwtCSEmbabFa3NqVd2fdCrTaSE6YjonZAO8ApfAGXAgmNuvzdu2qtijixR4Aq6AL+DIwF+Z95lqIeWzxVTIPbAL7ANvwJ2mf2fGbxnXwCfqbSXFKx7wELhogdduwCa8g38f6R2aCEnyZyCRiCKm+XMtGXRO1qsL3IgJgMecM5QMfAq8Y+fb1V8WA8eSQiD7FDQjK7VtAWuySoiL8PAYA74BrJ0x93i8VhIAAAAASUVORK5CYII=" style="vertical-align: middle"/> {{'Uploader.DragAndDrop' | translate}} <label for="singleFile" class="mat-focus-indicator mat-raised-button mat-button-base mat-primary">{{'Uploader.Browse' | translate}}</label></h3>
|
|
16
|
-
</mat-card>
|
|
17
|
-
<mat-file-upload-queue #fileUploadQueue [fileAlias]="fileAlias" [httpUrl]="httpUrl">
|
|
18
|
-
<mat-file-upload [file]="file" [id]="i" *ngFor="let file of fileUploadQueue.files; let i = index"
|
|
19
|
-
(onUpload)="onFileUploaded($event)"
|
|
20
|
-
></mat-file-upload>
|
|
21
|
-
</mat-file-upload-queue>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
text-align: center;
|
|
4
|
-
border: dashed 1px #979797;
|
|
5
|
-
position: relative;
|
|
6
|
-
margin: 0 auto;
|
|
7
|
-
cursor: copy;
|
|
8
|
-
|
|
9
|
-
input {
|
|
10
|
-
opacity: 0;
|
|
11
|
-
position: absolute;
|
|
12
|
-
z-index: 2;
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 100%;
|
|
15
|
-
top: 0;
|
|
16
|
-
left: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
h3 {
|
|
20
|
-
font-size: 20px;
|
|
21
|
-
font-weight: 600;
|
|
22
|
-
color: #38424c;
|
|
23
|
-
margin: 0;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.fileover {
|
|
28
|
-
animation: shake 1s;
|
|
29
|
-
animation-iteration-count: infinite;
|
|
30
|
-
background-color: #ffffff;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Shake animation */
|
|
34
|
-
@keyframes shake {
|
|
35
|
-
10%, 50%, 90% {
|
|
36
|
-
transform: translateY(-1px);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
20%, 80% {
|
|
40
|
-
transform: translateY(0px);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
30%, 70% {
|
|
44
|
-
transform: translateY(1px);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
40%, 60% {
|
|
48
|
-
transform: translateY(0px);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.status-box {
|
|
53
|
-
max-width: 90%;
|
|
54
|
-
margin: 0 auto;
|
|
55
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FileUploaderComponent } from './file-uploader.component';
|
|
4
|
-
|
|
5
|
-
describe('FileUploaderComponent', () => {
|
|
6
|
-
let component: FileUploaderComponent;
|
|
7
|
-
let fixture: ComponentFixture<FileUploaderComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ FileUploaderComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(FileUploaderComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
|
|
2
|
-
import {HttpErrorResponse, HttpResponse} from '@angular/common/http';
|
|
3
|
-
import {TranslateService} from '@ngx-translate/core';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-file-uploader',
|
|
8
|
-
templateUrl: './file-uploader.component.html',
|
|
9
|
-
styleUrls: ['./file-uploader.component.scss'],
|
|
10
|
-
encapsulation: ViewEncapsulation.None
|
|
11
|
-
})
|
|
12
|
-
export class FileUploaderComponent implements OnInit {
|
|
13
|
-
|
|
14
|
-
// Number of milliseconds to display the file upload success message
|
|
15
|
-
private static readonly SUCCESS_MESSAGE_TIMEOUT = 5000;
|
|
16
|
-
|
|
17
|
-
@Input() fileAlias: string;
|
|
18
|
-
@Input() httpUrl: string;
|
|
19
|
-
@Output() fileUploaded = new EventEmitter<object>();
|
|
20
|
-
showSuccess = false;
|
|
21
|
-
showError = false;
|
|
22
|
-
successMessage = '';
|
|
23
|
-
errorMessage = '';
|
|
24
|
-
|
|
25
|
-
protected translateService: TranslateService;
|
|
26
|
-
|
|
27
|
-
constructor(translateService: TranslateService) {
|
|
28
|
-
this.translateService = translateService;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ngOnInit(): void {
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
onFileUploaded(event): void {
|
|
35
|
-
if (event && event.event instanceof HttpResponse) {
|
|
36
|
-
this.clearError();
|
|
37
|
-
const fileName = event.file.name;
|
|
38
|
-
this.successMessage = this.translateService.instant('Uploader.Success', {fileName});
|
|
39
|
-
this.showSuccess = true;
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
this.clearSuccess();
|
|
42
|
-
}, FileUploaderComponent.SUCCESS_MESSAGE_TIMEOUT);
|
|
43
|
-
} else if (typeof event === 'object' && event.event instanceof HttpErrorResponse) {
|
|
44
|
-
this.clearSuccess();
|
|
45
|
-
const fileName = event.file.name;
|
|
46
|
-
let responseMessage = '';
|
|
47
|
-
const response = event.event;
|
|
48
|
-
if (response.message && response.message.length > 0) {
|
|
49
|
-
responseMessage = response.message;
|
|
50
|
-
}
|
|
51
|
-
this.errorMessage = this.translateService.instant('Uploader.Error', {fileName, responseMessage});
|
|
52
|
-
this.showError = true;
|
|
53
|
-
}
|
|
54
|
-
this.fileUploaded.emit(event);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
clearSuccess(): void {
|
|
58
|
-
this.showSuccess = false;
|
|
59
|
-
this.successMessage = '';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
clearError(): void {
|
|
63
|
-
this.showError = false;
|
|
64
|
-
this.errorMessage = '';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<ng-container *ngIf="uploadProgress$ | async as uploadProgress">
|
|
2
|
-
<mat-card class="template-card upload-progress-card">
|
|
3
|
-
<div class="flex-container-file-upload">
|
|
4
|
-
<div class="flex-child1">
|
|
5
|
-
<div class="file-icon">
|
|
6
|
-
<svg id="fileIcon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 58 58"
|
|
7
|
-
style="enable-background:new 0 0 58 58;" xml:space="preserve">
|
|
8
|
-
<polygon style="fill:#EDEADA;" points="51.5,14 37.5,0 6.5,0 6.5,58 51.5,58 " />
|
|
9
|
-
<g>
|
|
10
|
-
<path style="fill:#CEC9AE;" d="M16.5,23h25c0.552,0,1-0.447,1-1s-0.448-1-1-1h-25c-0.552,0-1,0.447-1,1S15.948,23,16.5,23z" />
|
|
11
|
-
<path style="fill:#CEC9AE;" d="M16.5,15h10c0.552,0,1-0.447,1-1s-0.448-1-1-1h-10c-0.552,0-1,0.447-1,1S15.948,15,16.5,15z" />
|
|
12
|
-
<path style="fill:#CEC9AE;" d="M41.5,29h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,29,41.5,29z" />
|
|
13
|
-
<path style="fill:#CEC9AE;" d="M41.5,37h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,37,41.5,37z" />
|
|
14
|
-
<path style="fill:#CEC9AE;" d="M41.5,45h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,45,41.5,45z" />
|
|
15
|
-
</g>
|
|
16
|
-
<polygon style="fill:#CEC9AE;" points="37.5,0 37.5,14 51.5,14 " />
|
|
17
|
-
</svg>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="flex-child2">
|
|
21
|
-
<span class="file-summary">{{file.name}} ({{file.size | bytes}})</span>
|
|
22
|
-
<span class="upload-progress">
|
|
23
|
-
<mat-progress-bar
|
|
24
|
-
[value]="uploadProgress.progressPercentage"
|
|
25
|
-
></mat-progress-bar>
|
|
26
|
-
<button style="margin-left: 15px;"
|
|
27
|
-
mat-icon-button
|
|
28
|
-
[attr.aria-label]="fileUploadAriaLabel"
|
|
29
|
-
(click)="upload()"
|
|
30
|
-
[disabled]="uploadInProgress$ | async"
|
|
31
|
-
><mat-icon>upload_file</mat-icon></button>
|
|
32
|
-
<button
|
|
33
|
-
mat-icon-button
|
|
34
|
-
[attr.aria-label]="cancelAriaLabel"
|
|
35
|
-
(click)="remove()"
|
|
36
|
-
><mat-icon>close</mat-icon></button>
|
|
37
|
-
</span>
|
|
38
|
-
<span class="file-summary">{{uploadProgress.progressPercentage}}% ({{uploadProgress.loaded | bytes}} of {{uploadProgress.total | bytes}})</span>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</mat-card>
|
|
42
|
-
</ng-container>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.file-summary {
|
|
2
|
-
font-size: 0.85rem;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.upload-progress {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
height: 10px;
|
|
10
|
-
|
|
11
|
-
::ng-deep .mat-progress-bar .mat-progress-bar-element {
|
|
12
|
-
transition: none;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.flex-container-file-upload {
|
|
17
|
-
display: flex;
|
|
18
|
-
|
|
19
|
-
.flex-child1 {
|
|
20
|
-
width: 50px;
|
|
21
|
-
margin-right: 15px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.flex-child2 {
|
|
25
|
-
flex: 1 100%;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.upload-progress-card {
|
|
30
|
-
margin-bottom: 5px;
|
|
31
|
-
}
|