From 0d433507c1198f35a56f8ea8572e19d63a3011a6 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 13 Dec 2024 19:16:24 +0400 Subject: [PATCH 1/6] Work for React 19 --- packages/survey-creator-react/package.json | 6 +- .../survey-creator-react/src/ActionButton.tsx | 6 +- .../src/AddQuestionButton.tsx | 4 +- .../src/ImageItemValueWrapper.tsx | 4 +- .../src/ItemValueWrapper.tsx | 4 +- .../survey-creator-react/src/LogoImage.tsx | 4 +- .../src/MatrixCellWrapper.tsx | 4 +- .../survey-creator-react/src/Navigation.tsx | 2 +- .../src/PageNavigator.tsx | 4 +- .../src/QuestionEditorContent.tsx | 6 +- .../src/QuestionEmbeddedSurvey.tsx | 2 +- .../src/QuestionError.tsx | 2 +- .../src/QuestionLinkValue.tsx | 4 +- packages/survey-creator-react/src/Results.tsx | 10 +-- .../survey-creator-react/src/StringEditor.tsx | 7 +- .../src/SurveyCreator.tsx | 4 +- .../survey-creator-react/src/TabbedMenu.tsx | 6 +- .../src/adorners/CellQuestion.tsx | 2 +- .../src/adorners/CellQuestionDropdown.tsx | 2 +- .../src/adorners/Page.tsx | 12 +-- .../src/adorners/Panel.tsx | 4 +- .../src/adorners/Question.tsx | 18 ++--- .../src/adorners/QuestionBanner.tsx | 2 +- .../src/adorners/QuestionDropdown.tsx | 2 +- .../src/adorners/QuestionFooter.tsx | 2 +- .../src/adorners/QuestionHeader.tsx | 2 +- .../src/adorners/QuestionImage.tsx | 10 +-- .../src/adorners/QuestionRating.tsx | 2 +- .../src/adorners/QuestionWidget.tsx | 2 +- .../survey-creator-react/src/adorners/Row.tsx | 4 +- .../src/components/Scroll.tsx | 2 +- .../src/components/Search.tsx | 2 +- .../src/components/SurfacePlaceholder.tsx | 2 +- .../src/custom-questions/BooleanSwitch.tsx | 2 +- .../src/custom-questions/ColorQuestion.tsx | 18 ++--- .../src/custom-questions/FileEditQuestion.tsx | 22 +++--- .../src/custom-questions/SpinEditor.tsx | 10 +-- .../TextWithResetQuestion.tsx | 4 +- .../src/side-bar/ObjectSelector.tsx | 2 +- .../src/side-bar/PropertyGridPlaceholder.tsx | 2 +- .../src/side-bar/SideBar.tsx | 4 +- .../src/side-bar/SideBarDefaultHeader.tsx | 2 +- .../src/side-bar/SideBarHeader.tsx | 2 +- .../side-bar/SideBarPropertyGridHeader.tsx | 2 +- .../src/side-bar/TabButton.tsx | 2 +- .../src/side-bar/TabControl.tsx | 2 +- .../src/tabs/Designer.tsx | 14 ++-- .../src/tabs/JsonEditorAce.tsx | 2 +- .../src/tabs/JsonEditorTextarea.tsx | 4 +- .../survey-creator-react/src/tabs/Logic.tsx | 6 +- .../survey-creator-react/src/tabs/Preview.tsx | 10 +-- .../src/tabs/SurveySimulator.tsx | 2 +- .../survey-creator-react/src/tabs/Theme.tsx | 8 +- .../src/tabs/logic-operator.tsx | 2 +- .../src/tabs/translation/Translation.tsx | 4 +- .../src/toolbox/AdaptiveToolbox.tsx | 6 +- .../src/toolbox/ToolboxCategory.tsx | 6 +- .../src/toolbox/ToolboxItem.tsx | 6 +- .../src/toolbox/ToolboxItemGroup.tsx | 2 +- .../testCafe-V2/by-page.html | 50 +++++++----- .../testCafe-V2/dropdown-collapse-view.html | 50 +++++++----- .../testCafe-V2/preview-theme-switcher.html | 56 +++++++------ .../testCafe-V2/testcafe-no-license.html | 49 +++++++----- .../testCafe-V2/testcafe-theme-tab.html | 54 +++++++------ .../testCafe-V2/testcafe-widget.html | 49 +++++++----- .../testCafe-V2/testcafe.html | 78 ++++++++++--------- .../testCafe-V2/testcafe_localized_ui.html | 56 +++++++------ .../testCafe-V2/theme-for-preview-option.html | 52 +++++++------ .../testCafe/by-page.html | 50 +++++++----- .../testCafe/dropdown-collapse-view.html | 50 +++++++----- .../testCafe/preview-theme-switcher.html | 52 +++++++------ .../testCafe/testcafe-no-license.html | 49 +++++++----- .../testCafe/testcafe-theme-tab.html | 50 +++++++----- .../testCafe/testcafe-widget.html | 49 +++++++----- .../testCafe/testcafe.html | 74 ++++++++++-------- .../testCafe/testcafe_localized_ui.html | 56 +++++++------ .../testCafe/theme-for-preview-option.html | 52 +++++++------ .../survey-creator-react/webpack.config.js | 2 +- 78 files changed, 709 insertions(+), 564 deletions(-) diff --git a/packages/survey-creator-react/package.json b/packages/survey-creator-react/package.json index de3351c5db..48c946ea80 100644 --- a/packages/survey-creator-react/package.json +++ b/packages/survey-creator-react/package.json @@ -44,8 +44,8 @@ "@types/jquery": "3.3.29", "@types/lodash": "4.14.186", "@types/node": "7.0.4", - "@types/react": "17.0.1", - "@types/react-dom": "17.0.1", + "@types/react": "^17.0.83", + "@types/react-dom": "^17.0.1", "@types/react-test-renderer": "^17.0.1", "ajv": "8.17.1", "axe-core": "^3.5.6", @@ -101,4 +101,4 @@ "tag": true } } -} +} \ No newline at end of file diff --git a/packages/survey-creator-react/src/ActionButton.tsx b/packages/survey-creator-react/src/ActionButton.tsx index 89b2b3e1c9..a50a4f8686 100644 --- a/packages/survey-creator-react/src/ActionButton.tsx +++ b/packages/survey-creator-react/src/ActionButton.tsx @@ -13,7 +13,7 @@ interface IActionButtonProps { allowBubble?: boolean; } export class ActionButton extends SurveyElementBase { - renderElement(): JSX.Element { + renderElement(): React.JSX.Element { const classes = new CssClassBuilder() .append(this.props.classes) .append("svc-action-button") @@ -26,7 +26,7 @@ export class ActionButton extends SurveyElementBase { return this.renderButtonText(classes); } - renderButtonText(classes): JSX.Element { + renderButtonText(classes): React.JSX.Element { if (this.props.disabled) { return {this.props.text}; } @@ -50,7 +50,7 @@ export class ActionButton extends SurveyElementBase { ); } - renderIcon(classes): JSX.Element { + renderIcon(classes): React.JSX.Element { classes += " svc-action-button--icon"; if (this.props.disabled) { return ; diff --git a/packages/survey-creator-react/src/AddQuestionButton.tsx b/packages/survey-creator-react/src/AddQuestionButton.tsx index 3c52187948..eb6566d6ba 100644 --- a/packages/survey-creator-react/src/AddQuestionButton.tsx +++ b/packages/survey-creator-react/src/AddQuestionButton.tsx @@ -15,7 +15,7 @@ export class AddQuestionButtonComponent extends SurveyElementBase<{ item: Action public get model() { return this.props.item.data; } - protected renderTypeSelector(): JSX.Element { + protected renderTypeSelector(): React.JSX.Element { const questionTypeSelectorModel = this.model.questionTypeSelectorModel; return attachKey2click( )); } - protected renderChooseButton(): JSX.Element { + protected renderChooseButton(): React.JSX.Element { return ( attachKey2click(