survey-creator-core 1.9.21 → 1.9.24

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.21
2
+ * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.24
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, SurveyElement, AdaptiveActionContainer, Action } from "survey-core";
8
- import { ActionContainer, DragDropSurveyElements, DragDropChoices, Event, PageModel } from "survey-core";
9
- import { IElement, IPanel, ISurveyElement, QuestionSelectBase, QuestionRowModel } 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";
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";
@@ -235,25 +235,6 @@ export interface IPortableMouseEvent {
235
235
  export interface IPortableDragEvent extends IPortableMouseEvent {
236
236
  dataTransfer: any;
237
237
  }
238
- export declare class ActionContainerViewModel extends Base {
239
- constructor(creator: CreatorBase, surveyElement: SurveyElement);
240
- creator: CreatorBase;
241
- surveyElement: SurveyElement;
242
- actionContainer: any;
243
- allowDragging: boolean;
244
- selectedPropPageFunc: any;
245
- sidebarFlyoutModeChangedFunc: any;
246
- protected checkActionProperties(): void;
247
- dispose(): void;
248
- protected onElementSelectedChanged(isSelected: boolean): void;
249
- protected updateActionsProperties(): void;
250
- protected updateElementAllowOptions(options: any, operationsAllow: boolean): void;
251
- protected isOperationsAllow(): boolean;
252
- protected updateActionVisibility(id: string, isVisible: boolean): void;
253
- getActionById(id: string): Action;
254
- protected buildActions(items: any): void;
255
- protected duplicate(): void;
256
- }
257
238
  export declare class ConditionEditorItem {
258
239
  conjunction: string;
259
240
  questionName: string;
@@ -298,6 +279,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
298
279
  * Set it to true to show "Logic" tab and to false to hide the tab
299
280
  */
300
281
  showLogicTab: boolean;
282
+ useTableViewInLogicTab: boolean;
301
283
  /*
302
284
  * Set delay for page hover
303
285
  */
@@ -331,12 +313,12 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
331
313
  toolbarValue: any;
332
314
  responsivityManager: CreatorResponsivityManager;
333
315
  footerToolbar: any;
334
- pageEditModeValue: "standard" | "single";
316
+ pageEditModeValue: "standard" | "single" | "bypage";
335
317
  /*
336
318
  * Set pageEditMode option to "single" to use creator in a single page mode. By default value is "standard".
337
319
  * You can set this option in creator constructor only
338
320
  */
339
- get pageEditMode(): "standard" | "single";
321
+ get pageEditMode(): "standard" | "single" | "bypage";
340
322
  surveyValue: SurveyModel;
341
323
  get toolbarItems(): any;
342
324
  get toolbar(): any;
@@ -346,7 +328,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
346
328
  newQuestions: any;
347
329
  newPanels: any;
348
330
  newQuestionChangedNames: any;
349
- pagesControllerValue: PagesController;
350
331
  selectionHistoryControllerValue: SelectionHistory;
351
332
  saveSurveyFuncValue: any;
352
333
  viewType: string;
@@ -413,14 +394,21 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
413
394
  */
414
395
  onGetObjectDisplayName: Event<(sender: CreatorBase, options: any) => any, any>;
415
396
  /*
416
- * Use this event to disable some operations for an element (question/panel).
417
- * <br/> sender the survey creator object that fires the event
418
- * <br/> options.obj the survey object question/panel
419
- * <br/> options.allowDelete set it to false to disable deleting the object
420
- * <br/> options.allowCopy set it to false to disable copying the object
421
- * <br/> options.allowDragging set it to false to disable dragging the element
422
- * <br/> options.allowChangeType set it to false to disable changing element type
423
- * <br/> options.allowChangeRequired set it to false to disable changing isRequired property
397
+ * Use this event to disable user interactions with a question or panel on the design surface.
398
+ *
399
+ * The event handler accepts the following arguments:
400
+ *
401
+ * - `sender`- A Survey Creator instance that raised the event.
402
+ * - `options.obj` - A survey element instance (question or panel) for which you can disable user interactions.
403
+ * - `options.allowAddToToolbox` - Allows users to save the current survey element configuration in the Toolbox.
404
+ * - `options.allowChangeRequired` - Allows users to make the survey element required.
405
+ * - `options.allowChangeType` - Allows users to change the survey element type.
406
+ * - `options.allowCopy` - Allows users to duplicate the survey element.
407
+ * - `options.allowDelete` - Allows users to delete the survey element.
408
+ * - `options.allowDragging` - Allows users to drag and drop the survey element.
409
+ * - `options.allowEdit` - Allows users to edit survey element properties on the design surface. If you disable this property, users can edit the properties only in the Property Grid.
410
+ *
411
+ * To disable a user interaction, set the correponding `allow...` property to `false`.
424
412
  */
425
413
  onElementAllowOperations: Event<(sender: CreatorBase, options: any) => any, any>;
426
414
  /*
@@ -704,6 +692,18 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
704
692
  */
705
693
  onTranslationLocaleInitiallySelected: Event<(sender: CreatorBase, options: any) => any, any>;
706
694
  /*
695
+ * Use this event to control drag&drop operations.
696
+ * <br/> sender the survey creator object that fires the event.
697
+ * <br/> options.survey the editing survey object.
698
+ * <br/> options.allow set it to false to disable dragging.
699
+ * <br/> options.target a target element that is dragging.
700
+ * <br/> options.source a source element. It can be null, if it is a new element, dragging from toolbox.
701
+ * <br/> options.parent a page or panel where target element is dragging.
702
+ * <br/> options.insertBefore an element before the target element is dragging. It can be null if parent container (page or panel) is empty or dragging an element under the last element of the container.
703
+ * <br/> options.insertAfter an element after the target element is dragging. It can be null if parent container (page or panel) is empty or dragging element to the top of the parent container.
704
+ */
705
+ onDragDropAllow: Event<(sender: CreatorBase, options: any) => any, any>;
706
+ /*
707
707
  * This callback is used internally for providing survey JSON text.
708
708
  */
709
709
  getSurveyJSONTextCallback: any;
@@ -817,6 +817,17 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
817
817
  */
818
818
  get isRTL(): boolean;
819
819
  set isRTL(val: boolean);
820
+ /*
821
+ * The event is called when creator is going to change the active tab.
822
+ * <br/> sender the survey creator object that fires the event
823
+ * <br/> options.tabName the name of new active tab
824
+ */
825
+ onActiveTabChanging: Event<(sender: CreatorBase, options: any) => any, any>;
826
+ /*
827
+ * The event is called when creator active tab is changed.
828
+ * <br/> sender the survey creator object that fires the event
829
+ * <br/> options.tabName the name of new active tab
830
+ */
820
831
  onActiveTabChanged: Event<(sender: CreatorBase, options: any) => any, any>;
821
832
  /*
822
833
  * Get/set the active tab.
@@ -833,7 +844,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
833
844
  get toolboxCategories(): any;
834
845
  sidebar: SidebarModel;
835
846
  updateToolboxIsCompact(newVal?: boolean): void;
836
- onSurveyElementPropertyValueChanged(property: JsonObjectProperty, obj: any, newValue: any): void;
837
847
  showToolboxValue: boolean;
838
848
  get showToolbox(): boolean;
839
849
  set showToolbox(val: boolean);
@@ -892,7 +902,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
892
902
  * This method performs redo uperation if possible.
893
903
  */
894
904
  redo(): void;
895
- get pagesController(): PagesController;
896
905
  get selectionHistoryController(): SelectionHistory;
897
906
  get currentPage(): PageModel;
898
907
  set currentPage(val: PageModel);
@@ -913,7 +922,6 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
913
922
  onAfterDrop: Event<() => any, any>;
914
923
  updateElementsOnLocaleChanged(obj: Base, propertyName: string): void;
915
924
  updateConditionsOnQuestionNameChanged(obj: Base, propertyName: string, oldValue: any): void;
916
- updatePagesController(sender: Base, name: string): void;
917
925
  isObjQuestion(obj: Base): boolean;
918
926
  isObjPage(obj: Base): boolean;
919
927
  protected setSurvey(survey: SurveyModel): void;
@@ -1075,7 +1083,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
1075
1083
  get addNewQuestionText(): any;
1076
1084
  getQuestionTypeSelectorModel(beforeAdd: any, panel?: IPanel): any;
1077
1085
  addNewQuestionInPage(beforeAdd: any, panel?: IPanel, type?: string): void;
1078
- createIActionBarItemByClass(className: string, title?: string): Action;
1086
+ createIActionBarItemByClass(className: string, title: string, iconName: string): Action;
1079
1087
  onElementMenuItemsChanged(element: any, items: any): void;
1080
1088
  getElementAllowOperations(element: SurveyElement): any;
1081
1089
  getNextItemValue(question: QuestionSelectBase): string | number;
@@ -1273,12 +1281,12 @@ export declare class ObjectSelectorModel extends Base {
1273
1281
  refresh(): void;
1274
1282
  }
1275
1283
  export declare class PageNavigatorViewModel extends Base {
1276
- constructor(pagesController: PagesController);
1284
+ constructor(pagesController: PagesController, pageEditMode: string);
1277
1285
  icon: string;
1278
1286
  pageListModel: ListModel;
1279
1287
  popupModel: any;
1280
1288
  pagesChangedFunc: any;
1281
- pageNameChangedFunc: any;
1289
+ currentPagesChangedFunc: any;
1282
1290
  dispose(): void;
1283
1291
  items: any;
1284
1292
  visible: boolean;
@@ -1293,19 +1301,18 @@ export declare class PagesController extends Base {
1293
1301
  constructor(creator: ICreatorSelectionOwner);
1294
1302
  creator: ICreatorSelectionOwner;
1295
1303
  onPagesChanged: EventBase<PagesController>;
1296
- onCurrentPagesChanged: EventBase<PagesController>;
1297
- onPageNameChanged: EventBase<PagesController>;
1298
- pagesChangedFunc: any;
1299
- currentpagedChangedFunc: any;
1304
+ onCurrentPageChanged: EventBase<PagesController>;
1305
+ currentPageChangedFunc: any;
1300
1306
  surveyValue: SurveyModel;
1307
+ page2Display: PageModel;
1301
1308
  get survey(): SurveyModel;
1302
1309
  get pages(): any;
1303
1310
  get currentPage(): PageModel;
1304
1311
  set currentPage(val: PageModel);
1305
1312
  selectPage(value: PageModel): void;
1306
1313
  getDisplayName(page: PageModel): string;
1314
+ raisePagesChanged(): void;
1307
1315
  onSurveyChanged(): void;
1308
- pageNameChanged(page: PageModel): void;
1309
1316
  dispose(): void;
1310
1317
  }
1311
1318
  export declare class PropertiesHelpTexts {
@@ -1407,7 +1414,8 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1407
1414
  creator: CreatorBase;
1408
1415
  static hiddenTypes: any;
1409
1416
  _orderedQuestions: any;
1410
- _questionDefaultSettings: any;
1417
+ static getQuestionDefaultSettings(questionType: string): any;
1418
+ static _questionDefaultSettings: any;
1411
1419
  /*
1412
1420
  * Modify this array to change the toolbox items order.
1413
1421
  */
@@ -1427,7 +1435,17 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
1427
1435
  activeCategory: string;
1428
1436
  hasCategories: boolean;
1429
1437
  canCollapseCategories: boolean;
1438
+ /*
1439
+ * Indicates whether the toolbox is currently in compact mode.
1440
+ */
1430
1441
  isCompact: boolean;
1442
+ /*
1443
+ * Specifies whether the toolbox should be in compact or full mode.
1444
+ * Accepts the following values:
1445
+ * - `true` - Toolbox is always in compact mode.
1446
+ * - `false` - Toolbox is always in full mode.
1447
+ * - `undefined` - Toolbox switches between the full and compact modes automatically based on available width.
1448
+ */
1431
1449
  forceCompact: boolean;
1432
1450
  setLocation(toolboxLocation: any): void;
1433
1451
  /*
@@ -1640,6 +1658,27 @@ export declare class StylesManager {
1640
1658
  static set currentTheme(val: string);
1641
1659
  static applyTheme(name?: string): void;
1642
1660
  }
1661
+ export declare class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> extends Base {
1662
+ constructor(creator: CreatorBase, surveyElement: T);
1663
+ creator: CreatorBase;
1664
+ actionContainer: any;
1665
+ allowDragging: boolean;
1666
+ selectedPropPageFunc: any;
1667
+ sidebarFlyoutModeChangedFunc: any;
1668
+ protected detachElement(surveyElement: T): void;
1669
+ protected attachElement(surveyElement: T): void;
1670
+ protected setSurveyElement(surveyElement: T): void;
1671
+ protected checkActionProperties(): void;
1672
+ dispose(): void;
1673
+ protected onElementSelectedChanged(isSelected: boolean): void;
1674
+ protected updateActionsProperties(): void;
1675
+ protected updateElementAllowOptions(options: any, operationsAllow: boolean): void;
1676
+ protected isOperationsAllow(): boolean;
1677
+ protected updateActionVisibility(id: string, isVisible: boolean): void;
1678
+ getActionById(id: string): Action;
1679
+ protected buildActions(items: any): void;
1680
+ protected duplicate(): void;
1681
+ }
1643
1682
  export declare class SurveyForTextWorker extends SurveyModel {
1644
1683
  constructor(jsonObj: any);
1645
1684
  }
@@ -1808,6 +1847,8 @@ export declare class SurveyLogicItem {
1808
1847
  get name(): string;
1809
1848
  get survey(): SurveyModel;
1810
1849
  getVisibleLogicTypes(): Array<SurveyLogicType>;
1850
+ get expressionText(): any;
1851
+ get actionsText(): any;
1811
1852
  getDisplayText(): any;
1812
1853
  edit(): void;
1813
1854
  remove(): void;
@@ -1961,6 +2002,7 @@ export declare class TabDesignerViewModel extends Base {
1961
2002
  widthUpdater: any;
1962
2003
  checkNewPageHandler: any;
1963
2004
  surveyOnPropertyChanged: any;
2005
+ pagesControllerValue: PagesController;
1964
2006
  newPage: PageModel;
1965
2007
  showNewPage: boolean;
1966
2008
  pageCount: number;
@@ -1968,10 +2010,10 @@ export declare class TabDesignerViewModel extends Base {
1968
2010
  showPlaceholder: boolean;
1969
2011
  creator: CreatorBase;
1970
2012
  get survey(): SurveyModel;
2013
+ get pagesController(): PagesController;
1971
2014
  get isToolboxVisible(): boolean;
1972
2015
  get placeholderText(): string;
1973
2016
  initSurvey(): void;
1974
- onPagesChangedHandler: any;
1975
2017
  dispose(): void;
1976
2018
  clickDesigner(): void;
1977
2019
  getDesignerCss(): string;
@@ -1986,7 +2028,7 @@ export declare class TabbedMenuItem extends Action implements ITabbedMenuItem {
1986
2028
  renderTab: any;
1987
2029
  }
1988
2030
  export declare class TestSurveyTabViewModel extends Base {
1989
- constructor(surveyProvider: CreatorBase);
2031
+ constructor(surveyProvider: CreatorBase, startTheme?: any);
1990
2032
  json: any;
1991
2033
  pages: any;
1992
2034
  prevPageAction: Action;
@@ -2006,11 +2048,14 @@ export declare class TestSurveyTabViewModel extends Base {
2006
2048
  get survey(): SurveyModel;
2007
2049
  get pageActions(): any;
2008
2050
  get isPageToolbarVisible(): boolean;
2009
- setJSON(json: any): void;
2051
+ updateSimulatorSurvey(json: any, theme: any): void;
2052
+ setJSON(json: any, currTheme: any): void;
2010
2053
  initialize(json: any, options: any): void;
2011
2054
  show(): void;
2012
2055
  testAgain(): void;
2013
2056
  buildActions(): void;
2057
+ setTheme(themeName: string, themeMapper: any): void;
2058
+ getCurrThemeTitle(themeMapper: any): string;
2014
2059
  protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
2015
2060
  }
2016
2061
  export declare class ToolbarActionContainer extends ActionContainer {
@@ -2237,22 +2282,23 @@ export declare class LogicActionTriggerModel extends LogicActionModelBase {
2237
2282
  updatePanelElements(selectedElement: string, options?: ISurveyCreatorOptions): void;
2238
2283
  getSelectedElement(): string;
2239
2284
  }
2240
- export declare class PageViewModel extends ActionContainerViewModel {
2285
+ export declare class PageAdorner extends SurveyElementAdornerBase<PageModel> {
2241
2286
  constructor(creator: CreatorBase, page: PageModel);
2242
2287
  isSelected: boolean;
2243
2288
  isPageLive: boolean;
2244
2289
  onPageSelectedCallback: any;
2245
2290
  questionTypeSelectorModel: any;
2246
2291
  currentAddQuestionType: string;
2247
- _page: PageModel;
2292
+ protected attachElement(surveyElement: PageModel): void;
2248
2293
  protected onElementSelectedChanged(isSelected: boolean): void;
2249
2294
  dispose(): void;
2250
2295
  get isGhost(): boolean;
2251
2296
  protected isOperationsAllow(): boolean;
2297
+ protected getPage(): PageModel;
2252
2298
  get page(): PageModel;
2253
2299
  addGhostPage: any;
2254
- addNewQuestion(model: PageViewModel, event: IPortableMouseEvent): void;
2255
- select(model: PageViewModel, event: IPortableMouseEvent): void;
2300
+ addNewQuestion(model: PageAdorner, event: IPortableMouseEvent): void;
2301
+ select(model: PageAdorner, event: IPortableMouseEvent): void;
2256
2302
  get css(): string;
2257
2303
  hover(event: any, element: any): void;
2258
2304
  hoverStopper(event: any, element: any): void;
@@ -2282,12 +2328,13 @@ export declare class PropertyGridEditor implements IPropertyGridEditor {
2282
2328
  isSupportGrouping(): boolean;
2283
2329
  onUpdateQuestionCssClasses(obj: Base, options: any): void;
2284
2330
  }
2285
- export declare class QuestionAdornerViewModel extends ActionContainerViewModel {
2331
+ export declare class QuestionAdornerViewModel extends SurveyElementAdornerBase {
2286
2332
  constructor(creator: CreatorBase, surveyElement: SurveyElement, templateData: SurveyTemplateRendererTemplateData);
2287
2333
  templateData: SurveyTemplateRendererTemplateData;
2288
2334
  isDragged: boolean;
2289
2335
  currentAddQuestionType: string;
2290
2336
  dragOrClickHelper: DragOrClickHelper;
2337
+ get element(): SurveyElement;
2291
2338
  select(model: QuestionAdornerViewModel, event: IPortableMouseEvent): boolean;
2292
2339
  rootCss(): "" | " svc-question__adorner--start-with-new-line";
2293
2340
  css(): string;
@@ -2406,6 +2453,9 @@ export declare class TabTestPlugin implements ICreatorPlugin {
2406
2453
  languageSelectorAction: Action;
2407
2454
  languagePopupModel: any;
2408
2455
  languageListModel: ListModel;
2456
+ changeThemePopupModel: any;
2457
+ changeThemeModel: ListModel;
2458
+ changeThemeAction: Action;
2409
2459
  deviceSelectorAction: Action;
2410
2460
  deviceListModel: ListModel;
2411
2461
  orientationSelectorAction: Action;
@@ -2414,6 +2464,7 @@ export declare class TabTestPlugin implements ICreatorPlugin {
2414
2464
  designerAction: Action;
2415
2465
  prevPageAction: Action;
2416
2466
  nextPageAction: Action;
2467
+ simulatorTheme: any;
2417
2468
  model: TestSurveyTabViewModel;
2418
2469
  activate(): void;
2419
2470
  update(): void;
@@ -2730,7 +2781,7 @@ export declare class QuestionImageAdornerViewModel extends QuestionAdornerViewMo
2730
2781
  }
2731
2782
  export declare class QuestionRatingAdornerViewModel extends QuestionAdornerViewModel {
2732
2783
  constructor(creator: CreatorBase, surveyElement: SurveyElement, templateData: SurveyTemplateRendererTemplateData);
2733
- get question(): QuestionRatingModel;
2784
+ get element(): QuestionRatingModel;
2734
2785
  addItem(model: QuestionRatingAdornerViewModel): void;
2735
2786
  removeItem(model: QuestionRatingAdornerViewModel): void;
2736
2787
  get allowAdd(): boolean;
@@ -3316,6 +3367,8 @@ export declare var propertyGridCss: {
3316
3367
  buttonRemove: string,
3317
3368
  iconAdd: string,
3318
3369
  iconRemove: string,
3370
+ dragElementDecorator: string,
3371
+ iconDragElement: string,
3319
3372
  iconDrag: string,
3320
3373
  dragDropGhostPositionTop: string,
3321
3374
  dragDropGhostPositionBottom: string,
@@ -4196,5 +4249,6 @@ export declare var logicCss: {
4196
4249
  };
4197
4250
  export declare var initialSettingsAllowShowEmptyTitleInDesignMode: boolean;
4198
4251
  export declare var editableStringRendererName: any;
4199
- export declare var svgBundle: string;
4252
+ export declare var svgBundle: any;
4253
+ export declare var path: any;
4200
4254
  export declare var Version: string;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.21
2
+ * SurveyJS Creator v1.9.24
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.21
2
+ * SurveyJS Creator v1.9.24
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