0.0.2 • Published 1 year ago

khunjeong-survey v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Survey Component

React 설문 모듈입니다.

설문 내용을 생성하는 Editor와 생성된 내용을 기반으로 동작하여 내용을 채워주는 Viewer가 포함되어 있습니다.

service_capture

Installation

npm install khunjeong-survey

# or

yarn add khunjeong-survey

How to use?

import { useState } from 'react';
import { Editor, Viewer, EditorType } from 'khunjeong-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

propertyrequiredvalue
submitButtonOptionsN{ text: string; visible: boolean; }
defaultValueN{}: EditorType.ISurveyResult
onChangeN(result: EditorType.ISurveyResult) => void
onSubmitN(result: EditorType.ISurveyResult) => void

Viewer

propertyrequiredvalue
surveyYEditorType.ISurveyResult
submitButtonOptionsN{ text: string; visible: boolean; }
onSubmitN(result: EditorType.ISurveyResult) => void