@verisoft/ui-core 18.6.0 → 18.7.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/.eslintrc.json +48 -0
- package/README.md +52 -3
- package/jest.config.ts +21 -0
- package/ng-package.json +7 -0
- package/package.json +19 -35
- package/project.json +36 -0
- package/{index.d.ts → src/index.ts} +6 -6
- package/src/lib/common/angular-helper.ts +44 -0
- package/src/lib/common/constants.ts +5 -0
- package/src/lib/common/control.models.ts +71 -0
- package/src/lib/common/datasource-component.model.spec.ts +42 -0
- package/src/lib/common/datasource-component.model.ts +43 -0
- package/{lib/common/deactivate-guard.model.d.ts → src/lib/common/deactivate-guard.model.ts} +5 -4
- package/src/lib/common/download-file.ts +20 -0
- package/src/lib/common/filter.ts +7 -0
- package/{lib/common/icons.d.ts → src/lib/common/icons.ts} +34 -34
- package/{lib/common/index.d.ts → src/lib/common/index.ts} +10 -10
- package/{lib/common/notificable-property.model.d.ts → src/lib/common/notificable-property.model.ts} +5 -4
- package/src/lib/common/rxjs.spec.ts +58 -0
- package/src/lib/common/rxjs.ts +21 -0
- package/src/lib/components/action-button-group/action-button-group.model.ts +15 -0
- package/src/lib/components/action-button-group/action-button.model.ts +15 -0
- package/{lib/components/action-button-group/index.d.ts → src/lib/components/action-button-group/index.ts} +2 -2
- package/src/lib/components/base-form/base-form-input.component.ts +121 -0
- package/src/lib/components/base-form/base-form.component.ts +236 -0
- package/src/lib/components/base-form/directives/detail-store.directive.ts +219 -0
- package/{lib/components/base-form/index.d.ts → src/lib/components/base-form/index.ts} +4 -4
- package/src/lib/components/base-form/models/base-form-input.models.ts +11 -0
- package/src/lib/components/base-form/models/base-form.models.ts +31 -0
- package/{lib/components/base-form/models/index.d.ts → src/lib/components/base-form/models/index.ts} +2 -2
- package/{lib/components/breadcrumb/breadcrumb.model.d.ts → src/lib/components/breadcrumb/breadcrumb.model.ts} +21 -16
- package/src/lib/components/breadcrumb/breadcrumb.service.ts +9 -0
- package/src/lib/components/breadcrumb/breadcrumbcore.component.ts +115 -0
- package/src/lib/components/breadcrumb/index.ts +3 -0
- package/{lib/components/button/button.model.d.ts → src/lib/components/button/button.model.ts} +21 -17
- package/src/lib/components/button/index.ts +1 -0
- package/{lib/components/calendar/calendar.model.d.ts → src/lib/components/calendar/calendar.model.ts} +16 -12
- package/src/lib/components/calendar/index.ts +1 -0
- package/src/lib/components/checkbox/checkbox.model.ts +8 -0
- package/src/lib/components/checkbox/index.ts +1 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.model.ts +31 -0
- package/src/lib/components/confirm-dialog/index.ts +1 -0
- package/{lib/components/dropdown/dropdown.model.d.ts → src/lib/components/dropdown/dropdown.model.ts} +16 -12
- package/src/lib/components/dropdown/index.ts +1 -0
- package/src/lib/components/dynamic-component/dynamic-component.model.ts +2 -0
- package/src/lib/components/dynamic-component/index.ts +1 -0
- package/src/lib/components/filter/filter.model.ts +17 -0
- package/{lib/components/filter/index.d.ts → src/lib/components/filter/index.ts} +1 -1
- package/{lib/components/form-field/form-field.model.d.ts → src/lib/components/form-field/form-field.model.ts} +15 -11
- package/src/lib/components/form-field/index.ts +1 -0
- package/{lib/components/generic-field/generic-field.model.d.ts → src/lib/components/generic-field/generic-field.model.ts} +10 -6
- package/src/lib/components/generic-field/index.ts +1 -0
- package/src/lib/components/generic-form/generic-form.component.ts +33 -0
- package/{lib/components/generic-form/index.d.ts → src/lib/components/generic-form/index.ts} +1 -1
- package/{lib/components/header/header.model.d.ts → src/lib/components/header/header.model.ts} +18 -11
- package/src/lib/components/header/index.ts +1 -0
- package/src/lib/components/icons/icons.component.ts +17 -0
- package/src/lib/components/icons/icons.model.ts +10 -0
- package/src/lib/components/icons/index.ts +2 -0
- package/{lib/components/index.d.ts → src/lib/components/index.ts} +35 -35
- package/src/lib/components/input-group/index.ts +1 -0
- package/{lib/components/input-group/input-group.model.d.ts → src/lib/components/input-group/input-group.model.ts} +17 -12
- package/src/lib/components/loader/index.ts +1 -0
- package/src/lib/components/loader/loader.model.ts +7 -0
- package/src/lib/components/multiselect/index.ts +1 -0
- package/{lib/components/multiselect/mutiselect.model.d.ts → src/lib/components/multiselect/mutiselect.model.ts} +13 -9
- package/src/lib/components/number-input/index.ts +1 -0
- package/{lib/components/number-input/number-input.model.d.ts → src/lib/components/number-input/number-input.model.ts} +14 -10
- package/{lib/components/page-header/index.d.ts → src/lib/components/page-header/index.ts} +3 -3
- package/{lib/components/page-header/page-header.model.d.ts → src/lib/components/page-header/page-header.model.ts} +11 -7
- package/src/lib/components/page-header/page-header.service.ts +9 -0
- package/src/lib/components/page-header/page-headercore.component.ts +40 -0
- package/src/lib/components/password/index.ts +1 -0
- package/{lib/components/password/password.model.d.ts → src/lib/components/password/password.model.ts} +25 -19
- package/src/lib/components/radiobutton/index.ts +1 -0
- package/{lib/components/radiobutton/radiobutton.model.d.ts → src/lib/components/radiobutton/radiobutton.model.ts} +16 -11
- package/src/lib/components/section/index.ts +1 -0
- package/{lib/components/section/section.model.d.ts → src/lib/components/section/section.model.ts} +11 -7
- package/src/lib/components/side-menu/directives/side-menu-service.directive.ts +31 -0
- package/{lib/components/side-menu/index.d.ts → src/lib/components/side-menu/index.ts} +4 -4
- package/src/lib/components/side-menu/services/side-menu-provider.service.ts +13 -0
- package/src/lib/components/side-menu/services/side-menu.service.ts +62 -0
- package/src/lib/components/side-menu/side-menu.model.ts +67 -0
- package/src/lib/components/slider/index.ts +1 -0
- package/{lib/components/slider/slider.model.d.ts → src/lib/components/slider/slider.model.ts} +13 -9
- package/src/lib/components/snackbar/index.ts +1 -0
- package/src/lib/components/snackbar/snackbar.model.ts +7 -0
- package/src/lib/components/stepper/index.ts +1 -0
- package/{lib/components/stepper/stepper.model.d.ts → src/lib/components/stepper/stepper.model.ts} +24 -19
- package/src/lib/components/switch/index.ts +1 -0
- package/src/lib/components/switch/switch.model.ts +8 -0
- package/src/lib/components/tab-view/index.ts +1 -0
- package/{lib/components/tab-view/tab-view.model.d.ts → src/lib/components/tab-view/tab-view.model.ts} +22 -17
- package/src/lib/components/table/column-configuration.ts +38 -0
- package/{lib/components/table/index.d.ts → src/lib/components/table/index.ts} +4 -4
- package/src/lib/components/table/table-builder.ts +93 -0
- package/src/lib/components/table/table-column.directive.ts +62 -0
- package/src/lib/components/table/table.models.ts +261 -0
- package/src/lib/components/table-filter/index.ts +1 -0
- package/{lib/components/table-filter/table-filter.model.d.ts → src/lib/components/table-filter/table-filter.model.ts} +22 -17
- package/src/lib/components/textarea/index.ts +1 -0
- package/{lib/components/textarea/textarea.model.d.ts → src/lib/components/textarea/textarea.model.ts} +13 -9
- package/src/lib/components/textfield/index.ts +1 -0
- package/{lib/components/textfield/textfield.model.d.ts → src/lib/components/textfield/textfield.model.ts} +13 -9
- package/src/lib/components/tristatecheckbox/index.ts +1 -0
- package/src/lib/components/tristatecheckbox/tristatecheckbox.model.ts +8 -0
- package/src/lib/components/unsubscribe.component.ts +12 -0
- package/src/lib/directives/datasource.directive.ts +275 -0
- package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +4 -4
- package/src/lib/directives/shortcut.directive.ts +37 -0
- package/src/lib/directives/table-datasource.directive.ts +184 -0
- package/src/lib/directives/table-filter.directive.ts +69 -0
- package/src/lib/format/format.ts +74 -0
- package/src/lib/pipes/error/error.codes.ts +11 -0
- package/src/lib/pipes/error/error.models.ts +27 -0
- package/src/lib/pipes/error/error.pipe.ts +27 -0
- package/src/lib/pipes/error/warning.codes.ts +5 -0
- package/src/lib/pipes/error/warning.pipe.ts +27 -0
- package/src/lib/pipes/helper/enumToList.pipe.ts +16 -0
- package/{lib/pipes/index.d.ts → src/lib/pipes/index.ts} +7 -7
- package/src/lib/pipes/keyOrFn/keyOrFn.pipe.ts +23 -0
- package/src/lib/services/confirm-dialog.service.ts +44 -0
- package/{lib/services/index.d.ts → src/lib/services/index.ts} +4 -4
- package/src/lib/services/leave-form.service.ts +53 -0
- package/src/lib/services/screen-size.service.ts +25 -0
- package/src/lib/services/table.service.ts +22 -0
- package/src/test-setup.ts +8 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +16 -0
- package/esm2022/index.mjs +0 -7
- package/esm2022/lib/common/angular-helper.mjs +0 -23
- package/esm2022/lib/common/constants.mjs +0 -4
- package/esm2022/lib/common/control.models.mjs +0 -63
- package/esm2022/lib/common/datasource-component.model.mjs +0 -14
- package/esm2022/lib/common/deactivate-guard.model.mjs +0 -2
- package/esm2022/lib/common/download-file.mjs +0 -13
- package/esm2022/lib/common/filter.mjs +0 -7
- package/esm2022/lib/common/icons.mjs +0 -2
- package/esm2022/lib/common/index.mjs +0 -11
- package/esm2022/lib/common/notificable-property.model.mjs +0 -2
- package/esm2022/lib/common/rxjs.mjs +0 -11
- package/esm2022/lib/components/action-button-group/action-button-group.model.mjs +0 -3
- package/esm2022/lib/components/action-button-group/action-button.model.mjs +0 -2
- package/esm2022/lib/components/action-button-group/index.mjs +0 -3
- package/esm2022/lib/components/base-form/base-form-input.component.mjs +0 -100
- package/esm2022/lib/components/base-form/base-form.component.mjs +0 -187
- package/esm2022/lib/components/base-form/directives/detail-store.directive.mjs +0 -163
- package/esm2022/lib/components/base-form/index.mjs +0 -5
- package/esm2022/lib/components/base-form/models/base-form-input.models.mjs +0 -7
- package/esm2022/lib/components/base-form/models/base-form.models.mjs +0 -10
- package/esm2022/lib/components/base-form/models/index.mjs +0 -3
- package/esm2022/lib/components/breadcrumb/breadcrumb.model.mjs +0 -3
- package/esm2022/lib/components/breadcrumb/breadcrumb.service.mjs +0 -16
- package/esm2022/lib/components/breadcrumb/breadcrumbcore.component.mjs +0 -88
- package/esm2022/lib/components/breadcrumb/index.mjs +0 -4
- package/esm2022/lib/components/button/button.model.mjs +0 -3
- package/esm2022/lib/components/button/index.mjs +0 -2
- package/esm2022/lib/components/calendar/calendar.model.mjs +0 -3
- package/esm2022/lib/components/calendar/index.mjs +0 -2
- package/esm2022/lib/components/checkbox/checkbox.model.mjs +0 -3
- package/esm2022/lib/components/checkbox/index.mjs +0 -2
- package/esm2022/lib/components/confirm-dialog/confirm-dialog.model.mjs +0 -3
- package/esm2022/lib/components/confirm-dialog/index.mjs +0 -2
- package/esm2022/lib/components/dropdown/dropdown.model.mjs +0 -3
- package/esm2022/lib/components/dropdown/index.mjs +0 -2
- package/esm2022/lib/components/dynamic-component/dynamic-component.model.mjs +0 -2
- package/esm2022/lib/components/dynamic-component/index.mjs +0 -2
- package/esm2022/lib/components/filter/filter.model.mjs +0 -3
- package/esm2022/lib/components/filter/index.mjs +0 -2
- package/esm2022/lib/components/form-field/form-field.model.mjs +0 -3
- package/esm2022/lib/components/form-field/index.mjs +0 -2
- package/esm2022/lib/components/generic-field/generic-field.model.mjs +0 -3
- package/esm2022/lib/components/generic-field/index.mjs +0 -2
- package/esm2022/lib/components/generic-form/generic-form.component.mjs +0 -10
- package/esm2022/lib/components/generic-form/index.mjs +0 -2
- package/esm2022/lib/components/header/header.model.mjs +0 -4
- package/esm2022/lib/components/header/index.mjs +0 -2
- package/esm2022/lib/components/icons/icons.component.mjs +0 -29
- package/esm2022/lib/components/icons/icons.model.mjs +0 -3
- package/esm2022/lib/components/icons/index.mjs +0 -3
- package/esm2022/lib/components/index.mjs +0 -36
- package/esm2022/lib/components/input-group/index.mjs +0 -2
- package/esm2022/lib/components/input-group/input-group.model.mjs +0 -3
- package/esm2022/lib/components/loader/index.mjs +0 -2
- package/esm2022/lib/components/loader/loader.model.mjs +0 -3
- package/esm2022/lib/components/multiselect/index.mjs +0 -2
- package/esm2022/lib/components/multiselect/mutiselect.model.mjs +0 -3
- package/esm2022/lib/components/number-input/index.mjs +0 -2
- package/esm2022/lib/components/number-input/number-input.model.mjs +0 -3
- package/esm2022/lib/components/page-header/index.mjs +0 -4
- package/esm2022/lib/components/page-header/page-header.model.mjs +0 -3
- package/esm2022/lib/components/page-header/page-header.service.mjs +0 -16
- package/esm2022/lib/components/page-header/page-headercore.component.mjs +0 -52
- package/esm2022/lib/components/password/index.mjs +0 -2
- package/esm2022/lib/components/password/password.model.mjs +0 -11
- package/esm2022/lib/components/radiobutton/index.mjs +0 -2
- package/esm2022/lib/components/radiobutton/radiobutton.model.mjs +0 -3
- package/esm2022/lib/components/section/index.mjs +0 -2
- package/esm2022/lib/components/section/section.model.mjs +0 -3
- package/esm2022/lib/components/side-menu/directives/side-menu-service.directive.mjs +0 -31
- package/esm2022/lib/components/side-menu/index.mjs +0 -5
- package/esm2022/lib/components/side-menu/services/side-menu-provider.service.mjs +0 -25
- package/esm2022/lib/components/side-menu/services/side-menu.service.mjs +0 -50
- package/esm2022/lib/components/side-menu/side-menu.model.mjs +0 -6
- package/esm2022/lib/components/slider/index.mjs +0 -2
- package/esm2022/lib/components/slider/slider.model.mjs +0 -3
- package/esm2022/lib/components/snackbar/index.mjs +0 -2
- package/esm2022/lib/components/snackbar/snackbar.model.mjs +0 -3
- package/esm2022/lib/components/stepper/index.mjs +0 -2
- package/esm2022/lib/components/stepper/stepper.model.mjs +0 -3
- package/esm2022/lib/components/switch/index.mjs +0 -2
- package/esm2022/lib/components/switch/switch.model.mjs +0 -3
- package/esm2022/lib/components/tab-view/index.mjs +0 -2
- package/esm2022/lib/components/tab-view/tab-view.model.mjs +0 -3
- package/esm2022/lib/components/table/column-configuration.mjs +0 -32
- package/esm2022/lib/components/table/index.mjs +0 -5
- package/esm2022/lib/components/table/table-builder.mjs +0 -68
- package/esm2022/lib/components/table/table-column.directive.mjs +0 -86
- package/esm2022/lib/components/table/table.models.mjs +0 -150
- package/esm2022/lib/components/table-filter/index.mjs +0 -2
- package/esm2022/lib/components/table-filter/table-filter.model.mjs +0 -3
- package/esm2022/lib/components/textarea/index.mjs +0 -2
- package/esm2022/lib/components/textarea/textarea.model.mjs +0 -3
- package/esm2022/lib/components/textfield/index.mjs +0 -2
- package/esm2022/lib/components/textfield/textfield.model.mjs +0 -3
- package/esm2022/lib/components/tristatecheckbox/index.mjs +0 -2
- package/esm2022/lib/components/tristatecheckbox/tristatecheckbox.model.mjs +0 -3
- package/esm2022/lib/components/unsubscribe.component.mjs +0 -16
- package/esm2022/lib/directives/datasource.directive.mjs +0 -175
- package/esm2022/lib/directives/index.mjs +0 -5
- package/esm2022/lib/directives/shortcut.directive.mjs +0 -46
- package/esm2022/lib/directives/table-datasource.directive.mjs +0 -124
- package/esm2022/lib/directives/table-filter.directive.mjs +0 -56
- package/esm2022/lib/format/format.mjs +0 -63
- package/esm2022/lib/pipes/error/error.codes.mjs +0 -10
- package/esm2022/lib/pipes/error/error.models.mjs +0 -21
- package/esm2022/lib/pipes/error/error.pipe.mjs +0 -31
- package/esm2022/lib/pipes/error/warning.codes.mjs +0 -4
- package/esm2022/lib/pipes/error/warning.pipe.mjs +0 -31
- package/esm2022/lib/pipes/helper/enumToList.pipe.mjs +0 -22
- package/esm2022/lib/pipes/index.mjs +0 -8
- package/esm2022/lib/pipes/keyOrFn/keyOrFn.pipe.mjs +0 -31
- package/esm2022/lib/services/confirm-dialog.service.mjs +0 -45
- package/esm2022/lib/services/index.mjs +0 -5
- package/esm2022/lib/services/leave-form.service.mjs +0 -52
- package/esm2022/lib/services/screen-size.service.mjs +0 -29
- package/esm2022/lib/services/table.service.mjs +0 -27
- package/esm2022/verisoft-ui-core.mjs +0 -5
- package/fesm2022/verisoft-ui-core.mjs +0 -2014
- package/fesm2022/verisoft-ui-core.mjs.map +0 -1
- package/lib/common/angular-helper.d.ts +0 -1
- package/lib/common/constants.d.ts +0 -3
- package/lib/common/control.models.d.ts +0 -62
- package/lib/common/datasource-component.model.d.ts +0 -19
- package/lib/common/download-file.d.ts +0 -2
- package/lib/common/filter.d.ts +0 -1
- package/lib/common/rxjs.d.ts +0 -2
- package/lib/components/action-button-group/action-button-group.model.d.ts +0 -12
- package/lib/components/action-button-group/action-button.model.d.ts +0 -14
- package/lib/components/base-form/base-form-input.component.d.ts +0 -30
- package/lib/components/base-form/base-form.component.d.ts +0 -50
- package/lib/components/base-form/directives/detail-store.directive.d.ts +0 -35
- package/lib/components/base-form/models/base-form-input.models.d.ts +0 -7
- package/lib/components/base-form/models/base-form.models.d.ts +0 -18
- package/lib/components/breadcrumb/breadcrumb.service.d.ts +0 -8
- package/lib/components/breadcrumb/breadcrumbcore.component.d.ts +0 -30
- package/lib/components/breadcrumb/index.d.ts +0 -3
- package/lib/components/button/index.d.ts +0 -1
- package/lib/components/calendar/index.d.ts +0 -1
- package/lib/components/checkbox/checkbox.model.d.ts +0 -4
- package/lib/components/checkbox/index.d.ts +0 -1
- package/lib/components/confirm-dialog/confirm-dialog.model.d.ts +0 -25
- package/lib/components/confirm-dialog/index.d.ts +0 -1
- package/lib/components/dropdown/index.d.ts +0 -1
- package/lib/components/dynamic-component/dynamic-component.model.d.ts +0 -3
- package/lib/components/dynamic-component/index.d.ts +0 -1
- package/lib/components/filter/filter.model.d.ts +0 -13
- package/lib/components/form-field/index.d.ts +0 -1
- package/lib/components/generic-field/index.d.ts +0 -1
- package/lib/components/generic-form/generic-form.component.d.ts +0 -30
- package/lib/components/header/index.d.ts +0 -1
- package/lib/components/icons/icons.component.d.ts +0 -6
- package/lib/components/icons/icons.model.d.ts +0 -6
- package/lib/components/icons/index.d.ts +0 -2
- package/lib/components/input-group/index.d.ts +0 -1
- package/lib/components/loader/index.d.ts +0 -1
- package/lib/components/loader/loader.model.d.ts +0 -3
- package/lib/components/multiselect/index.d.ts +0 -1
- package/lib/components/number-input/index.d.ts +0 -1
- package/lib/components/page-header/page-header.service.d.ts +0 -8
- package/lib/components/page-header/page-headercore.component.d.ts +0 -20
- package/lib/components/password/index.d.ts +0 -1
- package/lib/components/radiobutton/index.d.ts +0 -1
- package/lib/components/section/index.d.ts +0 -1
- package/lib/components/side-menu/directives/side-menu-service.directive.d.ts +0 -11
- package/lib/components/side-menu/services/side-menu-provider.service.d.ts +0 -10
- package/lib/components/side-menu/services/side-menu.service.d.ts +0 -15
- package/lib/components/side-menu/side-menu.model.d.ts +0 -42
- package/lib/components/slider/index.d.ts +0 -1
- package/lib/components/snackbar/index.d.ts +0 -1
- package/lib/components/snackbar/snackbar.model.d.ts +0 -3
- package/lib/components/stepper/index.d.ts +0 -1
- package/lib/components/switch/index.d.ts +0 -1
- package/lib/components/switch/switch.model.d.ts +0 -4
- package/lib/components/tab-view/index.d.ts +0 -1
- package/lib/components/table/column-configuration.d.ts +0 -12
- package/lib/components/table/table-builder.d.ts +0 -15
- package/lib/components/table/table-column.directive.d.ts +0 -25
- package/lib/components/table/table.models.d.ts +0 -132
- package/lib/components/table-filter/index.d.ts +0 -1
- package/lib/components/textarea/index.d.ts +0 -1
- package/lib/components/textfield/index.d.ts +0 -1
- package/lib/components/tristatecheckbox/index.d.ts +0 -1
- package/lib/components/tristatecheckbox/tristatecheckbox.model.d.ts +0 -4
- package/lib/components/unsubscribe.component.d.ts +0 -9
- package/lib/directives/datasource.directive.d.ts +0 -32
- package/lib/directives/shortcut.directive.d.ts +0 -11
- package/lib/directives/table-datasource.directive.d.ts +0 -29
- package/lib/directives/table-filter.directive.d.ts +0 -17
- package/lib/format/format.d.ts +0 -9
- package/lib/pipes/error/error.codes.d.ts +0 -5
- package/lib/pipes/error/error.models.d.ts +0 -8
- package/lib/pipes/error/error.pipe.d.ts +0 -8
- package/lib/pipes/error/warning.codes.d.ts +0 -5
- package/lib/pipes/error/warning.pipe.d.ts +0 -8
- package/lib/pipes/helper/enumToList.pipe.d.ts +0 -7
- package/lib/pipes/keyOrFn/keyOrFn.pipe.d.ts +0 -7
- package/lib/services/confirm-dialog.service.d.ts +0 -12
- package/lib/services/leave-form.service.d.ts +0 -13
- package/lib/services/screen-size.service.d.ts +0 -10
- package/lib/services/table.service.d.ts +0 -13
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { DataSourceComponentModel } from '../../common';
|
|
3
|
-
import { BaseFormCore } from '../base-form';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { DataSourceComponentModel } from '../../common';
|
|
3
|
+
import { BaseFormCore } from '../base-form';
|
|
4
|
+
|
|
5
|
+
export const MULTISELECT_COMPONENT_TOKEN = new InjectionToken<MultiselectCore<any>>(
|
|
6
|
+
'MultiselectComponentToken'
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export interface MultiselectCore<T> extends DataSourceComponentModel<T>, BaseFormCore {
|
|
10
|
+
dropdownIcon?: string;
|
|
11
|
+
floatLabel?: string;
|
|
12
|
+
editable: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number-input.model';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { BaseFormCore } from '../base-form';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { BaseFormCore } from '../base-form';
|
|
3
|
+
|
|
4
|
+
export const NUMBER_INPUT_COMPONENT_TOKEN = new InjectionToken<NumberInputCore>(
|
|
5
|
+
'NumberInputComponentToken'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export interface NumberInputCore extends BaseFormCore {
|
|
9
|
+
mode: string;
|
|
10
|
+
currency: string;
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
step: number;
|
|
14
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './page-header.model';
|
|
2
|
-
export * from './page-header.service';
|
|
3
|
-
export * from './page-headercore.component';
|
|
1
|
+
export * from './page-header.model';
|
|
2
|
+
export * from './page-header.service';
|
|
3
|
+
export * from './page-headercore.component';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export const PAGE_HEADER_COMPONENT_TOKEN = new InjectionToken<PageHeaderCore>(
|
|
4
|
+
'PageHeaderComponentToken'
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
export interface PageHeaderCore {
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string | undefined;
|
|
10
|
+
showBackButton: boolean | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventEmitter, Injectable, Output } from '@angular/core';
|
|
2
|
+
import { PageHeaderCore } from './page-header.model';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
})
|
|
7
|
+
export class PageHeaderService {
|
|
8
|
+
@Output() pageHeader = new EventEmitter<PageHeaderCore>();
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Directive, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { takeUntil } from 'rxjs';
|
|
4
|
+
import { FieldSize, FieldSizeType } from '../../common';
|
|
5
|
+
import { UnsubscribeComponent } from '../unsubscribe.component';
|
|
6
|
+
import { PageHeaderService } from './page-header.service';
|
|
7
|
+
|
|
8
|
+
@Directive({})
|
|
9
|
+
export class PageHeaderCoreComponent
|
|
10
|
+
extends UnsubscribeComponent
|
|
11
|
+
implements OnInit
|
|
12
|
+
{
|
|
13
|
+
@Input() title!: string;
|
|
14
|
+
@Input() subtitle: string | undefined;
|
|
15
|
+
@Input() showBackButton!: boolean;
|
|
16
|
+
@Input() size: FieldSizeType = FieldSize.small;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
readonly router: Router,
|
|
20
|
+
readonly cdr: ChangeDetectorRef,
|
|
21
|
+
readonly headerService: PageHeaderService
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit(): void {
|
|
27
|
+
this.headerService.pageHeader
|
|
28
|
+
.pipe(takeUntil(this.destroyed$))
|
|
29
|
+
.subscribe((x: any) => {
|
|
30
|
+
this.title = x.title;
|
|
31
|
+
this.subtitle = x.subtitle;
|
|
32
|
+
this.showBackButton = x.showBackButton ?? false;
|
|
33
|
+
this.cdr.detectChanges();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected locationBack() {
|
|
38
|
+
history.back();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './password.model';
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { BaseFormCore } from '../base-form';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { BaseFormCore } from '../base-form';
|
|
3
|
+
|
|
4
|
+
export const PASSWORD_COMPONENT_TOKEN = new InjectionToken<PasswordCore>(
|
|
5
|
+
'PasswordComponentToken'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export enum PasswordStrength {
|
|
9
|
+
None = 0,
|
|
10
|
+
Low = 1,
|
|
11
|
+
Medium = 2,
|
|
12
|
+
High = 3,
|
|
13
|
+
Superb = 4
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface PasswordCore extends BaseFormCore {
|
|
17
|
+
toggleMask: boolean;
|
|
18
|
+
feedback: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PasswordValidationItem {
|
|
22
|
+
severity: 'success' | 'error';
|
|
23
|
+
validationLabel: string;
|
|
24
|
+
validationFn: (x: string) => boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './radiobutton.model';
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { BaseFormCore } from '../base-form';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { BaseFormCore } from '../base-form';
|
|
3
|
+
|
|
4
|
+
export const RADIOBUTTON_COMPONENT_TOKEN = new InjectionToken<RadiobuttonCore<any>>(
|
|
5
|
+
'RadiobuttonComponentToken'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export interface RadioButtonItem<T> {
|
|
9
|
+
id: string;
|
|
10
|
+
value: T;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RadiobuttonCore<T> extends BaseFormCore {
|
|
14
|
+
radioGroupName: string;
|
|
15
|
+
items: RadioButtonItem<T>[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './section.model';
|
package/{lib/components/section/section.model.d.ts → src/lib/components/section/section.model.ts}
RENAMED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export const SECTION_COMPONENT_TOKEN = new InjectionToken<SectionCore>(
|
|
4
|
+
'SectionComponentToken'
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
export interface SectionCore {
|
|
8
|
+
title: string;
|
|
9
|
+
showContent: boolean;
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, Directive, inject } from "@angular/core";
|
|
2
|
+
import { takeUntil } from "rxjs";
|
|
3
|
+
import { UnsubscribeComponent } from "../../unsubscribe.component";
|
|
4
|
+
import { SideMenuService } from "../services/side-menu.service";
|
|
5
|
+
import { SIDE_MENU_COMPONENT_TOKEN } from "../side-menu.model";
|
|
6
|
+
|
|
7
|
+
@Directive({
|
|
8
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
9
|
+
selector: 'v-side-menu[useMenuService]',
|
|
10
|
+
exportAs: 'useMenuService',
|
|
11
|
+
standalone: true,
|
|
12
|
+
})
|
|
13
|
+
export class MenuServiceDirective
|
|
14
|
+
extends UnsubscribeComponent
|
|
15
|
+
implements AfterViewInit
|
|
16
|
+
{
|
|
17
|
+
private readonly menuService = inject(SideMenuService);
|
|
18
|
+
private readonly cdr = inject(ChangeDetectorRef);
|
|
19
|
+
private readonly sideMenu = inject(SIDE_MENU_COMPONENT_TOKEN);
|
|
20
|
+
|
|
21
|
+
ngAfterViewInit() {
|
|
22
|
+
this.menuService.menuItems$.pipe(takeUntil(this.destroyed$)).subscribe((items) => {
|
|
23
|
+
|
|
24
|
+
if (this.sideMenu) {
|
|
25
|
+
this.sideMenu.items = items;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
this.cdr.detectChanges();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './side-menu.model';
|
|
2
|
-
export * from './services/side-menu-provider.service';
|
|
3
|
-
export * from './services/side-menu.service';
|
|
4
|
-
export * from './directives/side-menu-service.directive';
|
|
1
|
+
export * from './side-menu.model';
|
|
2
|
+
export * from './services/side-menu-provider.service';
|
|
3
|
+
export * from './services/side-menu.service';
|
|
4
|
+
export * from './directives/side-menu-service.directive';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injectable, Optional, Inject } from '@angular/core';
|
|
2
|
+
import { MENU_TOKEN, MenuItem } from '../side-menu.model';
|
|
3
|
+
import { SideMenuService } from './side-menu.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class SideMenuProviderService {
|
|
7
|
+
constructor(
|
|
8
|
+
@Optional() @Inject(MENU_TOKEN) readonly menu: MenuItem[] = [],
|
|
9
|
+
readonly menuService: SideMenuService
|
|
10
|
+
) {
|
|
11
|
+
menuService.setMenu(menu);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { MenuItem, SIDE_MENU_STATE_TOKEN } from '../side-menu.model';
|
|
4
|
+
|
|
5
|
+
@Injectable({ providedIn: 'root' })
|
|
6
|
+
export class SideMenuService {
|
|
7
|
+
private _menuItems = new BehaviorSubject<MenuItem[]>([]);
|
|
8
|
+
private stateToken = inject(SIDE_MENU_STATE_TOKEN);
|
|
9
|
+
|
|
10
|
+
menuItems$: Observable<MenuItem[]> = this._menuItems.asObservable();
|
|
11
|
+
menuMinimalized = false;
|
|
12
|
+
|
|
13
|
+
setMenu(items: MenuItem[]): void {
|
|
14
|
+
this.resetSidemenuState(items);
|
|
15
|
+
this._menuItems.next(items);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
saveMinimalizedState(minimalized: boolean): void {
|
|
19
|
+
this.stateToken.minimalized = minimalized;
|
|
20
|
+
localStorage.setItem('SideMenuStateToken', JSON.stringify(this.stateToken));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
saveExpandedState(item: MenuItem): void {
|
|
24
|
+
const expanded = this.stateToken.expanded?.find(
|
|
25
|
+
(i: string) => i === item.label
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (!expanded) {
|
|
29
|
+
this.stateToken.expanded?.push(item.label!);
|
|
30
|
+
localStorage.setItem(
|
|
31
|
+
'SideMenuStateToken',
|
|
32
|
+
JSON.stringify(this.stateToken)
|
|
33
|
+
);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this.stateToken.expanded = this.stateToken.expanded?.filter(
|
|
38
|
+
(i: string) => i !== item.label
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
localStorage.setItem('SideMenuStateToken', JSON.stringify(this.stateToken));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private resetSidemenuState(items: MenuItem[]) {
|
|
45
|
+
if (typeof this.stateToken === 'string') {
|
|
46
|
+
this.stateToken = JSON.parse(this.stateToken);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.menuMinimalized = this.stateToken.minimalized;
|
|
50
|
+
const localStorageValue = this.stateToken.expanded;
|
|
51
|
+
|
|
52
|
+
if (!localStorageValue) return;
|
|
53
|
+
if (items) {
|
|
54
|
+
for (let index = 0; index < items.length; index++) {
|
|
55
|
+
const element = items[index];
|
|
56
|
+
element.expanded = !!localStorageValue.find(
|
|
57
|
+
(i: string) => i === element.label
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
export const MENU_TOKEN = new InjectionToken<MenuItem[]>(
|
|
5
|
+
'MENU'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const LOGO_ROUTER_ROUTE = new InjectionToken<string>(
|
|
9
|
+
'LOGO_ROUTER_ROUTE'
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export const SIDE_MENU_COMPONENT_TOKEN = new InjectionToken<SideMenuCore>(
|
|
13
|
+
'SideMenuComponentToken'
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const SIDE_MENU_STATE_TOKEN = new InjectionToken<SideMenuState>(
|
|
17
|
+
'SideMenuStateToken'
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export interface SideMenuState {
|
|
21
|
+
expanded: string[];
|
|
22
|
+
minimalized: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface MenuItem {
|
|
26
|
+
id?: string;
|
|
27
|
+
label?: string | undefined;
|
|
28
|
+
icon?: string;
|
|
29
|
+
expanded?: boolean;
|
|
30
|
+
data?: MenuItemData;
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
url?: string;
|
|
33
|
+
visible?: boolean | Observable<boolean>;
|
|
34
|
+
type?: string;
|
|
35
|
+
children?: MenuItem[];
|
|
36
|
+
routerLink?: any;
|
|
37
|
+
class?: string;
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
39
|
+
command?: Function;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type ExtendableType = {
|
|
43
|
+
[key: string]:
|
|
44
|
+
| string
|
|
45
|
+
| number
|
|
46
|
+
| boolean
|
|
47
|
+
| string[]
|
|
48
|
+
| number[]
|
|
49
|
+
| boolean[]
|
|
50
|
+
| undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface MenuItemData extends ExtendableType {
|
|
54
|
+
roles?: string[];
|
|
55
|
+
permissions?: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SideMenuModuleConfig {
|
|
59
|
+
items?: MenuItem[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SideMenuCore {
|
|
63
|
+
items: MenuItem[];
|
|
64
|
+
logoUrl: string;
|
|
65
|
+
userName: string;
|
|
66
|
+
userRole: any | any[] | undefined;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './slider.model';
|
package/{lib/components/slider/slider.model.d.ts → src/lib/components/slider/slider.model.ts}
RENAMED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { BaseFormCore } from '../base-form';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { BaseFormCore } from '../base-form';
|
|
3
|
+
|
|
4
|
+
export const SLIDER_COMPONENT_TOKEN = new InjectionToken<SliderCore>(
|
|
5
|
+
'SliderComponentToken'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export interface SliderCore extends BaseFormCore {
|
|
9
|
+
step: number;
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
range: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './snackbar.model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stepper.model';
|
package/{lib/components/stepper/stepper.model.d.ts → src/lib/components/stepper/stepper.model.ts}
RENAMED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { EventEmitter, InjectionToken, TemplateRef } from "@angular/core";
|
|
2
|
-
import { FieldSizeType, LayoutTypeType } from "../../common";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { EventEmitter, InjectionToken, TemplateRef } from "@angular/core";
|
|
2
|
+
import { FieldSizeType, LayoutTypeType } from "../../common";
|
|
3
|
+
|
|
4
|
+
export const STEPPER_COMPONENT_TOKEN = new InjectionToken<StepperCore>(
|
|
5
|
+
'StepperComponentToken'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export interface StepperItem {
|
|
9
|
+
header: string;
|
|
10
|
+
template?: TemplateRef<any>;
|
|
11
|
+
annotation?: string;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface StepperCore {
|
|
16
|
+
items: StepperItem[]
|
|
17
|
+
layout: LayoutTypeType
|
|
18
|
+
activeIndexChange: EventEmitter<number>
|
|
19
|
+
size: FieldSizeType | undefined;
|
|
20
|
+
icon: string;
|
|
21
|
+
prefix: string;
|
|
22
|
+
annotation: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './switch.model'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tab-view.model'
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { EventEmitter, InjectionToken, TemplateRef } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { EventEmitter, InjectionToken, TemplateRef } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
export const TAB_VIEW_COMPONENT_TOKEN = new InjectionToken<TabViewCore>(
|
|
4
|
+
'TabVIewComponentToken'
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
export interface TabViewItemCore {
|
|
8
|
+
title: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
content?: string;
|
|
13
|
+
contentTemplate?: TemplateRef<unknown>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface TabViewCore {
|
|
17
|
+
items: TabViewItemCore[];
|
|
18
|
+
useRouting: boolean;
|
|
19
|
+
activeIndex: number;
|
|
20
|
+
activeIndexChange: EventEmitter<number>;
|
|
21
|
+
url?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ColumnDefinition } from "./table.models";
|
|
2
|
+
|
|
3
|
+
export class ColumnConfiguration<TEntity> {
|
|
4
|
+
private column: Partial<ColumnDefinition<TEntity>> = {};
|
|
5
|
+
|
|
6
|
+
constructor(private id: string | keyof TEntity) {
|
|
7
|
+
this.column.id = id as string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
headerName(headerName: string | ((columnId: string, index?: number) => string)): this {
|
|
11
|
+
this.column.headerName = headerName;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
sortable(sortable: boolean): this {
|
|
16
|
+
this.column.sortable = sortable;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
columnClass(columnClass: string): this {
|
|
21
|
+
this.column.columnClass = columnClass;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
valueFunction(value: (row: TEntity, index?: number) => string): this {
|
|
26
|
+
this.column.value = value;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type(type: string): this {
|
|
31
|
+
this.column.type = type;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
build(): ColumnDefinition<TEntity> {
|
|
36
|
+
return this.column as ColumnDefinition<TEntity>;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './table.models';
|
|
2
|
-
export * from './table-column.directive';
|
|
3
|
-
export * from './table-builder';
|
|
4
|
-
export * from './column-configuration';
|
|
1
|
+
export * from './table.models';
|
|
2
|
+
export * from './table-column.directive';
|
|
3
|
+
export * from './table-builder';
|
|
4
|
+
export * from './column-configuration';
|