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,399 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import moment, { Moment } from 'moment-timezone';
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { STORED_TIMEZONE } from '../consts/date-time.consts';
|
|
6
|
+
import { EDatePattern, ETimezone, SmaPrizmDateTime } from '../directives/date/date-time.types';
|
|
7
|
+
import {
|
|
8
|
+
PrizmDateTimeRange,
|
|
9
|
+
PrizmDay,
|
|
10
|
+
PrizmDayRange,
|
|
11
|
+
PrizmTime,
|
|
12
|
+
PrizmTimeRange,
|
|
13
|
+
} from '@prizm-ui/components';
|
|
14
|
+
import { TuiDay } from '@taiga-ui/cdk';
|
|
15
|
+
|
|
16
|
+
export interface ITimeZone {
|
|
17
|
+
time_diff: string;
|
|
18
|
+
string: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ICurrentTime_TZ {
|
|
23
|
+
current_time: string;
|
|
24
|
+
picked_time_zone: ITimeZone;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Не менять формат, названия и ' ' оставлять всегда
|
|
28
|
+
// 'UTC ' - оставлять
|
|
29
|
+
// Eсли менять,изменить фильтры в ДО
|
|
30
|
+
export const timezoneSelectItems = [
|
|
31
|
+
'UTC +00:00',
|
|
32
|
+
'Europe/Moscow +03:00',
|
|
33
|
+
'Asia/Aqtau +05:00',
|
|
34
|
+
'Asia/Yekaterinburg +05:00',
|
|
35
|
+
'Asia/Novosibirsk +07:00',
|
|
36
|
+
'Asia/Krasnoyarsk +07:00',
|
|
37
|
+
'Asia/Irkutsk +08:00',
|
|
38
|
+
'Asia/Yakutsk +09:00',
|
|
39
|
+
];
|
|
40
|
+
export const TIME_ZONES: ITimeZone[] = [
|
|
41
|
+
{
|
|
42
|
+
value: 'Etc/GMT',
|
|
43
|
+
string: '+00:00 UTC',
|
|
44
|
+
time_diff: ETimezone.UTC,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: 'Europe/Moscow',
|
|
48
|
+
string: '+03:00 Москва',
|
|
49
|
+
time_diff: ETimezone.MSK,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 'Asia/Aqtau',
|
|
53
|
+
string: '+05:00 Тюмень',
|
|
54
|
+
time_diff: ETimezone.AQT,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: 'Asia/Novosibirsk',
|
|
58
|
+
string: '+07:00 Томск',
|
|
59
|
+
time_diff: ETimezone.NVS,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 'Asia/Irkutsk',
|
|
63
|
+
string: '+08:00 Иркутск',
|
|
64
|
+
time_diff: ETimezone.IRK,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: 'Asia/Yakutsk',
|
|
68
|
+
string: '+09:00 Якутск',
|
|
69
|
+
time_diff: ETimezone.YAK,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export const TIME_ZONE_HINTS: Record<string, string> = {
|
|
74
|
+
'+00:00': '+00:00 UTC',
|
|
75
|
+
'+03:00': 'ГПН-БС, ГПН-ГЕО, ГПН-НС, ГПН-ТП, ГПН-Щ, МНГП, НТЦ, Парадная, СПД',
|
|
76
|
+
'+05:00':
|
|
77
|
+
'ГПН-А, ГПН-БГП, ГПН-З, ГПН-ИТО, ГПН-М, ГПН-Н, ГПН-О, ГПН-Р, ГПН-С, ГПН-Х, ГПН-Я, МРТ, МсНГ, МЭН, ННГГФ, НТН, НЭН, СН-МНГ',
|
|
78
|
+
'+07:00': 'ГПН-В, МНГ-Г, ИН-ВНК',
|
|
79
|
+
'+08:00': 'Игнялинское м/р',
|
|
80
|
+
'+09:00': 'Чаяндинское м/р, Тымпучиканское м/р, Вакунайское м/р, Тас-Юряхское м/р',
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
@Injectable({
|
|
84
|
+
providedIn: 'root',
|
|
85
|
+
})
|
|
86
|
+
export class DateTimeService {
|
|
87
|
+
public readonly currentTimeTZ: ICurrentTime_TZ = {
|
|
88
|
+
picked_time_zone: TIME_ZONES[1],
|
|
89
|
+
current_time: new Date().toISOString(),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
private readonly _isTimeZoneChanged = new BehaviorSubject<ITimeZone>(
|
|
93
|
+
this.currentTimeTZ.picked_time_zone
|
|
94
|
+
);
|
|
95
|
+
public isTimeZoneChanged$ = this._isTimeZoneChanged.asObservable();
|
|
96
|
+
|
|
97
|
+
public constructor() {
|
|
98
|
+
const storedTimeZone = localStorage.getItem(STORED_TIMEZONE);
|
|
99
|
+
|
|
100
|
+
if (storedTimeZone) {
|
|
101
|
+
this.currentTimeTZ.picked_time_zone = JSON.parse(storedTimeZone) as ITimeZone;
|
|
102
|
+
} else {
|
|
103
|
+
this.currentTimeTZ.current_time = this.getCurrentTime();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public updateTimezone(time_zone: ITimeZone): void {
|
|
108
|
+
localStorage.setItem(STORED_TIMEZONE, JSON.stringify(time_zone));
|
|
109
|
+
|
|
110
|
+
this.currentTimeTZ.picked_time_zone = time_zone;
|
|
111
|
+
this.currentTimeTZ.current_time = this.getCurrentTime();
|
|
112
|
+
this._isTimeZoneChanged.next(this.currentTimeTZ.picked_time_zone);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public refreshDatePicked(): void {
|
|
116
|
+
this._isTimeZoneChanged.next(this.currentTimeTZ.picked_time_zone);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public getCurrentTime(): string {
|
|
120
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
121
|
+
timeZone: this.currentTimeTZ.picked_time_zone.value,
|
|
122
|
+
hour12: false,
|
|
123
|
+
hour: '2-digit',
|
|
124
|
+
minute: '2-digit',
|
|
125
|
+
};
|
|
126
|
+
return new Date().toLocaleString('en-GB', options);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public triggerTimeUpdate(timeZone: ITimeZone): void {
|
|
130
|
+
this._isTimeZoneChanged.next(timeZone);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @param utc время в UTC
|
|
135
|
+
* @param pattern
|
|
136
|
+
* Строка состоящая из:
|
|
137
|
+
*dd - день,
|
|
138
|
+
*MM - месяц,
|
|
139
|
+
*yyyy - год,
|
|
140
|
+
*HH - часы в 24ч-формате,
|
|
141
|
+
*hh - часы в 12ч-формате,
|
|
142
|
+
*mm - минуты,
|
|
143
|
+
*ss - секунды,
|
|
144
|
+
*sss - миллисекунды,
|
|
145
|
+
*/
|
|
146
|
+
public parseDate(utc: string, pattern: string): string {
|
|
147
|
+
const date: Date = this.isoToLocalDate(utc);
|
|
148
|
+
|
|
149
|
+
return format(date, pattern);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** @deprecated use parseDate(iso: string, pattern: string): string method */
|
|
153
|
+
public parseDateToMMYYYY(iso: string): string {
|
|
154
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
155
|
+
hour12: false,
|
|
156
|
+
year: 'numeric',
|
|
157
|
+
month: '2-digit',
|
|
158
|
+
day: '2-digit',
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const date = this.isoToLocalDate(iso).toLocaleString('en-GB', options);
|
|
162
|
+
const [_, month, year] = date.split('/');
|
|
163
|
+
|
|
164
|
+
return `${month}.${year}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** @deprecated use parseDate(iso: string, pattern: string): string method */
|
|
168
|
+
public parseDateToDDMMYYYY(iso: string): string {
|
|
169
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
170
|
+
hour12: false,
|
|
171
|
+
year: 'numeric',
|
|
172
|
+
month: '2-digit',
|
|
173
|
+
day: '2-digit',
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const date = this.isoToLocalDate(iso).toLocaleString('en-GB', options);
|
|
177
|
+
const [day, month, year] = date.split('/');
|
|
178
|
+
|
|
179
|
+
return `${day}.${month}.${year}`;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public isoToLocalDate(iso: string, tzDiff?: string): Date {
|
|
183
|
+
const date = this.isoToUTCDate(iso);
|
|
184
|
+
let diffTZ = tzDiff;
|
|
185
|
+
if (!tzDiff) {
|
|
186
|
+
diffTZ = this.currentTimeTZ.picked_time_zone.time_diff;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const hours = Number.parseInt(diffTZ!, 10);
|
|
190
|
+
date.setHours(date.getHours() + hours);
|
|
191
|
+
|
|
192
|
+
return date;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
public isoToUTCDate(iso: string): Date {
|
|
196
|
+
let dateString = iso;
|
|
197
|
+
|
|
198
|
+
// Перевод из таймзоны сервера к UTC
|
|
199
|
+
if (this._hasTimeZone(iso)) {
|
|
200
|
+
dateString = new Date(iso).toISOString();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (dateString.includes('Z')) {
|
|
204
|
+
dateString = dateString.slice(0, dateString.lastIndexOf('Z'));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return new Date(dateString);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private _hasTimeZone(iso: string): boolean {
|
|
211
|
+
const timeZoneRegex = /[+-]\d{2}(:\d{2})?$/;
|
|
212
|
+
|
|
213
|
+
return timeZoneRegex.test(iso);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Возвращает дату конвертированную в ISO формат без учета таймзоны
|
|
218
|
+
* */
|
|
219
|
+
public dateToIsoWithoutTimeZone(date: Date): string | null {
|
|
220
|
+
let result = null;
|
|
221
|
+
|
|
222
|
+
if (date) {
|
|
223
|
+
const timestamp = date.getTime() - date.getTimezoneOffset() * 60_000;
|
|
224
|
+
const correctDate = new Date(timestamp);
|
|
225
|
+
|
|
226
|
+
result = correctDate.toISOString();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
public formatDateSave(date?: string | null, option?: 'YMD'): string {
|
|
233
|
+
let result = '';
|
|
234
|
+
if (date) {
|
|
235
|
+
result = option ? format(date, 'yyyy-MM-dd') : format(date, EDatePattern.DATE);
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
public formatTimeSave(date?: string): string {
|
|
241
|
+
const dateTime: Date = new Date(date!);
|
|
242
|
+
const result = [dateTime.getHours(), dateTime.getMinutes(), dateTime.getSeconds()]
|
|
243
|
+
.map((time) => (time < 10 ? `0${time}` : time))
|
|
244
|
+
.join(':');
|
|
245
|
+
return result;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
public toISOString(date: Date, tzDiff?: string): string {
|
|
249
|
+
let diffTZ = tzDiff;
|
|
250
|
+
if (!tzDiff) {
|
|
251
|
+
diffTZ = this.currentTimeTZ.picked_time_zone.time_diff;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const m = this._momentWithTZ(date, diffTZ!);
|
|
255
|
+
|
|
256
|
+
return m.toISOString();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
public _momentWithTZ(date: Date, timezone: string): Moment {
|
|
260
|
+
const iso = this._dateToISOSliceZ(date);
|
|
261
|
+
let tz = timezone;
|
|
262
|
+
if (timezone === ETimezone.UTC) {
|
|
263
|
+
tz = 'Z';
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return moment.parseZone(`${iso}${tz}`);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private _dateToISOSliceZ(date: Date): string {
|
|
270
|
+
const iso = this.dateToIsoWithoutTimeZone(date)!;
|
|
271
|
+
|
|
272
|
+
return iso.includes('Z') ? iso.slice(0, iso.lastIndexOf('Z')) : iso;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
public convertDateToISOWithTZ(date: Date, tz: string): string {
|
|
276
|
+
const pad = (str: number) => str.toString().padStart(2, '0');
|
|
277
|
+
const datePart = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
278
|
+
const timePart = `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
279
|
+
|
|
280
|
+
return `${datePart}T${timePart}${tz}`;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public now(): Date {
|
|
284
|
+
const date = new Date();
|
|
285
|
+
const [hour, minutes] = this.currentTimeTZ.current_time
|
|
286
|
+
.split(':')
|
|
287
|
+
.map((value) => Number.parseInt(value, 10));
|
|
288
|
+
date.setHours(hour);
|
|
289
|
+
date.setMinutes(minutes);
|
|
290
|
+
|
|
291
|
+
return date;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* return объект типа moment с таймзоной выбранной в приложении
|
|
296
|
+
* */
|
|
297
|
+
public momentNowWithLocalTimezone(): Moment {
|
|
298
|
+
return moment.tz(this.currentTimeTZ.picked_time_zone.value);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
public nowUTC(): Date {
|
|
302
|
+
return new Date(moment.utc().format());
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public getWorkingDatesCount(startDate: Date, endDate: Date): number {
|
|
306
|
+
const sunday = 0;
|
|
307
|
+
const saturday = 6;
|
|
308
|
+
|
|
309
|
+
let count = 0;
|
|
310
|
+
const currentDate = new Date(startDate);
|
|
311
|
+
|
|
312
|
+
while (currentDate <= endDate) {
|
|
313
|
+
const dayOfWeek = currentDate.getDay();
|
|
314
|
+
|
|
315
|
+
if (dayOfWeek !== sunday && dayOfWeek !== saturday) {
|
|
316
|
+
count += 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
currentDate.setDate(currentDate.getDate() + 1);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return count;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
public getCurrentDateWithoutTime(): Date {
|
|
326
|
+
const currentDate = new Date();
|
|
327
|
+
|
|
328
|
+
currentDate.setHours(0);
|
|
329
|
+
currentDate.setMinutes(0);
|
|
330
|
+
currentDate.setSeconds(0);
|
|
331
|
+
currentDate.setMilliseconds(0);
|
|
332
|
+
|
|
333
|
+
return currentDate;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public getDateWithoutTime(date: Date): Date {
|
|
337
|
+
date.setHours(0);
|
|
338
|
+
date.setMinutes(0);
|
|
339
|
+
date.setSeconds(0);
|
|
340
|
+
date.setMilliseconds(0);
|
|
341
|
+
|
|
342
|
+
return date;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
public getXMonthBackDate(monthBackNumber: number): Date {
|
|
346
|
+
const currentDate = new Date();
|
|
347
|
+
currentDate.setMonth(currentDate.getMonth() - monthBackNumber);
|
|
348
|
+
return currentDate;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public prizmDateTimeRangeToNativeDates(range: PrizmDateTimeRange): { from: Date; to: Date } {
|
|
352
|
+
const { dayRange, timeRange } = range;
|
|
353
|
+
|
|
354
|
+
const from = this.prizmDateTimeToNativeDate([dayRange.from, timeRange?.from]);
|
|
355
|
+
const to = this.prizmDateTimeToNativeDate([dayRange.to, timeRange?.to]);
|
|
356
|
+
|
|
357
|
+
return { from, to };
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
public prizmDateTimeRangeFromNativeDates(from: Date, to: Date): PrizmDateTimeRange {
|
|
361
|
+
return new PrizmDateTimeRange(
|
|
362
|
+
PrizmDayRange.fromLocalNativeDate(from, to),
|
|
363
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
public prizmDateTimeToNativeDate(prizmDateTime: SmaPrizmDateTime): Date {
|
|
368
|
+
const [day, time] = prizmDateTime;
|
|
369
|
+
const date = new Date(day.toLocalNativeDate());
|
|
370
|
+
|
|
371
|
+
if (time) {
|
|
372
|
+
date.setHours(time.hours, time.minutes, time.seconds, time.ms);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return date;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
public getTuiDayFromString(date: string): TuiDay {
|
|
379
|
+
const localDate = this.isoToLocalDate(date);
|
|
380
|
+
return new TuiDay(localDate.getFullYear(), localDate.getMonth(), localDate.getDate());
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
public getTuiDayFromDate(date: Date): TuiDay {
|
|
384
|
+
return new TuiDay(date.getFullYear(), date.getMonth(), date.getDate());
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
public transferTuiDayToString(date: TuiDay | null, pattern?: EDatePattern): string | null {
|
|
388
|
+
return date ? format(date.toLocalNativeDate(), pattern ?? EDatePattern.YEAR_MONTH_DAY) : null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
public toSmaPrizmDateTime(dateString: string): SmaPrizmDateTime {
|
|
392
|
+
const date = new Date(dateString);
|
|
393
|
+
const hours = date.getHours();
|
|
394
|
+
const min = date.getMinutes();
|
|
395
|
+
const day = PrizmDay.fromLocalNativeDate(date);
|
|
396
|
+
const time = new PrizmTime(hours, min);
|
|
397
|
+
return [day, time];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { inject, Injectable, Injector } from '@angular/core';
|
|
2
|
+
import { PrizmDialogService } from '@prizm-ui/components';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { DialogContext, DialogOptions, DialogOverlayInsidePlacement } from './dialog.types';
|
|
5
|
+
import { tuiDialog, TuiDialogOptions, TuiDialogService } from '@taiga-ui/core';
|
|
6
|
+
import { PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
7
|
+
|
|
8
|
+
@Injectable({
|
|
9
|
+
providedIn: 'root',
|
|
10
|
+
})
|
|
11
|
+
export class DialogService {
|
|
12
|
+
private readonly _dialogService = inject(PrizmDialogService);
|
|
13
|
+
private readonly _tuiDialogService = inject(TuiDialogService);
|
|
14
|
+
|
|
15
|
+
public openModal(
|
|
16
|
+
template: unknown,
|
|
17
|
+
config: Partial<DialogOptions<unknown, unknown>>
|
|
18
|
+
): Observable<any> {
|
|
19
|
+
return this._dialogService.open(template, {
|
|
20
|
+
closeable: false,
|
|
21
|
+
width: 440,
|
|
22
|
+
position: DialogOverlayInsidePlacement.CENTER,
|
|
23
|
+
backdrop: true,
|
|
24
|
+
...config,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public openModalTaiga<Context extends DialogContext, Result = any>(
|
|
29
|
+
component: new (...args: any[]) => unknown,
|
|
30
|
+
context: Context,
|
|
31
|
+
injector?: Injector
|
|
32
|
+
): Observable<Result> {
|
|
33
|
+
const dialog = tuiDialog(component, {
|
|
34
|
+
injector,
|
|
35
|
+
closeable: context.closeable ?? false,
|
|
36
|
+
dismissible: context.dismissible ?? true,
|
|
37
|
+
size: context.size ?? 'auto',
|
|
38
|
+
}) as (data: any) => Observable<Result>;
|
|
39
|
+
|
|
40
|
+
return dialog({
|
|
41
|
+
...context,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Универсальная функция открытия диалога
|
|
47
|
+
*
|
|
48
|
+
* @param content - контент (компонент, ng-template или функция)
|
|
49
|
+
* @param context - данные для передачи в контент
|
|
50
|
+
* @param options - доп. настройки диалога (ширина, заголовок и т.д.)
|
|
51
|
+
*/
|
|
52
|
+
public openTuiDialogWithTemplate<T = void>(
|
|
53
|
+
content: PolymorpheusContent<TuiDialogOptions<T>>,
|
|
54
|
+
context?: Partial<TuiDialogOptions<T>>,
|
|
55
|
+
options?: Partial<TuiDialogOptions<T>>
|
|
56
|
+
): Observable<T> {
|
|
57
|
+
return this._tuiDialogService.open<T>(content, {
|
|
58
|
+
...context,
|
|
59
|
+
...options,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { PrizmDialogOptions } from '@prizm-ui/components';
|
|
2
2
|
import { TuiDialogSize } from '@taiga-ui/core';
|
|
3
|
+
|
|
3
4
|
export { PrizmOverlayInsidePlacement as DialogOverlayInsidePlacement } from '@prizm-ui/components';
|
|
5
|
+
|
|
4
6
|
export type DialogOptions<O, DATA> = PrizmDialogOptions<O, DATA>;
|
|
7
|
+
|
|
5
8
|
export type DialogSize = TuiDialogSize;
|
|
9
|
+
|
|
6
10
|
export interface DialogContext {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
closeable?: boolean;
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
width?: number;
|
|
14
|
+
size?: DialogSize;
|
|
11
15
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementRef, Injectable } from '@angular/core';
|
|
2
|
+
import { Observable, distinctUntilChanged, map, mergeMap } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class DomIntersectionService {
|
|
6
|
+
createAndObserve(element: ElementRef): Observable<boolean> {
|
|
7
|
+
return new Observable<IntersectionObserverEntry[]>((observer) => {
|
|
8
|
+
const intersectionObserver = new IntersectionObserver((entries) => {
|
|
9
|
+
observer.next(entries);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
intersectionObserver.observe(element.nativeElement);
|
|
13
|
+
|
|
14
|
+
return () => {
|
|
15
|
+
intersectionObserver.disconnect();
|
|
16
|
+
};
|
|
17
|
+
}).pipe(
|
|
18
|
+
mergeMap((entries: IntersectionObserverEntry[]) => entries),
|
|
19
|
+
map((entry) => entry.isIntersecting),
|
|
20
|
+
distinctUntilChanged()
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, filter, filter as rxjsFilter, ReplaySubject, skip, take } from 'rxjs';
|
|
3
|
+
import { InputsStateService } from '../inputs-state.service';
|
|
4
|
+
import { FiltersTransmitService } from './filters-transmit.service';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { NavigationStart } from '@angular/router';
|
|
7
|
+
import { ITpUserSettings } from '../../types/register-base.types';
|
|
8
|
+
import { isNonNull } from '../../utils';
|
|
9
|
+
import { getFirstSegmentOfPathName } from '../../utils/get-url-segment';
|
|
10
|
+
|
|
11
|
+
@Injectable()
|
|
12
|
+
export class FiltersStateService<T> extends InputsStateService<T> {
|
|
13
|
+
private readonly _transmitter = inject(FiltersTransmitService, { optional: true });
|
|
14
|
+
|
|
15
|
+
private readonly _selectedSavedFilter = new BehaviorSubject<ITpUserSettings | null>(null);
|
|
16
|
+
private readonly _isFilterNameChanged$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(
|
|
17
|
+
false
|
|
18
|
+
);
|
|
19
|
+
private readonly _searchFilterValue$: ReplaySubject<string> = new ReplaySubject<string>();
|
|
20
|
+
|
|
21
|
+
public readonly selectedSavedFilter = this._selectedSavedFilter.asObservable();
|
|
22
|
+
public readonly searchFilterValue$ = this._searchFilterValue$.asObservable();
|
|
23
|
+
|
|
24
|
+
public readonly pageStorageKey = `@page/${this.modulePath}`;
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
|
|
29
|
+
this._transmitter?.subscribeOnApplyFormValues(this.gqlValues$);
|
|
30
|
+
this._cachePage();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private _cachePage(): void {
|
|
34
|
+
this.limit$.pipe(filter(isNonNull), take(1)).subscribe((limit) => {
|
|
35
|
+
const cachedPage = localStorage.getItem(this.pageStorageKey);
|
|
36
|
+
|
|
37
|
+
if (cachedPage) {
|
|
38
|
+
const page = Number(cachedPage);
|
|
39
|
+
this.setPage(page);
|
|
40
|
+
this.setOffset(limit * (page - 1));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
this.page$.pipe(skip(1), takeUntilDestroyed(this.destroyRef)).subscribe((page) => {
|
|
45
|
+
localStorage.setItem(this.pageStorageKey, page.toString());
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
this._subscribeOnNavigateToOtherModules();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private _subscribeOnNavigateToOtherModules(): void {
|
|
52
|
+
this.router.events
|
|
53
|
+
.pipe(
|
|
54
|
+
rxjsFilter(
|
|
55
|
+
(event) =>
|
|
56
|
+
event instanceof NavigationStart &&
|
|
57
|
+
getFirstSegmentOfPathName(event.url) !== this.modulePath
|
|
58
|
+
),
|
|
59
|
+
takeUntilDestroyed(this.destroyRef)
|
|
60
|
+
)
|
|
61
|
+
.subscribe(() => {
|
|
62
|
+
localStorage.removeItem(this.pageStorageKey);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public setSelectedSavedFilter(value: ITpUserSettings | null): void {
|
|
67
|
+
this._selectedSavedFilter.next(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public setSearchFilterValue(value: string): void {
|
|
71
|
+
this._searchFilterValue$.next(value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public getSelectedSavedFilter(): ITpUserSettings | null {
|
|
75
|
+
return this._selectedSavedFilter.getValue();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public override onDestroy(): void {
|
|
79
|
+
this._selectedSavedFilter.complete();
|
|
80
|
+
this._isFilterNameChanged$.complete();
|
|
81
|
+
this._searchFilterValue$.complete();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Injectable, OnDestroy } from '@angular/core';
|
|
2
|
+
import { filter, map, Observable, Subject, takeUntil } from 'rxjs';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
import { IInputControl } from '../../types/inputs.types';
|
|
5
|
+
import { FormGroupWrapper } from '../../core/form-group-wrapper/form-group-wrapper';
|
|
6
|
+
import { distinctUntilChangedJSONs } from '../../utils';
|
|
7
|
+
import { ITpUserSettingsSettingsFilter } from '../../types/register-base.types';
|
|
8
|
+
|
|
9
|
+
export const FILTERS_QUERY_PARAMS_KEY = 'filters';
|
|
10
|
+
export const FILTERS_QUERY_PARAMS_VALUE_EMPTY = 'empty';
|
|
11
|
+
export const SEARCH_QUERY_PARAMS_KEY = 'search';
|
|
12
|
+
|
|
13
|
+
@Injectable()
|
|
14
|
+
export class FiltersTransmitService implements OnDestroy {
|
|
15
|
+
protected readonly _unsubscribe$ = new Subject<void>();
|
|
16
|
+
|
|
17
|
+
protected formGroup?: FormGroupWrapper<any>;
|
|
18
|
+
protected searchInput?: IInputControl<string | null>;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
private readonly _router: Router,
|
|
22
|
+
private readonly _route: ActivatedRoute
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
public setForm(formGroup: FormGroupWrapper<any>): void {
|
|
26
|
+
this.formGroup = formGroup;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public setSearchInput(searchInput: IInputControl<string | null> | undefined): void {
|
|
30
|
+
this.searchInput = searchInput;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public subscribeOnApplyFormValues(observable: Observable<unknown>): void {
|
|
34
|
+
observable
|
|
35
|
+
.pipe(
|
|
36
|
+
distinctUntilChangedJSONs(),
|
|
37
|
+
filter(() => !!this.formGroup),
|
|
38
|
+
map(() => this.formGroup!),
|
|
39
|
+
takeUntil(this._unsubscribe$)
|
|
40
|
+
)
|
|
41
|
+
.subscribe((formGroup) => {
|
|
42
|
+
const filtersEmpty = Object.values(formGroup.getRawValue()).every((val) => val === null);
|
|
43
|
+
const filters = filtersEmpty ? FILTERS_QUERY_PARAMS_VALUE_EMPTY : this.stringifyValues;
|
|
44
|
+
const search = this.searchInput?.getRawValue() || undefined;
|
|
45
|
+
|
|
46
|
+
this._setQueryParams({
|
|
47
|
+
[SEARCH_QUERY_PARAMS_KEY]: search,
|
|
48
|
+
[FILTERS_QUERY_PARAMS_KEY]: filters,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public get stringifyValues(): string | undefined {
|
|
54
|
+
const values = Object.entries(this.formGroup?.controls ?? {})
|
|
55
|
+
.map(([id, abstractControl]) => {
|
|
56
|
+
const control = abstractControl as IInputControl;
|
|
57
|
+
const value = control.saved_value$.getValue();
|
|
58
|
+
const savedValue = value === null ? null : value;
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
id,
|
|
62
|
+
value: savedValue,
|
|
63
|
+
};
|
|
64
|
+
})
|
|
65
|
+
.filter(({ value }) => value !== null);
|
|
66
|
+
|
|
67
|
+
if (values.length > 0) {
|
|
68
|
+
return JSON.stringify(values);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public get filters(): ITpUserSettingsSettingsFilter[] | undefined {
|
|
75
|
+
const param = this._route.snapshot.queryParams[FILTERS_QUERY_PARAMS_KEY];
|
|
76
|
+
|
|
77
|
+
if (param === FILTERS_QUERY_PARAMS_VALUE_EMPTY) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (param) {
|
|
82
|
+
return JSON.parse(param);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public get search(): string | undefined {
|
|
89
|
+
return this._route.snapshot.queryParams[SEARCH_QUERY_PARAMS_KEY];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private _setQueryParams(queryParams: Record<string, string | undefined>): void {
|
|
93
|
+
this._router.navigate([], {
|
|
94
|
+
relativeTo: this._route,
|
|
95
|
+
queryParams,
|
|
96
|
+
queryParamsHandling: 'merge',
|
|
97
|
+
replaceUrl: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public ngOnDestroy(): void {
|
|
102
|
+
this._unsubscribe$.next();
|
|
103
|
+
this._unsubscribe$.complete();
|
|
104
|
+
}
|
|
105
|
+
}
|