diff --git a/README.md b/README.md index 0aa892865..3da3f8c66 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids - [Migrating to v6](#migrating-to-v6) - [Migrating to v7](#migrating-to-v7) - [Migrating to v8](#migrating-to-v8) + - [Migrating to v9](#migrating-to-v9) - [jQuery Application](#jquery-application) - [Changes](#changes) - [The Team](#the-team) @@ -443,6 +444,12 @@ Possible breaking change if you use nested grid JSON format, or original Angular * remove `GridStackOptions.minWidth` obsolete since 5.1, use `oneColumnSize` instead * CSS rules removed `.grid-stack` prefix for anything already gs based, 12 column (default) now uses `.gs-12`, extra.css is less than 1/4th it original size!, `gs-min|max_w|h` attribute no longer written (but read) +## Migrating to v9 + +New addition - see release notes about `fitToContent` feature. +Possible break: +* `GridStack.onParentResize()` is now called `onResize()` as grid now directly track size change, no longer involving parent per say to tell us anything. Note sure why it was public. + # jQuery Application This is **old and no longer apply to v6+**. You'll need to use v5.1.1 and before diff --git a/angular/projects/lib/package.json b/angular/projects/lib/package.json index b16ba6269..ee7e05948 100644 --- a/angular/projects/lib/package.json +++ b/angular/projects/lib/package.json @@ -1,6 +1,6 @@ { "name": "gridstack-angular", - "version": "8.4.0-dev", + "version": "9.0.0", "peerDependencies": { "@angular/common": "^14.2.0", "@angular/core": "^14.2.0" diff --git a/angular/projects/lib/src/lib/base-widget.ts b/angular/projects/lib/src/lib/base-widget.ts index 1c5377efa..c7502c5b6 100644 --- a/angular/projects/lib/src/lib/base-widget.ts +++ b/angular/projects/lib/src/lib/base-widget.ts @@ -1,5 +1,5 @@ /** - * gridstack-item.component.ts 8.4.0-dev + * gridstack-item.component.ts 9.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/angular/projects/lib/src/lib/gridstack-item.component.ts b/angular/projects/lib/src/lib/gridstack-item.component.ts index cd26b43c3..1feb8cb2d 100644 --- a/angular/projects/lib/src/lib/gridstack-item.component.ts +++ b/angular/projects/lib/src/lib/gridstack-item.component.ts @@ -1,5 +1,5 @@ /** - * gridstack-item.component.ts 8.4.0-dev + * gridstack-item.component.ts 9.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/angular/projects/lib/src/lib/gridstack.component.ts b/angular/projects/lib/src/lib/gridstack.component.ts index c3c4593b4..2168d6891 100644 --- a/angular/projects/lib/src/lib/gridstack.component.ts +++ b/angular/projects/lib/src/lib/gridstack.component.ts @@ -1,5 +1,5 @@ /** - * gridstack.component.ts 8.4.0-dev + * gridstack.component.ts 9.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/angular/projects/lib/src/lib/gridstack.module.ts b/angular/projects/lib/src/lib/gridstack.module.ts index 81a999bfb..6d1a5d9bd 100644 --- a/angular/projects/lib/src/lib/gridstack.module.ts +++ b/angular/projects/lib/src/lib/gridstack.module.ts @@ -1,5 +1,5 @@ /** - * gridstack.component.ts 8.4.0-dev + * gridstack.component.ts 9.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 0ee1f9b7e..248fcdbe5 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -5,7 +5,7 @@ Change log **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* -- [8.4.0-dev (TBD)](#840-dev-tbd) +- [9.0.0 (2023-08-23)](#900-2023-08-23) - [8.4.0 (2023-07-20)](#840-2023-07-20) - [8.3.0 (2023-06-13)](#830-2023-06-13) - [8.2.3 (2023-06-11)](#823-2023-06-11) @@ -93,7 +93,7 @@ Change log -## 8.4.0-dev (TBD) +## 9.0.0 (2023-08-23) - feat [#404](https://github.com/gridstack/gridstack.js/issues/404) added `GridStackOptions.fitToContent` and `GridStackWidget.fitToContent` to make gridItems size themselves to their content (no scroll bar), calling `GridStack.resizeToContent(el)` whenever the grid or item is resized. - also added new `'resizecontent'` event, and `resizeToContentCB` and `resizeToContentParent` vars. - fix [#2406](https://github.com/gridstack/gridstack.js/issues/2406) inf loop when autoPosition after loading into 1 column, then 2. diff --git a/package.json b/package.json index 40611da11..d06d0a9bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "8.4.0-dev", + "version": "9.0.0", "license": "MIT", "author": "Alain Dumesny (https://github.com/adumesny)", "contributors": [ diff --git a/src/dd-base-impl.ts b/src/dd-base-impl.ts index 0007c7ed0..57c7afe31 100644 --- a/src/dd-base-impl.ts +++ b/src/dd-base-impl.ts @@ -1,5 +1,5 @@ /** - * dd-base-impl.ts 8.4.0-dev + * dd-base-impl.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-draggable.ts b/src/dd-draggable.ts index dd292820a..5b5341fea 100644 --- a/src/dd-draggable.ts +++ b/src/dd-draggable.ts @@ -1,5 +1,5 @@ /** - * dd-draggable.ts 8.4.0-dev + * dd-draggable.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-droppable.ts b/src/dd-droppable.ts index 573b316aa..262605cad 100644 --- a/src/dd-droppable.ts +++ b/src/dd-droppable.ts @@ -1,5 +1,5 @@ /** - * dd-droppable.ts 8.4.0-dev + * dd-droppable.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-element.ts b/src/dd-element.ts index 48b77a743..cd387c148 100644 --- a/src/dd-element.ts +++ b/src/dd-element.ts @@ -1,5 +1,5 @@ /** - * dd-elements.ts 8.4.0-dev + * dd-elements.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-gridstack.ts b/src/dd-gridstack.ts index f793ed6cb..a7f811fa9 100644 --- a/src/dd-gridstack.ts +++ b/src/dd-gridstack.ts @@ -1,5 +1,5 @@ /** - * dd-gridstack.ts 8.4.0-dev + * dd-gridstack.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-manager.ts b/src/dd-manager.ts index 5db40cd7c..57ee2df37 100644 --- a/src/dd-manager.ts +++ b/src/dd-manager.ts @@ -1,5 +1,5 @@ /** - * dd-manager.ts 8.4.0-dev + * dd-manager.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-resizable-handle.ts b/src/dd-resizable-handle.ts index c81be0dab..14a3a658a 100644 --- a/src/dd-resizable-handle.ts +++ b/src/dd-resizable-handle.ts @@ -1,5 +1,5 @@ /** - * dd-resizable-handle.ts 8.4.0-dev + * dd-resizable-handle.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-resizable.ts b/src/dd-resizable.ts index a16ada00d..2db9a16fa 100644 --- a/src/dd-resizable.ts +++ b/src/dd-resizable.ts @@ -1,5 +1,5 @@ /** - * dd-resizable.ts 8.4.0-dev + * dd-resizable.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-touch.ts b/src/dd-touch.ts index ede5eb9e1..8c592cd76 100644 --- a/src/dd-touch.ts +++ b/src/dd-touch.ts @@ -1,5 +1,5 @@ /** - * touch.ts 8.4.0-dev + * touch.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack-engine.ts b/src/gridstack-engine.ts index d21d531ea..084dfa434 100644 --- a/src/gridstack-engine.ts +++ b/src/gridstack-engine.ts @@ -1,5 +1,5 @@ /** - * gridstack-engine.ts 8.4.0-dev + * gridstack-engine.ts 9.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack-poly.js b/src/gridstack-poly.js index 2ce0dc857..2017da084 100644 --- a/src/gridstack-poly.js +++ b/src/gridstack-poly.js @@ -1,5 +1,5 @@ /** - * gridstack-poly.ts 8.4.0-dev used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4) + * gridstack-poly.ts 9.0.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 */ diff --git a/src/gridstack.scss b/src/gridstack.scss index cc4934eed..dcd4bb6be 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -1,5 +1,5 @@ /** - * gridstack SASS styles 8.4.0-dev + * gridstack SASS styles 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack.ts b/src/gridstack.ts index ae751fa63..4f46d52e5 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -1,5 +1,5 @@ /*! - * GridStack 8.4.0-dev + * GridStack 9.0.0 * https://gridstackjs.com/ * * Copyright (c) 2021-2022 Alain Dumesny @@ -1739,7 +1739,7 @@ export class GridStack { return this; } - static GDRev = '8.4.0-dev'; + static GDRev = '9.0.0'; /* =========================================================================================== * drag&drop methods that used to be stubbed out and implemented in dd-gridstack.ts diff --git a/src/types.ts b/src/types.ts index edbb60fa7..663c72439 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ /** - * types.ts 8.4.0-dev + * types.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/utils.ts b/src/utils.ts index 8cee09f2c..73927fd3b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ /** - * utils.ts 8.4.0-dev + * utils.ts 9.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ @@ -103,8 +103,8 @@ export class Utils { } /** true if we should resize to content */ - static shouldFitToContent(n: GridStackNode): boolean { - return n.fitToContent || (n.grid?.opts.fitToContent && n.fitToContent !== false); + static shouldFitToContent(n: GridStackNode | undefined): boolean { + return n?.grid && (n.fitToContent || (n.grid.opts.fitToContent && n.fitToContent !== false)); } /** returns true if a and b overlap */