forked from gridstack/gridstack.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
another BIG, BIG change * converted all code to Typescript * initial bundling with webpack to `gridstack.all.js` for browser inclusion * added index.ts to include all modules and dependencies for build * part-2 of gridstack gridstack#1084 TODO: * modified float.html to test new code. still not running (missing `GridStack` export) * need to use tsc to output for typescript native files ?
- Loading branch information
Showing
22 changed files
with
4,422 additions
and
2,952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
{ | ||
"name": "gridstack", | ||
"version": "1.1.0-dev", | ||
"description": "JavaScript / TypeScript for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)", | ||
"main": "dist/gridstack", | ||
"version": "2.0.0-rc", | ||
"description": "TypeScript/Javascript lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/gridstack/gridstack.js.git" | ||
}, | ||
"scripts": { | ||
"build": "grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md", | ||
"test": "grunt lint && karma start karma.conf.js", | ||
"lint": "grunt lint", | ||
"build": "yarn --no-progress && rm -rf dist/* && webpack && grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md", | ||
"web": "rm -rf dist/* && webpack", | ||
"test": "yarn lint && karma start karma.conf.js", | ||
"lint": "tslint -p ./tsconfig.json", | ||
"reset": "rm -rf dist node_modules", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
"keywords": [ | ||
"JavaScript", | ||
"Typescript", | ||
"gridstack.js", | ||
"grid", | ||
"gridster", | ||
|
@@ -27,7 +29,7 @@ | |
"widgets", | ||
"Angular", | ||
"React", | ||
"Typescript" | ||
"JavaScript" | ||
], | ||
"author": "Pavel Reznikov <[email protected]>", | ||
"contributors": [ | ||
|
@@ -41,6 +43,8 @@ | |
"homepage": "http://gridstack.github.io/gridstack.js/", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/jquery": "^3.3.32", | ||
"@types/jqueryui": "^1.12.10", | ||
"connect": "^3.7.0", | ||
"core-js": "^3.6.4", | ||
"coveralls": "^3.0.9", | ||
|
@@ -64,7 +68,11 @@ | |
"karma-jasmine": "^3.1.1", | ||
"node-sass": "^4.13.1", | ||
"puppeteer": "^2.1.1", | ||
"serve-static": "^1.14.1" | ||
"serve-static": "^1.14.1", | ||
"ts-loader": "^6.2.1", | ||
"typescript": "3.4.5", | ||
"webpack": "^4.42.0", | ||
"webpack-cli": "^3.3.11" | ||
}, | ||
"resolutions": { | ||
"lodash": "^4.17.13", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// gridstack-dragdrop-plugin.ts 2.0.0-rc @preserve | ||
|
||
/** | ||
* https://gridstackjs.com/ | ||
* (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov | ||
* gridstack.js may be freely distributed under the MIT license. | ||
*/ | ||
|
||
import { GridStack } from './gridstack'; | ||
import { GridStackElement } from './types'; | ||
|
||
/** drag&drop options currently called from the main code, but others can be passed in grid options */ | ||
export type DDOpts = 'enable' | 'disable' | 'option' | {} | any; | ||
export type DDKey = 'minWidth' | 'minHeight' | string; | ||
|
||
/** | ||
* Base class for drag'n'drop plugin. | ||
*/ | ||
export class GridStackDragDropPlugin { | ||
protected grid: GridStack; | ||
static registeredPlugins = []; | ||
|
||
static registerPlugin(pluginClass) { | ||
GridStackDragDropPlugin.registeredPlugins.push(pluginClass); | ||
}; | ||
|
||
public constructor(grid: GridStack) { | ||
this.grid = grid; | ||
} | ||
|
||
public resizable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin { | ||
return this; | ||
}; | ||
|
||
public draggable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin { | ||
return this; | ||
}; | ||
|
||
public droppable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin { | ||
return this; | ||
}; | ||
|
||
public isDroppable(el: GridStackElement): boolean { | ||
return false; | ||
}; | ||
|
||
public on(el: GridStackElement, eventName: string, callback): GridStackDragDropPlugin { | ||
return this; | ||
}; | ||
} |
Oops, something went wrong.