survey-core 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.
Files changed (226) hide show
  1. package/defaultV2.css +13 -2
  2. package/defaultV2.css.map +1 -1
  3. package/defaultV2.fontless.css +13 -2
  4. package/defaultV2.fontless.css.map +1 -1
  5. package/defaultV2.fontless.min.css +2 -2
  6. package/defaultV2.min.css +2 -2
  7. package/i18n/arabic.js +1 -1
  8. package/i18n/arabic.min.js +1 -1
  9. package/i18n/basque.js +1 -1
  10. package/i18n/basque.min.js +1 -1
  11. package/i18n/bulgarian.js +1 -1
  12. package/i18n/bulgarian.min.js +1 -1
  13. package/i18n/catalan.js +1 -1
  14. package/i18n/catalan.min.js +1 -1
  15. package/i18n/croatian.js +1 -1
  16. package/i18n/croatian.min.js +1 -1
  17. package/i18n/czech.js +1 -1
  18. package/i18n/czech.min.js +1 -1
  19. package/i18n/danish.js +1 -1
  20. package/i18n/danish.min.js +1 -1
  21. package/i18n/dutch.js +1 -1
  22. package/i18n/dutch.min.js +1 -1
  23. package/i18n/english.js +1 -1
  24. package/i18n/english.min.js +1 -1
  25. package/i18n/estonian.js +1 -1
  26. package/i18n/estonian.min.js +1 -1
  27. package/i18n/finnish.js +1 -1
  28. package/i18n/finnish.min.js +1 -1
  29. package/i18n/french.js +1 -1
  30. package/i18n/french.min.js +1 -1
  31. package/i18n/georgian.js +1 -1
  32. package/i18n/georgian.min.js +1 -1
  33. package/i18n/german.js +1 -1
  34. package/i18n/german.min.js +1 -1
  35. package/i18n/greek.js +1 -1
  36. package/i18n/greek.min.js +1 -1
  37. package/i18n/hebrew.js +1 -1
  38. package/i18n/hebrew.min.js +1 -1
  39. package/i18n/hindi.js +1 -1
  40. package/i18n/hindi.min.js +1 -1
  41. package/i18n/hungarian.js +1 -1
  42. package/i18n/hungarian.min.js +1 -1
  43. package/i18n/icelandic.js +1 -1
  44. package/i18n/icelandic.min.js +1 -1
  45. package/i18n/index.js +1 -1
  46. package/i18n/index.min.js +1 -1
  47. package/i18n/indonesian.js +1 -1
  48. package/i18n/indonesian.min.js +1 -1
  49. package/i18n/italian.js +1 -1
  50. package/i18n/italian.min.js +1 -1
  51. package/i18n/japanese.js +1 -1
  52. package/i18n/japanese.min.js +1 -1
  53. package/i18n/kazakh.js +1 -1
  54. package/i18n/kazakh.min.js +1 -1
  55. package/i18n/korean.js +1 -1
  56. package/i18n/korean.min.js +1 -1
  57. package/i18n/latvian.js +1 -1
  58. package/i18n/latvian.min.js +1 -1
  59. package/i18n/lithuanian.js +1 -1
  60. package/i18n/lithuanian.min.js +1 -1
  61. package/i18n/macedonian.js +1 -1
  62. package/i18n/macedonian.min.js +1 -1
  63. package/i18n/malay.js +1 -1
  64. package/i18n/malay.min.js +1 -1
  65. package/i18n/nl-BE.js +1 -1
  66. package/i18n/nl-BE.min.js +1 -1
  67. package/i18n/norwegian.js +1 -1
  68. package/i18n/norwegian.min.js +1 -1
  69. package/i18n/persian.js +1 -1
  70. package/i18n/persian.min.js +1 -1
  71. package/i18n/polish.js +1 -1
  72. package/i18n/polish.min.js +1 -1
  73. package/i18n/portuguese-br.js +1 -1
  74. package/i18n/portuguese-br.min.js +1 -1
  75. package/i18n/portuguese.js +1 -1
  76. package/i18n/portuguese.min.js +1 -1
  77. package/i18n/romanian.js +1 -1
  78. package/i18n/romanian.min.js +1 -1
  79. package/i18n/russian.js +1 -1
  80. package/i18n/russian.min.js +1 -1
  81. package/i18n/serbian.js +1 -1
  82. package/i18n/serbian.min.js +1 -1
  83. package/i18n/simplified-chinese.js +1 -1
  84. package/i18n/simplified-chinese.min.js +1 -1
  85. package/i18n/slovak.js +1 -1
  86. package/i18n/slovak.min.js +1 -1
  87. package/i18n/spanish.js +1 -1
  88. package/i18n/spanish.min.js +1 -1
  89. package/i18n/swahili.js +1 -1
  90. package/i18n/swahili.min.js +1 -1
  91. package/i18n/swedish.js +1 -1
  92. package/i18n/swedish.min.js +1 -1
  93. package/i18n/tajik.js +1 -1
  94. package/i18n/tajik.min.js +1 -1
  95. package/i18n/telugu.js +1 -1
  96. package/i18n/telugu.min.js +1 -1
  97. package/i18n/thai.js +1 -1
  98. package/i18n/thai.min.js +1 -1
  99. package/i18n/traditional-chinese.js +1 -1
  100. package/i18n/traditional-chinese.min.js +1 -1
  101. package/i18n/turkish.js +1 -1
  102. package/i18n/turkish.min.js +1 -1
  103. package/i18n/ukrainian.js +1 -1
  104. package/i18n/ukrainian.min.js +1 -1
  105. package/i18n/urdu.js +1 -1
  106. package/i18n/urdu.min.js +1 -1
  107. package/i18n/vietnamese.js +1 -1
  108. package/i18n/vietnamese.min.js +1 -1
  109. package/i18n/welsh.js +1 -1
  110. package/i18n/welsh.min.js +1 -1
  111. package/modern.css +15 -1
  112. package/modern.css.map +1 -1
  113. package/modern.fontless.css +15 -1
  114. package/modern.fontless.css.map +1 -1
  115. package/modern.fontless.min.css +2 -2
  116. package/modern.min.css +2 -2
  117. package/package.json +1 -1
  118. package/plugins/bootstrap-integration.js +1 -1
  119. package/plugins/bootstrap-integration.min.js +1 -1
  120. package/plugins/bootstrap-material-integration.js +1 -1
  121. package/plugins/bootstrap-material-integration.min.js +1 -1
  122. package/survey.core.js +69 -20
  123. package/survey.core.js.map +1 -1
  124. package/survey.core.min.js +3 -3
  125. package/survey.css +1 -1
  126. package/survey.i18n.js +1 -1
  127. package/survey.i18n.min.js +1 -1
  128. package/survey.min.css +1 -1
  129. package/themes/borderless-dark-panelless.js +1 -1
  130. package/themes/borderless-dark-panelless.min.js +1 -1
  131. package/themes/borderless-dark.js +1 -1
  132. package/themes/borderless-dark.min.js +1 -1
  133. package/themes/borderless-light-panelless..js +1 -1
  134. package/themes/borderless-light-panelless..min.js +1 -1
  135. package/themes/borderless-light.js +1 -1
  136. package/themes/borderless-light.min.js +1 -1
  137. package/themes/contrast-dark-panelless.js +1 -1
  138. package/themes/contrast-dark-panelless.min.js +1 -1
  139. package/themes/contrast-dark.js +1 -1
  140. package/themes/contrast-dark.min.js +1 -1
  141. package/themes/contrast-light-panelless.js +1 -1
  142. package/themes/contrast-light-panelless.min.js +1 -1
  143. package/themes/contrast-light.js +1 -1
  144. package/themes/contrast-light.min.js +1 -1
  145. package/themes/default-dark-panelless.js +1 -1
  146. package/themes/default-dark-panelless.min.js +1 -1
  147. package/themes/default-dark.js +1 -1
  148. package/themes/default-dark.min.js +1 -1
  149. package/themes/default-light-panelless.js +1 -1
  150. package/themes/default-light-panelless.min.js +1 -1
  151. package/themes/default-light.js +1 -1
  152. package/themes/default-light.min.js +1 -1
  153. package/themes/doubleborder-dark-panelless.js +1 -1
  154. package/themes/doubleborder-dark-panelless.min.js +1 -1
  155. package/themes/doubleborder-dark.js +1 -1
  156. package/themes/doubleborder-dark.min.js +1 -1
  157. package/themes/doubleborder-light-panelles.js +1 -1
  158. package/themes/doubleborder-light-panelles.min.js +1 -1
  159. package/themes/doubleborder-light.js +1 -1
  160. package/themes/doubleborder-light.min.js +1 -1
  161. package/themes/flat-dark-panelless.js +1 -1
  162. package/themes/flat-dark-panelless.min.js +1 -1
  163. package/themes/flat-dark.js +1 -1
  164. package/themes/flat-dark.min.js +1 -1
  165. package/themes/flat-light-panelless.js +1 -1
  166. package/themes/flat-light-panelless.min.js +1 -1
  167. package/themes/flat-light.js +1 -1
  168. package/themes/flat-light.min.js +1 -1
  169. package/themes/index.js +1 -1
  170. package/themes/index.min.js +1 -1
  171. package/themes/layered-dark-panelless.js +1 -1
  172. package/themes/layered-dark-panelless.min.js +1 -1
  173. package/themes/layered-dark.js +1 -1
  174. package/themes/layered-dark.min.js +1 -1
  175. package/themes/layered-light-panelless.js +1 -1
  176. package/themes/layered-light-panelless.min.js +1 -1
  177. package/themes/layered-light.js +1 -1
  178. package/themes/layered-light.min.js +1 -1
  179. package/themes/plain-dark-panelless.js +1 -1
  180. package/themes/plain-dark-panelless.min.js +1 -1
  181. package/themes/plain-dark.js +1 -1
  182. package/themes/plain-dark.min.js +1 -1
  183. package/themes/plain-light-panelless.js +1 -1
  184. package/themes/plain-light-panelless.min.js +1 -1
  185. package/themes/plain-light.js +1 -1
  186. package/themes/plain-light.min.js +1 -1
  187. package/themes/sharp-dark-panelless.js +1 -1
  188. package/themes/sharp-dark-panelless.min.js +1 -1
  189. package/themes/sharp-dark.js +1 -1
  190. package/themes/sharp-dark.min.js +1 -1
  191. package/themes/sharp-light-panelless.js +1 -1
  192. package/themes/sharp-light-panelless.min.js +1 -1
  193. package/themes/sharp-light.js +1 -1
  194. package/themes/sharp-light.min.js +1 -1
  195. package/themes/solid-dark-panelless.js +1 -1
  196. package/themes/solid-dark-panelless.min.js +1 -1
  197. package/themes/solid-dark.js +1 -1
  198. package/themes/solid-dark.min.js +1 -1
  199. package/themes/solid-light-panelless.js +1 -1
  200. package/themes/solid-light-panelless.min.js +1 -1
  201. package/themes/solid-light.js +1 -1
  202. package/themes/solid-light.min.js +1 -1
  203. package/themes/three-dimensional-dark-panelless.js +1 -1
  204. package/themes/three-dimensional-dark-panelless.min.js +1 -1
  205. package/themes/three-dimensional-dark.js +1 -1
  206. package/themes/three-dimensional-dark.min.js +1 -1
  207. package/themes/three-dimensional-light-panelless.js +1 -1
  208. package/themes/three-dimensional-light-panelless.min.js +1 -1
  209. package/themes/three-dimensional-light.js +1 -1
  210. package/themes/three-dimensional-light.min.js +1 -1
  211. package/ts3.4/typings/dropdownListModel.d.ts +1 -0
  212. package/ts3.4/typings/entries/chunks/model.d.ts +1 -1
  213. package/ts3.4/typings/jsonobject.d.ts +55 -5
  214. package/ts3.4/typings/localizablestring.d.ts +2 -0
  215. package/ts3.4/typings/question.d.ts +1 -0
  216. package/ts3.4/typings/questionCustomWidgets.d.ts +1 -0
  217. package/ts3.4/typings/question_tagbox.d.ts +10 -0
  218. package/ts3.4/typings/utils/utils.d.ts +1 -1
  219. package/typings/dropdownListModel.d.ts +1 -0
  220. package/typings/entries/chunks/model.d.ts +1 -1
  221. package/typings/jsonobject.d.ts +55 -5
  222. package/typings/localizablestring.d.ts +2 -0
  223. package/typings/question.d.ts +1 -0
  224. package/typings/questionCustomWidgets.d.ts +1 -0
  225. package/typings/question_tagbox.d.ts +10 -0
  226. package/typings/utils/utils.d.ts +1 -1
@@ -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
  */
@@ -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
  */
package/survey.core.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
  };
@@ -9431,8 +9436,8 @@ __webpack_require__.r(__webpack_exports__);
9431
9436
  //import "../../modern.scss";
9432
9437
  var Version;
9433
9438
  var ReleaseDate;
9434
- Version = "" + "1.9.130";
9435
- ReleaseDate = "" + "2024-02-15";
9439
+ Version = "" + "1.9.131";
9440
+ ReleaseDate = "" + "2024-02-20";
9436
9441
  function checkLibraryVersion(ver, libraryName) {
9437
9442
  if (Version != ver) {
9438
9443
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -20068,6 +20073,10 @@ __webpack_require__.r(__webpack_exports__);
20068
20073
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
20069
20074
  /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
20070
20075
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ "./src/base.ts");
20076
+ /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
20077
+ /* harmony import */ var _survey_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./survey-element */ "./src/survey-element.ts");
20078
+
20079
+
20071
20080
 
20072
20081
 
20073
20082
 
@@ -20079,12 +20088,17 @@ __webpack_require__.r(__webpack_exports__);
20079
20088
  var LocalizableString = /** @class */ (function () {
20080
20089
  function LocalizableString(owner, useMarkdown, name) {
20081
20090
  if (useMarkdown === void 0) { useMarkdown = false; }
20091
+ var _a;
20082
20092
  this.owner = owner;
20083
20093
  this.useMarkdown = useMarkdown;
20084
20094
  this.name = name;
20085
20095
  this.values = {};
20086
20096
  this.htmlValues = {};
20097
+ this._allowLineBreaks = false;
20087
20098
  this.onStringChanged = new _base__WEBPACK_IMPORTED_MODULE_3__["EventBase"]();
20099
+ if (owner instanceof _survey_element__WEBPACK_IMPORTED_MODULE_5__["SurveyElementCore"]) {
20100
+ this._allowLineBreaks = ((_a = _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].findProperty(owner.getType(), name)) === null || _a === void 0 ? void 0 : _a.type) == "text";
20101
+ }
20088
20102
  this.onCreating();
20089
20103
  }
20090
20104
  Object.defineProperty(LocalizableString, "defaultLocale", {
@@ -20110,6 +20124,13 @@ var LocalizableString = /** @class */ (function () {
20110
20124
  enumerable: false,
20111
20125
  configurable: true
20112
20126
  });
20127
+ Object.defineProperty(LocalizableString.prototype, "allowLineBreaks", {
20128
+ get: function () {
20129
+ return this._allowLineBreaks;
20130
+ },
20131
+ enumerable: false,
20132
+ configurable: true
20133
+ });
20113
20134
  LocalizableString.prototype.getIsMultiple = function () { return false; };
20114
20135
  Object.defineProperty(LocalizableString.prototype, "locale", {
20115
20136
  get: function () {
@@ -28318,7 +28339,6 @@ var Question = /** @class */ (function (_super) {
28318
28339
  Question.prototype.hasErrors = function (fireCallback, rec) {
28319
28340
  if (fireCallback === void 0) { fireCallback = true; }
28320
28341
  if (rec === void 0) { rec = null; }
28321
- var oldHasErrors = this.errors.length > 0;
28322
28342
  var errors = this.checkForErrors(!!rec && rec.isOnValueChanged === true);
28323
28343
  if (fireCallback) {
28324
28344
  if (!!this.survey) {
@@ -28376,13 +28396,16 @@ var Question = /** @class */ (function (_super) {
28376
28396
  return;
28377
28397
  var newError = null;
28378
28398
  if (typeof error === "string" || error instanceof String) {
28379
- newError = new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
28399
+ newError = this.addCustomError(error);
28380
28400
  }
28381
28401
  else {
28382
28402
  newError = error;
28383
28403
  }
28384
28404
  this.errors.push(newError);
28385
28405
  };
28406
+ Question.prototype.addCustomError = function (error) {
28407
+ return new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
28408
+ };
28386
28409
  Question.prototype.removeError = function (error) {
28387
28410
  var errors = this.errors;
28388
28411
  var index = errors.indexOf(error);
@@ -28433,6 +28456,12 @@ var Question = /** @class */ (function (_super) {
28433
28456
  err.onUpdateErrorTextCallback = function (err) { err.text = _this.requiredErrorText; };
28434
28457
  errors.push(err);
28435
28458
  }
28459
+ if (!this.isEmpty() && this.customWidget) {
28460
+ var text = this.customWidget.validate(this);
28461
+ if (!!text) {
28462
+ errors.push(this.addCustomError(text));
28463
+ }
28464
+ }
28436
28465
  };
28437
28466
  Question.prototype.hasRequiredError = function () {
28438
28467
  return this.isRequired && this.isEmpty();
@@ -29195,6 +29224,11 @@ var QuestionCustomWidget = /** @class */ (function () {
29195
29224
  return this.widgetJson.getDisplayValue(question, value);
29196
29225
  return null;
29197
29226
  };
29227
+ QuestionCustomWidget.prototype.validate = function (question) {
29228
+ if (this.widgetJson.validate)
29229
+ return this.widgetJson.validate(question);
29230
+ return undefined;
29231
+ };
29198
29232
  QuestionCustomWidget.prototype.isFit = function (question) {
29199
29233
  if (this.isLibraryLoaded() && this.widgetJson.isFit)
29200
29234
  return this.widgetJson.isFit(question);
@@ -51838,6 +51872,9 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
51838
51872
  enumerable: false,
51839
51873
  configurable: true
51840
51874
  });
51875
+ __decorate([
51876
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
51877
+ ], QuestionTagboxModel.prototype, "searchMode", void 0);
51841
51878
  __decorate([
51842
51879
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
51843
51880
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
@@ -51879,7 +51916,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("tagbox", [
51879
51916
  { name: "choicesLazyLoadPageSize:number", default: 25, visible: false },
51880
51917
  { name: "hideSelectedItems:boolean", default: false },
51881
51918
  { name: "closeOnSelect:boolean" },
51882
- { name: "itemComponent", visible: false, default: "" }
51919
+ { name: "itemComponent", visible: false, default: "" },
51920
+ { name: "searchMode", default: "contains", choices: ["contains", "startsWith"] }
51883
51921
  ], function () {
51884
51922
  return new QuestionTagboxModel("");
51885
51923
  }, "checkbox");
@@ -67022,7 +67060,8 @@ function findParentByClassNames(element, classNames) {
67022
67060
  }
67023
67061
  }
67024
67062
  }
67025
- function sanitizeEditableContent(element) {
67063
+ function sanitizeEditableContent(element, cleanLineBreaks) {
67064
+ if (cleanLineBreaks === void 0) { cleanLineBreaks = true; }
67026
67065
  if (window.getSelection && document.createRange && element.childNodes.length > 0) {
67027
67066
  var selection = document.getSelection();
67028
67067
  if (selection.rangeCount == 0) {
@@ -67033,13 +67072,23 @@ function sanitizeEditableContent(element) {
67033
67072
  range.setEndAfter(element.lastChild);
67034
67073
  selection.removeAllRanges();
67035
67074
  selection.addRange(range);
67036
- var tail_len = selection.toString().replace(/\n/g, "").length;
67037
- element.innerText = element.innerText.replace(/\n/g, "");
67075
+ var tail = selection.toString();
67076
+ var innerText = element.innerText;
67077
+ tail = tail.replace(/\r/g, "");
67078
+ if (cleanLineBreaks) {
67079
+ tail = tail.replace(/\n/g, "");
67080
+ innerText = innerText.replace(/\n/g, "");
67081
+ }
67082
+ var tail_len = tail.length;
67083
+ element.innerText = innerText;
67038
67084
  range = document.createRange();
67039
- range.setStart(element.childNodes[0], element.innerText.length - tail_len);
67040
- range.collapse(true);
67085
+ range.setStart(element.firstChild, 0);
67086
+ range.setEnd(element.firstChild, 0);
67041
67087
  selection.removeAllRanges();
67042
67088
  selection.addRange(range);
67089
+ for (var i = 0; i < innerText.length - tail_len; i++) {
67090
+ selection.modify("move", "forward", "character");
67091
+ }
67043
67092
  }
67044
67093
  }
67045
67094
  function mergeValues(src, dest) {
@@ -67101,7 +67150,7 @@ function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
67101
67150
  cancelBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sd-btn sd-btn--small";
67102
67151
  applyBtn.title = applyTitle || _surveyStrings__WEBPACK_IMPORTED_MODULE_2__["surveyLocalization"].getString("ok", locale);
67103
67152
  applyBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sv-popup__button--danger sd-btn sd-btn--small sd-btn--danger";
67104
- popupViewModel.width = "452px";
67153
+ //popupViewModel.width = "452px";
67105
67154
  return true;
67106
67155
  }
67107
67156
  function chooseFiles(input, callback) {