You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Alertseverity="warning">This component is work-in-progress and in preview. API is unstable.</Alert>
14
+
15
+
<br />
16
+
17
+
`@data-driven-forms/editor-core` is a set of components and utilities allowing to build a custom Data Driven Forms Drag And Drop editor based on [Data Driven Forms Drag And Drop](/editor/dnd) library.
A component for selecting new components and dragging them into the form container.
58
+
59
+
### prepareCondition
60
+
61
+
A function preparing DnD `condition` to DDF `condition`. Checks and removes all unfinished configuration.
62
+
63
+
### prepareValidate
64
+
65
+
A function preparing DnD `validate` to DDF `validate`. Checks and removes all unfinished configuration, esnures that only valid validators are passed to components..
66
+
67
+
### Properties
68
+
69
+
A properties editor for selected components.
70
+
71
+
### reducer
72
+
73
+
Extended DnD Reducer with additional functionality.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/editor/dnd.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,4 +16,70 @@ import Alert from '@mui/material/Alert';
16
16
17
17
`@data-driven-forms/dnd` is a library providing drag and drop functionality for React components. This custom light-weight library currently supports mouse and touch input, is highly customisable and supports deep nesting of container elements.
18
18
19
+
## Installation
20
+
21
+
```bash
22
+
npm install --save @data-driven-forms/dnd
23
+
```
24
+
or
25
+
```bash
26
+
yarn add @data-driven-forms/dnd
27
+
```
28
+
29
+
### API
30
+
31
+
### dispatchContext
32
+
33
+
An utility to create an context for `dispatch` function.
34
+
35
+
### DropCursor
36
+
37
+
A component handling moving cursor and selecting the correct place to move dragged element.
38
+
39
+
### findTargetElement
40
+
41
+
An utility function to go over all elements' positions stored in state and selecting the correct place.
42
+
43
+
### pauseEvent
44
+
45
+
An utility to stop an event from propagation and default action.
46
+
47
+
### Provider
48
+
49
+
A wrapper providing all neccessary components.
50
+
51
+
### reducer
52
+
53
+
A reducer providing the basic drag and drop functionality.
54
+
55
+
### stateContext
56
+
57
+
An utility to create an context for a drag and drop `state`.
58
+
59
+
### useComponent
60
+
61
+
*({ id: any }) => { ref, component }*
62
+
63
+
A hook to connect a component to DnD state. Requires an id of the component. Returns a `ref` and the `component` object from the state.
A hook to connect a container to DnD state. Requires an id of the container or a root in case the container is the root container. Returns a `ref`, `id` and the `container` object from the state.
70
+
71
+
### useDispatch
72
+
73
+
An utility to obtain a dispatch function for the DnD reducer.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/editor/pro-editor.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,5 +14,32 @@ import Alert from '@mui/material/Alert';
14
14
15
15
<br />
16
16
17
-
`@data-driven-forms/editor-pro` is a component
17
+
`@data-driven-forms/editor-pro` is a prebuilt Drag And Drop editor supporting custom provided mappers. The UI is built on Evergreen UI Framework. Check the [live example](/editor/live-editor).
0 commit comments