survey-react 1.9.116 → 1.9.117

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.
package/survey.react.d.ts CHANGED
@@ -297,7 +297,6 @@ declare module "localizablestring" {
297
297
  get localizationName(): string;
298
298
  set localizationName(val: string);
299
299
  onGetTextCallback: (str: string) => string;
300
- onGetDefaultTextCallback: () => string;
301
300
  storeDefaultText: boolean;
302
301
  onGetLocalizationTextCallback: (str: string) => string;
303
302
  onStrChanged: (oldValue: string, newValue: string) => void;
@@ -383,6 +382,14 @@ declare module "localizablestring" {
383
382
  private getValuesKeys;
384
383
  }
385
384
  }
385
+ declare module "console-warnings" {
386
+ export class ConsoleWarnings {
387
+ static disposedObjectChangedProperty(propName: string, objType: string): void;
388
+ static inCorrectQuestionValue(questionName: string, val: any): void;
389
+ static warn(text: string): void;
390
+ static error(text: string): void;
391
+ }
392
+ }
386
393
  declare module "jsonobject" {
387
394
  import { Base } from "base";
388
395
  export interface IPropertyDecoratorOptions<T = any> {
@@ -699,13 +706,6 @@ declare module "conditionProcessValue" {
699
706
  private getIntValue;
700
707
  }
701
708
  }
702
- declare module "console-warnings" {
703
- export class ConsoleWarnings {
704
- static disposedObjectChangedProperty(propName: string, objType: string): void;
705
- static inCorrectQuestionValue(questionName: string, val: any): void;
706
- static warn(text: string): void;
707
- }
708
- }
709
709
  declare module "functionsfactory" {
710
710
  import { HashTable } from "helpers";
711
711
  export class FunctionFactory {
@@ -2626,380 +2626,782 @@ declare module "calculatedValue" {
2626
2626
  private ensureExpression;
2627
2627
  }
2628
2628
  }
2629
- declare module "questionfactory" {
2629
+ declare module "textPreProcessor" {
2630
2630
  import { Question } from "question";
2631
- import { IElement } from "base-interfaces";
2632
- export class QuestionFactory {
2633
- static Instance: QuestionFactory;
2634
- static get DefaultChoices(): string[];
2635
- static get DefaultColums(): string[];
2636
- static get DefaultRows(): string[];
2637
- static get DefaultMutlipleTextItems(): string[];
2638
- registerQuestion(questionType: string, questionCreator: (name: string) => Question): void;
2639
- registerCustomQuestion(questionType: string): void;
2640
- unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
2641
- clear(): void;
2642
- getAllTypes(): Array<string>;
2643
- createQuestion(questionType: string, name: string): Question;
2644
- }
2645
- export class ElementFactory {
2646
- static Instance: ElementFactory;
2647
- private creatorHash;
2648
- registerElement(elementType: string, elementCreator: (name: string) => IElement): void;
2649
- registerCustomQuestion: (questionType: string) => void;
2650
- clear(): void;
2651
- unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
2652
- getAllTypes(): Array<string>;
2653
- createElement(elementType: string, name: string): IElement;
2654
- }
2655
- }
2656
- declare module "error" {
2657
- import { SurveyError } from "survey-error";
2658
- import { ISurveyErrorOwner } from "base-interfaces";
2659
- export class AnswerRequiredError extends SurveyError {
2660
- text: string;
2661
- constructor(text?: string, errorOwner?: ISurveyErrorOwner);
2662
- getErrorType(): string;
2663
- protected getDefaultText(): string;
2664
- }
2665
- export class OneAnswerRequiredError extends SurveyError {
2666
- text: string;
2667
- constructor(text?: string, errorOwner?: ISurveyErrorOwner);
2668
- getErrorType(): string;
2669
- protected getDefaultText(): string;
2670
- }
2671
- export class RequreNumericError extends SurveyError {
2672
- text: string;
2673
- constructor(text?: string, errorOwner?: ISurveyErrorOwner);
2674
- getErrorType(): string;
2675
- protected getDefaultText(): string;
2676
- }
2677
- export class ExceedSizeError extends SurveyError {
2678
- private maxSize;
2679
- constructor(maxSize: number, errorOwner?: ISurveyErrorOwner);
2680
- getErrorType(): string;
2681
- getDefaultText(): string;
2682
- private getTextSize;
2683
- }
2684
- export class WebRequestError extends SurveyError {
2685
- status: string;
2686
- response: string;
2687
- constructor(status: string, response: string, errorOwner?: ISurveyErrorOwner);
2688
- getErrorType(): string;
2689
- protected getDefaultText(): string;
2690
- }
2691
- export class WebRequestEmptyError extends SurveyError {
2692
- text: string;
2693
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2694
- getErrorType(): string;
2695
- protected getDefaultText(): string;
2696
- }
2697
- export class OtherEmptyError extends SurveyError {
2698
- text: string;
2699
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2700
- getErrorType(): string;
2701
- protected getDefaultText(): string;
2702
- }
2703
- export class UploadingFileError extends SurveyError {
2704
- text: string;
2705
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2706
- getErrorType(): string;
2707
- protected getDefaultText(): string;
2708
- }
2709
- export class RequiredInAllRowsError extends SurveyError {
2710
- text: string;
2711
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2712
- getErrorType(): string;
2713
- protected getDefaultText(): string;
2714
- }
2715
- export class MinRowCountError extends SurveyError {
2716
- minRowCount: number;
2717
- constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner);
2718
- getErrorType(): string;
2719
- protected getDefaultText(): string;
2720
- }
2721
- export class KeyDuplicationError extends SurveyError {
2722
- text: string;
2723
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2724
- getErrorType(): string;
2725
- protected getDefaultText(): string;
2631
+ import { PanelModel } from "panel";
2632
+ import { ISurvey, ITextProcessor } from "base-interfaces";
2633
+ export class TextPreProcessorItem {
2634
+ start: number;
2635
+ end: number;
2726
2636
  }
2727
- export class CustomError extends SurveyError {
2728
- text: string;
2729
- constructor(text: string, errorOwner?: ISurveyErrorOwner);
2730
- getErrorType(): string;
2637
+ export class TextPreProcessorValue {
2638
+ name: string;
2639
+ returnDisplayValue: boolean;
2640
+ constructor(name: string, returnDisplayValue: boolean);
2641
+ value: any;
2642
+ isExists: boolean;
2643
+ canProcess: boolean;
2731
2644
  }
2732
- }
2733
- declare module "drag-drop-helper-v1" {
2734
- import { IElement, ISurveyElement } from "base-interfaces";
2735
- export class DragDropInfo {
2736
- source: IElement;
2737
- target: IElement;
2738
- nestedPanelDepth: number;
2739
- constructor(source: IElement, target: IElement, nestedPanelDepth?: number);
2740
- destination: ISurveyElement;
2741
- isBottom: boolean;
2742
- isEdge: boolean;
2645
+ export class TextPreProcessor {
2646
+ private _unObservableValues;
2647
+ private get hasAllValuesOnLastRunValue();
2648
+ private set hasAllValuesOnLastRunValue(value);
2649
+ onProcess: (textValue: TextPreProcessorValue) => void;
2650
+ process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean): string;
2651
+ processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
2652
+ get hasAllValuesOnLastRun(): boolean;
2653
+ private getItems;
2654
+ private getName;
2743
2655
  }
2744
- }
2745
- declare module "drag-drop-panel-helper-v1" {
2746
- import { IElement, ISurveyElement } from "base-interfaces";
2747
- import { DragDropInfo } from "drag-drop-helper-v1";
2748
- import { PanelModelBase, QuestionRowModel } from "panel";
2749
- export class DragDropPanelHelperV1 {
2750
- private panel;
2751
- constructor(panel: PanelModelBase);
2752
- dragDropAddTarget(dragDropInfo: DragDropInfo): void;
2753
- dragDropFindRow(findElement: ISurveyElement): QuestionRowModel;
2754
- dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void;
2755
- updateRowsOnElementAdded(element: IElement, index: number, dragDropInfo?: DragDropInfo, thisElement?: PanelModelBase): void;
2756
- private dragDropAddTargetToRow;
2757
- private dragDropAddTargetToEmptyPanel;
2758
- private dragDropAddTargetToExistingRow;
2759
- private dragDropAddTargetToNewRow;
2760
- private dragDropAddTargetToEmptyPanelCore;
2656
+ export class QuestionTextProcessor implements ITextProcessor {
2657
+ protected variableName: string;
2658
+ private textPreProcessor;
2659
+ constructor(variableName: string);
2660
+ processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
2661
+ protected get survey(): ISurvey;
2662
+ protected get panel(): PanelModel;
2663
+ protected getValues(): any;
2664
+ protected getQuestionByName(name: string): Question;
2665
+ protected getParentTextProcessor(): ITextProcessor;
2666
+ protected onCustomProcessText(textValue: TextPreProcessorValue): boolean;
2667
+ protected getQuestionDisplayText(question: Question): string;
2668
+ private getProcessedTextValue;
2669
+ processText(text: string, returnDisplayValue: boolean): string;
2670
+ processTextEx(text: string, returnDisplayValue: boolean): any;
2671
+ private processTextCore;
2761
2672
  }
2762
2673
  }
2763
- declare module "panel" {
2674
+ declare module "question_custom" {
2675
+ import { Question, IConditionObject } from "question";
2676
+ import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "base-interfaces";
2677
+ import { SurveyElement } from "survey-element";
2678
+ import { PanelModel } from "panel";
2764
2679
  import { HashTable } from "helpers";
2765
- import { Base } from "base";
2766
- import { ISurveyImpl, IPage, IPanel, IConditionRunner, IElement, ISurveyElement, IQuestion, ISurveyErrorOwner, ITitleOwner, IProgressInfo, ISurvey, IFindElement } from "base-interfaces";
2767
- import { DragTypeOverMeEnum, SurveyElement } from "survey-element";
2768
- import { Question } from "question";
2769
- import { LocalizableString } from "localizablestring";
2770
- import { findScrollableParent } from "utils/utils";
2771
- import { SurveyError } from "survey-error";
2772
- import { IAction } from "actions/action";
2773
- import { ActionContainer } from "actions/container";
2774
- import { DragDropInfo } from "drag-drop-helper-v1";
2775
- export class QuestionRowModel extends Base {
2776
- panel: PanelModelBase;
2777
- private static rowCounter;
2778
- private static getRowId;
2779
- protected _scrollableParent: any;
2780
- protected _updateVisibility: any;
2781
- startLazyRendering(rowContainerDiv: HTMLElement, findScrollableContainer?: typeof findScrollableParent): void;
2782
- ensureVisibility(): void;
2783
- stopLazyRendering(): void;
2784
- private idValue;
2785
- constructor(panel: PanelModelBase);
2786
- private isLazyRenderingValue;
2787
- setIsLazyRendering(val: boolean): void;
2788
- isLazyRendering(): boolean;
2789
- get id(): string;
2790
- get elements(): Array<IElement>;
2791
- get visibleElements(): Array<IElement>;
2792
- get visible(): boolean;
2793
- set visible(val: boolean);
2794
- get isNeedRender(): boolean;
2795
- set isNeedRender(val: boolean);
2796
- updateVisible(): void;
2797
- addElement(q: IElement): void;
2798
- get index(): number;
2799
- private setWidth;
2800
- private getRenderedCalcWidth;
2801
- private getElementWidth;
2802
- private getRenderedWidthFromWidth;
2803
- private calcVisible;
2804
- private needToUpdateVisibleElements;
2805
- dragTypeOverMe: DragTypeOverMeEnum;
2806
- dispose(): void;
2807
- getRowCss(): string;
2808
- }
2680
+ import { ItemValue } from "itemvalue";
2809
2681
  /**
2810
- * A base class for the [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) and [PageModel](https://surveyjs.io/form-library/documentation/pagemodel) classes.
2682
+ * An interface used to create custom question types.
2683
+ *
2684
+ * Refer to the following articles for more information:
2685
+ *
2686
+ * - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types)
2687
+ * - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types)
2811
2688
  */
2812
- export class PanelModelBase extends SurveyElement<Question> implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner {
2813
- private static panelCounter;
2814
- private static getPanelId;
2815
- private elementsValue;
2816
- private isQuestionsReady;
2817
- private questionsValue;
2818
- addElementCallback: (element: IElement) => void;
2819
- removeElementCallback: (element: IElement) => void;
2820
- onGetQuestionTitleLocation: () => string;
2821
- private dragDropPanelHelper;
2822
- constructor(name?: string);
2823
- getType(): string;
2824
- setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
2825
- endLoadingFromJson(): void;
2826
- showTitle: boolean;
2827
- get hasTitle(): boolean;
2828
- delete(doDispose?: boolean): void;
2829
- protected removeFromParent(): void;
2830
- protected canShowTitle(): boolean;
2831
- showDescription: boolean;
2832
- get _showDescription(): boolean;
2833
- localeChanged(): void;
2834
- locStrsChanged(): void;
2835
- get renderedNavigationTitle(): string;
2689
+ export interface ICustomQuestionTypeConfiguration {
2836
2690
  /**
2837
- * Returns a character or text string that indicates a required panel/page.
2838
- * @see SurveyModel.requiredText
2839
- * @see isRequired
2691
+ * A name used to identify a custom question type.
2692
+ *
2693
+ * @see title
2840
2694
  */
2841
- get requiredText(): string;
2842
- protected get titlePattern(): string;
2843
- get isRequireTextOnStart(): boolean;
2844
- get isRequireTextBeforeTitle(): boolean;
2845
- get isRequireTextAfterTitle(): boolean;
2695
+ name: string;
2846
2696
  /**
2847
- * Specifies a custom error message for a required panel/page.
2848
- * @see isRequired
2849
- * @see requiredIf
2697
+ * A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used.
2698
+ *
2699
+ * @see name
2850
2700
  */
2851
- get requiredErrorText(): string;
2852
- set requiredErrorText(val: string);
2853
- get locRequiredErrorText(): LocalizableString;
2701
+ title?: string;
2854
2702
  /**
2855
- * Specifies the sort order of questions in the panel/page.
2856
- *
2857
- * Possible values:
2703
+ * The name of an icon to use for the custom question type.
2858
2704
  *
2859
- * - `"initial"` - Preserves the original order of questions.
2860
- * - `"random"` - Displays questions in random order.
2861
- * - `"default"` (default) - Inherits the setting from the Survey's `questionsOrder` property.
2862
- * @see SurveyModel.questionsOrder
2863
- * @see areQuestionsRandomized
2705
+ * [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
2864
2706
  */
2865
- get questionsOrder(): string;
2866
- set questionsOrder(val: string);
2867
- private canRandomize;
2868
- protected isRandomizing: boolean;
2869
- randomizeElements(isRandom: boolean): void;
2707
+ iconName?: string;
2708
+ internal?: boolean;
2870
2709
  /**
2871
- * Returns `true` if elements in this panel/page are arranged in random order.
2872
- * @see questionsOrder
2710
+ * A function that is called when the custom question type is initialized. Use it to add, remove, or modify the type's properties (see [Override Base Question Properties](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types#override-base-question-properties)).
2873
2711
  */
2874
- get areQuestionsRandomized(): boolean;
2712
+ onInit?(): void;
2875
2713
  /**
2876
- * Returns a survey element (panel or page) that contains this panel and allows you to move this question to a different survey element.
2714
+ * Specifies whether the custom question type is available in the Toolbox and the Add Question menu.
2877
2715
  *
2878
- * This property is always `null` for the `PageModel` object.
2716
+ * Default value: `true`
2717
+ *
2718
+ * Set this property to `false` if your custom question type is used only to customize Property Grid content and is not meant for a survey.
2879
2719
  */
2880
- get parent(): PanelModelBase;
2881
- set parent(val: PanelModelBase);
2882
- get depth(): number;
2720
+ showInToolbox?: boolean;
2883
2721
  /**
2884
- * A Boolean expression. If it evaluates to `false`, this panel/page becomes hidden.
2722
+ * A function that is called when the custom question is created. Use it to access questions nested within a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
2885
2723
  *
2886
- * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
2724
+ * Parameters:
2887
2725
  *
2888
- * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility)
2889
- * @see visible
2890
- * @see isVisible
2891
- */
2892
- get visibleIf(): string;
2893
- set visibleIf(val: string);
2894
- protected calcCssClasses(css: any): any;
2895
- /**
2896
- * An auto-generated unique element identifier.
2897
- */
2898
- get id(): string;
2899
- set id(val: string);
2900
- /**
2901
- * Returns `true` if the survey element is a panel.
2902
- * @see Base.getType
2726
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2727
+ * The custom question.
2903
2728
  */
2904
- get isPanel(): boolean;
2905
- getPanel(): IPanel;
2906
- getLayoutType(): string;
2907
- isLayoutTypeSupported(layoutType: string): boolean;
2729
+ onCreated?(question: Question): void;
2908
2730
  /**
2909
- * An array of all questions within this panel/page. Includes questions within nested panels.
2910
- * @see elements
2731
+ * A function that is called when JSON schemas are loaded.
2732
+ *
2733
+ * Parameters:
2734
+ *
2735
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2736
+ * A custom question.
2911
2737
  */
2912
- get questions(): Array<Question>;
2913
- getQuestions(includeNested: boolean): Array<Question>;
2914
- protected getValidName(name: string): string;
2738
+ onLoaded?(question: Question): void;
2915
2739
  /**
2916
- * Returns a question with a specified `name`. This method does not find questions within nested panels.
2917
- * @param name A question name.
2740
+ * A function that is called after the entire question is rendered.
2741
+ *
2742
+ * Parameters:
2743
+ *
2744
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2745
+ * A custom question.
2746
+ * - `htmlElement`: `any`\
2747
+ * An HTML element that represents the custom question.
2918
2748
  */
2919
- getQuestionByName(name: string): Question;
2749
+ onAfterRender?(question: Question, htmlElement: any): void;
2920
2750
  /**
2921
- * Returns a survey element with a specified `name`. This method can find survey elements within nested elements.
2922
- * @param name An element name.
2751
+ * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) is rendered.
2752
+ *
2753
+ * Parameters:
2754
+ *
2755
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2756
+ * A composite question.
2757
+ * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2758
+ * A nested question.
2759
+ * - `htmlElement`: `any`\
2760
+ * An HTML element that represents a nested question.
2923
2761
  */
2924
- getElementByName(name: string): IElement;
2925
- getQuestionByValueName(valueName: string): Question;
2762
+ onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void;
2926
2763
  /**
2927
- * Returns a JSON object with question values nested in the panel/page.
2928
- * @see getDisplayValue
2764
+ * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) requires an update of its CSS classes.
2765
+ *
2766
+ * Parameters:
2767
+ *
2768
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2769
+ * A composite question.
2770
+ * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2771
+ * A nested question.
2772
+ * - `cssClasses`: `any`\
2773
+ * An object with CSS classes applied to a nested question, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes.
2929
2774
  */
2930
- getValue(): any;
2931
- collectValues(data: any, level: number): boolean;
2775
+ onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void;
2932
2776
  /**
2933
- * Returns a JSON object with display texts that correspond to question values nested in the panel/page.
2934
- * @param keysAsText Pass `true` if not only values in the object should be display texts, but also keys. Default value: `false`.
2935
- * @see getValue
2777
+ * A function that is called when a custom question type property is changed. Use it to handle property changes.
2778
+ *
2779
+ * Parameters:
2780
+ *
2781
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2782
+ * A custom question.
2783
+ * - `propertyName`: `string`\
2784
+ * The name of the changed property.
2785
+ * - `newValue`: `any`\
2786
+ * A new value for the property.
2936
2787
  */
2937
- getDisplayValue(keysAsText: boolean): any;
2788
+ onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
2938
2789
  /**
2939
- * Returns a JSON object with comments left to questions within this panel/page. Question names are used as keys.
2790
+ * A function that is called after the question value is changed.
2791
+ *
2792
+ * Parameters:
2793
+ *
2794
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2795
+ * A custom question.
2796
+ * - `name`: `string`\
2797
+ * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
2798
+ * - `newValue`: `any`\
2799
+ * A new value for the question.
2940
2800
  */
2941
- getComments(): any;
2801
+ onValueChanged?(question: Question, name: string, newValue: any): void;
2942
2802
  /**
2943
- * Removes values that cannot be assigned to nested questions, for example, choices unlisted in the `choices` array.
2803
+ * A function that is called before a question value is changed.
2944
2804
  *
2945
- * Call this method after you assign new question values in code to ensure that they are acceptable.
2805
+ * This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
2946
2806
  *
2947
- * > This method does not remove values for invisible questions and values that fail validation. Call the `validate()` method to validate newly assigned values.
2807
+ * Parameters:
2948
2808
  *
2949
- * @see validate
2809
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2810
+ * A custom question.
2811
+ * - `name`: `string`\
2812
+ * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
2813
+ * - `newValue`: `any`\
2814
+ * A new value for the question.
2950
2815
  */
2951
- clearIncorrectValues(): void;
2816
+ onValueChanging?(question: Question, name: string, newValue: any): any;
2952
2817
  /**
2953
- * Empties the `errors` array for this panel/page and all its child elements (panels and questions).
2954
- * @see errors
2818
+ * A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed.
2819
+ *
2820
+ * Parameters:
2821
+ *
2822
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2823
+ * A custom question.
2824
+ * - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\
2825
+ * An `ItemValue` object.
2826
+ * - `options.propertyName`: `string`\
2827
+ * The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`).
2828
+ * - `options.name`: `string`\
2829
+ * The name of the changed property: `"text"` or `"value"`.
2830
+ * - `options.newValue`: `any`\
2831
+ * A new value for the property.
2955
2832
  */
2956
- clearErrors(): void;
2957
- private markQuestionListDirty;
2833
+ onItemValuePropertyChanged?(question: Question, options: {
2834
+ obj: ItemValue;
2835
+ propertyName: string;
2836
+ name: string;
2837
+ newValue: any;
2838
+ }): void;
2958
2839
  /**
2959
- * An array of all survey elements (questions or panels) within this panel/page. Does not include questions within nested panels.
2960
- * @see questions
2840
+ * A function that allows you to override the default `getDisplayValue()` implementation.
2961
2841
  */
2962
- get elements(): Array<IElement>;
2963
- getElementsInDesign(includeHidden?: boolean): Array<IElement>;
2842
+ getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any);
2964
2843
  /**
2965
- * Checks whether a given element belongs to this panel/page or nested panels.
2966
- * @param element A survey element to check.
2844
+ * JSON schemas of nested questions. Specify this property to create a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
2967
2845
  */
2968
- containsElement(element: IElement): boolean;
2846
+ elementsJSON?: any;
2969
2847
  /**
2970
- * Makes the panel/page require an answer at least in one nested question. If a respondent leaves the panel/page without any answers, the survey displays a validation error.
2971
- * @see requiredIf
2972
- * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
2848
+ * A function that allows you to create nested questions if you do not specify the `elementsJSON` property.
2849
+ *
2850
+ * @see elementsJSON
2973
2851
  */
2974
- get isRequired(): boolean;
2975
- set isRequired(val: boolean);
2852
+ createElements?: any;
2976
2853
  /**
2977
- * A Boolean expression. If it evaluates to `true`, this panel/page becomes required (at least one question in the panel/page should have an answer).
2978
- *
2979
- * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
2854
+ * A JSON schema for a built-in question type on which the custom question type is based.
2980
2855
  *
2981
- * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility)
2982
- * @see isRequired
2856
+ * Refer to the [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) help topic for more information.
2983
2857
  */
2984
- get requiredIf(): string;
2985
- set requiredIf(val: string);
2986
- searchText(text: string, founded: Array<IFindElement>): void;
2987
- hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
2858
+ questionJSON?: any;
2988
2859
  /**
2989
- * Validates questions within this panel or page and returns `false` if the validation fails.
2990
- * @param fireCallback *(Optional)* Pass `false` if you do not want to show validation errors in the UI.
2991
- * @param focusOnFirstError *(Optional)* Pass `true` if you want to focus the first question with a validation error.
2992
- * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
2860
+ * A function that allows you to create a custom question if you do not specify the `questionJSON` property.
2861
+ *
2862
+ * @see questionJSON
2993
2863
  */
2994
- validate(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
2995
- validateContainerOnly(): void;
2996
- private hasErrorsInPanels;
2997
- getErrorCustomText(text: string, error: SurveyError): string;
2998
- private hasRequiredError;
2999
- protected hasErrorsCore(rec: any): void;
3000
- protected getContainsErrors(): boolean;
3001
- updateElementVisibility(): void;
3002
- getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question;
2864
+ createQuestion?: any;
2865
+ valueToQuestion?: (val: any) => any;
2866
+ valueFromQuestion?: (val: any) => any;
2867
+ getValue?: (val: any) => any;
2868
+ setValue?: (val: any) => any;
2869
+ }
2870
+ export class ComponentQuestionJSON {
2871
+ name: string;
2872
+ json: ICustomQuestionTypeConfiguration;
2873
+ constructor(name: string, json: ICustomQuestionTypeConfiguration);
2874
+ onInit(): void;
2875
+ onCreated(question: Question): void;
2876
+ onLoaded(question: Question): void;
2877
+ onAfterRender(question: Question, htmlElement: any): void;
2878
+ onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void;
2879
+ onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void;
2880
+ onPropertyChanged(question: Question, propertyName: string, newValue: any): void;
2881
+ onValueChanged(question: Question, name: string, newValue: any): void;
2882
+ onValueChanging(question: Question, name: string, newValue: any): any;
2883
+ onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void;
2884
+ getDisplayValue(keyAsText: boolean, value: any, question: Question): any;
2885
+ setValueToQuestion(val: any): any;
2886
+ getValueFromQuestion(val: any): any;
2887
+ get isComposite(): boolean;
2888
+ }
2889
+ export class ComponentCollection {
2890
+ static Instance: ComponentCollection;
2891
+ private customQuestionValues;
2892
+ onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel;
2893
+ onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel;
2894
+ onAddingJson: (name: string, isComposite: boolean) => void;
2895
+ add(json: ICustomQuestionTypeConfiguration): void;
2896
+ remove(componentName: string): boolean;
2897
+ get items(): Array<ComponentQuestionJSON>;
2898
+ getCustomQuestionByName(name: string): ComponentQuestionJSON;
2899
+ private getCustomQuestionIndex;
2900
+ private removeByIndex;
2901
+ clear(includeInternal?: boolean): void;
2902
+ createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question;
2903
+ protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel;
2904
+ protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel;
2905
+ }
2906
+ export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel {
2907
+ customQuestion: ComponentQuestionJSON;
2908
+ constructor(name: string, customQuestion: ComponentQuestionJSON);
2909
+ getType(): string;
2910
+ locStrsChanged(): void;
2911
+ protected createWrapper(): void;
2912
+ protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
2913
+ itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void;
2914
+ onFirstRendering(): void;
2915
+ onHidingContent(): void;
2916
+ getProgressInfo(): IProgressInfo;
2917
+ protected abstract getElement(): SurveyElement;
2918
+ protected initElement(el: SurveyElement): void;
2919
+ protected isSettingValOnLoading: boolean;
2920
+ setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
2921
+ onSurveyLoad(): void;
2922
+ afterRenderQuestionElement(el: HTMLElement): void;
2923
+ afterRenderCore(el: any): void;
2924
+ protected onUpdateQuestionCssClasses(element: Question, css: any): void;
2925
+ protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
2926
+ protected setNewValue(newValue: any): void;
2927
+ getSurveyData(): ISurveyData;
2928
+ getTextProcessor(): ITextProcessor;
2929
+ getValue(name: string): any;
2930
+ setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
2931
+ protected getQuestionByName(name: string): IQuestion;
2932
+ protected isValueChanging(name: string, newValue: any): boolean;
2933
+ protected convertDataName(name: string): string;
2934
+ protected convertDataValue(name: string, newValue: any): any;
2935
+ getVariable(name: string): any;
2936
+ setVariable(name: string, newValue: any): void;
2937
+ getComment(name: string): string;
2938
+ setComment(name: string, newValue: string, locNotification: any): any;
2939
+ getAllValues(): any;
2940
+ getFilteredValues(): any;
2941
+ getFilteredProperties(): any;
2942
+ findQuestionByName(name: string): IQuestion;
2943
+ addElement(element: IElement, index: number): void;
2944
+ removeElement(element: IElement): boolean;
2945
+ getQuestionTitleLocation(): string;
2946
+ getQuestionStartIndex(): string;
2947
+ getChildrenLayoutType(): string;
2948
+ elementWidthChanged(el: IElement): void;
2949
+ get elements(): Array<IElement>;
2950
+ indexOf(el: IElement): number;
2951
+ ensureRowsVisibility(): void;
2952
+ validateContainerOnly(): void;
2953
+ getQuestionErrorLocation(): string;
2954
+ protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any;
2955
+ }
2956
+ export class QuestionCustomModel extends QuestionCustomModelBase {
2957
+ private questionWrapper;
2958
+ private hasJSONTitle;
2959
+ getTemplate(): string;
2960
+ protected createWrapper(): void;
2961
+ protected getElement(): SurveyElement;
2962
+ onAnyValueChanged(name: string, questionName: string): void;
2963
+ protected getQuestionByName(name: string): IQuestion;
2964
+ protected getDefaultTitle(): string;
2965
+ setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
2966
+ protected onSetData(): void;
2967
+ hasErrors(fireCallback?: boolean, rec?: any): boolean;
2968
+ focus(onError?: boolean): void;
2969
+ afterRenderCore(el: any): void;
2970
+ get contentQuestion(): Question;
2971
+ protected createQuestion(): Question;
2972
+ onSurveyLoad(): void;
2973
+ runCondition(values: HashTable<any>, properties: HashTable<any>): void;
2974
+ protected convertDataName(name: string): string;
2975
+ protected convertDataValue(name: string, newValue: any): any;
2976
+ protected getContentQuestionValue(): any;
2977
+ protected setContentQuestionValue(val: any): void;
2978
+ protected canSetValueToSurvey(): boolean;
2979
+ protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
2980
+ onSurveyValueChanged(newValue: any): void;
2981
+ protected getValueCore(): any;
2982
+ private isSettingValueChanged;
2983
+ protected setValueChangedDirectly(val: boolean): void;
2984
+ protected initElement(el: SurveyElement): void;
2985
+ updateElementCss(reNew?: boolean): void;
2986
+ protected updateElementCssCore(cssClasses: any): void;
2987
+ protected getDisplayValueCore(keyAsText: boolean, value: any): any;
2988
+ }
2989
+ export class QuestionCompositeModel extends QuestionCustomModelBase {
2990
+ customQuestion: ComponentQuestionJSON;
2991
+ static ItemVariableName: string;
2992
+ private panelWrapper;
2993
+ private textProcessing;
2994
+ constructor(name: string, customQuestion: ComponentQuestionJSON);
2995
+ protected createWrapper(): void;
2996
+ getTemplate(): string;
2997
+ protected getElement(): SurveyElement;
2998
+ protected getCssRoot(cssClasses: any): string;
2999
+ get contentPanel(): PanelModel;
3000
+ hasErrors(fireCallback?: boolean, rec?: any): boolean;
3001
+ updateElementCss(reNew?: boolean): void;
3002
+ getTextProcessor(): ITextProcessor;
3003
+ findQuestionByName(name: string): IQuestion;
3004
+ protected clearValueIfInvisibleCore(reason: string): void;
3005
+ onAnyValueChanged(name: string, questionName: string): void;
3006
+ get hasSingleInput(): boolean;
3007
+ get isContainer(): boolean;
3008
+ protected createPanel(): PanelModel;
3009
+ protected onReadOnlyChanged(): void;
3010
+ onSurveyLoad(): void;
3011
+ private setIsContentElement;
3012
+ setVisibleIndex(val: number): number;
3013
+ runCondition(values: HashTable<any>, properties: HashTable<any>): void;
3014
+ getValue(name: string): any;
3015
+ protected getQuestionByName(name: string): IQuestion;
3016
+ private settingNewValue;
3017
+ setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
3018
+ private updateValueCoreWithPanelValue;
3019
+ private getContentPanelValue;
3020
+ private getValueForContentPanel;
3021
+ private setNewValueIntoQuestion;
3022
+ addConditionObjectsByContext(objects: Array<IConditionObject>, context: any): void;
3023
+ protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean): void;
3024
+ protected convertDataValue(name: string, newValue: any): any;
3025
+ protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
3026
+ private setValuesIntoQuestions;
3027
+ protected getDisplayValueCore(keyAsText: boolean, value: any): any;
3028
+ private setAfterRenderCallbacks;
3029
+ }
3030
+ }
3031
+ declare module "questionfactory" {
3032
+ import { Question } from "question";
3033
+ import { IElement } from "base-interfaces";
3034
+ export class QuestionFactory {
3035
+ static Instance: QuestionFactory;
3036
+ static get DefaultChoices(): string[];
3037
+ static get DefaultColums(): string[];
3038
+ static get DefaultRows(): string[];
3039
+ static get DefaultMutlipleTextItems(): string[];
3040
+ registerQuestion(questionType: string, questionCreator: (name: string) => Question): void;
3041
+ registerCustomQuestion(questionType: string): void;
3042
+ unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
3043
+ clear(): void;
3044
+ getAllTypes(): Array<string>;
3045
+ createQuestion(questionType: string, name: string): Question;
3046
+ }
3047
+ export class ElementFactory {
3048
+ static Instance: ElementFactory;
3049
+ private creatorHash;
3050
+ registerElement(elementType: string, elementCreator: (name: string) => IElement): void;
3051
+ registerCustomQuestion: (questionType: string) => void;
3052
+ clear(): void;
3053
+ unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
3054
+ getAllTypes(): Array<string>;
3055
+ createElement(elementType: string, name: string): IElement;
3056
+ }
3057
+ }
3058
+ declare module "error" {
3059
+ import { SurveyError } from "survey-error";
3060
+ import { ISurveyErrorOwner } from "base-interfaces";
3061
+ export class AnswerRequiredError extends SurveyError {
3062
+ text: string;
3063
+ constructor(text?: string, errorOwner?: ISurveyErrorOwner);
3064
+ getErrorType(): string;
3065
+ protected getDefaultText(): string;
3066
+ }
3067
+ export class OneAnswerRequiredError extends SurveyError {
3068
+ text: string;
3069
+ constructor(text?: string, errorOwner?: ISurveyErrorOwner);
3070
+ getErrorType(): string;
3071
+ protected getDefaultText(): string;
3072
+ }
3073
+ export class RequreNumericError extends SurveyError {
3074
+ text: string;
3075
+ constructor(text?: string, errorOwner?: ISurveyErrorOwner);
3076
+ getErrorType(): string;
3077
+ protected getDefaultText(): string;
3078
+ }
3079
+ export class ExceedSizeError extends SurveyError {
3080
+ private maxSize;
3081
+ constructor(maxSize: number, errorOwner?: ISurveyErrorOwner);
3082
+ getErrorType(): string;
3083
+ getDefaultText(): string;
3084
+ private getTextSize;
3085
+ }
3086
+ export class WebRequestError extends SurveyError {
3087
+ status: string;
3088
+ response: string;
3089
+ constructor(status: string, response: string, errorOwner?: ISurveyErrorOwner);
3090
+ getErrorType(): string;
3091
+ protected getDefaultText(): string;
3092
+ }
3093
+ export class WebRequestEmptyError extends SurveyError {
3094
+ text: string;
3095
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3096
+ getErrorType(): string;
3097
+ protected getDefaultText(): string;
3098
+ }
3099
+ export class OtherEmptyError extends SurveyError {
3100
+ text: string;
3101
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3102
+ getErrorType(): string;
3103
+ protected getDefaultText(): string;
3104
+ }
3105
+ export class UploadingFileError extends SurveyError {
3106
+ text: string;
3107
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3108
+ getErrorType(): string;
3109
+ protected getDefaultText(): string;
3110
+ }
3111
+ export class RequiredInAllRowsError extends SurveyError {
3112
+ text: string;
3113
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3114
+ getErrorType(): string;
3115
+ protected getDefaultText(): string;
3116
+ }
3117
+ export class MinRowCountError extends SurveyError {
3118
+ minRowCount: number;
3119
+ constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner);
3120
+ getErrorType(): string;
3121
+ protected getDefaultText(): string;
3122
+ }
3123
+ export class KeyDuplicationError extends SurveyError {
3124
+ text: string;
3125
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3126
+ getErrorType(): string;
3127
+ protected getDefaultText(): string;
3128
+ }
3129
+ export class CustomError extends SurveyError {
3130
+ text: string;
3131
+ constructor(text: string, errorOwner?: ISurveyErrorOwner);
3132
+ getErrorType(): string;
3133
+ }
3134
+ }
3135
+ declare module "drag-drop-helper-v1" {
3136
+ import { IElement, ISurveyElement } from "base-interfaces";
3137
+ export class DragDropInfo {
3138
+ source: IElement;
3139
+ target: IElement;
3140
+ nestedPanelDepth: number;
3141
+ constructor(source: IElement, target: IElement, nestedPanelDepth?: number);
3142
+ destination: ISurveyElement;
3143
+ isBottom: boolean;
3144
+ isEdge: boolean;
3145
+ }
3146
+ }
3147
+ declare module "drag-drop-panel-helper-v1" {
3148
+ import { IElement, ISurveyElement } from "base-interfaces";
3149
+ import { DragDropInfo } from "drag-drop-helper-v1";
3150
+ import { PanelModelBase, QuestionRowModel } from "panel";
3151
+ export class DragDropPanelHelperV1 {
3152
+ private panel;
3153
+ constructor(panel: PanelModelBase);
3154
+ dragDropAddTarget(dragDropInfo: DragDropInfo): void;
3155
+ dragDropFindRow(findElement: ISurveyElement): QuestionRowModel;
3156
+ dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void;
3157
+ updateRowsOnElementAdded(element: IElement, index: number, dragDropInfo?: DragDropInfo, thisElement?: PanelModelBase): void;
3158
+ private dragDropAddTargetToRow;
3159
+ private dragDropAddTargetToEmptyPanel;
3160
+ private dragDropAddTargetToExistingRow;
3161
+ private dragDropAddTargetToNewRow;
3162
+ private dragDropAddTargetToEmptyPanelCore;
3163
+ }
3164
+ }
3165
+ declare module "panel" {
3166
+ import { HashTable } from "helpers";
3167
+ import { Base } from "base";
3168
+ import { ISurveyImpl, IPage, IPanel, IConditionRunner, IElement, ISurveyElement, IQuestion, ISurveyErrorOwner, ITitleOwner, IProgressInfo, ISurvey, IFindElement } from "base-interfaces";
3169
+ import { DragTypeOverMeEnum, SurveyElement } from "survey-element";
3170
+ import { Question } from "question";
3171
+ import { LocalizableString } from "localizablestring";
3172
+ import { findScrollableParent } from "utils/utils";
3173
+ import { SurveyError } from "survey-error";
3174
+ import { IAction } from "actions/action";
3175
+ import { ActionContainer } from "actions/container";
3176
+ import { DragDropInfo } from "drag-drop-helper-v1";
3177
+ export class QuestionRowModel extends Base {
3178
+ panel: PanelModelBase;
3179
+ private static rowCounter;
3180
+ private static getRowId;
3181
+ protected _scrollableParent: any;
3182
+ protected _updateVisibility: any;
3183
+ startLazyRendering(rowContainerDiv: HTMLElement, findScrollableContainer?: typeof findScrollableParent): void;
3184
+ ensureVisibility(): void;
3185
+ stopLazyRendering(): void;
3186
+ private idValue;
3187
+ constructor(panel: PanelModelBase);
3188
+ private isLazyRenderingValue;
3189
+ setIsLazyRendering(val: boolean): void;
3190
+ isLazyRendering(): boolean;
3191
+ get id(): string;
3192
+ get elements(): Array<IElement>;
3193
+ get visibleElements(): Array<IElement>;
3194
+ get visible(): boolean;
3195
+ set visible(val: boolean);
3196
+ get isNeedRender(): boolean;
3197
+ set isNeedRender(val: boolean);
3198
+ updateVisible(): void;
3199
+ addElement(q: IElement): void;
3200
+ get index(): number;
3201
+ private setWidth;
3202
+ private getRenderedCalcWidth;
3203
+ private getElementWidth;
3204
+ private getRenderedWidthFromWidth;
3205
+ private calcVisible;
3206
+ private needToUpdateVisibleElements;
3207
+ dragTypeOverMe: DragTypeOverMeEnum;
3208
+ dispose(): void;
3209
+ getRowCss(): string;
3210
+ }
3211
+ /**
3212
+ * A base class for the [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) and [PageModel](https://surveyjs.io/form-library/documentation/pagemodel) classes.
3213
+ */
3214
+ export class PanelModelBase extends SurveyElement<Question> implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner {
3215
+ private static panelCounter;
3216
+ private static getPanelId;
3217
+ private elementsValue;
3218
+ private isQuestionsReady;
3219
+ private questionsValue;
3220
+ addElementCallback: (element: IElement) => void;
3221
+ removeElementCallback: (element: IElement) => void;
3222
+ onGetQuestionTitleLocation: () => string;
3223
+ private dragDropPanelHelper;
3224
+ constructor(name?: string);
3225
+ getType(): string;
3226
+ setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
3227
+ endLoadingFromJson(): void;
3228
+ showTitle: boolean;
3229
+ get hasTitle(): boolean;
3230
+ delete(doDispose?: boolean): void;
3231
+ protected removeFromParent(): void;
3232
+ protected canShowTitle(): boolean;
3233
+ showDescription: boolean;
3234
+ get _showDescription(): boolean;
3235
+ localeChanged(): void;
3236
+ locStrsChanged(): void;
3237
+ get renderedNavigationTitle(): string;
3238
+ /**
3239
+ * Returns a character or text string that indicates a required panel/page.
3240
+ * @see SurveyModel.requiredText
3241
+ * @see isRequired
3242
+ */
3243
+ get requiredText(): string;
3244
+ protected get titlePattern(): string;
3245
+ get isRequireTextOnStart(): boolean;
3246
+ get isRequireTextBeforeTitle(): boolean;
3247
+ get isRequireTextAfterTitle(): boolean;
3248
+ /**
3249
+ * Specifies a custom error message for a required panel/page.
3250
+ * @see isRequired
3251
+ * @see requiredIf
3252
+ */
3253
+ get requiredErrorText(): string;
3254
+ set requiredErrorText(val: string);
3255
+ get locRequiredErrorText(): LocalizableString;
3256
+ /**
3257
+ * Specifies the sort order of questions in the panel/page.
3258
+ *
3259
+ * Possible values:
3260
+ *
3261
+ * - `"initial"` - Preserves the original order of questions.
3262
+ * - `"random"` - Displays questions in random order.
3263
+ * - `"default"` (default) - Inherits the setting from the Survey's `questionsOrder` property.
3264
+ * @see SurveyModel.questionsOrder
3265
+ * @see areQuestionsRandomized
3266
+ */
3267
+ get questionsOrder(): string;
3268
+ set questionsOrder(val: string);
3269
+ private canRandomize;
3270
+ protected isRandomizing: boolean;
3271
+ randomizeElements(isRandom: boolean): void;
3272
+ /**
3273
+ * Returns `true` if elements in this panel/page are arranged in random order.
3274
+ * @see questionsOrder
3275
+ */
3276
+ get areQuestionsRandomized(): boolean;
3277
+ /**
3278
+ * Returns a survey element (panel or page) that contains this panel and allows you to move this question to a different survey element.
3279
+ *
3280
+ * This property is always `null` for the `PageModel` object.
3281
+ */
3282
+ get parent(): PanelModelBase;
3283
+ set parent(val: PanelModelBase);
3284
+ get depth(): number;
3285
+ /**
3286
+ * A Boolean expression. If it evaluates to `false`, this panel/page becomes hidden.
3287
+ *
3288
+ * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
3289
+ *
3290
+ * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility)
3291
+ * @see visible
3292
+ * @see isVisible
3293
+ */
3294
+ get visibleIf(): string;
3295
+ set visibleIf(val: string);
3296
+ protected calcCssClasses(css: any): any;
3297
+ /**
3298
+ * An auto-generated unique element identifier.
3299
+ */
3300
+ get id(): string;
3301
+ set id(val: string);
3302
+ /**
3303
+ * Returns `true` if the survey element is a panel.
3304
+ * @see Base.getType
3305
+ */
3306
+ get isPanel(): boolean;
3307
+ getPanel(): IPanel;
3308
+ getLayoutType(): string;
3309
+ isLayoutTypeSupported(layoutType: string): boolean;
3310
+ /**
3311
+ * An array of all questions within this panel/page. Includes questions within nested panels.
3312
+ * @see elements
3313
+ */
3314
+ get questions(): Array<Question>;
3315
+ getQuestions(includeNested: boolean): Array<Question>;
3316
+ protected getValidName(name: string): string;
3317
+ /**
3318
+ * Returns a question with a specified `name`. This method does not find questions within nested panels.
3319
+ * @param name A question name.
3320
+ */
3321
+ getQuestionByName(name: string): Question;
3322
+ /**
3323
+ * Returns a survey element with a specified `name`. This method can find survey elements within nested elements.
3324
+ * @param name An element name.
3325
+ */
3326
+ getElementByName(name: string): IElement;
3327
+ getQuestionByValueName(valueName: string): Question;
3328
+ /**
3329
+ * Returns a JSON object with question values nested in the panel/page.
3330
+ * @see getDisplayValue
3331
+ */
3332
+ getValue(): any;
3333
+ collectValues(data: any, level: number): boolean;
3334
+ /**
3335
+ * Returns a JSON object with display texts that correspond to question values nested in the panel/page.
3336
+ * @param keysAsText Pass `true` if not only values in the object should be display texts, but also keys. Default value: `false`.
3337
+ * @see getValue
3338
+ */
3339
+ getDisplayValue(keysAsText: boolean): any;
3340
+ /**
3341
+ * Returns a JSON object with comments left to questions within this panel/page. Question names are used as keys.
3342
+ */
3343
+ getComments(): any;
3344
+ /**
3345
+ * Removes values that cannot be assigned to nested questions, for example, choices unlisted in the `choices` array.
3346
+ *
3347
+ * Call this method after you assign new question values in code to ensure that they are acceptable.
3348
+ *
3349
+ * > This method does not remove values for invisible questions and values that fail validation. Call the `validate()` method to validate newly assigned values.
3350
+ *
3351
+ * @see validate
3352
+ */
3353
+ clearIncorrectValues(): void;
3354
+ /**
3355
+ * Empties the `errors` array for this panel/page and all its child elements (panels and questions).
3356
+ * @see errors
3357
+ */
3358
+ clearErrors(): void;
3359
+ private markQuestionListDirty;
3360
+ /**
3361
+ * An array of all survey elements (questions or panels) within this panel/page. Does not include questions within nested panels.
3362
+ * @see questions
3363
+ */
3364
+ get elements(): Array<IElement>;
3365
+ getElementsInDesign(includeHidden?: boolean): Array<IElement>;
3366
+ /**
3367
+ * Checks whether a given element belongs to this panel/page or nested panels.
3368
+ * @param element A survey element to check.
3369
+ */
3370
+ containsElement(element: IElement): boolean;
3371
+ /**
3372
+ * Makes the panel/page require an answer at least in one nested question. If a respondent leaves the panel/page without any answers, the survey displays a validation error.
3373
+ * @see requiredIf
3374
+ * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
3375
+ */
3376
+ get isRequired(): boolean;
3377
+ set isRequired(val: boolean);
3378
+ /**
3379
+ * A Boolean expression. If it evaluates to `true`, this panel/page becomes required (at least one question in the panel/page should have an answer).
3380
+ *
3381
+ * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
3382
+ *
3383
+ * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility)
3384
+ * @see isRequired
3385
+ */
3386
+ get requiredIf(): string;
3387
+ set requiredIf(val: string);
3388
+ searchText(text: string, founded: Array<IFindElement>): void;
3389
+ hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
3390
+ /**
3391
+ * Validates questions within this panel or page and returns `false` if the validation fails.
3392
+ * @param fireCallback *(Optional)* Pass `false` if you do not want to show validation errors in the UI.
3393
+ * @param focusOnFirstError *(Optional)* Pass `true` if you want to focus the first question with a validation error.
3394
+ * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
3395
+ */
3396
+ validate(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
3397
+ validateContainerOnly(): void;
3398
+ private hasErrorsInPanels;
3399
+ getErrorCustomText(text: string, error: SurveyError): string;
3400
+ private hasRequiredError;
3401
+ protected hasErrorsCore(rec: any): void;
3402
+ protected getContainsErrors(): boolean;
3403
+ updateElementVisibility(): void;
3404
+ getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question;
3003
3405
  /**
3004
3406
  * Focuses the first question in this panel/page.
3005
3407
  * @see focusFirstErrorQuestion
@@ -4085,6 +4487,15 @@ declare module "question_baseselect" {
4085
4487
  setCanShowOptionItemCallback(func: (item: ItemValue) => boolean): void;
4086
4488
  get newItem(): ItemValue;
4087
4489
  protected addToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
4490
+ protected addNewItemToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
4491
+ protected addNonChoicesItems(dict: Array<{
4492
+ index: number;
4493
+ item: ItemValue;
4494
+ }>, isAddAll: boolean): void;
4495
+ protected addNonChoiceItem(dict: Array<{
4496
+ index: number;
4497
+ item: ItemValue;
4498
+ }>, item: ItemValue, order: Array<number>): void;
4088
4499
  protected canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean;
4089
4500
  isItemInList(item: ItemValue): boolean;
4090
4501
  protected get isAddDefaultItems(): boolean;
@@ -4108,8 +4519,6 @@ declare module "question_baseselect" {
4108
4519
  private getChoicesFromSelectQuestion;
4109
4520
  private copyChoiceItem;
4110
4521
  protected get hasActiveChoices(): boolean;
4111
- protected isHeadChoice(item: ItemValue, question: QuestionSelectBase): boolean;
4112
- protected isFootChoice(item: ItemValue, question: QuestionSelectBase): boolean;
4113
4522
  protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean;
4114
4523
  protected getChoices(): Array<ItemValue>;
4115
4524
  supportOther(): boolean;
@@ -4125,6 +4534,7 @@ declare module "question_baseselect" {
4125
4534
  protected getCommentFromValue(newValue: any): string;
4126
4535
  protected setOtherValueIntoValue(newValue: any): any;
4127
4536
  onOtherValueInput(event: any): void;
4537
+ onCompositionUpdateOtherValue(event: any): void;
4128
4538
  onOtherValueChange(event: any): void;
4129
4539
  private isRunningChoices;
4130
4540
  private runChoicesByUrl;
@@ -4168,6 +4578,8 @@ declare module "question_baseselect" {
4168
4578
  protected getItemClassCore(item: any, options: any): string;
4169
4579
  getLabelClass(item: ItemValue): string;
4170
4580
  getControlLabelClass(item: ItemValue): string;
4581
+ private headItemsCount;
4582
+ private footItemsCount;
4171
4583
  get headItems(): ItemValue[];
4172
4584
  get footItems(): ItemValue[];
4173
4585
  get dataChoices(): ItemValue[];
@@ -5195,75 +5607,30 @@ declare module "question_matrixdynamic" {
5195
5607
  * A message displayed when the matrix does not contain any rows. Applies only if `hideColumnsIfEmpty` is enabled.
5196
5608
  * @see hideColumnsIfEmpty
5197
5609
  */
5198
- get emptyRowsText(): string;
5199
- set emptyRowsText(val: string);
5200
- get locEmptyRowsText(): LocalizableString;
5201
- protected getDisplayValueCore(keysAsText: boolean, value: any): any;
5202
- protected getConditionObjectRowName(index: number): string;
5203
- protected getConditionObjectsRowIndeces(): Array<number>;
5204
- supportGoNextPageAutomatic(): boolean;
5205
- get hasRowText(): boolean;
5206
- protected onCheckForErrors(errors: Array<SurveyError>, isOnValueChanged: boolean): void;
5207
- private hasErrorInMinRows;
5208
- protected getUniqueColumns(): Array<MatrixDropdownColumn>;
5209
- protected generateRows(): Array<MatrixDynamicRowModel>;
5210
- protected createMatrixRow(value: any): MatrixDynamicRowModel;
5211
- private lastDeletedRow;
5212
- private getInsertedDeletedIndex;
5213
- private isEditingObjectValueChanged;
5214
- protected onBeforeValueChanged(val: any): void;
5215
- protected createNewValue(): any;
5216
- protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any;
5217
- private getRowValueByIndex;
5218
- protected getRowValueCore(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any;
5219
- getAddRowButtonCss(isEmptySection?: boolean): string;
5220
- getRemoveRowButtonCss(): string;
5221
- getRootCss(): string;
5222
- }
5223
- }
5224
- declare module "textPreProcessor" {
5225
- import { Question } from "question";
5226
- import { PanelModel } from "panel";
5227
- import { ISurvey, ITextProcessor } from "base-interfaces";
5228
- export class TextPreProcessorItem {
5229
- start: number;
5230
- end: number;
5231
- }
5232
- export class TextPreProcessorValue {
5233
- name: string;
5234
- returnDisplayValue: boolean;
5235
- constructor(name: string, returnDisplayValue: boolean);
5236
- value: any;
5237
- isExists: boolean;
5238
- canProcess: boolean;
5239
- }
5240
- export class TextPreProcessor {
5241
- private _unObservableValues;
5242
- private get hasAllValuesOnLastRunValue();
5243
- private set hasAllValuesOnLastRunValue(value);
5244
- onProcess: (textValue: TextPreProcessorValue) => void;
5245
- process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean): string;
5246
- processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
5247
- get hasAllValuesOnLastRun(): boolean;
5248
- private getItems;
5249
- private getName;
5250
- }
5251
- export class QuestionTextProcessor implements ITextProcessor {
5252
- protected variableName: string;
5253
- private textPreProcessor;
5254
- constructor(variableName: string);
5255
- processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
5256
- protected get survey(): ISurvey;
5257
- protected get panel(): PanelModel;
5258
- protected getValues(): any;
5259
- protected getQuestionByName(name: string): Question;
5260
- protected getParentTextProcessor(): ITextProcessor;
5261
- protected onCustomProcessText(textValue: TextPreProcessorValue): boolean;
5262
- protected getQuestionDisplayText(question: Question): string;
5263
- private getProcessedTextValue;
5264
- processText(text: string, returnDisplayValue: boolean): string;
5265
- processTextEx(text: string, returnDisplayValue: boolean): any;
5266
- private processTextCore;
5610
+ get emptyRowsText(): string;
5611
+ set emptyRowsText(val: string);
5612
+ get locEmptyRowsText(): LocalizableString;
5613
+ protected getDisplayValueCore(keysAsText: boolean, value: any): any;
5614
+ protected getConditionObjectRowName(index: number): string;
5615
+ protected getConditionObjectsRowIndeces(): Array<number>;
5616
+ supportGoNextPageAutomatic(): boolean;
5617
+ get hasRowText(): boolean;
5618
+ protected onCheckForErrors(errors: Array<SurveyError>, isOnValueChanged: boolean): void;
5619
+ private hasErrorInMinRows;
5620
+ protected getUniqueColumns(): Array<MatrixDropdownColumn>;
5621
+ protected generateRows(): Array<MatrixDynamicRowModel>;
5622
+ protected createMatrixRow(value: any): MatrixDynamicRowModel;
5623
+ private lastDeletedRow;
5624
+ private getInsertedDeletedIndex;
5625
+ private isEditingObjectValueChanged;
5626
+ protected onBeforeValueChanged(val: any): void;
5627
+ protected createNewValue(): any;
5628
+ protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any;
5629
+ private getRowValueByIndex;
5630
+ protected getRowValueCore(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any;
5631
+ getAddRowButtonCss(isEmptySection?: boolean): string;
5632
+ getRemoveRowButtonCss(): string;
5633
+ getRootCss(): string;
5267
5634
  }
5268
5635
  }
5269
5636
  declare module "themes" {
@@ -6600,7 +6967,7 @@ declare module "survey-events-api" {
6600
6967
  }
6601
6968
  export interface DownloadFileEvent extends LoadFilesEvent {
6602
6969
  /**
6603
- * A callback function that you should call when a file is downloaded successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass the downloaded file's data as a Base64 string if file upload was successful or an error message if file upload failed.
6970
+ * A callback function that you should call when a file is downloaded successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass the downloaded file's data as a Base64 string if file download was successful or an error message if file download failed.
6604
6971
  */
6605
6972
  callback: (status: string, data?: any) => any;
6606
6973
  /**
@@ -6614,7 +6981,7 @@ declare module "survey-events-api" {
6614
6981
  }
6615
6982
  export interface ClearFilesEvent extends LoadFilesEvent {
6616
6983
  /**
6617
- * A callback function that you should call when files are deleted successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass deleted files' data (`options.value`) if file upload was successful or an error message if file upload failed.
6984
+ * A callback function that you should call when files are deleted successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass deleted files' data (`options.value`) if file deletion was successful or an error message if file deletion failed.
6618
6985
  */
6619
6986
  callback: (status: string, data?: any) => any;
6620
6987
  /**
@@ -9887,7 +10254,7 @@ declare module "survey" {
9887
10254
  private changeCurrentPageFromPreview;
9888
10255
  private origionalPages;
9889
10256
  protected onQuestionsOnPageModeChanged(oldValue: string): void;
9890
- private restoreOrigionalPages;
10257
+ private restoreOriginalPages;
9891
10258
  private getPageStartIndex;
9892
10259
  private setupPagesForPageModes;
9893
10260
  private createPagesForQuestionOnPageMode;
@@ -11228,6 +11595,7 @@ declare module "question" {
11228
11595
  isMobile: boolean;
11229
11596
  forceIsInputReadOnly: boolean;
11230
11597
  constructor(name: string);
11598
+ protected getDefaultTitle(): string;
11231
11599
  protected createLocTitleProperty(): LocalizableString;
11232
11600
  getSurvey(live?: boolean): ISurvey;
11233
11601
  getValueName(): string;
@@ -11506,6 +11874,7 @@ declare module "question" {
11506
11874
  get isContainer(): boolean;
11507
11875
  protected updateCommentElements(): void;
11508
11876
  onCommentInput(event: any): void;
11877
+ onCompositionUpdateComment(event: any): void;
11509
11878
  onCommentChange(event: any): void;
11510
11879
  afterRenderQuestionElement(el: HTMLElement): void;
11511
11880
  afterRender(el: HTMLElement): void;
@@ -12141,6 +12510,7 @@ declare module "martixBase" {
12141
12510
  */
12142
12511
  get rowTitleWidth(): string;
12143
12512
  set rowTitleWidth(val: string);
12513
+ getCellAriaLabel(rowTitle: string, columnTitle: string): string;
12144
12514
  }
12145
12515
  }
12146
12516
  declare module "question_matrixdropdownbase" {
@@ -13953,6 +14323,11 @@ declare module "settings" {
13953
14323
  * Default value: `"none"`
13954
14324
  */
13955
14325
  noneItemValue: string;
14326
+ specialChoicesOrder: {
14327
+ selectAllItem: number[];
14328
+ noneItem: number[];
14329
+ otherItem: number[];
14330
+ };
13956
14331
  /**
13957
14332
  * A list of supported validators by question type.
13958
14333
  */
@@ -14139,7 +14514,8 @@ declare module "dropdownListModel" {
14139
14514
  private qustionPropertyChangedHandler;
14140
14515
  constructor(question: Question, onSelectionChanged?: (item: IAction, ...params: any[]) => void);
14141
14516
  get popupModel(): PopupModel;
14142
- get inputReadOnly(): boolean;
14517
+ get noTabIndex(): boolean;
14518
+ get filterReadOnly(): boolean;
14143
14519
  get filterStringEnabled(): boolean;
14144
14520
  get inputMode(): "none" | "text";
14145
14521
  setSearchEnabled(newValue: boolean): void;
@@ -14633,8 +15009,11 @@ declare module "question_checkbox" {
14633
15009
  private noneIndexInArray;
14634
15010
  protected canUseFilteredChoices(): boolean;
14635
15011
  protected supportSelectAll(): boolean;
14636
- protected addToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
14637
- protected isHeadChoice(item: ItemValue, question: QuestionSelectBase): boolean;
15012
+ protected addNonChoicesItems(dict: Array<{
15013
+ index: number;
15014
+ item: ItemValue;
15015
+ }>, isAddAll: boolean): void;
15016
+ protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean;
14638
15017
  isItemInList(item: ItemValue): boolean;
14639
15018
  protected getDisplayValueCore(keysAsText: boolean, value: any): any;
14640
15019
  protected clearIncorrectValuesCore(): void;
@@ -14905,7 +15284,8 @@ declare module "question_imagepicker" {
14905
15284
  set contentMode(val: string);
14906
15285
  protected convertDefaultValue(val: any): any;
14907
15286
  get inputType(): "checkbox" | "radio";
14908
- protected isFootChoice(_item: ItemValue, _question: QuestionSelectBase): boolean;
15287
+ protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean;
15288
+ protected addToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
14909
15289
  getSelectBaseRootCss(): string;
14910
15290
  private isResponsiveValue;
14911
15291
  maxImageWidth: number;
@@ -15868,442 +16248,91 @@ declare module "popup-survey" {
15868
16248
  *
15869
16249
  * Set this property to a negative value (for instance, -1) to keep the pop-up window open without a time limit.
15870
16250
  */
15871
- closeOnCompleteTimeout: number;
15872
- /**
15873
- * Indicates whether the pop-up survey appears on the page, regardless of its [expand state](#isExpanded).
15874
- *
15875
- * You can set this property to `true` or `false` to control visibility of the pop-up survey. Alternatively, you can use the [`show()`](#show) and [`hide()`](#hide) methods.
15876
- */
15877
- get isShowing(): boolean;
15878
- set isShowing(val: boolean);
15879
- /**
15880
- * Shows the pop-up survey. The survey may appear [expanded or collapsed](#isExpanded).
15881
- *
15882
- * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `true`.
15883
- * @see hide
15884
- */
15885
- show(): void;
15886
- /**
15887
- * Hides the pop-up survey.
15888
- *
15889
- * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `false`.
15890
- * @see show
15891
- * @see expand
15892
- * @see collapse
15893
- */
15894
- hide(): void;
15895
- /**
15896
- * Indicates whether the pop-up window is expanded or collapsed.
15897
- *
15898
- * You can set this property to `true` or `false` to control the expand state of the pop-up survey. Alternatively, you can use the [`expand()`](#expand) and [`collapse()`](#collapse) methods.
15899
- */
15900
- get isExpanded(): boolean;
15901
- set isExpanded(val: boolean);
15902
- protected onExpandedChanged(): void;
15903
- /**
15904
- * A title for the pop-up window. If this property is undefined, the title is taken from [`SurveyModel`](#survey)'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property.
15905
- */
15906
- get title(): string;
15907
- set title(value: string);
15908
- get locTitle(): LocalizableString;
15909
- /**
15910
- * Expands the pop-up window.
15911
- *
15912
- * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `true`.
15913
- * @see collapse
15914
- */
15915
- expand(): void;
15916
- /**
15917
- * Collapses the pop-up window, leaving only the survey title visible.
15918
- *
15919
- * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `false`.
15920
- * @see expand
15921
- */
15922
- collapse(): void;
15923
- changeExpandCollapse(): void;
15924
- /**
15925
- * Specifies whether to display a button that closes the pop-up window.
15926
- *
15927
- * Default value: `false`
15928
- *
15929
- * If you allow users to close the pop-up window, make sure to implement a UI element that opens it. This element should call the [`show()`](#show) method or enable the [`isShowing`](#isShowing) property.
15930
- * @see expand
15931
- * @see collapse
15932
- * @see hide
15933
- */
15934
- get allowClose(): boolean;
15935
- set allowClose(val: boolean);
15936
- get css(): any;
15937
- get cssButton(): string;
15938
- get cssRoot(): string;
15939
- get cssBody(): string;
15940
- get cssHeaderRoot(): string;
15941
- get cssHeaderTitle(): string;
15942
- get cssHeaderButton(): string;
15943
- get renderedWidth(): string;
15944
- width: string;
15945
- private updateCss;
15946
- private updateCssButton;
15947
- private setCssButton;
15948
- protected createSurvey(jsonObj: any): SurveyModel;
15949
- protected onSurveyComplete(): void;
15950
- onScroll(): void;
15951
- }
15952
- /**
15953
- * Obsolete. Please use PopupSurvey
15954
- */
15955
- export class SurveyWindowModel extends PopupSurveyModel {
15956
- }
15957
- }
15958
- declare module "question_custom" {
15959
- import { Question, IConditionObject } from "question";
15960
- import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "base-interfaces";
15961
- import { SurveyElement } from "survey-element";
15962
- import { PanelModel } from "panel";
15963
- import { HashTable } from "helpers";
15964
- import { ItemValue } from "itemvalue";
15965
- /**
15966
- * An interface used to create custom question types.
15967
- *
15968
- * Refer to the following articles for more information:
15969
- *
15970
- * - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types)
15971
- * - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types)
15972
- */
15973
- export interface ICustomQuestionTypeConfiguration {
15974
- /**
15975
- * A name used to identify a custom question type.
15976
- *
15977
- * @see title
15978
- */
15979
- name: string;
15980
- /**
15981
- * A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used.
15982
- *
15983
- * @see name
15984
- */
15985
- title?: string;
15986
- /**
15987
- * The name of an icon to use for the custom question type.
15988
- *
15989
- * [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
15990
- */
15991
- iconName?: string;
15992
- /**
15993
- * A function that is called when the custom question type is initialized. Use it to add, remove, or modify the type's properties (see [Override Base Question Properties](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types#override-base-question-properties)).
15994
- */
15995
- onInit?(): void;
15996
- /**
15997
- * Specifies whether the custom question type is available in the Toolbox and the Add Question menu.
15998
- *
15999
- * Default value: `true`
16000
- *
16001
- * Set this property to `false` if your custom question type is used only to customize Property Grid content and is not meant for a survey.
16002
- */
16003
- showInToolbox?: boolean;
16004
- /**
16005
- * A function that is called when the custom question is created. Use it to access questions nested within a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
16006
- *
16007
- * Parameters:
16008
- *
16009
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16010
- * The custom question.
16011
- */
16012
- onCreated?(question: Question): void;
16013
- /**
16014
- * A function that is called when JSON schemas are loaded.
16015
- *
16016
- * Parameters:
16017
- *
16018
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16019
- * A custom question.
16020
- */
16021
- onLoaded?(question: Question): void;
16022
- /**
16023
- * A function that is called after the entire question is rendered.
16024
- *
16025
- * Parameters:
16026
- *
16027
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16028
- * A custom question.
16029
- * - `htmlElement`: `any`\
16030
- * An HTML element that represents the custom question.
16031
- */
16032
- onAfterRender?(question: Question, htmlElement: any): void;
16033
- /**
16034
- * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) is rendered.
16035
- *
16036
- * Parameters:
16037
- *
16038
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16039
- * A composite question.
16040
- * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16041
- * A nested question.
16042
- * - `htmlElement`: `any`\
16043
- * An HTML element that represents a nested question.
16044
- */
16045
- onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void;
16046
- /**
16047
- * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) requires an update of its CSS classes.
16048
- *
16049
- * Parameters:
16050
- *
16051
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16052
- * A composite question.
16053
- * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16054
- * A nested question.
16055
- * - `cssClasses`: `any`\
16056
- * An object with CSS classes applied to a nested question, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes.
16057
- */
16058
- onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void;
16059
- /**
16060
- * A function that is called when a custom question type property is changed. Use it to handle property changes.
16061
- *
16062
- * Parameters:
16063
- *
16064
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16065
- * A custom question.
16066
- * - `propertyName`: `string`\
16067
- * The name of the changed property.
16068
- * - `newValue`: `any`\
16069
- * A new value for the property.
16070
- */
16071
- onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
16072
- /**
16073
- * A function that is called after the question value is changed.
16074
- *
16075
- * Parameters:
16076
- *
16077
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16078
- * A custom question.
16079
- * - `name`: `string`\
16080
- * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
16081
- * - `newValue`: `any`\
16082
- * A new value for the question.
16083
- */
16084
- onValueChanged?(question: Question, name: string, newValue: any): void;
16085
- /**
16086
- * A function that is called before a question value is changed.
16087
- *
16088
- * This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
16089
- *
16090
- * Parameters:
16091
- *
16092
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16093
- * A custom question.
16094
- * - `name`: `string`\
16095
- * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
16096
- * - `newValue`: `any`\
16097
- * A new value for the question.
16251
+ closeOnCompleteTimeout: number;
16252
+ /**
16253
+ * Indicates whether the pop-up survey appears on the page, regardless of its [expand state](#isExpanded).
16254
+ *
16255
+ * You can set this property to `true` or `false` to control visibility of the pop-up survey. Alternatively, you can use the [`show()`](#show) and [`hide()`](#hide) methods.
16098
16256
  */
16099
- onValueChanging?(question: Question, name: string, newValue: any): any;
16257
+ get isShowing(): boolean;
16258
+ set isShowing(val: boolean);
16100
16259
  /**
16101
- * A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed.
16260
+ * Shows the pop-up survey. The survey may appear [expanded or collapsed](#isExpanded).
16102
16261
  *
16103
- * Parameters:
16262
+ * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `true`.
16263
+ * @see hide
16264
+ */
16265
+ show(): void;
16266
+ /**
16267
+ * Hides the pop-up survey.
16104
16268
  *
16105
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16106
- * A custom question.
16107
- * - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\
16108
- * An `ItemValue` object.
16109
- * - `options.propertyName`: `string`\
16110
- * The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`).
16111
- * - `options.name`: `string`\
16112
- * The name of the changed property: `"text"` or `"value"`.
16113
- * - `options.newValue`: `any`\
16114
- * A new value for the property.
16269
+ * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `false`.
16270
+ * @see show
16271
+ * @see expand
16272
+ * @see collapse
16115
16273
  */
16116
- onItemValuePropertyChanged?(question: Question, options: {
16117
- obj: ItemValue;
16118
- propertyName: string;
16119
- name: string;
16120
- newValue: any;
16121
- }): void;
16274
+ hide(): void;
16122
16275
  /**
16123
- * A function that allows you to override the default `getDisplayValue()` implementation.
16276
+ * Indicates whether the pop-up window is expanded or collapsed.
16277
+ *
16278
+ * You can set this property to `true` or `false` to control the expand state of the pop-up survey. Alternatively, you can use the [`expand()`](#expand) and [`collapse()`](#collapse) methods.
16124
16279
  */
16125
- getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any);
16280
+ get isExpanded(): boolean;
16281
+ set isExpanded(val: boolean);
16282
+ protected onExpandedChanged(): void;
16126
16283
  /**
16127
- * JSON schemas of nested questions. Specify this property to create a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
16284
+ * A title for the pop-up window. If this property is undefined, the title is taken from [`SurveyModel`](#survey)'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property.
16128
16285
  */
16129
- elementsJSON?: any;
16286
+ get title(): string;
16287
+ set title(value: string);
16288
+ get locTitle(): LocalizableString;
16130
16289
  /**
16131
- * A function that allows you to create nested questions if you do not specify the `elementsJSON` property.
16290
+ * Expands the pop-up window.
16132
16291
  *
16133
- * @see elementsJSON
16292
+ * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `true`.
16293
+ * @see collapse
16134
16294
  */
16135
- createElements?: any;
16295
+ expand(): void;
16136
16296
  /**
16137
- * A JSON schema for a built-in question type on which the custom question type is based.
16297
+ * Collapses the pop-up window, leaving only the survey title visible.
16138
16298
  *
16139
- * Refer to the [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) help topic for more information.
16299
+ * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `false`.
16300
+ * @see expand
16140
16301
  */
16141
- questionJSON?: any;
16302
+ collapse(): void;
16303
+ changeExpandCollapse(): void;
16142
16304
  /**
16143
- * A function that allows you to create a custom question if you do not specify the `questionJSON` property.
16305
+ * Specifies whether to display a button that closes the pop-up window.
16144
16306
  *
16145
- * @see questionJSON
16307
+ * Default value: `false`
16308
+ *
16309
+ * If you allow users to close the pop-up window, make sure to implement a UI element that opens it. This element should call the [`show()`](#show) method or enable the [`isShowing`](#isShowing) property.
16310
+ * @see expand
16311
+ * @see collapse
16312
+ * @see hide
16146
16313
  */
16147
- createQuestion?: any;
16148
- valueToQuestion?: (val: any) => any;
16149
- valueFromQuestion?: (val: any) => any;
16150
- getValue?: (val: any) => any;
16151
- setValue?: (val: any) => any;
16152
- }
16153
- export class ComponentQuestionJSON {
16154
- name: string;
16155
- json: ICustomQuestionTypeConfiguration;
16156
- constructor(name: string, json: ICustomQuestionTypeConfiguration);
16157
- onInit(): void;
16158
- onCreated(question: Question): void;
16159
- onLoaded(question: Question): void;
16160
- onAfterRender(question: Question, htmlElement: any): void;
16161
- onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void;
16162
- onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void;
16163
- onPropertyChanged(question: Question, propertyName: string, newValue: any): void;
16164
- onValueChanged(question: Question, name: string, newValue: any): void;
16165
- onValueChanging(question: Question, name: string, newValue: any): any;
16166
- onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void;
16167
- getDisplayValue(keyAsText: boolean, value: any, question: Question): any;
16168
- setValueToQuestion(val: any): any;
16169
- getValueFromQuestion(val: any): any;
16170
- get isComposite(): boolean;
16171
- }
16172
- export class ComponentCollection {
16173
- static Instance: ComponentCollection;
16174
- private customQuestionValues;
16175
- onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel;
16176
- onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel;
16177
- onAddingJson: (name: string, isComposite: boolean) => void;
16178
- add(json: ICustomQuestionTypeConfiguration): void;
16179
- get items(): Array<ComponentQuestionJSON>;
16180
- getCustomQuestionByName(name: string): ComponentQuestionJSON;
16181
- clear(): void;
16182
- createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question;
16183
- protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel;
16184
- protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel;
16185
- }
16186
- export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel {
16187
- customQuestion: ComponentQuestionJSON;
16188
- constructor(name: string, customQuestion: ComponentQuestionJSON);
16189
- getType(): string;
16190
- locStrsChanged(): void;
16191
- protected createWrapper(): void;
16192
- protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
16193
- itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void;
16194
- onFirstRendering(): void;
16195
- onHidingContent(): void;
16196
- getProgressInfo(): IProgressInfo;
16197
- protected abstract getElement(): SurveyElement;
16198
- protected initElement(el: SurveyElement): void;
16199
- protected isSettingValOnLoading: boolean;
16200
- setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
16201
- onSurveyLoad(): void;
16202
- afterRenderQuestionElement(el: HTMLElement): void;
16203
- afterRenderCore(el: any): void;
16204
- protected onUpdateQuestionCssClasses(element: Question, css: any): void;
16205
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16206
- protected setNewValue(newValue: any): void;
16207
- getSurveyData(): ISurveyData;
16208
- getTextProcessor(): ITextProcessor;
16209
- getValue(name: string): any;
16210
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16211
- protected getQuestionByName(name: string): IQuestion;
16212
- protected isValueChanging(name: string, newValue: any): boolean;
16213
- protected convertDataName(name: string): string;
16214
- protected convertDataValue(name: string, newValue: any): any;
16215
- getVariable(name: string): any;
16216
- setVariable(name: string, newValue: any): void;
16217
- getComment(name: string): string;
16218
- setComment(name: string, newValue: string, locNotification: any): any;
16219
- getAllValues(): any;
16220
- getFilteredValues(): any;
16221
- getFilteredProperties(): any;
16222
- findQuestionByName(name: string): IQuestion;
16223
- addElement(element: IElement, index: number): void;
16224
- removeElement(element: IElement): boolean;
16225
- getQuestionTitleLocation(): string;
16226
- getQuestionStartIndex(): string;
16227
- getChildrenLayoutType(): string;
16228
- elementWidthChanged(el: IElement): void;
16229
- get elements(): Array<IElement>;
16230
- indexOf(el: IElement): number;
16231
- ensureRowsVisibility(): void;
16232
- validateContainerOnly(): void;
16233
- getQuestionErrorLocation(): string;
16234
- protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any;
16235
- }
16236
- export class QuestionCustomModel extends QuestionCustomModelBase {
16237
- private questionWrapper;
16238
- getTemplate(): string;
16239
- protected createWrapper(): void;
16240
- protected getElement(): SurveyElement;
16241
- onAnyValueChanged(name: string, questionName: string): void;
16242
- protected getQuestionByName(name: string): IQuestion;
16243
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16244
- protected onSetData(): void;
16245
- hasErrors(fireCallback?: boolean, rec?: any): boolean;
16246
- focus(onError?: boolean): void;
16247
- afterRenderCore(el: any): void;
16248
- get contentQuestion(): Question;
16249
- protected createQuestion(): Question;
16250
- onSurveyLoad(): void;
16251
- runCondition(values: HashTable<any>, properties: HashTable<any>): void;
16252
- protected convertDataName(name: string): string;
16253
- protected convertDataValue(name: string, newValue: any): any;
16254
- protected getContentQuestionValue(): any;
16255
- protected setContentQuestionValue(val: any): void;
16256
- protected canSetValueToSurvey(): boolean;
16257
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16258
- onSurveyValueChanged(newValue: any): void;
16259
- protected getValueCore(): any;
16260
- private isSettingValueChanged;
16261
- protected setValueChangedDirectly(val: boolean): void;
16262
- protected initElement(el: SurveyElement): void;
16263
- updateElementCss(reNew?: boolean): void;
16264
- protected updateElementCssCore(cssClasses: any): void;
16265
- protected getDisplayValueCore(keyAsText: boolean, value: any): any;
16314
+ get allowClose(): boolean;
16315
+ set allowClose(val: boolean);
16316
+ get css(): any;
16317
+ get cssButton(): string;
16318
+ get cssRoot(): string;
16319
+ get cssBody(): string;
16320
+ get cssHeaderRoot(): string;
16321
+ get cssHeaderTitle(): string;
16322
+ get cssHeaderButton(): string;
16323
+ get renderedWidth(): string;
16324
+ width: string;
16325
+ private updateCss;
16326
+ private updateCssButton;
16327
+ private setCssButton;
16328
+ protected createSurvey(jsonObj: any): SurveyModel;
16329
+ protected onSurveyComplete(): void;
16330
+ onScroll(): void;
16266
16331
  }
16267
- export class QuestionCompositeModel extends QuestionCustomModelBase {
16268
- customQuestion: ComponentQuestionJSON;
16269
- static ItemVariableName: string;
16270
- private panelWrapper;
16271
- private textProcessing;
16272
- constructor(name: string, customQuestion: ComponentQuestionJSON);
16273
- protected createWrapper(): void;
16274
- getTemplate(): string;
16275
- protected getElement(): SurveyElement;
16276
- protected getCssRoot(cssClasses: any): string;
16277
- get contentPanel(): PanelModel;
16278
- hasErrors(fireCallback?: boolean, rec?: any): boolean;
16279
- updateElementCss(reNew?: boolean): void;
16280
- getTextProcessor(): ITextProcessor;
16281
- findQuestionByName(name: string): IQuestion;
16282
- protected clearValueIfInvisibleCore(reason: string): void;
16283
- onAnyValueChanged(name: string, questionName: string): void;
16284
- get hasSingleInput(): boolean;
16285
- get isContainer(): boolean;
16286
- protected createPanel(): PanelModel;
16287
- protected onReadOnlyChanged(): void;
16288
- onSurveyLoad(): void;
16289
- private setIsContentElement;
16290
- setVisibleIndex(val: number): number;
16291
- runCondition(values: HashTable<any>, properties: HashTable<any>): void;
16292
- getValue(name: string): any;
16293
- protected getQuestionByName(name: string): IQuestion;
16294
- private settingNewValue;
16295
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16296
- private updateValueCoreWithPanelValue;
16297
- private getContentPanelValue;
16298
- private getValueForContentPanel;
16299
- private setNewValueIntoQuestion;
16300
- addConditionObjectsByContext(objects: Array<IConditionObject>, context: any): void;
16301
- protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean): void;
16302
- protected convertDataValue(name: string, newValue: any): any;
16303
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16304
- private setValuesIntoQuestions;
16305
- protected getDisplayValueCore(keyAsText: boolean, value: any): any;
16306
- private setAfterRenderCallbacks;
16332
+ /**
16333
+ * Obsolete. Please use PopupSurvey
16334
+ */
16335
+ export class SurveyWindowModel extends PopupSurveyModel {
16307
16336
  }
16308
16337
  }
16309
16338
  declare module "popup-dropdown-view-model" {
@@ -23625,6 +23654,7 @@ declare module "react/reactquestion_comment" {
23625
23654
  protected canRender(): boolean;
23626
23655
  protected onCommentChange(event: any): void;
23627
23656
  protected onCommentInput(event: any): void;
23657
+ protected onCommentCompositionUpdate(event: any): void;
23628
23658
  protected getComment(): string;
23629
23659
  protected getId(): string;
23630
23660
  protected getPlaceholder(): string;
@@ -23633,6 +23663,7 @@ declare module "react/reactquestion_comment" {
23633
23663
  export class SurveyQuestionOtherValueItem extends SurveyQuestionCommentItem {
23634
23664
  protected onCommentChange(event: any): void;
23635
23665
  protected onCommentInput(event: any): void;
23666
+ protected onCommentCompositionUpdate(event: any): void;
23636
23667
  protected getComment(): string;
23637
23668
  protected getId(): string;
23638
23669
  protected getPlaceholder(): string;