survey-creator-core 1.9.1-beta.1 → 1.9.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*Type definitions for SurveyJS Creator JavaScript library v1.9.1-beta.1
1
+ /*Type definitions for SurveyJS Creator JavaScript library v1.9.2-beta.1
2
2
  (c) 2015-2021 Devsoft Baltic OÜ - http://surveyjs.io/
3
3
  Github: https://github.com/surveyjs/survey-creator
4
4
  License: https://surveyjs.io/Licenses#SurveyCreator
@@ -6,9 +6,9 @@ License: https://surveyjs.io/Licenses#SurveyCreator
6
6
  // Dependencies for this module:
7
7
  // ../../../survey-core
8
8
 
9
- import { Base, ItemValue, JsonObjectProperty, MatrixDropdownColumn, Question, SurveyModel } from "survey-core";
9
+ import { Base, IAction, ItemValue, JsonObjectProperty, MatrixDropdownColumn, Question, SurveyModel } from "survey-core";
10
10
  import * as Survey from "survey-core";
11
- import { Base, SurveyModel, Question, PageModel, IElement, ActionContainer, AdaptiveActionContainer, IAction, Action, SurveyElement, ItemValue, QuestionSelectBase } from "survey-core";
11
+ import { Base, SurveyModel, Question, PageModel, IElement, ActionContainer, AdaptiveActionContainer, IAction, Action, IPanel, SurveyElement, ItemValue, QuestionSelectBase } from "survey-core";
12
12
  import { DragDropSurveyElements, DragDropChoices } from "survey-core";
13
13
  import { Base, SurveyModel } from "survey-core";
14
14
  import { SurveyModel } from "survey-core";
@@ -22,7 +22,7 @@ import { SurveyModel, Action, QuestionMatrixDynamicModel } from "survey-core";
22
22
  import { PageModel, PopupModel, ListModel, Base, SurveyModel, IAction, Action } from "survey-core";
23
23
  import { PageModel, SurveyModel } from "survey-core";
24
24
  import { Base, SurveyModel, SurveyTemplateRendererTemplateData, QuestionRowModel } from "survey-core";
25
- import { SurveyElement, SurveyModel, SurveyTemplateRendererTemplateData, Action, DragTypeOverMeEnum } from "survey-core";
25
+ import { SurveyElement, SurveyModel, SurveyTemplateRendererTemplateData, Action, PopupModel, ListModel, DragTypeOverMeEnum, IAction } from "survey-core";
26
26
  import { SurveyElement, SurveyTemplateRendererTemplateData, SurveyModel } from "survey-core";
27
27
  import { SurveyElement, SurveyTemplateRendererTemplateData, SurveyModel, QuestionRatingModel } from "survey-core";
28
28
  import { Base, ItemValue, QuestionSelectBase, SurveyModel } from "survey-core";
@@ -1808,6 +1808,7 @@ export interface ISurveyCreatorOptions {
1808
1808
  getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
1809
1809
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
1810
1810
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): any;
1811
+ onPropertyEditorUpdateTitleActionsCallback(object: any, property: JsonObjectProperty, editor: Question, titleActions: IAction[]): any;
1811
1812
  onIsPropertyReadOnlyCallback(obj: Base, property: JsonObjectProperty, readOnly: boolean, parentObj: Base, parentProperty: JsonObjectProperty): boolean;
1812
1813
  onCanDeleteItemCallback(object: any, item: Base, allowDelete: boolean): boolean;
1813
1814
  onCollectionItemDeletingCallback(obj: Base, property: JsonObjectProperty, collection: Array<Base>, item: Base): boolean;
@@ -1838,6 +1839,7 @@ export declare class EmptySurveyCreatorOptions implements ISurveyCreatorOptions
1838
1839
  getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
1839
1840
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
1840
1841
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): void;
1842
+ onPropertyEditorUpdateTitleActionsCallback(object: any, property: JsonObjectProperty, editor: Question, titleActions: IAction[]): void;
1841
1843
  onIsPropertyReadOnlyCallback(obj: Base, property: JsonObjectProperty, readOnly: boolean, parentObj: Base, parentProperty: JsonObjectProperty): boolean;
1842
1844
  onCanDeleteItemCallback(object: any, item: Base, allowDelete: boolean): boolean;
1843
1845
  onCollectionItemDeletingCallback(obj: Base, property: JsonObjectProperty, collection: Array<Base>, item: Base): boolean;
@@ -1857,6 +1859,7 @@ export declare class EmptySurveyCreatorOptions implements ISurveyCreatorOptions
1857
1859
 
1858
1860
  import "./components/creator.scss";
1859
1861
  import "./components/string-editor.scss";
1862
+ import "./creator-theme/creator.scss";
1860
1863
  export interface IKeyboardShortcut {
1861
1864
  name?: string;
1862
1865
  hotKey: {
@@ -2090,14 +2093,23 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2090
2093
  */
2091
2094
  onPropertyEditorCreated: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2092
2095
  /**
2093
- * The event is called before rendering a delete button in the Property Grid or in Question Editor.
2094
- * Obsolete, please use onCollectionItemAllowOperations
2095
- * <br/> sender the survey creator object that fires the event
2096
- * <br/> options.obj the survey Question
2097
- * <br/> options.item the object property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties
2098
- * <br/> 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
2099
- * @see onCollectionItemAllowOperations
2096
+ * The event is called after a property editor setups its title actions.
2097
+ * You can use this event to modify the property editor title actions
2098
+ * <br/> options.obj the survey object that is currently editing in the property grid
2099
+ * <br/> options.property the property that the current property editor is editing
2100
+ * <br/> options.editor the property editor. In fact it is a survey question. We are using a heavily customizable survey as a property grid in Creator V2. It means that every property editor is a question.
2101
+ * <br/> options.titleActions the list of title actions.
2100
2102
  */
2103
+ onPropertyEditorUpdateTitleActions: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2104
+ /**
2105
+ * The event is called before rendering a delete button in the Property Grid or in Question Editor.
2106
+ * Obsolete, please use onCollectionItemAllowOperations
2107
+ * <br/> sender the survey creator object that fires the event
2108
+ * <br/> options.obj the survey Question
2109
+ * <br/> options.item the object property (Survey.JsonObjectProperty object). It has name, className, type, visible, readOnly and other properties
2110
+ * <br/> 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
2111
+ * @see onCollectionItemAllowOperations
2112
+ */
2101
2113
  onCanDeleteItem: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2102
2114
  /**
2103
2115
  * 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.
@@ -2576,7 +2588,7 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2576
2588
  get JSON(): any;
2577
2589
  set JSON(val: any);
2578
2590
  loadSurvey(surveyId: string): void;
2579
- protected doClickQuestionCore(element: IElement, modifiedType?: string, index?: number): void;
2591
+ protected doClickQuestionCore(element: IElement, modifiedType?: string, index?: number, panel?: IPanel): void;
2580
2592
  setNewNames(element: Survey.ISurveyElement): void;
2581
2593
  protected getAllQuestions(): Array<any>;
2582
2594
  protected getAllPanels(): Array<any>;
@@ -2680,7 +2692,7 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2680
2692
  * Returns true if selected element is null or there is no errors.
2681
2693
  */
2682
2694
  validateSelectedElement(): boolean;
2683
- clickToolboxItem(newElement: any): void;
2695
+ clickToolboxItem(newElement: any, panel?: IPanel): void;
2684
2696
  getJSONForNewElement(json: any): any;
2685
2697
  /**
2686
2698
  * Open file chooser dialog
@@ -2709,6 +2721,7 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2709
2721
  set alwaySaveTextInPropertyEditors(value: boolean);
2710
2722
  onCanShowPropertyCallback(object: any, property: Survey.JsonObjectProperty, showMode: string, parentObj: any, parentProperty: Survey.JsonObjectProperty): boolean;
2711
2723
  onPropertyEditorCreatedCallback(object: any, property: Survey.JsonObjectProperty, editor: Question): void;
2724
+ onPropertyEditorUpdateTitleActionsCallback(object: any, property: Survey.JsonObjectProperty, editor: Question, titleActions: IAction[]): void;
2712
2725
  onCanDeleteItemCallback(object: any, item: Survey.Base, allowDelete: boolean): boolean;
2713
2726
  onCollectionItemDeletingCallback(obj: Survey.Base, property: Survey.JsonObjectProperty, collection: Array<Survey.Base>, item: Survey.Base): boolean;
2714
2727
  onCollectionItemAllowingCallback(obj: Base, property: Survey.JsonObjectProperty, collection: Array<Base>, item: Base, itemOptions: ICollectionItemAllowOperations): void;
@@ -2737,15 +2750,16 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2737
2750
  get saveSurveyFunc(): any;
2738
2751
  set saveSurveyFunc(value: any);
2739
2752
  convertCurrentQuestion(newType: string): void;
2753
+ getAddNewQuestionText(currentAddQuestionType?: string): any;
2740
2754
  get addNewQuestionText(): any;
2741
- getQuestionTypeSelectorModel(beforeAdd: () => void): {
2755
+ getQuestionTypeSelectorModel(beforeAdd: (type: string) => void, panel?: IPanel): {
2742
2756
  iconName: string;
2743
2757
  action: () => void;
2744
2758
  popupModel: Survey.PopupModel<{
2745
2759
  model: Survey.ListModel;
2746
2760
  }>;
2747
2761
  };
2748
- addNewQuestionInPage(beforeAdd: () => void): void;
2762
+ addNewQuestionInPage(beforeAdd: (string: any) => void, panel?: IPanel, type?: string): void;
2749
2763
  createIActionBarItemByClass(className: string, title?: string): Action;
2750
2764
  onElementMenuItemsChanged(element: any, items: Action[]): void;
2751
2765
  getElementAllowOperations(element: SurveyElement): any;
@@ -3525,6 +3539,7 @@ export declare class TabDesignerViewModel<T extends SurveyModel> extends Base {
3525
3539
  get isToolboxVisible(): boolean;
3526
3540
  initSurvey(): void;
3527
3541
  dispose(): void;
3542
+ clickDesigner(): void;
3528
3543
  getDesignerCss(): string;
3529
3544
  getRootCss(): string;
3530
3545
  }
@@ -3538,6 +3553,7 @@ export declare class TabDesignerPlugin<T extends SurveyModel> implements ICreato
3538
3553
  deactivate(): boolean;
3539
3554
  update(): void;
3540
3555
  createActions(): Action[];
3556
+ selectSurvey(): void;
3541
3557
  addFooterActions(): void;
3542
3558
  }
3543
3559
 
@@ -3932,6 +3948,7 @@ export declare class PageViewModel<T extends SurveyModel> extends ActionContaine
3932
3948
  isPageLive: boolean;
3933
3949
  onPageSelectedCallback: () => void;
3934
3950
  questionTypeSelectorModel: any;
3951
+ currentAddQuestionType: string;
3935
3952
  constructor(creator: CreatorBase<T>, page: PageModel);
3936
3953
  protected onElementSelectedChanged(isSelected: boolean): void;
3937
3954
  dispose(): void;
@@ -3961,6 +3978,7 @@ import "./question.scss";
3961
3978
  export declare class QuestionAdornerViewModel extends ActionContainerViewModel<SurveyModel> {
3962
3979
  templateData: SurveyTemplateRendererTemplateData;
3963
3980
  isDragged: boolean;
3981
+ currentAddQuestionType: string;
3964
3982
  constructor(creator: CreatorBase<SurveyModel>, surveyElement: SurveyElement, templateData: SurveyTemplateRendererTemplateData);
3965
3983
  select(model: QuestionAdornerViewModel, event: IPortableMouseEvent): boolean;
3966
3984
  rootCss(): "" | " svc-question__adorner--start-with-new-line";
@@ -3977,8 +3995,18 @@ export declare class QuestionAdornerViewModel extends ActionContainerViewModel<S
3977
3995
  set isRequired(newVal: any);
3978
3996
  startDragSurveyElement(event: PointerEvent): boolean;
3979
3997
  get allowEdit(): boolean;
3998
+ getConvertToTypesActions(): Array<IAction>;
3980
3999
  protected buildActions(items: Array<Action>): void;
3981
4000
  protected duplicate(): void;
4001
+ addNewQuestion(): void;
4002
+ questionTypeSelectorModel: {
4003
+ iconName: string;
4004
+ action: () => void;
4005
+ popupModel: PopupModel<{
4006
+ model: ListModel;
4007
+ }>;
4008
+ };
4009
+ get addNewQuestionText(): string;
3982
4010
  }
3983
4011
 
3984
4012
  import "./question-image.scss";
@@ -4417,7 +4445,9 @@ export declare abstract class PropertyGridEditor implements IPropertyGridEditor
4417
4445
  constructor();
4418
4446
  abstract fit(prop: JsonObjectProperty): boolean;
4419
4447
  abstract getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
4420
- showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): any;
4448
+ showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions, onClose?: (reason: "apply" | "cancel") => void): any;
4449
+ protected onModalPropertyEditorShown(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): void;
4450
+ protected onModalPropertyEditorClosed(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions, reason: "apply" | "cancel"): void;
4421
4451
  }
4422
4452
  export declare class PropertyGridEditorBoolean extends PropertyGridEditor {
4423
4453
  fit(prop: JsonObjectProperty, context?: string): boolean;
@@ -4648,8 +4678,10 @@ export declare class PropertyGridEditorQuestionRestfull extends PropertyGridEdit
4648
4678
  export declare class QuestionLinkValueModel extends Question {
4649
4679
  linkClickCallback: () => void;
4650
4680
  resetClickCallback: () => void;
4681
+ isSelected: boolean;
4651
4682
  linkValueText: string;
4652
4683
  showClear: boolean;
4684
+ allowClear: boolean;
4653
4685
  showValueInLink: boolean;
4654
4686
  constructor(name: string, json?: any);
4655
4687
  protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
@@ -4978,7 +5010,7 @@ export declare var propertyGridCss: {
4978
5010
  export declare class QuestionConverter {
4979
5011
  static convertInfo: {};
4980
5012
  static addConvertInfo(className: string, convertToClassName: string): void;
4981
- static getConvertToClasses(className: string, availableTypes?: Array<string>): Array<string>;
5013
+ static getConvertToClasses(className: string, availableTypes?: Array<string>, includeCurrent?: boolean): Array<string>;
4982
5014
  static convertObject(obj: Survey.Question, convertToClass: string): Survey.Question;
4983
5015
  }
4984
5016
 
@@ -5819,7 +5851,9 @@ export declare abstract class PropertyGridEditor implements IPropertyGridEditor
5819
5851
  constructor();
5820
5852
  abstract fit(prop: JsonObjectProperty): boolean;
5821
5853
  abstract getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
5822
- showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): any;
5854
+ showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions, onClose?: (reason: "apply" | "cancel") => void): any;
5855
+ protected onModalPropertyEditorShown(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): void;
5856
+ protected onModalPropertyEditorClosed(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions, reason: "apply" | "cancel"): void;
5823
5857
  }
5824
5858
  export declare class PropertyGridEditorBoolean extends PropertyGridEditor {
5825
5859
  fit(prop: JsonObjectProperty, context?: string): boolean;