survey-analytics 1.12.25 → 1.12.27

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.
@@ -1,891 +0,0 @@
1
- /*Type definitions for SurveyJS Analytics library v1.7.26
2
- Copyright (c) 2015-2019 Devsoft Baltic OÜ - http://surveyjs.io/
3
- Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
4
- */
5
- // Dependencies for this module:
6
- // ../../survey-core
7
-
8
- import { Event } from "survey-core";
9
- import { Question } from "survey-core";
10
- import { Question, IQuestion } from "survey-core";
11
- import { QuestionMatrixDropdownModel } from "survey-core";
12
- import { SurveyModel, Event } from "survey-core";
13
- import { SurveyModel } from "survey-core";
14
- import { Question, ItemValue } from "survey-core";
15
- import { ItemValue, QuestionMatrixModel, Question } from "survey-core";
16
- import { Question, QuestionBooleanModel } from "survey-core";
17
- import { ItemValue } from "survey-core";
18
-
19
- import "./localization/farsi";
20
- import "./localization/french";
21
- import "./localization/russian";
22
-
23
- export var localization: {
24
- currentLocaleValue: string;
25
- defaultLocaleValue: string;
26
- locales: {
27
- [index: string]: any;
28
- };
29
- localeNames: {
30
- [index: string]: any;
31
- };
32
- supportedLocales: any[];
33
- currentLocale: string;
34
- defaultLocale: string;
35
- getString: (strName: string) => any;
36
- getLocales: () => Array<string>;
37
- };
38
- export var surveyStrings: {
39
- groupButton: string;
40
- ungroupButton: string;
41
- selectButton: string;
42
- hideColumn: string;
43
- showColumn: string;
44
- makePrivateColumn: string;
45
- makePublicColumn: string;
46
- moveToDetail: string;
47
- showAsColumn: string;
48
- filterPlaceholder: string;
49
- removeRows: string;
50
- showLabel: string;
51
- entriesLabel: string;
52
- visualizer_text: string;
53
- visualizer_wordcloud: string;
54
- chartType_bar: string;
55
- chartType_stackedbar: string;
56
- chartType_doughnut: string;
57
- chartType_pie: string;
58
- chartType_scatter: string;
59
- chartType_gauge: string;
60
- chartType_bullet: string;
61
- hideButton: string;
62
- makePrivateButton: string;
63
- makePublicButton: string;
64
- showButton: string;
65
- resetFilter: string;
66
- changeLocale: string;
67
- clearButton: string;
68
- addElement: string;
69
- defaultOrder: string;
70
- ascOrder: string;
71
- descOrder: string;
72
- showMinorColumns: string;
73
- otherCommentTitle: string;
74
- showPercentages: string;
75
- hidePercentages: string;
76
- };
77
-
78
- /**
79
- * Describes data info:
80
- * dataName - question name, used as a key to obtain question data
81
- * getValues - function returning an array of all possible values
82
- * getLabels - function returning an array of human-friendly descriptions for values
83
- * getSeriesValues - function returning an array of all possible series values
84
- * getSeriesLabels - function returning an array of human-friendly descriptions for series values
85
- */
86
- export interface IDataInfo {
87
- dataName: string;
88
- getValues(): Array<any>;
89
- getLabels(): Array<string>;
90
- getSeriesValues(): Array<string>;
91
- getSeriesLabels(): Array<string>;
92
- }
93
- export class DataProvider {
94
- static seriesMarkerKey: string;
95
- protected filterValues: {
96
- [index: string]: any;
97
- };
98
- constructor(_data?: Array<any>);
99
- reset(): void;
100
- get data(): Array<any>;
101
- set data(data: Array<any>);
102
- get filteredData(): {
103
- [index: string]: any;
104
- }[];
105
- /**
106
- * Sets filter by question name and value.
107
- */
108
- setFilter(questionName: string, selectedValue: any): void;
109
- protected getDataCore(dataInfo: IDataInfo): number[][];
110
- /**
111
- * Returns calculated statisctics for the IDataInfo object.
112
- */
113
- getData(dataInfo: IDataInfo): any[];
114
- /**
115
- * Fires when data has been changed.
116
- */
117
- onDataChanged: Event<(sender: DataProvider, options: any) => any, any>;
118
- protected raiseDataChanged(): void;
119
- }
120
-
121
- import "./visualizerBase.scss";
122
- export class VisualizerBase implements IDataInfo {
123
- question: Question;
124
- protected options: {
125
- [index: string]: any;
126
- };
127
- protected renderResult: HTMLElement;
128
- protected toolbarContainer: HTMLElement;
129
- protected contentContainer: HTMLElement;
130
- protected footerContainer: HTMLElement;
131
- static otherCommentCollapsed: boolean;
132
- protected toolbarItemCreators: {
133
- [name: string]: (toolbar?: HTMLDivElement) => HTMLElement;
134
- };
135
- constructor(question: Question, data: Array<{
136
- [index: string]: any;
137
- }>, options?: {
138
- [index: string]: any;
139
- }, _name?: string);
140
- protected onDataChanged(): void;
141
- get dataName(): string;
142
- get hasFooter(): boolean;
143
- protected createVisualizer(question: Question): VisualizerBase;
144
- get footerVisualizer(): VisualizerBase;
145
- getSeriesValues(): Array<string>;
146
- getSeriesLabels(): Array<string>;
147
- getValues(): Array<any>;
148
- getLabels(): Array<string>;
149
- registerToolbarItem(name: string, creator: (toolbar?: HTMLDivElement) => HTMLElement): void;
150
- get name(): string;
151
- protected get data(): {
152
- [index: string]: any;
153
- }[];
154
- protected get dataProvider(): DataProvider;
155
- /**
156
- * Updates visualizer data.
157
- */
158
- updateData(data: Array<{
159
- [index: string]: any;
160
- }>): void;
161
- onUpdate: () => void;
162
- invokeOnUpdate(): void;
163
- destroy(): void;
164
- protected createToolbarItems(toolbar: HTMLDivElement): void;
165
- protected destroyToolbar(container: HTMLElement): void;
166
- protected renderToolbar(container: HTMLElement): void;
167
- protected destroyContent(container: HTMLElement): void;
168
- protected renderContent(container: HTMLElement): void;
169
- protected destroyFooter(container: HTMLElement): void;
170
- protected renderFooter(container: HTMLElement): void;
171
- render(targetElement: HTMLElement): void;
172
- /**
173
- * Redraws visualizer and all inner content.
174
- */
175
- refresh(): void;
176
- getRandomColor(): any;
177
- backgroundColor: string;
178
- static customColors: string[];
179
- getColors(count?: number): any;
180
- get showHeader(): boolean;
181
- set showHeader(newValue: boolean);
182
- getData(): any;
183
- }
184
-
185
- type VisualizerConstructor = new (question: Question, data: Array<{
186
- [index: string]: any;
187
- }>, options?: Object) => any;
188
- export class VisualizationManager {
189
- static alternativesVisualizer: any;
190
- static vizualizers: {
191
- [index: string]: Array<VisualizerConstructor>;
192
- };
193
- /**
194
- * Register visualizer (constructor) for question type.
195
- */
196
- static registerVisualizer(typeName: string, constructor: VisualizerConstructor): void;
197
- /**
198
- * Get visualizers (constructors) for question type.
199
- */
200
- static getVisualizersByType(typeName: string): VisualizerConstructor[];
201
- /**
202
- * Get visualizers (constructors) for question type.
203
- */
204
- static getAlternativesVisualizer(): any;
205
- /**
206
- * Register visualizer (constructor) for question type.
207
- */
208
- static registerAlternativesVisualizer(constructor: any): void;
209
- }
210
- export {};
211
-
212
- import "./visualizationPanel.scss";
213
- export interface IVisualizerPanelRenderedElement extends IVisualizerPanelElement {
214
- renderedElement?: HTMLElement;
215
- }
216
- /**
217
- * VisualizationPanel is responsible for displaying an array of survey questions
218
- *
219
- * constructor parameters:
220
- * questions - an array of survey questions to visualize
221
- * data - an array of answers in format of survey result
222
- *
223
- * options:
224
- * allowDynamicLayout - set it to false to disable items drag/drop reordering and dynamic layouting
225
- * allowHideQuestions - set it to false to deny user to hide/show individual questions
226
- * seriesValues - an array of series values in data to group data by series
227
- * seriesLabels - labels for series to display, if not passed the seriesValues are used as labels
228
- * survey - pass survey instance to use localses from the survey JSON
229
- * dataProvider - dataProvider for this visualizer
230
- *
231
- * elements - list of visual element descriptions
232
- */
233
- export class VisualizationPanel extends VisualizerBase {
234
- protected questions: Array<any>;
235
- protected visualizers: Array<VisualizerBase>;
236
- constructor(questions: Array<any>, data: Array<{
237
- [index: string]: any;
238
- }>, options?: {
239
- [index: string]: any;
240
- }, _elements?: Array<IVisualizerPanelRenderedElement>, isTrustedAccess?: boolean);
241
- protected showElement(elementName: string): void;
242
- protected hideElement(elementName: string): void;
243
- protected makeElementPrivate(element: any): void;
244
- protected makeElementPublic(element: any): void;
245
- protected moveVisibleElement(fromVisibleIndex: number, toVisibleIndex: number): void;
246
- protected moveElement(fromIndex: number, toIndex: number): void;
247
- /**
248
- * Returns current locale of the visualization panel.
249
- * If locales more than one, the language selection dropdown will be added in the toolbar
250
- * In order to use survey locales the survey instance object should be passed as 'survey' option for visualizer
251
- */
252
- get locale(): string;
253
- /**
254
- * Sets locale for visualization panel.
255
- */
256
- set locale(newLocale: string);
257
- /**
258
- * Returns whether the VisualizationPanel allows dynamic layouting - rearrange items via drap/drop.
259
- */
260
- get allowDynamicLayout(): boolean;
261
- /**
262
- * Returns whether the VisualizationPanel allows to hide/show individual inner visualizers.
263
- */
264
- get allowHideQuestions(): boolean;
265
- /**
266
- * Returns the layout engine instance if any.
267
- */
268
- get layoutEngine(): LayoutEngine;
269
- protected buildElements(questions: any[]): IVisualizerPanelElement[];
270
- /**
271
- * Returns panel elements descriptions array.
272
- * Inner visualizers are rendered in the order of this array and with titles from the displayName property
273
- */
274
- getElements(): IVisualizerPanelElement[];
275
- /**
276
- * Checks whether certain element is visible.
277
- */
278
- isVisible(visibility: ElementVisibility): boolean;
279
- protected get visibleElements(): IVisualizerPanelRenderedElement[];
280
- protected get hiddenElements(): IVisualizerPanelRenderedElement[];
281
- protected get locales(): any;
282
- /**
283
- * Returns panel element description by the question name.
284
- */
285
- getElement(name: string): IVisualizerPanelRenderedElement;
286
- /**
287
- * Returns panel element visualizer by the question name.
288
- */
289
- getVisualizer(dataName: string): VisualizerBase;
290
- /**
291
- * Fires when element visibility has been changed.
292
- * options:
293
- * elements - panel elements array
294
- * changed - changed element
295
- * reason - reason (string) why event fired: "ADDED", "MOVED" or "REMOVED"
296
- */
297
- onVisibleElementsChanged: Event<(sender: VisualizationPanel, options: any) => any, any>;
298
- protected visibleElementsChanged(element: IVisualizerPanelElement, reason: string): void;
299
- /**
300
- * Fires when vizualization panel state changed.
301
- * sender - this panel
302
- * state - new state of the panel
303
- */
304
- onStateChanged: Event<(sender: VisualizationPanel, state: any) => any, any>;
305
- /**
306
- * Fires when permissions changed
307
- */
308
- onPermissionsChangedCallback: any;
309
- /**
310
- * Renders given panel element.
311
- */
312
- protected renderPanelElement(element: IVisualizerPanelRenderedElement): HTMLElement;
313
- protected renderToolbar(container: HTMLElement): void;
314
- /**
315
- * Renders all questions into given HTML container element.
316
- * container - HTML element to render the panel
317
- */
318
- renderContent(container: HTMLElement): void;
319
- /**
320
- * Destroys visualizer and all inner content.
321
- */
322
- protected destroyContent(container: HTMLElement): void;
323
- /**
324
- * Method for clearing all rendered elements from outside.
325
- */
326
- clear(): void;
327
- /**
328
- * Redraws visualizer toobar and all inner content.
329
- */
330
- refresh(): void;
331
- /**
332
- * Updates layout of visualizer inner content.
333
- */
334
- layout(): void;
335
- /**
336
- * Sets filter by question name and value.
337
- */
338
- setFilter(questionName: string, selectedValue: any): void;
339
- /**
340
- * Gets vizualization panel state.
341
- */
342
- get state(): IState;
343
- /**
344
- * Sets vizualization panel state.
345
- */
346
- set state(newState: IState);
347
- /**
348
- * Gets vizualization panel permissions.
349
- */
350
- get permissions(): IPermission[];
351
- /**
352
- * Sets vizualization panel permissions.
353
- */
354
- set permissions(permissions: IPermission[]);
355
- destroy(): void;
356
- }
357
-
358
- export class VisualizationPanelDynamic extends VisualizerBase {
359
- protected _panelVisualizer: VisualizationPanel;
360
- constructor(question: Question, data: Array<{
361
- [index: string]: any;
362
- }>, options?: {
363
- [index: string]: any;
364
- }, name?: string);
365
- get name(): string;
366
- updateData(data: Array<{
367
- [index: string]: any;
368
- }>): void;
369
- getQuestions(): IQuestion[];
370
- destroyContent(container: HTMLElement): void;
371
- renderContent(container: HTMLElement): void;
372
- }
373
-
374
- export class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
375
- constructor(question: Question, data: Array<{
376
- [index: string]: any;
377
- }>, options?: Object);
378
- get name(): string;
379
- getQuestions(): Question[];
380
- }
381
-
382
- export class VisualizationMatrixDropdown extends VisualizerBase {
383
- protected _panelVisualizer: VisualizationPanel;
384
- constructor(question: QuestionMatrixDropdownModel, data: Array<{
385
- [index: string]: any;
386
- }>, options?: {
387
- [index: string]: any;
388
- }, name?: string);
389
- updateData(data: Array<{
390
- [index: string]: any;
391
- }>): void;
392
- getQuestions(): import("survey-core").Question[];
393
- destroyContent(container: HTMLElement): void;
394
- renderContent(container: HTMLElement): void;
395
- }
396
-
397
- export class AlternativeVisualizersWrapper extends VisualizerBase {
398
- constructor(visualizers: Array<VisualizerBase>, question: Question, data: Array<{
399
- [index: string]: any;
400
- }>, options?: Object);
401
- protected visualizerContainer: HTMLElement;
402
- updateData(data: Array<{
403
- [index: string]: any;
404
- }>): void;
405
- protected renderContent(container: HTMLElement): void;
406
- destroy(): void;
407
- }
408
-
409
- import "./datatables.scss";
410
- interface DataTablesOptions {
411
- buttons: boolean | string[] | any[] | any;
412
- dom: string;
413
- orderFixed: Array<number | string> | Array<Array<number | string>> | object;
414
- rowGroup: boolean | any;
415
- headerCallback: any;
416
- }
417
- export class DataTables extends Table {
418
- datatableApi: any;
419
- currentPageNumber: number;
420
- /**
421
- * The event is fired columns configuration has been changed.
422
- * <br/> sender the datatables adapter
423
- * <br/> options.survey current survey
424
- * @see getColumns
425
- */
426
- onColumnsReorder: Event<(sender: DataTables, options: any) => any, any>;
427
- static initJQuery($: any): void;
428
- constructor(survey: SurveyModel, data: Array<Object>, options: DataTablesOptions, _columns?: Array<ITableColumn>, isTrustedAccess?: boolean);
429
- destroy(): void;
430
- setColumnVisibility(columnName: string, visibility: ColumnVisibility): void;
431
- setColumnLocation(columnName: string, location: QuestionLocation): void;
432
- applyFilter(value: string): void;
433
- applyColumnFilter(columnName: string, value: string): void;
434
- sortByColumn(columnName: string, direction: string): void;
435
- setPageSize(value: number): void;
436
- setPageNumber(value: number): void;
437
- getPageNumber(): number;
438
- render(targetNode: HTMLElement): void;
439
- getColumns(): Array<Object>;
440
- layout(): void;
441
- }
442
- export class DatatablesRow extends TableRow {
443
- protected table: Table;
444
- protected extensionsContainer: HTMLElement;
445
- protected detailsContainer: HTMLElement;
446
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement, _innerRow: any);
447
- get innerRow(): any;
448
- getElement(): HTMLElement;
449
- getRowData(): HTMLElement;
450
- getDataPosition(): number;
451
- remove(): void;
452
- }
453
- export {};
454
-
455
- import "./tabulator.scss";
456
- interface IDownloadOptions {
457
- pdf?: any;
458
- csv?: any;
459
- xlsx?: any;
460
- }
461
- interface IOptions {
462
- columnMinWidth: number;
463
- actionsColumnWidth: number;
464
- paginationButtonCount: number;
465
- downloadOptions: IDownloadOptions;
466
- }
467
- export var defaultOptions: IOptions;
468
- export class Tabulator extends Table {
469
- constructor(survey: SurveyModel, data: Array<Object>, options: IOptions, _columns?: Array<any>, isTrustedAccess?: boolean);
470
- tabulatorTables: any;
471
- render(targetNode: HTMLElement): void;
472
- destroy: () => void;
473
- getColumns(): Array<Object>;
474
- setColumnVisibility(columnName: string, visibility: ColumnVisibility): void;
475
- setColumnLocation(columnName: string, location: QuestionLocation): void;
476
- sortByColumn(columnName: string, direction: string): void;
477
- applyColumnFilter(columnName: string, value: string): void;
478
- applyFilter(value: string): void;
479
- getPageNumber(): number;
480
- setPageNumber(value: number): void;
481
- setPageSize(value: number): void;
482
- download(type: string): void;
483
- layout(): void;
484
- }
485
- export class TabulatorRow extends TableRow {
486
- protected table: Table;
487
- protected extensionsContainer: HTMLElement;
488
- protected detailsContainer: HTMLElement;
489
- protected innerRow: any;
490
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement, innerRow: any);
491
- getElement(): HTMLElement;
492
- getRowData(): HTMLElement;
493
- getDataPosition(): number;
494
- remove(): void;
495
- }
496
- export {};
497
-
498
- export class WordCloudAdapter {
499
- constructor(model: WordCloud);
500
- get wordcloud(): any;
501
- create(node: HTMLElement): any;
502
- destroy(node: HTMLElement): void;
503
- }
504
- export class WordCloud extends VisualizerBase {
505
- constructor(question: Question, data: Array<{
506
- [index: string]: any;
507
- }>, options?: Object, name?: string);
508
- getData(): (string | number)[][];
509
- protected destroyContent(container: HTMLElement): void;
510
- protected renderContent(container: HTMLElement): void;
511
- destroy(): void;
512
- }
513
-
514
- export var textHelper: {
515
- getStopWords: (locale?: string) => string[];
516
- };
517
-
518
- import "./text.scss";
519
- export class TextTableAdapter {
520
- constructor(model: Text);
521
- create(container: HTMLElement): void;
522
- destroy(node: HTMLElement): void;
523
- }
524
- export class Text extends VisualizerBase {
525
- constructor(question: Question, data: Array<{
526
- [index: string]: any;
527
- }>, options?: Object, name?: string);
528
- getData(): {
529
- columnsCount: number;
530
- data: string[][];
531
- };
532
- protected destroyContent(container: HTMLElement): void;
533
- protected renderContent(container: HTMLElement): void;
534
- destroy(): void;
535
- }
536
-
537
- export enum ElementVisibility {
538
- Visible = 0,
539
- Invisible = 1,
540
- PublicInvisible = 2
541
- }
542
- export interface IVisualizerPanelElement {
543
- name: string;
544
- displayName: string;
545
- visibility: ElementVisibility;
546
- type?: string;
547
- }
548
- export interface IState {
549
- locale: string;
550
- elements: IVisualizerPanelElement[];
551
- }
552
- export interface IPermission {
553
- name: string;
554
- visibility: ElementVisibility;
555
- }
556
-
557
- export class LayoutEngine {
558
- protected _allowed: boolean;
559
- constructor(_allowed: boolean);
560
- protected startCore(container: HTMLElement): void;
561
- protected stopCore(): void;
562
- protected updateCore(): void;
563
- get allowed(): boolean;
564
- start(container: HTMLElement): void;
565
- stop(): void;
566
- update(): void;
567
- add(elements: Array<HTMLElement>, options?: any): void;
568
- remove(elements: Array<HTMLElement>, options?: any): void;
569
- onMoveCallback: (fromIndex: number, toIndex: number) => void;
570
- destroy(): void;
571
- }
572
- export class MuuriLayoutEngine extends LayoutEngine {
573
- constructor(allowed: boolean, _selector: string);
574
- protected startCore(container: HTMLElement): void;
575
- protected stopCore(): void;
576
- protected updateCore(): void;
577
- add(elements: Array<HTMLElement>, options?: any): void;
578
- remove(elements: Array<HTMLElement>, options?: any): void;
579
- }
580
-
581
- export abstract class Table {
582
- protected survey: SurveyModel;
583
- protected data: Array<Object>;
584
- protected options: any;
585
- protected _columns: Array<any>;
586
- isTrustedAccess: boolean;
587
- protected tableData: any;
588
- protected extensions: TableExtensions;
589
- constructor(survey: SurveyModel, data: Array<Object>, options: any, _columns: Array<any>, isTrustedAccess: boolean);
590
- protected renderResult: HTMLElement;
591
- protected currentPageSize: number;
592
- protected currentPageNumber: number;
593
- protected _rows: TableRow[];
594
- protected isColumnReorderEnabled: boolean;
595
- onColumnsVisibilityChanged: Event<(sender: Table, options: any) => any, any>;
596
- onColumnsLocationChanged: Event<(sender: Table, options: any) => any, any>;
597
- onRowRemoved: Event<(sender: Table, options: any) => any, any>;
598
- renderDetailActions: (container: HTMLElement, row: TableRow) => HTMLElement;
599
- getData(): Object[];
600
- abstract render(targetNode: HTMLElement): void;
601
- abstract applyFilter(value: string): void;
602
- abstract applyColumnFilter(columnName: string, value: string): void;
603
- abstract sortByColumn(columnName: string, direction: string): void;
604
- enableColumnReorder(): void;
605
- disableColumnReorder(): void;
606
- getPageNumber(): number;
607
- setPageNumber(value: number): void;
608
- getPageSize(): number;
609
- setPageSize(value: number): void;
610
- getCreatedRows(): TableRow[];
611
- clearCreatedRows(): void;
612
- protected buildColumns: (survey: SurveyModel) => {
613
- name: string;
614
- displayName: string;
615
- dataType: ColumnDataType;
616
- visibility: ColumnVisibility;
617
- location: QuestionLocation;
618
- }[];
619
- isColumnVisible(column: any): boolean;
620
- isVisible: (visibility: ColumnVisibility) => boolean;
621
- isAvailable: (visibility: ColumnVisibility) => boolean;
622
- getAvailableColumns: () => Array<ITableColumn>;
623
- get columns(): Array<ITableColumn>;
624
- set columns(columns: Array<ITableColumn>);
625
- protected initTableData(data: Array<any>): void;
626
- moveColumn(from: number, to: number): void;
627
- setColumnLocation(columnName: string, location: QuestionLocation): void;
628
- setColumnVisibility(columnName: string, visibility: ColumnVisibility): void;
629
- getColumnVisibility(columnName: string): ColumnVisibility;
630
- removeRow(row: TableRow): void;
631
- /**
632
- * Returns current locale of the table.
633
- * If locales more than one, the language selection dropdown will be added in the toolbar
634
- */
635
- get locale(): string;
636
- /**
637
- * Sets locale for table.
638
- */
639
- set locale(newLocale: string);
640
- getLocales(): Array<string>;
641
- refresh(hard?: boolean): void;
642
- destroy(): void;
643
- get isRendered(): boolean;
644
- /**
645
- * Vizualization panel state getter.
646
- */
647
- get state(): ITableState;
648
- /**
649
- * Vizualization panel state setter.
650
- */
651
- set state(newState: ITableState);
652
- /**
653
- * Fires when table state changed.
654
- */
655
- onStateChanged: Event<(sender: Table, options: any) => any, any>;
656
- /**
657
- * Gets table permissions.
658
- */
659
- get permissions(): IPermission[];
660
- /**
661
- * Sets table permissions.
662
- */
663
- set permissions(permissions: IPermission[]);
664
- /**
665
- * Fires when permissions changed
666
- */
667
- onPermissionsChangedCallback: any;
668
- }
669
- export abstract class TableRow {
670
- protected table: Table;
671
- protected extensionsContainer: HTMLElement;
672
- protected detailsContainer: HTMLElement;
673
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement);
674
- details: Details;
675
- extensions: TableExtensions;
676
- onToggleDetails: Event<(sender: TableRow, options: any) => any, any>;
677
- /**
678
- * Returns row's html element
679
- */
680
- abstract getElement(): HTMLElement;
681
- /**
682
- * Returns data, which is displayed in the row.
683
- */
684
- abstract getRowData(): any;
685
- /**
686
- * Returns position of row in the table's data.
687
- */
688
- abstract getDataPosition(): number;
689
- protected isSelected: boolean;
690
- render(): void;
691
- openDetails(): void;
692
- closeDetails(): void;
693
- toggleDetails(): void;
694
- getIsSelected(): boolean;
695
- toggleSelect(): void;
696
- remove(): void;
697
- destroy(): void;
698
- }
699
-
700
- export enum ColumnVisibility {
701
- Visible = 0,
702
- Invisible = 1,
703
- PublicInvisible = 2
704
- }
705
- export enum QuestionLocation {
706
- Column = 0,
707
- Row = 1
708
- }
709
- export enum ColumnDataType {
710
- Text = 0,
711
- FileLink = 1,
712
- Image = 2
713
- }
714
- export interface ITableColumn {
715
- name: string;
716
- displayName: string;
717
- dataType: ColumnDataType;
718
- visibility: ColumnVisibility;
719
- location: QuestionLocation;
720
- }
721
- export interface ITableState {
722
- locale: string;
723
- elements: ITableColumn[];
724
- }
725
-
726
- export class PlotlyChartAdapter {
727
- protected model: SelectBase;
728
- constructor(model: SelectBase);
729
- protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
730
- get chart(): Promise<import("plotly.js").PlotlyHTMLElement>;
731
- create(chartNode: HTMLElement): any;
732
- destroy(node: HTMLElement): void;
733
- }
734
- export interface PlotlyOptions {
735
- traces: Array<any>;
736
- layout: any;
737
- hasSeries: boolean;
738
- }
739
- export class PlotlySetup {
740
- static setups: {
741
- [type: string]: (model: SelectBase) => PlotlyOptions;
742
- };
743
- static setup(charType: string, model: SelectBase): PlotlyOptions;
744
- static setupPie(model: SelectBase): PlotlyOptions;
745
- static setupBar(model: SelectBase): PlotlyOptions;
746
- static setupScatter(model: SelectBase): PlotlyOptions;
747
- }
748
- export class SelectBasePlotly extends SelectBase {
749
- static types: string[];
750
- static displayModeBar: any;
751
- constructor(question: Question, data: Array<{
752
- [index: string]: any;
753
- }>, options?: Object);
754
- protected destroyContent(container: HTMLElement): void;
755
- protected renderContent(container: HTMLElement): void;
756
- getData(): any[];
757
- }
758
-
759
- export class PlotlyGaugeAdapter {
760
- constructor(model: GaugePlotly);
761
- get chart(): Promise<import("plotly.js").PlotlyHTMLElement>;
762
- create(chartNode: HTMLElement): any;
763
- destroy(node: HTMLElement): void;
764
- }
765
- export class GaugePlotly extends NumberModel {
766
- static types: string[];
767
- constructor(question: Question, data: Array<{
768
- [index: string]: any;
769
- }>, options?: Object);
770
- protected destroyContent(container: HTMLElement): void;
771
- protected renderContent(container: HTMLElement): void;
772
- }
773
-
774
- export class MatrixPlotly extends Matrix {
775
- static types: string[];
776
- constructor(question: Question, data: Array<{
777
- [index: string]: any;
778
- }>, options?: Object);
779
- protected destroyContent(container: HTMLElement): void;
780
- protected renderContent(container: HTMLElement): void;
781
- }
782
-
783
- export class PlotlyBoolChartAdapter extends PlotlyChartAdapter {
784
- constructor(model: BooleanPlotly);
785
- protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
786
- }
787
- export class BooleanPlotly extends BooleanModel {
788
- static types: string[];
789
- constructor(question: Question, data: Array<{
790
- [index: string]: any;
791
- }>, options?: Object);
792
- protected destroyContent(container: HTMLElement): void;
793
- protected renderContent(container: HTMLElement): void;
794
- }
795
-
796
- export class Details {
797
- protected table: Table;
798
- protected targetNode: HTMLElement;
799
- constructor(table: Table, row: TableRow, targetNode: HTMLElement);
800
- protected location: string;
801
- open(): void;
802
- protected createShowAsColumnButton: (columnName: string) => HTMLElement;
803
- close(): void;
804
- }
805
-
806
- interface ITableExtension {
807
- location: string;
808
- name: string;
809
- visibleIndex: number;
810
- render: (table: Table, opt: any) => HTMLElement;
811
- destroy?: () => void;
812
- }
813
- export class TableExtensions {
814
- constructor(table: Table);
815
- render(targetNode: HTMLElement, location: string, options?: any): void;
816
- destroy(): void;
817
- static registerExtension(extension: ITableExtension): void;
818
- static findExtension(location: string, actionName: string): ITableExtension;
819
- }
820
- export {};
821
-
822
- export class SelectBase extends VisualizerBase {
823
- orderByAnsweres: string;
824
- constructor(question: Question, data: Array<{
825
- [index: string]: any;
826
- }>, options?: Object, name?: string);
827
- protected chartTypes: string[];
828
- chartType: string;
829
- protected onChartTypeChanged(): void;
830
- protected setChartType(chartType: string): void;
831
- getSelectedItemByText(itemText: string): any;
832
- setSelection(item: ItemValue): void;
833
- get selection(): ItemValue;
834
- get showPercentages(): boolean;
835
- set showPercentages(val: boolean);
836
- setLabelsOrder(value: string): void;
837
- refreshContent(): void;
838
- onDataItemSelected: (selectedValue: any, selectedText: string) => void;
839
- valuesSource(): Array<ItemValue>;
840
- getValues(): Array<any>;
841
- getLabels(): Array<string>;
842
- getPercentages(): Array<Array<number>>;
843
- }
844
-
845
- export class NumberModel extends VisualizerBase {
846
- static stepsCount: number;
847
- static generateTextsCallback: (question: Question, maxValue: number, minValue: number, stepsCount: number, texts: string[]) => string[];
848
- protected chartTypes: Array<string>;
849
- chartType: String;
850
- static showAsPercentage: boolean;
851
- constructor(question: Question, data: Array<{
852
- [index: string]: any;
853
- }>, options?: {
854
- [index: string]: any;
855
- }, name?: string);
856
- protected onDataChanged(): void;
857
- protected onChartTypeChanged(): void;
858
- protected setChartType(chartType: string): void;
859
- destroy(): void;
860
- generateText(maxValue: number, minValue: number, stepsCount: number): any;
861
- generateValues(maxValue: number, stepsCount: number): number[];
862
- generateColors(maxValue: number, minValue: number, stepsCount: number): any[];
863
- getData(): number[];
864
- }
865
-
866
- export class Matrix extends SelectBase {
867
- constructor(question: Question, data: Array<{
868
- [index: string]: any;
869
- }>, options?: Object, name?: string);
870
- protected get matrixQuestion(): QuestionMatrixModel;
871
- getSeriesValues(): Array<string>;
872
- getSeriesLabels(): Array<string>;
873
- getSelectedItemByText(itemText: string): any;
874
- valuesSource(): Array<ItemValue>;
875
- getData(): any[];
876
- }
877
-
878
- export class BooleanModel extends SelectBase {
879
- protected chartTypes: string[];
880
- chartType: string;
881
- constructor(question: Question, data: Array<{
882
- [index: string]: any;
883
- }>, options?: Object);
884
- get booleanQuestion(): QuestionBooleanModel;
885
- static trueColor: string;
886
- static falseColor: string;
887
- getSelectedItemByText(itemText: string): ItemValue;
888
- getValues(): Array<any>;
889
- getLabels(): Array<string>;
890
- }
891
-