@valtimo/components 4.21.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/alert/alert.component.mjs +138 -0
- package/esm2020/lib/components/alert/alert.module.mjs +33 -0
- package/esm2020/lib/components/alert/alert.service.mjs +80 -0
- package/esm2020/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.mjs +168 -0
- package/esm2020/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.mjs +33 -0
- package/esm2020/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.mjs +92 -0
- package/esm2020/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.mjs +35 -0
- package/esm2020/lib/components/camunda/form/camunda-form.components.mjs +41 -0
- package/esm2020/lib/components/camunda/form/camunda-form.module.mjs +35 -0
- package/esm2020/lib/components/camunda/form/custom/camunda-custom-form.component.mjs +40 -0
- package/esm2020/lib/components/camunda/form/custom/camunda-custom-form.module.mjs +33 -0
- package/esm2020/lib/components/camunda/form/generated/camunda-generated-form.component.mjs +67 -0
- package/esm2020/lib/components/camunda/form/generated/camunda-generated-form.module.mjs +63 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.mjs +30 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.mjs +63 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/camunda-formfield.service.mjs +67 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.mjs +41 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.mjs +66 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.mjs +33 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/formfield.model.mjs +17 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.mjs +30 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.mjs +30 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.mjs +30 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.mjs +35 -0
- package/esm2020/lib/components/camunda/form/generated/formfield/validation/date.validators.mjs +59 -0
- package/esm2020/lib/components/card/card.component.mjs +36 -0
- package/esm2020/lib/components/card/card.module.mjs +33 -0
- package/esm2020/lib/components/components.module.mjs +26 -0
- package/esm2020/lib/components/data-list/data-list.component.mjs +33 -0
- package/esm2020/lib/components/data-list/data-list.module.mjs +33 -0
- package/esm2020/lib/components/dropzone/dropzone.component.mjs +156 -0
- package/esm2020/lib/components/dropzone/dropzone.module.mjs +37 -0
- package/esm2020/lib/components/field-auto-focus/field-auto-focus.directive.mjs +36 -0
- package/esm2020/lib/components/field-auto-focus/field-auto-focus.module.mjs +33 -0
- package/esm2020/lib/components/file-size/file-size.module.mjs +33 -0
- package/esm2020/lib/components/file-size/file-size.pipe.mjs +42 -0
- package/esm2020/lib/components/filter-sidebar/filter-sidebar.component.mjs +46 -0
- package/esm2020/lib/components/filter-sidebar/filter-sidebar.module.mjs +33 -0
- package/esm2020/lib/components/form-io/form-io-builder.component.mjs +39 -0
- package/esm2020/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.mjs +69 -0
- package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.mjs +90 -0
- package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader.component.mjs +78 -0
- package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader.formio.mjs +28 -0
- package/esm2020/lib/components/form-io/form-io.component.mjs +166 -0
- package/esm2020/lib/components/form-io/form-io.module.mjs +70 -0
- package/esm2020/lib/components/form-io/formio-config.mjs +22 -0
- package/esm2020/lib/components/form-io/services/form-io-dom.service.mjs +23 -0
- package/esm2020/lib/components/form-io/services/form-io-state.service.mjs +37 -0
- package/esm2020/lib/components/left-sidebar/left-sidebar.component.mjs +115 -0
- package/esm2020/lib/components/left-sidebar/left-sidebar.module.mjs +35 -0
- package/esm2020/lib/components/list/ListFilterPipe.directive.mjs +35 -0
- package/esm2020/lib/components/list/list.component.mjs +195 -0
- package/esm2020/lib/components/list/list.module.mjs +38 -0
- package/esm2020/lib/components/menu/menu-item-text.component.mjs +78 -0
- package/esm2020/lib/components/menu/menu-routing.module.mjs +33 -0
- package/esm2020/lib/components/menu/menu.component.mjs +66 -0
- package/esm2020/lib/components/menu/menu.init.mjs +32 -0
- package/esm2020/lib/components/menu/menu.module.mjs +39 -0
- package/esm2020/lib/components/menu/menu.service.mjs +122 -0
- package/esm2020/lib/components/menu/submenu-item-text.component.mjs +67 -0
- package/esm2020/lib/components/modal/modal.component.mjs +51 -0
- package/esm2020/lib/components/modal/modal.module.mjs +33 -0
- package/esm2020/lib/components/multiselect-dropdown/multiselect-dropdown.component.mjs +52 -0
- package/esm2020/lib/components/multiselect-dropdown/multiselect-dropdown.module.mjs +35 -0
- package/esm2020/lib/components/page-header/page-header.component.mjs +35 -0
- package/esm2020/lib/components/page-header/page-header.module.mjs +35 -0
- package/esm2020/lib/components/page-title/page-title.component.mjs +75 -0
- package/esm2020/lib/components/page-title/page-title.module.mjs +34 -0
- package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +26 -0
- package/esm2020/lib/components/progress-bar/progress-bar.module.mjs +33 -0
- package/esm2020/lib/components/right-sidebar/right-sidebar.component.mjs +112 -0
- package/esm2020/lib/components/right-sidebar/right-sidebar.module.mjs +69 -0
- package/esm2020/lib/components/searchable-dropdown/searchable-dropdown.component.mjs +201 -0
- package/esm2020/lib/components/searchable-dropdown/searchable-dropdown.module.mjs +34 -0
- package/esm2020/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.mjs +65 -0
- package/esm2020/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.mjs +35 -0
- package/esm2020/lib/components/spinner/spinner.component.mjs +54 -0
- package/esm2020/lib/components/spinner/spinner.module.mjs +35 -0
- package/esm2020/lib/components/timeline/timeline.component.mjs +30 -0
- package/esm2020/lib/components/timeline/timeline.module.mjs +34 -0
- package/esm2020/lib/components/topbar/topbar.component.mjs +28 -0
- package/esm2020/lib/components/topbar/topbar.module.mjs +34 -0
- package/esm2020/lib/components/uploader/uploader-drag-drop.directive.mjs +58 -0
- package/esm2020/lib/components/uploader/uploader.component.mjs +70 -0
- package/esm2020/lib/components/uploader/uploader.module.mjs +35 -0
- package/esm2020/lib/components/version/version.service.mjs +36 -0
- package/esm2020/lib/components/view-content/type-converters/booleanTypeConverter.mjs +29 -0
- package/esm2020/lib/components/view-content/type-converters/dateTypeConverter.mjs +29 -0
- package/esm2020/lib/components/view-content/type-converters/enumTypeConverter.mjs +24 -0
- package/esm2020/lib/components/view-content/type-converters/relatedFilesTypeConverter.mjs +24 -0
- package/esm2020/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.mjs +27 -0
- package/esm2020/lib/components/view-content/type-converters/stringTypeConverter.mjs +24 -0
- package/esm2020/lib/components/view-content/type-converters/type-converters.model.mjs +37 -0
- package/esm2020/lib/components/view-content/view-content.service.mjs +52 -0
- package/esm2020/lib/components/webcam/webcam.component.mjs +102 -0
- package/esm2020/lib/components/webcam/webcam.module.mjs +34 -0
- package/esm2020/lib/components/widget/widget.component.mjs +89 -0
- package/esm2020/lib/components/widget/widget.module.mjs +33 -0
- package/esm2020/lib/models/alert.model.mjs +30 -0
- package/esm2020/lib/models/form-io.model.mjs +30 -0
- package/esm2020/lib/models/index.mjs +24 -0
- package/esm2020/lib/models/pagination.model.mjs +2 -0
- package/esm2020/lib/models/searchable-dropdown.model.mjs +2 -0
- package/esm2020/lib/models/timeline.model.mjs +44 -0
- package/esm2020/lib/models/version.model.mjs +17 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +3 -1
- package/esm2020/valtimo-components.mjs +5 -0
- package/fesm2015/valtimo-components.mjs +4934 -0
- package/fesm2015/valtimo-components.mjs.map +1 -0
- package/fesm2020/valtimo-components.mjs +4956 -0
- package/fesm2020/valtimo-components.mjs.map +1 -0
- package/lib/components/alert/alert.component.d.ts +4 -0
- package/lib/components/alert/alert.component.d.ts.map +1 -0
- package/lib/components/alert/alert.module.d.ts +7 -0
- package/lib/components/alert/alert.module.d.ts.map +1 -0
- package/lib/components/alert/alert.service.d.ts +4 -0
- package/lib/components/alert/alert.service.d.ts.map +1 -0
- package/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.d.ts +4 -0
- package/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.d.ts.map +1 -0
- package/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.d.ts +7 -0
- package/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.d.ts.map +1 -0
- package/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.d.ts +4 -0
- package/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.d.ts.map +1 -0
- package/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.d.ts +9 -0
- package/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.d.ts.map +1 -0
- package/lib/components/camunda/form/camunda-form.components.d.ts +4 -0
- package/lib/components/camunda/form/camunda-form.components.d.ts.map +1 -0
- package/lib/components/camunda/form/camunda-form.module.d.ts +9 -0
- package/lib/components/camunda/form/camunda-form.module.d.ts.map +1 -0
- package/lib/components/camunda/form/custom/camunda-custom-form.component.d.ts +4 -0
- package/lib/components/camunda/form/custom/camunda-custom-form.component.d.ts.map +1 -0
- package/lib/components/camunda/form/custom/camunda-custom-form.module.d.ts +7 -0
- package/lib/components/camunda/form/custom/camunda-custom-form.module.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/camunda-generated-form.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/camunda-generated-form.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/camunda-generated-form.module.d.ts +17 -0
- package/lib/components/camunda/form/generated/camunda-generated-form.module.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/camunda-formfield.service.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/camunda-formfield.service.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/formfield.model.d.ts +1 -0
- package/lib/components/camunda/form/generated/formfield/formfield.model.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.d.ts +4 -0
- package/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.d.ts.map +1 -0
- package/lib/components/camunda/form/generated/formfield/validation/date.validators.d.ts +1 -0
- package/lib/components/camunda/form/generated/formfield/validation/date.validators.d.ts.map +1 -0
- package/lib/components/card/card.component.d.ts +4 -0
- package/lib/components/card/card.component.d.ts.map +1 -0
- package/lib/components/card/card.module.d.ts +7 -0
- package/lib/components/card/card.module.d.ts.map +1 -0
- package/lib/components/components.module.d.ts +5 -0
- package/lib/components/components.module.d.ts.map +1 -0
- package/lib/components/data-list/data-list.component.d.ts +4 -0
- package/lib/components/data-list/data-list.component.d.ts.map +1 -0
- package/lib/components/data-list/data-list.module.d.ts +7 -0
- package/lib/components/data-list/data-list.module.d.ts.map +1 -0
- package/lib/components/dropzone/dropzone.component.d.ts +4 -0
- package/lib/components/dropzone/dropzone.component.d.ts.map +1 -0
- package/lib/components/dropzone/dropzone.module.d.ts +11 -0
- package/lib/components/dropzone/dropzone.module.d.ts.map +1 -0
- package/lib/components/field-auto-focus/field-auto-focus.directive.d.ts +4 -0
- package/lib/components/field-auto-focus/field-auto-focus.directive.d.ts.map +1 -0
- package/lib/components/field-auto-focus/field-auto-focus.module.d.ts +7 -0
- package/lib/components/field-auto-focus/field-auto-focus.module.d.ts.map +1 -0
- package/lib/components/file-size/file-size.module.d.ts +7 -0
- package/lib/components/file-size/file-size.module.d.ts.map +1 -0
- package/lib/components/file-size/file-size.pipe.d.ts +4 -0
- package/lib/components/file-size/file-size.pipe.d.ts.map +1 -0
- package/lib/components/filter-sidebar/filter-sidebar.component.d.ts +4 -0
- package/lib/components/filter-sidebar/filter-sidebar.component.d.ts.map +1 -0
- package/lib/components/filter-sidebar/filter-sidebar.module.d.ts +7 -0
- package/lib/components/filter-sidebar/filter-sidebar.module.d.ts.map +1 -0
- package/lib/components/form-io/form-io-builder.component.d.ts +4 -0
- package/lib/components/form-io/form-io-builder.component.d.ts.map +1 -0
- package/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.d.ts +1 -0
- package/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.d.ts.map +1 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts +1 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts.map +1 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader.component.d.ts +4 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader.component.d.ts.map +1 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader.formio.d.ts +1 -0
- package/lib/components/form-io/form-io-uploader/form-io-uploader.formio.d.ts.map +1 -0
- package/lib/components/form-io/form-io.component.d.ts +5 -1
- package/lib/components/form-io/form-io.component.d.ts.map +1 -0
- package/lib/components/form-io/form-io.module.d.ts +16 -0
- package/lib/components/form-io/form-io.module.d.ts.map +1 -0
- package/lib/components/form-io/formio-config.d.ts +1 -0
- package/lib/components/form-io/formio-config.d.ts.map +1 -0
- package/lib/components/form-io/services/form-io-dom.service.d.ts +4 -0
- package/lib/components/form-io/services/form-io-dom.service.d.ts.map +1 -0
- package/lib/components/form-io/services/form-io-state.service.d.ts +4 -0
- package/lib/components/form-io/services/form-io-state.service.d.ts.map +1 -0
- package/lib/components/left-sidebar/left-sidebar.component.d.ts +4 -0
- package/lib/components/left-sidebar/left-sidebar.component.d.ts.map +1 -0
- package/lib/components/left-sidebar/left-sidebar.module.d.ts +9 -0
- package/lib/components/left-sidebar/left-sidebar.module.d.ts.map +1 -0
- package/lib/components/list/ListFilterPipe.directive.d.ts +4 -0
- package/lib/components/list/ListFilterPipe.directive.d.ts.map +1 -0
- package/lib/components/list/list.component.d.ts +4 -0
- package/lib/components/list/list.component.d.ts.map +1 -0
- package/lib/components/list/list.module.d.ts +12 -0
- package/lib/components/list/list.module.d.ts.map +1 -0
- package/lib/components/menu/menu-item-text.component.d.ts +4 -0
- package/lib/components/menu/menu-item-text.component.d.ts.map +1 -0
- package/lib/components/menu/menu-routing.module.d.ts +6 -0
- package/lib/components/menu/menu-routing.module.d.ts.map +1 -0
- package/lib/components/menu/menu.component.d.ts +4 -0
- package/lib/components/menu/menu.component.d.ts.map +1 -0
- package/lib/components/menu/menu.init.d.ts +1 -0
- package/lib/components/menu/menu.init.d.ts.map +1 -0
- package/lib/components/menu/menu.module.d.ts +12 -0
- package/lib/components/menu/menu.module.d.ts.map +1 -0
- package/lib/components/menu/menu.service.d.ts +4 -0
- package/lib/components/menu/menu.service.d.ts.map +1 -0
- package/lib/components/menu/submenu-item-text.component.d.ts +4 -0
- package/lib/components/menu/submenu-item-text.component.d.ts.map +1 -0
- package/lib/components/modal/modal.component.d.ts +4 -0
- package/lib/components/modal/modal.component.d.ts.map +1 -0
- package/lib/components/modal/modal.module.d.ts +7 -0
- package/lib/components/modal/modal.module.d.ts.map +1 -0
- package/lib/components/multiselect-dropdown/multiselect-dropdown.component.d.ts +6 -2
- package/lib/components/multiselect-dropdown/multiselect-dropdown.component.d.ts.map +1 -0
- package/lib/components/multiselect-dropdown/multiselect-dropdown.module.d.ts +9 -0
- package/lib/components/multiselect-dropdown/multiselect-dropdown.module.d.ts.map +1 -0
- package/lib/components/page-header/page-header.component.d.ts +8 -1
- package/lib/components/page-header/page-header.component.d.ts.map +1 -0
- package/lib/components/page-header/page-header.module.d.ts +9 -0
- package/lib/components/page-header/page-header.module.d.ts.map +1 -0
- package/lib/components/page-title/page-title.component.d.ts +8 -3
- package/lib/components/page-title/page-title.component.d.ts.map +1 -0
- package/lib/components/page-title/page-title.module.d.ts +8 -0
- package/lib/components/page-title/page-title.module.d.ts.map +1 -0
- package/lib/components/progress-bar/progress-bar.component.d.ts +4 -0
- package/lib/components/progress-bar/progress-bar.component.d.ts.map +1 -0
- package/lib/components/progress-bar/progress-bar.module.d.ts +7 -0
- package/lib/components/progress-bar/progress-bar.module.d.ts.map +1 -0
- package/lib/components/right-sidebar/right-sidebar.component.d.ts +4 -0
- package/lib/components/right-sidebar/right-sidebar.component.d.ts.map +1 -0
- package/lib/components/right-sidebar/right-sidebar.module.d.ts +11 -0
- package/lib/components/right-sidebar/right-sidebar.module.d.ts.map +1 -0
- package/lib/components/searchable-dropdown/searchable-dropdown.component.d.ts +4 -0
- package/lib/components/searchable-dropdown/searchable-dropdown.component.d.ts.map +1 -0
- package/lib/components/searchable-dropdown/searchable-dropdown.module.d.ts +8 -0
- package/lib/components/searchable-dropdown/searchable-dropdown.module.d.ts.map +1 -0
- package/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.d.ts +4 -0
- package/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.d.ts.map +1 -0
- package/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.d.ts +9 -0
- package/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.d.ts.map +1 -0
- package/lib/components/spinner/spinner.component.d.ts +4 -0
- package/lib/components/spinner/spinner.component.d.ts.map +1 -0
- package/lib/components/spinner/spinner.module.d.ts +9 -0
- package/lib/components/spinner/spinner.module.d.ts.map +1 -0
- package/lib/components/timeline/timeline.component.d.ts +4 -0
- package/lib/components/timeline/timeline.component.d.ts.map +1 -0
- package/lib/components/timeline/timeline.module.d.ts +8 -0
- package/lib/components/timeline/timeline.module.d.ts.map +1 -0
- package/lib/components/topbar/topbar.component.d.ts +4 -0
- package/lib/components/topbar/topbar.component.d.ts.map +1 -0
- package/lib/components/topbar/topbar.module.d.ts +8 -0
- package/lib/components/topbar/topbar.module.d.ts.map +1 -0
- package/lib/components/uploader/uploader-drag-drop.directive.d.ts +4 -0
- package/lib/components/uploader/uploader-drag-drop.directive.d.ts.map +1 -0
- package/lib/components/uploader/uploader.component.d.ts +4 -0
- package/lib/components/uploader/uploader.component.d.ts.map +1 -0
- package/lib/components/uploader/uploader.module.d.ts +9 -0
- package/lib/components/uploader/uploader.module.d.ts.map +1 -0
- package/lib/components/version/version.service.d.ts +4 -0
- package/lib/components/version/version.service.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/booleanTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/booleanTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/dateTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/dateTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/enumTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/enumTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/relatedFilesTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/relatedFilesTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/stringTypeConverter.d.ts +1 -0
- package/lib/components/view-content/type-converters/stringTypeConverter.d.ts.map +1 -0
- package/lib/components/view-content/type-converters/type-converters.model.d.ts +1 -0
- package/lib/components/view-content/type-converters/type-converters.model.d.ts.map +1 -0
- package/lib/components/view-content/view-content.service.d.ts +4 -0
- package/lib/components/view-content/view-content.service.d.ts.map +1 -0
- package/lib/components/webcam/webcam.component.d.ts +4 -0
- package/lib/components/webcam/webcam.component.d.ts.map +1 -0
- package/lib/components/webcam/webcam.module.d.ts +8 -0
- package/lib/components/webcam/webcam.module.d.ts.map +1 -0
- package/lib/components/widget/widget.component.d.ts +4 -0
- package/lib/components/widget/widget.component.d.ts.map +1 -0
- package/lib/components/widget/widget.module.d.ts +7 -0
- package/lib/components/widget/widget.module.d.ts.map +1 -0
- package/lib/models/alert.model.d.ts +1 -0
- package/lib/models/alert.model.d.ts.map +1 -0
- package/lib/models/form-io.model.d.ts +1 -0
- package/lib/models/form-io.model.d.ts.map +1 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/pagination.model.d.ts +1 -0
- package/lib/models/pagination.model.d.ts.map +1 -0
- package/lib/models/searchable-dropdown.model.d.ts +1 -0
- package/lib/models/searchable-dropdown.model.d.ts.map +1 -0
- package/lib/models/timeline.model.d.ts +1 -0
- package/lib/models/timeline.model.d.ts.map +1 -0
- package/lib/models/version.model.d.ts +1 -0
- package/lib/models/version.model.d.ts.map +1 -0
- package/package.json +25 -13
- package/public_api.d.ts +3 -0
- package/public_api.d.ts.map +1 -0
- package/valtimo-components.d.ts +2 -21
- package/valtimo-components.d.ts.map +1 -0
- package/bundles/valtimo-components.umd.js +0 -5368
- package/bundles/valtimo-components.umd.js.map +0 -1
- package/bundles/valtimo-components.umd.min.js +0 -17
- package/bundles/valtimo-components.umd.min.js.map +0 -1
- package/esm2015/lib/components/alert/alert.component.js +0 -140
- package/esm2015/lib/components/alert/alert.module.js +0 -28
- package/esm2015/lib/components/alert/alert.service.js +0 -81
- package/esm2015/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.js +0 -160
- package/esm2015/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.js +0 -28
- package/esm2015/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.js +0 -93
- package/esm2015/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.js +0 -30
- package/esm2015/lib/components/camunda/form/camunda-form.components.js +0 -37
- package/esm2015/lib/components/camunda/form/camunda-form.module.js +0 -30
- package/esm2015/lib/components/camunda/form/custom/camunda-custom-form.component.js +0 -42
- package/esm2015/lib/components/camunda/form/custom/camunda-custom-form.module.js +0 -28
- package/esm2015/lib/components/camunda/form/generated/camunda-generated-form.component.js +0 -69
- package/esm2015/lib/components/camunda/form/generated/camunda-generated-form.module.js +0 -58
- package/esm2015/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.js +0 -27
- package/esm2015/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.js +0 -64
- package/esm2015/lib/components/camunda/form/generated/formfield/camunda-formfield.service.js +0 -66
- package/esm2015/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.js +0 -40
- package/esm2015/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.js +0 -66
- package/esm2015/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.js +0 -30
- package/esm2015/lib/components/camunda/form/generated/formfield/formfield.model.js +0 -16
- package/esm2015/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.js +0 -27
- package/esm2015/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.js +0 -27
- package/esm2015/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.js +0 -27
- package/esm2015/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.js +0 -35
- package/esm2015/lib/components/camunda/form/generated/formfield/validation/date.validators.js +0 -60
- package/esm2015/lib/components/card/card.component.js +0 -36
- package/esm2015/lib/components/card/card.module.js +0 -28
- package/esm2015/lib/components/components.module.js +0 -22
- package/esm2015/lib/components/data-list/data-list.component.js +0 -33
- package/esm2015/lib/components/data-list/data-list.module.js +0 -28
- package/esm2015/lib/components/dropzone/dropzone.component.js +0 -142
- package/esm2015/lib/components/dropzone/dropzone.module.js +0 -32
- package/esm2015/lib/components/field-auto-focus/field-auto-focus.directive.js +0 -35
- package/esm2015/lib/components/field-auto-focus/field-auto-focus.module.js +0 -28
- package/esm2015/lib/components/file-size/file-size.module.js +0 -28
- package/esm2015/lib/components/file-size/file-size.pipe.js +0 -38
- package/esm2015/lib/components/filter-sidebar/filter-sidebar.component.js +0 -46
- package/esm2015/lib/components/filter-sidebar/filter-sidebar.module.js +0 -28
- package/esm2015/lib/components/form-io/form-io-builder.component.js +0 -38
- package/esm2015/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.js +0 -63
- package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.js +0 -90
- package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader.component.js +0 -74
- package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader.formio.js +0 -26
- package/esm2015/lib/components/form-io/form-io.component.js +0 -167
- package/esm2015/lib/components/form-io/form-io.module.js +0 -51
- package/esm2015/lib/components/form-io/formio-config.js +0 -22
- package/esm2015/lib/components/form-io/services/form-io-dom.service.js +0 -23
- package/esm2015/lib/components/form-io/services/form-io-state.service.js +0 -35
- package/esm2015/lib/components/left-sidebar/left-sidebar.component.js +0 -114
- package/esm2015/lib/components/left-sidebar/left-sidebar.module.js +0 -30
- package/esm2015/lib/components/list/ListFilterPipe.directive.js +0 -31
- package/esm2015/lib/components/list/list.component.js +0 -180
- package/esm2015/lib/components/list/list.module.js +0 -33
- package/esm2015/lib/components/menu/menu-item-text.component.js +0 -38
- package/esm2015/lib/components/menu/menu-routing.module.js +0 -27
- package/esm2015/lib/components/menu/menu.component.js +0 -67
- package/esm2015/lib/components/menu/menu.init.js +0 -34
- package/esm2015/lib/components/menu/menu.module.js +0 -34
- package/esm2015/lib/components/menu/menu.service.js +0 -134
- package/esm2015/lib/components/menu/submenu-item-text.component.js +0 -33
- package/esm2015/lib/components/modal/modal.component.js +0 -48
- package/esm2015/lib/components/modal/modal.module.js +0 -28
- package/esm2015/lib/components/multiselect-dropdown/multiselect-dropdown.component.js +0 -47
- package/esm2015/lib/components/multiselect-dropdown/multiselect-dropdown.module.js +0 -30
- package/esm2015/lib/components/page-header/page-header.component.js +0 -29
- package/esm2015/lib/components/page-header/page-header.module.js +0 -30
- package/esm2015/lib/components/page-title/page-title.component.js +0 -76
- package/esm2015/lib/components/page-title/page-title.module.js +0 -29
- package/esm2015/lib/components/progress-bar/progress-bar.component.js +0 -26
- package/esm2015/lib/components/progress-bar/progress-bar.module.js +0 -28
- package/esm2015/lib/components/right-sidebar/right-sidebar.component.js +0 -133
- package/esm2015/lib/components/right-sidebar/right-sidebar.module.js +0 -49
- package/esm2015/lib/components/searchable-dropdown/searchable-dropdown.component.js +0 -187
- package/esm2015/lib/components/searchable-dropdown/searchable-dropdown.module.js +0 -29
- package/esm2015/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.js +0 -52
- package/esm2015/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.js +0 -30
- package/esm2015/lib/components/spinner/spinner.component.js +0 -45
- package/esm2015/lib/components/spinner/spinner.module.js +0 -30
- package/esm2015/lib/components/timeline/timeline.component.js +0 -29
- package/esm2015/lib/components/timeline/timeline.module.js +0 -29
- package/esm2015/lib/components/topbar/topbar.component.js +0 -28
- package/esm2015/lib/components/topbar/topbar.module.js +0 -29
- package/esm2015/lib/components/uploader/uploader-drag-drop.directive.js +0 -49
- package/esm2015/lib/components/uploader/uploader.component.js +0 -68
- package/esm2015/lib/components/uploader/uploader.module.js +0 -30
- package/esm2015/lib/components/version/version.service.js +0 -38
- package/esm2015/lib/components/view-content/type-converters/booleanTypeConverter.js +0 -29
- package/esm2015/lib/components/view-content/type-converters/dateTypeConverter.js +0 -30
- package/esm2015/lib/components/view-content/type-converters/enumTypeConverter.js +0 -24
- package/esm2015/lib/components/view-content/type-converters/relatedFilesTypeConverter.js +0 -24
- package/esm2015/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.js +0 -27
- package/esm2015/lib/components/view-content/type-converters/stringTypeConverter.js +0 -24
- package/esm2015/lib/components/view-content/type-converters/type-converters.model.js +0 -37
- package/esm2015/lib/components/view-content/view-content.service.js +0 -51
- package/esm2015/lib/components/webcam/webcam.component.js +0 -102
- package/esm2015/lib/components/webcam/webcam.module.js +0 -29
- package/esm2015/lib/components/widget/widget.component.js +0 -80
- package/esm2015/lib/components/widget/widget.module.js +0 -28
- package/esm2015/lib/models/alert.model.js +0 -30
- package/esm2015/lib/models/form-io.model.js +0 -30
- package/esm2015/lib/models/index.js +0 -24
- package/esm2015/lib/models/pagination.model.js +0 -1
- package/esm2015/lib/models/searchable-dropdown.model.js +0 -1
- package/esm2015/lib/models/timeline.model.js +0 -44
- package/esm2015/lib/models/version.model.js +0 -16
- package/esm2015/valtimo-components.js +0 -26
- package/fesm2015/valtimo-components.js +0 -4735
- package/fesm2015/valtimo-components.js.map +0 -1
- package/valtimo-components.metadata.json +0 -1
|
@@ -1,4735 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, Component, Input, Output, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule, ɵɵdefineInjectable, Injectable, Directive, ɵɵinject, ElementRef, Renderer2, Pipe, HostListener, ViewChildren } from '@angular/core';
|
|
2
|
-
import { CommonModule, Location } from '@angular/common';
|
|
3
|
-
import { Validators, FormControl, FormBuilder, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
4
|
-
import * as momentImported from 'moment';
|
|
5
|
-
import { ChoicefieldService } from '@valtimo/choicefield';
|
|
6
|
-
import { RouterModule, NavigationEnd, Router, ActivatedRoute, PRIMARY_OUTLET, NavigationStart } from '@angular/router';
|
|
7
|
-
import { ConfigService, MenuIncludeService, HttpLoaderFactory } from '@valtimo/config';
|
|
8
|
-
import { NGXLogger } from 'ngx-logger';
|
|
9
|
-
import { BehaviorSubject, Observable, combineLatest, fromEvent, Subscription, Subject, timer, from } from 'rxjs';
|
|
10
|
-
import { DocumentService, DocumentModule } from '@valtimo/document';
|
|
11
|
-
import { UserProviderService } from '@valtimo/security';
|
|
12
|
-
import { NgbTooltipModule, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
|
|
13
|
-
import { TranslateModule, TranslateService, TranslateLoader } from '@ngx-translate/core';
|
|
14
|
-
import { HttpClient } from '@angular/common/http';
|
|
15
|
-
import { ContextService } from '@valtimo/context';
|
|
16
|
-
import { map, debounceTime, take, filter, switchMap } from 'rxjs/operators';
|
|
17
|
-
import { Title } from '@angular/platform-browser';
|
|
18
|
-
import * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
|
|
19
|
-
import { create } from 'heatmap.js-fixed/build/heatmap.js';
|
|
20
|
-
import { S3Resource, S3Service, UploadProviderService, DownloadService, ResourceModule } from '@valtimo/resource';
|
|
21
|
-
import { Formio, FormioModule, FormioAppConfig, createCustomFormioComponent, registerCustomFormioComponentWithClass, Components } from 'angular-formio';
|
|
22
|
-
import jwt_decode from 'jwt-decode';
|
|
23
|
-
import * as Dropzone from 'dropzone';
|
|
24
|
-
import { NgxSpinnerModule } from 'ngx-spinner';
|
|
25
|
-
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
|
|
26
|
-
|
|
27
|
-
/*
|
|
28
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
29
|
-
*
|
|
30
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
31
|
-
* you may not use this file except in compliance with the License.
|
|
32
|
-
* You may obtain a copy of the License at
|
|
33
|
-
*
|
|
34
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
35
|
-
*
|
|
36
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
37
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
38
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
39
|
-
* See the License for the specific language governing permissions and
|
|
40
|
-
* limitations under the License.
|
|
41
|
-
*/
|
|
42
|
-
class Alert {
|
|
43
|
-
constructor(init) {
|
|
44
|
-
Object.assign(this, init);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
var AlertType;
|
|
48
|
-
(function (AlertType) {
|
|
49
|
-
AlertType[AlertType["Success"] = 0] = "Success";
|
|
50
|
-
AlertType[AlertType["Error"] = 1] = "Error";
|
|
51
|
-
AlertType[AlertType["Info"] = 2] = "Info";
|
|
52
|
-
AlertType[AlertType["Warning"] = 3] = "Warning";
|
|
53
|
-
AlertType[AlertType["Notification"] = 4] = "Notification";
|
|
54
|
-
AlertType[AlertType["ModalNotification"] = 5] = "ModalNotification";
|
|
55
|
-
})(AlertType || (AlertType = {}));
|
|
56
|
-
|
|
57
|
-
/*
|
|
58
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
59
|
-
*
|
|
60
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
61
|
-
* you may not use this file except in compliance with the License.
|
|
62
|
-
* You may obtain a copy of the License at
|
|
63
|
-
*
|
|
64
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
65
|
-
*
|
|
66
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
67
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
68
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
69
|
-
* See the License for the specific language governing permissions and
|
|
70
|
-
* limitations under the License.
|
|
71
|
-
*/
|
|
72
|
-
class AlertsOptionsImpl {
|
|
73
|
-
constructor(submitMessage) {
|
|
74
|
-
this.submitMessage = submitMessage;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
class FormioOptionsImpl {
|
|
78
|
-
constructor() { }
|
|
79
|
-
setAlertMessage(submitMessage) {
|
|
80
|
-
this.alerts = new AlertsOptionsImpl(submitMessage);
|
|
81
|
-
}
|
|
82
|
-
setHooks(beforeSubmit) {
|
|
83
|
-
this.hooks = { beforeSubmit: beforeSubmit };
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/*
|
|
88
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
89
|
-
*
|
|
90
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
91
|
-
* you may not use this file except in compliance with the License.
|
|
92
|
-
* You may obtain a copy of the License at
|
|
93
|
-
*
|
|
94
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
95
|
-
*
|
|
96
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
97
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
98
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
99
|
-
* See the License for the specific language governing permissions and
|
|
100
|
-
* limitations under the License.
|
|
101
|
-
*/
|
|
102
|
-
class TimelineItemImpl {
|
|
103
|
-
constructor(date, time, user, activity, summaryTranslationKey, summaryTranslationParams) {
|
|
104
|
-
this._date = date;
|
|
105
|
-
this._time = time;
|
|
106
|
-
this._user = user;
|
|
107
|
-
this._activity = activity;
|
|
108
|
-
this._summaryTranslationKey = summaryTranslationKey;
|
|
109
|
-
this._summaryTranslationParams = summaryTranslationParams;
|
|
110
|
-
}
|
|
111
|
-
get date() {
|
|
112
|
-
return this._date;
|
|
113
|
-
}
|
|
114
|
-
get time() {
|
|
115
|
-
return this._time;
|
|
116
|
-
}
|
|
117
|
-
get user() {
|
|
118
|
-
return this._user;
|
|
119
|
-
}
|
|
120
|
-
get activity() {
|
|
121
|
-
return this._activity;
|
|
122
|
-
}
|
|
123
|
-
get summaryTranslationKey() {
|
|
124
|
-
return this._summaryTranslationKey;
|
|
125
|
-
}
|
|
126
|
-
get summaryTranslationParams() {
|
|
127
|
-
return this._summaryTranslationParams;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/*
|
|
132
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
133
|
-
*
|
|
134
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
135
|
-
* you may not use this file except in compliance with the License.
|
|
136
|
-
* You may obtain a copy of the License at
|
|
137
|
-
*
|
|
138
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
139
|
-
*
|
|
140
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
141
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
142
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
143
|
-
* See the License for the specific language governing permissions and
|
|
144
|
-
* limitations under the License.
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
/*
|
|
148
|
-
*
|
|
149
|
-
* * Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
150
|
-
* *
|
|
151
|
-
* * Licensed under EUPL, Version 1.2 (the "License");
|
|
152
|
-
* * you may not use this file except in compliance with the License.
|
|
153
|
-
* * You may obtain a copy of the License at
|
|
154
|
-
* *
|
|
155
|
-
* * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
156
|
-
* *
|
|
157
|
-
* * Unless required by applicable law or agreed to in writing, software
|
|
158
|
-
* * distributed under the License is distributed on an "AS IS" basis,
|
|
159
|
-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
160
|
-
* * See the License for the specific language governing permissions and
|
|
161
|
-
* * limitations under the License.
|
|
162
|
-
*
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
/*
|
|
166
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
167
|
-
*
|
|
168
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
169
|
-
* you may not use this file except in compliance with the License.
|
|
170
|
-
* You may obtain a copy of the License at
|
|
171
|
-
*
|
|
172
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
173
|
-
*
|
|
174
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
175
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
176
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
177
|
-
* See the License for the specific language governing permissions and
|
|
178
|
-
* limitations under the License.
|
|
179
|
-
*/
|
|
180
|
-
class CamundaFormComponent {
|
|
181
|
-
constructor() {
|
|
182
|
-
this.submitted = new EventEmitter();
|
|
183
|
-
}
|
|
184
|
-
onSubmitted(event) {
|
|
185
|
-
this.submitted.emit(event);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
CamundaFormComponent.decorators = [
|
|
189
|
-
{ type: Component, args: [{
|
|
190
|
-
selector: 'valtimo-camunda-form',
|
|
191
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"!componentName && submitted\">\n <valtimo-camunda-generated-form\n *ngIf=\"formFields\"\n [formFields]=\"formFields\"\n (submitted)=\"onSubmitted($event)\"\n >\n </valtimo-camunda-generated-form>\n</ng-container>\n<ng-container *ngIf=\"componentName\">\n <valtimo-custom-form [componentName]=\"componentName\"></valtimo-custom-form>\n</ng-container>\n"
|
|
192
|
-
},] }
|
|
193
|
-
];
|
|
194
|
-
CamundaFormComponent.ctorParameters = () => [];
|
|
195
|
-
CamundaFormComponent.propDecorators = {
|
|
196
|
-
componentName: [{ type: Input }],
|
|
197
|
-
formFields: [{ type: Input }],
|
|
198
|
-
submitted: [{ type: Output }]
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
/*
|
|
202
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
203
|
-
*
|
|
204
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
205
|
-
* you may not use this file except in compliance with the License.
|
|
206
|
-
* You may obtain a copy of the License at
|
|
207
|
-
*
|
|
208
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
209
|
-
*
|
|
210
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
211
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
212
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
213
|
-
* See the License for the specific language governing permissions and
|
|
214
|
-
* limitations under the License.
|
|
215
|
-
*/
|
|
216
|
-
class CamundaCustomFormComponent {
|
|
217
|
-
constructor(resolver) {
|
|
218
|
-
this.resolver = resolver;
|
|
219
|
-
}
|
|
220
|
-
ngOnInit() {
|
|
221
|
-
const factories = Array.from(this.resolver['_factories'].keys());
|
|
222
|
-
const factoryClass = factories.find((x) => x.name === this.componentName);
|
|
223
|
-
const cmpFactory = this.resolver.resolveComponentFactory(factoryClass);
|
|
224
|
-
this.viewContainerRef.createComponent(cmpFactory);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
CamundaCustomFormComponent.decorators = [
|
|
228
|
-
{ type: Component, args: [{
|
|
229
|
-
selector: 'valtimo-custom-form',
|
|
230
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-template #customFormContainer></ng-template>\n",
|
|
231
|
-
styles: [""]
|
|
232
|
-
},] }
|
|
233
|
-
];
|
|
234
|
-
CamundaCustomFormComponent.ctorParameters = () => [
|
|
235
|
-
{ type: ComponentFactoryResolver }
|
|
236
|
-
];
|
|
237
|
-
CamundaCustomFormComponent.propDecorators = {
|
|
238
|
-
componentName: [{ type: Input }],
|
|
239
|
-
viewContainerRef: [{ type: ViewChild, args: ['customFormContainer', { read: ViewContainerRef, static: true },] }]
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
/*
|
|
243
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
244
|
-
*
|
|
245
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
246
|
-
* you may not use this file except in compliance with the License.
|
|
247
|
-
* You may obtain a copy of the License at
|
|
248
|
-
*
|
|
249
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
250
|
-
*
|
|
251
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
252
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
253
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
254
|
-
* See the License for the specific language governing permissions and
|
|
255
|
-
* limitations under the License.
|
|
256
|
-
*/
|
|
257
|
-
class CamundaCustomFormModule {
|
|
258
|
-
}
|
|
259
|
-
CamundaCustomFormModule.decorators = [
|
|
260
|
-
{ type: NgModule, args: [{
|
|
261
|
-
declarations: [CamundaCustomFormComponent],
|
|
262
|
-
imports: [CommonModule],
|
|
263
|
-
exports: [CamundaCustomFormComponent],
|
|
264
|
-
},] }
|
|
265
|
-
];
|
|
266
|
-
|
|
267
|
-
/*
|
|
268
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
269
|
-
*
|
|
270
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
271
|
-
* you may not use this file except in compliance with the License.
|
|
272
|
-
* You may obtain a copy of the License at
|
|
273
|
-
*
|
|
274
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
275
|
-
*
|
|
276
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
277
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
278
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
279
|
-
* See the License for the specific language governing permissions and
|
|
280
|
-
* limitations under the License.
|
|
281
|
-
*/
|
|
282
|
-
const moment = momentImported;
|
|
283
|
-
moment.locale(localStorage.getItem('langKey'));
|
|
284
|
-
const DATE_FORMAT = 'DD-MM-YYYY';
|
|
285
|
-
function minDate(minDateIn) {
|
|
286
|
-
return (control) => {
|
|
287
|
-
if (!control.value) {
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
const controlDate = moment.utc(control.value).startOf('day');
|
|
291
|
-
const momentMinDate = moment.utc(minDateIn, DATE_FORMAT, true);
|
|
292
|
-
if (!controlDate.isSameOrAfter(momentMinDate)) {
|
|
293
|
-
return {
|
|
294
|
-
minDate: {
|
|
295
|
-
minDate: momentMinDate.format(DATE_FORMAT),
|
|
296
|
-
actual: controlDate.format(DATE_FORMAT),
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
function maxDate(maxDateIn) {
|
|
306
|
-
return (control) => {
|
|
307
|
-
if (!control.value) {
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
const controlDate = moment.utc(control.value).startOf('day');
|
|
311
|
-
const momentMaxDate = moment.utc(maxDateIn, DATE_FORMAT, true);
|
|
312
|
-
if (!controlDate.isSameOrBefore(momentMaxDate)) {
|
|
313
|
-
return {
|
|
314
|
-
maxDate: {
|
|
315
|
-
maxDate: momentMaxDate.format(DATE_FORMAT),
|
|
316
|
-
actual: controlDate.format(DATE_FORMAT),
|
|
317
|
-
},
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/*
|
|
327
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
328
|
-
*
|
|
329
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
330
|
-
* you may not use this file except in compliance with the License.
|
|
331
|
-
* You may obtain a copy of the License at
|
|
332
|
-
*
|
|
333
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
334
|
-
*
|
|
335
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
336
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
337
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
338
|
-
* See the License for the specific language governing permissions and
|
|
339
|
-
* limitations under the License.
|
|
340
|
-
*/
|
|
341
|
-
class CamundaFormfieldService {
|
|
342
|
-
constructor() { }
|
|
343
|
-
isFormFieldDisabled(formField) {
|
|
344
|
-
return formField.validationConstraints.filter(vc => vc.name === 'readonly').length > 0;
|
|
345
|
-
}
|
|
346
|
-
getMinDate(formField) {
|
|
347
|
-
return formField.validationConstraints.filter(vc => vc.name === 'minDate' && vc.configuration)[0];
|
|
348
|
-
}
|
|
349
|
-
getMaxDate(formField) {
|
|
350
|
-
return formField.validationConstraints.filter(vc => vc.name === 'maxDate' && vc.configuration)[0];
|
|
351
|
-
}
|
|
352
|
-
getValidatorTypes(formField) {
|
|
353
|
-
const validatorTypes = [];
|
|
354
|
-
formField.validationConstraints.forEach(validationConstraint => {
|
|
355
|
-
if (validationConstraint.name === 'required') {
|
|
356
|
-
validatorTypes.push(Validators.required);
|
|
357
|
-
}
|
|
358
|
-
if (validationConstraint.name === 'minlength') {
|
|
359
|
-
validatorTypes.push(Validators.minLength(+validationConstraint.configuration));
|
|
360
|
-
}
|
|
361
|
-
if (validationConstraint.name === 'maxlength') {
|
|
362
|
-
validatorTypes.push(Validators.maxLength(+validationConstraint.configuration));
|
|
363
|
-
}
|
|
364
|
-
if (validationConstraint.name === 'min') {
|
|
365
|
-
validatorTypes.push(Validators.min(+validationConstraint.configuration));
|
|
366
|
-
}
|
|
367
|
-
if (validationConstraint.name === 'max') {
|
|
368
|
-
validatorTypes.push(Validators.max(+validationConstraint.configuration));
|
|
369
|
-
}
|
|
370
|
-
if (validationConstraint.name === 'minDate') {
|
|
371
|
-
validatorTypes.push(minDate(validationConstraint.configuration));
|
|
372
|
-
}
|
|
373
|
-
if (validationConstraint.name === 'maxDate') {
|
|
374
|
-
validatorTypes.push(maxDate(validationConstraint.configuration));
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
return validatorTypes;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
CamundaFormfieldService.ɵprov = ɵɵdefineInjectable({ factory: function CamundaFormfieldService_Factory() { return new CamundaFormfieldService(); }, token: CamundaFormfieldService, providedIn: "root" });
|
|
381
|
-
CamundaFormfieldService.decorators = [
|
|
382
|
-
{ type: Injectable, args: [{
|
|
383
|
-
providedIn: 'root',
|
|
384
|
-
},] }
|
|
385
|
-
];
|
|
386
|
-
CamundaFormfieldService.ctorParameters = () => [];
|
|
387
|
-
|
|
388
|
-
/*
|
|
389
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
390
|
-
*
|
|
391
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
392
|
-
* you may not use this file except in compliance with the License.
|
|
393
|
-
* You may obtain a copy of the License at
|
|
394
|
-
*
|
|
395
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
396
|
-
*
|
|
397
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
398
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
399
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
400
|
-
* See the License for the specific language governing permissions and
|
|
401
|
-
* limitations under the License.
|
|
402
|
-
*/
|
|
403
|
-
class CamundaGeneratedFormComponent {
|
|
404
|
-
constructor(formBuilder, camundaFormFieldService, location) {
|
|
405
|
-
this.formBuilder = formBuilder;
|
|
406
|
-
this.camundaFormFieldService = camundaFormFieldService;
|
|
407
|
-
this.location = location;
|
|
408
|
-
this.submitted = new EventEmitter();
|
|
409
|
-
this.formFields = [];
|
|
410
|
-
}
|
|
411
|
-
ngOnInit() {
|
|
412
|
-
this.formGroup = this.createFormGroup();
|
|
413
|
-
}
|
|
414
|
-
createFormGroup() {
|
|
415
|
-
const group = this.formBuilder.group({});
|
|
416
|
-
this.formFields.forEach(formField => {
|
|
417
|
-
const control = new FormControl({
|
|
418
|
-
value: formField.defaultValue,
|
|
419
|
-
disabled: this.camundaFormFieldService.isFormFieldDisabled(formField),
|
|
420
|
-
}, this.camundaFormFieldService.getValidatorTypes(formField));
|
|
421
|
-
group.addControl(formField.id, control);
|
|
422
|
-
});
|
|
423
|
-
return group;
|
|
424
|
-
}
|
|
425
|
-
reset() {
|
|
426
|
-
this.formGroup.reset();
|
|
427
|
-
}
|
|
428
|
-
back() {
|
|
429
|
-
this.location.back();
|
|
430
|
-
}
|
|
431
|
-
handleSubmit(event) {
|
|
432
|
-
event.preventDefault();
|
|
433
|
-
event.stopPropagation();
|
|
434
|
-
this.submitted.emit(this.formGroup.value);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
CamundaGeneratedFormComponent.decorators = [
|
|
438
|
-
{ type: Component, args: [{
|
|
439
|
-
selector: 'valtimo-camunda-generated-form',
|
|
440
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form [formGroup]=\"formGroup\" (ngSubmit)=\"handleSubmit($event)\">\n <ng-container\n *ngFor=\"let formField of formFields\"\n valtimoCamundaFormfieldGenerator\n [formGroup]=\"formGroup\"\n [formField]=\"formField\"\n >\n <ng-content></ng-content>\n </ng-container>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n [disabled]=\"!formGroup.disabled && !formGroup.valid\"\n type=\"submit\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</form>\n"
|
|
441
|
-
},] }
|
|
442
|
-
];
|
|
443
|
-
CamundaGeneratedFormComponent.ctorParameters = () => [
|
|
444
|
-
{ type: FormBuilder },
|
|
445
|
-
{ type: CamundaFormfieldService },
|
|
446
|
-
{ type: Location }
|
|
447
|
-
];
|
|
448
|
-
CamundaGeneratedFormComponent.propDecorators = {
|
|
449
|
-
submitted: [{ type: Output }],
|
|
450
|
-
formFields: [{ type: Input }]
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
/*
|
|
454
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
455
|
-
*
|
|
456
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
457
|
-
* you may not use this file except in compliance with the License.
|
|
458
|
-
* You may obtain a copy of the License at
|
|
459
|
-
*
|
|
460
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
461
|
-
*
|
|
462
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
463
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
464
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
465
|
-
* See the License for the specific language governing permissions and
|
|
466
|
-
* limitations under the License.
|
|
467
|
-
*/
|
|
468
|
-
class CamundaStringFormfieldComponent {
|
|
469
|
-
constructor() { }
|
|
470
|
-
}
|
|
471
|
-
CamundaStringFormfieldComponent.decorators = [
|
|
472
|
-
{ type: Component, args: [{
|
|
473
|
-
selector: 'valtimo-camunda-string-formfield',
|
|
474
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n type=\"text\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
475
|
-
},] }
|
|
476
|
-
];
|
|
477
|
-
CamundaStringFormfieldComponent.ctorParameters = () => [];
|
|
478
|
-
|
|
479
|
-
/*
|
|
480
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
481
|
-
*
|
|
482
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
483
|
-
* you may not use this file except in compliance with the License.
|
|
484
|
-
* You may obtain a copy of the License at
|
|
485
|
-
*
|
|
486
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
487
|
-
*
|
|
488
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
489
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
490
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
491
|
-
* See the License for the specific language governing permissions and
|
|
492
|
-
* limitations under the License.
|
|
493
|
-
*/
|
|
494
|
-
class CamundaBooleanFormfieldComponent {
|
|
495
|
-
constructor() { }
|
|
496
|
-
}
|
|
497
|
-
CamundaBooleanFormfieldComponent.decorators = [
|
|
498
|
-
{ type: Component, args: [{
|
|
499
|
-
selector: 'valtimo-camunda-boolean-formfield',
|
|
500
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6 form-check mt-1\">\n <label for=\"yes_{{ formField.id }}\" class=\"custom-control custom-radio custom-control-inline\">\n <input\n class=\"custom-control-input\"\n id=\"yes_{{ formField.id }}\"\n type=\"radio\"\n [value]=\"true\"\n [formControlName]=\"formField.id\"\n />\n <span class=\"custom-control-label custom-control-color\">Yes</span>\n </label>\n <label for=\"no_{{ formField.id }}\" class=\"custom-control custom-radio custom-control-inline\">\n <input\n class=\"custom-control-input\"\n id=\"no_{{ formField.id }}\"\n type=\"radio\"\n [value]=\"false\"\n [formControlName]=\"formField.id\"\n />\n <span class=\"custom-control-label custom-control-color\">No</span>\n </label>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
501
|
-
},] }
|
|
502
|
-
];
|
|
503
|
-
CamundaBooleanFormfieldComponent.ctorParameters = () => [];
|
|
504
|
-
|
|
505
|
-
/*
|
|
506
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
507
|
-
*
|
|
508
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
509
|
-
* you may not use this file except in compliance with the License.
|
|
510
|
-
* You may obtain a copy of the License at
|
|
511
|
-
*
|
|
512
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
513
|
-
*
|
|
514
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
515
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
516
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
517
|
-
* See the License for the specific language governing permissions and
|
|
518
|
-
* limitations under the License.
|
|
519
|
-
*/
|
|
520
|
-
const moment$1 = momentImported;
|
|
521
|
-
moment$1.locale(localStorage.getItem('langKey'));
|
|
522
|
-
class CamundaDateFormfieldComponent {
|
|
523
|
-
constructor(formFieldService) {
|
|
524
|
-
this.formFieldService = formFieldService;
|
|
525
|
-
this.datePickerOptions = {};
|
|
526
|
-
}
|
|
527
|
-
ngOnInit() {
|
|
528
|
-
this.INPUT_SELECTOR = '#' + this.formField.id;
|
|
529
|
-
this.datePickerOptions = {
|
|
530
|
-
autoclose: true,
|
|
531
|
-
componentIcon: '.mdi.mdi-calendar',
|
|
532
|
-
navIcons: {
|
|
533
|
-
rightIcon: 'mdi mdi-chevron-right',
|
|
534
|
-
leftIcon: 'mdi mdi-chevron-left',
|
|
535
|
-
},
|
|
536
|
-
format: 'dd-mm-yyyy',
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
ngAfterViewInit() {
|
|
540
|
-
const formGroup = this.formGroup;
|
|
541
|
-
const formField = this.formField;
|
|
542
|
-
const maxDate = this.formFieldService.getMaxDate(this.formField);
|
|
543
|
-
if (maxDate) {
|
|
544
|
-
this.datePickerOptions.endDate = maxDate.configuration;
|
|
545
|
-
}
|
|
546
|
-
const minDate = this.formFieldService.getMinDate(this.formField);
|
|
547
|
-
if (minDate) {
|
|
548
|
-
this.datePickerOptions.startDate = minDate.configuration;
|
|
549
|
-
}
|
|
550
|
-
$(this.INPUT_SELECTOR).datetimepicker(this.datePickerOptions);
|
|
551
|
-
$(this.INPUT_SELECTOR).on('changeDate', function (e) {
|
|
552
|
-
formGroup.patchValue({
|
|
553
|
-
[formField.id]: moment$1(e.date.valueOf()).format('DD/MM/YYYY'),
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
CamundaDateFormfieldComponent.decorators = [
|
|
559
|
-
{ type: Component, args: [{
|
|
560
|
-
selector: 'valtimo-camunda-date-formfield',
|
|
561
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6 pt1\">\n <input\n type=\"input\"\n class=\"form-control\"\n data-min-view=\"2\"\n id=\"{{ formField.id }}\"\n autocomplete=\"off\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
562
|
-
},] }
|
|
563
|
-
];
|
|
564
|
-
CamundaDateFormfieldComponent.ctorParameters = () => [
|
|
565
|
-
{ type: CamundaFormfieldService }
|
|
566
|
-
];
|
|
567
|
-
|
|
568
|
-
/*
|
|
569
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
570
|
-
*
|
|
571
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
572
|
-
* you may not use this file except in compliance with the License.
|
|
573
|
-
* You may obtain a copy of the License at
|
|
574
|
-
*
|
|
575
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
576
|
-
*
|
|
577
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
578
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
579
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
580
|
-
* See the License for the specific language governing permissions and
|
|
581
|
-
* limitations under the License.
|
|
582
|
-
*/
|
|
583
|
-
class CamundaLongFormfieldComponent {
|
|
584
|
-
constructor() { }
|
|
585
|
-
}
|
|
586
|
-
CamundaLongFormfieldComponent.decorators = [
|
|
587
|
-
{ type: Component, args: [{
|
|
588
|
-
selector: 'valtimo-camunda-long-formfield',
|
|
589
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n type=\"number\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
590
|
-
},] }
|
|
591
|
-
];
|
|
592
|
-
CamundaLongFormfieldComponent.ctorParameters = () => [];
|
|
593
|
-
|
|
594
|
-
/*
|
|
595
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
596
|
-
*
|
|
597
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
598
|
-
* you may not use this file except in compliance with the License.
|
|
599
|
-
* You may obtain a copy of the License at
|
|
600
|
-
*
|
|
601
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
602
|
-
*
|
|
603
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
604
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
605
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
606
|
-
* See the License for the specific language governing permissions and
|
|
607
|
-
* limitations under the License.
|
|
608
|
-
*/
|
|
609
|
-
class CamundaEnumFormfieldComponent {
|
|
610
|
-
constructor() { }
|
|
611
|
-
ngOnInit() {
|
|
612
|
-
this.valueKeys = Object.keys(this.formField.type.values);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
CamundaEnumFormfieldComponent.decorators = [
|
|
616
|
-
{ type: Component, args: [{
|
|
617
|
-
selector: 'valtimo-camunda-enum-formfield',
|
|
618
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select class=\"form-control\" id=\"{{ formField.id }}\" [formControlName]=\"formField.id\">\n <option selected=\"selected\" value=\"\"></option>\n <option *ngFor=\"let key of valueKeys\" [value]=\"key\" id=\"option_{{ key }}\">\n {{ formField.type.values[key] }}\n </option>\n </select>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
619
|
-
},] }
|
|
620
|
-
];
|
|
621
|
-
CamundaEnumFormfieldComponent.ctorParameters = () => [];
|
|
622
|
-
|
|
623
|
-
/*
|
|
624
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
625
|
-
*
|
|
626
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
627
|
-
* you may not use this file except in compliance with the License.
|
|
628
|
-
* You may obtain a copy of the License at
|
|
629
|
-
*
|
|
630
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
631
|
-
*
|
|
632
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
633
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
634
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
635
|
-
* See the License for the specific language governing permissions and
|
|
636
|
-
* limitations under the License.
|
|
637
|
-
*/
|
|
638
|
-
class CamundaTextareaFormfieldComponent {
|
|
639
|
-
constructor() { }
|
|
640
|
-
}
|
|
641
|
-
CamundaTextareaFormfieldComponent.decorators = [
|
|
642
|
-
{ type: Component, args: [{
|
|
643
|
-
selector: 'valtimo-camunda-textarea-formfield',
|
|
644
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n ></textarea>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
645
|
-
},] }
|
|
646
|
-
];
|
|
647
|
-
CamundaTextareaFormfieldComponent.ctorParameters = () => [];
|
|
648
|
-
|
|
649
|
-
/*
|
|
650
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
651
|
-
*
|
|
652
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
653
|
-
* you may not use this file except in compliance with the License.
|
|
654
|
-
* You may obtain a copy of the License at
|
|
655
|
-
*
|
|
656
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
657
|
-
*
|
|
658
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
659
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
660
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
661
|
-
* See the License for the specific language governing permissions and
|
|
662
|
-
* limitations under the License.
|
|
663
|
-
*/
|
|
664
|
-
class CamundaChoicefieldFormfieldComponent {
|
|
665
|
-
constructor(choicefieldService) {
|
|
666
|
-
this.choicefieldService = choicefieldService;
|
|
667
|
-
this.choicefieldValues = [];
|
|
668
|
-
}
|
|
669
|
-
ngOnInit() {
|
|
670
|
-
this.choicefieldService
|
|
671
|
-
.getChoiceFieldValuesByName(this.formField.properties['choicefield'])
|
|
672
|
-
.subscribe(data => {
|
|
673
|
-
this.choicefieldValues = data;
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
CamundaChoicefieldFormfieldComponent.decorators = [
|
|
678
|
-
{ type: Component, args: [{
|
|
679
|
-
selector: 'valtimo-camunda-choicefield-formfield',
|
|
680
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select class=\"form-control\" id=\"{{ formField.id }}\" [formControlName]=\"formField.id\">\n <option selected=\"selected\" value=\"\"></option>\n <ng-container *ngFor=\"let choicefieldValue of choicefieldValues\">\n <option\n *ngIf=\"!choicefieldValue.deprecated\"\n [value]=\"choicefieldValue.value\"\n id=\"option_{{ choicefieldValue.value }}\"\n >\n {{ choicefieldValue.name }}\n </option>\n </ng-container>\n </select>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
|
|
681
|
-
},] }
|
|
682
|
-
];
|
|
683
|
-
CamundaChoicefieldFormfieldComponent.ctorParameters = () => [
|
|
684
|
-
{ type: ChoicefieldService }
|
|
685
|
-
];
|
|
686
|
-
|
|
687
|
-
/*
|
|
688
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
689
|
-
*
|
|
690
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
691
|
-
* you may not use this file except in compliance with the License.
|
|
692
|
-
* You may obtain a copy of the License at
|
|
693
|
-
*
|
|
694
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
695
|
-
*
|
|
696
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
697
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
698
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
699
|
-
* See the License for the specific language governing permissions and
|
|
700
|
-
* limitations under the License.
|
|
701
|
-
*/
|
|
702
|
-
class CamundaFormfieldGeneratorDirective {
|
|
703
|
-
constructor(viewContainerRef, componentFactoryResolver) {
|
|
704
|
-
this.viewContainerRef = viewContainerRef;
|
|
705
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
706
|
-
this.COMPONENTS = {
|
|
707
|
-
string: CamundaStringFormfieldComponent,
|
|
708
|
-
boolean: CamundaBooleanFormfieldComponent,
|
|
709
|
-
date: CamundaDateFormfieldComponent,
|
|
710
|
-
long: CamundaLongFormfieldComponent,
|
|
711
|
-
enum: CamundaEnumFormfieldComponent,
|
|
712
|
-
textarea: CamundaTextareaFormfieldComponent,
|
|
713
|
-
choicefield: CamundaChoicefieldFormfieldComponent,
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
ngOnInit() {
|
|
717
|
-
const typeName = this.formField.typeName.toLowerCase();
|
|
718
|
-
if (!this.COMPONENTS[typeName]) {
|
|
719
|
-
throw new Error('Could not find component for formfield type: ' + typeName);
|
|
720
|
-
}
|
|
721
|
-
const component = this.COMPONENTS[typeName];
|
|
722
|
-
const factory = this.componentFactoryResolver.resolveComponentFactory(component);
|
|
723
|
-
this.component = this.viewContainerRef.createComponent(factory);
|
|
724
|
-
this.component.instance.formGroup = this.formGroup;
|
|
725
|
-
this.component.instance.formField = this.formField;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
CamundaFormfieldGeneratorDirective.decorators = [
|
|
729
|
-
{ type: Directive, args: [{
|
|
730
|
-
selector: '[valtimoCamundaFormfieldGenerator]',
|
|
731
|
-
},] }
|
|
732
|
-
];
|
|
733
|
-
CamundaFormfieldGeneratorDirective.ctorParameters = () => [
|
|
734
|
-
{ type: ViewContainerRef },
|
|
735
|
-
{ type: ComponentFactoryResolver }
|
|
736
|
-
];
|
|
737
|
-
CamundaFormfieldGeneratorDirective.propDecorators = {
|
|
738
|
-
formField: [{ type: Input }],
|
|
739
|
-
formGroup: [{ type: Input }]
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
/*
|
|
743
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
744
|
-
*
|
|
745
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
746
|
-
* you may not use this file except in compliance with the License.
|
|
747
|
-
* You may obtain a copy of the License at
|
|
748
|
-
*
|
|
749
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
750
|
-
*
|
|
751
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
752
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
753
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
754
|
-
* See the License for the specific language governing permissions and
|
|
755
|
-
* limitations under the License.
|
|
756
|
-
*/
|
|
757
|
-
class CamundaFormfieldValidationComponent {
|
|
758
|
-
constructor() { }
|
|
759
|
-
ngOnInit() {
|
|
760
|
-
this.formControl = this.formGroup.get(this.formField.id);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
CamundaFormfieldValidationComponent.decorators = [
|
|
764
|
-
{ type: Component, args: [{
|
|
765
|
-
selector: 'valtimo-camunda-formfield-validation',
|
|
766
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ul\n class=\"parsley-errors-list filled\"\n *ngIf=\"formControl.invalid && (formControl.dirty || formControl.touched)\"\n>\n <li *ngIf=\"formControl.errors.required\">This field is required.</li>\n <li *ngIf=\"formControl.errors.minlength\">\n This field should be more than {{ formControl.errors.minlength.requiredLength }} characters.\n </li>\n <li *ngIf=\"formControl.errors.maxlength\">\n This field cannot be more than {{ formControl.errors.maxlength.requiredLength }} characters.\n </li>\n <li *ngIf=\"formControl.errors.min\">\n This field should be more than {{ formControl.errors.min.min }}.\n </li>\n <li *ngIf=\"formControl.errors.max\">\n This field should be less or equal to {{ formControl.errors.max.max }}.\n </li>\n <li *ngIf=\"formControl.errors.minDate\">\n This field should be more than {{ formControl.errors.minDate.minDate }}.\n </li>\n <li *ngIf=\"formControl.errors.maxDate\">\n This field should be less or equal to {{ formControl.errors.maxDate.maxDate }}.\n </li>\n</ul>\n"
|
|
767
|
-
},] }
|
|
768
|
-
];
|
|
769
|
-
CamundaFormfieldValidationComponent.ctorParameters = () => [];
|
|
770
|
-
CamundaFormfieldValidationComponent.propDecorators = {
|
|
771
|
-
formGroup: [{ type: Input }],
|
|
772
|
-
formField: [{ type: Input }]
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
/*
|
|
776
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
777
|
-
*
|
|
778
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
779
|
-
* you may not use this file except in compliance with the License.
|
|
780
|
-
* You may obtain a copy of the License at
|
|
781
|
-
*
|
|
782
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
783
|
-
*
|
|
784
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
785
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
786
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
787
|
-
* See the License for the specific language governing permissions and
|
|
788
|
-
* limitations under the License.
|
|
789
|
-
*/
|
|
790
|
-
class CamundaGeneratedFormModule {
|
|
791
|
-
}
|
|
792
|
-
CamundaGeneratedFormModule.decorators = [
|
|
793
|
-
{ type: NgModule, args: [{
|
|
794
|
-
declarations: [
|
|
795
|
-
CamundaStringFormfieldComponent,
|
|
796
|
-
CamundaBooleanFormfieldComponent,
|
|
797
|
-
CamundaDateFormfieldComponent,
|
|
798
|
-
CamundaFormfieldGeneratorDirective,
|
|
799
|
-
CamundaLongFormfieldComponent,
|
|
800
|
-
CamundaEnumFormfieldComponent,
|
|
801
|
-
CamundaTextareaFormfieldComponent,
|
|
802
|
-
CamundaChoicefieldFormfieldComponent,
|
|
803
|
-
CamundaFormfieldValidationComponent,
|
|
804
|
-
CamundaGeneratedFormComponent,
|
|
805
|
-
],
|
|
806
|
-
imports: [CommonModule, ReactiveFormsModule],
|
|
807
|
-
exports: [CamundaGeneratedFormComponent],
|
|
808
|
-
entryComponents: [
|
|
809
|
-
CamundaStringFormfieldComponent,
|
|
810
|
-
CamundaBooleanFormfieldComponent,
|
|
811
|
-
CamundaDateFormfieldComponent,
|
|
812
|
-
CamundaLongFormfieldComponent,
|
|
813
|
-
CamundaEnumFormfieldComponent,
|
|
814
|
-
CamundaTextareaFormfieldComponent,
|
|
815
|
-
CamundaChoicefieldFormfieldComponent,
|
|
816
|
-
],
|
|
817
|
-
},] }
|
|
818
|
-
];
|
|
819
|
-
|
|
820
|
-
/*
|
|
821
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
822
|
-
*
|
|
823
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
824
|
-
* you may not use this file except in compliance with the License.
|
|
825
|
-
* You may obtain a copy of the License at
|
|
826
|
-
*
|
|
827
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
828
|
-
*
|
|
829
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
830
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
831
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
832
|
-
* See the License for the specific language governing permissions and
|
|
833
|
-
* limitations under the License.
|
|
834
|
-
*/
|
|
835
|
-
class CamundaFormModule {
|
|
836
|
-
}
|
|
837
|
-
CamundaFormModule.decorators = [
|
|
838
|
-
{ type: NgModule, args: [{
|
|
839
|
-
declarations: [CamundaFormComponent],
|
|
840
|
-
imports: [CommonModule, CamundaGeneratedFormModule, CamundaCustomFormModule],
|
|
841
|
-
exports: [CamundaFormComponent],
|
|
842
|
-
},] }
|
|
843
|
-
];
|
|
844
|
-
|
|
845
|
-
/*
|
|
846
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
847
|
-
*
|
|
848
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
849
|
-
* you may not use this file except in compliance with the License.
|
|
850
|
-
* You may obtain a copy of the License at
|
|
851
|
-
*
|
|
852
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
853
|
-
*
|
|
854
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
855
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
856
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
857
|
-
* See the License for the specific language governing permissions and
|
|
858
|
-
* limitations under the License.
|
|
859
|
-
*/
|
|
860
|
-
class TopbarComponent {
|
|
861
|
-
constructor() { }
|
|
862
|
-
}
|
|
863
|
-
TopbarComponent.decorators = [
|
|
864
|
-
{ type: Component, args: [{
|
|
865
|
-
selector: 'valtimo-topbar',
|
|
866
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav class=\"navbar navbar-expand fixed-top be-top-header\">\n <div class=\"container-fluid\">\n <div class=\"be-navbar-header\">\n <a class=\"navbar-brand\" [routerLink]=\"['/']\"></a>\n </div>\n <div class=\"be-right-navbar\">\n <!-- important empty div: in order to made float-right element works on mobile -->\n <div></div>\n <ul class=\"nav navbar-nav be-user-nav float-right be-icons-nav\">\n <li class=\"nav-item dropdown special\">\n <a class=\"nav-link be-toggle-right-sidebar\" href=\"#\" role=\"button\" aria-expanded=\"false\">\n <i class=\"mdi mdi-account-circle user-icon\"></i>\n </a>\n </li>\n </ul>\n </div>\n </div>\n</nav>\n",
|
|
867
|
-
styles: [".user-icon{font-size:30px}.be-toggle-right-sidebar{display:flex}"]
|
|
868
|
-
},] }
|
|
869
|
-
];
|
|
870
|
-
TopbarComponent.ctorParameters = () => [];
|
|
871
|
-
|
|
872
|
-
/*
|
|
873
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
874
|
-
*
|
|
875
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
876
|
-
* you may not use this file except in compliance with the License.
|
|
877
|
-
* You may obtain a copy of the License at
|
|
878
|
-
*
|
|
879
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
880
|
-
*
|
|
881
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
882
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
883
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
884
|
-
* See the License for the specific language governing permissions and
|
|
885
|
-
* limitations under the License.
|
|
886
|
-
*/
|
|
887
|
-
class TopbarModule {
|
|
888
|
-
}
|
|
889
|
-
TopbarModule.decorators = [
|
|
890
|
-
{ type: NgModule, args: [{
|
|
891
|
-
declarations: [TopbarComponent],
|
|
892
|
-
imports: [CommonModule, RouterModule],
|
|
893
|
-
exports: [TopbarComponent],
|
|
894
|
-
},] }
|
|
895
|
-
];
|
|
896
|
-
|
|
897
|
-
/*
|
|
898
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
899
|
-
*
|
|
900
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
901
|
-
* you may not use this file except in compliance with the License.
|
|
902
|
-
* You may obtain a copy of the License at
|
|
903
|
-
*
|
|
904
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
905
|
-
*
|
|
906
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
907
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
908
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
909
|
-
* See the License for the specific language governing permissions and
|
|
910
|
-
* limitations under the License.
|
|
911
|
-
*/
|
|
912
|
-
class MenuService {
|
|
913
|
-
constructor(configService, documentService, userProviderService, logger, menuIncludeService) {
|
|
914
|
-
this.configService = configService;
|
|
915
|
-
this.documentService = documentService;
|
|
916
|
-
this.userProviderService = userProviderService;
|
|
917
|
-
this.logger = logger;
|
|
918
|
-
this.menuIncludeService = menuIncludeService;
|
|
919
|
-
this.includeFunctionObservables = {};
|
|
920
|
-
this._menuItems$ = new BehaviorSubject(undefined);
|
|
921
|
-
this.menuConfig = configService.config.menu;
|
|
922
|
-
}
|
|
923
|
-
init() {
|
|
924
|
-
this.reload();
|
|
925
|
-
this.logger.debug('Menu initialized');
|
|
926
|
-
}
|
|
927
|
-
get menuItems$() {
|
|
928
|
-
return this._menuItems$.asObservable();
|
|
929
|
-
}
|
|
930
|
-
reload() {
|
|
931
|
-
return this._menuItems$.next(this.loadMenuItems());
|
|
932
|
-
}
|
|
933
|
-
loadMenuItems() {
|
|
934
|
-
let menuItems = [];
|
|
935
|
-
this.menuConfig.menuItems.forEach((menuItem) => {
|
|
936
|
-
if (menuItem.includeFunction !== undefined) {
|
|
937
|
-
this.includeFunctionObservables[menuItem.title] =
|
|
938
|
-
this.menuIncludeService.getIncludeFunction(menuItem.includeFunction);
|
|
939
|
-
}
|
|
940
|
-
menuItem.show = true;
|
|
941
|
-
menuItems.push(menuItem);
|
|
942
|
-
});
|
|
943
|
-
menuItems = this.sortMenuItems(menuItems);
|
|
944
|
-
this.appendDossierSubMenuItems(menuItems).subscribe(value => (menuItems = this.applyMenuRoleSecurity(value)));
|
|
945
|
-
return menuItems;
|
|
946
|
-
}
|
|
947
|
-
sortMenuItems(menuItems) {
|
|
948
|
-
return menuItems.sort((a, b) => {
|
|
949
|
-
return a.sequence - b.sequence;
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
appendDossierSubMenuItems(menuItems) {
|
|
953
|
-
return new Observable(subscriber => {
|
|
954
|
-
this.logger.debug('appendDossierSubMenuItems');
|
|
955
|
-
this.documentService.getAllDefinitions().subscribe(definitions => {
|
|
956
|
-
const dossierMenuItems = definitions.content.map((definition, index) => ({
|
|
957
|
-
link: ['/dossiers/' + definition.id.name],
|
|
958
|
-
title: definition.schema.title,
|
|
959
|
-
iconClass: 'icon mdi mdi-dot-circle',
|
|
960
|
-
sequence: index,
|
|
961
|
-
show: true,
|
|
962
|
-
}));
|
|
963
|
-
this.logger.debug('found dossierMenuItems', dossierMenuItems);
|
|
964
|
-
const menuItemIndex = menuItems.findIndex(({ title }) => title === 'Dossiers');
|
|
965
|
-
if (menuItemIndex > 0) {
|
|
966
|
-
const dossierMenu = menuItems[menuItemIndex];
|
|
967
|
-
this.logger.debug('updating dossierMenu', dossierMenu);
|
|
968
|
-
dossierMenu.children = dossierMenuItems;
|
|
969
|
-
menuItems[menuItemIndex] = dossierMenu;
|
|
970
|
-
}
|
|
971
|
-
subscriber.next(menuItems);
|
|
972
|
-
this.logger.debug('appendDossierSubMenuItems finished');
|
|
973
|
-
});
|
|
974
|
-
});
|
|
975
|
-
}
|
|
976
|
-
applyMenuRoleSecurity(menuItems) {
|
|
977
|
-
this.userProviderService.getUserSubject().subscribe(user => {
|
|
978
|
-
if (user.roles != null) {
|
|
979
|
-
this.logger.debug('applyMenuRoleSecurity');
|
|
980
|
-
const userRoles = user.roles;
|
|
981
|
-
menuItems.forEach((menuItem) => {
|
|
982
|
-
const access = this.determineRoleAccess(menuItem, userRoles);
|
|
983
|
-
this.logger.debug('Menu: check role access', menuItem.roles, access);
|
|
984
|
-
if (menuItem.show !== access) {
|
|
985
|
-
this.logger.debug('Menu: Change access', menuItem, access);
|
|
986
|
-
menuItem.show = access;
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
return menuItems;
|
|
992
|
-
}
|
|
993
|
-
determineRoleAccess(menuItem, roles) {
|
|
994
|
-
if (!menuItem.roles) {
|
|
995
|
-
return true;
|
|
996
|
-
}
|
|
997
|
-
else if (menuItem.roles.some(role => roles.includes(role))) {
|
|
998
|
-
return true;
|
|
999
|
-
}
|
|
1000
|
-
else {
|
|
1001
|
-
return false;
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
MenuService.ɵprov = ɵɵdefineInjectable({ factory: function MenuService_Factory() { return new MenuService(ɵɵinject(ConfigService), ɵɵinject(DocumentService), ɵɵinject(UserProviderService), ɵɵinject(NGXLogger), ɵɵinject(MenuIncludeService)); }, token: MenuService, providedIn: "root" });
|
|
1006
|
-
MenuService.decorators = [
|
|
1007
|
-
{ type: Injectable, args: [{
|
|
1008
|
-
providedIn: 'root',
|
|
1009
|
-
},] }
|
|
1010
|
-
];
|
|
1011
|
-
MenuService.ctorParameters = () => [
|
|
1012
|
-
{ type: ConfigService },
|
|
1013
|
-
{ type: DocumentService },
|
|
1014
|
-
{ type: UserProviderService },
|
|
1015
|
-
{ type: NGXLogger },
|
|
1016
|
-
{ type: MenuIncludeService }
|
|
1017
|
-
];
|
|
1018
|
-
|
|
1019
|
-
/*
|
|
1020
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1021
|
-
*
|
|
1022
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1023
|
-
* you may not use this file except in compliance with the License.
|
|
1024
|
-
* You may obtain a copy of the License at
|
|
1025
|
-
*
|
|
1026
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1027
|
-
*
|
|
1028
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1029
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1030
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1031
|
-
* See the License for the specific language governing permissions and
|
|
1032
|
-
* limitations under the License.
|
|
1033
|
-
*/
|
|
1034
|
-
const routes = [];
|
|
1035
|
-
class MenuRoutingModule {
|
|
1036
|
-
}
|
|
1037
|
-
MenuRoutingModule.decorators = [
|
|
1038
|
-
{ type: NgModule, args: [{
|
|
1039
|
-
imports: [RouterModule.forChild(routes)],
|
|
1040
|
-
exports: [RouterModule],
|
|
1041
|
-
},] }
|
|
1042
|
-
];
|
|
1043
|
-
|
|
1044
|
-
/*
|
|
1045
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1046
|
-
*
|
|
1047
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1048
|
-
* you may not use this file except in compliance with the License.
|
|
1049
|
-
* You may obtain a copy of the License at
|
|
1050
|
-
*
|
|
1051
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1052
|
-
*
|
|
1053
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1054
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1055
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1056
|
-
* See the License for the specific language governing permissions and
|
|
1057
|
-
* limitations under the License.
|
|
1058
|
-
*/
|
|
1059
|
-
class MenuComponent {
|
|
1060
|
-
constructor(menuService, elRef, renderer, router) {
|
|
1061
|
-
this.menuService = menuService;
|
|
1062
|
-
this.elRef = elRef;
|
|
1063
|
-
this.renderer = renderer;
|
|
1064
|
-
this.router = router;
|
|
1065
|
-
this.includeFunctionObservables = {};
|
|
1066
|
-
this.includeFunctionObservables = this.menuService.includeFunctionObservables;
|
|
1067
|
-
}
|
|
1068
|
-
ngOnInit() {
|
|
1069
|
-
this.openRouterSubscription();
|
|
1070
|
-
this.menuItemSubscription = this.menuService.menuItems$.subscribe(value => (this.menuItems = value));
|
|
1071
|
-
}
|
|
1072
|
-
ngOnDestroy() {
|
|
1073
|
-
this.routerSubscription.unsubscribe();
|
|
1074
|
-
this.menuItemSubscription.unsubscribe();
|
|
1075
|
-
}
|
|
1076
|
-
openRouterSubscription() {
|
|
1077
|
-
this.routerSubscription = this.router.events.subscribe((event) => {
|
|
1078
|
-
if (event instanceof NavigationEnd) {
|
|
1079
|
-
this.closeSubMenu();
|
|
1080
|
-
}
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
closeSubMenu() {
|
|
1084
|
-
const visibleSubMenuElm = this.elRef.nativeElement.querySelector('.sub-menu.visible');
|
|
1085
|
-
if (visibleSubMenuElm) {
|
|
1086
|
-
this.renderer.removeClass(visibleSubMenuElm, 'visible');
|
|
1087
|
-
const topLevelMenuItem = this.elRef.nativeElement.querySelector('li.parent.open');
|
|
1088
|
-
if (topLevelMenuItem) {
|
|
1089
|
-
this.renderer.removeClass(topLevelMenuItem, 'open');
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
MenuComponent.decorators = [
|
|
1095
|
-
{ type: Component, args: [{
|
|
1096
|
-
selector: 'valtimo-menu',
|
|
1097
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ul class=\"sidebar-elements\">\n <ng-container *ngFor=\"let menuItem of menuItems\">\n <li\n [class.parent]=\"menuItem.children\"\n [hidden]=\"!menuItem.show\"\n [routerLinkActive]=\"'active'\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [ngClass]=\"{\n 'menu-item--hidden': menuItem.includeFunction !== undefined,\n 'menu-item--visible':\n menuItem.includeFunction !== undefined &&\n (includeFunctionObservables[menuItem.title] | async)\n }\"\n >\n <a *ngIf=\"menuItem.link\" [routerLink]=\"menuItem.link\" class=\"sub-item\">\n <valtimo-menu-item-text [menuItem]=\"menuItem\"></valtimo-menu-item-text>\n </a>\n <a *ngIf=\"!menuItem.link\" class=\"sub-item\">\n <valtimo-menu-item-text [menuItem]=\"menuItem\"></valtimo-menu-item-text>\n </a>\n <ng-container *ngIf=\"menuItem.children\">\n <ul class=\"sub-menu\">\n <li class=\"title\">{{ menuItem.title | translate }}</li>\n <li\n *ngFor=\"let subMenuItem of menuItem.children\"\n [routerLinkActive]=\"'active'\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n <a *ngIf=\"subMenuItem.link\" [routerLink]=\"subMenuItem.link\">\n <valtimo-submenu-item-text [submenuItem]=\"subMenuItem\"></valtimo-submenu-item-text>\n </a>\n <a *ngIf=\"!subMenuItem.link\">\n <valtimo-submenu-item-text [submenuItem]=\"subMenuItem\"></valtimo-submenu-item-text>\n </a>\n </li>\n </ul>\n </ng-container>\n </li>\n </ng-container>\n</ul>\n",
|
|
1098
|
-
styles: [".c-default{cursor:default}.sub-item{cursor:pointer}.menu-item--hidden{display:none}.menu-item--visible{display:block}"]
|
|
1099
|
-
},] }
|
|
1100
|
-
];
|
|
1101
|
-
MenuComponent.ctorParameters = () => [
|
|
1102
|
-
{ type: MenuService },
|
|
1103
|
-
{ type: ElementRef },
|
|
1104
|
-
{ type: Renderer2 },
|
|
1105
|
-
{ type: Router }
|
|
1106
|
-
];
|
|
1107
|
-
|
|
1108
|
-
/*
|
|
1109
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1110
|
-
*
|
|
1111
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1112
|
-
* you may not use this file except in compliance with the License.
|
|
1113
|
-
* You may obtain a copy of the License at
|
|
1114
|
-
*
|
|
1115
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1116
|
-
*
|
|
1117
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1118
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1119
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1120
|
-
* See the License for the specific language governing permissions and
|
|
1121
|
-
* limitations under the License.
|
|
1122
|
-
*/
|
|
1123
|
-
class MenuItemTextComponent {
|
|
1124
|
-
}
|
|
1125
|
-
MenuItemTextComponent.decorators = [
|
|
1126
|
-
{ type: Component, args: [{
|
|
1127
|
-
selector: 'valtimo-menu-item-text',
|
|
1128
|
-
template: `
|
|
1129
|
-
<i
|
|
1130
|
-
class="{{ menuItem.iconClass }}"
|
|
1131
|
-
container="body"
|
|
1132
|
-
placement="right"
|
|
1133
|
-
ngbTooltip="{{ menuItem.title | translate }}"
|
|
1134
|
-
autoClose="true"
|
|
1135
|
-
>
|
|
1136
|
-
</i>
|
|
1137
|
-
<span>{{ menuItem.title | translate }}</span>
|
|
1138
|
-
`
|
|
1139
|
-
},] }
|
|
1140
|
-
];
|
|
1141
|
-
MenuItemTextComponent.propDecorators = {
|
|
1142
|
-
menuItem: [{ type: Input }]
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
/*
|
|
1146
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1147
|
-
*
|
|
1148
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1149
|
-
* you may not use this file except in compliance with the License.
|
|
1150
|
-
* You may obtain a copy of the License at
|
|
1151
|
-
*
|
|
1152
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1153
|
-
*
|
|
1154
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1155
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1156
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1157
|
-
* See the License for the specific language governing permissions and
|
|
1158
|
-
* limitations under the License.
|
|
1159
|
-
*/
|
|
1160
|
-
class SubmenuItemTextComponent {
|
|
1161
|
-
}
|
|
1162
|
-
SubmenuItemTextComponent.decorators = [
|
|
1163
|
-
{ type: Component, args: [{
|
|
1164
|
-
selector: 'valtimo-submenu-item-text',
|
|
1165
|
-
template: `
|
|
1166
|
-
<span [ngClass]="submenuItem.textClass">
|
|
1167
|
-
{{ submenuItem.title | translate }}
|
|
1168
|
-
<ng-container *ngIf="!submenuItem.link">></ng-container>
|
|
1169
|
-
</span>
|
|
1170
|
-
`
|
|
1171
|
-
},] }
|
|
1172
|
-
];
|
|
1173
|
-
SubmenuItemTextComponent.propDecorators = {
|
|
1174
|
-
submenuItem: [{ type: Input }]
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
/*
|
|
1178
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1179
|
-
*
|
|
1180
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1181
|
-
* you may not use this file except in compliance with the License.
|
|
1182
|
-
* You may obtain a copy of the License at
|
|
1183
|
-
*
|
|
1184
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1185
|
-
*
|
|
1186
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1187
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1188
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1189
|
-
* See the License for the specific language governing permissions and
|
|
1190
|
-
* limitations under the License.
|
|
1191
|
-
*/
|
|
1192
|
-
class MenuModule {
|
|
1193
|
-
}
|
|
1194
|
-
MenuModule.decorators = [
|
|
1195
|
-
{ type: NgModule, args: [{
|
|
1196
|
-
declarations: [MenuComponent, MenuItemTextComponent, SubmenuItemTextComponent],
|
|
1197
|
-
imports: [CommonModule, RouterModule, NgbTooltipModule, TranslateModule],
|
|
1198
|
-
exports: [MenuComponent],
|
|
1199
|
-
providers: [],
|
|
1200
|
-
},] }
|
|
1201
|
-
];
|
|
1202
|
-
|
|
1203
|
-
/*
|
|
1204
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1205
|
-
*
|
|
1206
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1207
|
-
* you may not use this file except in compliance with the License.
|
|
1208
|
-
* You may obtain a copy of the License at
|
|
1209
|
-
*
|
|
1210
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1211
|
-
*
|
|
1212
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1213
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1214
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1215
|
-
* See the License for the specific language governing permissions and
|
|
1216
|
-
* limitations under the License.
|
|
1217
|
-
*/
|
|
1218
|
-
function menuInitializer(injector, logger) {
|
|
1219
|
-
const menuService = injector.get(MenuService);
|
|
1220
|
-
return () => {
|
|
1221
|
-
return new Promise((resolve, reject) => {
|
|
1222
|
-
try {
|
|
1223
|
-
logger.debug('menu initializer before init');
|
|
1224
|
-
menuService.init();
|
|
1225
|
-
logger.debug('menu initializer after init');
|
|
1226
|
-
resolve();
|
|
1227
|
-
}
|
|
1228
|
-
catch (error) {
|
|
1229
|
-
logger.debug('menu initializer error', error);
|
|
1230
|
-
reject(error);
|
|
1231
|
-
}
|
|
1232
|
-
});
|
|
1233
|
-
};
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
/*
|
|
1237
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1238
|
-
*
|
|
1239
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1240
|
-
* you may not use this file except in compliance with the License.
|
|
1241
|
-
* You may obtain a copy of the License at
|
|
1242
|
-
*
|
|
1243
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1244
|
-
*
|
|
1245
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1246
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1247
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1248
|
-
* See the License for the specific language governing permissions and
|
|
1249
|
-
* limitations under the License.
|
|
1250
|
-
*/
|
|
1251
|
-
class VersionService {
|
|
1252
|
-
constructor(http) {
|
|
1253
|
-
this.http = http;
|
|
1254
|
-
}
|
|
1255
|
-
getVersion() {
|
|
1256
|
-
// TODO: this hardcoded string should be taken care of with the introduction of a config service
|
|
1257
|
-
return this.http.get(`/api/valtimo/version`);
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
VersionService.ɵprov = ɵɵdefineInjectable({ factory: function VersionService_Factory() { return new VersionService(ɵɵinject(HttpClient)); }, token: VersionService, providedIn: "root" });
|
|
1261
|
-
VersionService.decorators = [
|
|
1262
|
-
{ type: Injectable, args: [{
|
|
1263
|
-
providedIn: 'root',
|
|
1264
|
-
},] }
|
|
1265
|
-
];
|
|
1266
|
-
VersionService.ctorParameters = () => [
|
|
1267
|
-
{ type: HttpClient }
|
|
1268
|
-
];
|
|
1269
|
-
|
|
1270
|
-
/*
|
|
1271
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1272
|
-
*
|
|
1273
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1274
|
-
* you may not use this file except in compliance with the License.
|
|
1275
|
-
* You may obtain a copy of the License at
|
|
1276
|
-
*
|
|
1277
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1278
|
-
*
|
|
1279
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1280
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1281
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1282
|
-
* See the License for the specific language governing permissions and
|
|
1283
|
-
* limitations under the License.
|
|
1284
|
-
*/
|
|
1285
|
-
class RightSidebarComponent {
|
|
1286
|
-
constructor(userProviderService, formBuilder, versionService, translate, contextService, http, logger) {
|
|
1287
|
-
this.userProviderService = userProviderService;
|
|
1288
|
-
this.formBuilder = formBuilder;
|
|
1289
|
-
this.versionService = versionService;
|
|
1290
|
-
this.translate = translate;
|
|
1291
|
-
this.contextService = contextService;
|
|
1292
|
-
this.http = http;
|
|
1293
|
-
this.logger = logger;
|
|
1294
|
-
}
|
|
1295
|
-
ngOnInit() {
|
|
1296
|
-
this.frequencies = [
|
|
1297
|
-
'emailNotificationOnMonday',
|
|
1298
|
-
'emailNotificationOnTuesday',
|
|
1299
|
-
'emailNotificationOnWednesday',
|
|
1300
|
-
'emailNotificationOnThursday',
|
|
1301
|
-
'emailNotificationOnFriday',
|
|
1302
|
-
'emailNotificationOnSaturday',
|
|
1303
|
-
'emailNotificationOnSunday',
|
|
1304
|
-
];
|
|
1305
|
-
this.settingsForm = this.formBuilder.group({
|
|
1306
|
-
taskNotifications: new FormControl(false),
|
|
1307
|
-
emailNotifications: new FormControl(false),
|
|
1308
|
-
emailNotificationOnMonday: new FormControl(false),
|
|
1309
|
-
emailNotificationOnTuesday: new FormControl(false),
|
|
1310
|
-
emailNotificationOnWednesday: new FormControl(false),
|
|
1311
|
-
emailNotificationOnThursday: new FormControl(false),
|
|
1312
|
-
emailNotificationOnFriday: new FormControl(false),
|
|
1313
|
-
emailNotificationOnSaturday: new FormControl(false),
|
|
1314
|
-
emailNotificationOnSunday: new FormControl(false),
|
|
1315
|
-
});
|
|
1316
|
-
this.getUserSettings();
|
|
1317
|
-
}
|
|
1318
|
-
loadContextSwitch() {
|
|
1319
|
-
combineLatest([
|
|
1320
|
-
this.contextService.getUserContexts(),
|
|
1321
|
-
this.contextService.getUserContextActive(),
|
|
1322
|
-
]).subscribe(([userContexts, userContextActive]) => {
|
|
1323
|
-
this.userContextActive = userContextActive;
|
|
1324
|
-
this.userContexts = userContexts;
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
setUserContext(contextId) {
|
|
1328
|
-
this.contextService.setUserContext(contextId).subscribe();
|
|
1329
|
-
location.href = '/';
|
|
1330
|
-
}
|
|
1331
|
-
loadUserSettingsTab() {
|
|
1332
|
-
this.userProviderService.getEmailNotificationSettings().subscribe(results => {
|
|
1333
|
-
if (results !== null) {
|
|
1334
|
-
this.settingsForm.controls.taskNotifications.setValue(results.taskNotifications);
|
|
1335
|
-
this.settingsForm.controls.emailNotifications.setValue(results.emailNotifications);
|
|
1336
|
-
this.settingsForm.controls.emailNotificationOnMonday.setValue(results.emailNotificationOnMonday);
|
|
1337
|
-
this.settingsForm.controls.emailNotificationOnTuesday.setValue(results.emailNotificationOnTuesday);
|
|
1338
|
-
this.settingsForm.controls.emailNotificationOnWednesday.setValue(results.emailNotificationOnWednesday);
|
|
1339
|
-
this.settingsForm.controls.emailNotificationOnThursday.setValue(results.emailNotificationOnThursday);
|
|
1340
|
-
this.settingsForm.controls.emailNotificationOnFriday.setValue(results.emailNotificationOnFriday);
|
|
1341
|
-
this.settingsForm.controls.emailNotificationOnSaturday.setValue(results.emailNotificationOnSaturday);
|
|
1342
|
-
this.settingsForm.controls.emailNotificationOnSunday.setValue(results.emailNotificationOnSunday);
|
|
1343
|
-
}
|
|
1344
|
-
else {
|
|
1345
|
-
// default is true in the database, even if api returns no content
|
|
1346
|
-
this.settingsForm.controls.taskNotifications.setValue(true);
|
|
1347
|
-
}
|
|
1348
|
-
});
|
|
1349
|
-
this.getVersion();
|
|
1350
|
-
}
|
|
1351
|
-
getUserSettings() {
|
|
1352
|
-
this.userProviderService.getUserSubject().subscribe(userIdentity => {
|
|
1353
|
-
this.logger.debug('user', userIdentity);
|
|
1354
|
-
this.userIdentity = userIdentity;
|
|
1355
|
-
this.loadContextSwitch();
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
getVersion() {
|
|
1359
|
-
this.versionService.getVersion().subscribe((build) => {
|
|
1360
|
-
this.build = build;
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
|
-
onSettingsSubmit() {
|
|
1364
|
-
if (!this.settingsForm.pristine) {
|
|
1365
|
-
this.userProviderService.updateEmailNotificationSettings(this.settingsForm.value).subscribe();
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
updateUserLanguage(langKey) {
|
|
1369
|
-
this.translate.use(langKey).subscribe(() => {
|
|
1370
|
-
localStorage.setItem('langKey', langKey);
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
|
-
logout() {
|
|
1374
|
-
this.userProviderService.logout();
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
RightSidebarComponent.decorators = [
|
|
1378
|
-
{ type: Component, args: [{
|
|
1379
|
-
selector: 'valtimo-right-sidebar',
|
|
1380
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav class=\"be-right-sidebar\">\n <div class=\"sb-content\">\n <div class=\"tab-navigation\">\n <ul class=\"nav nav-tabs nav-justified\" role=\"tablist\">\n <li class=\"nav-item\" role=\"presentation\">\n <a\n class=\"nav-link active\"\n href=\"#account\"\n aria-controls=\"account\"\n role=\"tab\"\n data-toggle=\"tab\"\n translate=\"account.title\"\n ></a>\n </li>\n <li class=\"nav-item\" role=\"presentation\">\n <a\n class=\"nav-link\"\n (click)=\"loadUserSettingsTab()\"\n href=\"#settings\"\n aria-controls=\"settings\"\n role=\"tab\"\n data-toggle=\"tab\"\n translate=\"settings.title\"\n ></a>\n </li>\n </ul>\n </div>\n <div class=\"tab-panel\">\n <div class=\"tab-content\">\n <!-- account -->\n <div class=\"tab-pane tab-account active\" id=\"account\" role=\"tabpanel\">\n <div class=\"p-3 be-scroller-settings\" *ngIf=\"userIdentity\">\n <div class=\"content\">\n <div class=\"category-title border-0 m-0\">\n <div class=\"p-0 text-muted\">\n <dl class=\"row mb-0\">\n <dt class=\"col-sm-3\">Email</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">{{ userIdentity.email }}</dd>\n <ng-container *ngIf=\"userIdentity.username\">\n <dt class=\"col-sm-3\">Username</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">{{ userIdentity.username }}</dd>\n </ng-container>\n <dt class=\"col-sm-3\">Name</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">\n {{ userIdentity.firstName + ' ' + userIdentity.lastName }}\n </dd>\n </dl>\n </div>\n </div>\n <!-- context switch -->\n <ul class=\"settings-list\" *ngIf=\"userContexts?.length > 1\">\n <li ngbTooltip=\"{{ 'settings.context.title' | translate }}\">\n <select\n class=\"form-control\"\n #contextSelect\n (change)=\"setUserContext(+contextSelect.value)\"\n >\n <option\n *ngFor=\"let context of userContexts\"\n [value]=\"context.id\"\n [selected]=\"context.id === userContextActive.id\"\n >\n {{ context.name }}\n </option>\n </select>\n </li>\n </ul>\n <ul class=\"list-group list-group-flush m-0\">\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://docs.valtimo.nl\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.help\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://www.valtimo.nl/feedback/\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.feedback\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://forum.valtimo.nl\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.forum\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"javascript:void(0)\"\n class=\"d-block\"\n (click)=\"logout()\"\n translate=\"account.links.signOut\"\n ></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n\n <!-- settings -->\n <div class=\"tab-pane tab-settings\" id=\"settings\" role=\"tabpanel\">\n <div class=\"p-3 be-scroller-settings\">\n <div class=\"content\">\n <span class=\"category-title\" translate=\"settings.language.title\"></span>\n <ul class=\"settings-list\">\n <li>\n <select\n class=\"form-control\"\n #langSelect\n (change)=\"updateUserLanguage(langSelect.value)\"\n >\n <option\n *ngFor=\"let lang of translate.getLangs()\"\n [value]=\"lang\"\n [selected]=\"lang === translate.currentLang\"\n >\n {{ 'settings.language.options.' + lang | translate }}\n </option>\n </select>\n </li>\n </ul>\n\n <form [formGroup]=\"settingsForm\">\n <span class=\"category-title\" translate=\"settings.notification.title\"></span>\n <ul class=\"settings-list m-0\">\n <li>\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"taskNotifications\"\n id=\"taskNotifications\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"taskNotifications\"></label></span>\n </div>\n <span class=\"name\" translate=\"settings.notification.taskNotifications\"></span>\n <div\n class=\"text-muted info-text\"\n translate=\"settings.notification.taskNotificationsIntro\"\n ></div>\n </li>\n\n <li>\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"emailNotifications\"\n id=\"emailNotifications\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"emailNotifications\"></label></span>\n </div>\n <span class=\"name\" translate=\"settings.notification.emailNotifications\"></span>\n <div\n class=\"text-muted info-text\"\n translate=\"settings.notification.emailNotificationsIntro\"\n ></div>\n </li>\n </ul>\n\n <div *ngIf=\"settingsForm.value.emailNotifications\">\n <ul class=\"settings-list\">\n <li *ngFor=\"let frequency of frequencies\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"{{ frequency }}\"\n id=\"{{ frequency }}\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"{{ frequency }}\"></label></span>\n </div>\n <span class=\"name\">{{\n 'settings.notification.' + frequency | translate\n }}</span>\n </li>\n </ul>\n </div>\n </form>\n\n <div class=\"version-holder\">\n <span class=\"category-title\" translate=\"settings.version.title\"></span>\n <ul class=\"settings-list\">\n <li *ngIf=\"build\">\n <div class=\"name\">{{ build.title }}</div>\n <div class=\"text-muted\">{{ build.version }}</div>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</nav>\n",
|
|
1381
|
-
styles: [".be-scroller-settings{padding-bottom:150px!important}.version-holder{background-color:#f8f9fa;bottom:0;position:fixed;width:259px}.info-text{line-height:1em!important;margin-bottom:15px;padding-right:70px}"]
|
|
1382
|
-
},] }
|
|
1383
|
-
];
|
|
1384
|
-
RightSidebarComponent.ctorParameters = () => [
|
|
1385
|
-
{ type: UserProviderService },
|
|
1386
|
-
{ type: FormBuilder },
|
|
1387
|
-
{ type: VersionService },
|
|
1388
|
-
{ type: TranslateService },
|
|
1389
|
-
{ type: ContextService },
|
|
1390
|
-
{ type: HttpClient },
|
|
1391
|
-
{ type: NGXLogger }
|
|
1392
|
-
];
|
|
1393
|
-
|
|
1394
|
-
/*
|
|
1395
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1396
|
-
*
|
|
1397
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1398
|
-
* you may not use this file except in compliance with the License.
|
|
1399
|
-
* You may obtain a copy of the License at
|
|
1400
|
-
*
|
|
1401
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1402
|
-
*
|
|
1403
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1404
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1405
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1406
|
-
* See the License for the specific language governing permissions and
|
|
1407
|
-
* limitations under the License.
|
|
1408
|
-
*/
|
|
1409
|
-
const ɵ0 = HttpLoaderFactory;
|
|
1410
|
-
class RightSidebarModule {
|
|
1411
|
-
}
|
|
1412
|
-
RightSidebarModule.decorators = [
|
|
1413
|
-
{ type: NgModule, args: [{
|
|
1414
|
-
declarations: [RightSidebarComponent],
|
|
1415
|
-
imports: [
|
|
1416
|
-
CommonModule,
|
|
1417
|
-
FormsModule,
|
|
1418
|
-
ReactiveFormsModule,
|
|
1419
|
-
RouterModule,
|
|
1420
|
-
TranslateModule.forRoot({
|
|
1421
|
-
loader: {
|
|
1422
|
-
provide: TranslateLoader,
|
|
1423
|
-
useFactory: ɵ0,
|
|
1424
|
-
deps: [HttpClient],
|
|
1425
|
-
},
|
|
1426
|
-
}),
|
|
1427
|
-
NgbTooltipModule,
|
|
1428
|
-
],
|
|
1429
|
-
exports: [RightSidebarComponent],
|
|
1430
|
-
},] }
|
|
1431
|
-
];
|
|
1432
|
-
|
|
1433
|
-
/*
|
|
1434
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1435
|
-
*
|
|
1436
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1437
|
-
* you may not use this file except in compliance with the License.
|
|
1438
|
-
* You may obtain a copy of the License at
|
|
1439
|
-
*
|
|
1440
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1441
|
-
*
|
|
1442
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1443
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1444
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1445
|
-
* See the License for the specific language governing permissions and
|
|
1446
|
-
* limitations under the License.
|
|
1447
|
-
*/
|
|
1448
|
-
class LeftSidebarComponent {
|
|
1449
|
-
constructor(translateService, elementRef) {
|
|
1450
|
-
this.translateService = translateService;
|
|
1451
|
-
this.elementRef = elementRef;
|
|
1452
|
-
this.menuWidthChanged = new EventEmitter();
|
|
1453
|
-
this.menuTooltipText$ = this.translateService.stream('interface.mainMenu');
|
|
1454
|
-
this.toggleMenuText$ = this.translateService.stream('interface.toggleMenu');
|
|
1455
|
-
this.mouseIsOnResizeBorder$ = new BehaviorSubject(false);
|
|
1456
|
-
this.menuWidth$ = new BehaviorSubject(undefined);
|
|
1457
|
-
this.isResizing$ = new BehaviorSubject(false);
|
|
1458
|
-
this.defaultMenuWidth = 230;
|
|
1459
|
-
this.maxMenuWidth = 330;
|
|
1460
|
-
this.minMenuWidth = 120;
|
|
1461
|
-
this.mouseX$ = fromEvent(document.body, 'mousemove').pipe(map((e) => e.pageX));
|
|
1462
|
-
this.bodyStyle = elementRef.nativeElement.ownerDocument.body.style;
|
|
1463
|
-
}
|
|
1464
|
-
ngOnInit() {
|
|
1465
|
-
this.setMenuWidth(this.defaultMenuWidth);
|
|
1466
|
-
}
|
|
1467
|
-
ngAfterViewInit() {
|
|
1468
|
-
this.mouseXSubscription = combineLatest([this.mouseX$, this.isResizing$])
|
|
1469
|
-
.pipe(debounceTime(3))
|
|
1470
|
-
.subscribe(([x, isResizing]) => {
|
|
1471
|
-
const menuOpen = this.menuIsOpen;
|
|
1472
|
-
if (isResizing) {
|
|
1473
|
-
const offSetWidth = this.xOnClick - x;
|
|
1474
|
-
const newMenuWidth = this.menuWidthOnClick - offSetWidth;
|
|
1475
|
-
const snapMargin = 35;
|
|
1476
|
-
const snapInside = newMenuWidth < this.minMenuWidth - snapMargin;
|
|
1477
|
-
const snapOutside = !menuOpen && offSetWidth < -snapMargin;
|
|
1478
|
-
if (menuOpen && newMenuWidth <= this.maxMenuWidth && newMenuWidth >= this.minMenuWidth) {
|
|
1479
|
-
this.setMenuWidth(newMenuWidth);
|
|
1480
|
-
}
|
|
1481
|
-
else if (snapInside || snapOutside) {
|
|
1482
|
-
this.snapMenu(snapInside ? this.menuWidthOnClick : this.defaultMenuWidth);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
this.mouseUpSubscription = fromEvent(document, 'mouseup').subscribe(() => {
|
|
1487
|
-
this.stopResizing();
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
ngOnDestroy() {
|
|
1491
|
-
this.mouseXSubscription.unsubscribe();
|
|
1492
|
-
this.mouseUpSubscription.unsubscribe();
|
|
1493
|
-
}
|
|
1494
|
-
enterBorder() {
|
|
1495
|
-
this.mouseIsOnResizeBorder$.next(true);
|
|
1496
|
-
}
|
|
1497
|
-
leaveBorder() {
|
|
1498
|
-
this.mouseIsOnResizeBorder$.next(false);
|
|
1499
|
-
}
|
|
1500
|
-
resizeBorderClick(e) {
|
|
1501
|
-
this.menuWidth$.pipe(take(1)).subscribe(menuWidth => {
|
|
1502
|
-
this.menuWidthOnClick = menuWidth;
|
|
1503
|
-
this.xOnClick = e.pageX;
|
|
1504
|
-
this.bodyStyle.userSelect = 'none';
|
|
1505
|
-
this.bodyStyle.cursor = 'col-resize';
|
|
1506
|
-
this.isResizing$.next(true);
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
snapMenu(snapTo) {
|
|
1510
|
-
this.stopResizing();
|
|
1511
|
-
this.setMenuWidth(snapTo);
|
|
1512
|
-
setTimeout(() => {
|
|
1513
|
-
this.toggleButtonRef.nativeElement.click();
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
stopResizing() {
|
|
1517
|
-
this.bodyStyle.cursor = 'auto';
|
|
1518
|
-
this.bodyStyle.userSelect = 'auto';
|
|
1519
|
-
this.isResizing$.next(false);
|
|
1520
|
-
}
|
|
1521
|
-
setMenuWidth(width) {
|
|
1522
|
-
this.menuWidth$.next(width);
|
|
1523
|
-
this.menuWidthChanged.emit(width);
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
LeftSidebarComponent.decorators = [
|
|
1527
|
-
{ type: Component, args: [{
|
|
1528
|
-
selector: 'valtimo-left-sidebar',
|
|
1529
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container *ngIf=\"{isResizing: isResizing$ | async} as obs\">\n <div\n class=\"be-left-sidebar\"\n [style.width.px]=\"menuIsOpen ? (menuWidth$ | async) : null\"\n [ngClass]=\"{'no-transition': obs.isResizing}\"\n >\n <div class=\"left-sidebar-wrapper\">\n <a class=\"left-sidebar-toggle\" href=\"javascript:void(0);\"\n ><valtimo-page-title></valtimo-page-title\n ></a>\n <div class=\"progress-widget\" style=\"padding: 20px 0\">\n <ul class=\"sidebar-elements\">\n <li>\n <a\n #toggleButton\n class=\"be-toggle-left-sidebar\"\n href=\"javascript:void(0);\"\n [title]=\"menuTooltipText$ | async\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n width=\"1em\"\n height=\"1em\"\n style=\"-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg)\"\n viewBox=\"0 0 24 24\"\n transform=\"rotate(360)\"\n >\n <path [ngClass]=\"menuIsOpen ? 'd-1' : 'd-1-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-2' : 'd-2-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-3' : 'd-3-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-4' : 'd-4-flipped'\" />\n </svg>\n <span>{{ toggleMenuText$ | async }}</span>\n </a>\n </li>\n </ul>\n </div>\n <div class=\"left-sidebar-spacer\">\n <div class=\"left-sidebar-scroll\">\n <div class=\"left-sidebar-content\">\n <valtimo-menu></valtimo-menu>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"resize-border\"\n (mouseenter)=\"enterBorder()\"\n (mouseleave)=\"leaveBorder()\"\n (mousedown)=\"resizeBorderClick($event)\"\n [ngClass]=\"{'resize-hover': (mouseIsOnResizeBorder$ | async) || obs.isResizing}\"\n ></div>\n </div>\n</ng-container>\n",
|
|
1530
|
-
styles: ["@media screen and (max-width:767px){.be-left-sidebar{width:100%!important}}.be-left-sidebar .left-sidebar-toggle{padding:20px}.be-left-sidebar .left-sidebar-toggle:before{font-size:1.615rem}.be-left-sidebar .sidebar-elements>li>a.be-toggle-left-sidebar{align-items:center;display:flex;height:32px}.be-left-sidebar .left-sidebar-content{padding-top:20px}.be-toggle-left-sidebar svg{height:auto;margin-right:7px;min-width:21px;overflow:visible}.be-toggle-left-sidebar svg path{fill:#696969;transition:.27s ease}.resize-border{background-color:#ff5800;cursor:col-resize;height:100%;margin-right:-3px;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease;width:3px}.resize-hover{opacity:.7}.no-transition{transition:none}.d-1{d:path(\"M3 18v-2h13v2z\")}.d-1-flipped{d:path(\"M3 18v-2h11v2z\")}.d-2{d:path(\"M3 13v-2h10v2H3\")}.d-2-flipped{d:path(\"M3 13v-2h12v2H3\")}.d-3{d:path(\"M3 6h13v2H3V6\")}.d-3-flipped{d:path(\"M3 6h11v2H3V6\")}.d-4{d:path(\"M21 15.61L19.59 17l-5.01-5 5.01-5L21 8.39 17.44 12 21 15.61\")}.d-4-flipped{d:path(\"M15.58 15.61L16.99 17 22 12l-5.01-5-1.41 1.39L19.14 12l-3.56 3.61\")}"]
|
|
1531
|
-
},] }
|
|
1532
|
-
];
|
|
1533
|
-
LeftSidebarComponent.ctorParameters = () => [
|
|
1534
|
-
{ type: TranslateService },
|
|
1535
|
-
{ type: ElementRef }
|
|
1536
|
-
];
|
|
1537
|
-
LeftSidebarComponent.propDecorators = {
|
|
1538
|
-
toggleButtonRef: [{ type: ViewChild, args: ['toggleButton',] }],
|
|
1539
|
-
menuIsOpen: [{ type: Input }],
|
|
1540
|
-
menuWidthChanged: [{ type: Output }]
|
|
1541
|
-
};
|
|
1542
|
-
|
|
1543
|
-
/*
|
|
1544
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1545
|
-
*
|
|
1546
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1547
|
-
* you may not use this file except in compliance with the License.
|
|
1548
|
-
* You may obtain a copy of the License at
|
|
1549
|
-
*
|
|
1550
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1551
|
-
*
|
|
1552
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1553
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1554
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1555
|
-
* See the License for the specific language governing permissions and
|
|
1556
|
-
* limitations under the License.
|
|
1557
|
-
*/
|
|
1558
|
-
class PageTitleComponent {
|
|
1559
|
-
constructor(router, activatedRoute, titleService, translateService, logger) {
|
|
1560
|
-
this.router = router;
|
|
1561
|
-
this.activatedRoute = activatedRoute;
|
|
1562
|
-
this.titleService = titleService;
|
|
1563
|
-
this.translateService = translateService;
|
|
1564
|
-
this.logger = logger;
|
|
1565
|
-
this.appTitle = 'Valtimo';
|
|
1566
|
-
this.routerSub = Subscription.EMPTY;
|
|
1567
|
-
}
|
|
1568
|
-
setTitle() {
|
|
1569
|
-
this.title = this.activatedRoute.snapshot.firstChild.data.title;
|
|
1570
|
-
// When loading lazy title is nested
|
|
1571
|
-
if (!this.title) {
|
|
1572
|
-
this.title = this.activatedRoute.snapshot.firstChild.children[0].data.title;
|
|
1573
|
-
}
|
|
1574
|
-
if (this.title) {
|
|
1575
|
-
this.translateService.stream(this.title).subscribe((title) => {
|
|
1576
|
-
this.logger.debug('PageTitle: setTitle translated async', title);
|
|
1577
|
-
this.titleService.setTitle(this.appTitle + ' - ' + title);
|
|
1578
|
-
});
|
|
1579
|
-
}
|
|
1580
|
-
else {
|
|
1581
|
-
this.logger.debug('PageTitle: setTitle default', this.appTitle);
|
|
1582
|
-
this.titleService.setTitle(this.appTitle);
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
ngOnInit() {
|
|
1586
|
-
this.setTitle();
|
|
1587
|
-
this.routerSub = this.router.events
|
|
1588
|
-
.pipe(filter(event => event instanceof NavigationEnd))
|
|
1589
|
-
.subscribe(event => {
|
|
1590
|
-
this.setTitle();
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
ngOnDestroy() {
|
|
1594
|
-
this.routerSub.unsubscribe();
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
PageTitleComponent.decorators = [
|
|
1598
|
-
{ type: Component, args: [{
|
|
1599
|
-
selector: 'valtimo-page-title',
|
|
1600
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<h2 class=\"page-head-title\" *ngIf=\"title !== ''\"><span [innerHTML]=\"title | translate\"></span></h2>\n",
|
|
1601
|
-
styles: [""]
|
|
1602
|
-
},] }
|
|
1603
|
-
];
|
|
1604
|
-
PageTitleComponent.ctorParameters = () => [
|
|
1605
|
-
{ type: Router },
|
|
1606
|
-
{ type: ActivatedRoute },
|
|
1607
|
-
{ type: Title },
|
|
1608
|
-
{ type: TranslateService },
|
|
1609
|
-
{ type: NGXLogger }
|
|
1610
|
-
];
|
|
1611
|
-
|
|
1612
|
-
/*
|
|
1613
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1614
|
-
*
|
|
1615
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1616
|
-
* you may not use this file except in compliance with the License.
|
|
1617
|
-
* You may obtain a copy of the License at
|
|
1618
|
-
*
|
|
1619
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1620
|
-
*
|
|
1621
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1622
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1623
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1624
|
-
* See the License for the specific language governing permissions and
|
|
1625
|
-
* limitations under the License.
|
|
1626
|
-
*/
|
|
1627
|
-
class PageTitleModule {
|
|
1628
|
-
}
|
|
1629
|
-
PageTitleModule.decorators = [
|
|
1630
|
-
{ type: NgModule, args: [{
|
|
1631
|
-
declarations: [PageTitleComponent],
|
|
1632
|
-
imports: [CommonModule, TranslateModule],
|
|
1633
|
-
exports: [PageTitleComponent],
|
|
1634
|
-
},] }
|
|
1635
|
-
];
|
|
1636
|
-
|
|
1637
|
-
/*
|
|
1638
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1639
|
-
*
|
|
1640
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1641
|
-
* you may not use this file except in compliance with the License.
|
|
1642
|
-
* You may obtain a copy of the License at
|
|
1643
|
-
*
|
|
1644
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1645
|
-
*
|
|
1646
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1647
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1648
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1649
|
-
* See the License for the specific language governing permissions and
|
|
1650
|
-
* limitations under the License.
|
|
1651
|
-
*/
|
|
1652
|
-
class LeftSidebarModule {
|
|
1653
|
-
}
|
|
1654
|
-
LeftSidebarModule.decorators = [
|
|
1655
|
-
{ type: NgModule, args: [{
|
|
1656
|
-
declarations: [LeftSidebarComponent],
|
|
1657
|
-
imports: [CommonModule, MenuModule, PageTitleModule],
|
|
1658
|
-
exports: [LeftSidebarComponent],
|
|
1659
|
-
},] }
|
|
1660
|
-
];
|
|
1661
|
-
|
|
1662
|
-
/*
|
|
1663
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1664
|
-
*
|
|
1665
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1666
|
-
* you may not use this file except in compliance with the License.
|
|
1667
|
-
* You may obtain a copy of the License at
|
|
1668
|
-
*
|
|
1669
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1670
|
-
*
|
|
1671
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1672
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1673
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1674
|
-
* See the License for the specific language governing permissions and
|
|
1675
|
-
* limitations under the License.
|
|
1676
|
-
*/
|
|
1677
|
-
class StringTypeConverter {
|
|
1678
|
-
getTypeString() {
|
|
1679
|
-
return 'string';
|
|
1680
|
-
}
|
|
1681
|
-
convert(value, definition) {
|
|
1682
|
-
return value;
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
/*
|
|
1687
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1688
|
-
*
|
|
1689
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1690
|
-
* you may not use this file except in compliance with the License.
|
|
1691
|
-
* You may obtain a copy of the License at
|
|
1692
|
-
*
|
|
1693
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1694
|
-
*
|
|
1695
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1696
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1697
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1698
|
-
* See the License for the specific language governing permissions and
|
|
1699
|
-
* limitations under the License.
|
|
1700
|
-
*/
|
|
1701
|
-
class BooleanTypeConverter {
|
|
1702
|
-
getTypeString() {
|
|
1703
|
-
return 'boolean';
|
|
1704
|
-
}
|
|
1705
|
-
convert(value, definition) {
|
|
1706
|
-
if (!definition.enum) {
|
|
1707
|
-
return value ? 'Yes' : 'No';
|
|
1708
|
-
}
|
|
1709
|
-
else {
|
|
1710
|
-
return value ? definition.enum[0] || 'Yes' : definition.enum[1] || 'No';
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
/*
|
|
1716
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1717
|
-
*
|
|
1718
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1719
|
-
* you may not use this file except in compliance with the License.
|
|
1720
|
-
* You may obtain a copy of the License at
|
|
1721
|
-
*
|
|
1722
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1723
|
-
*
|
|
1724
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1725
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1726
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1727
|
-
* See the License for the specific language governing permissions and
|
|
1728
|
-
* limitations under the License.
|
|
1729
|
-
*/
|
|
1730
|
-
const moment$2 = momentImported;
|
|
1731
|
-
moment$2.locale(localStorage.getItem('langKey'));
|
|
1732
|
-
class DateTypeConverter {
|
|
1733
|
-
getTypeString() {
|
|
1734
|
-
return 'date';
|
|
1735
|
-
}
|
|
1736
|
-
convert(value, definition) {
|
|
1737
|
-
if (!value) {
|
|
1738
|
-
return '-';
|
|
1739
|
-
}
|
|
1740
|
-
return moment$2(value).format('DD-MM-YYYY, hh:mm A');
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
/*
|
|
1745
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1746
|
-
*
|
|
1747
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1748
|
-
* you may not use this file except in compliance with the License.
|
|
1749
|
-
* You may obtain a copy of the License at
|
|
1750
|
-
*
|
|
1751
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1752
|
-
*
|
|
1753
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1754
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1755
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1756
|
-
* See the License for the specific language governing permissions and
|
|
1757
|
-
* limitations under the License.
|
|
1758
|
-
*/
|
|
1759
|
-
class EnumTypeConverter {
|
|
1760
|
-
getTypeString() {
|
|
1761
|
-
return 'enum';
|
|
1762
|
-
}
|
|
1763
|
-
convert(value, definition) {
|
|
1764
|
-
return definition.enum[value];
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
/*
|
|
1769
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1770
|
-
*
|
|
1771
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1772
|
-
* you may not use this file except in compliance with the License.
|
|
1773
|
-
* You may obtain a copy of the License at
|
|
1774
|
-
*
|
|
1775
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1776
|
-
*
|
|
1777
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1778
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1779
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1780
|
-
* See the License for the specific language governing permissions and
|
|
1781
|
-
* limitations under the License.
|
|
1782
|
-
*/
|
|
1783
|
-
class StringReplaceUnderscoreTypeConverter {
|
|
1784
|
-
constructor() {
|
|
1785
|
-
this.regExpStringRemoveUnderscore = /_/g;
|
|
1786
|
-
}
|
|
1787
|
-
getTypeString() {
|
|
1788
|
-
return 'stringReplaceUnderscore';
|
|
1789
|
-
}
|
|
1790
|
-
convert(value, definition) {
|
|
1791
|
-
return value.replace(this.regExpStringRemoveUnderscore, ' ');
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
/*
|
|
1796
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1797
|
-
*
|
|
1798
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1799
|
-
* you may not use this file except in compliance with the License.
|
|
1800
|
-
* You may obtain a copy of the License at
|
|
1801
|
-
*
|
|
1802
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1803
|
-
*
|
|
1804
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1805
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1806
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1807
|
-
* See the License for the specific language governing permissions and
|
|
1808
|
-
* limitations under the License.
|
|
1809
|
-
*/
|
|
1810
|
-
class RelatedFilesTypeConverter {
|
|
1811
|
-
getTypeString() {
|
|
1812
|
-
return 'relatedFiles';
|
|
1813
|
-
}
|
|
1814
|
-
convert(value, definition) {
|
|
1815
|
-
return value.length || '-';
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
/*
|
|
1820
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1821
|
-
*
|
|
1822
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1823
|
-
* you may not use this file except in compliance with the License.
|
|
1824
|
-
* You may obtain a copy of the License at
|
|
1825
|
-
*
|
|
1826
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1827
|
-
*
|
|
1828
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1829
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1830
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1831
|
-
* See the License for the specific language governing permissions and
|
|
1832
|
-
* limitations under the License.
|
|
1833
|
-
*/
|
|
1834
|
-
const stringTypeConverter = new StringTypeConverter();
|
|
1835
|
-
const booleanTypeConverter = new BooleanTypeConverter();
|
|
1836
|
-
const dateTypeConverter = new DateTypeConverter();
|
|
1837
|
-
const enumTypeConverter = new EnumTypeConverter();
|
|
1838
|
-
const stringReplaceUnderscoreTypeConverter = new StringReplaceUnderscoreTypeConverter();
|
|
1839
|
-
const relatedFilesTypeConverter = new RelatedFilesTypeConverter();
|
|
1840
|
-
// TODO: Via injection
|
|
1841
|
-
const TYPE_CONVERTERS = [
|
|
1842
|
-
stringTypeConverter,
|
|
1843
|
-
booleanTypeConverter,
|
|
1844
|
-
dateTypeConverter,
|
|
1845
|
-
enumTypeConverter,
|
|
1846
|
-
stringReplaceUnderscoreTypeConverter,
|
|
1847
|
-
relatedFilesTypeConverter,
|
|
1848
|
-
];
|
|
1849
|
-
|
|
1850
|
-
/*
|
|
1851
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1852
|
-
*
|
|
1853
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1854
|
-
* you may not use this file except in compliance with the License.
|
|
1855
|
-
* You may obtain a copy of the License at
|
|
1856
|
-
*
|
|
1857
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1858
|
-
*
|
|
1859
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1860
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1861
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1862
|
-
* See the License for the specific language governing permissions and
|
|
1863
|
-
* limitations under the License.
|
|
1864
|
-
*/
|
|
1865
|
-
class ViewContentService {
|
|
1866
|
-
constructor() {
|
|
1867
|
-
this.converters = {};
|
|
1868
|
-
this.defaultConverter = new StringTypeConverter();
|
|
1869
|
-
TYPE_CONVERTERS.forEach(converter => this.addConverter(converter));
|
|
1870
|
-
}
|
|
1871
|
-
get(value, definition) {
|
|
1872
|
-
if (!definition.viewType) {
|
|
1873
|
-
definition.viewType = typeof value;
|
|
1874
|
-
}
|
|
1875
|
-
if (typeof this.converters[definition.viewType] !== 'undefined') {
|
|
1876
|
-
return this.converters[definition.viewType].convert(value, definition);
|
|
1877
|
-
}
|
|
1878
|
-
else {
|
|
1879
|
-
return this.defaultConverter.convert(value, definition);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
addConverter(converter) {
|
|
1883
|
-
if (typeof this.converters[converter.getTypeString()] !== 'undefined') {
|
|
1884
|
-
throw new Error('Converter with name ' + converter.getTypeString() + ' already exists');
|
|
1885
|
-
}
|
|
1886
|
-
this.converters[converter.getTypeString()] = converter;
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
ViewContentService.ɵprov = ɵɵdefineInjectable({ factory: function ViewContentService_Factory() { return new ViewContentService(); }, token: ViewContentService, providedIn: "root" });
|
|
1890
|
-
ViewContentService.decorators = [
|
|
1891
|
-
{ type: Injectable, args: [{
|
|
1892
|
-
providedIn: 'root',
|
|
1893
|
-
},] }
|
|
1894
|
-
];
|
|
1895
|
-
ViewContentService.ctorParameters = () => [];
|
|
1896
|
-
|
|
1897
|
-
/*
|
|
1898
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
1899
|
-
*
|
|
1900
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1901
|
-
* you may not use this file except in compliance with the License.
|
|
1902
|
-
* You may obtain a copy of the License at
|
|
1903
|
-
*
|
|
1904
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1905
|
-
*
|
|
1906
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1907
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1908
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1909
|
-
* See the License for the specific language governing permissions and
|
|
1910
|
-
* limitations under the License.
|
|
1911
|
-
*/
|
|
1912
|
-
class ListComponent {
|
|
1913
|
-
constructor(viewContentService, logger) {
|
|
1914
|
-
this.viewContentService = viewContentService;
|
|
1915
|
-
this.logger = logger;
|
|
1916
|
-
this.actions = [];
|
|
1917
|
-
this.rowClicked = new EventEmitter();
|
|
1918
|
-
this.paginationClicked = new EventEmitter();
|
|
1919
|
-
this.paginationSet = new EventEmitter();
|
|
1920
|
-
this.search = new EventEmitter();
|
|
1921
|
-
this.sortChanged = new EventEmitter();
|
|
1922
|
-
this.headerProvided = false;
|
|
1923
|
-
this.regExpStringRemoveUnderscore = /_/g;
|
|
1924
|
-
this.sort$ = new BehaviorSubject({
|
|
1925
|
-
state: { name: '', direction: 'DESC' },
|
|
1926
|
-
isSorting: false,
|
|
1927
|
-
});
|
|
1928
|
-
this.viewListAs = localStorage.getItem('viewListAs') || 'table';
|
|
1929
|
-
}
|
|
1930
|
-
loadPaginationSize() {
|
|
1931
|
-
const entries = localStorage.getItem(`${this.paginationIdentifier}${ListComponent.PAGINATION_SIZE}`);
|
|
1932
|
-
if (entries !== null) {
|
|
1933
|
-
this.pagination.size = +entries;
|
|
1934
|
-
this.paginationSet.emit(+entries);
|
|
1935
|
-
this.logger.debug('Pagination loaded from local storage for this list. Current: ', entries);
|
|
1936
|
-
}
|
|
1937
|
-
else {
|
|
1938
|
-
this.logger.debug('Pagination does NOT exist in local storage for this list. Will use default. Change it to create an entry.');
|
|
1939
|
-
}
|
|
1940
|
-
this.paginationSet.emit();
|
|
1941
|
-
}
|
|
1942
|
-
setPaginationSize(numberOfEntries) {
|
|
1943
|
-
localStorage.setItem(`${this.paginationIdentifier}${ListComponent.PAGINATION_SIZE}`, numberOfEntries);
|
|
1944
|
-
this.pagination.size = numberOfEntries;
|
|
1945
|
-
this.logger.debug('Pagination set in local storage for this list: ', numberOfEntries);
|
|
1946
|
-
this.paginationSet.emit(numberOfEntries);
|
|
1947
|
-
}
|
|
1948
|
-
ngOnInit() {
|
|
1949
|
-
if (this.pagination) {
|
|
1950
|
-
this.loadPaginationSize();
|
|
1951
|
-
}
|
|
1952
|
-
if (this.initialSortState) {
|
|
1953
|
-
this.sort$.next(this.initialSortState);
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
ngOnChanges(changes) {
|
|
1957
|
-
if (changes.items && changes.items.currentValue) {
|
|
1958
|
-
this.transformListItemsMatchFields();
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
ngAfterViewInit() {
|
|
1962
|
-
if (this.isSearchable) {
|
|
1963
|
-
fromEvent(this.searchBox.nativeElement, 'keyup')
|
|
1964
|
-
.pipe(debounceTime(500))
|
|
1965
|
-
.subscribe(() => {
|
|
1966
|
-
const value = this.searchBox.nativeElement.value;
|
|
1967
|
-
if (this.search.observers.length > 0) {
|
|
1968
|
-
// custom search callbak is specified, perhaps to query on the server side
|
|
1969
|
-
this.search.emit(value);
|
|
1970
|
-
}
|
|
1971
|
-
else {
|
|
1972
|
-
this.searchModel = value;
|
|
1973
|
-
}
|
|
1974
|
-
});
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
transformListItemsMatchFields() {
|
|
1978
|
-
if (this.items && this.fields) {
|
|
1979
|
-
this.items.forEach(item => {
|
|
1980
|
-
item.listItemFields = this.fields.map(field => ({
|
|
1981
|
-
key: field.key,
|
|
1982
|
-
label: field.label,
|
|
1983
|
-
type: field.type || '',
|
|
1984
|
-
value: this.resolveObject(field, item),
|
|
1985
|
-
}));
|
|
1986
|
-
});
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
onClickRow(item) {
|
|
1990
|
-
this.rowClicked.emit(item);
|
|
1991
|
-
}
|
|
1992
|
-
resolveObject(definition, obj) {
|
|
1993
|
-
const definitionKey = definition.key;
|
|
1994
|
-
const customPropString = '$.';
|
|
1995
|
-
const key = definitionKey.includes(customPropString)
|
|
1996
|
-
? definitionKey.split(customPropString)[1]
|
|
1997
|
-
: definitionKey;
|
|
1998
|
-
const resolvedObjValue = key.split('.').reduce(function (prev, curr) {
|
|
1999
|
-
return prev ? prev[curr] : null;
|
|
2000
|
-
}, obj || self);
|
|
2001
|
-
return this.viewContentService.get(resolvedObjValue, definition);
|
|
2002
|
-
}
|
|
2003
|
-
switchView(type) {
|
|
2004
|
-
localStorage.setItem('viewListAs', type);
|
|
2005
|
-
this.viewListAs = type;
|
|
2006
|
-
}
|
|
2007
|
-
getTotalPageCount() {
|
|
2008
|
-
return Math.ceil(this.pagination.collectionSize / this.pagination.size);
|
|
2009
|
-
}
|
|
2010
|
-
onClickPagination(page) {
|
|
2011
|
-
this.paginationClicked.emit(page);
|
|
2012
|
-
}
|
|
2013
|
-
handleFieldClick(key, sortable) {
|
|
2014
|
-
const desc = 'DESC';
|
|
2015
|
-
const asc = 'ASC';
|
|
2016
|
-
if (!sortable) {
|
|
2017
|
-
return;
|
|
2018
|
-
}
|
|
2019
|
-
this.sort$.pipe(take(1)).subscribe(sort => {
|
|
2020
|
-
let newState;
|
|
2021
|
-
if (sort.state.name === key) {
|
|
2022
|
-
if (!sort.isSorting) {
|
|
2023
|
-
newState = { state: Object.assign(Object.assign({}, sort.state), { direction: desc }), isSorting: true };
|
|
2024
|
-
}
|
|
2025
|
-
else {
|
|
2026
|
-
if (sort.state.direction === desc) {
|
|
2027
|
-
newState = Object.assign(Object.assign({}, sort), { state: Object.assign(Object.assign({}, sort.state), { direction: asc }) });
|
|
2028
|
-
}
|
|
2029
|
-
else {
|
|
2030
|
-
newState = { state: Object.assign(Object.assign({}, sort.state), { direction: desc }), isSorting: false };
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
else {
|
|
2035
|
-
newState = { state: { name: key, direction: desc }, isSorting: true };
|
|
2036
|
-
}
|
|
2037
|
-
this.sort$.next(newState);
|
|
2038
|
-
this.sortChanged.emit(newState);
|
|
2039
|
-
});
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
ListComponent.PAGINATION_SIZE = 'PaginationSize';
|
|
2043
|
-
ListComponent.decorators = [
|
|
2044
|
-
{ type: Component, args: [{
|
|
2045
|
-
selector: 'valtimo-list',
|
|
2046
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div *ngIf=\"(items?.length > 0 && fields?.length > 0) || header\">\n <div\n class=\"d-flex align-items-center search-holder bg-light\"\n [ngClass]=\"{'pb-4 pt-4': !header}\"\n *ngIf=\"isSearchable || viewMode || header\"\n >\n <div class=\"align-self-start\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n\n <div class=\"ml-auto row\">\n <input\n *ngIf=\"isSearchable\"\n class=\"form-control col-sm-8\"\n type=\"text\"\n placeholder=\"Search...\"\n #searchBox\n />\n\n <div\n class=\"switch-view-holder btn-group col-sm-4 mt-1 mt-sm-0\"\n role=\"group\"\n *ngIf=\"viewMode\"\n >\n <button\n class=\"btn\"\n [ngClass]=\"viewListAs === 'table' ? 'btn-primary' : 'btn-default'\"\n (click)=\"switchView('table')\"\n >\n <i class=\"mdi mdi-view-headline\"></i>\n </button>\n <button\n class=\"btn\"\n [ngClass]=\"viewListAs === 'tile' ? 'btn-primary' : 'btn-default'\"\n (click)=\"switchView('tile')\"\n >\n <i class=\"mdi mdi-view-module\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <ng-content select=\"[tabs]\"></ng-content>\n\n <div *ngIf=\"items?.length > 0 && fields?.length > 0\">\n <div class=\"table-responsive noSwipe\" *ngIf=\"!viewMode || viewListAs === 'table'\">\n <table class=\"table table-striped table-hover m-0\" *ngIf=\"sort$ | async as sort\">\n <thead>\n <tr>\n <th\n *ngFor=\"let field of fields\"\n (click)=\"handleFieldClick(field.key, field.sortable)\"\n [ngClass]=\"{\n sortable: field.sortable,\n 'is-being-sorted': field.key === sort.state.name && sort.isSorting,\n ascending: sort.state.direction === 'ASC'\n }\"\n >\n {{ field.label }}\n </th>\n <th *ngFor=\"let action of actions\">\n {{ action.columnName }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n [ngClass]=\"{'click-able': this.rowClicked.observers.length > 0}\"\n *ngFor=\"let item of items | listFilter: searchModel\"\n (click)=\"onClickRow(item)\"\n >\n <td class=\"align-top\" *ngFor=\"let listItemField of item.listItemFields\">\n <ng-container *ngIf=\"listItemField.type === ''\">\n {{ listItemField.value || '-' }}\n </ng-container>\n\n <ng-container\n *ngIf=\"listItemField.type === 'dropdownActions'\"\n [ngTemplateOutlet]=\"dropdownActions\"\n [ngTemplateOutletContext]=\"{listItemField: listItemField, item: item}\"\n ></ng-container>\n </td>\n <td class=\"align-top\" *ngFor=\"let action of actions\">\n <i\n class=\"action-icon\"\n style=\"cursor: pointer\"\n [ngClass]=\"action.iconClass\"\n (click)=\"action.callback(item)\"\n ></i>\n </td>\n </tr>\n <tr>\n <td *ngIf=\"(items | listFilter: searchModel).length === 0\" [colSpan]=\"fields.length\">\n {{ 'list.noMatchingItems' | translate }}<i>\"{{ searchModel }}\"</i>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class=\"container-fluid\" *ngIf=\"viewMode && viewListAs === 'tile'\">\n <div class=\"row p-2\">\n <div\n class=\"col-12 col-sm-6 col-xl-4 p-2\"\n *ngFor=\"let item of items | listFilter: searchModel\"\n (click)=\"onClickRow(item)\"\n >\n <div class=\"click-able tile-holder p-4\">\n <dl class=\"row mb-0\" *ngFor=\"let listItemField of item.listItemFields\">\n <dt class=\"col-12 col-md-5 text-xl-right\">{{ listItemField.label }}</dt>\n <dd class=\"col-12 col-md-7\">{{ listItemField.value || '-' }}</dd>\n </dl>\n </div>\n </div>\n <div class=\"col-12\" *ngIf=\"(items | listFilter: searchModel).length === 0\">\n {{ 'list.noMatchingItems' | translate }}<i>\"{{ searchModel }}\"</i>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"pagination-holder bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && items?.length > 0 && fields?.length > 0\"\n >\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.page, total: getTotalPageCount()}\n }}</strong>\n <br />\n {{\n pagination.collectionSize === 1\n ? ('list.showingResult' | translate: {number: (items | listFilter: searchModel).length})\n : ('list.showingResults'\n | translate\n : {\n number: (items | listFilter: searchModel).length,\n total: pagination.collectionSize\n })\n }}\n </div>\n <div class=\"col-4 text-center\">\n {{ 'list.show' | translate }}\n <select [(ngModel)]=\"pagination.size\" (ngModelChange)=\"setPaginationSize($event)\">\n <option [ngValue]=\"10\">10</option>\n <option [ngValue]=\"25\">25</option>\n <option [ngValue]=\"50\">50</option>\n <option [ngValue]=\"100\">100</option>\n </select>\n {{ 'list.entries' | translate }}\n </div>\n <div class=\"col-4\">\n <ngb-pagination\n *ngIf=\"pagination.collectionSize > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.collectionSize\"\n [(page)]=\"pagination.page\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.maxPaginationItemSize\"\n [rotate]=\"true\"\n (pageChange)=\"onClickPagination(pagination.page)\"\n ></ngb-pagination>\n </div>\n </div>\n\n <div id=\"no-results\" class=\"p-5\" *ngIf=\"items?.length === 0\">\n {{ 'list.noResults' | translate }}\n </div>\n\n <div id=\"no-field-definitions\" class=\"p-5\" *ngIf=\"items?.length > 0 && fields?.length === 0\">\n {{ 'list.noFieldDefinitions' | translate }}\n </div>\n</div>\n\n<ng-template #dropdownActions let-listItemField=\"listItemField\" let-item=\"item\">\n <div class=\"dropdown\" *ngIf=\"listItemField?.value.length > 0\">\n <a\n style=\"cursor: pointer\"\n class=\"dropdown-toggle d-block\"\n id=\"dropdownMenu\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n <i class=\"action-icon icon mdi mdi-more-vert\"></i>\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenu\">\n <a\n (click)=\"action.callback(item)\"\n class=\"dropdown-item p-2\"\n *ngFor=\"let action of listItemField.value\"\n >\n <ng-container *ngIf=\"action.iconClass != null\">\n <i [ngClass]=\"action.iconClass\"></i>\n </ng-container>\n {{ action?.label || '-' }}\n </a>\n </div>\n </div>\n</ng-template>\n",
|
|
2047
|
-
styles: ["@charset \"UTF-8\";\n/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.table{table-layout:fixed}.table-responsive{overflow-x:visible}.click-able{cursor:pointer}.pagination-holder{border-top:1px solid #dee2e6}.search-holder{border-bottom:1px solid #dee2e6;height:80px;padding-left:18px;padding-right:18px}.switch-view-holder i{font-size:1.8rem;line-height:1.2rem;margin-top:9px}.tile-holder{background-color:#f5f5f5;border:1px solid transparent}.tile-holder:hover{background-color:#eee;border:1px solid #dee2e6}.page-count{margin-bottom:1rem}td:first-child,th:first-child{padding-left:25px}th.sortable{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;user-select:none}th.sortable:after{content:\" \uF0DD\";font-family:Font Awesome\\ 5 Free;margin:auto 0 auto 5px;opacity:0;position:absolute;transition:all .15s ease}th.sortable.is-being-sorted.ascending:after{transform:rotate(-180deg)}th.sortable:hover:after{opacity:.5}th.sortable.is-being-sorted:after{opacity:1}.action-icon{font-size:16px}"]
|
|
2048
|
-
},] }
|
|
2049
|
-
];
|
|
2050
|
-
ListComponent.ctorParameters = () => [
|
|
2051
|
-
{ type: ViewContentService },
|
|
2052
|
-
{ type: NGXLogger }
|
|
2053
|
-
];
|
|
2054
|
-
ListComponent.propDecorators = {
|
|
2055
|
-
items: [{ type: Input }],
|
|
2056
|
-
fields: [{ type: Input }],
|
|
2057
|
-
pagination: [{ type: Input }],
|
|
2058
|
-
viewMode: [{ type: Input }],
|
|
2059
|
-
isSearchable: [{ type: Input }],
|
|
2060
|
-
header: [{ type: Input }],
|
|
2061
|
-
actions: [{ type: Input }],
|
|
2062
|
-
paginationIdentifier: [{ type: Input }],
|
|
2063
|
-
initialSortState: [{ type: Input }],
|
|
2064
|
-
rowClicked: [{ type: Output }],
|
|
2065
|
-
paginationClicked: [{ type: Output }],
|
|
2066
|
-
paginationSet: [{ type: Output }],
|
|
2067
|
-
search: [{ type: Output }],
|
|
2068
|
-
sortChanged: [{ type: Output }],
|
|
2069
|
-
searchBox: [{ type: ViewChild, args: ['searchBox',] }]
|
|
2070
|
-
};
|
|
2071
|
-
|
|
2072
|
-
/*
|
|
2073
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2074
|
-
*
|
|
2075
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2076
|
-
* you may not use this file except in compliance with the License.
|
|
2077
|
-
* You may obtain a copy of the License at
|
|
2078
|
-
*
|
|
2079
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2080
|
-
*
|
|
2081
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2082
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2083
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2084
|
-
* See the License for the specific language governing permissions and
|
|
2085
|
-
* limitations under the License.
|
|
2086
|
-
*/
|
|
2087
|
-
class ListFilterPipe {
|
|
2088
|
-
transform(list, filterText) {
|
|
2089
|
-
list = list || [];
|
|
2090
|
-
if (!filterText) {
|
|
2091
|
-
return list;
|
|
2092
|
-
}
|
|
2093
|
-
return list.filter(item => Object.keys(item).some(k => item[k] != null && item[k].toString().toLowerCase().includes(filterText.toLowerCase())));
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
ListFilterPipe.decorators = [
|
|
2097
|
-
{ type: Pipe, args: [{
|
|
2098
|
-
name: 'listFilter',
|
|
2099
|
-
},] }
|
|
2100
|
-
];
|
|
2101
|
-
|
|
2102
|
-
/*
|
|
2103
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2104
|
-
*
|
|
2105
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2106
|
-
* you may not use this file except in compliance with the License.
|
|
2107
|
-
* You may obtain a copy of the License at
|
|
2108
|
-
*
|
|
2109
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2110
|
-
*
|
|
2111
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2112
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2113
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2114
|
-
* See the License for the specific language governing permissions and
|
|
2115
|
-
* limitations under the License.
|
|
2116
|
-
*/
|
|
2117
|
-
/**
|
|
2118
|
-
* Component used to display a card element
|
|
2119
|
-
*/
|
|
2120
|
-
class CardComponent {
|
|
2121
|
-
constructor() { }
|
|
2122
|
-
ngOnInit() { }
|
|
2123
|
-
}
|
|
2124
|
-
CardComponent.decorators = [
|
|
2125
|
-
{ type: Component, args: [{
|
|
2126
|
-
selector: 'valtimo-card',
|
|
2127
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"card card-border-color card-border-color-primary\">\n <div *ngIf=\"title || subtitle\" class=\"card-header card-header-divider\">\n <span *ngIf=\"title\">{{ title }}</span>\n <span *ngIf=\"subtitle\" class=\"card-subtitle\">{{ subtitle }}</span>\n </div>\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n</div>\n",
|
|
2128
|
-
styles: [""]
|
|
2129
|
-
},] }
|
|
2130
|
-
];
|
|
2131
|
-
CardComponent.ctorParameters = () => [];
|
|
2132
|
-
CardComponent.propDecorators = {
|
|
2133
|
-
title: [{ type: Input }],
|
|
2134
|
-
subtitle: [{ type: Input }]
|
|
2135
|
-
};
|
|
2136
|
-
|
|
2137
|
-
/*
|
|
2138
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2139
|
-
*
|
|
2140
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2141
|
-
* you may not use this file except in compliance with the License.
|
|
2142
|
-
* You may obtain a copy of the License at
|
|
2143
|
-
*
|
|
2144
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2145
|
-
*
|
|
2146
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2147
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2148
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2149
|
-
* See the License for the specific language governing permissions and
|
|
2150
|
-
* limitations under the License.
|
|
2151
|
-
*/
|
|
2152
|
-
class CardModule {
|
|
2153
|
-
}
|
|
2154
|
-
CardModule.decorators = [
|
|
2155
|
-
{ type: NgModule, args: [{
|
|
2156
|
-
declarations: [CardComponent],
|
|
2157
|
-
imports: [CommonModule],
|
|
2158
|
-
exports: [CardComponent],
|
|
2159
|
-
},] }
|
|
2160
|
-
];
|
|
2161
|
-
|
|
2162
|
-
/*
|
|
2163
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2164
|
-
*
|
|
2165
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2166
|
-
* you may not use this file except in compliance with the License.
|
|
2167
|
-
* You may obtain a copy of the License at
|
|
2168
|
-
*
|
|
2169
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2170
|
-
*
|
|
2171
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2172
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2173
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2174
|
-
* See the License for the specific language governing permissions and
|
|
2175
|
-
* limitations under the License.
|
|
2176
|
-
*/
|
|
2177
|
-
class ListModule {
|
|
2178
|
-
}
|
|
2179
|
-
ListModule.decorators = [
|
|
2180
|
-
{ type: NgModule, args: [{
|
|
2181
|
-
declarations: [ListComponent, ListFilterPipe],
|
|
2182
|
-
imports: [CommonModule, CardModule, NgbPaginationModule, FormsModule, TranslateModule],
|
|
2183
|
-
exports: [ListComponent, ListFilterPipe],
|
|
2184
|
-
},] }
|
|
2185
|
-
];
|
|
2186
|
-
|
|
2187
|
-
/*
|
|
2188
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2189
|
-
*
|
|
2190
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2191
|
-
* you may not use this file except in compliance with the License.
|
|
2192
|
-
* You may obtain a copy of the License at
|
|
2193
|
-
*
|
|
2194
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2195
|
-
*
|
|
2196
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2197
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2198
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2199
|
-
* See the License for the specific language governing permissions and
|
|
2200
|
-
* limitations under the License.
|
|
2201
|
-
*/
|
|
2202
|
-
class PageHeaderComponent {
|
|
2203
|
-
constructor() { }
|
|
2204
|
-
ngOnInit() { }
|
|
2205
|
-
}
|
|
2206
|
-
PageHeaderComponent.decorators = [
|
|
2207
|
-
{ type: Component, args: [{
|
|
2208
|
-
selector: 'valtimo-page-header',
|
|
2209
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"page-head\">\n <valtimo-page-title></valtimo-page-title>\n <valtimo-breadcrumb-navigation></valtimo-breadcrumb-navigation>\n</div>\n",
|
|
2210
|
-
styles: [""]
|
|
2211
|
-
},] }
|
|
2212
|
-
];
|
|
2213
|
-
PageHeaderComponent.ctorParameters = () => [];
|
|
2214
|
-
|
|
2215
|
-
/*
|
|
2216
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2217
|
-
*
|
|
2218
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2219
|
-
* you may not use this file except in compliance with the License.
|
|
2220
|
-
* You may obtain a copy of the License at
|
|
2221
|
-
*
|
|
2222
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2223
|
-
*
|
|
2224
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2225
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2226
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2227
|
-
* See the License for the specific language governing permissions and
|
|
2228
|
-
* limitations under the License.
|
|
2229
|
-
*/
|
|
2230
|
-
class BreadcrumbNavigationComponent {
|
|
2231
|
-
constructor(router, route) {
|
|
2232
|
-
this.router = router;
|
|
2233
|
-
this.route = route;
|
|
2234
|
-
this.breadcrumbs = [];
|
|
2235
|
-
this.appTitle = 'Valtimo';
|
|
2236
|
-
this.routerSub = Subscription.EMPTY;
|
|
2237
|
-
}
|
|
2238
|
-
ngOnInit() {
|
|
2239
|
-
this.setBreadcrumbs(this.route);
|
|
2240
|
-
this.routerSub = this.router.events
|
|
2241
|
-
.pipe(filter(event => event instanceof NavigationEnd))
|
|
2242
|
-
.pipe(map(() => this.route))
|
|
2243
|
-
.pipe(map(route => {
|
|
2244
|
-
while (route.firstChild) {
|
|
2245
|
-
route = route.firstChild;
|
|
2246
|
-
}
|
|
2247
|
-
return route;
|
|
2248
|
-
}))
|
|
2249
|
-
.pipe(filter(route => route.outlet === PRIMARY_OUTLET))
|
|
2250
|
-
.subscribe(route => {
|
|
2251
|
-
this.setBreadcrumbs(route);
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
setBreadcrumbs(route) {
|
|
2255
|
-
while (route.firstChild) {
|
|
2256
|
-
route = route.firstChild;
|
|
2257
|
-
}
|
|
2258
|
-
if (route.outlet === PRIMARY_OUTLET) {
|
|
2259
|
-
const snapshot = route.snapshot;
|
|
2260
|
-
const activeRoute = {
|
|
2261
|
-
url: snapshot.url.join('/'),
|
|
2262
|
-
path: snapshot.routeConfig.path,
|
|
2263
|
-
label: snapshot.data['title'],
|
|
2264
|
-
params: snapshot.params,
|
|
2265
|
-
};
|
|
2266
|
-
this.generateBreadcrumbs(activeRoute);
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
generateBreadcrumbs(activeBreadcrumb) {
|
|
2270
|
-
this.breadcrumbs = [];
|
|
2271
|
-
this.router.config.map(routerConfig => {
|
|
2272
|
-
if (activeBreadcrumb.path.indexOf(routerConfig.path + '/') === 0 &&
|
|
2273
|
-
activeBreadcrumb.path !== routerConfig.path &&
|
|
2274
|
-
routerConfig.path !== '') {
|
|
2275
|
-
const parentRoute = {
|
|
2276
|
-
url: routerConfig.path.replace(/:(.+?)\b/g, (_, p1) => activeBreadcrumb.params[p1]),
|
|
2277
|
-
path: routerConfig.path,
|
|
2278
|
-
label: routerConfig.data['title'],
|
|
2279
|
-
params: activeBreadcrumb.params,
|
|
2280
|
-
};
|
|
2281
|
-
const exist = this.breadcrumbs.findIndex(item => item.url === parentRoute.url);
|
|
2282
|
-
if (exist === -1) {
|
|
2283
|
-
this.breadcrumbs.push(parentRoute);
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
});
|
|
2287
|
-
}
|
|
2288
|
-
ngOnDestroy() {
|
|
2289
|
-
this.routerSub.unsubscribe();
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
BreadcrumbNavigationComponent.decorators = [
|
|
2293
|
-
{ type: Component, args: [{
|
|
2294
|
-
selector: 'valtimo-breadcrumb-navigation',
|
|
2295
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav aria-label=\"breadcrumb\" role=\"navigation\">\n <ol class=\"breadcrumb page-head-nav\">\n <li class=\"breadcrumb-item\">\n <a [routerLink]=\"['/']\">{{ appTitle }}</a>\n </li>\n <li class=\"breadcrumb-item\" *ngFor=\"let item of breadcrumbs\">\n <a [routerLink]=\"[item.url]\">{{ item.label | translate }}</a>\n </li>\n </ol>\n</nav>\n",
|
|
2296
|
-
styles: [""]
|
|
2297
|
-
},] }
|
|
2298
|
-
];
|
|
2299
|
-
BreadcrumbNavigationComponent.ctorParameters = () => [
|
|
2300
|
-
{ type: Router },
|
|
2301
|
-
{ type: ActivatedRoute }
|
|
2302
|
-
];
|
|
2303
|
-
|
|
2304
|
-
/*
|
|
2305
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2306
|
-
*
|
|
2307
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2308
|
-
* you may not use this file except in compliance with the License.
|
|
2309
|
-
* You may obtain a copy of the License at
|
|
2310
|
-
*
|
|
2311
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2312
|
-
*
|
|
2313
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2314
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2315
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2316
|
-
* See the License for the specific language governing permissions and
|
|
2317
|
-
* limitations under the License.
|
|
2318
|
-
*/
|
|
2319
|
-
class BreadcrumbNavigationModule {
|
|
2320
|
-
}
|
|
2321
|
-
BreadcrumbNavigationModule.decorators = [
|
|
2322
|
-
{ type: NgModule, args: [{
|
|
2323
|
-
declarations: [BreadcrumbNavigationComponent],
|
|
2324
|
-
imports: [CommonModule, RouterModule, TranslateModule],
|
|
2325
|
-
exports: [BreadcrumbNavigationComponent],
|
|
2326
|
-
},] }
|
|
2327
|
-
];
|
|
2328
|
-
|
|
2329
|
-
/*
|
|
2330
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2331
|
-
*
|
|
2332
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2333
|
-
* you may not use this file except in compliance with the License.
|
|
2334
|
-
* You may obtain a copy of the License at
|
|
2335
|
-
*
|
|
2336
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2337
|
-
*
|
|
2338
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2339
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2340
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2341
|
-
* See the License for the specific language governing permissions and
|
|
2342
|
-
* limitations under the License.
|
|
2343
|
-
*/
|
|
2344
|
-
class PageHeaderModule {
|
|
2345
|
-
}
|
|
2346
|
-
PageHeaderModule.decorators = [
|
|
2347
|
-
{ type: NgModule, args: [{
|
|
2348
|
-
declarations: [PageHeaderComponent],
|
|
2349
|
-
imports: [CommonModule, PageTitleModule, BreadcrumbNavigationModule],
|
|
2350
|
-
exports: [PageHeaderComponent],
|
|
2351
|
-
},] }
|
|
2352
|
-
];
|
|
2353
|
-
|
|
2354
|
-
/*
|
|
2355
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2356
|
-
*
|
|
2357
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2358
|
-
* you may not use this file except in compliance with the License.
|
|
2359
|
-
* You may obtain a copy of the License at
|
|
2360
|
-
*
|
|
2361
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2362
|
-
*
|
|
2363
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2364
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2365
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2366
|
-
* See the License for the specific language governing permissions and
|
|
2367
|
-
* limitations under the License.
|
|
2368
|
-
*/
|
|
2369
|
-
/**
|
|
2370
|
-
* Component used to display a widget element
|
|
2371
|
-
*/
|
|
2372
|
-
class WidgetComponent {
|
|
2373
|
-
ngOnInit() {
|
|
2374
|
-
this.setCardClassName();
|
|
2375
|
-
this.setType();
|
|
2376
|
-
this.setAdditionalClasses();
|
|
2377
|
-
this.setContrast();
|
|
2378
|
-
this.setDivider();
|
|
2379
|
-
this.setCollapse();
|
|
2380
|
-
}
|
|
2381
|
-
toggleContent() {
|
|
2382
|
-
if (this.collapseAble) {
|
|
2383
|
-
this.isCollapsed = !this.isCollapsed;
|
|
2384
|
-
}
|
|
2385
|
-
}
|
|
2386
|
-
setCardClassName() {
|
|
2387
|
-
this.cardClassName = 'card-full-default';
|
|
2388
|
-
}
|
|
2389
|
-
setType() {
|
|
2390
|
-
if (this.type) {
|
|
2391
|
-
this.cardClassName = `card-full-${this.type}`;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
setAdditionalClasses() {
|
|
2395
|
-
if (this.additionalClasses) {
|
|
2396
|
-
this.cardClassName = `${this.cardClassName} ${this.additionalClasses}`;
|
|
2397
|
-
}
|
|
2398
|
-
}
|
|
2399
|
-
setContrast() {
|
|
2400
|
-
if (this.contrast) {
|
|
2401
|
-
this.contrastClass = 'card-header-contrast';
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
setDivider() {
|
|
2405
|
-
if (this.divider) {
|
|
2406
|
-
this.dividerClass = 'card-header-divider';
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
setCollapse() {
|
|
2410
|
-
this.isCollapsed = !(this.collapseAble && this.collapse === 'hide');
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
WidgetComponent.decorators = [
|
|
2414
|
-
{ type: Component, args: [{
|
|
2415
|
-
selector: 'valtimo-widget',
|
|
2416
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"card card-border card-contrast {{ cardClassName }}\">\n <div class=\"card-header {{ contrastClass }} {{ dividerClass }}\" *ngIf=\"title || subtitle\">\n <div class=\"row\">\n <div class=\"col-7\" [ngClass]=\"{clickable: collapseAble}\" (click)=\"toggleContent()\">\n <!-- Title -->\n <div *ngIf=\"title\" class=\"text-truncate\">{{ title }}</div>\n <!-- Sub title -->\n <div *ngIf=\"subtitle\" class=\"card-subtitle text-truncate\">{{ subtitle }}</div>\n </div>\n\n <!-- Tools-->\n <div class=\"tools col-5 text-right\">\n <!-- Collapse content -->\n <a\n class=\"icon mdi\"\n *ngIf=\"collapseAble\"\n [ngClass]=\"{'mdi-chevron-up': isCollapsed, 'mdi-chevron-down': !isCollapsed}\"\n (click)=\"toggleContent()\"\n ></a>\n </div>\n </div>\n </div>\n <!-- content -->\n <div [hidden]=\"!isCollapsed\">\n <ng-content></ng-content>\n </div>\n</div>\n",
|
|
2417
|
-
styles: [".card-contrast .card-header{padding:20px!important}.card-subtitle{margin-bottom:0}.card-full,.card-full .card-subtitle,.card-full .tools .icon{color:#6b6b6b!important}.card-full-warning,.card-full-warning .card-subtitle,.card-full-warning .tools .icon{color:#343a40!important}.card-full-danger,.card-full-danger .card-subtitle,.card-full-danger .tools .icon,.card-full-dark,.card-full-dark .card-subtitle,.card-full-dark .tools .icon,.card-full-info,.card-full-info .card-subtitle,.card-full-info .tools .icon,.card-full-primary,.card-full-primary .card-subtitle,.card-full-primary .tools .icon,.card-full-success,.card-full-success .card-subtitle,.card-full-success .tools .icon{color:#fff!important}.card-contrast .card-body{padding-top:15px}.card-body{padding:15px 20px}.pie-label{font-size:16px!important}.widget.widget-tile svg.ngx-charts{margin-left:-1.5rem!important}svg.ngx-charts{margin:0;padding:0}"]
|
|
2418
|
-
},] }
|
|
2419
|
-
];
|
|
2420
|
-
WidgetComponent.propDecorators = {
|
|
2421
|
-
type: [{ type: Input }],
|
|
2422
|
-
name: [{ type: Input }],
|
|
2423
|
-
icon: [{ type: Input }],
|
|
2424
|
-
contrast: [{ type: Input }],
|
|
2425
|
-
divider: [{ type: Input }],
|
|
2426
|
-
title: [{ type: Input }],
|
|
2427
|
-
subtitle: [{ type: Input }],
|
|
2428
|
-
collapseAble: [{ type: Input }],
|
|
2429
|
-
collapse: [{ type: Input }],
|
|
2430
|
-
additionalClasses: [{ type: Input }]
|
|
2431
|
-
};
|
|
2432
|
-
|
|
2433
|
-
/*
|
|
2434
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2435
|
-
*
|
|
2436
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2437
|
-
* you may not use this file except in compliance with the License.
|
|
2438
|
-
* You may obtain a copy of the License at
|
|
2439
|
-
*
|
|
2440
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2441
|
-
*
|
|
2442
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2443
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2444
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2445
|
-
* See the License for the specific language governing permissions and
|
|
2446
|
-
* limitations under the License.
|
|
2447
|
-
*/
|
|
2448
|
-
class WidgetModule {
|
|
2449
|
-
}
|
|
2450
|
-
WidgetModule.decorators = [
|
|
2451
|
-
{ type: NgModule, args: [{
|
|
2452
|
-
declarations: [WidgetComponent],
|
|
2453
|
-
imports: [CommonModule],
|
|
2454
|
-
exports: [WidgetComponent],
|
|
2455
|
-
},] }
|
|
2456
|
-
];
|
|
2457
|
-
|
|
2458
|
-
/*
|
|
2459
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2460
|
-
*
|
|
2461
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2462
|
-
* you may not use this file except in compliance with the License.
|
|
2463
|
-
* You may obtain a copy of the License at
|
|
2464
|
-
*
|
|
2465
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2466
|
-
*
|
|
2467
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2468
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2469
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2470
|
-
* See the License for the specific language governing permissions and
|
|
2471
|
-
* limitations under the License.
|
|
2472
|
-
*/
|
|
2473
|
-
class FieldAutoFocusDirective {
|
|
2474
|
-
constructor(el) {
|
|
2475
|
-
this.el = el;
|
|
2476
|
-
}
|
|
2477
|
-
ngAfterContentInit() {
|
|
2478
|
-
setTimeout(() => {
|
|
2479
|
-
this.el.nativeElement.focus();
|
|
2480
|
-
}, 300);
|
|
2481
|
-
}
|
|
2482
|
-
}
|
|
2483
|
-
FieldAutoFocusDirective.decorators = [
|
|
2484
|
-
{ type: Directive, args: [{
|
|
2485
|
-
selector: '[valtimoFieldAutoFocus]',
|
|
2486
|
-
},] }
|
|
2487
|
-
];
|
|
2488
|
-
FieldAutoFocusDirective.ctorParameters = () => [
|
|
2489
|
-
{ type: ElementRef }
|
|
2490
|
-
];
|
|
2491
|
-
|
|
2492
|
-
/*
|
|
2493
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2494
|
-
*
|
|
2495
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2496
|
-
* you may not use this file except in compliance with the License.
|
|
2497
|
-
* You may obtain a copy of the License at
|
|
2498
|
-
*
|
|
2499
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2500
|
-
*
|
|
2501
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2502
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2503
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2504
|
-
* See the License for the specific language governing permissions and
|
|
2505
|
-
* limitations under the License.
|
|
2506
|
-
*/
|
|
2507
|
-
class FieldAutoFocusModule {
|
|
2508
|
-
}
|
|
2509
|
-
FieldAutoFocusModule.decorators = [
|
|
2510
|
-
{ type: NgModule, args: [{
|
|
2511
|
-
declarations: [FieldAutoFocusDirective],
|
|
2512
|
-
exports: [FieldAutoFocusDirective],
|
|
2513
|
-
imports: [CommonModule],
|
|
2514
|
-
},] }
|
|
2515
|
-
];
|
|
2516
|
-
|
|
2517
|
-
/*
|
|
2518
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2519
|
-
*
|
|
2520
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2521
|
-
* you may not use this file except in compliance with the License.
|
|
2522
|
-
* You may obtain a copy of the License at
|
|
2523
|
-
*
|
|
2524
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2525
|
-
*
|
|
2526
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2527
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2528
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2529
|
-
* See the License for the specific language governing permissions and
|
|
2530
|
-
* limitations under the License.
|
|
2531
|
-
*/
|
|
2532
|
-
class BpmnJsDiagramComponent {
|
|
2533
|
-
constructor() {
|
|
2534
|
-
this.importDone = new EventEmitter();
|
|
2535
|
-
this.heatPoints = { data: [] };
|
|
2536
|
-
}
|
|
2537
|
-
ngOnInit() {
|
|
2538
|
-
this.bpmnJS = new BpmnJS();
|
|
2539
|
-
this.bpmnJS.on('import.done', ({ error }) => {
|
|
2540
|
-
if (!error) {
|
|
2541
|
-
const canvas = this.bpmnJS.get('canvas'), eventBus = this.bpmnJS.get('eventBus');
|
|
2542
|
-
if (this.historicActivityInstances) {
|
|
2543
|
-
this.historicActivityInstances.forEach(instance => {
|
|
2544
|
-
canvas.addMarker(instance.activityId, instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current');
|
|
2545
|
-
});
|
|
2546
|
-
}
|
|
2547
|
-
canvas.zoom('fit-viewport', 'auto');
|
|
2548
|
-
if (this.heatmapDuration || this.heatmapCount) {
|
|
2549
|
-
eventBus.on('canvas.init', () => {
|
|
2550
|
-
if (this.heatmapMode) {
|
|
2551
|
-
this.clearHeatmap();
|
|
2552
|
-
}
|
|
2553
|
-
this.getHeatmapData();
|
|
2554
|
-
});
|
|
2555
|
-
eventBus.on('canvas.viewbox.changing', () => {
|
|
2556
|
-
if (this.heatmapMode) {
|
|
2557
|
-
this.clearHeatmap();
|
|
2558
|
-
}
|
|
2559
|
-
});
|
|
2560
|
-
eventBus.on('canvas.viewbox.changed', () => {
|
|
2561
|
-
this.getHeatmapData();
|
|
2562
|
-
});
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
});
|
|
2566
|
-
}
|
|
2567
|
-
ngAfterContentInit() {
|
|
2568
|
-
this.bpmnJS.importXML(this.bpmn20Xml);
|
|
2569
|
-
this.bpmnJS.attachTo(this.el.nativeElement);
|
|
2570
|
-
}
|
|
2571
|
-
getHeatmapData() {
|
|
2572
|
-
let inputData, valueKey;
|
|
2573
|
-
this.heatPoints = { data: [] };
|
|
2574
|
-
this.min = 0;
|
|
2575
|
-
this.max = 0;
|
|
2576
|
-
if (this.heatmapDuration) {
|
|
2577
|
-
inputData = this.heatmapDuration;
|
|
2578
|
-
valueKey = 'averageDurationInMilliseconds';
|
|
2579
|
-
}
|
|
2580
|
-
else if (this.heatmapCount) {
|
|
2581
|
-
inputData = this.heatmapCount;
|
|
2582
|
-
valueKey = 'totalCount';
|
|
2583
|
-
}
|
|
2584
|
-
if (inputData) {
|
|
2585
|
-
Object.keys(inputData).forEach(key => {
|
|
2586
|
-
const diagramContainer = this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = this.el.nativeElement
|
|
2587
|
-
.querySelector(`g[data-element-id=${key}]`)
|
|
2588
|
-
.getBoundingClientRect();
|
|
2589
|
-
this.setMax(key);
|
|
2590
|
-
this.heatPoints.data.push({
|
|
2591
|
-
x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
|
|
2592
|
-
y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
|
|
2593
|
-
value: inputData[key][valueKey],
|
|
2594
|
-
radius: diagramElm.width / 2,
|
|
2595
|
-
});
|
|
2596
|
-
if (inputData[key].count > 0) {
|
|
2597
|
-
this.addCounterActiveOverlays(key, inputData);
|
|
2598
|
-
}
|
|
2599
|
-
});
|
|
2600
|
-
if (this.heatmapMode) {
|
|
2601
|
-
this.showHeatmap();
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
setMax(key) {
|
|
2606
|
-
if (this.heatmapDuration) {
|
|
2607
|
-
this.max = Math.max(this.heatmapDuration[key].averageDurationInMilliseconds, this.max);
|
|
2608
|
-
}
|
|
2609
|
-
else if (this.heatmapCount) {
|
|
2610
|
-
this.max = Math.max(this.heatmapCount[key].totalCount + this.heatmapCount[key].count, this.max);
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
addCounterActiveOverlays(key, inputData) {
|
|
2614
|
-
const overlays = this.bpmnJS.get('overlays');
|
|
2615
|
-
overlays.add(key, {
|
|
2616
|
-
position: {
|
|
2617
|
-
bottom: -10,
|
|
2618
|
-
left: 0,
|
|
2619
|
-
},
|
|
2620
|
-
show: {
|
|
2621
|
-
minZoom: 0,
|
|
2622
|
-
maxZoom: 5.0,
|
|
2623
|
-
},
|
|
2624
|
-
html: `<span class="badge badge-pill badge-primary">${inputData[key].count}</span>`,
|
|
2625
|
-
});
|
|
2626
|
-
}
|
|
2627
|
-
showHeatmap() {
|
|
2628
|
-
this.heatMapInstance = create({
|
|
2629
|
-
radius: 54,
|
|
2630
|
-
blur: 0.7,
|
|
2631
|
-
maxOpacity: 0.4,
|
|
2632
|
-
minOpacity: 0,
|
|
2633
|
-
container: this.el.nativeElement,
|
|
2634
|
-
});
|
|
2635
|
-
this.heatMapInstance.setData({
|
|
2636
|
-
min: this.min,
|
|
2637
|
-
max: this.max,
|
|
2638
|
-
data: this.heatPoints.data,
|
|
2639
|
-
});
|
|
2640
|
-
}
|
|
2641
|
-
clearHeatmap() {
|
|
2642
|
-
this.heatMapInstance.setData({ data: [] });
|
|
2643
|
-
}
|
|
2644
|
-
toggleHeatmap() {
|
|
2645
|
-
this.heatmapMode = !this.heatmapMode;
|
|
2646
|
-
if (this.heatmapMode) {
|
|
2647
|
-
this.showHeatmap();
|
|
2648
|
-
}
|
|
2649
|
-
else {
|
|
2650
|
-
this.clearHeatmap();
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
ngOnDestroy() {
|
|
2654
|
-
this.bpmnJS.destroy();
|
|
2655
|
-
}
|
|
2656
|
-
}
|
|
2657
|
-
BpmnJsDiagramComponent.decorators = [
|
|
2658
|
-
{ type: Component, args: [{
|
|
2659
|
-
selector: 'valtimo-bpmn-js-diagram',
|
|
2660
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"p-4\" *ngIf=\"heatmapDuration || heatmapCount\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n id=\"toggleHeatmap\"\n [checked]=\"heatmapMode\"\n (click)=\"toggleHeatmap()\"\n /><span> <label for=\"toggleHeatmap\"></label></span>\n </div>\n</div>\n\n<div #ref class=\"diagram-container\"></div>\n\n<div *ngIf=\"historicActivityInstances\" class=\"p-4 text-center legenda-holder\">\n <span\n ><div class=\"legenda highlight-overlay-past\"></div>\n Executed tasks</span\n >\n <span class=\"ml-3\"\n ><div class=\"legenda highlight-overlay-current\"></div>\n Current tasks</span\n >\n</div>\n\n<div *ngIf=\"heatmapDuration || heatmapCount\" class=\"p-4 text-center legenda-holder\">\n <span\n ><span class=\"badge badge-pill badge-primary\">N</span> Amount of currently active\n instances of this task.</span\n >\n <span\n > | Red/yellow/green orbs: The amount of times the task is executed in\n comparison to the other tasks.</span\n >\n</div>\n",
|
|
2661
|
-
styles: [""]
|
|
2662
|
-
},] }
|
|
2663
|
-
];
|
|
2664
|
-
BpmnJsDiagramComponent.ctorParameters = () => [];
|
|
2665
|
-
BpmnJsDiagramComponent.propDecorators = {
|
|
2666
|
-
el: [{ type: ViewChild, args: ['ref', { static: true },] }],
|
|
2667
|
-
importDone: [{ type: Output }],
|
|
2668
|
-
bpmn20Xml: [{ type: Input }],
|
|
2669
|
-
heatmapDuration: [{ type: Input }],
|
|
2670
|
-
heatmapCount: [{ type: Input }],
|
|
2671
|
-
historicActivityInstances: [{ type: Input }]
|
|
2672
|
-
};
|
|
2673
|
-
|
|
2674
|
-
/*
|
|
2675
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2676
|
-
*
|
|
2677
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2678
|
-
* you may not use this file except in compliance with the License.
|
|
2679
|
-
* You may obtain a copy of the License at
|
|
2680
|
-
*
|
|
2681
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2682
|
-
*
|
|
2683
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2684
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2685
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2686
|
-
* See the License for the specific language governing permissions and
|
|
2687
|
-
* limitations under the License.
|
|
2688
|
-
*/
|
|
2689
|
-
class BpmnJsDiagramModule {
|
|
2690
|
-
}
|
|
2691
|
-
BpmnJsDiagramModule.decorators = [
|
|
2692
|
-
{ type: NgModule, args: [{
|
|
2693
|
-
declarations: [BpmnJsDiagramComponent],
|
|
2694
|
-
imports: [CommonModule],
|
|
2695
|
-
exports: [BpmnJsDiagramComponent],
|
|
2696
|
-
},] }
|
|
2697
|
-
];
|
|
2698
|
-
|
|
2699
|
-
/*
|
|
2700
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2701
|
-
*
|
|
2702
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2703
|
-
* you may not use this file except in compliance with the License.
|
|
2704
|
-
* You may obtain a copy of the License at
|
|
2705
|
-
*
|
|
2706
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2707
|
-
*
|
|
2708
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2709
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2710
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2711
|
-
* See the License for the specific language governing permissions and
|
|
2712
|
-
* limitations under the License.
|
|
2713
|
-
*/
|
|
2714
|
-
class TimelineComponent {
|
|
2715
|
-
}
|
|
2716
|
-
TimelineComponent.decorators = [
|
|
2717
|
-
{ type: Component, args: [{
|
|
2718
|
-
selector: 'valtimo-timeline',
|
|
2719
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div id=\"no-results\" class=\"p-5\" *ngIf=\"items?.length === 0\">No result found</div>\n <div class=\"pb-5\" *ngIf=\"items?.length > 0\">\n <ul class=\"timeline mb-0 py-5\">\n <li class=\"timeline-item status-done\" *ngFor=\"let item of items\">\n <div class=\"timeline-date\">\n <span>{{ item.date }}</span>\n </div>\n <div class=\"timeline-content mt-1\">\n <div class=\"timeline-header p-0\">\n <span class=\"timeline-time\">{{ item.time }}</span>\n <span class=\"timeline-author\">{{ item.user }}</span>\n <br />\n <p class=\"timeline-activity\">{{ item.activity }}</p>\n <div class=\"timeline-summary\">\n <p\n [innerHTML]=\"item.summaryTranslationKey | translate: item.summaryTranslationParams\"\n ></p>\n </div>\n </div>\n </div>\n </li>\n </ul>\n </div>\n</div>\n",
|
|
2720
|
-
styles: [""]
|
|
2721
|
-
},] }
|
|
2722
|
-
];
|
|
2723
|
-
TimelineComponent.propDecorators = {
|
|
2724
|
-
items: [{ type: Input }]
|
|
2725
|
-
};
|
|
2726
|
-
|
|
2727
|
-
/*
|
|
2728
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2729
|
-
*
|
|
2730
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2731
|
-
* you may not use this file except in compliance with the License.
|
|
2732
|
-
* You may obtain a copy of the License at
|
|
2733
|
-
*
|
|
2734
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2735
|
-
*
|
|
2736
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2737
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2738
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2739
|
-
* See the License for the specific language governing permissions and
|
|
2740
|
-
* limitations under the License.
|
|
2741
|
-
*/
|
|
2742
|
-
class TimelineModule {
|
|
2743
|
-
}
|
|
2744
|
-
TimelineModule.decorators = [
|
|
2745
|
-
{ type: NgModule, args: [{
|
|
2746
|
-
declarations: [TimelineComponent],
|
|
2747
|
-
imports: [CommonModule, TranslateModule],
|
|
2748
|
-
exports: [TimelineComponent],
|
|
2749
|
-
},] }
|
|
2750
|
-
];
|
|
2751
|
-
|
|
2752
|
-
/*
|
|
2753
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2754
|
-
*
|
|
2755
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2756
|
-
* you may not use this file except in compliance with the License.
|
|
2757
|
-
* You may obtain a copy of the License at
|
|
2758
|
-
*
|
|
2759
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2760
|
-
*
|
|
2761
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2762
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2763
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2764
|
-
* See the License for the specific language governing permissions and
|
|
2765
|
-
* limitations under the License.
|
|
2766
|
-
*/
|
|
2767
|
-
class ComponentsModule {
|
|
2768
|
-
}
|
|
2769
|
-
ComponentsModule.decorators = [
|
|
2770
|
-
{ type: NgModule }
|
|
2771
|
-
];
|
|
2772
|
-
|
|
2773
|
-
/*
|
|
2774
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2775
|
-
*
|
|
2776
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2777
|
-
* you may not use this file except in compliance with the License.
|
|
2778
|
-
* You may obtain a copy of the License at
|
|
2779
|
-
*
|
|
2780
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2781
|
-
*
|
|
2782
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2783
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2784
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2785
|
-
* See the License for the specific language governing permissions and
|
|
2786
|
-
* limitations under the License.
|
|
2787
|
-
*/
|
|
2788
|
-
class FilterSidebarComponent {
|
|
2789
|
-
constructor() {
|
|
2790
|
-
this.filterSidebar = localStorage.getItem('filterSidebar') || 'show';
|
|
2791
|
-
}
|
|
2792
|
-
ngOnInit() {
|
|
2793
|
-
if (this.filterSidebar === 'show') {
|
|
2794
|
-
localStorage.setItem('filterSidebar', 'show');
|
|
2795
|
-
$('.be-content').addClass('be-aside');
|
|
2796
|
-
}
|
|
2797
|
-
$('[data-toggle="tooltip"]').tooltip();
|
|
2798
|
-
}
|
|
2799
|
-
ngOnDestroy() {
|
|
2800
|
-
$('.be-content').removeClass('be-aside');
|
|
2801
|
-
}
|
|
2802
|
-
toggleFilterSidebar() {
|
|
2803
|
-
const beContent = $('.be-content');
|
|
2804
|
-
beContent.toggleClass('be-aside');
|
|
2805
|
-
this.filterSidebar = beContent.hasClass('be-aside') ? 'show' : 'hide';
|
|
2806
|
-
localStorage.setItem('filterSidebar', this.filterSidebar);
|
|
2807
|
-
}
|
|
2808
|
-
}
|
|
2809
|
-
FilterSidebarComponent.decorators = [
|
|
2810
|
-
{ type: Component, args: [{
|
|
2811
|
-
selector: 'valtimo-filter-sidebar',
|
|
2812
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <a\n class=\"toggle-filter-sidebar\"\n data-toggle=\"tooltip\"\n data-trigger=\"hover\"\n data-placement=\"right\"\n title=\"Show / hide\"\n href=\"javascript:void(0)\"\n (click)=\"toggleFilterSidebar()\"\n [ngClass]=\"this.filterSidebar === 'show' && 'toggle-expanded'\"\n >\n <div class=\"icon-container p-0 bg-transparent\">\n <i class=\"click-able icon shadow mdi mdi-filter-list\"></i>\n </div>\n </a>\n <aside class=\"page-aside p-4 mb-4 bg-light filter-holder\" *ngIf=\"this.filterSidebar === 'show'\">\n <ng-content></ng-content>\n </aside>\n</div>\n",
|
|
2813
|
-
styles: [".filter-holder{border:0 solid transparent}.toggle-filter-sidebar{cursor:pointer;font-size:2rem;margin-left:-50px;position:absolute;top:25px;z-index:1}.icon-container .icon{background-color:#fff;color:#6b6b6b}.toggle-filter-sidebar:hover .icon-container .icon{color:#ff5800}@media screen and (min-width:768px){.toggle-filter-sidebar{margin-left:-25px}.page-aside{height:calc(100vh - 61px);left:0;margin-top:0;position:absolute}.toggle-expanded{margin-left:255px}}"]
|
|
2814
|
-
},] }
|
|
2815
|
-
];
|
|
2816
|
-
FilterSidebarComponent.ctorParameters = () => [];
|
|
2817
|
-
|
|
2818
|
-
/*
|
|
2819
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2820
|
-
*
|
|
2821
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2822
|
-
* you may not use this file except in compliance with the License.
|
|
2823
|
-
* You may obtain a copy of the License at
|
|
2824
|
-
*
|
|
2825
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2826
|
-
*
|
|
2827
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2828
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2829
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2830
|
-
* See the License for the specific language governing permissions and
|
|
2831
|
-
* limitations under the License.
|
|
2832
|
-
*/
|
|
2833
|
-
class FilterSidebarModule {
|
|
2834
|
-
}
|
|
2835
|
-
FilterSidebarModule.decorators = [
|
|
2836
|
-
{ type: NgModule, args: [{
|
|
2837
|
-
declarations: [FilterSidebarComponent],
|
|
2838
|
-
imports: [CommonModule],
|
|
2839
|
-
exports: [FilterSidebarComponent],
|
|
2840
|
-
},] }
|
|
2841
|
-
];
|
|
2842
|
-
|
|
2843
|
-
/*
|
|
2844
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2845
|
-
*
|
|
2846
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2847
|
-
* you may not use this file except in compliance with the License.
|
|
2848
|
-
* You may obtain a copy of the License at
|
|
2849
|
-
*
|
|
2850
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2851
|
-
*
|
|
2852
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2853
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2854
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2855
|
-
* See the License for the specific language governing permissions and
|
|
2856
|
-
* limitations under the License.
|
|
2857
|
-
*/
|
|
2858
|
-
class UploaderComponent {
|
|
2859
|
-
constructor(s3Service) {
|
|
2860
|
-
this.s3Service = s3Service;
|
|
2861
|
-
this.resources = [];
|
|
2862
|
-
this.resourcesChanged = new EventEmitter();
|
|
2863
|
-
this.resourceRegistered = new EventEmitter();
|
|
2864
|
-
this.showFileList = true;
|
|
2865
|
-
}
|
|
2866
|
-
ngOnInit() { }
|
|
2867
|
-
onFileFieldChange(files) {
|
|
2868
|
-
for (const file of files) {
|
|
2869
|
-
this.uploadFile(file);
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
uploadFile(file) {
|
|
2873
|
-
this.s3Service.getPreSignedUrl(file.name).subscribe(value => {
|
|
2874
|
-
const preSignedUrl = new URL(value);
|
|
2875
|
-
this.s3Service.upload(preSignedUrl, file).subscribe(result => {
|
|
2876
|
-
const s3ResourceDTO = new S3Resource(file, preSignedUrl);
|
|
2877
|
-
this.s3Service.registerResource(s3ResourceDTO).subscribe(resource => {
|
|
2878
|
-
this.resources.push(resource);
|
|
2879
|
-
this.resourceRegistered.emit(resource);
|
|
2880
|
-
this.resourcesChanged.emit(this.resources);
|
|
2881
|
-
});
|
|
2882
|
-
});
|
|
2883
|
-
});
|
|
2884
|
-
}
|
|
2885
|
-
deleteResource(resource) {
|
|
2886
|
-
this.s3Service.delete(resource.id).subscribe(result => {
|
|
2887
|
-
const index = this.resources.findIndex(res => res.id === resource.id);
|
|
2888
|
-
this.resources.splice(index, 1);
|
|
2889
|
-
this.resourcesChanged.emit(this.resources);
|
|
2890
|
-
});
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2893
|
-
UploaderComponent.decorators = [
|
|
2894
|
-
{ type: Component, args: [{
|
|
2895
|
-
selector: 'valtimo-uploader',
|
|
2896
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"upload-file-container p-5\"\n (click)=\"fileInput.click()\"\n valtimoUploaderDragDrop\n (fileDropped)=\"onFileFieldChange($event)\"\n>\n <span class=\"align-middle\"><i class=\"mdi mdi-cloud-upload\"></i></span>\n <input hidden type=\"file\" #fileInput (change)=\"onFileFieldChange($event.target.files)\" multiple />\n</div>\n<div *ngIf=\"showFileList\">\n <div class=\"files-list px-3 py-2\" *ngFor=\"let resource of resources\">\n <p class=\"m-0\">\n <strong>{{ resource.name }}</strong\n ><br />\n {{ resource.sizeInBytes | filesize }}\n </p>\n <button class=\"delete-file\" (click)=\"deleteResource(resource)\">\n <i class=\"icon mdi mdi-delete text-danger\"></i>\n </button>\n </div>\n</div>\n",
|
|
2897
|
-
styles: [".upload-file-container{background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:100px;border:2px dashed #d5d8de;color:#d5d8de;margin:0 0 1rem;text-align:center}.upload-file-container i.mdi-cloud-upload{font-size:5em}.upload-file-container:hover{cursor:pointer;opacity:.8}.files-list{background:#fff;border:1px solid #bdc0c7;display:flex;font-size:1em;justify-content:space-between;margin:1rem auto;padding:5px}.files-list .delete-file{background:transparent;border:none;cursor:pointer}.files-list .delete-file i{font-size:1.5em}"]
|
|
2898
|
-
},] }
|
|
2899
|
-
];
|
|
2900
|
-
UploaderComponent.ctorParameters = () => [
|
|
2901
|
-
{ type: S3Service }
|
|
2902
|
-
];
|
|
2903
|
-
UploaderComponent.propDecorators = {
|
|
2904
|
-
resourcesChanged: [{ type: Output }],
|
|
2905
|
-
resourceRegistered: [{ type: Output }],
|
|
2906
|
-
showFileList: [{ type: Input }]
|
|
2907
|
-
};
|
|
2908
|
-
|
|
2909
|
-
/*
|
|
2910
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2911
|
-
*
|
|
2912
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2913
|
-
* you may not use this file except in compliance with the License.
|
|
2914
|
-
* You may obtain a copy of the License at
|
|
2915
|
-
*
|
|
2916
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2917
|
-
*
|
|
2918
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2919
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2920
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2921
|
-
* See the License for the specific language governing permissions and
|
|
2922
|
-
* limitations under the License.
|
|
2923
|
-
*/
|
|
2924
|
-
class UploaderDragDropDirective {
|
|
2925
|
-
constructor() {
|
|
2926
|
-
this.fileDropped = new EventEmitter();
|
|
2927
|
-
}
|
|
2928
|
-
onDragOver(evt) {
|
|
2929
|
-
evt.preventDefault();
|
|
2930
|
-
evt.stopPropagation();
|
|
2931
|
-
}
|
|
2932
|
-
onDragLeave(evt) {
|
|
2933
|
-
evt.preventDefault();
|
|
2934
|
-
evt.stopPropagation();
|
|
2935
|
-
}
|
|
2936
|
-
ondrop(evt) {
|
|
2937
|
-
evt.preventDefault();
|
|
2938
|
-
evt.stopPropagation();
|
|
2939
|
-
const files = evt.dataTransfer.files;
|
|
2940
|
-
if (files.length > 0) {
|
|
2941
|
-
this.fileDropped.emit(files);
|
|
2942
|
-
}
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
UploaderDragDropDirective.decorators = [
|
|
2946
|
-
{ type: Directive, args: [{
|
|
2947
|
-
selector: '[valtimoUploaderDragDrop]',
|
|
2948
|
-
},] }
|
|
2949
|
-
];
|
|
2950
|
-
UploaderDragDropDirective.propDecorators = {
|
|
2951
|
-
fileDropped: [{ type: Output }],
|
|
2952
|
-
onDragOver: [{ type: HostListener, args: ['dragover', ['$event'],] }],
|
|
2953
|
-
onDragLeave: [{ type: HostListener, args: ['dragleave', ['$event'],] }],
|
|
2954
|
-
ondrop: [{ type: HostListener, args: ['drop', ['$event'],] }]
|
|
2955
|
-
};
|
|
2956
|
-
|
|
2957
|
-
/*
|
|
2958
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2959
|
-
*
|
|
2960
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2961
|
-
* you may not use this file except in compliance with the License.
|
|
2962
|
-
* You may obtain a copy of the License at
|
|
2963
|
-
*
|
|
2964
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2965
|
-
*
|
|
2966
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2967
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
2968
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2969
|
-
* See the License for the specific language governing permissions and
|
|
2970
|
-
* limitations under the License.
|
|
2971
|
-
*/
|
|
2972
|
-
class FileSizePipe {
|
|
2973
|
-
constructor() {
|
|
2974
|
-
this.units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
2975
|
-
}
|
|
2976
|
-
transform(bytes = 0, precision = 2) {
|
|
2977
|
-
if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes)) {
|
|
2978
|
-
return '?';
|
|
2979
|
-
}
|
|
2980
|
-
let unit = 0;
|
|
2981
|
-
while (bytes >= 1024) {
|
|
2982
|
-
bytes /= 1024;
|
|
2983
|
-
unit++;
|
|
2984
|
-
}
|
|
2985
|
-
return bytes.toFixed(+precision) + ' ' + this.units[unit];
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
FileSizePipe.decorators = [
|
|
2989
|
-
{ type: Pipe, args: [{
|
|
2990
|
-
name: 'filesize',
|
|
2991
|
-
},] }
|
|
2992
|
-
];
|
|
2993
|
-
|
|
2994
|
-
/*
|
|
2995
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
2996
|
-
*
|
|
2997
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2998
|
-
* you may not use this file except in compliance with the License.
|
|
2999
|
-
* You may obtain a copy of the License at
|
|
3000
|
-
*
|
|
3001
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3002
|
-
*
|
|
3003
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3004
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3005
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3006
|
-
* See the License for the specific language governing permissions and
|
|
3007
|
-
* limitations under the License.
|
|
3008
|
-
*/
|
|
3009
|
-
class FileSizeModule {
|
|
3010
|
-
}
|
|
3011
|
-
FileSizeModule.decorators = [
|
|
3012
|
-
{ type: NgModule, args: [{
|
|
3013
|
-
declarations: [FileSizePipe],
|
|
3014
|
-
imports: [CommonModule],
|
|
3015
|
-
exports: [FileSizePipe],
|
|
3016
|
-
},] }
|
|
3017
|
-
];
|
|
3018
|
-
|
|
3019
|
-
/*
|
|
3020
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3021
|
-
*
|
|
3022
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3023
|
-
* you may not use this file except in compliance with the License.
|
|
3024
|
-
* You may obtain a copy of the License at
|
|
3025
|
-
*
|
|
3026
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3027
|
-
*
|
|
3028
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3029
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3030
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3031
|
-
* See the License for the specific language governing permissions and
|
|
3032
|
-
* limitations under the License.
|
|
3033
|
-
*/
|
|
3034
|
-
class UploaderModule {
|
|
3035
|
-
}
|
|
3036
|
-
UploaderModule.decorators = [
|
|
3037
|
-
{ type: NgModule, args: [{
|
|
3038
|
-
declarations: [UploaderComponent, UploaderDragDropDirective],
|
|
3039
|
-
imports: [CommonModule, FileSizeModule],
|
|
3040
|
-
exports: [UploaderComponent, UploaderDragDropDirective],
|
|
3041
|
-
},] }
|
|
3042
|
-
];
|
|
3043
|
-
|
|
3044
|
-
/*
|
|
3045
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3046
|
-
*
|
|
3047
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3048
|
-
* you may not use this file except in compliance with the License.
|
|
3049
|
-
* You may obtain a copy of the License at
|
|
3050
|
-
*
|
|
3051
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3052
|
-
*
|
|
3053
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3054
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3055
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3056
|
-
* See the License for the specific language governing permissions and
|
|
3057
|
-
* limitations under the License.
|
|
3058
|
-
*/
|
|
3059
|
-
class AlertService {
|
|
3060
|
-
constructor(router) {
|
|
3061
|
-
this.router = router;
|
|
3062
|
-
this.confirmed = new EventEmitter();
|
|
3063
|
-
this.subject = new Subject();
|
|
3064
|
-
// clear alert messages on route change unless 'keepAfterRouteChange' flag is true
|
|
3065
|
-
this.router.events.subscribe(event => {
|
|
3066
|
-
if (event instanceof NavigationStart) {
|
|
3067
|
-
// clear alert messages
|
|
3068
|
-
this.clear();
|
|
3069
|
-
}
|
|
3070
|
-
});
|
|
3071
|
-
}
|
|
3072
|
-
// enable subscribing to alerts observable
|
|
3073
|
-
onAlert() {
|
|
3074
|
-
return this.subject.asObservable();
|
|
3075
|
-
}
|
|
3076
|
-
// convenience methods
|
|
3077
|
-
success(message, confirmations, iconClass) {
|
|
3078
|
-
this.alert(new Alert({ message, type: AlertType.Success, confirmations, iconClass }));
|
|
3079
|
-
}
|
|
3080
|
-
error(message, confirmations, iconClass) {
|
|
3081
|
-
this.alert(new Alert({ message, type: AlertType.Error, confirmations, iconClass }));
|
|
3082
|
-
}
|
|
3083
|
-
info(message, confirmations, iconClass) {
|
|
3084
|
-
this.alert(new Alert({ message, type: AlertType.Info, confirmations, iconClass }));
|
|
3085
|
-
}
|
|
3086
|
-
warning(message, confirmations, iconClass) {
|
|
3087
|
-
this.alert(new Alert({ message, type: AlertType.Warning, confirmations, iconClass }));
|
|
3088
|
-
}
|
|
3089
|
-
notification(message, confirmations, iconClass) {
|
|
3090
|
-
this.alert(new Alert({ message, type: AlertType.Notification, confirmations, iconClass }));
|
|
3091
|
-
}
|
|
3092
|
-
modalNotification(message, confirmations, iconClass) {
|
|
3093
|
-
this.alert(new Alert({ message, type: AlertType.ModalNotification, confirmations, iconClass }));
|
|
3094
|
-
}
|
|
3095
|
-
// main alert method
|
|
3096
|
-
alert(alert) {
|
|
3097
|
-
this.subject.next(alert);
|
|
3098
|
-
}
|
|
3099
|
-
// clear alerts
|
|
3100
|
-
clear() {
|
|
3101
|
-
this.subject.next(new Alert({}));
|
|
3102
|
-
}
|
|
3103
|
-
// emit confirm
|
|
3104
|
-
emitAlertConfirmEvent(alert) {
|
|
3105
|
-
this.confirmed.emit(alert);
|
|
3106
|
-
}
|
|
3107
|
-
getAlertConfirmChangeEmitter() {
|
|
3108
|
-
return this.confirmed;
|
|
3109
|
-
}
|
|
3110
|
-
}
|
|
3111
|
-
AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(Router)); }, token: AlertService, providedIn: "root" });
|
|
3112
|
-
AlertService.decorators = [
|
|
3113
|
-
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
3114
|
-
];
|
|
3115
|
-
AlertService.ctorParameters = () => [
|
|
3116
|
-
{ type: Router }
|
|
3117
|
-
];
|
|
3118
|
-
|
|
3119
|
-
/*
|
|
3120
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3121
|
-
*
|
|
3122
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3123
|
-
* you may not use this file except in compliance with the License.
|
|
3124
|
-
* You may obtain a copy of the License at
|
|
3125
|
-
*
|
|
3126
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3127
|
-
*
|
|
3128
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3129
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3130
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3131
|
-
* See the License for the specific language governing permissions and
|
|
3132
|
-
* limitations under the License.
|
|
3133
|
-
*/
|
|
3134
|
-
class AlertComponent {
|
|
3135
|
-
constructor(alertService) {
|
|
3136
|
-
this.alertService = alertService;
|
|
3137
|
-
this.alerts = [];
|
|
3138
|
-
this.autoCloseInMS = 5000;
|
|
3139
|
-
}
|
|
3140
|
-
ngOnInit() { }
|
|
3141
|
-
ngAfterContentInit() {
|
|
3142
|
-
this.subscription = this.alertService.onAlert().subscribe(alert => {
|
|
3143
|
-
if (!alert.message) {
|
|
3144
|
-
// clear alerts when an empty alert is received
|
|
3145
|
-
this.alerts = [];
|
|
3146
|
-
return;
|
|
3147
|
-
}
|
|
3148
|
-
// set empty array when an empty alert confirmations is received
|
|
3149
|
-
if (!alert.confirmations) {
|
|
3150
|
-
alert.confirmations = [];
|
|
3151
|
-
}
|
|
3152
|
-
// add alert to array if not exist
|
|
3153
|
-
const alertExist = this.alerts.filter(x => x.message === alert.message);
|
|
3154
|
-
if (alertExist.length === 0) {
|
|
3155
|
-
this.alerts.push(alert);
|
|
3156
|
-
}
|
|
3157
|
-
if (this.inModal(alert)) {
|
|
3158
|
-
setTimeout(() => {
|
|
3159
|
-
this.openModal();
|
|
3160
|
-
}, 300);
|
|
3161
|
-
}
|
|
3162
|
-
// auto close except alert confirmations not empty
|
|
3163
|
-
if (this.autoCloseInMS > 0 && alert.confirmations.length === 0) {
|
|
3164
|
-
setTimeout(() => {
|
|
3165
|
-
this.removeAlert(alert);
|
|
3166
|
-
}, this.autoCloseInMS);
|
|
3167
|
-
}
|
|
3168
|
-
});
|
|
3169
|
-
}
|
|
3170
|
-
closeModal() {
|
|
3171
|
-
$('#modalNotification').modal('hide');
|
|
3172
|
-
}
|
|
3173
|
-
openModal() {
|
|
3174
|
-
$('#modalNotification').modal('show');
|
|
3175
|
-
}
|
|
3176
|
-
alertConfirm(alert, confirm) {
|
|
3177
|
-
alert.confirm = confirm;
|
|
3178
|
-
this.alertService.emitAlertConfirmEvent(alert);
|
|
3179
|
-
this.removeAlert(alert);
|
|
3180
|
-
}
|
|
3181
|
-
ngOnDestroy() {
|
|
3182
|
-
// unsubscribe to avoid memory leaks
|
|
3183
|
-
this.subscription.unsubscribe();
|
|
3184
|
-
}
|
|
3185
|
-
removeAlert(alert) {
|
|
3186
|
-
if (this.inModal(alert)) {
|
|
3187
|
-
this.closeModal();
|
|
3188
|
-
}
|
|
3189
|
-
// remove specified alert from array
|
|
3190
|
-
this.alerts = this.alerts.filter(x => x.message !== alert.message);
|
|
3191
|
-
}
|
|
3192
|
-
inModal(alert) {
|
|
3193
|
-
if (!alert) {
|
|
3194
|
-
return;
|
|
3195
|
-
}
|
|
3196
|
-
// return true based on AlertType.ModalNotification
|
|
3197
|
-
switch (alert.type) {
|
|
3198
|
-
case AlertType.ModalNotification:
|
|
3199
|
-
return true;
|
|
3200
|
-
default:
|
|
3201
|
-
return false;
|
|
3202
|
-
}
|
|
3203
|
-
}
|
|
3204
|
-
cssClass(alert) {
|
|
3205
|
-
if (!alert) {
|
|
3206
|
-
return;
|
|
3207
|
-
}
|
|
3208
|
-
// return css class based on alert type
|
|
3209
|
-
switch (alert.type) {
|
|
3210
|
-
case AlertType.Success:
|
|
3211
|
-
return 'alert alert-success';
|
|
3212
|
-
case AlertType.Error:
|
|
3213
|
-
return 'alert alert-danger';
|
|
3214
|
-
case AlertType.Info:
|
|
3215
|
-
return 'alert alert-info';
|
|
3216
|
-
case AlertType.Warning:
|
|
3217
|
-
return 'alert alert-warning';
|
|
3218
|
-
case AlertType.Notification:
|
|
3219
|
-
return 'alert alert-light';
|
|
3220
|
-
case AlertType.ModalNotification:
|
|
3221
|
-
return 'alert alert-light';
|
|
3222
|
-
}
|
|
3223
|
-
}
|
|
3224
|
-
cssIconClass(alert) {
|
|
3225
|
-
if (!alert) {
|
|
3226
|
-
return;
|
|
3227
|
-
}
|
|
3228
|
-
// return css class based on alert type
|
|
3229
|
-
switch (alert.type) {
|
|
3230
|
-
case AlertType.Success:
|
|
3231
|
-
return 'mdi mdi-check';
|
|
3232
|
-
case AlertType.Error:
|
|
3233
|
-
return 'mdi mdi-close-circle-o';
|
|
3234
|
-
case AlertType.Info:
|
|
3235
|
-
return 'mdi mdi-info-outline';
|
|
3236
|
-
case AlertType.Warning:
|
|
3237
|
-
return 'mdi mdi-alert-triangle';
|
|
3238
|
-
case AlertType.Notification:
|
|
3239
|
-
return 'mdi mdi-notifications';
|
|
3240
|
-
case AlertType.ModalNotification:
|
|
3241
|
-
return 'mdi mdi-notifications';
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
}
|
|
3245
|
-
AlertComponent.decorators = [
|
|
3246
|
-
{ type: Component, args: [{
|
|
3247
|
-
selector: 'valtimo-alert',
|
|
3248
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngFor=\"let alert of alerts\" class=\"{{ cssClass(alert) }} rounded-0 m-0 alert-dismissable\">\n <div *ngIf=\"inModal(alert)\">\n <!-- Modal -->\n <div class=\"modal fade\" id=\"modalNotification\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body p-0\">\n <button class=\"close\" type=\"button\" (click)=\"removeAlert(alert)\">\n <span class=\"mdi mdi-close\" aria-hidden=\"true\"></span>\n </button>\n <div class=\"icon\">\n <span class=\"{{ alert.iconClass || cssIconClass(alert) }}\"></span>\n </div>\n <div class=\"message\">\n <div [innerHTML]=\"alert.message\"></div>\n </div>\n </div>\n <div class=\"modal-footer pt-0\" *ngIf=\"alert.confirmations?.length\">\n <button\n class=\"{{ confirmation.class }} mr-2\"\n *ngFor=\"let confirmation of alert.confirmations\"\n (click)=\"alertConfirm(alert, confirmation.value)\"\n >\n {{ confirmation.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!inModal(alert)\" class=\"alert-block\">\n <div class=\"icon\"><span class=\"{{ alert.iconClass || cssIconClass(alert) }}\"></span></div>\n <div class=\"message\">\n <div [innerHTML]=\"alert.message\"></div>\n <div class=\"mt-3\" *ngIf=\"alert.confirmations?.length\">\n <button\n class=\"{{ confirmation.class }} mr-2\"\n *ngFor=\"let confirmation of alert.confirmations\"\n (click)=\"alertConfirm(alert, confirmation.value)\"\n >\n {{ confirmation.label }}\n </button>\n </div>\n </div>\n <button class=\"close\" type=\"button\" (click)=\"removeAlert(alert)\">\n <span class=\"mdi mdi-close\" aria-hidden=\"true\"></span>\n </button>\n </div>\n</div>\n",
|
|
3249
|
-
styles: [".alert-block{display:flex;flex-direction:row;justify-content:space-between}.alert-block .message{width:100%}.alert-block .icon{align-items:center;display:flex}.alert .message{font-size:1.1rem!important;line-height:1.5rem!important;padding:2rem 5rem 2rem 2rem!important}.alert .close{color:#fff!important;opacity:1!important;padding:2rem 2rem 0 0!important;right:0!important}.alert .icon{padding-left:2rem!important}.alert-warning{color:#404040!important}.alert-light .close,.alert-warning .close{color:#404040!important;opacity:1!important}"]
|
|
3250
|
-
},] }
|
|
3251
|
-
];
|
|
3252
|
-
AlertComponent.ctorParameters = () => [
|
|
3253
|
-
{ type: AlertService }
|
|
3254
|
-
];
|
|
3255
|
-
|
|
3256
|
-
/*
|
|
3257
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3258
|
-
*
|
|
3259
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3260
|
-
* you may not use this file except in compliance with the License.
|
|
3261
|
-
* You may obtain a copy of the License at
|
|
3262
|
-
*
|
|
3263
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3264
|
-
*
|
|
3265
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3266
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3267
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3268
|
-
* See the License for the specific language governing permissions and
|
|
3269
|
-
* limitations under the License.
|
|
3270
|
-
*/
|
|
3271
|
-
class AlertModule {
|
|
3272
|
-
}
|
|
3273
|
-
AlertModule.decorators = [
|
|
3274
|
-
{ type: NgModule, args: [{
|
|
3275
|
-
imports: [CommonModule],
|
|
3276
|
-
declarations: [AlertComponent],
|
|
3277
|
-
exports: [AlertComponent],
|
|
3278
|
-
},] }
|
|
3279
|
-
];
|
|
3280
|
-
|
|
3281
|
-
/*
|
|
3282
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3283
|
-
*
|
|
3284
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3285
|
-
* you may not use this file except in compliance with the License.
|
|
3286
|
-
* You may obtain a copy of the License at
|
|
3287
|
-
*
|
|
3288
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3289
|
-
*
|
|
3290
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3291
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3292
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3293
|
-
* See the License for the specific language governing permissions and
|
|
3294
|
-
* limitations under the License.
|
|
3295
|
-
*/
|
|
3296
|
-
class DataListComponent {
|
|
3297
|
-
constructor() { }
|
|
3298
|
-
ngOnInit() { }
|
|
3299
|
-
}
|
|
3300
|
-
DataListComponent.decorators = [
|
|
3301
|
-
{ type: Component, args: [{
|
|
3302
|
-
selector: 'valtimo-data-list',
|
|
3303
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"collection\">\n <dl class=\"row mb-0\" *ngFor=\"let item of collection\">\n <dd class=\"col-12 col-md-4 col-lg-3\">{{ item.label }}</dd>\n <dt class=\"col-12 col-md-8 col-lg-9\" [innerHTML]=\"item.value || '-'\"></dt>\n </dl>\n</div>\n\n<div *ngIf=\"object\">\n <dl class=\"row mb-0\" *ngFor=\"let item of object | keyvalue\">\n <dd class=\"col-12 col-md-4 col-lg-3\">{{ item.key }}</dd>\n <dt class=\"col-12 col-md-8 col-lg-9\" [innerHTML]=\"item.value || '-'\"></dt>\n </dl>\n</div>\n",
|
|
3304
|
-
styles: [""]
|
|
3305
|
-
},] }
|
|
3306
|
-
];
|
|
3307
|
-
DataListComponent.ctorParameters = () => [];
|
|
3308
|
-
DataListComponent.propDecorators = {
|
|
3309
|
-
collection: [{ type: Input }],
|
|
3310
|
-
object: [{ type: Input }]
|
|
3311
|
-
};
|
|
3312
|
-
|
|
3313
|
-
/*
|
|
3314
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3315
|
-
*
|
|
3316
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3317
|
-
* you may not use this file except in compliance with the License.
|
|
3318
|
-
* You may obtain a copy of the License at
|
|
3319
|
-
*
|
|
3320
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3321
|
-
*
|
|
3322
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3323
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3324
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3325
|
-
* See the License for the specific language governing permissions and
|
|
3326
|
-
* limitations under the License.
|
|
3327
|
-
*/
|
|
3328
|
-
class DataListModule {
|
|
3329
|
-
}
|
|
3330
|
-
DataListModule.decorators = [
|
|
3331
|
-
{ type: NgModule, args: [{
|
|
3332
|
-
declarations: [DataListComponent],
|
|
3333
|
-
imports: [CommonModule],
|
|
3334
|
-
exports: [DataListComponent],
|
|
3335
|
-
},] }
|
|
3336
|
-
];
|
|
3337
|
-
|
|
3338
|
-
class FormIoStateService {
|
|
3339
|
-
constructor() {
|
|
3340
|
-
this._documentDefinitionName$ = new BehaviorSubject(undefined);
|
|
3341
|
-
this._documentId$ = new BehaviorSubject(undefined);
|
|
3342
|
-
this._currentForm$ = new BehaviorSubject(undefined);
|
|
3343
|
-
}
|
|
3344
|
-
get documentDefinitionName$() {
|
|
3345
|
-
return this._documentDefinitionName$.asObservable();
|
|
3346
|
-
}
|
|
3347
|
-
setDocumentDefinitionName(documentDefinitionName) {
|
|
3348
|
-
this._documentDefinitionName$.next(documentDefinitionName);
|
|
3349
|
-
}
|
|
3350
|
-
get documentId$() {
|
|
3351
|
-
return this._documentId$.asObservable();
|
|
3352
|
-
}
|
|
3353
|
-
setDocumentId(documentId) {
|
|
3354
|
-
this._documentId$.next(documentId);
|
|
3355
|
-
}
|
|
3356
|
-
get currentForm$() {
|
|
3357
|
-
return this._currentForm$.asObservable();
|
|
3358
|
-
}
|
|
3359
|
-
set currentForm(form) {
|
|
3360
|
-
this._currentForm$.next(form);
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
FormIoStateService.ɵprov = ɵɵdefineInjectable({ factory: function FormIoStateService_Factory() { return new FormIoStateService(); }, token: FormIoStateService, providedIn: "root" });
|
|
3364
|
-
FormIoStateService.decorators = [
|
|
3365
|
-
{ type: Injectable, args: [{
|
|
3366
|
-
providedIn: 'root',
|
|
3367
|
-
},] }
|
|
3368
|
-
];
|
|
3369
|
-
|
|
3370
|
-
/*
|
|
3371
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3372
|
-
*
|
|
3373
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3374
|
-
* you may not use this file except in compliance with the License.
|
|
3375
|
-
* You may obtain a copy of the License at
|
|
3376
|
-
*
|
|
3377
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3378
|
-
*
|
|
3379
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3380
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3381
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3382
|
-
* See the License for the specific language governing permissions and
|
|
3383
|
-
* limitations under the License.
|
|
3384
|
-
*/
|
|
3385
|
-
class FormioComponent {
|
|
3386
|
-
constructor(userProviderService, logger, stateService, route, translateService) {
|
|
3387
|
-
this.userProviderService = userProviderService;
|
|
3388
|
-
this.logger = logger;
|
|
3389
|
-
this.stateService = stateService;
|
|
3390
|
-
this.route = route;
|
|
3391
|
-
this.translateService = translateService;
|
|
3392
|
-
this.submission = {};
|
|
3393
|
-
this.submit = new EventEmitter();
|
|
3394
|
-
this.change = new EventEmitter();
|
|
3395
|
-
this.refreshForm = new EventEmitter();
|
|
3396
|
-
this.errors = [];
|
|
3397
|
-
this.currentLanguage$ = new BehaviorSubject(this.translateService.currentLang);
|
|
3398
|
-
}
|
|
3399
|
-
ngOnInit() {
|
|
3400
|
-
const documentDefinitionName = this.route.snapshot.paramMap.get('documentDefinitionName');
|
|
3401
|
-
const documentId = this.route.snapshot.paramMap.get('documentId');
|
|
3402
|
-
const formDefinition = this.form;
|
|
3403
|
-
this.formDefinition = formDefinition;
|
|
3404
|
-
this.errors = [];
|
|
3405
|
-
this.setInitialToken();
|
|
3406
|
-
if (documentDefinitionName) {
|
|
3407
|
-
this.stateService.setDocumentDefinitionName(documentDefinitionName);
|
|
3408
|
-
}
|
|
3409
|
-
if (documentId) {
|
|
3410
|
-
this.stateService.setDocumentId(documentId);
|
|
3411
|
-
}
|
|
3412
|
-
this.subscribeFormRefresh();
|
|
3413
|
-
this.openLanguageSubscription();
|
|
3414
|
-
}
|
|
3415
|
-
ngOnChanges(changes) {
|
|
3416
|
-
const currentForm = changes.form.currentValue;
|
|
3417
|
-
this.formDefinition = currentForm;
|
|
3418
|
-
this.reloadForm();
|
|
3419
|
-
this.setInitialToken();
|
|
3420
|
-
if (changes.formDefinitionRefresh$) {
|
|
3421
|
-
this.unsubscribeFormRefresh();
|
|
3422
|
-
this.subscribeFormRefresh();
|
|
3423
|
-
}
|
|
3424
|
-
}
|
|
3425
|
-
ngOnDestroy() {
|
|
3426
|
-
var _a, _b;
|
|
3427
|
-
this.unsubscribeFormRefresh();
|
|
3428
|
-
(_a = this.tokenRefreshTimerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
3429
|
-
(_b = this.languageSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
3430
|
-
}
|
|
3431
|
-
reloadForm() {
|
|
3432
|
-
this.refreshForm.emit({
|
|
3433
|
-
form: this.formDefinition,
|
|
3434
|
-
});
|
|
3435
|
-
}
|
|
3436
|
-
showErrors(errors) {
|
|
3437
|
-
this.errors = errors;
|
|
3438
|
-
}
|
|
3439
|
-
onSubmit(submission) {
|
|
3440
|
-
this.errors = [];
|
|
3441
|
-
this.submit.emit(submission);
|
|
3442
|
-
}
|
|
3443
|
-
formReady(form) {
|
|
3444
|
-
this.reloadForm();
|
|
3445
|
-
this.stateService.currentForm = form;
|
|
3446
|
-
}
|
|
3447
|
-
onChange(object) {
|
|
3448
|
-
this.change.emit(object);
|
|
3449
|
-
}
|
|
3450
|
-
formHasLegacyUpload(formDefinition) {
|
|
3451
|
-
const stringifiedFormDefinition = JSON.stringify(formDefinition);
|
|
3452
|
-
const legacyUploadString = '"type":"file"';
|
|
3453
|
-
return stringifiedFormDefinition.includes(legacyUploadString);
|
|
3454
|
-
}
|
|
3455
|
-
setInitialToken() {
|
|
3456
|
-
this.userProviderService.getToken().then((token) => {
|
|
3457
|
-
this.setToken(token);
|
|
3458
|
-
});
|
|
3459
|
-
}
|
|
3460
|
-
setToken(token) {
|
|
3461
|
-
Formio.setToken(token);
|
|
3462
|
-
localStorage.setItem('formioToken', token);
|
|
3463
|
-
this.setTimerForTokenRefresh(token);
|
|
3464
|
-
this.logger.debug('New token set for form.io.');
|
|
3465
|
-
}
|
|
3466
|
-
setTimerForTokenRefresh(token) {
|
|
3467
|
-
const tokenExp = jwt_decode(token).exp * 1000;
|
|
3468
|
-
const expiryTime = tokenExp - Date.now() - 1000;
|
|
3469
|
-
if (!this.tokenRefreshTimerSubscription) {
|
|
3470
|
-
this.tokenRefreshTimerSubscription = timer(expiryTime).subscribe(() => {
|
|
3471
|
-
this.refreshToken();
|
|
3472
|
-
});
|
|
3473
|
-
}
|
|
3474
|
-
;
|
|
3475
|
-
this.logger.debug(`Timer for form.io token refresh set for: ${expiryTime}ms.`);
|
|
3476
|
-
}
|
|
3477
|
-
refreshToken() {
|
|
3478
|
-
from(this.userProviderService.updateToken(-1))
|
|
3479
|
-
.pipe(switchMap(() => this.userProviderService.getToken()), take(1))
|
|
3480
|
-
.subscribe(token => {
|
|
3481
|
-
this.setToken(token);
|
|
3482
|
-
});
|
|
3483
|
-
}
|
|
3484
|
-
subscribeFormRefresh() {
|
|
3485
|
-
if (this.formRefresh$) {
|
|
3486
|
-
this.formRefreshSubscription = this.formRefresh$.subscribe(refreshValue => {
|
|
3487
|
-
if (refreshValue) {
|
|
3488
|
-
this.refreshForm.emit(refreshValue);
|
|
3489
|
-
}
|
|
3490
|
-
});
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
unsubscribeFormRefresh() {
|
|
3494
|
-
if (this.formRefreshSubscription) {
|
|
3495
|
-
this.formRefreshSubscription.unsubscribe();
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
openLanguageSubscription() {
|
|
3499
|
-
this.languageSubscription = this.translateService.stream('key').subscribe(() => {
|
|
3500
|
-
this.currentLanguage$.next(this.translateService.currentLang);
|
|
3501
|
-
});
|
|
3502
|
-
}
|
|
3503
|
-
}
|
|
3504
|
-
FormioComponent.decorators = [
|
|
3505
|
-
{ type: Component, args: [{
|
|
3506
|
-
selector: 'valtimo-form-io',
|
|
3507
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n <formio\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [refresh]=\"refreshForm\"\n [options]=\"options\"\n [language]=\"currentLanguage$ | async\"\n (submit)=\"onSubmit($event)\"\n (ready)=\"formReady($event)\"\n (change)=\"onChange($event)\"\n ></formio>\n</div>\n",
|
|
3508
|
-
styles: [""]
|
|
3509
|
-
},] }
|
|
3510
|
-
];
|
|
3511
|
-
FormioComponent.ctorParameters = () => [
|
|
3512
|
-
{ type: UserProviderService },
|
|
3513
|
-
{ type: NGXLogger },
|
|
3514
|
-
{ type: FormIoStateService },
|
|
3515
|
-
{ type: ActivatedRoute },
|
|
3516
|
-
{ type: TranslateService }
|
|
3517
|
-
];
|
|
3518
|
-
FormioComponent.propDecorators = {
|
|
3519
|
-
form: [{ type: Input }],
|
|
3520
|
-
options: [{ type: Input }],
|
|
3521
|
-
submission: [{ type: Input }],
|
|
3522
|
-
formRefresh$: [{ type: Input }],
|
|
3523
|
-
submit: [{ type: Output }],
|
|
3524
|
-
change: [{ type: Output }]
|
|
3525
|
-
};
|
|
3526
|
-
|
|
3527
|
-
/*
|
|
3528
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3529
|
-
*
|
|
3530
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3531
|
-
* you may not use this file except in compliance with the License.
|
|
3532
|
-
* You may obtain a copy of the License at
|
|
3533
|
-
*
|
|
3534
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3535
|
-
*
|
|
3536
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3537
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3538
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3539
|
-
* See the License for the specific language governing permissions and
|
|
3540
|
-
* limitations under the License.
|
|
3541
|
-
*/
|
|
3542
|
-
class FormioBuilderComponent {
|
|
3543
|
-
constructor() {
|
|
3544
|
-
this.change = new EventEmitter();
|
|
3545
|
-
}
|
|
3546
|
-
ngOnInit() { }
|
|
3547
|
-
onChange(event) {
|
|
3548
|
-
this.change.emit(event);
|
|
3549
|
-
}
|
|
3550
|
-
}
|
|
3551
|
-
FormioBuilderComponent.decorators = [
|
|
3552
|
-
{ type: Component, args: [{
|
|
3553
|
-
selector: 'valtimo-form-io-builder',
|
|
3554
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <form-builder [form]=\"form\" (change)=\"onChange($event)\"></form-builder>\n</div>\n",
|
|
3555
|
-
styles: [""]
|
|
3556
|
-
},] }
|
|
3557
|
-
];
|
|
3558
|
-
FormioBuilderComponent.ctorParameters = () => [];
|
|
3559
|
-
FormioBuilderComponent.propDecorators = {
|
|
3560
|
-
form: [{ type: Input }],
|
|
3561
|
-
change: [{ type: Output }]
|
|
3562
|
-
};
|
|
3563
|
-
|
|
3564
|
-
/*
|
|
3565
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3566
|
-
*
|
|
3567
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3568
|
-
* you may not use this file except in compliance with the License.
|
|
3569
|
-
* You may obtain a copy of the License at
|
|
3570
|
-
*
|
|
3571
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3572
|
-
*
|
|
3573
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3574
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3575
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3576
|
-
* See the License for the specific language governing permissions and
|
|
3577
|
-
* limitations under the License.
|
|
3578
|
-
*/
|
|
3579
|
-
const AppConfig = {
|
|
3580
|
-
appUrl: 'http://localhost:4200',
|
|
3581
|
-
apiUrl: 'http://localhost:4200',
|
|
3582
|
-
icons: 'fontawesome',
|
|
3583
|
-
formOnly: false,
|
|
3584
|
-
};
|
|
3585
|
-
|
|
3586
|
-
class FormIoDomService {
|
|
3587
|
-
constructor(stateService) {
|
|
3588
|
-
this.stateService = stateService;
|
|
3589
|
-
}
|
|
3590
|
-
toggleSubmitButton(disabled) {
|
|
3591
|
-
this.stateService.currentForm$.pipe(take(1)).subscribe(form => {
|
|
3592
|
-
const button = form.formioElement.nativeElement
|
|
3593
|
-
.getElementsByClassName('formio-component-submit')[0]
|
|
3594
|
-
.getElementsByClassName('btn-primary')[0];
|
|
3595
|
-
button.disabled = disabled;
|
|
3596
|
-
});
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
FormIoDomService.decorators = [
|
|
3600
|
-
{ type: Injectable }
|
|
3601
|
-
];
|
|
3602
|
-
FormIoDomService.ctorParameters = () => [
|
|
3603
|
-
{ type: FormIoStateService }
|
|
3604
|
-
];
|
|
3605
|
-
|
|
3606
|
-
class FormIoUploaderComponent {
|
|
3607
|
-
constructor(uploadProviderService, stateService, domService, downloadService) {
|
|
3608
|
-
this.uploadProviderService = uploadProviderService;
|
|
3609
|
-
this.stateService = stateService;
|
|
3610
|
-
this.domService = domService;
|
|
3611
|
-
this.downloadService = downloadService;
|
|
3612
|
-
this.valueChange = new EventEmitter();
|
|
3613
|
-
this.uploading$ = new BehaviorSubject(false);
|
|
3614
|
-
this._value = [];
|
|
3615
|
-
}
|
|
3616
|
-
get value() {
|
|
3617
|
-
return this._value;
|
|
3618
|
-
}
|
|
3619
|
-
set value(value) {
|
|
3620
|
-
if (Array.isArray(value)) {
|
|
3621
|
-
this._value = value;
|
|
3622
|
-
}
|
|
3623
|
-
}
|
|
3624
|
-
downloadFile(resourceFile) {
|
|
3625
|
-
this.uploadProviderService
|
|
3626
|
-
.getResource(resourceFile.data.resourceId)
|
|
3627
|
-
.subscribe((resource) => {
|
|
3628
|
-
this.downloadService.downloadFile(resource.url, resource.resource.name);
|
|
3629
|
-
});
|
|
3630
|
-
}
|
|
3631
|
-
fileSelected(file) {
|
|
3632
|
-
this.domService.toggleSubmitButton(true);
|
|
3633
|
-
this.uploading$.next(true);
|
|
3634
|
-
this.stateService.documentDefinitionName$.pipe(take(1)).subscribe(name => {
|
|
3635
|
-
this.uploadProviderService.uploadFile(file, name).subscribe(result => {
|
|
3636
|
-
this.domService.toggleSubmitButton(false);
|
|
3637
|
-
this.uploading$.next(false);
|
|
3638
|
-
this._value.push(result);
|
|
3639
|
-
this.valueChange.emit(this._value);
|
|
3640
|
-
});
|
|
3641
|
-
});
|
|
3642
|
-
}
|
|
3643
|
-
deleteFile(resourceId) {
|
|
3644
|
-
this.domService.toggleSubmitButton(true);
|
|
3645
|
-
this._value = this._value.filter((file) => { var _a; return (file === null || file === void 0 ? void 0 : file.data) ? ((_a = file === null || file === void 0 ? void 0 : file.data) === null || _a === void 0 ? void 0 : _a.resourceId) !== resourceId : true; });
|
|
3646
|
-
this.valueChange.emit(this._value);
|
|
3647
|
-
}
|
|
3648
|
-
}
|
|
3649
|
-
FormIoUploaderComponent.decorators = [
|
|
3650
|
-
{ type: Component, args: [{
|
|
3651
|
-
selector: 'valtimo-formio-uploader',
|
|
3652
|
-
template: "<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"null\"\n [disabled]=\"disabled\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"hideTitle\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"!hideMaxFileSize\"\n [subtitle]=\"subtitle\"\n [title]=\"title\"\n [camera]=\"camera\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<div class=\"file-preview\" *ngFor=\"let resource of _value\">\n <div class=\"file-preview-name\">\n <a href=\"#\" (click)=\"downloadFile(resource)\">\n {{ resource.originalName }}\n </a>\n </div>\n <div class=\"file-preview-size\">\n <span>\n {{ resource.size | filesize }}\n </span>\n </div>\n <div class=\"file-preview-delete\" *ngIf=\"!disabled\">\n <a (click)=\"deleteFile(resource.data.resourceId)\">\n <i class=\"icon mdi mdi-delete\"></i>\n </a>\n </div>\n</div>\n",
|
|
3653
|
-
styles: [".progress-bar-container{padding:15px 20px}::ng-deep .formio-component-valtimo-file .btn-secondary,::ng-deep .formio-component-valtimo-file .formio-button-add-another{display:none}::ng-deep .formio-component-valtimo-file td{border:none;padding:0!important}::ng-deep .formio-component-valtimo-file .table{border:none;border-collapse:collapse;margin:10px 0}.dropzone-container{margin-bottom:12px}.file-preview{border:1px solid #dee2e6;display:flex;margin-top:-1px}.file-preview div{padding:12px 10px}.file-preview .file-preview-name{width:65%}.file-preview .file-preview-size{width:35%}.file-preview .icon{color:#a1a1a1;cursor:pointer;font-size:1.3846rem;line-height:18px}.file-preview .icon:hover{color:grey}"]
|
|
3654
|
-
},] }
|
|
3655
|
-
];
|
|
3656
|
-
FormIoUploaderComponent.ctorParameters = () => [
|
|
3657
|
-
{ type: UploadProviderService },
|
|
3658
|
-
{ type: FormIoStateService },
|
|
3659
|
-
{ type: FormIoDomService },
|
|
3660
|
-
{ type: DownloadService }
|
|
3661
|
-
];
|
|
3662
|
-
FormIoUploaderComponent.propDecorators = {
|
|
3663
|
-
disabled: [{ type: Input }],
|
|
3664
|
-
title: [{ type: Input }],
|
|
3665
|
-
hideTitle: [{ type: Input }],
|
|
3666
|
-
subtitle: [{ type: Input }],
|
|
3667
|
-
maxFileSize: [{ type: Input }],
|
|
3668
|
-
hideMaxFileSize: [{ type: Input }],
|
|
3669
|
-
camera: [{ type: Input }],
|
|
3670
|
-
valueChange: [{ type: Output }],
|
|
3671
|
-
value: [{ type: Input }]
|
|
3672
|
-
};
|
|
3673
|
-
|
|
3674
|
-
/*
|
|
3675
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3676
|
-
*
|
|
3677
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3678
|
-
* you may not use this file except in compliance with the License.
|
|
3679
|
-
* You may obtain a copy of the License at
|
|
3680
|
-
*
|
|
3681
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3682
|
-
*
|
|
3683
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3684
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3685
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3686
|
-
* See the License for the specific language governing permissions and
|
|
3687
|
-
* limitations under the License.
|
|
3688
|
-
*/
|
|
3689
|
-
class DropzoneComponent {
|
|
3690
|
-
constructor(translateService) {
|
|
3691
|
-
this.translateService = translateService;
|
|
3692
|
-
this.externalError$ = new BehaviorSubject('');
|
|
3693
|
-
this.maxFileSize = 5;
|
|
3694
|
-
this.showMaxFileSize = true;
|
|
3695
|
-
this.acceptedFiles = '.json';
|
|
3696
|
-
this.clear$ = new Subject();
|
|
3697
|
-
this.camera = false;
|
|
3698
|
-
this.fileSelected = new EventEmitter();
|
|
3699
|
-
this.file$ = new BehaviorSubject(undefined);
|
|
3700
|
-
this.showingCamera$ = new BehaviorSubject(false);
|
|
3701
|
-
this.error$ = new BehaviorSubject('');
|
|
3702
|
-
this.errorMessagesStrings = {
|
|
3703
|
-
tooBig: 'too big',
|
|
3704
|
-
wrongType: 'this type',
|
|
3705
|
-
};
|
|
3706
|
-
this.errorMessage$ = combineLatest([
|
|
3707
|
-
this.error$,
|
|
3708
|
-
this.translateService.stream('dropzone.error.generic'),
|
|
3709
|
-
this.translateService.stream('dropzone.error.tooBig'),
|
|
3710
|
-
this.translateService.stream('dropzone.error.wrongType'),
|
|
3711
|
-
]).pipe(map(([dropzoneError, generic, tooBig, wrongType]) => {
|
|
3712
|
-
const strings = this.errorMessagesStrings;
|
|
3713
|
-
if (dropzoneError) {
|
|
3714
|
-
if (dropzoneError.includes(strings.tooBig)) {
|
|
3715
|
-
return tooBig;
|
|
3716
|
-
}
|
|
3717
|
-
else if (dropzoneError.includes(strings.wrongType)) {
|
|
3718
|
-
return wrongType;
|
|
3719
|
-
}
|
|
3720
|
-
else {
|
|
3721
|
-
return generic;
|
|
3722
|
-
}
|
|
3723
|
-
}
|
|
3724
|
-
else {
|
|
3725
|
-
return '';
|
|
3726
|
-
}
|
|
3727
|
-
}));
|
|
3728
|
-
}
|
|
3729
|
-
ngOnInit() {
|
|
3730
|
-
this.clearSubscription = this.clear$.subscribe(() => {
|
|
3731
|
-
this.clearFile();
|
|
3732
|
-
this.clearError();
|
|
3733
|
-
});
|
|
3734
|
-
}
|
|
3735
|
-
ngAfterViewInit() {
|
|
3736
|
-
this.initDropzone();
|
|
3737
|
-
}
|
|
3738
|
-
ngOnDestroy() {
|
|
3739
|
-
this.clearSubscription.unsubscribe();
|
|
3740
|
-
}
|
|
3741
|
-
showCamera() {
|
|
3742
|
-
this.showingCamera$.next(true);
|
|
3743
|
-
}
|
|
3744
|
-
webcamImageSaved(image) {
|
|
3745
|
-
if (image) {
|
|
3746
|
-
this.setFile(image);
|
|
3747
|
-
}
|
|
3748
|
-
this.showingCamera$.next(false);
|
|
3749
|
-
}
|
|
3750
|
-
initDropzone() {
|
|
3751
|
-
this.dropzone = new Dropzone(this.dropzoneRef.nativeElement, {
|
|
3752
|
-
url: '/',
|
|
3753
|
-
maxFilesize: this.maxFileSize,
|
|
3754
|
-
clickable: this.dropzoneRef.nativeElement,
|
|
3755
|
-
autoProcessQueue: false,
|
|
3756
|
-
createImageThumbnails: false,
|
|
3757
|
-
acceptedFiles: this.acceptedFiles,
|
|
3758
|
-
previewTemplate: `<p style='display:none'></p>`,
|
|
3759
|
-
accept: file => {
|
|
3760
|
-
this.dropzone.removeAllFiles();
|
|
3761
|
-
this.setFile(file);
|
|
3762
|
-
},
|
|
3763
|
-
});
|
|
3764
|
-
this.setDropzoneEvents();
|
|
3765
|
-
}
|
|
3766
|
-
setDropzoneEvents() {
|
|
3767
|
-
this.dropzone.on('error', (file, message) => {
|
|
3768
|
-
this.clearFile();
|
|
3769
|
-
this.error$.next(message.toString());
|
|
3770
|
-
});
|
|
3771
|
-
}
|
|
3772
|
-
clearFile() {
|
|
3773
|
-
this.file$.next(undefined);
|
|
3774
|
-
}
|
|
3775
|
-
clearError() {
|
|
3776
|
-
this.error$.next('');
|
|
3777
|
-
}
|
|
3778
|
-
setFile(file) {
|
|
3779
|
-
this.file$.next(file);
|
|
3780
|
-
this.clearError();
|
|
3781
|
-
this.fileSelected.emit(file);
|
|
3782
|
-
}
|
|
3783
|
-
}
|
|
3784
|
-
DropzoneComponent.decorators = [
|
|
3785
|
-
{ type: Component, args: [{
|
|
3786
|
-
selector: 'valtimo-dropzone',
|
|
3787
|
-
template: "<form #dropzone [ngClass]=\"{disabled: disabled || uploading}\" class=\"dropzone dz-clickable\">\n <div class=\"dz-message\">\n <div class=\"icon\"><span class=\"mdi mdi-cloud-upload\"></span></div>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n <ng-container *ngIf=\"uploading\">\n <ng-container *ngTemplateOutlet=\"progressBar\"></ng-container>\n </ng-container>\n <div class=\"dropzone-mobile-trigger needsclick\"></div>\n </div>\n <button\n (click)=\"showCamera()\"\n *ngIf=\"camera\"\n type=\"button\"\n class=\"btn btn-primary px-3 webcam-button\"\n >\n <i class=\"icon mdi mdi-camera\" aria-hidden=\"true\"></i>\n </button>\n <ng-container *ngIf=\"showingCamera$ | async\">\n <ng-container *ngTemplateOutlet=\"webcam\"></ng-container>\n </ng-container>\n</form>\n\n<ng-template #body>\n <h2 *ngIf=\"!hideTitle\" class=\"mb-4 mt-2\">{{ title || ('dropzone.drop' | translate) }}</h2>\n <span *ngIf=\"subtitle\" class=\"note mb-3\">{{ subtitle }}</span>\n <span *ngIf=\"showMaxFileSize\" class=\"note mb-3 small-font\"\n >{{ 'dropzone.maxFileSize' | translate }}<b>{{ maxFileSize }}mb</b></span\n >\n <ng-container *ngTemplateOutlet=\"preview\"></ng-container>\n</ng-template>\n\n<ng-template #preview>\n <ng-container\n *ngIf=\"{\n errorMessage: errorMessage$ | async,\n externalError: externalError$ | async,\n file: file$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"obs.externalError || obs.errorMessage\">\n <div class=\"alert alert-danger mt-2 mb-0\">\n <div class=\"message\">\n {{ obs.externalError || obs.errorMessage }}\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!hideFilePreview && obs.file && !obs.externalError && !obs.errorMessage\">\n <div class=\"file\">\n <i class=\"icon mdi mdi-file-text mr-2\"></i>\n <span class=\"note\">{{ obs.file.name }}</span>\n <span class=\"note file-size\">- {{ obs.file.size | filesize: 2 }}</span>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #progressBar>\n <div class=\"progress-bar-container\">\n <valtimo-progress-bar></valtimo-progress-bar>\n </div>\n</ng-template>\n\n<ng-template #webcam>\n <valtimo-webcam (imageSaved)=\"webcamImageSaved($event)\"></valtimo-webcam>\n</ng-template>\n",
|
|
3788
|
-
styles: ["form.dropzone{padding:30px 20px}form.dropzone h2{font-size:2rem;text-align:center}form.dropzone.disabled{cursor:default;opacity:.7;pointer-events:none}form.dropzone.preview{border:none;padding:15px 20px}.dz-message{align-items:center;display:flex;flex-direction:column}.dropzone-mobile-trigger{cursor:pointer}.alert-light{align-items:center;display:flex}form.dropzone .mdi{background-color:transparent;border-radius:0;display:inline-block;height:auto;margin-bottom:0;padding:0;width:auto}form.dropzone .message{padding:1.385rem 2.1542rem}.file{align-items:center;display:flex;flex-direction:row;font-size:1.5rem}.small-font{color:#959595;font-size:1rem}.file-size{margin-left:5px}.progress-bar-container{bottom:0;height:auto;position:absolute;width:100%}.webcam-button{position:absolute;right:10px;top:10px}"]
|
|
3789
|
-
},] }
|
|
3790
|
-
];
|
|
3791
|
-
DropzoneComponent.ctorParameters = () => [
|
|
3792
|
-
{ type: TranslateService }
|
|
3793
|
-
];
|
|
3794
|
-
DropzoneComponent.propDecorators = {
|
|
3795
|
-
dropzoneRef: [{ type: ViewChild, args: ['dropzone',] }],
|
|
3796
|
-
title: [{ type: Input }],
|
|
3797
|
-
hideTitle: [{ type: Input }],
|
|
3798
|
-
subtitle: [{ type: Input }],
|
|
3799
|
-
externalError$: [{ type: Input }],
|
|
3800
|
-
maxFileSize: [{ type: Input }],
|
|
3801
|
-
showMaxFileSize: [{ type: Input }],
|
|
3802
|
-
acceptedFiles: [{ type: Input }],
|
|
3803
|
-
clear$: [{ type: Input }],
|
|
3804
|
-
disabled: [{ type: Input }],
|
|
3805
|
-
hideFilePreview: [{ type: Input }],
|
|
3806
|
-
uploading: [{ type: Input }],
|
|
3807
|
-
camera: [{ type: Input }],
|
|
3808
|
-
fileSelected: [{ type: Output }]
|
|
3809
|
-
};
|
|
3810
|
-
|
|
3811
|
-
/*
|
|
3812
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3813
|
-
*
|
|
3814
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3815
|
-
* you may not use this file except in compliance with the License.
|
|
3816
|
-
* You may obtain a copy of the License at
|
|
3817
|
-
*
|
|
3818
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3819
|
-
*
|
|
3820
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3821
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3822
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3823
|
-
* See the License for the specific language governing permissions and
|
|
3824
|
-
* limitations under the License.
|
|
3825
|
-
*/
|
|
3826
|
-
class ProgressBarComponent {
|
|
3827
|
-
}
|
|
3828
|
-
ProgressBarComponent.decorators = [
|
|
3829
|
-
{ type: Component, args: [{
|
|
3830
|
-
selector: 'valtimo-progress-bar',
|
|
3831
|
-
template: "<div class=\"progress\" style=\"position: relative\">\n <div class=\"progress-bar progress-bar-striped indeterminate\"></div>\n</div>\n",
|
|
3832
|
-
styles: [".progress-bar.indeterminate{-webkit-animation:progress-indeterminate 3s linear infinite;animation:progress-indeterminate 3s linear infinite;position:relative}@-webkit-keyframes progress-indeterminate{0%{left:-25%;width:25%}to{left:100%;width:25%}}@keyframes progress-indeterminate{0%{left:-25%;width:25%}to{left:100%;width:25%}}"]
|
|
3833
|
-
},] }
|
|
3834
|
-
];
|
|
3835
|
-
|
|
3836
|
-
/*
|
|
3837
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3838
|
-
*
|
|
3839
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3840
|
-
* you may not use this file except in compliance with the License.
|
|
3841
|
-
* You may obtain a copy of the License at
|
|
3842
|
-
*
|
|
3843
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3844
|
-
*
|
|
3845
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3846
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3847
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3848
|
-
* See the License for the specific language governing permissions and
|
|
3849
|
-
* limitations under the License.
|
|
3850
|
-
*/
|
|
3851
|
-
class ProgressBarModule {
|
|
3852
|
-
}
|
|
3853
|
-
ProgressBarModule.decorators = [
|
|
3854
|
-
{ type: NgModule, args: [{
|
|
3855
|
-
declarations: [ProgressBarComponent],
|
|
3856
|
-
imports: [CommonModule],
|
|
3857
|
-
exports: [ProgressBarComponent],
|
|
3858
|
-
},] }
|
|
3859
|
-
];
|
|
3860
|
-
|
|
3861
|
-
/*
|
|
3862
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3863
|
-
*
|
|
3864
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3865
|
-
* you may not use this file except in compliance with the License.
|
|
3866
|
-
* You may obtain a copy of the License at
|
|
3867
|
-
*
|
|
3868
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3869
|
-
*
|
|
3870
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3871
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3872
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3873
|
-
* See the License for the specific language governing permissions and
|
|
3874
|
-
* limitations under the License.
|
|
3875
|
-
*/
|
|
3876
|
-
class WebcamComponent {
|
|
3877
|
-
constructor() {
|
|
3878
|
-
this.imageSaved = new EventEmitter();
|
|
3879
|
-
this.showing$ = new BehaviorSubject(false);
|
|
3880
|
-
this.stream$ = new BehaviorSubject(undefined);
|
|
3881
|
-
this.picture$ = new BehaviorSubject(undefined);
|
|
3882
|
-
}
|
|
3883
|
-
ngAfterViewInit() {
|
|
3884
|
-
const video = this.getVideoElement();
|
|
3885
|
-
setTimeout(() => {
|
|
3886
|
-
this.toggleFade();
|
|
3887
|
-
});
|
|
3888
|
-
if (navigator.mediaDevices.getUserMedia) {
|
|
3889
|
-
navigator.mediaDevices.getUserMedia({ video: true }).then(stream => {
|
|
3890
|
-
video.srcObject = stream;
|
|
3891
|
-
this.stream$.next(stream);
|
|
3892
|
-
});
|
|
3893
|
-
}
|
|
3894
|
-
}
|
|
3895
|
-
captureImage() {
|
|
3896
|
-
const video = this.getVideoElement();
|
|
3897
|
-
const canvas = document.querySelector('#canvas');
|
|
3898
|
-
canvas.width = 640;
|
|
3899
|
-
canvas.height = 480;
|
|
3900
|
-
const ctx = canvas.getContext('2d');
|
|
3901
|
-
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
3902
|
-
const dataURI = canvas.toDataURL('image/jpeg');
|
|
3903
|
-
this.picture$.next({ file: this.dataURItoFile(dataURI), uri: dataURI });
|
|
3904
|
-
return false;
|
|
3905
|
-
}
|
|
3906
|
-
clearImage() {
|
|
3907
|
-
this.picture$.next(undefined);
|
|
3908
|
-
return false;
|
|
3909
|
-
}
|
|
3910
|
-
close(emitImage = true) {
|
|
3911
|
-
if (!emitImage) {
|
|
3912
|
-
this.clearImage();
|
|
3913
|
-
}
|
|
3914
|
-
this.toggleFade();
|
|
3915
|
-
this.emitOnTimeOut();
|
|
3916
|
-
return false;
|
|
3917
|
-
}
|
|
3918
|
-
stopStream() {
|
|
3919
|
-
this.stream$.pipe(take(1)).subscribe(mediaStream => {
|
|
3920
|
-
if (mediaStream) {
|
|
3921
|
-
mediaStream.getTracks().forEach(stream => stream.stop());
|
|
3922
|
-
}
|
|
3923
|
-
});
|
|
3924
|
-
}
|
|
3925
|
-
getVideoElement() {
|
|
3926
|
-
return document.querySelector('#videoElement');
|
|
3927
|
-
}
|
|
3928
|
-
emitOnTimeOut() {
|
|
3929
|
-
setTimeout(() => {
|
|
3930
|
-
var _a;
|
|
3931
|
-
this.stopStream();
|
|
3932
|
-
this.imageSaved.emit((_a = this.picture$.getValue()) === null || _a === void 0 ? void 0 : _a.file);
|
|
3933
|
-
}, 250);
|
|
3934
|
-
}
|
|
3935
|
-
toggleFade() {
|
|
3936
|
-
this.showing$.next(!this.showing$.getValue());
|
|
3937
|
-
}
|
|
3938
|
-
dataURItoFile(dataURI) {
|
|
3939
|
-
const binary = atob(dataURI.split(',')[1]);
|
|
3940
|
-
const array = [];
|
|
3941
|
-
for (let i = 0; i < binary.length; i++) {
|
|
3942
|
-
array.push(binary.charCodeAt(i));
|
|
3943
|
-
}
|
|
3944
|
-
const blob = new Blob([new Uint8Array(array)], { type: 'image/jpeg' });
|
|
3945
|
-
const imgFileName = `IMG_${new Date().toISOString().replace(/[-:.]/g, '')}.jpg`;
|
|
3946
|
-
return new File([blob], imgFileName);
|
|
3947
|
-
}
|
|
3948
|
-
}
|
|
3949
|
-
WebcamComponent.decorators = [
|
|
3950
|
-
{ type: Component, args: [{
|
|
3951
|
-
selector: 'valtimo-webcam',
|
|
3952
|
-
template: "<div\n (click)=\"close(false)\"\n *ngIf=\"{picture: picture$ | async, stream: stream$ | async} as obs\"\n [ngClass]=\"{showing: showing$ | async}\"\n class=\"webcam-overlay\"\n>\n <div (click)=\"(false); $event.stopPropagation()\" class=\"inner-container\">\n <div class=\"webcam-container modal-content\">\n <div class=\"video-container\">\n <video autoplay=\"true\" id=\"videoElement\"></video>\n <canvas id=\"canvas\"></canvas>\n <img *ngIf=\"obs.picture?.uri\" [src]=\"obs.picture?.uri\" />\n </div>\n <div class=\"button-container\">\n <div class=\"picture-btn\">\n <button\n (click)=\"captureImage()\"\n [disabled]=\"obs.picture?.file || !obs.stream\"\n class=\"btn btn-primary btn-lg\"\n >\n <i class=\"icon mdi mdi-camera mr-1\"></i>{{ 'webcam.takePicture' | translate }}\n </button>\n </div>\n <div class=\"new-btn\">\n <button (click)=\"clearImage()\" [disabled]=\"!obs.picture?.file\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-redo mr-1\"></i>{{ 'webcam.redo' | translate }}\n </button>\n </div>\n <div class=\"save-btn\">\n <button (click)=\"close()\" [disabled]=\"!obs.picture?.file\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-save mr-1\"></i>{{ 'webcam.save' | translate }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"modal-header\">\n <button (click)=\"close(false)\" aria-label=\"Close\" class=\"close\"><span>\u00D7</span></button>\n </div>\n </div>\n</div>\n",
|
|
3953
|
-
styles: [".webcam-overlay{align-items:center;background-color:rgba(0,0,0,.65);display:flex;height:100%;justify-content:center;left:0;opacity:0;position:fixed;top:0;transition:opacity .15s linear;width:100%;z-index:9999}.showing{opacity:1}.webcam-container{padding:20px}.button-container{align-items:center;display:flex;height:30px;justify-content:space-evenly;margin-bottom:10px;margin-top:20px}.button-container i{margin-right:5px}.new-btn,.picture-btn,.save-btn{display:flex;justify-content:center;position:absolute}.new-btn .icon,.picture-btn .icon,.save-btn .icon{background-color:unset;border-radius:unset;display:inline-block;height:unset;margin-bottom:0;padding:0;width:unset}.new-btn,.save-btn{width:calc(50% - 65px)}.picture-btn{left:0;width:100%}.new-btn{left:0}.save-btn{right:0}.modal-header{color:grey;margin-top:35px;padding:0;position:absolute;right:-18px;top:0}.close{color:grey}.inner-container{position:relative}.video-container{height:495px;overflow:hidden}.video-container img,.video-container video{height:495px;position:absolute;width:660px}.video-container img{-o-object-fit:cover;object-fit:cover}#canvas{display:none}"]
|
|
3954
|
-
},] }
|
|
3955
|
-
];
|
|
3956
|
-
WebcamComponent.propDecorators = {
|
|
3957
|
-
imageSaved: [{ type: Output }]
|
|
3958
|
-
};
|
|
3959
|
-
|
|
3960
|
-
/*
|
|
3961
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3962
|
-
*
|
|
3963
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3964
|
-
* you may not use this file except in compliance with the License.
|
|
3965
|
-
* You may obtain a copy of the License at
|
|
3966
|
-
*
|
|
3967
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3968
|
-
*
|
|
3969
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3970
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3971
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3972
|
-
* See the License for the specific language governing permissions and
|
|
3973
|
-
* limitations under the License.
|
|
3974
|
-
*/
|
|
3975
|
-
class WebcamModule {
|
|
3976
|
-
}
|
|
3977
|
-
WebcamModule.decorators = [
|
|
3978
|
-
{ type: NgModule, args: [{
|
|
3979
|
-
declarations: [WebcamComponent],
|
|
3980
|
-
imports: [CommonModule, TranslateModule],
|
|
3981
|
-
exports: [WebcamComponent],
|
|
3982
|
-
},] }
|
|
3983
|
-
];
|
|
3984
|
-
|
|
3985
|
-
/*
|
|
3986
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
3987
|
-
*
|
|
3988
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3989
|
-
* you may not use this file except in compliance with the License.
|
|
3990
|
-
* You may obtain a copy of the License at
|
|
3991
|
-
*
|
|
3992
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3993
|
-
*
|
|
3994
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3995
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
3996
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3997
|
-
* See the License for the specific language governing permissions and
|
|
3998
|
-
* limitations under the License.
|
|
3999
|
-
*/
|
|
4000
|
-
class DropzoneModule {
|
|
4001
|
-
}
|
|
4002
|
-
DropzoneModule.decorators = [
|
|
4003
|
-
{ type: NgModule, args: [{
|
|
4004
|
-
declarations: [DropzoneComponent],
|
|
4005
|
-
imports: [CommonModule, TranslateModule, FileSizeModule, ProgressBarModule, WebcamModule],
|
|
4006
|
-
exports: [DropzoneComponent],
|
|
4007
|
-
},] }
|
|
4008
|
-
];
|
|
4009
|
-
|
|
4010
|
-
/*
|
|
4011
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4012
|
-
*
|
|
4013
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4014
|
-
* you may not use this file except in compliance with the License.
|
|
4015
|
-
* You may obtain a copy of the License at
|
|
4016
|
-
*
|
|
4017
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4018
|
-
*
|
|
4019
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4020
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4021
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4022
|
-
* See the License for the specific language governing permissions and
|
|
4023
|
-
* limitations under the License.
|
|
4024
|
-
*/
|
|
4025
|
-
const ɵ0$1 = AppConfig;
|
|
4026
|
-
class FormIoModule {
|
|
4027
|
-
}
|
|
4028
|
-
FormIoModule.decorators = [
|
|
4029
|
-
{ type: NgModule, args: [{
|
|
4030
|
-
imports: [
|
|
4031
|
-
CommonModule,
|
|
4032
|
-
FormioModule,
|
|
4033
|
-
DropzoneModule,
|
|
4034
|
-
TranslateModule,
|
|
4035
|
-
DocumentModule,
|
|
4036
|
-
FileSizeModule,
|
|
4037
|
-
ResourceModule,
|
|
4038
|
-
RouterModule,
|
|
4039
|
-
],
|
|
4040
|
-
declarations: [FormioComponent, FormioBuilderComponent, FormIoUploaderComponent],
|
|
4041
|
-
exports: [FormioComponent, FormioBuilderComponent, FormIoUploaderComponent],
|
|
4042
|
-
providers: [FormIoDomService, { provide: FormioAppConfig, useValue: ɵ0$1 }],
|
|
4043
|
-
},] }
|
|
4044
|
-
];
|
|
4045
|
-
|
|
4046
|
-
/*
|
|
4047
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4048
|
-
*
|
|
4049
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4050
|
-
* you may not use this file except in compliance with the License.
|
|
4051
|
-
* You may obtain a copy of the License at
|
|
4052
|
-
*
|
|
4053
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4054
|
-
*
|
|
4055
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4056
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4057
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4058
|
-
* See the License for the specific language governing permissions and
|
|
4059
|
-
* limitations under the License.
|
|
4060
|
-
*/
|
|
4061
|
-
class ModalComponent {
|
|
4062
|
-
constructor() {
|
|
4063
|
-
this.title = '';
|
|
4064
|
-
this.subtitle = '';
|
|
4065
|
-
this.showFooter = false;
|
|
4066
|
-
}
|
|
4067
|
-
ngAfterViewInit() {
|
|
4068
|
-
$(`#${this.elementId}`).modal({ show: false });
|
|
4069
|
-
}
|
|
4070
|
-
show() {
|
|
4071
|
-
$(`#${this.elementId}`).modal('show');
|
|
4072
|
-
}
|
|
4073
|
-
hide() {
|
|
4074
|
-
$(`#${this.elementId}`).modal('hide');
|
|
4075
|
-
}
|
|
4076
|
-
}
|
|
4077
|
-
ModalComponent.decorators = [
|
|
4078
|
-
{ type: Component, args: [{
|
|
4079
|
-
selector: 'valtimo-modal',
|
|
4080
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"modal fade custom-width\" [id]=\"elementId\" role=\"dialog\" aria-modal=\"true\">\n <div class=\"modal-dialog modal-lg\">\n <div class=\"modal-content\">\n <div class=\"modal-header modal-header-colored colored-header-grey\">\n <div class=\"modal-title\">\n <h4 class=\"title-text mb-2\">{{ title }}</h4>\n <h5 class=\"subtitle-text\">{{ subtitle }}</h5>\n <ng-container *ngIf=\"templateBelowSubtitle\">\n <ng-container *ngTemplateOutlet=\"templateBelowSubtitle\"></ng-container>\n </ng-container>\n </div>\n <div class=\"text-right\">\n <img src=\"assets/modal/header-image.png\" class=\"modal-header-image\" />\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n </div>\n <div class=\"modal-body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"modal-footer\" *ngIf=\"showFooter\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n",
|
|
4081
|
-
styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.colored-header-grey{background-color:#f3f4f7}.title-text{color:#585555}.subtitle-text{color:#959595}.modal-header-image{height:auto;width:50%}.modal-header{border-bottom:1px solid #c5c6c9;padding-bottom:.66rem}@media (min-width:768px){.close{left:25px;margin-top:-20px!important;padding:0!important;position:relative}.close span{color:#fff}.modal-content{overflow:visible}}"]
|
|
4082
|
-
},] }
|
|
4083
|
-
];
|
|
4084
|
-
ModalComponent.ctorParameters = () => [];
|
|
4085
|
-
ModalComponent.propDecorators = {
|
|
4086
|
-
elementId: [{ type: Input }],
|
|
4087
|
-
title: [{ type: Input }],
|
|
4088
|
-
subtitle: [{ type: Input }],
|
|
4089
|
-
templateBelowSubtitle: [{ type: Input }],
|
|
4090
|
-
showFooter: [{ type: Input }]
|
|
4091
|
-
};
|
|
4092
|
-
|
|
4093
|
-
/*
|
|
4094
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4095
|
-
*
|
|
4096
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4097
|
-
* you may not use this file except in compliance with the License.
|
|
4098
|
-
* You may obtain a copy of the License at
|
|
4099
|
-
*
|
|
4100
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4101
|
-
*
|
|
4102
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4103
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4104
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4105
|
-
* See the License for the specific language governing permissions and
|
|
4106
|
-
* limitations under the License.
|
|
4107
|
-
*/
|
|
4108
|
-
class ModalModule {
|
|
4109
|
-
}
|
|
4110
|
-
ModalModule.decorators = [
|
|
4111
|
-
{ type: NgModule, args: [{
|
|
4112
|
-
declarations: [ModalComponent],
|
|
4113
|
-
imports: [CommonModule],
|
|
4114
|
-
exports: [ModalComponent],
|
|
4115
|
-
},] }
|
|
4116
|
-
];
|
|
4117
|
-
|
|
4118
|
-
/*
|
|
4119
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4120
|
-
*
|
|
4121
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4122
|
-
* you may not use this file except in compliance with the License.
|
|
4123
|
-
* You may obtain a copy of the License at
|
|
4124
|
-
*
|
|
4125
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4126
|
-
*
|
|
4127
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4128
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4129
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4130
|
-
* See the License for the specific language governing permissions and
|
|
4131
|
-
* limitations under the License.
|
|
4132
|
-
*/
|
|
4133
|
-
class SpinnerComponent {
|
|
4134
|
-
constructor() {
|
|
4135
|
-
this.useBootstrapSpinner = true;
|
|
4136
|
-
this.type = 'ball-clip-rotate';
|
|
4137
|
-
this.size = 'medium';
|
|
4138
|
-
this.color = 'currentColor';
|
|
4139
|
-
this.bdColor = 'rgba(0,0,0,0)';
|
|
4140
|
-
this.fullScreen = false;
|
|
4141
|
-
this.noMarginTop = false;
|
|
4142
|
-
}
|
|
4143
|
-
}
|
|
4144
|
-
SpinnerComponent.decorators = [
|
|
4145
|
-
{ type: Component, args: [{
|
|
4146
|
-
selector: 'valtimo-spinner',
|
|
4147
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"useBootstrapSpinner; else ngxSpinner\">\n <div class=\"spinner-container\" [ngClass]=\"{'no-margin-top': noMarginTop}\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"sr-only\">{{ 'interface.loading' | translate }}</span>\n </div>\n </div>\n</ng-container>\n\n<ng-template #ngxSpinner>\n <ngx-spinner\n [bdColor]=\"bdColor\"\n [fullScreen]=\"fullScreen\"\n [name]=\"name\"\n [color]=\"color\"\n [size]=\"size\"\n [type]=\"type\"\n >\n </ngx-spinner>\n</ng-template>\n",
|
|
4148
|
-
styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.spinner-container{display:flex;justify-content:center;margin-top:30px;width:100%}.spinner-container.no-margin-top{margin-top:0}"]
|
|
4149
|
-
},] }
|
|
4150
|
-
];
|
|
4151
|
-
SpinnerComponent.propDecorators = {
|
|
4152
|
-
useBootstrapSpinner: [{ type: Input }],
|
|
4153
|
-
name: [{ type: Input }],
|
|
4154
|
-
type: [{ type: Input }],
|
|
4155
|
-
size: [{ type: Input }],
|
|
4156
|
-
color: [{ type: Input }],
|
|
4157
|
-
bdColor: [{ type: Input }],
|
|
4158
|
-
fullScreen: [{ type: Input }],
|
|
4159
|
-
noMarginTop: [{ type: Input }]
|
|
4160
|
-
};
|
|
4161
|
-
|
|
4162
|
-
/*
|
|
4163
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4164
|
-
*
|
|
4165
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4166
|
-
* you may not use this file except in compliance with the License.
|
|
4167
|
-
* You may obtain a copy of the License at
|
|
4168
|
-
*
|
|
4169
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4170
|
-
*
|
|
4171
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4172
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4173
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4174
|
-
* See the License for the specific language governing permissions and
|
|
4175
|
-
* limitations under the License.
|
|
4176
|
-
*/
|
|
4177
|
-
class SpinnerModule {
|
|
4178
|
-
}
|
|
4179
|
-
SpinnerModule.decorators = [
|
|
4180
|
-
{ type: NgModule, args: [{
|
|
4181
|
-
declarations: [SpinnerComponent],
|
|
4182
|
-
exports: [SpinnerComponent],
|
|
4183
|
-
imports: [CommonModule, NgxSpinnerModule, TranslateModule],
|
|
4184
|
-
},] }
|
|
4185
|
-
];
|
|
4186
|
-
|
|
4187
|
-
/*
|
|
4188
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4189
|
-
*
|
|
4190
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4191
|
-
* you may not use this file except in compliance with the License.
|
|
4192
|
-
* You may obtain a copy of the License at
|
|
4193
|
-
*
|
|
4194
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4195
|
-
*
|
|
4196
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4197
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4198
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4199
|
-
* See the License for the specific language governing permissions and
|
|
4200
|
-
* limitations under the License.
|
|
4201
|
-
*/
|
|
4202
|
-
class SearchableDropdownComponent {
|
|
4203
|
-
constructor() {
|
|
4204
|
-
this.width = 250;
|
|
4205
|
-
this.itemSelected = new EventEmitter();
|
|
4206
|
-
this.searchId = 'search';
|
|
4207
|
-
this.searchTerm = new FormControl('');
|
|
4208
|
-
this.focusedItemId$ = new BehaviorSubject(this.searchId);
|
|
4209
|
-
this.open$ = new BehaviorSubject(false);
|
|
4210
|
-
this.filteredItems$ = new BehaviorSubject(undefined);
|
|
4211
|
-
this.wasInside = false;
|
|
4212
|
-
this.mouseOnList$ = new BehaviorSubject(false);
|
|
4213
|
-
}
|
|
4214
|
-
clickInside() {
|
|
4215
|
-
this.wasInside = true;
|
|
4216
|
-
}
|
|
4217
|
-
clickout() {
|
|
4218
|
-
if (!this.wasInside) {
|
|
4219
|
-
this.closeDropdown();
|
|
4220
|
-
}
|
|
4221
|
-
this.wasInside = false;
|
|
4222
|
-
}
|
|
4223
|
-
ngOnInit() {
|
|
4224
|
-
this.openKeysSubscription();
|
|
4225
|
-
this.openSearchSubscription();
|
|
4226
|
-
}
|
|
4227
|
-
ngOnChanges(changes) {
|
|
4228
|
-
const itemChanges = changes.items;
|
|
4229
|
-
const currenItems = itemChanges.currentValue;
|
|
4230
|
-
if (itemChanges && !itemChanges.previousValue && currenItems) {
|
|
4231
|
-
this.filteredItems$.next(currenItems);
|
|
4232
|
-
}
|
|
4233
|
-
}
|
|
4234
|
-
ngOnDestroy() {
|
|
4235
|
-
this.keySubscription.unsubscribe();
|
|
4236
|
-
this.searchSubscription.unsubscribe();
|
|
4237
|
-
}
|
|
4238
|
-
openDropdown() {
|
|
4239
|
-
this.open$.next(true);
|
|
4240
|
-
}
|
|
4241
|
-
hoverOverButton(id) {
|
|
4242
|
-
this.focusedItemId$.next(id);
|
|
4243
|
-
}
|
|
4244
|
-
mouseEnterList() {
|
|
4245
|
-
this.mouseOnList$.next(true);
|
|
4246
|
-
}
|
|
4247
|
-
mouseLeaveList() {
|
|
4248
|
-
this.mouseOnList$.next(false);
|
|
4249
|
-
}
|
|
4250
|
-
resetFocus() {
|
|
4251
|
-
this.focusedItemId$.next(this.searchId);
|
|
4252
|
-
}
|
|
4253
|
-
submit(id) {
|
|
4254
|
-
this.itemSelected.emit(id);
|
|
4255
|
-
}
|
|
4256
|
-
closeDropdown() {
|
|
4257
|
-
this.searchTerm.setValue('');
|
|
4258
|
-
this.resetFocus();
|
|
4259
|
-
this.open$.next(false);
|
|
4260
|
-
}
|
|
4261
|
-
openKeysSubscription() {
|
|
4262
|
-
this.keySubscription = fromEvent(document, 'keyup')
|
|
4263
|
-
.pipe(debounceTime(50))
|
|
4264
|
-
.subscribe((event) => {
|
|
4265
|
-
combineLatest([this.mouseOnList$, this.filteredItems$, this.focusedItemId$])
|
|
4266
|
-
.pipe(take(1))
|
|
4267
|
-
.subscribe(([mouseOnList, items, focusedId]) => {
|
|
4268
|
-
const length = items.length;
|
|
4269
|
-
const focusedIndex = items.findIndex(item => item.id === focusedId);
|
|
4270
|
-
const code = event.code;
|
|
4271
|
-
const shiftKey = event.shiftKey;
|
|
4272
|
-
const down = 'ArrowDown';
|
|
4273
|
-
const tab = 'Tab';
|
|
4274
|
-
const up = 'ArrowUp';
|
|
4275
|
-
const enter = 'Enter';
|
|
4276
|
-
const escape = 'Escape';
|
|
4277
|
-
// close dropdown on pressing escape
|
|
4278
|
-
if (code === escape) {
|
|
4279
|
-
this.closeDropdown();
|
|
4280
|
-
}
|
|
4281
|
-
// submit item when focus is on an item in the list and enter is pressed
|
|
4282
|
-
if (code === enter && focusedId !== this.searchId) {
|
|
4283
|
-
this.submit(focusedId);
|
|
4284
|
-
}
|
|
4285
|
-
// only handle tab or arrow keypresses when items are shown and the mouse is not on the list
|
|
4286
|
-
if (length > 0 && !mouseOnList) {
|
|
4287
|
-
// handle moving down in the list with arrow down or tab
|
|
4288
|
-
if (code === down || (code === tab && !shiftKey)) {
|
|
4289
|
-
// move focus to first item in the list when focus is on search box
|
|
4290
|
-
if (focusedId === this.searchId) {
|
|
4291
|
-
this.focusedItemId$.next(items[0].id);
|
|
4292
|
-
this.scrollButtonIntoView(focusedId);
|
|
4293
|
-
// move focus to next item in the list if focus is not on last item
|
|
4294
|
-
}
|
|
4295
|
-
else if (focusedIndex + 1 < length) {
|
|
4296
|
-
this.focusedItemId$.next(items[focusedIndex + 1].id);
|
|
4297
|
-
this.scrollButtonIntoView(focusedId);
|
|
4298
|
-
}
|
|
4299
|
-
// handle moving up in the list with up arrow up or shift+tab
|
|
4300
|
-
}
|
|
4301
|
-
else if ((code === up || (code === tab && shiftKey)) &&
|
|
4302
|
-
focusedId !== this.searchId) {
|
|
4303
|
-
// move to previous item if focus is not on the first item in the list
|
|
4304
|
-
if (focusedIndex > 0) {
|
|
4305
|
-
this.focusedItemId$.next(items[focusedIndex - 1].id);
|
|
4306
|
-
this.scrollButtonIntoView(focusedId);
|
|
4307
|
-
// move focus to search box if focus is on first item in the list
|
|
4308
|
-
}
|
|
4309
|
-
else {
|
|
4310
|
-
this.resetFocus();
|
|
4311
|
-
}
|
|
4312
|
-
}
|
|
4313
|
-
}
|
|
4314
|
-
});
|
|
4315
|
-
});
|
|
4316
|
-
}
|
|
4317
|
-
openSearchSubscription() {
|
|
4318
|
-
this.searchSubscription = this.searchTerm.valueChanges.subscribe(searchTerm => {
|
|
4319
|
-
this.focusedItemId$.pipe(take(1)).subscribe(focusedItemId => {
|
|
4320
|
-
if (!searchTerm) {
|
|
4321
|
-
this.filteredItems$.next(this.items);
|
|
4322
|
-
}
|
|
4323
|
-
else {
|
|
4324
|
-
const filteredItems = this.items.filter(item => item.text.toUpperCase().includes(searchTerm.toUpperCase()));
|
|
4325
|
-
this.filteredItems$.next(filteredItems);
|
|
4326
|
-
// move focus to search box if filtered list length is 0 or previously focused item is not in filtered list anymore
|
|
4327
|
-
if (filteredItems.length === 0 ||
|
|
4328
|
-
!filteredItems.some(item => item.id === focusedItemId)) {
|
|
4329
|
-
this.resetFocus();
|
|
4330
|
-
}
|
|
4331
|
-
}
|
|
4332
|
-
// move scrolling button into view to end of queue, so that DOM can be updated first
|
|
4333
|
-
setTimeout(() => {
|
|
4334
|
-
this.scrollButtonIntoView(focusedItemId);
|
|
4335
|
-
});
|
|
4336
|
-
});
|
|
4337
|
-
});
|
|
4338
|
-
}
|
|
4339
|
-
scrollButtonIntoView(id) {
|
|
4340
|
-
this.filteredItems$.pipe(take(1)).subscribe(items => {
|
|
4341
|
-
const focusItemIndex = items.findIndex(item => item.id === id);
|
|
4342
|
-
const focusedButton = this.buttons.toArray()[focusItemIndex];
|
|
4343
|
-
if (focusedButton) {
|
|
4344
|
-
focusedButton.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
4345
|
-
}
|
|
4346
|
-
});
|
|
4347
|
-
}
|
|
4348
|
-
}
|
|
4349
|
-
SearchableDropdownComponent.decorators = [
|
|
4350
|
-
{ type: Component, args: [{
|
|
4351
|
-
selector: 'valtimo-searchable-dropdown',
|
|
4352
|
-
template: "<ng-container *ngIf=\"buttonText && items\">\n <ng-container [ngTemplateOutlet]=\"(open$ | async) ? opened : closed\"> </ng-container>\n</ng-container>\n\n<ng-template #closed>\n <ng-container *ngIf=\"style === 'button' || !style\">\n <button\n class=\"btn btn-primary btn-sm dropdown-size\"\n (click)=\"openDropdown()\"\n [style.width.px]=\"width\"\n >\n {{ buttonText }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"style === 'underlinedText'\">\n <h5 class=\"underline-button\" (click)=\"openDropdown()\" [style.width.px]=\"width\">\n <b>\n {{ buttonText }}\n </b>\n </h5>\n </ng-container>\n</ng-template>\n\n<ng-template #opened>\n <div class=\"dropdown-container\" [style.width.px]=\"width\">\n <div class=\"dropdown-size search\" [style.width.px]=\"width\">\n <input\n #search\n [ngClass]=\"{disabled: disabled}\"\n [placeholder]=\"searchText\"\n [formControl]=\"searchTerm\"\n />\n {{ search.focus() }}\n </div>\n <div class=\"dropdown-list\" (mouseenter)=\"mouseEnterList()\" (mouseleave)=\"mouseLeaveList()\">\n <ng-container *ngIf=\"filteredItems$ | async as filteredItems\">\n <ng-container\n *ngIf=\"\n filteredItems.length > 0 && focusedItemId$ | async as focusedItemId;\n else noResults\n \"\n >\n <button\n #button\n *ngFor=\"let item of filteredItems\"\n [ngClass]=\"{focus: focusedItemId === item.id, disabled: disabled}\"\n class=\"dropdown-button dropdown-size\"\n (click)=\"submit(item.id)\"\n (mouseenter)=\"hoverOverButton(item.id)\"\n (mouseleave)=\"resetFocus()\"\n [style.width.px]=\"width\"\n >\n <span class=\"dropdown-button-text\">\n {{ item.text }}\n </span>\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"space\"> </ng-container>\n</ng-template>\n\n<ng-template #noResults>\n <div class=\"dropdown-button dropdown-size disabled\" [style.width.px]=\"width\">\n <span class=\"dropdown-button-text\">{{ noResultsText }}</span>\n </div>\n</ng-template>\n\n<ng-template #space>\n <div *ngIf=\"style === 'button' || !style\" class=\"dropdown-size\" [style.width.px]=\"width\"></div>\n <h5 *ngIf=\"style === 'underlinedText'\" class=\"underline-button\"><b>-</b></h5>\n</ng-template>\n",
|
|
4353
|
-
styles: [".dropdown-size{height:34px;width:250px}.underline-button{cursor:pointer;text-decoration:underline;width:250px}.dropdown-container{background-color:#fff;border:1px solid #e3e3e3;border-radius:3px;box-shadow:0 0 6px 0 rgba(0,0,0,.12);display:flex;flex-direction:column;max-height:300px;overflow:hidden;padding:7px 0;position:fixed;width:250px;z-index:999}.dropdown-list{list-style:none;margin:0;overflow:auto;overflow-x:hidden;padding:0;z-index:9999}.search{align-items:center;border-bottom:1px solid #dee2e6;display:flex;flex-shrink:0;height:44px;padding:8px 24px}.search input{padding:0;width:100%}.dropdown-button,.search input,.search input:focus{border:none;outline:none}.dropdown-button{align-items:center;background-color:#fff;color:#504e4e;cursor:pointer;display:flex;font-size:1rem;font-weight:400;padding:8px 24px}.dropdown-button.focus{background-color:#f5f5f5}.dropdown-button-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disabled{color:#959595;cursor:default;pointer-events:none}"]
|
|
4354
|
-
},] }
|
|
4355
|
-
];
|
|
4356
|
-
SearchableDropdownComponent.propDecorators = {
|
|
4357
|
-
style: [{ type: Input }],
|
|
4358
|
-
items: [{ type: Input }],
|
|
4359
|
-
buttonText: [{ type: Input }],
|
|
4360
|
-
searchText: [{ type: Input }],
|
|
4361
|
-
noResultsText: [{ type: Input }],
|
|
4362
|
-
disabled: [{ type: Input }],
|
|
4363
|
-
width: [{ type: Input }],
|
|
4364
|
-
itemSelected: [{ type: Output }],
|
|
4365
|
-
buttons: [{ type: ViewChildren, args: ['button',] }],
|
|
4366
|
-
clickInside: [{ type: HostListener, args: ['click',] }],
|
|
4367
|
-
clickout: [{ type: HostListener, args: ['document:click',] }]
|
|
4368
|
-
};
|
|
4369
|
-
|
|
4370
|
-
/*
|
|
4371
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4372
|
-
*
|
|
4373
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4374
|
-
* you may not use this file except in compliance with the License.
|
|
4375
|
-
* You may obtain a copy of the License at
|
|
4376
|
-
*
|
|
4377
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4378
|
-
*
|
|
4379
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4380
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4381
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4382
|
-
* See the License for the specific language governing permissions and
|
|
4383
|
-
* limitations under the License.
|
|
4384
|
-
*/
|
|
4385
|
-
class SearchableDropdownModule {
|
|
4386
|
-
}
|
|
4387
|
-
SearchableDropdownModule.decorators = [
|
|
4388
|
-
{ type: NgModule, args: [{
|
|
4389
|
-
declarations: [SearchableDropdownComponent],
|
|
4390
|
-
imports: [CommonModule, ReactiveFormsModule],
|
|
4391
|
-
exports: [SearchableDropdownComponent],
|
|
4392
|
-
},] }
|
|
4393
|
-
];
|
|
4394
|
-
|
|
4395
|
-
const formIoUploaderEditForm = () => ({
|
|
4396
|
-
components: [
|
|
4397
|
-
{ key: 'type', type: 'hidden' },
|
|
4398
|
-
{
|
|
4399
|
-
type: 'textfield',
|
|
4400
|
-
input: true,
|
|
4401
|
-
key: 'label',
|
|
4402
|
-
label: 'Label',
|
|
4403
|
-
placeholder: 'Label',
|
|
4404
|
-
validate: {
|
|
4405
|
-
required: true,
|
|
4406
|
-
},
|
|
4407
|
-
},
|
|
4408
|
-
{
|
|
4409
|
-
type: 'textfield',
|
|
4410
|
-
input: true,
|
|
4411
|
-
key: 'key',
|
|
4412
|
-
label: 'Property Name',
|
|
4413
|
-
placeholder: 'Property Name',
|
|
4414
|
-
tooltip: 'The name of this field in the API endpoint.',
|
|
4415
|
-
validate: {
|
|
4416
|
-
required: true,
|
|
4417
|
-
},
|
|
4418
|
-
},
|
|
4419
|
-
{
|
|
4420
|
-
type: 'textfield',
|
|
4421
|
-
input: true,
|
|
4422
|
-
key: 'customOptions.title',
|
|
4423
|
-
label: 'Title',
|
|
4424
|
-
placeholder: 'Title',
|
|
4425
|
-
tooltip: 'Leave empty to use the default title',
|
|
4426
|
-
validate: {
|
|
4427
|
-
required: false,
|
|
4428
|
-
},
|
|
4429
|
-
},
|
|
4430
|
-
{
|
|
4431
|
-
type: 'checkbox',
|
|
4432
|
-
input: true,
|
|
4433
|
-
inputType: 'checkbox',
|
|
4434
|
-
key: 'customOptions.hideTitle',
|
|
4435
|
-
label: 'Hide title',
|
|
4436
|
-
validate: {
|
|
4437
|
-
required: false,
|
|
4438
|
-
},
|
|
4439
|
-
},
|
|
4440
|
-
{
|
|
4441
|
-
type: 'textfield',
|
|
4442
|
-
input: true,
|
|
4443
|
-
key: 'customOptions.subtitle',
|
|
4444
|
-
label: 'Subtitle',
|
|
4445
|
-
placeholder: 'Title',
|
|
4446
|
-
tooltip: 'Leave empty to hide subtitle',
|
|
4447
|
-
validate: {
|
|
4448
|
-
required: false,
|
|
4449
|
-
},
|
|
4450
|
-
},
|
|
4451
|
-
{
|
|
4452
|
-
type: 'number',
|
|
4453
|
-
input: true,
|
|
4454
|
-
key: 'customOptions.maxFileSize',
|
|
4455
|
-
label: 'Maximum file size',
|
|
4456
|
-
placeholder: 'Maximum file size',
|
|
4457
|
-
defaultValue: 5,
|
|
4458
|
-
validate: {
|
|
4459
|
-
required: true,
|
|
4460
|
-
},
|
|
4461
|
-
},
|
|
4462
|
-
{
|
|
4463
|
-
type: 'checkbox',
|
|
4464
|
-
input: true,
|
|
4465
|
-
inputType: 'checkbox',
|
|
4466
|
-
key: 'customOptions.hideMaxFileSize',
|
|
4467
|
-
label: 'Hide maximum file size',
|
|
4468
|
-
validate: {
|
|
4469
|
-
required: false,
|
|
4470
|
-
},
|
|
4471
|
-
},
|
|
4472
|
-
{
|
|
4473
|
-
type: 'checkbox',
|
|
4474
|
-
input: true,
|
|
4475
|
-
inputType: 'checkbox',
|
|
4476
|
-
key: 'customOptions.camera',
|
|
4477
|
-
label: 'Allow camera uploads',
|
|
4478
|
-
validate: {
|
|
4479
|
-
required: false,
|
|
4480
|
-
},
|
|
4481
|
-
},
|
|
4482
|
-
],
|
|
4483
|
-
});
|
|
4484
|
-
|
|
4485
|
-
const customUploaderType = 'valtimo-file';
|
|
4486
|
-
const COMPONENT_OPTIONS = {
|
|
4487
|
-
type: customUploaderType,
|
|
4488
|
-
selector: 'valtimo-form-io-uploader',
|
|
4489
|
-
title: 'Valtimo File Upload',
|
|
4490
|
-
group: 'basic',
|
|
4491
|
-
icon: 'upload',
|
|
4492
|
-
// set empty value to force formio to accept arrays as valid input value for this field type
|
|
4493
|
-
emptyValue: [],
|
|
4494
|
-
editForm: formIoUploaderEditForm,
|
|
4495
|
-
};
|
|
4496
|
-
function registerFormioUploadComponent(injector) {
|
|
4497
|
-
const originalUploadComponent = createCustomFormioComponent(COMPONENT_OPTIONS);
|
|
4498
|
-
// override setValue function to allow for setting an array value
|
|
4499
|
-
class UploaderComponent extends originalUploadComponent {
|
|
4500
|
-
setValue(value) {
|
|
4501
|
-
this._customAngularElement.value = value;
|
|
4502
|
-
return true;
|
|
4503
|
-
}
|
|
4504
|
-
}
|
|
4505
|
-
registerCustomFormioComponentWithClass(COMPONENT_OPTIONS, FormIoUploaderComponent, UploaderComponent, injector);
|
|
4506
|
-
}
|
|
4507
|
-
|
|
4508
|
-
const SelectComponent = Components.components.select;
|
|
4509
|
-
function registerFormioFileSelectorComponent(injector) {
|
|
4510
|
-
const documentService = injector.get(DocumentService);
|
|
4511
|
-
const stateService = injector.get(FormIoStateService);
|
|
4512
|
-
const unavailableMessage = {
|
|
4513
|
-
label: 'could not retrieve documents',
|
|
4514
|
-
value: null,
|
|
4515
|
-
};
|
|
4516
|
-
function getDocumentResources(documentId) {
|
|
4517
|
-
if (!documentId) {
|
|
4518
|
-
return new Promise(resolve => {
|
|
4519
|
-
resolve([unavailableMessage]);
|
|
4520
|
-
});
|
|
4521
|
-
}
|
|
4522
|
-
return documentService
|
|
4523
|
-
.getDocument(documentId)
|
|
4524
|
-
.toPromise()
|
|
4525
|
-
.then(document => document.relatedFiles.map(relatedFile => {
|
|
4526
|
-
return {
|
|
4527
|
-
label: relatedFile.fileName,
|
|
4528
|
-
value: relatedFile.fileId,
|
|
4529
|
-
};
|
|
4530
|
-
}))
|
|
4531
|
-
.catch(() => {
|
|
4532
|
-
return new Promise(resolve => {
|
|
4533
|
-
resolve([unavailableMessage]);
|
|
4534
|
-
});
|
|
4535
|
-
});
|
|
4536
|
-
}
|
|
4537
|
-
class ResourceSelectorComponent extends SelectComponent {
|
|
4538
|
-
static schema(...extend) {
|
|
4539
|
-
return SelectComponent.schema(Object.assign({ type: 'resource-selector', label: 'Resource selector', key: 'resource-selector', dataSrc: 'custom', dataType: 'string', valueProperty: 'value', asyncValues: true, data: {
|
|
4540
|
-
custom: 'values = instance.getResources()',
|
|
4541
|
-
} }, extend));
|
|
4542
|
-
}
|
|
4543
|
-
getResources() {
|
|
4544
|
-
return stateService.documentId$
|
|
4545
|
-
.pipe(take(1))
|
|
4546
|
-
.toPromise()
|
|
4547
|
-
.then(documentId => getDocumentResources(documentId));
|
|
4548
|
-
}
|
|
4549
|
-
static get builderInfo() {
|
|
4550
|
-
return {
|
|
4551
|
-
title: 'Document picker',
|
|
4552
|
-
icon: 'th-list',
|
|
4553
|
-
group: 'basic',
|
|
4554
|
-
documentation: '/userguide/#textfield',
|
|
4555
|
-
weight: 0,
|
|
4556
|
-
schema: ResourceSelectorComponent.schema(),
|
|
4557
|
-
};
|
|
4558
|
-
}
|
|
4559
|
-
}
|
|
4560
|
-
Formio.use({
|
|
4561
|
-
components: {
|
|
4562
|
-
'resource-selector': ResourceSelectorComponent,
|
|
4563
|
-
},
|
|
4564
|
-
});
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
|
-
/*
|
|
4568
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4569
|
-
*
|
|
4570
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4571
|
-
* you may not use this file except in compliance with the License.
|
|
4572
|
-
* You may obtain a copy of the License at
|
|
4573
|
-
*
|
|
4574
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4575
|
-
*
|
|
4576
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4577
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4578
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4579
|
-
* See the License for the specific language governing permissions and
|
|
4580
|
-
* limitations under the License.
|
|
4581
|
-
*/
|
|
4582
|
-
class SearchableDropdownSelectComponent {
|
|
4583
|
-
constructor() {
|
|
4584
|
-
this.width = 250;
|
|
4585
|
-
this.itemSelected = new EventEmitter();
|
|
4586
|
-
this.clearSelection = new EventEmitter();
|
|
4587
|
-
}
|
|
4588
|
-
onSelect(id) {
|
|
4589
|
-
this.itemSelected.emit(id);
|
|
4590
|
-
}
|
|
4591
|
-
onClearSelection() {
|
|
4592
|
-
this.clearSelection.emit();
|
|
4593
|
-
}
|
|
4594
|
-
}
|
|
4595
|
-
SearchableDropdownSelectComponent.decorators = [
|
|
4596
|
-
{ type: Component, args: [{
|
|
4597
|
-
selector: 'valtimo-searchable-dropdown-select',
|
|
4598
|
-
template: "<valtimo-searchable-dropdown\n *ngIf=\"!hasSelection; else selection\"\n [style]=\"style\"\n [items]=\"items\"\n [buttonText]=\"buttonText\"\n [searchText]=\"searchText\"\n [noResultsText]=\"noResultsText\"\n [disabled]=\"disabled\"\n [width]=\"width\"\n (itemSelected)=\"onSelect($event)\"\n>\n</valtimo-searchable-dropdown>\n\n<ng-template #selection>\n <div\n class=\"d-flex flex-row align-items-center\"\n [style.height.px]=\"style === 'button' ? 34 : null\"\n >\n <h5 class=\"selected-text\">\n {{ selectedText }} <b>{{ selectedTextValue }}</b>\n </h5>\n <button\n type=\"button\"\n class=\"close p-0 m-0 ml-2 d-flex text-danger\"\n aria-label=\"Close\"\n (click)=\"onClearSelection()\"\n [title]=\"clearSelectionButtonTitle\"\n >\n <i class=\"clear-icon mdi mdi-close text-danger\"></i>\n </button>\n </div>\n</ng-template>\n",
|
|
4599
|
-
styles: [".selected-text{margin:0}.clear-icon{font-size:16px}"]
|
|
4600
|
-
},] }
|
|
4601
|
-
];
|
|
4602
|
-
SearchableDropdownSelectComponent.propDecorators = {
|
|
4603
|
-
style: [{ type: Input }],
|
|
4604
|
-
items: [{ type: Input }],
|
|
4605
|
-
buttonText: [{ type: Input }],
|
|
4606
|
-
searchText: [{ type: Input }],
|
|
4607
|
-
noResultsText: [{ type: Input }],
|
|
4608
|
-
disabled: [{ type: Input }],
|
|
4609
|
-
selectedText: [{ type: Input }],
|
|
4610
|
-
selectedTextValue: [{ type: Input }],
|
|
4611
|
-
clearSelectionButtonTitle: [{ type: Input }],
|
|
4612
|
-
hasSelection: [{ type: Input }],
|
|
4613
|
-
width: [{ type: Input }],
|
|
4614
|
-
itemSelected: [{ type: Output }],
|
|
4615
|
-
clearSelection: [{ type: Output }]
|
|
4616
|
-
};
|
|
4617
|
-
|
|
4618
|
-
/*
|
|
4619
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
4620
|
-
*
|
|
4621
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4622
|
-
* you may not use this file except in compliance with the License.
|
|
4623
|
-
* You may obtain a copy of the License at
|
|
4624
|
-
*
|
|
4625
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4626
|
-
*
|
|
4627
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4628
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4629
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4630
|
-
* See the License for the specific language governing permissions and
|
|
4631
|
-
* limitations under the License.
|
|
4632
|
-
*/
|
|
4633
|
-
class SearchableDropdownSelectModule {
|
|
4634
|
-
}
|
|
4635
|
-
SearchableDropdownSelectModule.decorators = [
|
|
4636
|
-
{ type: NgModule, args: [{
|
|
4637
|
-
declarations: [SearchableDropdownSelectComponent],
|
|
4638
|
-
imports: [CommonModule, ReactiveFormsModule, SearchableDropdownModule],
|
|
4639
|
-
exports: [SearchableDropdownSelectComponent],
|
|
4640
|
-
},] }
|
|
4641
|
-
];
|
|
4642
|
-
|
|
4643
|
-
/*
|
|
4644
|
-
* Copyright 2015-2022 Ritense BV, the Netherlands.
|
|
4645
|
-
*
|
|
4646
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4647
|
-
* you may not use this file except in compliance with the License.
|
|
4648
|
-
* You may obtain a copy of the License at
|
|
4649
|
-
*
|
|
4650
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4651
|
-
*
|
|
4652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4653
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4655
|
-
* See the License for the specific language governing permissions and
|
|
4656
|
-
* limitations under the License.
|
|
4657
|
-
*/
|
|
4658
|
-
class MultiselectDropdownComponent {
|
|
4659
|
-
constructor() {
|
|
4660
|
-
this.items = [];
|
|
4661
|
-
this.dropdownSettings = {
|
|
4662
|
-
singleSelection: false,
|
|
4663
|
-
selectAllText: 'Select All',
|
|
4664
|
-
unSelectAllText: 'UnSelect All',
|
|
4665
|
-
itemsShowLimit: 3,
|
|
4666
|
-
allowSearchFilter: true,
|
|
4667
|
-
};
|
|
4668
|
-
this.itemsSelected = new EventEmitter();
|
|
4669
|
-
}
|
|
4670
|
-
onItemsSelected() {
|
|
4671
|
-
this.itemsSelected.emit(this.selectedItems);
|
|
4672
|
-
}
|
|
4673
|
-
}
|
|
4674
|
-
MultiselectDropdownComponent.decorators = [
|
|
4675
|
-
{ type: Component, args: [{
|
|
4676
|
-
selector: 'valtimo-multiselect-dropdown',
|
|
4677
|
-
template: "<!--\n ~ Copyright 2015-2022 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-multiselect-dropdown\n [placeholder]=\"placeHolder\"\n [data]=\"items\"\n [(ngModel)]=\"selectedItems\"\n [settings]=\"dropdownSettings\"\n (onDropDownClose)=\"onItemsSelected()\"\n></ng-multiselect-dropdown>\n",
|
|
4678
|
-
styles: [""]
|
|
4679
|
-
},] }
|
|
4680
|
-
];
|
|
4681
|
-
MultiselectDropdownComponent.propDecorators = {
|
|
4682
|
-
selectedItems: [{ type: Input }],
|
|
4683
|
-
items: [{ type: Input }],
|
|
4684
|
-
placeHolder: [{ type: Input }],
|
|
4685
|
-
dropdownSettings: [{ type: Input }],
|
|
4686
|
-
itemsSelected: [{ type: Output }]
|
|
4687
|
-
};
|
|
4688
|
-
|
|
4689
|
-
/*
|
|
4690
|
-
* Copyright 2015-2022 Ritense BV, the Netherlands.
|
|
4691
|
-
*
|
|
4692
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4693
|
-
* you may not use this file except in compliance with the License.
|
|
4694
|
-
* You may obtain a copy of the License at
|
|
4695
|
-
*
|
|
4696
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4697
|
-
*
|
|
4698
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4699
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4700
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4701
|
-
* See the License for the specific language governing permissions and
|
|
4702
|
-
* limitations under the License.
|
|
4703
|
-
*/
|
|
4704
|
-
class MultiselectDropdownModule {
|
|
4705
|
-
}
|
|
4706
|
-
MultiselectDropdownModule.decorators = [
|
|
4707
|
-
{ type: NgModule, args: [{
|
|
4708
|
-
declarations: [MultiselectDropdownComponent],
|
|
4709
|
-
imports: [CommonModule, ReactiveFormsModule, NgMultiSelectDropDownModule, FormsModule],
|
|
4710
|
-
exports: [MultiselectDropdownComponent],
|
|
4711
|
-
},] }
|
|
4712
|
-
];
|
|
4713
|
-
|
|
4714
|
-
/*
|
|
4715
|
-
* Copyright 2015-2022 Ritense BV, the Netherlands.
|
|
4716
|
-
*
|
|
4717
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4718
|
-
* you may not use this file except in compliance with the License.
|
|
4719
|
-
* You may obtain a copy of the License at
|
|
4720
|
-
*
|
|
4721
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4722
|
-
*
|
|
4723
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4724
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
4725
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4726
|
-
* See the License for the specific language governing permissions and
|
|
4727
|
-
* limitations under the License.
|
|
4728
|
-
*/
|
|
4729
|
-
|
|
4730
|
-
/**
|
|
4731
|
-
* Generated bundle index. Do not edit.
|
|
4732
|
-
*/
|
|
4733
|
-
|
|
4734
|
-
export { Alert, AlertComponent, AlertModule, AlertService, AlertType, AlertsOptionsImpl, BpmnJsDiagramComponent, BpmnJsDiagramModule, BreadcrumbNavigationComponent, BreadcrumbNavigationModule, CamundaFormComponent, CamundaFormModule, CardComponent, CardModule, ComponentsModule, DataListComponent, DataListModule, DropzoneComponent, DropzoneModule, FieldAutoFocusDirective, FieldAutoFocusModule, FileSizeModule, FileSizePipe, FilterSidebarComponent, FilterSidebarModule, FormIoModule, FormIoStateService, FormIoUploaderComponent, FormioBuilderComponent, FormioComponent, FormioOptionsImpl, LeftSidebarComponent, LeftSidebarModule, ListComponent, ListFilterPipe, ListModule, MenuModule, MenuRoutingModule, MenuService, ModalComponent, ModalModule, MultiselectDropdownComponent, MultiselectDropdownModule, PageHeaderComponent, PageHeaderModule, PageTitleComponent, PageTitleModule, ProgressBarComponent, ProgressBarModule, RightSidebarComponent, RightSidebarModule, SearchableDropdownComponent, SearchableDropdownModule, SearchableDropdownSelectComponent, SearchableDropdownSelectModule, SpinnerModule, TimelineComponent, TimelineItemImpl, TimelineModule, TopbarComponent, TopbarModule, UploaderComponent, UploaderDragDropDirective, UploaderModule, ViewContentService, WebcamComponent, WebcamModule, WidgetComponent, WidgetModule, customUploaderType, menuInitializer, registerFormioFileSelectorComponent, registerFormioUploadComponent, ɵ0, CamundaGeneratedFormModule as ɵa, CamundaStringFormfieldComponent as ɵb, CamundaBooleanFormfieldComponent as ɵc, CamundaDateFormfieldComponent as ɵd, CamundaFormfieldService as ɵe, CamundaFormfieldGeneratorDirective as ɵf, CamundaLongFormfieldComponent as ɵg, CamundaEnumFormfieldComponent as ɵh, CamundaTextareaFormfieldComponent as ɵi, CamundaChoicefieldFormfieldComponent as ɵj, CamundaFormfieldValidationComponent as ɵk, CamundaGeneratedFormComponent as ɵl, CamundaCustomFormModule as ɵm, CamundaCustomFormComponent as ɵn, MenuComponent as ɵo, MenuItemTextComponent as ɵp, SubmenuItemTextComponent as ɵq, VersionService as ɵr, FormIoDomService as ɵs, AppConfig as ɵt, SpinnerComponent as ɵu };
|
|
4735
|
-
//# sourceMappingURL=valtimo-components.js.map
|