@proyecto-viviana/solidaria-components 0.3.2 → 0.4.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/dist/ActionBar.js +184 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +128 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.js +179 -0
- package/dist/ActionGroup.js.map +1 -0
- package/dist/ActionGroup.jsx +129 -0
- package/dist/ActionGroup.jsx.map +1 -0
- package/dist/Alert.js +111 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Alert.jsx +82 -0
- package/dist/Alert.jsx.map +1 -0
- package/dist/Autocomplete.js +130 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Autocomplete.jsx +116 -0
- package/dist/Autocomplete.jsx.map +1 -0
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +334 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +266 -0
- package/dist/Breadcrumbs.jsx.map +1 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +348 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.jsx +314 -0
- package/dist/Button.jsx.map +1 -0
- package/dist/Calendar.d.ts +4 -4
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +538 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +333 -0
- package/dist/Calendar.jsx.map +1 -0
- package/dist/CalendarPicker.d.ts +33 -0
- package/dist/CalendarPicker.d.ts.map +1 -0
- package/dist/CalendarPicker.js +44 -0
- package/dist/CalendarPicker.js.map +1 -0
- package/dist/CalendarPicker.jsx +44 -0
- package/dist/CalendarPicker.jsx.map +1 -0
- package/dist/Checkbox.d.ts +83 -4
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +923 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.jsx +707 -0
- package/dist/Checkbox.jsx.map +1 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +202 -0
- package/dist/Collection.js.map +1 -0
- package/dist/Collection.jsx +152 -0
- package/dist/Collection.jsx.map +1 -0
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +1720 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1344 -0
- package/dist/Color.jsx.map +1 -0
- package/dist/ColorEditor.js +208 -0
- package/dist/ColorEditor.js.map +1 -0
- package/dist/ColorEditor.jsx +120 -0
- package/dist/ColorEditor.jsx.map +1 -0
- package/dist/ComboBox.d.ts +4 -4
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +992 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +714 -0
- package/dist/ComboBox.jsx.map +1 -0
- package/dist/ContextualHelpTrigger.js +146 -0
- package/dist/ContextualHelpTrigger.js.map +1 -0
- package/dist/ContextualHelpTrigger.jsx +109 -0
- package/dist/ContextualHelpTrigger.jsx.map +1 -0
- package/dist/DateField.d.ts +3 -3
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +499 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +317 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +991 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.jsx +682 -0
- package/dist/DatePicker.jsx.map +1 -0
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +337 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dialog.jsx +192 -0
- package/dist/Dialog.jsx.map +1 -0
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +328 -0
- package/dist/Disclosure.js.map +1 -0
- package/dist/Disclosure.jsx +230 -0
- package/dist/Disclosure.jsx.map +1 -0
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +176 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/DragAndDrop.jsx +160 -0
- package/dist/DragAndDrop.jsx.map +1 -0
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +189 -0
- package/dist/DropZone.js.map +1 -0
- package/dist/DropZone.jsx +144 -0
- package/dist/DropZone.jsx.map +1 -0
- package/dist/FieldError.js +66 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldError.jsx +47 -0
- package/dist/FieldError.jsx.map +1 -0
- package/dist/FileTrigger.js +79 -0
- package/dist/FileTrigger.js.map +1 -0
- package/dist/FileTrigger.jsx +49 -0
- package/dist/FileTrigger.jsx.map +1 -0
- package/dist/Focusable.js +70 -0
- package/dist/Focusable.js.map +1 -0
- package/dist/Focusable.jsx +69 -0
- package/dist/Focusable.jsx.map +1 -0
- package/dist/Form.js +99 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.jsx +73 -0
- package/dist/Form.jsx.map +1 -0
- package/dist/GridList.d.ts +34 -2
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +723 -0
- package/dist/GridList.js.map +1 -0
- package/dist/GridList.jsx +552 -0
- package/dist/GridList.jsx.map +1 -0
- package/dist/HiddenTimeInput.js +104 -0
- package/dist/HiddenTimeInput.js.map +1 -0
- package/dist/HiddenTimeInput.jsx +69 -0
- package/dist/HiddenTimeInput.jsx.map +1 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +127 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.jsx +72 -0
- package/dist/Icon.jsx.map +1 -0
- package/dist/Keyboard.js +30 -0
- package/dist/Keyboard.js.map +1 -0
- package/dist/Keyboard.jsx +24 -0
- package/dist/Keyboard.jsx.map +1 -0
- package/dist/Landmark.js +134 -0
- package/dist/Landmark.js.map +1 -0
- package/dist/Landmark.jsx +118 -0
- package/dist/Landmark.jsx.map +1 -0
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +219 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.jsx +189 -0
- package/dist/Link.jsx.map +1 -0
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +670 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +508 -0
- package/dist/ListBox.jsx.map +1 -0
- package/dist/Menu.d.ts +27 -9
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +1254 -0
- package/dist/Menu.js.map +1 -0
- package/dist/Menu.jsx +1042 -0
- package/dist/Menu.jsx.map +1 -0
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +123 -0
- package/dist/Meter.js.map +1 -0
- package/dist/Meter.jsx +107 -0
- package/dist/Meter.jsx.map +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +380 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.jsx +314 -0
- package/dist/Modal.jsx.map +1 -0
- package/dist/NumberField.d.ts +3 -3
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +573 -0
- package/dist/NumberField.js.map +1 -0
- package/dist/NumberField.jsx +443 -0
- package/dist/NumberField.jsx.map +1 -0
- package/dist/Popover.d.ts +10 -2
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +464 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +333 -0
- package/dist/Popover.jsx.map +1 -0
- package/dist/Pressable.js +69 -0
- package/dist/Pressable.js.map +1 -0
- package/dist/Pressable.jsx +68 -0
- package/dist/Pressable.jsx.map +1 -0
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +130 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressBar.jsx +114 -0
- package/dist/ProgressBar.jsx.map +1 -0
- package/dist/RadioGroup.d.ts +82 -4
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +931 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RadioGroup.jsx +681 -0
- package/dist/RadioGroup.jsx.map +1 -0
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +410 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +253 -0
- package/dist/RangeCalendar.jsx.map +1 -0
- package/dist/RouterProvider.js +118 -0
- package/dist/RouterProvider.js.map +1 -0
- package/dist/RouterProvider.jsx +112 -0
- package/dist/RouterProvider.jsx.map +1 -0
- package/dist/SearchField.d.ts +2 -2
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +643 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +526 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1031 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +744 -0
- package/dist/Select.jsx.map +1 -0
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +86 -0
- package/dist/SelectionIndicator.js.map +1 -0
- package/dist/SelectionIndicator.jsx +50 -0
- package/dist/SelectionIndicator.jsx.map +1 -0
- package/dist/Separator.js +97 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Separator.jsx +85 -0
- package/dist/Separator.jsx.map +1 -0
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +165 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +138 -0
- package/dist/SharedElementTransition.jsx.map +1 -0
- package/dist/Slider.d.ts +33 -1
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +515 -0
- package/dist/Slider.js.map +1 -0
- package/dist/Slider.jsx +403 -0
- package/dist/Slider.jsx.map +1 -0
- package/dist/StepList.js +198 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +141 -0
- package/dist/StepList.jsx.map +1 -0
- package/dist/Switch.d.ts +65 -2
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +534 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.jsx +393 -0
- package/dist/Switch.jsx.map +1 -0
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1759 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1348 -0
- package/dist/Table.jsx.map +1 -0
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +595 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.jsx +367 -0
- package/dist/Tabs.jsx.map +1 -0
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +378 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +270 -0
- package/dist/TagGroup.jsx.map +1 -0
- package/dist/Text.d.ts +18 -6
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +42 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.jsx +35 -0
- package/dist/Text.jsx.map +1 -0
- package/dist/TextField.d.ts +6 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +436 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +403 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +3 -3
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +372 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +224 -0
- package/dist/TimeField.jsx.map +1 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +551 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.jsx +361 -0
- package/dist/Toast.jsx.map +1 -0
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +123 -0
- package/dist/ToggleButton.js.map +1 -0
- package/dist/ToggleButton.jsx +88 -0
- package/dist/ToggleButton.jsx.map +1 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +114 -0
- package/dist/ToggleButtonGroup.js.map +1 -0
- package/dist/ToggleButtonGroup.jsx +85 -0
- package/dist/ToggleButtonGroup.jsx.map +1 -0
- package/dist/Toolbar.js +112 -0
- package/dist/Toolbar.js.map +1 -0
- package/dist/Toolbar.jsx +92 -0
- package/dist/Toolbar.jsx.map +1 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +539 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.jsx +465 -0
- package/dist/Tooltip.jsx.map +1 -0
- package/dist/Tree.d.ts +14 -2
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +1424 -0
- package/dist/Tree.js.map +1 -0
- package/dist/Tree.jsx +1172 -0
- package/dist/Tree.jsx.map +1 -0
- package/dist/Virtualizer.d.ts +16 -2
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -0
- package/dist/Virtualizer.jsx +2 -0
- package/dist/Virtualizer2.js +751 -0
- package/dist/Virtualizer2.js.map +1 -0
- package/dist/Virtualizer2.jsx +730 -0
- package/dist/Virtualizer2.jsx.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +18 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +42 -0
- package/dist/VisuallyHidden.js.map +1 -0
- package/dist/VisuallyHidden.jsx +35 -0
- package/dist/VisuallyHidden.jsx.map +1 -0
- package/dist/contexts.js +33 -0
- package/dist/contexts.js.map +1 -0
- package/dist/contexts.jsx +33 -0
- package/dist/contexts.jsx.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -23932
- package/dist/index.jsx +70 -18337
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +395 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +395 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +83 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +285 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.jsx +277 -0
- package/dist/utils.jsx.map +1 -0
- package/dist/virtualizer/Layout.js +144 -0
- package/dist/virtualizer/Layout.js.map +1 -0
- package/dist/virtualizer/Layout.jsx +144 -0
- package/dist/virtualizer/Layout.jsx.map +1 -0
- package/package.json +401 -4
- package/src/Breadcrumbs.tsx +3 -1
- package/src/Button.tsx +22 -2
- package/src/Calendar.tsx +27 -10
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +42 -14
- package/src/ComboBox.tsx +50 -6
- package/src/DateField.tsx +20 -2
- package/src/DatePicker.tsx +57 -5
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +3 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +125 -24
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +31 -4
- package/src/Menu.tsx +252 -128
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +100 -52
- package/src/NumberField.tsx +51 -8
- package/src/Popover.tsx +40 -10
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +3 -1
- package/src/SearchField.tsx +27 -3
- package/src/Select.tsx +22 -7
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +3 -1
- package/src/Slider.tsx +159 -13
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +409 -95
- package/src/Tabs.tsx +16 -45
- package/src/TagGroup.tsx +3 -1
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +43 -5
- package/src/TimeField.tsx +20 -2
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +3 -1
- package/src/Tree.tsx +77 -9
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +50 -0
- package/src/utils.tsx +243 -27
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { onCleanup } from "solid-js";
|
|
2
|
+
import { createDraggableCollection, createDraggableItem, createDroppableCollection, createDroppableItem, getGlobalDraggingCollectionRef, getGlobalDraggingKeys } from "@proyecto-viviana/solidaria";
|
|
3
|
+
import { createDraggableCollectionState, createDroppableCollectionState } from "@proyecto-viviana/solid-stately";
|
|
4
|
+
//#region src/DragPreview.tsx
|
|
5
|
+
function DragPreview(props) {
|
|
6
|
+
const hasDom = typeof HTMLElement !== "undefined";
|
|
7
|
+
const isElementNode = (value) => {
|
|
8
|
+
if (!value) return false;
|
|
9
|
+
if (hasDom && value instanceof HTMLElement) return true;
|
|
10
|
+
return typeof value === "object" && value.nodeType === 1;
|
|
11
|
+
};
|
|
12
|
+
if (props.ref) {
|
|
13
|
+
const renderer = (items, callback) => {
|
|
14
|
+
const rendered = props.children(items);
|
|
15
|
+
if (!rendered) {
|
|
16
|
+
callback(null);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (typeof rendered === "object" && rendered !== null && "element" in rendered) {
|
|
20
|
+
const previewValue = rendered;
|
|
21
|
+
callback(isElementNode(previewValue.element) ? previewValue.element : null, previewValue.x, previewValue.y);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
callback(isElementNode(rendered) ? rendered : null);
|
|
25
|
+
};
|
|
26
|
+
props.ref.current = renderer;
|
|
27
|
+
onCleanup(() => {
|
|
28
|
+
if (props.ref?.current === renderer) props.ref.current = null;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/ListDropTargetDelegate.ts
|
|
35
|
+
const cssEscape = (value) => {
|
|
36
|
+
const css = globalThis.CSS;
|
|
37
|
+
return css?.escape ? css.escape(value) : value.replace(/[^a-zA-Z0-9_-]/g, "\\$&");
|
|
38
|
+
};
|
|
39
|
+
var ListDropTargetDelegate = class {
|
|
40
|
+
collection;
|
|
41
|
+
ref;
|
|
42
|
+
layout;
|
|
43
|
+
orientation;
|
|
44
|
+
direction;
|
|
45
|
+
constructor(collection, ref, options) {
|
|
46
|
+
this.collection = collection;
|
|
47
|
+
this.ref = ref;
|
|
48
|
+
this.layout = options?.layout ?? "stack";
|
|
49
|
+
this.orientation = options?.orientation ?? "vertical";
|
|
50
|
+
this.direction = options?.direction ?? "ltr";
|
|
51
|
+
}
|
|
52
|
+
getCollection() {
|
|
53
|
+
return typeof this.collection === "function" ? this.collection() : this.collection;
|
|
54
|
+
}
|
|
55
|
+
getPrimaryStart(rect) {
|
|
56
|
+
return this.orientation === "horizontal" ? rect.left : rect.top;
|
|
57
|
+
}
|
|
58
|
+
getPrimaryEnd(rect) {
|
|
59
|
+
return this.orientation === "horizontal" ? rect.right : rect.bottom;
|
|
60
|
+
}
|
|
61
|
+
getSecondaryStart(rect) {
|
|
62
|
+
return this.orientation === "horizontal" ? rect.top : rect.left;
|
|
63
|
+
}
|
|
64
|
+
getSecondaryEnd(rect) {
|
|
65
|
+
return this.orientation === "horizontal" ? rect.bottom : rect.right;
|
|
66
|
+
}
|
|
67
|
+
getFlowStart(rect) {
|
|
68
|
+
return this.layout === "stack" ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);
|
|
69
|
+
}
|
|
70
|
+
getFlowEnd(rect) {
|
|
71
|
+
return this.layout === "stack" ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);
|
|
72
|
+
}
|
|
73
|
+
getFlowSize(rect) {
|
|
74
|
+
return this.getFlowEnd(rect) - this.getFlowStart(rect);
|
|
75
|
+
}
|
|
76
|
+
getItemKeys() {
|
|
77
|
+
return [...this.getCollection()].filter((item) => item.type === "item").map((item) => item.key);
|
|
78
|
+
}
|
|
79
|
+
resolveBoundaryTarget(direction, isValidDropTarget) {
|
|
80
|
+
const keys = this.getItemKeys();
|
|
81
|
+
if (keys.length === 0) return null;
|
|
82
|
+
const key = direction === "next" ? keys[0] : keys[keys.length - 1];
|
|
83
|
+
const order = direction === "next" ? [
|
|
84
|
+
"before",
|
|
85
|
+
"on",
|
|
86
|
+
"after"
|
|
87
|
+
] : [
|
|
88
|
+
"after",
|
|
89
|
+
"on",
|
|
90
|
+
"before"
|
|
91
|
+
];
|
|
92
|
+
for (const dropPosition of order) {
|
|
93
|
+
const target = {
|
|
94
|
+
type: "item",
|
|
95
|
+
key,
|
|
96
|
+
dropPosition
|
|
97
|
+
};
|
|
98
|
+
if (isValidDropTarget(target)) return target;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
resolveTransitionTarget(target, direction, isValidDropTarget) {
|
|
103
|
+
if (target.type !== "item") return null;
|
|
104
|
+
const tryPosition = (dropPosition) => {
|
|
105
|
+
if (target.dropPosition === dropPosition) return null;
|
|
106
|
+
const nextTarget = {
|
|
107
|
+
type: "item",
|
|
108
|
+
key: target.key,
|
|
109
|
+
dropPosition
|
|
110
|
+
};
|
|
111
|
+
return isValidDropTarget(nextTarget) ? nextTarget : null;
|
|
112
|
+
};
|
|
113
|
+
if (direction === "next") {
|
|
114
|
+
if (target.dropPosition === "before") return tryPosition("on") ?? tryPosition("after");
|
|
115
|
+
if (target.dropPosition === "on") return tryPosition("after");
|
|
116
|
+
} else {
|
|
117
|
+
if (target.dropPosition === "after") return tryPosition("on") ?? tryPosition("before");
|
|
118
|
+
if (target.dropPosition === "on") return tryPosition("before");
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
resolveNeighborTarget(target, direction, isValidDropTarget) {
|
|
123
|
+
if (target.type !== "item") return null;
|
|
124
|
+
const keys = this.getItemKeys();
|
|
125
|
+
const index = keys.findIndex((key) => key === target.key);
|
|
126
|
+
if (index < 0) return this.resolveBoundaryTarget(direction, isValidDropTarget);
|
|
127
|
+
const nextIndex = direction === "next" ? index + 1 : index - 1;
|
|
128
|
+
if (nextIndex < 0 || nextIndex >= keys.length) {
|
|
129
|
+
const rootTarget = { type: "root" };
|
|
130
|
+
return isValidDropTarget(rootTarget) ? rootTarget : null;
|
|
131
|
+
}
|
|
132
|
+
const key = keys[nextIndex];
|
|
133
|
+
const order = direction === "next" ? [
|
|
134
|
+
"on",
|
|
135
|
+
"before",
|
|
136
|
+
"after"
|
|
137
|
+
] : [
|
|
138
|
+
"on",
|
|
139
|
+
"after",
|
|
140
|
+
"before"
|
|
141
|
+
];
|
|
142
|
+
for (const dropPosition of order) {
|
|
143
|
+
const nextTarget = {
|
|
144
|
+
type: "item",
|
|
145
|
+
key,
|
|
146
|
+
dropPosition
|
|
147
|
+
};
|
|
148
|
+
if (isValidDropTarget(nextTarget)) return nextTarget;
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
getKeyboardNavigationTarget(target, direction, isValidDropTarget) {
|
|
153
|
+
if (!target || target.type === "root") return this.resolveBoundaryTarget(direction, isValidDropTarget);
|
|
154
|
+
const transition = this.resolveTransitionTarget(target, direction, isValidDropTarget);
|
|
155
|
+
if (transition) return transition;
|
|
156
|
+
return this.resolveNeighborTarget(target, direction, isValidDropTarget);
|
|
157
|
+
}
|
|
158
|
+
getDropTargetFromPoint(x, y, isValidDropTarget) {
|
|
159
|
+
const root = this.ref();
|
|
160
|
+
if (!root) return { type: "root" };
|
|
161
|
+
const allItems = [...this.getCollection()].filter((item) => item.type === "item");
|
|
162
|
+
if (allItems.length === 0) return { type: "root" };
|
|
163
|
+
const collectionId = root.dataset.collection;
|
|
164
|
+
const selector = collectionId ? `[data-collection="${cssEscape(collectionId)}"]` : "[data-key]";
|
|
165
|
+
const elements = root.querySelectorAll(selector);
|
|
166
|
+
const elementMap = /* @__PURE__ */ new Map();
|
|
167
|
+
for (const node of elements) if (node instanceof HTMLElement && node.dataset.key != null) elementMap.set(node.dataset.key, node);
|
|
168
|
+
let low = 0;
|
|
169
|
+
let high = allItems.length;
|
|
170
|
+
const rootRect = root.getBoundingClientRect();
|
|
171
|
+
let primary = this.orientation === "horizontal" ? x : y;
|
|
172
|
+
let secondary = this.orientation === "horizontal" ? y : x;
|
|
173
|
+
primary += this.getPrimaryStart(rootRect);
|
|
174
|
+
secondary += this.getSecondaryStart(rootRect);
|
|
175
|
+
const flow = this.layout === "stack" ? primary : secondary;
|
|
176
|
+
const isPrimaryRtl = this.orientation === "horizontal" && this.direction === "rtl";
|
|
177
|
+
const isSecondaryRtl = this.layout === "grid" && this.orientation === "vertical" && this.direction === "rtl";
|
|
178
|
+
const isFlowRtl = this.layout === "stack" ? isPrimaryRtl : isSecondaryRtl;
|
|
179
|
+
while (low < high) {
|
|
180
|
+
const mid = Math.floor((low + high) / 2);
|
|
181
|
+
const item = allItems[mid];
|
|
182
|
+
const element = elementMap.get(String(item.key));
|
|
183
|
+
if (!element) break;
|
|
184
|
+
const rect = element.getBoundingClientRect();
|
|
185
|
+
const update = (isGreater) => {
|
|
186
|
+
if (isGreater) low = mid + 1;
|
|
187
|
+
else high = mid;
|
|
188
|
+
};
|
|
189
|
+
if (primary < this.getPrimaryStart(rect)) update(isPrimaryRtl);
|
|
190
|
+
else if (primary > this.getPrimaryEnd(rect)) update(!isPrimaryRtl);
|
|
191
|
+
else if (secondary < this.getSecondaryStart(rect)) update(isSecondaryRtl);
|
|
192
|
+
else if (secondary > this.getSecondaryEnd(rect)) update(!isSecondaryRtl);
|
|
193
|
+
else {
|
|
194
|
+
const target = {
|
|
195
|
+
type: "item",
|
|
196
|
+
key: item.key,
|
|
197
|
+
dropPosition: "on"
|
|
198
|
+
};
|
|
199
|
+
if (isValidDropTarget(target)) {
|
|
200
|
+
if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({
|
|
201
|
+
...target,
|
|
202
|
+
dropPosition: "before"
|
|
203
|
+
})) target.dropPosition = isFlowRtl ? "after" : "before";
|
|
204
|
+
else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({
|
|
205
|
+
...target,
|
|
206
|
+
dropPosition: "after"
|
|
207
|
+
})) target.dropPosition = isFlowRtl ? "before" : "after";
|
|
208
|
+
} else {
|
|
209
|
+
const midpoint = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;
|
|
210
|
+
if (flow <= midpoint && isValidDropTarget({
|
|
211
|
+
...target,
|
|
212
|
+
dropPosition: "before"
|
|
213
|
+
})) target.dropPosition = isFlowRtl ? "after" : "before";
|
|
214
|
+
else if (flow >= midpoint && isValidDropTarget({
|
|
215
|
+
...target,
|
|
216
|
+
dropPosition: "after"
|
|
217
|
+
})) target.dropPosition = isFlowRtl ? "before" : "after";
|
|
218
|
+
}
|
|
219
|
+
return target;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const item = allItems[Math.min(low, allItems.length - 1)];
|
|
223
|
+
const rect = elementMap.get(String(item.key))?.getBoundingClientRect();
|
|
224
|
+
if (rect && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) return {
|
|
225
|
+
type: "item",
|
|
226
|
+
key: item.key,
|
|
227
|
+
dropPosition: isFlowRtl ? "after" : "before"
|
|
228
|
+
};
|
|
229
|
+
return {
|
|
230
|
+
type: "item",
|
|
231
|
+
key: item.key,
|
|
232
|
+
dropPosition: isFlowRtl ? "before" : "after"
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/useDragAndDrop.ts
|
|
238
|
+
/**
|
|
239
|
+
* Provides hooks to enable drag-and-drop behavior for collection components.
|
|
240
|
+
*/
|
|
241
|
+
function useDragAndDrop(options = {}) {
|
|
242
|
+
const { getItems, onDrop, onInsert, onItemDrop, onReorder, onMove, onRootDrop, renderDragPreview, renderDropIndicator, dropTargetDelegate } = options;
|
|
243
|
+
const isDraggable = typeof getItems === "function";
|
|
244
|
+
const isDroppable = Boolean(onDrop || onInsert || onItemDrop || onReorder || onMove || onRootDrop);
|
|
245
|
+
const hooks = {};
|
|
246
|
+
const hasDom = typeof HTMLElement !== "undefined";
|
|
247
|
+
const isElementNode = (value) => {
|
|
248
|
+
if (!value) return false;
|
|
249
|
+
if (hasDom && value instanceof HTMLElement) return true;
|
|
250
|
+
return typeof value === "object" && value.nodeType === 1;
|
|
251
|
+
};
|
|
252
|
+
const resolvedPreview = options.preview ?? (renderDragPreview ? { current: (items, callback) => {
|
|
253
|
+
const rendered = renderDragPreview(items);
|
|
254
|
+
if (!rendered) {
|
|
255
|
+
callback(null);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (typeof rendered === "object" && rendered !== null && "element" in rendered) {
|
|
259
|
+
const previewValue = rendered;
|
|
260
|
+
callback(isElementNode(previewValue.element) ? previewValue.element : null, previewValue.x, previewValue.y);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
callback(isElementNode(rendered) ? rendered : null);
|
|
264
|
+
} } : void 0);
|
|
265
|
+
if (isDraggable && getItems) {
|
|
266
|
+
hooks.useDraggableCollectionState = (props) => {
|
|
267
|
+
return createDraggableCollectionState(() => ({
|
|
268
|
+
onDragStart: options.onDragStart ?? props.onDragStart,
|
|
269
|
+
onDragMove: options.onDragMove ?? props.onDragMove,
|
|
270
|
+
onDragEnd: options.onDragEnd ?? props.onDragEnd,
|
|
271
|
+
getAllowedDropOperations: options.getAllowedDropOperations ?? props.getAllowedDropOperations,
|
|
272
|
+
isDisabled: options.isDisabled ?? props.isDisabled,
|
|
273
|
+
preview: resolvedPreview ?? props.preview,
|
|
274
|
+
getItems: (keys) => {
|
|
275
|
+
return getItems(keys, props.items ?? options.items ?? []);
|
|
276
|
+
}
|
|
277
|
+
}));
|
|
278
|
+
};
|
|
279
|
+
hooks.useDraggableCollection = (props, state, ref) => createDraggableCollection({
|
|
280
|
+
...props,
|
|
281
|
+
ref
|
|
282
|
+
}, state);
|
|
283
|
+
hooks.useDraggableItem = (props, state) => createDraggableItem(() => props, state);
|
|
284
|
+
hooks.DragPreview = DragPreview;
|
|
285
|
+
hooks.renderDragPreview = renderDragPreview;
|
|
286
|
+
hooks.isVirtualDragging = () => getGlobalDraggingCollectionRef() != null || getGlobalDraggingKeys().size > 0;
|
|
287
|
+
}
|
|
288
|
+
if (isDroppable) {
|
|
289
|
+
hooks.useDroppableCollectionState = (props) => {
|
|
290
|
+
return createDroppableCollectionState(() => ({
|
|
291
|
+
acceptedDragTypes: options.acceptedDragTypes ?? props.acceptedDragTypes,
|
|
292
|
+
getDropOperation: options.getDropOperation ?? props.getDropOperation,
|
|
293
|
+
onDropEnter: options.onDropEnter ?? props.onDropEnter,
|
|
294
|
+
onDropActivate: options.onDropActivate ?? props.onDropActivate,
|
|
295
|
+
onDropExit: options.onDropExit ?? props.onDropExit,
|
|
296
|
+
onDrop: options.onDrop ?? props.onDrop,
|
|
297
|
+
onInsert: options.onInsert ?? props.onInsert,
|
|
298
|
+
onRootDrop: options.onRootDrop ?? props.onRootDrop,
|
|
299
|
+
onItemDrop: options.onItemDrop ?? props.onItemDrop,
|
|
300
|
+
onReorder: options.onReorder ?? props.onReorder,
|
|
301
|
+
onMove: options.onMove ?? props.onMove,
|
|
302
|
+
shouldAcceptItemDrop: options.shouldAcceptItemDrop ?? props.shouldAcceptItemDrop,
|
|
303
|
+
isDisabled: options.isDisabled ?? props.isDisabled
|
|
304
|
+
}));
|
|
305
|
+
};
|
|
306
|
+
hooks.useDroppableCollection = (props, state, ref) => {
|
|
307
|
+
const acceptedDragTypes = options.acceptedDragTypes ?? props.acceptedDragTypes;
|
|
308
|
+
const normalizedAcceptedDragTypes = acceptedDragTypes === "all" ? "all" : acceptedDragTypes?.filter((type) => typeof type === "string" || typeof type === "symbol");
|
|
309
|
+
return createDroppableCollection(() => ({
|
|
310
|
+
ref,
|
|
311
|
+
dropTargetDelegate: options.dropTargetDelegate ?? props.dropTargetDelegate,
|
|
312
|
+
keyboardDelegate: options.keyboardDelegate ?? props.keyboardDelegate,
|
|
313
|
+
onKeyDown: options.onKeyDown ?? props.onKeyDown,
|
|
314
|
+
acceptedDragTypes: normalizedAcceptedDragTypes,
|
|
315
|
+
isDisabled: options.isDisabled ?? props.isDisabled,
|
|
316
|
+
onDropActivate: (e) => {
|
|
317
|
+
(options.onDropActivate ?? props.onDropActivate)?.({
|
|
318
|
+
type: "dropactivate",
|
|
319
|
+
target: e.target,
|
|
320
|
+
x: e.x,
|
|
321
|
+
y: e.y
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
onDrop: (e) => {
|
|
325
|
+
(options.onDrop ?? props.onDrop)?.({
|
|
326
|
+
type: "drop",
|
|
327
|
+
target: e.target,
|
|
328
|
+
x: e.x,
|
|
329
|
+
y: e.y,
|
|
330
|
+
items: e.items,
|
|
331
|
+
dropOperation: e.dropOperation
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
onRootDrop: options.onRootDrop ?? props.onRootDrop,
|
|
335
|
+
onItemDrop: (e) => {
|
|
336
|
+
if (e.target.type === "item") (options.onItemDrop ?? props.onItemDrop)?.({
|
|
337
|
+
items: e.items,
|
|
338
|
+
target: e.target,
|
|
339
|
+
dropOperation: e.dropOperation,
|
|
340
|
+
isInternal: e.isInternal
|
|
341
|
+
});
|
|
342
|
+
},
|
|
343
|
+
onInsert: (e) => {
|
|
344
|
+
if (e.target.type === "item") (options.onInsert ?? props.onInsert)?.({
|
|
345
|
+
items: e.items,
|
|
346
|
+
target: e.target,
|
|
347
|
+
dropOperation: e.dropOperation
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
onReorder: (e) => {
|
|
351
|
+
if (e.target.type === "item") (options.onReorder ?? props.onReorder)?.({
|
|
352
|
+
keys: e.keys,
|
|
353
|
+
target: e.target,
|
|
354
|
+
dropOperation: e.dropOperation
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
onMove: (e) => {
|
|
358
|
+
if (e.target.type === "item") (options.onMove ?? props.onMove)?.({
|
|
359
|
+
keys: e.keys,
|
|
360
|
+
target: e.target,
|
|
361
|
+
dropOperation: e.dropOperation
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}), state);
|
|
365
|
+
};
|
|
366
|
+
hooks.useDroppableItem = (props, state, ref) => createDroppableItem(() => ({
|
|
367
|
+
...props,
|
|
368
|
+
ref
|
|
369
|
+
}), state);
|
|
370
|
+
hooks.useDropIndicator = (props, state, _ref) => {
|
|
371
|
+
const target = props.target;
|
|
372
|
+
const activeTarget = state.target;
|
|
373
|
+
const isDropTarget = activeTarget?.type === target.type && (target.type === "root" || activeTarget.type === "item" && target.type === "item" && activeTarget.key === target.key && activeTarget.dropPosition === target.dropPosition);
|
|
374
|
+
return {
|
|
375
|
+
dropIndicatorProps: {
|
|
376
|
+
role: "option",
|
|
377
|
+
"aria-disabled": true,
|
|
378
|
+
"aria-hidden": isDropTarget ? void 0 : "true",
|
|
379
|
+
tabIndex: -1,
|
|
380
|
+
"data-drop-target": isDropTarget ? "" : void 0
|
|
381
|
+
},
|
|
382
|
+
isDropTarget,
|
|
383
|
+
isHidden: !isDropTarget
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
hooks.renderDropIndicator = renderDropIndicator;
|
|
387
|
+
hooks.dropTargetDelegate = dropTargetDelegate;
|
|
388
|
+
hooks.ListDropTargetDelegate = ListDropTargetDelegate;
|
|
389
|
+
}
|
|
390
|
+
return { dragAndDropHooks: hooks };
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
export { useDragAndDrop as t };
|
|
394
|
+
|
|
395
|
+
//# sourceMappingURL=useDragAndDrop2.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDragAndDrop2.jsx","names":[],"sources":["../src/DragPreview.tsx","../src/ListDropTargetDelegate.ts","../src/useDragAndDrop.ts"],"sourcesContent":["import { onCleanup, type JSX } from \"solid-js\";\nimport type { DragItem, DragPreviewRenderer } from \"@proyecto-viviana/solid-stately\";\n\nexport interface DragPreviewProps {\n ref?: { current: DragPreviewRenderer | null };\n children: (\n items: DragItem[],\n ) => JSX.Element | { element: JSX.Element; x?: number; y?: number } | null | undefined;\n}\n\nexport function DragPreview(props: DragPreviewProps): JSX.Element {\n const hasDom = typeof HTMLElement !== \"undefined\";\n const isElementNode = (value: unknown): value is HTMLElement => {\n if (!value) return false;\n if (hasDom && value instanceof HTMLElement) return true;\n return typeof value === \"object\" && (value as { nodeType?: number }).nodeType === 1;\n };\n\n if (props.ref) {\n const renderer: DragPreviewRenderer = (items, callback) => {\n const rendered = props.children(items);\n if (!rendered) {\n callback(null);\n return;\n }\n if (typeof rendered === \"object\" && rendered !== null && \"element\" in rendered) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(\n isElementNode(previewValue.element) ? previewValue.element : null,\n previewValue.x,\n previewValue.y,\n );\n return;\n }\n callback(isElementNode(rendered) ? rendered : null);\n };\n\n props.ref.current = renderer;\n onCleanup(() => {\n if (props.ref?.current === renderer) {\n props.ref.current = null;\n }\n });\n }\n\n return null as unknown as JSX.Element;\n}\n","import type { Accessor } from \"solid-js\";\nimport type { DropTarget } from \"@proyecto-viviana/solid-stately\";\n\ntype Direction = \"ltr\" | \"rtl\";\ntype Orientation = \"horizontal\" | \"vertical\";\ntype Layout = \"stack\" | \"grid\";\n\ninterface CollectionNodeLike {\n key: string | number;\n type?: string;\n}\n\nexport interface ListDropTargetDelegateOptions {\n layout?: Layout;\n orientation?: Orientation;\n direction?: Direction;\n}\n\nconst cssEscape = (value: string): string => {\n const css = (globalThis as { CSS?: { escape?: (input: string) => string } }).CSS;\n return css?.escape ? css.escape(value) : value.replace(/[^a-zA-Z0-9_-]/g, \"\\\\$&\");\n};\n\nexport class ListDropTargetDelegate {\n private collection: Iterable<CollectionNodeLike> | (() => Iterable<CollectionNodeLike>);\n private ref: Accessor<HTMLElement | null>;\n private layout: Layout;\n private orientation: Orientation;\n private direction: Direction;\n\n constructor(\n collection: Iterable<CollectionNodeLike> | (() => Iterable<CollectionNodeLike>),\n ref: Accessor<HTMLElement | null>,\n options?: ListDropTargetDelegateOptions,\n ) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout ?? \"stack\";\n this.orientation = options?.orientation ?? \"vertical\";\n this.direction = options?.direction ?? \"ltr\";\n }\n\n private getCollection(): Iterable<CollectionNodeLike> {\n return typeof this.collection === \"function\"\n ? (this.collection as () => Iterable<CollectionNodeLike>)()\n : this.collection;\n }\n\n private getPrimaryStart(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect): number {\n return this.layout === \"stack\" ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect): number {\n return this.layout === \"stack\" ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect): number {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n private getItemKeys(): Array<string | number> {\n return [...this.getCollection()].filter((item) => item.type === \"item\").map((item) => item.key);\n }\n\n private resolveBoundaryTarget(\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n const keys = this.getItemKeys();\n if (keys.length === 0) return null;\n const key = direction === \"next\" ? keys[0] : keys[keys.length - 1];\n const order: Array<\"before\" | \"on\" | \"after\"> =\n direction === \"next\" ? [\"before\", \"on\", \"after\"] : [\"after\", \"on\", \"before\"];\n for (const dropPosition of order) {\n const target: DropTarget = { type: \"item\", key, dropPosition };\n if (isValidDropTarget(target)) return target;\n }\n return null;\n }\n\n private resolveTransitionTarget(\n target: DropTarget,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (target.type !== \"item\") return null;\n const tryPosition = (dropPosition: \"before\" | \"on\" | \"after\"): DropTarget | null => {\n if (target.dropPosition === dropPosition) return null;\n const nextTarget: DropTarget = {\n type: \"item\",\n key: target.key,\n dropPosition,\n };\n return isValidDropTarget(nextTarget) ? nextTarget : null;\n };\n\n if (direction === \"next\") {\n if (target.dropPosition === \"before\") {\n return tryPosition(\"on\") ?? tryPosition(\"after\");\n }\n if (target.dropPosition === \"on\") {\n return tryPosition(\"after\");\n }\n } else {\n if (target.dropPosition === \"after\") {\n return tryPosition(\"on\") ?? tryPosition(\"before\");\n }\n if (target.dropPosition === \"on\") {\n return tryPosition(\"before\");\n }\n }\n\n return null;\n }\n\n private resolveNeighborTarget(\n target: DropTarget,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (target.type !== \"item\") return null;\n const keys = this.getItemKeys();\n const index = keys.findIndex((key) => key === target.key);\n if (index < 0) return this.resolveBoundaryTarget(direction, isValidDropTarget);\n const nextIndex = direction === \"next\" ? index + 1 : index - 1;\n if (nextIndex < 0 || nextIndex >= keys.length) {\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const key = keys[nextIndex];\n const order: Array<\"on\" | \"before\" | \"after\"> =\n direction === \"next\" ? [\"on\", \"before\", \"after\"] : [\"on\", \"after\", \"before\"];\n for (const dropPosition of order) {\n const nextTarget: DropTarget = { type: \"item\", key, dropPosition };\n if (isValidDropTarget(nextTarget)) return nextTarget;\n }\n return null;\n }\n\n getKeyboardNavigationTarget(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (!target || target.type === \"root\") {\n return this.resolveBoundaryTarget(direction, isValidDropTarget);\n }\n const transition = this.resolveTransitionTarget(target, direction, isValidDropTarget);\n if (transition) return transition;\n return this.resolveNeighborTarget(target, direction, isValidDropTarget);\n }\n\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget {\n const root = this.ref();\n if (!root) {\n return { type: \"root\" };\n }\n\n const allItems = [...this.getCollection()].filter((item) => item.type === \"item\");\n if (allItems.length === 0) {\n return { type: \"root\" };\n }\n\n const collectionId = root.dataset.collection;\n const selector = collectionId ? `[data-collection=\"${cssEscape(collectionId)}\"]` : \"[data-key]\";\n const elements = root.querySelectorAll(selector);\n const elementMap = new Map<string, HTMLElement>();\n for (const node of elements) {\n if (node instanceof HTMLElement && node.dataset.key != null) {\n elementMap.set(node.dataset.key, node);\n }\n }\n\n let low = 0;\n let high = allItems.length;\n const rootRect = root.getBoundingClientRect();\n let primary = this.orientation === \"horizontal\" ? x : y;\n let secondary = this.orientation === \"horizontal\" ? y : x;\n primary += this.getPrimaryStart(rootRect);\n secondary += this.getSecondaryStart(rootRect);\n\n const flow = this.layout === \"stack\" ? primary : secondary;\n const isPrimaryRtl = this.orientation === \"horizontal\" && this.direction === \"rtl\";\n const isSecondaryRtl =\n this.layout === \"grid\" && this.orientation === \"vertical\" && this.direction === \"rtl\";\n const isFlowRtl = this.layout === \"stack\" ? isPrimaryRtl : isSecondaryRtl;\n\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n const item = allItems[mid];\n const element = elementMap.get(String(item.key));\n if (!element) break;\n const rect = element.getBoundingClientRect();\n const update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRtl);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRtl);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRtl);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRtl);\n } else {\n const target: DropTarget = {\n type: \"item\",\n key: item.key,\n dropPosition: \"on\",\n };\n\n if (isValidDropTarget(target)) {\n if (\n flow <= this.getFlowStart(rect) + 5 &&\n isValidDropTarget({ ...target, dropPosition: \"before\" })\n ) {\n target.dropPosition = isFlowRtl ? \"after\" : \"before\";\n } else if (\n flow >= this.getFlowEnd(rect) - 5 &&\n isValidDropTarget({ ...target, dropPosition: \"after\" })\n ) {\n target.dropPosition = isFlowRtl ? \"before\" : \"after\";\n }\n } else {\n const midpoint = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= midpoint && isValidDropTarget({ ...target, dropPosition: \"before\" })) {\n target.dropPosition = isFlowRtl ? \"after\" : \"before\";\n } else if (flow >= midpoint && isValidDropTarget({ ...target, dropPosition: \"after\" })) {\n target.dropPosition = isFlowRtl ? \"before\" : \"after\";\n }\n }\n\n return target;\n }\n }\n\n const item = allItems[Math.min(low, allItems.length - 1)];\n const element = elementMap.get(String(item.key));\n const rect = element?.getBoundingClientRect();\n if (\n rect &&\n (primary < this.getPrimaryStart(rect) ||\n Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))\n ) {\n return {\n type: \"item\",\n key: item.key,\n dropPosition: isFlowRtl ? \"after\" : \"before\",\n };\n }\n\n return {\n type: \"item\",\n key: item.key,\n dropPosition: isFlowRtl ? \"before\" : \"after\",\n };\n }\n}\n","/**\n * Drag and drop compatibility hook for collection components.\n *\n * Mirrors RAC's `useDragAndDrop` shape while delegating to Solid\n * state and aria primitives.\n */\n\nimport type { Accessor, JSX } from \"solid-js\";\nimport { DragPreview } from \"./DragPreview\";\nimport { ListDropTargetDelegate } from \"./ListDropTargetDelegate\";\nimport {\n createDraggableCollection,\n createDraggableItem,\n createDroppableCollection,\n createDroppableItem,\n getGlobalDraggingCollectionRef,\n getGlobalDraggingKeys,\n type DraggableCollectionOptions,\n type DraggableCollectionAria,\n type DraggableItemOptions,\n type DraggableItemAria,\n type DroppableCollectionOptions,\n type DroppableCollectionAria,\n type DroppableItemOptions,\n type DroppableItemAria,\n type DropTargetDelegate as AriaDropTargetDelegate,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createDraggableCollectionState,\n createDroppableCollectionState,\n type DragItem,\n type DragPreviewRenderer,\n type DraggableCollectionProps,\n type DraggableCollectionState,\n type DraggableCollectionStateOptions,\n type DropTarget,\n type DroppableCollectionProps,\n type DroppableCollectionState,\n type DroppableCollectionStateOptions,\n} from \"@proyecto-viviana/solid-stately\";\n\ninterface DraggableCollectionStateOpts<T = object> extends Omit<\n DraggableCollectionStateOptions<T>,\n \"getItems\"\n> {\n items?: T[];\n}\n\ninterface DragHooks<T = object> {\n useDraggableCollectionState?: (\n props: DraggableCollectionStateOpts<T>,\n ) => DraggableCollectionState;\n useDraggableCollection?: (\n props: Omit<DraggableCollectionOptions, \"ref\">,\n state: DraggableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DraggableCollectionAria;\n useDraggableItem?: (\n props: DraggableItemOptions,\n state: DraggableCollectionState,\n ) => DraggableItemAria;\n DragPreview?: typeof DragPreview;\n renderDragPreview?: DragAndDropOptions<T>[\"renderDragPreview\"];\n isVirtualDragging?: () => boolean;\n}\n\ninterface DropHooks {\n useDroppableCollectionState?: (\n props: DroppableCollectionStateOptions,\n ) => DroppableCollectionState;\n useDroppableCollection?: (\n props: Omit<DroppableCollectionOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DroppableCollectionAria;\n useDroppableItem?: (\n options: Omit<DroppableItemOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DroppableItemAria;\n useDropIndicator?: (\n props: { target: DropTarget },\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => {\n dropIndicatorProps: JSX.HTMLAttributes<HTMLElement>;\n isDropTarget: boolean;\n isHidden: boolean;\n };\n renderDropIndicator?: (target: DropTarget) => JSX.Element;\n dropTargetDelegate?: AriaDropTargetDelegate;\n ListDropTargetDelegate?: typeof ListDropTargetDelegate;\n}\n\nexport type DragAndDropHooks<T = object> = DragHooks<T> & DropHooks;\n\nexport interface DragAndDrop<T = object> {\n /** Drag and drop hooks for the collection element. */\n dragAndDropHooks: DragAndDropHooks<T>;\n}\n\nexport interface DragAndDropOptions<T = object>\n extends Partial<Omit<DraggableCollectionProps<T>, \"preview\">>, Partial<DroppableCollectionProps> {\n /**\n * Optional keyboard delegate forwarded to the collection droppable hook.\n */\n keyboardDelegate?: DroppableCollectionOptions[\"keyboardDelegate\"];\n /**\n * Optional keydown handler composed with collection droppable keyboard behavior.\n */\n onKeyDown?: DroppableCollectionOptions[\"onKeyDown\"];\n /**\n * A function that returns the items being dragged.\n * If omitted, draggable hooks are not added.\n */\n getItems?: (keys: Set<string | number>, items: T[]) => DragItem[];\n /**\n * Optional custom drag preview renderer.\n */\n renderDragPreview?: (\n items: DragItem[],\n ) => JSX.Element | { element: JSX.Element; x: number; y: number };\n /**\n * Optional drop indicator renderer for collection components.\n */\n renderDropIndicator?: (target: DropTarget) => JSX.Element;\n /**\n * Optional custom drop target delegate.\n */\n dropTargetDelegate?: AriaDropTargetDelegate;\n /**\n * Optional drag preview ref.\n */\n preview?: { current: DragPreviewRenderer | null };\n /**\n * Optional item snapshot used by draggable state `getItems`.\n */\n items?: T[];\n /**\n * Disable both drag and drop behavior.\n */\n isDisabled?: boolean;\n}\n\n/**\n * Provides hooks to enable drag-and-drop behavior for collection components.\n */\nexport function useDragAndDrop<T = object>(options: DragAndDropOptions<T> = {}): DragAndDrop<T> {\n const {\n getItems,\n onDrop,\n onInsert,\n onItemDrop,\n onReorder,\n onMove,\n onRootDrop,\n renderDragPreview,\n renderDropIndicator,\n dropTargetDelegate,\n } = options;\n\n const isDraggable = typeof getItems === \"function\";\n const isDroppable = Boolean(\n onDrop || onInsert || onItemDrop || onReorder || onMove || onRootDrop,\n );\n\n const hooks: DragAndDropHooks<T> = {};\n const hasDom = typeof HTMLElement !== \"undefined\";\n const isElementNode = (value: unknown): value is HTMLElement => {\n if (!value) return false;\n if (hasDom && value instanceof HTMLElement) return true;\n return typeof value === \"object\" && (value as { nodeType?: number }).nodeType === 1;\n };\n const resolvedPreview =\n options.preview ??\n (renderDragPreview\n ? {\n current: (\n items: DragItem[],\n callback: (node: HTMLElement | null, x?: number, y?: number) => void,\n ) => {\n const rendered = renderDragPreview(items);\n if (!rendered) {\n callback(null);\n return;\n }\n if (typeof rendered === \"object\" && rendered !== null && \"element\" in rendered) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(\n isElementNode(previewValue.element) ? previewValue.element : null,\n previewValue.x,\n previewValue.y,\n );\n return;\n }\n callback(isElementNode(rendered) ? rendered : null);\n },\n }\n : undefined);\n\n if (isDraggable && getItems) {\n hooks.useDraggableCollectionState = (props: DraggableCollectionStateOpts<T>) => {\n return createDraggableCollectionState<T>(() => ({\n onDragStart: options.onDragStart ?? props.onDragStart,\n onDragMove: options.onDragMove ?? props.onDragMove,\n onDragEnd: options.onDragEnd ?? props.onDragEnd,\n getAllowedDropOperations:\n options.getAllowedDropOperations ?? props.getAllowedDropOperations,\n isDisabled: options.isDisabled ?? props.isDisabled,\n preview: resolvedPreview ?? props.preview,\n getItems: (keys) => {\n const sourceItems = props.items ?? options.items ?? [];\n return getItems(keys, sourceItems);\n },\n }));\n };\n hooks.useDraggableCollection = (\n props: Omit<DraggableCollectionOptions, \"ref\">,\n state: DraggableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => createDraggableCollection({ ...props, ref }, state);\n hooks.useDraggableItem = (props, state) => createDraggableItem(() => props, state);\n hooks.DragPreview = DragPreview;\n hooks.renderDragPreview = renderDragPreview;\n hooks.isVirtualDragging = () =>\n getGlobalDraggingCollectionRef() != null || getGlobalDraggingKeys().size > 0;\n }\n\n if (isDroppable) {\n hooks.useDroppableCollectionState = (props: DroppableCollectionStateOptions) => {\n return createDroppableCollectionState(() => ({\n acceptedDragTypes: options.acceptedDragTypes ?? props.acceptedDragTypes,\n getDropOperation: options.getDropOperation ?? props.getDropOperation,\n onDropEnter: options.onDropEnter ?? props.onDropEnter,\n onDropActivate: options.onDropActivate ?? props.onDropActivate,\n onDropExit: options.onDropExit ?? props.onDropExit,\n onDrop: options.onDrop ?? props.onDrop,\n onInsert: options.onInsert ?? props.onInsert,\n onRootDrop: options.onRootDrop ?? props.onRootDrop,\n onItemDrop: options.onItemDrop ?? props.onItemDrop,\n onReorder: options.onReorder ?? props.onReorder,\n onMove: options.onMove ?? props.onMove,\n shouldAcceptItemDrop: options.shouldAcceptItemDrop ?? props.shouldAcceptItemDrop,\n isDisabled: options.isDisabled ?? props.isDisabled,\n }));\n };\n hooks.useDroppableCollection = (\n props: Omit<DroppableCollectionOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => {\n const acceptedDragTypes = options.acceptedDragTypes ?? props.acceptedDragTypes;\n const normalizedAcceptedDragTypes =\n acceptedDragTypes === \"all\"\n ? \"all\"\n : acceptedDragTypes?.filter(\n (type): type is string | symbol =>\n typeof type === \"string\" || typeof type === \"symbol\",\n );\n return createDroppableCollection(\n () => ({\n ref,\n dropTargetDelegate: options.dropTargetDelegate ?? props.dropTargetDelegate,\n keyboardDelegate: options.keyboardDelegate ?? props.keyboardDelegate,\n onKeyDown: options.onKeyDown ?? props.onKeyDown,\n acceptedDragTypes: normalizedAcceptedDragTypes,\n isDisabled: options.isDisabled ?? props.isDisabled,\n onDropActivate: (e) => {\n (options.onDropActivate ?? props.onDropActivate)?.({\n type: \"dropactivate\",\n target: e.target,\n x: e.x,\n y: e.y,\n });\n },\n onDrop: (e) => {\n (options.onDrop ?? props.onDrop)?.({\n type: \"drop\",\n target: e.target,\n x: e.x,\n y: e.y,\n items: e.items,\n dropOperation: e.dropOperation,\n });\n },\n onRootDrop: options.onRootDrop ?? props.onRootDrop,\n onItemDrop: (e) => {\n if (e.target.type === \"item\") {\n (options.onItemDrop ?? props.onItemDrop)?.({\n items: e.items,\n target: e.target,\n dropOperation: e.dropOperation,\n isInternal: e.isInternal,\n });\n }\n },\n onInsert: (e) => {\n if (e.target.type === \"item\") {\n (options.onInsert ?? props.onInsert)?.({\n items: e.items,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n onReorder: (e) => {\n if (e.target.type === \"item\") {\n (options.onReorder ?? props.onReorder)?.({\n keys: e.keys,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n onMove: (e) => {\n if (e.target.type === \"item\") {\n (options.onMove ?? props.onMove)?.({\n keys: e.keys,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n }),\n state,\n );\n };\n hooks.useDroppableItem = (\n props: Omit<DroppableItemOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => createDroppableItem(() => ({ ...props, ref }), state);\n hooks.useDropIndicator = (\n props: { target: DropTarget },\n state: DroppableCollectionState,\n _ref: Accessor<HTMLElement | null>,\n ) => {\n const target = props.target;\n const activeTarget = state.target;\n const isDropTarget =\n activeTarget?.type === target.type &&\n (target.type === \"root\" ||\n (activeTarget.type === \"item\" &&\n target.type === \"item\" &&\n activeTarget.key === target.key &&\n activeTarget.dropPosition === target.dropPosition));\n return {\n dropIndicatorProps: {\n role: \"option\",\n \"aria-disabled\": true,\n \"aria-hidden\": isDropTarget ? undefined : \"true\",\n tabIndex: -1,\n \"data-drop-target\": isDropTarget ? \"\" : undefined,\n },\n isDropTarget,\n isHidden: !isDropTarget,\n };\n };\n hooks.renderDropIndicator = renderDropIndicator;\n hooks.dropTargetDelegate = dropTargetDelegate;\n hooks.ListDropTargetDelegate = ListDropTargetDelegate;\n }\n\n return {\n dragAndDropHooks: hooks,\n };\n}\n"],"mappings":";;;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ACN,iBAAiB;KACjB,eAAe,eAAe,KAAA,IAAY;KAC1C,UAAU;KACV,oBAAoB,eAAe,KAAK,KAAA;IAC1C;IACA;IACA,UAAU,CAAC;GACb;EACF;EACA,MAAM,sBAAsB;EAC5B,MAAM,qBAAqB;EAC3B,MAAM,yBAAyB;CACjC;CAEA,OAAO,EACL,kBAAkB,MACpB;AACF"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Utility functions for solidaria-components
|
|
3
3
|
* Port of react-aria-components/src/utils.tsx
|
|
4
4
|
*/
|
|
5
|
-
import { type JSX, type Accessor, type
|
|
5
|
+
import { type JSX, type Accessor, type Context, type FlowComponent } from "solid-js";
|
|
6
6
|
/**
|
|
7
7
|
* Render props pattern - children can be a function that receives state
|
|
8
8
|
*/
|
|
@@ -53,6 +53,19 @@ export interface RenderPropsResult<T> {
|
|
|
53
53
|
* {renderProps.renderChildren()}
|
|
54
54
|
*/
|
|
55
55
|
renderChildren: () => JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Render a render-prop child ONCE over a reactive view of the values,
|
|
58
|
+
* mirroring how React reconciles a render prop's returned tree in place.
|
|
59
|
+
*
|
|
60
|
+
* Prefer this over `renderChildren()` for interactive leaf components (a
|
|
61
|
+
* Tab, a toggle segment) whose child wraps the pressable element: re-invoking
|
|
62
|
+
* the render function on every values() change recreates that DOM subtree,
|
|
63
|
+
* which detaches the pointer/press target mid-gesture and makes the browser
|
|
64
|
+
* suppress the native `click` (createPress then has to synthesize an
|
|
65
|
+
* untrusted fallback click — a visible parity break vs React). Static (non
|
|
66
|
+
* function) children are returned untouched, exactly like `renderChildren`.
|
|
67
|
+
*/
|
|
68
|
+
renderChildrenStable: () => JSX.Element;
|
|
56
69
|
/** The raw children prop (function or JSX) - use renderChildren() in most cases */
|
|
57
70
|
children: RenderChildren<T> | undefined;
|
|
58
71
|
/** The render props values accessor */
|
|
@@ -71,22 +84,81 @@ export declare function useRenderProps<T extends object>(props: RenderPropsBase<
|
|
|
71
84
|
defaultClassName?: string;
|
|
72
85
|
}, values: Accessor<T>): RenderPropsResult<T>;
|
|
73
86
|
export declare function composeRenderProps<T extends object>(base: RenderPropsBase<T> | undefined, override: RenderPropsBase<T> | undefined): RenderPropsBase<T>;
|
|
87
|
+
/** A Solid ref target: a callback, a mutable `{ current }` object, or undefined. */
|
|
88
|
+
export type RefLike<T> = T | ((el: T) => void) | {
|
|
89
|
+
current?: T | null;
|
|
90
|
+
} | undefined;
|
|
91
|
+
/** A value paired with an optional ref to merge onto the consuming element. */
|
|
92
|
+
export type WithRef<T, E> = T & {
|
|
93
|
+
ref?: RefLike<E>;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* A context value carrying named slots (mirrors react-aria-components'
|
|
97
|
+
* `SlottedValue`). Each entry under `slots` is the props object delivered to the
|
|
98
|
+
* component rendered with the matching `slot` name.
|
|
99
|
+
*/
|
|
100
|
+
export interface SlottedValue<T> {
|
|
101
|
+
slots?: Record<string, T>;
|
|
102
|
+
}
|
|
103
|
+
/** A slotted context value: a slots record, a bare value, or null/undefined. */
|
|
104
|
+
export type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;
|
|
74
105
|
/**
|
|
75
|
-
*
|
|
106
|
+
* The value type for a context consumed via {@link useContextProps}. Mirrors
|
|
107
|
+
* upstream `ContextValue<T, E>`: it may carry `slots` and an optional `ref` to
|
|
108
|
+
* merge onto the consuming element.
|
|
76
109
|
*/
|
|
77
|
-
export type ContextValue<T> = T
|
|
110
|
+
export type ContextValue<T, E = HTMLElement> = SlottedContextValue<WithRef<T, E>>;
|
|
78
111
|
/**
|
|
79
|
-
* Creates a context
|
|
112
|
+
* Creates a context that can carry either a bare value or a `slots` record.
|
|
80
113
|
*/
|
|
81
|
-
export declare function createSlottedContext<T>():
|
|
114
|
+
export declare function createSlottedContext<T>(): Context<SlottedContextValue<T>>;
|
|
115
|
+
/** Assigns an element to a Solid ref (callback or mutable `{ current }` object). */
|
|
116
|
+
export declare function assignRef<T>(ref: RefLike<T>, el: T): void;
|
|
117
|
+
/** Merges multiple Solid refs into one callback that forwards to each, once. */
|
|
118
|
+
export declare function mergeRefs<T>(...refs: Array<RefLike<T>>): (el: T) => void;
|
|
82
119
|
/**
|
|
83
|
-
*
|
|
120
|
+
* Resolves a (possibly slotted) context value for the given slot name. Port of
|
|
121
|
+
* react-aria-components' `useSlottedContext`:
|
|
122
|
+
* - `slot === null` opts out of the context entirely (returns `null`);
|
|
123
|
+
* - if the context carries a `slots` record, the entry for `slot` (or
|
|
124
|
+
* {@link DEFAULT_SLOT}) is returned, throwing on an unknown slot name;
|
|
125
|
+
* - otherwise the bare context value is returned.
|
|
126
|
+
*/
|
|
127
|
+
export declare function useSlottedContext<T>(context: Context<SlottedContextValue<T>>, slot?: string | null): T | null | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Merges context-provided props and a context ref into a component's own props
|
|
130
|
+
* and ref. Port of react-aria-components' `useContextProps`:
|
|
131
|
+
* - the context is resolved for `props.slot` via {@link useSlottedContext};
|
|
132
|
+
* - props win over context props (handler props are chained by `mergeProps`);
|
|
133
|
+
* - the component's own ref and the context's ref merge into one callback.
|
|
134
|
+
*
|
|
135
|
+
* The prop merge stays reactive (Solid `mergeProps` preserves getters), so prop
|
|
136
|
+
* changes keep flowing; the context value is read once at setup, matching a single
|
|
137
|
+
* upstream render.
|
|
84
138
|
*/
|
|
85
|
-
export declare function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
139
|
+
export declare function useContextProps<TProps extends SlotProps, TRef>(props: TProps, ref: RefLike<TRef>, context: Context<ContextValue<TProps, TRef>>): [TProps, (el: TRef) => void];
|
|
140
|
+
/**
|
|
141
|
+
* Detects whether slotted content was rendered into a placeholder, for the
|
|
142
|
+
* aria-label fallback pattern. Port of react-aria-components' `useSlot`: returns a
|
|
143
|
+
* ref callback to attach to the placeholder and an accessor that is `true` while
|
|
144
|
+
* an element is mounted there. The accessor flips to `false` after mount if the
|
|
145
|
+
* ref never ran (no slotted content was provided).
|
|
146
|
+
*/
|
|
147
|
+
export declare function useSlot(initialState?: boolean): [(el: Element | null) => void, Accessor<boolean>];
|
|
148
|
+
/**
|
|
149
|
+
* Nests a set of context providers around `children`. Port of
|
|
150
|
+
* react-aria-components' `Provider`: each `[Context, value]` pair wraps the
|
|
151
|
+
* previous result, so the LAST pair is the outermost provider — matching upstream's
|
|
152
|
+
* wrap-in-iteration-order.
|
|
153
|
+
*
|
|
154
|
+
* `children` is read through a lazy getter inside the innermost provider so child
|
|
155
|
+
* components are *created* within every provider's owner; Solid binds `useContext`
|
|
156
|
+
* at component-execution time, so eager children would miss these providers.
|
|
157
|
+
*/
|
|
158
|
+
export declare function Provider(props: {
|
|
159
|
+
values: Array<[Context<unknown>, unknown]>;
|
|
160
|
+
children: JSX.Element;
|
|
161
|
+
}): JSX.Element;
|
|
90
162
|
/**
|
|
91
163
|
* Converts boolean state values to data attributes
|
|
92
164
|
*/
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAUnB,MAAM,UAAU,CAAC;AAIlB;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,MAAM,GAAG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