vlist 0.1.3 → 1.5.5

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +558 -0
  3. package/dist/builder/a11y.d.ts +16 -0
  4. package/dist/builder/api.d.ts +21 -0
  5. package/dist/builder/context.d.ts +36 -0
  6. package/dist/builder/core.d.ts +16 -0
  7. package/dist/builder/data.d.ts +69 -0
  8. package/dist/builder/dom.d.ts +15 -0
  9. package/dist/builder/index.d.ts +25 -0
  10. package/dist/builder/materialize.d.ts +165 -0
  11. package/dist/builder/pool.d.ts +10 -0
  12. package/dist/builder/range.d.ts +10 -0
  13. package/dist/builder/scroll.d.ts +24 -0
  14. package/dist/builder/types.d.ts +464 -0
  15. package/dist/builder/velocity.d.ts +23 -0
  16. package/dist/constants.d.ts +58 -0
  17. package/dist/events/emitter.d.ts +18 -0
  18. package/dist/events/index.d.ts +6 -0
  19. package/dist/features/async/feature.d.ts +72 -0
  20. package/dist/features/async/index.d.ts +9 -0
  21. package/dist/features/async/manager.d.ts +103 -0
  22. package/dist/features/async/placeholder.d.ts +54 -0
  23. package/dist/features/async/sparse.d.ts +91 -0
  24. package/dist/features/autosize/feature.d.ts +34 -0
  25. package/dist/features/autosize/index.d.ts +2 -0
  26. package/dist/features/grid/feature.d.ts +48 -0
  27. package/dist/features/grid/index.d.ts +9 -0
  28. package/dist/features/grid/layout.d.ts +29 -0
  29. package/dist/features/grid/renderer.d.ts +71 -0
  30. package/dist/features/grid/types.d.ts +71 -0
  31. package/dist/features/groups/feature.d.ts +74 -0
  32. package/dist/features/groups/index.d.ts +10 -0
  33. package/dist/features/groups/layout.d.ts +47 -0
  34. package/dist/features/groups/sticky.d.ts +21 -0
  35. package/dist/features/groups/types.d.ts +86 -0
  36. package/dist/features/masonry/feature.d.ts +45 -0
  37. package/dist/features/masonry/index.d.ts +9 -0
  38. package/dist/features/masonry/layout.d.ts +29 -0
  39. package/dist/features/masonry/renderer.d.ts +55 -0
  40. package/dist/features/masonry/types.d.ts +68 -0
  41. package/dist/features/page/feature.d.ts +53 -0
  42. package/dist/features/page/index.d.ts +8 -0
  43. package/dist/features/scale/feature.d.ts +42 -0
  44. package/dist/features/scale/index.d.ts +10 -0
  45. package/dist/features/scrollbar/controller.d.ts +121 -0
  46. package/dist/features/scrollbar/feature.d.ts +60 -0
  47. package/dist/features/scrollbar/index.d.ts +8 -0
  48. package/dist/features/scrollbar/scrollbar.d.ts +73 -0
  49. package/dist/features/selection/feature.d.ts +75 -0
  50. package/dist/features/selection/index.d.ts +7 -0
  51. package/dist/features/selection/state.d.ts +115 -0
  52. package/dist/features/snapshots/feature.d.ts +79 -0
  53. package/dist/features/snapshots/index.d.ts +9 -0
  54. package/dist/features/table/feature.d.ts +67 -0
  55. package/dist/features/table/header.d.ts +49 -0
  56. package/dist/features/table/index.d.ts +10 -0
  57. package/dist/features/table/layout.d.ts +26 -0
  58. package/dist/features/table/renderer.d.ts +72 -0
  59. package/dist/features/table/types.d.ts +239 -0
  60. package/dist/index.d.ts +28 -0
  61. package/dist/index.js +1 -0
  62. package/dist/internals.d.ts +21 -0
  63. package/dist/internals.js +1 -0
  64. package/dist/rendering/index.d.ts +12 -0
  65. package/dist/rendering/measured.d.ts +52 -0
  66. package/dist/rendering/renderer.d.ts +111 -0
  67. package/dist/rendering/scale.d.ts +121 -0
  68. package/dist/rendering/scroll.d.ts +23 -0
  69. package/dist/rendering/sizes.d.ts +63 -0
  70. package/dist/rendering/sort.d.ts +33 -0
  71. package/dist/rendering/viewport.d.ts +139 -0
  72. package/dist/size.json +1 -0
  73. package/dist/types.d.ts +487 -0
  74. package/dist/utils/padding.d.ts +38 -0
  75. package/dist/utils/stats.d.ts +49 -0
  76. package/dist/vlist-extras.css +1 -0
  77. package/dist/vlist-grid.css +1 -0
  78. package/dist/vlist-masonry.css +1 -0
  79. package/dist/vlist-table.css +1 -0
  80. package/dist/vlist.css +1 -0
  81. package/package.json +66 -14
  82. package/README.MD +0 -80
  83. package/index.d.ts +0 -3
  84. package/index.js +0 -196
  85. package/virtual-scroll.component.d.ts +0 -34
  86. package/vlist.d.ts +0 -4
  87. package/vlist.metadata.json +0 -1
  88. package/vlist.umd.js +0 -197
package/vlist.umd.js DELETED
@@ -1,197 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/Observable'), require('rxjs/add/observable/of'), require('rxjs/add/observable/fromEvent'), require('rxjs/add/operator/debounceTime'), require('rxjs/add/operator/map'), require('rxjs/add/operator/retryWhen'), require('rxjs/add/operator/delay')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', 'rxjs/Observable', 'rxjs/add/observable/of', 'rxjs/add/observable/fromEvent', 'rxjs/add/operator/debounceTime', 'rxjs/add/operator/map', 'rxjs/add/operator/retryWhen', 'rxjs/add/operator/delay'], factory) :
4
- (factory((global.vlist = global.vlist || {}),global._angular_core,global._angular_common,global.rxjs_Observable));
5
- }(this, (function (exports,_angular_core,_angular_common,rxjs_Observable) { 'use strict';
6
-
7
- var VirtualScrollComponent = (function () {
8
- /**
9
- * @param {?} element
10
- */
11
- function VirtualScrollComponent(element) {
12
- this.element = element;
13
- this.items = [];
14
- this.update = new _angular_core.EventEmitter();
15
- this.itemHeight = 0;
16
- this.viewportPosition = 0;
17
- this.latestStartChunk = 0;
18
- this.latestEndChunk = 0;
19
- this.latestScrollTop = 0;
20
- this.ticking = false;
21
- }
22
- /**
23
- * @return {?}
24
- */
25
- VirtualScrollComponent.prototype.ngOnInit = function () {
26
- var _this = this;
27
- rxjs_Observable.Observable.fromEvent(window, 'resize').debounceTime(50).subscribe(function () { return _this.updateChunk(); });
28
- rxjs_Observable.Observable.of(this.viewportElementRef.nativeElement.getElementsByClassName('item')).map(function (items) {
29
- if (items.length == 0) {
30
- throw 'ex';
31
- }
32
- return items[0];
33
- }).retryWhen(function (errors) { return errors.delay(100); }).subscribe(function (item) {
34
- _this.itemHeight = item.getBoundingClientRect().height;
35
- _this.updateChunk();
36
- });
37
- };
38
- /**
39
- * @param {?} changes
40
- * @return {?}
41
- */
42
- VirtualScrollComponent.prototype.ngOnChanges = function (changes) {
43
- if (changes.items.currentValue.length > 0) {
44
- if (this.itemHeight == 0) {
45
- /** Render one item to get the item height. **/
46
- this.update.emit(this.items.slice(0, 1));
47
- }
48
- }
49
- /** Clear and update chunk. **/
50
- if (this.itemHeight > 0) {
51
- this.latestStartChunk = 0;
52
- this.latestEndChunk = 0;
53
- this.updateChunk();
54
- }
55
- };
56
- /**
57
- * @param {?} e
58
- * @return {?}
59
- */
60
- VirtualScrollComponent.prototype.onScroll = function (e) {
61
- var _this = this;
62
- this.latestScrollTop = this.getCurrentScrollTop();
63
- if (!this.ticking) {
64
- requestAnimationFrame(function () {
65
- _this.ticking = false;
66
- _this.updateChunk();
67
- _this.updateViewPort();
68
- });
69
- }
70
- this.ticking = true;
71
- };
72
- /**
73
- * @return {?}
74
- */
75
- VirtualScrollComponent.prototype.updateChunk = function () {
76
- if (this.latestStartChunk != this.startChunk() || this.latestEndChunk != this.endChunk()) {
77
- this.latestStartChunk = this.startChunk();
78
- this.latestEndChunk = this.endChunk();
79
- this.update.emit(this.items.slice(this.latestStartChunk, this.latestEndChunk));
80
- }
81
- };
82
- /**
83
- * @return {?}
84
- */
85
- VirtualScrollComponent.prototype.updateViewPort = function () {
86
- if (this.isBottom()) {
87
- this.viewportPosition = this.latestScrollTop - this.itemHeight;
88
- }
89
- else {
90
- this.viewportPosition = this.latestScrollTop;
91
- }
92
- };
93
- /**
94
- * @return {?}
95
- */
96
- VirtualScrollComponent.prototype.isBottom = function () {
97
- return this.getCurrentScrollHeight() - this.getCurrentScrollTop() === this.getCurrentHeight();
98
- };
99
- /**
100
- * @return {?}
101
- */
102
- VirtualScrollComponent.prototype.startChunk = function () {
103
- return Math.floor(this.getCurrentScrollTop() / this.itemHeight);
104
- };
105
- /**
106
- * @return {?}
107
- */
108
- VirtualScrollComponent.prototype.endChunk = function () {
109
- return this.startChunk() + this.totalPossibleItems();
110
- };
111
- /**
112
- * @return {?}
113
- */
114
- VirtualScrollComponent.prototype.getHeight = function () {
115
- return this.items.length * this.itemHeight;
116
- };
117
- /**
118
- * @return {?}
119
- */
120
- VirtualScrollComponent.prototype.getCurrentHeight = function () {
121
- return this.element.nativeElement.clientHeight;
122
- };
123
- /**
124
- * @return {?}
125
- */
126
- VirtualScrollComponent.prototype.getCurrentWidth = function () {
127
- return this.element.nativeElement.clientWidth;
128
- };
129
- /**
130
- * @return {?}
131
- */
132
- VirtualScrollComponent.prototype.getCurrentScrollHeight = function () {
133
- return this.element.nativeElement.scrollHeight;
134
- };
135
- /**
136
- * @return {?}
137
- */
138
- VirtualScrollComponent.prototype.getCurrentScrollTop = function () {
139
- return this.element.nativeElement.scrollTop;
140
- };
141
- /**
142
- * @return {?}
143
- */
144
- VirtualScrollComponent.prototype.totalPossibleItems = function () {
145
- return Math.round(this.getCurrentHeight() / this.itemHeight) + 1;
146
- };
147
- return VirtualScrollComponent;
148
- }());
149
- VirtualScrollComponent.decorators = [
150
- { type: _angular_core.Component, args: [{
151
- selector: 'virtual-scroll',
152
- template: "<div id=\"scrollport\" [style.height.px]=\"getHeight()\"></div> <div id=\"viewport\" #viewport [style.margin-top.px]=\"-getHeight()\" [style.transform]=\"'translateY(' + viewportPosition + 'px)'\"> <ng-content></ng-content> </div> ",
153
- styles: [":host { overflow: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; height: 100%; display: block; position: relative; } #scrollport { width: 1px; opacity: 0; } #viewport { position: absolute; width: 100%; } "]
154
- },] },
155
- ];
156
- /**
157
- * @nocollapse
158
- */
159
- VirtualScrollComponent.ctorParameters = function () { return [
160
- { type: _angular_core.ElementRef, },
161
- ]; };
162
- VirtualScrollComponent.propDecorators = {
163
- 'items': [{ type: _angular_core.Input },],
164
- 'update': [{ type: _angular_core.Output },],
165
- 'viewportElementRef': [{ type: _angular_core.ViewChild, args: ['viewport', { read: _angular_core.ElementRef },] },],
166
- 'onScroll': [{ type: _angular_core.HostListener, args: ['scroll',] },],
167
- };
168
-
169
- var VListModule = (function () {
170
- function VListModule() {
171
- }
172
- return VListModule;
173
- }());
174
- VListModule.decorators = [
175
- { type: _angular_core.NgModule, args: [{
176
- imports: [
177
- _angular_common.CommonModule
178
- ],
179
- declarations: [
180
- VirtualScrollComponent
181
- ],
182
- exports: [
183
- VirtualScrollComponent
184
- ]
185
- },] },
186
- ];
187
- /**
188
- * @nocollapse
189
- */
190
- VListModule.ctorParameters = function () { return []; };
191
-
192
- exports.VListModule = VListModule;
193
- exports.VirtualScrollComponent = VirtualScrollComponent;
194
-
195
- Object.defineProperty(exports, '__esModule', { value: true });
196
-
197
- })));