From 1316af9553cdbcb619b4433ba50eea3911fd3ea8 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 5 Sep 2024 01:41:04 +0200 Subject: [PATCH] [UI] Added general-purpose drag-and-drop components. This is to bridge the gap between pointer-based and touch-based devices and provide a drag-and-drop implementation that exposes a consistent API for both the interfaces. These components work by wrapping an underlying draggable/droppable DOM element and proxying the event handlers consistently when drag/touch events are detected. This allows to listen to high-level drag/drop events even on touch-based interface based on touch start/move/end events. Example usage: ```vue ``` --- .../src/components/elements/Draggable.vue | 416 ++++++++++++++++++ .../src/components/elements/Droppable.vue | 174 ++++++++ 2 files changed, 590 insertions(+) create mode 100644 platypush/backend/http/webapp/src/components/elements/Draggable.vue create mode 100644 platypush/backend/http/webapp/src/components/elements/Droppable.vue diff --git a/platypush/backend/http/webapp/src/components/elements/Draggable.vue b/platypush/backend/http/webapp/src/components/elements/Draggable.vue new file mode 100644 index 0000000000..feb37e1899 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/elements/Draggable.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/elements/Droppable.vue b/platypush/backend/http/webapp/src/components/elements/Droppable.vue new file mode 100644 index 0000000000..530a177ea5 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/elements/Droppable.vue @@ -0,0 +1,174 @@ + + +