survey-react 1.9.135 → 1.9.136

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.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.135
2
+ * surveyjs - Survey JavaScript library v1.9.136
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
  */
package/survey.react.d.ts CHANGED
@@ -1438,6 +1438,9 @@ declare module "defaultCss/defaultV2Css" {
1438
1438
  progressButtonsContainerCenter: string;
1439
1439
  progressButtonsContainer: string;
1440
1440
  progressButtonsConnector: string;
1441
+ progressButtonsButton: string;
1442
+ progressButtonsButtonBackground: string;
1443
+ progressButtonsButtonContent: string;
1441
1444
  progressButtonsHeader: string;
1442
1445
  progressButtonsFooter: string;
1443
1446
  progressButtonsImageButtonLeft: string;
@@ -4918,8 +4921,8 @@ declare module "question_matrixdropdowncolumn" {
4918
4921
  * @see defaultValueExpression
4919
4922
  * @see resetValueIf
4920
4923
  */
4921
- get setValueExpession(): string;
4922
- set setValueExpession(val: string);
4924
+ get setValueExpression(): string;
4925
+ set setValueExpression(val: string);
4923
4926
  /**
4924
4927
  * Specifies whether a respondent is required to provide a unique response for each question within this column.
4925
4928
  *
@@ -5097,6 +5100,7 @@ declare module "dragdrop/dom-adapter" {
5097
5100
  startDrag(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement, preventSaveTargetNode: boolean): void;
5098
5101
  draggedElementShortcut: HTMLElement;
5099
5102
  rootContainer: HTMLElement;
5103
+ documentOrShadowRoot: Document | ShadowRoot;
5100
5104
  }
5101
5105
  export class DragDropDOMAdapter implements IDragDropDOMAdapter {
5102
5106
  private dd;
@@ -5113,6 +5117,7 @@ declare module "dragdrop/dom-adapter" {
5113
5117
  private savedTargetNodeIndex;
5114
5118
  private scrollIntervalId;
5115
5119
  constructor(dd: IDragDropEngine, longTap?: boolean, fitToContainer?: boolean);
5120
+ get documentOrShadowRoot(): Document | ShadowRoot;
5116
5121
  private get rootElement();
5117
5122
  private stopLongTapIfMoveEnough;
5118
5123
  private get isMicroMovement();
@@ -6485,7 +6490,7 @@ declare module "question_paneldynamic" {
6485
6490
  get progress(): string;
6486
6491
  getRootCss(): string;
6487
6492
  get cssHeader(): string;
6488
- getPanelWrapperCss(): string;
6493
+ getPanelWrapperCss(panel: PanelModel): string;
6489
6494
  getPanelRemoveButtonCss(): string;
6490
6495
  getAddButtonCss(): string;
6491
6496
  getPrevButtonCss(): string;
@@ -8229,6 +8234,7 @@ declare module "question_text" {
8229
8234
  * @see maskSettings
8230
8235
  */
8231
8236
  maskType: string;
8237
+ inputTextAlignment: "left" | "right" | "auto";
8232
8238
  get maskTypeIsEmpty(): boolean;
8233
8239
  /**
8234
8240
  * An object with properties that configure the mask applied to the input.
@@ -8361,6 +8367,7 @@ declare module "question_text" {
8361
8367
  protected getControlCssClassBuilder(): CssClassBuilder;
8362
8368
  isReadOnlyRenderDiv(): boolean;
8363
8369
  get inputStyle(): any;
8370
+ private updateTextAlign;
8364
8371
  private _isWaitingForEnter;
8365
8372
  private updateValueOnEvent;
8366
8373
  onCompositionUpdate: (event: any) => void;
@@ -16263,6 +16270,7 @@ declare module "question_checkbox" {
16263
16270
  }>, isAddAll: boolean): void;
16264
16271
  protected isBuiltInChoice(item: ItemValue): boolean;
16265
16272
  isItemInList(item: ItemValue): boolean;
16273
+ protected getDisplayValueEmpty(): string;
16266
16274
  protected getDisplayValueCore(keysAsText: boolean, value: any): any;
16267
16275
  protected clearIncorrectValuesCore(): void;
16268
16276
  protected clearDisabledValuesCore(): void;
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.135
2
+ * surveyjs - Survey JavaScript library v1.9.136
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
  */
@@ -5503,6 +5503,9 @@ var defaultV2Css = {
5503
5503
  progressButtonsContainerCenter: "sd-progress-buttons__container-center",
5504
5504
  progressButtonsContainer: "sd-progress-buttons__container",
5505
5505
  progressButtonsConnector: "sd-progress-buttons__connector",
5506
+ progressButtonsButton: "sd-progress-buttons__button",
5507
+ progressButtonsButtonBackground: "sd-progress-buttons__button-background",
5508
+ progressButtonsButtonContent: "sd-progress-buttons__button-content",
5506
5509
  progressButtonsHeader: "sd-progress-buttons__header",
5507
5510
  progressButtonsFooter: "sd-progress-buttons__footer",
5508
5511
  progressButtonsImageButtonLeft: "sd-progress-buttons__image-button-left",
@@ -6937,7 +6940,7 @@ var DragDropCore = /** @class */ (function () {
6937
6940
  this.domAdapter.draggedElementShortcut.style.display = "none";
6938
6941
  if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomDocumentHelper"].isAvailable())
6939
6942
  return null;
6940
- var dragOverNode = _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomDocumentHelper"].getDocument().elementFromPoint(clientX, clientY);
6943
+ var dragOverNode = this.domAdapter.documentOrShadowRoot.elementFromPoint(clientX, clientY);
6941
6944
  // this.domAdapter.draggedElementShortcut.hidden = false;
6942
6945
  this.domAdapter.draggedElementShortcut.style.display = displayProp || "block";
6943
6946
  if (!dragOverNode)
@@ -7124,10 +7127,17 @@ var DragDropDOMAdapter = /** @class */ (function () {
7124
7127
  };
7125
7128
  this.draggedElementShortcut = null;
7126
7129
  }
7130
+ Object.defineProperty(DragDropDOMAdapter.prototype, "documentOrShadowRoot", {
7131
+ get: function () {
7132
+ return _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].environment.root;
7133
+ },
7134
+ enumerable: false,
7135
+ configurable: true
7136
+ });
7127
7137
  Object.defineProperty(DragDropDOMAdapter.prototype, "rootElement", {
7128
7138
  get: function () {
7129
7139
  if (Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["isShadowDOM"])(_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].environment.root)) {
7130
- return _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].environment.root.host;
7140
+ return this.rootContainer || _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].environment.root.host;
7131
7141
  }
7132
7142
  else {
7133
7143
  return this.rootContainer || _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].environment.root.documentElement || document.body;
@@ -7252,7 +7262,7 @@ var DragDropDOMAdapter = /** @class */ (function () {
7252
7262
  var displayProp = this.draggedElementShortcut.style.display;
7253
7263
  //this.draggedElementShortcut.hidden = true;
7254
7264
  this.draggedElementShortcut.style.display = "none";
7255
- var dragOverNode = document.elementFromPoint(clientX, clientY);
7265
+ var dragOverNode = this.documentOrShadowRoot.elementFromPoint(clientX, clientY);
7256
7266
  //this.draggedElementShortcut.hidden = false;
7257
7267
  this.draggedElementShortcut.style.display = displayProp || "block";
7258
7268
  var scrollableParentNode = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["findScrollableParent"])(dragOverNode);
@@ -9611,8 +9621,8 @@ __webpack_require__.r(__webpack_exports__);
9611
9621
 
9612
9622
  var Version;
9613
9623
  var ReleaseDate;
9614
- Version = "" + "1.9.135";
9615
- ReleaseDate = "" + "2024-03-19";
9624
+ Version = "" + "1.9.136";
9625
+ ReleaseDate = "" + "2024-03-26";
9616
9626
  function checkLibraryVersion(ver, libraryName) {
9617
9627
  if (Version != ver) {
9618
9628
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -37100,7 +37110,7 @@ var ProgressButtons = /** @class */ (function (_super) {
37100
37110
  if (!listContainerElement)
37101
37111
  return;
37102
37112
  var listContainerElements = element.querySelectorAll(".sd-progress-buttons__connector");
37103
- var circleWidth = this.showItemNumbers ? 17 : 7;
37113
+ var circleWidth = this.showItemNumbers ? 17 : 5;
37104
37114
  var connectorWidth = listContainerElement.clientWidth / (listContainerElement.children.length - 1) - circleWidth;
37105
37115
  for (var i = 0; i < listContainerElements.length; i++) {
37106
37116
  listContainerElements[i].style.width = connectorWidth + "px";
@@ -44416,6 +44426,10 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
44416
44426
  return this.hasSelectAll;
44417
44427
  return _super.prototype.isItemInList.call(this, item);
44418
44428
  };
44429
+ QuestionCheckboxModel.prototype.getDisplayValueEmpty = function () {
44430
+ var _this = this;
44431
+ return _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"].getTextOrHtmlByValue(this.visibleChoices.filter(function (choice) { return choice != _this.selectAllItemValue; }), undefined);
44432
+ };
44419
44433
  QuestionCheckboxModel.prototype.getDisplayValueCore = function (keysAsText, value) {
44420
44434
  if (!Array.isArray(value))
44421
44435
  return _super.prototype.getDisplayValueCore.call(this, keysAsText, value);
@@ -45540,9 +45554,10 @@ var QuestionCustomModel = /** @class */ (function (_super) {
45540
45554
  }
45541
45555
  };
45542
45556
  QuestionCustomModel.prototype.convertDataName = function (name) {
45543
- if (!this.contentQuestion)
45557
+ var q = this.contentQuestion;
45558
+ if (!q || name === this.getValueName())
45544
45559
  return _super.prototype.convertDataName.call(this, name);
45545
- var newName = name.replace(this.contentQuestion.getValueName(), this.getValueName());
45560
+ var newName = name.replace(q.getValueName(), this.getValueName());
45546
45561
  return newName.indexOf(this.getValueName()) == 0
45547
45562
  ? newName
45548
45563
  : _super.prototype.convertDataName.call(this, name);
@@ -49882,7 +49897,7 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
49882
49897
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_11__["CssClassBuilder"]()
49883
49898
  .append(css.cell, hasCellText)
49884
49899
  .append(hasCellText ? css.cellText : css.label)
49885
- .append(css.itemOnError, !hasCellText && this.hasCssError())
49900
+ .append(css.itemOnError, !hasCellText && (this.isAllRowRequired ? this.hasErrorInRow(row) : this.hasCssError()))
49886
49901
  .append(hasCellText ? css.cellTextSelected : css.itemChecked, isChecked)
49887
49902
  .append(hasCellText ? css.cellTextDisabled : css.itemDisabled, isDisabled)
49888
49903
  .append(css.itemHover, allowHover && !hasCellText)
@@ -53741,7 +53756,7 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
53741
53756
  enumerable: false,
53742
53757
  configurable: true
53743
53758
  });
53744
- Object.defineProperty(MatrixDropdownColumn.prototype, "setValueExpession", {
53759
+ Object.defineProperty(MatrixDropdownColumn.prototype, "setValueExpression", {
53745
53760
  /**
53746
53761
  * An expression used to calculate a value for all column cells.
53747
53762
  *
@@ -53752,10 +53767,10 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
53752
53767
  * @see resetValueIf
53753
53768
  */
53754
53769
  get: function () {
53755
- return this.templateQuestion.setValueExpession;
53770
+ return this.templateQuestion.setValueExpression;
53756
53771
  },
53757
53772
  set: function (val) {
53758
- this.templateQuestion.setValueExpession = val;
53773
+ this.templateQuestion.setValueExpression = val;
53759
53774
  },
53760
53775
  enumerable: false,
53761
53776
  configurable: true
@@ -60198,9 +60213,9 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
60198
60213
  enumerable: false,
60199
60214
  configurable: true
60200
60215
  });
60201
- QuestionPanelDynamicModel.prototype.getPanelWrapperCss = function () {
60216
+ QuestionPanelDynamicModel.prototype.getPanelWrapperCss = function (panel) {
60202
60217
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
60203
- .append(this.cssClasses.panelWrapper)
60218
+ .append(this.cssClasses.panelWrapper, !panel || panel.visible)
60204
60219
  .append(this.cssClasses.panelWrapperInRow, this.panelRemoveButtonLocation === "right")
60205
60220
  .toString();
60206
60221
  };
@@ -64084,11 +64099,20 @@ var QuestionTextModel = /** @class */ (function (_super) {
64084
64099
  get: function () {
64085
64100
  var style = {};
64086
64101
  style.width = this.inputWidth;
64102
+ this.updateTextAlign(style);
64087
64103
  return style;
64088
64104
  },
64089
64105
  enumerable: false,
64090
64106
  configurable: true
64091
64107
  });
64108
+ QuestionTextModel.prototype.updateTextAlign = function (style) {
64109
+ if (this.inputTextAlignment !== "auto") {
64110
+ style.textAlign = this.inputTextAlignment;
64111
+ }
64112
+ else if (this.maskType === "numeric" || this.maskType === "currency") {
64113
+ style.textAlign = "right";
64114
+ }
64115
+ };
64092
64116
  QuestionTextModel.prototype.updateValueOnEvent = function (event) {
64093
64117
  var newValue = event.target.value;
64094
64118
  if (!this.isTwoValueEquals(this.value, newValue)) {
@@ -64110,6 +64134,9 @@ var QuestionTextModel = /** @class */ (function (_super) {
64110
64134
  onSet: function (newValue, target) { target.onSetMaskType(newValue); }
64111
64135
  })
64112
64136
  ], QuestionTextModel.prototype, "maskType", void 0);
64137
+ __decorate([
64138
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
64139
+ ], QuestionTextModel.prototype, "inputTextAlignment", void 0);
64113
64140
  __decorate([
64114
64141
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
64115
64142
  ], QuestionTextModel.prototype, "_inputValue", void 0);
@@ -64276,6 +64303,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("text", [
64276
64303
  return isMinMaxType(obj);
64277
64304
  },
64278
64305
  },
64306
+ { name: "inputTextAlignment", default: "auto", choices: ["left", "right", "auto"], visible: false },
64279
64307
  {
64280
64308
  name: "maskType:masktype",
64281
64309
  default: "none",
@@ -69574,7 +69602,11 @@ var SurveyProgressButtons = /** @class */ (function (_super) {
69574
69602
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsConnector }),
69575
69603
  this.state.canShowItemTitles ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
69576
69604
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageTitle, title: page.renderedNavigationTitle }, page.renderedNavigationTitle),
69577
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageDescription, title: page.navigationDescription }, page.navigationDescription)) : null));
69605
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageDescription, title: page.navigationDescription }, page.navigationDescription)) : null,
69606
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsButton },
69607
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsButtonBackground }),
69608
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsButtonContent }),
69609
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.getItemNumber(page)))));
69578
69610
  };
69579
69611
  SurveyProgressButtons.prototype.clickScrollButton = function (listContainerElement, isLeftScroll) {
69580
69612
  if (!!listContainerElement) {
@@ -73313,7 +73345,7 @@ var SurveyQuestionPanelDynamicItem = /** @class */ (function (_super) {
73313
73345
  var separator = this.question.showSeparator(this.index) ?
73314
73346
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("hr", { className: this.question.cssClasses.separator })) : null;
73315
73347
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
73316
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getPanelWrapperCss() },
73348
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getPanelWrapperCss(this.panel) },
73317
73349
  panel,
73318
73350
  removeButton),
73319
73351
  separator));
@@ -82854,14 +82886,12 @@ var SurveyModel = /** @class */ (function (_super) {
82854
82886
  };
82855
82887
  SurveyModel.prototype.processResponsiveness = function (width, mobileWidth) {
82856
82888
  var isMobile = width < mobileWidth;
82857
- this.layoutElements.forEach(function (layoutElement) { return layoutElement.processResponsiveness && layoutElement.processResponsiveness(width); });
82858
- if (this.isMobile === isMobile) {
82859
- return false;
82860
- }
82861
- else {
82889
+ var isMobileChanged = this.isMobile !== isMobile;
82890
+ if (isMobileChanged) {
82862
82891
  this.setIsMobile(isMobile);
82863
- return true;
82864
82892
  }
82893
+ this.layoutElements.forEach(function (layoutElement) { return layoutElement.processResponsiveness && layoutElement.processResponsiveness(width); });
82894
+ return isMobileChanged;
82865
82895
  };
82866
82896
  SurveyModel.prototype.triggerResponsiveness = function (hard) {
82867
82897
  this.getAllQuestions().forEach(function (question) {