survey-creator-core 1.9.126 → 1.9.127
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 +2 -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/hebrew.js +2 -3
- package/i18n/hebrew.js.map +1 -1
- package/i18n/hebrew.min.js +2 -2
- package/i18n/hungarian.js +1 -1
- package/i18n/hungarian.min.js +1 -1
- package/i18n/index.js +2 -3
- package/i18n/index.js.map +1 -1
- package/i18n/index.min.js +2 -2
- 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 +19 -6
- package/survey-creator-core.fontless.css +18 -5
- package/survey-creator-core.fontless.css.map +1 -1
- package/survey-creator-core.fontless.min.css +5 -5
- package/survey-creator-core.i18n.js +2 -3
- package/survey-creator-core.i18n.js.map +1 -1
- package/survey-creator-core.i18n.min.js +2 -2
- package/survey-creator-core.js +267 -167
- package/survey-creator-core.js.map +1 -1
- package/survey-creator-core.min.css +6 -6
- package/survey-creator-core.min.js +3 -3
- package/typings/creator-base.d.ts +192 -113
- package/typings/creator-settings.d.ts +4 -4
- package/typings/custom-questions/question-file.d.ts +1 -1
- package/typings/question-editor/properties.d.ts +7 -5
|
@@ -59,9 +59,6 @@ export declare class ToolbarActionContainer extends ActionContainer {
|
|
|
59
59
|
export declare type toolboxLocationType = "left" | "right" | "sidebar";
|
|
60
60
|
export declare class CreatorEvent extends EventBase<CreatorBase, any> {
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Base class for Survey Creator.
|
|
64
|
-
*/
|
|
65
62
|
export declare class CreatorBase extends Base implements ISurveyCreatorOptions, ICreatorSelectionOwner, ILocalizableOwner {
|
|
66
63
|
protected options: ICreatorOptions;
|
|
67
64
|
getMarkdownHtml(text: string, name: string): string;
|
|
@@ -324,6 +321,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
324
321
|
* To disable a user interaction, set the correponding `allow...` property to `false`.
|
|
325
322
|
*
|
|
326
323
|
* [Specify Adorner Visibility](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#specify-adorner-availability (linkStyle))
|
|
324
|
+
* @see onCollectionItemAllowOperations
|
|
327
325
|
*/
|
|
328
326
|
onElementAllowOperations: CreatorEvent;
|
|
329
327
|
/**
|
|
@@ -390,6 +388,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
390
388
|
* A property editor. It is an object of the [`Question`](https://surveyjs.io/form-library/documentation/question) type because the Property Grid is [built upon a regular survey](https://surveyjs.io/survey-creator/documentation/creator-v2-whats-new#survey-creator-ui-elements-are-surveys).
|
|
391
389
|
* - `options.property`: `JsonObjectProperty`\
|
|
392
390
|
* A property that corresponds to the created property editor.
|
|
391
|
+
* @see onSetPropertyEditorOptions
|
|
393
392
|
* @see onPropertyGridSurveyCreated
|
|
394
393
|
*/
|
|
395
394
|
onPropertyEditorCreated: CreatorEvent;
|
|
@@ -432,47 +431,89 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
432
431
|
onCanDeleteItem: CreatorEvent;
|
|
433
432
|
onCollectionItemDeleting: CreatorEvent;
|
|
434
433
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
434
|
+
* An event that is raised when Survey Creator obtains permitted operations for a collection item (a choice option in Choices, a column or row in Columns, etc.). Use this event to prevent users from adding, deleting, or editing a particular collection item.
|
|
435
|
+
*
|
|
436
|
+
* Parameters:
|
|
437
|
+
*
|
|
438
|
+
* - `sender`: `CreatorBase`\
|
|
439
|
+
* A Survey Creator instance that raised the event.
|
|
440
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
441
|
+
* A survey element (survey, page, panel, question) that contains the collection to which the target item belongs.
|
|
442
|
+
* - `options.property`: `JsonObjectProperty`\
|
|
443
|
+
* A property that contains the collection to which the target item belongs.
|
|
444
|
+
* - `options.propertyName`: `string`\
|
|
445
|
+
* The property's name: `columns`, `rows`, `choices`, `rateValues`, etc.
|
|
446
|
+
* - `options.collection`: [`Survey.Base[]`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
447
|
+
* An array of collection items to which the target item belongs ([`columns`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#columns) or [`rows`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#rows) in matrix questions, [`choices`](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choices) in select-based questions, etc.).
|
|
448
|
+
* - `options.item`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
449
|
+
* A target collection item.
|
|
450
|
+
* - `options.allowAdd`: `boolean`\
|
|
451
|
+
* A Boolean property that you can set to `false` if you want to prevent the target item from being added to the collection.
|
|
452
|
+
* - `options.allowDelete`: `boolean`\
|
|
453
|
+
* A Boolean property that you can set to `false` if you want to prevent the target item from being deleted.
|
|
454
|
+
* - `options.allowEdit`: `boolean`\
|
|
455
|
+
* A Boolean property that you can set to `false` if you want to prevent the target item from being edited.
|
|
456
|
+
* @see onElementAllowOperations
|
|
446
457
|
*/
|
|
447
458
|
onCollectionItemAllowOperations: CreatorEvent;
|
|
448
459
|
/**
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
* An event that is raised when users add a new collection item (a choice option to Choices, a column or row to Columns, etc.). Use this event to modify this item.
|
|
461
|
+
*
|
|
462
|
+
* Parameters:
|
|
463
|
+
*
|
|
464
|
+
* - `sender`: `CreatorBase`\
|
|
465
|
+
* A Survey Creator instance that raised the event.
|
|
466
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
467
|
+
* A survey element (survey, page, panel, question) that contains the collection to which the target item belongs.
|
|
468
|
+
* - `options.property`: `JsonObjectProperty`\
|
|
469
|
+
* A property that contains the collection to which the target item belongs.
|
|
470
|
+
* - `options.propertyName`: `string`\
|
|
471
|
+
* The property's name: `columns`, `rows`, `choices`, `rateValues`, etc.
|
|
472
|
+
* - `options.newItem`: [`ItemValue`](https://surveyjs.io/form-library/documentation/itemvalue)\
|
|
473
|
+
* A new collection item. Overwrite its `value` or `text` property if you want to change the item's value or display text.
|
|
474
|
+
* - `options.itemValues`: [`ItemValue[]`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
475
|
+
* An array of collection items to which the target item belongs ([`columns`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#columns) or [`rows`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#rows) in matrix questions, [`choices`](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choices) in select-based questions, etc.). This array does not include `options.newItem`.
|
|
476
|
+
*
|
|
477
|
+
* > This event is not raised when users add a new column to a [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) or [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model). For these cases, handle the [`onMatrixColumnAdded`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onMatrixColumnAdded) event instead.
|
|
478
|
+
* @see onCollectionItemAllowOperations
|
|
479
|
+
*/
|
|
457
480
|
onItemValueAdded: CreatorEvent;
|
|
458
481
|
/**
|
|
459
|
-
*
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
482
|
+
* An event that is raised when users add a new column to a [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) or [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model). Use this event to modify this column.
|
|
483
|
+
*
|
|
484
|
+
* Parameters:
|
|
485
|
+
*
|
|
486
|
+
* - `sender`: `CreatorBase`\
|
|
487
|
+
* A Survey Creator instance that raised the event.
|
|
488
|
+
* - `options.matrix`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
|
|
489
|
+
* A Multi-Select or Dynamic Matrix to which a new column is being added.
|
|
490
|
+
* - `options.newColumn`: [`MatrixDropdownColumn`](https://surveyjs.io/form-library/documentation/api-reference/matrixdropdowncolumn)\
|
|
491
|
+
* A new matrix column. Edit its properties if you want to modify this column.
|
|
492
|
+
* - `options.columns`: [`MatrixDropdownColumn[]`](https://surveyjs.io/form-library/documentation/api-reference/matrixdropdowncolumn)\
|
|
493
|
+
* An array of matrix columns. This array does not include `options.newColumn`.
|
|
494
|
+
*
|
|
495
|
+
* > This event is not raised when users add a new column to a [Single-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model). For this case, handle the [`onItemValueAdded`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onItemValueAdded) event instead.
|
|
496
|
+
* @see onCollectionItemAllowOperations
|
|
464
497
|
*/
|
|
465
498
|
onMatrixColumnAdded: CreatorEvent;
|
|
466
499
|
/**
|
|
467
|
-
* Use this event to
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
500
|
+
* An event that is raised when a table property editor is created in the Property Grid. Use this event to configure the table property editor.
|
|
501
|
+
*
|
|
502
|
+
* Parameters:
|
|
503
|
+
*
|
|
504
|
+
* - `sender`: `CreatorBase`\
|
|
505
|
+
* A Survey Creator instance that raised the event.
|
|
506
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
507
|
+
* A survey element (survey, page, panel, question) for which the table property editor is created.
|
|
508
|
+
* - `options.propertyName`: `string`\
|
|
509
|
+
* The name of the property with which the editor is associated: [`"columns"`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#columns), [`"rows"`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model#rows), [`"choices"`](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choices), etc.
|
|
510
|
+
* - `options.editorOptions.allowAddRemoveItems`: `boolean`\
|
|
511
|
+
* A Boolean property that you can set to `false` if you want to disallow users to add and delete table rows.
|
|
512
|
+
* - `options.editorOptions.allowRemoveAllItems`: `boolean`\
|
|
513
|
+
* A Boolean property that you can set to `false` if you want to disallow users to delete all table rows.
|
|
514
|
+
* - `options.editorOptions.allowBatchEdit`: `boolean`\
|
|
515
|
+
* A Boolean property that you can set to `false` if you want to disallow users to edit table content as text in a pop-up window.
|
|
516
|
+
* @see onPropertyEditorCreated
|
|
476
517
|
*/
|
|
477
518
|
onSetPropertyEditorOptions: CreatorEvent;
|
|
478
519
|
onGenerateNewName: CreatorEvent;
|
|
@@ -522,7 +563,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
522
563
|
* - `sender`: `CreatorBase`\
|
|
523
564
|
* A Survey Creator instance that raised the event.
|
|
524
565
|
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
525
|
-
* A survey element (question, panel, page, or the survey itself) whose property
|
|
566
|
+
* A survey element (question, panel, page, or the survey itself) whose property has changed.
|
|
526
567
|
* - `options.propertyName`: `string`\
|
|
527
568
|
* The name of the modified property.
|
|
528
569
|
* - `options.value`: `any`\
|
|
@@ -532,21 +573,24 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
532
573
|
*/
|
|
533
574
|
onSurveyPropertyValueChanged: CreatorEvent;
|
|
534
575
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
*
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
576
|
+
* An event that is raised when a condition editor renders a list of questions available for selection. Use this event to modify this list.
|
|
577
|
+
*
|
|
578
|
+
* Parameters:
|
|
579
|
+
*
|
|
580
|
+
* - `sender`: `CreatorBase`\
|
|
581
|
+
* A Survey Creator instance that raised the event.
|
|
582
|
+
* - `options.obj`: [`Survey.Base`](https://surveyjs.io/form-library/documentation/api-reference/base)\
|
|
583
|
+
* A survey element (question, panel, page, or the survey itself) for which the condition editor is displayed.
|
|
584
|
+
* - `options.propertyName`: `string`\
|
|
585
|
+
* The name of a property being configured: `enableIf`, `requiredIf`, `visibleIf`, etc.
|
|
586
|
+
* - `options.editor`: `any`\
|
|
587
|
+
* A condition editor instance.
|
|
588
|
+
* - `options.list`: `any`\
|
|
589
|
+
* A list of questions available for selection.
|
|
590
|
+
* - `options.sortOrder`: `"asc"` (default) | `"none"`\
|
|
591
|
+
* The sort order of questions within the list. Set this property to `"none"` to disable sorting.
|
|
549
592
|
*/
|
|
593
|
+
onConditionQuestionsGetList: CreatorEvent;
|
|
550
594
|
onConditionGetTitle: CreatorEvent;
|
|
551
595
|
/**
|
|
552
596
|
* An event that is raised when Survey Creator populates a condition editor with operators. Use this event to hide individual condition operators.
|
|
@@ -563,19 +607,23 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
563
607
|
* A condition opeator for which the event is raised.
|
|
564
608
|
* - `options.show`: `boolean`\
|
|
565
609
|
* A Boolean property that you can set to `false` if you want to hide the condition operator.
|
|
566
|
-
*
|
|
567
610
|
*/
|
|
568
611
|
onGetConditionOperator: CreatorEvent;
|
|
569
612
|
/**
|
|
570
|
-
*
|
|
613
|
+
* An event that is raised when the Logic tab constructs a user-friendly display text for a logic rule. Use this event to modify this display text.
|
|
571
614
|
*
|
|
572
|
-
*
|
|
615
|
+
* Parameters:
|
|
573
616
|
*
|
|
574
|
-
* - `sender`
|
|
575
|
-
*
|
|
576
|
-
* - `options.
|
|
577
|
-
*
|
|
578
|
-
* - `options.
|
|
617
|
+
* - `sender`: `CreatorBase`\
|
|
618
|
+
* A Survey Creator instance that raised the event.
|
|
619
|
+
* - `options.expression`: `string`\
|
|
620
|
+
* A logical expression associated with the logic rule.
|
|
621
|
+
* - `options.expressionText`: `string`\
|
|
622
|
+
* The same expression in a user-friendly format.
|
|
623
|
+
* - `options.logicItem`: `SurveyLogicItem`\
|
|
624
|
+
* An object that describes the logic rule. Contains an array of actions and other properties.
|
|
625
|
+
* - `options.text`: `string`\
|
|
626
|
+
* A user-friendly display text for the logic rule. Modify this parameter if you want to override the display text.
|
|
579
627
|
*/
|
|
580
628
|
onLogicItemDisplayText: CreatorEvent;
|
|
581
629
|
/**
|
|
@@ -634,6 +682,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
634
682
|
* - `options.source` - A dragged element.
|
|
635
683
|
* - `options.target` - A drop target.
|
|
636
684
|
* - `options.newElement` - A new element. This parameter is defined only if users drag a question or panel from the Toolbox.
|
|
685
|
+
* @see state
|
|
637
686
|
*/
|
|
638
687
|
onModified: CreatorEvent;
|
|
639
688
|
/**
|
|
@@ -712,6 +761,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
712
761
|
* [Design Mode Survey Instance](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#design-mode-survey-instance (linkStyle))
|
|
713
762
|
*
|
|
714
763
|
* > If you want this event raised at startup, assign a survey JSON schema to the [`JSON`](#JSON) property *after* you add a handler to the event. If the JSON schema should be empty, specify the `JSON` property with an empty object.
|
|
764
|
+
* @see survey
|
|
715
765
|
*/
|
|
716
766
|
onDesignerSurveyCreated: CreatorEvent;
|
|
717
767
|
/**
|
|
@@ -731,9 +781,15 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
731
781
|
onPreviewSurveyCreated: CreatorEvent;
|
|
732
782
|
onTestSurveyCreated: CreatorEvent;
|
|
733
783
|
/**
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
|
|
784
|
+
* An event that is raised when Survey Creator [displays a toast notification](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#notify). Use this event to implement custom toast notification.
|
|
785
|
+
*
|
|
786
|
+
* Parameters:
|
|
787
|
+
*
|
|
788
|
+
* - `sender`: `CreatorBase`\
|
|
789
|
+
* A Survey Creator instance that raised the event.
|
|
790
|
+
* - `options.message`: `string`\
|
|
791
|
+
* A message to display.
|
|
792
|
+
* @see notify
|
|
737
793
|
*/
|
|
738
794
|
onNotify: CreatorEvent;
|
|
739
795
|
/**
|
|
@@ -776,15 +832,23 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
776
832
|
* A choice item for which the event is raised. This parameter has a value only when the dialog window is opened to select images for an [Image Picker](https://surveyjs.io/form-library/documentation/api-reference/image-picker-question-model) question.
|
|
777
833
|
* - `options.callback: (files: Array<File>)`: `Function`\
|
|
778
834
|
* A callback function to which you should pass selected files.
|
|
835
|
+
* @see onUploadFile
|
|
779
836
|
* @see uploadFiles
|
|
780
837
|
*/
|
|
781
838
|
onOpenFileChooser: CreatorEvent;
|
|
782
839
|
/**
|
|
783
|
-
*
|
|
840
|
+
* An event that is raised when a user selects a file to upload. Use this event to upload the file to your server.
|
|
784
841
|
*
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
* - `
|
|
842
|
+
* Parameters:
|
|
843
|
+
*
|
|
844
|
+
* - `sender`: `CreatorBase`\
|
|
845
|
+
* A Survey Creator instance that raised the event.
|
|
846
|
+
* - `options.question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
|
|
847
|
+
* A question for which files are being uploaded.
|
|
848
|
+
* - `options.files`: [`File[]`](https://developer.mozilla.org/en-US/docs/Web/API/File)\
|
|
849
|
+
* Files to upload.
|
|
850
|
+
* - `options.callback(status: string, fileUrl: string)`: `Function`\
|
|
851
|
+
* A callback function that you should call when a file is uploaded successfully or when file upload fails. Pass `"success"` or `"error"` as the `status` argument. If the file upload is successful, pass the file's URL as the `fileUrl` argument.
|
|
788
852
|
*
|
|
789
853
|
* [View Demo](https://surveyjs.io/survey-creator/examples/file-upload/ (linkStyle))
|
|
790
854
|
* @see uploadFiles
|
|
@@ -982,15 +1046,15 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
982
1046
|
* - `options.messageText`: `string`\
|
|
983
1047
|
* A notification message that you want to display. Assign a custom string value to this parameter.
|
|
984
1048
|
* - `options.actionText`: `string`\
|
|
985
|
-
* A caption text for the action
|
|
1049
|
+
* A caption text for the action link. Assign a custom string value to this parameter.
|
|
986
1050
|
* - `options.onClick`: `function`\
|
|
987
|
-
* A function that is called when users click the action
|
|
1051
|
+
* A function that is called when users click the action link. Assign a custom function to this parameter.
|
|
988
1052
|
*
|
|
989
|
-
* A message panel
|
|
1053
|
+
* A message panel is displayed within a question box on the design surface. It contains a text message and an optional action link. The following image illustrates a built-in message panel that appears when a question sources its choice options from another question or from a web service:
|
|
990
1054
|
*
|
|
991
1055
|
* <img src="https://surveyjs.io/stay-updated/release-notes/articles/v1.9.126/creator-message-panel.png" alt="Survey Creator: A message panel" width="75%">
|
|
992
1056
|
*
|
|
993
|
-
* To create a custom message panel, handle the `onCreateCustomMessagePanel` event. This event is raised for questions whose `isMessagePanelVisible` property set to `true`. The following code shows how to enable this property based on a condition. This code implements a custom data source selector for select-based questions (Dropdown, Checkboxes, Radio Button Group). When a survey author selects any data source other than "Custom", the `isMessagePanelVisible` property becomes enabled, indicating that the `onCreateCustomMessagePanel` event must be raised. A function that handles this event specifies custom message and action
|
|
1057
|
+
* To create a custom message panel, handle the `onCreateCustomMessagePanel` event. This event is raised for questions whose `isMessagePanelVisible` property set to `true`. The following code shows how to enable this property based on a condition. This code implements a custom data source selector for select-based questions (Dropdown, Checkboxes, Radio Button Group). When a survey author selects any data source other than "Custom", the `isMessagePanelVisible` property becomes enabled, indicating that the `onCreateCustomMessagePanel` event must be raised. A function that handles this event specifies custom message and action link texts and `onClick` event handler:
|
|
994
1058
|
*
|
|
995
1059
|
* ```js
|
|
996
1060
|
* import { Serializer } from "survey-core";
|
|
@@ -1033,7 +1097,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1033
1097
|
};
|
|
1034
1098
|
setSurveyJSONTextCallback: (text: string) => void;
|
|
1035
1099
|
/**
|
|
1036
|
-
* Limits the number of items in a logical
|
|
1100
|
+
* Limits the number of items in a logical condition.
|
|
1037
1101
|
*
|
|
1038
1102
|
* Default value: -1 (unlimited)
|
|
1039
1103
|
*/
|
|
@@ -1067,7 +1131,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1067
1131
|
* If you set this property to `false`, users can only use UI elements to edit logical expressions.
|
|
1068
1132
|
*
|
|
1069
1133
|
* Default value: `true`
|
|
1070
|
-
*
|
|
1071
1134
|
* @see showLogicTab
|
|
1072
1135
|
*/
|
|
1073
1136
|
allowEditExpressionsInTextEditor: boolean;
|
|
@@ -1199,10 +1262,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1199
1262
|
*/
|
|
1200
1263
|
get showInvisibleElementsInPreviewTab(): boolean;
|
|
1201
1264
|
set showInvisibleElementsInPreviewTab(val: boolean);
|
|
1202
|
-
/**
|
|
1203
|
-
* Set this property to true if you want to show "page selector" in the toolabar instead of "pages editor"
|
|
1204
|
-
*/
|
|
1205
|
-
showPageSelectorInToolbar: boolean;
|
|
1206
1265
|
/**
|
|
1207
1266
|
* Specifies whether users can switch between UI themes in the Preview tab.
|
|
1208
1267
|
*
|
|
@@ -1215,21 +1274,20 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1215
1274
|
tabbedMenu: AdaptiveActionContainer<TabbedMenuItem>;
|
|
1216
1275
|
get tabs(): Array<TabbedMenuItem>;
|
|
1217
1276
|
set tabs(val: Array<TabbedMenuItem>);
|
|
1218
|
-
/**
|
|
1219
|
-
* Returns the localized string by its id
|
|
1220
|
-
* @param str the string id.
|
|
1221
|
-
*/
|
|
1222
1277
|
getLocString(str: string): string;
|
|
1223
1278
|
/**
|
|
1224
|
-
* Specifies whether to show an error message if a survey is not saved in
|
|
1279
|
+
* Specifies whether to show an error message if a survey is not saved in a database.
|
|
1225
1280
|
*
|
|
1226
1281
|
* Default value: `true`
|
|
1227
1282
|
*/
|
|
1228
1283
|
showErrorOnFailedSave: boolean;
|
|
1229
1284
|
protected onSetReadOnly(newVal: boolean): void;
|
|
1230
1285
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1286
|
+
* Specifies the locale of the Survey Creator UI.
|
|
1287
|
+
*
|
|
1288
|
+
* Default value: `""` (inherited from `editorLocalization.currentLocale`)
|
|
1289
|
+
*
|
|
1290
|
+
* [Localization & Globalization](https://surveyjs.io/survey-creator/documentation/survey-localization-translate-surveys-to-different-languages (linkStyle))
|
|
1233
1291
|
*/
|
|
1234
1292
|
get locale(): string;
|
|
1235
1293
|
set locale(value: string);
|
|
@@ -1311,7 +1369,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1311
1369
|
showSidebarValue: boolean;
|
|
1312
1370
|
onShowSidebarVisibilityChanged: CreatorEvent;
|
|
1313
1371
|
/**
|
|
1314
|
-
* Specifies whether to show the sidebar that displays Property Grid.
|
|
1372
|
+
* Specifies whether to show the sidebar that displays the Property Grid.
|
|
1315
1373
|
*
|
|
1316
1374
|
* Default value: `true`
|
|
1317
1375
|
* @see sidebarLocation
|
|
@@ -1403,7 +1461,8 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1403
1461
|
isCanModifyProperty(obj: Base, propertyName: string): boolean;
|
|
1404
1462
|
onIsPropertyReadOnlyCallback(obj: Base, property: JsonObjectProperty, readOnly: boolean, parentObj: Base, parentProperty: JsonObjectProperty): boolean;
|
|
1405
1463
|
/**
|
|
1406
|
-
*
|
|
1464
|
+
* A [survey](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model) being configured in the Designer tab.
|
|
1465
|
+
* @see onDesignerSurveyCreated
|
|
1407
1466
|
*/
|
|
1408
1467
|
get survey(): SurveyModel;
|
|
1409
1468
|
private existingPages;
|
|
@@ -1478,11 +1537,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1478
1537
|
protected setSurvey(survey: SurveyModel): void;
|
|
1479
1538
|
private getSurveyTextFromDesigner;
|
|
1480
1539
|
protected setTextValue(value: string): void;
|
|
1481
|
-
/**
|
|
1482
|
-
* Set JSON as text into survey. Clear undo/redo states optionally.
|
|
1483
|
-
* @param value JSON as text
|
|
1484
|
-
* @param clearState default false. Set this parameter to true to clear undo/redo states.
|
|
1485
|
-
*/
|
|
1486
1540
|
changeText(value: string, clearState?: boolean): void;
|
|
1487
1541
|
/**
|
|
1488
1542
|
* A survey JSON schema as a string.
|
|
@@ -1497,7 +1551,15 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1497
1551
|
protected createSurveyCore(json: any, reason: string): SurveyModel;
|
|
1498
1552
|
private _stateValue;
|
|
1499
1553
|
/**
|
|
1500
|
-
*
|
|
1554
|
+
* Indicates the state of Survey Creator.
|
|
1555
|
+
*
|
|
1556
|
+
* Possible values:
|
|
1557
|
+
*
|
|
1558
|
+
* - `""` - Survey Creator doesn't have unsaved changes.
|
|
1559
|
+
* - `"modified"` - Survey Creator has unsaved changes.
|
|
1560
|
+
* - `"saving"` - Changes are being saved.
|
|
1561
|
+
* - `"saved"` - Changes are successfully saved.
|
|
1562
|
+
* @see onModified
|
|
1501
1563
|
*/
|
|
1502
1564
|
get state(): string;
|
|
1503
1565
|
protected setState(value: string): void;
|
|
@@ -1507,10 +1569,13 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1507
1569
|
notifySurveyPropertyChanged(options: any): void;
|
|
1508
1570
|
notifySurveyItemMoved(options: any): void;
|
|
1509
1571
|
/**
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1572
|
+
* Displays a toast notification with a specified message.
|
|
1573
|
+
*
|
|
1574
|
+
* If you want to implement custom toast notification from scratch, handle the [`onNotify`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onNotify) event.
|
|
1575
|
+
* @param message A message to display.
|
|
1576
|
+
* @param type A notification type: `"info"` (default) or `"error"`.
|
|
1512
1577
|
*/
|
|
1513
|
-
notify(
|
|
1578
|
+
notify(message: string, type?: "info" | "error"): void;
|
|
1514
1579
|
protected convertQuestion(obj: Question, className: string): Question;
|
|
1515
1580
|
private getDefaultElementJSON;
|
|
1516
1581
|
private singlePageJSON;
|
|
@@ -1538,8 +1603,9 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1538
1603
|
createNewElement(json: any): IElement;
|
|
1539
1604
|
copyElement(element: Base): IElement;
|
|
1540
1605
|
/**
|
|
1541
|
-
*
|
|
1542
|
-
* @param question A
|
|
1606
|
+
* Creates a copy of a specified question and inserts the copy next to this question.
|
|
1607
|
+
* @param question A question to copy.
|
|
1608
|
+
* @returns The instance of a new question.
|
|
1543
1609
|
*/
|
|
1544
1610
|
fastCopyQuestion(question: Base): IElement;
|
|
1545
1611
|
/**
|
|
@@ -1566,8 +1632,11 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1566
1632
|
*/
|
|
1567
1633
|
deleteElement(element: Base): void;
|
|
1568
1634
|
/**
|
|
1569
|
-
*
|
|
1570
|
-
* @param page A
|
|
1635
|
+
* Creates a copy of a specified page and inserts the copy next to this page.
|
|
1636
|
+
* @param page A [page](https://surveyjs.io/form-library/documentation/api-reference/page-model) to copy.
|
|
1637
|
+
* @returns The [instance of a new page](https://surveyjs.io/form-library/documentation/api-reference/page-model).
|
|
1638
|
+
* @see onPageAdding
|
|
1639
|
+
* @see onPageAdded
|
|
1571
1640
|
*/
|
|
1572
1641
|
copyPage(page: PageModel): PageModel;
|
|
1573
1642
|
protected deleteObjectCore(obj: any): void;
|
|
@@ -1616,8 +1685,9 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1616
1685
|
*/
|
|
1617
1686
|
validateSelectedElement(): boolean;
|
|
1618
1687
|
/**
|
|
1619
|
-
* Deletes all custom translation strings for
|
|
1688
|
+
* Deletes all custom translation strings for a specified locale from Survey Creator and from the generated survey JSON schema.
|
|
1620
1689
|
* @param locale A locale code (for example, "en").
|
|
1690
|
+
* @see locale
|
|
1621
1691
|
*/
|
|
1622
1692
|
deleteLocaleStrings(locale: string): void;
|
|
1623
1693
|
private getPropertyGridExpandedCategory;
|
|
@@ -1627,20 +1697,24 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1627
1697
|
clickToolboxItem(newElement: any, panel?: IPanel, modifiedType?: string): void;
|
|
1628
1698
|
getJSONForNewElement(json: any): any;
|
|
1629
1699
|
/**
|
|
1630
|
-
*
|
|
1631
|
-
* @param input file input element
|
|
1632
|
-
* @param
|
|
1700
|
+
* Opens a dialog window for users to select files.
|
|
1701
|
+
* @param input A [file input HTML element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement).
|
|
1702
|
+
* @param callback A callback function that you can use to process selected files. Accepts an array of JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/API/File" target="_blank">File</a> objects.
|
|
1703
|
+
* @see onOpenFileChooser
|
|
1704
|
+
* @see onUploadFile
|
|
1633
1705
|
*/
|
|
1634
|
-
chooseFiles(input: HTMLInputElement,
|
|
1706
|
+
chooseFiles(input: HTMLInputElement, callback: (files: File[]) => void, context?: {
|
|
1635
1707
|
element: SurveyElement;
|
|
1636
1708
|
item?: ItemValue;
|
|
1637
1709
|
}): void;
|
|
1638
1710
|
/**
|
|
1639
|
-
*
|
|
1640
|
-
* @param files files to upload
|
|
1641
|
-
* @param
|
|
1711
|
+
* Uploads files to a server.
|
|
1712
|
+
* @param files An array of JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/API/File" target="_blank">File</a> objects that represent files to upload.
|
|
1713
|
+
* @param question A [question instance](https://surveyjs.io/form-library/documentation/api-reference/question) for which files are uploaded.
|
|
1714
|
+
* @param callback A callback function that indicates the upload status—"success" or "error"—as the first argument. If a file is uploaded successfully, the second argument contains the file's URL.
|
|
1715
|
+
* @see onUploadFile
|
|
1642
1716
|
*/
|
|
1643
|
-
uploadFiles(files: File[], question: Question,
|
|
1717
|
+
uploadFiles(files: File[], question: Question, callback: (status: string, data: any) => any): void;
|
|
1644
1718
|
private _rootElementValue;
|
|
1645
1719
|
get rootElement(): HTMLElement;
|
|
1646
1720
|
setRootElement(element: HTMLElement): void;
|
|
@@ -1689,7 +1763,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1689
1763
|
/**
|
|
1690
1764
|
* A delay between changing survey settings and saving the survey JSON schema, measured in milliseconds. Applies only when the [`isAutoSave`](#isAutoSave) property is `true`.
|
|
1691
1765
|
*
|
|
1692
|
-
* Default value: 500 (
|
|
1766
|
+
* Default value: 500 (inherited from `settings.autoSave.delay`)
|
|
1693
1767
|
*
|
|
1694
1768
|
* If a user changes the settings once again during the delay, only the latest version will be saved.
|
|
1695
1769
|
*/
|
|
@@ -1765,17 +1839,17 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1765
1839
|
isMobileView: boolean;
|
|
1766
1840
|
isTouch: any;
|
|
1767
1841
|
/**
|
|
1768
|
-
* Specifies Toolbox location.
|
|
1842
|
+
* Specifies the Toolbox location.
|
|
1769
1843
|
*
|
|
1770
1844
|
* Possible values:
|
|
1771
1845
|
*
|
|
1772
|
-
* - `"left"` (default) - Displays Toolbox on the left side of the design surface.
|
|
1773
|
-
* - `"right"` - Displays Toolbox on the right side of the design surface.
|
|
1774
|
-
* - `"sidebar"` - Displays Toolbox as an overlay on top of Property Grid. Use the [`sidebarLocation`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#sidebarLocation) property to specify Property Grid position.
|
|
1846
|
+
* - `"left"` (default) - Displays the Toolbox on the left side of the design surface.
|
|
1847
|
+
* - `"right"` - Displays the Toolbox on the right side of the design surface.
|
|
1848
|
+
* - `"sidebar"` - Displays the Toolbox as an overlay on top of the Property Grid. Use the [`sidebarLocation`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#sidebarLocation) property to specify the Property Grid position.
|
|
1775
1849
|
*/
|
|
1776
1850
|
toolboxLocation: toolboxLocationType;
|
|
1777
1851
|
/**
|
|
1778
|
-
* Specifies the position of the sidebar that displays Property Grid. Applies only when [`showSidebar`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#showSidebar) is `true`.
|
|
1852
|
+
* Specifies the position of the sidebar that displays the Property Grid. Applies only when [`showSidebar`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#showSidebar) is `true`.
|
|
1779
1853
|
*
|
|
1780
1854
|
* Possible values:
|
|
1781
1855
|
*
|
|
@@ -1789,6 +1863,11 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
|
|
|
1789
1863
|
dispose(): void;
|
|
1790
1864
|
enableLinkFileEditor: boolean;
|
|
1791
1865
|
}
|
|
1866
|
+
/**
|
|
1867
|
+
* A class with properties, methods, and events that allow you to configure Survey Creator and manage its elements.
|
|
1868
|
+
*
|
|
1869
|
+
* [View Demo](https://surveyjs.io/survey-creator/examples/free-nps-survey-template/ (linkStyle))
|
|
1870
|
+
*/
|
|
1792
1871
|
export declare class SurveyCreatorModel extends CreatorBase {
|
|
1793
1872
|
}
|
|
1794
1873
|
export declare class StylesManager {
|
|
@@ -206,10 +206,10 @@ export interface ISurveyCreatorOptions {
|
|
|
206
206
|
onLogicGetTitleCallback(expression: string, displayExpression: string, text: string, logicItem: any): string;
|
|
207
207
|
getProcessedTranslationItemText(locale: string, locString: ILocalizableString, newText: string, obj: any): string;
|
|
208
208
|
getTranslationExportedText(obj: Base, name: string, locString: ILocalizableString, locale: string, text: string): string;
|
|
209
|
-
uploadFiles(files: File[], question: Question,
|
|
209
|
+
uploadFiles(files: File[], question: Question, callback: (status: string, data: any) => any): void;
|
|
210
210
|
getHasMachineTranslation(): boolean;
|
|
211
211
|
doMachineTranslation(fromLocale: string, toLocale: string, strings: Array<string>, callback: (translated: Array<string>) => void): void;
|
|
212
|
-
chooseFiles(input: HTMLInputElement,
|
|
212
|
+
chooseFiles(input: HTMLInputElement, callback: (files: File[]) => void, context?: {
|
|
213
213
|
element: SurveyElement;
|
|
214
214
|
item?: ItemValue;
|
|
215
215
|
}): void;
|
|
@@ -257,10 +257,10 @@ export declare class EmptySurveyCreatorOptions implements ISurveyCreatorOptions
|
|
|
257
257
|
isConditionOperatorEnabled(questionName: string, question: Question, operator: string, isEnabled: boolean): boolean;
|
|
258
258
|
onLogicGetTitleCallback(expression: string, displayExpression: string, text: string, logicItem: any): string;
|
|
259
259
|
getTranslationExportedText(obj: Base, name: string, locString: ILocalizableString, locale: string, text: string): string;
|
|
260
|
-
uploadFiles(files: File[], question: Question,
|
|
260
|
+
uploadFiles(files: File[], question: Question, callback: (status: string, data: any) => any): void;
|
|
261
261
|
getHasMachineTranslation(): boolean;
|
|
262
262
|
doMachineTranslation(fromLocale: string, toLocale: string, strings: Array<string>, callback: (translated: Array<string>) => void): void;
|
|
263
|
-
chooseFiles(input: HTMLInputElement,
|
|
263
|
+
chooseFiles(input: HTMLInputElement, callback: (files: File[]) => void, context?: {
|
|
264
264
|
element: SurveyElement;
|
|
265
265
|
item?: ItemValue;
|
|
266
266
|
}): void;
|
|
@@ -20,6 +20,6 @@ export declare class QuestionFileEditorModel extends QuestionFileModel {
|
|
|
20
20
|
getChooseButtonCss(): string;
|
|
21
21
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
22
22
|
onFileInputChange: (event: Event) => boolean;
|
|
23
|
-
onChooseFilesCallback: (input: HTMLInputElement,
|
|
23
|
+
onChooseFilesCallback: (input: HTMLInputElement, callback: (files: File[]) => void) => void;
|
|
24
24
|
chooseFiles(event: Event): boolean;
|
|
25
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { JsonObjectProperty } from "survey-core";
|
|
2
2
|
import { ISurveyCreatorOptions } from "../creator-settings";
|
|
3
3
|
export declare class SurveyQuestionEditorPropertyDefinition {
|
|
4
|
-
property:
|
|
4
|
+
property: JsonObjectProperty;
|
|
5
5
|
title: string;
|
|
6
6
|
category: string;
|
|
7
7
|
createdFromTabName: boolean;
|
|
@@ -24,15 +24,15 @@ export declare class SurveyQuestionProperties {
|
|
|
24
24
|
private properties;
|
|
25
25
|
private propertiesHash;
|
|
26
26
|
private tabs;
|
|
27
|
-
constructor(obj: any, options?: ISurveyCreatorOptions, className?: string, showMode?: string, parentObj?: any, parentProperty?:
|
|
28
|
-
getProperty(propertyName: string):
|
|
27
|
+
constructor(obj: any, options?: ISurveyCreatorOptions, className?: string, showMode?: string, parentObj?: any, parentProperty?: JsonObjectProperty);
|
|
28
|
+
getProperty(propertyName: string): JsonObjectProperty;
|
|
29
29
|
get showMode(): string;
|
|
30
30
|
get isEmpty(): boolean;
|
|
31
31
|
private fillPropertiesHash;
|
|
32
32
|
private isJSONPropertyVisible;
|
|
33
33
|
getTabByName(tabName: string): SurveyQuestionEditorTabDefinition;
|
|
34
34
|
getTabs(): Array<SurveyQuestionEditorTabDefinition>;
|
|
35
|
-
getProperties(tab: SurveyQuestionEditorTabDefinition): Array<
|
|
35
|
+
getProperties(tab: SurveyQuestionEditorTabDefinition): Array<JsonObjectProperty>;
|
|
36
36
|
private buildTabs;
|
|
37
37
|
private addPropertyIntoTab;
|
|
38
38
|
private movePropertiesToNextProperties;
|
|
@@ -43,6 +43,8 @@ export declare class SurveyQuestionProperties {
|
|
|
43
43
|
private getTabOrCreate;
|
|
44
44
|
private setUsedProperties;
|
|
45
45
|
private getAllDefinitionsByClass;
|
|
46
|
+
private getAllDefinitionsByClassCore;
|
|
47
|
+
private getAllDefinitionsByClassSingleCore;
|
|
46
48
|
private getJsonPropertyCategory;
|
|
47
49
|
private addNonTabProperties;
|
|
48
50
|
private sortProperties;
|