survey-creator-js 2.3.9 → 2.3.11

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,12 +1,12 @@
1
1
  /*!
2
- * SurveyJS Creator UI v2.3.9
2
+ * SurveyJS Creator UI v2.3.11
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
6
6
  */
7
7
 
8
8
  import * as React from 'survey-js-ui';
9
- import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, ReactQuestionFactory, SurveyLocStringViewer, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, createElement, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, Fragment, SurveyQuestionText, preact } from 'survey-js-ui';
9
+ import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, ReactQuestionFactory, SurveyLocStringViewer, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, SurveyPanel, createElement, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, Fragment, SurveyQuestionText, preact } from 'survey-js-ui';
10
10
  import { assign, SurveyCreatorModel, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, PageAdorner, LogoImageViewModel, editorLocalization, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperViewModel, SurveyResultsModel, ToolboxToolViewModel, editableStringRendererName, StringEditorViewModelBase, initLogicOperator, PageNavigatorViewModel } from 'survey-creator-core';
11
11
  export { PropertyGridEditorCollection, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, ToolboxToolViewModel, editorLocalization, localization, settings, svgBundle } from 'survey-creator-core';
12
12
  import { CssClassBuilder, settings, RendererFactory, unwrap, checkLibraryVersion } from 'survey-core';
@@ -446,7 +446,7 @@ class QuestionAdornerComponent extends CreatorModelElement {
446
446
  const element = this.model.element;
447
447
  return (React.createElement("div", { ref: node => node && (!this.model.renderedCollapsed ?
448
448
  node.setAttribute("inert", "") : node.removeAttribute("inert")), className: this.model.cssCollapsedHiddenHeader }, (element.hasTitle ?
449
- React.createElement(TitleElement, { element: element }) :
449
+ React.createElement(TitleElement, { element: element, renderActions: false }) :
450
450
  React.createElement("div", { className: this.model.cssCollapsedHiddenTitle },
451
451
  React.createElement("span", { className: "svc-fake-title" }, element.name)))));
452
452
  }
@@ -1101,17 +1101,42 @@ class ItemValueAdornerComponent extends CreatorModelElement {
1101
1101
  this.model.allowRemove ? attachKey2click(React.createElement("span", { role: "button", className: "svc-item-value-controls__button svc-item-value-controls__remove", "aria-label": this.model.tooltip, onClick: () => this.model.remove(this.model) },
1102
1102
  React.createElement(SvgIcon, { size: "auto", iconName: "icon-remove_16x16", title: this.model.tooltip }))) : null));
1103
1103
  const itemkey = this.props.element.key + (this.model.allowAdd ? "_new" : "");
1104
- return (React.createElement("div", { ref: this.rootRef, className: "svc-item-value-wrapper" +
1105
- (this.model.allowAdd ? " svc-item-value--new" : "") +
1106
- (this.model.isDragging ? " svc-item-value--dragging" : "") +
1107
- (this.model.isDragDropGhost ? " svc-item-value--ghost" : "") +
1108
- (this.model.isDragDropMoveDown ? " svc-item-value--movedown" : "") +
1109
- (this.model.isDragDropMoveUp ? " svc-item-value--moveup" : ""), key: itemkey, "data-sv-drop-target-item-value": this.model.isDraggable ? this.model.item.value : undefined, onPointerDown: (event) => this.model.onPointerDown(event) },
1110
- React.createElement("div", { className: "svc-item-value__ghost" }),
1111
- React.createElement("div", { className: "svc-item-value-controls", onBlur: this.onBlur }, button),
1112
- React.createElement("div", { className: "svc-item-value__item", onClick: (event) => this.model.select(this.model, event.nativeEvent) }, this.props.element)));
1104
+ return (React.createElement(React.Fragment, null,
1105
+ React.createElement("div", { ref: this.rootRef, className: "svc-item-value-wrapper" +
1106
+ (this.model.allowAdd ? " svc-item-value--new" : "") +
1107
+ (this.model.isDragging ? " svc-item-value--dragging" : "") +
1108
+ (this.model.isDragDropGhost ? " svc-item-value--ghost" : "") +
1109
+ (this.model.isDragDropMoveDown ? " svc-item-value--movedown" : "") +
1110
+ (this.model.isDragDropMoveUp ? " svc-item-value--moveup" : ""), key: itemkey, "data-sv-drop-target-item-value": this.model.isDraggable ? this.model.item.value : undefined, onPointerDown: (event) => this.model.onPointerDown(event) },
1111
+ React.createElement("div", { className: "svc-item-value__ghost" }),
1112
+ React.createElement("div", { className: "svc-item-value-controls", onBlur: this.onBlur }, button),
1113
+ React.createElement("div", { className: "svc-item-value__item", onClick: (event) => this.model.select(this.model, event.nativeEvent) }, this.props.element),
1114
+ this.renderPanelAction()),
1115
+ this.renderPanel()));
1116
+ }
1117
+ renderPanelAction() {
1118
+ if (!this.model.canShowPanel())
1119
+ return null;
1120
+ const isShowPanel = this.model.showPanel;
1121
+ const icName = isShowPanel ? "icon-collapsepanel-16x16" : "icon-expandpanel-16x16";
1122
+ const btn = attachKey2click(React.createElement("span", { role: "button", className: "svc-item-value-controls__button svc-item-value-controls__add svc-choice-elements-button", onClick: () => {
1123
+ this.model.togglePanel();
1124
+ } },
1125
+ React.createElement(SvgIcon, { size: "auto", iconName: icName })));
1126
+ return React.createElement("div", { className: "svc-item-value-controls svc-choice-elements-button-container" }, btn);
1127
+ }
1128
+ renderPanel() {
1129
+ if (!this.model.showPanel)
1130
+ return null;
1131
+ const creator = this.model.creator;
1132
+ const survey = creator.survey;
1133
+ return React.createElement(ChoiceItemPanel, { element: this.model.item.panel, survey: survey, creator: creator, css: survey.getCss() });
1113
1134
  }
1114
1135
  }
1136
+ const ChoiceItemPanel = React.memo(({ element, survey, creator, css }) => {
1137
+ return React.createElement(SurveyPanel, { element: element, survey: survey, creator: creator, cssClasses: css });
1138
+ });
1139
+ ChoiceItemPanel.displayName = "ChoiceItemPanel";
1115
1140
  ReactElementFactory.Instance.registerElement("svc-item-value", (props) => {
1116
1141
  return React.createElement(ItemValueAdornerComponent, props);
1117
1142
  });
@@ -2888,8 +2913,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2888
2913
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2889
2914
 
2890
2915
  let Version;
2891
- Version = `${"2.3.9"}`;
2892
- checkLibraryVersion(`${"2.3.9"}`, "survey-creator-react");
2916
+ Version = `${"2.3.11"}`;
2917
+ checkLibraryVersion(`${"2.3.11"}`, "survey-creator-react");
2893
2918
 
2894
2919
  function renderSurveyCreator(creator, element, props = {}) {
2895
2920
  let node = element;