survey-react 1.9.115 → 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 {
@@ -1343,13 +1343,13 @@ declare module "actions/action" {
1343
1343
  *
1344
1344
  * Action items are used in the Toolbar, matrix rows, titles of pages, panels, questions, and other survey elements.
1345
1345
  *
1346
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1346
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1347
1347
  */
1348
1348
  export interface IAction {
1349
1349
  /**
1350
1350
  * A unique action item identifier.
1351
1351
  *
1352
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1352
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1353
1353
  */
1354
1354
  id?: string;
1355
1355
  /**
@@ -1361,7 +1361,7 @@ declare module "actions/action" {
1361
1361
  /**
1362
1362
  * The action item's title.
1363
1363
  *
1364
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1364
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1365
1365
  * @see showTitle
1366
1366
  * @see disableShrink
1367
1367
  */
@@ -1389,7 +1389,7 @@ declare module "actions/action" {
1389
1389
  /**
1390
1390
  * A function that is executed when users click the action item.
1391
1391
  *
1392
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1392
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1393
1393
  */
1394
1394
  action?: (context?: any) => void;
1395
1395
  /**
@@ -1399,7 +1399,7 @@ declare module "actions/action" {
1399
1399
  *
1400
1400
  * To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
1401
1401
  *
1402
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1402
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1403
1403
  * @see innerCss
1404
1404
  */
1405
1405
  css?: string;
@@ -1410,7 +1410,7 @@ declare module "actions/action" {
1410
1410
  *
1411
1411
  * To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
1412
1412
  *
1413
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1413
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1414
1414
  * @see css
1415
1415
  */
1416
1416
  innerCss?: string;
@@ -1473,7 +1473,7 @@ declare module "actions/action" {
1473
1473
  /**
1474
1474
  * A number that specifies the action's position relative to other actions.
1475
1475
  *
1476
- * [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
1476
+ * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
1477
1477
  */
1478
1478
  visibleIndex?: number;
1479
1479
  needSpace?: boolean;
@@ -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[];
@@ -5207,63 +5619,18 @@ declare module "question_matrixdynamic" {
5207
5619
  private hasErrorInMinRows;
5208
5620
  protected getUniqueColumns(): Array<MatrixDropdownColumn>;
5209
5621
  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;
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" {
@@ -5593,7 +5960,7 @@ declare module "question_paneldynamic" {
5593
5960
  *
5594
5961
  * If you want to customize individual tab titles, handle `SurveyModel`'s [`onGetDynamicPanelTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetDynamicPanelTabTitle) event.
5595
5962
  *
5596
- * [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
5963
+ * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
5597
5964
  * @see templateTitle
5598
5965
  * @see renderMode
5599
5966
  */
@@ -5882,7 +6249,7 @@ declare module "question_paneldynamic" {
5882
6249
  * - `"progressTop"` - Renders each panel as a card and displays a progress bar at the top. [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/)
5883
6250
  * - `"progressBottom"` - Renders each panel panel as a card and displays a progress bar at the bottom.
5884
6251
  * - `"progressTopBottom"` - Renders each panel as a card and displays a progress bar at the top and bottom.
5885
- * - `"tab"` - Renders each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles. [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/)
6252
+ * - `"tab"` - Renders each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles. [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/)
5886
6253
  */
5887
6254
  get renderMode(): string;
5888
6255
  set renderMode(val: string);
@@ -6590,7 +6957,7 @@ declare module "survey-events-api" {
6590
6957
  }
6591
6958
  export interface UploadFilesEvent extends LoadFilesEvent {
6592
6959
  /**
6593
- * A callback function that you should call when a file is uploaded successfully or when file upload fails. Pass `"success"` or `"error"` to indicate the operation status and, optionally, the downloaded file's data.
6960
+ * A callback function that you should call when a file is uploaded successfully or when file upload fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass the uploaded file's data if file upload was successful or an error message if file upload failed.
6594
6961
  */
6595
6962
  callback: (status: string, data?: any) => any;
6596
6963
  /**
@@ -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"` to indicate the operation status and, optionally, the downloaded file's data as a Base64 string.
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"` to indicate the operation status and, optionally, deleted files' data (`options.value`).
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
  /**
@@ -7641,7 +8008,7 @@ declare module "question_multipletext" {
7641
8008
  /**
7642
8009
  * A class that describes an item in a [Multiple Textboxes](https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model) question.
7643
8010
  *
7644
- * [View Demo](/form-library/examples/multiple-text-box-question/)
8011
+ * [View Demo](https://surveyjs.io/form-library/examples/multiple-text-box-question/)
7645
8012
  */
7646
8013
  export class MultipleTextItemModel extends Base implements IValidatorOwner, ISurveyData, ISurveyImpl {
7647
8014
  private editorValue;
@@ -8390,16 +8757,16 @@ declare module "survey" {
8390
8757
  *
8391
8758
  * For information on event handler parameters, refer to descriptions within the interface.
8392
8759
  *
8393
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
8760
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
8394
8761
  * @see css
8395
8762
  */
8396
8763
  onUpdateQuestionCssClasses: EventBase<SurveyModel, UpdateQuestionCssClassesEvent>;
8397
8764
  /**
8398
- * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes.
8765
+ * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](https://surveyjs.io/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes.
8399
8766
  *
8400
8767
  * For information on event handler parameters, refer to descriptions within the interface.
8401
8768
  *
8402
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
8769
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
8403
8770
  * @see css
8404
8771
  */
8405
8772
  onUpdatePanelCssClasses: EventBase<SurveyModel, UpdatePanelCssClassesEvent>;
@@ -8408,7 +8775,7 @@ declare module "survey" {
8408
8775
  *
8409
8776
  * For information on event handler parameters, refer to descriptions within the interface.
8410
8777
  *
8411
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
8778
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
8412
8779
  * @see css
8413
8780
  */
8414
8781
  onUpdatePageCssClasses: EventBase<SurveyModel, UpdatePageCssClassesEvent>;
@@ -8417,7 +8784,7 @@ declare module "survey" {
8417
8784
  *
8418
8785
  * For information on event handler parameters, refer to descriptions within the interface.
8419
8786
  *
8420
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
8787
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
8421
8788
  * @see css
8422
8789
  */
8423
8790
  onUpdateChoiceItemCss: EventBase<SurveyModel, UpdateChoiceItemCssEvent>;
@@ -8509,7 +8876,7 @@ declare module "survey" {
8509
8876
  */
8510
8877
  onMatrixRowAdding: EventBase<SurveyModel, MatrixBeforeRowAddedEvent>;
8511
8878
  /**
8512
- * This event is obsolete. Use the [`onMatrixRowAdding`](/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead.
8879
+ * This event is obsolete. Use the [`onMatrixRowAdding`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead.
8513
8880
  */
8514
8881
  onMatrixBeforeRowAdded: EventBase<SurveyModel, MatrixBeforeRowAddedEvent>;
8515
8882
  /**
@@ -8529,7 +8896,7 @@ declare module "survey" {
8529
8896
  */
8530
8897
  onMatrixRenderRemoveButton: EventBase<SurveyModel, MatrixAllowRemoveRowEvent>;
8531
8898
  /**
8532
- * This event is obsolete. Use the [`onMatrixRenderRemoveButton`](/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead.
8899
+ * This event is obsolete. Use the [`onMatrixRenderRemoveButton`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead.
8533
8900
  */
8534
8901
  onMatrixAllowRemoveRow: EventBase<SurveyModel, MatrixAllowRemoveRowEvent>;
8535
8902
  /**
@@ -8548,7 +8915,7 @@ declare module "survey" {
8548
8915
  */
8549
8916
  onAfterRenderMatrixCell: EventBase<SurveyModel, MatrixAfterCellRenderEvent>;
8550
8917
  /**
8551
- * This event is obsolete. Use the [`onAfterRenderMatrixCell`](/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead.
8918
+ * This event is obsolete. Use the [`onAfterRenderMatrixCell`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead.
8552
8919
  */
8553
8920
  onMatrixAfterCellRender: EventBase<SurveyModel, MatrixAfterCellRenderEvent>;
8554
8921
  /**
@@ -8606,7 +8973,7 @@ declare module "survey" {
8606
8973
  *
8607
8974
  * For information on event handler parameters, refer to descriptions within the interface.
8608
8975
  *
8609
- * [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
8976
+ * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
8610
8977
  */
8611
8978
  onGetDynamicPanelTabTitle: EventBase<SurveyModel, DynamicPanelGetTabTitleEvent>;
8612
8979
  /**
@@ -8700,7 +9067,7 @@ declare module "survey" {
8700
9067
  /**
8701
9068
  * Gets or sets an object in which keys are UI elements and values are CSS classes applied to them.
8702
9069
  *
8703
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
9070
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
8704
9071
  */
8705
9072
  get css(): any;
8706
9073
  set css(value: any);
@@ -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;
@@ -10676,8 +11043,8 @@ declare module "survey" {
10676
11043
  /**
10677
11044
  * Applies a specified theme to the survey.
10678
11045
  *
10679
- * [Themes & Styles](/form-library/documentation/manage-default-themes-and-styles (linkStyle))
10680
- * @param theme An [`ITheme`](/form-library/documentation/api-reference/itheme) object with theme settings.
11046
+ * [Themes & Styles](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles (linkStyle))
11047
+ * @param theme An [`ITheme`](https://surveyjs.io/form-library/documentation/api-reference/itheme) object with theme settings.
10681
11048
  */
10682
11049
  applyTheme(theme: ITheme): void;
10683
11050
  themeChanged(theme: ITheme): void;
@@ -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;
@@ -11958,6 +12327,7 @@ declare module "question" {
11958
12327
  protected onChangeQuestionValue(newValue: any): void;
11959
12328
  protected setValueChangedDirectly(val: boolean): void;
11960
12329
  protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
12330
+ private get isParentChangingViaDefaultValue();
11961
12331
  onSurveyValueChanged(newValue: any): void;
11962
12332
  setVisibleIndex(val: number): number;
11963
12333
  removeElement(element: IElement): boolean;
@@ -12140,6 +12510,7 @@ declare module "martixBase" {
12140
12510
  */
12141
12511
  get rowTitleWidth(): string;
12142
12512
  set rowTitleWidth(val: string);
12513
+ getCellAriaLabel(rowTitle: string, columnTitle: string): string;
12143
12514
  }
12144
12515
  }
12145
12516
  declare module "question_matrixdropdownbase" {
@@ -13952,6 +14323,11 @@ declare module "settings" {
13952
14323
  * Default value: `"none"`
13953
14324
  */
13954
14325
  noneItemValue: string;
14326
+ specialChoicesOrder: {
14327
+ selectAllItem: number[];
14328
+ noneItem: number[];
14329
+ otherItem: number[];
14330
+ };
13955
14331
  /**
13956
14332
  * A list of supported validators by question type.
13957
14333
  */
@@ -14138,7 +14514,8 @@ declare module "dropdownListModel" {
14138
14514
  private qustionPropertyChangedHandler;
14139
14515
  constructor(question: Question, onSelectionChanged?: (item: IAction, ...params: any[]) => void);
14140
14516
  get popupModel(): PopupModel;
14141
- get inputReadOnly(): boolean;
14517
+ get noTabIndex(): boolean;
14518
+ get filterReadOnly(): boolean;
14142
14519
  get filterStringEnabled(): boolean;
14143
14520
  get inputMode(): "none" | "text";
14144
14521
  setSearchEnabled(newValue: boolean): void;
@@ -14632,8 +15009,11 @@ declare module "question_checkbox" {
14632
15009
  private noneIndexInArray;
14633
15010
  protected canUseFilteredChoices(): boolean;
14634
15011
  protected supportSelectAll(): boolean;
14635
- protected addToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
14636
- 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;
14637
15017
  isItemInList(item: ItemValue): boolean;
14638
15018
  protected getDisplayValueCore(keysAsText: boolean, value: any): any;
14639
15019
  protected clearIncorrectValuesCore(): void;
@@ -14904,7 +15284,8 @@ declare module "question_imagepicker" {
14904
15284
  set contentMode(val: string);
14905
15285
  protected convertDefaultValue(val: any): any;
14906
15286
  get inputType(): "checkbox" | "radio";
14907
- protected isFootChoice(_item: ItemValue, _question: QuestionSelectBase): boolean;
15287
+ protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean;
15288
+ protected addToVisibleChoices(items: Array<ItemValue>, isAddAll: boolean): void;
14908
15289
  getSelectBaseRootCss(): string;
14909
15290
  private isResponsiveValue;
14910
15291
  maxImageWidth: number;
@@ -15146,6 +15527,7 @@ declare module "question_comment" {
15146
15527
  beforeDestroyQuestionElement(el: HTMLElement): void;
15147
15528
  onInput(event: any): void;
15148
15529
  onKeyDown(event: any): void;
15530
+ protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
15149
15531
  onValueChanged(): void;
15150
15532
  protected setNewValue(newValue: string): any;
15151
15533
  protected getValueSeparator(): string;
@@ -15275,7 +15657,7 @@ declare module "question_rating" {
15275
15657
  *
15276
15658
  * If you do not specify the `rateValues` property, rate values are generated automatically based upon the [`rateMin`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMin), [`rateMax`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMax), [`rateStep`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateStep), and [`rateCount`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateCount) property values.
15277
15659
  *
15278
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15660
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15279
15661
  */
15280
15662
  get rateValues(): Array<any>;
15281
15663
  set rateValues(val: Array<any>);
@@ -15284,7 +15666,7 @@ declare module "question_rating" {
15284
15666
  *
15285
15667
  * Default value: 1
15286
15668
  *
15287
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15669
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15288
15670
  * @see rateMax
15289
15671
  * @see rateStep
15290
15672
  * @see rateCount
@@ -15296,7 +15678,7 @@ declare module "question_rating" {
15296
15678
  *
15297
15679
  * Default value: 5
15298
15680
  *
15299
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15681
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15300
15682
  * @see rateMin
15301
15683
  * @see rateStep
15302
15684
  * @see rateCount
@@ -15308,7 +15690,7 @@ declare module "question_rating" {
15308
15690
  *
15309
15691
  * Default value: 1
15310
15692
  *
15311
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15693
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15312
15694
  * @see rateMin
15313
15695
  * @see rateMax
15314
15696
  * @see rateCount
@@ -15320,7 +15702,7 @@ declare module "question_rating" {
15320
15702
  *
15321
15703
  * Set the [`rateMin`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMin) or [`rateMax`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMax) property to specify the first or the last rate value. Use the [`rateStep`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateStep) property to specify a step with which to generate rate values.
15322
15704
  *
15323
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15705
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15324
15706
  */
15325
15707
  rateCount: number;
15326
15708
  private static colorsCalculated;
@@ -15389,7 +15771,7 @@ declare module "question_rating" {
15389
15771
  * - `"dropdown"` - Displays rate values as items in a drop-down list.
15390
15772
  * - `"auto"` (default) - Selects between the `"buttons"` and `"dropdown"` modes based on the available width. When the width is insufficient to display buttons, the question displays a dropdown.
15391
15773
  *
15392
- * [View Demo](/form-library/examples/ui-adaptation-modes-for-rating-scale/ (linkStyle))
15774
+ * [View Demo](https://surveyjs.io/form-library/examples/ui-adaptation-modes-for-rating-scale/ (linkStyle))
15393
15775
  * @see rateType
15394
15776
  */
15395
15777
  displayMode: "dropdown" | "buttons" | "auto";
@@ -15402,7 +15784,7 @@ declare module "question_rating" {
15402
15784
  * - `"stars"` - Displays rate values as stars.
15403
15785
  * - `"smileys"` - Displays rate values as smiley faces.
15404
15786
  *
15405
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15787
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15406
15788
  * @see scaleColorMode
15407
15789
  * @see rateColorMode
15408
15790
  * @see displayMode
@@ -15418,7 +15800,7 @@ declare module "question_rating" {
15418
15800
  * - `"monochrome"` (default) - Displays emojis in monochrome.
15419
15801
  * - `"colored"` - Displays emojis in color.
15420
15802
  *
15421
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
15803
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
15422
15804
  * @see rateColorMode
15423
15805
  */
15424
15806
  scaleColorMode: "monochrome" | "colored";
@@ -15673,7 +16055,6 @@ declare module "question_image" {
15673
16055
  declare module "question_signaturepad" {
15674
16056
  import { Question } from "question";
15675
16057
  import { ITheme } from "themes";
15676
- export function getCanvasRatio(canvas: HTMLCanvasElement): number;
15677
16058
  /**
15678
16059
  * A class that describes the Signature question type.
15679
16060
  *
@@ -15690,6 +16071,13 @@ declare module "question_signaturepad" {
15690
16071
  afterRenderQuestionElement(el: HTMLElement): void;
15691
16072
  beforeDestroyQuestionElement(el: HTMLElement): void;
15692
16073
  themeChanged(theme: ITheme): void;
16074
+ private canvas;
16075
+ private scale;
16076
+ private valueIsUpdatingInternally;
16077
+ private resizeCanvas;
16078
+ private scaleCanvas;
16079
+ private refreshCanvas;
16080
+ private updateValueHandler;
15693
16081
  initSignaturePad(el: HTMLElement): void;
15694
16082
  destroySignaturePad(el: HTMLElement): void;
15695
16083
  /**
@@ -15713,6 +16101,29 @@ declare module "question_signaturepad" {
15713
16101
  */
15714
16102
  get signatureHeight(): number;
15715
16103
  set signatureHeight(val: number);
16104
+ /**
16105
+ * Specifies whether the signature area should be scaled to fit into the question width.
16106
+ *
16107
+ * Default value: `false`
16108
+ *
16109
+ * > The signature area is scaled only for display. The resulting image will have dimensions specified by the [`signatureHeight`](#signatureHeight) and [`signatureWidth`](#signatureWidth) properties.
16110
+ */
16111
+ signatureAutoScaleEnabled: boolean;
16112
+ /**
16113
+ * Speicifies the minimum width of pen strokes, measured in pixels.
16114
+ *
16115
+ * Default value: 0.5
16116
+ */
16117
+ penMinWidth: number;
16118
+ /**
16119
+ * Speicifies the maximum width of pen strokes, measured in pixels.
16120
+ *
16121
+ * Default value: 2.5
16122
+ */
16123
+ penMaxWidth: number;
16124
+ private get containerHeight();
16125
+ private get containerWidth();
16126
+ get renderedCanvasWidth(): string;
15716
16127
  get height(): number;
15717
16128
  set height(val: number);
15718
16129
  /**
@@ -15837,442 +16248,91 @@ declare module "popup-survey" {
15837
16248
  *
15838
16249
  * Set this property to a negative value (for instance, -1) to keep the pop-up window open without a time limit.
15839
16250
  */
15840
- closeOnCompleteTimeout: number;
15841
- /**
15842
- * Indicates whether the pop-up survey appears on the page, regardless of its [expand state](#isExpanded).
15843
- *
15844
- * 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.
15845
- */
15846
- get isShowing(): boolean;
15847
- set isShowing(val: boolean);
15848
- /**
15849
- * Shows the pop-up survey. The survey may appear [expanded or collapsed](#isExpanded).
15850
- *
15851
- * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `true`.
15852
- * @see hide
15853
- */
15854
- show(): void;
15855
- /**
15856
- * Hides the pop-up survey.
15857
- *
15858
- * As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `false`.
15859
- * @see show
15860
- * @see expand
15861
- * @see collapse
15862
- */
15863
- hide(): void;
15864
- /**
15865
- * Indicates whether the pop-up window is expanded or collapsed.
15866
- *
15867
- * 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.
15868
- */
15869
- get isExpanded(): boolean;
15870
- set isExpanded(val: boolean);
15871
- protected onExpandedChanged(): void;
15872
- /**
15873
- * 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.
15874
- */
15875
- get title(): string;
15876
- set title(value: string);
15877
- get locTitle(): LocalizableString;
15878
- /**
15879
- * Expands the pop-up window.
15880
- *
15881
- * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `true`.
15882
- * @see collapse
15883
- */
15884
- expand(): void;
15885
- /**
15886
- * Collapses the pop-up window, leaving only the survey title visible.
15887
- *
15888
- * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `false`.
15889
- * @see expand
15890
- */
15891
- collapse(): void;
15892
- changeExpandCollapse(): void;
15893
- /**
15894
- * Specifies whether to display a button that closes the pop-up window.
15895
- *
15896
- * Default value: `false`
15897
- *
15898
- * 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.
15899
- * @see expand
15900
- * @see collapse
15901
- * @see hide
15902
- */
15903
- get allowClose(): boolean;
15904
- set allowClose(val: boolean);
15905
- get css(): any;
15906
- get cssButton(): string;
15907
- get cssRoot(): string;
15908
- get cssBody(): string;
15909
- get cssHeaderRoot(): string;
15910
- get cssHeaderTitle(): string;
15911
- get cssHeaderButton(): string;
15912
- get renderedWidth(): string;
15913
- width: string;
15914
- private updateCss;
15915
- private updateCssButton;
15916
- private setCssButton;
15917
- protected createSurvey(jsonObj: any): SurveyModel;
15918
- protected onSurveyComplete(): void;
15919
- onScroll(): void;
15920
- }
15921
- /**
15922
- * Obsolete. Please use PopupSurvey
15923
- */
15924
- export class SurveyWindowModel extends PopupSurveyModel {
15925
- }
15926
- }
15927
- declare module "question_custom" {
15928
- import { Question, IConditionObject } from "question";
15929
- import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "base-interfaces";
15930
- import { SurveyElement } from "survey-element";
15931
- import { PanelModel } from "panel";
15932
- import { HashTable } from "helpers";
15933
- import { ItemValue } from "itemvalue";
15934
- /**
15935
- * An interface used to create custom question types.
15936
- *
15937
- * Refer to the following articles for more information:
15938
- *
15939
- * - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types)
15940
- * - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types)
15941
- */
15942
- export interface ICustomQuestionTypeConfiguration {
15943
- /**
15944
- * A name used to identify a custom question type.
15945
- *
15946
- * @see title
15947
- */
15948
- name: string;
15949
- /**
15950
- * A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used.
15951
- *
15952
- * @see name
15953
- */
15954
- title?: string;
15955
- /**
15956
- * The name of an icon to use for the custom question type.
15957
- *
15958
- * [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
15959
- */
15960
- iconName?: string;
15961
- /**
15962
- * 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)).
15963
- */
15964
- onInit?(): void;
15965
- /**
15966
- * Specifies whether the custom question type is available in the Toolbox and the Add Question menu.
15967
- *
15968
- * Default value: `true`
15969
- *
15970
- * 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.
15971
- */
15972
- showInToolbox?: boolean;
15973
- /**
15974
- * 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).
15975
- *
15976
- * Parameters:
15977
- *
15978
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
15979
- * The custom question.
15980
- */
15981
- onCreated?(question: Question): void;
15982
- /**
15983
- * A function that is called when JSON schemas are loaded.
15984
- *
15985
- * Parameters:
15986
- *
15987
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
15988
- * A custom question.
15989
- */
15990
- onLoaded?(question: Question): void;
15991
- /**
15992
- * A function that is called after the entire question is rendered.
15993
- *
15994
- * Parameters:
15995
- *
15996
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
15997
- * A custom question.
15998
- * - `htmlElement`: `any`\
15999
- * An HTML element that represents the custom question.
16000
- */
16001
- onAfterRender?(question: Question, htmlElement: any): void;
16002
- /**
16003
- * 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.
16004
- *
16005
- * Parameters:
16006
- *
16007
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16008
- * A composite question.
16009
- * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16010
- * A nested question.
16011
- * - `htmlElement`: `any`\
16012
- * An HTML element that represents a nested question.
16013
- */
16014
- onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void;
16015
- /**
16016
- * 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.
16017
- *
16018
- * Parameters:
16019
- *
16020
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16021
- * A composite question.
16022
- * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16023
- * A nested question.
16024
- * - `cssClasses`: `any`\
16025
- * 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.
16026
- */
16027
- onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void;
16028
- /**
16029
- * A function that is called when a custom question type property is changed. Use it to handle property changes.
16030
- *
16031
- * Parameters:
16032
- *
16033
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16034
- * A custom question.
16035
- * - `propertyName`: `string`\
16036
- * The name of the changed property.
16037
- * - `newValue`: `any`\
16038
- * A new value for the property.
16039
- */
16040
- onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
16041
- /**
16042
- * A function that is called after the question value is changed.
16043
- *
16044
- * Parameters:
16045
- *
16046
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16047
- * A custom question.
16048
- * - `name`: `string`\
16049
- * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
16050
- * - `newValue`: `any`\
16051
- * A new value for the question.
16052
- */
16053
- onValueChanged?(question: Question, name: string, newValue: any): void;
16054
- /**
16055
- * A function that is called before a question value is changed.
16056
- *
16057
- * This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
16058
- *
16059
- * Parameters:
16060
- *
16061
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16062
- * A custom question.
16063
- * - `name`: `string`\
16064
- * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
16065
- * - `newValue`: `any`\
16066
- * 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.
16067
16256
  */
16068
- onValueChanging?(question: Question, name: string, newValue: any): any;
16257
+ get isShowing(): boolean;
16258
+ set isShowing(val: boolean);
16069
16259
  /**
16070
- * 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).
16071
16261
  *
16072
- * 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.
16073
16268
  *
16074
- * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
16075
- * A custom question.
16076
- * - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\
16077
- * An `ItemValue` object.
16078
- * - `options.propertyName`: `string`\
16079
- * The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`).
16080
- * - `options.name`: `string`\
16081
- * The name of the changed property: `"text"` or `"value"`.
16082
- * - `options.newValue`: `any`\
16083
- * 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
16084
16273
  */
16085
- onItemValuePropertyChanged?(question: Question, options: {
16086
- obj: ItemValue;
16087
- propertyName: string;
16088
- name: string;
16089
- newValue: any;
16090
- }): void;
16274
+ hide(): void;
16091
16275
  /**
16092
- * 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.
16093
16279
  */
16094
- getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any);
16280
+ get isExpanded(): boolean;
16281
+ set isExpanded(val: boolean);
16282
+ protected onExpandedChanged(): void;
16095
16283
  /**
16096
- * 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.
16097
16285
  */
16098
- elementsJSON?: any;
16286
+ get title(): string;
16287
+ set title(value: string);
16288
+ get locTitle(): LocalizableString;
16099
16289
  /**
16100
- * A function that allows you to create nested questions if you do not specify the `elementsJSON` property.
16290
+ * Expands the pop-up window.
16101
16291
  *
16102
- * @see elementsJSON
16292
+ * As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `true`.
16293
+ * @see collapse
16103
16294
  */
16104
- createElements?: any;
16295
+ expand(): void;
16105
16296
  /**
16106
- * 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.
16107
16298
  *
16108
- * 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
16109
16301
  */
16110
- questionJSON?: any;
16302
+ collapse(): void;
16303
+ changeExpandCollapse(): void;
16111
16304
  /**
16112
- * 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.
16113
16306
  *
16114
- * @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
16115
16313
  */
16116
- createQuestion?: any;
16117
- valueToQuestion?: (val: any) => any;
16118
- valueFromQuestion?: (val: any) => any;
16119
- getValue?: (val: any) => any;
16120
- setValue?: (val: any) => any;
16121
- }
16122
- export class ComponentQuestionJSON {
16123
- name: string;
16124
- json: ICustomQuestionTypeConfiguration;
16125
- constructor(name: string, json: ICustomQuestionTypeConfiguration);
16126
- onInit(): void;
16127
- onCreated(question: Question): void;
16128
- onLoaded(question: Question): void;
16129
- onAfterRender(question: Question, htmlElement: any): void;
16130
- onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void;
16131
- onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void;
16132
- onPropertyChanged(question: Question, propertyName: string, newValue: any): void;
16133
- onValueChanged(question: Question, name: string, newValue: any): void;
16134
- onValueChanging(question: Question, name: string, newValue: any): any;
16135
- onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void;
16136
- getDisplayValue(keyAsText: boolean, value: any, question: Question): any;
16137
- setValueToQuestion(val: any): any;
16138
- getValueFromQuestion(val: any): any;
16139
- get isComposite(): boolean;
16140
- }
16141
- export class ComponentCollection {
16142
- static Instance: ComponentCollection;
16143
- private customQuestionValues;
16144
- onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel;
16145
- onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel;
16146
- onAddingJson: (name: string, isComposite: boolean) => void;
16147
- add(json: ICustomQuestionTypeConfiguration): void;
16148
- get items(): Array<ComponentQuestionJSON>;
16149
- getCustomQuestionByName(name: string): ComponentQuestionJSON;
16150
- clear(): void;
16151
- createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question;
16152
- protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel;
16153
- protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel;
16154
- }
16155
- export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel {
16156
- customQuestion: ComponentQuestionJSON;
16157
- constructor(name: string, customQuestion: ComponentQuestionJSON);
16158
- getType(): string;
16159
- locStrsChanged(): void;
16160
- protected createWrapper(): void;
16161
- protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
16162
- itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void;
16163
- onFirstRendering(): void;
16164
- onHidingContent(): void;
16165
- getProgressInfo(): IProgressInfo;
16166
- protected abstract getElement(): SurveyElement;
16167
- protected initElement(el: SurveyElement): void;
16168
- protected isSettingValOnLoading: boolean;
16169
- setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
16170
- onSurveyLoad(): void;
16171
- afterRenderQuestionElement(el: HTMLElement): void;
16172
- afterRenderCore(el: any): void;
16173
- protected onUpdateQuestionCssClasses(element: Question, css: any): void;
16174
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16175
- protected setNewValue(newValue: any): void;
16176
- getSurveyData(): ISurveyData;
16177
- getTextProcessor(): ITextProcessor;
16178
- getValue(name: string): any;
16179
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16180
- protected getQuestionByName(name: string): IQuestion;
16181
- protected isValueChanging(name: string, newValue: any): boolean;
16182
- protected convertDataName(name: string): string;
16183
- protected convertDataValue(name: string, newValue: any): any;
16184
- getVariable(name: string): any;
16185
- setVariable(name: string, newValue: any): void;
16186
- getComment(name: string): string;
16187
- setComment(name: string, newValue: string, locNotification: any): any;
16188
- getAllValues(): any;
16189
- getFilteredValues(): any;
16190
- getFilteredProperties(): any;
16191
- findQuestionByName(name: string): IQuestion;
16192
- addElement(element: IElement, index: number): void;
16193
- removeElement(element: IElement): boolean;
16194
- getQuestionTitleLocation(): string;
16195
- getQuestionStartIndex(): string;
16196
- getChildrenLayoutType(): string;
16197
- elementWidthChanged(el: IElement): void;
16198
- get elements(): Array<IElement>;
16199
- indexOf(el: IElement): number;
16200
- ensureRowsVisibility(): void;
16201
- validateContainerOnly(): void;
16202
- getQuestionErrorLocation(): string;
16203
- protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any;
16204
- }
16205
- export class QuestionCustomModel extends QuestionCustomModelBase {
16206
- private questionWrapper;
16207
- getTemplate(): string;
16208
- protected createWrapper(): void;
16209
- protected getElement(): SurveyElement;
16210
- onAnyValueChanged(name: string, questionName: string): void;
16211
- protected getQuestionByName(name: string): IQuestion;
16212
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16213
- protected onSetData(): void;
16214
- hasErrors(fireCallback?: boolean, rec?: any): boolean;
16215
- focus(onError?: boolean): void;
16216
- afterRenderCore(el: any): void;
16217
- get contentQuestion(): Question;
16218
- protected createQuestion(): Question;
16219
- onSurveyLoad(): void;
16220
- runCondition(values: HashTable<any>, properties: HashTable<any>): void;
16221
- protected convertDataName(name: string): string;
16222
- protected convertDataValue(name: string, newValue: any): any;
16223
- protected getContentQuestionValue(): any;
16224
- protected setContentQuestionValue(val: any): void;
16225
- protected canSetValueToSurvey(): boolean;
16226
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16227
- onSurveyValueChanged(newValue: any): void;
16228
- protected getValueCore(): any;
16229
- private isSettingValueChanged;
16230
- protected setValueChangedDirectly(val: boolean): void;
16231
- protected initElement(el: SurveyElement): void;
16232
- updateElementCss(reNew?: boolean): void;
16233
- protected updateElementCssCore(cssClasses: any): void;
16234
- 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;
16235
16331
  }
16236
- export class QuestionCompositeModel extends QuestionCustomModelBase {
16237
- customQuestion: ComponentQuestionJSON;
16238
- static ItemVariableName: string;
16239
- private panelWrapper;
16240
- private textProcessing;
16241
- constructor(name: string, customQuestion: ComponentQuestionJSON);
16242
- protected createWrapper(): void;
16243
- getTemplate(): string;
16244
- protected getElement(): SurveyElement;
16245
- protected getCssRoot(cssClasses: any): string;
16246
- get contentPanel(): PanelModel;
16247
- hasErrors(fireCallback?: boolean, rec?: any): boolean;
16248
- updateElementCss(reNew?: boolean): void;
16249
- getTextProcessor(): ITextProcessor;
16250
- findQuestionByName(name: string): IQuestion;
16251
- protected clearValueIfInvisibleCore(reason: string): void;
16252
- onAnyValueChanged(name: string, questionName: string): void;
16253
- get hasSingleInput(): boolean;
16254
- get isContainer(): boolean;
16255
- protected createPanel(): PanelModel;
16256
- protected onReadOnlyChanged(): void;
16257
- onSurveyLoad(): void;
16258
- private setIsContentElement;
16259
- setVisibleIndex(val: number): number;
16260
- runCondition(values: HashTable<any>, properties: HashTable<any>): void;
16261
- getValue(name: string): any;
16262
- protected getQuestionByName(name: string): IQuestion;
16263
- private settingNewValue;
16264
- setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
16265
- private updateValueCoreWithPanelValue;
16266
- private getContentPanelValue;
16267
- private getValueForContentPanel;
16268
- private setNewValueIntoQuestion;
16269
- addConditionObjectsByContext(objects: Array<IConditionObject>, context: any): void;
16270
- protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean): void;
16271
- protected convertDataValue(name: string, newValue: any): any;
16272
- protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
16273
- private setValuesIntoQuestions;
16274
- protected getDisplayValueCore(keyAsText: boolean, value: any): any;
16275
- private setAfterRenderCallbacks;
16332
+ /**
16333
+ * Obsolete. Please use PopupSurvey
16334
+ */
16335
+ export class SurveyWindowModel extends PopupSurveyModel {
16276
16336
  }
16277
16337
  }
16278
16338
  declare module "popup-dropdown-view-model" {
@@ -23594,6 +23654,7 @@ declare module "react/reactquestion_comment" {
23594
23654
  protected canRender(): boolean;
23595
23655
  protected onCommentChange(event: any): void;
23596
23656
  protected onCommentInput(event: any): void;
23657
+ protected onCommentCompositionUpdate(event: any): void;
23597
23658
  protected getComment(): string;
23598
23659
  protected getId(): string;
23599
23660
  protected getPlaceholder(): string;
@@ -23602,6 +23663,7 @@ declare module "react/reactquestion_comment" {
23602
23663
  export class SurveyQuestionOtherValueItem extends SurveyQuestionCommentItem {
23603
23664
  protected onCommentChange(event: any): void;
23604
23665
  protected onCommentInput(event: any): void;
23666
+ protected onCommentCompositionUpdate(event: any): void;
23605
23667
  protected getComment(): string;
23606
23668
  protected getId(): string;
23607
23669
  protected getPlaceholder(): string;