1- // jqueryui- gridstack-dragdrop-plugin .ts 2.0.0-rc @preserve
1+ // gridstack-dd-jqueryui .ts 2.0.0-rc @preserve
22
33/** JQuery UI Drag&Drop plugin
44 * https://gridstackjs.com/
77*/
88
99import { GridStack , GridStackElement } from '../gridstack' ;
10- import { GridStackDragDropPlugin , DDOpts , DDKey , DDDropOpt , DDCallback , DDValue } from '../gridstack-dragdrop-plugin ' ;
10+ import { GridStackDD , DDOpts , DDKey , DDDropOpt , DDCallback , DDValue } from '../gridstack-dd ' ;
1111import { GridItemHTMLElement , DDDragInOpt } from '../types' ;
1212
1313// TODO: TEMPORARY until can remove jquery-ui drag&drop and this class and use HTML5 instead !
@@ -18,12 +18,12 @@ import './jquery-ui.js';
1818/**
1919 * Jquery-ui based drag'n'drop plugin.
2020 */
21- export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
21+ export class GridStackDDJQueryUI extends GridStackDD {
2222 public constructor ( grid : GridStack ) {
2323 super ( grid ) ;
2424 }
2525
26- public resizable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
26+ public resizable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDD {
2727 let $el : JQuery = $ ( el ) ;
2828 if ( opts === 'disable' || opts === 'enable' ) {
2929 $el . resizable ( opts ) ;
@@ -44,7 +44,7 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
4444 return this ;
4545 }
4646
47- public draggable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
47+ public draggable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDD {
4848 let $el : JQuery = $ ( el ) ;
4949 if ( opts === 'disable' || opts === 'enable' ) {
5050 $el . draggable ( opts ) ;
@@ -66,13 +66,13 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
6666 return this ;
6767 }
6868
69- public dragIn ( el : GridStackElement , opts : DDDragInOpt ) : GridStackDragDropPlugin {
69+ public dragIn ( el : GridStackElement , opts : DDDragInOpt ) : GridStackDD {
7070 let $el : JQuery = $ ( el ) ;
7171 $el . draggable ( opts ) ;
7272 return this ;
7373 }
7474
75- public droppable ( el : GridItemHTMLElement , opts : DDOpts | DDDropOpt , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
75+ public droppable ( el : GridItemHTMLElement , opts : DDOpts | DDDropOpt , key ?: DDKey , value ?: DDValue ) : GridStackDD {
7676 let $el : JQuery = $ ( el ) ;
7777 if ( typeof opts . accept === 'function' && ! opts . _accept ) {
7878 // convert jquery event to generic element
@@ -93,18 +93,18 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
9393 return Boolean ( $el . data ( 'ui-draggable' ) ) ;
9494 }
9595
96- public on ( el : GridItemHTMLElement , name : string , callback : DDCallback ) : GridStackDragDropPlugin {
96+ public on ( el : GridItemHTMLElement , name : string , callback : DDCallback ) : GridStackDD {
9797 let $el : JQuery = $ ( el ) ;
9898 $el . on ( name , ( event , ui ) => { callback ( event as any , ui . draggable ? ui . draggable . get ( 0 ) : event . target ) } ) ;
9999 return this ;
100100 }
101101
102- public off ( el : GridItemHTMLElement , name : string ) : GridStackDragDropPlugin {
102+ public off ( el : GridItemHTMLElement , name : string ) : GridStackDD {
103103 let $el : JQuery = $ ( el ) ;
104104 $el . off ( name ) ;
105105 return this ;
106106 }
107107}
108108
109109// finally register ourself
110- GridStackDragDropPlugin . registerPlugin ( JQueryUIGridStackDragDropPlugin ) ;
110+ GridStackDD . registerPlugin ( GridStackDDJQueryUI ) ;
0 commit comments