@verisoft/ui-core 18.4.0 → 18.6.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/esm2022/index.mjs +7 -0
- package/esm2022/lib/common/angular-helper.mjs +23 -0
- package/esm2022/lib/common/constants.mjs +4 -0
- package/esm2022/lib/common/control.models.mjs +63 -0
- package/esm2022/lib/common/datasource-component.model.mjs +14 -0
- package/esm2022/lib/common/deactivate-guard.model.mjs +2 -0
- package/esm2022/lib/common/download-file.mjs +13 -0
- package/esm2022/lib/common/filter.mjs +7 -0
- package/esm2022/lib/common/icons.mjs +2 -0
- package/esm2022/lib/common/index.mjs +11 -0
- package/esm2022/lib/common/notificable-property.model.mjs +2 -0
- package/esm2022/lib/common/rxjs.mjs +11 -0
- package/esm2022/lib/components/action-button-group/action-button-group.model.mjs +3 -0
- package/esm2022/lib/components/action-button-group/action-button.model.mjs +2 -0
- package/esm2022/lib/components/action-button-group/index.mjs +3 -0
- package/esm2022/lib/components/base-form/base-form-input.component.mjs +100 -0
- package/esm2022/lib/components/base-form/base-form.component.mjs +187 -0
- package/esm2022/lib/components/base-form/directives/detail-store.directive.mjs +163 -0
- package/esm2022/lib/components/base-form/index.mjs +5 -0
- package/esm2022/lib/components/base-form/models/base-form-input.models.mjs +7 -0
- package/esm2022/lib/components/base-form/models/base-form.models.mjs +10 -0
- package/esm2022/lib/components/base-form/models/index.mjs +3 -0
- package/esm2022/lib/components/breadcrumb/breadcrumb.model.mjs +3 -0
- package/esm2022/lib/components/breadcrumb/breadcrumb.service.mjs +16 -0
- package/esm2022/lib/components/breadcrumb/breadcrumbcore.component.mjs +88 -0
- package/esm2022/lib/components/breadcrumb/index.mjs +4 -0
- package/esm2022/lib/components/button/button.model.mjs +3 -0
- package/esm2022/lib/components/button/index.mjs +2 -0
- package/esm2022/lib/components/calendar/calendar.model.mjs +3 -0
- package/esm2022/lib/components/calendar/index.mjs +2 -0
- package/esm2022/lib/components/checkbox/checkbox.model.mjs +3 -0
- package/esm2022/lib/components/checkbox/index.mjs +2 -0
- package/esm2022/lib/components/confirm-dialog/confirm-dialog.model.mjs +3 -0
- package/esm2022/lib/components/confirm-dialog/index.mjs +2 -0
- package/esm2022/lib/components/dropdown/dropdown.model.mjs +3 -0
- package/esm2022/lib/components/dropdown/index.mjs +2 -0
- package/esm2022/lib/components/dynamic-component/dynamic-component.model.mjs +2 -0
- package/esm2022/lib/components/dynamic-component/index.mjs +2 -0
- package/esm2022/lib/components/filter/filter.model.mjs +3 -0
- package/esm2022/lib/components/filter/index.mjs +2 -0
- package/esm2022/lib/components/form-field/form-field.model.mjs +3 -0
- package/esm2022/lib/components/form-field/index.mjs +2 -0
- package/esm2022/lib/components/generic-field/generic-field.model.mjs +3 -0
- package/esm2022/lib/components/generic-field/index.mjs +2 -0
- package/esm2022/lib/components/generic-form/generic-form.component.mjs +10 -0
- package/esm2022/lib/components/generic-form/index.mjs +2 -0
- package/esm2022/lib/components/header/header.model.mjs +4 -0
- package/esm2022/lib/components/header/index.mjs +2 -0
- package/esm2022/lib/components/icons/icons.component.mjs +29 -0
- package/esm2022/lib/components/icons/icons.model.mjs +3 -0
- package/esm2022/lib/components/icons/index.mjs +3 -0
- package/esm2022/lib/components/index.mjs +36 -0
- package/esm2022/lib/components/input-group/index.mjs +2 -0
- package/esm2022/lib/components/input-group/input-group.model.mjs +3 -0
- package/esm2022/lib/components/loader/index.mjs +2 -0
- package/esm2022/lib/components/loader/loader.model.mjs +3 -0
- package/esm2022/lib/components/multiselect/index.mjs +2 -0
- package/esm2022/lib/components/multiselect/mutiselect.model.mjs +3 -0
- package/esm2022/lib/components/number-input/index.mjs +2 -0
- package/esm2022/lib/components/number-input/number-input.model.mjs +3 -0
- package/esm2022/lib/components/page-header/index.mjs +4 -0
- package/esm2022/lib/components/page-header/page-header.model.mjs +3 -0
- package/esm2022/lib/components/page-header/page-header.service.mjs +16 -0
- package/esm2022/lib/components/page-header/page-headercore.component.mjs +52 -0
- package/esm2022/lib/components/password/index.mjs +2 -0
- package/esm2022/lib/components/password/password.model.mjs +11 -0
- package/esm2022/lib/components/radiobutton/index.mjs +2 -0
- package/esm2022/lib/components/radiobutton/radiobutton.model.mjs +3 -0
- package/esm2022/lib/components/section/index.mjs +2 -0
- package/esm2022/lib/components/section/section.model.mjs +3 -0
- package/esm2022/lib/components/side-menu/directives/side-menu-service.directive.mjs +31 -0
- package/esm2022/lib/components/side-menu/index.mjs +5 -0
- package/esm2022/lib/components/side-menu/services/side-menu-provider.service.mjs +25 -0
- package/esm2022/lib/components/side-menu/services/side-menu.service.mjs +50 -0
- package/esm2022/lib/components/side-menu/side-menu.model.mjs +6 -0
- package/esm2022/lib/components/slider/index.mjs +2 -0
- package/esm2022/lib/components/slider/slider.model.mjs +3 -0
- package/esm2022/lib/components/snackbar/index.mjs +2 -0
- package/esm2022/lib/components/snackbar/snackbar.model.mjs +3 -0
- package/esm2022/lib/components/stepper/index.mjs +2 -0
- package/esm2022/lib/components/stepper/stepper.model.mjs +3 -0
- package/esm2022/lib/components/switch/index.mjs +2 -0
- package/esm2022/lib/components/switch/switch.model.mjs +3 -0
- package/esm2022/lib/components/tab-view/index.mjs +2 -0
- package/esm2022/lib/components/tab-view/tab-view.model.mjs +3 -0
- package/esm2022/lib/components/table/column-configuration.mjs +32 -0
- package/esm2022/lib/components/table/index.mjs +5 -0
- package/esm2022/lib/components/table/table-builder.mjs +68 -0
- package/esm2022/lib/components/table/table-column.directive.mjs +86 -0
- package/esm2022/lib/components/table/table.models.mjs +150 -0
- package/esm2022/lib/components/table-filter/index.mjs +2 -0
- package/esm2022/lib/components/table-filter/table-filter.model.mjs +3 -0
- package/esm2022/lib/components/textarea/index.mjs +2 -0
- package/esm2022/lib/components/textarea/textarea.model.mjs +3 -0
- package/esm2022/lib/components/textfield/index.mjs +2 -0
- package/esm2022/lib/components/textfield/textfield.model.mjs +3 -0
- package/esm2022/lib/components/tristatecheckbox/index.mjs +2 -0
- package/esm2022/lib/components/tristatecheckbox/tristatecheckbox.model.mjs +3 -0
- package/esm2022/lib/components/unsubscribe.component.mjs +16 -0
- package/esm2022/lib/directives/datasource.directive.mjs +175 -0
- package/esm2022/lib/directives/index.mjs +5 -0
- package/esm2022/lib/directives/shortcut.directive.mjs +46 -0
- package/esm2022/lib/directives/table-datasource.directive.mjs +124 -0
- package/esm2022/lib/directives/table-filter.directive.mjs +56 -0
- package/esm2022/lib/format/format.mjs +63 -0
- package/esm2022/lib/pipes/error/error.codes.mjs +10 -0
- package/esm2022/lib/pipes/error/error.models.mjs +21 -0
- package/esm2022/lib/pipes/error/error.pipe.mjs +31 -0
- package/esm2022/lib/pipes/error/warning.codes.mjs +4 -0
- package/esm2022/lib/pipes/error/warning.pipe.mjs +31 -0
- package/esm2022/lib/pipes/helper/enumToList.pipe.mjs +22 -0
- package/esm2022/lib/pipes/index.mjs +8 -0
- package/esm2022/lib/pipes/keyOrFn/keyOrFn.pipe.mjs +31 -0
- package/esm2022/lib/services/confirm-dialog.service.mjs +45 -0
- package/esm2022/lib/services/index.mjs +5 -0
- package/esm2022/lib/services/leave-form.service.mjs +52 -0
- package/esm2022/lib/services/screen-size.service.mjs +29 -0
- package/esm2022/lib/services/table.service.mjs +27 -0
- package/esm2022/verisoft-ui-core.mjs +5 -0
- package/fesm2022/verisoft-ui-core.mjs +2014 -0
- package/fesm2022/verisoft-ui-core.mjs.map +1 -0
- package/{src/index.ts → index.d.ts} +6 -6
- package/lib/common/angular-helper.d.ts +1 -0
- package/lib/common/constants.d.ts +3 -0
- package/lib/common/control.models.d.ts +62 -0
- package/lib/common/datasource-component.model.d.ts +19 -0
- package/{src/lib/common/deactivate-guard.model.ts → lib/common/deactivate-guard.model.d.ts} +4 -5
- package/lib/common/download-file.d.ts +2 -0
- package/lib/common/filter.d.ts +1 -0
- package/{src/lib/common/icons.ts → lib/common/icons.d.ts} +34 -34
- package/{src/lib/common/index.ts → lib/common/index.d.ts} +10 -10
- package/{src/lib/common/notificable-property.model.ts → lib/common/notificable-property.model.d.ts} +4 -5
- package/lib/common/rxjs.d.ts +2 -0
- package/lib/components/action-button-group/action-button-group.model.d.ts +12 -0
- package/lib/components/action-button-group/action-button.model.d.ts +14 -0
- package/{src/lib/components/action-button-group/index.ts → lib/components/action-button-group/index.d.ts} +2 -2
- package/lib/components/base-form/base-form-input.component.d.ts +30 -0
- package/lib/components/base-form/base-form.component.d.ts +50 -0
- package/lib/components/base-form/directives/detail-store.directive.d.ts +35 -0
- package/{src/lib/components/base-form/index.ts → lib/components/base-form/index.d.ts} +4 -4
- package/lib/components/base-form/models/base-form-input.models.d.ts +7 -0
- package/lib/components/base-form/models/base-form.models.d.ts +18 -0
- package/{src/lib/components/base-form/models/index.ts → lib/components/base-form/models/index.d.ts} +2 -2
- package/{src/lib/components/breadcrumb/breadcrumb.model.ts → lib/components/breadcrumb/breadcrumb.model.d.ts} +16 -21
- package/lib/components/breadcrumb/breadcrumb.service.d.ts +8 -0
- package/lib/components/breadcrumb/breadcrumbcore.component.d.ts +30 -0
- package/lib/components/breadcrumb/index.d.ts +3 -0
- package/{src/lib/components/button/button.model.ts → lib/components/button/button.model.d.ts} +17 -21
- package/lib/components/button/index.d.ts +1 -0
- package/{src/lib/components/calendar/calendar.model.ts → lib/components/calendar/calendar.model.d.ts} +12 -16
- package/lib/components/calendar/index.d.ts +1 -0
- package/lib/components/checkbox/checkbox.model.d.ts +4 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/confirm-dialog/confirm-dialog.model.d.ts +25 -0
- package/lib/components/confirm-dialog/index.d.ts +1 -0
- package/{src/lib/components/dropdown/dropdown.model.ts → lib/components/dropdown/dropdown.model.d.ts} +12 -16
- package/lib/components/dropdown/index.d.ts +1 -0
- package/lib/components/dynamic-component/dynamic-component.model.d.ts +3 -0
- package/lib/components/dynamic-component/index.d.ts +1 -0
- package/lib/components/filter/filter.model.d.ts +13 -0
- package/{src/lib/components/filter/index.ts → lib/components/filter/index.d.ts} +1 -1
- package/{src/lib/components/form-field/form-field.model.ts → lib/components/form-field/form-field.model.d.ts} +11 -15
- package/lib/components/form-field/index.d.ts +1 -0
- package/{src/lib/components/generic-field/generic-field.model.ts → lib/components/generic-field/generic-field.model.d.ts} +6 -10
- package/lib/components/generic-field/index.d.ts +1 -0
- package/lib/components/generic-form/generic-form.component.d.ts +30 -0
- package/{src/lib/components/generic-form/index.ts → lib/components/generic-form/index.d.ts} +1 -1
- package/{src/lib/components/header/header.model.ts → lib/components/header/header.model.d.ts} +11 -18
- package/lib/components/header/index.d.ts +1 -0
- package/lib/components/icons/icons.component.d.ts +6 -0
- package/lib/components/icons/icons.model.d.ts +6 -0
- package/lib/components/icons/index.d.ts +2 -0
- package/{src/lib/components/index.ts → lib/components/index.d.ts} +35 -35
- package/lib/components/input-group/index.d.ts +1 -0
- package/{src/lib/components/input-group/input-group.model.ts → lib/components/input-group/input-group.model.d.ts} +12 -17
- package/lib/components/loader/index.d.ts +1 -0
- package/lib/components/loader/loader.model.d.ts +3 -0
- package/lib/components/multiselect/index.d.ts +1 -0
- package/{src/lib/components/multiselect/mutiselect.model.ts → lib/components/multiselect/mutiselect.model.d.ts} +9 -13
- package/lib/components/number-input/index.d.ts +1 -0
- package/{src/lib/components/number-input/number-input.model.ts → lib/components/number-input/number-input.model.d.ts} +10 -14
- package/{src/lib/components/page-header/index.ts → lib/components/page-header/index.d.ts} +3 -3
- package/{src/lib/components/page-header/page-header.model.ts → lib/components/page-header/page-header.model.d.ts} +7 -11
- package/lib/components/page-header/page-header.service.d.ts +8 -0
- package/lib/components/page-header/page-headercore.component.d.ts +20 -0
- package/lib/components/password/index.d.ts +1 -0
- package/{src/lib/components/password/password.model.ts → lib/components/password/password.model.d.ts} +19 -25
- package/lib/components/radiobutton/index.d.ts +1 -0
- package/{src/lib/components/radiobutton/radiobutton.model.ts → lib/components/radiobutton/radiobutton.model.d.ts} +11 -16
- package/lib/components/section/index.d.ts +1 -0
- package/{src/lib/components/section/section.model.ts → lib/components/section/section.model.d.ts} +7 -11
- package/lib/components/side-menu/directives/side-menu-service.directive.d.ts +11 -0
- package/{src/lib/components/side-menu/index.ts → lib/components/side-menu/index.d.ts} +4 -4
- package/lib/components/side-menu/services/side-menu-provider.service.d.ts +10 -0
- package/lib/components/side-menu/services/side-menu.service.d.ts +15 -0
- package/lib/components/side-menu/side-menu.model.d.ts +42 -0
- package/lib/components/slider/index.d.ts +1 -0
- package/{src/lib/components/slider/slider.model.ts → lib/components/slider/slider.model.d.ts} +9 -13
- package/lib/components/snackbar/index.d.ts +1 -0
- package/lib/components/snackbar/snackbar.model.d.ts +3 -0
- package/lib/components/stepper/index.d.ts +1 -0
- package/{src/lib/components/stepper/stepper.model.ts → lib/components/stepper/stepper.model.d.ts} +19 -24
- package/lib/components/switch/index.d.ts +1 -0
- package/lib/components/switch/switch.model.d.ts +4 -0
- package/lib/components/tab-view/index.d.ts +1 -0
- package/{src/lib/components/tab-view/tab-view.model.ts → lib/components/tab-view/tab-view.model.d.ts} +17 -22
- package/lib/components/table/column-configuration.d.ts +12 -0
- package/{src/lib/components/table/index.ts → lib/components/table/index.d.ts} +4 -4
- package/lib/components/table/table-builder.d.ts +15 -0
- package/lib/components/table/table-column.directive.d.ts +25 -0
- package/lib/components/table/table.models.d.ts +132 -0
- package/lib/components/table-filter/index.d.ts +1 -0
- package/{src/lib/components/table-filter/table-filter.model.ts → lib/components/table-filter/table-filter.model.d.ts} +17 -22
- package/lib/components/textarea/index.d.ts +1 -0
- package/{src/lib/components/textarea/textarea.model.ts → lib/components/textarea/textarea.model.d.ts} +9 -13
- package/lib/components/textfield/index.d.ts +1 -0
- package/{src/lib/components/textfield/textfield.model.ts → lib/components/textfield/textfield.model.d.ts} +9 -13
- package/lib/components/tristatecheckbox/index.d.ts +1 -0
- package/lib/components/tristatecheckbox/tristatecheckbox.model.d.ts +4 -0
- package/lib/components/unsubscribe.component.d.ts +9 -0
- package/lib/directives/datasource.directive.d.ts +32 -0
- package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +4 -4
- package/lib/directives/shortcut.directive.d.ts +11 -0
- package/lib/directives/table-datasource.directive.d.ts +29 -0
- package/lib/directives/table-filter.directive.d.ts +17 -0
- package/lib/format/format.d.ts +9 -0
- package/lib/pipes/error/error.codes.d.ts +5 -0
- package/lib/pipes/error/error.models.d.ts +8 -0
- package/lib/pipes/error/error.pipe.d.ts +8 -0
- package/lib/pipes/error/warning.codes.d.ts +5 -0
- package/lib/pipes/error/warning.pipe.d.ts +8 -0
- package/lib/pipes/helper/enumToList.pipe.d.ts +7 -0
- package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +7 -7
- package/lib/pipes/keyOrFn/keyOrFn.pipe.d.ts +7 -0
- package/lib/services/confirm-dialog.service.d.ts +12 -0
- package/{src/lib/services/index.ts → lib/services/index.d.ts} +4 -4
- package/lib/services/leave-form.service.d.ts +13 -0
- package/lib/services/screen-size.service.d.ts +10 -0
- package/lib/services/table.service.d.ts +13 -0
- package/package.json +35 -19
- package/.eslintrc.json +0 -48
- package/jest.config.ts +0 -21
- package/ng-package.json +0 -7
- package/project.json +0 -36
- package/src/lib/common/angular-helper.ts +0 -44
- package/src/lib/common/constants.ts +0 -5
- package/src/lib/common/control.models.ts +0 -71
- package/src/lib/common/datasource-component.model.spec.ts +0 -42
- package/src/lib/common/datasource-component.model.ts +0 -43
- package/src/lib/common/download-file.ts +0 -20
- package/src/lib/common/filter.ts +0 -7
- package/src/lib/common/rxjs.spec.ts +0 -58
- package/src/lib/common/rxjs.ts +0 -21
- package/src/lib/components/action-button-group/action-button-group.model.ts +0 -15
- package/src/lib/components/action-button-group/action-button.model.ts +0 -15
- package/src/lib/components/base-form/base-form-input.component.ts +0 -121
- package/src/lib/components/base-form/base-form.component.ts +0 -236
- package/src/lib/components/base-form/directives/detail-store.directive.ts +0 -219
- package/src/lib/components/base-form/models/base-form-input.models.ts +0 -11
- package/src/lib/components/base-form/models/base-form.models.ts +0 -31
- package/src/lib/components/breadcrumb/breadcrumb.service.ts +0 -9
- package/src/lib/components/breadcrumb/breadcrumbcore.component.ts +0 -115
- package/src/lib/components/breadcrumb/index.ts +0 -3
- package/src/lib/components/button/index.ts +0 -1
- package/src/lib/components/calendar/index.ts +0 -1
- package/src/lib/components/checkbox/checkbox.model.ts +0 -8
- package/src/lib/components/checkbox/index.ts +0 -1
- package/src/lib/components/confirm-dialog/confirm-dialog.model.ts +0 -31
- package/src/lib/components/confirm-dialog/index.ts +0 -1
- package/src/lib/components/dropdown/index.ts +0 -1
- package/src/lib/components/dynamic-component/dynamic-component.model.ts +0 -2
- package/src/lib/components/dynamic-component/index.ts +0 -1
- package/src/lib/components/filter/filter.model.ts +0 -17
- package/src/lib/components/form-field/index.ts +0 -1
- package/src/lib/components/generic-field/index.ts +0 -1
- package/src/lib/components/generic-form/generic-form.component.ts +0 -33
- package/src/lib/components/header/index.ts +0 -1
- package/src/lib/components/icons/icons.component.ts +0 -17
- package/src/lib/components/icons/icons.model.ts +0 -10
- package/src/lib/components/icons/index.ts +0 -2
- package/src/lib/components/input-group/index.ts +0 -1
- package/src/lib/components/loader/index.ts +0 -1
- package/src/lib/components/loader/loader.model.ts +0 -7
- package/src/lib/components/multiselect/index.ts +0 -1
- package/src/lib/components/number-input/index.ts +0 -1
- package/src/lib/components/page-header/page-header.service.ts +0 -9
- package/src/lib/components/page-header/page-headercore.component.ts +0 -40
- package/src/lib/components/password/index.ts +0 -1
- package/src/lib/components/radiobutton/index.ts +0 -1
- package/src/lib/components/section/index.ts +0 -1
- package/src/lib/components/side-menu/directives/side-menu-service.directive.ts +0 -31
- package/src/lib/components/side-menu/services/side-menu-provider.service.ts +0 -13
- package/src/lib/components/side-menu/services/side-menu.service.ts +0 -62
- package/src/lib/components/side-menu/side-menu.model.ts +0 -67
- package/src/lib/components/slider/index.ts +0 -1
- package/src/lib/components/snackbar/index.ts +0 -1
- package/src/lib/components/snackbar/snackbar.model.ts +0 -7
- package/src/lib/components/stepper/index.ts +0 -1
- package/src/lib/components/switch/index.ts +0 -1
- package/src/lib/components/switch/switch.model.ts +0 -8
- package/src/lib/components/tab-view/index.ts +0 -1
- package/src/lib/components/table/column-configuration.ts +0 -38
- package/src/lib/components/table/table-builder.ts +0 -93
- package/src/lib/components/table/table-column.directive.ts +0 -62
- package/src/lib/components/table/table.models.ts +0 -261
- package/src/lib/components/table-filter/index.ts +0 -1
- package/src/lib/components/textarea/index.ts +0 -1
- package/src/lib/components/textfield/index.ts +0 -1
- package/src/lib/components/tristatecheckbox/index.ts +0 -1
- package/src/lib/components/tristatecheckbox/tristatecheckbox.model.ts +0 -8
- package/src/lib/components/unsubscribe.component.ts +0 -12
- package/src/lib/directives/datasource.directive.ts +0 -275
- package/src/lib/directives/shortcut.directive.ts +0 -37
- package/src/lib/directives/table-datasource.directive.ts +0 -184
- package/src/lib/directives/table-filter.directive.ts +0 -69
- package/src/lib/format/format.ts +0 -74
- package/src/lib/pipes/error/error.codes.ts +0 -11
- package/src/lib/pipes/error/error.models.ts +0 -27
- package/src/lib/pipes/error/error.pipe.ts +0 -27
- package/src/lib/pipes/error/warning.codes.ts +0 -5
- package/src/lib/pipes/error/warning.pipe.ts +0 -27
- package/src/lib/pipes/helper/enumToList.pipe.ts +0 -16
- package/src/lib/pipes/keyOrFn/keyOrFn.pipe.ts +0 -23
- package/src/lib/services/confirm-dialog.service.ts +0 -44
- package/src/lib/services/leave-form.service.ts +0 -53
- package/src/lib/services/screen-size.service.ts +0 -25
- package/src/lib/services/table.service.ts +0 -22
- package/src/test-setup.ts +0 -8
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -16
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, InjectionToken, TemplateRef } from '@angular/core';
|
|
2
|
-
import { Params } from '@angular/router';
|
|
3
|
-
import { LazyLoadEvent, Sort, SortDirectionType } from '@verisoft/core';
|
|
4
|
-
import { v4 } from 'uuid';
|
|
5
|
-
import { FieldAlignType } from '../../common';
|
|
6
|
-
|
|
7
|
-
export const TABLE_COMPONENT_TOKEN = new InjectionToken<TableCore<any>>(
|
|
8
|
-
'TabVIewComponentToken'
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export const TABLE_COLUMN_PROVIDER = new InjectionToken(
|
|
12
|
-
'TABLE_COLUMN_PROVIDER'
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export enum TableSelectionMode {
|
|
16
|
-
single = 'single',
|
|
17
|
-
multiple = 'multiple',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum TableButtonSeverity {
|
|
21
|
-
success = 'success',
|
|
22
|
-
info = 'info',
|
|
23
|
-
warning = 'warning',
|
|
24
|
-
danger = 'danger',
|
|
25
|
-
help = 'help',
|
|
26
|
-
primary = 'primary',
|
|
27
|
-
secondary = 'secondary',
|
|
28
|
-
contrast = 'contrast',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export enum ColumnVisibility {
|
|
32
|
-
visible = 'visible',
|
|
33
|
-
hidden = 'hidden',
|
|
34
|
-
default = 'default',
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type TableSelectionModeType = keyof typeof TableSelectionMode;
|
|
38
|
-
export type TableButtonSeverityType = keyof typeof TableButtonSeverity;
|
|
39
|
-
export type ColumnVisibilityType = keyof typeof ColumnVisibility;
|
|
40
|
-
|
|
41
|
-
export interface TableCore<T> {
|
|
42
|
-
sorters: Sort[];
|
|
43
|
-
columns: ColumnDefinition<T>[];
|
|
44
|
-
data: T[];
|
|
45
|
-
total: number;
|
|
46
|
-
filter: Partial<T> | undefined;
|
|
47
|
-
loading: boolean;
|
|
48
|
-
scrollable: boolean;
|
|
49
|
-
pageSize: number;
|
|
50
|
-
currentPage: number;
|
|
51
|
-
showPaginator: boolean;
|
|
52
|
-
sortMultiple: boolean;
|
|
53
|
-
lazy: boolean;
|
|
54
|
-
selection: T[];
|
|
55
|
-
selectionMode: TableSelectionModeType | undefined;
|
|
56
|
-
showPageSizePicker: boolean;
|
|
57
|
-
entityKey: string | undefined;
|
|
58
|
-
selectionChange: EventEmitter<T[]>;
|
|
59
|
-
lazyLoad: EventEmitter<LazyLoadEvent>;
|
|
60
|
-
maximumColumnLength: number;
|
|
61
|
-
disableCustomClicks: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface TableSignal {
|
|
65
|
-
name: string,
|
|
66
|
-
symbol: symbol
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface ActionColumnsDefinition<T> {
|
|
70
|
-
severity?: TableButtonSeverity;
|
|
71
|
-
title?: string;
|
|
72
|
-
icon?: string;
|
|
73
|
-
tooltip?: string;
|
|
74
|
-
rounded?: boolean;
|
|
75
|
-
outlined?: boolean;
|
|
76
|
-
raised?: boolean;
|
|
77
|
-
badge?: string;
|
|
78
|
-
visible?: (row: T) => boolean;
|
|
79
|
-
routerLink?: (row: T) => string;
|
|
80
|
-
queryParams?: Params;
|
|
81
|
-
disabled?: boolean | ((row: T) => boolean);
|
|
82
|
-
onClick?: (row: T, event?: MouseEvent) => void;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface ColumnProvider<T> {
|
|
86
|
-
getDefinition(): ColumnDefinition<T>;
|
|
87
|
-
index: number;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface ColumnDefinition<T, _KEY = keyof T> {
|
|
91
|
-
id: string;
|
|
92
|
-
value?: (row: T, index?: number) => string;
|
|
93
|
-
headerName?: ((columnId: string, index?: number) => string) | string;
|
|
94
|
-
icon?: string | ((row?: T | undefined) => string);
|
|
95
|
-
type?: string;
|
|
96
|
-
sortable?: boolean;
|
|
97
|
-
format?: (row: T) => string
|
|
98
|
-
routerLink?: (row: T) => string | string;
|
|
99
|
-
queryParams?: Params;
|
|
100
|
-
columnClass?: string;
|
|
101
|
-
template?: TemplateRef<{ $implicit: T }>;
|
|
102
|
-
actions?: ActionColumnsDefinition<T>[];
|
|
103
|
-
textAlign?: FieldAlignType;
|
|
104
|
-
width?: string | number;
|
|
105
|
-
forceVisibility?: ColumnVisibilityType;
|
|
106
|
-
visible?: boolean;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export function LinkRenderer<T>(text: string, href: string) {
|
|
110
|
-
return (row: T, index: number | undefined) => {
|
|
111
|
-
return '<a href="' + href + '">' + text + '</a>';
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function routerRenderer<T>(link: string, text: string) {
|
|
116
|
-
return (row: T, index?: number | undefined) => {
|
|
117
|
-
return { text: text, link: link };
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export function Renderer<T>(fnc: (row: T) => string) {
|
|
122
|
-
return (row: T) => {
|
|
123
|
-
return fnc(row);
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export class ColumnModel<T> {
|
|
128
|
-
sortDirection: SortDirectionType | undefined = undefined;
|
|
129
|
-
columnClass?: string;
|
|
130
|
-
queryParams?: Params;
|
|
131
|
-
routerLink?: (row: T) => string | string;
|
|
132
|
-
valueGetter!: (row: T, index: number) => string;
|
|
133
|
-
headerGetter!: (columnId: string, index: number) => string | string;
|
|
134
|
-
template?: TemplateRef<{ $implicit: T }>;
|
|
135
|
-
actions?: ActionColumnsDefinition<T>[];
|
|
136
|
-
sortable?: boolean;
|
|
137
|
-
id: string;
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
139
|
-
format!: Function;
|
|
140
|
-
textAlign?: FieldAlignType;
|
|
141
|
-
width: string | undefined;
|
|
142
|
-
forceVisibility: ColumnVisibilityType = ColumnVisibility.default;
|
|
143
|
-
visible = true;
|
|
144
|
-
|
|
145
|
-
constructor(readonly configuration: ColumnDefinition<T>) {
|
|
146
|
-
this.id = this.configuration.id;
|
|
147
|
-
|
|
148
|
-
if (this.configuration.format) {
|
|
149
|
-
this.format = this.configuration.format;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (this.configuration.value) {
|
|
153
|
-
this.valueGetter = (row, index) => {
|
|
154
|
-
const value = this.configuration.value?.(row, index) ?? '-';
|
|
155
|
-
return this.format ? this.format(value, row) : value;
|
|
156
|
-
};
|
|
157
|
-
} else {
|
|
158
|
-
this.valueGetter = (row) => {
|
|
159
|
-
const value = ((row as { [key: string]: string })?.[this.configuration.id]) ?? '';
|
|
160
|
-
return this.format ? this.format(value, row) : value;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (this.configuration.actions) {
|
|
165
|
-
this.actions = this.configuration.actions;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (this.configuration.routerLink) {
|
|
169
|
-
this.routerLink = this.configuration.routerLink;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (this.configuration.columnClass) {
|
|
173
|
-
this.columnClass = this.configuration.columnClass;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (this.configuration.template) {
|
|
177
|
-
this.template = this.configuration.template;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (this.configuration.headerName) {
|
|
181
|
-
this.headerGetter = (
|
|
182
|
-
typeof this.configuration.headerName === 'string'
|
|
183
|
-
? () => this.configuration.headerName ?? ''
|
|
184
|
-
: (columnId: string, index: number) =>
|
|
185
|
-
(<(columnId: string, index?: number) => string>(
|
|
186
|
-
this.configuration.headerName
|
|
187
|
-
))?.(columnId, index) ?? this.id
|
|
188
|
-
) as (columnId: string, index: number) => string;
|
|
189
|
-
} else {
|
|
190
|
-
this.headerGetter = () => "";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (this.configuration.queryParams) {
|
|
194
|
-
this.queryParams = this.configuration.queryParams;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (this.routerLink) {
|
|
198
|
-
this.columnClass += ' ' + 'link';
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (this.configuration.sortable !== undefined) {
|
|
202
|
-
this.sortable = this.configuration.sortable;
|
|
203
|
-
} else {
|
|
204
|
-
this.sortable = true;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (this.configuration.width){
|
|
208
|
-
this.width = typeof this.configuration.width === "number" ? this.configuration.width + 'px' : this.configuration.width;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (this.configuration.textAlign !== undefined) {
|
|
212
|
-
this.textAlign = this.configuration.textAlign;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (this.configuration.forceVisibility) {
|
|
216
|
-
this.forceVisibility = this.configuration.forceVisibility;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (this.configuration.visible !== undefined) {
|
|
220
|
-
this.visible = this.configuration.visible;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export class RowModel<T> {
|
|
226
|
-
row: T;
|
|
227
|
-
index?: number;
|
|
228
|
-
id: number | string;
|
|
229
|
-
selected: boolean;
|
|
230
|
-
marked?: boolean;
|
|
231
|
-
focused?: boolean;
|
|
232
|
-
expanded: boolean;
|
|
233
|
-
fnc?: void;
|
|
234
|
-
customRoute: string | undefined;
|
|
235
|
-
|
|
236
|
-
constructor(
|
|
237
|
-
row: T,
|
|
238
|
-
selected: boolean,
|
|
239
|
-
expanded: boolean,
|
|
240
|
-
marked?: boolean,
|
|
241
|
-
index?: number,
|
|
242
|
-
fnc?: void,
|
|
243
|
-
customRoute?: string,
|
|
244
|
-
entityKey?: string
|
|
245
|
-
) {
|
|
246
|
-
this.row = row;
|
|
247
|
-
this.id = (row as { [key: string]: string })['id'] ?? v4();
|
|
248
|
-
this.index = index;
|
|
249
|
-
this.selected = selected;
|
|
250
|
-
this.expanded = expanded;
|
|
251
|
-
this.marked = marked;
|
|
252
|
-
this.fnc = fnc;
|
|
253
|
-
this.customRoute = createCustomRoute<T>(row, entityKey, customRoute);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function createCustomRoute<T>(row: T, entityKey?: string, customRoute?: string) {
|
|
258
|
-
return customRoute && entityKey
|
|
259
|
-
? `${customRoute}/` + (row as { [key: string]: string })[entityKey]
|
|
260
|
-
: undefined;
|
|
261
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './table-filter.model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './textarea.model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './textfield.model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tristatecheckbox.model'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { BaseFormCore } from '../base-form';
|
|
3
|
-
|
|
4
|
-
export const TRISTATE_CHECKBOX_COMPONENT_TOKEN = new InjectionToken<TristateCheckboxCore>(
|
|
5
|
-
'TristateCheckboxComponentToken'
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
export type TristateCheckboxCore = BaseFormCore
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Directive, OnDestroy } from '@angular/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
|
|
4
|
-
@Directive()
|
|
5
|
-
export abstract class UnsubscribeComponent implements OnDestroy {
|
|
6
|
-
destroyed$ = new Subject<void>();
|
|
7
|
-
|
|
8
|
-
ngOnDestroy() {
|
|
9
|
-
this.destroyed$.next();
|
|
10
|
-
this.destroyed$.complete();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectorRef,
|
|
4
|
-
Directive,
|
|
5
|
-
inject,
|
|
6
|
-
Input,
|
|
7
|
-
OnChanges,
|
|
8
|
-
OnInit,
|
|
9
|
-
SimpleChanges,
|
|
10
|
-
} from '@angular/core';
|
|
11
|
-
import {
|
|
12
|
-
BASE_URL_PATH,
|
|
13
|
-
convertDatasource,
|
|
14
|
-
DataSourceFunctionType,
|
|
15
|
-
DatasourceType,
|
|
16
|
-
DEFAULT_SEARCH_LIMIT,
|
|
17
|
-
FilterEvent,
|
|
18
|
-
LazyLoadEvent,
|
|
19
|
-
normalizeRequest,
|
|
20
|
-
Page,
|
|
21
|
-
RequestParams,
|
|
22
|
-
} from '@verisoft/core';
|
|
23
|
-
import {
|
|
24
|
-
BehaviorSubject,
|
|
25
|
-
catchError,
|
|
26
|
-
debounceTime,
|
|
27
|
-
filter,
|
|
28
|
-
map,
|
|
29
|
-
of,
|
|
30
|
-
switchMap,
|
|
31
|
-
takeUntil,
|
|
32
|
-
tap,
|
|
33
|
-
} from 'rxjs';
|
|
34
|
-
import {
|
|
35
|
-
DataSourceComponentModel,
|
|
36
|
-
DEFAULT_DEBOUNCE_TIME,
|
|
37
|
-
ExtendedRequestType,
|
|
38
|
-
setComponentProperties,
|
|
39
|
-
setDataToArray,
|
|
40
|
-
} from '../common';
|
|
41
|
-
import {
|
|
42
|
-
DROPDOWN_COMPONENT_TOKEN,
|
|
43
|
-
DropdownCore,
|
|
44
|
-
GENERIC_FIELD_COMPONENT_TOKEN,
|
|
45
|
-
GenericFieldCore,
|
|
46
|
-
MULTISELECT_COMPONENT_TOKEN,
|
|
47
|
-
MultiselectCore,
|
|
48
|
-
UnsubscribeComponent,
|
|
49
|
-
} from '../components';
|
|
50
|
-
|
|
51
|
-
@Directive({
|
|
52
|
-
selector:
|
|
53
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
54
|
-
'v-dropdown[useDatasource], v-multiselect[useDatasource], v-generic-field[useDatasource]',
|
|
55
|
-
standalone: true,
|
|
56
|
-
})
|
|
57
|
-
export class DatasourceDirective<T>
|
|
58
|
-
extends UnsubscribeComponent
|
|
59
|
-
implements OnChanges, OnInit
|
|
60
|
-
{
|
|
61
|
-
@Input() datasource!: DatasourceType<T>;
|
|
62
|
-
|
|
63
|
-
@Input() autoBind = true;
|
|
64
|
-
|
|
65
|
-
@Input() loadingText = '... loading ...';
|
|
66
|
-
|
|
67
|
-
@Input() filterField: string | undefined = 'fulltext';
|
|
68
|
-
|
|
69
|
-
@Input() transformFn?: (data: T) => unknown;
|
|
70
|
-
|
|
71
|
-
@Input() extraFilter!: any;
|
|
72
|
-
|
|
73
|
-
get activeComponent(): DataSourceComponentModel<T> {
|
|
74
|
-
return (this.dropdownComponent ??
|
|
75
|
-
this.multiSelectComponent ??
|
|
76
|
-
this.genericField) as DataSourceComponentModel<T>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private httpClient = inject(HttpClient);
|
|
80
|
-
|
|
81
|
-
private baseUrl: string = inject(BASE_URL_PATH);
|
|
82
|
-
|
|
83
|
-
private changeDetectorRef = inject(ChangeDetectorRef);
|
|
84
|
-
|
|
85
|
-
private isAllDataLoaded = false;
|
|
86
|
-
|
|
87
|
-
private parameters$ = new BehaviorSubject<Partial<ExtendedRequestType<T>>>({});
|
|
88
|
-
|
|
89
|
-
private lastParameter = {};
|
|
90
|
-
|
|
91
|
-
private dropdownComponent = inject<DropdownCore<T>>(
|
|
92
|
-
DROPDOWN_COMPONENT_TOKEN,
|
|
93
|
-
{ optional: true }
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
private multiSelectComponent = inject<MultiselectCore<T>>(
|
|
97
|
-
MULTISELECT_COMPONENT_TOKEN,
|
|
98
|
-
{
|
|
99
|
-
optional: true,
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
private genericField = inject<GenericFieldCore<T>>(
|
|
104
|
-
GENERIC_FIELD_COMPONENT_TOKEN,
|
|
105
|
-
{ optional: true }
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
private dataSourceService?: DataSourceFunctionType<T>;
|
|
109
|
-
|
|
110
|
-
private loadingPlaceholderItem: { [key: string]: unknown } = {};
|
|
111
|
-
|
|
112
|
-
ngOnInit(): void {
|
|
113
|
-
this.activeComponent.showed
|
|
114
|
-
.pipe(takeUntil(this.destroyed$))
|
|
115
|
-
.subscribe(() => {
|
|
116
|
-
if (
|
|
117
|
-
!this.autoBind &&
|
|
118
|
-
!this.activeComponent.options &&
|
|
119
|
-
!this.activeComponent.loading
|
|
120
|
-
) {
|
|
121
|
-
this.parameters$.next({});
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
this.activeComponent.lazyLoad
|
|
126
|
-
.pipe(takeUntil(this.destroyed$))
|
|
127
|
-
.subscribe((value: LazyLoadEvent) => {
|
|
128
|
-
this.parameters$.next({ offset: value?.offset, limit: value?.limit });
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
this.activeComponent.filtered
|
|
132
|
-
.pipe(takeUntil(this.destroyed$))
|
|
133
|
-
.subscribe((value: FilterEvent) => {
|
|
134
|
-
const property = this.filterField ?? this.activeComponent.optionLabel;
|
|
135
|
-
if (property) {
|
|
136
|
-
this.parameters$.next({
|
|
137
|
-
offset: 0,
|
|
138
|
-
filter: {
|
|
139
|
-
[property]: value.filter ? value.filter : undefined,
|
|
140
|
-
...(this.extraFilter ?? {})
|
|
141
|
-
} as Partial<T>,
|
|
142
|
-
useNewData: true,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
this.parameters$
|
|
148
|
-
.pipe(
|
|
149
|
-
takeUntil(this.destroyed$),
|
|
150
|
-
filter(request => !this.isDataForRequestLoaded(request)),
|
|
151
|
-
map((request) => {
|
|
152
|
-
const extendedParams = normalizeRequest({ ...this.lastParameter, ...request }, DEFAULT_SEARCH_LIMIT) as ExtendedRequestType<T>;
|
|
153
|
-
extendedParams.useNewData = request.useNewData ?? false;
|
|
154
|
-
return extendedParams;
|
|
155
|
-
}),
|
|
156
|
-
tap((request) => {
|
|
157
|
-
this.lastParameter = request;
|
|
158
|
-
}),
|
|
159
|
-
debounceTime(DEFAULT_DEBOUNCE_TIME),
|
|
160
|
-
tap(() => {
|
|
161
|
-
this.changeComponent(this.activeComponent, {
|
|
162
|
-
loading: true,
|
|
163
|
-
});
|
|
164
|
-
}),
|
|
165
|
-
switchMap((request) =>
|
|
166
|
-
this.dataSourceService
|
|
167
|
-
? this.dataSourceService(request as RequestParams<T>).pipe(
|
|
168
|
-
map((response) => ({ request, response }))
|
|
169
|
-
)
|
|
170
|
-
: of({
|
|
171
|
-
request,
|
|
172
|
-
response: {
|
|
173
|
-
data: [] as T[],
|
|
174
|
-
total: 0,
|
|
175
|
-
limit: request.limit,
|
|
176
|
-
offset: request.offset,
|
|
177
|
-
} as Page<T>,
|
|
178
|
-
})
|
|
179
|
-
),
|
|
180
|
-
catchError((request) => {
|
|
181
|
-
this.changeComponent(this.activeComponent, {
|
|
182
|
-
loading: false,
|
|
183
|
-
});
|
|
184
|
-
return of({
|
|
185
|
-
request: request as ExtendedRequestType<T>,
|
|
186
|
-
response: {
|
|
187
|
-
data: [] as T[],
|
|
188
|
-
total: 0,
|
|
189
|
-
limit: request.limit,
|
|
190
|
-
offset: request.offset,
|
|
191
|
-
} as Page<T>,
|
|
192
|
-
});
|
|
193
|
-
})
|
|
194
|
-
)
|
|
195
|
-
.subscribe(({ request, response }) =>
|
|
196
|
-
this.setDataToControl(request, response)
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
201
|
-
if (changes['datasource']) {
|
|
202
|
-
this.dataSourceService = convertDatasource(
|
|
203
|
-
this.datasource,
|
|
204
|
-
this.baseUrl,
|
|
205
|
-
this.httpClient
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
if (this.autoBind) {
|
|
209
|
-
this.parameters$.next({ offset: 0 });
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private isDataForRequestLoaded(request: Partial<ExtendedRequestType<T>>) {
|
|
215
|
-
if (request.useNewData) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const offset = request.offset ?? 0;
|
|
220
|
-
const limit = request.limit ?? DEFAULT_SEARCH_LIMIT;
|
|
221
|
-
const options = this.activeComponent.options;
|
|
222
|
-
if (!options) {
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (options.length < offset + limit) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const allItemsFilled = options.slice(offset, offset + limit).every(item => item !== undefined && item != this.loadingPlaceholderItem);
|
|
231
|
-
return allItemsFilled;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
private setDataToControl(request: ExtendedRequestType<T>, result: Page<T>): void {
|
|
235
|
-
this.isAllDataLoaded = result.total <= result.data.length;
|
|
236
|
-
const data = result.data;
|
|
237
|
-
const total = result.total;
|
|
238
|
-
const offset = request.offset;
|
|
239
|
-
const transferedData = this.transformFn
|
|
240
|
-
? data.map((x) => this.transformFn?.(x))
|
|
241
|
-
: data;
|
|
242
|
-
|
|
243
|
-
if (this.activeComponent.optionLabel) {
|
|
244
|
-
this.loadingPlaceholderItem[this.activeComponent.optionLabel] =
|
|
245
|
-
this.loadingText;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (this.activeComponent.optionValue) {
|
|
249
|
-
this.loadingPlaceholderItem[this.activeComponent.optionValue] = -1;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const options = request.useNewData ? undefined : this.activeComponent.options;
|
|
253
|
-
const newOptions = setDataToArray(
|
|
254
|
-
options,
|
|
255
|
-
transferedData,
|
|
256
|
-
offset,
|
|
257
|
-
total,
|
|
258
|
-
this.loadingPlaceholderItem
|
|
259
|
-
);
|
|
260
|
-
|
|
261
|
-
this.changeComponent(this.activeComponent, {
|
|
262
|
-
options: newOptions as T[],
|
|
263
|
-
loading: false,
|
|
264
|
-
lazy: !this.isAllDataLoaded,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
private changeComponent(
|
|
269
|
-
component: DataSourceComponentModel<T>,
|
|
270
|
-
value: Partial<DataSourceComponentModel<T>>
|
|
271
|
-
) {
|
|
272
|
-
setComponentProperties(component, value);
|
|
273
|
-
this.changeDetectorRef.detectChanges();
|
|
274
|
-
}
|
|
275
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Directive, HostListener, Input } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
@Directive({
|
|
4
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
5
|
-
selector: 'v-button[useShortCut]',
|
|
6
|
-
exportAs: 'useShortCut',
|
|
7
|
-
standalone: true,
|
|
8
|
-
})
|
|
9
|
-
export class ButtonShortCutDirective
|
|
10
|
-
{
|
|
11
|
-
@Input() shortCutFn?: () => void;
|
|
12
|
-
@Input() shortCutKey!: string;
|
|
13
|
-
|
|
14
|
-
private keyMap: { [key: string]: boolean } = {};
|
|
15
|
-
|
|
16
|
-
@HostListener('document:keydown', ['$event'])
|
|
17
|
-
onKeyDown(event: KeyboardEvent) {
|
|
18
|
-
this.keyMap[event.key.toLowerCase()] = true;
|
|
19
|
-
this.checkShortcut();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@HostListener('document:keyup', ['$event'])
|
|
23
|
-
onKeyUp(event: KeyboardEvent) {
|
|
24
|
-
this.keyMap[event.key.toLowerCase()] = false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private checkShortcut() {
|
|
28
|
-
if (this.shortCutKey && this.shortCutFn) {
|
|
29
|
-
const keys = this.shortCutKey.toLowerCase().split('+');
|
|
30
|
-
const isShortcutPressed = keys.every((key) => this.keyMap[key]);
|
|
31
|
-
if (isShortcutPressed) {
|
|
32
|
-
this.shortCutFn?.();
|
|
33
|
-
keys.forEach((key) => (this.keyMap[key] = false));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|