survey-react 1.9.92 → 1.9.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.92
2
+ * surveyjs - Survey JavaScript library v1.9.93
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
  */
@@ -101,617 +101,575 @@ return /******/ (function(modules) { // webpackBootstrap
101
101
  /************************************************************************/
102
102
  /******/ ({
103
103
 
104
- /***/ "./node_modules/signature_pad/dist/signature_pad.mjs":
105
- /*!***********************************************************!*\
106
- !*** ./node_modules/signature_pad/dist/signature_pad.mjs ***!
107
- \***********************************************************/
104
+ /***/ "./node_modules/signature_pad/dist/signature_pad.js":
105
+ /*!**********************************************************!*\
106
+ !*** ./node_modules/signature_pad/dist/signature_pad.js ***!
107
+ \**********************************************************/
108
108
  /*! exports provided: default */
109
- /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
109
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
110
110
 
111
111
  "use strict";
112
112
  __webpack_require__.r(__webpack_exports__);
113
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SignaturePad; });
113
114
  /*!
114
- * Signature Pad v2.3.2
115
- * https://github.com/szimek/signature_pad
116
- *
117
- * Copyright 2017 Szymon Nowak
118
- * Released under the MIT license
119
- *
120
- * The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
121
- * http://corner.squareup.com/2012/07/smoother-signatures.html
122
- *
123
- * Implementation of interpolation using cubic Bézier curves is taken from:
124
- * http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
125
- *
126
- * Algorithm for approximated length of a Bézier curve is taken from:
127
- * http://www.lemoda.net/maths/bezier-length/index.html
128
- *
115
+ * Signature Pad v4.1.5 | https://github.com/szimek/signature_pad
116
+ * (c) 2023 Szymon Nowak | Released under the MIT license
129
117
  */
130
118
 
131
- function Point(x, y, time) {
132
- this.x = x;
133
- this.y = y;
134
- this.time = time || new Date().getTime();
119
+ class Point {
120
+ constructor(x, y, pressure, time) {
121
+ if (isNaN(x) || isNaN(y)) {
122
+ throw new Error(`Point is invalid: (${x}, ${y})`);
123
+ }
124
+ this.x = +x;
125
+ this.y = +y;
126
+ this.pressure = pressure || 0;
127
+ this.time = time || Date.now();
128
+ }
129
+ distanceTo(start) {
130
+ return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
131
+ }
132
+ equals(other) {
133
+ return (this.x === other.x &&
134
+ this.y === other.y &&
135
+ this.pressure === other.pressure &&
136
+ this.time === other.time);
137
+ }
138
+ velocityFrom(start) {
139
+ return this.time !== start.time
140
+ ? this.distanceTo(start) / (this.time - start.time)
141
+ : 0;
142
+ }
135
143
  }
136
144
 
137
- Point.prototype.velocityFrom = function (start) {
138
- return this.time !== start.time ? this.distanceTo(start) / (this.time - start.time) : 1;
139
- };
140
-
141
- Point.prototype.distanceTo = function (start) {
142
- return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
143
- };
144
-
145
- Point.prototype.equals = function (other) {
146
- return this.x === other.x && this.y === other.y && this.time === other.time;
147
- };
148
-
149
- function Bezier(startPoint, control1, control2, endPoint) {
150
- this.startPoint = startPoint;
151
- this.control1 = control1;
152
- this.control2 = control2;
153
- this.endPoint = endPoint;
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
+ static fromPoints(points, widths) {
155
+ const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
156
+ const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
157
+ return new Bezier(points[1], c2, c3, points[2], widths.start, widths.end);
158
+ }
159
+ static calculateControlPoints(s1, s2, s3) {
160
+ const dx1 = s1.x - s2.x;
161
+ const dy1 = s1.y - s2.y;
162
+ const dx2 = s2.x - s3.x;
163
+ const dy2 = s2.y - s3.y;
164
+ const m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };
165
+ const m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };
166
+ const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
167
+ const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
168
+ const dxm = m1.x - m2.x;
169
+ const dym = m1.y - m2.y;
170
+ const k = l2 / (l1 + l2);
171
+ const cm = { x: m2.x + dxm * k, y: m2.y + dym * k };
172
+ const tx = s2.x - cm.x;
173
+ const ty = s2.y - cm.y;
174
+ return {
175
+ c1: new Point(m1.x + tx, m1.y + ty),
176
+ c2: new Point(m2.x + tx, m2.y + ty),
177
+ };
178
+ }
179
+ length() {
180
+ const steps = 10;
181
+ let length = 0;
182
+ let px;
183
+ let py;
184
+ for (let i = 0; i <= steps; i += 1) {
185
+ const t = i / steps;
186
+ const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
187
+ const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
188
+ if (i > 0) {
189
+ const xdiff = cx - px;
190
+ const ydiff = cy - py;
191
+ length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
192
+ }
193
+ px = cx;
194
+ py = cy;
195
+ }
196
+ return length;
197
+ }
198
+ point(t, start, c1, c2, end) {
199
+ return (start * (1.0 - t) * (1.0 - t) * (1.0 - t))
200
+ + (3.0 * c1 * (1.0 - t) * (1.0 - t) * t)
201
+ + (3.0 * c2 * (1.0 - t) * t * t)
202
+ + (end * t * t * t);
203
+ }
154
204
  }
155
205
 
156
- // Returns approximated length.
157
- Bezier.prototype.length = function () {
158
- var steps = 10;
159
- var length = 0;
160
- var px = void 0;
161
- var py = void 0;
162
-
163
- for (var i = 0; i <= steps; i += 1) {
164
- var t = i / steps;
165
- var cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
166
- var cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
167
- if (i > 0) {
168
- var xdiff = cx - px;
169
- var ydiff = cy - py;
170
- length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
206
+ class SignatureEventTarget {
207
+ constructor() {
208
+ try {
209
+ this._et = new EventTarget();
210
+ }
211
+ catch (error) {
212
+ this._et = document;
213
+ }
171
214
  }
172
- px = cx;
173
- py = cy;
174
- }
175
-
176
- return length;
177
- };
178
-
179
- /* eslint-disable no-multi-spaces, space-in-parens */
180
- Bezier.prototype._point = function (t, start, c1, c2, end) {
181
- return start * (1.0 - t) * (1.0 - t) * (1.0 - t) + 3.0 * c1 * (1.0 - t) * (1.0 - t) * t + 3.0 * c2 * (1.0 - t) * t * t + end * t * t * t;
182
- };
183
-
184
- /* eslint-disable */
215
+ addEventListener(type, listener, options) {
216
+ this._et.addEventListener(type, listener, options);
217
+ }
218
+ dispatchEvent(event) {
219
+ return this._et.dispatchEvent(event);
220
+ }
221
+ removeEventListener(type, callback, options) {
222
+ this._et.removeEventListener(type, callback, options);
223
+ }
224
+ }
185
225
 
186
- // http://stackoverflow.com/a/27078401/815507
187
- function throttle(func, wait, options) {
188
- var context, args, result;
189
- var timeout = null;
190
- var previous = 0;
191
- if (!options) options = {};
192
- var later = function later() {
193
- previous = options.leading === false ? 0 : Date.now();
194
- timeout = null;
195
- result = func.apply(context, args);
196
- if (!timeout) context = args = null;
197
- };
198
- return function () {
199
- var now = Date.now();
200
- if (!previous && options.leading === false) previous = now;
201
- var remaining = wait - (now - previous);
202
- context = this;
203
- args = arguments;
204
- if (remaining <= 0 || remaining > wait) {
205
- if (timeout) {
206
- clearTimeout(timeout);
226
+ function throttle(fn, wait = 250) {
227
+ let previous = 0;
228
+ let timeout = null;
229
+ let result;
230
+ let storedContext;
231
+ let storedArgs;
232
+ const later = () => {
233
+ previous = Date.now();
207
234
  timeout = null;
208
- }
209
- previous = now;
210
- result = func.apply(context, args);
211
- if (!timeout) context = args = null;
212
- } else if (!timeout && options.trailing !== false) {
213
- timeout = setTimeout(later, remaining);
214
- }
215
- return result;
216
- };
235
+ result = fn.apply(storedContext, storedArgs);
236
+ if (!timeout) {
237
+ storedContext = null;
238
+ storedArgs = [];
239
+ }
240
+ };
241
+ return function wrapper(...args) {
242
+ const now = Date.now();
243
+ const remaining = wait - (now - previous);
244
+ storedContext = this;
245
+ storedArgs = args;
246
+ if (remaining <= 0 || remaining > wait) {
247
+ if (timeout) {
248
+ clearTimeout(timeout);
249
+ timeout = null;
250
+ }
251
+ previous = now;
252
+ result = fn.apply(storedContext, storedArgs);
253
+ if (!timeout) {
254
+ storedContext = null;
255
+ storedArgs = [];
256
+ }
257
+ }
258
+ else if (!timeout) {
259
+ timeout = window.setTimeout(later, remaining);
260
+ }
261
+ return result;
262
+ };
217
263
  }
218
264
 
219
- function SignaturePad(canvas, options) {
220
- var self = this;
221
- var opts = options || {};
222
-
223
- this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;
224
- this.minWidth = opts.minWidth || 0.5;
225
- this.maxWidth = opts.maxWidth || 2.5;
226
- this.throttle = 'throttle' in opts ? opts.throttle : 16; // in miliseconds
227
- this.minDistance = 'minDistance' in opts ? opts.minDistance : 5;
228
-
229
- if (this.throttle) {
230
- this._strokeMoveUpdate = throttle(SignaturePad.prototype._strokeUpdate, this.throttle);
231
- } else {
232
- this._strokeMoveUpdate = SignaturePad.prototype._strokeUpdate;
233
- }
234
-
235
- this.dotSize = opts.dotSize || function () {
236
- return (this.minWidth + this.maxWidth) / 2;
237
- };
238
- this.penColor = opts.penColor || 'black';
239
- this.backgroundColor = opts.backgroundColor || 'rgba(0,0,0,0)';
240
- this.onBegin = opts.onBegin;
241
- this.onEnd = opts.onEnd;
242
-
243
- this._canvas = canvas;
244
- this._ctx = canvas.getContext('2d');
245
- this.clear();
246
-
247
- // We need add these inline so they are available to unbind while still having
248
- // access to 'self' we could use _.bind but it's not worth adding a dependency.
249
- this._handleMouseDown = function (event) {
250
- if (event.which === 1) {
251
- self._mouseButtonDown = true;
252
- self._strokeBegin(event);
265
+ class SignaturePad extends SignatureEventTarget {
266
+ constructor(canvas, options = {}) {
267
+ super();
268
+ this.canvas = canvas;
269
+ this._drawningStroke = false;
270
+ this._isEmpty = true;
271
+ this._lastPoints = [];
272
+ this._data = [];
273
+ this._lastVelocity = 0;
274
+ this._lastWidth = 0;
275
+ this._handleMouseDown = (event) => {
276
+ if (event.buttons === 1) {
277
+ this._drawningStroke = true;
278
+ this._strokeBegin(event);
279
+ }
280
+ };
281
+ this._handleMouseMove = (event) => {
282
+ if (this._drawningStroke) {
283
+ this._strokeMoveUpdate(event);
284
+ }
285
+ };
286
+ this._handleMouseUp = (event) => {
287
+ if (event.buttons === 1 && this._drawningStroke) {
288
+ this._drawningStroke = false;
289
+ this._strokeEnd(event);
290
+ }
291
+ };
292
+ this._handleTouchStart = (event) => {
293
+ if (event.cancelable) {
294
+ event.preventDefault();
295
+ }
296
+ if (event.targetTouches.length === 1) {
297
+ const touch = event.changedTouches[0];
298
+ this._strokeBegin(touch);
299
+ }
300
+ };
301
+ this._handleTouchMove = (event) => {
302
+ if (event.cancelable) {
303
+ event.preventDefault();
304
+ }
305
+ const touch = event.targetTouches[0];
306
+ this._strokeMoveUpdate(touch);
307
+ };
308
+ this._handleTouchEnd = (event) => {
309
+ const wasCanvasTouched = event.target === this.canvas;
310
+ if (wasCanvasTouched) {
311
+ if (event.cancelable) {
312
+ event.preventDefault();
313
+ }
314
+ const touch = event.changedTouches[0];
315
+ this._strokeEnd(touch);
316
+ }
317
+ };
318
+ this._handlePointerStart = (event) => {
319
+ this._drawningStroke = true;
320
+ event.preventDefault();
321
+ this._strokeBegin(event);
322
+ };
323
+ this._handlePointerMove = (event) => {
324
+ if (this._drawningStroke) {
325
+ event.preventDefault();
326
+ this._strokeMoveUpdate(event);
327
+ }
328
+ };
329
+ this._handlePointerEnd = (event) => {
330
+ if (this._drawningStroke) {
331
+ event.preventDefault();
332
+ this._drawningStroke = false;
333
+ this._strokeEnd(event);
334
+ }
335
+ };
336
+ this.velocityFilterWeight = options.velocityFilterWeight || 0.7;
337
+ this.minWidth = options.minWidth || 0.5;
338
+ this.maxWidth = options.maxWidth || 2.5;
339
+ this.throttle = ('throttle' in options ? options.throttle : 16);
340
+ this.minDistance = ('minDistance' in options ? options.minDistance : 5);
341
+ this.dotSize = options.dotSize || 0;
342
+ this.penColor = options.penColor || 'black';
343
+ this.backgroundColor = options.backgroundColor || 'rgba(0,0,0,0)';
344
+ this._strokeMoveUpdate = this.throttle
345
+ ? throttle(SignaturePad.prototype._strokeUpdate, this.throttle)
346
+ : SignaturePad.prototype._strokeUpdate;
347
+ this._ctx = canvas.getContext('2d');
348
+ this.clear();
349
+ this.on();
253
350
  }
254
- };
255
-
256
- this._handleMouseMove = function (event) {
257
- if (self._mouseButtonDown) {
258
- self._strokeMoveUpdate(event);
351
+ clear() {
352
+ const { _ctx: ctx, canvas } = this;
353
+ ctx.fillStyle = this.backgroundColor;
354
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
355
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
356
+ this._data = [];
357
+ this._reset(this._getPointGroupOptions());
358
+ this._isEmpty = true;
259
359
  }
260
- };
261
-
262
- this._handleMouseUp = function (event) {
263
- if (event.which === 1 && self._mouseButtonDown) {
264
- self._mouseButtonDown = false;
265
- self._strokeEnd(event);
360
+ fromDataURL(dataUrl, options = {}) {
361
+ return new Promise((resolve, reject) => {
362
+ const image = new Image();
363
+ const ratio = options.ratio || window.devicePixelRatio || 1;
364
+ const width = options.width || this.canvas.width / ratio;
365
+ const height = options.height || this.canvas.height / ratio;
366
+ const xOffset = options.xOffset || 0;
367
+ const yOffset = options.yOffset || 0;
368
+ this._reset(this._getPointGroupOptions());
369
+ image.onload = () => {
370
+ this._ctx.drawImage(image, xOffset, yOffset, width, height);
371
+ resolve();
372
+ };
373
+ image.onerror = (error) => {
374
+ reject(error);
375
+ };
376
+ image.crossOrigin = 'anonymous';
377
+ image.src = dataUrl;
378
+ this._isEmpty = false;
379
+ });
266
380
  }
267
- };
268
-
269
- this._handleTouchStart = function (event) {
270
- if (event.targetTouches.length === 1) {
271
- var touch = event.changedTouches[0];
272
- self._strokeBegin(touch);
381
+ toDataURL(type = 'image/png', encoderOptions) {
382
+ switch (type) {
383
+ case 'image/svg+xml':
384
+ if (typeof encoderOptions !== 'object') {
385
+ encoderOptions = undefined;
386
+ }
387
+ return `data:image/svg+xml;base64,${btoa(this.toSVG(encoderOptions))}`;
388
+ default:
389
+ if (typeof encoderOptions !== 'number') {
390
+ encoderOptions = undefined;
391
+ }
392
+ return this.canvas.toDataURL(type, encoderOptions);
393
+ }
273
394
  }
274
- };
275
-
276
- this._handleTouchMove = function (event) {
277
- // Prevent scrolling.
278
- event.preventDefault();
279
-
280
- var touch = event.targetTouches[0];
281
- self._strokeMoveUpdate(touch);
282
- };
283
-
284
- this._handleTouchEnd = function (event) {
285
- var wasCanvasTouched = event.target === self._canvas;
286
- if (wasCanvasTouched) {
287
- event.preventDefault();
288
- self._strokeEnd(event);
395
+ on() {
396
+ this.canvas.style.touchAction = 'none';
397
+ this.canvas.style.msTouchAction = 'none';
398
+ this.canvas.style.userSelect = 'none';
399
+ const isIOS = /Macintosh/.test(navigator.userAgent) && 'ontouchstart' in document;
400
+ if (window.PointerEvent && !isIOS) {
401
+ this._handlePointerEvents();
402
+ }
403
+ else {
404
+ this._handleMouseEvents();
405
+ if ('ontouchstart' in window) {
406
+ this._handleTouchEvents();
407
+ }
408
+ }
289
409
  }
290
- };
291
-
292
- // Enable mouse and touch event handlers
293
- this.on();
294
- }
295
-
296
- // Public methods
297
- SignaturePad.prototype.clear = function () {
298
- var ctx = this._ctx;
299
- var canvas = this._canvas;
300
-
301
- ctx.fillStyle = this.backgroundColor;
302
- ctx.clearRect(0, 0, canvas.width, canvas.height);
303
- ctx.fillRect(0, 0, canvas.width, canvas.height);
304
-
305
- this._data = [];
306
- this._reset();
307
- this._isEmpty = true;
308
- };
309
-
310
- SignaturePad.prototype.fromDataURL = function (dataUrl) {
311
- var _this = this;
312
-
313
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
314
-
315
- var image = new Image();
316
- var ratio = options.ratio || window.devicePixelRatio || 1;
317
- var width = options.width || this._canvas.width / ratio;
318
- var height = options.height || this._canvas.height / ratio;
319
-
320
- this._reset();
321
- image.src = dataUrl;
322
- image.onload = function () {
323
- _this._ctx.drawImage(image, 0, 0, width, height);
324
- };
325
- this._isEmpty = false;
326
- };
327
-
328
- SignaturePad.prototype.toDataURL = function (type) {
329
- var _canvas;
330
-
331
- switch (type) {
332
- case 'image/svg+xml':
333
- return this._toSVG();
334
- default:
335
- for (var _len = arguments.length, options = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
336
- options[_key - 1] = arguments[_key];
337
- }
338
-
339
- return (_canvas = this._canvas).toDataURL.apply(_canvas, [type].concat(options));
340
- }
341
- };
342
-
343
- SignaturePad.prototype.on = function () {
344
- this._handleMouseEvents();
345
- this._handleTouchEvents();
346
- };
347
-
348
- SignaturePad.prototype.off = function () {
349
- this._canvas.removeEventListener('mousedown', this._handleMouseDown);
350
- this._canvas.removeEventListener('mousemove', this._handleMouseMove);
351
- document.removeEventListener('mouseup', this._handleMouseUp);
352
-
353
- this._canvas.removeEventListener('touchstart', this._handleTouchStart);
354
- this._canvas.removeEventListener('touchmove', this._handleTouchMove);
355
- this._canvas.removeEventListener('touchend', this._handleTouchEnd);
356
- };
357
-
358
- SignaturePad.prototype.isEmpty = function () {
359
- return this._isEmpty;
360
- };
361
-
362
- // Private methods
363
- SignaturePad.prototype._strokeBegin = function (event) {
364
- this._data.push([]);
365
- this._reset();
366
- this._strokeUpdate(event);
367
-
368
- if (typeof this.onBegin === 'function') {
369
- this.onBegin(event);
370
- }
371
- };
372
-
373
- SignaturePad.prototype._strokeUpdate = function (event) {
374
- var x = event.clientX;
375
- var y = event.clientY;
376
-
377
- var point = this._createPoint(x, y);
378
- var lastPointGroup = this._data[this._data.length - 1];
379
- var lastPoint = lastPointGroup && lastPointGroup[lastPointGroup.length - 1];
380
- var isLastPointTooClose = lastPoint && point.distanceTo(lastPoint) < this.minDistance;
381
-
382
- // Skip this point if it's too close to the previous one
383
- if (!(lastPoint && isLastPointTooClose)) {
384
- var _addPoint = this._addPoint(point),
385
- curve = _addPoint.curve,
386
- widths = _addPoint.widths;
387
-
388
- if (curve && widths) {
389
- this._drawCurve(curve, widths.start, widths.end);
410
+ off() {
411
+ this.canvas.style.touchAction = 'auto';
412
+ this.canvas.style.msTouchAction = 'auto';
413
+ this.canvas.style.userSelect = 'auto';
414
+ this.canvas.removeEventListener('pointerdown', this._handlePointerStart);
415
+ this.canvas.removeEventListener('pointermove', this._handlePointerMove);
416
+ this.canvas.ownerDocument.removeEventListener('pointerup', this._handlePointerEnd);
417
+ this.canvas.removeEventListener('mousedown', this._handleMouseDown);
418
+ this.canvas.removeEventListener('mousemove', this._handleMouseMove);
419
+ this.canvas.ownerDocument.removeEventListener('mouseup', this._handleMouseUp);
420
+ this.canvas.removeEventListener('touchstart', this._handleTouchStart);
421
+ this.canvas.removeEventListener('touchmove', this._handleTouchMove);
422
+ this.canvas.removeEventListener('touchend', this._handleTouchEnd);
390
423
  }
391
-
392
- this._data[this._data.length - 1].push({
393
- x: point.x,
394
- y: point.y,
395
- time: point.time,
396
- color: this.penColor
397
- });
398
- }
399
- };
400
-
401
- SignaturePad.prototype._strokeEnd = function (event) {
402
- var canDrawCurve = this.points.length > 2;
403
- var point = this.points[0]; // Point instance
404
-
405
- if (!canDrawCurve && point) {
406
- this._drawDot(point);
407
- }
408
-
409
- if (point) {
410
- var lastPointGroup = this._data[this._data.length - 1];
411
- var lastPoint = lastPointGroup[lastPointGroup.length - 1]; // plain object
412
-
413
- // When drawing a dot, there's only one point in a group, so without this check
414
- // such group would end up with exactly the same 2 points.
415
- if (!point.equals(lastPoint)) {
416
- lastPointGroup.push({
417
- x: point.x,
418
- y: point.y,
419
- time: point.time,
420
- color: this.penColor
421
- });
424
+ isEmpty() {
425
+ return this._isEmpty;
422
426
  }
423
- }
424
-
425
- if (typeof this.onEnd === 'function') {
426
- this.onEnd(event);
427
- }
428
- };
429
-
430
- SignaturePad.prototype._handleMouseEvents = function () {
431
- this._mouseButtonDown = false;
432
-
433
- this._canvas.addEventListener('mousedown', this._handleMouseDown);
434
- this._canvas.addEventListener('mousemove', this._handleMouseMove);
435
- document.addEventListener('mouseup', this._handleMouseUp);
436
- };
437
-
438
- SignaturePad.prototype._handleTouchEvents = function () {
439
- // Pass touch events to canvas element on mobile IE11 and Edge.
440
- this._canvas.style.msTouchAction = 'none';
441
- this._canvas.style.touchAction = 'none';
442
-
443
- this._canvas.addEventListener('touchstart', this._handleTouchStart);
444
- this._canvas.addEventListener('touchmove', this._handleTouchMove);
445
- this._canvas.addEventListener('touchend', this._handleTouchEnd);
446
- };
447
-
448
- SignaturePad.prototype._reset = function () {
449
- this.points = [];
450
- this._lastVelocity = 0;
451
- this._lastWidth = (this.minWidth + this.maxWidth) / 2;
452
- this._ctx.fillStyle = this.penColor;
453
- };
454
-
455
- SignaturePad.prototype._createPoint = function (x, y, time) {
456
- var rect = this._canvas.getBoundingClientRect();
457
-
458
- return new Point(x - rect.left, y - rect.top, time || new Date().getTime());
459
- };
460
-
461
- SignaturePad.prototype._addPoint = function (point) {
462
- var points = this.points;
463
- var tmp = void 0;
464
-
465
- points.push(point);
466
-
467
- if (points.length > 2) {
468
- // To reduce the initial lag make it work with 3 points
469
- // by copying the first point to the beginning.
470
- if (points.length === 3) points.unshift(points[0]);
471
-
472
- tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);
473
- var c2 = tmp.c2;
474
- tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);
475
- var c3 = tmp.c1;
476
- var curve = new Bezier(points[1], c2, c3, points[2]);
477
- var widths = this._calculateCurveWidths(curve);
478
-
479
- // Remove the first element from the list,
480
- // so that we always have no more than 4 points in points array.
481
- points.shift();
482
-
483
- return { curve: curve, widths: widths };
484
- }
485
-
486
- return {};
487
- };
488
-
489
- SignaturePad.prototype._calculateCurveControlPoints = function (s1, s2, s3) {
490
- var dx1 = s1.x - s2.x;
491
- var dy1 = s1.y - s2.y;
492
- var dx2 = s2.x - s3.x;
493
- var dy2 = s2.y - s3.y;
494
-
495
- var m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };
496
- var m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };
497
-
498
- var l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
499
- var l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
500
-
501
- var dxm = m1.x - m2.x;
502
- var dym = m1.y - m2.y;
503
-
504
- var k = l2 / (l1 + l2);
505
- var cm = { x: m2.x + dxm * k, y: m2.y + dym * k };
506
-
507
- var tx = s2.x - cm.x;
508
- var ty = s2.y - cm.y;
509
-
510
- return {
511
- c1: new Point(m1.x + tx, m1.y + ty),
512
- c2: new Point(m2.x + tx, m2.y + ty)
513
- };
514
- };
515
-
516
- SignaturePad.prototype._calculateCurveWidths = function (curve) {
517
- var startPoint = curve.startPoint;
518
- var endPoint = curve.endPoint;
519
- var widths = { start: null, end: null };
520
-
521
- var velocity = this.velocityFilterWeight * endPoint.velocityFrom(startPoint) + (1 - this.velocityFilterWeight) * this._lastVelocity;
522
-
523
- var newWidth = this._strokeWidth(velocity);
524
-
525
- widths.start = this._lastWidth;
526
- widths.end = newWidth;
527
-
528
- this._lastVelocity = velocity;
529
- this._lastWidth = newWidth;
530
-
531
- return widths;
532
- };
533
-
534
- SignaturePad.prototype._strokeWidth = function (velocity) {
535
- return Math.max(this.maxWidth / (velocity + 1), this.minWidth);
536
- };
537
-
538
- SignaturePad.prototype._drawPoint = function (x, y, size) {
539
- var ctx = this._ctx;
540
-
541
- ctx.moveTo(x, y);
542
- ctx.arc(x, y, size, 0, 2 * Math.PI, false);
543
- this._isEmpty = false;
544
- };
545
-
546
- SignaturePad.prototype._drawCurve = function (curve, startWidth, endWidth) {
547
- var ctx = this._ctx;
548
- var widthDelta = endWidth - startWidth;
549
- var drawSteps = Math.floor(curve.length());
550
-
551
- ctx.beginPath();
552
-
553
- for (var i = 0; i < drawSteps; i += 1) {
554
- // Calculate the Bezier (x, y) coordinate for this step.
555
- var t = i / drawSteps;
556
- var tt = t * t;
557
- var ttt = tt * t;
558
- var u = 1 - t;
559
- var uu = u * u;
560
- var uuu = uu * u;
561
-
562
- var x = uuu * curve.startPoint.x;
563
- x += 3 * uu * t * curve.control1.x;
564
- x += 3 * u * tt * curve.control2.x;
565
- x += ttt * curve.endPoint.x;
566
-
567
- var y = uuu * curve.startPoint.y;
568
- y += 3 * uu * t * curve.control1.y;
569
- y += 3 * u * tt * curve.control2.y;
570
- y += ttt * curve.endPoint.y;
571
-
572
- var width = startWidth + ttt * widthDelta;
573
- this._drawPoint(x, y, width);
574
- }
575
-
576
- ctx.closePath();
577
- ctx.fill();
578
- };
579
-
580
- SignaturePad.prototype._drawDot = function (point) {
581
- var ctx = this._ctx;
582
- var width = typeof this.dotSize === 'function' ? this.dotSize() : this.dotSize;
583
-
584
- ctx.beginPath();
585
- this._drawPoint(point.x, point.y, width);
586
- ctx.closePath();
587
- ctx.fill();
588
- };
589
-
590
- SignaturePad.prototype._fromData = function (pointGroups, drawCurve, drawDot) {
591
- for (var i = 0; i < pointGroups.length; i += 1) {
592
- var group = pointGroups[i];
593
-
594
- if (group.length > 1) {
595
- for (var j = 0; j < group.length; j += 1) {
596
- var rawPoint = group[j];
597
- var point = new Point(rawPoint.x, rawPoint.y, rawPoint.time);
598
- var color = rawPoint.color;
599
-
600
- if (j === 0) {
601
- // First point in a group. Nothing to draw yet.
602
-
603
- // All points in the group have the same color, so it's enough to set
604
- // penColor just at the beginning.
605
- this.penColor = color;
606
- this._reset();
607
-
608
- this._addPoint(point);
609
- } else if (j !== group.length - 1) {
610
- // Middle point in a group.
611
- var _addPoint2 = this._addPoint(point),
612
- curve = _addPoint2.curve,
613
- widths = _addPoint2.widths;
614
-
615
- if (curve && widths) {
616
- drawCurve(curve, widths, color);
617
- }
618
- } else {
619
- // Last point in a group. Do nothing.
620
- }
621
- }
622
- } else {
623
- this._reset();
624
- var _rawPoint = group[0];
625
- drawDot(_rawPoint);
427
+ fromData(pointGroups, { clear = true } = {}) {
428
+ if (clear) {
429
+ this.clear();
430
+ }
431
+ this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));
432
+ this._data = this._data.concat(pointGroups);
626
433
  }
627
- }
628
- };
629
-
630
- SignaturePad.prototype._toSVG = function () {
631
- var _this2 = this;
632
-
633
- var pointGroups = this._data;
634
- var canvas = this._canvas;
635
- var ratio = Math.max(window.devicePixelRatio || 1, 1);
636
- var minX = 0;
637
- var minY = 0;
638
- var maxX = canvas.width / ratio;
639
- var maxY = canvas.height / ratio;
640
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
641
-
642
- svg.setAttributeNS(null, 'width', canvas.width);
643
- svg.setAttributeNS(null, 'height', canvas.height);
644
-
645
- this._fromData(pointGroups, function (curve, widths, color) {
646
- var path = document.createElement('path');
647
-
648
- // Need to check curve for NaN values, these pop up when drawing
649
- // lines on the canvas that are not continuous. E.g. Sharp corners
650
- // or stopping mid-stroke and than continuing without lifting mouse.
651
- if (!isNaN(curve.control1.x) && !isNaN(curve.control1.y) && !isNaN(curve.control2.x) && !isNaN(curve.control2.y)) {
652
- var attr = 'M ' + curve.startPoint.x.toFixed(3) + ',' + curve.startPoint.y.toFixed(3) + ' ' + ('C ' + curve.control1.x.toFixed(3) + ',' + curve.control1.y.toFixed(3) + ' ') + (curve.control2.x.toFixed(3) + ',' + curve.control2.y.toFixed(3) + ' ') + (curve.endPoint.x.toFixed(3) + ',' + curve.endPoint.y.toFixed(3));
653
-
654
- path.setAttribute('d', attr);
655
- path.setAttribute('stroke-width', (widths.end * 2.25).toFixed(3));
656
- path.setAttribute('stroke', color);
657
- path.setAttribute('fill', 'none');
658
- path.setAttribute('stroke-linecap', 'round');
659
-
660
- svg.appendChild(path);
434
+ toData() {
435
+ return this._data;
661
436
  }
662
- }, function (rawPoint) {
663
- var circle = document.createElement('circle');
664
- var dotSize = typeof _this2.dotSize === 'function' ? _this2.dotSize() : _this2.dotSize;
665
- circle.setAttribute('r', dotSize);
666
- circle.setAttribute('cx', rawPoint.x);
667
- circle.setAttribute('cy', rawPoint.y);
668
- circle.setAttribute('fill', rawPoint.color);
669
-
670
- svg.appendChild(circle);
671
- });
672
-
673
- var prefix = 'data:image/svg+xml;base64,';
674
- var header = '<svg' + ' xmlns="http://www.w3.org/2000/svg"' + ' xmlns:xlink="http://www.w3.org/1999/xlink"' + (' viewBox="' + minX + ' ' + minY + ' ' + maxX + ' ' + maxY + '"') + (' width="' + maxX + '"') + (' height="' + maxY + '"') + '>';
675
- var body = svg.innerHTML;
676
-
677
- // IE hack for missing innerHTML property on SVGElement
678
- if (body === undefined) {
679
- var dummy = document.createElement('dummy');
680
- var nodes = svg.childNodes;
681
- dummy.innerHTML = '';
682
-
683
- for (var i = 0; i < nodes.length; i += 1) {
684
- dummy.appendChild(nodes[i].cloneNode(true));
437
+ _getPointGroupOptions(group) {
438
+ return {
439
+ penColor: group && 'penColor' in group ? group.penColor : this.penColor,
440
+ dotSize: group && 'dotSize' in group ? group.dotSize : this.dotSize,
441
+ minWidth: group && 'minWidth' in group ? group.minWidth : this.minWidth,
442
+ maxWidth: group && 'maxWidth' in group ? group.maxWidth : this.maxWidth,
443
+ velocityFilterWeight: group && 'velocityFilterWeight' in group
444
+ ? group.velocityFilterWeight
445
+ : this.velocityFilterWeight,
446
+ };
685
447
  }
448
+ _strokeBegin(event) {
449
+ this.dispatchEvent(new CustomEvent('beginStroke', { detail: event }));
450
+ const pointGroupOptions = this._getPointGroupOptions();
451
+ const newPointGroup = Object.assign(Object.assign({}, pointGroupOptions), { points: [] });
452
+ this._data.push(newPointGroup);
453
+ this._reset(pointGroupOptions);
454
+ this._strokeUpdate(event);
455
+ }
456
+ _strokeUpdate(event) {
457
+ if (this._data.length === 0) {
458
+ this._strokeBegin(event);
459
+ return;
460
+ }
461
+ this.dispatchEvent(new CustomEvent('beforeUpdateStroke', { detail: event }));
462
+ const x = event.clientX;
463
+ const y = event.clientY;
464
+ const pressure = event.pressure !== undefined
465
+ ? event.pressure
466
+ : event.force !== undefined
467
+ ? event.force
468
+ : 0;
469
+ const point = this._createPoint(x, y, pressure);
470
+ const lastPointGroup = this._data[this._data.length - 1];
471
+ const lastPoints = lastPointGroup.points;
472
+ const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];
473
+ const isLastPointTooClose = lastPoint
474
+ ? point.distanceTo(lastPoint) <= this.minDistance
475
+ : false;
476
+ const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);
477
+ if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
478
+ const curve = this._addPoint(point, pointGroupOptions);
479
+ if (!lastPoint) {
480
+ this._drawDot(point, pointGroupOptions);
481
+ }
482
+ else if (curve) {
483
+ this._drawCurve(curve, pointGroupOptions);
484
+ }
485
+ lastPoints.push({
486
+ time: point.time,
487
+ x: point.x,
488
+ y: point.y,
489
+ pressure: point.pressure,
490
+ });
491
+ }
492
+ this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));
493
+ }
494
+ _strokeEnd(event) {
495
+ this._strokeUpdate(event);
496
+ this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));
497
+ }
498
+ _handlePointerEvents() {
499
+ this._drawningStroke = false;
500
+ this.canvas.addEventListener('pointerdown', this._handlePointerStart);
501
+ this.canvas.addEventListener('pointermove', this._handlePointerMove);
502
+ this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);
503
+ }
504
+ _handleMouseEvents() {
505
+ this._drawningStroke = false;
506
+ this.canvas.addEventListener('mousedown', this._handleMouseDown);
507
+ this.canvas.addEventListener('mousemove', this._handleMouseMove);
508
+ this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);
509
+ }
510
+ _handleTouchEvents() {
511
+ this.canvas.addEventListener('touchstart', this._handleTouchStart);
512
+ this.canvas.addEventListener('touchmove', this._handleTouchMove);
513
+ this.canvas.addEventListener('touchend', this._handleTouchEnd);
514
+ }
515
+ _reset(options) {
516
+ this._lastPoints = [];
517
+ this._lastVelocity = 0;
518
+ this._lastWidth = (options.minWidth + options.maxWidth) / 2;
519
+ this._ctx.fillStyle = options.penColor;
520
+ }
521
+ _createPoint(x, y, pressure) {
522
+ const rect = this.canvas.getBoundingClientRect();
523
+ return new Point(x - rect.left, y - rect.top, pressure, new Date().getTime());
524
+ }
525
+ _addPoint(point, options) {
526
+ const { _lastPoints } = this;
527
+ _lastPoints.push(point);
528
+ if (_lastPoints.length > 2) {
529
+ if (_lastPoints.length === 3) {
530
+ _lastPoints.unshift(_lastPoints[0]);
531
+ }
532
+ const widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);
533
+ const curve = Bezier.fromPoints(_lastPoints, widths);
534
+ _lastPoints.shift();
535
+ return curve;
536
+ }
537
+ return null;
538
+ }
539
+ _calculateCurveWidths(startPoint, endPoint, options) {
540
+ const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) +
541
+ (1 - options.velocityFilterWeight) * this._lastVelocity;
542
+ const newWidth = this._strokeWidth(velocity, options);
543
+ const widths = {
544
+ end: newWidth,
545
+ start: this._lastWidth,
546
+ };
547
+ this._lastVelocity = velocity;
548
+ this._lastWidth = newWidth;
549
+ return widths;
550
+ }
551
+ _strokeWidth(velocity, options) {
552
+ return Math.max(options.maxWidth / (velocity + 1), options.minWidth);
553
+ }
554
+ _drawCurveSegment(x, y, width) {
555
+ const ctx = this._ctx;
556
+ ctx.moveTo(x, y);
557
+ ctx.arc(x, y, width, 0, 2 * Math.PI, false);
558
+ this._isEmpty = false;
559
+ }
560
+ _drawCurve(curve, options) {
561
+ const ctx = this._ctx;
562
+ const widthDelta = curve.endWidth - curve.startWidth;
563
+ const drawSteps = Math.ceil(curve.length()) * 2;
564
+ ctx.beginPath();
565
+ ctx.fillStyle = options.penColor;
566
+ for (let i = 0; i < drawSteps; i += 1) {
567
+ const t = i / drawSteps;
568
+ const tt = t * t;
569
+ const ttt = tt * t;
570
+ const u = 1 - t;
571
+ const uu = u * u;
572
+ const uuu = uu * u;
573
+ let x = uuu * curve.startPoint.x;
574
+ x += 3 * uu * t * curve.control1.x;
575
+ x += 3 * u * tt * curve.control2.x;
576
+ x += ttt * curve.endPoint.x;
577
+ let y = uuu * curve.startPoint.y;
578
+ y += 3 * uu * t * curve.control1.y;
579
+ y += 3 * u * tt * curve.control2.y;
580
+ y += ttt * curve.endPoint.y;
581
+ const width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);
582
+ this._drawCurveSegment(x, y, width);
583
+ }
584
+ ctx.closePath();
585
+ ctx.fill();
586
+ }
587
+ _drawDot(point, options) {
588
+ const ctx = this._ctx;
589
+ const width = options.dotSize > 0
590
+ ? options.dotSize
591
+ : (options.minWidth + options.maxWidth) / 2;
592
+ ctx.beginPath();
593
+ this._drawCurveSegment(point.x, point.y, width);
594
+ ctx.closePath();
595
+ ctx.fillStyle = options.penColor;
596
+ ctx.fill();
597
+ }
598
+ _fromData(pointGroups, drawCurve, drawDot) {
599
+ for (const group of pointGroups) {
600
+ const { points } = group;
601
+ const pointGroupOptions = this._getPointGroupOptions(group);
602
+ if (points.length > 1) {
603
+ for (let j = 0; j < points.length; j += 1) {
604
+ const basicPoint = points[j];
605
+ const point = new Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);
606
+ if (j === 0) {
607
+ this._reset(pointGroupOptions);
608
+ }
609
+ const curve = this._addPoint(point, pointGroupOptions);
610
+ if (curve) {
611
+ drawCurve(curve, pointGroupOptions);
612
+ }
613
+ }
614
+ }
615
+ else {
616
+ this._reset(pointGroupOptions);
617
+ drawDot(points[0], pointGroupOptions);
618
+ }
619
+ }
620
+ }
621
+ toSVG({ includeBackgroundColor = false } = {}) {
622
+ const pointGroups = this._data;
623
+ const ratio = Math.max(window.devicePixelRatio || 1, 1);
624
+ const minX = 0;
625
+ const minY = 0;
626
+ const maxX = this.canvas.width / ratio;
627
+ const maxY = this.canvas.height / ratio;
628
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
629
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
630
+ svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
631
+ svg.setAttribute('viewBox', `${minX} ${minY} ${maxX} ${maxY}`);
632
+ svg.setAttribute('width', maxX.toString());
633
+ svg.setAttribute('height', maxY.toString());
634
+ if (includeBackgroundColor && this.backgroundColor) {
635
+ const rect = document.createElement('rect');
636
+ rect.setAttribute('width', '100%');
637
+ rect.setAttribute('height', '100%');
638
+ rect.setAttribute('fill', this.backgroundColor);
639
+ svg.appendChild(rect);
640
+ }
641
+ this._fromData(pointGroups, (curve, { penColor }) => {
642
+ const path = document.createElement('path');
643
+ if (!isNaN(curve.control1.x) &&
644
+ !isNaN(curve.control1.y) &&
645
+ !isNaN(curve.control2.x) &&
646
+ !isNaN(curve.control2.y)) {
647
+ const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(3)} ` +
648
+ `C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ` +
649
+ `${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ` +
650
+ `${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;
651
+ path.setAttribute('d', attr);
652
+ path.setAttribute('stroke-width', (curve.endWidth * 2.25).toFixed(3));
653
+ path.setAttribute('stroke', penColor);
654
+ path.setAttribute('fill', 'none');
655
+ path.setAttribute('stroke-linecap', 'round');
656
+ svg.appendChild(path);
657
+ }
658
+ }, (point, { penColor, dotSize, minWidth, maxWidth }) => {
659
+ const circle = document.createElement('circle');
660
+ const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;
661
+ circle.setAttribute('r', size.toString());
662
+ circle.setAttribute('cx', point.x.toString());
663
+ circle.setAttribute('cy', point.y.toString());
664
+ circle.setAttribute('fill', penColor);
665
+ svg.appendChild(circle);
666
+ });
667
+ return svg.outerHTML;
668
+ }
669
+ }
686
670
 
687
- body = dummy.innerHTML;
688
- }
689
-
690
- var footer = '</svg>';
691
- var data = header + body + footer;
692
-
693
- return prefix + btoa(data);
694
- };
695
-
696
- SignaturePad.prototype.fromData = function (pointGroups) {
697
- var _this3 = this;
698
-
699
- this.clear();
700
-
701
- this._fromData(pointGroups, function (curve, widths) {
702
- return _this3._drawCurve(curve, widths.start, widths.end);
703
- }, function (rawPoint) {
704
- return _this3._drawDot(rawPoint);
705
- });
706
-
707
- this._data = pointGroups;
708
- };
709
-
710
- SignaturePad.prototype.toData = function () {
711
- return this._data;
712
- };
713
671
 
714
- /* harmony default export */ __webpack_exports__["default"] = (SignaturePad);
672
+ //# sourceMappingURL=signature_pad.js.map
715
673
 
716
674
 
717
675
  /***/ }),
@@ -1005,11 +963,15 @@ var Action = /** @class */ (function (_super) {
1005
963
  if (!!_this.locTitleName) {
1006
964
  _this.locTitleChanged();
1007
965
  }
966
+ _this.registerFunctionOnPropertyValueChanged("_title", function () {
967
+ _this.raiseUpdate(true);
968
+ });
1008
969
  _this.locStrChangedInPopupModel();
1009
970
  return _this;
1010
971
  }
1011
- Action.prototype.raiseUpdate = function () {
1012
- this.updateCallback && this.updateCallback();
972
+ Action.prototype.raiseUpdate = function (isResetInitialized) {
973
+ if (isResetInitialized === void 0) { isResetInitialized = false; }
974
+ this.updateCallback && this.updateCallback(isResetInitialized);
1013
975
  };
1014
976
  Action.prototype.createLocTitle = function () {
1015
977
  return this.createLocalizableString("title", this, true);
@@ -1225,7 +1187,7 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1225
1187
  }
1226
1188
  AdaptiveActionContainer.prototype.hideItemsGreaterN = function (visibleItemsCount) {
1227
1189
  var actionsToHide = this.visibleActions.filter(function (action) { return !action.disableHide; });
1228
- visibleItemsCount = Math.max(visibleItemsCount, this.minVisibleItemsCount) - (this.visibleActions.length - actionsToHide.length);
1190
+ visibleItemsCount = Math.max(visibleItemsCount, this.minVisibleItemsCount - (this.visibleActions.length - actionsToHide.length));
1229
1191
  var hiddenItems = [];
1230
1192
  actionsToHide.forEach(function (item) {
1231
1193
  if (visibleItemsCount <= 0) {
@@ -1237,7 +1199,8 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1237
1199
  this.hiddenItemsListModel.setItems(hiddenItems);
1238
1200
  };
1239
1201
  AdaptiveActionContainer.prototype.getVisibleItemsCount = function (availableSize) {
1240
- var itemsSizes = this.visibleActions.map(function (item) { return item.minDimension; });
1202
+ this.visibleActions.filter(function (action) { return action.disableHide; }).forEach(function (action) { return availableSize -= action.minDimension; });
1203
+ var itemsSizes = this.visibleActions.filter(function (action) { return !action.disableHide; }).map(function (item) { return item.minDimension; });
1241
1204
  var currSize = 0;
1242
1205
  for (var i = 0; i < itemsSizes.length; i++) {
1243
1206
  currSize += itemsSizes[i];
@@ -1282,12 +1245,12 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1282
1245
  };
1283
1246
  AdaptiveActionContainer.prototype.onSet = function () {
1284
1247
  var _this = this;
1285
- this.actions.forEach(function (action) { return action.updateCallback = function () { return _this.raiseUpdate(false); }; });
1248
+ this.actions.forEach(function (action) { return action.updateCallback = function (isResetInitialized) { return _this.raiseUpdate(isResetInitialized); }; });
1286
1249
  _super.prototype.onSet.call(this);
1287
1250
  };
1288
1251
  AdaptiveActionContainer.prototype.onPush = function (item) {
1289
1252
  var _this = this;
1290
- item.updateCallback = function () { return _this.raiseUpdate(false); };
1253
+ item.updateCallback = function (isResetInitialized) { return _this.raiseUpdate(isResetInitialized); };
1291
1254
  _super.prototype.onPush.call(this, item);
1292
1255
  };
1293
1256
  AdaptiveActionContainer.prototype.getRenderedActions = function () {
@@ -1557,6 +1520,9 @@ var ActionContainer = /** @class */ (function (_super) {
1557
1520
  }
1558
1521
  })
1559
1522
  ], ActionContainer.prototype, "actions", void 0);
1523
+ __decorate([
1524
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({})
1525
+ ], ActionContainer.prototype, "containerCss", void 0);
1560
1526
  __decorate([
1561
1527
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
1562
1528
  ], ActionContainer.prototype, "isEmpty", void 0);
@@ -2027,8 +1993,9 @@ var Base = /** @class */ (function () {
2027
1993
  * @param propName A property name.
2028
1994
  */
2029
1995
  Base.prototype.getPropertyByName = function (propName) {
2030
- if (!this.classMetaData) {
2031
- this.classMetaData = _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].findClass(this.getType());
1996
+ var type = this.getType();
1997
+ if (!this.classMetaData || this.classMetaData.name !== type) {
1998
+ this.classMetaData = _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].findClass(type);
2032
1999
  }
2033
2000
  return !!this.classMetaData ? this.classMetaData.findProperty(propName) : null;
2034
2001
  };
@@ -5201,7 +5168,18 @@ var defaultV2Css = {
5201
5168
  panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
5202
5169
  progressBtnIcon: "icon-progressbuttonv2",
5203
5170
  noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
5204
- compact: "sd-element--with-frame sd-element--compact"
5171
+ compact: "sd-element--with-frame sd-element--compact",
5172
+ tabsRoot: "sd-tabs-toolbar",
5173
+ tabsLeft: "sd-tabs-toolbar--left",
5174
+ tabsRight: "sd-tabs-toolbar--right",
5175
+ tabsCenter: "sd-tabs-toolbar--center",
5176
+ tabs: {
5177
+ item: "sd-tab-item",
5178
+ itemPressed: "sd-tab-item--pressed",
5179
+ itemAsIcon: "sd-tab-item--icon",
5180
+ itemIcon: "sd-tab-item__icon",
5181
+ itemTitle: "sd-tab-item__title"
5182
+ }
5205
5183
  },
5206
5184
  progress: "sd-progress sd-body__progress",
5207
5185
  progressTop: "sd-body__progress--top",
@@ -5722,12 +5700,13 @@ var defaultV2Css = {
5722
5700
  other: "sd-input sd-comment sd-selectbase__other",
5723
5701
  onError: "sd-input--error",
5724
5702
  label: "sd-selectbase__label",
5725
- item: "sd-item sd-radio sd-selectbase__item",
5726
- itemDisabled: "sd-item--disabled sd-radio--disabled",
5727
- itemChecked: "sd-item--checked sd-radio--checked",
5728
- itemHover: "sd-item--allowhover sd-radio--allowhover",
5729
- itemControl: "sd-visuallyhidden sd-item__control sd-radio__control",
5730
- itemDecorator: "sd-item__svg sd-radio__svg",
5703
+ itemSvgIconId: "#icon-v2check",
5704
+ item: "sd-item sd-checkbox sd-selectbase__item",
5705
+ itemDisabled: "sd-item--disabled sd-checkbox--disabled",
5706
+ itemChecked: "sd-item--checked sd-checkbox--checked",
5707
+ itemHover: "sd-item--allowhover sd-checkbox--allowhover",
5708
+ itemControl: "sd-visuallyhidden sd-item__control sd-checkbox__control",
5709
+ itemDecorator: "sd-item__svg sd-checkbox__svg",
5731
5710
  cleanButton: "sd-tagbox_clean-button sd-dropdown_clean-button",
5732
5711
  cleanButtonSvg: "sd-tagbox_clean-button-svg sd-dropdown_clean-button-svg",
5733
5712
  cleanButtonIconId: "icon-clear",
@@ -6899,6 +6878,10 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
6899
6878
  enumerable: false,
6900
6879
  configurable: true
6901
6880
  });
6881
+ DragDropMatrixRows.prototype.onStartDrag = function () {
6882
+ this.restoreUserSelectValue = document.body.style.userSelect;
6883
+ document.body.style.userSelect = "none";
6884
+ };
6902
6885
  DragDropMatrixRows.prototype.createDraggedElementShortcut = function (text, draggedElementNode, event) {
6903
6886
  var _this = this;
6904
6887
  var draggedElementShortcut = document.createElement("div");
@@ -7005,6 +6988,7 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
7005
6988
  this.parentElement.clearOnDrop();
7006
6989
  this.fromIndex = null;
7007
6990
  this.toIndex = null;
6991
+ document.body.style.userSelect = this.restoreUserSelectValue || "initial";
7008
6992
  _super.prototype.clear.call(this);
7009
6993
  };
7010
6994
  return DragDropMatrixRows;
@@ -7191,13 +7175,14 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7191
7175
  __webpack_require__.r(__webpack_exports__);
7192
7176
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownListModel", function() { return DropdownListModel; });
7193
7177
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./src/base.ts");
7194
- /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
7195
- /* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./list */ "./src/list.ts");
7196
- /* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./popup */ "./src/popup.ts");
7197
- /* harmony import */ var _question_dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question_dropdown */ "./src/question_dropdown.ts");
7198
- /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
7199
- /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
7200
- /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
7178
+ /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
7179
+ /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
7180
+ /* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./list */ "./src/list.ts");
7181
+ /* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./popup */ "./src/popup.ts");
7182
+ /* harmony import */ var _question_dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./question_dropdown */ "./src/question_dropdown.ts");
7183
+ /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
7184
+ /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
7185
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
7201
7186
  var __extends = (undefined && undefined.__extends) || (function () {
7202
7187
  var extendStatics = function (d, b) {
7203
7188
  extendStatics = Object.setPrototypeOf ||
@@ -7227,6 +7212,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
7227
7212
 
7228
7213
 
7229
7214
 
7215
+
7230
7216
  var DropdownListModel = /** @class */ (function (_super) {
7231
7217
  __extends(DropdownListModel, _super);
7232
7218
  function DropdownListModel(question, onSelectionChanged) {
@@ -7247,9 +7233,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7247
7233
  }
7248
7234
  };
7249
7235
  question.onPropertyChanged.add(function (sender, options) {
7250
- if (options.name == "value") {
7251
- _this.showInputFieldComponent = _this.question.showInputFieldComponent;
7252
- }
7236
+ _this.onPropertyChangedHandler(sender, options);
7253
7237
  });
7254
7238
  _this.showInputFieldComponent = _this.question.showInputFieldComponent;
7255
7239
  _this.listModel = _this.createListModel();
@@ -7267,7 +7251,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7267
7251
  configurable: true
7268
7252
  });
7269
7253
  DropdownListModel.prototype.getFocusFirstInputSelector = function () {
7270
- if (_utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"]) {
7254
+ if (_utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"]) {
7271
7255
  return this.isValueEmpty(this.question.value) ? this.itemSelector : this.selectedItemSelector;
7272
7256
  }
7273
7257
  else {
@@ -7315,12 +7299,12 @@ var DropdownListModel = /** @class */ (function (_super) {
7315
7299
  };
7316
7300
  DropdownListModel.prototype.createPopup = function () {
7317
7301
  var _this = this;
7318
- this._popupModel = new _popup__WEBPACK_IMPORTED_MODULE_3__["PopupModel"]("sv-list", { model: this.listModel }, "bottom", "center", false);
7319
- this._popupModel.displayMode = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"] ? "overlay" : "popup";
7302
+ this._popupModel = new _popup__WEBPACK_IMPORTED_MODULE_4__["PopupModel"]("sv-list", { model: this.listModel }, "bottom", "center", false);
7303
+ this._popupModel.displayMode = _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"] ? "overlay" : "popup";
7320
7304
  this._popupModel.positionMode = "fixed";
7321
7305
  this._popupModel.isFocusedContainer = false;
7322
- this._popupModel.isFocusedContent = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
7323
- this._popupModel.setWidthByTarget = !_utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
7306
+ this._popupModel.isFocusedContent = _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"];
7307
+ this._popupModel.setWidthByTarget = !_utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"];
7324
7308
  this.updatePopupFocusFirstInputSelector();
7325
7309
  this.listModel.registerPropertyChangedHandlers(["showFilter"], function () {
7326
7310
  _this.updatePopupFocusFirstInputSelector();
@@ -7387,7 +7371,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7387
7371
  _this._popupModel.toggleVisibility();
7388
7372
  };
7389
7373
  }
7390
- var res = new _list__WEBPACK_IMPORTED_MODULE_2__["ListModel"](visibleItems, _onSelectionChanged, false, undefined, this.question.choicesLazyLoadEnabled ? this.listModelFilterStringChanged : undefined, this.listElementId);
7374
+ var res = new _list__WEBPACK_IMPORTED_MODULE_3__["ListModel"](visibleItems, _onSelectionChanged, false, undefined, this.question.choicesLazyLoadEnabled ? this.listModelFilterStringChanged : undefined, this.listElementId);
7391
7375
  res.renderElements = false;
7392
7376
  res.forceShowFilter = true;
7393
7377
  res.areSameItemsCallback = function (item1, item2) {
@@ -7407,7 +7391,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7407
7391
  model.isAllDataLoaded = !this.question.choicesLazyLoadEnabled;
7408
7392
  };
7409
7393
  DropdownListModel.prototype.updateCssClasses = function (popupCssClass, listCssClasses) {
7410
- this.popupModel.cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(popupCssClass).append(this.popupCssClasses).toString();
7394
+ this.popupModel.cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]().append(popupCssClass).append(this.popupCssClasses).toString();
7411
7395
  this.listModel.cssClasses = listCssClasses;
7412
7396
  };
7413
7397
  DropdownListModel.prototype.resetFilterString = function () {
@@ -7478,7 +7462,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7478
7462
  set: function (val) {
7479
7463
  this.inputString = val;
7480
7464
  this.filterString = val;
7481
- this.applyHintString(this.listModel.focusedItem);
7465
+ this.applyHintString(this.listModel.focusedItem || this.question.selectedItem);
7482
7466
  },
7483
7467
  enumerable: false,
7484
7468
  configurable: true
@@ -7577,14 +7561,14 @@ var DropdownListModel = /** @class */ (function (_super) {
7577
7561
  });
7578
7562
  Object.defineProperty(DropdownListModel.prototype, "inputMode", {
7579
7563
  get: function () {
7580
- return _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"] ? "none" : "text";
7564
+ return _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"] ? "none" : "text";
7581
7565
  },
7582
7566
  enumerable: false,
7583
7567
  configurable: true
7584
7568
  });
7585
7569
  DropdownListModel.prototype.setSearchEnabled = function (newValue) {
7586
- this.listModel.searchEnabled = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
7587
- this.listModel.showSearchClearButton = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
7570
+ this.listModel.searchEnabled = _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"];
7571
+ this.listModel.showSearchClearButton = _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"];
7588
7572
  this.searchEnabled = newValue;
7589
7573
  };
7590
7574
  DropdownListModel.prototype.updateItems = function () {
@@ -7600,6 +7584,11 @@ var DropdownListModel = /** @class */ (function (_super) {
7600
7584
  }
7601
7585
  }
7602
7586
  };
7587
+ DropdownListModel.prototype.onPropertyChangedHandler = function (sender, options) {
7588
+ if (options.name == "value") {
7589
+ this.showInputFieldComponent = this.question.showInputFieldComponent;
7590
+ }
7591
+ };
7603
7592
  DropdownListModel.prototype.focusItemOnClickAndPopup = function () {
7604
7593
  if (this._popupModel.isVisible && this.question.value)
7605
7594
  this.changeSelectionWithKeyboard(false);
@@ -7618,11 +7607,18 @@ var DropdownListModel = /** @class */ (function (_super) {
7618
7607
  DropdownListModel.prototype.changeSelectionWithKeyboard = function (reverse) {
7619
7608
  var _a;
7620
7609
  var focusedItem = this.listModel.focusedItem;
7621
- if (reverse) {
7622
- this.listModel.focusPrevVisibleItem();
7610
+ if (!focusedItem && this.question.selectedItem) {
7611
+ if (_itemvalue__WEBPACK_IMPORTED_MODULE_1__["ItemValue"].getItemByValue(this.question.choices, this.question.value)) {
7612
+ this.listModel.focusedItem = this.question.selectedItem;
7613
+ }
7623
7614
  }
7624
7615
  else {
7625
- this.listModel.focusNextVisibleItem();
7616
+ if (reverse) {
7617
+ this.listModel.focusPrevVisibleItem();
7618
+ }
7619
+ else {
7620
+ this.listModel.focusNextVisibleItem();
7621
+ }
7626
7622
  }
7627
7623
  this.beforeScrollToFocusedItem(focusedItem);
7628
7624
  this.scrollToFocusedItem();
@@ -7669,7 +7665,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7669
7665
  event.stopPropagation();
7670
7666
  }
7671
7667
  else if (this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32 && (!this.question.searchEnabled || !this.inputString))) {
7672
- if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"] && !this._markdownMode && this.question.value) {
7668
+ if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_5__["QuestionDropdownModel"] && !this._markdownMode && this.question.value) {
7673
7669
  this._popupModel.isVisible = false;
7674
7670
  this.onClear(event);
7675
7671
  this.question.survey.questionEditFinishCallback(this.question, event);
@@ -7700,7 +7696,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7700
7696
  if (event.keyCode === 32 && this.question.searchEnabled) {
7701
7697
  return;
7702
7698
  }
7703
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_7__["doKey2ClickUp"])(event, { processEsc: false, disableTabStop: this.question.isInputReadOnly });
7699
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["doKey2ClickUp"])(event, { processEsc: false, disableTabStop: this.question.isInputReadOnly });
7704
7700
  }
7705
7701
  };
7706
7702
  DropdownListModel.prototype.onEscape = function () {
@@ -7714,24 +7710,25 @@ var DropdownListModel = /** @class */ (function (_super) {
7714
7710
  }
7715
7711
  };
7716
7712
  DropdownListModel.prototype.onBlur = function (event) {
7717
- if (this.popupModel.isVisible && _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"]) {
7713
+ this.focused = false;
7714
+ if (this.popupModel.isVisible && _utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsTouch"]) {
7718
7715
  this._popupModel.isVisible = true;
7719
7716
  return;
7720
7717
  }
7721
- if (this.popupModel.isVisible && !!this.filterString) {
7722
- this.listModel.selectFocusedItem();
7723
- }
7724
7718
  this.resetFilterString();
7725
7719
  this.inputString = null;
7726
7720
  this.hintString = "";
7727
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_7__["doKey2ClickBlur"])(event);
7721
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["doKey2ClickBlur"])(event);
7728
7722
  this._popupModel.isVisible = false;
7729
7723
  event.stopPropagation();
7730
7724
  };
7731
7725
  DropdownListModel.prototype.onFocus = function (event) {
7726
+ this.focused = true;
7732
7727
  this.setInputStringFromSelectedItem(this.question.selectedItem);
7733
7728
  };
7734
7729
  DropdownListModel.prototype.setInputStringFromSelectedItem = function (newValue) {
7730
+ if (!this.focused)
7731
+ return;
7735
7732
  if (this.question.searchEnabled && !!newValue) {
7736
7733
  this.applyInputString(newValue);
7737
7734
  }
@@ -7752,10 +7749,10 @@ var DropdownListModel = /** @class */ (function (_super) {
7752
7749
  this.listModel.scrollToFocusedItem();
7753
7750
  };
7754
7751
  __decorate([
7755
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
7752
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
7756
7753
  ], DropdownListModel.prototype, "searchEnabled", void 0);
7757
7754
  __decorate([
7758
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
7755
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
7759
7756
  defaultValue: "",
7760
7757
  onSet: function (_, target) {
7761
7758
  target.onSetFilterString();
@@ -7763,7 +7760,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7763
7760
  })
7764
7761
  ], DropdownListModel.prototype, "filterString", void 0);
7765
7762
  __decorate([
7766
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
7763
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
7767
7764
  defaultValue: "",
7768
7765
  onSet: function (newValue, target) {
7769
7766
  target.question.inputHasValue = !!newValue;
@@ -7771,13 +7768,13 @@ var DropdownListModel = /** @class */ (function (_super) {
7771
7768
  })
7772
7769
  ], DropdownListModel.prototype, "inputString", void 0);
7773
7770
  __decorate([
7774
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({})
7771
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({})
7775
7772
  ], DropdownListModel.prototype, "showInputFieldComponent", void 0);
7776
7773
  __decorate([
7777
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
7774
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
7778
7775
  ], DropdownListModel.prototype, "ariaActivedescendant", void 0);
7779
7776
  __decorate([
7780
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
7777
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
7781
7778
  defaultValue: false,
7782
7779
  onSet: function (newVal, target) {
7783
7780
  if (newVal) {
@@ -7790,7 +7787,7 @@ var DropdownListModel = /** @class */ (function (_super) {
7790
7787
  })
7791
7788
  ], DropdownListModel.prototype, "hasScroll", void 0);
7792
7789
  __decorate([
7793
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "" })
7790
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
7794
7791
  ], DropdownListModel.prototype, "hintString", void 0);
7795
7792
  return DropdownListModel;
7796
7793
  }(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
@@ -8012,6 +8009,12 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
8012
8009
  }
8013
8010
  this.syncFilterStringPlaceholder();
8014
8011
  };
8012
+ DropdownMultiSelectListModel.prototype.onPropertyChangedHandler = function (sender, options) {
8013
+ _super.prototype.onPropertyChangedHandler.call(this, sender, options);
8014
+ if (options.name === "value" || options.name === "renderedValue") {
8015
+ this.syncFilterStringPlaceholder();
8016
+ }
8017
+ };
8015
8018
  __decorate([
8016
8019
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
8017
8020
  ], DropdownMultiSelectListModel.prototype, "filterStringPlaceholder", void 0);
@@ -8782,7 +8785,7 @@ __webpack_require__.r(__webpack_exports__);
8782
8785
  // import "../../main.scss";
8783
8786
  //import "../../modern.scss";
8784
8787
  var Version;
8785
- Version = "" + "1.9.92";
8788
+ Version = "" + "1.9.93";
8786
8789
  function checkLibraryVersion(ver, libraryName) {
8787
8790
  if (Version != ver) {
8788
8791
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -17026,7 +17029,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["JsonObjectProperty"].getItemValuesDefa
17026
17029
  return res;
17027
17030
  };
17028
17031
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("itemvalue", [
17029
- "!value",
17032
+ { name: "!value", isUnique: true },
17030
17033
  {
17031
17034
  name: "text",
17032
17035
  serializationProperty: "locText",
@@ -19865,7 +19868,7 @@ var arabicSurveyStrings = {
19865
19868
  completingSurveyBefore: "تظهر سجلاتنا أنك قد أكملت هذا الاستطلاع بالفعل.",
19866
19869
  loadingSurvey: "...يتم تحميل النموذج",
19867
19870
  placeholder: "...اختر",
19868
- // ratingOptionsCaption: "Tap to rate here...",
19871
+ // ratingOptionsCaption: "Select...",
19869
19872
  value: "القيمة",
19870
19873
  requiredError: ".يرجى الإجابة على السؤال",
19871
19874
  requiredErrorInPanel: "الرجاء الإجابة على سؤال واحد على الأقل.",
@@ -19972,7 +19975,7 @@ var basqueSurveyStrings = {
19972
19975
  completingSurveyBefore: "Gure datuek diote dagoeneko galdetegia erantzun duzula.",
19973
19976
  loadingSurvey: "Galdetegia kargatzen...",
19974
19977
  placeholder: "Hautatu...",
19975
- // ratingOptionsCaption: "Tap to rate here...",
19978
+ // ratingOptionsCaption: "Select...",
19976
19979
  value: "balioa",
19977
19980
  requiredError: "Mesedez, galdera erantzun.",
19978
19981
  requiredErrorInPanel: "Mesedez, gutxienez galdera bat erantzun.",
@@ -20079,7 +20082,7 @@ var bulgarianStrings = {
20079
20082
  completingSurveyBefore: "Изглежда, че вие вече сте попълнили анкетата.",
20080
20083
  loadingSurvey: "Зареждане на анкетата...",
20081
20084
  placeholder: "Изберете...",
20082
- // ratingOptionsCaption: "Tap to rate here...",
20085
+ // ratingOptionsCaption: "Select...",
20083
20086
  value: "value",
20084
20087
  requiredError: "Моля, отговорете на следния въпрос.",
20085
20088
  requiredErrorInPanel: "Моля, отговорете поне на един от въпросите.",
@@ -20186,7 +20189,7 @@ var catalanSurveyStrings = {
20186
20189
  // completingSurveyBefore: "Our records show that you have already completed this survey.",
20187
20190
  loadingSurvey: "L'enquesta s'està carregant ...",
20188
20191
  placeholder: "Selecciona ...",
20189
- // ratingOptionsCaption: "Tap to rate here...",
20192
+ // ratingOptionsCaption: "Select...",
20190
20193
  // value: "value",
20191
20194
  requiredError: "Si us plau contesti la pregunta.",
20192
20195
  // requiredErrorInPanel: "Response required: answer at least one question.",
@@ -20293,7 +20296,7 @@ var croatianStrings = {
20293
20296
  completingSurveyBefore: "Naši zapisi pokazuju da ste već završili ovu anketu.",
20294
20297
  loadingSurvey: "Anketa o učitavanje...",
20295
20298
  placeholder: "Odaberite...",
20296
- // ratingOptionsCaption: "Tap to rate here...",
20299
+ // ratingOptionsCaption: "Select...",
20297
20300
  value: "vrijednost",
20298
20301
  requiredError: "Molim vas odgovorite na pitanje.",
20299
20302
  requiredErrorInPanel: "Molim vas odgovorite na barem jedno pitanje.",
@@ -20400,7 +20403,7 @@ var czechSurveyStrings = {
20400
20403
  completingSurveyBefore: "Naše záznamy ukazují, že jste tento průzkum již dokončil/a.",
20401
20404
  loadingSurvey: "Probíhá načítání průzkumu...",
20402
20405
  placeholder: "Vyberte...",
20403
- // ratingOptionsCaption: "Tap to rate here...",
20406
+ // ratingOptionsCaption: "Select...",
20404
20407
  value: "hodnota",
20405
20408
  requiredError: "Odpovězte prosím na otázku.",
20406
20409
  requiredErrorInPanel: "Odpovězte prosím alespoň jednu otázku.",
@@ -20507,7 +20510,7 @@ var danishSurveyStrings = {
20507
20510
  completingSurveyBefore: "Vores data viser at du allerede har gennemført dette spørgeskema.",
20508
20511
  loadingSurvey: "Spørgeskemaet hentes fra serveren...",
20509
20512
  placeholder: "Vælg...",
20510
- // ratingOptionsCaption: "Tap to rate here...",
20513
+ // ratingOptionsCaption: "Select...",
20511
20514
  value: "værdi",
20512
20515
  requiredError: "Besvar venligst spørgsmålet.",
20513
20516
  requiredErrorInPanel: "Besvar venligst mindst ét spørgsmål.",
@@ -20614,7 +20617,7 @@ var dutchSurveyStrings = {
20614
20617
  completingSurveyBefore: "Onze gegevens tonen aan dat je deze vragenlijst reeds beantwoord hebt.",
20615
20618
  loadingSurvey: "De vragenlijst is aan het laden...",
20616
20619
  placeholder: "Kies...",
20617
- // ratingOptionsCaption: "Tap to rate here...",
20620
+ // ratingOptionsCaption: "Select...",
20618
20621
  value: "waarde",
20619
20622
  requiredError: "Dit is een vereiste vraag",
20620
20623
  requiredErrorInPanel: "Gelieve ten minste een vraag te beantwoorden.",
@@ -20720,7 +20723,7 @@ var englishStrings = {
20720
20723
  completingSurveyBefore: "Our records show that you have already completed this survey.",
20721
20724
  loadingSurvey: "Loading Survey...",
20722
20725
  placeholder: "Select...",
20723
- ratingOptionsCaption: "Tap to rate here...",
20726
+ ratingOptionsCaption: "Select...",
20724
20727
  value: "value",
20725
20728
  requiredError: "Response required.",
20726
20729
  requiredErrorInPanel: "Response required: answer at least one question.",
@@ -20832,7 +20835,7 @@ var estonianSurveyStrings = {
20832
20835
  completingSurveyBefore: "Meie andmetel oled sa sellele ankeedile juba vastanud.",
20833
20836
  loadingSurvey: "Laen ankeeti...",
20834
20837
  placeholder: "Vali...",
20835
- // ratingOptionsCaption: "Tap to rate here...",
20838
+ // ratingOptionsCaption: "Select...",
20836
20839
  value: "väärtus",
20837
20840
  requiredError: "Palun vasta küsimusele.",
20838
20841
  requiredErrorInPanel: "Palun vasta vähemalt ühele küsimusele.",
@@ -21153,7 +21156,7 @@ var georgianSurveyStrings = {
21153
21156
  // completingSurveyBefore: "Our records show that you have already completed this survey.",
21154
21157
  loadingSurvey: "ჩატვირთვა სერვერიდან...",
21155
21158
  placeholder: "არჩევა...",
21156
- // ratingOptionsCaption: "Tap to rate here...",
21159
+ // ratingOptionsCaption: "Select...",
21157
21160
  // value: "value",
21158
21161
  requiredError: "გთხოვთ უპასუხეთ კითხვას.",
21159
21162
  // requiredErrorInPanel: "Response required: answer at least one question.",
@@ -21475,7 +21478,7 @@ var hebrewSurveyStrings = {
21475
21478
  completingSurveyBefore: "הרשומות שלנו מראות שכבר סיימת את הסקר הזה.",
21476
21479
  loadingSurvey: "טעינה מהשרת...",
21477
21480
  placeholder: "בחר...",
21478
- // ratingOptionsCaption: "Tap to rate here...",
21481
+ // ratingOptionsCaption: "Select...",
21479
21482
  value: "ערך",
21480
21483
  requiredError: "אנא השב על השאלה",
21481
21484
  requiredErrorInPanel: "אנא ענה לפחות על שאלה אחת.",
@@ -21582,7 +21585,7 @@ var hindiStrings = {
21582
21585
  completingSurveyBefore: " हमारे रिकॉर्ड बताते हैं कि आप पहले ही इस सर्वेक्षण को पूरा कर चुके हैं",
21583
21586
  loadingSurvey: "सर्वेक्षण खुल रहा है.…",
21584
21587
  placeholder: "चुनें",
21585
- // ratingOptionsCaption: "Tap to rate here...",
21588
+ // ratingOptionsCaption: "Select...",
21586
21589
  value: "मूल्य",
21587
21590
  requiredError: "कृपया प्रश्न का उत्तर दें",
21588
21591
  requiredErrorInPanel: "कृपया कम से कम एक प्रश्न का उत्तर दें",
@@ -21689,7 +21692,7 @@ var hungarianSurveyStrings = {
21689
21692
  completingSurveyBefore: "Már kitöltötte a felmérést.",
21690
21693
  loadingSurvey: "Felmérés betöltése...",
21691
21694
  placeholder: "Válasszon...",
21692
- // ratingOptionsCaption: "Tap to rate here...",
21695
+ // ratingOptionsCaption: "Select...",
21693
21696
  value: "érték",
21694
21697
  requiredError: "Kérjük, válaszolja meg ezt a kérdést!",
21695
21698
  requiredErrorInPanel: "Kérjük, válaszoljon legalább egy kérdésre.",
@@ -21796,7 +21799,7 @@ var icelandicSurveyStrings = {
21796
21799
  completingSurveyBefore: "Skrár okkar sýna að þú hefur þegar lokið þessari könnun.",
21797
21800
  loadingSurvey: "Könnunin er að hlaða...",
21798
21801
  placeholder: "Veldu...",
21799
- // ratingOptionsCaption: "Tap to rate here...",
21802
+ // ratingOptionsCaption: "Select...",
21800
21803
  value: "gildi",
21801
21804
  requiredError: "Vinsamlegast svarið spurningunni.",
21802
21805
  requiredErrorInPanel: "Vinsamlegast svaraðu að minnsta kosti einni spurningu.",
@@ -21903,7 +21906,7 @@ var indonesianStrings = {
21903
21906
  completingSurveyBefore: "Catatan kami menunjukkan bahwa Anda telah menyelesaikan survei ini.",
21904
21907
  loadingSurvey: "Memuat survei...",
21905
21908
  placeholder: "Pilih...",
21906
- // ratingOptionsCaption: "Tap to rate here...",
21909
+ // ratingOptionsCaption: "Select...",
21907
21910
  value: "nilai",
21908
21911
  requiredError: "Silahkan jawab pertanyaan berikut.",
21909
21912
  requiredErrorInPanel: "Silahkan jawab setidaknya satu petanyaan.",
@@ -22117,7 +22120,7 @@ var japaneseSurveyStrings = {
22117
22120
  completingSurveyBefore: "当社の記録によると、この調査はすでに完了しています。",
22118
22121
  loadingSurvey: "調査をダウンロード中",
22119
22122
  placeholder: "選択",
22120
- // ratingOptionsCaption: "Tap to rate here...",
22123
+ // ratingOptionsCaption: "Select...",
22121
22124
  value: "値打ち",
22122
22125
  requiredError: "質問にお答え下さい",
22123
22126
  requiredErrorInPanel: "最低でも1つの質問に答えてください。",
@@ -22224,7 +22227,7 @@ var kazakhStrings = {
22224
22227
  completingSurveyBefore: "Сіз бұл сауалнаманы өтіп қойдыңыз.",
22225
22228
  loadingSurvey: "Серверден жүктеу...",
22226
22229
  placeholder: "Таңдау...",
22227
- // ratingOptionsCaption: "Tap to rate here...",
22230
+ // ratingOptionsCaption: "Select...",
22228
22231
  value: "мәні",
22229
22232
  requiredError: "Өтінеміз, сұраққа жауап беріңіз.",
22230
22233
  requiredErrorInPanel: "Өтінеміз, кем дегенде бір сұраққа жауап беріңіз.",
@@ -22545,7 +22548,7 @@ var lithuaniaSurveyStrings = {
22545
22548
  completingSurveyBefore: "Mūsų įrašai rodo, kad jau atlikote šią apklausą.",
22546
22549
  loadingSurvey: "Prašome palaukti...",
22547
22550
  placeholder: "Pasirinkti...",
22548
- // ratingOptionsCaption: "Tap to rate here...",
22551
+ // ratingOptionsCaption: "Select...",
22549
22552
  value: "reikšmė",
22550
22553
  requiredError: "Būtina atsakyti į šį klausimą.",
22551
22554
  requiredErrorInPanel: "Būtina atsakyti bent į vieną klausimą.",
@@ -22652,7 +22655,7 @@ var macedonianSurveyStrings = {
22652
22655
  completingSurveyBefore: "Нашите записи покажуваат дека веќе сте го завршиле ова истражување.",
22653
22656
  loadingSurvey: "Анкетата се вчитува ...",
22654
22657
  placeholder: "Изберете ...",
22655
- // ratingOptionsCaption: "Tap to rate here...",
22658
+ // ratingOptionsCaption: "Select...",
22656
22659
  value: "вредност",
22657
22660
  requiredError: "Ве молам, одговорете на прашањето.",
22658
22661
  requiredErrorInPanel: "Ве молам, одговорете барем на едно прашање.",
@@ -22759,7 +22762,7 @@ var malaySurveyStrings = {
22759
22762
  completingSurveyBefore: "Rekod kami menunjukkan yang anda telah melengkapkan tinjauan ini.",
22760
22763
  loadingSurvey: "Memuatkan Tinjauan...",
22761
22764
  placeholder: "Pilih...",
22762
- // ratingOptionsCaption: "Tap to rate here...",
22765
+ // ratingOptionsCaption: "Select...",
22763
22766
  value: "nilai",
22764
22767
  requiredError: "Respons diperlukan.",
22765
22768
  requiredErrorInPanel: "Respons diperlukan: jawab sekurang-kurangnya satu soalan.",
@@ -22890,7 +22893,7 @@ var norwegianSurveyStrings = {
22890
22893
  completingSurveyBefore: "Våre data viser at du allerede har gjennomført denne undersøkelsen.",
22891
22894
  loadingSurvey: "Undersøkelsen laster...",
22892
22895
  placeholder: "Velg...",
22893
- // ratingOptionsCaption: "Tap to rate here...",
22896
+ // ratingOptionsCaption: "Select...",
22894
22897
  value: "verdi",
22895
22898
  requiredError: "Vennligst svar på spørsmålet.",
22896
22899
  requiredErrorInPanel: "Vennligst svar på minst ett spørsmål.",
@@ -22997,7 +23000,7 @@ var persianSurveyStrings = {
22997
23000
  completingSurveyBefore: "به نظر می رسد هم هم اکنون پرسشنامه را تکمیل کرده اید.",
22998
23001
  loadingSurvey: "درحال ایجاد پرسشنامه",
22999
23002
  placeholder: "انتخاب کنید...",
23000
- // ratingOptionsCaption: "Tap to rate here...",
23003
+ // ratingOptionsCaption: "Select...",
23001
23004
  value: "مقدار",
23002
23005
  requiredError: "لطفا به سوال پاسخ دهید",
23003
23006
  requiredErrorInPanel: "لطفا حداقل به یک سوال پاسخ دهید.",
@@ -23214,7 +23217,7 @@ var portugueseBrSurveyStrings = {
23214
23217
  completingSurveyBefore: "Nossos registros mostram que você já finalizou a pesquisa.",
23215
23218
  loadingSurvey: "A pesquisa está carregando...",
23216
23219
  // placeholder: "Select...",
23217
- // ratingOptionsCaption: "Tap to rate here...",
23220
+ // ratingOptionsCaption: "Select...",
23218
23221
  // value: "value",
23219
23222
  requiredError: "Por favor, responda a pergunta.",
23220
23223
  requiredErrorInPanel: "Por favor, responda pelo menos uma pergunta.",
@@ -23429,7 +23432,7 @@ var romanianSurveyStrings = {
23429
23432
  completingSurveyBefore: "Din înregistrările noastre reiese că ați completat deja acest chestionar.",
23430
23433
  loadingSurvey: "Chestionarul se încarcă...",
23431
23434
  placeholder: "Alegeţi...",
23432
- // ratingOptionsCaption: "Tap to rate here...",
23435
+ // ratingOptionsCaption: "Select...",
23433
23436
  value: "valoare",
23434
23437
  requiredError: "Răspunsul la această întrebare este obligatoriu.",
23435
23438
  requiredErrorInPanel: "Vă rugăm să răspundeți la cel puțin o întrebare.",
@@ -23643,7 +23646,7 @@ var serbianStrings = {
23643
23646
  completingSurveyBefore: "Prema našim podacima, već ste popunili ovu anketu.",
23644
23647
  loadingSurvey: "Učitavam anketu...",
23645
23648
  placeholder: "Izaberi...",
23646
- // ratingOptionsCaption: "Tap to rate here...",
23649
+ // ratingOptionsCaption: "Select...",
23647
23650
  value: "vrednost",
23648
23651
  requiredError: "Molimo odgovorite na ovo pitanje.",
23649
23652
  requiredErrorInPanel: "Molimo odgovorite na bar jedno pitanje.",
@@ -23751,7 +23754,7 @@ var simplifiedChineseSurveyStrings = {
23751
23754
  completingSurveyBefore: "你已完成问卷.",
23752
23755
  loadingSurvey: "问卷正在加载中...",
23753
23756
  placeholder: "请选择...",
23754
- // ratingOptionsCaption: "Tap to rate here...",
23757
+ // ratingOptionsCaption: "Select...",
23755
23758
  value: "值",
23756
23759
  requiredError: "请填写此问题",
23757
23760
  requiredErrorInPanel: "至少回答一题.",
@@ -23858,7 +23861,7 @@ var slovakSurveyStrings = {
23858
23861
  completingSurveyBefore: "Podľa našich záznamov ste už tento prieskum dokončili.",
23859
23862
  loadingSurvey: "Načítanie prieskumu...",
23860
23863
  placeholder: "Vybrať...",
23861
- // ratingOptionsCaption: "Tap to rate here...",
23864
+ // ratingOptionsCaption: "Select...",
23862
23865
  value: "hodnota",
23863
23866
  requiredError: "Požaduje sa odozva.",
23864
23867
  requiredErrorInPanel: "Požaduje sa odozva: zodpovedajte aspoň jednu otázku.",
@@ -24072,7 +24075,7 @@ var swahiliStrings = {
24072
24075
  completingSurveyBefore: "Recodi zetu zinatuonyesha tayari umekamilisha utafiti.",
24073
24076
  loadingSurvey: "Tunaandaa utafiti...",
24074
24077
  placeholder: "Chagua...",
24075
- // ratingOptionsCaption: "Tap to rate here...",
24078
+ // ratingOptionsCaption: "Select...",
24076
24079
  value: "thamani",
24077
24080
  requiredError: "Tafadhali jibu hili swali.",
24078
24081
  requiredErrorInPanel: "Tafadhali jibu swali angalau moja.",
@@ -24286,7 +24289,7 @@ var tajikSurveyStrings = {
24286
24289
  completingSurveyBefore: "Шумо аллакай ин пурсишро анҷом додаед.",
24287
24290
  loadingSurvey: "Боргирӣ аз сервер...",
24288
24291
  placeholder: "Интихоб кардан...",
24289
- // ratingOptionsCaption: "Tap to rate here...",
24292
+ // ratingOptionsCaption: "Select...",
24290
24293
  value: "қиммат",
24291
24294
  requiredError: "Илтимос, ба савол ҷавоб диҳед.",
24292
24295
  requiredErrorInPanel: "Илтимос, ақалан ба як савол ҷавоб диҳед.",
@@ -24393,7 +24396,7 @@ var teluguStrings = {
24393
24396
  completingSurveyBefore: " మీరు ఇప్పటికే సర్వేను ముగించినట్లు మా రికార్డులు చూపిస్తున్నాయి",
24394
24397
  loadingSurvey: "సర్వే లోడ్ అవుతుంది",
24395
24398
  placeholder: "ఎన్నుకోండి",
24396
- // ratingOptionsCaption: "Tap to rate here...",
24399
+ // ratingOptionsCaption: "Select...",
24397
24400
  value: "విలువ",
24398
24401
  requiredError: "దయచేసి ప్రశ్నకు జవాబు ఇవ్వండి",
24399
24402
  requiredErrorInPanel: "దయచేసి కనీసం ఒక్క ప్రశ్నకైనా జవాబు ఇవ్వండి",
@@ -24500,7 +24503,7 @@ var thaiStrings = {
24500
24503
  completingSurveyBefore: "รายการของเราแสดงว่าคุณได้ทำ survey เสร็จเรียบร้อยแล้ว",
24501
24504
  loadingSurvey: "กำลังโหลด Survey...",
24502
24505
  placeholder: "เลือก...",
24503
- // ratingOptionsCaption: "Tap to rate here...",
24506
+ // ratingOptionsCaption: "Select...",
24504
24507
  value: "ข้อมูล",
24505
24508
  requiredError: "กรุณาตอบคำถาม",
24506
24509
  requiredErrorInPanel: "กรุณาตอบขั้นต่ำหนึ่งคำถาม",
@@ -24607,7 +24610,7 @@ var traditionalChineseSurveyStrings = {
24607
24610
  // completingSurveyBefore: "Our records show that you have already completed this survey.",
24608
24611
  loadingSurvey: "問卷載入中...",
24609
24612
  placeholder: "請選擇...",
24610
- // ratingOptionsCaption: "Tap to rate here...",
24613
+ // ratingOptionsCaption: "Select...",
24611
24614
  // value: "value",
24612
24615
  requiredError: "請填寫此問題",
24613
24616
  // requiredErrorInPanel: "Response required: answer at least one question.",
@@ -24714,7 +24717,7 @@ var turkishSurveyStrings = {
24714
24717
  completingSurveyBefore: "Kayıtlarımız, bu anketi zaten tamamladığınızı gösteriyor.",
24715
24718
  loadingSurvey: "Anket sunucudan yükleniyor ...",
24716
24719
  placeholder: "Seçiniz ...",
24717
- // ratingOptionsCaption: "Tap to rate here...",
24720
+ // ratingOptionsCaption: "Select...",
24718
24721
  value: "değer",
24719
24722
  requiredError: "Lütfen soruya cevap veriniz",
24720
24723
  requiredErrorInPanel: "Lütfen en az bir soruyu yanıtlayın.",
@@ -24821,7 +24824,7 @@ var ukrainianSurveyStrings = {
24821
24824
  completingSurveyBefore: "Ви вже проходили це опитування.",
24822
24825
  loadingSurvey: "Завантаження опитування...",
24823
24826
  placeholder: "Вибрати...",
24824
- // ratingOptionsCaption: "Tap to rate here...",
24827
+ // ratingOptionsCaption: "Select...",
24825
24828
  value: "значення",
24826
24829
  requiredError: "Будь ласка, дайте відповідь.",
24827
24830
  requiredErrorInPanel: "Будь ласка, дайте відповідь хоча б на одне питання.",
@@ -24928,7 +24931,7 @@ var vietnameseSurveyStrings = {
24928
24931
  completingSurveyBefore: "Hồ sơ chúng tôi cho thấy rằng bạn đã hoàn thành cuộc khảo sát này.",
24929
24932
  loadingSurvey: "Đang tải khảo sát...",
24930
24933
  placeholder: "Chọn...",
24931
- // ratingOptionsCaption: "Tap to rate here...",
24934
+ // ratingOptionsCaption: "Select...",
24932
24935
  value: "Giá trị",
24933
24936
  requiredError: "Vui lòng trả lời câu hỏi.",
24934
24937
  requiredErrorInPanel: "Vui lòng trả lời ít nhất một câu hỏi.",
@@ -25036,7 +25039,7 @@ var welshSurveyStrings = {
25036
25039
  completingSurveyBefore: "Rydych chi wedi llenwi’r arolwg hwn yn barod yn ôl ein cofnodion.",
25037
25040
  loadingSurvey: "Wrthi’n Llwytho’r Arolwg...",
25038
25041
  placeholder: "Dewiswch...",
25039
- // ratingOptionsCaption: "Tap to rate here...",
25042
+ // ratingOptionsCaption: "Select...",
25040
25043
  value: "gwerth",
25041
25044
  requiredError: "Atebwch y cwestiwn.",
25042
25045
  requiredErrorInPanel: "Atebwch o leiaf un cwestiwn.",
@@ -27444,13 +27447,13 @@ var PanelModelBase = /** @class */ (function (_super) {
27444
27447
  if (this.isRandomizing)
27445
27448
  return;
27446
27449
  this.setPropertyValue("isVisible", this.isVisible);
27447
- if (!!this.survey &&
27448
- this.survey.isClearValueOnHiddenContainer &&
27450
+ if (!!this.survey && this.survey.getQuestionClearIfInvisible("default") !== "none" &&
27449
27451
  !this.isLoadingFromJson) {
27450
27452
  var questions = this.questions;
27453
+ var isVisible = this.isVisible;
27451
27454
  for (var i = 0; i < questions.length; i++) {
27452
- if (!this.isVisible) {
27453
- questions[i].clearValueIfInvisible();
27455
+ if (!isVisible) {
27456
+ questions[i].clearValueIfInvisible("onHiddenContainer");
27454
27457
  }
27455
27458
  else {
27456
27459
  questions[i].updateValueWithDefaults();
@@ -30648,11 +30651,11 @@ var PopupModel = /** @class */ (function (_super) {
30648
30651
  }
30649
30652
  this.setPropertyValue("isVisible", value);
30650
30653
  this.onVisibilityChanged.fire(this, { model: this, isVisible: value });
30651
- this.refreshInnerModel();
30652
30654
  if (this.isVisible) {
30653
30655
  this.onShow();
30654
30656
  }
30655
30657
  else {
30658
+ this.refreshInnerModel();
30656
30659
  this.onHide();
30657
30660
  }
30658
30661
  },
@@ -31119,7 +31122,7 @@ var Question = /** @class */ (function (_super) {
31119
31122
  /**
31120
31123
  * Hides the question number from the title and excludes the question from numbering.
31121
31124
  *
31122
- * If you want to disable question numbering in the entire survey, set SurveyModel's `showQuestionNumbers` property to `false`.
31125
+ * If you want to disable question numbering in the entire survey, set `SurveyModel`'s `showQuestionNumbers` property to `false`.
31123
31126
  * @see SurveyModel.showQuestionNumbers
31124
31127
  */
31125
31128
  get: function () {
@@ -31281,13 +31284,17 @@ var Question = /** @class */ (function (_super) {
31281
31284
  if (!this.survey || this.isLoadingFromJson)
31282
31285
  return;
31283
31286
  this.survey.questionVisibilityChanged(this, this.isVisible);
31284
- if (this.isClearValueOnHidden) {
31285
- if (!this.visible) {
31286
- this.clearValueIfInvisible();
31287
- }
31288
- if (this.isVisible) {
31289
- this.updateValueWithDefaults();
31290
- }
31287
+ var isClearOnHidden = this.isClearValueOnHidden;
31288
+ if (!this.visible) {
31289
+ this.clearValueOnHidding(isClearOnHidden);
31290
+ }
31291
+ if (isClearOnHidden && this.isVisible) {
31292
+ this.updateValueWithDefaults();
31293
+ }
31294
+ };
31295
+ Question.prototype.clearValueOnHidding = function (isClearOnHidden) {
31296
+ if (isClearOnHidden) {
31297
+ this.clearValueIfInvisible();
31291
31298
  }
31292
31299
  };
31293
31300
  /**
@@ -32331,7 +32338,9 @@ var Question = /** @class */ (function (_super) {
32331
32338
  return val.length > 0 ? this.isValueSurveyElement(val[0]) : false;
32332
32339
  return !!val.getType && !!val.onPropertyChanged;
32333
32340
  };
32334
- Question.prototype.canClearValueAsInvisible = function () {
32341
+ Question.prototype.canClearValueAsInvisible = function (reason) {
32342
+ if (reason === "onHiddenContainer" && !this.isParentVisible)
32343
+ return true;
32335
32344
  if (this.isVisible && this.isParentVisible)
32336
32345
  return false;
32337
32346
  if (!!this.page && this.page.isStartPage)
@@ -32345,6 +32354,8 @@ var Question = /** @class */ (function (_super) {
32345
32354
  * Returns `true` if a parent element (page or panel) is visible.
32346
32355
  */
32347
32356
  get: function () {
32357
+ if (this.parentQuestion && !this.parentQuestion.isVisible)
32358
+ return false;
32348
32359
  var parent = this.parent;
32349
32360
  while (parent) {
32350
32361
  if (!parent.isVisible)
@@ -32358,16 +32369,17 @@ var Question = /** @class */ (function (_super) {
32358
32369
  });
32359
32370
  Question.prototype.clearValueIfInvisible = function (reason) {
32360
32371
  if (reason === void 0) { reason = "onHidden"; }
32361
- if (this.clearIfInvisible === "none")
32372
+ var clearIf = this.getClearIfInvisible();
32373
+ if (clearIf === "none")
32362
32374
  return;
32363
- if (reason === "onHidden" && this.clearIfInvisible === "onComplete")
32375
+ if (reason === "onHidden" && clearIf === "onComplete")
32364
32376
  return;
32365
- if (reason === "none" && (this.clearIfInvisible === "default" || this.clearIfInvisible === "none"))
32377
+ if (reason === "onHiddenContainer" && clearIf !== reason)
32366
32378
  return;
32367
- this.clearValueIfInvisibleCore();
32379
+ this.clearValueIfInvisibleCore(reason);
32368
32380
  };
32369
- Question.prototype.clearValueIfInvisibleCore = function () {
32370
- if (this.canClearValueAsInvisible()) {
32381
+ Question.prototype.clearValueIfInvisibleCore = function (reason) {
32382
+ if (this.canClearValueAsInvisible(reason)) {
32371
32383
  this.clearValue();
32372
32384
  }
32373
32385
  };
@@ -32379,6 +32391,7 @@ var Question = /** @class */ (function (_super) {
32379
32391
  *
32380
32392
  * - `"default"` (default) - Inherits the setting from the Survey's [`clearInvisibleValues`](https://surveyjs.io/form-library/documentation/surveymodel#clearInvisibleValues) property.
32381
32393
  * - `"onHidden"` - Clears the value when the question becomes invisible. If a question is invisible on startup and has an initial value, this value will be cleared when the survey is complete.
32394
+ * - `"onHiddenContainer"` - Clears the value when the question or its containter (page or panel) becomes invisible. If the question is invisible initially, its value is removed on survey completion.
32382
32395
  * - `"onComplete"` - Clears the value when the survey is complete.
32383
32396
  * - `"none"` - Never clears the value of an invisible question.
32384
32397
  * @see SurveyModel.clearInvisibleValues
@@ -32394,6 +32407,12 @@ var Question = /** @class */ (function (_super) {
32394
32407
  enumerable: false,
32395
32408
  configurable: true
32396
32409
  });
32410
+ Question.prototype.getClearIfInvisible = function () {
32411
+ var res = this.clearIfInvisible;
32412
+ if (!!this.survey)
32413
+ return this.survey.getQuestionClearIfInvisible(res);
32414
+ return res !== "default" ? res : "onComplete";
32415
+ };
32397
32416
  Object.defineProperty(Question.prototype, "displayValue", {
32398
32417
  get: function () {
32399
32418
  if (this.isLoadingFromJson)
@@ -32624,11 +32643,10 @@ var Question = /** @class */ (function (_super) {
32624
32643
  };
32625
32644
  Object.defineProperty(Question.prototype, "isClearValueOnHidden", {
32626
32645
  get: function () {
32627
- if (this.clearIfInvisible === "none" || this.clearIfInvisible === "onComplete")
32646
+ var clearIf = this.getClearIfInvisible();
32647
+ if (clearIf === "none" || clearIf === "onComplete")
32628
32648
  return false;
32629
- if (this.clearIfInvisible === "onHidden")
32630
- return true;
32631
- return !!this.survey && this.survey.isClearValueOnHidden;
32649
+ return clearIf === "onHidden" || clearIf === "onHiddenContainer";
32632
32650
  },
32633
32651
  enumerable: false,
32634
32652
  configurable: true
@@ -33386,7 +33404,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
33386
33404
  {
33387
33405
  name: "clearIfInvisible",
33388
33406
  default: "default",
33389
- choices: ["default", "none", "onComplete", "onHidden"],
33407
+ choices: ["default", "none", "onComplete", "onHidden", "onHiddenContainer"],
33390
33408
  },
33391
33409
  { name: "isRequired:switch", overridingProperty: "requiredIf" },
33392
33410
  "requiredIf:condition",
@@ -33753,6 +33771,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
33753
33771
  };
33754
33772
  QuestionSelectBase.prototype.createItemValue = function (value, text) {
33755
33773
  var res = _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(this.getItemValueType(), value);
33774
+ res.locOwner = this;
33756
33775
  if (!!text)
33757
33776
  res.text = text;
33758
33777
  return res;
@@ -35117,8 +35136,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
35117
35136
  return false;
35118
35137
  return !this.keepIncorrectValues && !this.isEmpty();
35119
35138
  };
35120
- QuestionSelectBase.prototype.clearValueIfInvisibleCore = function () {
35121
- _super.prototype.clearValueIfInvisibleCore.call(this);
35139
+ QuestionSelectBase.prototype.clearValueIfInvisibleCore = function (reason) {
35140
+ _super.prototype.clearValueIfInvisibleCore.call(this, reason);
35122
35141
  this.clearIncorrectValues();
35123
35142
  };
35124
35143
  /**
@@ -37080,6 +37099,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
37080
37099
  this.updateRemainingCharacterCounter(event.target.value);
37081
37100
  };
37082
37101
  QuestionCommentModel.prototype.onKeyDown = function (event) {
37102
+ this.checkForUndo(event);
37083
37103
  if (!this.acceptCarriageReturn && (event.key === "Enter" || event.keyCode === 13)) {
37084
37104
  event.preventDefault();
37085
37105
  event.stopPropagation();
@@ -37776,11 +37796,11 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
37776
37796
  return res;
37777
37797
  return _super.prototype.findQuestionByName.call(this, name);
37778
37798
  };
37779
- QuestionCompositeModel.prototype.clearValueIfInvisibleCore = function () {
37780
- _super.prototype.clearValueIfInvisibleCore.call(this);
37799
+ QuestionCompositeModel.prototype.clearValueIfInvisibleCore = function (reason) {
37800
+ _super.prototype.clearValueIfInvisibleCore.call(this, reason);
37781
37801
  var questions = this.contentPanel.questions;
37782
37802
  for (var i = 0; i < questions.length; i++) {
37783
- questions[i].clearValueIfInvisible();
37803
+ questions[i].clearValueIfInvisible(reason);
37784
37804
  }
37785
37805
  };
37786
37806
  QuestionCompositeModel.prototype.onAnyValueChanged = function (name) {
@@ -39172,6 +39192,10 @@ var QuestionFileModel = /** @class */ (function (_super) {
39172
39192
  QuestionFileModel.prototype.getType = function () {
39173
39193
  return "file";
39174
39194
  };
39195
+ QuestionFileModel.prototype.clearValue = function () {
39196
+ this.clearOnDeletingContainer();
39197
+ _super.prototype.clearValue.call(this);
39198
+ };
39175
39199
  QuestionFileModel.prototype.clearOnDeletingContainer = function () {
39176
39200
  if (!this.survey)
39177
39201
  return;
@@ -40720,11 +40744,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
40720
40744
  return QuestionImagePickerModel;
40721
40745
  }(_question_baseselect__WEBPACK_IMPORTED_MODULE_2__["QuestionCheckboxBase"]));
40722
40746
 
40723
- _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imageitemvalue", [], function (value) { return new ImageItemValue(value); }, "itemvalue");
40724
- _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addProperty("imageitemvalue", {
40725
- name: "imageLink",
40726
- serializationProperty: "locImageLink",
40727
- });
40747
+ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imageitemvalue", [{ name: "imageLink", serializationProperty: "locImageLink" }], function (value) { return new ImageItemValue(value); }, "itemvalue");
40728
40748
  _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("responsiveImageSize", [], undefined, "number");
40729
40749
  _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imagepicker", [
40730
40750
  { name: "showOtherItem", visible: false },
@@ -41414,8 +41434,8 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
41414
41434
  json["type"] = question.getType();
41415
41435
  return json;
41416
41436
  };
41417
- QuestionMatrixModel.prototype.clearValueIfInvisibleCore = function () {
41418
- _super.prototype.clearValueIfInvisibleCore.call(this);
41437
+ QuestionMatrixModel.prototype.clearValueIfInvisibleCore = function (reason) {
41438
+ _super.prototype.clearValueIfInvisibleCore.call(this, reason);
41419
41439
  if (this.hasRows) {
41420
41440
  this.clearInvisibleValuesInRows();
41421
41441
  }
@@ -41715,8 +41735,8 @@ var QuestionMatrixDropdownModel = /** @class */ (function (_super) {
41715
41735
  }
41716
41736
  _super.prototype.clearIncorrectValues.call(this);
41717
41737
  };
41718
- QuestionMatrixDropdownModel.prototype.clearValueIfInvisibleCore = function () {
41719
- _super.prototype.clearValueIfInvisibleCore.call(this);
41738
+ QuestionMatrixDropdownModel.prototype.clearValueIfInvisibleCore = function (reason) {
41739
+ _super.prototype.clearValueIfInvisibleCore.call(this, reason);
41720
41740
  this.clearInvisibleValuesInRows();
41721
41741
  };
41722
41742
  QuestionMatrixDropdownModel.prototype.generateRows = function () {
@@ -41728,7 +41748,7 @@ var QuestionMatrixDropdownModel = /** @class */ (function (_super) {
41728
41748
  if (!val)
41729
41749
  val = {};
41730
41750
  for (var i = 0; i < rows.length; i++) {
41731
- if (!rows[i].value)
41751
+ if (this.isValueEmpty(rows[i].value))
41732
41752
  continue;
41733
41753
  result.push(this.createMatrixRow(rows[i], val[rows[i].value]));
41734
41754
  }
@@ -47941,7 +47961,7 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
47941
47961
  }(_question__WEBPACK_IMPORTED_MODULE_2__["Question"]));
47942
47962
 
47943
47963
  _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("multipletextitem", [
47944
- "name",
47964
+ { name: "!name", isUnique: true },
47945
47965
  "isRequired:boolean",
47946
47966
  { name: "placeholder", alternativeName: "placeHolder", serializationProperty: "locPlaceholder" },
47947
47967
  {
@@ -49830,18 +49850,31 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
49830
49850
  }
49831
49851
  return true;
49832
49852
  };
49833
- QuestionPanelDynamicModel.prototype.clearValueIfInvisibleCore = function () {
49853
+ QuestionPanelDynamicModel.prototype.clearValueOnHidding = function (isClearOnHidden) {
49854
+ if (!isClearOnHidden) {
49855
+ if (!!this.survey && this.survey.getQuestionClearIfInvisible("onHidden") === "none")
49856
+ return;
49857
+ this.clearValueInPanelsIfInvisible("onHiddenContainer");
49858
+ }
49859
+ _super.prototype.clearValueOnHidding.call(this, isClearOnHidden);
49860
+ };
49861
+ QuestionPanelDynamicModel.prototype.clearValueIfInvisible = function (reason) {
49862
+ if (reason === void 0) { reason = "onHidden"; }
49863
+ var panelReason = reason === "onHidden" ? "onHiddenContainer" : reason;
49864
+ this.clearValueInPanelsIfInvisible(panelReason);
49865
+ _super.prototype.clearValueIfInvisible.call(this, reason);
49866
+ };
49867
+ QuestionPanelDynamicModel.prototype.clearValueInPanelsIfInvisible = function (reason) {
49834
49868
  for (var i = 0; i < this.panels.length; i++) {
49835
49869
  var questions = this.panels[i].questions;
49836
49870
  this.isSetPanelItemData = {};
49837
49871
  for (var j = 0; j < questions.length; j++) {
49838
49872
  var q = questions[j];
49839
- q.clearValueIfInvisible();
49873
+ q.clearValueIfInvisible(reason);
49840
49874
  this.isSetPanelItemData[q.getValueName()] = this.maxCheckCount + 1;
49841
49875
  }
49842
49876
  }
49843
49877
  this.isSetPanelItemData = {};
49844
- _super.prototype.clearValueIfInvisibleCore.call(this);
49845
49878
  };
49846
49879
  QuestionPanelDynamicModel.prototype.getIsRunningValidators = function () {
49847
49880
  if (_super.prototype.getIsRunningValidators.call(this))
@@ -50314,14 +50347,10 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
50314
50347
  return null;
50315
50348
  if (!this.additionalTitleToolbarValue) {
50316
50349
  this.additionalTitleToolbarValue = new _actions_adaptive_container__WEBPACK_IMPORTED_MODULE_13__["AdaptiveActionContainer"]();
50317
- this.additionalTitleToolbarValue.containerCss = this.getAdditionalTitleToolbarCss();
50318
- this.additionalTitleToolbarValue.cssClasses = {
50319
- item: "sv-tab-item",
50320
- itemPressed: "sv-tab-item--pressed",
50321
- itemAsIcon: "sv-tab-item--icon",
50322
- itemIcon: "sv-tab-item__icon",
50323
- itemTitle: "sv-tab-item__title"
50324
- };
50350
+ this.additionalTitleToolbarValue.dotsItem.popupModel.showPointer = false;
50351
+ this.additionalTitleToolbarValue.dotsItem.popupModel.verticalPosition = "bottom";
50352
+ this.additionalTitleToolbarValue.dotsItem.popupModel.horizontalPosition = "center";
50353
+ this.updateElementCss(false);
50325
50354
  }
50326
50355
  return this.additionalTitleToolbarValue;
50327
50356
  };
@@ -50405,24 +50434,25 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
50405
50434
  return;
50406
50435
  var locTitle = new _localizablestring__WEBPACK_IMPORTED_MODULE_2__["LocalizableString"](panel, true);
50407
50436
  locTitle.sharedData = this.locTemplateTabTitle;
50437
+ var isActive = this.getPanelIndexById(panel.id) === this.currentIndex;
50408
50438
  var newItem = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
50409
50439
  id: panel.id,
50410
- css: "sv-tab-item__root",
50411
- pressed: this.getPanelIndexById(panel.id) === this.currentIndex,
50440
+ pressed: isActive,
50412
50441
  locTitle: locTitle,
50442
+ disableHide: isActive,
50413
50443
  action: function () {
50414
50444
  _this.currentIndex = _this.getPanelIndexById(newItem.id);
50415
- _this.updateTabToolbarItemsPressedState();
50416
50445
  }
50417
50446
  });
50418
50447
  return newItem;
50419
50448
  };
50420
- QuestionPanelDynamicModel.prototype.getAdditionalTitleToolbarCss = function () {
50449
+ QuestionPanelDynamicModel.prototype.getAdditionalTitleToolbarCss = function (cssClasses) {
50450
+ var css = cssClasses !== null && cssClasses !== void 0 ? cssClasses : this.cssClasses;
50421
50451
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
50422
- .append("sv-tabs-toolbar")
50423
- .append("sv-tabs-toolbar--left", this.tabAlign === "left")
50424
- .append("sv-tabs-toolbar--right", this.tabAlign === "right")
50425
- .append("sv-tabs-toolbar--center", this.tabAlign === "center")
50452
+ .append(css.tabsRoot)
50453
+ .append(css.tabsLeft, this.tabAlign === "left")
50454
+ .append(css.tabsRight, this.tabAlign === "right")
50455
+ .append(css.tabsCenter, this.tabAlign === "center")
50426
50456
  .toString();
50427
50457
  };
50428
50458
  QuestionPanelDynamicModel.prototype.updateTabToolbarItemsPressedState = function () {
@@ -50431,7 +50461,15 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
50431
50461
  if (this.currentIndex < 0 || this.currentIndex >= this.visiblePanelCount)
50432
50462
  return;
50433
50463
  var panel = this.visiblePanels[this.currentIndex];
50434
- this.additionalTitleToolbar.renderedActions.forEach(function (action) { return action.pressed = action.id === panel.id; });
50464
+ this.additionalTitleToolbar.renderedActions.forEach(function (action) {
50465
+ var isActive = action.id === panel.id;
50466
+ action.pressed = isActive;
50467
+ action.disableHide = isActive;
50468
+ //should raise update if dimensions are not changed but action is active now
50469
+ if (action.mode === "popup" && action.disableHide) {
50470
+ action["raiseUpdate"]();
50471
+ }
50472
+ });
50435
50473
  };
50436
50474
  QuestionPanelDynamicModel.prototype.updateTabToolbar = function () {
50437
50475
  var _this = this;
@@ -50474,6 +50512,17 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
50474
50512
  QuestionPanelDynamicModel.prototype.showSeparator = function (index) {
50475
50513
  return this.isRenderModeList && index < this.visiblePanelCount - 1;
50476
50514
  };
50515
+ QuestionPanelDynamicModel.prototype.calcCssClasses = function (css) {
50516
+ var classes = _super.prototype.calcCssClasses.call(this, css);
50517
+ var additionalTitleToolbar = this.additionalTitleToolbar;
50518
+ if (!!additionalTitleToolbar) {
50519
+ additionalTitleToolbar.containerCss = this.getAdditionalTitleToolbarCss(classes);
50520
+ additionalTitleToolbar.cssClasses = classes.tabs;
50521
+ additionalTitleToolbar.dotsItem.cssClasses = classes.tabs;
50522
+ additionalTitleToolbar.dotsItem.popupModel.contentComponentData.model.cssClasses = css.list;
50523
+ }
50524
+ return classes;
50525
+ };
50477
50526
  QuestionPanelDynamicModel.maxCheckCount = 3;
50478
50527
  __decorate([
50479
50528
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_5__["property"])({ defaultValue: false, onSet: function (_, target) { target.updateFooterActions(); } })
@@ -52130,7 +52179,7 @@ __webpack_require__.r(__webpack_exports__);
52130
52179
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
52131
52180
  /* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
52132
52181
  /* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./question */ "./src/question.ts");
52133
- /* harmony import */ var signature_pad__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! signature_pad */ "./node_modules/signature_pad/dist/signature_pad.mjs");
52182
+ /* harmony import */ var signature_pad__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! signature_pad */ "./node_modules/signature_pad/dist/signature_pad.js");
52134
52183
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
52135
52184
  var __extends = (undefined && undefined.__extends) || (function () {
52136
52185
  var extendStatics = function (d, b) {
@@ -52231,14 +52280,14 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
52231
52280
  };
52232
52281
  signaturePad.penColor = this.penColor;
52233
52282
  signaturePad.backgroundColor = this.backgroundColor;
52234
- signaturePad.onBegin = function () {
52283
+ signaturePad.addEventListener("beginStroke", function () {
52235
52284
  _this.isDrawingValue = true;
52236
52285
  canvas.focus();
52237
- };
52238
- signaturePad.onEnd = function () {
52286
+ }, { once: true });
52287
+ signaturePad.addEventListener("endStroke", function () {
52239
52288
  _this.isDrawingValue = false;
52240
52289
  _this.updateValue();
52241
- };
52290
+ }, { once: true });
52242
52291
  var updateValueHandler = function () {
52243
52292
  var data = _this.value;
52244
52293
  canvas.width = _this.signatureWidth || defaultWidth;
@@ -52803,6 +52852,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
52803
52852
  _this.updateRemainingCharacterCounter(event.target.value);
52804
52853
  };
52805
52854
  _this.onKeyDown = function (event) {
52855
+ _this.checkForUndo(event);
52806
52856
  if (_this.isInputTextUpdate) {
52807
52857
  _this._isWaitingForEnter = event.keyCode === 229;
52808
52858
  }
@@ -53554,6 +53604,7 @@ var QuestionTextBase = /** @class */ (function (_super) {
53554
53604
  function QuestionTextBase(name) {
53555
53605
  var _this = _super.call(this, name) || this;
53556
53606
  _this.characterCounter = new CharacterCounter();
53607
+ _this.disableNativeUndoRedo = false;
53557
53608
  return _this;
53558
53609
  }
53559
53610
  QuestionTextBase.prototype.isTextValue = function () {
@@ -53650,6 +53701,10 @@ var QuestionTextBase = /** @class */ (function (_super) {
53650
53701
  _super.prototype.localeChanged.call(this);
53651
53702
  this.calcRenderedPlaceholder();
53652
53703
  };
53704
+ QuestionTextBase.prototype.setSurveyImpl = function (value, isLight) {
53705
+ _super.prototype.setSurveyImpl.call(this, value, isLight);
53706
+ this.calcRenderedPlaceholder();
53707
+ };
53653
53708
  QuestionTextBase.prototype.calcRenderedPlaceholder = function () {
53654
53709
  var res = this.placeHolder;
53655
53710
  if (!!res && !this.hasPlaceHolder()) {
@@ -53669,6 +53724,13 @@ var QuestionTextBase = /** @class */ (function (_super) {
53669
53724
  _super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
53670
53725
  this.updateRemainingCharacterCounter(newValue);
53671
53726
  };
53727
+ QuestionTextBase.prototype.checkForUndo = function (event) {
53728
+ if (this.disableNativeUndoRedo && this.isInputTextUpdate && (event.ctrlKey || event.metaKey)) {
53729
+ if ([89, 90].indexOf(event.keyCode) !== -1) {
53730
+ event.preventDefault();
53731
+ }
53732
+ }
53733
+ };
53672
53734
  QuestionTextBase.prototype.getControlClass = function () {
53673
53735
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
53674
53736
  .append(this.cssClasses.root)
@@ -66001,7 +66063,9 @@ var SurveyModel = /** @class */ (function (_super) {
66001
66063
  */
66002
66064
  _this.onUpdateQuestionCssClasses = _this.addEvent();
66003
66065
  /**
66004
- * An event that is raised before rendering a panel. Use it to override default panel CSS classes.
66066
+ * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes.
66067
+ *
66068
+ * For information on event handler parameters, refer to descriptions within the interface.
66005
66069
  *
66006
66070
  * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
66007
66071
  * @see css
@@ -66010,6 +66074,8 @@ var SurveyModel = /** @class */ (function (_super) {
66010
66074
  /**
66011
66075
  * An event that is raised before rendering a page. Use it to override default page CSS classes.
66012
66076
  *
66077
+ * For information on event handler parameters, refer to descriptions within the interface.
66078
+ *
66013
66079
  * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
66014
66080
  * @see css
66015
66081
  */
@@ -66017,6 +66083,8 @@ var SurveyModel = /** @class */ (function (_super) {
66017
66083
  /**
66018
66084
  * An event that is raised before rendering a choice item in Radio Button Group, Checkboxes, and Dropdown questions. Use it to override default CSS classes applied to choice items.
66019
66085
  *
66086
+ * For information on event handler parameters, refer to descriptions within the interface.
66087
+ *
66020
66088
  * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
66021
66089
  * @see css
66022
66090
  */
@@ -66093,91 +66161,61 @@ var SurveyModel = /** @class */ (function (_super) {
66093
66161
  */
66094
66162
  _this.onGetChoiceDisplayValue = _this.addEvent();
66095
66163
  /**
66096
- * An event that is raised on adding a new row in Matrix Dynamic question.
66097
- * @see QuestionMatrixDynamicModel
66098
- * @see QuestionMatrixDynamicModel.visibleRows
66164
+ * An event that is raised after a new row is added to a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66099
66165
  */
66100
66166
  _this.onMatrixRowAdded = _this.addEvent();
66101
66167
  /**
66102
- * An event that is raised before adding a new row in Matrix Dynamic question.
66103
- * @see QuestionMatrixDynamicModel
66104
- * @see QuestionMatrixDynamicModel.visibleRows
66168
+ * An event that is raised before a new row is added to a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66105
66169
  */
66106
66170
  _this.onMatrixBeforeRowAdded = _this.addEvent();
66107
66171
  /**
66108
- * An event that is raised before removing a row from Matrix Dynamic question. You can disable removing and clear the data instead.
66109
- * @see QuestionMatrixDynamicModel
66110
- * @see onMatrixRowRemoved
66172
+ * An event that is raised before a row is deleted from a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). You can cancel row deletion and clear row data instead.
66111
66173
  * @see onMatrixAllowRemoveRow
66112
66174
  */
66113
66175
  _this.onMatrixRowRemoving = _this.addEvent();
66114
66176
  /**
66115
- * An event that is raised on removing a row from Matrix Dynamic question.
66116
- * @see QuestionMatrixDynamicModel
66117
- * @see QuestionMatrixDynamicModel.visibleRows
66118
- * @see onMatrixRowRemoving
66177
+ * An event that is raised after a row is deleted from a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66119
66178
  * @see onMatrixAllowRemoveRow
66120
66179
  */
66121
66180
  _this.onMatrixRowRemoved = _this.addEvent();
66122
66181
  /**
66123
- * An event that is raised before rendering "Remove" button for removing a row from Matrix Dynamic question.
66124
- * @see QuestionMatrixDynamicModel
66182
+ * An event that is raised before rendering the Remove button in a row of a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). Use this event to hide the Remove button for individual matrix rows.
66125
66183
  * @see onMatrixRowRemoving
66126
66184
  * @see onMatrixRowRemoved
66127
66185
  */
66128
66186
  _this.onMatrixAllowRemoveRow = _this.addEvent();
66129
66187
  /**
66130
- * An event that is raised before creating cell question in the matrix. You can change the cell question type by setting different options.cellType.
66131
- * @see onMatrixBeforeRowAdded
66132
- * @see onMatrixCellCreated
66133
- * @see QuestionMatrixDynamicModel
66134
- * @see QuestionMatrixDropdownModel
66188
+ * An event that is raised before a cell in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) is created. Use this event to change the type of individual matrix cells.
66189
+ * @see onMatrixAfterCellRender
66135
66190
  */
66136
66191
  _this.onMatrixCellCreating = _this.addEvent();
66137
66192
  /**
66138
- * An event that is raised for every cell created in Matrix Dynamic and Matrix Dropdown questions.
66139
- * @see onMatrixBeforeRowAdded
66140
- * @see onMatrixCellCreating
66141
- * @see onMatrixRowAdded
66142
- * @see QuestionMatrixDynamicModel
66143
- * @see QuestionMatrixDropdownModel
66193
+ * An event that is raised after a cell in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) is created.
66194
+ * @see onMatrixAfterCellRender
66144
66195
  */
66145
66196
  _this.onMatrixCellCreated = _this.addEvent();
66146
66197
  /**
66147
- * An event that is raised for every cell after is has been rendered in DOM.
66198
+ * An event that is raised for every matrix cell after it is rendered to the DOM.
66148
66199
  * @see onMatrixCellCreated
66149
- * @see QuestionMatrixDynamicModel
66150
- * @see QuestionMatrixDropdownModel
66151
66200
  */
66152
66201
  _this.onMatrixAfterCellRender = _this.addEvent();
66153
66202
  /**
66154
- * An event that is raised when cell value is changed in Matrix Dynamic and Matrix Dropdown questions.
66155
- * @see onMatrixCellValueChanging
66203
+ * An event that is raised after a cell value is changed in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66156
66204
  * @see onMatrixBeforeRowAdded
66157
- * @see onMatrixRowAdded
66158
- * @see QuestionMatrixDynamicModel
66159
- * @see QuestionMatrixDropdownModel
66160
66205
  */
66161
66206
  _this.onMatrixCellValueChanged = _this.addEvent();
66162
66207
  /**
66163
- * An event that is raised on changing cell value in Matrix Dynamic and Matrix Dropdown questions. You may change the `options.value` property to change a cell value.
66164
- * @see onMatrixCellValueChanged
66208
+ * An event that is raised before a cell value is changed in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). Use this event to change the cell value.
66165
66209
  * @see onMatrixBeforeRowAdded
66166
- * @see onMatrixRowAdded
66167
- * @see QuestionMatrixDynamicModel
66168
- * @see QuestionMatrixDropdownModel
66169
66210
  */
66170
66211
  _this.onMatrixCellValueChanging = _this.addEvent();
66171
66212
  /**
66172
- * An event that is raised when Matrix Dynamic and Matrix Dropdown questions validate the cell value.
66213
+ * An event that is raised for [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) and [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) questions when they validate a cell value. Use this event to display a custom error message based on a condition.
66173
66214
  * @see onMatrixBeforeRowAdded
66174
- * @see onMatrixRowAdded
66175
- * @see QuestionMatrixDynamicModel
66176
- * @see QuestionMatrixDropdownModel
66177
66215
  */
66178
66216
  _this.onMatrixCellValidate = _this.addEvent();
66179
66217
  /**
66180
- * An event that is raised on adding a new column in Matrix Dynamic or Matrix Dropdown question.
66218
+ * An event that is raised after a new column is added to a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66181
66219
  */
66182
66220
  _this.onMatrixColumnAdded = _this.addEvent();
66183
66221
  /**
@@ -66255,9 +66293,12 @@ var SurveyModel = /** @class */ (function (_super) {
66255
66293
  */
66256
66294
  _this.onGetPanelFooterActions = _this.addEvent();
66257
66295
  /**
66258
- * Use this event to create/customize actions to be displayed in a matrix question's row.
66296
+ * An event that allows you to add, delete, or modify actions in rows of a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/).
66297
+ *
66298
+ * For information on event handler parameters, refer to descriptions within the interface.
66299
+ *
66300
+ * [View Demo](https://surveyjs.io/form-library/examples/employee-information-form/ (linkStyle))
66259
66301
  * @see IAction
66260
- * @see QuestionMatrixDropdownModelBase
66261
66302
  */
66262
66303
  _this.onGetMatrixRowActions = _this.addEvent();
66263
66304
  /**
@@ -67511,8 +67552,11 @@ var SurveyModel = /** @class */ (function (_super) {
67511
67552
  Object.defineProperty(SurveyModel.prototype, "logo", {
67512
67553
  //#region Title/Header options
67513
67554
  /**
67514
- * Gets or sets a survey logo.
67515
- * @see title
67555
+ * An image URL or a Base64-encoded image to use as a survey logo.
67556
+ *
67557
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-logo/ (linkStyle))
67558
+ * @see logoPosition
67559
+ * @see logoFit
67516
67560
  */
67517
67561
  get: function () {
67518
67562
  return this.getLocalizableStringText("logo");
@@ -67532,8 +67576,15 @@ var SurveyModel = /** @class */ (function (_super) {
67532
67576
  });
67533
67577
  Object.defineProperty(SurveyModel.prototype, "logoWidth", {
67534
67578
  /**
67535
- * Gets or sets a survey logo width.
67579
+ * A logo width in CSS-accepted values.
67580
+ *
67581
+ * Default value: `300px`
67582
+ *
67583
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-logo/ (linkStyle))
67584
+ * @see logoHeight
67536
67585
  * @see logo
67586
+ * @see logoPosition
67587
+ * @see logoFit
67537
67588
  */
67538
67589
  get: function () {
67539
67590
  var width = this.getPropertyValue("logoWidth");
@@ -67547,8 +67598,15 @@ var SurveyModel = /** @class */ (function (_super) {
67547
67598
  });
67548
67599
  Object.defineProperty(SurveyModel.prototype, "logoHeight", {
67549
67600
  /**
67550
- * Gets or sets a survey logo height.
67601
+ * A logo height in CSS-accepted values.
67602
+ *
67603
+ * Default value: `200px`
67604
+ *
67605
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-logo/ (linkStyle))
67606
+ * @see logoHeight
67551
67607
  * @see logo
67608
+ * @see logoPosition
67609
+ * @see logoFit
67552
67610
  */
67553
67611
  get: function () {
67554
67612
  var height = this.getPropertyValue("logoHeight");
@@ -67562,8 +67620,17 @@ var SurveyModel = /** @class */ (function (_super) {
67562
67620
  });
67563
67621
  Object.defineProperty(SurveyModel.prototype, "logoPosition", {
67564
67622
  /**
67565
- * Gets or sets a survey logo position.
67623
+ * A logo position relative to the [survey title](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title).
67624
+ *
67625
+ * Possible values:
67626
+ *
67627
+ * - `"left"` (default) - Places the logo to the left of the survey title.
67628
+ * - `"right"` - Places the logo to the right of the survey title.
67629
+ * - `"none"` - Hides the logo.
67630
+ *
67631
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-logo/ (linkStyle))
67566
67632
  * @see logo
67633
+ * @see logoFit
67567
67634
  */
67568
67635
  get: function () {
67569
67636
  return this.getPropertyValue("logoPosition");
@@ -67661,8 +67728,20 @@ var SurveyModel = /** @class */ (function (_super) {
67661
67728
  });
67662
67729
  Object.defineProperty(SurveyModel.prototype, "logoFit", {
67663
67730
  /**
67664
- * The logo fit mode.
67731
+ * Specifies how to resize a logo to fit it into its container.
67732
+ *
67733
+ * Possible values:
67734
+ *
67735
+ * - `"contain"` (default)
67736
+ * - `"cover"`
67737
+ * - `"fill"`
67738
+ * - `"none"`
67739
+ *
67740
+ * Refer to the [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property description for information on the possible values.
67741
+ *
67742
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-logo/ (linkStyle))
67665
67743
  * @see logo
67744
+ * @see logoPosition
67666
67745
  */
67667
67746
  get: function () {
67668
67747
  return this.getPropertyValue("logoFit");
@@ -68943,12 +69022,12 @@ var SurveyModel = /** @class */ (function (_super) {
68943
69022
  });
68944
69023
  Object.defineProperty(SurveyModel.prototype, "matrixDragHandleArea", {
68945
69024
  /**
68946
- * Specifies which part of a choice item responds to a drag gesture in MatrixDynamic questions.
69025
+ * Specifies which part of a matrix row responds to a drag gesture in [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) questions.
68947
69026
  *
68948
69027
  * Possible values:
68949
69028
  *
68950
- * - `"entireItem"` (default) - Users can use the entire choice item as a drag handle.
68951
- * - `"icon"` - Users can only use the choice item icon as a drag handle.
69029
+ * - `"entireItem"` (default) - Users can use the entire matrix row as a drag handle.
69030
+ * - `"icon"` - Users can only use a drag icon as a drag handle.
68952
69031
  */
68953
69032
  get: function () {
68954
69033
  return this.getPropertyValue("matrixDragHandleArea", "entireItem");
@@ -72220,23 +72299,13 @@ var SurveyModel = /** @class */ (function (_super) {
72220
72299
  enumerable: false,
72221
72300
  configurable: true
72222
72301
  });
72223
- Object.defineProperty(SurveyModel.prototype, "isClearValueOnHidden", {
72224
- get: function () {
72225
- return (this.clearInvisibleValues == "onHidden" ||
72226
- this.isClearValueOnHiddenContainer);
72227
- },
72228
- enumerable: false,
72229
- configurable: true
72230
- });
72231
- Object.defineProperty(SurveyModel.prototype, "isClearValueOnHiddenContainer", {
72232
- get: function () {
72233
- return (this.clearInvisibleValues == "onHiddenContainer" &&
72234
- !this.isShowingPreview &&
72235
- !this.runningPages);
72236
- },
72237
- enumerable: false,
72238
- configurable: true
72239
- });
72302
+ SurveyModel.prototype.getQuestionClearIfInvisible = function (questionClearIf) {
72303
+ if (this.isShowingPreview || this.runningPages)
72304
+ return "none";
72305
+ if (questionClearIf !== "default")
72306
+ return questionClearIf;
72307
+ return this.clearInvisibleValues;
72308
+ };
72240
72309
  SurveyModel.prototype.questionVisibilityChanged = function (question, newValue) {
72241
72310
  this.updateVisibleIndexes();
72242
72311
  this.onQuestionVisibleChanged.fire(this, {
@@ -73406,7 +73475,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
73406
73475
  default: "auto",
73407
73476
  choices: ["auto", "static", "responsive"],
73408
73477
  },
73409
- "width",
73478
+ { name: "width", visibleIf: function (obj) { return obj.widthMode === "static"; } },
73410
73479
  { name: "backgroundImage", serializationProperty: "locBackgroundImage", visible: false },
73411
73480
  { name: "backgroundImageFit", default: "cover", choices: ["auto", "contain", "cover"], visible: false },
73412
73481
  { name: "backgroundOpacity:number", minValue: 0, maxValue: 1, default: 1, visible: false },
@@ -75293,8 +75362,7 @@ var ResponsivityManager = /** @class */ (function () {
75293
75362
  this.model.updateCallback = function (isResetInitialized) {
75294
75363
  if (isResetInitialized)
75295
75364
  _this.isInitialized = false;
75296
- else
75297
- setTimeout(function () { _this.process(); }, 1);
75365
+ setTimeout(function () { _this.process(); }, 1);
75298
75366
  };
75299
75367
  if (typeof ResizeObserver !== "undefined") {
75300
75368
  this.resizeObserver = new ResizeObserver(function (_) { return _this.process(); });