fluid-dnd
Version:
An agnostic drag and drop library to sort all kind of lists. With current support for vue, react and svelte
27 lines (26 loc) • 781 B
JavaScript
import { getLength, getValue, onInsertEventOnList, removeAtEventOnList } from './DropMethods';
export class VueListCondig {
items;
parent;
constructor(items, parent) {
this.items = items;
this.parent = parent;
}
removeAtEvent(index) {
return removeAtEventOnList(this.items, index);
}
insertEvent(index, value) {
return onInsertEventOnList(this.items, index, value);
}
getLength() {
return getLength(this.items);
}
getValue(index) {
return getValue(this.items, index);
}
insertToListEmpty(config, index, value) {
import('../../core/events/insert').then(({ insertToListEmpty }) => {
insertToListEmpty(config, this.parent.value, index, value);
});
}
}