survey-creator-core 1.9.91 → 1.9.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.91
2
+ * SurveyJS Creator v1.9.93
3
3
  * (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -209,10 +209,13 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
209
209
  this.updateActionsProperties();
210
210
  };
211
211
  SurveyElementAdornerBase.prototype.updateActionsProperties = function () {
212
+ if (this.isDisposed)
213
+ return;
212
214
  this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
213
215
  };
214
216
  SurveyElementAdornerBase.prototype.updateElementAllowOptions = function (options, operationsAllow) {
215
217
  this.allowDragging = operationsAllow && options.allowDragging;
218
+ this.allowEditOption = (options.allowEdit == undefined || !!options.allowEdit);
216
219
  this.updateActionVisibility("delete", operationsAllow && options.allowDelete);
217
220
  this.updateActionVisibility("duplicate", operationsAllow && options.allowCopy);
218
221
  var settingsVisibility = (options.allowEdit !== undefined) ? (operationsAllow && options.allowEdit) : this.creator.sidebar.flyoutMode;
@@ -277,7 +280,7 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
277
280
  };
278
281
  Object.defineProperty(SurveyElementAdornerBase.prototype, "allowEdit", {
279
282
  get: function () {
280
- return !!this.creator && !this.creator.readOnly;
283
+ return !!this.creator && !this.creator.readOnly && this.allowEditOption;
281
284
  },
282
285
  enumerable: false,
283
286
  configurable: true
@@ -1988,7 +1991,7 @@ var QuestionImageAdornerViewModel = /** @class */ (function (_super) {
1988
1991
  var _this = this;
1989
1992
  this.filePresentationModel = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].createClass("file", { name: this.question.name });
1990
1993
  this.filePresentationModel.setSurveyImpl(this.question.getSurvey());
1991
- this.filePresentationModel.forceIsInputReadOnly = false;
1994
+ this.filePresentationModel.forceIsInputReadOnly = !this.creator.isCanModifyProperty(this.question, "imageLink");
1992
1995
  this.filePresentationModel.dragAreaPlaceholder = this.placeholderText;
1993
1996
  this.filePresentationModel.chooseButtonCaption = this.chooseImageText;
1994
1997
  this.filePresentationModel.acceptedTypes = "image/*";
@@ -2403,6 +2406,27 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
2403
2406
  enumerable: false,
2404
2407
  configurable: true
2405
2408
  });
2409
+ Object.defineProperty(QuestionAdornerViewModel.prototype, "isUsingCarryForward", {
2410
+ get: function () {
2411
+ var _a;
2412
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.isUsingCarryForward;
2413
+ },
2414
+ enumerable: false,
2415
+ configurable: true
2416
+ });
2417
+ QuestionAdornerViewModel.prototype.createCarryForwardParams = function () {
2418
+ var _this = this;
2419
+ var _a;
2420
+ if (!this.isUsingCarryForward)
2421
+ return null;
2422
+ var name = (_a = this.element) === null || _a === void 0 ? void 0 : _a.choicesFromQuestion;
2423
+ if (!name)
2424
+ return null;
2425
+ var question = this.creator.survey.getQuestionByName(name);
2426
+ if (!question)
2427
+ return null;
2428
+ return { question: question, text: this.creator.getLocString("ed.carryForwardChoicesCopied"), onClick: function () { _this.creator.selectElement(question); } };
2429
+ };
2406
2430
  QuestionAdornerViewModel.prototype.dispose = function () {
2407
2431
  this.surveyElement.unRegisterFunctionOnPropertyValueChanged("isRequired", "isRequiredAdorner");
2408
2432
  this.surveyElement.unRegisterFunctionOnPropertyValueChanged("inputType", "inputTypeAdorner");
@@ -4055,7 +4079,7 @@ var StringEditorViewModelBase = /** @class */ (function (_super) {
4055
4079
  }
4056
4080
  };
4057
4081
  StringEditorViewModelBase.prototype.onKeyDown = function (event) {
4058
- if (event.keyCode === 13) {
4082
+ if (event.keyCode === 13 && (this.editAsText || !event.shiftKey)) {
4059
4083
  this.blurEditor();
4060
4084
  if (!event.ctrlKey && !event.metaKey) {
4061
4085
  this.connector.onEditComplete.fire(this, {});
@@ -9739,10 +9763,8 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__["ComponentCollection"].Instance.add({
9739
9763
  showInToolbox: false,
9740
9764
  questionJSON: {
9741
9765
  "type": "paneldynamic",
9742
- "panelCount": 1,
9743
- //temp
9744
- "maxPanelCount": 1,
9745
9766
  "minPanelCount": 1,
9767
+ "panelAddText": Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_0__["getLocString"])("theme.boxShadowAddRule"),
9746
9768
  "templateElements": [
9747
9769
  {
9748
9770
  "type": "spinedit",
@@ -9969,9 +9991,9 @@ survey_core__WEBPACK_IMPORTED_MODULE_0__["ComponentCollection"].Instance.add({
9969
9991
  descriptionLocation: "hidden",
9970
9992
  choices: [
9971
9993
  { value: "400", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightRegular") },
9972
- { value: "500", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightHeavy") },
9973
- { value: "600", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightSemiBold") },
9974
- { value: "700", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightBold") },
9994
+ { value: "500", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightSemiBold") },
9995
+ { value: "600", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightBold") },
9996
+ { value: "700", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])("theme.fontWeightHeavy") },
9975
9997
  ],
9976
9998
  defaultValue: "400"
9977
9999
  },
@@ -10034,8 +10056,8 @@ var TabThemePlugin = /** @class */ (function () {
10034
10056
  creator.addPluginTab("theme", this, "ed.themeSurvey");
10035
10057
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
10036
10058
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
10037
- this.sidebarTab = this.creator.sidebar.addTab("preview");
10038
- this.sidebarTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("ed.previewPropertyGridTitle");
10059
+ this.sidebarTab = this.creator.sidebar.addTab("theme");
10060
+ this.sidebarTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("ed.themePropertyGridTitle");
10039
10061
  }
10040
10062
  TabThemePlugin.prototype.getSimulatorDevicesTitle = function () {
10041
10063
  if (!this.model)
@@ -10068,6 +10090,7 @@ var TabThemePlugin = /** @class */ (function () {
10068
10090
  this.sidebarTab.model = this.model.themeEditorSurvey;
10069
10091
  this.sidebarTab.componentName = "survey-widget";
10070
10092
  this.creator.sidebar.activeTab = this.sidebarTab.id;
10093
+ this.resetTheme.visible = true;
10071
10094
  this.importAction.visible = true;
10072
10095
  this.exportAction.visible = true;
10073
10096
  };
@@ -10099,6 +10122,7 @@ var TabThemePlugin = /** @class */ (function () {
10099
10122
  }
10100
10123
  this.sidebarTab.visible = false;
10101
10124
  this.testAgainAction.visible = false;
10125
+ this.resetTheme.visible = false;
10102
10126
  this.importAction.visible = false;
10103
10127
  this.exportAction.visible = false;
10104
10128
  this.invisibleToggleAction && (this.invisibleToggleAction.visible = false);
@@ -10189,6 +10213,18 @@ var TabThemePlugin = /** @class */ (function () {
10189
10213
  iconName: "icon-arrow-right_16x16",
10190
10214
  visible: false
10191
10215
  });
10216
+ this.resetTheme = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
10217
+ id: "resetTheme",
10218
+ iconName: "icon-reset",
10219
+ mode: "small",
10220
+ visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
10221
+ return (_this.creator.activeTab === "theme");
10222
+ }),
10223
+ action: function () {
10224
+ _this.model.applySelectedTheme();
10225
+ }
10226
+ });
10227
+ items.push(this.resetTheme);
10192
10228
  this.importAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
10193
10229
  id: "svc-theme-import",
10194
10230
  iconName: "icon-load",
@@ -10369,6 +10405,20 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10369
10405
  enumerable: false,
10370
10406
  configurable: true
10371
10407
  });
10408
+ ThemeSurveyTabViewModel.prototype.applySelectedTheme = function (saveChanges) {
10409
+ if (saveChanges === void 0) { saveChanges = false; }
10410
+ var newTheme = {};
10411
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(newTheme, Themes[this.getFullThemeName("default")], Themes[this.getFullThemeName()]);
10412
+ if (this.survey["isCompact"]) {
10413
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(newTheme, Themes[this.getFullThemeName() + "-lw"]);
10414
+ }
10415
+ if (saveChanges) {
10416
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(newTheme, this.themeChanges);
10417
+ }
10418
+ this.themeEditorSurvey.mergeData(newTheme);
10419
+ this.surveyProvider.theme.cssVariables = newTheme;
10420
+ this.setThemeToSurvey();
10421
+ };
10372
10422
  ThemeSurveyTabViewModel.prototype.loadTheme = function (theme) {
10373
10423
  this.themeName = theme["themeName"];
10374
10424
  this.themePalette = theme["themePalette"];
@@ -10658,14 +10708,7 @@ var ThemeSurveyTabViewModel = /** @class */ (function (_super) {
10658
10708
  _this.surveyProvider.theme["themeName"] = _this.themeName;
10659
10709
  _this.surveyProvider.theme["themePalette"] = _this.themePalette;
10660
10710
  }
10661
- var newTheme_1 = {};
10662
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(newTheme_1, Themes[_this.getFullThemeName("default")], Themes[_this.getFullThemeName()]);
10663
- if (_this.survey["isCompact"]) {
10664
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(newTheme_1, Themes[_this.getFullThemeName() + "-lw"]);
10665
- }
10666
- themeEditorSurvey.mergeData(newTheme_1);
10667
- _this.surveyProvider.theme.cssVariables = newTheme_1;
10668
- _this.setThemeToSurvey();
10711
+ _this.applySelectedTheme(options.name === "themeMode");
10669
10712
  return;
10670
10713
  }
10671
10714
  if (["backgroundImage", "backgroundImageFit"].indexOf(options.name) !== -1) {
@@ -13751,6 +13794,8 @@ var CreatorBase = /** @class */ (function (_super) {
13751
13794
  * - `sender` - the survey creator object that fires the event
13752
13795
  * - `options.files` - the Javascript File objects array
13753
13796
  * - `options.callback(status, imageLink)` - called on upload complete
13797
+ *
13798
+ * [View Demo](https://surveyjs.io/survey-creator/examples/file-upload/ (linkStyle))
13754
13799
  * @see uploadFiles
13755
13800
  */
13756
13801
  _this.onUploadFile = new CreatorEvent();
@@ -15190,6 +15235,9 @@ var CreatorBase = /** @class */ (function (_super) {
15190
15235
  survey["needRenderIcons"] = false;
15191
15236
  if (reason != "designer" && reason != "test") {
15192
15237
  survey.locale = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].currentLocale;
15238
+ if (!json["clearInvisibleValues"]) {
15239
+ survey.clearInvisibleValues = "onComplete";
15240
+ }
15193
15241
  }
15194
15242
  this.onSurveyInstanceCreated.fire(this, { survey: survey, reason: reason });
15195
15243
  return survey;
@@ -18446,7 +18494,7 @@ __webpack_require__.r(__webpack_exports__);
18446
18494
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! survey-core */ "survey-core");
18447
18495
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_70___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_70__);
18448
18496
  var Version;
18449
- Version = "" + "1.9.91";
18497
+ Version = "" + "1.9.93";
18450
18498
  //should be loaded before other styles for easier override
18451
18499
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
18452
18500
 
@@ -18535,7 +18583,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
18535
18583
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
18536
18584
 
18537
18585
  survey_core__WEBPACK_IMPORTED_MODULE_70__["settings"].supportCreatorV2 = true;
18538
- Object(survey_core__WEBPACK_IMPORTED_MODULE_70__["checkLibraryVersion"])("" + "1.9.91", "survey-creator-core");
18586
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_70__["checkLibraryVersion"])("" + "1.9.93", "survey-creator-core");
18539
18587
 
18540
18588
 
18541
18589
  /***/ }),
@@ -18845,6 +18893,7 @@ var map = {
18845
18893
  "./rating.svg": "./src/images/rating.svg",
18846
18894
  "./redo.svg": "./src/images/redo.svg",
18847
18895
  "./remove_16x16.svg": "./src/images/remove_16x16.svg",
18896
+ "./reset.svg": "./src/images/reset.svg",
18848
18897
  "./save.svg": "./src/images/save.svg",
18849
18898
  "./select-page.svg": "./src/images/select-page.svg",
18850
18899
  "./settings.svg": "./src/images/settings.svg",
@@ -19686,6 +19735,17 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\
19686
19735
 
19687
19736
  /***/ }),
19688
19737
 
19738
+ /***/ "./src/images/reset.svg":
19739
+ /*!******************************!*\
19740
+ !*** ./src/images/reset.svg ***!
19741
+ \******************************/
19742
+ /*! no static exports found */
19743
+ /***/ (function(module, exports) {
19744
+
19745
+ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.01 2.993C11.8 2.993 11.59 3.023 11.37 3.043L12.71 1.703L11.3 0.292999L7.59 4.003L11.3 7.713L12.71 6.303L11.46 5.053C11.64 5.043 11.82 5.013 12 5.013C15.86 5.013 19 8.153 19 12.013C19 15.873 15.86 19.013 12 19.013C8.14 19.013 5 15.873 5 12.013C5 11.463 4.55 11.013 4 11.013C3.45 11.013 3 11.463 3 12.013C3 16.973 7.04 21.013 12 21.013C16.96 21.013 21 16.973 21 12.013C21 7.053 16.97 2.993 12.01 2.993Z\"></path></svg>"
19746
+
19747
+ /***/ }),
19748
+
19689
19749
  /***/ "./src/images/save.svg":
19690
19750
  /*!*****************************!*\
19691
19751
  !*** ./src/images/save.svg ***!
@@ -20712,7 +20772,7 @@ var enStrings = {
20712
20772
  propertyEditorError: "Error",
20713
20773
  saveError: "Error! Editor content is not saved.",
20714
20774
  translationPropertyGridTitle: "Language Settings",
20715
- previewPropertyGridTitle: "Theme Settings",
20775
+ themePropertyGridTitle: "Theme Settings",
20716
20776
  translationLanguages: "Languages",
20717
20777
  translationAddLanguage: "Select language to translate",
20718
20778
  translationShowAllStrings: "All Strings",
@@ -20730,6 +20790,7 @@ var enStrings = {
20730
20790
  underline: "Underline",
20731
20791
  addNewQuestion: "Add Question",
20732
20792
  selectPage: "Select page...",
20793
+ carryForwardChoicesCopied: "Choices are copied from",
20733
20794
  htmlPlaceHolder: "HTML content will be here.",
20734
20795
  panelPlaceHolder: "Drop a question from the toolbox here.",
20735
20796
  surveyPlaceHolder: "The survey is empty. Drag an element from the toolbox or click the button below.",
@@ -20863,6 +20924,7 @@ var enStrings = {
20863
20924
  assistantTitle: "Available questions",
20864
20925
  cellsEmptyRowsColumns: "There is should be at least one column or row",
20865
20926
  showPreviewBeforeComplete: "Preview answers before submitting the survey",
20927
+ overridingPropertyPrefix: "Set by ",
20866
20928
  propertyIsEmpty: "Please enter a value",
20867
20929
  propertyIsNoUnique: "Please enter a unique value",
20868
20930
  propertyNameIsNotUnique: "Please enter a unique name",
@@ -21594,11 +21656,12 @@ var enStrings = {
21594
21656
  pageDescription: "Page Description Font",
21595
21657
  boxShadowX: "X",
21596
21658
  boxShadowY: "Y",
21659
+ boxShadowAddRule: "Add More Shadow Effect",
21597
21660
  opacity: "Opacity",
21598
21661
  boxShadowBlur: "Blur",
21599
21662
  boxShadowSpread: "Spread",
21600
21663
  questionShadow: "Question Panel Border / Shadow",
21601
- editorShadow: "Editor Border / Shadow"
21664
+ editorShadow: "Editor Border / Shadow",
21602
21665
  },
21603
21666
  };
21604
21667
  // Uncomment the line below if you create a custom dictionary.
@@ -21886,13 +21949,19 @@ var UndoRedoController = /** @class */ (function (_super) {
21886
21949
  };
21887
21950
  }
21888
21951
  this.undoRedoManager = new _undo_redo_manager__WEBPACK_IMPORTED_MODULE_3__["UndoRedoManager"]();
21889
- this.undoRedoManager.changesFinishedCallback = function (changes) {
21890
- _this.creator.notifySurveyPropertyChanged({
21891
- name: changes.propertyName,
21892
- target: changes.object,
21893
- oldValue: changes.oldValue,
21894
- newValue: changes.newValue
21895
- });
21952
+ this.undoRedoManager.changesFinishedCallback = function (actions, isUndo) {
21953
+ for (var i = actions.length - 1; i >= 0; i--) {
21954
+ var action = actions[i];
21955
+ if (!!action) {
21956
+ var changes = action.getChanges(isUndo);
21957
+ _this.creator.notifySurveyPropertyChanged({
21958
+ name: changes.propertyName,
21959
+ target: changes.object,
21960
+ oldValue: changes.oldValue,
21961
+ newValue: changes.newValue
21962
+ });
21963
+ }
21964
+ }
21896
21965
  };
21897
21966
  this.undoRedoManager.canUndoRedoCallback = function () {
21898
21967
  _this.updateUndeRedoActions();
@@ -22078,9 +22147,10 @@ var UndoRedoManager = /** @class */ (function () {
22078
22147
  };
22079
22148
  UndoRedoManager.prototype.notifyChangesFinished = function (transaction, isUndo) {
22080
22149
  if (isUndo === void 0) { isUndo = false; }
22081
- if (transaction.actions.length > 0 && transaction.actions[0]) {
22150
+ if (transaction.actions.length > 0) {
22082
22151
  !!this.changesFinishedCallback &&
22083
- this.changesFinishedCallback(transaction.actions[0].getChanges(isUndo));
22152
+ this.changesFinishedCallback(transaction.actions, isUndo);
22153
+ // this.changesFinishedCallback(transaction.actions[0].getChanges(isUndo));
22084
22154
  }
22085
22155
  };
22086
22156
  UndoRedoManager.prototype.canUndoRedoCallback = function () { };
@@ -22328,8 +22398,8 @@ var propertyGridCss = {
22328
22398
  root: "spg-paneldynamic",
22329
22399
  navigation: "spg-paneldynamic__navigation",
22330
22400
  title: "spg-title spg-question__title",
22331
- button: "spg-btn",
22332
- buttonRemove: "spg-paneldynamic__remove-btn",
22401
+ button: "spg-action-button spg-action-button--text",
22402
+ buttonRemove: "spg-action-button--danger",
22333
22403
  buttonAdd: "spg-paneldynamic__add-btn",
22334
22404
  progressTop: "spg-paneldynamic__progress spg-paneldynamic__progress--top",
22335
22405
  progressBottom: "spg-paneldynamic__progress spg-paneldynamic__progress--bottom",
@@ -22339,6 +22409,7 @@ var propertyGridCss = {
22339
22409
  progress: "spg-progress",
22340
22410
  progressBar: "spg-progress__bar",
22341
22411
  progressText: "spg-paneldynamic__progress-text",
22412
+ panelFooter: "spg-panel__footer",
22342
22413
  separator: "spg-paneldynamic__separator"
22343
22414
  },
22344
22415
  progress: "spg-progress spg-body__progress",
@@ -23732,15 +23803,33 @@ var ConditionEditor = /** @class */ (function (_super) {
23732
23803
  path = path.substring(1);
23733
23804
  }
23734
23805
  var json = question && question.getConditionJson ? question.getConditionJson(operator, path) : null;
23735
- if (!!json && json.type == "expression") {
23806
+ if (!json)
23807
+ return null;
23808
+ if (!!json.choicesFromQuestion) {
23809
+ this.updateChoicesFromQuestion(json);
23810
+ }
23811
+ if (json.type == "expression") {
23736
23812
  json.type = "text";
23737
23813
  }
23738
- if (!!json && operator == "anyof") {
23814
+ if (operator == "anyof") {
23739
23815
  if (!ConditionEditor.isClassContains(json.type, ["checkbox"], [])) {
23740
23816
  json.type = "checkbox";
23741
23817
  }
23742
23818
  }
23743
- return !!json ? json : null;
23819
+ return json;
23820
+ };
23821
+ ConditionEditor.prototype.updateChoicesFromQuestion = function (json) {
23822
+ var question = this.getConditionQuestion(json.choicesFromQuestion);
23823
+ if (!question)
23824
+ return;
23825
+ delete json.choicesFromQuestion;
23826
+ var questionJSON = question.toJSON();
23827
+ if (!!questionJSON.choices) {
23828
+ json.choices = questionJSON.choices;
23829
+ }
23830
+ if (!!questionJSON.choicesByUrl) {
23831
+ json.choicesByUrl = questionJSON.choicesByUrl;
23832
+ }
23744
23833
  };
23745
23834
  ConditionEditor.prototype.updateOperatorEnables = function (panel) {
23746
23835
  var questionName = panel.getQuestionByName("questionName");
@@ -24361,7 +24450,13 @@ function propertyVisibleIf(params) {
24361
24450
  return false;
24362
24451
  return this.question.property.visibleIf(this.question.obj);
24363
24452
  }
24453
+ function propertyEnableIf(params) {
24454
+ if (!this.question || !this.question.obj || !this.question.property)
24455
+ return false;
24456
+ return !this.question.obj[this.question.property.overridingProperty];
24457
+ }
24364
24458
  survey_core__WEBPACK_IMPORTED_MODULE_1__["FunctionFactory"].Instance.register("propertyVisibleIf", propertyVisibleIf);
24459
+ survey_core__WEBPACK_IMPORTED_MODULE_1__["FunctionFactory"].Instance.register("propertyEnableIf", propertyEnableIf);
24365
24460
  function setSurveyJSONForPropertyGrid(json, updateOnTyping, titleLocationLeft) {
24366
24461
  if (updateOnTyping === void 0) { updateOnTyping = true; }
24367
24462
  if (titleLocationLeft === void 0) { titleLocationLeft = true; }
@@ -24686,10 +24781,21 @@ var PropertyJSONGenerator = /** @class */ (function () {
24686
24781
  q.obj = this.obj;
24687
24782
  q.options = this.options;
24688
24783
  var eventVisibility = this.getVisibilityOnEvent(prop);
24689
- q.readOnly = q.readOnly || this.isPropertyReadOnly(prop);
24784
+ var eventReadOnly = this.isPropertyReadOnly(prop);
24785
+ q.readOnly = q.readOnly || eventReadOnly;
24690
24786
  q.visible = q.visible && eventVisibility;
24691
- if (!!prop.visibleIf) {
24692
- q.visibleIf = eventVisibility ? "propertyVisibleIf() = true" : "";
24787
+ if (!!prop.visibleIf && eventVisibility) {
24788
+ q.visibleIf = "propertyVisibleIf() = true";
24789
+ }
24790
+ if (!!prop.overridingProperty) {
24791
+ q.onUpdateCssClassesCallback = function (css) {
24792
+ css.questionWrapper = "spg-boolean-wrapper--overriding";
24793
+ };
24794
+ if (!eventReadOnly) {
24795
+ q.enableIf = "propertyEnableIf() = true";
24796
+ }
24797
+ var overridingQuestion = this.createOverridingQuestion(panel, q, prop.overridingProperty);
24798
+ q.parent.addElement(overridingQuestion, q.parent.elements.indexOf(q) + 1);
24693
24799
  }
24694
24800
  q.descriptionLocation = "hidden";
24695
24801
  var helpText = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getPropertyHelpInEditor(this.obj.getType(), prop.name, prop.type);
@@ -24707,6 +24813,27 @@ var PropertyJSONGenerator = /** @class */ (function () {
24707
24813
  PropertyJSONGenerator.prototype.isPropertyReadOnly = function (prop) {
24708
24814
  return PropertyJSONGenerator.isPropertyReadOnly(prop, this.options, this.obj, this.parentObj, this.parentProperty);
24709
24815
  };
24816
+ PropertyJSONGenerator.prototype.createOverridingQuestion = function (panel, question, overridingProp) {
24817
+ var linkValue = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].createClass("linkvalue");
24818
+ linkValue.name = question.name + "_" + "overridingProperty";
24819
+ linkValue.startWithNewLine = false;
24820
+ linkValue.property = question.property;
24821
+ linkValue.obj = question.obj;
24822
+ linkValue.visibleIf = "propertyEnableIf() = false";
24823
+ var overridingQuestion = panel.getQuestionByName(overridingProp);
24824
+ var text = !!overridingQuestion ? overridingQuestion.title : overridingProp;
24825
+ linkValue.linkValueText = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("pe.overridingPropertyPrefix") + text;
24826
+ linkValue.titleLocation = "hidden";
24827
+ linkValue.onUpdateCssClassesCallback = function (css) {
24828
+ css.questionWrapper = "spg-link-wrapper--overriding";
24829
+ };
24830
+ if (!!overridingQuestion) {
24831
+ linkValue.linkClickCallback = function () {
24832
+ overridingQuestion.focus();
24833
+ };
24834
+ }
24835
+ return linkValue;
24836
+ };
24710
24837
  PropertyJSONGenerator.prototype.getClasPropName = function () {
24711
24838
  if (!!this.parentObj && !!this.parentProperty)
24712
24839
  return this.parentProperty.name;
@@ -24795,6 +24922,10 @@ var PropertyJSONGenerator = /** @class */ (function () {
24795
24922
  json.isRequired = prop.isRequired;
24796
24923
  json.requiredErrorText = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("pe.propertyIsEmpty");
24797
24924
  json.title = this.getQuestionTitle(prop, title);
24925
+ if (["page", "panelbase"].indexOf(prop.className) && json.name === "name") {
24926
+ json.isRequired = true;
24927
+ json.requiredErrorText = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("pe.propertyIsEmpty");
24928
+ }
24798
24929
  var propDescr = (_a = _question_editor_definition__WEBPACK_IMPORTED_MODULE_8__["SurveyQuestionEditorDefinition"].definition[this.obj.getType()]) === null || _a === void 0 ? void 0 : _a.properties.filter(function (property) { return property["name"] === prop.name; })[0];
24799
24930
  if (typeof propDescr === "object" && propDescr.placeholder) {
24800
24931
  json.placeholder = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("pe." + propDescr.placeholder);
@@ -25323,18 +25454,27 @@ var PropertyGridEditor = /** @class */ (function () {
25323
25454
  PropertyGridEditor.prototype.isSupportGrouping = function () {
25324
25455
  return false;
25325
25456
  };
25326
- PropertyGridEditor.prototype.onUpdateQuestionCssClasses = function (obj, options) {
25327
- if (!this.isSupportGrouping())
25328
- return;
25329
- var question = options.question;
25457
+ PropertyGridEditor.prototype.hasPreviousElementForGrouping = function (question) {
25330
25458
  if (!question || !question.parent)
25331
- return;
25459
+ return false;
25332
25460
  var index = question.parent.elements.indexOf(question);
25333
25461
  if (index < 1)
25334
25462
  return;
25335
- if (question.parent.elements[index - 1].getType() !== question.getType())
25463
+ var prevElement = question.parent.elements[index - 1];
25464
+ var prevPrevElement = question.parent.elements[index - 2];
25465
+ if (prevElement.getType() === question.getType())
25466
+ return true;
25467
+ //in case of overriding property
25468
+ if (index > 1 && !prevElement.startWithNewLine && prevPrevElement["property"] === prevElement["property"] && prevPrevElement.getType() === question.getType())
25469
+ return true;
25470
+ return false;
25471
+ };
25472
+ PropertyGridEditor.prototype.onUpdateQuestionCssClasses = function (obj, options) {
25473
+ if (!this.isSupportGrouping())
25336
25474
  return;
25337
- options.cssClasses.mainRoot += " spg-row-narrow__question";
25475
+ if (this.hasPreviousElementForGrouping(options.question)) {
25476
+ options.cssClasses.mainRoot += " spg-row-narrow__question";
25477
+ }
25338
25478
  };
25339
25479
  return PropertyGridEditor;
25340
25480
  }());
@@ -28546,6 +28686,7 @@ var QuestionConverter = /** @class */ (function () {
28546
28686
  }
28547
28687
  QuestionConverter.updateJSON(json, convertToClass, obj.getType(), defaultJSON);
28548
28688
  newQuestion.fromJSON(json);
28689
+ QuestionConverter.removeValidators(newQuestion);
28549
28690
  var panel = obj.parent;
28550
28691
  var index = panel.elements.indexOf(obj);
28551
28692
  panel.isConverting = true;
@@ -28628,6 +28769,18 @@ var QuestionConverter = /** @class */ (function () {
28628
28769
  delete json.templateElements;
28629
28770
  }
28630
28771
  };
28772
+ QuestionConverter.removeValidators = function (question) {
28773
+ var validators = question.validators;
28774
+ if (!Array.isArray(validators) || validators.length === 0)
28775
+ return;
28776
+ var supported = question.getSupportedValidators();
28777
+ for (var i = validators.length - 1; i >= 0; i--) {
28778
+ var valType = validators[i].getType().replace("validator", "");
28779
+ if (supported.indexOf(valType) < 0) {
28780
+ validators.splice(i, 1);
28781
+ }
28782
+ }
28783
+ };
28631
28784
  QuestionConverter.convertInfo = {};
28632
28785
  return QuestionConverter;
28633
28786
  }());