survey-react 1.9.84 → 1.9.85

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.85
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 () {
@@ -4930,6 +4948,7 @@ var modernCss = {
4930
4948
  slider: "sv-boolean__slider",
4931
4949
  label: "sv-boolean__label",
4932
4950
  disabledLabel: "sv-boolean__label--disabled",
4951
+ sliderGhost: "sv-boolean__thumb-ghost",
4933
4952
  //checkbox
4934
4953
  rootCheckbox: "sv_qbln",
4935
4954
  checkboxItem: "sv-boolean sv-item",
@@ -5270,6 +5289,7 @@ var defaultStandardCss = {
5270
5289
  slider: "sv-boolean__slider",
5271
5290
  label: "sv-boolean__label ",
5272
5291
  disabledLabel: "sv-boolean__label--disabled",
5292
+ sliderGhost: "sv-boolean__thumb-ghost",
5273
5293
  //checkbox
5274
5294
  rootCheckbox: "sv_qcbc sv_qbln",
5275
5295
  checkboxItem: "sv-boolean",
@@ -5641,6 +5661,7 @@ var defaultV2Css = {
5641
5661
  nested: "sd-element--nested",
5642
5662
  invisible: "sd-element--invisible",
5643
5663
  navigationButton: "",
5664
+ compact: "sd-element--with-frame sd-element--compact"
5644
5665
  },
5645
5666
  paneldynamic: {
5646
5667
  mainRoot: "sd-element sd-question sd-question--paneldynamic sd-element--complex sd-question--complex sd-row__question",
@@ -5668,7 +5689,8 @@ var defaultV2Css = {
5668
5689
  footerButtonsContainer: "sd-paneldynamic__buttons-container",
5669
5690
  panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
5670
5691
  progressBtnIcon: "icon-progressbuttonv2",
5671
- noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder"
5692
+ noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
5693
+ compact: "sd-element--with-frame sd-element--compact"
5672
5694
  },
5673
5695
  progress: "sd-progress sd-body__progress",
5674
5696
  progressTop: "sd-body__progress--top",
@@ -5698,6 +5720,7 @@ var defaultV2Css = {
5698
5720
  pageDescription: "sd-description sd-page__description",
5699
5721
  row: "sd-row sd-clearfix",
5700
5722
  rowMultiple: "sd-row--multiple",
5723
+ rowCompact: "sd-row--compact",
5701
5724
  pageRow: "sd-page__row",
5702
5725
  question: {
5703
5726
  mainRoot: "sd-element sd-question sd-row__question",
@@ -5818,11 +5841,13 @@ var defaultV2Css = {
5818
5841
  itemChecked: "sd-boolean--checked",
5819
5842
  itemIndeterminate: "sd-boolean--indeterminate",
5820
5843
  itemDisabled: "sd-boolean--disabled",
5844
+ itemHover: "sd-boolean--allowhover",
5821
5845
  label: "sd-boolean__label",
5822
5846
  switch: "sd-boolean__switch",
5823
5847
  disabledLabel: "sd-checkbox__label--disabled",
5824
5848
  sliderText: "sd-boolean__thumb-text",
5825
5849
  slider: "sd-boolean__thumb",
5850
+ sliderGhost: "sd-boolean__thumb-ghost",
5826
5851
  //radio
5827
5852
  radioItem: "sd-item",
5828
5853
  radioItemChecked: "sd-item--checked sd-radio--checked",
@@ -5941,7 +5966,8 @@ var defaultV2Css = {
5941
5966
  cellText: "sd-matrix__text",
5942
5967
  cellTextSelected: "sd-matrix__text--checked",
5943
5968
  cellTextDisabled: "sd-matrix__text--disabled",
5944
- cellResponsiveTitle: "sd-matrix__responsive-title"
5969
+ cellResponsiveTitle: "sd-matrix__responsive-title",
5970
+ compact: "sd-element--with-frame sd-element--compact"
5945
5971
  },
5946
5972
  matrixdropdown: {
5947
5973
  mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
@@ -5966,7 +5992,8 @@ var defaultV2Css = {
5966
5992
  actionsCell: "sd-table__cell sd-table__cell--actions",
5967
5993
  emptyCell: "sd-table__cell--empty",
5968
5994
  verticalCell: "sd-table__cell--vertical",
5969
- cellQuestionWrapper: "sd-table__question-wrapper"
5995
+ cellQuestionWrapper: "sd-table__question-wrapper",
5996
+ compact: "sd-element--with-frame sd-element--compact"
5970
5997
  },
5971
5998
  matrixdynamic: {
5972
5999
  mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
@@ -6003,7 +6030,8 @@ var defaultV2Css = {
6003
6030
  ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
6004
6031
  emptyCell: "sd-table__cell--empty",
6005
6032
  verticalCell: "sd-table__cell--vertical",
6006
- cellQuestionWrapper: "sd-table__question-wrapper"
6033
+ cellQuestionWrapper: "sd-table__question-wrapper",
6034
+ compact: "sd-element--with-frame sd-element--compact"
6007
6035
  },
6008
6036
  rating: {
6009
6037
  rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase",
@@ -6025,6 +6053,9 @@ var defaultV2Css = {
6025
6053
  itemSmileyHover: "sd-rating__item-smiley--allowhover",
6026
6054
  itemSmileySelected: "sd-rating__item-smiley--selected",
6027
6055
  itemSmileyDisabled: "sd-rating__item-smiley--disabled",
6056
+ itemSmileyHighlighted: "sd-rating__item-star--highlighted",
6057
+ itemSmileyScaleColored: "sd-rating__item-smiley--scale-colored",
6058
+ itemSmileyRateColored: "sd-rating__item-smiley--rate-colored",
6028
6059
  minText: "sd-rating__item-text sd-rating__min-text",
6029
6060
  itemText: "sd-rating__item-text",
6030
6061
  maxText: "sd-rating__item-text sd-rating__max-text",
@@ -6151,7 +6182,8 @@ var defaultV2Css = {
6151
6182
  root: "sv-list__container sd-list",
6152
6183
  item: "sv-list__item sd-list__item",
6153
6184
  itemBody: "sv-list__item-body sd-list__item-body",
6154
- itemSelected: "sv-list__item--selected sd-list__item--selected"
6185
+ itemSelected: "sv-list__item--selected sd-list__item--selected",
6186
+ itemFocused: "sv-list__item--focused sd-list__item--focused",
6155
6187
  },
6156
6188
  actionBar: {
6157
6189
  root: "sd-action-bar",
@@ -8250,6 +8282,11 @@ var DropdownListModel = /** @class */ (function (_super) {
8250
8282
  this.filterString = undefined;
8251
8283
  }
8252
8284
  };
8285
+ DropdownListModel.prototype.clear = function () {
8286
+ this.inputString = null;
8287
+ this.hintString = "";
8288
+ this.resetFilterString();
8289
+ };
8253
8290
  DropdownListModel.prototype.onSetFilterString = function () {
8254
8291
  var _this = this;
8255
8292
  if (!!this.filterString && !this.popupModel.isVisible) {
@@ -8410,9 +8447,6 @@ var DropdownListModel = /** @class */ (function (_super) {
8410
8447
  };
8411
8448
  DropdownListModel.prototype.onClear = function (event) {
8412
8449
  this.question.clearValue();
8413
- this.inputString = null;
8414
- this.hintString = "";
8415
- this.resetFilterString();
8416
8450
  if (event) {
8417
8451
  event.preventDefault();
8418
8452
  event.stopPropagation();
@@ -8759,6 +8793,10 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
8759
8793
  this.question.renderedValue = newValue;
8760
8794
  this.updateListState();
8761
8795
  };
8796
+ DropdownMultiSelectListModel.prototype.clear = function () {
8797
+ _super.prototype.clear.call(this);
8798
+ this.syncFilterStringPlaceholder();
8799
+ };
8762
8800
  DropdownMultiSelectListModel.prototype.onClear = function (event) {
8763
8801
  _super.prototype.onClear.call(this, event);
8764
8802
  this.updateListState();
@@ -9550,7 +9588,7 @@ __webpack_require__.r(__webpack_exports__);
9550
9588
  // import "../../main.scss";
9551
9589
  //import "../../modern.scss";
9552
9590
  var Version;
9553
- Version = "" + "1.9.84";
9591
+ Version = "" + "1.9.85";
9554
9592
  function checkLibraryVersion(ver, libraryName) {
9555
9593
  if (Version != ver) {
9556
9594
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -16274,6 +16312,37 @@ var Helpers = /** @class */ (function () {
16274
16312
  }
16275
16313
  return true;
16276
16314
  };
16315
+ Helpers.compareStrings = function (x, y) {
16316
+ if (!!x)
16317
+ x = x.trim();
16318
+ if (!!y)
16319
+ y = y.trim();
16320
+ if (!x && !y)
16321
+ return 0;
16322
+ if (!x)
16323
+ return -1;
16324
+ if (!y)
16325
+ return 1;
16326
+ if (x === y)
16327
+ return 0;
16328
+ var digitIndex = -1;
16329
+ for (var i = 0; i < x.length && i < y.length; i++) {
16330
+ if (this.isCharDigit(x[i]) && this.isCharDigit(y[i])) {
16331
+ digitIndex = i;
16332
+ break;
16333
+ }
16334
+ if (x[i] !== y[i])
16335
+ break;
16336
+ }
16337
+ if (digitIndex > -1) {
16338
+ var nX = this.getNumberFromStr(x, digitIndex);
16339
+ var nY = this.getNumberFromStr(y, digitIndex);
16340
+ if (!Number.isNaN(nX) && !Number.isNaN(nY) && nX !== nY) {
16341
+ return nX > nY ? 1 : -1;
16342
+ }
16343
+ }
16344
+ return x > y ? 1 : -1;
16345
+ };
16277
16346
  Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
16278
16347
  if (ignoreOrder === void 0) { ignoreOrder = false; }
16279
16348
  if (x === y)
@@ -16480,6 +16549,18 @@ var Helpers = /** @class */ (function () {
16480
16549
  Helpers.isCharDigit = function (ch) {
16481
16550
  return ch >= "0" && ch <= "9";
16482
16551
  };
16552
+ Helpers.getNumberFromStr = function (str, index) {
16553
+ if (!this.isCharDigit(str[index]))
16554
+ return NaN;
16555
+ var nStr = "";
16556
+ while (index < str.length && this.isCharDigit(str[index])) {
16557
+ nStr += str[index];
16558
+ index++;
16559
+ }
16560
+ if (!nStr)
16561
+ return NaN;
16562
+ return this.getNumber(nStr);
16563
+ };
16483
16564
  Helpers.countDecimals = function (value) {
16484
16565
  if (Helpers.isNumber(value) && Math.floor(value) !== value) {
16485
16566
  var strs = value.toString().split(".");
@@ -19632,6 +19713,20 @@ var ListModel = /** @class */ (function (_super) {
19632
19713
  this.onFilterStringChangedCallback(text);
19633
19714
  }
19634
19715
  };
19716
+ ListModel.prototype.scrollToItem = function (selector, ms) {
19717
+ var _this = this;
19718
+ if (ms === void 0) { ms = 0; }
19719
+ setTimeout(function () {
19720
+ if (!_this.listContainerHtmlElement)
19721
+ return;
19722
+ var item = _this.listContainerHtmlElement.querySelector("." + selector);
19723
+ if (item) {
19724
+ setTimeout(function () {
19725
+ item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
19726
+ }, ms);
19727
+ }
19728
+ }, ms);
19729
+ };
19635
19730
  ListModel.prototype.setItems = function (items, sortByVisibleIndex) {
19636
19731
  var _this = this;
19637
19732
  if (sortByVisibleIndex === void 0) { sortByVisibleIndex = true; }
@@ -19793,15 +19888,10 @@ var ListModel = /** @class */ (function (_super) {
19793
19888
  }
19794
19889
  };
19795
19890
  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);
19891
+ this.scrollToItem(this.getDefaultCssClasses().itemFocused);
19892
+ };
19893
+ ListModel.prototype.scrollToSelectedItem = function () {
19894
+ this.scrollToItem(this.getDefaultCssClasses().itemSelected, 110);
19805
19895
  };
19806
19896
  ListModel.prototype.addScrollEventListener = function (handler) {
19807
19897
  if (!!handler) {
@@ -26509,7 +26599,7 @@ var PageModel = /** @class */ (function (_super) {
26509
26599
  configurable: true
26510
26600
  });
26511
26601
  PageModel.prototype.calcCssClasses = function (css) {
26512
- var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "" };
26602
+ var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
26513
26603
  this.copyCssClasses(classes.page, css.page);
26514
26604
  if (!!css.pageTitle) {
26515
26605
  classes.pageTitle = css.pageTitle;
@@ -26526,6 +26616,9 @@ var PageModel = /** @class */ (function (_super) {
26526
26616
  if (!!css.rowMultiple) {
26527
26617
  classes.rowMultiple = css.rowMultiple;
26528
26618
  }
26619
+ if (!!css.rowCompact) {
26620
+ classes.rowCompact = css.rowCompact;
26621
+ }
26529
26622
  if (this.survey) {
26530
26623
  this.survey.updatePageCssClasses(this, classes);
26531
26624
  }
@@ -26994,6 +27087,7 @@ var QuestionRowModel = /** @class */ (function (_super) {
26994
27087
  QuestionRowModel.prototype.getRowCss = function () {
26995
27088
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
26996
27089
  .append(this.panel.cssClasses.row)
27090
+ .append(this.panel.cssClasses.rowCompact, this.panel["isCompact"])
26997
27091
  .append(this.panel.cssClasses.pageRow, this.panel.isPage || (!!this.panel.originalPage && !this.panel.survey.isShowingPreview))
26998
27092
  .append(this.panel.cssClasses.rowMultiple, this.visibleElements.length > 1)
26999
27093
  .toString();
@@ -27242,12 +27336,15 @@ var PanelModelBase = /** @class */ (function (_super) {
27242
27336
  configurable: true
27243
27337
  });
27244
27338
  PanelModelBase.prototype.calcCssClasses = function (css) {
27245
- var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "" };
27339
+ var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
27246
27340
  this.copyCssClasses(classes.panel, css.panel);
27247
27341
  this.copyCssClasses(classes.error, css.error);
27248
27342
  if (!!css.pageRow) {
27249
27343
  classes.pageRow = css.pageRow;
27250
27344
  }
27345
+ if (!!css.rowCompact) {
27346
+ classes.rowCompact = css.rowCompact;
27347
+ }
27251
27348
  if (!!css.row) {
27252
27349
  classes.row = css.row;
27253
27350
  }
@@ -28939,6 +29036,7 @@ var defaultCss = {
28939
29036
  slider: "sv-boolean__slider",
28940
29037
  label: "sv-boolean__label ",
28941
29038
  disabledLabel: "sv-boolean__label--disabled",
29039
+ sliderGhost: "sv-boolean__thumb-ghost",
28942
29040
  materialDecorator: "sv-item__decorator sv-boolean__decorator",
28943
29041
  itemDecorator: "sv-item__svg sv-boolean__svg",
28944
29042
  checkedPath: "sv-boolean__checked-path",
@@ -29382,6 +29480,7 @@ var defaultCss = {
29382
29480
  slider: "sv-boolean__slider",
29383
29481
  label: "sv-boolean__label ",
29384
29482
  disabledLabel: "sv-boolean__label--disabled",
29483
+ sliderGhost: "sv-boolean__thumb-ghost",
29385
29484
  materialDecorator: "sv-item__decorator sv-boolean__decorator",
29386
29485
  itemDecorator: "sv-item__svg sv-boolean__svg",
29387
29486
  checkedPath: "sv-boolean__checked-path",
@@ -33128,9 +33227,15 @@ var Question = /** @class */ (function (_super) {
33128
33227
  return 1;
33129
33228
  };
33130
33229
  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;
33230
+ return this.checkIfAnswerCorrect() ? 1 : 0;
33231
+ };
33232
+ Question.prototype.checkIfAnswerCorrect = function () {
33233
+ var isEqual = this.isTwoValueEquals(this.value, this.correctAnswer, !_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].comparator.caseSensitive, true);
33234
+ var options = { result: isEqual, correctAnswer: isEqual ? 1 : 0 };
33235
+ if (!!this.survey) {
33236
+ this.survey.onCorrectQuestionAnswer(this, options);
33237
+ }
33238
+ return options.result;
33134
33239
  };
33135
33240
  /**
33136
33241
  * Returns `true` if a question answer matches the `correctAnswer` property value.
@@ -35539,11 +35644,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
35539
35644
  };
35540
35645
  QuestionSelectBase.prototype.sortArray = function (array, mult) {
35541
35646
  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;
35647
+ return _helpers__WEBPACK_IMPORTED_MODULE_8__["Helpers"].compareStrings(a.calculatedText, b.calculatedText) * mult;
35547
35648
  });
35548
35649
  };
35549
35650
  QuestionSelectBase.prototype.randomizeArray = function (array) {
@@ -36344,6 +36445,7 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
36344
36445
  .append(css.item)
36345
36446
  .append(css.itemOnError, this.errors.length > 0)
36346
36447
  .append(css.itemDisabled, this.isReadOnly)
36448
+ .append(css.itemHover, !this.isDesignMode)
36347
36449
  .append(css.itemChecked, !!this.booleanValue)
36348
36450
  .append(css.itemIndeterminate, this.booleanValue === null)
36349
36451
  .toString();
@@ -38726,6 +38828,13 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
38726
38828
  }
38727
38829
  return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
38728
38830
  };
38831
+ QuestionDropdownModel.prototype.needConvertRenderedOtherToDataValue = function () {
38832
+ var _a;
38833
+ var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
38834
+ if (!val)
38835
+ return false;
38836
+ return _super.prototype.hasUnknownValue.call(this, val, true, false);
38837
+ };
38729
38838
  QuestionDropdownModel.prototype.onVisibleChoicesChanged = function () {
38730
38839
  _super.prototype.onVisibleChoicesChanged.call(this);
38731
38840
  if (this.popupModel) {
@@ -38739,8 +38848,10 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
38739
38848
  return this.inputId + "_0";
38740
38849
  };
38741
38850
  QuestionDropdownModel.prototype.clearValue = function () {
38851
+ var _a;
38742
38852
  _super.prototype.clearValue.call(this);
38743
38853
  this.lastSelectedItemValue = null;
38854
+ (_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
38744
38855
  };
38745
38856
  QuestionDropdownModel.prototype.onClick = function (e) {
38746
38857
  !!this.onOpenedCallBack && this.onOpenedCallBack();
@@ -45627,7 +45738,12 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
45627
45738
  return this.cell.column.locCellHint.renderedHtml;
45628
45739
  }
45629
45740
  if (this.cell.column.isShowInMultipleColumns) {
45630
- return this.item.locText.renderedHtml;
45741
+ if (!!this.item) {
45742
+ return this.item.locText.renderedHtml;
45743
+ }
45744
+ else {
45745
+ return "";
45746
+ }
45631
45747
  }
45632
45748
  }
45633
45749
  if (this.question && this.question.isVisible) {
@@ -51365,6 +51481,9 @@ var RenderedRatingItem = /** @class */ (function (_super) {
51365
51481
  __decorate([
51366
51482
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
51367
51483
  ], RenderedRatingItem.prototype, "text", void 0);
51484
+ __decorate([
51485
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
51486
+ ], RenderedRatingItem.prototype, "style", void 0);
51368
51487
  return RenderedRatingItem;
51369
51488
  }(_base__WEBPACK_IMPORTED_MODULE_7__["Base"]));
51370
51489
 
@@ -51378,6 +51497,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51378
51497
  function QuestionRatingModel(name) {
51379
51498
  var _this = _super.call(this, name) || this;
51380
51499
  _this._syncPropertiesChanging = false;
51500
+ _this.initColors();
51381
51501
  _this.createItemValues("rateValues");
51382
51502
  _this.createRenderedRateItems();
51383
51503
  _this.createLocalizableString("ratingOptionsCaption", _this, false, true);
@@ -51393,12 +51513,17 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51393
51513
  _this.setIconsToRateValues();
51394
51514
  _this.createRenderedRateItems();
51395
51515
  });
51516
+ _this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
51517
+ _this.initColors();
51518
+ });
51396
51519
  _this.registerFunctionOnPropertiesValueChanged(["autoGenerate"], function () {
51397
51520
  if (!_this.autoGenerate && _this.rateValues.length === 0) {
51398
51521
  _this.setPropertyValue("rateValues", _this.visibleRateValues);
51399
51522
  }
51400
- if (_this.autoGenerate)
51523
+ if (_this.autoGenerate) {
51524
+ _this.rateValues.length = 0;
51401
51525
  _this.updateRateMax();
51526
+ }
51402
51527
  _this.createRenderedRateItems();
51403
51528
  });
51404
51529
  _this.createLocalizableString("minRateDescription", _this, true);
@@ -51408,8 +51533,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51408
51533
  }
51409
51534
  QuestionRatingModel.prototype.setIconsToRateValues = function () {
51410
51535
  var _this = this;
51411
- if (this.rateType == "smileys")
51536
+ if (this.rateType == "smileys") {
51412
51537
  this.rateValues.map(function (item) { return item.icon = _this.getItemSmiley(item); });
51538
+ }
51413
51539
  };
51414
51540
  QuestionRatingModel.prototype.startLoadingFromJson = function (jsonObj) {
51415
51541
  _super.prototype.startLoadingFromJson.call(this, jsonObj);
@@ -51417,6 +51543,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51417
51543
  };
51418
51544
  QuestionRatingModel.prototype.endLoadingFromJson = function () {
51419
51545
  _super.prototype.endLoadingFromJson.call(this);
51546
+ this.initColors();
51420
51547
  this.hasMinRateDescription = !!this.minRateDescription;
51421
51548
  this.hasMaxRateDescription = !!this.maxRateDescription;
51422
51549
  if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
@@ -51462,6 +51589,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51462
51589
  newCount = 10;
51463
51590
  }
51464
51591
  this.rateCount = newCount;
51592
+ if (this.rateValues.length > newCount)
51593
+ this.rateValues.length = newCount;
51465
51594
  };
51466
51595
  QuestionRatingModel.prototype.initPropertyDependencies = function () {
51467
51596
  var _this = this;
@@ -51572,6 +51701,39 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51572
51701
  enumerable: false,
51573
51702
  configurable: true
51574
51703
  });
51704
+ QuestionRatingModel.prototype.initColors = function () {
51705
+ if (this.colorMode === "monochrome")
51706
+ return;
51707
+ if (!document)
51708
+ return;
51709
+ if (QuestionRatingModel.badColor && QuestionRatingModel.normalColor && QuestionRatingModel.goodColor)
51710
+ return;
51711
+ function getRGBColor(varName) {
51712
+ var style = getComputedStyle(document.documentElement);
51713
+ var str = style.getPropertyValue && style.getPropertyValue(varName);
51714
+ if (!str)
51715
+ return null;
51716
+ var ctx = document.createElement("canvas").getContext("2d");
51717
+ ctx.fillStyle = str;
51718
+ var newStr = ctx.fillStyle;
51719
+ if (newStr.startsWith("rgba")) {
51720
+ return newStr.substring(5, newStr.length - 1).split(",").map(function (c) { return +(c.trim()); });
51721
+ }
51722
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(newStr);
51723
+ return result ? [
51724
+ parseInt(result[1], 16),
51725
+ parseInt(result[2], 16),
51726
+ parseInt(result[3], 16),
51727
+ 1
51728
+ ] : null;
51729
+ }
51730
+ QuestionRatingModel.badColor = getRGBColor("--sd-rating-bad-color");
51731
+ QuestionRatingModel.normalColor = getRGBColor("--sd-rating-normal-color");
51732
+ QuestionRatingModel.goodColor = getRGBColor("--sd-rating-good-color");
51733
+ QuestionRatingModel.badColorLight = getRGBColor("--sd-rating-bad-color-light");
51734
+ QuestionRatingModel.normalColorLight = getRGBColor("--sd-rating-normal-color-light");
51735
+ QuestionRatingModel.goodColorLight = getRGBColor("--sd-rating-good-color-light");
51736
+ };
51575
51737
  QuestionRatingModel.prototype.getDisplayValueCore = function (keysAsText, value) {
51576
51738
  var res = _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"].getTextOrHtmlByValue(this.visibleRateValues, value);
51577
51739
  return !!res ? res : value;
@@ -51611,13 +51773,16 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51611
51773
  if (this.rateType == "smileys" && rateValues.length > 10)
51612
51774
  rateValues = rateValues.slice(0, 10);
51613
51775
  this.renderedRateItems = rateValues.map(function (v, i) {
51776
+ var renderedItem = null;
51614
51777
  if (_this.displayRateDescriptionsAsExtremeItems) {
51615
51778
  if (i == 0)
51616
- return new RenderedRatingItem(v, _this.minRateDescription && _this.locMinRateDescription || v.locText);
51779
+ renderedItem = new RenderedRatingItem(v, _this.minRateDescription && _this.locMinRateDescription || v.locText);
51617
51780
  if (i == rateValues.length - 1)
51618
- return new RenderedRatingItem(v, _this.maxRateDescription && _this.locMaxRateDescription || v.locText);
51781
+ renderedItem = new RenderedRatingItem(v, _this.maxRateDescription && _this.locMaxRateDescription || v.locText);
51619
51782
  }
51620
- return new RenderedRatingItem(v);
51783
+ if (!renderedItem)
51784
+ renderedItem = new RenderedRatingItem(v);
51785
+ return renderedItem;
51621
51786
  });
51622
51787
  };
51623
51788
  QuestionRatingModel.prototype.correctValue = function (value, step) {
@@ -51767,6 +51932,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51767
51932
  return;
51768
51933
  var high = true;
51769
51934
  var selected = this.value != null;
51935
+ if (this.rateType !== "stars") {
51936
+ item.highlight = "highlighted";
51937
+ return;
51938
+ }
51770
51939
  for (var i = 0; i < this.renderedRateItems.length; i++) {
51771
51940
  this.renderedRateItems[i].highlight = high && !selected && "highlighted" || !high && selected && "unhighlighted" || "none";
51772
51941
  if (this.renderedRateItems[i] == item)
@@ -51805,6 +51974,46 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51805
51974
  QuestionRatingModel.prototype.getItemClassByText = function (item, text) {
51806
51975
  return this.getItemClass(item);
51807
51976
  };
51977
+ QuestionRatingModel.prototype.getRenderedItemColor = function (index, light) {
51978
+ var startColor = light ? QuestionRatingModel.badColorLight : QuestionRatingModel.badColor;
51979
+ var endColor = light ? QuestionRatingModel.goodColorLight : QuestionRatingModel.goodColor;
51980
+ var normalIndex = (this.rateCount - 1) / 2.0;
51981
+ var middleColor = light ? QuestionRatingModel.normalColorLight : QuestionRatingModel.normalColor;
51982
+ if (index < normalIndex) {
51983
+ endColor = middleColor;
51984
+ }
51985
+ else {
51986
+ startColor = middleColor;
51987
+ index -= normalIndex;
51988
+ }
51989
+ if (!startColor || !endColor)
51990
+ return null;
51991
+ var curColor = [0, 0, 0, 0];
51992
+ for (var i = 0; i < 4; i++) {
51993
+ curColor[i] = startColor[i] + (endColor[i] - startColor[i]) * index / normalIndex;
51994
+ if (i < 3)
51995
+ curColor[i] = Math.trunc(curColor[i]);
51996
+ }
51997
+ return "rgba(" + curColor[0] + ", " + curColor[1] + ", " + curColor[2] + ", " + curColor[3] + ")";
51998
+ };
51999
+ QuestionRatingModel.prototype.getItemStyle = function (item, highlight) {
52000
+ if (highlight === void 0) { highlight = "none"; }
52001
+ if (this.scaleColorMode === "monochrome" && this.rateColorMode == "default")
52002
+ return { borderColor: null, fill: null, backgroundColor: null };
52003
+ var index = this.visibleRateValues.indexOf(item);
52004
+ var color = this.getRenderedItemColor(index, false);
52005
+ if (this.value != this.renderedRateItems[index].value) {
52006
+ var colorLight = this.getRenderedItemColor(index, true);
52007
+ if (highlight == "highlighted" && this.scaleColorMode === "colored")
52008
+ return { borderColor: color, fill: color, backgroundColor: colorLight };
52009
+ if (this.scaleColorMode === "colored" && this.errors.length == 0)
52010
+ return { borderColor: color, fill: color, backgroundColor: null };
52011
+ return { borderColor: null, fill: null, backgroundColor: null };
52012
+ }
52013
+ else {
52014
+ return { borderColor: color, fill: null, backgroundColor: color };
52015
+ }
52016
+ };
51808
52017
  QuestionRatingModel.prototype.getItemClass = function (item, highlight) {
51809
52018
  var _this = this;
51810
52019
  if (highlight === void 0) { highlight = "none"; }
@@ -51829,6 +52038,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51829
52038
  var itemitemOnErrorClass = this.cssClasses.itemOnError;
51830
52039
  var itemHighlightedClass = null;
51831
52040
  var itemUnhighlightedClass = null;
52041
+ var itemScaleColoredClass = null;
52042
+ var itemRateColoredClass = null;
51832
52043
  if (this.isStar) {
51833
52044
  itemClass = this.cssClasses.itemStar;
51834
52045
  itemSelectedClass = this.cssClasses.itemStarSelected;
@@ -51844,6 +52055,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51844
52055
  itemDisabledClass = this.cssClasses.itemSmileyDisabled;
51845
52056
  itemHoverClass = this.cssClasses.itemSmileyHover;
51846
52057
  itemitemOnErrorClass = this.cssClasses.itemSmileyOnError;
52058
+ itemHighlightedClass = this.cssClasses.itemSmileyHighlighted;
52059
+ itemScaleColoredClass = this.cssClasses.itemSmileyScaleColored;
52060
+ itemRateColoredClass = this.cssClasses.itemSmileyRateColored;
51847
52061
  }
51848
52062
  var hasFixedSize = !this.isStar &&
51849
52063
  !this.isSmiley &&
@@ -51858,6 +52072,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51858
52072
  .append(itemDisabledClass, this.isReadOnly)
51859
52073
  .append(itemHoverClass, allowHover)
51860
52074
  .append(itemHighlightedClass, isHighlighted)
52075
+ .append(itemScaleColoredClass, this.scaleColorMode == "colored")
52076
+ .append(itemRateColoredClass, this.rateColorMode == "scale" && isSelected)
51861
52077
  .append(itemUnhighlightedClass, isUnhighlighted)
51862
52078
  .append(itemitemOnErrorClass, this.errors.length > 0)
51863
52079
  .append(this.cssClasses.itemFixedSize, hasFixedSize)
@@ -52021,7 +52237,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
52021
52237
  ], QuestionRatingModel.prototype, "rateDisplayMode", void 0);
52022
52238
  __decorate([
52023
52239
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
52024
- ], QuestionRatingModel.prototype, "smileysColorMode", void 0);
52240
+ ], QuestionRatingModel.prototype, "scaleColorMode", void 0);
52241
+ __decorate([
52242
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
52243
+ ], QuestionRatingModel.prototype, "rateColorMode", void 0);
52025
52244
  return QuestionRatingModel;
52026
52245
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
52027
52246
 
@@ -52035,18 +52254,38 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52035
52254
  choices: ["labels", "stars", "smileys"],
52036
52255
  visibleIndex: 0
52037
52256
  },
52257
+ {
52258
+ name: "scaleColorMode",
52259
+ category: "rateValues",
52260
+ default: "monochrome",
52261
+ choices: ["monochrome", "colored"],
52262
+ visibleIf: function (obj) {
52263
+ return obj.rateDisplayMode == "smileys";
52264
+ },
52265
+ visibleIndex: 1
52266
+ },
52267
+ {
52268
+ name: "rateColorMode",
52269
+ category: "rateValues",
52270
+ default: "scale",
52271
+ choices: ["default", "scale"],
52272
+ visibleIf: function (obj) {
52273
+ return obj.rateDisplayMode == "smileys" && obj.scaleColorMode == "monochrome";
52274
+ },
52275
+ visibleIndex: 2
52276
+ },
52038
52277
  {
52039
52278
  name: "autoGenerate",
52040
52279
  category: "rateValues",
52041
52280
  default: true,
52042
52281
  choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
52043
- visibleIndex: 2
52282
+ visibleIndex: 4
52044
52283
  },
52045
52284
  {
52046
52285
  name: "rateCount:number",
52047
52286
  default: 5,
52048
52287
  category: "rateValues",
52049
- visibleIndex: 1,
52288
+ visibleIndex: 3,
52050
52289
  onSettingValue: function (obj, val) {
52051
52290
  if (val < 2)
52052
52291
  return 2;
@@ -52066,7 +52305,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52066
52305
  visibleIf: function (obj) {
52067
52306
  return !obj.autoGenerate;
52068
52307
  },
52069
- visibleIndex: 3
52308
+ visibleIndex: 5
52070
52309
  },
52071
52310
  {
52072
52311
  name: "rateMin:number", default: 1,
@@ -52076,7 +52315,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52076
52315
  visibleIf: function (obj) {
52077
52316
  return !!obj.autoGenerate;
52078
52317
  },
52079
- visibleIndex: 4
52318
+ visibleIndex: 6
52080
52319
  },
52081
52320
  {
52082
52321
  name: "rateMax:number", default: 5,
@@ -52086,7 +52325,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52086
52325
  visibleIf: function (obj) {
52087
52326
  return !!obj.autoGenerate;
52088
52327
  },
52089
- visibleIndex: 5
52328
+ visibleIndex: 7
52090
52329
  },
52091
52330
  {
52092
52331
  name: "rateStep:number", default: 1, minValue: 0.1,
@@ -52100,7 +52339,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52100
52339
  visibleIf: function (obj) {
52101
52340
  return !!obj.autoGenerate;
52102
52341
  },
52103
- visibleIndex: 6
52342
+ visibleIndex: 8
52104
52343
  },
52105
52344
  {
52106
52345
  name: "minRateDescription",
@@ -52120,7 +52359,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
52120
52359
  default: "auto",
52121
52360
  choices: ["auto", "buttons", "dropdown"],
52122
52361
  visibleIndex: 20
52123
- },
52362
+ }
52124
52363
  ], function () {
52125
52364
  return new QuestionRatingModel("");
52126
52365
  }, "question");
@@ -52622,6 +52861,13 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
52622
52861
  }
52623
52862
  return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
52624
52863
  };
52864
+ QuestionTagboxModel.prototype.needConvertRenderedOtherToDataValue = function () {
52865
+ var _a;
52866
+ var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
52867
+ if (!val)
52868
+ return false;
52869
+ return _super.prototype.hasUnknownValue.call(this, val, true, false);
52870
+ };
52625
52871
  QuestionTagboxModel.prototype.onVisibleChoicesChanged = function () {
52626
52872
  _super.prototype.onVisibleChoicesChanged.call(this);
52627
52873
  if (this.popupModel) {
@@ -52665,6 +52911,10 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
52665
52911
  this.dropdownListModelValue.dispose();
52666
52912
  }
52667
52913
  };
52914
+ QuestionTagboxModel.prototype.clearValue = function () {
52915
+ _super.prototype.clearValue.call(this);
52916
+ this.dropdownListModel.clear();
52917
+ };
52668
52918
  __decorate([
52669
52919
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
52670
52920
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
@@ -54152,12 +54402,14 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
54152
54402
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
54153
54403
  ? ""
54154
54404
  : 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)),
54405
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, false); } },
54406
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(false) }, this.renderLocString(this.question.locLabelFalse))),
54156
54407
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
54157
54408
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
54158
54409
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
54159
54410
  : 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)))));
54411
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, true); } },
54412
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(true) }, this.renderLocString(this.question.locLabelTrue))))));
54161
54413
  };
54162
54414
  return SurveyQuestionBoolean;
54163
54415
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
@@ -54338,7 +54590,7 @@ var SurveyActionBarItem = /** @class */ (function (_super) {
54338
54590
  var title = this.item.tooltip || this.item.title;
54339
54591
  var buttonContent = this.renderButtonContent();
54340
54592
  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 });
54593
+ 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
54594
  return button;
54343
54595
  };
54344
54596
  return SurveyActionBarItem;
@@ -55879,7 +56131,7 @@ var RatingItemSmiley = /** @class */ (function (_super) {
55879
56131
  };
55880
56132
  RatingItemSmiley.prototype.render = function () {
55881
56133
  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); } },
56134
+ 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
56135
  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
56136
  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
56137
  };
@@ -59909,7 +60161,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
59909
60161
  };
59910
60162
  SurveyElementBase.renderQuestionDescription = function (question) {
59911
60163
  var descriptionText = SurveyElementBase.renderLocString(question.locDescription);
59912
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: question.cssDescription }, descriptionText);
60164
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: question.isDescriptionVisible ? undefined : { display: "none" }, className: question.cssDescription }, descriptionText);
59913
60165
  };
59914
60166
  SurveyElementBase.prototype.componentDidMount = function () {
59915
60167
  this.makeBaseElementsReact();
@@ -65046,6 +65298,13 @@ var SurveyElement = /** @class */ (function (_super) {
65046
65298
  SurveyElement.prototype.shouldAddRunnerStyles = function () {
65047
65299
  return !this.isDesignMode && this.isDefaultV2Theme;
65048
65300
  };
65301
+ Object.defineProperty(SurveyElement.prototype, "isCompact", {
65302
+ get: function () {
65303
+ return this.survey && this.survey["isCompact"];
65304
+ },
65305
+ enumerable: false,
65306
+ configurable: true
65307
+ });
65049
65308
  SurveyElement.prototype.getHasFrameV2 = function () {
65050
65309
  return this.shouldAddRunnerStyles() && (!this.hasParent && this.isSingleInRow);
65051
65310
  };
@@ -65054,7 +65313,8 @@ var SurveyElement = /** @class */ (function (_super) {
65054
65313
  };
65055
65314
  SurveyElement.prototype.getCssRoot = function (cssClasses) {
65056
65315
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
65057
- .append(cssClasses.withFrame, this.getHasFrameV2())
65316
+ .append(cssClasses.withFrame, this.getHasFrameV2() && !this.isCompact)
65317
+ .append(cssClasses.compact, this.isCompact && this.getHasFrameV2())
65058
65318
  .append(cssClasses.collapsed, !!this.isCollapsed)
65059
65319
  .append(cssClasses.expanded, !!this.isExpanded)
65060
65320
  .append(cssClasses.nested, this.getIsNested())
@@ -65187,6 +65447,13 @@ var SurveyElement = /** @class */ (function (_super) {
65187
65447
  enumerable: false,
65188
65448
  configurable: true
65189
65449
  });
65450
+ Object.defineProperty(SurveyElement.prototype, "isDescriptionVisible", {
65451
+ get: function () {
65452
+ return (!!this.description || this.isDesignMode);
65453
+ },
65454
+ enumerable: false,
65455
+ configurable: true
65456
+ });
65190
65457
  Object.defineProperty(SurveyElement.prototype, "rootStyle", {
65191
65458
  get: function () {
65192
65459
  var style = {};
@@ -66061,6 +66328,7 @@ var SurveyModel = /** @class */ (function (_super) {
66061
66328
  _this.hideRequiredErrors = false;
66062
66329
  //#endregion
66063
66330
  _this._isMobile = false;
66331
+ _this._isCompact = false;
66064
66332
  _this._isDesignMode = false;
66065
66333
  /**
66066
66334
  * 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 +67702,19 @@ var SurveyModel = /** @class */ (function (_super) {
67434
67702
  enumerable: false,
67435
67703
  configurable: true
67436
67704
  });
67705
+ Object.defineProperty(SurveyModel.prototype, "isCompact", {
67706
+ get: function () {
67707
+ return this._isCompact;
67708
+ },
67709
+ set: function (newVal) {
67710
+ if (newVal !== this._isCompact) {
67711
+ this._isCompact = newVal;
67712
+ this.updateElementCss();
67713
+ }
67714
+ },
67715
+ enumerable: false,
67716
+ configurable: true
67717
+ });
67437
67718
  SurveyModel.prototype.isLogoImageChoosen = function () {
67438
67719
  return this.locLogo.renderedHtml;
67439
67720
  };
@@ -72144,6 +72425,12 @@ var SurveyModel = /** @class */ (function (_super) {
72144
72425
  SurveyModel.prototype.getInCorrectAnswerCount = function () {
72145
72426
  return this.getCorrectedAnswerCountCore(false);
72146
72427
  };
72428
+ SurveyModel.prototype.onCorrectQuestionAnswer = function (question, options) {
72429
+ if (this.onIsAnswerCorrect.isEmpty)
72430
+ return;
72431
+ options.question = question;
72432
+ this.onIsAnswerCorrect.fire(this, options);
72433
+ };
72147
72434
  SurveyModel.prototype.getCorrectedAnswerCountCore = function (isCorrect) {
72148
72435
  var questions = this.getQuizQuestions();
72149
72436
  var counter = 0;
@@ -72802,6 +73089,9 @@ var SurveyModel = /** @class */ (function (_super) {
72802
73089
  __decorate([
72803
73090
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
72804
73091
  ], SurveyModel.prototype, "_isMobile", void 0);
73092
+ __decorate([
73093
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
73094
+ ], SurveyModel.prototype, "_isCompact", void 0);
72805
73095
  __decorate([
72806
73096
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
72807
73097
  ], SurveyModel.prototype, "renderBackgroundImage", void 0);