ngx-register-base 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/checkbox-selector/checkbox-selector.component.mjs +129 -0
- package/esm2022/lib/components/checkbox-selector/checkbox-selector.types.mjs +8 -0
- package/esm2022/lib/components/column-settings/column-settings.component.mjs +249 -0
- package/esm2022/lib/components/column-settings/components/column-settings-template/column-settings-template.component.mjs +80 -0
- package/esm2022/lib/components/column-settings/consts/column-settings.consts.mjs +10 -0
- package/esm2022/lib/components/column-settings/index.mjs +3 -0
- package/esm2022/lib/components/column-settings/types/column-settings.types.mjs +7 -0
- package/esm2022/lib/components/divider/divider.component.mjs +16 -0
- package/esm2022/lib/components/filter-button/filter-button.component.mjs +19 -0
- package/esm2022/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.mjs +31 -0
- package/esm2022/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.mjs +57 -0
- package/esm2022/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.mjs +110 -0
- package/esm2022/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.mjs +130 -0
- package/esm2022/lib/components/filters/components/filter-list/filter-list.service.mjs +89 -0
- package/esm2022/lib/components/filters/components/filter-list/filters-section/filters-section.component.mjs +41 -0
- package/esm2022/lib/components/filters/components/filter-list.module.mjs +45 -0
- package/esm2022/lib/components/filters/index.mjs +3 -0
- package/esm2022/lib/components/filters/register-table-filter.component.mjs +155 -0
- package/esm2022/lib/components/filters/register-table-filter.module.mjs +39 -0
- package/esm2022/lib/components/index.mjs +11 -0
- package/esm2022/lib/components/inputs/index.mjs +20 -0
- package/esm2022/lib/components/inputs/inputs.module.mjs +166 -0
- package/esm2022/lib/components/inputs/param-calendar-year/param-calendar-year.component.mjs +45 -0
- package/esm2022/lib/components/inputs/param-custom/param-custom.component.mjs +12 -0
- package/esm2022/lib/components/inputs/param-date/param-date.component.mjs +76 -0
- package/esm2022/lib/components/inputs/param-date-range/param-date-range.component.mjs +60 -0
- package/esm2022/lib/components/inputs/param-date-time/param-date-time.component.mjs +86 -0
- package/esm2022/lib/components/inputs/param-date-time-range/param-date-time-range.component.mjs +95 -0
- package/esm2022/lib/components/inputs/param-month/param-month.component.mjs +50 -0
- package/esm2022/lib/components/inputs/param-month-range/param-month-range.component.mjs +62 -0
- package/esm2022/lib/components/inputs/param-multi-select/param-multi-select.component.mjs +309 -0
- package/esm2022/lib/components/inputs/param-select/param-select.component.mjs +225 -0
- package/esm2022/lib/components/inputs/param-switcher/param-switcher.component.mjs +21 -0
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.mjs +28 -0
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/index.mjs +3 -0
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.mjs +105 -0
- package/esm2022/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.mjs +10 -0
- package/esm2022/lib/components/inputs/param-text/param-text.component.mjs +40 -0
- package/esm2022/lib/components/inputs/param-textarea/param-textarea.component.mjs +38 -0
- package/esm2022/lib/components/inputs/param-toggle/param-toggle.component.mjs +20 -0
- package/esm2022/lib/components/inputs/param-tree/consts/param-tree.consts.mjs +37 -0
- package/esm2022/lib/components/inputs/param-tree/index.mjs +8 -0
- package/esm2022/lib/components/inputs/param-tree/param-tree.component.mjs +207 -0
- package/esm2022/lib/components/inputs/param-tree/services/param-tree.service.mjs +116 -0
- package/esm2022/lib/components/inputs/param-tree/services/sync-tree-loader.service.mjs +20 -0
- package/esm2022/lib/components/inputs/param-tree/tokens/param-tree.tokens.mjs +3 -0
- package/esm2022/lib/components/inputs/param-tree/types/param-tree.types.mjs +2 -0
- package/esm2022/lib/components/inputs/param-tree/utils/param-tree.utils.mjs +9 -0
- package/esm2022/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.mjs +80 -0
- package/esm2022/lib/components/inputs/param-tree-select/param-tree-select.component.mjs +85 -0
- package/esm2022/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.mjs +15 -0
- package/esm2022/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.mjs +12 -0
- package/esm2022/lib/components/menu-constructor/index.mjs +5 -0
- package/esm2022/lib/components/menu-constructor/sproc-menu-constructor.component.mjs +559 -0
- package/esm2022/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.mjs +3 -0
- package/esm2022/lib/components/menu-constructor/store/sproc-menu-constructor.consts.mjs +5 -0
- package/esm2022/lib/components/menu-constructor/store/sproc-menu.tokens.mjs +3 -0
- package/esm2022/lib/components/page-menu/index.mjs +6 -0
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.consts.mjs +9 -0
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.schema.mjs +2 -0
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.tokens.mjs +4 -0
- package/esm2022/lib/components/page-menu/schema/sproc-page-menu.types.mjs +3 -0
- package/esm2022/lib/components/page-menu/sproc-page-menu.component.mjs +275 -0
- package/esm2022/lib/components/paginator/paginator.component.mjs +159 -0
- package/esm2022/lib/components/paginator/types/paginator.types.mjs +2 -0
- package/esm2022/lib/components/register-table/consts/register-table.consts.mjs +4 -0
- package/esm2022/lib/components/register-table/directives/cell-template.directive.mjs +19 -0
- package/esm2022/lib/components/register-table/directives/header-template.directive.mjs +18 -0
- package/esm2022/lib/components/register-table/index.mjs +4 -0
- package/esm2022/lib/components/register-table/model/schema.mjs +10 -0
- package/esm2022/lib/components/register-table/pipes/class-by-type.pipe.mjs +33 -0
- package/esm2022/lib/components/register-table/pipes/sticky-column.pipe.mjs +17 -0
- package/esm2022/lib/components/register-table/register-table.component.mjs +544 -0
- package/esm2022/lib/components/reset-settings-form/reset-settings-form.component.mjs +18 -0
- package/esm2022/lib/components/search-input/search-input.component.mjs +28 -0
- package/esm2022/lib/components/sliding-panel/sliding-panel.component.mjs +48 -0
- package/esm2022/lib/components/sliding-panel/sliding-panel.module.mjs +19 -0
- package/esm2022/lib/consts/date-time.consts.mjs +2 -0
- package/esm2022/lib/consts/index.mjs +4 -0
- package/esm2022/lib/consts/inputs.consts.mjs +4 -0
- package/esm2022/lib/consts/month.consts.mjs +77 -0
- package/esm2022/lib/consts/params.consts.mjs +2 -0
- package/esm2022/lib/consts/register-base.consts.mjs +26 -0
- package/esm2022/lib/core/form-group-wrapper/errors-consts.mjs +8 -0
- package/esm2022/lib/core/form-group-wrapper/form-group-wrapper.mjs +81 -0
- package/esm2022/lib/core/form-group-wrapper/index.mjs +2 -0
- package/esm2022/lib/core/index.mjs +5 -0
- package/esm2022/lib/core/input-control/index.mjs +2 -0
- package/esm2022/lib/core/input-control/input-control.mjs +11 -0
- package/esm2022/lib/core/param/index.mjs +6 -0
- package/esm2022/lib/core/param/param-base.mjs +215 -0
- package/esm2022/lib/core/param/param-date-base.mjs +26 -0
- package/esm2022/lib/core/param/param-select-base.mjs +114 -0
- package/esm2022/lib/core/param/param-text-base.mjs +25 -0
- package/esm2022/lib/core/param/param.tokens.mjs +4 -0
- package/esm2022/lib/core/register-base/index.mjs +3 -0
- package/esm2022/lib/core/register-base/register-base.mjs +575 -0
- package/esm2022/lib/core/register-base/register-base.store.mjs +43 -0
- package/esm2022/lib/directives/date/date-time.types.mjs +34 -0
- package/esm2022/lib/directives/date/format-date.pipe.mjs +33 -0
- package/esm2022/lib/directives/index.mjs +3 -0
- package/esm2022/lib/directives/number/number-only.directive.mjs +41 -0
- package/esm2022/lib/directives/sticky/index.mjs +3 -0
- package/esm2022/lib/directives/sticky/sticky-relative.directive.mjs +32 -0
- package/esm2022/lib/directives/sticky/sticky-relative.service.mjs +32 -0
- package/esm2022/lib/directives/sticky/sticky.directive.mjs +169 -0
- package/esm2022/lib/services/date-time.service.mjs +314 -0
- package/esm2022/lib/services/dialog/dialog.service.mjs +53 -0
- package/esm2022/lib/services/dialog/dialog.types.mjs +2 -0
- package/esm2022/lib/services/dialog/index.mjs +3 -0
- package/esm2022/lib/services/dom-intersection.service.mjs +22 -0
- package/esm2022/lib/services/filter/filters-state.service.mjs +65 -0
- package/esm2022/lib/services/filter/filters-transmit.service.mjs +82 -0
- package/esm2022/lib/services/filter/filters.service.mjs +23 -0
- package/esm2022/lib/services/index.mjs +8 -0
- package/esm2022/lib/services/inputs-state.service.mjs +130 -0
- package/esm2022/lib/services/inputs.service.mjs +88 -0
- package/esm2022/lib/services/key-pressed.service.mjs +37 -0
- package/esm2022/lib/services/resize-window-observer.service.mjs +33 -0
- package/esm2022/lib/services/selected-objects-state.service.mjs +123 -0
- package/esm2022/lib/store/fast-query-store.service.mjs +110 -0
- package/esm2022/lib/store/index.mjs +2 -0
- package/esm2022/lib/types/event.types.mjs +2 -0
- package/esm2022/lib/types/hasura.types.mjs +2 -0
- package/esm2022/lib/types/index.mjs +7 -0
- package/esm2022/lib/types/inputs.types.mjs +19 -0
- package/esm2022/lib/types/params.types.mjs +2 -0
- package/esm2022/lib/types/register-base.types.mjs +6 -0
- package/esm2022/lib/types/sub-types.mjs +2 -0
- package/esm2022/lib/types/user-profile.types.mjs +2 -0
- package/esm2022/lib/utils/functions.mjs +10 -0
- package/esm2022/lib/utils/get-url-segment.mjs +35 -0
- package/esm2022/lib/utils/index.mjs +5 -0
- package/esm2022/lib/utils/prizm.shared.module.mjs +284 -0
- package/esm2022/lib/utils/rxjs.mjs +28 -0
- package/esm2022/lib/utils/select-all-utils.mjs +11 -0
- package/esm2022/ngx-register-base.mjs +5 -0
- package/esm2022/public-api.mjs +9 -0
- package/fesm2022/ngx-register-base.mjs +7479 -0
- package/fesm2022/ngx-register-base.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/checkbox-selector/checkbox-selector.component.d.ts +33 -0
- package/lib/components/checkbox-selector/checkbox-selector.types.d.ts +7 -0
- package/lib/components/column-settings/column-settings.component.d.ts +80 -0
- package/lib/components/column-settings/components/column-settings-template/column-settings-template.component.d.ts +24 -0
- package/lib/components/column-settings/consts/column-settings.consts.d.ts +8 -0
- package/lib/components/column-settings/types/column-settings.types.d.ts +22 -0
- package/lib/components/divider/divider.component.d.ts +6 -0
- package/lib/components/filter-button/filter-button.component.d.ts +8 -0
- package/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.d.ts +14 -0
- package/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.d.ts +25 -0
- package/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.d.ts +39 -0
- package/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.d.ts +41 -0
- package/lib/components/filters/components/filter-list/filter-list.service.d.ts +20 -0
- package/lib/components/filters/components/filter-list/filters-section/filters-section.component.d.ts +15 -0
- package/lib/components/filters/components/filter-list.module.d.ts +15 -0
- package/lib/components/filters/register-table-filter.component.d.ts +40 -0
- package/lib/components/filters/register-table-filter.module.d.ts +13 -0
- package/lib/components/inputs/inputs.module.d.ts +31 -0
- package/lib/components/inputs/param-calendar-year/param-calendar-year.component.d.ts +19 -0
- package/lib/components/inputs/param-custom/param-custom.component.d.ts +6 -0
- package/lib/components/inputs/param-date/param-date.component.d.ts +20 -0
- package/lib/components/inputs/param-date-range/param-date-range.component.d.ts +26 -0
- package/lib/components/inputs/param-date-time/param-date-time.component.d.ts +25 -0
- package/lib/components/inputs/param-date-time-range/param-date-time-range.component.d.ts +28 -0
- package/lib/components/inputs/param-month/param-month.component.d.ts +18 -0
- package/lib/components/inputs/param-month-range/param-month-range.component.d.ts +21 -0
- package/lib/components/inputs/param-multi-select/param-multi-select.component.d.ts +46 -0
- package/lib/components/inputs/param-select/param-select.component.d.ts +34 -0
- package/lib/components/inputs/param-switcher/param-switcher.component.d.ts +8 -0
- package/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.d.ts +2 -0
- package/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.d.ts +19 -0
- package/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.d.ts +8 -0
- package/lib/components/inputs/param-text/param-text.component.d.ts +10 -0
- package/lib/components/inputs/param-textarea/param-textarea.component.d.ts +10 -0
- package/lib/components/inputs/param-toggle/param-toggle.component.d.ts +9 -0
- package/lib/components/inputs/param-tree/consts/param-tree.consts.d.ts +7 -0
- package/lib/components/inputs/param-tree/param-tree.component.d.ts +41 -0
- package/lib/components/inputs/param-tree/services/param-tree.service.d.ts +37 -0
- package/lib/components/inputs/param-tree/services/sync-tree-loader.service.d.ts +10 -0
- package/{src/lib/components/inputs/param-tree/tokens/param-tree.tokens.ts → lib/components/inputs/param-tree/tokens/param-tree.tokens.d.ts} +1 -2
- package/lib/components/inputs/param-tree/types/param-tree.types.d.ts +32 -0
- package/lib/components/inputs/param-tree/utils/param-tree.utils.d.ts +7 -0
- package/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.d.ts +31 -0
- package/lib/components/inputs/param-tree-select/param-tree-select.component.d.ts +30 -0
- package/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.d.ts +6 -0
- package/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.d.ts +5 -0
- package/lib/components/menu-constructor/sproc-menu-constructor.component.d.ts +113 -0
- package/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.d.ts +24 -0
- package/lib/components/menu-constructor/store/sproc-menu-constructor.consts.d.ts +36 -0
- package/{src/lib/components/menu-constructor/store/sproc-menu.tokens.ts → lib/components/menu-constructor/store/sproc-menu.tokens.d.ts} +1 -4
- package/lib/components/page-menu/schema/sproc-page-menu.consts.d.ts +7 -0
- package/lib/components/page-menu/schema/sproc-page-menu.schema.d.ts +30 -0
- package/lib/components/page-menu/schema/sproc-page-menu.tokens.d.ts +3 -0
- package/lib/components/page-menu/schema/sproc-page-menu.types.d.ts +36 -0
- package/lib/components/page-menu/sproc-page-menu.component.d.ts +48 -0
- package/lib/components/paginator/paginator.component.d.ts +52 -0
- package/lib/components/paginator/types/paginator.types.d.ts +15 -0
- package/lib/components/register-table/consts/register-table.consts.d.ts +3 -0
- package/lib/components/register-table/directives/cell-template.directive.d.ts +9 -0
- package/lib/components/register-table/directives/header-template.directive.d.ts +9 -0
- package/lib/components/register-table/model/schema.d.ts +52 -0
- package/lib/components/register-table/pipes/class-by-type.pipe.d.ts +8 -0
- package/lib/components/register-table/pipes/sticky-column.pipe.d.ts +7 -0
- package/lib/components/register-table/register-table.component.d.ts +165 -0
- package/lib/components/reset-settings-form/reset-settings-form.component.d.ts +9 -0
- package/lib/components/search-input/search-input.component.d.ts +11 -0
- package/lib/components/sliding-panel/sliding-panel.component.d.ts +14 -0
- package/lib/components/sliding-panel/sliding-panel.module.d.ts +9 -0
- package/lib/consts/date-time.consts.d.ts +1 -0
- package/lib/consts/index.d.ts +3 -0
- package/lib/consts/inputs.consts.d.ts +4 -0
- package/lib/consts/month.consts.d.ts +49 -0
- package/lib/consts/params.consts.d.ts +1 -0
- package/lib/consts/register-base.consts.d.ts +19 -0
- package/lib/core/form-group-wrapper/errors-consts.d.ts +5 -0
- package/lib/core/form-group-wrapper/form-group-wrapper.d.ts +15 -0
- package/lib/core/input-control/input-control.d.ts +11 -0
- package/lib/core/param/param-base.d.ts +68 -0
- package/lib/core/param/param-date-base.d.ts +18 -0
- package/lib/core/param/param-select-base.d.ts +42 -0
- package/lib/core/param/param-text-base.d.ts +15 -0
- package/{src/lib/core/param/param.tokens.ts → lib/core/param/param.tokens.d.ts} +1 -2
- package/lib/core/register-base/register-base.d.ts +168 -0
- package/lib/core/register-base/register-base.store.d.ts +35 -0
- package/lib/directives/date/date-time.types.d.ts +32 -0
- package/lib/directives/date/format-date.pipe.d.ts +10 -0
- package/lib/directives/number/number-only.directive.d.ts +10 -0
- package/lib/directives/sticky/sticky-relative.directive.d.ts +13 -0
- package/lib/directives/sticky/sticky-relative.service.d.ts +15 -0
- package/lib/directives/sticky/sticky.directive.d.ts +27 -0
- package/lib/services/date-time.service.d.ts +80 -0
- package/lib/services/dialog/dialog.service.d.ts +22 -0
- package/{src/lib/services/dialog/dialog.types.ts → lib/services/dialog/dialog.types.d.ts} +4 -8
- package/lib/services/dom-intersection.service.d.ts +8 -0
- package/lib/services/filter/filters-state.service.d.ts +21 -0
- package/lib/services/filter/filters-transmit.service.d.ts +28 -0
- package/lib/services/filter/filters.service.d.ts +12 -0
- package/lib/services/inputs-state.service.d.ts +57 -0
- package/lib/services/inputs.service.d.ts +28 -0
- package/lib/services/key-pressed.service.d.ts +15 -0
- package/lib/services/resize-window-observer.service.d.ts +11 -0
- package/lib/services/selected-objects-state.service.d.ts +47 -0
- package/lib/store/fast-query-store.service.d.ts +19 -0
- package/{src/lib/types/event.types.ts → lib/types/event.types.d.ts} +1 -1
- package/lib/types/hasura.types.d.ts +35 -0
- package/lib/types/inputs.types.d.ts +41 -0
- package/lib/types/params.types.d.ts +27 -0
- package/lib/types/register-base.types.d.ts +123 -0
- package/lib/types/sub-types.d.ts +8 -0
- package/lib/types/user-profile.types.d.ts +17 -0
- package/lib/utils/functions.d.ts +3 -0
- package/lib/utils/get-url-segment.d.ts +7 -0
- package/lib/utils/prizm.shared.module.d.ts +14 -0
- package/lib/utils/rxjs.d.ts +10 -0
- package/lib/utils/select-all-utils.d.ts +8 -0
- package/package.json +15 -12
- package/schematics/ng-update/replace-menu-state-token/index.d.ts +2 -0
- package/schematics/ng-update/replace-menu-state-token/index.js +29 -0
- package/schematics/ng-update/replace-menu-state-token/index.js.map +1 -0
- package/schematics/ng-update/update-prefix/index.d.ts +2 -0
- package/schematics/ng-update/update-prefix/index.js +33 -0
- package/schematics/ng-update/update-prefix/index.js.map +1 -0
- package/schematics/utils/{utils.ts → utils.d.ts} +2 -9
- package/schematics/utils/utils.js +25 -0
- package/schematics/utils/utils.js.map +1 -0
- package/ng-package.json +0 -15
- package/schematics/ng-update/replace-menu-state-token/index.ts +0 -33
- package/schematics/ng-update/update-prefix/index.ts +0 -38
- package/src/lib/components/checkbox-selector/checkbox-selector.component.html +0 -91
- package/src/lib/components/checkbox-selector/checkbox-selector.component.less +0 -67
- package/src/lib/components/checkbox-selector/checkbox-selector.component.ts +0 -176
- package/src/lib/components/checkbox-selector/checkbox-selector.types.ts +0 -8
- package/src/lib/components/column-settings/column-settings.component.html +0 -160
- package/src/lib/components/column-settings/column-settings.component.less +0 -131
- package/src/lib/components/column-settings/column-settings.component.ts +0 -352
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.html +0 -65
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.less +0 -79
- package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.ts +0 -114
- package/src/lib/components/column-settings/consts/column-settings.consts.ts +0 -9
- package/src/lib/components/column-settings/types/column-settings.types.ts +0 -26
- package/src/lib/components/divider/divider.component.html +0 -4
- package/src/lib/components/divider/divider.component.less +0 -10
- package/src/lib/components/divider/divider.component.ts +0 -12
- package/src/lib/components/filter-button/filter-button.component.html +0 -20
- package/src/lib/components/filter-button/filter-button.component.less +0 -41
- package/src/lib/components/filter-button/filter-button.component.ts +0 -18
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.html +0 -22
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.less +0 -23
- package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.ts +0 -31
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.html +0 -49
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.less +0 -37
- package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.ts +0 -66
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.html +0 -147
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.less +0 -45
- package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.ts +0 -114
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.html +0 -44
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.less +0 -49
- package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.ts +0 -167
- package/src/lib/components/filters/components/filter-list/filter-list.service.ts +0 -97
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.html +0 -18
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.less +0 -55
- package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.ts +0 -69
- package/src/lib/components/filters/components/filter-list.module.ts +0 -29
- package/src/lib/components/filters/register-table-filter.component.html +0 -53
- package/src/lib/components/filters/register-table-filter.component.less +0 -17
- package/src/lib/components/filters/register-table-filter.component.ts +0 -167
- package/src/lib/components/filters/register-table-filter.module.ts +0 -22
- package/src/lib/components/inputs/inputs.module.ts +0 -104
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.html +0 -49
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.less +0 -70
- package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.ts +0 -52
- package/src/lib/components/inputs/param-custom/param-custom.component.html +0 -1
- package/src/lib/components/inputs/param-custom/param-custom.component.ts +0 -9
- package/src/lib/components/inputs/param-date/param-date.component.html +0 -55
- package/src/lib/components/inputs/param-date/param-date.component.less +0 -67
- package/src/lib/components/inputs/param-date/param-date.component.ts +0 -77
- package/src/lib/components/inputs/param-date-range/param-date-range.component.html +0 -45
- package/src/lib/components/inputs/param-date-range/param-date-range.component.less +0 -75
- package/src/lib/components/inputs/param-date-range/param-date-range.component.ts +0 -67
- package/src/lib/components/inputs/param-date-time/param-date-time.component.html +0 -70
- package/src/lib/components/inputs/param-date-time/param-date-time.component.less +0 -72
- package/src/lib/components/inputs/param-date-time/param-date-time.component.ts +0 -101
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.html +0 -67
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.less +0 -103
- package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.ts +0 -128
- package/src/lib/components/inputs/param-month/param-month.component.html +0 -46
- package/src/lib/components/inputs/param-month/param-month.component.less +0 -72
- package/src/lib/components/inputs/param-month/param-month.component.ts +0 -55
- package/src/lib/components/inputs/param-month-range/param-month-range.component.html +0 -39
- package/src/lib/components/inputs/param-month-range/param-month-range.component.less +0 -71
- package/src/lib/components/inputs/param-month-range/param-month-range.component.ts +0 -76
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.html +0 -84
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.less +0 -108
- package/src/lib/components/inputs/param-multi-select/param-multi-select.component.ts +0 -448
- package/src/lib/components/inputs/param-select/param-select.component.html +0 -106
- package/src/lib/components/inputs/param-select/param-select.component.less +0 -26
- package/src/lib/components/inputs/param-select/param-select.component.ts +0 -318
- package/src/lib/components/inputs/param-switcher/param-switcher.component.html +0 -8
- package/src/lib/components/inputs/param-switcher/param-switcher.component.less +0 -53
- package/src/lib/components/inputs/param-switcher/param-switcher.component.ts +0 -13
- package/src/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.ts +0 -29
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.html +0 -19
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.less +0 -76
- package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.ts +0 -134
- package/src/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.ts +0 -8
- package/src/lib/components/inputs/param-text/param-text.component.html +0 -59
- package/src/lib/components/inputs/param-text/param-text.component.less +0 -33
- package/src/lib/components/inputs/param-text/param-text.component.ts +0 -36
- package/src/lib/components/inputs/param-textarea/param-textarea.component.html +0 -61
- package/src/lib/components/inputs/param-textarea/param-textarea.component.less +0 -21
- package/src/lib/components/inputs/param-textarea/param-textarea.component.ts +0 -33
- package/src/lib/components/inputs/param-toggle/param-toggle.component.html +0 -40
- package/src/lib/components/inputs/param-toggle/param-toggle.component.less +0 -69
- package/src/lib/components/inputs/param-toggle/param-toggle.component.ts +0 -14
- package/src/lib/components/inputs/param-tree/consts/param-tree.consts.ts +0 -59
- package/src/lib/components/inputs/param-tree/param-tree.component.html +0 -51
- package/src/lib/components/inputs/param-tree/param-tree.component.less +0 -3
- package/src/lib/components/inputs/param-tree/param-tree.component.ts +0 -282
- package/src/lib/components/inputs/param-tree/services/param-tree.service.ts +0 -176
- package/src/lib/components/inputs/param-tree/services/sync-tree-loader.service.ts +0 -18
- package/src/lib/components/inputs/param-tree/types/param-tree.types.ts +0 -39
- package/src/lib/components/inputs/param-tree/utils/param-tree.utils.ts +0 -18
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.html +0 -78
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.less +0 -109
- package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.ts +0 -89
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.html +0 -54
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.less +0 -56
- package/src/lib/components/inputs/param-tree-select/param-tree-select.component.ts +0 -91
- package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.html +0 -5
- package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.ts +0 -13
- package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.html +0 -4
- package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.ts +0 -11
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.html +0 -95
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.less +0 -183
- package/src/lib/components/menu-constructor/sproc-menu-constructor.component.ts +0 -687
- package/src/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.ts +0 -32
- package/src/lib/components/menu-constructor/store/sproc-menu-constructor.consts.ts +0 -46
- package/src/lib/components/page-menu/README.md +0 -60
- package/src/lib/components/page-menu/schema/sproc-page-menu.consts.ts +0 -8
- package/src/lib/components/page-menu/schema/sproc-page-menu.schema.ts +0 -35
- package/src/lib/components/page-menu/schema/sproc-page-menu.tokens.ts +0 -5
- package/src/lib/components/page-menu/schema/sproc-page-menu.types.ts +0 -42
- package/src/lib/components/page-menu/sproc-page-menu.component.html +0 -166
- package/src/lib/components/page-menu/sproc-page-menu.component.less +0 -228
- package/src/lib/components/page-menu/sproc-page-menu.component.ts +0 -337
- package/src/lib/components/paginator/paginator.component.html +0 -97
- package/src/lib/components/paginator/paginator.component.less +0 -101
- package/src/lib/components/paginator/paginator.component.ts +0 -192
- package/src/lib/components/paginator/types/paginator.types.ts +0 -16
- package/src/lib/components/register-table/consts/register-table.consts.ts +0 -3
- package/src/lib/components/register-table/directives/cell-template.directive.ts +0 -11
- package/src/lib/components/register-table/directives/header-template.directive.ts +0 -11
- package/src/lib/components/register-table/model/schema.ts +0 -62
- package/src/lib/components/register-table/pipes/class-by-type.pipe.ts +0 -28
- package/src/lib/components/register-table/pipes/sticky-column.pipe.ts +0 -11
- package/src/lib/components/register-table/register-table.component.html +0 -257
- package/src/lib/components/register-table/register-table.component.less +0 -151
- package/src/lib/components/register-table/register-table.component.ts +0 -743
- package/src/lib/components/reset-settings-form/reset-settings-form.component.html +0 -14
- package/src/lib/components/reset-settings-form/reset-settings-form.component.less +0 -26
- package/src/lib/components/reset-settings-form/reset-settings-form.component.ts +0 -15
- package/src/lib/components/search-input/search-input.component.html +0 -6
- package/src/lib/components/search-input/search-input.component.less +0 -17
- package/src/lib/components/search-input/search-input.component.ts +0 -31
- package/src/lib/components/sliding-panel/sliding-panel.component.html +0 -13
- package/src/lib/components/sliding-panel/sliding-panel.component.less +0 -112
- package/src/lib/components/sliding-panel/sliding-panel.component.ts +0 -36
- package/src/lib/components/sliding-panel/sliding-panel.module.ts +0 -11
- package/src/lib/consts/date-time.consts.ts +0 -1
- package/src/lib/consts/index.ts +0 -8
- package/src/lib/consts/inputs.consts.ts +0 -9
- package/src/lib/consts/month.consts.ts +0 -82
- package/src/lib/consts/params.consts.ts +0 -1
- package/src/lib/consts/register-base.consts.ts +0 -40
- package/src/lib/core/form-group-wrapper/errors-consts.ts +0 -6
- package/src/lib/core/form-group-wrapper/form-group-wrapper.ts +0 -109
- package/src/lib/core/input-control/input-control.ts +0 -30
- package/src/lib/core/param/param-base.ts +0 -262
- package/src/lib/core/param/param-date-base.ts +0 -30
- package/src/lib/core/param/param-select-base.ts +0 -118
- package/src/lib/core/param/param-text-base.ts +0 -23
- package/src/lib/core/register-base/register-base.store.ts +0 -84
- package/src/lib/core/register-base/register-base.ts +0 -854
- package/src/lib/directives/date/date-time.types.ts +0 -36
- package/src/lib/directives/date/format-date.pipe.ts +0 -28
- package/src/lib/directives/number/number-only.directive.ts +0 -36
- package/src/lib/directives/sticky/sticky-relative.directive.ts +0 -30
- package/src/lib/directives/sticky/sticky-relative.service.ts +0 -34
- package/src/lib/directives/sticky/sticky.directive.ts +0 -189
- package/src/lib/services/date-time.service.ts +0 -399
- package/src/lib/services/dialog/dialog.service.ts +0 -62
- package/src/lib/services/dom-intersection.service.ts +0 -23
- package/src/lib/services/filter/filters-state.service.ts +0 -83
- package/src/lib/services/filter/filters-transmit.service.ts +0 -105
- package/src/lib/services/filter/filters.service.ts +0 -21
- package/src/lib/services/inputs-state.service.ts +0 -157
- package/src/lib/services/inputs.service.ts +0 -114
- package/src/lib/services/key-pressed.service.ts +0 -40
- package/src/lib/services/resize-window-observer.service.ts +0 -37
- package/src/lib/services/selected-objects-state.service.ts +0 -159
- package/src/lib/store/fast-query-store.service.ts +0 -132
- package/src/lib/types/hasura.types.ts +0 -41
- package/src/lib/types/inputs.types.ts +0 -63
- package/src/lib/types/params.types.ts +0 -42
- package/src/lib/types/register-base.types.ts +0 -161
- package/src/lib/types/sub-types.ts +0 -15
- package/src/lib/types/user-profile.types.ts +0 -18
- package/src/lib/utils/functions.ts +0 -11
- package/src/lib/utils/get-url-segment.ts +0 -46
- package/src/lib/utils/prizm.shared.module.ts +0 -176
- package/src/lib/utils/rxjs.ts +0 -33
- package/src/lib/utils/select-all-utils.ts +0 -16
- package/tsconfig.lib.json +0 -16
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.schematics.json +0 -26
- package/tsconfig.spec.json +0 -15
- /package/{src/lib/components/column-settings/index.ts → lib/components/column-settings/index.d.ts} +0 -0
- /package/{src/lib/components/filters/index.ts → lib/components/filters/index.d.ts} +0 -0
- /package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -0
- /package/{src/lib/components/inputs/index.ts → lib/components/inputs/index.d.ts} +0 -0
- /package/{src/lib/components/inputs/param-switcher-date-time-range/index.ts → lib/components/inputs/param-switcher-date-time-range/index.d.ts} +0 -0
- /package/{src/lib/components/inputs/param-tree/index.ts → lib/components/inputs/param-tree/index.d.ts} +0 -0
- /package/{src/lib/components/menu-constructor/index.ts → lib/components/menu-constructor/index.d.ts} +0 -0
- /package/{src/lib/components/page-menu/index.ts → lib/components/page-menu/index.d.ts} +0 -0
- /package/{src/lib/components/register-table/index.ts → lib/components/register-table/index.d.ts} +0 -0
- /package/{src/lib/core/form-group-wrapper/index.ts → lib/core/form-group-wrapper/index.d.ts} +0 -0
- /package/{src/lib/core/index.ts → lib/core/index.d.ts} +0 -0
- /package/{src/lib/core/input-control/index.ts → lib/core/input-control/index.d.ts} +0 -0
- /package/{src/lib/core/param/index.ts → lib/core/param/index.d.ts} +0 -0
- /package/{src/lib/core/register-base/index.ts → lib/core/register-base/index.d.ts} +0 -0
- /package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -0
- /package/{src/lib/directives/sticky/index.ts → lib/directives/sticky/index.d.ts} +0 -0
- /package/{src/lib/services/dialog/index.ts → lib/services/dialog/index.d.ts} +0 -0
- /package/{src/lib/services/index.ts → lib/services/index.d.ts} +0 -0
- /package/{src/lib/store/index.ts → lib/store/index.d.ts} +0 -0
- /package/{src/lib/types/index.ts → lib/types/index.d.ts} +0 -0
- /package/{src/lib/utils/index.ts → lib/utils/index.d.ts} +0 -0
- /package/{src/public-api.ts → public-api.d.ts} +0 -0
|
@@ -1,687 +0,0 @@
|
|
|
1
|
-
import { Component, computed, DestroyRef, inject, OnInit, output, signal } from '@angular/core';
|
|
2
|
-
import { FormsModule } from '@angular/forms';
|
|
3
|
-
import {
|
|
4
|
-
CdkDrag,
|
|
5
|
-
CdkDragDrop,
|
|
6
|
-
CdkDragHandle,
|
|
7
|
-
CdkDragPreview,
|
|
8
|
-
CdkDropList,
|
|
9
|
-
} from '@angular/cdk/drag-drop';
|
|
10
|
-
import { AsyncPipe, NgForOf } from '@angular/common';
|
|
11
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
12
|
-
import { filter } from 'rxjs';
|
|
13
|
-
import { SprocAbstractMenuConstructorStore } from './store/sproc-abstract-menu-constructor.store';
|
|
14
|
-
import {
|
|
15
|
-
EMPTY_UUID,
|
|
16
|
-
FlatNode,
|
|
17
|
-
IClsMenuItemInput,
|
|
18
|
-
IMenuConstructorError,
|
|
19
|
-
MIGRATION_HINT,
|
|
20
|
-
NEW_ITEM_PREFIX,
|
|
21
|
-
ROOT_TITLE,
|
|
22
|
-
} from './store/sproc-menu-constructor.consts';
|
|
23
|
-
import { IClsMenuItem } from '../page-menu';
|
|
24
|
-
import { MENU_CONSTRUCTOR_STORE_TOKEN } from './store/sproc-menu.tokens';
|
|
25
|
-
|
|
26
|
-
@Component({
|
|
27
|
-
standalone: true,
|
|
28
|
-
selector: 'sproc-menu-constructor',
|
|
29
|
-
templateUrl: './sproc-menu-constructor.component.html',
|
|
30
|
-
styleUrls: ['./sproc-menu-constructor.component.less'],
|
|
31
|
-
imports: [CdkDrag, CdkDropList, NgForOf, FormsModule, CdkDragPreview, CdkDragHandle, AsyncPipe],
|
|
32
|
-
})
|
|
33
|
-
export class SprocMenuConstructorComponent implements OnInit {
|
|
34
|
-
private _store = inject(MENU_CONSTRUCTOR_STORE_TOKEN);
|
|
35
|
-
private _ref = inject(DestroyRef);
|
|
36
|
-
|
|
37
|
-
protected ROOT_TITLE = ROOT_TITLE;
|
|
38
|
-
protected loading$ = this._store.loading$;
|
|
39
|
-
protected originalTree: Map<string, FlatNode> = new Map([]);
|
|
40
|
-
protected MIGRATION_HINT = MIGRATION_HINT;
|
|
41
|
-
private deletedIds: string[] = [];
|
|
42
|
-
|
|
43
|
-
public errorMsgOutput = output<IMenuConstructorError>();
|
|
44
|
-
|
|
45
|
-
// плоское представление иерархического меню
|
|
46
|
-
protected flatTree = signal<FlatNode[]>([]);
|
|
47
|
-
|
|
48
|
-
// ветка элементов, которая перетаскивается
|
|
49
|
-
protected draggedBranch = signal<FlatNode[]>([]);
|
|
50
|
-
|
|
51
|
-
// вычисляемое свойство, возвращающее только видимые (не свернутые) элементы
|
|
52
|
-
protected visibleFlatTree = computed<FlatNode[]>(() => {
|
|
53
|
-
const flatTree = this.flatTree();
|
|
54
|
-
return this._getVisibleFrom(flatTree);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
private _pendingRecalc = false;
|
|
58
|
-
|
|
59
|
-
ngOnInit(): void {
|
|
60
|
-
this._store.menuItems$
|
|
61
|
-
.pipe(
|
|
62
|
-
filter((arr) => Array.isArray(arr) && arr.length > 0),
|
|
63
|
-
takeUntilDestroyed(this._ref)
|
|
64
|
-
)
|
|
65
|
-
.subscribe((value) => {
|
|
66
|
-
this.flatTree.set(this._convertToFlatNode(value));
|
|
67
|
-
this.originalTree = new Map(this.flatTree().map((item) => [item.id, { ...item }]));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Переключает состояние свернутости узла (collapse/expand)
|
|
73
|
-
* После изменения создает новый массив для триггера обновления сигнала
|
|
74
|
-
*/
|
|
75
|
-
protected toggleCollapse(node: FlatNode): void {
|
|
76
|
-
node.collapsed = !node.collapsed;
|
|
77
|
-
this.flatTree.set([...this.flatTree()]);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Начало перетаскивания: сохраняет всю ветку узла, которую тянут
|
|
82
|
-
*/
|
|
83
|
-
protected dragStarted(node: FlatNode): void {
|
|
84
|
-
const branch = this._collectBranch(this.flatTree(), node);
|
|
85
|
-
this.draggedBranch.set(branch);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Завершение перетаскивания: очищает информацию о текущей ветке
|
|
90
|
-
*/
|
|
91
|
-
protected dragEnded(): void {
|
|
92
|
-
this.draggedBranch.set([]);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Основная логика drag&drop при отпускании элемента
|
|
97
|
-
* Определяет новую позицию узла, пересчитывает глубины и связи
|
|
98
|
-
*/
|
|
99
|
-
protected drop(event: CdkDragDrop<FlatNode[]>): void {
|
|
100
|
-
const before = [...this.flatTree()];
|
|
101
|
-
const visibleBefore = this._getVisibleFrom(before);
|
|
102
|
-
const prevIdx = event.previousIndex;
|
|
103
|
-
const currIdx = event.currentIndex;
|
|
104
|
-
|
|
105
|
-
// Получает перетаскиваемый элемент из списка видимых
|
|
106
|
-
const draggedVisible = visibleBefore[prevIdx];
|
|
107
|
-
if (!draggedVisible) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Находит индекс узла в полном массиве
|
|
112
|
-
const start = before.findIndex((n) => n.id === draggedVisible.id);
|
|
113
|
-
if (start < 0) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Собирает всю ветку, начинающуюся с перетаскиваемого узла
|
|
118
|
-
const branch = this._collectBranch(before, before[start]);
|
|
119
|
-
const branchIds = new Set(branch.map((n) => n.id));
|
|
120
|
-
|
|
121
|
-
// Убирает ветку из исходного списка
|
|
122
|
-
const full = before.filter((n) => !branchIds.has(n.id));
|
|
123
|
-
|
|
124
|
-
// Определяет видимые элементы после удаления ветки
|
|
125
|
-
const visible = this._getVisibleFrom(full);
|
|
126
|
-
const prevVisible = visible[currIdx - 1] ?? null;
|
|
127
|
-
const nextVisible = visible[currIdx] ?? null;
|
|
128
|
-
|
|
129
|
-
// Индекс вставки ветки в новый список
|
|
130
|
-
const insert = nextVisible ? full.findIndex((n) => n.id === nextVisible.id) : full.length;
|
|
131
|
-
|
|
132
|
-
// Рассчитывает глубину вставляемой ветки в зависимости от соседей
|
|
133
|
-
let targetDepth;
|
|
134
|
-
if (prevVisible && nextVisible) {
|
|
135
|
-
targetDepth =
|
|
136
|
-
prevVisible.depth < nextVisible.depth ? prevVisible.depth + 1 : nextVisible.depth;
|
|
137
|
-
} else if (prevVisible && !nextVisible) {
|
|
138
|
-
targetDepth = prevVisible.depth;
|
|
139
|
-
} else if (!prevVisible && nextVisible) {
|
|
140
|
-
targetDepth = nextVisible.depth;
|
|
141
|
-
} else {
|
|
142
|
-
targetDepth = 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Вставляет ветку в новое место
|
|
146
|
-
full.splice(insert, 0, ...branch);
|
|
147
|
-
// Сдвигает глубину всей ветки
|
|
148
|
-
this._applyDepthShift(branch, targetDepth - branch[0].depth);
|
|
149
|
-
|
|
150
|
-
// Планирует пересчет структуры дерева
|
|
151
|
-
this._scheduleRecalc(full);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Увеличивает глубину (depth) конкретного узла, если возможно
|
|
156
|
-
*/
|
|
157
|
-
protected indent(node: FlatNode): void {
|
|
158
|
-
const arr = [...this.flatTree()];
|
|
159
|
-
const index = arr.indexOf(node);
|
|
160
|
-
if (index === -1) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const proposedDepth = node.depth + 1;
|
|
165
|
-
// Ищет подходящего родителя с нужной глубиной
|
|
166
|
-
const parentCandidate = [...arr]
|
|
167
|
-
.slice(0, index)
|
|
168
|
-
.reverse()
|
|
169
|
-
.find((n) => n.depth === proposedDepth - 1);
|
|
170
|
-
|
|
171
|
-
if (!parentCandidate) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
node.depth = proposedDepth;
|
|
176
|
-
this._scheduleRecalc(arr);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Уменьшает глубину (depth) узла + по возможности превращает его в родителя
|
|
181
|
-
*/
|
|
182
|
-
protected outdent(node: FlatNode): void {
|
|
183
|
-
const arr = [...this.flatTree()];
|
|
184
|
-
const index = arr.indexOf(node);
|
|
185
|
-
if (index === -1 || node.depth <= 0) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
node.depth = Math.max(0, node.depth - 1);
|
|
189
|
-
this._scheduleRecalc(arr);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Увеличивает глубину всей ветки узла (вместе с потомками)
|
|
194
|
-
*/
|
|
195
|
-
protected indentBranch(node: FlatNode): void {
|
|
196
|
-
const arr = [...this.flatTree()];
|
|
197
|
-
const index = arr.indexOf(node);
|
|
198
|
-
if (index === -1) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const proposedDepth = node.depth + 1;
|
|
202
|
-
const parentCandidate = [...arr]
|
|
203
|
-
.slice(0, index)
|
|
204
|
-
.reverse()
|
|
205
|
-
.find((n) => n.depth === proposedDepth - 1);
|
|
206
|
-
|
|
207
|
-
if (!parentCandidate) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const branch = this._collectBranch(arr, node);
|
|
212
|
-
this._applyDepthShift(branch, 1);
|
|
213
|
-
|
|
214
|
-
this._scheduleRecalc(arr);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Уменьшает глубину всей ветки узла
|
|
219
|
-
*/
|
|
220
|
-
protected outdentBranch(node: FlatNode): void {
|
|
221
|
-
const arr = [...this.flatTree()];
|
|
222
|
-
const branch = this._collectBranch(arr, node);
|
|
223
|
-
this._applyDepthShift(branch, -1);
|
|
224
|
-
this._scheduleRecalc(arr);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Проверяет, есть ли у узла дочерние элементы
|
|
229
|
-
*/
|
|
230
|
-
protected hasChildren(node: FlatNode): boolean {
|
|
231
|
-
const arr = this.flatTree();
|
|
232
|
-
const idx = arr.indexOf(node);
|
|
233
|
-
if (idx === -1) {
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
for (let i = idx + 1; i < arr.length; i++) {
|
|
237
|
-
const next = arr[i];
|
|
238
|
-
if (next.depth <= node.depth) {
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
if (next.depth === node.depth + 1) {
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
protected save(): void {
|
|
249
|
-
// Флаг для логгирования на время отладки
|
|
250
|
-
const logging = false;
|
|
251
|
-
|
|
252
|
-
const changedElements = this.flatTree().filter((newItem) => {
|
|
253
|
-
const originalItem = this.originalTree.get(newItem.id);
|
|
254
|
-
|
|
255
|
-
// Новый элемент
|
|
256
|
-
if (!originalItem) {
|
|
257
|
-
if (logging) {
|
|
258
|
-
console.log(`Новый элемент ${newItem.title}`);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const {
|
|
265
|
-
order_num: originalOrderNum,
|
|
266
|
-
id_parent: originalIdParent,
|
|
267
|
-
title: originalTitle,
|
|
268
|
-
allowed_roles: originalRoles,
|
|
269
|
-
code: originalCode,
|
|
270
|
-
route: originalRoute,
|
|
271
|
-
icon: originalIcon,
|
|
272
|
-
} = originalItem;
|
|
273
|
-
|
|
274
|
-
const {
|
|
275
|
-
order_num: newOrderNum,
|
|
276
|
-
id_parent: newIdParent,
|
|
277
|
-
title: newTitle,
|
|
278
|
-
allowed_roles: newRoles,
|
|
279
|
-
code: newCode,
|
|
280
|
-
route: newRoute,
|
|
281
|
-
icon: newIcon,
|
|
282
|
-
} = newItem;
|
|
283
|
-
|
|
284
|
-
const changedFields: string[] = [];
|
|
285
|
-
|
|
286
|
-
if (originalOrderNum !== newOrderNum) {
|
|
287
|
-
changedFields.push(`order_num: ${originalOrderNum} → ${newOrderNum}`);
|
|
288
|
-
}
|
|
289
|
-
if (originalIdParent !== newIdParent) {
|
|
290
|
-
changedFields.push(`id_parent: ${originalIdParent} → ${newIdParent}`);
|
|
291
|
-
}
|
|
292
|
-
if (originalTitle !== newTitle) {
|
|
293
|
-
changedFields.push(`title: ${originalTitle} → ${newTitle}`);
|
|
294
|
-
}
|
|
295
|
-
if (originalCode !== newCode) {
|
|
296
|
-
changedFields.push(`code: ${originalCode} → ${newCode}`);
|
|
297
|
-
}
|
|
298
|
-
if (originalRoute !== newRoute) {
|
|
299
|
-
changedFields.push(`route: ${originalRoute} → ${newRoute}`);
|
|
300
|
-
}
|
|
301
|
-
if (originalIcon !== newIcon) {
|
|
302
|
-
changedFields.push(`icon: ${originalIcon} → ${newIcon}`);
|
|
303
|
-
}
|
|
304
|
-
if (JSON.stringify(originalRoles) !== JSON.stringify(newRoles)) {
|
|
305
|
-
changedFields.push(`allowed_roles: ${originalRoles} → ${newRoles}`);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return changedFields.length > 0;
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
const isBlank = (s: unknown): boolean => typeof s !== 'string' || s.trim() === '';
|
|
312
|
-
|
|
313
|
-
const isRouteValid = ({ route, code }: FlatNode): boolean => {
|
|
314
|
-
// route считается заданным, только если это непустая строка
|
|
315
|
-
const hasRoute = route.trim() !== '';
|
|
316
|
-
|
|
317
|
-
return !hasRoute || route === code;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
const invalidCodeTitles: string[] = [];
|
|
321
|
-
const invalidRouteTitles: FlatNode[] = [];
|
|
322
|
-
|
|
323
|
-
for (const el of changedElements) {
|
|
324
|
-
if (isBlank(el.code)) {
|
|
325
|
-
invalidCodeTitles.push(el.title ?? '(без названия)');
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (!isRouteValid(el)) {
|
|
329
|
-
invalidRouteTitles.push(el);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (invalidCodeTitles.length > 0) {
|
|
334
|
-
this.errorMsgOutput.emit({
|
|
335
|
-
label: 'Конструктор меню',
|
|
336
|
-
appearance: 'negative',
|
|
337
|
-
// eslint-disable-next-line xss/no-mixed-html
|
|
338
|
-
content: `Все поля code должны быть заполнены. </br>
|
|
339
|
-
Исправьте следующие поля: </br>
|
|
340
|
-
${invalidCodeTitles.map((t) => `- ${t}`).join('</br>')}
|
|
341
|
-
`,
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
if (invalidRouteTitles.length > 0) {
|
|
348
|
-
this.errorMsgOutput.emit({
|
|
349
|
-
label: 'Конструктор меню',
|
|
350
|
-
appearance: 'negative',
|
|
351
|
-
// eslint-disable-next-line xss/no-mixed-html
|
|
352
|
-
content: `Все поля code должны быть равны полю route. </br>
|
|
353
|
-
Исправьте следующие поля: </br>
|
|
354
|
-
${invalidRouteTitles.map((t) => `- ${t.title} (${t.code} | ${t.route})`).join('</br>')}
|
|
355
|
-
`,
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const elRoute = (route: string): string | null => (route === '' ? null : route);
|
|
362
|
-
|
|
363
|
-
const normalizeElement = (el: FlatNode): IClsMenuItemInput => ({
|
|
364
|
-
title: el.title.trim(),
|
|
365
|
-
route: elRoute(el.route.trim()),
|
|
366
|
-
code: el.code,
|
|
367
|
-
icon: el.icon,
|
|
368
|
-
order_num: el.order_num,
|
|
369
|
-
allowed_roles: el.allowed_roles
|
|
370
|
-
? el.allowed_roles.split(',').map((value) => value.trim())
|
|
371
|
-
: null,
|
|
372
|
-
id_parent: el.id_parent,
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
const objectsToSave = changedElements
|
|
376
|
-
.filter(({ id }) => !id.includes(NEW_ITEM_PREFIX))
|
|
377
|
-
.map((el) => ({
|
|
378
|
-
_set: normalizeElement(el),
|
|
379
|
-
where: { id: { _eq: el.id } },
|
|
380
|
-
}));
|
|
381
|
-
|
|
382
|
-
const objectsToInsert = changedElements
|
|
383
|
-
.filter(({ id }) => id.includes(NEW_ITEM_PREFIX))
|
|
384
|
-
.map((element) => {
|
|
385
|
-
element.id = EMPTY_UUID;
|
|
386
|
-
|
|
387
|
-
return normalizeElement(element);
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
const objectsToDelete = [...this.deletedIds];
|
|
391
|
-
|
|
392
|
-
if (logging) {
|
|
393
|
-
console.log(`Измененные элементы`, objectsToSave);
|
|
394
|
-
console.log(`Новые элементы`, objectsToInsert);
|
|
395
|
-
console.log('Удалённые элементы:', objectsToDelete);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
this._store.updateMenu(objectsToSave, objectsToInsert, objectsToDelete);
|
|
399
|
-
|
|
400
|
-
this.deletedIds = [];
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
protected handleFold(state: boolean): void {
|
|
404
|
-
for (const element of this.flatTree()) {
|
|
405
|
-
if (element.title !== ROOT_TITLE) {
|
|
406
|
-
element.collapsed = state;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
this.flatTree.set([...this.flatTree()]);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Удаляет один элемент из дерева.
|
|
415
|
-
* Потомки становятся дочерними элементами родителя удалённого узла.
|
|
416
|
-
*/
|
|
417
|
-
protected deleteItem(node: FlatNode): void {
|
|
418
|
-
const arr = [...this.flatTree()];
|
|
419
|
-
const index = arr.indexOf(node);
|
|
420
|
-
if (index === -1) {
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
const parentId = node.id_parent;
|
|
425
|
-
const nodeDepth = node.depth;
|
|
426
|
-
|
|
427
|
-
// Находим потомков, которые были напрямую под этим узлом
|
|
428
|
-
for (let i = index + 1; i < arr.length; i++) {
|
|
429
|
-
const next = arr[i];
|
|
430
|
-
if (next.depth <= nodeDepth) {
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
if (next.depth === nodeDepth + 1) {
|
|
434
|
-
// потомок становится ребёнком родителя удалённого узла
|
|
435
|
-
next.id_parent = parentId ?? null;
|
|
436
|
-
next.depth = nodeDepth; // поднимаем на один уровень вверх
|
|
437
|
-
} else if (next.depth > nodeDepth + 1) {
|
|
438
|
-
// поднимаем остальные на один уровень вверх
|
|
439
|
-
next.depth -= 1;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
// Удаляем сам элемент
|
|
444
|
-
arr.splice(index, 1);
|
|
445
|
-
|
|
446
|
-
// Если id не временный — добавляем в список на удаление
|
|
447
|
-
if (!node.id.includes(NEW_ITEM_PREFIX)) {
|
|
448
|
-
this.deletedIds.push(node.id);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
this._scheduleRecalc(arr);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Добавляет новый элемент в дерево.
|
|
456
|
-
* По умолчанию он создаётся как дочерний элемент root.
|
|
457
|
-
*/
|
|
458
|
-
protected addNewItem(): void {
|
|
459
|
-
const arr = [...this.flatTree()];
|
|
460
|
-
|
|
461
|
-
const rootNode = arr.find((n) => n.title === this.ROOT_TITLE);
|
|
462
|
-
|
|
463
|
-
if (!rootNode) {
|
|
464
|
-
console.error('Root элемент не найден. Новый пункт не может быть добавлен.');
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
const newNode: FlatNode = {
|
|
469
|
-
id: `${NEW_ITEM_PREFIX}${crypto.randomUUID()}`,
|
|
470
|
-
id_parent: rootNode.id,
|
|
471
|
-
title: 'Новый пункт меню',
|
|
472
|
-
route: '',
|
|
473
|
-
icon: '',
|
|
474
|
-
order_num: 1,
|
|
475
|
-
allowed_roles: null,
|
|
476
|
-
collapsed: true,
|
|
477
|
-
code: '',
|
|
478
|
-
depth: rootNode.depth + 1,
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
const insertIndex = arr.findIndex((n) => n.id === rootNode.id) + 1;
|
|
482
|
-
arr.splice(insertIndex, 0, newNode);
|
|
483
|
-
|
|
484
|
-
this._scheduleRecalc(arr);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Сбрасывает текущее состояние в исходное
|
|
489
|
-
*/
|
|
490
|
-
protected reset(): void {
|
|
491
|
-
const originalMenu = structuredClone(this._store.originalMenu);
|
|
492
|
-
this.flatTree.set(this._convertToFlatNode(originalMenu));
|
|
493
|
-
this.deletedIds = [];
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Проверяет, находится ли элемент в текущей перетаскиваемой ветке
|
|
498
|
-
*/
|
|
499
|
-
protected isDragged(node: FlatNode): boolean {
|
|
500
|
-
return this.draggedBranch().some((n) => n.id === node.id);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Собирает всю ветку элементов начиная с указанного узла (включая потомков)
|
|
505
|
-
*/
|
|
506
|
-
private _collectBranch(arr: FlatNode[], root: FlatNode): FlatNode[] {
|
|
507
|
-
const start = arr.indexOf(root);
|
|
508
|
-
if (start < 0) {
|
|
509
|
-
return [];
|
|
510
|
-
}
|
|
511
|
-
const branch: FlatNode[] = [{ ...root }];
|
|
512
|
-
for (let i = start + 1; i < arr.length; i++) {
|
|
513
|
-
const n = arr[i];
|
|
514
|
-
if (n.depth > root.depth) {
|
|
515
|
-
branch.push(n);
|
|
516
|
-
} else {
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
return branch;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Сдвигает глубину всех элементов ветки на указанную разницу
|
|
525
|
-
* Не допускает отрицательных глубин
|
|
526
|
-
*/
|
|
527
|
-
private _applyDepthShift(branch: FlatNode[], diff: number): void {
|
|
528
|
-
if (diff === 0) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
for (const n of branch) {
|
|
532
|
-
n.depth = Math.max(0, n.depth + diff);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
* Преобразует иерархический JSON в плоский массив FlatNode[]
|
|
538
|
-
* Сохраняет порядок элементов и их вложенность
|
|
539
|
-
*/
|
|
540
|
-
private _convertToFlatNode(data: IClsMenuItem[]): FlatNode[] {
|
|
541
|
-
// Глубокая копия, чтобы не портить оригинал
|
|
542
|
-
const cloned = structuredClone(data);
|
|
543
|
-
|
|
544
|
-
const map = new Map<string, IClsMenuItem>();
|
|
545
|
-
const roots: IClsMenuItem[] = [];
|
|
546
|
-
|
|
547
|
-
for (const item of cloned) {
|
|
548
|
-
map.set(item.id, item);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
for (const item of cloned) {
|
|
552
|
-
if (item.id_parent && map.has(item.id_parent)) {
|
|
553
|
-
const parent = map.get(item.id_parent)!;
|
|
554
|
-
if (!parent.children) {
|
|
555
|
-
parent.children = [];
|
|
556
|
-
}
|
|
557
|
-
parent.children.push(item);
|
|
558
|
-
} else {
|
|
559
|
-
roots.push(item);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
const flat: FlatNode[] = [];
|
|
564
|
-
const walk = (node: IClsMenuItem, depth: number): void => {
|
|
565
|
-
flat.push({
|
|
566
|
-
id: node.id,
|
|
567
|
-
id_parent: node.id_parent,
|
|
568
|
-
title: node.title ?? '',
|
|
569
|
-
route: node.route ?? '',
|
|
570
|
-
icon: node.icon ?? '',
|
|
571
|
-
order_num: node.order_num ?? 0,
|
|
572
|
-
allowed_roles: node.allowed_roles?.join(',') ?? null,
|
|
573
|
-
collapsed: node.title !== ROOT_TITLE,
|
|
574
|
-
code: node.code ?? '',
|
|
575
|
-
depth,
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
if (node.children?.length) {
|
|
579
|
-
const sortedChildren = [...node.children].sort(
|
|
580
|
-
(a, b) => (a.order_num ?? 0) - (b.order_num ?? 0)
|
|
581
|
-
);
|
|
582
|
-
for (const child of sortedChildren) {
|
|
583
|
-
walk(child, depth + 1);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
|
-
|
|
588
|
-
const sortedRoots = [...roots].sort((a, b) => (a.order_num ?? 0) - (b.order_num ?? 0));
|
|
589
|
-
for (const root of sortedRoots) {
|
|
590
|
-
walk(root, 0);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
return flat;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Возвращает список видимых элементов на основе флагов collapsed
|
|
598
|
-
* Использует стек для отслеживания свернутости на каждом уровне
|
|
599
|
-
*/
|
|
600
|
-
private _getVisibleFrom(arr: FlatNode[] | (() => FlatNode[])): FlatNode[] {
|
|
601
|
-
const source = typeof arr === 'function' ? arr() : arr;
|
|
602
|
-
const out: FlatNode[] = [];
|
|
603
|
-
const collapsedStack: boolean[] = [];
|
|
604
|
-
|
|
605
|
-
for (const n of source) {
|
|
606
|
-
while (collapsedStack.length > n.depth) {
|
|
607
|
-
collapsedStack.pop();
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
if (!collapsedStack.includes(true)) {
|
|
611
|
-
out.push(n);
|
|
612
|
-
collapsedStack[n.depth] = !!n.collapsed;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
return out;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* Пересчитывает order_num и id_parent у всех элементов массива
|
|
621
|
-
* После перемещений поддерживает корректную структуру дерева
|
|
622
|
-
* order_num назначается относительно родителя (1..N)
|
|
623
|
-
*/
|
|
624
|
-
private _recalculateTree(arr: FlatNode[]): void {
|
|
625
|
-
const parents: FlatNode[] = [];
|
|
626
|
-
const childCounters = new Map<string | null, number>();
|
|
627
|
-
|
|
628
|
-
for (const node of arr) {
|
|
629
|
-
while (parents.length > 0 && parents[parents.length - 1].depth >= node.depth) {
|
|
630
|
-
parents.pop();
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
const parent = parents.length > 0 ? parents[parents.length - 1] : null;
|
|
634
|
-
node.id_parent = parent ? parent.id : null;
|
|
635
|
-
|
|
636
|
-
// вычисляем порядковый номер среди братьев
|
|
637
|
-
if (node.title !== ROOT_TITLE) {
|
|
638
|
-
const parentId = node.id_parent ?? null;
|
|
639
|
-
const currentCount = childCounters.get(parentId) ?? 1;
|
|
640
|
-
node.order_num = currentCount;
|
|
641
|
-
childCounters.set(parentId, currentCount + 1);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
parents.push(node);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Асинхронно планирует пересчет дерева через requestAnimationFrame
|
|
650
|
-
* Это предотвращает множественные лишние пересчеты при частых изменениях
|
|
651
|
-
*/
|
|
652
|
-
private _scheduleRecalc(arr: FlatNode[]): void {
|
|
653
|
-
if (this._pendingRecalc) {
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
this._pendingRecalc = true;
|
|
658
|
-
requestAnimationFrame(() => {
|
|
659
|
-
this._recalculateTree([...arr]);
|
|
660
|
-
const current = this.flatTree();
|
|
661
|
-
if (!this._arraysEqual(current, arr)) {
|
|
662
|
-
this.flatTree.set([...arr]);
|
|
663
|
-
}
|
|
664
|
-
this._pendingRecalc = false;
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Проверяет равенство двух массивов FlatNode по ключевым свойствам
|
|
670
|
-
*/
|
|
671
|
-
private _arraysEqual(a: FlatNode[], b: FlatNode[]): boolean {
|
|
672
|
-
if (a.length !== b.length) {
|
|
673
|
-
return false;
|
|
674
|
-
}
|
|
675
|
-
for (const [i, element] of a.entries()) {
|
|
676
|
-
if (
|
|
677
|
-
element.id !== b[i].id ||
|
|
678
|
-
element.depth !== b[i].depth ||
|
|
679
|
-
element.order_num !== b[i].order_num
|
|
680
|
-
) {
|
|
681
|
-
return false;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
return true;
|
|
686
|
-
}
|
|
687
|
-
}
|