Skip to content

Commit 038eea7

Browse files
authored
Merge pull request #2432 from adumesny/master
9.0.2-dev
2 parents 8ea7d68 + 452854b commit 038eea7

26 files changed

+51
-47
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ Possible breaking change if you use nested grid JSON format, or original Angular
446446
447447
## Migrating to v9
448448
449-
New addition - see release notes about `fitToContent` feature.
449+
New addition - see release notes about `sizeToContent` feature.
450450
Possible break:
451451
* `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.
452452

angular/projects/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gridstack-angular",
3-
"version": "9.0.2",
3+
"version": "9.0.2-dev",
44
"peerDependencies": {
55
"@angular/common": "^14.2.0",
66
"@angular/core": "^14.2.0"

angular/projects/lib/src/lib/base-widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gridstack-item.component.ts 9.0.2
2+
* gridstack-item.component.ts 9.0.2-dev
33
* Copyright (c) 2022 Alain Dumesny - see GridStack root license
44
*/
55

angular/projects/lib/src/lib/gridstack-item.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gridstack-item.component.ts 9.0.2
2+
* gridstack-item.component.ts 9.0.2-dev
33
* Copyright (c) 2022 Alain Dumesny - see GridStack root license
44
*/
55

angular/projects/lib/src/lib/gridstack.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gridstack.component.ts 9.0.2
2+
* gridstack.component.ts 9.0.2-dev
33
* Copyright (c) 2022 Alain Dumesny - see GridStack root license
44
*/
55

angular/projects/lib/src/lib/gridstack.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gridstack.component.ts 9.0.2
2+
* gridstack.component.ts 9.0.2-dev
33
* Copyright (c) 2022 Alain Dumesny - see GridStack root license
44
*/
55

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ <h1>Demos</h1>
1212
<li><a href="anijs.html">AniJS</a></li>
1313
<li><a href="cell-height.html">Cell Height</a></li>
1414
<li><a href="column.html">Column</a></li>
15-
<li><a href="fitToContent.html">Fit To Content</a></li>
1615
<li><a href="float.html">Float grid</a></li>
1716
<li><a href="knockout.html">Knockout.js</a></li>
1817
<li><a href="mobile.html">Mobile touch</a></li>
@@ -26,6 +25,7 @@ <h1>Demos</h1>
2625
<li><a href="responsive.html">Responsive</a></li>
2726
<li><a href="right-to-left(rtl).html">Right-To-Left (RTL)</a></li>
2827
<li><a href="serialization.html">Serialization</a></li>
28+
<li><a href="sizeToContent.html">Size To Content</a></li>
2929
<li><a href="static.html">Static</a></li>
3030
<li><a href="title_drag.html">Title drag</a></li>
3131
<li><a href="two.html">Two grids</a></li>

demo/fitToContent.html renamed to demo/sizeToContent.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<title>FitToContent demo</title>
7+
<title>sizeToContent demo</title>
88

99
<link rel="stylesheet" href="demo.css"/>
1010
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>
@@ -17,9 +17,9 @@
1717
</head>
1818
<body>
1919
<div class="container">
20-
<h1>Cell FitToContent options demo</h1>
20+
<h1>Cell sizeToContent options demo</h1>
2121
<p>new 9.x feature that size the items to fit their content height as to not have scroll bars
22-
(unless `fitToContent:false` in C: case). Defaulting to different initial size (see code) to show grow/shrink behavior.</p>
22+
(unless `sizeToContent:false` in C: case). Defaulting to different initial size (see code) to show grow/shrink behavior.</p>
2323
<div>
2424
column:
2525
<a onClick="column(8)" class="btn btn-primary" href="#">8</a>
@@ -39,17 +39,17 @@ <h1>Cell FitToContent options demo</h1>
3939
let opts = {
4040
margin: 5,
4141
cellHeight: 50,
42-
fitToContent: true, // default to make them all fit
42+
sizeToContent: true, // default to make them all fit
4343
resizable: { handles: 'all'} // do all sides for testing
44-
// cellHeightThrottle: 100, // ms before fitToContent happens
44+
// cellHeightThrottle: 100, // ms before sizeToContent happens
4545
}
4646
let grid = GridStack.init(opts);
4747
let text ='some very large content that will normally not fit in the window.'
4848
text = text + text;
4949
let items = [
5050
{x:0, y:0, w:2, content: `<div>A no h: ${text}</div>`},
5151
{x:2, y:0, w:1, h:2, content: '<div>B: shrink h=2</div>'}, // make taller than needed upfront
52-
{x:3, y:0, w:2, fitToContent: false, content: `<div>C: WILL SCROLL. ${text}</div>`}, // prevent this from fitting testing
52+
{x:3, y:0, w:2, sizeToContent: false, content: `<div>C: WILL SCROLL. ${text}</div>`}, // prevent this from fitting testing
5353
{x:0, y:1, w:3, content: `<div>D no h: ${text} ${text}</div>`},
5454
];
5555
grid.load(items);

doc/CHANGES.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change log
55
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

8+
- [9.0.2-dev (TBD)](#902-dev-tbd)
89
- [9.0.2 (2023-08-29)](#902-2023-08-29)
910
- [9.0.1 (2023-08-27)](#901-2023-08-27)
1011
- [9.0.0 (2023-08-23)](#900-2023-08-23)
@@ -95,16 +96,19 @@ Change log
9596

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

99+
## 9.0.2-dev (TBD)
100+
* renamed fitToContent to sizeToContent (API BREAK)
101+
98102
## 9.0.2 (2023-08-29)
99103
* fix 'resizecontent' event fix not called.
100-
* partial fix [#2427](https://github.com/gridstack/gridstack.js/issues/2427) fitToContent when calling cellHeight()/addWidget()/MakeWidget()
104+
* partial fix [#2427](https://github.com/gridstack/gridstack.js/issues/2427) sizeToContent when calling cellHeight()/addWidget()/MakeWidget()
101105

102106
## 9.0.1 (2023-08-27)
103107
* fix [#2413](https://github.com/gridstack/gridstack.js/issues/2413) support touchscreen+mouse devices. Thank you [@Ruslan207](https://github.com/Ruslan207)
104-
* tweak to `fitToContent` from [#2412](https://github.com/gridstack/gridstack.js/pull/2412#issuecomment-1690219018). Thank you [@JonSohn](https://github.com/JonSohn)
108+
* tweak to `sizeToContent` from [#2412](https://github.com/gridstack/gridstack.js/pull/2412#issuecomment-1690219018). Thank you [@JonSohn](https://github.com/JonSohn)
105109

106110
## 9.0.0 (2023-08-23)
107-
- 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.
111+
- feat [#404](https://github.com/gridstack/gridstack.js/issues/404) added `GridStackOptions.sizeToContent` and `GridStackWidget.sizeToContent` to make gridItems size themselves to their content (no scroll bar), calling `GridStack.resizeToContent(el)` whenever the grid or item is resized.
108112
- also added new `'resizecontent'` event, and `resizeToContentCB` and `resizeToContentParent` vars.
109113
- fix [#2406](https://github.com/gridstack/gridstack.js/issues/2406) inf loop when autoPosition after loading into 1 column, then 2.
110114

doc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ gridstack.js API
9999
- `draggable` - allows to override draggable options - see `DDDragOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body', scroll: true}`)
100100
- `dragOut` to let user drag nested grid items out of a parent or not (default false) See [example](http://gridstackjs.com/demo/nested.html)
101101
- `engineClass` - the type of engine to create (so you can subclass) default to GridStackEngine
102-
- `fitToContent` - make gridItems size themselves to their content, calling `resizeToContent(el)` whenever the grid or item is resized.
102+
- `sizeToContent` - make gridItems size themselves to their content, calling `resizeToContent(el)` whenever the grid or item is resized.
103103
- `float` - enable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html)
104104
- `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)
105105
- `handleClass` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
@@ -159,7 +159,7 @@ You need to add `noResize` and `noMove` attributes to completely lock the widget
159159
- `noMove` - disable element moving
160160
- `id`- (number | string) good for quick identification (for example in change event)
161161
- `content` - (string) html content to be added when calling `grid.load()/addWidget()` as content inside the item
162-
- `fitToContent` - make gridItem size itself to the content, calling `GridStack.resizeToContent(el)` whenever the grid or item is resized.
162+
- `sizeToContent` - make gridItem size itself to the content, calling `GridStack.resizeToContent(el)` whenever the grid or item is resized.
163163
- `subGrid`?: GridStackOptions - optional nested grid options and list of children
164164
- `subGridDynamic`?: boolean - enable/disable the creation of sub-grids on the fly by dragging items completely over others (nest) vs partially (push). Forces `DDDragOpt.pause=true` to accomplish that.
165165

0 commit comments

Comments
 (0)