ngx-register-base 1.2.3 → 1.3.1
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/ng-package.json +15 -0
- package/package.json +12 -15
- package/schematics/ng-update/replace-menu-state-token/index.ts +33 -0
- package/schematics/ng-update/update-prefix/index.ts +38 -0
- package/schematics/utils/{utils.d.ts → utils.ts} +9 -2
- package/src/lib/components/checkbox-selector/checkbox-selector.component.html +91 -0
- package/src/lib/components/checkbox-selector/checkbox-selector.component.less +67 -0
- package/src/lib/components/checkbox-selector/checkbox-selector.component.ts +176 -0
- package/src/lib/components/checkbox-selector/checkbox-selector.types.ts +8 -0
- package/src/lib/components/column-settings/column-settings.component.html +160 -0
- package/src/lib/components/column-settings/column-settings.component.less +131 -0
- package/src/lib/components/column-settings/column-settings.component.ts +352 -0
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.html +65 -0
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.less +79 -0
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.ts +114 -0
- package/src/lib/components/column-settings/consts/column-settings.consts.ts +9 -0
- package/src/lib/components/column-settings/types/column-settings.types.ts +26 -0
- package/src/lib/components/divider/divider.component.html +4 -0
- package/src/lib/components/divider/divider.component.less +10 -0
- package/src/lib/components/divider/divider.component.ts +12 -0
- package/src/lib/components/filter-button/filter-button.component.html +20 -0
- package/src/lib/components/filter-button/filter-button.component.less +41 -0
- package/src/lib/components/filter-button/filter-button.component.ts +18 -0
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.html +22 -0
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.less +23 -0
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.ts +31 -0
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.html +49 -0
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.less +37 -0
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.ts +66 -0
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.html +147 -0
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.less +45 -0
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.ts +114 -0
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.html +44 -0
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.less +49 -0
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.ts +167 -0
- package/src/lib/components/filters/components/filter-list/filter-list.service.ts +97 -0
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.html +18 -0
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.less +55 -0
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.ts +69 -0
- package/src/lib/components/filters/components/filter-list.module.ts +29 -0
- package/src/lib/components/filters/register-table-filter.component.html +53 -0
- package/src/lib/components/filters/register-table-filter.component.less +17 -0
- package/src/lib/components/filters/register-table-filter.component.ts +167 -0
- package/src/lib/components/filters/register-table-filter.module.ts +22 -0
- package/src/lib/components/inputs/inputs.module.ts +104 -0
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.html +49 -0
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.less +70 -0
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.ts +52 -0
- package/src/lib/components/inputs/param-custom/param-custom.component.html +1 -0
- package/src/lib/components/inputs/param-custom/param-custom.component.ts +9 -0
- package/src/lib/components/inputs/param-date/param-date.component.html +55 -0
- package/src/lib/components/inputs/param-date/param-date.component.less +67 -0
- package/src/lib/components/inputs/param-date/param-date.component.ts +77 -0
- package/src/lib/components/inputs/param-date-range/param-date-range.component.html +45 -0
- package/src/lib/components/inputs/param-date-range/param-date-range.component.less +75 -0
- package/src/lib/components/inputs/param-date-range/param-date-range.component.ts +67 -0
- package/src/lib/components/inputs/param-date-time/param-date-time.component.html +70 -0
- package/src/lib/components/inputs/param-date-time/param-date-time.component.less +72 -0
- package/src/lib/components/inputs/param-date-time/param-date-time.component.ts +101 -0
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.html +67 -0
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.less +103 -0
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.ts +128 -0
- package/src/lib/components/inputs/param-month/param-month.component.html +46 -0
- package/src/lib/components/inputs/param-month/param-month.component.less +72 -0
- package/src/lib/components/inputs/param-month/param-month.component.ts +55 -0
- package/src/lib/components/inputs/param-month-range/param-month-range.component.html +39 -0
- package/src/lib/components/inputs/param-month-range/param-month-range.component.less +71 -0
- package/src/lib/components/inputs/param-month-range/param-month-range.component.ts +76 -0
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.html +84 -0
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.less +108 -0
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.ts +448 -0
- package/src/lib/components/inputs/param-select/param-select.component.html +106 -0
- package/src/lib/components/inputs/param-select/param-select.component.less +26 -0
- package/src/lib/components/inputs/param-select/param-select.component.ts +318 -0
- package/src/lib/components/inputs/param-switcher/param-switcher.component.html +8 -0
- package/src/lib/components/inputs/param-switcher/param-switcher.component.less +53 -0
- package/src/lib/components/inputs/param-switcher/param-switcher.component.ts +13 -0
- package/src/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.ts +29 -0
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.html +19 -0
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.less +76 -0
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.ts +134 -0
- package/src/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.ts +8 -0
- package/src/lib/components/inputs/param-text/param-text.component.html +59 -0
- package/src/lib/components/inputs/param-text/param-text.component.less +33 -0
- package/src/lib/components/inputs/param-text/param-text.component.ts +36 -0
- package/src/lib/components/inputs/param-textarea/param-textarea.component.html +61 -0
- package/src/lib/components/inputs/param-textarea/param-textarea.component.less +21 -0
- package/src/lib/components/inputs/param-textarea/param-textarea.component.ts +33 -0
- package/src/lib/components/inputs/param-toggle/param-toggle.component.html +40 -0
- package/src/lib/components/inputs/param-toggle/param-toggle.component.less +69 -0
- package/src/lib/components/inputs/param-toggle/param-toggle.component.ts +14 -0
- package/src/lib/components/inputs/param-tree/consts/param-tree.consts.ts +59 -0
- package/src/lib/components/inputs/param-tree/param-tree.component.html +51 -0
- package/src/lib/components/inputs/param-tree/param-tree.component.less +3 -0
- package/src/lib/components/inputs/param-tree/param-tree.component.ts +282 -0
- package/src/lib/components/inputs/param-tree/services/param-tree.service.ts +176 -0
- package/src/lib/components/inputs/param-tree/services/sync-tree-loader.service.ts +18 -0
- package/{lib/components/inputs/param-tree/tokens/param-tree.tokens.d.ts → src/lib/components/inputs/param-tree/tokens/param-tree.tokens.ts} +2 -1
- package/src/lib/components/inputs/param-tree/types/param-tree.types.ts +39 -0
- package/src/lib/components/inputs/param-tree/utils/param-tree.utils.ts +18 -0
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.html +78 -0
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.less +109 -0
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.ts +89 -0
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.html +54 -0
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.less +56 -0
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.ts +91 -0
- package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.html +5 -0
- package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.ts +13 -0
- package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.html +4 -0
- package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.ts +11 -0
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.html +95 -0
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.less +183 -0
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.ts +687 -0
- package/src/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.ts +32 -0
- package/src/lib/components/menu-constructor/store/sproc-menu-constructor.consts.ts +46 -0
- package/{lib/components/menu-constructor/store/sproc-menu.tokens.d.ts → src/lib/components/menu-constructor/store/sproc-menu.tokens.ts} +4 -1
- package/src/lib/components/page-menu/README.md +60 -0
- package/src/lib/components/page-menu/schema/sproc-page-menu.consts.ts +8 -0
- package/src/lib/components/page-menu/schema/sproc-page-menu.schema.ts +35 -0
- package/src/lib/components/page-menu/schema/sproc-page-menu.tokens.ts +5 -0
- package/src/lib/components/page-menu/schema/sproc-page-menu.types.ts +42 -0
- package/src/lib/components/page-menu/sproc-page-menu.component.html +166 -0
- package/src/lib/components/page-menu/sproc-page-menu.component.less +228 -0
- package/src/lib/components/page-menu/sproc-page-menu.component.ts +337 -0
- package/src/lib/components/paginator/paginator.component.html +97 -0
- package/src/lib/components/paginator/paginator.component.less +101 -0
- package/src/lib/components/paginator/paginator.component.ts +192 -0
- package/src/lib/components/paginator/types/paginator.types.ts +16 -0
- package/src/lib/components/register-table/consts/register-table.consts.ts +3 -0
- package/src/lib/components/register-table/directives/cell-template.directive.ts +11 -0
- package/src/lib/components/register-table/directives/header-template.directive.ts +11 -0
- package/src/lib/components/register-table/model/schema.ts +62 -0
- package/src/lib/components/register-table/pipes/class-by-type.pipe.ts +28 -0
- package/src/lib/components/register-table/pipes/sticky-column.pipe.ts +11 -0
- package/src/lib/components/register-table/register-table.component.html +257 -0
- package/src/lib/components/register-table/register-table.component.less +151 -0
- package/src/lib/components/register-table/register-table.component.ts +743 -0
- package/src/lib/components/reset-settings-form/reset-settings-form.component.html +14 -0
- package/src/lib/components/reset-settings-form/reset-settings-form.component.less +26 -0
- package/src/lib/components/reset-settings-form/reset-settings-form.component.ts +15 -0
- package/src/lib/components/search-input/search-input.component.html +6 -0
- package/src/lib/components/search-input/search-input.component.less +17 -0
- package/src/lib/components/search-input/search-input.component.ts +31 -0
- package/src/lib/components/sliding-panel/sliding-panel.component.html +13 -0
- package/src/lib/components/sliding-panel/sliding-panel.component.less +112 -0
- package/src/lib/components/sliding-panel/sliding-panel.component.ts +36 -0
- package/src/lib/components/sliding-panel/sliding-panel.module.ts +11 -0
- package/src/lib/consts/date-time.consts.ts +1 -0
- package/src/lib/consts/index.ts +8 -0
- package/src/lib/consts/inputs.consts.ts +9 -0
- package/src/lib/consts/month.consts.ts +82 -0
- package/src/lib/consts/params.consts.ts +1 -0
- package/src/lib/consts/register-base.consts.ts +40 -0
- package/src/lib/core/form-group-wrapper/errors-consts.ts +6 -0
- package/src/lib/core/form-group-wrapper/form-group-wrapper.ts +109 -0
- package/src/lib/core/input-control/input-control.ts +30 -0
- package/src/lib/core/param/param-base.ts +262 -0
- package/src/lib/core/param/param-date-base.ts +30 -0
- package/src/lib/core/param/param-select-base.ts +118 -0
- package/src/lib/core/param/param-text-base.ts +23 -0
- package/{lib/core/param/param.tokens.d.ts → src/lib/core/param/param.tokens.ts} +2 -1
- package/src/lib/core/register-base/register-base.store.ts +84 -0
- package/src/lib/core/register-base/register-base.ts +854 -0
- package/src/lib/directives/date/date-time.types.ts +36 -0
- package/src/lib/directives/date/format-date.pipe.ts +28 -0
- package/src/lib/directives/number/number-only.directive.ts +36 -0
- package/src/lib/directives/sticky/sticky-relative.directive.ts +30 -0
- package/src/lib/directives/sticky/sticky-relative.service.ts +34 -0
- package/src/lib/directives/sticky/sticky.directive.ts +189 -0
- package/src/lib/services/date-time.service.ts +399 -0
- package/src/lib/services/dialog/dialog.service.ts +62 -0
- package/{lib/services/dialog/dialog.types.d.ts → src/lib/services/dialog/dialog.types.ts} +8 -4
- package/src/lib/services/dom-intersection.service.ts +23 -0
- package/src/lib/services/filter/filters-state.service.ts +83 -0
- package/src/lib/services/filter/filters-transmit.service.ts +105 -0
- package/src/lib/services/filter/filters.service.ts +21 -0
- package/src/lib/services/inputs-state.service.ts +157 -0
- package/src/lib/services/inputs.service.ts +114 -0
- package/src/lib/services/key-pressed.service.ts +40 -0
- package/src/lib/services/resize-window-observer.service.ts +37 -0
- package/src/lib/services/selected-objects-state.service.ts +159 -0
- package/src/lib/store/fast-query-store.service.ts +132 -0
- package/{lib/types/event.types.d.ts → src/lib/types/event.types.ts} +1 -1
- package/src/lib/types/hasura.types.ts +41 -0
- package/src/lib/types/inputs.types.ts +63 -0
- package/src/lib/types/params.types.ts +42 -0
- package/src/lib/types/register-base.types.ts +161 -0
- package/src/lib/types/sub-types.ts +15 -0
- package/src/lib/types/user-profile.types.ts +18 -0
- package/src/lib/utils/functions.ts +11 -0
- package/src/lib/utils/get-url-segment.ts +46 -0
- package/src/lib/utils/prizm.shared.module.ts +176 -0
- package/src/lib/utils/rxjs.ts +33 -0
- package/src/lib/utils/select-all-utils.ts +16 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.schematics.json +26 -0
- package/tsconfig.spec.json +15 -0
- package/esm2022/lib/components/checkbox-selector/checkbox-selector.component.mjs +0 -129
- package/esm2022/lib/components/checkbox-selector/checkbox-selector.types.mjs +0 -8
- package/esm2022/lib/components/column-settings/column-settings.component.mjs +0 -249
- package/esm2022/lib/components/column-settings/components/column-settings-template/column-settings-template.component.mjs +0 -80
- package/esm2022/lib/components/column-settings/consts/column-settings.consts.mjs +0 -10
- package/esm2022/lib/components/column-settings/index.mjs +0 -3
- package/esm2022/lib/components/column-settings/types/column-settings.types.mjs +0 -7
- package/esm2022/lib/components/divider/divider.component.mjs +0 -16
- package/esm2022/lib/components/filter-button/filter-button.component.mjs +0 -19
- package/esm2022/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.mjs +0 -31
- package/esm2022/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.mjs +0 -57
- package/esm2022/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.mjs +0 -110
- package/esm2022/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.mjs +0 -130
- package/esm2022/lib/components/filters/components/filter-list/filter-list.service.mjs +0 -89
- package/esm2022/lib/components/filters/components/filter-list/filters-section/filters-section.component.mjs +0 -41
- package/esm2022/lib/components/filters/components/filter-list.module.mjs +0 -45
- package/esm2022/lib/components/filters/index.mjs +0 -3
- package/esm2022/lib/components/filters/register-table-filter.component.mjs +0 -155
- package/esm2022/lib/components/filters/register-table-filter.module.mjs +0 -39
- package/esm2022/lib/components/index.mjs +0 -11
- package/esm2022/lib/components/inputs/index.mjs +0 -20
- package/esm2022/lib/components/inputs/inputs.module.mjs +0 -166
- package/esm2022/lib/components/inputs/param-calendar-year/param-calendar-year.component.mjs +0 -45
- package/esm2022/lib/components/inputs/param-custom/param-custom.component.mjs +0 -12
- package/esm2022/lib/components/inputs/param-date/param-date.component.mjs +0 -76
- package/esm2022/lib/components/inputs/param-date-range/param-date-range.component.mjs +0 -61
- package/esm2022/lib/components/inputs/param-date-time/param-date-time.component.mjs +0 -86
- package/esm2022/lib/components/inputs/param-date-time-range/param-date-time-range.component.mjs +0 -96
- package/esm2022/lib/components/inputs/param-month/param-month.component.mjs +0 -50
- package/esm2022/lib/components/inputs/param-month-range/param-month-range.component.mjs +0 -62
- package/esm2022/lib/components/inputs/param-multi-select/param-multi-select.component.mjs +0 -309
- package/esm2022/lib/components/inputs/param-select/param-select.component.mjs +0 -209
- package/esm2022/lib/components/inputs/param-switcher/param-switcher.component.mjs +0 -21
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.mjs +0 -28
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/index.mjs +0 -3
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.mjs +0 -105
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.mjs +0 -10
- package/esm2022/lib/components/inputs/param-text/param-text.component.mjs +0 -40
- package/esm2022/lib/components/inputs/param-textarea/param-textarea.component.mjs +0 -38
- package/esm2022/lib/components/inputs/param-toggle/param-toggle.component.mjs +0 -20
- package/esm2022/lib/components/inputs/param-tree/consts/param-tree.consts.mjs +0 -37
- package/esm2022/lib/components/inputs/param-tree/index.mjs +0 -8
- package/esm2022/lib/components/inputs/param-tree/param-tree.component.mjs +0 -207
- package/esm2022/lib/components/inputs/param-tree/services/param-tree.service.mjs +0 -116
- package/esm2022/lib/components/inputs/param-tree/services/sync-tree-loader.service.mjs +0 -20
- package/esm2022/lib/components/inputs/param-tree/tokens/param-tree.tokens.mjs +0 -3
- package/esm2022/lib/components/inputs/param-tree/types/param-tree.types.mjs +0 -2
- package/esm2022/lib/components/inputs/param-tree/utils/param-tree.utils.mjs +0 -9
- package/esm2022/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.mjs +0 -80
- package/esm2022/lib/components/inputs/param-tree-select/param-tree-select.component.mjs +0 -85
- package/esm2022/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.mjs +0 -15
- package/esm2022/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.mjs +0 -12
- package/esm2022/lib/components/menu-constructor/index.mjs +0 -5
- package/esm2022/lib/components/menu-constructor/sproc-menu-constructor.component.mjs +0 -559
- package/esm2022/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.mjs +0 -3
- package/esm2022/lib/components/menu-constructor/store/sproc-menu-constructor.consts.mjs +0 -5
- package/esm2022/lib/components/menu-constructor/store/sproc-menu.tokens.mjs +0 -3
- package/esm2022/lib/components/page-menu/index.mjs +0 -6
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.consts.mjs +0 -9
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.schema.mjs +0 -2
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.tokens.mjs +0 -4
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.types.mjs +0 -3
- package/esm2022/lib/components/page-menu/sproc-page-menu.component.mjs +0 -275
- package/esm2022/lib/components/paginator/paginator.component.mjs +0 -159
- package/esm2022/lib/components/paginator/types/paginator.types.mjs +0 -2
- package/esm2022/lib/components/register-table/consts/register-table.consts.mjs +0 -4
- package/esm2022/lib/components/register-table/directives/cell-template.directive.mjs +0 -19
- package/esm2022/lib/components/register-table/directives/header-template.directive.mjs +0 -18
- package/esm2022/lib/components/register-table/index.mjs +0 -4
- package/esm2022/lib/components/register-table/model/schema.mjs +0 -10
- package/esm2022/lib/components/register-table/pipes/class-by-type.pipe.mjs +0 -33
- package/esm2022/lib/components/register-table/pipes/sticky-column.pipe.mjs +0 -17
- package/esm2022/lib/components/register-table/register-table.component.mjs +0 -544
- package/esm2022/lib/components/reset-settings-form/reset-settings-form.component.mjs +0 -18
- package/esm2022/lib/components/search-input/search-input.component.mjs +0 -28
- package/esm2022/lib/components/sliding-panel/sliding-panel.component.mjs +0 -48
- package/esm2022/lib/components/sliding-panel/sliding-panel.module.mjs +0 -19
- package/esm2022/lib/consts/date-time.consts.mjs +0 -2
- package/esm2022/lib/consts/index.mjs +0 -4
- package/esm2022/lib/consts/inputs.consts.mjs +0 -4
- package/esm2022/lib/consts/month.consts.mjs +0 -77
- package/esm2022/lib/consts/params.consts.mjs +0 -2
- package/esm2022/lib/consts/register-base.consts.mjs +0 -26
- package/esm2022/lib/core/form-group-wrapper/errors-consts.mjs +0 -8
- package/esm2022/lib/core/form-group-wrapper/form-group-wrapper.mjs +0 -81
- package/esm2022/lib/core/form-group-wrapper/index.mjs +0 -2
- package/esm2022/lib/core/index.mjs +0 -5
- package/esm2022/lib/core/input-control/index.mjs +0 -2
- package/esm2022/lib/core/input-control/input-control.mjs +0 -11
- package/esm2022/lib/core/param/index.mjs +0 -6
- package/esm2022/lib/core/param/param-base.mjs +0 -215
- package/esm2022/lib/core/param/param-date-base.mjs +0 -26
- package/esm2022/lib/core/param/param-select-base.mjs +0 -114
- package/esm2022/lib/core/param/param-text-base.mjs +0 -25
- package/esm2022/lib/core/param/param.tokens.mjs +0 -4
- package/esm2022/lib/core/register-base/index.mjs +0 -3
- package/esm2022/lib/core/register-base/register-base.mjs +0 -575
- package/esm2022/lib/core/register-base/register-base.store.mjs +0 -43
- package/esm2022/lib/directives/date/date-time.types.mjs +0 -34
- package/esm2022/lib/directives/date/format-date.pipe.mjs +0 -33
- package/esm2022/lib/directives/index.mjs +0 -3
- package/esm2022/lib/directives/number/number-only.directive.mjs +0 -41
- package/esm2022/lib/directives/sticky/index.mjs +0 -3
- package/esm2022/lib/directives/sticky/sticky-relative.directive.mjs +0 -32
- package/esm2022/lib/directives/sticky/sticky-relative.service.mjs +0 -32
- package/esm2022/lib/directives/sticky/sticky.directive.mjs +0 -169
- package/esm2022/lib/services/date-time.service.mjs +0 -314
- package/esm2022/lib/services/dialog/dialog.service.mjs +0 -53
- package/esm2022/lib/services/dialog/dialog.types.mjs +0 -2
- package/esm2022/lib/services/dialog/index.mjs +0 -3
- package/esm2022/lib/services/dom-intersection.service.mjs +0 -22
- package/esm2022/lib/services/filter/filters-state.service.mjs +0 -65
- package/esm2022/lib/services/filter/filters-transmit.service.mjs +0 -82
- package/esm2022/lib/services/filter/filters.service.mjs +0 -23
- package/esm2022/lib/services/index.mjs +0 -8
- package/esm2022/lib/services/inputs-state.service.mjs +0 -130
- package/esm2022/lib/services/inputs.service.mjs +0 -88
- package/esm2022/lib/services/key-pressed.service.mjs +0 -37
- package/esm2022/lib/services/resize-window-observer.service.mjs +0 -33
- package/esm2022/lib/services/selected-objects-state.service.mjs +0 -123
- package/esm2022/lib/store/fast-query-store.service.mjs +0 -110
- package/esm2022/lib/store/index.mjs +0 -2
- package/esm2022/lib/types/event.types.mjs +0 -2
- package/esm2022/lib/types/hasura.types.mjs +0 -2
- package/esm2022/lib/types/index.mjs +0 -7
- package/esm2022/lib/types/inputs.types.mjs +0 -19
- package/esm2022/lib/types/params.types.mjs +0 -2
- package/esm2022/lib/types/register-base.types.mjs +0 -6
- package/esm2022/lib/types/sub-types.mjs +0 -2
- package/esm2022/lib/types/user-profile.types.mjs +0 -2
- package/esm2022/lib/utils/functions.mjs +0 -10
- package/esm2022/lib/utils/get-url-segment.mjs +0 -35
- package/esm2022/lib/utils/index.mjs +0 -5
- package/esm2022/lib/utils/prizm.shared.module.mjs +0 -284
- package/esm2022/lib/utils/rxjs.mjs +0 -28
- package/esm2022/lib/utils/select-all-utils.mjs +0 -11
- package/esm2022/ngx-register-base.mjs +0 -5
- package/esm2022/public-api.mjs +0 -9
- package/fesm2022/ngx-register-base.mjs +0 -7465
- package/fesm2022/ngx-register-base.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/checkbox-selector/checkbox-selector.component.d.ts +0 -33
- package/lib/components/checkbox-selector/checkbox-selector.types.d.ts +0 -7
- package/lib/components/column-settings/column-settings.component.d.ts +0 -80
- package/lib/components/column-settings/components/column-settings-template/column-settings-template.component.d.ts +0 -24
- package/lib/components/column-settings/consts/column-settings.consts.d.ts +0 -8
- package/lib/components/column-settings/types/column-settings.types.d.ts +0 -22
- package/lib/components/divider/divider.component.d.ts +0 -6
- package/lib/components/filter-button/filter-button.component.d.ts +0 -8
- package/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.d.ts +0 -14
- package/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.d.ts +0 -25
- package/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.d.ts +0 -39
- package/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.d.ts +0 -41
- package/lib/components/filters/components/filter-list/filter-list.service.d.ts +0 -20
- package/lib/components/filters/components/filter-list/filters-section/filters-section.component.d.ts +0 -15
- package/lib/components/filters/components/filter-list.module.d.ts +0 -15
- package/lib/components/filters/register-table-filter.component.d.ts +0 -40
- package/lib/components/filters/register-table-filter.module.d.ts +0 -13
- package/lib/components/inputs/inputs.module.d.ts +0 -31
- package/lib/components/inputs/param-calendar-year/param-calendar-year.component.d.ts +0 -19
- package/lib/components/inputs/param-custom/param-custom.component.d.ts +0 -6
- package/lib/components/inputs/param-date/param-date.component.d.ts +0 -20
- package/lib/components/inputs/param-date-range/param-date-range.component.d.ts +0 -26
- package/lib/components/inputs/param-date-time/param-date-time.component.d.ts +0 -25
- package/lib/components/inputs/param-date-time-range/param-date-time-range.component.d.ts +0 -28
- package/lib/components/inputs/param-month/param-month.component.d.ts +0 -18
- package/lib/components/inputs/param-month-range/param-month-range.component.d.ts +0 -21
- package/lib/components/inputs/param-multi-select/param-multi-select.component.d.ts +0 -46
- package/lib/components/inputs/param-select/param-select.component.d.ts +0 -30
- package/lib/components/inputs/param-switcher/param-switcher.component.d.ts +0 -8
- package/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.d.ts +0 -2
- package/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.d.ts +0 -19
- package/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.d.ts +0 -8
- package/lib/components/inputs/param-text/param-text.component.d.ts +0 -10
- package/lib/components/inputs/param-textarea/param-textarea.component.d.ts +0 -10
- package/lib/components/inputs/param-toggle/param-toggle.component.d.ts +0 -9
- package/lib/components/inputs/param-tree/consts/param-tree.consts.d.ts +0 -7
- package/lib/components/inputs/param-tree/param-tree.component.d.ts +0 -41
- package/lib/components/inputs/param-tree/services/param-tree.service.d.ts +0 -37
- package/lib/components/inputs/param-tree/services/sync-tree-loader.service.d.ts +0 -10
- package/lib/components/inputs/param-tree/types/param-tree.types.d.ts +0 -32
- package/lib/components/inputs/param-tree/utils/param-tree.utils.d.ts +0 -7
- package/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.d.ts +0 -31
- package/lib/components/inputs/param-tree-select/param-tree-select.component.d.ts +0 -30
- package/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.d.ts +0 -6
- package/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.d.ts +0 -5
- package/lib/components/menu-constructor/sproc-menu-constructor.component.d.ts +0 -113
- package/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.d.ts +0 -24
- package/lib/components/menu-constructor/store/sproc-menu-constructor.consts.d.ts +0 -36
- package/lib/components/page-menu/schema/sproc-page-menu.consts.d.ts +0 -7
- package/lib/components/page-menu/schema/sproc-page-menu.schema.d.ts +0 -30
- package/lib/components/page-menu/schema/sproc-page-menu.tokens.d.ts +0 -3
- package/lib/components/page-menu/schema/sproc-page-menu.types.d.ts +0 -36
- package/lib/components/page-menu/sproc-page-menu.component.d.ts +0 -48
- package/lib/components/paginator/paginator.component.d.ts +0 -52
- package/lib/components/paginator/types/paginator.types.d.ts +0 -15
- package/lib/components/register-table/consts/register-table.consts.d.ts +0 -3
- package/lib/components/register-table/directives/cell-template.directive.d.ts +0 -9
- package/lib/components/register-table/directives/header-template.directive.d.ts +0 -9
- package/lib/components/register-table/model/schema.d.ts +0 -52
- package/lib/components/register-table/pipes/class-by-type.pipe.d.ts +0 -8
- package/lib/components/register-table/pipes/sticky-column.pipe.d.ts +0 -7
- package/lib/components/register-table/register-table.component.d.ts +0 -165
- package/lib/components/reset-settings-form/reset-settings-form.component.d.ts +0 -9
- package/lib/components/search-input/search-input.component.d.ts +0 -11
- package/lib/components/sliding-panel/sliding-panel.component.d.ts +0 -14
- package/lib/components/sliding-panel/sliding-panel.module.d.ts +0 -9
- package/lib/consts/date-time.consts.d.ts +0 -1
- package/lib/consts/index.d.ts +0 -3
- package/lib/consts/inputs.consts.d.ts +0 -4
- package/lib/consts/month.consts.d.ts +0 -49
- package/lib/consts/params.consts.d.ts +0 -1
- package/lib/consts/register-base.consts.d.ts +0 -19
- package/lib/core/form-group-wrapper/errors-consts.d.ts +0 -5
- package/lib/core/form-group-wrapper/form-group-wrapper.d.ts +0 -15
- package/lib/core/input-control/input-control.d.ts +0 -11
- package/lib/core/param/param-base.d.ts +0 -68
- package/lib/core/param/param-date-base.d.ts +0 -18
- package/lib/core/param/param-select-base.d.ts +0 -42
- package/lib/core/param/param-text-base.d.ts +0 -15
- package/lib/core/register-base/register-base.d.ts +0 -168
- package/lib/core/register-base/register-base.store.d.ts +0 -35
- package/lib/directives/date/date-time.types.d.ts +0 -32
- package/lib/directives/date/format-date.pipe.d.ts +0 -10
- package/lib/directives/number/number-only.directive.d.ts +0 -10
- package/lib/directives/sticky/sticky-relative.directive.d.ts +0 -13
- package/lib/directives/sticky/sticky-relative.service.d.ts +0 -15
- package/lib/directives/sticky/sticky.directive.d.ts +0 -27
- package/lib/services/date-time.service.d.ts +0 -80
- package/lib/services/dialog/dialog.service.d.ts +0 -22
- package/lib/services/dom-intersection.service.d.ts +0 -8
- package/lib/services/filter/filters-state.service.d.ts +0 -21
- package/lib/services/filter/filters-transmit.service.d.ts +0 -28
- package/lib/services/filter/filters.service.d.ts +0 -12
- package/lib/services/inputs-state.service.d.ts +0 -57
- package/lib/services/inputs.service.d.ts +0 -28
- package/lib/services/key-pressed.service.d.ts +0 -15
- package/lib/services/resize-window-observer.service.d.ts +0 -11
- package/lib/services/selected-objects-state.service.d.ts +0 -47
- package/lib/store/fast-query-store.service.d.ts +0 -19
- package/lib/types/hasura.types.d.ts +0 -35
- package/lib/types/inputs.types.d.ts +0 -41
- package/lib/types/params.types.d.ts +0 -27
- package/lib/types/register-base.types.d.ts +0 -123
- package/lib/types/sub-types.d.ts +0 -8
- package/lib/types/user-profile.types.d.ts +0 -17
- package/lib/utils/functions.d.ts +0 -3
- package/lib/utils/get-url-segment.d.ts +0 -7
- package/lib/utils/prizm.shared.module.d.ts +0 -14
- package/lib/utils/rxjs.d.ts +0 -10
- package/lib/utils/select-all-utils.d.ts +0 -8
- package/schematics/ng-update/replace-menu-state-token/index.d.ts +0 -2
- package/schematics/ng-update/replace-menu-state-token/index.js +0 -29
- package/schematics/ng-update/replace-menu-state-token/index.js.map +0 -1
- package/schematics/ng-update/update-prefix/index.d.ts +0 -2
- package/schematics/ng-update/update-prefix/index.js +0 -33
- package/schematics/ng-update/update-prefix/index.js.map +0 -1
- package/schematics/utils/utils.js +0 -25
- package/schematics/utils/utils.js.map +0 -1
- /package/{lib/components/column-settings/index.d.ts → src/lib/components/column-settings/index.ts} +0 -0
- /package/{lib/components/filters/index.d.ts → src/lib/components/filters/index.ts} +0 -0
- /package/{lib/components/index.d.ts → src/lib/components/index.ts} +0 -0
- /package/{lib/components/inputs/index.d.ts → src/lib/components/inputs/index.ts} +0 -0
- /package/{lib/components/inputs/param-switcher-date-time-range/index.d.ts → src/lib/components/inputs/param-switcher-date-time-range/index.ts} +0 -0
- /package/{lib/components/inputs/param-tree/index.d.ts → src/lib/components/inputs/param-tree/index.ts} +0 -0
- /package/{lib/components/menu-constructor/index.d.ts → src/lib/components/menu-constructor/index.ts} +0 -0
- /package/{lib/components/page-menu/index.d.ts → src/lib/components/page-menu/index.ts} +0 -0
- /package/{lib/components/register-table/index.d.ts → src/lib/components/register-table/index.ts} +0 -0
- /package/{lib/core/form-group-wrapper/index.d.ts → src/lib/core/form-group-wrapper/index.ts} +0 -0
- /package/{lib/core/index.d.ts → src/lib/core/index.ts} +0 -0
- /package/{lib/core/input-control/index.d.ts → src/lib/core/input-control/index.ts} +0 -0
- /package/{lib/core/param/index.d.ts → src/lib/core/param/index.ts} +0 -0
- /package/{lib/core/register-base/index.d.ts → src/lib/core/register-base/index.ts} +0 -0
- /package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +0 -0
- /package/{lib/directives/sticky/index.d.ts → src/lib/directives/sticky/index.ts} +0 -0
- /package/{lib/services/dialog/index.d.ts → src/lib/services/dialog/index.ts} +0 -0
- /package/{lib/services/index.d.ts → src/lib/services/index.ts} +0 -0
- /package/{lib/store/index.d.ts → src/lib/store/index.ts} +0 -0
- /package/{lib/types/index.d.ts → src/lib/types/index.ts} +0 -0
- /package/{lib/utils/index.d.ts → src/lib/utils/index.ts} +0 -0
- /package/{public-api.d.ts → src/public-api.ts} +0 -0
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
computed,
|
|
5
|
+
contentChildren,
|
|
6
|
+
DestroyRef,
|
|
7
|
+
effect,
|
|
8
|
+
ElementRef,
|
|
9
|
+
inject,
|
|
10
|
+
input,
|
|
11
|
+
OnDestroy,
|
|
12
|
+
output,
|
|
13
|
+
signal,
|
|
14
|
+
TemplateRef,
|
|
15
|
+
untracked,
|
|
16
|
+
viewChild,
|
|
17
|
+
viewChildren,
|
|
18
|
+
} from '@angular/core';
|
|
19
|
+
import { DomIntersectionService } from '../../services/dom-intersection.service';
|
|
20
|
+
import { TuiHint, TuiIcon, TuiLoader, TuiScrollbar } from '@taiga-ui/core';
|
|
21
|
+
import { TuiTable, TuiTableSortChange } from '@taiga-ui/addon-table';
|
|
22
|
+
import { AsyncPipe, DecimalPipe, NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
|
|
23
|
+
import {
|
|
24
|
+
ColumnDataTypes,
|
|
25
|
+
EColumnDataType,
|
|
26
|
+
IColumnData,
|
|
27
|
+
RegisterTableCellSorter,
|
|
28
|
+
ThWidthEntry,
|
|
29
|
+
} from './model/schema';
|
|
30
|
+
import { TuiCheckbox } from '@taiga-ui/kit';
|
|
31
|
+
import { EDatePattern, ETimezone } from '../../directives/date/date-time.types';
|
|
32
|
+
import {
|
|
33
|
+
outputFromObservable,
|
|
34
|
+
takeUntilDestroyed,
|
|
35
|
+
toObservable,
|
|
36
|
+
toSignal,
|
|
37
|
+
} from '@angular/core/rxjs-interop';
|
|
38
|
+
import { HeaderTemplateDirective } from './directives/header-template.directive';
|
|
39
|
+
import { DateTimeService } from '../../services/date-time.service';
|
|
40
|
+
import { CellTemplateDirective } from './directives/cell-template.directive';
|
|
41
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
42
|
+
import { KEY_PRESSED, KeyPressedService } from '../../services/key-pressed.service';
|
|
43
|
+
import { EOrder, THS_WIDTH_CHANGES_DEBOUNCE_TIME_MLS } from '../../consts/register-base.consts';
|
|
44
|
+
import { ClassByTypePipe } from './pipes/class-by-type.pipe';
|
|
45
|
+
import { StickyColumnPipe } from './pipes/sticky-column.pipe';
|
|
46
|
+
import {
|
|
47
|
+
CHECKBOX_SELECTOR_KEY,
|
|
48
|
+
CHECKBOX_SELECTOR_WIDTH_PX,
|
|
49
|
+
MIN_COL_WIDTH_PX,
|
|
50
|
+
} from './consts/register-table.consts';
|
|
51
|
+
import {
|
|
52
|
+
BehaviorSubject,
|
|
53
|
+
combineLatest,
|
|
54
|
+
debounceTime,
|
|
55
|
+
map,
|
|
56
|
+
skip,
|
|
57
|
+
Subject,
|
|
58
|
+
switchMap,
|
|
59
|
+
tap,
|
|
60
|
+
} from 'rxjs';
|
|
61
|
+
import { CheckboxSelectorComponent } from '../checkbox-selector/checkbox-selector.component';
|
|
62
|
+
import { distinctUntilChangedJSONs } from '../../utils';
|
|
63
|
+
import { StickyDirective, StickyRelativeDirective } from '../../directives';
|
|
64
|
+
import { ScalarUUID } from 'hasura';
|
|
65
|
+
import { ERegisterObjectState, IRegisterObject } from '../../types';
|
|
66
|
+
import { ApplySelectionTypes } from '../checkbox-selector/checkbox-selector.types';
|
|
67
|
+
import { SelectedObjectsStateService } from '../../services';
|
|
68
|
+
import { TuiResizable, TuiResizer } from '@taiga-ui/cdk';
|
|
69
|
+
import { FormatDatePipe } from '../../directives/date/format-date.pipe';
|
|
70
|
+
import { IPaginatorOutput } from '../paginator/types/paginator.types';
|
|
71
|
+
import { PaginatorComponent } from '../paginator/paginator.component';
|
|
72
|
+
|
|
73
|
+
/** Общий компонент для создания таблицы ресстра */
|
|
74
|
+
@Component({
|
|
75
|
+
selector: 'sproc-register-table',
|
|
76
|
+
templateUrl: './register-table.component.html',
|
|
77
|
+
styleUrls: ['./register-table.component.less'],
|
|
78
|
+
standalone: true,
|
|
79
|
+
imports: [
|
|
80
|
+
TuiScrollbar,
|
|
81
|
+
TuiLoader,
|
|
82
|
+
NgClass,
|
|
83
|
+
NgStyle,
|
|
84
|
+
TuiCheckbox,
|
|
85
|
+
NgTemplateOutlet,
|
|
86
|
+
DecimalPipe,
|
|
87
|
+
FormatDatePipe,
|
|
88
|
+
AsyncPipe,
|
|
89
|
+
FormsModule,
|
|
90
|
+
ReactiveFormsModule,
|
|
91
|
+
TuiLoader,
|
|
92
|
+
TuiTable,
|
|
93
|
+
ClassByTypePipe,
|
|
94
|
+
StickyColumnPipe,
|
|
95
|
+
TuiHint,
|
|
96
|
+
PaginatorComponent,
|
|
97
|
+
CheckboxSelectorComponent,
|
|
98
|
+
StickyDirective,
|
|
99
|
+
StickyRelativeDirective,
|
|
100
|
+
TuiIcon,
|
|
101
|
+
TuiResizer,
|
|
102
|
+
TuiResizable,
|
|
103
|
+
],
|
|
104
|
+
providers: [
|
|
105
|
+
DomIntersectionService,
|
|
106
|
+
KeyPressedService,
|
|
107
|
+
{
|
|
108
|
+
provide: KEY_PRESSED,
|
|
109
|
+
useValue: 'Shift',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
113
|
+
})
|
|
114
|
+
export class RegisterTableComponent implements OnDestroy {
|
|
115
|
+
/** Переданный контент для заголовков таблицы, темплейты с директивой HeaderTemplateDirective */
|
|
116
|
+
public headerTemplates = contentChildren<HeaderTemplateDirective>(HeaderTemplateDirective);
|
|
117
|
+
/** Переданный контент для ячеек таблицы, темплейты с директивой CellTemplateDirective */
|
|
118
|
+
public cellTemplates = contentChildren<CellTemplateDirective>(CellTemplateDirective);
|
|
119
|
+
|
|
120
|
+
/** Элементы строк таблицы */
|
|
121
|
+
public bodyRows = viewChildren('bodyRow', { read: ElementRef });
|
|
122
|
+
/** Элемент скролла таблицы */
|
|
123
|
+
public scrollbar = viewChild(TuiScrollbar, { read: ElementRef });
|
|
124
|
+
/** Состояние загрузки данных таблицы */
|
|
125
|
+
public isLoading = input.required<boolean | null>();
|
|
126
|
+
/** Состояние загрузки данных пагинации */
|
|
127
|
+
public isPaginatorLoading = input<boolean>(false);
|
|
128
|
+
/** Номер страницы */
|
|
129
|
+
public page = input.required<number | null>();
|
|
130
|
+
/** Количество записей на одной странице */
|
|
131
|
+
public limit = input.required<number | null>();
|
|
132
|
+
/** Отображение колонки выбора строк (по умолчанию отображается) */
|
|
133
|
+
public checkboxColumn = input(true);
|
|
134
|
+
/** Список столбцов */
|
|
135
|
+
public columns = input.required<string[]>();
|
|
136
|
+
/** Данные столбцов */
|
|
137
|
+
public columnsData = input.required<IColumnData[]>();
|
|
138
|
+
/** Идентификаторы фиксированных слева столбцов */
|
|
139
|
+
public stickyLeftIds = input<string[] | undefined>();
|
|
140
|
+
/** Идентификаторы фиксированных слева столбцов */
|
|
141
|
+
public stickyRightIds = input<string[] | undefined>();
|
|
142
|
+
/** Всего записей */
|
|
143
|
+
public totalRecords = input.required<number>();
|
|
144
|
+
/** Всего записей, без учета фильтра */
|
|
145
|
+
public totalNotFiltered = input.required<number>();
|
|
146
|
+
/** Значения таблицы */
|
|
147
|
+
public rowData = input.required<any[]>();
|
|
148
|
+
/**
|
|
149
|
+
* @description Идентификаторы выбранных записей
|
|
150
|
+
*
|
|
151
|
+
* @deprecated Используйте stateObjects
|
|
152
|
+
* */
|
|
153
|
+
public selectedIds = input(new Set<ScalarUUID>());
|
|
154
|
+
/**
|
|
155
|
+
* @description Объекты выбранных записей
|
|
156
|
+
*
|
|
157
|
+
* @deprecated Используйте stateObjects
|
|
158
|
+
* */
|
|
159
|
+
public selectedObjects = input(new Set<any>());
|
|
160
|
+
/** Загрузка дополнительных записей при выборе соответствущего пункта в чекбокс-селекторе */
|
|
161
|
+
public isSelectloading = input<boolean | null>(false);
|
|
162
|
+
/** Текст пустой таблицы */
|
|
163
|
+
public emptyText = input<string>('Нет данных');
|
|
164
|
+
/** Дизейбл сортировки */
|
|
165
|
+
public sortingDisabled = input(false);
|
|
166
|
+
/** Максимальное значения выбора чекбоксов через поле ввода */
|
|
167
|
+
public checkboxInputMaxValue = input<number | null>(null);
|
|
168
|
+
/** Дизейбл выбора чекбоксов */
|
|
169
|
+
public checkboxDisabled = input(false);
|
|
170
|
+
/** Дизейбл выбора чекбоксов */
|
|
171
|
+
public paginatorDisabled = input(false);
|
|
172
|
+
|
|
173
|
+
public selectedCounter = computed(() => {
|
|
174
|
+
const selectedSize = this._selectedService?.selectedValues()?.size ?? null;
|
|
175
|
+
const unselectedSize = this._selectedService?.unselectedValues()?.size ?? 0;
|
|
176
|
+
const unfetchedObjects = this._selectedService?.stateUnfetchedObjects();
|
|
177
|
+
const isNotSelected = unfetchedObjects !== ERegisterObjectState.SELECTED;
|
|
178
|
+
|
|
179
|
+
if (selectedSize === null) {
|
|
180
|
+
this._deprecatedSelectedRowsCounter();
|
|
181
|
+
return this.selectedIds().size;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return isNotSelected ? selectedSize : this.totalRecords() - unselectedSize;
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
protected readonly dts = inject(DateTimeService);
|
|
188
|
+
protected readonly destroyRef = inject(DestroyRef);
|
|
189
|
+
|
|
190
|
+
private readonly _shift = inject(KeyPressedService);
|
|
191
|
+
private readonly _domIntersectionService = inject(DomIntersectionService);
|
|
192
|
+
// TODO удалить optional: true после выполнения задачи SMA2-3134
|
|
193
|
+
private readonly _selectedService = inject(SelectedObjectsStateService, {
|
|
194
|
+
optional: true,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
/** Событие выбора в чекбокс-селекторе */
|
|
198
|
+
public selectChanged = output<ApplySelectionTypes>();
|
|
199
|
+
/** Событие изменения значений пагинатора */
|
|
200
|
+
public paginatorChange = output<IPaginatorOutput>();
|
|
201
|
+
/** Событие нажатия на строку */
|
|
202
|
+
public rowClick = output<any>();
|
|
203
|
+
/** Событие двойного нажатия на строку */
|
|
204
|
+
public rowDblClick = output<any>();
|
|
205
|
+
/** Событие нажатия на строку */
|
|
206
|
+
public rowSelected = output<{ row: any[]; count: number }>();
|
|
207
|
+
/** Событие сортировки значений в таблице */
|
|
208
|
+
public sort = output<RegisterTableCellSorter<any>[]>();
|
|
209
|
+
/** Событие изменения ширины колонки */
|
|
210
|
+
private readonly _thsWidthMap = computed(
|
|
211
|
+
() => new Map(this.columnsData().map(({ name, width }) => [name, new BehaviorSubject(width)]))
|
|
212
|
+
);
|
|
213
|
+
public thsWidthChange = outputFromObservable<ThWidthEntry[]>(
|
|
214
|
+
toObservable(this._thsWidthMap).pipe(
|
|
215
|
+
switchMap((changes) =>
|
|
216
|
+
combineLatest(
|
|
217
|
+
[...changes.entries()].map(([name, $width]) =>
|
|
218
|
+
$width.asObservable().pipe(map((width) => ({ name, width })))
|
|
219
|
+
)
|
|
220
|
+
).pipe(
|
|
221
|
+
distinctUntilChangedJSONs(),
|
|
222
|
+
debounceTime(THS_WIDTH_CHANGES_DEBOUNCE_TIME_MLS),
|
|
223
|
+
skip(1)
|
|
224
|
+
)
|
|
225
|
+
)
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
/** Событие изменения видимых строк таблицы */
|
|
229
|
+
private readonly _observerRowsVisibilityDOM$ = toObservable(this.bodyRows).pipe(
|
|
230
|
+
switchMap((bodyRows) =>
|
|
231
|
+
combineLatest(
|
|
232
|
+
bodyRows.map((bodyRow, index) =>
|
|
233
|
+
this._domIntersectionService.createAndObserve(bodyRow).pipe(
|
|
234
|
+
// TODO удалить tap, как только перестанет использоваться is_visible по проекту
|
|
235
|
+
tap((isVisible) => {
|
|
236
|
+
this.rowData()[index].is_visible = isVisible;
|
|
237
|
+
}),
|
|
238
|
+
map((isVisible) => (isVisible ? this.rowData()[index] : undefined))
|
|
239
|
+
)
|
|
240
|
+
)
|
|
241
|
+
).pipe(map((visibleRows) => visibleRows.filter((visibleRow) => !!visibleRow)))
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
public visibleRowsChange = outputFromObservable<any[]>(this._observerRowsVisibilityDOM$);
|
|
245
|
+
|
|
246
|
+
protected readonly EColumnDataType = EColumnDataType;
|
|
247
|
+
protected readonly ETimezone = ETimezone;
|
|
248
|
+
protected readonly EDatePattern = EDatePattern;
|
|
249
|
+
protected readonly ERegisterObjectState = ERegisterObjectState;
|
|
250
|
+
|
|
251
|
+
protected readonly CHECKBOX_SELECTOR_KEY = CHECKBOX_SELECTOR_KEY;
|
|
252
|
+
protected readonly CHECKBOX_SELECTOR_WIDTH_PX = CHECKBOX_SELECTOR_WIDTH_PX;
|
|
253
|
+
|
|
254
|
+
protected readonly stickyThStyle = Object.freeze({ 'z-index': 22 });
|
|
255
|
+
protected readonly stickyTdStyle = Object.freeze({ 'z-index': 21 });
|
|
256
|
+
|
|
257
|
+
protected readonly columnsWithCheckboxes = computed(() => [
|
|
258
|
+
CHECKBOX_SELECTOR_KEY,
|
|
259
|
+
...this.columns(),
|
|
260
|
+
]);
|
|
261
|
+
protected readonly scrollPosition = signal<{ top: number; left: number }>({ top: 0, left: 0 });
|
|
262
|
+
protected readonly tableWidth = toSignal(
|
|
263
|
+
combineLatest([toObservable(this.columnsWithCheckboxes), toObservable(this._thsWidthMap)]).pipe(
|
|
264
|
+
map(
|
|
265
|
+
({ 0: visibleColumns, 1: changes }) =>
|
|
266
|
+
new Map([...changes.entries()].filter(([thName]) => visibleColumns.includes(thName)))
|
|
267
|
+
),
|
|
268
|
+
switchMap((changes) =>
|
|
269
|
+
combineLatest(
|
|
270
|
+
[...changes.entries()].map(({ 1: $width }) =>
|
|
271
|
+
$width.asObservable().pipe(map((width) => width))
|
|
272
|
+
)
|
|
273
|
+
).pipe(
|
|
274
|
+
map((widths) => {
|
|
275
|
+
let tableWidth = this.checkboxColumn() ? CHECKBOX_SELECTOR_WIDTH_PX : 0;
|
|
276
|
+
|
|
277
|
+
for (const width of widths) {
|
|
278
|
+
tableWidth += width ? Number(width) : 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return tableWidth;
|
|
282
|
+
})
|
|
283
|
+
)
|
|
284
|
+
)
|
|
285
|
+
)
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
protected stateObjects = this._selectedService?.state;
|
|
289
|
+
|
|
290
|
+
protected visibleColumnsTree = computed(() =>
|
|
291
|
+
this._filterVisibleColumns(this.columnsData(), this.columns())
|
|
292
|
+
);
|
|
293
|
+
protected maxDepth = computed(() => this._getMaxDepth(this.visibleColumnsTree()));
|
|
294
|
+
protected leaves = computed(() => this._getFlatLeaves(this.visibleColumnsTree()));
|
|
295
|
+
|
|
296
|
+
protected headerRows = computed(() => {
|
|
297
|
+
const maxDepth = this.maxDepth();
|
|
298
|
+
const rows: { col: IColumnData; rowspan: number; colspan: number }[][] = Array.from(
|
|
299
|
+
{ length: maxDepth },
|
|
300
|
+
() => []
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
if (maxDepth === 0) {
|
|
304
|
+
return rows;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
for (const col of this.visibleColumnsTree()) {
|
|
308
|
+
this._buildHeaderRecursive(col, 0, maxDepth, rows);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return rows;
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
private _deprecatedSelectedRowsCounter = signal(0);
|
|
315
|
+
|
|
316
|
+
protected readonly timeZoneChanges$ = this.dts.isTimeZoneChanged$;
|
|
317
|
+
|
|
318
|
+
protected readonly columnOrders = new Map<string, RegisterTableCellSorter<any>>();
|
|
319
|
+
|
|
320
|
+
private readonly _projectedHeadersMap = new Map<string, TemplateRef<any>>();
|
|
321
|
+
private readonly _projectedCellsMap = new Map<string, TemplateRef<any>>();
|
|
322
|
+
|
|
323
|
+
private readonly _clickedRow$ = new Subject<unknown>();
|
|
324
|
+
|
|
325
|
+
private readonly _hoveredRow$ = new BehaviorSubject<unknown>(null);
|
|
326
|
+
|
|
327
|
+
protected lastSelectedRow: unknown;
|
|
328
|
+
|
|
329
|
+
constructor() {
|
|
330
|
+
this._setScrollPositionAfterDataLoading();
|
|
331
|
+
this._projectHeaderTemplates();
|
|
332
|
+
this._projectCellTemplates();
|
|
333
|
+
// TODO удалить метод, как только перестанет использоваться is_visible по проекту
|
|
334
|
+
this._syncRowVisibilityDOM();
|
|
335
|
+
|
|
336
|
+
effect(() => {
|
|
337
|
+
const data = this.rowData();
|
|
338
|
+
|
|
339
|
+
if (data.length > 0 && !this.lastSelectedRow) {
|
|
340
|
+
[this.lastSelectedRow] = data;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
private _setScrollPositionAfterDataLoading(): void {
|
|
346
|
+
effect(() => {
|
|
347
|
+
if (!this.isLoading()) {
|
|
348
|
+
untracked(() => {
|
|
349
|
+
const { top, left } = this.scrollPosition();
|
|
350
|
+
const scrollbarElement = this.scrollbar()?.nativeElement;
|
|
351
|
+
|
|
352
|
+
if (scrollbarElement) {
|
|
353
|
+
scrollbarElement.scrollTop = top;
|
|
354
|
+
scrollbarElement.scrollLeft = left;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
private _projectHeaderTemplates(): void {
|
|
362
|
+
effect(() => {
|
|
363
|
+
this._projectedHeadersMap.clear();
|
|
364
|
+
for (const template of this.headerTemplates()) {
|
|
365
|
+
this._projectedHeadersMap.set(template.headerTemplateName(), template.tpl);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
private _projectCellTemplates(): void {
|
|
371
|
+
effect(() => {
|
|
372
|
+
this._projectedCellsMap.clear();
|
|
373
|
+
for (const template of this.cellTemplates()) {
|
|
374
|
+
this._projectedCellsMap.set(template.cellTemplateName, template.tpl);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
private _syncRowVisibilityDOM(): void {
|
|
380
|
+
this._observerRowsVisibilityDOM$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
public ngOnDestroy(): void {
|
|
384
|
+
this._clickedRow$.complete();
|
|
385
|
+
this._hoveredRow$.complete();
|
|
386
|
+
for (const subject of this._thsWidthMap().values()) {
|
|
387
|
+
subject.complete();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
protected getProjectionHeaderByName(name: string): TemplateRef<any> | undefined {
|
|
392
|
+
return this._projectedHeadersMap.get(name);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
protected getProjectionCellByName(name: string): TemplateRef<any> | undefined {
|
|
396
|
+
return this._projectedCellsMap.get(name);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
protected sortChange({ sortComparator }: TuiTableSortChange<Partial<Record<string, any>>>): void {
|
|
400
|
+
if (!sortComparator) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const id = sortComparator({}, {}) as any as string;
|
|
405
|
+
const columnOrder = this.columnOrders.get(id);
|
|
406
|
+
|
|
407
|
+
if (this._shift.isPressed()) {
|
|
408
|
+
this.updateColumnOrder(id, columnOrder);
|
|
409
|
+
} else {
|
|
410
|
+
this.columnOrders.clear();
|
|
411
|
+
this.updateColumnOrder(id, columnOrder);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
this.sort.emit([...this.columnOrders.values()]);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
private updateColumnOrder(
|
|
418
|
+
id: string,
|
|
419
|
+
columnOrder: RegisterTableCellSorter<any> | undefined
|
|
420
|
+
): void {
|
|
421
|
+
if (columnOrder) {
|
|
422
|
+
const { options } = columnOrder;
|
|
423
|
+
const { order } = options;
|
|
424
|
+
|
|
425
|
+
if (order === EOrder.DESC) {
|
|
426
|
+
this.columnOrders.delete(id);
|
|
427
|
+
} else {
|
|
428
|
+
this.columnOrders.set(id, { options: { ...options, order: EOrder.DESC } });
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
this.columnOrders.set(id, { options: { id, order: EOrder.ASC } });
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
protected setThName(thName: string): any {
|
|
436
|
+
return () => thName;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
protected checkAvailableColumnSorting(columnData: IColumnData): boolean {
|
|
440
|
+
const { sortable, type } = columnData;
|
|
441
|
+
const availableSortColumnTypes: ColumnDataTypes[] = [
|
|
442
|
+
EColumnDataType.TEXT,
|
|
443
|
+
EColumnDataType.DATE,
|
|
444
|
+
EColumnDataType.NUM,
|
|
445
|
+
];
|
|
446
|
+
|
|
447
|
+
return !this.sortingDisabled() && sortable !== false && availableSortColumnTypes.includes(type);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
protected checkResizeBlocked(columnData: IColumnData): boolean {
|
|
451
|
+
const resizableBlockedTypes: ColumnDataTypes[] = [
|
|
452
|
+
EColumnDataType.CHECKBOX,
|
|
453
|
+
EColumnDataType.ICON,
|
|
454
|
+
EColumnDataType.ICON_SVG,
|
|
455
|
+
];
|
|
456
|
+
|
|
457
|
+
return columnData.fixed || resizableBlockedTypes.includes(columnData.type);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
protected onRowHover(row: unknown): void {
|
|
461
|
+
this._hoveredRow$.next(row);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
protected onRowClick(event: MouseEvent, row: unknown): void {
|
|
465
|
+
const blueHighlightsSelected = window.getSelection();
|
|
466
|
+
blueHighlightsSelected?.removeAllRanges();
|
|
467
|
+
|
|
468
|
+
const stateObjects = this.stateObjects?.();
|
|
469
|
+
|
|
470
|
+
// TODO оставить только if после SMA2-3134
|
|
471
|
+
if (stateObjects) {
|
|
472
|
+
if (event.shiftKey) {
|
|
473
|
+
this._changeRangeRowsState(stateObjects, this.lastSelectedRow, row);
|
|
474
|
+
} else {
|
|
475
|
+
if (event.ctrlKey) {
|
|
476
|
+
this._changeOnlyRowState(stateObjects, row, true);
|
|
477
|
+
} else {
|
|
478
|
+
this._changeOnlyRowState(stateObjects, row);
|
|
479
|
+
}
|
|
480
|
+
this.lastSelectedRow = row;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
this.rowClick.emit(row);
|
|
484
|
+
|
|
485
|
+
const selectedObjects = this._selectedService?.selectedValues();
|
|
486
|
+
|
|
487
|
+
if (selectedObjects) {
|
|
488
|
+
this.rowSelected.emit({
|
|
489
|
+
row: [...selectedObjects],
|
|
490
|
+
count: selectedObjects.size,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
this._clickedRow$.next(row);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (event.shiftKey) {
|
|
499
|
+
this._selectRangeRows(this.lastSelectedRow, row);
|
|
500
|
+
} else {
|
|
501
|
+
if (event.ctrlKey) {
|
|
502
|
+
this._selectOnlyRow(row, true);
|
|
503
|
+
} else {
|
|
504
|
+
this._selectOnlyRow(row);
|
|
505
|
+
}
|
|
506
|
+
this.lastSelectedRow = row;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
this.rowClick.emit(row);
|
|
510
|
+
this.rowSelected.emit({
|
|
511
|
+
row: [...this.selectedObjects()],
|
|
512
|
+
count: this.selectedObjects().size,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
private _changeOnlyRowState(
|
|
517
|
+
state: Map<ScalarUUID, IRegisterObject>,
|
|
518
|
+
row: unknown,
|
|
519
|
+
saveSelected?: boolean
|
|
520
|
+
): void {
|
|
521
|
+
if (typeof row !== 'object' || !row || !('id' in row)) {
|
|
522
|
+
console.error('Поле id отсутствует в элементе', row);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const id = row.id as string;
|
|
527
|
+
const wasSelected = state.get(id)?.state === ERegisterObjectState.SELECTED;
|
|
528
|
+
|
|
529
|
+
if (saveSelected) {
|
|
530
|
+
this.updateStateObjectByKey(id, {
|
|
531
|
+
state: wasSelected ? ERegisterObjectState.UNSELECTED : ERegisterObjectState.SELECTED,
|
|
532
|
+
});
|
|
533
|
+
} else {
|
|
534
|
+
this.updateAllStateObjectsByState(ERegisterObjectState.UNSELECTED);
|
|
535
|
+
this.updateStateObjectByKey(id, { state: ERegisterObjectState.SELECTED });
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
private _selectOnlyRow(row: unknown, saveSelected?: boolean): void {
|
|
540
|
+
if (typeof row !== 'object' || !row || !('id' in row)) {
|
|
541
|
+
console.error('Поле id отсутствует в элементе', row);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const id = row.id as string;
|
|
546
|
+
const wasSelected = this.selectedIds().has(id);
|
|
547
|
+
|
|
548
|
+
if (saveSelected) {
|
|
549
|
+
if (wasSelected) {
|
|
550
|
+
this.selectedIds().delete(id);
|
|
551
|
+
this.selectedObjects().delete(row);
|
|
552
|
+
} else {
|
|
553
|
+
this.selectedIds().add(id);
|
|
554
|
+
this.selectedObjects().add(row);
|
|
555
|
+
}
|
|
556
|
+
} else {
|
|
557
|
+
this.selectedIds().clear();
|
|
558
|
+
this.selectedObjects().clear();
|
|
559
|
+
this.selectedIds().add(id);
|
|
560
|
+
this.selectedObjects().add(row);
|
|
561
|
+
}
|
|
562
|
+
this._emitDeprecatedSelectedRows();
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
private _emitDeprecatedSelectedRows(): void {
|
|
566
|
+
this._deprecatedSelectedRowsCounter.update((value) => value + 1);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
private _changeRangeRowsState(
|
|
570
|
+
stateObjects: Map<ScalarUUID, IRegisterObject>,
|
|
571
|
+
previousRow: unknown,
|
|
572
|
+
currentRow: unknown
|
|
573
|
+
): void {
|
|
574
|
+
this.updateAllStateObjectsByState(ERegisterObjectState.UNSELECTED);
|
|
575
|
+
|
|
576
|
+
let prevIndex = this.rowData().indexOf(previousRow);
|
|
577
|
+
let currIndex = this.rowData().indexOf(currentRow);
|
|
578
|
+
|
|
579
|
+
if (prevIndex > currIndex) {
|
|
580
|
+
const tempIndex = prevIndex;
|
|
581
|
+
prevIndex = currIndex;
|
|
582
|
+
currIndex = tempIndex;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const idsObjectsShouldSelected: Set<ScalarUUID> = new Set(
|
|
586
|
+
this.rowData()
|
|
587
|
+
.slice(prevIndex === -1 ? 0 : prevIndex, currIndex + 1)
|
|
588
|
+
.map((row) => row.id)
|
|
589
|
+
);
|
|
590
|
+
|
|
591
|
+
const slicedStateObjects = new Map(
|
|
592
|
+
[...stateObjects].filter(([key]) => idsObjectsShouldSelected.has(key))
|
|
593
|
+
);
|
|
594
|
+
|
|
595
|
+
for (const key of slicedStateObjects.keys()) {
|
|
596
|
+
this.updateStateObjectByKey(key, { state: ERegisterObjectState.SELECTED });
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
private _selectRangeRows(previousRow: unknown, currentRow: unknown): void {
|
|
601
|
+
let prevIndex = this.rowData().indexOf(previousRow);
|
|
602
|
+
let currIndex = this.rowData().indexOf(currentRow);
|
|
603
|
+
|
|
604
|
+
if (prevIndex > currIndex) {
|
|
605
|
+
const tempIndex = prevIndex;
|
|
606
|
+
prevIndex = currIndex;
|
|
607
|
+
currIndex = tempIndex;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const itemsShouldSelected = this.rowData().slice(
|
|
611
|
+
prevIndex === -1 ? 0 : prevIndex,
|
|
612
|
+
currIndex + 1
|
|
613
|
+
);
|
|
614
|
+
|
|
615
|
+
this.selectedIds().clear();
|
|
616
|
+
this.selectedObjects().clear();
|
|
617
|
+
this._emitDeprecatedSelectedRows();
|
|
618
|
+
|
|
619
|
+
for (const item of itemsShouldSelected) {
|
|
620
|
+
this.selectedIds().add(item.id);
|
|
621
|
+
this.selectedObjects().add(item);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
protected thResizeChanges(name: string, width: number): void {
|
|
626
|
+
const thWidthChangesEntry = this._thsWidthMap().get(name);
|
|
627
|
+
|
|
628
|
+
if (thWidthChangesEntry) {
|
|
629
|
+
const validWidth = width > MIN_COL_WIDTH_PX ? width : MIN_COL_WIDTH_PX;
|
|
630
|
+
thWidthChangesEntry.next(validWidth.toString());
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
protected getThWidth(name: string): string | undefined {
|
|
635
|
+
const thWidthChangesEntry = this._thsWidthMap().get(name);
|
|
636
|
+
|
|
637
|
+
return thWidthChangesEntry?.getValue();
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
protected saveScrollEndPosition(): void {
|
|
641
|
+
const scrollbarElement = this.scrollbar()?.nativeElement;
|
|
642
|
+
|
|
643
|
+
if (scrollbarElement && !this.isLoading()) {
|
|
644
|
+
const { scrollTop, scrollLeft } = scrollbarElement;
|
|
645
|
+
|
|
646
|
+
this.scrollPosition.set({
|
|
647
|
+
top: scrollTop,
|
|
648
|
+
left: scrollLeft,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
protected updateAllStateObjectsByState(state: ERegisterObjectState): void {
|
|
654
|
+
this._selectedService?.setAllStateObjectsByState(state);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
protected updateStateObjectByKey(key: ScalarUUID, updates: Partial<IRegisterObject>): void {
|
|
658
|
+
this._selectedService?.setStateObjectByKey(key, updates);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
protected markRowBeforeSelect(row: unknown): boolean {
|
|
662
|
+
const shiftPressed = this._shift.isPressed();
|
|
663
|
+
const prevRow = this.lastSelectedRow;
|
|
664
|
+
const hoveredRow = this._hoveredRow$.getValue();
|
|
665
|
+
|
|
666
|
+
if (shiftPressed && prevRow && hoveredRow) {
|
|
667
|
+
let beforeIndex = this.rowData().indexOf(prevRow);
|
|
668
|
+
let afterIndex = this.rowData().indexOf(hoveredRow);
|
|
669
|
+
|
|
670
|
+
if (beforeIndex > afterIndex) {
|
|
671
|
+
const tempIndex = beforeIndex;
|
|
672
|
+
beforeIndex = afterIndex;
|
|
673
|
+
afterIndex = tempIndex;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
const currentIndex = this.rowData().indexOf(row);
|
|
677
|
+
|
|
678
|
+
return beforeIndex <= currentIndex && currentIndex <= afterIndex;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
private _buildHeaderRecursive(
|
|
685
|
+
col: IColumnData,
|
|
686
|
+
level: number,
|
|
687
|
+
maxDepth: number,
|
|
688
|
+
rows: { col: IColumnData; rowspan: number; colspan: number }[][]
|
|
689
|
+
): number {
|
|
690
|
+
const children = col.children || [];
|
|
691
|
+
const hasChildren = children.length > 0;
|
|
692
|
+
|
|
693
|
+
const customRowspan = col.rowspan || 1;
|
|
694
|
+
const nextLevel = level + customRowspan;
|
|
695
|
+
|
|
696
|
+
let colspan = 0;
|
|
697
|
+
|
|
698
|
+
if (hasChildren) {
|
|
699
|
+
for (const child of children) {
|
|
700
|
+
colspan += this._buildHeaderRecursive(child, nextLevel, maxDepth, rows);
|
|
701
|
+
}
|
|
702
|
+
} else {
|
|
703
|
+
colspan = 1;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const rowspan = hasChildren ? customRowspan : maxDepth - level;
|
|
707
|
+
|
|
708
|
+
if (rows[level]) {
|
|
709
|
+
rows[level].push({ col, rowspan, colspan });
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
return colspan;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
private _getFlatLeaves(columns: IColumnData[]): IColumnData[] {
|
|
716
|
+
return columns.flatMap((col) => {
|
|
717
|
+
if (col.children && col.children.length > 0) {
|
|
718
|
+
return this._getFlatLeaves(col.children);
|
|
719
|
+
}
|
|
720
|
+
return [col];
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
private _filterVisibleColumns(columns: IColumnData[], showedNames: string[]): IColumnData[] {
|
|
725
|
+
return columns
|
|
726
|
+
.map((col) => {
|
|
727
|
+
if (col.children && col.children.length > 0) {
|
|
728
|
+
const visibleChildren = this._filterVisibleColumns(col.children, showedNames);
|
|
729
|
+
return { ...col, children: visibleChildren };
|
|
730
|
+
}
|
|
731
|
+
return col;
|
|
732
|
+
})
|
|
733
|
+
.filter((col) => showedNames.includes(col.name) || (col.children && col.children.length > 0));
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
private _getMaxDepth(columns: IColumnData[]): number {
|
|
737
|
+
if (!columns || columns.length === 0) {
|
|
738
|
+
return 0;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
return 1 + Math.max(...columns.map((c) => this._getMaxDepth(c.children || [])));
|
|
742
|
+
}
|
|
743
|
+
}
|