0.1.32 • Published 2 years ago
@im-ian/react-survey v0.1.32
Survey Component
2018~2019년에 제작했던 React 설문 모듈입니다. 아카이브 용도로 업로드 되었습니다.
설문 폼을 생성하는 Editor와 생성된 폼을 기반으로 응답을 수집하는 Viewer가 포함되어 있습니다.

Installation
npm install @im-ian/react-survey
# or
yarn add @im-ian/react-surveyHow to use?
import { useState } from 'react';
import { Editor, Viewer, EditorType } from '@im-ian/react-survey';
const View = () => {
const [survey, setSurvey] = useState<EditorType.ISurveyResult>();
return (
<>
<Editor onSubmit={survey => setSurvey(survey)} />
{survey && (
<Viewer
survey={survey}
onSubmit={result => {
console.log(result);
}}
/>
)}
</>
);
};
export default View;@import url(https://cdn.syncfusion.com/ej2/material.css);Feature
Editor
| property | required | value |
|---|---|---|
| submitButtonOptions | N | { text: string; visible: boolean; } |
| defaultValue | N | {}: EditorType.ISurveyResult |
| onChange | N | (result: EditorType.ISurveyResult) => void |
| onSubmit | N | (result: EditorType.ISurveyResult) => void |
Viewer
| property | required | value |
|---|---|---|
| survey | Y | EditorType.ISurveyResult |
| submitButtonOptions | N | { text: string; visible: boolean; } |
| onSubmit | N | (result: EditorType.ISurveyResult) => void |