cedar-embeddable-editor 0.9.1 → 0.9.3
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/cedar-embeddable-editor.js +1 -0
- package/package.json +1 -1
- 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/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 +0 -86
- package/src/assets/i18n-cee/hu.json +0 -86
- 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 +0 -5
- package/src/environments/environment.ts +0 -18
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -16
- 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/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.scss
DELETED
|
File without changes
|
package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.spec.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import {CedarInputEmailComponent} from './cedar-input-email.component';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
describe('CedarInputEmailComponent', () => {
|
|
6
|
-
let component: CedarInputEmailComponent;
|
|
7
|
-
let fixture: ComponentFixture<CedarInputEmailComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ CedarInputEmailComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CedarInputEmailComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
-
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
|
|
3
|
-
import {ErrorStateMatcher} from '@angular/material/core';
|
|
4
|
-
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
5
|
-
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
6
|
-
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
7
|
-
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
8
|
-
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
9
|
-
|
|
10
|
-
export class TextFieldErrorStateMatcher implements ErrorStateMatcher {
|
|
11
|
-
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
12
|
-
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@Component({
|
|
17
|
-
selector: 'app-cedar-input-email',
|
|
18
|
-
templateUrl: './cedar-input-email.component.html',
|
|
19
|
-
styleUrls: ['./cedar-input-email.component.scss'],
|
|
20
|
-
encapsulation: ViewEncapsulation.None
|
|
21
|
-
})
|
|
22
|
-
export class CedarInputEmailComponent extends CedarUIComponent implements OnInit {
|
|
23
|
-
|
|
24
|
-
component: FieldComponent;
|
|
25
|
-
options: FormGroup;
|
|
26
|
-
inputValueControl = new FormControl(null, null);
|
|
27
|
-
errorStateMatcher = new TextFieldErrorStateMatcher();
|
|
28
|
-
@Input() handlerContext: HandlerContext;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
fb: FormBuilder,
|
|
32
|
-
public cds: ComponentDataService,
|
|
33
|
-
private activeComponentRegistry: ActiveComponentRegistryService
|
|
34
|
-
) {
|
|
35
|
-
super();
|
|
36
|
-
this.options = fb.group({
|
|
37
|
-
inputValue: this.inputValueControl,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
ngOnInit(): void {
|
|
42
|
-
const validators: any[] = [];
|
|
43
|
-
|
|
44
|
-
validators.push(Validators.email);
|
|
45
|
-
|
|
46
|
-
if (this.component.valueInfo.requiredValue) {
|
|
47
|
-
validators.push(Validators.required);
|
|
48
|
-
}
|
|
49
|
-
this.inputValueControl = new FormControl(null, validators);
|
|
50
|
-
if (this.component.valueInfo.defaultValue != null) {
|
|
51
|
-
this.setValueUIAndModel(this.component.valueInfo.defaultValue);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
56
|
-
this.component = componentToRender;
|
|
57
|
-
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
inputChanged($event: Event): void {
|
|
61
|
-
let val = ($event.target as HTMLTextAreaElement).value;
|
|
62
|
-
|
|
63
|
-
if (val.length === 0) {
|
|
64
|
-
val = null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this.handlerContext.changeValue(this.component, val);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
setCurrentValue(currentValue: any): void {
|
|
71
|
-
this.inputValueControl.setValue(currentValue);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
clearValue(): void {
|
|
75
|
-
this.setValueUIAndModel(null);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private setValueUIAndModel(value: string): void {
|
|
79
|
-
this.inputValueControl.setValue(value);
|
|
80
|
-
this.handlerContext.changeValue(this.component, value);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
getCharCountHint(): string {
|
|
84
|
-
let len = 0;
|
|
85
|
-
if (this.inputValueControl.value != null) {
|
|
86
|
-
len = this.inputValueControl.value.length;
|
|
87
|
-
}
|
|
88
|
-
const s = '' + len;
|
|
89
|
-
return s;
|
|
90
|
-
}
|
|
91
|
-
}
|
package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<form class="form-container" [formGroup]="options">
|
|
2
|
-
<mat-form-field class="full-width">
|
|
3
|
-
<!-- <mat-label>{{cds.getRenderingLabelForComponent(component)}}</mat-label>-->
|
|
4
|
-
<input matInput type="text"
|
|
5
|
-
[formControl]="inputValueControl"
|
|
6
|
-
[errorStateMatcher]="errorStateMatcher"
|
|
7
|
-
(input)="inputChanged($event)"
|
|
8
|
-
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}">
|
|
9
|
-
<button type="button" mat-button *ngIf="inputValueControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearValue()">
|
|
10
|
-
<mat-icon>close</mat-icon>
|
|
11
|
-
</button>
|
|
12
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('link')" class="mat-error">{{'Validation.Link.Invalid' | translate}}</mat-error>
|
|
13
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('required')" class="mat-error">{{'Validation.Required' | translate}}</mat-error>
|
|
14
|
-
</mat-form-field>
|
|
15
|
-
</form>
|
|
16
|
-
|
package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.scss
DELETED
|
File without changes
|
package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.spec.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import {CedarInputLinkComponent} from './cedar-input-link.component';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
describe('CedarInputLinkComponent', () => {
|
|
6
|
-
let component: CedarInputLinkComponent;
|
|
7
|
-
let fixture: ComponentFixture<CedarInputLinkComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ CedarInputLinkComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CedarInputLinkComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
-
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
|
|
3
|
-
import {ErrorStateMatcher} from '@angular/material/core';
|
|
4
|
-
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
5
|
-
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
6
|
-
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
7
|
-
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
8
|
-
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
9
|
-
|
|
10
|
-
export class TextFieldErrorStateMatcher implements ErrorStateMatcher {
|
|
11
|
-
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
12
|
-
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@Component({
|
|
17
|
-
selector: 'app-cedar-input-link',
|
|
18
|
-
templateUrl: './cedar-input-link.component.html',
|
|
19
|
-
styleUrls: ['./cedar-input-link.component.scss'],
|
|
20
|
-
encapsulation: ViewEncapsulation.None
|
|
21
|
-
})
|
|
22
|
-
export class CedarInputLinkComponent extends CedarUIComponent implements OnInit {
|
|
23
|
-
|
|
24
|
-
component: FieldComponent;
|
|
25
|
-
options: FormGroup;
|
|
26
|
-
inputValueControl = new FormControl(null, null);
|
|
27
|
-
errorStateMatcher = new TextFieldErrorStateMatcher();
|
|
28
|
-
@Input() handlerContext: HandlerContext;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
fb: FormBuilder,
|
|
32
|
-
public cds: ComponentDataService,
|
|
33
|
-
private activeComponentRegistry: ActiveComponentRegistryService
|
|
34
|
-
) {
|
|
35
|
-
super();
|
|
36
|
-
this.options = fb.group({
|
|
37
|
-
inputValue: this.inputValueControl,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
ngOnInit(): void {
|
|
42
|
-
const validators: any[] = [];
|
|
43
|
-
|
|
44
|
-
const reg = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
|
|
45
|
-
validators.push(Validators.pattern(reg));
|
|
46
|
-
|
|
47
|
-
if (this.component.valueInfo.requiredValue) {
|
|
48
|
-
validators.push(Validators.required);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
this.inputValueControl = new FormControl(null, validators);
|
|
52
|
-
if (this.component.valueInfo.defaultValue != null) {
|
|
53
|
-
this.setValueUIAndModel(this.component.valueInfo.defaultValue);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
58
|
-
this.component = componentToRender;
|
|
59
|
-
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
inputChanged($event: Event): void {
|
|
63
|
-
let val = ($event.target as HTMLTextAreaElement).value;
|
|
64
|
-
|
|
65
|
-
if (val.length === 0) {
|
|
66
|
-
val = null;
|
|
67
|
-
}
|
|
68
|
-
this.handlerContext.changeValue(this.component, val);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
setCurrentValue(currentValue: any): void {
|
|
72
|
-
this.inputValueControl.setValue(currentValue);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
clearValue(): void {
|
|
76
|
-
this.setValueUIAndModel(null);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private setValueUIAndModel(value: string): void {
|
|
80
|
-
this.inputValueControl.setValue(value);
|
|
81
|
-
this.handlerContext.changeValue(this.component, value);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
getCharCountHint(): string {
|
|
85
|
-
let len = 0;
|
|
86
|
-
if (this.inputValueControl.value != null) {
|
|
87
|
-
len = this.inputValueControl.value.length;
|
|
88
|
-
}
|
|
89
|
-
const s = '' + len;
|
|
90
|
-
return s;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<form class="form-container" [formGroup]="options">
|
|
2
|
-
<mat-form-field class="full-width">
|
|
3
|
-
<input matInput [formControl]="selectedChoiceInputControl" style="display:none">
|
|
4
|
-
<mat-radio-group [formControl]="selectedChoiceInputControl">
|
|
5
|
-
<div *ngFor="let choice of component.choiceInfo.choices" class="col-md-2">
|
|
6
|
-
<mat-radio-button
|
|
7
|
-
[checked]="choice.selectedByDefault"
|
|
8
|
-
[value]="choice.label"
|
|
9
|
-
(change)="inputChanged($event)"
|
|
10
|
-
>{{choice.label}}</mat-radio-button>
|
|
11
|
-
</div>
|
|
12
|
-
<button type="button" tabindex="0" mat-button *ngIf="selectedChoiceInputControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearValue()">
|
|
13
|
-
<mat-icon>close</mat-icon>
|
|
14
|
-
</button>
|
|
15
|
-
</mat-radio-group>
|
|
16
|
-
<mat-error align="start" *ngIf="selectedChoiceInputControl.getError('required')" class="mat-error">{{'Validation.Required' | translate}}</mat-error>
|
|
17
|
-
</mat-form-field>
|
|
18
|
-
</form>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import {CedarInputMultipleChoiceComponent} from './cedar-input-multiple-choice.component';
|
|
4
|
-
|
|
5
|
-
describe('CedarInputMultipleChoiceComponent', () => {
|
|
6
|
-
let component: CedarInputMultipleChoiceComponent;
|
|
7
|
-
let fixture: ComponentFixture<CedarInputMultipleChoiceComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [CedarInputMultipleChoiceComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CedarInputMultipleChoiceComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
-
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
3
|
-
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
|
|
4
|
-
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
5
|
-
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
6
|
-
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
7
|
-
import {ErrorStateMatcher} from '@angular/material/core';
|
|
8
|
-
import {TextFieldErrorStateMatcher} from '../cedar-input-text/cedar-input-text.component';
|
|
9
|
-
|
|
10
|
-
export class MultipleChoiceErrorStateMatcher implements ErrorStateMatcher {
|
|
11
|
-
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
12
|
-
return !!(control && control.invalid && (control.dirty || control.touched));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
@Component({
|
|
16
|
-
selector: 'app-cedar-input-multiple-choice',
|
|
17
|
-
templateUrl: './cedar-input-multiple-choice.component.html',
|
|
18
|
-
styleUrls: ['./cedar-input-multiple-choice.component.scss'],
|
|
19
|
-
encapsulation: ViewEncapsulation.None
|
|
20
|
-
})
|
|
21
|
-
export class CedarInputMultipleChoiceComponent extends CedarUIComponent implements OnInit {
|
|
22
|
-
component: FieldComponent;
|
|
23
|
-
options: FormGroup;
|
|
24
|
-
selectedChoiceInputControl = new FormControl(null, null);
|
|
25
|
-
errorStateMatcher = new MultipleChoiceErrorStateMatcher();
|
|
26
|
-
@Input() handlerContext: HandlerContext;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
fb: FormBuilder,
|
|
30
|
-
private activeComponentRegistry: ActiveComponentRegistryService
|
|
31
|
-
) {
|
|
32
|
-
super();
|
|
33
|
-
this.options = fb.group({
|
|
34
|
-
selectedChoiceValue: this.selectedChoiceInputControl
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ngOnInit(): void {
|
|
39
|
-
this.populateItemsOnLoad();
|
|
40
|
-
const validators: any[] = [];
|
|
41
|
-
if (this.component.valueInfo.requiredValue) {
|
|
42
|
-
validators.push(Validators.required);
|
|
43
|
-
}
|
|
44
|
-
this.selectedChoiceInputControl = new FormControl(null, validators);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
48
|
-
this.component = componentToRender;
|
|
49
|
-
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
inputChanged(event): void {
|
|
53
|
-
this.handlerContext.changeValue(this.component, event.value);
|
|
54
|
-
}
|
|
55
|
-
clearValue(): void {
|
|
56
|
-
this.setValueUIAndModel(null);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private setValueUIAndModel(value: string): void {
|
|
60
|
-
this.selectedChoiceInputControl.setValue(value);
|
|
61
|
-
this.handlerContext.changeValue(this.component, value);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
setCurrentValue(currentValue: any): void {
|
|
65
|
-
this.selectedChoiceInputControl.setValue(currentValue);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private populateItemsOnLoad(): void {
|
|
69
|
-
for (const choice of this.component.choiceInfo.choices) {
|
|
70
|
-
if (choice.selectedByDefault) {
|
|
71
|
-
this.handlerContext.changeValue(this.component, choice.label);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
this.handlerContext.changeValue(this.component, null);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<form class="form-container" [formGroup]="options">
|
|
2
|
-
<mat-form-field class="full-width">
|
|
3
|
-
<!-- <mat-label>{{cds.getRenderingLabelForComponent(component)}}</mat-label>-->
|
|
4
|
-
<input matInput type="number" placeholder="{{'Generic.NumberOnly' | translate}}"
|
|
5
|
-
[formControl]="inputValueControl"
|
|
6
|
-
(input)="inputChanged($event)"
|
|
7
|
-
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}">
|
|
8
|
-
<span matSuffix>{{unitOfMeasure}}</span>
|
|
9
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('min')" class="mat-error">{{'Validation.Numeric.MinValue' | translate: {constraintMinValue} }}</mat-error>
|
|
10
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('max')" class="mat-error">{{'Validation.Numeric.MaxValue' | translate: {constraintMaxValue} }}</mat-error>
|
|
11
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('pattern')" class="mat-error">{{patternErrorMessage}}.</mat-error>
|
|
12
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('required')" class="mat-error">{{'Validation.Required' | translate}}</mat-error>
|
|
13
|
-
<mat-hint align="end">{{getMinMaxValueHint()}}</mat-hint>
|
|
14
|
-
</mat-form-field>
|
|
15
|
-
</form>
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { CedarInputNumericComponent } from './cedar-input-numeric.component';
|
|
4
|
-
|
|
5
|
-
describe('CedarInputNumericComponent', () => {
|
|
6
|
-
let component: CedarInputNumericComponent;
|
|
7
|
-
let fixture: ComponentFixture<CedarInputNumericComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ CedarInputNumericComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CedarInputNumericComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
-
import {FieldComponent} from '../../../shared/models/component/field-component.model';
|
|
3
|
-
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
|
4
|
-
import {ComponentDataService} from '../../../shared/service/component-data.service';
|
|
5
|
-
import {CedarUIComponent} from '../../../shared/models/ui/cedar-ui-component.model';
|
|
6
|
-
import {ActiveComponentRegistryService} from '../../../shared/service/active-component-registry.service';
|
|
7
|
-
import {HandlerContext} from '../../../shared/util/handler-context';
|
|
8
|
-
import {Numbers} from '../../../shared/models/numbers.model';
|
|
9
|
-
import {Xsd} from '../../../shared/models/xsd.model';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'app-cedar-input-numeric',
|
|
13
|
-
templateUrl: './cedar-input-numeric.component.html',
|
|
14
|
-
styleUrls: ['./cedar-input-numeric.component.scss'],
|
|
15
|
-
encapsulation: ViewEncapsulation.None
|
|
16
|
-
})
|
|
17
|
-
export class CedarInputNumericComponent extends CedarUIComponent implements OnInit {
|
|
18
|
-
|
|
19
|
-
component: FieldComponent;
|
|
20
|
-
options: FormGroup;
|
|
21
|
-
inputValueControl = new FormControl(null, Validators.min(10));
|
|
22
|
-
unitOfMeasure: string = null;
|
|
23
|
-
constraintMinValue = null;
|
|
24
|
-
constraintMaxValue = null;
|
|
25
|
-
patternErrorMessage = null;
|
|
26
|
-
@Input() handlerContext: HandlerContext;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
30
|
-
fb: FormBuilder,
|
|
31
|
-
public cds: ComponentDataService,
|
|
32
|
-
private activeComponentRegistry: ActiveComponentRegistryService
|
|
33
|
-
) {
|
|
34
|
-
super();
|
|
35
|
-
this.options = fb.group({
|
|
36
|
-
inputValue: this.inputValueControl,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
ngOnInit(): void {
|
|
41
|
-
this.unitOfMeasure = this.component.numberInfo.unitOfMeasure;
|
|
42
|
-
|
|
43
|
-
const validators: any[] = [];
|
|
44
|
-
|
|
45
|
-
this.constraintMinValue = this.component.numberInfo.minValue;
|
|
46
|
-
this.constraintMaxValue = this.component.numberInfo.maxValue;
|
|
47
|
-
|
|
48
|
-
if (this.component.valueInfo.requiredValue) {
|
|
49
|
-
validators.push(Validators.required);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const numberType = this.component.numberInfo.numberType;
|
|
53
|
-
const decimalPlace = this.component.numberInfo.decimalPlace;
|
|
54
|
-
let maxDecimalError = '';
|
|
55
|
-
|
|
56
|
-
if (numberType === Xsd.int) {
|
|
57
|
-
validators.push(Validators.pattern(Numbers.PATTERN_XSD_INT_AND_LONG));
|
|
58
|
-
this.patternErrorMessage = ' The value should be an integer.';
|
|
59
|
-
|
|
60
|
-
if (this.constraintMinValue == null) {
|
|
61
|
-
this.constraintMinValue = Numbers.NUMBER_INT_MIN;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (this.constraintMaxValue == null) {
|
|
65
|
-
this.constraintMaxValue = Numbers.NUMBER_INT_MAX;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (numberType === Xsd.long) {
|
|
70
|
-
validators.push(Validators.pattern(Numbers.PATTERN_XSD_INT_AND_LONG));
|
|
71
|
-
this.patternErrorMessage = ' The value should be a long integer.';
|
|
72
|
-
|
|
73
|
-
if (this.constraintMinValue == null) {
|
|
74
|
-
this.constraintMinValue = Numbers.NUMBER_LONG_MIN;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (this.constraintMaxValue == null) {
|
|
78
|
-
this.constraintMaxValue = Numbers.NUMBER_LONG_MAX;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (numberType === Xsd.float || numberType === Xsd.double) {
|
|
83
|
-
let pattern: string = Numbers.PATTERN_XSD_FLOAT_AND_DOUBLE;
|
|
84
|
-
let maxDig = '';
|
|
85
|
-
|
|
86
|
-
if (decimalPlace != null) {
|
|
87
|
-
maxDig = '' + decimalPlace;
|
|
88
|
-
maxDecimalError = ' maximum ' + decimalPlace + ' decimals.';
|
|
89
|
-
}
|
|
90
|
-
pattern = pattern.replace(new RegExp('maxDig', 'g'), maxDig);
|
|
91
|
-
validators.push(Validators.pattern(pattern));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (numberType === Xsd.float) {
|
|
95
|
-
this.patternErrorMessage = ' The value should be a float,' + maxDecimalError;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (numberType === Xsd.double) {
|
|
99
|
-
this.patternErrorMessage = ' The value should be a double,' + maxDecimalError;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (this.constraintMinValue != null) {
|
|
103
|
-
validators.push(Validators.min(this.constraintMinValue));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (this.constraintMaxValue != null) {
|
|
107
|
-
validators.push(Validators.max(this.constraintMaxValue));
|
|
108
|
-
}
|
|
109
|
-
this.inputValueControl = new FormControl(null, validators);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@Input() set componentToRender(componentToRender: FieldComponent) {
|
|
113
|
-
this.component = componentToRender;
|
|
114
|
-
this.activeComponentRegistry.registerComponent(this.component, this);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
inputChanged($event: Event): void {
|
|
118
|
-
let val = ($event.target as HTMLTextAreaElement).value;
|
|
119
|
-
|
|
120
|
-
if (val.length === 0) {
|
|
121
|
-
val = null;
|
|
122
|
-
}
|
|
123
|
-
this.handlerContext.changeValue(this.component, val);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
setCurrentValue(currentValue: any): void {
|
|
127
|
-
this.inputValueControl.setValue(currentValue);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
clearValue(): void {
|
|
131
|
-
this.setValueUIAndModel(null);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
private setValueUIAndModel(value: string): void {
|
|
135
|
-
this.inputValueControl.setValue(value);
|
|
136
|
-
this.handlerContext.changeValue(this.component, value);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
getMinMaxValueHint(): string {
|
|
140
|
-
let s = '';
|
|
141
|
-
let min = null;
|
|
142
|
-
let max = null;
|
|
143
|
-
|
|
144
|
-
if (this.component.numberInfo.minValue != null) {
|
|
145
|
-
min = this.component.numberInfo.minValue;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (this.component.numberInfo.maxValue != null) {
|
|
149
|
-
max = this.component.numberInfo.maxValue;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (min != null || max != null) {
|
|
153
|
-
if (min != null) {
|
|
154
|
-
s += 'min: ' + min + '; ';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (max != null) {
|
|
158
|
-
s += 'max: ' + max + ';';
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const decimalPlace = this.component.numberInfo.decimalPlace;
|
|
162
|
-
|
|
163
|
-
if (decimalPlace != null) {
|
|
164
|
-
s += ' max ' + decimalPlace + ' decimals;';
|
|
165
|
-
}
|
|
166
|
-
return s;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
}
|
package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<form class="form-container" [formGroup]="options">
|
|
2
|
-
<mat-form-field class="full-width">
|
|
3
|
-
<!-- <mat-label>{{cds.getRenderingLabelForComponent(component)}}</mat-label>-->
|
|
4
|
-
<input matInput type="text"
|
|
5
|
-
[formControl]="inputValueControl"
|
|
6
|
-
[errorStateMatcher]="errorStateMatcher"
|
|
7
|
-
(input)="inputChanged($event)"
|
|
8
|
-
attr.aria-label="{{cds.getRenderingLabelForComponent(component)}}">
|
|
9
|
-
<button type="button" mat-button *ngIf="inputValueControl.value" matSuffix mat-icon-button attr.aria-label="{{'Generic.Clear' | translate}}" (click)="clearValue()">
|
|
10
|
-
<mat-icon>close</mat-icon>
|
|
11
|
-
</button>
|
|
12
|
-
<mat-error align="start" *ngIf="inputValueControl.getError('required')" class="mat-error">{{'Validation.Required' | translate}}</mat-error>
|
|
13
|
-
</mat-form-field>
|
|
14
|
-
</form>
|
|
15
|
-
|
package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.scss
DELETED
|
File without changes
|
package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.spec.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import {CedarInputPhoneComponent} from './cedar-input-phone.component';
|
|
4
|
-
|
|
5
|
-
describe('CedarInputPhoneComponent', () => {
|
|
6
|
-
let component: CedarInputPhoneComponent;
|
|
7
|
-
let fixture: ComponentFixture<CedarInputPhoneComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [CedarInputPhoneComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CedarInputPhoneComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|