wt-front-shared 1.0.39 → 1.0.41
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/esm2020/lib/core/+state/forms/forms.facade.mjs +7 -4
- package/esm2020/lib/core/+state/forms/forms.selectors.mjs +9 -2
- package/esm2020/lib/core/+state/router/router.effects.mjs +8 -2
- package/esm2020/lib/core/+state/router/router.facade.mjs +2 -1
- package/esm2020/lib/core/+state/users/users.facade.mjs +1 -2
- package/esm2020/lib/core/components/auto-form/components/form-field-file/form-field-file.component.mjs +1 -8
- package/esm2020/lib/core/components/auto-form/components/form-field-select/form-field-select.component.mjs +18 -4
- package/esm2020/lib/core/components/auto-form/containers/auto-form-main/auto-form-main.component.mjs +58 -27
- package/esm2020/lib/core/components/auto-form/containers/form-field/form-field.component.mjs +5 -3
- package/esm2020/lib/core/components/auto-form/containers/publish-messages/publish-messages.component.mjs +38 -28
- package/esm2020/lib/core/components/auto-form/interfaces/auto-form.interfaces.mjs +2 -0
- package/esm2020/lib/core/components/index.mjs +2 -1
- package/esm2020/lib/core/constants/form-errors.const.mjs +2 -2
- package/esm2020/lib/core/models/forms/form-value.mjs +1 -1
- package/esm2020/lib/core/models/forms/image-form-value.mjs +1 -1
- package/esm2020/lib/core/services/router/router.service.mjs +2 -2
- package/esm2020/lib/core/services/users/users.service.mjs +1 -2
- package/esm2020/public-api.mjs +2 -2
- package/fesm2015/wt-front-shared.mjs +125 -61
- package/fesm2015/wt-front-shared.mjs.map +1 -1
- package/fesm2020/wt-front-shared.mjs +123 -59
- package/fesm2020/wt-front-shared.mjs.map +1 -1
- package/lib/core/+state/forms/forms.facade.d.ts +4 -3
- package/lib/core/+state/forms/forms.selectors.d.ts +2 -0
- package/lib/core/+state/router/router.effects.d.ts +1 -1
- package/lib/core/components/auto-form/components/form-field-select/form-field-select.component.d.ts +5 -3
- package/lib/core/components/auto-form/containers/auto-form-main/auto-form-main.component.d.ts +14 -15
- package/lib/core/components/auto-form/containers/form-field/form-field.component.d.ts +4 -2
- package/lib/core/components/auto-form/containers/publish-messages/publish-messages.component.d.ts +10 -7
- package/lib/core/components/auto-form/interfaces/auto-form.interfaces.d.ts +18 -0
- package/lib/core/components/index.d.ts +1 -0
- package/lib/core/models/forms/form-value.d.ts +1 -1
- package/lib/core/models/forms/image-form-value.d.ts +1 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, NgModule, PLATFORM_ID, Injectable, Inject, Component, ChangeDetectionStrategy, Injector, Input, ViewChild, EventEmitter, Output, ElementRef, Directive, Optional, ContentChild, forwardRef, Pipe } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@angular/common';
|
|
4
4
|
import { isPlatformBrowser, isPlatformServer, APP_BASE_HREF, CommonModule } from '@angular/common';
|
|
5
|
-
import { BehaviorSubject, of, throwError, ReplaySubject, Subject, EMPTY, merge, fromEvent } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, of, throwError, ReplaySubject, Subject, EMPTY, Subscription, merge, fromEvent } from 'rxjs';
|
|
6
6
|
import * as i3 from '@angular/router';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import * as i1$2 from '@ngrx/effects';
|
|
@@ -227,7 +227,7 @@ const PasswordRules = {
|
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
const SharedFormErrors = {
|
|
230
|
-
REQUIRE: '
|
|
230
|
+
REQUIRE: 'Поле :field является обязательным',
|
|
231
231
|
FORM_SAVE_ERROR: "Произошла ошибка при сохранении формы, проверьте все еще. Если ошибка повторяется напишите в службу поддержки <a href=\"mailto:support@world-travel.uz\">support@world-travel.uz</a>",
|
|
232
232
|
PATTERN: "Не коректное значение",
|
|
233
233
|
};
|
|
@@ -2372,8 +2372,15 @@ const getForm = (formId) => createSelector(getFormsState, (state) => {
|
|
|
2372
2372
|
}
|
|
2373
2373
|
return null;
|
|
2374
2374
|
});
|
|
2375
|
+
const getAllForms = () => createSelector(getFormsState, (state) => {
|
|
2376
|
+
if (state) {
|
|
2377
|
+
return state.list;
|
|
2378
|
+
}
|
|
2379
|
+
return null;
|
|
2380
|
+
});
|
|
2375
2381
|
const formsQuery = {
|
|
2376
|
-
getForm
|
|
2382
|
+
getForm,
|
|
2383
|
+
getAllForms
|
|
2377
2384
|
};
|
|
2378
2385
|
|
|
2379
2386
|
class FormsFacade {
|
|
@@ -2389,15 +2396,18 @@ class FormsFacade {
|
|
|
2389
2396
|
getForm(formId) {
|
|
2390
2397
|
return this.store.pipe(select(formsQuery.getForm(formId)));
|
|
2391
2398
|
}
|
|
2399
|
+
getAllForms() {
|
|
2400
|
+
return this.store.pipe(select(formsQuery.getAllForms()));
|
|
2401
|
+
}
|
|
2392
2402
|
removeForm(formId) {
|
|
2393
2403
|
this.store.dispatch(DeleteForm({ payload: { formId } }));
|
|
2394
2404
|
}
|
|
2395
2405
|
}
|
|
2396
2406
|
FormsFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormsFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2397
|
-
FormsFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormsFacade, providedIn:
|
|
2407
|
+
FormsFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormsFacade, providedIn: 'root' });
|
|
2398
2408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormsFacade, decorators: [{
|
|
2399
2409
|
type: Injectable,
|
|
2400
|
-
args: [{ providedIn:
|
|
2410
|
+
args: [{ providedIn: 'root' }]
|
|
2401
2411
|
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
|
|
2402
2412
|
|
|
2403
2413
|
class UsersService extends BaseAPIService {
|
|
@@ -2407,7 +2417,6 @@ class UsersService extends BaseAPIService {
|
|
|
2407
2417
|
this.config = config;
|
|
2408
2418
|
this.requestsFacade = requestsFacade;
|
|
2409
2419
|
this.formsFacade = formsFacade;
|
|
2410
|
-
console.log("CORE_CONFIG", this.config);
|
|
2411
2420
|
this.api = new UsersApi(this.config.apiUrl);
|
|
2412
2421
|
}
|
|
2413
2422
|
loginSend(config) {
|
|
@@ -2527,7 +2536,13 @@ class RouterEffects {
|
|
|
2527
2536
|
const path = this.preparePath(payload.path);
|
|
2528
2537
|
let extras;
|
|
2529
2538
|
if (payload.extras) {
|
|
2530
|
-
extras =
|
|
2539
|
+
extras = {};
|
|
2540
|
+
if (!!payload.extras.queryParams) {
|
|
2541
|
+
extras.queryParams = payload.extras.queryParams;
|
|
2542
|
+
}
|
|
2543
|
+
if (!!payload.extras.fragment) {
|
|
2544
|
+
extras.fragment = payload.extras.fragment;
|
|
2545
|
+
}
|
|
2531
2546
|
}
|
|
2532
2547
|
this.router.navigate(path, extras)
|
|
2533
2548
|
.then(data => {
|
|
@@ -2569,7 +2584,7 @@ class RouterService {
|
|
|
2569
2584
|
this.store = store;
|
|
2570
2585
|
}
|
|
2571
2586
|
goTo(src, extras) {
|
|
2572
|
-
console.info('[ navigation ]', src);
|
|
2587
|
+
console.info('[ router.service.navigation ]', src, extras);
|
|
2573
2588
|
this.store.dispatch(Go({ payload: { path: [src], extras } }));
|
|
2574
2589
|
}
|
|
2575
2590
|
}
|
|
@@ -2884,7 +2899,6 @@ class UsersFacade {
|
|
|
2884
2899
|
this.getUser$ = this.store.pipe(select(usersQuery.getUser));
|
|
2885
2900
|
}
|
|
2886
2901
|
testMethod() {
|
|
2887
|
-
console.log('testMethod');
|
|
2888
2902
|
}
|
|
2889
2903
|
loadAll() {
|
|
2890
2904
|
this.store.dispatch(LoadUsers());
|
|
@@ -5704,6 +5718,7 @@ class RouterFacade {
|
|
|
5704
5718
|
this.store = store;
|
|
5705
5719
|
}
|
|
5706
5720
|
goTo(path, extras = null) {
|
|
5721
|
+
console.info('[ router.facade.navigation ]', path, extras);
|
|
5707
5722
|
return this.store.dispatch(Go({ payload: { path, extras } }));
|
|
5708
5723
|
}
|
|
5709
5724
|
}
|
|
@@ -7241,10 +7256,18 @@ class FormFieldSelectComponent {
|
|
|
7241
7256
|
this.unSubscribeSubject$ = new Subject();
|
|
7242
7257
|
}
|
|
7243
7258
|
ngOnInit() {
|
|
7259
|
+
console.log('ngOnInit');
|
|
7244
7260
|
if (this.fieldData.options.subscribeToFormChanges) {
|
|
7245
7261
|
this.subscribeToFormChanges();
|
|
7246
7262
|
this.placeholder = this.fieldData.options.subscribeToFormChanges.emptyTitle;
|
|
7247
7263
|
}
|
|
7264
|
+
if (this.autoCompleteFields) {
|
|
7265
|
+
const findField = this.autoCompleteFields.find(item => item.field === this.fieldData.field);
|
|
7266
|
+
if (findField?.field) {
|
|
7267
|
+
this.form.get(findField.field).setValue(findField.value);
|
|
7268
|
+
this.form.get(findField.field).disable();
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7248
7271
|
this.subscribeToSearchChange();
|
|
7249
7272
|
}
|
|
7250
7273
|
ngOnDestroy() {
|
|
@@ -7252,11 +7275,13 @@ class FormFieldSelectComponent {
|
|
|
7252
7275
|
this.unSubscribeSubject$.complete();
|
|
7253
7276
|
}
|
|
7254
7277
|
ngOnChanges(changes) {
|
|
7278
|
+
console.log('changes', changes);
|
|
7255
7279
|
if (changes.fieldData && changes.fieldData.currentValue) {
|
|
7256
7280
|
const { loadOptionFromStore, selectOptions } = changes.fieldData.currentValue.options;
|
|
7257
7281
|
if (selectOptions && selectOptions.length) {
|
|
7258
7282
|
this.options = selectOptions;
|
|
7259
7283
|
}
|
|
7284
|
+
console.log('loadOptionFromStore', loadOptionFromStore);
|
|
7260
7285
|
if (loadOptionFromStore) {
|
|
7261
7286
|
this.loadOptionsFromStore(loadOptionFromStore);
|
|
7262
7287
|
}
|
|
@@ -7302,7 +7327,9 @@ class FormFieldSelectComponent {
|
|
|
7302
7327
|
const listKeys = loadOptionFromStore.split('.');
|
|
7303
7328
|
this.store.select(state => {
|
|
7304
7329
|
let selectedStore = state;
|
|
7330
|
+
console.log('state', state);
|
|
7305
7331
|
listKeys.forEach(key => {
|
|
7332
|
+
console.log('key', key);
|
|
7306
7333
|
selectedStore = selectedStore[key];
|
|
7307
7334
|
});
|
|
7308
7335
|
return selectedStore;
|
|
@@ -7393,7 +7420,7 @@ class FormFieldSelectComponent {
|
|
|
7393
7420
|
}
|
|
7394
7421
|
}
|
|
7395
7422
|
FormFieldSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormFieldSelectComponent, deps: [{ token: i1.Store }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7396
|
-
FormFieldSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormFieldSelectComponent, selector: "shared-form-field-select", inputs: { fieldData: "fieldData", form: "form" }, usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"form\">\n <mat-form-field appearance=\"outline\"\n class=\"width100\">\n <mat-label>{{fieldData.title}}</mat-label>\n <mat-select [required]=\"fieldData.validators?.includes('required')\"\n [multiple]=\"fieldData.options.multiple\"\n [formControlName]=\"fieldData.field\">\n <mat-option *ngIf=\"fieldData.options.innerSearch\">\n <ngx-mat-select-search\n placeholderLabel=\"\u041F\u043E\u0438\u0441\u043A...\"\n [formControl]=\"searchCtrl\"></ngx-mat-select-search>\n </mat-option>\n <mat-option *ngIf=\"!fieldData.validators?.includes('required')\" value=\"0\">\n -----\n </mat-option>\n <ng-container *ngIf=\"!fieldData.options.loading\">\n <ng-container *ngIf=\"options.length\">\n <mat-option *ngFor=\"let item of options\" [value]=\"item.id\">\n {{item.name || item['title']}}\n </mat-option>\n </ng-container>\n <ng-container *ngIf=\"!options.length\">\n <mat-option>\n \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442\n </mat-option>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"fieldData.options.loading\">\n <mat-option>\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430....</mat-option>\n </ng-container>\n </mat-select>\n <ng-container *ngIf=\"!options.length && placeholder\">\n <div @appearOpacity class=\"form-select-placeholder\">{{placeholder}}</div>\n </ng-container>\n </mat-form-field>\n</div>\n", styles: [".form-select-placeholder{position:absolute;margin-left:81px;margin-top:-3px;opacity:.8}\n"], dependencies: [{ kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }], animations: [appearOpacity], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7423
|
+
FormFieldSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormFieldSelectComponent, selector: "shared-form-field-select", inputs: { fieldData: "fieldData", form: "form", autoCompleteFields: "autoCompleteFields" }, usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"form\">\n <mat-form-field appearance=\"outline\"\n class=\"width100\">\n <mat-label>{{fieldData.title}}</mat-label>\n <mat-select [required]=\"fieldData.validators?.includes('required')\"\n [multiple]=\"fieldData.options.multiple\"\n [formControlName]=\"fieldData.field\">\n <mat-option *ngIf=\"fieldData.options.innerSearch\">\n <ngx-mat-select-search\n placeholderLabel=\"\u041F\u043E\u0438\u0441\u043A...\"\n [formControl]=\"searchCtrl\"></ngx-mat-select-search>\n </mat-option>\n <mat-option *ngIf=\"!fieldData.validators?.includes('required')\" value=\"0\">\n -----\n </mat-option>\n <ng-container *ngIf=\"!fieldData.options.loading\">\n <ng-container *ngIf=\"options.length\">\n <mat-option *ngFor=\"let item of options\" [value]=\"item.id\">\n {{item.name || item['title']}}\n </mat-option>\n </ng-container>\n <ng-container *ngIf=\"!options.length\">\n <mat-option>\n \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442\n </mat-option>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"fieldData.options.loading\">\n <mat-option>\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430....</mat-option>\n </ng-container>\n </mat-select>\n <ng-container *ngIf=\"!options.length && placeholder\">\n <div @appearOpacity class=\"form-select-placeholder\">{{placeholder}}</div>\n </ng-container>\n </mat-form-field>\n</div>\n", styles: [".form-select-placeholder{position:absolute;margin-left:81px;margin-top:-3px;opacity:.8}\n"], dependencies: [{ kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }], animations: [appearOpacity], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7397
7424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormFieldSelectComponent, decorators: [{
|
|
7398
7425
|
type: Component,
|
|
7399
7426
|
args: [{ selector: 'shared-form-field-select', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearOpacity], template: "<div [formGroup]=\"form\">\n <mat-form-field appearance=\"outline\"\n class=\"width100\">\n <mat-label>{{fieldData.title}}</mat-label>\n <mat-select [required]=\"fieldData.validators?.includes('required')\"\n [multiple]=\"fieldData.options.multiple\"\n [formControlName]=\"fieldData.field\">\n <mat-option *ngIf=\"fieldData.options.innerSearch\">\n <ngx-mat-select-search\n placeholderLabel=\"\u041F\u043E\u0438\u0441\u043A...\"\n [formControl]=\"searchCtrl\"></ngx-mat-select-search>\n </mat-option>\n <mat-option *ngIf=\"!fieldData.validators?.includes('required')\" value=\"0\">\n -----\n </mat-option>\n <ng-container *ngIf=\"!fieldData.options.loading\">\n <ng-container *ngIf=\"options.length\">\n <mat-option *ngFor=\"let item of options\" [value]=\"item.id\">\n {{item.name || item['title']}}\n </mat-option>\n </ng-container>\n <ng-container *ngIf=\"!options.length\">\n <mat-option>\n \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442\n </mat-option>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"fieldData.options.loading\">\n <mat-option>\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430....</mat-option>\n </ng-container>\n </mat-select>\n <ng-container *ngIf=\"!options.length && placeholder\">\n <div @appearOpacity class=\"form-select-placeholder\">{{placeholder}}</div>\n </ng-container>\n </mat-form-field>\n</div>\n", styles: [".form-select-placeholder{position:absolute;margin-left:81px;margin-top:-3px;opacity:.8}\n"] }]
|
|
@@ -7401,6 +7428,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
7401
7428
|
type: Input
|
|
7402
7429
|
}], form: [{
|
|
7403
7430
|
type: Input
|
|
7431
|
+
}], autoCompleteFields: [{
|
|
7432
|
+
type: Input
|
|
7404
7433
|
}] } });
|
|
7405
7434
|
|
|
7406
7435
|
class FormFieldSlideToggleComponent {
|
|
@@ -7761,9 +7790,7 @@ class FormFieldFileComponent {
|
|
|
7761
7790
|
untilComponentDestroyed(this)
|
|
7762
7791
|
)
|
|
7763
7792
|
.subscribe(() => {
|
|
7764
|
-
console.log("this.currentPristineValue", this.currentPristineValue, this.form.pristine);
|
|
7765
7793
|
if (!this.currentPristineValue && this.form.pristine) {
|
|
7766
|
-
console.log("ngOnInit");
|
|
7767
7794
|
this.clearFile();
|
|
7768
7795
|
}
|
|
7769
7796
|
this.currentPristineValue = this.form.pristine;
|
|
@@ -7772,7 +7799,6 @@ class FormFieldFileComponent {
|
|
|
7772
7799
|
ngOnChanges(changes) {
|
|
7773
7800
|
const field = this.fieldData.field;
|
|
7774
7801
|
if (field && this.form) {
|
|
7775
|
-
console.log("ngOnChanges", this.form.get(field)?.value);
|
|
7776
7802
|
this.imageVersions = this.form.get(field)?.value?.versions || "";
|
|
7777
7803
|
if (this.imageVersions) {
|
|
7778
7804
|
this.inputStatus = "0";
|
|
@@ -7802,14 +7828,12 @@ class FormFieldFileComponent {
|
|
|
7802
7828
|
}
|
|
7803
7829
|
}
|
|
7804
7830
|
deleteImage() {
|
|
7805
|
-
console.log("deleteImage");
|
|
7806
7831
|
const id = this.form.get("id")?.value;
|
|
7807
7832
|
const field = this.fieldData.field;
|
|
7808
7833
|
if (id) {
|
|
7809
7834
|
this.dialogService.openDeleteDialog()
|
|
7810
7835
|
.pipe(untilComponentDestroyed(this))
|
|
7811
7836
|
.subscribe((result) => {
|
|
7812
|
-
console.log("result");
|
|
7813
7837
|
if (result) {
|
|
7814
7838
|
if (!this.imageSource) {
|
|
7815
7839
|
this.initRequest();
|
|
@@ -7830,13 +7854,11 @@ class FormFieldFileComponent {
|
|
|
7830
7854
|
this.request$
|
|
7831
7855
|
.pipe(filter(request => request.status === this.requestStatuses.LOADED), take(1), untilComponentDestroyed(this))
|
|
7832
7856
|
.subscribe((data) => {
|
|
7833
|
-
console.log("data", data);
|
|
7834
7857
|
this.clearFile();
|
|
7835
7858
|
});
|
|
7836
7859
|
}
|
|
7837
7860
|
}
|
|
7838
7861
|
clearFile() {
|
|
7839
|
-
console.log("clearFile");
|
|
7840
7862
|
this.input.nativeElement.value = "";
|
|
7841
7863
|
this.imageSource = "";
|
|
7842
7864
|
this.imageVersions = null;
|
|
@@ -8568,10 +8590,10 @@ class FormFieldComponent {
|
|
|
8568
8590
|
}
|
|
8569
8591
|
}
|
|
8570
8592
|
FormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormFieldComponent, deps: [{ token: CORE_CONFIG }, { token: AuthenticationService }, { token: CoreFacade }, { token: i0.ChangeDetectorRef }, { token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
8571
|
-
FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormFieldComponent, selector: "shared-form-field", inputs: { fieldData: "fieldData", itemId: "itemId", form: "form", editorImageUploadUrl: "editorImageUploadUrl", errorMessageTexts: "errorMessageTexts", entity: "entity", publicationMessages: "publicationMessages", entityTypeUserRoleRights: "entityTypeUserRoleRights" }, outputs: { eventUpdateForm: "eventUpdateForm", eventSendAction: "eventSendAction" }, ngImport: i0, template: "<div *ngIf=\"!fieldData.options.notEditable && !fieldData.options.hide\"\n fxLayout=\"column\"\n class=\"position-relative form-field\"\n [id]=\"'field-' + fieldData.field\"\n [formGroup]=\"form\"\n [ngClass]=\"{\n 'border-block textarea-field mb-21': fieldData.type === fieldTypes.FieldTypeTextarea || fieldData.type === fieldTypes.FieldTypeTextareaEditor,\n 'form-field-error': haveFieldError,\n 'form-field-warning': haveFieldWarning,\n 'check-box-field': fieldData.type === fieldTypes.FieldTypeSlideToggle\n }\">\n <ng-container [ngSwitch]=\"fieldData.type\">\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSelect\">\n <shared-form-field-select\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-select>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSlideToggle\">\n <shared-form-field-slide-toggle\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-slide-toggle>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextarea\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <textarea matInput rows=\"6\" [formControlName]=\"fieldData.field\"></textarea>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextareaEditor\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <div *ngIf=\"fieldData.description\" class=\"field-description\">\n {{fieldData.description}}\n </div>\n <ckeditor [formControlName]=\"fieldData.field\"\n [config]=\"ckeConfig\"></ckeditor>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFile\">\n <shared-form-field-file\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [entity]=\"entity\"\n ></shared-form-field-file>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFiles\">\n <shared-form-field-files\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-files>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTags\">\n <shared-form-field-tags\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-tags>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <shared-form-field-input\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-input>\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"fieldData.actions\" class=\"field-actions\">\n <ng-container *ngFor=\"let action of fieldData.actions\">\n <div class=\"field-actions-action\" (click)=\"fieldActionHandler(action)\">{{action.title}}</div>\n </ng-container>\n </div>\n\n <shared-form-field-spinner *ngIf=\"fieldData.options.loading\"></shared-form-field-spinner>\n\n <ng-container *ngIf=\"fieldData.options.hint\">\n <mat-icon class=\"hint-icons\" (click)=\"openHintDialog(fieldData.options.hint)\">help_outline</mat-icon>\n </ng-container>\n\n <shared-form-field-error\n @appearFromLeft\n *ngIf=\"fieldControl.touched && !fieldControl.valid\"\n [form]=\"form\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-error>\n\n <shared-form-field-publish-error\n [form]=\"form\"\n [entity]=\"entity\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-publish-error>\n</div>\n", styles: [".mb-21{margin-bottom:21px}.field-description{border-radius:8px;color:#5f5b5b;margin:5px 5px 15px;border-left:3px solid #009ce5;padding:10px 0 10px 10px;background:rgba(0,156,229,.2588235294)}.field-actions{display:flex;justify-content:flex-end;margin-bottom:5px}.field-actions .field-actions-action{padding:0 10px;text-align:right;background:#007bff;color:#fff;border-radius:4px}.textarea-field-length{background:#f8f8f8;text-align:right;padding-right:10px;color:#989494;border-bottom:1px solid #d1d1d1;font-size:11px}.hint-icons{position:absolute;right:0;margin-top:9px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: FormFieldErrorComponent, selector: "shared-form-field-error", inputs: ["fieldData", "form", "errorMessageTexts"] }, { kind: "component", type: FormFieldPublishErrorComponent, selector: "shared-form-field-publish-error", inputs: ["fieldData", "form", "entity", "errorMessageTexts"] }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i9.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i11.CKEditorComponent, selector: "ckeditor", inputs: ["editorUrl", "tagName", "type", "data", "readOnly", "config"], outputs: ["namespaceLoaded", "ready", "dataReady", "change", "dataChange", "dragStart", "dragEnd", "drop", "fileUploadResponse", "fileUploadRequest", "focus", "paste", "afterPaste", "blur"] }, { kind: "component", type: FormFieldSpinnerComponent, selector: "shared-form-field-spinner" }, { kind: "component", type: FormFieldSelectComponent, selector: "shared-form-field-select", inputs: ["fieldData", "form"] }, { kind: "component", type: FormFieldSlideToggleComponent, selector: "shared-form-field-slide-toggle", inputs: ["fieldData", "form"] }, { kind: "component", type: FormFieldInputComponent, selector: "shared-form-field-input", inputs: ["fieldData", "form"] }, { kind: "component", type: FormFieldFileComponent, selector: "shared-form-field-file", inputs: ["fieldData", "form", "entity"] }, { kind: "component", type: FormFieldFilesComponent, selector: "shared-form-field-files", inputs: ["fieldData", "form", "itemId"] }, { kind: "component", type: FormFieldTagsComponent, selector: "shared-form-field-tags", inputs: ["fieldData", "form", "itemId"] }], animations: [appearFromLeft], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8593
|
+
FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormFieldComponent, selector: "shared-form-field", inputs: { fieldData: "fieldData", itemId: "itemId", form: "form", editorImageUploadUrl: "editorImageUploadUrl", errorMessageTexts: "errorMessageTexts", entity: "entity", publicationMessages: "publicationMessages", entityTypeUserRoleRights: "entityTypeUserRoleRights", autoCompleteFields: "autoCompleteFields" }, outputs: { eventUpdateForm: "eventUpdateForm", eventSendAction: "eventSendAction" }, ngImport: i0, template: "<div *ngIf=\"!fieldData.options.notEditable && !fieldData.options.hide\"\n fxLayout=\"column\"\n class=\"position-relative form-field\"\n [id]=\"'field-' + fieldData.field\"\n [formGroup]=\"form\"\n [ngClass]=\"{\n 'border-block textarea-field mb-21': fieldData.type === fieldTypes.FieldTypeTextarea || fieldData.type === fieldTypes.FieldTypeTextareaEditor,\n 'form-field-error': haveFieldError,\n 'form-field-warning': haveFieldWarning,\n 'check-box-field': fieldData.type === fieldTypes.FieldTypeSlideToggle\n }\">\n <ng-container [ngSwitch]=\"fieldData.type\">\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSelect\">\n <shared-form-field-select\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [autoCompleteFields]=\"autoCompleteFields\"\n ></shared-form-field-select>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSlideToggle\">\n <shared-form-field-slide-toggle\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-slide-toggle>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextarea\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <textarea matInput rows=\"6\" [formControlName]=\"fieldData.field\"></textarea>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextareaEditor\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <div *ngIf=\"fieldData.description\" class=\"field-description\">\n {{fieldData.description}}\n </div>\n <ckeditor [formControlName]=\"fieldData.field\"\n [config]=\"ckeConfig\"></ckeditor>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFile\">\n <shared-form-field-file\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [entity]=\"entity\"\n ></shared-form-field-file>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFiles\">\n <shared-form-field-files\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-files>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTags\">\n <shared-form-field-tags\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-tags>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <shared-form-field-input\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-input>\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"fieldData.actions\" class=\"field-actions\">\n <ng-container *ngFor=\"let action of fieldData.actions\">\n <div class=\"field-actions-action\" (click)=\"fieldActionHandler(action)\">{{action.title}}</div>\n </ng-container>\n </div>\n\n <shared-form-field-spinner *ngIf=\"fieldData.options.loading\"></shared-form-field-spinner>\n\n <ng-container *ngIf=\"fieldData.options.hint\">\n <mat-icon class=\"hint-icons\" (click)=\"openHintDialog(fieldData.options.hint)\">help_outline</mat-icon>\n </ng-container>\n\n <shared-form-field-error\n @appearFromLeft\n *ngIf=\"fieldControl.touched && !fieldControl.valid\"\n [form]=\"form\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-error>\n\n <shared-form-field-publish-error\n [form]=\"form\"\n [entity]=\"entity\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-publish-error>\n</div>\n", styles: [".mb-21{margin-bottom:21px}.field-description{border-radius:8px;color:#5f5b5b;margin:5px 5px 15px;border-left:3px solid #009ce5;padding:10px 0 10px 10px;background:rgba(0,156,229,.2588235294)}.field-actions{display:flex;justify-content:flex-end;margin-bottom:5px}.field-actions .field-actions-action{padding:0 10px;text-align:right;background:#007bff;color:#fff;border-radius:4px}.textarea-field-length{background:#f8f8f8;text-align:right;padding-right:10px;color:#989494;border-bottom:1px solid #d1d1d1;font-size:11px}.hint-icons{position:absolute;right:0;margin-top:9px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: FormFieldErrorComponent, selector: "shared-form-field-error", inputs: ["fieldData", "form", "errorMessageTexts"] }, { kind: "component", type: FormFieldPublishErrorComponent, selector: "shared-form-field-publish-error", inputs: ["fieldData", "form", "entity", "errorMessageTexts"] }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i9.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i11.CKEditorComponent, selector: "ckeditor", inputs: ["editorUrl", "tagName", "type", "data", "readOnly", "config"], outputs: ["namespaceLoaded", "ready", "dataReady", "change", "dataChange", "dragStart", "dragEnd", "drop", "fileUploadResponse", "fileUploadRequest", "focus", "paste", "afterPaste", "blur"] }, { kind: "component", type: FormFieldSpinnerComponent, selector: "shared-form-field-spinner" }, { kind: "component", type: FormFieldSelectComponent, selector: "shared-form-field-select", inputs: ["fieldData", "form", "autoCompleteFields"] }, { kind: "component", type: FormFieldSlideToggleComponent, selector: "shared-form-field-slide-toggle", inputs: ["fieldData", "form"] }, { kind: "component", type: FormFieldInputComponent, selector: "shared-form-field-input", inputs: ["fieldData", "form"] }, { kind: "component", type: FormFieldFileComponent, selector: "shared-form-field-file", inputs: ["fieldData", "form", "entity"] }, { kind: "component", type: FormFieldFilesComponent, selector: "shared-form-field-files", inputs: ["fieldData", "form", "itemId"] }, { kind: "component", type: FormFieldTagsComponent, selector: "shared-form-field-tags", inputs: ["fieldData", "form", "itemId"] }], animations: [appearFromLeft], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8572
8594
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
8573
8595
|
type: Component,
|
|
8574
|
-
args: [{ selector: 'shared-form-field', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearFromLeft], template: "<div *ngIf=\"!fieldData.options.notEditable && !fieldData.options.hide\"\n fxLayout=\"column\"\n class=\"position-relative form-field\"\n [id]=\"'field-' + fieldData.field\"\n [formGroup]=\"form\"\n [ngClass]=\"{\n 'border-block textarea-field mb-21': fieldData.type === fieldTypes.FieldTypeTextarea || fieldData.type === fieldTypes.FieldTypeTextareaEditor,\n 'form-field-error': haveFieldError,\n 'form-field-warning': haveFieldWarning,\n 'check-box-field': fieldData.type === fieldTypes.FieldTypeSlideToggle\n }\">\n <ng-container [ngSwitch]=\"fieldData.type\">\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSelect\">\n <shared-form-field-select\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-select>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSlideToggle\">\n <shared-form-field-slide-toggle\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-slide-toggle>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextarea\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <textarea matInput rows=\"6\" [formControlName]=\"fieldData.field\"></textarea>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextareaEditor\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <div *ngIf=\"fieldData.description\" class=\"field-description\">\n {{fieldData.description}}\n </div>\n <ckeditor [formControlName]=\"fieldData.field\"\n [config]=\"ckeConfig\"></ckeditor>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFile\">\n <shared-form-field-file\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [entity]=\"entity\"\n ></shared-form-field-file>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFiles\">\n <shared-form-field-files\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-files>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTags\">\n <shared-form-field-tags\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-tags>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <shared-form-field-input\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-input>\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"fieldData.actions\" class=\"field-actions\">\n <ng-container *ngFor=\"let action of fieldData.actions\">\n <div class=\"field-actions-action\" (click)=\"fieldActionHandler(action)\">{{action.title}}</div>\n </ng-container>\n </div>\n\n <shared-form-field-spinner *ngIf=\"fieldData.options.loading\"></shared-form-field-spinner>\n\n <ng-container *ngIf=\"fieldData.options.hint\">\n <mat-icon class=\"hint-icons\" (click)=\"openHintDialog(fieldData.options.hint)\">help_outline</mat-icon>\n </ng-container>\n\n <shared-form-field-error\n @appearFromLeft\n *ngIf=\"fieldControl.touched && !fieldControl.valid\"\n [form]=\"form\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-error>\n\n <shared-form-field-publish-error\n [form]=\"form\"\n [entity]=\"entity\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-publish-error>\n</div>\n", styles: [".mb-21{margin-bottom:21px}.field-description{border-radius:8px;color:#5f5b5b;margin:5px 5px 15px;border-left:3px solid #009ce5;padding:10px 0 10px 10px;background:rgba(0,156,229,.2588235294)}.field-actions{display:flex;justify-content:flex-end;margin-bottom:5px}.field-actions .field-actions-action{padding:0 10px;text-align:right;background:#007bff;color:#fff;border-radius:4px}.textarea-field-length{background:#f8f8f8;text-align:right;padding-right:10px;color:#989494;border-bottom:1px solid #d1d1d1;font-size:11px}.hint-icons{position:absolute;right:0;margin-top:9px}\n"] }]
|
|
8596
|
+
args: [{ selector: 'shared-form-field', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearFromLeft], template: "<div *ngIf=\"!fieldData.options.notEditable && !fieldData.options.hide\"\n fxLayout=\"column\"\n class=\"position-relative form-field\"\n [id]=\"'field-' + fieldData.field\"\n [formGroup]=\"form\"\n [ngClass]=\"{\n 'border-block textarea-field mb-21': fieldData.type === fieldTypes.FieldTypeTextarea || fieldData.type === fieldTypes.FieldTypeTextareaEditor,\n 'form-field-error': haveFieldError,\n 'form-field-warning': haveFieldWarning,\n 'check-box-field': fieldData.type === fieldTypes.FieldTypeSlideToggle\n }\">\n <ng-container [ngSwitch]=\"fieldData.type\">\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSelect\">\n <shared-form-field-select\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [autoCompleteFields]=\"autoCompleteFields\"\n ></shared-form-field-select>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeSlideToggle\">\n <shared-form-field-slide-toggle\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-slide-toggle>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextarea\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <textarea matInput rows=\"6\" [formControlName]=\"fieldData.field\"></textarea>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTextareaEditor\">\n <div class=\"textarea-field-width\">\n <label\n [id]=\"'field-' + fieldData.field\">{{fieldData.title}}{{fieldData.validators && fieldData.validators.includes('required') ? ' *' : ''}}</label>\n <div *ngIf=\"fieldData.description\" class=\"field-description\">\n {{fieldData.description}}\n </div>\n <ckeditor [formControlName]=\"fieldData.field\"\n [config]=\"ckeConfig\"></ckeditor>\n <div class=\"textarea-field-length\">\n <b>\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0434\u043B\u0438\u043D\u0430: {{form.get(fieldData.field).value?.length || 0}}</b>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFile\">\n <shared-form-field-file\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [entity]=\"entity\"\n ></shared-form-field-file>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeFiles\">\n <shared-form-field-files\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-files>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"fieldTypes.FieldTypeTags\">\n <shared-form-field-tags\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n [itemId]=\"itemId\"\n ></shared-form-field-tags>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <shared-form-field-input\n [fieldData]=\"fieldData\"\n [form]=\"form\"\n ></shared-form-field-input>\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"fieldData.actions\" class=\"field-actions\">\n <ng-container *ngFor=\"let action of fieldData.actions\">\n <div class=\"field-actions-action\" (click)=\"fieldActionHandler(action)\">{{action.title}}</div>\n </ng-container>\n </div>\n\n <shared-form-field-spinner *ngIf=\"fieldData.options.loading\"></shared-form-field-spinner>\n\n <ng-container *ngIf=\"fieldData.options.hint\">\n <mat-icon class=\"hint-icons\" (click)=\"openHintDialog(fieldData.options.hint)\">help_outline</mat-icon>\n </ng-container>\n\n <shared-form-field-error\n @appearFromLeft\n *ngIf=\"fieldControl.touched && !fieldControl.valid\"\n [form]=\"form\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-error>\n\n <shared-form-field-publish-error\n [form]=\"form\"\n [entity]=\"entity\"\n [fieldData]=\"fieldData\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [ngClass]=\"{'textarea-error': fieldData.type === fieldTypes.FieldTypeTextarea}\"\n ></shared-form-field-publish-error>\n</div>\n", styles: [".mb-21{margin-bottom:21px}.field-description{border-radius:8px;color:#5f5b5b;margin:5px 5px 15px;border-left:3px solid #009ce5;padding:10px 0 10px 10px;background:rgba(0,156,229,.2588235294)}.field-actions{display:flex;justify-content:flex-end;margin-bottom:5px}.field-actions .field-actions-action{padding:0 10px;text-align:right;background:#007bff;color:#fff;border-radius:4px}.textarea-field-length{background:#f8f8f8;text-align:right;padding-right:10px;color:#989494;border-bottom:1px solid #d1d1d1;font-size:11px}.hint-icons{position:absolute;right:0;margin-top:9px}\n"] }]
|
|
8575
8597
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
8576
8598
|
type: Inject,
|
|
8577
8599
|
args: [CORE_CONFIG]
|
|
@@ -8591,6 +8613,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
8591
8613
|
type: Input
|
|
8592
8614
|
}], entityTypeUserRoleRights: [{
|
|
8593
8615
|
type: Input
|
|
8616
|
+
}], autoCompleteFields: [{
|
|
8617
|
+
type: Input
|
|
8594
8618
|
}], eventUpdateForm: [{
|
|
8595
8619
|
type: Output
|
|
8596
8620
|
}], eventSendAction: [{
|
|
@@ -8894,38 +8918,48 @@ class PublicationMessagesComponent {
|
|
|
8894
8918
|
this.scrollToField = new EventEmitter();
|
|
8895
8919
|
this.errorOpened = false;
|
|
8896
8920
|
this.messagesOpened = false;
|
|
8897
|
-
this.publishedTitle =
|
|
8898
|
-
this.unPublishedTitle =
|
|
8899
|
-
this.unPublishedMessage =
|
|
8900
|
-
this.errorTitleSource =
|
|
8901
|
-
this.recommendationTitleSource =
|
|
8902
|
-
this.errorTitle =
|
|
8903
|
-
this.recommendationTitle =
|
|
8921
|
+
this.publishedTitle = 'Позиция опубликована до';
|
|
8922
|
+
this.unPublishedTitle = 'Внимание позиция НЕ опубликована';
|
|
8923
|
+
this.unPublishedMessage = 'Для публикации позиции нужно заполнить все поля и нажать на кнопку ОПУБЛИКОВАТЬ';
|
|
8924
|
+
this.errorTitleSource = 'Для публикации Вам обязательно нужно исправить <b>${pointCount}</b> пункт(а/ов)';
|
|
8925
|
+
this.recommendationTitleSource = 'Мы также рекомендуем Вам исправить <b>${pointCount}</b> пункт(а/ов)';
|
|
8926
|
+
this.errorTitle = '';
|
|
8927
|
+
this.recommendationTitle = '';
|
|
8904
8928
|
this.publishErrorConstants = PublishErrors;
|
|
8905
|
-
this.itemPublishFinishedField =
|
|
8906
|
-
this.itemPublishFinishedAt =
|
|
8907
|
-
this.itemPublishFinishedAtTmp =
|
|
8929
|
+
this.itemPublishFinishedField = 'publishFinishedAt';
|
|
8930
|
+
this.itemPublishFinishedAt = '';
|
|
8931
|
+
this.itemPublishFinishedAtTmp = '';
|
|
8932
|
+
this.globalSubscription = new Subscription();
|
|
8908
8933
|
}
|
|
8909
8934
|
ngOnInit() {
|
|
8910
|
-
this.
|
|
8911
|
-
this.definitionPublicationMessages();
|
|
8935
|
+
this.preparingComponent();
|
|
8912
8936
|
}
|
|
8913
8937
|
ngOnDestroy() {
|
|
8938
|
+
this.globalSubscription.unsubscribe();
|
|
8914
8939
|
}
|
|
8915
8940
|
ngOnChanges(changes) {
|
|
8916
8941
|
if (changes?.form?.currentValue.value[this.itemPublishFinishedField]) {
|
|
8917
8942
|
this.updateItemPublishFinishAt(changes.form.currentValue.value[this.itemPublishFinishedField]);
|
|
8918
8943
|
}
|
|
8944
|
+
if (changes.entity || changes.itemId) {
|
|
8945
|
+
this.globalSubscription.unsubscribe();
|
|
8946
|
+
this.globalSubscription = new Subscription();
|
|
8947
|
+
this.preparingComponent();
|
|
8948
|
+
}
|
|
8949
|
+
}
|
|
8950
|
+
preparingComponent() {
|
|
8951
|
+
this.subscribeToFormChanges();
|
|
8952
|
+
this.definitionPublicationMessages();
|
|
8919
8953
|
}
|
|
8920
8954
|
showScrollToFieldMethod(field) {
|
|
8921
8955
|
this.scrollToField.emit(field);
|
|
8922
8956
|
}
|
|
8923
8957
|
subscribeToFormChanges() {
|
|
8924
|
-
this.form.valueChanges
|
|
8925
|
-
.pipe(untilComponentDestroyed(this))
|
|
8958
|
+
const subscription = this.form.valueChanges
|
|
8926
8959
|
.subscribe((data) => {
|
|
8927
8960
|
this.updateItemPublishFinishAt(data?.publishFinishedAt);
|
|
8928
8961
|
});
|
|
8962
|
+
this.globalSubscription.add(subscription);
|
|
8929
8963
|
}
|
|
8930
8964
|
updateItemPublishFinishAt(itemPublishFinishedAt) {
|
|
8931
8965
|
if (this.itemPublishFinishedAtTmp !== itemPublishFinishedAt) {
|
|
@@ -8935,9 +8969,8 @@ class PublicationMessagesComponent {
|
|
|
8935
8969
|
}
|
|
8936
8970
|
}
|
|
8937
8971
|
definitionPublicationMessages() {
|
|
8938
|
-
if (typeof this.entity ===
|
|
8939
|
-
this.publicationMessagesFacade.getPublicationMessage(this.entity?.toLowerCase(), this.itemId)
|
|
8940
|
-
.pipe(untilComponentDestroyed(this))
|
|
8972
|
+
if (typeof this.entity === 'string') {
|
|
8973
|
+
const subscription = this.publicationMessagesFacade.getPublicationMessage(this.entity?.toLowerCase(), this.itemId)
|
|
8941
8974
|
.subscribe((messages) => {
|
|
8942
8975
|
if (messages?.length) {
|
|
8943
8976
|
const tmpErrors = this.filterMessages(true, messages);
|
|
@@ -8945,10 +8978,10 @@ class PublicationMessagesComponent {
|
|
|
8945
8978
|
const tmpRecommendation = this.filterMessages(false, messages);
|
|
8946
8979
|
this.recommendation = this.prepareErrors(tmpRecommendation);
|
|
8947
8980
|
if (this.errors.length) {
|
|
8948
|
-
this.errorTitle = this.errorTitleSource.replace(
|
|
8981
|
+
this.errorTitle = this.errorTitleSource.replace('${pointCount}', String(this.errors.length));
|
|
8949
8982
|
}
|
|
8950
8983
|
if (this.recommendation.length) {
|
|
8951
|
-
this.recommendationTitle = this.recommendationTitleSource.replace(
|
|
8984
|
+
this.recommendationTitle = this.recommendationTitleSource.replace('${pointCount}', String(this.recommendation.length));
|
|
8952
8985
|
}
|
|
8953
8986
|
}
|
|
8954
8987
|
else {
|
|
@@ -8957,9 +8990,10 @@ class PublicationMessagesComponent {
|
|
|
8957
8990
|
}
|
|
8958
8991
|
this.cd.markForCheck();
|
|
8959
8992
|
});
|
|
8993
|
+
this.globalSubscription.add(subscription);
|
|
8960
8994
|
}
|
|
8961
8995
|
else {
|
|
8962
|
-
console.error(
|
|
8996
|
+
console.error('[ publish-messages ][ entity-type ]', { entity: this.entity }, 'INCORRECT_ENTITY_TYPE');
|
|
8963
8997
|
}
|
|
8964
8998
|
}
|
|
8965
8999
|
filterMessages(error = false, messages) {
|
|
@@ -8982,10 +9016,10 @@ class PublicationMessagesComponent {
|
|
|
8982
9016
|
}
|
|
8983
9017
|
}
|
|
8984
9018
|
PublicationMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PublicationMessagesComponent, deps: [{ token: PublicationMessagesFacade }, { token: AutoFormService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8985
|
-
PublicationMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PublicationMessagesComponent, selector: "shared-publication-messages", inputs: { entity: "entity", form: "form", itemId: "itemId", fields: "fields", config: "config", havePublication: "havePublication" }, outputs: { scrollToField: "scrollToField" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"itemPublishFinishedAt\" @appearFromLeftWithDelay class=\"message-box success mb-10\">\n <div>{{publishedTitle}} <b>{{itemPublishFinishedAt| date : 'MMM d, y'}}</b></div>\n</div>\n<div *ngIf=\"!itemPublishFinishedAt && havePublication\" @appearFromLeftWithDelay class=\"message-box error mb-10\">\n <div>{{unPublishedTitle}}</div>\n
|
|
9019
|
+
PublicationMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PublicationMessagesComponent, selector: "shared-publication-messages", inputs: { entity: "entity", form: "form", itemId: "itemId", fields: "fields", config: "config", havePublication: "havePublication" }, outputs: { scrollToField: "scrollToField" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"itemPublishFinishedAt\" @appearFromLeftWithDelay class=\"message-box success mb-10\">\n <div>{{publishedTitle}} <b>{{itemPublishFinishedAt| date : 'MMM d, y'}}</b></div>\n</div>\n<div *ngIf=\"!itemPublishFinishedAt && havePublication\" @appearFromLeftWithDelay class=\"message-box error mb-10\">\n <div class=\"no-publish-error\">\n <mat-icon class=\"no-publish-error-ico\">assignment_late</mat-icon>\n <div class=\"no-publish-error-text\">\n <div>{{unPublishedTitle}}</div>\n <div class=\"fs-12 pt-0\">{{unPublishedMessage}}</div>\n </div>\n </div>\n</div>\n<ng-container *ngIf=\"errors?.length\">\n <ng-container\n *ngTemplateOutlet=\"listMessages; context: {title: errorTitle, isError: true, messages: errors}\"></ng-container>\n</ng-container>\n<ng-container *ngIf=\"recommendation?.length\">\n <ng-container\n *ngTemplateOutlet=\"listMessages; context: {title: recommendationTitle, isError: false, messages: recommendation}\"></ng-container>\n</ng-container>\n<ng-template #listMessages let-title=\"title\" let-isError=\"isError\" let-messages=\"messages\">\n <div class=\"publish-messages mb-10\"\n [ngClass]=\"{'error-messages': isError, 'warning-messages': !isError}\">\n <div class=\"title cursor-pointer\"\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n (click)=\"toggleExpand(isError)\">\n <div fxLayout=\"row\" fxLayoutAlign=\"left center\">\n <mat-icon class=\"f-28 ml-10 mr-20\">{{isError ? 'error' : 'report_problem'}}</mat-icon>\n <h4 [innerHTML]=\"title\"></h4>\n </div>\n <shared-button\n color=\"basic\"\n iconColor=\"orange_gray\"\n size=\"large\"\n [icon]=\"(isError && errorOpened) || (!isError && messagesOpened) ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></shared-button>\n </div>\n <div *ngIf=\"(errorOpened && isError) || (messagesOpened && !isError)\"\n [@expandCollapse]\n class=\"publish-messages-list\">\n <div *ngFor=\"let messageData of messages;trackBy: truckByField\" class=\"mb-10\">\n <shared-panel [title]=\"messageData.title\"\n [description]=\"messageData.description\"\n color=\"red-light\"\n buttonColor=\"accent\"\n ></shared-panel>\n <a class=\"cursor-pointer color-grey fs-12\" (click)=\"showScrollToFieldMethod(messageData.field)\">\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\n \u043F\u043E\u043B\u0435</a>\n </div>\n </div>\n </div>\n</ng-template>\n<div *ngIf=\"errors?.length || recommendation?.length\" fxLayout=\"row\" fxLayoutAlign=\"end center\" class=\"fs-12\">\n \u0415\u0441\u043B\u0438 \u0443 \u0412\u0430\u0441 \u0435\u0441\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438 \u043F\u0438\u0448\u0438\u0442\u0435 \u0432 <a class=\"pl-5\" href=\"mailto:support@world-travel.uz\">support@world-travel.uz</a>\n</div>\n", styles: [".publish-messages{border-radius:8px;overflow:hidden}.publish-messages.error-messages{background:linear-gradient(90deg,#ef847c,#f190af)}.publish-messages.error-messages .title{background:#f44336;background:linear-gradient(to bottom,#f44336,#af3b32);color:#fff}.publish-messages.warning-messages{background:linear-gradient(260deg,#faf0cd,#fab397)}.publish-messages.warning-messages .title{background:#e28d0b;background:linear-gradient(to bottom,#ffb646,#e28d0b);color:#fff}.publish-messages .title{padding:10px;border-top-left-radius:8px;border-top-right-radius:8px;text-shadow:0 0 6px rgba(56,56,56,.5803921569);font-size:16px}.publish-messages .publish-messages-list{padding:10px}.publish-messages .h4,.publish-messages h4{cursor:pointer}.no-publish-error{display:flex}.no-publish-error .no-publish-error-ico{font-size:43px;margin-right:10px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i9.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i9.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PanelComponent, selector: "shared-panel", inputs: ["title", "smallDescription", "description", "color", "buttonColor"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "shared-button", inputs: ["icon", "iconColor", "iconSize", "rightIcon", "disabled", "loading", "active", "stopPropagation", "type", "color", "size", "styleTheme", "tooltip", "tooltipPosition"], outputs: ["clickButton"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }], animations: [expandCollapse, appearFromLeftWithDelay], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8986
9020
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PublicationMessagesComponent, decorators: [{
|
|
8987
9021
|
type: Component,
|
|
8988
|
-
args: [{ selector:
|
|
9022
|
+
args: [{ selector: 'shared-publication-messages', animations: [expandCollapse, appearFromLeftWithDelay], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"itemPublishFinishedAt\" @appearFromLeftWithDelay class=\"message-box success mb-10\">\n <div>{{publishedTitle}} <b>{{itemPublishFinishedAt| date : 'MMM d, y'}}</b></div>\n</div>\n<div *ngIf=\"!itemPublishFinishedAt && havePublication\" @appearFromLeftWithDelay class=\"message-box error mb-10\">\n <div class=\"no-publish-error\">\n <mat-icon class=\"no-publish-error-ico\">assignment_late</mat-icon>\n <div class=\"no-publish-error-text\">\n <div>{{unPublishedTitle}}</div>\n <div class=\"fs-12 pt-0\">{{unPublishedMessage}}</div>\n </div>\n </div>\n</div>\n<ng-container *ngIf=\"errors?.length\">\n <ng-container\n *ngTemplateOutlet=\"listMessages; context: {title: errorTitle, isError: true, messages: errors}\"></ng-container>\n</ng-container>\n<ng-container *ngIf=\"recommendation?.length\">\n <ng-container\n *ngTemplateOutlet=\"listMessages; context: {title: recommendationTitle, isError: false, messages: recommendation}\"></ng-container>\n</ng-container>\n<ng-template #listMessages let-title=\"title\" let-isError=\"isError\" let-messages=\"messages\">\n <div class=\"publish-messages mb-10\"\n [ngClass]=\"{'error-messages': isError, 'warning-messages': !isError}\">\n <div class=\"title cursor-pointer\"\n fxLayout=\"row\"\n fxLayoutAlign=\"space-between center\"\n (click)=\"toggleExpand(isError)\">\n <div fxLayout=\"row\" fxLayoutAlign=\"left center\">\n <mat-icon class=\"f-28 ml-10 mr-20\">{{isError ? 'error' : 'report_problem'}}</mat-icon>\n <h4 [innerHTML]=\"title\"></h4>\n </div>\n <shared-button\n color=\"basic\"\n iconColor=\"orange_gray\"\n size=\"large\"\n [icon]=\"(isError && errorOpened) || (!isError && messagesOpened) ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></shared-button>\n </div>\n <div *ngIf=\"(errorOpened && isError) || (messagesOpened && !isError)\"\n [@expandCollapse]\n class=\"publish-messages-list\">\n <div *ngFor=\"let messageData of messages;trackBy: truckByField\" class=\"mb-10\">\n <shared-panel [title]=\"messageData.title\"\n [description]=\"messageData.description\"\n color=\"red-light\"\n buttonColor=\"accent\"\n ></shared-panel>\n <a class=\"cursor-pointer color-grey fs-12\" (click)=\"showScrollToFieldMethod(messageData.field)\">\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\n \u043F\u043E\u043B\u0435</a>\n </div>\n </div>\n </div>\n</ng-template>\n<div *ngIf=\"errors?.length || recommendation?.length\" fxLayout=\"row\" fxLayoutAlign=\"end center\" class=\"fs-12\">\n \u0415\u0441\u043B\u0438 \u0443 \u0412\u0430\u0441 \u0435\u0441\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438 \u043F\u0438\u0448\u0438\u0442\u0435 \u0432 <a class=\"pl-5\" href=\"mailto:support@world-travel.uz\">support@world-travel.uz</a>\n</div>\n", styles: [".publish-messages{border-radius:8px;overflow:hidden}.publish-messages.error-messages{background:linear-gradient(90deg,#ef847c,#f190af)}.publish-messages.error-messages .title{background:#f44336;background:linear-gradient(to bottom,#f44336,#af3b32);color:#fff}.publish-messages.warning-messages{background:linear-gradient(260deg,#faf0cd,#fab397)}.publish-messages.warning-messages .title{background:#e28d0b;background:linear-gradient(to bottom,#ffb646,#e28d0b);color:#fff}.publish-messages .title{padding:10px;border-top-left-radius:8px;border-top-right-radius:8px;text-shadow:0 0 6px rgba(56,56,56,.5803921569);font-size:16px}.publish-messages .publish-messages-list{padding:10px}.publish-messages .h4,.publish-messages h4{cursor:pointer}.no-publish-error{display:flex}.no-publish-error .no-publish-error-ico{font-size:43px;margin-right:10px}\n"] }]
|
|
8989
9023
|
}], ctorParameters: function () { return [{ type: PublicationMessagesFacade }, { type: AutoFormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { entity: [{
|
|
8990
9024
|
type: Input
|
|
8991
9025
|
}], form: [{
|
|
@@ -9003,10 +9037,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
9003
9037
|
}] } });
|
|
9004
9038
|
|
|
9005
9039
|
class AutoFormMainComponent {
|
|
9006
|
-
constructor(formErrors, formsFacade, publicationMessagesFacade, cd) {
|
|
9040
|
+
constructor(formErrors, formsFacade, publicationMessagesFacade, route, cd) {
|
|
9007
9041
|
this.formErrors = formErrors;
|
|
9008
9042
|
this.formsFacade = formsFacade;
|
|
9009
9043
|
this.publicationMessagesFacade = publicationMessagesFacade;
|
|
9044
|
+
this.route = route;
|
|
9010
9045
|
this.cd = cd;
|
|
9011
9046
|
this.showPublicationMessages = false;
|
|
9012
9047
|
this.editorImageUploadUrl = '';
|
|
@@ -9014,7 +9049,7 @@ class AutoFormMainComponent {
|
|
|
9014
9049
|
this.config = { needToPublish: true };
|
|
9015
9050
|
this.changed = new EventEmitter();
|
|
9016
9051
|
this.formCompleted = new EventEmitter();
|
|
9017
|
-
this.
|
|
9052
|
+
this.globalSubscription = new Subscription();
|
|
9018
9053
|
this.object_ = Object;
|
|
9019
9054
|
this.dataStored = false;
|
|
9020
9055
|
this.dataStoredTitle = 'Данные сохранены';
|
|
@@ -9022,20 +9057,48 @@ class AutoFormMainComponent {
|
|
|
9022
9057
|
this.groupsState = {};
|
|
9023
9058
|
}
|
|
9024
9059
|
ngOnInit() {
|
|
9060
|
+
this.currentEntity = this.entity;
|
|
9061
|
+
this.currentItemId = this.itemId;
|
|
9025
9062
|
if (this.itemId) {
|
|
9026
9063
|
this.dataStored = true;
|
|
9027
9064
|
}
|
|
9028
9065
|
this.storedFormValue = this.form.value;
|
|
9066
|
+
this.preparingData();
|
|
9067
|
+
this.getQueryParams();
|
|
9068
|
+
}
|
|
9069
|
+
ngOnDestroy() {
|
|
9070
|
+
this.globalSubscription.unsubscribe();
|
|
9071
|
+
}
|
|
9072
|
+
ngOnChanges(changes) {
|
|
9073
|
+
if ((changes.entity && changes.entity.currentValue !== this.currentEntity) ||
|
|
9074
|
+
(changes.itemId && changes.itemId.currentValue !== this.currentItemId)) {
|
|
9075
|
+
this.globalSubscription.unsubscribe();
|
|
9076
|
+
this.globalSubscription = new Subscription();
|
|
9077
|
+
this.preparingData();
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
getQueryParams() {
|
|
9081
|
+
this.route.queryParamMap
|
|
9082
|
+
.pipe(untilComponentDestroyed(this))
|
|
9083
|
+
.subscribe(params => {
|
|
9084
|
+
this.autoCompleteFields = [];
|
|
9085
|
+
const fields = params.getAll('fields');
|
|
9086
|
+
const fieldsValue = params.getAll('fieldsvalue');
|
|
9087
|
+
for (let i = 0; i < fields.length; i++) {
|
|
9088
|
+
this.autoCompleteFields.push({
|
|
9089
|
+
field: fields[i],
|
|
9090
|
+
value: Number(fieldsValue[i])
|
|
9091
|
+
});
|
|
9092
|
+
}
|
|
9093
|
+
});
|
|
9094
|
+
}
|
|
9095
|
+
preparingData() {
|
|
9029
9096
|
this.groupFields();
|
|
9030
9097
|
this.subscribeToFormErrors();
|
|
9031
9098
|
this.subscribeToFormStatus();
|
|
9032
9099
|
this.subscribeToFormChanges();
|
|
9033
9100
|
this.subscribeToPublicationMessages();
|
|
9034
9101
|
}
|
|
9035
|
-
ngOnDestroy() {
|
|
9036
|
-
this.unSubscribeSubject$.next();
|
|
9037
|
-
this.unSubscribeSubject$.complete();
|
|
9038
|
-
}
|
|
9039
9102
|
groupFields() {
|
|
9040
9103
|
this.groupedFields = {};
|
|
9041
9104
|
this.fields.filter(formField => !formField.options?.notEditable)
|
|
@@ -9062,8 +9125,8 @@ class AutoFormMainComponent {
|
|
|
9062
9125
|
}, 0);
|
|
9063
9126
|
}
|
|
9064
9127
|
subscribeToFormErrors() {
|
|
9065
|
-
this.formErrors.getFormErrors(this.formId)
|
|
9066
|
-
.pipe(
|
|
9128
|
+
const newSubscription = this.formErrors.getFormErrors(this.formId)
|
|
9129
|
+
.pipe(filter((errors) => !!(errors && errors.length)))
|
|
9067
9130
|
.subscribe((errors) => {
|
|
9068
9131
|
if (errors && errors.length) {
|
|
9069
9132
|
errors.forEach(error => {
|
|
@@ -9081,14 +9144,14 @@ class AutoFormMainComponent {
|
|
|
9081
9144
|
this.cd.markForCheck();
|
|
9082
9145
|
}
|
|
9083
9146
|
});
|
|
9147
|
+
this.globalSubscription.add(newSubscription);
|
|
9084
9148
|
}
|
|
9085
9149
|
subscribeToFormStatus() {
|
|
9086
9150
|
this.formsFacade.initForm({
|
|
9087
9151
|
formId: this.formId,
|
|
9088
9152
|
loading: false
|
|
9089
9153
|
});
|
|
9090
|
-
this.formsFacade.getForm(this.formId)
|
|
9091
|
-
.pipe(takeUntil(this.unSubscribeSubject$))
|
|
9154
|
+
const newSubscription = this.formsFacade.getForm(this.formId)
|
|
9092
9155
|
.subscribe((form) => {
|
|
9093
9156
|
if (form.isComplete) {
|
|
9094
9157
|
this.formCompleted.emit({ newId: form.data.itemId });
|
|
@@ -9103,10 +9166,10 @@ class AutoFormMainComponent {
|
|
|
9103
9166
|
this.cd.markForCheck();
|
|
9104
9167
|
}
|
|
9105
9168
|
});
|
|
9169
|
+
this.globalSubscription.add(newSubscription);
|
|
9106
9170
|
}
|
|
9107
9171
|
subscribeToFormChanges() {
|
|
9108
|
-
this.form.valueChanges
|
|
9109
|
-
.pipe(takeUntil(this.unSubscribeSubject$))
|
|
9172
|
+
const newSubscription = this.form.valueChanges
|
|
9110
9173
|
.subscribe((formValue) => {
|
|
9111
9174
|
const areEquals = this.areObjectsEquals(formValue, this.storedFormValue);
|
|
9112
9175
|
if (!areEquals) {
|
|
@@ -9115,6 +9178,7 @@ class AutoFormMainComponent {
|
|
|
9115
9178
|
this.dataStored = areEquals;
|
|
9116
9179
|
this.changed.emit({ valueChanged: !areEquals });
|
|
9117
9180
|
});
|
|
9181
|
+
this.globalSubscription.add(newSubscription);
|
|
9118
9182
|
}
|
|
9119
9183
|
groupClick(groupName) {
|
|
9120
9184
|
this.groupsState[groupName] = !this.groupsState[groupName];
|
|
@@ -9139,20 +9203,20 @@ class AutoFormMainComponent {
|
|
|
9139
9203
|
}
|
|
9140
9204
|
subscribeToPublicationMessages() {
|
|
9141
9205
|
if (this.itemId) {
|
|
9142
|
-
this.publicationMessagesFacade.getPublicationMessage(this.entity, this.itemId)
|
|
9143
|
-
.pipe(takeUntil(this.unSubscribeSubject$))
|
|
9206
|
+
const newSubscription = this.publicationMessagesFacade.getPublicationMessage(this.entity, this.itemId)
|
|
9144
9207
|
.subscribe((publicationMessages) => {
|
|
9145
9208
|
this.allPublicationMessages = publicationMessages;
|
|
9146
9209
|
});
|
|
9210
|
+
this.globalSubscription.add(newSubscription);
|
|
9147
9211
|
}
|
|
9148
9212
|
}
|
|
9149
9213
|
}
|
|
9150
|
-
AutoFormMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AutoFormMainComponent, deps: [{ token: FormErrorsFacade }, { token: FormsFacade }, { token: PublicationMessagesFacade }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
9151
|
-
AutoFormMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AutoFormMainComponent, selector: "shared-auto-form", inputs: { fields: "fields", itemId: "itemId", formId: "formId", showPublicationMessages: "showPublicationMessages", form: "form", editorImageUploadUrl: "editorImageUploadUrl", errorMessageTexts: "errorMessageTexts", entity: "entity", havePublication: "havePublication", config: "config" }, outputs: { changed: "changed", formCompleted: "formCompleted" }, ngImport: i0, template: "<shared-smart-progress-bar *ngIf=\"storedFormValue._occupancyRating\"\n [value]=\"storedFormValue._occupancyRating\"\n [title]=\"'\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0441\u0442\u0438 \u0444\u043E\u0440\u043C\u044B'\"></shared-smart-progress-bar>\n\n<ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n</ng-container>\n\n<div *ngFor=\"let group of object_.keys(groupedFields); trackBy: truckByFieldName\"\n class=\"form-group\"\n [ngClass]=\"{'form-group-open': groupsState[group]}\">\n <h2 *ngIf=\"group\" class=\"form-field-group-title\" (click)=\"groupClick(group)\">\n <mat-icon class=\"fs-20 field-group-icon\">expand_more</mat-icon>\n {{group}}\n </h2>\n <div *ngIf=\"groupsState[group]\"\n class=\"form-group-fields\">\n <div *ngFor=\"let item of groupedFields[group]; trackBy: truckByFieldName\"\n class=\"form-field-row col-md-12\"\n [ngClass]=\"item.options.col ? 'col-lg-'+item.options.col : ''\">\n\n <div [ngClass]=\"{'field-tab': group}\">\n <shared-form-field\n [itemId]=\"itemId\"\n [fieldData]=\"item\"\n [form]=\"form\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [editorImageUploadUrl]=\"editorImageUploadUrl\"\n [entity]=\"entity\"\n [publicationMessages]=\"allPublicationMessages\"\n ></shared-form-field>\n </div>\n </div>\n </div>\n</div>\n<div @appearFromLeft *ngIf=\"dataStored && form.valid\" class=\"message-box warning mt-20 mb-10\">\n <ul>\n <li>{{dataStoredTitle}}</li>\n </ul>\n</div>\n<shred-form-message-box\n class=\"mt-20 mb-10\"\n [form]=\"form\"\n [fields]=\"fields\"\n [errorMessageTexts]=\"errorMessageTexts\"></shred-form-message-box>\n\n<ng-container *ngIf=\"havePublication\">\n <ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #publicationMessages let-form=\"form\" let-entity=\"entity\" let-itemId=\"itemId\" let-fields=\"fields\">\n <shared-publication-messages\n [@appearFromLeft]\n [form]=\"form\"\n [entity]=\"entity\"\n [itemId]=\"itemId\"\n [fields]=\"fields\"\n [havePublication]=\"havePublication\"\n (scrollToField)=\"scrollToField($event)\"></shared-publication-messages>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;flex-wrap:wrap}.form-group{cursor:pointer}.form-group h2{display:flex;transition:color .3s}.progress-bar{margin-bottom:10px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: SmartProgressBarComponent, selector: "shared-smart-progress-bar", inputs: ["value", "title", "showValue"] }, { kind: "component", type: FormFieldComponent, selector: "shared-form-field", inputs: ["fieldData", "itemId", "form", "editorImageUploadUrl", "errorMessageTexts", "entity", "publicationMessages", "entityTypeUserRoleRights"], outputs: ["eventUpdateForm", "eventSendAction"] }, { kind: "component", type: FormMessageBoxComponent, selector: "shred-form-message-box", inputs: ["form", "fields", "errorMessageTexts"] }, { kind: "component", type: PublicationMessagesComponent, selector: "shared-publication-messages", inputs: ["entity", "form", "itemId", "fields", "config", "havePublication"], outputs: ["scrollToField"] }], animations: [appearFromLeft, appearOpacity], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9214
|
+
AutoFormMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AutoFormMainComponent, deps: [{ token: FormErrorsFacade }, { token: FormsFacade }, { token: PublicationMessagesFacade }, { token: i3.ActivatedRoute }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
9215
|
+
AutoFormMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AutoFormMainComponent, selector: "shared-auto-form", inputs: { fields: "fields", itemId: "itemId", formId: "formId", showPublicationMessages: "showPublicationMessages", form: "form", editorImageUploadUrl: "editorImageUploadUrl", errorMessageTexts: "errorMessageTexts", entity: "entity", havePublication: "havePublication", config: "config" }, outputs: { changed: "changed", formCompleted: "formCompleted" }, usesOnChanges: true, ngImport: i0, template: "<shared-smart-progress-bar *ngIf=\"storedFormValue._occupancyRating\"\n [value]=\"storedFormValue._occupancyRating\"\n [title]=\"'\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0441\u0442\u0438 \u0444\u043E\u0440\u043C\u044B'\"></shared-smart-progress-bar>\n\n<ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n</ng-container>\n\n<div *ngFor=\"let group of object_.keys(groupedFields); trackBy: truckByFieldName\"\n class=\"form-group\"\n [ngClass]=\"{'form-group-open': groupsState[group]}\">\n <h2 *ngIf=\"group\" class=\"form-field-group-title\" (click)=\"groupClick(group)\">\n <mat-icon class=\"fs-20 field-group-icon\">expand_more</mat-icon>\n {{group}}\n </h2>\n <div *ngIf=\"groupsState[group]\"\n class=\"form-group-fields\">\n <div *ngFor=\"let item of groupedFields[group]; trackBy: truckByFieldName\"\n class=\"form-field-row col-md-12\"\n [ngClass]=\"item.options.col ? 'col-lg-'+item.options.col : ''\">\n\n <div [ngClass]=\"{'field-tab': group}\">\n <shared-form-field\n [itemId]=\"itemId\"\n [fieldData]=\"item\"\n [form]=\"form\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [editorImageUploadUrl]=\"editorImageUploadUrl\"\n [entity]=\"entity\"\n [publicationMessages]=\"allPublicationMessages\"\n [autoCompleteFields]=\"autoCompleteFields\"\n ></shared-form-field>\n </div>\n </div>\n </div>\n</div>\n<div @appearFromLeft *ngIf=\"dataStored && form.valid\" class=\"message-box warning mt-20 mb-10\">\n <ul>\n <li>{{dataStoredTitle}}</li>\n </ul>\n</div>\n<shred-form-message-box\n class=\"mt-20 mb-10\"\n [form]=\"form\"\n [fields]=\"fields\"\n [errorMessageTexts]=\"errorMessageTexts\"></shred-form-message-box>\n\n<ng-container *ngIf=\"havePublication\">\n <ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #publicationMessages let-form=\"form\" let-entity=\"entity\" let-itemId=\"itemId\" let-fields=\"fields\">\n <shared-publication-messages\n *ngIf=\"itemId\"\n [@appearFromLeft]\n [form]=\"form\"\n [entity]=\"entity\"\n [itemId]=\"itemId\"\n [fields]=\"fields\"\n [havePublication]=\"havePublication\"\n (scrollToField)=\"scrollToField($event)\"></shared-publication-messages>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;flex-wrap:wrap}.form-group{cursor:pointer}.form-group h2{display:flex;transition:color .3s}.progress-bar{margin-bottom:10px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: SmartProgressBarComponent, selector: "shared-smart-progress-bar", inputs: ["value", "title", "showValue"] }, { kind: "component", type: FormFieldComponent, selector: "shared-form-field", inputs: ["fieldData", "itemId", "form", "editorImageUploadUrl", "errorMessageTexts", "entity", "publicationMessages", "entityTypeUserRoleRights", "autoCompleteFields"], outputs: ["eventUpdateForm", "eventSendAction"] }, { kind: "component", type: FormMessageBoxComponent, selector: "shred-form-message-box", inputs: ["form", "fields", "errorMessageTexts"] }, { kind: "component", type: PublicationMessagesComponent, selector: "shared-publication-messages", inputs: ["entity", "form", "itemId", "fields", "config", "havePublication"], outputs: ["scrollToField"] }], animations: [appearFromLeft, appearOpacity], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9152
9216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AutoFormMainComponent, decorators: [{
|
|
9153
9217
|
type: Component,
|
|
9154
|
-
args: [{ selector: 'shared-auto-form', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearFromLeft, appearOpacity], template: "<shared-smart-progress-bar *ngIf=\"storedFormValue._occupancyRating\"\n [value]=\"storedFormValue._occupancyRating\"\n [title]=\"'\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0441\u0442\u0438 \u0444\u043E\u0440\u043C\u044B'\"></shared-smart-progress-bar>\n\n<ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n</ng-container>\n\n<div *ngFor=\"let group of object_.keys(groupedFields); trackBy: truckByFieldName\"\n class=\"form-group\"\n [ngClass]=\"{'form-group-open': groupsState[group]}\">\n <h2 *ngIf=\"group\" class=\"form-field-group-title\" (click)=\"groupClick(group)\">\n <mat-icon class=\"fs-20 field-group-icon\">expand_more</mat-icon>\n {{group}}\n </h2>\n <div *ngIf=\"groupsState[group]\"\n class=\"form-group-fields\">\n <div *ngFor=\"let item of groupedFields[group]; trackBy: truckByFieldName\"\n class=\"form-field-row col-md-12\"\n [ngClass]=\"item.options.col ? 'col-lg-'+item.options.col : ''\">\n\n <div [ngClass]=\"{'field-tab': group}\">\n <shared-form-field\n [itemId]=\"itemId\"\n [fieldData]=\"item\"\n [form]=\"form\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [editorImageUploadUrl]=\"editorImageUploadUrl\"\n [entity]=\"entity\"\n [publicationMessages]=\"allPublicationMessages\"\n ></shared-form-field>\n </div>\n </div>\n </div>\n</div>\n<div @appearFromLeft *ngIf=\"dataStored && form.valid\" class=\"message-box warning mt-20 mb-10\">\n <ul>\n <li>{{dataStoredTitle}}</li>\n </ul>\n</div>\n<shred-form-message-box\n class=\"mt-20 mb-10\"\n [form]=\"form\"\n [fields]=\"fields\"\n [errorMessageTexts]=\"errorMessageTexts\"></shred-form-message-box>\n\n<ng-container *ngIf=\"havePublication\">\n <ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #publicationMessages let-form=\"form\" let-entity=\"entity\" let-itemId=\"itemId\" let-fields=\"fields\">\n <shared-publication-messages\n [@appearFromLeft]\n [form]=\"form\"\n [entity]=\"entity\"\n [itemId]=\"itemId\"\n [fields]=\"fields\"\n [havePublication]=\"havePublication\"\n (scrollToField)=\"scrollToField($event)\"></shared-publication-messages>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;flex-wrap:wrap}.form-group{cursor:pointer}.form-group h2{display:flex;transition:color .3s}.progress-bar{margin-bottom:10px}\n"] }]
|
|
9155
|
-
}], ctorParameters: function () { return [{ type: FormErrorsFacade }, { type: FormsFacade }, { type: PublicationMessagesFacade }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { fields: [{
|
|
9218
|
+
args: [{ selector: 'shared-auto-form', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearFromLeft, appearOpacity], template: "<shared-smart-progress-bar *ngIf=\"storedFormValue._occupancyRating\"\n [value]=\"storedFormValue._occupancyRating\"\n [title]=\"'\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0441\u0442\u0438 \u0444\u043E\u0440\u043C\u044B'\"></shared-smart-progress-bar>\n\n<ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n</ng-container>\n\n<div *ngFor=\"let group of object_.keys(groupedFields); trackBy: truckByFieldName\"\n class=\"form-group\"\n [ngClass]=\"{'form-group-open': groupsState[group]}\">\n <h2 *ngIf=\"group\" class=\"form-field-group-title\" (click)=\"groupClick(group)\">\n <mat-icon class=\"fs-20 field-group-icon\">expand_more</mat-icon>\n {{group}}\n </h2>\n <div *ngIf=\"groupsState[group]\"\n class=\"form-group-fields\">\n <div *ngFor=\"let item of groupedFields[group]; trackBy: truckByFieldName\"\n class=\"form-field-row col-md-12\"\n [ngClass]=\"item.options.col ? 'col-lg-'+item.options.col : ''\">\n\n <div [ngClass]=\"{'field-tab': group}\">\n <shared-form-field\n [itemId]=\"itemId\"\n [fieldData]=\"item\"\n [form]=\"form\"\n [errorMessageTexts]=\"errorMessageTexts\"\n [editorImageUploadUrl]=\"editorImageUploadUrl\"\n [entity]=\"entity\"\n [publicationMessages]=\"allPublicationMessages\"\n [autoCompleteFields]=\"autoCompleteFields\"\n ></shared-form-field>\n </div>\n </div>\n </div>\n</div>\n<div @appearFromLeft *ngIf=\"dataStored && form.valid\" class=\"message-box warning mt-20 mb-10\">\n <ul>\n <li>{{dataStoredTitle}}</li>\n </ul>\n</div>\n<shred-form-message-box\n class=\"mt-20 mb-10\"\n [form]=\"form\"\n [fields]=\"fields\"\n [errorMessageTexts]=\"errorMessageTexts\"></shred-form-message-box>\n\n<ng-container *ngIf=\"havePublication\">\n <ng-container *ngIf=\"showPublicationMessages && fields?.length\">\n <ng-container\n *ngTemplateOutlet=\"publicationMessages, context: {form: form, entity: entity, itemId: itemId, fields: fields}\"></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #publicationMessages let-form=\"form\" let-entity=\"entity\" let-itemId=\"itemId\" let-fields=\"fields\">\n <shared-publication-messages\n *ngIf=\"itemId\"\n [@appearFromLeft]\n [form]=\"form\"\n [entity]=\"entity\"\n [itemId]=\"itemId\"\n [fields]=\"fields\"\n [havePublication]=\"havePublication\"\n (scrollToField)=\"scrollToField($event)\"></shared-publication-messages>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;flex-wrap:wrap}.form-group{cursor:pointer}.form-group h2{display:flex;transition:color .3s}.progress-bar{margin-bottom:10px}\n"] }]
|
|
9219
|
+
}], ctorParameters: function () { return [{ type: FormErrorsFacade }, { type: FormsFacade }, { type: PublicationMessagesFacade }, { type: i3.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { fields: [{
|
|
9156
9220
|
type: Input
|
|
9157
9221
|
}], itemId: [{
|
|
9158
9222
|
type: Input
|