@proyecto-viviana/solid-stately 0.2.4 → 0.3.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/LICENSE +21 -0
- package/README.md +30 -283
- package/dist/autocomplete/createAutocompleteState.d.ts +3 -2
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/calendar/createCalendarState.d.ts +22 -7
- package/dist/calendar/createDateFieldState.d.ts +30 -7
- package/dist/calendar/createDatePickerState.d.ts +60 -0
- package/dist/calendar/createRangeCalendarState.d.ts +27 -8
- package/dist/calendar/createTimeFieldState.d.ts +34 -7
- package/dist/calendar/index.d.ts +7 -6
- package/dist/checkbox/createCheckboxGroupState.d.ts +12 -3
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/collections/ListCollection.d.ts +1 -1
- package/dist/collections/createListState.d.ts +8 -8
- package/dist/collections/createMenuState.d.ts +7 -7
- package/dist/collections/createSelectionState.d.ts +5 -5
- package/dist/collections/index.d.ts +5 -5
- package/dist/collections/types.d.ts +23 -12
- package/dist/color/Color.d.ts +1 -1
- package/dist/color/createColorAreaState.d.ts +4 -2
- package/dist/color/createColorFieldState.d.ts +38 -12
- package/dist/color/createColorSliderState.d.ts +9 -2
- package/dist/color/createColorWheelState.d.ts +13 -2
- package/dist/color/getColorChannels.d.ts +20 -0
- package/dist/color/index.d.ts +6 -6
- package/dist/color/types.d.ts +4 -4
- package/dist/combobox/createComboBoxState.d.ts +27 -13
- package/dist/combobox/index.d.ts +1 -1
- package/dist/data/createAsyncList.d.ts +111 -0
- package/dist/data/createListData.d.ts +65 -0
- package/dist/data/createTreeData.d.ts +65 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/datepicker/index.d.ts +8 -0
- package/dist/disclosure/createDisclosureState.d.ts +2 -2
- package/dist/disclosure/index.d.ts +1 -1
- package/dist/dnd/createDragState.d.ts +2 -2
- package/dist/dnd/createDraggableCollectionState.d.ts +2 -2
- package/dist/dnd/createDropState.d.ts +2 -2
- package/dist/dnd/createDroppableCollectionState.d.ts +3 -3
- package/dist/dnd/index.d.ts +5 -5
- package/dist/dnd/types.d.ts +16 -16
- package/dist/form/createFormValidationState.d.ts +3 -3
- package/dist/form/index.d.ts +1 -1
- package/dist/grid/createGridState.d.ts +2 -2
- package/dist/grid/index.d.ts +2 -2
- package/dist/grid/types.d.ts +17 -11
- package/dist/index.d.ts +31 -25
- package/dist/index.js +7990 -6264
- package/dist/index.js.map +1 -7
- package/dist/menu/index.d.ts +8 -0
- package/dist/numberfield/createNumberFieldState.d.ts +2 -2
- package/dist/numberfield/index.d.ts +1 -1
- package/dist/overlays/createOverlayTriggerState.d.ts +2 -2
- package/dist/overlays/index.d.ts +1 -1
- package/dist/radio/createRadioGroupState.d.ts +13 -4
- package/dist/radio/index.d.ts +1 -1
- package/dist/searchfield/createSearchFieldState.d.ts +2 -2
- package/dist/searchfield/index.d.ts +2 -2
- package/dist/select/createSelectState.d.ts +20 -3
- package/dist/select/index.d.ts +1 -1
- package/dist/selection/index.d.ts +11 -0
- package/dist/slider/createSliderState.d.ts +3 -3
- package/dist/slider/index.d.ts +2 -2
- package/dist/steplist/createStepListState.d.ts +48 -0
- package/dist/steplist/index.d.ts +1 -0
- package/dist/table/TableCollection.d.ts +3 -3
- package/dist/table/createTableColumnResizeState.d.ts +54 -0
- package/dist/table/createTableState.d.ts +2 -2
- package/dist/table/index.d.ts +5 -3
- package/dist/table/types.d.ts +10 -10
- package/dist/tabs/createTabListState.d.ts +5 -5
- package/dist/tabs/index.d.ts +1 -1
- package/dist/textfield/createTextFieldState.d.ts +2 -2
- package/dist/textfield/index.d.ts +1 -1
- package/dist/toast/createToastState.d.ts +15 -3
- package/dist/toast/index.d.ts +1 -1
- package/dist/toggle/createToggleGroupState.d.ts +45 -0
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/index.d.ts +2 -1
- package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tree/TreeCollection.d.ts +5 -4
- package/dist/tree/createTreeState.d.ts +2 -2
- package/dist/tree/index.d.ts +3 -3
- package/dist/tree/types.d.ts +19 -13
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/reactivity.d.ts +1 -1
- package/package.json +30 -30
- package/src/autocomplete/createAutocompleteState.d.ts +19 -17
- package/src/autocomplete/createAutocompleteState.ts +25 -32
- package/src/autocomplete/index.d.ts +6 -2
- package/src/autocomplete/index.ts +1 -1
- package/src/calendar/createCalendarState.d.ts +139 -117
- package/src/calendar/createCalendarState.ts +221 -74
- package/src/calendar/createDateFieldState.d.ts +130 -95
- package/src/calendar/createDateFieldState.ts +286 -151
- package/src/calendar/createDatePickerState.ts +347 -0
- package/src/calendar/createRangeCalendarState.d.ts +154 -129
- package/src/calendar/createRangeCalendarState.ts +293 -79
- package/src/calendar/createTimeFieldState.d.ts +81 -79
- package/src/calendar/createTimeFieldState.ts +187 -108
- package/src/calendar/index.d.ts +80 -7
- package/src/calendar/index.ts +21 -12
- package/src/checkbox/createCheckboxGroupState.d.ts +57 -55
- package/src/checkbox/createCheckboxGroupState.ts +57 -30
- package/src/checkbox/index.d.ts +6 -2
- package/src/checkbox/index.ts +1 -1
- package/src/collections/ListCollection.d.ts +25 -22
- package/src/collections/ListCollection.ts +152 -146
- package/src/collections/createListState.d.ts +73 -58
- package/src/collections/createListState.ts +267 -264
- package/src/collections/createMenuState.d.ts +36 -31
- package/src/collections/createMenuState.ts +112 -106
- package/src/collections/createSelectionState.d.ts +78 -65
- package/src/collections/createSelectionState.ts +340 -336
- package/src/collections/index.d.ts +38 -6
- package/src/collections/index.ts +41 -46
- package/src/collections/types.d.ts +101 -101
- package/src/collections/types.ts +181 -169
- package/src/color/Color.d.ts +20 -5
- package/src/color/Color.ts +1054 -951
- package/src/color/createColorAreaState.d.ts +67 -65
- package/src/color/createColorAreaState.ts +301 -293
- package/src/color/createColorFieldState.d.ts +46 -44
- package/src/color/createColorFieldState.ts +428 -292
- package/src/color/createColorSliderState.d.ts +58 -56
- package/src/color/createColorSliderState.ts +272 -241
- package/src/color/createColorWheelState.d.ts +42 -40
- package/src/color/createColorWheelState.ts +248 -211
- package/src/color/getColorChannels.ts +36 -0
- package/src/color/index.d.ts +36 -7
- package/src/color/index.ts +44 -47
- package/src/color/types.d.ts +68 -63
- package/src/color/types.ts +119 -127
- package/src/combobox/createComboBoxState.d.ts +107 -105
- package/src/combobox/createComboBoxState.ts +790 -703
- package/src/combobox/index.d.ts +10 -2
- package/src/combobox/index.ts +13 -13
- package/src/data/createAsyncList.ts +403 -0
- package/src/data/createListData.ts +298 -0
- package/src/data/createTreeData.ts +646 -0
- package/src/data/index.ts +25 -0
- package/src/datepicker/index.ts +32 -0
- package/src/disclosure/createDisclosureState.d.ts +47 -43
- package/src/disclosure/createDisclosureState.ts +9 -23
- package/src/disclosure/index.d.ts +10 -2
- package/src/disclosure/index.ts +1 -1
- package/src/dnd/createDragState.d.ts +51 -42
- package/src/dnd/createDragState.ts +151 -153
- package/src/dnd/createDraggableCollectionState.d.ts +52 -41
- package/src/dnd/createDraggableCollectionState.ts +158 -165
- package/src/dnd/createDropState.d.ts +64 -45
- package/src/dnd/createDropState.ts +202 -212
- package/src/dnd/createDroppableCollectionState.d.ts +88 -59
- package/src/dnd/createDroppableCollectionState.ts +354 -357
- package/src/dnd/index.d.ts +54 -6
- package/src/dnd/index.ts +63 -76
- package/src/dnd/types.d.ts +167 -156
- package/src/dnd/types.ts +316 -317
- package/src/form/createFormValidationState.d.ts +47 -45
- package/src/form/createFormValidationState.ts +356 -389
- package/src/form/index.d.ts +16 -2
- package/src/form/index.ts +15 -15
- package/src/grid/createGridState.d.ts +7 -4
- package/src/grid/createGridState.ts +44 -51
- package/src/grid/index.d.ts +3 -3
- package/src/grid/index.ts +2 -8
- package/src/grid/types.d.ts +136 -129
- package/src/grid/types.ts +24 -17
- package/src/index.d.ts +310 -26
- package/src/index.ts +87 -79
- package/src/menu/index.ts +17 -0
- package/src/numberfield/createNumberFieldState.d.ts +56 -54
- package/src/numberfield/createNumberFieldState.ts +422 -383
- package/src/numberfield/index.d.ts +6 -2
- package/src/numberfield/index.ts +5 -5
- package/src/overlays/createOverlayTriggerState.d.ts +22 -20
- package/src/overlays/createOverlayTriggerState.ts +66 -67
- package/src/overlays/index.d.ts +6 -2
- package/src/overlays/index.ts +5 -5
- package/src/radio/createRadioGroupState.d.ts +54 -52
- package/src/radio/createRadioGroupState.ts +66 -30
- package/src/radio/index.d.ts +7 -2
- package/src/radio/index.ts +1 -1
- package/src/searchfield/createSearchFieldState.d.ts +16 -14
- package/src/searchfield/createSearchFieldState.ts +56 -62
- package/src/searchfield/index.d.ts +3 -3
- package/src/searchfield/index.ts +2 -5
- package/src/select/createSelectState.d.ts +63 -61
- package/src/select/createSelectState.ts +290 -181
- package/src/select/index.d.ts +2 -2
- package/src/select/index.ts +1 -5
- package/src/selection/index.ts +27 -0
- package/src/slider/createSliderState.d.ts +60 -60
- package/src/slider/createSliderState.ts +233 -211
- package/src/slider/index.d.ts +3 -3
- package/src/slider/index.ts +2 -6
- package/src/ssr/index.d.ts +1 -1
- package/src/ssr/index.ts +2 -2
- package/src/steplist/createStepListState.ts +191 -0
- package/src/steplist/index.ts +5 -0
- package/src/table/TableCollection.d.ts +42 -40
- package/src/table/TableCollection.ts +61 -64
- package/src/table/createTableColumnResizeState.ts +242 -0
- package/src/table/createTableState.d.ts +7 -4
- package/src/table/createTableState.ts +10 -7
- package/src/table/index.d.ts +14 -4
- package/src/table/index.ts +10 -3
- package/src/table/types.d.ts +98 -92
- package/src/table/types.ts +17 -13
- package/src/tabs/createTabListState.d.ts +59 -57
- package/src/tabs/createTabListState.ts +58 -39
- package/src/tabs/index.d.ts +8 -2
- package/src/tabs/index.ts +1 -1
- package/src/textfield/createTextFieldState.d.ts +16 -14
- package/src/textfield/createTextFieldState.ts +7 -18
- package/src/textfield/index.d.ts +6 -2
- package/src/textfield/index.ts +1 -1
- package/src/toast/createToastState.d.ts +92 -81
- package/src/toast/createToastState.ts +56 -44
- package/src/toast/index.d.ts +12 -2
- package/src/toast/index.ts +1 -1
- package/src/toggle/createToggleGroupState.ts +117 -0
- package/src/toggle/createToggleState.d.ts +19 -19
- package/src/toggle/createToggleState.ts +2 -16
- package/src/toggle/index.d.ts +2 -2
- package/src/toggle/index.ts +6 -4
- package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
- package/src/tooltip/createTooltipTriggerState.ts +184 -183
- package/src/tooltip/index.d.ts +7 -2
- package/src/tooltip/index.ts +6 -6
- package/src/tree/TreeCollection.d.ts +26 -23
- package/src/tree/TreeCollection.ts +215 -175
- package/src/tree/createTreeState.d.ts +7 -4
- package/src/tree/createTreeState.ts +390 -392
- package/src/tree/index.d.ts +10 -4
- package/src/tree/index.ts +13 -13
- package/src/tree/types.d.ts +131 -126
- package/src/tree/types.ts +183 -174
- package/src/utils/index.d.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/reactivity.d.ts +2 -2
- package/src/utils/reactivity.ts +3 -3
package/src/dnd/index.d.ts
CHANGED
|
@@ -3,9 +3,57 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exports for DnD functionality.
|
|
5
5
|
*/
|
|
6
|
-
export type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export type {
|
|
7
|
+
DropOperation,
|
|
8
|
+
DragItem,
|
|
9
|
+
DragDropEvent,
|
|
10
|
+
DragStartEvent,
|
|
11
|
+
DragMoveEvent,
|
|
12
|
+
DragEndEvent,
|
|
13
|
+
DropEnterEvent,
|
|
14
|
+
DropMoveEvent,
|
|
15
|
+
DropActivateEvent,
|
|
16
|
+
DropExitEvent,
|
|
17
|
+
TextDropItem,
|
|
18
|
+
FileDropItem,
|
|
19
|
+
DirectoryDropItem,
|
|
20
|
+
DropItem,
|
|
21
|
+
DropEvent,
|
|
22
|
+
DropPosition,
|
|
23
|
+
RootDropTarget,
|
|
24
|
+
ItemDropTarget,
|
|
25
|
+
DropTarget,
|
|
26
|
+
DroppableCollectionEnterEvent,
|
|
27
|
+
DroppableCollectionMoveEvent,
|
|
28
|
+
DroppableCollectionActivateEvent,
|
|
29
|
+
DroppableCollectionExitEvent,
|
|
30
|
+
DroppableCollectionDropEvent,
|
|
31
|
+
DroppableCollectionInsertDropEvent,
|
|
32
|
+
DroppableCollectionRootDropEvent,
|
|
33
|
+
DroppableCollectionOnItemDropEvent,
|
|
34
|
+
DroppableCollectionReorderEvent,
|
|
35
|
+
DragTypes,
|
|
36
|
+
DropTargetDelegate,
|
|
37
|
+
DraggableCollectionStartEvent,
|
|
38
|
+
DraggableCollectionMoveEvent,
|
|
39
|
+
DraggableCollectionEndEvent,
|
|
40
|
+
DragPreviewRenderer,
|
|
41
|
+
DroppableCollectionUtilityOptions,
|
|
42
|
+
DroppableCollectionBaseProps,
|
|
43
|
+
DroppableCollectionProps,
|
|
44
|
+
DraggableCollectionProps,
|
|
45
|
+
} from "./types";
|
|
46
|
+
export { createDragState, type DragStateOptions, type DragState } from "./createDragState";
|
|
47
|
+
export { createDropState, type DropStateOptions, type DropState } from "./createDropState";
|
|
48
|
+
export {
|
|
49
|
+
createDraggableCollectionState,
|
|
50
|
+
type DraggableCollectionStateOptions,
|
|
51
|
+
type DraggableCollectionState,
|
|
52
|
+
} from "./createDraggableCollectionState";
|
|
53
|
+
export {
|
|
54
|
+
createDroppableCollectionState,
|
|
55
|
+
DIRECTORY_DRAG_TYPE,
|
|
56
|
+
type DroppableCollectionStateOptions,
|
|
57
|
+
type DroppableCollectionState,
|
|
58
|
+
} from "./createDroppableCollectionState";
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
package/src/dnd/index.ts
CHANGED
|
@@ -1,76 +1,63 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drag and Drop state management for solid-stately.
|
|
3
|
-
*
|
|
4
|
-
* Exports for DnD functionality.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
createDraggableCollectionState,
|
|
66
|
-
type DraggableCollectionStateOptions,
|
|
67
|
-
type DraggableCollectionState,
|
|
68
|
-
} from './createDraggableCollectionState';
|
|
69
|
-
|
|
70
|
-
// Droppable collection state
|
|
71
|
-
export {
|
|
72
|
-
createDroppableCollectionState,
|
|
73
|
-
DIRECTORY_DRAG_TYPE,
|
|
74
|
-
type DroppableCollectionStateOptions,
|
|
75
|
-
type DroppableCollectionState,
|
|
76
|
-
} from './createDroppableCollectionState';
|
|
1
|
+
/**
|
|
2
|
+
* Drag and Drop state management for solid-stately.
|
|
3
|
+
*
|
|
4
|
+
* Exports for DnD functionality.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
DropOperation,
|
|
9
|
+
DragItem,
|
|
10
|
+
DragDropEvent,
|
|
11
|
+
DragStartEvent,
|
|
12
|
+
DragMoveEvent,
|
|
13
|
+
DragEndEvent,
|
|
14
|
+
DropEnterEvent,
|
|
15
|
+
DropMoveEvent,
|
|
16
|
+
DropActivateEvent,
|
|
17
|
+
DropExitEvent,
|
|
18
|
+
TextDropItem,
|
|
19
|
+
FileDropItem,
|
|
20
|
+
DirectoryDropItem,
|
|
21
|
+
DropItem,
|
|
22
|
+
DropEvent,
|
|
23
|
+
DropPosition,
|
|
24
|
+
RootDropTarget,
|
|
25
|
+
ItemDropTarget,
|
|
26
|
+
DropTarget,
|
|
27
|
+
DroppableCollectionEnterEvent,
|
|
28
|
+
DroppableCollectionMoveEvent,
|
|
29
|
+
DroppableCollectionActivateEvent,
|
|
30
|
+
DroppableCollectionExitEvent,
|
|
31
|
+
DroppableCollectionDropEvent,
|
|
32
|
+
DroppableCollectionInsertDropEvent,
|
|
33
|
+
DroppableCollectionRootDropEvent,
|
|
34
|
+
DroppableCollectionOnItemDropEvent,
|
|
35
|
+
DroppableCollectionReorderEvent,
|
|
36
|
+
DragTypes,
|
|
37
|
+
DropTargetDelegate,
|
|
38
|
+
DraggableCollectionStartEvent,
|
|
39
|
+
DraggableCollectionMoveEvent,
|
|
40
|
+
DraggableCollectionEndEvent,
|
|
41
|
+
DragPreviewRenderer,
|
|
42
|
+
DroppableCollectionUtilityOptions,
|
|
43
|
+
DroppableCollectionBaseProps,
|
|
44
|
+
DroppableCollectionProps,
|
|
45
|
+
DraggableCollectionProps,
|
|
46
|
+
} from "./types";
|
|
47
|
+
|
|
48
|
+
export { createDragState, type DragStateOptions, type DragState } from "./createDragState";
|
|
49
|
+
|
|
50
|
+
export { createDropState, type DropStateOptions, type DropState } from "./createDropState";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
createDraggableCollectionState,
|
|
54
|
+
type DraggableCollectionStateOptions,
|
|
55
|
+
type DraggableCollectionState,
|
|
56
|
+
} from "./createDraggableCollectionState";
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
createDroppableCollectionState,
|
|
60
|
+
DIRECTORY_DRAG_TYPE,
|
|
61
|
+
type DroppableCollectionStateOptions,
|
|
62
|
+
type DroppableCollectionState,
|
|
63
|
+
} from "./createDroppableCollectionState";
|
package/src/dnd/types.d.ts
CHANGED
|
@@ -4,261 +4,272 @@
|
|
|
4
4
|
* Core types for drag and drop operations, matching React Aria's DnD API.
|
|
5
5
|
*/
|
|
6
6
|
/** The type of drop operation to perform. */
|
|
7
|
-
export type DropOperation =
|
|
7
|
+
export type DropOperation = "copy" | "link" | "move" | "cancel";
|
|
8
8
|
/** Drag item data as key-value pairs where keys are MIME types or custom types. */
|
|
9
9
|
export interface DragItem {
|
|
10
|
-
|
|
10
|
+
[type: string]: string;
|
|
11
11
|
}
|
|
12
12
|
/** Base event for drag/drop operations with coordinates. */
|
|
13
13
|
export interface DragDropEvent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
/** The x coordinate of the event, relative to the target element. */
|
|
15
|
+
x: number;
|
|
16
|
+
/** The y coordinate of the event, relative to the target element. */
|
|
17
|
+
y: number;
|
|
18
18
|
}
|
|
19
19
|
/** Event fired when a drag operation starts. */
|
|
20
20
|
export interface DragStartEvent extends DragDropEvent {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** The event type. */
|
|
22
|
+
type: "dragstart";
|
|
23
23
|
}
|
|
24
24
|
/** Event fired as a drag moves. */
|
|
25
25
|
export interface DragMoveEvent extends DragDropEvent {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/** The event type. */
|
|
27
|
+
type: "dragmove";
|
|
28
28
|
}
|
|
29
29
|
/** Event fired when a drag operation ends. */
|
|
30
30
|
export interface DragEndEvent extends DragDropEvent {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/** The event type. */
|
|
32
|
+
type: "dragend";
|
|
33
|
+
/** The drop operation that occurred. */
|
|
34
|
+
dropOperation: DropOperation;
|
|
35
35
|
}
|
|
36
36
|
/** Event fired when a drag enters a drop target. */
|
|
37
37
|
export interface DropEnterEvent extends DragDropEvent {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
/** The event type. */
|
|
39
|
+
type: "dropenter";
|
|
40
40
|
}
|
|
41
41
|
/** Event fired as a drag moves within a drop target. */
|
|
42
42
|
export interface DropMoveEvent extends DragDropEvent {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
/** The event type. */
|
|
44
|
+
type: "dropmove";
|
|
45
45
|
}
|
|
46
46
|
/** Event fired when a drag is held over a drop target. */
|
|
47
47
|
export interface DropActivateEvent extends DragDropEvent {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
/** The event type. */
|
|
49
|
+
type: "dropactivate";
|
|
50
50
|
}
|
|
51
51
|
/** Event fired when a drag exits a drop target. */
|
|
52
52
|
export interface DropExitEvent extends DragDropEvent {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
/** The event type. */
|
|
54
|
+
type: "dropexit";
|
|
55
55
|
}
|
|
56
56
|
/** A text item in a drop operation. */
|
|
57
57
|
export interface TextDropItem {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
/** The item kind. */
|
|
59
|
+
kind: "text";
|
|
60
|
+
/** The drag types available for this item. */
|
|
61
|
+
types: Set<string>;
|
|
62
|
+
/** Returns the data for the given type as a string. */
|
|
63
|
+
getText(type: string): Promise<string>;
|
|
64
64
|
}
|
|
65
65
|
/** A file item in a drop operation. */
|
|
66
66
|
export interface FileDropItem {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
/** The item kind. */
|
|
68
|
+
kind: "file";
|
|
69
|
+
/** The file type (usually a mime type). */
|
|
70
|
+
type: string;
|
|
71
|
+
/** The file name. */
|
|
72
|
+
name: string;
|
|
73
|
+
/** Returns the contents of the file as a blob. */
|
|
74
|
+
getFile(): Promise<File>;
|
|
75
|
+
/** Returns the contents of the file as a string. */
|
|
76
|
+
getText(): Promise<string>;
|
|
77
77
|
}
|
|
78
78
|
/** A directory item in a drop operation. */
|
|
79
79
|
export interface DirectoryDropItem {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
/** The item kind. */
|
|
81
|
+
kind: "directory";
|
|
82
|
+
/** The directory name. */
|
|
83
|
+
name: string;
|
|
84
|
+
/** Returns the entries contained within the directory. */
|
|
85
|
+
getEntries(): AsyncIterable<FileDropItem | DirectoryDropItem>;
|
|
86
86
|
}
|
|
87
87
|
/** Union of all drop item types. */
|
|
88
88
|
export type DropItem = TextDropItem | FileDropItem | DirectoryDropItem;
|
|
89
89
|
/** Event fired when items are dropped. */
|
|
90
90
|
export interface DropEvent extends DragDropEvent {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
/** The event type. */
|
|
92
|
+
type: "drop";
|
|
93
|
+
/** The drop operation that should occur. */
|
|
94
|
+
dropOperation: DropOperation;
|
|
95
|
+
/** The dropped items. */
|
|
96
|
+
items: DropItem[];
|
|
97
97
|
}
|
|
98
98
|
/** Position relative to an item for drop operations. */
|
|
99
|
-
export type DropPosition =
|
|
99
|
+
export type DropPosition = "on" | "before" | "after";
|
|
100
100
|
/** Drop target representing the root of a collection. */
|
|
101
101
|
export interface RootDropTarget {
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
/** The drop target type. */
|
|
103
|
+
type: "root";
|
|
104
104
|
}
|
|
105
105
|
/** Drop target representing an item in a collection. */
|
|
106
106
|
export interface ItemDropTarget {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
/** The drop target type. */
|
|
108
|
+
type: "item";
|
|
109
|
+
/** The item key. */
|
|
110
|
+
key: string | number;
|
|
111
|
+
/** The drop position relative to the item. */
|
|
112
|
+
dropPosition: DropPosition;
|
|
113
113
|
}
|
|
114
114
|
/** Union of drop target types. */
|
|
115
115
|
export type DropTarget = RootDropTarget | ItemDropTarget;
|
|
116
116
|
/** Event fired when a drag enters a droppable collection. */
|
|
117
117
|
export interface DroppableCollectionEnterEvent extends DropEnterEvent {
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
/** The drop target. */
|
|
119
|
+
target: DropTarget;
|
|
120
120
|
}
|
|
121
121
|
/** Event fired as a drag moves within a droppable collection. */
|
|
122
122
|
export interface DroppableCollectionMoveEvent extends DropMoveEvent {
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
/** The drop target. */
|
|
124
|
+
target: DropTarget;
|
|
125
125
|
}
|
|
126
126
|
/** Event fired when a drag is held over a droppable collection item. */
|
|
127
127
|
export interface DroppableCollectionActivateEvent extends DropActivateEvent {
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
/** The drop target. */
|
|
129
|
+
target: DropTarget;
|
|
130
130
|
}
|
|
131
131
|
/** Event fired when a drag exits a droppable collection. */
|
|
132
132
|
export interface DroppableCollectionExitEvent extends DropExitEvent {
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
/** The drop target. */
|
|
134
|
+
target: DropTarget;
|
|
135
135
|
}
|
|
136
136
|
/** Event fired when items are dropped on a droppable collection. */
|
|
137
137
|
export interface DroppableCollectionDropEvent extends DropEvent {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
/** The drop target. */
|
|
139
|
+
target: DropTarget;
|
|
140
140
|
}
|
|
141
141
|
/** Event for inserting items between existing collection items. */
|
|
142
142
|
export interface DroppableCollectionInsertDropEvent {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
/** The dropped items. */
|
|
144
|
+
items: DropItem[];
|
|
145
|
+
/** The drop operation that should occur. */
|
|
146
|
+
dropOperation: DropOperation;
|
|
147
|
+
/** The drop target. */
|
|
148
|
+
target: ItemDropTarget;
|
|
149
149
|
}
|
|
150
150
|
/** Event for dropping on the root of a collection. */
|
|
151
151
|
export interface DroppableCollectionRootDropEvent {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
/** The dropped items. */
|
|
153
|
+
items: DropItem[];
|
|
154
|
+
/** The drop operation that should occur. */
|
|
155
|
+
dropOperation: DropOperation;
|
|
156
156
|
}
|
|
157
157
|
/** Event for dropping on a specific item. */
|
|
158
158
|
export interface DroppableCollectionOnItemDropEvent {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
/** The dropped items. */
|
|
160
|
+
items: DropItem[];
|
|
161
|
+
/** The drop operation that should occur. */
|
|
162
|
+
dropOperation: DropOperation;
|
|
163
|
+
/** Whether the drag originated within the same collection as the drop. */
|
|
164
|
+
isInternal: boolean;
|
|
165
|
+
/** The drop target. */
|
|
166
|
+
target: ItemDropTarget;
|
|
167
167
|
}
|
|
168
168
|
/** Event for reordering items within a collection. */
|
|
169
169
|
export interface DroppableCollectionReorderEvent {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
/** The keys of the items that were reordered. */
|
|
171
|
+
keys: Set<string | number>;
|
|
172
|
+
/** The drop operation that should occur. */
|
|
173
|
+
dropOperation: DropOperation;
|
|
174
|
+
/** The drop target. */
|
|
175
|
+
target: ItemDropTarget;
|
|
176
176
|
}
|
|
177
177
|
/** Interface for checking drag types. */
|
|
178
178
|
export interface DragTypes {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
/** Returns whether the drag contains data of the given type. */
|
|
180
|
+
has(type: string | symbol): boolean;
|
|
181
181
|
}
|
|
182
182
|
/** Delegate for determining drop targets within a collection. */
|
|
183
183
|
export interface DropTargetDelegate {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
/**
|
|
185
|
+
* Returns a drop target within a collection for the given coordinates.
|
|
186
|
+
* @param x - X coordinate relative to the collection container
|
|
187
|
+
* @param y - Y coordinate relative to the collection container
|
|
188
|
+
* @param isValidDropTarget - Function to check if a target is valid
|
|
189
|
+
*/
|
|
190
|
+
getDropTargetFromPoint(
|
|
191
|
+
x: number,
|
|
192
|
+
y: number,
|
|
193
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
194
|
+
): DropTarget | null;
|
|
191
195
|
}
|
|
192
196
|
/** Event fired when a collection drag starts. */
|
|
193
197
|
export interface DraggableCollectionStartEvent extends DragStartEvent {
|
|
194
|
-
|
|
195
|
-
|
|
198
|
+
/** The keys of the items that were dragged. */
|
|
199
|
+
keys: Set<string | number>;
|
|
196
200
|
}
|
|
197
201
|
/** Event fired as a collection drag moves. */
|
|
198
202
|
export interface DraggableCollectionMoveEvent extends DragMoveEvent {
|
|
199
|
-
|
|
200
|
-
|
|
203
|
+
/** The keys of the items that were dragged. */
|
|
204
|
+
keys: Set<string | number>;
|
|
201
205
|
}
|
|
202
206
|
/** Event fired when a collection drag ends. */
|
|
203
207
|
export interface DraggableCollectionEndEvent extends DragEndEvent {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
/** The keys of the items that were dragged. */
|
|
209
|
+
keys: Set<string | number>;
|
|
210
|
+
/** Whether the drop ended within the same collection as it originated. */
|
|
211
|
+
isInternal: boolean;
|
|
208
212
|
}
|
|
209
213
|
/** Function to render a custom drag preview. */
|
|
210
|
-
export type DragPreviewRenderer = (
|
|
214
|
+
export type DragPreviewRenderer = (
|
|
215
|
+
items: DragItem[],
|
|
216
|
+
callback: (node: HTMLElement | null, x?: number, y?: number) => void,
|
|
217
|
+
) => void;
|
|
211
218
|
/** Props for droppable collection utility handlers. */
|
|
212
219
|
export interface DroppableCollectionUtilityOptions {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
/**
|
|
221
|
+
* The drag types that the droppable collection accepts.
|
|
222
|
+
* @default 'all'
|
|
223
|
+
*/
|
|
224
|
+
acceptedDragTypes?: "all" | Array<string | symbol>;
|
|
225
|
+
/** Handler that is called when external items are dropped "between" items. */
|
|
226
|
+
onInsert?: (e: DroppableCollectionInsertDropEvent) => void;
|
|
227
|
+
/** Handler that is called when external items are dropped on the collection's root. */
|
|
228
|
+
onRootDrop?: (e: DroppableCollectionRootDropEvent) => void;
|
|
229
|
+
/** Handler that is called when items are dropped "on" an item. */
|
|
230
|
+
onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;
|
|
231
|
+
/** Handler that is called when items are reordered within the collection. */
|
|
232
|
+
onReorder?: (e: DroppableCollectionReorderEvent) => void;
|
|
233
|
+
/** Handler that is called when items are moved within the source collection. */
|
|
234
|
+
onMove?: (e: DroppableCollectionReorderEvent) => void;
|
|
235
|
+
/** A function returning whether a given target is a valid "on" drop target. */
|
|
236
|
+
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean;
|
|
230
237
|
}
|
|
231
238
|
/** Base props for droppable collections. */
|
|
232
239
|
export interface DroppableCollectionBaseProps {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
/** Handler that is called when a valid drag enters a drop target. */
|
|
241
|
+
onDropEnter?: (e: DroppableCollectionEnterEvent) => void;
|
|
242
|
+
/** Handler that is called after a valid drag is held over a drop target. */
|
|
243
|
+
onDropActivate?: (e: DroppableCollectionActivateEvent) => void;
|
|
244
|
+
/** Handler that is called when a valid drag exits a drop target. */
|
|
245
|
+
onDropExit?: (e: DroppableCollectionExitEvent) => void;
|
|
246
|
+
/** Handler that is called when a valid drag is dropped on a drop target. */
|
|
247
|
+
onDrop?: (e: DroppableCollectionDropEvent) => void;
|
|
248
|
+
/** A function returning the drop operation to be performed. */
|
|
249
|
+
getDropOperation?: (
|
|
250
|
+
target: DropTarget,
|
|
251
|
+
types: DragTypes,
|
|
252
|
+
allowedOperations: DropOperation[],
|
|
253
|
+
) => DropOperation;
|
|
243
254
|
}
|
|
244
255
|
/** Combined props for droppable collections. */
|
|
245
|
-
export interface DroppableCollectionProps
|
|
246
|
-
}
|
|
256
|
+
export interface DroppableCollectionProps
|
|
257
|
+
extends DroppableCollectionUtilityOptions, DroppableCollectionBaseProps {}
|
|
247
258
|
/** Props for draggable collections. */
|
|
248
259
|
export interface DraggableCollectionProps<T = object> {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
//# sourceMappingURL=types.d.ts.map
|
|
260
|
+
/** Handler that is called when a drag operation is started. */
|
|
261
|
+
onDragStart?: (e: DraggableCollectionStartEvent) => void;
|
|
262
|
+
/** Handler that is called when the drag is moved. */
|
|
263
|
+
onDragMove?: (e: DraggableCollectionMoveEvent) => void;
|
|
264
|
+
/** Handler that is called when the drag operation ends. */
|
|
265
|
+
onDragEnd?: (e: DraggableCollectionEndEvent) => void;
|
|
266
|
+
/** A function that returns the items being dragged. */
|
|
267
|
+
getItems: (keys: Set<string | number>, items: T[]) => DragItem[];
|
|
268
|
+
/** The ref of the element that will be rendered as the drag preview. */
|
|
269
|
+
preview?: {
|
|
270
|
+
current: DragPreviewRenderer | null;
|
|
271
|
+
};
|
|
272
|
+
/** Function that returns the allowed drop operations. */
|
|
273
|
+
getAllowedDropOperations?: () => DropOperation[];
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=types.d.ts.map
|