survey-creator-core 1.9.112 → 1.9.113
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 +5 -2
- 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/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 +6 -9
- package/survey-creator-core.fontless.css +5 -8
- package/survey-creator-core.fontless.css.map +1 -1
- package/survey-creator-core.fontless.min.css +4 -4
- package/survey-creator-core.i18n.js +1 -1
- package/survey-creator-core.i18n.min.js +1 -1
- package/survey-creator-core.js +618 -533
- package/survey-creator-core.js.map +1 -1
- package/survey-creator-core.min.css +5 -5
- package/survey-creator-core.min.js +45 -45
- package/typings/components/tabs/json-editor-plugin.d.ts +12 -2
- package/typings/components/tabs/test.d.ts +2 -0
- package/typings/components/tabs/theme-builder.d.ts +22 -2
- package/typings/components/tabs/theme-custom-questions/element-settings.d.ts +4 -4
- package/typings/components/tabs/theme-custom-questions/font-settings.d.ts +4 -4
- package/typings/components/tabs/theme-plugin.d.ts +6 -3
- package/typings/creator-base.d.ts +167 -137
- package/typings/creator-options.d.ts +0 -6
- package/typings/creator-settings.d.ts +3 -0
- package/typings/custom-questions/question-file.d.ts +3 -0
- package/typings/editorLocalization.d.ts +5 -1
- package/typings/localization/english.d.ts +4 -1
- package/typings/plugins/undo-redo/undo-redo-controller.d.ts +0 -10
- package/typings/property-grid-theme/property-grid.d.ts +1 -0
- package/typings/survey-helper.d.ts +6 -6
- package/typings/utils/utils.d.ts +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Base, ListModel } from "survey-core";
|
|
1
|
+
import { Base, ListModel, Action } from "survey-core";
|
|
2
2
|
import { ICreatorPlugin, CreatorBase } from "../../creator-base";
|
|
3
3
|
import { SurveyTextWorkerError } from "../../textWorker";
|
|
4
|
+
import { saveToFileHandler } from "../../utils/utils";
|
|
4
5
|
export declare abstract class JsonEditorBaseModel extends Base {
|
|
5
6
|
protected creator: CreatorBase;
|
|
6
7
|
isJSONChanged: boolean;
|
|
@@ -26,8 +27,17 @@ export declare abstract class JsonEditorBaseModel extends Base {
|
|
|
26
27
|
}
|
|
27
28
|
export declare abstract class TabJsonEditorBasePlugin implements ICreatorPlugin {
|
|
28
29
|
private creator;
|
|
29
|
-
|
|
30
|
+
private inputFileElement;
|
|
31
|
+
private importAction;
|
|
32
|
+
private exportAction;
|
|
33
|
+
private copyAction;
|
|
30
34
|
constructor(creator: CreatorBase);
|
|
35
|
+
saveToFileHandler: typeof saveToFileHandler;
|
|
36
|
+
exportToFile(fileName: string): void;
|
|
37
|
+
importFromFile(file: File, callback?: (json: string) => void): void;
|
|
38
|
+
copyToClipboard(): void;
|
|
39
|
+
protected createActions(): Array<Action>;
|
|
40
|
+
model: JsonEditorBaseModel;
|
|
31
41
|
activate(): void;
|
|
32
42
|
deactivate(): boolean;
|
|
33
43
|
defaultAllowingDeactivate(): boolean;
|
|
@@ -25,6 +25,8 @@ export declare class TestSurveyTabViewModel extends Base {
|
|
|
25
25
|
get pageActions(): Array<Action>;
|
|
26
26
|
get isPageToolbarVisible(): boolean;
|
|
27
27
|
constructor(surveyProvider: CreatorBase, startTheme?: any);
|
|
28
|
+
get isMobileView(): boolean;
|
|
29
|
+
get showResults(): boolean;
|
|
28
30
|
updateSimulatorSurvey(json: any, theme: any): void;
|
|
29
31
|
setJSON(json: any, currTheme: any): void;
|
|
30
32
|
initialize(json: any, options: any): void;
|
|
@@ -5,6 +5,7 @@ import { UndoRedoManager } from "../../plugins/undo-redo/undo-redo-manager";
|
|
|
5
5
|
export declare class ThemeBuilder extends Base {
|
|
6
6
|
private surveyProvider;
|
|
7
7
|
private startThemeClasses;
|
|
8
|
+
static DefaultTheme: ITheme;
|
|
8
9
|
private json;
|
|
9
10
|
pages: ActionContainer;
|
|
10
11
|
prevPageAction: Action;
|
|
@@ -57,6 +58,8 @@ export declare class ThemeBuilder extends Base {
|
|
|
57
58
|
canModify: boolean;
|
|
58
59
|
}>;
|
|
59
60
|
constructor(surveyProvider: CreatorBase, startThemeClasses?: any);
|
|
61
|
+
get isMobileView(): boolean;
|
|
62
|
+
get showResults(): boolean;
|
|
60
63
|
loadTheme(theme: ITheme): void;
|
|
61
64
|
resetTheme(): void;
|
|
62
65
|
setTheme(theme: ITheme): void;
|
|
@@ -88,6 +91,7 @@ export declare class ThemeBuilder extends Base {
|
|
|
88
91
|
private setThemeCssVariablesChanges;
|
|
89
92
|
protected createThemeEditorSurvey(): SurveyModel;
|
|
90
93
|
findSuitableTheme(themeName: string): ITheme;
|
|
94
|
+
private patchFileEditors;
|
|
91
95
|
private getCoverJson;
|
|
92
96
|
private setCoverCssVariables;
|
|
93
97
|
private loadThemeIntoPropertyGrid;
|
|
@@ -96,11 +100,27 @@ export declare class ThemeBuilder extends Base {
|
|
|
96
100
|
private setCoverPropertiesFromSurvey;
|
|
97
101
|
private setCoverColorsFromThemeVariables;
|
|
98
102
|
private updateHeaderViewContainerEditors;
|
|
103
|
+
private updatePropertyGridEditorAvailablesFromSurveyElement;
|
|
99
104
|
private updatePropertyGridEditorsAvailability;
|
|
100
105
|
private updatePropertyGridEditors;
|
|
101
|
-
private
|
|
102
|
-
private raiseThemeModified;
|
|
106
|
+
private setCssVariablesIntoCurrentTheme;
|
|
103
107
|
private updateSimulatorTheme;
|
|
108
|
+
private _saveThemeFuncValue;
|
|
109
|
+
/**
|
|
110
|
+
* A function that is called [auto-save](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#isAutoSave) is triggered to save a theme JSON object.
|
|
111
|
+
*
|
|
112
|
+
* For more information, refer to the [Save and Load Custom Themes](/survey-creator/documentation/theme-editor#save-and-load-custom-themes) help topic.
|
|
113
|
+
*/
|
|
114
|
+
get saveThemeFunc(): any;
|
|
115
|
+
set saveThemeFunc(value: any);
|
|
116
|
+
private autoSaveTimerId;
|
|
117
|
+
protected processAutoSave(): void;
|
|
118
|
+
protected themeModified(options: {
|
|
119
|
+
theme: ITheme;
|
|
120
|
+
} | {
|
|
121
|
+
name: string;
|
|
122
|
+
value: any;
|
|
123
|
+
}): void;
|
|
104
124
|
private getThemeEditorSurveyJSON;
|
|
105
125
|
getHorizontalAlignment(questionName: string, title: string, defaultValue: string): {
|
|
106
126
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function elementSettingsToCssVariable(question:
|
|
1
|
+
import { Question } from "survey-core";
|
|
2
|
+
export declare function elementSettingsToCssVariable(question: Question, themeCssVariables: {
|
|
3
3
|
[index: string]: string;
|
|
4
4
|
}): void;
|
|
5
|
-
export declare function elementSettingsFromCssVariable(question:
|
|
5
|
+
export declare function elementSettingsFromCssVariable(question: Question, themeCssVariables: {
|
|
6
6
|
[index: string]: string;
|
|
7
|
-
}, defaultBackcolorVariable: string, defaultHovercolorVariable: string):
|
|
7
|
+
}, defaultBackcolorVariable: string, defaultHovercolorVariable: string): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Question } from "survey-core";
|
|
2
2
|
export declare const DefaultFonts: string[];
|
|
3
|
-
export declare function fontsettingsToCssVariable(question:
|
|
3
|
+
export declare function fontsettingsToCssVariable(question: Question, themeCssVariables: {
|
|
4
4
|
[index: string]: string;
|
|
5
5
|
}): void;
|
|
6
|
-
export declare function fontsettingsFromCssVariable(question:
|
|
6
|
+
export declare function fontsettingsFromCssVariable(question: Question, themeCssVariables: {
|
|
7
7
|
[index: string]: string;
|
|
8
|
-
}, defaultColorVariable?: string, defaultPlaceholderColorVariable?: string):
|
|
8
|
+
}, defaultColorVariable?: string, defaultPlaceholderColorVariable?: string): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action, ITheme, EventBase } from "survey-core";
|
|
2
2
|
import { CreatorBase, ICreatorPlugin } from "../../creator-base";
|
|
3
3
|
import { ThemeBuilder } from "./theme-builder";
|
|
4
|
+
import { saveToFileHandler } from "../../utils/utils";
|
|
4
5
|
export declare class ThemeTabPlugin implements ICreatorPlugin {
|
|
5
6
|
private creator;
|
|
6
7
|
private previewAction;
|
|
@@ -25,7 +26,7 @@ export declare class ThemeTabPlugin implements ICreatorPlugin {
|
|
|
25
26
|
activate(): void;
|
|
26
27
|
update(): void;
|
|
27
28
|
deactivate(): boolean;
|
|
28
|
-
saveToFileHandler:
|
|
29
|
+
saveToFileHandler: typeof saveToFileHandler;
|
|
29
30
|
exportToFile(fileName: string): void;
|
|
30
31
|
importFromFile(file: File, callback?: (theme: ITheme) => void): void;
|
|
31
32
|
createActions(): Array<Action>;
|
|
@@ -35,9 +36,11 @@ export declare class ThemeTabPlugin implements ICreatorPlugin {
|
|
|
35
36
|
addFooterActions(): void;
|
|
36
37
|
get availableThemes(): string[];
|
|
37
38
|
set availableThemes(availebleThemes: string[]);
|
|
38
|
-
addTheme(theme: ITheme): string;
|
|
39
|
-
removeTheme(
|
|
39
|
+
addTheme(theme: ITheme, setAsDefault?: boolean): string;
|
|
40
|
+
removeTheme(themeAccessor: string | ITheme): void;
|
|
41
|
+
getCurrentTheme(content?: "full" | "changes"): ITheme;
|
|
40
42
|
getThemeChanges(): ITheme;
|
|
43
|
+
get isThemePristine(): boolean;
|
|
41
44
|
onThemeSelected: EventBase<ThemeTabPlugin, {
|
|
42
45
|
theme: ITheme;
|
|
43
46
|
}>;
|
|
@@ -202,14 +202,8 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
202
202
|
get isDesignerShowing(): boolean;
|
|
203
203
|
showDesigner(): void;
|
|
204
204
|
get isTestSurveyShowing(): boolean;
|
|
205
|
-
/**
|
|
206
|
-
* Return true if Preview tab is currently active
|
|
207
|
-
*/
|
|
208
205
|
get isPreviewShowing(): boolean;
|
|
209
206
|
showTestSurvey(): void;
|
|
210
|
-
/**
|
|
211
|
-
* Show Preview tab
|
|
212
|
-
*/
|
|
213
207
|
showPreview(): void;
|
|
214
208
|
protected plugins: {
|
|
215
209
|
[name: string]: ICreatorPlugin;
|
|
@@ -218,11 +212,19 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
218
212
|
addPlugin(name: string, plugin: ICreatorPlugin): void;
|
|
219
213
|
getPlugin<P extends ICreatorPlugin = ICreatorPlugin>(name: string): P;
|
|
220
214
|
/**
|
|
221
|
-
*
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
215
|
+
* An event that is raised before a survey element (a question, panel, or page) is deleted.
|
|
216
|
+
*
|
|
217
|
+
* Parameters:
|
|
218
|
+
*
|
|
219
|
+
* - `sender`: `CreatorBase`\
|
|
220
|
+
* A Survey Creator instance that raised the event.
|
|
221
|
+
* - `options.element`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
222
|
+
* A survey element to be deleted.
|
|
223
|
+
* - `options.elementType`: `"question"` | `"panel"` | `"page"`\
|
|
224
|
+
* The element type.
|
|
225
|
+
* - `options.allowing`: `boolean`\
|
|
226
|
+
* A Boolean property that you can set to `false` if you want to cancel element deletion.
|
|
227
|
+
* @see deleteElement
|
|
226
228
|
*/
|
|
227
229
|
onElementDeleting: CreatorEvent;
|
|
228
230
|
/**
|
|
@@ -288,54 +290,72 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
288
290
|
*/
|
|
289
291
|
onHtmlToMarkdown: CreatorEvent;
|
|
290
292
|
/**
|
|
291
|
-
* Use this event to disable user interactions with a question or
|
|
293
|
+
* An event that is raised when Survey Creator obtains permitted operations for a survey element. Use this event to disable user interactions with a question, panel, or page on the design surface.
|
|
292
294
|
*
|
|
293
|
-
*
|
|
295
|
+
* Parameters:
|
|
294
296
|
*
|
|
295
|
-
* - `sender
|
|
296
|
-
*
|
|
297
|
-
* - `options.
|
|
298
|
-
*
|
|
299
|
-
* - `options.
|
|
300
|
-
*
|
|
301
|
-
* - `options.
|
|
302
|
-
*
|
|
303
|
-
* - `options.
|
|
304
|
-
*
|
|
297
|
+
* - `sender`: `CreatorBase`\
|
|
298
|
+
* A Survey Creator instance that raised the event.
|
|
299
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
300
|
+
* A survey element (question or panel) for which you can disable user interactions.
|
|
301
|
+
* - `options.allowChangeRequired`: `boolean`\
|
|
302
|
+
* Allows users to mark the survey element as required.
|
|
303
|
+
* - `options.allowChangeType`: `boolean`\
|
|
304
|
+
* Allows users to change the survey element type.
|
|
305
|
+
* - `options.allowChangeInputType`: `boolean`\
|
|
306
|
+
* Allows users to change the [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) property of Single-Line Input questions.
|
|
307
|
+
* - `options.allowCopy`: `boolean`\
|
|
308
|
+
* Allows users to duplicate the survey element.
|
|
309
|
+
* - `options.allowDelete`: `boolean`\
|
|
310
|
+
* Allows users to delete the survey element.
|
|
311
|
+
* - `options.allowDragging`: `boolean`\
|
|
312
|
+
* Allows users to drag and drop the survey element.
|
|
313
|
+
* - `options.allowEdit`: `boolean`\
|
|
314
|
+
* Allows users to edit survey element properties on the design surface. If you disable this property, users can edit the properties only in the Property Grid.
|
|
305
315
|
*
|
|
306
316
|
* To disable a user interaction, set the correponding `allow...` property to `false`.
|
|
317
|
+
*
|
|
318
|
+
* [Specify Adorner Visibility](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#specify-adorner-availability (linkStyle))
|
|
307
319
|
*/
|
|
308
320
|
onElementAllowOperations: CreatorEvent;
|
|
309
321
|
/**
|
|
310
|
-
* Use this event to
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
322
|
+
* An event that is raised when Survey Creator obtains [adorners](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#specify-adorner-availability) for a survey element. Use this event to hide and modify predefined adorners or add a custom adorner.
|
|
323
|
+
*
|
|
324
|
+
* Parameters:
|
|
325
|
+
*
|
|
326
|
+
* - `sender`: `CreatorBase`\
|
|
327
|
+
* A Survey Creator instance that raised the event.
|
|
328
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
329
|
+
* A survey element (question, panel, or page) whose adorners you can customize.
|
|
330
|
+
* - `options.items`: [`IAction[]`](https://surveyjs.io/form-library/documentation/api-reference/iaction#title)\
|
|
331
|
+
* An array of adorner actions. You can add, modify, or remove actions from this array.
|
|
332
|
+
*
|
|
333
|
+
* [View Demo](https://surveyjs.io/survey-creator/examples/create-custom-adorners/ (linkStyle))
|
|
314
334
|
* @see onElementAllowOperations
|
|
335
|
+
* @see onGetPageActions
|
|
315
336
|
*/
|
|
316
337
|
onDefineElementMenuItems: CreatorEvent;
|
|
317
338
|
/**
|
|
318
|
-
*
|
|
319
|
-
*- sender the survey creator object that fires the event
|
|
320
|
-
*- options.obj the survey object, Survey, Page, Panel or Question
|
|
321
|
-
*- options.property the object property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties.
|
|
322
|
-
*- options.canShow a boolean value. It is true by default. Set it false to hide the property from the Properties Grid and in the Question Editor.
|
|
323
|
-
*- options.parentObj the parent object. It is null for non-nested properties. It is not null for itemvalue or column objects. The parent object is a question (dropdown, radigroup, checkbox, matrices and so on).
|
|
324
|
-
*- options.parentProperty the parent property (Survey.JsonObjectProperty object). It is null for non-nested properties. It is not null for itemvalue or column objects. The parent object is choices, columns, rows, triggers and so on.
|
|
339
|
+
* An event that is raised when Survey Creator adds properties to a survey element selected on the design surface. Handle this event if you cancel the addition of certain properties and thus [hide them from the Property Grid](https://surveyjs.io/survey-creator/documentation/property-grid-customization#hide-properties-from-the-property-grid).
|
|
325
340
|
*
|
|
326
|
-
*
|
|
341
|
+
* Parameters:
|
|
342
|
+
*
|
|
343
|
+
* - `sender`: `CreatorBase`\
|
|
344
|
+
* A Survey Creator instance that raised the event.
|
|
345
|
+
* - `options.property`: `JsonObjectProperty`\
|
|
346
|
+
* A property being added.
|
|
347
|
+
* - `options.parentProperty`: `JsonObjectProperty`\
|
|
348
|
+
* A property that nests `options.property` (`choices` for an item value, `columns` for a matrix column, `rows` for a matrix row etc.). `options.parentProperty` has a value only for nested properties.
|
|
349
|
+
* - `options.obj`: `any`\
|
|
350
|
+
* A survey element that contains `options.property`: page, panel, question, the survey itself, item value (choice option), matrix column, etc.
|
|
351
|
+
* - `options.parentObj`: `any`\
|
|
352
|
+
* A survey element that contains `options.parentProperty`. `options.parentObj` has a value only for nested properties.
|
|
353
|
+
* - `options.canShow`: `boolean`\
|
|
354
|
+
* A Boolean property that you can set to `false` if you do not want to add the property.
|
|
355
|
+
*
|
|
356
|
+
* [View Demo](https://surveyjs.io/survey-creator/examples/hide-category-from-property-grid/ (linkStyle))
|
|
327
357
|
*/
|
|
328
358
|
onShowingProperty: CreatorEvent;
|
|
329
|
-
/**
|
|
330
|
-
* @Deprecated Obsolete, please use onShowingProperty event.
|
|
331
|
-
* The event is called before showing a property in the Property Grid or in Question Editor.
|
|
332
|
-
*- sender the survey creator object that fires the event
|
|
333
|
-
*- options.obj the survey object, Survey, Page, Panel or Question
|
|
334
|
-
*- options.property the object property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties.
|
|
335
|
-
*- options.canShow a boolean value. It is true by default. Set it false to hide the property from the Property Grid or in Question Editor
|
|
336
|
-
*- options.parentObj the parent object. It is null for non-nested properties. It is not null for itemvalue or column objects. The parent object is a question (dropdown, radigroup, checkbox, matrices and so on).
|
|
337
|
-
*- options.parentProperty the parent property (Survey.JsonObjectProperty object). It is null for non-nested properties. It is not null for itemvalue or column objects. The parent object is choices, columns, rows, triggers and so on.
|
|
338
|
-
*/
|
|
339
359
|
onCanShowProperty: CreatorEvent;
|
|
340
360
|
/**
|
|
341
361
|
* The event is called after a survey that represents the Property Grid is created and all its questions (property editors) are setup.
|
|
@@ -376,28 +396,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
376
396
|
* - `options.popupModel` - A `PopupBaseViewModel` object that describes the pop-up window model. Use `options.popupModel.footerToolbar` to access the actions at the bottom of the window.
|
|
377
397
|
*/
|
|
378
398
|
onPropertyGridShowModal: CreatorEvent;
|
|
379
|
-
/**
|
|
380
|
-
* The event is called before rendering a delete button in the Property Grid or in Question Editor.
|
|
381
|
-
* @Deprecated Obsolete, please use onCollectionItemAllowOperations
|
|
382
|
-
*- sender the survey creator object that fires the event
|
|
383
|
-
*- options.obj the survey Question
|
|
384
|
-
*- options.item the object property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties
|
|
385
|
-
*- options.canDelete a boolean value. It is true by default. Set it false to remove delete button from the Property Grid or in Question Editor
|
|
386
|
-
* @see onCollectionItemAllowOperations
|
|
387
|
-
*/
|
|
388
399
|
onCanDeleteItem: CreatorEvent;
|
|
389
|
-
/**
|
|
390
|
-
* The event is called on deleting a collection item from the Property Editor. For example: column in columns editor or item in choices and so on.
|
|
391
|
-
* @Deprecated Obsolete, please use onCollectionItemAllowOperations
|
|
392
|
-
*- sender the survey creator object that fires the event
|
|
393
|
-
*- options.obj the survey object: Question, Panel, Page or Survey
|
|
394
|
-
*- options.property the collection property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties
|
|
395
|
-
*- options.propertyName the collection property name
|
|
396
|
-
*- options.collection the editing collection where deleting item is located. It is can be columns in the matrices or choices in dropdown question and so on.
|
|
397
|
-
*- options.item the collection item that we are going to delete
|
|
398
|
-
*- options.allowDelete a boolean value. It is true by default. Set it false to abondome the element removing from the collection
|
|
399
|
-
* @see onCollectionItemAllowOperations
|
|
400
|
-
*/
|
|
401
400
|
onCollectionItemDeleting: CreatorEvent;
|
|
402
401
|
/**
|
|
403
402
|
* The event is called before rendering a collection item in a property editor. For example: a column in a column editor, or an item in Choices and so on.
|
|
@@ -646,11 +645,12 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
646
645
|
* - `sender`: `CreatorBase`\
|
|
647
646
|
* A Survey Creator instance that raised the event.
|
|
648
647
|
* - `options.actions`: [`IAction[]`](/form-library/documentation/api-reference/iaction)\
|
|
649
|
-
* An array of actions. You can add or remove actions from this array.
|
|
648
|
+
* An array of actions. You can add, modify, or remove actions from this array.
|
|
650
649
|
* - `options.page`: [`PageModel`](/form-library/documentation/api-reference/page-model)\
|
|
651
650
|
* A page for which the event is raised.
|
|
652
651
|
* - `options.addNewQuestion(type)`: Method\
|
|
653
652
|
* Adds a new question of a specified [`type`](/form-library/documentation/api-reference/question#getType) to the page.
|
|
653
|
+
* @see onDefineElementMenuItems
|
|
654
654
|
*/
|
|
655
655
|
onGetPageActions: CreatorEvent;
|
|
656
656
|
/**
|
|
@@ -691,13 +691,28 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
691
691
|
*/
|
|
692
692
|
onNotify: CreatorEvent;
|
|
693
693
|
/**
|
|
694
|
-
*
|
|
695
|
-
|
|
694
|
+
* An event that is raised before a survey element (a question, panel, page, or the survey itself) is focused. Use this event to move focus to a different survey element.
|
|
695
|
+
*
|
|
696
|
+
* Parameters:
|
|
697
|
+
*
|
|
698
|
+
* - `sender`: `CreatorBase`\
|
|
699
|
+
* A Survey Creator instance that raised the event.
|
|
700
|
+
* - `options.newSelectedElement`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
701
|
+
* An element that is going to be focused.
|
|
702
|
+
* @see onSelectedElementChanged
|
|
703
|
+
* @see selectedElement
|
|
696
704
|
*/
|
|
697
705
|
onSelectedElementChanging: CreatorEvent;
|
|
698
706
|
/**
|
|
699
|
-
*
|
|
700
|
-
|
|
707
|
+
* An event that is raised after a survey element (a question, panel, page, or the survey itself) is focused.
|
|
708
|
+
*
|
|
709
|
+
* Parameters:
|
|
710
|
+
*
|
|
711
|
+
* - `sender`: `CreatorBase`\
|
|
712
|
+
* A Survey Creator instance that raised the event.
|
|
713
|
+
* - `options.newSelectedElement`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
714
|
+
* The [focused element](#selectedElement).
|
|
715
|
+
* @see onSelectedElementChanging
|
|
701
716
|
*/
|
|
702
717
|
onSelectedElementChanged: CreatorEvent;
|
|
703
718
|
/**
|
|
@@ -815,27 +830,34 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
815
830
|
*/
|
|
816
831
|
onTranslationItemChanging: CreatorEvent;
|
|
817
832
|
/**
|
|
818
|
-
* Use this event to control drag
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
833
|
+
* An event that is raised when users drag and drop survey elements within the design surface. Use this event to control drag and drop operations.
|
|
834
|
+
*
|
|
835
|
+
* Parameters:
|
|
836
|
+
*
|
|
837
|
+
* - `sender`: `CreatorBase`\
|
|
838
|
+
* A Survey Creator instance that raised the event.
|
|
839
|
+
* - `options.target`: `IElement`\
|
|
840
|
+
* A survey element being dragged.
|
|
841
|
+
* - `options.source`: `IElement`\
|
|
842
|
+
* A survey element from which `target` is being dragged. This parameter is `null` if `target` is being dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox).
|
|
843
|
+
* - `options.insertBefore`: `IElement`\
|
|
844
|
+
* A survey element before which the target element will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if the target element will be placed below all other elements within the container.
|
|
845
|
+
* - `options.insertAfter`: `IElement`\
|
|
846
|
+
* A survey element after which `target` will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if `target` will be placed above all other elements within the container.
|
|
847
|
+
* - `options.parent`: `ISurveyElement`\
|
|
848
|
+
* A parent container (page or panel) within which `target` will be placed.
|
|
849
|
+
* - `options.survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
|
|
850
|
+
* A survey within which the drag and drop operation occured.
|
|
851
|
+
* - `options.allow`: `boolean`\
|
|
852
|
+
* A Boolean property that you can set to `false` if you want to cancel the drag and drop operation.
|
|
853
|
+
* @see onDragStart
|
|
854
|
+
* @see onDragEnd
|
|
827
855
|
*/
|
|
828
856
|
onDragDropAllow: CreatorEvent;
|
|
829
|
-
/**
|
|
830
|
-
* This callback is used internally for providing survey JSON text.
|
|
831
|
-
*/
|
|
832
857
|
getSurveyJSONTextCallback: () => {
|
|
833
858
|
text: string;
|
|
834
859
|
isModified: boolean;
|
|
835
860
|
};
|
|
836
|
-
/**
|
|
837
|
-
* This callback is used internally for setting survey JSON text.
|
|
838
|
-
*/
|
|
839
861
|
setSurveyJSONTextCallback: (text: string) => void;
|
|
840
862
|
/**
|
|
841
863
|
* Limits the number of items in a logical expression.
|
|
@@ -936,13 +958,20 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
936
958
|
* @see allowChangeThemeInPreview
|
|
937
959
|
*/
|
|
938
960
|
themeForPreview: string;
|
|
939
|
-
|
|
940
|
-
|
|
961
|
+
/**
|
|
962
|
+
* A function that is called each time users click the [Save button](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#showSaveButton) or [auto-save](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#isAutoSave) is triggered to save a theme JSON object.
|
|
963
|
+
*
|
|
964
|
+
* For more information, refer to the [Save and Load Custom Themes](/survey-creator/documentation/theme-editor#save-and-load-custom-themes) help topic.
|
|
965
|
+
* @see showThemeTab
|
|
966
|
+
* @see saveSurveyFunc
|
|
967
|
+
*/
|
|
968
|
+
get saveThemeFunc(): any;
|
|
969
|
+
set saveThemeFunc(value: any);
|
|
970
|
+
isThemeModified: boolean;
|
|
941
971
|
private _theme;
|
|
942
972
|
get theme(): ITheme;
|
|
943
973
|
set theme(newTheme: ITheme);
|
|
944
|
-
|
|
945
|
-
raiseThemeChanged(): void;
|
|
974
|
+
doSaveTheme(): void;
|
|
946
975
|
private _allowModifyPages;
|
|
947
976
|
/**
|
|
948
977
|
* Specifies whether users can add, edit, and delete survey pages.
|
|
@@ -1108,45 +1137,53 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1108
1137
|
rightContainerActiveItem(name: string): void;
|
|
1109
1138
|
leftContainerActiveItem(name: string): void;
|
|
1110
1139
|
/**
|
|
1111
|
-
*
|
|
1112
|
-
|
|
1140
|
+
* An event that is raised before an undo operation.
|
|
1141
|
+
*
|
|
1142
|
+
* Parameters:
|
|
1143
|
+
*
|
|
1144
|
+
* - `sender`: `CreatorBase`\
|
|
1145
|
+
* A Survey Creator instance that raised the event.
|
|
1146
|
+
* - `options.canUndo`: `boolean`\
|
|
1147
|
+
* A Boolean value that you can set to `false` if you want to prevent the undo operation.
|
|
1148
|
+
* @see undo
|
|
1149
|
+
* @see redo
|
|
1150
|
+
* @see onBeforeRedo
|
|
1113
1151
|
*/
|
|
1114
1152
|
onBeforeUndo: CreatorEvent;
|
|
1115
1153
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
|
|
1154
|
+
* An event that is raised before an redo operation.
|
|
1155
|
+
*
|
|
1156
|
+
* Parameters:
|
|
1157
|
+
*
|
|
1158
|
+
* - `sender`: `CreatorBase`\
|
|
1159
|
+
* A Survey Creator instance that raised the event.
|
|
1160
|
+
* - `options.canRedo`: `boolean`\
|
|
1161
|
+
* A Boolean value that you can set to `false` if you want to prevent the redo operation.
|
|
1162
|
+
* @see redo
|
|
1163
|
+
* @see undo
|
|
1164
|
+
* @see onBeforeUndo
|
|
1118
1165
|
*/
|
|
1119
1166
|
onBeforeRedo: CreatorEvent;
|
|
1120
|
-
/**
|
|
1121
|
-
* The event is called after undo happens.
|
|
1122
|
-
*- options.state is an undo/redo item.
|
|
1123
|
-
*/
|
|
1124
|
-
onAfterUndo: CreatorEvent;
|
|
1125
|
-
/**
|
|
1126
|
-
* The event is called after redo happens.
|
|
1127
|
-
*- options.state is an undo/redo item.
|
|
1128
|
-
*/
|
|
1129
|
-
onAfterRedo: CreatorEvent;
|
|
1130
1167
|
get undoRedoManager(): UndoRedoManager;
|
|
1131
1168
|
get undoRedoController(): UndoRedoController;
|
|
1132
|
-
/**
|
|
1133
|
-
* This method starts undo/redo transaction: all changes will be stored as one undo/redo item.
|
|
1134
|
-
*/
|
|
1135
1169
|
startUndoRedoTransaction(name?: string): void;
|
|
1136
|
-
/**
|
|
1137
|
-
* This method stops undo/redo transaction.
|
|
1138
|
-
*/
|
|
1139
1170
|
stopUndoRedoTransaction(): void;
|
|
1140
1171
|
/**
|
|
1141
|
-
* Returns true if
|
|
1172
|
+
* Returns `true` if an undo or redo operation is in progress.
|
|
1173
|
+
* @see undo
|
|
1174
|
+
* @see redo
|
|
1142
1175
|
*/
|
|
1143
1176
|
get isProcessingUndoRedo(): boolean;
|
|
1144
1177
|
/**
|
|
1145
|
-
*
|
|
1178
|
+
* Cancels the last change if possible.
|
|
1179
|
+
* @see redo
|
|
1180
|
+
* @see onBeforeUndo
|
|
1146
1181
|
*/
|
|
1147
1182
|
undo(): void;
|
|
1148
1183
|
/**
|
|
1149
|
-
*
|
|
1184
|
+
* Repeats the last undone action if possible.
|
|
1185
|
+
* @see undo
|
|
1186
|
+
* @see onBeforeRedo
|
|
1150
1187
|
*/
|
|
1151
1188
|
redo(): void;
|
|
1152
1189
|
get selectionHistoryController(): SelectionHistory;
|
|
@@ -1205,6 +1242,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1205
1242
|
* - `options.toElement`: `any`\
|
|
1206
1243
|
* A survey element to which `draggedElement` is being dragged.
|
|
1207
1244
|
* @see onDragEnd
|
|
1245
|
+
* @see onDragDropAllow
|
|
1208
1246
|
*/
|
|
1209
1247
|
onDragStart: Event<() => any, any, any>;
|
|
1210
1248
|
onBeforeDrop: Event<() => any, any, any>;
|
|
@@ -1221,6 +1259,8 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1221
1259
|
* A survey element from which `draggedElement` was dragged.
|
|
1222
1260
|
* - `options.toElement`: `any`\
|
|
1223
1261
|
* A survey element to which `draggedElement` was dragged.
|
|
1262
|
+
* @see onDragStart
|
|
1263
|
+
* @see onDragDropAllow
|
|
1224
1264
|
*/
|
|
1225
1265
|
onDragEnd: Event<() => any, any, any>;
|
|
1226
1266
|
onAfterDrop: Event<() => any, any, any>;
|
|
@@ -1315,22 +1355,20 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1315
1355
|
*/
|
|
1316
1356
|
fastCopyQuestion(question: Base): IElement;
|
|
1317
1357
|
/**
|
|
1318
|
-
*
|
|
1358
|
+
* Gets or sets the focused survey element: a question, panel, page, or the survey itself.
|
|
1359
|
+
* @see onSelectedElementChanging
|
|
1360
|
+
* @see onSelectedElementChanged
|
|
1319
1361
|
*/
|
|
1320
1362
|
get selectedElement(): Base;
|
|
1321
1363
|
set selectedElement(val: Base);
|
|
1322
|
-
/**
|
|
1323
|
-
* @Deprecated Obsolete. Please use deleteCurrentElement.
|
|
1324
|
-
* @see deleteCurrentElement
|
|
1325
|
-
*/
|
|
1326
1364
|
deleteCurrentObject(): void;
|
|
1327
|
-
/**
|
|
1328
|
-
* Delete a currently selected element in the survey. It can be a question, a panel or a page.
|
|
1329
|
-
*/
|
|
1330
1365
|
deleteCurrentElement(): void;
|
|
1331
1366
|
/**
|
|
1332
|
-
*
|
|
1333
|
-
*
|
|
1367
|
+
* Deletes a survey element: a question, panel, or page.
|
|
1368
|
+
*
|
|
1369
|
+
* If you want to delete the focused element, pass the [`selectedElement`](#selectedElement) property value to this method.
|
|
1370
|
+
* @param element A survey element to delete.
|
|
1371
|
+
* @see onElementDeleting
|
|
1334
1372
|
*/
|
|
1335
1373
|
deleteElement(element: Base): void;
|
|
1336
1374
|
/**
|
|
@@ -1376,8 +1414,10 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1376
1414
|
expandPropertyTab(name: string): void;
|
|
1377
1415
|
collapsePropertyTab(name: string): void;
|
|
1378
1416
|
/**
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1417
|
+
* Validates the property values of the [focused element](#selectedElement).
|
|
1418
|
+
* @returns `true` if all property values of the focused element are valid or if no element is focused, `false` otherwise.
|
|
1419
|
+
* @see onSelectedElementChanging
|
|
1420
|
+
* @see onSelectedElementChanged
|
|
1381
1421
|
*/
|
|
1382
1422
|
validateSelectedElement(): boolean;
|
|
1383
1423
|
/**
|
|
@@ -1446,7 +1486,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1446
1486
|
getHasMachineTranslation(): boolean;
|
|
1447
1487
|
doMachineTranslation(fromLocale: string, toLocale: string, strings: Array<string>, callback: (translated: Array<string>) => void): void;
|
|
1448
1488
|
/**
|
|
1449
|
-
* A delay between changing survey
|
|
1489
|
+
* A delay between changing survey settings and saving the survey JSON schema, measured in milliseconds. Applies only when the [`isAutoSave`](#isAutoSave) property is `true`.
|
|
1450
1490
|
*
|
|
1451
1491
|
* Default value: 500 (taken from `settings.autoSave.delay`)
|
|
1452
1492
|
*
|
|
@@ -1454,19 +1494,9 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1454
1494
|
*/
|
|
1455
1495
|
autoSaveDelay: number;
|
|
1456
1496
|
private autoSaveTimerId;
|
|
1457
|
-
protected doAutoSave(
|
|
1497
|
+
protected doAutoSave(): void;
|
|
1458
1498
|
saveNo: number;
|
|
1459
1499
|
doSave(): void;
|
|
1460
|
-
doSaveTheme(): void;
|
|
1461
|
-
/**
|
|
1462
|
-
* A function that is called each time users click the [Save button](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#showSaveButton) or [auto-save](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#isAutoSave) is triggered to save a theme JSON object.
|
|
1463
|
-
*
|
|
1464
|
-
* For more information, refer to the [Save and Load Custom Themes](/survey-creator/documentation/theme-editor#save-and-load-custom-themes) help topic.
|
|
1465
|
-
* @see showThemeTab
|
|
1466
|
-
* @see saveSurveyFunc
|
|
1467
|
-
*/
|
|
1468
|
-
get saveThemeFunc(): any;
|
|
1469
|
-
set saveThemeFunc(value: any);
|
|
1470
1500
|
/**
|
|
1471
1501
|
* Specifies whether to display a button that saves the survey or theme (executes the [`saveSurveyFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveSurveyFunc) or [`saveThemeFunc`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#saveThemeFunc) function).
|
|
1472
1502
|
* @see isAutoSave
|
|
@@ -31,12 +31,6 @@ export interface ICreatorOptions {
|
|
|
31
31
|
* Default value: `false`
|
|
32
32
|
*/
|
|
33
33
|
showLogicTab?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Specifies whether to display the Embed Survey tab.
|
|
36
|
-
*
|
|
37
|
-
* Default value: `false`
|
|
38
|
-
*/
|
|
39
|
-
showEmbeddedSurveyTab?: boolean;
|
|
40
34
|
/**
|
|
41
35
|
* Specifies whether to display the Translation tab.
|
|
42
36
|
*
|