diff --git a/.eslintrc.json b/.eslintrc.json index 6f49dcc612..cf81c07acc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,6 +16,7 @@ "rules": { "surveyjs/no-test-only": 2, "surveyjs/no-test-debug": 2, + "surveyjs/no-imports-from-entries": 2, "no-console": 2, // Remember, this means error! "indent": [ "error", diff --git a/accessibilityTests/helper.ts b/accessibilityTests/helper.ts index dd3fe0b9a8..f1fd434041 100644 --- a/accessibilityTests/helper.ts +++ b/accessibilityTests/helper.ts @@ -57,7 +57,7 @@ export const initSurvey = ClientFunction( } else if (framework === "react") { document.getElementById("surveyElement").innerHTML = ""; window["ReactDOM"].render( - window["React"].createElement(window["Survey"].Survey, { + window["React"].createElement(window["SurveyReact"].Survey, { model: model, onComplete: surveyComplete, }), diff --git a/build-scripts/survey-jquery-ui/tsconfig.typing.jquery-ui.json b/build-scripts/survey-jquery-ui/tsconfig.typing.jquery-ui.json index aba072468c..ed19213d71 100644 --- a/build-scripts/survey-jquery-ui/tsconfig.typing.jquery-ui.json +++ b/build-scripts/survey-jquery-ui/tsconfig.typing.jquery-ui.json @@ -27,6 +27,6 @@ "skipLibCheck": true }, "include": [ - "../../src/entries/jquery-ui-model.ts" + "../../src/entries/react-ui-model.ts" ], } \ No newline at end of file diff --git a/build-scripts/survey-ui/tsconfig.typing.ui.json b/build-scripts/survey-ui/tsconfig.typing.ui.json index aba072468c..ed19213d71 100644 --- a/build-scripts/survey-ui/tsconfig.typing.ui.json +++ b/build-scripts/survey-ui/tsconfig.typing.ui.json @@ -27,6 +27,6 @@ "skipLibCheck": true }, "include": [ - "../../src/entries/jquery-ui-model.ts" + "../../src/entries/react-ui-model.ts" ], } \ No newline at end of file diff --git a/eslint-surveyjs/index.js b/eslint-surveyjs/index.js index 4d7ba09253..ec2f6b48bb 100644 --- a/eslint-surveyjs/index.js +++ b/eslint-surveyjs/index.js @@ -1,5 +1,6 @@ const testOnlyMessage = " :( please don't forget to remove 'test.only' testcafe statement it will disable all other tests :( "; const debugMessage = " :( please don't forget to remove 'debug()' :( "; +const entriesMessage = "import from 'entries' folder needs to be replaced. Use another path." module.exports = { rules: { @@ -25,5 +26,13 @@ module.exports = { } } }), + "no-imports-from-entries": context => + ({ + ImportDeclaration: function (node) { + if (node.source.value.includes("\/entries\/")) { + context.report(node, entriesMessage); + } + } + }), } }; \ No newline at end of file diff --git a/examples_test/bootstrap/react.html b/examples_test/bootstrap/react.html index 8006559786..8f10b45858 100644 --- a/examples_test/bootstrap/react.html +++ b/examples_test/bootstrap/react.html @@ -5,7 +5,13 @@ - + + + + + + +
diff --git a/examples_test/bootstrap/survey-ui.html b/examples_test/bootstrap/survey-ui.html index c6d420f053..7b33baffc1 100644 --- a/examples_test/bootstrap/survey-ui.html +++ b/examples_test/bootstrap/survey-ui.html @@ -10,7 +10,7 @@ - + diff --git a/examples_test/customWidget/react.html b/examples_test/customWidget/react.html index 138c16115e..fe3c3f300d 100644 --- a/examples_test/customWidget/react.html +++ b/examples_test/customWidget/react.html @@ -12,8 +12,12 @@ - - + + + + + + diff --git a/examples_test/default/react.html b/examples_test/default/react.html index 1a2627434e..398efaaf30 100644 --- a/examples_test/default/react.html +++ b/examples_test/default/react.html @@ -5,8 +5,12 @@ - - + + + + + + diff --git a/examples_test/defaultV2/react.html b/examples_test/defaultV2/react.html index 0c95e265cd..7a76317dd4 100644 --- a/examples_test/defaultV2/react.html +++ b/examples_test/defaultV2/react.html @@ -6,8 +6,12 @@ - - + + + + + +
diff --git a/examples_test/modern/react.html b/examples_test/modern/react.html index 344e5442ab..a0aa2e7ae3 100644 --- a/examples_test/modern/react.html +++ b/examples_test/modern/react.html @@ -4,8 +4,12 @@ - - + + + + + + diff --git a/package.json b/package.json index 2d967b4ebd..18c3de481f 100644 --- a/package.json +++ b/package.json @@ -145,8 +145,8 @@ "eslint": "^7.32.0", "eslint-cli": "^1.1.1", "eslint-plugin-react": "7.30.1", - "eslint-plugin-surveyjs": "file:eslint-surveyjs", "eslint-plugin-vue": "^9.3.0", + "eslint-plugin-surveyjs": "file:eslint-surveyjs", "file-loader": "0.10.0", "generate-json-webpack-plugin": "^1.0.0", "get-func-name": "2.0.0", diff --git a/src/entries/jquery-ui-model.ts b/src/entries/jquery-ui-model.ts deleted file mode 100644 index 27ed75619d..0000000000 --- a/src/entries/jquery-ui-model.ts +++ /dev/null @@ -1,114 +0,0 @@ -// react -export { Survey, attachKey2click } from "../react/reactSurvey"; -export { ReactSurveyElementsWrapper } from "../react/reactsurveymodel"; -export { SurveyNavigationBase } from "../react/reactSurveyNavigationBase"; -export { SurveyTimerPanel } from "../react/reacttimerpanel"; -export { SurveyPage } from "../react/page"; -export { SurveyRow } from "../react/row"; -export { SurveyPanel } from "../react/panel"; -export { SurveyFlowPanel } from "../react/flow-panel"; -export { - SurveyQuestion, - SurveyElementErrors, - SurveyQuestionAndErrorsCell, - ISurveyCreator -} from "../react/reactquestion"; -export { - ReactSurveyElement, - SurveyElementBase, - SurveyQuestionElementBase, -} from "../react/reactquestion_element"; -export { - SurveyQuestionCommentItem, - SurveyQuestionComment, -} from "../react/reactquestion_comment"; -export { - SurveyQuestionCheckbox, - SurveyQuestionCheckboxItem, -} from "../react/reactquestion_checkbox"; -export { - SurveyQuestionRanking, - SurveyQuestionRankingItem, -} from "../react/reactquestion_ranking"; - -export { RatingItem } from "../react/components/rating/rating-item"; -export { RatingItemStar } from "../react/components/rating/rating-item-star"; -export { RatingItemSmiley } from "../react/components/rating/rating-item-smiley"; -export { RatingDropdownItem } from "../react/components/rating/rating-dropdown-item"; - -export { TagboxFilterString } from "../react/tagbox-filter"; -export { SurveyQuestionOptionItem } from "../react/dropdown-item"; -export { SurveyQuestionDropdownBase } from "../react/dropdown-base"; -export { SurveyQuestionDropdown } from "../react/reactquestion_dropdown"; -export { SurveyQuestionTagboxItem } from "../react/tagbox-item"; -export { SurveyQuestionTagbox } from "../react/reactquestion_tagbox"; -export { SurveyQuestionDropdownSelect } from "../react/dropdown-select"; -export { - SurveyQuestionMatrix, - SurveyQuestionMatrixRow, - SurveyQuestionMatrixCell -} from "../react/reactquestion_matrix"; -export { SurveyQuestionHtml } from "../react/reactquestion_html"; -export { SurveyQuestionFile } from "../react/reactquestion_file"; -export { SurveyFileChooseButton } from "../react/components/file/file-choose-button"; -export { SurveyFilePreview } from "../react/components/file/file-preview"; -export { SurveyQuestionMultipleText } from "../react/reactquestion_multipletext"; -export { SurveyQuestionRadiogroup, SurveyQuestionRadioItem } from "../react/reactquestion_radiogroup"; -export { SurveyQuestionText } from "../react/reactquestion_text"; -export { SurveyQuestionBoolean } from "../react/boolean"; -export { SurveyQuestionBooleanCheckbox } from "../react/boolean-checkbox"; -export { SurveyQuestionBooleanRadio } from "../react/boolean-radio"; -export { SurveyQuestionEmpty } from "../react/reactquestion_empty"; -export { SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase } from "../react/reactquestion_matrixdropdownbase"; -export { SurveyQuestionMatrixDropdown } from "../react/reactquestion_matrixdropdown"; -export { SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton } from "../react/reactquestion_matrixdynamic"; -export { SurveyQuestionPanelDynamic } from "../react/reactquestion_paneldynamic"; -export { SurveyProgress } from "../react/progress"; -export { SurveyProgressButtons } from "../react/progressButtons"; -export { SurveyProgressToc } from "../react/progressToc"; -export { SurveyQuestionRating } from "../react/reactquestion_rating"; -export { SurveyQuestionRatingDropdown } from "../react/rating-dropdown"; -export { SurveyQuestionExpression } from "../react/reactquestion_expression"; -export { PopupSurvey, SurveyWindow } from "../react/react-popup-survey"; -export { ReactQuestionFactory } from "../react/reactquestion_factory"; -export { ReactElementFactory } from "../react/element-factory"; -export { SurveyQuestionImagePicker } from "../react/imagepicker"; -export { SurveyQuestionImage } from "../react/image"; -export { SurveyQuestionSignaturePad } from "../react/signaturepad"; -export { SurveyQuestionButtonGroup } from "../react/reactquestion_buttongroup"; -export { SurveyQuestionCustom, SurveyQuestionComposite } from "../react/reactquestion_custom"; - -export { Popup } from "../react/components/popup/popup"; -export { List } from "../react/components/list/list"; -export { TitleActions } from "../react/components/title/title-actions"; -export { TitleElement } from "../react/components/title/title-element"; -export { SurveyActionBar } from "../react/components/action-bar/action-bar"; -export { LogoImage } from "../react/components/survey-header/logo-image"; -export { SurveyHeader } from "../react/components/survey-header/survey-header"; -export { SvgIcon } from "../react/components/svg-icon/svg-icon"; -export { SurveyQuestionMatrixDynamicRemoveButton } from "../react/components/matrix-actions/remove-button/remove-button"; -export { SurveyQuestionMatrixDetailButton } from "../react/components/matrix-actions/detail-button/detail-button"; -export { SurveyQuestionMatrixDynamicDragDropIcon } from "../react/components/matrix-actions/drag-drop-icon/drag-drop-icon"; -export { SurveyQuestionPanelDynamicAddButton } from "../react/components/paneldynamic-actions/paneldynamic-add-btn"; -export { SurveyQuestionPanelDynamicRemoveButton } from "../react/components/paneldynamic-actions/paneldynamic-remove-btn"; -export { SurveyQuestionPanelDynamicPrevButton } from "../react/components/paneldynamic-actions/paneldynamic-prev-btn"; -export { SurveyQuestionPanelDynamicNextButton } from "../react/components/paneldynamic-actions/paneldynamic-next-btn"; -export { SurveyQuestionPanelDynamicProgressText } from "../react/components/paneldynamic-actions/paneldynamic-progress-text"; -export { SurveyNavigationButton } from "../react/components/survey-actions/survey-nav-button"; -export { QuestionErrorComponent } from "../react/components/question-error"; - -export { MatrixRow } from "../react/components/matrix/row"; -export { Skeleton } from "../react/components/skeleton"; -export { NotifierComponent } from "../react/components/notifier"; -export { ComponentsContainer } from "../react/components/components-container"; -export { CharacterCounterComponent } from "../react/components/character-counter"; -export * from "../react/components/header"; - -export { SurveyLocStringViewer } from "../react/string-viewer"; -export { SurveyLocStringEditor } from "../react/string-editor"; -export { LoadingIndicatorComponent } from "../react/components/loading-indicator"; - -export { SvgBundleComponent } from "../react/svgbundle"; - -//Uncomment to include the "date" question type. -//export {default as SurveyQuestionDate} from "../plugins/react/reactquestiondate"; diff --git a/src/entries/jquery-ui.ts b/src/entries/jquery-ui.ts index 04e79b11a2..78c5542138 100644 --- a/src/entries/jquery-ui.ts +++ b/src/entries/jquery-ui.ts @@ -2,7 +2,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import jQuery from "jquery"; -import { Survey, PopupSurvey } from "./jquery-ui-model"; +import { Survey, PopupSurvey } from "./react-ui-model"; import { SurveyModel, checkLibraryVersion } from "survey-core"; @@ -29,7 +29,7 @@ SurveyModel.platform = "jquery"; export const preact: any = React; -export * from "./jquery-ui-model"; +export * from "./react-ui-model"; export * from "./core-export"; export { SurveyModel as Model } from "survey-core"; diff --git a/src/entries/react-ui.ts b/src/entries/react-ui.ts index c4c6cfda91..5981943c69 100644 --- a/src/entries/react-ui.ts +++ b/src/entries/react-ui.ts @@ -2,9 +2,6 @@ export * from "./react-ui-model"; export * from "./core-export"; export { SurveyModel as Model } from "survey-core"; -export * from "../utils/responsivity-manager"; -export { unwrap } from "../utils/utils"; - import { checkLibraryVersion } from "survey-core"; checkLibraryVersion(`${process.env.VERSION}`, "survey-react-ui"); \ No newline at end of file diff --git a/src/entries/ui-model.ts b/src/entries/ui-model.ts deleted file mode 100644 index 27ed75619d..0000000000 --- a/src/entries/ui-model.ts +++ /dev/null @@ -1,114 +0,0 @@ -// react -export { Survey, attachKey2click } from "../react/reactSurvey"; -export { ReactSurveyElementsWrapper } from "../react/reactsurveymodel"; -export { SurveyNavigationBase } from "../react/reactSurveyNavigationBase"; -export { SurveyTimerPanel } from "../react/reacttimerpanel"; -export { SurveyPage } from "../react/page"; -export { SurveyRow } from "../react/row"; -export { SurveyPanel } from "../react/panel"; -export { SurveyFlowPanel } from "../react/flow-panel"; -export { - SurveyQuestion, - SurveyElementErrors, - SurveyQuestionAndErrorsCell, - ISurveyCreator -} from "../react/reactquestion"; -export { - ReactSurveyElement, - SurveyElementBase, - SurveyQuestionElementBase, -} from "../react/reactquestion_element"; -export { - SurveyQuestionCommentItem, - SurveyQuestionComment, -} from "../react/reactquestion_comment"; -export { - SurveyQuestionCheckbox, - SurveyQuestionCheckboxItem, -} from "../react/reactquestion_checkbox"; -export { - SurveyQuestionRanking, - SurveyQuestionRankingItem, -} from "../react/reactquestion_ranking"; - -export { RatingItem } from "../react/components/rating/rating-item"; -export { RatingItemStar } from "../react/components/rating/rating-item-star"; -export { RatingItemSmiley } from "../react/components/rating/rating-item-smiley"; -export { RatingDropdownItem } from "../react/components/rating/rating-dropdown-item"; - -export { TagboxFilterString } from "../react/tagbox-filter"; -export { SurveyQuestionOptionItem } from "../react/dropdown-item"; -export { SurveyQuestionDropdownBase } from "../react/dropdown-base"; -export { SurveyQuestionDropdown } from "../react/reactquestion_dropdown"; -export { SurveyQuestionTagboxItem } from "../react/tagbox-item"; -export { SurveyQuestionTagbox } from "../react/reactquestion_tagbox"; -export { SurveyQuestionDropdownSelect } from "../react/dropdown-select"; -export { - SurveyQuestionMatrix, - SurveyQuestionMatrixRow, - SurveyQuestionMatrixCell -} from "../react/reactquestion_matrix"; -export { SurveyQuestionHtml } from "../react/reactquestion_html"; -export { SurveyQuestionFile } from "../react/reactquestion_file"; -export { SurveyFileChooseButton } from "../react/components/file/file-choose-button"; -export { SurveyFilePreview } from "../react/components/file/file-preview"; -export { SurveyQuestionMultipleText } from "../react/reactquestion_multipletext"; -export { SurveyQuestionRadiogroup, SurveyQuestionRadioItem } from "../react/reactquestion_radiogroup"; -export { SurveyQuestionText } from "../react/reactquestion_text"; -export { SurveyQuestionBoolean } from "../react/boolean"; -export { SurveyQuestionBooleanCheckbox } from "../react/boolean-checkbox"; -export { SurveyQuestionBooleanRadio } from "../react/boolean-radio"; -export { SurveyQuestionEmpty } from "../react/reactquestion_empty"; -export { SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase } from "../react/reactquestion_matrixdropdownbase"; -export { SurveyQuestionMatrixDropdown } from "../react/reactquestion_matrixdropdown"; -export { SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton } from "../react/reactquestion_matrixdynamic"; -export { SurveyQuestionPanelDynamic } from "../react/reactquestion_paneldynamic"; -export { SurveyProgress } from "../react/progress"; -export { SurveyProgressButtons } from "../react/progressButtons"; -export { SurveyProgressToc } from "../react/progressToc"; -export { SurveyQuestionRating } from "../react/reactquestion_rating"; -export { SurveyQuestionRatingDropdown } from "../react/rating-dropdown"; -export { SurveyQuestionExpression } from "../react/reactquestion_expression"; -export { PopupSurvey, SurveyWindow } from "../react/react-popup-survey"; -export { ReactQuestionFactory } from "../react/reactquestion_factory"; -export { ReactElementFactory } from "../react/element-factory"; -export { SurveyQuestionImagePicker } from "../react/imagepicker"; -export { SurveyQuestionImage } from "../react/image"; -export { SurveyQuestionSignaturePad } from "../react/signaturepad"; -export { SurveyQuestionButtonGroup } from "../react/reactquestion_buttongroup"; -export { SurveyQuestionCustom, SurveyQuestionComposite } from "../react/reactquestion_custom"; - -export { Popup } from "../react/components/popup/popup"; -export { List } from "../react/components/list/list"; -export { TitleActions } from "../react/components/title/title-actions"; -export { TitleElement } from "../react/components/title/title-element"; -export { SurveyActionBar } from "../react/components/action-bar/action-bar"; -export { LogoImage } from "../react/components/survey-header/logo-image"; -export { SurveyHeader } from "../react/components/survey-header/survey-header"; -export { SvgIcon } from "../react/components/svg-icon/svg-icon"; -export { SurveyQuestionMatrixDynamicRemoveButton } from "../react/components/matrix-actions/remove-button/remove-button"; -export { SurveyQuestionMatrixDetailButton } from "../react/components/matrix-actions/detail-button/detail-button"; -export { SurveyQuestionMatrixDynamicDragDropIcon } from "../react/components/matrix-actions/drag-drop-icon/drag-drop-icon"; -export { SurveyQuestionPanelDynamicAddButton } from "../react/components/paneldynamic-actions/paneldynamic-add-btn"; -export { SurveyQuestionPanelDynamicRemoveButton } from "../react/components/paneldynamic-actions/paneldynamic-remove-btn"; -export { SurveyQuestionPanelDynamicPrevButton } from "../react/components/paneldynamic-actions/paneldynamic-prev-btn"; -export { SurveyQuestionPanelDynamicNextButton } from "../react/components/paneldynamic-actions/paneldynamic-next-btn"; -export { SurveyQuestionPanelDynamicProgressText } from "../react/components/paneldynamic-actions/paneldynamic-progress-text"; -export { SurveyNavigationButton } from "../react/components/survey-actions/survey-nav-button"; -export { QuestionErrorComponent } from "../react/components/question-error"; - -export { MatrixRow } from "../react/components/matrix/row"; -export { Skeleton } from "../react/components/skeleton"; -export { NotifierComponent } from "../react/components/notifier"; -export { ComponentsContainer } from "../react/components/components-container"; -export { CharacterCounterComponent } from "../react/components/character-counter"; -export * from "../react/components/header"; - -export { SurveyLocStringViewer } from "../react/string-viewer"; -export { SurveyLocStringEditor } from "../react/string-editor"; -export { LoadingIndicatorComponent } from "../react/components/loading-indicator"; - -export { SvgBundleComponent } from "../react/svgbundle"; - -//Uncomment to include the "date" question type. -//export {default as SurveyQuestionDate} from "../plugins/react/reactquestiondate"; diff --git a/src/entries/ui.ts b/src/entries/ui.ts index 6a1fbe3c92..736762170e 100644 --- a/src/entries/ui.ts +++ b/src/entries/ui.ts @@ -2,7 +2,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; // import jQuery from "jquery"; -import { Survey, PopupSurvey } from "./ui-model"; +import { Survey, PopupSurvey } from "./react-ui-model"; import { SurveyModel } from "survey-core"; const jQuery = window["jQuery"] || window["$"]; @@ -39,7 +39,7 @@ SurveyModel.platform = "ui"; export const preact: any = React; -export * from "./ui-model"; +export * from "./react-ui-model"; export * from "./core-export"; export { SurveyModel as Model } from "survey-core"; diff --git a/src/react/reactquestion_file.tsx b/src/react/reactquestion_file.tsx index 68f80a85c6..d009ceb883 100644 --- a/src/react/reactquestion_file.tsx +++ b/src/react/reactquestion_file.tsx @@ -7,7 +7,9 @@ import { ReactQuestionFactory } from "./reactquestion_factory"; import { attachKey2click } from "./reactSurvey"; import { LoadingIndicatorComponent } from "./components/loading-indicator"; import { SurveyAction } from "./components/action-bar/action-bar-item"; -import { ReactElementFactory, SurveyFileChooseButton } from "../entries/react-ui-model"; +import { ReactElementFactory } from "./element-factory"; +import { SurveyFileChooseButton } from "./components/file/file-choose-button"; +// import { ReactElementFactory, SurveyFileChooseButton } from "../entries/react-ui-model"; export class SurveyQuestionFile extends SurveyQuestionElementBase { constructor(props: any) { diff --git a/testCafe/dxService/runSurveyOneTime.js b/testCafe/dxService/runSurveyOneTime.js index 9b4ae1e890..a0fd0a1755 100644 --- a/testCafe/dxService/runSurveyOneTime.js +++ b/testCafe/dxService/runSurveyOneTime.js @@ -115,7 +115,7 @@ const initSurvey = ClientFunction(framework => { "sendResultOnPageNext" ).checked; window["ReactDOM"].render( - window["React"].createElement(window["Survey"].Survey, { + window["React"].createElement(window["SurveyReact"].Survey, { model: survey, onComplete: surveyComplete, onSendResult: surveySendResult diff --git a/testCafe/helper.js b/testCafe/helper.js index 56548f3832..9079983cef 100644 --- a/testCafe/helper.js +++ b/testCafe/helper.js @@ -69,7 +69,7 @@ export const initSurvey = ClientFunction( const root = window["ReactDOM"].createRoot(document.getElementById("surveyElement")); window["root"] = root; root.render( - window["React"].createElement(window["Survey"].Survey, { + window["React"].createElement(window["SurveyReact"].Survey, { model: model, onComplete: surveyComplete, }), @@ -132,7 +132,7 @@ export const initSurveyPopup = ClientFunction( const root = window["ReactDOM"].createRoot(document.getElementById("surveyElement")); window["root"] = root; root.render( - window["React"].createElement(window["Survey"].PopupSurvey, { + window["React"].createElement(window["SurveyReact"].PopupSurvey, { model: model, isExpanded: true, allowClose: true, @@ -184,7 +184,7 @@ export const registerCustomToolboxComponent = ClientFunction( } } - window["Survey"].ReactElementFactory.Instance.registerElement( + window["SurveyReact"].ReactElementFactory.Instance.registerElement( "svc-custom-action", (props) => { return window["React"].createElement(CustomActionButton, props); @@ -260,10 +260,10 @@ export const registerCustomItemComponent = ClientFunction( {" "} {" "} - {" "} + >{" "} {" "} {item.title}{" "} @@ -271,7 +271,7 @@ export const registerCustomItemComponent = ClientFunction( /* eslint-enable */ } } - window["Survey"].ReactElementFactory.Instance.registerElement( + window["SurveyReact"].ReactElementFactory.Instance.registerElement( "new-item", (props) => { return window["React"].createElement(ItemTemplateComponent, props); @@ -360,13 +360,13 @@ export const registerCustomItemContentComponent = ClientFunction( }; return (
- - {Survey.SurveyElementBase.renderLocString(locText)} + + {SurveyReact.SurveyElementBase.renderLocString(locText)}
); } } - window["Survey"].ReactElementFactory.Instance.registerElement( + window["SurveyReact"].ReactElementFactory.Instance.registerElement( "new-item-content", (props) => { return window["React"].createElement(ItemContentTemplateComponent, props); diff --git a/testCafe/survey/afterRenderEvent.js b/testCafe/survey/afterRenderEvent.js index 659f85bcf9..5dfecb61c6 100644 --- a/testCafe/survey/afterRenderEvent.js +++ b/testCafe/survey/afterRenderEvent.js @@ -100,7 +100,7 @@ frameworks.forEach((framework) => { window.setSurvey = setSurvey; if(!!survey) { // eslint-disable-next-line react/react-in-jsx-scope, no-undef, react/jsx-no-undef - return ; + return ; } else { return null; } diff --git a/testCafe/survey/customCss.js b/testCafe/survey/customCss.js index 9fa67a05fc..1f690b7381 100644 --- a/testCafe/survey/customCss.js +++ b/testCafe/survey/customCss.js @@ -25,7 +25,7 @@ const initSurvey = ClientFunction((framework, json) => { model.render("surveyElement"); } else if (framework === "react") { window["ReactDOM"].render( - window["React"].createElement(window["Survey"].Survey, { + window["React"].createElement(window["SurveyReact"].Survey, { model: model, css: myCss, }), diff --git a/testCafe/survey/popup.js b/testCafe/survey/popup.js index 1423191cc2..d4e4cee718 100644 --- a/testCafe/survey/popup.js +++ b/testCafe/survey/popup.js @@ -27,7 +27,7 @@ const initPopupSurvey = ClientFunction( } else if (framework === "react") { document.getElementById("surveyElement").innerHTML = ""; window["ReactDOM"].render( - window["React"].createElement(window["Survey"].PopupSurvey, { + window["React"].createElement(window["SurveyReact"].PopupSurvey, { model: model, onComplete: surveyComplete, }), diff --git a/tests/markup/question_knockout_tests.ts b/tests/markup/question_knockout_tests.ts index 9aa9955407..fec9a01754 100644 --- a/tests/markup/question_knockout_tests.ts +++ b/tests/markup/question_knockout_tests.ts @@ -1,5 +1,6 @@ import { testQuestionMarkup } from "./helper"; +// eslint-disable-next-line surveyjs/no-imports-from-entries import { Model as KnockoutModel } from "../../src/entries/knockout"; import { markupTests } from "./etalon"; @@ -8,7 +9,7 @@ var platformDescriptor = { survey: null, surveyFactory: (json) => new KnockoutModel(json), getStrFromHtml: (snapshot) => { - return require("./snapshots/"+snapshot+".snap.html"); + return require("./snapshots/" + snapshot + ".snap.html"); }, render: (survey, element) => survey.render(element.id) }; diff --git a/tests/markup/question_react_tests.ts b/tests/markup/question_react_tests.ts index ffabe45327..ac94f45071 100644 --- a/tests/markup/question_react_tests.ts +++ b/tests/markup/question_react_tests.ts @@ -1,6 +1,7 @@ import { testQuestionMarkup } from "./helper"; import { markupTests } from "./etalon"; +// eslint-disable-next-line surveyjs/no-imports-from-entries import { Model as ReactModel, Survey as SurveyReact } from "../../src/entries/react"; import { act } from "react-dom/test-utils"; import React from "react"; @@ -12,7 +13,7 @@ var platformDescriptor = { surveyFactory: (json) => new ReactModel(json), render: (survey, element) => { var component = React.createElement(SurveyReact, { model: survey }, null); - act(()=>{ + act(() => { ReactDOM.render( component, element @@ -20,7 +21,7 @@ var platformDescriptor = { }); }, getStrFromHtml: (snapshot) => { - return require("./snapshots/"+snapshot+".snap.html"); + return require("./snapshots/" + snapshot + ".snap.html"); }, finish: (element) => { ReactDOM.unmountComponentAtNode(element); diff --git a/tests/markup/question_vue_tests.ts b/tests/markup/question_vue_tests.ts index b2caced920..35f10d8fdb 100644 --- a/tests/markup/question_vue_tests.ts +++ b/tests/markup/question_vue_tests.ts @@ -1,6 +1,7 @@ import { testQuestionMarkup } from "./helper"; import { markupTests } from "./etalon"; +// eslint-disable-next-line surveyjs/no-imports-from-entries import { Model as VueModel, Survey as SurveyVue } from "../../src/entries/vue"; import Vue from "vue/dist/vue.js"; @@ -29,7 +30,7 @@ var platformDescriptor = { export default QUnit.module("Base"); markupTests.forEach(markupTest => { - if(markupTest.excludePlatform === platformDescriptor.name) { + if (markupTest.excludePlatform === platformDescriptor.name) { QUnit.skip(markupTest.name, function (assert) { testQuestionMarkup(assert, markupTest, platformDescriptor); }); diff --git a/tests/stylesManagerTests.ts b/tests/stylesManagerTests.ts index 130bf004e1..f450fc48f1 100644 --- a/tests/stylesManagerTests.ts +++ b/tests/stylesManagerTests.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line surveyjs/no-imports-from-entries import { bootstrapThemeName } from "../src/entries/plugins"; import { StylesManager } from "../src/stylesmanager"; import { Logger } from "../src/utils/utils"; diff --git a/visualRegressionTests/tests/defaultV2/buttongroup.ts b/visualRegressionTests/tests/defaultV2/buttongroup.ts index b780436481..480451c0d3 100644 --- a/visualRegressionTests/tests/defaultV2/buttongroup.ts +++ b/visualRegressionTests/tests/defaultV2/buttongroup.ts @@ -19,8 +19,8 @@ const registerButtongroup = ClientFunction((framework) => { return new Survey.QuestionButtonGroupModel(name); }); if (framework === "react") { - Survey.ReactQuestionFactory.Instance.registerQuestion("buttongroup", props => { - return (window).React.createElement(Survey.SurveyQuestionButtonGroup, props); + (window).SurveyReact.ReactQuestionFactory.Instance.registerQuestion("buttongroup", props => { + return (window).React.createElement((window).SurveyReact.SurveyQuestionButtonGroup, props); }); } if (framework === "jquery-ui") {