ngx-register-base 1.3.0 → 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,318 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
forwardRef,
|
|
6
|
+
input,
|
|
7
|
+
OnDestroy,
|
|
8
|
+
Output,
|
|
9
|
+
signal,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import {
|
|
12
|
+
BehaviorSubject,
|
|
13
|
+
combineLatest,
|
|
14
|
+
debounceTime,
|
|
15
|
+
distinctUntilChanged,
|
|
16
|
+
filter,
|
|
17
|
+
map,
|
|
18
|
+
tap,
|
|
19
|
+
} from 'rxjs';
|
|
20
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
21
|
+
import {
|
|
22
|
+
TUI_ITEMS_HANDLERS,
|
|
23
|
+
TuiAppearance,
|
|
24
|
+
TuiDropdown,
|
|
25
|
+
TuiHint,
|
|
26
|
+
TuiLoader,
|
|
27
|
+
TuiTextfield,
|
|
28
|
+
} from '@taiga-ui/core';
|
|
29
|
+
import {
|
|
30
|
+
TuiChevron,
|
|
31
|
+
TuiComboBox,
|
|
32
|
+
TuiDataListWrapper,
|
|
33
|
+
TuiFilterByInputPipe,
|
|
34
|
+
TuiSelect,
|
|
35
|
+
} from '@taiga-ui/kit';
|
|
36
|
+
import { TuiTextfieldControllerModule } from '@taiga-ui/legacy';
|
|
37
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
38
|
+
import { NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet } from '@angular/common';
|
|
39
|
+
import { TuiStringMatcher } from '@taiga-ui/cdk';
|
|
40
|
+
import { ParamInvalidIconComponent } from '../sub-components/param-invalid-icon/param-invalid-icon.component';
|
|
41
|
+
import { FastQueryStore } from '../../../store/fast-query-store.service';
|
|
42
|
+
import { ParamSelectBase } from '../../../core/param/param-select-base';
|
|
43
|
+
import { IFilterSelectValue } from '../../../types/params.types';
|
|
44
|
+
import { PARAM_SEARCH_INPUT_DEBOUNCE_TIME_MLS } from '../../../consts/params.consts';
|
|
45
|
+
|
|
46
|
+
@Component({
|
|
47
|
+
selector: 'sproc-param-select',
|
|
48
|
+
templateUrl: './param-select.component.html',
|
|
49
|
+
styleUrls: ['./param-select.component.less'],
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
providers: [
|
|
52
|
+
FastQueryStore,
|
|
53
|
+
{
|
|
54
|
+
provide: TUI_ITEMS_HANDLERS,
|
|
55
|
+
deps: [forwardRef(() => ParamSelectComponent)],
|
|
56
|
+
useFactory: (component: ParamSelectComponent) => ({
|
|
57
|
+
stringify: component.stringify,
|
|
58
|
+
identityMatcher: component.identityMatcher,
|
|
59
|
+
disabledItemHandler: signal(() => false),
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
standalone: true,
|
|
64
|
+
imports: [
|
|
65
|
+
TuiTextfield,
|
|
66
|
+
TuiAppearance,
|
|
67
|
+
TuiTextfieldControllerModule,
|
|
68
|
+
ReactiveFormsModule,
|
|
69
|
+
TuiDataListWrapper,
|
|
70
|
+
TuiFilterByInputPipe,
|
|
71
|
+
NgTemplateOutlet,
|
|
72
|
+
NgSwitch,
|
|
73
|
+
NgSwitchCase,
|
|
74
|
+
NgSwitchDefault,
|
|
75
|
+
TuiComboBox,
|
|
76
|
+
ParamInvalidIconComponent,
|
|
77
|
+
NgIf,
|
|
78
|
+
TuiSelect,
|
|
79
|
+
TuiDropdown,
|
|
80
|
+
TuiLoader,
|
|
81
|
+
TuiChevron,
|
|
82
|
+
TuiHint,
|
|
83
|
+
],
|
|
84
|
+
})
|
|
85
|
+
export class ParamSelectComponent
|
|
86
|
+
extends ParamSelectBase<IFilterSelectValue | null, IFilterSelectValue | null>
|
|
87
|
+
implements OnDestroy
|
|
88
|
+
{
|
|
89
|
+
override placeholder = input('Выберите значение');
|
|
90
|
+
readonly stringify = input<(item: IFilterSelectValue) => string>((item) =>
|
|
91
|
+
String(item.name ?? '')
|
|
92
|
+
);
|
|
93
|
+
readonly identityMatcher = input<(a: IFilterSelectValue, b: IFilterSelectValue) => boolean>(
|
|
94
|
+
(a, b) => a.id === b.id
|
|
95
|
+
);
|
|
96
|
+
readonly matcher = input<TuiStringMatcher<IFilterSelectValue>>(
|
|
97
|
+
(item: IFilterSelectValue, query: string) => {
|
|
98
|
+
if (!query || String(query).trim() === '') {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
return String(item?.name ?? '')
|
|
102
|
+
.toLowerCase()
|
|
103
|
+
.includes(String(query).toLowerCase());
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
override buildShowedValue = input(
|
|
107
|
+
(value: IFilterSelectValue | null): string => value?.name ?? '-'
|
|
108
|
+
);
|
|
109
|
+
public strict = input<boolean>(true);
|
|
110
|
+
|
|
111
|
+
@Output() onSelect = new EventEmitter<IFilterSelectValue>();
|
|
112
|
+
|
|
113
|
+
protected readonly search$ = new BehaviorSubject<string | undefined>(undefined);
|
|
114
|
+
|
|
115
|
+
public override afterViewInit(): void {
|
|
116
|
+
this._observeFetchItems();
|
|
117
|
+
if (this.meta) {
|
|
118
|
+
this._subscribeOnMetaChanges();
|
|
119
|
+
this._subscribeOnSearch();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public ngOnDestroy(): void {
|
|
124
|
+
this.search$.complete();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
private _subscribeOnSearch(): void {
|
|
128
|
+
this.search$
|
|
129
|
+
.pipe(debounceTime(PARAM_SEARCH_INPUT_DEBOUNCE_TIME_MLS), takeUntilDestroyed(this.dr))
|
|
130
|
+
.subscribe((searchValue: string | undefined) => {
|
|
131
|
+
this.fetchItems(searchValue);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private _observeFetchItems(): void {
|
|
136
|
+
this._observeValueFill();
|
|
137
|
+
this._observeEmptyValue();
|
|
138
|
+
this._observeValueFetch();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private _observeValueFill(): void {
|
|
142
|
+
this.control.valueChanges
|
|
143
|
+
.pipe(
|
|
144
|
+
filter(Boolean),
|
|
145
|
+
filter((value) => !value.name),
|
|
146
|
+
takeUntilDestroyed(this.dr)
|
|
147
|
+
)
|
|
148
|
+
.subscribe((value) => {
|
|
149
|
+
const id = this._getIdFromValue(value);
|
|
150
|
+
const filledValue = this.items.find((item) => item.id === id);
|
|
151
|
+
|
|
152
|
+
if (filledValue) {
|
|
153
|
+
this.control.setValue(filledValue, { emitEvent: false });
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private _observeEmptyValue(): void {
|
|
159
|
+
this.control.valueChanges
|
|
160
|
+
.pipe(
|
|
161
|
+
filter((value) => value === null),
|
|
162
|
+
takeUntilDestroyed(this.dr)
|
|
163
|
+
)
|
|
164
|
+
.subscribe(() => {
|
|
165
|
+
this.search$.next('');
|
|
166
|
+
this.fetchItems();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private _observeValueFetch(): void {
|
|
171
|
+
combineLatest([
|
|
172
|
+
this.control.valueChanges.pipe(
|
|
173
|
+
map((value) => value?.id ?? null),
|
|
174
|
+
distinctUntilChanged(),
|
|
175
|
+
filter((id) => !this.items.some((item) => item.id === id))
|
|
176
|
+
),
|
|
177
|
+
this.meta$,
|
|
178
|
+
])
|
|
179
|
+
.pipe(takeUntilDestroyed(this.dr))
|
|
180
|
+
.subscribe(() => this.fetchItems());
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
private _getIdFromValue(value: unknown): string | number | null {
|
|
184
|
+
return typeof value === 'object' && value !== null
|
|
185
|
+
? ((value as { id?: string | number }).id ?? null)
|
|
186
|
+
: (value as string | number | null);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private _subscribeOnMetaChanges(): void {
|
|
190
|
+
this.meta$.pipe(takeUntilDestroyed(this.dr)).subscribe(() => {
|
|
191
|
+
this.fetchItems();
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
protected fetchItems(searchValue?: string): void {
|
|
196
|
+
const { idField, valueField } = this.metaFields;
|
|
197
|
+
|
|
198
|
+
if (!this.meta?.table?.name || idField === null || valueField === null) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const selectedItemIDs = this._getSelectedItemIDs(searchValue);
|
|
203
|
+
|
|
204
|
+
this.loading = true;
|
|
205
|
+
const where = this.buildWhere(searchValue);
|
|
206
|
+
const selectedItemIdsWhere = this._buildSelectedItemIdsWhere(where, selectedItemIDs, idField);
|
|
207
|
+
|
|
208
|
+
this.store
|
|
209
|
+
.getResults(
|
|
210
|
+
{
|
|
211
|
+
table: this.meta.table,
|
|
212
|
+
where,
|
|
213
|
+
order_by: this.meta.order_by,
|
|
214
|
+
offset: this.meta.offset,
|
|
215
|
+
distinct_on: this.meta.distinct_on,
|
|
216
|
+
subquery: this.meta.subquery,
|
|
217
|
+
limit: this.meta.limit ?? this.limit,
|
|
218
|
+
},
|
|
219
|
+
true,
|
|
220
|
+
selectedItemIdsWhere
|
|
221
|
+
)
|
|
222
|
+
.pipe(
|
|
223
|
+
tap((data) => {
|
|
224
|
+
this._handleResults(data, idField, valueField, selectedItemIDs);
|
|
225
|
+
}),
|
|
226
|
+
tap(() => {
|
|
227
|
+
this.loading = false;
|
|
228
|
+
this.cdr.markForCheck();
|
|
229
|
+
}),
|
|
230
|
+
takeUntilDestroyed(this.dr)
|
|
231
|
+
)
|
|
232
|
+
.subscribe();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
private _getSelectedItemIDs(searchValue?: string): string[] | undefined {
|
|
236
|
+
if (this.value && (!searchValue || searchValue === '')) {
|
|
237
|
+
const idField = this.meta?.table.idField ?? 'id';
|
|
238
|
+
return [this.value[idField]];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
private _buildSelectedItemIdsWhere(
|
|
245
|
+
where: any,
|
|
246
|
+
selectedItemIDs: string[] | undefined,
|
|
247
|
+
idField: string
|
|
248
|
+
): object | undefined {
|
|
249
|
+
if (where && selectedItemIDs && selectedItemIDs.length > 0 && selectedItemIDs[0]) {
|
|
250
|
+
return { _and: [{ [idField]: { _in: selectedItemIDs } }, where] };
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
private _handleResults(
|
|
257
|
+
data: any,
|
|
258
|
+
idField: string,
|
|
259
|
+
valueField: string,
|
|
260
|
+
selectedItemIDs: string[] | undefined
|
|
261
|
+
): void {
|
|
262
|
+
this.items = data.data.map((item: any) => ({
|
|
263
|
+
...item,
|
|
264
|
+
id: item[idField] ?? '',
|
|
265
|
+
name: this._getNameFromField(item, valueField),
|
|
266
|
+
}));
|
|
267
|
+
|
|
268
|
+
this._updateControlValues(data, idField, valueField, selectedItemIDs);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
private _getNameFromField(item: any, field: string): string {
|
|
272
|
+
if (field.includes('.')) {
|
|
273
|
+
return this._getNameFromDeepField(item, field);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return this.formatShowedValue(item, field);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
private _getNameFromDeepField(item: any, field: string): string {
|
|
280
|
+
const deepFields = field.split('.');
|
|
281
|
+
let tempObject = { ...item };
|
|
282
|
+
|
|
283
|
+
for (const deepField of deepFields) {
|
|
284
|
+
tempObject = tempObject[deepField];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return tempObject;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
private _updateControlValues(
|
|
291
|
+
data: any,
|
|
292
|
+
idField: string,
|
|
293
|
+
valueField: string,
|
|
294
|
+
selectedItemIDs: string[] | undefined
|
|
295
|
+
): void {
|
|
296
|
+
const idSelectedValue = this.value?.[idField];
|
|
297
|
+
const availableItems =
|
|
298
|
+
data.selectedIdsQuery
|
|
299
|
+
?.filter((item: any) => idSelectedValue === item[idField])
|
|
300
|
+
.map((item: any) => ({
|
|
301
|
+
...item,
|
|
302
|
+
id: item[idField] ?? '',
|
|
303
|
+
name: this._getNameFromField(item, valueField),
|
|
304
|
+
})) ?? [];
|
|
305
|
+
|
|
306
|
+
if (selectedItemIDs && selectedItemIDs.length > 0 && availableItems.length > 0) {
|
|
307
|
+
const [item] = availableItems;
|
|
308
|
+
this.control?.setValue(item);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const itemsThatDontExist = availableItems.filter(
|
|
312
|
+
(new_item: any) => !this.items.some((value: any) => value.id === new_item.id)
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
this.items.push(...itemsThatDontExist);
|
|
316
|
+
this.itemsChange.emit(this.items);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div class="param-switcher">
|
|
2
|
+
<div *ngIf="label" class="label">
|
|
3
|
+
<span *ngIf="label" class="label__text">{{ label }}</span>
|
|
4
|
+
<span *ngIf="required" class="label--required">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<prizm-switcher [formControl]="control" [switchers]="switchers"></prizm-switcher>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@import 'fonts';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
.param-switcher {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
|
|
9
|
+
.label {
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
|
|
13
|
+
.input-label;
|
|
14
|
+
|
|
15
|
+
&__text {
|
|
16
|
+
color: var(--main-black);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--required {
|
|
20
|
+
color: var(--brand-danger);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
::ng-deep {
|
|
25
|
+
prizm-switcher {
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex: 1;
|
|
29
|
+
|
|
30
|
+
prizm-switcher-item {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1;
|
|
33
|
+
|
|
34
|
+
button {
|
|
35
|
+
height: 24px !important;
|
|
36
|
+
min-height: 24px !important;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex: 1;
|
|
39
|
+
|
|
40
|
+
prizm-wrapper {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
padding: unset !important;
|
|
45
|
+
border: 1px solid var(--chip-background);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
+
import { PrizmSwitcherItem } from '@prizm-ui/components';
|
|
3
|
+
import { ParamBase } from '../../../core';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'sproc-param-switcher',
|
|
7
|
+
templateUrl: './param-switcher.component.html',
|
|
8
|
+
styleUrls: ['./param-switcher.component.less'],
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
})
|
|
11
|
+
export class ParamSwitcherComponent extends ParamBase<number, number> {
|
|
12
|
+
@Input() switchers: PrizmSwitcherItem[] = [];
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PrizmSwitcherItem } from '@prizm-ui/components';
|
|
2
|
+
import { ESwitcherValue } from '../types/param-switcher-date-time-range.types';
|
|
3
|
+
|
|
4
|
+
export const SwitcherItems: PrizmSwitcherItem[] = [
|
|
5
|
+
{
|
|
6
|
+
id: ESwitcherValue.MONTH,
|
|
7
|
+
title: 'мес',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: ESwitcherValue.FIRST,
|
|
11
|
+
title: '1 кв',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: ESwitcherValue.SECOND,
|
|
15
|
+
title: '2 кв',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: ESwitcherValue.THIRD,
|
|
19
|
+
title: '3 кв',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: ESwitcherValue.FOURTH,
|
|
23
|
+
title: '4 кв',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: ESwitcherValue.YEAR,
|
|
27
|
+
title: 'год',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="param-custom-template">
|
|
2
|
+
<div *ngIf="label" class="label">
|
|
3
|
+
<span *ngIf="label" class="label__text">{{ label }}</span>
|
|
4
|
+
<span *ngIf="required" class="label--required">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<prizm-switcher [switchers]="switchers" [formControl]="switcherControl"></prizm-switcher>
|
|
8
|
+
|
|
9
|
+
<prizm-input-layout class="flex-shrink--zero" size="s" [forceClear]="forceClear">
|
|
10
|
+
<prizm-input-layout-date-time-range
|
|
11
|
+
[placeholder]="placeholder()"
|
|
12
|
+
[timeMode]="timeMode"
|
|
13
|
+
[maxLength]="maxLength"
|
|
14
|
+
[min]="$any(min)"
|
|
15
|
+
[max]="$any(max)"
|
|
16
|
+
[formControl]="control"
|
|
17
|
+
></prizm-input-layout-date-time-range>
|
|
18
|
+
</prizm-input-layout>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import 'fonts';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
.param-custom-template {
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
padding: 0 2px;
|
|
9
|
+
gap: 8px;
|
|
10
|
+
|
|
11
|
+
.label {
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: 4px;
|
|
14
|
+
|
|
15
|
+
.input-label;
|
|
16
|
+
|
|
17
|
+
&__text {
|
|
18
|
+
color: var(--main-black);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--required {
|
|
22
|
+
color: var(--brand-danger);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
::ng-deep {
|
|
27
|
+
prizm-switcher {
|
|
28
|
+
.container {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex: 1;
|
|
31
|
+
|
|
32
|
+
prizm-switcher-item {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex: 1;
|
|
35
|
+
|
|
36
|
+
button {
|
|
37
|
+
height: 24px !important;
|
|
38
|
+
min-height: 24px !important;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex: 1;
|
|
41
|
+
|
|
42
|
+
prizm-wrapper {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
padding: unset !important;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.prizm-input-form:not(.prizm-input-form-focused) {
|
|
54
|
+
background: inherit;
|
|
55
|
+
border: none;
|
|
56
|
+
border-bottom: 1px solid #d7d8df;
|
|
57
|
+
padding: 0 3.5px 0 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.prizm-input-form .prizm-input-form-focused {
|
|
61
|
+
background: inherit;
|
|
62
|
+
border: 1px !important;
|
|
63
|
+
border-bottom: 1px solid #d7d8df;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.prizm-input-form-inner {
|
|
67
|
+
min-height: 32px;
|
|
68
|
+
height: 32px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
input {
|
|
72
|
+
.input-text-12px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import {
|
|
4
|
+
PrizmDateTimeRange,
|
|
5
|
+
PrizmDay,
|
|
6
|
+
PrizmDayRange,
|
|
7
|
+
PrizmTime,
|
|
8
|
+
PrizmTimeRange,
|
|
9
|
+
} from '@prizm-ui/components';
|
|
10
|
+
import { SwitcherItems } from './consts/param-switcher-date-time-range.consts';
|
|
11
|
+
import { ESwitcherValue } from './types/param-switcher-date-time-range.types';
|
|
12
|
+
import { ParamDateTimeRangeComponent } from '../param-date-time-range/param-date-time-range.component';
|
|
13
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
|
+
import { EMonth } from '../../../consts/month.consts';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'sproc-param-switcher-date-time-range',
|
|
18
|
+
templateUrl: './param-switcher-date-time-range.component.html',
|
|
19
|
+
styleUrls: ['./param-switcher-date-time-range.component.less'],
|
|
20
|
+
})
|
|
21
|
+
export class ParamSwitcherDateTimeRangeComponent extends ParamDateTimeRangeComponent {
|
|
22
|
+
protected switcherControl = new FormControl<ESwitcherValue | null>(null);
|
|
23
|
+
protected switchers = SwitcherItems;
|
|
24
|
+
|
|
25
|
+
public override onInit(): void {
|
|
26
|
+
super.onInit();
|
|
27
|
+
this._subscribeOnSwitcher();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public override afterViewInit(): void {
|
|
31
|
+
super.afterViewInit();
|
|
32
|
+
this.switcherControl.setValue(ESwitcherValue.MONTH);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private _subscribeOnSwitcher(): void {
|
|
36
|
+
this.switcherControl.valueChanges
|
|
37
|
+
.pipe(takeUntilDestroyed(this.dr))
|
|
38
|
+
.subscribe((switcherValue) => {
|
|
39
|
+
const now = new Date();
|
|
40
|
+
const year = now.getFullYear();
|
|
41
|
+
const month: EMonth = now.getMonth();
|
|
42
|
+
|
|
43
|
+
let controlValue: PrizmDateTimeRange | null = null;
|
|
44
|
+
|
|
45
|
+
if (switcherValue === ESwitcherValue.MONTH) {
|
|
46
|
+
controlValue = this._calcMonthRange(year, month);
|
|
47
|
+
} else if (switcherValue === ESwitcherValue.FIRST) {
|
|
48
|
+
controlValue = this._calcFirstQuarterRange(year);
|
|
49
|
+
} else if (switcherValue === ESwitcherValue.SECOND) {
|
|
50
|
+
controlValue = this._calcSecondQuarterRange(year);
|
|
51
|
+
} else if (switcherValue === ESwitcherValue.THIRD) {
|
|
52
|
+
controlValue = this._calcThirdQuarterRange(year);
|
|
53
|
+
} else if (switcherValue === ESwitcherValue.FOURTH) {
|
|
54
|
+
controlValue = this._calcFourthQuarterRange(year);
|
|
55
|
+
} else if (switcherValue === ESwitcherValue.YEAR) {
|
|
56
|
+
controlValue = this._calcYearRange(year);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.control.setValue(controlValue);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private _calcMonthRange(year: number, month: EMonth): PrizmDateTimeRange {
|
|
64
|
+
const from = new Date(year, month, 1);
|
|
65
|
+
const to = new Date(year, month);
|
|
66
|
+
to.setMonth(to.getMonth() + 1);
|
|
67
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
68
|
+
|
|
69
|
+
return new PrizmDateTimeRange(
|
|
70
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
71
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
private _calcFirstQuarterRange(year: number): PrizmDateTimeRange {
|
|
76
|
+
const from = new Date(year, EMonth.JAN, 1);
|
|
77
|
+
const to = new Date(year, EMonth.MAR);
|
|
78
|
+
to.setMonth(to.getMonth() + 1);
|
|
79
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
80
|
+
|
|
81
|
+
return new PrizmDateTimeRange(
|
|
82
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
83
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private _calcSecondQuarterRange(year: number): PrizmDateTimeRange {
|
|
88
|
+
const from = new Date(year, EMonth.APR, 1);
|
|
89
|
+
const to = new Date(year, EMonth.JUN);
|
|
90
|
+
to.setMonth(to.getMonth() + 1);
|
|
91
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
92
|
+
|
|
93
|
+
return new PrizmDateTimeRange(
|
|
94
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
95
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private _calcThirdQuarterRange(year: number): PrizmDateTimeRange {
|
|
100
|
+
const from = new Date(year, EMonth.JUL, 1);
|
|
101
|
+
const to = new Date(year, EMonth.SEP);
|
|
102
|
+
to.setMonth(to.getMonth() + 1);
|
|
103
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
104
|
+
|
|
105
|
+
return new PrizmDateTimeRange(
|
|
106
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
107
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private _calcFourthQuarterRange(year: number): PrizmDateTimeRange {
|
|
112
|
+
const from = new Date(year, EMonth.OCT, 1);
|
|
113
|
+
const to = new Date(year, EMonth.DEC);
|
|
114
|
+
to.setMonth(to.getMonth() + 1);
|
|
115
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
116
|
+
|
|
117
|
+
return new PrizmDateTimeRange(
|
|
118
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
119
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private _calcYearRange(year: number): PrizmDateTimeRange {
|
|
124
|
+
const from = new Date(year, EMonth.JAN, 1);
|
|
125
|
+
const to = new Date(year, EMonth.DEC);
|
|
126
|
+
to.setMonth(to.getMonth() + 1);
|
|
127
|
+
to.setMilliseconds(to.getMilliseconds() - 1);
|
|
128
|
+
|
|
129
|
+
return new PrizmDateTimeRange(
|
|
130
|
+
new PrizmDayRange(PrizmDay.fromLocalNativeDate(from), PrizmDay.fromLocalNativeDate(to)),
|
|
131
|
+
new PrizmTimeRange(PrizmTime.fromLocalNativeDate(from), PrizmTime.fromLocalNativeDate(to))
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|