survey-react-ui 1.8.78 → 1.9.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "1.8.78",
3
+ "version": "1.9.2",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -26,7 +26,7 @@
26
26
  "typings": "survey-react-ui.d.ts",
27
27
  "dependencies": {
28
28
  "survey-core": "*",
29
- "react": "^17.0.1",
30
- "react-dom": "^17.0.1"
29
+ "react": "^16.5.0 || ^17.0.1",
30
+ "react-dom": "^16.5.0 || ^17.0.1"
31
31
  }
32
32
  }
@@ -1,4 +1,4 @@
1
- /*Type definitions for Survey JavaScript library v1.8.78
1
+ /*Type definitions for Survey JavaScript library v1.9.2
2
2
  Copyright (c) 2015-2021 Devsoft Baltic OÜ - http://surveyjs.io/
3
3
  Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
4
4
  */
@@ -168,6 +168,7 @@ export declare class SurveyPanel extends SurveyPanelBase {
168
168
  constructor(props: any);
169
169
  get panel(): PanelModel;
170
170
  protected renderElement(): JSX.Element;
171
+ protected renderHeader(): JSX.Element;
171
172
  protected wrapElement(element: JSX.Element): JSX.Element;
172
173
  protected renderContent(style: any, rows: JSX.Element[], className: string): JSX.Element;
173
174
  protected renderTitle(): JSX.Element;
@@ -223,24 +224,31 @@ export declare class SurveyElementErrors extends ReactSurveyElement {
223
224
  componentWillUnmount(): void;
224
225
  protected renderElement(): JSX.Element;
225
226
  }
226
- export declare class SurveyQuestionAndErrorsCell extends ReactSurveyElement {
227
+ export declare abstract class SurveyQuestionAndErrorsWrapped extends ReactSurveyElement {
227
228
  [index: string]: any;
228
- protected cellRef: React.RefObject<HTMLTableCellElement>;
229
229
  constructor(props: any);
230
230
  protected getStateElement(): Base;
231
- protected get itemCss(): string;
232
231
  protected get question(): Question;
233
232
  protected get creator(): ISurveyCreator;
234
233
  protected getQuestion(): Question;
234
+ protected get itemCss(): string;
235
235
  componentDidMount(): void;
236
- componentWillUnmount(): void;
237
236
  componentDidUpdate(prevProps: any, prevState: any): void;
238
237
  protected doAfterRender(): void;
239
238
  protected canRender(): boolean;
240
- protected renderElement(): JSX.Element;
239
+ protected renderErrors(errorsLocation: string): JSX.Element;
240
+ protected renderContent(): JSX.Element;
241
+ protected abstract renderElement(): JSX.Element;
241
242
  protected getShowErrors(): boolean;
242
- protected getCellStyle(): any;
243
243
  protected renderQuestion(): JSX.Element;
244
+ }
245
+ export declare class SurveyQuestionAndErrorsCell extends SurveyQuestionAndErrorsWrapped {
246
+ [index: string]: any;
247
+ protected cellRef: React.RefObject<HTMLTableCellElement>;
248
+ constructor(props: any);
249
+ componentWillUnmount(): void;
250
+ protected renderElement(): JSX.Element;
251
+ protected getCellStyle(): any;
244
252
  protected getHeaderText(): string;
245
253
  protected wrapCell(cell: QuestionMatrixDropdownRenderedCell, element: JSX.Element): JSX.Element;
246
254
  }
@@ -391,6 +399,7 @@ export declare class SurveyQuestionFile extends SurveyQuestionElementBase {
391
399
  protected renderElement(): JSX.Element;
392
400
  protected renderFileDecorator(): JSX.Element;
393
401
  protected renderClearButton(className: string): JSX.Element;
402
+ protected renderFileSign(className: string, val: any): JSX.Element;
394
403
  protected renderPreview(): JSX.Element;
395
404
  }
396
405
 
@@ -398,8 +407,12 @@ export declare class SurveyQuestionMultipleText extends SurveyQuestionElementBas
398
407
  constructor(props: any);
399
408
  protected get question(): QuestionMultipleTextModel;
400
409
  protected renderElement(): JSX.Element;
410
+ protected renderItemTooltipError(item: MultipleTextItemModel, cssClasses: any): JSX.Element;
401
411
  protected renderRow(rowIndex: number, items: Array<MultipleTextItemModel>, cssClasses: any): JSX.Element;
402
412
  }
413
+ export declare class SurveyMultipleTextItemEditor extends SurveyQuestionAndErrorsWrapped {
414
+ protected renderElement(): JSX.Element;
415
+ }
403
416
 
404
417
  export declare class SurveyQuestionRadiogroup extends SurveyQuestionElementBase {
405
418
  constructor(props: any);
@@ -426,6 +439,7 @@ export declare class SurveyQuestionRadioItem extends ReactSurveyElement {
426
439
 
427
440
  export declare class SurveyQuestionText extends SurveyQuestionUncontrolledElement<QuestionTextModel> {
428
441
  constructor(props: any);
442
+ protected renderInput(): JSX.Element;
429
443
  protected renderElement(): JSX.Element;
430
444
  }
431
445
 
@@ -502,8 +516,8 @@ export declare class SurveyQuestionPanelDynamic extends SurveyQuestionElementBas
502
516
  handleOnRangeChange(event: any): void;
503
517
  protected renderElement(): JSX.Element;
504
518
  protected renderNavigator(): JSX.Element;
505
- protected rendrerPrevButton(viewBox?: string, icon?: JSX.Element): JSX.Element;
506
- protected rendrerNextButton(viewBox?: string, icon?: JSX.Element): JSX.Element;
519
+ protected rendrerPrevButton(): JSX.Element;
520
+ protected rendrerNextButton(): JSX.Element;
507
521
  protected renderRange(): JSX.Element;
508
522
  protected renderAddRowButton(): JSX.Element;
509
523
  protected renderNavigatorV2(): JSX.Element;
@@ -800,6 +814,7 @@ interface IDimensions {
800
814
  export declare class ResponsivityManager {
801
815
  protected container: HTMLDivElement;
802
816
  protected minDimensionConst: number;
817
+ protected recalcMinDimensionConst: boolean;
803
818
  getComputedStyle: (elt: Element) => CSSStyleDeclaration;
804
819
  constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number);
805
820
  protected getDimensions(element: HTMLElement): IDimensions;
@@ -825,7 +840,7 @@ declare function isElementVisible(element: HTMLElement, threshold?: number): boo
825
840
  declare function findScrollableParent(element: HTMLElement): HTMLElement;
826
841
  declare function scrollElementByChildId(id: string): void;
827
842
  declare function getIconNameFromProxy(iconName: string): string;
828
- declare function createSvg(size: number, width: number, height: number, iconName: string, svgElem: any): void;
843
+ declare function createSvg(size: number | string, width: number, height: number, iconName: string, svgElem: any): void;
829
844
  export declare function unwrap<T>(value: T | (() => T)): T;
830
845
  export declare function getSize(value: any): any;
831
846
  declare function doKey2ClickUp(evt: KeyboardEvent, options?: {
@@ -917,6 +932,7 @@ export declare class QuestionCheckboxModel extends QuestionCheckboxBase {
917
932
  protected onEnableItemCallBack(item: ItemValue): boolean;
918
933
  protected onAfterRunItemsEnableCondition(): void;
919
934
  protected getItemClassCore(item: any, options: any): string;
935
+ updateValueFromSurvey(newValue: any): void;
920
936
  protected setNewValue(newValue: any): void;
921
937
  protected getIsMultipleValue(): boolean;
922
938
  protected getCommentFromValue(newValue: any): string;
@@ -940,7 +956,6 @@ export declare class QuestionCheckboxModel extends QuestionCheckboxBase {
940
956
  protected renderedValueFromDataCore(val: any): any;
941
957
  protected rendredValueToDataCore(val: any): any;
942
958
  get checkBoxSvgPath(): string;
943
- getItemId(item: ItemValue): string;
944
959
  }
945
960
 
946
961
  export declare class Bindings {
@@ -1095,6 +1110,7 @@ export declare class Base {
1095
1110
  * @param val new property value
1096
1111
  */
1097
1112
  setPropertyValue(name: string, val: any): void;
1113
+ protected setArrayPropertyDirectly(name: string, val: any, sendNotification?: boolean): void;
1098
1114
  protected setPropertyValueDirectly(name: string, val: any): void;
1099
1115
  protected clearPropertyValue(name: string): void;
1100
1116
  onPropertyValueChangedCallback(name: string, oldValue: any, newValue: any, sender: Base, arrayChanges: ArrayChanges): void;
@@ -1129,7 +1145,7 @@ export declare class Base {
1129
1145
  */
1130
1146
  unRegisterFunctionOnPropertiesValueChanged(names: Array<string>, key?: string): void;
1131
1147
  createCustomLocalizableObj(name: string): void;
1132
- protected createLocalizableString(name: string, owner: ILocalizableOwner, useMarkDown?: boolean, hasDefaultValue?: boolean): LocalizableString;
1148
+ protected createLocalizableString(name: string, owner: ILocalizableOwner, useMarkDown?: boolean, defaultStr?: boolean | string): LocalizableString;
1133
1149
  getLocalizableString(name: string): LocalizableString;
1134
1150
  getLocalizableStringText(name: string, defaultStr?: string): string;
1135
1151
  setLocalizableStringText(name: string, value: string): void;
@@ -1393,9 +1409,7 @@ export declare class QuestionSelectBase extends Question {
1393
1409
  /**
1394
1410
  * Use this property to set the place holder text for other or comment field .
1395
1411
  */
1396
- get otherPlaceHolder(): string;
1397
- set otherPlaceHolder(val: string);
1398
- get locOtherPlaceHolder(): LocalizableString;
1412
+ otherPlaceHolder: string;
1399
1413
  /**
1400
1414
  * The text that shows when the other item is choosed by the other input is empty.
1401
1415
  */
@@ -1484,6 +1498,13 @@ export declare class QuestionSelectBase extends Question {
1484
1498
  choicesLoaded(): void;
1485
1499
  getItemValueWrapperComponentName(item: ItemValue): string;
1486
1500
  getItemValueWrapperComponentData(item: ItemValue): any;
1501
+ ariaItemChecked(item: ItemValue): "true" | "false";
1502
+ isOtherItem(item: ItemValue): boolean;
1503
+ get itemSvgIcon(): string;
1504
+ ariaItemLabel(item: ItemValue): string;
1505
+ getItemId(item: ItemValue): string;
1506
+ get questionName(): string;
1507
+ getItemEnabled(item: ItemValue): any;
1487
1508
  }
1488
1509
  /**
1489
1510
  * A base class for checkbox and radiogroup questions. It introduced a colCount property.
@@ -1499,8 +1520,6 @@ export declare class QuestionCheckboxBase extends QuestionSelectBase {
1499
1520
  protected onParentChanged(): void;
1500
1521
  protected onParentQuestionChanged(): void;
1501
1522
  protected getSearchableItemValueKeys(keys: Array<string>): void;
1502
- getItemEnabled(item: ItemValue): any;
1503
- isOtherItem(item: ItemValue): boolean;
1504
1523
  }
1505
1524
 
1506
1525
  export interface ILocalizableOwner {
@@ -1850,6 +1869,7 @@ export interface ISurvey extends ITextProcessor, ISurveyErrorOwner {
1850
1869
  requiredText: string;
1851
1870
  beforeSettingQuestionErrors(question: IQuestion, errors: Array<SurveyError>): void;
1852
1871
  beforeSettingPanelErrors(question: IPanel, errors: Array<SurveyError>): void;
1872
+ getSurveyErrorCustomText(obj: Base, text: string, error: SurveyError): string;
1853
1873
  getElementTitleTagName(element: Base, tagName: string): string;
1854
1874
  questionTitlePattern: string;
1855
1875
  getUpdatedQuestionTitle(question: IQuestion, title: string): string;
@@ -2183,6 +2203,7 @@ export interface IAction {
2183
2203
  * Set this property to true to activate the toolbar item (page)
2184
2204
  */
2185
2205
  active?: boolean;
2206
+ pressed?: boolean;
2186
2207
  /**
2187
2208
  * Toolbar item template name
2188
2209
  */
@@ -2246,6 +2267,7 @@ export declare class Action extends Base implements IAction {
2246
2267
  popupModel: any;
2247
2268
  needSeparator: boolean;
2248
2269
  active: boolean;
2270
+ pressed: boolean;
2249
2271
  template: string;
2250
2272
  component: string;
2251
2273
  items: any;
@@ -2326,8 +2348,6 @@ export declare class Question extends SurveyElement implements IQuestion, ICondi
2326
2348
  */
2327
2349
  onReadyChanged: EventBase<Question>;
2328
2350
  isReadOnlyRenderDiv(): boolean;
2329
- get isErrorsModeTooltip(): boolean;
2330
- get hasParent(): boolean;
2331
2351
  constructor(name: string);
2332
2352
  protected createLocTitleProperty(): LocalizableString;
2333
2353
  getSurvey(live?: boolean): ISurvey;
@@ -2348,9 +2368,9 @@ export declare class Question extends SurveyElement implements IQuestion, ICondi
2348
2368
  /**
2349
2369
  * A11Y properties
2350
2370
  */
2351
- get ariaRequired(): boolean;
2371
+ get ariaRequired(): "true" | "false";
2352
2372
  get ariaLabel(): string;
2353
- get ariaInvalid(): boolean;
2373
+ get ariaInvalid(): "true" | "false";
2354
2374
  get ariaDescribedBy(): string;
2355
2375
  /**
2356
2376
  * Get is question ready to use
@@ -2577,6 +2597,7 @@ export declare class Question extends SurveyElement implements IQuestion, ICondi
2577
2597
  */
2578
2598
  get renderWidth(): string;
2579
2599
  set renderWidth(val: string);
2600
+ get renderCssRoot(): string;
2580
2601
  /**
2581
2602
  * Set it different from 0 to increase the left padding.
2582
2603
  */
@@ -2643,6 +2664,8 @@ export declare class Question extends SurveyElement implements IQuestion, ICondi
2643
2664
  */
2644
2665
  get isReadOnly(): boolean;
2645
2666
  get isInputReadOnly(): boolean;
2667
+ get renderedInputReadOnly(): string;
2668
+ get renderedInputDisabled(): string;
2646
2669
  protected onReadOnlyChanged(): void;
2647
2670
  /**
2648
2671
  * An expression that returns true or false. If it returns false the Question becomes read only and an end-user will not able to answer on the qustion. The library runs the expression on survey start and on changing a question value. If the property is empty then readOnly property is used.
@@ -2711,6 +2734,7 @@ export declare class Question extends SurveyElement implements IQuestion, ICondi
2711
2734
  set defaultValue(val: any);
2712
2735
  get defaultValueExpression(): any;
2713
2736
  set defaultValueExpression(val: any);
2737
+ get resizeStyle(): "none" | "both";
2714
2738
  /**
2715
2739
  * Returns question answer data as a plain object: with question title, name, value and displayValue.
2716
2740
  * For complex questions (like matrix, etc.) isNode flag is set to true and data contains array of nested objects (rows)
@@ -3005,6 +3029,7 @@ export interface IMatrixDropdownData {
3005
3029
  getRenderer(name: string): string;
3006
3030
  getRendererContext(locStr: LocalizableString): any;
3007
3031
  getProcessedText(text: string): string;
3032
+ getParentTextProcessor(): ITextProcessor;
3008
3033
  getSharedQuestionByName(columnName: string, row: MatrixDropdownRowModelBase): Question;
3009
3034
  onTotalValueChanged(): any;
3010
3035
  getSurvey(): ISurvey;
@@ -3318,9 +3343,11 @@ export declare class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseM
3318
3343
  setIsDetailPanelShowing(row: MatrixDropdownRowModelBase, val: boolean): void;
3319
3344
  getDetailPanelButtonCss(row: MatrixDropdownRowModelBase): string;
3320
3345
  getDetailPanelIconCss(row: MatrixDropdownRowModelBase): string;
3346
+ getDetailPanelIconId(row: MatrixDropdownRowModelBase): string;
3321
3347
  createRowDetailPanel(row: MatrixDropdownRowModelBase): PanelModel;
3322
3348
  getSharedQuestionByName(columnName: string, row: MatrixDropdownRowModelBase): Question;
3323
3349
  onTotalValueChanged(): any;
3350
+ getParentTextProcessor(): ITextProcessor;
3324
3351
  getQuestionFromArray(name: string, index: number): IQuestion;
3325
3352
  getCellTemplateData(cell: QuestionMatrixDropdownRenderedCell): any;
3326
3353
  getCellWrapperComponentName(cell: MatrixDropdownCell): string;
@@ -3351,6 +3378,10 @@ export declare class PopupUtils {
3351
3378
  height: number;
3352
3379
  top: number;
3353
3380
  };
3381
+ static updateHorizontalDimensions(left: number, width: number, windowWidth: number, horizontalPosition: HorizontalPosition): {
3382
+ width: number;
3383
+ left: number;
3384
+ };
3354
3385
  static updateVerticalPosition(targetRect: ClientRect, height: number, verticalPosition: VerticalPosition, showPointer: boolean, windowHeight: number): VerticalPosition;
3355
3386
  static calculatePopupDirection(verticalPosition: VerticalPosition, horizontalPosition: HorizontalPosition): string;
3356
3387
  static calculatePointerTarget(targetRect: ClientRect, top: number, left: number, verticalPosition: VerticalPosition, horizontalPosition: HorizontalPosition): INumberPosition;
@@ -3508,6 +3539,7 @@ export declare class SurveyElement extends SurveyElementCore implements ISurveyE
3508
3539
  protected updateElementCssCore(cssClasses: any): void;
3509
3540
  get cssError(): string;
3510
3541
  updateElementCss(reNew?: boolean): void;
3542
+ protected clearCssClasses(): void;
3511
3543
  protected getIsLoadingFromJson(): boolean;
3512
3544
  /**
3513
3545
  * This is the identifier of a survey element - question or panel.
@@ -3574,6 +3606,10 @@ export declare class SurveyElement extends SurveyElementCore implements ISurveyE
3574
3606
  protected moveToBase(parent: IPanel, container: IPanel, insertBefore?: any): boolean;
3575
3607
  protected setPage(parent: IPanel, newPage: IPage): void;
3576
3608
  protected getSearchableLocKeys(keys: Array<string>): void;
3609
+ protected get isDefaultV2Theme(): boolean;
3610
+ get isErrorsModeTooltip(): boolean;
3611
+ get hasParent(): boolean;
3612
+ protected get hasFrameV2(): boolean;
3577
3613
  }
3578
3614
 
3579
3615
  export declare class ValidatorResult {
@@ -3732,7 +3768,6 @@ export declare class TextPreProcessorValue {
3732
3768
  }
3733
3769
  export declare class TextPreProcessor {
3734
3770
  onProcess: (textValue: TextPreProcessorValue) => void;
3735
- constructor();
3736
3771
  process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean): string;
3737
3772
  processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
3738
3773
  get hasAllValuesOnLastRun(): boolean;
@@ -3745,6 +3780,7 @@ export declare class QuestionTextProcessor implements ITextProcessor {
3745
3780
  protected get panel(): PanelModel;
3746
3781
  protected getValues(): any;
3747
3782
  protected getQuestionByName(name: string): Question;
3783
+ protected getParentTextProcessor(): ITextProcessor;
3748
3784
  protected onCustomProcessText(textValue: TextPreProcessorValue): boolean;
3749
3785
  processText(text: string, returnDisplayValue: boolean): string;
3750
3786
  processTextEx(text: string, returnDisplayValue: boolean): any;
@@ -3805,6 +3841,8 @@ export declare class QuestionMatrixBaseModel<TRow, TColumn> extends Question {
3805
3841
  constructor(name: string);
3806
3842
  getType(): string;
3807
3843
  get isCompositeQuestion(): boolean;
3844
+ get showColumnHeader(): boolean;
3845
+ set showColumnHeader(val: boolean);
3808
3846
  /**
3809
3847
  * Set this property to false, to hide table header. The default value is true.
3810
3848
  */
@@ -3898,6 +3936,7 @@ export declare class PanelModelBase extends SurveyElement implements IPanel, ICo
3898
3936
  setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
3899
3937
  endLoadingFromJson(): void;
3900
3938
  get hasTitle(): boolean;
3939
+ get hasDescription(): boolean;
3901
3940
  protected canShowTitle(): boolean;
3902
3941
  get _showDescription(): boolean;
3903
3942
  localeChanged(): void;
@@ -4069,6 +4108,7 @@ export declare class PanelModelBase extends SurveyElement implements IPanel, ICo
4069
4108
  protected createRow(): QuestionRowModel;
4070
4109
  onSurveyLoad(): void;
4071
4110
  onFirstRendering(): void;
4111
+ updateRows(): void;
4072
4112
  get rows(): Array<QuestionRowModel>;
4073
4113
  ensureRowsVisibility(): void;
4074
4114
  protected onRowsChanged(): void;
@@ -4306,6 +4346,7 @@ export declare class PanelModel extends PanelModelBase implements IElement {
4306
4346
  protected onVisibleChanged(): void;
4307
4347
  needResponsiveWidth(): boolean;
4308
4348
  focusIn: () => void;
4349
+ getContainerCss(): string;
4309
4350
  }
4310
4351
 
4311
4352
  export interface IMatrixColumnOwner extends ILocalizableOwner {
@@ -4477,6 +4518,7 @@ export declare class QuestionMatrixDropdownRenderedCell {
4477
4518
  set className(val: string);
4478
4519
  get className(): string;
4479
4520
  get headers(): string;
4521
+ getTitle(): string;
4480
4522
  calculateFinalClassName(matrixCssClasses: any): string;
4481
4523
  }
4482
4524
  export declare class QuestionMatrixDropdownRenderedRow extends Base {