Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gridstack

Package Overview
Dependencies
Maintainers
0
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridstack - npm Package Compare versions

Comparing version 10.3.0 to 10.3.1

dist/angular/src/base-widget.ts

2

dist/angular/lib/gridstack-item.component.d.ts
/**
* gridstack-item.component.ts 10.3.0
* gridstack-item.component.ts 10.3.1
* Copyright (c) 2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* gridstack.component.ts 10.3.0
* gridstack.component.ts 10.3.1
* Copyright (c) 2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-base-impl.ts 10.3.0
* dd-base-impl.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-base-impl.ts 10.3.0
* dd-base-impl.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-draggable.ts 10.3.0
* dd-draggable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-draggable.ts 10.3.0
* dd-draggable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -25,4 +25,5 @@ */

// get the element that is actually supposed to be dragged by
let handleName = option.handle.substring(1);
this.dragEls = el.classList.contains(handleName) ? [el] : Array.from(el.querySelectorAll(option.handle));
const handleName = option.handle.substring(1);
const n = el.gridstackNode;
this.dragEls = el.classList.contains(handleName) ? [el] : (n?.subGrid ? [el.querySelector(option.handle) || el] : Array.from(el.querySelectorAll(option.handle)));
if (this.dragEls.length === 0) {

@@ -29,0 +30,0 @@ this.dragEls = [el];

/**
* dd-droppable.ts 10.3.0
* dd-droppable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-droppable.ts 10.3.0
* dd-droppable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-elements.ts 10.3.0
* dd-elements.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-elements.ts 10.3.0
* dd-elements.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-gridstack.ts 10.3.0
* dd-gridstack.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -14,3 +14,3 @@ */

export type DDOpts = 'enable' | 'disable' | 'destroy' | 'option' | string | any;
export type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight';
export type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'maxHeightMoveUp' | 'maxWidthMoveLeft';
export type DDValue = number | string;

@@ -17,0 +17,0 @@ /** drag&drop events callbacks */

/**
* dd-gridstack.ts 10.3.0
* dd-gridstack.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-manager.ts 10.3.0
* dd-manager.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-manager.ts 10.3.0
* dd-manager.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-resizable-handle.ts 10.3.0
* dd-resizable-handle.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-resizable-handle.ts 10.3.0
* dd-resizable-handle.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-resizable.ts 10.3.0
* dd-resizable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -11,3 +11,5 @@ */

maxHeight?: number;
maxHeightMoveUp?: number;
maxWidth?: number;
maxWidthMoveLeft?: number;
minHeight?: number;

@@ -14,0 +16,0 @@ minWidth?: number;

/**
* dd-resizable.ts 10.3.0
* dd-resizable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -232,2 +232,4 @@ */

const offsetY = this.sizeToContent ? 0 : event.clientY - oEvent.clientY; // prevent vert resize
let moveLeft;
let moveUp;
if (dir.indexOf('e') > -1) {

@@ -239,2 +241,3 @@ newRect.width += offsetX;

newRect.left += offsetX;
moveLeft = true;
}

@@ -247,4 +250,5 @@ if (dir.indexOf('s') > -1) {

newRect.top += offsetY;
moveUp = true;
}
const constrain = this._constrainSize(newRect.width, newRect.height);
const constrain = this._constrainSize(newRect.width, newRect.height, moveLeft, moveUp);
if (Math.round(newRect.width) !== Math.round(constrain.width)) { // round to ignore slight round-off errors

@@ -265,7 +269,8 @@ if (dir.indexOf('w') > -1) {

/** @internal constrain the size to the set min/max values */
_constrainSize(oWidth, oHeight) {
const maxWidth = this.option.maxWidth || Number.MAX_SAFE_INTEGER;
const minWidth = this.option.minWidth / this.rectScale.x || oWidth;
const maxHeight = this.option.maxHeight || Number.MAX_SAFE_INTEGER;
const minHeight = this.option.minHeight / this.rectScale.y || oHeight;
_constrainSize(oWidth, oHeight, moveLeft, moveUp) {
const o = this.option;
const maxWidth = (moveLeft ? o.maxWidthMoveLeft : o.maxWidth) || Number.MAX_SAFE_INTEGER;
const minWidth = o.minWidth / this.rectScale.x || oWidth;
const maxHeight = (moveUp ? o.maxHeightMoveUp : o.maxHeight) || Number.MAX_SAFE_INTEGER;
const minHeight = o.minHeight / this.rectScale.y || oHeight;
const width = Math.min(maxWidth, Math.max(minWidth, oWidth));

@@ -272,0 +277,0 @@ const height = Math.min(maxHeight, Math.max(minHeight, oHeight));

/**
* touch.ts 10.3.0
* touch.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* touch.ts 10.3.0
* touch.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* dd-base-impl.ts 10.3.0
* dd-base-impl.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-base-impl.ts 10.3.0
* dd-base-impl.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-draggable.ts 10.3.0
* dd-draggable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-draggable.ts 10.3.0
* dd-draggable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -57,3 +57,4 @@ */

var handleName = option.handle.substring(1);
_this.dragEls = el.classList.contains(handleName) ? [el] : Array.from(el.querySelectorAll(option.handle));
var n = el.gridstackNode;
_this.dragEls = el.classList.contains(handleName) ? [el] : ((n === null || n === void 0 ? void 0 : n.subGrid) ? [el.querySelector(option.handle) || el] : Array.from(el.querySelectorAll(option.handle)));
if (_this.dragEls.length === 0) {

@@ -60,0 +61,0 @@ _this.dragEls = [el];

/**
* dd-droppable.ts 10.3.0
* dd-droppable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-droppable.ts 10.3.0
* dd-droppable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-elements.ts 10.3.0
* dd-elements.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-elements.ts 10.3.0
* dd-elements.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-gridstack.ts 10.3.0
* dd-gridstack.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -14,3 +14,3 @@ */

export type DDOpts = 'enable' | 'disable' | 'destroy' | 'option' | string | any;
export type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight';
export type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'maxHeightMoveUp' | 'maxWidthMoveLeft';
export type DDValue = number | string;

@@ -17,0 +17,0 @@ /** drag&drop events callbacks */

"use strict";
/**
* dd-gridstack.ts 10.3.0
* dd-gridstack.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-manager.ts 10.3.0
* dd-manager.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-manager.ts 10.3.0
* dd-manager.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-resizable-handle.ts 10.3.0
* dd-resizable-handle.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* dd-resizable-handle.ts 10.3.0
* dd-resizable-handle.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* dd-resizable.ts 10.3.0
* dd-resizable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -11,3 +11,5 @@ */

maxHeight?: number;
maxHeightMoveUp?: number;
maxWidth?: number;
maxWidthMoveLeft?: number;
minHeight?: number;

@@ -14,0 +16,0 @@ minWidth?: number;

"use strict";
/**
* dd-resizable.ts 10.3.0
* dd-resizable.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -257,2 +257,4 @@ */

var offsetY = this.sizeToContent ? 0 : event.clientY - oEvent.clientY; // prevent vert resize
var moveLeft;
var moveUp;
if (dir.indexOf('e') > -1) {

@@ -264,2 +266,3 @@ newRect.width += offsetX;

newRect.left += offsetX;
moveLeft = true;
}

@@ -272,4 +275,5 @@ if (dir.indexOf('s') > -1) {

newRect.top += offsetY;
moveUp = true;
}
var constrain = this._constrainSize(newRect.width, newRect.height);
var constrain = this._constrainSize(newRect.width, newRect.height, moveLeft, moveUp);
if (Math.round(newRect.width) !== Math.round(constrain.width)) { // round to ignore slight round-off errors

@@ -290,7 +294,8 @@ if (dir.indexOf('w') > -1) {

/** @internal constrain the size to the set min/max values */
DDResizable.prototype._constrainSize = function (oWidth, oHeight) {
var maxWidth = this.option.maxWidth || Number.MAX_SAFE_INTEGER;
var minWidth = this.option.minWidth / this.rectScale.x || oWidth;
var maxHeight = this.option.maxHeight || Number.MAX_SAFE_INTEGER;
var minHeight = this.option.minHeight / this.rectScale.y || oHeight;
DDResizable.prototype._constrainSize = function (oWidth, oHeight, moveLeft, moveUp) {
var o = this.option;
var maxWidth = (moveLeft ? o.maxWidthMoveLeft : o.maxWidth) || Number.MAX_SAFE_INTEGER;
var minWidth = o.minWidth / this.rectScale.x || oWidth;
var maxHeight = (moveUp ? o.maxHeightMoveUp : o.maxHeight) || Number.MAX_SAFE_INTEGER;
var minHeight = o.minHeight / this.rectScale.y || oHeight;
var width = Math.min(maxWidth, Math.max(minWidth, oWidth));

@@ -297,0 +302,0 @@ var height = Math.min(maxHeight, Math.max(minHeight, oHeight));

/**
* touch.ts 10.3.0
* touch.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* touch.ts 10.3.0
* touch.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/*!
* GridStack 10.3.0
* GridStack 10.3.1
* https://gridstackjs.com/

@@ -4,0 +4,0 @@ *

/**
* gridstack-engine.ts 10.3.0
* gridstack-engine.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* gridstack-engine.ts 10.3.0
* gridstack-engine.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* gridstack-poly.ts 10.3.0 used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4)
* gridstack-poly.ts 10.3.1 used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4)
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/*!
* GridStack 10.3.0
* GridStack 10.3.1
* https://gridstackjs.com/

@@ -4,0 +4,0 @@ *

/**
* types.ts 10.3.0
* types.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* types.ts 10.3.0
* types.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -5,0 +5,0 @@ */

/**
* utils.ts 10.3.0
* utils.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

"use strict";
/**
* utils.ts 10.3.0
* utils.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -586,6 +586,2 @@ */

};
// don't check for `instanceof DragEvent` as Safari use MouseEvent #1540
if (e.dataTransfer) {
evt['dataTransfer'] = e.dataTransfer; // workaround 'readonly' field.
}
['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].forEach(function (p) { return evt[p] = e[p]; }); // keys

@@ -643,3 +639,9 @@ ['pageX', 'pageY', 'clientX', 'clientY', 'screenX', 'screenY'].forEach(function (p) { return evt[p] = e[p]; }); // point info

/** swap the given object 2 field values */
Utils.swap = function (o, a, b) { var tmp = o[a]; o[a] = o[b]; o[b] = tmp; };
Utils.swap = function (o, a, b) {
if (!o)
return;
var tmp = o[a];
o[a] = o[b];
o[b] = tmp;
};
/** returns true if event is inside the given element rectangle */

@@ -646,0 +648,0 @@ // Note: Safari Mac has null event.relatedTarget which causes #1684 so check if DragEvent is inside the coordinates instead

/*!
* GridStack 10.3.0
* GridStack 10.3.1
* https://gridstackjs.com/

@@ -4,0 +4,0 @@ *

/**
* gridstack-engine.ts 10.3.0
* gridstack-engine.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* gridstack-engine.ts 10.3.0
* gridstack-engine.ts 10.3.1
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/*!
* GridStack 10.3.0
* GridStack 10.3.1
* https://gridstackjs.com/

@@ -4,0 +4,0 @@ *

/**
* types.ts 10.3.0
* types.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* types.ts 10.3.0
* types.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* utils.ts 10.3.0
* utils.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -4,0 +4,0 @@ */

/**
* utils.ts 10.3.0
* utils.ts 10.3.1
* Copyright (c) 2021 Alain Dumesny - see GridStack root license

@@ -531,6 +531,2 @@ */

};
// don't check for `instanceof DragEvent` as Safari use MouseEvent #1540
if (e.dataTransfer) {
evt['dataTransfer'] = e.dataTransfer; // workaround 'readonly' field.
}
['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].forEach(p => evt[p] = e[p]); // keys

@@ -588,3 +584,9 @@ ['pageX', 'pageY', 'clientX', 'clientY', 'screenX', 'screenY'].forEach(p => evt[p] = e[p]); // point info

/** swap the given object 2 field values */
static swap(o, a, b) { const tmp = o[a]; o[a] = o[b]; o[b] = tmp; }
static swap(o, a, b) {
if (!o)
return;
const tmp = o[a];
o[a] = o[b];
o[b] = tmp;
}
/** returns true if event is inside the given element rectangle */

@@ -591,0 +593,0 @@ // Note: Safari Mac has null event.relatedTarget which causes #1684 so check if DragEvent is inside the coordinates instead

@@ -8,2 +8,3 @@ Change log

- [10.3.1 (2024-07-21)](#1031-2024-07-21)
- [10.3.0 (2024-06-26)](#1030-2024-06-26)

@@ -116,2 +117,9 @@ - [10.2.1 (2024-06-23)](#1021-2024-06-23)

## 10.3.1 (2024-07-21)
* fix: [#2734](https://github.com/gridstack/gridstack.js/bug/2734) rotate() JS error
* fix: [#2741](https://github.com/gridstack/gridstack.js/pull/2741) resizeToContent JS error with nested grid
* fix: [#2740](https://github.com/gridstack/gridstack.js/bug/2740) nested grid drag fix
* fix: [#2730](https://github.com/gridstack/gridstack.js/bug/2730) resizing left from right most item works
* fix: [#2327](https://github.com/gridstack/gridstack.js/bug/2327) remove dataTransfer mention as not supported
## 10.3.0 (2024-06-26)

@@ -118,0 +126,0 @@ * fix: [#2720](https://github.com/gridstack/gridstack.js/pull/2720) load() now creates widgets in order (used to be reverse due to old collision code)

{
"name": "gridstack",
"version": "10.3.0",
"version": "10.3.1",
"license": "MIT",

@@ -95,3 +95,4 @@ "author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",

},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"files": ["dist","doc"]
}

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

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

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

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

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

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

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 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 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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc