gridstack
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -10,3 +10,3 @@ /** | ||
export declare type DDDropOpt = { | ||
/** function or class type that this grid will accept as dropped items (see GridstackOptions.acceptWidgets) */ | ||
/** function or class type that this grid will accept as dropped items (see GridStackOptions.acceptWidgets) */ | ||
accept?: (el: GridItemHTMLElement) => boolean; | ||
@@ -13,0 +13,0 @@ }; |
"use strict"; | ||
// gridstack-dd.ts 2.0.0 @preserve | ||
// gridstack-dd.ts 2.0.1 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +4,0 @@ /** |
"use strict"; | ||
// gridstack-engine.ts 2.0.0 @preserve | ||
// gridstack-engine.ts 2.0.1 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -173,2 +173,3 @@ /** | ||
node = node || {}; | ||
node._id = node._id || GridStackEngine._idSeq++; | ||
// if we're missing position, have the grid position us automatically (before we set them to 0,0) | ||
@@ -286,3 +287,2 @@ if (node.x === undefined || node.y === undefined || node.x === null || node.y === null) { | ||
node = this.prepareNode(node); | ||
node._id = node._id || GridStackEngine._idSeq++; | ||
if (node.autoPosition) { | ||
@@ -289,0 +289,0 @@ this._sortNodes(); |
@@ -9,3 +9,3 @@ /** | ||
import { Utils } from './utils'; | ||
import { GridItemHTMLElement, GridStackWidget, GridStackNode, GridstackOptions, numberOrString } from './types'; | ||
import { GridItemHTMLElement, GridStackWidget, GridStackNode, GridStackOptions, numberOrString } from './types'; | ||
import { GridStackDD } from './gridstack-dd'; | ||
@@ -57,3 +57,3 @@ export * from './types'; | ||
*/ | ||
static init(options?: GridstackOptions, elOrString?: GridStackElement): GridStack; | ||
static init(options?: GridStackOptions, elOrString?: GridStackElement): GridStack; | ||
/** | ||
@@ -68,3 +68,3 @@ * Will initialize a list of elements (given a selector) and return an array of grids. | ||
*/ | ||
static initAll(options?: GridstackOptions, selector?: string): GridStack[]; | ||
static initAll(options?: GridStackOptions, selector?: string): GridStack[]; | ||
/** scoping so users can call GridStack.Utils.sort() for example */ | ||
@@ -79,3 +79,3 @@ static Utils: typeof Utils; | ||
/** grid options - public for classes to access, but use methods to modify! */ | ||
opts: GridstackOptions; | ||
opts: GridStackOptions; | ||
/** current drag&drop plugin being used */ | ||
@@ -88,3 +88,3 @@ dd: GridStackDD; | ||
*/ | ||
constructor(el: GridHTMLElement, opts?: GridstackOptions); | ||
constructor(el: GridHTMLElement, opts?: GridStackOptions); | ||
/** | ||
@@ -125,5 +125,5 @@ * add a new widget and returns it. | ||
*/ | ||
getCellHeight(): number; | ||
getCellHeight(forcePixel?: boolean): number; | ||
/** | ||
* Update current cell height - see `GridstackOptions.cellHeight` for format. | ||
* Update current cell height - see `GridStackOptions.cellHeight` for format. | ||
* This method rebuilds an internal CSS style sheet. | ||
@@ -241,3 +241,3 @@ * Note: You can expect performance issues if call this method too often. | ||
* grid.el.appendChild('<div id="gsi-1" data-gs-width="3"></div>'); | ||
* grid.makeWidget('gsi-1'); | ||
* grid.makeWidget('#gsi-1'); | ||
*/ | ||
@@ -349,5 +349,5 @@ makeWidget(els: GridStackElement): GridItemHTMLElement; | ||
/** | ||
* Updates the margins which will set all 4 sides at once - see `GridstackOptions.margin` for format options. | ||
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options. | ||
* @param value new vertical margin value | ||
* Note: you can instead use `marginTop | marginBottom | marginLeft | marginRight` GridstackOptions to set the sides separately. | ||
* Note: you can instead use `marginTop | marginBottom | marginLeft | marginRight` GridStackOptions to set the sides separately. | ||
*/ | ||
@@ -375,2 +375,11 @@ margin(value: numberOrString): GridStack; | ||
willItFit(x: number, y: number, width: number, height: number, autoPosition: boolean): boolean; | ||
/** called to resize children nested grids when we/item resizes */ | ||
private _resizeNestedGrids; | ||
/** | ||
* called when we are being resized by the window - check if the one Column Mode needs to be turned on/off | ||
* and remember the prev columns we used, as well as check for auto cell height (square) | ||
*/ | ||
onParentResize(): GridStack; | ||
/** add or remove the window size event handler */ | ||
private _updateWindowResizeEvent; | ||
} |
"use strict"; | ||
// gridstack-dd-jqueryui.ts 2.0.0 @preserve | ||
// gridstack-dd-jqueryui.ts 2.0.1 @preserve | ||
function __export(m) { | ||
@@ -4,0 +4,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export interface GridstackOptions { | ||
export interface GridStackOptions { | ||
/** | ||
@@ -128,3 +128,3 @@ * accept widgets dragged from other grids or from outside (default: `false`). Can be: | ||
/** | ||
* Gridstack Widget creation options | ||
* GridStack Widget creation options | ||
*/ | ||
@@ -131,0 +131,0 @@ export interface GridStackWidget { |
"use strict"; | ||
// types.ts 2.0.0 @preserve | ||
// types.ts 2.0.1 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=types.js.map |
@@ -6,9 +6,9 @@ /** | ||
*/ | ||
import { GridStackWidget, GridStackNode, GridstackOptions, numberOrString } from './types'; | ||
import { GridStackWidget, GridStackNode, GridStackOptions, numberOrString } from './types'; | ||
/** checks for obsolete method names */ | ||
export declare function obsolete(self: any, f: any, oldName: string, newName: string, rev: string): (...args: any[]) => any; | ||
/** checks for obsolete grid options (can be used for any fields, but msg is about options) */ | ||
export declare function obsoleteOpts(opts: GridstackOptions, oldName: string, newName: string, rev: string): void; | ||
export declare function obsoleteOpts(opts: GridStackOptions, oldName: string, newName: string, rev: string): void; | ||
/** checks for obsolete grid options which are gone */ | ||
export declare function obsoleteOptsDel(opts: GridstackOptions, oldName: string, rev: string, info: string): void; | ||
export declare function obsoleteOptsDel(opts: GridStackOptions, oldName: string, rev: string, info: string): void; | ||
/** checks for obsolete Jquery element attributes */ | ||
@@ -15,0 +15,0 @@ export declare function obsoleteAttr(el: HTMLElement, oldName: string, newName: string, rev: string): void; |
"use strict"; | ||
// utils.ts 2.0.0 @preserve | ||
// utils.ts 2.0.1 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +4,0 @@ /** checks for obsolete method names */ |
@@ -8,3 +8,4 @@ Change log | ||
- [2.0.0-dev (2020-09-07)](#200-dev-2020-09-07) | ||
- [2.0.1 (2020-09-26)](#201-2020-09-26) | ||
- [2.0.0 (2020-09-07)](#200-2020-09-07) | ||
- [1.2.1 (2020-09-04)](#121-2020-09-04) | ||
@@ -40,4 +41,14 @@ - [1.2.0 (2020-08-01)](#120-2020-08-01) | ||
## 2.0.0-dev (2020-09-07) | ||
## 2.0.1 (2020-09-26) | ||
- fix `minWidth()`, `minHeight()`, `maxHeight()` to set node value as well [1359](https://github.com/gridstack/gridstack.js/issues/1359) | ||
- fix `GridStackOptions` spelling [1359](https://github.com/gridstack/gridstack.js/issues/1359) | ||
- fix remove window resize event when `grid.destroy()` [1369](https://github.com/gridstack/gridstack.js/issues/1369) | ||
- fix nested grid resize [1361](https://github.com/gridstack/gridstack.js/issues/1361) | ||
- fix resize with `cellHeight` '6rem' '6em' not working [1356](https://github.com/gridstack/gridstack.js/issues/1356) | ||
- fix preserve attributes (min/max/id/etc...) when dragging between grids [1367](https://github.com/gridstack/gridstack.js/issues/1367) | ||
- fix 2 drop shadows when dragging between grids [393](https://github.com/gridstack/gridstack.js/issues/393) | ||
## 2.0.0 (2020-09-07) | ||
- re-write to native Typescript, removing all JQuery from main code and API (drag&drop plugin still using jqueryui for now) | ||
@@ -44,0 +55,0 @@ - add `getGridItems()` to return list of HTML grid items |
@@ -153,3 +153,3 @@ gridstack.js API | ||
The Typescript `GridStackEvent` list all possible values, and nothing else is supported by the `grid.on()` method, though it's possible to register directly for other events generated by the drag&drop plugging implementation detail (currently jquery-ui based). | ||
The Typescript `GridStackEvent` list all possible values, and nothing else is supported by the `grid.on()` method, though it's possible to register directly for other events generated by the drag&drop plugging implementation detail (currently jquery-ui based so you can still use `$(".grid-stack").on(...)`). | ||
@@ -415,3 +415,3 @@ ### added(event, items) | ||
grid.el.appendChild('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2" data-gs-auto-position="true"></div>') | ||
grid.makeWidget('gsi-1'); | ||
grid.makeWidget('#gsi-1'); | ||
``` | ||
@@ -418,0 +418,0 @@ |
{ | ||
"name": "gridstack", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "TypeScript/Javascript lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)", | ||
@@ -5,0 +5,0 @@ "main": "./dist/gridstack.js", |
@@ -9,3 +9,2 @@ gridstack.js | ||
[![downloads](https://img.shields.io/npm/dm/gridstack.svg)](https://www.npmjs.com/package/gridstack) | ||
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/alaind831) | ||
@@ -18,4 +17,7 @@ Mobile-friendly Javascript library (with Typescript bindings) for dashboard layout and creation. Making a drag-and-drop, multi-column responsive dashboard has never been easier. Allows you to build draggable, responsive bootstrap v4-friendly layouts. It also has multiple bindings and works great with [React](https://reactjs.org/), [Angular](https://angular.io/), [Knockout.js](http://knockoutjs.com), [Ember](https://www.emberjs.com/) and others. Includes Typescript defines. | ||
If you find this lib useful, please [donate](https://www.paypal.me/alaind831) and help support it! | ||
If you find this lib useful, please donate [PayPal](https://www.paypal.me/alaind831) or [Venmo](https://www.venmo.com/adumesny) (adumesny) and help support it! | ||
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/alaind831) | ||
[![Donate](https://img.shields.io/badge/Donate-Venmo-g.svg)](https://www.venmo.com/adumesny) | ||
Join us on Slack: https://gridstackjs.troolee.com | ||
@@ -67,5 +69,5 @@ | ||
```bash | ||
yarn install gridstack | ||
or | ||
```js | ||
yarn add gridstack | ||
// or | ||
npm install --save gridstack | ||
@@ -100,4 +102,4 @@ ``` | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.0/dist/gridstack.min.css" /> | ||
<script src="https://cdn.jsdelivr.net/npm/gridstack@2.0.0/dist/gridstack.all.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.1/dist/gridstack.min.css" /> | ||
<script src="https://cdn.jsdelivr.net/npm/gridstack@2.0.1/dist/gridstack.all.js"></script> | ||
``` | ||
@@ -154,3 +156,3 @@ | ||
Gridstack no longer requires external dependencies as of v1.0.0 (lodash was removed in v0.5.0 and jquery API in v1.0.0). All you need to include is `gridstack.all.js` and `gridstack.css` (layouts are done using CSS column based %). | ||
GridStack no longer requires external dependencies as of v1.0.0 (lodash was removed in v0.5.0 and jquery API in v1.0.0). All you need to include is `gridstack.all.js` and `gridstack.css` (layouts are done using CSS column based %). | ||
@@ -182,2 +184,3 @@ ## API Documentation | ||
- vue.js: see [demo](https://github.com/gridstack/gridstack.js/blob/develop/demo/vuejs.html) | ||
- ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack) | ||
@@ -200,3 +203,3 @@ - AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular) | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.1.2/dist/gridstack-extra.css"/> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.1/dist/gridstack-extra.css"/> | ||
@@ -365,4 +368,6 @@ <div class="grid-stack grid-stack-N">...</div> | ||
Note: v2.0.-rc does not currently support importing GridStack Drag&Drop without also including our jquery + jqueryui. Still trying to figure how to make that bundle possible. | ||
Note: v2.0.0 does not currently support importing GridStack Drag&Drop without also including our jquery + jqueryui. Still trying to figure how to make that bundle possible. You will have to use 1.x | ||
As for events, you can still use `$(".grid-stack").on(...)` while jqueryui is used internally for things we don't support, but recommended you don't as that will get dropped at some point. | ||
## Migrating to v2 | ||
@@ -374,3 +379,3 @@ | ||
1. In general methods that used no args (getter) vs setter can't be used in TS when the arguments differ (set/get are also not function calls so API would have changed). Instead we decided to have <b>all set methods return</b> `GridStack` to they can be chain-able (ex: `grid.float(true).cellHeight(10).column(6)`). Also legacy methods that used to take many parameters will now take a single object (typically `GridstackOptions` or `GridStackWidget`). | ||
1. In general methods that used no args (getter) vs setter can't be used in TS when the arguments differ (set/get are also not function calls so API would have changed). Instead we decided to have <b>all set methods return</b> `GridStack` to they can be chain-able (ex: `grid.float(true).cellHeight(10).column(6)`). Also legacy methods that used to take many parameters will now take a single object (typically `GridStackOptions` or `GridStackWidget`). | ||
@@ -377,0 +382,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1881872
395
5681