survey-react-ui 1.12.4 → 1.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "1.12.4",
3
+ "version": "1.12.5",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "typings": "./typings/src/entries/react-ui.d.ts",
23
23
  "peerDependencies": {
24
- "survey-core": "1.12.4",
24
+ "survey-core": "1.12.5",
25
25
  "react": "^16.5.0 || ^17.0.1 || ^18.2.0",
26
26
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0"
27
27
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.4
2
+ * surveyjs - Survey JavaScript library v1.12.5
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -103,7 +103,7 @@ return /******/ (function(modules) { // webpackBootstrap
103
103
 
104
104
  /***/ "./src/entries/react-ui.ts":
105
105
  /*!**********************************************!*\
106
- !*** ./src/entries/react-ui.ts + 96 modules ***!
106
+ !*** ./src/entries/react-ui.ts + 98 modules ***!
107
107
  \**********************************************/
108
108
  /*! exports provided: 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, SurveyModel, SurveyWindowModel, Model, settings, surveyLocalization, surveyStrings */
109
109
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} (<- Module is not an ECMAScript module) */
@@ -448,7 +448,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
448
448
  SurveyElementBase.prototype.makeBaseElementsReact = function () {
449
449
  var els = this.getStateElements();
450
450
  for (var i = 0; i < els.length; i++) {
451
- els[i].enableOnElementRenderedEvent();
451
+ els[i].enableOnElementRerenderedEvent();
452
452
  this.makeBaseElementReact(els[i]);
453
453
  }
454
454
  };
@@ -460,7 +460,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
460
460
  };
461
461
  SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
462
462
  els.forEach(function (el) {
463
- el.disableOnElementRenderedEvent();
463
+ el.disableOnElementRerenderedEvent();
464
464
  });
465
465
  };
466
466
  SurveyElementBase.prototype.getStateElements = function () {
@@ -1047,7 +1047,7 @@ var panel_base_SurveyPanelBase = /** @class */ (function (_super) {
1047
1047
  var el = this.rootRef.current;
1048
1048
  if (el && this.survey) {
1049
1049
  if (this.panelBase.isPanel) {
1050
- this.survey.afterRenderPanel(this.panelBase, el);
1050
+ this.panelBase.afterRender(el);
1051
1051
  }
1052
1052
  else {
1053
1053
  this.survey.afterRenderPage(el);
@@ -5275,6 +5275,120 @@ ReactQuestionFactory.Instance.registerQuestion("file", function (props) {
5275
5275
  return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](reactquestion_file_SurveyQuestionFile, props);
5276
5276
  });
5277
5277
 
5278
+ // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-item.tsx
5279
+ var file_item_extends = (undefined && undefined.__extends) || (function () {
5280
+ var extendStatics = function (d, b) {
5281
+ extendStatics = Object.setPrototypeOf ||
5282
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5283
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
5284
+ return extendStatics(d, b);
5285
+ };
5286
+ return function (d, b) {
5287
+ if (typeof b !== "function" && b !== null)
5288
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
5289
+ extendStatics(d, b);
5290
+ function __() { this.constructor = d; }
5291
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5292
+ };
5293
+ })();
5294
+
5295
+
5296
+
5297
+ var file_item_SurveyFileItem = /** @class */ (function (_super) {
5298
+ file_item_extends(SurveyFileItem, _super);
5299
+ function SurveyFileItem() {
5300
+ return _super !== null && _super.apply(this, arguments) || this;
5301
+ }
5302
+ Object.defineProperty(SurveyFileItem.prototype, "question", {
5303
+ get: function () {
5304
+ return this.props.question;
5305
+ },
5306
+ enumerable: false,
5307
+ configurable: true
5308
+ });
5309
+ Object.defineProperty(SurveyFileItem.prototype, "item", {
5310
+ get: function () {
5311
+ return this.props.item;
5312
+ },
5313
+ enumerable: false,
5314
+ configurable: true
5315
+ });
5316
+ SurveyFileItem.prototype.renderFileSign = function (className, val) {
5317
+ var _this = this;
5318
+ if (!className || !val.name)
5319
+ return null;
5320
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: className },
5321
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("a", { href: val.content, onClick: function (event) {
5322
+ _this.question.doDownloadFile(event, val);
5323
+ }, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
5324
+ };
5325
+ SurveyFileItem.prototype.renderElement = function () {
5326
+ var _this = this;
5327
+ var val = this.item;
5328
+ 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); } },
5329
+ this.renderFileSign(this.question.cssClasses.fileSign, val),
5330
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.getImageWrapperCss(val) },
5331
+ 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),
5332
+ 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); } },
5333
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
5334
+ (this.question.cssClasses.removeFileSvgIconId) ?
5335
+ (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),
5336
+ this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
5337
+ };
5338
+ SurveyFileItem.prototype.canRender = function () {
5339
+ return this.question.showPreviewContainer;
5340
+ };
5341
+ return SurveyFileItem;
5342
+ }(reactquestion_element_SurveyElementBase));
5343
+
5344
+
5345
+ // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-page.tsx
5346
+ var file_page_extends = (undefined && undefined.__extends) || (function () {
5347
+ var extendStatics = function (d, b) {
5348
+ extendStatics = Object.setPrototypeOf ||
5349
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5350
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
5351
+ return extendStatics(d, b);
5352
+ };
5353
+ return function (d, b) {
5354
+ if (typeof b !== "function" && b !== null)
5355
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
5356
+ extendStatics(d, b);
5357
+ function __() { this.constructor = d; }
5358
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5359
+ };
5360
+ })();
5361
+
5362
+
5363
+
5364
+ var file_page_SurveyFilePage = /** @class */ (function (_super) {
5365
+ file_page_extends(SurveyFilePage, _super);
5366
+ function SurveyFilePage() {
5367
+ return _super !== null && _super.apply(this, arguments) || this;
5368
+ }
5369
+ Object.defineProperty(SurveyFilePage.prototype, "question", {
5370
+ get: function () {
5371
+ return this.props.question;
5372
+ },
5373
+ enumerable: false,
5374
+ configurable: true
5375
+ });
5376
+ Object.defineProperty(SurveyFilePage.prototype, "page", {
5377
+ get: function () {
5378
+ return this.props.page;
5379
+ },
5380
+ enumerable: false,
5381
+ configurable: true
5382
+ });
5383
+ SurveyFilePage.prototype.renderElement = function () {
5384
+ var _this = this;
5385
+ 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 })); });
5386
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.page.css, id: this.page.id }, items));
5387
+ };
5388
+ return SurveyFilePage;
5389
+ }(reactquestion_element_SurveyElementBase));
5390
+
5391
+
5278
5392
  // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/file/file-preview.tsx
5279
5393
  var file_preview_extends = (undefined && undefined.__extends) || (function () {
5280
5394
  var extendStatics = function (d, b) {
@@ -5295,6 +5409,7 @@ var file_preview_extends = (undefined && undefined.__extends) || (function () {
5295
5409
 
5296
5410
 
5297
5411
 
5412
+
5298
5413
  var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
5299
5414
  file_preview_extends(SurveyFilePreview, _super);
5300
5415
  function SurveyFilePreview() {
@@ -5318,20 +5433,9 @@ var file_preview_SurveyFilePreview = /** @class */ (function (_super) {
5318
5433
  };
5319
5434
  SurveyFilePreview.prototype.renderElement = function () {
5320
5435
  var _this = this;
5321
- var previews = this.question.previewValue.map(function (val, index) {
5322
- if (!val)
5323
- return null;
5324
- 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" } },
5325
- _this.renderFileSign(_this.question.cssClasses.fileSign, val),
5326
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: _this.question.getImageWrapperCss(val) },
5327
- _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),
5328
- 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); } },
5329
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: _this.question.cssClasses.removeFile }, _this.question.removeFileCaption),
5330
- (_this.question.cssClasses.removeFileSvgIconId) ?
5331
- (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),
5332
- _this.renderFileSign(_this.question.cssClasses.fileSignBottom, val)));
5333
- });
5334
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, previews);
5436
+ 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 })); })
5437
+ : 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 })); });
5438
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: this.question.cssClasses.fileList || undefined }, content);
5335
5439
  };
5336
5440
  SurveyFilePreview.prototype.canRender = function () {
5337
5441
  return this.question.showPreviewContainer;
@@ -9212,7 +9316,7 @@ ReactElementFactory.Instance.registerElement(external_root_Survey_commonjs2_surv
9212
9316
 
9213
9317
 
9214
9318
 
9215
- Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.12.4", "survey-react-ui");
9319
+ Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.12.5", "survey-react-ui");
9216
9320
 
9217
9321
 
9218
9322
  /***/ }),