survey-react 1.12.15 → 1.12.16-patch.1

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.15
2
+ * surveyjs - Survey JavaScript library v1.12.16-patch.1
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
  */
@@ -1705,7 +1705,7 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
1705
1705
  /*!********************************************!*\
1706
1706
  !*** ./src/entries/react.ts + 287 modules ***!
1707
1707
  \********************************************/
1708
- /*! 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, getLocaleString, setupLocale, 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, renamedIcons, getIconNameFromProxy, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgThemeSets, addIconsToThemeSet, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, activateLazyRenderingChecks, 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, PopupModal */
1708
+ /*! 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, getLocaleString, getLocaleStrings, setupLocale, 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, renamedIcons, getIconNameFromProxy, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgThemeSets, addIconsToThemeSet, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, activateLazyRenderingChecks, 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, PopupModal */
1709
1709
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} (<- Module is not an ECMAScript module) */
1710
1710
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom"} (<- Module is not an ECMAScript module) */
1711
1711
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -1869,6 +1869,7 @@ __webpack_require__.d(__webpack_exports__, "englishStrings", function() { return
1869
1869
  __webpack_require__.d(__webpack_exports__, "surveyLocalization", function() { return /* reexport */ surveyLocalization; });
1870
1870
  __webpack_require__.d(__webpack_exports__, "surveyStrings", function() { return /* reexport */ surveyStrings; });
1871
1871
  __webpack_require__.d(__webpack_exports__, "getLocaleString", function() { return /* reexport */ getLocaleString; });
1872
+ __webpack_require__.d(__webpack_exports__, "getLocaleStrings", function() { return /* reexport */ getLocaleStrings; });
1872
1873
  __webpack_require__.d(__webpack_exports__, "setupLocale", function() { return /* reexport */ setupLocale; });
1873
1874
  __webpack_require__.d(__webpack_exports__, "QuestionCustomWidget", function() { return /* reexport */ QuestionCustomWidget; });
1874
1875
  __webpack_require__.d(__webpack_exports__, "CustomWidgetCollection", function() { return /* reexport */ questionCustomWidgets_CustomWidgetCollection; });
@@ -2960,6 +2961,9 @@ function getLocaleString(strName, locale) {
2960
2961
  if (locale === void 0) { locale = null; }
2961
2962
  return surveyLocalization.getString(strName, locale);
2962
2963
  }
2964
+ function getLocaleStrings(locale) {
2965
+ return surveyLocalization.getLocaleStrings(locale);
2966
+ }
2963
2967
  function setupLocale(localeConfig) {
2964
2968
  surveyLocalization.setupLocale(localeConfig);
2965
2969
  }
@@ -13671,7 +13675,13 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13671
13675
  Object.defineProperty(SurveyElementCore.prototype, "isPage", {
13672
13676
  /**
13673
13677
  * Returns `true` if the survey element is a page.
13674
- * @see Base.getType
13678
+ *
13679
+ * This property returns `false` for [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model) objects in the following cases:
13680
+ *
13681
+ * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `"singlePage"`.
13682
+ * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).
13683
+ *
13684
+ * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and all regular pages become panels.
13675
13685
  */
13676
13686
  get: function () { return false; },
13677
13687
  enumerable: false,
@@ -13679,8 +13689,14 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13679
13689
  });
13680
13690
  Object.defineProperty(SurveyElementCore.prototype, "isPanel", {
13681
13691
  /**
13682
- * Returns `true` if the survey element is a panel.
13683
- * @see Base.getType
13692
+ * Returns `true` if the survey element is a panel or acts as one.
13693
+ *
13694
+ * This property returns `true` for `PageModel` objects in the following cases:
13695
+ *
13696
+ * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `"singlePage"`.
13697
+ * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).
13698
+ *
13699
+ * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and all regular pages become panels.
13684
13700
  */
13685
13701
  get: function () { return false; },
13686
13702
  enumerable: false,
@@ -13689,7 +13705,6 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13689
13705
  Object.defineProperty(SurveyElementCore.prototype, "isQuestion", {
13690
13706
  /**
13691
13707
  * Returns `true` if the survey element is a question.
13692
- * @see Base.getType
13693
13708
  */
13694
13709
  get: function () { return false; },
13695
13710
  enumerable: false,
@@ -13698,7 +13713,6 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13698
13713
  Object.defineProperty(SurveyElementCore.prototype, "isSurvey", {
13699
13714
  /**
13700
13715
  * Returns `true` if the element is a survey.
13701
- * @see Base.getType
13702
13716
  */
13703
13717
  get: function () { return false; },
13704
13718
  enumerable: false,
@@ -14713,7 +14727,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14713
14727
  SurveyElement.prototype.getPage = function (parent) {
14714
14728
  while (parent && parent.parent)
14715
14729
  parent = parent.parent;
14716
- if (parent && parent.getType() == "page")
14730
+ if (parent && parent.isPage)
14717
14731
  return parent;
14718
14732
  return null;
14719
14733
  };
@@ -14765,7 +14779,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14765
14779
  });
14766
14780
  Object.defineProperty(SurveyElement.prototype, "hasParent", {
14767
14781
  get: function () {
14768
- return (this.parent && !this.parent.isPage && (!this.parent.originalPage)) || (this.parent === undefined);
14782
+ return (this.parent && !this.parent.isPage) || (this.parent === undefined);
14769
14783
  },
14770
14784
  enumerable: false,
14771
14785
  configurable: true
@@ -15025,6 +15039,8 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
15025
15039
  return null;
15026
15040
  };
15027
15041
  SurveyElement.prototype.getCssTitle = function (cssClasses) {
15042
+ if (!cssClasses)
15043
+ return "";
15028
15044
  var isExpandable = this.state !== "default";
15029
15045
  var numInlineLimit = 4;
15030
15046
  return new CssClassBuilder()
@@ -15924,18 +15940,18 @@ function confirmAction(message) {
15924
15940
  return settings.confirmActionFunc(message);
15925
15941
  return confirm(message);
15926
15942
  }
15927
- function confirmActionAsync(message, funcOnYes, funcOnNo, locale, rootElement) {
15943
+ function confirmActionAsync(options) {
15928
15944
  var callbackFunc = function (res) {
15929
15945
  if (res)
15930
- funcOnYes();
15931
- else if (!!funcOnNo)
15932
- funcOnNo();
15946
+ options.funcOnYes();
15947
+ else if (!!options.funcOnNo)
15948
+ options.funcOnNo();
15933
15949
  };
15934
15950
  if (!!settings && !!settings.confirmActionAsync) {
15935
- if (settings.confirmActionAsync(message, callbackFunc, undefined, locale, rootElement))
15951
+ if (settings.confirmActionAsync(options.message, callbackFunc, options))
15936
15952
  return;
15937
15953
  }
15938
- callbackFunc(confirmAction(message));
15954
+ callbackFunc(confirmAction(options.message));
15939
15955
  }
15940
15956
  function detectIEBrowser() {
15941
15957
  var ua = navigator.userAgent;
@@ -16471,7 +16487,7 @@ var Logger = /** @class */ (function () {
16471
16487
  return Logger;
16472
16488
  }());
16473
16489
 
16474
- function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
16490
+ function showConfirmDialog(message, callback, options) {
16475
16491
  var locStr = new localizablestring_LocalizableString(undefined);
16476
16492
  var popupViewModel = settings.showDialog({
16477
16493
  componentName: "sv-string-viewer",
@@ -16484,17 +16500,17 @@ function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
16484
16500
  callback(false);
16485
16501
  return false;
16486
16502
  },
16487
- title: message,
16503
+ title: message || options.message,
16488
16504
  displayMode: "popup",
16489
16505
  isFocusedContent: false,
16490
- cssClass: "sv-popup--confirm-delete"
16491
- }, rootElement);
16506
+ cssClass: options.cssClass || "sv-popup--confirm"
16507
+ }, options.rootElement);
16492
16508
  var toolbar = popupViewModel.footerToolbar;
16493
16509
  var applyBtn = toolbar.getActionById("apply");
16494
16510
  var cancelBtn = toolbar.getActionById("cancel");
16495
- cancelBtn.title = getLocaleString("cancel", locale);
16511
+ cancelBtn.title = getLocaleString("cancel", options.locale);
16496
16512
  cancelBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sd-btn sd-btn--small";
16497
- applyBtn.title = applyTitle || getLocaleString("ok", locale);
16513
+ applyBtn.title = options.applyTitle || getLocaleString("ok", options.locale);
16498
16514
  applyBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sv-popup__button--danger sd-btn sd-btn--small sd-btn--danger";
16499
16515
  configConfirmDialog(popupViewModel);
16500
16516
  return true;
@@ -17111,8 +17127,8 @@ var settings = {
17111
17127
  * @param message A message to be displayed in the confirm dialog window.
17112
17128
  * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.
17113
17129
  */
17114
- confirmActionAsync: function (message, callback, applyTitle, locale, rootElement) {
17115
- return showConfirmDialog(message, callback, applyTitle, locale, rootElement);
17130
+ confirmActionAsync: function (message, callback, options) {
17131
+ return showConfirmDialog(message, callback, options);
17116
17132
  },
17117
17133
  /**
17118
17134
  * A minimum width value for all survey elements.
@@ -33526,10 +33542,16 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
33526
33542
  confirmDelete = this.isRequireConfirmOnRowDelete(index);
33527
33543
  }
33528
33544
  if (confirmDelete) {
33529
- confirmActionAsync(this.confirmDeleteText, function () {
33530
- _this.removeRowAsync(index, row);
33531
- onRowRemoved && onRowRemoved();
33532
- }, undefined, this.getLocale(), this.survey.rootElement);
33545
+ confirmActionAsync({
33546
+ message: this.confirmDeleteText,
33547
+ funcOnYes: function () {
33548
+ _this.removeRowAsync(index, row);
33549
+ onRowRemoved && onRowRemoved();
33550
+ },
33551
+ locale: this.getLocale(),
33552
+ rootElement: this.survey.rootElement,
33553
+ cssClass: this.cssClasses.confirmDialog
33554
+ });
33533
33555
  return;
33534
33556
  }
33535
33557
  this.removeRowAsync(index, row);
@@ -34255,7 +34277,8 @@ var defaultV2Css = {
34255
34277
  noPointerEventsMode: "sd-question--no-pointer-events",
34256
34278
  errorsContainer: "sd-element__erbox sd-question__erbox",
34257
34279
  errorsContainerTop: "sd-element__erbox--above-element sd-question__erbox--above-question",
34258
- errorsContainerBottom: "sd-question__erbox--below-question"
34280
+ errorsContainerBottom: "sd-question__erbox--below-question",
34281
+ confirmDialog: "sd-popup--confirm sv-popup--confirm"
34259
34282
  },
34260
34283
  image: {
34261
34284
  mainRoot: "sd-question sd-question--image",
@@ -36188,7 +36211,6 @@ var panel_spreadArray = (undefined && undefined.__spreadArray) || function (to,
36188
36211
 
36189
36212
 
36190
36213
 
36191
-
36192
36214
  var panel_QuestionRowModel = /** @class */ (function (_super) {
36193
36215
  panel_extends(QuestionRowModel, _super);
36194
36216
  function QuestionRowModel(panel) {
@@ -36791,9 +36813,14 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36791
36813
  });
36792
36814
  Object.defineProperty(PanelModelBase.prototype, "parent", {
36793
36815
  /**
36794
- * Returns a survey element (panel or page) that contains this panel and allows you to move this question to a different survey element.
36816
+ * Returns a survey element (panel or page) that contains this panel and allows you to move the panel to a different survey element.
36817
+ *
36818
+ * For `PageModel` objects, the `parent` property is `null`, except in the following cases:
36795
36819
  *
36796
- * This property is always `null` for the `PageModel` object.
36820
+ * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `"singlePage"`.
36821
+ * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).
36822
+ *
36823
+ * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and the `parent` property contains this object.
36797
36824
  */
36798
36825
  get: function () {
36799
36826
  return this.getPropertyValue("parent", null);
@@ -36876,10 +36903,6 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36876
36903
  configurable: true
36877
36904
  });
36878
36905
  Object.defineProperty(PanelModelBase.prototype, "isPanel", {
36879
- /**
36880
- * Returns `true` if the survey element is a panel.
36881
- * @see Base.getType
36882
- */
36883
36906
  get: function () {
36884
36907
  return false;
36885
36908
  },
@@ -37621,11 +37644,11 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37621
37644
  PanelModelBase.prototype.updateRows = function () {
37622
37645
  if (this.isLoadingFromJson)
37623
37646
  return;
37624
- for (var i = 0; i < this.elements.length; i++) {
37625
- if (this.elements[i].isPanel) {
37626
- this.elements[i].updateRows();
37647
+ this.getElementsForRows().forEach(function (el) {
37648
+ if (el.isPanel) {
37649
+ el.updateRows();
37627
37650
  }
37628
- }
37651
+ });
37629
37652
  this.onRowsChanged();
37630
37653
  };
37631
37654
  Object.defineProperty(PanelModelBase.prototype, "rows", {
@@ -37734,7 +37757,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37734
37757
  var _this = this;
37735
37758
  var survey = this.survey;
37736
37759
  var fireNotification = this.canFireAddRemoveNotifications(element);
37737
- element.setSurveyImpl(this.surveyImpl);
37760
+ if (!!this.surveyImpl) {
37761
+ element.setSurveyImpl(this.surveyImpl);
37762
+ }
37738
37763
  element.parent = this;
37739
37764
  this.markQuestionListDirty();
37740
37765
  if (this.canBuildRows()) {
@@ -37760,8 +37785,8 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37760
37785
  };
37761
37786
  PanelModelBase.prototype.onRemoveElement = function (element) {
37762
37787
  element.parent = null;
37788
+ this.unregisterElementPropertiesChanged(element);
37763
37789
  this.markQuestionListDirty();
37764
- element.unregisterPropertyChangedHandlers(["visible", "isVisible", "startWithNewLine"], this.id);
37765
37790
  this.updateRowsOnElementRemoved(element);
37766
37791
  if (this.isRandomizing)
37767
37792
  return;
@@ -37770,6 +37795,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37770
37795
  this.removeElementCallback(element);
37771
37796
  this.onElementVisibilityChanged(this);
37772
37797
  };
37798
+ PanelModelBase.prototype.unregisterElementPropertiesChanged = function (element) {
37799
+ element.unregisterPropertyChangedHandlers(["visible", "isVisible", "startWithNewLine"], this.id);
37800
+ };
37773
37801
  PanelModelBase.prototype.onRemoveElementNotifySurvey = function (element) {
37774
37802
  if (!this.canFireAddRemoveNotifications(element))
37775
37803
  return;
@@ -37814,19 +37842,21 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37814
37842
  PanelModelBase.prototype.buildRows = function () {
37815
37843
  if (!this.canBuildRows())
37816
37844
  return [];
37817
- var result = new Array();
37818
- for (var i = 0; i < this.elements.length; i++) {
37819
- var el = this.elements[i];
37845
+ var res = new Array();
37846
+ var els = this.getElementsForRows();
37847
+ for (var i = 0; i < els.length; i++) {
37848
+ var el = els[i];
37820
37849
  var isNewRow = i == 0 || el.startWithNewLine;
37821
- var row = isNewRow ? this.createRowAndSetLazy(result.length) : result[result.length - 1];
37850
+ var row = isNewRow ? this.createRowAndSetLazy(res.length) : res[res.length - 1];
37822
37851
  if (isNewRow)
37823
- result.push(row);
37852
+ res.push(row);
37824
37853
  row.addElement(el);
37825
37854
  }
37826
- for (var i = 0; i < result.length; i++) {
37827
- result[i].updateVisible();
37828
- }
37829
- return result;
37855
+ res.forEach(function (row) { return row.updateVisible(); });
37856
+ return res;
37857
+ };
37858
+ PanelModelBase.prototype.getElementsForRows = function () {
37859
+ return this.elements;
37830
37860
  };
37831
37861
  PanelModelBase.prototype.getDragDropInfo = function () {
37832
37862
  var page = this.getPage(this.parent);
@@ -38389,10 +38419,13 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
38389
38419
  }
38390
38420
  this.rows.splice(0, this.rows.length);
38391
38421
  }
38422
+ this.disposeElements();
38423
+ this.elements.splice(0, this.elements.length);
38424
+ };
38425
+ PanelModelBase.prototype.disposeElements = function () {
38392
38426
  for (var i = 0; i < this.elements.length; i++) {
38393
38427
  this.elements[i].dispose();
38394
38428
  }
38395
- this.elements.splice(0, this.elements.length);
38396
38429
  };
38397
38430
  PanelModelBase.panelCounter = 100;
38398
38431
  panel_decorate([
@@ -38445,7 +38478,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38445
38478
  });
38446
38479
  PanelModel.prototype.getSurvey = function (live) {
38447
38480
  if (live === void 0) { live = false; }
38448
- if (live) {
38481
+ if (live && this.isPanel) {
38449
38482
  return !!this.parent ? this.parent.getSurvey(live) : null;
38450
38483
  }
38451
38484
  return _super.prototype.getSurvey.call(this, live);
@@ -38596,6 +38629,8 @@ var panel_PanelModel = /** @class */ (function (_super) {
38596
38629
  return locTitleValue;
38597
38630
  };
38598
38631
  PanelModel.prototype.beforeSetVisibleIndex = function (index) {
38632
+ if (this.isPage)
38633
+ return _super.prototype.beforeSetVisibleIndex.call(this, index);
38599
38634
  var visibleIndex = -1;
38600
38635
  if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty || this.hasParentInQuestionIndex())) {
38601
38636
  visibleIndex = index;
@@ -38627,7 +38662,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38627
38662
  }
38628
38663
  };
38629
38664
  PanelModel.prototype.getRenderedTitle = function (str) {
38630
- if (!str) {
38665
+ if (this.isPanel && !str) {
38631
38666
  if (this.isCollapsed || this.isExpanded)
38632
38667
  return this.name;
38633
38668
  if (this.isDesignMode)
@@ -38752,11 +38787,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38752
38787
  return this.footerToolbarValue;
38753
38788
  };
38754
38789
  Object.defineProperty(PanelModel.prototype, "hasEditButton", {
38755
- get: function () {
38756
- if (this.survey && this.survey.state === "preview")
38757
- return (this.parent && this.parent instanceof page_PageModel);
38758
- return false;
38759
- },
38790
+ get: function () { return false; },
38760
38791
  enumerable: false,
38761
38792
  configurable: true
38762
38793
  });
@@ -38765,19 +38796,16 @@ var panel_PanelModel = /** @class */ (function (_super) {
38765
38796
  return;
38766
38797
  this.survey.cancelPreviewByPage(this);
38767
38798
  };
38768
- PanelModel.prototype.canShowTitle = function (survey) {
38769
- var page = this.originalPage;
38770
- if (!!page)
38771
- return page.canShowTitle(survey);
38772
- return _super.prototype.canShowTitle.call(this, survey);
38773
- };
38774
38799
  Object.defineProperty(PanelModel.prototype, "cssTitle", {
38775
38800
  get: function () {
38776
- return this.getCssTitle(this.cssClasses.panel);
38801
+ return this.getCssPanelTitle();
38777
38802
  },
38778
38803
  enumerable: false,
38779
38804
  configurable: true
38780
38805
  });
38806
+ PanelModel.prototype.getCssPanelTitle = function () {
38807
+ return this.getCssTitle(this.cssClasses.panel);
38808
+ };
38781
38809
  PanelModel.prototype.getCssTitleExpandableSvg = function () {
38782
38810
  if (this.state === "default")
38783
38811
  return null;
@@ -38791,6 +38819,8 @@ var panel_PanelModel = /** @class */ (function (_super) {
38791
38819
  configurable: true
38792
38820
  });
38793
38821
  PanelModel.prototype.getCssError = function (cssClasses) {
38822
+ if (this.isPage)
38823
+ return _super.prototype.getCssError.call(this, cssClasses);
38794
38824
  var builder = new CssClassBuilder()
38795
38825
  .append(_super.prototype.getCssError.call(this, cssClasses))
38796
38826
  .append(cssClasses.panel.errorsContainer);
@@ -38821,10 +38851,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38821
38851
  };
38822
38852
  Object.defineProperty(PanelModel.prototype, "showPanelAsPage", {
38823
38853
  get: function () {
38824
- var panel = this;
38825
- if (!!panel.originalPage)
38826
- return true;
38827
- return panel.survey.isShowingPreview && panel.survey.isSinglePage && !!panel.parent && !!panel.parent.originalPage;
38854
+ return false;
38828
38855
  },
38829
38856
  enumerable: false,
38830
38857
  configurable: true
@@ -38864,7 +38891,9 @@ var panel_PanelModel = /** @class */ (function (_super) {
38864
38891
  PanelModel.prototype.afterRenderCore = function (element) {
38865
38892
  var _a;
38866
38893
  _super.prototype.afterRenderCore.call(this, element);
38867
- (_a = this.survey) === null || _a === void 0 ? void 0 : _a.afterRenderPanel(this, element);
38894
+ if (this.isPanel) {
38895
+ (_a = this.survey) === null || _a === void 0 ? void 0 : _a.afterRenderPanel(this, element);
38896
+ }
38868
38897
  };
38869
38898
  return PanelModel;
38870
38899
  }(panel_PanelModelBase));
@@ -38912,27 +38941,17 @@ Serializer.addClass("panelbase", [
38912
38941
  return new panel_PanelModelBase();
38913
38942
  });
38914
38943
  Serializer.addClass("panel", [
38915
- {
38916
- name: "state",
38917
- default: "default",
38918
- choices: ["default", "collapsed", "expanded"],
38919
- },
38944
+ { name: "state", default: "default", choices: ["default", "collapsed", "expanded"] },
38920
38945
  { name: "isRequired:switch", overridingProperty: "requiredIf" },
38921
- {
38922
- name: "requiredErrorText:text",
38923
- serializationProperty: "locRequiredErrorText",
38924
- },
38946
+ { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" },
38925
38947
  { name: "startWithNewLine:boolean", default: true },
38926
- "width",
38948
+ { name: "width" },
38927
38949
  { name: "minWidth", defaultFunc: function () { return "auto"; } },
38928
38950
  { name: "maxWidth", defaultFunc: function () { return settings.maxWidth; } },
38929
- {
38930
- name: "colSpan:number", visible: false,
38931
- onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); },
38932
- },
38951
+ { name: "colSpan:number", visible: false, onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); } },
38933
38952
  {
38934
38953
  name: "effectiveColSpan:number", minValue: 1, isSerializable: false,
38935
- visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
38954
+ visibleIf: function (obj) { return !!obj.survey && obj.survey.gridLayoutEnabled; }
38936
38955
  },
38937
38956
  { name: "innerIndent:number", default: 0, choices: [0, 1, 2, 3] },
38938
38957
  { name: "indent:number", default: 0, choices: [0, 1, 2, 3], visible: false },
@@ -38952,13 +38971,9 @@ Serializer.addClass("panel", [
38952
38971
  : [];
38953
38972
  },
38954
38973
  },
38955
- "showNumber:boolean",
38956
- {
38957
- name: "showQuestionNumbers",
38958
- default: "default",
38959
- choices: ["default", "onpanel", "off"],
38960
- },
38961
- "questionStartIndex",
38974
+ { name: "showNumber:boolean" },
38975
+ { name: "showQuestionNumbers", default: "default", choices: ["default", "onpanel", "off"] },
38976
+ { name: "questionStartIndex", visibleIf: function (obj) { return obj.isPanel; } },
38962
38977
  { name: "allowAdaptiveActions:boolean", default: true, visible: false },
38963
38978
  ], function () {
38964
38979
  return new panel_PanelModel();
@@ -39234,12 +39249,61 @@ var page_PageModel = /** @class */ (function (_super) {
39234
39249
  return this.name;
39235
39250
  };
39236
39251
  Object.defineProperty(PageModel.prototype, "isPage", {
39252
+ get: function () {
39253
+ return !this.isPanel;
39254
+ },
39255
+ enumerable: false,
39256
+ configurable: true
39257
+ });
39258
+ Object.defineProperty(PageModel.prototype, "isPanel", {
39259
+ get: function () {
39260
+ return !!this.parent;
39261
+ },
39262
+ enumerable: false,
39263
+ configurable: true
39264
+ });
39265
+ Object.defineProperty(PageModel.prototype, "showPanelAsPage", {
39237
39266
  get: function () {
39238
39267
  return true;
39239
39268
  },
39240
39269
  enumerable: false,
39241
39270
  configurable: true
39242
39271
  });
39272
+ Object.defineProperty(PageModel.prototype, "hasEditButton", {
39273
+ get: function () {
39274
+ return this.isPanel && this.survey && this.survey.state === "preview"
39275
+ && !!this.parent && !this.parent.isPanel;
39276
+ },
39277
+ enumerable: false,
39278
+ configurable: true
39279
+ });
39280
+ PageModel.prototype.getElementsForRows = function () {
39281
+ var _a;
39282
+ var q = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.currentSingleQuestion;
39283
+ if (!!q) {
39284
+ if (q.page === this)
39285
+ return [q];
39286
+ return [];
39287
+ }
39288
+ return _super.prototype.getElementsForRows.call(this);
39289
+ };
39290
+ PageModel.prototype.disposeElements = function () {
39291
+ if (!this.isPageContainer) {
39292
+ _super.prototype.disposeElements.call(this);
39293
+ }
39294
+ };
39295
+ PageModel.prototype.onRemoveElement = function (element) {
39296
+ if (this.isPageContainer) {
39297
+ element.parent = null;
39298
+ this.unregisterElementPropertiesChanged(element);
39299
+ }
39300
+ else {
39301
+ _super.prototype.onRemoveElement.call(this, element);
39302
+ }
39303
+ };
39304
+ PageModel.prototype.getTemplate = function () {
39305
+ return this.isPanel ? "panel" : _super.prototype.getTemplate.call(this);
39306
+ };
39243
39307
  Object.defineProperty(PageModel.prototype, "no", {
39244
39308
  get: function () {
39245
39309
  if (!this.canShowPageNumber() || !this.survey)
@@ -39377,6 +39441,8 @@ var page_PageModel = /** @class */ (function (_super) {
39377
39441
  configurable: true
39378
39442
  });
39379
39443
  PageModel.prototype.calcCssClasses = function (css) {
39444
+ if (this.isPanel)
39445
+ return _super.prototype.calcCssClasses.call(this, css);
39380
39446
  var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "", rowEnter: "", rowLeave: "", rowDelayedEnter: "", rowReplace: "" };
39381
39447
  this.copyCssClasses(classes.page, css.page);
39382
39448
  this.copyCssClasses(classes.error, css.error);
@@ -39415,20 +39481,18 @@ var page_PageModel = /** @class */ (function (_super) {
39415
39481
  }
39416
39482
  return classes;
39417
39483
  };
39418
- Object.defineProperty(PageModel.prototype, "cssTitle", {
39419
- get: function () {
39420
- if (!this.cssClasses.page)
39421
- return "";
39422
- return new CssClassBuilder()
39423
- .append(this.cssClasses.page.title)
39424
- .toString();
39425
- },
39426
- enumerable: false,
39427
- configurable: true
39428
- });
39484
+ PageModel.prototype.getCssPanelTitle = function () {
39485
+ if (this.isPanel)
39486
+ return _super.prototype.getCssPanelTitle.call(this);
39487
+ if (!this.cssClasses.page)
39488
+ return "";
39489
+ return new CssClassBuilder()
39490
+ .append(this.cssClasses.page.title)
39491
+ .toString();
39492
+ };
39429
39493
  Object.defineProperty(PageModel.prototype, "cssRoot", {
39430
39494
  get: function () {
39431
- if (!this.cssClasses.page || !this.survey)
39495
+ if (this.isPanel || !this.cssClasses.page || !this.survey)
39432
39496
  return "";
39433
39497
  return new CssClassBuilder()
39434
39498
  .append(this.cssClasses.page.root)
@@ -39440,6 +39504,8 @@ var page_PageModel = /** @class */ (function (_super) {
39440
39504
  configurable: true
39441
39505
  });
39442
39506
  PageModel.prototype.getCssError = function (cssClasses) {
39507
+ if (this.isPanel)
39508
+ return _super.prototype.getCssError.call(this, cssClasses);
39443
39509
  return new CssClassBuilder()
39444
39510
  .append(_super.prototype.getCssError.call(this, cssClasses))
39445
39511
  .append(cssClasses.page.errorsContainer).toString();
@@ -39616,7 +39682,7 @@ var page_PageModel = /** @class */ (function (_super) {
39616
39682
  jsonobject_property({ defaultValue: -1, onSet: function (val, target) { return target.onNumChanged(val); } })
39617
39683
  ], PageModel.prototype, "num", void 0);
39618
39684
  return PageModel;
39619
- }(panel_PanelModelBase));
39685
+ }(panel_PanelModel));
39620
39686
 
39621
39687
  Serializer.addClass("page", [
39622
39688
  {
@@ -39641,9 +39707,25 @@ Serializer.addClass("page", [
39641
39707
  },
39642
39708
  { name: "title:text", serializationProperty: "locTitle" },
39643
39709
  { name: "description:text", serializationProperty: "locDescription" },
39710
+ { name: "state", visible: false },
39711
+ { name: "isRequired", visible: false },
39712
+ { name: "startWithNewLine", visible: false },
39713
+ { name: "width", visible: false },
39714
+ { name: "minWidth", visible: false },
39715
+ { name: "maxWidth", visible: false },
39716
+ { name: "colSpan", visible: false, isSerializable: false },
39717
+ { name: "effectiveColSpan:number", visible: false, isSerializable: false },
39718
+ { name: "innerIndent", visible: false },
39719
+ { name: "indent", visible: false },
39720
+ { name: "page", visible: false, isSerializable: false },
39721
+ { name: "showNumber", visible: false },
39722
+ { name: "showQuestionNumbers", visible: false },
39723
+ { name: "questionStartIndex", visible: false },
39724
+ { name: "allowAdaptiveActions", visible: false },
39725
+ { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText", visible: false },
39644
39726
  ], function () {
39645
39727
  return new page_PageModel();
39646
- }, "panelbase");
39728
+ }, "panel");
39647
39729
 
39648
39730
  // CONCATENATED MODULE: ./packages/survey-core/src/progress-buttons.ts
39649
39731
  var progress_buttons_extends = (undefined && undefined.__extends) || (function () {
@@ -39885,16 +39967,27 @@ var ProgressButtonsResponsivityManager = /** @class */ (function () {
39885
39967
 
39886
39968
 
39887
39969
 
39888
-
39889
39970
  function tryFocusPage(survey, panel) {
39890
39971
  if (survey.isDesignMode)
39891
39972
  return true;
39892
39973
  panel.focusFirstQuestion();
39893
39974
  return true;
39894
39975
  }
39976
+ function getPage(question) {
39977
+ if (!!question.parentQuestion) {
39978
+ return getPage(question.parentQuestion);
39979
+ }
39980
+ var parent = question.parent;
39981
+ while (parent && parent.getType() !== "page" && parent.parent) {
39982
+ parent = parent.parent;
39983
+ }
39984
+ if (parent && parent.getType() === "page") {
39985
+ return parent;
39986
+ }
39987
+ return null;
39988
+ }
39895
39989
  function createTOCListModel(survey, onAction) {
39896
39990
  var items = getTOCItems(survey, onAction);
39897
- var selectedItem = items.filter(function (i) { return !!survey.currentPage && i.id === survey.currentPage.name; })[0] || items[0];
39898
39991
  var listOptions = {
39899
39992
  items: items,
39900
39993
  onSelectionChanged: function (item) {
@@ -39902,15 +39995,20 @@ function createTOCListModel(survey, onAction) {
39902
39995
  listModel.selectedItem = item;
39903
39996
  }
39904
39997
  },
39905
- allowSelection: true,
39906
39998
  searchEnabled: false,
39907
39999
  locOwner: survey,
39908
- selectedItem: selectedItem
39909
40000
  };
39910
40001
  var listModel = new list_ListModel(listOptions);
39911
40002
  listModel.allowSelection = false;
40003
+ var updateSelectedItem = function (currentPage, defaultSelection) {
40004
+ listModel.selectedItem = !!currentPage && listModel.actions.filter(function (i) { return i.id === currentPage.name; })[0] || defaultSelection;
40005
+ };
40006
+ updateSelectedItem(survey.currentPage, items[0]);
39912
40007
  survey.onCurrentPageChanged.add(function (s, o) {
39913
- listModel.selectedItem = listModel.actions.filter(function (i) { return !!survey.currentPage && i.id === survey.currentPage.name; })[0];
40008
+ updateSelectedItem(survey.currentPage);
40009
+ });
40010
+ survey.onFocusInQuestion.add(function (s, o) {
40011
+ updateSelectedItem(getPage(o.question));
39914
40012
  });
39915
40013
  survey.registerFunctionOnPropertyValueChanged("pages", function () {
39916
40014
  listModel.setItems(getTOCItems(survey, onAction));
@@ -39918,8 +40016,7 @@ function createTOCListModel(survey, onAction) {
39918
40016
  return listModel;
39919
40017
  }
39920
40018
  function getTOCItems(survey, onAction) {
39921
- var _a;
39922
- var pagesSource = survey.questionsOnPageMode === "singlePage" ? (_a = survey.pages[0]) === null || _a === void 0 ? void 0 : _a.elements : survey.pages;
40019
+ var pagesSource = survey.pages;
39923
40020
  var items = (pagesSource || []).map(function (page) {
39924
40021
  return new action_Action({
39925
40022
  id: page.name,
@@ -39927,7 +40024,7 @@ function getTOCItems(survey, onAction) {
39927
40024
  action: function () {
39928
40025
  DomDocumentHelper.activeElementBlur();
39929
40026
  !!onAction && onAction();
39930
- if (page instanceof page_PageModel) {
40027
+ if (page.isPage) {
39931
40028
  return survey.tryNavigateToPage(page);
39932
40029
  }
39933
40030
  return tryFocusPage(survey, page);
@@ -43640,6 +43737,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43640
43737
  get: function () {
43641
43738
  if (this.isDesignMode)
43642
43739
  return this.pages;
43740
+ if (!!this.pageContainerValue && (this.isShowingPreview || this.isSinglePage))
43741
+ return [this.pageContainerValue];
43643
43742
  var result = new Array();
43644
43743
  for (var i = 0; i < this.pages.length; i++) {
43645
43744
  if (this.isPageInVisibleList(this.pages[i])) {
@@ -43773,7 +43872,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43773
43872
  return false;
43774
43873
  if (index === this.currentPageNo)
43775
43874
  return false;
43776
- if (index < this.currentPageNo || this.isValidateOnComplete) {
43875
+ if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages) {
43777
43876
  this.currentPageNo = index;
43778
43877
  return true;
43779
43878
  }
@@ -44105,6 +44204,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44105
44204
  this.onFirstPageIsStartedChanged();
44106
44205
  if (goToFirstPage) {
44107
44206
  this.currentPage = this.firstVisiblePage;
44207
+ if (this.currentSingleQuestion) {
44208
+ var questions = this.getAllQuestions(true);
44209
+ this.currentSingleQuestion = questions.length > 0 ? questions[0] : undefined;
44210
+ }
44108
44211
  }
44109
44212
  if (clearData) {
44110
44213
  this.updateValuesWithDefaults();
@@ -44142,7 +44245,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44142
44245
  SurveyModel.prototype.currentPageChanged = function (newValue, oldValue) {
44143
44246
  this.notifyQuestionsOnHidingContent(oldValue);
44144
44247
  var options = this.createPageChangeEventOptions(newValue, oldValue);
44145
- if (oldValue && !oldValue.passed) {
44248
+ if (oldValue && !oldValue.isDisposed && !oldValue.passed) {
44146
44249
  if (oldValue.validate(false)) {
44147
44250
  oldValue.passed = true;
44148
44251
  }
@@ -44153,9 +44256,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44153
44256
  this.onCurrentPageChanged.fire(this, options);
44154
44257
  };
44155
44258
  SurveyModel.prototype.notifyQuestionsOnHidingContent = function (page) {
44156
- if (!page)
44157
- return;
44158
- page.questions.forEach(function (q) { return q.onHidingContent(); });
44259
+ if (page && !page.isDisposed) {
44260
+ page.questions.forEach(function (q) { return q.onHidingContent(); });
44261
+ }
44159
44262
  };
44160
44263
  SurveyModel.prototype.createPageChangeEventOptions = function (newValue, oldValue) {
44161
44264
  var diff = !!newValue && !!oldValue ? newValue.visibleIndex - oldValue.visibleIndex : 0;
@@ -44391,6 +44494,30 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44391
44494
  return false;
44392
44495
  return this.doCurrentPageComplete(false);
44393
44496
  };
44497
+ SurveyModel.prototype.performNext = function () {
44498
+ var q = this.currentSingleQuestion;
44499
+ if (!q)
44500
+ return this.nextPage();
44501
+ if (!q.validate(true))
44502
+ return false;
44503
+ var questions = this.getAllQuestions(true);
44504
+ var index = questions.indexOf(q);
44505
+ if (index < 0 || index === questions.length - 1)
44506
+ return false;
44507
+ this.currentSingleQuestion = questions[index + 1];
44508
+ return true;
44509
+ };
44510
+ SurveyModel.prototype.performPrevious = function () {
44511
+ var q = this.currentSingleQuestion;
44512
+ if (!q)
44513
+ return this.prevPage();
44514
+ var questions = this.getAllQuestions(true);
44515
+ var index = questions.indexOf(q);
44516
+ if (index === 0)
44517
+ return false;
44518
+ this.currentSingleQuestion = questions[index - 1];
44519
+ return true;
44520
+ };
44394
44521
  SurveyModel.prototype.hasErrorsOnNavigate = function (doComplete) {
44395
44522
  var _this = this;
44396
44523
  if (!this.isEditMode || this.ignoreValidation)
@@ -44720,9 +44847,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44720
44847
  };
44721
44848
  SurveyModel.prototype.nextPageUIClick = function () {
44722
44849
  if (!!this.mouseDownPage && this.mouseDownPage !== this.activePage)
44723
- return;
44850
+ return false;
44724
44851
  this.mouseDownPage = null;
44725
- return this.nextPage();
44852
+ return this.performNext();
44726
44853
  };
44727
44854
  SurveyModel.prototype.nextPageMouseDown = function () {
44728
44855
  this.mouseDownPage = this.activePage;
@@ -44766,7 +44893,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44766
44893
  this.isShowingPreview = false;
44767
44894
  };
44768
44895
  SurveyModel.prototype.cancelPreviewByPage = function (panel) {
44769
- this.cancelPreview(panel["originalPage"]);
44896
+ this.cancelPreview(panel);
44770
44897
  };
44771
44898
  SurveyModel.prototype.doCurrentPageComplete = function (doComplete) {
44772
44899
  if (this.isValidatingOnServer)
@@ -44796,6 +44923,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44796
44923
  enumerable: false,
44797
44924
  configurable: true
44798
44925
  });
44926
+ Object.defineProperty(SurveyModel.prototype, "isSingleVisibleQuestion", {
44927
+ get: function () {
44928
+ return this.isSingleVisibleQuestionVal(this.questionsOnPageMode);
44929
+ },
44930
+ enumerable: false,
44931
+ configurable: true
44932
+ });
44933
+ SurveyModel.prototype.isSingleVisibleQuestionVal = function (val) {
44934
+ return val === "questionPerPage" || val === "questionOnPage";
44935
+ };
44799
44936
  Object.defineProperty(SurveyModel.prototype, "questionsOnPageMode", {
44800
44937
  /**
44801
44938
  * Specifies how to distribute survey elements between pages.
@@ -44871,25 +45008,54 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44871
45008
  this.pageVisibilityChanged(this.pages[0], !this.isStartedState);
44872
45009
  };
44873
45010
  SurveyModel.prototype.onShowingPreviewChanged = function () {
45011
+ this.updatePagesContainer();
45012
+ };
45013
+ SurveyModel.prototype.createRootPage = function (name, pages) {
45014
+ var container = Serializer.createClass("page");
45015
+ container.name = name;
45016
+ container.isPageContainer = true;
45017
+ pages.forEach(function (page) {
45018
+ if (!page.isStartPage) {
45019
+ container.addElement(page);
45020
+ }
45021
+ });
45022
+ return container;
45023
+ };
45024
+ SurveyModel.prototype.disposeContainerPage = function () {
45025
+ var cPage = this.pageContainerValue;
45026
+ var elements = [].concat(cPage.elements);
45027
+ elements.forEach(function (el) { return cPage.removeElement(el); });
45028
+ cPage.dispose();
45029
+ this.pageContainerValue = undefined;
45030
+ };
45031
+ SurveyModel.prototype.updatePagesContainer = function () {
44874
45032
  if (this.isDesignMode)
44875
45033
  return;
44876
- if (this.isShowingPreview) {
44877
- this.runningPages = this.pages.slice(0, this.pages.length);
44878
- this.setupPagesForPageModes(true, false);
44879
- }
44880
- else {
44881
- if (this.runningPages) {
44882
- this.restoreOriginalPages(this.runningPages);
45034
+ this.getAllQuestions().forEach(function (q) { return q.updateElementVisibility(); });
45035
+ this.setPropertyValue("currentPage", undefined);
45036
+ var singleName = "single-page";
45037
+ var previewName = "preview-page";
45038
+ var rootPage = undefined;
45039
+ if (this.isSinglePage) {
45040
+ var cPage = this.pageContainerValue;
45041
+ if (cPage && cPage.name === previewName) {
45042
+ rootPage = cPage.elements[0];
45043
+ this.disposeContainerPage();
45044
+ }
45045
+ else {
45046
+ rootPage = this.createRootPage(singleName, this.pages);
44883
45047
  }
44884
- this.runningPages = undefined;
44885
45048
  }
44886
- this.runConditions();
44887
- this.updateAllElementsVisibility(this.pages);
44888
- this.updateVisibleIndexes();
44889
45049
  if (this.isShowingPreview) {
44890
- this.currentPageNo = 0;
45050
+ rootPage = this.createRootPage(previewName, rootPage ? [rootPage] : this.pages);
44891
45051
  }
44892
- else {
45052
+ if (rootPage) {
45053
+ rootPage.setSurveyImpl(this);
45054
+ this.pageContainerValue = rootPage;
45055
+ this.currentPage = rootPage;
45056
+ }
45057
+ if (!this.isSinglePage && !this.isShowingPreview) {
45058
+ this.disposeContainerPage();
44893
45059
  var curPage = this.gotoPageFromPreview;
44894
45060
  this.gotoPageFromPreview = null;
44895
45061
  if (helpers_Helpers.isValueEmpty(curPage) && this.visiblePageCount > 0) {
@@ -44901,110 +45067,62 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44901
45067
  this.changeCurrentPageFromPreview = false;
44902
45068
  }
44903
45069
  }
45070
+ if (!this.currentPage && this.visiblePageCount > 0) {
45071
+ this.currentPage = this.visiblePages[0];
45072
+ }
45073
+ this.pages.forEach(function (page) {
45074
+ if (page.hasShown) {
45075
+ page.updateElementCss(true);
45076
+ }
45077
+ });
45078
+ this.updateButtonsVisibility();
44904
45079
  };
44905
- SurveyModel.prototype.onQuestionsOnPageModeChanged = function (oldValue, isFirstLoad) {
44906
- if (isFirstLoad === void 0) { isFirstLoad = false; }
45080
+ Object.defineProperty(SurveyModel.prototype, "currentSingleQuestion", {
45081
+ get: function () { return this.currentSingleQuestionValue; },
45082
+ set: function (val) {
45083
+ if (val !== this.currentSingleQuestion) {
45084
+ this.currentSingleQuestionValue = val;
45085
+ if (!!val) {
45086
+ var page = val.page;
45087
+ page.updateRows();
45088
+ if (page !== this.currentPage) {
45089
+ this.currentPage = page;
45090
+ }
45091
+ else {
45092
+ if (this.focusFirstQuestionAutomatic) {
45093
+ val.focus();
45094
+ }
45095
+ }
45096
+ this.updateButtonsVisibility();
45097
+ }
45098
+ else {
45099
+ this.visiblePages.forEach(function (page) { return page.updateRows(); });
45100
+ }
45101
+ }
45102
+ },
45103
+ enumerable: false,
45104
+ configurable: true
45105
+ });
45106
+ SurveyModel.prototype.onQuestionsOnPageModeChanged = function (oldValue) {
44907
45107
  if (this.isShowingPreview)
44908
45108
  return;
44909
- if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
44910
- if (this.originalPages) {
44911
- this.restoreOriginalPages(this.originalPages);
44912
- }
44913
- this.originalPages = undefined;
45109
+ this.currentSingleQuestion = undefined;
45110
+ if (oldValue === "singlePage") {
45111
+ this.updatePagesContainer();
44914
45112
  }
44915
- else {
44916
- if (!oldValue || oldValue == "standard") {
44917
- this.originalPages = this.pages.slice(0, this.pages.length);
44918
- }
44919
- this.setupPagesForPageModes(this.isSinglePage, isFirstLoad);
45113
+ if (this.isSinglePage) {
45114
+ this.updatePagesContainer();
44920
45115
  }
44921
- this.runConditions();
44922
- this.updateVisibleIndexes();
44923
- };
44924
- SurveyModel.prototype.restoreOriginalPages = function (originalPages) {
44925
- this.questionHashesClear();
44926
- this.pages.splice(0, this.pages.length);
44927
- for (var i = 0; i < originalPages.length; i++) {
44928
- var page = originalPages[i];
44929
- page.setWasShown(false);
44930
- this.pages.push(page);
45116
+ if (this.isSingleVisibleQuestion) {
45117
+ var questions = this.getAllQuestions(true);
45118
+ if (questions.length > 0) {
45119
+ this.currentSingleQuestion = questions[0];
45120
+ }
44931
45121
  }
44932
45122
  };
44933
45123
  SurveyModel.prototype.getPageStartIndex = function () {
44934
45124
  return this.firstPageIsStarted && this.pages.length > 0 ? 1 : 0;
44935
45125
  };
44936
- SurveyModel.prototype.setupPagesForPageModes = function (isSinglePage, isFirstLoad) {
44937
- var _this = this;
44938
- this.questionHashesClear();
44939
- if (this.firstPageIsStarted && this.pages.length > 0) {
44940
- this.pages[0].questions.forEach(function (q) { return _this.questionHashesAdded(q); });
44941
- }
44942
- this.isLockingUpdateOnPageModes = !isFirstLoad;
44943
- var startIndex = this.getPageStartIndex();
44944
- _super.prototype.startLoadingFromJson.call(this);
44945
- var newPages = this.createPagesForQuestionOnPageMode(isSinglePage, startIndex);
44946
- var deletedLen = this.pages.length - startIndex;
44947
- this.pages.splice(startIndex, deletedLen);
44948
- for (var i = 0; i < newPages.length; i++) {
44949
- this.pages.push(newPages[i]);
44950
- }
44951
- _super.prototype.endLoadingFromJson.call(this);
44952
- for (var i = 0; i < newPages.length; i++) {
44953
- newPages[i].setSurveyImpl(this, true);
44954
- }
44955
- this.doElementsOnLoad();
44956
- this.updateCurrentPage();
44957
- this.isLockingUpdateOnPageModes = false;
44958
- };
44959
- SurveyModel.prototype.createPagesForQuestionOnPageMode = function (isSinglePage, startIndex) {
44960
- if (isSinglePage) {
44961
- return [this.createSinglePage(startIndex)];
44962
- }
44963
- return this.createPagesForEveryQuestion(startIndex);
44964
- };
44965
- SurveyModel.prototype.createSinglePage = function (startIndex) {
44966
- var single = this.createNewPage("all");
44967
- single.setSurveyImpl(this);
44968
- for (var i = startIndex; i < this.pages.length; i++) {
44969
- var page = this.pages[i];
44970
- var panel = Serializer.createClass("panel");
44971
- panel.originalPage = page;
44972
- single.addPanel(panel);
44973
- var json = new jsonobject_JsonObject().toJsonObject(page);
44974
- new jsonobject_JsonObject().toObject(json, panel);
44975
- }
44976
- return single;
44977
- };
44978
- SurveyModel.prototype.createPagesForEveryQuestion = function (startIndex) {
44979
- var res = [];
44980
- for (var i = startIndex; i < this.pages.length; i++) {
44981
- var originalPage = this.pages[i];
44982
- // Initialize randomization
44983
- originalPage.setWasShown(true);
44984
- for (var j = 0; j < originalPage.elements.length; j++) {
44985
- var originalElement = originalPage.elements[j];
44986
- var element = Serializer.createClass(originalElement.getType());
44987
- if (!element)
44988
- continue;
44989
- var jsonObj = new jsonobject_JsonObject();
44990
- //Deserialize page properties only, excluding elements
44991
- jsonObj.lightSerializing = true;
44992
- var pageJson = jsonObj.toJsonObject(originalPage);
44993
- var page = Serializer.createClass(originalPage.getType());
44994
- page.fromJSON(pageJson);
44995
- page.name = originalElement.name;
44996
- page.setSurveyImpl(this);
44997
- res.push(page);
44998
- var json = new jsonobject_JsonObject().toJsonObject(originalElement);
44999
- page.addElement(element);
45000
- new jsonobject_JsonObject().toObject(json, element);
45001
- for (var k = 0; k < page.questions.length; k++) {
45002
- this.questionHashesAdded(page.questions[k]);
45003
- }
45004
- }
45005
- }
45006
- return res;
45007
- };
45008
45126
  Object.defineProperty(SurveyModel.prototype, "isFirstPage", {
45009
45127
  /**
45010
45128
  * Indicates whether the [current page](#currentPage) is the first page.
@@ -45070,30 +45188,73 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45070
45188
  enumerable: false,
45071
45189
  configurable: true
45072
45190
  });
45191
+ Object.defineProperty(SurveyModel.prototype, "isFirstElement", {
45192
+ get: function () {
45193
+ return this.getPropertyValue("isFirstElement");
45194
+ },
45195
+ enumerable: false,
45196
+ configurable: true
45197
+ });
45198
+ Object.defineProperty(SurveyModel.prototype, "isLastElement", {
45199
+ get: function () {
45200
+ return this.getPropertyValue("isLastElement");
45201
+ },
45202
+ enumerable: false,
45203
+ configurable: true
45204
+ });
45073
45205
  SurveyModel.prototype.updateIsFirstLastPageState = function () {
45074
45206
  var curPage = this.currentPage;
45075
45207
  this.setPropertyValue("isFirstPage", !!curPage && curPage === this.firstVisiblePage);
45076
45208
  this.setPropertyValue("isLastPage", !!curPage && curPage === this.lastVisiblePage);
45209
+ var fVal = undefined;
45210
+ var lVal = undefined;
45211
+ var q = this.currentSingleQuestion;
45212
+ if (!!q) {
45213
+ var questions = this.getAllQuestions(true);
45214
+ var index = questions.indexOf(q);
45215
+ if (index >= 0) {
45216
+ fVal = index === 0;
45217
+ lVal = index === questions.length - 1;
45218
+ }
45219
+ }
45220
+ this.setPropertyValue("isFirstElement", fVal);
45221
+ this.setPropertyValue("isLastElement", lVal);
45077
45222
  };
45223
+ Object.defineProperty(SurveyModel.prototype, "isLastPageOrElement", {
45224
+ get: function () {
45225
+ return this.isLastElement !== undefined ? this.isLastElement : this.isLastPage;
45226
+ },
45227
+ enumerable: false,
45228
+ configurable: true
45229
+ });
45230
+ Object.defineProperty(SurveyModel.prototype, "isFirstPageOrElement", {
45231
+ get: function () {
45232
+ return this.isFirstElement !== undefined ? this.isFirstElement : this.isFirstPage;
45233
+ },
45234
+ enumerable: false,
45235
+ configurable: true
45236
+ });
45078
45237
  SurveyModel.prototype.calcIsShowPrevButton = function () {
45079
- if (this.isFirstPage || !this.showPrevButton || this.state !== "running")
45238
+ if (this.isFirstPageOrElement || !this.showPrevButton || this.state !== "running")
45080
45239
  return false;
45240
+ if (this.isFirstElement !== undefined)
45241
+ return true;
45081
45242
  var page = this.visiblePages[this.currentPageNo - 1];
45082
45243
  return page && page.getMaxTimeToFinish() <= 0;
45083
45244
  };
45084
45245
  SurveyModel.prototype.calcIsShowNextButton = function () {
45085
- return this.state === "running" && !this.isLastPage && !this.canBeCompletedByTrigger;
45246
+ return this.state === "running" && !this.isLastPageOrElement && !this.canBeCompletedByTrigger;
45086
45247
  };
45087
45248
  SurveyModel.prototype.calcIsCompleteButtonVisible = function () {
45088
45249
  var state = this.state;
45089
45250
  return this.isEditMode && (this.state === "running" &&
45090
- (this.isLastPage && !this.isShowPreviewBeforeComplete || this.canBeCompletedByTrigger)
45251
+ (this.isLastPageOrElement && !this.isShowPreviewBeforeComplete || this.canBeCompletedByTrigger)
45091
45252
  || state === "preview") && this.showCompleteButton;
45092
45253
  };
45093
45254
  SurveyModel.prototype.calcIsPreviewButtonVisible = function () {
45094
45255
  return (this.isEditMode &&
45095
45256
  this.isShowPreviewBeforeComplete &&
45096
- this.state == "running" && this.isLastPage);
45257
+ this.state == "running" && this.isLastPageOrElement);
45097
45258
  };
45098
45259
  SurveyModel.prototype.calcIsCancelPreviewButtonVisible = function () {
45099
45260
  return (this.isEditMode &&
@@ -45102,6 +45263,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45102
45263
  };
45103
45264
  Object.defineProperty(SurveyModel.prototype, "firstVisiblePage", {
45104
45265
  get: function () {
45266
+ if (this.visiblePageCount === 1)
45267
+ return this.visiblePages[0];
45105
45268
  var pages = this.pages;
45106
45269
  for (var i = 0; i < pages.length; i++) {
45107
45270
  if (this.isPageInVisibleList(pages[i]))
@@ -45114,6 +45277,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45114
45277
  });
45115
45278
  Object.defineProperty(SurveyModel.prototype, "lastVisiblePage", {
45116
45279
  get: function () {
45280
+ if (this.visiblePageCount === 1)
45281
+ return this.visiblePages[0];
45117
45282
  var pages = this.pages;
45118
45283
  for (var i = pages.length - 1; i >= 0; i--) {
45119
45284
  if (this.isPageInVisibleList(pages[i]))
@@ -45462,7 +45627,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45462
45627
  });
45463
45628
  SurveyModel.prototype.updateProgressText = function (onValueChanged) {
45464
45629
  if (onValueChanged === void 0) { onValueChanged = false; }
45465
- if (this.isCalculatingProgressText || this.isShowingPreview || this.isLockingUpdateOnPageModes)
45630
+ if (this.isCalculatingProgressText || this.isShowingPreview)
45466
45631
  return;
45467
45632
  if (onValueChanged &&
45468
45633
  this.progressBarType == "pages" &&
@@ -46804,7 +46969,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46804
46969
  this.updateVisibleIndexes();
46805
46970
  };
46806
46971
  SurveyModel.prototype.updateVisibleIndexes = function (page) {
46807
- if (this.isLoadingFromJson || !!this.isEndLoadingFromJson || this.isLockingUpdateOnPageModes)
46972
+ if (this.isLoadingFromJson || !!this.isEndLoadingFromJson)
46808
46973
  return;
46809
46974
  if (this.isRunningConditions &&
46810
46975
  this.onQuestionVisibleChanged.isEmpty &&
@@ -46873,12 +47038,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46873
47038
  SurveyModel.prototype.endLoadingFromJson = function () {
46874
47039
  this.isEndLoadingFromJson = "processing";
46875
47040
  this.onFirstPageIsStartedChanged();
46876
- this.onQuestionsOnPageModeChanged("standard", true);
46877
47041
  _super.prototype.endLoadingFromJson.call(this);
46878
47042
  if (this.hasCookie) {
46879
47043
  this.isCompletedBefore = true;
46880
47044
  }
46881
47045
  this.doElementsOnLoad();
47046
+ this.onQuestionsOnPageModeChanged("standard");
46882
47047
  this.isEndLoadingFromJson = "conditions";
46883
47048
  this.runConditions();
46884
47049
  this.notifyElementsOnAnyValueOrVariableChanged("");
@@ -46926,7 +47091,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46926
47091
  mouseDown: function () { return _this.navigationMouseDown(); },
46927
47092
  },
46928
47093
  locTitle: this.locPagePrevText,
46929
- action: function () { return _this.prevPage(); },
47094
+ action: function () { return _this.performPrevious(); },
46930
47095
  component: defaultComponent
46931
47096
  });
46932
47097
  var navNext = new action_Action({
@@ -47206,8 +47371,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
47206
47371
  SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged, questionName) {
47207
47372
  if (locNotification === void 0) { locNotification = false; }
47208
47373
  if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
47209
- if (this.isLockingUpdateOnPageModes)
47210
- return;
47211
47374
  var newValue = newQuestionValue;
47212
47375
  if (allowNotifyValueChanged) {
47213
47376
  newValue = this.questionOnValueChanging(name, newQuestionValue);
@@ -61024,7 +61187,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
61024
61187
  };
61025
61188
  _this.doClean = function () {
61026
61189
  if (_this.needConfirmRemoveFile) {
61027
- confirmActionAsync(_this.confirmRemoveAllMessage, function () { _this.clearFilesCore(); }, undefined, _this.getLocale(), _this.survey.rootElement);
61190
+ confirmActionAsync({
61191
+ message: _this.confirmRemoveAllMessage,
61192
+ funcOnYes: function () { _this.clearFilesCore(); },
61193
+ locale: _this.getLocale(),
61194
+ rootElement: _this.survey.rootElement,
61195
+ cssClass: _this.cssClasses.confirmDialog
61196
+ });
61028
61197
  return;
61029
61198
  }
61030
61199
  _this.clearFilesCore();
@@ -62033,7 +62202,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
62033
62202
  var _this = this;
62034
62203
  event.stopPropagation();
62035
62204
  if (this.needConfirmRemoveFile) {
62036
- confirmActionAsync(this.getConfirmRemoveMessage(data.name), function () { _this.removeFileCore(data); }, undefined, this.getLocale(), this.survey.rootElement);
62205
+ confirmActionAsync({
62206
+ message: this.getConfirmRemoveMessage(data.name),
62207
+ funcOnYes: function () { _this.clearFilesCore(); },
62208
+ locale: this.getLocale(),
62209
+ rootElement: this.survey.rootElement,
62210
+ cssClass: this.cssClasses.confirmDialog
62211
+ });
62037
62212
  return;
62038
62213
  }
62039
62214
  this.removeFileCore(data);
@@ -68018,7 +68193,13 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68018
68193
  }
68019
68194
  };
68020
68195
  if (this.isRequireConfirmOnDelete(value)) {
68021
- confirmActionAsync(this.confirmDeleteText, function () { removePanel(); }, undefined, this.getLocale(), this.survey.rootElement);
68196
+ confirmActionAsync({
68197
+ message: this.confirmDeleteText,
68198
+ funcOnYes: function () { removePanel(); },
68199
+ locale: this.getLocale(),
68200
+ rootElement: this.survey.rootElement,
68201
+ cssClass: this.cssClasses.confirmDialog
68202
+ });
68022
68203
  }
68023
68204
  else {
68024
68205
  removePanel();
@@ -72159,8 +72340,8 @@ Serializer.addClass("currencymask", [
72159
72340
 
72160
72341
  var Version;
72161
72342
  var ReleaseDate;
72162
- Version = "" + "1.12.15";
72163
- ReleaseDate = "" + "2024-12-16";
72343
+ Version = "" + "1.12.16-patch.1";
72344
+ ReleaseDate = "" + "2024-12-25";
72164
72345
  function checkLibraryVersion(ver, libraryName) {
72165
72346
  if (Version != ver) {
72166
72347
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -82670,7 +82851,7 @@ var element_SurveyRowElement = /** @class */ (function (_super) {
82670
82851
  if (!this.row.isNeedRender) {
82671
82852
  return ReactElementFactory.Instance.createElement(element.skeletonComponentName, { key: element.name + index, element: element, css: this.css, });
82672
82853
  }
82673
- var elementType = element.getType();
82854
+ var elementType = element.getTemplate();
82674
82855
  if (!ReactElementFactory.Instance.isElementRegistered(elementType)) {
82675
82856
  elementType = "question";
82676
82857
  }