survey-react 1.12.3 → 1.12.5

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.12.3
2
+ * surveyjs - Survey JavaScript library v1.12.5
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
  */
@@ -962,9 +962,9 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
962
962
 
963
963
  /***/ "./src/entries/react.ts":
964
964
  /*!********************************************!*\
965
- !*** ./src/entries/react.ts + 282 modules ***!
965
+ !*** ./src/entries/react.ts + 284 modules ***!
966
966
  \********************************************/
967
- /*! exports provided: Version, ReleaseDate, checkLibraryVersion, setLicenseKey, slk, hasLicense, settings, Helpers, AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ExpressionValidator, ValidatorRunner, ItemValue, Base, Event, EventBase, ArrayChanges, ComputedUpdater, SurveyError, SurveyElementCore, SurveyElement, DragTypeOverMeEnum, CalculatedValue, CustomError, AnswerRequiredError, OneAnswerRequiredError, RequreNumericError, ExceedSizeError, LocalizableString, LocalizableStrings, HtmlConditionItem, UrlConditionItem, ChoicesRestful, ChoicesRestfull, FunctionFactory, registerFunction, ConditionRunner, ExpressionRunner, ExpressionExecutor, Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand, ConditionsParser, ProcessValue, JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase, MatrixDropdownColumn, matrixDropdownColumnTypes, QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable, MatrixDropdownRowModel, QuestionMatrixDropdownModel, MatrixDynamicRowModel, QuestionMatrixDynamicModel, MatrixRowModel, MatrixCells, QuestionMatrixModel, QuestionMatrixBaseModel, MultipleTextItemModel, MultipleTextCell, MultipleTextErrorCell, MutlipleTextErrorRow, MutlipleTextRow, QuestionMultipleTextModel, MultipleTextEditorModel, PanelModel, PanelModelBase, QuestionRowModel, FlowPanelModel, PageModel, DefaultTitleModel, Question, QuestionNonValue, QuestionEmptyModel, QuestionCheckboxBase, QuestionSelectBase, QuestionCheckboxModel, QuestionTagboxModel, QuestionRankingModel, QuestionCommentModel, QuestionDropdownModel, QuestionFactory, ElementFactory, QuestionFileModel, QuestionHtmlModel, QuestionRadiogroupModel, QuestionRatingModel, RenderedRatingItem, QuestionExpressionModel, QuestionTextBase, CharacterCounter, QuestionTextModel, QuestionBooleanModel, QuestionImagePickerModel, ImageItemValue, QuestionImageModel, QuestionSignaturePadModel, QuestionPanelDynamicModel, QuestionPanelDynamicItem, SurveyTimer, SurveyTimerModel, tryFocusPage, createTOCListModel, getTocRootCss, TOCModel, SurveyProgressModel, ProgressButtons, ProgressButtonsResponsivityManager, SurveyModel, SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, SurveyTriggerCopyValue, SurveyTriggerRunExpression, SurveyTriggerSkip, Trigger, PopupSurveyModel, SurveyWindowModel, TextPreProcessor, Notifier, Cover, CoverCell, dxSurveyService, englishStrings, surveyLocalization, surveyStrings, QuestionCustomWidget, CustomWidgetCollection, QuestionCustomModel, QuestionCompositeModel, ComponentQuestionJSON, ComponentCollection, ListModel, MultiSelectListModel, PopupModel, createDialogOptions, PopupBaseViewModel, PopupDropdownViewModel, PopupModalViewModel, createPopupViewModel, createPopupModalViewModel, DropdownListModel, DropdownMultiSelectListModel, QuestionButtonGroupModel, ButtonGroupItemModel, ButtonGroupItemValue, IsMobile, IsTouch, _setIsTouch, confirmAction, confirmActionAsync, detectIEOrEdge, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, loadFileFromBase64, increaseHeightByContent, createSvg, chooseFiles, sanitizeEditableContent, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, classesToSelector, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgBundleViewModel, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, createDropdownActionModel, createDropdownActionModelAdvanced, createPopupModelWithListModel, getActionDropdownButtonTarget, BaseAction, Action, ActionDropdownViewModel, AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab, AdaptiveActionContainer, defaultActionBarCss, ActionContainer, DragOrClickHelper, Model, bootstrapThemeName, bootstrapThemeColors, bootstrapThemeCssRules, bootstrapMaterialThemeName, bootstrapMaterialThemeColors, bootstrapMaterialThemeCssRules, defaultBootstrapCss, defaultBootstrapMaterialCss, Survey, attachKey2click, ReactSurveyElementsWrapper, SurveyNavigationBase, SurveyTimerPanel, SurveyPage, SurveyRow, SurveyPanel, SurveyFlowPanel, SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsCell, ReactSurveyElement, SurveyElementBase, SurveyQuestionElementBase, SurveyQuestionCommentItem, SurveyQuestionComment, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, RatingItem, RatingItemStar, RatingItemSmiley, RatingDropdownItem, TagboxFilterString, SurveyQuestionOptionItem, SurveyQuestionDropdownBase, SurveyQuestionDropdown, SurveyQuestionTagboxItem, SurveyQuestionTagbox, SurveyQuestionDropdownSelect, SurveyQuestionMatrix, SurveyQuestionMatrixRow, SurveyQuestionMatrixCell, SurveyQuestionHtml, SurveyQuestionFile, SurveyFileChooseButton, SurveyFilePreview, SurveyQuestionMultipleText, SurveyQuestionRadiogroup, SurveyQuestionRadioItem, SurveyQuestionText, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionEmpty, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionPanelDynamic, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionExpression, PopupSurvey, SurveyWindow, ReactQuestionFactory, ReactElementFactory, SurveyQuestionImagePicker, SurveyQuestionImage, SurveyQuestionSignaturePad, SurveyQuestionButtonGroup, SurveyQuestionCustom, SurveyQuestionComposite, Popup, ListItemContent, ListItemGroup, List, TitleActions, TitleElement, SurveyActionBar, LogoImage, SurveyHeader, SvgIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicProgressText, SurveyNavigationButton, QuestionErrorComponent, MatrixRow, Skeleton, NotifierComponent, ComponentsContainer, CharacterCounterComponent, HeaderMobile, HeaderCell, Header, SurveyLocStringViewer, SurveyLocStringEditor, LoadingIndicatorComponent, SvgBundleComponent */
967
+ /*! exports provided: Version, ReleaseDate, checkLibraryVersion, setLicenseKey, slk, hasLicense, settings, Helpers, AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ExpressionValidator, ValidatorRunner, ItemValue, Base, Event, EventBase, ArrayChanges, ComputedUpdater, SurveyError, SurveyElementCore, SurveyElement, DragTypeOverMeEnum, CalculatedValue, CustomError, AnswerRequiredError, OneAnswerRequiredError, RequreNumericError, ExceedSizeError, LocalizableString, LocalizableStrings, HtmlConditionItem, UrlConditionItem, ChoicesRestful, ChoicesRestfull, FunctionFactory, registerFunction, ConditionRunner, ExpressionRunner, ExpressionExecutor, Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand, ConditionsParser, ProcessValue, JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase, MatrixDropdownColumn, matrixDropdownColumnTypes, QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable, MatrixDropdownRowModel, QuestionMatrixDropdownModel, MatrixDynamicRowModel, QuestionMatrixDynamicModel, MatrixRowModel, MatrixCells, QuestionMatrixModel, QuestionMatrixBaseModel, MultipleTextItemModel, MultipleTextCell, MultipleTextErrorCell, MutlipleTextErrorRow, MutlipleTextRow, QuestionMultipleTextModel, MultipleTextEditorModel, PanelModel, PanelModelBase, QuestionRowModel, FlowPanelModel, PageModel, DefaultTitleModel, Question, QuestionNonValue, QuestionEmptyModel, QuestionCheckboxBase, QuestionSelectBase, QuestionCheckboxModel, QuestionTagboxModel, QuestionRankingModel, QuestionCommentModel, QuestionDropdownModel, QuestionFactory, ElementFactory, QuestionFileModel, QuestionFilePage, QuestionHtmlModel, QuestionRadiogroupModel, QuestionRatingModel, RenderedRatingItem, QuestionExpressionModel, QuestionTextBase, CharacterCounter, QuestionTextModel, QuestionBooleanModel, QuestionImagePickerModel, ImageItemValue, QuestionImageModel, QuestionSignaturePadModel, QuestionPanelDynamicModel, QuestionPanelDynamicItem, SurveyTimer, SurveyTimerModel, tryFocusPage, createTOCListModel, getTocRootCss, TOCModel, SurveyProgressModel, ProgressButtons, ProgressButtonsResponsivityManager, SurveyModel, SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, SurveyTriggerCopyValue, SurveyTriggerRunExpression, SurveyTriggerSkip, Trigger, PopupSurveyModel, SurveyWindowModel, TextPreProcessor, Notifier, Cover, CoverCell, dxSurveyService, englishStrings, surveyLocalization, surveyStrings, QuestionCustomWidget, CustomWidgetCollection, QuestionCustomModel, QuestionCompositeModel, ComponentQuestionJSON, ComponentCollection, ListModel, MultiSelectListModel, PopupModel, createDialogOptions, PopupBaseViewModel, PopupDropdownViewModel, PopupModalViewModel, createPopupViewModel, createPopupModalViewModel, DropdownListModel, DropdownMultiSelectListModel, QuestionButtonGroupModel, ButtonGroupItemModel, ButtonGroupItemValue, IsMobile, IsTouch, _setIsTouch, confirmAction, confirmActionAsync, detectIEOrEdge, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, loadFileFromBase64, increaseHeightByContent, createSvg, chooseFiles, sanitizeEditableContent, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, classesToSelector, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgBundleViewModel, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, createDropdownActionModel, createDropdownActionModelAdvanced, createPopupModelWithListModel, getActionDropdownButtonTarget, BaseAction, Action, ActionDropdownViewModel, AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab, AdaptiveActionContainer, defaultActionBarCss, ActionContainer, DragOrClickHelper, Model, bootstrapThemeName, bootstrapThemeColors, bootstrapThemeCssRules, bootstrapMaterialThemeName, bootstrapMaterialThemeColors, bootstrapMaterialThemeCssRules, defaultBootstrapCss, defaultBootstrapMaterialCss, Survey, attachKey2click, ReactSurveyElementsWrapper, SurveyNavigationBase, SurveyTimerPanel, SurveyPage, SurveyRow, SurveyPanel, SurveyFlowPanel, SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsCell, ReactSurveyElement, SurveyElementBase, SurveyQuestionElementBase, SurveyQuestionCommentItem, SurveyQuestionComment, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, RatingItem, RatingItemStar, RatingItemSmiley, RatingDropdownItem, TagboxFilterString, SurveyQuestionOptionItem, SurveyQuestionDropdownBase, SurveyQuestionDropdown, SurveyQuestionTagboxItem, SurveyQuestionTagbox, SurveyQuestionDropdownSelect, SurveyQuestionMatrix, SurveyQuestionMatrixRow, SurveyQuestionMatrixCell, SurveyQuestionHtml, SurveyQuestionFile, SurveyFileChooseButton, SurveyFilePreview, SurveyQuestionMultipleText, SurveyQuestionRadiogroup, SurveyQuestionRadioItem, SurveyQuestionText, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionEmpty, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionPanelDynamic, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionExpression, PopupSurvey, SurveyWindow, ReactQuestionFactory, ReactElementFactory, SurveyQuestionImagePicker, SurveyQuestionImage, SurveyQuestionSignaturePad, SurveyQuestionButtonGroup, SurveyQuestionCustom, SurveyQuestionComposite, Popup, ListItemContent, ListItemGroup, List, TitleActions, TitleElement, SurveyActionBar, LogoImage, SurveyHeader, SvgIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicProgressText, SurveyNavigationButton, QuestionErrorComponent, MatrixRow, Skeleton, NotifierComponent, ComponentsContainer, CharacterCounterComponent, HeaderMobile, HeaderCell, Header, SurveyLocStringViewer, SurveyLocStringEditor, LoadingIndicatorComponent, SvgBundleComponent */
968
968
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} (<- Module is not an ECMAScript module) */
969
969
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom"} (<- Module is not an ECMAScript module) */
970
970
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -1083,6 +1083,7 @@ __webpack_require__.d(__webpack_exports__, "QuestionDropdownModel", function() {
1083
1083
  __webpack_require__.d(__webpack_exports__, "QuestionFactory", function() { return /* reexport */ questionfactory_QuestionFactory; });
1084
1084
  __webpack_require__.d(__webpack_exports__, "ElementFactory", function() { return /* reexport */ questionfactory_ElementFactory; });
1085
1085
  __webpack_require__.d(__webpack_exports__, "QuestionFileModel", function() { return /* reexport */ question_file_QuestionFileModel; });
1086
+ __webpack_require__.d(__webpack_exports__, "QuestionFilePage", function() { return /* reexport */ question_file_QuestionFilePage; });
1086
1087
  __webpack_require__.d(__webpack_exports__, "QuestionHtmlModel", function() { return /* reexport */ question_html_QuestionHtmlModel; });
1087
1088
  __webpack_require__.d(__webpack_exports__, "QuestionRadiogroupModel", function() { return /* reexport */ question_radiogroup_QuestionRadiogroupModel; });
1088
1089
  __webpack_require__.d(__webpack_exports__, "QuestionRatingModel", function() { return /* reexport */ question_rating_QuestionRatingModel; });
@@ -2473,8 +2474,10 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
2473
2474
  return this.getValue(obj);
2474
2475
  };
2475
2476
  JsonObjectProperty.prototype.getValue = function (obj) {
2476
- if (this.onGetValue)
2477
+ if (this.onGetValue) {
2478
+ obj = this.getOriginalObj(obj);
2477
2479
  return this.onGetValue(obj);
2480
+ }
2478
2481
  if (this.serializationProperty && !!obj[this.serializationProperty])
2479
2482
  return obj[this.serializationProperty].getJson();
2480
2483
  return obj[this.name];
@@ -2501,6 +2504,7 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
2501
2504
  };
2502
2505
  JsonObjectProperty.prototype.setValue = function (obj, value, jsonConv) {
2503
2506
  if (this.onSetValue) {
2507
+ obj = this.getOriginalObj(obj);
2504
2508
  this.onSetValue(obj, value, jsonConv);
2505
2509
  }
2506
2510
  else {
@@ -2589,7 +2593,7 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
2589
2593
  };
2590
2594
  JsonObjectProperty.prototype.isVisible = function (layout, obj) {
2591
2595
  if (obj === void 0) { obj = null; }
2592
- var isLayout = !this.layout || this.layout == layout;
2596
+ var isLayout = !this.layout || !layout || this.layout === layout;
2593
2597
  if (!this.visible || !isLayout)
2594
2598
  return false;
2595
2599
  if (!!this.visibleIf && !!obj) {
@@ -9254,8 +9258,8 @@ var base_Base = /** @class */ (function () {
9254
9258
  this.isCreating = true;
9255
9259
  this.animationAllowedLock = 0;
9256
9260
  //remove when knockout obsolete
9257
- this.supportOnElementRenderedEvent = true;
9258
- this.onElementRenderedEventEnabled = false;
9261
+ this.supportOnElementRerenderedEvent = true;
9262
+ this.onElementRerenderedEventEnabled = false;
9259
9263
  this._onElementRerendered = new EventBase();
9260
9264
  this.bindingsValue = new base_Bindings(this);
9261
9265
  CustomPropertiesCollection.createProperties(this);
@@ -10192,7 +10196,7 @@ var base_Base = /** @class */ (function () {
10192
10196
  configurable: true
10193
10197
  });
10194
10198
  Base.prototype.getIsAnimationAllowed = function () {
10195
- return settings.animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.supportOnElementRenderedEvent);
10199
+ return settings.animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.supportOnElementRerenderedEvent);
10196
10200
  };
10197
10201
  Base.prototype.blockAnimations = function () {
10198
10202
  this.animationAllowedLock--;
@@ -10200,17 +10204,17 @@ var base_Base = /** @class */ (function () {
10200
10204
  Base.prototype.releaseAnimations = function () {
10201
10205
  this.animationAllowedLock++;
10202
10206
  };
10203
- Base.prototype.enableOnElementRenderedEvent = function () {
10204
- this.onElementRenderedEventEnabled = true;
10207
+ Base.prototype.enableOnElementRerenderedEvent = function () {
10208
+ this.onElementRerenderedEventEnabled = true;
10205
10209
  };
10206
- Base.prototype.disableOnElementRenderedEvent = function () {
10210
+ Base.prototype.disableOnElementRerenderedEvent = function () {
10207
10211
  var _a;
10208
10212
  (_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, { isCancel: true });
10209
- this.onElementRenderedEventEnabled = false;
10213
+ this.onElementRerenderedEventEnabled = false;
10210
10214
  };
10211
10215
  Object.defineProperty(Base.prototype, "onElementRerendered", {
10212
10216
  get: function () {
10213
- return this.supportOnElementRenderedEvent && this.onElementRenderedEventEnabled ? this._onElementRerendered : undefined;
10217
+ return this.supportOnElementRerenderedEvent && this.onElementRerenderedEventEnabled ? this._onElementRerendered : undefined;
10214
10218
  },
10215
10219
  enumerable: false,
10216
10220
  configurable: true
@@ -10402,7 +10406,9 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
10402
10406
  var _items = this.container.querySelectorAll(this.itemsSelector);
10403
10407
  (_items || []).forEach(function (item, index) {
10404
10408
  var currentAction = actions[index];
10405
- _this.calcActionDimensions(currentAction, item);
10409
+ if (!!currentAction) {
10410
+ _this.calcActionDimensions(currentAction, item);
10411
+ }
10406
10412
  });
10407
10413
  };
10408
10414
  ResponsivityManager.prototype.calcActionDimensions = function (currentAction, item) {
@@ -12962,6 +12968,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
12962
12968
  }
12963
12969
  }
12964
12970
  }, function () { return _this.renderedIsExpanded; });
12971
+ _this.onAfterRenderElement = _this.addEvent();
12965
12972
  _this.name = name;
12966
12973
  _this.createNewArray("errors");
12967
12974
  _this.createNewArray("titleActions");
@@ -12991,16 +12998,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
12991
12998
  }
12992
12999
  return info;
12993
13000
  };
12994
- SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions) {
12995
- var root = settings.environment.root;
12996
- if (!elementId || typeof root === "undefined")
12997
- return false;
12998
- var el = root.getElementById(elementId);
12999
- return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions);
13000
- };
13001
- SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions) {
13002
- if (!el || !el.scrollIntoView)
13003
- return false;
13001
+ SurveyElement.IsNeedScrollIntoView = function (el, checkLeft, scrollIfVisible) {
13004
13002
  var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
13005
13003
  var needScroll = elTop < 0;
13006
13004
  var elLeft = -1;
@@ -13016,8 +13014,55 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
13016
13014
  needScroll = width > 0 && width < elLeft;
13017
13015
  }
13018
13016
  }
13017
+ return needScroll;
13018
+ };
13019
+ SurveyElement.ScrollIntoView = function (el, scrollIntoViewOptions, doneCallback) {
13020
+ el.scrollIntoView(scrollIntoViewOptions);
13021
+ if (typeof doneCallback === "function") {
13022
+ var lastPos_1 = null;
13023
+ var same_1 = 0;
13024
+ var checkPos_1 = function () {
13025
+ var newPos = el.getBoundingClientRect().top;
13026
+ if (newPos === lastPos_1) {
13027
+ if (same_1++ > 2) {
13028
+ doneCallback();
13029
+ return;
13030
+ }
13031
+ }
13032
+ else {
13033
+ lastPos_1 = newPos;
13034
+ same_1 = 0;
13035
+ }
13036
+ requestAnimationFrame(checkPos_1);
13037
+ };
13038
+ DomWindowHelper.requestAnimationFrame(checkPos_1);
13039
+ // let currPageXOffset = window.pageXOffset;
13040
+ // let currPageYOffset = window.pageYOffset;
13041
+ // var scrollDone = setInterval(() => {
13042
+ // DomWindowHelper.requestAnimationFrame(() => {
13043
+ // if (currPageXOffset == window.pageXOffset && currPageYOffset == window.pageYOffset) {
13044
+ // clearInterval(scrollDone);
13045
+ // doneCallback();
13046
+ // }
13047
+ // currPageXOffset = window.pageXOffset;
13048
+ // currPageYOffset = window.pageYOffset;
13049
+ // });
13050
+ // }, 25);
13051
+ }
13052
+ };
13053
+ SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
13054
+ var root = settings.environment.root;
13055
+ if (!elementId || typeof root === "undefined")
13056
+ return false;
13057
+ var el = root.getElementById(elementId);
13058
+ return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);
13059
+ };
13060
+ SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
13061
+ if (!el || !el.scrollIntoView)
13062
+ return false;
13063
+ var needScroll = SurveyElement.IsNeedScrollIntoView(el, checkLeft, scrollIfVisible);
13019
13064
  if (needScroll) {
13020
- el.scrollIntoView(scrollIntoViewOptions);
13065
+ SurveyElement.ScrollIntoView(el, scrollIntoViewOptions, doneCallback);
13021
13066
  }
13022
13067
  return needScroll;
13023
13068
  };
@@ -13385,6 +13430,17 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
13385
13430
  this.surveyChangedCallback();
13386
13431
  }
13387
13432
  };
13433
+ Object.defineProperty(SurveyElement.prototype, "skeletonHeight", {
13434
+ get: function () {
13435
+ var skeletonHeight = undefined;
13436
+ if (!!this.survey && this.survey.skeletonHeight) {
13437
+ skeletonHeight = this.survey.skeletonHeight + "px";
13438
+ }
13439
+ return skeletonHeight;
13440
+ },
13441
+ enumerable: false,
13442
+ configurable: true
13443
+ });
13388
13444
  Object.defineProperty(SurveyElement.prototype, "isInternal", {
13389
13445
  get: function () {
13390
13446
  return this.isContentElement;
@@ -13756,7 +13812,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
13756
13812
  };
13757
13813
  Object.defineProperty(SurveyElement.prototype, "isDefaultV2Theme", {
13758
13814
  get: function () {
13759
- return this.survey && this.survey.getCss().root == "sd-root-modern";
13815
+ return this.survey && this.survey.getCss().root.indexOf("sd-root-modern") !== -1;
13760
13816
  },
13761
13817
  enumerable: false,
13762
13818
  configurable: true
@@ -14109,7 +14165,8 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14109
14165
  },
14110
14166
  getLeaveOptions: function () {
14111
14167
  var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;
14112
- return { cssClass: cssClasses.contentLeave,
14168
+ return {
14169
+ cssClass: cssClasses.contentLeave,
14113
14170
  onBeforeRunAnimation: beforeRunAnimation,
14114
14171
  onAfterRunAnimation: afterRunAnimation
14115
14172
  };
@@ -14152,12 +14209,16 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14152
14209
  SurveyElement.prototype.getIsAnimationAllowed = function () {
14153
14210
  return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey && !this.survey["isEndLoadingFromJson"];
14154
14211
  };
14212
+ SurveyElement.prototype.afterRenderCore = function (element) {
14213
+ this.onAfterRenderElement.fire(this, { htmlElement: element });
14214
+ };
14155
14215
  SurveyElement.prototype.dispose = function () {
14156
14216
  _super.prototype.dispose.call(this);
14157
14217
  if (this.titleToolbarValue) {
14158
14218
  this.titleToolbarValue.dispose();
14159
14219
  }
14160
14220
  };
14221
+ // TODO V2: get rid of this flag
14161
14222
  SurveyElement.CreateDisabledDesignElements = false;
14162
14223
  survey_element_decorate([
14163
14224
  jsonobject_property({ defaultValue: null })
@@ -14190,6 +14251,66 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14190
14251
  return SurveyElement;
14191
14252
  }(survey_element_SurveyElementCore));
14192
14253
 
14254
+ var RenderingCompletedAwaiter = /** @class */ (function () {
14255
+ function RenderingCompletedAwaiter(_elements, _renderedHandler, waitingTimeout) {
14256
+ var _this = this;
14257
+ if (waitingTimeout === void 0) { waitingTimeout = 100; }
14258
+ this._elements = _elements;
14259
+ this._renderedHandler = _renderedHandler;
14260
+ this._elementsToRenderCount = 0;
14261
+ this._elementsToRenderTimer = undefined;
14262
+ this._elementRenderedHandler = function (s, o) {
14263
+ var _a;
14264
+ (_a = s.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
14265
+ _this._elementsToRenderCount--;
14266
+ if (_this._elementsToRenderCount <= 0) {
14267
+ _this.visibleElementsRendered();
14268
+ }
14269
+ };
14270
+ this._elements.forEach(function (element) {
14271
+ if (element.onAfterRenderElement) {
14272
+ element.onAfterRenderElement.add(_this._elementRenderedHandler);
14273
+ _this._elementsToRenderCount++;
14274
+ }
14275
+ });
14276
+ if (this._elementsToRenderCount > 0) {
14277
+ this._elementsToRenderTimer = setTimeout(function () {
14278
+ if (_this._elementsToRenderCount > 0) {
14279
+ _this.visibleElementsRendered();
14280
+ }
14281
+ }, waitingTimeout);
14282
+ }
14283
+ else {
14284
+ this.visibleElementsRendered();
14285
+ }
14286
+ }
14287
+ RenderingCompletedAwaiter.prototype.stopWaitingForElementsRendering = function () {
14288
+ var _this = this;
14289
+ if (this._elementsToRenderTimer) {
14290
+ clearTimeout(this._elementsToRenderTimer);
14291
+ this._elementsToRenderTimer = undefined;
14292
+ }
14293
+ this._elements.forEach(function (element) {
14294
+ var _a;
14295
+ (_a = element.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
14296
+ });
14297
+ this._elementsToRenderCount = 0;
14298
+ };
14299
+ RenderingCompletedAwaiter.prototype.visibleElementsRendered = function () {
14300
+ var renderedHandler = this._renderedHandler;
14301
+ this.dispose();
14302
+ if (typeof renderedHandler == "function") {
14303
+ renderedHandler();
14304
+ }
14305
+ };
14306
+ RenderingCompletedAwaiter.prototype.dispose = function () {
14307
+ this.stopWaitingForElementsRendering();
14308
+ this._elements = undefined;
14309
+ this._renderedHandler = undefined;
14310
+ };
14311
+ return RenderingCompletedAwaiter;
14312
+ }());
14313
+
14193
14314
 
14194
14315
  // CONCATENATED MODULE: ./packages/survey-core/src/localizablestring.ts
14195
14316
 
@@ -14919,7 +15040,7 @@ function findScrollableParent(element) {
14919
15040
  }
14920
15041
  return findScrollableParent(element.parentElement);
14921
15042
  }
14922
- function scrollElementByChildId(id) {
15043
+ function activateLazyRenderingChecks(id) {
14923
15044
  var environment = settings.environment;
14924
15045
  if (!environment)
14925
15046
  return;
@@ -17524,21 +17645,26 @@ var text_area_TextAreaModel = /** @class */ (function () {
17524
17645
  this.onPropertyChangedCallback = function () {
17525
17646
  if (_this.element) {
17526
17647
  _this.element.value = _this.getTextValue();
17527
- if (_this.autoGrow) {
17528
- increaseHeightByContent(_this.element);
17529
- }
17648
+ _this.updateElement();
17530
17649
  }
17531
17650
  };
17532
17651
  this.question.registerFunctionOnPropertyValueChanged(this.options.propertyName, this.onPropertyChangedCallback, "__textarea");
17533
17652
  }
17653
+ TextAreaModel.prototype.updateElement = function () {
17654
+ var _this = this;
17655
+ if (this.element && this.autoGrow) {
17656
+ setTimeout(function () { return increaseHeightByContent(_this.element); }, 1);
17657
+ }
17658
+ };
17534
17659
  TextAreaModel.prototype.setElement = function (element) {
17535
17660
  if (!!element) {
17536
17661
  this.element = element;
17662
+ this.updateElement();
17537
17663
  }
17538
17664
  };
17539
17665
  TextAreaModel.prototype.getTextValue = function () {
17540
17666
  if (!!this.options.getTextValue)
17541
- return this.options.getTextValue();
17667
+ return this.options.getTextValue() || "";
17542
17668
  return "";
17543
17669
  };
17544
17670
  TextAreaModel.prototype.onTextAreaChange = function (event) {
@@ -18803,7 +18929,8 @@ var question_Question = /** @class */ (function (_super) {
18803
18929
  }
18804
18930
  this.checkForResponsiveness(el);
18805
18931
  };
18806
- Question.prototype.afterRenderCore = function (el) {
18932
+ Question.prototype.afterRenderCore = function (element) {
18933
+ _super.prototype.afterRenderCore.call(this, element);
18807
18934
  };
18808
18935
  Question.prototype.getCommentElementsId = function () {
18809
18936
  return [this.commentId];
@@ -19415,7 +19542,7 @@ var question_Question = /** @class */ (function (_super) {
19415
19542
  });
19416
19543
  Object.defineProperty(Question.prototype, "isDisabledAttr", {
19417
19544
  get: function () {
19418
- return this.isDesignModeV2;
19545
+ return this.isDesignModeV2 || (!!this.readOnlyCallback && this.readOnlyCallback());
19419
19546
  },
19420
19547
  enumerable: false,
19421
19548
  configurable: true
@@ -19609,7 +19736,7 @@ var question_Question = /** @class */ (function (_super) {
19609
19736
  *
19610
19737
  * | Question type | Value type(s) |
19611
19738
  * | ------------- | ------------- |
19612
- * | Checkboxes | `Array<string \| number>` |
19739
+ * | Checkboxes | <code>Array&lt;string &#124; number&gt;</code> |
19613
19740
  * | Dropdown | `string` \| `number` |
19614
19741
  * | Dynamic Matrix | `Array<object>` |
19615
19742
  * | Dynamic Panel | `Array<object>` |
@@ -19617,14 +19744,14 @@ var question_Question = /** @class */ (function (_super) {
19617
19744
  * | File Upload | `File` \| `Array<File>` |
19618
19745
  * | HTML | (no value) |
19619
19746
  * | Image | (no value) |
19620
- * | Image Picker | `Array<string \| number>` |
19747
+ * | Image Picker | <code>Array&lt;string &#124; number&gt;</code> |
19621
19748
  * | Long Text | `string` |
19622
19749
  * | Multi-Select Dropdown | `object` |
19623
19750
  * | Multi-Select Matrix | `object` |
19624
19751
  * | Multiple Textboxes | `Array<string>` |
19625
19752
  * | Panel | (no value) |
19626
19753
  * | Radio Button Group | `string` \| `number` |
19627
- * | Ranking | `Array<string \| number>` |
19754
+ * | Ranking | <code>Array&lt;string &#124; number&gt;</code> |
19628
19755
  * | Rating Scale | `number` \| `string` |
19629
19756
  * | Signature | `string` (base64-encoded image) |
19630
19757
  * | Single-Line Input | `string` \| `number` \| `Date` |
@@ -20379,11 +20506,12 @@ var question_Question = /** @class */ (function (_super) {
20379
20506
  };
20380
20507
  Question.prototype.removeError = function (error) {
20381
20508
  if (!error)
20382
- return;
20509
+ return false;
20383
20510
  var errors = this.errors;
20384
20511
  var index = errors.indexOf(error);
20385
20512
  if (index !== -1)
20386
20513
  errors.splice(index, 1);
20514
+ return index !== -1;
20387
20515
  };
20388
20516
  Question.prototype.checkForErrors = function (isOnValueChanged, fireCallback) {
20389
20517
  var qErrors = new Array();
@@ -29899,9 +30027,11 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
29899
30027
  rec.validationValues = this.getDataFilteredValues();
29900
30028
  rec.isSingleDetailPanel = this.detailPanelMode === "underRowSingle";
29901
30029
  for (var i = 0; i < rows.length; i++) {
29902
- res = rows[i].hasErrors(fireCallback, rec, function () {
29903
- _this.raiseOnCompletedAsyncValidators();
29904
- }) || res;
30030
+ if (rows[i].isVisible) {
30031
+ res = rows[i].hasErrors(fireCallback, rec, function () {
30032
+ _this.raiseOnCompletedAsyncValidators();
30033
+ }) || res;
30034
+ }
29905
30035
  }
29906
30036
  return res;
29907
30037
  };
@@ -29988,7 +30118,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
29988
30118
  if (duplicatedRows.indexOf(row) < 0) {
29989
30119
  var question = row.getQuestionByName(columnName);
29990
30120
  if (question) {
29991
- _this.removeDuplicationError(question);
30121
+ _this.removeDuplicationError(row, question);
29992
30122
  }
29993
30123
  }
29994
30124
  });
@@ -30006,8 +30136,10 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
30006
30136
  question.addError(new KeyDuplicationError(this.keyDuplicationError, this));
30007
30137
  }
30008
30138
  };
30009
- QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (question) {
30010
- question.removeError(this.getDuplicationError(question));
30139
+ QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (row, question) {
30140
+ if (question.removeError(this.getDuplicationError(question)) && question.errors.length === 0 && !!row.editingObj) {
30141
+ row.editingObj[question.getValueName()] = question.value;
30142
+ }
30011
30143
  };
30012
30144
  QuestionMatrixDropdownModelBase.prototype.getFirstQuestionToFocus = function (withError) {
30013
30145
  return this.getFirstCellQuestion(withError);
@@ -30118,7 +30250,14 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
30118
30250
  });
30119
30251
  Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "hasInvisibleRows", {
30120
30252
  get: function () {
30121
- return !!this.visibleRowsArray && this.visibleRowsArray.length !== this.generatedVisibleRows.length;
30253
+ var rows = this.generatedVisibleRows;
30254
+ if (!Array.isArray(rows))
30255
+ return false;
30256
+ for (var i = 0; i < rows.length; i++) {
30257
+ if (!rows[i].isVisible)
30258
+ return true;
30259
+ }
30260
+ return false;
30122
30261
  },
30123
30262
  enumerable: false,
30124
30263
  configurable: true
@@ -30329,7 +30468,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
30329
30468
  };
30330
30469
  QuestionMatrixDropdownModelBase.prototype.clearInvisibleValuesInRows = function () {
30331
30470
  var _a;
30332
- if (this.isEmpty() || !this.isRowsFiltered)
30471
+ if (this.isEmpty() || !this.isRowsFiltered())
30333
30472
  return;
30334
30473
  var sharedQuestions = ((_a = this.survey) === null || _a === void 0 ? void 0 : _a.questionsByValueName(this.getValueName())) || [];
30335
30474
  if (sharedQuestions.length < 2) {
@@ -31609,10 +31748,10 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
31609
31748
  };
31610
31749
  _this.createLocalizableString("removeRowText", _this, false, "removeRow");
31611
31750
  _this.createLocalizableString("emptyRowsText", _this, false, true);
31612
- _this.registerPropertyChangedHandlers(["hideColumnsIfEmpty", "allowAddRows"], function () {
31613
- _this.updateShowTableAndAddRow();
31614
- });
31751
+ _this.registerPropertyChangedHandlers(["hideColumnsIfEmpty", "allowAddRows"], function () { _this.updateShowTableAndAddRow(); });
31615
31752
  _this.registerPropertyChangedHandlers(["allowRowsDragAndDrop", "isReadOnly", "lockedRowCount"], function () { _this.resetRenderedTable(); });
31753
+ _this.registerPropertyChangedHandlers(["minRowCount"], function () { _this.onMinRowCountChanged(); });
31754
+ _this.registerPropertyChangedHandlers(["maxRowCount"], function () { _this.onMaxRowCountChanged(); });
31616
31755
  _this.dragOrClickHelper = new dragOrClickHelper_DragOrClickHelper(_this.startDragMatrixRow);
31617
31756
  return _this;
31618
31757
  }
@@ -31720,7 +31859,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
31720
31859
  return (_super.prototype.isDefaultValueEmpty.call(this) && this.isValueEmpty(this.defaultRowValue));
31721
31860
  };
31722
31861
  QuestionMatrixDynamicModel.prototype.valueFromData = function (val) {
31723
- if (this.minRowCount < 1)
31862
+ if (this.minRowCount < 1 || this.isEmpty())
31724
31863
  return _super.prototype.valueFromData.call(this, val);
31725
31864
  if (!Array.isArray(val))
31726
31865
  val = [];
@@ -31890,14 +32029,19 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
31890
32029
  if (val < 0)
31891
32030
  val = 0;
31892
32031
  this.setPropertyValue("minRowCount", val);
31893
- if (val > this.maxRowCount)
31894
- this.maxRowCount = val;
31895
- if (this.rowCount < val)
31896
- this.rowCount = val;
31897
32032
  },
31898
32033
  enumerable: false,
31899
32034
  configurable: true
31900
32035
  });
32036
+ QuestionMatrixDynamicModel.prototype.onMinRowCountChanged = function () {
32037
+ var val = this.minRowCount;
32038
+ if (val > this.maxRowCount)
32039
+ this.maxRowCount = val;
32040
+ if (this.initialRowCount < val)
32041
+ this.initialRowCount = val;
32042
+ if (this.rowCount < val)
32043
+ this.rowCount = val;
32044
+ };
31901
32045
  Object.defineProperty(QuestionMatrixDynamicModel.prototype, "maxRowCount", {
31902
32046
  /**
31903
32047
  * A maximum number of rows in the matrix. Users cannot add new rows if `rowCount` equals `maxRowCount`.
@@ -31918,14 +32062,17 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
31918
32062
  if (val == this.maxRowCount)
31919
32063
  return;
31920
32064
  this.setPropertyValue("maxRowCount", val);
31921
- if (val < this.minRowCount)
31922
- this.minRowCount = val;
31923
- if (this.rowCount > val)
31924
- this.rowCount = val;
31925
32065
  },
31926
32066
  enumerable: false,
31927
32067
  configurable: true
31928
32068
  });
32069
+ QuestionMatrixDynamicModel.prototype.onMaxRowCountChanged = function () {
32070
+ var val = this.maxRowCount;
32071
+ if (val < this.minRowCount)
32072
+ this.minRowCount = val;
32073
+ if (this.rowCount > val)
32074
+ this.rowCount = val;
32075
+ };
31929
32076
  Object.defineProperty(QuestionMatrixDynamicModel.prototype, "allowAddRows", {
31930
32077
  /**
31931
32078
  * Specifies whether users are allowed to add new rows.
@@ -32020,6 +32167,8 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
32020
32167
  this.addRow(true);
32021
32168
  };
32022
32169
  QuestionMatrixDynamicModel.prototype.getQuestionToFocusOnAddingRow = function () {
32170
+ if (this.visibleRows.length === 0)
32171
+ return null;
32023
32172
  var row = this.visibleRows[this.visibleRows.length - 1];
32024
32173
  for (var i = 0; i < row.cells.length; i++) {
32025
32174
  var q = row.cells[i].question;
@@ -32097,8 +32246,9 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
32097
32246
  }
32098
32247
  if (this.data) {
32099
32248
  this.runCellsCondition(this.getDataFilteredValues(), this.getDataFilteredProperties());
32100
- if (this.isValueEmpty(defaultValue)) {
32101
- var row = this.visibleRows[this.rowCount - 1];
32249
+ var rows = this.visibleRows;
32250
+ if (this.isValueEmpty(defaultValue) && rows.length > 0) {
32251
+ var row = rows[rows.length - 1];
32102
32252
  if (!this.isValueEmpty(row.value)) {
32103
32253
  if (!newValue) {
32104
32254
  newValue = this.createNewValue();
@@ -32112,8 +32262,10 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
32112
32262
  }
32113
32263
  }
32114
32264
  if (this.survey) {
32115
- if (prevRowCount + 1 == this.rowCount) {
32116
- this.survey.matrixRowAdded(this, this.visibleRows[this.visibleRows.length - 1]);
32265
+ var rows = this.visibleRows;
32266
+ if (prevRowCount + 1 == this.rowCount && rows.length > 0) {
32267
+ var row = rows[rows.length - 1];
32268
+ this.survey.matrixRowAdded(this, row);
32117
32269
  this.onRowsChanged();
32118
32270
  }
32119
32271
  }
@@ -32464,6 +32616,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
32464
32616
  newRow = lastDelRow;
32465
32617
  }
32466
32618
  else {
32619
+ lastDelRow = undefined;
32467
32620
  newRow = this.createMatrixRow(val[index]);
32468
32621
  }
32469
32622
  rows.splice(index, 0, newRow);
@@ -32546,6 +32699,8 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
32546
32699
  return result;
32547
32700
  };
32548
32701
  QuestionMatrixDynamicModel.prototype.deleteRowValue = function (newValue, row) {
32702
+ if (!Array.isArray(newValue))
32703
+ return newValue;
32549
32704
  var isEmpty = true;
32550
32705
  for (var i = 0; i < newValue.length; i++) {
32551
32706
  if (this.isObject(newValue[i]) && Object.keys(newValue[i]).length > 0) {
@@ -33387,6 +33542,7 @@ var defaultV2Css = {
33387
33542
  changeCameraButton: "sd-file__change-camera-button",
33388
33543
  takePictureButton: "sd-file__take-picture-button",
33389
33544
  loadingIndicator: "sd-file__loading-indicator",
33545
+ page: "sd-file__page"
33390
33546
  },
33391
33547
  signaturepad: {
33392
33548
  mainRoot: "sd-element sd-question sd-question--signature sd-row__question",
@@ -33717,7 +33873,8 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
33717
33873
  function SurveyTimer() {
33718
33874
  this.listenerCounter = 0;
33719
33875
  this.timerId = -1;
33720
- this.onTimer = new EventBase();
33876
+ this.onTimerTick = new EventBase();
33877
+ this.onTimer = this.onTimerTick;
33721
33878
  }
33722
33879
  Object.defineProperty(SurveyTimer, "instance", {
33723
33880
  get: function () {
@@ -33733,7 +33890,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
33733
33890
  var _this = this;
33734
33891
  if (func === void 0) { func = null; }
33735
33892
  if (func) {
33736
- this.onTimer.add(func);
33893
+ this.onTimerTick.add(func);
33737
33894
  }
33738
33895
  this.prevTimeInMs = surveyTimerFunctions.now();
33739
33896
  if (this.timerId < 0) {
@@ -33746,7 +33903,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
33746
33903
  SurveyTimer.prototype.stop = function (func) {
33747
33904
  if (func === void 0) { func = null; }
33748
33905
  if (func) {
33749
- this.onTimer.remove(func);
33906
+ this.onTimerTick.remove(func);
33750
33907
  }
33751
33908
  this.listenerCounter--;
33752
33909
  if (this.listenerCounter == 0 && this.timerId > -1) {
@@ -33756,7 +33913,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
33756
33913
  };
33757
33914
  SurveyTimer.prototype.doTimer = function () {
33758
33915
  var _this = this;
33759
- if (this.onTimer.isEmpty || this.listenerCounter == 0) {
33916
+ if (this.onTimerTick.isEmpty || this.listenerCounter == 0) {
33760
33917
  this.timerId = -1;
33761
33918
  }
33762
33919
  if (this.timerId < 0)
@@ -33768,7 +33925,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
33768
33925
  seconds = 1;
33769
33926
  }
33770
33927
  var prevItem = this.timerId;
33771
- this.onTimer.fire(this, { seconds: seconds });
33928
+ this.onTimerTick.fire(this, { seconds: seconds });
33772
33929
  //We have to check that we have the same timerId
33773
33930
  //It could be changed during events execution and it will lead to double timer events
33774
33931
  if (prevItem !== this.timerId)
@@ -33868,8 +34025,8 @@ var surveyTimerModel_SurveyTimerModel = /** @class */ (function (_super) {
33868
34025
  }
33869
34026
  this.spent = this.spent + seconds;
33870
34027
  this.update();
33871
- if (this.onTimer) {
33872
- this.onTimer(page);
34028
+ if (this.onTimerTick) {
34029
+ this.onTimerTick(page);
33873
34030
  }
33874
34031
  };
33875
34032
  SurveyTimerModel.prototype.updateProgress = function () {
@@ -34849,6 +35006,13 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
34849
35006
  QuestionRowModel.getRowId = function () {
34850
35007
  return "pr_" + QuestionRowModel.rowCounter++;
34851
35008
  };
35009
+ Object.defineProperty(QuestionRowModel.prototype, "allowRendering", {
35010
+ get: function () {
35011
+ return !this.panel || !this.panel.survey || !this.panel.survey["isLazyRenderingSuspended"];
35012
+ },
35013
+ enumerable: false,
35014
+ configurable: true
35015
+ });
34852
35016
  QuestionRowModel.prototype.startLazyRendering = function (rowContainerDiv, findScrollableContainer) {
34853
35017
  var _this = this;
34854
35018
  if (findScrollableContainer === void 0) { findScrollableContainer = findScrollableParent; }
@@ -34863,6 +35027,9 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
34863
35027
  this.isNeedRender = !hasScroll;
34864
35028
  if (hasScroll) {
34865
35029
  this._updateVisibility = function () {
35030
+ if (!_this.allowRendering) {
35031
+ return;
35032
+ }
34866
35033
  var isRowContainerDivVisible = isElementVisible(rowContainerDiv, 50);
34867
35034
  if (!_this.isNeedRender && isRowContainerDivVisible) {
34868
35035
  _this.isNeedRender = true;
@@ -34996,6 +35163,10 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
34996
35163
  if (this.elements[i].isVisible) {
34997
35164
  visElements.push(this.elements[i]);
34998
35165
  }
35166
+ if (this.elements[i].isPanel || this.elements[i].getType() === "paneldynamic") {
35167
+ this.setIsLazyRendering(false);
35168
+ this.stopLazyRendering();
35169
+ }
34999
35170
  }
35000
35171
  this.visibleElements = visElements;
35001
35172
  return;
@@ -35606,7 +35777,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
35606
35777
  PanelModelBase.prototype.getValue = function () {
35607
35778
  var data = {};
35608
35779
  this.collectValues(data, 0);
35609
- return data;
35780
+ return helpers_Helpers.getUnbindValue(data);
35610
35781
  };
35611
35782
  PanelModelBase.prototype.collectValues = function (data, level) {
35612
35783
  var elements = this.elements;
@@ -36206,11 +36377,21 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36206
36377
  this.onVisibleChanged();
36207
36378
  }
36208
36379
  };
36380
+ PanelModelBase.prototype.canRenderFirstRows = function () {
36381
+ return this.isPage;
36382
+ };
36383
+ PanelModelBase.prototype.isLazyRenderInRow = function (rowIndex) {
36384
+ if (!this.survey || !this.survey.isLazyRendering)
36385
+ return false;
36386
+ return (rowIndex >= this.survey.lazyRenderingFirstBatchSize ||
36387
+ !this.canRenderFirstRows());
36388
+ };
36209
36389
  PanelModelBase.prototype.createRowAndSetLazy = function (index) {
36210
36390
  var row = this.createRow();
36211
36391
  row.setIsLazyRendering(this.isLazyRenderInRow(index));
36212
36392
  return row;
36213
36393
  };
36394
+ // TODO V2: make all createRow API private (at least protected) after removing DragDropPanelHelperV1
36214
36395
  PanelModelBase.prototype.createRow = function () {
36215
36396
  return new panel_QuestionRowModel(this);
36216
36397
  };
@@ -36441,15 +36622,6 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36441
36622
  }
36442
36623
  return result;
36443
36624
  };
36444
- PanelModelBase.prototype.isLazyRenderInRow = function (rowIndex) {
36445
- if (!this.survey || !this.survey.isLazyRendering)
36446
- return false;
36447
- return (rowIndex >= this.survey.lazyRenderingFirstBatchSize ||
36448
- !this.canRenderFirstRows());
36449
- };
36450
- PanelModelBase.prototype.canRenderFirstRows = function () {
36451
- return this.isPage;
36452
- };
36453
36625
  PanelModelBase.prototype.getDragDropInfo = function () {
36454
36626
  var page = this.getPage(this.parent);
36455
36627
  return !!page ? page.getDragDropInfo() : undefined;
@@ -36479,27 +36651,74 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36479
36651
  }
36480
36652
  }
36481
36653
  };
36482
- PanelModelBase.prototype.disableLazyRenderingBeforeElement = function (el) {
36483
- var row = el ? this.findRowByElement(el) : undefined;
36484
- var index = el ? this.rows.indexOf(row) : this.rows.length - 1;
36485
- for (var i = index; i >= 0; i--) {
36486
- var currentRow = this.rows[i];
36487
- if (currentRow.isNeedRender) {
36488
- break;
36489
- }
36490
- else {
36491
- currentRow.isNeedRender = true;
36492
- currentRow.stopLazyRendering();
36493
- }
36494
- }
36654
+ PanelModelBase.prototype.getAllRows = function () {
36655
+ var _this = this;
36656
+ var allRows = [];
36657
+ this.rows.forEach(function (row) {
36658
+ var nestedRows = [];
36659
+ row.elements.forEach(function (element) {
36660
+ if (element.isPanel) {
36661
+ nestedRows.push.apply(nestedRows, element.getAllRows());
36662
+ }
36663
+ else if (element.getType() == "paneldynamic") {
36664
+ if (_this.isDesignMode) {
36665
+ nestedRows.push.apply(nestedRows, element.template.getAllRows());
36666
+ }
36667
+ else {
36668
+ element.panels.forEach(function (panel) { return nestedRows.push.apply(nestedRows, panel.getAllRows()); });
36669
+ }
36670
+ }
36671
+ });
36672
+ allRows.push(row);
36673
+ allRows.push.apply(allRows, nestedRows);
36674
+ });
36675
+ return allRows;
36495
36676
  };
36496
- PanelModelBase.prototype.findRowByElement = function (el) {
36497
- var rows = this.rows;
36677
+ PanelModelBase.prototype.findRowAndIndexByElement = function (el, rows) {
36678
+ if (!el) {
36679
+ return { row: undefined, index: this.rows.length - 1 };
36680
+ }
36681
+ rows = rows || this.rows;
36498
36682
  for (var i = 0; i < rows.length; i++) {
36499
36683
  if (rows[i].elements.indexOf(el) > -1)
36500
- return rows[i];
36684
+ return { row: rows[i], index: i };
36685
+ }
36686
+ return { row: null, index: -1 };
36687
+ };
36688
+ PanelModelBase.prototype.forceRenderRow = function (row) {
36689
+ if (!!row && !row.isNeedRender) {
36690
+ row.isNeedRender = true;
36691
+ row.stopLazyRendering();
36501
36692
  }
36502
- return null;
36693
+ };
36694
+ PanelModelBase.prototype.forceRenderElement = function (el, elementsRendered, gap) {
36695
+ if (elementsRendered === void 0) { elementsRendered = function () { }; }
36696
+ if (gap === void 0) { gap = 0; }
36697
+ var allRows = this.getAllRows();
36698
+ var _a = this.findRowAndIndexByElement(el, allRows), row = _a.row, index = _a.index;
36699
+ if (index >= 0 && index < allRows.length) {
36700
+ var rowsToRender = [];
36701
+ rowsToRender.push(row);
36702
+ for (var i = index - 1; i >= index - gap && i >= 0; i--) {
36703
+ rowsToRender.push(allRows[i]);
36704
+ }
36705
+ this.forceRenderRows(rowsToRender, elementsRendered);
36706
+ }
36707
+ };
36708
+ PanelModelBase.prototype.forceRenderRows = function (rows, elementsRendered) {
36709
+ var _this = this;
36710
+ if (elementsRendered === void 0) { elementsRendered = function () { }; }
36711
+ var rowRenderedHandler = (function (rowsCount) { return function () {
36712
+ rowsCount--;
36713
+ if (rowsCount <= 0) {
36714
+ elementsRendered();
36715
+ }
36716
+ }; })(rows.length);
36717
+ rows.forEach(function (row) { return new RenderingCompletedAwaiter(row.visibleElements, rowRenderedHandler); });
36718
+ rows.forEach(function (row) { return _this.forceRenderRow(row); });
36719
+ };
36720
+ PanelModelBase.prototype.findRowByElement = function (el) {
36721
+ return this.findRowAndIndexByElement(el).row;
36503
36722
  };
36504
36723
  PanelModelBase.prototype.elementWidthChanged = function (el) {
36505
36724
  if (this.isLoadingFromJson)
@@ -36955,6 +37174,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36955
37174
  }
36956
37175
  return this.layoutColumns.slice(0, tailIndex + 1);
36957
37176
  };
37177
+ PanelModelBase.prototype.afterRender = function (el) {
37178
+ this.afterRenderCore(el);
37179
+ };
36958
37180
  PanelModelBase.prototype.dispose = function () {
36959
37181
  _super.prototype.dispose.call(this);
36960
37182
  if (this.rows) {
@@ -37183,7 +37405,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
37183
37405
  };
37184
37406
  PanelModel.prototype.beforeSetVisibleIndex = function (index) {
37185
37407
  var visibleIndex = -1;
37186
- if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty)) {
37408
+ if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty || this.hasParentInQuestionIndex())) {
37187
37409
  visibleIndex = index;
37188
37410
  }
37189
37411
  this.setPropertyValue("visibleIndex", visibleIndex);
@@ -37191,14 +37413,21 @@ var panel_PanelModel = /** @class */ (function (_super) {
37191
37413
  return visibleIndex < 0 ? 0 : 1;
37192
37414
  };
37193
37415
  PanelModel.prototype.getPanelStartIndex = function (index) {
37194
- if (this.showQuestionNumbers == "off")
37416
+ if (this.showQuestionNumbers === "off")
37195
37417
  return -1;
37196
- if (this.showQuestionNumbers == "onpanel")
37418
+ if (this.showQuestionNumbers === "onpanel")
37197
37419
  return 0;
37198
37420
  return index;
37199
37421
  };
37422
+ PanelModel.prototype.hasParentInQuestionIndex = function () {
37423
+ if (this.showQuestionNumbers !== "onpanel")
37424
+ return false;
37425
+ var str = this.questionStartIndex;
37426
+ var index = str.indexOf(".");
37427
+ return index > -1 && index < str.length - 1;
37428
+ };
37200
37429
  PanelModel.prototype.isContinueNumbering = function () {
37201
- return (this.showQuestionNumbers != "off" && this.showQuestionNumbers != "onpanel");
37430
+ return this.showQuestionNumbers !== "off" && this.showQuestionNumbers !== "onpanel";
37202
37431
  };
37203
37432
  PanelModel.prototype.notifySurveyOnVisibilityChanged = function () {
37204
37433
  if (this.survey != null && !this.isLoadingFromJson) {
@@ -37420,6 +37649,11 @@ var panel_PanelModel = /** @class */ (function (_super) {
37420
37649
  PanelModel.prototype.getContainerCss = function () {
37421
37650
  return this.getCssRoot(this.cssClasses.panel);
37422
37651
  };
37652
+ PanelModel.prototype.afterRenderCore = function (element) {
37653
+ var _a;
37654
+ _super.prototype.afterRenderCore.call(this, element);
37655
+ (_a = this.survey) === null || _a === void 0 ? void 0 : _a.afterRenderPanel(this, element);
37656
+ };
37423
37657
  return PanelModel;
37424
37658
  }(panel_PanelModelBase));
37425
37659
 
@@ -37773,7 +38007,7 @@ var page_PageModel = /** @class */ (function (_super) {
37773
38007
  _this.hasShownValue = false;
37774
38008
  /**
37775
38009
  * A time period that a respondent has spent on this page so far; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
37776
- * @see maxTimeToFinish
38010
+ * @see timeLimit
37777
38011
  */
37778
38012
  _this.timeSpent = 0;
37779
38013
  _this.createLocalizableString("navigationDescription", _this, true);
@@ -37866,6 +38100,13 @@ var page_PageModel = /** @class */ (function (_super) {
37866
38100
  this.locNavigationTitle.strChanged();
37867
38101
  this.locNavigationDescription.strChanged();
37868
38102
  };
38103
+ PageModel.prototype.getMarkdownHtml = function (text, name) {
38104
+ var result = _super.prototype.getMarkdownHtml.call(this, text, name);
38105
+ if (name === "navigationTitle" && this.canShowPageNumber() && result) {
38106
+ return this.num + ". " + result;
38107
+ }
38108
+ return result;
38109
+ };
37869
38110
  Object.defineProperty(PageModel.prototype, "passed", {
37870
38111
  get: function () {
37871
38112
  return this.getPropertyValue("passed", false);
@@ -38053,12 +38294,6 @@ var page_PageModel = /** @class */ (function (_super) {
38053
38294
  this.survey.scrollElementToTop(this, null, this, this.id);
38054
38295
  }
38055
38296
  };
38056
- // public get timeSpent(): number {
38057
- // return this.getPropertyValue("timeSpent", 0);
38058
- // }
38059
- // public set timeSpent(val: number) {
38060
- // this.setPropertyValue("timeSpent", val);
38061
- // }
38062
38297
  /**
38063
38298
  * Returns a list of all panels on this page.
38064
38299
  * @param visibleOnly A Boolean value that specifies whether to include only visible panels.
@@ -38076,28 +38311,42 @@ var page_PageModel = /** @class */ (function (_super) {
38076
38311
  if (includingDesignTime === void 0) { includingDesignTime = false; }
38077
38312
  return this.getAllPanels(visibleOnly, includingDesignTime);
38078
38313
  };
38079
- Object.defineProperty(PageModel.prototype, "maxTimeToFinish", {
38314
+ Object.defineProperty(PageModel.prototype, "timeLimit", {
38080
38315
  /**
38081
38316
  * A time period that a respondent has to complete this page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
38082
38317
  *
38083
- * A negative value or 0 sets an unlimited time period.
38318
+ * Default value: 0 (time is unlimited)
38084
38319
  *
38085
- * Alternatively, you can use the `SurveyModel`'s [`maxTimeToFinishPage`](https://surveyjs.io/form-library/documentation/surveymodel#maxTimeToFinishPage) property to specify identical time periods for all survey pages.
38320
+ * Alternatively, you can use the `SurveyModel`'s [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/surveymodel#timeLimitPerPage) property to specify identical time periods for all survey pages.
38086
38321
  * @see timeSpent
38087
38322
  */
38088
38323
  get: function () {
38089
- return this.getPropertyValue("maxTimeToFinish", 0);
38324
+ return this.getPropertyValue("timeLimit", 0);
38090
38325
  },
38091
38326
  set: function (val) {
38092
- this.setPropertyValue("maxTimeToFinish", val);
38327
+ this.setPropertyValue("timeLimit", val);
38328
+ },
38329
+ enumerable: false,
38330
+ configurable: true
38331
+ });
38332
+ Object.defineProperty(PageModel.prototype, "maxTimeToFinish", {
38333
+ /**
38334
+ * Obsolete. Use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeLimit) property instead.
38335
+ * @deprecated
38336
+ */
38337
+ get: function () {
38338
+ return this.timeLimit;
38339
+ },
38340
+ set: function (val) {
38341
+ this.timeLimit = val;
38093
38342
  },
38094
38343
  enumerable: false,
38095
38344
  configurable: true
38096
38345
  });
38097
38346
  PageModel.prototype.getMaxTimeToFinish = function () {
38098
- if (this.maxTimeToFinish !== 0)
38099
- return this.maxTimeToFinish;
38100
- var res = !!this.survey ? this.survey.maxTimeToFinishPage : 0;
38347
+ if (this.timeLimit !== 0)
38348
+ return this.timeLimit;
38349
+ var res = !!this.survey ? this.survey.timeLimitPerPage : 0;
38101
38350
  return res > 0 ? res : 0;
38102
38351
  };
38103
38352
  PageModel.prototype.onNumChanged = function (value) { };
@@ -38139,7 +38388,7 @@ Serializer.addClass("page", [
38139
38388
  default: "inherit",
38140
38389
  choices: ["inherit", "show", "hide"],
38141
38390
  },
38142
- { name: "maxTimeToFinish:number", default: 0, minValue: 0 },
38391
+ { name: "timeLimit:number", alternativeName: "maxTimeToFinish", default: 0, minValue: 0 },
38143
38392
  {
38144
38393
  name: "navigationTitle",
38145
38394
  visibleIf: function (obj) {
@@ -39165,12 +39414,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39165
39414
  * An event that is raised every second while the timer is running.
39166
39415
  *
39167
39416
  * Use the [`timeSpent`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeSpent) property to find out how many seconds have elapsed.
39168
- * @see maxTimeToFinish
39169
- * @see maxTimeToFinishPage
39170
- * @see showTimerPanel
39417
+ * @see timeLimit
39418
+ * @see timeLimitPerPage
39419
+ * @see showTimer
39420
+ * @see timerLocation
39171
39421
  * @see startTimer
39172
39422
  */
39173
- _this.onTimer = _this.addEvent();
39423
+ _this.onTimerTick = _this.addEvent();
39424
+ /**
39425
+ * Obsolete. Use the [`onTimerTick`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTimerTick) event instead.
39426
+ * @deprecated
39427
+ */
39428
+ _this.onTimer = _this.onTimerTick;
39174
39429
  _this.onTimerPanelInfoText = _this.addEvent();
39175
39430
  /**
39176
39431
  * An event that is raised after an item value is changed in a panel within a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question.
@@ -39267,6 +39522,19 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39267
39522
  */
39268
39523
  _this.jsonErrors = null;
39269
39524
  _this.cssValue = null;
39525
+ /**
39526
+ * Specifies whether the [Complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page) should display the [survey header](https://surveyjs.io/form-library/examples/brand-your-survey-header/).
39527
+ *
39528
+ * Possible values:
39529
+ *
39530
+ * - `true` - Displays the survey header on the Complete page.
39531
+ * - `false` - Hides the header when users reach the Complete page.
39532
+ * - `"auto"` (default) - Displays a header with the basic view, but hides a header with the advanced view (see the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property description).
39533
+ *
39534
+ * > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
39535
+ */
39536
+ _this.showHeaderOnCompletePage = "auto";
39537
+ _this._isLazyRenderingSuspended = false;
39270
39538
  /**
39271
39539
  * Specifies whether to hide validation errors thrown by the Required validation in the UI.
39272
39540
  *
@@ -39303,6 +39571,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39303
39571
  _this.onResize = new EventBase();
39304
39572
  _this.isCurrentPageRendering = true;
39305
39573
  _this.isCurrentPageRendered = undefined;
39574
+ _this.skeletonHeight = undefined;
39306
39575
  _this.isTriggerIsRunning = false;
39307
39576
  _this.triggerValues = null;
39308
39577
  _this.triggerKeys = null;
@@ -39341,7 +39610,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39341
39610
  _this.createLocalizableString("editText", _this, false, true);
39342
39611
  _this.createLocalizableString("questionTitleTemplate", _this, true);
39343
39612
  _this.timerModelValue = new surveyTimerModel_SurveyTimerModel(_this);
39344
- _this.timerModelValue.onTimer = function (page) {
39613
+ _this.timerModelValue.onTimerTick = function (page) {
39345
39614
  _this.doTimer(page);
39346
39615
  };
39347
39616
  _this.createNewArray("pages", function (value) {
@@ -39718,7 +39987,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39718
39987
  Object.defineProperty(SurveyModel.prototype, "bodyCss", {
39719
39988
  get: function () {
39720
39989
  return new CssClassBuilder().append(this.css.body)
39721
- .append(this.css.bodyWithTimer, this.showTimerPanel != "none" && this.state === "running")
39990
+ .append(this.css.bodyWithTimer, this.showTimer && this.state === "running")
39722
39991
  .append(this.css.body + "--" + this.calculatedWidthMode).toString();
39723
39992
  },
39724
39993
  enumerable: false,
@@ -39789,22 +40058,29 @@ var survey_SurveyModel = /** @class */ (function (_super) {
39789
40058
  enumerable: false,
39790
40059
  configurable: true
39791
40060
  });
39792
- SurveyModel.prototype.disableLazyRenderingBeforeElement = function (el) {
39793
- if (this.isDesignMode) {
39794
- var page = this.getPageByElement(el);
39795
- var index = this.pages.indexOf(page);
39796
- for (var i = index; i >= 0; i--) {
39797
- var currentPage = this.pages[i];
39798
- currentPage.disableLazyRenderingBeforeElement(currentPage == page ? el : undefined);
39799
- }
39800
- }
40061
+ Object.defineProperty(SurveyModel.prototype, "isLazyRenderingSuspended", {
40062
+ get: function () {
40063
+ return this._isLazyRenderingSuspended;
40064
+ },
40065
+ enumerable: false,
40066
+ configurable: true
40067
+ });
40068
+ SurveyModel.prototype.suspendLazyRendering = function () {
40069
+ if (!this.isLazyRendering)
40070
+ return;
40071
+ this._isLazyRenderingSuspended = true;
40072
+ };
40073
+ SurveyModel.prototype.releaseLazyRendering = function () {
40074
+ if (!this.isLazyRendering)
40075
+ return;
40076
+ this._isLazyRenderingSuspended = false;
39801
40077
  };
39802
40078
  SurveyModel.prototype.updateLazyRenderingRowsOnRemovingElements = function () {
39803
40079
  if (!this.isLazyRendering)
39804
40080
  return;
39805
40081
  var page = this.currentPage;
39806
40082
  if (!!page) {
39807
- scrollElementByChildId(page.id);
40083
+ activateLazyRenderingChecks(page.id);
39808
40084
  }
39809
40085
  };
39810
40086
  Object.defineProperty(SurveyModel.prototype, "triggers", {
@@ -41037,13 +41313,20 @@ var survey_SurveyModel = /** @class */ (function (_super) {
41037
41313
  /**
41038
41314
  * Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns a result value.
41039
41315
  * @param expression An expression to calculate.
41316
+ * @param callback A callback function that you can use to access the calculation result if the expression uses asynchronous functions.
41040
41317
  */
41041
- SurveyModel.prototype.runExpression = function (expression) {
41318
+ SurveyModel.prototype.runExpression = function (expression, callback) {
41042
41319
  if (!expression)
41043
41320
  return null;
41044
41321
  var values = this.getFilteredValues();
41045
41322
  var properties = this.getFilteredProperties();
41046
- return new ExpressionRunner(expression).run(values, properties);
41323
+ var exp = new ExpressionRunner(expression);
41324
+ var onCompleteRes = undefined;
41325
+ exp.onRunComplete = function (res) {
41326
+ onCompleteRes = res;
41327
+ callback && callback(res);
41328
+ };
41329
+ return exp.run(values, properties) || onCompleteRes;
41047
41330
  };
41048
41331
  /**
41049
41332
  * Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns `true` or `false`.
@@ -44331,7 +44614,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44331
44614
  this.onGetMatrixRowActions.fire(this, options);
44332
44615
  return options.actions;
44333
44616
  };
44334
- SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions) {
44617
+ SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement) {
44618
+ var _this = this;
44335
44619
  var options = {
44336
44620
  element: element,
44337
44621
  question: question,
@@ -44341,7 +44625,25 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44341
44625
  };
44342
44626
  this.onScrollingElementToTop.fire(this, options);
44343
44627
  if (!options.cancel) {
44344
- survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
44628
+ var elementPage_1 = this.getPageByElement(element);
44629
+ if (this.isLazyRendering && !!elementPage_1) {
44630
+ var elementsToRenderBefore = 1;
44631
+ var rootElement = settings.environment.rootElement;
44632
+ var surveyRootElement = this.rootElement || passedRootElement || rootElement;
44633
+ if (!!this.skeletonHeight && !!surveyRootElement && typeof surveyRootElement.getBoundingClientRect === "function") {
44634
+ elementsToRenderBefore = surveyRootElement.getBoundingClientRect().height / this.skeletonHeight - 1;
44635
+ }
44636
+ elementPage_1.forceRenderElement(element, function () {
44637
+ _this.suspendLazyRendering();
44638
+ survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, function () {
44639
+ _this.releaseLazyRendering();
44640
+ activateLazyRenderingChecks(elementPage_1.id);
44641
+ });
44642
+ }, elementsToRenderBefore);
44643
+ }
44644
+ else {
44645
+ survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
44646
+ }
44345
44647
  }
44346
44648
  };
44347
44649
  /**
@@ -46088,64 +46390,117 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46088
46390
  };
46089
46391
  Object.defineProperty(SurveyModel.prototype, "showTimerPanel", {
46090
46392
  /**
46091
- * Displays the timer panel and specifies its position. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46393
+ * Obsolete. Use the [`showTimer`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer) and [`timerLocation`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerLocation) properties instead.
46394
+ * @deprecated
46395
+ */
46396
+ get: function () {
46397
+ if (!this.showTimer)
46398
+ return "none";
46399
+ return this.timerLocation;
46400
+ },
46401
+ set: function (val) {
46402
+ this.showTimer = val !== "none";
46403
+ if (this.showTimer) {
46404
+ this.timerLocation = val;
46405
+ }
46406
+ },
46407
+ enumerable: false,
46408
+ configurable: true
46409
+ });
46410
+ Object.defineProperty(SurveyModel.prototype, "showTimer", {
46411
+ /**
46412
+ * Specifies the timer's visibility. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46092
46413
  *
46093
- * Possible values:
46414
+ * Default value: `false`
46094
46415
  *
46095
- * - `"top"` - Displays the timer panel at the top of the survey.
46096
- * - `"bottom"` - Displays the timer panel at the bottom of the survey.
46097
- * - `"none"` (default) - Hides the timer panel.
46416
+ * If you set this property to `true`, the timer starts automatically when the survey begins. To specify time limits, use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimit) and [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimitPerPage) properties.
46098
46417
  *
46099
- * If the timer panel is displayed, the timer starts automatically when the survey begins. To specify time limits, use the [`maxTimeToFinish`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#maxTimeToFinish) and [`maxTimeToFinishPage`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#maxTimeToFinishPage) properties.
46418
+ * The timer displays information about time spent on an individual page and the entire survey. If you want to display only the page timer or the survey timer, set the [`timerInfoMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerInfoMode) property to `"page"` or `"survey"`.
46100
46419
  *
46101
- * The timer panel displays information about time spent on an individual page and the entire survey. If you want to display only the page timer or the survey timer, set the [`showTimerPanelMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimerPanelMode) property to `"page"` or `"survey"`.
46102
- * @see startTimer
46103
- * @see stopTimer
46420
+ * You can enable the timer without displaying it. In this case, you need to specify the required time limits and use the [`startTimer()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#startTimer) and [`stopTimer()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#stopTimer) methods to control the timer.
46421
+ * @see timerLocation
46104
46422
  * @see timeSpent
46105
- * @see onTimer
46423
+ * @see onTimerTick
46424
+ */
46425
+ get: function () {
46426
+ return this.getPropertyValue("showTimer");
46427
+ },
46428
+ set: function (val) {
46429
+ this.setPropertyValue("showTimer", val);
46430
+ },
46431
+ enumerable: false,
46432
+ configurable: true
46433
+ });
46434
+ Object.defineProperty(SurveyModel.prototype, "timerLocation", {
46435
+ /**
46436
+ * Specifies the timer's position relative to the survey. Applies only if the [`showTimer`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer) property is set to `true`.
46437
+ *
46438
+ * Possible values:
46439
+ *
46440
+ * - `"top"` (default) - Displays the timer at the top of the survey.
46441
+ * - `"bottom"` - Displays the timer at the bottom of the survey.
46442
+ * @see onTimerTick
46106
46443
  */
46107
46444
  get: function () {
46108
- return this.getPropertyValue("showTimerPanel");
46445
+ return this.getPropertyValue("timerLocation");
46109
46446
  },
46110
46447
  set: function (val) {
46111
- this.setPropertyValue("showTimerPanel", val);
46448
+ this.setPropertyValue("timerLocation", val);
46112
46449
  },
46113
46450
  enumerable: false,
46114
46451
  configurable: true
46115
46452
  });
46116
46453
  Object.defineProperty(SurveyModel.prototype, "isTimerPanelShowingOnTop", {
46117
46454
  get: function () {
46118
- return this.showTimerPanel == "top";
46455
+ return this.showTimer && this.timerLocation === "top";
46119
46456
  },
46120
46457
  enumerable: false,
46121
46458
  configurable: true
46122
46459
  });
46123
46460
  Object.defineProperty(SurveyModel.prototype, "isTimerPanelShowingOnBottom", {
46124
46461
  get: function () {
46125
- return this.showTimerPanel == "bottom";
46462
+ return this.showTimer && this.timerLocation === "bottom";
46126
46463
  },
46127
46464
  enumerable: false,
46128
46465
  configurable: true
46129
46466
  });
46130
- Object.defineProperty(SurveyModel.prototype, "showTimerPanelMode", {
46467
+ Object.defineProperty(SurveyModel.prototype, "timerInfoMode", {
46131
46468
  /**
46132
- * Specifies whether the timer panel displays timers for the current page, the entire survey, or both. Applies only if the timer panel is [visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimerPanel).
46469
+ * Specifies whether the timer panel displays timers for the current page, the entire survey, or both. Applies only if the timer panel is [visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer).
46133
46470
  *
46134
46471
  * Possible values:
46135
46472
  *
46136
46473
  * - `"survey"` - Displays only the survey timer.
46137
46474
  * - `"page"` - Displays only the page timer.
46138
- * - `"all"` (default) - Displays both the survey and page timers.
46475
+ * - `"combined"` (default) - Displays both the survey and page timers.
46139
46476
  * @see timeSpent
46140
- * @see onTimer
46477
+ * @see onTimerTick
46141
46478
  * @see startTimer
46142
46479
  * @see stopTimer
46143
46480
  */
46144
46481
  get: function () {
46145
- return this.getPropertyValue("showTimerPanelMode");
46482
+ return this.getTimerInfoVal(this.getPropertyValue("timerInfoMode"));
46483
+ },
46484
+ set: function (val) {
46485
+ this.setPropertyValue("timerInfoMode", val);
46486
+ },
46487
+ enumerable: false,
46488
+ configurable: true
46489
+ });
46490
+ SurveyModel.prototype.getTimerInfoVal = function (val) {
46491
+ return val === "all" ? "combined" : val;
46492
+ };
46493
+ Object.defineProperty(SurveyModel.prototype, "showTimerPanelMode", {
46494
+ /**
46495
+ * Obsolete. Use the [`timerInfoMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerInfoMode) property instead.
46496
+ * @deprecated
46497
+ */
46498
+ get: function () {
46499
+ var res = this.timerInfoMode;
46500
+ return res === "combined" ? "all" : res;
46146
46501
  },
46147
46502
  set: function (val) {
46148
- this.setPropertyValue("showTimerPanelMode", val);
46503
+ this.timerInfoMode = this.getTimerInfoVal(val);
46149
46504
  },
46150
46505
  enumerable: false,
46151
46506
  configurable: true
@@ -46264,11 +46619,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46264
46619
  var pageSpent = page.timeSpent;
46265
46620
  var surveySpent = this.timeSpent;
46266
46621
  var pageLimitSec = page.getMaxTimeToFinish();
46267
- var surveyLimit = this.maxTimeToFinish;
46268
- if (this.showTimerPanelMode == "page") {
46622
+ var surveyLimit = this.timeLimit;
46623
+ if (this.timerInfoMode == "page") {
46269
46624
  return { spent: pageSpent, limit: pageLimitSec };
46270
46625
  }
46271
- if (this.showTimerPanelMode == "survey") {
46626
+ if (this.timerInfoMode == "survey") {
46272
46627
  return { spent: surveySpent, limit: surveyLimit };
46273
46628
  }
46274
46629
  else {
@@ -46294,16 +46649,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46294
46649
  var surveySpent = this.getDisplayTime(this.timeSpent);
46295
46650
  var pageLimitSec = page.getMaxTimeToFinish();
46296
46651
  var pageLimit = this.getDisplayTime(pageLimitSec);
46297
- var surveyLimit = this.getDisplayTime(this.maxTimeToFinish);
46298
- if (this.showTimerPanelMode == "page")
46652
+ var surveyLimit = this.getDisplayTime(this.timeLimit);
46653
+ if (this.timerInfoMode == "page")
46299
46654
  return this.getTimerInfoPageText(page, pageSpent, pageLimit);
46300
- if (this.showTimerPanelMode == "survey")
46655
+ if (this.timerInfoMode == "survey")
46301
46656
  return this.getTimerInfoSurveyText(surveySpent, surveyLimit);
46302
- if (this.showTimerPanelMode == "all") {
46303
- if (pageLimitSec <= 0 && this.maxTimeToFinish <= 0) {
46657
+ if (this.timerInfoMode == "combined") {
46658
+ if (pageLimitSec <= 0 && this.timeLimit <= 0) {
46304
46659
  return this.getLocalizationFormatString("timerSpentAll", pageSpent, surveySpent);
46305
46660
  }
46306
- if (pageLimitSec > 0 && this.maxTimeToFinish > 0) {
46661
+ if (pageLimitSec > 0 && this.timeLimit > 0) {
46307
46662
  return this.getLocalizationFormatString("timerLimitAll", pageSpent, pageLimit, surveySpent, surveyLimit);
46308
46663
  }
46309
46664
  var pageText = this.getTimerInfoPageText(page, pageSpent, pageLimit);
@@ -46318,7 +46673,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46318
46673
  : this.getLocalizationFormatString("timerSpentPage", pageSpent, pageLimit);
46319
46674
  };
46320
46675
  SurveyModel.prototype.getTimerInfoSurveyText = function (surveySpent, surveyLimit) {
46321
- var strName = this.maxTimeToFinish > 0 ? "timerLimitSurvey" : "timerSpentSurvey";
46676
+ var strName = this.timeLimit > 0 ? "timerLimitSurvey" : "timerSpentSurvey";
46322
46677
  return this.getLocalizationFormatString(strName, surveySpent, surveyLimit);
46323
46678
  };
46324
46679
  SurveyModel.prototype.getDisplayClockTime = function (val) {
@@ -46354,10 +46709,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46354
46709
  /**
46355
46710
  * Starts a timer that calculates how many seconds a respondent has spent on the survey. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46356
46711
  * @see stopTimer
46357
- * @see maxTimeToFinish
46358
- * @see maxTimeToFinishPage
46712
+ * @see timeLimit
46713
+ * @see timeLimitPerPage
46359
46714
  * @see timeSpent
46360
- * @see onTimer
46715
+ * @see onTimerTick
46361
46716
  */
46362
46717
  SurveyModel.prototype.startTimer = function () {
46363
46718
  if (this.isEditMode) {
@@ -46365,17 +46720,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46365
46720
  }
46366
46721
  };
46367
46722
  SurveyModel.prototype.startTimerFromUI = function () {
46368
- if (this.showTimerPanel != "none" && this.state === "running") {
46723
+ if (this.showTimer && this.state === "running") {
46369
46724
  this.startTimer();
46370
46725
  }
46371
46726
  };
46372
46727
  /**
46373
46728
  * Stops the timer. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46374
46729
  * @see startTimer
46375
- * @see maxTimeToFinish
46376
- * @see maxTimeToFinishPage
46730
+ * @see timeLimit
46731
+ * @see timeLimitPerPage
46377
46732
  * @see timeSpent
46378
- * @see onTimer
46733
+ * @see onTimerTick
46379
46734
  */
46380
46735
  SurveyModel.prototype.stopTimer = function () {
46381
46736
  this.timerModel.stop();
@@ -46387,8 +46742,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46387
46742
  * Assign a number to this property if you need to start the quiz timer from a specific time (for instance, if you want to continue an interrupted quiz).
46388
46743
  *
46389
46744
  * You can also find out how many seconds a respondent has spent on an individual survey page. To do this, use the [`timeSpent`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeSpent) property of a [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model) object.
46390
- * @see maxTimeToFinish
46391
- * @see maxTimeToFinishPage
46745
+ * @see timeLimit
46746
+ * @see timeLimitPerPage
46392
46747
  * @see startTimer
46393
46748
  */
46394
46749
  get: function () { return this.timerModel.spent; },
@@ -46396,52 +46751,80 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46396
46751
  enumerable: false,
46397
46752
  configurable: true
46398
46753
  });
46399
- Object.defineProperty(SurveyModel.prototype, "maxTimeToFinish", {
46754
+ Object.defineProperty(SurveyModel.prototype, "timeLimit", {
46400
46755
  /**
46401
46756
  * A time period that a respondent has to complete the survey; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46402
46757
  *
46403
- * A negative value or 0 sets an unlimited time period.
46758
+ * Default value: 0 (time is unlimited)
46404
46759
  *
46405
46760
  * [View Demo](https://surveyjs.io/form-library/examples/make-quiz-javascript/ (linkStyle))
46406
- * @see maxTimeToFinishPage
46761
+ * @see timeLimitPerPage
46407
46762
  * @see startTimer
46408
46763
  * @see timeSpent
46409
46764
  */
46410
46765
  get: function () {
46411
- return this.getPropertyValue("maxTimeToFinish", 0);
46766
+ return this.getPropertyValue("timeLimit", 0);
46412
46767
  },
46413
46768
  set: function (val) {
46414
- this.setPropertyValue("maxTimeToFinish", val);
46769
+ this.setPropertyValue("timeLimit", val);
46415
46770
  },
46416
46771
  enumerable: false,
46417
46772
  configurable: true
46418
46773
  });
46419
- Object.defineProperty(SurveyModel.prototype, "maxTimeToFinishPage", {
46774
+ Object.defineProperty(SurveyModel.prototype, "maxTimeToFinish", {
46775
+ /**
46776
+ * Obsolete. Use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimit) property instead.
46777
+ * @deprecated
46778
+ */
46779
+ get: function () {
46780
+ return this.timeLimit;
46781
+ },
46782
+ set: function (val) {
46783
+ this.timeLimit = val;
46784
+ },
46785
+ enumerable: false,
46786
+ configurable: true
46787
+ });
46788
+ Object.defineProperty(SurveyModel.prototype, "timeLimitPerPage", {
46420
46789
  /**
46421
46790
  * A time period that a respondent has to complete each survey page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
46422
46791
  *
46423
- * A negative value or 0 sets an unlimited time period.
46792
+ * Default value: 0 (time is unlimited)
46424
46793
  *
46425
- * You can also use `PageModel`'s [`maxTimeToFinish`](https://surveyjs.io/form-library/documentation/api-reference/page-model#maxTimeToFinish) property to specify a time period for an individual survey page.
46794
+ * You can also use `PageModel`'s [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeLimit) property to specify a time period for an individual survey page.
46426
46795
  *
46427
46796
  * [View Demo](https://surveyjs.io/form-library/examples/make-quiz-javascript/ (linkStyle))
46428
- * @see maxTimeToFinish
46797
+ * @see timeLimit
46429
46798
  * @see startTimer
46430
46799
  * @see timeSpent
46431
46800
  */
46432
46801
  get: function () {
46433
- return this.getPropertyValue("maxTimeToFinishPage", 0);
46802
+ return this.getPropertyValue("timeLimitPerPage", 0);
46803
+ },
46804
+ set: function (val) {
46805
+ this.setPropertyValue("timeLimitPerPage", val);
46806
+ },
46807
+ enumerable: false,
46808
+ configurable: true
46809
+ });
46810
+ Object.defineProperty(SurveyModel.prototype, "maxTimeToFinishPage", {
46811
+ /**
46812
+ * Obsolete. Use the [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimitPerPage) property instead.
46813
+ * @deprecated
46814
+ */
46815
+ get: function () {
46816
+ return this.timeLimitPerPage;
46434
46817
  },
46435
46818
  set: function (val) {
46436
- this.setPropertyValue("maxTimeToFinishPage", val);
46819
+ this.timeLimitPerPage = val;
46437
46820
  },
46438
46821
  enumerable: false,
46439
46822
  configurable: true
46440
46823
  });
46441
46824
  SurveyModel.prototype.doTimer = function (page) {
46442
- this.onTimer.fire(this, {});
46443
- if (this.maxTimeToFinish > 0 && this.maxTimeToFinish <= this.timeSpent) {
46444
- this.timeSpent = this.maxTimeToFinish;
46825
+ this.onTimerTick.fire(this, {});
46826
+ if (this.timeLimit > 0 && this.timeLimit <= this.timeSpent) {
46827
+ this.timeSpent = this.timeLimit;
46445
46828
  this.completeLastPage();
46446
46829
  }
46447
46830
  if (page) {
@@ -46749,7 +47132,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46749
47132
  }
46750
47133
  }
46751
47134
  else if (isStrCiEqual(layoutElement.id, "advanced-header")) {
46752
- if ((this.state === "running" || this.state === "starting") && layoutElement.container === container) {
47135
+ if ((this.state === "running" || this.state === "starting" || (this.showHeaderOnCompletePage === true && this.state === "completed")) && layoutElement.container === container) {
46753
47136
  containerLayoutElements.push(layoutElement);
46754
47137
  }
46755
47138
  }
@@ -47273,18 +47656,13 @@ Serializer.addClass("survey", [
47273
47656
  default: "noPreview",
47274
47657
  choices: ["noPreview", "showAllQuestions", "showAnsweredQuestions"],
47275
47658
  },
47276
- { name: "maxTimeToFinish:number", default: 0, minValue: 0 },
47277
- { name: "maxTimeToFinishPage:number", default: 0, minValue: 0 },
47278
- {
47279
- name: "showTimerPanel",
47280
- default: "none",
47281
- choices: ["none", "top", "bottom"],
47282
- },
47283
- {
47284
- name: "showTimerPanelMode",
47285
- default: "all",
47286
- choices: ["page", "survey", "all"],
47287
- },
47659
+ { name: "showTimer:boolean" },
47660
+ { name: "timeLimit:number", alternativeName: "maxTimeToFinish", default: 0, minValue: 0, enableIf: function (obj) { return obj.showTimer; } },
47661
+ { name: "timeLimitPerPage:number", alternativeName: "maxTimeToFinishPage", default: 0, minValue: 0, enableIf: function (obj) { return obj.showTimer; } },
47662
+ { name: "timerLocation", default: "top", choices: ["top", "bottom"], enableIf: function (obj) { return obj.showTimer; } },
47663
+ { name: "timerInfoMode", alternativeName: "showTimerPanelMode",
47664
+ default: "combined", choices: ["page", "survey", "combined"], enableIf: function (obj) { return obj.showTimer; } },
47665
+ { name: "showTimerPanel", visible: false, isSerializable: false },
47288
47666
  {
47289
47667
  name: "widthMode",
47290
47668
  default: "auto",
@@ -47337,6 +47715,7 @@ var question_baseselect_decorate = (undefined && undefined.__decorate) || functi
47337
47715
 
47338
47716
 
47339
47717
 
47718
+
47340
47719
  /**
47341
47720
  * A base class for multiple-choice question types ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
47342
47721
  */
@@ -47975,6 +48354,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
47975
48354
  return this.otherValueCore;
47976
48355
  };
47977
48356
  QuestionSelectBase.prototype.selectOtherValueFromComment = function (val) {
48357
+ if (val) {
48358
+ this.prevIsOtherSelected = true;
48359
+ }
47978
48360
  this.value = val ? this.otherItem.value : undefined;
47979
48361
  };
47980
48362
  QuestionSelectBase.prototype.setQuestionComment = function (newValue) {
@@ -49567,24 +49949,8 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
49567
49949
  QuestionSelectBase.prototype.getItemEnabled = function (item) {
49568
49950
  return !this.isDisabledAttr && item.isEnabled;
49569
49951
  };
49570
- QuestionSelectBase.prototype.afterRender = function (el) {
49571
- _super.prototype.afterRender.call(this, el);
49572
- this.rootElement = el;
49573
- };
49574
- QuestionSelectBase.prototype.beforeDestroyQuestionElement = function (el) {
49575
- _super.prototype.beforeDestroyQuestionElement.call(this, el);
49576
- this.rootElement = undefined;
49577
- };
49578
49952
  QuestionSelectBase.prototype.focusOtherComment = function () {
49579
- var _this = this;
49580
- if (!!this.rootElement) {
49581
- setTimeout(function () {
49582
- var commentEl = _this.rootElement.querySelector("textarea");
49583
- if (!!commentEl) {
49584
- commentEl.focus();
49585
- }
49586
- }, 10);
49587
- }
49953
+ survey_element_SurveyElement.FocusElement(this.otherId);
49588
49954
  };
49589
49955
  QuestionSelectBase.prototype.onValueChanged = function () {
49590
49956
  _super.prototype.onValueChanged.call(this);
@@ -52079,11 +52445,16 @@ var question_matrix_MatrixRowModel = /** @class */ (function (_super) {
52079
52445
  return MatrixRowModel;
52080
52446
  }(base_Base));
52081
52447
 
52082
- var question_matrix_MatrixCells = /** @class */ (function () {
52448
+ var question_matrix_MatrixCells = /** @class */ (function (_super) {
52449
+ question_matrix_extends(MatrixCells, _super);
52083
52450
  function MatrixCells(cellsOwner) {
52084
- this.cellsOwner = cellsOwner;
52085
- this.values = {};
52451
+ var _this = _super.call(this) || this;
52452
+ _this.cellsOwner = cellsOwner;
52453
+ _this.values = {};
52454
+ _this.locs = {};
52455
+ return _this;
52086
52456
  }
52457
+ MatrixCells.prototype.getType = function () { return "cells"; };
52087
52458
  Object.defineProperty(MatrixCells.prototype, "isEmpty", {
52088
52459
  get: function () {
52089
52460
  return Object.keys(this.values).length == 0;
@@ -52092,78 +52463,97 @@ var question_matrix_MatrixCells = /** @class */ (function () {
52092
52463
  configurable: true
52093
52464
  });
52094
52465
  MatrixCells.prototype.valuesChanged = function () {
52095
- if (!!this.onValuesChanged) {
52466
+ if (!this.locNotification && !!this.onValuesChanged) {
52096
52467
  this.onValuesChanged();
52097
52468
  }
52098
52469
  };
52099
- MatrixCells.prototype.setCellText = function (row, column, val) {
52470
+ MatrixCells.prototype.getDefaultCellLocText = function (column) {
52471
+ return this.getCellLocCore(this.defaultRowValue, column);
52472
+ };
52473
+ MatrixCells.prototype.getCellDisplayLocText = function (row, column) {
52474
+ return this.getCellLocCore(row, column);
52475
+ };
52476
+ MatrixCells.prototype.getCellLocCore = function (row, col) {
52477
+ var _this = this;
52100
52478
  row = this.getCellRowColumnValue(row, this.rows);
52101
- column = this.getCellRowColumnValue(column, this.columns);
52102
- if (!row || !column)
52103
- return;
52104
- if (val) {
52105
- if (!this.values[row])
52106
- this.values[row] = {};
52107
- if (!this.values[row][column])
52108
- this.values[row][column] = this.createString();
52109
- this.values[row][column].text = val;
52479
+ col = this.getCellRowColumnValue(col, this.columns);
52480
+ if (helpers_Helpers.isValueEmpty(row) || helpers_Helpers.isValueEmpty(col))
52481
+ return null;
52482
+ if (!this.locs[row]) {
52483
+ this.locs[row] = {};
52110
52484
  }
52111
- else {
52112
- if (this.values[row] && this.values[row][column]) {
52113
- var loc = this.values[row][column];
52114
- loc.text = "";
52115
- if (loc.isEmpty) {
52116
- delete this.values[row][column];
52117
- if (Object.keys(this.values[row]).length == 0) {
52118
- delete this.values[row];
52485
+ var res = this.locs[row][col];
52486
+ if (!res) {
52487
+ res = this.createString();
52488
+ res.setJson(this.getCellLocData(row, col));
52489
+ res.onGetTextCallback = function (str) {
52490
+ if (!str) {
52491
+ var column = itemvalue_ItemValue.getItemByValue(_this.columns, col);
52492
+ if (column) {
52493
+ return column.locText.getJson() || column.value;
52119
52494
  }
52120
52495
  }
52121
- }
52496
+ return str;
52497
+ };
52498
+ res.onStrChanged = function (oldValue, newValue) {
52499
+ _this.updateValues(row, col, newValue);
52500
+ };
52501
+ this.locs[row][col] = res;
52122
52502
  }
52123
- this.valuesChanged();
52503
+ return res;
52124
52504
  };
52125
- MatrixCells.prototype.setDefaultCellText = function (column, val) {
52126
- this.setCellText(settings.matrix.defaultRowName, column, val);
52505
+ Object.defineProperty(MatrixCells.prototype, "defaultRowValue", {
52506
+ get: function () { return settings.matrix.defaultRowName; },
52507
+ enumerable: false,
52508
+ configurable: true
52509
+ });
52510
+ MatrixCells.prototype.getCellLocData = function (row, col) {
52511
+ var data = this.getCellLocDataFromValue(row, col);
52512
+ if (data)
52513
+ return data;
52514
+ return this.getCellLocDataFromValue(this.defaultRowValue, col);
52127
52515
  };
52128
- MatrixCells.prototype.getCellLocText = function (row, column) {
52129
- row = this.getCellRowColumnValue(row, this.rows);
52130
- column = this.getCellRowColumnValue(column, this.columns);
52131
- if (!row || !column)
52132
- return null;
52516
+ MatrixCells.prototype.getCellLocDataFromValue = function (row, column) {
52133
52517
  if (!this.values[row])
52134
52518
  return null;
52135
52519
  if (!this.values[row][column])
52136
52520
  return null;
52137
52521
  return this.values[row][column];
52138
52522
  };
52139
- MatrixCells.prototype.getDefaultCellLocText = function (column, val) {
52140
- return this.getCellLocText(settings.matrix.defaultRowName, column);
52523
+ MatrixCells.prototype.getCellText = function (row, column) {
52524
+ var loc = this.getCellLocCore(row, column);
52525
+ return loc ? loc.calculatedText : null;
52141
52526
  };
52142
- MatrixCells.prototype.getCellDisplayLocText = function (row, column) {
52143
- var cellText = this.getCellLocText(row, column);
52144
- if (cellText && !cellText.isEmpty)
52145
- return cellText;
52146
- cellText = this.getCellLocText(settings.matrix.defaultRowName, column);
52147
- if (cellText && !cellText.isEmpty)
52148
- return cellText;
52149
- if (typeof column == "number") {
52150
- column =
52151
- column >= 0 && column < this.columns.length
52152
- ? this.columns[column]
52153
- : null;
52527
+ MatrixCells.prototype.setCellText = function (row, column, val) {
52528
+ var loc = this.getCellLocCore(row, column);
52529
+ if (loc) {
52530
+ loc.text = val;
52154
52531
  }
52155
- if (column && column.locText)
52156
- return column.locText;
52157
- return null;
52158
52532
  };
52159
- MatrixCells.prototype.getCellText = function (row, column) {
52160
- var loc = this.getCellLocText(row, column);
52161
- return loc ? loc.calculatedText : null;
52533
+ MatrixCells.prototype.updateValues = function (row, column, val) {
52534
+ if (val) {
52535
+ if (!this.values[row])
52536
+ this.values[row] = {};
52537
+ this.values[row][column] = val;
52538
+ this.valuesChanged();
52539
+ }
52540
+ else {
52541
+ if (this.values[row] && this.values[row][column]) {
52542
+ delete this.values[row][column];
52543
+ if (Object.keys(this.values[row]).length == 0) {
52544
+ delete this.values[row];
52545
+ }
52546
+ this.valuesChanged();
52547
+ }
52548
+ }
52162
52549
  };
52163
52550
  MatrixCells.prototype.getDefaultCellText = function (column) {
52164
- var loc = this.getCellLocText(settings.matrix.defaultRowName, column);
52551
+ var loc = this.getCellLocCore(this.defaultRowValue, column);
52165
52552
  return loc ? loc.calculatedText : null;
52166
52553
  };
52554
+ MatrixCells.prototype.setDefaultCellText = function (column, val) {
52555
+ this.setCellText(this.defaultRowValue, column, val);
52556
+ };
52167
52557
  MatrixCells.prototype.getCellDisplayText = function (row, column) {
52168
52558
  var loc = this.getCellDisplayLocText(row, column);
52169
52559
  return loc ? loc.calculatedText : null;
@@ -52197,18 +52587,22 @@ var question_matrix_MatrixCells = /** @class */ (function () {
52197
52587
  MatrixCells.prototype.getJson = function () {
52198
52588
  if (this.isEmpty)
52199
52589
  return null;
52590
+ var defaultRow = this.values[this.defaultRowValue];
52200
52591
  var res = {};
52201
52592
  for (var row in this.values) {
52202
52593
  var resRow = {};
52203
52594
  var rowValues = this.values[row];
52204
52595
  for (var col in rowValues) {
52205
- resRow[col] = rowValues[col].getJson();
52596
+ if (row === this.defaultRowValue || !defaultRow || defaultRow[col] !== rowValues[col]) {
52597
+ resRow[col] = rowValues[col];
52598
+ }
52206
52599
  }
52207
52600
  res[row] = resRow;
52208
52601
  }
52209
52602
  return res;
52210
52603
  };
52211
52604
  MatrixCells.prototype.setJson = function (value) {
52605
+ var _this = this;
52212
52606
  this.values = {};
52213
52607
  if (!!value) {
52214
52608
  for (var row in value) {
@@ -52219,21 +52613,23 @@ var question_matrix_MatrixCells = /** @class */ (function () {
52219
52613
  for (var col in rowValues) {
52220
52614
  if (col == "pos")
52221
52615
  continue;
52222
- var loc = this.createString();
52223
- loc.setJson(rowValues[col]);
52224
- this.values[row][col] = loc;
52616
+ this.values[row][col] = rowValues[col];
52225
52617
  }
52226
52618
  }
52227
52619
  }
52620
+ this.locNotification = true;
52621
+ this.runFuncOnLocs(function (row, col, loc) { return loc.setJson(_this.getCellLocData(row, col)); });
52622
+ this.locNotification = false;
52228
52623
  this.valuesChanged();
52229
52624
  };
52230
52625
  MatrixCells.prototype.locStrsChanged = function () {
52231
- if (this.isEmpty)
52232
- return;
52233
- for (var row in this.values) {
52234
- var rowValues = this.values[row];
52626
+ this.runFuncOnLocs(function (row, col, loc) { return loc.strChanged(); });
52627
+ };
52628
+ MatrixCells.prototype.runFuncOnLocs = function (func) {
52629
+ for (var row in this.locs) {
52630
+ var rowValues = this.locs[row];
52235
52631
  for (var col in rowValues) {
52236
- rowValues[col].strChanged();
52632
+ func(row, col, rowValues[col]);
52237
52633
  }
52238
52634
  }
52239
52635
  };
@@ -52241,7 +52637,7 @@ var question_matrix_MatrixCells = /** @class */ (function () {
52241
52637
  return new localizablestring_LocalizableString(this.cellsOwner, true);
52242
52638
  };
52243
52639
  return MatrixCells;
52244
- }());
52640
+ }(base_Base));
52245
52641
 
52246
52642
  /**
52247
52643
  * A class that describes the Single-Select Matrix question type.
@@ -53202,6 +53598,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
53202
53598
  _this.updateRemainingCharacterCounter(event.target.value);
53203
53599
  };
53204
53600
  _this.onKeyUp = function (event) {
53601
+ _this.updateDateValidationMessage(event);
53205
53602
  if (_this.isInputTextUpdate) {
53206
53603
  if (!_this._isWaitingForEnter || event.keyCode === 13) {
53207
53604
  _this.updateValueOnEvent(event);
@@ -53216,7 +53613,6 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
53216
53613
  _this.updateRemainingCharacterCounter(event.target.value);
53217
53614
  };
53218
53615
  _this.onKeyDown = function (event) {
53219
- _this.updateDateValidationMessage(event);
53220
53616
  _this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
53221
53617
  if (_this.isInputTextUpdate) {
53222
53618
  _this._isWaitingForEnter = event.keyCode === 229;
@@ -57924,6 +58320,11 @@ var question_ranking_QuestionRankingModel = /** @class */ (function (_super) {
57924
58320
  this.updateRankingChoices();
57925
58321
  this.releaseAnimations();
57926
58322
  };
58323
+ QuestionRankingModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
58324
+ _super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
58325
+ if (newValue)
58326
+ this.isValueSetByUser = true;
58327
+ };
57927
58328
  QuestionRankingModel.prototype.addToValueByVisibleChoices = function () {
57928
58329
  var newValue = this.value.slice();
57929
58330
  this.visibleChoices.forEach(function (choice) {
@@ -58474,7 +58875,6 @@ var question_comment_extends = (undefined && undefined.__extends) || (function (
58474
58875
 
58475
58876
 
58476
58877
 
58477
-
58478
58878
  /**
58479
58879
  * A class that describes the Long Text question type.
58480
58880
  *
@@ -58623,15 +59023,8 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
58623
59023
  QuestionCommentModel.prototype.afterRenderQuestionElement = function (el) {
58624
59024
  var root = settings.environment.root;
58625
59025
  this.element = root.getElementById(this.inputId) || el;
58626
- this.updateElement();
58627
59026
  _super.prototype.afterRenderQuestionElement.call(this, el);
58628
59027
  };
58629
- QuestionCommentModel.prototype.updateElement = function () {
58630
- var _this_1 = this;
58631
- if (this.element && this.renderedAutoGrow) {
58632
- setTimeout(function () { return increaseHeightByContent(_this_1.element); }, 1);
58633
- }
58634
- };
58635
59028
  QuestionCommentModel.prototype.beforeDestroyQuestionElement = function (el) {
58636
59029
  _super.prototype.beforeDestroyQuestionElement.call(this, el);
58637
59030
  this.element = undefined;
@@ -58639,8 +59032,6 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
58639
59032
  QuestionCommentModel.prototype.onInput = function (event) {
58640
59033
  if (this.isInputTextUpdate)
58641
59034
  this.value = event.target.value;
58642
- else
58643
- this.updateElement();
58644
59035
  this.updateRemainingCharacterCounter(event.target.value);
58645
59036
  };
58646
59037
  QuestionCommentModel.prototype.onBlurCore = function (event) {
@@ -58653,15 +59044,6 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
58653
59044
  event.stopPropagation();
58654
59045
  }
58655
59046
  };
58656
- QuestionCommentModel.prototype.setQuestionValue = function (newValue, updateIsAnswered) {
58657
- if (updateIsAnswered === void 0) { updateIsAnswered = true; }
58658
- _super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
58659
- this.updateElement();
58660
- };
58661
- QuestionCommentModel.prototype.onValueChanged = function () {
58662
- _super.prototype.onValueChanged.call(this);
58663
- this.updateElement();
58664
- };
58665
59047
  QuestionCommentModel.prototype.setNewValue = function (newValue) {
58666
59048
  if (!this.acceptCarriageReturn && !!newValue) {
58667
59049
  // eslint-disable-next-line no-control-regex
@@ -58939,6 +59321,7 @@ var question_file_decorate = (undefined && undefined.__decorate) || function (de
58939
59321
 
58940
59322
 
58941
59323
 
59324
+
58942
59325
  function dataUrl2File(dataUrl, fileName, type) {
58943
59326
  var str = atob(dataUrl.split(",")[1]);
58944
59327
  var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
@@ -59085,6 +59468,32 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
59085
59468
  *
59086
59469
  * [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
59087
59470
  */
59471
+ var question_file_QuestionFilePage = /** @class */ (function (_super) {
59472
+ question_file_extends(QuestionFilePage, _super);
59473
+ function QuestionFilePage(question, index) {
59474
+ var _this = _super.call(this) || this;
59475
+ _this.question = question;
59476
+ _this.index = index;
59477
+ _this.id = QuestionFilePage.getId();
59478
+ return _this;
59479
+ }
59480
+ QuestionFilePage.getId = function () {
59481
+ return "sv_sfp_" + QuestionFilePage.pageCounter++;
59482
+ };
59483
+ Object.defineProperty(QuestionFilePage.prototype, "css", {
59484
+ get: function () {
59485
+ return this.question.cssClasses.page;
59486
+ },
59487
+ enumerable: false,
59488
+ configurable: true
59489
+ });
59490
+ QuestionFilePage.pageCounter = 0;
59491
+ question_file_decorate([
59492
+ propertyArray({})
59493
+ ], QuestionFilePage.prototype, "items", void 0);
59494
+ return QuestionFilePage;
59495
+ }(base_Base));
59496
+
59088
59497
  var question_file_QuestionFileModel = /** @class */ (function (_super) {
59089
59498
  question_file_extends(QuestionFileModel, _super);
59090
59499
  function QuestionFileModel(name) {
@@ -59093,6 +59502,10 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59093
59502
  _this.fileNavigator = new container_ActionContainer();
59094
59503
  _this.canFlipCameraValue = undefined;
59095
59504
  _this.prevPreviewLength = 0;
59505
+ _this._renderedPages = [];
59506
+ _this.pagesAnimation = new AnimationTab(_this.getPagesAnimationOptions(), function (val) {
59507
+ _this._renderedPages = val;
59508
+ }, function () { return _this.renderedPages; });
59096
59509
  _this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
59097
59510
  var itemsCount = Math.floor(availableWidth / (itemWidth + gap));
59098
59511
  if ((itemsCount + 1) * (itemWidth + gap) - gap <= availableWidth)
@@ -59171,6 +59584,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59171
59584
  id: "prevPage",
59172
59585
  iconSize: 16,
59173
59586
  action: function () {
59587
+ _this.navigationDirection = "left";
59174
59588
  _this.indexToShow = _this.previewValue.length && ((_this.indexToShow - 1 + _this.pagesCount) % _this.pagesCount) || 0;
59175
59589
  _this.fileIndexAction.title = _this.getFileIndexCaption();
59176
59590
  }
@@ -59179,6 +59593,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59179
59593
  id: "nextPage",
59180
59594
  iconSize: 16,
59181
59595
  action: function () {
59596
+ _this.navigationDirection = "right";
59182
59597
  _this.indexToShow = _this.previewValue.length && ((_this.indexToShow + 1) % _this.pagesCount) || 0;
59183
59598
  _this.fileIndexAction.title = _this.getFileIndexCaption();
59184
59599
  }
@@ -59254,6 +59669,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59254
59669
  _this.fileNavigator.actions = [_this.prevFileAction, _this.fileIndexAction, _this.nextFileAction];
59255
59670
  return _this;
59256
59671
  }
59672
+ Object.defineProperty(QuestionFileModel.prototype, "supportFileNavigator", {
59673
+ get: function () {
59674
+ return this.isDefaultV2Theme;
59675
+ },
59676
+ enumerable: false,
59677
+ configurable: true
59678
+ });
59257
59679
  Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
59258
59680
  get: function () { return this.isFileLoadingValue; },
59259
59681
  set: function (val) {
@@ -59387,15 +59809,42 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59387
59809
  return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.pagesCount);
59388
59810
  };
59389
59811
  QuestionFileModel.prototype.updateFileNavigator = function () {
59812
+ this.updatePages();
59813
+ this.navigationDirection = undefined;
59390
59814
  this.indexToShow = this.previewValue.length && ((this.indexToShow + this.pagesCount) % this.pagesCount) || 0;
59391
59815
  this.fileIndexAction.title = this.getFileIndexCaption();
59392
59816
  };
59817
+ QuestionFileModel.prototype.updateRenderedPages = function () {
59818
+ if (this.pages && this.pages[this.indexToShow]) {
59819
+ this.renderedPages = [this.pages[this.indexToShow]];
59820
+ }
59821
+ };
59822
+ QuestionFileModel.prototype.updatePages = function () {
59823
+ var _this = this;
59824
+ this.blockAnimations();
59825
+ var currentPage;
59826
+ this.pages = [];
59827
+ this.renderedPages = [];
59828
+ this.previewValue.forEach(function (val, index) {
59829
+ if (index % _this.pageSize == 0) {
59830
+ currentPage = new question_file_QuestionFilePage(_this, _this.pages.length);
59831
+ _this.pages.push(currentPage);
59832
+ }
59833
+ currentPage.items.push(val);
59834
+ });
59835
+ this.releaseAnimations();
59836
+ this.updateRenderedPages();
59837
+ };
59393
59838
  QuestionFileModel.prototype.previewValueChanged = function () {
59394
59839
  var _this = this;
59840
+ this.navigationDirection = undefined;
59395
59841
  if (this.previewValue.length !== this.prevPreviewLength) {
59396
59842
  if (this.previewValue.length > 0) {
59397
59843
  if (this.prevPreviewLength > this.previewValue.length) {
59398
- this.indexToShow = this.indexToShow >= this.pagesCount && this.indexToShow > 0 ? this.pagesCount - 1 : this.indexToShow;
59844
+ if (this.indexToShow >= this.pagesCount && this.indexToShow > 0) {
59845
+ this.indexToShow = this.pagesCount - 1;
59846
+ this.navigationDirection = "left-delete";
59847
+ }
59399
59848
  }
59400
59849
  else {
59401
59850
  this.indexToShow = Math.floor(this.prevPreviewLength / this.pageSize);
@@ -59405,6 +59854,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59405
59854
  this.indexToShow = 0;
59406
59855
  }
59407
59856
  }
59857
+ this.updatePages();
59408
59858
  this.fileIndexAction.title = this.getFileIndexCaption();
59409
59859
  this.containsMultiplyFiles = this.previewValue.length > 1;
59410
59860
  if (this.previewValue.length > 0 && !this.calculatedGapBetweenItems && !this.calculatedItemWidth) {
@@ -59414,11 +59864,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59414
59864
  }
59415
59865
  this.prevPreviewLength = this.previewValue.length;
59416
59866
  };
59417
- QuestionFileModel.prototype.isPreviewVisible = function (index) {
59418
- var isFileNavigatorVisible = this.fileNavigatorVisible;
59419
- var isPreviewVisible = (this.indexToShow * this.pageSize <= index && index < (this.indexToShow + 1) * this.pageSize);
59420
- return !isFileNavigatorVisible || isPreviewVisible;
59421
- };
59422
59867
  QuestionFileModel.prototype.getType = function () {
59423
59868
  return "file";
59424
59869
  };
@@ -59864,6 +60309,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59864
60309
  content: content,
59865
60310
  });
59866
60311
  });
60312
+ this.previewValueChanged();
59867
60313
  }
59868
60314
  else {
59869
60315
  if (!!this._previewLoader) {
@@ -59883,7 +60329,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
59883
60329
  });
59884
60330
  this._previewLoader.load(newValues);
59885
60331
  }
59886
- this.previewValueChanged();
59887
60332
  };
59888
60333
  QuestionFileModel.prototype.getIsQuestionReady = function () {
59889
60334
  return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
@@ -60027,6 +60472,46 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
60027
60472
  QuestionFileModel.prototype.getFileListSelector = function () {
60028
60473
  return classesToSelector(this.cssClasses.fileList);
60029
60474
  };
60475
+ Object.defineProperty(QuestionFileModel.prototype, "renderedPages", {
60476
+ get: function () {
60477
+ return this._renderedPages;
60478
+ },
60479
+ set: function (val) {
60480
+ this.pagesAnimation.sync(val);
60481
+ },
60482
+ enumerable: false,
60483
+ configurable: true
60484
+ });
60485
+ QuestionFileModel.prototype.getPagesAnimationOptions = function () {
60486
+ var _this = this;
60487
+ return {
60488
+ getEnterOptions: function (page) {
60489
+ var pageClass = _this.cssClasses.page;
60490
+ return { cssClass: pageClass ? new CssClassBuilder()
60491
+ .append(pageClass + "--enter-from-left", _this.navigationDirection == "left" || _this.navigationDirection == "left-delete")
60492
+ .append(pageClass + "--enter-from-right", _this.navigationDirection == "right").toString() : ""
60493
+ };
60494
+ },
60495
+ getLeaveOptions: function (page) {
60496
+ var pageClass = _this.cssClasses.page;
60497
+ return {
60498
+ cssClass: pageClass ? new CssClassBuilder()
60499
+ .append(pageClass + "--leave-to-left", _this.navigationDirection == "right")
60500
+ .append(pageClass + "--leave-to-right", _this.navigationDirection == "left").toString() : ""
60501
+ };
60502
+ },
60503
+ getAnimatedElement: function (page) {
60504
+ var _a;
60505
+ return (_a = _this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelector("#" + page.id);
60506
+ },
60507
+ isAnimationEnabled: function () {
60508
+ return _this.animationAllowed && !!_this.rootElement;
60509
+ },
60510
+ getRerenderEvent: function () {
60511
+ return _this.onElementRerendered;
60512
+ }
60513
+ };
60514
+ };
60030
60515
  QuestionFileModel.prototype.triggerResponsiveness = function (hard) {
60031
60516
  if (hard) {
60032
60517
  this.calculatedGapBetweenItems = undefined;
@@ -60035,17 +60520,19 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
60035
60520
  _super.prototype.triggerResponsiveness.call(this);
60036
60521
  };
60037
60522
  QuestionFileModel.prototype.processResponsiveness = function (_, availableWidth) {
60038
- var _this = this;
60039
60523
  this._width = availableWidth;
60040
60524
  if (this.rootElement) {
60041
60525
  if ((!this.calculatedGapBetweenItems || !this.calculatedItemWidth) && this.allowMultiple) {
60042
60526
  var fileListSelector = this.getFileListSelector();
60043
60527
  var fileListElement = fileListSelector ? this.rootElement.querySelector(this.getFileListSelector()) : undefined;
60044
60528
  if (fileListElement) {
60045
- this.calculatedGapBetweenItems = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(fileListElement).gap));
60046
- var firstVisibleItem = Array.from(fileListElement.children).filter(function (_, index) { return _this.isPreviewVisible(index); })[0];
60047
- if (firstVisibleItem) {
60048
- this.calculatedItemWidth = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(firstVisibleItem).width));
60529
+ var visiblePage = fileListElement.querySelector(classesToSelector(this.cssClasses.page));
60530
+ if (visiblePage) {
60531
+ var firstVisibleItem = visiblePage.querySelector(classesToSelector(this.cssClasses.previewItem));
60532
+ this.calculatedGapBetweenItems = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(visiblePage).gap));
60533
+ if (firstVisibleItem) {
60534
+ this.calculatedItemWidth = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(firstVisibleItem).width));
60535
+ }
60049
60536
  }
60050
60537
  }
60051
60538
  }
@@ -60098,7 +60585,12 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
60098
60585
  propertyArray({})
60099
60586
  ], QuestionFileModel.prototype, "previewValue", void 0);
60100
60587
  question_file_decorate([
60101
- jsonobject_property({ defaultValue: 0 })
60588
+ propertyArray({})
60589
+ ], QuestionFileModel.prototype, "pages", void 0);
60590
+ question_file_decorate([
60591
+ jsonobject_property({ defaultValue: 0, onSet: function (val, target) {
60592
+ target.updateRenderedPages();
60593
+ } })
60102
60594
  ], QuestionFileModel.prototype, "indexToShow", void 0);
60103
60595
  question_file_decorate([
60104
60596
  jsonobject_property({
@@ -60162,6 +60654,9 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
60162
60654
  question_file_decorate([
60163
60655
  jsonobject_property()
60164
60656
  ], QuestionFileModel.prototype, "locRenderedPlaceholderValue", void 0);
60657
+ question_file_decorate([
60658
+ propertyArray()
60659
+ ], QuestionFileModel.prototype, "_renderedPages", void 0);
60165
60660
  return QuestionFileModel;
60166
60661
  }(question_file_QuestionFileModelBase));
60167
60662
 
@@ -60634,8 +61129,14 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60634
61129
  }
60635
61130
  _this.createRenderedRateItems();
60636
61131
  });
60637
- _this.createLocalizableString("minRateDescription", _this, true);
60638
- _this.createLocalizableString("maxRateDescription", _this, true);
61132
+ _this.createLocalizableString("minRateDescription", _this, true)
61133
+ .onStringChanged.add(function (sender, options) {
61134
+ _this.hasMinRateDescription = !sender.isEmpty;
61135
+ });
61136
+ _this.createLocalizableString("maxRateDescription", _this, true)
61137
+ .onStringChanged.add(function (sender, options) {
61138
+ _this.hasMaxRateDescription = !sender.isEmpty;
61139
+ });
60639
61140
  _this.initPropertyDependencies();
60640
61141
  return _this;
60641
61142
  }
@@ -60647,8 +61148,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60647
61148
  };
60648
61149
  QuestionRatingModel.prototype.endLoadingFromJson = function () {
60649
61150
  _super.prototype.endLoadingFromJson.call(this);
60650
- this.hasMinRateDescription = !!this.minRateDescription;
60651
- this.hasMaxRateDescription = !!this.maxRateDescription;
60652
61151
  if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
60653
61152
  this.updateRateMax();
60654
61153
  }
@@ -60906,6 +61405,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60906
61405
  }
60907
61406
  if (this.rateType == "smileys" && rateValues.length > 10)
60908
61407
  rateValues = rateValues.slice(0, 10);
61408
+ this.visibleChoicesValue = rateValues.map(function (i, idx) { return _this.getRatingItemValue(i, idx); });
60909
61409
  this.renderedRateItems = rateValues.map(function (v, i) {
60910
61410
  var renderedItem = null;
60911
61411
  if (_this.displayRateDescriptionsAsExtremeItems) {
@@ -60925,14 +61425,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60925
61425
  var step = this.rateStep;
60926
61426
  while (value <= this.rateMax &&
60927
61427
  res.length < settings.ratingMaximumRateValueCount) {
60928
- var description = void 0;
60929
- if (value === this.rateMin) {
60930
- description = this.minRateDescription && this.locMinRateDescription;
60931
- }
60932
- if (value === this.rateMax || res.length === settings.ratingMaximumRateValueCount) {
60933
- description = this.maxRateDescription && this.locMaxRateDescription;
60934
- }
60935
- var item = new RatingItemValue(value, description);
61428
+ var item = new itemvalue_ItemValue(value);
60936
61429
  item.locOwner = this;
60937
61430
  item.ownerPropertyName = "rateValues";
60938
61431
  res.push(item);
@@ -60940,6 +61433,22 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60940
61433
  }
60941
61434
  return res;
60942
61435
  };
61436
+ QuestionRatingModel.prototype.getRatingItemValue = function (item, index) {
61437
+ if (!item)
61438
+ return null;
61439
+ var value = item.value;
61440
+ var description;
61441
+ if (value === this.rateMin) {
61442
+ description = this.minRateDescription && this.locMinRateDescription;
61443
+ }
61444
+ if (value === this.rateMax || index === settings.ratingMaximumRateValueCount) {
61445
+ description = this.maxRateDescription && this.locMaxRateDescription;
61446
+ }
61447
+ var newItem = new RatingItemValue(value, description);
61448
+ newItem.locOwner = item.locOwner;
61449
+ newItem.ownerPropertyName = item.ownerPropertyName;
61450
+ return newItem;
61451
+ };
60943
61452
  QuestionRatingModel.prototype.correctValue = function (value, step) {
60944
61453
  if (!value)
60945
61454
  return value;
@@ -60994,7 +61503,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
60994
61503
  },
60995
61504
  set: function (val) {
60996
61505
  this.setLocalizableStringText("minRateDescription", val);
60997
- this.hasMinRateDescription = !!this.minRateDescription;
60998
61506
  },
60999
61507
  enumerable: false,
61000
61508
  configurable: true
@@ -61019,7 +61527,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61019
61527
  },
61020
61528
  set: function (val) {
61021
61529
  this.setLocalizableStringText("maxRateDescription", val);
61022
- this.hasMaxRateDescription = !!this.maxRateDescription;
61023
61530
  },
61024
61531
  enumerable: false,
61025
61532
  configurable: true
@@ -61387,7 +61894,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61387
61894
  };
61388
61895
  Object.defineProperty(QuestionRatingModel.prototype, "visibleChoices", {
61389
61896
  get: function () {
61390
- return this.visibleRateValues;
61897
+ return this.visibleChoicesValue;
61391
61898
  },
61392
61899
  enumerable: false,
61393
61900
  configurable: true
@@ -61439,6 +61946,11 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61439
61946
  enumerable: false,
61440
61947
  configurable: true
61441
61948
  });
61949
+ QuestionRatingModel.prototype.onBlurCore = function (event) {
61950
+ var _a;
61951
+ (_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.onBlur(event);
61952
+ _super.prototype.onBlurCore.call(this, event);
61953
+ };
61442
61954
  QuestionRatingModel.prototype.updateCssClasses = function (res, css) {
61443
61955
  _super.prototype.updateCssClasses.call(this, res, css);
61444
61956
  if (!!this.dropdownListModel) {
@@ -64458,6 +64970,8 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
64458
64970
  _this.updateFooterActions();
64459
64971
  });
64460
64972
  _this.registerPropertyChangedHandlers(["allowAddPanel"], function () { _this.updateNoEntriesTextDefaultLoc(); });
64973
+ _this.registerPropertyChangedHandlers(["minPanelCount"], function () { _this.onMinPanelCountChanged(); });
64974
+ _this.registerPropertyChangedHandlers(["maxPanelCount"], function () { _this.onMaxPanelCountChanged(); });
64461
64975
  return _this;
64462
64976
  }
64463
64977
  Object.defineProperty(QuestionPanelDynamicModel.prototype, "isCompositeQuestion", {
@@ -65421,17 +65935,18 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
65421
65935
  set: function (val) {
65422
65936
  if (val < 0)
65423
65937
  val = 0;
65424
- if (val == this.minPanelCount)
65425
- return;
65426
65938
  this.setPropertyValue("minPanelCount", val);
65427
- if (val > this.maxPanelCount)
65428
- this.maxPanelCount = val;
65429
- if (this.panelCount < val)
65430
- this.panelCount = val;
65431
65939
  },
65432
65940
  enumerable: false,
65433
65941
  configurable: true
65434
65942
  });
65943
+ QuestionPanelDynamicModel.prototype.onMinPanelCountChanged = function () {
65944
+ var val = this.minPanelCount;
65945
+ if (val > this.maxPanelCount)
65946
+ this.maxPanelCount = val;
65947
+ if (this.panelCount < val)
65948
+ this.panelCount = val;
65949
+ };
65435
65950
  Object.defineProperty(QuestionPanelDynamicModel.prototype, "maxPanelCount", {
65436
65951
  /**
65437
65952
  * A maximum number of panels in Dynamic Panel. Users cannot add new panels if `panelCount` equals `maxPanelCount`.
@@ -65449,17 +65964,20 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
65449
65964
  return;
65450
65965
  if (val > settings.panel.maxPanelCount)
65451
65966
  val = settings.panel.maxPanelCount;
65452
- if (val == this.maxPanelCount)
65453
- return;
65454
65967
  this.setPropertyValue("maxPanelCount", val);
65455
- if (val < this.minPanelCount)
65456
- this.minPanelCount = val;
65457
- if (this.panelCount > val)
65458
- this.panelCount = val;
65968
+ this.updateFooterActions();
65459
65969
  },
65460
65970
  enumerable: false,
65461
65971
  configurable: true
65462
65972
  });
65973
+ QuestionPanelDynamicModel.prototype.onMaxPanelCountChanged = function () {
65974
+ var val = this.maxPanelCount;
65975
+ if (val < this.minPanelCount)
65976
+ this.minPanelCount = val;
65977
+ if (this.panelCount > val)
65978
+ this.panelCount = val;
65979
+ this.updateFooterActions();
65980
+ };
65463
65981
  Object.defineProperty(QuestionPanelDynamicModel.prototype, "allowAddPanel", {
65464
65982
  /**
65465
65983
  * Specifies whether users are allowed to add new panels.
@@ -66207,6 +66725,12 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
66207
66725
  QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
66208
66726
  this.template.readOnly = this.isReadOnly;
66209
66727
  this.template.onSurveyLoad();
66728
+ if (this.panelCount < this.minPanelCount) {
66729
+ this.panelCount = this.minPanelCount;
66730
+ }
66731
+ if (this.panelCount > this.maxPanelCount) {
66732
+ this.panelCount = this.maxPanelCount;
66733
+ }
66210
66734
  this.buildPanelsFirstTime();
66211
66735
  _super.prototype.onSurveyLoad.call(this);
66212
66736
  };
@@ -70119,8 +70643,8 @@ Serializer.addClass("currencymask", [
70119
70643
 
70120
70644
  var Version;
70121
70645
  var ReleaseDate;
70122
- Version = "" + "1.12.3";
70123
- ReleaseDate = "" + "2024-09-24";
70646
+ Version = "" + "1.12.5";
70647
+ ReleaseDate = "" + "2024-10-07";
70124
70648
  function checkLibraryVersion(ver, libraryName) {
70125
70649
  if (Version != ver) {
70126
70650
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -72722,7 +73246,6 @@ function setStyles() {
72722
73246
  ".sv-popup--modal .sv-popup__body-content": "padding: calc(4 * var(--base-unit, 8px));",
72723
73247
  ".sv-popup--overlay": "width: 100%;",
72724
73248
  ".sv-popup--overlay .sv-popup__container": "background: rgba(144, 144, 144, 0.5); max-width: 100vw; max-height: calc(100vh - 1 * var(--base-unit, 8px)); height: calc(100vh - 1 * var(--base-unit, 8px)); width: 100%; padding-top: calc(2 * var(--base-unit, 8px)); border: unset;",
72725
- ".sv-popup__shadow": "width: 100%; height: 100%; border-radius: calc(1 * var(--base-unit, 8px));",
72726
73249
  ".sv-popup--overlay .sv-popup__body-content": "border-radius: calc(2 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) 0px 0px; background: var(--background, #fff); box-shadow: 0px calc(1 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) rgba(0, 0, 0, 0.1); padding: calc(3 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)); height: calc(100% - calc(1 * var(--base-unit, 8px))); max-height: 100vh; max-width: 100vw;",
72727
73250
  ".sv-popup--overlay .sv-popup__scrolling-content": "height: calc(100% - (10 * var(--base-unit, 8px)));",
72728
73251
  ".sv-popup--overlay .sv-popup__body-footer": "margin-top: calc(2 * var(--base-unit, 8px));",
@@ -80102,7 +80625,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
80102
80625
  SurveyElementBase.prototype.makeBaseElementsReact = function () {
80103
80626
  var els = this.getStateElements();
80104
80627
  for (var i = 0; i < els.length; i++) {
80105
- els[i].enableOnElementRenderedEvent();
80628
+ els[i].enableOnElementRerenderedEvent();
80106
80629
  this.makeBaseElementReact(els[i]);
80107
80630
  }
80108
80631
  };
@@ -80114,7 +80637,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
80114
80637
  };
80115
80638
  SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
80116
80639
  els.forEach(function (el) {
80117
- el.disableOnElementRenderedEvent();
80640
+ el.disableOnElementRerenderedEvent();
80118
80641
  });
80119
80642
  };
80120
80643
  SurveyElementBase.prototype.getStateElements = function () {
@@ -80701,7 +81224,7 @@ var panel_base_SurveyPanelBase = /** @class */ (function (_super) {
80701
81224
  var el = this.rootRef.current;
80702
81225
  if (el && this.survey) {
80703
81226
  if (this.panelBase.isPanel) {
80704
- this.survey.afterRenderPanel(this.panelBase, el);
81227
+ this.panelBase.afterRender(el);
80705
81228
  }
80706
81229
  else {
80707
81230
  this.survey.afterRenderPage(el);
@@ -81045,12 +81568,11 @@ var popup_PopupContainer = /** @class */ (function (_super) {
81045
81568
  }, onClick: function (ev) {
81046
81569
  _this.clickInside(ev);
81047
81570
  } },
81048
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__shadow" },
81049
- headerPopup,
81050
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__body-content" },
81051
- headerContent,
81052
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__scrolling-content" }, content),
81053
- footerContent))));
81571
+ headerPopup,
81572
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__body-content" },
81573
+ headerContent,
81574
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__scrolling-content" }, content),
81575
+ footerContent)));
81054
81576
  };
81055
81577
  PopupContainer.prototype.renderHeaderContent = function () {
81056
81578
  return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__body-header" }, this.model.title);
@@ -84930,6 +85452,120 @@ ReactQuestionFactory.Instance.registerQuestion("file", function (props) {
84930
85452
  return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](reactquestion_file_SurveyQuestionFile, props);
84931
85453
  });
84932
85454
 
85455
+ // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-item.tsx
85456
+ var file_item_extends = (undefined && undefined.__extends) || (function () {
85457
+ var extendStatics = function (d, b) {
85458
+ extendStatics = Object.setPrototypeOf ||
85459
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
85460
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
85461
+ return extendStatics(d, b);
85462
+ };
85463
+ return function (d, b) {
85464
+ if (typeof b !== "function" && b !== null)
85465
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
85466
+ extendStatics(d, b);
85467
+ function __() { this.constructor = d; }
85468
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
85469
+ };
85470
+ })();
85471
+
85472
+
85473
+
85474
+ var file_item_SurveyFileItem = /** @class */ (function (_super) {
85475
+ file_item_extends(SurveyFileItem, _super);
85476
+ function SurveyFileItem() {
85477
+ return _super !== null && _super.apply(this, arguments) || this;
85478
+ }
85479
+ Object.defineProperty(SurveyFileItem.prototype, "question", {
85480
+ get: function () {
85481
+ return this.props.question;
85482
+ },
85483
+ enumerable: false,
85484
+ configurable: true
85485
+ });
85486
+ Object.defineProperty(SurveyFileItem.prototype, "item", {
85487
+ get: function () {
85488
+ return this.props.item;
85489
+ },
85490
+ enumerable: false,
85491
+ configurable: true
85492
+ });
85493
+ SurveyFileItem.prototype.renderFileSign = function (className, val) {
85494
+ var _this = this;
85495
+ if (!className || !val.name)
85496
+ return null;
85497
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: className },
85498
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("a", { href: val.content, onClick: function (event) {
85499
+ _this.question.doDownloadFile(event, val);
85500
+ }, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
85501
+ };
85502
+ SurveyFileItem.prototype.renderElement = function () {
85503
+ var _this = this;
85504
+ var val = this.item;
85505
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.previewItem, onClick: function (event) { return _this.question.doDownloadFileFromContainer(event); } },
85506
+ this.renderFileSign(this.question.cssClasses.fileSign, val),
85507
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.getImageWrapperCss(val) },
85508
+ this.question.canPreviewImage(val) ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { src: val.content, style: { height: this.question.imageHeight, width: this.question.imageWidth }, alt: "File preview" })) : (this.question.cssClasses.defaultImage ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { iconName: this.question.cssClasses.defaultImageIconId, size: "auto", className: this.question.cssClasses.defaultImage })) : null),
85509
+ val.name && !this.question.isReadOnly ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: function (event) { return _this.question.doRemoveFile(val, event); } },
85510
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
85511
+ (this.question.cssClasses.removeFileSvgIconId) ?
85512
+ (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
85513
+ this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
85514
+ };
85515
+ SurveyFileItem.prototype.canRender = function () {
85516
+ return this.question.showPreviewContainer;
85517
+ };
85518
+ return SurveyFileItem;
85519
+ }(reactquestion_element_SurveyElementBase));
85520
+
85521
+
85522
+ // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-page.tsx
85523
+ var file_page_extends = (undefined && undefined.__extends) || (function () {
85524
+ var extendStatics = function (d, b) {
85525
+ extendStatics = Object.setPrototypeOf ||
85526
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
85527
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
85528
+ return extendStatics(d, b);
85529
+ };
85530
+ return function (d, b) {
85531
+ if (typeof b !== "function" && b !== null)
85532
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
85533
+ extendStatics(d, b);
85534
+ function __() { this.constructor = d; }
85535
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
85536
+ };
85537
+ })();
85538
+
85539
+
85540
+
85541
+ var file_page_SurveyFilePage = /** @class */ (function (_super) {
85542
+ file_page_extends(SurveyFilePage, _super);
85543
+ function SurveyFilePage() {
85544
+ return _super !== null && _super.apply(this, arguments) || this;
85545
+ }
85546
+ Object.defineProperty(SurveyFilePage.prototype, "question", {
85547
+ get: function () {
85548
+ return this.props.question;
85549
+ },
85550
+ enumerable: false,
85551
+ configurable: true
85552
+ });
85553
+ Object.defineProperty(SurveyFilePage.prototype, "page", {
85554
+ get: function () {
85555
+ return this.props.page;
85556
+ },
85557
+ enumerable: false,
85558
+ configurable: true
85559
+ });
85560
+ SurveyFilePage.prototype.renderElement = function () {
85561
+ var _this = this;
85562
+ var items = this.page.items.map(function (item, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_item_SurveyFileItem, { item: item, question: _this.question, key: index })); });
85563
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.page.css, id: this.page.id }, items));
85564
+ };
85565
+ return SurveyFilePage;
85566
+ }(reactquestion_element_SurveyElementBase));
85567
+
85568
+
84933
85569
  // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-preview.tsx
84934
85570
  var file_preview_extends = (undefined && undefined.__extends) || (function () {
84935
85571
  var extendStatics = function (d, b) {
@@ -84950,6 +85586,7 @@ var file_preview_extends = (undefined && undefined.__extends) || (function () {
84950
85586
 
84951
85587
 
84952
85588
 
85589
+
84953
85590
  var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
84954
85591
  file_preview_extends(SurveyFilePreview, _super);
84955
85592
  function SurveyFilePreview() {
@@ -84973,20 +85610,9 @@ var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
84973
85610
  };
84974
85611
  SurveyFilePreview.prototype.renderElement = function () {
84975
85612
  var _this = this;
84976
- var previews = this.question.previewValue.map(function (val, index) {
84977
- if (!val)
84978
- return null;
84979
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { key: _this.question.inputId + "_" + index, className: _this.question.cssClasses.previewItem, onClick: function (event) { return _this.question.doDownloadFileFromContainer(event); }, style: { display: _this.question.isPreviewVisible(index) ? undefined : "none" } },
84980
- _this.renderFileSign(_this.question.cssClasses.fileSign, val),
84981
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: _this.question.getImageWrapperCss(val) },
84982
- _this.question.canPreviewImage(val) ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { src: val.content, style: { height: _this.question.imageHeight, width: _this.question.imageWidth }, alt: "File preview" })) : (_this.question.cssClasses.defaultImage ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { iconName: _this.question.cssClasses.defaultImageIconId, size: "auto", className: _this.question.cssClasses.defaultImage })) : null),
84983
- val.name && !_this.question.isReadOnly ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: _this.question.getRemoveButtonCss(), onClick: function (event) { return _this.question.doRemoveFile(val, event); } },
84984
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: _this.question.cssClasses.removeFile }, _this.question.removeFileCaption),
84985
- (_this.question.cssClasses.removeFileSvgIconId) ?
84986
- (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { title: _this.question.removeFileCaption, iconName: _this.question.cssClasses.removeFileSvgIconId, size: "auto", className: _this.question.cssClasses.removeFileSvg })) : null)) : null),
84987
- _this.renderFileSign(_this.question.cssClasses.fileSignBottom, val)));
84988
- });
84989
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, previews);
85613
+ var content = this.question.supportFileNavigator ? this.question.renderedPages.map(function (page, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_page_SurveyFilePage, { page: page, question: _this.question, key: page.id })); })
85614
+ : this.question.previewValue.map(function (item, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_item_SurveyFileItem, { item: item, question: _this.question, key: index })); });
85615
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, content);
84990
85616
  };
84991
85617
  SurveyFilePreview.prototype.canRender = function () {
84992
85618
  return this.question.showPreviewContainer;
@@ -88568,8 +89194,8 @@ var skeleton_Skeleton = /** @class */ (function (_super) {
88568
89194
  return _super !== null && _super.apply(this, arguments) || this;
88569
89195
  }
88570
89196
  Skeleton.prototype.render = function () {
88571
- var _a;
88572
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.id }));
89197
+ var _a, _b;
89198
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.id, style: { height: (_b = this.props.element) === null || _b === void 0 ? void 0 : _b.skeletonHeight } }));
88573
89199
  };
88574
89200
  return Skeleton;
88575
89201
  }(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Component));