survey-react 1.12.14 → 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.14
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, 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; });
@@ -1935,6 +1936,7 @@ __webpack_require__.d(__webpack_exports__, "VerticalResponsivityManager", functi
1935
1936
  __webpack_require__.d(__webpack_exports__, "unwrap", function() { return /* reexport */ unwrap; });
1936
1937
  __webpack_require__.d(__webpack_exports__, "getOriginalEvent", function() { return /* reexport */ getOriginalEvent; });
1937
1938
  __webpack_require__.d(__webpack_exports__, "getElement", function() { return /* reexport */ getElement; });
1939
+ __webpack_require__.d(__webpack_exports__, "activateLazyRenderingChecks", function() { return /* reexport */ activateLazyRenderingChecks; });
1938
1940
  __webpack_require__.d(__webpack_exports__, "createDropdownActionModel", function() { return /* reexport */ createDropdownActionModel; });
1939
1941
  __webpack_require__.d(__webpack_exports__, "createDropdownActionModelAdvanced", function() { return /* reexport */ createDropdownActionModelAdvanced; });
1940
1942
  __webpack_require__.d(__webpack_exports__, "createPopupModelWithListModel", function() { return /* reexport */ createPopupModelWithListModel; });
@@ -2855,12 +2857,13 @@ var surveyLocalization = {
2855
2857
  //TODO remove on next week
2856
2858
  get showNamesInEnglish() { return this.useEnglishNames; },
2857
2859
  set showNamesInEnglish(val) { this.useEnglishNames = val; },
2858
- setupLocale: function (loc, strings, name, nameInEngish, direction) {
2859
- this.locales[loc] = strings;
2860
- this.localeNames[loc] = name;
2861
- this.localeNamesInEnglish[loc] = nameInEngish;
2862
- if (direction !== undefined) {
2863
- this.localeDirections[loc] = direction;
2860
+ setupLocale: function (localeConfig) {
2861
+ var loc = localeConfig.localeCode;
2862
+ this.locales[loc] = localeConfig.strings;
2863
+ this.localeNames[loc] = localeConfig.nativeName;
2864
+ this.localeNamesInEnglish[loc] = localeConfig.englishName;
2865
+ if (localeConfig.rtl !== undefined) {
2866
+ this.localeDirections[loc] = localeConfig.rtl;
2864
2867
  }
2865
2868
  },
2866
2869
  get currentLocale() {
@@ -2958,8 +2961,11 @@ function getLocaleString(strName, locale) {
2958
2961
  if (locale === void 0) { locale = null; }
2959
2962
  return surveyLocalization.getString(strName, locale);
2960
2963
  }
2964
+ function getLocaleStrings(locale) {
2965
+ return surveyLocalization.getLocaleStrings(locale);
2966
+ }
2961
2967
  function setupLocale(localeConfig) {
2962
- surveyLocalization.setupLocale(localeConfig.localeCode, localeConfig.strings, localeConfig.nativeName, localeConfig.englishName, localeConfig.rtl ? "rtl" : undefined);
2968
+ surveyLocalization.setupLocale(localeConfig);
2963
2969
  }
2964
2970
  var surveyStrings = englishStrings;
2965
2971
  surveyLocalization.locales["en"] = englishStrings;
@@ -11781,9 +11787,15 @@ var list_ListModel = /** @class */ (function (_super) {
11781
11787
  .append(itemValue.css)
11782
11788
  .toString();
11783
11789
  };
11784
- _this.getItemIndent = function (itemValue) {
11790
+ // public getItemIndent = (itemValue: any) => {
11791
+ // const level: number = itemValue.level || 0;
11792
+ // return (level + 1) * ListModel.INDENT + "px";
11793
+ // };
11794
+ _this.getItemStyle = function (itemValue) {
11785
11795
  var level = itemValue.level || 0;
11786
- return (level + 1) * ListModel.INDENT + "px";
11796
+ return {
11797
+ "--sjs-list-item-level": level + 1
11798
+ };
11787
11799
  };
11788
11800
  if (Object.keys(items).indexOf("items") !== -1) {
11789
11801
  var options_1 = items;
@@ -12699,13 +12711,14 @@ var action_BaseAction = /** @class */ (function (_super) {
12699
12711
 
12700
12712
  var action_Action = /** @class */ (function (_super) {
12701
12713
  action_extends(Action, _super);
12702
- function Action(innerItem) {
12714
+ function Action(innerItemData) {
12703
12715
  var _this = _super.call(this) || this;
12704
- _this.innerItem = innerItem;
12705
12716
  _this.locTitleChanged = function () {
12706
12717
  var val = _this.locTitle.renderedHtml;
12707
12718
  _this.setPropertyValue("_title", !!val ? val : undefined);
12708
12719
  };
12720
+ var innerItem = (innerItemData instanceof Action) ? innerItemData.innerItem : innerItemData;
12721
+ _this.innerItem = innerItem;
12709
12722
  _this.locTitle = !!innerItem ? innerItem["locTitle"] : null;
12710
12723
  //Object.assign(this, item) to support IE11
12711
12724
  if (!!innerItem) {
@@ -13662,7 +13675,13 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13662
13675
  Object.defineProperty(SurveyElementCore.prototype, "isPage", {
13663
13676
  /**
13664
13677
  * Returns `true` if the survey element is a page.
13665
- * @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.
13666
13685
  */
13667
13686
  get: function () { return false; },
13668
13687
  enumerable: false,
@@ -13670,8 +13689,14 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13670
13689
  });
13671
13690
  Object.defineProperty(SurveyElementCore.prototype, "isPanel", {
13672
13691
  /**
13673
- * Returns `true` if the survey element is a panel.
13674
- * @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.
13675
13700
  */
13676
13701
  get: function () { return false; },
13677
13702
  enumerable: false,
@@ -13680,7 +13705,6 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13680
13705
  Object.defineProperty(SurveyElementCore.prototype, "isQuestion", {
13681
13706
  /**
13682
13707
  * Returns `true` if the survey element is a question.
13683
- * @see Base.getType
13684
13708
  */
13685
13709
  get: function () { return false; },
13686
13710
  enumerable: false,
@@ -13689,7 +13713,6 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
13689
13713
  Object.defineProperty(SurveyElementCore.prototype, "isSurvey", {
13690
13714
  /**
13691
13715
  * Returns `true` if the element is a survey.
13692
- * @see Base.getType
13693
13716
  */
13694
13717
  get: function () { return false; },
13695
13718
  enumerable: false,
@@ -14704,7 +14727,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14704
14727
  SurveyElement.prototype.getPage = function (parent) {
14705
14728
  while (parent && parent.parent)
14706
14729
  parent = parent.parent;
14707
- if (parent && parent.getType() == "page")
14730
+ if (parent && parent.isPage)
14708
14731
  return parent;
14709
14732
  return null;
14710
14733
  };
@@ -14756,7 +14779,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14756
14779
  });
14757
14780
  Object.defineProperty(SurveyElement.prototype, "hasParent", {
14758
14781
  get: function () {
14759
- return (this.parent && !this.parent.isPage && (!this.parent.originalPage)) || (this.parent === undefined);
14782
+ return (this.parent && !this.parent.isPage) || (this.parent === undefined);
14760
14783
  },
14761
14784
  enumerable: false,
14762
14785
  configurable: true
@@ -15016,6 +15039,8 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
15016
15039
  return null;
15017
15040
  };
15018
15041
  SurveyElement.prototype.getCssTitle = function (cssClasses) {
15042
+ if (!cssClasses)
15043
+ return "";
15019
15044
  var isExpandable = this.state !== "default";
15020
15045
  var numInlineLimit = 4;
15021
15046
  return new CssClassBuilder()
@@ -15915,18 +15940,18 @@ function confirmAction(message) {
15915
15940
  return settings.confirmActionFunc(message);
15916
15941
  return confirm(message);
15917
15942
  }
15918
- function confirmActionAsync(message, funcOnYes, funcOnNo, locale, rootElement) {
15943
+ function confirmActionAsync(options) {
15919
15944
  var callbackFunc = function (res) {
15920
15945
  if (res)
15921
- funcOnYes();
15922
- else if (!!funcOnNo)
15923
- funcOnNo();
15946
+ options.funcOnYes();
15947
+ else if (!!options.funcOnNo)
15948
+ options.funcOnNo();
15924
15949
  };
15925
15950
  if (!!settings && !!settings.confirmActionAsync) {
15926
- if (settings.confirmActionAsync(message, callbackFunc, undefined, locale, rootElement))
15951
+ if (settings.confirmActionAsync(options.message, callbackFunc, options))
15927
15952
  return;
15928
15953
  }
15929
- callbackFunc(confirmAction(message));
15954
+ callbackFunc(confirmAction(options.message));
15930
15955
  }
15931
15956
  function detectIEBrowser() {
15932
15957
  var ua = navigator.userAgent;
@@ -16462,7 +16487,7 @@ var Logger = /** @class */ (function () {
16462
16487
  return Logger;
16463
16488
  }());
16464
16489
 
16465
- function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
16490
+ function showConfirmDialog(message, callback, options) {
16466
16491
  var locStr = new localizablestring_LocalizableString(undefined);
16467
16492
  var popupViewModel = settings.showDialog({
16468
16493
  componentName: "sv-string-viewer",
@@ -16475,17 +16500,17 @@ function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
16475
16500
  callback(false);
16476
16501
  return false;
16477
16502
  },
16478
- title: message,
16503
+ title: message || options.message,
16479
16504
  displayMode: "popup",
16480
16505
  isFocusedContent: false,
16481
- cssClass: "sv-popup--confirm-delete"
16482
- }, rootElement);
16506
+ cssClass: options.cssClass || "sv-popup--confirm"
16507
+ }, options.rootElement);
16483
16508
  var toolbar = popupViewModel.footerToolbar;
16484
16509
  var applyBtn = toolbar.getActionById("apply");
16485
16510
  var cancelBtn = toolbar.getActionById("cancel");
16486
- cancelBtn.title = getLocaleString("cancel", locale);
16511
+ cancelBtn.title = getLocaleString("cancel", options.locale);
16487
16512
  cancelBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sd-btn sd-btn--small";
16488
- applyBtn.title = applyTitle || getLocaleString("ok", locale);
16513
+ applyBtn.title = options.applyTitle || getLocaleString("ok", options.locale);
16489
16514
  applyBtn.innerCss = "sv-popup__body-footer-item sv-popup__button sv-popup__button--danger sd-btn sd-btn--small sd-btn--danger";
16490
16515
  configConfirmDialog(popupViewModel);
16491
16516
  return true;
@@ -17102,8 +17127,8 @@ var settings = {
17102
17127
  * @param message A message to be displayed in the confirm dialog window.
17103
17128
  * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.
17104
17129
  */
17105
- confirmActionAsync: function (message, callback, applyTitle, locale, rootElement) {
17106
- return showConfirmDialog(message, callback, applyTitle, locale, rootElement);
17130
+ confirmActionAsync: function (message, callback, options) {
17131
+ return showConfirmDialog(message, callback, options);
17107
17132
  },
17108
17133
  /**
17109
17134
  * A minimum width value for all survey elements.
@@ -31424,10 +31449,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
31424
31449
  if (isDeletingValue) {
31425
31450
  delete rowValue[columnName];
31426
31451
  }
31427
- for (var i = 0; i < row.cells.length; i++) {
31428
- var key = row.cells[i].question.getValueName();
31429
- delete rowValue[key];
31430
- }
31452
+ row.questions.forEach(function (q) {
31453
+ delete rowValue[q.getValueName()];
31454
+ });
31431
31455
  if (newRowValue) {
31432
31456
  newRowValue = JSON.parse(JSON.stringify(newRowValue));
31433
31457
  for (var key in newRowValue) {
@@ -33518,10 +33542,16 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
33518
33542
  confirmDelete = this.isRequireConfirmOnRowDelete(index);
33519
33543
  }
33520
33544
  if (confirmDelete) {
33521
- confirmActionAsync(this.confirmDeleteText, function () {
33522
- _this.removeRowAsync(index, row);
33523
- onRowRemoved && onRowRemoved();
33524
- }, 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
+ });
33525
33555
  return;
33526
33556
  }
33527
33557
  this.removeRowAsync(index, row);
@@ -34247,7 +34277,8 @@ var defaultV2Css = {
34247
34277
  noPointerEventsMode: "sd-question--no-pointer-events",
34248
34278
  errorsContainer: "sd-element__erbox sd-question__erbox",
34249
34279
  errorsContainerTop: "sd-element__erbox--above-element sd-question__erbox--above-question",
34250
- errorsContainerBottom: "sd-question__erbox--below-question"
34280
+ errorsContainerBottom: "sd-question__erbox--below-question",
34281
+ confirmDialog: "sd-popup--confirm sv-popup--confirm"
34251
34282
  },
34252
34283
  image: {
34253
34284
  mainRoot: "sd-question sd-question--image",
@@ -36180,7 +36211,6 @@ var panel_spreadArray = (undefined && undefined.__spreadArray) || function (to,
36180
36211
 
36181
36212
 
36182
36213
 
36183
-
36184
36214
  var panel_QuestionRowModel = /** @class */ (function (_super) {
36185
36215
  panel_extends(QuestionRowModel, _super);
36186
36216
  function QuestionRowModel(panel) {
@@ -36783,9 +36813,14 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36783
36813
  });
36784
36814
  Object.defineProperty(PanelModelBase.prototype, "parent", {
36785
36815
  /**
36786
- * 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:
36819
+ *
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).
36787
36822
  *
36788
- * This property is always `null` for the `PageModel` object.
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.
36789
36824
  */
36790
36825
  get: function () {
36791
36826
  return this.getPropertyValue("parent", null);
@@ -36868,10 +36903,6 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36868
36903
  configurable: true
36869
36904
  });
36870
36905
  Object.defineProperty(PanelModelBase.prototype, "isPanel", {
36871
- /**
36872
- * Returns `true` if the survey element is a panel.
36873
- * @see Base.getType
36874
- */
36875
36906
  get: function () {
36876
36907
  return false;
36877
36908
  },
@@ -37613,11 +37644,11 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37613
37644
  PanelModelBase.prototype.updateRows = function () {
37614
37645
  if (this.isLoadingFromJson)
37615
37646
  return;
37616
- for (var i = 0; i < this.elements.length; i++) {
37617
- if (this.elements[i].isPanel) {
37618
- this.elements[i].updateRows();
37647
+ this.getElementsForRows().forEach(function (el) {
37648
+ if (el.isPanel) {
37649
+ el.updateRows();
37619
37650
  }
37620
- }
37651
+ });
37621
37652
  this.onRowsChanged();
37622
37653
  };
37623
37654
  Object.defineProperty(PanelModelBase.prototype, "rows", {
@@ -37726,7 +37757,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37726
37757
  var _this = this;
37727
37758
  var survey = this.survey;
37728
37759
  var fireNotification = this.canFireAddRemoveNotifications(element);
37729
- element.setSurveyImpl(this.surveyImpl);
37760
+ if (!!this.surveyImpl) {
37761
+ element.setSurveyImpl(this.surveyImpl);
37762
+ }
37730
37763
  element.parent = this;
37731
37764
  this.markQuestionListDirty();
37732
37765
  if (this.canBuildRows()) {
@@ -37752,8 +37785,8 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37752
37785
  };
37753
37786
  PanelModelBase.prototype.onRemoveElement = function (element) {
37754
37787
  element.parent = null;
37788
+ this.unregisterElementPropertiesChanged(element);
37755
37789
  this.markQuestionListDirty();
37756
- element.unregisterPropertyChangedHandlers(["visible", "isVisible", "startWithNewLine"], this.id);
37757
37790
  this.updateRowsOnElementRemoved(element);
37758
37791
  if (this.isRandomizing)
37759
37792
  return;
@@ -37762,6 +37795,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37762
37795
  this.removeElementCallback(element);
37763
37796
  this.onElementVisibilityChanged(this);
37764
37797
  };
37798
+ PanelModelBase.prototype.unregisterElementPropertiesChanged = function (element) {
37799
+ element.unregisterPropertyChangedHandlers(["visible", "isVisible", "startWithNewLine"], this.id);
37800
+ };
37765
37801
  PanelModelBase.prototype.onRemoveElementNotifySurvey = function (element) {
37766
37802
  if (!this.canFireAddRemoveNotifications(element))
37767
37803
  return;
@@ -37806,19 +37842,21 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37806
37842
  PanelModelBase.prototype.buildRows = function () {
37807
37843
  if (!this.canBuildRows())
37808
37844
  return [];
37809
- var result = new Array();
37810
- for (var i = 0; i < this.elements.length; i++) {
37811
- 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];
37812
37849
  var isNewRow = i == 0 || el.startWithNewLine;
37813
- var row = isNewRow ? this.createRowAndSetLazy(result.length) : result[result.length - 1];
37850
+ var row = isNewRow ? this.createRowAndSetLazy(res.length) : res[res.length - 1];
37814
37851
  if (isNewRow)
37815
- result.push(row);
37852
+ res.push(row);
37816
37853
  row.addElement(el);
37817
37854
  }
37818
- for (var i = 0; i < result.length; i++) {
37819
- result[i].updateVisible();
37820
- }
37821
- return result;
37855
+ res.forEach(function (row) { return row.updateVisible(); });
37856
+ return res;
37857
+ };
37858
+ PanelModelBase.prototype.getElementsForRows = function () {
37859
+ return this.elements;
37822
37860
  };
37823
37861
  PanelModelBase.prototype.getDragDropInfo = function () {
37824
37862
  var page = this.getPage(this.parent);
@@ -38381,10 +38419,13 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
38381
38419
  }
38382
38420
  this.rows.splice(0, this.rows.length);
38383
38421
  }
38422
+ this.disposeElements();
38423
+ this.elements.splice(0, this.elements.length);
38424
+ };
38425
+ PanelModelBase.prototype.disposeElements = function () {
38384
38426
  for (var i = 0; i < this.elements.length; i++) {
38385
38427
  this.elements[i].dispose();
38386
38428
  }
38387
- this.elements.splice(0, this.elements.length);
38388
38429
  };
38389
38430
  PanelModelBase.panelCounter = 100;
38390
38431
  panel_decorate([
@@ -38437,7 +38478,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38437
38478
  });
38438
38479
  PanelModel.prototype.getSurvey = function (live) {
38439
38480
  if (live === void 0) { live = false; }
38440
- if (live) {
38481
+ if (live && this.isPanel) {
38441
38482
  return !!this.parent ? this.parent.getSurvey(live) : null;
38442
38483
  }
38443
38484
  return _super.prototype.getSurvey.call(this, live);
@@ -38588,6 +38629,8 @@ var panel_PanelModel = /** @class */ (function (_super) {
38588
38629
  return locTitleValue;
38589
38630
  };
38590
38631
  PanelModel.prototype.beforeSetVisibleIndex = function (index) {
38632
+ if (this.isPage)
38633
+ return _super.prototype.beforeSetVisibleIndex.call(this, index);
38591
38634
  var visibleIndex = -1;
38592
38635
  if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty || this.hasParentInQuestionIndex())) {
38593
38636
  visibleIndex = index;
@@ -38619,7 +38662,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38619
38662
  }
38620
38663
  };
38621
38664
  PanelModel.prototype.getRenderedTitle = function (str) {
38622
- if (!str) {
38665
+ if (this.isPanel && !str) {
38623
38666
  if (this.isCollapsed || this.isExpanded)
38624
38667
  return this.name;
38625
38668
  if (this.isDesignMode)
@@ -38744,11 +38787,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38744
38787
  return this.footerToolbarValue;
38745
38788
  };
38746
38789
  Object.defineProperty(PanelModel.prototype, "hasEditButton", {
38747
- get: function () {
38748
- if (this.survey && this.survey.state === "preview")
38749
- return (this.parent && this.parent instanceof page_PageModel);
38750
- return false;
38751
- },
38790
+ get: function () { return false; },
38752
38791
  enumerable: false,
38753
38792
  configurable: true
38754
38793
  });
@@ -38757,19 +38796,16 @@ var panel_PanelModel = /** @class */ (function (_super) {
38757
38796
  return;
38758
38797
  this.survey.cancelPreviewByPage(this);
38759
38798
  };
38760
- PanelModel.prototype.canShowTitle = function (survey) {
38761
- var page = this.originalPage;
38762
- if (!!page)
38763
- return page.canShowTitle(survey);
38764
- return _super.prototype.canShowTitle.call(this, survey);
38765
- };
38766
38799
  Object.defineProperty(PanelModel.prototype, "cssTitle", {
38767
38800
  get: function () {
38768
- return this.getCssTitle(this.cssClasses.panel);
38801
+ return this.getCssPanelTitle();
38769
38802
  },
38770
38803
  enumerable: false,
38771
38804
  configurable: true
38772
38805
  });
38806
+ PanelModel.prototype.getCssPanelTitle = function () {
38807
+ return this.getCssTitle(this.cssClasses.panel);
38808
+ };
38773
38809
  PanelModel.prototype.getCssTitleExpandableSvg = function () {
38774
38810
  if (this.state === "default")
38775
38811
  return null;
@@ -38783,6 +38819,8 @@ var panel_PanelModel = /** @class */ (function (_super) {
38783
38819
  configurable: true
38784
38820
  });
38785
38821
  PanelModel.prototype.getCssError = function (cssClasses) {
38822
+ if (this.isPage)
38823
+ return _super.prototype.getCssError.call(this, cssClasses);
38786
38824
  var builder = new CssClassBuilder()
38787
38825
  .append(_super.prototype.getCssError.call(this, cssClasses))
38788
38826
  .append(cssClasses.panel.errorsContainer);
@@ -38813,10 +38851,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38813
38851
  };
38814
38852
  Object.defineProperty(PanelModel.prototype, "showPanelAsPage", {
38815
38853
  get: function () {
38816
- var panel = this;
38817
- if (!!panel.originalPage)
38818
- return true;
38819
- return panel.survey.isShowingPreview && panel.survey.isSinglePage && !!panel.parent && !!panel.parent.originalPage;
38854
+ return false;
38820
38855
  },
38821
38856
  enumerable: false,
38822
38857
  configurable: true
@@ -38856,7 +38891,9 @@ var panel_PanelModel = /** @class */ (function (_super) {
38856
38891
  PanelModel.prototype.afterRenderCore = function (element) {
38857
38892
  var _a;
38858
38893
  _super.prototype.afterRenderCore.call(this, element);
38859
- (_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
+ }
38860
38897
  };
38861
38898
  return PanelModel;
38862
38899
  }(panel_PanelModelBase));
@@ -38904,27 +38941,17 @@ Serializer.addClass("panelbase", [
38904
38941
  return new panel_PanelModelBase();
38905
38942
  });
38906
38943
  Serializer.addClass("panel", [
38907
- {
38908
- name: "state",
38909
- default: "default",
38910
- choices: ["default", "collapsed", "expanded"],
38911
- },
38944
+ { name: "state", default: "default", choices: ["default", "collapsed", "expanded"] },
38912
38945
  { name: "isRequired:switch", overridingProperty: "requiredIf" },
38913
- {
38914
- name: "requiredErrorText:text",
38915
- serializationProperty: "locRequiredErrorText",
38916
- },
38946
+ { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" },
38917
38947
  { name: "startWithNewLine:boolean", default: true },
38918
- "width",
38948
+ { name: "width" },
38919
38949
  { name: "minWidth", defaultFunc: function () { return "auto"; } },
38920
38950
  { name: "maxWidth", defaultFunc: function () { return settings.maxWidth; } },
38921
- {
38922
- name: "colSpan:number", visible: false,
38923
- onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); },
38924
- },
38951
+ { name: "colSpan:number", visible: false, onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); } },
38925
38952
  {
38926
38953
  name: "effectiveColSpan:number", minValue: 1, isSerializable: false,
38927
- visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
38954
+ visibleIf: function (obj) { return !!obj.survey && obj.survey.gridLayoutEnabled; }
38928
38955
  },
38929
38956
  { name: "innerIndent:number", default: 0, choices: [0, 1, 2, 3] },
38930
38957
  { name: "indent:number", default: 0, choices: [0, 1, 2, 3], visible: false },
@@ -38944,13 +38971,9 @@ Serializer.addClass("panel", [
38944
38971
  : [];
38945
38972
  },
38946
38973
  },
38947
- "showNumber:boolean",
38948
- {
38949
- name: "showQuestionNumbers",
38950
- default: "default",
38951
- choices: ["default", "onpanel", "off"],
38952
- },
38953
- "questionStartIndex",
38974
+ { name: "showNumber:boolean" },
38975
+ { name: "showQuestionNumbers", default: "default", choices: ["default", "onpanel", "off"] },
38976
+ { name: "questionStartIndex", visibleIf: function (obj) { return obj.isPanel; } },
38954
38977
  { name: "allowAdaptiveActions:boolean", default: true, visible: false },
38955
38978
  ], function () {
38956
38979
  return new panel_PanelModel();
@@ -39226,12 +39249,61 @@ var page_PageModel = /** @class */ (function (_super) {
39226
39249
  return this.name;
39227
39250
  };
39228
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", {
39229
39266
  get: function () {
39230
39267
  return true;
39231
39268
  },
39232
39269
  enumerable: false,
39233
39270
  configurable: true
39234
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
+ };
39235
39307
  Object.defineProperty(PageModel.prototype, "no", {
39236
39308
  get: function () {
39237
39309
  if (!this.canShowPageNumber() || !this.survey)
@@ -39369,6 +39441,8 @@ var page_PageModel = /** @class */ (function (_super) {
39369
39441
  configurable: true
39370
39442
  });
39371
39443
  PageModel.prototype.calcCssClasses = function (css) {
39444
+ if (this.isPanel)
39445
+ return _super.prototype.calcCssClasses.call(this, css);
39372
39446
  var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "", rowEnter: "", rowLeave: "", rowDelayedEnter: "", rowReplace: "" };
39373
39447
  this.copyCssClasses(classes.page, css.page);
39374
39448
  this.copyCssClasses(classes.error, css.error);
@@ -39407,20 +39481,18 @@ var page_PageModel = /** @class */ (function (_super) {
39407
39481
  }
39408
39482
  return classes;
39409
39483
  };
39410
- Object.defineProperty(PageModel.prototype, "cssTitle", {
39411
- get: function () {
39412
- if (!this.cssClasses.page)
39413
- return "";
39414
- return new CssClassBuilder()
39415
- .append(this.cssClasses.page.title)
39416
- .toString();
39417
- },
39418
- enumerable: false,
39419
- configurable: true
39420
- });
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
+ };
39421
39493
  Object.defineProperty(PageModel.prototype, "cssRoot", {
39422
39494
  get: function () {
39423
- if (!this.cssClasses.page || !this.survey)
39495
+ if (this.isPanel || !this.cssClasses.page || !this.survey)
39424
39496
  return "";
39425
39497
  return new CssClassBuilder()
39426
39498
  .append(this.cssClasses.page.root)
@@ -39432,6 +39504,8 @@ var page_PageModel = /** @class */ (function (_super) {
39432
39504
  configurable: true
39433
39505
  });
39434
39506
  PageModel.prototype.getCssError = function (cssClasses) {
39507
+ if (this.isPanel)
39508
+ return _super.prototype.getCssError.call(this, cssClasses);
39435
39509
  return new CssClassBuilder()
39436
39510
  .append(_super.prototype.getCssError.call(this, cssClasses))
39437
39511
  .append(cssClasses.page.errorsContainer).toString();
@@ -39608,7 +39682,7 @@ var page_PageModel = /** @class */ (function (_super) {
39608
39682
  jsonobject_property({ defaultValue: -1, onSet: function (val, target) { return target.onNumChanged(val); } })
39609
39683
  ], PageModel.prototype, "num", void 0);
39610
39684
  return PageModel;
39611
- }(panel_PanelModelBase));
39685
+ }(panel_PanelModel));
39612
39686
 
39613
39687
  Serializer.addClass("page", [
39614
39688
  {
@@ -39633,9 +39707,25 @@ Serializer.addClass("page", [
39633
39707
  },
39634
39708
  { name: "title:text", serializationProperty: "locTitle" },
39635
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 },
39636
39726
  ], function () {
39637
39727
  return new page_PageModel();
39638
- }, "panelbase");
39728
+ }, "panel");
39639
39729
 
39640
39730
  // CONCATENATED MODULE: ./packages/survey-core/src/progress-buttons.ts
39641
39731
  var progress_buttons_extends = (undefined && undefined.__extends) || (function () {
@@ -39877,16 +39967,27 @@ var ProgressButtonsResponsivityManager = /** @class */ (function () {
39877
39967
 
39878
39968
 
39879
39969
 
39880
-
39881
39970
  function tryFocusPage(survey, panel) {
39882
39971
  if (survey.isDesignMode)
39883
39972
  return true;
39884
39973
  panel.focusFirstQuestion();
39885
39974
  return true;
39886
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
+ }
39887
39989
  function createTOCListModel(survey, onAction) {
39888
39990
  var items = getTOCItems(survey, onAction);
39889
- var selectedItem = items.filter(function (i) { return !!survey.currentPage && i.id === survey.currentPage.name; })[0] || items[0];
39890
39991
  var listOptions = {
39891
39992
  items: items,
39892
39993
  onSelectionChanged: function (item) {
@@ -39894,15 +39995,20 @@ function createTOCListModel(survey, onAction) {
39894
39995
  listModel.selectedItem = item;
39895
39996
  }
39896
39997
  },
39897
- allowSelection: true,
39898
39998
  searchEnabled: false,
39899
39999
  locOwner: survey,
39900
- selectedItem: selectedItem
39901
40000
  };
39902
40001
  var listModel = new list_ListModel(listOptions);
39903
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]);
39904
40007
  survey.onCurrentPageChanged.add(function (s, o) {
39905
- 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));
39906
40012
  });
39907
40013
  survey.registerFunctionOnPropertyValueChanged("pages", function () {
39908
40014
  listModel.setItems(getTOCItems(survey, onAction));
@@ -39910,8 +40016,7 @@ function createTOCListModel(survey, onAction) {
39910
40016
  return listModel;
39911
40017
  }
39912
40018
  function getTOCItems(survey, onAction) {
39913
- var _a;
39914
- var pagesSource = survey.questionsOnPageMode === "singlePage" ? (_a = survey.pages[0]) === null || _a === void 0 ? void 0 : _a.elements : survey.pages;
40019
+ var pagesSource = survey.pages;
39915
40020
  var items = (pagesSource || []).map(function (page) {
39916
40021
  return new action_Action({
39917
40022
  id: page.name,
@@ -39919,7 +40024,7 @@ function getTOCItems(survey, onAction) {
39919
40024
  action: function () {
39920
40025
  DomDocumentHelper.activeElementBlur();
39921
40026
  !!onAction && onAction();
39922
- if (page instanceof page_PageModel) {
40027
+ if (page.isPage) {
39923
40028
  return survey.tryNavigateToPage(page);
39924
40029
  }
39925
40030
  return tryFocusPage(survey, page);
@@ -43632,6 +43737,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43632
43737
  get: function () {
43633
43738
  if (this.isDesignMode)
43634
43739
  return this.pages;
43740
+ if (!!this.pageContainerValue && (this.isShowingPreview || this.isSinglePage))
43741
+ return [this.pageContainerValue];
43635
43742
  var result = new Array();
43636
43743
  for (var i = 0; i < this.pages.length; i++) {
43637
43744
  if (this.isPageInVisibleList(this.pages[i])) {
@@ -43765,7 +43872,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43765
43872
  return false;
43766
43873
  if (index === this.currentPageNo)
43767
43874
  return false;
43768
- if (index < this.currentPageNo || this.isValidateOnComplete) {
43875
+ if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages) {
43769
43876
  this.currentPageNo = index;
43770
43877
  return true;
43771
43878
  }
@@ -44097,6 +44204,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44097
44204
  this.onFirstPageIsStartedChanged();
44098
44205
  if (goToFirstPage) {
44099
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
+ }
44100
44211
  }
44101
44212
  if (clearData) {
44102
44213
  this.updateValuesWithDefaults();
@@ -44134,7 +44245,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44134
44245
  SurveyModel.prototype.currentPageChanged = function (newValue, oldValue) {
44135
44246
  this.notifyQuestionsOnHidingContent(oldValue);
44136
44247
  var options = this.createPageChangeEventOptions(newValue, oldValue);
44137
- if (oldValue && !oldValue.passed) {
44248
+ if (oldValue && !oldValue.isDisposed && !oldValue.passed) {
44138
44249
  if (oldValue.validate(false)) {
44139
44250
  oldValue.passed = true;
44140
44251
  }
@@ -44145,9 +44256,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44145
44256
  this.onCurrentPageChanged.fire(this, options);
44146
44257
  };
44147
44258
  SurveyModel.prototype.notifyQuestionsOnHidingContent = function (page) {
44148
- if (!page)
44149
- return;
44150
- page.questions.forEach(function (q) { return q.onHidingContent(); });
44259
+ if (page && !page.isDisposed) {
44260
+ page.questions.forEach(function (q) { return q.onHidingContent(); });
44261
+ }
44151
44262
  };
44152
44263
  SurveyModel.prototype.createPageChangeEventOptions = function (newValue, oldValue) {
44153
44264
  var diff = !!newValue && !!oldValue ? newValue.visibleIndex - oldValue.visibleIndex : 0;
@@ -44383,6 +44494,30 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44383
44494
  return false;
44384
44495
  return this.doCurrentPageComplete(false);
44385
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
+ };
44386
44521
  SurveyModel.prototype.hasErrorsOnNavigate = function (doComplete) {
44387
44522
  var _this = this;
44388
44523
  if (!this.isEditMode || this.ignoreValidation)
@@ -44712,9 +44847,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44712
44847
  };
44713
44848
  SurveyModel.prototype.nextPageUIClick = function () {
44714
44849
  if (!!this.mouseDownPage && this.mouseDownPage !== this.activePage)
44715
- return;
44850
+ return false;
44716
44851
  this.mouseDownPage = null;
44717
- return this.nextPage();
44852
+ return this.performNext();
44718
44853
  };
44719
44854
  SurveyModel.prototype.nextPageMouseDown = function () {
44720
44855
  this.mouseDownPage = this.activePage;
@@ -44758,7 +44893,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44758
44893
  this.isShowingPreview = false;
44759
44894
  };
44760
44895
  SurveyModel.prototype.cancelPreviewByPage = function (panel) {
44761
- this.cancelPreview(panel["originalPage"]);
44896
+ this.cancelPreview(panel);
44762
44897
  };
44763
44898
  SurveyModel.prototype.doCurrentPageComplete = function (doComplete) {
44764
44899
  if (this.isValidatingOnServer)
@@ -44788,6 +44923,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44788
44923
  enumerable: false,
44789
44924
  configurable: true
44790
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
+ };
44791
44936
  Object.defineProperty(SurveyModel.prototype, "questionsOnPageMode", {
44792
44937
  /**
44793
44938
  * Specifies how to distribute survey elements between pages.
@@ -44863,25 +45008,54 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44863
45008
  this.pageVisibilityChanged(this.pages[0], !this.isStartedState);
44864
45009
  };
44865
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 () {
44866
45032
  if (this.isDesignMode)
44867
45033
  return;
44868
- if (this.isShowingPreview) {
44869
- this.runningPages = this.pages.slice(0, this.pages.length);
44870
- this.setupPagesForPageModes(true, false);
44871
- }
44872
- else {
44873
- if (this.runningPages) {
44874
- 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);
44875
45047
  }
44876
- this.runningPages = undefined;
44877
45048
  }
44878
- this.runConditions();
44879
- this.updateAllElementsVisibility(this.pages);
44880
- this.updateVisibleIndexes();
44881
45049
  if (this.isShowingPreview) {
44882
- this.currentPageNo = 0;
45050
+ rootPage = this.createRootPage(previewName, rootPage ? [rootPage] : this.pages);
44883
45051
  }
44884
- 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();
44885
45059
  var curPage = this.gotoPageFromPreview;
44886
45060
  this.gotoPageFromPreview = null;
44887
45061
  if (helpers_Helpers.isValueEmpty(curPage) && this.visiblePageCount > 0) {
@@ -44893,110 +45067,62 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44893
45067
  this.changeCurrentPageFromPreview = false;
44894
45068
  }
44895
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();
44896
45079
  };
44897
- SurveyModel.prototype.onQuestionsOnPageModeChanged = function (oldValue, isFirstLoad) {
44898
- 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) {
44899
45107
  if (this.isShowingPreview)
44900
45108
  return;
44901
- if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
44902
- if (this.originalPages) {
44903
- this.restoreOriginalPages(this.originalPages);
44904
- }
44905
- this.originalPages = undefined;
45109
+ this.currentSingleQuestion = undefined;
45110
+ if (oldValue === "singlePage") {
45111
+ this.updatePagesContainer();
44906
45112
  }
44907
- else {
44908
- if (!oldValue || oldValue == "standard") {
44909
- this.originalPages = this.pages.slice(0, this.pages.length);
44910
- }
44911
- this.setupPagesForPageModes(this.isSinglePage, isFirstLoad);
45113
+ if (this.isSinglePage) {
45114
+ this.updatePagesContainer();
44912
45115
  }
44913
- this.runConditions();
44914
- this.updateVisibleIndexes();
44915
- };
44916
- SurveyModel.prototype.restoreOriginalPages = function (originalPages) {
44917
- this.questionHashesClear();
44918
- this.pages.splice(0, this.pages.length);
44919
- for (var i = 0; i < originalPages.length; i++) {
44920
- var page = originalPages[i];
44921
- page.setWasShown(false);
44922
- 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
+ }
44923
45121
  }
44924
45122
  };
44925
45123
  SurveyModel.prototype.getPageStartIndex = function () {
44926
45124
  return this.firstPageIsStarted && this.pages.length > 0 ? 1 : 0;
44927
45125
  };
44928
- SurveyModel.prototype.setupPagesForPageModes = function (isSinglePage, isFirstLoad) {
44929
- var _this = this;
44930
- this.questionHashesClear();
44931
- if (this.firstPageIsStarted && this.pages.length > 0) {
44932
- this.pages[0].questions.forEach(function (q) { return _this.questionHashesAdded(q); });
44933
- }
44934
- this.isLockingUpdateOnPageModes = !isFirstLoad;
44935
- var startIndex = this.getPageStartIndex();
44936
- _super.prototype.startLoadingFromJson.call(this);
44937
- var newPages = this.createPagesForQuestionOnPageMode(isSinglePage, startIndex);
44938
- var deletedLen = this.pages.length - startIndex;
44939
- this.pages.splice(startIndex, deletedLen);
44940
- for (var i = 0; i < newPages.length; i++) {
44941
- this.pages.push(newPages[i]);
44942
- }
44943
- _super.prototype.endLoadingFromJson.call(this);
44944
- for (var i = 0; i < newPages.length; i++) {
44945
- newPages[i].setSurveyImpl(this, true);
44946
- }
44947
- this.doElementsOnLoad();
44948
- this.updateCurrentPage();
44949
- this.isLockingUpdateOnPageModes = false;
44950
- };
44951
- SurveyModel.prototype.createPagesForQuestionOnPageMode = function (isSinglePage, startIndex) {
44952
- if (isSinglePage) {
44953
- return [this.createSinglePage(startIndex)];
44954
- }
44955
- return this.createPagesForEveryQuestion(startIndex);
44956
- };
44957
- SurveyModel.prototype.createSinglePage = function (startIndex) {
44958
- var single = this.createNewPage("all");
44959
- single.setSurveyImpl(this);
44960
- for (var i = startIndex; i < this.pages.length; i++) {
44961
- var page = this.pages[i];
44962
- var panel = Serializer.createClass("panel");
44963
- panel.originalPage = page;
44964
- single.addPanel(panel);
44965
- var json = new jsonobject_JsonObject().toJsonObject(page);
44966
- new jsonobject_JsonObject().toObject(json, panel);
44967
- }
44968
- return single;
44969
- };
44970
- SurveyModel.prototype.createPagesForEveryQuestion = function (startIndex) {
44971
- var res = [];
44972
- for (var i = startIndex; i < this.pages.length; i++) {
44973
- var originalPage = this.pages[i];
44974
- // Initialize randomization
44975
- originalPage.setWasShown(true);
44976
- for (var j = 0; j < originalPage.elements.length; j++) {
44977
- var originalElement = originalPage.elements[j];
44978
- var element = Serializer.createClass(originalElement.getType());
44979
- if (!element)
44980
- continue;
44981
- var jsonObj = new jsonobject_JsonObject();
44982
- //Deserialize page properties only, excluding elements
44983
- jsonObj.lightSerializing = true;
44984
- var pageJson = jsonObj.toJsonObject(originalPage);
44985
- var page = Serializer.createClass(originalPage.getType());
44986
- page.fromJSON(pageJson);
44987
- page.name = originalElement.name;
44988
- page.setSurveyImpl(this);
44989
- res.push(page);
44990
- var json = new jsonobject_JsonObject().toJsonObject(originalElement);
44991
- page.addElement(element);
44992
- new jsonobject_JsonObject().toObject(json, element);
44993
- for (var k = 0; k < page.questions.length; k++) {
44994
- this.questionHashesAdded(page.questions[k]);
44995
- }
44996
- }
44997
- }
44998
- return res;
44999
- };
45000
45126
  Object.defineProperty(SurveyModel.prototype, "isFirstPage", {
45001
45127
  /**
45002
45128
  * Indicates whether the [current page](#currentPage) is the first page.
@@ -45062,30 +45188,73 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45062
45188
  enumerable: false,
45063
45189
  configurable: true
45064
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
+ });
45065
45205
  SurveyModel.prototype.updateIsFirstLastPageState = function () {
45066
45206
  var curPage = this.currentPage;
45067
45207
  this.setPropertyValue("isFirstPage", !!curPage && curPage === this.firstVisiblePage);
45068
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);
45069
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
+ });
45070
45237
  SurveyModel.prototype.calcIsShowPrevButton = function () {
45071
- if (this.isFirstPage || !this.showPrevButton || this.state !== "running")
45238
+ if (this.isFirstPageOrElement || !this.showPrevButton || this.state !== "running")
45072
45239
  return false;
45240
+ if (this.isFirstElement !== undefined)
45241
+ return true;
45073
45242
  var page = this.visiblePages[this.currentPageNo - 1];
45074
45243
  return page && page.getMaxTimeToFinish() <= 0;
45075
45244
  };
45076
45245
  SurveyModel.prototype.calcIsShowNextButton = function () {
45077
- return this.state === "running" && !this.isLastPage && !this.canBeCompletedByTrigger;
45246
+ return this.state === "running" && !this.isLastPageOrElement && !this.canBeCompletedByTrigger;
45078
45247
  };
45079
45248
  SurveyModel.prototype.calcIsCompleteButtonVisible = function () {
45080
45249
  var state = this.state;
45081
45250
  return this.isEditMode && (this.state === "running" &&
45082
- (this.isLastPage && !this.isShowPreviewBeforeComplete || this.canBeCompletedByTrigger)
45251
+ (this.isLastPageOrElement && !this.isShowPreviewBeforeComplete || this.canBeCompletedByTrigger)
45083
45252
  || state === "preview") && this.showCompleteButton;
45084
45253
  };
45085
45254
  SurveyModel.prototype.calcIsPreviewButtonVisible = function () {
45086
45255
  return (this.isEditMode &&
45087
45256
  this.isShowPreviewBeforeComplete &&
45088
- this.state == "running" && this.isLastPage);
45257
+ this.state == "running" && this.isLastPageOrElement);
45089
45258
  };
45090
45259
  SurveyModel.prototype.calcIsCancelPreviewButtonVisible = function () {
45091
45260
  return (this.isEditMode &&
@@ -45094,6 +45263,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45094
45263
  };
45095
45264
  Object.defineProperty(SurveyModel.prototype, "firstVisiblePage", {
45096
45265
  get: function () {
45266
+ if (this.visiblePageCount === 1)
45267
+ return this.visiblePages[0];
45097
45268
  var pages = this.pages;
45098
45269
  for (var i = 0; i < pages.length; i++) {
45099
45270
  if (this.isPageInVisibleList(pages[i]))
@@ -45106,6 +45277,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45106
45277
  });
45107
45278
  Object.defineProperty(SurveyModel.prototype, "lastVisiblePage", {
45108
45279
  get: function () {
45280
+ if (this.visiblePageCount === 1)
45281
+ return this.visiblePages[0];
45109
45282
  var pages = this.pages;
45110
45283
  for (var i = pages.length - 1; i >= 0; i--) {
45111
45284
  if (this.isPageInVisibleList(pages[i]))
@@ -45454,7 +45627,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45454
45627
  });
45455
45628
  SurveyModel.prototype.updateProgressText = function (onValueChanged) {
45456
45629
  if (onValueChanged === void 0) { onValueChanged = false; }
45457
- if (this.isCalculatingProgressText || this.isShowingPreview || this.isLockingUpdateOnPageModes)
45630
+ if (this.isCalculatingProgressText || this.isShowingPreview)
45458
45631
  return;
45459
45632
  if (onValueChanged &&
45460
45633
  this.progressBarType == "pages" &&
@@ -45565,7 +45738,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45565
45738
  width: width,
45566
45739
  };
45567
45740
  this.onResize.fire(this, options);
45568
- this.setResponsiveStartWidth(width);
45741
+ // this.setResponsiveStartWidth(width);
45569
45742
  return isMobileChanged;
45570
45743
  };
45571
45744
  SurveyModel.prototype.triggerResponsiveness = function (hard) {
@@ -46796,7 +46969,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46796
46969
  this.updateVisibleIndexes();
46797
46970
  };
46798
46971
  SurveyModel.prototype.updateVisibleIndexes = function (page) {
46799
- if (this.isLoadingFromJson || !!this.isEndLoadingFromJson || this.isLockingUpdateOnPageModes)
46972
+ if (this.isLoadingFromJson || !!this.isEndLoadingFromJson)
46800
46973
  return;
46801
46974
  if (this.isRunningConditions &&
46802
46975
  this.onQuestionVisibleChanged.isEmpty &&
@@ -46865,12 +47038,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46865
47038
  SurveyModel.prototype.endLoadingFromJson = function () {
46866
47039
  this.isEndLoadingFromJson = "processing";
46867
47040
  this.onFirstPageIsStartedChanged();
46868
- this.onQuestionsOnPageModeChanged("standard", true);
46869
47041
  _super.prototype.endLoadingFromJson.call(this);
46870
47042
  if (this.hasCookie) {
46871
47043
  this.isCompletedBefore = true;
46872
47044
  }
46873
47045
  this.doElementsOnLoad();
47046
+ this.onQuestionsOnPageModeChanged("standard");
46874
47047
  this.isEndLoadingFromJson = "conditions";
46875
47048
  this.runConditions();
46876
47049
  this.notifyElementsOnAnyValueOrVariableChanged("");
@@ -46918,7 +47091,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46918
47091
  mouseDown: function () { return _this.navigationMouseDown(); },
46919
47092
  },
46920
47093
  locTitle: this.locPagePrevText,
46921
- action: function () { return _this.prevPage(); },
47094
+ action: function () { return _this.performPrevious(); },
46922
47095
  component: defaultComponent
46923
47096
  });
46924
47097
  var navNext = new action_Action({
@@ -47198,8 +47371,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
47198
47371
  SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged, questionName) {
47199
47372
  if (locNotification === void 0) { locNotification = false; }
47200
47373
  if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
47201
- if (this.isLockingUpdateOnPageModes)
47202
- return;
47203
47374
  var newValue = newQuestionValue;
47204
47375
  if (allowNotifyValueChanged) {
47205
47376
  newValue = this.questionOnValueChanging(name, newQuestionValue);
@@ -47884,6 +48055,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
47884
48055
  if (this.isScaled && this.responsiveStartWidth > 1) {
47885
48056
  var initialWidth = this.responsiveStartWidth;
47886
48057
  try {
48058
+ width = width || this.staticStartWidth;
47887
48059
  initialWidth = !isNaN(width) ? width : parseFloat(width.toString().replace("px", ""));
47888
48060
  }
47889
48061
  catch (e) { }
@@ -47896,6 +48068,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
47896
48068
  enumerable: false,
47897
48069
  configurable: true
47898
48070
  });
48071
+ SurveyModel.prototype.setStaticStartWidth = function (width) {
48072
+ this.staticStartWidth = width;
48073
+ };
47899
48074
  SurveyModel.prototype.setResponsiveStartWidth = function (width) {
47900
48075
  this.responsiveStartWidth = width;
47901
48076
  };
@@ -48734,6 +48909,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48734
48909
  survey_decorate([
48735
48910
  jsonobject_property({ defaultValue: 100 })
48736
48911
  ], SurveyModel.prototype, "widthScale", void 0);
48912
+ survey_decorate([
48913
+ jsonobject_property()
48914
+ ], SurveyModel.prototype, "staticStartWidth", void 0);
48737
48915
  survey_decorate([
48738
48916
  jsonobject_property()
48739
48917
  ], SurveyModel.prototype, "responsiveStartWidth", void 0);
@@ -61009,7 +61187,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
61009
61187
  };
61010
61188
  _this.doClean = function () {
61011
61189
  if (_this.needConfirmRemoveFile) {
61012
- 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
+ });
61013
61197
  return;
61014
61198
  }
61015
61199
  _this.clearFilesCore();
@@ -61309,7 +61493,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
61309
61493
  if (this.previewValue.length > 0 && !this.calculatedGapBetweenItems && !this.calculatedItemWidth) {
61310
61494
  setTimeout(function () {
61311
61495
  _this.processResponsiveness(0, _this._width);
61312
- });
61496
+ }, 1);
61313
61497
  }
61314
61498
  this.prevPreviewLength = this.previewValue.length;
61315
61499
  };
@@ -62018,7 +62202,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
62018
62202
  var _this = this;
62019
62203
  event.stopPropagation();
62020
62204
  if (this.needConfirmRemoveFile) {
62021
- 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
+ });
62022
62212
  return;
62023
62213
  }
62024
62214
  this.removeFileCore(data);
@@ -68003,7 +68193,13 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68003
68193
  }
68004
68194
  };
68005
68195
  if (this.isRequireConfirmOnDelete(value)) {
68006
- 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
+ });
68007
68203
  }
68008
68204
  else {
68009
68205
  removePanel();
@@ -72144,8 +72340,8 @@ Serializer.addClass("currencymask", [
72144
72340
 
72145
72341
  var Version;
72146
72342
  var ReleaseDate;
72147
- Version = "" + "1.12.14";
72148
- ReleaseDate = "" + "2024-12-09";
72343
+ Version = "" + "1.12.16-patch.1";
72344
+ ReleaseDate = "" + "2024-12-25";
72149
72345
  function checkLibraryVersion(ver, libraryName) {
72150
72346
  if (Version != ver) {
72151
72347
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -82655,7 +82851,7 @@ var element_SurveyRowElement = /** @class */ (function (_super) {
82655
82851
  if (!this.row.isNeedRender) {
82656
82852
  return ReactElementFactory.Instance.createElement(element.skeletonComponentName, { key: element.name + index, element: element, css: this.css, });
82657
82853
  }
82658
- var elementType = element.getType();
82854
+ var elementType = element.getTemplate();
82659
82855
  if (!ReactElementFactory.Instance.isElementRegistered(elementType)) {
82660
82856
  elementType = "question";
82661
82857
  }
@@ -83391,7 +83587,7 @@ var action_bar_SurveyActionBar = /** @class */ (function (_super) {
83391
83587
  return;
83392
83588
  var container = this.rootRef.current;
83393
83589
  if (!!container) {
83394
- this.model.initResponsivityManager(container, function (callback) { setTimeout(callback); });
83590
+ this.model.initResponsivityManager(container, function (callback) { setTimeout(callback, 100); });
83395
83591
  }
83396
83592
  };
83397
83593
  SurveyActionBar.prototype.componentWillUnmount = function () {
@@ -83406,7 +83602,7 @@ var action_bar_SurveyActionBar = /** @class */ (function (_super) {
83406
83602
  if (!!this.model.hasActions) {
83407
83603
  var container = this.rootRef.current;
83408
83604
  if (!!container) {
83409
- this.model.initResponsivityManager(container, function (callback) { setTimeout(callback); });
83605
+ this.model.initResponsivityManager(container, function (callback) { setTimeout(callback, 100); });
83410
83606
  }
83411
83607
  }
83412
83608
  };
@@ -89460,13 +89656,10 @@ var list_item_ListItem = /** @class */ (function (_super) {
89460
89656
  var _this = this;
89461
89657
  if (!this.item)
89462
89658
  return null;
89463
- var contentWrapStyle = {
89464
- paddingInlineStart: this.model.getItemIndent(this.item)
89465
- };
89466
89659
  var className = this.model.getItemClass(this.item);
89467
89660
  var itemContent = this.item.component || this.model.itemComponent;
89468
89661
  var newElement = ReactElementFactory.Instance.createElement(itemContent, { item: this.item, key: this.item.id, model: this.model });
89469
- var contentWrap = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { style: contentWrapStyle, className: this.model.cssClasses.itemBody, title: this.item.locTitle.calculatedText, onMouseOver: function (event) { _this.model.onItemHover(_this.item); }, onMouseLeave: function (event) { _this.model.onItemLeave(_this.item); } }, newElement);
89662
+ var contentWrap = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { style: this.model.getItemStyle(this.item), className: this.model.cssClasses.itemBody, title: this.item.locTitle.calculatedText, onMouseOver: function (event) { _this.model.onItemHover(_this.item); }, onMouseLeave: function (event) { _this.model.onItemLeave(_this.item); } }, newElement);
89470
89663
  var separator = this.item.needSeparator ? external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.model.cssClasses.itemSeparator }) : null;
89471
89664
  var isVisible = this.model.isItemVisible(this.item);
89472
89665
  var style = {
@@ -90210,7 +90403,7 @@ var image_SurveyQuestionImage = /** @class */ (function (_super) {
90210
90403
  }
90211
90404
  var control = null;
90212
90405
  if (this.question.renderedMode === "image") {
90213
- control = (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("img", { className: cssClasses, src: this.question.locImageLink.renderedHtml, alt: this.question.altText || this.question.title, width: this.question.renderedWidth, height: this.question.renderedHeight,
90406
+ control = (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("img", { className: cssClasses, src: this.question.locImageLink.renderedHtml || null, alt: this.question.altText || this.question.title, width: this.question.renderedWidth, height: this.question.renderedHeight,
90214
90407
  //alt={item.text || item.value}
90215
90408
  style: style, onLoad: function (event) { _this.question.onLoadHandler(); }, onError: function (event) { _this.question.onErrorHandler(); } }));
90216
90409
  }
@@ -90641,7 +90834,7 @@ var logo_image_LogoImage = /** @class */ (function (_super) {
90641
90834
  LogoImage.prototype.render = function () {
90642
90835
  var content = [];
90643
90836
  content.push(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { key: "logo-image", className: this.survey.logoClassNames },
90644
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { className: this.survey.css.logoImage, src: this.survey.locLogo.renderedHtml, alt: this.survey.locTitle.renderedHtml, width: this.survey.renderedLogoWidth, height: this.survey.renderedLogoHeight, style: { objectFit: this.survey.logoFit, width: this.survey.renderedStyleLogoWidth, height: this.survey.renderedStyleLogoHeight } })));
90837
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { className: this.survey.css.logoImage, src: this.survey.locLogo.renderedHtml || null, alt: this.survey.locTitle.renderedHtml, width: this.survey.renderedLogoWidth, height: this.survey.renderedLogoHeight, style: { objectFit: this.survey.logoFit, width: this.survey.renderedStyleLogoWidth, height: this.survey.renderedStyleLogoHeight } })));
90645
90838
  return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, content);
90646
90839
  };
90647
90840
  return LogoImage;