survey-creator-core 1.11.1 → 1.11.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.
Files changed (80) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1 -1
  4. package/i18n/arabic.min.js +1 -1
  5. package/i18n/bulgarian.js +1 -1
  6. package/i18n/bulgarian.min.js +1 -1
  7. package/i18n/croatian.js +1 -1
  8. package/i18n/croatian.min.js +1 -1
  9. package/i18n/czech.js +1 -1
  10. package/i18n/czech.min.js +1 -1
  11. package/i18n/danish.js +1 -1
  12. package/i18n/danish.min.js +1 -1
  13. package/i18n/dutch.js +1 -1
  14. package/i18n/dutch.min.js +1 -1
  15. package/i18n/english.js +1 -1
  16. package/i18n/english.min.js +1 -1
  17. package/i18n/finnish.js +1 -1
  18. package/i18n/finnish.min.js +1 -1
  19. package/i18n/french.js +1 -1
  20. package/i18n/french.min.js +1 -1
  21. package/i18n/german.js +1 -1
  22. package/i18n/german.min.js +1 -1
  23. package/i18n/hebrew.js +1 -1
  24. package/i18n/hebrew.min.js +1 -1
  25. package/i18n/hungarian.js +1 -1
  26. package/i18n/hungarian.min.js +1 -1
  27. package/i18n/index.js +1 -1
  28. package/i18n/index.min.js +1 -1
  29. package/i18n/indonesian.js +1 -1
  30. package/i18n/indonesian.min.js +1 -1
  31. package/i18n/italian.js +1 -1
  32. package/i18n/italian.min.js +1 -1
  33. package/i18n/japanese.js +1 -1
  34. package/i18n/japanese.min.js +1 -1
  35. package/i18n/korean.js +1 -1
  36. package/i18n/korean.min.js +1 -1
  37. package/i18n/malay.js +1 -1
  38. package/i18n/malay.min.js +1 -1
  39. package/i18n/mongolian.js +1 -1
  40. package/i18n/mongolian.min.js +1 -1
  41. package/i18n/norwegian.js +1 -1
  42. package/i18n/norwegian.min.js +1 -1
  43. package/i18n/persian.js +1 -1
  44. package/i18n/persian.min.js +1 -1
  45. package/i18n/polish.js +1 -1
  46. package/i18n/polish.min.js +1 -1
  47. package/i18n/portuguese.js +1 -1
  48. package/i18n/portuguese.min.js +1 -1
  49. package/i18n/russian.js +1 -1
  50. package/i18n/russian.min.js +1 -1
  51. package/i18n/simplified-chinese.js +1 -1
  52. package/i18n/simplified-chinese.min.js +1 -1
  53. package/i18n/slovak.js +1 -1
  54. package/i18n/slovak.min.js +1 -1
  55. package/i18n/spanish.js +1 -1
  56. package/i18n/spanish.min.js +1 -1
  57. package/i18n/swedish.js +1 -1
  58. package/i18n/swedish.min.js +1 -1
  59. package/i18n/tajik.js +1 -1
  60. package/i18n/tajik.min.js +1 -1
  61. package/i18n/traditional-chinese.js +1 -1
  62. package/i18n/traditional-chinese.min.js +1 -1
  63. package/i18n/turkish.js +1 -1
  64. package/i18n/turkish.min.js +1 -1
  65. package/package.json +2 -2
  66. package/survey-creator-core.css +17 -6
  67. package/survey-creator-core.fontless.css +16 -5
  68. package/survey-creator-core.fontless.css.map +1 -1
  69. package/survey-creator-core.fontless.min.css +2 -2
  70. package/survey-creator-core.i18n.js +1 -1
  71. package/survey-creator-core.i18n.min.js +1 -1
  72. package/survey-creator-core.js +483 -727
  73. package/survey-creator-core.js.map +1 -1
  74. package/survey-creator-core.min.css +3 -3
  75. package/survey-creator-core.min.js +3 -3
  76. package/typings/components/tabs/preview.d.ts +51 -0
  77. package/typings/components/tabs/test.d.ts +5 -47
  78. package/typings/components/tabs/theme-builder.d.ts +5 -39
  79. package/typings/components/tabs/theme-model.d.ts +4 -3
  80. package/typings/property-grid/index.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.11.1
2
+ * SurveyJS Creator v1.11.2
3
3
  * (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -130,7 +130,7 @@ License: MIT
130
130
  /***/ (function(module, exports, __webpack_require__) {
131
131
 
132
132
  /*!
133
- * surveyjs - Survey JavaScript library v1.11.1
133
+ * surveyjs - Survey JavaScript library v1.11.2
134
134
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
135
135
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
136
136
  */
@@ -14526,325 +14526,16 @@ var SurveyLogic = /** @class */ (function (_super) {
14526
14526
 
14527
14527
  /***/ }),
14528
14528
 
14529
- /***/ "./src/components/tabs/test-plugin.ts":
14530
- /*!********************************************!*\
14531
- !*** ./src/components/tabs/test-plugin.ts ***!
14532
- \********************************************/
14533
- /*! exports provided: TabTestPlugin */
14534
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
14535
-
14536
- "use strict";
14537
- __webpack_require__.r(__webpack_exports__);
14538
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabTestPlugin", function() { return TabTestPlugin; });
14539
- /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
14540
- /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
14541
- /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
14542
- /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../editorLocalization */ "./src/editorLocalization.ts");
14543
- /* harmony import */ var _simulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../simulator */ "./src/components/simulator.ts");
14544
- /* harmony import */ var _test__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./test */ "./src/components/tabs/test.ts");
14545
-
14546
-
14547
-
14548
-
14549
-
14550
- var TabTestPlugin = /** @class */ (function () {
14551
- function TabTestPlugin(creator) {
14552
- this.creator = creator;
14553
- this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
14554
- creator.addPluginTab("test", this);
14555
- this.setPreviewTheme(this.creator.themeForPreview);
14556
- this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
14557
- }
14558
- TabTestPlugin.prototype.setDevice = function (newVal) {
14559
- this.model.simulator.device = newVal;
14560
- this.model.simulator.resetZoomParameters();
14561
- var currentType = _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][this.model.simulator.device].deviceType;
14562
- this.orientationSelectorAction.enabled = currentType != "desktop";
14563
- this.deviceSelectorAction.iconName = "icon-device-" + currentType;
14564
- this.deviceSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])("pe.simulator");
14565
- };
14566
- TabTestPlugin.prototype.setDefaultLanguageOption = function (opt) {
14567
- var _this = this;
14568
- var vis = opt === true || opt === "all" || (opt === "auto" && this.model.survey.getUsedLocales().length > 1);
14569
- this.languageSelectorAction.visible = vis;
14570
- var languages = [];
14571
- if (vis) {
14572
- languages = this.getLanguages(opt !== "all" ? this.model.survey.getUsedLocales() : null);
14573
- }
14574
- this.languageSelectorAction.popupModel.contentComponentData.model.setItems(languages);
14575
- this.languageSelectorAction.data.selectedItem = languages.filter(function (lang) { return lang.id === _this.model.activeLanguage; })[0];
14576
- };
14577
- TabTestPlugin.prototype.getLanguages = function (usedLanguages) {
14578
- if (usedLanguages === void 0) { usedLanguages = null; }
14579
- var res = [];
14580
- var locales = !!usedLanguages && usedLanguages.length > 1 ? usedLanguages : survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].getLocales();
14581
- for (var i = 0; i < locales.length; i++) {
14582
- var loc = locales[i];
14583
- res.push({ id: loc, title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(loc) });
14584
- }
14585
- return res;
14586
- };
14587
- TabTestPlugin.prototype.updateActions = function () {
14588
- this.languageSelectorAction.title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(this.model.activeLanguage);
14589
- this.languageSelectorAction.visible = true;
14590
- if (this.creator.showSimulatorInTestSurveyTab) {
14591
- this.setDevice(this.model.simulator.device);
14592
- this.deviceSelectorAction.data.selectedItem = { id: this.model.simulator.device };
14593
- this.orientationSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])("pe.portraitOrientation");
14594
- }
14595
- if (this.creator.showInvisibleElementsInTestSurveyTab) {
14596
- this.invisibleToggleAction.css = this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
14597
- this.invisibleToggleAction.visible = this.model.isRunning;
14598
- }
14599
- if (this.creator.showDefaultLanguageInTestSurveyTab != undefined) {
14600
- this.setDefaultLanguageOption(this.creator.showDefaultLanguageInTestSurveyTab);
14601
- }
14602
- };
14603
- TabTestPlugin.prototype.setPreviewTheme = function (themeName) {
14604
- this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][themeName] || survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
14605
- };
14606
- TabTestPlugin.prototype.createVisibleUpdater = function () {
14607
- var _this = this;
14608
- return new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.creator.activeTab === "test"; });
14609
- };
14610
- TabTestPlugin.prototype.activate = function () {
14611
- this.model = new _test__WEBPACK_IMPORTED_MODULE_4__["TestSurveyTabViewModel"](this.creator, this.simulatorTheme);
14612
- this.model.simulator.landscape = this.creator.previewOrientation != "portrait";
14613
- this.update();
14614
- };
14615
- TabTestPlugin.prototype.update = function () {
14616
- var _this = this;
14617
- if (!this.model)
14618
- return;
14619
- var options = {
14620
- showPagesInTestSurveyTab: this.creator.showPagesInTestSurveyTab,
14621
- };
14622
- this.model.testAgainAction = this.testAgainAction;
14623
- this.model.prevPageAction = this.prevPageAction;
14624
- this.model.nextPageAction = this.nextPageAction;
14625
- this.model.initialize(this.creator.JSON, options);
14626
- this.updateActions();
14627
- this.model.show();
14628
- this.model.onPropertyChanged.add(function (sender, options) {
14629
- if (options.name === "isRunning") {
14630
- _this.invisibleToggleAction && (_this.invisibleToggleAction.visible = _this.model.isRunning);
14631
- _this.testAgainAction.visible = !_this.model.isRunning;
14632
- }
14633
- });
14634
- };
14635
- TabTestPlugin.prototype.deactivate = function () {
14636
- if (this.model) {
14637
- this.simulatorTheme = this.model.simulator.survey.css;
14638
- this.model.onSurveyCreatedCallback = undefined;
14639
- this.model.dispose();
14640
- this.model = undefined;
14641
- }
14642
- this.languageSelectorAction.visible = false;
14643
- this.testAgainAction.visible = false;
14644
- this.invisibleToggleAction && (this.invisibleToggleAction.visible = false);
14645
- return true;
14646
- };
14647
- TabTestPlugin.prototype.getAvailableThemes = function (themeMapper) {
14648
- var availableThemesToItems = [];
14649
- for (var i = 0; i < themeMapper.length; i++) {
14650
- var item = themeMapper[i];
14651
- var action = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({ id: item.name + "_themeSwitcher", locTitleName: this.getThemeLocName(item.name) });
14652
- action.value = item.name;
14653
- availableThemesToItems.push(action);
14654
- }
14655
- return availableThemesToItems;
14656
- };
14657
- TabTestPlugin.prototype.getThemeLocName = function (name) {
14658
- return "ed." + name + "Theme";
14659
- };
14660
- TabTestPlugin.prototype.createActions = function () {
14661
- var _this = this;
14662
- var items = [];
14663
- this.testAgainAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14664
- id: "testSurveyAgain",
14665
- visible: false,
14666
- locTitleName: "ed.testSurveyAgain",
14667
- action: function () {
14668
- _this.model.testAgain();
14669
- }
14670
- });
14671
- if (this.creator.showSimulatorInTestSurveyTab) {
14672
- var deviceSelectorItems = Object.keys(_simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"])
14673
- .filter(function (key) { return !!_simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].title; })
14674
- .map(function (key) { var _a; return ({ id: key, title: _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].title, visibleIndex: (_a = _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].visibleIndex) !== null && _a !== void 0 ? _a : Number.MAX_VALUE }); });
14675
- this.deviceSelectorAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
14676
- id: "deviceSelector",
14677
- iconName: "icon-device-desktop",
14678
- mode: "small",
14679
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14680
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
14681
- }),
14682
- }, {
14683
- items: deviceSelectorItems,
14684
- allowSelection: true,
14685
- onSelectionChanged: function (item) { _this.setDevice(item.id); },
14686
- horizontalPosition: "center",
14687
- onHide: function () { _this.deviceSelectorAction.enabled = true; },
14688
- onShow: function () { _this.deviceSelectorAction.enabled = false; }
14689
- });
14690
- items.push(this.deviceSelectorAction);
14691
- this.orientationSelectorAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14692
- id: "orientationSelector",
14693
- iconName: "icon-device-rotate",
14694
- mode: "small",
14695
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14696
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
14697
- }),
14698
- action: function () {
14699
- _this.model.simulator.landscape = !_this.model.simulator.landscape;
14700
- _this.orientationSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])(!_this.model.simulator.landscape ? "pe.landscapeOrientation" : "pe.portraitOrientation");
14701
- }
14702
- });
14703
- items.push(this.orientationSelectorAction);
14704
- }
14705
- if (this.creator.showInvisibleElementsInTestSurveyTab) {
14706
- this.invisibleToggleAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14707
- id: "showInvisible",
14708
- iconName: "icon-invisible-items",
14709
- mode: "small",
14710
- needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14711
- return !_this.creator.isMobileView;
14712
- }),
14713
- locTitleName: "ts.showInvisibleElements",
14714
- visible: false,
14715
- action: function () {
14716
- _this.model.showInvisibleElements = !_this.model.showInvisibleElements;
14717
- _this.invisibleToggleAction.css = _this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
14718
- _this.invisibleToggleAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])(!_this.model.showInvisibleElements ? "ts.showInvisibleElements" : "ts.hideInvisibleElements");
14719
- }
14720
- });
14721
- items.push(this.invisibleToggleAction);
14722
- }
14723
- var themeMapper = survey_core__WEBPACK_IMPORTED_MODULE_1__["StylesManager"].getIncludedThemeCss();
14724
- var sequence = ["defaultV2", "modern", "default"];
14725
- themeMapper = themeMapper.sort(function (theme1, theme2) {
14726
- return sequence.indexOf(theme1.name) > sequence.indexOf(theme2.name) ? 1 : -1;
14727
- });
14728
- var availableThemesToItems = this.getAvailableThemes(themeMapper);
14729
- if (this.creator.allowChangeThemeInPreview && availableThemesToItems.length > 1 && !this.creator.showThemeTab) {
14730
- this.changeThemeModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ListModel"](availableThemesToItems, function (item) {
14731
- if (!!_this.model) {
14732
- _this.model.setTheme(item.value, themeMapper);
14733
- }
14734
- _this.changeThemeAction.locTitleName = _this.getThemeLocName(item.value);
14735
- _this.changeThemeAction.locStrsChanged();
14736
- _this.changeThemePopupModel.toggleVisibility();
14737
- }, true);
14738
- this.changeThemeModel.locOwner = this.creator;
14739
- this.changeThemePopupModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["PopupModel"]("sv-list", { model: this.changeThemeModel }, "bottom", "center");
14740
- var getStartThemeName = function () {
14741
- var availableThemes = themeMapper.filter(function (item) { return item.theme.root === _this.simulatorTheme.root; });
14742
- return availableThemes.length > 0 ? availableThemes[0].name : "defaultV2";
14743
- };
14744
- this.changeThemeAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14745
- id: "themeSwitcher",
14746
- iconName: "icon-theme",
14747
- component: "sv-action-bar-item-dropdown",
14748
- mode: "large",
14749
- locTitleName: this.getThemeLocName(getStartThemeName()),
14750
- needSeparator: true,
14751
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14752
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.showSimulatorInTestSurveyTab, _this.creator.activeTab === "test");
14753
- }),
14754
- action: function () {
14755
- _this.changeThemePopupModel.toggleVisibility();
14756
- },
14757
- popupModel: this.changeThemePopupModel
14758
- });
14759
- items.push(this.changeThemeAction);
14760
- }
14761
- this.languageSelectorAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
14762
- id: "languageSelector",
14763
- iconName: "icon-language",
14764
- visible: false,
14765
- mode: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14766
- return _this.creator.isMobileView ? "small" : "large";
14767
- }),
14768
- }, {
14769
- items: [],
14770
- allowSelection: true,
14771
- onSelectionChanged: function (item) {
14772
- _this.model.activeLanguage = item.id;
14773
- _this.languageSelectorAction.title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(item.id);
14774
- },
14775
- horizontalPosition: "center",
14776
- onHide: function () { _this.languageSelectorAction.enabled = true; },
14777
- onShow: function () { _this.languageSelectorAction.enabled = false; }
14778
- });
14779
- items.push(this.languageSelectorAction);
14780
- this.designerAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14781
- id: "svd-designer",
14782
- iconName: "icon-config",
14783
- action: function () { _this.creator.makeNewViewActive("designer"); },
14784
- visible: this.createVisibleUpdater(),
14785
- locTitleName: "ed.designer",
14786
- showTitle: false
14787
- });
14788
- this.previewAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14789
- id: "svd-preview",
14790
- iconName: "icon-preview",
14791
- active: true,
14792
- visible: this.createVisibleUpdater(),
14793
- locTitleName: "tabs.preview",
14794
- showTitle: false,
14795
- action: function () { }
14796
- });
14797
- this.prevPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14798
- id: "prevPage",
14799
- iconName: "icon-arrow-left_16x16",
14800
- needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14801
- return _this.creator.isMobileView;
14802
- }),
14803
- visible: false
14804
- });
14805
- this.nextPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14806
- id: "nextPage",
14807
- iconName: "icon-arrow-right_16x16",
14808
- visible: false
14809
- });
14810
- return items;
14811
- };
14812
- TabTestPlugin.prototype.addFooterActions = function () {
14813
- this.creator.footerToolbar.actions.push(this.designerAction);
14814
- this.creator.footerToolbar.actions.push(this.previewAction);
14815
- this.creator.footerToolbar.actions.push(this.prevPageAction);
14816
- this.creator.footerToolbar.actions.push(this.nextPageAction);
14817
- this.invisibleToggleAction && (this.creator.footerToolbar.actions.push(this.invisibleToggleAction));
14818
- // this.languageSelectorAction && (this.creator.footerToolbar.actions.push(this.languageSelectorAction));
14819
- };
14820
- return TabTestPlugin;
14821
- }());
14822
-
14823
-
14824
-
14825
- /***/ }),
14826
-
14827
- /***/ "./src/components/tabs/test.scss":
14828
- /*!***************************************!*\
14829
- !*** ./src/components/tabs/test.scss ***!
14830
- \***************************************/
14831
- /*! no static exports found */
14832
- /***/ (function(module, exports, __webpack_require__) {
14833
-
14834
- // extracted by mini-css-extract-plugin
14835
-
14836
- /***/ }),
14837
-
14838
- /***/ "./src/components/tabs/test.ts":
14839
- /*!*************************************!*\
14840
- !*** ./src/components/tabs/test.ts ***!
14841
- \*************************************/
14842
- /*! exports provided: TestSurveyTabViewModel */
14529
+ /***/ "./src/components/tabs/preview.ts":
14530
+ /*!****************************************!*\
14531
+ !*** ./src/components/tabs/preview.ts ***!
14532
+ \****************************************/
14533
+ /*! exports provided: PreviewViewModel */
14843
14534
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
14844
14535
 
14845
14536
  "use strict";
14846
14537
  __webpack_require__.r(__webpack_exports__);
14847
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestSurveyTabViewModel", function() { return TestSurveyTabViewModel; });
14538
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreviewViewModel", function() { return PreviewViewModel; });
14848
14539
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
14849
14540
  /* harmony import */ var _simulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../simulator */ "./src/components/simulator.ts");
14850
14541
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! survey-core */ "survey-core");
@@ -14853,23 +14544,22 @@ __webpack_require__.r(__webpack_exports__);
14853
14544
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
14854
14545
 
14855
14546
 
14856
- __webpack_require__(/*! ./test.scss */ "./src/components/tabs/test.scss");
14857
14547
 
14858
14548
 
14859
14549
 
14860
- var TestSurveyTabViewModel = /** @class */ (function (_super) {
14861
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TestSurveyTabViewModel, _super);
14862
- function TestSurveyTabViewModel(surveyProvider, startTheme) {
14863
- if (startTheme === void 0) { startTheme = survey_core__WEBPACK_IMPORTED_MODULE_2__["defaultV2Css"]; }
14550
+ var PreviewViewModel = /** @class */ (function (_super) {
14551
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PreviewViewModel, _super);
14552
+ function PreviewViewModel(surveyProvider, startThemeClasses) {
14553
+ if (startThemeClasses === void 0) { startThemeClasses = survey_core__WEBPACK_IMPORTED_MODULE_2__["defaultV2Css"]; }
14864
14554
  var _this = _super.call(this) || this;
14865
14555
  _this.surveyProvider = surveyProvider;
14866
- _this.startTheme = startTheme;
14556
+ _this.startThemeClasses = startThemeClasses;
14867
14557
  _this.enableInvisiblePages = true;
14868
14558
  _this.pages = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ActionContainer"]();
14869
14559
  _this.simulator = new _simulator__WEBPACK_IMPORTED_MODULE_1__["SurveySimulatorModel"]();
14870
14560
  return _this;
14871
14561
  }
14872
- Object.defineProperty(TestSurveyTabViewModel.prototype, "activeLanguage", {
14562
+ Object.defineProperty(PreviewViewModel.prototype, "activeLanguage", {
14873
14563
  get: function () {
14874
14564
  return this.getPropertyValue("activeLanguage", this.survey.locale || survey_core__WEBPACK_IMPORTED_MODULE_2__["surveyLocalization"].defaultLocale);
14875
14565
  },
@@ -14882,44 +14572,44 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
14882
14572
  enumerable: false,
14883
14573
  configurable: true
14884
14574
  });
14885
- Object.defineProperty(TestSurveyTabViewModel.prototype, "survey", {
14575
+ Object.defineProperty(PreviewViewModel.prototype, "survey", {
14886
14576
  get: function () {
14887
14577
  return this.simulator.survey;
14888
14578
  },
14889
14579
  enumerable: false,
14890
14580
  configurable: true
14891
14581
  });
14892
- Object.defineProperty(TestSurveyTabViewModel.prototype, "pageActions", {
14582
+ Object.defineProperty(PreviewViewModel.prototype, "pageActions", {
14893
14583
  get: function () {
14894
14584
  return this.pages.actions;
14895
14585
  },
14896
14586
  enumerable: false,
14897
14587
  configurable: true
14898
14588
  });
14899
- Object.defineProperty(TestSurveyTabViewModel.prototype, "isPageToolbarVisible", {
14589
+ Object.defineProperty(PreviewViewModel.prototype, "isPageToolbarVisible", {
14900
14590
  get: function () {
14901
14591
  return this.pages.visibleActions.length > 0 && !this.surveyProvider.isMobileView;
14902
14592
  },
14903
14593
  enumerable: false,
14904
14594
  configurable: true
14905
14595
  });
14906
- Object.defineProperty(TestSurveyTabViewModel.prototype, "isMobileView", {
14596
+ Object.defineProperty(PreviewViewModel.prototype, "isMobileView", {
14907
14597
  get: function () {
14908
14598
  return this.surveyProvider.isMobileView;
14909
14599
  },
14910
14600
  enumerable: false,
14911
14601
  configurable: true
14912
14602
  });
14913
- Object.defineProperty(TestSurveyTabViewModel.prototype, "showResults", {
14603
+ Object.defineProperty(PreviewViewModel.prototype, "showResults", {
14914
14604
  get: function () {
14915
- return this.surveyProvider.previewShowResults && !this.isRunning && !this.isMobileView;
14605
+ return this.getShowResults();
14916
14606
  },
14917
14607
  enumerable: false,
14918
14608
  configurable: true
14919
14609
  });
14920
- TestSurveyTabViewModel.prototype.updateSimulatorSurvey = function (json, theme) {
14610
+ PreviewViewModel.prototype.updateSimulatorSurvey = function (json, theme) {
14921
14611
  var _this = this;
14922
- var newSurvey = this.surveyProvider.createSurvey(json || {}, "test", this, function (survey) {
14612
+ var newSurvey = this.surveyProvider.createSurvey(json || {}, this.getTabName(), this, function (survey) {
14923
14613
  survey.applyTheme(_this.surveyProvider.theme);
14924
14614
  survey.setCss(theme, false);
14925
14615
  survey.fitToContainer = true;
@@ -14968,7 +14658,7 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
14968
14658
  this.show();
14969
14659
  }
14970
14660
  };
14971
- TestSurveyTabViewModel.prototype.setJSON = function (json, currTheme) {
14661
+ PreviewViewModel.prototype.setJSON = function (json, currTheme) {
14972
14662
  this.json = json;
14973
14663
  if (json != null) {
14974
14664
  if (json.cookieName) {
@@ -14977,30 +14667,30 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
14977
14667
  }
14978
14668
  this.updateSimulatorSurvey(json, currTheme);
14979
14669
  };
14980
- TestSurveyTabViewModel.prototype.initialize = function (json, options) {
14981
- this.setJSON(json, this.startTheme);
14670
+ PreviewViewModel.prototype.initialize = function (json, options) {
14671
+ this.setJSON(json, this.startThemeClasses);
14982
14672
  this.updatePageList();
14983
14673
  if (options.showPagesInTestSurveyTab !== undefined) {
14984
14674
  this.showPagesInTestSurveyTab = options.showPagesInTestSurveyTab;
14985
14675
  }
14986
14676
  this.buildActions();
14987
14677
  };
14988
- TestSurveyTabViewModel.prototype.updatePageItem = function (page) {
14678
+ PreviewViewModel.prototype.updatePageItem = function (page) {
14989
14679
  var item = this.getPageItemByPage(page);
14990
14680
  if (item) {
14991
14681
  item.enabled = this.enableInvisiblePages || page.isVisible;
14992
14682
  }
14993
14683
  };
14994
- TestSurveyTabViewModel.prototype.getCurrentPageItem = function () {
14684
+ PreviewViewModel.prototype.getCurrentPageItem = function () {
14995
14685
  return this.pageListItems[this.survey.pages.indexOf(this.survey.activePage)];
14996
14686
  };
14997
- TestSurveyTabViewModel.prototype.getSelectPageTitle = function () {
14687
+ PreviewViewModel.prototype.getSelectPageTitle = function () {
14998
14688
  return (this.activePage && this.getPageTitle(this.activePage, "preview-tab:selected-page", "survey-tester-selected")) || Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("ts.selectPage");
14999
14689
  };
15000
- TestSurveyTabViewModel.prototype.getPageTitle = function (page, area, reason) {
14690
+ PreviewViewModel.prototype.getPageTitle = function (page, area, reason) {
15001
14691
  if (area === void 0) { area = "preview-tab:page-list"; }
15002
14692
  if (reason === void 0) { reason = "survey-tester"; }
15003
- var pageTitle = page.title.replace(TestSurveyTabViewModel.tagRegex, "");
14693
+ var pageTitle = page.title.replace(PreviewViewModel.tagRegex, "");
15004
14694
  var title = this.surveyProvider.getObjectDisplayName(page, area, reason, pageTitle);
15005
14695
  if (title === page.name && title.indexOf("page") === 0) {
15006
14696
  var index = this.survey.pages.indexOf(page);
@@ -15008,7 +14698,7 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15008
14698
  }
15009
14699
  return title;
15010
14700
  };
15011
- TestSurveyTabViewModel.prototype.updatePageList = function () {
14701
+ PreviewViewModel.prototype.updatePageList = function () {
15012
14702
  var pages = [];
15013
14703
  for (var i = 0; i < this.survey.pages.length; i++) {
15014
14704
  var page = this.survey.pages[i];
@@ -15022,18 +14712,20 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15022
14712
  }
15023
14713
  this.pageListItems = pages;
15024
14714
  };
15025
- TestSurveyTabViewModel.prototype.show = function () {
14715
+ PreviewViewModel.prototype.getTabName = function () { return ""; };
14716
+ PreviewViewModel.prototype.getShowResults = function () { return false; };
14717
+ PreviewViewModel.prototype.show = function () {
15026
14718
  this.showInvisibleElements = false;
15027
14719
  this.activePage = this.survey.activePage;
15028
14720
  this.survey.locale = this.activeLanguage;
15029
14721
  this.isRunning = true;
15030
14722
  };
15031
- TestSurveyTabViewModel.prototype.testAgain = function () {
14723
+ PreviewViewModel.prototype.testAgain = function () {
15032
14724
  this.setJSON(this.json, this.simulator.survey.css);
15033
14725
  this.updatePageList();
15034
14726
  this.show();
15035
14727
  };
15036
- TestSurveyTabViewModel.prototype.buildActions = function () {
14728
+ PreviewViewModel.prototype.buildActions = function () {
15037
14729
  var _this = this;
15038
14730
  var pageActions = [];
15039
14731
  var setNearPage = function (isNext) {
@@ -15055,7 +14747,8 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15055
14747
  if (this.prevPageAction) {
15056
14748
  this.prevPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15057
14749
  var isRunning = _this.survey.state === "running";
15058
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, _this.surveyProvider.activeTab === "test", _this.pageListItems.length > 1) && isRunning;
14750
+ var isActiveTab = _this.getTabName() === _this.surveyProvider.activeTab;
14751
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
15059
14752
  });
15060
14753
  this.prevPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15061
14754
  return _this.surveyProvider.isMobileView ? "icon-arrow-left" : "icon-arrow-left_16x16";
@@ -15077,6 +14770,9 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15077
14770
  selectedItem: this.getCurrentPageItem(),
15078
14771
  onSelectionChanged: function (item) {
15079
14772
  _this.activePage = item.data;
14773
+ for (var i = 0; i < _this.survey.pages.length && _this.survey.pages[i] !== _this.activePage; i++) {
14774
+ _this.survey.pages[i].passed = true;
14775
+ }
15080
14776
  },
15081
14777
  verticalPosition: "top",
15082
14778
  horizontalPosition: "center"
@@ -15088,7 +14784,8 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15088
14784
  if (this.nextPageAction) {
15089
14785
  this.nextPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15090
14786
  var isRunning = _this.survey.state === "running";
15091
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, _this.surveyProvider.activeTab === "test", _this.pageListItems.length > 1) && isRunning;
14787
+ var isActiveTab = _this.getTabName() === _this.surveyProvider.activeTab;
14788
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
15092
14789
  });
15093
14790
  this.nextPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15094
14791
  return _this.surveyProvider.isMobileView ? "icon-arrow-right" : "icon-arrow-right_16x16";
@@ -15103,13 +14800,13 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15103
14800
  this.pages.containerCss = "sv-action-bar--pages";
15104
14801
  this.updatePrevNextPageActionState();
15105
14802
  };
15106
- TestSurveyTabViewModel.prototype.setActivePageItem = function (page, val) {
14803
+ PreviewViewModel.prototype.setActivePageItem = function (page, val) {
15107
14804
  var item = this.getPageItemByPage(page);
15108
14805
  if (item) {
15109
14806
  item.active = val;
15110
14807
  }
15111
14808
  };
15112
- TestSurveyTabViewModel.prototype.getPageItemByPage = function (page) {
14809
+ PreviewViewModel.prototype.getPageItemByPage = function (page) {
15113
14810
  var model = this.selectPageAction.popupModel.contentComponentData.model;
15114
14811
  if (!model || !Array.isArray(model.actions))
15115
14812
  return undefined;
@@ -15120,11 +14817,11 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15120
14817
  }
15121
14818
  return null;
15122
14819
  };
15123
- TestSurveyTabViewModel.prototype.updateResultsTemplate = function (theme) {
14820
+ PreviewViewModel.prototype.updateResultsTemplate = function (theme) {
15124
14821
  this.simulator.survey.setCss(theme, false);
15125
14822
  this.simulator.survey.render();
15126
14823
  };
15127
- TestSurveyTabViewModel.prototype.setTheme = function (themeName, themeMapper) {
14824
+ PreviewViewModel.prototype.setTheme = function (themeName, themeMapper) {
15128
14825
  var availableThemes = themeMapper.filter(function (item) { return item.name === themeName; });
15129
14826
  var theme = survey_core__WEBPACK_IMPORTED_MODULE_2__["defaultV2Css"];
15130
14827
  if (availableThemes.length > 0) {
@@ -15132,7 +14829,7 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15132
14829
  }
15133
14830
  this.isRunning ? this.updateSimulatorSurvey(this.json, theme) : this.updateResultsTemplate(theme);
15134
14831
  };
15135
- TestSurveyTabViewModel.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
14832
+ PreviewViewModel.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
15136
14833
  _super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);
15137
14834
  if (!this.pages.hasActions)
15138
14835
  return;
@@ -15146,374 +14843,27 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15146
14843
  this.selectPageAction.visible = this.isRunning && this.pageListItems.length > 1 && this.showPagesInTestSurveyTab;
15147
14844
  }
15148
14845
  };
15149
- TestSurveyTabViewModel.prototype.updatePrevNextPageActionState = function () {
14846
+ PreviewViewModel.prototype.updatePrevNextPageActionState = function () {
15150
14847
  if (!this.prevPageAction || !this.survey)
15151
14848
  return;
15152
14849
  var isPrevEnabled = this.survey.firstPageIsStarted && this.survey.state !== "starting"
15153
14850
  || (!this.survey.firstPageIsStarted && !this.survey.isFirstPage);
15154
- // this.prevPageAction.css = isPrevEnabled ? "sv-action-bar-item--secondary" : "";
15155
14851
  this.prevPageAction.enabled = isPrevEnabled;
15156
14852
  var isNextEnabled = this.survey && this.survey.visiblePages.indexOf(this.activePage) !== this.survey.visiblePages.length - 1;
15157
- // this.nextPageAction.css = isNextEnabled ? "sv-action-bar-item--secondary" : "";
15158
14853
  this.nextPageAction.enabled = isNextEnabled;
15159
14854
  };
15160
- TestSurveyTabViewModel.prototype.onScroll = function () {
14855
+ PreviewViewModel.prototype.onScroll = function () {
15161
14856
  this.survey.onScroll();
15162
14857
  return true;
15163
14858
  };
15164
- TestSurveyTabViewModel.prototype.dispose = function () {
14859
+ PreviewViewModel.prototype.dispose = function () {
15165
14860
  if (this.selectPageAction) {
15166
14861
  this.selectPageAction.dispose();
15167
14862
  }
15168
14863
  this.simulator.dispose();
15169
14864
  _super.prototype.dispose.call(this);
15170
14865
  };
15171
- TestSurveyTabViewModel.tagRegex = /(<([^>]+)>)/ig;
15172
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15173
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15174
- defaultValue: false,
15175
- onSet: function (val, target) {
15176
- target.simulator.survey.showInvisibleElements = val;
15177
- }
15178
- })
15179
- ], TestSurveyTabViewModel.prototype, "showInvisibleElements", void 0);
15180
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15181
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
15182
- ], TestSurveyTabViewModel.prototype, "showPagesInTestSurveyTab", void 0);
15183
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15184
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15185
- defaultValue: true,
15186
- onSet: function (value, target) {
15187
- if (!!target.simulator)
15188
- target.simulator.isRunning = value;
15189
- }
15190
- })
15191
- ], TestSurveyTabViewModel.prototype, "isRunning", void 0);
15192
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15193
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
15194
- ], TestSurveyTabViewModel.prototype, "pageListItems", void 0);
15195
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15196
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15197
- onSet: function (val, target) {
15198
- if (!!val) {
15199
- var survey = target.simulator.survey;
15200
- if (survey.firstPageIsStarted) {
15201
- if (val === survey.pages[0]) {
15202
- survey.clear(false, true);
15203
- }
15204
- else {
15205
- if (survey.state == "starting") {
15206
- survey.setPropertyValue("isStartedState", false);
15207
- }
15208
- }
15209
- }
15210
- if (survey.state !== "starting") {
15211
- survey.currentPage = val;
15212
- }
15213
- }
15214
- target.updatePrevNextPageActionState();
15215
- }
15216
- })
15217
- ], TestSurveyTabViewModel.prototype, "activePage", void 0);
15218
- return TestSurveyTabViewModel;
15219
- }(survey_core__WEBPACK_IMPORTED_MODULE_2__["Base"]));
15220
-
15221
-
15222
-
15223
- /***/ }),
15224
-
15225
- /***/ "./src/components/tabs/theme-builder.scss":
15226
- /*!************************************************!*\
15227
- !*** ./src/components/tabs/theme-builder.scss ***!
15228
- \************************************************/
15229
- /*! no static exports found */
15230
- /***/ (function(module, exports, __webpack_require__) {
15231
-
15232
- // extracted by mini-css-extract-plugin
15233
-
15234
- /***/ }),
15235
-
15236
- /***/ "./src/components/tabs/theme-builder.ts":
15237
- /*!**********************************************!*\
15238
- !*** ./src/components/tabs/theme-builder.ts ***!
15239
- \**********************************************/
15240
- /*! exports provided: ThemeTabViewModel */
15241
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
15242
-
15243
- "use strict";
15244
- __webpack_require__.r(__webpack_exports__);
15245
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeTabViewModel", function() { return ThemeTabViewModel; });
15246
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
15247
- /* harmony import */ var _simulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../simulator */ "./src/components/simulator.ts");
15248
- /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! survey-core */ "survey-core");
15249
- /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_2__);
15250
- /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../editorLocalization */ "./src/editorLocalization.ts");
15251
- /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
15252
-
15253
-
15254
-
15255
-
15256
-
15257
- __webpack_require__(/*! ./theme-builder.scss */ "./src/components/tabs/theme-builder.scss");
15258
- var ThemeTabViewModel = /** @class */ (function (_super) {
15259
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ThemeTabViewModel, _super);
15260
- function ThemeTabViewModel(surveyProvider, startThemeClasses) {
15261
- if (startThemeClasses === void 0) { startThemeClasses = survey_core__WEBPACK_IMPORTED_MODULE_2__["defaultV2Css"]; }
15262
- var _this = _super.call(this) || this;
15263
- _this.surveyProvider = surveyProvider;
15264
- _this.startThemeClasses = startThemeClasses;
15265
- _this.pages = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ActionContainer"]();
15266
- _this.blockChanges = true;
15267
- _this.simulator = new _simulator__WEBPACK_IMPORTED_MODULE_1__["SurveySimulatorModel"]();
15268
- return _this;
15269
- }
15270
- Object.defineProperty(ThemeTabViewModel.prototype, "survey", {
15271
- get: function () {
15272
- return this.simulator.survey;
15273
- },
15274
- enumerable: false,
15275
- configurable: true
15276
- });
15277
- Object.defineProperty(ThemeTabViewModel.prototype, "pageActions", {
15278
- get: function () {
15279
- return this.pages.actions;
15280
- },
15281
- enumerable: false,
15282
- configurable: true
15283
- });
15284
- Object.defineProperty(ThemeTabViewModel.prototype, "isPageToolbarVisible", {
15285
- get: function () {
15286
- return false;
15287
- },
15288
- enumerable: false,
15289
- configurable: true
15290
- });
15291
- Object.defineProperty(ThemeTabViewModel.prototype, "currentTheme", {
15292
- get: function () {
15293
- return this.surveyProvider.theme;
15294
- },
15295
- enumerable: false,
15296
- configurable: true
15297
- });
15298
- Object.defineProperty(ThemeTabViewModel.prototype, "currentThemeCssVariables", {
15299
- get: function () {
15300
- return this.currentTheme.cssVariables || {};
15301
- },
15302
- enumerable: false,
15303
- configurable: true
15304
- });
15305
- Object.defineProperty(ThemeTabViewModel.prototype, "isMobileView", {
15306
- get: function () {
15307
- return this.surveyProvider.isMobileView;
15308
- },
15309
- enumerable: false,
15310
- configurable: true
15311
- });
15312
- Object.defineProperty(ThemeTabViewModel.prototype, "showResults", {
15313
- get: function () {
15314
- return !this.isRunning && !this.isMobileView;
15315
- },
15316
- enumerable: false,
15317
- configurable: true
15318
- });
15319
- ThemeTabViewModel.prototype.updateSimulatorSurvey = function (json, theme) {
15320
- var _this = this;
15321
- var newSurvey = this.surveyProvider.createSurvey(json || {}, "theme", this, function (survey) {
15322
- survey.setCss(theme, false);
15323
- survey.fitToContainer = true;
15324
- survey.addLayoutElement({
15325
- id: "complete-customization",
15326
- container: "completePage",
15327
- component: "svc-complete-page",
15328
- data: _this
15329
- });
15330
- if (!!json && !!json.locale) {
15331
- survey.locale = json.locale;
15332
- }
15333
- survey.applyTheme(_this.currentTheme);
15334
- });
15335
- this.simulator.survey = newSurvey;
15336
- if (this.onSurveyCreatedCallback)
15337
- this.onSurveyCreatedCallback(this.survey);
15338
- var self = this;
15339
- this.survey.onComplete.add(function (sender) {
15340
- self.isRunning = false;
15341
- });
15342
- if (!!this.survey["onNavigateToUrl"]) {
15343
- this.survey["onNavigateToUrl"].add(function (sender, options) {
15344
- var url = options.url;
15345
- options.url = "";
15346
- if (!!url) {
15347
- var message = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("ed.navigateToMsg") + " '" + url + "'.";
15348
- if (!!this.surveyProvider) {
15349
- this.surveyProvider.notify(message);
15350
- }
15351
- else {
15352
- alert(message);
15353
- }
15354
- }
15355
- });
15356
- }
15357
- this.survey.onStarted.add(function (sender) {
15358
- self.setActivePageItem(self.simulator.survey.activePage, true);
15359
- });
15360
- this.survey.onCurrentPageChanged.add(function (sender, options) {
15361
- self.activePage = options.newCurrentPage;
15362
- self.setActivePageItem(options.oldCurrentPage, false);
15363
- self.setActivePageItem(options.newCurrentPage, true);
15364
- });
15365
- this.survey.onPageVisibleChanged.add(function (sender, options) {
15366
- self.updatePageItem(options.page);
15367
- _this.updatePrevNextPageActionState();
15368
- });
15369
- };
15370
- ThemeTabViewModel.prototype.setJSON = function (json, currTheme) {
15371
- this.json = json;
15372
- if (json != null) {
15373
- if (json.cookieName) {
15374
- delete json.cookieName;
15375
- }
15376
- }
15377
- this.updateSimulatorSurvey(json, currTheme);
15378
- };
15379
- ThemeTabViewModel.prototype.initialize = function (json, options) {
15380
- this.blockChanges = true;
15381
- try {
15382
- this.setJSON(json, this.startThemeClasses);
15383
- this.updatePageList();
15384
- this.buildActions();
15385
- if (options.showPagesInTestSurveyTab !== undefined) {
15386
- this.showPagesInTestSurveyTab = options.showPagesInTestSurveyTab;
15387
- }
15388
- }
15389
- finally {
15390
- this.blockChanges = false;
15391
- }
15392
- };
15393
- ThemeTabViewModel.prototype.updatePageItem = function (page) {
15394
- var item = this.getPageItemByPage(page);
15395
- if (item) {
15396
- item.enabled = page.isVisible;
15397
- }
15398
- };
15399
- ThemeTabViewModel.prototype.getCurrentPageItem = function () {
15400
- return this.pageListItems[this.survey.pages.indexOf(this.survey.activePage)];
15401
- };
15402
- ThemeTabViewModel.prototype.getSelectPageTitle = function () {
15403
- return (this.activePage && this.getPageTitle(this.activePage, "preview-tab:selected-page", "survey-tester-selected")) || Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("ts.selectPage");
15404
- };
15405
- ThemeTabViewModel.prototype.getPageTitle = function (page, area, reason) {
15406
- if (area === void 0) { area = "preview-tab:page-list"; }
15407
- if (reason === void 0) { reason = "survey-tester"; }
15408
- var title = this.surveyProvider.getObjectDisplayName(page, area, reason, page.title);
15409
- if (title === page.name && title.indexOf("page") === 0) {
15410
- var index = this.survey.pages.indexOf(page);
15411
- return _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.pageTypeName") + " " + (index + 1);
15412
- }
15413
- return title;
15414
- };
15415
- ThemeTabViewModel.prototype.updatePageList = function () {
15416
- var pages = [];
15417
- for (var i = 0; i < this.survey.pages.length; i++) {
15418
- var page = this.survey.pages[i];
15419
- pages.push({
15420
- id: page.name,
15421
- data: page,
15422
- title: this.getPageTitle(page),
15423
- enabled: page.isVisible,
15424
- visible: true
15425
- });
15426
- }
15427
- this.pageListItems = pages;
15428
- };
15429
- ThemeTabViewModel.prototype.show = function () {
15430
- this.showInvisibleElements = false;
15431
- this.activePage = this.survey.activePage;
15432
- this.isRunning = true;
15433
- };
15434
- ThemeTabViewModel.prototype.testAgain = function () {
15435
- this.setJSON(this.json, this.simulator.survey.css);
15436
- this.updatePageList();
15437
- this.show();
15438
- };
15439
- ThemeTabViewModel.prototype.buildActions = function () {
15440
- var _this = this;
15441
- var pageActions = [];
15442
- var setNearPage = function (isNext) {
15443
- var currentIndex = _this.survey.currentPageNo;
15444
- var shift = isNext ? 1 : -1;
15445
- var newIndex = currentIndex + shift;
15446
- if (_this.survey.state === "starting" && isNext) {
15447
- newIndex = 0;
15448
- }
15449
- var nearPage = _this.survey.visiblePages[newIndex];
15450
- if (!isNext && currentIndex === 0 && _this.survey.firstPageIsStarted
15451
- && _this.survey.pages.length > 0) {
15452
- nearPage = _this.survey.pages[0];
15453
- }
15454
- var pageIndex = _this.survey.pages.indexOf(nearPage);
15455
- _this.activePage = _this.survey.pages[pageIndex];
15456
- };
15457
- if (this.prevPageAction) {
15458
- this.prevPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15459
- var isRunning = _this.survey.state === "running";
15460
- var isActiveTab = _this.surveyProvider.activeTab === "theme";
15461
- return _this.surveyProvider.isMobileView && Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
15462
- });
15463
- this.prevPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15464
- return _this.surveyProvider.isMobileView ? "icon-arrow-left" : "icon-arrow-left_16x16";
15465
- });
15466
- this.prevPageAction.iconSize = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15467
- return _this.surveyProvider.isMobileView ? 24 : 16;
15468
- });
15469
- this.prevPageAction.action = function () { return setNearPage(false); };
15470
- pageActions.push(this.prevPageAction);
15471
- }
15472
- if (this.nextPageAction) {
15473
- this.nextPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15474
- var isRunning = _this.survey.state === "running";
15475
- var isActiveTab = _this.surveyProvider.activeTab === "theme";
15476
- return _this.surveyProvider.isMobileView && Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
15477
- });
15478
- this.nextPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15479
- return _this.surveyProvider.isMobileView ? "icon-arrow-right" : "icon-arrow-right_16x16";
15480
- });
15481
- this.nextPageAction.iconSize = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
15482
- return _this.surveyProvider.isMobileView ? 24 : 16;
15483
- });
15484
- this.nextPageAction.action = function () { return setNearPage(true); };
15485
- pageActions.push(this.nextPageAction);
15486
- }
15487
- this.pages.actions = pageActions;
15488
- this.pages.containerCss = "sv-action-bar--pages";
15489
- this.updatePrevNextPageActionState();
15490
- };
15491
- ThemeTabViewModel.prototype.updatePrevNextPageActionState = function () {
15492
- if (!this.prevPageAction || !this.survey)
15493
- return;
15494
- var isPrevEnabled = this.survey.firstPageIsStarted && this.survey.state !== "starting" || (!this.survey.firstPageIsStarted && !this.survey.isFirstPage);
15495
- this.prevPageAction.enabled = isPrevEnabled;
15496
- var isNextEnabled = this.survey && this.survey.visiblePages.indexOf(this.activePage) !== this.survey.visiblePages.length - 1;
15497
- this.nextPageAction.enabled = isNextEnabled;
15498
- };
15499
- ThemeTabViewModel.prototype.setActivePageItem = function (page, val) {
15500
- var item = this.getPageItemByPage(page);
15501
- if (item) {
15502
- item.active = val;
15503
- }
15504
- };
15505
- ThemeTabViewModel.prototype.getPageItemByPage = function (page) {
15506
- var items = this.pageListItems;
15507
- for (var i = 0; i < items.length; i++) {
15508
- if (items[i].data === page)
15509
- return items[i];
15510
- }
15511
- return null;
15512
- };
15513
- ThemeTabViewModel.prototype.dispose = function () {
15514
- this.simulator.dispose();
15515
- _super.prototype.dispose.call(this);
15516
- };
14866
+ PreviewViewModel.tagRegex = /(<([^>]+)>)/ig;
15517
14867
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15518
14868
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15519
14869
  defaultValue: false,
@@ -15521,10 +14871,10 @@ var ThemeTabViewModel = /** @class */ (function (_super) {
15521
14871
  target.simulator.survey.showInvisibleElements = val;
15522
14872
  }
15523
14873
  })
15524
- ], ThemeTabViewModel.prototype, "showInvisibleElements", void 0);
14874
+ ], PreviewViewModel.prototype, "showInvisibleElements", void 0);
15525
14875
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15526
14876
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
15527
- ], ThemeTabViewModel.prototype, "showPagesInTestSurveyTab", void 0);
14877
+ ], PreviewViewModel.prototype, "showPagesInTestSurveyTab", void 0);
15528
14878
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15529
14879
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15530
14880
  defaultValue: true,
@@ -15533,10 +14883,10 @@ var ThemeTabViewModel = /** @class */ (function (_super) {
15533
14883
  target.simulator.isRunning = value;
15534
14884
  }
15535
14885
  })
15536
- ], ThemeTabViewModel.prototype, "isRunning", void 0);
14886
+ ], PreviewViewModel.prototype, "isRunning", void 0);
15537
14887
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15538
14888
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
15539
- ], ThemeTabViewModel.prototype, "pageListItems", void 0);
14889
+ ], PreviewViewModel.prototype, "pageListItems", void 0);
15540
14890
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
15541
14891
  Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["property"])({
15542
14892
  onSet: function (val, target) {
@@ -15559,12 +14909,407 @@ var ThemeTabViewModel = /** @class */ (function (_super) {
15559
14909
  target.updatePrevNextPageActionState();
15560
14910
  }
15561
14911
  })
15562
- ], ThemeTabViewModel.prototype, "activePage", void 0);
15563
- return ThemeTabViewModel;
14912
+ ], PreviewViewModel.prototype, "activePage", void 0);
14913
+ return PreviewViewModel;
15564
14914
  }(survey_core__WEBPACK_IMPORTED_MODULE_2__["Base"]));
15565
14915
 
15566
14916
 
15567
14917
 
14918
+ /***/ }),
14919
+
14920
+ /***/ "./src/components/tabs/test-plugin.ts":
14921
+ /*!********************************************!*\
14922
+ !*** ./src/components/tabs/test-plugin.ts ***!
14923
+ \********************************************/
14924
+ /*! exports provided: TabTestPlugin */
14925
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14926
+
14927
+ "use strict";
14928
+ __webpack_require__.r(__webpack_exports__);
14929
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabTestPlugin", function() { return TabTestPlugin; });
14930
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
14931
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
14932
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
14933
+ /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../editorLocalization */ "./src/editorLocalization.ts");
14934
+ /* harmony import */ var _simulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../simulator */ "./src/components/simulator.ts");
14935
+ /* harmony import */ var _test__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./test */ "./src/components/tabs/test.ts");
14936
+
14937
+
14938
+
14939
+
14940
+
14941
+ var TabTestPlugin = /** @class */ (function () {
14942
+ function TabTestPlugin(creator) {
14943
+ this.creator = creator;
14944
+ this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
14945
+ creator.addPluginTab("test", this);
14946
+ this.setPreviewTheme(this.creator.themeForPreview);
14947
+ this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
14948
+ }
14949
+ TabTestPlugin.prototype.setDevice = function (newVal) {
14950
+ this.model.simulator.device = newVal;
14951
+ this.model.simulator.resetZoomParameters();
14952
+ var currentType = _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][this.model.simulator.device].deviceType;
14953
+ this.orientationSelectorAction.enabled = currentType != "desktop";
14954
+ this.deviceSelectorAction.iconName = "icon-device-" + currentType;
14955
+ this.deviceSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])("pe.simulator");
14956
+ };
14957
+ TabTestPlugin.prototype.setDefaultLanguageOption = function (opt) {
14958
+ var _this = this;
14959
+ var vis = opt === true || opt === "all" || (opt === "auto" && this.model.survey.getUsedLocales().length > 1);
14960
+ this.languageSelectorAction.visible = vis;
14961
+ var languages = [];
14962
+ if (vis) {
14963
+ languages = this.getLanguages(opt !== "all" ? this.model.survey.getUsedLocales() : null);
14964
+ }
14965
+ this.languageSelectorAction.popupModel.contentComponentData.model.setItems(languages);
14966
+ this.languageSelectorAction.data.selectedItem = languages.filter(function (lang) { return lang.id === _this.model.activeLanguage; })[0];
14967
+ };
14968
+ TabTestPlugin.prototype.getLanguages = function (usedLanguages) {
14969
+ if (usedLanguages === void 0) { usedLanguages = null; }
14970
+ var res = [];
14971
+ var locales = !!usedLanguages && usedLanguages.length > 1 ? usedLanguages : survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].getLocales();
14972
+ for (var i = 0; i < locales.length; i++) {
14973
+ var loc = locales[i];
14974
+ res.push({ id: loc, title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(loc) });
14975
+ }
14976
+ return res;
14977
+ };
14978
+ TabTestPlugin.prototype.updateActions = function () {
14979
+ this.languageSelectorAction.title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(this.model.activeLanguage);
14980
+ this.languageSelectorAction.visible = true;
14981
+ if (this.creator.showSimulatorInTestSurveyTab) {
14982
+ this.setDevice(this.model.simulator.device);
14983
+ this.deviceSelectorAction.data.selectedItem = { id: this.model.simulator.device };
14984
+ this.orientationSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])("pe.portraitOrientation");
14985
+ }
14986
+ if (this.creator.showInvisibleElementsInTestSurveyTab) {
14987
+ this.invisibleToggleAction.css = this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
14988
+ this.invisibleToggleAction.visible = this.model.isRunning;
14989
+ }
14990
+ if (this.creator.showDefaultLanguageInTestSurveyTab != undefined) {
14991
+ this.setDefaultLanguageOption(this.creator.showDefaultLanguageInTestSurveyTab);
14992
+ }
14993
+ };
14994
+ TabTestPlugin.prototype.setPreviewTheme = function (themeName) {
14995
+ this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][themeName] || survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
14996
+ };
14997
+ TabTestPlugin.prototype.createVisibleUpdater = function () {
14998
+ var _this = this;
14999
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.creator.activeTab === "test"; });
15000
+ };
15001
+ TabTestPlugin.prototype.activate = function () {
15002
+ this.model = new _test__WEBPACK_IMPORTED_MODULE_4__["TestSurveyTabViewModel"](this.creator, this.simulatorTheme);
15003
+ this.model.simulator.landscape = this.creator.previewOrientation != "portrait";
15004
+ this.update();
15005
+ };
15006
+ TabTestPlugin.prototype.update = function () {
15007
+ var _this = this;
15008
+ if (!this.model)
15009
+ return;
15010
+ var options = {
15011
+ showPagesInTestSurveyTab: this.creator.showPagesInTestSurveyTab,
15012
+ };
15013
+ this.model.testAgainAction = this.testAgainAction;
15014
+ this.model.prevPageAction = this.prevPageAction;
15015
+ this.model.nextPageAction = this.nextPageAction;
15016
+ this.model.initialize(this.creator.JSON, options);
15017
+ this.updateActions();
15018
+ this.model.show();
15019
+ this.model.onPropertyChanged.add(function (sender, options) {
15020
+ if (options.name === "isRunning") {
15021
+ _this.invisibleToggleAction && (_this.invisibleToggleAction.visible = _this.model.isRunning);
15022
+ _this.testAgainAction.visible = !_this.model.isRunning;
15023
+ }
15024
+ });
15025
+ };
15026
+ TabTestPlugin.prototype.deactivate = function () {
15027
+ if (this.model) {
15028
+ this.simulatorTheme = this.model.simulator.survey.css;
15029
+ this.model.onSurveyCreatedCallback = undefined;
15030
+ this.model.dispose();
15031
+ this.model = undefined;
15032
+ }
15033
+ this.languageSelectorAction.visible = false;
15034
+ this.testAgainAction.visible = false;
15035
+ this.invisibleToggleAction && (this.invisibleToggleAction.visible = false);
15036
+ return true;
15037
+ };
15038
+ TabTestPlugin.prototype.getAvailableThemes = function (themeMapper) {
15039
+ var availableThemesToItems = [];
15040
+ for (var i = 0; i < themeMapper.length; i++) {
15041
+ var item = themeMapper[i];
15042
+ var action = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({ id: item.name + "_themeSwitcher", locTitleName: this.getThemeLocName(item.name) });
15043
+ action.value = item.name;
15044
+ availableThemesToItems.push(action);
15045
+ }
15046
+ return availableThemesToItems;
15047
+ };
15048
+ TabTestPlugin.prototype.getThemeLocName = function (name) {
15049
+ return "ed." + name + "Theme";
15050
+ };
15051
+ TabTestPlugin.prototype.createActions = function () {
15052
+ var _this = this;
15053
+ var items = [];
15054
+ this.testAgainAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15055
+ id: "testSurveyAgain",
15056
+ visible: false,
15057
+ locTitleName: "ed.testSurveyAgain",
15058
+ action: function () {
15059
+ _this.model.testAgain();
15060
+ }
15061
+ });
15062
+ if (this.creator.showSimulatorInTestSurveyTab) {
15063
+ var deviceSelectorItems = Object.keys(_simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"])
15064
+ .filter(function (key) { return !!_simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].title; })
15065
+ .map(function (key) { var _a; return ({ id: key, title: _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].title, visibleIndex: (_a = _simulator__WEBPACK_IMPORTED_MODULE_3__["simulatorDevices"][key].visibleIndex) !== null && _a !== void 0 ? _a : Number.MAX_VALUE }); });
15066
+ this.deviceSelectorAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
15067
+ id: "deviceSelector",
15068
+ iconName: "icon-device-desktop",
15069
+ mode: "small",
15070
+ visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15071
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
15072
+ }),
15073
+ }, {
15074
+ items: deviceSelectorItems,
15075
+ allowSelection: true,
15076
+ onSelectionChanged: function (item) { _this.setDevice(item.id); },
15077
+ horizontalPosition: "center",
15078
+ onHide: function () { _this.deviceSelectorAction.enabled = true; },
15079
+ onShow: function () { _this.deviceSelectorAction.enabled = false; }
15080
+ });
15081
+ items.push(this.deviceSelectorAction);
15082
+ this.orientationSelectorAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15083
+ id: "orientationSelector",
15084
+ iconName: "icon-device-rotate",
15085
+ mode: "small",
15086
+ visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15087
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
15088
+ }),
15089
+ action: function () {
15090
+ _this.model.simulator.landscape = !_this.model.simulator.landscape;
15091
+ _this.orientationSelectorAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])(!_this.model.simulator.landscape ? "pe.landscapeOrientation" : "pe.portraitOrientation");
15092
+ }
15093
+ });
15094
+ items.push(this.orientationSelectorAction);
15095
+ }
15096
+ if (this.creator.showInvisibleElementsInTestSurveyTab) {
15097
+ this.invisibleToggleAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15098
+ id: "showInvisible",
15099
+ iconName: "icon-invisible-items",
15100
+ mode: "small",
15101
+ needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15102
+ return !_this.creator.isMobileView;
15103
+ }),
15104
+ locTitleName: "ts.showInvisibleElements",
15105
+ visible: false,
15106
+ action: function () {
15107
+ _this.model.showInvisibleElements = !_this.model.showInvisibleElements;
15108
+ _this.invisibleToggleAction.css = _this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
15109
+ _this.invisibleToggleAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_2__["getLocString"])(!_this.model.showInvisibleElements ? "ts.showInvisibleElements" : "ts.hideInvisibleElements");
15110
+ }
15111
+ });
15112
+ items.push(this.invisibleToggleAction);
15113
+ }
15114
+ var themeMapper = survey_core__WEBPACK_IMPORTED_MODULE_1__["StylesManager"].getIncludedThemeCss();
15115
+ var sequence = ["defaultV2", "modern", "default"];
15116
+ themeMapper = themeMapper.sort(function (theme1, theme2) {
15117
+ return sequence.indexOf(theme1.name) > sequence.indexOf(theme2.name) ? 1 : -1;
15118
+ });
15119
+ var availableThemesToItems = this.getAvailableThemes(themeMapper);
15120
+ if (this.creator.allowChangeThemeInPreview && availableThemesToItems.length > 1 && !this.creator.showThemeTab) {
15121
+ this.changeThemeModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ListModel"](availableThemesToItems, function (item) {
15122
+ if (!!_this.model) {
15123
+ _this.model.setTheme(item.value, themeMapper);
15124
+ }
15125
+ _this.changeThemeAction.locTitleName = _this.getThemeLocName(item.value);
15126
+ _this.changeThemeAction.locStrsChanged();
15127
+ _this.changeThemePopupModel.toggleVisibility();
15128
+ }, true);
15129
+ this.changeThemeModel.locOwner = this.creator;
15130
+ this.changeThemePopupModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["PopupModel"]("sv-list", { model: this.changeThemeModel }, "bottom", "center");
15131
+ var getStartThemeName = function () {
15132
+ var availableThemes = themeMapper.filter(function (item) { return item.theme.root === _this.simulatorTheme.root; });
15133
+ return availableThemes.length > 0 ? availableThemes[0].name : "defaultV2";
15134
+ };
15135
+ this.changeThemeAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15136
+ id: "themeSwitcher",
15137
+ iconName: "icon-theme",
15138
+ component: "sv-action-bar-item-dropdown",
15139
+ mode: "large",
15140
+ locTitleName: this.getThemeLocName(getStartThemeName()),
15141
+ needSeparator: true,
15142
+ visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15143
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["notShortCircuitAnd"])(_this.creator.showSimulatorInTestSurveyTab, _this.creator.activeTab === "test");
15144
+ }),
15145
+ action: function () {
15146
+ _this.changeThemePopupModel.toggleVisibility();
15147
+ },
15148
+ popupModel: this.changeThemePopupModel
15149
+ });
15150
+ items.push(this.changeThemeAction);
15151
+ }
15152
+ this.languageSelectorAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
15153
+ id: "languageSelector",
15154
+ iconName: "icon-language",
15155
+ visible: false,
15156
+ mode: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15157
+ return _this.creator.isMobileView ? "small" : "large";
15158
+ }),
15159
+ }, {
15160
+ items: [],
15161
+ allowSelection: true,
15162
+ onSelectionChanged: function (item) {
15163
+ _this.model.activeLanguage = item.id;
15164
+ _this.languageSelectorAction.title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getLocaleName(item.id);
15165
+ },
15166
+ horizontalPosition: "center",
15167
+ onHide: function () { _this.languageSelectorAction.enabled = true; },
15168
+ onShow: function () { _this.languageSelectorAction.enabled = false; }
15169
+ });
15170
+ items.push(this.languageSelectorAction);
15171
+ this.designerAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15172
+ id: "svd-designer",
15173
+ iconName: "icon-config",
15174
+ action: function () { _this.creator.makeNewViewActive("designer"); },
15175
+ visible: this.createVisibleUpdater(),
15176
+ locTitleName: "ed.designer",
15177
+ showTitle: false
15178
+ });
15179
+ this.previewAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15180
+ id: "svd-preview",
15181
+ iconName: "icon-preview",
15182
+ active: true,
15183
+ visible: this.createVisibleUpdater(),
15184
+ locTitleName: "tabs.preview",
15185
+ showTitle: false,
15186
+ action: function () { }
15187
+ });
15188
+ this.prevPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15189
+ id: "prevPage",
15190
+ iconName: "icon-arrow-left_16x16",
15191
+ needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
15192
+ return _this.creator.isMobileView;
15193
+ }),
15194
+ visible: false
15195
+ });
15196
+ this.nextPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
15197
+ id: "nextPage",
15198
+ iconName: "icon-arrow-right_16x16",
15199
+ visible: false
15200
+ });
15201
+ return items;
15202
+ };
15203
+ TabTestPlugin.prototype.addFooterActions = function () {
15204
+ this.creator.footerToolbar.actions.push(this.designerAction);
15205
+ this.creator.footerToolbar.actions.push(this.previewAction);
15206
+ this.creator.footerToolbar.actions.push(this.prevPageAction);
15207
+ this.creator.footerToolbar.actions.push(this.nextPageAction);
15208
+ this.invisibleToggleAction && (this.creator.footerToolbar.actions.push(this.invisibleToggleAction));
15209
+ // this.languageSelectorAction && (this.creator.footerToolbar.actions.push(this.languageSelectorAction));
15210
+ };
15211
+ return TabTestPlugin;
15212
+ }());
15213
+
15214
+
15215
+
15216
+ /***/ }),
15217
+
15218
+ /***/ "./src/components/tabs/test.scss":
15219
+ /*!***************************************!*\
15220
+ !*** ./src/components/tabs/test.scss ***!
15221
+ \***************************************/
15222
+ /*! no static exports found */
15223
+ /***/ (function(module, exports, __webpack_require__) {
15224
+
15225
+ // extracted by mini-css-extract-plugin
15226
+
15227
+ /***/ }),
15228
+
15229
+ /***/ "./src/components/tabs/test.ts":
15230
+ /*!*************************************!*\
15231
+ !*** ./src/components/tabs/test.ts ***!
15232
+ \*************************************/
15233
+ /*! exports provided: TestSurveyTabViewModel */
15234
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
15235
+
15236
+ "use strict";
15237
+ __webpack_require__.r(__webpack_exports__);
15238
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestSurveyTabViewModel", function() { return TestSurveyTabViewModel; });
15239
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
15240
+ /* harmony import */ var _preview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./preview */ "./src/components/tabs/preview.ts");
15241
+
15242
+
15243
+ __webpack_require__(/*! ./test.scss */ "./src/components/tabs/test.scss");
15244
+ var TestSurveyTabViewModel = /** @class */ (function (_super) {
15245
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TestSurveyTabViewModel, _super);
15246
+ function TestSurveyTabViewModel(surveyProvider, startThemeClasses) {
15247
+ return _super.call(this, surveyProvider, startThemeClasses) || this;
15248
+ }
15249
+ TestSurveyTabViewModel.prototype.getTabName = function () {
15250
+ return "test";
15251
+ };
15252
+ TestSurveyTabViewModel.prototype.getShowResults = function () {
15253
+ return this.surveyProvider.previewShowResults && !this.isRunning && !this.isMobileView;
15254
+ };
15255
+ return TestSurveyTabViewModel;
15256
+ }(_preview__WEBPACK_IMPORTED_MODULE_1__["PreviewViewModel"]));
15257
+
15258
+
15259
+
15260
+ /***/ }),
15261
+
15262
+ /***/ "./src/components/tabs/theme-builder.scss":
15263
+ /*!************************************************!*\
15264
+ !*** ./src/components/tabs/theme-builder.scss ***!
15265
+ \************************************************/
15266
+ /*! no static exports found */
15267
+ /***/ (function(module, exports, __webpack_require__) {
15268
+
15269
+ // extracted by mini-css-extract-plugin
15270
+
15271
+ /***/ }),
15272
+
15273
+ /***/ "./src/components/tabs/theme-builder.ts":
15274
+ /*!**********************************************!*\
15275
+ !*** ./src/components/tabs/theme-builder.ts ***!
15276
+ \**********************************************/
15277
+ /*! exports provided: ThemeTabViewModel */
15278
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
15279
+
15280
+ "use strict";
15281
+ __webpack_require__.r(__webpack_exports__);
15282
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeTabViewModel", function() { return ThemeTabViewModel; });
15283
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
15284
+ /* harmony import */ var _preview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./preview */ "./src/components/tabs/preview.ts");
15285
+
15286
+
15287
+ __webpack_require__(/*! ./theme-builder.scss */ "./src/components/tabs/theme-builder.scss");
15288
+ var ThemeTabViewModel = /** @class */ (function (_super) {
15289
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ThemeTabViewModel, _super);
15290
+ function ThemeTabViewModel(surveyProvider, startThemeClasses) {
15291
+ return _super.call(this, surveyProvider, startThemeClasses) || this;
15292
+ }
15293
+ Object.defineProperty(ThemeTabViewModel.prototype, "currentTheme", {
15294
+ get: function () {
15295
+ return this.surveyProvider.theme;
15296
+ },
15297
+ enumerable: false,
15298
+ configurable: true
15299
+ });
15300
+ Object.defineProperty(ThemeTabViewModel.prototype, "currentThemeCssVariables", {
15301
+ get: function () {
15302
+ return this.currentTheme.cssVariables || {};
15303
+ },
15304
+ enumerable: false,
15305
+ configurable: true
15306
+ });
15307
+ ThemeTabViewModel.prototype.getTabName = function () { return "theme"; };
15308
+ return ThemeTabViewModel;
15309
+ }(_preview__WEBPACK_IMPORTED_MODULE_1__["PreviewViewModel"]));
15310
+
15311
+
15312
+
15568
15313
  /***/ }),
15569
15314
 
15570
15315
  /***/ "./src/components/tabs/theme-custom-questions/background-corner-radius.ts":
@@ -15710,6 +15455,7 @@ function getElementsJSON() {
15710
15455
  title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.opacity"),
15711
15456
  min: 0,
15712
15457
  max: 100,
15458
+ defaultValue: 100,
15713
15459
  unit: "%",
15714
15460
  titleLocation: "left"
15715
15461
  }
@@ -15755,7 +15501,7 @@ if (!survey_core__WEBPACK_IMPORTED_MODULE_0__["ComponentCollection"].Instance.ge
15755
15501
  return !!value ? createColor(value) : "";
15756
15502
  },
15757
15503
  valueFromQuestion: function (value) {
15758
- return typeof value == "string" ? Object(_utils_utils__WEBPACK_IMPORTED_MODULE_2__["parseColor"])(value) : value;
15504
+ return typeof value == "string" || typeof value == "undefined" ? Object(_utils_utils__WEBPACK_IMPORTED_MODULE_2__["parseColor"])(value) : value;
15759
15505
  },
15760
15506
  onCreated: function (question) {
15761
15507
  question.contentPanel.questions.forEach(function (q) { return q.allowRootStyle = false; });
@@ -15901,6 +15647,8 @@ if (!survey_core__WEBPACK_IMPORTED_MODULE_1__["ComponentCollection"].Instance.ge
15901
15647
  color.visible = question.name !== "surveyTitle" && question.name !== "surveyDescription";
15902
15648
  var placeholderColor = question.contentPanel.getQuestionByName("placeholdercolor");
15903
15649
  placeholderColor.visible = question.name === "editorFont";
15650
+ var family = question.contentPanel.getQuestionByName("family");
15651
+ family.choices = [].concat(DefaultFonts);
15904
15652
  },
15905
15653
  valueToQuestion: function (value) {
15906
15654
  return JSON.parse(JSON.stringify(value));
@@ -16645,17 +16393,19 @@ var ThemeModel = /** @class */ (function (_super) {
16645
16393
  return findSuitableTheme(themeName, this.colorPalette, this.isPanelless, probeThemeFullName);
16646
16394
  };
16647
16395
  ThemeModel.prototype.fromJSON = function (json, options) {
16396
+ var _this = this;
16648
16397
  if (!json)
16649
16398
  return;
16650
- _super.prototype.fromJSON.call(this, json, options);
16651
- var headerModel = new _header_model__WEBPACK_IMPORTED_MODULE_8__["HeaderModel"]();
16652
- headerModel.fromJSON(json.header || {});
16653
- headerModel.owner = this;
16654
- this.header = headerModel;
16399
+ var _json = {};
16400
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["assign"])(_json, json);
16401
+ delete _json["header"];
16402
+ delete _json["cssVariables"];
16403
+ _super.prototype.fromJSON.call(this, _json, options);
16404
+ this.header.fromJSON(json.header || {});
16655
16405
  if (json.cssVariables) {
16656
16406
  this["primaryColor"] = json.cssVariables["--sjs-primary-backcolor"];
16657
16407
  _super.prototype.fromJSON.call(this, json.cssVariables, options);
16658
- headerModel.setCssVariables(json.cssVariables);
16408
+ this.header.setCssVariables(json.cssVariables);
16659
16409
  this.scale = !!this["--sjs-base-unit"] ? Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["roundTo2Decimals"])(parseFloat(this["--sjs-base-unit"]) * 100 / 8) : undefined;
16660
16410
  this.fontSize = !!this["--sjs-font-size"] ? Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["roundTo2Decimals"])(parseFloat(this["--sjs-font-size"]) * 100 / 16) : undefined;
16661
16411
  this.cornerRadius = this["--sjs-corner-radius"] ? Object(_utils_utils__WEBPACK_IMPORTED_MODULE_10__["roundTo2Decimals"])(parseFloat(this["--sjs-corner-radius"])) : undefined;
@@ -16663,6 +16413,11 @@ var ThemeModel = /** @class */ (function (_super) {
16663
16413
  this.backgroundOpacity = json["backgroundOpacity"] * 100;
16664
16414
  this["questionPanel"] = Object(_theme_custom_questions_background_corner_radius__WEBPACK_IMPORTED_MODULE_6__["backgroundCornerRadiusFromCssVariable"])(this.getPropertyByName("questionPanel"), json.cssVariables, "--sjs-general-backcolor", "--sjs-general-backcolor-dark", this.cornerRadius);
16665
16415
  this["editorPanel"] = Object(_theme_custom_questions_background_corner_radius__WEBPACK_IMPORTED_MODULE_6__["backgroundCornerRadiusFromCssVariable"])(this.getPropertyByName("editorPanel"), json.cssVariables, "--sjs-general-backcolor-dim-light", "--sjs-general-backcolor-dim-dark", this.cornerRadius);
16416
+ survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].getProperties("theme").forEach(function (property) {
16417
+ if (property.type === "font") {
16418
+ _this[property.name] = Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_5__["fontsettingsFromCssVariable"])(property, json.cssVariables);
16419
+ }
16420
+ });
16666
16421
  this["pageTitle"] = Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_5__["fontsettingsFromCssVariable"])(this.getPropertyByName("pageTitle"), json.cssVariables, "--sjs-general-dim-forecolor");
16667
16422
  this["pageDescription"] = Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_5__["fontsettingsFromCssVariable"])(this.getPropertyByName("pageDescription"), json.cssVariables, "--sjs-general-dim-forecolor-light");
16668
16423
  this["questionTitle"] = Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_5__["fontsettingsFromCssVariable"])(this.getPropertyByName("questionTitle"), json.cssVariables, "--sjs-general-forecolor");
@@ -16976,6 +16731,7 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addProperties("theme", [{
16976
16731
  onPropertyEditorUpdate: function (obj, editor) {
16977
16732
  if (!!editor) {
16978
16733
  editor.allowClear = false;
16734
+ editor.choices = [].concat(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_5__["DefaultFonts"]);
16979
16735
  }
16980
16736
  }
16981
16737
  }, {
@@ -17292,6 +17048,7 @@ var ThemeTabPlugin = /** @class */ (function () {
17292
17048
  this.simulatorCssClasses = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
17293
17049
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
17294
17050
  this.propertyGrid = new _property_grid__WEBPACK_IMPORTED_MODULE_7__["PropertyGridModel"](undefined, creator, _theme_model_definition__WEBPACK_IMPORTED_MODULE_11__["themeModelPropertyGridDefinition"]);
17051
+ this.propertyGrid.surveyInstanceCreatedArea = "theme-tab:property-grid";
17295
17052
  var propertyGridViewModel = new _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_8__["PropertyGridViewModel"](this.propertyGrid, creator);
17296
17053
  this.propertyGridTab = this.creator.sidebar.addTab("theme", "svc-property-grid", propertyGridViewModel);
17297
17054
  this.propertyGridTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.themePropertyGridTitle");
@@ -17364,7 +17121,7 @@ var ThemeTabPlugin = /** @class */ (function () {
17364
17121
  this.addSubGroupTitle(survey.getPanelByName("appearanceinput"), "theme.lines");
17365
17122
  };
17366
17123
  ThemeTabPlugin.prototype.updatePropertyGridEditorsAvailability = function () {
17367
- var simulatorSurvey = this.model.simulator.survey;
17124
+ var simulatorSurvey = this.model.survey;
17368
17125
  var page = this.propertyGrid.survey.pages[0];
17369
17126
  var header = page === null || page === void 0 ? void 0 : page.getElementByName("header");
17370
17127
  if (header && header.elements.length > 0) {
@@ -17571,7 +17328,7 @@ var ThemeTabPlugin = /** @class */ (function () {
17571
17328
  };
17572
17329
  ThemeTabPlugin.prototype.deactivate = function () {
17573
17330
  if (this.model) {
17574
- this.simulatorCssClasses = this.model.simulator.survey.css;
17331
+ this.simulatorCssClasses = this.model.survey.css;
17575
17332
  this.model.onPropertyChanged.clear();
17576
17333
  this.themeModel.onThemeSelected.clear();
17577
17334
  this.themeModel.onThemePropertyChanged.clear();
@@ -22513,14 +22270,14 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22513
22270
  SurveyCreatorModel.prototype.createSurvey = function (json, reason, model, callback, area) {
22514
22271
  var _a;
22515
22272
  var survey = this.createSurveyCore(json, reason);
22516
- if (reason !== "designer" && reason !== "test") {
22273
+ if (reason !== "designer" && reason !== "test" && reason !== "theme") {
22517
22274
  survey.fitToContainer = false;
22518
22275
  }
22519
22276
  if (reason === "designer" || reason === "modal-question-editor") {
22520
22277
  initializeDesignTimeSurveyModel(survey, this);
22521
22278
  }
22522
22279
  survey["needRenderIcons"] = false;
22523
- if (reason != "designer" && reason != "test") {
22280
+ if (reason != "designer" && reason != "test" && reason !== "theme") {
22524
22281
  survey.locale = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].currentLocale;
22525
22282
  if (!json["clearInvisibleValues"]) {
22526
22283
  survey.clearInvisibleValues = "onComplete";
@@ -22539,7 +22296,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22539
22296
  if (reason === "designer") {
22540
22297
  this.onDesignerSurveyCreated.fire(this, { survey: survey });
22541
22298
  }
22542
- if (reason === "test") {
22299
+ if (reason === "test" || reason === "theme") {
22543
22300
  this.onPreviewSurveyCreated.fire(this, { survey: survey });
22544
22301
  }
22545
22302
  return survey;
@@ -22548,13 +22305,11 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22548
22305
  var hash = {};
22549
22306
  hash["designer"] = "designer-tab";
22550
22307
  hash["test"] = "preview-tab";
22551
- hash["property-grid"] = "property-grid";
22552
22308
  hash["default-value"] = "default-value-popup-editor";
22553
22309
  hash["condition-builder"] = "logic-rule:condition-editor";
22554
22310
  hash["logic-item-editor"] = "logic-rule:action-editor";
22555
22311
  hash["logic-items"] = "logic-tab:condition-list";
22556
22312
  hash["theme"] = "theme-tab";
22557
- hash["theme_editor"] = "theme-tab:property-grid";
22558
22313
  hash["translation_settings"] = "translation-tab:language-list";
22559
22314
  hash["translation_strings"] = "translation-tab:table";
22560
22315
  hash["translation_strings_header"] = "translation-tab:table-header";
@@ -22562,7 +22317,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22562
22317
  hash["fast-entry"] = "table-values-popup-editor";
22563
22318
  hash["modal-question-editor"] = "matrix-cell-question-popup-editor";
22564
22319
  var res = hash[reason];
22565
- return !!res ? res : "internal-use";
22320
+ return !!res ? res : reason;
22566
22321
  };
22567
22322
  SurveyCreatorModel.prototype.createSurveyCore = function (json, reason) {
22568
22323
  if (json === void 0) { json = {}; }
@@ -26581,7 +26336,7 @@ __webpack_require__.r(__webpack_exports__);
26581
26336
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! survey-core */ "survey-core");
26582
26337
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_78___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_78__);
26583
26338
  var Version;
26584
- Version = "" + "1.11.1";
26339
+ Version = "" + "1.11.2";
26585
26340
  //should be loaded before other styles for easier override
26586
26341
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
26587
26342
 
@@ -26678,7 +26433,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
26678
26433
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
26679
26434
 
26680
26435
  survey_core__WEBPACK_IMPORTED_MODULE_78__["settings"].supportCreatorV2 = true;
26681
- Object(survey_core__WEBPACK_IMPORTED_MODULE_78__["checkLibraryVersion"])("" + "1.11.1", "survey-creator-core");
26436
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_78__["checkLibraryVersion"])("" + "1.11.2", "survey-creator-core");
26682
26437
 
26683
26438
 
26684
26439
  /***/ }),
@@ -34012,6 +33767,7 @@ var PropertyGridModel = /** @class */ (function () {
34012
33767
  if (obj === void 0) { obj = null; }
34013
33768
  if (options === void 0) { options = new _creator_settings__WEBPACK_IMPORTED_MODULE_6__["EmptySurveyCreatorOptions"](); }
34014
33769
  if (propertyGridDefinition === void 0) { propertyGridDefinition = null; }
33770
+ this.surveyInstanceCreatedArea = "property-grid";
34015
33771
  this.isCellCreating = false;
34016
33772
  this.options = options;
34017
33773
  this.propertyGridDefinition = propertyGridDefinition;
@@ -34251,7 +34007,7 @@ var PropertyGridModel = /** @class */ (function () {
34251
34007
  });
34252
34008
  };
34253
34009
  PropertyGridModel.prototype.createSurvey = function (json, callback) {
34254
- return this.options.createSurvey(json, "property-grid", this, callback);
34010
+ return this.options.createSurvey(json, this.surveyInstanceCreatedArea, this, callback);
34255
34011
  };
34256
34012
  PropertyGridModel.prototype.getSurveyJSON = function () {
34257
34013
  var res = {};
@@ -35929,7 +35685,7 @@ var PropertyGridEditorMatrixPages = /** @class */ (function (_super) {
35929
35685
  return prop.type == "surveypages";
35930
35686
  };
35931
35687
  PropertyGridEditorMatrixPages.prototype.addItem = function (creator, obj, question) {
35932
- creator.addPage();
35688
+ creator.addPage(undefined, false);
35933
35689
  };
35934
35690
  PropertyGridEditorMatrixPages.prototype.getColumnClassName = function (obj, prop) {
35935
35691
  return "page@" + obj.getType();