gridstack
Advanced tools
Comparing version 2.0.1 to 2.0.2
"use strict"; | ||
// gridstack-dd.ts 2.0.1 @preserve | ||
// gridstack-dd.ts 2.0.2 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +4,0 @@ /** |
"use strict"; | ||
// gridstack-engine.ts 2.0.1 @preserve | ||
// gridstack-engine.ts 2.0.2 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +4,0 @@ /** |
@@ -125,2 +125,85 @@ // gridstack-poly.js 2.0.0 @preserve | ||
}); | ||
} | ||
// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md | ||
(function (arr) { | ||
arr.forEach(function (item) { | ||
if (item.hasOwnProperty('append')) { | ||
return; | ||
} | ||
Object.defineProperty(item, 'append', { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: function append() { | ||
var argArr = Array.prototype.slice.call(arguments), | ||
docFrag = document.createDocumentFragment(); | ||
argArr.forEach(function (argItem) { | ||
var isNode = argItem instanceof Node; | ||
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); | ||
}); | ||
this.appendChild(docFrag); | ||
} | ||
}); | ||
}); | ||
})([Element.prototype, Document.prototype, DocumentFragment.prototype]); | ||
// Production steps of ECMA-262, Edition 5, 15.4.4.18 | ||
// Reference: http://es5.github.io/#x15.4.4.18 | ||
if (!Array.prototype['forEach']) { | ||
Array.prototype.forEach = function(callback, thisArg) { | ||
if (this == null) { throw new TypeError('Array.prototype.forEach called on null or undefined'); } | ||
var T, k; | ||
// 1. Let O be the result of calling toObject() passing the | ||
// |this| value as the argument. | ||
var O = Object(this); | ||
// 2. Let lenValue be the result of calling the Get() internal | ||
// method of O with the argument "length". | ||
// 3. Let len be toUint32(lenValue). | ||
var len = O.length >>> 0; | ||
// 4. If isCallable(callback) is false, throw a TypeError exception. | ||
// See: http://es5.github.com/#x9.11 | ||
if (typeof callback !== "function") { throw new TypeError(callback + ' is not a function'); } | ||
// 5. If thisArg was supplied, let T be thisArg; else let | ||
// T be undefined. | ||
if (arguments.length > 1) { T = thisArg; } | ||
// 6. Let k be 0 | ||
k = 0; | ||
// 7. Repeat, while k < len | ||
while (k < len) { | ||
var kValue; | ||
// a. Let Pk be ToString(k). | ||
// This is implicit for LHS operands of the in operator | ||
// b. Let kPresent be the result of calling the HasProperty | ||
// internal method of O with argument Pk. | ||
// This step can be combined with c | ||
// c. If kPresent is true, then | ||
if (k in O) { | ||
// i. Let kValue be the result of calling the Get internal | ||
// method of O with argument Pk. | ||
kValue = O[k]; | ||
// ii. Call the Call internal method of callback with T as | ||
// the this value and argument list containing kValue, k, and O. | ||
callback.call(T, kValue, k, O); | ||
} | ||
// d. Increase k by 1. | ||
k++; | ||
} | ||
// 8. return undefined | ||
}; | ||
} |
@@ -6,3 +6,2 @@ /** | ||
*/ | ||
import './gridstack-poly.js'; | ||
import { GridStackEngine } from './gridstack-engine'; | ||
@@ -9,0 +8,0 @@ import { Utils } from './utils'; |
"use strict"; | ||
// gridstack-dd-jqueryui.ts 2.0.1 @preserve | ||
// gridstack-dd-jqueryui.ts 2.0.2 @preserve | ||
function __export(m) { | ||
@@ -4,0 +4,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; |
"use strict"; | ||
// types.ts 2.0.1 @preserve | ||
// types.ts 2.0.2 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=types.js.map |
@@ -7,2 +7,6 @@ /** | ||
import { GridStackWidget, GridStackNode, GridStackOptions, numberOrString } from './types'; | ||
export interface HeightData { | ||
height: number; | ||
unit: string; | ||
} | ||
/** checks for obsolete method names */ | ||
@@ -42,7 +46,6 @@ export declare function obsolete(self: any, f: any, oldName: string, newName: string, rev: string): (...args: any[]) => any; | ||
static toNumber(value: null | string): number | null; | ||
static parseHeight(val: numberOrString): { | ||
height: number; | ||
unit: string; | ||
}; | ||
static defaults(target: any, ...sources: any[]): any; | ||
static parseHeight(val: numberOrString): HeightData; | ||
/** copies unset fields in target to use the given default sources values */ | ||
static defaults(target: any, ...sources: any[]): {}; | ||
/** makes a shallow copy of the passed json struct */ | ||
static clone(target: {}): {}; | ||
@@ -49,0 +52,0 @@ /** return the closest parent matching the given class */ |
"use strict"; | ||
// utils.ts 2.0.1 @preserve | ||
// utils.ts 2.0.2 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -137,10 +137,18 @@ /** checks for obsolete method names */ | ||
} | ||
return { height: height, unit: heightUnit }; | ||
return { height, unit: heightUnit }; | ||
} | ||
/** copies unset fields in target to use the given default sources values */ | ||
static defaults(target, ...sources) { | ||
sources.forEach(function (source) { | ||
for (let prop in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, prop) && (target[prop] === null || target[prop] === undefined)) { | ||
target[prop] = source[prop]; | ||
sources.forEach(source => { | ||
for (const key in source) { | ||
if (!source.hasOwnProperty(key)) { | ||
return; | ||
} | ||
if (target[key] === null || target[key] === undefined) { | ||
target[key] = source[key]; | ||
} | ||
else if (typeof source[key] === 'object' && typeof target[key] === 'object') { | ||
// property is an object, recursively add it's field over... #1373 | ||
this.defaults(target[key], source[key]); | ||
} | ||
} | ||
@@ -150,2 +158,3 @@ }); | ||
} | ||
/** makes a shallow copy of the passed json struct */ | ||
static clone(target) { | ||
@@ -166,7 +175,7 @@ return Object.assign({}, target); // was $.extend({}, target) | ||
let isWaiting = false; | ||
return function (...args) { | ||
return (...args) => { | ||
if (!isWaiting) { | ||
callback.apply(this, args); | ||
isWaiting = true; | ||
setTimeout(function () { isWaiting = false; }, delay); | ||
setTimeout(() => isWaiting = false, delay); | ||
} | ||
@@ -173,0 +182,0 @@ }; |
@@ -8,2 +8,4 @@ Change log | ||
- [2.0.2-dev](#202-dev) | ||
- [2.0.2 (2020-10-05)](#202-2020-10-05) | ||
- [2.0.1 (2020-09-26)](#201-2020-09-26) | ||
@@ -41,2 +43,11 @@ - [2.0.0 (2020-09-07)](#200-2020-09-07) | ||
## 2.0.2-dev | ||
- TBD | ||
## 2.0.2 (2020-10-05) | ||
- fix `animate` to not re-create CSS style each time (should be faster too) and made it default now since so much nicer. pass `{animate: false}` grid options if you want instant again [937](https://github.com/gridstack/gridstack.js/issues/937) | ||
- fix `resizable: { handles: ...}` forcing `alwaysShowResizeHandle` behavior [1373](https://github.com/gridstack/gridstack.js/issues/1373) | ||
## 2.0.1 (2020-09-26) | ||
@@ -63,2 +74,3 @@ | ||
- add optional params to `removeWidget()` to have quiet mode (no callbacks) | ||
- drop support for IE11 due to more compact ES6 output and newer TS code | ||
@@ -65,0 +77,0 @@ ## 1.2.1 (2020-09-04) |
@@ -77,3 +77,3 @@ gridstack.js API | ||
See [example](http://gridstack.github.io/gridstack.js/demo/advance.html) | ||
- `animate` - turns animation on (default: `false`) | ||
- `animate` - turns animation on to smooth transitions (default: `true`) | ||
- `auto` - if `false` gridstack will not initialize existing items (default: `true`) | ||
@@ -80,0 +80,0 @@ - `cellHeight` - one cell height (default: `auto`). Can be: |
{ | ||
"name": "gridstack", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"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", |
@@ -99,4 +99,4 @@ gridstack.js | ||
```html | ||
<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> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.2/dist/gridstack.min.css" /> | ||
<script src="https://cdn.jsdelivr.net/npm/gridstack@2.0.2/dist/gridstack.all.js"></script> | ||
``` | ||
@@ -198,3 +198,3 @@ | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.1/dist/gridstack-extra.css"/> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@2.0.2/dist/gridstack-extra.css"/> | ||
@@ -387,2 +387,4 @@ <div class="grid-stack grid-stack-N">...</div> | ||
**Note:** 2.x no longer support legacy IE11 and older due to using more compact ES6 output and typecsript native code. You will need to stay at 1.x | ||
Changes | ||
@@ -389,0 +391,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
1890418
39
5860
397