survey-creator-react 1.12.56 → 1.12.58

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 React v2.3.11
2
+ * SurveyJS Creator React v2.5.0
3
3
  * (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -217,7 +217,7 @@ class SurveyCreatorComponent extends SurveyElementBase {
217
217
  return (React.createElement("div", { role: "tabpanel", key: tab.id, id: "scrollableDiv-" + tab.id, "aria-labelledby": "tab-" + tab.id, className: className }, component));
218
218
  }
219
219
  renderSidebar() {
220
- if (!!this.creator.sidebar) {
220
+ if (!!this.creator.isSidebarVisible) {
221
221
  return ReactElementFactory.Instance.createElement("svc-side-bar", { model: this.creator.sidebar });
222
222
  }
223
223
  else {
@@ -281,8 +281,25 @@ class CreatorModelElement extends SurveyElementBase {
281
281
  return true;
282
282
  for (var i = 0; i < names.length; i++) {
283
283
  const key = names[i];
284
- if (this.props[key] !== nextProps[key])
285
- return true;
284
+ if (typeof key === "object") {
285
+ const currentProp = this.props[key.name];
286
+ const nextProp = nextProps[key.name];
287
+ if (key.deepEqual) {
288
+ if (this.props[key.name] === nextProps[key.name])
289
+ return false;
290
+ const currentPropKeys = Object.keys(currentProp || {});
291
+ if (currentPropKeys.length !== Object.keys(nextProp || {}).length)
292
+ return true;
293
+ return currentPropKeys.some(key => currentProp[key] != nextProp[key]);
294
+ }
295
+ else {
296
+ return currentProp !== nextProp;
297
+ }
298
+ }
299
+ else {
300
+ if (this.props[key] !== nextProps[key])
301
+ return true;
302
+ }
286
303
  }
287
304
  return false;
288
305
  }
@@ -302,7 +319,7 @@ class RowWrapper extends CreatorModelElement {
302
319
  this.model = new RowViewModel(props.componentData.creator, props.row, null);
303
320
  }
304
321
  getUpdatedModelProps() {
305
- return ["row", "componentData"];
322
+ return ["row", { name: "componentData", deepEqual: true }];
306
323
  }
307
324
  getStateElement() {
308
325
  return this.model;
@@ -1434,11 +1451,11 @@ class SurveyCreatorToolboxItem extends CreatorModelElement {
1434
1451
  event.persist();
1435
1452
  this.model.click(event);
1436
1453
  } },
1437
- React.createElement(SvgIcon, { size: "auto", iconName: this.item.iconName, className: "svc-toolbox__item-icon", title: this.item.tooltip }),
1454
+ React.createElement(SvgIcon, { size: "auto", iconName: this.item.iconName, className: "svc-toolbox__item-icon", title: this.item.getTooltip() }),
1438
1455
  React.createElement("span", null, this.item.title))
1439
1456
  :
1440
1457
  null);
1441
- const item = attachKey2click(React.createElement("div", { className: this.item.renderedCss, tabIndex: 0, role: "button", "aria-label": this.item.tooltip, onClick: (event) => {
1458
+ const item = attachKey2click(React.createElement("div", { className: this.item.renderedCss, tabIndex: 0, role: "button", "aria-label": this.item.getTooltip(), onClick: (event) => {
1442
1459
  event.persist();
1443
1460
  this.model.click(event);
1444
1461
  } },
@@ -1520,8 +1537,9 @@ class SurveyCreatorToolboxCategory extends SurveyElementBase {
1520
1537
  if (this.toolbox.canCollapseCategories) {
1521
1538
  className += " svc-toolbox__category-header--collapsed";
1522
1539
  }
1540
+ const title = this.renderLocString(this.category.locTitle);
1523
1541
  return attachKey2click(React.createElement("div", { className: className, onClick: e => this.category.toggleState() },
1524
- React.createElement("span", { className: "svc-toolbox__category-title" }, this.category.title),
1542
+ React.createElement("span", { className: "svc-toolbox__category-title" }, title),
1525
1543
  this.renderButton()));
1526
1544
  }
1527
1545
  renderButton() {
@@ -1780,7 +1798,7 @@ class TabControl extends SurveyElementBase {
1780
1798
  React.createElement(TabsComponent, { model: this.props.model.topToolbar })))),
1781
1799
  React.createElement("div", { className: "svc-sidebar-tabs__bottom-container" },
1782
1800
  React.createElement("div", { className: "svc-sidebar-tabs__items" },
1783
- React.createElement(TabsComponent, { model: this.props.model.bottomToolbar })))));
1801
+ React.createElement(SurveyActionBar, { model: this.props.model.bottomToolbar })))));
1784
1802
  }
1785
1803
  }
1786
1804
  ReactElementFactory.Instance.registerElement("svc-tab-control", (props) => {
@@ -2299,7 +2317,7 @@ class TabDesignerComponent extends SurveyElementBase {
2299
2317
  React.createElement(SurveyHeader, { survey: survey }))));
2300
2318
  }
2301
2319
  renderPlaceHolder() {
2302
- const surveyHeader = this.renderHeader(this.creator.allowEditSurveyTitle && this.creator.showHeaderInEmptySurvey);
2320
+ const surveyHeader = this.renderHeader(this.creator.showSurveyHeader && this.creator.showHeaderInEmptySurvey);
2303
2321
  return (React.createElement(React.Fragment, null,
2304
2322
  surveyHeader,
2305
2323
  React.createElement("div", { className: "svc-designer__placeholder-container", "data-sv-drop-target-survey-element": "newGhostPage" },
@@ -2311,7 +2329,7 @@ class TabDesignerComponent extends SurveyElementBase {
2311
2329
  }
2312
2330
  renderTabContent() {
2313
2331
  const survey = this.creator.survey;
2314
- const surveyHeader = this.renderHeader(this.creator.allowEditSurveyTitle);
2332
+ const surveyHeader = this.renderHeader(this.creator.showSurveyHeader);
2315
2333
  const style = Object.assign({}, this.model.surfaceCssVariables);
2316
2334
  style.maxWidth = survey.renderedWidth;
2317
2335
  const tabTools = this.renderTabTools();
@@ -2898,12 +2916,12 @@ ReactQuestionFactory.Instance.registerQuestion("commentwithreset", (props) => {
2898
2916
 
2899
2917
  class SurveyQuestionBooleanSwitch extends SurveyQuestionElementBase {
2900
2918
  renderElement() {
2901
- const button = attachKey2click(React.createElement("div", { className: "spg-boolean-switch__button" + (this.questionBase.value ? " spg-boolean-switch__button--checked" : ""), tabIndex: 0, role: "checkbox", "aria-checked": this.questionBase.booleanValue || false, "aria-required": this.questionBase.a11y_input_ariaRequired, "aria-label": this.questionBase.a11y_input_ariaLabel, "aria-labelledby": this.questionBase.a11y_input_ariaLabelledBy, "aria-invalid": this.questionBase.a11y_input_ariaInvalid, "aria-errormessage": this.questionBase.a11y_input_ariaErrormessage },
2919
+ const button = attachKey2click(React.createElement("div", { className: "spg-boolean-switch__button" + (this.questionBase.booleanValue ? " spg-boolean-switch__button--checked" : ""), tabIndex: 0, role: "checkbox", "aria-checked": this.questionBase.booleanValue || false, "aria-required": this.questionBase.a11y_input_ariaRequired, "aria-label": this.questionBase.a11y_input_ariaLabel, "aria-labelledby": this.questionBase.a11y_input_ariaLabelledBy, "aria-invalid": this.questionBase.a11y_input_ariaInvalid, "aria-errormessage": this.questionBase.a11y_input_ariaErrormessage },
2902
2920
  React.createElement("div", { className: "spg-boolean-switch__thumb" },
2903
2921
  React.createElement("div", { className: "spg-boolean-switch__thumb-circle spg-boolean-switch__thumb--left" })),
2904
2922
  React.createElement("div", { className: "spg-boolean-switch__thumb" },
2905
2923
  React.createElement("div", { className: "spg-boolean-switch__thumb-circle spg-boolean-switch__thumb--right" }))), this.questionBase, { processEsc: false });
2906
- return (React.createElement("div", { className: "spg-boolean-switch", onClick: () => this.questionBase.value = !this.questionBase.value },
2924
+ return (React.createElement("div", { className: "spg-boolean-switch", onClick: () => this.questionBase.booleanValue = !this.questionBase.booleanValue },
2907
2925
  button,
2908
2926
  React.createElement("div", { className: "spg-boolean-switch__caption" },
2909
2927
  React.createElement("div", { className: "spg-boolean-switch__title", id: this.questionBase.labelRenderedAriaID }, SurveyElementBase.renderLocString(this.questionBase.locTitle)))));
@@ -2915,8 +2933,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2915
2933
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2916
2934
 
2917
2935
  let Version;
2918
- Version = `${"2.3.11"}`;
2919
- checkLibraryVersion(`${"2.3.11"}`, "survey-creator-react");
2936
+ Version = `${"2.5.0"}`;
2937
+ checkLibraryVersion(`${"2.5.0"}`, "survey-creator-react");
2920
2938
 
2921
2939
  export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, CreatorSurveyPageComponent, ImageItemValueAdornerComponent, ItemValueAdornerComponent, LogoImageComponent, MatrixCellAdornerComponent, PanelAdornerComponent, PropertyGridComponent, PropertyGridPlaceholderComponent, QuestionAdornerComponent, QuestionBanner, QuestionDropdownAdornerComponent, QuestionEditorContentComponent, QuestionErrorComponent, QuestionImageAdornerComponent, QuestionRatingAdornerComponent, QuestionWidgetAdornerComponent, QuestionWrapperFooter, QuestionWrapperHeader, ReactDragEvent, ReactMouseEvent, RowWrapper, SearchComponent, SideBarDefaultHeader, SidebarComponent, SurveyCreator, SurveyCreatorComponent, SurveyCreatorToolboxCategory, SurveyCreatorToolboxItem, SurveyCreatorToolboxItemGroup, SurveyCreatorToolboxTool, SurveyElementEmbeddedSurvey, SurveyLocStringEditor, SurveyLogicOpertor, SurveyNavigation, SurveyQuestionBooleanSwitch, SurveyQuestionColor, SurveyQuestionFileEditor, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyQuestionTextWithReset, SurveyResults, SurveyResultsByRow, SurveySimulator, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
2922
2940
  //# sourceMappingURL=survey-creator-react.mjs.map