survey-react 1.9.117 → 1.9.118
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 +14 -4
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +5 -2
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +5 -2
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +93 -23
- package/survey.react.js +239 -118
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +4 -4
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.118
|
3
3
|
* Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -112,7 +112,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
112
112
|
__webpack_require__.r(__webpack_exports__);
|
113
113
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SignaturePad; });
|
114
114
|
/*!
|
115
|
-
* Signature Pad v4.1.
|
115
|
+
* Signature Pad v4.1.7 | https://github.com/szimek/signature_pad
|
116
116
|
* (c) 2023 Szymon Nowak | Released under the MIT license
|
117
117
|
*/
|
118
118
|
|
@@ -143,14 +143,6 @@ class Point {
|
|
143
143
|
}
|
144
144
|
|
145
145
|
class Bezier {
|
146
|
-
constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
|
147
|
-
this.startPoint = startPoint;
|
148
|
-
this.control2 = control2;
|
149
|
-
this.control1 = control1;
|
150
|
-
this.endPoint = endPoint;
|
151
|
-
this.startWidth = startWidth;
|
152
|
-
this.endWidth = endWidth;
|
153
|
-
}
|
154
146
|
static fromPoints(points, widths) {
|
155
147
|
const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
|
156
148
|
const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
|
@@ -176,6 +168,14 @@ class Bezier {
|
|
176
168
|
c2: new Point(m2.x + tx, m2.y + ty),
|
177
169
|
};
|
178
170
|
}
|
171
|
+
constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
|
172
|
+
this.startPoint = startPoint;
|
173
|
+
this.control2 = control2;
|
174
|
+
this.control1 = control1;
|
175
|
+
this.endPoint = endPoint;
|
176
|
+
this.startWidth = startWidth;
|
177
|
+
this.endWidth = endWidth;
|
178
|
+
}
|
179
179
|
length() {
|
180
180
|
const steps = 10;
|
181
181
|
let length = 0;
|
@@ -266,7 +266,7 @@ class SignaturePad extends SignatureEventTarget {
|
|
266
266
|
constructor(canvas, options = {}) {
|
267
267
|
super();
|
268
268
|
this.canvas = canvas;
|
269
|
-
this.
|
269
|
+
this._drawingStroke = false;
|
270
270
|
this._isEmpty = true;
|
271
271
|
this._lastPoints = [];
|
272
272
|
this._data = [];
|
@@ -274,18 +274,14 @@ class SignaturePad extends SignatureEventTarget {
|
|
274
274
|
this._lastWidth = 0;
|
275
275
|
this._handleMouseDown = (event) => {
|
276
276
|
if (event.buttons === 1) {
|
277
|
-
this._drawningStroke = true;
|
278
277
|
this._strokeBegin(event);
|
279
278
|
}
|
280
279
|
};
|
281
280
|
this._handleMouseMove = (event) => {
|
282
|
-
|
283
|
-
this._strokeMoveUpdate(event);
|
284
|
-
}
|
281
|
+
this._strokeMoveUpdate(event);
|
285
282
|
};
|
286
283
|
this._handleMouseUp = (event) => {
|
287
|
-
if (event.buttons === 1
|
288
|
-
this._drawningStroke = false;
|
284
|
+
if (event.buttons === 1) {
|
289
285
|
this._strokeEnd(event);
|
290
286
|
}
|
291
287
|
};
|
@@ -316,20 +312,15 @@ class SignaturePad extends SignatureEventTarget {
|
|
316
312
|
}
|
317
313
|
};
|
318
314
|
this._handlePointerStart = (event) => {
|
319
|
-
this._drawningStroke = true;
|
320
315
|
event.preventDefault();
|
321
316
|
this._strokeBegin(event);
|
322
317
|
};
|
323
318
|
this._handlePointerMove = (event) => {
|
324
|
-
|
325
|
-
event.preventDefault();
|
326
|
-
this._strokeMoveUpdate(event);
|
327
|
-
}
|
319
|
+
this._strokeMoveUpdate(event);
|
328
320
|
};
|
329
321
|
this._handlePointerEnd = (event) => {
|
330
|
-
if (this.
|
322
|
+
if (this._drawingStroke) {
|
331
323
|
event.preventDefault();
|
332
|
-
this._drawningStroke = false;
|
333
324
|
this._strokeEnd(event);
|
334
325
|
}
|
335
326
|
};
|
@@ -450,7 +441,11 @@ class SignaturePad extends SignatureEventTarget {
|
|
450
441
|
};
|
451
442
|
}
|
452
443
|
_strokeBegin(event) {
|
453
|
-
this.dispatchEvent(new CustomEvent('beginStroke', { detail: event }));
|
444
|
+
const cancelled = !this.dispatchEvent(new CustomEvent('beginStroke', { detail: event, cancelable: true }));
|
445
|
+
if (cancelled) {
|
446
|
+
return;
|
447
|
+
}
|
448
|
+
this._drawingStroke = true;
|
454
449
|
const pointGroupOptions = this._getPointGroupOptions();
|
455
450
|
const newPointGroup = Object.assign(Object.assign({}, pointGroupOptions), { points: [] });
|
456
451
|
this._data.push(newPointGroup);
|
@@ -458,6 +453,9 @@ class SignaturePad extends SignatureEventTarget {
|
|
458
453
|
this._strokeUpdate(event);
|
459
454
|
}
|
460
455
|
_strokeUpdate(event) {
|
456
|
+
if (!this._drawingStroke) {
|
457
|
+
return;
|
458
|
+
}
|
461
459
|
if (this._data.length === 0) {
|
462
460
|
this._strokeBegin(event);
|
463
461
|
return;
|
@@ -496,17 +494,21 @@ class SignaturePad extends SignatureEventTarget {
|
|
496
494
|
this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));
|
497
495
|
}
|
498
496
|
_strokeEnd(event) {
|
497
|
+
if (!this._drawingStroke) {
|
498
|
+
return;
|
499
|
+
}
|
499
500
|
this._strokeUpdate(event);
|
501
|
+
this._drawingStroke = false;
|
500
502
|
this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));
|
501
503
|
}
|
502
504
|
_handlePointerEvents() {
|
503
|
-
this.
|
505
|
+
this._drawingStroke = false;
|
504
506
|
this.canvas.addEventListener('pointerdown', this._handlePointerStart);
|
505
507
|
this.canvas.addEventListener('pointermove', this._handlePointerMove);
|
506
508
|
this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);
|
507
509
|
}
|
508
510
|
_handleMouseEvents() {
|
509
|
-
this.
|
511
|
+
this._drawingStroke = false;
|
510
512
|
this.canvas.addEventListener('mousedown', this._handleMouseDown);
|
511
513
|
this.canvas.addEventListener('mousemove', this._handleMouseMove);
|
512
514
|
this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);
|
@@ -4820,6 +4822,7 @@ var modernCss = {
|
|
4820
4822
|
},
|
4821
4823
|
saveData: {
|
4822
4824
|
root: "sv-save-data_root",
|
4825
|
+
rootWithButtons: "sv-save-data_root--with-buttons",
|
4823
4826
|
info: "sv-save-data_info",
|
4824
4827
|
error: "sv-save-data_error",
|
4825
4828
|
success: "sv-save-data_success",
|
@@ -5212,6 +5215,7 @@ var defaultStandardCss = {
|
|
5212
5215
|
},
|
5213
5216
|
saveData: {
|
5214
5217
|
root: "sv-save-data_root",
|
5218
|
+
rootWithButtons: "sv-save-data_root--with-buttons",
|
5215
5219
|
info: "sv-save-data_info",
|
5216
5220
|
error: "sv-save-data_error",
|
5217
5221
|
success: "sv-save-data_success",
|
@@ -5909,6 +5913,7 @@ var defaultV2Css = {
|
|
5909
5913
|
},
|
5910
5914
|
saveData: {
|
5911
5915
|
root: "sv-save-data_root",
|
5916
|
+
rootWithButtons: "sv-save-data_root--with-buttons",
|
5912
5917
|
info: "sv-save-data_info",
|
5913
5918
|
error: "sv-save-data_error",
|
5914
5919
|
success: "sv-save-data_success",
|
@@ -6174,7 +6179,10 @@ var DragDropPageHelperV1 = /** @class */ (function () {
|
|
6174
6179
|
allow: true,
|
6175
6180
|
target: this.dragDropInfo.target,
|
6176
6181
|
source: this.dragDropInfo.source,
|
6182
|
+
toElement: this.dragDropInfo.target,
|
6183
|
+
draggedElement: this.dragDropInfo.source,
|
6177
6184
|
parent: parent,
|
6185
|
+
fromElement: this.dragDropInfo.source ? this.dragDropInfo.source.parent : null,
|
6178
6186
|
insertAfter: insertAfter,
|
6179
6187
|
insertBefore: insertBefore,
|
6180
6188
|
};
|
@@ -6587,10 +6595,12 @@ var DragDropChoices = /** @class */ (function (_super) {
|
|
6587
6595
|
var draggedElementShortcut = document.createElement("div");
|
6588
6596
|
draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n box-shadow: var(--sjs-shadow-large, 0px 8px 16px 0px rgba(0, 0, 0, 0.1)), var(--sjs-shadow-medium, 0px 2px 6px 0px rgba(0, 0, 0, 0.1));\n background-color: var(--sjs-general-backcolor, var(--background, #fff));\n padding: calc(0.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n border-radius: calc(0.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n ";
|
6589
6597
|
var itemValueNode = draggedElementNode.closest("[data-sv-drop-target-item-value]");
|
6590
|
-
|
6598
|
+
this.imagepickerControlsNode = itemValueNode.querySelector(".svc-image-item-value-controls");
|
6591
6599
|
var imageContainerNode = itemValueNode.querySelector(".sd-imagepicker__image-container");
|
6592
6600
|
var imageNode = itemValueNode.querySelector(item.imageLink ? "img" : ".sd-imagepicker__no-image").cloneNode(true);
|
6593
|
-
|
6601
|
+
if (!!this.imagepickerControlsNode) {
|
6602
|
+
this.imagepickerControlsNode.style.display = "none";
|
6603
|
+
}
|
6594
6604
|
imageContainerNode.style.width = imageNode.width + "px";
|
6595
6605
|
imageContainerNode.style.height = imageNode.height + "px";
|
6596
6606
|
imageNode.style.objectFit = "cover";
|
@@ -6680,6 +6690,10 @@ var DragDropChoices = /** @class */ (function (_super) {
|
|
6680
6690
|
if (!!this.parentElement) {
|
6681
6691
|
this.updateVisibleChoices(this.parentElement);
|
6682
6692
|
}
|
6693
|
+
if (!!this.imagepickerControlsNode) {
|
6694
|
+
this.imagepickerControlsNode.style.display = "flex";
|
6695
|
+
this.imagepickerControlsNode = null;
|
6696
|
+
}
|
6683
6697
|
_super.prototype.clear.call(this);
|
6684
6698
|
};
|
6685
6699
|
DragDropChoices.prototype.updateVisibleChoices = function (parent) {
|
@@ -9384,8 +9398,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9384
9398
|
//import "../../modern.scss";
|
9385
9399
|
var Version;
|
9386
9400
|
var ReleaseDate;
|
9387
|
-
Version = "" + "1.9.
|
9388
|
-
ReleaseDate = "" + "2023-11-
|
9401
|
+
Version = "" + "1.9.118";
|
9402
|
+
ReleaseDate = "" + "2023-11-21";
|
9389
9403
|
function checkLibraryVersion(ver, libraryName) {
|
9390
9404
|
if (Version != ver) {
|
9391
9405
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -18761,6 +18775,11 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
18761
18775
|
return ((value === false && (this.type == "boolean" || this.type == "switch")) ||
|
18762
18776
|
value === "" || _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value));
|
18763
18777
|
};
|
18778
|
+
JsonObjectProperty.prototype.getSerializableValue = function (obj) {
|
18779
|
+
if (!!this.onSerializeValue)
|
18780
|
+
return this.onSerializeValue(obj);
|
18781
|
+
return this.getValue(obj);
|
18782
|
+
};
|
18764
18783
|
JsonObjectProperty.prototype.getValue = function (obj) {
|
18765
18784
|
if (this.onGetValue)
|
18766
18785
|
return this.onGetValue(obj);
|
@@ -19352,6 +19371,9 @@ var JsonMetadataClass = /** @class */ (function () {
|
|
19352
19371
|
if (!!propInfo.baseValue) {
|
19353
19372
|
prop.setBaseValue(propInfo.baseValue);
|
19354
19373
|
}
|
19374
|
+
if (propInfo.onSerializeValue) {
|
19375
|
+
prop.onSerializeValue = propInfo.onSerializeValue;
|
19376
|
+
}
|
19355
19377
|
if (propInfo.onGetValue) {
|
19356
19378
|
prop.onGetValue = propInfo.onGetValue;
|
19357
19379
|
}
|
@@ -20146,7 +20168,7 @@ var JsonObject = /** @class */ (function () {
|
|
20146
20168
|
if (property.isSerializable === false ||
|
20147
20169
|
(property.isLightSerializable === false && this.lightSerializing))
|
20148
20170
|
return;
|
20149
|
-
var value = property.
|
20171
|
+
var value = property.getSerializableValue(obj);
|
20150
20172
|
if (!storeDefaults && property.isDefaultValueByObj(obj, value))
|
20151
20173
|
return;
|
20152
20174
|
if (this.isValueArray(value)) {
|
@@ -22526,8 +22548,8 @@ var englishStrings = {
|
|
22526
22548
|
textMaxLength: "Please enter no more than {0} character(s).",
|
22527
22549
|
textMinMaxLength: "Please enter at least {0} and no more than {1} characters.",
|
22528
22550
|
minRowCountError: "Please fill in at least {0} row(s).",
|
22529
|
-
minSelectError: "Please select at least {0}
|
22530
|
-
maxSelectError: "Please select no more than {0}
|
22551
|
+
minSelectError: "Please select at least {0} option(s).",
|
22552
|
+
maxSelectError: "Please select no more than {0} option(s).",
|
22531
22553
|
numericMinMax: "The '{0}' should be at least {1} and at most {2}",
|
22532
22554
|
numericMin: "The '{0}' should be at least {1}",
|
22533
22555
|
numericMax: "The '{0}' should be at most {1}",
|
@@ -28424,9 +28446,19 @@ var QuestionMatrixBaseModel = /** @class */ (function (_super) {
|
|
28424
28446
|
enumerable: false,
|
28425
28447
|
configurable: true
|
28426
28448
|
});
|
28449
|
+
//a11y
|
28427
28450
|
QuestionMatrixBaseModel.prototype.getCellAriaLabel = function (rowTitle, columnTitle) {
|
28428
|
-
|
28451
|
+
var row = (this.getLocalizationString("matrix_row") || "row").toLocaleLowerCase();
|
28452
|
+
var column = (this.getLocalizationString("matrix_column") || "column").toLocaleLowerCase();
|
28453
|
+
return row + " " + rowTitle + ", " + column + " " + columnTitle;
|
28429
28454
|
};
|
28455
|
+
Object.defineProperty(QuestionMatrixBaseModel.prototype, "isNewA11yStructure", {
|
28456
|
+
get: function () {
|
28457
|
+
return true;
|
28458
|
+
},
|
28459
|
+
enumerable: false,
|
28460
|
+
configurable: true
|
28461
|
+
});
|
28430
28462
|
__decorate([
|
28431
28463
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
28432
28464
|
], QuestionMatrixBaseModel.prototype, "verticalAlign", void 0);
|
@@ -28606,6 +28638,7 @@ var Notifier = /** @class */ (function (_super) {
|
|
28606
28638
|
Notifier.prototype.getCssClass = function (type) {
|
28607
28639
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
|
28608
28640
|
.append(this.cssClasses.root)
|
28641
|
+
.append(this.cssClasses.rootWithButtons, this.actionBar.visibleActions.length > 0)
|
28609
28642
|
.append(this.cssClasses.info, type !== "error" && type !== "success")
|
28610
28643
|
.append(this.cssClasses.error, type === "error")
|
28611
28644
|
.append(this.cssClasses.success, type === "success")
|
@@ -34992,16 +35025,6 @@ var Question = /** @class */ (function (_super) {
|
|
34992
35025
|
this.updateCommentElements();
|
34993
35026
|
}
|
34994
35027
|
};
|
34995
|
-
Question.prototype.onCompositionUpdateComment = function (event) {
|
34996
|
-
var _this = this;
|
34997
|
-
if (this.isInputTextUpdate) {
|
34998
|
-
setTimeout(function () {
|
34999
|
-
if (event.target) {
|
35000
|
-
_this.comment = event.target.value;
|
35001
|
-
}
|
35002
|
-
}, 1);
|
35003
|
-
}
|
35004
|
-
};
|
35005
35028
|
Question.prototype.onCommentChange = function (event) {
|
35006
35029
|
this.comment = event.target.value;
|
35007
35030
|
if (this.comment !== event.target.value) {
|
@@ -35529,6 +35552,7 @@ var Question = /** @class */ (function (_super) {
|
|
35529
35552
|
* @see otherItem
|
35530
35553
|
* @see otherErrorText
|
35531
35554
|
* @see showCommentArea
|
35555
|
+
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
35532
35556
|
*/
|
35533
35557
|
get: function () {
|
35534
35558
|
return this.getPropertyValue("showOtherItem", false);
|
@@ -37699,6 +37723,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
37699
37723
|
* When users select the "None" item in multi-select questions, all other items become unselected.
|
37700
37724
|
* @see noneItem
|
37701
37725
|
* @see noneText
|
37726
|
+
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
37702
37727
|
*/
|
37703
37728
|
get: function () {
|
37704
37729
|
return this.getPropertyValue("showNoneItem");
|
@@ -38180,6 +38205,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38180
38205
|
*
|
38181
38206
|
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-dropdownrestfull/ (linkStyle))
|
38182
38207
|
* @see choices
|
38208
|
+
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
38183
38209
|
*/
|
38184
38210
|
get: function () {
|
38185
38211
|
return this.getPropertyValue("choicesByUrl");
|
@@ -38213,6 +38239,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38213
38239
|
* If you need to specify only the `value` property, you can set the `choices` property to an array of primitive values, for example, `[ "item1", "item2", "item3" ]`. These values are both saved in survey results and used as display text.
|
38214
38240
|
* @see choicesByUrl
|
38215
38241
|
* @see choicesFromQuestion
|
38242
|
+
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
38216
38243
|
*/
|
38217
38244
|
get: function () {
|
38218
38245
|
return this.getPropertyValue("choices");
|
@@ -38355,6 +38382,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38355
38382
|
* - `"asc"`- Sorts choice items in ascending order.
|
38356
38383
|
* - `"desc"`- Sorts choice items in ascending order.
|
38357
38384
|
* - `"random"` - Displays choice items in random order.
|
38385
|
+
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
38358
38386
|
*/
|
38359
38387
|
get: function () {
|
38360
38388
|
return this.getPropertyValue("choicesOrder");
|
@@ -38879,16 +38907,6 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38879
38907
|
this.updateCommentElements();
|
38880
38908
|
}
|
38881
38909
|
};
|
38882
|
-
QuestionSelectBase.prototype.onCompositionUpdateOtherValue = function (event) {
|
38883
|
-
var _this = this;
|
38884
|
-
if (this.isInputTextUpdate) {
|
38885
|
-
setTimeout(function () {
|
38886
|
-
if (event.target) {
|
38887
|
-
_this.otherValue = event.target.value;
|
38888
|
-
}
|
38889
|
-
}, 1);
|
38890
|
-
}
|
38891
|
-
};
|
38892
38910
|
QuestionSelectBase.prototype.onOtherValueChange = function (event) {
|
38893
38911
|
this.otherValue = event.target.value;
|
38894
38912
|
if (this.otherValue !== event.target.value) {
|
@@ -40552,12 +40570,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
40552
40570
|
* @see enabledChoices
|
40553
40571
|
*/
|
40554
40572
|
get: function () {
|
40573
|
+
var val = this.renderedValue;
|
40574
|
+
var visChoices = this.visibleChoices;
|
40575
|
+
var selectedItemValues = this.selectedItemValues;
|
40555
40576
|
if (this.isEmpty())
|
40556
40577
|
return [];
|
40557
|
-
var
|
40558
|
-
var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, this.visibleChoices) : this.visibleChoices;
|
40578
|
+
var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, visChoices) : visChoices;
|
40559
40579
|
var itemValues = val.map(function (item) { return _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"].getItemByValue(allChoices, item); }).filter(function (item) { return !!item; });
|
40560
|
-
if (!itemValues.length && !
|
40580
|
+
if (!itemValues.length && !selectedItemValues) {
|
40561
40581
|
this.updateSelectedItemValues();
|
40562
40582
|
}
|
40563
40583
|
return this.validateItemValues(itemValues);
|
@@ -41155,7 +41175,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
41155
41175
|
this.updateRemainingCharacterCounter(event.target.value);
|
41156
41176
|
};
|
41157
41177
|
QuestionCommentModel.prototype.onKeyDown = function (event) {
|
41158
|
-
this.
|
41178
|
+
this.onKeyDownPreprocess && this.onKeyDownPreprocess(event);
|
41159
41179
|
if (!this.acceptCarriageReturn && (event.key === "Enter" || event.keyCode === 13)) {
|
41160
41180
|
event.preventDefault();
|
41161
41181
|
event.stopPropagation();
|
@@ -43296,7 +43316,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43296
43316
|
_this.onUploadStateChanged = _this.addEvent();
|
43297
43317
|
_this.onStateChanged = _this.addEvent();
|
43298
43318
|
_this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
43299
|
-
_this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
43300
43319
|
_this.canFlipCameraValue = undefined;
|
43301
43320
|
_this.prevPreviewLength = 0;
|
43302
43321
|
_this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
|
@@ -43355,6 +43374,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43355
43374
|
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["loadFileFromBase64"])(data.content, data.name);
|
43356
43375
|
}
|
43357
43376
|
};
|
43377
|
+
_this.createLocalizableString("takePhotoCaption", _this, false, true);
|
43378
|
+
_this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
43379
|
+
_this.actionsContainer.locOwner = _this;
|
43358
43380
|
_this.fileIndexAction = new _actions_action__WEBPACK_IMPORTED_MODULE_8__["Action"]({
|
43359
43381
|
id: "fileIndex",
|
43360
43382
|
title: _this.getFileIndexCaption(),
|
@@ -43381,7 +43403,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43381
43403
|
id: "sv-file-take-picture",
|
43382
43404
|
iconSize: "auto",
|
43383
43405
|
innerCss: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(_this.cssClasses.contextButton).append(_this.cssClasses.takePictureButton).toString(); }),
|
43384
|
-
|
43406
|
+
locTitle: _this.locTakePhotoCaption,
|
43385
43407
|
showTitle: false,
|
43386
43408
|
action: function () {
|
43387
43409
|
_this.snapPicture();
|
@@ -43417,7 +43439,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43417
43439
|
iconName: "icon-takepicture_24x24",
|
43418
43440
|
id: "sv-file-start-camera",
|
43419
43441
|
iconSize: "auto",
|
43420
|
-
|
43442
|
+
locTitle: _this.locTakePhotoCaption,
|
43421
43443
|
showTitle: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return !_this.isAnswered; }),
|
43422
43444
|
enabledIf: function () { return !_this.isInputReadOnly; },
|
43423
43445
|
action: function () {
|
@@ -43752,6 +43774,17 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43752
43774
|
QuestionFileModel.prototype.getConfirmRemoveMessage = function (fileName) {
|
43753
43775
|
return this.confirmRemoveMessage.format(fileName);
|
43754
43776
|
};
|
43777
|
+
Object.defineProperty(QuestionFileModel.prototype, "takePhotoCaption", {
|
43778
|
+
get: function () { return this.getLocalizableStringText("takePhotoCaption"); },
|
43779
|
+
set: function (val) { this.setLocalizableStringText("takePhotoCaption", val); },
|
43780
|
+
enumerable: false,
|
43781
|
+
configurable: true
|
43782
|
+
});
|
43783
|
+
Object.defineProperty(QuestionFileModel.prototype, "locTakePhotoCaption", {
|
43784
|
+
get: function () { return this.getLocalizableString("takePhotoCaption"); },
|
43785
|
+
enumerable: false,
|
43786
|
+
configurable: true
|
43787
|
+
});
|
43755
43788
|
Object.defineProperty(QuestionFileModel.prototype, "locRenderedPlaceholder", {
|
43756
43789
|
get: function () {
|
43757
43790
|
var _this = this;
|
@@ -44360,9 +44393,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44360
44393
|
__decorate([
|
44361
44394
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "chooseFileCaption" } })
|
44362
44395
|
], QuestionFileModel.prototype, "chooseButtonCaption", void 0);
|
44363
|
-
__decorate([
|
44364
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "takePhotoCaption" } })
|
44365
|
-
], QuestionFileModel.prototype, "takePhotoCaption", void 0);
|
44366
44396
|
__decorate([
|
44367
44397
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "replaceFileCaption" } })
|
44368
44398
|
], QuestionFileModel.prototype, "replaceButtonCaption", void 0);
|
@@ -46608,7 +46638,19 @@ var MatrixDropdownCell = /** @class */ (function () {
|
|
46608
46638
|
this.data = data;
|
46609
46639
|
this.questionValue = this.createQuestion(column, row, data);
|
46610
46640
|
this.questionValue.updateCustomWidget();
|
46641
|
+
this.updateCellQuestionTitleDueToAccessebility(row);
|
46611
46642
|
}
|
46643
|
+
MatrixDropdownCell.prototype.updateCellQuestionTitleDueToAccessebility = function (row) {
|
46644
|
+
var _this = this;
|
46645
|
+
this.questionValue.locTitle.onGetTextCallback = function (str) {
|
46646
|
+
if (!row || !row.getSurvey())
|
46647
|
+
return _this.questionValue.title;
|
46648
|
+
var rowTitle = row.getAccessbilityText();
|
46649
|
+
if (!rowTitle)
|
46650
|
+
return _this.questionValue.title;
|
46651
|
+
return _this.column.colOwner.getCellAriaLabel(rowTitle, _this.questionValue.title);
|
46652
|
+
};
|
46653
|
+
};
|
46612
46654
|
MatrixDropdownCell.prototype.locStrsChanged = function () {
|
46613
46655
|
this.question.locStrsChanged();
|
46614
46656
|
};
|
@@ -46766,6 +46808,13 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
46766
46808
|
enumerable: false,
|
46767
46809
|
configurable: true
|
46768
46810
|
});
|
46811
|
+
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "dataName", {
|
46812
|
+
get: function () {
|
46813
|
+
return this.rowName;
|
46814
|
+
},
|
46815
|
+
enumerable: false,
|
46816
|
+
configurable: true
|
46817
|
+
});
|
46769
46818
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "text", {
|
46770
46819
|
get: function () {
|
46771
46820
|
return this.rowName;
|
@@ -46822,6 +46871,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
46822
46871
|
enumerable: false,
|
46823
46872
|
configurable: true
|
46824
46873
|
});
|
46874
|
+
MatrixDropdownRowModelBase.prototype.getAccessbilityText = function () {
|
46875
|
+
return this.locText && this.locText.renderedHtml;
|
46876
|
+
};
|
46825
46877
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "hasPanel", {
|
46826
46878
|
get: function () {
|
46827
46879
|
if (!this.data)
|
@@ -48430,7 +48482,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
48430
48482
|
questionPlainData.isNode = true;
|
48431
48483
|
questionPlainData.data = this.visibleRows.map(function (row) {
|
48432
48484
|
var rowDataItem = {
|
48433
|
-
name: row.
|
48485
|
+
name: row.dataName,
|
48434
48486
|
title: row.text,
|
48435
48487
|
value: row.value,
|
48436
48488
|
displayValue: _this.getRowDisplayValue(false, row, row.value),
|
@@ -50244,12 +50296,6 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
|
50244
50296
|
Object.defineProperty(QuestionMatrixDropdownRenderedCell.prototype, "headers", {
|
50245
50297
|
get: function () {
|
50246
50298
|
if (this.cell && this.cell.column) {
|
50247
|
-
if (this.cell.column.cellHint === " ") {
|
50248
|
-
return "";
|
50249
|
-
}
|
50250
|
-
if (!!this.cell.column.cellHint) {
|
50251
|
-
return this.cell.column.locCellHint.renderedHtml;
|
50252
|
-
}
|
50253
50299
|
if (this.matrix.IsMultiplyColumn(this.cell.column)) {
|
50254
50300
|
if (!!this.item) {
|
50255
50301
|
return this.item.locText.renderedHtml;
|
@@ -50258,6 +50304,13 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
|
50258
50304
|
return "";
|
50259
50305
|
}
|
50260
50306
|
}
|
50307
|
+
var cellHint = this.cell.column.cellHint;
|
50308
|
+
if (!!cellHint) {
|
50309
|
+
if (cellHint.trim() === "")
|
50310
|
+
return "";
|
50311
|
+
return this.cell.column.locCellHint.renderedHtml;
|
50312
|
+
}
|
50313
|
+
return this.cell.column.title;
|
50261
50314
|
}
|
50262
50315
|
if (this.hasQuestion && this.question.isVisible) {
|
50263
50316
|
return this.question.locTitle.renderedHtml;
|
@@ -51315,6 +51368,23 @@ var MatrixDynamicRowModel = /** @class */ (function (_super) {
|
|
51315
51368
|
enumerable: false,
|
51316
51369
|
configurable: true
|
51317
51370
|
});
|
51371
|
+
Object.defineProperty(MatrixDynamicRowModel.prototype, "dataName", {
|
51372
|
+
get: function () {
|
51373
|
+
return "row" + (this.index + 1);
|
51374
|
+
},
|
51375
|
+
enumerable: false,
|
51376
|
+
configurable: true
|
51377
|
+
});
|
51378
|
+
Object.defineProperty(MatrixDynamicRowModel.prototype, "text", {
|
51379
|
+
get: function () {
|
51380
|
+
return "row " + (this.index + 1);
|
51381
|
+
},
|
51382
|
+
enumerable: false,
|
51383
|
+
configurable: true
|
51384
|
+
});
|
51385
|
+
MatrixDynamicRowModel.prototype.getAccessbilityText = function () {
|
51386
|
+
return (this.index + 1).toString();
|
51387
|
+
};
|
51318
51388
|
Object.defineProperty(MatrixDynamicRowModel.prototype, "shortcutText", {
|
51319
51389
|
get: function () {
|
51320
51390
|
var matrix = this.data;
|
@@ -58891,7 +58961,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
58891
58961
|
_this.updateRemainingCharacterCounter(event.target.value);
|
58892
58962
|
};
|
58893
58963
|
_this.onKeyDown = function (event) {
|
58894
|
-
_this.
|
58964
|
+
_this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
|
58895
58965
|
if (_this.isInputTextUpdate) {
|
58896
58966
|
_this._isWaitingForEnter = event.keyCode === 229;
|
58897
58967
|
}
|
@@ -59652,7 +59722,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
|
|
59652
59722
|
function QuestionTextBase(name) {
|
59653
59723
|
var _this = _super.call(this, name) || this;
|
59654
59724
|
_this.characterCounter = new CharacterCounter();
|
59655
|
-
_this.disableNativeUndoRedo = false;
|
59656
59725
|
return _this;
|
59657
59726
|
}
|
59658
59727
|
QuestionTextBase.prototype.isTextValue = function () {
|
@@ -59778,13 +59847,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
|
|
59778
59847
|
return val;
|
59779
59848
|
};
|
59780
59849
|
QuestionTextBase.prototype.getValueSeparator = function () { return ", "; };
|
59781
|
-
QuestionTextBase.prototype.checkForUndo = function (event) {
|
59782
|
-
if (this.disableNativeUndoRedo && this.isInputTextUpdate && (event.ctrlKey || event.metaKey)) {
|
59783
|
-
if ([89, 90].indexOf(event.keyCode) !== -1) {
|
59784
|
-
event.preventDefault();
|
59785
|
-
}
|
59786
|
-
}
|
59787
|
-
};
|
59788
59850
|
QuestionTextBase.prototype.getControlCssClassBuilder = function () {
|
59789
59851
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
|
59790
59852
|
.append(this.cssClasses.root)
|
@@ -66236,8 +66298,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
66236
66298
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
66237
66299
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
66238
66300
|
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
66239
|
-
/* harmony import */ var
|
66240
|
-
/* harmony import */ var
|
66301
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! survey-core */ "./src/entries/core.ts");
|
66302
|
+
/* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/react/reactquestion_factory.tsx");
|
66303
|
+
/* harmony import */ var _components_character_counter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/character-counter */ "./src/react/components/character-counter.tsx");
|
66241
66304
|
var __extends = (undefined && undefined.__extends) || (function () {
|
66242
66305
|
var extendStatics = function (d, b) {
|
66243
66306
|
extendStatics = Object.setPrototypeOf ||
|
@@ -66257,6 +66320,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
66257
66320
|
|
66258
66321
|
|
66259
66322
|
|
66323
|
+
|
66260
66324
|
var SurveyQuestionComment = /** @class */ (function (_super) {
|
66261
66325
|
__extends(SurveyQuestionComment, _super);
|
66262
66326
|
function SurveyQuestionComment(props) {
|
@@ -66279,7 +66343,7 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
|
|
66279
66343
|
if (this.question.isReadOnlyRenderDiv()) {
|
66280
66344
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.value);
|
66281
66345
|
}
|
66282
|
-
var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
66346
|
+
var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_4__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
|
66283
66347
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
|
66284
66348
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isInputReadOnly, readOnly: this.question.isInputReadOnly, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onBlur: onBlur, onInput: onInput, onKeyDown: function (event) { _this.question.onKeyDown(event); }, cols: this.question.cols, rows: this.question.rows, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy, style: { resize: this.question.resizeStyle } }),
|
66285
66349
|
counter));
|
@@ -66289,9 +66353,19 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
|
|
66289
66353
|
|
66290
66354
|
var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
66291
66355
|
__extends(SurveyQuestionCommentItem, _super);
|
66292
|
-
function SurveyQuestionCommentItem() {
|
66293
|
-
|
66356
|
+
function SurveyQuestionCommentItem(props) {
|
66357
|
+
var _this = _super.call(this, props) || this;
|
66358
|
+
_this.state = { comment: _this.getComment() || "" };
|
66359
|
+
return _this;
|
66294
66360
|
}
|
66361
|
+
SurveyQuestionCommentItem.prototype.getStateComment = function () {
|
66362
|
+
var comment = this.getComment();
|
66363
|
+
var stateComment = this.state.comment;
|
66364
|
+
if (stateComment !== undefined && stateComment.trim() !== comment) {
|
66365
|
+
stateComment = comment;
|
66366
|
+
}
|
66367
|
+
return stateComment !== undefined ? stateComment : comment || "";
|
66368
|
+
};
|
66295
66369
|
SurveyQuestionCommentItem.prototype.canRender = function () {
|
66296
66370
|
return !!this.props.question;
|
66297
66371
|
};
|
@@ -66301,12 +66375,12 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
66301
66375
|
SurveyQuestionCommentItem.prototype.onCommentInput = function (event) {
|
66302
66376
|
this.props.question.onCommentInput(event);
|
66303
66377
|
};
|
66304
|
-
SurveyQuestionCommentItem.prototype.onCommentCompositionUpdate = function (event) {
|
66305
|
-
this.props.question.onCompositionUpdateComment(event);
|
66306
|
-
};
|
66307
66378
|
SurveyQuestionCommentItem.prototype.getComment = function () {
|
66308
66379
|
return this.props.question.comment;
|
66309
66380
|
};
|
66381
|
+
SurveyQuestionCommentItem.prototype.setComment = function (value) {
|
66382
|
+
this.props.question.comment = value;
|
66383
|
+
};
|
66310
66384
|
SurveyQuestionCommentItem.prototype.getId = function () {
|
66311
66385
|
return this.props.question.commentId;
|
66312
66386
|
};
|
@@ -66319,18 +66393,16 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
66319
66393
|
var className = this.props.otherCss || this.cssClasses.comment;
|
66320
66394
|
var handleOnChange = function (event) {
|
66321
66395
|
_this.setState({ comment: event.target.value });
|
66322
|
-
|
66396
|
+
// https://github.com/surveyjs/survey-library/issues/7252
|
66397
|
+
if (!survey_core__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(_this.getComment(), event.target.value, false, true, false)) {
|
66398
|
+
_this.setComment(event.target.value);
|
66399
|
+
}
|
66323
66400
|
};
|
66324
|
-
var
|
66325
|
-
var stateComment = !!this.state ? this.state.comment : undefined;
|
66326
|
-
if (stateComment !== undefined && stateComment.trim() !== questionComment) {
|
66327
|
-
stateComment = questionComment;
|
66328
|
-
}
|
66329
|
-
var comment = stateComment !== undefined ? stateComment : questionComment || "";
|
66401
|
+
var comment = this.getStateComment();
|
66330
66402
|
if (question.isReadOnlyRenderDiv()) {
|
66331
66403
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
|
66332
66404
|
}
|
66333
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); },
|
66405
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
|
66334
66406
|
};
|
66335
66407
|
return SurveyQuestionCommentItem;
|
66336
66408
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
@@ -66346,12 +66418,12 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
|
|
66346
66418
|
SurveyQuestionOtherValueItem.prototype.onCommentInput = function (event) {
|
66347
66419
|
this.props.question.onOtherValueInput(event);
|
66348
66420
|
};
|
66349
|
-
SurveyQuestionOtherValueItem.prototype.onCommentCompositionUpdate = function (event) {
|
66350
|
-
this.props.question.onCompositionUpdateOtherValue(event);
|
66351
|
-
};
|
66352
66421
|
SurveyQuestionOtherValueItem.prototype.getComment = function () {
|
66353
66422
|
return this.props.question.otherValue;
|
66354
66423
|
};
|
66424
|
+
SurveyQuestionOtherValueItem.prototype.setComment = function (value) {
|
66425
|
+
this.props.question.otherValue = value;
|
66426
|
+
};
|
66355
66427
|
SurveyQuestionOtherValueItem.prototype.getId = function () {
|
66356
66428
|
return this.props.question.otherId;
|
66357
66429
|
};
|
@@ -66361,7 +66433,7 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
|
|
66361
66433
|
return SurveyQuestionOtherValueItem;
|
66362
66434
|
}(SurveyQuestionCommentItem));
|
66363
66435
|
|
66364
|
-
|
66436
|
+
_reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__["ReactQuestionFactory"].Instance.registerQuestion("comment", function (props) {
|
66365
66437
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionComment, props);
|
66366
66438
|
});
|
66367
66439
|
|
@@ -67407,7 +67479,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
67407
67479
|
else {
|
67408
67480
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
|
67409
67481
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
|
67410
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.
|
67482
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(row.locText.renderedHtml, column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
|
67411
67483
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
67412
67484
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
67413
67485
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
|
@@ -70441,6 +70513,27 @@ var settings = {
|
|
70441
70513
|
* Default value: `"none"`
|
70442
70514
|
*/
|
70443
70515
|
noneItemValue: "none",
|
70516
|
+
/**
|
70517
|
+
* An object whose properties specify the order of the special choice items (None, Other, Select All) in select-based questions.
|
70518
|
+
*
|
70519
|
+
* Default value: `{ selectAllItem: [-1], noneItem: [1], otherItem: [2] }`
|
70520
|
+
*
|
70521
|
+
* Use this object to reorder special choices. Each property accepts an array of integer numbers. Negative numbers place a special choice item above regular choice items, positive numbers place it below them. For instance, the code below specifies the following order of choices: None, Select All, regular choices, Other.
|
70522
|
+
*
|
70523
|
+
* ```js
|
70524
|
+
* import { settings } from "survey-core";
|
70525
|
+
*
|
70526
|
+
* settings.specialChoicesOrder.noneItem = [-2];
|
70527
|
+
* settings.specialChoicesOrder.selectAllItem = [-1];
|
70528
|
+
* settings.specialChoicesOrder.otherItem = [1];
|
70529
|
+
* ```
|
70530
|
+
*
|
70531
|
+
* If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:
|
70532
|
+
*
|
70533
|
+
* ```js
|
70534
|
+
* settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices
|
70535
|
+
* ```
|
70536
|
+
*/
|
70444
70537
|
specialChoicesOrder: {
|
70445
70538
|
selectAllItem: [-1],
|
70446
70539
|
noneItem: [1],
|
@@ -71368,9 +71461,7 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
71368
71461
|
* @see isExpanded
|
71369
71462
|
*/
|
71370
71463
|
get: function () {
|
71371
|
-
|
71372
|
-
return;
|
71373
|
-
return this.state === "collapsed";
|
71464
|
+
return this.state === "collapsed" && !this.isDesignMode;
|
71374
71465
|
},
|
71375
71466
|
enumerable: false,
|
71376
71467
|
configurable: true
|
@@ -76106,6 +76197,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76106
76197
|
this.notify(this.completedStateText, this.completedState, value === "error");
|
76107
76198
|
}
|
76108
76199
|
};
|
76200
|
+
/**
|
76201
|
+
* Displays a toast notification with a specified message.
|
76202
|
+
*
|
76203
|
+
* Depending on the `type` argument, a survey can display the following notification types:
|
76204
|
+
*
|
76205
|
+
* 
|
76206
|
+
* @param message A message to display.
|
76207
|
+
* @param type A notification type: `"info"` (default), `"success"`, or `"error"`.
|
76208
|
+
* @param showActions For internal use.
|
76209
|
+
*/
|
76109
76210
|
SurveyModel.prototype.notify = function (message, type, showActions) {
|
76110
76211
|
if (showActions === void 0) { showActions = false; }
|
76111
76212
|
this.notifier.showActions = showActions;
|
@@ -76926,14 +77027,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76926
77027
|
if (this.isShowingPreview)
|
76927
77028
|
return;
|
76928
77029
|
if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
|
76929
|
-
if (this.
|
76930
|
-
this.restoreOriginalPages(this.
|
77030
|
+
if (this.originalPages) {
|
77031
|
+
this.restoreOriginalPages(this.originalPages);
|
76931
77032
|
}
|
76932
|
-
this.
|
77033
|
+
this.originalPages = undefined;
|
76933
77034
|
}
|
76934
77035
|
else {
|
76935
77036
|
if (!oldValue || oldValue == "standard") {
|
76936
|
-
this.
|
77037
|
+
this.originalPages = this.pages.slice(0, this.pages.length);
|
76937
77038
|
}
|
76938
77039
|
this.setupPagesForPageModes(this.isSinglePage);
|
76939
77040
|
}
|
@@ -80490,7 +80591,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
80490
80591
|
className: "htmlconditionitem", isArray: true
|
80491
80592
|
},
|
80492
80593
|
{ name: "loadingHtml:html", serializationProperty: "locLoadingHtml" },
|
80493
|
-
{ name: "pages:surveypages", className: "page", isArray: true },
|
80594
|
+
{ name: "pages:surveypages", className: "page", isArray: true, onSerializeValue: function (obj) { return obj.originalPages || obj.pages; } },
|
80494
80595
|
{
|
80495
80596
|
name: "elements",
|
80496
80597
|
alternativeName: "questions",
|
@@ -82933,19 +83034,36 @@ var ResponsivityManager = /** @class */ (function () {
|
|
82933
83034
|
configurable: true
|
82934
83035
|
});
|
82935
83036
|
ResponsivityManager.prototype.process = function () {
|
82936
|
-
var
|
83037
|
+
var _this = this;
|
82937
83038
|
if (this.isContainerVisible && !this.model.isResponsivenessDisabled) {
|
82938
83039
|
if (!this.isInitialized) {
|
82939
83040
|
this.model.setActionsMode("large");
|
82940
|
-
|
82941
|
-
|
83041
|
+
var recalcItemSizes = function () {
|
83042
|
+
_this.calcItemsSizes();
|
83043
|
+
_this.isInitialized = true;
|
83044
|
+
};
|
83045
|
+
if (queueMicrotask) {
|
83046
|
+
queueMicrotask(recalcItemSizes);
|
83047
|
+
}
|
83048
|
+
else {
|
83049
|
+
recalcItemSizes();
|
83050
|
+
}
|
83051
|
+
}
|
83052
|
+
var processResponsiveness = function () {
|
83053
|
+
var _a;
|
83054
|
+
var dotsItemSize = _this.dotsItemSize;
|
83055
|
+
if (!_this.dotsItemSize) {
|
83056
|
+
var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
|
83057
|
+
dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;
|
83058
|
+
}
|
83059
|
+
_this.model.fit(_this.getAvailableSpace(), dotsItemSize);
|
83060
|
+
};
|
83061
|
+
if (queueMicrotask) {
|
83062
|
+
queueMicrotask(processResponsiveness);
|
82942
83063
|
}
|
82943
|
-
|
82944
|
-
|
82945
|
-
var dotsItemElement = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
|
82946
|
-
dotsItemSize = dotsItemElement && this.calcItemSize(dotsItemElement) || this.dotsSizeConst;
|
83064
|
+
else {
|
83065
|
+
processResponsiveness();
|
82947
83066
|
}
|
82948
|
-
this.model.fit(this.getAvailableSpace(), dotsItemSize);
|
82949
83067
|
}
|
82950
83068
|
};
|
82951
83069
|
ResponsivityManager.prototype.dispose = function () {
|
@@ -83367,6 +83485,9 @@ function findParentByClassNames(element, classNames) {
|
|
83367
83485
|
function sanitizeEditableContent(element) {
|
83368
83486
|
if (window.getSelection && document.createRange && element.childNodes.length > 0) {
|
83369
83487
|
var selection = document.getSelection();
|
83488
|
+
if (selection.rangeCount == 0) {
|
83489
|
+
return;
|
83490
|
+
}
|
83370
83491
|
var range = selection.getRangeAt(0);
|
83371
83492
|
range.setStart(range.endContainer, range.endOffset);
|
83372
83493
|
range.setEndAfter(element.lastChild);
|