survey-creator-react 2.0.9 → 2.1.0
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.
- package/fesm/survey-creator-react.mjs +22 -6
- package/fesm/survey-creator-react.mjs.map +1 -1
- package/package.json +4 -4
- package/survey-creator-react.js +23 -6
- package/survey-creator-react.js.map +1 -1
- package/survey-creator-react.min.js +1 -1
- package/survey-creator-react.min.js.LICENSE.txt +1 -1
- package/typings/adorners/Page.d.ts +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator React v2.0
|
|
2
|
+
* SurveyJS Creator React v2.1.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
|
|
@@ -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
|
}
|
|
@@ -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" },
|
|
@@ -2813,8 +2829,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
|
|
|
2813
2829
|
RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
|
|
2814
2830
|
|
|
2815
2831
|
let Version;
|
|
2816
|
-
Version = `${"2.0
|
|
2817
|
-
checkLibraryVersion(`${"2.0
|
|
2832
|
+
Version = `${"2.1.0"}`;
|
|
2833
|
+
checkLibraryVersion(`${"2.1.0"}`, "survey-creator-react");
|
|
2818
2834
|
|
|
2819
2835
|
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
2836
|
//# sourceMappingURL=survey-creator-react.mjs.map
|