survey-pdf 2.2.6 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-pdf",
3
- "version": "2.2.6",
3
+ "version": "2.3.1",
4
4
  "description": "survey.pdf.js is a SurveyJS PDF Library. It is a easy way to export SurveyJS surveys to PDF. It uses JSON for survey metadata.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "typings": "./typings/entries/pdf.d.ts",
21
21
  "peerDependencies": {
22
- "survey-core": "2.2.6"
22
+ "survey-core": "2.3.1"
23
23
  },
24
24
  "dependencies": {
25
25
  "jspdf": "^2.3.0 || ^3"
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/survey.pdf.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.2.6
2
+ * surveyjs - SurveyJS PDF library v2.3.1
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1558,7 +1558,7 @@ __webpack_require__.r(__webpack_exports__);
1558
1558
 
1559
1559
 
1560
1560
 
1561
- (0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.2.6"), 'survey-pdf');
1561
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.3.1"), 'survey-pdf');
1562
1562
 
1563
1563
 
1564
1564
  /***/ }),
@@ -2301,6 +2301,26 @@ var FlatDropdown = /** @class */ (function (_super) {
2301
2301
  _this.question = question;
2302
2302
  return _this;
2303
2303
  }
2304
+ FlatDropdown.prototype.generateItemComment = function (point) {
2305
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
2306
+ var commentModel;
2307
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
2308
+ switch (_a.label) {
2309
+ case 0:
2310
+ commentModel = this.question.getCommentTextAreaModel(this.question.selectedItem);
2311
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createCommentFlat(point, this.question, this.controller, {
2312
+ fieldName: commentModel.id,
2313
+ rows: _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.OTHER_ROWS_COUNT,
2314
+ value: commentModel.getTextValue(),
2315
+ shouldRenderBorders: survey_core__WEBPACK_IMPORTED_MODULE_1__.settings.readOnlyCommentRenderMode === 'textarea',
2316
+ isReadOnly: this.question.isReadOnly,
2317
+ isMultiline: true,
2318
+ })];
2319
+ case 1: return [2 /*return*/, _a.sent()];
2320
+ }
2321
+ });
2322
+ });
2323
+ };
2304
2324
  FlatDropdown.prototype.generateFlatsContent = function (point) {
2305
2325
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
2306
2326
  var valueBrick, _a, compositeFlat, otherPoint, _b, _c;
@@ -2313,7 +2333,7 @@ var FlatDropdown = /** @class */ (function (_super) {
2313
2333
  case 1: return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createCommentFlat(point, this.question, this.controller, {
2314
2334
  fieldName: this.question.id,
2315
2335
  shouldRenderBorders: survey_core__WEBPACK_IMPORTED_MODULE_1__.settings.readOnlyTextRenderMode === 'input',
2316
- value: _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getDropdownQuestionValue(this.question),
2336
+ value: this.question.readOnlyText || '',
2317
2337
  isReadOnly: this.question.isReadOnly,
2318
2338
  placeholder: _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getLocString(this.question.locPlaceholder)
2319
2339
  })];
@@ -2323,18 +2343,11 @@ var FlatDropdown = /** @class */ (function (_super) {
2323
2343
  case 3:
2324
2344
  valueBrick = _a;
2325
2345
  compositeFlat = new _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick(valueBrick);
2326
- if (!this.question.isOtherSelected) return [3 /*break*/, 5];
2346
+ if (!this.question.isShowingChoiceComment) return [3 /*break*/, 5];
2327
2347
  otherPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(compositeFlat);
2328
2348
  otherPoint.yTop += this.controller.unitHeight * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_ROWS;
2329
2349
  _c = (_b = compositeFlat).addBrick;
2330
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createCommentFlat(otherPoint, this.question, this.controller, {
2331
- fieldName: this.question.id + '_comment',
2332
- rows: _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.OTHER_ROWS_COUNT,
2333
- value: this.question.comment !== undefined && this.question.comment !== null ? this.question.comment : '',
2334
- shouldRenderBorders: survey_core__WEBPACK_IMPORTED_MODULE_1__.settings.readOnlyCommentRenderMode === 'textarea',
2335
- isReadOnly: this.question.isReadOnly,
2336
- isMultiline: true,
2337
- })];
2350
+ return [4 /*yield*/, this.generateItemComment(otherPoint)];
2338
2351
  case 4:
2339
2352
  _c.apply(_b, [_d.sent()]);
2340
2353
  _d.label = 5;
@@ -2863,11 +2876,13 @@ __webpack_require__.r(__webpack_exports__);
2863
2876
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
2864
2877
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
2865
2878
  /* harmony import */ var _flat_question__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flat_question */ "./src/flat_layout/flat_question.ts");
2866
- /* harmony import */ var _flat_radiogroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat_radiogroup */ "./src/flat_layout/flat_radiogroup.ts");
2867
- /* harmony import */ var _flat_repository__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat_repository */ "./src/flat_layout/flat_repository.ts");
2868
- /* harmony import */ var _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../pdf_render/pdf_text */ "./src/pdf_render/pdf_text.ts");
2869
- /* harmony import */ var _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../pdf_render/pdf_composite */ "./src/pdf_render/pdf_composite.ts");
2870
- /* harmony import */ var _helper_survey__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helper_survey */ "./src/helper_survey.ts");
2879
+ /* harmony import */ var _flat_repository__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat_repository */ "./src/flat_layout/flat_repository.ts");
2880
+ /* harmony import */ var _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../pdf_render/pdf_text */ "./src/pdf_render/pdf_text.ts");
2881
+ /* harmony import */ var _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../pdf_render/pdf_composite */ "./src/pdf_render/pdf_composite.ts");
2882
+ /* harmony import */ var _helper_survey__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helper_survey */ "./src/helper_survey.ts");
2883
+ /* harmony import */ var _pdf_render_pdf_radioitem__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../pdf_render/pdf_radioitem */ "./src/pdf_render/pdf_radioitem.ts");
2884
+ /* harmony import */ var _pdf_render_pdf_checkitem__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../pdf_render/pdf_checkitem */ "./src/pdf_render/pdf_checkitem.ts");
2885
+
2871
2886
 
2872
2887
 
2873
2888
 
@@ -2892,9 +2907,9 @@ var FlatMatrix = /** @class */ (function (_super) {
2892
2907
  switch (_c.label) {
2893
2908
  case 0:
2894
2909
  headers = [];
2895
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
2910
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
2896
2911
  if (this.question.hasRows) {
2897
- currPoint.xLeft += this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_COLUMNS;
2912
+ currPoint.xLeft += this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_COLUMNS;
2898
2913
  }
2899
2914
  i = 0;
2900
2915
  _c.label = 1;
@@ -2902,20 +2917,20 @@ var FlatMatrix = /** @class */ (function (_super) {
2902
2917
  if (!(i < this.question.visibleColumns.length)) return [3 /*break*/, 4];
2903
2918
  this.controller.pushMargins();
2904
2919
  this.controller.margins.left = currPoint.xLeft;
2905
- this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getPageAvailableWidth(this.controller) - this.columnWidth);
2920
+ this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getPageAvailableWidth(this.controller) - this.columnWidth);
2906
2921
  _b = (_a = headers).push;
2907
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createBoldTextFlat(currPoint, this.question, this.controller, this.question.visibleColumns[i].locText)];
2922
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createBoldTextFlat(currPoint, this.question, this.controller, this.question.visibleColumns[i].locText)];
2908
2923
  case 2:
2909
2924
  _b.apply(_a, [_c.sent()]);
2910
- currPoint.xLeft += this.columnWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_COLUMNS;
2925
+ currPoint.xLeft += this.columnWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_COLUMNS;
2911
2926
  this.controller.popMargins();
2912
2927
  _c.label = 3;
2913
2928
  case 3:
2914
2929
  i++;
2915
2930
  return [3 /*break*/, 1];
2916
2931
  case 4:
2917
- compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], headers, false)))();
2918
- return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
2932
+ compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], headers, false)))();
2933
+ return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
2919
2934
  }
2920
2935
  });
2921
2936
  });
@@ -2927,7 +2942,7 @@ var FlatMatrix = /** @class */ (function (_super) {
2927
2942
  switch (_a.label) {
2928
2943
  case 0:
2929
2944
  cells = [];
2930
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
2945
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
2931
2946
  i = 0;
2932
2947
  _a.label = 1;
2933
2948
  case 1:
@@ -2936,7 +2951,7 @@ var FlatMatrix = /** @class */ (function (_super) {
2936
2951
  return [4 /*yield*/, new FlatMatrixRow(this.survey, this.question, this.controller, this.question.visibleRows[i], i, key, i == 0, isVertical, this.rowTitleWidth, this.columnWidth).generateFlatsContent(currPoint)];
2937
2952
  case 2:
2938
2953
  flatsRow = _a.sent();
2939
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createPoint(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.mergeRects.apply(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper, flatsRow));
2954
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.mergeRects.apply(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper, flatsRow));
2940
2955
  currPoint.yTop += this.controller.unitHeight * FlatMatrix.GAP_BETWEEN_ROWS;
2941
2956
  cells.push.apply(cells, flatsRow);
2942
2957
  _a.label = 3;
@@ -2949,16 +2964,16 @@ var FlatMatrix = /** @class */ (function (_super) {
2949
2964
  });
2950
2965
  };
2951
2966
  FlatMatrix.prototype.calculateColumnsWidthes = function () {
2952
- var availableWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getPageAvailableWidth(this.controller);
2967
+ var availableWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getPageAvailableWidth(this.controller);
2953
2968
  if (this.question.hasRows && this.question.rowTitleWidth) {
2954
2969
  this.controller.pushMargins();
2955
- this.rowTitleWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.parseWidth(this.question.rowTitleWidth, availableWidth);
2956
- this.controller.margins.left += (this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_COLUMNS);
2957
- this.columnWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getColumnWidth(this.controller, this.question.visibleColumns.length);
2970
+ this.rowTitleWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.parseWidth(this.question.rowTitleWidth, availableWidth);
2971
+ this.controller.margins.left += (this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_COLUMNS);
2972
+ this.columnWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getColumnWidth(this.controller, this.question.visibleColumns.length);
2958
2973
  this.controller.popMargins();
2959
2974
  }
2960
2975
  else {
2961
- this.columnWidth = this.rowTitleWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getColumnWidth(this.controller, this.question.visibleColumns.length + (this.question.hasRows ? 1 : 0));
2976
+ this.columnWidth = this.rowTitleWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getColumnWidth(this.controller, this.question.visibleColumns.length + (this.question.hasRows ? 1 : 0));
2962
2977
  }
2963
2978
  };
2964
2979
  FlatMatrix.prototype.generateFlatsContent = function (point) {
@@ -2969,14 +2984,14 @@ var FlatMatrix = /** @class */ (function (_super) {
2969
2984
  case 0:
2970
2985
  this.calculateColumnsWidthes();
2971
2986
  isVertical = this.question.renderAs === 'list' || this.controller.matrixRenderAs === 'list' ||
2972
- this.columnWidth < this.controller.measureText(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.MATRIX_COLUMN_WIDTH).width;
2973
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
2987
+ this.columnWidth < this.controller.measureText(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.MATRIX_COLUMN_WIDTH).width;
2988
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
2974
2989
  cells = [];
2975
2990
  if (!(!isVertical && this.question.showHeader && this.question.visibleColumns.length != 0)) return [3 /*break*/, 2];
2976
2991
  return [4 /*yield*/, this.generateFlatsHeader(currPoint)];
2977
2992
  case 1:
2978
2993
  headers = _d.sent();
2979
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createPoint(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.mergeRects.apply(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper, headers));
2994
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.mergeRects.apply(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper, headers));
2980
2995
  currPoint.yTop += FlatMatrix.GAP_BETWEEN_ROWS * this.controller.unitHeight;
2981
2996
  cells.push.apply(cells, headers);
2982
2997
  _d.label = 2;
@@ -2995,23 +3010,20 @@ var FlatMatrix = /** @class */ (function (_super) {
2995
3010
  return FlatMatrix;
2996
3011
  }(_flat_question__WEBPACK_IMPORTED_MODULE_2__.FlatQuestion));
2997
3012
 
2998
- var FlatMatrixRow = /** @class */ (function (_super) {
2999
- (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FlatMatrixRow, _super);
3013
+ var FlatMatrixRow = /** @class */ (function () {
3000
3014
  function FlatMatrixRow(survey, question, controller, row, rowIndex, key, isFirst, isVertical, rowTitleWidth, columnWidth) {
3001
3015
  if (isFirst === void 0) { isFirst = false; }
3002
3016
  if (isVertical === void 0) { isVertical = false; }
3003
- var _this = _super.call(this, survey, question, controller) || this;
3004
- _this.survey = survey;
3005
- _this.controller = controller;
3006
- _this.row = row;
3007
- _this.rowIndex = rowIndex;
3008
- _this.key = key;
3009
- _this.isFirst = isFirst;
3010
- _this.isVertical = isVertical;
3011
- _this.rowTitleWidth = rowTitleWidth;
3012
- _this.columnWidth = columnWidth;
3013
- _this.questionMatrix = question;
3014
- return _this;
3017
+ this.survey = survey;
3018
+ this.question = question;
3019
+ this.controller = controller;
3020
+ this.row = row;
3021
+ this.rowIndex = rowIndex;
3022
+ this.key = key;
3023
+ this.isFirst = isFirst;
3024
+ this.isVertical = isVertical;
3025
+ this.rowTitleWidth = rowTitleWidth;
3026
+ this.columnWidth = columnWidth;
3015
3027
  }
3016
3028
  FlatMatrixRow.prototype.generateFlatsContent = function (point) {
3017
3029
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
@@ -3033,40 +3045,56 @@ var FlatMatrixRow = /** @class */ (function (_super) {
3033
3045
  });
3034
3046
  });
3035
3047
  };
3048
+ FlatMatrixRow.prototype.generateFlatItem = function (rect, item, index, key, context) {
3049
+ if (context === void 0) { context = {}; }
3050
+ var fieldName = this.question.id + key;
3051
+ var isChecked = this.row.isChecked(item);
3052
+ if (this.question.isMultiSelect) {
3053
+ return new _pdf_render_pdf_checkitem__WEBPACK_IMPORTED_MODULE_8__.CheckItemBrick(this.controller, rect, fieldName + 'index' + index, { question: this.question, index: index, checked: isChecked, item: item, readOnly: this.question.isReadOnly });
3054
+ }
3055
+ else {
3056
+ if (index === 0) {
3057
+ this.radioGroupWrap = new _pdf_render_pdf_radioitem__WEBPACK_IMPORTED_MODULE_7__.RadioGroupWrap(fieldName, this.controller, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ readOnly: this.question.isReadOnly, question: this.question }, context));
3058
+ this.question.pdfRadioGroupWrap = this.radioGroupWrap;
3059
+ }
3060
+ else if (typeof this.radioGroupWrap === 'undefined') {
3061
+ this.radioGroupWrap = this.question.pdfRadioGroupWrap;
3062
+ }
3063
+ return new _pdf_render_pdf_radioitem__WEBPACK_IMPORTED_MODULE_7__.RadioItemBrick(this.controller, rect, { question: this.question, index: index, checked: isChecked, item: item }, this.radioGroupWrap);
3064
+ }
3065
+ };
3036
3066
  FlatMatrixRow.prototype.generateTextComposite = function (point, column, index) {
3037
3067
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
3038
- var currPoint, checked, itemRect, radioFlat, cellTextFlat;
3068
+ var currPoint, itemRect, radioFlat, cellTextFlat;
3039
3069
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
3040
3070
  switch (_a.label) {
3041
3071
  case 0:
3042
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
3043
- checked = this.row.value == column.value;
3044
- itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRect(currPoint, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getPageAvailableWidth(this.controller), this.controller.unitHeight);
3045
- radioFlat = this.generateFlatItem(itemRect, column, index, this.key, checked, { row: this.row, rowIndex: this.rowIndex });
3046
- currPoint.yTop = radioFlat.yBot + this.controller.unitHeight * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_ITEM_TEXT;
3047
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createTextFlat(currPoint, this.questionMatrix, this.controller, this.questionMatrix.getCellDisplayLocText(this.row.name, column), _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_5__.TextBrick)];
3072
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
3073
+ itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRect(currPoint, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getPageAvailableWidth(this.controller), this.controller.unitHeight);
3074
+ radioFlat = this.generateFlatItem(itemRect, column, index, this.key, { row: this.row, rowIndex: this.rowIndex });
3075
+ currPoint.yTop = radioFlat.yBot + this.controller.unitHeight * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_ITEM_TEXT;
3076
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createTextFlat(currPoint, this.question, this.controller, this.question.getCellDisplayLocText(this.row.name, column), _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_4__.TextBrick)];
3048
3077
  case 1:
3049
3078
  cellTextFlat = _a.sent();
3050
- return [2 /*return*/, new _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick(radioFlat, cellTextFlat)];
3079
+ return [2 /*return*/, new _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick(radioFlat, cellTextFlat)];
3051
3080
  }
3052
3081
  });
3053
3082
  });
3054
3083
  };
3055
- FlatMatrixRow.prototype.generateItemCompoiste = function (point, column, index) {
3084
+ FlatMatrixRow.prototype.generateItemComposite = function (point, column, index) {
3056
3085
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
3057
- var currPoint, checked, itemRect, radioFlat, radioText;
3086
+ var currPoint, itemRect, radioFlat, radioText;
3058
3087
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
3059
3088
  switch (_a.label) {
3060
3089
  case 0:
3061
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
3062
- checked = this.row.value == column.value;
3063
- itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRect(currPoint, this.controller.unitHeight, this.controller.unitHeight);
3064
- radioFlat = this.generateFlatItem(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.moveRect(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.scaleRect(itemRect, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.SELECT_ITEM_FLAT_SCALE), itemRect.xLeft), column, index, this.key, checked, { row: this.row, rowIndex: this.rowIndex });
3065
- currPoint.xLeft = radioFlat.xRight + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_ITEM_TEXT;
3066
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createTextFlat(currPoint, this.questionMatrix, this.controller, column.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_5__.TextBrick)];
3090
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
3091
+ itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRect(currPoint, this.controller.unitHeight, this.controller.unitHeight);
3092
+ radioFlat = this.generateFlatItem(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.moveRect(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.scaleRect(itemRect, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.SELECT_ITEM_FLAT_SCALE), itemRect.xLeft), column, index, this.key, { row: this.row, rowIndex: this.rowIndex });
3093
+ currPoint.xLeft = radioFlat.xRight + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_ITEM_TEXT;
3094
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createTextFlat(currPoint, this.question, this.controller, column.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_4__.TextBrick)];
3067
3095
  case 1:
3068
3096
  radioText = _a.sent();
3069
- return [2 /*return*/, new _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick(radioFlat, radioText)];
3097
+ return [2 /*return*/, new _pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick(radioFlat, radioText)];
3070
3098
  }
3071
3099
  });
3072
3100
  });
@@ -3078,48 +3106,48 @@ var FlatMatrixRow = /** @class */ (function (_super) {
3078
3106
  switch (_e.label) {
3079
3107
  case 0:
3080
3108
  cells = [];
3081
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
3082
- if (!this.questionMatrix.hasRows) return [3 /*break*/, 2];
3109
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
3110
+ if (!this.question.hasRows) return [3 /*break*/, 2];
3083
3111
  this.controller.pushMargins();
3084
3112
  currPoint.xLeft = this.controller.margins.left;
3085
- this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getPageAvailableWidth(this.controller) - this.rowTitleWidth);
3113
+ this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getPageAvailableWidth(this.controller) - this.rowTitleWidth);
3086
3114
  _b = (_a = cells).push;
3087
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createTextFlat(currPoint, this.questionMatrix, this.controller, this.row.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_5__.TextBrick)];
3115
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createTextFlat(currPoint, this.question, this.controller, this.row.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_4__.TextBrick)];
3088
3116
  case 1:
3089
3117
  _b.apply(_a, [_e.sent()]);
3090
- currPoint.xLeft += this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_COLUMNS;
3118
+ currPoint.xLeft += this.rowTitleWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_COLUMNS;
3091
3119
  this.controller.popMargins();
3092
3120
  _e.label = 2;
3093
3121
  case 2:
3094
3122
  i = 0;
3095
3123
  _e.label = 3;
3096
3124
  case 3:
3097
- if (!(i < this.questionMatrix.visibleColumns.length)) return [3 /*break*/, 8];
3098
- column = this.questionMatrix.visibleColumns[i];
3125
+ if (!(i < this.question.visibleColumns.length)) return [3 /*break*/, 8];
3126
+ column = this.question.visibleColumns[i];
3099
3127
  checked = this.row.value == column.value;
3100
3128
  this.controller.pushMargins();
3101
3129
  this.controller.margins.left = currPoint.xLeft;
3102
- this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.getPageAvailableWidth(this.controller) - this.columnWidth);
3103
- if (!this.questionMatrix.hasCellText) return [3 /*break*/, 5];
3130
+ this.controller.margins.right += (_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.getPageAvailableWidth(this.controller) - this.columnWidth);
3131
+ if (!this.question.hasCellText) return [3 /*break*/, 5];
3104
3132
  _d = (_c = cells).push;
3105
3133
  return [4 /*yield*/, this.generateTextComposite(currPoint, column, i)];
3106
3134
  case 4:
3107
3135
  _d.apply(_c, [_e.sent()]);
3108
3136
  return [3 /*break*/, 6];
3109
3137
  case 5:
3110
- itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRect(currPoint, this.controller.unitHeight, this.controller.unitHeight);
3111
- cells.push(this.generateFlatItem(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.moveRect(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.scaleRect(itemRect, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.SELECT_ITEM_FLAT_SCALE), currPoint.xLeft), column, i, this.key, checked, { row: this.row, rowIndex: this.rowIndex }));
3138
+ itemRect = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRect(currPoint, this.controller.unitHeight, this.controller.unitHeight);
3139
+ cells.push(this.generateFlatItem(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.moveRect(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.scaleRect(itemRect, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.SELECT_ITEM_FLAT_SCALE), currPoint.xLeft), column, i, this.key, { row: this.row, rowIndex: this.rowIndex }));
3112
3140
  _e.label = 6;
3113
3141
  case 6:
3114
- currPoint.xLeft += this.columnWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.GAP_BETWEEN_COLUMNS;
3142
+ currPoint.xLeft += this.columnWidth + this.controller.unitWidth * _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_COLUMNS;
3115
3143
  this.controller.popMargins();
3116
3144
  _e.label = 7;
3117
3145
  case 7:
3118
3146
  i++;
3119
3147
  return [3 /*break*/, 3];
3120
3148
  case 8:
3121
- compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], cells, false)))();
3122
- return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
3149
+ compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], cells, false)))();
3150
+ return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
3123
3151
  }
3124
3152
  });
3125
3153
  });
@@ -3131,29 +3159,54 @@ var FlatMatrixRow = /** @class */ (function (_super) {
3131
3159
  switch (_d.label) {
3132
3160
  case 0:
3133
3161
  cells = [];
3134
- currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.clone(point);
3135
- if (!this.questionMatrix.hasRows) return [3 /*break*/, 2];
3136
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createTextFlat(currPoint, this.questionMatrix, this.controller, this.row.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_5__.TextBrick)];
3162
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
3163
+ if (!this.question.hasRows) return [3 /*break*/, 2];
3164
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createTextFlat(currPoint, this.question, this.controller, this.row.locText, _pdf_render_pdf_text__WEBPACK_IMPORTED_MODULE_4__.TextBrick)];
3137
3165
  case 1:
3138
3166
  rowTextFlat = _d.sent();
3139
3167
  currPoint.yTop = rowTextFlat.yBot + _flat_question__WEBPACK_IMPORTED_MODULE_2__.FlatQuestion.CONTENT_GAP_VERT_SCALE * this.controller.unitHeight;
3140
3168
  cells.push(rowTextFlat);
3141
3169
  _d.label = 2;
3142
3170
  case 2:
3143
- this.generateFlatComposite = (this.questionMatrix.hasCellText) ? this.generateTextComposite : this.generateItemCompoiste;
3144
3171
  _b = (_a = cells.push).apply;
3145
3172
  _c = [cells];
3146
- return [4 /*yield*/, this.generateVerticallyItems(currPoint, this.questionMatrix.visibleColumns)];
3173
+ return [4 /*yield*/, this.generateVerticallyItems(currPoint, this.question.visibleColumns)];
3147
3174
  case 3:
3148
3175
  _b.apply(_a, _c.concat([_d.sent()]));
3149
- compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_6__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], cells, false)))();
3150
- return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_7__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
3176
+ compositeBrick = new (_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick.bind.apply(_pdf_render_pdf_composite__WEBPACK_IMPORTED_MODULE_5__.CompositeBrick, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([void 0], cells, false)))();
3177
+ return [2 /*return*/, [compositeBrick, _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createRowlineFlat(_helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.createPoint(compositeBrick), this.controller)]];
3178
+ }
3179
+ });
3180
+ });
3181
+ };
3182
+ FlatMatrixRow.prototype.generateVerticallyItems = function (point, itemValues) {
3183
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
3184
+ var currPoint, flats, i, itemFlat;
3185
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
3186
+ switch (_a.label) {
3187
+ case 0:
3188
+ currPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.clone(point);
3189
+ flats = [];
3190
+ i = 0;
3191
+ _a.label = 1;
3192
+ case 1:
3193
+ if (!(i < itemValues.length)) return [3 /*break*/, 4];
3194
+ return [4 /*yield*/, ((this.question.hasCellText) ? this.generateTextComposite : this.generateItemComposite).call(this, currPoint, itemValues[i], i)];
3195
+ case 2:
3196
+ itemFlat = _a.sent();
3197
+ currPoint.yTop = itemFlat.yBot + _helper_survey__WEBPACK_IMPORTED_MODULE_6__.SurveyHelper.GAP_BETWEEN_ROWS * this.controller.unitHeight;
3198
+ flats.push(itemFlat);
3199
+ _a.label = 3;
3200
+ case 3:
3201
+ i++;
3202
+ return [3 /*break*/, 1];
3203
+ case 4: return [2 /*return*/, flats];
3151
3204
  }
3152
3205
  });
3153
3206
  });
3154
3207
  };
3155
3208
  return FlatMatrixRow;
3156
- }(_flat_radiogroup__WEBPACK_IMPORTED_MODULE_3__.FlatRadiogroup));
3209
+ }());
3157
3210
 
3158
3211
  survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.removeProperty('matrix', 'renderAs');
3159
3212
  survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperty('matrix', {
@@ -3162,7 +3215,7 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperty('matrix', {
3162
3215
  visible: false,
3163
3216
  choices: ['auto', 'list']
3164
3217
  });
3165
- _flat_repository__WEBPACK_IMPORTED_MODULE_4__.FlatRepository.getInstance().register('matrix', FlatMatrix);
3218
+ _flat_repository__WEBPACK_IMPORTED_MODULE_3__.FlatRepository.getInstance().register('matrix', FlatMatrix);
3166
3219
 
3167
3220
 
3168
3221
  /***/ }),
@@ -4589,6 +4642,26 @@ var FlatSelectBase = /** @class */ (function (_super) {
4589
4642
  _this.question = question;
4590
4643
  return _this;
4591
4644
  }
4645
+ FlatSelectBase.prototype.generateItemComment = function (point, item) {
4646
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
4647
+ var commentModel;
4648
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
4649
+ switch (_a.label) {
4650
+ case 0:
4651
+ commentModel = this.question.getCommentTextAreaModel(item);
4652
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.createCommentFlat(point, this.question, this.controller, {
4653
+ fieldName: commentModel.id,
4654
+ rows: _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.OTHER_ROWS_COUNT,
4655
+ value: commentModel.getTextValue(),
4656
+ shouldRenderBorders: survey_core__WEBPACK_IMPORTED_MODULE_1__.settings.readOnlyCommentRenderMode === 'textarea',
4657
+ isReadOnly: this.question.isReadOnly,
4658
+ isMultiline: true,
4659
+ })];
4660
+ case 1: return [2 /*return*/, _a.sent()];
4661
+ }
4662
+ });
4663
+ });
4664
+ };
4592
4665
  FlatSelectBase.prototype.generateFlatComposite = function (point, item, index) {
4593
4666
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
4594
4667
  var compositeFlat, itemRect, itemFlat, textPoint, _a, _b, otherPoint, _c, _d;
@@ -4608,19 +4681,11 @@ var FlatSelectBase = /** @class */ (function (_super) {
4608
4681
  _b.apply(_a, [_e.sent()]);
4609
4682
  _e.label = 2;
4610
4683
  case 2:
4611
- if (!(item === this.question.otherItem && (item.value === this.question.value ||
4612
- (typeof this.question.isOtherSelected !== 'undefined' && this.question.isOtherSelected)))) return [3 /*break*/, 4];
4613
- otherPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.createPoint(compositeFlat);
4684
+ if (!item.isCommentShowing) return [3 /*break*/, 4];
4685
+ otherPoint = _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.createPoint(compositeFlat, true, false);
4614
4686
  otherPoint.yTop += this.controller.unitHeight * _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.GAP_BETWEEN_ROWS;
4615
4687
  _d = (_c = compositeFlat).addBrick;
4616
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.createCommentFlat(otherPoint, this.question, this.controller, {
4617
- fieldName: this.question.id + '_comment' + index,
4618
- rows: _helper_survey__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.OTHER_ROWS_COUNT,
4619
- value: this.question.comment !== undefined && this.question.comment !== null ? this.question.comment : '',
4620
- shouldRenderBorders: survey_core__WEBPACK_IMPORTED_MODULE_1__.settings.readOnlyCommentRenderMode === 'textarea',
4621
- isReadOnly: this.question.isReadOnly,
4622
- isMultiline: true,
4623
- })];
4688
+ return [4 /*yield*/, this.generateItemComment(otherPoint, item)];
4624
4689
  case 3:
4625
4690
  _d.apply(_c, [_e.sent()]);
4626
4691
  _e.label = 4;
@@ -6197,19 +6262,6 @@ var SurveyHelper = /** @class */ (function () {
6197
6262
  return text.renderedHtml;
6198
6263
  return text.renderedText || text.renderedHtml;
6199
6264
  };
6200
- SurveyHelper.getDropdownQuestionValue = function (question) {
6201
- var qDropDown = question;
6202
- if (qDropDown.isOtherSelected) {
6203
- return qDropDown.otherText;
6204
- }
6205
- else if (!!question.displayValue) {
6206
- return question.displayValue;
6207
- }
6208
- else if (qDropDown.showOptionsCaption) {
6209
- return qDropDown.optionsCaption;
6210
- }
6211
- return '';
6212
- };
6213
6265
  SurveyHelper.getContentQuestion = function (question) {
6214
6266
  return !!question.contentQuestion ? question.contentQuestion : question;
6215
6267
  };
@@ -11396,7 +11448,7 @@ var DropdownBrick = /** @class */ (function (_super) {
11396
11448
  comboBox.fontSize = this.fontSize;
11397
11449
  comboBox.readOnly = this.question.isReadOnly;
11398
11450
  comboBox.isUnicode = _helper_survey__WEBPACK_IMPORTED_MODULE_2__.SurveyHelper.isCustomFont(this.controller, comboBox.fontName);
11399
- comboBox.V = this.getCorrectedText(_helper_survey__WEBPACK_IMPORTED_MODULE_2__.SurveyHelper.getDropdownQuestionValue(this.question));
11451
+ comboBox.V = this.getCorrectedText(this.question.readOnlyText || '');
11400
11452
  this.controller.doc.addField(comboBox);
11401
11453
  _helper_survey__WEBPACK_IMPORTED_MODULE_2__.SurveyHelper.renderFlatBorders(this.controller, this);
11402
11454
  return [2 /*return*/];