survey-creator-react 1.12.37 → 1.12.39
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.
|
|
2
|
+
* SurveyJS Creator React v2.1.1
|
|
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
|
|
@@ -359,6 +359,11 @@ class ReactDragEvent extends ReactMouseEvent {
|
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
+
function QuestionElementContentFunc(props) {
|
|
363
|
+
return props.element;
|
|
364
|
+
}
|
|
365
|
+
const QuestionElementContent = React.memo(QuestionElementContentFunc);
|
|
366
|
+
QuestionElementContent.displayName = "QuestionElementContent";
|
|
362
367
|
class QuestionAdornerComponent extends CreatorModelElement {
|
|
363
368
|
constructor(props) {
|
|
364
369
|
super(props);
|
|
@@ -433,7 +438,7 @@ class QuestionAdornerComponent extends CreatorModelElement {
|
|
|
433
438
|
}
|
|
434
439
|
renderElementContent() {
|
|
435
440
|
return (React.createElement(React.Fragment, null,
|
|
436
|
-
this.props.element,
|
|
441
|
+
React.createElement(QuestionElementContent, { element: this.props.element }),
|
|
437
442
|
this.renderElementPlaceholder(),
|
|
438
443
|
this.renderCarryForwardBanner()));
|
|
439
444
|
}
|
|
@@ -651,9 +656,9 @@ class QuestionRatingAdornerComponent extends CreatorModelElement {
|
|
|
651
656
|
return (React.createElement(React.Fragment, null,
|
|
652
657
|
React.createElement("div", { className: "svc-rating-question-content" },
|
|
653
658
|
React.createElement("div", { className: model.controlsClassNames },
|
|
654
|
-
model.allowRemove ? attachKey2click(React.createElement("span", { className: model.removeClassNames, "aria-label": model.removeTooltip, onClick: () => model.removeItem(model) },
|
|
659
|
+
model.allowRemove ? attachKey2click(React.createElement("span", { role: "button", className: model.removeClassNames, "aria-label": model.removeTooltip, onClick: () => model.removeItem(model) },
|
|
655
660
|
React.createElement(SvgIcon, { size: "auto", iconName: "icon-remove_16x16", title: model.removeTooltip }))) : null,
|
|
656
|
-
model.allowAdd ? attachKey2click(React.createElement("span", { className: model.addClassNames, "aria-label": model.addTooltip, onClick: () => model.addItem(model) },
|
|
661
|
+
model.allowAdd ? attachKey2click(React.createElement("span", { role: "button", className: model.addClassNames, "aria-label": model.addTooltip, onClick: () => model.addItem(model) },
|
|
657
662
|
React.createElement(SvgIcon, { size: "auto", iconName: "icon-add_16x16", title: model.addTooltip }))) : null),
|
|
658
663
|
this.props.element)));
|
|
659
664
|
}
|
|
@@ -732,6 +737,10 @@ ReactElementFactory.Instance.registerElement("svc-cell-dropdown-question", (prop
|
|
|
732
737
|
return React.createElement(CellQuestionDropdownAdornerComponent, props);
|
|
733
738
|
});
|
|
734
739
|
|
|
740
|
+
const PageElementContent = React.memo(({ page, survey, creator }) => {
|
|
741
|
+
return React.createElement(SurveyPage, { page: page, survey: survey, creator: creator });
|
|
742
|
+
});
|
|
743
|
+
PageElementContent.displayName = "PageElementContent";
|
|
735
744
|
class CreatorSurveyPageComponent extends CreatorModelElement {
|
|
736
745
|
constructor(props) {
|
|
737
746
|
super(props);
|
|
@@ -741,9 +750,12 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
|
|
|
741
750
|
if (this.model) {
|
|
742
751
|
this.model.attachToUI(props.page, this.rootRef.current);
|
|
743
752
|
}
|
|
744
|
-
this.model =
|
|
753
|
+
this.model = this.createPageAdorner(props.creator, props.page);
|
|
745
754
|
this.model.isGhost = this.props.isGhost;
|
|
746
755
|
}
|
|
756
|
+
createPageAdorner(creator, page) {
|
|
757
|
+
return new PageAdorner(creator, page);
|
|
758
|
+
}
|
|
747
759
|
shouldComponentUpdate(nextProps, nextState) {
|
|
748
760
|
const res = super.shouldComponentUpdate(nextProps, nextState);
|
|
749
761
|
if (this.model) {
|
|
@@ -793,7 +805,11 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
|
|
|
793
805
|
React.createElement("div", { className: "svc-panel__placeholder" }, this.model.placeholderText))));
|
|
794
806
|
}
|
|
795
807
|
renderContent() {
|
|
796
|
-
|
|
808
|
+
if (!this.model.needRenderContent) {
|
|
809
|
+
return React.createElement("div", { className: "svc-page__loading-content" },
|
|
810
|
+
React.createElement(LoadingIndicatorComponent, null));
|
|
811
|
+
}
|
|
812
|
+
return (React.createElement(PageElementContent, { page: this.props.page, survey: this.props.survey, creator: this.props.creator }));
|
|
797
813
|
}
|
|
798
814
|
renderHeader() {
|
|
799
815
|
const actions = (React.createElement("div", { className: "svc-page__content-actions" },
|
|
@@ -1060,7 +1076,7 @@ class ItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1060
1076
|
}
|
|
1061
1077
|
render() {
|
|
1062
1078
|
this.model.item = this.props.item;
|
|
1063
|
-
const button = this.model.allowAdd ? (attachKey2click(React.createElement("span", { className: "svc-item-value-controls__button svc-item-value-controls__add", "aria-label": this.model.tooltip, onClick: () => {
|
|
1079
|
+
const button = this.model.allowAdd ? (attachKey2click(React.createElement("span", { role: "button", className: "svc-item-value-controls__button svc-item-value-controls__add", "aria-label": this.model.tooltip, onClick: () => {
|
|
1064
1080
|
this.model.add(this.model);
|
|
1065
1081
|
this.model.isNew = false;
|
|
1066
1082
|
} },
|
|
@@ -1068,7 +1084,7 @@ class ItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1068
1084
|
" ",
|
|
1069
1085
|
this.model.isDraggable ? (React.createElement("span", { className: "svc-item-value-controls__button svc-item-value-controls__drag" },
|
|
1070
1086
|
React.createElement(SvgIcon, { className: "svc-item-value-controls__drag-icon", size: "auto", iconName: "icon-drag-24x24", title: this.model.dragTooltip }))) : null,
|
|
1071
|
-
this.model.allowRemove ? attachKey2click(React.createElement("span", { className: "svc-item-value-controls__button svc-item-value-controls__remove", "aria-label": this.model.tooltip, onClick: () => this.model.remove(this.model) },
|
|
1087
|
+
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) },
|
|
1072
1088
|
React.createElement(SvgIcon, { size: "auto", iconName: "icon-remove_16x16", title: this.model.tooltip }))) : null));
|
|
1073
1089
|
const itemkey = this.props.element.key + (this.model.allowAdd ? "_new" : "");
|
|
1074
1090
|
return (React.createElement("div", { ref: this.rootRef, className: "svc-item-value-wrapper" +
|
|
@@ -2060,12 +2076,15 @@ class SurveyLogicOpertor extends SurveyQuestionDropdown {
|
|
|
2060
2076
|
const q = this.question;
|
|
2061
2077
|
initLogicOperator(q);
|
|
2062
2078
|
const text = (q.locReadOnlyText) ? this.renderLocString(q.locReadOnlyText) : "";
|
|
2079
|
+
const dropdownListModel = this.question.dropdownListModel;
|
|
2063
2080
|
return (React.createElement("div", { id: this.question.inputId, className: q.getControlClass(), tabIndex: this.question.isInputReadOnly ? undefined : 0,
|
|
2064
2081
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2065
2082
|
// @ts-ignore
|
|
2066
|
-
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onKeyUp: this.keyhandler, role:
|
|
2067
|
-
React.createElement("div", { className: this.question.cssClasses.controlValue }, text)
|
|
2068
|
-
|
|
2083
|
+
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onKeyUp: this.keyhandler, role: dropdownListModel.ariaQuestionRole, "aria-required": dropdownListModel.ariaQuestionRequired, "aria-invalid": dropdownListModel.ariaQuestionInvalid, "aria-errormessage": dropdownListModel.ariaQuestionErrorMessage, "aria-expanded": dropdownListModel.ariaQuestionExpanded, "aria-label": dropdownListModel.ariaQuestionLabel, "aria-labelledby": dropdownListModel.ariaQuestionLabelledby, "aria-controls": dropdownListModel.ariaQuestionControls },
|
|
2084
|
+
React.createElement("div", { className: this.question.cssClasses.controlValue }, text)));
|
|
2085
|
+
}
|
|
2086
|
+
renderEditorButtons() {
|
|
2087
|
+
return null;
|
|
2069
2088
|
}
|
|
2070
2089
|
}
|
|
2071
2090
|
ReactQuestionFactory.Instance.registerQuestion("sv-logic-operator", (props) => {
|
|
@@ -2107,9 +2126,10 @@ class SurveyPageNavigator extends CreatorModelElement {
|
|
|
2107
2126
|
if (this.model.isPopupOpened)
|
|
2108
2127
|
className += " svc-page-navigator__button--pressed";
|
|
2109
2128
|
return (React.createElement("div", { className: "svc-page-navigator", ref: this.containerRef, style: { display: this.model.visible ? "flex" : "none" } },
|
|
2110
|
-
|
|
2111
|
-
React.createElement(
|
|
2112
|
-
|
|
2129
|
+
React.createElement("div", null,
|
|
2130
|
+
attachKey2click(React.createElement("div", { role: "button", className: className, onClick: () => this.model.togglePageSelector(), title: this.model.pageSelectorCaption },
|
|
2131
|
+
React.createElement(SvgIcon, { className: "svc-page-navigator__button-icon", iconName: this.model.icon, size: "auto", title: this.model.pageSelectorCaption }))),
|
|
2132
|
+
React.createElement(Popup, { model: this.model.popupModel })),
|
|
2113
2133
|
React.createElement("div", null, this.model.visibleItems.map((item) => (React.createElement(SurveyPageNavigatorItem, { key: item.id, item: item }))))));
|
|
2114
2134
|
}
|
|
2115
2135
|
}
|
|
@@ -2813,8 +2833,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
|
|
|
2813
2833
|
RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
|
|
2814
2834
|
|
|
2815
2835
|
let Version;
|
|
2816
|
-
Version = `${"2.
|
|
2817
|
-
checkLibraryVersion(`${"2.
|
|
2836
|
+
Version = `${"2.1.1"}`;
|
|
2837
|
+
checkLibraryVersion(`${"2.1.1"}`, "survey-creator-react");
|
|
2818
2838
|
|
|
2819
2839
|
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 };
|
|
2820
2840
|
//# sourceMappingURL=survey-creator-react.mjs.map
|