@vuu-ui/vuu-ui-controls 2.1.18 → 2.1.19-beta.2
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/package.json +14 -17
- package/src/calendar/Calendar.css.js +10 -0
- package/src/calendar/Calendar.js +70 -0
- package/src/calendar/index.js +4 -0
- package/src/calendar/internal/CalendarCarousel.css.js +19 -0
- package/src/calendar/internal/CalendarCarousel.js +73 -0
- package/src/calendar/internal/CalendarContext.js +9 -0
- package/src/calendar/internal/CalendarDay.css.js +116 -0
- package/{esm → src}/calendar/internal/CalendarDay.js +33 -53
- package/src/calendar/internal/CalendarMonth.css.js +13 -0
- package/src/calendar/internal/CalendarMonth.js +43 -0
- package/src/calendar/internal/CalendarNavigation.css.js +24 -0
- package/src/calendar/internal/CalendarNavigation.js +185 -0
- package/src/calendar/internal/CalendarWeekHeader.css.js +23 -0
- package/src/calendar/internal/CalendarWeekHeader.js +31 -0
- package/src/calendar/internal/useFocusManagement.js +66 -0
- package/src/calendar/internal/utils.js +57 -0
- package/src/calendar/useCalendar.js +116 -0
- package/src/calendar/useCalendarDay.js +74 -0
- package/src/calendar/useSelection.js +202 -0
- package/src/column-picker/ColumnPicker.css.js +8 -0
- package/src/column-picker/ColumnPicker.js +108 -0
- package/src/column-picker/ColumnSearch.css.js +61 -0
- package/src/column-picker/ColumnSearch.js +66 -0
- package/src/column-picker/index.js +2 -0
- package/src/column-picker/moving-window.js +49 -0
- package/src/common-hooks/index.js +3 -0
- package/src/common-hooks/selectionTypes.js +8 -0
- package/src/common-hooks/use-resize-observer.js +122 -0
- package/src/common-hooks/useControlled.js +45 -0
- package/src/context-panel-provider/ContextPanelProvider.js +80 -0
- package/src/cycle-state-button/CycleStateButton.js +30 -0
- package/src/cycle-state-button/index.js +1 -0
- package/src/date-input/DateInput.css.js +195 -0
- package/src/date-input/DateInput.js +210 -0
- package/src/date-input/index.js +1 -0
- package/src/date-picker/DatePicker.js +137 -0
- package/src/date-picker/DatePickerContext.js +20 -0
- package/src/date-picker/DatePickerPanel.css.js +25 -0
- package/src/date-picker/DatePickerPanel.js +124 -0
- package/src/date-picker/index.js +1 -0
- package/src/drag-drop/DragDropProvider.js +123 -0
- package/src/drag-drop/DragDropState.js +25 -0
- package/src/drag-drop/Draggable.css.js +57 -0
- package/src/drag-drop/Draggable.js +77 -0
- package/src/drag-drop/DropIndicator.css.js +11 -0
- package/src/drag-drop/DropIndicator.js +28 -0
- package/{esm → src}/drag-drop/dragDropTypes.js +0 -2
- package/src/drag-drop/drop-target-utils.js +199 -0
- package/src/drag-drop/index.js +6 -0
- package/src/drag-drop/useAutoScroll.js +53 -0
- package/src/drag-drop/useDragDisplacers.js +126 -0
- package/src/drag-drop/useDragDrop.js +435 -0
- package/src/drag-drop/useDragDropCopy.js +22 -0
- package/src/drag-drop/useDragDropIndicator.js +182 -0
- package/src/drag-drop/useDragDropNaturalMovement.js +205 -0
- package/src/drag-drop/useDropIndicator.js +21 -0
- package/src/drag-drop/useGlobalDragDrop.js +67 -0
- package/src/drag-drop/useTransition.js +11 -0
- package/src/editable/index.js +1 -0
- package/src/editable/useEditableText.js +199 -0
- package/src/editable-label/EditableLabel.css.js +81 -0
- package/src/editable-label/EditableLabel.js +125 -0
- package/src/editable-label/index.js +1 -0
- package/src/expando-input/ExpandoInput.css.js +67 -0
- package/src/expando-input/ExpandoInput.js +40 -0
- package/src/expando-input/index.js +1 -0
- package/src/highlighter/Highlighter.css.js +8 -0
- package/src/highlighter/Highlighter.js +27 -0
- package/src/highlighter/index.js +1 -0
- package/src/hover-overlay/HoverOverlay.js +92 -0
- package/src/icon-button/Icon.css.js +8 -0
- package/src/icon-button/Icon.js +26 -0
- package/src/icon-button/IconButton.css.js +10 -0
- package/src/icon-button/IconButton.js +28 -0
- package/src/icon-button/ToggleIconButton.css.js +47 -0
- package/src/icon-button/ToggleIconButton.js +26 -0
- package/src/icon-button/index.js +3 -0
- package/src/index.js +31 -0
- package/src/instrument-picker/SearchCell.css.js +17 -0
- package/src/instrument-picker/SearchCell.js +29 -0
- package/src/instrument-picker/TablePicker.css.js +23 -0
- package/src/instrument-picker/TablePicker.js +89 -0
- package/src/instrument-picker/index.js +1 -0
- package/src/instrument-picker/moving-window.js +49 -0
- package/src/instrument-picker/useDataSource.js +38 -0
- package/src/instrument-picker/useTablePicker.js +136 -0
- package/src/measured-container/MeasuredContainer.css.js +11 -0
- package/src/measured-container/MeasuredContainer.js +50 -0
- package/src/measured-container/index.js +2 -0
- package/src/measured-container/useMeasuredContainer.js +156 -0
- package/src/modal-provider/ModalProvider.js +147 -0
- package/src/overflow-container/OverflowContainer.css.js +135 -0
- package/src/overflow-container/OverflowContainer.js +87 -0
- package/src/overflow-container/index.js +2 -0
- package/src/overflow-container/overflow-utils.js +211 -0
- package/src/overflow-container/useOverflowContainer.js +108 -0
- package/src/price-ticker/PriceTicker.css.js +32 -0
- package/src/price-ticker/PriceTicker.js +51 -0
- package/src/price-ticker/index.js +1 -0
- package/src/prompt/Prompt.css.js +48 -0
- package/src/prompt/Prompt.js +112 -0
- package/src/sortable-list/SortableList.js +39 -0
- package/src/split-button/SplitButton.css.js +117 -0
- package/src/split-button/SplitButton.js +60 -0
- package/src/split-button/SplitStateButton.css.js +66 -0
- package/src/split-button/SplitStateButton.js +23 -0
- package/src/split-button/index.js +2 -0
- package/src/split-button/useSplitButton.js +61 -0
- package/src/table-search/SearchCell.css.js +20 -0
- package/src/table-search/SearchCell.js +26 -0
- package/src/table-search/TableSearch.css.js +27 -0
- package/src/table-search/TableSearch.js +81 -0
- package/src/table-search/index.js +1 -0
- package/src/table-search/moving-window.js +49 -0
- package/src/table-search/useTableSearch.js +30 -0
- package/src/tabs-next/TabBar.css.js +26 -0
- package/src/tabs-next/TabBar.js +27 -0
- package/src/tabs-next/TabListNext.css.js +36 -0
- package/src/tabs-next/TabListNext.js +94 -0
- package/src/tabs-next/TabNext.css.js +76 -0
- package/src/tabs-next/TabNext.js +91 -0
- package/src/tabs-next/TabNextAction.js +26 -0
- package/src/tabs-next/TabNextContext.js +14 -0
- package/src/tabs-next/TabNextPanel.css.js +17 -0
- package/src/tabs-next/TabNextPanel.js +69 -0
- package/src/tabs-next/TabNextTrigger.css.js +22 -0
- package/src/tabs-next/TabNextTrigger.js +66 -0
- package/src/tabs-next/TabOverflowList.css.js +77 -0
- package/src/tabs-next/TabOverflowList.js +115 -0
- package/src/tabs-next/TabsNext.js +149 -0
- package/src/tabs-next/TabsNextContext.js +28 -0
- package/src/tabs-next/hooks/useCollection.js +80 -0
- package/src/tabs-next/hooks/useFocusOutside.js +23 -0
- package/src/tabs-next/hooks/useOverflow.js +118 -0
- package/src/tabs-next/index.js +7 -0
- package/src/tabstrip/Tab.css.js +148 -0
- package/src/tabstrip/Tab.js +107 -0
- package/src/tabstrip/TabMenu.css.js +8 -0
- package/src/tabstrip/TabMenu.js +48 -0
- package/src/tabstrip/TabMenuOptions.js +14 -0
- package/src/tabstrip/TabsTypes.js +0 -0
- package/src/tabstrip/Tabstrip.css.js +121 -0
- package/src/tabstrip/Tabstrip.js +106 -0
- package/src/tabstrip/ThemeTabstrip.css.js +20 -0
- package/src/tabstrip/index.js +4 -0
- package/src/tabstrip/tabstrip-dom-utils.js +11 -0
- package/src/tabstrip/useAnimatedSelectionThumb.js +68 -0
- package/src/tabstrip/useKeyboardNavigation.js +191 -0
- package/src/tabstrip/useSelection.js +50 -0
- package/src/tabstrip/useTabstrip.js +181 -0
- package/src/time-input/MaskedInput.js +285 -0
- package/src/time-input/TimeInput.css.js +39 -0
- package/src/time-input/TimeInput.js +37 -0
- package/src/time-input/useTimeInput.js +82 -0
- package/src/toolbar/Toolbar.css.js +46 -0
- package/src/toolbar/Toolbar.js +62 -0
- package/src/toolbar/index.js +1 -0
- package/src/toolbar/toolbar-dom-utils.js +11 -0
- package/src/toolbar/useKeyboardNavigation.js +240 -0
- package/src/toolbar/useSelection.js +82 -0
- package/src/toolbar/useToolbar.js +73 -0
- package/src/utils/deprecated-types.js +0 -0
- package/{esm → src}/utils/escapeRegExp.js +1 -3
- package/src/utils/forwardCallbackProps.js +15 -0
- package/src/utils/index.js +5 -0
- package/src/utils/isOverflowElement.js +2 -0
- package/src/utils/isPlainObject.js +2 -0
- package/src/vuu-date-picker/VuuDatePicker.js +92 -0
- package/src/vuu-date-picker/index.js +1 -0
- package/src/vuu-input/VuuInput.css.js +13 -0
- package/src/vuu-input/VuuInput.js +85 -0
- package/src/vuu-input/index.js +1 -0
- package/src/vuu-time-picker/TimeRangePicker.js +0 -0
- package/src/vuu-time-picker/VuuTimePicker.css.js +14 -0
- package/src/vuu-time-picker/VuuTimePicker.js +26 -0
- package/src/vuu-typeahead-input/VuuTypeaheadInput.css.js +49 -0
- package/src/vuu-typeahead-input/VuuTypeaheadInput.js +46 -0
- package/src/vuu-typeahead-input/index.js +1 -0
- package/src/vuu-typeahead-input/useVuuTypeaheadInput.js +140 -0
- package/types/calendar/useCalendar.d.ts +3 -3
- package/types/calendar/useSelection.d.ts +1 -1
- package/types/date-input/DateInput.d.ts +1 -1
- package/types/date-picker/DatePicker.d.ts +1 -1
- package/types/date-picker/DatePickerContext.d.ts +2 -2
- package/types/date-picker/DatePickerPanel.d.ts +1 -1
- package/types/instrument-picker/useTablePicker.d.ts +4 -4
- package/types/split-button/useSplitButton.d.ts +120 -120
- package/types/tabs-next/hooks/useOverflow.d.ts +1 -1
- package/types/tabstrip/Tab.d.ts +1 -1
- package/types/tabstrip/useTabstrip.d.ts +1 -1
- package/types/toolbar/useToolbar.d.ts +1 -1
- package/cjs/calendar/Calendar.css.js +0 -6
- package/cjs/calendar/Calendar.css.js.map +0 -1
- package/cjs/calendar/Calendar.js +0 -93
- package/cjs/calendar/Calendar.js.map +0 -1
- package/cjs/calendar/internal/CalendarCarousel.css.js +0 -6
- package/cjs/calendar/internal/CalendarCarousel.css.js.map +0 -1
- package/cjs/calendar/internal/CalendarCarousel.js +0 -75
- package/cjs/calendar/internal/CalendarCarousel.js.map +0 -1
- package/cjs/calendar/internal/CalendarContext.js +0 -19
- package/cjs/calendar/internal/CalendarContext.js.map +0 -1
- package/cjs/calendar/internal/CalendarDay.css.js +0 -6
- package/cjs/calendar/internal/CalendarDay.css.js.map +0 -1
- package/cjs/calendar/internal/CalendarDay.js +0 -86
- package/cjs/calendar/internal/CalendarDay.js.map +0 -1
- package/cjs/calendar/internal/CalendarMonth.css.js +0 -6
- package/cjs/calendar/internal/CalendarMonth.css.js.map +0 -1
- package/cjs/calendar/internal/CalendarMonth.js +0 -71
- package/cjs/calendar/internal/CalendarMonth.js.map +0 -1
- package/cjs/calendar/internal/CalendarNavigation.css.js +0 -6
- package/cjs/calendar/internal/CalendarNavigation.css.js.map +0 -1
- package/cjs/calendar/internal/CalendarNavigation.js +0 -236
- package/cjs/calendar/internal/CalendarNavigation.js.map +0 -1
- package/cjs/calendar/internal/CalendarWeekHeader.css.js +0 -6
- package/cjs/calendar/internal/CalendarWeekHeader.css.js.map +0 -1
- package/cjs/calendar/internal/CalendarWeekHeader.js +0 -43
- package/cjs/calendar/internal/CalendarWeekHeader.js.map +0 -1
- package/cjs/calendar/internal/useFocusManagement.js +0 -66
- package/cjs/calendar/internal/useFocusManagement.js.map +0 -1
- package/cjs/calendar/internal/utils.js +0 -64
- package/cjs/calendar/internal/utils.js.map +0 -1
- package/cjs/calendar/useCalendar.js +0 -163
- package/cjs/calendar/useCalendar.js.map +0 -1
- package/cjs/calendar/useCalendarDay.js +0 -80
- package/cjs/calendar/useCalendarDay.js.map +0 -1
- package/cjs/calendar/useSelection.js +0 -248
- package/cjs/calendar/useSelection.js.map +0 -1
- package/cjs/column-picker/ColumnPicker.css.js +0 -6
- package/cjs/column-picker/ColumnPicker.css.js.map +0 -1
- package/cjs/column-picker/ColumnPicker.js +0 -128
- package/cjs/column-picker/ColumnPicker.js.map +0 -1
- package/cjs/column-picker/ColumnSearch.css.js +0 -6
- package/cjs/column-picker/ColumnSearch.css.js.map +0 -1
- package/cjs/column-picker/ColumnSearch.js +0 -82
- package/cjs/column-picker/ColumnSearch.js.map +0 -1
- package/cjs/common-hooks/selectionTypes.js +0 -18
- package/cjs/common-hooks/selectionTypes.js.map +0 -1
- package/cjs/common-hooks/use-resize-observer.js +0 -123
- package/cjs/common-hooks/use-resize-observer.js.map +0 -1
- package/cjs/common-hooks/useControlled.js +0 -58
- package/cjs/common-hooks/useControlled.js.map +0 -1
- package/cjs/context-panel-provider/ContextPanelProvider.js +0 -99
- package/cjs/context-panel-provider/ContextPanelProvider.js.map +0 -1
- package/cjs/cycle-state-button/CycleStateButton.js +0 -50
- package/cjs/cycle-state-button/CycleStateButton.js.map +0 -1
- package/cjs/date-input/DateInput.css.js +0 -6
- package/cjs/date-input/DateInput.css.js.map +0 -1
- package/cjs/date-input/DateInput.js +0 -277
- package/cjs/date-input/DateInput.js.map +0 -1
- package/cjs/date-picker/DatePicker.js +0 -169
- package/cjs/date-picker/DatePicker.js.map +0 -1
- package/cjs/date-picker/DatePickerContext.js +0 -26
- package/cjs/date-picker/DatePickerContext.js.map +0 -1
- package/cjs/date-picker/DatePickerPanel.css.js +0 -6
- package/cjs/date-picker/DatePickerPanel.css.js.map +0 -1
- package/cjs/date-picker/DatePickerPanel.js +0 -146
- package/cjs/date-picker/DatePickerPanel.js.map +0 -1
- package/cjs/drag-drop/DragDropProvider.js +0 -145
- package/cjs/drag-drop/DragDropProvider.js.map +0 -1
- package/cjs/drag-drop/DragDropState.js +0 -36
- package/cjs/drag-drop/DragDropState.js.map +0 -1
- package/cjs/drag-drop/Draggable.css.js +0 -6
- package/cjs/drag-drop/Draggable.css.js.map +0 -1
- package/cjs/drag-drop/Draggable.js +0 -90
- package/cjs/drag-drop/Draggable.js.map +0 -1
- package/cjs/drag-drop/dragDropTypes.js +0 -8
- package/cjs/drag-drop/dragDropTypes.js.map +0 -1
- package/cjs/drag-drop/drop-target-utils.js +0 -245
- package/cjs/drag-drop/drop-target-utils.js.map +0 -1
- package/cjs/drag-drop/useAutoScroll.js +0 -71
- package/cjs/drag-drop/useAutoScroll.js.map +0 -1
- package/cjs/drag-drop/useDragDisplacers.js +0 -160
- package/cjs/drag-drop/useDragDisplacers.js.map +0 -1
- package/cjs/drag-drop/useDragDrop.js +0 -504
- package/cjs/drag-drop/useDragDrop.js.map +0 -1
- package/cjs/drag-drop/useDragDropCopy.js +0 -34
- package/cjs/drag-drop/useDragDropCopy.js.map +0 -1
- package/cjs/drag-drop/useDragDropIndicator.js +0 -251
- package/cjs/drag-drop/useDragDropIndicator.js.map +0 -1
- package/cjs/drag-drop/useDragDropNaturalMovement.js +0 -265
- package/cjs/drag-drop/useDragDropNaturalMovement.js.map +0 -1
- package/cjs/drag-drop/useDropIndicator.js +0 -27
- package/cjs/drag-drop/useDropIndicator.js.map +0 -1
- package/cjs/drag-drop/useGlobalDragDrop.js +0 -89
- package/cjs/drag-drop/useGlobalDragDrop.js.map +0 -1
- package/cjs/editable/useEditableText.js +0 -211
- package/cjs/editable/useEditableText.js.map +0 -1
- package/cjs/editable-label/EditableLabel.css.js +0 -6
- package/cjs/editable-label/EditableLabel.css.js.map +0 -1
- package/cjs/editable-label/EditableLabel.js +0 -143
- package/cjs/editable-label/EditableLabel.js.map +0 -1
- package/cjs/expando-input/ExpandoInput.css.js +0 -6
- package/cjs/expando-input/ExpandoInput.css.js.map +0 -1
- package/cjs/expando-input/ExpandoInput.js +0 -53
- package/cjs/expando-input/ExpandoInput.js.map +0 -1
- package/cjs/hover-overlay/HoverOverlay.js +0 -96
- package/cjs/hover-overlay/HoverOverlay.js.map +0 -1
- package/cjs/icon-button/Icon.css.js +0 -6
- package/cjs/icon-button/Icon.css.js.map +0 -1
- package/cjs/icon-button/Icon.js +0 -37
- package/cjs/icon-button/Icon.js.map +0 -1
- package/cjs/icon-button/IconButton.css.js +0 -6
- package/cjs/icon-button/IconButton.css.js.map +0 -1
- package/cjs/icon-button/IconButton.js +0 -26
- package/cjs/icon-button/IconButton.js.map +0 -1
- package/cjs/icon-button/ToggleIconButton.css.js +0 -6
- package/cjs/icon-button/ToggleIconButton.css.js.map +0 -1
- package/cjs/icon-button/ToggleIconButton.js +0 -39
- package/cjs/icon-button/ToggleIconButton.js.map +0 -1
- package/cjs/index.js +0 -170
- package/cjs/index.js.map +0 -1
- package/cjs/instrument-picker/TablePicker.css.js +0 -6
- package/cjs/instrument-picker/TablePicker.css.js.map +0 -1
- package/cjs/instrument-picker/TablePicker.js +0 -130
- package/cjs/instrument-picker/TablePicker.js.map +0 -1
- package/cjs/instrument-picker/useTablePicker.js +0 -150
- package/cjs/instrument-picker/useTablePicker.js.map +0 -1
- package/cjs/measured-container/MeasuredContainer.css.js +0 -6
- package/cjs/measured-container/MeasuredContainer.css.js.map +0 -1
- package/cjs/measured-container/MeasuredContainer.js +0 -72
- package/cjs/measured-container/MeasuredContainer.js.map +0 -1
- package/cjs/measured-container/useMeasuredContainer.js +0 -167
- package/cjs/measured-container/useMeasuredContainer.js.map +0 -1
- package/cjs/modal-provider/ModalProvider.js +0 -143
- package/cjs/modal-provider/ModalProvider.js.map +0 -1
- package/cjs/overflow-container/OverflowContainer.css.js +0 -6
- package/cjs/overflow-container/OverflowContainer.css.js.map +0 -1
- package/cjs/overflow-container/OverflowContainer.js +0 -143
- package/cjs/overflow-container/OverflowContainer.js.map +0 -1
- package/cjs/overflow-container/overflow-utils.js +0 -286
- package/cjs/overflow-container/overflow-utils.js.map +0 -1
- package/cjs/overflow-container/useOverflowContainer.js +0 -143
- package/cjs/overflow-container/useOverflowContainer.js.map +0 -1
- package/cjs/price-ticker/PriceTicker.css.js +0 -6
- package/cjs/price-ticker/PriceTicker.css.js.map +0 -1
- package/cjs/price-ticker/PriceTicker.js +0 -50
- package/cjs/price-ticker/PriceTicker.js.map +0 -1
- package/cjs/prompt/Prompt.css.js +0 -6
- package/cjs/prompt/Prompt.css.js.map +0 -1
- package/cjs/prompt/Prompt.js +0 -142
- package/cjs/prompt/Prompt.js.map +0 -1
- package/cjs/sortable-list/SortableList.js +0 -37
- package/cjs/sortable-list/SortableList.js.map +0 -1
- package/cjs/split-button/SplitButton.css.js +0 -6
- package/cjs/split-button/SplitButton.css.js.map +0 -1
- package/cjs/split-button/SplitButton.js +0 -84
- package/cjs/split-button/SplitButton.js.map +0 -1
- package/cjs/split-button/SplitStateButton.css.js +0 -6
- package/cjs/split-button/SplitStateButton.css.js.map +0 -1
- package/cjs/split-button/SplitStateButton.js +0 -31
- package/cjs/split-button/SplitStateButton.js.map +0 -1
- package/cjs/split-button/useSplitButton.js +0 -84
- package/cjs/split-button/useSplitButton.js.map +0 -1
- package/cjs/table-search/SearchCell.css.js +0 -6
- package/cjs/table-search/SearchCell.css.js.map +0 -1
- package/cjs/table-search/SearchCell.js +0 -32
- package/cjs/table-search/SearchCell.js.map +0 -1
- package/cjs/table-search/TableSearch.css.js +0 -6
- package/cjs/table-search/TableSearch.css.js.map +0 -1
- package/cjs/table-search/TableSearch.js +0 -89
- package/cjs/table-search/TableSearch.js.map +0 -1
- package/cjs/table-search/useTableSearch.js +0 -39
- package/cjs/table-search/useTableSearch.js.map +0 -1
- package/cjs/tabs-next/TabBar.css.js +0 -6
- package/cjs/tabs-next/TabBar.css.js.map +0 -1
- package/cjs/tabs-next/TabBar.js +0 -41
- package/cjs/tabs-next/TabBar.js.map +0 -1
- package/cjs/tabs-next/TabListNext.css.js +0 -6
- package/cjs/tabs-next/TabListNext.css.js.map +0 -1
- package/cjs/tabs-next/TabListNext.js +0 -124
- package/cjs/tabs-next/TabListNext.js.map +0 -1
- package/cjs/tabs-next/TabNext.css.js +0 -6
- package/cjs/tabs-next/TabNext.css.js.map +0 -1
- package/cjs/tabs-next/TabNext.js +0 -110
- package/cjs/tabs-next/TabNext.js.map +0 -1
- package/cjs/tabs-next/TabNextAction.js +0 -35
- package/cjs/tabs-next/TabNextAction.js.map +0 -1
- package/cjs/tabs-next/TabNextContext.js +0 -23
- package/cjs/tabs-next/TabNextContext.js.map +0 -1
- package/cjs/tabs-next/TabNextPanel.css.js +0 -6
- package/cjs/tabs-next/TabNextPanel.css.js.map +0 -1
- package/cjs/tabs-next/TabNextPanel.js +0 -77
- package/cjs/tabs-next/TabNextPanel.js.map +0 -1
- package/cjs/tabs-next/TabNextTrigger.css.js +0 -6
- package/cjs/tabs-next/TabNextTrigger.css.js.map +0 -1
- package/cjs/tabs-next/TabNextTrigger.js +0 -74
- package/cjs/tabs-next/TabNextTrigger.js.map +0 -1
- package/cjs/tabs-next/TabOverflowList.css.js +0 -6
- package/cjs/tabs-next/TabOverflowList.css.js.map +0 -1
- package/cjs/tabs-next/TabOverflowList.js +0 -130
- package/cjs/tabs-next/TabOverflowList.js.map +0 -1
- package/cjs/tabs-next/TabsNext.js +0 -174
- package/cjs/tabs-next/TabsNext.js.map +0 -1
- package/cjs/tabs-next/TabsNextContext.js +0 -33
- package/cjs/tabs-next/TabsNextContext.js.map +0 -1
- package/cjs/tabs-next/hooks/useCollection.js +0 -91
- package/cjs/tabs-next/hooks/useCollection.js.map +0 -1
- package/cjs/tabs-next/hooks/useFocusOutside.js +0 -24
- package/cjs/tabs-next/hooks/useFocusOutside.js.map +0 -1
- package/cjs/tabs-next/hooks/useOverflow.js +0 -138
- package/cjs/tabs-next/hooks/useOverflow.js.map +0 -1
- package/cjs/tabstrip/Tab.css.js +0 -6
- package/cjs/tabstrip/Tab.css.js.map +0 -1
- package/cjs/tabstrip/Tab.js +0 -153
- package/cjs/tabstrip/Tab.js.map +0 -1
- package/cjs/tabstrip/TabMenu.css.js +0 -6
- package/cjs/tabstrip/TabMenu.css.js.map +0 -1
- package/cjs/tabstrip/TabMenu.js +0 -72
- package/cjs/tabstrip/TabMenu.js.map +0 -1
- package/cjs/tabstrip/TabMenuOptions.js +0 -20
- package/cjs/tabstrip/TabMenuOptions.js.map +0 -1
- package/cjs/tabstrip/Tabstrip.css.js +0 -6
- package/cjs/tabstrip/Tabstrip.css.js.map +0 -1
- package/cjs/tabstrip/Tabstrip.js +0 -160
- package/cjs/tabstrip/Tabstrip.js.map +0 -1
- package/cjs/tabstrip/tabstrip-dom-utils.js +0 -19
- package/cjs/tabstrip/tabstrip-dom-utils.js.map +0 -1
- package/cjs/tabstrip/useAnimatedSelectionThumb.js +0 -85
- package/cjs/tabstrip/useAnimatedSelectionThumb.js.map +0 -1
- package/cjs/tabstrip/useKeyboardNavigation.js +0 -247
- package/cjs/tabstrip/useKeyboardNavigation.js.map +0 -1
- package/cjs/tabstrip/useSelection.js +0 -60
- package/cjs/tabstrip/useSelection.js.map +0 -1
- package/cjs/tabstrip/useTabstrip.js +0 -233
- package/cjs/tabstrip/useTabstrip.js.map +0 -1
- package/cjs/time-input/MaskedInput.js +0 -377
- package/cjs/time-input/MaskedInput.js.map +0 -1
- package/cjs/time-input/TimeInput.css.js +0 -6
- package/cjs/time-input/TimeInput.css.js.map +0 -1
- package/cjs/time-input/TimeInput.js +0 -56
- package/cjs/time-input/TimeInput.js.map +0 -1
- package/cjs/time-input/useTimeInput.js +0 -121
- package/cjs/time-input/useTimeInput.js.map +0 -1
- package/cjs/toolbar/Toolbar.css.js +0 -6
- package/cjs/toolbar/Toolbar.css.js.map +0 -1
- package/cjs/toolbar/Toolbar.js +0 -90
- package/cjs/toolbar/Toolbar.js.map +0 -1
- package/cjs/toolbar/toolbar-dom-utils.js +0 -18
- package/cjs/toolbar/toolbar-dom-utils.js.map +0 -1
- package/cjs/toolbar/useKeyboardNavigation.js +0 -305
- package/cjs/toolbar/useKeyboardNavigation.js.map +0 -1
- package/cjs/toolbar/useSelection.js +0 -93
- package/cjs/toolbar/useSelection.js.map +0 -1
- package/cjs/toolbar/useToolbar.js +0 -100
- package/cjs/toolbar/useToolbar.js.map +0 -1
- package/cjs/utils/escapeRegExp.js +0 -9
- package/cjs/utils/escapeRegExp.js.map +0 -1
- package/cjs/utils/forwardCallbackProps.js +0 -22
- package/cjs/utils/forwardCallbackProps.js.map +0 -1
- package/cjs/utils/isOverflowElement.js +0 -8
- package/cjs/utils/isOverflowElement.js.map +0 -1
- package/cjs/utils/isPlainObject.js +0 -6
- package/cjs/utils/isPlainObject.js.map +0 -1
- package/cjs/vuu-date-picker/VuuDatePicker.js +0 -122
- package/cjs/vuu-date-picker/VuuDatePicker.js.map +0 -1
- package/cjs/vuu-input/VuuInput.css.js +0 -6
- package/cjs/vuu-input/VuuInput.css.js.map +0 -1
- package/cjs/vuu-input/VuuInput.js +0 -102
- package/cjs/vuu-input/VuuInput.js.map +0 -1
- package/cjs/vuu-time-picker/VuuTimePicker.css.js +0 -6
- package/cjs/vuu-time-picker/VuuTimePicker.css.js.map +0 -1
- package/cjs/vuu-time-picker/VuuTimePicker.js +0 -37
- package/cjs/vuu-time-picker/VuuTimePicker.js.map +0 -1
- package/cjs/vuu-typeahead-input/VuuTypeaheadInput.css.js +0 -6
- package/cjs/vuu-typeahead-input/VuuTypeaheadInput.css.js.map +0 -1
- package/cjs/vuu-typeahead-input/VuuTypeaheadInput.js +0 -80
- package/cjs/vuu-typeahead-input/VuuTypeaheadInput.js.map +0 -1
- package/cjs/vuu-typeahead-input/useVuuTypeaheadInput.js +0 -176
- package/cjs/vuu-typeahead-input/useVuuTypeaheadInput.js.map +0 -1
- package/esm/calendar/Calendar.css.js +0 -4
- package/esm/calendar/Calendar.css.js.map +0 -1
- package/esm/calendar/Calendar.js +0 -91
- package/esm/calendar/Calendar.js.map +0 -1
- package/esm/calendar/internal/CalendarCarousel.css.js +0 -4
- package/esm/calendar/internal/CalendarCarousel.css.js.map +0 -1
- package/esm/calendar/internal/CalendarCarousel.js +0 -73
- package/esm/calendar/internal/CalendarCarousel.js.map +0 -1
- package/esm/calendar/internal/CalendarContext.js +0 -16
- package/esm/calendar/internal/CalendarContext.js.map +0 -1
- package/esm/calendar/internal/CalendarDay.css.js +0 -4
- package/esm/calendar/internal/CalendarDay.css.js.map +0 -1
- package/esm/calendar/internal/CalendarDay.js.map +0 -1
- package/esm/calendar/internal/CalendarMonth.css.js +0 -4
- package/esm/calendar/internal/CalendarMonth.css.js.map +0 -1
- package/esm/calendar/internal/CalendarMonth.js +0 -69
- package/esm/calendar/internal/CalendarMonth.js.map +0 -1
- package/esm/calendar/internal/CalendarNavigation.css.js +0 -4
- package/esm/calendar/internal/CalendarNavigation.css.js.map +0 -1
- package/esm/calendar/internal/CalendarNavigation.js +0 -234
- package/esm/calendar/internal/CalendarNavigation.js.map +0 -1
- package/esm/calendar/internal/CalendarWeekHeader.css.js +0 -4
- package/esm/calendar/internal/CalendarWeekHeader.css.js.map +0 -1
- package/esm/calendar/internal/CalendarWeekHeader.js +0 -41
- package/esm/calendar/internal/CalendarWeekHeader.js.map +0 -1
- package/esm/calendar/internal/useFocusManagement.js +0 -64
- package/esm/calendar/internal/useFocusManagement.js.map +0 -1
- package/esm/calendar/internal/utils.js +0 -55
- package/esm/calendar/internal/utils.js.map +0 -1
- package/esm/calendar/useCalendar.js +0 -161
- package/esm/calendar/useCalendar.js.map +0 -1
- package/esm/calendar/useCalendarDay.js +0 -78
- package/esm/calendar/useCalendarDay.js.map +0 -1
- package/esm/calendar/useSelection.js +0 -243
- package/esm/calendar/useSelection.js.map +0 -1
- package/esm/column-picker/ColumnPicker.css.js +0 -4
- package/esm/column-picker/ColumnPicker.css.js.map +0 -1
- package/esm/column-picker/ColumnPicker.js +0 -126
- package/esm/column-picker/ColumnPicker.js.map +0 -1
- package/esm/column-picker/ColumnSearch.css.js +0 -4
- package/esm/column-picker/ColumnSearch.css.js.map +0 -1
- package/esm/column-picker/ColumnSearch.js +0 -80
- package/esm/column-picker/ColumnSearch.js.map +0 -1
- package/esm/common-hooks/selectionTypes.js +0 -10
- package/esm/common-hooks/selectionTypes.js.map +0 -1
- package/esm/common-hooks/use-resize-observer.js +0 -118
- package/esm/common-hooks/use-resize-observer.js.map +0 -1
- package/esm/common-hooks/useControlled.js +0 -56
- package/esm/common-hooks/useControlled.js.map +0 -1
- package/esm/context-panel-provider/ContextPanelProvider.js +0 -94
- package/esm/context-panel-provider/ContextPanelProvider.js.map +0 -1
- package/esm/cycle-state-button/CycleStateButton.js +0 -48
- package/esm/cycle-state-button/CycleStateButton.js.map +0 -1
- package/esm/date-input/DateInput.css.js +0 -4
- package/esm/date-input/DateInput.css.js.map +0 -1
- package/esm/date-input/DateInput.js +0 -275
- package/esm/date-input/DateInput.js.map +0 -1
- package/esm/date-picker/DatePicker.js +0 -167
- package/esm/date-picker/DatePicker.js.map +0 -1
- package/esm/date-picker/DatePickerContext.js +0 -23
- package/esm/date-picker/DatePickerContext.js.map +0 -1
- package/esm/date-picker/DatePickerPanel.css.js +0 -4
- package/esm/date-picker/DatePickerPanel.css.js.map +0 -1
- package/esm/date-picker/DatePickerPanel.js +0 -144
- package/esm/date-picker/DatePickerPanel.js.map +0 -1
- package/esm/drag-drop/DragDropProvider.js +0 -142
- package/esm/drag-drop/DragDropProvider.js.map +0 -1
- package/esm/drag-drop/DragDropState.js +0 -34
- package/esm/drag-drop/DragDropState.js.map +0 -1
- package/esm/drag-drop/Draggable.css.js +0 -4
- package/esm/drag-drop/Draggable.css.js.map +0 -1
- package/esm/drag-drop/Draggable.js +0 -85
- package/esm/drag-drop/Draggable.js.map +0 -1
- package/esm/drag-drop/dragDropTypes.js.map +0 -1
- package/esm/drag-drop/drop-target-utils.js +0 -228
- package/esm/drag-drop/drop-target-utils.js.map +0 -1
- package/esm/drag-drop/useAutoScroll.js +0 -69
- package/esm/drag-drop/useAutoScroll.js.map +0 -1
- package/esm/drag-drop/useDragDisplacers.js +0 -158
- package/esm/drag-drop/useDragDisplacers.js.map +0 -1
- package/esm/drag-drop/useDragDrop.js +0 -502
- package/esm/drag-drop/useDragDrop.js.map +0 -1
- package/esm/drag-drop/useDragDropCopy.js +0 -31
- package/esm/drag-drop/useDragDropCopy.js.map +0 -1
- package/esm/drag-drop/useDragDropIndicator.js +0 -249
- package/esm/drag-drop/useDragDropIndicator.js.map +0 -1
- package/esm/drag-drop/useDragDropNaturalMovement.js +0 -263
- package/esm/drag-drop/useDragDropNaturalMovement.js.map +0 -1
- package/esm/drag-drop/useDropIndicator.js +0 -25
- package/esm/drag-drop/useDropIndicator.js.map +0 -1
- package/esm/drag-drop/useGlobalDragDrop.js +0 -87
- package/esm/drag-drop/useGlobalDragDrop.js.map +0 -1
- package/esm/editable/useEditableText.js +0 -209
- package/esm/editable/useEditableText.js.map +0 -1
- package/esm/editable-label/EditableLabel.css.js +0 -4
- package/esm/editable-label/EditableLabel.css.js.map +0 -1
- package/esm/editable-label/EditableLabel.js +0 -140
- package/esm/editable-label/EditableLabel.js.map +0 -1
- package/esm/expando-input/ExpandoInput.css.js +0 -4
- package/esm/expando-input/ExpandoInput.css.js.map +0 -1
- package/esm/expando-input/ExpandoInput.js +0 -51
- package/esm/expando-input/ExpandoInput.js.map +0 -1
- package/esm/hover-overlay/HoverOverlay.js +0 -94
- package/esm/hover-overlay/HoverOverlay.js.map +0 -1
- package/esm/icon-button/Icon.css.js +0 -4
- package/esm/icon-button/Icon.css.js.map +0 -1
- package/esm/icon-button/Icon.js +0 -35
- package/esm/icon-button/Icon.js.map +0 -1
- package/esm/icon-button/IconButton.css.js +0 -4
- package/esm/icon-button/IconButton.css.js.map +0 -1
- package/esm/icon-button/IconButton.js +0 -24
- package/esm/icon-button/IconButton.js.map +0 -1
- package/esm/icon-button/ToggleIconButton.css.js +0 -4
- package/esm/icon-button/ToggleIconButton.css.js.map +0 -1
- package/esm/icon-button/ToggleIconButton.js +0 -37
- package/esm/icon-button/ToggleIconButton.js.map +0 -1
- package/esm/index.js +0 -59
- package/esm/index.js.map +0 -1
- package/esm/instrument-picker/TablePicker.css.js +0 -4
- package/esm/instrument-picker/TablePicker.css.js.map +0 -1
- package/esm/instrument-picker/TablePicker.js +0 -128
- package/esm/instrument-picker/TablePicker.js.map +0 -1
- package/esm/instrument-picker/useTablePicker.js +0 -148
- package/esm/instrument-picker/useTablePicker.js.map +0 -1
- package/esm/measured-container/MeasuredContainer.css.js +0 -4
- package/esm/measured-container/MeasuredContainer.css.js.map +0 -1
- package/esm/measured-container/MeasuredContainer.js +0 -70
- package/esm/measured-container/MeasuredContainer.js.map +0 -1
- package/esm/measured-container/useMeasuredContainer.js +0 -164
- package/esm/measured-container/useMeasuredContainer.js.map +0 -1
- package/esm/modal-provider/ModalProvider.js +0 -140
- package/esm/modal-provider/ModalProvider.js.map +0 -1
- package/esm/overflow-container/OverflowContainer.css.js +0 -4
- package/esm/overflow-container/OverflowContainer.css.js.map +0 -1
- package/esm/overflow-container/OverflowContainer.js +0 -141
- package/esm/overflow-container/OverflowContainer.js.map +0 -1
- package/esm/overflow-container/overflow-utils.js +0 -272
- package/esm/overflow-container/overflow-utils.js.map +0 -1
- package/esm/overflow-container/useOverflowContainer.js +0 -141
- package/esm/overflow-container/useOverflowContainer.js.map +0 -1
- package/esm/price-ticker/PriceTicker.css.js +0 -4
- package/esm/price-ticker/PriceTicker.css.js.map +0 -1
- package/esm/price-ticker/PriceTicker.js +0 -48
- package/esm/price-ticker/PriceTicker.js.map +0 -1
- package/esm/prompt/Prompt.css.js +0 -4
- package/esm/prompt/Prompt.css.js.map +0 -1
- package/esm/prompt/Prompt.js +0 -140
- package/esm/prompt/Prompt.js.map +0 -1
- package/esm/sortable-list/SortableList.js +0 -34
- package/esm/sortable-list/SortableList.js.map +0 -1
- package/esm/split-button/SplitButton.css.js +0 -4
- package/esm/split-button/SplitButton.css.js.map +0 -1
- package/esm/split-button/SplitButton.js +0 -82
- package/esm/split-button/SplitButton.js.map +0 -1
- package/esm/split-button/SplitStateButton.css.js +0 -4
- package/esm/split-button/SplitStateButton.css.js.map +0 -1
- package/esm/split-button/SplitStateButton.js +0 -29
- package/esm/split-button/SplitStateButton.js.map +0 -1
- package/esm/split-button/useSplitButton.js +0 -82
- package/esm/split-button/useSplitButton.js.map +0 -1
- package/esm/table-search/SearchCell.css.js +0 -4
- package/esm/table-search/SearchCell.css.js.map +0 -1
- package/esm/table-search/SearchCell.js +0 -30
- package/esm/table-search/SearchCell.js.map +0 -1
- package/esm/table-search/TableSearch.css.js +0 -4
- package/esm/table-search/TableSearch.css.js.map +0 -1
- package/esm/table-search/TableSearch.js +0 -87
- package/esm/table-search/TableSearch.js.map +0 -1
- package/esm/table-search/useTableSearch.js +0 -37
- package/esm/table-search/useTableSearch.js.map +0 -1
- package/esm/tabs-next/TabBar.css.js +0 -4
- package/esm/tabs-next/TabBar.css.js.map +0 -1
- package/esm/tabs-next/TabBar.js +0 -39
- package/esm/tabs-next/TabBar.js.map +0 -1
- package/esm/tabs-next/TabListNext.css.js +0 -4
- package/esm/tabs-next/TabListNext.css.js.map +0 -1
- package/esm/tabs-next/TabListNext.js +0 -122
- package/esm/tabs-next/TabListNext.js.map +0 -1
- package/esm/tabs-next/TabNext.css.js +0 -4
- package/esm/tabs-next/TabNext.css.js.map +0 -1
- package/esm/tabs-next/TabNext.js +0 -108
- package/esm/tabs-next/TabNext.js.map +0 -1
- package/esm/tabs-next/TabNextAction.js +0 -33
- package/esm/tabs-next/TabNextAction.js.map +0 -1
- package/esm/tabs-next/TabNextContext.js +0 -20
- package/esm/tabs-next/TabNextContext.js.map +0 -1
- package/esm/tabs-next/TabNextPanel.css.js +0 -4
- package/esm/tabs-next/TabNextPanel.css.js.map +0 -1
- package/esm/tabs-next/TabNextPanel.js +0 -75
- package/esm/tabs-next/TabNextPanel.js.map +0 -1
- package/esm/tabs-next/TabNextTrigger.css.js +0 -4
- package/esm/tabs-next/TabNextTrigger.css.js.map +0 -1
- package/esm/tabs-next/TabNextTrigger.js +0 -72
- package/esm/tabs-next/TabNextTrigger.js.map +0 -1
- package/esm/tabs-next/TabOverflowList.css.js +0 -4
- package/esm/tabs-next/TabOverflowList.css.js.map +0 -1
- package/esm/tabs-next/TabOverflowList.js +0 -128
- package/esm/tabs-next/TabOverflowList.js.map +0 -1
- package/esm/tabs-next/TabsNext.js +0 -172
- package/esm/tabs-next/TabsNext.js.map +0 -1
- package/esm/tabs-next/TabsNextContext.js +0 -30
- package/esm/tabs-next/TabsNextContext.js.map +0 -1
- package/esm/tabs-next/hooks/useCollection.js +0 -89
- package/esm/tabs-next/hooks/useCollection.js.map +0 -1
- package/esm/tabs-next/hooks/useFocusOutside.js +0 -22
- package/esm/tabs-next/hooks/useFocusOutside.js.map +0 -1
- package/esm/tabs-next/hooks/useOverflow.js +0 -136
- package/esm/tabs-next/hooks/useOverflow.js.map +0 -1
- package/esm/tabstrip/Tab.css.js +0 -4
- package/esm/tabstrip/Tab.css.js.map +0 -1
- package/esm/tabstrip/Tab.js +0 -151
- package/esm/tabstrip/Tab.js.map +0 -1
- package/esm/tabstrip/TabMenu.css.js +0 -4
- package/esm/tabstrip/TabMenu.css.js.map +0 -1
- package/esm/tabstrip/TabMenu.js +0 -70
- package/esm/tabstrip/TabMenu.js.map +0 -1
- package/esm/tabstrip/TabMenuOptions.js +0 -16
- package/esm/tabstrip/TabMenuOptions.js.map +0 -1
- package/esm/tabstrip/Tabstrip.css.js +0 -4
- package/esm/tabstrip/Tabstrip.css.js.map +0 -1
- package/esm/tabstrip/Tabstrip.js +0 -158
- package/esm/tabstrip/Tabstrip.js.map +0 -1
- package/esm/tabstrip/tabstrip-dom-utils.js +0 -16
- package/esm/tabstrip/tabstrip-dom-utils.js.map +0 -1
- package/esm/tabstrip/useAnimatedSelectionThumb.js +0 -83
- package/esm/tabstrip/useAnimatedSelectionThumb.js.map +0 -1
- package/esm/tabstrip/useKeyboardNavigation.js +0 -245
- package/esm/tabstrip/useKeyboardNavigation.js.map +0 -1
- package/esm/tabstrip/useSelection.js +0 -58
- package/esm/tabstrip/useSelection.js.map +0 -1
- package/esm/tabstrip/useTabstrip.js +0 -231
- package/esm/tabstrip/useTabstrip.js.map +0 -1
- package/esm/time-input/MaskedInput.js +0 -375
- package/esm/time-input/MaskedInput.js.map +0 -1
- package/esm/time-input/TimeInput.css.js +0 -4
- package/esm/time-input/TimeInput.css.js.map +0 -1
- package/esm/time-input/TimeInput.js +0 -54
- package/esm/time-input/TimeInput.js.map +0 -1
- package/esm/time-input/useTimeInput.js +0 -119
- package/esm/time-input/useTimeInput.js.map +0 -1
- package/esm/toolbar/Toolbar.css.js +0 -4
- package/esm/toolbar/Toolbar.css.js.map +0 -1
- package/esm/toolbar/Toolbar.js +0 -88
- package/esm/toolbar/Toolbar.js.map +0 -1
- package/esm/toolbar/toolbar-dom-utils.js +0 -15
- package/esm/toolbar/toolbar-dom-utils.js.map +0 -1
- package/esm/toolbar/useKeyboardNavigation.js +0 -303
- package/esm/toolbar/useKeyboardNavigation.js.map +0 -1
- package/esm/toolbar/useSelection.js +0 -91
- package/esm/toolbar/useSelection.js.map +0 -1
- package/esm/toolbar/useToolbar.js +0 -98
- package/esm/toolbar/useToolbar.js.map +0 -1
- package/esm/utils/escapeRegExp.js.map +0 -1
- package/esm/utils/forwardCallbackProps.js +0 -20
- package/esm/utils/forwardCallbackProps.js.map +0 -1
- package/esm/utils/isOverflowElement.js +0 -6
- package/esm/utils/isOverflowElement.js.map +0 -1
- package/esm/utils/isPlainObject.js +0 -4
- package/esm/utils/isPlainObject.js.map +0 -1
- package/esm/vuu-date-picker/VuuDatePicker.js +0 -120
- package/esm/vuu-date-picker/VuuDatePicker.js.map +0 -1
- package/esm/vuu-input/VuuInput.css.js +0 -4
- package/esm/vuu-input/VuuInput.css.js.map +0 -1
- package/esm/vuu-input/VuuInput.js +0 -100
- package/esm/vuu-input/VuuInput.js.map +0 -1
- package/esm/vuu-time-picker/VuuTimePicker.css.js +0 -4
- package/esm/vuu-time-picker/VuuTimePicker.css.js.map +0 -1
- package/esm/vuu-time-picker/VuuTimePicker.js +0 -35
- package/esm/vuu-time-picker/VuuTimePicker.js.map +0 -1
- package/esm/vuu-typeahead-input/VuuTypeaheadInput.css.js +0 -4
- package/esm/vuu-typeahead-input/VuuTypeaheadInput.css.js.map +0 -1
- package/esm/vuu-typeahead-input/VuuTypeaheadInput.js +0 -78
- package/esm/vuu-typeahead-input/VuuTypeaheadInput.js.map +0 -1
- package/esm/vuu-typeahead-input/useVuuTypeaheadInput.js +0 -174
- package/esm/vuu-typeahead-input/useVuuTypeaheadInput.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
import { dimensions } from "./drop-target-utils.js";
|
|
3
|
+
const useAutoScroll = ({ containerRef, onScrollingStopped, orientation = "vertical" })=>{
|
|
4
|
+
const scrollTimer = useRef(null);
|
|
5
|
+
const isScrolling = useRef(false);
|
|
6
|
+
const scrollPosRef = useRef(0);
|
|
7
|
+
const lastScrollDirectionRef = useRef("fwd");
|
|
8
|
+
const stopScrolling = useCallback((atEnd = false)=>{
|
|
9
|
+
if (null !== scrollTimer.current) {
|
|
10
|
+
clearTimeout(scrollTimer.current);
|
|
11
|
+
scrollTimer.current = null;
|
|
12
|
+
}
|
|
13
|
+
isScrolling.current = false;
|
|
14
|
+
onScrollingStopped?.(lastScrollDirectionRef.current, scrollPosRef.current, atEnd);
|
|
15
|
+
}, [
|
|
16
|
+
onScrollingStopped
|
|
17
|
+
]);
|
|
18
|
+
const startScrolling = useCallback((direction, scrollRate, scrollUnit = 100)=>{
|
|
19
|
+
const { current: container } = containerRef;
|
|
20
|
+
if (container) {
|
|
21
|
+
const { SCROLL_POS, SCROLL_SIZE, CLIENT_SIZE } = dimensions(orientation);
|
|
22
|
+
const { [SCROLL_POS]: scrollPos, [SCROLL_SIZE]: scrollSize, [CLIENT_SIZE]: clientSize } = container;
|
|
23
|
+
const maxScroll = "fwd" === direction ? scrollSize - clientSize - scrollPos : scrollPos;
|
|
24
|
+
const nextScroll = Math.min(maxScroll, scrollUnit);
|
|
25
|
+
if ("fwd" === direction) {
|
|
26
|
+
lastScrollDirectionRef.current = "fwd";
|
|
27
|
+
container[SCROLL_POS] = scrollPosRef.current = scrollPos + nextScroll;
|
|
28
|
+
} else {
|
|
29
|
+
lastScrollDirectionRef.current = "bwd";
|
|
30
|
+
container[SCROLL_POS] = scrollPosRef.current = scrollPos - nextScroll;
|
|
31
|
+
}
|
|
32
|
+
if (nextScroll === maxScroll) requestAnimationFrame(()=>{
|
|
33
|
+
stopScrolling(true);
|
|
34
|
+
});
|
|
35
|
+
else {
|
|
36
|
+
isScrolling.current = true;
|
|
37
|
+
scrollTimer.current = window.setTimeout(()=>{
|
|
38
|
+
startScrolling(direction, scrollRate, scrollUnit);
|
|
39
|
+
}, 100);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, [
|
|
43
|
+
containerRef,
|
|
44
|
+
orientation,
|
|
45
|
+
stopScrolling
|
|
46
|
+
]);
|
|
47
|
+
return {
|
|
48
|
+
isScrolling,
|
|
49
|
+
startScrolling,
|
|
50
|
+
stopScrolling
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export { useAutoScroll };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
2
|
+
import { createDragSpacer } from "./Draggable.js";
|
|
3
|
+
import { mutateDropTargetsSwitchDropTargetPosition } from "./drop-target-utils.js";
|
|
4
|
+
const useDragDisplacers = (orientation = "horizontal")=>{
|
|
5
|
+
const animationFrame = useRef(0);
|
|
6
|
+
const transitioning = useRef(false);
|
|
7
|
+
const spacers = useMemo(()=>[
|
|
8
|
+
createDragSpacer(transitioning),
|
|
9
|
+
createDragSpacer()
|
|
10
|
+
], []);
|
|
11
|
+
const animateTransition = useCallback((size, propertyName = "width")=>{
|
|
12
|
+
const [spacer1, spacer2] = spacers;
|
|
13
|
+
animationFrame.current = requestAnimationFrame(()=>{
|
|
14
|
+
transitioning.current = true;
|
|
15
|
+
spacer1.style.cssText = `${propertyName}: 0px`;
|
|
16
|
+
spacer2.style.cssText = `${propertyName}: ${size}px`;
|
|
17
|
+
spacers[0] = spacer2;
|
|
18
|
+
spacers[1] = spacer1;
|
|
19
|
+
});
|
|
20
|
+
}, [
|
|
21
|
+
spacers
|
|
22
|
+
]);
|
|
23
|
+
const clearSpacers = useCallback((useTransition = false)=>{
|
|
24
|
+
if (true === useTransition) {
|
|
25
|
+
const [spacer] = spacers;
|
|
26
|
+
const cleanup = ()=>{
|
|
27
|
+
spacer.removeEventListener("transitionend", cleanup);
|
|
28
|
+
clearSpacers();
|
|
29
|
+
};
|
|
30
|
+
const propertyName = "horizontal" === orientation ? "width" : "height";
|
|
31
|
+
spacer.addEventListener("transitionend", cleanup);
|
|
32
|
+
animateTransition(0, propertyName);
|
|
33
|
+
} else spacers.forEach((spacer)=>spacer.remove());
|
|
34
|
+
}, [
|
|
35
|
+
animateTransition,
|
|
36
|
+
orientation,
|
|
37
|
+
spacers
|
|
38
|
+
]);
|
|
39
|
+
const setTerminalSpacer = useCallback((container, position, size)=>{
|
|
40
|
+
clearSpacers();
|
|
41
|
+
const propertyName = "horizontal" === orientation ? "width" : "height";
|
|
42
|
+
const [spacer] = spacers;
|
|
43
|
+
spacer.style.cssText = `${propertyName}: ${size}px`;
|
|
44
|
+
if ("start" === position) container.firstChild?.before(spacer);
|
|
45
|
+
else container.lastChild?.after(spacer);
|
|
46
|
+
}, [
|
|
47
|
+
clearSpacers,
|
|
48
|
+
orientation,
|
|
49
|
+
spacers
|
|
50
|
+
]);
|
|
51
|
+
const cancelAnyPendingAnimation = useCallback(()=>{
|
|
52
|
+
if (animationFrame.current) {
|
|
53
|
+
cancelAnimationFrame(animationFrame.current);
|
|
54
|
+
animationFrame.current = 0;
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
57
|
+
const displaceItem = useCallback((dropTargets, dropTarget, size, useTransition = false, direction = "static")=>{
|
|
58
|
+
if (dropTarget) {
|
|
59
|
+
const propertyName = "horizontal" === orientation ? "width" : "height";
|
|
60
|
+
const [spacer1, spacer2] = spacers;
|
|
61
|
+
cancelAnyPendingAnimation();
|
|
62
|
+
if (useTransition) {
|
|
63
|
+
if (transitioning.current) {
|
|
64
|
+
clearSpacers();
|
|
65
|
+
spacer1.style.cssText = `${propertyName}: ${size}px`;
|
|
66
|
+
spacer2.style.cssText = `${propertyName}: 0px`;
|
|
67
|
+
if ("fwd" === direction) {
|
|
68
|
+
dropTarget.element.before(spacer1);
|
|
69
|
+
dropTarget.element.after(spacer2);
|
|
70
|
+
} else {
|
|
71
|
+
dropTarget.element.after(spacer1);
|
|
72
|
+
dropTarget.element.before(spacer2);
|
|
73
|
+
}
|
|
74
|
+
} else if ("fwd" === direction) dropTarget.element.after(spacer2);
|
|
75
|
+
else dropTarget.element.before(spacer2);
|
|
76
|
+
animateTransition(size, propertyName);
|
|
77
|
+
} else if ("static" === direction) {
|
|
78
|
+
spacer1.style.cssText = `${propertyName}: ${size}px`;
|
|
79
|
+
dropTarget.element.before(spacer1);
|
|
80
|
+
} else throw Error("useDragDisplacers currently only supports noTransition for static displacement");
|
|
81
|
+
if ("static" !== direction) mutateDropTargetsSwitchDropTargetPosition(dropTargets, direction);
|
|
82
|
+
return "bwd" === direction ? dropTarget.index : dropTarget.index + 1;
|
|
83
|
+
}
|
|
84
|
+
return -1;
|
|
85
|
+
}, [
|
|
86
|
+
animateTransition,
|
|
87
|
+
cancelAnyPendingAnimation,
|
|
88
|
+
clearSpacers,
|
|
89
|
+
orientation,
|
|
90
|
+
spacers
|
|
91
|
+
]);
|
|
92
|
+
const displaceLastItem = useCallback((dropTargets, dropTarget, size, useTransition = false, direction = "static")=>{
|
|
93
|
+
const propertyName = "horizontal" === orientation ? "width" : "height";
|
|
94
|
+
const [spacer1, spacer2] = spacers;
|
|
95
|
+
cancelAnyPendingAnimation();
|
|
96
|
+
if (useTransition) {
|
|
97
|
+
if (transitioning.current) {
|
|
98
|
+
clearSpacers();
|
|
99
|
+
spacer1.style.cssText = `${propertyName}: ${size}px`;
|
|
100
|
+
spacer2.style.cssText = `${propertyName}: 0px`;
|
|
101
|
+
dropTarget.element.before(spacer1);
|
|
102
|
+
dropTarget.element.after(spacer2);
|
|
103
|
+
} else if ("fwd" === direction) dropTarget.element.after(spacer2);
|
|
104
|
+
else dropTarget.element.before(spacer2);
|
|
105
|
+
animateTransition(size, propertyName);
|
|
106
|
+
} else {
|
|
107
|
+
spacer1.style.cssText = `${propertyName}: ${size}px`;
|
|
108
|
+
dropTarget.element.after(spacer1);
|
|
109
|
+
}
|
|
110
|
+
if ("static" !== direction) mutateDropTargetsSwitchDropTargetPosition(dropTargets, direction);
|
|
111
|
+
return dropTarget.index;
|
|
112
|
+
}, [
|
|
113
|
+
animateTransition,
|
|
114
|
+
cancelAnyPendingAnimation,
|
|
115
|
+
clearSpacers,
|
|
116
|
+
orientation,
|
|
117
|
+
spacers
|
|
118
|
+
]);
|
|
119
|
+
return {
|
|
120
|
+
displaceItem,
|
|
121
|
+
displaceLastItem,
|
|
122
|
+
clearSpacers,
|
|
123
|
+
setTerminalSpacer
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export { useDragDisplacers };
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { dispatchCustomEvent } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { useDragDropProvider } from "./DragDropProvider.js";
|
|
5
|
+
import { DragDropState } from "./DragDropState.js";
|
|
6
|
+
import { Draggable } from "./Draggable.js";
|
|
7
|
+
import { NOT_OVERFLOWED, cloneElement, constrainRect, dimensions, getScrollableContainer, isContainerScrollable } from "./drop-target-utils.js";
|
|
8
|
+
import { useAutoScroll } from "./useAutoScroll.js";
|
|
9
|
+
import { NULL_DROP_OPTIONS, useDragDropCopy } from "./useDragDropCopy.js";
|
|
10
|
+
import { useDragDropIndicator } from "./useDragDropIndicator.js";
|
|
11
|
+
import { useDragDropNaturalMovement } from "./useDragDropNaturalMovement.js";
|
|
12
|
+
import { isOverflowElement } from "../utils/index.js";
|
|
13
|
+
const NULL_DRAG_DROP_RESULT = {
|
|
14
|
+
beginDrag: ()=>void 0,
|
|
15
|
+
drag: ()=>void 0,
|
|
16
|
+
draggableRef: {
|
|
17
|
+
current: null
|
|
18
|
+
},
|
|
19
|
+
drop: ()=>NULL_DROP_OPTIONS,
|
|
20
|
+
isDragging: false,
|
|
21
|
+
isScrolling: false,
|
|
22
|
+
handleScrollStart: ()=>void 0,
|
|
23
|
+
handleScrollStop: ()=>void 0,
|
|
24
|
+
revealOverflowedItems: false
|
|
25
|
+
};
|
|
26
|
+
const UNBOUNDED = {
|
|
27
|
+
start: 0,
|
|
28
|
+
end: 1000,
|
|
29
|
+
contraStart: 0,
|
|
30
|
+
contraEnd: 1000
|
|
31
|
+
};
|
|
32
|
+
const noDragDrop = ()=>NULL_DRAG_DROP_RESULT;
|
|
33
|
+
const dragThreshold = 3;
|
|
34
|
+
const getDraggableElement = (el, query)=>el?.closest(query);
|
|
35
|
+
const getLastElement = (container, itemQuery)=>{
|
|
36
|
+
const fullItemQuery = `:is(${itemQuery}${NOT_OVERFLOWED},.vuuOverflowContainer-OverflowIndicator)`;
|
|
37
|
+
const childElements = Array.from(container.querySelectorAll(fullItemQuery));
|
|
38
|
+
const lastElement = childElements.pop();
|
|
39
|
+
return [
|
|
40
|
+
lastElement,
|
|
41
|
+
isOverflowElement(lastElement)
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
const useDragDrop = ({ allowDragDrop, containerRef, draggableClassName, getDragPayload, id, itemQuery = "*", onDragStart, onDrop, onDropSettle, orientation, scrollingContainerRef, ...dragDropProps })=>{
|
|
45
|
+
const dragBoundaries = useRef({
|
|
46
|
+
start: 0,
|
|
47
|
+
end: 0,
|
|
48
|
+
contraStart: 0,
|
|
49
|
+
contraEnd: 0
|
|
50
|
+
});
|
|
51
|
+
const [draggableStatus, setDraggableStatus] = useState({
|
|
52
|
+
draggable: void 0,
|
|
53
|
+
draggedItemIndex: -1,
|
|
54
|
+
isDragging: false
|
|
55
|
+
});
|
|
56
|
+
const dragDropStateRef = useRef(null);
|
|
57
|
+
const mouseDownTimer = useRef(null);
|
|
58
|
+
const isScrollableRef = useRef(false);
|
|
59
|
+
const mousedownElementRef = useRef(null);
|
|
60
|
+
const mousePosRef = useRef({
|
|
61
|
+
x: 0,
|
|
62
|
+
y: 0
|
|
63
|
+
});
|
|
64
|
+
const startPosRef = useRef({
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0
|
|
67
|
+
});
|
|
68
|
+
const settlingItemRef = useRef(null);
|
|
69
|
+
const scrollableContainerRef = useRef(null);
|
|
70
|
+
const dropPosRef = useRef(-1);
|
|
71
|
+
const dropIndexRef = useRef(-1);
|
|
72
|
+
const handleScrollStopRef = useRef(void 0);
|
|
73
|
+
const { isDragSource, isDropTarget, onDragOut, onEndOfDragOperation, register } = useDragDropProvider(id);
|
|
74
|
+
const dragMouseMoveHandlerRef = useRef(void 0);
|
|
75
|
+
const dragMouseUpHandlerRef = useRef(void 0);
|
|
76
|
+
const attachDragHandlers = useCallback(()=>{
|
|
77
|
+
const { current: dragMove } = dragMouseMoveHandlerRef;
|
|
78
|
+
const { current: dragUp } = dragMouseUpHandlerRef;
|
|
79
|
+
if (dragMove && dragUp) {
|
|
80
|
+
document.addEventListener("mousemove", dragMove, false);
|
|
81
|
+
document.addEventListener("mouseup", dragUp, false);
|
|
82
|
+
}
|
|
83
|
+
}, []);
|
|
84
|
+
const removeDragHandlers = useCallback(()=>{
|
|
85
|
+
const { current: dragMove } = dragMouseMoveHandlerRef;
|
|
86
|
+
const { current: dragUp } = dragMouseUpHandlerRef;
|
|
87
|
+
if (dragMove && dragUp) {
|
|
88
|
+
document.removeEventListener("mousemove", dragMove, false);
|
|
89
|
+
document.removeEventListener("mouseup", dragUp, false);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
92
|
+
const setDragBoundaries = useCallback((containerRect, draggableRect)=>{
|
|
93
|
+
const { current: container } = containerRef;
|
|
94
|
+
if (container) {
|
|
95
|
+
const [lastElement, lastItemIsOverflowIndicator] = getLastElement(container, itemQuery);
|
|
96
|
+
const { CONTRA, CONTRA_END, DIMENSION, END, START } = dimensions(orientation);
|
|
97
|
+
const draggableSize = draggableRect[DIMENSION];
|
|
98
|
+
const { [START]: lastItemStart, [END]: lastItemEnd } = lastElement.getBoundingClientRect();
|
|
99
|
+
dragBoundaries.current.start = containerRect[START];
|
|
100
|
+
dragBoundaries.current.end = lastItemIsOverflowIndicator ? Math.max(lastItemStart, containerRect.right - draggableSize) : isScrollableRef.current ? containerRect[START] + containerRect[DIMENSION] - draggableSize : lastItemEnd - draggableSize;
|
|
101
|
+
dragBoundaries.current.contraStart = containerRect[CONTRA];
|
|
102
|
+
dragBoundaries.current.contraEnd = containerRect[CONTRA_END];
|
|
103
|
+
}
|
|
104
|
+
}, [
|
|
105
|
+
containerRef,
|
|
106
|
+
itemQuery,
|
|
107
|
+
orientation
|
|
108
|
+
]);
|
|
109
|
+
const terminateDrag = useCallback(()=>{
|
|
110
|
+
const { current: settlingItem } = settlingItemRef;
|
|
111
|
+
settlingItemRef.current = null;
|
|
112
|
+
const { current: toIndex } = dropIndexRef;
|
|
113
|
+
const droppedItem = containerRef.current?.querySelector(`${itemQuery}[data-index="${toIndex}"]`);
|
|
114
|
+
if (droppedItem) droppedItem.classList.remove("vuuDropTarget-settling");
|
|
115
|
+
dropIndexRef.current = -1;
|
|
116
|
+
onDropSettle?.(toIndex);
|
|
117
|
+
setDraggableStatus((status)=>({
|
|
118
|
+
...status,
|
|
119
|
+
draggable: void 0
|
|
120
|
+
}));
|
|
121
|
+
if (settlingItem) dispatchCustomEvent(settlingItem, "vuu-dropped");
|
|
122
|
+
}, [
|
|
123
|
+
containerRef,
|
|
124
|
+
itemQuery,
|
|
125
|
+
onDropSettle
|
|
126
|
+
]);
|
|
127
|
+
const getScrollDirection = useCallback((mousePos)=>{
|
|
128
|
+
if (scrollableContainerRef.current && dragDropStateRef.current) {
|
|
129
|
+
const { mouseOffset } = dragDropStateRef.current;
|
|
130
|
+
const { POS, SCROLL_POS, SCROLL_SIZE, CLIENT_SIZE } = dimensions(orientation);
|
|
131
|
+
const { [SCROLL_POS]: scrollPos, [SCROLL_SIZE]: scrollSize, [CLIENT_SIZE]: clientSize } = scrollableContainerRef.current;
|
|
132
|
+
const maxScroll = scrollSize - clientSize;
|
|
133
|
+
const canScrollFwd = scrollPos < maxScroll;
|
|
134
|
+
const viewportEnd = dragBoundaries.current.end;
|
|
135
|
+
const bwd = scrollPos > 0 && mousePos - mouseOffset[POS] <= dragBoundaries.current.start;
|
|
136
|
+
const fwd = canScrollFwd && mousePos - mouseOffset[POS] >= viewportEnd;
|
|
137
|
+
return bwd ? "bwd" : fwd ? "fwd" : "";
|
|
138
|
+
}
|
|
139
|
+
}, [
|
|
140
|
+
scrollableContainerRef,
|
|
141
|
+
orientation
|
|
142
|
+
]);
|
|
143
|
+
const useDragDropHook = true === allowDragDrop || "natural-movement" === allowDragDrop ? useDragDropNaturalMovement : "drop-indicator" === allowDragDrop ? useDragDropIndicator : "drag-copy" === allowDragDrop ? useDragDropCopy : noDragDrop;
|
|
144
|
+
const onScrollingStopped = useCallback((scrollDirection, scrollPos, atEnd)=>{
|
|
145
|
+
handleScrollStopRef.current?.(scrollDirection, scrollPos, atEnd);
|
|
146
|
+
}, []);
|
|
147
|
+
const { isScrolling, startScrolling, stopScrolling } = useAutoScroll({
|
|
148
|
+
containerRef: scrollableContainerRef,
|
|
149
|
+
onScrollingStopped,
|
|
150
|
+
orientation
|
|
151
|
+
});
|
|
152
|
+
const handleDrop = useCallback((options)=>{
|
|
153
|
+
dropPosRef.current = options.toIndex;
|
|
154
|
+
if (options.isExternal) onDrop?.({
|
|
155
|
+
...options,
|
|
156
|
+
payload: dragDropStateRef.current?.payload
|
|
157
|
+
});
|
|
158
|
+
else onDrop?.(options);
|
|
159
|
+
dropIndexRef.current = options.toIndex;
|
|
160
|
+
if (id) onEndOfDragOperation?.(id);
|
|
161
|
+
dragDropStateRef.current = null;
|
|
162
|
+
}, [
|
|
163
|
+
id,
|
|
164
|
+
onDrop,
|
|
165
|
+
onEndOfDragOperation
|
|
166
|
+
]);
|
|
167
|
+
const { beginDrag, drag, drop, handleScrollStart, handleScrollStop, releaseDrag, ...dragResult } = useDragDropHook({
|
|
168
|
+
...dragDropProps,
|
|
169
|
+
containerRef,
|
|
170
|
+
isDragSource,
|
|
171
|
+
isDropTarget,
|
|
172
|
+
itemQuery,
|
|
173
|
+
orientation
|
|
174
|
+
});
|
|
175
|
+
handleScrollStopRef.current = handleScrollStop;
|
|
176
|
+
const dragHandedOvertoProvider = useCallback((dragDistance, clientContraPos)=>{
|
|
177
|
+
const { CONTRA_POS } = dimensions(orientation);
|
|
178
|
+
const lastClientContraPos = mousePosRef.current[CONTRA_POS];
|
|
179
|
+
const dragOutDistance = isDragSource ? Math.abs(lastClientContraPos - clientContraPos) : 0;
|
|
180
|
+
if (true === allowDragDrop && !isDragSource && !isDropTarget) return false;
|
|
181
|
+
const handoverToProvider = false === isDropTarget || dragOutDistance - dragDistance > 5;
|
|
182
|
+
if (dragDropStateRef.current && handoverToProvider) {
|
|
183
|
+
if (onDragOut?.(id, dragDropStateRef.current)) {
|
|
184
|
+
removeDragHandlers();
|
|
185
|
+
releaseDrag?.();
|
|
186
|
+
dragDropStateRef.current = null;
|
|
187
|
+
}
|
|
188
|
+
dragBoundaries.current = UNBOUNDED;
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
}, [
|
|
192
|
+
allowDragDrop,
|
|
193
|
+
id,
|
|
194
|
+
isDragSource,
|
|
195
|
+
isDropTarget,
|
|
196
|
+
onDragOut,
|
|
197
|
+
orientation,
|
|
198
|
+
releaseDrag,
|
|
199
|
+
removeDragHandlers
|
|
200
|
+
]);
|
|
201
|
+
const dragMouseMoveHandler = useCallback((evt)=>{
|
|
202
|
+
const { CLIENT_POS, CONTRA_CLIENT_POS, POS } = dimensions(orientation);
|
|
203
|
+
const { clientX, clientY } = evt;
|
|
204
|
+
const { [CLIENT_POS]: clientPos, [CONTRA_CLIENT_POS]: clientContraPos } = evt;
|
|
205
|
+
const lastClientPos = mousePosRef.current[POS];
|
|
206
|
+
const dragDistance = Math.abs(lastClientPos - clientPos);
|
|
207
|
+
const { current: dragDropState } = dragDropStateRef;
|
|
208
|
+
const { current: boundary } = dragBoundaries;
|
|
209
|
+
if (dragHandedOvertoProvider(dragDistance, clientContraPos)) return;
|
|
210
|
+
mousePosRef.current.x = clientX;
|
|
211
|
+
mousePosRef.current.y = clientY;
|
|
212
|
+
if (dragDropState) {
|
|
213
|
+
const { draggableElement, mouseOffset } = dragDropState;
|
|
214
|
+
if (dragBoundaries.current === UNBOUNDED && draggableElement) {
|
|
215
|
+
const dragPosX = mousePosRef.current.x - mouseOffset.x;
|
|
216
|
+
const dragPosY = mousePosRef.current.y - mouseOffset.y;
|
|
217
|
+
draggableElement.style.top = `${dragPosY}px`;
|
|
218
|
+
draggableElement.style.left = `${dragPosX}px`;
|
|
219
|
+
} else if (dragDistance > 0 && draggableElement) {
|
|
220
|
+
const mouseMoveDirection = lastClientPos < clientPos ? "fwd" : "bwd";
|
|
221
|
+
const scrollDirection = getScrollDirection(clientPos);
|
|
222
|
+
const dragPos = mousePosRef.current[POS] - mouseOffset[POS];
|
|
223
|
+
const START = "horizontal" === orientation ? "left" : "top";
|
|
224
|
+
if (scrollDirection && isScrollableRef.current && !isScrolling.current) {
|
|
225
|
+
handleScrollStart?.(scrollDirection);
|
|
226
|
+
startScrolling(scrollDirection, 1);
|
|
227
|
+
if ("fwd" === scrollDirection) draggableElement.style[START] = `${boundary.end}px`;
|
|
228
|
+
else draggableElement.style[START] = `${boundary.start}px`;
|
|
229
|
+
} else if (!scrollDirection && isScrolling.current) stopScrolling();
|
|
230
|
+
if (!isScrolling.current) {
|
|
231
|
+
const renderDragPos = Math.round(Math.max(boundary.start, Math.min(boundary.end, dragPos)));
|
|
232
|
+
draggableElement.style[START] = `${renderDragPos}px`;
|
|
233
|
+
drag(renderDragPos, mouseMoveDirection);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, [
|
|
238
|
+
drag,
|
|
239
|
+
dragHandedOvertoProvider,
|
|
240
|
+
getScrollDirection,
|
|
241
|
+
handleScrollStart,
|
|
242
|
+
isScrolling,
|
|
243
|
+
orientation,
|
|
244
|
+
startScrolling,
|
|
245
|
+
stopScrolling
|
|
246
|
+
]);
|
|
247
|
+
const dragMouseUpHandler = useCallback(()=>{
|
|
248
|
+
removeDragHandlers();
|
|
249
|
+
if (dragDropStateRef.current) settlingItemRef.current = dragDropStateRef.current.draggableElement;
|
|
250
|
+
const dropOptions = drop();
|
|
251
|
+
handleDrop(dropOptions);
|
|
252
|
+
setDraggableStatus((status)=>({
|
|
253
|
+
...status,
|
|
254
|
+
draggedItemIndex: -1,
|
|
255
|
+
isDragging: false
|
|
256
|
+
}));
|
|
257
|
+
}, [
|
|
258
|
+
drop,
|
|
259
|
+
handleDrop,
|
|
260
|
+
removeDragHandlers
|
|
261
|
+
]);
|
|
262
|
+
dragMouseMoveHandlerRef.current = dragMouseMoveHandler;
|
|
263
|
+
dragMouseUpHandlerRef.current = dragMouseUpHandler;
|
|
264
|
+
const resumeDrag = useCallback((dragDropState)=>{
|
|
265
|
+
dragDropStateRef.current = dragDropState;
|
|
266
|
+
const { draggableElement, mouseOffset } = dragDropState;
|
|
267
|
+
const { current: container } = containerRef;
|
|
268
|
+
if (!container || !draggableElement) return false;
|
|
269
|
+
{
|
|
270
|
+
const containerRect = container.getBoundingClientRect();
|
|
271
|
+
const draggableRect = draggableElement.getBoundingClientRect();
|
|
272
|
+
setDragBoundaries(containerRect, draggableRect);
|
|
273
|
+
mousePosRef.current.x = draggableRect.left + mouseOffset.x;
|
|
274
|
+
mousePosRef.current.y = draggableRect.top + mouseOffset.y;
|
|
275
|
+
beginDrag(draggableElement);
|
|
276
|
+
attachDragHandlers();
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
}, [
|
|
280
|
+
attachDragHandlers,
|
|
281
|
+
beginDrag,
|
|
282
|
+
containerRef,
|
|
283
|
+
setDragBoundaries
|
|
284
|
+
]);
|
|
285
|
+
const dragStart = useCallback((mousePosition)=>{
|
|
286
|
+
const { current: container } = containerRef;
|
|
287
|
+
const { current: target } = mousedownElementRef;
|
|
288
|
+
const dragElement = getDraggableElement(target, itemQuery);
|
|
289
|
+
const scrollableContainer = scrollingContainerRef?.current ?? getScrollableContainer(container, itemQuery);
|
|
290
|
+
if (container && scrollableContainer && dragElement) {
|
|
291
|
+
isScrollableRef.current = isContainerScrollable(scrollableContainer, orientation);
|
|
292
|
+
scrollableContainerRef.current = scrollableContainer;
|
|
293
|
+
const containerRect = scrollableContainer.getBoundingClientRect();
|
|
294
|
+
const draggableRect = dragElement.getBoundingClientRect();
|
|
295
|
+
const dragDropState = dragDropStateRef.current = new DragDropState(mousePosition, dragElement);
|
|
296
|
+
setDragBoundaries(containerRect, draggableRect);
|
|
297
|
+
beginDrag(dragElement);
|
|
298
|
+
const { dataset: { index = "-1" } } = dragElement;
|
|
299
|
+
setDraggableStatus({
|
|
300
|
+
isDragging: true,
|
|
301
|
+
draggable: /*#__PURE__*/ jsx(Draggable, {
|
|
302
|
+
element: cloneElement(dragElement),
|
|
303
|
+
onDropped: terminateDrag,
|
|
304
|
+
onTransitionEnd: terminateDrag,
|
|
305
|
+
ref: dragDropState.setDraggable,
|
|
306
|
+
style: constrainRect(draggableRect, containerRect),
|
|
307
|
+
wrapperClassName: draggableClassName
|
|
308
|
+
}),
|
|
309
|
+
draggedItemIndex: parseInt(index)
|
|
310
|
+
});
|
|
311
|
+
onDragStart?.(dragDropState);
|
|
312
|
+
attachDragHandlers();
|
|
313
|
+
mousedownElementRef.current = null;
|
|
314
|
+
}
|
|
315
|
+
}, [
|
|
316
|
+
attachDragHandlers,
|
|
317
|
+
beginDrag,
|
|
318
|
+
containerRef,
|
|
319
|
+
draggableClassName,
|
|
320
|
+
itemQuery,
|
|
321
|
+
onDragStart,
|
|
322
|
+
orientation,
|
|
323
|
+
scrollingContainerRef,
|
|
324
|
+
setDragBoundaries,
|
|
325
|
+
terminateDrag
|
|
326
|
+
]);
|
|
327
|
+
const preDragMouseMoveHandler = useCallback((evt)=>{
|
|
328
|
+
const { current: mouseDownPosition } = startPosRef;
|
|
329
|
+
const { CLIENT_POS, POS } = dimensions(orientation);
|
|
330
|
+
const { [CLIENT_POS]: clientPos } = evt;
|
|
331
|
+
const mouseMoveDistance = Math.abs(clientPos - mouseDownPosition[POS]);
|
|
332
|
+
if (mouseMoveDistance > dragThreshold && containerRef.current) {
|
|
333
|
+
if (mouseDownTimer.current) {
|
|
334
|
+
window.clearTimeout(mouseDownTimer.current);
|
|
335
|
+
mouseDownTimer.current = null;
|
|
336
|
+
}
|
|
337
|
+
document.removeEventListener("mousemove", preDragMouseMoveHandler);
|
|
338
|
+
document.removeEventListener("mouseup", preDragMouseUpHandler, false);
|
|
339
|
+
const mousePosition = {
|
|
340
|
+
clientX: mouseDownPosition.x,
|
|
341
|
+
clientY: mouseDownPosition.y
|
|
342
|
+
};
|
|
343
|
+
dragStart(mousePosition);
|
|
344
|
+
}
|
|
345
|
+
}, [
|
|
346
|
+
containerRef,
|
|
347
|
+
beginDrag,
|
|
348
|
+
orientation
|
|
349
|
+
]);
|
|
350
|
+
const preDragMouseUpHandler = useCallback(()=>{
|
|
351
|
+
if (mouseDownTimer.current) {
|
|
352
|
+
window.clearTimeout(mouseDownTimer.current);
|
|
353
|
+
mouseDownTimer.current = null;
|
|
354
|
+
}
|
|
355
|
+
document.removeEventListener("mousemove", preDragMouseMoveHandler, false);
|
|
356
|
+
document.removeEventListener("mouseup", preDragMouseUpHandler, false);
|
|
357
|
+
}, [
|
|
358
|
+
preDragMouseMoveHandler
|
|
359
|
+
]);
|
|
360
|
+
const mouseDownHandler = useCallback((evt)=>{
|
|
361
|
+
if (0 !== evt.button) return;
|
|
362
|
+
const { current: container } = containerRef;
|
|
363
|
+
evt.stopPropagation();
|
|
364
|
+
if (container && !evt.defaultPrevented) {
|
|
365
|
+
const { clientX, clientY } = evt;
|
|
366
|
+
mousePosRef.current.x = startPosRef.current.x = clientX;
|
|
367
|
+
mousePosRef.current.y = startPosRef.current.y = clientY;
|
|
368
|
+
mousedownElementRef.current = evt.target;
|
|
369
|
+
const mousePosition = {
|
|
370
|
+
clientX,
|
|
371
|
+
clientY
|
|
372
|
+
};
|
|
373
|
+
document.addEventListener("mousemove", preDragMouseMoveHandler, false);
|
|
374
|
+
document.addEventListener("mouseup", preDragMouseUpHandler, false);
|
|
375
|
+
evt.persist();
|
|
376
|
+
mouseDownTimer.current = window.setTimeout(()=>{
|
|
377
|
+
document.removeEventListener("mousemove", preDragMouseMoveHandler, false);
|
|
378
|
+
document.removeEventListener("mouseup", preDragMouseUpHandler, false);
|
|
379
|
+
dragStart(mousePosition);
|
|
380
|
+
}, 500);
|
|
381
|
+
}
|
|
382
|
+
}, [
|
|
383
|
+
containerRef,
|
|
384
|
+
dragStart,
|
|
385
|
+
preDragMouseMoveHandler,
|
|
386
|
+
preDragMouseUpHandler
|
|
387
|
+
]);
|
|
388
|
+
const { current: settlingItem } = settlingItemRef;
|
|
389
|
+
useLayoutEffect(()=>{
|
|
390
|
+
if (settlingItem && containerRef.current) {
|
|
391
|
+
const dropPos = dropPosRef.current;
|
|
392
|
+
const droppedItem = containerRef.current.querySelector(`${itemQuery}[data-index="${dropPos}"]`);
|
|
393
|
+
if (droppedItem) {
|
|
394
|
+
droppedItem.classList.add("vuuDropTarget-settling");
|
|
395
|
+
requestAnimationFrame(()=>{
|
|
396
|
+
const { top: targetTop, left: targetLeft } = droppedItem.getBoundingClientRect();
|
|
397
|
+
const style = getComputedStyle(settlingItem);
|
|
398
|
+
const currentLeft = parseInt(style.getPropertyValue("left"));
|
|
399
|
+
const currentTop = parseInt(style.getPropertyValue("top"));
|
|
400
|
+
if (currentLeft !== targetLeft || currentTop !== targetTop) {
|
|
401
|
+
settlingItem.classList.add("vuuDraggable-settling");
|
|
402
|
+
settlingItem.style.top = `${targetTop}px`;
|
|
403
|
+
settlingItem.style.left = `${targetLeft}px`;
|
|
404
|
+
} else terminateDrag();
|
|
405
|
+
});
|
|
406
|
+
} else setDraggableStatus((status)=>({
|
|
407
|
+
...status,
|
|
408
|
+
draggable: void 0
|
|
409
|
+
}));
|
|
410
|
+
}
|
|
411
|
+
}, [
|
|
412
|
+
containerRef,
|
|
413
|
+
itemQuery,
|
|
414
|
+
settlingItem,
|
|
415
|
+
terminateDrag
|
|
416
|
+
]);
|
|
417
|
+
useEffect(()=>{
|
|
418
|
+
if (id && (isDragSource || isDropTarget)) register(id, "drop-only" === allowDragDrop ? false : resumeDrag, onDrop);
|
|
419
|
+
}, [
|
|
420
|
+
allowDragDrop,
|
|
421
|
+
id,
|
|
422
|
+
isDragSource,
|
|
423
|
+
isDropTarget,
|
|
424
|
+
onDrop,
|
|
425
|
+
register,
|
|
426
|
+
resumeDrag
|
|
427
|
+
]);
|
|
428
|
+
return {
|
|
429
|
+
...dragResult,
|
|
430
|
+
...draggableStatus,
|
|
431
|
+
isScrolling,
|
|
432
|
+
onMouseDown: allowDragDrop && "drop-only" !== allowDragDrop ? mouseDownHandler : void 0
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
export { useDragDrop };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
const NULL_DROP_OPTIONS = {
|
|
3
|
+
fromIndex: -1,
|
|
4
|
+
toIndex: -1
|
|
5
|
+
};
|
|
6
|
+
const useDragDropCopy = ({ selected, viewportRange })=>{
|
|
7
|
+
const rangeRef = useRef(void 0);
|
|
8
|
+
rangeRef.current = viewportRange;
|
|
9
|
+
const beginDrag = useCallback((dragElement)=>{
|
|
10
|
+
if (dragElement.ariaSelected && Array.isArray(selected) && selected.length > 1) console.log("its a selected element, and we have a multi select");
|
|
11
|
+
}, [
|
|
12
|
+
selected
|
|
13
|
+
]);
|
|
14
|
+
const drag = useCallback(()=>void 0, []);
|
|
15
|
+
const drop = useCallback(()=>NULL_DROP_OPTIONS, []);
|
|
16
|
+
return {
|
|
17
|
+
beginDrag,
|
|
18
|
+
drag,
|
|
19
|
+
drop
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { NULL_DROP_OPTIONS, useDragDropCopy };
|