Skip to content

Commit 19b43a8

Browse files
authored
Merge pull request #2805 from adumesny/master
doc update
2 parents 4aa1aa3 + 861bfb6 commit 19b43a8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

angular/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,23 @@ public identify(index: number, w: GridStackWidget) {
162162

163163
You can see a fuller example at [app.component.ts](projects/demo/src/app/app.component.ts)
164164

165-
to build the demo, go to [angular/projects/demo](projects/demo/) and run `yarn` + `yarn start` and navigate to `http://localhost:4200/`
165+
to build the demo, go to [angular/projects/demo](projects/demo/) and run `yarn` + `yarn upgrade` (ng18 seem to have introduced some conflicts) + `yarn start` and navigate to `http://localhost:4200/`
166166

167-
Code ship starting with v8.1.2+ in `dist/angular` for people to use directly and is an angular module! (source code under `dist/angular/src`)
167+
Code started shipping with v8.1.2+ in `dist/angular` for people to use directly and is an angular module! (source code under `dist/angular/src`)
168168

169169
## Caveats
170170

171171
- This wrapper needs:
172172
- gridstack v8 to run as it needs the latest changes (use older version that matches GS versions)
173-
- Angular 13+ for dynamic createComponent() API
173+
- Angular 14+ for dynamic `createComponent()` API
174174

175-
NOTE: if you are on Angular 12 or below: copy the wrapper code over (or patch it - see main page example) and change `createComponent()` calls to use old API instead:
175+
NOTE: if you are on Angular 13 or below: copy the wrapper code over (or patch it - see main page example) and change `createComponent()` calls to use old API instead:
176176
```ts
177177
protected resolver: ComponentFactoryResolver,
178178
...
179179
const factory = this.resolver.resolveComponentFactory(GridItemComponent);
180180
const gridItemRef = grid.container.createComponent(factory) as ComponentRef<GridItemComponent>;
181+
// ...do the same for widget selector...
181182
```
182183

183184
## ngFor Caveats

doc/CHANGES.md

Lines changed: 4 additions & 0 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+
- [11.0.0 (TBD)](#1100-tbd)
89
- [10.3.1 (2024-07-21)](#1031-2024-07-21)
910
- [10.3.0 (2024-06-26)](#1030-2024-06-26)
1011
- [10.2.1 (2024-06-23)](#1021-2024-06-23)
@@ -113,6 +114,9 @@ Change log
113114

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

117+
## 11.0.0 (TBD)
118+
* fix: [#2736](https://github.com/gridstack/gridstack.js/bug/2736) safe practices around GridStackWidget.content no longer setting innerHTML
119+
116120
## 10.3.1 (2024-07-21)
117121
* fix: [#2734](https://github.com/gridstack/gridstack.js/bug/2734) rotate() JS error
118122
* fix: [#2741](https://github.com/gridstack/gridstack.js/pull/2741) resizeToContent JS error with nested grid

doc/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ gridstack.js API
3333
- [`setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragInOpt, root = HTMLElement | Document)`](#setupdragindragin-string--htmlelement-draginoptions-dddraginopt-root--htmlelement--document)
3434
- [`GridStack.registerEngine(engineClass: typeof GridStackEngine)`](#gridstackregisterengineengineclass-typeof-gridstackengine)
3535
- [API](#api)
36-
- [`addWidget(el?: GridStackWidget | GridStackElement, options?: GridStackWidget)`](#addwidgetel-gridstackwidget--gridstackelement-options-gridstackwidget)
36+
- [`addWidget(w: GridStackWidget): GridItemHTMLElement`](#addwidgetw-gridstackwidget-griditemhtmlelement)
3737
- [`batchUpdate(flag = true)`](#batchupdateflag--true)
3838
- [`compact(layout: CompactOptions = 'compact', doSort = true)`](#compactlayout-compactoptions--compact-dosort--true)
3939
- [`cellHeight(val: number, update = true)`](#cellheightval-number-update--true)
@@ -355,23 +355,20 @@ but you will probably also want `helper: 'clone'` or your own callback function)
355355
* call to specify global custom engine subclass - see instead `GridStackOptions.engineClass` if you only need to replace just one instance.
356356
## API
357357

358-
### `addWidget(el?: GridStackWidget | GridStackElement, options?: GridStackWidget)`
358+
### `addWidget(w: GridStackWidget): GridItemHTMLElement`
359359

360-
Creates new widget and returns it. Options is an object containing the fields x,y,width,height,etc...
360+
Creates new widget and returns it.
361361

362362
Parameters:
363363

364-
- `el`: GridStackWidget | GridStackElement - html element, or string definition, or GridStackWidget (which can have content string as well) to add
365-
- `options`: GridStackWidget - widget position/size options (optional, and ignore if first param is already option) - see GridStackWidget
364+
- `w`: GridStackWidget - widget position/size options - see GridStackWidget
366365

367366
Widget will be always placed even if result height is more than actual grid height. You need to use `willItFit` method
368367
before calling `addWidget` for additional check.
369368

370369
```js
371370
let grid = GridStack.init();
372371
grid.addWidget({w: 3, content: 'hello'});
373-
// or
374-
grid.addWidget('<div class="grid-stack-item"><div class="grid-stack-item-content">hello</div></div>', {w: 3});
375372
```
376373

377374
### `batchUpdate(flag = true)`

0 commit comments

Comments
 (0)