fluid-dnd 1.1.2-beta.0 → 1.2.0-beta.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/README.md +6 -1
- package/dist/{HandlerPublisher-CAhfY7Ch.js → HandlerPublisher-BrFNCUjc.js} +1 -1
- package/dist/{HandlerPublisher-BttKXTeA.cjs → HandlerPublisher-DIbGFZTl.cjs} +1 -1
- package/dist/core/configHandler.d.ts +3 -2
- package/dist/core/dragAndDrop.d.ts +4 -4
- package/dist/core/index.d.ts +6 -6
- package/dist/core/useDraggable.d.ts +3 -2
- package/dist/core/useDroppable.d.ts +3 -2
- package/dist/core/utils/GetStyles.d.ts +3 -2
- package/dist/core/utils/ParseStyles.d.ts +3 -2
- package/dist/core/utils/SetStyles.d.ts +2 -1
- package/dist/core/utils/SetTransform.d.ts +3 -2
- package/dist/core/utils/config.d.ts +3 -3
- package/dist/core/utils/droppableConfigurator.d.ts +4 -3
- package/dist/core/utils/events/emitEvents.d.ts +7 -6
- package/dist/core/utils/scroll.d.ts +3 -2
- package/dist/core/utils/tempChildren.d.ts +2 -1
- package/dist/core/utils/translate/GetTranslateBeforeDropping.d.ts +3 -2
- package/dist/core/utils/translate/GetTranslationByDraggingAndEvent.d.ts +3 -2
- package/dist/index/index.cjs +1 -1
- package/dist/index/index.mjs +1 -1
- package/dist/{index-LwQqhkeh.cjs → index-_CLUJ2Ve.cjs} +1 -1
- package/dist/{index-BnYdI35p.js → index-ekBJgYrv.js} +5 -5
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.mjs +55 -0
- package/dist/react/useDragAndDrop.d.ts +3 -0
- package/dist/react/utils/ReactLilstConfig.d.ts +4 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.d.ts +2 -1
- package/dist/svelte/index.mjs +2 -2
- package/dist/svelte/useDragAndDrop.d.ts +2 -1
- package/dist/svelte/utils/SvelteListCondig.d.ts +2 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.d.ts +2 -1
- package/dist/vue/index.mjs +2 -2
- package/dist/vue/useDragAndDrop.d.ts +3 -2
- package/dist/vue/utils/DropMethods.d.ts +2 -1
- package/dist/vue/utils/VueListCondig.d.ts +3 -3
- package/package.json +12 -8
- package/dist/index.d.ts +0 -4
package/README.md
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
Fluid DnD is a [**fluid**, **agnostic** and **versatil** drag and drop
|
19
|
-
library for lists with support for Vue
|
19
|
+
library for lists with support for Vue, react and Svelte](https://fluid-dnd.netlify.app/). It's a **lightweight** tool ~7 Kb (gzip) with no depenencies.
|
20
20
|
|
21
21
|
<img src="https://github.com/user-attachments/assets/b350f9a4-7dd7-40ca-ae3f-ecca166a9081" width="100%"/>
|
22
22
|
|
@@ -56,6 +56,11 @@ library for lists with support for Vue 3 and Svelte](https://fluid-dnd.netlify.a
|
|
56
56
|
- 🛠️ Edit the previous [here](https://codesandbox.io/s/nifty-hooks-5plkpl).
|
57
57
|
- 📘 See others examples [here](https://fluid-dnd.netlify.app/example/vertical-list/single-vertical-list/).
|
58
58
|
|
59
|
+
## 📚 Libraries Support
|
60
|
+
- Vue >=3.0.0
|
61
|
+
- React >= 18.0.0
|
62
|
+
- Svelte >= 5.0.0
|
63
|
+
|
59
64
|
## 🤝 Contributing
|
60
65
|
|
61
66
|
If you're interested in contributing to [fluid-dnd](https://github.com/carlosjorger/fluid-dnd), please read our contributing docs before submitting a pull request [CONTRIBUTING](./CONTRIBUTING.md).
|
@@ -1,7 +1,7 @@
|
|
1
1
|
var d = Object.defineProperty;
|
2
2
|
var e = (a, s, l) => s in a ? d(a, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : a[s] = l;
|
3
3
|
var r = (a, s, l) => e(a, typeof s != "symbol" ? s + "" : s, l);
|
4
|
-
import { a as h, t as n, G as t } from "./index-
|
4
|
+
import { a as h, t as n, G as t } from "./index-ekBJgYrv.js";
|
5
5
|
class c {
|
6
6
|
constructor() {
|
7
7
|
r(this, "handlers");
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-
|
1
|
+
"use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-_CLUJ2Ve.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ListCondig } from
|
2
|
-
import {
|
3
|
-
|
4
|
-
export default function dragAndDrop<T>(listCondig: ListCondig<T>, handlerPublisher: HandlerPublisher, config?: Config<T>, indexAttr?: string): readonly [(index: number) => void, (index: number, value: T) => void, (parent: HTMLElement | undefined) => void];
|
1
|
+
import { ListCondig, Config } from '.';
|
2
|
+
import { default as HandlerPublisher } from './HandlerPublisher';
|
3
|
+
|
4
|
+
export default function dragAndDrop<T>(listCondig: ListCondig<T>, handlerPublisher: HandlerPublisher, config?: Config<T>, indexAttr?: string): readonly [(index: number) => void, (index: number, value: T) => void, (parent: HTMLElement | null | undefined) => void];
|
package/dist/core/index.d.ts
CHANGED
@@ -4,13 +4,13 @@ export type DraggableElement = {
|
|
4
4
|
} | {
|
5
5
|
index: number;
|
6
6
|
};
|
7
|
-
export
|
8
|
-
removeAtEvent: (index: number) => T | undefined;
|
9
|
-
insertEvent: (index: number, value: T) => void;
|
7
|
+
export type ListCondig<T> = {
|
8
|
+
removeAtEvent: (index: number, sync?: boolean) => T | undefined;
|
9
|
+
insertEvent: (index: number, value: T, sync?: boolean) => void;
|
10
10
|
getLength: () => number;
|
11
11
|
getValue: (index: number) => T;
|
12
12
|
insertToListEmpty: (config: CoreConfig<T>, index: number, value: T) => void;
|
13
|
-
}
|
13
|
+
};
|
14
14
|
export type MapFrom<T> = (object: T, droppable: Element) => unknown;
|
15
15
|
export interface DragStartEventData<T> {
|
16
16
|
index: number;
|
@@ -95,8 +95,8 @@ export interface Config<T> {
|
|
95
95
|
* @public
|
96
96
|
*/
|
97
97
|
export type OnDropEvent = (source: DraggableElement, destination: DraggableElement) => void;
|
98
|
-
export type OnRemoveAtEvent<T> = (index: number) => T | undefined;
|
99
|
-
export type OnInsertEvent<T> = (index: number, value: T) => void;
|
98
|
+
export type OnRemoveAtEvent<T> = (index: number, sync?: boolean) => T | undefined;
|
99
|
+
export type OnInsertEvent<T> = (index: number, value: T, sync?: boolean) => void;
|
100
100
|
export type OnGetLength = () => number;
|
101
101
|
export type OnGetValue<T> = (index: number) => T;
|
102
102
|
export type CoreConfig<T> = {
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import { CoreConfig } from
|
2
|
-
import HandlerPublisher from
|
1
|
+
import { CoreConfig } from '.';
|
2
|
+
import { default as HandlerPublisher } from './HandlerPublisher';
|
3
|
+
|
3
4
|
export default function useDraggable<T>(draggableElement: HTMLElement, index: number, config: CoreConfig<T>, parent: HTMLElement, handlerPublisher: HandlerPublisher): readonly [(targetIndex: number) => void, (targetIndex: number, value: T) => void];
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import { CoreConfig } from
|
2
|
-
import HandlerPublisher from
|
1
|
+
import { CoreConfig } from '.';
|
2
|
+
import { default as HandlerPublisher } from './HandlerPublisher';
|
3
|
+
|
3
4
|
export default function useDroppable<T>(coreConfig: CoreConfig<T>, handlerPublisher: HandlerPublisher, droppable?: HTMLElement, indexAttr?: string): readonly [((targetIndex: number) => void)[], ((targetIndex: number, value: T) => void)[]];
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { Direction } from
|
2
|
-
import { BeforeMargin, AfterMargin, BorderWidth, PaddingBefore, Before } from
|
1
|
+
import { Direction } from '..';
|
2
|
+
import { BeforeMargin, AfterMargin, BorderWidth, PaddingBefore, Before } from '../../../index';
|
3
|
+
|
3
4
|
export declare const getWindowScroll: () => {
|
4
5
|
scrollX: number;
|
5
6
|
scrollY: number;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { GapStyle } from
|
2
|
-
import { Direction } from
|
1
|
+
import { GapStyle } from '../../../index';
|
2
|
+
import { Direction } from '..';
|
3
|
+
|
3
4
|
export declare const getNumberFromPixels: (pixels: string | undefined) => number;
|
4
5
|
export declare const computeGapPixels: (element: Element, gapType: GapStyle) => number;
|
5
6
|
export declare const gapAndDisplayInformation: (element: Element | null, gapStyle: GapStyle) => [number, boolean];
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { DragMouseTouchEvent, fixedSize } from
|
1
|
+
import { DragMouseTouchEvent, fixedSize } from '../../../index';
|
2
|
+
|
2
3
|
type onTouchEvent = "ontouchstart" | "ontouchmove" | "ontouchend";
|
3
4
|
declare const onMouseEvents: readonly ["onmouseup", "onmousedown", "onmousemove"];
|
4
5
|
type onMouseEvent = (typeof onMouseEvents)[number];
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { DragMouseTouchEvent, TransformEvent } from
|
2
|
-
import { Direction } from
|
1
|
+
import { DragMouseTouchEvent, TransformEvent } from '../../../index';
|
2
|
+
import { Direction } from '..';
|
3
|
+
|
3
4
|
export declare const useTransform: (draggedElement: HTMLElement) => readonly [(element: HTMLElement, parent: HTMLElement, pagePosition: {
|
4
5
|
pageX: number;
|
5
6
|
pageY: number;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ListCondig, MapFrom } from
|
2
|
-
import {
|
3
|
-
|
1
|
+
import { ListCondig, MapFrom, Config, CoreConfig } from '..';
|
2
|
+
import { DroppableConfig } from '../configHandler';
|
3
|
+
|
4
4
|
export declare const getConfig: <T>(listCondig: ListCondig<T>, config?: Config<T>) => CoreConfig<T>;
|
5
5
|
export declare const MapConfig: <T>(coreConfig: DroppableConfig<any>, mapFrom: MapFrom<T>) => CoreConfig<any>;
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { DroppableConfig } from
|
2
|
-
import { DragMouseTouchEvent } from
|
3
|
-
import { MapFrom } from
|
1
|
+
import { DroppableConfig } from '../configHandler';
|
2
|
+
import { DragMouseTouchEvent } from '../../../index';
|
3
|
+
import { MapFrom } from '..';
|
4
|
+
|
4
5
|
export declare class DroppableConfigurator<T> {
|
5
6
|
initial: DroppableConfig<any> | undefined;
|
6
7
|
current: DroppableConfig<T> | undefined;
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { WindowScroll } from
|
2
|
-
import { CoreConfig } from
|
3
|
-
import { DRAG_EVENT, START_DRAG_EVENT, START_DROP_EVENT } from
|
4
|
-
import { DroppableConfig } from
|
5
|
-
import HandlerPublisher from '../../HandlerPublisher';
|
1
|
+
import { WindowScroll } from '../../../../index';
|
2
|
+
import { CoreConfig } from '../..';
|
3
|
+
import { DRAG_EVENT, START_DRAG_EVENT, START_DROP_EVENT } from '..';
|
4
|
+
import { DroppableConfig } from '../../configHandler';
|
5
|
+
import { default as HandlerPublisher } from '../../HandlerPublisher';
|
6
|
+
|
6
7
|
type DraggingEvent = typeof DRAG_EVENT | typeof START_DRAG_EVENT;
|
7
8
|
type DragAndDropEvent = DraggingEvent | DropEvent;
|
8
9
|
type DropEvent = "drop" | typeof START_DROP_EVENT;
|
9
10
|
export default function useEmitEvents<T>(currentConfig: CoreConfig<T>, index: number, parent: HTMLElement, droppableGroupClass: string | null, handlerPublisher: HandlerPublisher, endDraggingAction: () => void): readonly [(draggedElement: HTMLElement, event: DragAndDropEvent, initialWindowScroll: WindowScroll, droppableConfig: DroppableConfig<T> | undefined, positionOnSourceDroppable?: number) => void, (targetIndex: number, draggedElement: HTMLElement, droppableConfig: DroppableConfig<T>, onFinishRemoveEvent: (element: HTMLElement) => void) => void, (targetIndex: number, draggedElement: HTMLElement, droppable: HTMLElement, value: T, startInserting: () => void) => void, (draggedElement: HTMLElement) => void, (element: Element, force: boolean) => void];
|
10
|
-
export declare const insertToListEmpty: <T>(config: CoreConfig<T>, droppable: HTMLElement | undefined, targetIndex: number, value: T) => void;
|
11
|
+
export declare const insertToListEmpty: <T>(config: CoreConfig<T>, droppable: HTMLElement | undefined | null, targetIndex: number, value: T) => void;
|
11
12
|
export {};
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ElementScroll } from
|
2
|
-
import { Direction } from
|
1
|
+
import { ElementScroll } from 'index';
|
2
|
+
import { Direction } from '..';
|
3
|
+
|
3
4
|
export declare const scrollByDirection: (element: HTMLElement, direction: Direction, scrollAmount: number) => void;
|
4
5
|
export declare const scrollPercent: (direction: Direction, droppable: HTMLElement, droppableScroll: ElementScroll) => number;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { DroppableConfig } from
|
1
|
+
import { DroppableConfig } from '../configHandler';
|
2
|
+
|
2
3
|
export declare const isTempElement: (element: Node) => boolean;
|
3
4
|
export declare const addTempChild: <T>(draggedElement: HTMLElement | undefined, parent: Element, ifStartDragging: boolean, droppableConfig?: DroppableConfig<T>, addingAnimationDuration?: number) => void;
|
4
5
|
export declare const addTempChildOnInsert: <T>(draggedElement: HTMLElement | undefined, ifStartDragging: boolean, droppableConfig?: DroppableConfig<T>) => void;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { Direction } from
|
2
|
-
import { Translate, WindowScroll } from
|
1
|
+
import { Direction } from '../..';
|
2
|
+
import { Translate, WindowScroll } from '../../../../index';
|
3
|
+
|
3
4
|
export default function getTranslateBeforeDropping(direction: Direction, siblings: Element[], sourceIndex: number, targetIndex: number, scroll: WindowScroll, previousScroll: {
|
4
5
|
scrollLeft: number;
|
5
6
|
scrollTop: number;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { Direction } from
|
2
|
-
import { DragAndDropEvent } from
|
1
|
+
import { Direction } from '../..';
|
2
|
+
import { DragAndDropEvent } from '..';
|
3
|
+
|
3
4
|
export default function getTranslationByDraggingAndEvent(current: HTMLElement, event: DragAndDropEvent, direction: Direction, droppable: HTMLElement, previousElement?: Element | null, nextElement?: Element | null): {
|
4
5
|
height: number;
|
5
6
|
width: number;
|
package/dist/index/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-_CLUJ2Ve.cjs");exports.dragAndDrop=e.dragAndDrop;
|
package/dist/index/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var De=Object.defineProperty;var ve=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t,n)=>ve(e,typeof t!="symbol"?t+"":t,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Yt="dragging-handler-class",Wt="dropping",se="grabbing",oe="grab",Zt="disable-transition",nt=(e,t)=>e.classList.contains(t),gt=(e,t,n=!1)=>{e.classList.toggle(t,n)},U=(e,t)=>{e.classList.add(t)},Ct=(e,t)=>{e.classList.remove(t)},be=(e,t)=>yt(t).every(n=>nt(e,n)),pt=e=>e?`.${yt(e).join(".")}`:"",Te=(e,t)=>{if(!t)return;const n=yt(t);e.classList.add(...n)},yt=e=>e?e.split(" ").filter(t=>t):[],V="horizontal",tt="vertical",Ee=()=>{const{scrollX:e,scrollY:t}=window;return{scrollX:e,scrollY:t}},qt=e=>!e||e.trim().length==0||e=="normal"?0:parseFloat(e),Ce=e=>e?parseInt(e):-1,ye=e=>{const t=getComputedStyle(e),n=new DOMMatrixReadOnly(t.transform);return{x:n.m41,y:n.m42}},re=(e,t)=>e.x1>t.x1?re(t,e):e.x2<t.x1?0:e.x2>=t.x2?e.x2-e.x1:e.x2-t.x1,ht=(e,t)=>!Ae(e,t),Ae=(e,t)=>{const n=Mt(e),s=Mt(t),o=Jt(n,s,tt),r=Jt(n,s,V);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Jt=(e,t,n)=>{const{before:s,distance:o}=w(n);return re({x1:e[s],x2:e[s]+e[o]},{x1:t[s],x2:t[s]+t[o]})},L=(e,t)=>e?qt(getComputedStyle(e)[t]):0,Kt=e=>{const{scrollLeft:t,scrollTop:n}=e;return{scrollLeft:t,scrollTop:n}},Mt=e=>e.getBoundingClientRect(),w=e=>{const t=e==V;return{beforeMargin:t?"marginLeft":"marginTop",afterMargin:t?"marginRight":"marginBottom",borderBeforeWidth:t?"borderLeftWidth":"borderTopWidth",before:t?"left":"top",after:t?"right":"down",gap:t?"columnGap":"rowGap",distance:t?"width":"height",axis:t?"x":"y",offset:t?"offsetX":"offsetY",scroll:t?"scrollX":"scrollY",scrollElement:t?"scrollLeft":"scrollTop",page:t?"pageX":"pageY",inner:t?"innerWidth":"innerHeight",offsetElement:t?"offsetLeft":"offsetTop",scrollDistance:t?"scrollWidth":"scrollHeight",clientDistance:t?"clientWidth":"clientHeight",paddingBefore:t?"paddingLeft":"paddingTop",getRect:Mt}},Rt=(e,t)=>xe(e,t),ie=e=>[...e.children].filter(n=>nt(n,Q)),xe=(e,t)=>{const n=[...t.children].filter(o=>nt(o,Q)&&!o.isEqualNode(e)).toReversed(),s=[...t.children].findLastIndex(o=>o.isEqualNode(e));return[n,s,t]},we=e=>{let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).position==="fixed")return t;t=t.parentElement}return null},ce=(e,t)=>{const{before:n,borderBeforeWidth:s}=w(t),o=we(e);return o?Mt(o)[n]+L(o,s):0},Xt=e=>window.TouchEvent&&e instanceof TouchEvent,it=e=>e instanceof HTMLElement,ae=e=>e instanceof MouseEvent,Be=["onmouseup","onmousedown","onmousemove"],Re=(e,t,n)=>{e&&(e.style.height=`${t}px`,e.style.width=`${n}px`)},Tt=(e,t,n)=>{!e||!it(e)||(n==0&&t==0?e.style.transform="":e.style.transform=`translate(${n}px,${t}px)`)},Le=(e,t,n)=>{e[t]=s=>{if(s.defaultPrevented)return;const o=_t(s);n(o)}},$t=(e,t,n)=>{n&&(Oe(t)?e[t]=n:Le(e,t,n))},Oe=e=>Be.includes(e),Me=e=>{const{target:t}=e;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:t,offsetX:0,offsetY:0}},Ne=(e,t)=>{const n=(s,o)=>Pe(t,window,o,s);if(ae(e)){const{offsetX:s,offsetY:o}=e;return[s,o]}else{const s=e.target;return[n(s,V),n(s,tt)]}},_t=e=>{const t=Fe(e);if(!t)return Me(e);const[n,s]=Ne(e,t),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m}=t;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m,offsetX:n,offsetY:s}},Fe=e=>{if(Xt(e))return e.touches[0]??e.changedTouches[0];if(ae(e))return e},Pe=(e,t,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:u}=w(n),d=u(s);return e[o]-t[r]-d[c]-L(s,l)},Ft=(e,t,n="ease-out",s="transform")=>{it(e)&&(e.style.transitionDuration=`${t}ms`,e.style.transitionTimingFunction=`${n}`,e.style.transitionProperty=`${s}`)},le=(e,t,n)=>{!e||!it(e)||(e[t]=()=>{n()})},$e=e=>{var t=e.querySelector("style");if(!t){var n=document.createElement("style");return e.appendChild(n),n}return t},Ge=(e,t)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=t.match(n)||[];for(const o of e.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},Ie=(e,t)=>{t.forEach(n=>{Ye(e,n)})},Ye=(e,t)=>{var s;var n=$e(e);n.sheet&&(Ge(n.sheet,t)||(s=n.sheet)==null||s.insertRule(t,n.sheet.cssRules.length))},ue=(e,t={})=>{for(const n of Object.keys(t)){const s=t[n];s!=null&&We(e,`--${n}`,s)}},We=(e,t,n)=>e&&e.style.setProperty(t,n),fe="startDrag",Nt="drag",zt="startDrop",Xe="drop",at="temp-child",de="cubic-bezier(0.2, 0, 0, 1)",_e=e=>e===Xe||e===zt,Vt=e=>!e||e.length==0?0:qt(e.replace("px","")),Ve=(e,t)=>{const n=getComputedStyle(e)[t];if(n.match("%")){const o=qt(n.replace("%","")),{width:r}=e.getBoundingClientRect();return r*(o/100)}return Vt(n)},jt=(e,t)=>{if(!(e instanceof Element))return[0,!1];const n=Ve(e,t),s=getComputedStyle(e).display,o=n>0||s==="flex";return[n,o]},He=e=>{const{top:t,left:n}=getComputedStyle(e);return[Vt(t),Vt(n)]},qe=(e,t)=>{const{gap:n}=w(t),[s,o]=jt(e,n);return o?s:0};function Et(e,t,n,s,o=e.previousElementSibling,r=e.nextElementSibling){let{height:c,width:l}=ze(n,e,o,r);return ht(e,s)&&t==Nt&&(c=0,l=0),{height:c,width:l}}const ze=(e,t,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:u}=w(e),d=L(t,o),m=L(t,r),v=L(s,r),[B,O]=jt(t.parentElement,l),F=u(t)[c];if(O)return Qt(F,m,d,B,0,e);const[h,S,y]=je(n,v,d,m,o);return Qt(F,S,h,0,y,e)},je=(e,t,n,s,o)=>{const r=Math.max(t,n);let c=s,l=t;if(e){const u=L(e,o);c=Math.max(u,s),l=Math.max(l,u)}return[r,c,l]},Qt=(e,t,n,s,o,r)=>ke(r,e+t+n+s-o),ke=(e,t)=>e==V?{width:t,height:0}:{width:0,height:t},Ut=(e,t)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=w(e),c=L(t,n),l=L(t,s),u=r(t)[o];return c+l+u},Ze=(e,t)=>{const[n,s]=He(t),o=Ut(tt,e);return[Ut(V,e)-s,o-n]};function Je(e,t,n,s,o,r,c,l,u){let d=0,m=0;const v=!!(n<0&&u);if(n===s&&!v)return te({height:d,width:m},e,o,c,v);const[B,O,F,h]=Ue(t,n,s,u);if(v){const[et,ot]=Ze(l,u);d+=ot,m+=et}const{scrollElement:S,beforeMargin:y,afterMargin:R,distance:I,gap:Y}=w(e),[W,P]=jt(l,Y),[st,H,N]=en(y,R,B,O==null?void 0:O.previousElementSibling,h,P,v),[Z,q,z]=tn(y,R,I,F,W,P),X=Qe(q,Z,z,H,st,W),j=v?l[S]:Ke(S,l,r),$=(h?X-N:N-X)-j;return e===tt?d+=$:e===V&&(m+=$),te({height:d,width:m},e,o,c,v)}const Ke=(e,t,n)=>{const s=t[e],o=n[e];return s-o},Qe=(e,t,n,s,o,r)=>{const c=Math.max(t,o);return Math.max(n,s)+e+c+r},Ue=(e,t,n,s)=>{const o=t<n,[r,c]=[t,n].toSorted((m,v)=>m-v),l=e[t]??s,u=e[n];let d=o?e.slice(r+1,c+1):e.slice(r,c);return r<0&&s&&(d=e.slice(r+1,c)),[l,u,d,o]},tn=(e,t,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=L(s[0],e);let l=0,u=-c;for(const[d,m]of s.entries()){const v=m.getBoundingClientRect()[n],B=L(m,e);r&&(l+=B),r&&d>0?l+=o:l=Math.max(l,B),u+=l+v,l=L(m,t)}return[c,u,l]},te=(e,t,n,s,o)=>{const{scroll:r,distance:c}=w(t),l=window[r],u=n[r],d=o?0:u-2*l+s[r];return e[c]+=d,e},en=(e,t,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return nn(e,t,l,n,r,c)},nn=(e,t,n,s,o,r)=>{if(o)return[0,0,0];const c=L(r?null:n,t),l=L(s,e);let u=Math.max(c,l);return[c,l,u]},kt=(e,t,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];e(o,c)}});return o.observe(t,n),o},sn=(e,t,n)=>{n!=0&&(t==="vertical"?e.scrollBy(0,n):e.scrollBy(n,0))},on=(e,t,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=w(e);return n[r]/(t[s]-t[o])},rn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",pe=50,ee=e=>it(e)?e.classList.contains(at):!1,cn=(e,t,n)=>{let s=Et(t,rn,n,e);const o=qe(e,n),{distance:r}=w(n);s[r]-=o;const[c,l]=an(n,t);return s[l]=c,s},an=(e,t)=>{const n=e==V?tt:V,{distance:s,getRect:o}=w(n);return[o(t)[s],s]},mt=(e,t,n)=>{Re(e,t,n),e.style.minWidth=`${n}px`},ln=(e,t,n)=>s=>{t.contains(e)&&(mt(e,n.height,n.width),s.disconnect())},un=(e,t)=>{if(!t)return;const{droppable:n,config:s,scroll:o}=e,{direction:r}=s,c=on(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:u,scrollElement:d}=w(r);c&&(n[d]=n[l]-n[u])},he=(e,t,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(un(n,t),o.querySelector(`.${at}`)||!e)return;var u=e.tagName=="LI"?"DIV":e.tagName,d=document.createElement(u);U(d,at),mt(d,0,0);const m=cn(o,e,c);return Ft(d,l,ge,"width, min-width, height"),[d,m,o]},Gt=(e,t,n,s,o)=>{const r=he(e,n,s);if(!r)return;const[c,l,u]=r;t.isSameNode(u)&&mt(c,l.height,l.width),kt(ln(c,u,l),u,{childList:!0,subtree:!0}),u.appendChild(c)},fn=(e,t,n)=>{const s=he(e,t,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),dn(o,r)},dn=(e,t)=>requestAnimationFrame(()=>{mt(e,t.height,t.width),requestAnimationFrame(()=>{Ft(e,0,ge,"width, min-width, height")})}),gn=(e,t,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(t)||!o&&(l!=null&&l.isSameNode(e)))return;mt(c,0,0),setTimeout(()=>{var d;(d=c.parentNode)==null||d.removeChild(c)},s+pe)})}},bt=(e,t,n=!1)=>{var s=e.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{e.contains(r)&&e.removeChild(r)},t+pe)):e.removeChild(o)})},pn=50;function hn(e,t,n,s,o,r){let c=t;const{direction:l,handlerSelector:u,onRemoveAtEvent:d,animationDuration:m,delayBeforeInsert:v,draggingClass:B}=e,O=(i,f,g,D,C)=>{if(!D)return;const{droppable:b,config:T}=D,A=Et(i,f,T.direction,b);_e(f)?P(i,f,A,g,D,C):y(i,f,A,D)},F=(i,f,g,D,C)=>{const b=Et(f,"insert",e.direction,g),{onInsertEvent:T}=e,A=ie(g);for(const[M,x]of A.entries())nt(x,Q)&&M>=i&&W(x,b);C(),setTimeout(()=>{T(i,D),bt(n,0,!0),me(i,g,e),et(f),_(f,n)},v)},h=(i,f,g,D)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:b}=g;let[T]=Rt(f,C);T=[f,...T].toReversed();const A=Et(f,"remove",b.direction,C);for(const[M,x]of T.entries())M>=i&&(Y(x,A),setTimeout(()=>{D(x)},m))},S=i=>{bt(n,m,!0),setTimeout(()=>{et(i),_(i,n)},m)},y=(i,f,g,D)=>{const{config:C,droppable:b}=D,[T]=Rt(i,b),A=ht(i,b);T.length==0&&I(g,1,C.direction,T);for(const[M,x]of T.entries()){if(!nt(x,Q))continue;const G=R(C.direction,i,x,g);if(!A&&G)g=G;else if(!A)continue;const J=T.length-M;I(g,J,C.direction,T),f===fe?Y(x,g):f===Nt&&W(x,g)}},R=(i,f,g,D)=>{const{before:C,distance:b,axis:T,getRect:A}=w(i),M=A(f),x=A(g),G=M[C],J=x[C],ft=x[b],St=J+ft/2,Dt=ye(g)[T],ct=St-Dt;return G>ct?{height:0,width:0}:D},I=(i,f,g,D)=>{const C=D.filter(T=>nt(T,Q)).length,{distance:b}=w(g);i[b]==0?c=Math.max(c,f):c=Math.min(c,f-1),c=Math.min(c,C)},Y=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g)},W=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g),Ft(i,m,de)},P=(i,f,g,D,C,b)=>{const{droppable:T,scroll:A,config:M}=C,[x,G]=Rt(i,T),J=x.toReversed(),ft=G===-1?J.length:G;J.splice(ft,0,i);const[St,Dt,ct]=st(i,G,J,T);g=Et(i,f,M.direction,n,St,Dt);const Pt=Ee(),At=Je(M.direction,J,G,ct,Pt,A,D,T,i);x.length==0&&H(void 0,g,i,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),f===zt&&!nt(wt,at)&&H(wt,Bt,i,At)}N(ct,i,M,T,b)},st=(i,f,g,D)=>{const b=ht(i,D)?f:c,T=()=>f<b?[b,b+1]:f>b?[b-1,b]:[b-1,b+1],[A,M]=T(),x=g[A]??null,G=g[M]??null;return[x,G,b]},H=(i,f,g,D)=>{Tt(i,f.height,f.width),Tt(g,D.height,D.width)},N=(i,f,g,D,C)=>{const{onInsertEvent:b,onDragEnd:T}=g;U(f,Wt),z(f,n,D,()=>{if(Ct(f,Wt),C!=null){const A=d(C);A!=null&&(b(i,A),T({value:A,index:i})),q(f),Z()}})},Z=()=>{if(s){var i=document.querySelectorAll(`${pt(s)} > .${Q}`);for(const f of i)$(f)}},q=i=>{setTimeout(()=>{Ct(i,B)},pn)},z=(i,f,g,D)=>{setTimeout(()=>{D&&D(),X(f,g),j(g),et(i),_(i,f),_(i,g)},m)},X=(i,f)=>{i.isSameNode(f)?bt(i,m):(bt(i,m,!0),bt(f,m))},j=i=>{if(n.isSameNode(i))return;var[f]=n.querySelectorAll(`.${at}`);if(!f)return;const{distance:g}=w(l);it(f)&&(f.style[g]="0px")},_=(i,f)=>{const[g]=Rt(i,f);for(const D of[...g,i])$(D)},$=i=>{it(i)&&(i.style.transition="",i.style.transform="")},et=i=>{r(),ut(i,!1),i.style.transform="",i.style.transition="",i.style.top="",i.style.left="",ue(i,{fixedHeight:"",fixedWidth:""})},ot=(i,f)=>{const g=f.querySelector(u);gt(document.body,se,i),gt(g||f,Yt,i)},ut=(i,f)=>{gt(i,Ht,f),ot(f,i),o.toggleGrabClass(!f)};return[O,h,F,S,ut]}const me=(e,t,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ie(t)[e];U(l,s),U(l,Zt),setTimeout(()=>{Ct(l,Zt),Ct(l,s),r.disconnect()},o)},t,{childList:!0})},mn=(e,t,n,s)=>{if(!t)return;const{onInsertEvent:o,delayBeforeInsert:r}=e;setTimeout(()=>{o(n,s),me(n,t,e)},r)},Sn=(e,t)=>{const n=l=>e.removeAtEvent(l),s=(l,u)=>e.insertEvent(l,u),o=()=>e.getLength(),r=l=>e.getValue(l),c=l=>l;return{direction:(t==null?void 0:t.direction)??tt,handlerSelector:(t==null?void 0:t.handlerSelector)??Q,draggingClass:(t==null?void 0:t.draggingClass)??"dragging",droppableClass:(t==null?void 0:t.droppableClass)??"droppable-hover",isDraggable:(t==null?void 0:t.isDraggable)??(()=>!0),onDragStart:(t==null?void 0:t.onDragStart)??(()=>{}),onDragEnd:(t==null?void 0:t.onDragEnd)??(()=>{}),droppableGroup:t==null?void 0:t.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(t==null?void 0:t.animationDuration)??200,removingClass:(t==null?void 0:t.removingClass)??"removing",insertingFromClass:(t==null?void 0:t.insertingFromClass)??"from-inserting",delayBeforeRemove:(t==null?void 0:t.delayBeforeRemove)??200,delayBeforeInsert:(t==null?void 0:t.delayBeforeInsert)??200,mapFrom:(t==null?void 0:t.mapFrom)??c}},Dn=(e,t)=>{const{config:n,droppable:s}=e,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:u=>{const{index:d,value:m}=u;r({index:d,value:t(m,s)})},onInsertEvent:(u,d)=>o(u,t(d,s))}},vn=e=>{let t={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=u=>{e.style.transform=`translate( ${u.x}px, ${u.y}px)`},r=u=>{e.style.top=`${u.top}px`,e.style.left=`${u.left}px`};return[(u,d,m,v)=>{const B=h=>{const{beforeMargin:S,borderBeforeWidth:y,before:R,offset:I,scroll:Y,page:W,inner:P,distance:st,axis:H,getRect:N}=w(h),Z=m[W],q=window[Y],z=window[P],X=N(u)[st],j=L(u,y),_=L(u,S),$=Z-t[I],et=ce(u,h);if($>=q-X/2&&$<=q+z){const ut=$-n[R]-j-_-q-et;return O(h),ut}return s[H]},O=h=>{if(u&&nt(u,Ht)&&h===v){const{before:S,distance:y,axis:R,getRect:I}=w(v),Y=I(u)[y],W=I(d),P=n[S]-W[S]+s[R],H=W[y]-Y,N=P/H,Z=Y/H,q=.1,z=.2,X=.8;let j=0;const _=ht(u,d);!_&&N<z&&N>-Z?j=N/z-1:!_&&N>X&&N<1+Z&&(j=1/(1-X)*(N-X));const $=q*Y*j;sn(d,v,$)}},F=h=>{const{axis:S}=w(h);s[S]=B(h),o(s)};F(V),F(tt)},(u,d)=>{const[m,v,B,O]=En(u,d,e);n={top:m,left:v},r(n),t={offsetX:B,offsetY:O}}]},Lt=(e,t,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=w(e);return r(t)[o]-r(n)[o]-L(n,s)},bn=(e,t)=>{let{offsetX:n,offsetY:s,target:o}=e,r=Tn(o,t);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(V,c,r),s+=Lt(tt,c,r)),r&&t!=o&&(n+=Lt(V,r,t),s+=Lt(tt,r,t)),[n,s]},Tn=(e,t)=>{const n=e==null?void 0:e.closest(`.${Ot}`);return n&&n.isSameNode(t)?e:n},ne=(e,t,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:u}=w(e),d=ce(n,e);return t[c]-s[o]-L(n,r)-L(n,l)-window[u]-d},En=(e,t,n)=>{const[s,o]=bn(e,n);return[ne(tt,e,t,{offsetX:s,offsetY:o}),ne(V,e,t,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(t,n){const s=K.configs.filter(r=>!r.droppable.isSameNode(t)),o=Kt(t);s.push({droppable:t,config:n,scroll:o}),K.configs=s}static updateScrolls(t,n){for(const s of K.configs){const{droppable:o}=s;(n&&be(o,n)||o.isSameNode(t))&&(s.scroll=Kt(o))}}static getConfig(t){return K.configs.find(({droppable:s})=>s.isSameNode(t))}};k(K,"configs",[]),k(K,"removeObsoleteConfigs",()=>{const t=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=t});let lt=K;class Cn{constructor(t,n,s,o,r,c){k(this,"initial");k(this,"current");k(this,"parent");k(this,"draggableElement");k(this,"groupClass");k(this,"dragEvent");k(this,"changeDroppable");k(this,"mapFrom");this.parent=s,this.draggableElement=t,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(t,n,s){return document.elementsFromPoint(t,n).filter(o=>!o.isSameNode(s))}getElementBelow(t,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,t);return l};let r=null;return s?(t.hidden=!0,r=o(this),t.hidden=!1):r=o(this),r}getCurrent(t,n,s=!0){const o=this.getElementBelow(t,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(t){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(t,s))}isNotInsideAnotherDroppable(t,n){return!ht(t,n)||this.isOutsideOfAllDroppables(t)}onScrollEvent(){this.dragEvent()}setOnScroll(t){le(t,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(t){const n=lt.getConfig(t);if(n)return t.isSameNode(this.parent)?n:{...n,config:Dn(n,this.mapFrom)}}getCurrentConfig(t){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,t);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(t){const n=this.current;this.current=this.getCurrentConfig(t),this.changeDroppable(this.current,n)}isOutside(t,n=!0){const s=this.draggableElement;return!this.getCurrent(s,t,n)}}function yn(e,t,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:u,delayBeforeRemove:d,draggingClass:m,removingClass:v,onRemoveAtEvent:B,droppableClass:O,onDragStart:F}=n,h=yt(l).map(a=>`droppable-group-${a}`).join(" ");let S=0,y={scrollX:0,scrollY:0},R={pageX:0,pageY:0},I;const[Y,W]=vn(e),[P,st,H,N,Z]=hn(n,t,s,h,o,()=>S=0),q=()=>{U(e,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},X=()=>{if(c(e)){const a=e.querySelector(r);z(a||e)}},j=()=>{X(),q()},_=a=>{const p=a==null?void 0:a.querySelector(`.${Ot}`),E=p==null?void 0:p.parentElement;return p&&E&&nt(E,It)&&!E.isSameNode(s)?null:p},$=a=>{const p=_(a)??a;p&&c(a)&&($t(p,"onmousedown",M("mousemove","mouseup")),$t(p,"ontouchstart",M("touchmove","touchend")),et(p)),a!=null&&a.isSameNode(p)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const p=a.querySelectorAll("img");Array.from(p).forEach(E=>{E.onmousedown=()=>!1})},ot=()=>{if(R.pageX==0&&R.pageY==0||!i.current)return;const{droppable:a,config:p}=i.current;Y(e,a,R,p.direction),P(e,Nt,y,i.current)},ut=(a,p)=>{p&&S==2&&!(a!=null&&a.droppable.isSameNode(p.droppable))&&P(e,Nt,y,p)},i=new Cn(e,h,s,ot,ut,n.mapFrom),f=a=>{if(!i.current)return;const p=h?Array.from(document.querySelectorAll(pt(h))):[s];for(const E of p)E.classList.toggle(O,!a&&E.isSameNode(i.current.droppable))},g=a=>{i.updateConfig(a);const p=i.isOutside(a);f(p),S===1?ft(a):S===2&&(D(p),Dt(a))},D=(a=!0)=>{if(!i.current)return;const{droppable:p}=i.current;gn(p,s,h,u,a),!a&&Gt(e,s,S==1,i.current)},C=a=>{if(Xt(a)&&a.cancelable)a.preventDefault();else if(Xt(a))return;const p=_t(a);g(p)},b=(a,p)=>{a=="touchmove"?I=setTimeout(()=>{p()},200):p()},T=(a,p)=>{const{clientX:E,clientY:dt}=a,rt=document.elementFromPoint(E,dt),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&p&&vt&&!p.isSameNode(vt)},A=a=>{const p=n.onGetValue(t);return{index:t,element:a,value:p}},M=(a,p)=>E=>{if(T(E,e))return;lt.updateScrolls(s,h);const{scrollX:dt,scrollY:rt}=window;if(y={scrollX:dt,scrollY:rt},S===0){S=1;const vt=A(e);vt&&F(vt),b(a,()=>{a=="touchmove"&&(i.updateConfig(E),f(i.isOutside(E)),ft(E)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(p,G(a),{once:!0})}},x=a=>i.updateConfig(a),G=a=>p=>{f(!0);const E=_t(p);clearTimeout(I),At(i.isOutside(E,!1)),document.removeEventListener(a,C),i.updateConfig(E);const dt=i.getCurrentConfig(E);if(dt){const{droppable:rt}=dt;J(rt)}s.onscroll=null},J=a=>{if(a.onscroll=null,!h)return;const p=Array.from(document.querySelectorAll(pt(h)));for(const E of p)it(E)&&(E.onscroll=null)},ft=a=>{Gt(e,s,S==1,i.current),St(),P(e,fe,y,i.current),wt(e),W(a,e)},St=()=>{S=2},Dt=a=>{const{pageX:p,pageY:E}=a;R={pageX:p,pageY:E},ot()},ct=a=>le(a,"onscroll",Pt),Pt=()=>ot(),At=a=>{if(S!==2){S=0;return}S=3,xt(e),P(e,zt,y,a?i.initial:i.current,t)},xt=a=>{Ft(a,u,de),Tt(a,0,0)},wt=a=>{const{height:p,width:E}=a.getBoundingClientRect();ue(a,{fixedHeight:`${p}px`,fixedWidth:`${E}px`}),Z(a,!0),gt(a,m,!0),a.style.transition=""},Bt=a=>{if(!i.initial)return;const p=i.initial;a==t&&(U(e,v),setTimeout(()=>{B(t),Ct(e,v),Gt(e,s,S==1,i.initial),st(a,e,p,E=>{xt(E),N(e)})},d))},Se=(a,p)=>{(a===t||a===n.onGetLegth()&&t===a-1)&&H(a,e,s,p,()=>{fn(e,S==1,i.initial)})};return j(),$(e),[Bt,Se]}const An=(e,t)=>{e&&Te(t,e)},xn=()=>{Ie(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${oe}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Yt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${se}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function wn(e,t,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=e;if(!n)return[r,c];const u=yt(l).map(d=>`droppable-group-${d}`).join(" ");xn(),An(u,n);for(const d of n.children){const m=d.getAttribute(o),v=Ce(m),B=d;if(B&&v>=0){const[O,F]=yn(B,v,e,n,t);r.push(O),c.push(F)}}return[r,c]}function Bn(e,t,n,s="index"){let o=[],r=[];const c=Sn(e,n),l=h=>{for(const S of o)S(h)},u=(h,S)=>{if(c.onGetLegth()===0)e.insertToListEmpty(c,h,S);else for(const R of r)R(h,S)},d=h=>{const[S,y]=wn(c,t,h,s);o=S,r=y},m=h=>{const S=h.addedNodes.values().filter(R=>!ee(R)).toArray(),y=h.removedNodes.values().filter(R=>!ee(R)).toArray();return S.length>0||y.length>0},v=h=>{kt(()=>{d(h)},h,{childList:!0},m)},B=h=>{U(h,It)},O=h=>{lt.addConfig(h,c)};return[l,u,h=>{h&&(B(h),O(h),v(h),d(h),lt.removeObsoleteConfigs())}]}exports.GRAB_CLASS=oe;exports.addClass=U;exports.dragAndDrop=Bn;exports.insertToListEmpty=mn;exports.toggleClass=gt;
|
1
|
+
"use strict";var De=Object.defineProperty;var ve=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t,n)=>ve(e,typeof t!="symbol"?t+"":t,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Yt="dragging-handler-class",Wt="dropping",se="grabbing",oe="grab",Zt="disable-transition",nt=(e,t)=>e.classList.contains(t),gt=(e,t,n=!1)=>{e.classList.toggle(t,n)},U=(e,t)=>{e.classList.add(t)},Ct=(e,t)=>{e.classList.remove(t)},be=(e,t)=>yt(t).every(n=>nt(e,n)),pt=e=>e?`.${yt(e).join(".")}`:"",Te=(e,t)=>{if(!t)return;const n=yt(t);e.classList.add(...n)},yt=e=>e?e.split(" ").filter(t=>t):[],V="horizontal",tt="vertical",Ee=()=>{const{scrollX:e,scrollY:t}=window;return{scrollX:e,scrollY:t}},qt=e=>!e||e.trim().length==0||e=="normal"?0:parseFloat(e),Ce=e=>e?parseInt(e):-1,ye=e=>{const t=getComputedStyle(e),n=new DOMMatrixReadOnly(t.transform);return{x:n.m41,y:n.m42}},re=(e,t)=>e.x1>t.x1?re(t,e):e.x2<t.x1?0:e.x2>=t.x2?e.x2-e.x1:e.x2-t.x1,ht=(e,t)=>!Ae(e,t),Ae=(e,t)=>{const n=Mt(e),s=Mt(t),o=Jt(n,s,tt),r=Jt(n,s,V);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Jt=(e,t,n)=>{const{before:s,distance:o}=w(n);return re({x1:e[s],x2:e[s]+e[o]},{x1:t[s],x2:t[s]+t[o]})},L=(e,t)=>e?qt(getComputedStyle(e)[t]):0,Kt=e=>{const{scrollLeft:t,scrollTop:n}=e;return{scrollLeft:t,scrollTop:n}},Mt=e=>e.getBoundingClientRect(),w=e=>{const t=e==V;return{beforeMargin:t?"marginLeft":"marginTop",afterMargin:t?"marginRight":"marginBottom",borderBeforeWidth:t?"borderLeftWidth":"borderTopWidth",before:t?"left":"top",after:t?"right":"down",gap:t?"columnGap":"rowGap",distance:t?"width":"height",axis:t?"x":"y",offset:t?"offsetX":"offsetY",scroll:t?"scrollX":"scrollY",scrollElement:t?"scrollLeft":"scrollTop",page:t?"pageX":"pageY",inner:t?"innerWidth":"innerHeight",offsetElement:t?"offsetLeft":"offsetTop",scrollDistance:t?"scrollWidth":"scrollHeight",clientDistance:t?"clientWidth":"clientHeight",paddingBefore:t?"paddingLeft":"paddingTop",getRect:Mt}},Rt=(e,t)=>xe(e,t),ie=e=>[...e.children].filter(n=>nt(n,Q)),xe=(e,t)=>{const n=[...t.children].filter(o=>nt(o,Q)&&!o.isEqualNode(e)).toReversed(),s=[...t.children].findLastIndex(o=>o.isEqualNode(e));return[n,s,t]},we=e=>{let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).position==="fixed")return t;t=t.parentElement}return null},ce=(e,t)=>{const{before:n,borderBeforeWidth:s}=w(t),o=we(e);return o?Mt(o)[n]+L(o,s):0},Xt=e=>window.TouchEvent&&e instanceof TouchEvent,it=e=>e instanceof HTMLElement,ae=e=>e instanceof MouseEvent,Be=["onmouseup","onmousedown","onmousemove"],Re=(e,t,n)=>{e&&(e.style.height=`${t}px`,e.style.width=`${n}px`)},Tt=(e,t,n)=>{!e||!it(e)||(n==0&&t==0?e.style.transform="":e.style.transform=`translate(${n}px,${t}px)`)},Le=(e,t,n)=>{e[t]=s=>{if(s.defaultPrevented)return;const o=_t(s);n(o)}},$t=(e,t,n)=>{n&&(Oe(t)?e[t]=n:Le(e,t,n))},Oe=e=>Be.includes(e),Me=e=>{const{target:t}=e;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:t,offsetX:0,offsetY:0}},Ne=(e,t)=>{const n=(s,o)=>Pe(t,window,o,s);if(ae(e)){const{offsetX:s,offsetY:o}=e;return[s,o]}else{const s=e.target;return[n(s,V),n(s,tt)]}},_t=e=>{const t=Fe(e);if(!t)return Me(e);const[n,s]=Ne(e,t),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m}=t;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m,offsetX:n,offsetY:s}},Fe=e=>{if(Xt(e))return e.touches[0]??e.changedTouches[0];if(ae(e))return e},Pe=(e,t,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:u}=w(n),d=u(s);return e[o]-t[r]-d[c]-L(s,l)},Ft=(e,t,n="ease-out",s="transform")=>{it(e)&&(e.style.transitionDuration=`${t}ms`,e.style.transitionTimingFunction=`${n}`,e.style.transitionProperty=`${s}`)},le=(e,t,n)=>{!e||!it(e)||(e[t]=()=>{n()})},$e=e=>{var t=e.querySelector("style");if(!t){var n=document.createElement("style");return e.appendChild(n),n}return t},Ge=(e,t)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=t.match(n)||[];for(const o of e.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},Ie=(e,t)=>{t.forEach(n=>{Ye(e,n)})},Ye=(e,t)=>{var s;var n=$e(e);n.sheet&&(Ge(n.sheet,t)||(s=n.sheet)==null||s.insertRule(t,n.sheet.cssRules.length))},ue=(e,t={})=>{for(const n of Object.keys(t)){const s=t[n];s!=null&&We(e,`--${n}`,s)}},We=(e,t,n)=>e&&e.style.setProperty(t,n),fe="startDrag",Nt="drag",zt="startDrop",Xe="drop",at="temp-child",de="cubic-bezier(0.2, 0, 0, 1)",_e=e=>e===Xe||e===zt,Vt=e=>!e||e.length==0?0:qt(e.replace("px","")),Ve=(e,t)=>{const n=getComputedStyle(e)[t];if(n.match("%")){const o=qt(n.replace("%","")),{width:r}=e.getBoundingClientRect();return r*(o/100)}return Vt(n)},jt=(e,t)=>{if(!(e instanceof Element))return[0,!1];const n=Ve(e,t),s=getComputedStyle(e).display,o=n>0||s==="flex";return[n,o]},He=e=>{const{top:t,left:n}=getComputedStyle(e);return[Vt(t),Vt(n)]},qe=(e,t)=>{const{gap:n}=w(t),[s,o]=jt(e,n);return o?s:0};function Et(e,t,n,s,o=e.previousElementSibling,r=e.nextElementSibling){let{height:c,width:l}=ze(n,e,o,r);return ht(e,s)&&t==Nt&&(c=0,l=0),{height:c,width:l}}const ze=(e,t,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:u}=w(e),d=L(t,o),m=L(t,r),v=L(s,r),[B,O]=jt(t.parentElement,l),F=u(t)[c];if(O)return Qt(F,m,d,B,0,e);const[h,S,y]=je(n,v,d,m,o);return Qt(F,S,h,0,y,e)},je=(e,t,n,s,o)=>{const r=Math.max(t,n);let c=s,l=t;if(e){const u=L(e,o);c=Math.max(u,s),l=Math.max(l,u)}return[r,c,l]},Qt=(e,t,n,s,o,r)=>ke(r,e+t+n+s-o),ke=(e,t)=>e==V?{width:t,height:0}:{width:0,height:t},Ut=(e,t)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=w(e),c=L(t,n),l=L(t,s),u=r(t)[o];return c+l+u},Ze=(e,t)=>{const[n,s]=He(t),o=Ut(tt,e);return[Ut(V,e)-s,o-n]};function Je(e,t,n,s,o,r,c,l,u){let d=0,m=0;const v=!!(n<0&&u);if(n===s&&!v)return te({height:d,width:m},e,o,c,v);const[B,O,F,h]=Ue(t,n,s,u);if(v){const[et,ot]=Ze(l,u);d+=ot,m+=et}const{scrollElement:S,beforeMargin:y,afterMargin:R,distance:I,gap:Y}=w(e),[W,P]=jt(l,Y),[st,H,N]=en(y,R,B,O==null?void 0:O.previousElementSibling,h,P,v),[Z,q,z]=tn(y,R,I,F,W,P),X=Qe(q,Z,z,H,st,W),j=v?l[S]:Ke(S,l,r),$=(h?X-N:N-X)-j;return e===tt?d+=$:e===V&&(m+=$),te({height:d,width:m},e,o,c,v)}const Ke=(e,t,n)=>{const s=t[e],o=n[e];return s-o},Qe=(e,t,n,s,o,r)=>{const c=Math.max(t,o);return Math.max(n,s)+e+c+r},Ue=(e,t,n,s)=>{const o=t<n,[r,c]=[t,n].toSorted((m,v)=>m-v),l=e[t]??s,u=e[n];let d=o?e.slice(r+1,c+1):e.slice(r,c);return r<0&&s&&(d=e.slice(r+1,c)),[l,u,d,o]},tn=(e,t,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=L(s[0],e);let l=0,u=-c;for(const[d,m]of s.entries()){const v=m.getBoundingClientRect()[n],B=L(m,e);r&&(l+=B),r&&d>0?l+=o:l=Math.max(l,B),u+=l+v,l=L(m,t)}return[c,u,l]},te=(e,t,n,s,o)=>{const{scroll:r,distance:c}=w(t),l=window[r],u=n[r],d=o?0:u-2*l+s[r];return e[c]+=d,e},en=(e,t,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return nn(e,t,l,n,r,c)},nn=(e,t,n,s,o,r)=>{if(o)return[0,0,0];const c=L(r?null:n,t),l=L(s,e);let u=Math.max(c,l);return[c,l,u]},kt=(e,t,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];e(o,c)}});return o.observe(t,n),o},sn=(e,t,n)=>{n!=0&&(t==="vertical"?e.scrollBy(0,n):e.scrollBy(n,0))},on=(e,t,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=w(e);return n[r]/(t[s]-t[o])},rn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",pe=50,ee=e=>it(e)?e.classList.contains(at):!1,cn=(e,t,n)=>{let s=Et(t,rn,n,e);const o=qe(e,n),{distance:r}=w(n);s[r]-=o;const[c,l]=an(n,t);return s[l]=c,s},an=(e,t)=>{const n=e==V?tt:V,{distance:s,getRect:o}=w(n);return[o(t)[s],s]},mt=(e,t,n)=>{Re(e,t,n),e.style.minWidth=`${n}px`},ln=(e,t,n)=>s=>{t.contains(e)&&(mt(e,n.height,n.width),s.disconnect())},un=(e,t)=>{if(!t)return;const{droppable:n,config:s,scroll:o}=e,{direction:r}=s,c=on(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:u,scrollElement:d}=w(r);c&&(n[d]=n[l]-n[u])},he=(e,t,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(un(n,t),o.querySelector(`.${at}`)||!e)return;var u=e.tagName=="LI"?"DIV":e.tagName,d=document.createElement(u);U(d,at),mt(d,0,0);const m=cn(o,e,c);return Ft(d,l,ge,"width, min-width, height"),[d,m,o]},Gt=(e,t,n,s,o)=>{const r=he(e,n,s);if(!r)return;const[c,l,u]=r;t.isSameNode(u)&&mt(c,l.height,l.width),kt(ln(c,u,l),u,{childList:!0,subtree:!0}),u.appendChild(c)},fn=(e,t,n)=>{const s=he(e,t,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),dn(o,r)},dn=(e,t)=>requestAnimationFrame(()=>{mt(e,t.height,t.width),requestAnimationFrame(()=>{Ft(e,0,ge,"width, min-width, height")})}),gn=(e,t,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(t)||!o&&(l!=null&&l.isSameNode(e)))return;mt(c,0,0),setTimeout(()=>{var d;(d=c.parentNode)==null||d.removeChild(c)},s+pe)})}},bt=(e,t,n=!1)=>{var s=e.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{e.contains(r)&&e.removeChild(r)},t+pe)):e.removeChild(o)})},pn=50;function hn(e,t,n,s,o,r){let c=t;const{direction:l,handlerSelector:u,onRemoveAtEvent:d,animationDuration:m,delayBeforeInsert:v,draggingClass:B}=e,O=(i,f,g,D,C)=>{if(!D)return;const{droppable:b,config:T}=D,A=Et(i,f,T.direction,b);_e(f)?P(i,f,A,g,D,C):y(i,f,A,D)},F=(i,f,g,D,C)=>{const b=Et(f,"insert",e.direction,g),{onInsertEvent:T}=e,A=ie(g);for(const[M,x]of A.entries())nt(x,Q)&&M>=i&&W(x,b);C(),setTimeout(()=>{T(i,D),me(i,g,e),et(f),_(f,n),bt(n,0,!0)},v)},h=(i,f,g,D)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:b}=g;let[T]=Rt(f,C);T=[f,...T].toReversed();const A=Et(f,"remove",b.direction,C);for(const[M,x]of T.entries())M>=i&&(Y(x,A),setTimeout(()=>{D(x)},m))},S=i=>{bt(n,m,!0),setTimeout(()=>{et(i),_(i,n)},m)},y=(i,f,g,D)=>{const{config:C,droppable:b}=D,[T]=Rt(i,b),A=ht(i,b);T.length==0&&I(g,1,C.direction,T);for(const[M,x]of T.entries()){if(!nt(x,Q))continue;const G=R(C.direction,i,x,g);if(!A&&G)g=G;else if(!A)continue;const J=T.length-M;I(g,J,C.direction,T),f===fe?Y(x,g):f===Nt&&W(x,g)}},R=(i,f,g,D)=>{const{before:C,distance:b,axis:T,getRect:A}=w(i),M=A(f),x=A(g),G=M[C],J=x[C],ft=x[b],St=J+ft/2,Dt=ye(g)[T],ct=St-Dt;return G>ct?{height:0,width:0}:D},I=(i,f,g,D)=>{const C=D.filter(T=>nt(T,Q)).length,{distance:b}=w(g);i[b]==0?c=Math.max(c,f):c=Math.min(c,f-1),c=Math.min(c,C)},Y=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g)},W=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g),Ft(i,m,de)},P=(i,f,g,D,C,b)=>{const{droppable:T,scroll:A,config:M}=C,[x,G]=Rt(i,T),J=x.toReversed(),ft=G===-1?J.length:G;J.splice(ft,0,i);const[St,Dt,ct]=st(i,G,J,T);g=Et(i,f,M.direction,n,St,Dt);const Pt=Ee(),At=Je(M.direction,J,G,ct,Pt,A,D,T,i);x.length==0&&H(void 0,g,i,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),f===zt&&!nt(wt,at)&&H(wt,Bt,i,At)}N(ct,i,M,T,b)},st=(i,f,g,D)=>{const b=ht(i,D)?f:c,T=()=>f<b?[b,b+1]:f>b?[b-1,b]:[b-1,b+1],[A,M]=T(),x=g[A]??null,G=g[M]??null;return[x,G,b]},H=(i,f,g,D)=>{Tt(i,f.height,f.width),Tt(g,D.height,D.width)},N=(i,f,g,D,C)=>{const{onInsertEvent:b,onDragEnd:T}=g;U(f,Wt),z(f,n,D,()=>{if(Ct(f,Wt),C!=null){const A=d(C,!0);A!=null&&(b(i,A,!0),T({value:A,index:i})),q(f),Z()}})},Z=()=>{if(s){var i=document.querySelectorAll(`${pt(s)} > .${Q}`);for(const f of i)$(f)}},q=i=>{setTimeout(()=>{Ct(i,B)},pn)},z=(i,f,g,D)=>{setTimeout(()=>{D&&D(),X(f,g),j(g),et(i),_(i,f),_(i,g)},m)},X=(i,f)=>{i.isSameNode(f)?bt(i,m):(bt(i,m,!0),bt(f,m))},j=i=>{if(n.isSameNode(i))return;var[f]=n.querySelectorAll(`.${at}`);if(!f)return;const{distance:g}=w(l);it(f)&&(f.style[g]="0px")},_=(i,f)=>{const[g]=Rt(i,f);for(const D of[...g,i])$(D)},$=i=>{it(i)&&(i.style.transition="",i.style.transform="")},et=i=>{r(),ut(i,!1),i.style.transform="",i.style.transition="",i.style.top="",i.style.left="",ue(i,{fixedHeight:"",fixedWidth:""})},ot=(i,f)=>{const g=f.querySelector(u);gt(document.body,se,i),gt(g||f,Yt,i)},ut=(i,f)=>{gt(i,Ht,f),ot(f,i),o.toggleGrabClass(!f)};return[O,h,F,S,ut]}const me=(e,t,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ie(t)[e];U(l,s),U(l,Zt),setTimeout(()=>{Ct(l,Zt),Ct(l,s),r.disconnect()},o)},t,{childList:!0})},mn=(e,t,n,s)=>{if(!t)return;const{onInsertEvent:o,delayBeforeInsert:r}=e;setTimeout(()=>{o(n,s),me(n,t,e)},r)},Sn=(e,t)=>{const n=(l,u)=>e.removeAtEvent(l,u),s=(l,u,d)=>e.insertEvent(l,u,d),o=()=>e.getLength(),r=l=>e.getValue(l),c=l=>l;return{direction:(t==null?void 0:t.direction)??tt,handlerSelector:(t==null?void 0:t.handlerSelector)??Q,draggingClass:(t==null?void 0:t.draggingClass)??"dragging",droppableClass:(t==null?void 0:t.droppableClass)??"droppable-hover",isDraggable:(t==null?void 0:t.isDraggable)??(()=>!0),onDragStart:(t==null?void 0:t.onDragStart)??(()=>{}),onDragEnd:(t==null?void 0:t.onDragEnd)??(()=>{}),droppableGroup:t==null?void 0:t.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(t==null?void 0:t.animationDuration)??200,removingClass:(t==null?void 0:t.removingClass)??"removing",insertingFromClass:(t==null?void 0:t.insertingFromClass)??"from-inserting",delayBeforeRemove:(t==null?void 0:t.delayBeforeRemove)??200,delayBeforeInsert:(t==null?void 0:t.delayBeforeInsert)??200,mapFrom:(t==null?void 0:t.mapFrom)??c}},Dn=(e,t)=>{const{config:n,droppable:s}=e,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:u=>{const{index:d,value:m}=u;r({index:d,value:t(m,s)})},onInsertEvent:(u,d)=>o(u,t(d,s),!0)}},vn=e=>{let t={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=u=>{e.style.transform=`translate( ${u.x}px, ${u.y}px)`},r=u=>{e.style.top=`${u.top}px`,e.style.left=`${u.left}px`};return[(u,d,m,v)=>{const B=h=>{const{beforeMargin:S,borderBeforeWidth:y,before:R,offset:I,scroll:Y,page:W,inner:P,distance:st,axis:H,getRect:N}=w(h),Z=m[W],q=window[Y],z=window[P],X=N(u)[st],j=L(u,y),_=L(u,S),$=Z-t[I],et=ce(u,h);if($>=q-X/2&&$<=q+z){const ut=$-n[R]-j-_-q-et;return O(h),ut}return s[H]},O=h=>{if(u&&nt(u,Ht)&&h===v){const{before:S,distance:y,axis:R,getRect:I}=w(v),Y=I(u)[y],W=I(d),P=n[S]-W[S]+s[R],H=W[y]-Y,N=P/H,Z=Y/H,q=.1,z=.2,X=.8;let j=0;const _=ht(u,d);!_&&N<z&&N>-Z?j=N/z-1:!_&&N>X&&N<1+Z&&(j=1/(1-X)*(N-X));const $=q*Y*j;sn(d,v,$)}},F=h=>{const{axis:S}=w(h);s[S]=B(h),o(s)};F(V),F(tt)},(u,d)=>{const[m,v,B,O]=En(u,d,e);n={top:m,left:v},r(n),t={offsetX:B,offsetY:O}}]},Lt=(e,t,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=w(e);return r(t)[o]-r(n)[o]-L(n,s)},bn=(e,t)=>{let{offsetX:n,offsetY:s,target:o}=e,r=Tn(o,t);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(V,c,r),s+=Lt(tt,c,r)),r&&t!=o&&(n+=Lt(V,r,t),s+=Lt(tt,r,t)),[n,s]},Tn=(e,t)=>{const n=e==null?void 0:e.closest(`.${Ot}`);return n&&n.isSameNode(t)?e:n},ne=(e,t,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:u}=w(e),d=ce(n,e);return t[c]-s[o]-L(n,r)-L(n,l)-window[u]-d},En=(e,t,n)=>{const[s,o]=bn(e,n);return[ne(tt,e,t,{offsetX:s,offsetY:o}),ne(V,e,t,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(t,n){const s=K.configs.filter(r=>!r.droppable.isSameNode(t)),o=Kt(t);s.push({droppable:t,config:n,scroll:o}),K.configs=s}static updateScrolls(t,n){for(const s of K.configs){const{droppable:o}=s;(n&&be(o,n)||o.isSameNode(t))&&(s.scroll=Kt(o))}}static getConfig(t){return K.configs.find(({droppable:s})=>s.isSameNode(t))}};k(K,"configs",[]),k(K,"removeObsoleteConfigs",()=>{const t=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=t});let lt=K;class Cn{constructor(t,n,s,o,r,c){k(this,"initial");k(this,"current");k(this,"parent");k(this,"draggableElement");k(this,"groupClass");k(this,"dragEvent");k(this,"changeDroppable");k(this,"mapFrom");this.parent=s,this.draggableElement=t,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(t,n,s){return document.elementsFromPoint(t,n).filter(o=>!o.isSameNode(s))}getElementBelow(t,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,t);return l};let r=null;return s?(t.hidden=!0,r=o(this),t.hidden=!1):r=o(this),r}getCurrent(t,n,s=!0){const o=this.getElementBelow(t,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(t){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(t,s))}isNotInsideAnotherDroppable(t,n){return!ht(t,n)||this.isOutsideOfAllDroppables(t)}onScrollEvent(){this.dragEvent()}setOnScroll(t){le(t,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(t){const n=lt.getConfig(t);if(n)return t.isSameNode(this.parent)?n:{...n,config:Dn(n,this.mapFrom)}}getCurrentConfig(t){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,t);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(t){const n=this.current;this.current=this.getCurrentConfig(t),this.changeDroppable(this.current,n)}isOutside(t,n=!0){const s=this.draggableElement;return!this.getCurrent(s,t,n)}}function yn(e,t,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:u,delayBeforeRemove:d,draggingClass:m,removingClass:v,onRemoveAtEvent:B,droppableClass:O,onDragStart:F}=n,h=yt(l).map(a=>`droppable-group-${a}`).join(" ");let S=0,y={scrollX:0,scrollY:0},R={pageX:0,pageY:0},I;const[Y,W]=vn(e),[P,st,H,N,Z]=hn(n,t,s,h,o,()=>S=0),q=()=>{U(e,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},X=()=>{if(c(e)){const a=e.querySelector(r);z(a||e)}},j=()=>{X(),q()},_=a=>{const p=a==null?void 0:a.querySelector(`.${Ot}`),E=p==null?void 0:p.parentElement;return p&&E&&nt(E,It)&&!E.isSameNode(s)?null:p},$=a=>{const p=_(a)??a;p&&c(a)&&($t(p,"onmousedown",M("mousemove","mouseup")),$t(p,"ontouchstart",M("touchmove","touchend")),et(p)),a!=null&&a.isSameNode(p)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const p=a.querySelectorAll("img");Array.from(p).forEach(E=>{E.onmousedown=()=>!1})},ot=()=>{if(R.pageX==0&&R.pageY==0||!i.current)return;const{droppable:a,config:p}=i.current;Y(e,a,R,p.direction),P(e,Nt,y,i.current)},ut=(a,p)=>{p&&S==2&&!(a!=null&&a.droppable.isSameNode(p.droppable))&&P(e,Nt,y,p)},i=new Cn(e,h,s,ot,ut,n.mapFrom),f=a=>{if(!i.current)return;const p=h?Array.from(document.querySelectorAll(pt(h))):[s];for(const E of p)E.classList.toggle(O,!a&&E.isSameNode(i.current.droppable))},g=a=>{i.updateConfig(a);const p=i.isOutside(a);f(p),S===1?ft(a):S===2&&(D(p),Dt(a))},D=(a=!0)=>{if(!i.current)return;const{droppable:p}=i.current;gn(p,s,h,u,a),!a&&Gt(e,s,S==1,i.current)},C=a=>{if(Xt(a)&&a.cancelable)a.preventDefault();else if(Xt(a))return;const p=_t(a);g(p)},b=(a,p)=>{a=="touchmove"?I=setTimeout(()=>{p()},200):p()},T=(a,p)=>{const{clientX:E,clientY:dt}=a,rt=document.elementFromPoint(E,dt),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&p&&vt&&!p.isSameNode(vt)},A=a=>{const p=n.onGetValue(t);return{index:t,element:a,value:p}},M=(a,p)=>E=>{if(T(E,e))return;lt.updateScrolls(s,h);const{scrollX:dt,scrollY:rt}=window;if(y={scrollX:dt,scrollY:rt},S===0){S=1;const vt=A(e);vt&&F(vt),b(a,()=>{a=="touchmove"&&(i.updateConfig(E),f(i.isOutside(E)),ft(E)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(p,G(a),{once:!0})}},x=a=>i.updateConfig(a),G=a=>p=>{f(!0);const E=_t(p);clearTimeout(I),At(i.isOutside(E,!1)),document.removeEventListener(a,C),i.updateConfig(E);const dt=i.getCurrentConfig(E);if(dt){const{droppable:rt}=dt;J(rt)}s.onscroll=null},J=a=>{if(a.onscroll=null,!h)return;const p=Array.from(document.querySelectorAll(pt(h)));for(const E of p)it(E)&&(E.onscroll=null)},ft=a=>{Gt(e,s,S==1,i.current),St(),P(e,fe,y,i.current),wt(e),W(a,e)},St=()=>{S=2},Dt=a=>{const{pageX:p,pageY:E}=a;R={pageX:p,pageY:E},ot()},ct=a=>le(a,"onscroll",Pt),Pt=()=>ot(),At=a=>{if(S!==2){S=0;return}S=3,xt(e),P(e,zt,y,a?i.initial:i.current,t)},xt=a=>{Ft(a,u,de),Tt(a,0,0)},wt=a=>{const{height:p,width:E}=a.getBoundingClientRect();ue(a,{fixedHeight:`${p}px`,fixedWidth:`${E}px`}),Z(a,!0),gt(a,m,!0),a.style.transition=""},Bt=a=>{if(!i.initial)return;const p=i.initial;a==t&&(U(e,v),setTimeout(()=>{B(t),Ct(e,v),Gt(e,s,S==1,i.initial),st(a,e,p,E=>{xt(E),N(e)})},d))},Se=(a,p)=>{(a===t||a===n.onGetLegth()&&t===a-1)&&H(a,e,s,p,()=>{fn(e,S==1,i.initial)})};return j(),$(e),[Bt,Se]}const An=(e,t)=>{e&&Te(t,e)},xn=()=>{Ie(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${oe}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Yt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${se}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function wn(e,t,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=e;if(!n)return[r,c];const u=yt(l).map(d=>`droppable-group-${d}`).join(" ");xn(),An(u,n);for(const d of n.children){const m=d.getAttribute(o),v=Ce(m),B=d;if(B&&v>=0){const[O,F]=yn(B,v,e,n,t);r.push(O),c.push(F)}}return[r,c]}function Bn(e,t,n,s="index"){let o=[],r=[];const c=Sn(e,n),l=h=>{for(const S of o)S(h)},u=(h,S)=>{if(c.onGetLegth()===0)e.insertToListEmpty(c,h,S);else for(const R of r)R(h,S)},d=h=>{const[S,y]=wn(c,t,h,s);o=S,r=y},m=h=>{const S=h.addedNodes.values().filter(R=>!ee(R)).toArray(),y=h.removedNodes.values().filter(R=>!ee(R)).toArray();return S.length>0||y.length>0},v=h=>{kt(()=>{d(h)},h,{childList:!0},m)},B=h=>{U(h,It)},O=h=>{lt.addConfig(h,c)};return[l,u,h=>{h&&(B(h),O(h),v(h),d(h),lt.removeObsoleteConfigs())}]}exports.GRAB_CLASS=oe;exports.addClass=U;exports.dragAndDrop=Bn;exports.insertToListEmpty=mn;exports.toggleClass=gt;
|
@@ -517,7 +517,7 @@ function hn(e, t, n, s, o, r) {
|
|
517
517
|
for (const [M, x] of A.entries())
|
518
518
|
et(x, Q) && M >= i && W(x, b);
|
519
519
|
C(), setTimeout(() => {
|
520
|
-
T(i, D),
|
520
|
+
T(i, D), he(i, g, e), tt(f), V(f, n), vt(n, 0, !0);
|
521
521
|
}, v);
|
522
522
|
}, h = (i, f, g, D) => {
|
523
523
|
if (!g || !g.droppable || !g.config)
|
@@ -652,8 +652,8 @@ function hn(e, t, n, s, o, r) {
|
|
652
652
|
const { onInsertEvent: b, onDragEnd: T } = g;
|
653
653
|
nt(f, Wt), z(f, n, D, () => {
|
654
654
|
if (Ct(f, Wt), C != null) {
|
655
|
-
const A = d(C);
|
656
|
-
A != null && (b(i, A), T({ value: A, index: i })), q(f), Z();
|
655
|
+
const A = d(C, !0);
|
656
|
+
A != null && (b(i, A, !0), T({ value: A, index: i })), q(f), Z();
|
657
657
|
}
|
658
658
|
});
|
659
659
|
}, Z = () => {
|
@@ -724,7 +724,7 @@ const he = (e, t, n) => {
|
|
724
724
|
o(n, s), he(n, t, e);
|
725
725
|
}, r);
|
726
726
|
}, mn = (e, t) => {
|
727
|
-
const n = (l) => e.removeAtEvent(l), s = (l, u) => e.insertEvent(l, u), o = () => e.getLength(), r = (l) => e.getValue(l), c = (l) => l;
|
727
|
+
const n = (l, u) => e.removeAtEvent(l, u), s = (l, u, d) => e.insertEvent(l, u, d), o = () => e.getLength(), r = (l) => e.getValue(l), c = (l) => l;
|
728
728
|
return {
|
729
729
|
direction: (t == null ? void 0 : t.direction) ?? U,
|
730
730
|
handlerSelector: (t == null ? void 0 : t.handlerSelector) ?? Q,
|
@@ -755,7 +755,7 @@ const he = (e, t, n) => {
|
|
755
755
|
const { index: d, value: m } = u;
|
756
756
|
r({ index: d, value: t(m, s) });
|
757
757
|
},
|
758
|
-
onInsertEvent: (u, d) => o(u, t(d, s))
|
758
|
+
onInsertEvent: (u, d) => o(u, t(d, s), !0)
|
759
759
|
};
|
760
760
|
}, Dn = (e) => {
|
761
761
|
let t = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("../HandlerPublisher-DIbGFZTl.cjs"),S=require("../index-_CLUJ2Ve.cjs"),m=require("react-dom");function A(a,l){const[e,n]=u.useState(a),i=u.useRef(e);u.useEffect(()=>{i.current=e},[e]);function f(t,r=!1){const s=i.current[t],c=()=>{n(o=>[...o.slice(0,t),...o.slice(t+1)])};return r?m.flushSync(c):c(),s}function g(t,r,s=!1){const c=()=>{n(o=>[...o.slice(0,t),r,...o.slice(t)])};s?m.flushSync(c):c()}function d(){return e.length}function h(t){return e[t]}function b(t,r,s){S.insertToListEmpty(t,l.current,r,s)}return[e,n,{removeAtEvent:f,insertEvent:g,getLength:d,getValue:h,insertToListEmpty:b}]}const D=new y.HandlerPublisher;function E(a,l){const e=u.useRef(null),[n,i,f]=A(a,e),[g,d,h]=S.dragAndDrop(f,D,l,"data-index");return u.useEffect(()=>{h(e.current)},[n.length]),[e,n,i,d,g]}exports.useDragAndDrop=E;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { useState as S, useRef as d, useEffect as h } from "react";
|
2
|
+
import { H as A } from "../HandlerPublisher-BrFNCUjc.js";
|
3
|
+
import { i as C, d as L } from "../index-ekBJgYrv.js";
|
4
|
+
import { flushSync as p } from "react-dom";
|
5
|
+
function b(a, u) {
|
6
|
+
const [t, n] = S(a), c = d(t);
|
7
|
+
h(() => {
|
8
|
+
c.current = t;
|
9
|
+
}, [t]);
|
10
|
+
function l(e, r = !1) {
|
11
|
+
const s = c.current[e], o = () => {
|
12
|
+
n((i) => [
|
13
|
+
...i.slice(0, e),
|
14
|
+
...i.slice(e + 1)
|
15
|
+
]);
|
16
|
+
};
|
17
|
+
return r ? p(o) : o(), s;
|
18
|
+
}
|
19
|
+
function f(e, r, s = !1) {
|
20
|
+
const o = () => {
|
21
|
+
n((i) => [
|
22
|
+
...i.slice(0, e),
|
23
|
+
r,
|
24
|
+
...i.slice(e)
|
25
|
+
]);
|
26
|
+
};
|
27
|
+
s ? p(o) : o();
|
28
|
+
}
|
29
|
+
function m() {
|
30
|
+
return t.length;
|
31
|
+
}
|
32
|
+
function g(e) {
|
33
|
+
return t[e];
|
34
|
+
}
|
35
|
+
function E(e, r, s) {
|
36
|
+
C(e, u.current, r, s);
|
37
|
+
}
|
38
|
+
return [t, n, {
|
39
|
+
removeAtEvent: l,
|
40
|
+
insertEvent: f,
|
41
|
+
getLength: m,
|
42
|
+
getValue: g,
|
43
|
+
insertToListEmpty: E
|
44
|
+
}];
|
45
|
+
}
|
46
|
+
const y = new A();
|
47
|
+
function k(a, u) {
|
48
|
+
const t = d(null), [n, c, l] = b(a, t), [f, m, g] = L(l, y, u, "data-index");
|
49
|
+
return h(() => {
|
50
|
+
g(t.current);
|
51
|
+
}, [n.length]), [t, n, c, m, f];
|
52
|
+
}
|
53
|
+
export {
|
54
|
+
k as useDragAndDrop
|
55
|
+
};
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { Config } from '../core';
|
2
|
+
|
3
|
+
export default function useDragAndDrop<T, E extends HTMLElement>(items: T[], config?: Config<T>): readonly [import('react').RefObject<E>, T[], import('react').Dispatch<import('react').SetStateAction<T[]>>, (index: number, value: T) => void, (index: number) => void];
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { RefObject } from 'react';
|
2
|
+
import { ListCondig } from '../../core';
|
3
|
+
|
4
|
+
export declare function useReactListConfig<T, E extends HTMLElement>(items: T[], parent: RefObject<E>): readonly [T[], import('react').Dispatch<import('react').SetStateAction<T[]>>, ListCondig<T>];
|
package/dist/svelte/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-
|
1
|
+
"use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-DIbGFZTl.cjs"),o=require("../index-_CLUJ2Ve.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
|
package/dist/svelte/index.d.ts
CHANGED
package/dist/svelte/index.mjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
var l = Object.defineProperty;
|
2
2
|
var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
3
|
var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
|
4
|
-
import { H as c } from "../HandlerPublisher-
|
5
|
-
import { i as m, d as u } from "../index-
|
4
|
+
import { H as c } from "../HandlerPublisher-BrFNCUjc.js";
|
5
|
+
import { i as m, d as u } from "../index-ekBJgYrv.js";
|
6
6
|
class h {
|
7
7
|
constructor(t) {
|
8
8
|
r(this, "items");
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { Config } from
|
1
|
+
import { Config } from '../core';
|
2
|
+
|
2
3
|
export default function useDragAndDrop<T>(items: T[], config?: Config<T>): readonly [(parent: HTMLElement) => {
|
3
4
|
destroy(): void;
|
4
5
|
}, (index: number, value: T) => void, (index: number) => void];
|
package/dist/vue/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-
|
1
|
+
"use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-DIbGFZTl.cjs"),u=require("../index-_CLUJ2Ve.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
|
package/dist/vue/index.d.ts
CHANGED
package/dist/vue/index.mjs
CHANGED
@@ -2,8 +2,8 @@ var l = Object.defineProperty;
|
|
2
2
|
var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
3
|
var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
|
4
4
|
import { ref as c, watch as m } from "vue";
|
5
|
-
import { H as h } from "../HandlerPublisher-
|
6
|
-
import { i as p, d as v } from "../index-
|
5
|
+
import { H as h } from "../HandlerPublisher-BrFNCUjc.js";
|
6
|
+
import { i as p, d as v } from "../index-ekBJgYrv.js";
|
7
7
|
const g = (n, t) => {
|
8
8
|
const e = n.value;
|
9
9
|
if (e.length <= 0)
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import { Ref } from
|
2
|
-
import { Config } from
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { Config } from '../core';
|
3
|
+
|
3
4
|
export default function useDragAndDrop<T>(items: Ref<T[]>, config?: Config<T>): readonly [Ref<HTMLElement | undefined, HTMLElement | undefined>, (index: number, value: T) => void, (index: number) => void];
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { Ref } from
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
|
2
3
|
export declare const removeAtEventOnList: <T>(list: Ref<T[]>, index: number) => T | undefined;
|
3
4
|
export declare const onInsertEventOnList: <T>(list: Ref<T[]>, index: number, value: T) => void;
|
4
5
|
export declare const getLength: <T>(list: Ref<T[]>) => number;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CoreConfig } from
|
2
|
-
import {
|
3
|
-
|
1
|
+
import { CoreConfig, ListCondig } from '../../core';
|
2
|
+
import { Ref } from 'vue';
|
3
|
+
|
4
4
|
export declare class VueListCondig<T> implements ListCondig<T> {
|
5
5
|
private items;
|
6
6
|
private parent;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "fluid-dnd",
|
3
|
-
"version": "1.
|
4
|
-
"description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue
|
3
|
+
"version": "1.2.0-beta.0",
|
4
|
+
"description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue, react and svelte",
|
5
5
|
"type": "module",
|
6
6
|
"homepage": "https://fluid-dnd.netlify.app",
|
7
7
|
"repository": {
|
@@ -23,6 +23,11 @@
|
|
23
23
|
"import": "./dist/svelte/index.mjs",
|
24
24
|
"require": "./dist/svelte/index.cjs"
|
25
25
|
},
|
26
|
+
"./react": {
|
27
|
+
"types": "./dist/react/index.d.ts",
|
28
|
+
"import": "./dist/react/index.mjs",
|
29
|
+
"require": "./dist/react/index.cjs"
|
30
|
+
},
|
26
31
|
".": {
|
27
32
|
"types": "./dist/index.d.ts",
|
28
33
|
"import": "./dist/index.mjs",
|
@@ -32,20 +37,17 @@
|
|
32
37
|
"types": "./index.d.ts",
|
33
38
|
"keywords": [
|
34
39
|
"vue",
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"component",
|
40
|
+
"react",
|
41
|
+
"svelte",
|
38
42
|
"dnd",
|
39
43
|
"library",
|
40
44
|
"drag",
|
41
45
|
"drop",
|
42
|
-
"dragging",
|
43
46
|
"drag&drop",
|
44
47
|
"drag-n-drop",
|
45
48
|
"draggable",
|
46
49
|
"droppable",
|
47
50
|
"sortable",
|
48
|
-
"lightweight",
|
49
51
|
"dependency-free",
|
50
52
|
"fluid-dnd"
|
51
53
|
],
|
@@ -59,6 +61,8 @@
|
|
59
61
|
"eslint-plugin-vue": "^9.33.0",
|
60
62
|
"@types/node": "^20.12.5",
|
61
63
|
"@vitejs/plugin-vue": "^4.5.2",
|
64
|
+
"@types/react": "^18.3.20",
|
65
|
+
"@types/react-dom": "^19.1.2",
|
62
66
|
"jsdom": "^24.0.0",
|
63
67
|
"typescript": "^5.2.2",
|
64
68
|
"vite": "^5.0.8",
|
@@ -71,7 +75,7 @@
|
|
71
75
|
},
|
72
76
|
"scripts": {
|
73
77
|
"dev": "cd my-test-examples && vite",
|
74
|
-
"build": "
|
78
|
+
"build": "tsc && vite build",
|
75
79
|
"preview": "vite preview",
|
76
80
|
"test": "vitest"
|
77
81
|
}
|
package/dist/index.d.ts
DELETED