survey-react-ui 1.11.4 → 1.11.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "1.11.4",
3
+ "version": "1.11.6",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "typings": "survey-react-ui.d.ts",
23
23
  "peerDependencies": {
24
- "survey-core": "1.11.4",
24
+ "survey-core": "1.11.6",
25
25
  "react": "^16.5.0 || ^17.0.1 || ^18.2.0",
26
26
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0"
27
27
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.11.4
2
+ * surveyjs - Survey JavaScript library v1.11.6
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -328,6 +328,13 @@ var BaseAction = /** @class */ (function (_super) {
328
328
  enumerable: false,
329
329
  configurable: true
330
330
  });
331
+ Object.defineProperty(BaseAction.prototype, "hasSubItems", {
332
+ get: function () {
333
+ return !!this.items && this.items.length > 0;
334
+ },
335
+ enumerable: false,
336
+ configurable: true
337
+ });
331
338
  BaseAction.prototype.getActionBarItemTitleCss = function () {
332
339
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
333
340
  .append(this.cssClasses.itemTitle)
@@ -514,11 +521,13 @@ var Action = /** @class */ (function (_super) {
514
521
  Action.prototype.createLocTitle = function () {
515
522
  return this.createLocalizableString("title", this, true);
516
523
  };
517
- Action.prototype.setItems = function (items, onSelectionChanged) {
524
+ Action.prototype.setSubItems = function (options) {
518
525
  this.markerIconName = "icon-next_16x16";
519
526
  this.component = "sv-list-item-group";
520
- this.items = __spreadArray([], items);
521
- var popupModel = createPopupModelWithListModel({ items: items, onSelectionChanged: onSelectionChanged, searchEnabled: false }, { horizontalPosition: "right", showPointer: false, canShrink: false });
527
+ this.items = __spreadArray([], options.items);
528
+ var listOptions = Object.assign({}, options);
529
+ listOptions.searchEnabled = false;
530
+ var popupModel = createPopupModelWithListModel(listOptions, { horizontalPosition: "right", showPointer: false, canShrink: false });
522
531
  popupModel.cssClass = "sv-popup-inner";
523
532
  this.popupModel = popupModel;
524
533
  };
@@ -557,6 +566,23 @@ var Action = /** @class */ (function (_super) {
557
566
  this.locTooltipChanged();
558
567
  this.locStrChangedInPopupModel();
559
568
  };
569
+ Action.prototype.doAction = function (args) {
570
+ var evt = !!args.originalEvent ? args.originalEvent : args;
571
+ this.action(this, evt.isTrusted);
572
+ evt.preventDefault();
573
+ evt.stopPropagation();
574
+ return true;
575
+ };
576
+ Action.prototype.doMouseDown = function () {
577
+ this.isMouseDown = true;
578
+ };
579
+ Action.prototype.doFocus = function (args) {
580
+ if (!!this.onFocus) {
581
+ var evt = !!args.originalEvent ? args.originalEvent : args;
582
+ this.onFocus(this.isMouseDown, evt);
583
+ }
584
+ this.isMouseDown = false;
585
+ };
560
586
  Action.prototype.locStrChangedInPopupModel = function () {
561
587
  if (!this.popupModel || !this.popupModel.contentComponentData || !this.popupModel.contentComponentData.model)
562
588
  return;
@@ -637,6 +663,9 @@ var Action = /** @class */ (function (_super) {
637
663
  __decorate([
638
664
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
639
665
  ], Action.prototype, "action", void 0);
666
+ __decorate([
667
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
668
+ ], Action.prototype, "onFocus", void 0);
640
669
  __decorate([
641
670
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
642
671
  ], Action.prototype, "_component", void 0);
@@ -1069,9 +1098,6 @@ var ActionContainer = /** @class */ (function (_super) {
1069
1098
  itemValue.showPopupDelayed(_this.subItemsShowDelay);
1070
1099
  _this.popupAfterShowCallback(itemValue);
1071
1100
  }
1072
- else if (!!action.popupModel && action.popupModel.isVisible) {
1073
- action.hidePopupDelayed(_this.subItemsHideDelay);
1074
- }
1075
1101
  });
1076
1102
  };
1077
1103
  ActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {
@@ -3777,7 +3803,7 @@ __webpack_require__.r(__webpack_exports__);
3777
3803
 
3778
3804
 
3779
3805
 
3780
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.4", "survey-react-ui");
3806
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.6", "survey-react-ui");
3781
3807
 
3782
3808
 
3783
3809
  /***/ }),
@@ -10391,7 +10417,7 @@ var JsonObject = /** @class */ (function () {
10391
10417
  JsonObject.prototype.toJsonObjectCore = function (obj, property, options) {
10392
10418
  if (!obj || !obj.getType)
10393
10419
  return obj;
10394
- if (typeof obj.getData === "function")
10420
+ if (!obj.isSurvey && typeof obj.getData === "function")
10395
10421
  return obj.getData();
10396
10422
  var result = {};
10397
10423
  if (property != null && !property.className) {
@@ -10717,6 +10743,7 @@ var defaultListCss = {
10717
10743
  searchClearButtonIcon: "sv-list__filter-clear-button",
10718
10744
  loadingIndicator: "sv-list__loading-indicator",
10719
10745
  itemSelected: "sv-list__item--selected",
10746
+ itemGroup: "sv-list__item--group",
10720
10747
  itemWithIcon: "sv-list__item--with-icon",
10721
10748
  itemDisabled: "sv-list__item--disabled",
10722
10749
  itemFocused: "sv-list__item--focused",
@@ -10782,6 +10809,7 @@ var ListModel = /** @class */ (function (_super) {
10782
10809
  .append(_this.cssClasses.itemDisabled, _this.isItemDisabled(itemValue))
10783
10810
  .append(_this.cssClasses.itemFocused, _this.isItemFocused(itemValue))
10784
10811
  .append(_this.cssClasses.itemSelected, _this.isItemSelected(itemValue))
10812
+ .append(_this.cssClasses.itemGroup, itemValue.hasSubItems)
10785
10813
  .append(_this.cssClasses.itemHovered, itemValue.isHovered)
10786
10814
  .append(_this.cssClasses.itemTextWrap, _this.textWrapEnabled)
10787
10815
  .append(itemValue.css)
@@ -12507,7 +12535,7 @@ var SurveyActionBarItem = /** @class */ (function (_super) {
12507
12535
  var title = this.item.tooltip || this.item.title;
12508
12536
  var buttonContent = this.renderButtonContent();
12509
12537
  var tabIndex = this.item.disableTabStop ? -1 : undefined;
12510
- 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), this.item, { processEsc: false });
12538
+ 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, onMouseDown: function () { return _this.item.doMouseDown(); }, onFocus: function (args) { return _this.item.doFocus(args); }, onClick: function (args) { return _this.item.doAction(args); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
12511
12539
  return button;
12512
12540
  };
12513
12541
  return SurveyActionBarItem;
@@ -14816,7 +14844,7 @@ var RatingItem = /** @class */ (function (_super) {
14816
14844
  var itemText = this.renderLocString(this.item.locText);
14817
14845
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { onMouseDown: this.handleOnMouseDown, className: this.question.getItemClassByText(this.item.itemValue, this.item.text) },
14818
14846
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, 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-errormessage": this.question.ariaErrormessage }),
14819
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText }, itemText)));
14847
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText, "data-text": this.item.text }, itemText)));
14820
14848
  };
14821
14849
  RatingItem.prototype.componentDidMount = function () {
14822
14850
  _super.prototype.componentDidMount.call(this);
@@ -17568,7 +17596,7 @@ var Survey = /** @class */ (function (_super) {
17568
17596
  }
17569
17597
  var rootCss = this.survey.getRootCss();
17570
17598
  var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
17571
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables },
17599
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables, lang: this.survey.locale || "en", dir: this.survey.localeDir },
17572
17600
  this.survey.needRenderIcons ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_svgbundle__WEBPACK_IMPORTED_MODULE_10__["SvgBundleComponent"], null) : null,
17573
17601
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.wrapperFormCss },
17574
17602
  backgroundImage,
@@ -17747,7 +17775,7 @@ function attachKey2click(element, viewModel, options) {
17747
17775
  return false;
17748
17776
  },
17749
17777
  onKeyDown: function (evt) { return Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["doKey2ClickDown"])(evt, options); },
17750
- onBlur: function (evt) { return Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["doKey2ClickBlur"])(evt); }
17778
+ onBlur: function (evt) { return Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["doKey2ClickBlur"])(evt); },
17751
17779
  });
17752
17780
  }
17753
17781
 
@@ -18605,7 +18633,7 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
18605
18633
  var itemLabel = !this.hideCaption ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
18606
18634
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: itemClass, role: "presentation" },
18607
18635
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: labelClass },
18608
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", role: "option", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange }),
18636
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError() }),
18609
18637
  this.cssClasses.materialDecorator ?
18610
18638
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
18611
18639
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
@@ -18755,7 +18783,7 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
18755
18783
  var comment = this.getComment() || "";
18756
18784
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
18757
18785
  }
18758
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, ref: function (textarea) { return (_this.setControl(textarea)); }, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onBlur: function (e) { _this.onCommentChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
18786
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, ref: function (textarea) { return (_this.setControl(textarea)); }, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), rows: question.commentAreaRows, placeholder: this.getPlaceholder(), onBlur: function (e) { _this.onCommentChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
18759
18787
  };
18760
18788
  return SurveyQuestionCommentItem;
18761
18789
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
@@ -22922,11 +22950,18 @@ var settings = {
22922
22950
  */
22923
22951
  ratingMaximumRateValueCount: 20,
22924
22952
  /**
22925
- * Specifies whether to close the drop-down menu of a [TagBox](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.
22953
+ * Specifies whether to close the drop-down menu of a [Multi-Select Dropdown (Tag Box)](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.
22926
22954
  *
22927
- * This setting applies to all TagBox questions on a page. You can use the [closeOnSelect](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual TagBox question.
22955
+ * This setting applies to all Multi-Select Dropdown questions on a web page. You can use the [`closeOnSelect`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual Multi-Select Dropdown question.
22928
22956
  */
22929
22957
  tagboxCloseOnSelect: false,
22958
+ /**
22959
+ * A time interval in milliseconds between the last entered character and the beginning of search in [Single-](https://surveyjs.io/form-library/examples/create-dropdown-menu-in-javascript/) and [Multi-Select Dropdown](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) questions. Applies only to questions with the [`choicesLazyLoadEnabled`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#choicesLazyLoadEnabled) property set to `true`.
22960
+ *
22961
+ * Default value: 500
22962
+ *
22963
+ * [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle))
22964
+ */
22930
22965
  dropdownSearchDelay: 500,
22931
22966
  /**
22932
22967
  * A function that activates a browser confirm dialog.
@@ -23314,6 +23349,42 @@ var SurveyElementCore = /** @class */ (function (_super) {
23314
23349
  SurveyElementCore.prototype.createLocTitleProperty = function () {
23315
23350
  return this.createLocalizableString("title", this, true);
23316
23351
  };
23352
+ Object.defineProperty(SurveyElementCore.prototype, "isPage", {
23353
+ /**
23354
+ * Returns `true` if the survey element is a page.
23355
+ * @see Base.getType
23356
+ */
23357
+ get: function () { return false; },
23358
+ enumerable: false,
23359
+ configurable: true
23360
+ });
23361
+ Object.defineProperty(SurveyElementCore.prototype, "isPanel", {
23362
+ /**
23363
+ * Returns `true` if the survey element is a panel.
23364
+ * @see Base.getType
23365
+ */
23366
+ get: function () { return false; },
23367
+ enumerable: false,
23368
+ configurable: true
23369
+ });
23370
+ Object.defineProperty(SurveyElementCore.prototype, "isQuestion", {
23371
+ /**
23372
+ * Returns `true` if the survey element is a question.
23373
+ * @see Base.getType
23374
+ */
23375
+ get: function () { return false; },
23376
+ enumerable: false,
23377
+ configurable: true
23378
+ });
23379
+ Object.defineProperty(SurveyElementCore.prototype, "isSurvey", {
23380
+ /**
23381
+ * Returns `true` if the element is a survey.
23382
+ * @see Base.getType
23383
+ */
23384
+ get: function () { return false; },
23385
+ enumerable: false,
23386
+ configurable: true
23387
+ });
23317
23388
  Object.defineProperty(SurveyElementCore.prototype, "title", {
23318
23389
  /**
23319
23390
  * A title for the survey element. If `title` is undefined, the `name` property value is displayed instead.
@@ -24145,39 +24216,6 @@ var SurveyElement = /** @class */ (function (_super) {
24145
24216
  SurveyElement.prototype.setVisibleIndex = function (index) {
24146
24217
  return 0;
24147
24218
  };
24148
- Object.defineProperty(SurveyElement.prototype, "isPage", {
24149
- /**
24150
- * Returns `true` if the survey element is a page.
24151
- * @see Base.getType
24152
- */
24153
- get: function () {
24154
- return false;
24155
- },
24156
- enumerable: false,
24157
- configurable: true
24158
- });
24159
- Object.defineProperty(SurveyElement.prototype, "isPanel", {
24160
- /**
24161
- * Returns `true` if the survey element is a panel.
24162
- * @see Base.getType
24163
- */
24164
- get: function () {
24165
- return false;
24166
- },
24167
- enumerable: false,
24168
- configurable: true
24169
- });
24170
- Object.defineProperty(SurveyElement.prototype, "isQuestion", {
24171
- /**
24172
- * Returns `true` if the survey element is a question.
24173
- * @see Base.getType
24174
- */
24175
- get: function () {
24176
- return false;
24177
- },
24178
- enumerable: false,
24179
- configurable: true
24180
- });
24181
24219
  SurveyElement.prototype.delete = function (doDispose) { };
24182
24220
  /**
24183
24221
  * Returns the survey's [locale](https://surveyjs.io/form-library/documentation/surveymodel#locale).
@@ -24741,6 +24779,7 @@ var surveyLocalization = {
24741
24779
  defaultLocaleValue: "en",
24742
24780
  locales: {},
24743
24781
  localeNames: {},
24782
+ localeDirections: {},
24744
24783
  supportedLocales: [],
24745
24784
  get currentLocale() {
24746
24785
  return this.currentLocaleValue === this.defaultLocaleValue ? "" : this.currentLocaleValue;