survey-creator-core 1.9.120 → 1.9.121

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 (75) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1 -1
  4. package/i18n/arabic.min.js +1 -1
  5. package/i18n/bulgarian.js +1 -1
  6. package/i18n/bulgarian.min.js +1 -1
  7. package/i18n/croatian.js +1 -1
  8. package/i18n/croatian.min.js +1 -1
  9. package/i18n/czech.js +1 -1
  10. package/i18n/czech.min.js +1 -1
  11. package/i18n/danish.js +1 -1
  12. package/i18n/danish.min.js +1 -1
  13. package/i18n/dutch.js +1 -1
  14. package/i18n/dutch.min.js +1 -1
  15. package/i18n/english.js +1 -1
  16. package/i18n/english.min.js +1 -1
  17. package/i18n/finnish.js +1 -1
  18. package/i18n/finnish.min.js +1 -1
  19. package/i18n/french.js +1 -1
  20. package/i18n/french.min.js +1 -1
  21. package/i18n/german.js +1 -1
  22. package/i18n/german.min.js +1 -1
  23. package/i18n/hungarian.js +1 -1
  24. package/i18n/hungarian.min.js +1 -1
  25. package/i18n/index.js +1 -1
  26. package/i18n/index.min.js +1 -1
  27. package/i18n/indonesian.js +1 -1
  28. package/i18n/indonesian.min.js +1 -1
  29. package/i18n/italian.js +1 -1
  30. package/i18n/italian.min.js +1 -1
  31. package/i18n/japanese.js +1 -1
  32. package/i18n/japanese.min.js +1 -1
  33. package/i18n/korean.js +1 -1
  34. package/i18n/korean.min.js +1 -1
  35. package/i18n/malay.js +1 -1
  36. package/i18n/malay.min.js +1 -1
  37. package/i18n/mongolian.js +1 -1
  38. package/i18n/mongolian.min.js +1 -1
  39. package/i18n/norwegian.js +1 -1
  40. package/i18n/norwegian.min.js +1 -1
  41. package/i18n/persian.js +1 -1
  42. package/i18n/persian.min.js +1 -1
  43. package/i18n/polish.js +1 -1
  44. package/i18n/polish.min.js +1 -1
  45. package/i18n/portuguese.js +1 -1
  46. package/i18n/portuguese.min.js +1 -1
  47. package/i18n/russian.js +1 -1
  48. package/i18n/russian.min.js +1 -1
  49. package/i18n/simplified-chinese.js +1 -1
  50. package/i18n/simplified-chinese.min.js +1 -1
  51. package/i18n/slovak.js +1 -1
  52. package/i18n/slovak.min.js +1 -1
  53. package/i18n/spanish.js +1 -1
  54. package/i18n/spanish.min.js +1 -1
  55. package/i18n/swedish.js +1 -1
  56. package/i18n/swedish.min.js +1 -1
  57. package/i18n/tajik.js +1 -1
  58. package/i18n/tajik.min.js +1 -1
  59. package/i18n/traditional-chinese.js +1 -1
  60. package/i18n/traditional-chinese.min.js +1 -1
  61. package/i18n/turkish.js +1 -1
  62. package/i18n/turkish.min.js +1 -1
  63. package/package.json +2 -2
  64. package/survey-creator-core.css +7 -3
  65. package/survey-creator-core.fontless.css +6 -2
  66. package/survey-creator-core.fontless.css.map +1 -1
  67. package/survey-creator-core.fontless.min.css +3 -3
  68. package/survey-creator-core.i18n.js +1 -1
  69. package/survey-creator-core.i18n.min.js +1 -1
  70. package/survey-creator-core.js +76 -27
  71. package/survey-creator-core.js.map +1 -1
  72. package/survey-creator-core.min.css +4 -4
  73. package/survey-creator-core.min.js +3 -3
  74. package/typings/components/action-container-view-model.d.ts +2 -2
  75. package/typings/components/question.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.120
2
+ * SurveyJS Creator v1.9.121
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
@@ -130,7 +130,7 @@ License: MIT
130
130
  /***/ (function(module, exports, __webpack_require__) {
131
131
 
132
132
  /*!
133
- * surveyjs - Survey JavaScript library v1.9.120
133
+ * surveyjs - Survey JavaScript library v1.9.121
134
134
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
135
135
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
136
136
  */
@@ -4549,20 +4549,37 @@ var SurveyElementActionContainer = /** @class */ (function (_super) {
4549
4549
  function SurveyElementActionContainer() {
4550
4550
  return _super !== null && _super.apply(this, arguments) || this;
4551
4551
  }
4552
- SurveyElementActionContainer.prototype.setModeForActions = function (modes, defaultMode) {
4553
- this.visibleActions.forEach(function (action) {
4554
- action.mode = modes[action.id] || defaultMode;
4555
- });
4552
+ SurveyElementActionContainer.prototype.needToShrink = function (item, shrinkStart, shrinkEnd) {
4553
+ return (item.innerItem.location == "start" && shrinkStart || item.innerItem.location != "start" && shrinkEnd);
4556
4554
  };
4557
- SurveyElementActionContainer.prototype.skipInputType = function (item, dimension) {
4558
- return item.id != "convertInputType" ? dimension : 0;
4555
+ SurveyElementActionContainer.prototype.setModeForActions = function (shrinkStart, shrinkEnd, exclude) {
4556
+ var _this = this;
4557
+ if (exclude === void 0) { exclude = []; }
4558
+ this.visibleActions.forEach(function (item) {
4559
+ if (exclude.indexOf(item.id) != -1) {
4560
+ item.mode = "removed";
4561
+ return;
4562
+ }
4563
+ if (_this.needToShrink(item, shrinkStart, shrinkEnd)) {
4564
+ item.mode = item.innerItem.iconName ? "small" : "removed";
4565
+ return;
4566
+ }
4567
+ item.mode = "large";
4568
+ });
4559
4569
  };
4560
- SurveyElementActionContainer.prototype.skipQuestionType = function (item, dimension) {
4561
- return item.id != "convertInputType" && item.id != "convertTo" ? dimension : 0;
4570
+ SurveyElementActionContainer.prototype.calcItemSize = function (item, shrinkStart, shrinkEnd, exclude) {
4571
+ if (exclude === void 0) { exclude = []; }
4572
+ if (exclude.indexOf(item.id) != -1)
4573
+ return 0;
4574
+ if (this.needToShrink(item, shrinkStart, shrinkEnd)) {
4575
+ if (!item.innerItem.iconName)
4576
+ return 0;
4577
+ return item.minDimension;
4578
+ }
4579
+ return item.maxDimension;
4562
4580
  };
4563
4581
  SurveyElementActionContainer.prototype.fit = function (dimension, dotsItemSize) {
4564
4582
  var _this = this;
4565
- var _a;
4566
4583
  if (dimension <= 0)
4567
4584
  return;
4568
4585
  this.dotsItem.visible = false;
@@ -4571,19 +4588,33 @@ var SurveyElementActionContainer = /** @class */ (function (_super) {
4571
4588
  items.forEach(function (i) { return i.mode = "large"; });
4572
4589
  return;
4573
4590
  }
4574
- if (dimension >= items.reduce(function (sum, i) { return sum += _this.skipInputType(i, i.maxDimension); }, 0)) {
4575
- this.setModeForActions({ "convertInputType": "removed" }, "large");
4591
+ // if (dimension >= items.reduce((sum, i) => sum += this.skipInputType(i, i.maxDimension), 0)) {
4592
+ // this.setModeForActions({ "convertInputType": "removed" }, "large");
4593
+ // return;
4594
+ // }
4595
+ if (dimension >= items.reduce(function (sum, i) { return sum += _this.calcItemSize(i, false, true); }, 0)) {
4596
+ this.setModeForActions(false, true);
4576
4597
  return;
4577
4598
  }
4578
- if (dimension >= items.reduce(function (sum, i) { return sum += _this.skipQuestionType(i, i.minDimension); }, (_a = this.getActionById("convertTo")) === null || _a === void 0 ? void 0 : _a.maxDimension)) {
4579
- this.setModeForActions({ "convertInputType": "removed", "convertTo": "large" }, "small");
4599
+ if (dimension >= items.reduce(function (sum, i) { return sum += _this.calcItemSize(i, false, true, ["convertInputType"]); }, 0)) {
4600
+ this.setModeForActions(false, true, ["convertInputType"]);
4580
4601
  return;
4581
4602
  }
4582
- if (dimension >= items.reduce(function (sum, i) { return sum += _this.skipInputType(i, i.minDimension); }, 0)) {
4583
- this.setModeForActions({ "convertInputType": "removed", "convertTo": "small" }, "small");
4603
+ if (dimension >= items.reduce(function (sum, i) { return sum += _this.calcItemSize(i, true, true); }, 0)) {
4604
+ this.setModeForActions(true, true);
4584
4605
  return;
4585
4606
  }
4586
- this.setModeForActions({ "convertInputType": "removed", "convertTo": "small" }, "popup");
4607
+ this.visibleActions.forEach(function (item) {
4608
+ if (item.id == "convertTo") {
4609
+ item.mode = "small";
4610
+ return;
4611
+ }
4612
+ if (item.id == "convertInputType") {
4613
+ item.mode = "removed";
4614
+ return;
4615
+ }
4616
+ item.mode = "popup";
4617
+ });
4587
4618
  this.dotsItem.visible = true;
4588
4619
  this.hiddenItemsListModel.setItems(items.filter(function (i) { return i.mode == "popup"; }).map(function (i) { return i.innerItem; }));
4589
4620
  };
@@ -5010,8 +5041,10 @@ var ImageItemValueWrapperViewModel = /** @class */ (function (_super) {
5010
5041
  var fileInput = model.itemsRoot.getElementsByClassName("svc-choose-file-input")[0];
5011
5042
  model.creator.chooseFiles(fileInput, function (files) {
5012
5043
  model.isUploading = true;
5013
- model.creator.uploadFiles(files, model.question, function (_, link) {
5014
- model.item.imageLink = link;
5044
+ model.creator.uploadFiles(files, model.question, function (status, link) {
5045
+ if (status === "success") {
5046
+ model.item.imageLink = link;
5047
+ }
5015
5048
  model.isUploading = false;
5016
5049
  });
5017
5050
  }, { element: model.question, item: model.item });
@@ -5019,10 +5052,12 @@ var ImageItemValueWrapperViewModel = /** @class */ (function (_super) {
5019
5052
  ImageItemValueWrapperViewModel.prototype.uploadFiles = function (files) {
5020
5053
  var _this = this;
5021
5054
  this.isUploading = true;
5022
- this.creator.uploadFiles(files, this.question, function (_, link) {
5023
- _this.creator.createNewItemValue(_this.question, _this.isChoosingNewFile, function (res) {
5024
- res.imageLink = link;
5025
- });
5055
+ this.creator.uploadFiles(files, this.question, function (status, link) {
5056
+ if (status === "success") {
5057
+ _this.creator.createNewItemValue(_this.question, _this.isChoosingNewFile, function (res) {
5058
+ res.imageLink = link;
5059
+ });
5060
+ }
5026
5061
  _this.isChoosingNewFile = false;
5027
5062
  _this.isUploading = false;
5028
5063
  });
@@ -7009,6 +7044,19 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7009
7044
  //this.updateActionsProperties();
7010
7045
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["toggleHovered"])(event, element);
7011
7046
  };
7047
+ QuestionAdornerViewModel.prototype.updateActionsProperties = function () {
7048
+ if (this.isDisposed)
7049
+ return;
7050
+ _super.prototype.updateActionsProperties.call(this);
7051
+ var actions = this.actionContainer.visibleActions;
7052
+ var switchToStartLocation = false;
7053
+ for (var i = actions.length - 1; i >= 0; i--) {
7054
+ if (actions[i].id === "convertTo")
7055
+ switchToStartLocation = true;
7056
+ if (!actions[i].innerItem.location)
7057
+ actions[i].innerItem.location = switchToStartLocation ? "start" : "end";
7058
+ }
7059
+ };
7012
7060
  QuestionAdornerViewModel.prototype.updateElementAllowOptions = function (options, operationsAllow) {
7013
7061
  _super.prototype.updateElementAllowOptions.call(this, options, operationsAllow);
7014
7062
  this.updateActionVisibility("convertTo", operationsAllow && options.allowChangeType);
@@ -7155,12 +7203,13 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7155
7203
  var newAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
7156
7204
  id: id,
7157
7205
  css: "sv-action--convertTo sv-action-bar-item--secondary",
7158
- iconName: (_a = this.creator.toolbox.getItemByName(this.element.getType())) === null || _a === void 0 ? void 0 : _a.iconName,
7206
+ iconName: id == "convertTo" ? (_a = this.creator.toolbox.getItemByName(this.element.getType())) === null || _a === void 0 ? void 0 : _a.iconName : undefined,
7159
7207
  iconSize: 24,
7160
7208
  title: actionTitle,
7161
7209
  enabled: enabled,
7162
7210
  visibleIndex: index,
7163
7211
  disableShrink: false,
7212
+ location: "start",
7164
7213
  action: function (newType) {
7165
7214
  },
7166
7215
  }, {
@@ -25702,7 +25751,7 @@ __webpack_require__.r(__webpack_exports__);
25702
25751
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! survey-core */ "survey-core");
25703
25752
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_72___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_72__);
25704
25753
  var Version;
25705
- Version = "" + "1.9.120";
25754
+ Version = "" + "1.9.121";
25706
25755
  //should be loaded before other styles for easier override
25707
25756
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
25708
25757
 
@@ -25793,7 +25842,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
25793
25842
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
25794
25843
 
25795
25844
  survey_core__WEBPACK_IMPORTED_MODULE_72__["settings"].supportCreatorV2 = true;
25796
- Object(survey_core__WEBPACK_IMPORTED_MODULE_72__["checkLibraryVersion"])("" + "1.9.120", "survey-creator-core");
25845
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_72__["checkLibraryVersion"])("" + "1.9.121", "survey-creator-core");
25797
25846
 
25798
25847
 
25799
25848
  /***/ }),