Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/base-widget.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack-item.component.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack.component.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack.module.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
4 changes: 2 additions & 2 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change log
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**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)
Expand Down Expand Up @@ -93,7 +93,7 @@ Change log

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridstack",
"version": "8.4.0-dev",
"version": "9.0.0",
"license": "MIT",
"author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/dd-base-impl.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-draggable.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-droppable.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-element.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-gridstack.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-resizable-handle.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-resizable.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-touch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* touch.ts 8.4.0-dev
* touch.ts 9.0.0
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-engine.ts
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-poly.js
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack.scss
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
4 changes: 2 additions & 2 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* GridStack 8.4.0-dev
* GridStack 9.0.0
* https://gridstackjs.com/
*
* Copyright (c) 2021-2022 Alain Dumesny
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* types.ts 8.4.0-dev
* types.ts 9.0.0
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* utils.ts 8.4.0-dev
* utils.ts 9.0.0
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down Expand Up @@ -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 */
Expand Down