survey-react 1.9.130 → 1.9.131

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
@@ -269,130 +269,6 @@ declare module "surveyStrings" {
269
269
  cancel: string;
270
270
  };
271
271
  }
272
- declare module "localizablestring" {
273
- import { EventBase } from "base";
274
- export interface ILocalizableOwner {
275
- getLocale(): string;
276
- getMarkdownHtml(text: string, name: string): string;
277
- getProcessedText(text: string): string;
278
- getRenderer(name: string): string;
279
- getRendererContext(locStr: LocalizableString): any;
280
- }
281
- export interface ILocalizableString {
282
- getLocaleText(loc: string): string;
283
- setLocaleText(loc: string, newValue: string): any;
284
- getJson(): any;
285
- getLocales(): Array<string>;
286
- getIsMultiple(): boolean;
287
- }
288
- /**
289
- * The class represents the string that supports multi-languages and markdown.
290
- * It uses in all objects where support for multi-languages and markdown is required.
291
- */
292
- export class LocalizableString implements ILocalizableString {
293
- owner: ILocalizableOwner;
294
- useMarkdown: boolean;
295
- name?: string;
296
- static SerializeAsObject: boolean;
297
- static get defaultLocale(): string;
298
- static set defaultLocale(val: string);
299
- static defaultRenderer: string;
300
- static editableRenderer: string;
301
- private values;
302
- private htmlValues;
303
- private renderedText;
304
- private calculatedTextValue;
305
- private _localizationName;
306
- get localizationName(): string;
307
- set localizationName(val: string);
308
- onGetTextCallback: (str: string) => string;
309
- storeDefaultText: boolean;
310
- onGetLocalizationTextCallback: (str: string) => string;
311
- onStrChanged: (oldValue: string, newValue: string) => void;
312
- onSearchChanged: () => void;
313
- sharedData: LocalizableString;
314
- searchText: string;
315
- searchIndex: number;
316
- disableLocalization: boolean;
317
- defaultValue: string;
318
- constructor(owner: ILocalizableOwner, useMarkdown?: boolean, name?: string);
319
- getIsMultiple(): boolean;
320
- get locale(): string;
321
- strChanged(): void;
322
- get text(): string;
323
- set text(value: string);
324
- get calculatedText(): string;
325
- private calcText;
326
- get pureText(): string;
327
- private getRootDialect;
328
- private getLocalizationName;
329
- private getLocalizationStr;
330
- get hasHtml(): boolean;
331
- get html(): string;
332
- get isEmpty(): boolean;
333
- get textOrHtml(): string;
334
- get renderedHtml(): string;
335
- getLocaleText(loc: string): string;
336
- private getLocaleTextCore;
337
- private isLocaleTextEqualsWithDefault;
338
- clear(): void;
339
- clearLocale(loc?: string): void;
340
- setLocaleText(loc: string, value: string): void;
341
- private isValueEmpty;
342
- private get curLocale();
343
- private canRemoveLocValue;
344
- private fireStrChanged;
345
- hasNonDefaultText(): boolean;
346
- getLocales(): Array<string>;
347
- getJson(): any;
348
- setJson(value: any): void;
349
- get renderAs(): string;
350
- get renderAsData(): any;
351
- equals(obj: any): boolean;
352
- private searchableText;
353
- setFindText(text: string): boolean;
354
- onChanged(): void;
355
- onStringChanged: EventBase<LocalizableString>;
356
- protected onCreating(): void;
357
- private hasHtmlValue;
358
- private setHtmlValue;
359
- getHtmlValue(): string;
360
- private deleteValuesEqualsToDefault;
361
- private getValue;
362
- private setValue;
363
- private deleteValue;
364
- private getValueLoc;
365
- private getValuesKeys;
366
- private get defaultLoc();
367
- }
368
- /**
369
- * The class represents the list of strings that supports multi-languages.
370
- */
371
- export class LocalizableStrings implements ILocalizableString {
372
- owner: ILocalizableOwner;
373
- private values;
374
- onValueChanged: (oldValue: any, newValue: any) => void;
375
- constructor(owner: ILocalizableOwner);
376
- getIsMultiple(): boolean;
377
- get locale(): string;
378
- get value(): Array<string>;
379
- set value(val: Array<string>);
380
- get text(): string;
381
- set text(val: string);
382
- getLocaleText(loc: string): string;
383
- setLocaleText(loc: string, newValue: string): any;
384
- getValue(loc: string): Array<string>;
385
- private getValueCore;
386
- setValue(loc: string, val: Array<string>): void;
387
- hasValue(loc?: string): boolean;
388
- get isEmpty(): boolean;
389
- private getLocale;
390
- getLocales(): Array<string>;
391
- getJson(): any;
392
- setJson(value: any): void;
393
- private getValuesKeys;
394
- }
395
- }
396
272
  declare module "conditionProcessValue" {
397
273
  import { HashTable } from "helpers";
398
274
  export class ProcessValue {
@@ -849,7 +725,7 @@ declare module "utils/utils" {
849
725
  function isContainerVisible(el: HTMLElement): boolean;
850
726
  function getFirstVisibleChild(el: HTMLElement): any;
851
727
  function findParentByClassNames(element: HTMLElement, classNames: Array<string>): Element;
852
- export function sanitizeEditableContent(element: any): void;
728
+ export function sanitizeEditableContent(element: any, cleanLineBreaks?: boolean): void;
853
729
  function mergeValues(src: any, dest: any): void;
854
730
  export class Logger {
855
731
  private _result;
@@ -12005,6 +11881,7 @@ declare module "questionCustomWidgets" {
12005
11881
  afterRender(question: IQuestion, el: any): void;
12006
11882
  willUnmount(question: IQuestion, el: any): void;
12007
11883
  getDisplayValue(question: IQuestion, value?: any): string;
11884
+ validate(question: IQuestion): string;
12008
11885
  isFit(question: IQuestion): boolean;
12009
11886
  get canShowInToolbox(): boolean;
12010
11887
  get showInToolbox(): boolean;
@@ -12827,6 +12704,7 @@ declare module "question" {
12827
12704
  */
12828
12705
  get requiredText(): string;
12829
12706
  addError(error: SurveyError | string): void;
12707
+ private addCustomError;
12830
12708
  removeError(error: SurveyError): void;
12831
12709
  private checkForErrors;
12832
12710
  protected canCollectErrors(): boolean;
@@ -14025,6 +13903,52 @@ declare module "jsonobject" {
14025
13903
  export interface IObject {
14026
13904
  [key: string]: any;
14027
13905
  }
13906
+ export interface IJsonPropertyInfo {
13907
+ name: string;
13908
+ type?: string;
13909
+ className?: string;
13910
+ classNamePart?: string;
13911
+ baseClassName?: string;
13912
+ isRequired?: boolean;
13913
+ isUnique?: boolean;
13914
+ uniqueProperty?: string;
13915
+ choices?: any;
13916
+ visible?: boolean;
13917
+ alternativeName?: string;
13918
+ oldName?: string;
13919
+ version?: string;
13920
+ dataList?: Array<string>;
13921
+ isLocalizable?: boolean;
13922
+ isSerializable?: boolean;
13923
+ isLightSerializable?: boolean;
13924
+ readOnly?: boolean;
13925
+ serializationProperty?: string;
13926
+ dependsOn?: Array<string> | string;
13927
+ isBindable?: boolean;
13928
+ isArray?: boolean;
13929
+ layout?: string;
13930
+ default?: any;
13931
+ defaultFunc?: (obj: Base) => any;
13932
+ baseValue?: any;
13933
+ onSerializeValue?: (obj: any) => any;
13934
+ onGetValue?: (obj: any) => any;
13935
+ onSettingValue?: (obj: any, value: any) => any;
13936
+ onSetValue?: (obj: any, value: any, jsonConv: JsonObject) => any;
13937
+ visibleIf?: (obj: any) => boolean;
13938
+ enableIf?: (obj: any) => boolean;
13939
+ onExecuteExpression?: (obj: any, res: any) => any;
13940
+ onPropertyEditorUpdate?: (obj: any, propEditor: any) => any;
13941
+ displayName?: string;
13942
+ category?: string;
13943
+ categoryIndex?: number;
13944
+ visibleIndex?: number;
13945
+ nextToProperty?: string;
13946
+ overridingProperty?: string;
13947
+ showMode?: string;
13948
+ maxLength?: number;
13949
+ maxValue?: any;
13950
+ minValue?: any;
13951
+ }
14028
13952
  /**
14029
13953
  * Contains information about a property of a survey element (page, panel, questions, and etc).
14030
13954
  * @see addProperty
@@ -14032,7 +13956,7 @@ declare module "jsonobject" {
14032
13956
  * @see [Add Properties](https://surveyjs.io/Documentation/Survey-Creator#addproperties)
14033
13957
  * @see [Remove Properties](https://surveyjs.io/Documentation/Survey-Creator#removeproperties)
14034
13958
  */
14035
- export class JsonObjectProperty implements IObject {
13959
+ export class JsonObjectProperty implements IObject, IJsonPropertyInfo {
14036
13960
  name: string;
14037
13961
  static getItemValuesDefaultValue: (val: any, type: string) => any;
14038
13962
  [key: string]: any;
@@ -14042,7 +13966,7 @@ declare module "jsonobject" {
14042
13966
  private classInfoValue;
14043
13967
  private typeValue;
14044
13968
  private choicesValue;
14045
- private baseValue;
13969
+ baseValue: any;
14046
13970
  private isRequiredValue;
14047
13971
  private isUniqueValue;
14048
13972
  private uniquePropertyValue;
@@ -14086,6 +14010,10 @@ declare module "jsonobject" {
14086
14010
  onExecuteExpression: (obj: any, res: any) => any;
14087
14011
  onPropertyEditorUpdate: (obj: any, propEditor: any) => any;
14088
14012
  constructor(classInfo: JsonMetadataClass, name: string, isRequired?: boolean);
14013
+ uniqueProperty?: string;
14014
+ dependsOn?: string | string[];
14015
+ default?: any;
14016
+ defaultFunc?: (obj: Base) => any;
14089
14017
  get id(): number;
14090
14018
  get classInfo(): JsonMetadataClass;
14091
14019
  get type(): string;
@@ -14199,7 +14127,7 @@ declare module "jsonobject" {
14199
14127
  private getObjPropertyValueCore;
14200
14128
  private isObjWrapper;
14201
14129
  private isNeedUseObjWrapper;
14202
- addClass(name: string, properties: Array<any>, creator?: (json?: any) => any, parentName?: string): JsonMetadataClass;
14130
+ addClass(name: string, properties: Array<IJsonPropertyInfo | string>, creator?: (json?: any) => any, parentName?: string): JsonMetadataClass;
14203
14131
  removeClass(name: string): void;
14204
14132
  overrideClassCreatore(name: string, creator: () => any): void;
14205
14133
  overrideClassCreator(name: string, creator: () => any): void;
@@ -14220,8 +14148,8 @@ declare module "jsonobject" {
14220
14148
  private createCustomType;
14221
14149
  getChildrenClasses(name: string, canBeCreated?: boolean): Array<JsonMetadataClass>;
14222
14150
  getRequiredProperties(name: string): Array<string>;
14223
- addProperties(className: string, propertiesInfos: Array<any>): void;
14224
- addProperty(className: string, propertyInfo: any): JsonObjectProperty;
14151
+ addProperties(className: string, propertiesInfos: Array<IJsonPropertyInfo | string>): void;
14152
+ addProperty(className: string, propertyInfo: IJsonPropertyInfo | string): JsonObjectProperty;
14225
14153
  private addCustomPropertyCore;
14226
14154
  removeProperty(className: string, propertyName: string): boolean;
14227
14155
  private clearDynamicPropsCache;
@@ -14322,6 +14250,132 @@ declare module "jsonobject" {
14322
14250
  */
14323
14251
  export var Serializer: JsonMetadata;
14324
14252
  }
14253
+ declare module "localizablestring" {
14254
+ import { EventBase } from "base";
14255
+ export interface ILocalizableOwner {
14256
+ getLocale(): string;
14257
+ getMarkdownHtml(text: string, name: string): string;
14258
+ getProcessedText(text: string): string;
14259
+ getRenderer(name: string): string;
14260
+ getRendererContext(locStr: LocalizableString): any;
14261
+ }
14262
+ export interface ILocalizableString {
14263
+ getLocaleText(loc: string): string;
14264
+ setLocaleText(loc: string, newValue: string): any;
14265
+ getJson(): any;
14266
+ getLocales(): Array<string>;
14267
+ getIsMultiple(): boolean;
14268
+ }
14269
+ /**
14270
+ * The class represents the string that supports multi-languages and markdown.
14271
+ * It uses in all objects where support for multi-languages and markdown is required.
14272
+ */
14273
+ export class LocalizableString implements ILocalizableString {
14274
+ owner: ILocalizableOwner;
14275
+ useMarkdown: boolean;
14276
+ name?: string;
14277
+ static SerializeAsObject: boolean;
14278
+ static get defaultLocale(): string;
14279
+ static set defaultLocale(val: string);
14280
+ static defaultRenderer: string;
14281
+ static editableRenderer: string;
14282
+ private values;
14283
+ private htmlValues;
14284
+ private renderedText;
14285
+ private calculatedTextValue;
14286
+ private _localizationName;
14287
+ get localizationName(): string;
14288
+ set localizationName(val: string);
14289
+ private _allowLineBreaks;
14290
+ get allowLineBreaks(): boolean;
14291
+ onGetTextCallback: (str: string) => string;
14292
+ storeDefaultText: boolean;
14293
+ onGetLocalizationTextCallback: (str: string) => string;
14294
+ onStrChanged: (oldValue: string, newValue: string) => void;
14295
+ onSearchChanged: () => void;
14296
+ sharedData: LocalizableString;
14297
+ searchText: string;
14298
+ searchIndex: number;
14299
+ disableLocalization: boolean;
14300
+ defaultValue: string;
14301
+ constructor(owner: ILocalizableOwner, useMarkdown?: boolean, name?: string);
14302
+ getIsMultiple(): boolean;
14303
+ get locale(): string;
14304
+ strChanged(): void;
14305
+ get text(): string;
14306
+ set text(value: string);
14307
+ get calculatedText(): string;
14308
+ private calcText;
14309
+ get pureText(): string;
14310
+ private getRootDialect;
14311
+ private getLocalizationName;
14312
+ private getLocalizationStr;
14313
+ get hasHtml(): boolean;
14314
+ get html(): string;
14315
+ get isEmpty(): boolean;
14316
+ get textOrHtml(): string;
14317
+ get renderedHtml(): string;
14318
+ getLocaleText(loc: string): string;
14319
+ private getLocaleTextCore;
14320
+ private isLocaleTextEqualsWithDefault;
14321
+ clear(): void;
14322
+ clearLocale(loc?: string): void;
14323
+ setLocaleText(loc: string, value: string): void;
14324
+ private isValueEmpty;
14325
+ private get curLocale();
14326
+ private canRemoveLocValue;
14327
+ private fireStrChanged;
14328
+ hasNonDefaultText(): boolean;
14329
+ getLocales(): Array<string>;
14330
+ getJson(): any;
14331
+ setJson(value: any): void;
14332
+ get renderAs(): string;
14333
+ get renderAsData(): any;
14334
+ equals(obj: any): boolean;
14335
+ private searchableText;
14336
+ setFindText(text: string): boolean;
14337
+ onChanged(): void;
14338
+ onStringChanged: EventBase<LocalizableString>;
14339
+ protected onCreating(): void;
14340
+ private hasHtmlValue;
14341
+ private setHtmlValue;
14342
+ getHtmlValue(): string;
14343
+ private deleteValuesEqualsToDefault;
14344
+ private getValue;
14345
+ private setValue;
14346
+ private deleteValue;
14347
+ private getValueLoc;
14348
+ private getValuesKeys;
14349
+ private get defaultLoc();
14350
+ }
14351
+ /**
14352
+ * The class represents the list of strings that supports multi-languages.
14353
+ */
14354
+ export class LocalizableStrings implements ILocalizableString {
14355
+ owner: ILocalizableOwner;
14356
+ private values;
14357
+ onValueChanged: (oldValue: any, newValue: any) => void;
14358
+ constructor(owner: ILocalizableOwner);
14359
+ getIsMultiple(): boolean;
14360
+ get locale(): string;
14361
+ get value(): Array<string>;
14362
+ set value(val: Array<string>);
14363
+ get text(): string;
14364
+ set text(val: string);
14365
+ getLocaleText(loc: string): string;
14366
+ setLocaleText(loc: string, newValue: string): any;
14367
+ getValue(loc: string): Array<string>;
14368
+ private getValueCore;
14369
+ setValue(loc: string, val: Array<string>): void;
14370
+ hasValue(loc?: string): boolean;
14371
+ get isEmpty(): boolean;
14372
+ private getLocale;
14373
+ getLocales(): Array<string>;
14374
+ getJson(): any;
14375
+ setJson(value: any): void;
14376
+ private getValuesKeys;
14377
+ }
14378
+ }
14325
14379
  declare module "base" {
14326
14380
  import { ILocalizableOwner, LocalizableString } from "localizablestring";
14327
14381
  import { HashTable } from "helpers";
@@ -15376,6 +15430,7 @@ declare module "dropdownListModel" {
15376
15430
  protected popupRecalculatePosition(isResetHeight: boolean): void;
15377
15431
  protected onHidePopup(): void;
15378
15432
  protected getAvailableItems(): Array<ItemValue>;
15433
+ protected setOnTextSearchCallbackForListModel(listModel: ListModel<ItemValue>): void;
15379
15434
  protected createListModel(): ListModel<ItemValue>;
15380
15435
  protected updateAfterListModelCreated(model: ListModel<ItemValue>): void;
15381
15436
  updateCssClasses(popupCssClass: string, listCssClasses: any): void;
@@ -16060,6 +16115,16 @@ declare module "question_tagbox" {
16060
16115
  private updateReadOnlyText;
16061
16116
  protected getDefaultItemComponent(): string;
16062
16117
  onSurveyLoad(): void;
16118
+ /**
16119
+ * Specifies a comparison operation used to filter the drop-down list. Applies only if [`searchEnabled`](#searchEnabled) is `true`.
16120
+ *
16121
+ * Possible values:
16122
+ *
16123
+ * - `"contains"` (default)
16124
+ * - `"startsWith"`
16125
+ * @see [SurveyModel.onChoicesSearch](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onChoicesSearch)
16126
+ */
16127
+ searchMode: "contains" | "startsWith";
16063
16128
  /**
16064
16129
  * Specifies whether to display a button that clears the selected value.
16065
16130
  */
@@ -17309,7 +17374,7 @@ declare module "entries/chunks/model" {
17309
17374
  export { Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand } from "expressions/expressions";
17310
17375
  export { ConditionsParser } from "conditionsParser";
17311
17376
  export { ProcessValue } from "conditionProcessValue";
17312
- export { JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray } from "jsonobject";
17377
+ export { JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, IJsonPropertyInfo, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray } from "jsonobject";
17313
17378
  export { IMatrixDropdownData, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "question_matrixdropdownbase";
17314
17379
  export { MatrixDropdownColumn, matrixDropdownColumnTypes } from "question_matrixdropdowncolumn";
17315
17380
  export { QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable } from "question_matrixdropdownrendered";
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.130
2
+ * surveyjs - Survey JavaScript library v1.9.131
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -8023,6 +8023,17 @@ var DropdownListModel = /** @class */ (function (_super) {
8023
8023
  DropdownListModel.prototype.getAvailableItems = function () {
8024
8024
  return this.question.visibleChoices;
8025
8025
  };
8026
+ DropdownListModel.prototype.setOnTextSearchCallbackForListModel = function (listModel) {
8027
+ var _this = this;
8028
+ listModel.setOnTextSearchCallback(function (item, textToSearch) {
8029
+ if (_this.filteredItems)
8030
+ return _this.filteredItems.indexOf(item) >= 0;
8031
+ var textInLow = item.text.toLocaleLowerCase();
8032
+ textInLow = _settings__WEBPACK_IMPORTED_MODULE_6__["settings"].comparator.normalizeTextCallback(textInLow, "filter");
8033
+ var index = textInLow.indexOf(textToSearch.toLocaleLowerCase());
8034
+ return _this.question.searchMode == "startsWith" ? index == 0 : index > -1;
8035
+ });
8036
+ };
8026
8037
  DropdownListModel.prototype.createListModel = function () {
8027
8038
  var _this = this;
8028
8039
  var visibleItems = this.getAvailableItems();
@@ -8036,14 +8047,7 @@ var DropdownListModel = /** @class */ (function (_super) {
8036
8047
  };
8037
8048
  }
8038
8049
  var res = new _list__WEBPACK_IMPORTED_MODULE_3__["ListModel"](visibleItems, _onSelectionChanged, false, undefined, this.question.choicesLazyLoadEnabled ? this.listModelFilterStringChanged : undefined, this.listElementId);
8039
- res.setOnTextSearchCallback(function (item, textToSearch) {
8040
- if (_this.filteredItems)
8041
- return _this.filteredItems.indexOf(item) >= 0;
8042
- var textInLow = item.text.toLocaleLowerCase();
8043
- textInLow = _settings__WEBPACK_IMPORTED_MODULE_6__["settings"].comparator.normalizeTextCallback(textInLow, "filter");
8044
- var index = textInLow.indexOf(textToSearch.toLocaleLowerCase());
8045
- return _this.question.searchMode == "startsWith" ? index == 0 : index > -1;
8046
- });
8050
+ this.setOnTextSearchCallbackForListModel(res);
8047
8051
  res.renderElements = false;
8048
8052
  res.forceShowFilter = true;
8049
8053
  res.areSameItemsCallback = function (item1, item2) {
@@ -8622,6 +8626,7 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
8622
8626
  };
8623
8627
  }
8624
8628
  var res = new _multiSelectListModel__WEBPACK_IMPORTED_MODULE_3__["MultiSelectListModel"](visibleItems, _onSelectionChanged, false, undefined, this.question.choicesLazyLoadEnabled ? this.listModelFilterStringChanged : undefined, this.listElementId);
8629
+ this.setOnTextSearchCallbackForListModel(res);
8625
8630
  res.forceShowFilter = true;
8626
8631
  return res;
8627
8632
  };
@@ -9542,8 +9547,8 @@ __webpack_require__.r(__webpack_exports__);
9542
9547
  //import "../../modern.scss";
9543
9548
  var Version;
9544
9549
  var ReleaseDate;
9545
- Version = "" + "1.9.130";
9546
- ReleaseDate = "" + "2024-02-15";
9550
+ Version = "" + "1.9.131";
9551
+ ReleaseDate = "" + "2024-02-20";
9547
9552
  function checkLibraryVersion(ver, libraryName) {
9548
9553
  if (Version != ver) {
9549
9554
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -21257,6 +21262,10 @@ __webpack_require__.r(__webpack_exports__);
21257
21262
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
21258
21263
  /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
21259
21264
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ "./src/base.ts");
21265
+ /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
21266
+ /* harmony import */ var _survey_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./survey-element */ "./src/survey-element.ts");
21267
+
21268
+
21260
21269
 
21261
21270
 
21262
21271
 
@@ -21268,12 +21277,17 @@ __webpack_require__.r(__webpack_exports__);
21268
21277
  var LocalizableString = /** @class */ (function () {
21269
21278
  function LocalizableString(owner, useMarkdown, name) {
21270
21279
  if (useMarkdown === void 0) { useMarkdown = false; }
21280
+ var _a;
21271
21281
  this.owner = owner;
21272
21282
  this.useMarkdown = useMarkdown;
21273
21283
  this.name = name;
21274
21284
  this.values = {};
21275
21285
  this.htmlValues = {};
21286
+ this._allowLineBreaks = false;
21276
21287
  this.onStringChanged = new _base__WEBPACK_IMPORTED_MODULE_3__["EventBase"]();
21288
+ if (owner instanceof _survey_element__WEBPACK_IMPORTED_MODULE_5__["SurveyElementCore"]) {
21289
+ this._allowLineBreaks = ((_a = _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].findProperty(owner.getType(), name)) === null || _a === void 0 ? void 0 : _a.type) == "text";
21290
+ }
21277
21291
  this.onCreating();
21278
21292
  }
21279
21293
  Object.defineProperty(LocalizableString, "defaultLocale", {
@@ -21299,6 +21313,13 @@ var LocalizableString = /** @class */ (function () {
21299
21313
  enumerable: false,
21300
21314
  configurable: true
21301
21315
  });
21316
+ Object.defineProperty(LocalizableString.prototype, "allowLineBreaks", {
21317
+ get: function () {
21318
+ return this._allowLineBreaks;
21319
+ },
21320
+ enumerable: false,
21321
+ configurable: true
21322
+ });
21302
21323
  LocalizableString.prototype.getIsMultiple = function () { return false; };
21303
21324
  Object.defineProperty(LocalizableString.prototype, "locale", {
21304
21325
  get: function () {
@@ -38136,7 +38157,6 @@ var Question = /** @class */ (function (_super) {
38136
38157
  Question.prototype.hasErrors = function (fireCallback, rec) {
38137
38158
  if (fireCallback === void 0) { fireCallback = true; }
38138
38159
  if (rec === void 0) { rec = null; }
38139
- var oldHasErrors = this.errors.length > 0;
38140
38160
  var errors = this.checkForErrors(!!rec && rec.isOnValueChanged === true);
38141
38161
  if (fireCallback) {
38142
38162
  if (!!this.survey) {
@@ -38194,13 +38214,16 @@ var Question = /** @class */ (function (_super) {
38194
38214
  return;
38195
38215
  var newError = null;
38196
38216
  if (typeof error === "string" || error instanceof String) {
38197
- newError = new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
38217
+ newError = this.addCustomError(error);
38198
38218
  }
38199
38219
  else {
38200
38220
  newError = error;
38201
38221
  }
38202
38222
  this.errors.push(newError);
38203
38223
  };
38224
+ Question.prototype.addCustomError = function (error) {
38225
+ return new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
38226
+ };
38204
38227
  Question.prototype.removeError = function (error) {
38205
38228
  var errors = this.errors;
38206
38229
  var index = errors.indexOf(error);
@@ -38251,6 +38274,12 @@ var Question = /** @class */ (function (_super) {
38251
38274
  err.onUpdateErrorTextCallback = function (err) { err.text = _this.requiredErrorText; };
38252
38275
  errors.push(err);
38253
38276
  }
38277
+ if (!this.isEmpty() && this.customWidget) {
38278
+ var text = this.customWidget.validate(this);
38279
+ if (!!text) {
38280
+ errors.push(this.addCustomError(text));
38281
+ }
38282
+ }
38254
38283
  };
38255
38284
  Question.prototype.hasRequiredError = function () {
38256
38285
  return this.isRequired && this.isEmpty();
@@ -39013,6 +39042,11 @@ var QuestionCustomWidget = /** @class */ (function () {
39013
39042
  return this.widgetJson.getDisplayValue(question, value);
39014
39043
  return null;
39015
39044
  };
39045
+ QuestionCustomWidget.prototype.validate = function (question) {
39046
+ if (this.widgetJson.validate)
39047
+ return this.widgetJson.validate(question);
39048
+ return undefined;
39049
+ };
39016
39050
  QuestionCustomWidget.prototype.isFit = function (question) {
39017
39051
  if (this.isLibraryLoaded() && this.widgetJson.isFit)
39018
39052
  return this.widgetJson.isFit(question);
@@ -61656,6 +61690,9 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
61656
61690
  enumerable: false,
61657
61691
  configurable: true
61658
61692
  });
61693
+ __decorate([
61694
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
61695
+ ], QuestionTagboxModel.prototype, "searchMode", void 0);
61659
61696
  __decorate([
61660
61697
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
61661
61698
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
@@ -61697,7 +61734,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("tagbox", [
61697
61734
  { name: "choicesLazyLoadPageSize:number", default: 25, visible: false },
61698
61735
  { name: "hideSelectedItems:boolean", default: false },
61699
61736
  { name: "closeOnSelect:boolean" },
61700
- { name: "itemComponent", visible: false, default: "" }
61737
+ { name: "itemComponent", visible: false, default: "" },
61738
+ { name: "searchMode", default: "contains", choices: ["contains", "startsWith"] }
61701
61739
  ], function () {
61702
61740
  return new QuestionTagboxModel("");
61703
61741
  }, "checkbox");
@@ -72747,11 +72785,12 @@ var SurveyLocStringViewer = /** @class */ (function (_super) {
72747
72785
  return strEl;
72748
72786
  };
72749
72787
  SurveyLocStringViewer.prototype.renderString = function () {
72788
+ var className = this.locStr.allowLineBreaks ? "sv-string-viewer sv-string-viewer--multiline" : "sv-string-viewer";
72750
72789
  if (this.locStr.hasHtml) {
72751
72790
  var htmlValue = { __html: this.locStr.renderedHtml };
72752
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { ref: this.rootRef, className: "sv-string-viewer", style: this.style, dangerouslySetInnerHTML: htmlValue });
72791
+ return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
72753
72792
  }
72754
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { ref: this.rootRef, className: "sv-string-viewer", style: this.style }, this.locStr.renderedHtml);
72793
+ return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
72755
72794
  };
72756
72795
  return SurveyLocStringViewer;
72757
72796
  }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));
@@ -86886,7 +86925,8 @@ function findParentByClassNames(element, classNames) {
86886
86925
  }
86887
86926
  }
86888
86927
  }
86889
- function sanitizeEditableContent(element) {
86928
+ function sanitizeEditableContent(element, cleanLineBreaks) {
86929
+ if (cleanLineBreaks === void 0) { cleanLineBreaks = true; }
86890
86930
  if (window.getSelection && document.createRange && element.childNodes.length > 0) {
86891
86931
  var selection = document.getSelection();
86892
86932
  if (selection.rangeCount == 0) {
@@ -86897,13 +86937,23 @@ function sanitizeEditableContent(element) {
86897
86937
  range.setEndAfter(element.lastChild);
86898
86938
  selection.removeAllRanges();
86899
86939
  selection.addRange(range);
86900
- var tail_len = selection.toString().replace(/\n/g, "").length;
86901
- element.innerText = element.innerText.replace(/\n/g, "");
86940
+ var tail = selection.toString();
86941
+ var innerText = element.innerText;
86942
+ tail = tail.replace(/\r/g, "");
86943
+ if (cleanLineBreaks) {
86944
+ tail = tail.replace(/\n/g, "");
86945
+ innerText = innerText.replace(/\n/g, "");
86946
+ }
86947
+ var tail_len = tail.length;
86948
+ element.innerText = innerText;
86902
86949
  range = document.createRange();
86903
- range.setStart(element.childNodes[0], element.innerText.length - tail_len);
86904
- range.collapse(true);
86950
+ range.setStart(element.firstChild, 0);
86951
+ range.setEnd(element.firstChild, 0);
86905
86952
  selection.removeAllRanges();
86906
86953
  selection.addRange(range);
86954
+ for (var i = 0; i < innerText.length - tail_len; i++) {
86955
+ selection.modify("move", "forward", "character");
86956
+ }
86907
86957
  }
86908
86958
  }
86909
86959
  function mergeValues(src, dest) {
@@ -86965,7 +87015,7 @@ function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
86965
87015
  cancelBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sd-btn sd-btn--small";
86966
87016
  applyBtn.title = applyTitle || _surveyStrings__WEBPACK_IMPORTED_MODULE_2__["surveyLocalization"].getString("ok", locale);
86967
87017
  applyBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sv-popup__button--danger sd-btn sd-btn--small sd-btn--danger";
86968
- popupViewModel.width = "452px";
87018
+ //popupViewModel.width = "452px";
86969
87019
  return true;
86970
87020
  }
86971
87021
  function chooseFiles(input, callback) {