survey-creator-core 1.9.47 → 1.9.48

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,15 +1,15 @@
1
1
  /*
2
- * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.47
2
+ * Type definition for Survey Creatorlibrary. Platform independent (core) v1.9.48
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, SurveyModel, ItemValue } from "survey-core";
7
7
  import { MatrixDropdownColumn, IAction, Action, ActionContainer, DragDropSurveyElements } from "survey-core";
8
8
  import { DragDropChoices, Event, AdaptiveActionContainer, PageModel, IElement } from "survey-core";
9
- import { IPanel, ISurveyElement, SurveyElement, QuestionSelectBase, QuestionRowModel } from "survey-core";
10
- import { LocalizableString, Operand, DragOrClickHelper, PanelModel, QuestionDropdownModel } from "survey-core";
11
- import { ListModel, PopupModel, EventBase, PanelModelBase, QuestionNonValue } from "survey-core";
12
- import { SurveyTemplateRendererTemplateData, QuestionRatingModel, ComputedUpdater, QuestionCheckboxModel, ILocalizableString } from "survey-core";
9
+ import { IPanel, ISurveyElement, SurveyElement, QuestionSelectBase, Operand } from "survey-core";
10
+ import { DragOrClickHelper, PanelModel, QuestionDropdownModel, ListModel, PopupModel } from "survey-core";
11
+ import { EventBase, PanelModelBase, QuestionNonValue, SurveyTemplateRendererTemplateData, QuestionRatingModel } from "survey-core";
12
+ import { QuestionRowModel, LocalizableString, ComputedUpdater, QuestionCheckboxModel, ILocalizableString } from "survey-core";
13
13
  import { ArrayChanges, ImageItemValue, HashTable, QuestionMatrixDynamicModel, QuestionMatrixModel } from "survey-core";
14
14
  import { QuestionMatrixDropdownModel, QuestionPanelDynamicModel, QuestionCommentModel, MatrixDynamicRowModel } from "survey-core";
15
15
 
@@ -42,7 +42,7 @@ export interface ISurveyCreatorOptions {
42
42
  maximumChoicesCount: number;
43
43
  maximumRowsCount: number;
44
44
  maximumRateValues: number;
45
- getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
45
+ getObjectDisplayName(obj: Base, area: string, 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
48
  onPropertyGridSurveyCreatedCallback(object: any, survey: SurveyModel): any;
@@ -340,7 +340,7 @@ export interface ICreatorSelectionOwner {
340
340
  survey: SurveyModel;
341
341
  selectElement(el: Base, propertyName?: string): any;
342
342
  selectedElement: Base;
343
- getObjectDisplayName(el: Base): string;
343
+ getObjectDisplayName(el: Base, area: string): string;
344
344
  }
345
345
  export interface ISelectionHistoryItem {
346
346
  obj: Base;
@@ -399,6 +399,7 @@ export interface IPropertyGridEditor {
399
399
  getJSON(obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions): any;
400
400
  showModalPropertyEditor?: (editor: IPropertyGridEditor, property: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => any;
401
401
  onCreated?: (obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions) => void;
402
+ validateValue?: (obj: Base, question: Question, prop: JsonObjectProperty, val: any) => string;
402
403
  onAfterRenderQuestion?: (obj: Base, prop: JsonObjectProperty, evtOptions: any) => void;
403
404
  createPropertyEditorSetup?: (obj: Base, prop: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => IPropertyEditorSetup;
404
405
  isPropertyEditorSetupEnabled?: (obj: Base, prop: JsonObjectProperty, question: Question, options: ISurveyCreatorOptions) => boolean;
@@ -653,21 +654,34 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
653
654
  */
654
655
  onSurveyInstanceCreated: Event<(sender: CreatorBase, options: any) => any, any>;
655
656
  /*
656
- * The event allows to display the custom name for objects: questions, pages and panels. By default the object name is using. You may show object title by setting showObjectTitles property to true.
657
- * Use this event, if you want custom display name for objects.
658
- * - sender the survey creator object that fires the event
659
- * - options.obj the survey object, Survey, Page, Panel or Question
660
- * - options.reason the name of the UI that requests the object display name.
661
- * - options.displayName change this property to show your custom display name for the object
657
+ * An event that is raised when Survey Creator obtains a survey element name to display it in the UI.
658
+ *
659
+ * Handle this event to replace survey element names in the UI with custom display texts.
660
+ * If you only want to replace the names with survey element titles, enable the [`showObjectTitles`](https://surveyjs.io/survey-creator/documentation/surveycreator#showObjectTitles) property instead of handling this event.
661
+ *
662
+ * The event handler accepts the following arguments:
662
663
  *
663
- * The list of possible values in options.reason:
664
- * - "condition" - raised from Condition modal window or on setup condition in a logic tab
665
- * - "survey-tester" - raised from page selector list in "Preview" tab
666
- * - "survey-tester-selected" - raised on setting page selector title in "Preview" tab
667
- * - "survey-translation" - raised from translation tab
668
- * - "property-editor" - raised on showing question property editor, for example "gotoName". It is raised for all elements (questions) in the dropdown.
669
- * - "property-grid" - raised from showing object selector for property grid in "Designer" tab.
670
- * - "property-grid-title" - raised on rendering selected object title in property grid in "Designer" tab.
664
+ * - `sender`- A Survey Creator instance that raised the event.
665
+ * - `options.obj` - The instance of a survey element (survey, page, question, or panel) whose name has been requested.
666
+ * - `options.area` - A Survey Creator UI element that requests the display name.
667
+ * - `"page-selector"` - Page selector on the design surface
668
+ * - `"condition-editor"` - Condition pop-up window or drop-down menus that allow users to select questions in the Logic tab
669
+ * - `"logic-tab:question-filter"` - Question filter in the Logic tab
670
+ * - `"preview-tab:page-list"` - Page list in the Preview tab
671
+ * - `"preview-tab:selected-page"` - Selected page name in the Preview tab
672
+ * - `"property-grid:property-editor"` - Property editors in the Property Grid
673
+ * - `"property-grid-header:element-list"` - Survey element list in the header of the Property Grid
674
+ * - `"property-grid-header:selected-element"` - Selected survey element in the header of the Property Grid
675
+ * - `"translation-tab"` - Translation tab
676
+ * - `options.displayName` - Modify this property to set a custom display text for the survey element.
677
+ * - `options.reason` - Obsolete. Use the `options.area` property instead.
678
+ * - `"condition"` - Use the `"condition-editor"` value of `options.area` instead.
679
+ * - `"survey-tester"` - Use the `"preview-tab:page-list"` value of `options.area` instead.
680
+ * - `"survey-tester-selected"` - Use the `"preview-tab:selected-page"` value of `options.area` instead.
681
+ * - `"survey-translation"` - Use the `"translation-tab"` value of `options.area` instead.
682
+ * - `"property-editor"` - Use the `"property-grid:property-editor"` value of `options.area` instead.
683
+ * - `"property-grid"` - Use the `"property-grid-header:element-list"` value of `options.area` instead.
684
+ * - `"property-grid-title"` - Use the `"property-grid-header:selected-element"` value of `options.area` instead.
671
685
  */
672
686
  onGetObjectDisplayName: Event<(sender: CreatorBase, options: any) => any, any>;
673
687
  /*
@@ -1349,7 +1363,7 @@ export declare class CreatorBase extends Base implements ISurveyCreatorOptions,
1349
1363
  get text(): string;
1350
1364
  set text(val: string);
1351
1365
  getSurveyJSON(): any;
1352
- getObjectDisplayName(obj: Base, reason?: string, displayName?: string): string;
1366
+ getObjectDisplayName(obj: Base, area: string, reason?: string, displayName?: string): string;
1353
1367
  createSurvey(json?: any, reason?: string): SurveyModel;
1354
1368
  protected createSurveyCore(json: any, reason: string): SurveyModel;
1355
1369
  _stateValue: string;
@@ -1536,20 +1550,6 @@ export declare class DescriptionMardownParser {
1536
1550
  static linkRegEx: any;
1537
1551
  parse(text: string): string;
1538
1552
  }
1539
- export declare class DesignTimeSurveyModel extends SurveyModel {
1540
- constructor(creator: CreatorBase, jsonObj?: any);
1541
- creator: CreatorBase;
1542
- isPopupEditorContent: boolean;
1543
- getElementWrapperComponentName(element: any, reason?: string): string;
1544
- getQuestionContentWrapperComponentName(element: any, reason?: string): string;
1545
- getElementWrapperComponentData(element: any, reason?: string): any;
1546
- getRowWrapperComponentName(row: QuestionRowModel): string;
1547
- getRowWrapperComponentData(row: QuestionRowModel): any;
1548
- getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string;
1549
- getItemValueWrapperComponentData(item: ItemValue, question: QuestionSelectBase): any;
1550
- getRendererForString(element: Base, name: string): string;
1551
- getRendererContextForString(element: Base, locStr: LocalizableString): any;
1552
- }
1553
1553
  export declare class EditableObject {
1554
1554
  constructor(obj: Base);
1555
1555
  static isCopyObject(obj: any): boolean;
@@ -1700,7 +1700,7 @@ export declare class Notifier extends Base {
1700
1700
  notify(message: string, type?: "info" | "error"): void;
1701
1701
  }
1702
1702
  export declare class ObjectSelector {
1703
- constructor(creator: CreatorBase, survey: SurveyModel, getObjectDisplayName?: (obj: Base, reason: string, displayName: string) => string);
1703
+ constructor(creator: CreatorBase, survey: SurveyModel, getObjectDisplayName?: (obj: Base, area: string, reason: string, displayName: string) => string);
1704
1704
  surveyValue: SurveyModel;
1705
1705
  deepestLevel: number;
1706
1706
  filteredTextInLow: string;
@@ -1719,7 +1719,7 @@ export declare class ObjectSelectorItem extends Action {
1719
1719
  hasText(filteredTextInLow: string): boolean;
1720
1720
  }
1721
1721
  export declare class ObjectSelectorModel extends Base {
1722
- constructor(creator: CreatorBase, getObjectDisplayName?: (obj: Base, reason: string, displayName: string) => string);
1722
+ constructor(creator: CreatorBase, getObjectDisplayName?: (obj: Base, area: string, reason: string, displayName: string) => string);
1723
1723
  selector: ObjectSelector;
1724
1724
  listModelValue: ListModel;
1725
1725
  isVisible: boolean;
@@ -1824,7 +1824,9 @@ export declare class QuestionConverter {
1824
1824
  }
1825
1825
  export declare class QuestionEmbeddedSurveyModel extends QuestionNonValue {
1826
1826
  constructor(name: string);
1827
- embeddedSurvey: SurveyModel;
1827
+ embeddedSurveyValue: SurveyModel;
1828
+ onEmbeddedSurveyValueChanged: any;
1829
+ get embeddedSurvey(): SurveyModel;
1828
1830
  getType(): string;
1829
1831
  }
1830
1832
  export declare class QuestionLinkValueModel extends Question {
@@ -2604,7 +2606,7 @@ export declare class Translation extends Base implements ITranslationLocales {
2604
2606
  protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
2605
2607
  get survey(): SurveyModel;
2606
2608
  set survey(val: SurveyModel);
2607
- reset(): void;
2609
+ reset(resetSelectedLocales?: boolean): void;
2608
2610
  canShowProperty(obj: Base, prop: JsonObjectProperty, isEmpty: boolean): boolean;
2609
2611
  get defaultLocale(): string;
2610
2612
  getLocaleName(loc: string): string;
@@ -2726,7 +2728,7 @@ export declare class EmptySurveyCreatorOptions implements ISurveyCreatorOptions
2726
2728
  maximumChoicesCount: number;
2727
2729
  maximumRowsCount: number;
2728
2730
  maximumRateValues: number;
2729
- getObjectDisplayName(obj: Base, reason: string, displayName: string): string;
2731
+ getObjectDisplayName(obj: Base, area: string, reason: string, displayName: string): string;
2730
2732
  onCanShowPropertyCallback(object: any, property: JsonObjectProperty, showMode: string, parentObj: any, parentProperty: JsonObjectProperty): boolean;
2731
2733
  onPropertyGridSurveyCreatedCallback(object: any, survey: SurveyModel): void;
2732
2734
  onPropertyEditorCreatedCallback(object: any, property: JsonObjectProperty, editor: Question): void;
@@ -3534,6 +3536,7 @@ export declare function findAction(actions: any, id: string): IAction;
3534
3536
  export declare function updateMatrixLogicExpandAction(question: QuestionMatrixDynamicModel, actions: any, row: MatrixDynamicRowModel): void;
3535
3537
  export declare function updateMatrixLogicRemoveAction(question: QuestionMatrixDynamicModel, actions: any, row: MatrixDynamicRowModel): void;
3536
3538
  export declare function updateMatrixRemoveAction(question: QuestionMatrixDynamicModel, actions: any, row: MatrixDynamicRowModel): void;
3539
+ export declare function initializeDesignTimeSurveyModel(model: any, creator: CreatorBase): void;
3537
3540
  export declare function getElementWrapperComponentName(element: any, reason: string, isPopupEditorContent: boolean): string;
3538
3541
  export declare function getQuestionContentWrapperComponentName(element: any): string;
3539
3542
  export declare function getElementWrapperComponentData(element: any, reason: string, creator: CreatorBase): any;
@@ -4162,6 +4165,7 @@ export declare var PropertyGridEditorCollection: {
4162
4165
  isEditorFit: (prop: JsonObjectProperty, asDefault?: boolean) => IPropertyGridEditor,
4163
4166
  getJSON: (obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions, context?: string) => any,
4164
4167
  onCreated: (obj: Base, question: Question, prop: JsonObjectProperty, options: ISurveyCreatorOptions) => any,
4168
+ validateValue: (obj: Base, question: Question, prop: JsonObjectProperty, value: any) => string,
4165
4169
  onAfterRenderQuestion: (obj: Base, prop: JsonObjectProperty, evtOptions: any) => void,
4166
4170
  onMatrixCellCreated: (obj: Base, prop: JsonObjectProperty, options: any) => void,
4167
4171
  onMatrixCellValueChanged: (obj: Base, prop: JsonObjectProperty, options: any) => void,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.47
2
+ * SurveyJS Creator v1.9.48
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.47
2
+ * SurveyJS Creator v1.9.48
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