survey-react 1.11.4 → 1.11.5

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
@@ -191,6 +191,9 @@ declare module "surveyStrings" {
191
191
  localeNames: {
192
192
  [index: string]: any;
193
193
  };
194
+ localeDirections: {
195
+ [index: string]: any;
196
+ };
194
197
  supportedLocales: any[];
195
198
  currentLocale: string;
196
199
  defaultLocale: string;
@@ -989,6 +992,7 @@ declare module "list" {
989
992
  searchClearButtonIcon: string;
990
993
  loadingIndicator: string;
991
994
  itemSelected: string;
995
+ itemGroup: string;
992
996
  itemWithIcon: string;
993
997
  itemDisabled: string;
994
998
  itemFocused: string;
@@ -1059,6 +1063,7 @@ declare module "list" {
1059
1063
  searchClearButtonIcon: string;
1060
1064
  loadingIndicator: string;
1061
1065
  itemSelected: string;
1066
+ itemGroup: string;
1062
1067
  itemWithIcon: string;
1063
1068
  itemDisabled: string;
1064
1069
  itemFocused: string;
@@ -1328,6 +1333,7 @@ declare module "actions/action" {
1328
1333
  get disabled(): boolean;
1329
1334
  get canShrink(): boolean;
1330
1335
  get hasTitle(): boolean;
1336
+ get hasSubItems(): boolean;
1331
1337
  getActionBarItemTitleCss(): string;
1332
1338
  getActionBarItemCss(): string;
1333
1339
  getActionRootCss(): string;
@@ -1360,7 +1366,7 @@ declare module "actions/action" {
1360
1366
  private raiseUpdate;
1361
1367
  constructor(innerItem: IAction);
1362
1368
  private createLocTitle;
1363
- setItems(items: Array<IAction>, onSelectionChanged?: (item: Action, ...params: any[]) => void): void;
1369
+ setSubItems(options: IListModel): void;
1364
1370
  location?: string;
1365
1371
  id: string;
1366
1372
  private _visible;
@@ -2837,7 +2843,7 @@ declare module "question_custom" {
2837
2843
  */
2838
2844
  onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
2839
2845
  /**
2840
- * A function that is called after the question value is changed.
2846
+ * A function that is called after the question value is changed in the UI.
2841
2847
  *
2842
2848
  * Parameters:
2843
2849
  *
@@ -2847,10 +2853,12 @@ declare module "question_custom" {
2847
2853
  * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
2848
2854
  * - `newValue`: `any`\
2849
2855
  * A new value for the question.
2856
+ *
2857
+ * If you want to perform some actions when the value is changed in code as well as in the UI, implement the [`onValueSet`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueSet) function.
2850
2858
  */
2851
2859
  onValueChanged?(question: Question, name: string, newValue: any): void;
2852
2860
  /**
2853
- * A function that is called before a question value is changed.
2861
+ * A function that is called before a question value is changed in the UI.
2854
2862
  *
2855
2863
  * This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
2856
2864
  *
@@ -2918,6 +2926,21 @@ declare module "question_custom" {
2918
2926
  * @returns An error text.
2919
2927
  */
2920
2928
  getErrorText?: (question: Question) => string;
2929
+ /**
2930
+ * A function that is called after the question value is set.
2931
+ *
2932
+ * Parameters:
2933
+ *
2934
+ * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
2935
+ * A custom question.
2936
+ * - `newValue`: `any`\
2937
+ * A new value for the question.
2938
+ *
2939
+ * Unlike the [`onValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueChanged) function, which is called only when the question value is changed in the UI, `onValueSet` is called when the value is changed in code as well.
2940
+ *
2941
+ * [View Demo](https://surveyjs.io/survey-creator/examples/smart-search-input/ (linkStyle))
2942
+ */
2943
+ onValueSet?: (question: Question, newValue: any) => void;
2921
2944
  onSetQuestionValue?: (question: Question, newValue: any) => void;
2922
2945
  valueToQuestion?: (val: any) => any;
2923
2946
  valueFromQuestion?: (val: any) => any;
@@ -3459,6 +3482,8 @@ declare module "panel" {
3459
3482
  get questionTitleLocation(): string;
3460
3483
  set questionTitleLocation(value: string);
3461
3484
  getQuestionTitleLocation(): string;
3485
+ availableQuestionTitleWidth(): boolean;
3486
+ hasElementWithTitleLocationLeft(): boolean;
3462
3487
  /**
3463
3488
  * Sets consistent width for question titles in CSS values. Applies only when [`questionTitleLocation`](#questionTitleLocation) evaluates to `"left"`.
3464
3489
  *
@@ -4720,6 +4745,11 @@ declare module "question_baseselect" {
4720
4745
  get hasHeadItems(): boolean;
4721
4746
  get hasFootItems(): boolean;
4722
4747
  get columns(): any[];
4748
+ protected getObservedElementSelector(): string;
4749
+ protected supportResponsiveness(): boolean;
4750
+ allowMultiColumns: boolean;
4751
+ protected onBeforeSetCompactRenderer(): void;
4752
+ protected onBeforeSetDesktopRenderer(): void;
4723
4753
  get hasColumns(): boolean;
4724
4754
  get rowLayout(): boolean;
4725
4755
  get blockedRow(): boolean;
@@ -4744,6 +4774,10 @@ declare module "question_baseselect" {
4744
4774
  protected getDefaultItemComponent(): string;
4745
4775
  /**
4746
4776
  * The name of a component used to render items.
4777
+ *
4778
+ * [View Dropdown Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
4779
+ *
4780
+ * [View Ranking Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
4747
4781
  */
4748
4782
  get itemComponent(): string;
4749
4783
  set itemComponent(value: string);
@@ -4963,7 +4997,7 @@ declare module "question_expression" {
4963
4997
  unlocCalculation(): void;
4964
4998
  runCondition(values: HashTable<any>, properties: HashTable<any>): void;
4965
4999
  protected canCollectErrors(): boolean;
4966
- protected hasRequiredError(): boolean;
5000
+ hasRequiredError(): boolean;
4967
5001
  private createRunner;
4968
5002
  /**
4969
5003
  * The maximum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property.
@@ -7978,6 +8012,7 @@ declare module "survey-events-api" {
7978
8012
  * A Boolean property that you can set to `false` if you want to cancel the drag and drop operation.
7979
8013
  */
7980
8014
  allow: boolean;
8015
+ allowMultipleElementsInRow?: boolean;
7981
8016
  /**
7982
8017
  * Obsolete. Use `options.draggedElement` instead.
7983
8018
  */
@@ -10355,6 +10390,7 @@ declare module "survey" {
10355
10390
  *
10356
10391
  * You can override this property for individual Long Text questions: [`autoGrow`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model#autoGrow).
10357
10392
  * @see allowResizeComment
10393
+ * @see commentAreaRows
10358
10394
  */
10359
10395
  get autoGrowComment(): boolean;
10360
10396
  set autoGrowComment(val: boolean);
@@ -10365,9 +10401,21 @@ declare module "survey" {
10365
10401
  *
10366
10402
  * You can override this property for individual Long Text questions: [`allowResize`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model#allowResize).
10367
10403
  * @see autoGrowComment
10404
+ * @see commentAreaRows
10368
10405
  */
10369
10406
  get allowResizeComment(): boolean;
10370
10407
  set allowResizeComment(val: boolean);
10408
+ /**
10409
+ * Specifies the visible height of comment areas, measured in lines. Applies to the questions with the [`showCommentArea`](https://surveyjs.io/form-library/documentation/api-reference/question#showCommentArea) or [`showOtherItem`](https://surveyjs.io/form-library/documentation/api-reference/question#showOtherItem) property enabled.
10410
+ *
10411
+ * Default value: 2
10412
+ *
10413
+ * The value of this property is passed on to the `rows` attribute of the underlying `<textarea>` element.
10414
+ * @see autoGrowComment
10415
+ * @see allowResizeComment
10416
+ */
10417
+ get commentAreaRows(): number;
10418
+ set commentAreaRows(val: number);
10371
10419
  /**
10372
10420
  * Specifies when to update the question value in questions with a text input field.
10373
10421
  *
@@ -10428,6 +10476,7 @@ declare module "survey" {
10428
10476
  get locale(): string;
10429
10477
  set locale(value: string);
10430
10478
  private onSurveyLocaleChanged;
10479
+ get localeDir(): string;
10431
10480
  /**
10432
10481
  * Returns an array of locales whose translations are used in the survey.
10433
10482
  *
@@ -13160,6 +13209,7 @@ declare module "question" {
13160
13209
  set hasOther(val: boolean);
13161
13210
  protected hasOtherChanged(): void;
13162
13211
  get requireUpdateCommentValue(): boolean;
13212
+ readOnlyCallback: () => boolean;
13163
13213
  get isReadOnly(): boolean;
13164
13214
  get isInputReadOnly(): boolean;
13165
13215
  get renderedInputReadOnly(): string;
@@ -13197,6 +13247,7 @@ declare module "question" {
13197
13247
  protected initDataFromSurvey(): void;
13198
13248
  protected initCommentFromSurvey(): void;
13199
13249
  protected runExpression(expression: string): any;
13250
+ get commentAreaRows(): number;
13200
13251
  private get autoGrowComment();
13201
13252
  private get allowResizeComment();
13202
13253
  private get questionValue();
@@ -13397,6 +13448,7 @@ declare module "question" {
13397
13448
  protected isValueExpression(val: any): boolean;
13398
13449
  protected setValueAndRunExpression(runner: ExpressionRunner, defaultValue: any, setFunc: (val: any) => void, values?: HashTable<any>, properties?: HashTable<any>): void;
13399
13450
  protected convertFuncValuetoQuestionValue(val: any): any;
13451
+ private runExpressionSetValueCore;
13400
13452
  private runExpressionSetValue;
13401
13453
  private runDefaultValueExpression;
13402
13454
  /**
@@ -13458,7 +13510,7 @@ declare module "question" {
13458
13510
  protected canRunValidators(isOnValueChanged: boolean): boolean;
13459
13511
  private fireSurveyValidation;
13460
13512
  protected onCheckForErrors(errors: Array<SurveyError>, isOnValueChanged: boolean): void;
13461
- protected hasRequiredError(): boolean;
13513
+ hasRequiredError(): boolean;
13462
13514
  private validatorRunner;
13463
13515
  private isRunningValidatorsValue;
13464
13516
  onCompletedAsyncValidators: (hasErrors: boolean) => void;
@@ -13751,6 +13803,7 @@ declare module "martixBase" {
13751
13803
  protected onColumnsChanged(): void;
13752
13804
  protected onRowsChanged(): void;
13753
13805
  protected updateVisibilityBasedOnRows(): void;
13806
+ protected isVisibleCore(): boolean;
13754
13807
  protected shouldRunColumnExpression(): boolean;
13755
13808
  protected hasRowsAsItems(): boolean;
13756
13809
  protected runItemsCondition(values: HashTable<any>, properties: HashTable<any>): boolean;
@@ -13824,6 +13877,7 @@ declare module "question_matrixdropdownbase" {
13824
13877
  onTotalValueChanged(): any;
13825
13878
  getSurvey(): ISurvey;
13826
13879
  getDataFilteredValues(): any;
13880
+ isMatrixReadOnly(): boolean;
13827
13881
  }
13828
13882
  export class MatrixDropdownCell {
13829
13883
  column: MatrixDropdownColumn;
@@ -13871,6 +13925,8 @@ declare module "question_matrixdropdownbase" {
13871
13925
  get rowName(): any;
13872
13926
  get dataName(): string;
13873
13927
  get text(): any;
13928
+ isRowEnabled(): boolean;
13929
+ protected isRowHasEnabledCondition(): boolean;
13874
13930
  get value(): any;
13875
13931
  set value(value: any);
13876
13932
  get locText(): LocalizableString;
@@ -13923,7 +13979,7 @@ declare module "question_matrixdropdownbase" {
13923
13979
  locStrsChanged(): void;
13924
13980
  updateCellQuestionOnColumnChanged(column: MatrixDropdownColumn, name: string, newValue: any): void;
13925
13981
  updateCellQuestionOnColumnItemValueChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void;
13926
- onQuestionReadOnlyChanged(parentIsReadOnly: boolean): void;
13982
+ onQuestionReadOnlyChanged(): void;
13927
13983
  private validationValues;
13928
13984
  hasErrors(fireCallback: boolean, rec: any, raiseOnCompletedAsyncValidators: () => void): boolean;
13929
13985
  protected updateCellOnColumnChanged(cell: MatrixDropdownCell, name: string, newValue: any): void;
@@ -14302,6 +14358,7 @@ declare module "question_matrixdropdownbase" {
14302
14358
  onTotalValueChanged(): any;
14303
14359
  getDataFilteredValues(): any;
14304
14360
  getParentTextProcessor(): ITextProcessor;
14361
+ isMatrixReadOnly(): boolean;
14305
14362
  getQuestionFromArray(name: string, index: number): IQuestion;
14306
14363
  private isMatrixValueEmpty;
14307
14364
  private get SurveyModel();
@@ -14391,6 +14448,7 @@ declare module "base-interfaces" {
14391
14448
  isUpdateValueTextOnTyping: boolean;
14392
14449
  autoGrowComment: boolean;
14393
14450
  allowResizeComment: boolean;
14451
+ commentAreaRows: number;
14394
14452
  state: string;
14395
14453
  isLazyRendering: boolean;
14396
14454
  lazyRenderingFirstBatchSize: number;
@@ -15919,11 +15977,18 @@ declare module "settings" {
15919
15977
  */
15920
15978
  ratingMaximumRateValueCount: number;
15921
15979
  /**
15922
- * Specifies whether to close the drop-down menu of a [TagBox](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.
15980
+ * Specifies whether to close the drop-down menu of a [Multi-Select Dropdown (Tag Box)](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.
15923
15981
  *
15924
- * This setting applies to all TagBox questions on a page. You can use the [closeOnSelect](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual TagBox question.
15982
+ * This setting applies to all Multi-Select Dropdown questions on a web page. You can use the [`closeOnSelect`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual Multi-Select Dropdown question.
15925
15983
  */
15926
15984
  tagboxCloseOnSelect: boolean;
15985
+ /**
15986
+ * A time interval in milliseconds between the last entered character and the beginning of search in [Single-](https://surveyjs.io/form-library/examples/create-dropdown-menu-in-javascript/) and [Multi-Select Dropdown](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) questions. Applies only to questions with the [`choicesLazyLoadEnabled`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#choicesLazyLoadEnabled) property set to `true`.
15987
+ *
15988
+ * Default value: 500
15989
+ *
15990
+ * [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle))
15991
+ */
15927
15992
  dropdownSearchDelay: number;
15928
15993
  /**
15929
15994
  * A function that activates a browser confirm dialog.
@@ -16179,6 +16244,8 @@ declare module "question_matrixdropdown" {
16179
16244
  get rowName(): string;
16180
16245
  get text(): string;
16181
16246
  get locText(): LocalizableString;
16247
+ isRowEnabled(): boolean;
16248
+ protected isRowHasEnabledCondition(): boolean;
16182
16249
  }
16183
16250
  /**
16184
16251
  * A class that describes the Multi-Select Matrix question type. Multi-Select Matrix allows you to use the [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), [Text](https://surveyjs.io/form-library/documentation/questiontextmodel), and [Comment](https://surveyjs.io/form-library/documentation/questioncommentmodel) question types as cell editors.
@@ -16883,6 +16950,7 @@ declare module "question_checkbox" {
16883
16950
  get checkBoxSvgPath(): string;
16884
16951
  get isNewA11yStructure(): boolean;
16885
16952
  get a11y_input_ariaRole(): string;
16953
+ get a11y_input_ariaRequired(): "true" | "false";
16886
16954
  }
16887
16955
  }
16888
16956
  declare module "multiSelectListModel" {
@@ -17213,6 +17281,7 @@ declare module "dragdrop/choices" {
17213
17281
  private imagepickerControlsNode;
17214
17282
  protected get draggedElementType(): string;
17215
17283
  protected createDraggedElementShortcut(text: string, draggedElementNode: HTMLElement, event: PointerEvent): HTMLElement;
17284
+ onShortcutCreated: (node: HTMLElement) => void;
17216
17285
  private createImagePickerShortcut;
17217
17286
  protected getDropTargetByDataAttributeValue(dataAttributeValue: string): ItemValue;
17218
17287
  private getVisibleChoices;
@@ -17241,7 +17310,7 @@ declare module "dragdrop/ranking-choices" {
17241
17310
  protected isDropTargetValid(dropTarget: ItemValue, dropTargetNode?: HTMLElement): boolean;
17242
17311
  protected calculateIsBottom(clientY: number, dropTargetNode?: HTMLElement): boolean;
17243
17312
  protected doDragOver: () => any;
17244
- getIndixies(model: any, fromChoicesArray: Array<ItemValue>, toChoicesArray: Array<ItemValue>): {
17313
+ getIndices(model: any, fromChoicesArray: Array<ItemValue>, toChoicesArray: Array<ItemValue>): {
17245
17314
  fromIndex: number;
17246
17315
  toIndex: number;
17247
17316
  };
@@ -17332,7 +17401,7 @@ declare module "question_ranking" {
17332
17401
  endLoadingFromJson(): void;
17333
17402
  private setDragDropRankingChoices;
17334
17403
  protected createDragDropRankingChoices(): DragDropRankingChoices;
17335
- private draggedChoise;
17404
+ private draggedChoiceValue;
17336
17405
  private draggedTargetNode;
17337
17406
  handlePointerDown: (event: PointerEvent, choice: ItemValue, node: HTMLElement) => void;
17338
17407
  startDrag: (event: PointerEvent) => void;
@@ -17366,9 +17435,6 @@ declare module "question_ranking" {
17366
17435
  */
17367
17436
  get longTap(): boolean;
17368
17437
  set longTap(val: boolean);
17369
- /**
17370
- * The name of a component used to render items.
17371
- */
17372
17438
  protected getDefaultItemComponent(): string;
17373
17439
  /**
17374
17440
  * Specifies whether users can select choices they want to rank.
@@ -17786,9 +17852,14 @@ declare module "question_rating" {
17786
17852
  getItemClassByText(item: ItemValue, text: string): string;
17787
17853
  private getRenderedItemColor;
17788
17854
  getItemStyle(item: ItemValue, highlight?: "none" | "highlighted" | "unhighlighted"): {
17789
- borderColor: string;
17790
- fill: string;
17791
- backgroundColor: string;
17855
+ "--sd-rating-item-color"?: undefined;
17856
+ "--sd-rating-item-color-light"?: undefined;
17857
+ } | {
17858
+ "--sd-rating-item-color": string;
17859
+ "--sd-rating-item-color-light": string;
17860
+ } | {
17861
+ "--sd-rating-item-color": string;
17862
+ "--sd-rating-item-color-light"?: undefined;
17792
17863
  };
17793
17864
  getItemClass(item: ItemValue, highlight?: "none" | "highlighted" | "unhighlighted"): string;
17794
17865
  getControlClass(): string;