angular-overflow-indicator 19.0.5 → 20.0.1
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.
- package/README.md +73 -70
- package/fesm2022/angular-overflow-indicator.mjs +17 -17
- package/fesm2022/angular-overflow-indicator.mjs.map +1 -1
- package/index.d.ts +29 -1
- package/package.json +3 -3
- package/lib/default-indicator-button/default-indicator-button.component.d.ts +0 -6
- package/lib/default-indicator-button/index.d.ts +0 -1
- package/lib/scroll-view-with-indicator/index.d.ts +0 -1
- package/lib/scroll-view-with-indicator/scroll-view-with-indicator.component.d.ts +0 -26
package/README.md
CHANGED
|
@@ -1,70 +1,73 @@
|
|
|
1
|
-
# angular-overflow-indicator
|
|
2
|
-
|
|
3
|
-
This library includes a simple and performant component that displays a given button if the content of the component overflows.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
### Button that displays/hides accordingly
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
### Observe the scroll state
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Basic Usage
|
|
17
|
-
|
|
18
|
-
**Step 1: Install the package**
|
|
19
|
-
|
|
20
|
-
```console
|
|
21
|
-
yarn add angular-overflow-indicator
|
|
22
|
-
```
|
|
23
|
-
or
|
|
24
|
-
```console
|
|
25
|
-
npm install angular-overflow-indicator
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Step 2: Install the package**
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
import { ScrollViewWithIndicatorComponent } from 'angular-overflow-indicator';
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Step 3: Create a container with a maximum/fixed size**
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<div [style]="{ height: '300px', width: '500px' }">
|
|
38
|
-
// ...
|
|
39
|
-
</div>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Step 4: Add a template that includes the indicator-button**
|
|
43
|
-
|
|
44
|
-
```html
|
|
45
|
-
<div [style]="{ height: '300px', width: '500px' }">
|
|
46
|
-
<ng-template #customButton>
|
|
47
|
-
<button (click)="view.scrollToBottom()">There is more below <i>👇</i></button>
|
|
48
|
-
</ng-template>
|
|
49
|
-
|
|
50
|
-
// ...
|
|
51
|
-
</div>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Step 5: Add the overflow-indicator-component with a list larger than the outer container and pass the template reference of the indicator-button**
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
# angular-overflow-indicator
|
|
2
|
+
|
|
3
|
+
This library includes a simple and performant component that displays a given button if the content of the component overflows.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Button that displays/hides accordingly
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
### Observe the scroll state
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Basic Usage
|
|
17
|
+
|
|
18
|
+
**Step 1: Install the package**
|
|
19
|
+
|
|
20
|
+
```console
|
|
21
|
+
yarn add angular-overflow-indicator
|
|
22
|
+
```
|
|
23
|
+
or
|
|
24
|
+
```console
|
|
25
|
+
npm install angular-overflow-indicator
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Step 2: Install the package**
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { ScrollViewWithIndicatorComponent } from 'angular-overflow-indicator';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Step 3: Create a container with a maximum/fixed size**
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<div [style]="{ height: '300px', width: '500px' }">
|
|
38
|
+
// ...
|
|
39
|
+
</div>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Step 4: Add a template that includes the indicator-button**
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<div [style]="{ height: '300px', width: '500px' }">
|
|
46
|
+
<ng-template #customButton>
|
|
47
|
+
<button (click)="view.scrollToBottom()">There is more below <i>👇</i></button>
|
|
48
|
+
</ng-template>
|
|
49
|
+
|
|
50
|
+
// ...
|
|
51
|
+
</div>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Step 5: Add the overflow-indicator-component with a list larger than the outer container and pass the template reference of the indicator-button**
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
|
|
58
|
+
<div [style]="{ height: '300px', width: '500px' }">
|
|
59
|
+
<ng-template #customButton>
|
|
60
|
+
<button (click)="view.scrollToBottom()">There is more below <i>👇</i></button>
|
|
61
|
+
</ng-template>
|
|
62
|
+
|
|
63
|
+
<ng-scroll-view-with-indicator #view [indicatorButton]="customButton">
|
|
64
|
+
<ul>
|
|
65
|
+
@for (item of items(); track item) {
|
|
66
|
+
<li>List item {{ item }}</li>
|
|
67
|
+
}
|
|
68
|
+
</ul>
|
|
69
|
+
</ng-scroll-view-with-indicator>
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
@@ -7,28 +7,28 @@ class DefaultIndicatorButtonComponent {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.buttonClicked = output();
|
|
9
9
|
}
|
|
10
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
11
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
12
|
-
<button class="default-button" (click)="buttonClicked.emit()">
|
|
13
|
-
<span>There is more content</span>
|
|
14
|
-
</button>
|
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DefaultIndicatorButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: DefaultIndicatorButtonComponent, isStandalone: true, selector: "ng-scroll-view-default-indicator-button", outputs: { buttonClicked: "buttonClicked" }, ngImport: i0, template: `
|
|
12
|
+
<button class="default-button" (click)="buttonClicked.emit()">
|
|
13
|
+
<span>There is more content</span>
|
|
14
|
+
</button>
|
|
15
15
|
`, isInline: true, styles: ["button{border:none;font-size:.8rem;font-weight:500;padding:.4rem .6rem;background-color:#444;color:#fff;border-radius:1rem;margin-bottom:.4rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DefaultIndicatorButtonComponent, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
|
-
args: [{ selector: 'ng-scroll-view-default-indicator-button', template: `
|
|
20
|
-
<button class="default-button" (click)="buttonClicked.emit()">
|
|
21
|
-
<span>There is more content</span>
|
|
22
|
-
</button>
|
|
19
|
+
args: [{ selector: 'ng-scroll-view-default-indicator-button', template: `
|
|
20
|
+
<button class="default-button" (click)="buttonClicked.emit()">
|
|
21
|
+
<span>There is more content</span>
|
|
22
|
+
</button>
|
|
23
23
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["button{border:none;font-size:.8rem;font-weight:500;padding:.4rem .6rem;background-color:#444;color:#fff;border-radius:1rem;margin-bottom:.4rem}\n"] }]
|
|
24
24
|
}] });
|
|
25
25
|
|
|
26
26
|
class ScrollViewWithIndicatorComponent {
|
|
27
27
|
constructor() {
|
|
28
28
|
this.scrollState = output();
|
|
29
|
-
this.indicatorButton = input.required();
|
|
30
|
-
this.isOverflowing = signal(false);
|
|
31
|
-
this.isAtBottom = signal(false);
|
|
29
|
+
this.indicatorButton = input.required(...(ngDevMode ? [{ debugName: "indicatorButton" }] : []));
|
|
30
|
+
this.isOverflowing = signal(false, ...(ngDevMode ? [{ debugName: "isOverflowing" }] : []));
|
|
31
|
+
this.isAtBottom = signal(false, ...(ngDevMode ? [{ debugName: "isAtBottom" }] : []));
|
|
32
32
|
this.cdr = inject(ChangeDetectorRef);
|
|
33
33
|
this.resizeObserver = null;
|
|
34
34
|
}
|
|
@@ -67,12 +67,12 @@ class ScrollViewWithIndicatorComponent {
|
|
|
67
67
|
this.isAtBottom.set(element.scrollTop + 1 >= maxScroll);
|
|
68
68
|
this.scrollState.emit(Math.round((100 / maxScroll) * (element.scrollTop + 1)));
|
|
69
69
|
}
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
71
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ScrollViewWithIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ScrollViewWithIndicatorComponent, isStandalone: true, selector: "ng-scroll-view-with-indicator", inputs: { indicatorButton: { classPropertyName: "indicatorButton", publicName: "indicatorButton", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { scrollState: "scrollState" }, viewQueries: [{ propertyName: "contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true }], ngImport: i0, template: "<div class=\"content-wrapper\" #contentWrapper (scroll)=\"onScroll()\">\n <ng-content />\n</div>\n\n@if (isOverflowing() && !isAtBottom()) {\n <div class=\"scroll-indicator\">\n @if (indicatorButton()) {\n <ng-container [ngTemplateOutlet]=\"indicatorButton()\" />\n } @else {\n <ng-scroll-view-default-indicator-button (buttonClicked)=\"scrollToBottom()\" />\n }\n </div>\n}\n", styles: [":host{height:100%;max-height:100%;position:relative;min-height:0;display:flex}.content-wrapper{flex:1;max-height:100%;min-height:0;overflow-y:auto;box-sizing:border-box}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DefaultIndicatorButtonComponent, selector: "ng-scroll-view-default-indicator-button", outputs: ["buttonClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
72
72
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ScrollViewWithIndicatorComponent, decorators: [{
|
|
74
74
|
type: Component,
|
|
75
|
-
args: [{ selector: 'ng-scroll-view-with-indicator', imports: [CommonModule, DefaultIndicatorButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"content-wrapper\" #contentWrapper (scroll)=\"onScroll()\">\
|
|
75
|
+
args: [{ selector: 'ng-scroll-view-with-indicator', imports: [CommonModule, DefaultIndicatorButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"content-wrapper\" #contentWrapper (scroll)=\"onScroll()\">\n <ng-content />\n</div>\n\n@if (isOverflowing() && !isAtBottom()) {\n <div class=\"scroll-indicator\">\n @if (indicatorButton()) {\n <ng-container [ngTemplateOutlet]=\"indicatorButton()\" />\n } @else {\n <ng-scroll-view-default-indicator-button (buttonClicked)=\"scrollToBottom()\" />\n }\n </div>\n}\n", styles: [":host{height:100%;max-height:100%;position:relative;min-height:0;display:flex}.content-wrapper{flex:1;max-height:100%;min-height:0;overflow-y:auto;box-sizing:border-box}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:center}\n"] }]
|
|
76
76
|
}], propDecorators: { contentWrapper: [{
|
|
77
77
|
type: ViewChild,
|
|
78
78
|
args: ['contentWrapper']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-overflow-indicator.mjs","sources":["../../../../libs/angular-overflow-indicator/src/lib/default-indicator-button/default-indicator-button.component.ts","../../../../libs/angular-overflow-indicator/src/lib/scroll-view-with-indicator/scroll-view-with-indicator.component.ts","../../../../libs/angular-overflow-indicator/src/lib/scroll-view-with-indicator/scroll-view-with-indicator.component.html","../../../../libs/angular-overflow-indicator/src/angular-overflow-indicator.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, output } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ng-scroll-view-default-indicator-button',\r\n template: `\r\n <button class=\"default-button\" (click)=\"buttonClicked.emit()\">\r\n <span>There is more content</span>\r\n </button>\r\n `,\r\n styles: `\r\n button {\r\n border: none;\r\n font-size: 0.8rem;\r\n font-weight: 500;\r\n padding: 0.4rem 0.6rem;\r\n background-color: #444444;\r\n color: #ffffff;\r\n border-radius: 1rem;\r\n margin-bottom: 0.4rem;\r\n }\r\n `,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class DefaultIndicatorButtonComponent {\r\n buttonClicked = output();\r\n}\r\n","import {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n inject,\r\n input,\r\n OnDestroy,\r\n output,\r\n signal,\r\n TemplateRef,\r\n ViewChild\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { DefaultIndicatorButtonComponent } from '../default-indicator-button';\r\n\r\n@Component({\r\n selector: 'ng-scroll-view-with-indicator',\r\n templateUrl: './scroll-view-with-indicator.component.html',\r\n styleUrls: ['./scroll-view-with-indicator.component.css'],\r\n imports: [CommonModule, DefaultIndicatorButtonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ScrollViewWithIndicatorComponent implements AfterViewInit, OnDestroy {\r\n @ViewChild('contentWrapper') contentWrapper!: ElementRef<HTMLDivElement>;\r\n scrollState = output<number>();\r\n\r\n readonly indicatorButton = input.required<TemplateRef<unknown>>();\r\n readonly isOverflowing = signal(false);\r\n readonly isAtBottom = signal(false);\r\n\r\n private readonly cdr = inject(ChangeDetectorRef);\r\n private resizeObserver: ResizeObserver | null = null;\r\n\r\n ngAfterViewInit(): void {\r\n this.resizeObserver = new ResizeObserver(() => {\r\n this.updateOverflowState();\r\n this.updateScrollState();\r\n this.cdr.detectChanges();\r\n });\r\n\r\n this.resizeObserver.observe(this.contentWrapper.nativeElement);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.resizeObserver?.disconnect();\r\n }\r\n\r\n /**\r\n * Manually scrolls the content-container to the bottom\r\n */\r\n scrollToBottom(): void {\r\n this.contentWrapper.nativeElement.scrollTop = this.contentWrapper.nativeElement.scrollHeight;\r\n }\r\n\r\n /**\r\n * If the user scrolled all the way to the end of the container,\r\n * the indicator button can be hidden\r\n */\r\n onScroll(): void {\r\n this.updateScrollState();\r\n }\r\n\r\n private updateOverflowState(): void {\r\n const element = this.contentWrapper.nativeElement;\r\n const maxScroll = element.scrollHeight - element.offsetHeight;\r\n this.isOverflowing.set(element.offsetHeight < element.scrollHeight && element.scrollTop < maxScroll);\r\n }\r\n\r\n private updateScrollState(): void {\r\n const element = this.contentWrapper.nativeElement;\r\n const maxScroll = element.scrollHeight - element.offsetHeight;\r\n this.isAtBottom.set(element.scrollTop + 1 >= maxScroll);\r\n this.scrollState.emit(Math.round((100 / maxScroll) * (element.scrollTop + 1)));\r\n }\r\n}\r\n","<div class=\"content-wrapper\" #contentWrapper (scroll)=\"onScroll()\">\r\n <ng-content />\r\n</div>\r\n\r\n<div class=\"scroll-indicator\" *ngIf=\"isOverflowing() && !isAtBottom()\">\r\n <ng-container *ngIf=\"indicatorButton(); else defaultButton\" [ngTemplateOutlet]=\"indicatorButton()\" />\r\n\r\n <ng-template #defaultButton>\r\n <ng-scroll-view-default-indicator-button (buttonClicked)=\"scrollToBottom()\" />\r\n </ng-template>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAuBa,+BAA+B,CAAA;AArB5C,IAAA,WAAA,GAAA;QAsBE,IAAa,CAAA,aAAA,GAAG,MAAM,EAAE;AACzB;8GAFY,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA/B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,+BAA+B,EAnBhC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yCAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mJAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAeU,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBArB3C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yCAAyC,EACzC,QAAA,EAAA,CAAA;;;;GAIT,EAagB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,mJAAA,CAAA,EAAA;;;MCGpC,gCAAgC,CAAA;AAP7C,IAAA,WAAA,GAAA;QASE,IAAW,CAAA,WAAA,GAAG,MAAM,EAAU;AAErB,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,QAAQ,EAAwB;AACxD,QA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A,UAAA,EAAA,CAAA;kBAP5C,SAAS;+BACE,+BAA+B,EAAA,OAAA,EAGhC,CAAC,YAAY,EAAE,+BAA+B,CAAC,EAAA,eAAA,EACvC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ycAAA,EAAA,MAAA,EAAA,CAAA,6QAAA,CAAA,EAAA;8BAGlB,cAAc,EAAA,CAAA;sBAA1C,SAAS;uBAAC,gBAAgB;;;AEzB7B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"angular-overflow-indicator.mjs","sources":["../tmp-esm2022/lib/default-indicator-button/default-indicator-button.component.js","../tmp-esm2022/lib/scroll-view-with-indicator/scroll-view-with-indicator.component.js","../tmp-esm2022/angular-overflow-indicator.js"],"sourcesContent":["import { ChangeDetectionStrategy, Component, output } from '@angular/core';\nimport * as i0 from \"@angular/core\";\nexport class DefaultIndicatorButtonComponent {\n constructor() {\n this.buttonClicked = output();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.1.6\", ngImport: i0, type: DefaultIndicatorButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"20.1.6\", type: DefaultIndicatorButtonComponent, isStandalone: true, selector: \"ng-scroll-view-default-indicator-button\", outputs: { buttonClicked: \"buttonClicked\" }, ngImport: i0, template: `\n <button class=\"default-button\" (click)=\"buttonClicked.emit()\">\n <span>There is more content</span>\n </button>\n `, isInline: true, styles: [\"button{border:none;font-size:.8rem;font-weight:500;padding:.4rem .6rem;background-color:#444;color:#fff;border-radius:1rem;margin-bottom:.4rem}\\n\"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.1.6\", ngImport: i0, type: DefaultIndicatorButtonComponent, decorators: [{\n type: Component,\n args: [{ selector: 'ng-scroll-view-default-indicator-button', template: `\n <button class=\"default-button\" (click)=\"buttonClicked.emit()\">\n <span>There is more content</span>\n </button>\n `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [\"button{border:none;font-size:.8rem;font-weight:500;padding:.4rem .6rem;background-color:#444;color:#fff;border-radius:1rem;margin-bottom:.4rem}\\n\"] }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1pbmRpY2F0b3ItYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1vdmVyZmxvdy1pbmRpY2F0b3Ivc3JjL2xpYi9kZWZhdWx0LWluZGljYXRvci1idXR0b24vZGVmYXVsdC1pbmRpY2F0b3ItYnV0dG9uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUF1QjNFLE1BQU0sT0FBTywrQkFBK0I7SUFyQjVDO1FBc0JFLGtCQUFhLEdBQUcsTUFBTSxFQUFFLENBQUM7S0FDMUI7OEdBRlksK0JBQStCO2tHQUEvQiwrQkFBK0IsZ0pBbkJoQzs7OztHQUlUOzsyRkFlVSwrQkFBK0I7a0JBckIzQyxTQUFTOytCQUNFLHlDQUF5QyxZQUN6Qzs7OztHQUlULG1CQWFnQix1QkFBdUIsQ0FBQyxNQUFNIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3ksIENvbXBvbmVudCwgb3V0cHV0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ25nLXNjcm9sbC12aWV3LWRlZmF1bHQtaW5kaWNhdG9yLWJ1dHRvbicsXG4gIHRlbXBsYXRlOiBgXG4gICAgPGJ1dHRvbiBjbGFzcz1cImRlZmF1bHQtYnV0dG9uXCIgKGNsaWNrKT1cImJ1dHRvbkNsaWNrZWQuZW1pdCgpXCI+XG4gICAgICA8c3Bhbj5UaGVyZSBpcyBtb3JlIGNvbnRlbnQ8L3NwYW4+XG4gICAgPC9idXR0b24+XG4gIGAsXG4gIHN0eWxlczogYFxuICAgIGJ1dHRvbiB7XG4gICAgICBib3JkZXI6IG5vbmU7XG4gICAgICBmb250LXNpemU6IDAuOHJlbTtcbiAgICAgIGZvbnQtd2VpZ2h0OiA1MDA7XG4gICAgICBwYWRkaW5nOiAwLjRyZW0gMC42cmVtO1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzQ0NDQ0NDtcbiAgICAgIGNvbG9yOiAjZmZmZmZmO1xuICAgICAgYm9yZGVyLXJhZGl1czogMXJlbTtcbiAgICAgIG1hcmdpbi1ib3R0b206IDAuNHJlbTtcbiAgICB9XG4gIGAsXG4gIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoXG59KVxuZXhwb3J0IGNsYXNzIERlZmF1bHRJbmRpY2F0b3JCdXR0b25Db21wb25lbnQge1xuICBidXR0b25DbGlja2VkID0gb3V0cHV0KCk7XG59XG4iXX0=","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, inject, input, output, signal, ViewChild } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DefaultIndicatorButtonComponent } from '../default-indicator-button';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/common\";\nexport class ScrollViewWithIndicatorComponent {\n constructor() {\n this.scrollState = output();\n this.indicatorButton = input.required(...(ngDevMode ? [{ debugName: \"indicatorButton\" }] : []));\n this.isOverflowing = signal(false, ...(ngDevMode ? [{ debugName: \"isOverflowing\" }] : []));\n this.isAtBottom = signal(false, ...(ngDevMode ? [{ debugName: \"isAtBottom\" }] : []));\n this.cdr = inject(ChangeDetectorRef);\n this.resizeObserver = null;\n }\n ngAfterViewInit() {\n this.resizeObserver = new ResizeObserver(() => {\n this.updateOverflowState();\n this.updateScrollState();\n this.cdr.detectChanges();\n });\n this.resizeObserver.observe(this.contentWrapper.nativeElement);\n }\n ngOnDestroy() {\n this.resizeObserver?.disconnect();\n }\n /**\n * Manually scrolls the content-container to the bottom\n */\n scrollToBottom() {\n this.contentWrapper.nativeElement.scrollTop = this.contentWrapper.nativeElement.scrollHeight;\n }\n /**\n * If the user scrolled all the way to the end of the container,\n * the indicator button can be hidden\n */\n onScroll() {\n this.updateScrollState();\n }\n updateOverflowState() {\n const element = this.contentWrapper.nativeElement;\n const maxScroll = element.scrollHeight - element.offsetHeight;\n this.isOverflowing.set(element.offsetHeight < element.scrollHeight && element.scrollTop < maxScroll);\n }\n updateScrollState() {\n const element = this.contentWrapper.nativeElement;\n const maxScroll = element.scrollHeight - element.offsetHeight;\n this.isAtBottom.set(element.scrollTop + 1 >= maxScroll);\n this.scrollState.emit(Math.round((100 / maxScroll) * (element.scrollTop + 1)));\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.1.6\", ngImport: i0, type: ScrollViewWithIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"20.1.6\", type: ScrollViewWithIndicatorComponent, isStandalone: true, selector: \"ng-scroll-view-with-indicator\", inputs: { indicatorButton: { classPropertyName: \"indicatorButton\", publicName: \"indicatorButton\", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { scrollState: \"scrollState\" }, viewQueries: [{ propertyName: \"contentWrapper\", first: true, predicate: [\"contentWrapper\"], descendants: true }], ngImport: i0, template: \"<div class=\\\"content-wrapper\\\" #contentWrapper (scroll)=\\\"onScroll()\\\">\\n <ng-content />\\n</div>\\n\\n@if (isOverflowing() && !isAtBottom()) {\\n <div class=\\\"scroll-indicator\\\">\\n @if (indicatorButton()) {\\n <ng-container [ngTemplateOutlet]=\\\"indicatorButton()\\\" />\\n } @else {\\n <ng-scroll-view-default-indicator-button (buttonClicked)=\\\"scrollToBottom()\\\" />\\n }\\n </div>\\n}\\n\", styles: [\":host{height:100%;max-height:100%;position:relative;min-height:0;display:flex}.content-wrapper{flex:1;max-height:100%;min-height:0;overflow-y:auto;box-sizing:border-box}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:center}\\n\"], dependencies: [{ kind: \"ngmodule\", type: CommonModule }, { kind: \"directive\", type: i1.NgTemplateOutlet, selector: \"[ngTemplateOutlet]\", inputs: [\"ngTemplateOutletContext\", \"ngTemplateOutlet\", \"ngTemplateOutletInjector\"] }, { kind: \"component\", type: DefaultIndicatorButtonComponent, selector: \"ng-scroll-view-default-indicator-button\", outputs: [\"buttonClicked\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.1.6\", ngImport: i0, type: ScrollViewWithIndicatorComponent, decorators: [{\n type: Component,\n args: [{ selector: 'ng-scroll-view-with-indicator', imports: [CommonModule, DefaultIndicatorButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: \"<div class=\\\"content-wrapper\\\" #contentWrapper (scroll)=\\\"onScroll()\\\">\\n <ng-content />\\n</div>\\n\\n@if (isOverflowing() && !isAtBottom()) {\\n <div class=\\\"scroll-indicator\\\">\\n @if (indicatorButton()) {\\n <ng-container [ngTemplateOutlet]=\\\"indicatorButton()\\\" />\\n } @else {\\n <ng-scroll-view-default-indicator-button (buttonClicked)=\\\"scrollToBottom()\\\" />\\n }\\n </div>\\n}\\n\", styles: [\":host{height:100%;max-height:100%;position:relative;min-height:0;display:flex}.content-wrapper{flex:1;max-height:100%;min-height:0;overflow-y:auto;box-sizing:border-box}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:center}\\n\"] }]\n }], propDecorators: { contentWrapper: [{\n type: ViewChild,\n args: ['contentWrapper']\n }] } });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Nyb2xsLXZpZXctd2l0aC1pbmRpY2F0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLW92ZXJmbG93LWluZGljYXRvci9zcmMvbGliL3Njcm9sbC12aWV3LXdpdGgtaW5kaWNhdG9yL3Njcm9sbC12aWV3LXdpdGgtaW5kaWNhdG9yLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1vdmVyZmxvdy1pbmRpY2F0b3Ivc3JjL2xpYi9zY3JvbGwtdmlldy13aXRoLWluZGljYXRvci9zY3JvbGwtdmlldy13aXRoLWluZGljYXRvci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwsdUJBQXVCLEVBQ3ZCLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsVUFBVSxFQUNWLE1BQU0sRUFDTixLQUFLLEVBRUwsTUFBTSxFQUNOLE1BQU0sRUFFTixTQUFTLEVBQ1YsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSwrQkFBK0IsRUFBRSxNQUFNLDZCQUE2QixDQUFDOzs7QUFTOUUsTUFBTSxPQUFPLGdDQUFnQztJQVA3QztRQVNFLGdCQUFXLEdBQUcsTUFBTSxFQUFVLENBQUM7UUFFdEIsb0JBQWUsR0FBRyxLQUFLLENBQUMsUUFBUSwwREFBd0IsQ0FBQztRQUN6RCxrQkFBYSxHQUFHLE1BQU0sQ0FBQyxLQUFLLHlEQUFDLENBQUM7UUFDOUIsZUFBV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ZGl2PlxuXG5AaWYgKGlzT3ZlcmZsb3dpbmcoKSAmJiAhaXNBdEJvdHRvbSgpKSB7XG4gIDxkaXYgY2xhc3M9XCJzY3JvbGwtaW5kaWNhdG9yXCI+XG4gICAgQGlmIChpbmRpY2F0b3JCdXR0b24oKSkge1xuICAgICAgPG5nLWNvbnRhaW5lciBbbmdUZW1wbGF0ZU91dGxldF09XCJpbmRpY2F0b3JCdXR0b24oKVwiIC8+XG4gICAgfSBAZWxzZSB7XG4gICAgICA8bmctc2Nyb2xsLXZpZXctZGVmYXVsdC1pbmRpY2F0b3ItYnV0dG9uIChidXR0b25DbGlja2VkKT1cInNjcm9sbFRvQm90dG9tKClcIiAvPlxuICAgIH1cbiAgPC9kaXY+XG59XG4iXX0=","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1vdmVyZmxvdy1pbmRpY2F0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItb3ZlcmZsb3ctaW5kaWNhdG9yL3NyYy9hbmd1bGFyLW92ZXJmbG93LWluZGljYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ=="],"names":[],"mappings":";;;;;AAEO,MAAM,+BAA+B,CAAC;AAC7C,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,aAAa,GAAG,MAAM,EAAE;AACrC;AACA,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,UAAU,EAAE,Q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IAAI,EAAE,SAAS;AAC/B,gBAAgB,IAAI,EAAE,CAAC,gBAAgB;AACvC,aAAa,CAAC,EAAE,EAAE,CAAC;;AC1DnB;AACA;AACA;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, ElementRef, TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class ScrollViewWithIndicatorComponent implements AfterViewInit, OnDestroy {
|
|
5
|
+
contentWrapper: ElementRef<HTMLDivElement>;
|
|
6
|
+
scrollState: _angular_core.OutputEmitterRef<number>;
|
|
7
|
+
readonly indicatorButton: _angular_core.InputSignal<TemplateRef<unknown>>;
|
|
8
|
+
readonly isOverflowing: _angular_core.WritableSignal<boolean>;
|
|
9
|
+
readonly isAtBottom: _angular_core.WritableSignal<boolean>;
|
|
10
|
+
private readonly cdr;
|
|
11
|
+
private resizeObserver;
|
|
12
|
+
ngAfterViewInit(): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Manually scrolls the content-container to the bottom
|
|
16
|
+
*/
|
|
17
|
+
scrollToBottom(): void;
|
|
18
|
+
/**
|
|
19
|
+
* If the user scrolled all the way to the end of the container,
|
|
20
|
+
* the indicator button can be hidden
|
|
21
|
+
*/
|
|
22
|
+
onScroll(): void;
|
|
23
|
+
private updateOverflowState;
|
|
24
|
+
private updateScrollState;
|
|
25
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScrollViewWithIndicatorComponent, never>;
|
|
26
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScrollViewWithIndicatorComponent, "ng-scroll-view-with-indicator", never, { "indicatorButton": { "alias": "indicatorButton"; "required": true; "isSignal": true; }; }, { "scrollState": "scrollState"; }, never, ["*"], true, never>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { ScrollViewWithIndicatorComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-overflow-indicator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.1",
|
|
4
4
|
"description": "A simple and performant component that displays a given button if the content of the component overflows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"directory": "libs/angular-overflow-indicator"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@angular/common": "^
|
|
13
|
-
"@angular/core": "^
|
|
12
|
+
"@angular/common": "^20.0.0",
|
|
13
|
+
"@angular/core": "^20.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"tslib": "^2.6.2"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class DefaultIndicatorButtonComponent {
|
|
3
|
-
buttonClicked: import("@angular/core").OutputEmitterRef<void>;
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultIndicatorButtonComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DefaultIndicatorButtonComponent, "ng-scroll-view-default-indicator-button", never, {}, { "buttonClicked": "buttonClicked"; }, never, never, true, never>;
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DefaultIndicatorButtonComponent } from './default-indicator-button.component';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ScrollViewWithIndicatorComponent } from './scroll-view-with-indicator.component';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ScrollViewWithIndicatorComponent implements AfterViewInit, OnDestroy {
|
|
4
|
-
contentWrapper: ElementRef<HTMLDivElement>;
|
|
5
|
-
scrollState: import("@angular/core").OutputEmitterRef<number>;
|
|
6
|
-
readonly indicatorButton: import("@angular/core").InputSignal<TemplateRef<unknown>>;
|
|
7
|
-
readonly isOverflowing: import("@angular/core").WritableSignal<boolean>;
|
|
8
|
-
readonly isAtBottom: import("@angular/core").WritableSignal<boolean>;
|
|
9
|
-
private readonly cdr;
|
|
10
|
-
private resizeObserver;
|
|
11
|
-
ngAfterViewInit(): void;
|
|
12
|
-
ngOnDestroy(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Manually scrolls the content-container to the bottom
|
|
15
|
-
*/
|
|
16
|
-
scrollToBottom(): void;
|
|
17
|
-
/**
|
|
18
|
-
* If the user scrolled all the way to the end of the container,
|
|
19
|
-
* the indicator button can be hidden
|
|
20
|
-
*/
|
|
21
|
-
onScroll(): void;
|
|
22
|
-
private updateOverflowState;
|
|
23
|
-
private updateScrollState;
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ScrollViewWithIndicatorComponent, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ScrollViewWithIndicatorComponent, "ng-scroll-view-with-indicator", never, { "indicatorButton": { "alias": "indicatorButton"; "required": true; "isSignal": true; }; }, { "scrollState": "scrollState"; }, never, ["*"], true, never>;
|
|
26
|
-
}
|