survey-creator-core 1.11.5 → 1.11.6

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.
Files changed (85) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1 -1
  4. package/i18n/arabic.min.js +1 -1
  5. package/i18n/bulgarian.js +1 -1
  6. package/i18n/bulgarian.min.js +1 -1
  7. package/i18n/croatian.js +1 -1
  8. package/i18n/croatian.min.js +1 -1
  9. package/i18n/czech.js +1 -1
  10. package/i18n/czech.min.js +1 -1
  11. package/i18n/danish.js +1 -1
  12. package/i18n/danish.min.js +1 -1
  13. package/i18n/dutch.js +1 -1
  14. package/i18n/dutch.min.js +1 -1
  15. package/i18n/english.js +1 -1
  16. package/i18n/english.min.js +1 -1
  17. package/i18n/finnish.js +1 -1
  18. package/i18n/finnish.min.js +1 -1
  19. package/i18n/french.js +1 -1
  20. package/i18n/french.min.js +1 -1
  21. package/i18n/german.js +1 -1
  22. package/i18n/german.min.js +1 -1
  23. package/i18n/hebrew.js +1 -1
  24. package/i18n/hebrew.min.js +1 -1
  25. package/i18n/hungarian.js +1 -1
  26. package/i18n/hungarian.min.js +1 -1
  27. package/i18n/index.js +1 -1
  28. package/i18n/index.min.js +1 -1
  29. package/i18n/indonesian.js +1 -1
  30. package/i18n/indonesian.min.js +1 -1
  31. package/i18n/italian.js +1 -1
  32. package/i18n/italian.min.js +1 -1
  33. package/i18n/japanese.js +1 -1
  34. package/i18n/japanese.min.js +1 -1
  35. package/i18n/korean.js +1 -1
  36. package/i18n/korean.min.js +1 -1
  37. package/i18n/malay.js +1 -1
  38. package/i18n/malay.min.js +1 -1
  39. package/i18n/mongolian.js +1 -1
  40. package/i18n/mongolian.min.js +1 -1
  41. package/i18n/norwegian.js +1 -1
  42. package/i18n/norwegian.min.js +1 -1
  43. package/i18n/persian.js +1 -1
  44. package/i18n/persian.min.js +1 -1
  45. package/i18n/polish.js +1 -1
  46. package/i18n/polish.min.js +1 -1
  47. package/i18n/portuguese.js +1 -1
  48. package/i18n/portuguese.min.js +1 -1
  49. package/i18n/russian.js +1 -1
  50. package/i18n/russian.min.js +1 -1
  51. package/i18n/simplified-chinese.js +1 -1
  52. package/i18n/simplified-chinese.min.js +1 -1
  53. package/i18n/slovak.js +1 -1
  54. package/i18n/slovak.min.js +1 -1
  55. package/i18n/spanish.js +1 -1
  56. package/i18n/spanish.min.js +1 -1
  57. package/i18n/swedish.js +1 -1
  58. package/i18n/swedish.min.js +1 -1
  59. package/i18n/tajik.js +1 -1
  60. package/i18n/tajik.min.js +1 -1
  61. package/i18n/traditional-chinese.js +1 -1
  62. package/i18n/traditional-chinese.min.js +1 -1
  63. package/i18n/turkish.js +1 -1
  64. package/i18n/turkish.min.js +1 -1
  65. package/package.json +2 -2
  66. package/survey-creator-core.css +244 -36
  67. package/survey-creator-core.fontless.css +243 -35
  68. package/survey-creator-core.fontless.css.map +1 -1
  69. package/survey-creator-core.fontless.min.css +9 -9
  70. package/survey-creator-core.i18n.js +1 -1
  71. package/survey-creator-core.i18n.min.js +1 -1
  72. package/survey-creator-core.js +443 -89
  73. package/survey-creator-core.js.map +1 -1
  74. package/survey-creator-core.min.css +10 -10
  75. package/survey-creator-core.min.js +6 -6
  76. package/typings/components/action-container-view-model.d.ts +9 -1
  77. package/typings/components/question.d.ts +4 -2
  78. package/typings/components/tabs/designer-plugin.d.ts +2 -0
  79. package/typings/components/tabs/designer-state-manager.d.ts +17 -0
  80. package/typings/components/toolbox/toolbox-tool.d.ts +8 -4
  81. package/typings/creator-base.d.ts +18 -4
  82. package/typings/creator-events-api.d.ts +4 -0
  83. package/typings/creator-options.d.ts +12 -0
  84. package/typings/survey-helper.d.ts +1 -0
  85. package/typings/toolbox.d.ts +7 -0
@@ -1,5 +1,6 @@
1
- import { Base, AdaptiveActionContainer, Action, SurveyElement } from "survey-core";
1
+ import { Base, AdaptiveActionContainer, Action, SurveyElement, ActionContainer } from "survey-core";
2
2
  import { SurveyCreatorModel } from "../creator-base";
3
+ import { DesignerStateManager } from "./tabs/designer-state-manager";
3
4
  export declare class SurveyElementActionContainer extends AdaptiveActionContainer {
4
5
  private needToShrink;
5
6
  private setModeForActions;
@@ -10,7 +11,11 @@ export declare class SurveyElementAdornerBase<T extends SurveyElement = SurveyEl
10
11
  creator: SurveyCreatorModel;
11
12
  protected surveyElement: T;
12
13
  actionContainer: SurveyElementActionContainer;
14
+ topActionContainer: ActionContainer;
15
+ protected designerStateManager: DesignerStateManager;
13
16
  allowDragging: boolean;
17
+ collapsed: boolean;
18
+ renderedCollapsed: boolean;
14
19
  private allowEditOption;
15
20
  private selectedPropPageFunc;
16
21
  private sidebarFlyoutModeChangedFunc;
@@ -27,6 +32,9 @@ export declare class SurveyElementAdornerBase<T extends SurveyElement = SurveyEl
27
32
  protected updateActionVisibility(id: string, isVisible: boolean): void;
28
33
  getActionById(id: string): Action;
29
34
  protected buildActions(items: Array<Action>): void;
35
+ isDisableSelecting: boolean;
36
+ protected disableActionFocusing(isMouse: boolean, event: any): void;
37
+ protected canSelectElement(): boolean;
30
38
  get allowEdit(): boolean;
31
39
  get showAddQuestionButton(): boolean;
32
40
  protected setShowAddQuestionButton(val: boolean): void;
@@ -16,8 +16,9 @@ export declare class QuestionAdornerViewModel extends SurveyElementAdornerBase {
16
16
  private dragOrClickHelper;
17
17
  constructor(creator: SurveyCreatorModel, surveyElement: SurveyElement, templateData: SurveyTemplateRendererTemplateData);
18
18
  get element(): SurveyElement<any>;
19
+ protected canSelectElement(): boolean;
19
20
  select(model: QuestionAdornerViewModel, event: IPortableEvent): boolean;
20
- rootCss(): "" | " svc-question__adorner--start-with-new-line";
21
+ rootCss(): string;
21
22
  css(): string;
22
23
  get isDragMe(): boolean;
23
24
  get dragTypeOverMe(): DragTypeOverMeEnum;
@@ -43,7 +44,8 @@ export declare class QuestionAdornerViewModel extends SurveyElementAdornerBase {
43
44
  set isRequired(newVal: any);
44
45
  onPointerDown(pointerDownEvent: PointerEvent): void;
45
46
  startDragSurveyElement: (event: PointerEvent) => boolean;
46
- getConvertToTypesActions(): Array<IAction>;
47
+ private getConvertToTypes;
48
+ getConvertToTypesActions(parentAction?: Action): Array<IAction>;
47
49
  private get currentType();
48
50
  private createConvertToAction;
49
51
  private createConvertInputType;
@@ -3,6 +3,7 @@ import { SurveyCreatorModel } from "../../creator-base";
3
3
  import { ICreatorPlugin } from "../../creator-settings";
4
4
  import { PropertyGridViewModel } from "../../property-grid/property-grid-view-model";
5
5
  import { TabDesignerViewModel } from "./designer";
6
+ import { DesignerStateManager } from "./designer-state-manager";
6
7
  export declare class TabDesignerPlugin implements ICreatorPlugin {
7
8
  private creator;
8
9
  model: TabDesignerViewModel;
@@ -13,6 +14,7 @@ export declare class TabDesignerPlugin implements ICreatorPlugin {
13
14
  private saveSurveyAction;
14
15
  previewAction: Action;
15
16
  private designerAction;
17
+ designerStateManager: DesignerStateManager;
16
18
  private get isSurveySelected();
17
19
  private get isSettingsActive();
18
20
  private createVisibleUpdater;
@@ -0,0 +1,17 @@
1
+ import { SurveyElement, SurveyModel } from "survey-core";
2
+ declare class ElementState {
3
+ collapsed: boolean;
4
+ }
5
+ export declare class DesignerStateManager {
6
+ private elementState;
7
+ private pageState;
8
+ private getStateMapForElement;
9
+ private onQuestionAddedHandler;
10
+ private onPageAddedHandler;
11
+ private onPanelAddedHandler;
12
+ initForSurvey(survey: SurveyModel): void;
13
+ initForElement(element: SurveyElement): void;
14
+ getElementState(element: SurveyElement): ElementState;
15
+ constructor();
16
+ }
17
+ export {};
@@ -1,16 +1,20 @@
1
- import { Base } from "survey-core";
2
- import { IQuestionToolboxItem } from "../../toolbox";
1
+ import { Base, ActionContainer } from "survey-core";
2
+ import { IQuestionToolboxItem, QuestionToolboxItem } from "../../toolbox";
3
3
  import { SurveyCreatorModel } from "../../creator-base";
4
4
  export declare class ToolboxToolViewModel extends Base {
5
5
  protected item: IQuestionToolboxItem;
6
6
  protected creator: SurveyCreatorModel;
7
+ protected model: ActionContainer;
7
8
  private dragOrClickHelper;
8
- constructor(item: IQuestionToolboxItem, creator: SurveyCreatorModel);
9
+ constructor(item: IQuestionToolboxItem, creator: SurveyCreatorModel, model: ActionContainer);
9
10
  click: (event: any) => void;
11
+ get toolboxItem(): QuestionToolboxItem;
10
12
  get allowAdd(): boolean;
13
+ onMouseOver(itemValue: any, mouseoverEvent: any): void;
14
+ onMouseLeave(itemValue: any, mouseoverEvent: any): void;
11
15
  onPointerDown(pointerDownEvent: any): boolean;
12
- private _node;
13
16
  private onPointerUp;
14
17
  private startDragToolboxItem;
18
+ private hidePopup;
15
19
  private get dragDropHelper();
16
20
  }
@@ -1065,6 +1065,18 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
1065
1065
  get JSON(): any;
1066
1066
  set JSON(val: any);
1067
1067
  loadSurvey(surveyId: string): void;
1068
+ /**
1069
+ * Specifies where to add new questions when users click the "Add Question" button.
1070
+ *
1071
+ * Accepted values:
1072
+ *
1073
+ * - `true` (default)
1074
+ * New questions are added to the end of a survey page.
1075
+ *
1076
+ * - `false`
1077
+ * New questions are added after the currently selected question on the design surface.
1078
+ */
1079
+ addNewQuestionLast: boolean;
1068
1080
  protected doClickQuestionCore(element: IElement, modifiedType?: string, index?: number, panel?: IPanel): void;
1069
1081
  private isRowMultiline;
1070
1082
  private findRowByElement;
@@ -1081,11 +1093,12 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
1081
1093
  createNewElement(json: any): IElement;
1082
1094
  copyElement(element: Base): IElement;
1083
1095
  /**
1084
- * Creates a copy of a specified question and inserts the copy next to this question.
1096
+ * Creates a copy of a specified question, inserts the copy next to this question and optionally select it in the designer.
1085
1097
  * @param question A question to copy.
1098
+ * @param selectNewElement Select a new element if true
1086
1099
  * @returns The instance of a new question.
1087
1100
  */
1088
- fastCopyQuestion(question: Base): IElement;
1101
+ fastCopyQuestion(question: Base, selectNewElement?: boolean): IElement;
1089
1102
  /**
1090
1103
  * Gets or sets the focused survey element: a question, panel, page, or the survey itself.
1091
1104
  * @see onSelectedElementChanging
@@ -1309,8 +1322,8 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
1309
1322
  getAvailableToolboxItems(element?: SurveyElement, isAddNew?: boolean): Array<QuestionToolboxItem>;
1310
1323
  getQuestionTypeSelectorModel(beforeAdd: (type: string) => void, element?: SurveyElement): Action;
1311
1324
  getUpdatedPageAdornerFooterActions(pageAdorner: PageAdorner, actions: Array<IAction>): IAction[];
1312
- addNewQuestionInPage(beforeAdd: (string: any) => void, panel?: IPanel, type?: string): void;
1313
- createIActionBarItemByClass(className: string, title: string, iconName: string, needSeparator: boolean): Action;
1325
+ addNewQuestionInPage(beforeAdd: (string: any) => void, panel?: IPanel, type?: string, subtype?: string): void;
1326
+ createIActionBarItemByClass(item: QuestionToolboxItem, needSeparator: boolean, onSelectQuestionType?: (questionType: string, subtype?: string) => void): Action;
1314
1327
  onElementMenuItemsChanged(element: any, items: Action[]): void;
1315
1328
  getElementAllowOperations(element: SurveyElement): any;
1316
1329
  getChoicesItemBaseTitle(): any;
@@ -1349,6 +1362,7 @@ export declare class SurveyCreatorModel extends Base implements ISurveyCreatorOp
1349
1362
  * @see toolboxLocation
1350
1363
  */
1351
1364
  sidebarLocation: "left" | "right";
1365
+ expandCollapseButtonVisibility?: "never" | "onhover" | "always";
1352
1366
  selectFromStringEditor: boolean;
1353
1367
  isCreatorDisposed: boolean;
1354
1368
  dispose(): void;
@@ -777,6 +777,10 @@ export interface DragDropAllowEvent {
777
777
  * A survey within which the drag and drop operation occured.
778
778
  */
779
779
  survey?: SurveyModel;
780
+ /**
781
+ * A Boolean property that you can set to `false` if you want to disallow placing `draggedElement` on the same line with any other survey element.
782
+ */
783
+ allowDropNextToAnother?: boolean;
780
784
  /**
781
785
  * A Boolean property that you can set to `false` if you want to cancel the drag and drop operation.
782
786
  */
@@ -242,6 +242,18 @@ export interface ICreatorOptions {
242
242
  * Refer to the [Limit Available Question and Panel Types](https://surveyjs.io/Documentation/Survey-Creator?id=toolbox#limit-available-question-and-panel-types) help topic for more information.
243
243
  */
244
244
  questionTypes?: Array<string>;
245
+ /**
246
+ * Specifies where to add new questions when users click the "Add Question" button.
247
+ *
248
+ * Accepted values:
249
+ *
250
+ * - `true` (default)
251
+ * New questions are added to the end of a survey page.
252
+ *
253
+ * - `false`
254
+ * New questions are added after the currently selected question on the design surface.
255
+ */
256
+ addNewQuestionLast?: boolean;
245
257
  /**
246
258
  * Specifies how Survey Creator users edit survey pages.
247
259
  *
@@ -35,6 +35,7 @@ export declare class SurveyHelper {
35
35
  static warnNonSupported(name: string, newPropertyName?: string): void;
36
36
  static warnText(text: string): void;
37
37
  private static deleteConditionProperties;
38
+ private static deleteRandomProperties;
38
39
  static updateQuestionJson(questionJson: any): void;
39
40
  private static deleteConditionPropertiesFromArray;
40
41
  static convertMatrixRowsToText(rows: any): string;
@@ -35,6 +35,7 @@ export interface IQuestionToolboxItem extends IAction {
35
35
  * Toolbox item category. If it is empty, it goes to 'General' category.
36
36
  */
37
37
  category: string;
38
+ getArea?: (el: HTMLElement) => HTMLElement;
38
39
  }
39
40
  export interface IQuestionToolbox {
40
41
  toggleCategoryState(name: string): any;
@@ -73,6 +74,7 @@ export declare class QuestionToolboxItem extends Action implements IQuestionTool
73
74
  toJSON(): IQuestionToolboxItem;
74
75
  get typeName(): string;
75
76
  get isPanel(): boolean;
77
+ getArea(target: HTMLElement): HTMLElement;
76
78
  hasText(text: string): boolean;
77
79
  }
78
80
  /**
@@ -95,6 +97,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
95
97
  get itemSelector(): string;
96
98
  get containerSelector(): string;
97
99
  static getQuestionDefaultSettings(questionType: string): any;
100
+ static getSubTypePropertyName(questionType: string): string;
98
101
  /**
99
102
  * Modify this array to change the toolbox items order.
100
103
  */
@@ -207,6 +210,7 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
207
210
  * @see IQuestionToolboxItem
208
211
  */
209
212
  private getActionByItem;
213
+ private addSubTypes;
210
214
  addItem(item: IQuestionToolboxItem, index?: number): void;
211
215
  private correctItem;
212
216
  private get dragDropHelper();
@@ -341,8 +345,11 @@ export declare class QuestionToolbox extends AdaptiveActionContainer<QuestionToo
341
345
  private registerCustomWidgets;
342
346
  private registerComponentQuestions;
343
347
  private getComponentItems;
348
+ private getItemClassNames;
344
349
  private addItemFromJSON;
345
350
  private getQuestionJSON;
346
351
  private isHiddenCustomWidget;
347
352
  private getQuestionTypes;
353
+ hideAllInnerPopups(): void;
354
+ onScroll(model: any, event: any): void;
348
355
  }