wt-front-shared 19.0.45 → 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-form/index.d.ts +5 -0
- package/{lib/core/components/auto-form → auto-form/lib}/auto-form.module.d.ts +22 -28
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-cheditor/form-field-cheditor.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-date/form-field-date.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-file/form-field-file.component.d.ts +8 -8
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-file-show/form-field-file-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-files/form-field-files.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-files-show/form-field-files-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-input/form-field-input.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-input-show/form-field-input-show.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-json-show/form-field-json-show.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-rating/form-field-rating.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-select/form-field-select.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-select-show/form-field-select-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-slide-toggle/form-field-slide-toggle.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-slide-toggle-show/form-field-slide-toggle-show.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-string-list-input/form-field-string-list-input.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-tags/form-field-tags.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-textarea-show/form-field-textarea-show.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-message-box/form-message-box.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-main/auto-form-main.component.d.ts +10 -10
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-show/auto-form-show.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-show-field/auto-form-show-field.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/form-field/form-field.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/publish-messages/publish-messages.component.d.ts +6 -6
- package/{lib/core → auto-form/lib}/dialogs/form-dialog/form-dialog.component.d.ts +13 -13
- package/auto-form/public-api.d.ts +3 -0
- package/entities/README.md +46 -0
- package/entities/index.d.ts +5 -0
- package/entities/lib/guards/entity-sections.guard.d.ts +11 -0
- package/entities/lib/guards/route-wait.service.d.ts +10 -0
- package/entities/lib/services/entities-adapter.service.d.ts +72 -0
- package/entities/lib/services/entities-api.service.d.ts +13 -0
- package/entities/lib/services/entities-events.service.d.ts +9 -0
- package/entities/lib/services/entities-sections.service.d.ts +42 -0
- package/entities/lib/settings/code-editor.component.d.ts +24 -0
- package/entities/lib/settings/code-lint.util.d.ts +11 -0
- package/entities/lib/settings/entities-settings.component.d.ts +27 -0
- package/entities/lib/settings/entities-settings.facade.d.ts +23 -0
- package/entities/lib/settings/entities-settings.models.d.ts +99 -0
- package/entities/lib/settings/entities-settings.util.d.ts +122 -0
- package/entities/lib/settings/entity-form.component.d.ts +256 -0
- package/entities/lib/settings/entity-plan-dialog.component.d.ts +15 -0
- package/entities/lib/state/entities.actions.d.ts +35 -0
- package/entities/lib/state/entities.effects.d.ts +34 -0
- package/entities/lib/state/entities.facade.d.ts +17 -0
- package/entities/lib/state/entities.models.d.ts +157 -0
- package/entities/lib/state/entities.reducer.d.ts +13 -0
- package/entities/lib/state/entities.selectors.d.ts +15 -0
- package/entities/lib/tokens.d.ts +8 -0
- package/entities/lib/ui/confirm-dialog.component.d.ts +13 -0
- package/entities/lib/ui/empty-state.component.d.ts +8 -0
- package/entities/lib/ui/index.d.ts +5 -0
- package/entities/lib/ui/inline-alert.component.d.ts +11 -0
- package/entities/lib/ui/page-header.component.d.ts +8 -0
- package/entities/lib/ui/status-chip.component.d.ts +8 -0
- package/entities/public-api.d.ts +19 -0
- package/fesm2022/wt-front-shared-auto-form.mjs +2781 -0
- package/fesm2022/wt-front-shared-auto-form.mjs.map +1 -0
- package/fesm2022/wt-front-shared-entities.mjs +2850 -0
- package/fesm2022/wt-front-shared-entities.mjs.map +1 -0
- package/fesm2022/wt-front-shared-panel-ui.mjs +2056 -0
- package/fesm2022/wt-front-shared-panel-ui.mjs.map +1 -0
- package/fesm2022/wt-front-shared-static-data.mjs +5058 -0
- package/fesm2022/wt-front-shared-static-data.mjs.map +1 -0
- package/fesm2022/wt-front-shared.mjs +829 -10491
- package/fesm2022/wt-front-shared.mjs.map +1 -1
- package/lib/core/+state/router/router.effects.d.ts +1 -1
- package/lib/core/+state/static-data/static-data.actions.d.ts +1 -1
- package/lib/core/+state/static-data/static-data.facade.d.ts +1 -1
- package/lib/core/animations/appearFromLeftWithDelay.d.ts +10 -1
- package/lib/core/components/external-services/external-service.models.d.ts +3 -0
- package/lib/core/components/index.d.ts +7 -47
- package/lib/core/components/star-rating/star-rating.component.d.ts +2 -2
- package/lib/core/dialogs/dialogs.module.d.ts +7 -9
- package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-others.d.ts +1 -1
- package/lib/core/interceptors/headers.interceptor.d.ts +4 -3
- package/lib/core/services/auto-form/auto-form.service.d.ts +2 -2
- package/lib/core/services/base-auto-form/base-auto-form.service.d.ts +3 -3
- package/lib/core/{components/static-data → static-data-shared}/interfaces/static-data.interface.d.ts +1 -1
- package/lib/core/{components/static-data → static-data-shared}/services/static-data.service.service.d.ts +3 -3
- package/lib/core/utils/deep-equal.d.ts +6 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/models/config/app-config.d.ts +2 -1
- package/lib/models/endpoints/static-data/board-settings-request.d.ts +1 -1
- package/lib/models/endpoints/static-data/preset-settings-request.d.ts +1 -1
- package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -1
- package/package.json +39 -2
- package/panel-ui/index.d.ts +5 -0
- package/{lib/core/components → panel-ui/lib}/files-upload/constants.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/files-upload/file-list-card/file-list-card.component.d.ts +6 -6
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload/files-upload.component.d.ts +5 -5
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload-list-images/files-upload-list-images.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload.module.d.ts +2 -3
- package/{lib/core/components → panel-ui/lib}/files-upload/table-files-uploading/table-files-uploading.component.d.ts +4 -4
- package/{lib/core/components → panel-ui/lib}/form-field-error/form-field-error.component.d.ts +2 -2
- package/{lib/core/components → panel-ui/lib}/form-field-publish-error/form-field-publish-error.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/panel/panel.component.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/panel/panel.module.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/profile/profile.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/site-helper/site-helper.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/tag-cloud/tag-cloud.component.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/tag-cloud/tag-cloud.module.d.ts +1 -1
- package/panel-ui/public-api.d.ts +30 -0
- package/public-api.d.ts +10 -3
- package/static-data/index.d.ts +5 -0
- package/{lib/core/components/static-data → static-data/lib}/boards/board-edit-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/board-filter.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/board-settings-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/boards.facade.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/boards/index.d.ts +0 -1
- package/{lib/core/components/static-data → static-data/lib}/boards/kanban.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/field-settings-dialog/field-settings-dialog.component.d.ts +4 -4
- package/{lib/core/components/static-data → static-data/lib}/components/filtering-dialog/filtering-dialog.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/components/filtering-form/filtering-form.component.d.ts +6 -6
- package/{lib/core/components/static-data → static-data/lib}/components/list-sub-entities/list-sub-entities.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-dynamic-form-dialog/static-data-create-new-dynamic-form-dialog.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-item-dialog/static-data-create-new-item-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-filter-options/static-data-filter-options.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-filtering/static-data-list-filtering.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/static-data-list-items.component.d.ts +12 -10
- package/{lib/core/components/static-data → static-data/lib}/components/view-static-data-details-dialog/view-static-data-details-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-details/static-data-details.component.d.ts +28 -27
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/column-filter.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/static-data-items.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-list/static-data-list.component.d.ts +6 -5
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-view/static-data-view.component.d.ts +10 -10
- package/{lib/core/components/static-data → static-data/lib}/presets/index.d.ts +0 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/presets.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/presets.facade.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/save-preset-dialog.component.d.ts +1 -1
- package/static-data/lib/static-data.module.d.ts +40 -0
- package/static-data/public-api.d.ts +8 -0
- package/lib/core/components/button/index.d.ts +0 -2
- package/lib/core/components/static-data/static-data.module.d.ts +0 -46
- /package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-spinner/form-field-spinner.component.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/constants/auto-form-show-value.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/constants/errors.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/auto-form.interfaces.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/dynamic-form-question-type.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/field-type.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-format.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-option.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/input-type.d.ts +0 -0
- /package/lib/core/{components/static-data → static-data-shared}/interfaces/component-input-data.interface.d.ts +0 -0
- /package/lib/core/{components/static-data/boards → static-data-shared/models}/board.models.d.ts +0 -0
- /package/lib/core/{components/static-data/presets → static-data-shared/models}/preset.models.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/access-denied/access-denied.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/access-denied/access-denied.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/chips-input/chips-input.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/chips-input/chips-input.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/form-field-error/form-field-error.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/form-field-publish-error/form-field-publish-error.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/header/header.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/header/header.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/input-tags/input-tags.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/input-tags/input-tags.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/panel-header/panel-header.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/panel-header/panel-header.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/profile/profile.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/configs/publication-error-tour.config.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/configs/unpublish-tour.config.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/interfaces/config.interfaces.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/site-helper.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/smart-progress-bar/smart-progress-bar.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/smart-progress-bar/smart-progress-bar.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/sticky-sidebar/sticky-sidebar.directive.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/sticky-sidebar/sticky-sidebar.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/table-menu/table-menu.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/table-menu/table-menu.module.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-dialog/static-data-create-new-dialog.component.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/column-preferences.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/group-nested-items.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/visible-nested-rows.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/column-resize.directive.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/static-data-routing.module.d.ts +0 -0
|
@@ -0,0 +1,2056 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, NgModule, ViewChild, Input, EventEmitter, Output, Inject, InjectionToken, PLATFORM_ID, ElementRef, ContentChild, forwardRef, Optional, Directive } from '@angular/core';
|
|
3
|
+
import * as i2$1 from '@angular/common';
|
|
4
|
+
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
5
|
+
import { driver } from 'driver.js';
|
|
6
|
+
import * as i2 from 'ngx-cookie-service';
|
|
7
|
+
import * as i3 from '@angular/router';
|
|
8
|
+
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
9
|
+
import { takeUntil, filter, startWith, map } from 'rxjs/operators';
|
|
10
|
+
import * as i1 from 'wt-front-shared';
|
|
11
|
+
import { appearOpacity2, RequestStatus, trackById, hideToTopOpacity, CORE_CONFIG, appearFromLeftHideToRight, appearOpacity, appearFromLeft, SharedSpinnerModule, ImageModule, ERRORS, PublishErrors, expandCollapse, ButtonModule, resolveUserProfile } from 'wt-front-shared';
|
|
12
|
+
import { Subject, EMPTY, merge, fromEvent } from 'rxjs';
|
|
13
|
+
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
14
|
+
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
|
15
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
16
|
+
import * as i3$1 from '@angular/material/icon';
|
|
17
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
+
import * as i2$2 from '@angular/material/form-field';
|
|
19
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
20
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
21
|
+
import * as i4$1 from 'ng2-file-upload';
|
|
22
|
+
import { FileUploader, FileUploadModule } from 'ng2-file-upload';
|
|
23
|
+
import * as i3$2 from '@angular/cdk/drag-drop';
|
|
24
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
25
|
+
import * as i3$3 from '@angular/material/progress-bar';
|
|
26
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
27
|
+
import * as i4 from '@angular/material/button';
|
|
28
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
29
|
+
import { MatInputModule } from '@angular/material/input';
|
|
30
|
+
import * as i1$1 from '@angular/cdk/platform';
|
|
31
|
+
import * as i2$3 from '@angular/material/menu';
|
|
32
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
33
|
+
|
|
34
|
+
class AccessDeniedComponent {
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: AccessDeniedComponent, isStandalone: false, selector: "shared-access-denied", ngImport: i0, template: "<div class=\"text-center mt-30\">\n \u041A \u0441\u043E\u0436\u0430\u043B\u0435\u043D\u0438\u044E, \u0443 \u0412\u0430\u0441 \u043D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B<br/>\n <div class=\"mt-20\">\n \u0415\u0441\u043B\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u0432\u043E\u0434\u0443, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430 \u043D\u0430\u043F\u0438\u0448\u0438\u0442\u0435 \u0432 <a href=\"mailto:support@world-travel.uz\">support@world-travel.uz</a>\n </div>\n</div>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedComponent, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'shared-access-denied', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"text-center mt-30\">\n \u041A \u0441\u043E\u0436\u0430\u043B\u0435\u043D\u0438\u044E, \u0443 \u0412\u0430\u0441 \u043D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B<br/>\n <div class=\"mt-20\">\n \u0415\u0441\u043B\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u0432\u043E\u0434\u0443, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430 \u043D\u0430\u043F\u0438\u0448\u0438\u0442\u0435 \u0432 <a href=\"mailto:support@world-travel.uz\">support@world-travel.uz</a>\n </div>\n</div>\n" }]
|
|
41
|
+
}] });
|
|
42
|
+
|
|
43
|
+
class AccessDeniedModule {
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
45
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedModule, declarations: [AccessDeniedComponent], exports: [AccessDeniedComponent] }); }
|
|
46
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedModule }); }
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccessDeniedModule, decorators: [{
|
|
49
|
+
type: NgModule,
|
|
50
|
+
args: [{
|
|
51
|
+
imports: [],
|
|
52
|
+
declarations: [AccessDeniedComponent],
|
|
53
|
+
exports: [AccessDeniedComponent]
|
|
54
|
+
}]
|
|
55
|
+
}] });
|
|
56
|
+
|
|
57
|
+
const publicationErrorTourConfigs = {
|
|
58
|
+
'0': {
|
|
59
|
+
option: {
|
|
60
|
+
callNextAfter: 1000,
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
'1': {
|
|
64
|
+
text: 'У вас имеются замечания, которые требуется исправить перед публикацией вашей записи.',
|
|
65
|
+
image: 'assets/site-helper/base.png',
|
|
66
|
+
option: {
|
|
67
|
+
callNextAfter: 3000
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
'2': {
|
|
71
|
+
text: 'Давайте посмотрим на них',
|
|
72
|
+
image: 'assets/site-helper/site-tour.png',
|
|
73
|
+
tourSteps: [
|
|
74
|
+
{
|
|
75
|
+
element: '.publish-messages.error-messages', popover: { title: 'Блок ошибок публикации', description: 'В данном разделе вы можете ознакомиться с теми изменениями, которые необходимо внести для публикации вашей записи.' }
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
actionBeforeStep: () => {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
const buttonElement = document.querySelector('.publish-messages button');
|
|
81
|
+
if (buttonElement) {
|
|
82
|
+
buttonElement.click();
|
|
83
|
+
}
|
|
84
|
+
resolve(null);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
element: '.publish-messages-list div:nth-child(1) shared-panel', popover: { title: 'Первое замечание' }
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
element: '.publish-messages-list div:nth-child(1) a', popover: { title: 'По клику на эту ссылку вы сможете найти поле в форме' }
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
actionBeforeStep: () => {
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
const buttonElement = document.querySelector('.publish-messages div:nth-child(1) .fuse-card button');
|
|
96
|
+
if (buttonElement) {
|
|
97
|
+
buttonElement.click();
|
|
98
|
+
}
|
|
99
|
+
resolve(null);
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
element: '.publish-messages-list div:nth-child(1) .fuse-card .card-expand-area', popover: { title: 'Тут можно просмотреть описание ошибки' }
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
element: '#publish-button', popover: { title: 'После испправления всех замечаний нажмите на кнопку опубликовать' }
|
|
106
|
+
},
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
'3': {
|
|
110
|
+
image: 'assets/site-helper/all-ok.png',
|
|
111
|
+
option: {
|
|
112
|
+
callNextAfter: 1000,
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
'4': {}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const unPublishTourConfigs = {
|
|
119
|
+
'0': {
|
|
120
|
+
option: {
|
|
121
|
+
callNextAfter: 1000,
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
'1': {
|
|
125
|
+
text: 'Для того чтобы пользователи могли увидеть запись, необходимо её опубликовать.',
|
|
126
|
+
image: 'assets/site-helper/base.png',
|
|
127
|
+
option: {
|
|
128
|
+
callNextByClickButton: 'Я понял'
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
'2': {
|
|
132
|
+
image: 'assets/site-helper/all-ok.png',
|
|
133
|
+
option: {
|
|
134
|
+
callNextAfter: 1000,
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
'3': {}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
class SiteHelperComponent {
|
|
141
|
+
constructor(cd, renderer, formsFacade, publicationMessagesFacade, staticDataFacade, cookieService, router) {
|
|
142
|
+
this.cd = cd;
|
|
143
|
+
this.renderer = renderer;
|
|
144
|
+
this.formsFacade = formsFacade;
|
|
145
|
+
this.publicationMessagesFacade = publicationMessagesFacade;
|
|
146
|
+
this.staticDataFacade = staticDataFacade;
|
|
147
|
+
this.cookieService = cookieService;
|
|
148
|
+
this.router = router;
|
|
149
|
+
this.activeConfigStep = -1;
|
|
150
|
+
this.staticDataUrlKey = 'static-data';
|
|
151
|
+
this.cookiesKeyPrefix = 'wt-site-tour';
|
|
152
|
+
this.siteHelperRunning = false;
|
|
153
|
+
this.siteHelperKeys = {
|
|
154
|
+
errorPublication: 'error-publication'
|
|
155
|
+
};
|
|
156
|
+
this.destroy$ = new Subject();
|
|
157
|
+
}
|
|
158
|
+
async ngOnInit() {
|
|
159
|
+
this.pageUrl = this.router.url || '/';
|
|
160
|
+
this.subscribeToRouteChanges();
|
|
161
|
+
const isStartedTour = await this.checkStaticItemData(this.router.url);
|
|
162
|
+
if (!isStartedTour) {
|
|
163
|
+
this.siteHelperRunning = true;
|
|
164
|
+
this.runSiteHelper();
|
|
165
|
+
}
|
|
166
|
+
this.subscribeToFormsStatus();
|
|
167
|
+
}
|
|
168
|
+
ngOnDestroy() {
|
|
169
|
+
this.destroy$.next();
|
|
170
|
+
this.destroy$.complete();
|
|
171
|
+
}
|
|
172
|
+
subscribeToFormsStatus() {
|
|
173
|
+
this.formsFacade.getAllForms()
|
|
174
|
+
.pipe(takeUntil(this.destroy$))
|
|
175
|
+
.subscribe((allForms) => {
|
|
176
|
+
const inValidForms = allForms.filter(item => item.hasError);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
subscribeToRouteChanges() {
|
|
180
|
+
this.router.events
|
|
181
|
+
.pipe(filter(event => event instanceof NavigationEnd), takeUntil(this.destroy$))
|
|
182
|
+
.subscribe(async (event) => {
|
|
183
|
+
this.stopSiteTour();
|
|
184
|
+
if (event.url !== '/auth') {
|
|
185
|
+
this.currentSiteHelperKey = '';
|
|
186
|
+
this.pageUrl = event.url;
|
|
187
|
+
const isStartedTour = await this.checkStaticItemData(event.url);
|
|
188
|
+
if (!isStartedTour) {
|
|
189
|
+
this.siteHelperRunning = true;
|
|
190
|
+
this.runSiteHelper();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
this.hideSiteTour();
|
|
195
|
+
this.siteHelperRunning = false;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async checkStaticItemData(url) {
|
|
200
|
+
const urlParams = url.split('/');
|
|
201
|
+
if (urlParams?.length > 2 && urlParams[1] === this.staticDataUrlKey && urlParams[2] && Number(urlParams[3])) {
|
|
202
|
+
const contentType = urlParams[2];
|
|
203
|
+
const itemId = Number(urlParams[3]);
|
|
204
|
+
const staticItemData = await this.getStaticDataItemData(contentType, itemId);
|
|
205
|
+
if (staticItemData?.id) {
|
|
206
|
+
const publicationMessages = await this.getStaticDataFormErrors(contentType, itemId);
|
|
207
|
+
const errorPublicationMessages = publicationMessages.filter(item => item.isError);
|
|
208
|
+
if (errorPublicationMessages?.length) {
|
|
209
|
+
const cookieKey = this.getCookieKey(this.siteHelperKeys.errorPublication);
|
|
210
|
+
if (!this.cookieService.get(cookieKey)) {
|
|
211
|
+
this.currentSiteHelperKey = this.siteHelperKeys.errorPublication;
|
|
212
|
+
this.siteHelperRunning = true;
|
|
213
|
+
this.runSiteHelper(publicationErrorTourConfigs);
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// if user open an item, which has not published yet
|
|
218
|
+
if (!staticItemData.publishedAt) {
|
|
219
|
+
this.siteHelperRunning = true;
|
|
220
|
+
this.runSiteHelper(unPublishTourConfigs);
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
// if user just have saved, need to say that he needs to publish
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
saveCompletedStatusInCookies() {
|
|
229
|
+
if (this.currentSiteHelperKey) {
|
|
230
|
+
const cookieKey = this.getCookieKey(this.currentSiteHelperKey);
|
|
231
|
+
const cookiesExpiresDate = new Date();
|
|
232
|
+
cookiesExpiresDate.setDate(cookiesExpiresDate.getDate() + 10e5);
|
|
233
|
+
this.cookieService.set(cookieKey, 'true', cookiesExpiresDate);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
getCookieKey(key) {
|
|
237
|
+
return key ? `${this.cookiesKeyPrefix}-${key}` : null;
|
|
238
|
+
}
|
|
239
|
+
getStaticDataFormErrors(contentType, itemId) {
|
|
240
|
+
return new Promise((resolve, reject) => {
|
|
241
|
+
this.publicationMessagesFacade.getPublicationMessage(contentType, itemId)
|
|
242
|
+
.pipe(filter(item => !!item?.length), takeUntil(this.destroy$))
|
|
243
|
+
.subscribe((publicationMessage) => {
|
|
244
|
+
resolve(publicationMessage);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
getStaticDataItemData(contentType, itemId) {
|
|
249
|
+
return new Promise((resolve, reject) => {
|
|
250
|
+
this.staticDataFacade.getStaticDataItem$(contentType, 'list', itemId)
|
|
251
|
+
.pipe(filter(item => !!item.id), takeUntil(this.destroy$))
|
|
252
|
+
.subscribe((data) => {
|
|
253
|
+
resolve(data);
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
stopSiteTour() {
|
|
258
|
+
if (this.activeConfigStep !== -1) {
|
|
259
|
+
this.activeConfigStep = -1;
|
|
260
|
+
this.hideSiteTour();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
hideSiteTour() {
|
|
264
|
+
const createdElement = document.getElementsByClassName('site-helper')?.[0];
|
|
265
|
+
if (createdElement) {
|
|
266
|
+
createdElement.remove();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
runSiteHelper(configuration) {
|
|
270
|
+
this.stopSiteTour();
|
|
271
|
+
if (this.siteHelperRunning) {
|
|
272
|
+
this.activeConfigStep = -1;
|
|
273
|
+
if (configuration) {
|
|
274
|
+
this.currentSiteHelperConfiguration = configuration;
|
|
275
|
+
}
|
|
276
|
+
else if (this.configurations[this.pageUrl]) {
|
|
277
|
+
const helperKey = `url-${this.pageUrl}`;
|
|
278
|
+
const cookieKey = this.getCookieKey(helperKey);
|
|
279
|
+
if (!this.cookieService.get(cookieKey)) {
|
|
280
|
+
this.currentSiteHelperKey = `url-${this.pageUrl}`;
|
|
281
|
+
this.currentSiteHelperConfiguration = this.configurations[this.pageUrl];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (this.currentSiteHelperConfiguration) {
|
|
285
|
+
this.runSiteHelperNextStep();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
async runSiteHelperNextStep() {
|
|
290
|
+
if (!this.siteHelperRunning) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.activeConfigStep++;
|
|
294
|
+
const configItem = this.currentSiteHelperConfiguration?.[this.activeConfigStep];
|
|
295
|
+
if (configItem) {
|
|
296
|
+
let textDiv;
|
|
297
|
+
let imageDiv;
|
|
298
|
+
this.hideSiteTour();
|
|
299
|
+
if (configItem.tourSteps) {
|
|
300
|
+
await this.initSiteTour(configItem.tourSteps);
|
|
301
|
+
}
|
|
302
|
+
if (configItem.text) {
|
|
303
|
+
textDiv = this.renderer.createElement('div');
|
|
304
|
+
textDiv.classList.add('site-helper-text');
|
|
305
|
+
textDiv.innerHTML = configItem.text;
|
|
306
|
+
if (configItem.option?.callNextByClickButton) {
|
|
307
|
+
const buttonDiv = this.renderer.createElement('div');
|
|
308
|
+
buttonDiv.classList.add('site-helper-text-button');
|
|
309
|
+
const button = this.renderer.createElement('button');
|
|
310
|
+
button.textContent = configItem.option.callNextByClickButton;
|
|
311
|
+
button.onclick = () => {
|
|
312
|
+
this.runSiteHelperNextStep();
|
|
313
|
+
};
|
|
314
|
+
this.renderer.appendChild(buttonDiv, button);
|
|
315
|
+
this.renderer.appendChild(textDiv, buttonDiv);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (configItem.image) {
|
|
319
|
+
imageDiv = this.renderer.createElement('div');
|
|
320
|
+
imageDiv.classList.add('site-helper-image');
|
|
321
|
+
const image = this.renderer.createElement('img');
|
|
322
|
+
image.src = configItem.image;
|
|
323
|
+
this.renderer.appendChild(imageDiv, image);
|
|
324
|
+
}
|
|
325
|
+
if (textDiv || imageDiv) {
|
|
326
|
+
const commonDiv = this.renderer.createElement('div');
|
|
327
|
+
commonDiv.classList.add('site-helper');
|
|
328
|
+
if (textDiv) {
|
|
329
|
+
this.renderer.appendChild(commonDiv, textDiv);
|
|
330
|
+
}
|
|
331
|
+
if (imageDiv) {
|
|
332
|
+
this.renderer.appendChild(commonDiv, imageDiv);
|
|
333
|
+
}
|
|
334
|
+
this.renderer.appendChild(document.body, commonDiv);
|
|
335
|
+
}
|
|
336
|
+
if (configItem?.option?.callNextAfter) {
|
|
337
|
+
setTimeout(() => {
|
|
338
|
+
this.runSiteHelperNextStep();
|
|
339
|
+
}, configItem.option.callNextAfter);
|
|
340
|
+
}
|
|
341
|
+
this.cd.markForCheck();
|
|
342
|
+
}
|
|
343
|
+
// Complete the site tour
|
|
344
|
+
if (this.activeConfigStep === (Object.keys(this.currentSiteHelperConfiguration).length + 1)) {
|
|
345
|
+
this.siteHelperRunning = false;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
initSiteTour(steps) {
|
|
349
|
+
return new Promise((resolve, reject) => {
|
|
350
|
+
const driverObj = driver({
|
|
351
|
+
showProgress: true,
|
|
352
|
+
steps: [
|
|
353
|
+
...steps
|
|
354
|
+
],
|
|
355
|
+
progressText: '{{current}} из {{total}}',
|
|
356
|
+
nextBtnText: 'Следующий',
|
|
357
|
+
prevBtnText: 'Предыдыщий',
|
|
358
|
+
doneBtnText: 'Готово',
|
|
359
|
+
onNextClick: async (element, step, options) => {
|
|
360
|
+
if (driverObj.isLastStep()) {
|
|
361
|
+
this.saveCompletedStatusInCookies();
|
|
362
|
+
this.runSiteHelperNextStep();
|
|
363
|
+
driverObj.destroy();
|
|
364
|
+
resolve(null);
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
// if next step has actionBeforeStep, need to run it firstly
|
|
368
|
+
const nextStep = steps[options.state.activeIndex + 1];
|
|
369
|
+
if (nextStep?.actionBeforeStep) {
|
|
370
|
+
await nextStep.actionBeforeStep();
|
|
371
|
+
}
|
|
372
|
+
setTimeout(() => {
|
|
373
|
+
driverObj.moveNext();
|
|
374
|
+
}, 0);
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
onCloseClick: () => {
|
|
378
|
+
driverObj.destroy();
|
|
379
|
+
this.runSiteHelperNextStep();
|
|
380
|
+
this.saveCompletedStatusInCookies();
|
|
381
|
+
},
|
|
382
|
+
popoverClass: 'site-helper-popover',
|
|
383
|
+
onHighlighted: () => {
|
|
384
|
+
resolve(null);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
driverObj.drive();
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i1.FormsFacade }, { token: i1.PublicationMessagesFacade }, { token: i1.StaticDataFacade }, { token: i2.CookieService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
391
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: SiteHelperComponent, isStandalone: false, selector: "shared-site-helper", inputs: { configurations: "configurations" }, viewQueries: [{ propertyName: "textDiv", first: true, predicate: ["siteHelperText"], descendants: true }], ngImport: i0, template: "", styles: [".site-helper{position:fixed;right:20px;bottom:0;z-index:100000;display:flex;flex-direction:column}.site-helper .site-helper-text-button button{background:#4caf50;border:0;color:#fff;height:30px;margin-top:10px}\n"], animations: [appearOpacity2], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
392
|
+
}
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperComponent, decorators: [{
|
|
394
|
+
type: Component,
|
|
395
|
+
args: [{ selector: 'shared-site-helper', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearOpacity2], standalone: false, template: "", styles: [".site-helper{position:fixed;right:20px;bottom:0;z-index:100000;display:flex;flex-direction:column}.site-helper .site-helper-text-button button{background:#4caf50;border:0;color:#fff;height:30px;margin-top:10px}\n"] }]
|
|
396
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i1.FormsFacade }, { type: i1.PublicationMessagesFacade }, { type: i1.StaticDataFacade }, { type: i2.CookieService }, { type: i3.Router }], propDecorators: { configurations: [{
|
|
397
|
+
type: Input
|
|
398
|
+
}], textDiv: [{
|
|
399
|
+
type: ViewChild,
|
|
400
|
+
args: ['siteHelperText']
|
|
401
|
+
}] } });
|
|
402
|
+
|
|
403
|
+
class SiteHelperModule {
|
|
404
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
405
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperModule, declarations: [SiteHelperComponent], imports: [CommonModule], exports: [SiteHelperComponent] }); }
|
|
406
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperModule, imports: [CommonModule] }); }
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SiteHelperModule, decorators: [{
|
|
409
|
+
type: NgModule,
|
|
410
|
+
args: [{
|
|
411
|
+
declarations: [SiteHelperComponent],
|
|
412
|
+
imports: [CommonModule],
|
|
413
|
+
exports: [SiteHelperComponent]
|
|
414
|
+
}]
|
|
415
|
+
}] });
|
|
416
|
+
|
|
417
|
+
class ChipsInputComponent {
|
|
418
|
+
constructor() {
|
|
419
|
+
this.items = [];
|
|
420
|
+
this.selectedItems = [];
|
|
421
|
+
this.changedList = new EventEmitter();
|
|
422
|
+
this.changedText = new EventEmitter();
|
|
423
|
+
this.visible = true;
|
|
424
|
+
this.selectable = true;
|
|
425
|
+
this.removable = true;
|
|
426
|
+
this.addOnBlur = true;
|
|
427
|
+
this.separatorKeysCodes = [ENTER, COMMA];
|
|
428
|
+
this.itemsCtrl = new UntypedFormControl();
|
|
429
|
+
this.filteredItems = this.itemsCtrl.valueChanges.pipe(startWith(null), map((item) => {
|
|
430
|
+
this.changedText.emit(item);
|
|
431
|
+
if (this.items) {
|
|
432
|
+
return item ? this._filter(item) : this.items.slice();
|
|
433
|
+
}
|
|
434
|
+
return [];
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
add(event) {
|
|
438
|
+
// Add item only when MatAutocomplete is not open
|
|
439
|
+
// To make sure this does not conflict with OptionSelected Event
|
|
440
|
+
if (!this.matAutocomplete.isOpen) {
|
|
441
|
+
const input = event.input;
|
|
442
|
+
const value = event.value;
|
|
443
|
+
// Add our item
|
|
444
|
+
if ((value || '').trim()) {
|
|
445
|
+
this.selectedItems.push({ id: 3, title: value.trim() });
|
|
446
|
+
this.changedList.emit(this.selectedItems);
|
|
447
|
+
}
|
|
448
|
+
// Reset the input value
|
|
449
|
+
if (input) {
|
|
450
|
+
input.value = '';
|
|
451
|
+
}
|
|
452
|
+
this.itemsCtrl.setValue(null);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
remove(item) {
|
|
456
|
+
this.selectedItems = this.selectedItems.filter(SItem => SItem.id !== item.id);
|
|
457
|
+
this.changedList.emit(this.selectedItems);
|
|
458
|
+
}
|
|
459
|
+
selected(event) {
|
|
460
|
+
this.selectedItems.push({ id: 1, title: event.option.viewValue });
|
|
461
|
+
this.itemInput.nativeElement.value = '';
|
|
462
|
+
this.itemsCtrl.setValue(null);
|
|
463
|
+
this.changedList.emit(this.selectedItems);
|
|
464
|
+
}
|
|
465
|
+
_filter(value) {
|
|
466
|
+
if (typeof value === 'string') {
|
|
467
|
+
return this.items.filter(itemFilter => itemFilter.title.indexOf(value) === 0);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
return this.items.filter(itemFilter => {
|
|
471
|
+
return itemFilter.id !== value.id;
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
476
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: ChipsInputComponent, isStandalone: false, selector: "shared-chips-input", inputs: { title: "title", items: "items", selectedItems: "selectedItems" }, outputs: { changedList: "changedList", changedText: "changedText" }, viewQueries: [{ propertyName: "itemInput", first: true, predicate: ["itemInput"], descendants: true }, { propertyName: "matAutocomplete", first: true, predicate: ["auto"], descendants: true }], ngImport: i0, template: "<!--\n<mat-form-field class=\"example-chip-list\">\n <mat-label class=\"title\">{{title}}</mat-label>\n <mat-chip-list #chipList aria-label=\"Fruit selection\">\n <mat-chip\n *ngFor=\"let item of selectedItems\"\n [selectable]=\"selectable\"\n [removable]=\"removable\"\n (removed)=\"remove(item)\">\n {{item.title}}\n <mat-icon matChipRemove *ngIf=\"removable\">cancel</mat-icon>\n </mat-chip>\n <input\n #itemInput\n [placeholder]=\"''\"\n [formControl]=\"itemsCtrl\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"chipList\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"add($event)\">\n </mat-chip-list>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\">\n {{item.title}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>\n-->\n<!--\n<mat-form-field class=\"example-chip-list\">\n <mat-label>Favorite Fruits</mat-label>\n <mat-chip-grid #chipGrid aria-label=\"Fruit selection\">\n <mat-chip-row *ngFor=\"let fruit of fruits\" (removed)=\"remove(fruit)\">\n {{fruit}}\n <button matChipRemove [attr.aria-label]=\"'remove ' + fruit\">\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n </mat-chip-grid>\n <input placeholder=\"New Fruit...\" #fruitInput [formControl]=\"fruitCtrl\"\n [matChipInputFor]=\"chipGrid\" [matAutocomplete]=\"auto\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n (matChipInputTokenEnd)=\"add($event)\"/>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let fruit of filteredFruits | async\" [value]=\"fruit\">\n {{fruit}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n-->\n", styles: [".example-chip-list{width:100%}.title{color:#0009;font-size:16px}\n"] }); }
|
|
477
|
+
}
|
|
478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputComponent, decorators: [{
|
|
479
|
+
type: Component,
|
|
480
|
+
args: [{ selector: 'shared-chips-input', standalone: false, template: "<!--\n<mat-form-field class=\"example-chip-list\">\n <mat-label class=\"title\">{{title}}</mat-label>\n <mat-chip-list #chipList aria-label=\"Fruit selection\">\n <mat-chip\n *ngFor=\"let item of selectedItems\"\n [selectable]=\"selectable\"\n [removable]=\"removable\"\n (removed)=\"remove(item)\">\n {{item.title}}\n <mat-icon matChipRemove *ngIf=\"removable\">cancel</mat-icon>\n </mat-chip>\n <input\n #itemInput\n [placeholder]=\"''\"\n [formControl]=\"itemsCtrl\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"chipList\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"add($event)\">\n </mat-chip-list>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\">\n {{item.title}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>\n-->\n<!--\n<mat-form-field class=\"example-chip-list\">\n <mat-label>Favorite Fruits</mat-label>\n <mat-chip-grid #chipGrid aria-label=\"Fruit selection\">\n <mat-chip-row *ngFor=\"let fruit of fruits\" (removed)=\"remove(fruit)\">\n {{fruit}}\n <button matChipRemove [attr.aria-label]=\"'remove ' + fruit\">\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n </mat-chip-grid>\n <input placeholder=\"New Fruit...\" #fruitInput [formControl]=\"fruitCtrl\"\n [matChipInputFor]=\"chipGrid\" [matAutocomplete]=\"auto\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n (matChipInputTokenEnd)=\"add($event)\"/>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let fruit of filteredFruits | async\" [value]=\"fruit\">\n {{fruit}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n-->\n", styles: [".example-chip-list{width:100%}.title{color:#0009;font-size:16px}\n"] }]
|
|
481
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], items: [{
|
|
484
|
+
type: Input
|
|
485
|
+
}], selectedItems: [{
|
|
486
|
+
type: Input
|
|
487
|
+
}], changedList: [{
|
|
488
|
+
type: Output
|
|
489
|
+
}], changedText: [{
|
|
490
|
+
type: Output
|
|
491
|
+
}], itemInput: [{
|
|
492
|
+
type: ViewChild,
|
|
493
|
+
args: ['itemInput', { static: false }]
|
|
494
|
+
}], matAutocomplete: [{
|
|
495
|
+
type: ViewChild,
|
|
496
|
+
args: ['auto', { static: false }]
|
|
497
|
+
}] } });
|
|
498
|
+
|
|
499
|
+
// import { MatLegacyChipsModule } from "@angular/material/legacy-chips";
|
|
500
|
+
class ChipsInputModule {
|
|
501
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
502
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputModule, declarations: [ChipsInputComponent], imports: [CommonModule,
|
|
503
|
+
MatFormFieldModule,
|
|
504
|
+
MatChipsModule,
|
|
505
|
+
MatAutocompleteModule,
|
|
506
|
+
MatIconModule,
|
|
507
|
+
ReactiveFormsModule], exports: [ChipsInputComponent] }); }
|
|
508
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputModule, imports: [CommonModule,
|
|
509
|
+
MatFormFieldModule,
|
|
510
|
+
MatChipsModule,
|
|
511
|
+
MatAutocompleteModule,
|
|
512
|
+
MatIconModule,
|
|
513
|
+
ReactiveFormsModule] }); }
|
|
514
|
+
}
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChipsInputModule, decorators: [{
|
|
516
|
+
type: NgModule,
|
|
517
|
+
args: [{
|
|
518
|
+
declarations: [ChipsInputComponent],
|
|
519
|
+
exports: [ChipsInputComponent],
|
|
520
|
+
imports: [
|
|
521
|
+
CommonModule,
|
|
522
|
+
MatFormFieldModule,
|
|
523
|
+
MatChipsModule,
|
|
524
|
+
MatAutocompleteModule,
|
|
525
|
+
MatIconModule,
|
|
526
|
+
ReactiveFormsModule,
|
|
527
|
+
// MatLegacyChipsModule
|
|
528
|
+
]
|
|
529
|
+
}]
|
|
530
|
+
}] });
|
|
531
|
+
|
|
532
|
+
const FileListModeList = 'list';
|
|
533
|
+
const FileListModeSort = 'sort';
|
|
534
|
+
|
|
535
|
+
class FileListCardComponent {
|
|
536
|
+
constructor(filesFacade, notificationsFacade, dialogService, cd, requestsFacade) {
|
|
537
|
+
this.filesFacade = filesFacade;
|
|
538
|
+
this.notificationsFacade = notificationsFacade;
|
|
539
|
+
this.dialogService = dialogService;
|
|
540
|
+
this.cd = cd;
|
|
541
|
+
this.requestsFacade = requestsFacade;
|
|
542
|
+
this.requestStatus = RequestStatus;
|
|
543
|
+
this.ModeSort = FileListModeSort;
|
|
544
|
+
this.edit = false;
|
|
545
|
+
this.filesKey = 'files';
|
|
546
|
+
this.firstRequest = true;
|
|
547
|
+
this.allMethods = '*';
|
|
548
|
+
this.loading = false;
|
|
549
|
+
this.messages = {
|
|
550
|
+
ATTENTION: 'Внимание',
|
|
551
|
+
TITLE_SAVED: 'Заголовок успешно сохранен'
|
|
552
|
+
};
|
|
553
|
+
this.destroy$ = new Subject();
|
|
554
|
+
}
|
|
555
|
+
ngOnInit() {
|
|
556
|
+
}
|
|
557
|
+
ngOnDestroy() {
|
|
558
|
+
this.requestsFacade.deleteRequestWaiter(this.filesKey, this.allMethods, this.file.id);
|
|
559
|
+
this.loading = false;
|
|
560
|
+
this.destroy$.next();
|
|
561
|
+
this.destroy$.complete();
|
|
562
|
+
}
|
|
563
|
+
ngOnChanges(changes) {
|
|
564
|
+
}
|
|
565
|
+
changeTitle(event) {
|
|
566
|
+
this.currentValue = event.target.value?.trim();
|
|
567
|
+
}
|
|
568
|
+
saveTitle(file) {
|
|
569
|
+
if (this.currentValue !== file.title) {
|
|
570
|
+
this.initRequest();
|
|
571
|
+
this.fileUpdate(file.id, { title: this.currentValue });
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
this.sendNotification(file);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
sendNotification(file) {
|
|
578
|
+
const rand = Math.random();
|
|
579
|
+
this.notificationsFacade.addNotifications({
|
|
580
|
+
id: `file-card-${file.id}-${rand}`,
|
|
581
|
+
type: 'success',
|
|
582
|
+
text: this.messages.TITLE_SAVED,
|
|
583
|
+
title: this.messages.ATTENTION
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
fileUpdate(id, params) {
|
|
587
|
+
this.filesFacade.filesUpdate({ ...params, id, section: this.section, itemId: this.itemId });
|
|
588
|
+
}
|
|
589
|
+
fileDelete(id) {
|
|
590
|
+
this.dialogService.openDeleteDialog()
|
|
591
|
+
.pipe(takeUntil(this.destroy$))
|
|
592
|
+
.subscribe((result) => {
|
|
593
|
+
if (result) {
|
|
594
|
+
this.initRequest();
|
|
595
|
+
this.filesFacade.filesDelete(id);
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
setMain(id, main) {
|
|
600
|
+
if (!main) {
|
|
601
|
+
this.initRequest();
|
|
602
|
+
this.fileUpdate(id, { main: true });
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
editFile() {
|
|
606
|
+
this.edit = true;
|
|
607
|
+
this.cd.markForCheck();
|
|
608
|
+
}
|
|
609
|
+
subscribeToRequest() {
|
|
610
|
+
this.request$
|
|
611
|
+
.pipe(takeUntil(this.destroy$))
|
|
612
|
+
.subscribe(data => {
|
|
613
|
+
if (this.currentStatus !== data.status) {
|
|
614
|
+
if (data.status === this.requestStatus.LOADING) {
|
|
615
|
+
this.loading = true;
|
|
616
|
+
this.edit = false;
|
|
617
|
+
}
|
|
618
|
+
if (data.status === this.requestStatus.LOADED) {
|
|
619
|
+
this.loading = false;
|
|
620
|
+
this.edit = false;
|
|
621
|
+
}
|
|
622
|
+
this.currentStatus = data.status;
|
|
623
|
+
this.cd.markForCheck();
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
initRequest() {
|
|
628
|
+
if (this.firstRequest) {
|
|
629
|
+
this.requestsFacade.createRequestListener(this.filesKey, this.allMethods, this.file.id);
|
|
630
|
+
this.request$ = this.requestsFacade.getRequestUpdates(this.filesKey, this.allMethods, this.file.id);
|
|
631
|
+
this.subscribeToRequest();
|
|
632
|
+
this.firstRequest = false;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FileListCardComponent, deps: [{ token: i1.FilesFacade }, { token: i1.NotificationsFacade }, { token: i1.DialogService }, { token: i0.ChangeDetectorRef }, { token: i1.RequestsFacade }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FileListCardComponent, isStandalone: false, selector: "shared-file-list-card", inputs: { file: "file", section: "section", itemId: "itemId", mode: "mode" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"fuse-card d-flex flex-column\"\n [ngClass]=\"{'fuse-card-sort': mode === ModeSort}\">\n <div class=\"top-panel\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n mat-icon-button\n aria-label=\"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\"\n title=\"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\"\n class=\"color-green\"\n (click)=\"editFile()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button\n aria-label=\"\u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0433\u043B\u0430\u0432\u043D\u044B\u043C\"\n title=\"\u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0433\u043B\u0430\u0432\u043D\u044B\u043C\"\n (click)=\"setMain(file.id, file.main)\"\n [ngClass]=\"{'cursor-no-pointer': file.main}\">\n <mat-icon *ngIf=\"!file.main\">star_border</mat-icon>\n <mat-icon *ngIf=\"file.main\">star</mat-icon>\n </button>\n <button\n mat-icon-button\n aria-label=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0444\u0430\u0439\u043B\"\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0444\u0430\u0439\u043B\"\n class=\"color-red\"\n (click)=\"fileDelete(file.id)\"\n >\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n <div class=\"image\">\n <shared-image class=\"mat-elevation-z3\"\n [versions]=\"file.versions\"\n [version]=\"1\"\n [haveZoom]=\"true\"></shared-image>\n </div>\n <div class=\"p-10 cart-title p-0\"\n [ngClass]=\"{'edit-title': edit, 'empty-title': !file.title}\">\n <div class=\"width100 display-flex-space-between edit-block\"\n [ngClass]=\"{'edit-block-open': edit}\">\n\n <!--<shared-image class=\"mlr-5 mat-elevation-z3 width150100\"\n [versions]=\"file.versions\"\n [version]=\"3\"\n [haveZoom]=\"true\"></shared-image>-->\n <div *ngIf=\"!edit && file?.title\" class=\"h3\">{{ file.title }}</div>\n <ng-container *ngIf=\"edit\">\n <textarea type=\"text\"\n placeholder=\"Enter image title...\"\n class=\"edit-textarea\"\n (change)=\"changeTitle($event)\"\n [innerText]=\"file && file.title ? file.title : ''\"></textarea>\n <div class=\"edit-button\">\n <button\n mat-icon-button\n aria-label=\"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\"\n title=\"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\"\n class=\"color-green\"\n (click)=\"saveTitle(file)\"\n >\n <mat-icon>check</mat-icon>\n </button>\n <button\n mat-icon-button\n aria-label=\"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\"\n title=\"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\"\n class=\"color-red\"\n (click)=\"edit = false\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n <shared-spinner\n *ngIf=\"loading\"\n [overlay]=\"true\"\n [diameter]=\"20\"\n [color]=\"'blue'\"></shared-spinner>\n</div>\n", styles: [".fuse-card{display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px;flex-grow:1;flex-basis:0}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.fuse-card:last-child{border:none}.card-list.cdk-drop-list-dragging .fuse-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1.SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i1.ImageComponent, selector: "shared-image", inputs: ["versions", "url", "version", "title", "index", "haveZoom", "imgClass", "loading", "width", "height", "sizes"], outputs: ["clickEvent", "delete"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
637
|
+
}
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FileListCardComponent, decorators: [{
|
|
639
|
+
type: Component,
|
|
640
|
+
args: [{ selector: 'shared-file-list-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"fuse-card d-flex flex-column\"\n [ngClass]=\"{'fuse-card-sort': mode === ModeSort}\">\n <div class=\"top-panel\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n mat-icon-button\n aria-label=\"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\"\n title=\"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\"\n class=\"color-green\"\n (click)=\"editFile()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button\n aria-label=\"\u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0433\u043B\u0430\u0432\u043D\u044B\u043C\"\n title=\"\u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0433\u043B\u0430\u0432\u043D\u044B\u043C\"\n (click)=\"setMain(file.id, file.main)\"\n [ngClass]=\"{'cursor-no-pointer': file.main}\">\n <mat-icon *ngIf=\"!file.main\">star_border</mat-icon>\n <mat-icon *ngIf=\"file.main\">star</mat-icon>\n </button>\n <button\n mat-icon-button\n aria-label=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0444\u0430\u0439\u043B\"\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0444\u0430\u0439\u043B\"\n class=\"color-red\"\n (click)=\"fileDelete(file.id)\"\n >\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n <div class=\"image\">\n <shared-image class=\"mat-elevation-z3\"\n [versions]=\"file.versions\"\n [version]=\"1\"\n [haveZoom]=\"true\"></shared-image>\n </div>\n <div class=\"p-10 cart-title p-0\"\n [ngClass]=\"{'edit-title': edit, 'empty-title': !file.title}\">\n <div class=\"width100 display-flex-space-between edit-block\"\n [ngClass]=\"{'edit-block-open': edit}\">\n\n <!--<shared-image class=\"mlr-5 mat-elevation-z3 width150100\"\n [versions]=\"file.versions\"\n [version]=\"3\"\n [haveZoom]=\"true\"></shared-image>-->\n <div *ngIf=\"!edit && file?.title\" class=\"h3\">{{ file.title }}</div>\n <ng-container *ngIf=\"edit\">\n <textarea type=\"text\"\n placeholder=\"Enter image title...\"\n class=\"edit-textarea\"\n (change)=\"changeTitle($event)\"\n [innerText]=\"file && file.title ? file.title : ''\"></textarea>\n <div class=\"edit-button\">\n <button\n mat-icon-button\n aria-label=\"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\"\n title=\"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\"\n class=\"color-green\"\n (click)=\"saveTitle(file)\"\n >\n <mat-icon>check</mat-icon>\n </button>\n <button\n mat-icon-button\n aria-label=\"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\"\n title=\"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\"\n class=\"color-red\"\n (click)=\"edit = false\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n <shared-spinner\n *ngIf=\"loading\"\n [overlay]=\"true\"\n [diameter]=\"20\"\n [color]=\"'blue'\"></shared-spinner>\n</div>\n", styles: [".fuse-card{display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px;flex-grow:1;flex-basis:0}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.fuse-card:last-child{border:none}.card-list.cdk-drop-list-dragging .fuse-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
641
|
+
}], ctorParameters: () => [{ type: i1.FilesFacade }, { type: i1.NotificationsFacade }, { type: i1.DialogService }, { type: i0.ChangeDetectorRef }, { type: i1.RequestsFacade }], propDecorators: { file: [{
|
|
642
|
+
type: Input
|
|
643
|
+
}], section: [{
|
|
644
|
+
type: Input
|
|
645
|
+
}], itemId: [{
|
|
646
|
+
type: Input
|
|
647
|
+
}], mode: [{
|
|
648
|
+
type: Input
|
|
649
|
+
}] } });
|
|
650
|
+
|
|
651
|
+
class FilesUploadListImagesComponent {
|
|
652
|
+
constructor(filesFacade) {
|
|
653
|
+
this.filesFacade = filesFacade;
|
|
654
|
+
this.mode = FileListModeList;
|
|
655
|
+
this.changeSort = new EventEmitter();
|
|
656
|
+
this.loaded = false;
|
|
657
|
+
this.trackById = trackById;
|
|
658
|
+
this.storedFirstSorting = [];
|
|
659
|
+
this.destroy$ = new Subject();
|
|
660
|
+
}
|
|
661
|
+
ngOnInit() {
|
|
662
|
+
this.getFiles();
|
|
663
|
+
}
|
|
664
|
+
ngOnDestroy() {
|
|
665
|
+
this.destroy$.next();
|
|
666
|
+
this.destroy$.complete();
|
|
667
|
+
}
|
|
668
|
+
getFiles() {
|
|
669
|
+
this.files$ = this.filesFacade.getFiles({
|
|
670
|
+
itemId: this.itemId,
|
|
671
|
+
section: this.section,
|
|
672
|
+
type: this.filesType
|
|
673
|
+
})
|
|
674
|
+
.pipe(map((files) => {
|
|
675
|
+
console.log('files', files);
|
|
676
|
+
if (files && files.length) {
|
|
677
|
+
this.files = files.sort(this.sortFiles);
|
|
678
|
+
this.storedFirstSorting = this.saveFirstSorting(this.files);
|
|
679
|
+
return this.prepareFiles(files);
|
|
680
|
+
}
|
|
681
|
+
return files;
|
|
682
|
+
}), takeUntil(this.destroy$));
|
|
683
|
+
}
|
|
684
|
+
saveFirstSorting(files) {
|
|
685
|
+
return files.map((item, order) => ({ id: item.id, order }));
|
|
686
|
+
}
|
|
687
|
+
sortFiles(a, b) {
|
|
688
|
+
// @ts-ignore
|
|
689
|
+
if (a.order < b.order)
|
|
690
|
+
return -1;
|
|
691
|
+
// @ts-ignore
|
|
692
|
+
if (a.order > b.order)
|
|
693
|
+
return 1;
|
|
694
|
+
return 0;
|
|
695
|
+
}
|
|
696
|
+
prepareFiles(files) {
|
|
697
|
+
let mapFiles;
|
|
698
|
+
if (files) {
|
|
699
|
+
mapFiles = files.sort((a, b) => a.sort - b.sort);
|
|
700
|
+
mapFiles
|
|
701
|
+
.map(file => ({ ...file }))
|
|
702
|
+
.forEach(item => {
|
|
703
|
+
item.edit = false;
|
|
704
|
+
if (!item.title) {
|
|
705
|
+
item.title = '';
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
this.loaded = true;
|
|
710
|
+
return mapFiles;
|
|
711
|
+
}
|
|
712
|
+
drop(event) {
|
|
713
|
+
moveItemInArray(this.files, event.previousIndex, event.currentIndex);
|
|
714
|
+
const newSorting = [];
|
|
715
|
+
this.files.forEach((item, index) => {
|
|
716
|
+
// @ts-ignore
|
|
717
|
+
newSorting.push({ id: item.id, order: index });
|
|
718
|
+
});
|
|
719
|
+
this.changeSort.emit({ newSorting, storedSorting: this.storedFirstSorting });
|
|
720
|
+
}
|
|
721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadListImagesComponent, deps: [{ token: i1.FilesFacade }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FilesUploadListImagesComponent, isStandalone: false, selector: "shared-files-upload-list-images", inputs: { section: "section", filesType: "filesType", itemId: "itemId", mode: "mode" }, outputs: { changeSort: "changeSort" }, ngImport: i0, template: "<div class=\"cards position-relative\">\n <ng-container *ngIf=\"files$ | async as files; else loading\">\n <div *ngIf=\"files.length\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListDropped)=\"drop($event)\"\n class=\"card-list\">\n <!-- trackBy: trackById -->\n <shared-file-list-card\n cdkDrag\n *ngFor=\"let file of files;\"\n @hideToTopOpacity\n [file]=\"file\"\n [section]=\"section\"\n [itemId]=\"itemId\"></shared-file-list-card>\n </div>\n <div *ngIf=\"!files.length\" class=\"empty-list\">\n \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442\n </div>\n </ng-container>\n</div>\n<ng-template #loading>\n <shared-spinner [overlay]=\"true\"></shared-spinner>\n</ng-template>\n", styles: [".image{text-align:center;background-size:cover;background-position:center top;width:318px;height:200px;border-radius:6px;overflow:hidden}.custom-placeholder{background:#d0d0d0;border:dotted 3px #7f7f7f;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.cards,.card-list{display:flex;flex-wrap:wrap}.card-list-sort{flex-direction:column;flex-wrap:nowrap;overflow:hidden}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.fuse-card:last-child{border:none}.card-list.cdk-drop-list-dragging .fuse-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i3$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i1.SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "component", type: FileListCardComponent, selector: "shared-file-list-card", inputs: ["file", "section", "itemId", "mode"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], animations: [hideToTopOpacity], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
723
|
+
}
|
|
724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadListImagesComponent, decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{ selector: 'shared-files-upload-list-images', changeDetection: ChangeDetectionStrategy.OnPush, animations: [hideToTopOpacity], standalone: false, template: "<div class=\"cards position-relative\">\n <ng-container *ngIf=\"files$ | async as files; else loading\">\n <div *ngIf=\"files.length\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListDropped)=\"drop($event)\"\n class=\"card-list\">\n <!-- trackBy: trackById -->\n <shared-file-list-card\n cdkDrag\n *ngFor=\"let file of files;\"\n @hideToTopOpacity\n [file]=\"file\"\n [section]=\"section\"\n [itemId]=\"itemId\"></shared-file-list-card>\n </div>\n <div *ngIf=\"!files.length\" class=\"empty-list\">\n \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442\n </div>\n </ng-container>\n</div>\n<ng-template #loading>\n <shared-spinner [overlay]=\"true\"></shared-spinner>\n</ng-template>\n", styles: [".image{text-align:center;background-size:cover;background-position:center top;width:318px;height:200px;border-radius:6px;overflow:hidden}.custom-placeholder{background:#d0d0d0;border:dotted 3px #7f7f7f;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.cards,.card-list{display:flex;flex-wrap:wrap}.card-list-sort{flex-direction:column;flex-wrap:nowrap;overflow:hidden}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.fuse-card:last-child{border:none}.card-list.cdk-drop-list-dragging .fuse-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
727
|
+
}], ctorParameters: () => [{ type: i1.FilesFacade }], propDecorators: { section: [{
|
|
728
|
+
type: Input
|
|
729
|
+
}], filesType: [{
|
|
730
|
+
type: Input
|
|
731
|
+
}], itemId: [{
|
|
732
|
+
type: Input
|
|
733
|
+
}], mode: [{
|
|
734
|
+
type: Input
|
|
735
|
+
}], changeSort: [{
|
|
736
|
+
type: Output
|
|
737
|
+
}] } });
|
|
738
|
+
|
|
739
|
+
class TableFilesUploadingComponent {
|
|
740
|
+
constructor(filesFacade, notificationsFacade, changeDetectorRef, authenticationService, config) {
|
|
741
|
+
this.filesFacade = filesFacade;
|
|
742
|
+
this.notificationsFacade = notificationsFacade;
|
|
743
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
744
|
+
this.authenticationService = authenticationService;
|
|
745
|
+
this.config = config;
|
|
746
|
+
this.haveElevation = true;
|
|
747
|
+
this.loadingCompleted = new EventEmitter();
|
|
748
|
+
this.hasBaseDropZoneOver = false;
|
|
749
|
+
this.loaded = false;
|
|
750
|
+
this.allProgress$ = new Subject();
|
|
751
|
+
this.itemsProgress$ = new Subject();
|
|
752
|
+
this.itemsProgress = {};
|
|
753
|
+
this.showInputs = true;
|
|
754
|
+
}
|
|
755
|
+
ngOnInit() {
|
|
756
|
+
this.allProgress$.next(0);
|
|
757
|
+
this.itemsProgress$.next({});
|
|
758
|
+
this.initUploader();
|
|
759
|
+
}
|
|
760
|
+
ngOnDestroy() {
|
|
761
|
+
this.allProgress$.complete();
|
|
762
|
+
this.itemsProgress$.complete();
|
|
763
|
+
}
|
|
764
|
+
initUploader() {
|
|
765
|
+
this.publicUrl = this.config.publicUrl;
|
|
766
|
+
const apiUrl = this.config.apiUrl;
|
|
767
|
+
const { token } = this.authenticationService.loadAuthDataFromLocalStore();
|
|
768
|
+
const uploadUrl = `${apiUrl}/api/files/${this.section}/${this.itemId}`;
|
|
769
|
+
this.url = `${this.publicUrl}/${this.section}/${this.itemId}`;
|
|
770
|
+
this.uploader = new FileUploader({
|
|
771
|
+
url: uploadUrl,
|
|
772
|
+
authToken: `JWT ${token}`,
|
|
773
|
+
isHTML5: true,
|
|
774
|
+
autoUpload: true
|
|
775
|
+
});
|
|
776
|
+
this.uploader.onProgressItem = (item, progress) => this.onProgressItem(item, progress);
|
|
777
|
+
this.uploader.onProgressAll = (progress) => this.onProgressAll(progress);
|
|
778
|
+
this.uploader.onErrorItem = (item, response, status, headers) => this.onErrorItem(item, response, status, headers);
|
|
779
|
+
this.uploader.onAfterAddingFile = () => this.onAfterAddingFile();
|
|
780
|
+
this.uploader.onCompleteAll = this.onCompleteAll.bind(this);
|
|
781
|
+
}
|
|
782
|
+
onToggleImageBlockDone(e) {
|
|
783
|
+
if (e.toState === 'open') {
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
fileOverBase(e) {
|
|
787
|
+
this.hasBaseDropZoneOver = e;
|
|
788
|
+
}
|
|
789
|
+
onAfterAddingFile() {
|
|
790
|
+
this.showInputs = false;
|
|
791
|
+
this.changeDetectorRef.markForCheck();
|
|
792
|
+
}
|
|
793
|
+
onProgressItem(fileItem, progress) {
|
|
794
|
+
const fileName = fileItem.file.name;
|
|
795
|
+
this.itemsProgress[fileName] = progress;
|
|
796
|
+
this.itemsProgress$.next(this.itemsProgress);
|
|
797
|
+
}
|
|
798
|
+
onProgressAll(progress) {
|
|
799
|
+
this.allProgress$.next(progress);
|
|
800
|
+
}
|
|
801
|
+
onCompleteAll() {
|
|
802
|
+
this.notificationsFacade.addNotifications({
|
|
803
|
+
type: 'success',
|
|
804
|
+
text: 'Картинки успешно загружены',
|
|
805
|
+
id: 'images.uploads',
|
|
806
|
+
timeout: 2000
|
|
807
|
+
});
|
|
808
|
+
this.filesFacade.loadFiles({ itemId: this.itemId, section: this.section });
|
|
809
|
+
this.loadingCompleted.emit();
|
|
810
|
+
}
|
|
811
|
+
onErrorItem(item, response, status, headers) {
|
|
812
|
+
this.notificationsFacade.addNotifications({
|
|
813
|
+
type: 'error',
|
|
814
|
+
text: 'При загрузке возникли ошибки, попробуйте еще раз',
|
|
815
|
+
title: 'Ошибка',
|
|
816
|
+
id: 'images.uploads'
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableFilesUploadingComponent, deps: [{ token: i1.FilesFacade }, { token: i1.NotificationsFacade }, { token: i0.ChangeDetectorRef }, { token: i1.AuthenticationService }, { token: CORE_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
820
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: TableFilesUploadingComponent, isStandalone: false, selector: "shared-table-files-uploading", inputs: { section: "section", itemId: "itemId", haveElevation: "haveElevation" }, outputs: { loadingCompleted: "loadingCompleted" }, ngImport: i0, template: "<div\n class=\"page-layout simple fullwidth fileUploads\"\n fxLayout=\"column\">\n <!-- CONTENT -->\n <div class=\"p-24\"\n [ngClass]=\"{'mat-card mat-elevation-z4': haveElevation}\">\n <div class=\"row\">\n <div class=\"col-md-12\" *ngIf=\"!uploader.queue.length\" [@appearFromLeftHideToRight]>\n <div class=\"h2 mb-24\">\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B</div>\n <div ng2FileDrop\n [ngClass]=\"{'nv-file-over': hasBaseDropZoneOver}\"\n (fileOver)=\"fileOverBase($event)\"\n [uploader]=\"uploader\"\n class=\"well my-drop-zone\">\n \u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B\n </div>\n <div class=\"p-5\">\n \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B: <input type=\"file\" ng2FileSelect [uploader]=\"uploader\" multiple/><br/>\n </div>\n </div>\n\n <div *ngIf=\"uploader && uploader.queue.length\" [@appearFromLeftHideToRight] class=\"col-md-12\">\n <ng-container *ngIf=\"allProgress$ | async as allProgress\">\n <ng-container *ngIf=\"itemsProgress$ | async as itemsProgress\">\n <ng-container *ngIf=\"allProgress !== 100\">\n <h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A</h3>\n <table class=\"table\">\n <thead>\n <tr>\n <th width=\"50%\">\u0424\u0430\u0439\u043B</th>\n <th>\u0420\u0430\u0437\u043C\u0435\u0440</th>\n <th>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploader.queue\">\n <tr [@appearFromLeftHideToRight] *ngIf=\"itemsProgress[item?.file?.name] !== 100\">\n <td><strong>{{ item?.file?.name }}</strong></td>\n <td nowrap>{{ item?.file?.size / 1024 / 1024 | number:'.2' }} MB</td>\n <td>\n <div class=\"progress\">\n <mat-progress-bar\n class=\"example-margin\"\n color=\"warn\"\n mode=\"determinate\"\n [value]=\"itemsProgress[item?.file?.name] || 0\">\n </mat-progress-bar>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div>\n <div class=\"progress-block\">\n Queue progress:\n <div class=\"progress\">\n <mat-progress-bar\n class=\"example-margin\"\n color=\"warn\"\n mode=\"determinate\"\n [value]=\"allProgress\">\n </mat-progress-bar>\n </div>\n </div>\n <!--<div class=\"text-right\">\n <button mat-flat-button color=\"accent\"\n class=\"mr-5\"\n (click)=\"uploader.uploadAll()\"\n [disabled]=\"!uploader.getNotUploadedItems().length\">\n <mat-icon class=\"fs-18\">get_app</mat-icon>\n \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n <button mat-flat-button color=\"primary\"\n class=\"mr-5\"\n (click)=\"uploader.cancelAll()\"\n [disabled]=\"!uploader.isUploading\">\n <mat-icon class=\"fs-18\">clear</mat-icon>\n \u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n <button mat-flat-button color=\"warn\"\n class=\"mr-5\"\n (click)=\"uploader.clearQueue()\"\n [disabled]=\"!uploader.queue.length\">\n <mat-icon class=\"fs-18\">delete_outline</mat-icon>\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n </div>-->\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.fileUploads{margin-bottom:10px;margin-left:-5px}.fileUploads .mat-card{margin:5px}.nv-file-over{border:dotted 3px #f44336}.cursor-no-pointer{cursor:auto}.table{width:100%}.table tr{line-height:40px;border-top:1px solid #efefef}.table thead{background:#efefef}.table thead th{padding:0 10px}.my-drop-zone{border:dotted 3px lightgray;padding:10px;margin-bottom:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i4$1.FileDropDirective, selector: "[ng2FileDrop]", inputs: ["uploader"], outputs: ["fileOver", "onFileDrop"] }, { kind: "directive", type: i4$1.FileSelectDirective, selector: "[ng2FileSelect]", inputs: ["uploader"], outputs: ["onFileSelected"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.DecimalPipe, name: "number" }], animations: [
|
|
821
|
+
hideToTopOpacity,
|
|
822
|
+
appearFromLeftHideToRight
|
|
823
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
824
|
+
}
|
|
825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableFilesUploadingComponent, decorators: [{
|
|
826
|
+
type: Component,
|
|
827
|
+
args: [{ selector: 'shared-table-files-uploading', animations: [
|
|
828
|
+
hideToTopOpacity,
|
|
829
|
+
appearFromLeftHideToRight
|
|
830
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n class=\"page-layout simple fullwidth fileUploads\"\n fxLayout=\"column\">\n <!-- CONTENT -->\n <div class=\"p-24\"\n [ngClass]=\"{'mat-card mat-elevation-z4': haveElevation}\">\n <div class=\"row\">\n <div class=\"col-md-12\" *ngIf=\"!uploader.queue.length\" [@appearFromLeftHideToRight]>\n <div class=\"h2 mb-24\">\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B</div>\n <div ng2FileDrop\n [ngClass]=\"{'nv-file-over': hasBaseDropZoneOver}\"\n (fileOver)=\"fileOverBase($event)\"\n [uploader]=\"uploader\"\n class=\"well my-drop-zone\">\n \u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B\n </div>\n <div class=\"p-5\">\n \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B: <input type=\"file\" ng2FileSelect [uploader]=\"uploader\" multiple/><br/>\n </div>\n </div>\n\n <div *ngIf=\"uploader && uploader.queue.length\" [@appearFromLeftHideToRight] class=\"col-md-12\">\n <ng-container *ngIf=\"allProgress$ | async as allProgress\">\n <ng-container *ngIf=\"itemsProgress$ | async as itemsProgress\">\n <ng-container *ngIf=\"allProgress !== 100\">\n <h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A</h3>\n <table class=\"table\">\n <thead>\n <tr>\n <th width=\"50%\">\u0424\u0430\u0439\u043B</th>\n <th>\u0420\u0430\u0437\u043C\u0435\u0440</th>\n <th>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploader.queue\">\n <tr [@appearFromLeftHideToRight] *ngIf=\"itemsProgress[item?.file?.name] !== 100\">\n <td><strong>{{ item?.file?.name }}</strong></td>\n <td nowrap>{{ item?.file?.size / 1024 / 1024 | number:'.2' }} MB</td>\n <td>\n <div class=\"progress\">\n <mat-progress-bar\n class=\"example-margin\"\n color=\"warn\"\n mode=\"determinate\"\n [value]=\"itemsProgress[item?.file?.name] || 0\">\n </mat-progress-bar>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div>\n <div class=\"progress-block\">\n Queue progress:\n <div class=\"progress\">\n <mat-progress-bar\n class=\"example-margin\"\n color=\"warn\"\n mode=\"determinate\"\n [value]=\"allProgress\">\n </mat-progress-bar>\n </div>\n </div>\n <!--<div class=\"text-right\">\n <button mat-flat-button color=\"accent\"\n class=\"mr-5\"\n (click)=\"uploader.uploadAll()\"\n [disabled]=\"!uploader.getNotUploadedItems().length\">\n <mat-icon class=\"fs-18\">get_app</mat-icon>\n \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n <button mat-flat-button color=\"primary\"\n class=\"mr-5\"\n (click)=\"uploader.cancelAll()\"\n [disabled]=\"!uploader.isUploading\">\n <mat-icon class=\"fs-18\">clear</mat-icon>\n \u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n <button mat-flat-button color=\"warn\"\n class=\"mr-5\"\n (click)=\"uploader.clearQueue()\"\n [disabled]=\"!uploader.queue.length\">\n <mat-icon class=\"fs-18\">delete_outline</mat-icon>\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435\n </button>\n </div>-->\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.fileUploads{margin-bottom:10px;margin-left:-5px}.fileUploads .mat-card{margin:5px}.nv-file-over{border:dotted 3px #f44336}.cursor-no-pointer{cursor:auto}.table{width:100%}.table tr{line-height:40px;border-top:1px solid #efefef}.table thead{background:#efefef}.table thead th{padding:0 10px}.my-drop-zone{border:dotted 3px lightgray;padding:10px;margin-bottom:10px}\n"] }]
|
|
831
|
+
}], ctorParameters: () => [{ type: i1.FilesFacade }, { type: i1.NotificationsFacade }, { type: i0.ChangeDetectorRef }, { type: i1.AuthenticationService }, { type: undefined, decorators: [{
|
|
832
|
+
type: Inject,
|
|
833
|
+
args: [CORE_CONFIG]
|
|
834
|
+
}] }], propDecorators: { section: [{
|
|
835
|
+
type: Input
|
|
836
|
+
}], itemId: [{
|
|
837
|
+
type: Input
|
|
838
|
+
}], haveElevation: [{
|
|
839
|
+
type: Input
|
|
840
|
+
}], loadingCompleted: [{
|
|
841
|
+
type: Output
|
|
842
|
+
}] } });
|
|
843
|
+
|
|
844
|
+
class FilesUploadComponent {
|
|
845
|
+
constructor(filesFacade, requestsFacade, cd) {
|
|
846
|
+
this.filesFacade = filesFacade;
|
|
847
|
+
this.requestsFacade = requestsFacade;
|
|
848
|
+
this.cd = cd;
|
|
849
|
+
this.haveElevation = true;
|
|
850
|
+
this.uploadFilesState = 'close';
|
|
851
|
+
this.mode = FileListModeList;
|
|
852
|
+
this.fileListModeSort = FileListModeSort;
|
|
853
|
+
this.openState = 'open';
|
|
854
|
+
this.closeState = 'close';
|
|
855
|
+
this.changedSort = false;
|
|
856
|
+
this.filesUrl = 'files';
|
|
857
|
+
this.sortUrl = 'sort';
|
|
858
|
+
this.postMethod = 'post';
|
|
859
|
+
this.request$ = this.requestsFacade.getRequestUpdates(this.filesUrl, this.postMethod, undefined, this.sortUrl);
|
|
860
|
+
this.loadingStatus = RequestStatus.LOADING;
|
|
861
|
+
}
|
|
862
|
+
ngOnInit() {
|
|
863
|
+
}
|
|
864
|
+
ngOnDestroy() {
|
|
865
|
+
this.requestsFacade.deleteRequestWaiter(this.filesUrl, this.postMethod, undefined, this.sortUrl);
|
|
866
|
+
}
|
|
867
|
+
saveSort() {
|
|
868
|
+
this.cancelSort();
|
|
869
|
+
this.requestsFacade.createRequestListener(this.filesUrl, this.postMethod, undefined, this.sortUrl);
|
|
870
|
+
this.filesFacade.filesSort(this.fileOrders);
|
|
871
|
+
}
|
|
872
|
+
changeSort(data) {
|
|
873
|
+
const { newSorting, storedSorting } = data;
|
|
874
|
+
this.fileOrders = [...newSorting];
|
|
875
|
+
this.storedSorting = [...storedSorting];
|
|
876
|
+
this.changedSort = true;
|
|
877
|
+
this.cd.markForCheck();
|
|
878
|
+
}
|
|
879
|
+
cancelSort() {
|
|
880
|
+
this.changedSort = false;
|
|
881
|
+
if (this.storedSorting) {
|
|
882
|
+
this.filesFacade.filesUpdates(this.storedSorting);
|
|
883
|
+
}
|
|
884
|
+
this.cd.markForCheck();
|
|
885
|
+
}
|
|
886
|
+
uploadFilesToggle() {
|
|
887
|
+
this.uploadFilesState = this.uploadFilesState === this.openState ? this.closeState : this.openState;
|
|
888
|
+
}
|
|
889
|
+
loadingCompleted() {
|
|
890
|
+
this.uploadFilesState = this.closeState;
|
|
891
|
+
}
|
|
892
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadComponent, deps: [{ token: i1.FilesFacade }, { token: i1.RequestsFacade }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
893
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FilesUploadComponent, isStandalone: false, selector: "shared-files-upload", inputs: { section: "section", itemId: "itemId", filesType: "filesType", haveElevation: "haveElevation" }, ngImport: i0, template: "<div class=\"text-center mb-14 top-button\">\n <button\n *ngIf=\"!changedSort\"\n @appearOpacity\n mat-stroked-button\n color=\"accent\"\n (click)=\"uploadFilesToggle()\">\n <mat-icon class=\"fs-18\">add_a_photo</mat-icon>\n \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\n </button>\n\n <button *ngIf=\"changedSort\"\n @appearOpacity\n mat-stroked-button\n color=\"primary\"\n (click)=\"cancelSort()\">\n <mat-icon class=\"fs-18\">cancel</mat-icon>\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n *ngIf=\"changedSort\"\n @appearOpacity\n class=\"ml-5\"\n mat-stroked-button\n color=\"accent\"\n [disabled]=\"!fileOrders\"\n (click)=\"saveSort()\">\n <mat-icon class=\"fs-18\">save</mat-icon>\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443\n </button>\n</div>\n\n<shared-table-files-uploading\n [@appearFromLeft]\n *ngIf=\"uploadFilesState === openState\"\n [section]=\"section\"\n [itemId]=\"itemId\"\n [haveElevation]=\"haveElevation\"\n (loadingCompleted)=\"loadingCompleted()\"></shared-table-files-uploading>\n\n<shared-files-upload-list-images\n [@appearFromLeft]\n [section]=\"section\"\n [filesType]=\"filesType\"\n [itemId]=\"itemId\"\n [mode]=\"mode\"\n (changeSort)=\"changeSort($event)\"></shared-files-upload-list-images>\n\n<ng-container *ngIf=\"request$ | async as request\">\n <shared-spinner *ngIf=\"request && request.status === loadingStatus\" [overlay]=\"true\"></shared-spinner>\n</ng-container>\n", styles: [":host{width:100%;padding:10px}.another-file-over-class{border:dotted 3px #4caf50}html,body{height:100%}.cursor-no-pointer{cursor:auto}.edit-title{display:flex;width:100%}.edit-title textarea{flex-grow:1}.edit-title button{width:40px}button mat-icon{margin-right:5px;font-size:20px!important}.mb-14{margin-bottom:14px}.progress-block{margin-bottom:10px}.ml-5{margin-left:5px}.top-button{position:relative;z-index:10}.sub-button{opacity:0;margin-top:-50px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1.SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: FilesUploadListImagesComponent, selector: "shared-files-upload-list-images", inputs: ["section", "filesType", "itemId", "mode"], outputs: ["changeSort"] }, { kind: "component", type: TableFilesUploadingComponent, selector: "shared-table-files-uploading", inputs: ["section", "itemId", "haveElevation"], outputs: ["loadingCompleted"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], animations: [
|
|
894
|
+
appearOpacity,
|
|
895
|
+
appearFromLeft,
|
|
896
|
+
appearFromLeftHideToRight
|
|
897
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
898
|
+
}
|
|
899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadComponent, decorators: [{
|
|
900
|
+
type: Component,
|
|
901
|
+
args: [{ selector: 'shared-files-upload', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
902
|
+
appearOpacity,
|
|
903
|
+
appearFromLeft,
|
|
904
|
+
appearFromLeftHideToRight
|
|
905
|
+
], standalone: false, template: "<div class=\"text-center mb-14 top-button\">\n <button\n *ngIf=\"!changedSort\"\n @appearOpacity\n mat-stroked-button\n color=\"accent\"\n (click)=\"uploadFilesToggle()\">\n <mat-icon class=\"fs-18\">add_a_photo</mat-icon>\n \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\n </button>\n\n <button *ngIf=\"changedSort\"\n @appearOpacity\n mat-stroked-button\n color=\"primary\"\n (click)=\"cancelSort()\">\n <mat-icon class=\"fs-18\">cancel</mat-icon>\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n *ngIf=\"changedSort\"\n @appearOpacity\n class=\"ml-5\"\n mat-stroked-button\n color=\"accent\"\n [disabled]=\"!fileOrders\"\n (click)=\"saveSort()\">\n <mat-icon class=\"fs-18\">save</mat-icon>\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443\n </button>\n</div>\n\n<shared-table-files-uploading\n [@appearFromLeft]\n *ngIf=\"uploadFilesState === openState\"\n [section]=\"section\"\n [itemId]=\"itemId\"\n [haveElevation]=\"haveElevation\"\n (loadingCompleted)=\"loadingCompleted()\"></shared-table-files-uploading>\n\n<shared-files-upload-list-images\n [@appearFromLeft]\n [section]=\"section\"\n [filesType]=\"filesType\"\n [itemId]=\"itemId\"\n [mode]=\"mode\"\n (changeSort)=\"changeSort($event)\"></shared-files-upload-list-images>\n\n<ng-container *ngIf=\"request$ | async as request\">\n <shared-spinner *ngIf=\"request && request.status === loadingStatus\" [overlay]=\"true\"></shared-spinner>\n</ng-container>\n", styles: [":host{width:100%;padding:10px}.another-file-over-class{border:dotted 3px #4caf50}html,body{height:100%}.cursor-no-pointer{cursor:auto}.edit-title{display:flex;width:100%}.edit-title textarea{flex-grow:1}.edit-title button{width:40px}button mat-icon{margin-right:5px;font-size:20px!important}.mb-14{margin-bottom:14px}.progress-block{margin-bottom:10px}.ml-5{margin-left:5px}.top-button{position:relative;z-index:10}.sub-button{opacity:0;margin-top:-50px}\n"] }]
|
|
906
|
+
}], ctorParameters: () => [{ type: i1.FilesFacade }, { type: i1.RequestsFacade }, { type: i0.ChangeDetectorRef }], propDecorators: { section: [{
|
|
907
|
+
type: Input
|
|
908
|
+
}], itemId: [{
|
|
909
|
+
type: Input
|
|
910
|
+
}], filesType: [{
|
|
911
|
+
type: Input
|
|
912
|
+
}], haveElevation: [{
|
|
913
|
+
type: Input
|
|
914
|
+
}] } });
|
|
915
|
+
|
|
916
|
+
class FilesUploadModule {
|
|
917
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
918
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadModule, declarations: [FilesUploadComponent,
|
|
919
|
+
FilesUploadListImagesComponent,
|
|
920
|
+
FileListCardComponent,
|
|
921
|
+
TableFilesUploadingComponent], imports: [CommonModule,
|
|
922
|
+
MatIconModule,
|
|
923
|
+
MatProgressBarModule,
|
|
924
|
+
FileUploadModule,
|
|
925
|
+
DragDropModule,
|
|
926
|
+
SharedSpinnerModule,
|
|
927
|
+
MatButtonModule,
|
|
928
|
+
ImageModule], exports: [FilesUploadComponent,
|
|
929
|
+
DragDropModule] }); }
|
|
930
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadModule, imports: [CommonModule,
|
|
931
|
+
MatIconModule,
|
|
932
|
+
MatProgressBarModule,
|
|
933
|
+
FileUploadModule,
|
|
934
|
+
DragDropModule,
|
|
935
|
+
SharedSpinnerModule,
|
|
936
|
+
MatButtonModule,
|
|
937
|
+
ImageModule, DragDropModule] }); }
|
|
938
|
+
}
|
|
939
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FilesUploadModule, decorators: [{
|
|
940
|
+
type: NgModule,
|
|
941
|
+
args: [{
|
|
942
|
+
imports: [
|
|
943
|
+
CommonModule,
|
|
944
|
+
MatIconModule,
|
|
945
|
+
MatProgressBarModule,
|
|
946
|
+
FileUploadModule,
|
|
947
|
+
DragDropModule,
|
|
948
|
+
SharedSpinnerModule,
|
|
949
|
+
MatButtonModule,
|
|
950
|
+
ImageModule,
|
|
951
|
+
// FlexModule
|
|
952
|
+
// SortablejsModule
|
|
953
|
+
],
|
|
954
|
+
declarations: [
|
|
955
|
+
FilesUploadComponent,
|
|
956
|
+
FilesUploadListImagesComponent,
|
|
957
|
+
FileListCardComponent,
|
|
958
|
+
TableFilesUploadingComponent
|
|
959
|
+
],
|
|
960
|
+
exports: [
|
|
961
|
+
FilesUploadComponent,
|
|
962
|
+
DragDropModule
|
|
963
|
+
]
|
|
964
|
+
}]
|
|
965
|
+
}] });
|
|
966
|
+
|
|
967
|
+
class FormFieldErrorComponent {
|
|
968
|
+
constructor(baseAutoFormService, cd) {
|
|
969
|
+
this.baseAutoFormService = baseAutoFormService;
|
|
970
|
+
this.cd = cd;
|
|
971
|
+
this.unSubscribeSubject$ = new Subject();
|
|
972
|
+
}
|
|
973
|
+
ngOnInit() {
|
|
974
|
+
this.getError();
|
|
975
|
+
this.statusChanges();
|
|
976
|
+
}
|
|
977
|
+
ngOnDestroy() {
|
|
978
|
+
this.unSubscribeSubject$.next();
|
|
979
|
+
this.unSubscribeSubject$.complete();
|
|
980
|
+
}
|
|
981
|
+
statusChanges() {
|
|
982
|
+
this.form.get(this.fieldData.field).statusChanges
|
|
983
|
+
.pipe(takeUntil(this.unSubscribeSubject$))
|
|
984
|
+
.subscribe(() => {
|
|
985
|
+
this.getError();
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
getError() {
|
|
989
|
+
const control = this.form.get(this.fieldData.field);
|
|
990
|
+
const controlValue = control.value;
|
|
991
|
+
if (control && control.errors) {
|
|
992
|
+
Object
|
|
993
|
+
.keys(control.errors)
|
|
994
|
+
.map(errorKey => {
|
|
995
|
+
const fieldValidationErrorTest = this.fieldData.options?.validations?.[errorKey]?.errorText;
|
|
996
|
+
let error;
|
|
997
|
+
switch (errorKey) {
|
|
998
|
+
case 'required':
|
|
999
|
+
error = fieldValidationErrorTest || ERRORS['required'].message1;
|
|
1000
|
+
break;
|
|
1001
|
+
case 'email':
|
|
1002
|
+
error = fieldValidationErrorTest || ERRORS['email'].message1;
|
|
1003
|
+
break;
|
|
1004
|
+
case 'mask':
|
|
1005
|
+
error = fieldValidationErrorTest || ERRORS['mask'].message1;
|
|
1006
|
+
break;
|
|
1007
|
+
case 'minlength':
|
|
1008
|
+
error = fieldValidationErrorTest || ERRORS['minlength'].message1;
|
|
1009
|
+
break;
|
|
1010
|
+
case 'pattern':
|
|
1011
|
+
error = fieldValidationErrorTest || ERRORS['pattern'].message1;
|
|
1012
|
+
break;
|
|
1013
|
+
case 'customValidation':
|
|
1014
|
+
error = fieldValidationErrorTest || control.errors['customValidation'];
|
|
1015
|
+
break;
|
|
1016
|
+
default:
|
|
1017
|
+
error = this.errorMessageTexts && this.errorMessageTexts[errorKey] ? this.errorMessageTexts[errorKey] : errorKey;
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
this.error = this.baseAutoFormService.prepareFieldError(error, {
|
|
1021
|
+
['field']: this.fieldData.title,
|
|
1022
|
+
['valueLength']: controlValue?.length || 0,
|
|
1023
|
+
['requiredLength']: control.errors?.minlength?.requiredLength || 0,
|
|
1024
|
+
['value']: controlValue,
|
|
1025
|
+
});
|
|
1026
|
+
this.cd.markForCheck();
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorComponent, deps: [{ token: i1.BaseAutoFormService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1031
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormFieldErrorComponent, isStandalone: false, selector: "shared-form-field-error", inputs: { fieldData: "fieldData", form: "form", errorMessageTexts: "errorMessageTexts" }, ngImport: i0, template: "<mat-error class=\"field-error\">\n {{error}}\n</mat-error>\n", styles: [""], dependencies: [{ kind: "directive", type: i2$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1032
|
+
}
|
|
1033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorComponent, decorators: [{
|
|
1034
|
+
type: Component,
|
|
1035
|
+
args: [{ selector: 'shared-form-field-error', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<mat-error class=\"field-error\">\n {{error}}\n</mat-error>\n" }]
|
|
1036
|
+
}], ctorParameters: () => [{ type: i1.BaseAutoFormService }, { type: i0.ChangeDetectorRef }], propDecorators: { fieldData: [{
|
|
1037
|
+
type: Input
|
|
1038
|
+
}], form: [{
|
|
1039
|
+
type: Input
|
|
1040
|
+
}], errorMessageTexts: [{
|
|
1041
|
+
type: Input
|
|
1042
|
+
}] } });
|
|
1043
|
+
|
|
1044
|
+
class FormFieldErrorModule {
|
|
1045
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1046
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorModule, declarations: [FormFieldErrorComponent], imports: [CommonModule,
|
|
1047
|
+
MatFormFieldModule], exports: [FormFieldErrorComponent] }); }
|
|
1048
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorModule, imports: [CommonModule,
|
|
1049
|
+
MatFormFieldModule] }); }
|
|
1050
|
+
}
|
|
1051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldErrorModule, decorators: [{
|
|
1052
|
+
type: NgModule,
|
|
1053
|
+
args: [{
|
|
1054
|
+
declarations: [FormFieldErrorComponent],
|
|
1055
|
+
exports: [
|
|
1056
|
+
FormFieldErrorComponent
|
|
1057
|
+
],
|
|
1058
|
+
imports: [
|
|
1059
|
+
CommonModule,
|
|
1060
|
+
MatFormFieldModule
|
|
1061
|
+
]
|
|
1062
|
+
}]
|
|
1063
|
+
}] });
|
|
1064
|
+
|
|
1065
|
+
class FormFieldPublishErrorComponent {
|
|
1066
|
+
constructor(autoFormService, publicationMessagesFacade) {
|
|
1067
|
+
this.autoFormService = autoFormService;
|
|
1068
|
+
this.publicationMessagesFacade = publicationMessagesFacade;
|
|
1069
|
+
this.unSubscribeSubject$ = new Subject();
|
|
1070
|
+
}
|
|
1071
|
+
ngOnInit() {
|
|
1072
|
+
this.subscribeToPublishErError();
|
|
1073
|
+
}
|
|
1074
|
+
ngOnDestroy() {
|
|
1075
|
+
this.unSubscribeSubject$.next();
|
|
1076
|
+
this.unSubscribeSubject$.complete();
|
|
1077
|
+
}
|
|
1078
|
+
subscribeToPublishErError() {
|
|
1079
|
+
const field = this.fieldData.field;
|
|
1080
|
+
const itemId = this.form.get("id")?.value;
|
|
1081
|
+
if (itemId) {
|
|
1082
|
+
this.messages$ = this.publicationMessagesFacade.getPublicationMessage(this.entity, itemId)
|
|
1083
|
+
.pipe(map((items) => items.filter(item => item.field === field)), map((items) => ({
|
|
1084
|
+
errors: items.filter(item => item.isError),
|
|
1085
|
+
recommendations: items.filter(item => !item.isError)
|
|
1086
|
+
})), map((items) => ({
|
|
1087
|
+
errors: this.autoFormService.prepareFormFieldPublicationMessage(items.errors, PublishErrors, [this.fieldData]),
|
|
1088
|
+
recommendations: this.autoFormService.prepareFormFieldPublicationMessage(items.recommendations, PublishErrors, [this.fieldData])
|
|
1089
|
+
})));
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
this.messages$ = EMPTY;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorComponent, deps: [{ token: i1.AutoFormService }, { token: i1.PublicationMessagesFacade }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1096
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormFieldPublishErrorComponent, isStandalone: false, selector: "shared-form-field-publish-error", inputs: { fieldData: "fieldData", form: "form", entity: "entity", errorMessageTexts: "errorMessageTexts" }, ngImport: i0, template: "<ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container *ngFor=\"let messageObj of messages.errors\">\n <div @appearFromLeft class=\"color-red\">\n {{messageObj.description}}\n </div>\n </ng-container>\n <ng-container *ngFor=\"let messageObj of messages.recommendations\">\n <div @appearFromLeft class=\"color-orange\">\n {{messageObj.description}}\n </div>\n </ng-container>\n</ng-container>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], animations: [appearFromLeft], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1097
|
+
}
|
|
1098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorComponent, decorators: [{
|
|
1099
|
+
type: Component,
|
|
1100
|
+
args: [{ selector: "shared-form-field-publish-error", changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearFromLeft], standalone: false, template: "<ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container *ngFor=\"let messageObj of messages.errors\">\n <div @appearFromLeft class=\"color-red\">\n {{messageObj.description}}\n </div>\n </ng-container>\n <ng-container *ngFor=\"let messageObj of messages.recommendations\">\n <div @appearFromLeft class=\"color-orange\">\n {{messageObj.description}}\n </div>\n </ng-container>\n</ng-container>\n\n" }]
|
|
1101
|
+
}], ctorParameters: () => [{ type: i1.AutoFormService }, { type: i1.PublicationMessagesFacade }], propDecorators: { fieldData: [{
|
|
1102
|
+
type: Input
|
|
1103
|
+
}], form: [{
|
|
1104
|
+
type: Input
|
|
1105
|
+
}], entity: [{
|
|
1106
|
+
type: Input
|
|
1107
|
+
}], errorMessageTexts: [{
|
|
1108
|
+
type: Input
|
|
1109
|
+
}] } });
|
|
1110
|
+
|
|
1111
|
+
class FormFieldPublishErrorModule {
|
|
1112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1113
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorModule, declarations: [FormFieldPublishErrorComponent], imports: [CommonModule,
|
|
1114
|
+
MatFormFieldModule], exports: [FormFieldPublishErrorComponent] }); }
|
|
1115
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorModule, imports: [CommonModule,
|
|
1116
|
+
MatFormFieldModule] }); }
|
|
1117
|
+
}
|
|
1118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormFieldPublishErrorModule, decorators: [{
|
|
1119
|
+
type: NgModule,
|
|
1120
|
+
args: [{
|
|
1121
|
+
declarations: [FormFieldPublishErrorComponent],
|
|
1122
|
+
exports: [
|
|
1123
|
+
FormFieldPublishErrorComponent
|
|
1124
|
+
],
|
|
1125
|
+
imports: [
|
|
1126
|
+
CommonModule,
|
|
1127
|
+
MatFormFieldModule
|
|
1128
|
+
]
|
|
1129
|
+
}]
|
|
1130
|
+
}] });
|
|
1131
|
+
|
|
1132
|
+
class HeaderComponent {
|
|
1133
|
+
constructor() {
|
|
1134
|
+
this.title = 'Travel BloGG';
|
|
1135
|
+
this.small = false;
|
|
1136
|
+
}
|
|
1137
|
+
ngOnInit() {
|
|
1138
|
+
}
|
|
1139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: HeaderComponent, isStandalone: false, selector: "shared-header", inputs: { title: "title", subTitle: "subTitle", description: "description", image: "image", small: "small" }, ngImport: i0, template: "<section class=\"home_banner_area\" [ngStyle]=\"{'background-image': image ? ' url(assets/' + image + ')' : '', 'color': '#ff0000'}\">\n <div class=\"banner_inner\" [ngClass]=\"{'dark-bg': image}\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-lg-3 text-right\">\n <div class=\"home_left_img mb-14\">\n <img class=\"img-fluid\" src=\"assets/images/banner/logo.png\" [alt]=\"title\">\n </div>\n </div>\n <div class=\"col-lg-9\" style=\"margin-top: 45px\">\n <div class=\"banner_content\">\n <div *ngIf=\"subTitle\" class=\"sub-title\">{{subTitle}}</div>\n <h1>\n {{title}}\n </h1>\n <p class=\"description\" *ngIf=\"description\">\n {{description}}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n</section>\n", styles: [".description{height:83px;overflow:hidden;line-height:20px;font-size:14px}.dark-bg{background-color:#0000008c}.mb-14{margin-bottom:14px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
1141
|
+
}
|
|
1142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderComponent, decorators: [{
|
|
1143
|
+
type: Component,
|
|
1144
|
+
args: [{ selector: 'shared-header', standalone: false, template: "<section class=\"home_banner_area\" [ngStyle]=\"{'background-image': image ? ' url(assets/' + image + ')' : '', 'color': '#ff0000'}\">\n <div class=\"banner_inner\" [ngClass]=\"{'dark-bg': image}\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-lg-3 text-right\">\n <div class=\"home_left_img mb-14\">\n <img class=\"img-fluid\" src=\"assets/images/banner/logo.png\" [alt]=\"title\">\n </div>\n </div>\n <div class=\"col-lg-9\" style=\"margin-top: 45px\">\n <div class=\"banner_content\">\n <div *ngIf=\"subTitle\" class=\"sub-title\">{{subTitle}}</div>\n <h1>\n {{title}}\n </h1>\n <p class=\"description\" *ngIf=\"description\">\n {{description}}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n</section>\n", styles: [".description{height:83px;overflow:hidden;line-height:20px;font-size:14px}.dark-bg{background-color:#0000008c}.mb-14{margin-bottom:14px}\n"] }]
|
|
1145
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], subTitle: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], description: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], image: [{
|
|
1152
|
+
type: Input
|
|
1153
|
+
}], small: [{
|
|
1154
|
+
type: Input
|
|
1155
|
+
}] } });
|
|
1156
|
+
|
|
1157
|
+
class HeaderModule {
|
|
1158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1159
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: HeaderModule, declarations: [HeaderComponent], imports: [CommonModule], exports: [CommonModule,
|
|
1160
|
+
HeaderComponent] }); }
|
|
1161
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderModule, imports: [CommonModule, CommonModule] }); }
|
|
1162
|
+
}
|
|
1163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderModule, decorators: [{
|
|
1164
|
+
type: NgModule,
|
|
1165
|
+
args: [{
|
|
1166
|
+
declarations: [HeaderComponent],
|
|
1167
|
+
imports: [
|
|
1168
|
+
CommonModule
|
|
1169
|
+
],
|
|
1170
|
+
exports: [
|
|
1171
|
+
CommonModule,
|
|
1172
|
+
HeaderComponent
|
|
1173
|
+
]
|
|
1174
|
+
}]
|
|
1175
|
+
}] });
|
|
1176
|
+
|
|
1177
|
+
class InputTagsComponent {
|
|
1178
|
+
constructor() {
|
|
1179
|
+
this.allTags = [
|
|
1180
|
+
{ id: 1, title: 'Apple' },
|
|
1181
|
+
{ id: 2, title: 'Lemon' },
|
|
1182
|
+
{ id: 3, title: 'Lime' },
|
|
1183
|
+
{ id: 4, title: 'Orange' },
|
|
1184
|
+
{ id: 5, title: 'Strawberry' }
|
|
1185
|
+
];
|
|
1186
|
+
this.tags = [{ id: 2, title: 'Lemon' }];
|
|
1187
|
+
}
|
|
1188
|
+
ngOnInit() {
|
|
1189
|
+
}
|
|
1190
|
+
changedText(tags) {
|
|
1191
|
+
}
|
|
1192
|
+
changedList(tags) {
|
|
1193
|
+
}
|
|
1194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputTagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1195
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: InputTagsComponent, isStandalone: false, selector: "shared-input-tags", ngImport: i0, template: "<ng-container *ngIf=\"allTags && allTags.length\">\n <shared-chips-input\n [title]=\"'Tags'\"\n [items]=\"allTags\"\n [selectedItems]=\"tags\"\n (changedText)=\"changedText($event)\"\n (changedList)=\"changedList($event)\"></shared-chips-input>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ChipsInputComponent, selector: "shared-chips-input", inputs: ["title", "items", "selectedItems"], outputs: ["changedList", "changedText"] }] }); }
|
|
1196
|
+
}
|
|
1197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputTagsComponent, decorators: [{
|
|
1198
|
+
type: Component,
|
|
1199
|
+
args: [{ selector: 'shared-input-tags', standalone: false, template: "<ng-container *ngIf=\"allTags && allTags.length\">\n <shared-chips-input\n [title]=\"'Tags'\"\n [items]=\"allTags\"\n [selectedItems]=\"tags\"\n (changedText)=\"changedText($event)\"\n (changedList)=\"changedList($event)\"></shared-chips-input>\n</ng-container>\n" }]
|
|
1200
|
+
}], ctorParameters: () => [] });
|
|
1201
|
+
|
|
1202
|
+
class InputTagsModule {
|
|
1203
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputTagsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1204
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: InputTagsModule, declarations: [InputTagsComponent], imports: [CommonModule,
|
|
1205
|
+
ChipsInputModule], exports: [InputTagsComponent] }); }
|
|
1206
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputTagsModule, imports: [CommonModule,
|
|
1207
|
+
ChipsInputModule] }); }
|
|
1208
|
+
}
|
|
1209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputTagsModule, decorators: [{
|
|
1210
|
+
type: NgModule,
|
|
1211
|
+
args: [{
|
|
1212
|
+
declarations: [InputTagsComponent],
|
|
1213
|
+
exports: [InputTagsComponent],
|
|
1214
|
+
imports: [
|
|
1215
|
+
CommonModule,
|
|
1216
|
+
ChipsInputModule
|
|
1217
|
+
]
|
|
1218
|
+
}]
|
|
1219
|
+
}] });
|
|
1220
|
+
|
|
1221
|
+
class PanelComponent {
|
|
1222
|
+
constructor() {
|
|
1223
|
+
this.close = new EventEmitter();
|
|
1224
|
+
this.isOpened = false;
|
|
1225
|
+
}
|
|
1226
|
+
ngOnInit() {
|
|
1227
|
+
}
|
|
1228
|
+
toggleExpanded() {
|
|
1229
|
+
this.isOpened = !this.isOpened;
|
|
1230
|
+
}
|
|
1231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1232
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: PanelComponent, isStandalone: false, selector: "shared-panel", inputs: { title: "title", smallDescription: "smallDescription", description: "description", color: "color", buttonColor: "buttonColor" }, outputs: { close: "close" }, ngImport: i0, template: "<div class=\"fuse-card\" [ngClass]=\"'bg-'+color\">\n\n <div class=\"p-10 cursor-pointer\"\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n (click)=\"toggleExpanded()\">\n <div class=\"h4\">{{title}}</div>\n <shared-button\n [color]=\"buttonColor\"\n [icon]=\"isOpened ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></shared-button>\n </div>\n\n <div *ngIf=\"smallDescription\" class=\"p-16 pt-0 line-height-1.75\" [innerHTML]=\"smallDescription\">\n </div>\n\n <div class=\"card-expand-area\" *ngIf=\"isOpened\" [@expandCollapse]>\n <div class=\"card-expanded-content\" [innerHTML]=\"description\"></div>\n </div>\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ButtonComponent, selector: "shared-button", inputs: ["icon", "iconColor", "iconSize", "rightIcon", "disabled", "loading", "active", "stopPropagation", "type", "color", "fullWidth", "size", "styleTheme", "tooltip", "tooltipPosition"], outputs: ["clickButton"] }], animations: [expandCollapse], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1233
|
+
}
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelComponent, decorators: [{
|
|
1235
|
+
type: Component,
|
|
1236
|
+
args: [{ selector: 'shared-panel', animations: [expandCollapse], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"fuse-card\" [ngClass]=\"'bg-'+color\">\n\n <div class=\"p-10 cursor-pointer\"\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n (click)=\"toggleExpanded()\">\n <div class=\"h4\">{{title}}</div>\n <shared-button\n [color]=\"buttonColor\"\n [icon]=\"isOpened ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></shared-button>\n </div>\n\n <div *ngIf=\"smallDescription\" class=\"p-16 pt-0 line-height-1.75\" [innerHTML]=\"smallDescription\">\n </div>\n\n <div class=\"card-expand-area\" *ngIf=\"isOpened\" [@expandCollapse]>\n <div class=\"card-expanded-content\" [innerHTML]=\"description\"></div>\n </div>\n\n</div>\n" }]
|
|
1237
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
1238
|
+
type: Input
|
|
1239
|
+
}], smallDescription: [{
|
|
1240
|
+
type: Input
|
|
1241
|
+
}], description: [{
|
|
1242
|
+
type: Input
|
|
1243
|
+
}], color: [{
|
|
1244
|
+
type: Input
|
|
1245
|
+
}], buttonColor: [{
|
|
1246
|
+
type: Input
|
|
1247
|
+
}], close: [{
|
|
1248
|
+
type: Output
|
|
1249
|
+
}] } });
|
|
1250
|
+
|
|
1251
|
+
class PanelModule {
|
|
1252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1253
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: PanelModule, declarations: [PanelComponent], imports: [CommonModule,
|
|
1254
|
+
ButtonModule], exports: [PanelComponent] }); }
|
|
1255
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelModule, imports: [CommonModule,
|
|
1256
|
+
ButtonModule] }); }
|
|
1257
|
+
}
|
|
1258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelModule, decorators: [{
|
|
1259
|
+
type: NgModule,
|
|
1260
|
+
args: [{
|
|
1261
|
+
declarations: [PanelComponent],
|
|
1262
|
+
imports: [
|
|
1263
|
+
CommonModule,
|
|
1264
|
+
ButtonModule,
|
|
1265
|
+
// FlexModule
|
|
1266
|
+
],
|
|
1267
|
+
exports: [PanelComponent]
|
|
1268
|
+
}]
|
|
1269
|
+
}] });
|
|
1270
|
+
|
|
1271
|
+
class PanelHeaderComponent {
|
|
1272
|
+
constructor() { }
|
|
1273
|
+
ngOnInit() {
|
|
1274
|
+
}
|
|
1275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1276
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: PanelHeaderComponent, isStandalone: false, selector: "shared-panel-header", inputs: { title: "title", parentTitle: "parentTitle", parentUrl: "parentUrl" }, ngImport: i0, template: "<div class=\"header accent p-24 h-160\">\n <div class=\"header-breadcrumbs mt-16\">\n <mat-icon\n class=\"secondary-text s-18 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">home\n </mat-icon>\n\n <!--\n <span class=\"secondary-text\">Documentation</span>\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <span class=\"secondary-text\">Components</span>-->\n <ng-container *ngIf=\"parentTitle\">\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <div class=\"address-paren-item address-item\" [routerLink]=\"parentUrl\">{{parentTitle}}</div>\n </ng-container>\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <div class=\"address-item\">{{title}}</div>\n </div>\n\n <!-- <div class=\"find-block\">\n <mat-form-field>\n <div class=\"find-field\">\n <input matInput #filterInput placeholder=\"\u041F\u043E\u0438\u0441\u043A\">\n <button mat-button [color]=\"'primary'\" (click)=\"applyFilter(filterInput)\" class=\"w-100\">\n \u041D\u0430\u0439\u0442\u0438\n </button>\n <button *ngIf=\"searchText\" mat-button\n (click)=\"applyFilter(filterInput, true)\"\n class=\"ml-5 w-100\">\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n </div>\n </mat-form-field>\n </div>-->\n</div>\n\n", styles: [".address-item{font-size:12px}.address-item.address-paren-item{cursor:pointer;color:#007bff}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1277
|
+
}
|
|
1278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderComponent, decorators: [{
|
|
1279
|
+
type: Component,
|
|
1280
|
+
args: [{ selector: 'shared-panel-header', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"header accent p-24 h-160\">\n <div class=\"header-breadcrumbs mt-16\">\n <mat-icon\n class=\"secondary-text s-18 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">home\n </mat-icon>\n\n <!--\n <span class=\"secondary-text\">Documentation</span>\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <span class=\"secondary-text\">Components</span>-->\n <ng-container *ngIf=\"parentTitle\">\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <div class=\"address-paren-item address-item\" [routerLink]=\"parentUrl\">{{parentTitle}}</div>\n </ng-container>\n <mat-icon\n class=\"secondary-text s-16 mat-icon notranslate material-icons mat-icon-no-color\"\n role=\"img\" aria-hidden=\"true\">chevron_right\n </mat-icon>\n <div class=\"address-item\">{{title}}</div>\n </div>\n\n <!-- <div class=\"find-block\">\n <mat-form-field>\n <div class=\"find-field\">\n <input matInput #filterInput placeholder=\"\u041F\u043E\u0438\u0441\u043A\">\n <button mat-button [color]=\"'primary'\" (click)=\"applyFilter(filterInput)\" class=\"w-100\">\n \u041D\u0430\u0439\u0442\u0438\n </button>\n <button *ngIf=\"searchText\" mat-button\n (click)=\"applyFilter(filterInput, true)\"\n class=\"ml-5 w-100\">\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n </div>\n </mat-form-field>\n </div>-->\n</div>\n\n", styles: [".address-item{font-size:12px}.address-item.address-paren-item{cursor:pointer;color:#007bff}\n"] }]
|
|
1281
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
1282
|
+
type: Input
|
|
1283
|
+
}], parentTitle: [{
|
|
1284
|
+
type: Input
|
|
1285
|
+
}], parentUrl: [{
|
|
1286
|
+
type: Input
|
|
1287
|
+
}] } });
|
|
1288
|
+
|
|
1289
|
+
class PanelHeaderModule {
|
|
1290
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1291
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderModule, declarations: [PanelHeaderComponent], imports: [CommonModule,
|
|
1292
|
+
MatIconModule,
|
|
1293
|
+
MatFormFieldModule,
|
|
1294
|
+
MatButtonModule,
|
|
1295
|
+
MatInputModule,
|
|
1296
|
+
// FlexLayoutModule,
|
|
1297
|
+
RouterModule], exports: [PanelHeaderComponent] }); }
|
|
1298
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderModule, imports: [CommonModule,
|
|
1299
|
+
MatIconModule,
|
|
1300
|
+
MatFormFieldModule,
|
|
1301
|
+
MatButtonModule,
|
|
1302
|
+
MatInputModule,
|
|
1303
|
+
// FlexLayoutModule,
|
|
1304
|
+
RouterModule] }); }
|
|
1305
|
+
}
|
|
1306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PanelHeaderModule, decorators: [{
|
|
1307
|
+
type: NgModule,
|
|
1308
|
+
args: [{
|
|
1309
|
+
declarations: [PanelHeaderComponent],
|
|
1310
|
+
exports: [PanelHeaderComponent],
|
|
1311
|
+
imports: [
|
|
1312
|
+
CommonModule,
|
|
1313
|
+
MatIconModule,
|
|
1314
|
+
MatFormFieldModule,
|
|
1315
|
+
MatButtonModule,
|
|
1316
|
+
MatInputModule,
|
|
1317
|
+
// FlexLayoutModule,
|
|
1318
|
+
RouterModule
|
|
1319
|
+
]
|
|
1320
|
+
}]
|
|
1321
|
+
}] });
|
|
1322
|
+
|
|
1323
|
+
class SmartProgressBarComponent {
|
|
1324
|
+
constructor() {
|
|
1325
|
+
this.showValue = true;
|
|
1326
|
+
}
|
|
1327
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1328
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: SmartProgressBarComponent, isStandalone: false, selector: "shared-smart-progress-bar", inputs: { value: "value", title: "title", showValue: "showValue" }, ngImport: i0, template: "<div class=\"progress\">\n <div class=\"progress-bar\"\n role=\"progressbar\"\n [title]=\"title\"\n [style]=\"{width: value + '%'}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [class.bg-0]=\"value <= 30\"\n [class.bg-1]=\"value > 30 && value <= 40\"\n [class.bg-2]=\"value > 40 && value <= 50\"\n [class.bg-3]=\"value > 50 && value <= 60\"\n [class.bg-4]=\"value > 60 && value <= 70\"\n [class.bg-5]=\"value > 70 && value <= 85\"\n [class.bg-6]=\"value > 85\">\n <ng-container *ngIf=\"value\">\u0424\u043E\u0440\u043C\u0430 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0430 \u043D\u0430 {{value}}%</ng-container>\n </div>\n</div>\n\n", styles: [".progress{display:flex;height:13px;overflow:hidden;font-size:10px;background-color:#e9ecef;border-radius:.25rem;margin-bottom:10px}.progress .progress-bar{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:transparent!important;transition:all .6s ease}.progress .progress-bar.bg-0{background-color:#e72235!important}.progress .progress-bar.bg-1{background-color:#dc4835!important}.progress .progress-bar.bg-2{background-color:#c09841!important}.progress .progress-bar.bg-3{background-color:#b6962b!important}.progress .progress-bar.bg-4{background-color:#9cad04!important}.progress .progress-bar.bg-5{background-color:#548804!important}.progress .progress-bar.bg-6{background-color:#28a745!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1329
|
+
}
|
|
1330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarComponent, decorators: [{
|
|
1331
|
+
type: Component,
|
|
1332
|
+
args: [{ selector: 'shared-smart-progress-bar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"progress\">\n <div class=\"progress-bar\"\n role=\"progressbar\"\n [title]=\"title\"\n [style]=\"{width: value + '%'}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [class.bg-0]=\"value <= 30\"\n [class.bg-1]=\"value > 30 && value <= 40\"\n [class.bg-2]=\"value > 40 && value <= 50\"\n [class.bg-3]=\"value > 50 && value <= 60\"\n [class.bg-4]=\"value > 60 && value <= 70\"\n [class.bg-5]=\"value > 70 && value <= 85\"\n [class.bg-6]=\"value > 85\">\n <ng-container *ngIf=\"value\">\u0424\u043E\u0440\u043C\u0430 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0430 \u043D\u0430 {{value}}%</ng-container>\n </div>\n</div>\n\n", styles: [".progress{display:flex;height:13px;overflow:hidden;font-size:10px;background-color:#e9ecef;border-radius:.25rem;margin-bottom:10px}.progress .progress-bar{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:transparent!important;transition:all .6s ease}.progress .progress-bar.bg-0{background-color:#e72235!important}.progress .progress-bar.bg-1{background-color:#dc4835!important}.progress .progress-bar.bg-2{background-color:#c09841!important}.progress .progress-bar.bg-3{background-color:#b6962b!important}.progress .progress-bar.bg-4{background-color:#9cad04!important}.progress .progress-bar.bg-5{background-color:#548804!important}.progress .progress-bar.bg-6{background-color:#28a745!important}\n"] }]
|
|
1333
|
+
}], propDecorators: { value: [{
|
|
1334
|
+
type: Input
|
|
1335
|
+
}], title: [{
|
|
1336
|
+
type: Input
|
|
1337
|
+
}], showValue: [{
|
|
1338
|
+
type: Input
|
|
1339
|
+
}] } });
|
|
1340
|
+
|
|
1341
|
+
class SmartProgressBarModule {
|
|
1342
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1343
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarModule, declarations: [SmartProgressBarComponent], imports: [CommonModule], exports: [SmartProgressBarComponent] }); }
|
|
1344
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarModule, imports: [CommonModule] }); }
|
|
1345
|
+
}
|
|
1346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SmartProgressBarModule, decorators: [{
|
|
1347
|
+
type: NgModule,
|
|
1348
|
+
args: [{
|
|
1349
|
+
declarations: [SmartProgressBarComponent],
|
|
1350
|
+
imports: [CommonModule],
|
|
1351
|
+
exports: [SmartProgressBarComponent]
|
|
1352
|
+
}]
|
|
1353
|
+
}] });
|
|
1354
|
+
|
|
1355
|
+
const defaultStickySidebarOptions = {
|
|
1356
|
+
topSpacing: 0,
|
|
1357
|
+
bottomSpacing: 0,
|
|
1358
|
+
stickyClass: 'is-affixed',
|
|
1359
|
+
resizeSensor: true,
|
|
1360
|
+
minWidth: false,
|
|
1361
|
+
containerSelector: '.container',
|
|
1362
|
+
containerForWidth: false
|
|
1363
|
+
};
|
|
1364
|
+
const STICKY_SIDEBAR_OPTIONS = new InjectionToken('STICKY_SIDEBAR_OPTIONS');
|
|
1365
|
+
class StickySidebarDirective {
|
|
1366
|
+
constructor(element, _options, zone, renderer, platformId) {
|
|
1367
|
+
this.element = element;
|
|
1368
|
+
this._options = _options;
|
|
1369
|
+
this.zone = zone;
|
|
1370
|
+
this.renderer = renderer;
|
|
1371
|
+
this.platformId = platformId;
|
|
1372
|
+
this.affixedType = 'STATIC';
|
|
1373
|
+
this.direction = 'down';
|
|
1374
|
+
this.support = {
|
|
1375
|
+
transform: false,
|
|
1376
|
+
transform3d: false
|
|
1377
|
+
};
|
|
1378
|
+
this._initialized = false;
|
|
1379
|
+
this._reStyle = false;
|
|
1380
|
+
this._breakpoint = false;
|
|
1381
|
+
// Dimensions of sidebar, container and screen viewport.
|
|
1382
|
+
this.dimensions = {
|
|
1383
|
+
translateY: 0,
|
|
1384
|
+
maxTranslateY: 0,
|
|
1385
|
+
topSpacing: 0,
|
|
1386
|
+
lastTopSpacing: 0,
|
|
1387
|
+
bottomSpacing: 0,
|
|
1388
|
+
lastBottomSpacing: 0,
|
|
1389
|
+
sidebarHeight: 0,
|
|
1390
|
+
sidebarWidth: 0,
|
|
1391
|
+
containerTop: 0,
|
|
1392
|
+
containerHeight: 0,
|
|
1393
|
+
containerBottom: 0,
|
|
1394
|
+
viewportHeight: 0,
|
|
1395
|
+
viewportTop: 0,
|
|
1396
|
+
lastViewportTop: 0,
|
|
1397
|
+
sidebarLeft: 0,
|
|
1398
|
+
viewportBottom: 0,
|
|
1399
|
+
viewportLeft: 0
|
|
1400
|
+
};
|
|
1401
|
+
this.lastScrollTop = 0;
|
|
1402
|
+
this.resize = new Subject();
|
|
1403
|
+
this.options = _options && { ...defaultStickySidebarOptions, ..._options } || defaultStickySidebarOptions;
|
|
1404
|
+
if (isPlatformBrowser(platformId)) {
|
|
1405
|
+
this.sidebarEl = this.element.nativeElement;
|
|
1406
|
+
this._setSupportFeatures();
|
|
1407
|
+
this.bindEvents();
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
static offsetRelative(element) {
|
|
1411
|
+
const result = { left: 0, top: 0 };
|
|
1412
|
+
let el = element;
|
|
1413
|
+
do {
|
|
1414
|
+
const offsetTop = el.offsetTop;
|
|
1415
|
+
const offsetLeft = el.offsetLeft;
|
|
1416
|
+
if (!isNaN(offsetTop))
|
|
1417
|
+
result.top += offsetTop;
|
|
1418
|
+
if (!isNaN(offsetLeft))
|
|
1419
|
+
result.left += offsetLeft;
|
|
1420
|
+
el =
|
|
1421
|
+
'BODY' === element.tagName
|
|
1422
|
+
? el.parentElement
|
|
1423
|
+
: el.offsetParent;
|
|
1424
|
+
} while (el);
|
|
1425
|
+
return result;
|
|
1426
|
+
}
|
|
1427
|
+
ngOnInit() {
|
|
1428
|
+
}
|
|
1429
|
+
bindEvents() {
|
|
1430
|
+
// this.resizeDetector = elementResizeDetectorMaker();
|
|
1431
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
1432
|
+
this.zone.runOutsideAngular(() => {
|
|
1433
|
+
this.eventSub = merge(fromEvent(window, 'scroll'), fromEvent(window, 'resize')).subscribe(evt => {
|
|
1434
|
+
if (evt.type === 'scroll') {
|
|
1435
|
+
const scrollTop = this.getScrollTop();
|
|
1436
|
+
this.scrollDirection = scrollTop > this.lastScrollTop ? 'down' : 'top';
|
|
1437
|
+
this.lastScrollTop = scrollTop;
|
|
1438
|
+
}
|
|
1439
|
+
this.updateSticky(evt);
|
|
1440
|
+
});
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
ngOnDestroy() {
|
|
1445
|
+
if (!isPlatformBrowser(this.platformId))
|
|
1446
|
+
return;
|
|
1447
|
+
if (this.eventSub)
|
|
1448
|
+
this.eventSub.unsubscribe();
|
|
1449
|
+
if (this.sidebarInner && this.sidebarInner.nativeElement)
|
|
1450
|
+
this.removeResizeEventListener(this.sidebarInner.nativeElement);
|
|
1451
|
+
if (this.container)
|
|
1452
|
+
this.removeResizeEventListener(this.container);
|
|
1453
|
+
}
|
|
1454
|
+
ngAfterContentInit() {
|
|
1455
|
+
if (!isPlatformBrowser(this.platformId))
|
|
1456
|
+
return;
|
|
1457
|
+
if (this.options.containerSelector) {
|
|
1458
|
+
let containers = document.querySelectorAll(this.options.containerSelector);
|
|
1459
|
+
containers = Array.prototype.slice.call(containers);
|
|
1460
|
+
containers.forEach((container, item) => {
|
|
1461
|
+
if (!container.contains(this.element.nativeElement))
|
|
1462
|
+
return;
|
|
1463
|
+
this.container = container;
|
|
1464
|
+
});
|
|
1465
|
+
if (!containers.length)
|
|
1466
|
+
throw new Error('The container does not contains on the sidebar.');
|
|
1467
|
+
}
|
|
1468
|
+
if (this.options.containerForWidth) {
|
|
1469
|
+
let containersForWidth = document.querySelectorAll(this.options.containerForWidth);
|
|
1470
|
+
containersForWidth = Array.prototype.slice.call(containersForWidth);
|
|
1471
|
+
containersForWidth.forEach((containerW, item) => {
|
|
1472
|
+
if (!containerW.contains(this.element.nativeElement))
|
|
1473
|
+
return;
|
|
1474
|
+
this.containerForWidth = containerW;
|
|
1475
|
+
});
|
|
1476
|
+
if (!containersForWidth.length)
|
|
1477
|
+
throw new Error('The container does not contains on the sidebar.');
|
|
1478
|
+
}
|
|
1479
|
+
this._widthBreakpoint();
|
|
1480
|
+
this.calcDimensions();
|
|
1481
|
+
this.stickyPosition();
|
|
1482
|
+
this._updateStickyListener = this.handleResizeEvent.bind(this);
|
|
1483
|
+
this.addResizeEventListener(this.sidebarInner.nativeElement, this._updateStickyListener);
|
|
1484
|
+
this.addResizeEventListener(this.container, this._updateStickyListener);
|
|
1485
|
+
this.zone.runOutsideAngular(() => {
|
|
1486
|
+
this.eventSub.add(this.resize.subscribe((evt) => {
|
|
1487
|
+
this.updateSticky(evt);
|
|
1488
|
+
}));
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
handleResizeEvent(evt) {
|
|
1492
|
+
this.direction = 'down';
|
|
1493
|
+
this.resize.next(evt);
|
|
1494
|
+
}
|
|
1495
|
+
addResizeEventListener(element, handler) {
|
|
1496
|
+
// this.resizeDetector.listenTo(element, handler);
|
|
1497
|
+
}
|
|
1498
|
+
removeResizeEventListener(element) {
|
|
1499
|
+
// if (this.resizeDetector)
|
|
1500
|
+
// this.resizeDetector.uninstall(element);
|
|
1501
|
+
}
|
|
1502
|
+
calcDimensions() {
|
|
1503
|
+
if (this._breakpoint)
|
|
1504
|
+
return;
|
|
1505
|
+
const dims = this.dimensions;
|
|
1506
|
+
// Container of sticky sidebar dimensions.
|
|
1507
|
+
dims.containerTop = StickySidebarDirective.offsetRelative(this.container).top;
|
|
1508
|
+
dims.containerHeight = this.container.clientHeight;
|
|
1509
|
+
dims.containerBottom = dims.containerTop + dims.containerHeight;
|
|
1510
|
+
// Sidebar dimensions.
|
|
1511
|
+
dims.sidebarHeight = this.sidebarInner.nativeElement.offsetHeight;
|
|
1512
|
+
dims.sidebarWidth = this.options.containerForWidth ? this.containerForWidth.offsetWidth : this.sidebarInner.nativeElement.offsetWidth;
|
|
1513
|
+
// Screen viewport dimensions.
|
|
1514
|
+
dims.viewportHeight = isPlatformBrowser(this.platformId) ? window.innerHeight : null;
|
|
1515
|
+
// Maximum sidebar translate Y.
|
|
1516
|
+
dims.maxTranslateY = dims.containerHeight - dims.sidebarHeight;
|
|
1517
|
+
this._calcDimensionsWithScroll();
|
|
1518
|
+
}
|
|
1519
|
+
_calcDimensionsWithScroll() {
|
|
1520
|
+
const dims = this.dimensions;
|
|
1521
|
+
dims.sidebarLeft = StickySidebarDirective.offsetRelative(this.sidebarEl).left;
|
|
1522
|
+
dims.viewportTop = this.getScrollTop();
|
|
1523
|
+
dims.viewportBottom = dims.viewportTop + dims.viewportHeight;
|
|
1524
|
+
dims.viewportLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
1525
|
+
dims.topSpacing = this.options.topSpacing;
|
|
1526
|
+
dims.bottomSpacing = this.options.bottomSpacing;
|
|
1527
|
+
if ('VIEWPORT-TOP' === this.affixedType) {
|
|
1528
|
+
if (dims.topSpacing < dims.lastTopSpacing) {
|
|
1529
|
+
dims.translateY += dims.lastTopSpacing - dims.topSpacing;
|
|
1530
|
+
this._reStyle = true;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
else if ('VIEWPORT-BOTTOM' === this.affixedType) {
|
|
1534
|
+
// Adjust translate Y in the case decrease bottom spacing value.
|
|
1535
|
+
if (dims.bottomSpacing < dims.lastBottomSpacing) {
|
|
1536
|
+
dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing;
|
|
1537
|
+
this._reStyle = true;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
dims.lastTopSpacing = dims.topSpacing;
|
|
1541
|
+
dims.lastBottomSpacing = dims.bottomSpacing;
|
|
1542
|
+
}
|
|
1543
|
+
isSidebarFitsViewport() {
|
|
1544
|
+
const dims = this.dimensions;
|
|
1545
|
+
const offset = this.scrollDirection === 'down' ? dims.lastBottomSpacing : dims.lastTopSpacing;
|
|
1546
|
+
return this.dimensions.sidebarHeight + offset < this.dimensions.viewportHeight;
|
|
1547
|
+
}
|
|
1548
|
+
observeScrollDir() {
|
|
1549
|
+
const dims = this.dimensions;
|
|
1550
|
+
if (dims.lastViewportTop === dims.viewportTop)
|
|
1551
|
+
return;
|
|
1552
|
+
const furthest = 'down' === this.direction ? Math.min : Math.max;
|
|
1553
|
+
if (dims.viewportTop === furthest(dims.viewportTop, dims.lastViewportTop))
|
|
1554
|
+
this.direction = 'down' === this.direction ? 'up' : 'down';
|
|
1555
|
+
}
|
|
1556
|
+
getAffixType() {
|
|
1557
|
+
this._calcDimensionsWithScroll();
|
|
1558
|
+
const dims = this.dimensions;
|
|
1559
|
+
const colliderTop = dims.viewportTop + dims.topSpacing;
|
|
1560
|
+
let affixType = this.affixedType;
|
|
1561
|
+
if (colliderTop <= dims.containerTop || dims.containerHeight <= dims.sidebarHeight) {
|
|
1562
|
+
dims.translateY = 0;
|
|
1563
|
+
affixType = 'STATIC';
|
|
1564
|
+
}
|
|
1565
|
+
else {
|
|
1566
|
+
affixType =
|
|
1567
|
+
'up' === this.direction
|
|
1568
|
+
? this._getAffixTypeScrollingUp()
|
|
1569
|
+
: this._getAffixTypeScrollingDown();
|
|
1570
|
+
}
|
|
1571
|
+
dims.translateY = Math.max(0, dims.translateY);
|
|
1572
|
+
dims.translateY = Math.min(dims.containerHeight, dims.translateY);
|
|
1573
|
+
dims.translateY = Math.round(dims.translateY);
|
|
1574
|
+
dims.lastViewportTop = dims.viewportTop;
|
|
1575
|
+
return affixType;
|
|
1576
|
+
}
|
|
1577
|
+
_getAffixTypeScrollingDown() {
|
|
1578
|
+
const dims = this.dimensions;
|
|
1579
|
+
const sidebarBottom = dims.sidebarHeight + dims.containerTop;
|
|
1580
|
+
const colliderTop = dims.viewportTop + dims.topSpacing;
|
|
1581
|
+
const colliderBottom = dims.viewportBottom - dims.bottomSpacing;
|
|
1582
|
+
let affixType = this.affixedType;
|
|
1583
|
+
if (this.isSidebarFitsViewport()) {
|
|
1584
|
+
if (dims.sidebarHeight + colliderTop >= dims.containerBottom) {
|
|
1585
|
+
dims.translateY = dims.containerBottom - sidebarBottom;
|
|
1586
|
+
affixType = 'CONTAINER-BOTTOM';
|
|
1587
|
+
}
|
|
1588
|
+
else if (colliderTop >= dims.containerTop) {
|
|
1589
|
+
dims.translateY = colliderTop - dims.containerTop;
|
|
1590
|
+
affixType = 'VIEWPORT-TOP';
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
else {
|
|
1594
|
+
if (dims.containerBottom <= colliderBottom) {
|
|
1595
|
+
dims.translateY = dims.containerBottom - sidebarBottom;
|
|
1596
|
+
affixType = 'CONTAINER-BOTTOM';
|
|
1597
|
+
}
|
|
1598
|
+
else if (sidebarBottom + dims.translateY <= colliderBottom) {
|
|
1599
|
+
dims.translateY = colliderBottom - sidebarBottom;
|
|
1600
|
+
affixType = 'VIEWPORT-BOTTOM';
|
|
1601
|
+
}
|
|
1602
|
+
else if (dims.containerTop + dims.translateY <= colliderTop &&
|
|
1603
|
+
(0 !== dims.translateY && dims.maxTranslateY !== dims.translateY)) {
|
|
1604
|
+
affixType = 'VIEWPORT-UNBOTTOM';
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
return affixType;
|
|
1608
|
+
}
|
|
1609
|
+
_getAffixTypeScrollingUp() {
|
|
1610
|
+
const dims = this.dimensions;
|
|
1611
|
+
const sidebarBottom = dims.sidebarHeight + dims.containerTop;
|
|
1612
|
+
const colliderTop = dims.viewportTop + dims.topSpacing;
|
|
1613
|
+
const colliderBottom = dims.viewportBottom - dims.bottomSpacing;
|
|
1614
|
+
let affixType = this.affixedType;
|
|
1615
|
+
if (colliderTop <= dims.translateY + dims.containerTop) {
|
|
1616
|
+
dims.translateY = colliderTop - dims.containerTop;
|
|
1617
|
+
affixType = 'VIEWPORT-TOP';
|
|
1618
|
+
}
|
|
1619
|
+
else if (dims.containerBottom <= colliderBottom) {
|
|
1620
|
+
dims.translateY = dims.containerBottom - sidebarBottom;
|
|
1621
|
+
affixType = 'CONTAINER-BOTTOM';
|
|
1622
|
+
}
|
|
1623
|
+
else if (!this.isSidebarFitsViewport()) {
|
|
1624
|
+
if (dims.containerTop <= colliderTop &&
|
|
1625
|
+
(0 !== dims.translateY && dims.maxTranslateY !== dims.translateY)) {
|
|
1626
|
+
affixType = 'VIEWPORT-UNBOTTOM';
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
return affixType;
|
|
1630
|
+
}
|
|
1631
|
+
_getStyle(affixType) {
|
|
1632
|
+
if ('undefined' === typeof affixType)
|
|
1633
|
+
return;
|
|
1634
|
+
const style = { inner: {}, outer: {} };
|
|
1635
|
+
const dims = this.dimensions;
|
|
1636
|
+
switch (affixType) {
|
|
1637
|
+
case 'VIEWPORT-TOP':
|
|
1638
|
+
style.inner = {
|
|
1639
|
+
position: 'fixed',
|
|
1640
|
+
top: dims.topSpacing,
|
|
1641
|
+
left: dims.sidebarLeft - dims.viewportLeft,
|
|
1642
|
+
width: dims.sidebarWidth
|
|
1643
|
+
};
|
|
1644
|
+
break;
|
|
1645
|
+
case 'VIEWPORT-BOTTOM':
|
|
1646
|
+
style.inner = {
|
|
1647
|
+
position: 'fixed',
|
|
1648
|
+
top: 'auto',
|
|
1649
|
+
left: dims.sidebarLeft,
|
|
1650
|
+
bottom: dims.bottomSpacing,
|
|
1651
|
+
width: dims.sidebarWidth
|
|
1652
|
+
};
|
|
1653
|
+
break;
|
|
1654
|
+
case 'CONTAINER-BOTTOM':
|
|
1655
|
+
case 'VIEWPORT-UNBOTTOM':
|
|
1656
|
+
const translate = this._getTranslate('0', dims.translateY + 'px');
|
|
1657
|
+
if (translate)
|
|
1658
|
+
style.inner = { transform: translate };
|
|
1659
|
+
else
|
|
1660
|
+
style.inner = { position: 'absolute', top: dims.translateY, width: dims.sidebarWidth };
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
switch (affixType) {
|
|
1664
|
+
case 'VIEWPORT-TOP':
|
|
1665
|
+
case 'VIEWPORT-BOTTOM':
|
|
1666
|
+
case 'VIEWPORT-UNBOTTOM':
|
|
1667
|
+
case 'CONTAINER-BOTTOM':
|
|
1668
|
+
style.outer = { height: dims.sidebarHeight, position: 'relative' };
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
style.outer = { height: '', position: '', ...style.outer };
|
|
1672
|
+
style.inner = {
|
|
1673
|
+
position: 'relative',
|
|
1674
|
+
top: '',
|
|
1675
|
+
left: '',
|
|
1676
|
+
bottom: '',
|
|
1677
|
+
width: '',
|
|
1678
|
+
transform: '',
|
|
1679
|
+
...style.inner
|
|
1680
|
+
};
|
|
1681
|
+
return style;
|
|
1682
|
+
}
|
|
1683
|
+
stickyPosition(force = false) {
|
|
1684
|
+
if (this._breakpoint)
|
|
1685
|
+
return;
|
|
1686
|
+
force = this._reStyle || force || false;
|
|
1687
|
+
const offsetTop = this.options.topSpacing;
|
|
1688
|
+
const offsetBottom = this.options.bottomSpacing;
|
|
1689
|
+
const affixType = this.getAffixType();
|
|
1690
|
+
const style = this._getStyle(affixType);
|
|
1691
|
+
const innerEl = this.sidebarInner.nativeElement;
|
|
1692
|
+
if ((this.affixedType !== affixType || force) && affixType) {
|
|
1693
|
+
//const affixEvent = 'affix.' + affixType.toLowerCase().replace('viewport-', '') + StickySidebarDirective.EVENT_KEY;
|
|
1694
|
+
//StickySidebar.eventTrigger(this.sidebar, affixEvent);
|
|
1695
|
+
if ('STATIC' === affixType)
|
|
1696
|
+
this.renderer.removeClass(this.sidebarEl, this.options.stickyClass);
|
|
1697
|
+
else
|
|
1698
|
+
this.renderer.addClass(this.sidebarEl, this.options.stickyClass);
|
|
1699
|
+
Object.keys(style.outer).forEach(key => {
|
|
1700
|
+
const unit = 'number' === typeof style.outer[key] ? 'px' : '';
|
|
1701
|
+
this.sidebarEl.style[key] = style.outer[key] + unit;
|
|
1702
|
+
});
|
|
1703
|
+
Object.keys(style.inner).forEach(key => {
|
|
1704
|
+
const unit = 'number' === typeof style.inner[key] ? 'px' : '';
|
|
1705
|
+
innerEl.style[key] = style.inner[key] + unit;
|
|
1706
|
+
});
|
|
1707
|
+
//const affixedEvent = 'affixed.'+ affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY;
|
|
1708
|
+
//StickySidebar.eventTrigger(this.sidebar, affixedEvent);
|
|
1709
|
+
}
|
|
1710
|
+
else {
|
|
1711
|
+
if (this._initialized)
|
|
1712
|
+
innerEl.style.left = style.inner['left'];
|
|
1713
|
+
}
|
|
1714
|
+
this.affixedType = affixType;
|
|
1715
|
+
}
|
|
1716
|
+
_widthBreakpoint() {
|
|
1717
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
1718
|
+
if (Number(window.innerWidth) <= Number(this.options.minWidth)) {
|
|
1719
|
+
this._breakpoint = true;
|
|
1720
|
+
this.affixedType = 'STATIC';
|
|
1721
|
+
this.renderer.removeAttribute(this.sidebarEl, 'style');
|
|
1722
|
+
this.renderer.removeAttribute(this.sidebarInner.nativeElement, 'style');
|
|
1723
|
+
this.renderer.removeClass(this.sidebarEl, this.options.stickyClass);
|
|
1724
|
+
}
|
|
1725
|
+
else {
|
|
1726
|
+
this._breakpoint = false;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
updateSticky(event) {
|
|
1731
|
+
if (this._running)
|
|
1732
|
+
return;
|
|
1733
|
+
this._running = true;
|
|
1734
|
+
(eventType => {
|
|
1735
|
+
requestAnimationFrame(() => {
|
|
1736
|
+
switch (eventType) {
|
|
1737
|
+
case 'scroll':
|
|
1738
|
+
this._calcDimensionsWithScroll();
|
|
1739
|
+
this.observeScrollDir();
|
|
1740
|
+
this.stickyPosition();
|
|
1741
|
+
break;
|
|
1742
|
+
// When browser is resizing or there's no event, observe width
|
|
1743
|
+
// breakpoint and re-calculate dimensions.
|
|
1744
|
+
case 'resize':
|
|
1745
|
+
default:
|
|
1746
|
+
this._widthBreakpoint();
|
|
1747
|
+
this.calcDimensions();
|
|
1748
|
+
this.stickyPosition(true);
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
this._running = false;
|
|
1752
|
+
});
|
|
1753
|
+
})(event.type);
|
|
1754
|
+
}
|
|
1755
|
+
_setSupportFeatures() {
|
|
1756
|
+
const support = this.support;
|
|
1757
|
+
support.transform = this.supportTransform();
|
|
1758
|
+
support.transform3d = this.supportTransform(true);
|
|
1759
|
+
}
|
|
1760
|
+
_getTranslate(y = '0', x = '0', z = '0') {
|
|
1761
|
+
if (this.support.transform3d)
|
|
1762
|
+
return 'translate3d(' + y + ', ' + x + ', ' + z + ')';
|
|
1763
|
+
else if (this.support.transform)
|
|
1764
|
+
return 'translate(' + y + ', ' + x + ')';
|
|
1765
|
+
else
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
supportTransform(transform3d = false) {
|
|
1769
|
+
let result = null;
|
|
1770
|
+
const property = transform3d ? 'perspective' : 'transform', upper = property.charAt(0).toUpperCase() + property.slice(1), prefixes = ['Webkit', 'Moz', 'O', 'ms'], support = this.renderer.createElement('support'), style = support.style;
|
|
1771
|
+
(property + ' ' + prefixes.join(upper + ' ') + upper).split(' ').forEach(function (property, i) {
|
|
1772
|
+
if (style[property] !== undefined) {
|
|
1773
|
+
result = property;
|
|
1774
|
+
return false;
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
return result;
|
|
1778
|
+
}
|
|
1779
|
+
getScrollTop() {
|
|
1780
|
+
return document.documentElement.scrollTop || document.body.scrollTop || document.documentElement.offsetTop * -1;
|
|
1781
|
+
}
|
|
1782
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarDirective, deps: [{ token: i0.ElementRef }, { token: STICKY_SIDEBAR_OPTIONS, optional: true }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1783
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: StickySidebarDirective, isStandalone: false, selector: "[wtStickySidebar]", queries: [{ propertyName: "sidebarInner", first: true, predicate: i0.forwardRef(() => StickySidebarInnerDirective), descendants: true, read: ElementRef, static: true }], ngImport: i0 }); }
|
|
1784
|
+
}
|
|
1785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarDirective, decorators: [{
|
|
1786
|
+
type: Directive,
|
|
1787
|
+
args: [{
|
|
1788
|
+
selector: '[wtStickySidebar]',
|
|
1789
|
+
standalone: false
|
|
1790
|
+
}]
|
|
1791
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
1792
|
+
type: Optional
|
|
1793
|
+
}, {
|
|
1794
|
+
type: Inject,
|
|
1795
|
+
args: [STICKY_SIDEBAR_OPTIONS]
|
|
1796
|
+
}] }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1$1.Platform, decorators: [{
|
|
1797
|
+
type: Inject,
|
|
1798
|
+
args: [PLATFORM_ID]
|
|
1799
|
+
}] }], propDecorators: { sidebarInner: [{
|
|
1800
|
+
type: ContentChild,
|
|
1801
|
+
args: [forwardRef(() => StickySidebarInnerDirective), { static: true, read: ElementRef }]
|
|
1802
|
+
}] } });
|
|
1803
|
+
class StickySidebarInnerDirective {
|
|
1804
|
+
constructor() {
|
|
1805
|
+
}
|
|
1806
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarInnerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1807
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: StickySidebarInnerDirective, isStandalone: false, selector: "[wtStickySidebarInner]", ngImport: i0 }); }
|
|
1808
|
+
}
|
|
1809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarInnerDirective, decorators: [{
|
|
1810
|
+
type: Directive,
|
|
1811
|
+
args: [{
|
|
1812
|
+
selector: '[wtStickySidebarInner]',
|
|
1813
|
+
standalone: false
|
|
1814
|
+
}]
|
|
1815
|
+
}], ctorParameters: () => [] });
|
|
1816
|
+
|
|
1817
|
+
class StickySidebarModule {
|
|
1818
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1819
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarModule, declarations: [/*StickySidebarDirective*/ StickySidebarInnerDirective], imports: [CommonModule], exports: [/*StickySidebarDirective*/ StickySidebarInnerDirective] }); }
|
|
1820
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarModule, imports: [CommonModule] }); }
|
|
1821
|
+
}
|
|
1822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: StickySidebarModule, decorators: [{
|
|
1823
|
+
type: NgModule,
|
|
1824
|
+
args: [{
|
|
1825
|
+
declarations: [/*StickySidebarDirective*/ StickySidebarInnerDirective],
|
|
1826
|
+
imports: [
|
|
1827
|
+
CommonModule
|
|
1828
|
+
],
|
|
1829
|
+
exports: [/*StickySidebarDirective*/ StickySidebarInnerDirective]
|
|
1830
|
+
}]
|
|
1831
|
+
}] });
|
|
1832
|
+
|
|
1833
|
+
class TableMenuComponent {
|
|
1834
|
+
constructor() {
|
|
1835
|
+
this.edit = new EventEmitter();
|
|
1836
|
+
this.delete = new EventEmitter();
|
|
1837
|
+
}
|
|
1838
|
+
ngOnInit() {
|
|
1839
|
+
}
|
|
1840
|
+
editAction() {
|
|
1841
|
+
this.edit.emit();
|
|
1842
|
+
}
|
|
1843
|
+
deleteAction() {
|
|
1844
|
+
this.delete.emit();
|
|
1845
|
+
}
|
|
1846
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1847
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: TableMenuComponent, isStandalone: false, selector: "shared-table-menu", outputs: { edit: "edit", delete: "delete" }, ngImport: i0, template: "<mat-icon class=\"cursor-pointer\" [matMenuTriggerFor]=\"menu\">more_vert</mat-icon>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"editAction()\">\n <mat-icon>edit</mat-icon>\n <span>\u0420\u0435\u0434.</span>\n </button>\n <button mat-menu-item (click)=\"deleteAction()\">\n <mat-icon>delete</mat-icon>\n <span>\u0423\u0434\u0430\u043B\u0438\u0442\u044C</span>\n </button>\n</mat-menu>\n", styles: [""], dependencies: [{ kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$3.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2$3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] }); }
|
|
1848
|
+
}
|
|
1849
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableMenuComponent, decorators: [{
|
|
1850
|
+
type: Component,
|
|
1851
|
+
args: [{ selector: 'shared-table-menu', standalone: false, template: "<mat-icon class=\"cursor-pointer\" [matMenuTriggerFor]=\"menu\">more_vert</mat-icon>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"editAction()\">\n <mat-icon>edit</mat-icon>\n <span>\u0420\u0435\u0434.</span>\n </button>\n <button mat-menu-item (click)=\"deleteAction()\">\n <mat-icon>delete</mat-icon>\n <span>\u0423\u0434\u0430\u043B\u0438\u0442\u044C</span>\n </button>\n</mat-menu>\n" }]
|
|
1852
|
+
}], ctorParameters: () => [], propDecorators: { edit: [{
|
|
1853
|
+
type: Output
|
|
1854
|
+
}], delete: [{
|
|
1855
|
+
type: Output
|
|
1856
|
+
}] } });
|
|
1857
|
+
|
|
1858
|
+
class TableMenuModule {
|
|
1859
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1860
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: TableMenuModule, declarations: [TableMenuComponent], imports: [CommonModule,
|
|
1861
|
+
MatIconModule,
|
|
1862
|
+
MatMenuModule], exports: [TableMenuComponent,
|
|
1863
|
+
MatIconModule,
|
|
1864
|
+
MatMenuModule] }); }
|
|
1865
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableMenuModule, imports: [CommonModule,
|
|
1866
|
+
MatIconModule,
|
|
1867
|
+
MatMenuModule, MatIconModule,
|
|
1868
|
+
MatMenuModule] }); }
|
|
1869
|
+
}
|
|
1870
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TableMenuModule, decorators: [{
|
|
1871
|
+
type: NgModule,
|
|
1872
|
+
args: [{
|
|
1873
|
+
declarations: [TableMenuComponent],
|
|
1874
|
+
imports: [
|
|
1875
|
+
CommonModule,
|
|
1876
|
+
MatIconModule,
|
|
1877
|
+
MatMenuModule
|
|
1878
|
+
],
|
|
1879
|
+
exports: [
|
|
1880
|
+
TableMenuComponent,
|
|
1881
|
+
MatIconModule,
|
|
1882
|
+
MatMenuModule
|
|
1883
|
+
]
|
|
1884
|
+
}]
|
|
1885
|
+
}] });
|
|
1886
|
+
|
|
1887
|
+
class TagCloudComponent {
|
|
1888
|
+
constructor() {
|
|
1889
|
+
this.loaded = false;
|
|
1890
|
+
this.trackByFn = trackById;
|
|
1891
|
+
}
|
|
1892
|
+
ngOnInit() {
|
|
1893
|
+
/*this.tagsFacade.loadTags();
|
|
1894
|
+
this.getTags$ = this.tagsFacade.getTags$.pipe(
|
|
1895
|
+
filter(items => !!items),
|
|
1896
|
+
tap(items => {
|
|
1897
|
+
if (items.length) {
|
|
1898
|
+
this.loaded = true;
|
|
1899
|
+
}
|
|
1900
|
+
})
|
|
1901
|
+
);*/
|
|
1902
|
+
}
|
|
1903
|
+
ngOnDestroy() {
|
|
1904
|
+
}
|
|
1905
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TagCloudComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1906
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: TagCloudComponent, isStandalone: false, selector: "shared-tag-cloud", ngImport: i0, template: "<ng-container *ngIf=\"getTags$ | async; let tags;\">\n<aside *ngIf=\"loaded\" class=\"single-sidebar-widget tag_cloud_widget\">\n <h4 class=\"widget_title\">\u0422\u0435\u0433\u0438</h4>\n <ul class=\"tag-list list\">\n <li *ngFor=\"let tag of tags; trackBy: trackByFn\"><a [routerLink]=\"['/tag/' + tag.slug + '.html']\">{{tag.name}}</a></li>\n </ul>\n</aside>\n</ng-container>\n<shared-spinner *ngIf=\"!loaded\" [diameter]=\"30\"></shared-spinner>\n", styles: [".tag-list li:nth-child(3n) a{margin-right:0!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1907
|
+
}
|
|
1908
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TagCloudComponent, decorators: [{
|
|
1909
|
+
type: Component,
|
|
1910
|
+
args: [{ selector: 'shared-tag-cloud', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-container *ngIf=\"getTags$ | async; let tags;\">\n<aside *ngIf=\"loaded\" class=\"single-sidebar-widget tag_cloud_widget\">\n <h4 class=\"widget_title\">\u0422\u0435\u0433\u0438</h4>\n <ul class=\"tag-list list\">\n <li *ngFor=\"let tag of tags; trackBy: trackByFn\"><a [routerLink]=\"['/tag/' + tag.slug + '.html']\">{{tag.name}}</a></li>\n </ul>\n</aside>\n</ng-container>\n<shared-spinner *ngIf=\"!loaded\" [diameter]=\"30\"></shared-spinner>\n", styles: [".tag-list li:nth-child(3n) a{margin-right:0!important}\n"] }]
|
|
1911
|
+
}], ctorParameters: () => [] });
|
|
1912
|
+
|
|
1913
|
+
class TagCloudModule {
|
|
1914
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TagCloudModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1915
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: TagCloudModule, declarations: [TagCloudComponent], imports: [CommonModule,
|
|
1916
|
+
SharedSpinnerModule,
|
|
1917
|
+
RouterModule], exports: [TagCloudComponent] }); }
|
|
1918
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TagCloudModule, imports: [CommonModule,
|
|
1919
|
+
SharedSpinnerModule,
|
|
1920
|
+
RouterModule] }); }
|
|
1921
|
+
}
|
|
1922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TagCloudModule, decorators: [{
|
|
1923
|
+
type: NgModule,
|
|
1924
|
+
args: [{
|
|
1925
|
+
declarations: [TagCloudComponent],
|
|
1926
|
+
imports: [
|
|
1927
|
+
CommonModule,
|
|
1928
|
+
SharedSpinnerModule,
|
|
1929
|
+
RouterModule
|
|
1930
|
+
],
|
|
1931
|
+
exports: [TagCloudComponent]
|
|
1932
|
+
}]
|
|
1933
|
+
}] });
|
|
1934
|
+
|
|
1935
|
+
class ProfileComponent {
|
|
1936
|
+
constructor(authService, cd) {
|
|
1937
|
+
this.authService = authService;
|
|
1938
|
+
this.cd = cd;
|
|
1939
|
+
this.user = null;
|
|
1940
|
+
this.token = null;
|
|
1941
|
+
this.title = 'Мой профиль';
|
|
1942
|
+
this.parentTitle = 'Главная';
|
|
1943
|
+
this.parentUrl = ['/'];
|
|
1944
|
+
this.logout = new EventEmitter();
|
|
1945
|
+
this.back = new EventEmitter();
|
|
1946
|
+
this.profile = {
|
|
1947
|
+
avatar: null,
|
|
1948
|
+
initials: '',
|
|
1949
|
+
name: '',
|
|
1950
|
+
surname: '',
|
|
1951
|
+
fullName: '',
|
|
1952
|
+
displayName: '',
|
|
1953
|
+
email: '',
|
|
1954
|
+
role: ''
|
|
1955
|
+
};
|
|
1956
|
+
this.imageFailed = false;
|
|
1957
|
+
}
|
|
1958
|
+
ngOnInit() {
|
|
1959
|
+
if (this.user) {
|
|
1960
|
+
this.updateProfile(this.user, this.token);
|
|
1961
|
+
}
|
|
1962
|
+
else if (this.authService?.currentUser) {
|
|
1963
|
+
this.authSubscription = this.authService.currentUser.subscribe((currentUser) => {
|
|
1964
|
+
if (currentUser) {
|
|
1965
|
+
this.updateProfile(currentUser, this.token || currentUser.token);
|
|
1966
|
+
}
|
|
1967
|
+
});
|
|
1968
|
+
const initialUser = this.authService.currentUserValue;
|
|
1969
|
+
if (initialUser) {
|
|
1970
|
+
this.updateProfile(initialUser, this.token || initialUser.token);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
ngOnChanges(changes) {
|
|
1975
|
+
if (changes['user'] || changes['token']) {
|
|
1976
|
+
this.updateProfile(this.user, this.token);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
ngOnDestroy() {
|
|
1980
|
+
this.authSubscription?.unsubscribe();
|
|
1981
|
+
}
|
|
1982
|
+
updateProfile(user, token) {
|
|
1983
|
+
this.imageFailed = false;
|
|
1984
|
+
this.profile = resolveUserProfile(user, token);
|
|
1985
|
+
this.cd.markForCheck();
|
|
1986
|
+
}
|
|
1987
|
+
onImageError() {
|
|
1988
|
+
this.imageFailed = true;
|
|
1989
|
+
this.cd.markForCheck();
|
|
1990
|
+
}
|
|
1991
|
+
onBack() {
|
|
1992
|
+
this.back.emit();
|
|
1993
|
+
}
|
|
1994
|
+
onLogout() {
|
|
1995
|
+
this.logout.emit();
|
|
1996
|
+
}
|
|
1997
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ProfileComponent, deps: [{ token: i1.AuthenticationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1998
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: ProfileComponent, isStandalone: false, selector: "shared-profile", inputs: { user: "user", token: "token", title: "title", parentTitle: "parentTitle", parentUrl: "parentUrl" }, outputs: { logout: "logout", back: "back" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"shared-profile-container\">\n <shared-panel-header\n [title]=\"title\"\n [parentTitle]=\"parentTitle\"\n [parentUrl]=\"parentUrl\">\n </shared-panel-header>\n\n <div class=\"profile-content p-24\">\n <div class=\"profile-card\">\n <div class=\"profile-header-banner\">\n <div class=\"profile-avatar-wrapper\">\n <img\n *ngIf=\"profile.avatar && !imageFailed; else initialsTpl\"\n [src]=\"profile.avatar\"\n (error)=\"onImageError()\"\n class=\"profile-avatar-img\"\n alt=\"User avatar\"\n />\n <ng-template #initialsTpl>\n <div class=\"profile-avatar-initials\" aria-label=\"User initials\">\n {{ profile.initials }}\n </div>\n </ng-template>\n </div>\n\n <div class=\"profile-header-info\">\n <h2 class=\"profile-name\">{{ profile.fullName }}</h2>\n <div class=\"profile-meta\">\n <span class=\"profile-role-badge\" *ngIf=\"profile.role\">\n {{ profile.role }}\n </span>\n <span class=\"profile-email\" *ngIf=\"profile.email\">\n <mat-icon class=\"s-16\">email</mat-icon>\n {{ profile.email }}\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-body\">\n <div class=\"profile-section\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">person</mat-icon>\n \u041B\u0438\u0447\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\n </h3>\n <div class=\"info-grid\">\n <div class=\"info-item\">\n <span class=\"info-label\">\u0418\u043C\u044F</span>\n <span class=\"info-value\">{{ profile.name || '\u2014' }}</span>\n </div>\n <div class=\"info-item\">\n <span class=\"info-label\">\u0424\u0430\u043C\u0438\u043B\u0438\u044F</span>\n <span class=\"info-value\">{{ profile.surname || '\u2014' }}</span>\n </div>\n <div class=\"info-item\">\n <span class=\"info-label\">Email</span>\n <span class=\"info-value\">{{ profile.email || '\u2014' }}</span>\n </div>\n <div class=\"info-item\" *ngIf=\"profile.role\">\n <span class=\"info-label\">\u0420\u043E\u043B\u044C</span>\n <span class=\"info-value\">{{ profile.role }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-section\" *ngIf=\"profile.accessGroupId || (profile.workspaces && profile.workspaces.length)\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">business</mat-icon>\n \u041E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u044F \u0438 \u0434\u043E\u0441\u0442\u0443\u043F\n </h3>\n <div class=\"info-grid\">\n <div class=\"info-item\" *ngIf=\"profile.accessGroupId\">\n <span class=\"info-label\">ID \u0433\u0440\u0443\u043F\u043F\u044B \u0434\u043E\u0441\u0442\u0443\u043F\u0430</span>\n <span class=\"info-value\">{{ profile.accessGroupId }}</span>\n </div>\n <div class=\"info-item\" *ngIf=\"profile.workspaces && profile.workspaces.length\">\n <span class=\"info-label\">\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430</span>\n <span class=\"info-value\">\n <span class=\"workspace-badge\" *ngFor=\"let ws of profile.workspaces\">\n {{ ws.name || ws.id }}\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-section\" *ngIf=\"profile.rights && profile.rights.length\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">verified_user</mat-icon>\n \u041F\u0440\u0430\u0432\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u0430\n </h3>\n <div class=\"rights-chips\">\n <span class=\"right-chip\" *ngFor=\"let r of profile.rights\">\n {{ r.name || r.section || r.role || r.block || r }}\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-actions\">\n <button mat-stroked-button type=\"button\" class=\"btn-back\" (click)=\"onBack()\">\n <mat-icon>arrow_back</mat-icon>\n \u041D\u0430\u0437\u0430\u0434\n </button>\n <button mat-flat-button color=\"warn\" type=\"button\" class=\"btn-logout\" (click)=\"onLogout()\">\n <mat-icon>logout</mat-icon>\n \u0412\u044B\u0439\u0442\u0438\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".shared-profile-container{width:100%}.profile-content{max-width:960px;margin:0 auto}.profile-card{background:#fff;border-radius:12px;box-shadow:0 4px 20px #0000000f;border:1px solid rgba(0,0,0,.06);overflow:hidden}.profile-header-banner{display:flex;align-items:center;padding:32px;background:linear-gradient(135deg,#f5f7fb,#ebeffa);border-bottom:1px solid #e2e8f0;gap:24px}@media(max-width:576px){.profile-header-banner{flex-direction:column;text-align:center}}.profile-avatar-wrapper{flex-shrink:0}.profile-avatar-img{width:88px;height:88px;border-radius:50%;object-fit:cover;border:4px solid #ffffff;box-shadow:0 4px 12px #0000001a}.profile-avatar-initials{width:88px;height:88px;border-radius:50%;background:linear-gradient(135deg,#4936f5,#6857f7);color:#fff;font-size:32px;font-weight:700;letter-spacing:1px;display:flex;align-items:center;justify-content:center;border:4px solid #ffffff;box-shadow:0 4px 12px #4936f540;text-transform:uppercase}.profile-header-info{flex-grow:1}.profile-name{margin:0 0 8px;font-size:24px;font-weight:700;color:#1e293b}.profile-meta{display:flex;align-items:center;flex-wrap:wrap;gap:12px}@media(max-width:576px){.profile-meta{justify-content:center}}.profile-role-badge{display:inline-block;padding:4px 12px;border-radius:20px;background-color:#4936f5;color:#fff;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.profile-email{display:inline-flex;align-items:center;gap:4px;color:#64748b;font-size:14px}.profile-body{padding:32px}.profile-section{margin-bottom:28px}.profile-section:last-child{margin-bottom:0}.section-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#334155;margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid #f1f5f9}.section-title mat-icon{color:#4936f5}.info-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.info-item{display:flex;flex-direction:column;gap:4px}.info-label{font-size:12px;font-weight:500;color:#94a3b8;text-transform:uppercase;letter-spacing:.5px}.info-value{font-size:14px;font-weight:500;color:#1e293b}.workspace-badge{display:inline-block;padding:3px 8px;margin:2px 4px 2px 0;background-color:#f1f5f9;border-radius:4px;font-size:12px;color:#475569}.rights-chips{display:flex;flex-wrap:wrap;gap:8px}.right-chip{display:inline-block;padding:4px 10px;background-color:#f0fdf4;border:1px solid #bbf7d0;color:#166534;border-radius:6px;font-size:12px;font-weight:500}.profile-actions{display:flex;justify-content:space-between;align-items:center;padding:20px 32px;background-color:#fafbfc;border-top:1px solid #f1f5f9}.profile-actions button{display:inline-flex;align-items:center;gap:6px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PanelHeaderComponent, selector: "shared-panel-header", inputs: ["title", "parentTitle", "parentUrl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1999
|
+
}
|
|
2000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ProfileComponent, decorators: [{
|
|
2001
|
+
type: Component,
|
|
2002
|
+
args: [{ selector: 'shared-profile', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"shared-profile-container\">\n <shared-panel-header\n [title]=\"title\"\n [parentTitle]=\"parentTitle\"\n [parentUrl]=\"parentUrl\">\n </shared-panel-header>\n\n <div class=\"profile-content p-24\">\n <div class=\"profile-card\">\n <div class=\"profile-header-banner\">\n <div class=\"profile-avatar-wrapper\">\n <img\n *ngIf=\"profile.avatar && !imageFailed; else initialsTpl\"\n [src]=\"profile.avatar\"\n (error)=\"onImageError()\"\n class=\"profile-avatar-img\"\n alt=\"User avatar\"\n />\n <ng-template #initialsTpl>\n <div class=\"profile-avatar-initials\" aria-label=\"User initials\">\n {{ profile.initials }}\n </div>\n </ng-template>\n </div>\n\n <div class=\"profile-header-info\">\n <h2 class=\"profile-name\">{{ profile.fullName }}</h2>\n <div class=\"profile-meta\">\n <span class=\"profile-role-badge\" *ngIf=\"profile.role\">\n {{ profile.role }}\n </span>\n <span class=\"profile-email\" *ngIf=\"profile.email\">\n <mat-icon class=\"s-16\">email</mat-icon>\n {{ profile.email }}\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-body\">\n <div class=\"profile-section\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">person</mat-icon>\n \u041B\u0438\u0447\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\n </h3>\n <div class=\"info-grid\">\n <div class=\"info-item\">\n <span class=\"info-label\">\u0418\u043C\u044F</span>\n <span class=\"info-value\">{{ profile.name || '\u2014' }}</span>\n </div>\n <div class=\"info-item\">\n <span class=\"info-label\">\u0424\u0430\u043C\u0438\u043B\u0438\u044F</span>\n <span class=\"info-value\">{{ profile.surname || '\u2014' }}</span>\n </div>\n <div class=\"info-item\">\n <span class=\"info-label\">Email</span>\n <span class=\"info-value\">{{ profile.email || '\u2014' }}</span>\n </div>\n <div class=\"info-item\" *ngIf=\"profile.role\">\n <span class=\"info-label\">\u0420\u043E\u043B\u044C</span>\n <span class=\"info-value\">{{ profile.role }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-section\" *ngIf=\"profile.accessGroupId || (profile.workspaces && profile.workspaces.length)\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">business</mat-icon>\n \u041E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u044F \u0438 \u0434\u043E\u0441\u0442\u0443\u043F\n </h3>\n <div class=\"info-grid\">\n <div class=\"info-item\" *ngIf=\"profile.accessGroupId\">\n <span class=\"info-label\">ID \u0433\u0440\u0443\u043F\u043F\u044B \u0434\u043E\u0441\u0442\u0443\u043F\u0430</span>\n <span class=\"info-value\">{{ profile.accessGroupId }}</span>\n </div>\n <div class=\"info-item\" *ngIf=\"profile.workspaces && profile.workspaces.length\">\n <span class=\"info-label\">\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430</span>\n <span class=\"info-value\">\n <span class=\"workspace-badge\" *ngFor=\"let ws of profile.workspaces\">\n {{ ws.name || ws.id }}\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-section\" *ngIf=\"profile.rights && profile.rights.length\">\n <h3 class=\"section-title\">\n <mat-icon class=\"s-18\">verified_user</mat-icon>\n \u041F\u0440\u0430\u0432\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u0430\n </h3>\n <div class=\"rights-chips\">\n <span class=\"right-chip\" *ngFor=\"let r of profile.rights\">\n {{ r.name || r.section || r.role || r.block || r }}\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"profile-actions\">\n <button mat-stroked-button type=\"button\" class=\"btn-back\" (click)=\"onBack()\">\n <mat-icon>arrow_back</mat-icon>\n \u041D\u0430\u0437\u0430\u0434\n </button>\n <button mat-flat-button color=\"warn\" type=\"button\" class=\"btn-logout\" (click)=\"onLogout()\">\n <mat-icon>logout</mat-icon>\n \u0412\u044B\u0439\u0442\u0438\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".shared-profile-container{width:100%}.profile-content{max-width:960px;margin:0 auto}.profile-card{background:#fff;border-radius:12px;box-shadow:0 4px 20px #0000000f;border:1px solid rgba(0,0,0,.06);overflow:hidden}.profile-header-banner{display:flex;align-items:center;padding:32px;background:linear-gradient(135deg,#f5f7fb,#ebeffa);border-bottom:1px solid #e2e8f0;gap:24px}@media(max-width:576px){.profile-header-banner{flex-direction:column;text-align:center}}.profile-avatar-wrapper{flex-shrink:0}.profile-avatar-img{width:88px;height:88px;border-radius:50%;object-fit:cover;border:4px solid #ffffff;box-shadow:0 4px 12px #0000001a}.profile-avatar-initials{width:88px;height:88px;border-radius:50%;background:linear-gradient(135deg,#4936f5,#6857f7);color:#fff;font-size:32px;font-weight:700;letter-spacing:1px;display:flex;align-items:center;justify-content:center;border:4px solid #ffffff;box-shadow:0 4px 12px #4936f540;text-transform:uppercase}.profile-header-info{flex-grow:1}.profile-name{margin:0 0 8px;font-size:24px;font-weight:700;color:#1e293b}.profile-meta{display:flex;align-items:center;flex-wrap:wrap;gap:12px}@media(max-width:576px){.profile-meta{justify-content:center}}.profile-role-badge{display:inline-block;padding:4px 12px;border-radius:20px;background-color:#4936f5;color:#fff;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.profile-email{display:inline-flex;align-items:center;gap:4px;color:#64748b;font-size:14px}.profile-body{padding:32px}.profile-section{margin-bottom:28px}.profile-section:last-child{margin-bottom:0}.section-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#334155;margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid #f1f5f9}.section-title mat-icon{color:#4936f5}.info-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.info-item{display:flex;flex-direction:column;gap:4px}.info-label{font-size:12px;font-weight:500;color:#94a3b8;text-transform:uppercase;letter-spacing:.5px}.info-value{font-size:14px;font-weight:500;color:#1e293b}.workspace-badge{display:inline-block;padding:3px 8px;margin:2px 4px 2px 0;background-color:#f1f5f9;border-radius:4px;font-size:12px;color:#475569}.rights-chips{display:flex;flex-wrap:wrap;gap:8px}.right-chip{display:inline-block;padding:4px 10px;background-color:#f0fdf4;border:1px solid #bbf7d0;color:#166534;border-radius:6px;font-size:12px;font-weight:500}.profile-actions{display:flex;justify-content:space-between;align-items:center;padding:20px 32px;background-color:#fafbfc;border-top:1px solid #f1f5f9}.profile-actions button{display:inline-flex;align-items:center;gap:6px}\n"] }]
|
|
2003
|
+
}], ctorParameters: () => [{ type: i1.AuthenticationService }, { type: i0.ChangeDetectorRef }], propDecorators: { user: [{
|
|
2004
|
+
type: Input
|
|
2005
|
+
}], token: [{
|
|
2006
|
+
type: Input
|
|
2007
|
+
}], title: [{
|
|
2008
|
+
type: Input
|
|
2009
|
+
}], parentTitle: [{
|
|
2010
|
+
type: Input
|
|
2011
|
+
}], parentUrl: [{
|
|
2012
|
+
type: Input
|
|
2013
|
+
}], logout: [{
|
|
2014
|
+
type: Output
|
|
2015
|
+
}], back: [{
|
|
2016
|
+
type: Output
|
|
2017
|
+
}] } });
|
|
2018
|
+
|
|
2019
|
+
class ProfileModule {
|
|
2020
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ProfileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2021
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: ProfileModule, declarations: [ProfileComponent], imports: [CommonModule,
|
|
2022
|
+
RouterModule,
|
|
2023
|
+
MatButtonModule,
|
|
2024
|
+
MatIconModule,
|
|
2025
|
+
PanelHeaderModule], exports: [CommonModule,
|
|
2026
|
+
ProfileComponent] }); }
|
|
2027
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ProfileModule, imports: [CommonModule,
|
|
2028
|
+
RouterModule,
|
|
2029
|
+
MatButtonModule,
|
|
2030
|
+
MatIconModule,
|
|
2031
|
+
PanelHeaderModule, CommonModule] }); }
|
|
2032
|
+
}
|
|
2033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ProfileModule, decorators: [{
|
|
2034
|
+
type: NgModule,
|
|
2035
|
+
args: [{
|
|
2036
|
+
declarations: [ProfileComponent],
|
|
2037
|
+
imports: [
|
|
2038
|
+
CommonModule,
|
|
2039
|
+
RouterModule,
|
|
2040
|
+
MatButtonModule,
|
|
2041
|
+
MatIconModule,
|
|
2042
|
+
PanelHeaderModule
|
|
2043
|
+
],
|
|
2044
|
+
exports: [
|
|
2045
|
+
CommonModule,
|
|
2046
|
+
ProfileComponent
|
|
2047
|
+
]
|
|
2048
|
+
}]
|
|
2049
|
+
}] });
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Generated bundle index. Do not edit.
|
|
2053
|
+
*/
|
|
2054
|
+
|
|
2055
|
+
export { AccessDeniedComponent, AccessDeniedModule, ChipsInputComponent, ChipsInputModule, FilesUploadComponent, FilesUploadModule, FormFieldErrorComponent, FormFieldErrorModule, FormFieldPublishErrorComponent, FormFieldPublishErrorModule, HeaderComponent, HeaderModule, InputTagsComponent, InputTagsModule, PanelComponent, PanelHeaderComponent, PanelHeaderModule, PanelModule, ProfileComponent, ProfileModule, STICKY_SIDEBAR_OPTIONS, SiteHelperComponent, SiteHelperModule, SmartProgressBarComponent, SmartProgressBarModule, StickySidebarDirective, StickySidebarInnerDirective, StickySidebarModule, TableMenuComponent, TableMenuModule, TagCloudComponent, TagCloudModule, defaultStickySidebarOptions };
|
|
2056
|
+
//# sourceMappingURL=wt-front-shared-panel-ui.mjs.map
|