-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from dhilt/issue-236-Access-to-min-max-Buffer…
…-indexes Access to Buffer indexes data via Adapter
- Loading branch information
Showing
34 changed files
with
364 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<app-demo | ||
[datasource]="datasource" | ||
[context]="demoContext" | ||
[sources]="sources" | ||
> | ||
<div actions> | ||
firstIndex: {{datasource.adapter.bufferInfo.firstIndex}} / | ||
lastIndex: {{datasource.adapter.bufferInfo.lastIndex}}<br> | ||
minIndex: {{datasource.adapter.bufferInfo.minIndex}} / | ||
maxIndex: {{datasource.adapter.bufferInfo.maxIndex}}<br> | ||
</div> | ||
<div description> | ||
<p> | ||
<em>Adapter.bufferInfo</em> is a read-only property which exposes | ||
an object of the following type: | ||
</p> | ||
<pre>{{bufferInfoType}}</pre> | ||
<p> | ||
<em>firstIndex</em> & <em>lastIndex</em> | ||
are the first and the last indexes in the current Buffer, | ||
<em>minIndex</em> & <em>maxIndex</em> are min and max indexes that were present in the Buffer, | ||
<em>absMinIndex</em> & <em>absMaxIndex</em> are min and max indexes that can be present in the Buffer. | ||
</p> | ||
</div> | ||
</app-demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { demos } from '../../routes'; | ||
import { DemoContext, DemoSources, DemoSourceType } from '../../shared/interfaces'; | ||
import { datasourceGetCallbackInfinite } from '../../shared/datasource-get'; | ||
|
||
import { Datasource } from '../../../../public_api'; // from 'ngx-ui-scroll'; | ||
|
||
@Component({ | ||
selector: 'app-demo-buffer-info', | ||
templateUrl: './buffer-info.component.html' | ||
}) | ||
export class DemoBufferInfoComponent { | ||
|
||
demoContext: DemoContext = { | ||
config: demos.adapter.map.bufferInfo, | ||
viewportId: `buffer-info-viewport`, | ||
count: 0, | ||
log: '' | ||
}; | ||
|
||
datasource = new Datasource({ | ||
get: datasourceGetCallbackInfinite(this.demoContext) | ||
}); | ||
|
||
sources: DemoSources = [{ | ||
name: DemoSourceType.Component, | ||
text: `datasource = new Datasource ({ | ||
get: (index, count, success) => { | ||
const data = []; | ||
for (let i = index; i <= index + count - 1; i++) { | ||
data.push({ id: i, text: 'item #' + i }); | ||
} | ||
success(data); | ||
} | ||
});` | ||
}, { | ||
active: true, | ||
name: DemoSourceType.Template, | ||
text: `firstIndex: {{datasource.adapter.bufferInfo.firstIndex}} / | ||
lastIndex: {{datasource.adapter.bufferInfo.lastIndex}} <br> | ||
minIndex: {{datasource.adapter.bufferInfo.minIndex}} / | ||
maxIndex: {{datasource.adapter.bufferInfo.maxIndex}} <br> | ||
<div class="viewport"> | ||
<div *uiScroll="let item of datasource"> | ||
<div class="item">{{item.text}}</div> | ||
</div> | ||
</div>` | ||
}, { | ||
name: DemoSourceType.Styles, | ||
text: `.viewport { | ||
width: 150px; | ||
height: 250px; | ||
overflow-y: auto; | ||
} | ||
.item { | ||
font-weight: bold; | ||
height: 25px; | ||
}` | ||
}]; | ||
|
||
bufferInfoType = `interface IBufferInfo { | ||
firstIndex: number; | ||
lastIndex: number; | ||
minIndex: number; | ||
maxIndex: number; | ||
absMinIndex: number; | ||
absMaxIndex: number; | ||
}`; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.