vlist 0.1.2 → 1.5.4

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 -188
  85. package/virtual-scroll.component.d.ts +0 -37
  86. package/vlist.d.ts +0 -4
  87. package/vlist.metadata.json +0 -1
  88. package/vlist.umd.js +0 -189
package/vlist.umd.js DELETED
@@ -1,189 +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.of(this.viewportElementRef.nativeElement.getElementsByClassName('item')).map(function (items) {
28
- if (items.length == 0) {
29
- throw 'ex';
30
- }
31
- return items[0];
32
- }).retryWhen(function (errors) { return errors.delay(100); }).subscribe(function (item) {
33
- _this.itemHeight = item.getBoundingClientRect().height;
34
- _this.updateChunk();
35
- });
36
- rxjs_Observable.Observable.fromEvent(window, 'resize').debounceTime(50).subscribe(function () { return _this.updateChunk(); });
37
- };
38
- /**
39
- * Render one item to get the item height.
40
- * @param {?} changes
41
- * @return {?}
42
- */
43
- VirtualScrollComponent.prototype.ngOnChanges = function (changes) {
44
- if (changes.items.currentValue.length > 0) {
45
- this.update.emit(this.items.slice(0, 1));
46
- }
47
- };
48
- /**
49
- * @param {?} e
50
- * @return {?}
51
- */
52
- VirtualScrollComponent.prototype.onScroll = function (e) {
53
- var _this = this;
54
- this.latestScrollTop = this.getCurrentScrollTop();
55
- if (!this.ticking) {
56
- requestAnimationFrame(function () {
57
- _this.ticking = false;
58
- _this.updateChunk();
59
- _this.updateViewPort();
60
- });
61
- }
62
- this.ticking = true;
63
- };
64
- /**
65
- * @return {?}
66
- */
67
- VirtualScrollComponent.prototype.updateChunk = function () {
68
- if (this.latestStartChunk != this.startChunk() || this.latestEndChunk != this.endChunk()) {
69
- this.latestStartChunk = this.startChunk();
70
- this.latestEndChunk = this.endChunk();
71
- this.update.emit(this.items.slice(this.latestStartChunk, this.latestEndChunk));
72
- }
73
- };
74
- /**
75
- * @return {?}
76
- */
77
- VirtualScrollComponent.prototype.updateViewPort = function () {
78
- if (this.isBottom()) {
79
- this.viewportPosition = this.latestScrollTop - this.itemHeight;
80
- }
81
- else {
82
- this.viewportPosition = this.latestScrollTop;
83
- }
84
- };
85
- /**
86
- * @return {?}
87
- */
88
- VirtualScrollComponent.prototype.isBottom = function () {
89
- return this.getCurrentScrollHeight() - this.getCurrentScrollTop() === this.getCurrentHeight();
90
- };
91
- /**
92
- * @return {?}
93
- */
94
- VirtualScrollComponent.prototype.startChunk = function () {
95
- return Math.floor(this.getCurrentScrollTop() / this.itemHeight);
96
- };
97
- /**
98
- * @return {?}
99
- */
100
- VirtualScrollComponent.prototype.endChunk = function () {
101
- return this.startChunk() + this.totalPossibleItems();
102
- };
103
- /**
104
- * @return {?}
105
- */
106
- VirtualScrollComponent.prototype.getHeight = function () {
107
- return this.items.length * this.itemHeight;
108
- };
109
- /**
110
- * @return {?}
111
- */
112
- VirtualScrollComponent.prototype.getCurrentHeight = function () {
113
- return this.element.nativeElement.clientHeight;
114
- };
115
- /**
116
- * @return {?}
117
- */
118
- VirtualScrollComponent.prototype.getCurrentWidth = function () {
119
- return this.element.nativeElement.clientWidth;
120
- };
121
- /**
122
- * @return {?}
123
- */
124
- VirtualScrollComponent.prototype.getCurrentScrollHeight = function () {
125
- return this.element.nativeElement.scrollHeight;
126
- };
127
- /**
128
- * @return {?}
129
- */
130
- VirtualScrollComponent.prototype.getCurrentScrollTop = function () {
131
- return this.element.nativeElement.scrollTop;
132
- };
133
- /**
134
- * @return {?}
135
- */
136
- VirtualScrollComponent.prototype.totalPossibleItems = function () {
137
- return Math.round(this.getCurrentHeight() / this.itemHeight) + 1;
138
- };
139
- return VirtualScrollComponent;
140
- }());
141
- VirtualScrollComponent.decorators = [
142
- { type: _angular_core.Component, args: [{
143
- selector: 'virtual-scroll',
144
- 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> ",
145
- 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%; } "]
146
- },] },
147
- ];
148
- /**
149
- * @nocollapse
150
- */
151
- VirtualScrollComponent.ctorParameters = function () { return [
152
- { type: _angular_core.ElementRef, },
153
- ]; };
154
- VirtualScrollComponent.propDecorators = {
155
- 'items': [{ type: _angular_core.Input },],
156
- 'update': [{ type: _angular_core.Output },],
157
- 'viewportElementRef': [{ type: _angular_core.ViewChild, args: ['viewport', { read: _angular_core.ElementRef },] },],
158
- 'onScroll': [{ type: _angular_core.HostListener, args: ['scroll',] },],
159
- };
160
-
161
- var VListModule = (function () {
162
- function VListModule() {
163
- }
164
- return VListModule;
165
- }());
166
- VListModule.decorators = [
167
- { type: _angular_core.NgModule, args: [{
168
- imports: [
169
- _angular_common.CommonModule
170
- ],
171
- declarations: [
172
- VirtualScrollComponent
173
- ],
174
- exports: [
175
- VirtualScrollComponent
176
- ]
177
- },] },
178
- ];
179
- /**
180
- * @nocollapse
181
- */
182
- VListModule.ctorParameters = function () { return []; };
183
-
184
- exports.VListModule = VListModule;
185
- exports.VirtualScrollComponent = VirtualScrollComponent;
186
-
187
- Object.defineProperty(exports, '__esModule', { value: true });
188
-
189
- })));