@patternfly/react-drag-drop 6.2.0-prerelease.9 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/dist/cjs.tsbuildinfo +1 -1
- package/dist/esm/components/DragDrop/DragButton.d.ts +1 -1
- package/dist/esm/components/DragDrop/DragButton.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/DragButton.js +2 -3
- package/dist/esm/components/DragDrop/DragButton.js.map +1 -1
- package/dist/esm/components/DragDrop/DragDropContainer.d.ts +1 -1
- package/dist/esm/components/DragDrop/DragDropContainer.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/DragDropContainer.js +17 -21
- package/dist/esm/components/DragDrop/DragDropContainer.js.map +1 -1
- package/dist/esm/components/DragDrop/DragDropSort.d.ts +2 -2
- package/dist/esm/components/DragDrop/DragDropSort.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/DragDropSort.js +4 -4
- package/dist/esm/components/DragDrop/DragDropSort.js.map +1 -1
- package/dist/esm/components/DragDrop/Draggable.d.ts +1 -1
- package/dist/esm/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Draggable.js +2 -4
- package/dist/esm/components/DragDrop/Draggable.js.map +1 -1
- package/dist/esm/components/DragDrop/DraggableDataListItem.d.ts +1 -1
- package/dist/esm/components/DragDrop/DraggableDataListItem.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/DraggableDataListItem.js +2 -6
- package/dist/esm/components/DragDrop/DraggableDataListItem.js.map +1 -1
- package/dist/esm/components/DragDrop/DraggableDualListSelectorListItem.d.ts +2 -2
- package/dist/esm/components/DragDrop/DraggableDualListSelectorListItem.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/DraggableDualListSelectorListItem.js +12 -16
- package/dist/esm/components/DragDrop/DraggableDualListSelectorListItem.js.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.d.ts +3 -3
- package/dist/esm/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.js +8 -9
- package/dist/esm/components/DragDrop/Droppable.js.map +1 -1
- package/dist/esm.tsbuildinfo +1 -1
- package/dist/js/components/DragDrop/DragButton.d.ts +1 -1
- package/dist/js/components/DragDrop/DragButton.d.ts.map +1 -1
- package/dist/js/components/DragDrop/DragButton.js +2 -3
- package/dist/js/components/DragDrop/DragButton.js.map +1 -1
- package/dist/js/components/DragDrop/DragDropContainer.d.ts +1 -1
- package/dist/js/components/DragDrop/DragDropContainer.d.ts.map +1 -1
- package/dist/js/components/DragDrop/DragDropContainer.js +17 -21
- package/dist/js/components/DragDrop/DragDropContainer.js.map +1 -1
- package/dist/js/components/DragDrop/DragDropSort.d.ts +2 -2
- package/dist/js/components/DragDrop/DragDropSort.d.ts.map +1 -1
- package/dist/js/components/DragDrop/DragDropSort.js +4 -4
- package/dist/js/components/DragDrop/DragDropSort.js.map +1 -1
- package/dist/js/components/DragDrop/Draggable.d.ts +1 -1
- package/dist/js/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Draggable.js +2 -4
- package/dist/js/components/DragDrop/Draggable.js.map +1 -1
- package/dist/js/components/DragDrop/DraggableDataListItem.d.ts +1 -1
- package/dist/js/components/DragDrop/DraggableDataListItem.d.ts.map +1 -1
- package/dist/js/components/DragDrop/DraggableDataListItem.js +2 -6
- package/dist/js/components/DragDrop/DraggableDataListItem.js.map +1 -1
- package/dist/js/components/DragDrop/DraggableDualListSelectorListItem.d.ts +2 -2
- package/dist/js/components/DragDrop/DraggableDualListSelectorListItem.d.ts.map +1 -1
- package/dist/js/components/DragDrop/DraggableDualListSelectorListItem.js +12 -16
- package/dist/js/components/DragDrop/DraggableDualListSelectorListItem.js.map +1 -1
- package/dist/js/components/DragDrop/Droppable.d.ts +3 -3
- package/dist/js/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Droppable.js +8 -9
- package/dist/js/components/DragDrop/Droppable.js.map +1 -1
- package/package.json +8 -8
- package/src/components/DragDrop/DragButton.tsx +0 -1
- package/src/components/DragDrop/DragDropContainer.tsx +9 -9
- package/src/components/DragDrop/DragDropSort.tsx +3 -3
- package/src/components/DragDrop/Draggable.tsx +0 -1
- package/src/components/DragDrop/DraggableDataListItem.tsx +0 -1
- package/src/components/DragDrop/DraggableDualListSelectorListItem.tsx +3 -3
- package/src/components/DragDrop/Droppable.tsx +5 -5
- package/src/components/DragDrop/__tests__/DragDrop.test.tsx +0 -1
- package/src/components/DragDrop/__tests__/__snapshots__/DragDrop.test.tsx.snap +1 -1
- package/src/components/DragDrop/examples/BasicSorting.tsx +2 -2
- package/src/components/DragDrop/examples/DataListDraggable.tsx +2 -2
- package/src/components/DragDrop/examples/DragDrop.md +1 -0
- package/src/components/DragDrop/examples/DragDropContainerBasic.tsx +2 -2
- package/src/components/DragDrop/examples/DragDropContainerDataList.tsx +2 -2
- package/src/components/DragDrop/examples/DragDropContainerDualListSelector.tsx +6 -6
- package/src/components/DragDrop/examples/DragDropDemos.md +1 -0
- package/src/components/DragDrop/examples/DualListSelectorDraggable.tsx +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import {
|
|
@@ -79,17 +79,17 @@ export const DragDropContainer: React.FunctionComponent<DragDropContainerProps>
|
|
|
79
79
|
overlayProps,
|
|
80
80
|
...props
|
|
81
81
|
}: DragDropContainerProps) => {
|
|
82
|
-
const itemsCopy =
|
|
83
|
-
const hasRecentlyMovedContainer =
|
|
84
|
-
const [activeId, setActiveId] =
|
|
85
|
-
const lastOverId =
|
|
82
|
+
const itemsCopy = useRef<Record<string, DraggableObject[]> | null>(null);
|
|
83
|
+
const hasRecentlyMovedContainer = useRef(false);
|
|
84
|
+
const [activeId, setActiveId] = useState<UniqueIdentifier>(null);
|
|
85
|
+
const lastOverId = useRef<UniqueIdentifier | null>(null);
|
|
86
86
|
|
|
87
|
-
const findItem =
|
|
87
|
+
const findItem = useCallback(
|
|
88
88
|
(id: UniqueIdentifier, containerId: UniqueIdentifier) => items[containerId].find((item) => item.id === id),
|
|
89
89
|
[items]
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
-
const findContainer =
|
|
92
|
+
const findContainer = useCallback(
|
|
93
93
|
(id: UniqueIdentifier) => {
|
|
94
94
|
if (id in items) {
|
|
95
95
|
return id;
|
|
@@ -106,7 +106,7 @@ export const DragDropContainer: React.FunctionComponent<DragDropContainerProps>
|
|
|
106
106
|
})
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
const collisionDetectionStrategy: CollisionDetection =
|
|
109
|
+
const collisionDetectionStrategy: CollisionDetection = useCallback(
|
|
110
110
|
(args) => {
|
|
111
111
|
if (activeId && activeId in items) {
|
|
112
112
|
return closestCenter({
|
|
@@ -146,7 +146,7 @@ export const DragDropContainer: React.FunctionComponent<DragDropContainerProps>
|
|
|
146
146
|
[activeId, items]
|
|
147
147
|
);
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
useEffect(() => {
|
|
150
150
|
requestAnimationFrame(() => {
|
|
151
151
|
hasRecentlyMovedContainer.current = false;
|
|
152
152
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
import { DndContextProps, DragEndEvent, DragStartEvent } from '@dnd-kit/core';
|
|
3
3
|
import { Droppable } from './Droppable';
|
|
4
4
|
import { DragDropContainer, DraggableObject } from './DragDropContainer';
|
|
@@ -12,7 +12,7 @@ export type DragDropSortDragStartEvent = DragStartEvent;
|
|
|
12
12
|
export interface DragDropSortProps extends DndContextProps {
|
|
13
13
|
/** Custom defined content wrapper for draggable items. By default, draggable items are wrapped in a styled div.
|
|
14
14
|
* Intended to be a 'DataList' or 'DualListSelectorList' without children. */
|
|
15
|
-
children?: React.ReactElement
|
|
15
|
+
children?: React.ReactElement<any>;
|
|
16
16
|
/** Sorted array of draggable objects */
|
|
17
17
|
items: DraggableObject[];
|
|
18
18
|
/** Callback when user drops a draggable object */
|
|
@@ -38,7 +38,7 @@ export const DragDropSort: React.FunctionComponent<DragDropSortProps> = ({
|
|
|
38
38
|
overlayProps,
|
|
39
39
|
...props
|
|
40
40
|
}: DragDropSortProps) => {
|
|
41
|
-
const itemIds =
|
|
41
|
+
const itemIds = useMemo(() => (items ? Array.from(items, (item) => item.id as string) : []), [items]);
|
|
42
42
|
|
|
43
43
|
const handleDragStart = (event: DragStartEvent) => {
|
|
44
44
|
onDrag(event, itemIds.indexOf(event.active.id as string));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useContext } from 'react';
|
|
2
2
|
import { useSortable } from '@dnd-kit/sortable';
|
|
3
3
|
import { CSS } from '@dnd-kit/utilities';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
@@ -23,7 +23,7 @@ export interface DraggableDualListSelectorListItemProps extends React.HTMLProps<
|
|
|
23
23
|
/** @hide Internal field used to keep track of order of unfiltered options. */
|
|
24
24
|
orderIndex?: number;
|
|
25
25
|
/** @hide Forwarded ref */
|
|
26
|
-
innerRef?: React.RefObject<HTMLLIElement>;
|
|
26
|
+
innerRef?: React.RefObject<HTMLLIElement | null>;
|
|
27
27
|
/** Flag indicating if the dual list selector is in a disabled state */
|
|
28
28
|
isDisabled?: boolean;
|
|
29
29
|
}
|
|
@@ -42,7 +42,7 @@ export const DraggableDualListSelectorListItem: React.FunctionComponent<Draggabl
|
|
|
42
42
|
animateLayoutChanges: () => false
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const { setFocusedOption } =
|
|
45
|
+
const { setFocusedOption } = useContext(DualListSelectorListContext);
|
|
46
46
|
|
|
47
47
|
const style = {
|
|
48
48
|
transform: CSS.Transform.toString(transform),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cloneElement, useMemo } from 'react';
|
|
2
2
|
import { useDroppable } from '@dnd-kit/core';
|
|
3
3
|
import { DraggableObject } from './DragDropContainer';
|
|
4
4
|
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
@@ -14,10 +14,10 @@ interface DroppableProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
14
14
|
/** Array of draggable objects */
|
|
15
15
|
items: DraggableObject[];
|
|
16
16
|
/** Alternative to wrapping drop zone in a div, will override any ref and style set on the element. */
|
|
17
|
-
wrapper?: React.ReactElement
|
|
17
|
+
wrapper?: React.ReactElement<any>;
|
|
18
18
|
/** The variant determines which component wraps the draggable object.
|
|
19
19
|
* Default variant wraps the draggable object in a div.
|
|
20
|
-
* DataList
|
|
20
|
+
* DataList variant wraps the draggable object in a DataListItem
|
|
21
21
|
* DualListSelectorList variant wraps the draggable objects in a DualListSelectorListItem and a div.pf-c-dual-list-selector__item-text element
|
|
22
22
|
* TableComposable variant wraps the draggable objects in TODO
|
|
23
23
|
* */
|
|
@@ -31,7 +31,7 @@ export const Droppable: React.FunctionComponent<DroppableProps> = ({
|
|
|
31
31
|
wrapper,
|
|
32
32
|
...props
|
|
33
33
|
}: DroppableProps) => {
|
|
34
|
-
const itemIds =
|
|
34
|
+
const itemIds = useMemo(() => (items ? Array.from(items, (item) => item.id as string) : []), [items]);
|
|
35
35
|
const { setNodeRef } = useDroppable({ id: id ? id : 'droppable' });
|
|
36
36
|
|
|
37
37
|
const content = items.map((item: DraggableObject) => {
|
|
@@ -60,7 +60,7 @@ export const Droppable: React.FunctionComponent<DroppableProps> = ({
|
|
|
60
60
|
return (
|
|
61
61
|
<SortableContext items={itemIds} strategy={verticalListSortingStrategy} id={id}>
|
|
62
62
|
{wrapper &&
|
|
63
|
-
|
|
63
|
+
cloneElement(wrapper, {
|
|
64
64
|
children: content,
|
|
65
65
|
ref: setNodeRef,
|
|
66
66
|
...props
|
|
@@ -142,7 +142,7 @@ exports[`renders some divs 1`] = `
|
|
|
142
142
|
aria-live="assertive"
|
|
143
143
|
id="DndLiveRegion-0"
|
|
144
144
|
role="status"
|
|
145
|
-
style="position: fixed; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%); white-space: nowrap;"
|
|
145
|
+
style="position: fixed; top: 0px; left: 0px; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%); white-space: nowrap;"
|
|
146
146
|
/>
|
|
147
147
|
</div>
|
|
148
148
|
</DocumentFragment>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import { DragDropSort, DraggableObject } from '@patternfly/react-drag-drop';
|
|
3
3
|
|
|
4
4
|
export const BasicSorting: React.FunctionComponent = () => {
|
|
5
|
-
const [items, setItems] =
|
|
5
|
+
const [items, setItems] = useState<DraggableObject[]>([
|
|
6
6
|
{ id: 'basic-1', content: 'one' },
|
|
7
7
|
{ id: 'basic-2', content: 'two' },
|
|
8
8
|
{ id: 'basic-3', content: 'three' }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import { DataList, DataListCell, DataListCheck, DataListControl, DataListItemCells } from '@patternfly/react-core';
|
|
3
3
|
import { DragDropSort, DraggableObject } from '@patternfly/react-drag-drop';
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ const getItems = (count: number): DraggableObject[] =>
|
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
24
|
export const DataListDraggable: React.FunctionComponent = (props) => {
|
|
25
|
-
const [items, setItems] =
|
|
25
|
+
const [items, setItems] = useState<DraggableObject[]>(getItems(10));
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<DragDropSort
|
|
@@ -8,6 +8,7 @@ hideNavItem: true
|
|
|
8
8
|
|
|
9
9
|
Note: This drag and drop implementation lives in its own package at [@patternfly/react-drag-drop](https://www.npmjs.com/package/@patternfly/react-drag-drop)!
|
|
10
10
|
|
|
11
|
+
import { useState } from 'react';
|
|
11
12
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
12
13
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
13
14
|
import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-right-icon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Droppable as NewDroppable,
|
|
4
4
|
DraggableObject,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@patternfly/react-drag-drop';
|
|
10
10
|
|
|
11
11
|
export const DragDropContainerBasic: React.FunctionComponent = () => {
|
|
12
|
-
const [allItems, setAllItems] =
|
|
12
|
+
const [allItems, setAllItems] = useState<Record<string, DraggableObject[]>>({
|
|
13
13
|
container1: [
|
|
14
14
|
{ id: 'button-1', content: 'one' },
|
|
15
15
|
{ id: 'button-2', content: 'two' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
DataList,
|
|
4
4
|
DataListCell,
|
|
@@ -35,7 +35,7 @@ const getItems = (from: number, count: number): DraggableObject[] =>
|
|
|
35
35
|
}));
|
|
36
36
|
|
|
37
37
|
export const DataListDraggable: React.FunctionComponent = (props) => {
|
|
38
|
-
const [items, setItems] =
|
|
38
|
+
const [items, setItems] = useState<Record<string, DraggableObject[]>>({
|
|
39
39
|
group1: getItems(0, 5),
|
|
40
40
|
group2: getItems(5, 5)
|
|
41
41
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
DualListSelector,
|
|
4
4
|
DualListSelectorPane,
|
|
@@ -14,21 +14,21 @@ import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-d
|
|
|
14
14
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
15
15
|
|
|
16
16
|
export const DragDropContainerDualListSelector: React.FunctionComponent = () => {
|
|
17
|
-
const [ignoreNextOptionSelect, setIgnoreNextOptionSelect] =
|
|
18
|
-
const [availableOptions, setAvailableOptions] =
|
|
17
|
+
const [ignoreNextOptionSelect, setIgnoreNextOptionSelect] = useState(false);
|
|
18
|
+
const [availableOptions, setAvailableOptions] = useState<DraggableObject[]>([
|
|
19
19
|
{ id: 'Apple', content: 'Apple', props: { key: 'Apple', isSelected: false } },
|
|
20
20
|
{ id: 'Banana', content: 'Banana', props: { key: 'Banana', isSelected: false } },
|
|
21
21
|
{ id: 'Pineapple', content: 'Pineapple', props: { key: 'Pineapple', isSelected: false } }
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
|
-
const [chosenOptions, setChosenOptions] =
|
|
24
|
+
const [chosenOptions, setChosenOptions] = useState<DraggableObject[]>([
|
|
25
25
|
{ id: 'Orange', content: 'Orange', props: { key: 'Orange', isSelected: false } },
|
|
26
26
|
{ id: 'Grape', content: 'Grape', props: { key: 'Grape', isSelected: false } },
|
|
27
27
|
{ id: 'Peach', content: 'Peach', props: { key: 'Peach', isSelected: false } },
|
|
28
28
|
{ id: 'Strawberry', content: 'Strawberry', props: { key: 'Strawberry', isSelected: false } }
|
|
29
29
|
]);
|
|
30
30
|
|
|
31
|
-
const [allDraggableItems, setAllItems] =
|
|
31
|
+
const [allDraggableItems, setAllItems] = useState<Record<string, DraggableObject[]>>({
|
|
32
32
|
available: availableOptions.map((option, index) => ({
|
|
33
33
|
...option,
|
|
34
34
|
props: {
|
|
@@ -53,7 +53,7 @@ export const DragDropContainerDualListSelector: React.FunctionComponent = () =>
|
|
|
53
53
|
setAllItems(items);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
useEffect(() => {
|
|
57
57
|
setAllItems({
|
|
58
58
|
available: availableOptions.map((option, index) => ({
|
|
59
59
|
...option,
|
|
@@ -7,6 +7,7 @@ propComponents: ['DragDropSort', 'DraggableObject']
|
|
|
7
7
|
|
|
8
8
|
Note: This drag and drop implementation lives in its own package at [@patternfly/react-drag-drop](https://www.npmjs.com/package/@patternfly/react-drag-drop)!
|
|
9
9
|
|
|
10
|
+
import { useEffect, useState } from 'react';
|
|
10
11
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
11
12
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
12
13
|
import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-right-icon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
DualListSelector,
|
|
4
4
|
DualListSelectorPane,
|
|
@@ -15,14 +15,14 @@ import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-d
|
|
|
15
15
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
16
16
|
|
|
17
17
|
export const ComposableDualListSelector: React.FunctionComponent = () => {
|
|
18
|
-
const [ignoreNextOptionSelect, setIgnoreNextOptionSelect] =
|
|
19
|
-
const [availableOptions, setAvailableOptions] =
|
|
18
|
+
const [ignoreNextOptionSelect, setIgnoreNextOptionSelect] = useState(false);
|
|
19
|
+
const [availableOptions, setAvailableOptions] = useState<DraggableObject[]>([
|
|
20
20
|
{ id: 'Apple', content: 'Apple', props: { key: 'Apple', isSelected: false } },
|
|
21
21
|
{ id: 'Banana', content: 'Banana', props: { key: 'Banana', isSelected: false } },
|
|
22
22
|
{ id: 'Pineapple', content: 'Pineapple', props: { key: 'Pineapple', isSelected: false } }
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
const [chosenOptions, setChosenOptions] =
|
|
25
|
+
const [chosenOptions, setChosenOptions] = useState<DraggableObject[]>([
|
|
26
26
|
{ id: 'Orange', content: 'Orange', props: { key: 'Orange', isSelected: false } },
|
|
27
27
|
{ id: 'Grape', content: 'Grape', props: { key: 'Grape', isSelected: false } },
|
|
28
28
|
{ id: 'Peach', content: 'Peach', props: { key: 'Peach', isSelected: false } },
|