survey-core 1.12.6 → 1.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/defaultV2.css +22 -3
- package/defaultV2.css.map +1 -1
- package/defaultV2.fontless.css +22 -3
- package/defaultV2.fontless.css.map +1 -1
- package/defaultV2.fontless.min.css +2 -2
- package/defaultV2.min.css +2 -2
- package/i18n/arabic.js +5 -2
- package/i18n/arabic.js.map +1 -1
- package/i18n/arabic.min.js +2 -2
- package/i18n/basque.js +5 -2
- package/i18n/basque.js.map +1 -1
- package/i18n/basque.min.js +2 -2
- package/i18n/bulgarian.js +5 -2
- package/i18n/bulgarian.js.map +1 -1
- package/i18n/bulgarian.min.js +2 -2
- package/i18n/catalan.js +5 -2
- package/i18n/catalan.js.map +1 -1
- package/i18n/catalan.min.js +2 -2
- package/i18n/croatian.js +5 -2
- package/i18n/croatian.js.map +1 -1
- package/i18n/croatian.min.js +2 -2
- package/i18n/czech.js +5 -2
- package/i18n/czech.js.map +1 -1
- package/i18n/czech.min.js +2 -2
- package/i18n/danish.js +5 -2
- package/i18n/danish.js.map +1 -1
- package/i18n/danish.min.js +2 -2
- package/i18n/dutch.js +5 -2
- package/i18n/dutch.js.map +1 -1
- package/i18n/dutch.min.js +2 -2
- package/i18n/english.js +2 -1
- package/i18n/english.js.map +1 -1
- package/i18n/english.min.js +2 -2
- package/i18n/estonian.js +5 -2
- package/i18n/estonian.js.map +1 -1
- package/i18n/estonian.min.js +2 -2
- package/i18n/finnish.js +5 -2
- package/i18n/finnish.js.map +1 -1
- package/i18n/finnish.min.js +2 -2
- package/i18n/french.js +5 -2
- package/i18n/french.js.map +1 -1
- package/i18n/french.min.js +2 -2
- package/i18n/georgian.js +5 -2
- package/i18n/georgian.js.map +1 -1
- package/i18n/georgian.min.js +2 -2
- package/i18n/german.js +5 -2
- package/i18n/german.js.map +1 -1
- package/i18n/german.min.js +2 -2
- package/i18n/greek.js +5 -2
- package/i18n/greek.js.map +1 -1
- package/i18n/greek.min.js +2 -2
- package/i18n/hebrew.js +5 -2
- package/i18n/hebrew.js.map +1 -1
- package/i18n/hebrew.min.js +2 -2
- package/i18n/hindi.js +5 -2
- package/i18n/hindi.js.map +1 -1
- package/i18n/hindi.min.js +2 -2
- package/i18n/hungarian.js +5 -2
- package/i18n/hungarian.js.map +1 -1
- package/i18n/hungarian.min.js +2 -2
- package/i18n/icelandic.js +5 -2
- package/i18n/icelandic.js.map +1 -1
- package/i18n/icelandic.min.js +2 -2
- package/i18n/index.js +193 -48
- package/i18n/index.js.map +1 -1
- package/i18n/index.min.js +2 -2
- package/i18n/indonesian.js +5 -2
- package/i18n/indonesian.js.map +1 -1
- package/i18n/indonesian.min.js +2 -2
- package/i18n/italian.js +5 -2
- package/i18n/italian.js.map +1 -1
- package/i18n/italian.min.js +2 -2
- package/i18n/japanese.js +5 -1
- package/i18n/japanese.js.map +1 -1
- package/i18n/japanese.min.js +2 -2
- package/i18n/kazakh.js +5 -2
- package/i18n/kazakh.js.map +1 -1
- package/i18n/kazakh.min.js +2 -2
- package/i18n/korean.js +5 -2
- package/i18n/korean.js.map +1 -1
- package/i18n/korean.min.js +2 -2
- package/i18n/latvian.js +5 -2
- package/i18n/latvian.js.map +1 -1
- package/i18n/latvian.min.js +2 -2
- package/i18n/lithuanian.js +5 -2
- package/i18n/lithuanian.js.map +1 -1
- package/i18n/lithuanian.min.js +2 -2
- package/i18n/macedonian.js +5 -2
- package/i18n/macedonian.js.map +1 -1
- package/i18n/macedonian.min.js +2 -2
- package/i18n/malay.js +5 -2
- package/i18n/malay.js.map +1 -1
- package/i18n/malay.min.js +2 -2
- package/i18n/nl-BE.js +5 -2
- package/i18n/nl-BE.js.map +1 -1
- package/i18n/nl-BE.min.js +2 -2
- package/i18n/norwegian.js +5 -2
- package/i18n/norwegian.js.map +1 -1
- package/i18n/norwegian.min.js +2 -2
- package/i18n/persian.js +5 -2
- package/i18n/persian.js.map +1 -1
- package/i18n/persian.min.js +2 -2
- package/i18n/philippines.js +5 -2
- package/i18n/philippines.js.map +1 -1
- package/i18n/philippines.min.js +2 -2
- package/i18n/polish.js +5 -2
- package/i18n/polish.js.map +1 -1
- package/i18n/polish.min.js +2 -2
- package/i18n/portuguese-br.js +5 -2
- package/i18n/portuguese-br.js.map +1 -1
- package/i18n/portuguese-br.min.js +2 -2
- package/i18n/portuguese.js +5 -2
- package/i18n/portuguese.js.map +1 -1
- package/i18n/portuguese.min.js +2 -2
- package/i18n/romanian.js +5 -2
- package/i18n/romanian.js.map +1 -1
- package/i18n/romanian.min.js +2 -2
- package/i18n/russian.js +5 -2
- package/i18n/russian.js.map +1 -1
- package/i18n/russian.min.js +2 -2
- package/i18n/serbian.js +5 -2
- package/i18n/serbian.js.map +1 -1
- package/i18n/serbian.min.js +2 -2
- package/i18n/simplified-chinese.js +5 -2
- package/i18n/simplified-chinese.js.map +1 -1
- package/i18n/simplified-chinese.min.js +2 -2
- package/i18n/slovak.js +5 -2
- package/i18n/slovak.js.map +1 -1
- package/i18n/slovak.min.js +2 -2
- package/i18n/spanish.js +5 -2
- package/i18n/spanish.js.map +1 -1
- package/i18n/spanish.min.js +2 -2
- package/i18n/swahili.js +5 -2
- package/i18n/swahili.js.map +1 -1
- package/i18n/swahili.min.js +2 -2
- package/i18n/swedish.js +5 -2
- package/i18n/swedish.js.map +1 -1
- package/i18n/swedish.min.js +2 -2
- package/i18n/tajik.js +1 -1
- package/i18n/tajik.min.js +1 -1
- package/i18n/telugu.js +5 -2
- package/i18n/telugu.js.map +1 -1
- package/i18n/telugu.min.js +2 -2
- package/i18n/thai.js +5 -2
- package/i18n/thai.js.map +1 -1
- package/i18n/thai.min.js +2 -2
- package/i18n/traditional-chinese.js +5 -2
- package/i18n/traditional-chinese.js.map +1 -1
- package/i18n/traditional-chinese.min.js +2 -2
- package/i18n/turkish.js +5 -2
- package/i18n/turkish.js.map +1 -1
- package/i18n/turkish.min.js +2 -2
- package/i18n/ukrainian.js +5 -2
- package/i18n/ukrainian.js.map +1 -1
- package/i18n/ukrainian.min.js +2 -2
- package/i18n/urdu.js +5 -2
- package/i18n/urdu.js.map +1 -1
- package/i18n/urdu.min.js +2 -2
- package/i18n/vietnamese.js +5 -2
- package/i18n/vietnamese.js.map +1 -1
- package/i18n/vietnamese.min.js +2 -2
- package/i18n/welsh.js +5 -2
- package/i18n/welsh.js.map +1 -1
- package/i18n/welsh.min.js +2 -2
- package/modern.css +17 -1
- package/modern.css.map +1 -1
- package/modern.fontless.css +17 -1
- package/modern.fontless.css.map +1 -1
- package/modern.fontless.min.css +2 -2
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/plugins/bootstrap-integration/cssbootstrap.d.ts +1 -0
- package/plugins/bootstrap-integration/index.js +3 -2
- package/plugins/bootstrap-integration/index.js.map +1 -1
- package/plugins/bootstrap-integration/index.min.js +2 -2
- package/plugins/bootstrap-material-integration/cssbootstrapmaterial.d.ts +1 -0
- package/plugins/bootstrap-material-integration/index.js +3 -2
- package/plugins/bootstrap-material-integration/index.js.map +1 -1
- package/plugins/bootstrap-material-integration/index.min.js +2 -2
- package/survey.core.js +507 -266
- package/survey.core.js.map +1 -1
- package/survey.core.min.js +3 -3
- package/survey.css +17 -1
- package/survey.css.map +1 -1
- package/survey.i18n.js +193 -48
- package/survey.i18n.js.map +1 -1
- package/survey.i18n.min.js +2 -2
- package/survey.min.css +2 -2
- package/themes/borderless-dark-panelless.js +1 -1
- package/themes/borderless-dark-panelless.min.js +1 -1
- package/themes/borderless-dark.js +1 -1
- package/themes/borderless-dark.min.js +1 -1
- package/themes/borderless-light-panelless..js +1 -1
- package/themes/borderless-light-panelless..min.js +1 -1
- package/themes/borderless-light.js +1 -1
- package/themes/borderless-light.min.js +1 -1
- package/themes/contrast-dark-panelless.js +1 -1
- package/themes/contrast-dark-panelless.min.js +1 -1
- package/themes/contrast-dark.js +1 -1
- package/themes/contrast-dark.min.js +1 -1
- package/themes/contrast-light-panelless.js +1 -1
- package/themes/contrast-light-panelless.min.js +1 -1
- package/themes/contrast-light.js +1 -1
- package/themes/contrast-light.min.js +1 -1
- package/themes/default-dark-panelless.js +1 -1
- package/themes/default-dark-panelless.min.js +1 -1
- package/themes/default-dark.js +1 -1
- package/themes/default-dark.min.js +1 -1
- package/themes/default-light-panelless.js +1 -1
- package/themes/default-light-panelless.min.js +1 -1
- package/themes/default-light.js +1 -1
- package/themes/default-light.min.js +1 -1
- package/themes/doubleborder-dark-panelless.js +1 -1
- package/themes/doubleborder-dark-panelless.min.js +1 -1
- package/themes/doubleborder-dark.js +1 -1
- package/themes/doubleborder-dark.min.js +1 -1
- package/themes/doubleborder-light-panelles.js +1 -1
- package/themes/doubleborder-light-panelles.min.js +1 -1
- package/themes/doubleborder-light.js +1 -1
- package/themes/doubleborder-light.min.js +1 -1
- package/themes/flat-dark-panelless.js +1 -1
- package/themes/flat-dark-panelless.min.js +1 -1
- package/themes/flat-dark.js +1 -1
- package/themes/flat-dark.min.js +1 -1
- package/themes/flat-light-panelless.js +1 -1
- package/themes/flat-light-panelless.min.js +1 -1
- package/themes/flat-light.js +1 -1
- package/themes/flat-light.min.js +1 -1
- package/themes/index.js +1 -1
- package/themes/index.min.js +1 -1
- package/themes/layered-dark-panelless.js +1 -1
- package/themes/layered-dark-panelless.min.js +1 -1
- package/themes/layered-dark.js +1 -1
- package/themes/layered-dark.min.js +1 -1
- package/themes/layered-light-panelless.js +1 -1
- package/themes/layered-light-panelless.min.js +1 -1
- package/themes/layered-light.js +1 -1
- package/themes/layered-light.min.js +1 -1
- package/themes/plain-dark-panelless.js +1 -1
- package/themes/plain-dark-panelless.min.js +1 -1
- package/themes/plain-dark.js +1 -1
- package/themes/plain-dark.min.js +1 -1
- package/themes/plain-light-panelless.js +1 -1
- package/themes/plain-light-panelless.min.js +1 -1
- package/themes/plain-light.js +1 -1
- package/themes/plain-light.min.js +1 -1
- package/themes/sharp-dark-panelless.js +1 -1
- package/themes/sharp-dark-panelless.min.js +1 -1
- package/themes/sharp-dark.js +1 -1
- package/themes/sharp-dark.min.js +1 -1
- package/themes/sharp-light-panelless.js +1 -1
- package/themes/sharp-light-panelless.min.js +1 -1
- package/themes/sharp-light.js +1 -1
- package/themes/sharp-light.min.js +1 -1
- package/themes/solid-dark-panelless.js +1 -1
- package/themes/solid-dark-panelless.min.js +1 -1
- package/themes/solid-dark.js +1 -1
- package/themes/solid-dark.min.js +1 -1
- package/themes/solid-light-panelless.js +1 -1
- package/themes/solid-light-panelless.min.js +1 -1
- package/themes/solid-light.js +1 -1
- package/themes/solid-light.min.js +1 -1
- package/themes/three-dimensional-dark-panelless.js +1 -1
- package/themes/three-dimensional-dark-panelless.min.js +1 -1
- package/themes/three-dimensional-dark.js +1 -1
- package/themes/three-dimensional-dark.min.js +1 -1
- package/themes/three-dimensional-light-panelless.js +1 -1
- package/themes/three-dimensional-light-panelless.min.js +1 -1
- package/themes/three-dimensional-light.js +1 -1
- package/themes/three-dimensional-light.min.js +1 -1
- package/ts3.4/typings/packages/survey-core/src/base-interfaces.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/base.d.ts +1 -1
- package/ts3.4/typings/packages/survey-core/src/conditionProcessValue.d.ts +2 -0
- package/ts3.4/typings/packages/survey-core/src/conditions.d.ts +25 -18
- package/ts3.4/typings/packages/survey-core/src/defaultCss/defaultV2Css.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/dragdrop/matrix-rows.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/expressions/expressions.d.ts +5 -5
- package/ts3.4/typings/packages/survey-core/src/itemvalue.d.ts +2 -1
- package/ts3.4/typings/packages/survey-core/src/jsonobject.d.ts +1 -1
- package/ts3.4/typings/packages/survey-core/src/localizablestring.d.ts +2 -2
- package/ts3.4/typings/packages/survey-core/src/localization/english.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/question_baseselect.d.ts +1 -1
- package/ts3.4/typings/packages/survey-core/src/question_checkbox.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/question_file.d.ts +4 -3
- package/ts3.4/typings/packages/survey-core/src/question_matrix.d.ts +1 -1
- package/ts3.4/typings/packages/survey-core/src/question_matrixdropdownbase.d.ts +5 -0
- package/ts3.4/typings/packages/survey-core/src/question_matrixdropdownrendered.d.ts +3 -1
- package/ts3.4/typings/packages/survey-core/src/question_matrixdynamic.d.ts +3 -1
- package/ts3.4/typings/packages/survey-core/src/question_paneldynamic.d.ts +1 -0
- package/ts3.4/typings/packages/survey-core/src/question_signaturepad.d.ts +5 -3
- package/ts3.4/typings/packages/survey-core/src/survey-element.d.ts +1 -1
- package/ts3.4/typings/packages/survey-core/src/survey-events-api.d.ts +13 -1
- package/ts3.4/typings/packages/survey-core/src/survey.d.ts +22 -5
- package/ts3.4/typings/packages/survey-core/src/surveyStrings.d.ts +1 -0
- package/ts3.4/typings/src/defaultCss/cssmodern.d.ts +1 -0
- package/ts3.4/typings/src/defaultCss/cssstandard.d.ts +1 -0
- package/typings/packages/survey-core/src/base-interfaces.d.ts +1 -0
- package/typings/packages/survey-core/src/base.d.ts +1 -1
- package/typings/packages/survey-core/src/conditionProcessValue.d.ts +2 -0
- package/typings/packages/survey-core/src/conditions.d.ts +25 -18
- package/typings/packages/survey-core/src/defaultCss/defaultV2Css.d.ts +1 -0
- package/typings/packages/survey-core/src/dragdrop/matrix-rows.d.ts +1 -0
- package/typings/packages/survey-core/src/expressions/expressions.d.ts +5 -5
- package/typings/packages/survey-core/src/itemvalue.d.ts +2 -1
- package/typings/packages/survey-core/src/jsonobject.d.ts +1 -1
- package/typings/packages/survey-core/src/localizablestring.d.ts +2 -2
- package/typings/packages/survey-core/src/localization/english.d.ts +1 -0
- package/typings/packages/survey-core/src/question_baseselect.d.ts +1 -1
- package/typings/packages/survey-core/src/question_checkbox.d.ts +1 -0
- package/typings/packages/survey-core/src/question_file.d.ts +5 -4
- package/typings/packages/survey-core/src/question_matrix.d.ts +1 -1
- package/typings/packages/survey-core/src/question_matrixdropdownbase.d.ts +5 -0
- package/typings/packages/survey-core/src/question_matrixdropdownrendered.d.ts +3 -1
- package/typings/packages/survey-core/src/question_matrixdynamic.d.ts +3 -1
- package/typings/packages/survey-core/src/question_paneldynamic.d.ts +1 -0
- package/typings/packages/survey-core/src/question_signaturepad.d.ts +5 -3
- package/typings/packages/survey-core/src/survey-element.d.ts +1 -1
- package/typings/packages/survey-core/src/survey-events-api.d.ts +13 -1
- package/typings/packages/survey-core/src/survey.d.ts +22 -5
- package/typings/packages/survey-core/src/surveyStrings.d.ts +1 -0
- package/typings/src/defaultCss/cssmodern.d.ts +1 -0
- package/typings/src/defaultCss/cssstandard.d.ts +1 -0
package/survey.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.12.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.12.8
|
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -1872,6 +1872,7 @@ var englishStrings = {
|
|
|
1872
1872
|
numericError: "The value should be numeric.",
|
|
1873
1873
|
minError: "The value should not be less than {0}",
|
|
1874
1874
|
maxError: "The value should not be greater than {0}",
|
|
1875
|
+
textNoDigitsAllow: "Numbers are not allowed.",
|
|
1875
1876
|
textMinLength: "Please enter at least {0} character(s).",
|
|
1876
1877
|
textMaxLength: "Please enter no more than {0} character(s).",
|
|
1877
1878
|
textMinMaxLength: "Please enter at least {0} and no more than {1} characters.",
|
|
@@ -2347,19 +2348,24 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
|
|
|
2347
2348
|
return this.isDefaultValueByObj(undefined, value);
|
|
2348
2349
|
};
|
|
2349
2350
|
JsonObjectProperty.prototype.isDefaultValueByObj = function (obj, value) {
|
|
2351
|
+
if (this.isLocalizable)
|
|
2352
|
+
return value === null || value === undefined;
|
|
2350
2353
|
var dValue = this.getDefaultValue(obj);
|
|
2351
2354
|
if (!helpers_Helpers.isValueEmpty(dValue)) {
|
|
2352
2355
|
return helpers_Helpers.isTwoValueEquals(value, dValue, false, true, false);
|
|
2353
2356
|
}
|
|
2354
|
-
if (this.isLocalizable)
|
|
2355
|
-
return value === null || value === undefined;
|
|
2356
2357
|
return ((value === false && (this.type == "boolean" || this.type == "switch") && !this.defaultValueFunc) ||
|
|
2357
2358
|
value === "" || helpers_Helpers.isValueEmpty(value));
|
|
2358
2359
|
};
|
|
2359
|
-
JsonObjectProperty.prototype.getSerializableValue = function (obj) {
|
|
2360
|
+
JsonObjectProperty.prototype.getSerializableValue = function (obj, storeDefaults) {
|
|
2360
2361
|
if (!!this.onSerializeValue)
|
|
2361
2362
|
return this.onSerializeValue(obj);
|
|
2362
|
-
|
|
2363
|
+
var value = this.getValue(obj);
|
|
2364
|
+
if (value === undefined || value === null)
|
|
2365
|
+
return undefined;
|
|
2366
|
+
if (!storeDefaults && this.isDefaultValueByObj(obj, value))
|
|
2367
|
+
return undefined;
|
|
2368
|
+
return value;
|
|
2363
2369
|
};
|
|
2364
2370
|
JsonObjectProperty.prototype.getValue = function (obj) {
|
|
2365
2371
|
if (this.onGetValue) {
|
|
@@ -2397,7 +2403,7 @@ var jsonobject_JsonObjectProperty = /** @class */ (function () {
|
|
|
2397
2403
|
}
|
|
2398
2404
|
else {
|
|
2399
2405
|
if (this.serializationProperty && !!obj[this.serializationProperty])
|
|
2400
|
-
obj[this.serializationProperty].setJson(value);
|
|
2406
|
+
obj[this.serializationProperty].setJson(value, true);
|
|
2401
2407
|
else {
|
|
2402
2408
|
if (value && typeof value === "string") {
|
|
2403
2409
|
if (this.type == "number") {
|
|
@@ -3141,7 +3147,7 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
3141
3147
|
if (obj[name] === val)
|
|
3142
3148
|
return;
|
|
3143
3149
|
if (!!obj[name] && !!obj[name].setJson) {
|
|
3144
|
-
obj[name].setJson(val);
|
|
3150
|
+
obj[name].setJson(val, true);
|
|
3145
3151
|
}
|
|
3146
3152
|
else {
|
|
3147
3153
|
if (Array.isArray(val)) {
|
|
@@ -3904,8 +3910,8 @@ var jsonobject_JsonObject = /** @class */ (function () {
|
|
|
3904
3910
|
this.valueToJsonCore(obj, result, serProp, options);
|
|
3905
3911
|
return;
|
|
3906
3912
|
}
|
|
3907
|
-
var value = prop.getSerializableValue(obj);
|
|
3908
|
-
if (
|
|
3913
|
+
var value = prop.getSerializableValue(obj, options.storeDefaults);
|
|
3914
|
+
if (value === undefined)
|
|
3909
3915
|
return;
|
|
3910
3916
|
if (this.isValueArray(value)) {
|
|
3911
3917
|
var arrValue = [];
|
|
@@ -4128,6 +4134,7 @@ var conditionProcessValue_ProcessValue = /** @class */ (function () {
|
|
|
4128
4134
|
function ProcessValue() {
|
|
4129
4135
|
this.values = null;
|
|
4130
4136
|
this.properties = null;
|
|
4137
|
+
this.asyncValues = {};
|
|
4131
4138
|
}
|
|
4132
4139
|
ProcessValue.prototype.getFirstName = function (text, obj) {
|
|
4133
4140
|
if (obj === void 0) { obj = null; }
|
|
@@ -4887,10 +4894,15 @@ var expressions_extends = (undefined && undefined.__extends) || (function () {
|
|
|
4887
4894
|
|
|
4888
4895
|
|
|
4889
4896
|
|
|
4890
|
-
|
|
4891
4897
|
var Operand = /** @class */ (function () {
|
|
4892
4898
|
function Operand() {
|
|
4899
|
+
this._id = Operand.counter++;
|
|
4893
4900
|
}
|
|
4901
|
+
Object.defineProperty(Operand.prototype, "id", {
|
|
4902
|
+
get: function () { return this._id; },
|
|
4903
|
+
enumerable: false,
|
|
4904
|
+
configurable: true
|
|
4905
|
+
});
|
|
4894
4906
|
Operand.prototype.toString = function (func) {
|
|
4895
4907
|
if (func === void 0) { func = undefined; }
|
|
4896
4908
|
return "";
|
|
@@ -4906,6 +4918,7 @@ var Operand = /** @class */ (function () {
|
|
|
4906
4918
|
Operand.prototype.areOperatorsEquals = function (op1, op2) {
|
|
4907
4919
|
return !op1 && !op2 || !!op1 && op1.isEqual(op2);
|
|
4908
4920
|
};
|
|
4921
|
+
Operand.counter = 1;
|
|
4909
4922
|
return Operand;
|
|
4910
4923
|
}());
|
|
4911
4924
|
|
|
@@ -5298,7 +5311,6 @@ var expressions_FunctionOperand = /** @class */ (function (_super) {
|
|
|
5298
5311
|
var _this = _super.call(this) || this;
|
|
5299
5312
|
_this.originalValue = originalValue;
|
|
5300
5313
|
_this.parameters = parameters;
|
|
5301
|
-
_this.isReadyValue = false;
|
|
5302
5314
|
if (Array.isArray(parameters) && parameters.length === 0) {
|
|
5303
5315
|
_this.parameters = new ArrayOperand([]);
|
|
5304
5316
|
}
|
|
@@ -5307,26 +5319,26 @@ var expressions_FunctionOperand = /** @class */ (function (_super) {
|
|
|
5307
5319
|
FunctionOperand.prototype.getType = function () {
|
|
5308
5320
|
return "function";
|
|
5309
5321
|
};
|
|
5310
|
-
FunctionOperand.prototype.evaluateAsync = function (processValue) {
|
|
5311
|
-
var _this = this;
|
|
5312
|
-
this.isReadyValue = false;
|
|
5313
|
-
var asyncProcessValue = new conditionProcessValue_ProcessValue();
|
|
5314
|
-
asyncProcessValue.values = helpers_Helpers.createCopy(processValue.values);
|
|
5315
|
-
asyncProcessValue.properties = helpers_Helpers.createCopy(processValue.properties);
|
|
5316
|
-
asyncProcessValue.properties.returnResult = function (result) {
|
|
5317
|
-
_this.asynResult = result;
|
|
5318
|
-
_this.isReadyValue = true;
|
|
5319
|
-
_this.onAsyncReady();
|
|
5320
|
-
};
|
|
5321
|
-
this.evaluateCore(asyncProcessValue);
|
|
5322
|
-
};
|
|
5323
5322
|
FunctionOperand.prototype.evaluate = function (processValue) {
|
|
5324
|
-
|
|
5325
|
-
|
|
5323
|
+
var asyncVal = this.getAsynValue(processValue);
|
|
5324
|
+
if (!!asyncVal)
|
|
5325
|
+
return asyncVal.value;
|
|
5326
5326
|
return this.evaluateCore(processValue);
|
|
5327
5327
|
};
|
|
5328
5328
|
FunctionOperand.prototype.evaluateCore = function (processValue) {
|
|
5329
|
-
|
|
5329
|
+
var properties = processValue.properties;
|
|
5330
|
+
if (this.isAsyncFunction) {
|
|
5331
|
+
properties = helpers_Helpers.createCopy(processValue.properties);
|
|
5332
|
+
var id_1 = this.id;
|
|
5333
|
+
var asyncValues_1 = processValue.asyncValues;
|
|
5334
|
+
var onComplete_1 = processValue.onCompleteAsyncFunc;
|
|
5335
|
+
var item_1 = this;
|
|
5336
|
+
properties.returnResult = function (result) {
|
|
5337
|
+
asyncValues_1[id_1] = { value: result };
|
|
5338
|
+
onComplete_1(item_1);
|
|
5339
|
+
};
|
|
5340
|
+
}
|
|
5341
|
+
return functionsfactory_FunctionFactory.Instance.run(this.originalValue, this.parameters.evaluate(processValue), properties, this.parameters.values);
|
|
5330
5342
|
};
|
|
5331
5343
|
FunctionOperand.prototype.toString = function (func) {
|
|
5332
5344
|
if (func === void 0) { func = undefined; }
|
|
@@ -5340,16 +5352,13 @@ var expressions_FunctionOperand = /** @class */ (function (_super) {
|
|
|
5340
5352
|
FunctionOperand.prototype.setVariables = function (variables) {
|
|
5341
5353
|
this.parameters.setVariables(variables);
|
|
5342
5354
|
};
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
configurable: true
|
|
5349
|
-
});
|
|
5350
|
-
FunctionOperand.prototype.hasFunction = function () {
|
|
5351
|
-
return true;
|
|
5355
|
+
FunctionOperand.prototype.isReady = function (proccessValue) {
|
|
5356
|
+
return !!this.getAsynValue(proccessValue);
|
|
5357
|
+
};
|
|
5358
|
+
FunctionOperand.prototype.getAsynValue = function (proccessValue) {
|
|
5359
|
+
return proccessValue.asyncValues[this.id];
|
|
5352
5360
|
};
|
|
5361
|
+
FunctionOperand.prototype.hasFunction = function () { return true; };
|
|
5353
5362
|
FunctionOperand.prototype.hasAsyncFunction = function () {
|
|
5354
5363
|
return this.isAsyncFunction() || this.parameters.hasAsyncFunction();
|
|
5355
5364
|
};
|
|
@@ -8684,9 +8693,100 @@ var conditions_extends = (undefined && undefined.__extends) || (function () {
|
|
|
8684
8693
|
|
|
8685
8694
|
|
|
8686
8695
|
|
|
8696
|
+
|
|
8697
|
+
var conditions_ExpressionExecutorRunner = /** @class */ (function () {
|
|
8698
|
+
function ExpressionExecutorRunner(operand, id, onComplete, values, properties) {
|
|
8699
|
+
this.operand = operand;
|
|
8700
|
+
this.id = id;
|
|
8701
|
+
this.onComplete = onComplete;
|
|
8702
|
+
this.processValue = new conditionProcessValue_ProcessValue();
|
|
8703
|
+
this.processValue.values = values;
|
|
8704
|
+
this.processValue.properties = properties;
|
|
8705
|
+
}
|
|
8706
|
+
ExpressionExecutorRunner.prototype.run = function (isAsync) {
|
|
8707
|
+
var _this = this;
|
|
8708
|
+
if (!isAsync)
|
|
8709
|
+
return this.runValues();
|
|
8710
|
+
this.processValue.values = helpers_Helpers.createCopy(this.processValue.values);
|
|
8711
|
+
this.processValue.onCompleteAsyncFunc = function (op) {
|
|
8712
|
+
var item = _this.getAsyncItemByOperand(op, _this.asyncFuncList);
|
|
8713
|
+
if (item) {
|
|
8714
|
+
_this.doAsyncFunctionReady(item);
|
|
8715
|
+
}
|
|
8716
|
+
};
|
|
8717
|
+
this.asyncFuncList = new Array();
|
|
8718
|
+
this.operand.addToAsyncList(this.asyncFuncList);
|
|
8719
|
+
for (var i = 0; i < this.asyncFuncList.length; i++) {
|
|
8720
|
+
this.runAsyncItem(this.asyncFuncList[i]);
|
|
8721
|
+
}
|
|
8722
|
+
return false;
|
|
8723
|
+
};
|
|
8724
|
+
ExpressionExecutorRunner.prototype.getAsyncItemByOperand = function (op, list) {
|
|
8725
|
+
if (!Array.isArray(list))
|
|
8726
|
+
return null;
|
|
8727
|
+
for (var i = 0; i < list.length; i++) {
|
|
8728
|
+
if (list[i].operand === op)
|
|
8729
|
+
return list[i];
|
|
8730
|
+
var res = this.getAsyncItemByOperand(op, list[i].children);
|
|
8731
|
+
if (!!res)
|
|
8732
|
+
return res;
|
|
8733
|
+
}
|
|
8734
|
+
return null;
|
|
8735
|
+
};
|
|
8736
|
+
ExpressionExecutorRunner.prototype.runAsyncItem = function (item) {
|
|
8737
|
+
var _this = this;
|
|
8738
|
+
if (item.children) {
|
|
8739
|
+
item.children.forEach(function (child) { return _this.runAsyncItem(child); });
|
|
8740
|
+
}
|
|
8741
|
+
else {
|
|
8742
|
+
this.runAsyncItemCore(item);
|
|
8743
|
+
}
|
|
8744
|
+
};
|
|
8745
|
+
ExpressionExecutorRunner.prototype.runAsyncItemCore = function (item) {
|
|
8746
|
+
if (item.operand) {
|
|
8747
|
+
item.operand.evaluate(this.processValue);
|
|
8748
|
+
}
|
|
8749
|
+
else {
|
|
8750
|
+
this.doAsyncFunctionReady(item);
|
|
8751
|
+
}
|
|
8752
|
+
};
|
|
8753
|
+
ExpressionExecutorRunner.prototype.doAsyncFunctionReady = function (item) {
|
|
8754
|
+
if (item.parent && this.isAsyncChildrenReady(item)) {
|
|
8755
|
+
this.runAsyncItemCore(item.parent);
|
|
8756
|
+
return;
|
|
8757
|
+
}
|
|
8758
|
+
for (var i = 0; i < this.asyncFuncList.length; i++) {
|
|
8759
|
+
if (!this.isAsyncFuncReady(this.asyncFuncList[i]))
|
|
8760
|
+
return;
|
|
8761
|
+
}
|
|
8762
|
+
this.runValues();
|
|
8763
|
+
};
|
|
8764
|
+
ExpressionExecutorRunner.prototype.isAsyncFuncReady = function (item) {
|
|
8765
|
+
if (item.operand && !item.operand.isReady(this.processValue))
|
|
8766
|
+
return false;
|
|
8767
|
+
return this.isAsyncChildrenReady(item);
|
|
8768
|
+
};
|
|
8769
|
+
ExpressionExecutorRunner.prototype.isAsyncChildrenReady = function (item) {
|
|
8770
|
+
if (item.children) {
|
|
8771
|
+
for (var i = 0; i < item.children.length; i++) {
|
|
8772
|
+
if (!this.isAsyncFuncReady(item.children[i]))
|
|
8773
|
+
return false;
|
|
8774
|
+
}
|
|
8775
|
+
}
|
|
8776
|
+
return true;
|
|
8777
|
+
};
|
|
8778
|
+
ExpressionExecutorRunner.prototype.runValues = function () {
|
|
8779
|
+
var res = this.operand.evaluate(this.processValue);
|
|
8780
|
+
if (!!this.onComplete) {
|
|
8781
|
+
this.onComplete(res, this.id);
|
|
8782
|
+
}
|
|
8783
|
+
return res;
|
|
8784
|
+
};
|
|
8785
|
+
return ExpressionExecutorRunner;
|
|
8786
|
+
}());
|
|
8787
|
+
|
|
8687
8788
|
var conditions_ExpressionExecutor = /** @class */ (function () {
|
|
8688
8789
|
function ExpressionExecutor(expression) {
|
|
8689
|
-
this.processValue = new conditionProcessValue_ProcessValue();
|
|
8690
8790
|
this.parser = new conditionsParser_ConditionsParser();
|
|
8691
8791
|
this.isAsyncValue = false;
|
|
8692
8792
|
this.hasFunctionValue = false;
|
|
@@ -8729,7 +8829,7 @@ var conditions_ExpressionExecutor = /** @class */ (function () {
|
|
|
8729
8829
|
ExpressionExecutor.prototype.canRun = function () {
|
|
8730
8830
|
return !!this.operand;
|
|
8731
8831
|
};
|
|
8732
|
-
ExpressionExecutor.prototype.run = function (values, properties) {
|
|
8832
|
+
ExpressionExecutor.prototype.run = function (values, properties, id) {
|
|
8733
8833
|
if (properties === void 0) { properties = null; }
|
|
8734
8834
|
if (!this.operand) {
|
|
8735
8835
|
if (!!this.expression) {
|
|
@@ -8737,67 +8837,8 @@ var conditions_ExpressionExecutor = /** @class */ (function () {
|
|
|
8737
8837
|
}
|
|
8738
8838
|
return null;
|
|
8739
8839
|
}
|
|
8740
|
-
this.
|
|
8741
|
-
this.
|
|
8742
|
-
if (!this.isAsync)
|
|
8743
|
-
return this.runValues();
|
|
8744
|
-
this.asyncFuncList = new Array();
|
|
8745
|
-
this.operand.addToAsyncList(this.asyncFuncList);
|
|
8746
|
-
for (var i = 0; i < this.asyncFuncList.length; i++) {
|
|
8747
|
-
this.runAsyncItem(this.asyncFuncList[i]);
|
|
8748
|
-
}
|
|
8749
|
-
return false;
|
|
8750
|
-
};
|
|
8751
|
-
ExpressionExecutor.prototype.runAsyncItem = function (item) {
|
|
8752
|
-
var _this = this;
|
|
8753
|
-
if (item.children) {
|
|
8754
|
-
item.children.forEach(function (child) { return _this.runAsyncItem(child); });
|
|
8755
|
-
}
|
|
8756
|
-
else {
|
|
8757
|
-
this.runAsyncItemCore(item);
|
|
8758
|
-
}
|
|
8759
|
-
};
|
|
8760
|
-
ExpressionExecutor.prototype.runAsyncItemCore = function (item) {
|
|
8761
|
-
var _this = this;
|
|
8762
|
-
if (item.operand) {
|
|
8763
|
-
item.operand.onAsyncReady = function () { return _this.doAsyncFunctionReady(item); };
|
|
8764
|
-
item.operand.evaluateAsync(this.processValue);
|
|
8765
|
-
}
|
|
8766
|
-
else {
|
|
8767
|
-
this.doAsyncFunctionReady(item);
|
|
8768
|
-
}
|
|
8769
|
-
};
|
|
8770
|
-
ExpressionExecutor.prototype.doAsyncFunctionReady = function (item) {
|
|
8771
|
-
if (item.parent && this.isAsyncChildrenReady(item)) {
|
|
8772
|
-
this.runAsyncItemCore(item.parent);
|
|
8773
|
-
return;
|
|
8774
|
-
}
|
|
8775
|
-
for (var i = 0; i < this.asyncFuncList.length; i++) {
|
|
8776
|
-
if (!this.isAsyncFuncReady(this.asyncFuncList[i]))
|
|
8777
|
-
return;
|
|
8778
|
-
}
|
|
8779
|
-
this.runValues();
|
|
8780
|
-
};
|
|
8781
|
-
ExpressionExecutor.prototype.isAsyncFuncReady = function (item) {
|
|
8782
|
-
if (item.operand && !item.operand.isReady)
|
|
8783
|
-
return false;
|
|
8784
|
-
return this.isAsyncChildrenReady(item);
|
|
8785
|
-
};
|
|
8786
|
-
ExpressionExecutor.prototype.isAsyncChildrenReady = function (item) {
|
|
8787
|
-
if (item.children) {
|
|
8788
|
-
for (var i = 0; i < item.children.length; i++) {
|
|
8789
|
-
if (!this.isAsyncFuncReady(item.children[i]))
|
|
8790
|
-
return false;
|
|
8791
|
-
}
|
|
8792
|
-
}
|
|
8793
|
-
return true;
|
|
8794
|
-
};
|
|
8795
|
-
ExpressionExecutor.prototype.runValues = function () {
|
|
8796
|
-
var res = this.operand.evaluate(this.processValue);
|
|
8797
|
-
if (!!this.onComplete) {
|
|
8798
|
-
this.onComplete(res);
|
|
8799
|
-
}
|
|
8800
|
-
return res;
|
|
8840
|
+
var runner = new conditions_ExpressionExecutorRunner(this.operand, id, this.onComplete, values, properties);
|
|
8841
|
+
return runner.run(this.isAsync);
|
|
8801
8842
|
};
|
|
8802
8843
|
ExpressionExecutor.createExpressionExecutor = function (expression) { return new ExpressionExecutor(expression); };
|
|
8803
8844
|
return ExpressionExecutor;
|
|
@@ -8805,14 +8846,8 @@ var conditions_ExpressionExecutor = /** @class */ (function () {
|
|
|
8805
8846
|
|
|
8806
8847
|
var ExpressionRunnerBase = /** @class */ (function () {
|
|
8807
8848
|
function ExpressionRunnerBase(expression) {
|
|
8808
|
-
this._id = ExpressionRunnerBase.IdCounter++;
|
|
8809
8849
|
this.expression = expression;
|
|
8810
8850
|
}
|
|
8811
|
-
Object.defineProperty(ExpressionRunnerBase.prototype, "id", {
|
|
8812
|
-
get: function () { return this._id; },
|
|
8813
|
-
enumerable: false,
|
|
8814
|
-
configurable: true
|
|
8815
|
-
});
|
|
8816
8851
|
Object.defineProperty(ExpressionRunnerBase.prototype, "expression", {
|
|
8817
8852
|
get: function () {
|
|
8818
8853
|
return !!this.expressionExecutor ? this.expressionExecutor.expression : "";
|
|
@@ -8822,7 +8857,7 @@ var ExpressionRunnerBase = /** @class */ (function () {
|
|
|
8822
8857
|
if (!!this.expressionExecutor && value === this.expression)
|
|
8823
8858
|
return;
|
|
8824
8859
|
this.expressionExecutor = conditions_ExpressionExecutor.createExpressionExecutor(value);
|
|
8825
|
-
this.expressionExecutor.onComplete = function (res) { _this.doOnComplete(res); };
|
|
8860
|
+
this.expressionExecutor.onComplete = function (res, id) { _this.doOnComplete(res, id); };
|
|
8826
8861
|
this.variables = undefined;
|
|
8827
8862
|
this.containsFunc = undefined;
|
|
8828
8863
|
},
|
|
@@ -8853,17 +8888,18 @@ var ExpressionRunnerBase = /** @class */ (function () {
|
|
|
8853
8888
|
};
|
|
8854
8889
|
ExpressionRunnerBase.prototype.runCore = function (values, properties) {
|
|
8855
8890
|
if (properties === void 0) { properties = null; }
|
|
8891
|
+
var id = ExpressionRunnerBase.IdRunnerCounter++;
|
|
8856
8892
|
if (this.onBeforeAsyncRun && this.isAsync) {
|
|
8857
|
-
this.onBeforeAsyncRun(
|
|
8893
|
+
this.onBeforeAsyncRun(id);
|
|
8858
8894
|
}
|
|
8859
|
-
return this.expressionExecutor.run(values, properties);
|
|
8895
|
+
return this.expressionExecutor.run(values, properties, id);
|
|
8860
8896
|
};
|
|
8861
|
-
ExpressionRunnerBase.prototype.doOnComplete = function (res) {
|
|
8897
|
+
ExpressionRunnerBase.prototype.doOnComplete = function (res, id) {
|
|
8862
8898
|
if (this.onAfterAsyncRun && this.isAsync) {
|
|
8863
|
-
this.onAfterAsyncRun(
|
|
8899
|
+
this.onAfterAsyncRun(id);
|
|
8864
8900
|
}
|
|
8865
8901
|
};
|
|
8866
|
-
ExpressionRunnerBase.
|
|
8902
|
+
ExpressionRunnerBase.IdRunnerCounter = 1;
|
|
8867
8903
|
return ExpressionRunnerBase;
|
|
8868
8904
|
}());
|
|
8869
8905
|
|
|
@@ -8876,10 +8912,10 @@ var ConditionRunner = /** @class */ (function (_super) {
|
|
|
8876
8912
|
if (properties === void 0) { properties = null; }
|
|
8877
8913
|
return this.runCore(values, properties) == true;
|
|
8878
8914
|
};
|
|
8879
|
-
ConditionRunner.prototype.doOnComplete = function (res) {
|
|
8915
|
+
ConditionRunner.prototype.doOnComplete = function (res, id) {
|
|
8880
8916
|
if (!!this.onRunComplete)
|
|
8881
8917
|
this.onRunComplete(res == true);
|
|
8882
|
-
_super.prototype.doOnComplete.call(this, res);
|
|
8918
|
+
_super.prototype.doOnComplete.call(this, res, id);
|
|
8883
8919
|
};
|
|
8884
8920
|
return ConditionRunner;
|
|
8885
8921
|
}(ExpressionRunnerBase));
|
|
@@ -8893,10 +8929,10 @@ var ExpressionRunner = /** @class */ (function (_super) {
|
|
|
8893
8929
|
if (properties === void 0) { properties = null; }
|
|
8894
8930
|
return this.runCore(values, properties);
|
|
8895
8931
|
};
|
|
8896
|
-
ExpressionRunner.prototype.doOnComplete = function (res) {
|
|
8932
|
+
ExpressionRunner.prototype.doOnComplete = function (res, id) {
|
|
8897
8933
|
if (!!this.onRunComplete)
|
|
8898
8934
|
this.onRunComplete(res);
|
|
8899
|
-
_super.prototype.doOnComplete.call(this, res);
|
|
8935
|
+
_super.prototype.doOnComplete.call(this, res, id);
|
|
8900
8936
|
};
|
|
8901
8937
|
return ExpressionRunner;
|
|
8902
8938
|
}(ExpressionRunnerBase));
|
|
@@ -9009,7 +9045,7 @@ var base_Bindings = /** @class */ (function () {
|
|
|
9009
9045
|
}
|
|
9010
9046
|
return res;
|
|
9011
9047
|
};
|
|
9012
|
-
Bindings.prototype.setJson = function (value) {
|
|
9048
|
+
Bindings.prototype.setJson = function (value, isLoading) {
|
|
9013
9049
|
var oldValue = this.getJson();
|
|
9014
9050
|
this.values = null;
|
|
9015
9051
|
if (!!value) {
|
|
@@ -9018,7 +9054,9 @@ var base_Bindings = /** @class */ (function () {
|
|
|
9018
9054
|
this.values[key] = value[key];
|
|
9019
9055
|
}
|
|
9020
9056
|
}
|
|
9021
|
-
|
|
9057
|
+
if (!isLoading) {
|
|
9058
|
+
this.onChangedJSON(oldValue);
|
|
9059
|
+
}
|
|
9022
9060
|
};
|
|
9023
9061
|
Bindings.prototype.fillProperties = function () {
|
|
9024
9062
|
if (this.properties !== null)
|
|
@@ -9674,7 +9712,7 @@ var base_Base = /** @class */ (function () {
|
|
|
9674
9712
|
};
|
|
9675
9713
|
Base.prototype.doBeforeAsynRun = function (id) {
|
|
9676
9714
|
if (!this.asynExpressionHash)
|
|
9677
|
-
this.asynExpressionHash =
|
|
9715
|
+
this.asynExpressionHash = {};
|
|
9678
9716
|
var isChanged = !this.isAsyncExpressionRunning;
|
|
9679
9717
|
this.asynExpressionHash[id] = true;
|
|
9680
9718
|
if (isChanged) {
|
|
@@ -9794,10 +9832,11 @@ var base_Base = /** @class */ (function () {
|
|
|
9794
9832
|
var _this = this;
|
|
9795
9833
|
if (useMarkDown === void 0) { useMarkDown = false; }
|
|
9796
9834
|
if (defaultStr === void 0) { defaultStr = false; }
|
|
9797
|
-
var
|
|
9835
|
+
var locName = undefined;
|
|
9798
9836
|
if (defaultStr) {
|
|
9799
|
-
|
|
9837
|
+
locName = defaultStr === true ? name : defaultStr;
|
|
9800
9838
|
}
|
|
9839
|
+
var locStr = new localizablestring_LocalizableString(owner, useMarkDown, name, locName);
|
|
9801
9840
|
locStr.onStrChanged = function (oldValue, newValue) {
|
|
9802
9841
|
_this.propertyValueChanged(name, oldValue, newValue);
|
|
9803
9842
|
};
|
|
@@ -12968,22 +13007,22 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
|
12968
13007
|
}
|
|
12969
13008
|
return null;
|
|
12970
13009
|
};
|
|
12971
|
-
SurveyElement.FocusElement = function (elementId) {
|
|
13010
|
+
SurveyElement.FocusElement = function (elementId, isTimeOut, containerEl) {
|
|
12972
13011
|
if (!elementId || !DomDocumentHelper.isAvailable())
|
|
12973
13012
|
return false;
|
|
12974
|
-
var res = SurveyElement.focusElementCore(elementId);
|
|
13013
|
+
var res = !isTimeOut ? SurveyElement.focusElementCore(elementId, containerEl) : false;
|
|
12975
13014
|
if (!res) {
|
|
12976
13015
|
setTimeout(function () {
|
|
12977
|
-
SurveyElement.focusElementCore(elementId);
|
|
12978
|
-
}, 10);
|
|
13016
|
+
SurveyElement.focusElementCore(elementId, containerEl);
|
|
13017
|
+
}, isTimeOut ? 100 : 10);
|
|
12979
13018
|
}
|
|
12980
13019
|
return res;
|
|
12981
13020
|
};
|
|
12982
|
-
SurveyElement.focusElementCore = function (elementId) {
|
|
13021
|
+
SurveyElement.focusElementCore = function (elementId, containerEl) {
|
|
12983
13022
|
var root = settings.environment.root;
|
|
12984
|
-
if (!root)
|
|
13023
|
+
if (!root && !containerEl)
|
|
12985
13024
|
return false;
|
|
12986
|
-
var el = root.getElementById(elementId);
|
|
13025
|
+
var el = containerEl ? containerEl.querySelector("#" + CSS.escape(elementId)) : root.getElementById(elementId);
|
|
12987
13026
|
// https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom
|
|
12988
13027
|
if (el && !el["disabled"] && el.style.display !== "none" && el.offsetParent !== null) {
|
|
12989
13028
|
SurveyElement.ScrollElementToViewCore(el, true, false);
|
|
@@ -14208,19 +14247,15 @@ var RenderingCompletedAwaiter = /** @class */ (function () {
|
|
|
14208
14247
|
* It uses in all objects where support for multi-languages and markdown is required.
|
|
14209
14248
|
*/
|
|
14210
14249
|
var localizablestring_LocalizableString = /** @class */ (function () {
|
|
14211
|
-
function LocalizableString(owner, useMarkdown, name) {
|
|
14250
|
+
function LocalizableString(owner, useMarkdown, name, locName) {
|
|
14212
14251
|
if (useMarkdown === void 0) { useMarkdown = false; }
|
|
14213
|
-
var _a;
|
|
14214
14252
|
this.owner = owner;
|
|
14215
14253
|
this.useMarkdown = useMarkdown;
|
|
14216
14254
|
this.name = name;
|
|
14217
14255
|
this.values = {};
|
|
14218
14256
|
this.htmlValues = {};
|
|
14219
|
-
this._allowLineBreaks = false;
|
|
14220
14257
|
this.onStringChanged = new EventBase();
|
|
14221
|
-
|
|
14222
|
-
this._allowLineBreaks = ((_a = Serializer.findProperty(owner.getType(), name)) === null || _a === void 0 ? void 0 : _a.type) == "text";
|
|
14223
|
-
}
|
|
14258
|
+
this._localizationName = locName;
|
|
14224
14259
|
this.onCreating();
|
|
14225
14260
|
}
|
|
14226
14261
|
Object.defineProperty(LocalizableString, "defaultLocale", {
|
|
@@ -14248,6 +14283,13 @@ var localizablestring_LocalizableString = /** @class */ (function () {
|
|
|
14248
14283
|
});
|
|
14249
14284
|
Object.defineProperty(LocalizableString.prototype, "allowLineBreaks", {
|
|
14250
14285
|
get: function () {
|
|
14286
|
+
var _a;
|
|
14287
|
+
if (this._allowLineBreaks === undefined) {
|
|
14288
|
+
this._allowLineBreaks = false;
|
|
14289
|
+
if (!!this.name && this.owner instanceof survey_element_SurveyElementCore) {
|
|
14290
|
+
this._allowLineBreaks = ((_a = Serializer.findProperty(this.owner.getType(), this.name)) === null || _a === void 0 ? void 0 : _a.type) == "text";
|
|
14291
|
+
}
|
|
14292
|
+
}
|
|
14251
14293
|
return this._allowLineBreaks;
|
|
14252
14294
|
},
|
|
14253
14295
|
enumerable: false,
|
|
@@ -14419,14 +14461,22 @@ var localizablestring_LocalizableString = /** @class */ (function () {
|
|
|
14419
14461
|
};
|
|
14420
14462
|
LocalizableString.prototype.setLocaleText = function (loc, value) {
|
|
14421
14463
|
loc = this.getValueLoc(loc);
|
|
14464
|
+
if (!!loc && value === undefined) {
|
|
14465
|
+
var oldValue_1 = this.getValue(loc);
|
|
14466
|
+
if (oldValue_1 !== undefined) {
|
|
14467
|
+
this.deleteValue(loc);
|
|
14468
|
+
this.fireStrChanged(loc, oldValue_1);
|
|
14469
|
+
}
|
|
14470
|
+
return;
|
|
14471
|
+
}
|
|
14422
14472
|
if (!this.storeDefaultText && this.isLocaleTextEqualsWithDefault(loc, value)) {
|
|
14423
14473
|
if (!this.isValueEmpty(value) || !!loc && loc !== this.defaultLoc)
|
|
14424
14474
|
return;
|
|
14425
14475
|
var dl = surveyLocalization.defaultLocale;
|
|
14426
|
-
var
|
|
14427
|
-
if (!!dl && !this.isValueEmpty(
|
|
14476
|
+
var oldValue_2 = this.getValue(dl);
|
|
14477
|
+
if (!!dl && !this.isValueEmpty(oldValue_2)) {
|
|
14428
14478
|
this.setValue(dl, value);
|
|
14429
|
-
this.fireStrChanged(dl,
|
|
14479
|
+
this.fireStrChanged(dl, oldValue_2);
|
|
14430
14480
|
}
|
|
14431
14481
|
return;
|
|
14432
14482
|
}
|
|
@@ -14525,24 +14575,35 @@ var localizablestring_LocalizableString = /** @class */ (function () {
|
|
|
14525
14575
|
}
|
|
14526
14576
|
return res;
|
|
14527
14577
|
};
|
|
14528
|
-
LocalizableString.prototype.setJson = function (value) {
|
|
14578
|
+
LocalizableString.prototype.setJson = function (value, isLoading) {
|
|
14529
14579
|
if (!!this.sharedData) {
|
|
14530
|
-
this.sharedData.setJson(value);
|
|
14580
|
+
this.sharedData.setJson(value, isLoading);
|
|
14531
14581
|
return;
|
|
14532
14582
|
}
|
|
14533
14583
|
this.values = {};
|
|
14534
14584
|
this.htmlValues = {};
|
|
14535
14585
|
if (value === null || value === undefined)
|
|
14536
14586
|
return;
|
|
14537
|
-
if (
|
|
14538
|
-
|
|
14587
|
+
if (isLoading) {
|
|
14588
|
+
if (typeof value === "string") {
|
|
14589
|
+
this.values[settings.defaultLocaleName] = value;
|
|
14590
|
+
}
|
|
14591
|
+
else {
|
|
14592
|
+
this.values = value;
|
|
14593
|
+
delete this.values["pos"];
|
|
14594
|
+
}
|
|
14539
14595
|
}
|
|
14540
14596
|
else {
|
|
14541
|
-
|
|
14542
|
-
this.setLocaleText(
|
|
14597
|
+
if (typeof value === "string") {
|
|
14598
|
+
this.setLocaleText(null, value);
|
|
14599
|
+
}
|
|
14600
|
+
else {
|
|
14601
|
+
for (var key in value) {
|
|
14602
|
+
this.setLocaleText(key, value[key]);
|
|
14603
|
+
}
|
|
14543
14604
|
}
|
|
14605
|
+
this.strChanged();
|
|
14544
14606
|
}
|
|
14545
|
-
this.strChanged();
|
|
14546
14607
|
};
|
|
14547
14608
|
Object.defineProperty(LocalizableString.prototype, "renderAs", {
|
|
14548
14609
|
get: function () {
|
|
@@ -16928,9 +16989,9 @@ var TextValidator = /** @class */ (function (_super) {
|
|
|
16928
16989
|
if (this.isValueEmpty(value))
|
|
16929
16990
|
return null;
|
|
16930
16991
|
if (!this.allowDigits) {
|
|
16931
|
-
var reg =
|
|
16932
|
-
if (
|
|
16933
|
-
return new ValidatorResult(null, this.createCustomError(
|
|
16992
|
+
var reg = /\d+$/;
|
|
16993
|
+
if (reg.test(value)) {
|
|
16994
|
+
return new ValidatorResult(null, this.createCustomError("textNoDigitsAllow"));
|
|
16934
16995
|
}
|
|
16935
16996
|
}
|
|
16936
16997
|
if (this.minLength > 0 && value.length < this.minLength) {
|
|
@@ -16942,6 +17003,8 @@ var TextValidator = /** @class */ (function (_super) {
|
|
|
16942
17003
|
return null;
|
|
16943
17004
|
};
|
|
16944
17005
|
TextValidator.prototype.getDefaultErrorText = function (name) {
|
|
17006
|
+
if (name === "textNoDigitsAllow")
|
|
17007
|
+
return this.getLocalizationString(name);
|
|
16945
17008
|
if (this.minLength > 0 && this.maxLength > 0)
|
|
16946
17009
|
return this.getLocalizationFormatString("textMinMaxLength", this.minLength, this.maxLength);
|
|
16947
17010
|
if (this.minLength > 0)
|
|
@@ -19177,8 +19240,10 @@ var question_Question = /** @class */ (function (_super) {
|
|
|
19177
19240
|
}
|
|
19178
19241
|
};
|
|
19179
19242
|
Question.prototype.focusInputElement = function (onError) {
|
|
19243
|
+
var _a;
|
|
19180
19244
|
var id = !onError ? this.getFirstInputElementId() : this.getFirstErrorInputElementId();
|
|
19181
|
-
|
|
19245
|
+
var surveyRoot = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.rootElement;
|
|
19246
|
+
if (survey_element_SurveyElement.FocusElement(id, false, surveyRoot)) {
|
|
19182
19247
|
this.fireCallback(this.focusCallback);
|
|
19183
19248
|
}
|
|
19184
19249
|
};
|
|
@@ -21267,10 +21332,10 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21267
21332
|
if (text)
|
|
21268
21333
|
_this.locText.text = text;
|
|
21269
21334
|
if (!!value && typeof value === "object") {
|
|
21270
|
-
_this.setData(value);
|
|
21335
|
+
_this.setData(value, true);
|
|
21271
21336
|
}
|
|
21272
21337
|
else {
|
|
21273
|
-
_this.value
|
|
21338
|
+
_this.setValue(value, true);
|
|
21274
21339
|
}
|
|
21275
21340
|
if (_this.getType() != "itemvalue") {
|
|
21276
21341
|
CustomPropertiesCollection.createProperties(_this);
|
|
@@ -21452,24 +21517,32 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21452
21517
|
return this.getPropertyValue("value");
|
|
21453
21518
|
},
|
|
21454
21519
|
set: function (newValue) {
|
|
21455
|
-
|
|
21456
|
-
if (!helpers_Helpers.isValueEmpty(newValue)) {
|
|
21457
|
-
var str = newValue.toString();
|
|
21458
|
-
var index = str.indexOf(settings.itemValueSeparator);
|
|
21459
|
-
if (index > -1) {
|
|
21460
|
-
newValue = str.slice(0, index);
|
|
21461
|
-
text = str.slice(index + 1);
|
|
21462
|
-
}
|
|
21463
|
-
}
|
|
21464
|
-
this.setPropertyValue("value", newValue);
|
|
21465
|
-
if (!!text) {
|
|
21466
|
-
this.text = text;
|
|
21467
|
-
}
|
|
21468
|
-
this.id = this.value;
|
|
21520
|
+
this.setValue(newValue, false);
|
|
21469
21521
|
},
|
|
21470
21522
|
enumerable: false,
|
|
21471
21523
|
configurable: true
|
|
21472
21524
|
});
|
|
21525
|
+
ItemValue.prototype.setValue = function (newValue, newItem) {
|
|
21526
|
+
var text = undefined;
|
|
21527
|
+
if (!helpers_Helpers.isValueEmpty(newValue)) {
|
|
21528
|
+
var str = newValue.toString();
|
|
21529
|
+
var index = str.indexOf(settings.itemValueSeparator);
|
|
21530
|
+
if (index > -1) {
|
|
21531
|
+
newValue = str.slice(0, index);
|
|
21532
|
+
text = str.slice(index + 1);
|
|
21533
|
+
}
|
|
21534
|
+
}
|
|
21535
|
+
if (newItem) {
|
|
21536
|
+
this.setPropertyValueDirectly("value", newValue);
|
|
21537
|
+
}
|
|
21538
|
+
else {
|
|
21539
|
+
this.setPropertyValue("value", newValue);
|
|
21540
|
+
}
|
|
21541
|
+
if (!!text) {
|
|
21542
|
+
this.text = text;
|
|
21543
|
+
}
|
|
21544
|
+
this.id = this.value;
|
|
21545
|
+
};
|
|
21473
21546
|
Object.defineProperty(ItemValue.prototype, "hasText", {
|
|
21474
21547
|
get: function () {
|
|
21475
21548
|
return this.locText.pureText ? true : false;
|
|
@@ -21549,7 +21622,7 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21549
21622
|
}
|
|
21550
21623
|
return res;
|
|
21551
21624
|
};
|
|
21552
|
-
ItemValue.prototype.setData = function (value) {
|
|
21625
|
+
ItemValue.prototype.setData = function (value, isNewItem) {
|
|
21553
21626
|
if (helpers_Helpers.isValueEmpty(value))
|
|
21554
21627
|
return;
|
|
21555
21628
|
if (typeof value.value === "undefined" && typeof value.text !== "undefined" && Object.keys(value).length === 1) {
|
|
@@ -21566,9 +21639,11 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21566
21639
|
new jsonobject_JsonObject().toObject(json, this);
|
|
21567
21640
|
}
|
|
21568
21641
|
else {
|
|
21569
|
-
this.value
|
|
21642
|
+
this.setValue(value, isNewItem);
|
|
21643
|
+
}
|
|
21644
|
+
if (!isNewItem) {
|
|
21645
|
+
this.locText.strChanged();
|
|
21570
21646
|
}
|
|
21571
|
-
this.locText.strChanged();
|
|
21572
21647
|
};
|
|
21573
21648
|
Object.defineProperty(ItemValue.prototype, "visibleIf", {
|
|
21574
21649
|
get: function () {
|
|
@@ -26665,6 +26740,15 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedRow = /** @cla
|
|
|
26665
26740
|
QuestionMatrixDropdownRenderedRow.prototype.getRootElement = function () {
|
|
26666
26741
|
return this.rootElement;
|
|
26667
26742
|
};
|
|
26743
|
+
QuestionMatrixDropdownRenderedRow.prototype.focusCell = function (cellIndex) {
|
|
26744
|
+
if (this.rootElement) {
|
|
26745
|
+
var inputElementSelector = ":scope td:nth-of-type(" + (cellIndex + 1) + ") input, :scope td:nth-of-type(" + (cellIndex + 1) + ") button";
|
|
26746
|
+
var inputElement = this.rootElement.querySelectorAll(inputElementSelector)[0];
|
|
26747
|
+
if (inputElement) {
|
|
26748
|
+
inputElement.focus();
|
|
26749
|
+
}
|
|
26750
|
+
}
|
|
26751
|
+
};
|
|
26668
26752
|
QuestionMatrixDropdownRenderedRow.counter = 1;
|
|
26669
26753
|
question_matrixdropdownrendered_decorate([
|
|
26670
26754
|
jsonobject_property({ defaultValue: false })
|
|
@@ -26910,7 +26994,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
26910
26994
|
return;
|
|
26911
26995
|
var rowIndex = this.getRenderedRowIndexByIndex(index);
|
|
26912
26996
|
this.rowsActions.splice(index, 0, this.buildRowActions(row));
|
|
26913
|
-
this.addHorizontalRow(this.rows, row,
|
|
26997
|
+
this.addHorizontalRow(this.rows, row, rowIndex);
|
|
26914
26998
|
this.updateShowTableAndAddRow();
|
|
26915
26999
|
};
|
|
26916
27000
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndexByIndex = function (index) {
|
|
@@ -26980,6 +27064,14 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
26980
27064
|
this.rows.splice(panelRowIndex, 1);
|
|
26981
27065
|
}
|
|
26982
27066
|
};
|
|
27067
|
+
QuestionMatrixDropdownRenderedTable.prototype.focusActionCell = function (row, actionCellIndex) {
|
|
27068
|
+
var row2Focus = this.rows[this.rows.length - 1];
|
|
27069
|
+
if (this.matrix.isColumnLayoutHorizontal) {
|
|
27070
|
+
var nextRenderedRowIndex = this.getRenderedRowIndex(row);
|
|
27071
|
+
row2Focus = this.rows[nextRenderedRowIndex];
|
|
27072
|
+
}
|
|
27073
|
+
row2Focus === null || row2Focus === void 0 ? void 0 : row2Focus.focusCell(actionCellIndex);
|
|
27074
|
+
};
|
|
26983
27075
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndex = function (row) {
|
|
26984
27076
|
for (var i = 0; i < this.rows.length; i++) {
|
|
26985
27077
|
if (this.rows[i].row == row)
|
|
@@ -27076,7 +27168,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27076
27168
|
else {
|
|
27077
27169
|
var editCell = this.createEditCell(cell);
|
|
27078
27170
|
if (cell.column) {
|
|
27079
|
-
this.
|
|
27171
|
+
this.setCellWidth(cell.column, editCell);
|
|
27080
27172
|
}
|
|
27081
27173
|
editCell.className = new CssClassBuilder().append(editCell.className)
|
|
27082
27174
|
.append(this.cssClasses.footerCell).toString();
|
|
@@ -27114,13 +27206,13 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27114
27206
|
var rows = this.matrix.visibleRows;
|
|
27115
27207
|
var renderedRows = [];
|
|
27116
27208
|
for (var i = 0; i < rows.length; i++) {
|
|
27117
|
-
this.addHorizontalRow(renderedRows, rows[i]
|
|
27209
|
+
this.addHorizontalRow(renderedRows, rows[i]);
|
|
27118
27210
|
}
|
|
27119
27211
|
return renderedRows;
|
|
27120
27212
|
};
|
|
27121
|
-
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row,
|
|
27213
|
+
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, index) {
|
|
27122
27214
|
if (index === void 0) { index = -1; }
|
|
27123
|
-
var renderedRow = this.createHorizontalRow(row
|
|
27215
|
+
var renderedRow = this.createHorizontalRow(row);
|
|
27124
27216
|
var errorRow = this.createErrorRow(renderedRow);
|
|
27125
27217
|
renderedRow.row = row;
|
|
27126
27218
|
if (index < 0) {
|
|
@@ -27300,7 +27392,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27300
27392
|
res.onAfterCreated();
|
|
27301
27393
|
return res;
|
|
27302
27394
|
};
|
|
27303
|
-
QuestionMatrixDropdownRenderedTable.prototype.createHorizontalRow = function (row
|
|
27395
|
+
QuestionMatrixDropdownRenderedTable.prototype.createHorizontalRow = function (row) {
|
|
27304
27396
|
var res = this.createRenderedRow(this.cssClasses);
|
|
27305
27397
|
if (this.isRowsDragAndDrop) {
|
|
27306
27398
|
var rowIndex = this.matrix.visibleRows.indexOf(row);
|
|
@@ -27311,7 +27403,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27311
27403
|
var renderedCell = this.createTextCell(row.locText);
|
|
27312
27404
|
renderedCell.row = row;
|
|
27313
27405
|
res.cells.push(renderedCell);
|
|
27314
|
-
this.
|
|
27406
|
+
this.setCellWidth(null, renderedCell);
|
|
27315
27407
|
renderedCell.className = new CssClassBuilder()
|
|
27316
27408
|
.append(renderedCell.className)
|
|
27317
27409
|
.append(this.cssClasses.rowTextCell)
|
|
@@ -27332,9 +27424,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27332
27424
|
}
|
|
27333
27425
|
var renderedCell = this.createEditCell(cell);
|
|
27334
27426
|
res.cells.push(renderedCell);
|
|
27335
|
-
|
|
27336
|
-
this.setHeaderCellWidth(cell.column, renderedCell);
|
|
27337
|
-
}
|
|
27427
|
+
this.setCellWidth(cell.column, renderedCell);
|
|
27338
27428
|
}
|
|
27339
27429
|
}
|
|
27340
27430
|
this.addRowActionsCell(row, res, "end");
|
|
@@ -27579,9 +27669,9 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27579
27669
|
return cell;
|
|
27580
27670
|
};
|
|
27581
27671
|
QuestionMatrixDropdownRenderedTable.prototype.setHeaderCell = function (column, cell) {
|
|
27582
|
-
this.
|
|
27672
|
+
this.setCellWidth(column, cell);
|
|
27583
27673
|
};
|
|
27584
|
-
QuestionMatrixDropdownRenderedTable.prototype.
|
|
27674
|
+
QuestionMatrixDropdownRenderedTable.prototype.setCellWidth = function (column, cell) {
|
|
27585
27675
|
cell.minWidth = column != null ? this.matrix.getColumnWidth(column) : this.matrix.getRowTitleWidth();
|
|
27586
27676
|
cell.width = column != null ? column.width : this.matrix.getRowTitleWidth();
|
|
27587
27677
|
};
|
|
@@ -29733,6 +29823,8 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
|
29733
29823
|
};
|
|
29734
29824
|
QuestionMatrixDropdownModelBase.prototype.onHidingContent = function () {
|
|
29735
29825
|
_super.prototype.onHidingContent.call(this);
|
|
29826
|
+
if (!this.generatedVisibleRows)
|
|
29827
|
+
return;
|
|
29736
29828
|
var questions = [];
|
|
29737
29829
|
this.collectNestedQuestions(questions, true);
|
|
29738
29830
|
questions.forEach(function (q) { return q.onHidingContent(); });
|
|
@@ -30437,6 +30529,20 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
|
30437
30529
|
QuestionMatrixDropdownModelBase.prototype.getRootCss = function () {
|
|
30438
30530
|
return new CssClassBuilder().append(_super.prototype.getRootCss.call(this)).append(this.cssClasses.rootScroll, this.horizontalScroll).toString();
|
|
30439
30531
|
};
|
|
30532
|
+
QuestionMatrixDropdownModelBase.prototype.afterRenderQuestionElement = function (el) {
|
|
30533
|
+
_super.prototype.afterRenderQuestionElement.call(this, el);
|
|
30534
|
+
this.setRootElement(el === null || el === void 0 ? void 0 : el.parentElement);
|
|
30535
|
+
};
|
|
30536
|
+
QuestionMatrixDropdownModelBase.prototype.beforeDestroyQuestionElement = function (el) {
|
|
30537
|
+
_super.prototype.beforeDestroyQuestionElement.call(this, el);
|
|
30538
|
+
this.setRootElement(undefined);
|
|
30539
|
+
};
|
|
30540
|
+
QuestionMatrixDropdownModelBase.prototype.setRootElement = function (val) {
|
|
30541
|
+
this.rootElement = val;
|
|
30542
|
+
};
|
|
30543
|
+
QuestionMatrixDropdownModelBase.prototype.getRootElement = function () {
|
|
30544
|
+
return this.rootElement;
|
|
30545
|
+
};
|
|
30440
30546
|
return QuestionMatrixDropdownModelBase;
|
|
30441
30547
|
}(martixBase_QuestionMatrixBaseModel));
|
|
30442
30548
|
|
|
@@ -31348,6 +31454,7 @@ var matrix_rows_extends = (undefined && undefined.__extends) || (function () {
|
|
|
31348
31454
|
})();
|
|
31349
31455
|
|
|
31350
31456
|
|
|
31457
|
+
|
|
31351
31458
|
var matrix_rows_DragDropMatrixRows = /** @class */ (function (_super) {
|
|
31352
31459
|
matrix_rows_extends(DragDropMatrixRows, _super);
|
|
31353
31460
|
function DragDropMatrixRows() {
|
|
@@ -31374,19 +31481,28 @@ var matrix_rows_DragDropMatrixRows = /** @class */ (function (_super) {
|
|
|
31374
31481
|
_body.style.userSelect = "none";
|
|
31375
31482
|
}
|
|
31376
31483
|
};
|
|
31484
|
+
Object.defineProperty(DragDropMatrixRows.prototype, "shortcutClass", {
|
|
31485
|
+
get: function () {
|
|
31486
|
+
return new CssClassBuilder()
|
|
31487
|
+
.append(this.parentElement.cssClasses.draggedRow)
|
|
31488
|
+
//.append(this.parentElement.cssClasses.dragShortcutMobileMod, IsMobile)
|
|
31489
|
+
.toString();
|
|
31490
|
+
},
|
|
31491
|
+
enumerable: false,
|
|
31492
|
+
configurable: true
|
|
31493
|
+
});
|
|
31377
31494
|
DragDropMatrixRows.prototype.createDraggedElementShortcut = function (text, draggedElementNode, event) {
|
|
31378
31495
|
var _this = this;
|
|
31379
31496
|
var draggedElementShortcut = DomDocumentHelper.createElement("div");
|
|
31380
31497
|
if (!draggedElementShortcut)
|
|
31381
31498
|
return;
|
|
31382
|
-
|
|
31383
|
-
draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n font-family: var(--sjs-font-family, var(--font-family, var(--sjs-default-font-family)));\n ";
|
|
31499
|
+
draggedElementShortcut.className = this.shortcutClass;
|
|
31384
31500
|
var isDeepClone = true;
|
|
31385
31501
|
if (!!draggedElementNode) {
|
|
31386
31502
|
var row = (draggedElementNode
|
|
31387
31503
|
.closest("[data-sv-drop-target-matrix-row]"));
|
|
31388
31504
|
var clone = (row.cloneNode(isDeepClone));
|
|
31389
|
-
clone.style.cssText = "\n
|
|
31505
|
+
clone.style.cssText = "\n width: " + row.offsetWidth + "px;\n ";
|
|
31390
31506
|
clone.classList.remove("sv-matrix__drag-drop--moveup");
|
|
31391
31507
|
clone.classList.remove("sv-matrix__drag-drop--movedown");
|
|
31392
31508
|
this.draggedElement.isDragDropMoveDown = false;
|
|
@@ -32218,14 +32334,41 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32218
32334
|
}
|
|
32219
32335
|
return res;
|
|
32220
32336
|
};
|
|
32337
|
+
QuestionMatrixDynamicModel.prototype.focusAddBUtton = function () {
|
|
32338
|
+
var rootElement = this.getRootElement();
|
|
32339
|
+
if (!!rootElement && !!this.cssClasses.buttonAdd) {
|
|
32340
|
+
var addButton = rootElement.querySelectorAll("." + this.cssClasses.buttonAdd)[0];
|
|
32341
|
+
addButton && addButton.focus();
|
|
32342
|
+
}
|
|
32343
|
+
};
|
|
32344
|
+
QuestionMatrixDynamicModel.prototype.getActionCellIndex = function (row) {
|
|
32345
|
+
var headerShift = this.showHeader ? 1 : 0;
|
|
32346
|
+
if (this.isColumnLayoutHorizontal) {
|
|
32347
|
+
return row.cells.length - 1 + headerShift;
|
|
32348
|
+
}
|
|
32349
|
+
return this.visibleRows.indexOf(row) + headerShift;
|
|
32350
|
+
};
|
|
32221
32351
|
QuestionMatrixDynamicModel.prototype.removeRowUI = function (value) {
|
|
32352
|
+
var _this = this;
|
|
32222
32353
|
if (!!value && !!value.rowName) {
|
|
32223
32354
|
var index = this.visibleRows.indexOf(value);
|
|
32224
32355
|
if (index < 0)
|
|
32225
32356
|
return;
|
|
32226
32357
|
value = index;
|
|
32227
32358
|
}
|
|
32228
|
-
this.removeRow(value)
|
|
32359
|
+
this.removeRow(value, undefined, function () {
|
|
32360
|
+
var rowCount = _this.visibleRows.length;
|
|
32361
|
+
var nextIndex = index >= rowCount ? rowCount - 1 : index;
|
|
32362
|
+
var nextRow = nextIndex > -1 ? _this.visibleRows[nextIndex] : undefined;
|
|
32363
|
+
setTimeout(function () {
|
|
32364
|
+
if (nextRow) {
|
|
32365
|
+
_this.renderedTable.focusActionCell(nextRow, _this.getActionCellIndex(nextRow));
|
|
32366
|
+
}
|
|
32367
|
+
else {
|
|
32368
|
+
_this.focusAddBUtton();
|
|
32369
|
+
}
|
|
32370
|
+
}, 10);
|
|
32371
|
+
});
|
|
32229
32372
|
};
|
|
32230
32373
|
QuestionMatrixDynamicModel.prototype.isRequireConfirmOnRowDelete = function (index) {
|
|
32231
32374
|
if (!this.confirmDelete)
|
|
@@ -32244,7 +32387,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32244
32387
|
* @param index A zero-based row index.
|
|
32245
32388
|
* @param confirmDelete *(Optional)* A Boolean value that specifies whether to display a confirmation dialog. If you do not specify this parameter, the [`confirmDelete`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model#confirmDelete) property value is used.
|
|
32246
32389
|
*/
|
|
32247
|
-
QuestionMatrixDynamicModel.prototype.removeRow = function (index, confirmDelete) {
|
|
32390
|
+
QuestionMatrixDynamicModel.prototype.removeRow = function (index, confirmDelete, onRowRemoved) {
|
|
32248
32391
|
var _this = this;
|
|
32249
32392
|
if (!this.canRemoveRows)
|
|
32250
32393
|
return;
|
|
@@ -32257,10 +32400,14 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32257
32400
|
confirmDelete = this.isRequireConfirmOnRowDelete(index);
|
|
32258
32401
|
}
|
|
32259
32402
|
if (confirmDelete) {
|
|
32260
|
-
confirmActionAsync(this.confirmDeleteText, function () {
|
|
32403
|
+
confirmActionAsync(this.confirmDeleteText, function () {
|
|
32404
|
+
_this.removeRowAsync(index, row);
|
|
32405
|
+
onRowRemoved && onRowRemoved();
|
|
32406
|
+
}, undefined, this.getLocale(), this.survey.rootElement);
|
|
32261
32407
|
return;
|
|
32262
32408
|
}
|
|
32263
32409
|
this.removeRowAsync(index, row);
|
|
32410
|
+
onRowRemoved && onRowRemoved();
|
|
32264
32411
|
};
|
|
32265
32412
|
QuestionMatrixDynamicModel.prototype.removeRowAsync = function (index, row) {
|
|
32266
32413
|
if (!!row && !!this.survey && !this.survey.matrixRowRemoving(this, index, row))
|
|
@@ -33282,7 +33429,7 @@ var defaultV2Css = {
|
|
|
33282
33429
|
actionsCellDrag: "sd-table__cell--drag",
|
|
33283
33430
|
emptyCell: "sd-table__cell--empty",
|
|
33284
33431
|
verticalCell: "sd-table__cell--vertical",
|
|
33285
|
-
cellQuestionWrapper: "sd-table__question-wrapper",
|
|
33432
|
+
cellQuestionWrapper: "sd-matrix__question-wrapper sd-table__question-wrapper",
|
|
33286
33433
|
compact: "sd-element--with-frame sd-element--compact"
|
|
33287
33434
|
},
|
|
33288
33435
|
matrixdynamic: {
|
|
@@ -33335,9 +33482,10 @@ var defaultV2Css = {
|
|
|
33335
33482
|
emptyRowsSection: "sd-matrixdynamic__placeholder sd-question__placeholder",
|
|
33336
33483
|
iconDrag: "sv-matrixdynamic__drag-icon",
|
|
33337
33484
|
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
33485
|
+
draggedRow: "sv-matrixdynamic-dragged-row",
|
|
33338
33486
|
emptyCell: "sd-table__cell--empty",
|
|
33339
33487
|
verticalCell: "sd-table__cell--vertical",
|
|
33340
|
-
cellQuestionWrapper: "sd-table__question-wrapper",
|
|
33488
|
+
cellQuestionWrapper: "sd-matrix__question-wrapper sd-table__question-wrapper",
|
|
33341
33489
|
errorsCell: "sd-table__cell--error",
|
|
33342
33490
|
errorsCellTop: "sd-table__cell--error-top",
|
|
33343
33491
|
errorsCellBottom: "sd-table__cell--error-bottom",
|
|
@@ -37956,7 +38104,10 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
|
37956
38104
|
});
|
|
37957
38105
|
Object.defineProperty(PageModel.prototype, "no", {
|
|
37958
38106
|
get: function () {
|
|
37959
|
-
|
|
38107
|
+
if (!this.canShowPageNumber() || !this.survey)
|
|
38108
|
+
return "";
|
|
38109
|
+
var no = this.isStartPage ? "" : this.num + ". ";
|
|
38110
|
+
return this.survey.getUpdatedPageNo(this, no);
|
|
37960
38111
|
},
|
|
37961
38112
|
enumerable: false,
|
|
37962
38113
|
configurable: true
|
|
@@ -39022,7 +39173,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39022
39173
|
*
|
|
39023
39174
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
39024
39175
|
*
|
|
39025
|
-
* If you want to modify question numbers, handle the [`
|
|
39176
|
+
* If you want to modify question numbers, handle the [`onGetQuestionNumber`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetQuestionNumber) event.
|
|
39026
39177
|
* @see requiredText
|
|
39027
39178
|
*/
|
|
39028
39179
|
_this.onGetQuestionTitle = _this.addEvent();
|
|
@@ -39035,7 +39186,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39035
39186
|
*
|
|
39036
39187
|
* [View Demo](https://surveyjs.io/form-library/examples/survey-titletagnames/ (linkStyle))
|
|
39037
39188
|
* @see onGetQuestionTitle
|
|
39038
|
-
* @see
|
|
39189
|
+
* @see onGetQuestionNumber
|
|
39039
39190
|
*/
|
|
39040
39191
|
_this.onGetTitleTagName = _this.addEvent();
|
|
39041
39192
|
/**
|
|
@@ -39047,7 +39198,21 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39047
39198
|
* @see onGetQuestionTitle
|
|
39048
39199
|
* @see questionStartIndex
|
|
39049
39200
|
*/
|
|
39050
|
-
_this.
|
|
39201
|
+
_this.onGetQuestionNumber = _this.addEvent();
|
|
39202
|
+
/**
|
|
39203
|
+
* This event is obsolete. Use the [`onGetQuestionNumber`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetQuestionNumber) event instead.
|
|
39204
|
+
*/
|
|
39205
|
+
_this.onGetQuestionNo = _this.onGetQuestionNumber;
|
|
39206
|
+
/**
|
|
39207
|
+
* An event that is raised before the survey calculates a page number. Handle this event to modify page numbers.
|
|
39208
|
+
*
|
|
39209
|
+
* This event is raised only if the [`showPageNumbers`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showPageNumbers) property is enabled.
|
|
39210
|
+
*
|
|
39211
|
+
* For information on event handler parameters, refer to descriptions within the interface.
|
|
39212
|
+
* @see onGetQuestionTitle
|
|
39213
|
+
* @see questionStartIndex
|
|
39214
|
+
*/
|
|
39215
|
+
_this.onGetPageNumber = _this.addEvent();
|
|
39051
39216
|
/**
|
|
39052
39217
|
* An event that is raised before the survey displays progress text. Handle this event to change the progress text in code.
|
|
39053
39218
|
* @see showProgressBar
|
|
@@ -39581,7 +39746,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39581
39746
|
_this.updateBackgroundImageStyle();
|
|
39582
39747
|
});
|
|
39583
39748
|
_this.registerPropertyChangedHandlers(["showPrevButton", "showCompleteButton"], function () { _this.updateButtonsVisibility(); });
|
|
39584
|
-
_this.
|
|
39749
|
+
_this.onGetQuestionNumber.onCallbacksChanged = function () {
|
|
39585
39750
|
_this.resetVisibleIndexes();
|
|
39586
39751
|
};
|
|
39587
39752
|
_this.onProgressText.onCallbacksChanged = function () {
|
|
@@ -39853,7 +40018,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39853
40018
|
else {
|
|
39854
40019
|
this.cssValue = value;
|
|
39855
40020
|
}
|
|
39856
|
-
this.updateCss();
|
|
39857
40021
|
this.updateElementCss(false);
|
|
39858
40022
|
};
|
|
39859
40023
|
Object.defineProperty(SurveyModel.prototype, "cssTitle", {
|
|
@@ -40515,7 +40679,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
40515
40679
|
* - `"onValueChanged"` - Triggers validation each time a question value is changed.
|
|
40516
40680
|
* - `"onComplete"` - Triggers validation when a user clicks the Complete button. If previous pages contain errors, the survey switches to the page with the first error.
|
|
40517
40681
|
*
|
|
40518
|
-
* >
|
|
40682
|
+
* > In SurveyJS Form Library v1.12.5 and earlier, the `"onValueChanged"` mode doesn't work with date input fields because of the way browsers process date values. In most browsers, the value is considered changed as soon as a user starts entering the date in a text input field. This means that a user may only enter the day without having the chance to enter the month and year before validation is triggered. For this reason, date input fields are validated before the survey is switched to the next page or completed. Starting with v1.12.6, `"onValueChanged"` works for date input fields as well as for input fields of other types.
|
|
40519
40683
|
*
|
|
40520
40684
|
* Refer to the following help topic for more information: [Data Validation](https://surveyjs.io/form-library/documentation/data-validation).
|
|
40521
40685
|
* @see validationEnabled
|
|
@@ -41638,17 +41802,25 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
41638
41802
|
return options.title;
|
|
41639
41803
|
};
|
|
41640
41804
|
SurveyModel.prototype.getUpdatedQuestionNo = function (question, no) {
|
|
41641
|
-
if (this.
|
|
41805
|
+
if (this.onGetQuestionNumber.isEmpty)
|
|
41806
|
+
return no;
|
|
41807
|
+
var options = { question: question, number: no, no: no };
|
|
41808
|
+
this.onGetQuestionNumber.fire(this, options);
|
|
41809
|
+
return options.no === no ? options.number : options.no;
|
|
41810
|
+
};
|
|
41811
|
+
SurveyModel.prototype.getUpdatedPageNo = function (page, no) {
|
|
41812
|
+
if (this.onGetPageNumber.isEmpty)
|
|
41642
41813
|
return no;
|
|
41643
|
-
var options = {
|
|
41644
|
-
this.
|
|
41645
|
-
return options.
|
|
41814
|
+
var options = { page: page, number: no };
|
|
41815
|
+
this.onGetPageNumber.fire(this, options);
|
|
41816
|
+
return options.number;
|
|
41646
41817
|
};
|
|
41647
41818
|
Object.defineProperty(SurveyModel.prototype, "showPageNumbers", {
|
|
41648
41819
|
/**
|
|
41649
41820
|
* Specifies whether page titles contain page numbers.
|
|
41650
41821
|
*
|
|
41651
41822
|
* [View Demo](https://surveyjs.io/form-library/examples/how-to-number-pages-and-questions/ (linkStyle))
|
|
41823
|
+
* @see onGetPageNumber
|
|
41652
41824
|
*/
|
|
41653
41825
|
get: function () {
|
|
41654
41826
|
return this.getPropertyValue("showPageNumbers");
|
|
@@ -41675,6 +41847,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
41675
41847
|
* [View Demo](https://surveyjs.io/form-library/examples/how-to-number-pages-and-questions/ (linkStyle))
|
|
41676
41848
|
*
|
|
41677
41849
|
* If you want to hide the number of an individual question, enable its [`hideNumber`](https://surveyjs.io/form-library/documentation/api-reference/question#hideNumber) property.
|
|
41850
|
+
* @see onGetQuestionNumber
|
|
41678
41851
|
*/
|
|
41679
41852
|
get: function () {
|
|
41680
41853
|
return this.getPropertyValue("showQuestionNumbers");
|
|
@@ -46069,11 +46242,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
46069
46242
|
if (!!question.page) {
|
|
46070
46243
|
this.questionHashesAdded(question);
|
|
46071
46244
|
}
|
|
46072
|
-
if (!this.
|
|
46073
|
-
this.
|
|
46245
|
+
if (!this.isLoadingFromJson) {
|
|
46246
|
+
if (!this.currentPage) {
|
|
46247
|
+
this.updateCurrentPage();
|
|
46248
|
+
}
|
|
46249
|
+
this.updateVisibleIndexes();
|
|
46250
|
+
this.setCalculatedWidthModeUpdater();
|
|
46074
46251
|
}
|
|
46075
|
-
this.updateVisibleIndexes();
|
|
46076
|
-
this.setCalculatedWidthModeUpdater();
|
|
46077
46252
|
if (this.canFireAddElement()) {
|
|
46078
46253
|
this.onQuestionAdded.fire(this, {
|
|
46079
46254
|
question: question,
|
|
@@ -46456,6 +46631,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
46456
46631
|
});
|
|
46457
46632
|
SurveyModel.prototype.setCalculatedWidthModeUpdater = function () {
|
|
46458
46633
|
var _this = this;
|
|
46634
|
+
if (this.isLoadingFromJson)
|
|
46635
|
+
return;
|
|
46459
46636
|
if (this.calculatedWidthModeUpdater)
|
|
46460
46637
|
this.calculatedWidthModeUpdater.dispose();
|
|
46461
46638
|
this.calculatedWidthModeUpdater = new ComputedUpdater(function () { return _this.calculateWidthMode(); });
|
|
@@ -47005,7 +47182,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
47005
47182
|
}
|
|
47006
47183
|
}
|
|
47007
47184
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, this.progressBarComponentName)) {
|
|
47008
|
-
if (this.questionsOnPageMode != "singlePage") {
|
|
47185
|
+
if (this.questionsOnPageMode != "singlePage" || this.progressBarType == "questions") {
|
|
47009
47186
|
var headerLayoutElement = this.findLayoutElement("advanced-header");
|
|
47010
47187
|
var advHeader = headerLayoutElement && headerLayoutElement.data;
|
|
47011
47188
|
var isBelowHeader = !advHeader || advHeader.hasBackground;
|
|
@@ -49879,7 +50056,8 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
49879
50056
|
return !this.isDisabledAttr && item.isEnabled;
|
|
49880
50057
|
};
|
|
49881
50058
|
QuestionSelectBase.prototype.focusOtherComment = function () {
|
|
49882
|
-
|
|
50059
|
+
var _a;
|
|
50060
|
+
survey_element_SurveyElement.FocusElement(this.otherId, false, (_a = this.survey) === null || _a === void 0 ? void 0 : _a.rootElement);
|
|
49883
50061
|
};
|
|
49884
50062
|
QuestionSelectBase.prototype.onValueChanged = function () {
|
|
49885
50063
|
_super.prototype.onValueChanged.call(this);
|
|
@@ -49897,7 +50075,7 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
49897
50075
|
*
|
|
49898
50076
|
* [View Dropdown Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
|
|
49899
50077
|
*
|
|
49900
|
-
* [View Ranking Demo](https://surveyjs.io/form-library/examples/
|
|
50078
|
+
* [View Ranking Demo](https://surveyjs.io/form-library/examples/ranking-with-custom-items/ (linkStyle))
|
|
49901
50079
|
*/
|
|
49902
50080
|
get: function () {
|
|
49903
50081
|
return this.getPropertyValue("itemComponent", this.getDefaultItemComponent());
|
|
@@ -50865,7 +51043,7 @@ var popup_dropdown_view_model_PopupDropdownViewModel = /** @class */ (function (
|
|
|
50865
51043
|
var heightValues = [height, DomWindowHelper.getInnerHeight() * 0.9, (_c = DomWindowHelper.getVisualViewport()) === null || _c === void 0 ? void 0 : _c.height];
|
|
50866
51044
|
height = Math.ceil(Math.min.apply(Math, heightValues.filter(function (each) { return typeof each === "number"; })));
|
|
50867
51045
|
verticalPosition = PopupUtils.updateVerticalPosition(targetElementRect, height, this.model.horizontalPosition, this.model.verticalPosition, area.height);
|
|
50868
|
-
actualHorizontalPosition = PopupUtils.updateHorizontalPosition(targetElementRect, width,
|
|
51046
|
+
actualHorizontalPosition = PopupUtils.updateHorizontalPosition(targetElementRect, width, actualHorizontalPosition, area.width);
|
|
50869
51047
|
}
|
|
50870
51048
|
this.popupDirection = PopupUtils.calculatePopupDirection(verticalPosition, actualHorizontalPosition);
|
|
50871
51049
|
var pos = PopupUtils.calculatePosition(targetElementRect, height, width + marginLeft + marginRight, verticalPosition, actualHorizontalPosition, this.model.positionMode);
|
|
@@ -52530,7 +52708,7 @@ var question_matrix_MatrixCells = /** @class */ (function (_super) {
|
|
|
52530
52708
|
}
|
|
52531
52709
|
return res;
|
|
52532
52710
|
};
|
|
52533
|
-
MatrixCells.prototype.setJson = function (value) {
|
|
52711
|
+
MatrixCells.prototype.setJson = function (value, isLoading) {
|
|
52534
52712
|
var _this = this;
|
|
52535
52713
|
this.values = {};
|
|
52536
52714
|
if (!!value) {
|
|
@@ -54185,6 +54363,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
|
54185
54363
|
this.dateValidationMessage = this.isDateInputType && !!event.target ? event.target.validationMessage : undefined;
|
|
54186
54364
|
};
|
|
54187
54365
|
QuestionTextModel.prototype.onBlurCore = function (event) {
|
|
54366
|
+
this.updateDateValidationMessage(event);
|
|
54188
54367
|
this.updateValueOnEvent(event);
|
|
54189
54368
|
this.updateRemainingCharacterCounter(event.target.value);
|
|
54190
54369
|
_super.prototype.onBlurCore.call(this, event);
|
|
@@ -56248,6 +56427,22 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
|
56248
56427
|
}
|
|
56249
56428
|
return false;
|
|
56250
56429
|
};
|
|
56430
|
+
QuestionCheckboxModel.prototype.convertFuncValuetoQuestionValue = function (val) {
|
|
56431
|
+
var _this = this;
|
|
56432
|
+
if (!!this.valuePropertyName && Array.isArray(val) && val.length > 0) {
|
|
56433
|
+
var res_1 = [];
|
|
56434
|
+
val.forEach(function (item) {
|
|
56435
|
+
var isObj = typeof item === "object";
|
|
56436
|
+
var obj = isObj ? item : {};
|
|
56437
|
+
if (!isObj) {
|
|
56438
|
+
obj[_this.valuePropertyName] = item;
|
|
56439
|
+
}
|
|
56440
|
+
res_1.push(obj);
|
|
56441
|
+
});
|
|
56442
|
+
val = res_1;
|
|
56443
|
+
}
|
|
56444
|
+
return _super.prototype.convertDefaultValue.call(this, val);
|
|
56445
|
+
};
|
|
56251
56446
|
QuestionCheckboxModel.prototype.getRealValue = function (val) {
|
|
56252
56447
|
if (!val)
|
|
56253
56448
|
return val;
|
|
@@ -59378,10 +59573,19 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
|
|
|
59378
59573
|
QuestionFileModelBase.prototype.onChangeQuestionValue = function (newValue) {
|
|
59379
59574
|
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
|
59380
59575
|
this.stateChanged(this.isEmpty() ? "empty" : "loaded");
|
|
59381
|
-
if (!this.isLoadingFromJson) {
|
|
59382
|
-
this.loadPreview(newValue);
|
|
59383
|
-
}
|
|
59384
59576
|
};
|
|
59577
|
+
QuestionFileModelBase.prototype.getIsQuestionReady = function () {
|
|
59578
|
+
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
|
59579
|
+
};
|
|
59580
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "isFileLoading", {
|
|
59581
|
+
get: function () { return this.isFileLoadingValue; },
|
|
59582
|
+
set: function (val) {
|
|
59583
|
+
this.isFileLoadingValue = val;
|
|
59584
|
+
this.updateIsReady();
|
|
59585
|
+
},
|
|
59586
|
+
enumerable: false,
|
|
59587
|
+
configurable: true
|
|
59588
|
+
});
|
|
59385
59589
|
question_file_decorate([
|
|
59386
59590
|
jsonobject_property()
|
|
59387
59591
|
], QuestionFileModelBase.prototype, "isUploading", void 0);
|
|
@@ -59604,15 +59808,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
59604
59808
|
enumerable: false,
|
|
59605
59809
|
configurable: true
|
|
59606
59810
|
});
|
|
59607
|
-
Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
|
|
59608
|
-
get: function () { return this.isFileLoadingValue; },
|
|
59609
|
-
set: function (val) {
|
|
59610
|
-
this.isFileLoadingValue = val;
|
|
59611
|
-
this.updateIsReady();
|
|
59612
|
-
},
|
|
59613
|
-
enumerable: false,
|
|
59614
|
-
configurable: true
|
|
59615
|
-
});
|
|
59616
59811
|
Object.defineProperty(QuestionFileModel.prototype, "fileNavigatorVisible", {
|
|
59617
59812
|
get: function () {
|
|
59618
59813
|
var isUploading = this.isUploading;
|
|
@@ -59795,6 +59990,12 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
59795
59990
|
QuestionFileModel.prototype.getType = function () {
|
|
59796
59991
|
return "file";
|
|
59797
59992
|
};
|
|
59993
|
+
QuestionFileModel.prototype.onChangeQuestionValue = function (newValue) {
|
|
59994
|
+
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
|
59995
|
+
if (!this.isLoadingFromJson) {
|
|
59996
|
+
this.loadPreview(newValue);
|
|
59997
|
+
}
|
|
59998
|
+
};
|
|
59798
59999
|
Object.defineProperty(QuestionFileModel.prototype, "showPreview", {
|
|
59799
60000
|
/**
|
|
59800
60001
|
* Disable this property only to implement a custom preview.
|
|
@@ -60258,9 +60459,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
60258
60459
|
this._previewLoader.load(newValues);
|
|
60259
60460
|
}
|
|
60260
60461
|
};
|
|
60261
|
-
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
|
60262
|
-
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
|
60263
|
-
};
|
|
60264
60462
|
QuestionFileModel.prototype.allFilesOk = function (files) {
|
|
60265
60463
|
var _this = this;
|
|
60266
60464
|
var errorLength = this.errors ? this.errors.length : 0;
|
|
@@ -61005,8 +61203,8 @@ var question_rating_RenderedRatingItem = /** @class */ (function (_super) {
|
|
|
61005
61203
|
|
|
61006
61204
|
var RatingItemValue = /** @class */ (function (_super) {
|
|
61007
61205
|
question_rating_extends(RatingItemValue, _super);
|
|
61008
|
-
function RatingItemValue(value, description) {
|
|
61009
|
-
var _this = _super.call(this, value) || this;
|
|
61206
|
+
function RatingItemValue(value, text, description) {
|
|
61207
|
+
var _this = _super.call(this, value, text) || this;
|
|
61010
61208
|
_this.description = description;
|
|
61011
61209
|
return _this;
|
|
61012
61210
|
}
|
|
@@ -61372,7 +61570,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
|
61372
61570
|
if (value === this.rateMax || index === settings.ratingMaximumRateValueCount) {
|
|
61373
61571
|
description = this.maxRateDescription && this.locMaxRateDescription;
|
|
61374
61572
|
}
|
|
61375
|
-
var newItem = new RatingItemValue(value, description);
|
|
61573
|
+
var newItem = new RatingItemValue(value, item.text, description);
|
|
61376
61574
|
newItem.locOwner = item.locOwner;
|
|
61377
61575
|
newItem.ownerPropertyName = item.ownerPropertyName;
|
|
61378
61576
|
return newItem;
|
|
@@ -64071,9 +64269,11 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64071
64269
|
function QuestionSignaturePadModel(name) {
|
|
64072
64270
|
var _this = _super.call(this, name) || this;
|
|
64073
64271
|
_this.valueIsUpdatingInternally = false;
|
|
64272
|
+
_this._loadedData = undefined;
|
|
64074
64273
|
_this.updateValueHandler = function () {
|
|
64274
|
+
_this._loadedData = undefined;
|
|
64075
64275
|
_this.scaleCanvas(false, true);
|
|
64076
|
-
_this.
|
|
64276
|
+
_this.loadPreview(_this.value);
|
|
64077
64277
|
};
|
|
64078
64278
|
return _this;
|
|
64079
64279
|
}
|
|
@@ -64144,15 +64344,14 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64144
64344
|
this.signaturePad.minWidth = this.penMinWidth * scale;
|
|
64145
64345
|
this.signaturePad.maxWidth = this.penMaxWidth * scale;
|
|
64146
64346
|
canvas.getContext("2d").scale(1 / scale, 1 / scale);
|
|
64147
|
-
if (refresh)
|
|
64148
|
-
this.
|
|
64347
|
+
if (refresh) {
|
|
64348
|
+
this.loadPreview(this.value);
|
|
64349
|
+
}
|
|
64149
64350
|
}
|
|
64150
64351
|
};
|
|
64151
|
-
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
|
64152
|
-
this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
|
|
64153
|
-
};
|
|
64154
64352
|
QuestionSignaturePadModel.prototype.fromUrl = function (url) {
|
|
64155
64353
|
var _this = this;
|
|
64354
|
+
this.isFileLoading = true;
|
|
64156
64355
|
var img = new Image();
|
|
64157
64356
|
img.crossOrigin = "anonymous";
|
|
64158
64357
|
img.src = url;
|
|
@@ -64161,41 +64360,65 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64161
64360
|
ctx.drawImage(img, 0, 0);
|
|
64162
64361
|
var dataURL = _this.canvas.toDataURL(_this.getFormat());
|
|
64163
64362
|
_this.fromDataUrl(dataURL);
|
|
64363
|
+
_this.isFileLoading = false;
|
|
64164
64364
|
};
|
|
64165
64365
|
};
|
|
64166
|
-
QuestionSignaturePadModel.prototype.
|
|
64167
|
-
|
|
64168
|
-
|
|
64169
|
-
|
|
64170
|
-
|
|
64171
|
-
|
|
64366
|
+
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
|
64367
|
+
this._loadedData = data;
|
|
64368
|
+
if (this.signaturePad) {
|
|
64369
|
+
this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
|
|
64370
|
+
}
|
|
64371
|
+
};
|
|
64372
|
+
Object.defineProperty(QuestionSignaturePadModel.prototype, "loadedData", {
|
|
64373
|
+
get: function () {
|
|
64374
|
+
return this._loadedData;
|
|
64375
|
+
},
|
|
64376
|
+
enumerable: false,
|
|
64377
|
+
configurable: true
|
|
64378
|
+
});
|
|
64379
|
+
QuestionSignaturePadModel.prototype.loadPreview = function (newValue) {
|
|
64380
|
+
var _this = this;
|
|
64381
|
+
if (!newValue) {
|
|
64382
|
+
if (this.signaturePad && this.canvas) {
|
|
64383
|
+
this.canvas.getContext("2d").clearRect(0, 0, this.canvas.width * this.scale, this.canvas.height * this.scale);
|
|
64384
|
+
this.signaturePad.clear();
|
|
64385
|
+
}
|
|
64172
64386
|
this.valueWasChangedFromLastUpload = false;
|
|
64387
|
+
return;
|
|
64388
|
+
}
|
|
64389
|
+
if (this.storeDataAsText) {
|
|
64390
|
+
this.fromDataUrl(newValue);
|
|
64173
64391
|
}
|
|
64174
64392
|
else {
|
|
64175
|
-
if (this.
|
|
64176
|
-
this.fromDataUrl(this.
|
|
64393
|
+
if (this.loadedData) {
|
|
64394
|
+
this.fromDataUrl(this.loadedData);
|
|
64177
64395
|
}
|
|
64178
64396
|
else {
|
|
64179
|
-
|
|
64397
|
+
var newValues = !!newValue ? [newValue] : [];
|
|
64398
|
+
if (!!this._previewLoader) {
|
|
64399
|
+
this._previewLoader.dispose();
|
|
64400
|
+
}
|
|
64401
|
+
this.isFileLoading = true;
|
|
64402
|
+
this._previewLoader = new FileLoader(this, function (status, loaded) {
|
|
64403
|
+
if (status === "success" && loaded && loaded.length > 0 && loaded[0].content) {
|
|
64404
|
+
_this.fromDataUrl(loaded[0].content);
|
|
64405
|
+
}
|
|
64406
|
+
else if (status === "skipped") {
|
|
64407
|
+
_this.fromUrl(newValue);
|
|
64408
|
+
}
|
|
64409
|
+
_this.isFileLoading = false;
|
|
64410
|
+
_this._previewLoader.dispose();
|
|
64411
|
+
_this._previewLoader = undefined;
|
|
64412
|
+
});
|
|
64413
|
+
this._previewLoader.load(newValues);
|
|
64180
64414
|
}
|
|
64181
64415
|
}
|
|
64182
64416
|
};
|
|
64183
|
-
QuestionSignaturePadModel.prototype.
|
|
64184
|
-
|
|
64185
|
-
if (!this.
|
|
64186
|
-
|
|
64187
|
-
|
|
64188
|
-
this._previewLoader.dispose();
|
|
64189
|
-
}
|
|
64190
|
-
this.isFileLoading = true;
|
|
64191
|
-
this._previewLoader = new FileLoader(this, function (status, loaded) {
|
|
64192
|
-
_this.isFileLoading = false;
|
|
64193
|
-
if (loaded && loaded.length > 0 && loaded[0].content && status === "success")
|
|
64194
|
-
_this.fromDataUrl(loaded[0].content);
|
|
64195
|
-
_this._previewLoader.dispose();
|
|
64196
|
-
_this._previewLoader = undefined;
|
|
64197
|
-
});
|
|
64198
|
-
this._previewLoader.load(newValues);
|
|
64417
|
+
QuestionSignaturePadModel.prototype.onChangeQuestionValue = function (newValue) {
|
|
64418
|
+
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
|
64419
|
+
if (!this.isLoadingFromJson) {
|
|
64420
|
+
this._loadedData = undefined;
|
|
64421
|
+
this.loadPreview(newValue);
|
|
64199
64422
|
}
|
|
64200
64423
|
};
|
|
64201
64424
|
QuestionSignaturePadModel.prototype.onSurveyLoad = function () {
|
|
@@ -64238,7 +64461,7 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64238
64461
|
this.updateValueHandler();
|
|
64239
64462
|
this.readOnlyChangedCallback();
|
|
64240
64463
|
var propertyChangedHandler = function (sender, options) {
|
|
64241
|
-
if (options.name === "signatureWidth" || options.name === "signatureHeight"
|
|
64464
|
+
if (options.name === "signatureWidth" || options.name === "signatureHeight") {
|
|
64242
64465
|
if (!_this.valueIsUpdatingInternally)
|
|
64243
64466
|
_this.updateValueHandler();
|
|
64244
64467
|
}
|
|
@@ -64458,7 +64681,8 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64458
64681
|
QuestionSignaturePadModel.prototype.clearValue = function (keepComment) {
|
|
64459
64682
|
this.valueWasChangedFromLastUpload = false;
|
|
64460
64683
|
_super.prototype.clearValue.call(this, keepComment);
|
|
64461
|
-
this.
|
|
64684
|
+
this._loadedData = undefined;
|
|
64685
|
+
this.loadPreview(this.value);
|
|
64462
64686
|
};
|
|
64463
64687
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
|
64464
64688
|
_super.prototype.endLoadingFromJson.call(this);
|
|
@@ -66419,15 +66643,31 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
|
66419
66643
|
*/
|
|
66420
66644
|
QuestionPanelDynamicModel.prototype.removePanelUI = function (value) {
|
|
66421
66645
|
var _this = this;
|
|
66646
|
+
var visIndex = this.getVisualPanelIndex(value);
|
|
66647
|
+
if (visIndex < 0 || visIndex >= this.visiblePanelCount)
|
|
66648
|
+
return;
|
|
66422
66649
|
if (!this.canRemovePanel)
|
|
66423
66650
|
return;
|
|
66651
|
+
var removePanel = function () {
|
|
66652
|
+
var _a;
|
|
66653
|
+
_this.removePanel(visIndex);
|
|
66654
|
+
var pnlCount = _this.visiblePanelCount;
|
|
66655
|
+
var nextIndex = visIndex >= pnlCount ? pnlCount - 1 : visIndex;
|
|
66656
|
+
var id = pnlCount === 0 ? _this.addButtonId : (nextIndex > -1 ? _this.getPanelRemoveButtonId(_this.visiblePanels[nextIndex]) : "");
|
|
66657
|
+
if (!!id) {
|
|
66658
|
+
survey_element_SurveyElement.FocusElement(id, true, (_a = _this.survey) === null || _a === void 0 ? void 0 : _a.rootElement);
|
|
66659
|
+
}
|
|
66660
|
+
};
|
|
66424
66661
|
if (this.isRequireConfirmOnDelete(value)) {
|
|
66425
|
-
confirmActionAsync(this.confirmDeleteText, function () {
|
|
66662
|
+
confirmActionAsync(this.confirmDeleteText, function () { removePanel(); }, undefined, this.getLocale(), this.survey.rootElement);
|
|
66426
66663
|
}
|
|
66427
66664
|
else {
|
|
66428
|
-
|
|
66665
|
+
removePanel();
|
|
66429
66666
|
}
|
|
66430
66667
|
};
|
|
66668
|
+
QuestionPanelDynamicModel.prototype.getPanelRemoveButtonId = function (panel) {
|
|
66669
|
+
return panel.id + "_remove_button";
|
|
66670
|
+
};
|
|
66431
66671
|
QuestionPanelDynamicModel.prototype.isRequireConfirmOnDelete = function (val) {
|
|
66432
66672
|
if (!this.confirmDelete)
|
|
66433
66673
|
return false;
|
|
@@ -66647,7 +66887,6 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
|
66647
66887
|
if (!loc)
|
|
66648
66888
|
return;
|
|
66649
66889
|
loc.localizationName = (this.isReadOnly || !this.allowAddPanel) ? "noEntriesReadonlyText" : "noEntriesText";
|
|
66650
|
-
loc.strChanged();
|
|
66651
66890
|
};
|
|
66652
66891
|
QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
|
|
66653
66892
|
this.template.readOnly = this.isReadOnly;
|
|
@@ -66922,7 +67161,7 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
|
66922
67161
|
};
|
|
66923
67162
|
QuestionPanelDynamicModel.prototype.hasErrorInPanels = function (fireCallback, rec) {
|
|
66924
67163
|
var res = false;
|
|
66925
|
-
var panels = this.
|
|
67164
|
+
var panels = this.visiblePanels;
|
|
66926
67165
|
var keyValues = [];
|
|
66927
67166
|
for (var i = 0; i < panels.length; i++) {
|
|
66928
67167
|
this.setOnCompleteAsyncInPanel(panels[i]);
|
|
@@ -70570,8 +70809,8 @@ Serializer.addClass("currencymask", [
|
|
|
70570
70809
|
|
|
70571
70810
|
var Version;
|
|
70572
70811
|
var ReleaseDate;
|
|
70573
|
-
Version = "" + "1.12.
|
|
70574
|
-
ReleaseDate = "" + "2024-10-
|
|
70812
|
+
Version = "" + "1.12.8";
|
|
70813
|
+
ReleaseDate = "" + "2024-10-31";
|
|
70575
70814
|
function checkLibraryVersion(ver, libraryName) {
|
|
70576
70815
|
if (Version != ver) {
|
|
70577
70816
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
|
@@ -71351,7 +71590,7 @@ var defaultStandardCss = {
|
|
|
71351
71590
|
matrixdynamic: {
|
|
71352
71591
|
root: "sv_q_matrix_dynamic",
|
|
71353
71592
|
button: "sv_matrix_dynamic_button",
|
|
71354
|
-
buttonAdd: "",
|
|
71593
|
+
buttonAdd: "sv_matrix_dynamic_button--add",
|
|
71355
71594
|
buttonRemove: "",
|
|
71356
71595
|
iconAdd: "",
|
|
71357
71596
|
iconRemove: "",
|
|
@@ -71372,7 +71611,8 @@ var defaultStandardCss = {
|
|
|
71372
71611
|
emptyRowsSection: "sv_matrix_empty_rows_section",
|
|
71373
71612
|
emptyRowsText: "sv_matrix_empty_rows_text",
|
|
71374
71613
|
emptyRowsButton: "",
|
|
71375
|
-
ghostRow: "sv-matrix-row--drag-drop-ghost-mod"
|
|
71614
|
+
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
71615
|
+
draggedRow: "sv-matrixdynamic-dragged-row"
|
|
71376
71616
|
},
|
|
71377
71617
|
paneldynamic: {
|
|
71378
71618
|
root: "sv_panel_dynamic",
|
|
@@ -71912,7 +72152,8 @@ var modernCss = {
|
|
|
71912
72152
|
emptyRowsSection: "sv-table__empty--rows--section",
|
|
71913
72153
|
emptyRowsText: "sv-table__empty--rows--text",
|
|
71914
72154
|
emptyRowsButton: "",
|
|
71915
|
-
ghostRow: "sv-matrix-row--drag-drop-ghost-mod"
|
|
72155
|
+
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
72156
|
+
draggedRow: "sv-matrixdynamic-dragged-row",
|
|
71916
72157
|
},
|
|
71917
72158
|
rating: {
|
|
71918
72159
|
root: "sv-rating",
|