@egjs/ngx-infinitegrid 4.7.1-beta.0 → 4.8.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.
Files changed (31) hide show
  1. package/README.md +18 -12
  2. package/bundles/egjs-ngx-infinitegrid.umd.js +659 -0
  3. package/bundles/egjs-ngx-infinitegrid.umd.js.map +1 -0
  4. package/bundles/egjs-ngx-infinitegrid.umd.min.js +2 -0
  5. package/bundles/egjs-ngx-infinitegrid.umd.min.js.map +1 -0
  6. package/egjs-ngx-infinitegrid.d.ts +9 -0
  7. package/egjs-ngx-infinitegrid.metadata.json +1 -0
  8. package/esm2015/egjs-ngx-infinitegrid.js +10 -0
  9. package/esm2015/lib/consts.js +25 -0
  10. package/esm2015/lib/grids/ngx-frame-infinitegrid.component.js +19 -0
  11. package/esm2015/lib/grids/ngx-justified-infinitegrid.component.js +21 -0
  12. package/esm2015/lib/grids/ngx-masonry-infinitegrid.component.js +22 -0
  13. package/esm2015/lib/grids/ngx-packing-infinitegrid.component.js +20 -0
  14. package/esm2015/lib/ngx-infinitegrid.component.js +184 -0
  15. package/esm2015/lib/ngx-infinitegrid.interface.js +13 -0
  16. package/esm2015/lib/ngx-infinitegrid.module.js +31 -0
  17. package/esm2015/lib/types.js +2 -0
  18. package/esm2015/public-api.js +7 -0
  19. package/fesm2015/egjs-ngx-infinitegrid.js +316 -0
  20. package/fesm2015/egjs-ngx-infinitegrid.js.map +1 -0
  21. package/lib/consts.d.ts +1 -0
  22. package/lib/grids/ngx-frame-infinitegrid.component.d.ts +8 -0
  23. package/lib/grids/ngx-justified-infinitegrid.component.d.ts +10 -0
  24. package/lib/grids/ngx-masonry-infinitegrid.component.d.ts +11 -0
  25. package/lib/grids/ngx-packing-infinitegrid.component.d.ts +9 -0
  26. package/lib/ngx-infinitegrid.component.d.ts +67 -0
  27. package/lib/ngx-infinitegrid.interface.d.ts +12 -0
  28. package/lib/ngx-infinitegrid.module.d.ts +2 -0
  29. package/lib/types.d.ts +19 -0
  30. package/package.json +14 -13
  31. package/public-api.d.ts +3 -0
package/README.md CHANGED
@@ -33,7 +33,9 @@
33
33
 
34
34
  ## ⚙️ Installation
35
35
  ```sh
36
- npm install --save @egjs/ngx-infinitegrid
36
+ npm install @egjs/ngx-infinitegrid
37
+ # Or if you're using yarn
38
+ yarn add @egjs/ngx-infinitegrid
37
39
  ```
38
40
 
39
41
  ## 🏃 Quick Start
@@ -54,22 +56,25 @@ import { NgModule } from '@angular/core';
54
56
  providers: [],
55
57
  bootstrap: [AppComponent]
56
58
  })
57
- export class AppModule { } /* Your app */
59
+ export class AppModule {} /* Your app */
58
60
  ```
59
61
 
60
62
  ```html
61
- <div NgxMasonryInfiniteGrid
63
+ <div
64
+ NgxMasonryInfiniteGrid
62
65
  class="container"
63
66
  [gap]="5"
64
67
  [items]="items"
65
68
  [trackBy]="trackBy"
66
69
  [groupBy]="groupBy"
67
70
  (requestAppend)="onRequestAppend($event)"
68
- *ngFor="let item of [0]; trackBy: randomTrackBy;"
71
+ *ngFor="let item of [0]; trackBy: randomTrackBy"
69
72
  #ig
70
- >
71
- <div class="item" *ngFor ="let item of ig.visibleItems; trackBy: trackBy;">
72
- </div>
73
+ >
74
+ <div
75
+ class="item"
76
+ *ngFor="let item of ig.visibleItems; trackBy: trackBy;"
77
+ ></div>
73
78
  </div>
74
79
  ```
75
80
 
@@ -79,10 +84,11 @@ import { OnRequestAppend } from '@egjs/infinitegrid';
79
84
 
80
85
  @Component({
81
86
  selector: 'app-root',
82
- templateUrl: './app.component.html',
87
+ templateUrl: './app.component.html'
83
88
  })
84
89
  export class AppComponent {
85
90
  items = this.getItems(0, 10);
91
+
86
92
  getItems(nextGroupKey: number, count: number) {
87
93
  const nextItems = [];
88
94
  const nextKey = nextGroupKey * count;
@@ -92,19 +98,19 @@ export class AppComponent {
92
98
  }
93
99
  return nextItems;
94
100
  }
101
+
95
102
  groupBy(_: any, item: any) {
96
103
  return item.groupKey;
97
104
  }
105
+
98
106
  trackBy(_: any, item: any) {
99
107
  return item.key;
100
108
  }
109
+
101
110
  onRequestAppend(e: OnRequestAppend) {
102
111
  const nextGroupKey = (+e.groupKey! || 0) + 1;
103
112
 
104
- this.items = [
105
- ...this.items,
106
- ...this.getItems(nextGroupKey, 10),
107
- ];
113
+ this.items = [...this.items, ...this.getItems(nextGroupKey, 10)];
108
114
  }
109
115
  }
110
116
  ```