survey-core 1.12.7 → 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 +466 -247
- 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_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_signaturepad.d.ts +5 -3
- 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 +21 -4
- 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_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_signaturepad.d.ts +5 -3
- package/typings/packages/survey-core/src/survey-events-api.d.ts +13 -1
- package/typings/packages/survey-core/src/survey.d.ts +21 -4
- 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
|
};
|
|
@@ -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);
|
|
14543
14599
|
}
|
|
14600
|
+
else {
|
|
14601
|
+
for (var key in value) {
|
|
14602
|
+
this.setLocaleText(key, value[key]);
|
|
14603
|
+
}
|
|
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)
|
|
@@ -21269,10 +21332,10 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21269
21332
|
if (text)
|
|
21270
21333
|
_this.locText.text = text;
|
|
21271
21334
|
if (!!value && typeof value === "object") {
|
|
21272
|
-
_this.setData(value);
|
|
21335
|
+
_this.setData(value, true);
|
|
21273
21336
|
}
|
|
21274
21337
|
else {
|
|
21275
|
-
_this.value
|
|
21338
|
+
_this.setValue(value, true);
|
|
21276
21339
|
}
|
|
21277
21340
|
if (_this.getType() != "itemvalue") {
|
|
21278
21341
|
CustomPropertiesCollection.createProperties(_this);
|
|
@@ -21454,24 +21517,32 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21454
21517
|
return this.getPropertyValue("value");
|
|
21455
21518
|
},
|
|
21456
21519
|
set: function (newValue) {
|
|
21457
|
-
|
|
21458
|
-
if (!helpers_Helpers.isValueEmpty(newValue)) {
|
|
21459
|
-
var str = newValue.toString();
|
|
21460
|
-
var index = str.indexOf(settings.itemValueSeparator);
|
|
21461
|
-
if (index > -1) {
|
|
21462
|
-
newValue = str.slice(0, index);
|
|
21463
|
-
text = str.slice(index + 1);
|
|
21464
|
-
}
|
|
21465
|
-
}
|
|
21466
|
-
this.setPropertyValue("value", newValue);
|
|
21467
|
-
if (!!text) {
|
|
21468
|
-
this.text = text;
|
|
21469
|
-
}
|
|
21470
|
-
this.id = this.value;
|
|
21520
|
+
this.setValue(newValue, false);
|
|
21471
21521
|
},
|
|
21472
21522
|
enumerable: false,
|
|
21473
21523
|
configurable: true
|
|
21474
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
|
+
};
|
|
21475
21546
|
Object.defineProperty(ItemValue.prototype, "hasText", {
|
|
21476
21547
|
get: function () {
|
|
21477
21548
|
return this.locText.pureText ? true : false;
|
|
@@ -21551,7 +21622,7 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21551
21622
|
}
|
|
21552
21623
|
return res;
|
|
21553
21624
|
};
|
|
21554
|
-
ItemValue.prototype.setData = function (value) {
|
|
21625
|
+
ItemValue.prototype.setData = function (value, isNewItem) {
|
|
21555
21626
|
if (helpers_Helpers.isValueEmpty(value))
|
|
21556
21627
|
return;
|
|
21557
21628
|
if (typeof value.value === "undefined" && typeof value.text !== "undefined" && Object.keys(value).length === 1) {
|
|
@@ -21568,9 +21639,11 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
|
21568
21639
|
new jsonobject_JsonObject().toObject(json, this);
|
|
21569
21640
|
}
|
|
21570
21641
|
else {
|
|
21571
|
-
this.value
|
|
21642
|
+
this.setValue(value, isNewItem);
|
|
21643
|
+
}
|
|
21644
|
+
if (!isNewItem) {
|
|
21645
|
+
this.locText.strChanged();
|
|
21572
21646
|
}
|
|
21573
|
-
this.locText.strChanged();
|
|
21574
21647
|
};
|
|
21575
21648
|
Object.defineProperty(ItemValue.prototype, "visibleIf", {
|
|
21576
21649
|
get: function () {
|
|
@@ -26667,6 +26740,15 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedRow = /** @cla
|
|
|
26667
26740
|
QuestionMatrixDropdownRenderedRow.prototype.getRootElement = function () {
|
|
26668
26741
|
return this.rootElement;
|
|
26669
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
|
+
};
|
|
26670
26752
|
QuestionMatrixDropdownRenderedRow.counter = 1;
|
|
26671
26753
|
question_matrixdropdownrendered_decorate([
|
|
26672
26754
|
jsonobject_property({ defaultValue: false })
|
|
@@ -26912,7 +26994,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
26912
26994
|
return;
|
|
26913
26995
|
var rowIndex = this.getRenderedRowIndexByIndex(index);
|
|
26914
26996
|
this.rowsActions.splice(index, 0, this.buildRowActions(row));
|
|
26915
|
-
this.addHorizontalRow(this.rows, row,
|
|
26997
|
+
this.addHorizontalRow(this.rows, row, rowIndex);
|
|
26916
26998
|
this.updateShowTableAndAddRow();
|
|
26917
26999
|
};
|
|
26918
27000
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndexByIndex = function (index) {
|
|
@@ -26982,6 +27064,14 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
26982
27064
|
this.rows.splice(panelRowIndex, 1);
|
|
26983
27065
|
}
|
|
26984
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
|
+
};
|
|
26985
27075
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndex = function (row) {
|
|
26986
27076
|
for (var i = 0; i < this.rows.length; i++) {
|
|
26987
27077
|
if (this.rows[i].row == row)
|
|
@@ -27078,7 +27168,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27078
27168
|
else {
|
|
27079
27169
|
var editCell = this.createEditCell(cell);
|
|
27080
27170
|
if (cell.column) {
|
|
27081
|
-
this.
|
|
27171
|
+
this.setCellWidth(cell.column, editCell);
|
|
27082
27172
|
}
|
|
27083
27173
|
editCell.className = new CssClassBuilder().append(editCell.className)
|
|
27084
27174
|
.append(this.cssClasses.footerCell).toString();
|
|
@@ -27116,13 +27206,13 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27116
27206
|
var rows = this.matrix.visibleRows;
|
|
27117
27207
|
var renderedRows = [];
|
|
27118
27208
|
for (var i = 0; i < rows.length; i++) {
|
|
27119
|
-
this.addHorizontalRow(renderedRows, rows[i]
|
|
27209
|
+
this.addHorizontalRow(renderedRows, rows[i]);
|
|
27120
27210
|
}
|
|
27121
27211
|
return renderedRows;
|
|
27122
27212
|
};
|
|
27123
|
-
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row,
|
|
27213
|
+
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, index) {
|
|
27124
27214
|
if (index === void 0) { index = -1; }
|
|
27125
|
-
var renderedRow = this.createHorizontalRow(row
|
|
27215
|
+
var renderedRow = this.createHorizontalRow(row);
|
|
27126
27216
|
var errorRow = this.createErrorRow(renderedRow);
|
|
27127
27217
|
renderedRow.row = row;
|
|
27128
27218
|
if (index < 0) {
|
|
@@ -27302,7 +27392,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27302
27392
|
res.onAfterCreated();
|
|
27303
27393
|
return res;
|
|
27304
27394
|
};
|
|
27305
|
-
QuestionMatrixDropdownRenderedTable.prototype.createHorizontalRow = function (row
|
|
27395
|
+
QuestionMatrixDropdownRenderedTable.prototype.createHorizontalRow = function (row) {
|
|
27306
27396
|
var res = this.createRenderedRow(this.cssClasses);
|
|
27307
27397
|
if (this.isRowsDragAndDrop) {
|
|
27308
27398
|
var rowIndex = this.matrix.visibleRows.indexOf(row);
|
|
@@ -27313,7 +27403,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27313
27403
|
var renderedCell = this.createTextCell(row.locText);
|
|
27314
27404
|
renderedCell.row = row;
|
|
27315
27405
|
res.cells.push(renderedCell);
|
|
27316
|
-
this.
|
|
27406
|
+
this.setCellWidth(null, renderedCell);
|
|
27317
27407
|
renderedCell.className = new CssClassBuilder()
|
|
27318
27408
|
.append(renderedCell.className)
|
|
27319
27409
|
.append(this.cssClasses.rowTextCell)
|
|
@@ -27334,9 +27424,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27334
27424
|
}
|
|
27335
27425
|
var renderedCell = this.createEditCell(cell);
|
|
27336
27426
|
res.cells.push(renderedCell);
|
|
27337
|
-
|
|
27338
|
-
this.setHeaderCellWidth(cell.column, renderedCell);
|
|
27339
|
-
}
|
|
27427
|
+
this.setCellWidth(cell.column, renderedCell);
|
|
27340
27428
|
}
|
|
27341
27429
|
}
|
|
27342
27430
|
this.addRowActionsCell(row, res, "end");
|
|
@@ -27581,9 +27669,9 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
|
27581
27669
|
return cell;
|
|
27582
27670
|
};
|
|
27583
27671
|
QuestionMatrixDropdownRenderedTable.prototype.setHeaderCell = function (column, cell) {
|
|
27584
|
-
this.
|
|
27672
|
+
this.setCellWidth(column, cell);
|
|
27585
27673
|
};
|
|
27586
|
-
QuestionMatrixDropdownRenderedTable.prototype.
|
|
27674
|
+
QuestionMatrixDropdownRenderedTable.prototype.setCellWidth = function (column, cell) {
|
|
27587
27675
|
cell.minWidth = column != null ? this.matrix.getColumnWidth(column) : this.matrix.getRowTitleWidth();
|
|
27588
27676
|
cell.width = column != null ? column.width : this.matrix.getRowTitleWidth();
|
|
27589
27677
|
};
|
|
@@ -29735,6 +29823,8 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
|
29735
29823
|
};
|
|
29736
29824
|
QuestionMatrixDropdownModelBase.prototype.onHidingContent = function () {
|
|
29737
29825
|
_super.prototype.onHidingContent.call(this);
|
|
29826
|
+
if (!this.generatedVisibleRows)
|
|
29827
|
+
return;
|
|
29738
29828
|
var questions = [];
|
|
29739
29829
|
this.collectNestedQuestions(questions, true);
|
|
29740
29830
|
questions.forEach(function (q) { return q.onHidingContent(); });
|
|
@@ -30439,6 +30529,20 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
|
30439
30529
|
QuestionMatrixDropdownModelBase.prototype.getRootCss = function () {
|
|
30440
30530
|
return new CssClassBuilder().append(_super.prototype.getRootCss.call(this)).append(this.cssClasses.rootScroll, this.horizontalScroll).toString();
|
|
30441
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
|
+
};
|
|
30442
30546
|
return QuestionMatrixDropdownModelBase;
|
|
30443
30547
|
}(martixBase_QuestionMatrixBaseModel));
|
|
30444
30548
|
|
|
@@ -31350,6 +31454,7 @@ var matrix_rows_extends = (undefined && undefined.__extends) || (function () {
|
|
|
31350
31454
|
})();
|
|
31351
31455
|
|
|
31352
31456
|
|
|
31457
|
+
|
|
31353
31458
|
var matrix_rows_DragDropMatrixRows = /** @class */ (function (_super) {
|
|
31354
31459
|
matrix_rows_extends(DragDropMatrixRows, _super);
|
|
31355
31460
|
function DragDropMatrixRows() {
|
|
@@ -31376,19 +31481,28 @@ var matrix_rows_DragDropMatrixRows = /** @class */ (function (_super) {
|
|
|
31376
31481
|
_body.style.userSelect = "none";
|
|
31377
31482
|
}
|
|
31378
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
|
+
});
|
|
31379
31494
|
DragDropMatrixRows.prototype.createDraggedElementShortcut = function (text, draggedElementNode, event) {
|
|
31380
31495
|
var _this = this;
|
|
31381
31496
|
var draggedElementShortcut = DomDocumentHelper.createElement("div");
|
|
31382
31497
|
if (!draggedElementShortcut)
|
|
31383
31498
|
return;
|
|
31384
|
-
|
|
31385
|
-
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;
|
|
31386
31500
|
var isDeepClone = true;
|
|
31387
31501
|
if (!!draggedElementNode) {
|
|
31388
31502
|
var row = (draggedElementNode
|
|
31389
31503
|
.closest("[data-sv-drop-target-matrix-row]"));
|
|
31390
31504
|
var clone = (row.cloneNode(isDeepClone));
|
|
31391
|
-
clone.style.cssText = "\n
|
|
31505
|
+
clone.style.cssText = "\n width: " + row.offsetWidth + "px;\n ";
|
|
31392
31506
|
clone.classList.remove("sv-matrix__drag-drop--moveup");
|
|
31393
31507
|
clone.classList.remove("sv-matrix__drag-drop--movedown");
|
|
31394
31508
|
this.draggedElement.isDragDropMoveDown = false;
|
|
@@ -32220,14 +32334,41 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32220
32334
|
}
|
|
32221
32335
|
return res;
|
|
32222
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
|
+
};
|
|
32223
32351
|
QuestionMatrixDynamicModel.prototype.removeRowUI = function (value) {
|
|
32352
|
+
var _this = this;
|
|
32224
32353
|
if (!!value && !!value.rowName) {
|
|
32225
32354
|
var index = this.visibleRows.indexOf(value);
|
|
32226
32355
|
if (index < 0)
|
|
32227
32356
|
return;
|
|
32228
32357
|
value = index;
|
|
32229
32358
|
}
|
|
32230
|
-
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
|
+
});
|
|
32231
32372
|
};
|
|
32232
32373
|
QuestionMatrixDynamicModel.prototype.isRequireConfirmOnRowDelete = function (index) {
|
|
32233
32374
|
if (!this.confirmDelete)
|
|
@@ -32246,7 +32387,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32246
32387
|
* @param index A zero-based row index.
|
|
32247
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.
|
|
32248
32389
|
*/
|
|
32249
|
-
QuestionMatrixDynamicModel.prototype.removeRow = function (index, confirmDelete) {
|
|
32390
|
+
QuestionMatrixDynamicModel.prototype.removeRow = function (index, confirmDelete, onRowRemoved) {
|
|
32250
32391
|
var _this = this;
|
|
32251
32392
|
if (!this.canRemoveRows)
|
|
32252
32393
|
return;
|
|
@@ -32259,10 +32400,14 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
|
32259
32400
|
confirmDelete = this.isRequireConfirmOnRowDelete(index);
|
|
32260
32401
|
}
|
|
32261
32402
|
if (confirmDelete) {
|
|
32262
|
-
confirmActionAsync(this.confirmDeleteText, function () {
|
|
32403
|
+
confirmActionAsync(this.confirmDeleteText, function () {
|
|
32404
|
+
_this.removeRowAsync(index, row);
|
|
32405
|
+
onRowRemoved && onRowRemoved();
|
|
32406
|
+
}, undefined, this.getLocale(), this.survey.rootElement);
|
|
32263
32407
|
return;
|
|
32264
32408
|
}
|
|
32265
32409
|
this.removeRowAsync(index, row);
|
|
32410
|
+
onRowRemoved && onRowRemoved();
|
|
32266
32411
|
};
|
|
32267
32412
|
QuestionMatrixDynamicModel.prototype.removeRowAsync = function (index, row) {
|
|
32268
32413
|
if (!!row && !!this.survey && !this.survey.matrixRowRemoving(this, index, row))
|
|
@@ -33284,7 +33429,7 @@ var defaultV2Css = {
|
|
|
33284
33429
|
actionsCellDrag: "sd-table__cell--drag",
|
|
33285
33430
|
emptyCell: "sd-table__cell--empty",
|
|
33286
33431
|
verticalCell: "sd-table__cell--vertical",
|
|
33287
|
-
cellQuestionWrapper: "sd-table__question-wrapper",
|
|
33432
|
+
cellQuestionWrapper: "sd-matrix__question-wrapper sd-table__question-wrapper",
|
|
33288
33433
|
compact: "sd-element--with-frame sd-element--compact"
|
|
33289
33434
|
},
|
|
33290
33435
|
matrixdynamic: {
|
|
@@ -33337,9 +33482,10 @@ var defaultV2Css = {
|
|
|
33337
33482
|
emptyRowsSection: "sd-matrixdynamic__placeholder sd-question__placeholder",
|
|
33338
33483
|
iconDrag: "sv-matrixdynamic__drag-icon",
|
|
33339
33484
|
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
33485
|
+
draggedRow: "sv-matrixdynamic-dragged-row",
|
|
33340
33486
|
emptyCell: "sd-table__cell--empty",
|
|
33341
33487
|
verticalCell: "sd-table__cell--vertical",
|
|
33342
|
-
cellQuestionWrapper: "sd-table__question-wrapper",
|
|
33488
|
+
cellQuestionWrapper: "sd-matrix__question-wrapper sd-table__question-wrapper",
|
|
33343
33489
|
errorsCell: "sd-table__cell--error",
|
|
33344
33490
|
errorsCellTop: "sd-table__cell--error-top",
|
|
33345
33491
|
errorsCellBottom: "sd-table__cell--error-bottom",
|
|
@@ -37958,7 +38104,10 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
|
37958
38104
|
});
|
|
37959
38105
|
Object.defineProperty(PageModel.prototype, "no", {
|
|
37960
38106
|
get: function () {
|
|
37961
|
-
|
|
38107
|
+
if (!this.canShowPageNumber() || !this.survey)
|
|
38108
|
+
return "";
|
|
38109
|
+
var no = this.isStartPage ? "" : this.num + ". ";
|
|
38110
|
+
return this.survey.getUpdatedPageNo(this, no);
|
|
37962
38111
|
},
|
|
37963
38112
|
enumerable: false,
|
|
37964
38113
|
configurable: true
|
|
@@ -39024,7 +39173,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39024
39173
|
*
|
|
39025
39174
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
39026
39175
|
*
|
|
39027
|
-
* 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.
|
|
39028
39177
|
* @see requiredText
|
|
39029
39178
|
*/
|
|
39030
39179
|
_this.onGetQuestionTitle = _this.addEvent();
|
|
@@ -39037,7 +39186,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39037
39186
|
*
|
|
39038
39187
|
* [View Demo](https://surveyjs.io/form-library/examples/survey-titletagnames/ (linkStyle))
|
|
39039
39188
|
* @see onGetQuestionTitle
|
|
39040
|
-
* @see
|
|
39189
|
+
* @see onGetQuestionNumber
|
|
39041
39190
|
*/
|
|
39042
39191
|
_this.onGetTitleTagName = _this.addEvent();
|
|
39043
39192
|
/**
|
|
@@ -39049,7 +39198,21 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39049
39198
|
* @see onGetQuestionTitle
|
|
39050
39199
|
* @see questionStartIndex
|
|
39051
39200
|
*/
|
|
39052
|
-
_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();
|
|
39053
39216
|
/**
|
|
39054
39217
|
* An event that is raised before the survey displays progress text. Handle this event to change the progress text in code.
|
|
39055
39218
|
* @see showProgressBar
|
|
@@ -39583,7 +39746,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
39583
39746
|
_this.updateBackgroundImageStyle();
|
|
39584
39747
|
});
|
|
39585
39748
|
_this.registerPropertyChangedHandlers(["showPrevButton", "showCompleteButton"], function () { _this.updateButtonsVisibility(); });
|
|
39586
|
-
_this.
|
|
39749
|
+
_this.onGetQuestionNumber.onCallbacksChanged = function () {
|
|
39587
39750
|
_this.resetVisibleIndexes();
|
|
39588
39751
|
};
|
|
39589
39752
|
_this.onProgressText.onCallbacksChanged = function () {
|
|
@@ -41639,17 +41802,25 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
41639
41802
|
return options.title;
|
|
41640
41803
|
};
|
|
41641
41804
|
SurveyModel.prototype.getUpdatedQuestionNo = function (question, no) {
|
|
41642
|
-
if (this.
|
|
41805
|
+
if (this.onGetQuestionNumber.isEmpty)
|
|
41643
41806
|
return no;
|
|
41644
|
-
var options = { question: question, no: no };
|
|
41645
|
-
this.
|
|
41646
|
-
return options.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)
|
|
41813
|
+
return no;
|
|
41814
|
+
var options = { page: page, number: no };
|
|
41815
|
+
this.onGetPageNumber.fire(this, options);
|
|
41816
|
+
return options.number;
|
|
41647
41817
|
};
|
|
41648
41818
|
Object.defineProperty(SurveyModel.prototype, "showPageNumbers", {
|
|
41649
41819
|
/**
|
|
41650
41820
|
* Specifies whether page titles contain page numbers.
|
|
41651
41821
|
*
|
|
41652
41822
|
* [View Demo](https://surveyjs.io/form-library/examples/how-to-number-pages-and-questions/ (linkStyle))
|
|
41823
|
+
* @see onGetPageNumber
|
|
41653
41824
|
*/
|
|
41654
41825
|
get: function () {
|
|
41655
41826
|
return this.getPropertyValue("showPageNumbers");
|
|
@@ -41676,6 +41847,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
41676
41847
|
* [View Demo](https://surveyjs.io/form-library/examples/how-to-number-pages-and-questions/ (linkStyle))
|
|
41677
41848
|
*
|
|
41678
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
|
|
41679
41851
|
*/
|
|
41680
41852
|
get: function () {
|
|
41681
41853
|
return this.getPropertyValue("showQuestionNumbers");
|
|
@@ -47010,7 +47182,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
|
47010
47182
|
}
|
|
47011
47183
|
}
|
|
47012
47184
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, this.progressBarComponentName)) {
|
|
47013
|
-
if (this.questionsOnPageMode != "singlePage") {
|
|
47185
|
+
if (this.questionsOnPageMode != "singlePage" || this.progressBarType == "questions") {
|
|
47014
47186
|
var headerLayoutElement = this.findLayoutElement("advanced-header");
|
|
47015
47187
|
var advHeader = headerLayoutElement && headerLayoutElement.data;
|
|
47016
47188
|
var isBelowHeader = !advHeader || advHeader.hasBackground;
|
|
@@ -50871,7 +51043,7 @@ var popup_dropdown_view_model_PopupDropdownViewModel = /** @class */ (function (
|
|
|
50871
51043
|
var heightValues = [height, DomWindowHelper.getInnerHeight() * 0.9, (_c = DomWindowHelper.getVisualViewport()) === null || _c === void 0 ? void 0 : _c.height];
|
|
50872
51044
|
height = Math.ceil(Math.min.apply(Math, heightValues.filter(function (each) { return typeof each === "number"; })));
|
|
50873
51045
|
verticalPosition = PopupUtils.updateVerticalPosition(targetElementRect, height, this.model.horizontalPosition, this.model.verticalPosition, area.height);
|
|
50874
|
-
actualHorizontalPosition = PopupUtils.updateHorizontalPosition(targetElementRect, width,
|
|
51046
|
+
actualHorizontalPosition = PopupUtils.updateHorizontalPosition(targetElementRect, width, actualHorizontalPosition, area.width);
|
|
50875
51047
|
}
|
|
50876
51048
|
this.popupDirection = PopupUtils.calculatePopupDirection(verticalPosition, actualHorizontalPosition);
|
|
50877
51049
|
var pos = PopupUtils.calculatePosition(targetElementRect, height, width + marginLeft + marginRight, verticalPosition, actualHorizontalPosition, this.model.positionMode);
|
|
@@ -52536,7 +52708,7 @@ var question_matrix_MatrixCells = /** @class */ (function (_super) {
|
|
|
52536
52708
|
}
|
|
52537
52709
|
return res;
|
|
52538
52710
|
};
|
|
52539
|
-
MatrixCells.prototype.setJson = function (value) {
|
|
52711
|
+
MatrixCells.prototype.setJson = function (value, isLoading) {
|
|
52540
52712
|
var _this = this;
|
|
52541
52713
|
this.values = {};
|
|
52542
52714
|
if (!!value) {
|
|
@@ -54191,6 +54363,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
|
54191
54363
|
this.dateValidationMessage = this.isDateInputType && !!event.target ? event.target.validationMessage : undefined;
|
|
54192
54364
|
};
|
|
54193
54365
|
QuestionTextModel.prototype.onBlurCore = function (event) {
|
|
54366
|
+
this.updateDateValidationMessage(event);
|
|
54194
54367
|
this.updateValueOnEvent(event);
|
|
54195
54368
|
this.updateRemainingCharacterCounter(event.target.value);
|
|
54196
54369
|
_super.prototype.onBlurCore.call(this, event);
|
|
@@ -56254,6 +56427,22 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
|
56254
56427
|
}
|
|
56255
56428
|
return false;
|
|
56256
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
|
+
};
|
|
56257
56446
|
QuestionCheckboxModel.prototype.getRealValue = function (val) {
|
|
56258
56447
|
if (!val)
|
|
56259
56448
|
return val;
|
|
@@ -59384,10 +59573,19 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
|
|
|
59384
59573
|
QuestionFileModelBase.prototype.onChangeQuestionValue = function (newValue) {
|
|
59385
59574
|
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
|
59386
59575
|
this.stateChanged(this.isEmpty() ? "empty" : "loaded");
|
|
59387
|
-
if (!this.isLoadingFromJson) {
|
|
59388
|
-
this.loadPreview(newValue);
|
|
59389
|
-
}
|
|
59390
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
|
+
});
|
|
59391
59589
|
question_file_decorate([
|
|
59392
59590
|
jsonobject_property()
|
|
59393
59591
|
], QuestionFileModelBase.prototype, "isUploading", void 0);
|
|
@@ -59610,15 +59808,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
59610
59808
|
enumerable: false,
|
|
59611
59809
|
configurable: true
|
|
59612
59810
|
});
|
|
59613
|
-
Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
|
|
59614
|
-
get: function () { return this.isFileLoadingValue; },
|
|
59615
|
-
set: function (val) {
|
|
59616
|
-
this.isFileLoadingValue = val;
|
|
59617
|
-
this.updateIsReady();
|
|
59618
|
-
},
|
|
59619
|
-
enumerable: false,
|
|
59620
|
-
configurable: true
|
|
59621
|
-
});
|
|
59622
59811
|
Object.defineProperty(QuestionFileModel.prototype, "fileNavigatorVisible", {
|
|
59623
59812
|
get: function () {
|
|
59624
59813
|
var isUploading = this.isUploading;
|
|
@@ -59801,6 +59990,12 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
59801
59990
|
QuestionFileModel.prototype.getType = function () {
|
|
59802
59991
|
return "file";
|
|
59803
59992
|
};
|
|
59993
|
+
QuestionFileModel.prototype.onChangeQuestionValue = function (newValue) {
|
|
59994
|
+
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
|
59995
|
+
if (!this.isLoadingFromJson) {
|
|
59996
|
+
this.loadPreview(newValue);
|
|
59997
|
+
}
|
|
59998
|
+
};
|
|
59804
59999
|
Object.defineProperty(QuestionFileModel.prototype, "showPreview", {
|
|
59805
60000
|
/**
|
|
59806
60001
|
* Disable this property only to implement a custom preview.
|
|
@@ -60264,9 +60459,6 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
|
|
60264
60459
|
this._previewLoader.load(newValues);
|
|
60265
60460
|
}
|
|
60266
60461
|
};
|
|
60267
|
-
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
|
60268
|
-
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
|
60269
|
-
};
|
|
60270
60462
|
QuestionFileModel.prototype.allFilesOk = function (files) {
|
|
60271
60463
|
var _this = this;
|
|
60272
60464
|
var errorLength = this.errors ? this.errors.length : 0;
|
|
@@ -61011,8 +61203,8 @@ var question_rating_RenderedRatingItem = /** @class */ (function (_super) {
|
|
|
61011
61203
|
|
|
61012
61204
|
var RatingItemValue = /** @class */ (function (_super) {
|
|
61013
61205
|
question_rating_extends(RatingItemValue, _super);
|
|
61014
|
-
function RatingItemValue(value, description) {
|
|
61015
|
-
var _this = _super.call(this, value) || this;
|
|
61206
|
+
function RatingItemValue(value, text, description) {
|
|
61207
|
+
var _this = _super.call(this, value, text) || this;
|
|
61016
61208
|
_this.description = description;
|
|
61017
61209
|
return _this;
|
|
61018
61210
|
}
|
|
@@ -61378,7 +61570,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
|
61378
61570
|
if (value === this.rateMax || index === settings.ratingMaximumRateValueCount) {
|
|
61379
61571
|
description = this.maxRateDescription && this.locMaxRateDescription;
|
|
61380
61572
|
}
|
|
61381
|
-
var newItem = new RatingItemValue(value, description);
|
|
61573
|
+
var newItem = new RatingItemValue(value, item.text, description);
|
|
61382
61574
|
newItem.locOwner = item.locOwner;
|
|
61383
61575
|
newItem.ownerPropertyName = item.ownerPropertyName;
|
|
61384
61576
|
return newItem;
|
|
@@ -64077,9 +64269,11 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64077
64269
|
function QuestionSignaturePadModel(name) {
|
|
64078
64270
|
var _this = _super.call(this, name) || this;
|
|
64079
64271
|
_this.valueIsUpdatingInternally = false;
|
|
64272
|
+
_this._loadedData = undefined;
|
|
64080
64273
|
_this.updateValueHandler = function () {
|
|
64274
|
+
_this._loadedData = undefined;
|
|
64081
64275
|
_this.scaleCanvas(false, true);
|
|
64082
|
-
_this.
|
|
64276
|
+
_this.loadPreview(_this.value);
|
|
64083
64277
|
};
|
|
64084
64278
|
return _this;
|
|
64085
64279
|
}
|
|
@@ -64150,15 +64344,14 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64150
64344
|
this.signaturePad.minWidth = this.penMinWidth * scale;
|
|
64151
64345
|
this.signaturePad.maxWidth = this.penMaxWidth * scale;
|
|
64152
64346
|
canvas.getContext("2d").scale(1 / scale, 1 / scale);
|
|
64153
|
-
if (refresh)
|
|
64154
|
-
this.
|
|
64347
|
+
if (refresh) {
|
|
64348
|
+
this.loadPreview(this.value);
|
|
64349
|
+
}
|
|
64155
64350
|
}
|
|
64156
64351
|
};
|
|
64157
|
-
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
|
64158
|
-
this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
|
|
64159
|
-
};
|
|
64160
64352
|
QuestionSignaturePadModel.prototype.fromUrl = function (url) {
|
|
64161
64353
|
var _this = this;
|
|
64354
|
+
this.isFileLoading = true;
|
|
64162
64355
|
var img = new Image();
|
|
64163
64356
|
img.crossOrigin = "anonymous";
|
|
64164
64357
|
img.src = url;
|
|
@@ -64167,41 +64360,65 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64167
64360
|
ctx.drawImage(img, 0, 0);
|
|
64168
64361
|
var dataURL = _this.canvas.toDataURL(_this.getFormat());
|
|
64169
64362
|
_this.fromDataUrl(dataURL);
|
|
64363
|
+
_this.isFileLoading = false;
|
|
64170
64364
|
};
|
|
64171
64365
|
};
|
|
64172
|
-
QuestionSignaturePadModel.prototype.
|
|
64173
|
-
|
|
64174
|
-
|
|
64175
|
-
|
|
64176
|
-
|
|
64177
|
-
|
|
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
|
+
}
|
|
64178
64386
|
this.valueWasChangedFromLastUpload = false;
|
|
64387
|
+
return;
|
|
64388
|
+
}
|
|
64389
|
+
if (this.storeDataAsText) {
|
|
64390
|
+
this.fromDataUrl(newValue);
|
|
64179
64391
|
}
|
|
64180
64392
|
else {
|
|
64181
|
-
if (this.
|
|
64182
|
-
this.fromDataUrl(this.
|
|
64393
|
+
if (this.loadedData) {
|
|
64394
|
+
this.fromDataUrl(this.loadedData);
|
|
64183
64395
|
}
|
|
64184
64396
|
else {
|
|
64185
|
-
|
|
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);
|
|
64186
64414
|
}
|
|
64187
64415
|
}
|
|
64188
64416
|
};
|
|
64189
|
-
QuestionSignaturePadModel.prototype.
|
|
64190
|
-
|
|
64191
|
-
if (!this.
|
|
64192
|
-
|
|
64193
|
-
|
|
64194
|
-
this._previewLoader.dispose();
|
|
64195
|
-
}
|
|
64196
|
-
this.isFileLoading = true;
|
|
64197
|
-
this._previewLoader = new FileLoader(this, function (status, loaded) {
|
|
64198
|
-
_this.isFileLoading = false;
|
|
64199
|
-
if (loaded && loaded.length > 0 && loaded[0].content && status === "success")
|
|
64200
|
-
_this.fromDataUrl(loaded[0].content);
|
|
64201
|
-
_this._previewLoader.dispose();
|
|
64202
|
-
_this._previewLoader = undefined;
|
|
64203
|
-
});
|
|
64204
|
-
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);
|
|
64205
64422
|
}
|
|
64206
64423
|
};
|
|
64207
64424
|
QuestionSignaturePadModel.prototype.onSurveyLoad = function () {
|
|
@@ -64244,7 +64461,7 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64244
64461
|
this.updateValueHandler();
|
|
64245
64462
|
this.readOnlyChangedCallback();
|
|
64246
64463
|
var propertyChangedHandler = function (sender, options) {
|
|
64247
|
-
if (options.name === "signatureWidth" || options.name === "signatureHeight"
|
|
64464
|
+
if (options.name === "signatureWidth" || options.name === "signatureHeight") {
|
|
64248
64465
|
if (!_this.valueIsUpdatingInternally)
|
|
64249
64466
|
_this.updateValueHandler();
|
|
64250
64467
|
}
|
|
@@ -64464,7 +64681,8 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
|
64464
64681
|
QuestionSignaturePadModel.prototype.clearValue = function (keepComment) {
|
|
64465
64682
|
this.valueWasChangedFromLastUpload = false;
|
|
64466
64683
|
_super.prototype.clearValue.call(this, keepComment);
|
|
64467
|
-
this.
|
|
64684
|
+
this._loadedData = undefined;
|
|
64685
|
+
this.loadPreview(this.value);
|
|
64468
64686
|
};
|
|
64469
64687
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
|
64470
64688
|
_super.prototype.endLoadingFromJson.call(this);
|
|
@@ -66669,7 +66887,6 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
|
66669
66887
|
if (!loc)
|
|
66670
66888
|
return;
|
|
66671
66889
|
loc.localizationName = (this.isReadOnly || !this.allowAddPanel) ? "noEntriesReadonlyText" : "noEntriesText";
|
|
66672
|
-
loc.strChanged();
|
|
66673
66890
|
};
|
|
66674
66891
|
QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
|
|
66675
66892
|
this.template.readOnly = this.isReadOnly;
|
|
@@ -70592,8 +70809,8 @@ Serializer.addClass("currencymask", [
|
|
|
70592
70809
|
|
|
70593
70810
|
var Version;
|
|
70594
70811
|
var ReleaseDate;
|
|
70595
|
-
Version = "" + "1.12.
|
|
70596
|
-
ReleaseDate = "" + "2024-10-
|
|
70812
|
+
Version = "" + "1.12.8";
|
|
70813
|
+
ReleaseDate = "" + "2024-10-31";
|
|
70597
70814
|
function checkLibraryVersion(ver, libraryName) {
|
|
70598
70815
|
if (Version != ver) {
|
|
70599
70816
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
|
@@ -71373,7 +71590,7 @@ var defaultStandardCss = {
|
|
|
71373
71590
|
matrixdynamic: {
|
|
71374
71591
|
root: "sv_q_matrix_dynamic",
|
|
71375
71592
|
button: "sv_matrix_dynamic_button",
|
|
71376
|
-
buttonAdd: "",
|
|
71593
|
+
buttonAdd: "sv_matrix_dynamic_button--add",
|
|
71377
71594
|
buttonRemove: "",
|
|
71378
71595
|
iconAdd: "",
|
|
71379
71596
|
iconRemove: "",
|
|
@@ -71394,7 +71611,8 @@ var defaultStandardCss = {
|
|
|
71394
71611
|
emptyRowsSection: "sv_matrix_empty_rows_section",
|
|
71395
71612
|
emptyRowsText: "sv_matrix_empty_rows_text",
|
|
71396
71613
|
emptyRowsButton: "",
|
|
71397
|
-
ghostRow: "sv-matrix-row--drag-drop-ghost-mod"
|
|
71614
|
+
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
71615
|
+
draggedRow: "sv-matrixdynamic-dragged-row"
|
|
71398
71616
|
},
|
|
71399
71617
|
paneldynamic: {
|
|
71400
71618
|
root: "sv_panel_dynamic",
|
|
@@ -71934,7 +72152,8 @@ var modernCss = {
|
|
|
71934
72152
|
emptyRowsSection: "sv-table__empty--rows--section",
|
|
71935
72153
|
emptyRowsText: "sv-table__empty--rows--text",
|
|
71936
72154
|
emptyRowsButton: "",
|
|
71937
|
-
ghostRow: "sv-matrix-row--drag-drop-ghost-mod"
|
|
72155
|
+
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
|
72156
|
+
draggedRow: "sv-matrixdynamic-dragged-row",
|
|
71938
72157
|
},
|
|
71939
72158
|
rating: {
|
|
71940
72159
|
root: "sv-rating",
|