survey-angular-ui 1.9.127 → 1.9.128
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/bundles/survey-angular-ui.umd.js +28 -32
- package/bundles/survey-angular-ui.umd.js.map +1 -1
- package/components/progress/buttons/progress.component.d.ts +14 -12
- package/esm2015/components/progress/buttons/progress.component.js +30 -33
- package/fesm2015/survey-angular-ui.js +29 -32
- package/fesm2015/survey-angular-ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { SurveyModel } from "survey-core";
|
|
2
|
+
import { SurveyModel, ProgressButtons, IProgressButtonsViewModel } from "survey-core";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ProgressButtonsComponent implements OnDestroy, AfterViewInit, OnChanges, OnInit {
|
|
4
|
+
export declare class ProgressButtonsComponent implements OnDestroy, AfterViewInit, OnChanges, OnInit, IProgressButtonsViewModel {
|
|
5
5
|
private changeDetectorRef;
|
|
6
|
-
model:
|
|
6
|
+
model: ProgressButtons;
|
|
7
|
+
survey: SurveyModel;
|
|
8
|
+
container: string;
|
|
7
9
|
progressButtonsListContainer: ElementRef<HTMLDivElement>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
hasScroller: boolean;
|
|
11
|
+
canShowHeader: boolean;
|
|
12
|
+
canShowFooter: boolean;
|
|
13
|
+
canShowItemTitles: boolean;
|
|
14
|
+
private respManager?;
|
|
11
15
|
constructor(changeDetectorRef: ChangeDetectorRef);
|
|
12
|
-
|
|
16
|
+
onResize(canShowItemTitles: boolean): void;
|
|
17
|
+
onUpdateScroller(hasScroller: boolean): void;
|
|
18
|
+
onUpdateSettings(): void;
|
|
13
19
|
ngOnInit(): void;
|
|
14
20
|
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
isListElementClickable(index: number): boolean;
|
|
16
|
-
getListElementCss(index: number): string;
|
|
17
|
-
clickListElement(index: number): void;
|
|
18
|
-
getScrollButtonCss(isLeftScroll: boolean): string;
|
|
19
21
|
clickScrollButton(isLeftScroll: boolean): void;
|
|
20
22
|
ngAfterViewInit(): void;
|
|
21
23
|
ngOnDestroy(): void;
|
|
22
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProgressButtonsComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ProgressButtonsComponent, "sv-ng-progress-buttons", never, { "model": "model"; }, {}, never, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ProgressButtonsComponent, "sv-ng-progress-buttons", never, { "model": "model"; "survey": "survey"; "container": "container"; }, {}, never, never>;
|
|
24
26
|
}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { Component, Input, ViewChild } from "@angular/core";
|
|
2
|
+
import { ProgressButtonsResponsivityManager } from "survey-core";
|
|
2
3
|
import { AngularComponentFactory } from "../../../component-factory";
|
|
3
|
-
import { SurveyProgressButtonsModel } from "survey-core";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "@angular/common";
|
|
6
6
|
export class ProgressButtonsComponent {
|
|
7
7
|
constructor(changeDetectorRef) {
|
|
8
8
|
this.changeDetectorRef = changeDetectorRef;
|
|
9
9
|
this.hasScroller = false;
|
|
10
|
-
this.
|
|
10
|
+
this.canShowHeader = false;
|
|
11
|
+
this.canShowFooter = false;
|
|
12
|
+
this.canShowItemTitles = true;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
+
onResize(canShowItemTitles) {
|
|
15
|
+
this.canShowItemTitles = canShowItemTitles;
|
|
16
|
+
this.canShowHeader = !this.canShowItemTitles;
|
|
17
|
+
this.changeDetectorRef.detectChanges();
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
ngOnChanges(changes) {
|
|
19
|
-
this.createProgressButtonsModel();
|
|
19
|
+
onUpdateScroller(hasScroller) {
|
|
20
|
+
this.hasScroller = hasScroller;
|
|
21
|
+
this.changeDetectorRef.detectChanges();
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
onUpdateSettings() {
|
|
24
|
+
this.canShowItemTitles = this.model.showItemTitles;
|
|
25
|
+
this.canShowFooter = !this.model.showItemTitles;
|
|
26
|
+
this.changeDetectorRef.detectChanges();
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
return this.progressButtonsModel.getListElementCss(index);
|
|
26
|
-
}
|
|
27
|
-
clickListElement(index) {
|
|
28
|
-
this.progressButtonsModel.clickListElement(index);
|
|
28
|
+
ngOnInit() {
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
return this.progressButtonsModel.getScrollButtonCss(this.hasScroller, isLeftScroll);
|
|
30
|
+
ngOnChanges(changes) {
|
|
32
31
|
}
|
|
33
32
|
clickScrollButton(isLeftScroll) {
|
|
34
33
|
if (this.progressButtonsListContainer) {
|
|
@@ -36,25 +35,19 @@ export class ProgressButtonsComponent {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
ngAfterViewInit() {
|
|
39
|
-
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.hasScroller = listContainerElement.scrollWidth > listContainerElement.offsetWidth;
|
|
45
|
-
this.changeDetectorRef.detectChanges();
|
|
46
|
-
}
|
|
47
|
-
}, 100);
|
|
38
|
+
var _a;
|
|
39
|
+
if (!!((_a = this.progressButtonsListContainer) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
40
|
+
const element = this.progressButtonsListContainer.nativeElement;
|
|
41
|
+
this.respManager = new ProgressButtonsResponsivityManager(this.model, element, this);
|
|
42
|
+
}
|
|
48
43
|
}
|
|
49
44
|
ngOnDestroy() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.updateScroller = undefined;
|
|
53
|
-
}
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this.respManager) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
49
|
ProgressButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ProgressButtonsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
-
ProgressButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ProgressButtonsComponent, selector: "sv-ng-progress-buttons", inputs: { model: "model" }, viewQueries: [{ propertyName: "progressButtonsListContainer", first: true, predicate: ["progressButtonsListContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"model.css.
|
|
50
|
+
ProgressButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ProgressButtonsComponent, selector: "sv-ng-progress-buttons", inputs: { model: "model", survey: "survey", container: "container" }, viewQueries: [{ propertyName: "progressButtonsListContainer", first: true, predicate: ["progressButtonsListContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"model.getRootCss(container)\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-label=\"progress\">\n <div *ngIf=\"canShowHeader\" [class]=\"survey.css.progressButtonsHeader\">\n <div [class]=\"survey.css.progressButtonsPageTitle\" [title]=\"model.headerText\">{{ model.headerText }}</div>\n </div>\n <div [class]=\"survey.css.progressButtonsContainer\">\n <div\n [class]=\"model.getScrollButtonCss(hasScroller, true)\"\n (click)=\"clickScrollButton(true)\"\n role=\"button\"\n ></div>\n <div\n [class]=\"survey.css.progressButtonsListContainer\" #progressButtonsListContainer>\n <ul [class]=\"survey.css.progressButtonsList\">\n <li\n *ngFor=\"let page of survey.visiblePages; index as index\"\n [class]=\"model.getListElementCss(index)\"\n (click)=\"model.isListElementClickable(index) ? model.clickListElement(page) : null\"\n [attr.data-page-number]=\"model.getItemNumber(page)\">\n <div [class]=\"survey.css.progressButtonsConnector\"></div>\n <div *ngIf=\"canShowItemTitles\"\n [class]=\"survey.css.progressButtonsPageTitle\"\n [title]=\"page.renderedNavigationTitle\"\n >\n {{ page.renderedNavigationTitle }}\n </div>\n <div *ngIf=\"canShowItemTitles\"\n [class]=\"survey.css.progressButtonsPageDescription\"\n [title]=\"page.locNavigationDescription.renderedHtml\"\n >\n {{ page.locNavigationDescription.renderedHtml }}\n </div>\n </li>\n </ul>\n </div>\n <div\n [class]=\"model.getScrollButtonCss(hasScroller, false)\"\n (click)=\"clickScrollButton(false)\"\n role=\"button\"\n ></div>\n </div>\n <div *ngIf=\"canShowFooter\" [class]=\"survey.css.progressButtonsFooter\">\n <div [class]=\"survey.css.progressButtonsPageTitle\" [title]=\"model.footerText\">{{ model.footerText }}</div>\n </div>\n</div>", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
58
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ProgressButtonsComponent, decorators: [{
|
|
59
52
|
type: Component,
|
|
60
53
|
args: [{
|
|
@@ -63,9 +56,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
63
56
|
}]
|
|
64
57
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { model: [{
|
|
65
58
|
type: Input
|
|
59
|
+
}], survey: [{
|
|
60
|
+
type: Input
|
|
61
|
+
}], container: [{
|
|
62
|
+
type: Input
|
|
66
63
|
}], progressButtonsListContainer: [{
|
|
67
64
|
type: ViewChild,
|
|
68
65
|
args: ["progressButtonsListContainer"]
|
|
69
66
|
}] } });
|
|
70
67
|
AngularComponentFactory.Instance.registerComponent("sv-progress-buttons", ProgressButtonsComponent);
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3Jlc3MuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvcHJvZ3Jlc3MvYnV0dG9ucy9wcm9ncmVzcy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9wcm9ncmVzcy9idXR0b25zL3Byb2dyZXNzLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBb0MsU0FBUyxFQUFjLEtBQUssRUFBK0MsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZKLE9BQU8sRUFBZ0Msa0NBQWtDLEVBQTZCLE1BQU0sYUFBYSxDQUFDO0FBQzFILE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLDRCQUE0QixDQUFDOzs7QUFNckUsTUFBTSxPQUFPLHdCQUF3QjtJQVVuQyxZQUFvQixpQkFBb0M7UUFBcEMsc0JBQWlCLEdBQWpCLGlCQUFpQixDQUFtQjtRQUxqRCxnQkFBVyxHQUFZLEtBQUssQ0FBQztRQUM3QixrQkFBYSxHQUFZLEtBQUssQ0FBQztRQUMvQixrQkFBYSxHQUFZLEtBQUssQ0FBQztRQUMvQixzQkFBaUIsR0FBWSxJQUFJLENBQUM7SUFHekMsQ0FBQztJQUNELFFBQVEsQ0FBQyxpQkFBMEI7UUFDakMsSUFBSSxDQUFDLGlCQUFpQixHQUFHLGlCQUFpQixDQUFDO1FBQzNDLElBQUksQ0FBQyxhQUFhLEdBQUcsQ0FBQyxJQUFJLENBQUMs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pdj4iXX0=
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { TemplateRef, Component, ViewChild, Directive, Input, ViewContainerRef, Injectable, HostBinding, ElementRef, Pipe, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as Survey from 'survey-core';
|
|
4
|
-
import { createPopupModalViewModel, settings, createDialogOptions, SvgRegistry, PopupSurveyModel, LocalizableString, createPopupViewModel, DropdownListModel, Helpers, DropdownMultiSelectListModel, RendererFactory, ButtonGroupItemModel, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, getActionDropdownButtonTarget, ActionDropdownViewModel, SurveyProgressModel,
|
|
4
|
+
import { createPopupModalViewModel, settings, createDialogOptions, SvgRegistry, PopupSurveyModel, LocalizableString, createPopupViewModel, DropdownListModel, Helpers, DropdownMultiSelectListModel, RendererFactory, ButtonGroupItemModel, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, getActionDropdownButtonTarget, ActionDropdownViewModel, SurveyProgressModel, ProgressButtonsResponsivityManager, SurveyModel } from 'survey-core';
|
|
5
5
|
import { DomPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
|
|
6
6
|
import * as i2 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
@@ -2424,28 +2424,27 @@ class ProgressButtonsComponent {
|
|
|
2424
2424
|
constructor(changeDetectorRef) {
|
|
2425
2425
|
this.changeDetectorRef = changeDetectorRef;
|
|
2426
2426
|
this.hasScroller = false;
|
|
2427
|
-
this.
|
|
2427
|
+
this.canShowHeader = false;
|
|
2428
|
+
this.canShowFooter = false;
|
|
2429
|
+
this.canShowItemTitles = true;
|
|
2428
2430
|
}
|
|
2429
|
-
|
|
2430
|
-
this.
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
this.createProgressButtonsModel();
|
|
2434
|
-
}
|
|
2435
|
-
ngOnChanges(changes) {
|
|
2436
|
-
this.createProgressButtonsModel();
|
|
2431
|
+
onResize(canShowItemTitles) {
|
|
2432
|
+
this.canShowItemTitles = canShowItemTitles;
|
|
2433
|
+
this.canShowHeader = !this.canShowItemTitles;
|
|
2434
|
+
this.changeDetectorRef.detectChanges();
|
|
2437
2435
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2436
|
+
onUpdateScroller(hasScroller) {
|
|
2437
|
+
this.hasScroller = hasScroller;
|
|
2438
|
+
this.changeDetectorRef.detectChanges();
|
|
2440
2439
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2440
|
+
onUpdateSettings() {
|
|
2441
|
+
this.canShowItemTitles = this.model.showItemTitles;
|
|
2442
|
+
this.canShowFooter = !this.model.showItemTitles;
|
|
2443
|
+
this.changeDetectorRef.detectChanges();
|
|
2443
2444
|
}
|
|
2444
|
-
|
|
2445
|
-
this.progressButtonsModel.clickListElement(index);
|
|
2445
|
+
ngOnInit() {
|
|
2446
2446
|
}
|
|
2447
|
-
|
|
2448
|
-
return this.progressButtonsModel.getScrollButtonCss(this.hasScroller, isLeftScroll);
|
|
2447
|
+
ngOnChanges(changes) {
|
|
2449
2448
|
}
|
|
2450
2449
|
clickScrollButton(isLeftScroll) {
|
|
2451
2450
|
if (this.progressButtonsListContainer) {
|
|
@@ -2453,25 +2452,19 @@ class ProgressButtonsComponent {
|
|
|
2453
2452
|
}
|
|
2454
2453
|
}
|
|
2455
2454
|
ngAfterViewInit() {
|
|
2456
|
-
|
|
2457
|
-
this.
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
this.hasScroller = listContainerElement.scrollWidth > listContainerElement.offsetWidth;
|
|
2462
|
-
this.changeDetectorRef.detectChanges();
|
|
2463
|
-
}
|
|
2464
|
-
}, 100);
|
|
2455
|
+
var _a;
|
|
2456
|
+
if (!!((_a = this.progressButtonsListContainer) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
2457
|
+
const element = this.progressButtonsListContainer.nativeElement;
|
|
2458
|
+
this.respManager = new ProgressButtonsResponsivityManager(this.model, element, this);
|
|
2459
|
+
}
|
|
2465
2460
|
}
|
|
2466
2461
|
ngOnDestroy() {
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
this.updateScroller = undefined;
|
|
2470
|
-
}
|
|
2462
|
+
var _a;
|
|
2463
|
+
(_a = this.respManager) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
2471
2464
|
}
|
|
2472
2465
|
}
|
|
2473
2466
|
ProgressButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ProgressButtonsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2474
|
-
ProgressButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ProgressButtonsComponent, selector: "sv-ng-progress-buttons", inputs: { model: "model" }, viewQueries: [{ propertyName: "progressButtonsListContainer", first: true, predicate: ["progressButtonsListContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"model.css.
|
|
2467
|
+
ProgressButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ProgressButtonsComponent, selector: "sv-ng-progress-buttons", inputs: { model: "model", survey: "survey", container: "container" }, viewQueries: [{ propertyName: "progressButtonsListContainer", first: true, predicate: ["progressButtonsListContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"model.getRootCss(container)\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-label=\"progress\">\n <div *ngIf=\"canShowHeader\" [class]=\"survey.css.progressButtonsHeader\">\n <div [class]=\"survey.css.progressButtonsPageTitle\" [title]=\"model.headerText\">{{ model.headerText }}</div>\n </div>\n <div [class]=\"survey.css.progressButtonsContainer\">\n <div\n [class]=\"model.getScrollButtonCss(hasScroller, true)\"\n (click)=\"clickScrollButton(true)\"\n role=\"button\"\n ></div>\n <div\n [class]=\"survey.css.progressButtonsListContainer\" #progressButtonsListContainer>\n <ul [class]=\"survey.css.progressButtonsList\">\n <li\n *ngFor=\"let page of survey.visiblePages; index as index\"\n [class]=\"model.getListElementCss(index)\"\n (click)=\"model.isListElementClickable(index) ? model.clickListElement(page) : null\"\n [attr.data-page-number]=\"model.getItemNumber(page)\">\n <div [class]=\"survey.css.progressButtonsConnector\"></div>\n <div *ngIf=\"canShowItemTitles\"\n [class]=\"survey.css.progressButtonsPageTitle\"\n [title]=\"page.renderedNavigationTitle\"\n >\n {{ page.renderedNavigationTitle }}\n </div>\n <div *ngIf=\"canShowItemTitles\"\n [class]=\"survey.css.progressButtonsPageDescription\"\n [title]=\"page.locNavigationDescription.renderedHtml\"\n >\n {{ page.locNavigationDescription.renderedHtml }}\n </div>\n </li>\n </ul>\n </div>\n <div\n [class]=\"model.getScrollButtonCss(hasScroller, false)\"\n (click)=\"clickScrollButton(false)\"\n role=\"button\"\n ></div>\n </div>\n <div *ngIf=\"canShowFooter\" [class]=\"survey.css.progressButtonsFooter\">\n <div [class]=\"survey.css.progressButtonsPageTitle\" [title]=\"model.footerText\">{{ model.footerText }}</div>\n </div>\n</div>", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2475
2468
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ProgressButtonsComponent, decorators: [{
|
|
2476
2469
|
type: Component,
|
|
2477
2470
|
args: [{
|
|
@@ -2480,6 +2473,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2480
2473
|
}]
|
|
2481
2474
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { model: [{
|
|
2482
2475
|
type: Input
|
|
2476
|
+
}], survey: [{
|
|
2477
|
+
type: Input
|
|
2478
|
+
}], container: [{
|
|
2479
|
+
type: Input
|
|
2483
2480
|
}], progressButtonsListContainer: [{
|
|
2484
2481
|
type: ViewChild,
|
|
2485
2482
|
args: ["progressButtonsListContainer"]
|