2.0.1 • Published 2 years ago
jsonkeymapping v2.0.1
jsonkeymapping
to map new key to json
Install
npm install --save jsonkeymapping
Usage
import {JsonCustomHeader, MapFieldsForm} from 'jsonkeymapping'
const App = () => {
const jsonRef = useRef(null)
const mappedFieldRef = useRef(null)
const handleClick = () => {
jsonRef.current.openModal(
jsonData, //Array of objects -> mandatory
comboValues, //combo values for mapping field -> Array -> Mandatory -> sample [{code: 'id', name: 'id'}]
mappData, //for showing already added mapping form data
)
}
return (
<>
<button onClick={handleClick}>Open</button>
<JsonCustomHeader ref={jsonRef} />
<MapFieldsForm
ref={mappedFieldRef}
comboValues={comboValues} //combo data for fields => sample [{code: 'id', name: 'id'}]
fields={mappData} //for showing already added mapping form data
viewOnly={true} //diable editing
/>
</>
)
}
License
MIT © ajmalpsa