gridstack 12.3.3 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack.component.mjs +4 -2
- package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
- package/dist/angular/esm2020/lib/types.mjs +2 -2
- package/dist/angular/fesm2015/gridstack-angular.mjs +6 -4
- package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
- package/dist/angular/fesm2020/gridstack-angular.mjs +7 -5
- package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
- package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
- package/dist/angular/lib/gridstack.component.d.ts +4 -4
- package/dist/angular/lib/types.d.ts +1 -1
- package/dist/angular/package.json +1 -1
- package/dist/angular/projects/lib/src/index.d.ts +5 -0
- package/dist/angular/projects/lib/src/index.js +9 -0
- package/dist/angular/projects/lib/src/index.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/base-widget.d.ts +56 -0
- package/dist/angular/projects/lib/src/lib/base-widget.js +94 -0
- package/dist/angular/projects/lib/src/lib/base-widget.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.d.ts +76 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.js +112 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.d.ts +233 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.js +457 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.d.ts +29 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.js +52 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/types.d.ts +51 -0
- package/dist/angular/projects/lib/src/lib/types.js +6 -0
- package/dist/angular/projects/lib/src/lib/types.js.map +1 -0
- package/dist/angular/src/base-widget.ts +13 -13
- package/dist/angular/src/gridstack-item.component.ts +5 -5
- package/dist/angular/src/gridstack.component.ts +34 -32
- package/dist/angular/src/gridstack.module.ts +4 -4
- package/dist/angular/src/types.ts +3 -2
- package/dist/gridstack-all.js +1 -1
- package/dist/gridstack-all.js.LICENSE.txt +1 -1
- package/dist/gridstack-all.js.map +1 -1
- package/dist/gridstack.css +1 -1
- package/dist/src/dd-base-impl.d.ts +1 -1
- package/dist/src/dd-base-impl.js +1 -1
- package/dist/src/dd-base-impl.js.map +1 -1
- package/dist/src/dd-draggable.d.ts +1 -1
- package/dist/src/dd-draggable.js +1 -1
- package/dist/src/dd-draggable.js.map +1 -1
- package/dist/src/dd-droppable.d.ts +1 -1
- package/dist/src/dd-droppable.js +7 -1
- package/dist/src/dd-droppable.js.map +1 -1
- package/dist/src/dd-element.d.ts +1 -1
- package/dist/src/dd-element.js +1 -1
- package/dist/src/dd-element.js.map +1 -1
- package/dist/src/dd-gridstack.d.ts +1 -1
- package/dist/src/dd-gridstack.js +1 -1
- package/dist/src/dd-gridstack.js.map +1 -1
- package/dist/src/dd-manager.d.ts +1 -1
- package/dist/src/dd-manager.js +1 -1
- package/dist/src/dd-manager.js.map +1 -1
- package/dist/src/dd-resizable-handle.d.ts +5 -4
- package/dist/src/dd-resizable-handle.js +23 -8
- package/dist/src/dd-resizable-handle.js.map +1 -1
- package/dist/src/dd-resizable.d.ts +3 -5
- package/dist/src/dd-resizable.js +5 -10
- package/dist/src/dd-resizable.js.map +1 -1
- package/dist/src/dd-touch.d.ts +1 -1
- package/dist/src/dd-touch.js +1 -1
- package/dist/src/dd-touch.js.map +1 -1
- package/dist/src/gridstack-engine.d.ts +1 -1
- package/dist/src/gridstack-engine.js +7 -1
- package/dist/src/gridstack-engine.js.map +1 -1
- package/dist/src/gridstack.d.ts +1 -2
- package/dist/src/gridstack.js +9 -18
- package/dist/src/gridstack.js.map +1 -1
- package/dist/src/gridstack.scss +1 -1
- package/dist/src/types.d.ts +11 -6
- package/dist/src/types.js +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils.d.ts +1 -270
- package/dist/src/utils.js +37 -31
- package/dist/src/utils.js.map +1 -1
- package/doc/API.md +166 -165
- package/package.json +5 -5
- package/dist/dd-base-impl.d.ts +0 -69
- package/dist/dd-base-impl.js +0 -70
- package/dist/dd-base-impl.js.map +0 -1
- package/dist/dd-draggable.d.ts +0 -20
- package/dist/dd-draggable.js +0 -364
- package/dist/dd-draggable.js.map +0 -1
- package/dist/dd-droppable.d.ts +0 -26
- package/dist/dd-droppable.js +0 -149
- package/dist/dd-droppable.js.map +0 -1
- package/dist/dd-element.d.ts +0 -27
- package/dist/dd-element.js +0 -91
- package/dist/dd-element.js.map +0 -1
- package/dist/dd-gridstack.d.ts +0 -82
- package/dist/dd-gridstack.js +0 -165
- package/dist/dd-gridstack.js.map +0 -1
- package/dist/dd-manager.d.ts +0 -43
- package/dist/dd-manager.js +0 -14
- package/dist/dd-manager.js.map +0 -1
- package/dist/dd-resizable-handle.d.ts +0 -18
- package/dist/dd-resizable-handle.js +0 -113
- package/dist/dd-resizable-handle.js.map +0 -1
- package/dist/dd-resizable.d.ts +0 -30
- package/dist/dd-resizable.js +0 -304
- package/dist/dd-resizable.js.map +0 -1
- package/dist/dd-touch.d.ts +0 -33
- package/dist/dd-touch.js +0 -145
- package/dist/dd-touch.js.map +0 -1
- package/dist/gridstack-engine.d.ts +0 -321
- package/dist/gridstack-engine.js +0 -1272
- package/dist/gridstack-engine.js.map +0 -1
- package/dist/gridstack.d.ts +0 -802
- package/dist/gridstack.js +0 -2872
- package/dist/gridstack.js.map +0 -1
- package/dist/spec/gridstack-engine-spec.d.ts +0 -1
- package/dist/spec/gridstack-engine-spec.js +0 -358
- package/dist/spec/gridstack-engine-spec.js.map +0 -1
- package/dist/spec/gridstack-spec.d.ts +0 -1
- package/dist/spec/gridstack-spec.js +0 -1780
- package/dist/spec/gridstack-spec.js.map +0 -1
- package/dist/spec/integration/gridstack-integration.spec.d.ts +0 -1
- package/dist/spec/integration/gridstack-integration.spec.js +0 -171
- package/dist/spec/integration/gridstack-integration.spec.js.map +0 -1
- package/dist/spec/regression-spec.d.ts +0 -1
- package/dist/spec/regression-spec.js +0 -100
- package/dist/spec/regression-spec.js.map +0 -1
- package/dist/spec/utils-spec.d.ts +0 -1
- package/dist/spec/utils-spec.js +0 -243
- package/dist/spec/utils-spec.js.map +0 -1
- package/dist/types.d.ts +0 -427
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -283
- package/dist/utils.js +0 -787
- package/dist/utils.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -74
- package/dist/vitest.config.js.map +0 -1
- package/dist/vitest.setup.d.ts +0 -1
- package/dist/vitest.setup.js +0 -90
- package/dist/vitest.setup.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gridstack-integration.spec.js","sourceRoot":"","sources":["../../../spec/integration/gridstack-integration.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,iDAAiD;AACjD,6DAA6D;AAE7D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,UAAU,CAAC,GAAG,EAAE;QACd,mCAAmC;QACnC,gCAAgC;QAChC,sDAAsD;QACtD,iDAAiD;QACjD,wBAAwB;QACxB,wCAAwC;QACxC,6CAA6C;QAC7C,4DAA4D;QAC5D,KAAK;QACL,oCAAoC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,sCAAsC;QACtC,uBAAuB;QACvB,2BAA2B;QAC3B,0DAA0D;QAC1D,2CAA2C;IAC7C,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0CAA0C,EAAE,G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gBACzC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { GridStack } from '../../src/gridstack';\n\n// Integration tests for GridStack HTML scenarios\n// These test actual GridStack behavior with DOM manipulation\n\ndescribe('GridStack Integration Tests', () => {\n beforeEach(() => {\n // // Clean up DOM before each test\n // document.body.innerHTML = '';\n // // Add basic CSS for GridStack to function properly\n // const style = document.createElement('style');\n // style.textContent = `\n // .grid-stack { position: relative; }\n // .grid-stack-item { position: absolute; }\n // .grid-stack-item-content { width: 100%; height: 100%; }\n // `;\n // document.head.appendChild(style);\n });\n\n afterEach(() => {\n // // Clean up any GridStack instances\n // GridStack.removeAll;\n // // Clean up added styles\n // const styles = document.head.querySelectorAll('style');\n // styles.forEach(style => style.remove());\n });\n\n describe('Auto-positioning with no x,y coordinates', () => {\n it('should position items in order 5,1,2,4,3 based on their constraints', () => {\n // Create the HTML structure from the test file\n document.body.innerHTML = `\n <div class=\"grid-stack\">\n <div class=\"grid-stack-item upper\" gs-w=\"2\" gs-h=\"2\" gs-id=\"1\">\n <div class=\"grid-stack-item-content\">item 1</div>\n </div>\n <div class=\"grid-stack-item\" gs-w=\"3\" gs-h=\"2\" gs-id=\"2\">\n <div class=\"grid-stack-item-content\">item 2</div>\n </div>\n <div class=\"grid-stack-item\" gs-w=\"9\" gs-h=\"1\" gs-id=\"3\">\n <div class=\"grid-stack-item-content\">item 3 too big to fit, so next row</div>\n </div>\n <div class=\"grid-stack-item\" gs-w=\"3\" gs-h=\"1\" gs-id=\"4\">\n <div class=\"grid-stack-item-content\">item 4</div>\n </div>\n <div class=\"grid-stack-item\" gs-x=\"1\" gs-y=\"1\" gs-w=\"1\" gs-h=\"1\" gs-id=\"5\">\n <div class=\"grid-stack-item-content\">item 5 first</div>\n </div>\n </div>\n `;\n\n // Initialize GridStack with same options as test\n const options = {\n cellHeight: 80,\n margin: 5,\n float: true\n };\n const grid = GridStack.init(options);\n\n // Get all nodes and their positions\n const nodes = grid.engine.nodes;\n expect(nodes).toHaveLength(5);\n\n // Item 5 should be positioned (has explicit x=1, y=1 in HTML)\n const item5 = nodes.find(n => n.id === '5');\n expect(item5).toBeDefined();\n expect(item5!.w).toBe(1);\n expect(item5!.h).toBe(1);\n\n // Item 1 should be positioned next (2x2)\n const item1 = nodes.find(n => n.id === '1');\n expect(item1).toBeDefined();\n expect(item1!.w).toBe(2);\n expect(item1!.h).toBe(2);\n\n // Item 2 should be positioned (3x2) \n const item2 = nodes.find(n => n.id === '2');\n expect(item2).toBeDefined();\n expect(item2!.w).toBe(3);\n expect(item2!.h).toBe(2);\n\n // Item 4 should be positioned (3x1)\n const item4 = nodes.find(n => n.id === '4');\n expect(item4).toBeDefined();\n expect(item4!.w).toBe(3);\n expect(item4!.h).toBe(1);\n\n // Item 3 should be on next row (too big to fit - 9x1)\n const item3 = nodes.find(n => n.id === '3');\n expect(item3).toBeDefined();\n expect(item3!.w).toBe(9);\n expect(item3!.h).toBe(1);\n \n // Verify all items are positioned (have valid coordinates)\n nodes.forEach(node => {\n expect(node.x).toBeGreaterThanOrEqual(0);\n expect(node.y).toBeGreaterThanOrEqual(0);\n expect(node.w).toBeGreaterThan(0);\n expect(node.h).toBeGreaterThan(0);\n });\n });\n });\n\n describe('Grid initialization and basic functionality', () => {\n it('should initialize GridStack with items and maintain data integrity', () => {\n document.body.innerHTML = `\n <div class=\"grid-stack\">\n <div class=\"grid-stack-item\" gs-x=\"0\" gs-y=\"0\" gs-w=\"4\" gs-h=\"2\" gs-id=\"item1\">\n <div class=\"grid-stack-item-content\">Item 1</div>\n </div>\n <div class=\"grid-stack-item\" gs-x=\"4\" gs-y=\"0\" gs-w=\"4\" gs-h=\"4\" gs-id=\"item2\">\n <div class=\"grid-stack-item-content\">Item 2</div>\n </div>\n </div>\n `;\n\n const grid = GridStack.init();\n \n expect(grid).toBeDefined();\n expect(grid.engine.nodes).toHaveLength(2);\n \n const item1 = grid.engine.nodes.find(n => n.id === 'item1');\n const item2 = grid.engine.nodes.find(n => n.id === 'item2');\n \n expect(item1).toEqual(expect.objectContaining({\n x: 0, y: 0, w: 4, h: 2, id: 'item1'\n }));\n \n expect(item2).toEqual(expect.objectContaining({\n x: 4, y: 0, w: 4, h: 4, id: 'item2'\n }));\n });\n\n it('should handle empty grid initialization', () => {\n document.body.innerHTML = '<div class=\"grid-stack\"></div>';\n \n const grid = GridStack.init();\n \n expect(grid).toBeDefined();\n expect(grid.engine.nodes).toHaveLength(0);\n });\n\n it('should add widgets programmatically', () => {\n document.body.innerHTML = '<div class=\"grid-stack\"></div>';\n \n const grid = GridStack.init();\n \n const addedEl = grid.addWidget({\n x: 0, y: 0, w: 2, h: 2, id: 'new-widget'\n });\n \n expect(addedEl).toBeDefined();\n expect(grid.engine.nodes).toHaveLength(1);\n \n // Check that the widget was added with valid properties\n const node = grid.engine.nodes[0];\n expect(node.x).toBe(0);\n expect(node.y).toBe(0);\n // Note: w and h might default to 1x1 if not explicitly set in the HTML attributes\n });\n });\n\n describe('Layout and positioning validation', () => {\n it('should respect minRow constraints', () => {\n document.body.innerHTML = '<div class=\"grid-stack\"></div>';\n \n const grid = GridStack.init({ minRow: 3 });\n \n // Even with no items, grid should maintain minimum rows\n expect(grid.getRow()).toBeGreaterThanOrEqual(3);\n });\n\n it('should handle widget collision detection', () => {\n document.body.innerHTML = `\n <div class=\"grid-stack\">\n <div class=\"grid-stack-item\" gs-x=\"0\" gs-y=\"0\" gs-w=\"2\" gs-h=\"2\" gs-id=\"item1\">\n <div class=\"grid-stack-item-content\">Item 1</div>\n </div>\n </div>\n `;\n\n const grid = GridStack.init();\n \n // Try to add overlapping widget\n const widgetEl = grid.addWidget({\n x: 1, y: 1, w: 2, h: 2, id: 'overlap'\n });\n \n expect(widgetEl).toBeDefined();\n expect(grid.engine.nodes).toHaveLength(2);\n \n // Verify that items don't actually overlap (GridStack should handle collision)\n // Just verify we have 2 nodes without overlap testing since the API changed\n const nodes = grid.engine.nodes;\n expect(nodes).toHaveLength(2);\n \n // All nodes should have valid positions\n nodes.forEach(node => {\n expect(node.x).toBeGreaterThanOrEqual(0);\n expect(node.y).toBeGreaterThanOrEqual(0);\n expect(node.w).toBeGreaterThan(0);\n expect(node.h).toBeGreaterThan(0);\n });\n });\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { GridStack } from '../src/gridstack';
|
|
2
|
-
describe('regression >', () => {
|
|
3
|
-
'use strict';
|
|
4
|
-
let grid;
|
|
5
|
-
let findEl = function (id) {
|
|
6
|
-
return grid.engine.nodes.find(n => n.id === id).el;
|
|
7
|
-
};
|
|
8
|
-
let findSubEl = function (id, index = 0) {
|
|
9
|
-
return grid.engine.nodes[index].subGrid?.engine.nodes.find(n => n.id === id).el;
|
|
10
|
-
};
|
|
11
|
-
// empty grid
|
|
12
|
-
let gridstackEmptyHTML = '<div style="width: 800px; height: 600px" id="gs-cont">' +
|
|
13
|
-
' <div class="grid-stack"></div>' +
|
|
14
|
-
'</div>';
|
|
15
|
-
describe('2492 load() twice >', () => {
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
document.body.insertAdjacentHTML('afterbegin', gridstackEmptyHTML);
|
|
18
|
-
});
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
document.body.removeChild(document.getElementById('gs-cont'));
|
|
21
|
-
});
|
|
22
|
-
it('', () => {
|
|
23
|
-
let items = [
|
|
24
|
-
{ x: 0, y: 0, w: 2, content: '0 wide' },
|
|
25
|
-
{ x: 1, y: 0, content: '1 over' },
|
|
26
|
-
{ x: 2, y: 1, content: '2 float' },
|
|
27
|
-
];
|
|
28
|
-
let count = 0;
|
|
29
|
-
items.forEach(n => n.id = String(count++));
|
|
30
|
-
grid = GridStack.init({ cellHeight: 70, margin: 5 }).load(items);
|
|
31
|
-
let el0 = findEl('0');
|
|
32
|
-
let el1 = findEl('1');
|
|
33
|
-
let el2 = findEl('2');
|
|
34
|
-
expect(el0.getAttribute('gs-x')).toBe(null);
|
|
35
|
-
expect(el0.getAttribute('gs-y')).toBe(null);
|
|
36
|
-
expect(el0.children[0].innerHTML).toBe(items[0].content);
|
|
37
|
-
expect(parseInt(el1.getAttribute('gs-x'))).toBe(1);
|
|
38
|
-
expect(parseInt(el1.getAttribute('gs-y'))).toBe(1);
|
|
39
|
-
expect(parseInt(el2.getAttribute('gs-x'))).toBe(2);
|
|
40
|
-
expect(el2.getAttribute('gs-y')).toBe(null);
|
|
41
|
-
// loading with changed content should be same positions
|
|
42
|
-
items.forEach(n => n.content += '*');
|
|
43
|
-
grid.load(items);
|
|
44
|
-
expect(el0.getAttribute('gs-x')).toBe(null);
|
|
45
|
-
expect(el0.getAttribute('gs-y')).toBe(null);
|
|
46
|
-
expect(el0.children[0].innerHTML).toBe(items[0].content);
|
|
47
|
-
expect(parseInt(el1.getAttribute('gs-x'))).toBe(1);
|
|
48
|
-
expect(parseInt(el1.getAttribute('gs-y'))).toBe(1);
|
|
49
|
-
expect(parseInt(el2.getAttribute('gs-x'))).toBe(2);
|
|
50
|
-
expect(el2.getAttribute('gs-y')).toBe(null);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('2865 nested grid resize >', () => {
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
document.body.insertAdjacentHTML('afterbegin', gridstackEmptyHTML);
|
|
56
|
-
});
|
|
57
|
-
afterEach(() => {
|
|
58
|
-
document.body.removeChild(document.getElementById('gs-cont'));
|
|
59
|
-
});
|
|
60
|
-
it('', () => {
|
|
61
|
-
let children = [{}, {}, {}];
|
|
62
|
-
let items = [
|
|
63
|
-
{ x: 0, y: 0, w: 3, h: 5, sizeToContent: true, subGridOpts: { children, column: 'auto' } }
|
|
64
|
-
];
|
|
65
|
-
let count = 0;
|
|
66
|
-
[...items, ...children].forEach(n => n.id = String(count++));
|
|
67
|
-
grid = GridStack.init({ cellHeight: 70, margin: 5, children: items });
|
|
68
|
-
let nested = findEl('0');
|
|
69
|
-
let el1 = findSubEl('1');
|
|
70
|
-
let el2 = findSubEl('2');
|
|
71
|
-
let el3 = findSubEl('3');
|
|
72
|
-
expect(nested.getAttribute('gs-x')).toBe(null);
|
|
73
|
-
expect(nested.getAttribute('gs-y')).toBe(null);
|
|
74
|
-
expect(parseInt(nested.getAttribute('gs-w'))).toBe(3);
|
|
75
|
-
// TODO: sizeToContent doesn't seem to be called in headless mode ??? works in browser.
|
|
76
|
-
// expect(nested.getAttribute('gs-h')).toBe(null); // sizeToContent 5 -> 1 which is null
|
|
77
|
-
expect(el1.getAttribute('gs-x')).toBe(null);
|
|
78
|
-
expect(el1.getAttribute('gs-y')).toBe(null);
|
|
79
|
-
expect(parseInt(el2.getAttribute('gs-x'))).toBe(1);
|
|
80
|
-
expect(el2.getAttribute('gs-y')).toBe(null);
|
|
81
|
-
expect(parseInt(el3.getAttribute('gs-x'))).toBe(2);
|
|
82
|
-
expect(el3.getAttribute('gs-y')).toBe(null);
|
|
83
|
-
// now resize the nested grid to 2 -> should reflow el3
|
|
84
|
-
grid.update(nested, { w: 2 });
|
|
85
|
-
expect(nested.getAttribute('gs-x')).toBe(null);
|
|
86
|
-
expect(nested.getAttribute('gs-y')).toBe(null);
|
|
87
|
-
expect(parseInt(nested.getAttribute('gs-w'))).toBe(2);
|
|
88
|
-
// TODO: sizeToContent doesn't seem to be called in headless mode ??? works in browser.
|
|
89
|
-
// expect(parseInt(nested.getAttribute('gs-h'))).toBe(2);
|
|
90
|
-
expect(el1.getAttribute('gs-x')).toBe(null);
|
|
91
|
-
expect(el1.getAttribute('gs-y')).toBe(null);
|
|
92
|
-
expect(parseInt(el2.getAttribute('gs-x'))).toBe(1);
|
|
93
|
-
expect(el2.getAttribute('gs-y')).toBe(null);
|
|
94
|
-
// 3rd item pushed to next row
|
|
95
|
-
expect(el3.getAttribute('gs-x')).toBe(null);
|
|
96
|
-
expect(parseInt(el3.getAttribute('gs-y'))).toBe(1);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
//# sourceMappingURL=regression-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regression-spec.js","sourceRoot":"","sources":["../../spec/regression-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAEnF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,YAAY,CAAC;IAEb,IAAI,IAAe,CAAC;IACpB,IAAI,MAAM,GAAG,UAAS,EAAU;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAE,CAAC,EAAG,CAAC;IACvD,CAAC,CAAC;IACF,IAAI,SAAS,GAAG,UAAS,EAAU,EAAE,KAAK,GAAG,CAAC;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAE,CAAC,EAAG,CAAC;IACpF,CAAC,CAAC;IAGF,aAAa;IACb,IAAI,kBAAkB,GACtB,wDAAwD;QACxD,kCAAkC;QAClC,QAAQ,CAAC;IAET,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,UAAU,CAAC,GAAG,EAAE;YACd,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,GAAG,EAAE;YACb,QAAQ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,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC;YAC3B,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/C,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtD,uFAAuF;YACvF,yDAAyD;YACzD,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnD,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,8BAA8B;YAC9B,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { GridItemHTMLElement, GridStack, GridStackWidget } from '../src/gridstack';\r\n\r\ndescribe('regression >', () => {\r\n 'use strict';\r\n\r\n let grid: GridStack;\r\n let findEl = function(id: string): GridItemHTMLElement {\r\n return grid.engine.nodes.find(n => n.id === id)!.el!;\r\n };\r\n let findSubEl = function(id: string, index = 0): GridItemHTMLElement {\r\n return grid.engine.nodes[index].subGrid?.engine.nodes.find(n => n.id === id)!.el!;\r\n };\r\n\r\n\r\n // empty grid\r\n let gridstackEmptyHTML =\r\n '<div style=\"width: 800px; height: 600px\" id=\"gs-cont\">' +\r\n ' <div class=\"grid-stack\"></div>' +\r\n '</div>';\r\n\r\n describe('2492 load() twice >', () => {\r\n beforeEach(() => {\r\n document.body.insertAdjacentHTML('afterbegin', gridstackEmptyHTML);\r\n });\r\n afterEach(() => {\r\n document.body.removeChild(document.getElementById('gs-cont'));\r\n });\r\n it('', () => {\r\n let items: GridStackWidget[] = [\r\n {x: 0, y: 0, w:2, content: '0 wide'},\r\n {x: 1, y: 0, content: '1 over'},\r\n {x: 2, y: 1, content: '2 float'},\r\n ];\r\n let count = 0;\r\n items.forEach(n => n.id = String(count++));\r\n grid = GridStack.init({cellHeight: 70, margin: 5}).load(items);\r\n\r\n let el0 = findEl('0');\r\n let el1 = findEl('1');\r\n let el2 = findEl('2');\r\n\r\n expect(el0.getAttribute('gs-x')).toBe(null);\r\n expect(el0.getAttribute('gs-y')).toBe(null);\r\n expect(el0.children[0].innerHTML).toBe(items[0].content!);\r\n expect(parseInt(el1.getAttribute('gs-x'))).toBe(1);\r\n expect(parseInt(el1.getAttribute('gs-y'))).toBe(1);\r\n expect(parseInt(el2.getAttribute('gs-x'))).toBe(2);\r\n expect(el2.getAttribute('gs-y')).toBe(null);\r\n\r\n // loading with changed content should be same positions\r\n items.forEach(n => n.content += '*')\r\n grid.load(items);\r\n expect(el0.getAttribute('gs-x')).toBe(null);\r\n expect(el0.getAttribute('gs-y')).toBe(null);\r\n expect(el0.children[0].innerHTML).toBe(items[0].content!);\r\n expect(parseInt(el1.getAttribute('gs-x'))).toBe(1);\r\n expect(parseInt(el1.getAttribute('gs-y'))).toBe(1);\r\n expect(parseInt(el2.getAttribute('gs-x'))).toBe(2);\r\n expect(el2.getAttribute('gs-y')).toBe(null);\r\n });\r\n });\r\n\r\n describe('2865 nested grid resize >', () => {\r\n beforeEach(() => {\r\n document.body.insertAdjacentHTML('afterbegin', gridstackEmptyHTML);\r\n });\r\n afterEach(() => {\r\n document.body.removeChild(document.getElementById('gs-cont'));\r\n });\r\n it('', () => {\r\n let children: GridStackWidget[] = [{},{},{}];\r\n let items: GridStackWidget[] = [\r\n {x: 0, y: 0, w:3, h:5, sizeToContent: true, subGridOpts: {children, column: 'auto'}}\r\n ];\r\n let count = 0;\r\n [...items, ...children].forEach(n => n.id = String(count++));\r\n grid = GridStack.init({cellHeight: 70, margin: 5, children: items});\r\n\r\n let nested = findEl('0');\r\n let el1 = findSubEl('1');\r\n let el2 = findSubEl('2');\r\n let el3 = findSubEl('3');\r\n expect(nested.getAttribute('gs-x')).toBe(null);\r\n expect(nested.getAttribute('gs-y')).toBe(null);\r\n expect(parseInt(nested.getAttribute('gs-w'))).toBe(3);\r\n // TODO: sizeToContent doesn't seem to be called in headless mode ??? works in browser.\r\n // expect(nested.getAttribute('gs-h')).toBe(null); // sizeToContent 5 -> 1 which is null\r\n expect(el1.getAttribute('gs-x')).toBe(null);\r\n expect(el1.getAttribute('gs-y')).toBe(null);\r\n expect(parseInt(el2.getAttribute('gs-x'))).toBe(1);\r\n expect(el2.getAttribute('gs-y')).toBe(null);\r\n expect(parseInt(el3.getAttribute('gs-x'))).toBe(2);\r\n expect(el3.getAttribute('gs-y')).toBe(null);\r\n\r\n // now resize the nested grid to 2 -> should reflow el3\r\n grid.update(nested, {w:2});\r\n expect(nested.getAttribute('gs-x')).toBe(null);\r\n expect(nested.getAttribute('gs-y')).toBe(null);\r\n expect(parseInt(nested.getAttribute('gs-w'))).toBe(2);\r\n // TODO: sizeToContent doesn't seem to be called in headless mode ??? works in browser.\r\n // expect(parseInt(nested.getAttribute('gs-h'))).toBe(2);\r\n expect(el1.getAttribute('gs-x')).toBe(null);\r\n expect(el1.getAttribute('gs-y')).toBe(null);\r\n expect(parseInt(el2.getAttribute('gs-x'))).toBe(1);\r\n expect(el2.getAttribute('gs-y')).toBe(null);\r\n // 3rd item pushed to next row\r\n expect(el3.getAttribute('gs-x')).toBe(null);\r\n expect(parseInt(el3.getAttribute('gs-y'))).toBe(1);\r\n });\r\n });\r\n});\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/spec/utils-spec.js
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../src/utils';
|
|
2
|
-
describe('gridstack utils', () => {
|
|
3
|
-
describe('setup of utils', () => {
|
|
4
|
-
it('should set gridstack Utils.', () => {
|
|
5
|
-
let utils = Utils;
|
|
6
|
-
expect(utils).not.toBeNull();
|
|
7
|
-
expect(typeof utils).toBe('function');
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
describe('test toBool', () => {
|
|
11
|
-
it('should return booleans.', () => {
|
|
12
|
-
expect(Utils.toBool(true)).toEqual(true);
|
|
13
|
-
expect(Utils.toBool(false)).toEqual(false);
|
|
14
|
-
});
|
|
15
|
-
it('should work with integer.', () => {
|
|
16
|
-
expect(Utils.toBool(1)).toEqual(true);
|
|
17
|
-
expect(Utils.toBool(0)).toEqual(false);
|
|
18
|
-
});
|
|
19
|
-
it('should work with Strings.', () => {
|
|
20
|
-
expect(Utils.toBool('')).toEqual(false);
|
|
21
|
-
expect(Utils.toBool('0')).toEqual(false);
|
|
22
|
-
expect(Utils.toBool('no')).toEqual(false);
|
|
23
|
-
expect(Utils.toBool('false')).toEqual(false);
|
|
24
|
-
expect(Utils.toBool('yes')).toEqual(true);
|
|
25
|
-
expect(Utils.toBool('yadda')).toEqual(true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
describe('test isIntercepted', () => {
|
|
29
|
-
let src = { x: 3, y: 2, w: 3, h: 2 };
|
|
30
|
-
it('should intercept.', () => {
|
|
31
|
-
expect(Utils.isIntercepted(src, { x: 0, y: 0, w: 4, h: 3 })).toEqual(true);
|
|
32
|
-
expect(Utils.isIntercepted(src, { x: 0, y: 0, w: 40, h: 30 })).toEqual(true);
|
|
33
|
-
expect(Utils.isIntercepted(src, { x: 3, y: 2, w: 3, h: 2 })).toEqual(true);
|
|
34
|
-
expect(Utils.isIntercepted(src, { x: 5, y: 3, w: 3, h: 2 })).toEqual(true);
|
|
35
|
-
});
|
|
36
|
-
it('shouldn\'t intercept.', () => {
|
|
37
|
-
expect(Utils.isIntercepted(src, { x: 0, y: 0, w: 3, h: 2 })).toEqual(false);
|
|
38
|
-
expect(Utils.isIntercepted(src, { x: 0, y: 0, w: 13, h: 2 })).toEqual(false);
|
|
39
|
-
expect(Utils.isIntercepted(src, { x: 1, y: 4, w: 13, h: 2 })).toEqual(false);
|
|
40
|
-
expect(Utils.isIntercepted(src, { x: 0, y: 3, w: 3, h: 2 })).toEqual(false);
|
|
41
|
-
expect(Utils.isIntercepted(src, { x: 6, y: 3, w: 3, h: 2 })).toEqual(false);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('test parseHeight', () => {
|
|
45
|
-
it('should parse height value', () => {
|
|
46
|
-
expect(Utils.parseHeight(12)).toEqual(expect.objectContaining({ h: 12, unit: 'px' }));
|
|
47
|
-
expect(Utils.parseHeight('12px')).toEqual(expect.objectContaining({ h: 12, unit: 'px' }));
|
|
48
|
-
expect(Utils.parseHeight('12.3px')).toEqual(expect.objectContaining({ h: 12.3, unit: 'px' }));
|
|
49
|
-
expect(Utils.parseHeight('12.3em')).toEqual(expect.objectContaining({ h: 12.3, unit: 'em' }));
|
|
50
|
-
expect(Utils.parseHeight('12.3rem')).toEqual(expect.objectContaining({ h: 12.3, unit: 'rem' }));
|
|
51
|
-
expect(Utils.parseHeight('12.3vh')).toEqual(expect.objectContaining({ h: 12.3, unit: 'vh' }));
|
|
52
|
-
expect(Utils.parseHeight('12.3vw')).toEqual(expect.objectContaining({ h: 12.3, unit: 'vw' }));
|
|
53
|
-
expect(Utils.parseHeight('12.3%')).toEqual(expect.objectContaining({ h: 12.3, unit: '%' }));
|
|
54
|
-
expect(Utils.parseHeight('12.5cm')).toEqual(expect.objectContaining({ h: 12.5, unit: 'cm' }));
|
|
55
|
-
expect(Utils.parseHeight('12.5mm')).toEqual(expect.objectContaining({ h: 12.5, unit: 'mm' }));
|
|
56
|
-
expect(Utils.parseHeight('12.5')).toEqual(expect.objectContaining({ h: 12.5, unit: 'px' }));
|
|
57
|
-
expect(() => { Utils.parseHeight('12.5 df'); }).toThrow('Invalid height val = 12.5 df');
|
|
58
|
-
});
|
|
59
|
-
it('should parse negative height value', () => {
|
|
60
|
-
expect(Utils.parseHeight(-12)).toEqual(expect.objectContaining({ h: -12, unit: 'px' }));
|
|
61
|
-
expect(Utils.parseHeight('-12px')).toEqual(expect.objectContaining({ h: -12, unit: 'px' }));
|
|
62
|
-
expect(Utils.parseHeight('-12.3px')).toEqual(expect.objectContaining({ h: -12.3, unit: 'px' }));
|
|
63
|
-
expect(Utils.parseHeight('-12.3em')).toEqual(expect.objectContaining({ h: -12.3, unit: 'em' }));
|
|
64
|
-
expect(Utils.parseHeight('-12.3rem')).toEqual(expect.objectContaining({ h: -12.3, unit: 'rem' }));
|
|
65
|
-
expect(Utils.parseHeight('-12.3vh')).toEqual(expect.objectContaining({ h: -12.3, unit: 'vh' }));
|
|
66
|
-
expect(Utils.parseHeight('-12.3vw')).toEqual(expect.objectContaining({ h: -12.3, unit: 'vw' }));
|
|
67
|
-
expect(Utils.parseHeight('-12.3%')).toEqual(expect.objectContaining({ h: -12.3, unit: '%' }));
|
|
68
|
-
expect(Utils.parseHeight('-12.3cm')).toEqual(expect.objectContaining({ h: -12.3, unit: 'cm' }));
|
|
69
|
-
expect(Utils.parseHeight('-12.3mm')).toEqual(expect.objectContaining({ h: -12.3, unit: 'mm' }));
|
|
70
|
-
expect(Utils.parseHeight('-12.5')).toEqual(expect.objectContaining({ h: -12.5, unit: 'px' }));
|
|
71
|
-
expect(() => { Utils.parseHeight('-12.5 df'); }).toThrow('Invalid height val = -12.5 df');
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe('test defaults', () => {
|
|
75
|
-
it('should assign missing field or undefined', () => {
|
|
76
|
-
let src = {};
|
|
77
|
-
expect(src).toEqual({});
|
|
78
|
-
expect(Utils.defaults(src, { x: 1, y: 2 })).toEqual({ x: 1, y: 2 });
|
|
79
|
-
expect(Utils.defaults(src, { x: 10 })).toEqual({ x: 1, y: 2 });
|
|
80
|
-
src.w = undefined;
|
|
81
|
-
expect(src).toEqual({ x: 1, y: 2, w: undefined });
|
|
82
|
-
expect(Utils.defaults(src, { x: 10, w: 3 })).toEqual({ x: 1, y: 2, w: 3 });
|
|
83
|
-
expect(Utils.defaults(src, { h: undefined })).toEqual({ x: 1, y: 2, w: 3, h: undefined });
|
|
84
|
-
src = { x: 1, y: 2, sub: { foo: 1, two: 2 } };
|
|
85
|
-
expect(src).toEqual({ x: 1, y: 2, sub: { foo: 1, two: 2 } });
|
|
86
|
-
expect(Utils.defaults(src, { x: 10, w: 3 })).toEqual({ x: 1, y: 2, w: 3, sub: { foo: 1, two: 2 } });
|
|
87
|
-
expect(Utils.defaults(src, { sub: { three: 3 } })).toEqual({ x: 1, y: 2, w: 3, sub: { foo: 1, two: 2, three: 3 } });
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
describe('removePositioningStyles', () => {
|
|
91
|
-
it('should remove styles', () => {
|
|
92
|
-
let doc = document.implementation.createHTMLDocument();
|
|
93
|
-
doc.body.innerHTML = '<div style="position: absolute; left: 1; top: 2; w: 3; h: 4"></div>';
|
|
94
|
-
let el = doc.body.children[0];
|
|
95
|
-
expect(el.style.position).toEqual('absolute');
|
|
96
|
-
// expect(el.style.left).toEqual('1'); // not working!
|
|
97
|
-
Utils.removePositioningStyles(el);
|
|
98
|
-
expect(el.style.position).toEqual('');
|
|
99
|
-
// bogus test
|
|
100
|
-
expect(Utils.getScrollElement(el)).not.toBe(null);
|
|
101
|
-
// bogus test
|
|
102
|
-
Utils.updateScrollPosition(el, { top: 20 }, 10);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
describe('clone', () => {
|
|
106
|
-
const a = { first: 1, second: 'text' };
|
|
107
|
-
const b = { first: 1, second: { third: 3 } };
|
|
108
|
-
const c = { first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } };
|
|
109
|
-
it('Should have the same values', () => {
|
|
110
|
-
const z = Utils.clone(a);
|
|
111
|
-
expect(z).toEqual({ first: 1, second: 'text' });
|
|
112
|
-
});
|
|
113
|
-
it('Should have 2 in first key, and original unchanged', () => {
|
|
114
|
-
const z = Utils.clone(a);
|
|
115
|
-
z.first = 2;
|
|
116
|
-
expect(a).toEqual({ first: 1, second: 'text' });
|
|
117
|
-
expect(z).toEqual({ first: 2, second: 'text' });
|
|
118
|
-
});
|
|
119
|
-
it('Should have new string in second key, and original unchanged', () => {
|
|
120
|
-
const z = Utils.clone(a);
|
|
121
|
-
z.second = 2;
|
|
122
|
-
expect(a).toEqual({ first: 1, second: 'text' });
|
|
123
|
-
expect(z).toEqual({ first: 1, second: 2 });
|
|
124
|
-
});
|
|
125
|
-
it('new string in both cases - use cloneDeep instead', () => {
|
|
126
|
-
const z = Utils.clone(b);
|
|
127
|
-
z.second.third = 'share';
|
|
128
|
-
expect(b).toEqual({ first: 1, second: { third: 'share' } });
|
|
129
|
-
expect(z).toEqual({ first: 1, second: { third: 'share' } });
|
|
130
|
-
});
|
|
131
|
-
it('Array Should match', () => {
|
|
132
|
-
const z = Utils.clone(c);
|
|
133
|
-
expect(c).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
134
|
-
expect(z).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
135
|
-
});
|
|
136
|
-
it('Array[0] changed in both cases - use cloneDeep instead', () => {
|
|
137
|
-
const z = Utils.clone(c);
|
|
138
|
-
z.second[0] = 0;
|
|
139
|
-
expect(c).toEqual({ first: 1, second: [0, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
140
|
-
expect(z).toEqual({ first: 1, second: [0, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
141
|
-
});
|
|
142
|
-
it('fifth changed in both cases - use cloneDeep instead', () => {
|
|
143
|
-
const z = Utils.clone(c);
|
|
144
|
-
z.third.fourth.fifth = 'share';
|
|
145
|
-
expect(c).toEqual({ first: 1, second: [0, 2, 3], third: { fourth: { fifth: 'share' } } });
|
|
146
|
-
expect(z).toEqual({ first: 1, second: [0, 2, 3], third: { fourth: { fifth: 'share' } } });
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
describe('cloneDeep', () => {
|
|
150
|
-
// reset our test cases
|
|
151
|
-
const a = { first: 1, second: 'text' };
|
|
152
|
-
const b = { first: 1, second: { third: 3 } };
|
|
153
|
-
const c = { first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } };
|
|
154
|
-
const d = { first: [1, [2, 3], ['four', 'five', 'six']] };
|
|
155
|
-
const e = { first: 1, __skip: { second: 2 } };
|
|
156
|
-
const f = { first: 1, _dontskip: { second: 2 } };
|
|
157
|
-
it('Should have the same values', () => {
|
|
158
|
-
const z = Utils.cloneDeep(a);
|
|
159
|
-
expect(z).toEqual({ first: 1, second: 'text' });
|
|
160
|
-
});
|
|
161
|
-
it('Should have 2 in first key, and original unchanged', () => {
|
|
162
|
-
const z = Utils.cloneDeep(a);
|
|
163
|
-
z.first = 2;
|
|
164
|
-
expect(a).toEqual({ first: 1, second: 'text' });
|
|
165
|
-
expect(z).toEqual({ first: 2, second: 'text' });
|
|
166
|
-
});
|
|
167
|
-
it('Should have new string in second key, and original unchanged', () => {
|
|
168
|
-
const z = Utils.cloneDeep(a);
|
|
169
|
-
z.second = 2;
|
|
170
|
-
expect(a).toEqual({ first: 1, second: 'text' });
|
|
171
|
-
expect(z).toEqual({ first: 1, second: 2 });
|
|
172
|
-
});
|
|
173
|
-
it('Should have new string nested object, and original unchanged', () => {
|
|
174
|
-
const z = Utils.cloneDeep(b);
|
|
175
|
-
z.second.third = 'diff';
|
|
176
|
-
expect(b).toEqual({ first: 1, second: { third: 3 } });
|
|
177
|
-
expect(z).toEqual({ first: 1, second: { third: 'diff' } });
|
|
178
|
-
});
|
|
179
|
-
it('Array Should match', () => {
|
|
180
|
-
const z = Utils.cloneDeep(c);
|
|
181
|
-
expect(c).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
182
|
-
expect(z).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
183
|
-
});
|
|
184
|
-
it('Array[0] changed in z only', () => {
|
|
185
|
-
const z = Utils.cloneDeep(c);
|
|
186
|
-
z.second[0] = 0;
|
|
187
|
-
expect(c).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
188
|
-
expect(z).toEqual({ first: 1, second: [0, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
189
|
-
});
|
|
190
|
-
it('nested firth element changed only in z', () => {
|
|
191
|
-
const z = Utils.cloneDeep(c);
|
|
192
|
-
z.third.fourth.fifth = 'diff';
|
|
193
|
-
expect(c).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 5 } } });
|
|
194
|
-
expect(z).toEqual({ first: 1, second: [1, 2, 3], third: { fourth: { fifth: 'diff' } } });
|
|
195
|
-
});
|
|
196
|
-
it('nested array only has one item changed', () => {
|
|
197
|
-
const z = Utils.cloneDeep(d);
|
|
198
|
-
z.first[1] = 'two';
|
|
199
|
-
z.first[2][2] = 6;
|
|
200
|
-
expect(d).toEqual({ first: [1, [2, 3], ['four', 'five', 'six']] });
|
|
201
|
-
expect(z).toEqual({ first: [1, 'two', ['four', 'five', 6]] });
|
|
202
|
-
});
|
|
203
|
-
it('skip __ items so it mods both instance', () => {
|
|
204
|
-
const z = Utils.cloneDeep(e);
|
|
205
|
-
z.__skip.second = 'two';
|
|
206
|
-
expect(e).toEqual({ first: 1, __skip: { second: 'two' } }); // TODO support clone deep of function workaround
|
|
207
|
-
expect(z).toEqual({ first: 1, __skip: { second: 'two' } });
|
|
208
|
-
});
|
|
209
|
-
it('correctly copy _ item', () => {
|
|
210
|
-
const z = Utils.cloneDeep(f);
|
|
211
|
-
z._dontskip.second = 'two';
|
|
212
|
-
expect(f).toEqual({ first: 1, _dontskip: { second: 2 } });
|
|
213
|
-
expect(z).toEqual({ first: 1, _dontskip: { second: 'two' } });
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
describe('removeInternalAndSame', () => {
|
|
217
|
-
it('should remove internal and same', () => {
|
|
218
|
-
const a = { first: 1, second: 'text', _skip: { second: 2 }, arr: [1, 'second', 3] };
|
|
219
|
-
const b = { first: 1, second: 'text' };
|
|
220
|
-
Utils.removeInternalAndSame(a, b);
|
|
221
|
-
expect(a).toEqual({ arr: [1, 'second', 3] });
|
|
222
|
-
});
|
|
223
|
-
it('should not remove items in an array', () => {
|
|
224
|
-
const a = { arr: [1, 2, 3] };
|
|
225
|
-
const b = { arr: [1, 3] };
|
|
226
|
-
Utils.removeInternalAndSame(a, b);
|
|
227
|
-
expect(a).toEqual({ arr: [1, 2, 3] });
|
|
228
|
-
});
|
|
229
|
-
it('should remove nested object, and make empty', () => {
|
|
230
|
-
const a = { obj1: { first: 1, nested: { second: 2 } }, obj2: { first: 1, second: 2 } };
|
|
231
|
-
const b = { obj1: { first: 1, nested: { second: 2 } }, obj2: { first: 1, second: 2 } };
|
|
232
|
-
Utils.removeInternalAndSame(a, b);
|
|
233
|
-
expect(a).toEqual({});
|
|
234
|
-
});
|
|
235
|
-
it('should remove nested object, and make empty - part 2', () => {
|
|
236
|
-
const a = { obj1: { first: 1, nested: { second: 2 } }, obj2: { first: 1, second: 2 } };
|
|
237
|
-
const b = { obj1: { first: 1 }, obj2: { first: 1, second: 2 } };
|
|
238
|
-
Utils.removeInternalAndSame(a, b);
|
|
239
|
-
expect(a).toEqual({ obj1: { nested: { second: 2 } } });
|
|
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AC,MAAM,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC,EAAC,EAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Utils } from '../src/utils';\n\ndescribe('gridstack utils', () => {\n describe('setup of utils', () => {\n it('should set gridstack Utils.', () => {\n let utils = Utils;\n expect(utils).not.toBeNull();\n expect(typeof utils).toBe('function');\n });\n });\n\n describe('test toBool', () => {\n it('should return booleans.', () => {\n expect(Utils.toBool(true)).toEqual(true);\n expect(Utils.toBool(false)).toEqual(false);\n });\n it('should work with integer.', () => {\n expect(Utils.toBool(1)).toEqual(true);\n expect(Utils.toBool(0)).toEqual(false);\n });\n it('should work with Strings.', () => {\n expect(Utils.toBool('')).toEqual(false);\n expect(Utils.toBool('0')).toEqual(false);\n expect(Utils.toBool('no')).toEqual(false);\n expect(Utils.toBool('false')).toEqual(false);\n expect(Utils.toBool('yes')).toEqual(true);\n expect(Utils.toBool('yadda')).toEqual(true);\n });\n });\n\n describe('test isIntercepted', () => {\n let src = {x: 3, y: 2, w: 3, h: 2};\n\n it('should intercept.', () => {\n expect(Utils.isIntercepted(src, {x: 0, y: 0, w: 4, h: 3})).toEqual(true);\n expect(Utils.isIntercepted(src, {x: 0, y: 0, w: 40, h: 30})).toEqual(true);\n expect(Utils.isIntercepted(src, {x: 3, y: 2, w: 3, h: 2})).toEqual(true);\n expect(Utils.isIntercepted(src, {x: 5, y: 3, w: 3, h: 2})).toEqual(true);\n });\n it('shouldn\\'t intercept.', () => {\n expect(Utils.isIntercepted(src, {x: 0, y: 0, w: 3, h: 2})).toEqual(false);\n expect(Utils.isIntercepted(src, {x: 0, y: 0, w: 13, h: 2})).toEqual(false);\n expect(Utils.isIntercepted(src, {x: 1, y: 4, w: 13, h: 2})).toEqual(false);\n expect(Utils.isIntercepted(src, {x: 0, y: 3, w: 3, h: 2})).toEqual(false);\n expect(Utils.isIntercepted(src, {x: 6, y: 3, w: 3, h: 2})).toEqual(false);\n });\n });\n\n describe('test parseHeight', () => {\n\n it('should parse height value', () => {\n expect(Utils.parseHeight(12)).toEqual(expect.objectContaining({h: 12, unit: 'px'}));\n expect(Utils.parseHeight('12px')).toEqual(expect.objectContaining({h: 12, unit: 'px'}));\n expect(Utils.parseHeight('12.3px')).toEqual(expect.objectContaining({h: 12.3, unit: 'px'}));\n expect(Utils.parseHeight('12.3em')).toEqual(expect.objectContaining({h: 12.3, unit: 'em'}));\n expect(Utils.parseHeight('12.3rem')).toEqual(expect.objectContaining({h: 12.3, unit: 'rem'}));\n expect(Utils.parseHeight('12.3vh')).toEqual(expect.objectContaining({h: 12.3, unit: 'vh'}));\n expect(Utils.parseHeight('12.3vw')).toEqual(expect.objectContaining({h: 12.3, unit: 'vw'}));\n expect(Utils.parseHeight('12.3%')).toEqual(expect.objectContaining({h: 12.3, unit: '%'}));\n expect(Utils.parseHeight('12.5cm')).toEqual(expect.objectContaining({h: 12.5, unit: 'cm'}));\n expect(Utils.parseHeight('12.5mm')).toEqual(expect.objectContaining({h: 12.5, unit: 'mm'}));\n expect(Utils.parseHeight('12.5')).toEqual(expect.objectContaining({h: 12.5, unit: 'px'}));\n expect(() => { Utils.parseHeight('12.5 df'); }).toThrow('Invalid height val = 12.5 df');\n });\n\n it('should parse negative height value', () => {\n expect(Utils.parseHeight(-12)).toEqual(expect.objectContaining({h: -12, unit: 'px'}));\n expect(Utils.parseHeight('-12px')).toEqual(expect.objectContaining({h: -12, unit: 'px'}));\n expect(Utils.parseHeight('-12.3px')).toEqual(expect.objectContaining({h: -12.3, unit: 'px'}));\n expect(Utils.parseHeight('-12.3em')).toEqual(expect.objectContaining({h: -12.3, unit: 'em'}));\n expect(Utils.parseHeight('-12.3rem')).toEqual(expect.objectContaining({h: -12.3, unit: 'rem'}));\n expect(Utils.parseHeight('-12.3vh')).toEqual(expect.objectContaining({h: -12.3, unit: 'vh'}));\n expect(Utils.parseHeight('-12.3vw')).toEqual(expect.objectContaining({h: -12.3, unit: 'vw'}));\n expect(Utils.parseHeight('-12.3%')).toEqual(expect.objectContaining({h: -12.3, unit: '%'}));\n expect(Utils.parseHeight('-12.3cm')).toEqual(expect.objectContaining({h: -12.3, unit: 'cm'}));\n expect(Utils.parseHeight('-12.3mm')).toEqual(expect.objectContaining({h: -12.3, unit: 'mm'}));\n expect(Utils.parseHeight('-12.5')).toEqual(expect.objectContaining({h: -12.5, unit: 'px'}));\n expect(() => { Utils.parseHeight('-12.5 df'); }).toThrow('Invalid height val = -12.5 df');\n });\n });\n\n describe('test defaults', () => {\n it('should assign missing field or undefined', () => {\n let src: any = {};\n expect(src).toEqual({});\n expect(Utils.defaults(src, {x: 1, y: 2})).toEqual({x: 1, y: 2});\n expect(Utils.defaults(src, {x: 10})).toEqual({x: 1, y: 2});\n src.w = undefined;\n expect(src).toEqual({x: 1, y: 2, w: undefined});\n expect(Utils.defaults(src, {x: 10, w: 3})).toEqual({x: 1, y: 2, w: 3});\n expect(Utils.defaults(src, {h: undefined})).toEqual({x: 1, y: 2, w: 3, h: undefined});\n src = {x: 1, y: 2, sub: {foo: 1, two: 2}};\n expect(src).toEqual({x: 1, y: 2, sub: {foo: 1, two: 2}});\n expect(Utils.defaults(src, {x: 10, w: 3})).toEqual({x: 1, y: 2, w: 3, sub: {foo: 1, two: 2}});\n expect(Utils.defaults(src, {sub: {three: 3}})).toEqual({x: 1, y: 2, w: 3, sub: {foo: 1, two: 2, three: 3}});\n });\n });\n\n describe('removePositioningStyles', () => {\n it('should remove styles', () => {\n let doc = document.implementation.createHTMLDocument();\n doc.body.innerHTML = '<div style=\"position: absolute; left: 1; top: 2; w: 3; h: 4\"></div>';\n let el = doc.body.children[0] as HTMLElement;\n expect(el.style.position).toEqual('absolute');\n // expect(el.style.left).toEqual('1'); // not working!\n\n Utils.removePositioningStyles(el);\n expect(el.style.position).toEqual('');\n\n // bogus test\n expect(Utils.getScrollElement(el)).not.toBe(null);\n // bogus test\n Utils.updateScrollPosition(el, {top: 20}, 10);\n });\n });\n\n describe('clone', () => {\n const a: any = {first: 1, second: 'text'};\n const b: any = {first: 1, second: {third: 3}};\n const c: any = {first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}};\n it('Should have the same values', () => {\n const z = Utils.clone(a);\n expect(z).toEqual({first: 1, second: 'text'});\n });\n it('Should have 2 in first key, and original unchanged', () => {\n const z = Utils.clone(a);\n z.first = 2;\n expect(a).toEqual({first: 1, second: 'text'});\n expect(z).toEqual({first: 2, second: 'text'});\n });\n it('Should have new string in second key, and original unchanged', () => {\n const z = Utils.clone(a);\n z.second = 2;\n expect(a).toEqual({first: 1, second: 'text'});\n expect(z).toEqual({first: 1, second: 2});\n });\n it('new string in both cases - use cloneDeep instead', () => {\n const z = Utils.clone(b);\n z.second.third = 'share';\n expect(b).toEqual({first: 1, second: {third: 'share'}});\n expect(z).toEqual({first: 1, second: {third: 'share'}});\n });\n it('Array Should match', () => {\n const z = Utils.clone(c);\n expect(c).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n expect(z).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n });\n it('Array[0] changed in both cases - use cloneDeep instead', () => {\n const z = Utils.clone(c);\n z.second[0] = 0;\n expect(c).toEqual({first: 1, second: [0, 2, 3], third: { fourth: {fifth: 5}}});\n expect(z).toEqual({first: 1, second: [0, 2, 3], third: { fourth: {fifth: 5}}});\n });\n it('fifth changed in both cases - use cloneDeep instead', () => {\n const z = Utils.clone(c);\n z.third.fourth.fifth = 'share';\n expect(c).toEqual({first: 1, second: [0, 2, 3], third: { fourth: {fifth: 'share'}}});\n expect(z).toEqual({first: 1, second: [0, 2, 3], third: { fourth: {fifth: 'share'}}});\n });\n });\n describe('cloneDeep', () => {\n // reset our test cases\n const a: any = {first: 1, second: 'text'};\n const b: any = {first: 1, second: {third: 3}};\n const c: any = {first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}};\n const d: any = {first: [1, [2, 3], ['four', 'five', 'six']]};\n const e: any = {first: 1, __skip: {second: 2}};\n const f: any = {first: 1, _dontskip: {second: 2}};\n \n it('Should have the same values', () => {\n const z = Utils.cloneDeep(a);\n expect(z).toEqual({first: 1, second: 'text'});\n });\n it('Should have 2 in first key, and original unchanged', () => {\n const z = Utils.cloneDeep(a);\n z.first = 2;\n expect(a).toEqual({first: 1, second: 'text'});\n expect(z).toEqual({first: 2, second: 'text'});\n });\n it('Should have new string in second key, and original unchanged', () => {\n const z = Utils.cloneDeep(a);\n z.second = 2;\n expect(a).toEqual({first: 1, second: 'text'});\n expect(z).toEqual({first: 1, second: 2});\n });\n it('Should have new string nested object, and original unchanged', () => {\n const z = Utils.cloneDeep(b);\n z.second.third = 'diff';\n expect(b).toEqual({first: 1, second: {third: 3}});\n expect(z).toEqual({first: 1, second: {third: 'diff'}});\n });\n it('Array Should match', () => {\n const z = Utils.cloneDeep(c);\n expect(c).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n expect(z).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n });\n it('Array[0] changed in z only', () => {\n const z = Utils.cloneDeep(c);\n z.second[0] = 0;\n expect(c).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n expect(z).toEqual({first: 1, second: [0, 2, 3], third: { fourth: {fifth: 5}}});\n });\n it('nested firth element changed only in z', () => {\n const z = Utils.cloneDeep(c);\n z.third.fourth.fifth = 'diff';\n expect(c).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 5}}});\n expect(z).toEqual({first: 1, second: [1, 2, 3], third: { fourth: {fifth: 'diff'}}});\n });\n it('nested array only has one item changed', () => {\n const z = Utils.cloneDeep(d);\n z.first[1] = 'two';\n z.first[2][2] = 6;\n expect(d).toEqual({first: [1, [2, 3], ['four', 'five', 'six']]});\n expect(z).toEqual({first: [1, 'two', ['four', 'five', 6]]});\n });\n it('skip __ items so it mods both instance', () => {\n const z = Utils.cloneDeep(e);\n z.__skip.second = 'two';\n expect(e).toEqual({first: 1, __skip: {second: 'two'}}); // TODO support clone deep of function workaround\n expect(z).toEqual({first: 1, __skip: {second: 'two'}});\n });\n it('correctly copy _ item', () => {\n const z = Utils.cloneDeep(f);\n z._dontskip.second = 'two';\n expect(f).toEqual({first: 1, _dontskip: {second: 2}});\n expect(z).toEqual({first: 1, _dontskip: {second: 'two'}});\n });\n });\n describe('removeInternalAndSame', () => {\n it('should remove internal and same', () => {\n const a = {first: 1, second: 'text', _skip: {second: 2}, arr: [1, 'second', 3]};\n const b = {first: 1, second: 'text'};\n Utils.removeInternalAndSame(a, b);\n expect(a).toEqual({arr: [1, 'second', 3]});\n });\n it('should not remove items in an array', () => {\n const a = {arr: [1, 2, 3]};\n const b = {arr: [1, 3]};\n Utils.removeInternalAndSame(a, b);\n expect(a).toEqual({arr: [1, 2, 3]});\n });\n it('should remove nested object, and make empty', () => {\n const a = {obj1: {first: 1, nested: {second: 2}}, obj2: {first: 1, second: 2}};\n const b = {obj1: {first: 1, nested: {second: 2}}, obj2: {first: 1, second: 2}};\n Utils.removeInternalAndSame(a, b);\n expect(a).toEqual({});\n });\n it('should remove nested object, and make empty - part 2', () => {\n const a = {obj1: {first: 1, nested: {second: 2}}, obj2: {first: 1, second: 2}};\n const b = {obj1: {first: 1}, obj2: {first: 1, second: 2}};\n Utils.removeInternalAndSame(a, b);\n expect(a).toEqual({obj1: {nested: {second: 2}}});\n });\n });\n});\n"]}
|