survey-react 1.12.4 → 1.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/defaultV2.css +86 -6
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +1 -1
- package/modern.min.css +1 -1
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +202 -80
- package/survey.react.js +772 -348
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +3 -3
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.12.
|
2
|
+
* surveyjs - Survey JavaScript library v1.12.6
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -962,9 +962,9 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
|
|
962
962
|
|
963
963
|
/***/ "./src/entries/react.ts":
|
964
964
|
/*!********************************************!*\
|
965
|
-
!*** ./src/entries/react.ts +
|
965
|
+
!*** ./src/entries/react.ts + 284 modules ***!
|
966
966
|
\********************************************/
|
967
|
-
/*! exports provided: Version, ReleaseDate, checkLibraryVersion, setLicenseKey, slk, hasLicense, settings, Helpers, AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ExpressionValidator, ValidatorRunner, ItemValue, Base, Event, EventBase, ArrayChanges, ComputedUpdater, SurveyError, SurveyElementCore, SurveyElement, DragTypeOverMeEnum, CalculatedValue, CustomError, AnswerRequiredError, OneAnswerRequiredError, RequreNumericError, ExceedSizeError, LocalizableString, LocalizableStrings, HtmlConditionItem, UrlConditionItem, ChoicesRestful, ChoicesRestfull, FunctionFactory, registerFunction, ConditionRunner, ExpressionRunner, ExpressionExecutor, Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand, ConditionsParser, ProcessValue, JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase, MatrixDropdownColumn, matrixDropdownColumnTypes, QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable, MatrixDropdownRowModel, QuestionMatrixDropdownModel, MatrixDynamicRowModel, QuestionMatrixDynamicModel, MatrixRowModel, MatrixCells, QuestionMatrixModel, QuestionMatrixBaseModel, MultipleTextItemModel, MultipleTextCell, MultipleTextErrorCell, MutlipleTextErrorRow, MutlipleTextRow, QuestionMultipleTextModel, MultipleTextEditorModel, PanelModel, PanelModelBase, QuestionRowModel, FlowPanelModel, PageModel, DefaultTitleModel, Question, QuestionNonValue, QuestionEmptyModel, QuestionCheckboxBase, QuestionSelectBase, QuestionCheckboxModel, QuestionTagboxModel, QuestionRankingModel, QuestionCommentModel, QuestionDropdownModel, QuestionFactory, ElementFactory, QuestionFileModel, QuestionHtmlModel, QuestionRadiogroupModel, QuestionRatingModel, RenderedRatingItem, QuestionExpressionModel, QuestionTextBase, CharacterCounter, QuestionTextModel, QuestionBooleanModel, QuestionImagePickerModel, ImageItemValue, QuestionImageModel, QuestionSignaturePadModel, QuestionPanelDynamicModel, QuestionPanelDynamicItem, SurveyTimer, SurveyTimerModel, tryFocusPage, createTOCListModel, getTocRootCss, TOCModel, SurveyProgressModel, ProgressButtons, ProgressButtonsResponsivityManager, SurveyModel, SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, SurveyTriggerCopyValue, SurveyTriggerRunExpression, SurveyTriggerSkip, Trigger, PopupSurveyModel, SurveyWindowModel, TextPreProcessor, Notifier, Cover, CoverCell, dxSurveyService, englishStrings, surveyLocalization, surveyStrings, QuestionCustomWidget, CustomWidgetCollection, QuestionCustomModel, QuestionCompositeModel, ComponentQuestionJSON, ComponentCollection, ListModel, MultiSelectListModel, PopupModel, createDialogOptions, PopupBaseViewModel, PopupDropdownViewModel, PopupModalViewModel, createPopupViewModel, createPopupModalViewModel, DropdownListModel, DropdownMultiSelectListModel, QuestionButtonGroupModel, ButtonGroupItemModel, ButtonGroupItemValue, IsMobile, IsTouch, _setIsTouch, confirmAction, confirmActionAsync, detectIEOrEdge, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, loadFileFromBase64, increaseHeightByContent, createSvg, chooseFiles, sanitizeEditableContent, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, classesToSelector, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgBundleViewModel, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, createDropdownActionModel, createDropdownActionModelAdvanced, createPopupModelWithListModel, getActionDropdownButtonTarget, BaseAction, Action, ActionDropdownViewModel, AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab, AdaptiveActionContainer, defaultActionBarCss, ActionContainer, DragOrClickHelper, Model, bootstrapThemeName, bootstrapThemeColors, bootstrapThemeCssRules, bootstrapMaterialThemeName, bootstrapMaterialThemeColors, bootstrapMaterialThemeCssRules, defaultBootstrapCss, defaultBootstrapMaterialCss, Survey, attachKey2click, ReactSurveyElementsWrapper, SurveyNavigationBase, SurveyTimerPanel, SurveyPage, SurveyRow, SurveyPanel, SurveyFlowPanel, SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsCell, ReactSurveyElement, SurveyElementBase, SurveyQuestionElementBase, SurveyQuestionCommentItem, SurveyQuestionComment, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, RatingItem, RatingItemStar, RatingItemSmiley, RatingDropdownItem, TagboxFilterString, SurveyQuestionOptionItem, SurveyQuestionDropdownBase, SurveyQuestionDropdown, SurveyQuestionTagboxItem, SurveyQuestionTagbox, SurveyQuestionDropdownSelect, SurveyQuestionMatrix, SurveyQuestionMatrixRow, SurveyQuestionMatrixCell, SurveyQuestionHtml, SurveyQuestionFile, SurveyFileChooseButton, SurveyFilePreview, SurveyQuestionMultipleText, SurveyQuestionRadiogroup, SurveyQuestionRadioItem, SurveyQuestionText, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionEmpty, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionPanelDynamic, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionExpression, PopupSurvey, SurveyWindow, ReactQuestionFactory, ReactElementFactory, SurveyQuestionImagePicker, SurveyQuestionImage, SurveyQuestionSignaturePad, SurveyQuestionButtonGroup, SurveyQuestionCustom, SurveyQuestionComposite, Popup, ListItemContent, ListItemGroup, List, TitleActions, TitleElement, SurveyActionBar, LogoImage, SurveyHeader, SvgIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicProgressText, SurveyNavigationButton, QuestionErrorComponent, MatrixRow, Skeleton, NotifierComponent, ComponentsContainer, CharacterCounterComponent, HeaderMobile, HeaderCell, Header, SurveyLocStringViewer, SurveyLocStringEditor, LoadingIndicatorComponent, SvgBundleComponent */
|
967
|
+
/*! exports provided: Version, ReleaseDate, checkLibraryVersion, setLicenseKey, slk, hasLicense, settings, Helpers, AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ExpressionValidator, ValidatorRunner, ItemValue, Base, Event, EventBase, ArrayChanges, ComputedUpdater, SurveyError, SurveyElementCore, SurveyElement, DragTypeOverMeEnum, CalculatedValue, CustomError, AnswerRequiredError, OneAnswerRequiredError, RequreNumericError, ExceedSizeError, LocalizableString, LocalizableStrings, HtmlConditionItem, UrlConditionItem, ChoicesRestful, ChoicesRestfull, FunctionFactory, registerFunction, ConditionRunner, ExpressionRunner, ExpressionExecutor, Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand, ConditionsParser, ProcessValue, JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase, MatrixDropdownColumn, matrixDropdownColumnTypes, QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable, MatrixDropdownRowModel, QuestionMatrixDropdownModel, MatrixDynamicRowModel, QuestionMatrixDynamicModel, MatrixRowModel, MatrixCells, QuestionMatrixModel, QuestionMatrixBaseModel, MultipleTextItemModel, MultipleTextCell, MultipleTextErrorCell, MutlipleTextErrorRow, MutlipleTextRow, QuestionMultipleTextModel, MultipleTextEditorModel, PanelModel, PanelModelBase, QuestionRowModel, FlowPanelModel, PageModel, DefaultTitleModel, Question, QuestionNonValue, QuestionEmptyModel, QuestionCheckboxBase, QuestionSelectBase, QuestionCheckboxModel, QuestionTagboxModel, QuestionRankingModel, QuestionCommentModel, QuestionDropdownModel, QuestionFactory, ElementFactory, QuestionFileModel, QuestionFilePage, QuestionHtmlModel, QuestionRadiogroupModel, QuestionRatingModel, RenderedRatingItem, QuestionExpressionModel, QuestionTextBase, CharacterCounter, QuestionTextModel, QuestionBooleanModel, QuestionImagePickerModel, ImageItemValue, QuestionImageModel, QuestionSignaturePadModel, QuestionPanelDynamicModel, QuestionPanelDynamicItem, SurveyTimer, SurveyTimerModel, tryFocusPage, createTOCListModel, getTocRootCss, TOCModel, SurveyProgressModel, ProgressButtons, ProgressButtonsResponsivityManager, SurveyModel, SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, SurveyTriggerCopyValue, SurveyTriggerRunExpression, SurveyTriggerSkip, Trigger, PopupSurveyModel, SurveyWindowModel, TextPreProcessor, Notifier, Cover, CoverCell, dxSurveyService, englishStrings, surveyLocalization, surveyStrings, QuestionCustomWidget, CustomWidgetCollection, QuestionCustomModel, QuestionCompositeModel, ComponentQuestionJSON, ComponentCollection, ListModel, MultiSelectListModel, PopupModel, createDialogOptions, PopupBaseViewModel, PopupDropdownViewModel, PopupModalViewModel, createPopupViewModel, createPopupModalViewModel, DropdownListModel, DropdownMultiSelectListModel, QuestionButtonGroupModel, ButtonGroupItemModel, ButtonGroupItemValue, IsMobile, IsTouch, _setIsTouch, confirmAction, confirmActionAsync, detectIEOrEdge, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, loadFileFromBase64, increaseHeightByContent, createSvg, chooseFiles, sanitizeEditableContent, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, classesToSelector, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgBundleViewModel, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, createDropdownActionModel, createDropdownActionModelAdvanced, createPopupModelWithListModel, getActionDropdownButtonTarget, BaseAction, Action, ActionDropdownViewModel, AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab, AdaptiveActionContainer, defaultActionBarCss, ActionContainer, DragOrClickHelper, Model, bootstrapThemeName, bootstrapThemeColors, bootstrapThemeCssRules, bootstrapMaterialThemeName, bootstrapMaterialThemeColors, bootstrapMaterialThemeCssRules, defaultBootstrapCss, defaultBootstrapMaterialCss, Survey, attachKey2click, ReactSurveyElementsWrapper, SurveyNavigationBase, SurveyTimerPanel, SurveyPage, SurveyRow, SurveyPanel, SurveyFlowPanel, SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsCell, ReactSurveyElement, SurveyElementBase, SurveyQuestionElementBase, SurveyQuestionCommentItem, SurveyQuestionComment, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, RatingItem, RatingItemStar, RatingItemSmiley, RatingDropdownItem, TagboxFilterString, SurveyQuestionOptionItem, SurveyQuestionDropdownBase, SurveyQuestionDropdown, SurveyQuestionTagboxItem, SurveyQuestionTagbox, SurveyQuestionDropdownSelect, SurveyQuestionMatrix, SurveyQuestionMatrixRow, SurveyQuestionMatrixCell, SurveyQuestionHtml, SurveyQuestionFile, SurveyFileChooseButton, SurveyFilePreview, SurveyQuestionMultipleText, SurveyQuestionRadiogroup, SurveyQuestionRadioItem, SurveyQuestionText, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionEmpty, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionPanelDynamic, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionExpression, PopupSurvey, SurveyWindow, ReactQuestionFactory, ReactElementFactory, SurveyQuestionImagePicker, SurveyQuestionImage, SurveyQuestionSignaturePad, SurveyQuestionButtonGroup, SurveyQuestionCustom, SurveyQuestionComposite, Popup, ListItemContent, ListItemGroup, List, TitleActions, TitleElement, SurveyActionBar, LogoImage, SurveyHeader, SvgIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicProgressText, SurveyNavigationButton, QuestionErrorComponent, MatrixRow, Skeleton, NotifierComponent, ComponentsContainer, CharacterCounterComponent, HeaderMobile, HeaderCell, Header, SurveyLocStringViewer, SurveyLocStringEditor, LoadingIndicatorComponent, SvgBundleComponent */
|
968
968
|
/*! ModuleConcatenation bailout: Cannot concat with external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} (<- Module is not an ECMAScript module) */
|
969
969
|
/*! ModuleConcatenation bailout: Cannot concat with external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom"} (<- Module is not an ECMAScript module) */
|
970
970
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
@@ -1083,6 +1083,7 @@ __webpack_require__.d(__webpack_exports__, "QuestionDropdownModel", function() {
|
|
1083
1083
|
__webpack_require__.d(__webpack_exports__, "QuestionFactory", function() { return /* reexport */ questionfactory_QuestionFactory; });
|
1084
1084
|
__webpack_require__.d(__webpack_exports__, "ElementFactory", function() { return /* reexport */ questionfactory_ElementFactory; });
|
1085
1085
|
__webpack_require__.d(__webpack_exports__, "QuestionFileModel", function() { return /* reexport */ question_file_QuestionFileModel; });
|
1086
|
+
__webpack_require__.d(__webpack_exports__, "QuestionFilePage", function() { return /* reexport */ question_file_QuestionFilePage; });
|
1086
1087
|
__webpack_require__.d(__webpack_exports__, "QuestionHtmlModel", function() { return /* reexport */ question_html_QuestionHtmlModel; });
|
1087
1088
|
__webpack_require__.d(__webpack_exports__, "QuestionRadiogroupModel", function() { return /* reexport */ question_radiogroup_QuestionRadiogroupModel; });
|
1088
1089
|
__webpack_require__.d(__webpack_exports__, "QuestionRatingModel", function() { return /* reexport */ question_rating_QuestionRatingModel; });
|
@@ -2473,8 +2474,10 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
|
|
2473
2474
|
return this.getValue(obj);
|
2474
2475
|
};
|
2475
2476
|
JsonObjectProperty.prototype.getValue = function (obj) {
|
2476
|
-
if (this.onGetValue)
|
2477
|
+
if (this.onGetValue) {
|
2478
|
+
obj = this.getOriginalObj(obj);
|
2477
2479
|
return this.onGetValue(obj);
|
2480
|
+
}
|
2478
2481
|
if (this.serializationProperty && !!obj[this.serializationProperty])
|
2479
2482
|
return obj[this.serializationProperty].getJson();
|
2480
2483
|
return obj[this.name];
|
@@ -2501,6 +2504,7 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
|
|
2501
2504
|
};
|
2502
2505
|
JsonObjectProperty.prototype.setValue = function (obj, value, jsonConv) {
|
2503
2506
|
if (this.onSetValue) {
|
2507
|
+
obj = this.getOriginalObj(obj);
|
2504
2508
|
this.onSetValue(obj, value, jsonConv);
|
2505
2509
|
}
|
2506
2510
|
else {
|
@@ -2589,7 +2593,7 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
|
|
2589
2593
|
};
|
2590
2594
|
JsonObjectProperty.prototype.isVisible = function (layout, obj) {
|
2591
2595
|
if (obj === void 0) { obj = null; }
|
2592
|
-
var isLayout = !this.layout || this.layout
|
2596
|
+
var isLayout = !this.layout || !layout || this.layout === layout;
|
2593
2597
|
if (!this.visible || !isLayout)
|
2594
2598
|
return false;
|
2595
2599
|
if (!!this.visibleIf && !!obj) {
|
@@ -3119,6 +3123,9 @@ var jsonobject_JsonMetadataClass = /** @class */ (function () {
|
|
3119
3123
|
if (propInfo.readOnly === true) {
|
3120
3124
|
prop.readOnly = true;
|
3121
3125
|
}
|
3126
|
+
if (propInfo.availableInMatrixColumn === true) {
|
3127
|
+
prop.availableInMatrixColumn = true;
|
3128
|
+
}
|
3122
3129
|
if (propInfo.choices) {
|
3123
3130
|
var choicesFunc = typeof propInfo.choices === "function" ? propInfo.choices : null;
|
3124
3131
|
var choicesValue = typeof propInfo.choices !== "function" ? propInfo.choices : null;
|
@@ -9254,8 +9261,8 @@ var base_Base = /** @class */ (function () {
|
|
9254
9261
|
this.isCreating = true;
|
9255
9262
|
this.animationAllowedLock = 0;
|
9256
9263
|
//remove when knockout obsolete
|
9257
|
-
this.
|
9258
|
-
this.
|
9264
|
+
this.supportOnElementRerenderedEvent = true;
|
9265
|
+
this.onElementRerenderedEventEnabled = false;
|
9259
9266
|
this._onElementRerendered = new EventBase();
|
9260
9267
|
this.bindingsValue = new base_Bindings(this);
|
9261
9268
|
CustomPropertiesCollection.createProperties(this);
|
@@ -10192,7 +10199,7 @@ var base_Base = /** @class */ (function () {
|
|
10192
10199
|
configurable: true
|
10193
10200
|
});
|
10194
10201
|
Base.prototype.getIsAnimationAllowed = function () {
|
10195
|
-
return settings.animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.
|
10202
|
+
return settings.animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.supportOnElementRerenderedEvent);
|
10196
10203
|
};
|
10197
10204
|
Base.prototype.blockAnimations = function () {
|
10198
10205
|
this.animationAllowedLock--;
|
@@ -10200,17 +10207,17 @@ var base_Base = /** @class */ (function () {
|
|
10200
10207
|
Base.prototype.releaseAnimations = function () {
|
10201
10208
|
this.animationAllowedLock++;
|
10202
10209
|
};
|
10203
|
-
Base.prototype.
|
10204
|
-
this.
|
10210
|
+
Base.prototype.enableOnElementRerenderedEvent = function () {
|
10211
|
+
this.onElementRerenderedEventEnabled = true;
|
10205
10212
|
};
|
10206
|
-
Base.prototype.
|
10213
|
+
Base.prototype.disableOnElementRerenderedEvent = function () {
|
10207
10214
|
var _a;
|
10208
10215
|
(_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, { isCancel: true });
|
10209
|
-
this.
|
10216
|
+
this.onElementRerenderedEventEnabled = false;
|
10210
10217
|
};
|
10211
10218
|
Object.defineProperty(Base.prototype, "onElementRerendered", {
|
10212
10219
|
get: function () {
|
10213
|
-
return this.
|
10220
|
+
return this.supportOnElementRerenderedEvent && this.onElementRerenderedEventEnabled ? this._onElementRerendered : undefined;
|
10214
10221
|
},
|
10215
10222
|
enumerable: false,
|
10216
10223
|
configurable: true
|
@@ -10223,66 +10230,6 @@ var base_Base = /** @class */ (function () {
|
|
10223
10230
|
return Base;
|
10224
10231
|
}());
|
10225
10232
|
|
10226
|
-
var RenderingCompletedAwaiter = /** @class */ (function () {
|
10227
|
-
function RenderingCompletedAwaiter(_elements, _renderedHandler, waitingTimeout) {
|
10228
|
-
var _this = this;
|
10229
|
-
if (waitingTimeout === void 0) { waitingTimeout = 100; }
|
10230
|
-
this._elements = _elements;
|
10231
|
-
this._renderedHandler = _renderedHandler;
|
10232
|
-
this._elementsToRenderCount = 0;
|
10233
|
-
this._elementsToRenderTimer = undefined;
|
10234
|
-
this._elementRenderedHandler = function (s, o) {
|
10235
|
-
var _a;
|
10236
|
-
(_a = s.onElementRerendered) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
10237
|
-
_this._elementsToRenderCount--;
|
10238
|
-
if (_this._elementsToRenderCount <= 0) {
|
10239
|
-
_this.visibleElementsRendered();
|
10240
|
-
}
|
10241
|
-
};
|
10242
|
-
this._elements.forEach(function (element) {
|
10243
|
-
if (element.onElementRerendered) {
|
10244
|
-
element.onElementRerendered.add(_this._elementRenderedHandler);
|
10245
|
-
_this._elementsToRenderCount++;
|
10246
|
-
}
|
10247
|
-
});
|
10248
|
-
if (this._elementsToRenderCount > 0) {
|
10249
|
-
this._elementsToRenderTimer = setTimeout(function () {
|
10250
|
-
if (_this._elementsToRenderCount > 0) {
|
10251
|
-
_this.visibleElementsRendered();
|
10252
|
-
}
|
10253
|
-
}, waitingTimeout);
|
10254
|
-
}
|
10255
|
-
else {
|
10256
|
-
this.visibleElementsRendered();
|
10257
|
-
}
|
10258
|
-
}
|
10259
|
-
RenderingCompletedAwaiter.prototype.stopWaitingForElementsRendering = function () {
|
10260
|
-
var _this = this;
|
10261
|
-
if (this._elementsToRenderTimer) {
|
10262
|
-
clearTimeout(this._elementsToRenderTimer);
|
10263
|
-
this._elementsToRenderTimer = undefined;
|
10264
|
-
}
|
10265
|
-
this._elements.forEach(function (element) {
|
10266
|
-
var _a;
|
10267
|
-
(_a = element.onElementRerendered) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
10268
|
-
});
|
10269
|
-
this._elementsToRenderCount = 0;
|
10270
|
-
};
|
10271
|
-
RenderingCompletedAwaiter.prototype.visibleElementsRendered = function () {
|
10272
|
-
var renderedHandler = this._renderedHandler;
|
10273
|
-
this.dispose();
|
10274
|
-
if (typeof renderedHandler == "function") {
|
10275
|
-
renderedHandler();
|
10276
|
-
}
|
10277
|
-
};
|
10278
|
-
RenderingCompletedAwaiter.prototype.dispose = function () {
|
10279
|
-
this.stopWaitingForElementsRendering();
|
10280
|
-
this._elements = undefined;
|
10281
|
-
this._renderedHandler = undefined;
|
10282
|
-
};
|
10283
|
-
return RenderingCompletedAwaiter;
|
10284
|
-
}());
|
10285
|
-
|
10286
10233
|
var ArrayChanges = /** @class */ (function () {
|
10287
10234
|
function ArrayChanges(index, deleteCount, itemsToAdd, deletedItems) {
|
10288
10235
|
this.index = index;
|
@@ -10462,7 +10409,9 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
10462
10409
|
var _items = this.container.querySelectorAll(this.itemsSelector);
|
10463
10410
|
(_items || []).forEach(function (item, index) {
|
10464
10411
|
var currentAction = actions[index];
|
10465
|
-
|
10412
|
+
if (!!currentAction) {
|
10413
|
+
_this.calcActionDimensions(currentAction, item);
|
10414
|
+
}
|
10466
10415
|
});
|
10467
10416
|
};
|
10468
10417
|
ResponsivityManager.prototype.calcActionDimensions = function (currentAction, item) {
|
@@ -13022,6 +12971,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13022
12971
|
}
|
13023
12972
|
}
|
13024
12973
|
}, function () { return _this.renderedIsExpanded; });
|
12974
|
+
_this.onAfterRenderElement = _this.addEvent();
|
13025
12975
|
_this.name = name;
|
13026
12976
|
_this.createNewArray("errors");
|
13027
12977
|
_this.createNewArray("titleActions");
|
@@ -13051,16 +13001,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13051
13001
|
}
|
13052
13002
|
return info;
|
13053
13003
|
};
|
13054
|
-
SurveyElement.
|
13055
|
-
var root = settings.environment.root;
|
13056
|
-
if (!elementId || typeof root === "undefined")
|
13057
|
-
return false;
|
13058
|
-
var el = root.getElementById(elementId);
|
13059
|
-
return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);
|
13060
|
-
};
|
13061
|
-
SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
13062
|
-
if (!el || !el.scrollIntoView)
|
13063
|
-
return false;
|
13004
|
+
SurveyElement.IsNeedScrollIntoView = function (el, checkLeft, scrollIfVisible) {
|
13064
13005
|
var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
|
13065
13006
|
var needScroll = elTop < 0;
|
13066
13007
|
var elLeft = -1;
|
@@ -13076,20 +13017,48 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13076
13017
|
needScroll = width > 0 && width < elLeft;
|
13077
13018
|
}
|
13078
13019
|
}
|
13079
|
-
|
13080
|
-
|
13081
|
-
|
13082
|
-
|
13083
|
-
|
13084
|
-
|
13085
|
-
|
13086
|
-
|
13020
|
+
return needScroll;
|
13021
|
+
};
|
13022
|
+
SurveyElement.ScrollIntoView = function (el, scrollIntoViewOptions, doneCallback) {
|
13023
|
+
el.scrollIntoView(scrollIntoViewOptions);
|
13024
|
+
if (typeof doneCallback === "function") {
|
13025
|
+
var lastPos_1 = null;
|
13026
|
+
var same_1 = 0;
|
13027
|
+
var checkPos_1 = function () {
|
13028
|
+
var newPos = el.getBoundingClientRect().top;
|
13029
|
+
if (newPos === lastPos_1) {
|
13030
|
+
if (same_1++ > 2) {
|
13087
13031
|
doneCallback();
|
13032
|
+
return;
|
13088
13033
|
}
|
13089
|
-
|
13090
|
-
|
13091
|
-
|
13092
|
-
|
13034
|
+
}
|
13035
|
+
else {
|
13036
|
+
lastPos_1 = newPos;
|
13037
|
+
same_1 = 0;
|
13038
|
+
}
|
13039
|
+
requestAnimationFrame(checkPos_1);
|
13040
|
+
};
|
13041
|
+
DomWindowHelper.requestAnimationFrame(checkPos_1);
|
13042
|
+
}
|
13043
|
+
};
|
13044
|
+
SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
13045
|
+
var root = settings.environment.root;
|
13046
|
+
if (!elementId || typeof root === "undefined")
|
13047
|
+
return false;
|
13048
|
+
var el = root.getElementById(elementId);
|
13049
|
+
return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);
|
13050
|
+
};
|
13051
|
+
SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
13052
|
+
if (!el || !el.scrollIntoView) {
|
13053
|
+
doneCallback && doneCallback();
|
13054
|
+
return false;
|
13055
|
+
}
|
13056
|
+
var needScroll = SurveyElement.IsNeedScrollIntoView(el, checkLeft, scrollIfVisible);
|
13057
|
+
if (needScroll) {
|
13058
|
+
SurveyElement.ScrollIntoView(el, scrollIntoViewOptions, doneCallback);
|
13059
|
+
}
|
13060
|
+
else {
|
13061
|
+
doneCallback && doneCallback();
|
13093
13062
|
}
|
13094
13063
|
return needScroll;
|
13095
13064
|
};
|
@@ -13839,7 +13808,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13839
13808
|
};
|
13840
13809
|
Object.defineProperty(SurveyElement.prototype, "isDefaultV2Theme", {
|
13841
13810
|
get: function () {
|
13842
|
-
return this.survey && this.survey.getCss().root
|
13811
|
+
return this.survey && this.survey.getCss().root.indexOf("sd-root-modern") !== -1;
|
13843
13812
|
},
|
13844
13813
|
enumerable: false,
|
13845
13814
|
configurable: true
|
@@ -14236,12 +14205,16 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14236
14205
|
SurveyElement.prototype.getIsAnimationAllowed = function () {
|
14237
14206
|
return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey && !this.survey["isEndLoadingFromJson"];
|
14238
14207
|
};
|
14208
|
+
SurveyElement.prototype.afterRenderCore = function (element) {
|
14209
|
+
this.onAfterRenderElement.fire(this, { htmlElement: element });
|
14210
|
+
};
|
14239
14211
|
SurveyElement.prototype.dispose = function () {
|
14240
14212
|
_super.prototype.dispose.call(this);
|
14241
14213
|
if (this.titleToolbarValue) {
|
14242
14214
|
this.titleToolbarValue.dispose();
|
14243
14215
|
}
|
14244
14216
|
};
|
14217
|
+
// TODO V2: get rid of this flag
|
14245
14218
|
SurveyElement.CreateDisabledDesignElements = false;
|
14246
14219
|
survey_element_decorate([
|
14247
14220
|
jsonobject_property({ defaultValue: null })
|
@@ -14274,6 +14247,66 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14274
14247
|
return SurveyElement;
|
14275
14248
|
}(survey_element_SurveyElementCore));
|
14276
14249
|
|
14250
|
+
var RenderingCompletedAwaiter = /** @class */ (function () {
|
14251
|
+
function RenderingCompletedAwaiter(_elements, _renderedHandler, waitingTimeout) {
|
14252
|
+
var _this = this;
|
14253
|
+
if (waitingTimeout === void 0) { waitingTimeout = 100; }
|
14254
|
+
this._elements = _elements;
|
14255
|
+
this._renderedHandler = _renderedHandler;
|
14256
|
+
this._elementsToRenderCount = 0;
|
14257
|
+
this._elementsToRenderTimer = undefined;
|
14258
|
+
this._elementRenderedHandler = function (s, o) {
|
14259
|
+
var _a;
|
14260
|
+
(_a = s.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
14261
|
+
_this._elementsToRenderCount--;
|
14262
|
+
if (_this._elementsToRenderCount <= 0) {
|
14263
|
+
_this.visibleElementsRendered();
|
14264
|
+
}
|
14265
|
+
};
|
14266
|
+
this._elements.forEach(function (element) {
|
14267
|
+
if (element.onAfterRenderElement) {
|
14268
|
+
element.onAfterRenderElement.add(_this._elementRenderedHandler);
|
14269
|
+
_this._elementsToRenderCount++;
|
14270
|
+
}
|
14271
|
+
});
|
14272
|
+
if (this._elementsToRenderCount > 0) {
|
14273
|
+
this._elementsToRenderTimer = setTimeout(function () {
|
14274
|
+
if (_this._elementsToRenderCount > 0) {
|
14275
|
+
_this.visibleElementsRendered();
|
14276
|
+
}
|
14277
|
+
}, waitingTimeout);
|
14278
|
+
}
|
14279
|
+
else {
|
14280
|
+
this.visibleElementsRendered();
|
14281
|
+
}
|
14282
|
+
}
|
14283
|
+
RenderingCompletedAwaiter.prototype.stopWaitingForElementsRendering = function () {
|
14284
|
+
var _this = this;
|
14285
|
+
if (this._elementsToRenderTimer) {
|
14286
|
+
clearTimeout(this._elementsToRenderTimer);
|
14287
|
+
this._elementsToRenderTimer = undefined;
|
14288
|
+
}
|
14289
|
+
this._elements.forEach(function (element) {
|
14290
|
+
var _a;
|
14291
|
+
(_a = element.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
14292
|
+
});
|
14293
|
+
this._elementsToRenderCount = 0;
|
14294
|
+
};
|
14295
|
+
RenderingCompletedAwaiter.prototype.visibleElementsRendered = function () {
|
14296
|
+
var renderedHandler = this._renderedHandler;
|
14297
|
+
this.dispose();
|
14298
|
+
if (typeof renderedHandler == "function") {
|
14299
|
+
renderedHandler();
|
14300
|
+
}
|
14301
|
+
};
|
14302
|
+
RenderingCompletedAwaiter.prototype.dispose = function () {
|
14303
|
+
this.stopWaitingForElementsRendering();
|
14304
|
+
this._elements = undefined;
|
14305
|
+
this._renderedHandler = undefined;
|
14306
|
+
};
|
14307
|
+
return RenderingCompletedAwaiter;
|
14308
|
+
}());
|
14309
|
+
|
14277
14310
|
|
14278
14311
|
// CONCATENATED MODULE: ./packages/survey-core/src/localizablestring.ts
|
14279
14312
|
|
@@ -16750,6 +16783,11 @@ var validator_SurveyValidator = /** @class */ (function (_super) {
|
|
16750
16783
|
_this.createLocalizableString("text", _this, true);
|
16751
16784
|
return _this;
|
16752
16785
|
}
|
16786
|
+
Object.defineProperty(SurveyValidator.prototype, "isValidator", {
|
16787
|
+
get: function () { return true; },
|
16788
|
+
enumerable: false,
|
16789
|
+
configurable: true
|
16790
|
+
});
|
16753
16791
|
SurveyValidator.prototype.getSurvey = function (live) {
|
16754
16792
|
if (live === void 0) { live = false; }
|
16755
16793
|
return !!this.errorOwner && !!this.errorOwner["getSurvey"]
|
@@ -17608,16 +17646,21 @@ var text_area_TextAreaModel = /** @class */ (function () {
|
|
17608
17646
|
this.onPropertyChangedCallback = function () {
|
17609
17647
|
if (_this.element) {
|
17610
17648
|
_this.element.value = _this.getTextValue();
|
17611
|
-
|
17612
|
-
increaseHeightByContent(_this.element);
|
17613
|
-
}
|
17649
|
+
_this.updateElement();
|
17614
17650
|
}
|
17615
17651
|
};
|
17616
17652
|
this.question.registerFunctionOnPropertyValueChanged(this.options.propertyName, this.onPropertyChangedCallback, "__textarea");
|
17617
17653
|
}
|
17654
|
+
TextAreaModel.prototype.updateElement = function () {
|
17655
|
+
var _this = this;
|
17656
|
+
if (this.element && this.autoGrow) {
|
17657
|
+
setTimeout(function () { return increaseHeightByContent(_this.element); }, 1);
|
17658
|
+
}
|
17659
|
+
};
|
17618
17660
|
TextAreaModel.prototype.setElement = function (element) {
|
17619
17661
|
if (!!element) {
|
17620
17662
|
this.element = element;
|
17663
|
+
this.updateElement();
|
17621
17664
|
}
|
17622
17665
|
};
|
17623
17666
|
TextAreaModel.prototype.getTextValue = function () {
|
@@ -18887,7 +18930,8 @@ var question_Question = /** @class */ (function (_super) {
|
|
18887
18930
|
}
|
18888
18931
|
this.checkForResponsiveness(el);
|
18889
18932
|
};
|
18890
|
-
Question.prototype.afterRenderCore = function (
|
18933
|
+
Question.prototype.afterRenderCore = function (element) {
|
18934
|
+
_super.prototype.afterRenderCore.call(this, element);
|
18891
18935
|
};
|
18892
18936
|
Question.prototype.getCommentElementsId = function () {
|
18893
18937
|
return [this.commentId];
|
@@ -19222,6 +19266,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19222
19266
|
* @param onError Pass `true` if you want to focus an input field with the first validation error. Default value: `false` (focuses the first input field). Applies to question types with multiple input fields.
|
19223
19267
|
*/
|
19224
19268
|
Question.prototype.focus = function (onError, scrollIfVisible) {
|
19269
|
+
var _this = this;
|
19225
19270
|
if (onError === void 0) { onError = false; }
|
19226
19271
|
if (this.isDesignMode || !this.isVisible || !this.survey)
|
19227
19272
|
return;
|
@@ -19231,16 +19276,17 @@ var question_Question = /** @class */ (function (_super) {
|
|
19231
19276
|
this.survey.focusQuestionByInstance(this, onError);
|
19232
19277
|
}
|
19233
19278
|
else {
|
19234
|
-
this.
|
19235
|
-
|
19236
|
-
|
19237
|
-
|
19238
|
-
|
19239
|
-
|
19240
|
-
|
19241
|
-
|
19279
|
+
if (!!this.survey) {
|
19280
|
+
this.expandAllParents();
|
19281
|
+
var scrollOptions = this.survey["isSmoothScrollEnabled"] ? { behavior: "smooth" } : undefined;
|
19282
|
+
this.survey.scrollElementToTop(this, this, null, this.id, scrollIfVisible, scrollOptions, undefined, function () {
|
19283
|
+
_this.focusInputElement(onError);
|
19284
|
+
});
|
19285
|
+
}
|
19286
|
+
else {
|
19287
|
+
this.focusInputElement(onError);
|
19288
|
+
}
|
19242
19289
|
}
|
19243
|
-
this.focusInputElement(onError);
|
19244
19290
|
};
|
19245
19291
|
Question.prototype.focusInputElement = function (onError) {
|
19246
19292
|
var id = !onError ? this.getFirstInputElementId() : this.getFirstErrorInputElementId();
|
@@ -20767,9 +20813,12 @@ var question_Question = /** @class */ (function (_super) {
|
|
20767
20813
|
if (this.isValueEmpty(value) && helpers_Helpers.isNumber(this[propName])) {
|
20768
20814
|
value = 0;
|
20769
20815
|
}
|
20770
|
-
this
|
20816
|
+
this.updateBindingProp(propName, value);
|
20771
20817
|
}
|
20772
20818
|
};
|
20819
|
+
Question.prototype.updateBindingProp = function (propName, value) {
|
20820
|
+
this[propName] = value;
|
20821
|
+
};
|
20773
20822
|
Question.prototype.getComponentName = function () {
|
20774
20823
|
return RendererFactory.Instance.getRendererByQuestion(this);
|
20775
20824
|
};
|
@@ -27871,7 +27920,7 @@ var MatrixDropdownRowTextProcessor = /** @class */ (function (_super) {
|
|
27871
27920
|
textValue.value = this.row.rowIndex;
|
27872
27921
|
return true;
|
27873
27922
|
}
|
27874
|
-
if (textValue.name
|
27923
|
+
if ([question_matrixdropdownbase_MatrixDropdownRowModelBase.RowValueVariableName, question_matrixdropdownbase_MatrixDropdownRowModelBase.RowNameVariableName].indexOf(textValue.name) > -1) {
|
27875
27924
|
textValue.isExists = true;
|
27876
27925
|
textValue.value = this.row.rowName;
|
27877
27926
|
return true;
|
@@ -28105,11 +28154,12 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28105
28154
|
MatrixDropdownRowModelBase.prototype.applyRowVariablesToValues = function (res, rowIndex) {
|
28106
28155
|
res[MatrixDropdownRowModelBase.IndexVariableName] = rowIndex;
|
28107
28156
|
res[MatrixDropdownRowModelBase.RowValueVariableName] = this.rowName;
|
28157
|
+
res[MatrixDropdownRowModelBase.RowNameVariableName] = this.rowName;
|
28108
28158
|
};
|
28109
28159
|
MatrixDropdownRowModelBase.prototype.runCondition = function (values, properties, rowsVisibleIf) {
|
28110
|
-
if (
|
28111
|
-
|
28112
|
-
|
28160
|
+
if (!this.data)
|
28161
|
+
return;
|
28162
|
+
values[MatrixDropdownRowModelBase.OwnerVariableName] = this.data.getFilteredData();
|
28113
28163
|
var rowIndex = this.rowIndex;
|
28114
28164
|
this.applyRowVariablesToValues(values, rowIndex);
|
28115
28165
|
var newProps = helpers_Helpers.createCopy(properties);
|
@@ -28520,11 +28570,14 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28520
28570
|
};
|
28521
28571
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "rowIndex", {
|
28522
28572
|
get: function () {
|
28523
|
-
return
|
28573
|
+
return this.getRowIndex();
|
28524
28574
|
},
|
28525
28575
|
enumerable: false,
|
28526
28576
|
configurable: true
|
28527
28577
|
});
|
28578
|
+
MatrixDropdownRowModelBase.prototype.getRowIndex = function () {
|
28579
|
+
return !!this.data ? this.data.getRowIndex(this) + 1 : -1;
|
28580
|
+
};
|
28528
28581
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "editingObj", {
|
28529
28582
|
get: function () {
|
28530
28583
|
return this.editingObjValue;
|
@@ -28562,6 +28615,7 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28562
28615
|
MatrixDropdownRowModelBase.OwnerVariableName = "self";
|
28563
28616
|
MatrixDropdownRowModelBase.IndexVariableName = "rowIndex";
|
28564
28617
|
MatrixDropdownRowModelBase.RowValueVariableName = "rowValue";
|
28618
|
+
MatrixDropdownRowModelBase.RowNameVariableName = "rowName";
|
28565
28619
|
MatrixDropdownRowModelBase.idCounter = 1;
|
28566
28620
|
return MatrixDropdownRowModelBase;
|
28567
28621
|
}());
|
@@ -29225,9 +29279,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29225
29279
|
return !!question ? question.getConditionJson(operator) : null;
|
29226
29280
|
};
|
29227
29281
|
QuestionMatrixDropdownModelBase.prototype.clearIncorrectValues = function () {
|
29228
|
-
|
29229
|
-
if (!rows)
|
29282
|
+
if (!Array.isArray(this.visibleRows))
|
29230
29283
|
return;
|
29284
|
+
var rows = this.generatedVisibleRows;
|
29231
29285
|
for (var i = 0; i < rows.length; i++) {
|
29232
29286
|
rows[i].clearIncorrectValues(this.getRowValue(i));
|
29233
29287
|
}
|
@@ -29632,13 +29686,13 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29632
29686
|
* @see setRowValue
|
29633
29687
|
*/
|
29634
29688
|
QuestionMatrixDropdownModelBase.prototype.getRowValue = function (rowIndex) {
|
29635
|
-
if (rowIndex < 0)
|
29689
|
+
if (rowIndex < 0 || !Array.isArray(this.visibleRows))
|
29636
29690
|
return null;
|
29637
|
-
var
|
29638
|
-
if (rowIndex >=
|
29691
|
+
var rows = this.generatedVisibleRows;
|
29692
|
+
if (rowIndex >= rows.length)
|
29639
29693
|
return null;
|
29640
29694
|
var newValue = this.createNewValue();
|
29641
|
-
return this.getRowValueCore(
|
29695
|
+
return this.getRowValueCore(rows[rowIndex], newValue);
|
29642
29696
|
};
|
29643
29697
|
QuestionMatrixDropdownModelBase.prototype.checkIfValueInRowDuplicated = function (checkedRow, cellQuestion) {
|
29644
29698
|
if (!this.generatedVisibleRows)
|
@@ -30207,7 +30261,14 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
30207
30261
|
});
|
30208
30262
|
Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "hasInvisibleRows", {
|
30209
30263
|
get: function () {
|
30210
|
-
|
30264
|
+
var rows = this.generatedVisibleRows;
|
30265
|
+
if (!Array.isArray(rows))
|
30266
|
+
return false;
|
30267
|
+
for (var i = 0; i < rows.length; i++) {
|
30268
|
+
if (!rows[i].isVisible)
|
30269
|
+
return true;
|
30270
|
+
}
|
30271
|
+
return false;
|
30211
30272
|
},
|
30212
30273
|
enumerable: false,
|
30213
30274
|
configurable: true
|
@@ -30283,9 +30344,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
30283
30344
|
return { value: newValue, rowValue: rowValue };
|
30284
30345
|
};
|
30285
30346
|
QuestionMatrixDropdownModelBase.prototype.getRowIndex = function (row) {
|
30286
|
-
if (!this.generatedVisibleRows)
|
30347
|
+
if (!Array.isArray(this.generatedVisibleRows))
|
30287
30348
|
return -1;
|
30288
|
-
return this.
|
30349
|
+
return this.generatedVisibleRows.indexOf(row);
|
30289
30350
|
};
|
30290
30351
|
QuestionMatrixDropdownModelBase.prototype.getElementsInDesign = function (includeHidden) {
|
30291
30352
|
if (includeHidden === void 0) { includeHidden = false; }
|
@@ -30418,7 +30479,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
30418
30479
|
};
|
30419
30480
|
QuestionMatrixDropdownModelBase.prototype.clearInvisibleValuesInRows = function () {
|
30420
30481
|
var _a;
|
30421
|
-
if (this.isEmpty() || !this.isRowsFiltered)
|
30482
|
+
if (this.isEmpty() || !this.isRowsFiltered())
|
30422
30483
|
return;
|
30423
30484
|
var sharedQuestions = ((_a = this.survey) === null || _a === void 0 ? void 0 : _a.questionsByValueName(this.getValueName())) || [];
|
30424
30485
|
if (sharedQuestions.length < 2) {
|
@@ -30683,17 +30744,17 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30683
30744
|
if (!rows)
|
30684
30745
|
return res;
|
30685
30746
|
for (var i = 0; i < rows.length; i++) {
|
30686
|
-
var
|
30687
|
-
var val = value[
|
30747
|
+
var rowName = rows[i].rowName;
|
30748
|
+
var val = value[rowName];
|
30688
30749
|
if (!val)
|
30689
30750
|
continue;
|
30690
30751
|
if (keysAsText) {
|
30691
|
-
var displayRowValue = itemvalue_ItemValue.getTextOrHtmlByValue(this.rows,
|
30752
|
+
var displayRowValue = itemvalue_ItemValue.getTextOrHtmlByValue(this.rows, rowName);
|
30692
30753
|
if (!!displayRowValue) {
|
30693
|
-
|
30754
|
+
rowName = displayRowValue;
|
30694
30755
|
}
|
30695
30756
|
}
|
30696
|
-
res[
|
30757
|
+
res[rowName] = this.getRowDisplayValue(keysAsText, rows[i], val);
|
30697
30758
|
}
|
30698
30759
|
return res;
|
30699
30760
|
};
|
@@ -30748,11 +30809,11 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30748
30809
|
}
|
30749
30810
|
_super.prototype.clearGeneratedRows.call(this);
|
30750
30811
|
};
|
30751
|
-
QuestionMatrixDropdownModel.prototype.getRowValueForCreation = function (val,
|
30752
|
-
var res = val[
|
30812
|
+
QuestionMatrixDropdownModel.prototype.getRowValueForCreation = function (val, rowName) {
|
30813
|
+
var res = val[rowName];
|
30753
30814
|
if (!res)
|
30754
30815
|
return res;
|
30755
|
-
var names = this.defaultValuesInRows[
|
30816
|
+
var names = this.defaultValuesInRows[rowName];
|
30756
30817
|
if (!Array.isArray(names) || names.length === 0)
|
30757
30818
|
return res;
|
30758
30819
|
names.forEach(function (name) {
|
@@ -30799,8 +30860,8 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30799
30860
|
val = {};
|
30800
30861
|
for (var i = 0; i < this.rows.length; i++) {
|
30801
30862
|
var row = this.rows[i];
|
30802
|
-
var
|
30803
|
-
this.updateProgressInfoByRow(res, !!
|
30863
|
+
var rowName = val[row.value];
|
30864
|
+
this.updateProgressInfoByRow(res, !!rowName ? rowName : {});
|
30804
30865
|
}
|
30805
30866
|
};
|
30806
30867
|
return QuestionMatrixDropdownModel;
|
@@ -31634,6 +31695,10 @@ var MatrixDynamicRowModel = /** @class */ (function (_super) {
|
|
31634
31695
|
_this.buildCells(value);
|
31635
31696
|
return _this;
|
31636
31697
|
}
|
31698
|
+
MatrixDynamicRowModel.prototype.getRowIndex = function () {
|
31699
|
+
var res = _super.prototype.getRowIndex.call(this);
|
31700
|
+
return res > 0 ? res : this.index + 1;
|
31701
|
+
};
|
31637
31702
|
Object.defineProperty(MatrixDynamicRowModel.prototype, "rowName", {
|
31638
31703
|
get: function () {
|
31639
31704
|
return this.id;
|
@@ -31698,10 +31763,10 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31698
31763
|
};
|
31699
31764
|
_this.createLocalizableString("removeRowText", _this, false, "removeRow");
|
31700
31765
|
_this.createLocalizableString("emptyRowsText", _this, false, true);
|
31701
|
-
_this.registerPropertyChangedHandlers(["hideColumnsIfEmpty", "allowAddRows"], function () {
|
31702
|
-
_this.updateShowTableAndAddRow();
|
31703
|
-
});
|
31766
|
+
_this.registerPropertyChangedHandlers(["hideColumnsIfEmpty", "allowAddRows"], function () { _this.updateShowTableAndAddRow(); });
|
31704
31767
|
_this.registerPropertyChangedHandlers(["allowRowsDragAndDrop", "isReadOnly", "lockedRowCount"], function () { _this.resetRenderedTable(); });
|
31768
|
+
_this.registerPropertyChangedHandlers(["minRowCount"], function () { _this.onMinRowCountChanged(); });
|
31769
|
+
_this.registerPropertyChangedHandlers(["maxRowCount"], function () { _this.onMaxRowCountChanged(); });
|
31705
31770
|
_this.dragOrClickHelper = new dragOrClickHelper_DragOrClickHelper(_this.startDragMatrixRow);
|
31706
31771
|
return _this;
|
31707
31772
|
}
|
@@ -31809,7 +31874,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31809
31874
|
return (_super.prototype.isDefaultValueEmpty.call(this) && this.isValueEmpty(this.defaultRowValue));
|
31810
31875
|
};
|
31811
31876
|
QuestionMatrixDynamicModel.prototype.valueFromData = function (val) {
|
31812
|
-
if (this.minRowCount < 1)
|
31877
|
+
if (this.minRowCount < 1 || this.isEmpty())
|
31813
31878
|
return _super.prototype.valueFromData.call(this, val);
|
31814
31879
|
if (!Array.isArray(val))
|
31815
31880
|
val = [];
|
@@ -31863,6 +31928,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31863
31928
|
return this.rowCountValue;
|
31864
31929
|
},
|
31865
31930
|
set: function (val) {
|
31931
|
+
val = helpers_Helpers.getNumber(val);
|
31866
31932
|
if (val < 0 || val > settings.matrix.maxRowCount)
|
31867
31933
|
return;
|
31868
31934
|
this.setRowCountValueFromData = false;
|
@@ -31895,6 +31961,23 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31895
31961
|
enumerable: false,
|
31896
31962
|
configurable: true
|
31897
31963
|
});
|
31964
|
+
QuestionMatrixDynamicModel.prototype.updateBindingProp = function (propName, value) {
|
31965
|
+
_super.prototype.updateBindingProp.call(this, propName, value);
|
31966
|
+
var rows = this.generatedVisibleRows;
|
31967
|
+
if (propName !== "rowCount" || !Array.isArray(rows))
|
31968
|
+
return;
|
31969
|
+
var val = this.getUnbindValue(this.value) || [];
|
31970
|
+
if (val.length < rows.length) {
|
31971
|
+
var hasValue = false;
|
31972
|
+
for (var i = val.length; i < rows.length; i++) {
|
31973
|
+
hasValue || (hasValue = !rows[i].isEmpty);
|
31974
|
+
val.push(rows[i].value || {});
|
31975
|
+
}
|
31976
|
+
if (hasValue) {
|
31977
|
+
this.value = val;
|
31978
|
+
}
|
31979
|
+
}
|
31980
|
+
};
|
31898
31981
|
QuestionMatrixDynamicModel.prototype.updateProgressInfoByValues = function (res) {
|
31899
31982
|
var val = this.value;
|
31900
31983
|
if (!Array.isArray(val))
|
@@ -31979,14 +32062,19 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31979
32062
|
if (val < 0)
|
31980
32063
|
val = 0;
|
31981
32064
|
this.setPropertyValue("minRowCount", val);
|
31982
|
-
if (val > this.maxRowCount)
|
31983
|
-
this.maxRowCount = val;
|
31984
|
-
if (this.rowCount < val)
|
31985
|
-
this.rowCount = val;
|
31986
32065
|
},
|
31987
32066
|
enumerable: false,
|
31988
32067
|
configurable: true
|
31989
32068
|
});
|
32069
|
+
QuestionMatrixDynamicModel.prototype.onMinRowCountChanged = function () {
|
32070
|
+
var val = this.minRowCount;
|
32071
|
+
if (val > this.maxRowCount)
|
32072
|
+
this.maxRowCount = val;
|
32073
|
+
if (this.initialRowCount < val)
|
32074
|
+
this.initialRowCount = val;
|
32075
|
+
if (this.rowCount < val)
|
32076
|
+
this.rowCount = val;
|
32077
|
+
};
|
31990
32078
|
Object.defineProperty(QuestionMatrixDynamicModel.prototype, "maxRowCount", {
|
31991
32079
|
/**
|
31992
32080
|
* A maximum number of rows in the matrix. Users cannot add new rows if `rowCount` equals `maxRowCount`.
|
@@ -32007,14 +32095,17 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32007
32095
|
if (val == this.maxRowCount)
|
32008
32096
|
return;
|
32009
32097
|
this.setPropertyValue("maxRowCount", val);
|
32010
|
-
if (val < this.minRowCount)
|
32011
|
-
this.minRowCount = val;
|
32012
|
-
if (this.rowCount > val)
|
32013
|
-
this.rowCount = val;
|
32014
32098
|
},
|
32015
32099
|
enumerable: false,
|
32016
32100
|
configurable: true
|
32017
32101
|
});
|
32102
|
+
QuestionMatrixDynamicModel.prototype.onMaxRowCountChanged = function () {
|
32103
|
+
var val = this.maxRowCount;
|
32104
|
+
if (val < this.minRowCount)
|
32105
|
+
this.minRowCount = val;
|
32106
|
+
if (this.rowCount > val)
|
32107
|
+
this.rowCount = val;
|
32108
|
+
};
|
32018
32109
|
Object.defineProperty(QuestionMatrixDynamicModel.prototype, "allowAddRows", {
|
32019
32110
|
/**
|
32020
32111
|
* Specifies whether users are allowed to add new rows.
|
@@ -32109,6 +32200,8 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32109
32200
|
this.addRow(true);
|
32110
32201
|
};
|
32111
32202
|
QuestionMatrixDynamicModel.prototype.getQuestionToFocusOnAddingRow = function () {
|
32203
|
+
if (this.visibleRows.length === 0)
|
32204
|
+
return null;
|
32112
32205
|
var row = this.visibleRows[this.visibleRows.length - 1];
|
32113
32206
|
for (var i = 0; i < row.cells.length; i++) {
|
32114
32207
|
var q = row.cells[i].question;
|
@@ -32186,8 +32279,9 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32186
32279
|
}
|
32187
32280
|
if (this.data) {
|
32188
32281
|
this.runCellsCondition(this.getDataFilteredValues(), this.getDataFilteredProperties());
|
32189
|
-
|
32190
|
-
|
32282
|
+
var rows = this.visibleRows;
|
32283
|
+
if (this.isValueEmpty(defaultValue) && rows.length > 0) {
|
32284
|
+
var row = rows[rows.length - 1];
|
32191
32285
|
if (!this.isValueEmpty(row.value)) {
|
32192
32286
|
if (!newValue) {
|
32193
32287
|
newValue = this.createNewValue();
|
@@ -32201,8 +32295,10 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32201
32295
|
}
|
32202
32296
|
}
|
32203
32297
|
if (this.survey) {
|
32204
|
-
|
32205
|
-
|
32298
|
+
var rows = this.visibleRows;
|
32299
|
+
if (prevRowCount + 1 == this.rowCount && rows.length > 0) {
|
32300
|
+
var row = rows[rows.length - 1];
|
32301
|
+
this.survey.matrixRowAdded(this, row);
|
32206
32302
|
this.onRowsChanged();
|
32207
32303
|
}
|
32208
32304
|
}
|
@@ -32636,6 +32732,8 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32636
32732
|
return result;
|
32637
32733
|
};
|
32638
32734
|
QuestionMatrixDynamicModel.prototype.deleteRowValue = function (newValue, row) {
|
32735
|
+
if (!Array.isArray(newValue))
|
32736
|
+
return newValue;
|
32639
32737
|
var isEmpty = true;
|
32640
32738
|
for (var i = 0; i < newValue.length; i++) {
|
32641
32739
|
if (this.isObject(newValue[i]) && Object.keys(newValue[i]).length > 0) {
|
@@ -33477,6 +33575,7 @@ var defaultV2Css = {
|
|
33477
33575
|
changeCameraButton: "sd-file__change-camera-button",
|
33478
33576
|
takePictureButton: "sd-file__take-picture-button",
|
33479
33577
|
loadingIndicator: "sd-file__loading-indicator",
|
33578
|
+
page: "sd-file__page"
|
33480
33579
|
},
|
33481
33580
|
signaturepad: {
|
33482
33581
|
mainRoot: "sd-element sd-question sd-question--signature sd-row__question",
|
@@ -33807,7 +33906,8 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
|
|
33807
33906
|
function SurveyTimer() {
|
33808
33907
|
this.listenerCounter = 0;
|
33809
33908
|
this.timerId = -1;
|
33810
|
-
this.
|
33909
|
+
this.onTimerTick = new EventBase();
|
33910
|
+
this.onTimer = this.onTimerTick;
|
33811
33911
|
}
|
33812
33912
|
Object.defineProperty(SurveyTimer, "instance", {
|
33813
33913
|
get: function () {
|
@@ -33823,7 +33923,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
|
|
33823
33923
|
var _this = this;
|
33824
33924
|
if (func === void 0) { func = null; }
|
33825
33925
|
if (func) {
|
33826
|
-
this.
|
33926
|
+
this.onTimerTick.add(func);
|
33827
33927
|
}
|
33828
33928
|
this.prevTimeInMs = surveyTimerFunctions.now();
|
33829
33929
|
if (this.timerId < 0) {
|
@@ -33836,7 +33936,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
|
|
33836
33936
|
SurveyTimer.prototype.stop = function (func) {
|
33837
33937
|
if (func === void 0) { func = null; }
|
33838
33938
|
if (func) {
|
33839
|
-
this.
|
33939
|
+
this.onTimerTick.remove(func);
|
33840
33940
|
}
|
33841
33941
|
this.listenerCounter--;
|
33842
33942
|
if (this.listenerCounter == 0 && this.timerId > -1) {
|
@@ -33846,7 +33946,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
|
|
33846
33946
|
};
|
33847
33947
|
SurveyTimer.prototype.doTimer = function () {
|
33848
33948
|
var _this = this;
|
33849
|
-
if (this.
|
33949
|
+
if (this.onTimerTick.isEmpty || this.listenerCounter == 0) {
|
33850
33950
|
this.timerId = -1;
|
33851
33951
|
}
|
33852
33952
|
if (this.timerId < 0)
|
@@ -33858,7 +33958,7 @@ var surveytimer_SurveyTimer = /** @class */ (function () {
|
|
33858
33958
|
seconds = 1;
|
33859
33959
|
}
|
33860
33960
|
var prevItem = this.timerId;
|
33861
|
-
this.
|
33961
|
+
this.onTimerTick.fire(this, { seconds: seconds });
|
33862
33962
|
//We have to check that we have the same timerId
|
33863
33963
|
//It could be changed during events execution and it will lead to double timer events
|
33864
33964
|
if (prevItem !== this.timerId)
|
@@ -33958,8 +34058,8 @@ var surveyTimerModel_SurveyTimerModel = /** @class */ (function (_super) {
|
|
33958
34058
|
}
|
33959
34059
|
this.spent = this.spent + seconds;
|
33960
34060
|
this.update();
|
33961
|
-
if (this.
|
33962
|
-
this.
|
34061
|
+
if (this.onTimerTick) {
|
34062
|
+
this.onTimerTick(page);
|
33963
34063
|
}
|
33964
34064
|
};
|
33965
34065
|
SurveyTimerModel.prototype.updateProgress = function () {
|
@@ -34350,7 +34450,7 @@ var header_Cover = /** @class */ (function (_super) {
|
|
34350
34450
|
return this.height ? Math.max(this.height, this.actualHeight + 40) + "px" : undefined;
|
34351
34451
|
}
|
34352
34452
|
if (this.survey && this.survey.isMobile) {
|
34353
|
-
return this.mobileHeight ? Math.max(this.mobileHeight, this.actualHeight
|
34453
|
+
return this.mobileHeight ? Math.max(this.mobileHeight, this.actualHeight) + "px" : undefined;
|
34354
34454
|
}
|
34355
34455
|
return undefined;
|
34356
34456
|
},
|
@@ -34431,13 +34531,19 @@ var header_Cover = /** @class */ (function (_super) {
|
|
34431
34531
|
};
|
34432
34532
|
Cover.prototype.processResponsiveness = function (width) {
|
34433
34533
|
if (this.survey && this.survey.rootElement) {
|
34434
|
-
|
34435
|
-
|
34436
|
-
|
34437
|
-
|
34438
|
-
|
34439
|
-
|
34440
|
-
|
34534
|
+
if (!this.survey.isMobile) {
|
34535
|
+
var logoEl = this.survey.rootElement.querySelectorAll(".sv-header__logo")[0];
|
34536
|
+
var titleEl = this.survey.rootElement.querySelectorAll(".sv-header__title")[0];
|
34537
|
+
var descriptionEl = this.survey.rootElement.querySelectorAll(".sv-header__description")[0];
|
34538
|
+
var logoHeight = logoEl ? logoEl.getBoundingClientRect().height : 0;
|
34539
|
+
var titleHeight = titleEl ? titleEl.getBoundingClientRect().height : 0;
|
34540
|
+
var descriptionHeight = descriptionEl ? descriptionEl.getBoundingClientRect().height : 0;
|
34541
|
+
this.actualHeight = this.calculateActualHeight(logoHeight, titleHeight, descriptionHeight);
|
34542
|
+
}
|
34543
|
+
else {
|
34544
|
+
var headerContainer = this.survey.rootElement.querySelectorAll(".sv-header > div")[0];
|
34545
|
+
this.actualHeight = headerContainer ? headerContainer.getBoundingClientRect().height : 0;
|
34546
|
+
}
|
34441
34547
|
}
|
34442
34548
|
};
|
34443
34549
|
Object.defineProperty(Cover.prototype, "hasBackground", {
|
@@ -35710,7 +35816,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
35710
35816
|
PanelModelBase.prototype.getValue = function () {
|
35711
35817
|
var data = {};
|
35712
35818
|
this.collectValues(data, 0);
|
35713
|
-
return data;
|
35819
|
+
return helpers_Helpers.getUnbindValue(data);
|
35714
35820
|
};
|
35715
35821
|
PanelModelBase.prototype.collectValues = function (data, level) {
|
35716
35822
|
var elements = this.elements;
|
@@ -37107,6 +37213,9 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
37107
37213
|
}
|
37108
37214
|
return this.layoutColumns.slice(0, tailIndex + 1);
|
37109
37215
|
};
|
37216
|
+
PanelModelBase.prototype.afterRender = function (el) {
|
37217
|
+
this.afterRenderCore(el);
|
37218
|
+
};
|
37110
37219
|
PanelModelBase.prototype.dispose = function () {
|
37111
37220
|
_super.prototype.dispose.call(this);
|
37112
37221
|
if (this.rows) {
|
@@ -37579,6 +37688,11 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
37579
37688
|
PanelModel.prototype.getContainerCss = function () {
|
37580
37689
|
return this.getCssRoot(this.cssClasses.panel);
|
37581
37690
|
};
|
37691
|
+
PanelModel.prototype.afterRenderCore = function (element) {
|
37692
|
+
var _a;
|
37693
|
+
_super.prototype.afterRenderCore.call(this, element);
|
37694
|
+
(_a = this.survey) === null || _a === void 0 ? void 0 : _a.afterRenderPanel(this, element);
|
37695
|
+
};
|
37582
37696
|
return PanelModel;
|
37583
37697
|
}(panel_PanelModelBase));
|
37584
37698
|
|
@@ -37932,7 +38046,7 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
37932
38046
|
_this.hasShownValue = false;
|
37933
38047
|
/**
|
37934
38048
|
* A time period that a respondent has spent on this page so far; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
37935
|
-
* @see
|
38049
|
+
* @see timeLimit
|
37936
38050
|
*/
|
37937
38051
|
_this.timeSpent = 0;
|
37938
38052
|
_this.createLocalizableString("navigationDescription", _this, true);
|
@@ -38219,12 +38333,6 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
38219
38333
|
this.survey.scrollElementToTop(this, null, this, this.id);
|
38220
38334
|
}
|
38221
38335
|
};
|
38222
|
-
// public get timeSpent(): number {
|
38223
|
-
// return this.getPropertyValue("timeSpent", 0);
|
38224
|
-
// }
|
38225
|
-
// public set timeSpent(val: number) {
|
38226
|
-
// this.setPropertyValue("timeSpent", val);
|
38227
|
-
// }
|
38228
38336
|
/**
|
38229
38337
|
* Returns a list of all panels on this page.
|
38230
38338
|
* @param visibleOnly A Boolean value that specifies whether to include only visible panels.
|
@@ -38242,28 +38350,42 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
38242
38350
|
if (includingDesignTime === void 0) { includingDesignTime = false; }
|
38243
38351
|
return this.getAllPanels(visibleOnly, includingDesignTime);
|
38244
38352
|
};
|
38245
|
-
Object.defineProperty(PageModel.prototype, "
|
38353
|
+
Object.defineProperty(PageModel.prototype, "timeLimit", {
|
38246
38354
|
/**
|
38247
38355
|
* A time period that a respondent has to complete this page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
38248
38356
|
*
|
38249
|
-
*
|
38357
|
+
* Default value: 0 (time is unlimited)
|
38250
38358
|
*
|
38251
|
-
* Alternatively, you can use the `SurveyModel`'s [`
|
38359
|
+
* Alternatively, you can use the `SurveyModel`'s [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/surveymodel#timeLimitPerPage) property to specify identical time periods for all survey pages.
|
38252
38360
|
* @see timeSpent
|
38253
38361
|
*/
|
38254
38362
|
get: function () {
|
38255
|
-
return this.getPropertyValue("
|
38363
|
+
return this.getPropertyValue("timeLimit", 0);
|
38256
38364
|
},
|
38257
38365
|
set: function (val) {
|
38258
|
-
this.setPropertyValue("
|
38366
|
+
this.setPropertyValue("timeLimit", val);
|
38367
|
+
},
|
38368
|
+
enumerable: false,
|
38369
|
+
configurable: true
|
38370
|
+
});
|
38371
|
+
Object.defineProperty(PageModel.prototype, "maxTimeToFinish", {
|
38372
|
+
/**
|
38373
|
+
* Obsolete. Use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeLimit) property instead.
|
38374
|
+
* @deprecated
|
38375
|
+
*/
|
38376
|
+
get: function () {
|
38377
|
+
return this.timeLimit;
|
38378
|
+
},
|
38379
|
+
set: function (val) {
|
38380
|
+
this.timeLimit = val;
|
38259
38381
|
},
|
38260
38382
|
enumerable: false,
|
38261
38383
|
configurable: true
|
38262
38384
|
});
|
38263
38385
|
PageModel.prototype.getMaxTimeToFinish = function () {
|
38264
|
-
if (this.
|
38265
|
-
return this.
|
38266
|
-
var res = !!this.survey ? this.survey.
|
38386
|
+
if (this.timeLimit !== 0)
|
38387
|
+
return this.timeLimit;
|
38388
|
+
var res = !!this.survey ? this.survey.timeLimitPerPage : 0;
|
38267
38389
|
return res > 0 ? res : 0;
|
38268
38390
|
};
|
38269
38391
|
PageModel.prototype.onNumChanged = function (value) { };
|
@@ -38305,7 +38427,7 @@ Serializer.addClass("page", [
|
|
38305
38427
|
default: "inherit",
|
38306
38428
|
choices: ["inherit", "show", "hide"],
|
38307
38429
|
},
|
38308
|
-
{ name: "
|
38430
|
+
{ name: "timeLimit:number", alternativeName: "maxTimeToFinish", default: 0, minValue: 0 },
|
38309
38431
|
{
|
38310
38432
|
name: "navigationTitle",
|
38311
38433
|
visibleIf: function (obj) {
|
@@ -39331,12 +39453,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39331
39453
|
* An event that is raised every second while the timer is running.
|
39332
39454
|
*
|
39333
39455
|
* Use the [`timeSpent`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeSpent) property to find out how many seconds have elapsed.
|
39334
|
-
* @see
|
39335
|
-
* @see
|
39336
|
-
* @see
|
39456
|
+
* @see timeLimit
|
39457
|
+
* @see timeLimitPerPage
|
39458
|
+
* @see showTimer
|
39459
|
+
* @see timerLocation
|
39337
39460
|
* @see startTimer
|
39338
39461
|
*/
|
39339
|
-
_this.
|
39462
|
+
_this.onTimerTick = _this.addEvent();
|
39463
|
+
/**
|
39464
|
+
* Obsolete. Use the [`onTimerTick`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTimerTick) event instead.
|
39465
|
+
* @deprecated
|
39466
|
+
*/
|
39467
|
+
_this.onTimer = _this.onTimerTick;
|
39340
39468
|
_this.onTimerPanelInfoText = _this.addEvent();
|
39341
39469
|
/**
|
39342
39470
|
* An event that is raised after an item value is changed in a panel within a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question.
|
@@ -39433,6 +39561,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39433
39561
|
*/
|
39434
39562
|
_this.jsonErrors = null;
|
39435
39563
|
_this.cssValue = null;
|
39564
|
+
/**
|
39565
|
+
* Specifies whether the [Complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page) should display the [survey header](https://surveyjs.io/form-library/examples/brand-your-survey-header/).
|
39566
|
+
*
|
39567
|
+
* Possible values:
|
39568
|
+
*
|
39569
|
+
* - `true` - Displays the survey header on the Complete page.
|
39570
|
+
* - `false` - Hides the header when users reach the Complete page.
|
39571
|
+
* - `"auto"` (default) - Displays a header with the basic view, but hides a header with the advanced view (see the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property description).
|
39572
|
+
*
|
39573
|
+
* > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
|
39574
|
+
*/
|
39575
|
+
_this.showHeaderOnCompletePage = "auto";
|
39436
39576
|
_this._isLazyRenderingSuspended = false;
|
39437
39577
|
/**
|
39438
39578
|
* Specifies whether to hide validation errors thrown by the Required validation in the UI.
|
@@ -39464,6 +39604,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39464
39604
|
_this.isNavigationButtonPressed = false;
|
39465
39605
|
_this.mouseDownPage = null;
|
39466
39606
|
_this.isCalculatingProgressText = false;
|
39607
|
+
_this.isSmoothScrollEnabled = false;
|
39467
39608
|
/**
|
39468
39609
|
* An event that is raised when the survey's width or height is changed.
|
39469
39610
|
*/
|
@@ -39509,7 +39650,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39509
39650
|
_this.createLocalizableString("editText", _this, false, true);
|
39510
39651
|
_this.createLocalizableString("questionTitleTemplate", _this, true);
|
39511
39652
|
_this.timerModelValue = new surveyTimerModel_SurveyTimerModel(_this);
|
39512
|
-
_this.timerModelValue.
|
39653
|
+
_this.timerModelValue.onTimerTick = function (page) {
|
39513
39654
|
_this.doTimer(page);
|
39514
39655
|
};
|
39515
39656
|
_this.createNewArray("pages", function (value) {
|
@@ -39886,7 +40027,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39886
40027
|
Object.defineProperty(SurveyModel.prototype, "bodyCss", {
|
39887
40028
|
get: function () {
|
39888
40029
|
return new CssClassBuilder().append(this.css.body)
|
39889
|
-
.append(this.css.bodyWithTimer, this.
|
40030
|
+
.append(this.css.bodyWithTimer, this.showTimer && this.state === "running")
|
39890
40031
|
.append(this.css.body + "--" + this.calculatedWidthMode).toString();
|
39891
40032
|
},
|
39892
40033
|
enumerable: false,
|
@@ -44513,7 +44654,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44513
44654
|
this.onGetMatrixRowActions.fire(this, options);
|
44514
44655
|
return options.actions;
|
44515
44656
|
};
|
44516
|
-
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement) {
|
44657
|
+
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement, onScolledCallback) {
|
44517
44658
|
var _this = this;
|
44518
44659
|
var options = {
|
44519
44660
|
element: element,
|
@@ -44525,7 +44666,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44525
44666
|
this.onScrollingElementToTop.fire(this, options);
|
44526
44667
|
if (!options.cancel) {
|
44527
44668
|
var elementPage_1 = this.getPageByElement(element);
|
44528
|
-
if (this.isLazyRendering) {
|
44669
|
+
if (this.isLazyRendering && !!elementPage_1) {
|
44529
44670
|
var elementsToRenderBefore = 1;
|
44530
44671
|
var rootElement = settings.environment.rootElement;
|
44531
44672
|
var surveyRootElement = this.rootElement || passedRootElement || rootElement;
|
@@ -44537,11 +44678,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44537
44678
|
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, function () {
|
44538
44679
|
_this.releaseLazyRendering();
|
44539
44680
|
activateLazyRenderingChecks(elementPage_1.id);
|
44681
|
+
onScolledCallback && onScolledCallback();
|
44540
44682
|
});
|
44541
44683
|
}, elementsToRenderBefore);
|
44542
44684
|
}
|
44543
44685
|
else {
|
44544
|
-
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
|
44686
|
+
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, onScolledCallback);
|
44545
44687
|
}
|
44546
44688
|
}
|
44547
44689
|
};
|
@@ -46289,64 +46431,117 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46289
46431
|
};
|
46290
46432
|
Object.defineProperty(SurveyModel.prototype, "showTimerPanel", {
|
46291
46433
|
/**
|
46292
|
-
*
|
46434
|
+
* Obsolete. Use the [`showTimer`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer) and [`timerLocation`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerLocation) properties instead.
|
46435
|
+
* @deprecated
|
46436
|
+
*/
|
46437
|
+
get: function () {
|
46438
|
+
if (!this.showTimer)
|
46439
|
+
return "none";
|
46440
|
+
return this.timerLocation;
|
46441
|
+
},
|
46442
|
+
set: function (val) {
|
46443
|
+
this.showTimer = val !== "none";
|
46444
|
+
if (this.showTimer) {
|
46445
|
+
this.timerLocation = val;
|
46446
|
+
}
|
46447
|
+
},
|
46448
|
+
enumerable: false,
|
46449
|
+
configurable: true
|
46450
|
+
});
|
46451
|
+
Object.defineProperty(SurveyModel.prototype, "showTimer", {
|
46452
|
+
/**
|
46453
|
+
* Specifies the timer's visibility. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
46293
46454
|
*
|
46294
|
-
*
|
46455
|
+
* Default value: `false`
|
46295
46456
|
*
|
46296
|
-
*
|
46297
|
-
* - `"bottom"` - Displays the timer panel at the bottom of the survey.
|
46298
|
-
* - `"none"` (default) - Hides the timer panel.
|
46457
|
+
* If you set this property to `true`, the timer starts automatically when the survey begins. To specify time limits, use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimit) and [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimitPerPage) properties.
|
46299
46458
|
*
|
46300
|
-
*
|
46459
|
+
* The timer displays information about time spent on an individual page and the entire survey. If you want to display only the page timer or the survey timer, set the [`timerInfoMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerInfoMode) property to `"page"` or `"survey"`.
|
46301
46460
|
*
|
46302
|
-
*
|
46303
|
-
* @see
|
46304
|
-
* @see stopTimer
|
46461
|
+
* You can enable the timer without displaying it. In this case, you need to specify the required time limits and use the [`startTimer()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#startTimer) and [`stopTimer()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#stopTimer) methods to control the timer.
|
46462
|
+
* @see timerLocation
|
46305
46463
|
* @see timeSpent
|
46306
|
-
* @see
|
46464
|
+
* @see onTimerTick
|
46307
46465
|
*/
|
46308
46466
|
get: function () {
|
46309
|
-
return this.getPropertyValue("
|
46467
|
+
return this.getPropertyValue("showTimer");
|
46310
46468
|
},
|
46311
46469
|
set: function (val) {
|
46312
|
-
this.setPropertyValue("
|
46470
|
+
this.setPropertyValue("showTimer", val);
|
46471
|
+
},
|
46472
|
+
enumerable: false,
|
46473
|
+
configurable: true
|
46474
|
+
});
|
46475
|
+
Object.defineProperty(SurveyModel.prototype, "timerLocation", {
|
46476
|
+
/**
|
46477
|
+
* Specifies the timer's position relative to the survey. Applies only if the [`showTimer`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer) property is set to `true`.
|
46478
|
+
*
|
46479
|
+
* Possible values:
|
46480
|
+
*
|
46481
|
+
* - `"top"` (default) - Displays the timer at the top of the survey.
|
46482
|
+
* - `"bottom"` - Displays the timer at the bottom of the survey.
|
46483
|
+
* @see onTimerTick
|
46484
|
+
*/
|
46485
|
+
get: function () {
|
46486
|
+
return this.getPropertyValue("timerLocation");
|
46487
|
+
},
|
46488
|
+
set: function (val) {
|
46489
|
+
this.setPropertyValue("timerLocation", val);
|
46313
46490
|
},
|
46314
46491
|
enumerable: false,
|
46315
46492
|
configurable: true
|
46316
46493
|
});
|
46317
46494
|
Object.defineProperty(SurveyModel.prototype, "isTimerPanelShowingOnTop", {
|
46318
46495
|
get: function () {
|
46319
|
-
return this.
|
46496
|
+
return this.showTimer && this.timerLocation === "top";
|
46320
46497
|
},
|
46321
46498
|
enumerable: false,
|
46322
46499
|
configurable: true
|
46323
46500
|
});
|
46324
46501
|
Object.defineProperty(SurveyModel.prototype, "isTimerPanelShowingOnBottom", {
|
46325
46502
|
get: function () {
|
46326
|
-
return this.
|
46503
|
+
return this.showTimer && this.timerLocation === "bottom";
|
46327
46504
|
},
|
46328
46505
|
enumerable: false,
|
46329
46506
|
configurable: true
|
46330
46507
|
});
|
46331
|
-
Object.defineProperty(SurveyModel.prototype, "
|
46508
|
+
Object.defineProperty(SurveyModel.prototype, "timerInfoMode", {
|
46332
46509
|
/**
|
46333
|
-
* Specifies whether the timer panel displays timers for the current page, the entire survey, or both. Applies only if the timer panel is [visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#
|
46510
|
+
* Specifies whether the timer panel displays timers for the current page, the entire survey, or both. Applies only if the timer panel is [visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTimer).
|
46334
46511
|
*
|
46335
46512
|
* Possible values:
|
46336
46513
|
*
|
46337
46514
|
* - `"survey"` - Displays only the survey timer.
|
46338
46515
|
* - `"page"` - Displays only the page timer.
|
46339
|
-
* - `"
|
46516
|
+
* - `"combined"` (default) - Displays both the survey and page timers.
|
46340
46517
|
* @see timeSpent
|
46341
|
-
* @see
|
46518
|
+
* @see onTimerTick
|
46342
46519
|
* @see startTimer
|
46343
46520
|
* @see stopTimer
|
46344
46521
|
*/
|
46345
46522
|
get: function () {
|
46346
|
-
return this.getPropertyValue("
|
46523
|
+
return this.getTimerInfoVal(this.getPropertyValue("timerInfoMode"));
|
46524
|
+
},
|
46525
|
+
set: function (val) {
|
46526
|
+
this.setPropertyValue("timerInfoMode", val);
|
46527
|
+
},
|
46528
|
+
enumerable: false,
|
46529
|
+
configurable: true
|
46530
|
+
});
|
46531
|
+
SurveyModel.prototype.getTimerInfoVal = function (val) {
|
46532
|
+
return val === "all" ? "combined" : val;
|
46533
|
+
};
|
46534
|
+
Object.defineProperty(SurveyModel.prototype, "showTimerPanelMode", {
|
46535
|
+
/**
|
46536
|
+
* Obsolete. Use the [`timerInfoMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timerInfoMode) property instead.
|
46537
|
+
* @deprecated
|
46538
|
+
*/
|
46539
|
+
get: function () {
|
46540
|
+
var res = this.timerInfoMode;
|
46541
|
+
return res === "combined" ? "all" : res;
|
46347
46542
|
},
|
46348
46543
|
set: function (val) {
|
46349
|
-
this.
|
46544
|
+
this.timerInfoMode = this.getTimerInfoVal(val);
|
46350
46545
|
},
|
46351
46546
|
enumerable: false,
|
46352
46547
|
configurable: true
|
@@ -46465,11 +46660,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46465
46660
|
var pageSpent = page.timeSpent;
|
46466
46661
|
var surveySpent = this.timeSpent;
|
46467
46662
|
var pageLimitSec = page.getMaxTimeToFinish();
|
46468
|
-
var surveyLimit = this.
|
46469
|
-
if (this.
|
46663
|
+
var surveyLimit = this.timeLimit;
|
46664
|
+
if (this.timerInfoMode == "page") {
|
46470
46665
|
return { spent: pageSpent, limit: pageLimitSec };
|
46471
46666
|
}
|
46472
|
-
if (this.
|
46667
|
+
if (this.timerInfoMode == "survey") {
|
46473
46668
|
return { spent: surveySpent, limit: surveyLimit };
|
46474
46669
|
}
|
46475
46670
|
else {
|
@@ -46495,16 +46690,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46495
46690
|
var surveySpent = this.getDisplayTime(this.timeSpent);
|
46496
46691
|
var pageLimitSec = page.getMaxTimeToFinish();
|
46497
46692
|
var pageLimit = this.getDisplayTime(pageLimitSec);
|
46498
|
-
var surveyLimit = this.getDisplayTime(this.
|
46499
|
-
if (this.
|
46693
|
+
var surveyLimit = this.getDisplayTime(this.timeLimit);
|
46694
|
+
if (this.timerInfoMode == "page")
|
46500
46695
|
return this.getTimerInfoPageText(page, pageSpent, pageLimit);
|
46501
|
-
if (this.
|
46696
|
+
if (this.timerInfoMode == "survey")
|
46502
46697
|
return this.getTimerInfoSurveyText(surveySpent, surveyLimit);
|
46503
|
-
if (this.
|
46504
|
-
if (pageLimitSec <= 0 && this.
|
46698
|
+
if (this.timerInfoMode == "combined") {
|
46699
|
+
if (pageLimitSec <= 0 && this.timeLimit <= 0) {
|
46505
46700
|
return this.getLocalizationFormatString("timerSpentAll", pageSpent, surveySpent);
|
46506
46701
|
}
|
46507
|
-
if (pageLimitSec > 0 && this.
|
46702
|
+
if (pageLimitSec > 0 && this.timeLimit > 0) {
|
46508
46703
|
return this.getLocalizationFormatString("timerLimitAll", pageSpent, pageLimit, surveySpent, surveyLimit);
|
46509
46704
|
}
|
46510
46705
|
var pageText = this.getTimerInfoPageText(page, pageSpent, pageLimit);
|
@@ -46519,7 +46714,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46519
46714
|
: this.getLocalizationFormatString("timerSpentPage", pageSpent, pageLimit);
|
46520
46715
|
};
|
46521
46716
|
SurveyModel.prototype.getTimerInfoSurveyText = function (surveySpent, surveyLimit) {
|
46522
|
-
var strName = this.
|
46717
|
+
var strName = this.timeLimit > 0 ? "timerLimitSurvey" : "timerSpentSurvey";
|
46523
46718
|
return this.getLocalizationFormatString(strName, surveySpent, surveyLimit);
|
46524
46719
|
};
|
46525
46720
|
SurveyModel.prototype.getDisplayClockTime = function (val) {
|
@@ -46555,10 +46750,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46555
46750
|
/**
|
46556
46751
|
* Starts a timer that calculates how many seconds a respondent has spent on the survey. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
46557
46752
|
* @see stopTimer
|
46558
|
-
* @see
|
46559
|
-
* @see
|
46753
|
+
* @see timeLimit
|
46754
|
+
* @see timeLimitPerPage
|
46560
46755
|
* @see timeSpent
|
46561
|
-
* @see
|
46756
|
+
* @see onTimerTick
|
46562
46757
|
*/
|
46563
46758
|
SurveyModel.prototype.startTimer = function () {
|
46564
46759
|
if (this.isEditMode) {
|
@@ -46566,17 +46761,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46566
46761
|
}
|
46567
46762
|
};
|
46568
46763
|
SurveyModel.prototype.startTimerFromUI = function () {
|
46569
|
-
if (this.
|
46764
|
+
if (this.showTimer && this.state === "running") {
|
46570
46765
|
this.startTimer();
|
46571
46766
|
}
|
46572
46767
|
};
|
46573
46768
|
/**
|
46574
46769
|
* Stops the timer. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
46575
46770
|
* @see startTimer
|
46576
|
-
* @see
|
46577
|
-
* @see
|
46771
|
+
* @see timeLimit
|
46772
|
+
* @see timeLimitPerPage
|
46578
46773
|
* @see timeSpent
|
46579
|
-
* @see
|
46774
|
+
* @see onTimerTick
|
46580
46775
|
*/
|
46581
46776
|
SurveyModel.prototype.stopTimer = function () {
|
46582
46777
|
this.timerModel.stop();
|
@@ -46588,8 +46783,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46588
46783
|
* Assign a number to this property if you need to start the quiz timer from a specific time (for instance, if you want to continue an interrupted quiz).
|
46589
46784
|
*
|
46590
46785
|
* You can also find out how many seconds a respondent has spent on an individual survey page. To do this, use the [`timeSpent`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeSpent) property of a [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model) object.
|
46591
|
-
* @see
|
46592
|
-
* @see
|
46786
|
+
* @see timeLimit
|
46787
|
+
* @see timeLimitPerPage
|
46593
46788
|
* @see startTimer
|
46594
46789
|
*/
|
46595
46790
|
get: function () { return this.timerModel.spent; },
|
@@ -46597,52 +46792,80 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46597
46792
|
enumerable: false,
|
46598
46793
|
configurable: true
|
46599
46794
|
});
|
46600
|
-
Object.defineProperty(SurveyModel.prototype, "
|
46795
|
+
Object.defineProperty(SurveyModel.prototype, "timeLimit", {
|
46601
46796
|
/**
|
46602
46797
|
* A time period that a respondent has to complete the survey; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
46603
46798
|
*
|
46604
|
-
*
|
46799
|
+
* Default value: 0 (time is unlimited)
|
46605
46800
|
*
|
46606
46801
|
* [View Demo](https://surveyjs.io/form-library/examples/make-quiz-javascript/ (linkStyle))
|
46607
|
-
* @see
|
46802
|
+
* @see timeLimitPerPage
|
46608
46803
|
* @see startTimer
|
46609
46804
|
* @see timeSpent
|
46610
46805
|
*/
|
46611
46806
|
get: function () {
|
46612
|
-
return this.getPropertyValue("
|
46807
|
+
return this.getPropertyValue("timeLimit", 0);
|
46613
46808
|
},
|
46614
46809
|
set: function (val) {
|
46615
|
-
this.setPropertyValue("
|
46810
|
+
this.setPropertyValue("timeLimit", val);
|
46616
46811
|
},
|
46617
46812
|
enumerable: false,
|
46618
46813
|
configurable: true
|
46619
46814
|
});
|
46620
|
-
Object.defineProperty(SurveyModel.prototype, "
|
46815
|
+
Object.defineProperty(SurveyModel.prototype, "maxTimeToFinish", {
|
46816
|
+
/**
|
46817
|
+
* Obsolete. Use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimit) property instead.
|
46818
|
+
* @deprecated
|
46819
|
+
*/
|
46820
|
+
get: function () {
|
46821
|
+
return this.timeLimit;
|
46822
|
+
},
|
46823
|
+
set: function (val) {
|
46824
|
+
this.timeLimit = val;
|
46825
|
+
},
|
46826
|
+
enumerable: false,
|
46827
|
+
configurable: true
|
46828
|
+
});
|
46829
|
+
Object.defineProperty(SurveyModel.prototype, "timeLimitPerPage", {
|
46621
46830
|
/**
|
46622
46831
|
* A time period that a respondent has to complete each survey page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
46623
46832
|
*
|
46624
|
-
*
|
46833
|
+
* Default value: 0 (time is unlimited)
|
46625
46834
|
*
|
46626
|
-
* You can also use `PageModel`'s [`
|
46835
|
+
* You can also use `PageModel`'s [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeLimit) property to specify a time period for an individual survey page.
|
46627
46836
|
*
|
46628
46837
|
* [View Demo](https://surveyjs.io/form-library/examples/make-quiz-javascript/ (linkStyle))
|
46629
|
-
* @see
|
46838
|
+
* @see timeLimit
|
46630
46839
|
* @see startTimer
|
46631
46840
|
* @see timeSpent
|
46632
46841
|
*/
|
46633
46842
|
get: function () {
|
46634
|
-
return this.getPropertyValue("
|
46843
|
+
return this.getPropertyValue("timeLimitPerPage", 0);
|
46635
46844
|
},
|
46636
46845
|
set: function (val) {
|
46637
|
-
this.setPropertyValue("
|
46846
|
+
this.setPropertyValue("timeLimitPerPage", val);
|
46847
|
+
},
|
46848
|
+
enumerable: false,
|
46849
|
+
configurable: true
|
46850
|
+
});
|
46851
|
+
Object.defineProperty(SurveyModel.prototype, "maxTimeToFinishPage", {
|
46852
|
+
/**
|
46853
|
+
* Obsolete. Use the [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeLimitPerPage) property instead.
|
46854
|
+
* @deprecated
|
46855
|
+
*/
|
46856
|
+
get: function () {
|
46857
|
+
return this.timeLimitPerPage;
|
46858
|
+
},
|
46859
|
+
set: function (val) {
|
46860
|
+
this.timeLimitPerPage = val;
|
46638
46861
|
},
|
46639
46862
|
enumerable: false,
|
46640
46863
|
configurable: true
|
46641
46864
|
});
|
46642
46865
|
SurveyModel.prototype.doTimer = function (page) {
|
46643
|
-
this.
|
46644
|
-
if (this.
|
46645
|
-
this.timeSpent = this.
|
46866
|
+
this.onTimerTick.fire(this, {});
|
46867
|
+
if (this.timeLimit > 0 && this.timeLimit <= this.timeSpent) {
|
46868
|
+
this.timeSpent = this.timeLimit;
|
46646
46869
|
this.completeLastPage();
|
46647
46870
|
}
|
46648
46871
|
if (page) {
|
@@ -46950,7 +47173,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46950
47173
|
}
|
46951
47174
|
}
|
46952
47175
|
else if (isStrCiEqual(layoutElement.id, "advanced-header")) {
|
46953
|
-
if ((this.state === "running" || this.state === "starting") && layoutElement.container === container) {
|
47176
|
+
if ((this.state === "running" || this.state === "starting" || (this.showHeaderOnCompletePage === true && this.state === "completed")) && layoutElement.container === container) {
|
46954
47177
|
containerLayoutElements.push(layoutElement);
|
46955
47178
|
}
|
46956
47179
|
}
|
@@ -47474,18 +47697,13 @@ Serializer.addClass("survey", [
|
|
47474
47697
|
default: "noPreview",
|
47475
47698
|
choices: ["noPreview", "showAllQuestions", "showAnsweredQuestions"],
|
47476
47699
|
},
|
47477
|
-
{ name: "
|
47478
|
-
{ name: "
|
47479
|
-
{
|
47480
|
-
|
47481
|
-
|
47482
|
-
choices: ["
|
47483
|
-
},
|
47484
|
-
{
|
47485
|
-
name: "showTimerPanelMode",
|
47486
|
-
default: "all",
|
47487
|
-
choices: ["page", "survey", "all"],
|
47488
|
-
},
|
47700
|
+
{ name: "showTimer:boolean" },
|
47701
|
+
{ name: "timeLimit:number", alternativeName: "maxTimeToFinish", default: 0, minValue: 0, enableIf: function (obj) { return obj.showTimer; } },
|
47702
|
+
{ name: "timeLimitPerPage:number", alternativeName: "maxTimeToFinishPage", default: 0, minValue: 0, enableIf: function (obj) { return obj.showTimer; } },
|
47703
|
+
{ name: "timerLocation", default: "top", choices: ["top", "bottom"], enableIf: function (obj) { return obj.showTimer; } },
|
47704
|
+
{ name: "timerInfoMode", alternativeName: "showTimerPanelMode",
|
47705
|
+
default: "combined", choices: ["page", "survey", "combined"], enableIf: function (obj) { return obj.showTimer; } },
|
47706
|
+
{ name: "showTimerPanel", visible: false, isSerializable: false },
|
47489
47707
|
{
|
47490
47708
|
name: "widthMode",
|
47491
47709
|
default: "auto",
|
@@ -47538,6 +47756,7 @@ var question_baseselect_decorate = (undefined && undefined.__decorate) || functi
|
|
47538
47756
|
|
47539
47757
|
|
47540
47758
|
|
47759
|
+
|
47541
47760
|
/**
|
47542
47761
|
* A base class for multiple-choice question types ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
|
47543
47762
|
*/
|
@@ -48176,6 +48395,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48176
48395
|
return this.otherValueCore;
|
48177
48396
|
};
|
48178
48397
|
QuestionSelectBase.prototype.selectOtherValueFromComment = function (val) {
|
48398
|
+
if (val) {
|
48399
|
+
this.prevIsOtherSelected = true;
|
48400
|
+
}
|
48179
48401
|
this.value = val ? this.otherItem.value : undefined;
|
48180
48402
|
};
|
48181
48403
|
QuestionSelectBase.prototype.setQuestionComment = function (newValue) {
|
@@ -49768,24 +49990,8 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
49768
49990
|
QuestionSelectBase.prototype.getItemEnabled = function (item) {
|
49769
49991
|
return !this.isDisabledAttr && item.isEnabled;
|
49770
49992
|
};
|
49771
|
-
QuestionSelectBase.prototype.afterRender = function (el) {
|
49772
|
-
_super.prototype.afterRender.call(this, el);
|
49773
|
-
this.rootElement = el;
|
49774
|
-
};
|
49775
|
-
QuestionSelectBase.prototype.beforeDestroyQuestionElement = function (el) {
|
49776
|
-
_super.prototype.beforeDestroyQuestionElement.call(this, el);
|
49777
|
-
this.rootElement = undefined;
|
49778
|
-
};
|
49779
49993
|
QuestionSelectBase.prototype.focusOtherComment = function () {
|
49780
|
-
|
49781
|
-
if (!!this.rootElement) {
|
49782
|
-
setTimeout(function () {
|
49783
|
-
var commentEl = _this.rootElement.querySelector("textarea");
|
49784
|
-
if (!!commentEl) {
|
49785
|
-
commentEl.focus();
|
49786
|
-
}
|
49787
|
-
}, 10);
|
49788
|
-
}
|
49994
|
+
survey_element_SurveyElement.FocusElement(this.otherId);
|
49789
49995
|
};
|
49790
49996
|
QuestionSelectBase.prototype.onValueChanged = function () {
|
49791
49997
|
_super.prototype.onValueChanged.call(this);
|
@@ -53554,7 +53760,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
53554
53760
|
return inputMask;
|
53555
53761
|
};
|
53556
53762
|
QuestionTextModel.prototype.isTextValue = function () {
|
53557
|
-
return ["text", "number", "password"].indexOf(this.inputType) > -1;
|
53763
|
+
return this.isDateInputType || ["text", "number", "password"].indexOf(this.inputType) > -1;
|
53558
53764
|
};
|
53559
53765
|
QuestionTextModel.prototype.getType = function () {
|
53560
53766
|
return "text";
|
@@ -53898,7 +54104,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
53898
54104
|
if (!this.isMinMaxType)
|
53899
54105
|
return true;
|
53900
54106
|
var isValid = !this.isValueLessMin && !this.isValueGreaterMax;
|
53901
|
-
if (this.
|
54107
|
+
if ((!isValid || this.errors.length > 0) && !!this.survey &&
|
53902
54108
|
(this.survey.isValidateOnValueChanging || this.survey.isValidateOnValueChanged)) {
|
53903
54109
|
this.hasErrors();
|
53904
54110
|
}
|
@@ -54028,11 +54234,6 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
54028
54234
|
enumerable: false,
|
54029
54235
|
configurable: true
|
54030
54236
|
});
|
54031
|
-
QuestionTextModel.prototype.canRunValidators = function (isOnValueChanged) {
|
54032
|
-
return (this.errors.length > 0 ||
|
54033
|
-
!isOnValueChanged ||
|
54034
|
-
this.supportGoNextPageError());
|
54035
|
-
};
|
54036
54237
|
QuestionTextModel.prototype.setNewValue = function (newValue) {
|
54037
54238
|
newValue = this.correctValueType(newValue);
|
54038
54239
|
if (!!newValue) {
|
@@ -58710,7 +58911,6 @@ var question_comment_extends = (undefined && undefined.__extends) || (function (
|
|
58710
58911
|
|
58711
58912
|
|
58712
58913
|
|
58713
|
-
|
58714
58914
|
/**
|
58715
58915
|
* A class that describes the Long Text question type.
|
58716
58916
|
*
|
@@ -58840,8 +59040,12 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
|
|
58840
59040
|
Object.defineProperty(QuestionCommentModel.prototype, "renderedAllowResize", {
|
58841
59041
|
get: function () {
|
58842
59042
|
var res = this.allowResize;
|
58843
|
-
|
58844
|
-
|
59043
|
+
if (res === undefined && this.survey) {
|
59044
|
+
return this.survey.allowResizeComment;
|
59045
|
+
}
|
59046
|
+
else {
|
59047
|
+
return !!res;
|
59048
|
+
}
|
58845
59049
|
},
|
58846
59050
|
enumerable: false,
|
58847
59051
|
configurable: true
|
@@ -58859,15 +59063,8 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
|
|
58859
59063
|
QuestionCommentModel.prototype.afterRenderQuestionElement = function (el) {
|
58860
59064
|
var root = settings.environment.root;
|
58861
59065
|
this.element = root.getElementById(this.inputId) || el;
|
58862
|
-
this.updateElement();
|
58863
59066
|
_super.prototype.afterRenderQuestionElement.call(this, el);
|
58864
59067
|
};
|
58865
|
-
QuestionCommentModel.prototype.updateElement = function () {
|
58866
|
-
var _this_1 = this;
|
58867
|
-
if (this.element && this.renderedAutoGrow) {
|
58868
|
-
setTimeout(function () { return increaseHeightByContent(_this_1.element); }, 1);
|
58869
|
-
}
|
58870
|
-
};
|
58871
59068
|
QuestionCommentModel.prototype.beforeDestroyQuestionElement = function (el) {
|
58872
59069
|
_super.prototype.beforeDestroyQuestionElement.call(this, el);
|
58873
59070
|
this.element = undefined;
|
@@ -58875,8 +59072,6 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
|
|
58875
59072
|
QuestionCommentModel.prototype.onInput = function (event) {
|
58876
59073
|
if (this.isInputTextUpdate)
|
58877
59074
|
this.value = event.target.value;
|
58878
|
-
else
|
58879
|
-
this.updateElement();
|
58880
59075
|
this.updateRemainingCharacterCounter(event.target.value);
|
58881
59076
|
};
|
58882
59077
|
QuestionCommentModel.prototype.onBlurCore = function (event) {
|
@@ -58889,15 +59084,6 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
|
|
58889
59084
|
event.stopPropagation();
|
58890
59085
|
}
|
58891
59086
|
};
|
58892
|
-
QuestionCommentModel.prototype.setQuestionValue = function (newValue, updateIsAnswered) {
|
58893
|
-
if (updateIsAnswered === void 0) { updateIsAnswered = true; }
|
58894
|
-
_super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
|
58895
|
-
this.updateElement();
|
58896
|
-
};
|
58897
|
-
QuestionCommentModel.prototype.onValueChanged = function () {
|
58898
|
-
_super.prototype.onValueChanged.call(this);
|
58899
|
-
this.updateElement();
|
58900
|
-
};
|
58901
59087
|
QuestionCommentModel.prototype.setNewValue = function (newValue) {
|
58902
59088
|
if (!this.acceptCarriageReturn && !!newValue) {
|
58903
59089
|
// eslint-disable-next-line no-control-regex
|
@@ -59175,6 +59361,7 @@ var question_file_decorate = (undefined && undefined.__decorate) || function (de
|
|
59175
59361
|
|
59176
59362
|
|
59177
59363
|
|
59364
|
+
|
59178
59365
|
function dataUrl2File(dataUrl, fileName, type) {
|
59179
59366
|
var str = atob(dataUrl.split(",")[1]);
|
59180
59367
|
var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
|
@@ -59316,6 +59503,32 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
|
|
59316
59503
|
return QuestionFileModelBase;
|
59317
59504
|
}(question_Question));
|
59318
59505
|
|
59506
|
+
var question_file_QuestionFilePage = /** @class */ (function (_super) {
|
59507
|
+
question_file_extends(QuestionFilePage, _super);
|
59508
|
+
function QuestionFilePage(question, index) {
|
59509
|
+
var _this = _super.call(this) || this;
|
59510
|
+
_this.question = question;
|
59511
|
+
_this.index = index;
|
59512
|
+
_this.id = QuestionFilePage.getId();
|
59513
|
+
return _this;
|
59514
|
+
}
|
59515
|
+
QuestionFilePage.getId = function () {
|
59516
|
+
return "sv_sfp_" + QuestionFilePage.pageCounter++;
|
59517
|
+
};
|
59518
|
+
Object.defineProperty(QuestionFilePage.prototype, "css", {
|
59519
|
+
get: function () {
|
59520
|
+
return this.question.cssClasses.page;
|
59521
|
+
},
|
59522
|
+
enumerable: false,
|
59523
|
+
configurable: true
|
59524
|
+
});
|
59525
|
+
QuestionFilePage.pageCounter = 0;
|
59526
|
+
question_file_decorate([
|
59527
|
+
propertyArray({})
|
59528
|
+
], QuestionFilePage.prototype, "items", void 0);
|
59529
|
+
return QuestionFilePage;
|
59530
|
+
}(base_Base));
|
59531
|
+
|
59319
59532
|
/**
|
59320
59533
|
* A class that describes the File Upload question type.
|
59321
59534
|
*
|
@@ -59329,6 +59542,10 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59329
59542
|
_this.fileNavigator = new container_ActionContainer();
|
59330
59543
|
_this.canFlipCameraValue = undefined;
|
59331
59544
|
_this.prevPreviewLength = 0;
|
59545
|
+
_this._renderedPages = [];
|
59546
|
+
_this.pagesAnimation = new AnimationTab(_this.getPagesAnimationOptions(), function (val) {
|
59547
|
+
_this._renderedPages = val;
|
59548
|
+
}, function () { return _this.renderedPages; });
|
59332
59549
|
_this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
|
59333
59550
|
var itemsCount = Math.floor(availableWidth / (itemWidth + gap));
|
59334
59551
|
if ((itemsCount + 1) * (itemWidth + gap) - gap <= availableWidth)
|
@@ -59407,6 +59624,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59407
59624
|
id: "prevPage",
|
59408
59625
|
iconSize: 16,
|
59409
59626
|
action: function () {
|
59627
|
+
_this.navigationDirection = "left";
|
59410
59628
|
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow - 1 + _this.pagesCount) % _this.pagesCount) || 0;
|
59411
59629
|
_this.fileIndexAction.title = _this.getFileIndexCaption();
|
59412
59630
|
}
|
@@ -59415,6 +59633,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59415
59633
|
id: "nextPage",
|
59416
59634
|
iconSize: 16,
|
59417
59635
|
action: function () {
|
59636
|
+
_this.navigationDirection = "right";
|
59418
59637
|
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow + 1) % _this.pagesCount) || 0;
|
59419
59638
|
_this.fileIndexAction.title = _this.getFileIndexCaption();
|
59420
59639
|
}
|
@@ -59490,6 +59709,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59490
59709
|
_this.fileNavigator.actions = [_this.prevFileAction, _this.fileIndexAction, _this.nextFileAction];
|
59491
59710
|
return _this;
|
59492
59711
|
}
|
59712
|
+
Object.defineProperty(QuestionFileModel.prototype, "supportFileNavigator", {
|
59713
|
+
get: function () {
|
59714
|
+
return this.isDefaultV2Theme;
|
59715
|
+
},
|
59716
|
+
enumerable: false,
|
59717
|
+
configurable: true
|
59718
|
+
});
|
59493
59719
|
Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
|
59494
59720
|
get: function () { return this.isFileLoadingValue; },
|
59495
59721
|
set: function (val) {
|
@@ -59623,15 +59849,42 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59623
59849
|
return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.pagesCount);
|
59624
59850
|
};
|
59625
59851
|
QuestionFileModel.prototype.updateFileNavigator = function () {
|
59852
|
+
this.updatePages();
|
59853
|
+
this.navigationDirection = undefined;
|
59626
59854
|
this.indexToShow = this.previewValue.length && ((this.indexToShow + this.pagesCount) % this.pagesCount) || 0;
|
59627
59855
|
this.fileIndexAction.title = this.getFileIndexCaption();
|
59628
59856
|
};
|
59857
|
+
QuestionFileModel.prototype.updateRenderedPages = function () {
|
59858
|
+
if (this.pages && this.pages[this.indexToShow]) {
|
59859
|
+
this.renderedPages = [this.pages[this.indexToShow]];
|
59860
|
+
}
|
59861
|
+
};
|
59862
|
+
QuestionFileModel.prototype.updatePages = function () {
|
59863
|
+
var _this = this;
|
59864
|
+
this.blockAnimations();
|
59865
|
+
var currentPage;
|
59866
|
+
this.pages = [];
|
59867
|
+
this.renderedPages = [];
|
59868
|
+
this.previewValue.forEach(function (val, index) {
|
59869
|
+
if (index % _this.pageSize == 0) {
|
59870
|
+
currentPage = new question_file_QuestionFilePage(_this, _this.pages.length);
|
59871
|
+
_this.pages.push(currentPage);
|
59872
|
+
}
|
59873
|
+
currentPage.items.push(val);
|
59874
|
+
});
|
59875
|
+
this.releaseAnimations();
|
59876
|
+
this.updateRenderedPages();
|
59877
|
+
};
|
59629
59878
|
QuestionFileModel.prototype.previewValueChanged = function () {
|
59630
59879
|
var _this = this;
|
59880
|
+
this.navigationDirection = undefined;
|
59631
59881
|
if (this.previewValue.length !== this.prevPreviewLength) {
|
59632
59882
|
if (this.previewValue.length > 0) {
|
59633
59883
|
if (this.prevPreviewLength > this.previewValue.length) {
|
59634
|
-
|
59884
|
+
if (this.indexToShow >= this.pagesCount && this.indexToShow > 0) {
|
59885
|
+
this.indexToShow = this.pagesCount - 1;
|
59886
|
+
this.navigationDirection = "left-delete";
|
59887
|
+
}
|
59635
59888
|
}
|
59636
59889
|
else {
|
59637
59890
|
this.indexToShow = Math.floor(this.prevPreviewLength / this.pageSize);
|
@@ -59641,6 +59894,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59641
59894
|
this.indexToShow = 0;
|
59642
59895
|
}
|
59643
59896
|
}
|
59897
|
+
this.updatePages();
|
59644
59898
|
this.fileIndexAction.title = this.getFileIndexCaption();
|
59645
59899
|
this.containsMultiplyFiles = this.previewValue.length > 1;
|
59646
59900
|
if (this.previewValue.length > 0 && !this.calculatedGapBetweenItems && !this.calculatedItemWidth) {
|
@@ -59650,11 +59904,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
59650
59904
|
}
|
59651
59905
|
this.prevPreviewLength = this.previewValue.length;
|
59652
59906
|
};
|
59653
|
-
QuestionFileModel.prototype.isPreviewVisible = function (index) {
|
59654
|
-
var isFileNavigatorVisible = this.fileNavigatorVisible;
|
59655
|
-
var isPreviewVisible = (this.indexToShow * this.pageSize <= index && index < (this.indexToShow + 1) * this.pageSize);
|
59656
|
-
return !isFileNavigatorVisible || isPreviewVisible;
|
59657
|
-
};
|
59658
59907
|
QuestionFileModel.prototype.getType = function () {
|
59659
59908
|
return "file";
|
59660
59909
|
};
|
@@ -60100,6 +60349,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60100
60349
|
content: content,
|
60101
60350
|
});
|
60102
60351
|
});
|
60352
|
+
this.previewValueChanged();
|
60103
60353
|
}
|
60104
60354
|
else {
|
60105
60355
|
if (!!this._previewLoader) {
|
@@ -60119,7 +60369,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60119
60369
|
});
|
60120
60370
|
this._previewLoader.load(newValues);
|
60121
60371
|
}
|
60122
|
-
this.previewValueChanged();
|
60123
60372
|
};
|
60124
60373
|
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
60125
60374
|
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
@@ -60263,6 +60512,46 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60263
60512
|
QuestionFileModel.prototype.getFileListSelector = function () {
|
60264
60513
|
return classesToSelector(this.cssClasses.fileList);
|
60265
60514
|
};
|
60515
|
+
Object.defineProperty(QuestionFileModel.prototype, "renderedPages", {
|
60516
|
+
get: function () {
|
60517
|
+
return this._renderedPages;
|
60518
|
+
},
|
60519
|
+
set: function (val) {
|
60520
|
+
this.pagesAnimation.sync(val);
|
60521
|
+
},
|
60522
|
+
enumerable: false,
|
60523
|
+
configurable: true
|
60524
|
+
});
|
60525
|
+
QuestionFileModel.prototype.getPagesAnimationOptions = function () {
|
60526
|
+
var _this = this;
|
60527
|
+
return {
|
60528
|
+
getEnterOptions: function (page) {
|
60529
|
+
var pageClass = _this.cssClasses.page;
|
60530
|
+
return { cssClass: pageClass ? new CssClassBuilder()
|
60531
|
+
.append(pageClass + "--enter-from-left", _this.navigationDirection == "left" || _this.navigationDirection == "left-delete")
|
60532
|
+
.append(pageClass + "--enter-from-right", _this.navigationDirection == "right").toString() : ""
|
60533
|
+
};
|
60534
|
+
},
|
60535
|
+
getLeaveOptions: function (page) {
|
60536
|
+
var pageClass = _this.cssClasses.page;
|
60537
|
+
return {
|
60538
|
+
cssClass: pageClass ? new CssClassBuilder()
|
60539
|
+
.append(pageClass + "--leave-to-left", _this.navigationDirection == "right")
|
60540
|
+
.append(pageClass + "--leave-to-right", _this.navigationDirection == "left").toString() : ""
|
60541
|
+
};
|
60542
|
+
},
|
60543
|
+
getAnimatedElement: function (page) {
|
60544
|
+
var _a;
|
60545
|
+
return (_a = _this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelector("#" + page.id);
|
60546
|
+
},
|
60547
|
+
isAnimationEnabled: function () {
|
60548
|
+
return _this.animationAllowed && !!_this.rootElement;
|
60549
|
+
},
|
60550
|
+
getRerenderEvent: function () {
|
60551
|
+
return _this.onElementRerendered;
|
60552
|
+
}
|
60553
|
+
};
|
60554
|
+
};
|
60266
60555
|
QuestionFileModel.prototype.triggerResponsiveness = function (hard) {
|
60267
60556
|
if (hard) {
|
60268
60557
|
this.calculatedGapBetweenItems = undefined;
|
@@ -60271,17 +60560,19 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60271
60560
|
_super.prototype.triggerResponsiveness.call(this);
|
60272
60561
|
};
|
60273
60562
|
QuestionFileModel.prototype.processResponsiveness = function (_, availableWidth) {
|
60274
|
-
var _this = this;
|
60275
60563
|
this._width = availableWidth;
|
60276
60564
|
if (this.rootElement) {
|
60277
60565
|
if ((!this.calculatedGapBetweenItems || !this.calculatedItemWidth) && this.allowMultiple) {
|
60278
60566
|
var fileListSelector = this.getFileListSelector();
|
60279
60567
|
var fileListElement = fileListSelector ? this.rootElement.querySelector(this.getFileListSelector()) : undefined;
|
60280
60568
|
if (fileListElement) {
|
60281
|
-
|
60282
|
-
|
60283
|
-
|
60284
|
-
this.
|
60569
|
+
var visiblePage = fileListElement.querySelector(classesToSelector(this.cssClasses.page));
|
60570
|
+
if (visiblePage) {
|
60571
|
+
var firstVisibleItem = visiblePage.querySelector(classesToSelector(this.cssClasses.previewItem));
|
60572
|
+
this.calculatedGapBetweenItems = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(visiblePage).gap));
|
60573
|
+
if (firstVisibleItem) {
|
60574
|
+
this.calculatedItemWidth = Math.ceil(Number.parseFloat(DomDocumentHelper.getComputedStyle(firstVisibleItem).width));
|
60575
|
+
}
|
60285
60576
|
}
|
60286
60577
|
}
|
60287
60578
|
}
|
@@ -60334,7 +60625,12 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60334
60625
|
propertyArray({})
|
60335
60626
|
], QuestionFileModel.prototype, "previewValue", void 0);
|
60336
60627
|
question_file_decorate([
|
60337
|
-
|
60628
|
+
propertyArray({})
|
60629
|
+
], QuestionFileModel.prototype, "pages", void 0);
|
60630
|
+
question_file_decorate([
|
60631
|
+
jsonobject_property({ defaultValue: 0, onSet: function (val, target) {
|
60632
|
+
target.updateRenderedPages();
|
60633
|
+
} })
|
60338
60634
|
], QuestionFileModel.prototype, "indexToShow", void 0);
|
60339
60635
|
question_file_decorate([
|
60340
60636
|
jsonobject_property({
|
@@ -60398,6 +60694,9 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
60398
60694
|
question_file_decorate([
|
60399
60695
|
jsonobject_property()
|
60400
60696
|
], QuestionFileModel.prototype, "locRenderedPlaceholderValue", void 0);
|
60697
|
+
question_file_decorate([
|
60698
|
+
propertyArray()
|
60699
|
+
], QuestionFileModel.prototype, "_renderedPages", void 0);
|
60401
60700
|
return QuestionFileModel;
|
60402
60701
|
}(question_file_QuestionFileModelBase));
|
60403
60702
|
|
@@ -66381,9 +66680,8 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
66381
66680
|
: null;
|
66382
66681
|
};
|
66383
66682
|
QuestionPanelDynamicModel.prototype.addConditionObjectsByContext = function (objects, context) {
|
66384
|
-
var
|
66385
|
-
|
66386
|
-
: false;
|
66683
|
+
var contextQ = !!(context === null || context === void 0 ? void 0 : context.isValidator) ? context.errorOwner : context;
|
66684
|
+
var hasContext = !!context && (context === true || this.template.questions.indexOf(contextQ) > -1);
|
66387
66685
|
var panelObjs = new Array();
|
66388
66686
|
var questions = this.template.questions;
|
66389
66687
|
for (var i = 0; i < questions.length; i++) {
|
@@ -70384,8 +70682,8 @@ Serializer.addClass("currencymask", [
|
|
70384
70682
|
|
70385
70683
|
var Version;
|
70386
70684
|
var ReleaseDate;
|
70387
|
-
Version = "" + "1.12.
|
70388
|
-
ReleaseDate = "" + "2024-10-
|
70685
|
+
Version = "" + "1.12.6";
|
70686
|
+
ReleaseDate = "" + "2024-10-15";
|
70389
70687
|
function checkLibraryVersion(ver, libraryName) {
|
70390
70688
|
if (Version != ver) {
|
70391
70689
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -80366,7 +80664,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
80366
80664
|
SurveyElementBase.prototype.makeBaseElementsReact = function () {
|
80367
80665
|
var els = this.getStateElements();
|
80368
80666
|
for (var i = 0; i < els.length; i++) {
|
80369
|
-
els[i].
|
80667
|
+
els[i].enableOnElementRerenderedEvent();
|
80370
80668
|
this.makeBaseElementReact(els[i]);
|
80371
80669
|
}
|
80372
80670
|
};
|
@@ -80378,7 +80676,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
80378
80676
|
};
|
80379
80677
|
SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
|
80380
80678
|
els.forEach(function (el) {
|
80381
|
-
el.
|
80679
|
+
el.disableOnElementRerenderedEvent();
|
80382
80680
|
});
|
80383
80681
|
};
|
80384
80682
|
SurveyElementBase.prototype.getStateElements = function () {
|
@@ -80965,7 +81263,7 @@ var panel_base_SurveyPanelBase = /** @class */ (function (_super) {
|
|
80965
81263
|
var el = this.rootRef.current;
|
80966
81264
|
if (el && this.survey) {
|
80967
81265
|
if (this.panelBase.isPanel) {
|
80968
|
-
this.
|
81266
|
+
this.panelBase.afterRender(el);
|
80969
81267
|
}
|
80970
81268
|
else {
|
80971
81269
|
this.survey.afterRenderPage(el);
|
@@ -81341,6 +81639,12 @@ var popup_PopupContainer = /** @class */ (function (_super) {
|
|
81341
81639
|
_this.model.clickOutside(e);
|
81342
81640
|
}, onKeyDown: this.handleKeydown }, container));
|
81343
81641
|
};
|
81642
|
+
PopupContainer.prototype.componentDidMount = function () {
|
81643
|
+
_super.prototype.componentDidMount.call(this);
|
81644
|
+
if (this.model.isVisible) {
|
81645
|
+
this.model.updateOnShowing();
|
81646
|
+
}
|
81647
|
+
};
|
81344
81648
|
return PopupContainer;
|
81345
81649
|
}(reactquestion_element_SurveyElementBase));
|
81346
81650
|
|
@@ -81371,12 +81675,26 @@ function showDialog(dialogOptions, rootElement) {
|
|
81371
81675
|
var popupViewModel = createPopupModalViewModel(dialogOptions, rootElement);
|
81372
81676
|
var onVisibilityChangedCallback = function (_, options) {
|
81373
81677
|
if (!options.isVisible) {
|
81374
|
-
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.
|
81678
|
+
if (typeof external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot == "function") {
|
81679
|
+
if (!!root) {
|
81680
|
+
root.unmount();
|
81681
|
+
}
|
81682
|
+
}
|
81683
|
+
else {
|
81684
|
+
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.unmountComponentAtNode(popupViewModel.container);
|
81685
|
+
}
|
81375
81686
|
popupViewModel.dispose();
|
81376
81687
|
}
|
81377
81688
|
};
|
81378
81689
|
popupViewModel.onVisibilityChanged.add(onVisibilityChangedCallback);
|
81379
|
-
|
81690
|
+
var root;
|
81691
|
+
if (typeof external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot == "function") {
|
81692
|
+
root = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot(popupViewModel.container);
|
81693
|
+
root.render(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_PopupContainer, { model: popupViewModel }));
|
81694
|
+
}
|
81695
|
+
else {
|
81696
|
+
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.render(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_PopupContainer, { model: popupViewModel }), popupViewModel.container);
|
81697
|
+
}
|
81380
81698
|
popupViewModel.model.isVisible = true;
|
81381
81699
|
return popupViewModel;
|
81382
81700
|
}
|
@@ -81407,9 +81725,7 @@ var action_bar_item_dropdown_extends = (undefined && undefined.__extends) || (fu
|
|
81407
81725
|
var action_bar_item_dropdown_SurveyActionBarItemDropdown = /** @class */ (function (_super) {
|
81408
81726
|
action_bar_item_dropdown_extends(SurveyActionBarItemDropdown, _super);
|
81409
81727
|
function SurveyActionBarItemDropdown(props) {
|
81410
|
-
|
81411
|
-
_this.viewModel = new ActionDropdownViewModel(_this.item);
|
81412
|
-
return _this;
|
81728
|
+
return _super.call(this, props) || this;
|
81413
81729
|
}
|
81414
81730
|
SurveyActionBarItemDropdown.prototype.renderInnerButton = function () {
|
81415
81731
|
var button = _super.prototype.renderInnerButton.call(this);
|
@@ -81417,6 +81733,9 @@ var action_bar_item_dropdown_SurveyActionBarItemDropdown = /** @class */ (functi
|
|
81417
81733
|
button,
|
81418
81734
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_Popup, { model: this.item.popupModel, getTarget: getActionDropdownButtonTarget })));
|
81419
81735
|
};
|
81736
|
+
SurveyActionBarItemDropdown.prototype.componentDidMount = function () {
|
81737
|
+
this.viewModel = new ActionDropdownViewModel(this.item);
|
81738
|
+
};
|
81420
81739
|
SurveyActionBarItemDropdown.prototype.componentWillUnmount = function () {
|
81421
81740
|
_super.prototype.componentWillUnmount.call(this);
|
81422
81741
|
this.viewModel.dispose();
|
@@ -81807,9 +82126,6 @@ var text_area_TextAreaComponent = /** @class */ (function (_super) {
|
|
81807
82126
|
var _this = this;
|
81808
82127
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("textarea", { id: this.viewModel.id, className: this.viewModel.className, ref: function (textarea) { return (_this.viewModel.setElement(textarea)); }, disabled: this.viewModel.isDisabledAttr, readOnly: this.viewModel.isReadOnlyAttr, rows: this.viewModel.rows, cols: this.viewModel.cols, placeholder: this.viewModel.placeholder, maxLength: this.viewModel.maxLength, defaultValue: this.initialValue, onChange: function (event) { _this.viewModel.onTextAreaInput(event); }, onFocus: function (event) { _this.viewModel.onTextAreaFocus(event); }, onBlur: function (event) { _this.viewModel.onTextAreaBlur(event); }, onKeyDown: function (event) { _this.viewModel.onTextAreaKeyDown(event); }, "aria-required": this.viewModel.ariaRequired, "aria-label": this.viewModel.ariaLabel, "aria-labelledby": this.viewModel.ariaLabelledBy, "aria-describedby": this.viewModel.ariaDescribedBy, "aria-invalid": this.viewModel.ariaInvalid, "aria-errormessage": this.viewModel.ariaErrormessage, style: { resize: this.viewModel.question.resizeStyle } }));
|
81809
82128
|
};
|
81810
|
-
TextAreaComponent.prototype.componentWillUnmount = function () {
|
81811
|
-
this.viewModel.dispose();
|
81812
|
-
};
|
81813
82129
|
return TextAreaComponent;
|
81814
82130
|
}(reactquestion_element_SurveyElementBase));
|
81815
82131
|
|
@@ -82824,6 +83140,7 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
|
|
82824
83140
|
if (!!el)
|
82825
83141
|
this.survey.afterRenderSurvey(el);
|
82826
83142
|
this.survey.startTimerFromUI();
|
83143
|
+
this.setSurveyEvents();
|
82827
83144
|
}
|
82828
83145
|
};
|
82829
83146
|
Survey.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
@@ -82980,7 +83297,6 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
|
|
82980
83297
|
if (!!newProps.css) {
|
82981
83298
|
this.survey.css = this.css;
|
82982
83299
|
}
|
82983
|
-
this.setSurveyEvents();
|
82984
83300
|
};
|
82985
83301
|
Survey.prototype.isModelJSONChanged = function (newProps) {
|
82986
83302
|
if (!!newProps["model"]) {
|
@@ -84284,6 +84600,10 @@ var dropdown_item_SurveyQuestionOptionItem = /** @class */ (function (_super) {
|
|
84284
84600
|
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
84285
84601
|
this.setupModel();
|
84286
84602
|
};
|
84603
|
+
SurveyQuestionOptionItem.prototype.componentDidMount = function () {
|
84604
|
+
_super.prototype.componentDidMount.call(this);
|
84605
|
+
this.setupModel();
|
84606
|
+
};
|
84287
84607
|
SurveyQuestionOptionItem.prototype.componentWillUnmount = function () {
|
84288
84608
|
_super.prototype.componentWillUnmount.call(this);
|
84289
84609
|
if (!!this.item) {
|
@@ -85193,6 +85513,120 @@ ReactQuestionFactory.Instance.registerQuestion("file", function (props) {
|
|
85193
85513
|
return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](reactquestion_file_SurveyQuestionFile, props);
|
85194
85514
|
});
|
85195
85515
|
|
85516
|
+
// CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-item.tsx
|
85517
|
+
var file_item_extends = (undefined && undefined.__extends) || (function () {
|
85518
|
+
var extendStatics = function (d, b) {
|
85519
|
+
extendStatics = Object.setPrototypeOf ||
|
85520
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
85521
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
85522
|
+
return extendStatics(d, b);
|
85523
|
+
};
|
85524
|
+
return function (d, b) {
|
85525
|
+
if (typeof b !== "function" && b !== null)
|
85526
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
85527
|
+
extendStatics(d, b);
|
85528
|
+
function __() { this.constructor = d; }
|
85529
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
85530
|
+
};
|
85531
|
+
})();
|
85532
|
+
|
85533
|
+
|
85534
|
+
|
85535
|
+
var file_item_SurveyFileItem = /** @class */ (function (_super) {
|
85536
|
+
file_item_extends(SurveyFileItem, _super);
|
85537
|
+
function SurveyFileItem() {
|
85538
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
85539
|
+
}
|
85540
|
+
Object.defineProperty(SurveyFileItem.prototype, "question", {
|
85541
|
+
get: function () {
|
85542
|
+
return this.props.question;
|
85543
|
+
},
|
85544
|
+
enumerable: false,
|
85545
|
+
configurable: true
|
85546
|
+
});
|
85547
|
+
Object.defineProperty(SurveyFileItem.prototype, "item", {
|
85548
|
+
get: function () {
|
85549
|
+
return this.props.item;
|
85550
|
+
},
|
85551
|
+
enumerable: false,
|
85552
|
+
configurable: true
|
85553
|
+
});
|
85554
|
+
SurveyFileItem.prototype.renderFileSign = function (className, val) {
|
85555
|
+
var _this = this;
|
85556
|
+
if (!className || !val.name)
|
85557
|
+
return null;
|
85558
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: className },
|
85559
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("a", { href: val.content, onClick: function (event) {
|
85560
|
+
_this.question.doDownloadFile(event, val);
|
85561
|
+
}, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
|
85562
|
+
};
|
85563
|
+
SurveyFileItem.prototype.renderElement = function () {
|
85564
|
+
var _this = this;
|
85565
|
+
var val = this.item;
|
85566
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.previewItem, onClick: function (event) { return _this.question.doDownloadFileFromContainer(event); } },
|
85567
|
+
this.renderFileSign(this.question.cssClasses.fileSign, val),
|
85568
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.getImageWrapperCss(val) },
|
85569
|
+
this.question.canPreviewImage(val) ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { src: val.content, style: { height: this.question.imageHeight, width: this.question.imageWidth }, alt: "File preview" })) : (this.question.cssClasses.defaultImage ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { iconName: this.question.cssClasses.defaultImageIconId, size: "auto", className: this.question.cssClasses.defaultImage })) : null),
|
85570
|
+
val.name && !this.question.isReadOnly ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: function (event) { return _this.question.doRemoveFile(val, event); } },
|
85571
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
|
85572
|
+
(this.question.cssClasses.removeFileSvgIconId) ?
|
85573
|
+
(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
|
85574
|
+
this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
|
85575
|
+
};
|
85576
|
+
SurveyFileItem.prototype.canRender = function () {
|
85577
|
+
return this.question.showPreviewContainer;
|
85578
|
+
};
|
85579
|
+
return SurveyFileItem;
|
85580
|
+
}(reactquestion_element_SurveyElementBase));
|
85581
|
+
|
85582
|
+
|
85583
|
+
// CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-page.tsx
|
85584
|
+
var file_page_extends = (undefined && undefined.__extends) || (function () {
|
85585
|
+
var extendStatics = function (d, b) {
|
85586
|
+
extendStatics = Object.setPrototypeOf ||
|
85587
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
85588
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
85589
|
+
return extendStatics(d, b);
|
85590
|
+
};
|
85591
|
+
return function (d, b) {
|
85592
|
+
if (typeof b !== "function" && b !== null)
|
85593
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
85594
|
+
extendStatics(d, b);
|
85595
|
+
function __() { this.constructor = d; }
|
85596
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
85597
|
+
};
|
85598
|
+
})();
|
85599
|
+
|
85600
|
+
|
85601
|
+
|
85602
|
+
var file_page_SurveyFilePage = /** @class */ (function (_super) {
|
85603
|
+
file_page_extends(SurveyFilePage, _super);
|
85604
|
+
function SurveyFilePage() {
|
85605
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
85606
|
+
}
|
85607
|
+
Object.defineProperty(SurveyFilePage.prototype, "question", {
|
85608
|
+
get: function () {
|
85609
|
+
return this.props.question;
|
85610
|
+
},
|
85611
|
+
enumerable: false,
|
85612
|
+
configurable: true
|
85613
|
+
});
|
85614
|
+
Object.defineProperty(SurveyFilePage.prototype, "page", {
|
85615
|
+
get: function () {
|
85616
|
+
return this.props.page;
|
85617
|
+
},
|
85618
|
+
enumerable: false,
|
85619
|
+
configurable: true
|
85620
|
+
});
|
85621
|
+
SurveyFilePage.prototype.renderElement = function () {
|
85622
|
+
var _this = this;
|
85623
|
+
var items = this.page.items.map(function (item, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_item_SurveyFileItem, { item: item, question: _this.question, key: index })); });
|
85624
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.page.css, id: this.page.id }, items));
|
85625
|
+
};
|
85626
|
+
return SurveyFilePage;
|
85627
|
+
}(reactquestion_element_SurveyElementBase));
|
85628
|
+
|
85629
|
+
|
85196
85630
|
// CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-preview.tsx
|
85197
85631
|
var file_preview_extends = (undefined && undefined.__extends) || (function () {
|
85198
85632
|
var extendStatics = function (d, b) {
|
@@ -85213,6 +85647,7 @@ var file_preview_extends = (undefined && undefined.__extends) || (function () {
|
|
85213
85647
|
|
85214
85648
|
|
85215
85649
|
|
85650
|
+
|
85216
85651
|
var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
|
85217
85652
|
file_preview_extends(SurveyFilePreview, _super);
|
85218
85653
|
function SurveyFilePreview() {
|
@@ -85236,20 +85671,9 @@ var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
|
|
85236
85671
|
};
|
85237
85672
|
SurveyFilePreview.prototype.renderElement = function () {
|
85238
85673
|
var _this = this;
|
85239
|
-
var
|
85240
|
-
|
85241
|
-
|
85242
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { key: _this.question.inputId + "_" + index, className: _this.question.cssClasses.previewItem, onClick: function (event) { return _this.question.doDownloadFileFromContainer(event); }, style: { display: _this.question.isPreviewVisible(index) ? undefined : "none" } },
|
85243
|
-
_this.renderFileSign(_this.question.cssClasses.fileSign, val),
|
85244
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: _this.question.getImageWrapperCss(val) },
|
85245
|
-
_this.question.canPreviewImage(val) ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", { src: val.content, style: { height: _this.question.imageHeight, width: _this.question.imageWidth }, alt: "File preview" })) : (_this.question.cssClasses.defaultImage ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { iconName: _this.question.cssClasses.defaultImageIconId, size: "auto", className: _this.question.cssClasses.defaultImage })) : null),
|
85246
|
-
val.name && !_this.question.isReadOnly ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: _this.question.getRemoveButtonCss(), onClick: function (event) { return _this.question.doRemoveFile(val, event); } },
|
85247
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: _this.question.cssClasses.removeFile }, _this.question.removeFileCaption),
|
85248
|
-
(_this.question.cssClasses.removeFileSvgIconId) ?
|
85249
|
-
(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(svg_icon_SvgIcon, { title: _this.question.removeFileCaption, iconName: _this.question.cssClasses.removeFileSvgIconId, size: "auto", className: _this.question.cssClasses.removeFileSvg })) : null)) : null),
|
85250
|
-
_this.renderFileSign(_this.question.cssClasses.fileSignBottom, val)));
|
85251
|
-
});
|
85252
|
-
return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, previews);
|
85674
|
+
var content = this.question.supportFileNavigator ? this.question.renderedPages.map(function (page, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_page_SurveyFilePage, { page: page, question: _this.question, key: page.id })); })
|
85675
|
+
: this.question.previewValue.map(function (item, index) { return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(file_item_SurveyFileItem, { item: item, question: _this.question, key: index })); });
|
85676
|
+
return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, content);
|
85253
85677
|
};
|
85254
85678
|
SurveyFilePreview.prototype.canRender = function () {
|
85255
85679
|
return this.question.showPreviewContainer;
|