survey-creator-core 2.0.1 → 2.0.2
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/fesm/i18n/arabic.js +1 -1
- package/fesm/i18n/bulgarian.js +1 -1
- package/fesm/i18n/burmese.js +1 -1
- package/fesm/i18n/croatian.js +1 -1
- package/fesm/i18n/czech.js +1 -1
- package/fesm/i18n/danish.js +1 -1
- package/fesm/i18n/dutch.js +1 -1
- package/fesm/i18n/english.js +1 -1
- package/fesm/i18n/finnish.js +1 -1
- package/fesm/i18n/french.js +1 -1
- package/fesm/i18n/german.js +1 -1
- package/fesm/i18n/hebrew.js +1 -1
- package/fesm/i18n/hungarian.js +1 -1
- package/fesm/i18n/index.js +1 -1
- package/fesm/i18n/indonesian.js +1 -1
- package/fesm/i18n/italian.js +1 -1
- package/fesm/i18n/japanese.js +1 -1
- package/fesm/i18n/korean.js +1 -1
- package/fesm/i18n/malay.js +1 -1
- package/fesm/i18n/mongolian.js +1 -1
- package/fesm/i18n/norwegian.js +1 -1
- package/fesm/i18n/persian.js +1 -1
- package/fesm/i18n/polish.js +1 -1
- package/fesm/i18n/portuguese.js +1 -1
- package/fesm/i18n/romanian.js +1 -1
- package/fesm/i18n/russian.js +1 -1
- package/fesm/i18n/simplified-chinese.js +1 -1
- package/fesm/i18n/slovak.js +1 -1
- package/fesm/i18n/slovenian.js +1 -1
- package/fesm/i18n/spanish.js +1 -1
- package/fesm/i18n/swedish.js +1 -1
- package/fesm/i18n/tajik.js +1 -1
- package/fesm/i18n/thai.js +1 -1
- package/fesm/i18n/traditional-chinese.js +1 -1
- package/fesm/i18n/turkish.js +1 -1
- package/fesm/survey-creator-core.i18n.js +1 -1
- package/fesm/survey-creator-core.js +344 -80
- package/fesm/survey-creator-core.js.map +1 -1
- package/fesm/themes/index.js +1 -1
- package/fonts.fontless.css +1 -1
- package/fonts.fontless.min.css +1 -1
- package/i18n/arabic.js +1 -1
- package/i18n/arabic.min.js.LICENSE.txt +1 -1
- package/i18n/bulgarian.js +1 -1
- package/i18n/bulgarian.min.js.LICENSE.txt +1 -1
- package/i18n/burmese.js +1 -1
- package/i18n/burmese.min.js.LICENSE.txt +1 -1
- package/i18n/croatian.js +1 -1
- package/i18n/croatian.min.js.LICENSE.txt +1 -1
- package/i18n/czech.js +1 -1
- package/i18n/czech.min.js.LICENSE.txt +1 -1
- package/i18n/danish.js +1 -1
- package/i18n/danish.min.js.LICENSE.txt +1 -1
- package/i18n/dutch.js +1 -1
- package/i18n/dutch.min.js.LICENSE.txt +1 -1
- package/i18n/english.js +1 -1
- package/i18n/english.min.js.LICENSE.txt +1 -1
- package/i18n/finnish.js +1 -1
- package/i18n/finnish.min.js.LICENSE.txt +1 -1
- package/i18n/french.js +1 -1
- package/i18n/french.min.js.LICENSE.txt +1 -1
- package/i18n/german.js +1 -1
- package/i18n/german.min.js.LICENSE.txt +1 -1
- package/i18n/hebrew.js +1 -1
- package/i18n/hebrew.min.js.LICENSE.txt +1 -1
- package/i18n/hungarian.js +1 -1
- package/i18n/hungarian.min.js.LICENSE.txt +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.min.js.LICENSE.txt +1 -1
- package/i18n/indonesian.js +1 -1
- package/i18n/indonesian.min.js.LICENSE.txt +1 -1
- package/i18n/italian.js +1 -1
- package/i18n/italian.min.js.LICENSE.txt +1 -1
- package/i18n/japanese.js +1 -1
- package/i18n/japanese.min.js.LICENSE.txt +1 -1
- package/i18n/korean.js +1 -1
- package/i18n/korean.min.js.LICENSE.txt +1 -1
- package/i18n/malay.js +1 -1
- package/i18n/malay.min.js.LICENSE.txt +1 -1
- package/i18n/mongolian.js +1 -1
- package/i18n/mongolian.min.js.LICENSE.txt +1 -1
- package/i18n/norwegian.js +1 -1
- package/i18n/norwegian.min.js.LICENSE.txt +1 -1
- package/i18n/persian.js +1 -1
- package/i18n/persian.min.js.LICENSE.txt +1 -1
- package/i18n/polish.js +1 -1
- package/i18n/polish.min.js.LICENSE.txt +1 -1
- package/i18n/portuguese.js +1 -1
- package/i18n/portuguese.min.js.LICENSE.txt +1 -1
- package/i18n/romanian.js +1 -1
- package/i18n/romanian.min.js.LICENSE.txt +1 -1
- package/i18n/russian.js +1 -1
- package/i18n/russian.min.js.LICENSE.txt +1 -1
- package/i18n/simplified-chinese.js +1 -1
- package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
- package/i18n/slovak.js +1 -1
- package/i18n/slovak.min.js.LICENSE.txt +1 -1
- package/i18n/slovenian.js +1 -1
- package/i18n/slovenian.min.js.LICENSE.txt +1 -1
- package/i18n/spanish.js +1 -1
- package/i18n/spanish.min.js.LICENSE.txt +1 -1
- package/i18n/swedish.js +1 -1
- package/i18n/swedish.min.js.LICENSE.txt +1 -1
- package/i18n/tajik.js +1 -1
- package/i18n/tajik.min.js.LICENSE.txt +1 -1
- package/i18n/thai.js +1 -1
- package/i18n/thai.min.js.LICENSE.txt +1 -1
- package/i18n/traditional-chinese.js +1 -1
- package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
- package/i18n/turkish.js +1 -1
- package/i18n/turkish.min.js.LICENSE.txt +1 -1
- package/package.json +2 -2
- package/survey-creator-core.css +3 -3
- package/survey-creator-core.fontless.css +2 -2
- package/survey-creator-core.fontless.css.map +1 -1
- package/survey-creator-core.fontless.min.css +3 -3
- package/survey-creator-core.i18n.js +1 -1
- package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
- package/survey-creator-core.js +371 -79
- package/survey-creator-core.js.map +1 -1
- package/survey-creator-core.min.css +4 -4
- package/survey-creator-core.min.js +1 -1
- package/survey-creator-core.min.js.LICENSE.txt +1 -1
- package/themes/default-contrast.js +1 -1
- package/themes/default-contrast.min.js.LICENSE.txt +1 -1
- package/themes/default-dark.js +1 -1
- package/themes/default-dark.min.js.LICENSE.txt +1 -1
- package/themes/index.js +1 -1
- package/themes/index.min.js.LICENSE.txt +1 -1
- package/themes/sc2020.js +1 -1
- package/themes/sc2020.min.js.LICENSE.txt +1 -1
- package/typings/creator-base.d.ts +19 -1
- package/typings/creator-options.d.ts +6 -0
- package/typings/expand-collapse-manager.d.ts +1 -5
- package/typings/plugins/undo-redo/undo-redo-controller.d.ts +1 -0
- package/typings/property-grid/index.d.ts +1 -0
- package/typings/question-editor/properties.d.ts +1 -0
- package/typings/utils/creator-locstrings.d.ts +9 -0
package/survey-creator-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator v2.0.
|
|
2
|
+
* SurveyJS Creator v2.0.2
|
|
3
3
|
* (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* Github: https://github.com/surveyjs/survey-creator
|
|
5
5
|
* License: https://surveyjs.io/Licenses#SurveyCreator
|
|
@@ -5847,7 +5847,6 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
|
|
|
5847
5847
|
this.setSurveyElement(surveyElement);
|
|
5848
5848
|
this.creator.onLocaleChanded.add(this.creatorOnLocaleChanged);
|
|
5849
5849
|
this.creator.sidebar.onPropertyChanged.add(this.sidebarFlyoutModeChangedFunc);
|
|
5850
|
-
this.creator.expandCollapseManager.add(this);
|
|
5851
5850
|
}
|
|
5852
5851
|
};
|
|
5853
5852
|
SurveyElementAdornerBase.prototype.detachOnlyMyElement = function () {
|
|
@@ -5861,7 +5860,6 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
|
|
|
5861
5860
|
this.surveyElement = undefined;
|
|
5862
5861
|
this.creator.onLocaleChanded.remove(this.creatorOnLocaleChanged);
|
|
5863
5862
|
this.creator.sidebar.onPropertyChanged.remove(this.sidebarFlyoutModeChangedFunc);
|
|
5864
|
-
this.creator.expandCollapseManager.remove(this);
|
|
5865
5863
|
};
|
|
5866
5864
|
SurveyElementAdornerBase.prototype.dispose = function () {
|
|
5867
5865
|
this.detachFromUI();
|
|
@@ -6191,14 +6189,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6191
6189
|
/* harmony import */ var _designer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./designer */ "./src/components/tabs/designer.ts");
|
|
6192
6190
|
/* harmony import */ var _designer_state_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./designer-state-manager */ "./src/components/tabs/designer-state-manager.ts");
|
|
6193
6191
|
/* harmony import */ var _side_bar_tab_control_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../side-bar/tab-control-model */ "./src/components/side-bar/tab-control-model.ts");
|
|
6194
|
-
/* harmony import */ var
|
|
6195
|
-
/* harmony import */ var
|
|
6196
|
-
/* harmony import */ var
|
|
6197
|
-
/* harmony import */ var
|
|
6198
|
-
/* harmony import */ var
|
|
6199
|
-
/* harmony import */ var
|
|
6200
|
-
/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./themes */ "./src/components/tabs/themes.ts");
|
|
6201
|
-
|
|
6192
|
+
/* harmony import */ var _utils_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/actions */ "./src/utils/actions.ts");
|
|
6193
|
+
/* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../editorLocalization */ "./src/editorLocalization.ts");
|
|
6194
|
+
/* harmony import */ var _creator_theme_creator_theme_model_definition__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../creator-theme/creator-theme-model-definition */ "./src/creator-theme/creator-theme-model-definition.ts");
|
|
6195
|
+
/* harmony import */ var _creator_theme_creator_theme_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../creator-theme/creator-theme-model */ "./src/creator-theme/creator-theme-model.ts");
|
|
6196
|
+
/* harmony import */ var _creator_theme_creator_themes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../creator-theme/creator-themes */ "./src/creator-theme/creator-themes.ts");
|
|
6197
|
+
/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./themes */ "./src/components/tabs/themes.ts");
|
|
6202
6198
|
|
|
6203
6199
|
|
|
6204
6200
|
|
|
@@ -6231,7 +6227,7 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6231
6227
|
_this.updateTabControlActions();
|
|
6232
6228
|
};
|
|
6233
6229
|
this.propertyGridPlaceholderPage = this.creator.sidebar.addPage("propertyGridPlaceholder", "svc-property-grid-placeholder", this.propertyGridViewModel);
|
|
6234
|
-
this.propertyGridPlaceholderPage.caption =
|
|
6230
|
+
this.propertyGridPlaceholderPage.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_8__.editorLocalization.getString("ed.surveySettings");
|
|
6235
6231
|
this.propertyGridTab = this.creator.sidebar.addPage("propertyGrid", "svc-property-grid", this.propertyGridViewModel, function () {
|
|
6236
6232
|
var result = [];
|
|
6237
6233
|
if (!!_this.propertyGridViewModel.prevSelectionAction) {
|
|
@@ -6392,10 +6388,10 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6392
6388
|
var _this = this;
|
|
6393
6389
|
this.themePropertyGrid.survey.getAllQuestions().forEach(function (question) {
|
|
6394
6390
|
if (question.name === "--sjs-special-background") {
|
|
6395
|
-
question.choices = _this.themeModel && _this.themeModel.isLight ? (0,
|
|
6391
|
+
question.choices = _this.themeModel && _this.themeModel.isLight ? (0,_themes__WEBPACK_IMPORTED_MODULE_12__.getPredefinedBackgoundColorsChoices)() : [];
|
|
6396
6392
|
}
|
|
6397
6393
|
if (question.name === "--sjs-primary-background-500" || question.name === "--sjs-secondary-background-500") {
|
|
6398
|
-
question.choices = (0,
|
|
6394
|
+
question.choices = (0,_themes__WEBPACK_IMPORTED_MODULE_12__.getPredefinedColorsItemValues)(_this.themeModel.isLight === false ? "dark" : "light");
|
|
6399
6395
|
}
|
|
6400
6396
|
});
|
|
6401
6397
|
};
|
|
@@ -6412,8 +6408,8 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6412
6408
|
};
|
|
6413
6409
|
TabDesignerPlugin.prototype.createCreatorThemeSettingsPage = function (creator) {
|
|
6414
6410
|
var _this = this;
|
|
6415
|
-
this.themeModel = new
|
|
6416
|
-
this.themePropertyGrid = new _property_grid__WEBPACK_IMPORTED_MODULE_2__.PropertyGridModel(undefined, creator,
|
|
6411
|
+
this.themeModel = new _creator_theme_creator_theme_model__WEBPACK_IMPORTED_MODULE_10__.CreatorThemeModel();
|
|
6412
|
+
this.themePropertyGrid = new _property_grid__WEBPACK_IMPORTED_MODULE_2__.PropertyGridModel(undefined, creator, _creator_theme_creator_theme_model_definition__WEBPACK_IMPORTED_MODULE_9__.creatorThemeModelPropertyGridDefinition);
|
|
6417
6413
|
this.themePropertyGrid.showOneCategoryInPropertyGrid = true;
|
|
6418
6414
|
this.themePropertyGrid.surveyInstanceCreatedArea = "designer-tab:creator-settings";
|
|
6419
6415
|
var themePropertyGridViewModel = new _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_3__.PropertyGridViewModel(this.themePropertyGrid, creator);
|
|
@@ -6422,7 +6418,7 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6422
6418
|
};
|
|
6423
6419
|
themePropertyGridViewModel.searchEnabled = false;
|
|
6424
6420
|
this.themePropertyGridTab = this.creator.sidebar.addPage("creatorTheme", "svc-property-grid", themePropertyGridViewModel);
|
|
6425
|
-
this.themePropertyGridTab.caption =
|
|
6421
|
+
this.themePropertyGridTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_8__.editorLocalization.getString("ed.creatorSettingTitle");
|
|
6426
6422
|
this.themePropertyGridTab.activateCallback = function () {
|
|
6427
6423
|
settingsAction.active = true;
|
|
6428
6424
|
};
|
|
@@ -6440,7 +6436,7 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6440
6436
|
_this.syncTheme();
|
|
6441
6437
|
_this.creator.onCreatorThemePropertyChanged.fire(_this.creator, options);
|
|
6442
6438
|
});
|
|
6443
|
-
var settingsAction = new
|
|
6439
|
+
var settingsAction = new _utils_actions__WEBPACK_IMPORTED_MODULE_7__.MenuButton({
|
|
6444
6440
|
id: "theme-settings",
|
|
6445
6441
|
locTooltipName: "ed.creatorSettingTitle",
|
|
6446
6442
|
iconName: "gear-24x24",
|
|
@@ -6465,7 +6461,7 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6465
6461
|
});
|
|
6466
6462
|
var themeChooser = survey.getQuestionByName("themeName");
|
|
6467
6463
|
if (!!themeChooser) {
|
|
6468
|
-
themeChooser.choices =
|
|
6464
|
+
themeChooser.choices = _creator_theme_creator_themes__WEBPACK_IMPORTED_MODULE_11__.PredefinedCreatorThemes.map(function (theme) { return ({ value: theme, text: (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_8__.getLocString)("creatortheme.names." + theme) }); });
|
|
6469
6465
|
}
|
|
6470
6466
|
survey.runExpressions();
|
|
6471
6467
|
this.updatePredefinedColorChoices();
|
|
@@ -6514,10 +6510,10 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6514
6510
|
this.propertyGrid.survey.pages.forEach(function (p) {
|
|
6515
6511
|
if (p.elements.length === 0)
|
|
6516
6512
|
return;
|
|
6517
|
-
var action = new
|
|
6513
|
+
var action = new _utils_actions__WEBPACK_IMPORTED_MODULE_7__.MenuButton({
|
|
6518
6514
|
id: p.name,
|
|
6519
6515
|
tooltip: p.title,
|
|
6520
|
-
iconName:
|
|
6516
|
+
iconName: p["iconName"],
|
|
6521
6517
|
iconSize: "auto",
|
|
6522
6518
|
active: _this.activePageIsPropertyGrid && p.name === _this.propertyGrid.survey.currentPage.name,
|
|
6523
6519
|
pressed: false,
|
|
@@ -6558,7 +6554,6 @@ var TabDesignerPlugin = /** @class */ (function () {
|
|
|
6558
6554
|
this.creator.sidebar.sideAreaComponentData = undefined;
|
|
6559
6555
|
this.creator.sidebar.onPropertyChanged.clear();
|
|
6560
6556
|
this.creator.sidebar.header.reset();
|
|
6561
|
-
this.creator.expandCollapseManager.clear();
|
|
6562
6557
|
return true;
|
|
6563
6558
|
};
|
|
6564
6559
|
TabDesignerPlugin.prototype.onDesignerSurveyPropertyChanged = function (obj, propName) {
|
|
@@ -14874,9 +14869,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14874
14869
|
/* harmony import */ var _theme_model_definition__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./theme-model-definition */ "./src/components/tabs/theme-model-definition.ts");
|
|
14875
14870
|
/* harmony import */ var _property_grid_theme_property_grid__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../property-grid-theme/property-grid */ "./src/property-grid-theme/property-grid.ts");
|
|
14876
14871
|
/* harmony import */ var _side_bar_tab_control_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../side-bar/tab-control-model */ "./src/components/side-bar/tab-control-model.ts");
|
|
14877
|
-
/* harmony import */ var
|
|
14878
|
-
/* harmony import */ var _utils_actions__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/actions */ "./src/utils/actions.ts");
|
|
14879
|
-
|
|
14872
|
+
/* harmony import */ var _utils_actions__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/actions */ "./src/utils/actions.ts");
|
|
14880
14873
|
|
|
14881
14874
|
|
|
14882
14875
|
|
|
@@ -15256,10 +15249,10 @@ var ThemeTabPlugin = /** @class */ (function () {
|
|
|
15256
15249
|
var _this = this;
|
|
15257
15250
|
if (this.showOneCategoryInPropertyGrid) {
|
|
15258
15251
|
var pgTabs_1 = this.propertyGrid.survey.pages.map(function (p) {
|
|
15259
|
-
var action = new
|
|
15252
|
+
var action = new _utils_actions__WEBPACK_IMPORTED_MODULE_14__.MenuButton({
|
|
15260
15253
|
id: p.name,
|
|
15261
15254
|
tooltip: p.title,
|
|
15262
|
-
iconName:
|
|
15255
|
+
iconName: p["iconName"],
|
|
15263
15256
|
iconSize: "auto",
|
|
15264
15257
|
active: p.name === _this.propertyGrid.survey.currentPage.name,
|
|
15265
15258
|
pressed: false,
|
|
@@ -17080,7 +17073,6 @@ var TranslationGroup = /** @class */ (function (_super) {
|
|
|
17080
17073
|
return;
|
|
17081
17074
|
var properties = this.getLocalizedProperties(this.obj);
|
|
17082
17075
|
for (var i = 0; i < properties.length; i++) {
|
|
17083
|
-
var property = properties[i];
|
|
17084
17076
|
var item = this.createTranslationItem(this.obj, properties[i]);
|
|
17085
17077
|
if (!!item) {
|
|
17086
17078
|
this.itemValues.push(item);
|
|
@@ -17183,10 +17175,10 @@ var TranslationGroup = /** @class */ (function (_super) {
|
|
|
17183
17175
|
};
|
|
17184
17176
|
TranslationGroup.prototype.createTranslationItem = function (obj, property) {
|
|
17185
17177
|
var _a;
|
|
17186
|
-
var defaultValue = this.getDefaultValue(obj, property);
|
|
17187
17178
|
var locStr = obj[property.serializationProperty];
|
|
17188
17179
|
if (!locStr)
|
|
17189
17180
|
return null;
|
|
17181
|
+
var defaultValue = this.getDefaultValue(obj, property);
|
|
17190
17182
|
if (!this.showAllStrings && !defaultValue && locStr.isEmpty)
|
|
17191
17183
|
return null;
|
|
17192
17184
|
var editLocale = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
|
|
@@ -17201,9 +17193,7 @@ var TranslationGroup = /** @class */ (function (_super) {
|
|
|
17201
17193
|
property.isLocalizable &&
|
|
17202
17194
|
!!property.serializationProperty) {
|
|
17203
17195
|
var locStr = obj[property.serializationProperty];
|
|
17204
|
-
if (!!locStr &&
|
|
17205
|
-
!obj.isPage && !obj.isPanel &&
|
|
17206
|
-
(!!locStr.onGetTextCallback || locStr["onRenderedHtmlCallback"]))
|
|
17196
|
+
if (!!locStr && !obj.isPage && !obj.isPanel && !!locStr.onGetTextCallback)
|
|
17207
17197
|
return obj["name"];
|
|
17208
17198
|
}
|
|
17209
17199
|
return "";
|
|
@@ -18709,11 +18699,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18709
18699
|
/* harmony import */ var _designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./designTabSurveyThemeJSON */ "./src/designTabSurveyThemeJSON.ts");
|
|
18710
18700
|
/* harmony import */ var _components_survey_element_adorner_base__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./components/survey-element-adorner-base */ "./src/components/survey-element-adorner-base.ts");
|
|
18711
18701
|
/* harmony import */ var _tabbed_menu__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tabbed-menu */ "./src/tabbed-menu.ts");
|
|
18712
|
-
/* harmony import */ var
|
|
18713
|
-
/* harmony import */ var
|
|
18714
|
-
/* harmony import */ var
|
|
18715
|
-
/* harmony import */ var
|
|
18716
|
-
/* harmony import */ var
|
|
18702
|
+
/* harmony import */ var _utils_creator_locstrings__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./utils/creator-locstrings */ "./src/utils/creator-locstrings.ts");
|
|
18703
|
+
/* harmony import */ var _svgbundle__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./svgbundle */ "./src/svgbundle.ts");
|
|
18704
|
+
/* harmony import */ var _components_list_theme__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./components/list-theme */ "./src/components/list-theme.ts");
|
|
18705
|
+
/* harmony import */ var _components_creator_scss__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./components/creator.scss */ "./src/components/creator.scss");
|
|
18706
|
+
/* harmony import */ var _components_string_editor_scss__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./components/string-editor.scss */ "./src/components/string-editor.scss");
|
|
18707
|
+
/* harmony import */ var _creator_theme_creator_scss__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./creator-theme/creator.scss */ "./src/creator-theme/creator.scss");
|
|
18708
|
+
|
|
18717
18709
|
|
|
18718
18710
|
|
|
18719
18711
|
|
|
@@ -18752,9 +18744,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18752
18744
|
|
|
18753
18745
|
|
|
18754
18746
|
|
|
18755
|
-
(0,survey_core__WEBPACK_IMPORTED_MODULE_1__.addIconsToThemeSet)("v1",
|
|
18756
|
-
(0,survey_core__WEBPACK_IMPORTED_MODULE_1__.addIconsToThemeSet)("v2",
|
|
18757
|
-
survey_core__WEBPACK_IMPORTED_MODULE_1__.SvgRegistry.registerIcons(
|
|
18747
|
+
(0,survey_core__WEBPACK_IMPORTED_MODULE_1__.addIconsToThemeSet)("v1", _svgbundle__WEBPACK_IMPORTED_MODULE_31__.iconsV1);
|
|
18748
|
+
(0,survey_core__WEBPACK_IMPORTED_MODULE_1__.addIconsToThemeSet)("v2", _svgbundle__WEBPACK_IMPORTED_MODULE_31__.iconsV2);
|
|
18749
|
+
survey_core__WEBPACK_IMPORTED_MODULE_1__.SvgRegistry.registerIcons(_svgbundle__WEBPACK_IMPORTED_MODULE_31__.iconsV2);
|
|
18758
18750
|
//Obsolete
|
|
18759
18751
|
var CreatorAction = /** @class */ (function (_super) {
|
|
18760
18752
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(CreatorAction, _super);
|
|
@@ -19153,7 +19145,6 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
19153
19145
|
*
|
|
19154
19146
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
19155
19147
|
*
|
|
19156
|
-
*
|
|
19157
19148
|
* Within the event handler, you need to pass translation strings and locale information to the translation service API. The service should return an array of translated strings that you need to pass to the `options.callback` function. The following code shows how to integrate the Microsoft Translator service into Survey Creator:
|
|
19158
19149
|
*
|
|
19159
19150
|
* ```js
|
|
@@ -19199,6 +19190,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
19199
19190
|
* ```
|
|
19200
19191
|
*
|
|
19201
19192
|
* > Survey Creator does not include a machine translation service out of the box. Our component only provides a UI for calling the service API.
|
|
19193
|
+
* @see startMachineTranslationTo
|
|
19202
19194
|
*/
|
|
19203
19195
|
_this.onMachineTranslate = _this.addCreatorEvent();
|
|
19204
19196
|
/**
|
|
@@ -19512,6 +19504,13 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
19512
19504
|
* Default value: `false`
|
|
19513
19505
|
*/
|
|
19514
19506
|
_this.collapseOnDrag = false;
|
|
19507
|
+
/**
|
|
19508
|
+
* Specifies whether to clear translations to other languages when a source language translation is changed.
|
|
19509
|
+
*
|
|
19510
|
+
* Default value: `false`
|
|
19511
|
+
* @see showTranslationTab
|
|
19512
|
+
*/
|
|
19513
|
+
_this.clearTranslationsOnSourceTextChange = false;
|
|
19515
19514
|
if (!!options2 ||
|
|
19516
19515
|
typeof _this.options === "string" ||
|
|
19517
19516
|
_this.options instanceof String) {
|
|
@@ -21442,9 +21441,52 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
21442
21441
|
options.value = options.newValue;
|
|
21443
21442
|
this.onAfterPropertyChanged.fire(this, options);
|
|
21444
21443
|
}
|
|
21444
|
+
this.clearLocalizationStrings(options.target, options.name);
|
|
21445
21445
|
options.type = "PROPERTY_CHANGED";
|
|
21446
21446
|
this.setModified(options);
|
|
21447
21447
|
};
|
|
21448
|
+
SurveyCreatorModel.prototype.clearLocalizationStrings = function (el, name) {
|
|
21449
|
+
if (this.clearTranslationsOnSourceTextChange) {
|
|
21450
|
+
var loc = this.survey.locale;
|
|
21451
|
+
if (!!loc && loc !== survey_core__WEBPACK_IMPORTED_MODULE_1__.surveyLocalization.defaultLocale)
|
|
21452
|
+
return;
|
|
21453
|
+
if ((el.isQuestion || survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.isDescendantOf(el.getType(), "matrixdropdowncolumn")) && name === "name") {
|
|
21454
|
+
this.clearNonDefaultLocalesInStrByValue(el.locTitle);
|
|
21455
|
+
}
|
|
21456
|
+
else {
|
|
21457
|
+
if (survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.isDescendantOf(el.getType(), "itemvalue") && name === "value") {
|
|
21458
|
+
this.clearNonDefaultLocalesInStrByValue(el.locText);
|
|
21459
|
+
}
|
|
21460
|
+
else {
|
|
21461
|
+
var prop = survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.findProperty(el.getType(), name);
|
|
21462
|
+
if (prop && prop.isLocalizable && prop.serializationProperty) {
|
|
21463
|
+
var locStr = el[prop.serializationProperty];
|
|
21464
|
+
this.clearNonDefaultLocalesInStr(locStr);
|
|
21465
|
+
}
|
|
21466
|
+
}
|
|
21467
|
+
}
|
|
21468
|
+
}
|
|
21469
|
+
};
|
|
21470
|
+
SurveyCreatorModel.prototype.clearNonDefaultLocalesInStrByValue = function (locStr) {
|
|
21471
|
+
if (!locStr.isEmpty && !locStr.getLocaleText("")) {
|
|
21472
|
+
this.clearNonDefaultLocalesInStr(locStr);
|
|
21473
|
+
}
|
|
21474
|
+
};
|
|
21475
|
+
SurveyCreatorModel.prototype.clearNonDefaultLocalesInStr = function (locStr) {
|
|
21476
|
+
if (locStr) {
|
|
21477
|
+
var ctrl = this.undoRedoController;
|
|
21478
|
+
if (ctrl)
|
|
21479
|
+
ctrl.ignoreChanges = true;
|
|
21480
|
+
var locs = locStr.getLocales();
|
|
21481
|
+
locs.forEach(function (l) {
|
|
21482
|
+
if (l !== survey_core__WEBPACK_IMPORTED_MODULE_1__.surveyLocalization.defaultLocale && l !== "default") {
|
|
21483
|
+
locStr.setLocaleText(l, "");
|
|
21484
|
+
}
|
|
21485
|
+
});
|
|
21486
|
+
if (ctrl)
|
|
21487
|
+
ctrl.ignoreChanges = false;
|
|
21488
|
+
}
|
|
21489
|
+
};
|
|
21448
21490
|
SurveyCreatorModel.prototype.notifySurveyItemMoved = function (options) {
|
|
21449
21491
|
options.type = "ELEMENT_REORDERED";
|
|
21450
21492
|
this.setModified(options);
|
|
@@ -22579,6 +22621,17 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
22579
22621
|
this.onMachineTranslate.fire(this, { fromLocale: fromLocale, toLocale: toLocale, strings: strings, callback: callback });
|
|
22580
22622
|
}
|
|
22581
22623
|
};
|
|
22624
|
+
/**
|
|
22625
|
+
* Starts the translation of survey strings from the default language to one or more specified languages using a machine translation service, such as Google Translate or Microsoft Translator.
|
|
22626
|
+
*
|
|
22627
|
+
* This method only launches the operation by raising the [`onMachineTranslate`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onMachineTranslate) event. Handle this event to perform the actual translation.
|
|
22628
|
+
* @param locales An array of locale codes that correspond to target languages, for example, `[ "de", "fr" ]`.
|
|
22629
|
+
*/
|
|
22630
|
+
SurveyCreatorModel.prototype.startMachineTranslationTo = function (locales) {
|
|
22631
|
+
if (!this.getHasMachineTranslation())
|
|
22632
|
+
return;
|
|
22633
|
+
(0,_utils_creator_locstrings__WEBPACK_IMPORTED_MODULE_30__.doMachineStringsTranslation)(this.survey, this, locales);
|
|
22634
|
+
};
|
|
22582
22635
|
SurveyCreatorModel.prototype.doAutoSave = function () {
|
|
22583
22636
|
var _this = this;
|
|
22584
22637
|
var saveFunc = function () { return _this.doSave(); };
|
|
@@ -22758,7 +22811,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
22758
22811
|
items: [],
|
|
22759
22812
|
allowSelection: false,
|
|
22760
22813
|
cssClass: "svc-creator-popup",
|
|
22761
|
-
cssClasses:
|
|
22814
|
+
cssClasses: _components_list_theme__WEBPACK_IMPORTED_MODULE_32__.listComponentCss,
|
|
22762
22815
|
verticalPosition: "bottom",
|
|
22763
22816
|
horizontalPosition: "center",
|
|
22764
22817
|
displayMode: this.isTouch ? "overlay" : "popup"
|
|
@@ -22825,7 +22878,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
|
|
|
22825
22878
|
onSelectQuestionType(item.typeName, i.json);
|
|
22826
22879
|
}
|
|
22827
22880
|
}); });
|
|
22828
|
-
action.setSubItems({ items: innerItems, cssClasses:
|
|
22881
|
+
action.setSubItems({ items: innerItems, cssClasses: _components_list_theme__WEBPACK_IMPORTED_MODULE_32__.listComponentCss });
|
|
22829
22882
|
}
|
|
22830
22883
|
return action;
|
|
22831
22884
|
};
|
|
@@ -26468,6 +26521,10 @@ var EditorLocalization = /** @class */ (function () {
|
|
|
26468
26521
|
return (locale ? this.getLocaleStrings(locale) : this.getDefaultStrings()) || this.getDefaultStrings();
|
|
26469
26522
|
};
|
|
26470
26523
|
EditorLocalization.prototype.getLocaleStrings = function (loc) {
|
|
26524
|
+
if (!loc)
|
|
26525
|
+
loc = this.defaultLocale;
|
|
26526
|
+
if (loc === "en")
|
|
26527
|
+
return defaultStrings;
|
|
26471
26528
|
return this.locales[loc];
|
|
26472
26529
|
};
|
|
26473
26530
|
EditorLocalization.prototype.setupLocale = function (loc, strings) {
|
|
@@ -26636,11 +26693,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26636
26693
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26637
26694
|
/* harmony export */ ExpandCollapseManager: () => (/* binding */ ExpandCollapseManager)
|
|
26638
26695
|
/* harmony export */ });
|
|
26696
|
+
/* harmony import */ var _components_survey_element_adorner_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/survey-element-adorner-base */ "./src/components/survey-element-adorner-base.ts");
|
|
26697
|
+
|
|
26639
26698
|
var ExpandCollapseManager = /** @class */ (function () {
|
|
26640
26699
|
function ExpandCollapseManager(creator) {
|
|
26641
26700
|
this.creator = creator;
|
|
26642
26701
|
this._lockQuestions = false;
|
|
26643
|
-
this.adorners = [];
|
|
26644
26702
|
}
|
|
26645
26703
|
ExpandCollapseManager.prototype.expandCollapseElements = function (reason, isCollapsed, elements) {
|
|
26646
26704
|
if (elements === void 0) { elements = null; }
|
|
@@ -26661,35 +26719,27 @@ var ExpandCollapseManager = /** @class */ (function () {
|
|
|
26661
26719
|
.concat(this.creator.survey.getAllPanels())
|
|
26662
26720
|
.concat(this.creator.survey.getAllQuestions());
|
|
26663
26721
|
};
|
|
26722
|
+
ExpandCollapseManager.prototype.sortElements = function (elements) {
|
|
26723
|
+
return [].concat(elements).sort(function (el, el2) {
|
|
26724
|
+
var a = el.isPage ? 2 : el.isPanel ? 1 : 0;
|
|
26725
|
+
var b = el2.isPage ? 2 : el2.isPanel ? 1 : 0;
|
|
26726
|
+
return a - b;
|
|
26727
|
+
});
|
|
26728
|
+
};
|
|
26664
26729
|
ExpandCollapseManager.prototype.updateCollapsed = function (elements, value, reason) {
|
|
26665
26730
|
var _this = this;
|
|
26666
|
-
elements.forEach(function (element) {
|
|
26731
|
+
this.sortElements(elements).forEach(function (element) {
|
|
26667
26732
|
var _a;
|
|
26668
26733
|
if (element.isQuestion && _this._lockQuestions)
|
|
26669
26734
|
return;
|
|
26670
26735
|
var collapsed = _this.creator.getElementExpandCollapseState(element, reason, value);
|
|
26671
26736
|
(_a = _this.creator.designerStateManager) === null || _a === void 0 ? void 0 : _a.setElementCollapsed(element, collapsed);
|
|
26672
|
-
|
|
26673
|
-
|
|
26674
|
-
|
|
26675
|
-
|
|
26676
|
-
continue;
|
|
26677
|
-
if (elements.indexOf(element) == -1)
|
|
26678
|
-
continue;
|
|
26679
|
-
if (this.adorners[i].allowExpandCollapse) {
|
|
26680
|
-
var newState = this.creator.getElementExpandCollapseState(element, reason, value);
|
|
26681
|
-
this.adorners[i].collapsed = newState;
|
|
26737
|
+
var adorner = _components_survey_element_adorner_base__WEBPACK_IMPORTED_MODULE_0__.SurveyElementAdornerBase.GetAdorner(element);
|
|
26738
|
+
if (adorner && adorner.allowExpandCollapse) {
|
|
26739
|
+
var newState = _this.creator.getElementExpandCollapseState(element, reason, value);
|
|
26740
|
+
adorner.collapsed = newState;
|
|
26682
26741
|
}
|
|
26683
|
-
}
|
|
26684
|
-
};
|
|
26685
|
-
ExpandCollapseManager.prototype.add = function (adorner) {
|
|
26686
|
-
this.adorners.push(adorner);
|
|
26687
|
-
};
|
|
26688
|
-
ExpandCollapseManager.prototype.remove = function (adorner) {
|
|
26689
|
-
this.adorners.splice(this.adorners.indexOf(adorner), 1);
|
|
26690
|
-
};
|
|
26691
|
-
ExpandCollapseManager.prototype.clear = function () {
|
|
26692
|
-
this.adorners.length = 0;
|
|
26742
|
+
});
|
|
26693
26743
|
};
|
|
26694
26744
|
return ExpandCollapseManager;
|
|
26695
26745
|
}());
|
|
@@ -34317,7 +34367,7 @@ var UndoRedoController = /** @class */ (function (_super) {
|
|
|
34317
34367
|
return _this;
|
|
34318
34368
|
}
|
|
34319
34369
|
UndoRedoController.prototype.onSurveyPropertyValueChangedCallback = function (name, oldValue, newValue, sender, arrayChanges) {
|
|
34320
|
-
if (!this.undoRedoManager || !this.undoRedoManager.isCorrectProperty(sender, name)) {
|
|
34370
|
+
if (this.ignoreChanges || !this.undoRedoManager || !this.undoRedoManager.isCorrectProperty(sender, name)) {
|
|
34321
34371
|
return;
|
|
34322
34372
|
}
|
|
34323
34373
|
var canUndoRedoMerge = this.undoRedoManager.tryMergeTransaction(sender, name, newValue);
|
|
@@ -37353,9 +37403,9 @@ var FastEntryEditor = /** @class */ (function (_super) {
|
|
|
37353
37403
|
if (item) {
|
|
37354
37404
|
item.text = src[i].text;
|
|
37355
37405
|
names.forEach(function (name) {
|
|
37356
|
-
if (name
|
|
37357
|
-
|
|
37358
|
-
|
|
37406
|
+
if (name !== "value") {
|
|
37407
|
+
item[name] = src[i][name];
|
|
37408
|
+
}
|
|
37359
37409
|
});
|
|
37360
37410
|
src.splice(i, 1, item);
|
|
37361
37411
|
}
|
|
@@ -37806,6 +37856,15 @@ var PropertyGridTitleActionsCreator = /** @class */ (function () {
|
|
|
37806
37856
|
options.titleActions = actions;
|
|
37807
37857
|
}
|
|
37808
37858
|
};
|
|
37859
|
+
PropertyGridTitleActionsCreator.prototype.onValueChanged = function (obj, property, question) {
|
|
37860
|
+
var editor = PropertyGridEditorCollection.getEditor(property);
|
|
37861
|
+
if (!!editor && !!editor.createPropertyEditorSetup && !!editor.isPropertyEditorSetupEnabled) {
|
|
37862
|
+
var act = question.getTitleToolbar().getActionById("property-grid-setup");
|
|
37863
|
+
if (!!act) {
|
|
37864
|
+
act.enabled = editor.isPropertyEditorSetupEnabled(obj, property, question, this.options);
|
|
37865
|
+
}
|
|
37866
|
+
}
|
|
37867
|
+
};
|
|
37809
37868
|
PropertyGridTitleActionsCreator.prototype.createClearValueAction = function (editor, property, question, enabled) {
|
|
37810
37869
|
var _this = this;
|
|
37811
37870
|
return {
|
|
@@ -37877,6 +37936,7 @@ var PropertyGridTitleActionsCreator = /** @class */ (function () {
|
|
|
37877
37936
|
return PropertyGridTitleActionsCreator;
|
|
37878
37937
|
}());
|
|
37879
37938
|
|
|
37939
|
+
survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperty("panelbase", { name: "iconName", visible: false });
|
|
37880
37940
|
var PropertyJSONGenerator = /** @class */ (function () {
|
|
37881
37941
|
function PropertyJSONGenerator(obj, options, parentObj, parentProperty, propertyGridDefinition) {
|
|
37882
37942
|
if (options === void 0) { options = null; }
|
|
@@ -38061,7 +38121,7 @@ var PropertyJSONGenerator = /** @class */ (function () {
|
|
|
38061
38121
|
PropertyJSONGenerator.prototype.createPanelProps = function (tab, context, isChild) {
|
|
38062
38122
|
var _this = this;
|
|
38063
38123
|
if (isChild === void 0) { isChild = false; }
|
|
38064
|
-
var panel = this.createPanelJSON(tab.name, tab.title, isChild);
|
|
38124
|
+
var panel = this.createPanelJSON(tab.name, tab.title, tab.iconName, isChild);
|
|
38065
38125
|
for (var i = 0; i < tab.properties.length; i++) {
|
|
38066
38126
|
var propDef = tab.properties[i];
|
|
38067
38127
|
var propJSON = this.createQuestionJSON(this.obj, propDef.property, propDef.title, false, context);
|
|
@@ -38093,10 +38153,11 @@ var PropertyJSONGenerator = /** @class */ (function () {
|
|
|
38093
38153
|
json.titleLocation = "left";
|
|
38094
38154
|
json.minWidth = "50px";
|
|
38095
38155
|
};
|
|
38096
|
-
PropertyJSONGenerator.prototype.createPanelJSON = function (category, title, isChild) {
|
|
38156
|
+
PropertyJSONGenerator.prototype.createPanelJSON = function (category, title, iconName, isChild) {
|
|
38097
38157
|
var res = {
|
|
38098
38158
|
type: "panel",
|
|
38099
38159
|
name: category,
|
|
38160
|
+
iconName: iconName,
|
|
38100
38161
|
title: this.getPanelTitle(category, title),
|
|
38101
38162
|
elements: []
|
|
38102
38163
|
};
|
|
@@ -38732,6 +38793,8 @@ var PropertyGridModel = /** @class */ (function () {
|
|
|
38732
38793
|
var cellQuestion = options.row.getQuestionByName(options.columnName);
|
|
38733
38794
|
if (!!cellQuestion) {
|
|
38734
38795
|
this.changeDependedProperties(cellQuestion, function (name) { return options.row.getQuestionByName(name); }, function (name) { return options.row.getValue(name); });
|
|
38796
|
+
var matrix = options.question;
|
|
38797
|
+
this.titleActionsCreator.onValueChanged(matrix.obj, matrix.property, matrix);
|
|
38735
38798
|
}
|
|
38736
38799
|
PropertyGridEditorCollection.onMatrixCellValueChanged(this.obj, options.question.property, options);
|
|
38737
38800
|
};
|
|
@@ -39789,16 +39852,12 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
|
|
|
39789
39852
|
if (cellQuestion.getType() === "text" && !!objType) {
|
|
39790
39853
|
if (propertyName === "text" && objType === "itemvalue") {
|
|
39791
39854
|
cellQuestion.placeholder = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ComputedUpdater(function () {
|
|
39792
|
-
|
|
39793
|
-
return rowObj.value.toString();
|
|
39794
|
-
return rowObj.text;
|
|
39855
|
+
return rowObj.locText.getPlaceholder();
|
|
39795
39856
|
});
|
|
39796
39857
|
}
|
|
39797
39858
|
if (propertyName === "title" && (objType === "matrixdropdowncolumn" || objType === "multipletextitem")) {
|
|
39798
39859
|
cellQuestion.placeholder = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ComputedUpdater(function () {
|
|
39799
|
-
|
|
39800
|
-
return rowObj.name;
|
|
39801
|
-
return rowObj.title;
|
|
39860
|
+
return rowObj.locTitle.getPlaceholder();
|
|
39802
39861
|
});
|
|
39803
39862
|
}
|
|
39804
39863
|
}
|
|
@@ -42672,6 +42731,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42672
42731
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
42673
42732
|
/* harmony import */ var _survey_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../survey-helper */ "./src/survey-helper.ts");
|
|
42674
42733
|
/* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../creator-settings */ "./src/creator-settings.ts");
|
|
42734
|
+
/* harmony import */ var _property_grid_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../property-grid/icons */ "./src/property-grid/icons.ts");
|
|
42735
|
+
|
|
42675
42736
|
|
|
42676
42737
|
|
|
42677
42738
|
|
|
@@ -42959,6 +43020,7 @@ var SurveyQuestionProperties = /** @class */ (function () {
|
|
|
42959
43020
|
}
|
|
42960
43021
|
var res = new SurveyQuestionEditorTabDefinition();
|
|
42961
43022
|
res.name = tabName;
|
|
43023
|
+
res.iconName = _property_grid_icons__WEBPACK_IMPORTED_MODULE_4__.pgTabIcons[tabName] || _property_grid_icons__WEBPACK_IMPORTED_MODULE_4__.pgTabIcons["undefined"];
|
|
42962
43024
|
if (tabName == _creator_settings__WEBPACK_IMPORTED_MODULE_3__.settings.propertyGrid.generalTabName) {
|
|
42963
43025
|
res.index = -1;
|
|
42964
43026
|
}
|
|
@@ -46258,6 +46320,236 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46258
46320
|
// extracted by mini-css-extract-plugin
|
|
46259
46321
|
|
|
46260
46322
|
|
|
46323
|
+
/***/ }),
|
|
46324
|
+
|
|
46325
|
+
/***/ "./src/utils/creator-locstrings.ts":
|
|
46326
|
+
/*!*****************************************!*\
|
|
46327
|
+
!*** ./src/utils/creator-locstrings.ts ***!
|
|
46328
|
+
\*****************************************/
|
|
46329
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
46330
|
+
|
|
46331
|
+
"use strict";
|
|
46332
|
+
__webpack_require__.r(__webpack_exports__);
|
|
46333
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
46334
|
+
/* harmony export */ collectLocalizableStrings: () => (/* binding */ collectLocalizableStrings),
|
|
46335
|
+
/* harmony export */ doMachineStringsTranslation: () => (/* binding */ doMachineStringsTranslation)
|
|
46336
|
+
/* harmony export */ });
|
|
46337
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
46338
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
46339
|
+
|
|
46340
|
+
function doMachineStringsTranslation(survey, creatorOptions, locales) {
|
|
46341
|
+
var _this = this;
|
|
46342
|
+
locales.forEach(function (loc) {
|
|
46343
|
+
var locStrs = getUnlocalizedStrings(survey, _this, loc);
|
|
46344
|
+
if (locStrs.length > 0) {
|
|
46345
|
+
var locStrsHash_1 = {};
|
|
46346
|
+
var defaultStrs_1 = new Array();
|
|
46347
|
+
locStrs.forEach(function (locStr) {
|
|
46348
|
+
var text = locStr.getLocaleText("");
|
|
46349
|
+
if (!text && locStr.onGetTextCallback) {
|
|
46350
|
+
text = locStr.onGetTextCallback("");
|
|
46351
|
+
if (isTextNonTranslated(text)) {
|
|
46352
|
+
text = undefined;
|
|
46353
|
+
}
|
|
46354
|
+
}
|
|
46355
|
+
if (!!text) {
|
|
46356
|
+
if (!locStrsHash_1[text]) {
|
|
46357
|
+
locStrsHash_1[text] = [];
|
|
46358
|
+
defaultStrs_1.push(text);
|
|
46359
|
+
}
|
|
46360
|
+
locStrsHash_1[text].push(locStr);
|
|
46361
|
+
}
|
|
46362
|
+
});
|
|
46363
|
+
creatorOptions.doMachineTranslation(survey_core__WEBPACK_IMPORTED_MODULE_0__.surveyLocalization.defaultLocale, loc, defaultStrs_1, function (translated) {
|
|
46364
|
+
if (!!translated && translated.length === defaultStrs_1.length) {
|
|
46365
|
+
creatorOptions.startUndoRedoTransaction("Translate to " + loc);
|
|
46366
|
+
var _loop_1 = function (i) {
|
|
46367
|
+
locStrsHash_1[defaultStrs_1[i]].forEach(function (locStr) { return locStr.setLocaleText(loc, translated[i]); });
|
|
46368
|
+
};
|
|
46369
|
+
for (var i = 0; i < defaultStrs_1.length; i++) {
|
|
46370
|
+
_loop_1(i);
|
|
46371
|
+
}
|
|
46372
|
+
creatorOptions.stopUndoRedoTransaction();
|
|
46373
|
+
}
|
|
46374
|
+
});
|
|
46375
|
+
}
|
|
46376
|
+
});
|
|
46377
|
+
}
|
|
46378
|
+
function collectLocalizableStrings(survey, options, translateObj) {
|
|
46379
|
+
collectStringsByObj(survey, options, translateObj);
|
|
46380
|
+
}
|
|
46381
|
+
function getUnlocalizedStrings(survey, creatorOptions, loc) {
|
|
46382
|
+
var res = new Array();
|
|
46383
|
+
var options = {
|
|
46384
|
+
canShowProperty: function (reason, obj, property, locStr, isShowing, defaultValue) {
|
|
46385
|
+
return isShowing && (!locStr || !(locStr === null || locStr === void 0 ? void 0 : locStr.isEmpty)) || !!defaultValue;
|
|
46386
|
+
},
|
|
46387
|
+
onAddLocalizedString: function (obj, property, locStr, translatedObj) {
|
|
46388
|
+
res.push(locStr);
|
|
46389
|
+
},
|
|
46390
|
+
onCreateNewTranslateObj: function (obj, property, translateObj) {
|
|
46391
|
+
return undefined;
|
|
46392
|
+
}
|
|
46393
|
+
};
|
|
46394
|
+
collectStringsByObj(survey, options, undefined);
|
|
46395
|
+
return res;
|
|
46396
|
+
}
|
|
46397
|
+
function collectStringsByObj(obj, options, translateObj) {
|
|
46398
|
+
if (isItemValueArray(obj)) {
|
|
46399
|
+
createItemValuesLocale(obj, options, translateObj);
|
|
46400
|
+
return;
|
|
46401
|
+
}
|
|
46402
|
+
if (!obj || !obj.getType)
|
|
46403
|
+
return;
|
|
46404
|
+
var properties = getLocalizedProperties(obj, options);
|
|
46405
|
+
for (var i_1 = 0; i_1 < properties.length; i_1++) {
|
|
46406
|
+
addLocalizationItem(obj, options, properties[i_1], translateObj);
|
|
46407
|
+
}
|
|
46408
|
+
properties = getArrayProperties(obj);
|
|
46409
|
+
for (var i = 0; i < properties.length; i++) {
|
|
46410
|
+
var property = properties[i];
|
|
46411
|
+
var value = obj[property.name];
|
|
46412
|
+
//If ItemValue array?
|
|
46413
|
+
if (isItemValueArray(value)) {
|
|
46414
|
+
if (canShowProperty("itemvalue-array", options, obj, property, Array.isArray(value) && value.length > 0)) {
|
|
46415
|
+
createGroup(options, obj[property.name], property, translateObj);
|
|
46416
|
+
}
|
|
46417
|
+
}
|
|
46418
|
+
else {
|
|
46419
|
+
for (var i_2 = 0; i_2 < value.length; i_2++) {
|
|
46420
|
+
createGroup(options, value[i_2], property, translateObj);
|
|
46421
|
+
}
|
|
46422
|
+
}
|
|
46423
|
+
}
|
|
46424
|
+
createMatrixCellsGroup(options, obj, translateObj);
|
|
46425
|
+
}
|
|
46426
|
+
function isItemValueArray(val) {
|
|
46427
|
+
return (!!val &&
|
|
46428
|
+
Array.isArray(val) &&
|
|
46429
|
+
val.length > 0 &&
|
|
46430
|
+
!!val[0] &&
|
|
46431
|
+
!!val[0]["getType"] &&
|
|
46432
|
+
!!val[0]["setData"] &&
|
|
46433
|
+
!!val[0]["setLocText"]);
|
|
46434
|
+
}
|
|
46435
|
+
function addLocalizationItem(obj, options, property, translateObj) {
|
|
46436
|
+
var locStr = getLocalizableStr(obj, property);
|
|
46437
|
+
if (!locStr)
|
|
46438
|
+
return;
|
|
46439
|
+
var defaultValue = getDefaultValue(obj, property);
|
|
46440
|
+
if (canShowProperty("add-locsr", options, obj, property, !locStr.isEmpty, defaultValue)) {
|
|
46441
|
+
options.onAddLocalizedString(obj, property, locStr, translateObj);
|
|
46442
|
+
}
|
|
46443
|
+
}
|
|
46444
|
+
function createItemValuesLocale(obj, options, translateObj) {
|
|
46445
|
+
for (var i = 0; i < obj.length; i++) {
|
|
46446
|
+
var val = obj[i];
|
|
46447
|
+
addPropertiesForItemValue(val, options, translateObj);
|
|
46448
|
+
}
|
|
46449
|
+
}
|
|
46450
|
+
function addPropertiesForItemValue(itemValue, options, translateObj) {
|
|
46451
|
+
var locProperties = getLocalizedProperties(itemValue, options, false);
|
|
46452
|
+
for (var i = 0; i < locProperties.length; i++) {
|
|
46453
|
+
var prop = locProperties[i];
|
|
46454
|
+
var isText = prop.name === "text";
|
|
46455
|
+
var reason = isText ? "itemvalue-text" : "itemvalue-customprop";
|
|
46456
|
+
var defValue = isText ? itemValue.value : undefined;
|
|
46457
|
+
var canshow = canShowProperty(reason, options, itemValue, prop, true, defValue);
|
|
46458
|
+
if (!canshow && isText)
|
|
46459
|
+
break;
|
|
46460
|
+
if (canshow) {
|
|
46461
|
+
options.onAddLocalizedString(itemValue, prop, getLocalizableStr(itemValue, prop), translateObj);
|
|
46462
|
+
}
|
|
46463
|
+
}
|
|
46464
|
+
}
|
|
46465
|
+
function getLocalizedProperties(obj, options, checkIsShowing) {
|
|
46466
|
+
if (checkIsShowing === void 0) { checkIsShowing = true; }
|
|
46467
|
+
var res = new Array();
|
|
46468
|
+
var properties = survey_core__WEBPACK_IMPORTED_MODULE_0__.Serializer.getPropertiesByObj(obj);
|
|
46469
|
+
for (var i = 0; i < properties.length; i++) {
|
|
46470
|
+
var property = properties[i];
|
|
46471
|
+
if (property.readOnly || !property.visible || !property.isSerializable || !property.isLocalizable)
|
|
46472
|
+
continue;
|
|
46473
|
+
var isShowing = ["url", "file"].indexOf(property.type) < 0;
|
|
46474
|
+
if (!checkIsShowing || canShowProperty("get-property", options, obj, property, isShowing)) {
|
|
46475
|
+
res.push(property);
|
|
46476
|
+
}
|
|
46477
|
+
}
|
|
46478
|
+
return res;
|
|
46479
|
+
}
|
|
46480
|
+
function getArrayProperties(obj) {
|
|
46481
|
+
var res = new Array();
|
|
46482
|
+
var properties = survey_core__WEBPACK_IMPORTED_MODULE_0__.Serializer.getPropertiesByObj(obj);
|
|
46483
|
+
for (var i = 0; i < properties.length; i++) {
|
|
46484
|
+
var property = properties[i];
|
|
46485
|
+
if (property.isSerializable === false)
|
|
46486
|
+
continue;
|
|
46487
|
+
var value = obj[property.name];
|
|
46488
|
+
if (!!value && Array.isArray(value) && value.length > 0) {
|
|
46489
|
+
res.push(property);
|
|
46490
|
+
}
|
|
46491
|
+
}
|
|
46492
|
+
return res;
|
|
46493
|
+
}
|
|
46494
|
+
function getLocalizableStr(obj, prop) {
|
|
46495
|
+
return obj[prop.serializationProperty];
|
|
46496
|
+
}
|
|
46497
|
+
function createGroup(options, obj, property, translateObj) {
|
|
46498
|
+
if (!!obj && (obj.getType || Array.isArray(obj))) {
|
|
46499
|
+
translateObj = options.onCreateNewTranslateObj(obj, property, translateObj);
|
|
46500
|
+
collectStringsByObj(obj, options, translateObj);
|
|
46501
|
+
}
|
|
46502
|
+
}
|
|
46503
|
+
function canShowProperty(reason, options, obj, property, isShowing, defaultValue) {
|
|
46504
|
+
if (options.canShowProperty) {
|
|
46505
|
+
return options.canShowProperty(reason, obj, property, getLocalizableStr(obj, property), isShowing, defaultValue);
|
|
46506
|
+
}
|
|
46507
|
+
return isShowing;
|
|
46508
|
+
}
|
|
46509
|
+
function createMatrixCellsGroup(options, obj, translateObj) {
|
|
46510
|
+
survey_core__WEBPACK_IMPORTED_MODULE_0__.Serializer.getPropertiesByObj(obj).forEach(function (prop) {
|
|
46511
|
+
if (prop.type === "cells" && canShowProperty("matrix-cell", options, obj, prop, true)) {
|
|
46512
|
+
createMatrixCellsGroupCore(options, obj, prop, translateObj);
|
|
46513
|
+
}
|
|
46514
|
+
});
|
|
46515
|
+
}
|
|
46516
|
+
function createMatrixCellsGroupCore(options, obj, prop, translateObj) {
|
|
46517
|
+
var cells = obj[prop.name];
|
|
46518
|
+
if (cells.isEmpty)
|
|
46519
|
+
return;
|
|
46520
|
+
var matrix = obj;
|
|
46521
|
+
translateObj = options.onCreateNewTranslateObj(obj, prop, translateObj);
|
|
46522
|
+
var defaultName = survey_core__WEBPACK_IMPORTED_MODULE_0__.settings.matrix.defaultRowName;
|
|
46523
|
+
var rows = [defaultName];
|
|
46524
|
+
matrix.rows.forEach(function (row) { return rows.push(row.value); });
|
|
46525
|
+
rows.forEach(function (val) {
|
|
46526
|
+
matrix.columns.forEach(function (col) {
|
|
46527
|
+
var locStr = cells.getCellDisplayLocText(val, col);
|
|
46528
|
+
if (!!locStr) {
|
|
46529
|
+
options.onAddLocalizedString(obj, prop, locStr, translateObj);
|
|
46530
|
+
}
|
|
46531
|
+
});
|
|
46532
|
+
});
|
|
46533
|
+
}
|
|
46534
|
+
function getDefaultValue(obj, prop) {
|
|
46535
|
+
var locStr = getLocalizableStr(obj, prop);
|
|
46536
|
+
if (!locStr)
|
|
46537
|
+
return "";
|
|
46538
|
+
if (prop.name == "title") {
|
|
46539
|
+
if (!!locStr && !obj.isPage && !obj.isPanel && !!locStr.onGetTextCallback)
|
|
46540
|
+
return obj["name"];
|
|
46541
|
+
}
|
|
46542
|
+
return "";
|
|
46543
|
+
}
|
|
46544
|
+
function isTextNonTranslated(text) {
|
|
46545
|
+
if (!text)
|
|
46546
|
+
return true;
|
|
46547
|
+
if (survey_core__WEBPACK_IMPORTED_MODULE_0__.Helpers.isNumber(text))
|
|
46548
|
+
return true;
|
|
46549
|
+
return text.length < 2;
|
|
46550
|
+
}
|
|
46551
|
+
|
|
46552
|
+
|
|
46261
46553
|
/***/ }),
|
|
46262
46554
|
|
|
46263
46555
|
/***/ "./src/utils/creator-utils.ts":
|
|
@@ -47400,7 +47692,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47400
47692
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
47401
47693
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_118___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_118__);
|
|
47402
47694
|
var Version;
|
|
47403
|
-
Version = "".concat("2.0.
|
|
47695
|
+
Version = "".concat("2.0.2");
|
|
47404
47696
|
//should be loaded before other styles for easier override
|
|
47405
47697
|
|
|
47406
47698
|
|
|
@@ -47524,7 +47816,7 @@ Version = "".concat("2.0.1");
|
|
|
47524
47816
|
|
|
47525
47817
|
|
|
47526
47818
|
|
|
47527
|
-
(0,survey_core__WEBPACK_IMPORTED_MODULE_118__.checkLibraryVersion)("".concat("2.0.
|
|
47819
|
+
(0,survey_core__WEBPACK_IMPORTED_MODULE_118__.checkLibraryVersion)("".concat("2.0.2"), "survey-creator-core");
|
|
47528
47820
|
|
|
47529
47821
|
})();
|
|
47530
47822
|
|