survey-creator-core 1.9.103 → 1.9.105

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.103
2
+ * SurveyJS Creator v1.9.105
3
3
  * (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -2494,6 +2494,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
2494
2494
  this.updateActionVisibility("convertTo", operationsAllow && options.allowChangeType);
2495
2495
  this.updateActionVisibilityByProp("isrequired", "isRequired", operationsAllow && options.allowChangeRequired);
2496
2496
  this.updateActionVisibilityByProp("convertInputType", "inputType", options.allowChangeInputType);
2497
+ this.updateActionVisibilityByProp("convertInputType", "rateDisplayMode", options.allowChangeInputType);
2497
2498
  };
2498
2499
  QuestionAdornerViewModel.prototype.updateActionVisibilityByProp = function (actionName, propName, allow) {
2499
2500
  var prop = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(this.surveyElement.getType(), propName);
@@ -7213,6 +7214,7 @@ var logicCss = {
7213
7214
  tableWrapper: "",
7214
7215
  mainRoot: "sl-question st-row__question st-scrollable",
7215
7216
  root: "sl-table st-matrixdynamic",
7217
+ noHeader: "",
7216
7218
  row: "sl-table__row",
7217
7219
  rowAdditional: "sl-table__row--additional",
7218
7220
  cell: "sl-table__cell",
@@ -9405,7 +9407,8 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
9405
9407
  TestSurveyTabViewModel.prototype.getPageTitle = function (page, area, reason) {
9406
9408
  if (area === void 0) { area = "preview-tab:page-list"; }
9407
9409
  if (reason === void 0) { reason = "survey-tester"; }
9408
- var title = this.surveyProvider.getObjectDisplayName(page, area, reason, page.title);
9410
+ var pageTitle = page.title.replace(TestSurveyTabViewModel.tagRegex, "");
9411
+ var title = this.surveyProvider.getObjectDisplayName(page, area, reason, pageTitle);
9409
9412
  if (title === page.name && title.indexOf("page") === 0) {
9410
9413
  var index = this.survey.pages.indexOf(page);
9411
9414
  return _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.pageTypeName") + " " + (index + 1);
@@ -9558,6 +9561,7 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
9558
9561
  this.onScrollCallback();
9559
9562
  return true;
9560
9563
  };
9564
+ TestSurveyTabViewModel.tagRegex = /(<([^>]+)>)/ig;
9561
9565
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
9562
9566
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
9563
9567
  defaultValue: false,
@@ -9952,6 +9956,14 @@ survey_core__WEBPACK_IMPORTED_MODULE_0__["ComponentCollection"].Instance.add({
9952
9956
  titleLocation: "hidden",
9953
9957
  descriptionLocation: "hidden"
9954
9958
  },
9959
+ {
9960
+ type: "colorsettings",
9961
+ name: "placeholdercolor",
9962
+ colorTitle: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.placeholderColor"),
9963
+ colorTitleLocation: "left",
9964
+ titleLocation: "hidden",
9965
+ descriptionLocation: "hidden"
9966
+ },
9955
9967
  {
9956
9968
  type: "spinedit",
9957
9969
  name: "size",
@@ -9967,6 +9979,8 @@ survey_core__WEBPACK_IMPORTED_MODULE_0__["ComponentCollection"].Instance.add({
9967
9979
  onCreated: function (question) {
9968
9980
  var color = question.contentPanel.getQuestionByName("color");
9969
9981
  color.visible = question.name !== "surveyTitle";
9982
+ var placeholderColor = question.contentPanel.getQuestionByName("placeholdercolor");
9983
+ placeholderColor.visible = question.name === "editorFont";
9970
9984
  },
9971
9985
  onValueChanged: function (question, name, newValue) {
9972
9986
  },
@@ -9978,7 +9992,7 @@ function fontsettingsToCssVariable(question, themeCssVariables) {
9978
9992
  themeCssVariables["--sjs-font-" + question.name.toLocaleLowerCase() + "-" + key] = question.value[key] + (((_a = innerQ.unit) === null || _a === void 0 ? void 0 : _a.toString()) || "");
9979
9993
  });
9980
9994
  }
9981
- function fontsettingsFromCssVariable(question, themeCssVariables, defaultColorVariable) {
9995
+ function fontsettingsFromCssVariable(question, themeCssVariables, defaultColorVariable, defaultPlaceholderColorVariable) {
9982
9996
  var result = {};
9983
9997
  Object.keys(themeCssVariables).filter(function (key) { return key.indexOf(question.name.toLocaleLowerCase()) !== -1; }).forEach(function (key) {
9984
9998
  var propertyName = key.split("-").pop();
@@ -9987,8 +10001,13 @@ function fontsettingsFromCssVariable(question, themeCssVariables, defaultColorVa
9987
10001
  if (Object.keys(result).length !== 0) {
9988
10002
  question.value = result;
9989
10003
  }
9990
- else if (!!defaultColorVariable) {
9991
- question.contentPanel.getQuestionByName("color").value = defaultColorVariable;
10004
+ else {
10005
+ if (!!defaultColorVariable) {
10006
+ question.contentPanel.getQuestionByName("color").value = defaultColorVariable;
10007
+ }
10008
+ if (!!defaultPlaceholderColorVariable) {
10009
+ question.contentPanel.getQuestionByName("placeholdercolor").value = defaultPlaceholderColorVariable;
10010
+ }
9992
10011
  }
9993
10012
  return result;
9994
10013
  }
@@ -10184,6 +10203,8 @@ var TabThemePlugin = /** @class */ (function () {
10184
10203
  this.resetTheme = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
10185
10204
  id: "resetTheme",
10186
10205
  iconName: "icon-reset",
10206
+ locTitleName: "ed.themeResetButton",
10207
+ locTooltipName: "ed.themeResetButton",
10187
10208
  mode: "small",
10188
10209
  visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
10189
10210
  return (_this.creator.activeTab === "theme");
@@ -10414,6 +10435,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10414
10435
  this.setThemeToSurvey();
10415
10436
  };
10416
10437
  ThemeSurveyTabViewModel.prototype.loadTheme = function (theme) {
10438
+ this.blockThemeChangedNotifications += 1;
10417
10439
  this.themeName = theme.themeName;
10418
10440
  this.themePalette = theme.colorPalette;
10419
10441
  this.themeMode = theme.isPanelless ? "lightweight" : undefined;
@@ -10429,6 +10451,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10429
10451
  var themeVariables = {};
10430
10452
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(themeVariables, this.themeVariables, theme.cssVariables);
10431
10453
  theme.cssVariables = themeVariables;
10454
+ this.blockThemeChangedNotifications -= 1;
10432
10455
  };
10433
10456
  ThemeSurveyTabViewModel.prototype.updateSimulatorSurvey = function (json, theme) {
10434
10457
  var newSurvey = this.surveyProvider.createSurvey(json || {}, "theme");
@@ -10816,7 +10839,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10816
10839
  Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("pageDescription"), newCssVariables, newCssVariables["--sjs-general-dim-forecolor-light"]);
10817
10840
  Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("questionTitle"), newCssVariables, newCssVariables["--sjs-general-forecolor"]);
10818
10841
  Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("questionDescription"), newCssVariables, newCssVariables["--sjs-general-forecolor-light"]);
10819
- Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("editorFont"), newCssVariables, newCssVariables["--sjs-general-forecolor"]);
10842
+ Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("editorFont"), newCssVariables, newCssVariables["--sjs-general-forecolor"], newCssVariables["--sjs-general-forecolor-light"]);
10820
10843
  if (!!newCssVariables["--sjs-corner-radius"]) {
10821
10844
  themeEditorSurvey.getQuestionByName("cornerRadius").value = parseFloat(newCssVariables["--sjs-corner-radius"]);
10822
10845
  }
@@ -10832,14 +10855,17 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10832
10855
  }
10833
10856
  });
10834
10857
  };
10858
+ ThemeSurveyTabViewModel.prototype.raiseThemeChanged = function () {
10859
+ if (this.blockThemeChangedNotifications == 0) {
10860
+ this.surveyProvider.raiseThemeChanged();
10861
+ }
10862
+ };
10835
10863
  ThemeSurveyTabViewModel.prototype.setThemeToSurvey = function (theme) {
10836
10864
  if (!!theme) {
10837
10865
  this.surveyProvider.theme = theme;
10838
10866
  }
10839
10867
  this.survey.applyTheme(this.surveyProvider.theme);
10840
- if (this.blockThemeChangedNotifications == 0) {
10841
- this.surveyProvider.raiseThemeChanged();
10842
- }
10868
+ this.raiseThemeChanged();
10843
10869
  };
10844
10870
  ThemeSurveyTabViewModel.prototype.getThemeEditorSurveyJSON = function () {
10845
10871
  var themeEditorSurveyJSON = {
@@ -11332,6 +11358,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
11332
11358
  _target.survey.backgroundImage = newValue;
11333
11359
  }
11334
11360
  _target.currentTheme["backgroundImage"] = newValue;
11361
+ _target.raiseThemeChanged();
11335
11362
  }
11336
11363
  })
11337
11364
  ], ThemeSurveyTabViewModel.prototype, "backgroundImage", void 0);
@@ -11343,6 +11370,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
11343
11370
  _target.survey.backgroundImageFit = newValue;
11344
11371
  }
11345
11372
  _target.currentTheme["backgroundImageFit"] = newValue;
11373
+ _target.raiseThemeChanged();
11346
11374
  }
11347
11375
  })
11348
11376
  ], ThemeSurveyTabViewModel.prototype, "backgroundImageFit", void 0);
@@ -11354,6 +11382,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
11354
11382
  _target.survey.backgroundImageAttachment = newValue;
11355
11383
  }
11356
11384
  _target.currentTheme["backgroundImageAttachment"] = newValue;
11385
+ _target.raiseThemeChanged();
11357
11386
  }
11358
11387
  })
11359
11388
  ], ThemeSurveyTabViewModel.prototype, "backgroundImageAttachment", void 0);
@@ -11861,9 +11890,11 @@ var translationCss = {
11861
11890
  mainRoot: "st-question st-row__question st-scrollable",
11862
11891
  tableWrapper: "st-matrix",
11863
11892
  root: "st-table",
11893
+ noHeader: "st-table--no-header",
11864
11894
  rowError: "st-matrix__row--error",
11865
11895
  cell: "st-table__cell st-matrix__cell",
11866
11896
  headerCell: "st-table__cell st-table__cell--header",
11897
+ rowTextCell: "st-table__cell st-table__cell--row-text",
11867
11898
  label: "st-item st-radio st-matrix__label",
11868
11899
  itemValue: "st-visuallyhidden st-item__control st-radio__control",
11869
11900
  itemChecked: "st-radio--checked",
@@ -11878,14 +11909,18 @@ var translationCss = {
11878
11909
  matrixdropdown: {
11879
11910
  mainRoot: "st-question st-row__question st-scrollable",
11880
11911
  root: "st-table",
11912
+ noHeader: "st-table--no-header",
11881
11913
  cell: "st-table__cell",
11882
- headerCell: "st-table__cell st-table__cell--header"
11914
+ headerCell: "st-table__cell st-table__cell--header",
11915
+ rowTextCell: "st-table__cell st-table__cell--row-text"
11883
11916
  },
11884
11917
  matrixdynamic: {
11885
11918
  mainRoot: "st-question st-row__question st-scrollable",
11886
11919
  root: "st-table st-matrixdynamic",
11920
+ noHeader: "st-table--no-header",
11887
11921
  cell: "st-table__cell",
11888
11922
  headerCell: "st-table__cell st-table__cell--header",
11923
+ rowTextCell: "st-table__cell st-table__cell--row-text",
11889
11924
  button: "st-btn",
11890
11925
  detailRow: "st-table__row st-table__row--detail",
11891
11926
  detailButton: "st-table__cell--detail-button",
@@ -12278,6 +12313,38 @@ var TranslationGroup = /** @class */ (function (_super) {
12278
12313
  TranslationGroup.prototype.setAsRoot = function () {
12279
12314
  this.isRootValue = true;
12280
12315
  };
12316
+ TranslationGroup.prototype.setParent = function (parent) {
12317
+ this.parentValue = parent;
12318
+ };
12319
+ Object.defineProperty(TranslationGroup.prototype, "parent", {
12320
+ get: function () { return this.parentValue; },
12321
+ enumerable: false,
12322
+ configurable: true
12323
+ });
12324
+ Object.defineProperty(TranslationGroup.prototype, "fullName", {
12325
+ get: function () {
12326
+ var propsName = this.obj.name === this.name || this.isRoot ? "_props" : "";
12327
+ var name = this.name + propsName;
12328
+ if (this.isRoot || !this.parent)
12329
+ return name;
12330
+ var parentName = this.parent.getNameForChild();
12331
+ return (!!parentName ? parentName + "_" : "") + name;
12332
+ },
12333
+ enumerable: false,
12334
+ configurable: true
12335
+ });
12336
+ TranslationGroup.prototype.getNameForChild = function () {
12337
+ if (this.isRoot)
12338
+ return "";
12339
+ return this.isFinalNameObj ? this.name : this.fullName;
12340
+ };
12341
+ Object.defineProperty(TranslationGroup.prototype, "isFinalNameObj", {
12342
+ get: function () {
12343
+ return this.obj.isQuestion || this.obj.isPage || this.obj.isPanel;
12344
+ },
12345
+ enumerable: false,
12346
+ configurable: true
12347
+ });
12281
12348
  TranslationGroup.prototype.getItemByName = function (name) {
12282
12349
  for (var i = 0; i < this.itemValues.length; i++) {
12283
12350
  if (this.itemValues[i].name == name)
@@ -12399,10 +12466,7 @@ var TranslationGroup = /** @class */ (function (_super) {
12399
12466
  //If ItemValue array?
12400
12467
  if (this.isItemValueArray(value)) {
12401
12468
  if (this.canShowProperty(property, Array.isArray(value) && value.length > 0)) {
12402
- var group = new TranslationGroup(property.name, value, this.translation, _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getPropertyName(property.name), true);
12403
- if (group.hasItems) {
12404
- this.itemValues.push(group);
12405
- }
12469
+ this.addNewGroup(new TranslationGroup(property.name, value, this.translation, _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getPropertyName(property.name), true));
12406
12470
  }
12407
12471
  }
12408
12472
  else {
@@ -12497,13 +12561,16 @@ var TranslationGroup = /** @class */ (function (_super) {
12497
12561
  name_1 = property.name + index;
12498
12562
  text = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getPropertyName(property.name) + index;
12499
12563
  }
12500
- var group = new TranslationGroup(name_1, obj, this.translation, text);
12501
- if (group.hasItems) {
12502
- this.itemValues.push(group);
12503
- }
12564
+ this.addNewGroup(new TranslationGroup(name_1, obj, this.translation, text));
12504
12565
  }
12505
12566
  }
12506
12567
  };
12568
+ TranslationGroup.prototype.addNewGroup = function (group) {
12569
+ group.setParent(this);
12570
+ if (group.hasItems) {
12571
+ this.itemValues.push(group);
12572
+ }
12573
+ };
12507
12574
  TranslationGroup.prototype.createItemValuesLocale = function () {
12508
12575
  for (var i = 0; i < this.obj.length; i++) {
12509
12576
  var val = this.obj[i];
@@ -12715,7 +12782,7 @@ var Translation = /** @class */ (function (_super) {
12715
12782
  survey.startLoadingFromJson();
12716
12783
  survey.css = _translation_theme__WEBPACK_IMPORTED_MODULE_8__["translationCss"];
12717
12784
  survey.addNewPage("page");
12718
- this.addTranslationGroupIntoStringsSurvey(survey.pages[0], this.root, null);
12785
+ this.addTranslationGroupIntoStringsSurvey(survey.pages[0], this.root);
12719
12786
  survey.data = this.getStringsSurveyData(survey);
12720
12787
  survey.endLoadingFromJson();
12721
12788
  var getTransationItem = function (question, rowName) {
@@ -12774,7 +12841,7 @@ var Translation = /** @class */ (function (_super) {
12774
12841
  survey.currentPage = survey.pages[0];
12775
12842
  return survey;
12776
12843
  };
12777
- Translation.prototype.addTranslationGroupIntoStringsSurvey = function (panel, group, parent) {
12844
+ Translation.prototype.addTranslationGroupIntoStringsSurvey = function (panel, group) {
12778
12845
  for (var i = 0; i < group.items.length; i++) {
12779
12846
  if (group.items[i].isGroup)
12780
12847
  continue;
@@ -12782,7 +12849,7 @@ var Translation = /** @class */ (function (_super) {
12782
12849
  var matrix = (survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].createClass("matrixdropdown"));
12783
12850
  matrix.cellType = "comment";
12784
12851
  matrix.titleLocation = "hidden";
12785
- matrix.name = this.getStringsSurveyQuestionName(group, parent) + i;
12852
+ matrix.name = group.fullName + i;
12786
12853
  matrix.showHeader = false;
12787
12854
  panel.addQuestion(matrix);
12788
12855
  this.addLocaleColumns(matrix);
@@ -12802,7 +12869,7 @@ var Translation = /** @class */ (function (_super) {
12802
12869
  if (item.hasIndent) {
12803
12870
  pnl.cssClasses.panel.content += " st-panel-indent";
12804
12871
  }
12805
- this.addTranslationGroupIntoStringsSurvey(pnl, item, group);
12872
+ this.addTranslationGroupIntoStringsSurvey(pnl, item);
12806
12873
  }
12807
12874
  };
12808
12875
  Translation.prototype.addLocaleColumns = function (matrix) {
@@ -12812,13 +12879,6 @@ var Translation = /** @class */ (function (_super) {
12812
12879
  matrix.addColumn(locs[i], this.getLocaleName(locs[i]));
12813
12880
  }
12814
12881
  };
12815
- Translation.prototype.getStringsSurveyQuestionName = function (group, parent) {
12816
- var name = group.name + (group.obj.name == group.name || group.isRoot ? "_props" : "");
12817
- if (!!parent && parent !== this.root) {
12818
- name = parent.name + "_" + name;
12819
- }
12820
- return name;
12821
- };
12822
12882
  Translation.prototype.getStringsSurveyData = function (survey) {
12823
12883
  var res = {};
12824
12884
  var questions = survey.getAllQuestions();
@@ -13275,7 +13335,7 @@ var ToolboxToolViewModel = /** @class */ (function (_super) {
13275
13335
  };
13276
13336
  _this.startDragToolboxItem = function (pointerDownEvent, currentTarget) {
13277
13337
  var json = _this.creator.getJSONForNewElement(_this.item.json);
13278
- _this.dragDropHelper.startDragToolboxItem(pointerDownEvent, json, _this.item.title);
13338
+ _this.dragDropHelper.startDragToolboxItem(pointerDownEvent, json, _this.item);
13279
13339
  return true;
13280
13340
  };
13281
13341
  _this.dragOrClickHelper = new survey_core__WEBPACK_IMPORTED_MODULE_1__["DragOrClickHelper"](_this.startDragToolboxItem);
@@ -15560,6 +15620,11 @@ var CreatorBase = /** @class */ (function (_super) {
15560
15620
  var selectedElement = this.getSelectedSurveyElement();
15561
15621
  if (selectedElement && selectedElement.parent && selectedElement["page"] == parent &&
15562
15622
  (selectedElement !== panel)) {
15623
+ if (!panel) {
15624
+ while (selectedElement.parent !== null && selectedElement.parent.isPanel) {
15625
+ selectedElement = selectedElement.parent;
15626
+ }
15627
+ }
15563
15628
  parent = selectedElement.parent;
15564
15629
  if (index < 0) {
15565
15630
  index = parent.elements.indexOf(selectedElement);
@@ -15767,6 +15832,13 @@ var CreatorBase = /** @class */ (function (_super) {
15767
15832
  this.selectElement(!!newPage ? newPage : this.survey);
15768
15833
  }
15769
15834
  else {
15835
+ if (this.isInitialSurveyEmpty && this.survey.pageCount === 1) {
15836
+ var page = this.survey.pages[0];
15837
+ if (page.elements.length === 1 && obj === page.elements[0]) {
15838
+ this.deleteObjectCore(page);
15839
+ return;
15840
+ }
15841
+ }
15770
15842
  this.deletePanelOrQuestion(obj);
15771
15843
  }
15772
15844
  this.setModified({
@@ -16162,7 +16234,7 @@ var CreatorBase = /** @class */ (function (_super) {
16162
16234
  if (obj["questions"]) {
16163
16235
  obj["questions"].forEach(function (q) { return _this.updateConditionsOnRemove(q); });
16164
16236
  }
16165
- obj["delete"]();
16237
+ obj["delete"](false);
16166
16238
  this.selectElement(objIndex > -1 ? elements[objIndex] : parent);
16167
16239
  };
16168
16240
  CreatorBase.prototype.onCanShowObjectProperty = function (object, property, showMode, parentObj, parentProperty) {
@@ -16798,7 +16870,7 @@ var CreatorBase = /** @class */ (function (_super) {
16798
16870
  })
16799
16871
  ], CreatorBase.prototype, "isCreatorDisposed", void 0);
16800
16872
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
16801
- Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
16873
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
16802
16874
  ], CreatorBase.prototype, "enableLinkFileEditor", void 0);
16803
16875
  return CreatorBase;
16804
16876
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Base"]));
@@ -18022,31 +18094,44 @@ var EditorLocalization = /** @class */ (function () {
18022
18094
  };
18023
18095
  EditorLocalization.prototype.getString = function (strName, locale) {
18024
18096
  if (locale === void 0) { locale = null; }
18097
+ if (!locale)
18098
+ locale = this.currentLocale;
18025
18099
  var loc = this.getLocale(locale);
18026
18100
  var defaultLocale = this.getLocale("en");
18027
- var path = strName.split(".");
18028
- var obj = loc;
18029
- for (var i = 0; i < path.length; i++) {
18030
- obj = obj[path[i]];
18031
- if (!obj && obj !== "") {
18032
- if (loc === defaultLocale)
18033
- return path[i];
18034
- return this.getString(strName, "en");
18035
- }
18101
+ var locs = [];
18102
+ if (!!loc)
18103
+ locs.push(loc);
18104
+ if (!!locale && locale.indexOf("-") > -1) {
18105
+ var baseLocale = this.getLocale(locale.substring(0, locale.indexOf("-")));
18106
+ if (!!baseLocale)
18107
+ locs.push(baseLocale);
18036
18108
  }
18037
- return obj;
18109
+ if (locs.length === 0 || locs[locs.length - 1] !== defaultLocale) {
18110
+ locs.push(defaultLocale);
18111
+ }
18112
+ for (var i = 0; i < locs.length; i++) {
18113
+ var res = this.getStringByLocale(strName, locs[i]);
18114
+ if (!!res || res === "")
18115
+ return res;
18116
+ }
18117
+ var path = strName.split(".");
18118
+ return path[path.length - 1];
18038
18119
  };
18039
18120
  EditorLocalization.prototype.hasString = function (strName, locale) {
18040
18121
  if (locale === void 0) { locale = null; }
18041
- var loc = this.getLocale(locale);
18122
+ return this.getStringByLocale(strName, this.getLocale(locale)) !== undefined;
18123
+ };
18124
+ EditorLocalization.prototype.getStringByLocale = function (strName, loc) {
18042
18125
  var path = strName.split(".");
18043
18126
  var obj = loc;
18044
18127
  for (var i = 0; i < path.length; i++) {
18128
+ if (typeof obj === "string")
18129
+ return undefined;
18045
18130
  obj = obj[path[i]];
18046
18131
  if (!obj && obj !== "")
18047
- return false;
18132
+ return undefined;
18048
18133
  }
18049
- return true;
18134
+ return obj;
18050
18135
  };
18051
18136
  EditorLocalization.prototype.getLocaleName = function (loc, defaultLocale) {
18052
18137
  if (defaultLocale === void 0) { defaultLocale = null; }
@@ -18240,10 +18325,7 @@ var EditorLocalization = /** @class */ (function () {
18240
18325
  if (value === "" || value === null || value === undefined)
18241
18326
  return "";
18242
18327
  value = value.toString();
18243
- var loc = this.getLocale(locale);
18244
- var res = loc[prefix] ? loc[prefix][value] : null;
18245
- if (!res)
18246
- res = defaultStrings[prefix][value];
18328
+ var res = this.getString(prefix + "." + value, locale);
18247
18329
  if (!!res)
18248
18330
  return res;
18249
18331
  return this.camelCaseBreaking
@@ -18820,7 +18902,7 @@ __webpack_require__.r(__webpack_exports__);
18820
18902
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! survey-core */ "survey-core");
18821
18903
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_69___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_69__);
18822
18904
  var Version;
18823
- Version = "" + "1.9.103";
18905
+ Version = "" + "1.9.105";
18824
18906
  //should be loaded before other styles for easier override
18825
18907
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
18826
18908
 
@@ -18908,7 +18990,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
18908
18990
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
18909
18991
 
18910
18992
  survey_core__WEBPACK_IMPORTED_MODULE_69__["settings"].supportCreatorV2 = true;
18911
- Object(survey_core__WEBPACK_IMPORTED_MODULE_69__["checkLibraryVersion"])("" + "1.9.103", "survey-creator-core");
18993
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_69__["checkLibraryVersion"])("" + "1.9.105", "survey-creator-core");
18912
18994
 
18913
18995
 
18914
18996
  /***/ }),
@@ -21134,6 +21216,7 @@ var enStrings = {
21134
21216
  translationPlaceHolder: "Translation...",
21135
21217
  themeExportButton: "Export",
21136
21218
  themeImportButton: "Import",
21219
+ themeResetButton: "Reset theme settings to default",
21137
21220
  bold: "Bold",
21138
21221
  italic: "Italic",
21139
21222
  underline: "Underline",
@@ -22013,6 +22096,7 @@ var enStrings = {
22013
22096
  fontFamily: "Font family",
22014
22097
  fontSize: "Font size",
22015
22098
  color: "Color",
22099
+ placeholderColor: "Placeholder color",
22016
22100
  size: "Size",
22017
22101
  fontWeightRegular: "Regular",
22018
22102
  fontWeightHeavy: "Heavy",
@@ -25285,7 +25369,8 @@ var PropertyJSONGenerator = /** @class */ (function () {
25285
25369
  };
25286
25370
  if (!!overridingQuestion) {
25287
25371
  linkValue.linkClickCallback = function () {
25288
- overridingQuestion.focus();
25372
+ //Focus and aways scroll into view
25373
+ overridingQuestion.focus(false, true);
25289
25374
  };
25290
25375
  }
25291
25376
  return linkValue;
@@ -25409,6 +25494,9 @@ var PropertyJSONGenerator = /** @class */ (function () {
25409
25494
  if (json.cellType === "buttongroup") {
25410
25495
  json.cellType = "dropdown";
25411
25496
  }
25497
+ if (json.cellType === "fileedit") {
25498
+ json.cellType = "text";
25499
+ }
25412
25500
  if (!!prop.visibleIf) {
25413
25501
  json.visibleIf = "propertyVisibleIf() = true";
25414
25502
  }
@@ -25605,8 +25693,8 @@ var PropertyGridModel = /** @class */ (function () {
25605
25693
  });
25606
25694
  this.survey.onUploadFiles.add(function (_, options) {
25607
25695
  var callback = function (status, data) { return options.callback(status, [{ content: data, file: options.files[0] }]); };
25608
- var obj = options.question.obj.getType() == "image" ? options.question.obj : (options.question.obj.getType() == "imageitemvalue" ? options.question.obj.locOwner : undefined);
25609
- _this.options.uploadFiles(options.files, obj, callback);
25696
+ var question = options.question.obj.getType() == "survey" ? undefined : (options.question.obj.getType() == "imageitemvalue" ? options.question.obj.locOwner : options.question.obj);
25697
+ _this.options.uploadFiles(options.files, question, callback);
25610
25698
  });
25611
25699
  this.survey.getAllQuestions().map(function (q) { return q.allowRootStyle = false; });
25612
25700
  this.survey.onQuestionCreated.add(function (_, opt) {
@@ -26021,19 +26109,23 @@ var PropertyGridLinkEditor = /** @class */ (function (_super) {
26021
26109
  return _super !== null && _super.apply(this, arguments) || this;
26022
26110
  }
26023
26111
  PropertyGridLinkEditor.prototype.fit = function (prop) {
26024
- return ["logo", "imageLink"].indexOf(prop.name) > -1;
26112
+ return ["logo", "imageLink", "backgroundImage"].indexOf(prop.name) > -1;
26025
26113
  };
26026
26114
  PropertyGridLinkEditor.prototype.getJSON = function (obj, prop, options) {
26027
- var res = { type: "fileedit", storeDataAsText: false, };
26115
+ var _a;
26116
+ var maxSize = ((_a = options.onUploadFile) === null || _a === void 0 ? void 0 : _a.isEmpty) ? 65536 : undefined;
26117
+ var res = { type: "fileedit", storeDataAsText: false, maxSize: maxSize };
26028
26118
  return res;
26029
26119
  };
26030
26120
  PropertyGridLinkEditor.prototype.onCreated = function (obj, question, prop, options) {
26031
- if (["image"].indexOf(obj.getType()) > -1) {
26032
- var questionObj = obj;
26033
- questionObj.registerFunctionOnPropertyValueChanged("contentMode", function (newValue) {
26034
- question.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["getAcceptedTypesByContentMode"])(newValue);
26035
- });
26036
- question.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["getAcceptedTypesByContentMode"])(questionObj.contentMode);
26121
+ if (["image", "imageitemvalue"].indexOf(obj.getType()) > -1) {
26122
+ var questionObj = obj.getType() == "imageitemvalue" ? obj.locOwner : obj;
26123
+ if (questionObj) {
26124
+ questionObj.registerFunctionOnPropertyValueChanged("contentMode", function (newValue) {
26125
+ question.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["getAcceptedTypesByContentMode"])(newValue);
26126
+ });
26127
+ question.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["getAcceptedTypesByContentMode"])(questionObj.contentMode);
26128
+ }
26037
26129
  }
26038
26130
  else {
26039
26131
  question.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["getAcceptedTypesByContentMode"])("image");
@@ -26549,14 +26641,6 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
26549
26641
  matrix.dragDropMatrixRows.onDragEnd.add(function () { options.stopUndoRedoTransaction(); });
26550
26642
  }
26551
26643
  };
26552
- PropertyGridEditorMatrix.prototype.initializeAcceptedTypes = function (obj, cellQuestion) {
26553
- if (obj.getType() === "imagepicker" && cellQuestion.name == "imageLink" && cellQuestion.getType() == "fileedit") {
26554
- obj.registerFunctionOnPropertyValueChanged("contentMode", function (newValue) {
26555
- cellQuestion.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["getAcceptedTypesByContentMode"])(newValue);
26556
- });
26557
- cellQuestion.acceptedTypes = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["getAcceptedTypesByContentMode"])(obj.contentMode);
26558
- }
26559
- };
26560
26644
  PropertyGridEditorMatrix.prototype.initializePlaceholder = function (rowObj, cellQuestion, propertyName) {
26561
26645
  var objType = typeof rowObj.getType === "function" && rowObj.getType();
26562
26646
  if (cellQuestion.getType() === "text" && !!objType) {
@@ -26582,7 +26666,6 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
26582
26666
  return;
26583
26667
  var q = options.cellQuestion;
26584
26668
  q.obj = rowObj;
26585
- this.initializeAcceptedTypes(obj, q);
26586
26669
  this.initializePlaceholder(rowObj, q, options.columnName);
26587
26670
  q.property = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(rowObj.getType(), options.columnName);
26588
26671
  };
@@ -26661,6 +26744,7 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
26661
26744
  });
26662
26745
  };
26663
26746
  PropertyGridEditorMatrix.prototype.createNewItem = function (matrix, prop) {
26747
+ matrix.visibleRows.forEach(function (row) { return row.hideDetailPanel(); });
26664
26748
  var json = {};
26665
26749
  var baseValue = this.getBaseValue(prop);
26666
26750
  var keyPropName = this.getKeyValue();
@@ -28150,6 +28234,7 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28150
28234
  { name: "state", tab: "layout" },
28151
28235
  { name: "titleLocation", tab: "layout" },
28152
28236
  { name: "descriptionLocation", tab: "layout" },
28237
+ { name: "errorLocation", tab: "layout" },
28153
28238
  { name: "indent", tab: "layout" },
28154
28239
  { name: "width", tab: "layout" },
28155
28240
  { name: "minWidth", tab: "layout" },
@@ -28211,7 +28296,9 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28211
28296
  { name: "columnLayout", tab: "layout" },
28212
28297
  { name: "horizontalScroll", tab: "layout" },
28213
28298
  { name: "columnColCount", tab: "layout" },
28214
- { name: "columnMinWidth", tab: "layout" }
28299
+ { name: "columnMinWidth", tab: "layout" },
28300
+ { name: "cellErrorLocation", tab: "layout" },
28301
+ { name: "detailErrorLocation", tab: "layout" }
28215
28302
  ],
28216
28303
  tabs: [
28217
28304
  { name: "columns", index: 10 },
@@ -28274,7 +28361,8 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28274
28361
  multipletext: {
28275
28362
  properties: [
28276
28363
  { name: "colCount", tab: "layout" },
28277
- { name: "itemSize", tab: "layout" }
28364
+ { name: "itemSize", tab: "layout" },
28365
+ { name: "itemErrorLocation", tab: "layout" }
28278
28366
  ],
28279
28367
  tabs: [{ name: "items", index: 10 }]
28280
28368
  },
@@ -28441,6 +28529,7 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28441
28529
  "cellType",
28442
28530
  "name",
28443
28531
  "title",
28532
+ "visible",
28444
28533
  "isRequired",
28445
28534
  "readOnly",
28446
28535
  "isUnique",
@@ -28620,6 +28709,7 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28620
28709
  { name: "defaultPanelValue", tab: "data" },
28621
28710
  { name: "defaultValueFromLastPanel", tab: "data" },
28622
28711
  { name: "templateTitleLocation", tab: "layout" },
28712
+ { name: "templateErrorLocation", tab: "layout" },
28623
28713
  { name: "panelRemoveButtonLocation", tab: "layout" },
28624
28714
  { name: "keyName", tab: "validation" },
28625
28715
  { name: "keyDuplicationError", tab: "validation" }
@@ -28635,7 +28725,8 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
28635
28725
  { name: "visibleIf", tab: "logic" },
28636
28726
  { name: "enableIf", tab: "logic" },
28637
28727
  { name: "requiredIf", tab: "logic" },
28638
- { name: "questionTitleLocation", tab: "layout" }
28728
+ { name: "questionTitleLocation", tab: "layout" },
28729
+ { name: "questionErrorLocation", tab: "layout" }
28639
28730
  ],
28640
28731
  tabs: [
28641
28732
  { name: "logic", index: 100 },
@@ -29270,9 +29361,16 @@ var QuestionConverter = /** @class */ (function () {
29270
29361
  if (survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(convertToClass, "matrixdropdownbase") &&
29271
29362
  survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(convertFromClass, "matrix") &&
29272
29363
  json.columns) {
29273
- json.columns = json.columns.map(function (col) { return ({ name: col.value || col, title: col.text }); });
29364
+ json.columns = json.columns.map(function (col) { return ({
29365
+ name: QuestionConverter.getColumnName(col.value || col), title: col.text
29366
+ }); });
29274
29367
  }
29275
29368
  };
29369
+ QuestionConverter.getColumnName = function (val) {
29370
+ if (survey_core__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(val))
29371
+ return "col" + val;
29372
+ return val;
29373
+ };
29276
29374
  QuestionConverter.updateJSONForRating = function (json, convertToClass, defaultJSON) {
29277
29375
  if (convertToClass === "rating" && json.choices) {
29278
29376
  if (!defaultJSON || !defaultJSON.choices ||
@@ -29641,10 +29739,11 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
29641
29739
  });
29642
29740
  // private isRight: boolean;
29643
29741
  // protected prevIsRight: boolean;
29644
- DragDropSurveyElements.prototype.startDragToolboxItem = function (event, draggedElementJson, toolboxItemTitle) {
29742
+ DragDropSurveyElements.prototype.startDragToolboxItem = function (event, draggedElementJson, toolboxItemModel) {
29645
29743
  var preventSaveTargetNode = true;
29646
29744
  var draggedElement = this.createElementFromJson(draggedElementJson);
29647
- draggedElement.toolboxItemTitle = toolboxItemTitle;
29745
+ draggedElement.toolboxItemTitle = toolboxItemModel.title;
29746
+ draggedElement.toolboxItemIconName = toolboxItemModel.iconName;
29648
29747
  this.startDrag(event, draggedElement, null, null, preventSaveTargetNode);
29649
29748
  };
29650
29749
  DragDropSurveyElements.prototype.startDragSurveyElement = function (event, draggedElement, isElementSelected) {
@@ -29666,8 +29765,8 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
29666
29765
  };
29667
29766
  DragDropSurveyElements.prototype.createDraggedElementIcon = function () {
29668
29767
  var span = document.createElement("span");
29669
- var type = this.draggedElement.getType();
29670
- var svgString = "<svg class=\"sv-svg-icon\" role=\"img\" style=\"width: 24px; height: 24px;\"><use xlink:href=\"#icon-" + type + "\"></use></svg>";
29768
+ var iconName = this.draggedElement.toolboxItemIconName;
29769
+ var svgString = "<svg class=\"sv-svg-icon\" role=\"img\" style=\"width: 24px; height: 24px;\"><use xlink:href=\"#" + iconName + "\"></use></svg>";
29671
29770
  span.className = "svc-dragged-element-shortcut__icon";
29672
29771
  span.innerHTML = svgString;
29673
29772
  return span;
@@ -30813,7 +30912,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
30813
30912
  var json = _this.creator.getJSONForNewElement(itemModel.json);
30814
30913
  _this.dotsItem.popupModel.toggleVisibility();
30815
30914
  (_a = _this.creator) === null || _a === void 0 ? void 0 : _a.onDragDropItemStart();
30816
- _this.dragDropHelper.startDragToolboxItem(pointerDownEvent, json, itemModel.title);
30915
+ _this.dragDropHelper.startDragToolboxItem(pointerDownEvent, json, itemModel);
30817
30916
  });
30818
30917
  this.hiddenItemsListModel.onPointerDown = function (pointerDownEvent, item) {
30819
30918
  if (!_this.creator.readOnly) {
@@ -30947,13 +31046,15 @@ var QuestionToolbox = /** @class */ (function (_super) {
30947
31046
  var name = !!options.name ? options.name : question.name;
30948
31047
  var title = !!options.title ? options.title : name;
30949
31048
  var tooltip = !!options.tooltip ? options.tooltip : title;
31049
+ var iconName = !!options.iconName ? options.iconName : QuestionToolbox.defaultIconName;
30950
31050
  var item = {
30951
31051
  id: name,
30952
31052
  name: name,
30953
31053
  title: title,
30954
31054
  tooltip: tooltip,
31055
+ className: "svc-toolbox__item svc-toolbox__item--" + iconName,
30955
31056
  isCopied: options.isCopied !== false,
30956
- iconName: !!options.iconName ? options.iconName : QuestionToolbox.defaultIconName,
31057
+ iconName: iconName,
30957
31058
  json: !!options.json ? options.json : this.getQuestionJSON(question),
30958
31059
  category: !!options.category ? options.category : ""
30959
31060
  };
@@ -31323,12 +31424,14 @@ var QuestionToolbox = /** @class */ (function (_super) {
31323
31424
  }
31324
31425
  var json = this.getQuestionJSON(question);
31325
31426
  var title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("qt." + name);
31427
+ var iconName = "icon-" + name;
31326
31428
  var item = {
31327
31429
  id: name,
31328
31430
  name: name,
31329
- iconName: "icon-" + name,
31431
+ iconName: iconName,
31330
31432
  title: title,
31331
31433
  tooltip: title,
31434
+ className: "svc-toolbox__item svc-toolbox__item--" + iconName,
31332
31435
  json: json,
31333
31436
  isCopied: false,
31334
31437
  category: (defaultCategories[name] || "")