survey-creator-core 1.9.26 → 1.9.29

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,12 +1,12 @@
1
1
  /*
2
- * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.26
2
+ * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.29
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - https://surveyjs.io/
4
4
  * License: https://surveyjs.io/Licenses#SurveyCreator
5
5
  */
6
6
  import { Base, JsonObjectProperty, Question, ItemValue, MatrixDropdownColumn } from "survey-core";
7
- import { IAction, SurveyModel, ActionContainer, DragDropSurveyElements, DragDropChoices } from "survey-core";
8
- import { Event, AdaptiveActionContainer, PageModel, IElement, IPanel } from "survey-core";
9
- import { ISurveyElement, Action, SurveyElement, QuestionSelectBase, QuestionRowModel } from "survey-core";
7
+ import { IAction, SurveyModel, Action, ActionContainer, DragDropSurveyElements } from "survey-core";
8
+ import { DragDropChoices, Event, AdaptiveActionContainer, PageModel, IElement } from "survey-core";
9
+ import { IPanel, ISurveyElement, SurveyElement, QuestionSelectBase, QuestionRowModel } from "survey-core";
10
10
  import { LocalizableString, DragOrClickHelper, PanelModel, QuestionDropdownModel, ListModel } from "survey-core";
11
11
  import { PopupModel, EventBase, PanelModelBase, QuestionNonValue, SurveyTemplateRendererTemplateData } from "survey-core";
12
12
  import { ComputedUpdater, QuestionCheckboxModel, ILocalizableString, ArrayChanges, ImageItemValue } from "survey-core";
@@ -217,7 +217,13 @@ export interface ICreatorPlugin {
217
217
  dispose?: any;
218
218
  model: Base;
219
219
  }
220
- export interface ITabbedMenuItem extends IAction {
220
+ export interface ICreatorAction extends IAction {
221
+ locTitleName?: string;
222
+ locTooltipName?: string;
223
+ onUpdateTitle?: any;
224
+ onUpdateTooltip?: any;
225
+ }
226
+ export interface ITabbedMenuItem extends ICreatorAction {
221
227
  componentContent: string;
222
228
  renderTab?: any;
223
229
  }
@@ -245,6 +251,14 @@ export declare class ConditionEditorItemsBuilder {
245
251
  constructor(hasValue?: any);
246
252
  build(text: string): Array<ConditionEditorItem>;
247
253
  }
254
+ export declare class CreatorAction extends Action implements ICreatorAction {
255
+ constructor(item: ICreatorAction);
256
+ locTitleName: string;
257
+ locTooltipName: string;
258
+ onUpdateTitle: any;
259
+ onUpdateTooltip: any;
260
+ updateTitle(): void;
261
+ }
248
262
  /*
249
263
  * Base class for Survey Creator.
250
264
  */
@@ -394,6 +408,18 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
394
408
  */
395
409
  onGetObjectDisplayName: Event<(sender: CreatorBase, options: any) => any, any>;
396
410
  /*
411
+ * This event is raised after a user has edited a text value on the design surface. This value may include HTML markup. You can handle the `onHtmlToMarkdown` event to convert the HTML markup to Markdown.
412
+ *
413
+ * The event handler accepts the following arguments:
414
+ *
415
+ * - `sender` - A Survey Creator instance that raised the event.
416
+ * - `options.element` - The instance of a survey element (survey, page, panel, question) that the user configures.
417
+ * - `options.name` - The name of a property whose value has been edited.
418
+ * - `options.html` - HTML content. Pass this field's value to an HTML-to-Markdown converter.
419
+ * - `options.text` - A text string that may contain Markdown. Assign the result of the HTML-to-Markdown conversion to this field.
420
+ */
421
+ onHtmlToMarkdown: Event<(sender: CreatorBase, options: any) => any, any>;
422
+ /*
397
423
  * Use this event to disable user interactions with a question or panel on the design surface.
398
424
  *
399
425
  * The event handler accepts the following arguments:
@@ -508,8 +534,8 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
508
534
  * <br/> options.editorOptions options that can be changed.
509
535
  * <br/> options.editorOptions.allowAddRemoveItems a boolean property, true by default. Set it false to disable add/remove items in array properties. For example 'choices', 'columns', 'rows'.
510
536
  * <br/> options.editorOptions.allowRemoveAllItems a boolean property, true by default. Set it false to disable remove all items in array properties. For example 'choices', 'columns', 'rows'.
511
- * <br/> options.editorOptions.showTextView a boolean property, true by default. Set it false to disable "Fast Entry" tab for "choices" property.
512
- * <br/> options.editorOptions.itemsEntryType a string property, 'form' by default. Set it 'fast' to show "Fast Entry" tab for "choices" property by default.
537
+ * <br/> options.editorOptions.showTextView a boolean property, true by default. Set it false to disable "Manual Entry" tab for "choices" property.
538
+ * <br/> options.editorOptions.itemsEntryType a string property, 'form' by default. Set it 'fast' to show "Manual Entry" tab for "choices" property by default.
513
539
  */
514
540
  onSetPropertyEditorOptions: Event<(sender: CreatorBase, options: any) => any, any>;
515
541
  /*
@@ -667,7 +693,9 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
667
693
  * <br/> sender the survey creator object that fires the event
668
694
  * <br/> There are two properties in options:
669
695
  * <br/> files the Javascript File objects array
670
- * <br/> callback called on upload complete
696
+ * <br/> callback called on upload complete,
697
+ * <br/> which takes two string arguments:
698
+ * <br/> a status and an image link
671
699
  */
672
700
  onUploadFile: Event<(sender: CreatorBase, options: any) => any, any>;
673
701
  /*
@@ -766,6 +794,11 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
766
794
  get showSimulatorInPreviewTab(): boolean;
767
795
  set showSimulatorInPreviewTab(val: boolean);
768
796
  /*
797
+ * Specifies a theme to use for the survey in the Preview tab.
798
+ * Accepted values: `"modern"`, `"default"`, `"defaultV2"`
799
+ */
800
+ themeForPreview: string;
801
+ /*
769
802
  * Set this property to false to disable pages adding, editing and deleting
770
803
  */
771
804
  allowModifyPages: boolean;
@@ -808,6 +841,12 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
808
841
  showErrorOnFailedSave: boolean;
809
842
  protected onSetReadOnly(newVal: boolean): void;
810
843
  /*
844
+ * Gets or sets the survey locale. The default value it is empty, this means the 'en' locale is used.
845
+ * You can set it to 'de' - German, 'fr' - French and so on.
846
+ */
847
+ get locale(): string;
848
+ set locale(val: string);
849
+ /*
811
850
  * A boolean property, false by default. Set it to true to deny editing.
812
851
  */
813
852
  get readOnly(): boolean;
@@ -1296,7 +1335,6 @@ export declare class ObjectSelector {
1296
1335
  export declare class ObjectSelectorItem extends Action {
1297
1336
  constructor(id: number, data: Base, title: string, level: number);
1298
1337
  data: Base;
1299
- title: string;
1300
1338
  level: number;
1301
1339
  textInLow: string;
1302
1340
  hasText(filteredTextInLow: string): boolean;
@@ -1435,6 +1473,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1435
1473
  constructor(supportedQuestions?: any, creator?: CreatorBase);
1436
1474
  creator: CreatorBase;
1437
1475
  static hiddenTypes: any;
1476
+ static defaultIconName: string;
1438
1477
  _orderedQuestions: any;
1439
1478
  static getQuestionDefaultSettings(questionType: string): any;
1440
1479
  static _questionDefaultSettings: any;
@@ -1497,6 +1536,10 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1497
1536
  * Add a copied Question into Toolbox
1498
1537
  */
1499
1538
  addCopiedItem(question: Question, options?: any): void;
1539
+ /*
1540
+ * Add a toolbox item
1541
+ */
1542
+ getActionByItem(item: IQuestionToolboxItem): QuestionToolboxItem;
1500
1543
  addItem(item: IQuestionToolboxItem, index?: number): void;
1501
1544
  /*
1502
1545
  * Add a new toolbox item, add delete the old item with the same name
@@ -1528,6 +1571,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1528
1571
  */
1529
1572
  get keepAllCategoriesExpanded(): boolean;
1530
1573
  set keepAllCategoriesExpanded(val: boolean);
1574
+ updateTitles(): void;
1531
1575
  /*
1532
1576
  * Change the category of the toolbox item
1533
1577
  */
@@ -1570,7 +1614,6 @@ export declare class QuestionToolboxItem extends Action implements IQuestionTool
1570
1614
  iconName: string;
1571
1615
  name: string;
1572
1616
  json: any;
1573
- title: string;
1574
1617
  tooltip: string;
1575
1618
  isCopied: boolean;
1576
1619
  category: string;
@@ -1658,6 +1701,7 @@ export declare class StringEditorViewModelBase extends Base {
1658
1701
  valueBeforeEdit: string;
1659
1702
  errorText: string;
1660
1703
  focused: boolean;
1704
+ editAsText: boolean;
1661
1705
  setLocString(locString: LocalizableString): void;
1662
1706
  checkConstraints(event: any): void;
1663
1707
  blurEditor: any;
@@ -2000,6 +2044,14 @@ export declare class SurveySimulatorModel extends Base {
2000
2044
  considerDPI: boolean;
2001
2045
  simulatorEnabled: boolean;
2002
2046
  simulatorScaleEnabled: boolean;
2047
+ currZoomScale: number;
2048
+ get zoomScale(): number;
2049
+ activateZoom: any;
2050
+ deactivateZoom: any;
2051
+ listenTryToZoomWithWheel: any;
2052
+ listenTryToZoom: any;
2053
+ tryToZoom(data: any, event: any): boolean;
2054
+ resetZoomParameters(): void;
2003
2055
  get activeDevice(): string;
2004
2056
  set activeDevice(val: string);
2005
2057
  get landscapeOrientation(): boolean;
@@ -2044,11 +2096,6 @@ export declare class TabDesignerViewModel extends Base {
2044
2096
  export declare class TabbedMenuContainer extends AdaptiveActionContainer<TabbedMenuItem> {
2045
2097
  constructor();
2046
2098
  }
2047
- export declare class TabbedMenuItem extends Action implements ITabbedMenuItem {
2048
- constructor(item: ITabbedMenuItem);
2049
- componentContent: string;
2050
- renderTab: any;
2051
- }
2052
2099
  export declare class TestSurveyTabViewModel extends Base {
2053
2100
  constructor(surveyProvider: CreatorBase, startTheme?: any);
2054
2101
  json: any;
@@ -2157,6 +2204,10 @@ export declare class Translation extends Base implements ITranslationLocales {
2157
2204
  importFromCSVFile(file: any): void;
2158
2205
  mergeLocaleWithDefault(): void;
2159
2206
  translateItemAfterRender(item: TranslationItem, el: any, locale: string): void;
2207
+ /*
2208
+ * Update a translation item with given values
2209
+ */
2210
+ updateItemWithStrings(item: TranslationItem, values: any, locales: any): void;
2160
2211
  dispose(): void;
2161
2212
  }
2162
2213
  export declare class TranslationItemBase extends Base {
@@ -2326,6 +2377,7 @@ export declare class PageAdorner extends SurveyElementAdornerBase<PageModel> {
2326
2377
  hoverStopper(event: any, element: any): void;
2327
2378
  protected duplicate(): void;
2328
2379
  get allowEdit(): boolean;
2380
+ get showAddQuestionButton(): boolean;
2329
2381
  get addNewQuestionText(): string;
2330
2382
  }
2331
2383
  export declare class PropertyEditorSetupValue implements IPropertyEditorSetup {
@@ -2373,6 +2425,7 @@ export declare class QuestionAdornerViewModel extends SurveyElementAdornerBase {
2373
2425
  onPointerDown(pointerDownEvent: any): void;
2374
2426
  startDragSurveyElement: any;
2375
2427
  get allowEdit(): boolean;
2428
+ get showAddQuestionButton(): boolean;
2376
2429
  getConvertToTypesActions(): Array<IAction>;
2377
2430
  protected buildActions(items: any): void;
2378
2431
  protected duplicate(): void;
@@ -2459,11 +2512,9 @@ export declare class TabJsonEditorBasePlugin implements ICreatorPlugin {
2459
2512
  }
2460
2513
  export declare class TabLogicPlugin implements ICreatorPlugin {
2461
2514
  constructor(creator: CreatorBase);
2462
- filterQuestionAction: Action;
2463
- filterActionTypeAction: Action;
2464
- fastEntryAction: Action;
2465
- showAllQuestionsText: string;
2466
- showAllActionTypesText: string;
2515
+ filterQuestionAction: CreatorAction;
2516
+ filterActionTypeAction: CreatorAction;
2517
+ fastEntryAction: CreatorAction;
2467
2518
  model: SurveyLogicUI;
2468
2519
  activate(): void;
2469
2520
  update(): void;
@@ -2517,6 +2568,11 @@ export declare class TabTranslationPlugin implements ICreatorPlugin {
2517
2568
  get importFromCSVText(): string;
2518
2569
  createActions(): any;
2519
2570
  }
2571
+ export declare class TabbedMenuItem extends CreatorAction implements ITabbedMenuItem {
2572
+ constructor(item: ITabbedMenuItem);
2573
+ componentContent: string;
2574
+ renderTab: any;
2575
+ }
2520
2576
  export declare class TextareaJsonEditorModel extends JsonEditorBaseModel {
2521
2577
  constructor(creator: CreatorBase);
2522
2578
  protected _text: string;
@@ -3056,6 +3112,7 @@ export declare function getElementWrapperComponentData(element: any, reason: str
3056
3112
  export declare function getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string;
3057
3113
  export declare function getItemValueWrapperComponentData(item: ItemValue, question: QuestionSelectBase, creator: CreatorBase): any;
3058
3114
  export declare function isStringEditable(element: any, name: string): boolean;
3115
+ export declare function isTextInput(target: any): boolean;
3059
3116
  export declare var editorLocalization: EditorLocalization;
3060
3117
  export declare var defaultStrings: any;
3061
3118
  export declare var settings: {
@@ -3082,6 +3139,16 @@ export declare var settings: {
3082
3139
  lessorequal: any,
3083
3140
  },
3084
3141
  defaultNewSurveyJSON: any,
3142
+ designer: {
3143
+ /*
3144
+ * The default question type on clicking Add Question button.
3145
+ */
3146
+ defaultAddQuestionType: string,
3147
+ /*
3148
+ * Set this property to false, to hide "Add Question" button on designer surface
3149
+ */
3150
+ showAddQuestionButton: boolean,
3151
+ },
3085
3152
  logic: {
3086
3153
  visibleActions: any,
3087
3154
  logicItemTitleMaxChars: number,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.26
2
+ * SurveyJS Creator v1.9.29
3
3
  * (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.26
2
+ * SurveyJS Creator v1.9.29
3
3
  * (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator