gridstack
Advanced tools
Comparing version 8.0.1 to 8.1.0
/** | ||
* dd-base-impl.ts 8.0.1 | ||
* dd-base-impl.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-base-impl.ts 8.0.1 | ||
* dd-base-impl.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-draggable.ts 8.0.1 | ||
* dd-draggable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -10,3 +10,4 @@ */ | ||
handle?: string; | ||
helper?: string | HTMLElement | ((event: Event) => HTMLElement); | ||
helper?: 'clone' | HTMLElement | ((event: Event) => HTMLElement); | ||
cancel?: string; | ||
start?: (event: Event, ui: DDUIData) => void; | ||
@@ -13,0 +14,0 @@ stop?: (event: Event) => void; |
/** | ||
* dd-draggable.ts 8.0.1 | ||
* dd-draggable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -9,2 +9,4 @@ */ | ||
import { isTouch, touchend, touchmove, touchstart, pointerdown } from './dd-touch'; | ||
// make sure we are not clicking on known object that handles mouseDown | ||
const skipMouseDown = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle'; | ||
// let count = 0; // TEST | ||
@@ -78,10 +80,9 @@ class DDDraggable extends DDBaseImplement { | ||
return true; // only left click | ||
// make sure we are not clicking on known object that handles mouseDown (TODO: make this extensible ?) #2054 | ||
const skipMouseDown = ['input', 'textarea', 'button', 'select', 'option']; | ||
const name = e.target.nodeName.toLowerCase(); | ||
if (skipMouseDown.find(skip => skip === name)) | ||
// make sure we are not clicking on known object that handles mouseDown, or ones supplied by the user | ||
if (e.target.closest(skipMouseDown)) | ||
return true; | ||
// also check for content editable | ||
if (e.target.closest('[contenteditable="true"]')) | ||
return true; | ||
if (this.option.cancel) { | ||
if (e.target.closest(this.option.cancel)) | ||
return true; | ||
} | ||
// REMOVE: why would we get the event if it wasn't for us or child ? | ||
@@ -88,0 +89,0 @@ // make sure we are clicking on a drag handle or child of it... |
/** | ||
* dd-droppable.ts 8.0.1 | ||
* dd-droppable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-droppable.ts 8.0.1 | ||
* dd-droppable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-elements.ts 8.0.1 | ||
* dd-elements.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-elements.ts 8.0.1 | ||
* dd-elements.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-gridstack.ts 8.0.1 | ||
* dd-gridstack.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-gridstack.ts 8.0.1 | ||
* dd-gridstack.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-manager.ts 8.0.1 | ||
* dd-manager.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-manager.ts 8.0.1 | ||
* dd-manager.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-resizable-handle.ts 8.0.1 | ||
* dd-resizable-handle.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-resizable-handle.ts 8.0.1 | ||
* dd-resizable-handle.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-resizable.ts 8.0.1 | ||
* dd-resizable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-resizable.ts 8.0.1 | ||
* dd-resizable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* touch.ts 8.0.1 | ||
* touch.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* touch.ts 8.0.1 | ||
* touch.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* dd-base-impl.ts 8.0.1 | ||
* dd-base-impl.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-base-impl.ts 8.0.1 | ||
* dd-base-impl.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-draggable.ts 8.0.1 | ||
* dd-draggable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -10,3 +10,4 @@ */ | ||
handle?: string; | ||
helper?: string | HTMLElement | ((event: Event) => HTMLElement); | ||
helper?: 'clone' | HTMLElement | ((event: Event) => HTMLElement); | ||
cancel?: string; | ||
start?: (event: Event, ui: DDUIData) => void; | ||
@@ -13,0 +14,0 @@ stop?: (event: Event) => void; |
"use strict"; | ||
/** | ||
* dd-draggable.ts 8.0.1 | ||
* dd-draggable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -27,2 +27,4 @@ */ | ||
var dd_touch_1 = require("./dd-touch"); | ||
// make sure we are not clicking on known object that handles mouseDown | ||
var skipMouseDown = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle'; | ||
// let count = 0; // TEST | ||
@@ -101,10 +103,9 @@ var DDDraggable = exports.DDDraggable = /** @class */ (function (_super) { | ||
return true; // only left click | ||
// make sure we are not clicking on known object that handles mouseDown (TODO: make this extensible ?) #2054 | ||
var skipMouseDown = ['input', 'textarea', 'button', 'select', 'option']; | ||
var name = e.target.nodeName.toLowerCase(); | ||
if (skipMouseDown.find(function (skip) { return skip === name; })) | ||
// make sure we are not clicking on known object that handles mouseDown, or ones supplied by the user | ||
if (e.target.closest(skipMouseDown)) | ||
return true; | ||
// also check for content editable | ||
if (e.target.closest('[contenteditable="true"]')) | ||
return true; | ||
if (this.option.cancel) { | ||
if (e.target.closest(this.option.cancel)) | ||
return true; | ||
} | ||
// REMOVE: why would we get the event if it wasn't for us or child ? | ||
@@ -111,0 +112,0 @@ // make sure we are clicking on a drag handle or child of it... |
/** | ||
* dd-droppable.ts 8.0.1 | ||
* dd-droppable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-droppable.ts 8.0.1 | ||
* dd-droppable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-elements.ts 8.0.1 | ||
* dd-elements.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-elements.ts 8.0.1 | ||
* dd-elements.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-gridstack.ts 8.0.1 | ||
* dd-gridstack.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-gridstack.ts 8.0.1 | ||
* dd-gridstack.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-manager.ts 8.0.1 | ||
* dd-manager.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-manager.ts 8.0.1 | ||
* dd-manager.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-resizable-handle.ts 8.0.1 | ||
* dd-resizable-handle.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-resizable-handle.ts 8.0.1 | ||
* dd-resizable-handle.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* dd-resizable.ts 8.0.1 | ||
* dd-resizable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* dd-resizable.ts 8.0.1 | ||
* dd-resizable.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* touch.ts 8.0.1 | ||
* touch.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* touch.ts 8.0.1 | ||
* touch.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* GridStack 8.0.1 | ||
* GridStack 8.1.0 | ||
* https://gridstackjs.com/ | ||
@@ -4,0 +4,0 @@ * |
/** | ||
* gridstack-engine.ts 8.0.1 | ||
* gridstack-engine.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
"use strict"; | ||
/** | ||
* gridstack-engine.ts 8.0.1 | ||
* gridstack-engine.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* gridstack-poly.ts 8.0.1 used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4) | ||
* gridstack-poly.ts 8.1.0 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 8.0.1 | ||
* GridStack 8.1.0 | ||
* https://gridstackjs.com/ | ||
@@ -344,5 +344,5 @@ * | ||
* @param dragInOptions options - see DDDragInOpt. (default: {handle: '.grid-stack-item-content', appendTo: 'body'} | ||
* @param root optional root which defaults to document (for shadow dom) | ||
* @param root optional root which defaults to document (for shadow dom pas the parent HTMLDocument) | ||
**/ | ||
static setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root?: Document): void; | ||
static setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root?: HTMLElement | Document): void; | ||
/** | ||
@@ -349,0 +349,0 @@ * Enables/Disables dragging by the user of specific grid element. If you want all items, and have it affect future items, use enableMove() instead. No-op for static grids. |
/** | ||
* types.ts 8.0.1 | ||
* types.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -248,6 +248,8 @@ */ | ||
scroll?: boolean; | ||
/** prevents dragging from starting on specified elements, listed as comma separated selectors (eg: '.no-drag'). default built in is 'input,textarea,button,select,option' */ | ||
cancel?: string; | ||
} | ||
export interface DDDragInOpt extends DDDragOpt { | ||
/** helper function when dropping (ex: 'clone' or your own method) */ | ||
helper?: string | ((event: Event) => HTMLElement); | ||
/** helper function when dropping: 'clone' or your own method */ | ||
helper?: 'clone' | ((event: Event) => HTMLElement); | ||
} | ||
@@ -254,0 +256,0 @@ export interface Size { |
"use strict"; | ||
/** | ||
* types.ts 8.0.1 | ||
* types.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* utils.ts 8.0.1 | ||
* utils.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -23,5 +23,5 @@ */ | ||
/** convert a potential selector into actual list of html elements. optional root which defaults to document (for shadow dom) */ | ||
static getElements(els: GridStackElement, root?: Document): HTMLElement[]; | ||
static getElements(els: GridStackElement, root?: HTMLElement | Document): HTMLElement[]; | ||
/** convert a potential selector into actual single element. optional root which defaults to document (for shadow dom) */ | ||
static getElement(els: GridStackElement, root?: Document): HTMLElement; | ||
static getElement(els: GridStackElement, root?: HTMLElement | Document): HTMLElement; | ||
/** returns true if a and b overlap */ | ||
@@ -28,0 +28,0 @@ static isIntercepted(a: GridStackPosition, b: GridStackPosition): boolean; |
"use strict"; | ||
/** | ||
* utils.ts 8.0.1 | ||
* utils.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -79,2 +79,3 @@ */ | ||
if (root === void 0) { root = document; } | ||
var doc = ('getElementById' in root) ? root : undefined; | ||
if (typeof els === 'string') { | ||
@@ -84,4 +85,4 @@ // Note: very common for people use to id='1,2,3' which is only legal as HTML5 id, but not CSS selectors | ||
// see https://github.com/gridstack/gridstack.js/issues/2234#issuecomment-1523796562 | ||
if (!isNaN(+els[0])) { // start with digit | ||
var el = root.getElementById(els); | ||
if (doc && !isNaN(+els[0])) { // start with digit | ||
var el = doc.getElementById(els); | ||
return el ? [el] : []; | ||
@@ -103,19 +104,20 @@ } | ||
if (root === void 0) { root = document; } | ||
var doc = ('getElementById' in root) ? root : undefined; | ||
if (typeof els === 'string') { | ||
if (!els.length) | ||
return null; | ||
if (els[0] === '#') { | ||
return root.getElementById(els.substring(1)); | ||
if (doc && els[0] === '#') { | ||
return doc.getElementById(els.substring(1)); | ||
} | ||
if (els[0] === '.' || els[0] === '[') { | ||
if (els[0] === '#' || els[0] === '.' || els[0] === '[') { | ||
return root.querySelector(els); | ||
} | ||
// if we start with a digit, assume it's an id (error calling querySelector('#1')) as class are not valid CSS | ||
if (!isNaN(+els[0])) { // start with digit | ||
return root.getElementById(els); | ||
if (doc && !isNaN(+els[0])) { // start with digit | ||
return doc.getElementById(els); | ||
} | ||
// finally try string, then id, then class | ||
var el = root.querySelector(els); | ||
if (!el) { | ||
el = root.getElementById(els); | ||
if (doc && !el) { | ||
el = doc.getElementById(els); | ||
} | ||
@@ -122,0 +124,0 @@ if (!el) { |
/*! | ||
* GridStack 8.0.1 | ||
* GridStack 8.1.0 | ||
* https://gridstackjs.com/ | ||
@@ -4,0 +4,0 @@ * |
/** | ||
* gridstack-engine.ts 8.0.1 | ||
* gridstack-engine.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* gridstack-engine.ts 8.0.1 | ||
* gridstack-engine.ts 8.1.0 | ||
* Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/*! | ||
* GridStack 8.0.1 | ||
* GridStack 8.1.0 | ||
* https://gridstackjs.com/ | ||
@@ -344,5 +344,5 @@ * | ||
* @param dragInOptions options - see DDDragInOpt. (default: {handle: '.grid-stack-item-content', appendTo: 'body'} | ||
* @param root optional root which defaults to document (for shadow dom) | ||
* @param root optional root which defaults to document (for shadow dom pas the parent HTMLDocument) | ||
**/ | ||
static setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root?: Document): void; | ||
static setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root?: HTMLElement | Document): void; | ||
/** | ||
@@ -349,0 +349,0 @@ * Enables/Disables dragging by the user of specific grid element. If you want all items, and have it affect future items, use enableMove() instead. No-op for static grids. |
/** | ||
* gridstack-item.component.ts 8.0.1 | ||
* gridstack-item.component.ts 8.1.0 | ||
* Copyright (c) 2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* gridstack-item.component.ts 8.0.1 | ||
* gridstack-item.component.ts 8.1.0 | ||
* Copyright (c) 2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* gridstack.component.ts 8.0.1 | ||
* gridstack.component.ts 8.1.0 | ||
* Copyright (c) 2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* gridstack.component.ts 8.0.1 | ||
* gridstack.component.ts 8.1.0 | ||
* Copyright (c) 2022 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* types.ts 8.0.1 | ||
* types.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -248,6 +248,8 @@ */ | ||
scroll?: boolean; | ||
/** prevents dragging from starting on specified elements, listed as comma separated selectors (eg: '.no-drag'). default built in is 'input,textarea,button,select,option' */ | ||
cancel?: string; | ||
} | ||
export interface DDDragInOpt extends DDDragOpt { | ||
/** helper function when dropping (ex: 'clone' or your own method) */ | ||
helper?: string | ((event: Event) => HTMLElement); | ||
/** helper function when dropping: 'clone' or your own method */ | ||
helper?: 'clone' | ((event: Event) => HTMLElement); | ||
} | ||
@@ -254,0 +256,0 @@ export interface Size { |
/** | ||
* types.ts 8.0.1 | ||
* types.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* utils.ts 8.0.1 | ||
* utils.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -23,5 +23,5 @@ */ | ||
/** convert a potential selector into actual list of html elements. optional root which defaults to document (for shadow dom) */ | ||
static getElements(els: GridStackElement, root?: Document): HTMLElement[]; | ||
static getElements(els: GridStackElement, root?: HTMLElement | Document): HTMLElement[]; | ||
/** convert a potential selector into actual single element. optional root which defaults to document (for shadow dom) */ | ||
static getElement(els: GridStackElement, root?: Document): HTMLElement; | ||
static getElement(els: GridStackElement, root?: HTMLElement | Document): HTMLElement; | ||
/** returns true if a and b overlap */ | ||
@@ -28,0 +28,0 @@ static isIntercepted(a: GridStackPosition, b: GridStackPosition): boolean; |
/** | ||
* utils.ts 8.0.1 | ||
* utils.ts 8.1.0 | ||
* Copyright (c) 2021 Alain Dumesny - see GridStack root license | ||
@@ -45,2 +45,3 @@ */ | ||
static getElements(els, root = document) { | ||
const doc = ('getElementById' in root) ? root : undefined; | ||
if (typeof els === 'string') { | ||
@@ -50,4 +51,4 @@ // Note: very common for people use to id='1,2,3' which is only legal as HTML5 id, but not CSS selectors | ||
// see https://github.com/gridstack/gridstack.js/issues/2234#issuecomment-1523796562 | ||
if (!isNaN(+els[0])) { // start with digit | ||
const el = root.getElementById(els); | ||
if (doc && !isNaN(+els[0])) { // start with digit | ||
const el = doc.getElementById(els); | ||
return el ? [el] : []; | ||
@@ -68,19 +69,20 @@ } | ||
static getElement(els, root = document) { | ||
const doc = ('getElementById' in root) ? root : undefined; | ||
if (typeof els === 'string') { | ||
if (!els.length) | ||
return null; | ||
if (els[0] === '#') { | ||
return root.getElementById(els.substring(1)); | ||
if (doc && els[0] === '#') { | ||
return doc.getElementById(els.substring(1)); | ||
} | ||
if (els[0] === '.' || els[0] === '[') { | ||
if (els[0] === '#' || els[0] === '.' || els[0] === '[') { | ||
return root.querySelector(els); | ||
} | ||
// if we start with a digit, assume it's an id (error calling querySelector('#1')) as class are not valid CSS | ||
if (!isNaN(+els[0])) { // start with digit | ||
return root.getElementById(els); | ||
if (doc && !isNaN(+els[0])) { // start with digit | ||
return doc.getElementById(els); | ||
} | ||
// finally try string, then id, then class | ||
let el = root.querySelector(els); | ||
if (!el) { | ||
el = root.getElementById(els); | ||
if (doc && !el) { | ||
el = doc.getElementById(els); | ||
} | ||
@@ -87,0 +89,0 @@ if (!el) { |
@@ -8,2 +8,3 @@ Change log | ||
- [8.1.0 (2023-05-06)](#810-2023-05-06) | ||
- [8.0.1 (2023-04-29)](#801-2023-04-29) | ||
@@ -88,2 +89,8 @@ - [8.0.0 (2023-04-29)](#800-2023-04-29) | ||
## 8.1.0 (2023-05-06) | ||
* break: remove `GridStackOptions.minWidth` obsolete since 5.1, use `oneColumnSize` instead | ||
* optimize: CSS files now even 25% smaller (after being halfed in 8.0.0) by removing `.grid-stack` prefix for anything already gs based, and 3 digit rounding. | ||
* fix: [#2275](https://github.com/gridstack/gridstack.js/issues/2275) `setupDragIn()` signature tweaks (HTMLElement | Document) | ||
* feat: [#2205](https://github.com/gridstack/gridstack.js/issues/2205) added `GridStackOptions.draggable.cancel` for list of selectors that should prevent item dragging | ||
## 8.0.1 (2023-04-29) | ||
@@ -90,0 +97,0 @@ * feat: [#2275](https://github.com/gridstack/gridstack.js/issues/2275) `setupDragIn()` now can take an array or elements (in addition to selector string) and optional parent root (for shadow DOM support) |
@@ -31,3 +31,3 @@ gridstack.js API | ||
- [`addGrid(parent: HTMLElement, opt: GridStackOptions = {}): GridStack `](#addgridparent-htmlelement-opt-gridstackoptions---gridstack-) | ||
- [`setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root = document)`](#setupdragindragin-string--htmlelement-draginoptions-dddraginopt-root--document) | ||
- [`setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root = HTMLElement | Document)`](#setupdragindragin-string--htmlelement-draginoptions-dddraginopt-root--htmlelement--document) | ||
- [`GridStack.registerEngine(engineClass: typeof GridStackEngine)`](#gridstackregisterengineengineclass-typeof-gridstackengine) | ||
@@ -135,5 +135,6 @@ - [API](#api) | ||
- `scroll`?: boolean - default to 'true', enable or disable the scroll when an element is dragged on bottom or top of the grid. | ||
- `cancel`?: string - prevents dragging from starting on specified elements, listed as comma separated selectors (eg: '.no-drag'). default built in is 'input,textarea,button,select,option' | ||
### DDDragInOpt extends DDDragOpt | ||
- `helper`?: string | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method) | ||
- `helper`?: 'clone' | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method) | ||
@@ -328,3 +329,3 @@ ## Grid attributes | ||
### `setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root = document)` | ||
### `setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root = HTMLElement | Document)` | ||
@@ -335,3 +336,3 @@ * call to setup dragging in from the outside (say toolbar), by specifying the class selection and options. | ||
* @param dragInOptions options - see `DDDragInOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}` | ||
* @param root - default to document (for shadow dom support) | ||
* @param root - default to document. for shadow dom support pass the parent container. | ||
but you will probably also want `helper: 'clone'` or your own callback function). | ||
@@ -338,0 +339,0 @@ |
{ | ||
"name": "gridstack", | ||
"version": "8.0.1", | ||
"version": "8.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)", |
@@ -248,17 +248,18 @@ # gridstack.js | ||
Better yet, here is a SASS code snippet which can make life much easier (Thanks to @ascendantofrain, [#81](https://github.com/gridstack/gridstack.js/issues/81) and @StefanM98, [#868](https://github.com/gridstack/gridstack.js/issues/868)) and you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead: | ||
Better yet, here is a SASS code snippet, you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead: | ||
```sass | ||
@use "sass:math"; | ||
.grid-stack > .grid-stack-item { | ||
$columns: 12; | ||
@function fixed($float) { | ||
@return calc(round($float * 100) / 100); // total 4 digits being % | ||
} | ||
.grid-stack-#{$columns} > .grid-stack-item { | ||
$gridstack-columns: 12; | ||
min-width: fixed(calc(100% / $columns)); | ||
min-width: 100%/$gridstack-columns; | ||
@for $i from 0 through $gridstack-columns { | ||
&[gs-w='#{$i}'] { width: (100% / $gridstack-columns) * $i; } | ||
&[gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; } | ||
@for $i from 1 through $columns - 1 { | ||
&[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); } | ||
&[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); } | ||
} | ||
} | ||
} | ||
``` | ||
@@ -451,3 +452,3 @@ | ||
Possible breaking change if you use nested grid JSON format, or original Angular wrapper. Also target is now ES2020 (see release notes). | ||
Possible breaking change if you use nested grid JSON format, or original Angular wrapper, or relied on specific CSS paths. Also target is now ES2020 (see release notes). | ||
* `GridStackOptions.subGrid` -> `GridStackOptions.subGridOpts` rename | ||
@@ -457,2 +458,3 @@ * We now have `GridStackWidget.subGridOpts` vs `GridStackNode.subGrid` (was `subGrid` with both types which is error prone) | ||
* removed `GridStackOptions.dragInOptions` since `setupDragIn()`has it replaced since 4.0 | ||
* remove `GridStackOptions.minWidth` obsolete since 5.1, use `oneColumnSize` instead | ||
@@ -459,0 +461,0 @@ # jQuery Application |
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 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 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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
1
505
2413556
104
14491