survey-creator-react 1.12.54 → 1.12.55
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.
|
|
2
|
+
* SurveyJS Creator React 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
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { createElement, Fragment } from 'react';
|
|
10
|
-
import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, ReactQuestionFactory, SurveyLocStringViewer, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, SurveyQuestionText } from 'survey-react-ui';
|
|
10
|
+
import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, ReactQuestionFactory, SurveyLocStringViewer, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, SurveyPanel, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, SurveyQuestionText } from 'survey-react-ui';
|
|
11
11
|
import { SurveyCreatorModel, assign, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, PageAdorner, LogoImageViewModel, editorLocalization, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperViewModel, SurveyResultsModel, ToolboxToolViewModel, editableStringRendererName, StringEditorViewModelBase, initLogicOperator, PageNavigatorViewModel } from 'survey-creator-core';
|
|
12
12
|
export { PropertyGridEditorCollection, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, ToolboxToolViewModel, editorLocalization, localization, settings, svgBundle } from 'survey-creator-core';
|
|
13
13
|
import * as ReactDOM from 'react-dom';
|
|
@@ -51,6 +51,7 @@ class TabbedMenuItemWrapper extends SurveyElementBase {
|
|
|
51
51
|
constructor(props) {
|
|
52
52
|
super(props);
|
|
53
53
|
this.ref = React.createRef();
|
|
54
|
+
this.state = { changed: 0 };
|
|
54
55
|
}
|
|
55
56
|
get item() {
|
|
56
57
|
return this.props.item;
|
|
@@ -71,14 +72,22 @@ class TabbedMenuItemWrapper extends SurveyElementBase {
|
|
|
71
72
|
componentDidMount() {
|
|
72
73
|
super.componentDidMount();
|
|
73
74
|
this.item.updateModeCallback = (mode, callback) => {
|
|
75
|
+
const update = () => {
|
|
76
|
+
if (this.item.mode == mode) {
|
|
77
|
+
this.setState({ changed: this.state.changed + 1 });
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.item.mode = mode;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
74
83
|
queueMicrotask(() => {
|
|
75
84
|
if (ReactDOM["flushSync"]) {
|
|
76
85
|
ReactDOM["flushSync"](() => {
|
|
77
|
-
|
|
86
|
+
update();
|
|
78
87
|
});
|
|
79
88
|
}
|
|
80
89
|
else {
|
|
81
|
-
|
|
90
|
+
update();
|
|
82
91
|
}
|
|
83
92
|
queueMicrotask(() => {
|
|
84
93
|
callback(mode, this.ref.current);
|
|
@@ -439,7 +448,7 @@ class QuestionAdornerComponent extends CreatorModelElement {
|
|
|
439
448
|
const element = this.model.element;
|
|
440
449
|
return (React.createElement("div", { ref: node => node && (!this.model.renderedCollapsed ?
|
|
441
450
|
node.setAttribute("inert", "") : node.removeAttribute("inert")), className: this.model.cssCollapsedHiddenHeader }, (element.hasTitle ?
|
|
442
|
-
React.createElement(TitleElement, { element: element }) :
|
|
451
|
+
React.createElement(TitleElement, { element: element, renderActions: false }) :
|
|
443
452
|
React.createElement("div", { className: this.model.cssCollapsedHiddenTitle },
|
|
444
453
|
React.createElement("span", { className: "svc-fake-title" }, element.name)))));
|
|
445
454
|
}
|
|
@@ -620,7 +629,7 @@ class QuestionImageAdornerComponent extends QuestionAdornerComponent {
|
|
|
620
629
|
return [this.model, this.imageModel.filePresentationModel];
|
|
621
630
|
}
|
|
622
631
|
renderElementContent() {
|
|
623
|
-
if (this.imageModel.
|
|
632
|
+
if (this.imageModel.isEmptyElement) {
|
|
624
633
|
const fileQuestion = ReactQuestionFactory.Instance.createQuestion("file", {
|
|
625
634
|
creator: this.imageModel.question.survey,
|
|
626
635
|
isDisplayMode: false,
|
|
@@ -1094,17 +1103,42 @@ class ItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1094
1103
|
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) },
|
|
1095
1104
|
React.createElement(SvgIcon, { size: "auto", iconName: "icon-remove_16x16", title: this.model.tooltip }))) : null));
|
|
1096
1105
|
const itemkey = this.props.element.key + (this.model.allowAdd ? "_new" : "");
|
|
1097
|
-
return (React.createElement(
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
+
return (React.createElement(React.Fragment, null,
|
|
1107
|
+
React.createElement("div", { ref: this.rootRef, className: "svc-item-value-wrapper" +
|
|
1108
|
+
(this.model.allowAdd ? " svc-item-value--new" : "") +
|
|
1109
|
+
(this.model.isDragging ? " svc-item-value--dragging" : "") +
|
|
1110
|
+
(this.model.isDragDropGhost ? " svc-item-value--ghost" : "") +
|
|
1111
|
+
(this.model.isDragDropMoveDown ? " svc-item-value--movedown" : "") +
|
|
1112
|
+
(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) },
|
|
1113
|
+
React.createElement("div", { className: "svc-item-value__ghost" }),
|
|
1114
|
+
React.createElement("div", { className: "svc-item-value-controls", onBlur: this.onBlur }, button),
|
|
1115
|
+
React.createElement("div", { className: "svc-item-value__item", onClick: (event) => this.model.select(this.model, event.nativeEvent) }, this.props.element),
|
|
1116
|
+
this.renderPanelAction()),
|
|
1117
|
+
this.renderPanel()));
|
|
1118
|
+
}
|
|
1119
|
+
renderPanelAction() {
|
|
1120
|
+
if (!this.model.canShowPanel())
|
|
1121
|
+
return null;
|
|
1122
|
+
const isShowPanel = this.model.showPanel;
|
|
1123
|
+
const icName = isShowPanel ? "icon-collapsepanel-16x16" : "icon-expandpanel-16x16";
|
|
1124
|
+
const btn = attachKey2click(React.createElement("span", { role: "button", className: "svc-item-value-controls__button svc-item-value-controls__add svc-choice-elements-button", onClick: () => {
|
|
1125
|
+
this.model.togglePanel();
|
|
1126
|
+
} },
|
|
1127
|
+
React.createElement(SvgIcon, { size: "auto", iconName: icName })));
|
|
1128
|
+
return React.createElement("div", { className: "svc-item-value-controls svc-choice-elements-button-container" }, btn);
|
|
1129
|
+
}
|
|
1130
|
+
renderPanel() {
|
|
1131
|
+
if (!this.model.showPanel)
|
|
1132
|
+
return null;
|
|
1133
|
+
const creator = this.model.creator;
|
|
1134
|
+
const survey = creator.survey;
|
|
1135
|
+
return React.createElement(ChoiceItemPanel, { element: this.model.item.panel, survey: survey, creator: creator, css: survey.getCss() });
|
|
1106
1136
|
}
|
|
1107
1137
|
}
|
|
1138
|
+
const ChoiceItemPanel = React.memo(({ element, survey, creator, css }) => {
|
|
1139
|
+
return React.createElement(SurveyPanel, { element: element, survey: survey, creator: creator, cssClasses: css });
|
|
1140
|
+
});
|
|
1141
|
+
ChoiceItemPanel.displayName = "ChoiceItemPanel";
|
|
1108
1142
|
ReactElementFactory.Instance.registerElement("svc-item-value", (props) => {
|
|
1109
1143
|
return React.createElement(ItemValueAdornerComponent, props);
|
|
1110
1144
|
});
|
|
@@ -2881,8 +2915,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
|
|
|
2881
2915
|
RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
|
|
2882
2916
|
|
|
2883
2917
|
let Version;
|
|
2884
|
-
Version = `${"2.3.
|
|
2885
|
-
checkLibraryVersion(`${"2.3.
|
|
2918
|
+
Version = `${"2.3.11"}`;
|
|
2919
|
+
checkLibraryVersion(`${"2.3.11"}`, "survey-creator-react");
|
|
2886
2920
|
|
|
2887
2921
|
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 };
|
|
2888
2922
|
//# sourceMappingURL=survey-creator-react.mjs.map
|