survey-creator-core 1.9.27 → 1.9.30

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,10 +1,10 @@
1
1
  /*
2
- * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.27
2
+ * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.30
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - https://surveyjs.io/
4
4
  * License: https://surveyjs.io/Licenses#SurveyCreator
5
5
  */
6
- import { Base, JsonObjectProperty, Question, ItemValue, MatrixDropdownColumn } from "survey-core";
7
- import { IAction, SurveyModel, Action, ActionContainer, DragDropSurveyElements } from "survey-core";
6
+ import { Base, JsonObjectProperty, Question, SurveyModel, ItemValue } from "survey-core";
7
+ import { MatrixDropdownColumn, IAction, Action, ActionContainer, DragDropSurveyElements } from "survey-core";
8
8
  import { DragDropChoices, Event, AdaptiveActionContainer, PageModel, IElement } from "survey-core";
9
9
  import { IPanel, ISurveyElement, SurveyElement, QuestionSelectBase, QuestionRowModel } from "survey-core";
10
10
  import { LocalizableString, DragOrClickHelper, PanelModel, QuestionDropdownModel, ListModel } from "survey-core";
@@ -45,6 +45,7 @@ export interface ISurveyCreatorOptions {
45
45
  getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
46
46
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
47
47
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): any;
48
+ onPropertyGridSurveyCreatedCallback(object: any, survey: SurveyModel): any;
48
49
  onPropertyEditorUpdateTitleActionsCallback(object: any, property: JsonObjectProperty, editor: Question, titleActions: any): any;
49
50
  onIsPropertyReadOnlyCallback(obj: Base, property: JsonObjectProperty, readOnly: boolean, parentObj: Base, parentProperty: JsonObjectProperty): boolean;
50
51
  onCanDeleteItemCallback(object: any, item: Base, allowDelete: boolean): boolean;
@@ -458,6 +459,13 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
458
459
  onShowingProperty: Event<(sender: CreatorBase, options: any) => any, any>;
459
460
  onCanShowProperty: Event<(sender: CreatorBase, options: any) => any, any>;
460
461
  /*
462
+ * The event is called after a survey that represents the Property Grid is created and all its questions (property editors) are setup.
463
+ * You can use this event to modify this survey to change the property grid behavior
464
+ * <br/> options.obj the survey object that is currently editing in the property grid
465
+ * <br/> options.survey the property grid survey
466
+ */
467
+ onPropertyGridSurveyCreated: Event<(sender: CreatorBase, options: any) => any, any>;
468
+ /*
461
469
  * The event is called after a property editor (in fact a survey question) has been created and all it's properties have been assign.
462
470
  * You can use this event to modify the property editor properties or set event handlers to customize it's behavior
463
471
  * <br/> options.obj the survey object that is currently editing in the property grid
@@ -566,6 +574,14 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
566
574
  */
567
575
  onPropertyValueChanging: Event<(sender: CreatorBase, options: any) => any, any>;
568
576
  /*
577
+ * The event is fired when a property in any survey object object is changed.
578
+ * <br/> sender the survey creator object that fires the event
579
+ * <br/> options.obj the survey object which property has been changed.
580
+ * <br/> options.propertyName the name of the changed property.
581
+ * <br/> options.value the property value.
582
+ */
583
+ onSurveyPropertyValueChanged: Event<(sender: CreatorBase, options: any) => any, any>;
584
+ /*
569
585
  * Use this event to modify the list (name and titles) of the questions available in a condition editor.
570
586
  * <br/> sender the survey creator object that fires the event
571
587
  * <br/> options.obj the survey object which property is edited in the Property Editor.
@@ -693,7 +709,9 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
693
709
  * <br/> sender the survey creator object that fires the event
694
710
  * <br/> There are two properties in options:
695
711
  * <br/> files the Javascript File objects array
696
- * <br/> callback called on upload complete
712
+ * <br/> callback called on upload complete,
713
+ * <br/> which takes two string arguments:
714
+ * <br/> a status and an image link
697
715
  */
698
716
  onUploadFile: Event<(sender: CreatorBase, options: any) => any, any>;
699
717
  /*
@@ -792,6 +810,11 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
792
810
  get showSimulatorInPreviewTab(): boolean;
793
811
  set showSimulatorInPreviewTab(val: boolean);
794
812
  /*
813
+ * Specifies a theme to use for the survey in the Preview tab.
814
+ * Accepted values: `"modern"`, `"default"`, `"defaultV2"`
815
+ */
816
+ themeForPreview: string;
817
+ /*
795
818
  * Set this property to false to disable pages adding, editing and deleting
796
819
  */
797
820
  allowModifyPages: boolean;
@@ -980,6 +1003,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
980
1003
  onStateChanged: Event<(sender: CreatorBase, options: any) => any, any>;
981
1004
  notifier: Notifier;
982
1005
  setModified(options?: any): void;
1006
+ notifySurveyPropertyChanged(options: any): void;
983
1007
  /*
984
1008
  * This function triggers user notification (via the alert() function if no onNotify event handler added).
985
1009
  */
@@ -1082,6 +1106,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
1082
1106
  get alwaySaveTextInPropertyEditors(): boolean;
1083
1107
  set alwaySaveTextInPropertyEditors(val: boolean);
1084
1108
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
1109
+ onPropertyGridSurveyCreatedCallback(object: any, survey: SurveyModel): void;
1085
1110
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): void;
1086
1111
  onPropertyEditorUpdateTitleActionsCallback(object: any, property: JsonObjectProperty, editor: Question, titleActions: any): void;
1087
1112
  onCanDeleteItemCallback(object: any, item: Base, allowDelete: boolean): boolean;
@@ -1141,7 +1166,6 @@ export declare class CreatorResponsivityManager {
1141
1166
  prevShowToolbox: any;
1142
1167
  prevShowPageNavigator: any;
1143
1168
  screenWidth: any;
1144
- devicePixelRatio: any;
1145
1169
  process(): void;
1146
1170
  dispose(): void;
1147
1171
  }
@@ -1328,7 +1352,6 @@ export declare class ObjectSelector {
1328
1352
  export declare class ObjectSelectorItem extends Action {
1329
1353
  constructor(id: number, data: Base, title: string, level: number);
1330
1354
  data: Base;
1331
- title: string;
1332
1355
  level: number;
1333
1356
  textInLow: string;
1334
1357
  hasText(filteredTextInLow: string): boolean;
@@ -1467,6 +1490,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1467
1490
  constructor(supportedQuestions?: any, creator?: CreatorBase);
1468
1491
  creator: CreatorBase;
1469
1492
  static hiddenTypes: any;
1493
+ static defaultIconName: string;
1470
1494
  _orderedQuestions: any;
1471
1495
  static getQuestionDefaultSettings(questionType: string): any;
1472
1496
  static _questionDefaultSettings: any;
@@ -1529,6 +1553,10 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1529
1553
  * Add a copied Question into Toolbox
1530
1554
  */
1531
1555
  addCopiedItem(question: Question, options?: any): void;
1556
+ /*
1557
+ * Add a toolbox item
1558
+ */
1559
+ getActionByItem(item: IQuestionToolboxItem): QuestionToolboxItem;
1532
1560
  addItem(item: IQuestionToolboxItem, index?: number): void;
1533
1561
  /*
1534
1562
  * Add a new toolbox item, add delete the old item with the same name
@@ -1603,7 +1631,6 @@ export declare class QuestionToolboxItem extends Action implements IQuestionTool
1603
1631
  iconName: string;
1604
1632
  name: string;
1605
1633
  json: any;
1606
- title: string;
1607
1634
  tooltip: string;
1608
1635
  isCopied: boolean;
1609
1636
  category: string;
@@ -2194,6 +2221,10 @@ export declare class Translation extends Base implements ITranslationLocales {
2194
2221
  importFromCSVFile(file: any): void;
2195
2222
  mergeLocaleWithDefault(): void;
2196
2223
  translateItemAfterRender(item: TranslationItem, el: any, locale: string): void;
2224
+ /*
2225
+ * Update a translation item with given values
2226
+ */
2227
+ updateItemWithStrings(item: TranslationItem, values: any, locales: any): void;
2197
2228
  dispose(): void;
2198
2229
  }
2199
2230
  export declare class TranslationItemBase extends Base {
@@ -2295,6 +2326,7 @@ export declare class EmptySurveyCreatorOptions implements ISurveyCreatorOptions
2295
2326
  maximumRateValues: number;
2296
2327
  getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
2297
2328
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
2329
+ onPropertyGridSurveyCreatedCallback(object: any, survey: SurveyModel): void;
2298
2330
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): void;
2299
2331
  onPropertyEditorUpdateTitleActionsCallback(object: any, property: JsonObjectProperty, editor: Question, titleActions: any): void;
2300
2332
  onIsPropertyReadOnlyCallback(obj: Base, property: JsonObjectProperty, readOnly: boolean, parentObj: Base, parentProperty: JsonObjectProperty): boolean;
@@ -2363,6 +2395,7 @@ export declare class PageAdorner extends SurveyElementAdornerBase<PageModel> {
2363
2395
  hoverStopper(event: any, element: any): void;
2364
2396
  protected duplicate(): void;
2365
2397
  get allowEdit(): boolean;
2398
+ get showAddQuestionButton(): boolean;
2366
2399
  get addNewQuestionText(): string;
2367
2400
  }
2368
2401
  export declare class PropertyEditorSetupValue implements IPropertyEditorSetup {
@@ -2410,6 +2443,7 @@ export declare class QuestionAdornerViewModel extends SurveyElementAdornerBase {
2410
2443
  onPointerDown(pointerDownEvent: any): void;
2411
2444
  startDragSurveyElement: any;
2412
2445
  get allowEdit(): boolean;
2446
+ get showAddQuestionButton(): boolean;
2413
2447
  getConvertToTypesActions(): Array<IAction>;
2414
2448
  protected buildActions(items: any): void;
2415
2449
  protected duplicate(): void;
@@ -3096,6 +3130,7 @@ export declare function getElementWrapperComponentData(element: any, reason: str
3096
3130
  export declare function getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string;
3097
3131
  export declare function getItemValueWrapperComponentData(item: ItemValue, question: QuestionSelectBase, creator: CreatorBase): any;
3098
3132
  export declare function isStringEditable(element: any, name: string): boolean;
3133
+ export declare function isTextInput(target: any): boolean;
3099
3134
  export declare var editorLocalization: EditorLocalization;
3100
3135
  export declare var defaultStrings: any;
3101
3136
  export declare var settings: {
@@ -3122,6 +3157,16 @@ export declare var settings: {
3122
3157
  lessorequal: any,
3123
3158
  },
3124
3159
  defaultNewSurveyJSON: any,
3160
+ designer: {
3161
+ /*
3162
+ * The default question type on clicking Add Question button.
3163
+ */
3164
+ defaultAddQuestionType: string,
3165
+ /*
3166
+ * Set this property to false, to hide "Add Question" button on designer surface
3167
+ */
3168
+ showAddQuestionButton: boolean,
3169
+ },
3125
3170
  logic: {
3126
3171
  visibleActions: any,
3127
3172
  logicItemTitleMaxChars: number,