survey-creator-core 1.11.6 → 1.11.7
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/fonts.fontless.css +1 -1
- package/fonts.fontless.min.css +1 -1
- package/i18n/arabic.js +1 -1
- package/i18n/arabic.min.js +1 -1
- package/i18n/bulgarian.js +1 -1
- package/i18n/bulgarian.min.js +1 -1
- package/i18n/croatian.js +1 -1
- package/i18n/croatian.min.js +1 -1
- package/i18n/czech.js +1 -1
- package/i18n/czech.min.js +1 -1
- package/i18n/danish.js +1 -1
- package/i18n/danish.min.js +1 -1
- package/i18n/dutch.js +1 -1
- package/i18n/dutch.min.js +1 -1
- package/i18n/english.js +7 -3
- package/i18n/english.js.map +1 -1
- package/i18n/english.min.js +2 -2
- package/i18n/finnish.js +1 -1
- package/i18n/finnish.min.js +1 -1
- package/i18n/french.js +1 -1
- package/i18n/french.min.js +1 -1
- package/i18n/german.js +1 -1
- package/i18n/german.min.js +1 -1
- package/i18n/hebrew.js +1 -1
- package/i18n/hebrew.min.js +1 -1
- package/i18n/hungarian.js +1 -1
- package/i18n/hungarian.min.js +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.min.js +1 -1
- package/i18n/indonesian.js +1 -1
- package/i18n/indonesian.min.js +1 -1
- package/i18n/italian.js +1 -1
- package/i18n/italian.min.js +1 -1
- package/i18n/japanese.js +1 -1
- package/i18n/japanese.min.js +1 -1
- package/i18n/korean.js +1 -1
- package/i18n/korean.min.js +1 -1
- package/i18n/malay.js +1 -1
- package/i18n/malay.min.js +1 -1
- package/i18n/mongolian.js +1 -1
- package/i18n/mongolian.min.js +1 -1
- package/i18n/norwegian.js +1 -1
- package/i18n/norwegian.min.js +1 -1
- package/i18n/persian.js +1 -1
- package/i18n/persian.min.js +1 -1
- package/i18n/polish.js +1 -1
- package/i18n/polish.min.js +1 -1
- package/i18n/portuguese.js +1 -1
- package/i18n/portuguese.min.js +1 -1
- package/i18n/russian.js +1 -1
- package/i18n/russian.min.js +1 -1
- package/i18n/simplified-chinese.js +1 -1
- package/i18n/simplified-chinese.min.js +1 -1
- package/i18n/slovak.js +1 -1
- package/i18n/slovak.min.js +1 -1
- package/i18n/spanish.js +1 -1
- package/i18n/spanish.min.js +1 -1
- package/i18n/swedish.js +1 -1
- package/i18n/swedish.min.js +1 -1
- package/i18n/tajik.js +1 -1
- package/i18n/tajik.min.js +1 -1
- package/i18n/traditional-chinese.js +1 -1
- package/i18n/traditional-chinese.min.js +1 -1
- package/i18n/turkish.js +1 -1
- package/i18n/turkish.min.js +1 -1
- package/package.json +2 -2
- package/survey-creator-core.css +8 -8
- package/survey-creator-core.fontless.css +7 -7
- package/survey-creator-core.fontless.css.map +1 -1
- package/survey-creator-core.fontless.min.css +3 -3
- package/survey-creator-core.i18n.js +1 -1
- package/survey-creator-core.i18n.min.js +1 -1
- package/survey-creator-core.js +220 -107
- package/survey-creator-core.js.map +1 -1
- package/survey-creator-core.min.css +4 -4
- package/survey-creator-core.min.js +5 -5
- package/typings/components/tabs/theme-plugin.d.ts +2 -0
- package/typings/creator-base.d.ts +15 -5
- package/typings/creator-events-api.d.ts +17 -20
- package/typings/editorLocalization.d.ts +4 -0
- package/typings/localization/english.d.ts +4 -0
- package/typings/property-grid/index.d.ts +6 -0
- package/typings/questionconverter.d.ts +2 -1
- package/typings/toolbox.d.ts +127 -87
|
@@ -20,6 +20,8 @@ import { ThemeModel } from "./theme-model";
|
|
|
20
20
|
* const creator = new SurveyCreatorModel(creatorOptions);
|
|
21
21
|
* creator.themeEditor.settingName = "value";
|
|
22
22
|
* ```
|
|
23
|
+
*
|
|
24
|
+
* [Theme Editor Documentation](https://surveyjs.io/survey-creator/documentation/theme-editor (linkStyle))
|
|
23
25
|
*/
|
|
24
26
|
export declare class ThemeTabPlugin implements ICreatorPlugin {
|
|
25
27
|
private creator;
|
|
@@ -14,7 +14,7 @@ import { ICreatorOptions } from "./creator-options";
|
|
|
14
14
|
import { ThemeTabPlugin } from "./components/tabs/theme-plugin";
|
|
15
15
|
import { DragDropSurveyElements } from "./survey-elements";
|
|
16
16
|
import { PageAdorner } from "./components/page";
|
|
17
|
-
import { ElementDeletingEvent, PropertyGetReadOnlyEvent, ElementGetDisplayNameEvent, HtmlToMarkdownEvent, ElementAllowOperationsEvent, ElementGetActionsEvent, PropertyAddingEvent, PropertyGridSurveyCreatedEvent, PropertyEditorCreatedEvent, PropertyEditorUpdateTitleActionsEvent, PropertyGridShowPopupEvent, CollectionItemAllowOperationsEvent, CollectionItemAddedEvent, FastEntryItemsEvent as FastEntryFinishedEvent, MatrixColumnAddedEvent, ConfigureTablePropertyEditorEvent, PropertyDisplayCustomErrorEvent, PropertyValueChangingEvent, PropertyValueChangedEvent, ConditionGetQuestionListEvent, GetConditionOperatorEvent, LogicRuleGetDisplayTextEvent, ModifiedEvent, QuestionAddedEvent, PanelAddedEvent, PageAddedEvent, PageGetFooterActionsEvent, SurveyInstanceCreatedEvent, DesignerSurveyCreatedEvent, PreviewSurveyCreatedEvent, NotifyEvent, ElementFocusingEvent, ElementFocusedEvent, OpenFileChooserEvent, UploadFileEvent, TranslationStringVisibilityEvent, TranslationImportItemEvent, TranslationImportedEvent, TranslationExportItemEvent, MachineTranslateEvent, TranslationItemChangingEvent, DragDropAllowEvent, CreateCustomMessagePanelEvent, ActiveTabChangingEvent, ActiveTabChangedEvent, BeforeUndoEvent, BeforeRedoEvent, PageAddingEvent, DragStartEndEvent } from "./creator-events-api";
|
|
17
|
+
import { ElementDeletingEvent, PropertyGetReadOnlyEvent, ElementGetDisplayNameEvent, HtmlToMarkdownEvent, ElementAllowOperationsEvent, ElementGetActionsEvent, PropertyAddingEvent, PropertyGridSurveyCreatedEvent, PropertyEditorCreatedEvent, PropertyEditorUpdateTitleActionsEvent, PropertyGridShowPopupEvent, CollectionItemAllowOperationsEvent, CollectionItemAddedEvent, FastEntryItemsEvent as FastEntryFinishedEvent, MatrixColumnAddedEvent, ConfigureTablePropertyEditorEvent, PropertyDisplayCustomErrorEvent, PropertyValueChangingEvent, PropertyValueChangedEvent, ConditionGetQuestionListEvent, GetConditionOperatorEvent, LogicRuleGetDisplayTextEvent, ModifiedEvent, QuestionAddedEvent, PanelAddedEvent, PageAddedEvent, QuestionConvertingEvent, PageGetFooterActionsEvent, SurveyInstanceCreatedEvent, DesignerSurveyCreatedEvent, PreviewSurveyCreatedEvent, NotifyEvent, ElementFocusingEvent, ElementFocusedEvent, OpenFileChooserEvent, UploadFileEvent, TranslationStringVisibilityEvent, TranslationImportItemEvent, TranslationImportedEvent, TranslationExportItemEvent, MachineTranslateEvent, TranslationItemChangingEvent, DragDropAllowEvent, CreateCustomMessagePanelEvent, ActiveTabChangingEvent, ActiveTabChangedEvent, BeforeUndoEvent, BeforeRedoEvent, PageAddingEvent, DragStartEndEvent } from "./creator-events-api";
|
|
18
18
|
export interface IKeyboardShortcut {
|
|
19
19
|
name?: string;
|
|
20
20
|
affectedTab?: string;
|
|
@@ -146,7 +146,7 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
|
|
|
146
146
|
*
|
|
147
147
|
* Default value: `false`
|
|
148
148
|
*
|
|
149
|
-
* If you enable this property, Survey Creator calls the [`saveSurveyFunc`](#saveSurveyFunc) or [`saveThemeFunc`](#saveThemeFunc) function to save the survey or theme JSON schema. The schemas are saved with a 500-millisecond delay after users change settings. You can specify the [`autoSaveDelay`](#autoSaveDelay) property to increase or
|
|
149
|
+
* If you enable this property, Survey Creator calls the [`saveSurveyFunc`](#saveSurveyFunc) or [`saveThemeFunc`](#saveThemeFunc) function to save the survey or theme JSON schema. The schemas are saved with a 500-millisecond delay after users change settings. You can specify the [`autoSaveDelay`](#autoSaveDelay) property to increase or decrease the delay.
|
|
150
150
|
*/
|
|
151
151
|
isAutoSave: boolean;
|
|
152
152
|
showOptions: boolean;
|
|
@@ -403,6 +403,10 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
|
|
|
403
403
|
* [Customize Survey Elements on Creation](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#customize-survey-elements-on-creation (linkStyle))
|
|
404
404
|
*/
|
|
405
405
|
onPageAdded: EventBase<SurveyCreatorModel, PageAddedEvent>;
|
|
406
|
+
/**
|
|
407
|
+
* An event that is raised when a [question's type is being changed](https://surveyjs.io/survey-creator/documentation/end-user-guide/user-interface#how-to-change-the-question-type).
|
|
408
|
+
*/
|
|
409
|
+
onQuestionConverting: EventBase<SurveyCreatorModel, QuestionConvertingEvent>;
|
|
406
410
|
/**
|
|
407
411
|
* An event that is raised when Survey Creator renders action buttons under each page on the design surface. Use this event to add, remove, or modify the buttons.
|
|
408
412
|
* @see onDefineElementMenuItems
|
|
@@ -847,6 +851,11 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
|
|
|
847
851
|
private canSwitchViewType;
|
|
848
852
|
private activatePlugin;
|
|
849
853
|
private get currentPlugin();
|
|
854
|
+
/**
|
|
855
|
+
* Provides access to the [Toolbox API](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox).
|
|
856
|
+
*
|
|
857
|
+
* [Toolbox Customization](https://surveyjs.io/survey-creator/documentation/toolbox-customization (linkStyle))
|
|
858
|
+
*/
|
|
850
859
|
toolbox: QuestionToolbox;
|
|
851
860
|
get toolboxCategories(): Array<any>;
|
|
852
861
|
sidebar: SidebarModel;
|
|
@@ -1013,6 +1022,7 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
|
|
|
1013
1022
|
private getDefaultSurveyJson;
|
|
1014
1023
|
protected setSurvey(survey: SurveyModel): void;
|
|
1015
1024
|
private getSurveyTextFromDesigner;
|
|
1025
|
+
private moveElementsToTheEnd;
|
|
1016
1026
|
protected setTextValue(value: string): void;
|
|
1017
1027
|
changeText(value: string, clearState?: boolean): void;
|
|
1018
1028
|
/**
|
|
@@ -1093,12 +1103,12 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
|
|
|
1093
1103
|
createNewElement(json: any): IElement;
|
|
1094
1104
|
copyElement(element: Base): IElement;
|
|
1095
1105
|
/**
|
|
1096
|
-
* Creates a copy of a specified question, inserts the copy next to this question and optionally
|
|
1106
|
+
* Creates a copy of a specified question, inserts the copy next to this question, and (optionally) selects it on the design surface.
|
|
1097
1107
|
* @param question A question to copy.
|
|
1098
|
-
* @param
|
|
1108
|
+
* @param selectCopy *(Optional)* Pass `true` if you want to select the copy on the design surface. Default value: `false`.
|
|
1099
1109
|
* @returns The instance of a new question.
|
|
1100
1110
|
*/
|
|
1101
|
-
fastCopyQuestion(question: Base,
|
|
1111
|
+
fastCopyQuestion(question: Base, selectCopy?: boolean): IElement;
|
|
1102
1112
|
/**
|
|
1103
1113
|
* Gets or sets the focused survey element: a question, panel, page, or the survey itself.
|
|
1104
1114
|
* @see onSelectedElementChanging
|
|
@@ -423,29 +423,21 @@ export interface LogicRuleGetDisplayTextEvent {
|
|
|
423
423
|
}
|
|
424
424
|
export interface ModifiedEvent {
|
|
425
425
|
/**
|
|
426
|
-
* A value that indicates the modification: `"ADDED_FROM_TOOLBOX"`,
|
|
426
|
+
* A value that indicates the modification: `"ADDED_FROM_TOOLBOX"`, "ADDED_FROM_PAGEBUTTON", `"PAGE_ADDED"`, `"QUESTION_CONVERTED"`, `"ELEMENT_COPIED"`, `"PROPERTY_CHANGED"`, `"ELEMENT_REORDERED"`, `"OBJECT_DELETED"`, `"JSON_EDITOR"`
|
|
427
427
|
*
|
|
428
428
|
* Depending on the `options.type` value, the `options` object contains parameters listed below:
|
|
429
429
|
*
|
|
430
|
-
* `options.type`: `"ADDED_FROM_TOOLBOX"`
|
|
431
|
-
* - `options.question` - An added
|
|
430
|
+
* `options.type`: `"ADDED_FROM_TOOLBOX"` | `"ADDED_FROM_PAGEBUTTON"` | `"ELEMENT_COPIED"`
|
|
431
|
+
* - `options.question` - An added or copied survey element.
|
|
432
432
|
*
|
|
433
433
|
* `options.type`: `"PAGE_ADDED"`
|
|
434
434
|
* - `options.newValue` - An added page.
|
|
435
435
|
*
|
|
436
|
-
* `options.type`: `"PAGE_MOVED"`
|
|
437
|
-
* - `options.page` - A moved page.
|
|
438
|
-
* - `options.indexFrom` - A previous index.
|
|
439
|
-
* - `options.indexTo` - A current index.
|
|
440
|
-
*
|
|
441
436
|
* `options.type`: `"QUESTION_CONVERTED"`
|
|
442
437
|
* - `options.className` - The name of a class to which a question has been converted.
|
|
443
438
|
* - `options.oldValue` - An object of a previous class.
|
|
444
439
|
* - `options.newValue` - An object of a class specified by `options.className`.
|
|
445
440
|
*
|
|
446
|
-
* `options.type`: `"QUESTION_CHANGED_BY_EDITOR"`
|
|
447
|
-
* - `options.question` - A question that has been edited in a pop-up editor.
|
|
448
|
-
*
|
|
449
441
|
* `options.type`: `"PROPERTY_CHANGED"`
|
|
450
442
|
* - `options.name` - The name of the changed property.
|
|
451
443
|
* - `options.target` - An object that contains the changed property.
|
|
@@ -461,15 +453,6 @@ export interface ModifiedEvent {
|
|
|
461
453
|
*
|
|
462
454
|
* `options.type`: `"OBJECT_DELETED"`
|
|
463
455
|
* - `options.target` - A deleted object.
|
|
464
|
-
*
|
|
465
|
-
* `options.type`: `"VIEW_TYPE_CHANGED"`
|
|
466
|
-
* - `options.newType` - A current view: `"editor"` or `"designer"`.
|
|
467
|
-
*
|
|
468
|
-
* `options.type`: `"DO_DROP"`
|
|
469
|
-
* - `options.page` - A parent page of the dragged element.
|
|
470
|
-
* - `options.source` - A dragged element.
|
|
471
|
-
* - `options.target` - A drop target.
|
|
472
|
-
* - `options.newElement` - A new element. This parameter is defined only if users drag a question or panel from the Toolbox.
|
|
473
456
|
*/
|
|
474
457
|
type: string;
|
|
475
458
|
question?: Question;
|
|
@@ -522,6 +505,20 @@ export interface PageAddedEvent {
|
|
|
522
505
|
*/
|
|
523
506
|
page: PageModel;
|
|
524
507
|
}
|
|
508
|
+
export interface QuestionConvertingEvent {
|
|
509
|
+
/**
|
|
510
|
+
* A question of the previous type.
|
|
511
|
+
*/
|
|
512
|
+
sourceQuestion: Question;
|
|
513
|
+
/**
|
|
514
|
+
* A target [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
515
|
+
*/
|
|
516
|
+
targetType: string;
|
|
517
|
+
/**
|
|
518
|
+
* A JSON object produced by the previous question. You can modify this object to decide which properties should be copied to a new question. Set this parameter to `undefined` if you want to create the new question with a default JSON object.
|
|
519
|
+
*/
|
|
520
|
+
json: any;
|
|
521
|
+
}
|
|
525
522
|
export interface PageGetFooterActionsEvent {
|
|
526
523
|
/**
|
|
527
524
|
* An array of actions. You can add, modify, or remove actions from this array.
|
|
@@ -448,6 +448,9 @@ export declare var defaultStrings: {
|
|
|
448
448
|
rateDescriptionLocation: string;
|
|
449
449
|
size: string;
|
|
450
450
|
cellErrorLocation: string;
|
|
451
|
+
enabled: string;
|
|
452
|
+
disabled: string;
|
|
453
|
+
inherit: string;
|
|
451
454
|
apply: string;
|
|
452
455
|
ok: string;
|
|
453
456
|
save: string;
|
|
@@ -1469,6 +1472,7 @@ export declare var defaultStrings: {
|
|
|
1469
1472
|
filePlaceholder: string;
|
|
1470
1473
|
photoPlaceholder: string;
|
|
1471
1474
|
fileOrPhotoPlaceholder: string;
|
|
1475
|
+
colCount: string;
|
|
1472
1476
|
masksettings: {
|
|
1473
1477
|
saveMaskedValue: string;
|
|
1474
1478
|
};
|
|
@@ -406,6 +406,9 @@ export declare var enStrings: {
|
|
|
406
406
|
rateDescriptionLocation: string;
|
|
407
407
|
size: string;
|
|
408
408
|
cellErrorLocation: string;
|
|
409
|
+
enabled: string;
|
|
410
|
+
disabled: string;
|
|
411
|
+
inherit: string;
|
|
409
412
|
apply: string;
|
|
410
413
|
ok: string;
|
|
411
414
|
save: string;
|
|
@@ -1427,6 +1430,7 @@ export declare var enStrings: {
|
|
|
1427
1430
|
filePlaceholder: string;
|
|
1428
1431
|
photoPlaceholder: string;
|
|
1429
1432
|
fileOrPhotoPlaceholder: string;
|
|
1433
|
+
colCount: string;
|
|
1430
1434
|
masksettings: {
|
|
1431
1435
|
saveMaskedValue: string;
|
|
1432
1436
|
};
|
|
@@ -177,6 +177,12 @@ export declare class PropertyGridEditorBoolean extends PropertyGridEditor {
|
|
|
177
177
|
getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
|
|
178
178
|
isSupportGrouping(): boolean;
|
|
179
179
|
}
|
|
180
|
+
export declare class PropertyGridEditorUndefinedBoolean extends PropertyGridEditor {
|
|
181
|
+
fit(prop: JsonObjectProperty, context?: string): boolean;
|
|
182
|
+
getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
|
|
183
|
+
onCreated(obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions, propGridDefinition?: ISurveyPropertyGridDefinition): void;
|
|
184
|
+
onSetup(obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions): void;
|
|
185
|
+
}
|
|
180
186
|
export declare abstract class PropertyGridEditorStringBase extends PropertyGridEditor {
|
|
181
187
|
protected updateMaxLength(prop: JsonObjectProperty, json: any): any;
|
|
182
188
|
protected updateType(prop: JsonObjectProperty, obj: Base, json: any): any;
|
|
@@ -6,7 +6,8 @@ export declare class QuestionConverter {
|
|
|
6
6
|
static addConvertInfo(className: string, convertToClassName: string): void;
|
|
7
7
|
private static getConvertableClasses;
|
|
8
8
|
static getConvertToClasses(className: string, availableTypes?: Array<string>, includeCurrent?: boolean): Array<string>;
|
|
9
|
-
static
|
|
9
|
+
static getObjJSON(obj: Question, defaultObjJSON: any): any;
|
|
10
|
+
static convertObject(obj: Question, convertToClass: string, objJSON: any, defaultJSON?: any): Question;
|
|
10
11
|
private static updateJSON;
|
|
11
12
|
private static updateJSONForMatrices;
|
|
12
13
|
private static getColumnName;
|
package/typings/toolbox.d.ts
CHANGED
|
@@ -3,38 +3,57 @@ import { SurveyCreatorModel, toolboxLocationType } from "./creator-base";
|
|
|
3
3
|
import { SearchManagerToolbox } from "./property-grid/search-manager";
|
|
4
4
|
export declare type overflowBehaviorType = "hideInMenu" | "scroll";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* A toolbox item configuration.
|
|
7
|
+
*
|
|
8
|
+
* `IQuestionToolboxItem` objects are used in such Toolbox API methods as [`getItemByName(name)`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#getItemByName), [`addItem(name, index)`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#addItem), [`replaceItem(name)`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#replaceItem), and others.
|
|
9
|
+
*
|
|
10
|
+
* [Toolbox Customization](https://surveyjs.io/survey-creator/documentation/toolbox-customization (linkStyle))
|
|
7
11
|
*/
|
|
8
12
|
export interface IQuestionToolboxItem extends IAction {
|
|
9
13
|
/**
|
|
10
|
-
* A
|
|
14
|
+
* A toolbox item identifier.
|
|
15
|
+
*
|
|
16
|
+
* > Toolbox item names must be unique.
|
|
11
17
|
*/
|
|
12
18
|
name: string;
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
20
|
+
* An icon name.
|
|
21
|
+
*
|
|
22
|
+
* [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
|
|
15
23
|
*/
|
|
16
24
|
iconName: string;
|
|
17
25
|
/**
|
|
18
|
-
*
|
|
26
|
+
* A JSON object used to create a new question or panel when users click this toolbox item. It must contain the `type` property.
|
|
27
|
+
*
|
|
28
|
+
* [View Toolbox Customization Demo](https://surveyjs.io/survey-creator/examples/survey-toolbox-customization/ (linkStyle))
|
|
19
29
|
*/
|
|
20
30
|
json: any;
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
32
|
+
* A user-friendly toolbox item title.
|
|
23
33
|
*/
|
|
24
34
|
title: string;
|
|
25
35
|
className: string;
|
|
26
36
|
/**
|
|
27
|
-
*
|
|
37
|
+
* A toolbox item tooltip.
|
|
38
|
+
*
|
|
39
|
+
* If `tooltip` is undefined, the [`title`](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem#title) property value is used instead.
|
|
28
40
|
*/
|
|
29
41
|
tooltip?: string;
|
|
30
|
-
/**
|
|
31
|
-
* True, if an end user added this item into Toolbox from the survey.
|
|
32
|
-
*/
|
|
33
42
|
isCopied: boolean;
|
|
34
43
|
/**
|
|
35
|
-
*
|
|
44
|
+
* A category to which this toolbox item belongs.
|
|
45
|
+
*
|
|
46
|
+
* Out-of-the-box categories include `"general"`, `"choice"`, `"text"`, `"containers"`, `"matrix"`, and `"misc"`.
|
|
47
|
+
*
|
|
48
|
+
* Default value: `"general"`
|
|
36
49
|
*/
|
|
37
50
|
category: string;
|
|
51
|
+
/**
|
|
52
|
+
* Specifies whether users can interact with the toolbox item.
|
|
53
|
+
*
|
|
54
|
+
* Default value: `true`
|
|
55
|
+
*/
|
|
56
|
+
enabled?: boolean;
|
|
38
57
|
getArea?: (el: HTMLElement) => HTMLElement;
|
|
39
58
|
}
|
|
40
59
|
export interface IQuestionToolbox {
|
|
@@ -78,7 +97,22 @@ export declare class QuestionToolboxItem extends Action implements IQuestionTool
|
|
|
78
97
|
hasText(text: string): boolean;
|
|
79
98
|
}
|
|
80
99
|
/**
|
|
81
|
-
*
|
|
100
|
+
* An object that enables you to modify Survey Creator's Toolbox. To access this object, use the [`toolbox`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#toolbox) property on a Survey Creator instance:
|
|
101
|
+
*
|
|
102
|
+
* ```js
|
|
103
|
+
* const creatorOptions = { ... };
|
|
104
|
+
* const creator = new SurveyCreator.SurveyCreator(creatorOptions);
|
|
105
|
+
* creator.toolbox.settingName = "value";
|
|
106
|
+
*
|
|
107
|
+
* // In modular applications:
|
|
108
|
+
* import { SurveyCreatorModel } from "survey-creator-core";
|
|
109
|
+
*
|
|
110
|
+
* const creatorOptions = { ... };
|
|
111
|
+
* const creator = new SurveyCreatorModel(creatorOptions);
|
|
112
|
+
* creator.toolbox.settingName = "value";
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* [Toolbox Customization](https://surveyjs.io/survey-creator/documentation/toolbox-customization (linkStyle))
|
|
82
116
|
*/
|
|
83
117
|
export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToolboxItem> implements IQuestionToolbox {
|
|
84
118
|
private supportedQuestions;
|
|
@@ -98,14 +132,8 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
98
132
|
get containerSelector(): string;
|
|
99
133
|
static getQuestionDefaultSettings(questionType: string): any;
|
|
100
134
|
static getSubTypePropertyName(questionType: string): string;
|
|
101
|
-
/**
|
|
102
|
-
* Modify this array to change the toolbox items order.
|
|
103
|
-
*/
|
|
104
135
|
get orderedQuestions(): string[];
|
|
105
136
|
set orderedQuestions(questions: string[]);
|
|
106
|
-
/**
|
|
107
|
-
* The maximum number of copied toolbox items. If an user adding copiedItemMaxCount + 1 item, the first added item will be removed.
|
|
108
|
-
*/
|
|
109
137
|
copiedItemMaxCount: number;
|
|
110
138
|
private allowExpandMultipleCategoriesValue;
|
|
111
139
|
private keepAllCategoriesExpandedValue;
|
|
@@ -116,11 +144,14 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
116
144
|
* Contains toolbox categories and allows you to modify them.
|
|
117
145
|
*
|
|
118
146
|
* [View Demo](https://surveyjs.io/Examples/Survey-Creator?id=toolboxcategories (linkStyle))
|
|
147
|
+
* @see defineCategories
|
|
148
|
+
* @see showCategoryTitles
|
|
119
149
|
*/
|
|
120
150
|
categories: Array<QuestionToolboxCategory>;
|
|
121
151
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
152
|
+
* Gets or sets the currently expanded category. Applies only if [`allowExpandMultipleCategories`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#allowExpandMultipleCategories) and [`keepAllCategoriesExpanded`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#keepAllCategoriesExpanded) are `false` and [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) is `true`.
|
|
153
|
+
*
|
|
154
|
+
* Default value: `""`
|
|
124
155
|
* @see expandCategory
|
|
125
156
|
* @see collapseCategory
|
|
126
157
|
*/
|
|
@@ -129,27 +160,35 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
129
160
|
canCollapseCategories: boolean;
|
|
130
161
|
updateResponsiveness(isCompact: boolean, overflowBehavior: overflowBehaviorType): void;
|
|
131
162
|
/**
|
|
132
|
-
* Indicates whether the
|
|
133
|
-
* @see forceCompact
|
|
163
|
+
* Indicates whether the Toolbox is currently in [compact mode](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#forceCompact).
|
|
134
164
|
*/
|
|
135
165
|
isCompact: boolean;
|
|
136
166
|
isFocused: boolean;
|
|
137
167
|
/**
|
|
138
|
-
*
|
|
168
|
+
* Specifies how the Toolbox behaves when it contains more items than can fit on the screen.
|
|
169
|
+
*
|
|
170
|
+
* Possible values:
|
|
171
|
+
*
|
|
172
|
+
* - `"scroll"` (default) - Enables scrolling to help users reach the items that do not fit on the screen.
|
|
173
|
+
* - `"hideInMenu"` - Hides the overflow items in a three-dot menu.
|
|
139
174
|
*/
|
|
140
175
|
overflowBehavior: overflowBehaviorType;
|
|
141
176
|
/**
|
|
142
|
-
* Specifies whether the
|
|
143
|
-
*
|
|
177
|
+
* Specifies whether the Toolbox should be in compact or full mode.
|
|
178
|
+
*
|
|
179
|
+
* Possible values:
|
|
180
|
+
*
|
|
144
181
|
* - `true` - Toolbox is always in compact mode.
|
|
145
182
|
* - `false` - Toolbox is always in full mode.
|
|
146
|
-
* - `undefined` - Toolbox switches between the full and compact modes automatically based on available width.
|
|
183
|
+
* - `undefined` (default) - Toolbox switches between the full and compact modes automatically based on available width.
|
|
184
|
+
*
|
|
185
|
+
* [View Toolbox Customization Demo](https://surveyjs.io/survey-creator/examples/survey-toolbox-customization/ (linkStyle))
|
|
147
186
|
* @see isCompact
|
|
148
187
|
*/
|
|
149
188
|
forceCompact: boolean;
|
|
150
189
|
private categoriesTitles;
|
|
151
190
|
/**
|
|
152
|
-
* Specifies whether to display a search field that allows users to find question and panel types within the
|
|
191
|
+
* Specifies whether to display a search field that allows users to find question and panel types within the Toolbox.
|
|
153
192
|
*
|
|
154
193
|
* Default value: `true`
|
|
155
194
|
*/
|
|
@@ -172,89 +211,87 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
172
211
|
searchItem: IAction;
|
|
173
212
|
get classNames(): string;
|
|
174
213
|
setLocation(toolboxLocation: toolboxLocationType): void;
|
|
175
|
-
/**
|
|
176
|
-
* The Array of Toolbox items as Text JSON.
|
|
177
|
-
*/
|
|
178
214
|
get jsonText(): string;
|
|
179
215
|
set jsonText(value: string);
|
|
180
|
-
/**
|
|
181
|
-
* The Array of copied Toolbox items as Text JSON.
|
|
182
|
-
*/
|
|
183
216
|
get copiedJsonText(): string;
|
|
184
217
|
set copiedJsonText(value: string);
|
|
185
218
|
/**
|
|
186
|
-
*
|
|
219
|
+
* An array of toolbox items.
|
|
220
|
+
* @see getItemByName
|
|
221
|
+
* @see addItem
|
|
222
|
+
* @see removeItem
|
|
187
223
|
*/
|
|
188
224
|
get items(): Array<QuestionToolboxItem>;
|
|
189
225
|
get itemNames(): Array<string>;
|
|
190
|
-
/**
|
|
191
|
-
* The Array of copied Toolbox items
|
|
192
|
-
*/
|
|
193
226
|
get copiedItems(): Array<QuestionToolboxItem>;
|
|
194
|
-
/**
|
|
195
|
-
* Add toolbox items into the Toolbox
|
|
196
|
-
* @param items the list of new items
|
|
197
|
-
* @param clearAll set it to true to clear all previous items.
|
|
198
|
-
*/
|
|
199
227
|
addItems(items: Array<IQuestionToolboxItem>, clearAll?: boolean): void;
|
|
200
|
-
/**
|
|
201
|
-
* Add a copied Question into Toolbox
|
|
202
|
-
* @param question a copied Survey.Question
|
|
203
|
-
* @param options a json object that allows you to override question properties. Attributes are: name, title, tooltip, isCopied, iconName, json and category.
|
|
204
|
-
*/
|
|
205
228
|
addCopiedItem(question: Question, options?: any): void;
|
|
206
|
-
/**
|
|
207
|
-
* Add a toolbox item
|
|
208
|
-
* @param item the toolbox item description
|
|
209
|
-
* @param index the toolbox index to place the item, the item is added to the end if index not passed
|
|
210
|
-
* @see IQuestionToolboxItem
|
|
211
|
-
*/
|
|
212
229
|
private getActionByItem;
|
|
213
230
|
private addSubTypes;
|
|
231
|
+
/**
|
|
232
|
+
* Adds a new item to the Toolbox.
|
|
233
|
+
* @param item A [toolbox item configuration](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem).
|
|
234
|
+
* @param index *(Optional)* A zero-based index at which to insert the item. If you do not specify this parameter, the item is added to the end.
|
|
235
|
+
* @see removeItem
|
|
236
|
+
* @see replaceItem
|
|
237
|
+
* @see items
|
|
238
|
+
*/
|
|
214
239
|
addItem(item: IQuestionToolboxItem, index?: number): void;
|
|
215
240
|
private correctItem;
|
|
216
241
|
private get dragDropHelper();
|
|
217
242
|
/**
|
|
218
|
-
*
|
|
219
|
-
* @param item
|
|
220
|
-
* @see
|
|
243
|
+
* Adds a new toolbox item and deletes an existing item with the same name (if there is any).
|
|
244
|
+
* @param item A [toolbox item configuration](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem).
|
|
245
|
+
* @see addItem
|
|
221
246
|
*/
|
|
222
247
|
replaceItem(item: IQuestionToolboxItem): boolean;
|
|
223
248
|
/**
|
|
224
|
-
*
|
|
225
|
-
* @param name toolbox item name
|
|
226
|
-
* @
|
|
249
|
+
* Removes a [toolbox item](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem) with a specified name.
|
|
250
|
+
* @param name A toolbox item's [`name`](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem#name).
|
|
251
|
+
* @returns `true` if the item is successfully deleted or `false` otherwise.
|
|
252
|
+
* @see clearItems
|
|
253
|
+
* @see addItem
|
|
254
|
+
* @see items
|
|
227
255
|
*/
|
|
228
256
|
removeItem(name: string): boolean;
|
|
229
257
|
/**
|
|
230
|
-
*
|
|
258
|
+
* Removes all items from the Toolbox.
|
|
259
|
+
* @see removeItem
|
|
260
|
+
* @see addItem
|
|
261
|
+
* @see items
|
|
231
262
|
*/
|
|
232
263
|
clearItems(): void;
|
|
233
|
-
/**
|
|
234
|
-
* Remove all copied toolbox items.
|
|
235
|
-
*/
|
|
236
264
|
clearCopiedItems(): void;
|
|
237
265
|
/**
|
|
238
|
-
* Returns toolbox item
|
|
239
|
-
* @param name
|
|
266
|
+
* Returns a [toolbox item](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem) with a specified name.
|
|
267
|
+
* @param name A toolbox item's [`name`](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem#name).
|
|
268
|
+
* @returns A toolbox item or `null` if a toolbox item with the specified name isn't found.
|
|
240
269
|
*/
|
|
241
270
|
getItemByName(name: string): IQuestionToolboxItem;
|
|
242
271
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
272
|
+
* Specifies whether more than one category can be in the expanded state at a time. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) is `true`.
|
|
273
|
+
*
|
|
274
|
+
* If this property is `false`, the currently expanded category collapses when a user expands another category.
|
|
275
|
+
*
|
|
276
|
+
* Default value: `false`
|
|
277
|
+
* @see keepAllCategoriesExpanded
|
|
245
278
|
*/
|
|
246
279
|
get allowExpandMultipleCategories(): boolean;
|
|
247
280
|
set allowExpandMultipleCategories(val: boolean);
|
|
248
281
|
/**
|
|
249
|
-
*
|
|
282
|
+
* Specifies whether to expand all categories without the capability to collapse any of them. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) is `true`.
|
|
283
|
+
* @see allowExpandMultipleCategories
|
|
250
284
|
*/
|
|
251
285
|
get keepAllCategoriesExpanded(): boolean;
|
|
252
286
|
set keepAllCategoriesExpanded(val: boolean);
|
|
253
287
|
/**
|
|
254
288
|
* Specifies whether to display category titles in the Toolbox.
|
|
255
289
|
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
290
|
+
* Default value: `false`
|
|
291
|
+
*
|
|
292
|
+
* If this property is disabled, the Toolbox hides the titles but continues to display horizontal lines that divide categories. To remove these lines as well, call the [`removeCategories()`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#removeCategories) method.
|
|
293
|
+
* @see allowExpandMultipleCategories
|
|
294
|
+
* @see keepAllCategoriesExpanded
|
|
258
295
|
*/
|
|
259
296
|
get showCategoryTitles(): boolean;
|
|
260
297
|
set showCategoryTitles(val: boolean);
|
|
@@ -262,16 +299,18 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
262
299
|
private updateActionTitle;
|
|
263
300
|
private updateCategoriesState;
|
|
264
301
|
/**
|
|
265
|
-
*
|
|
266
|
-
* @param
|
|
267
|
-
* @param
|
|
302
|
+
* Changes the category of a toolbox item.
|
|
303
|
+
* @param itemName A toolbox item's [`name`](https://surveyjs.io/survey-creator/documentation/api-reference/iquestiontoolboxitem#name).
|
|
304
|
+
* @param categoryName A new category name. Out-of-the-box category names include `"general"`, `"choice"`, `"text"`, `"containers"`, `"matrix"`, and `"misc"`.
|
|
305
|
+
* @see defineCategories
|
|
268
306
|
*/
|
|
269
|
-
changeCategory(
|
|
307
|
+
changeCategory(itemName: string, categoryName: string): void;
|
|
270
308
|
/**
|
|
271
|
-
*
|
|
272
|
-
* @param
|
|
309
|
+
* Changes the categories of multiple toolbox items.
|
|
310
|
+
* @param items An array of objects with the following structure: `{ name: "toolboxItemName", category: "newCategoryName" }`.
|
|
311
|
+
* @see defineCategories
|
|
273
312
|
*/
|
|
274
|
-
changeCategories(
|
|
313
|
+
changeCategories(items: Array<any>): void;
|
|
275
314
|
/**
|
|
276
315
|
* Defines toolbox categories from scratch.
|
|
277
316
|
*
|
|
@@ -302,31 +341,32 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
|
|
|
302
341
|
*/
|
|
303
342
|
defineCategories(categories: Array<IToolboxCategoryDefinition>, displayMisc?: boolean): void;
|
|
304
343
|
/**
|
|
305
|
-
* Removes categories from the Toolbox.
|
|
344
|
+
* Removes all categories from the Toolbox.
|
|
306
345
|
*/
|
|
307
346
|
removeCategories(): void;
|
|
308
347
|
toggleCategoryState(categoryName: string): void;
|
|
309
348
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
349
|
+
* Expands a category with a specified name. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) is `true`.
|
|
350
|
+
*
|
|
351
|
+
* If [`allowExpandMultipleCategories`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#allowExpandMultipleCategories) is `false`, all other categories become collapsed.
|
|
352
|
+
* @param categoryName A category name. Out-of-the-box category names include `"general"`, `"choice"`, `"text"`, `"containers"`, `"matrix"`, and `"misc"`.
|
|
313
353
|
* @see collapseCategory
|
|
314
354
|
*/
|
|
315
355
|
expandCategory(categoryName: string): void;
|
|
316
356
|
/**
|
|
317
|
-
*
|
|
318
|
-
* @param categoryName the category
|
|
319
|
-
* @see
|
|
357
|
+
* Collapses a category with a specified name. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) and [`allowExpandMultipleCategories`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#allowExpandMultipleCategories) are `true`.
|
|
358
|
+
* @param categoryName A category name. Out-of-the-box category names include `"general"`, `"choice"`, `"text"`, `"containers"`, `"matrix"`, and `"misc"`.
|
|
359
|
+
* @see expandCategory
|
|
320
360
|
*/
|
|
321
361
|
collapseCategory(categoryName: string): void;
|
|
322
362
|
/**
|
|
323
|
-
*
|
|
324
|
-
* @see
|
|
363
|
+
* Expands all categories. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) and [`allowExpandMultipleCategories`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#allowExpandMultipleCategories) are `true`.
|
|
364
|
+
* @see collapseAllCategories
|
|
325
365
|
*/
|
|
326
366
|
expandAllCategories(): void;
|
|
327
367
|
/**
|
|
328
|
-
*
|
|
329
|
-
* @see
|
|
368
|
+
* Collapses all categories. Applies only if [`showCategoryTitles`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#showCategoryTitles) and [`allowExpandMultipleCategories`](https://surveyjs.io/survey-creator/documentation/api-reference/questiontoolbox#allowExpandMultipleCategories) are `true`.
|
|
369
|
+
* @see expandAllCategories
|
|
330
370
|
*/
|
|
331
371
|
collapseAllCategories(): void;
|
|
332
372
|
private expandCollapseAllCategories;
|