4.0.1 • Published 2 years ago

@eafmm/react v4.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Form Minimap React

React components and hooks for Form Minimap. Please consult that documentation for further information on the concepts mentioned below.

Demo Appplication


Getting Started

Installation

npm install --save @fmm/react

Adding Form Minimap

The code sample below shows the lines added to a simple form to add a minimap (M) or a minimap with panel (P)

M P         import React from 'react';
M           import { FmmReactMinimapTag } from '@eafmm/react';
  P         import { FmmReactMinimapTag, FmmReactPanelTag } from '@eafmm/react';

            function App() {
M P             var anchorRef = React.useRef();
  P             var panelRef = React.useRef();
M               var css = '.fmm-frame { height: 50px; }';
  P             var css = '.fmm-frame { height: 50px; } .fmm-panel { height: 0; }';
                return (
                    <div className="App">
M P                     <style>{css}</style>
M P                     <div ref={anchorRef} style={{width:'20px', height:'20px', marginLeft:'200px'}}></div>
  P                     <FmmReactPanelTag ref={panelRef}/>
                        <form>
M                           <FmmReactMinimapTag anchorRef={anchorRef} title='Title'/>
  P                         <FmmReactMinimapTag anchorRef={anchorRef} panelRef={panelRef} title='Title'/>
                            <input id="Input1"/><br/>
                            <input id="Input2"/><br/>
                            <input id="Input3"/><br/>
                            <input id="Input4"/>
                        </form>
                    </div>
                );
            }

            export default App;

API

FmmReactMinimap

Adapter for FmmMinimap returned from FmmReactMinimapTag or useFmmReactMinimap.

| Method | --- | destructor | takeSnapshot


FmmReactMinimapTag

Component to create and manage a FmmReactMinimap. The minimap is detached when this component is destroyed. For minimaps in a panel, use the panelRef property; otherwise use the anchorRef for a popup minimap.

PropertyTypeRequired
aggregateLabelsFmmMapString
anchorRefReact.RefObject\<HTMLElement>
customElementIdsstring[]
debounceMsecnumber
dynamicLabelsstring[]
frameworkFmmFramework
onUpdateFmmOnUpdate
ordinalnumber
pageRefReact.RefObject\<HTMLElement>
panelRefReact.RefObject\<FmmReactPanel>
storeRefReact.RefObject\[FmmStore](https://www.npmjs.com/package/@eafmm/core#fmmstore)\
titlestring
usePanelDetailboolean
useWidthToScaleboolean
verbositynumber
zoomFactornumber

useFmmReactMinimap

Hook version of FmmReactMinimapTag that returns a FmmReactMinimap.

ParameterTypeRequiredDescription
keystringMinimap is recreated when key changes. Any previous minimap is detached.
formReact.RefObject\<HTMLFormElement>
pFmmReactMinimapPropsObject with properties of FmmReactMinimapTag.

FmmReactPanel

Adapter for FmmPanel returned from FmmReactPanelTag or useFmmReactPanel.

| Method | --- | destroyDetached


FmmReactPanelTag

Component to create and manage a FmmReactPanel.

PropertyTypeRequired
detailParentRefReact.RefObject\<HTMLDivElement>
minimapsCountnumber
verticalboolean

useFmmReactPanel

Hook version of FmmReactPanelTag that returns a FmmReactPanel.

ParameterTypeRequired
hostRefstring
minimapsCountnumber
detailParentRefReact.RefObject\<HTMLDivElement>
verticalboolean

FmmReactStoreTag

Component to create and manage a FmmStore.

PropertyTypeRequired
errorsFmmMapErrors
valuesFmmMapValues

useFmmReactStore

Hook version of FmmReactStoreTag that returns a FmmStore.

ParameterTypeRequired
valuesFmmMapValues
errorsFmmMapErrors
4.0.1

2 years ago

3.0.1

3 years ago

4.0.0

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago