survey-react 1.9.84 → 1.9.86

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.9.84
2
+ * surveyjs - Survey JavaScript library v1.9.86
3
3
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1278,9 +1278,11 @@ function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOpti
1278
1278
  var newActionOptions = Object.assign({}, actionOptions, {
1279
1279
  component: "sv-action-bar-item-dropdown",
1280
1280
  popupModel: innerPopupModel,
1281
- action: function () {
1281
+ action: function (action, isUserAction) {
1282
1282
  !!(actionOptions.action) && actionOptions.action();
1283
+ innerPopupModel.isFocusedContent = !isUserAction || listModel.showFilter;
1283
1284
  innerPopupModel.toggleVisibility();
1285
+ listModel.scrollToSelectedItem();
1284
1286
  },
1285
1287
  });
1286
1288
  var newAction = new Action(newActionOptions);
@@ -1356,7 +1358,7 @@ var BaseAction = /** @class */ (function (_super) {
1356
1358
  });
1357
1359
  Object.defineProperty(BaseAction.prototype, "isVisible", {
1358
1360
  get: function () {
1359
- return this.visible && this.mode !== "popup";
1361
+ return this.visible && this.mode !== "popup" && this.mode !== "removed";
1360
1362
  },
1361
1363
  enumerable: false,
1362
1364
  configurable: true
@@ -1411,6 +1413,12 @@ var BaseAction = /** @class */ (function (_super) {
1411
1413
  BaseAction.prototype.getTooltip = function () {
1412
1414
  return this.tooltip || this.title;
1413
1415
  };
1416
+ BaseAction.prototype.getIsTrusted = function (args) {
1417
+ if (!!args.originalEvent) {
1418
+ return args.originalEvent.isTrusted;
1419
+ }
1420
+ return args.isTrusted;
1421
+ };
1414
1422
  __decorate([
1415
1423
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
1416
1424
  ], BaseAction.prototype, "tooltip", void 0);
@@ -1748,6 +1756,16 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1748
1756
  items[index].mode = "large";
1749
1757
  }
1750
1758
  }
1759
+ if (itemsSize > availableSize) {
1760
+ var hidableItems = this.visibleActions.filter(function (a) { return a.removePriority; });
1761
+ hidableItems.sort(function (a, b) { return a.removePriority - b.removePriority; });
1762
+ for (var index = 0; index < hidableItems.length; index++) {
1763
+ if (itemsSize > availableSize) {
1764
+ itemsSize -= items[index].disableShrink ? hidableItems[index].maxDimension : hidableItems[index].minDimension;
1765
+ hidableItems[index].mode = "removed";
1766
+ }
1767
+ }
1768
+ }
1751
1769
  };
1752
1770
  Object.defineProperty(AdaptiveActionContainer.prototype, "hiddenItemsListModel", {
1753
1771
  get: function () {
@@ -2560,6 +2578,9 @@ var Base = /** @class */ (function () {
2560
2578
  if (defaultValue === void 0) { defaultValue = null; }
2561
2579
  var res = this.getPropertyValueCore(this.propertyHash, name);
2562
2580
  if (this.isPropertyEmpty(res)) {
2581
+ var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;
2582
+ if (locStr)
2583
+ return locStr.text;
2563
2584
  if (defaultValue != null)
2564
2585
  return defaultValue;
2565
2586
  var propDefaultValue = this.getDefaultValueFromProperty(name);
@@ -4930,6 +4951,7 @@ var modernCss = {
4930
4951
  slider: "sv-boolean__slider",
4931
4952
  label: "sv-boolean__label",
4932
4953
  disabledLabel: "sv-boolean__label--disabled",
4954
+ sliderGhost: "sv-boolean__thumb-ghost",
4933
4955
  //checkbox
4934
4956
  rootCheckbox: "sv_qbln",
4935
4957
  checkboxItem: "sv-boolean sv-item",
@@ -5270,6 +5292,7 @@ var defaultStandardCss = {
5270
5292
  slider: "sv-boolean__slider",
5271
5293
  label: "sv-boolean__label ",
5272
5294
  disabledLabel: "sv-boolean__label--disabled",
5295
+ sliderGhost: "sv-boolean__thumb-ghost",
5273
5296
  //checkbox
5274
5297
  rootCheckbox: "sv_qcbc sv_qbln",
5275
5298
  checkboxItem: "sv-boolean",
@@ -5641,6 +5664,7 @@ var defaultV2Css = {
5641
5664
  nested: "sd-element--nested",
5642
5665
  invisible: "sd-element--invisible",
5643
5666
  navigationButton: "",
5667
+ compact: "sd-element--with-frame sd-element--compact"
5644
5668
  },
5645
5669
  paneldynamic: {
5646
5670
  mainRoot: "sd-element sd-question sd-question--paneldynamic sd-element--complex sd-question--complex sd-row__question",
@@ -5668,7 +5692,8 @@ var defaultV2Css = {
5668
5692
  footerButtonsContainer: "sd-paneldynamic__buttons-container",
5669
5693
  panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
5670
5694
  progressBtnIcon: "icon-progressbuttonv2",
5671
- noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder"
5695
+ noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
5696
+ compact: "sd-element--with-frame sd-element--compact"
5672
5697
  },
5673
5698
  progress: "sd-progress sd-body__progress",
5674
5699
  progressTop: "sd-body__progress--top",
@@ -5698,6 +5723,7 @@ var defaultV2Css = {
5698
5723
  pageDescription: "sd-description sd-page__description",
5699
5724
  row: "sd-row sd-clearfix",
5700
5725
  rowMultiple: "sd-row--multiple",
5726
+ rowCompact: "sd-row--compact",
5701
5727
  pageRow: "sd-page__row",
5702
5728
  question: {
5703
5729
  mainRoot: "sd-element sd-question sd-row__question",
@@ -5818,11 +5844,13 @@ var defaultV2Css = {
5818
5844
  itemChecked: "sd-boolean--checked",
5819
5845
  itemIndeterminate: "sd-boolean--indeterminate",
5820
5846
  itemDisabled: "sd-boolean--disabled",
5847
+ itemHover: "sd-boolean--allowhover",
5821
5848
  label: "sd-boolean__label",
5822
5849
  switch: "sd-boolean__switch",
5823
5850
  disabledLabel: "sd-checkbox__label--disabled",
5824
5851
  sliderText: "sd-boolean__thumb-text",
5825
5852
  slider: "sd-boolean__thumb",
5853
+ sliderGhost: "sd-boolean__thumb-ghost",
5826
5854
  //radio
5827
5855
  radioItem: "sd-item",
5828
5856
  radioItemChecked: "sd-item--checked sd-radio--checked",
@@ -5941,7 +5969,8 @@ var defaultV2Css = {
5941
5969
  cellText: "sd-matrix__text",
5942
5970
  cellTextSelected: "sd-matrix__text--checked",
5943
5971
  cellTextDisabled: "sd-matrix__text--disabled",
5944
- cellResponsiveTitle: "sd-matrix__responsive-title"
5972
+ cellResponsiveTitle: "sd-matrix__responsive-title",
5973
+ compact: "sd-element--with-frame sd-element--compact"
5945
5974
  },
5946
5975
  matrixdropdown: {
5947
5976
  mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
@@ -5966,7 +5995,8 @@ var defaultV2Css = {
5966
5995
  actionsCell: "sd-table__cell sd-table__cell--actions",
5967
5996
  emptyCell: "sd-table__cell--empty",
5968
5997
  verticalCell: "sd-table__cell--vertical",
5969
- cellQuestionWrapper: "sd-table__question-wrapper"
5998
+ cellQuestionWrapper: "sd-table__question-wrapper",
5999
+ compact: "sd-element--with-frame sd-element--compact"
5970
6000
  },
5971
6001
  matrixdynamic: {
5972
6002
  mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
@@ -6003,7 +6033,8 @@ var defaultV2Css = {
6003
6033
  ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
6004
6034
  emptyCell: "sd-table__cell--empty",
6005
6035
  verticalCell: "sd-table__cell--vertical",
6006
- cellQuestionWrapper: "sd-table__question-wrapper"
6036
+ cellQuestionWrapper: "sd-table__question-wrapper",
6037
+ compact: "sd-element--with-frame sd-element--compact"
6007
6038
  },
6008
6039
  rating: {
6009
6040
  rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase",
@@ -6025,6 +6056,9 @@ var defaultV2Css = {
6025
6056
  itemSmileyHover: "sd-rating__item-smiley--allowhover",
6026
6057
  itemSmileySelected: "sd-rating__item-smiley--selected",
6027
6058
  itemSmileyDisabled: "sd-rating__item-smiley--disabled",
6059
+ itemSmileyHighlighted: "sd-rating__item-star--highlighted",
6060
+ itemSmileyScaleColored: "sd-rating__item-smiley--scale-colored",
6061
+ itemSmileyRateColored: "sd-rating__item-smiley--rate-colored",
6028
6062
  minText: "sd-rating__item-text sd-rating__min-text",
6029
6063
  itemText: "sd-rating__item-text",
6030
6064
  maxText: "sd-rating__item-text sd-rating__max-text",
@@ -6151,7 +6185,8 @@ var defaultV2Css = {
6151
6185
  root: "sv-list__container sd-list",
6152
6186
  item: "sv-list__item sd-list__item",
6153
6187
  itemBody: "sv-list__item-body sd-list__item-body",
6154
- itemSelected: "sv-list__item--selected sd-list__item--selected"
6188
+ itemSelected: "sv-list__item--selected sd-list__item--selected",
6189
+ itemFocused: "sv-list__item--focused sd-list__item--focused",
6155
6190
  },
6156
6191
  actionBar: {
6157
6192
  root: "sd-action-bar",
@@ -8250,6 +8285,11 @@ var DropdownListModel = /** @class */ (function (_super) {
8250
8285
  this.filterString = undefined;
8251
8286
  }
8252
8287
  };
8288
+ DropdownListModel.prototype.clear = function () {
8289
+ this.inputString = null;
8290
+ this.hintString = "";
8291
+ this.resetFilterString();
8292
+ };
8253
8293
  DropdownListModel.prototype.onSetFilterString = function () {
8254
8294
  var _this = this;
8255
8295
  if (!!this.filterString && !this.popupModel.isVisible) {
@@ -8410,9 +8450,6 @@ var DropdownListModel = /** @class */ (function (_super) {
8410
8450
  };
8411
8451
  DropdownListModel.prototype.onClear = function (event) {
8412
8452
  this.question.clearValue();
8413
- this.inputString = null;
8414
- this.hintString = "";
8415
- this.resetFilterString();
8416
8453
  if (event) {
8417
8454
  event.preventDefault();
8418
8455
  event.stopPropagation();
@@ -8437,10 +8474,10 @@ var DropdownListModel = /** @class */ (function (_super) {
8437
8474
  }
8438
8475
  this.scrollToFocusedItem();
8439
8476
  if (this.question.value && !this.listModel.filterString && this.question.searchEnabled && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
8440
- this.applyInputString(this.listModel.focusedItem);
8477
+ this.applyInputString(this.listModel.focusedItem || this.question.selectedItem);
8441
8478
  }
8442
8479
  else {
8443
- this.applyHintString(this.listModel.focusedItem);
8480
+ this.applyHintString(this.listModel.focusedItem || this.question.selectedItem);
8444
8481
  }
8445
8482
  this.ariaActivedescendant = (_a = this.listModel.focusedItem) === null || _a === void 0 ? void 0 : _a.elementId;
8446
8483
  };
@@ -8759,6 +8796,10 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
8759
8796
  this.question.renderedValue = newValue;
8760
8797
  this.updateListState();
8761
8798
  };
8799
+ DropdownMultiSelectListModel.prototype.clear = function () {
8800
+ _super.prototype.clear.call(this);
8801
+ this.syncFilterStringPlaceholder();
8802
+ };
8762
8803
  DropdownMultiSelectListModel.prototype.onClear = function (event) {
8763
8804
  _super.prototype.onClear.call(this, event);
8764
8805
  this.updateListState();
@@ -9550,7 +9591,7 @@ __webpack_require__.r(__webpack_exports__);
9550
9591
  // import "../../main.scss";
9551
9592
  //import "../../modern.scss";
9552
9593
  var Version;
9553
- Version = "" + "1.9.84";
9594
+ Version = "" + "1.9.86";
9554
9595
  function checkLibraryVersion(ver, libraryName) {
9555
9596
  if (Version != ver) {
9556
9597
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -16274,6 +16315,37 @@ var Helpers = /** @class */ (function () {
16274
16315
  }
16275
16316
  return true;
16276
16317
  };
16318
+ Helpers.compareStrings = function (x, y) {
16319
+ if (!!x)
16320
+ x = x.trim();
16321
+ if (!!y)
16322
+ y = y.trim();
16323
+ if (!x && !y)
16324
+ return 0;
16325
+ if (!x)
16326
+ return -1;
16327
+ if (!y)
16328
+ return 1;
16329
+ if (x === y)
16330
+ return 0;
16331
+ var digitIndex = -1;
16332
+ for (var i = 0; i < x.length && i < y.length; i++) {
16333
+ if (this.isCharDigit(x[i]) && this.isCharDigit(y[i])) {
16334
+ digitIndex = i;
16335
+ break;
16336
+ }
16337
+ if (x[i] !== y[i])
16338
+ break;
16339
+ }
16340
+ if (digitIndex > -1) {
16341
+ var nX = this.getNumberFromStr(x, digitIndex);
16342
+ var nY = this.getNumberFromStr(y, digitIndex);
16343
+ if (!Number.isNaN(nX) && !Number.isNaN(nY) && nX !== nY) {
16344
+ return nX > nY ? 1 : -1;
16345
+ }
16346
+ }
16347
+ return x > y ? 1 : -1;
16348
+ };
16277
16349
  Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
16278
16350
  if (ignoreOrder === void 0) { ignoreOrder = false; }
16279
16351
  if (x === y)
@@ -16480,6 +16552,18 @@ var Helpers = /** @class */ (function () {
16480
16552
  Helpers.isCharDigit = function (ch) {
16481
16553
  return ch >= "0" && ch <= "9";
16482
16554
  };
16555
+ Helpers.getNumberFromStr = function (str, index) {
16556
+ if (!this.isCharDigit(str[index]))
16557
+ return NaN;
16558
+ var nStr = "";
16559
+ while (index < str.length && this.isCharDigit(str[index])) {
16560
+ nStr += str[index];
16561
+ index++;
16562
+ }
16563
+ if (!nStr)
16564
+ return NaN;
16565
+ return this.getNumber(nStr);
16566
+ };
16483
16567
  Helpers.countDecimals = function (value) {
16484
16568
  if (Helpers.isNumber(value) && Math.floor(value) !== value) {
16485
16569
  var strs = value.toString().split(".");
@@ -19627,10 +19711,24 @@ var ListModel = /** @class */ (function (_super) {
19627
19711
  });
19628
19712
  ListModel.prototype.onFilterStringChanged = function (text) {
19629
19713
  var _this = this;
19630
- this.isEmpty = this.renderedActions.filter(function (action) { return _this.isItemVisible(action); }).length === 0;
19631
19714
  if (!!this.onFilterStringChangedCallback) {
19632
19715
  this.onFilterStringChangedCallback(text);
19633
19716
  }
19717
+ this.isEmpty = this.renderedActions.filter(function (action) { return _this.isItemVisible(action); }).length === 0;
19718
+ };
19719
+ ListModel.prototype.scrollToItem = function (selector, ms) {
19720
+ var _this = this;
19721
+ if (ms === void 0) { ms = 0; }
19722
+ setTimeout(function () {
19723
+ if (!_this.listContainerHtmlElement)
19724
+ return;
19725
+ var item = _this.listContainerHtmlElement.querySelector("." + selector);
19726
+ if (item) {
19727
+ setTimeout(function () {
19728
+ item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
19729
+ }, ms);
19730
+ }
19731
+ }, ms);
19634
19732
  };
19635
19733
  ListModel.prototype.setItems = function (items, sortByVisibleIndex) {
19636
19734
  var _this = this;
@@ -19793,15 +19891,10 @@ var ListModel = /** @class */ (function (_super) {
19793
19891
  }
19794
19892
  };
19795
19893
  ListModel.prototype.scrollToFocusedItem = function () {
19796
- var _this = this;
19797
- setTimeout(function () {
19798
- if (!_this.listContainerHtmlElement)
19799
- return;
19800
- var item = _this.listContainerHtmlElement.querySelector("." + _this.getDefaultCssClasses().itemFocused);
19801
- if (item) {
19802
- item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
19803
- }
19804
- }, 0);
19894
+ this.scrollToItem(this.getDefaultCssClasses().itemFocused);
19895
+ };
19896
+ ListModel.prototype.scrollToSelectedItem = function () {
19897
+ this.scrollToItem(this.getDefaultCssClasses().itemSelected, 110);
19805
19898
  };
19806
19899
  ListModel.prototype.addScrollEventListener = function (handler) {
19807
19900
  if (!!handler) {
@@ -20071,9 +20164,7 @@ var LocalizableString = /** @class */ (function () {
20071
20164
  return res;
20072
20165
  };
20073
20166
  LocalizableString.prototype.setLocaleText = function (loc, value) {
20074
- if (this.disableLocalization) {
20075
- loc = _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].defaultLocaleName;
20076
- }
20167
+ loc = this.getValueLoc(loc);
20077
20168
  if (!this.storeDefaultText && value == this.getLocaleTextWithDefault(loc)) {
20078
20169
  if (!!value || !!loc && loc !== this.defaultLoc)
20079
20170
  return;
@@ -20278,19 +20369,24 @@ var LocalizableString = /** @class */ (function () {
20278
20369
  LocalizableString.prototype.getValue = function (loc) {
20279
20370
  if (!!this.sharedData)
20280
20371
  return this.sharedData.getValue(loc);
20281
- return this.values[loc];
20372
+ return this.values[this.getValueLoc(loc)];
20282
20373
  };
20283
20374
  LocalizableString.prototype.setValue = function (loc, value) {
20284
20375
  if (!!this.sharedData)
20285
20376
  this.sharedData.setValue(loc, value);
20286
20377
  else
20287
- this.values[loc] = value;
20378
+ this.values[this.getValueLoc(loc)] = value;
20288
20379
  };
20289
20380
  LocalizableString.prototype.deleteValue = function (loc) {
20290
20381
  if (!!this.sharedData)
20291
20382
  this.sharedData.deleteValue(loc);
20292
20383
  else
20293
- delete this.values[loc];
20384
+ delete this.values[this.getValueLoc(loc)];
20385
+ };
20386
+ LocalizableString.prototype.getValueLoc = function (loc) {
20387
+ if (this.disableLocalization)
20388
+ return _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].defaultLocaleName;
20389
+ return loc;
20294
20390
  };
20295
20391
  LocalizableString.prototype.getValuesKeys = function () {
20296
20392
  if (!!this.sharedData)
@@ -26509,7 +26605,7 @@ var PageModel = /** @class */ (function (_super) {
26509
26605
  configurable: true
26510
26606
  });
26511
26607
  PageModel.prototype.calcCssClasses = function (css) {
26512
- var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "" };
26608
+ var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
26513
26609
  this.copyCssClasses(classes.page, css.page);
26514
26610
  if (!!css.pageTitle) {
26515
26611
  classes.pageTitle = css.pageTitle;
@@ -26526,6 +26622,9 @@ var PageModel = /** @class */ (function (_super) {
26526
26622
  if (!!css.rowMultiple) {
26527
26623
  classes.rowMultiple = css.rowMultiple;
26528
26624
  }
26625
+ if (!!css.rowCompact) {
26626
+ classes.rowCompact = css.rowCompact;
26627
+ }
26529
26628
  if (this.survey) {
26530
26629
  this.survey.updatePageCssClasses(this, classes);
26531
26630
  }
@@ -26917,8 +27016,11 @@ var QuestionRowModel = /** @class */ (function (_super) {
26917
27016
  el.renderWidth = this.getRenderedWidthFromWidth(width);
26918
27017
  preSetWidthElements.push(el);
26919
27018
  }
26920
- if (!(this.panel.isDefaultV2Theme || ((_a = this.panel.parentQuestion) === null || _a === void 0 ? void 0 : _a.isDefaultV2Theme))) {
26921
- el.rightIndent = counter < visCount - 1 ? 1 : 0;
27019
+ if (counter < visCount - 1 && !(this.panel.isDefaultV2Theme || ((_a = this.panel.parentQuestion) === null || _a === void 0 ? void 0 : _a.isDefaultV2Theme))) {
27020
+ el.rightIndent = 1;
27021
+ }
27022
+ else {
27023
+ el.rightIndent = 0;
26922
27024
  }
26923
27025
  counter++;
26924
27026
  }
@@ -26994,6 +27096,7 @@ var QuestionRowModel = /** @class */ (function (_super) {
26994
27096
  QuestionRowModel.prototype.getRowCss = function () {
26995
27097
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
26996
27098
  .append(this.panel.cssClasses.row)
27099
+ .append(this.panel.cssClasses.rowCompact, this.panel["isCompact"])
26997
27100
  .append(this.panel.cssClasses.pageRow, this.panel.isPage || (!!this.panel.originalPage && !this.panel.survey.isShowingPreview))
26998
27101
  .append(this.panel.cssClasses.rowMultiple, this.visibleElements.length > 1)
26999
27102
  .toString();
@@ -27242,12 +27345,15 @@ var PanelModelBase = /** @class */ (function (_super) {
27242
27345
  configurable: true
27243
27346
  });
27244
27347
  PanelModelBase.prototype.calcCssClasses = function (css) {
27245
- var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "" };
27348
+ var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
27246
27349
  this.copyCssClasses(classes.panel, css.panel);
27247
27350
  this.copyCssClasses(classes.error, css.error);
27248
27351
  if (!!css.pageRow) {
27249
27352
  classes.pageRow = css.pageRow;
27250
27353
  }
27354
+ if (!!css.rowCompact) {
27355
+ classes.rowCompact = css.rowCompact;
27356
+ }
27251
27357
  if (!!css.row) {
27252
27358
  classes.row = css.row;
27253
27359
  }
@@ -28704,8 +28810,19 @@ var PanelModel = /** @class */ (function (_super) {
28704
28810
  enumerable: false,
28705
28811
  configurable: true
28706
28812
  });
28813
+ Object.defineProperty(PanelModel.prototype, "showErrorsAbovePanel", {
28814
+ get: function () {
28815
+ return this.isDefaultV2Theme;
28816
+ },
28817
+ enumerable: false,
28818
+ configurable: true
28819
+ });
28707
28820
  PanelModel.prototype.getCssError = function (cssClasses) {
28708
- var builder = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]().append(this.cssClasses.error.root);
28821
+ var isDefaultV2Theme = this.isDefaultV2Theme;
28822
+ var builder = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
28823
+ .append(this.cssClasses.error.root)
28824
+ .append(this.cssClasses.error.outsideQuestion, isDefaultV2Theme)
28825
+ .append(this.cssClasses.error.aboveQuestion, isDefaultV2Theme);
28709
28826
  return builder.append("panel-error-root", builder.isEmpty()).toString();
28710
28827
  };
28711
28828
  PanelModel.prototype.onVisibleChanged = function () {
@@ -28939,6 +29056,7 @@ var defaultCss = {
28939
29056
  slider: "sv-boolean__slider",
28940
29057
  label: "sv-boolean__label ",
28941
29058
  disabledLabel: "sv-boolean__label--disabled",
29059
+ sliderGhost: "sv-boolean__thumb-ghost",
28942
29060
  materialDecorator: "sv-item__decorator sv-boolean__decorator",
28943
29061
  itemDecorator: "sv-item__svg sv-boolean__svg",
28944
29062
  checkedPath: "sv-boolean__checked-path",
@@ -29382,6 +29500,7 @@ var defaultCss = {
29382
29500
  slider: "sv-boolean__slider",
29383
29501
  label: "sv-boolean__label ",
29384
29502
  disabledLabel: "sv-boolean__label--disabled",
29503
+ sliderGhost: "sv-boolean__thumb-ghost",
29385
29504
  materialDecorator: "sv-item__decorator sv-boolean__decorator",
29386
29505
  itemDecorator: "sv-item__svg sv-boolean__svg",
29387
29506
  checkedPath: "sv-boolean__checked-path",
@@ -33128,9 +33247,15 @@ var Question = /** @class */ (function (_super) {
33128
33247
  return 1;
33129
33248
  };
33130
33249
  Question.prototype.getCorrectAnswerCount = function () {
33131
- return this.isTwoValueEquals(this.value, this.correctAnswer, !_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].comparator.caseSensitive, true)
33132
- ? 1
33133
- : 0;
33250
+ return this.checkIfAnswerCorrect() ? 1 : 0;
33251
+ };
33252
+ Question.prototype.checkIfAnswerCorrect = function () {
33253
+ var isEqual = this.isTwoValueEquals(this.value, this.correctAnswer, !_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].comparator.caseSensitive, true);
33254
+ var options = { result: isEqual, correctAnswer: isEqual ? 1 : 0 };
33255
+ if (!!this.survey) {
33256
+ this.survey.onCorrectQuestionAnswer(this, options);
33257
+ }
33258
+ return options.result;
33134
33259
  };
33135
33260
  /**
33136
33261
  * Returns `true` if a question answer matches the `correctAnswer` property value.
@@ -34751,21 +34876,40 @@ var QuestionSelectBase = /** @class */ (function (_super) {
34751
34876
  return this.hasUnknownValue(val, true, false);
34752
34877
  };
34753
34878
  QuestionSelectBase.prototype.updateSelectedItemValues = function () {
34879
+ var IsMultipleValue = this.getIsMultipleValue();
34880
+ if (IsMultipleValue) {
34881
+ this.updateMultipleSelectedItemValues();
34882
+ }
34883
+ else {
34884
+ this.updateSingleSelectedItemValues();
34885
+ }
34886
+ };
34887
+ QuestionSelectBase.prototype.updateSingleSelectedItemValues = function () {
34754
34888
  var _this = this;
34755
- if (!!this.survey && !this.isEmpty() && this.choices.length === 0) {
34756
- var IsMultipleValue_1 = this.getIsMultipleValue();
34889
+ if (!!this.survey && !this.isEmpty() && !_itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].getItemByValue(this.choices, this.value)) {
34757
34890
  this.survey.getChoiceDisplayValue({
34758
34891
  question: this,
34759
- values: IsMultipleValue_1 ? this.value : [this.value],
34892
+ values: [this.value],
34760
34893
  setItems: function (displayValues) {
34761
34894
  if (!displayValues || !displayValues.length)
34762
34895
  return;
34763
- if (IsMultipleValue_1) {
34764
- _this.selectedItemValues = displayValues.map(function (displayValue, index) { return _this.createItemValue(_this.value[index], displayValue); });
34765
- }
34766
- else {
34767
- _this.selectedItemValues = _this.createItemValue(_this.value, displayValues[0]);
34768
- }
34896
+ _this.selectedItemValues = _this.createItemValue(_this.value, displayValues[0]);
34897
+ }
34898
+ });
34899
+ }
34900
+ };
34901
+ QuestionSelectBase.prototype.updateMultipleSelectedItemValues = function () {
34902
+ var _this = this;
34903
+ var valueArray = this.value;
34904
+ var hasItemWithValues = valueArray.some(function (val) { return !_itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].getItemByValue(_this.choices, val); });
34905
+ if (!!this.survey && !this.isEmpty() && hasItemWithValues) {
34906
+ this.survey.getChoiceDisplayValue({
34907
+ question: this,
34908
+ values: valueArray,
34909
+ setItems: function (displayValues) {
34910
+ if (!displayValues || !displayValues.length)
34911
+ return;
34912
+ _this.selectedItemValues = displayValues.map(function (displayValue, index) { return _this.createItemValue(_this.value[index], displayValue); });
34769
34913
  }
34770
34914
  });
34771
34915
  }
@@ -35539,11 +35683,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
35539
35683
  };
35540
35684
  QuestionSelectBase.prototype.sortArray = function (array, mult) {
35541
35685
  return array.sort(function (a, b) {
35542
- if (a.calculatedText < b.calculatedText)
35543
- return -1 * mult;
35544
- if (a.calculatedText > b.calculatedText)
35545
- return 1 * mult;
35546
- return 0;
35686
+ return _helpers__WEBPACK_IMPORTED_MODULE_8__["Helpers"].compareStrings(a.calculatedText, b.calculatedText) * mult;
35547
35687
  });
35548
35688
  };
35549
35689
  QuestionSelectBase.prototype.randomizeArray = function (array) {
@@ -36344,6 +36484,7 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
36344
36484
  .append(css.item)
36345
36485
  .append(css.itemOnError, this.errors.length > 0)
36346
36486
  .append(css.itemDisabled, this.isReadOnly)
36487
+ .append(css.itemHover, !this.isDesignMode)
36347
36488
  .append(css.itemChecked, !!this.booleanValue)
36348
36489
  .append(css.itemIndeterminate, this.booleanValue === null)
36349
36490
  .toString();
@@ -38726,6 +38867,13 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
38726
38867
  }
38727
38868
  return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
38728
38869
  };
38870
+ QuestionDropdownModel.prototype.needConvertRenderedOtherToDataValue = function () {
38871
+ var _a;
38872
+ var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
38873
+ if (!val)
38874
+ return false;
38875
+ return _super.prototype.hasUnknownValue.call(this, val, true, false);
38876
+ };
38729
38877
  QuestionDropdownModel.prototype.onVisibleChoicesChanged = function () {
38730
38878
  _super.prototype.onVisibleChoicesChanged.call(this);
38731
38879
  if (this.popupModel) {
@@ -38739,8 +38887,10 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
38739
38887
  return this.inputId + "_0";
38740
38888
  };
38741
38889
  QuestionDropdownModel.prototype.clearValue = function () {
38890
+ var _a;
38742
38891
  _super.prototype.clearValue.call(this);
38743
38892
  this.lastSelectedItemValue = null;
38893
+ (_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
38744
38894
  };
38745
38895
  QuestionDropdownModel.prototype.onClick = function (e) {
38746
38896
  !!this.onOpenedCallBack && this.onOpenedCallBack();
@@ -45627,7 +45777,12 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
45627
45777
  return this.cell.column.locCellHint.renderedHtml;
45628
45778
  }
45629
45779
  if (this.cell.column.isShowInMultipleColumns) {
45630
- return this.item.locText.renderedHtml;
45780
+ if (!!this.item) {
45781
+ return this.item.locText.renderedHtml;
45782
+ }
45783
+ else {
45784
+ return "";
45785
+ }
45631
45786
  }
45632
45787
  }
45633
45788
  if (this.question && this.question.isVisible) {
@@ -51365,6 +51520,9 @@ var RenderedRatingItem = /** @class */ (function (_super) {
51365
51520
  __decorate([
51366
51521
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
51367
51522
  ], RenderedRatingItem.prototype, "text", void 0);
51523
+ __decorate([
51524
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
51525
+ ], RenderedRatingItem.prototype, "style", void 0);
51368
51526
  return RenderedRatingItem;
51369
51527
  }(_base__WEBPACK_IMPORTED_MODULE_7__["Base"]));
51370
51528
 
@@ -51378,12 +51536,13 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51378
51536
  function QuestionRatingModel(name) {
51379
51537
  var _this = _super.call(this, name) || this;
51380
51538
  _this._syncPropertiesChanging = false;
51539
+ _this.initColors();
51381
51540
  _this.createItemValues("rateValues");
51382
51541
  _this.createRenderedRateItems();
51383
51542
  _this.createLocalizableString("ratingOptionsCaption", _this, false, true);
51384
51543
  _this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
51385
51544
  "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
51386
- _this.registerFunctionOnPropertiesValueChanged(["rateDisplayMode"], function () {
51545
+ _this.registerFunctionOnPropertiesValueChanged(["rateType"], function () {
51387
51546
  _this.setIconsToRateValues();
51388
51547
  _this.createRenderedRateItems();
51389
51548
  _this.updateRateCount();
@@ -51393,12 +51552,17 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51393
51552
  _this.setIconsToRateValues();
51394
51553
  _this.createRenderedRateItems();
51395
51554
  });
51555
+ _this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
51556
+ _this.initColors();
51557
+ });
51396
51558
  _this.registerFunctionOnPropertiesValueChanged(["autoGenerate"], function () {
51397
51559
  if (!_this.autoGenerate && _this.rateValues.length === 0) {
51398
51560
  _this.setPropertyValue("rateValues", _this.visibleRateValues);
51399
51561
  }
51400
- if (_this.autoGenerate)
51562
+ if (_this.autoGenerate) {
51563
+ _this.rateValues.length = 0;
51401
51564
  _this.updateRateMax();
51565
+ }
51402
51566
  _this.createRenderedRateItems();
51403
51567
  });
51404
51568
  _this.createLocalizableString("minRateDescription", _this, true);
@@ -51408,8 +51572,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51408
51572
  }
51409
51573
  QuestionRatingModel.prototype.setIconsToRateValues = function () {
51410
51574
  var _this = this;
51411
- if (this.rateType == "smileys")
51575
+ if (this.rateType == "smileys") {
51412
51576
  this.rateValues.map(function (item) { return item.icon = _this.getItemSmiley(item); });
51577
+ }
51413
51578
  };
51414
51579
  QuestionRatingModel.prototype.startLoadingFromJson = function (jsonObj) {
51415
51580
  _super.prototype.startLoadingFromJson.call(this, jsonObj);
@@ -51417,6 +51582,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51417
51582
  };
51418
51583
  QuestionRatingModel.prototype.endLoadingFromJson = function () {
51419
51584
  _super.prototype.endLoadingFromJson.call(this);
51585
+ this.initColors();
51420
51586
  this.hasMinRateDescription = !!this.minRateDescription;
51421
51587
  this.hasMaxRateDescription = !!this.maxRateDescription;
51422
51588
  if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
@@ -51462,6 +51628,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51462
51628
  newCount = 10;
51463
51629
  }
51464
51630
  this.rateCount = newCount;
51631
+ if (this.rateValues.length > newCount)
51632
+ this.rateValues.length = newCount;
51465
51633
  };
51466
51634
  QuestionRatingModel.prototype.initPropertyDependencies = function () {
51467
51635
  var _this = this;
@@ -51507,6 +51675,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51507
51675
  * If you need to specify only the `value` property, you can set the `rateValues` property to an array of numbers, for example, `[ 3, 6, 10 ]`. These values are both saved in survey results and used as display text.
51508
51676
  *
51509
51677
  * If you do not specify the `rateValues` property, rate values are generated automatically based upon the [`rateMin`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMin), [`rateMax`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMax), [`rateStep`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateStep), and [`rateCount`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateCount) property values.
51678
+ *
51679
+ * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
51510
51680
  */
51511
51681
  get: function () {
51512
51682
  return this.getPropertyValue("rateValues");
@@ -51523,6 +51693,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51523
51693
  * Specifies the first rate value in the generated sequence of rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
51524
51694
  *
51525
51695
  * Default value: 1
51696
+ *
51697
+ * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
51526
51698
  * @see rateMax
51527
51699
  * @see rateStep
51528
51700
  * @see rateCount
@@ -51541,6 +51713,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51541
51713
  * Specifies the last rate value in the generated sequence of rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
51542
51714
  *
51543
51715
  * Default value: 5
51716
+ *
51717
+ * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
51544
51718
  * @see rateMin
51545
51719
  * @see rateStep
51546
51720
  * @see rateCount
@@ -51559,6 +51733,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51559
51733
  * Specifies a step with which to generate rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
51560
51734
  *
51561
51735
  * Default value: 1
51736
+ *
51737
+ * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
51562
51738
  * @see rateMin
51563
51739
  * @see rateMax
51564
51740
  * @see rateCount
@@ -51572,6 +51748,39 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51572
51748
  enumerable: false,
51573
51749
  configurable: true
51574
51750
  });
51751
+ QuestionRatingModel.prototype.initColors = function () {
51752
+ if (this.colorMode === "monochrome")
51753
+ return;
51754
+ if (!document)
51755
+ return;
51756
+ if (QuestionRatingModel.badColor && QuestionRatingModel.normalColor && QuestionRatingModel.goodColor)
51757
+ return;
51758
+ function getRGBColor(varName) {
51759
+ var style = getComputedStyle(document.documentElement);
51760
+ var str = style.getPropertyValue && style.getPropertyValue(varName);
51761
+ if (!str)
51762
+ return null;
51763
+ var ctx = document.createElement("canvas").getContext("2d");
51764
+ ctx.fillStyle = str;
51765
+ var newStr = ctx.fillStyle;
51766
+ if (newStr.startsWith("rgba")) {
51767
+ return newStr.substring(5, newStr.length - 1).split(",").map(function (c) { return +(c.trim()); });
51768
+ }
51769
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(newStr);
51770
+ return result ? [
51771
+ parseInt(result[1], 16),
51772
+ parseInt(result[2], 16),
51773
+ parseInt(result[3], 16),
51774
+ 1
51775
+ ] : null;
51776
+ }
51777
+ QuestionRatingModel.badColor = getRGBColor("--sd-rating-bad-color");
51778
+ QuestionRatingModel.normalColor = getRGBColor("--sd-rating-normal-color");
51779
+ QuestionRatingModel.goodColor = getRGBColor("--sd-rating-good-color");
51780
+ QuestionRatingModel.badColorLight = getRGBColor("--sd-rating-bad-color-light");
51781
+ QuestionRatingModel.normalColorLight = getRGBColor("--sd-rating-normal-color-light");
51782
+ QuestionRatingModel.goodColorLight = getRGBColor("--sd-rating-good-color-light");
51783
+ };
51575
51784
  QuestionRatingModel.prototype.getDisplayValueCore = function (keysAsText, value) {
51576
51785
  var res = _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"].getTextOrHtmlByValue(this.visibleRateValues, value);
51577
51786
  return !!res ? res : value;
@@ -51611,13 +51820,16 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51611
51820
  if (this.rateType == "smileys" && rateValues.length > 10)
51612
51821
  rateValues = rateValues.slice(0, 10);
51613
51822
  this.renderedRateItems = rateValues.map(function (v, i) {
51823
+ var renderedItem = null;
51614
51824
  if (_this.displayRateDescriptionsAsExtremeItems) {
51615
51825
  if (i == 0)
51616
- return new RenderedRatingItem(v, _this.minRateDescription && _this.locMinRateDescription || v.locText);
51826
+ renderedItem = new RenderedRatingItem(v, _this.minRateDescription && _this.locMinRateDescription || v.locText);
51617
51827
  if (i == rateValues.length - 1)
51618
- return new RenderedRatingItem(v, _this.maxRateDescription && _this.locMaxRateDescription || v.locText);
51828
+ renderedItem = new RenderedRatingItem(v, _this.maxRateDescription && _this.locMaxRateDescription || v.locText);
51619
51829
  }
51620
- return new RenderedRatingItem(v);
51830
+ if (!renderedItem)
51831
+ renderedItem = new RenderedRatingItem(v);
51832
+ return renderedItem;
51621
51833
  });
51622
51834
  };
51623
51835
  QuestionRatingModel.prototype.correctValue = function (value, step) {
@@ -51709,12 +51921,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51709
51921
  enumerable: false,
51710
51922
  configurable: true
51711
51923
  });
51712
- Object.defineProperty(QuestionRatingModel.prototype, "rateType", {
51924
+ Object.defineProperty(QuestionRatingModel.prototype, "rateDisplayMode", {
51713
51925
  get: function () {
51714
- return this.rateDisplayMode;
51926
+ return this.rateType;
51715
51927
  },
51716
51928
  set: function (val) {
51717
- this.rateDisplayMode = val;
51929
+ this.rateType = val;
51718
51930
  },
51719
51931
  enumerable: false,
51720
51932
  configurable: true
@@ -51767,6 +51979,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51767
51979
  return;
51768
51980
  var high = true;
51769
51981
  var selected = this.value != null;
51982
+ if (this.rateType !== "stars") {
51983
+ item.highlight = "highlighted";
51984
+ return;
51985
+ }
51770
51986
  for (var i = 0; i < this.renderedRateItems.length; i++) {
51771
51987
  this.renderedRateItems[i].highlight = high && !selected && "highlighted" || !high && selected && "unhighlighted" || "none";
51772
51988
  if (this.renderedRateItems[i] == item)
@@ -51805,6 +52021,46 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51805
52021
  QuestionRatingModel.prototype.getItemClassByText = function (item, text) {
51806
52022
  return this.getItemClass(item);
51807
52023
  };
52024
+ QuestionRatingModel.prototype.getRenderedItemColor = function (index, light) {
52025
+ var startColor = light ? QuestionRatingModel.badColorLight : QuestionRatingModel.badColor;
52026
+ var endColor = light ? QuestionRatingModel.goodColorLight : QuestionRatingModel.goodColor;
52027
+ var normalIndex = (this.rateCount - 1) / 2.0;
52028
+ var middleColor = light ? QuestionRatingModel.normalColorLight : QuestionRatingModel.normalColor;
52029
+ if (index < normalIndex) {
52030
+ endColor = middleColor;
52031
+ }
52032
+ else {
52033
+ startColor = middleColor;
52034
+ index -= normalIndex;
52035
+ }
52036
+ if (!startColor || !endColor)
52037
+ return null;
52038
+ var curColor = [0, 0, 0, 0];
52039
+ for (var i = 0; i < 4; i++) {
52040
+ curColor[i] = startColor[i] + (endColor[i] - startColor[i]) * index / normalIndex;
52041
+ if (i < 3)
52042
+ curColor[i] = Math.trunc(curColor[i]);
52043
+ }
52044
+ return "rgba(" + curColor[0] + ", " + curColor[1] + ", " + curColor[2] + ", " + curColor[3] + ")";
52045
+ };
52046
+ QuestionRatingModel.prototype.getItemStyle = function (item, highlight) {
52047
+ if (highlight === void 0) { highlight = "none"; }
52048
+ if (this.scaleColorMode === "monochrome" && this.rateColorMode == "default")
52049
+ return { borderColor: null, fill: null, backgroundColor: null };
52050
+ var index = this.visibleRateValues.indexOf(item);
52051
+ var color = this.getRenderedItemColor(index, false);
52052
+ if (this.value != this.renderedRateItems[index].value) {
52053
+ var colorLight = this.getRenderedItemColor(index, true);
52054
+ if (highlight == "highlighted" && this.scaleColorMode === "colored")
52055
+ return { borderColor: color, fill: color, backgroundColor: colorLight };
52056
+ if (this.scaleColorMode === "colored" && this.errors.length == 0)
52057
+ return { borderColor: color, fill: color, backgroundColor: null };
52058
+ return { borderColor: null, fill: null, backgroundColor: null };
52059
+ }
52060
+ else {
52061
+ return { borderColor: color, fill: null, backgroundColor: color };
52062
+ }
52063
+ };
51808
52064
  QuestionRatingModel.prototype.getItemClass = function (item, highlight) {
51809
52065
  var _this = this;
51810
52066
  if (highlight === void 0) { highlight = "none"; }
@@ -51829,6 +52085,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51829
52085
  var itemitemOnErrorClass = this.cssClasses.itemOnError;
51830
52086
  var itemHighlightedClass = null;
51831
52087
  var itemUnhighlightedClass = null;
52088
+ var itemScaleColoredClass = null;
52089
+ var itemRateColoredClass = null;
51832
52090
  if (this.isStar) {
51833
52091
  itemClass = this.cssClasses.itemStar;
51834
52092
  itemSelectedClass = this.cssClasses.itemStarSelected;
@@ -51844,6 +52102,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51844
52102
  itemDisabledClass = this.cssClasses.itemSmileyDisabled;
51845
52103
  itemHoverClass = this.cssClasses.itemSmileyHover;
51846
52104
  itemitemOnErrorClass = this.cssClasses.itemSmileyOnError;
52105
+ itemHighlightedClass = this.cssClasses.itemSmileyHighlighted;
52106
+ itemScaleColoredClass = this.cssClasses.itemSmileyScaleColored;
52107
+ itemRateColoredClass = this.cssClasses.itemSmileyRateColored;
51847
52108
  }
51848
52109
  var hasFixedSize = !this.isStar &&
51849
52110
  !this.isSmiley &&
@@ -51858,6 +52119,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51858
52119
  .append(itemDisabledClass, this.isReadOnly)
51859
52120
  .append(itemHoverClass, allowHover)
51860
52121
  .append(itemHighlightedClass, isHighlighted)
52122
+ .append(itemScaleColoredClass, this.scaleColorMode == "colored")
52123
+ .append(itemRateColoredClass, this.rateColorMode == "scale" && isSelected)
51861
52124
  .append(itemUnhighlightedClass, isUnhighlighted)
51862
52125
  .append(itemitemOnErrorClass, this.errors.length > 0)
51863
52126
  .append(this.cssClasses.itemFixedSize, hasFixedSize)
@@ -52018,35 +52281,58 @@ var QuestionRatingModel = /** @class */ (function (_super) {
52018
52281
  ], QuestionRatingModel.prototype, "displayMode", void 0);
52019
52282
  __decorate([
52020
52283
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
52021
- ], QuestionRatingModel.prototype, "rateDisplayMode", void 0);
52284
+ ], QuestionRatingModel.prototype, "rateType", void 0);
52022
52285
  __decorate([
52023
52286
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
52024
- ], QuestionRatingModel.prototype, "smileysColorMode", void 0);
52287
+ ], QuestionRatingModel.prototype, "scaleColorMode", void 0);
52288
+ __decorate([
52289
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
52290
+ ], QuestionRatingModel.prototype, "rateColorMode", void 0);
52025
52291
  return QuestionRatingModel;
52026
52292
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
52027
52293
 
52028
52294
  _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52029
52295
  { name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
52030
52296
  {
52031
- name: "rateDisplayMode",
52032
- alternativeName: "rateType",
52297
+ name: "rateType",
52298
+ alternativeName: "rateDisplayMode",
52033
52299
  default: "labels",
52034
52300
  category: "rateValues",
52035
52301
  choices: ["labels", "stars", "smileys"],
52036
52302
  visibleIndex: 0
52037
52303
  },
52304
+ {
52305
+ name: "scaleColorMode",
52306
+ category: "rateValues",
52307
+ default: "monochrome",
52308
+ choices: ["monochrome", "colored"],
52309
+ visibleIf: function (obj) {
52310
+ return obj.rateDisplayMode == "smileys";
52311
+ },
52312
+ visibleIndex: 1
52313
+ },
52314
+ {
52315
+ name: "rateColorMode",
52316
+ category: "rateValues",
52317
+ default: "scale",
52318
+ choices: ["default", "scale"],
52319
+ visibleIf: function (obj) {
52320
+ return obj.rateDisplayMode == "smileys" && obj.scaleColorMode == "monochrome";
52321
+ },
52322
+ visibleIndex: 2
52323
+ },
52038
52324
  {
52039
52325
  name: "autoGenerate",
52040
52326
  category: "rateValues",
52041
52327
  default: true,
52042
52328
  choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
52043
- visibleIndex: 2
52329
+ visibleIndex: 4
52044
52330
  },
52045
52331
  {
52046
52332
  name: "rateCount:number",
52047
52333
  default: 5,
52048
52334
  category: "rateValues",
52049
- visibleIndex: 1,
52335
+ visibleIndex: 3,
52050
52336
  onSettingValue: function (obj, val) {
52051
52337
  if (val < 2)
52052
52338
  return 2;
@@ -52066,7 +52352,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52066
52352
  visibleIf: function (obj) {
52067
52353
  return !obj.autoGenerate;
52068
52354
  },
52069
- visibleIndex: 3
52355
+ visibleIndex: 5
52070
52356
  },
52071
52357
  {
52072
52358
  name: "rateMin:number", default: 1,
@@ -52076,7 +52362,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52076
52362
  visibleIf: function (obj) {
52077
52363
  return !!obj.autoGenerate;
52078
52364
  },
52079
- visibleIndex: 4
52365
+ visibleIndex: 6
52080
52366
  },
52081
52367
  {
52082
52368
  name: "rateMax:number", default: 5,
@@ -52086,7 +52372,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52086
52372
  visibleIf: function (obj) {
52087
52373
  return !!obj.autoGenerate;
52088
52374
  },
52089
- visibleIndex: 5
52375
+ visibleIndex: 7
52090
52376
  },
52091
52377
  {
52092
52378
  name: "rateStep:number", default: 1, minValue: 0.1,
@@ -52100,7 +52386,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52100
52386
  visibleIf: function (obj) {
52101
52387
  return !!obj.autoGenerate;
52102
52388
  },
52103
- visibleIndex: 6
52389
+ visibleIndex: 8
52104
52390
  },
52105
52391
  {
52106
52392
  name: "minRateDescription",
@@ -52119,8 +52405,11 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52119
52405
  name: "displayMode",
52120
52406
  default: "auto",
52121
52407
  choices: ["auto", "buttons", "dropdown"],
52408
+ visibleIf: function (obj) {
52409
+ return obj.rateType == "labels";
52410
+ },
52122
52411
  visibleIndex: 20
52123
- },
52412
+ }
52124
52413
  ], function () {
52125
52414
  return new QuestionRatingModel("");
52126
52415
  }, "question");
@@ -52622,6 +52911,13 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
52622
52911
  }
52623
52912
  return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
52624
52913
  };
52914
+ QuestionTagboxModel.prototype.needConvertRenderedOtherToDataValue = function () {
52915
+ var _a;
52916
+ var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
52917
+ if (!val)
52918
+ return false;
52919
+ return _super.prototype.hasUnknownValue.call(this, val, true, false);
52920
+ };
52625
52921
  QuestionTagboxModel.prototype.onVisibleChoicesChanged = function () {
52626
52922
  _super.prototype.onVisibleChoicesChanged.call(this);
52627
52923
  if (this.popupModel) {
@@ -52665,6 +52961,10 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
52665
52961
  this.dropdownListModelValue.dispose();
52666
52962
  }
52667
52963
  };
52964
+ QuestionTagboxModel.prototype.clearValue = function () {
52965
+ _super.prototype.clearValue.call(this);
52966
+ this.dropdownListModel.clear();
52967
+ };
52668
52968
  __decorate([
52669
52969
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
52670
52970
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
@@ -53335,6 +53635,12 @@ function getCorrectMinMax(obj, min, max, isMax) {
53335
53635
  return isMax ? min : max;
53336
53636
  return val;
53337
53637
  }
53638
+ function propertyEditorMinMaxUpdate(obj, propertyEditor) {
53639
+ if (!!obj && !!obj.inputType) {
53640
+ propertyEditor.inputType = obj.inputType !== "range" ? obj.inputType : "number";
53641
+ propertyEditor.textUpdateMode = "onBlur";
53642
+ }
53643
+ }
53338
53644
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("text", [
53339
53645
  {
53340
53646
  name: "inputType",
@@ -53374,9 +53680,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("text", [
53374
53680
  return isMinMaxType(obj);
53375
53681
  },
53376
53682
  onPropertyEditorUpdate: function (obj, propertyEditor) {
53377
- if (!!obj && !!obj.inputType) {
53378
- propertyEditor.inputType = obj.inputType !== "range" ? obj.inputType : "number";
53379
- }
53683
+ propertyEditorMinMaxUpdate(obj, propertyEditor);
53380
53684
  },
53381
53685
  onSettingValue: function (obj, val) {
53382
53686
  return getCorrectMinMax(obj, val, obj.max, false);
@@ -53393,9 +53697,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("text", [
53393
53697
  return getCorrectMinMax(obj, obj.min, val, true);
53394
53698
  },
53395
53699
  onPropertyEditorUpdate: function (obj, propertyEditor) {
53396
- if (!!obj && !!obj.inputType) {
53397
- propertyEditor.inputType = obj.inputType !== "range" ? obj.inputType : "number";
53398
- }
53700
+ propertyEditorMinMaxUpdate(obj, propertyEditor);
53399
53701
  },
53400
53702
  },
53401
53703
  {
@@ -53696,10 +53998,8 @@ __webpack_require__.r(__webpack_exports__);
53696
53998
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
53697
53999
 
53698
54000
 
53699
- //TODO replace completely with ElementFactory
53700
54001
  var QuestionFactory = /** @class */ (function () {
53701
54002
  function QuestionFactory() {
53702
- this.creatorHash = {};
53703
54003
  }
53704
54004
  Object.defineProperty(QuestionFactory, "DefaultChoices", {
53705
54005
  get: function () {
@@ -53737,26 +54037,23 @@ var QuestionFactory = /** @class */ (function () {
53737
54037
  configurable: true
53738
54038
  });
53739
54039
  QuestionFactory.prototype.registerQuestion = function (questionType, questionCreator) {
53740
- this.creatorHash[questionType] = questionCreator;
54040
+ ElementFactory.Instance.registerElement(questionType, questionCreator);
53741
54041
  };
53742
- QuestionFactory.prototype.unregisterElement = function (elementType) {
53743
- delete this.creatorHash[elementType];
54042
+ QuestionFactory.prototype.registerCustomQuestion = function (questionType) {
54043
+ ElementFactory.Instance.registerCustomQuestion(questionType);
54044
+ };
54045
+ QuestionFactory.prototype.unregisterElement = function (elementType, removeFromSerializer) {
54046
+ if (removeFromSerializer === void 0) { removeFromSerializer = false; }
54047
+ ElementFactory.Instance.unregisterElement(elementType, removeFromSerializer);
53744
54048
  };
53745
54049
  QuestionFactory.prototype.clear = function () {
53746
- this.creatorHash = {};
54050
+ ElementFactory.Instance.clear();
53747
54051
  };
53748
54052
  QuestionFactory.prototype.getAllTypes = function () {
53749
- var result = new Array();
53750
- for (var key in this.creatorHash) {
53751
- result.push(key);
53752
- }
53753
- return result.sort();
54053
+ return ElementFactory.Instance.getAllTypes();
53754
54054
  };
53755
54055
  QuestionFactory.prototype.createQuestion = function (questionType, name) {
53756
- var creator = this.creatorHash[questionType];
53757
- if (creator == null)
53758
- return null;
53759
- return creator(name);
54056
+ return ElementFactory.Instance.createElement(questionType, name);
53760
54057
  };
53761
54058
  QuestionFactory.Instance = new QuestionFactory();
53762
54059
  return QuestionFactory;
@@ -53764,7 +54061,17 @@ var QuestionFactory = /** @class */ (function () {
53764
54061
 
53765
54062
  var ElementFactory = /** @class */ (function () {
53766
54063
  function ElementFactory() {
54064
+ var _this = this;
53767
54065
  this.creatorHash = {};
54066
+ this.registerCustomQuestion = function (questionType) {
54067
+ var creator = function (name) {
54068
+ var el = _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].createClass(questionType);
54069
+ if (!!el)
54070
+ el.name = name;
54071
+ return el;
54072
+ };
54073
+ _this.registerElement(questionType, creator);
54074
+ };
53768
54075
  }
53769
54076
  ElementFactory.prototype.registerElement = function (elementType, elementCreator) {
53770
54077
  this.creatorHash[elementType] = elementCreator;
@@ -53775,13 +54082,12 @@ var ElementFactory = /** @class */ (function () {
53775
54082
  ElementFactory.prototype.unregisterElement = function (elementType, removeFromSerializer) {
53776
54083
  if (removeFromSerializer === void 0) { removeFromSerializer = false; }
53777
54084
  delete this.creatorHash[elementType];
53778
- QuestionFactory.Instance.unregisterElement(elementType);
53779
54085
  if (removeFromSerializer) {
53780
54086
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(elementType);
53781
54087
  }
53782
54088
  };
53783
54089
  ElementFactory.prototype.getAllTypes = function () {
53784
- var result = QuestionFactory.Instance.getAllTypes();
54090
+ var result = new Array();
53785
54091
  for (var key in this.creatorHash) {
53786
54092
  result.push(key);
53787
54093
  }
@@ -53789,9 +54095,9 @@ var ElementFactory = /** @class */ (function () {
53789
54095
  };
53790
54096
  ElementFactory.prototype.createElement = function (elementType, name) {
53791
54097
  var creator = this.creatorHash[elementType];
53792
- if (creator == null)
53793
- return QuestionFactory.Instance.createQuestion(elementType, name);
53794
- return creator(name);
54098
+ if (!!creator)
54099
+ return creator(name);
54100
+ return null;
53795
54101
  };
53796
54102
  ElementFactory.Instance = new ElementFactory();
53797
54103
  return ElementFactory;
@@ -54152,12 +54458,14 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
54152
54458
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
54153
54459
  ? ""
54154
54460
  : this.question.booleanValue, id: this.question.inputId, className: cssClasses.control, disabled: this.isDisplayMode, checked: this.question.booleanValue || false, onChange: this.handleOnChange, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
54155
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(false), onClick: function (event) { return _this.handleOnLabelClick(event, false); } }, this.renderLocString(this.question.locLabelFalse)),
54461
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, false); } },
54462
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(false) }, this.renderLocString(this.question.locLabelFalse))),
54156
54463
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
54157
54464
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
54158
54465
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
54159
54466
  : null)),
54160
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(true), onClick: function (event) { return _this.handleOnLabelClick(event, true); } }, this.renderLocString(this.question.locLabelTrue)))));
54467
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, true); } },
54468
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(true) }, this.renderLocString(this.question.locLabelTrue))))));
54161
54469
  };
54162
54470
  return SurveyQuestionBoolean;
54163
54471
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
@@ -54338,7 +54646,7 @@ var SurveyActionBarItem = /** @class */ (function (_super) {
54338
54646
  var title = this.item.tooltip || this.item.title;
54339
54647
  var buttonContent = this.renderButtonContent();
54340
54648
  var tabIndex = this.item.disableTabStop ? -1 : undefined;
54341
- var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function () { return _this.item.action(_this.item); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), null, { processEsc: false });
54649
+ var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function (args) { return _this.item.action(_this.item, _this.item.getIsTrusted(args)); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), null, { processEsc: false });
54342
54650
  return button;
54343
54651
  };
54344
54652
  return SurveyActionBarItem;
@@ -55879,7 +56187,7 @@ var RatingItemSmiley = /** @class */ (function (_super) {
55879
56187
  };
55880
56188
  RatingItemSmiley.prototype.render = function () {
55881
56189
  var _this = this;
55882
- return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
56190
+ return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { style: this.question.getItemStyle(this.item.itemValue, this.item.highlight), className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
55883
56191
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
55884
56192
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { size: "auto", iconName: this.question.getItemSmileyIconName(this.item.itemValue), title: this.item.text })));
55885
56193
  };
@@ -57897,8 +58205,9 @@ var SurveyPanel = /** @class */ (function (_super) {
57897
58205
  _this.panelBase.focusIn();
57898
58206
  };
57899
58207
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { ref: this.rootRef, className: this.panelBase.getContainerCss(), onFocus: focusIn, id: this.panelBase.id },
58208
+ this.panel.showErrorsAbovePanel ? errors : null,
57900
58209
  header,
57901
- errors,
58210
+ this.panel.showErrorsAbovePanel ? null : errors,
57902
58211
  content));
57903
58212
  };
57904
58213
  SurveyPanel.prototype.renderHeader = function () {
@@ -58260,7 +58569,8 @@ var Survey = /** @class */ (function (_super) {
58260
58569
  var rootCss = this.survey.getRootCss();
58261
58570
  var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
58262
58571
  var rootStyle = {
58263
- backgroundImage: this.survey.renderBackgroundImage
58572
+ backgroundImage: this.survey.renderBackgroundImage,
58573
+ backgroundSize: this.survey.backgroundImageFit
58264
58574
  };
58265
58575
  var formStyle = {
58266
58576
  backgroundColor: this.survey.renderBackgroundOpacity
@@ -59909,7 +60219,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
59909
60219
  };
59910
60220
  SurveyElementBase.renderQuestionDescription = function (question) {
59911
60221
  var descriptionText = SurveyElementBase.renderLocString(question.locDescription);
59912
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: question.cssDescription }, descriptionText);
60222
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: question.isDescriptionVisible ? undefined : { display: "none" }, className: question.cssDescription }, descriptionText);
59913
60223
  };
59914
60224
  SurveyElementBase.prototype.componentDidMount = function () {
59915
60225
  this.makeBaseElementsReact();
@@ -65046,6 +65356,13 @@ var SurveyElement = /** @class */ (function (_super) {
65046
65356
  SurveyElement.prototype.shouldAddRunnerStyles = function () {
65047
65357
  return !this.isDesignMode && this.isDefaultV2Theme;
65048
65358
  };
65359
+ Object.defineProperty(SurveyElement.prototype, "isCompact", {
65360
+ get: function () {
65361
+ return this.survey && this.survey["isCompact"];
65362
+ },
65363
+ enumerable: false,
65364
+ configurable: true
65365
+ });
65049
65366
  SurveyElement.prototype.getHasFrameV2 = function () {
65050
65367
  return this.shouldAddRunnerStyles() && (!this.hasParent && this.isSingleInRow);
65051
65368
  };
@@ -65054,7 +65371,8 @@ var SurveyElement = /** @class */ (function (_super) {
65054
65371
  };
65055
65372
  SurveyElement.prototype.getCssRoot = function (cssClasses) {
65056
65373
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
65057
- .append(cssClasses.withFrame, this.getHasFrameV2())
65374
+ .append(cssClasses.withFrame, this.getHasFrameV2() && !this.isCompact)
65375
+ .append(cssClasses.compact, this.isCompact && this.getHasFrameV2())
65058
65376
  .append(cssClasses.collapsed, !!this.isCollapsed)
65059
65377
  .append(cssClasses.expanded, !!this.isExpanded)
65060
65378
  .append(cssClasses.nested, this.getIsNested())
@@ -65187,6 +65505,13 @@ var SurveyElement = /** @class */ (function (_super) {
65187
65505
  enumerable: false,
65188
65506
  configurable: true
65189
65507
  });
65508
+ Object.defineProperty(SurveyElement.prototype, "isDescriptionVisible", {
65509
+ get: function () {
65510
+ return (!!this.description || this.isDesignMode);
65511
+ },
65512
+ enumerable: false,
65513
+ configurable: true
65514
+ });
65190
65515
  Object.defineProperty(SurveyElement.prototype, "rootStyle", {
65191
65516
  get: function () {
65192
65517
  var style = {};
@@ -66061,6 +66386,7 @@ var SurveyModel = /** @class */ (function (_super) {
66061
66386
  _this.hideRequiredErrors = false;
66062
66387
  //#endregion
66063
66388
  _this._isMobile = false;
66389
+ _this._isCompact = false;
66064
66390
  _this._isDesignMode = false;
66065
66391
  /**
66066
66392
  * Gets or sets whether the survey must ignore validation like required questions and others, on `nextPage` and `completeLastPage` function calls. The default is `false`.
@@ -67434,6 +67760,19 @@ var SurveyModel = /** @class */ (function (_super) {
67434
67760
  enumerable: false,
67435
67761
  configurable: true
67436
67762
  });
67763
+ Object.defineProperty(SurveyModel.prototype, "isCompact", {
67764
+ get: function () {
67765
+ return this._isCompact;
67766
+ },
67767
+ set: function (newVal) {
67768
+ if (newVal !== this._isCompact) {
67769
+ this._isCompact = newVal;
67770
+ this.updateElementCss();
67771
+ }
67772
+ },
67773
+ enumerable: false,
67774
+ configurable: true
67775
+ });
67437
67776
  SurveyModel.prototype.isLogoImageChoosen = function () {
67438
67777
  return this.locLogo.renderedHtml;
67439
67778
  };
@@ -71099,7 +71438,7 @@ var SurveyModel = /** @class */ (function (_super) {
71099
71438
  values[name] = this.getValue(name);
71100
71439
  }
71101
71440
  this.addCalculatedValuesIntoFilteredValues(values);
71102
- this.checkTriggers(values, true);
71441
+ this.checkTriggers(values, true, isOnComplete);
71103
71442
  };
71104
71443
  SurveyModel.prototype.getCurrentPageQuestions = function (includeInvsible) {
71105
71444
  if (includeInvsible === void 0) { includeInvsible = false; }
@@ -72144,6 +72483,12 @@ var SurveyModel = /** @class */ (function (_super) {
72144
72483
  SurveyModel.prototype.getInCorrectAnswerCount = function () {
72145
72484
  return this.getCorrectedAnswerCountCore(false);
72146
72485
  };
72486
+ SurveyModel.prototype.onCorrectQuestionAnswer = function (question, options) {
72487
+ if (this.onIsAnswerCorrect.isEmpty)
72488
+ return;
72489
+ options.question = question;
72490
+ this.onIsAnswerCorrect.fire(this, options);
72491
+ };
72147
72492
  SurveyModel.prototype.getCorrectedAnswerCountCore = function (isCorrect) {
72148
72493
  var questions = this.getQuizQuestions();
72149
72494
  var counter = 0;
@@ -72802,9 +73147,15 @@ var SurveyModel = /** @class */ (function (_super) {
72802
73147
  __decorate([
72803
73148
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
72804
73149
  ], SurveyModel.prototype, "_isMobile", void 0);
73150
+ __decorate([
73151
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
73152
+ ], SurveyModel.prototype, "_isCompact", void 0);
72805
73153
  __decorate([
72806
73154
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
72807
73155
  ], SurveyModel.prototype, "renderBackgroundImage", void 0);
73156
+ __decorate([
73157
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
73158
+ ], SurveyModel.prototype, "backgroundImageFit", void 0);
72808
73159
  __decorate([
72809
73160
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
72810
73161
  ], SurveyModel.prototype, "rootCss", void 0);
@@ -73051,6 +73402,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
73051
73402
  },
73052
73403
  "width",
73053
73404
  { name: "backgroundImage", serializationProperty: "locBackgroundImage", visible: false },
73405
+ { name: "backgroundImageFit", default: "cover", choices: ["auto", "contain", "cover"], visible: false },
73054
73406
  { name: "backgroundOpacity:number", minValue: 0, maxValue: 1, default: 1, visible: false },
73055
73407
  { name: "showBrandInfo:boolean", default: false, visible: false }
73056
73408
  ]);