survey-creator-core 1.9.7-beta.1 → 1.9.11-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.7-beta.1
1
+ /*Type definitions for SurveyJS Creator JavaScript library v1.9.11-beta.1
2
2
  (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
3
3
  Github: https://github.com/surveyjs/survey-creator
4
4
  License: https://surveyjs.io/Licenses#SurveyCreator
@@ -49,6 +49,7 @@ import { SurveyModel, Base, Question, SurveyElement } from "survey-core";
49
49
  import { SurveyModel, QuestionPanelDynamicModel, ItemValue, PanelModel, Base, Question, QuestionCommentModel } from "survey-core";
50
50
  import { SurveyModel, QuestionPanelDynamicModel, PanelModel, Question } from "survey-core";
51
51
  import { Base, AdaptiveActionContainer, Action, SurveyModel, SurveyElement } from "survey-core";
52
+ import { Base, ItemValue, PanelModel, QuestionDropdownModel, SurveyModel } from "survey-core";
52
53
 
53
54
 
54
55
  import "../components/property-panel/property-panel-item.scss";
@@ -62,28 +63,6 @@ import "../components/side-bar/side-bar.scss";
62
63
  import "../property-grid-theme/property-grid.scss";
63
64
  import "../utils/design.scss";
64
65
  import "../utils/layout.scss";
65
- import "../localization/arabic";
66
- import "../localization/danish";
67
- import "../localization/french";
68
- import "../localization/german";
69
- import "../localization/finnish";
70
- import "../localization/italian";
71
- import "../localization/indonesian";
72
- import "../localization/korean";
73
- import "../localization/persian";
74
- import "../localization/polish";
75
- import "../localization/portuguese";
76
- import "../localization/simplified-chinese";
77
- import "../localization/spanish";
78
- import "../localization/swedish";
79
- import "../localization/traditional-chinese";
80
- import "../localization/turkish";
81
- import "../localization/norwegian";
82
- import "../localization/hungarian";
83
- import "../localization/russian";
84
- import "../localization/tajik";
85
- import "../localization/dutch";
86
- import "../localization/croatian";
87
66
 
88
67
  export declare var enStrings: {
89
68
  survey: {
@@ -198,6 +177,7 @@ export declare var enStrings: {
198
177
  translationLanguages: string;
199
178
  translationAddLanguage: string;
200
179
  translationShowAllStrings: string;
180
+ translationShowUsedStringsOnly: string;
201
181
  translationShowAllPages: string;
202
182
  translationNoStrings: string;
203
183
  translationExportToSCVButton: string;
@@ -1033,6 +1013,7 @@ export declare var defaultStrings: {
1033
1013
  translationLanguages: string;
1034
1014
  translationAddLanguage: string;
1035
1015
  translationShowAllStrings: string;
1016
+ translationShowUsedStringsOnly: string;
1036
1017
  translationShowAllPages: string;
1037
1018
  translationNoStrings: string;
1038
1019
  translationExportToSCVButton: string;
@@ -1742,9 +1723,13 @@ export declare enum QuestionConvertMode {
1742
1723
  CompatibleTypes = 1
1743
1724
  }
1744
1725
  export declare var settings: {
1745
- traslation: {
1726
+ translation: {
1746
1727
  sortByName: boolean;
1747
1728
  exportPrefix: string;
1729
+ /**
1730
+ * The maximum number of locales that user can select at once for translation
1731
+ */
1732
+ maximumSelectedLocales: number;
1748
1733
  };
1749
1734
  operators: {
1750
1735
  empty: any[];
@@ -1770,7 +1755,6 @@ export declare var settings: {
1770
1755
  */
1771
1756
  questionConvertMode: QuestionConvertMode;
1772
1757
  propertyGrid: {
1773
- allowCollapse: boolean;
1774
1758
  useButtonGroup: boolean;
1775
1759
  maxCharsInButtonGroup: number;
1776
1760
  showNavigationButtons: boolean;
@@ -1804,6 +1788,7 @@ export declare var settings: {
1804
1788
  layout: {
1805
1789
  showTabs: boolean;
1806
1790
  showToolbar: boolean;
1791
+ allowCollapseSidebar: boolean;
1807
1792
  };
1808
1793
  jsonEditor: {
1809
1794
  indentation: number;
@@ -1916,7 +1901,7 @@ export declare class ToolbarActionContainer extends ActionContainer {
1916
1901
  constructor(creator: CreatorBase);
1917
1902
  protected getRenderedActions(): Array<Action>;
1918
1903
  }
1919
- export declare type toolBoxLocationType = "left" | "right" | "insideSideBar" | "hidden";
1904
+ export declare type toolboxLocationType = "left" | "right" | "sidebar";
1920
1905
  /**
1921
1906
  * Base class for Survey Creator.
1922
1907
  */
@@ -2364,6 +2349,16 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2364
2349
  * - `options.visible` - A Boolean value that specifies the property visibility. Set it to `false` to hide the property.
2365
2350
  */
2366
2351
  onTranslationStringVisibility: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2352
+ /**
2353
+ * Use this event to define is the locale initially selected (default value) and ready for translaion or it is unselected.
2354
+ *
2355
+ * The event handler accepts the following arguments:
2356
+ *
2357
+ * - `sender` - A Survey Creator instance that raised the event.
2358
+ * - `options.locale` - the locale name, like 'en', 'de' and so on.
2359
+ * - `options.isSelected` - it is true by default. Set it to false to make the translation unselected.
2360
+ */
2361
+ onTranslationLocaleInitiallySelected: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2367
2362
  /**
2368
2363
  * This callback is used internally for providing survey JSON text.
2369
2364
  */
@@ -2500,16 +2495,20 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2500
2495
  makeNewViewActive(viewName: string): boolean;
2501
2496
  toolbox: QuestionToolbox;
2502
2497
  get toolboxCategories(): Array<any>;
2503
- sideBar: SideBarModel;
2498
+ sidebar: SidebarModel;
2504
2499
  constructor(options: ICreatorOptions, options2?: ICreatorOptions);
2505
2500
  updateToolboxIsCompact(newVal?: boolean): void;
2506
2501
  onSurveyElementPropertyValueChanged(property: Survey.JsonObjectProperty, obj: any, newValue: any): void;
2507
- get showToolbox(): "left" | "right" | "top" | "none" | boolean;
2508
- set showToolbox(val: "left" | "right" | "top" | "none" | boolean);
2509
- onShowPropertyGridVisiblityChanged: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2502
+ showToolboxValue: boolean;
2503
+ get showToolbox(): boolean;
2504
+ set showToolbox(val: boolean);
2505
+ onShowSidebarVisiblityChanged: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2510
2506
  /**
2511
2507
  * Set this this property grid false to hide the property grid.
2512
2508
  */
2509
+ get showSidebar(): boolean;
2510
+ set showSidebar(val: boolean);
2511
+ onShowPropertyGridVisiblityChanged: Survey.Event<(sender: CreatorBase<T>, options: any) => any, any>;
2513
2512
  get showPropertyGrid(): boolean;
2514
2513
  set showPropertyGrid(val: boolean);
2515
2514
  rightContainerActiveItem(name: string): void;
@@ -2544,6 +2543,10 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2544
2543
  * This method stops undo/redo transaction.
2545
2544
  */
2546
2545
  stopUndoRedoTransaction(): void;
2546
+ /**
2547
+ * Returns true if Creator is currently doing undo or redo opertaions
2548
+ */
2549
+ get isProcessingUndoRedo(): boolean;
2547
2550
  /**
2548
2551
  * This method performs undo uperation if possible.
2549
2552
  */
@@ -2796,9 +2799,10 @@ export declare class CreatorBase<T extends SurveyModel = SurveyModel> extends Su
2796
2799
  showPageNavigator: any;
2797
2800
  showTabs: any;
2798
2801
  showToolbar: any;
2802
+ allowCollapseSidebar: any;
2799
2803
  isMobileView: any;
2800
- toolboxLocation: toolBoxLocationType;
2801
- sideBarLocation: "left" | "right";
2804
+ toolboxLocation: toolboxLocationType;
2805
+ sidebarLocation: "left" | "right";
2802
2806
  selectFromStringEditor: boolean;
2803
2807
  }
2804
2808
  export declare class StylesManager {
@@ -3108,6 +3112,7 @@ export declare class SurveyLogic extends Base implements ISurveyLogicItemOwner {
3108
3112
  protected hasErrorInUI(): boolean;
3109
3113
  protected getExpressionText(): string;
3110
3114
  protected getEditingActions(): Array<SurveyLogicAction>;
3115
+ protected onReadOnlyChanged(): void;
3111
3116
  addNew(): void;
3112
3117
  editItem(item: SurveyLogicItem): void;
3113
3118
  protected onStartEditing(): void;
@@ -3214,6 +3219,7 @@ export declare class Translation extends Base implements ITranslationLocales {
3214
3219
  availableTranlationsChangedCallback: () => void;
3215
3220
  tranlationChangedCallback: (locale: string, name: string, value: string, context: any) => void;
3216
3221
  translationStringVisibilityCallback: (obj: Base, propertyName: string, visible: boolean) => boolean;
3222
+ localeInitialVisibleCallback: (locale: string) => boolean;
3217
3223
  chooseLanguageActions: Array<IAction>;
3218
3224
  constructor(survey: SurveyModel, options?: ISurveyCreatorOptions, hasUI?: boolean);
3219
3225
  getType(): string;
@@ -3566,6 +3572,7 @@ export declare class TabTranslationPlugin implements ICreatorPlugin {
3566
3572
  deactivate(): boolean;
3567
3573
  get selectLanguageOptionsCaption(): any;
3568
3574
  get showAllStringsText(): string;
3575
+ get showUsedStringsOnlyText(): string;
3569
3576
  get showAllPagesText(): string;
3570
3577
  get exportToCSVText(): string;
3571
3578
  get importFromCSVText(): string;
@@ -3621,6 +3628,7 @@ export declare class SurveyLogicUI extends SurveyLogic {
3621
3628
  addNewUI(): void;
3622
3629
  toggleExpressionEditorIsFastEntry(): void;
3623
3630
  protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
3631
+ protected onReadOnlyChanged(): void;
3624
3632
  get expressionEditor(): ConditionEditor;
3625
3633
  get itemEditor(): LogicItemEditor;
3626
3634
  getExpressionEditor(item: SurveyLogicItem): ConditionEditor;
@@ -4381,6 +4389,7 @@ export declare class LogoImageViewModel extends Base {
4381
4389
 
4382
4390
  export declare class StringEditorViewModelBase extends Base {
4383
4391
  errorText: string;
4392
+ focused: boolean;
4384
4393
  constructor(locString: LocalizableString, creator: CreatorBase);
4385
4394
  setLocString(locString: LocalizableString): void;
4386
4395
  checkConstraints(event: any): void;
@@ -4452,7 +4461,7 @@ export interface IPropertyGridEditor {
4452
4461
  fit(prop: JsonObjectProperty, context?: string): boolean;
4453
4462
  isDefault?: () => boolean;
4454
4463
  getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
4455
- showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): any;
4464
+ showModalPropertyEditor?: (editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => any;
4456
4465
  onCreated?: (obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions) => void;
4457
4466
  onAfterRenderQuestion?: (obj: Base, prop: JsonObjectProperty, evtOptions: any) => void;
4458
4467
  createPropertyEditorSetup?: (obj: Base, prop: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => IPropertyEditorSetup;
@@ -4719,7 +4728,7 @@ export declare class PropertyGridEditorBindings extends PropertyGridEditor {
4719
4728
  fit(prop: JsonObjectProperty): boolean;
4720
4729
  getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
4721
4730
  onMatrixCellCreated(obj: Base, options: any): void;
4722
- onMatrixCellValueChanged(obj: Base, options: any): void;
4731
+ onCreated(obj: Base, question: Question, prop: JsonObjectProperty): void;
4723
4732
  }
4724
4733
 
4725
4734
  export declare class PropertyGridViewModel<T extends SurveyModel> extends Base {
@@ -4912,7 +4921,6 @@ export declare var propertyGridCss: {
4912
4921
  itemSvgIconId: string;
4913
4922
  labelChecked: string;
4914
4923
  itemControl: string;
4915
- itemDecorator: string;
4916
4924
  controlLabel: string;
4917
4925
  materialDecorator: string;
4918
4926
  other: string;
@@ -4946,7 +4954,6 @@ export declare var propertyGridCss: {
4946
4954
  svgIconId: string;
4947
4955
  label: string;
4948
4956
  disabledLabel: string;
4949
- itemDecorator: string;
4950
4957
  materialDecorator: string;
4951
4958
  };
4952
4959
  text: {
@@ -5185,7 +5192,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
5185
5192
  canCollapseCategories: boolean;
5186
5193
  isCompact: boolean;
5187
5194
  constructor(supportedQuestions?: Array<string>, creator?: CreatorBase<SurveyModel>);
5188
- setLocation(toolboxLocation: toolBoxLocationType): void;
5195
+ setLocation(toolboxLocation: toolboxLocationType): void;
5189
5196
  /**
5190
5197
  * The Array of Toolbox items as Text JSON.
5191
5198
  */
@@ -5295,9 +5302,9 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
5295
5302
  dispose(): void;
5296
5303
  }
5297
5304
 
5298
- export declare class SideBarModel extends Base {
5305
+ export declare class SidebarModel extends Base {
5299
5306
  toolbar: AdaptiveActionContainer;
5300
- tabs: Array<SideBarTabModel>;
5307
+ tabs: Array<SidebarTabModel>;
5301
5308
  headerText: string;
5302
5309
  visible: boolean;
5303
5310
  collapsedManually: boolean;
@@ -5307,26 +5314,26 @@ export declare class SideBarModel extends Base {
5307
5314
  activeTab: string;
5308
5315
  get flyoutPanelMode(): boolean;
5309
5316
  get closeText(): string;
5310
- getTabById(id: string): SideBarTabModel;
5317
+ getTabById(id: string): SidebarTabModel;
5311
5318
  constructor(creator: CreatorBase, collapseAction?: () => void, expandAction?: () => void);
5312
5319
  getExpandAction(): Action;
5313
- collapseSideBar(): void;
5314
- expandSideBar(): void;
5315
- addTab(id: string, componentName?: string, model?: any, buildActions?: () => Array<Action>): SideBarTabModel;
5320
+ collapseSidebar(): void;
5321
+ expandSidebar(): void;
5322
+ addTab(id: string, componentName?: string, model?: any, buildActions?: () => Array<Action>): SidebarTabModel;
5316
5323
  updateHasVisibleTabs(): void;
5317
5324
  dispose(): void;
5318
5325
  initResizeManager(container: HTMLDivElement): void;
5319
5326
  resetResizeManager(): void;
5320
5327
  }
5321
5328
 
5322
- export declare class SideBarTabModel extends Base {
5329
+ export declare class SidebarTabModel extends Base {
5323
5330
  id: string;
5324
- sidePanel: SideBarModel;
5331
+ sidePanel: SidebarModel;
5325
5332
  caption: string;
5326
5333
  visible: boolean;
5327
5334
  model: any;
5328
5335
  componentName: string;
5329
- constructor(id: string, sidePanel: SideBarModel, componentName?: string, model?: any);
5336
+ constructor(id: string, sidePanel: SidebarModel, componentName?: string, model?: any);
5330
5337
  }
5331
5338
 
5332
5339
  export interface IPortableMouseEvent {
@@ -5460,6 +5467,7 @@ export declare class UndoRedoManager {
5460
5467
  canUndoRedoCallback(): void;
5461
5468
  startTransaction(name: string): void;
5462
5469
  stopTransaction(): void;
5470
+ get isProcessingUndoRedo(): boolean;
5463
5471
  canUndo(): boolean;
5464
5472
  undo(): void;
5465
5473
  canRedo(): boolean;
@@ -5863,8 +5871,8 @@ export declare class LogicItemEditor extends PropertyEditorSetupValue {
5863
5871
  get isModified(): boolean;
5864
5872
  get panel(): QuestionPanelDynamicModel;
5865
5873
  get panels(): Array<PanelModel>;
5866
- getPanelByAction(action: SurveyLogicAction): PanelModel;
5867
- getActionByPanel(panel: PanelModel): SurveyLogicAction;
5874
+ getActionModelByPanel(panel: PanelModel): LogicActionModelBase;
5875
+ setActionModelByPanel(panel: PanelModel, actionModel: LogicActionModelBase): void;
5868
5876
  get context(): Question;
5869
5877
  set context(val: Question);
5870
5878
  protected getSurveyJSON(): any;
@@ -5914,7 +5922,7 @@ export interface IPropertyGridEditor {
5914
5922
  fit(prop: JsonObjectProperty, context?: string): boolean;
5915
5923
  isDefault?: () => boolean;
5916
5924
  getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
5917
- showModalPropertyEditor(editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions): any;
5925
+ showModalPropertyEditor?: (editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => any;
5918
5926
  onCreated?: (obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions) => void;
5919
5927
  onAfterRenderQuestion?: (obj: Base, prop: JsonObjectProperty, evtOptions: any) => void;
5920
5928
  createPropertyEditorSetup?: (obj: Base, prop: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => IPropertyEditorSetup;
@@ -6059,3 +6067,37 @@ export declare class PropertyGridEditorQuestionValue extends PropertyGridEditorQ
6059
6067
  protected getItemValue(question: Question): any;
6060
6068
  }
6061
6069
 
6070
+ export declare class LogicActionModelBase {
6071
+ protected panel: PanelModel;
6072
+ initialLogicAction: SurveyLogicAction;
6073
+ logicType: SurveyLogicType;
6074
+ isTrigger: boolean;
6075
+ currentLogicAction: SurveyLogicAction;
6076
+ static createActionModel(panel: PanelModel, logicAction: SurveyLogicAction, logicType: SurveyLogicType, selectorElementsHash: any): LogicActionModelBase;
6077
+ constructor(panel: PanelModel, initialLogicAction: SurveyLogicAction, logicType: SurveyLogicType);
6078
+ updateCurrentLogicAction(survey: SurveyModel): boolean;
6079
+ afterUpdateInitialLogicAction(): void;
6080
+ resetElements(): void;
6081
+ getSelectedElement(): string;
6082
+ updateInitialLogicAction(): void;
6083
+ setInitialElementValue(question: QuestionDropdownModel, action: SurveyLogicAction, selectedQuestion: string): void;
6084
+ }
6085
+ export declare class LogicActionModel extends LogicActionModelBase {
6086
+ constructor(panel: PanelModel, logicAction: SurveyLogicAction, logicType: SurveyLogicType, selectorElementsHash: any);
6087
+ updateCurrentLogicAction(survey: SurveyModel): boolean;
6088
+ resetElements(): void;
6089
+ updatePanelElements(selectedElement: string, choices: Array<ItemValue>): void;
6090
+ getSelectedElement(): string;
6091
+ }
6092
+ export declare class LogicActionTriggerModel extends LogicActionModelBase {
6093
+ isTrigger: boolean;
6094
+ constructor(panel: PanelModel, logicAction: SurveyLogicAction, logicType: SurveyLogicType);
6095
+ afterUpdateInitialLogicAction(): void;
6096
+ updateCurrentLogicAction(survey: SurveyModel): boolean;
6097
+ updatePanel(propertyName: string, newValue: any, options: ISurveyCreatorOptions, survey: SurveyModel): void;
6098
+ setPanelObj(obj: Base): void;
6099
+ resetElements(): void;
6100
+ updatePanelElements(selectedElement: string, options?: ISurveyCreatorOptions): void;
6101
+ getSelectedElement(): string;
6102
+ }
6103
+