Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements: Docs #7

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/pull_request.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Pull_Request_Validation
name: Build

on:
pull_request:
branches: [ "main" ]
push:
branches:
- 'main'

workflow_dispatch:

Expand All @@ -13,7 +14,7 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -22,23 +23,21 @@ jobs:

- name: Install Dependencies
run: npm ci

- name: Build Library
run: npm run lib:build

- name: Test Library
run: npm run ci:test-lib
verify-changelog:
name: Verify Changelog
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Changelog Reader
uses: mindsers/[email protected]
with:
# Path to the CHANGELOG file containing the log entries
path: ./projects/zeiss-id-library/CHANGELOG.md
path: ./projects/ng-infinite-scroll/CHANGELOG.md
# Specifies if the CHANGELOG.md file should be validated and the behavior of the action
validation_level: error
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,50 @@

![DALL-E Prompt: Angular Infinity Scroll](/docs/images/header.png)

Content will be added: To be defined as soon as we release the first version
This library provides a directive to implement infinite scrolling in Angular applications. The directive listens to the scroll event and emits an event when the user is near the end of the scrollable container.

## Basic Usage

Usage of directive and components need to be documented here.
1. Install the package from the registry. Make sure you have added the Github PlanB. registry to your `.npmrc` file.

```bash
npm install @planbgmbh/ng-infinity-scroll
```

2. Import the directive into your application / component where you want to use it.

```typescript
import { NgScrollObserverDirective } from '@planbgmbh/ng-infinite-scroll';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, NgScrollObserverDirective],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
```

3. Use the directive inside your template.

```html
<div
ngScrollObserver
[scrollIndex]="$index"
[scrollItemCount]="visibleItems().length"
(scrollNearEnd)="loadMoreItems()"
class="scroll-item"
>
Item {{ item }}
</div>
```

## Supported Angular Version

We currently support every Angular Version with a minimum requirement of Angular 17.0.0.

| Package Version | Supported Angular Version |
| --------------- | ------------------------- |
| 1.x | 17, 18 |

## Credits

Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 1 addition & 92 deletions projects/ng-infinite-scroll-demo/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,98 +45,7 @@ <h1>Hello, {{ title }}</h1>
<p>Congratulations! Your app is running. 🎉</p>
</div>
<div class="divider" role="separator" aria-label="Divider"></div>
<div class="right-side">
<!-- <div class="pill-group">
@for (item of [
{ title: 'Explore the Docs', link: 'https://angular.dev' },
{ title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' },
{ title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
{ title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' },
{ title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' },
]; track item.title) {
<a
class="pill"
[href]="item.link"
target="_blank"
rel="noopener"
>
<span>{{ item.title }}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
height="14"
viewBox="0 -960 960 960"
width="14"
fill="currentColor"
>
<path
d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"
/>
</svg>
</a>
}
</div>
<div class="social-links">
<a
href="https://github.com/angular/angular"
aria-label="Github"
target="_blank"
rel="noopener"
>
<svg
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Github"
>
<path
d="M12.3047 0C5.50634 0 0 5.50942 0 12.3047C0 17.7423 3.52529 22.3535 8.41332 23.9787C9.02856 24.0946 9.25414 23.7142 9.25414 23.3871C9.25414 23.0949 9.24389 22.3207 9.23876 21.2953C5.81601 22.0377 5.09414 19.6444 5.09414 19.6444C4.53427 18.2243 3.72524 17.8449 3.72524 17.8449C2.61064 17.082 3.81137 17.0973 3.81137 17.0973C5.04697 17.1835 5.69604 18.3647 5.69604 18.3647C6.79321 20.2463 8.57636 19.7029 9.27978 19.3881C9.39052 18.5924 9.70736 18.0499 10.0591 17.7423C7.32641 17.4347 4.45429 16.3765 4.45429 11.6618C4.45429 10.3185 4.9311 9.22133 5.72065 8.36C5.58222 8.04931 5.16694 6.79833 5.82831 5.10337C5.82831 5.10337 6.85883 4.77319 9.2121 6.36459C10.1965 6.09082 11.2424 5.95546 12.2883 5.94931C13.3342 5.95546 14.3801 6.09082 15.3644 6.36459C17.7023 4.77319 18.7328 5.10337 18.7328 5.10337C19.3942 6.79833 18.9789 8.04931 18.8559 8.36C19.6403 9.22133 20.1171 10.3185 20.1171 11.6618C20.1171 16.3888 17.2409 17.4296 14.5031 17.7321C14.9338 18.1012 15.3337 18.8559 15.3337 20.0084C15.3337 21.6552 15.3183 22.978 15.3183 23.3779C15.3183 23.7009 15.5336 24.0854 16.1642 23.9623C21.0871 22.3484 24.6094 17.7341 24.6094 12.3047C24.6094 5.50942 19.0999 0 12.3047 0Z"
/>
</svg>
</a>
<a
href="https://twitter.com/angular"
aria-label="Twitter"
target="_blank"
rel="noopener"
>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Twitter"
>
<path
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
/>
</svg>
</a>
<a
href="https://www.youtube.com/channel/UCbn1OgGei-DV7aSRo_HaAiw"
aria-label="Youtube"
target="_blank"
rel="noopener"
>
<svg
width="29"
height="20"
viewBox="0 0 29 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Youtube"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M27.4896 1.52422C27.9301 1.96749 28.2463 2.51866 28.4068 3.12258C29.0004 5.35161 29.0004 10 29.0004 10C29.0004 10 29.0004 14.6484 28.4068 16.8774C28.2463 17.4813 27.9301 18.0325 27.4896 18.4758C27.0492 18.9191 26.5 19.2389 25.8972 19.4032C23.6778 20 14.8068 20 14.8068 20C14.8068 20 5.93586 20 3.71651 19.4032C3.11363 19.2389 2.56449 18.9191 2.12405 18.4758C1.68361 18.0325 1.36732 17.4813 1.20683 16.8774C0.613281 14.6484 0.613281 10 0.613281 10C0.613281 10 0.613281 5.35161 1.20683 3.12258C1.36732 2.51866 1.68361 1.96749 2.12405 1.52422C2.56449 1.08095 3.11363 0.76113 3.71651 0.596774C5.93586 0 14.8068 0 14.8068 0C14.8068 0 23.6778 0 25.8972 0.596774C26.5 0.76113 27.0492 1.08095 27.4896 1.52422ZM19.3229 10L11.9036 5.77905V14.221L19.3229 10Z"
/>
</svg>
</a>
</div> -->
</div>
<div class="right-side"></div>
</div>
</main>

Expand Down
7 changes: 2 additions & 5 deletions projects/ng-infinite-scroll/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0]
## [1.0.0] - 2024-07-08

### Added

- ci: basic setup for CI
- chore: setup for Github and PRs
- chore: basic library setup
- feat: providing infinite scroll directive
- Initial release and implementation of infinite scroll directive
2 changes: 1 addition & 1 deletion projects/ng-infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@planbgmbh/ng-infinite-scroll",
"version": "0.0.0",
"version": "1.0.0",
"author": {
"name": "Aaron Czichon, PlanB. GmbH",
"email": "[email protected]"
Expand Down
Loading