survey-react 1.11.11 → 1.11.12

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.11.11
2
+ * surveyjs - Survey JavaScript library v1.11.12
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
  */
@@ -27535,6 +27535,9 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
27535
27535
  if (this.isSettingValue)
27536
27536
  return;
27537
27537
  this.updateQuestionsValue(name, newColumnValue, isComment);
27538
+ if (!isComment) {
27539
+ this.updateSharedQuestionsValue(name, newColumnValue);
27540
+ }
27538
27541
  var newValue = this.value;
27539
27542
  var changedName = isComment ? name + base_Base.commentSuffix : name;
27540
27543
  var changedValue = newColumnValue;
@@ -27580,6 +27583,18 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
27580
27583
  }
27581
27584
  this.isSettingValue = false;
27582
27585
  };
27586
+ MatrixDropdownRowModelBase.prototype.updateSharedQuestionsValue = function (name, value) {
27587
+ var questions = this.getQuestionsByValueName(name);
27588
+ if (questions.length > 1) {
27589
+ for (var i = 0; i < questions.length; i++) {
27590
+ if (!helpers_Helpers.isTwoValueEquals(questions[i].value, value)) {
27591
+ this.isSettingValue = true;
27592
+ questions[i].updateValueFromSurvey(value);
27593
+ this.isSettingValue = false;
27594
+ }
27595
+ }
27596
+ }
27597
+ };
27583
27598
  MatrixDropdownRowModelBase.prototype.runTriggers = function (name, value) {
27584
27599
  if (!name)
27585
27600
  return;
@@ -27668,6 +27683,19 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
27668
27683
  }
27669
27684
  return res;
27670
27685
  };
27686
+ MatrixDropdownRowModelBase.prototype.getQuestionsByValueName = function (name) {
27687
+ var res = [];
27688
+ for (var i = 0; i < this.cells.length; i++) {
27689
+ var cell = this.cells[i];
27690
+ if (cell.question && cell.question.getValueName() === name) {
27691
+ res.push(cell.question);
27692
+ }
27693
+ }
27694
+ if (!!this.detailPanel) {
27695
+ res = res.concat(this.detailPanel.getQuestionsByValueName(name));
27696
+ }
27697
+ return res;
27698
+ };
27671
27699
  MatrixDropdownRowModelBase.prototype.getSharedQuestionByName = function (columnName) {
27672
27700
  return !!this.data
27673
27701
  ? this.data.getSharedQuestionByName(columnName, this)
@@ -27771,6 +27799,9 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
27771
27799
  return res;
27772
27800
  };
27773
27801
  MatrixDropdownRowModelBase.prototype.updateCellOnColumnChanged = function (cell, name, newValue) {
27802
+ if (name === "choices" && Array.isArray(newValue) && newValue.length === 0 && this.data) {
27803
+ newValue = this.data.choices;
27804
+ }
27774
27805
  cell.question[name] = newValue;
27775
27806
  };
27776
27807
  MatrixDropdownRowModelBase.prototype.updateCellOnColumnItemValueChanged = function (cell, propertyName, obj, name, newValue, oldValue) {
@@ -29722,6 +29753,7 @@ Serializer.addClass("matrixdropdownbase", [
29722
29753
  },
29723
29754
  {
29724
29755
  name: "detailElements",
29756
+ baseClassName: "question",
29725
29757
  visible: false,
29726
29758
  isLightSerializable: false,
29727
29759
  },
@@ -34823,12 +34855,17 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
34823
34855
  return null;
34824
34856
  };
34825
34857
  PanelModelBase.prototype.getQuestionByValueName = function (valueName) {
34858
+ var res = this.getQuestionsByValueName(valueName);
34859
+ return res.length > 0 ? res[0] : null;
34860
+ };
34861
+ PanelModelBase.prototype.getQuestionsByValueName = function (valueName) {
34862
+ var res = [];
34826
34863
  var questions = this.questions;
34827
34864
  for (var i = 0; i < questions.length; i++) {
34828
34865
  if (questions[i].getValueName() == valueName)
34829
- return questions[i];
34866
+ res.push(questions[i]);
34830
34867
  }
34831
- return null;
34868
+ return res;
34832
34869
  };
34833
34870
  /**
34834
34871
  * Returns a JSON object with question values nested in the panel/page.
@@ -52182,6 +52219,22 @@ var InputElementAdapter = /** @class */ (function () {
52182
52219
  }());
52183
52220
 
52184
52221
 
52222
+ // CONCATENATED MODULE: ./packages/survey-core/src/mask/mask_utils.ts
52223
+
52224
+ var numberDefinition = /[0-9]/;
52225
+ function getAvailableMaskTypeChoices() {
52226
+ var classes = Serializer.getChildrenClasses("masksettings") || [];
52227
+ var choices = classes.map(function (cl) {
52228
+ var value = cl.name;
52229
+ if (cl.name.indexOf("mask") !== -1) {
52230
+ value = value.slice(0, value.indexOf("mask"));
52231
+ }
52232
+ return value;
52233
+ });
52234
+ choices.unshift("none");
52235
+ return choices;
52236
+ }
52237
+
52185
52238
  // CONCATENATED MODULE: ./packages/survey-core/src/question_text.ts
52186
52239
  var question_text_extends = (undefined && undefined.__extends) || (function () {
52187
52240
  var extendStatics = function (d, b) {
@@ -52213,6 +52266,7 @@ var question_text_decorate = (undefined && undefined.__decorate) || function (de
52213
52266
 
52214
52267
 
52215
52268
 
52269
+
52216
52270
  /**
52217
52271
  * A class that describes the Single-Line Input question type.
52218
52272
  *
@@ -53085,12 +53139,16 @@ Serializer.addClass("text", [
53085
53139
  },
53086
53140
  { name: "inputTextAlignment", default: "auto", choices: ["left", "right", "auto"], visible: false },
53087
53141
  {
53088
- name: "maskType:masktype",
53142
+ name: "maskType",
53089
53143
  default: "none",
53090
53144
  visibleIndex: 0,
53091
53145
  dependsOn: "inputType",
53092
53146
  visibleIf: function (obj) {
53093
53147
  return obj.inputType === "text" || obj.inputType === "tel";
53148
+ },
53149
+ choices: function (obj) {
53150
+ var choices = getAvailableMaskTypeChoices();
53151
+ return choices;
53094
53152
  }
53095
53153
  },
53096
53154
  {
@@ -53186,6 +53244,7 @@ var question_multipletext_decorate = (undefined && undefined.__decorate) || func
53186
53244
 
53187
53245
 
53188
53246
 
53247
+
53189
53248
  var MultipleTextEditorModel = /** @class */ (function (_super) {
53190
53249
  question_multipletext_extends(MultipleTextEditorModel, _super);
53191
53250
  function MultipleTextEditorModel() {
@@ -54287,12 +54346,16 @@ Serializer.addClass("multipletextitem", [
54287
54346
  choices: settings.questions.inputTypes,
54288
54347
  },
54289
54348
  {
54290
- name: "maskType:masktype",
54349
+ name: "maskType",
54291
54350
  default: "none",
54292
54351
  visibleIndex: 0,
54293
54352
  dependsOn: "inputType",
54294
54353
  visibleIf: function (obj) {
54295
54354
  return obj.inputType === "text";
54355
+ },
54356
+ choices: function (obj) {
54357
+ var choices = getAvailableMaskTypeChoices();
54358
+ return choices;
54296
54359
  }
54297
54360
  },
54298
54361
  {
@@ -67800,9 +67863,6 @@ Serializer.addClass("patternmask", [
67800
67863
  return new mask_pattern_InputMaskPattern();
67801
67864
  }, "masksettings");
67802
67865
 
67803
- // CONCATENATED MODULE: ./packages/survey-core/src/mask/mask_utils.ts
67804
- var numberDefinition = /[0-9]/;
67805
-
67806
67866
  // CONCATENATED MODULE: ./packages/survey-core/src/mask/mask_numeric.ts
67807
67867
  var mask_numeric_extends = (undefined && undefined.__extends) || (function () {
67808
67868
  var extendStatics = function (d, b) {
@@ -68946,8 +69006,8 @@ Serializer.addClass("currencymask", [
68946
69006
 
68947
69007
  var Version;
68948
69008
  var ReleaseDate;
68949
- Version = "" + "1.11.11";
68950
- ReleaseDate = "" + "2024-08-14";
69009
+ Version = "" + "1.11.12";
69010
+ ReleaseDate = "" + "2024-08-20";
68951
69011
  function checkLibraryVersion(ver, libraryName) {
68952
69012
  if (Version != ver) {
68953
69013
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -81511,7 +81571,6 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
81511
81571
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "header", needRenderWrapper: false }),
81512
81572
  renderResult,
81513
81573
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "footer", needRenderWrapper: false }))),
81514
- this.survey.showBrandInfo ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](brand_info_BrandInfo, null) : null,
81515
81574
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](notifier_NotifierComponent, { notifier: this.survey.notifier }))));
81516
81575
  };
81517
81576
  Survey.prototype.renderElement = function () {
@@ -81561,7 +81620,8 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
81561
81620
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { id: pageId, className: className, style: style },
81562
81621
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "contentTop" }),
81563
81622
  activePage,
81564
- external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "contentBottom" }))),
81623
+ external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "contentBottom" }),
81624
+ this.survey.showBrandInfo ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](brand_info_BrandInfo, null) : null)),
81565
81625
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](components_container_ComponentsContainer, { survey: this.survey, container: "right" })));
81566
81626
  };
81567
81627
  Survey.prototype.renderPage = function (page) {
@@ -86267,7 +86327,13 @@ var react_popup_survey_PopupSurvey = /** @class */ (function (_super) {
86267
86327
  return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](svg_icon_SvgIcon, { iconName: "icon-minimize_16x16", size: 16 });
86268
86328
  };
86269
86329
  PopupSurvey.prototype.renderCloseButton = function (popup) {
86270
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: popup.cssHeaderCloseButton, onClick: function () { popup.hide(); } },
86330
+ var _this = this;
86331
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: popup.cssHeaderCloseButton, onClick: function () {
86332
+ popup.hide();
86333
+ if (typeof _this.props.onClose == "function") {
86334
+ _this.props.onClose();
86335
+ }
86336
+ } },
86271
86337
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](svg_icon_SvgIcon, { iconName: "icon-close_16x16", size: 16 })));
86272
86338
  };
86273
86339
  PopupSurvey.prototype.renderAllowFullScreenButon = function (popup) {