@tectra-ng/utils 0.0.1 → 0.2.2
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/LICENSE +21 -0
- package/README.md +40 -1
- package/auto-focus/README.md +19 -0
- package/breakpoint/README.md +23 -0
- package/clipboard/README.md +37 -0
- package/clock/README.md +21 -0
- package/currency/README.md +17 -0
- package/date/README.md +46 -0
- package/debounce-input/README.md +31 -0
- package/drag-scroll/README.md +25 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs +100 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs +54 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs +225 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clock.mjs +59 -0
- package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-currency.mjs +63 -0
- package/fesm2022/tectra-ng-utils-currency.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-date.mjs +200 -0
- package/fesm2022/tectra-ng-utils-date.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs +156 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs +199 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-file.mjs +78 -0
- package/fesm2022/tectra-ng-utils-file.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs +238 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter.mjs +88 -0
- package/fesm2022/tectra-ng-utils-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs +70 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs +162 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs +117 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-http.mjs +189 -0
- package/fesm2022/tectra-ng-utils-http.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs +297 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-plural.mjs +98 -0
- package/fesm2022/tectra-ng-utils-plural.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-polling.mjs +109 -0
- package/fesm2022/tectra-ng-utils-polling.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-random.mjs +20 -0
- package/fesm2022/tectra-ng-utils-random.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs +87 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs +136 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-selection.mjs +52 -0
- package/fesm2022/tectra-ng-utils-selection.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs +92 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stream.mjs +30 -0
- package/fesm2022/tectra-ng-utils-stream.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs +350 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-text.mjs +173 -0
- package/fesm2022/tectra-ng-utils-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-title.mjs +99 -0
- package/fesm2022/tectra-ng-utils-title.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-validators.mjs +232 -0
- package/fesm2022/tectra-ng-utils-validators.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils.mjs +4 -0
- package/fesm2022/tectra-ng-utils.mjs.map +1 -0
- package/file/README.md +19 -0
- package/filter/README.md +22 -0
- package/filter-state/README.md +36 -0
- package/form-changes/README.md +26 -0
- package/form-validation/README.md +40 -0
- package/go-back/README.md +28 -0
- package/http/README.md +34 -0
- package/in-view/README.md +34 -0
- package/package.json +173 -3
- package/plural/README.md +21 -0
- package/polling/README.md +34 -0
- package/random/README.md +10 -0
- package/relative-time/README.md +29 -0
- package/scroll-end/README.md +25 -0
- package/selection/README.md +24 -0
- package/stop-propagation/README.md +15 -0
- package/stream/README.md +14 -0
- package/style-class/README.md +34 -0
- package/text/README.md +25 -0
- package/title/README.md +26 -0
- package/types/tectra-ng-utils-auto-focus.d.ts +22 -0
- package/types/tectra-ng-utils-auto-focus.d.ts.map +1 -0
- package/types/tectra-ng-utils-breakpoint.d.ts +15 -0
- package/types/tectra-ng-utils-breakpoint.d.ts.map +1 -0
- package/types/tectra-ng-utils-clipboard.d.ts +48 -0
- package/types/tectra-ng-utils-clipboard.d.ts.map +1 -0
- package/types/tectra-ng-utils-clock.d.ts +18 -0
- package/types/tectra-ng-utils-clock.d.ts.map +1 -0
- package/types/tectra-ng-utils-currency.d.ts +11 -0
- package/types/tectra-ng-utils-currency.d.ts.map +1 -0
- package/types/tectra-ng-utils-date.d.ts +65 -0
- package/types/tectra-ng-utils-date.d.ts.map +1 -0
- package/types/tectra-ng-utils-debounce-input.d.ts +38 -0
- package/types/tectra-ng-utils-debounce-input.d.ts.map +1 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts +41 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts.map +1 -0
- package/types/tectra-ng-utils-file.d.ts +18 -0
- package/types/tectra-ng-utils-file.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter-state.d.ts +55 -0
- package/types/tectra-ng-utils-filter-state.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter.d.ts +21 -0
- package/types/tectra-ng-utils-filter.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-changes.d.ts +22 -0
- package/types/tectra-ng-utils-form-changes.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-validation.d.ts +45 -0
- package/types/tectra-ng-utils-form-validation.d.ts.map +1 -0
- package/types/tectra-ng-utils-go-back.d.ts +25 -0
- package/types/tectra-ng-utils-go-back.d.ts.map +1 -0
- package/types/tectra-ng-utils-http.d.ts +47 -0
- package/types/tectra-ng-utils-http.d.ts.map +1 -0
- package/types/tectra-ng-utils-in-view.d.ts +80 -0
- package/types/tectra-ng-utils-in-view.d.ts.map +1 -0
- package/types/tectra-ng-utils-plural.d.ts +21 -0
- package/types/tectra-ng-utils-plural.d.ts.map +1 -0
- package/types/tectra-ng-utils-polling.d.ts +61 -0
- package/types/tectra-ng-utils-polling.d.ts.map +1 -0
- package/types/tectra-ng-utils-random.d.ts +4 -0
- package/types/tectra-ng-utils-random.d.ts.map +1 -0
- package/types/tectra-ng-utils-relative-time.d.ts +22 -0
- package/types/tectra-ng-utils-relative-time.d.ts.map +1 -0
- package/types/tectra-ng-utils-scroll-end.d.ts +38 -0
- package/types/tectra-ng-utils-scroll-end.d.ts.map +1 -0
- package/types/tectra-ng-utils-selection.d.ts +21 -0
- package/types/tectra-ng-utils-selection.d.ts.map +1 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts +22 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts.map +1 -0
- package/types/tectra-ng-utils-stream.d.ts +3 -0
- package/types/tectra-ng-utils-stream.d.ts.map +1 -0
- package/types/tectra-ng-utils-style-class.d.ts +91 -0
- package/types/tectra-ng-utils-style-class.d.ts.map +1 -0
- package/types/tectra-ng-utils-text.d.ts +26 -0
- package/types/tectra-ng-utils-text.d.ts.map +1 -0
- package/types/tectra-ng-utils-title.d.ts +31 -0
- package/types/tectra-ng-utils-title.d.ts.map +1 -0
- package/types/tectra-ng-utils-validators.d.ts +67 -0
- package/types/tectra-ng-utils-validators.d.ts.map +1 -0
- package/types/tectra-ng-utils.d.ts +2 -0
- package/types/tectra-ng-utils.d.ts.map +1 -0
- package/validators/README.md +42 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Location } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Directive, ElementRef, HostAttributeToken, inject, input, output } from "@angular/core";
|
|
4
|
+
import { Router, UrlTree } from "@angular/router";
|
|
5
|
+
const NATIVE_CONTROLS = [
|
|
6
|
+
"BUTTON",
|
|
7
|
+
"A",
|
|
8
|
+
"INPUT",
|
|
9
|
+
"SUMMARY"
|
|
10
|
+
];
|
|
11
|
+
var TxGoBack = class TxGoBack {
|
|
12
|
+
location = inject(Location);
|
|
13
|
+
router = inject(Router);
|
|
14
|
+
element = inject(ElementRef).nativeElement;
|
|
15
|
+
fallback = input("/", {
|
|
16
|
+
...ngDevMode ? { debugName: "fallback" } : /* istanbul ignore next */ {},
|
|
17
|
+
alias: "txGoBack"
|
|
18
|
+
});
|
|
19
|
+
navigated = output();
|
|
20
|
+
needsRole = !NATIVE_CONTROLS.includes(this.element.tagName.toUpperCase()) && inject(new HostAttributeToken("role"), { optional: true }) === null;
|
|
21
|
+
canGoBack() {
|
|
22
|
+
return (this.location.getState()?.navigationId ?? 1) > 1;
|
|
23
|
+
}
|
|
24
|
+
back() {
|
|
25
|
+
if (this.canGoBack()) {
|
|
26
|
+
this.location.back();
|
|
27
|
+
this.navigated.emit("back");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const target = this.fallback() || "/";
|
|
31
|
+
target instanceof UrlTree ? this.router.navigateByUrl(target) : typeof target === "string" ? this.router.navigateByUrl(target) : this.router.navigate([...target]);
|
|
32
|
+
this.navigated.emit("fallback");
|
|
33
|
+
}
|
|
34
|
+
onClick(event) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
this.back();
|
|
37
|
+
}
|
|
38
|
+
onKey(event) {
|
|
39
|
+
if (this.needsRole) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
this.back();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
45
|
+
minVersion: "12.0.0",
|
|
46
|
+
version: "22.2.3",
|
|
47
|
+
ngImport: i0,
|
|
48
|
+
type: TxGoBack,
|
|
49
|
+
deps: [],
|
|
50
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
51
|
+
});
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
53
|
+
minVersion: "17.1.0",
|
|
54
|
+
version: "22.2.3",
|
|
55
|
+
type: TxGoBack,
|
|
56
|
+
isStandalone: true,
|
|
57
|
+
selector: "[txGoBack]",
|
|
58
|
+
inputs: { fallback: {
|
|
59
|
+
classPropertyName: "fallback",
|
|
60
|
+
publicName: "txGoBack",
|
|
61
|
+
isSignal: true,
|
|
62
|
+
isRequired: false,
|
|
63
|
+
transformFunction: null
|
|
64
|
+
} },
|
|
65
|
+
outputs: { navigated: "navigated" },
|
|
66
|
+
host: {
|
|
67
|
+
listeners: {
|
|
68
|
+
"click": "onClick($event)",
|
|
69
|
+
"keydown.enter": "onKey($event)",
|
|
70
|
+
"keydown.space": "onKey($event)"
|
|
71
|
+
},
|
|
72
|
+
properties: {
|
|
73
|
+
"attr.role": "needsRole ? \"button\" : null",
|
|
74
|
+
"attr.tabindex": "needsRole ? 0 : null"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
exportAs: ["txGoBack"],
|
|
78
|
+
ngImport: i0
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
82
|
+
minVersion: "12.0.0",
|
|
83
|
+
version: "22.2.3",
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
type: TxGoBack,
|
|
86
|
+
decorators: [{
|
|
87
|
+
type: Directive,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: "[txGoBack]",
|
|
90
|
+
exportAs: "txGoBack",
|
|
91
|
+
host: {
|
|
92
|
+
"[attr.role]": "needsRole ? \"button\" : null",
|
|
93
|
+
"[attr.tabindex]": "needsRole ? 0 : null",
|
|
94
|
+
"(click)": "onClick($event)",
|
|
95
|
+
"(keydown.enter)": "onKey($event)",
|
|
96
|
+
"(keydown.space)": "onKey($event)"
|
|
97
|
+
}
|
|
98
|
+
}]
|
|
99
|
+
}],
|
|
100
|
+
propDecorators: {
|
|
101
|
+
fallback: [{
|
|
102
|
+
type: i0.Input,
|
|
103
|
+
args: [{
|
|
104
|
+
isSignal: true,
|
|
105
|
+
alias: "txGoBack",
|
|
106
|
+
required: false
|
|
107
|
+
}]
|
|
108
|
+
}],
|
|
109
|
+
navigated: [{
|
|
110
|
+
type: i0.Output,
|
|
111
|
+
args: ["navigated"]
|
|
112
|
+
}]
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export { TxGoBack };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=tectra-ng-utils-go-back.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-go-back.mjs","names":[],"sources":["../../../../packages/utils/go-back/src/go-back.directive.ts"],"sourcesContent":["import { Location } from '@angular/common';\nimport { Directive, ElementRef, HostAttributeToken, inject, input, output } from '@angular/core';\nimport { Router, UrlTree } from '@angular/router';\n\nconst NATIVE_CONTROLS = ['BUTTON', 'A', 'INPUT', 'SUMMARY'];\n\n@Directive({\n selector: '[txGoBack]',\n exportAs: 'txGoBack',\n host: {\n '[attr.role]': 'needsRole ? \"button\" : null',\n '[attr.tabindex]': 'needsRole ? 0 : null',\n '(click)': 'onClick($event)',\n '(keydown.enter)': 'onKey($event)',\n '(keydown.space)': 'onKey($event)',\n },\n})\nexport class TxGoBack {\n private readonly location = inject(Location);\n private readonly router = inject(Router);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n readonly fallback = input<string | readonly unknown[] | UrlTree>('/', { alias: 'txGoBack' });\n\n readonly navigated = output<'back' | 'fallback'>();\n\n protected readonly needsRole = !NATIVE_CONTROLS.includes(this.element.tagName.toUpperCase()) && inject(new HostAttributeToken('role'), { optional: true }) === null;\n\n canGoBack(): boolean {\n const state = this.location.getState() as { navigationId?: number } | null;\n return (state?.navigationId ?? 1) > 1;\n }\n\n back(): void {\n if (this.canGoBack()) {\n this.location.back();\n this.navigated.emit('back');\n return;\n }\n const target = this.fallback() || '/';\n void (target instanceof UrlTree ? this.router.navigateByUrl(target) : typeof target === 'string' ? this.router.navigateByUrl(target) : this.router.navigate([...target]));\n this.navigated.emit('fallback');\n }\n\n protected onClick(event: Event): void {\n event.preventDefault();\n this.back();\n }\n\n protected onKey(event: Event): void {\n if (this.needsRole) {\n event.preventDefault();\n this.back();\n }\n }\n}\n"],"mappings":";;;;AAIA,MAAM,kBAAkB;CAAC;CAAU;CAAK;CAAS;AAAS;AAa1D,IAAa,WAAb,MAAa,SAAQ;CACF,WAAW,OAAO,QAAQ;CAC1B,SAAS,OAAO,MAAM;CACtB,UAAU,OAAgC,UAAU,CAAC,CAAC;CAE9D,WAAW,MAA6C,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,OAAO;CAAU,CAAA;CAEhF,YAAY,OAAM;CAER,YAAY,CAAC,gBAAgB,SAAS,KAAK,QAAQ,QAAQ,YAAW,CAAE,KAAK,OAAO,IAAI,mBAAmB,MAAM,GAAG,EAAE,UAAU,KAAI,CAAE,MAAM;CAE/J,YAAS;EAEP,QADc,KAAK,SAAS,SACpB,CAAA,EAAO,gBAAgB,KAAK;CACtC;CAEA,OAAI;EACF,IAAI,KAAK,UAAS,GAAI;GACpB,KAAK,SAAS,KAAI;GAClB,KAAK,UAAU,KAAK,MAAM;GAC1B;EACF;EACA,MAAM,SAAS,KAAK,SAAQ,KAAM;EAClC,AAAM,kBAAkB,UAAU,KAAK,OAAO,cAAc,MAAM,IAAI,OAAO,WAAW,WAAW,KAAK,OAAO,cAAc,MAAM,IAAI,KAAK,OAAO,SAAS,CAAC,GAAG,MAAM,CAAC;EACvK,KAAK,UAAU,KAAK,UAAU;CAChC;CAEU,QAAQ,OAAY;EAC5B,MAAM,eAAc;EACpB,KAAK,KAAI;CACX;CAEU,MAAM,OAAY;EAC1B,IAAI,KAAK,WAAW;GAClB,MAAM,eAAc;GACpB,KAAK,KAAI;EACX;CACF;CArCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,UAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,SAAA,EAAA,WAAA,YAAA;EAAA,MAAA;GAAA,WAAA;IAAA,SAAA;IAAA,iBAAA;IAAA,iBAAA;GAAA;GAAA,YAAA;IAAA,aAAA;IAAA,iBAAA;GAAA;EAAA;EAAA,UAAA,CAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAXpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IACJ,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,mBAAmB;IACnB,mBAAmB;GACpB;EACF,CAAA"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { HttpErrorResponse, HttpParams, HttpStatusCode } from "@angular/common/http";
|
|
2
|
+
import { retry, throwError, timer } from "rxjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Pipe, inject } from "@angular/core";
|
|
5
|
+
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
6
|
+
function toParamValue(value) {
|
|
7
|
+
if (value instanceof Date) return value.toISOString();
|
|
8
|
+
return typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
9
|
+
}
|
|
10
|
+
const isEmpty = (value) => value === void 0 || value === null || value === "";
|
|
11
|
+
function buildHttpParams(query) {
|
|
12
|
+
let params = new HttpParams();
|
|
13
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
14
|
+
if (Array.isArray(value)) value.filter((item) => !isEmpty(item)).forEach((item) => params = params.append(key, toParamValue(item)));
|
|
15
|
+
else if (!isEmpty(value)) params = params.set(key, toParamValue(value));
|
|
16
|
+
});
|
|
17
|
+
return params;
|
|
18
|
+
}
|
|
19
|
+
const TX_HTTP_RETRY_COUNT = 5;
|
|
20
|
+
const TX_HTTP_RETRY_BASE_DELAY_MS = 2e3;
|
|
21
|
+
const TX_HTTP_RETRY_MAX_DELAY_MS = 3e4;
|
|
22
|
+
const TX_HTTP_RETRY_FACTOR = 2;
|
|
23
|
+
const TX_HTTP_NETWORK_ERROR_STATUS = 0;
|
|
24
|
+
const TX_HTTP_RETRYABLE_STATUSES = [
|
|
25
|
+
0,
|
|
26
|
+
HttpStatusCode.TooManyRequests,
|
|
27
|
+
HttpStatusCode.BadGateway,
|
|
28
|
+
HttpStatusCode.ServiceUnavailable,
|
|
29
|
+
HttpStatusCode.GatewayTimeout
|
|
30
|
+
];
|
|
31
|
+
function parseRetryAfter(value, now = Date.now()) {
|
|
32
|
+
const trimmed = value?.trim();
|
|
33
|
+
if (!trimmed) return null;
|
|
34
|
+
const seconds = Number(trimmed);
|
|
35
|
+
if (Number.isFinite(seconds) && seconds >= 0) return seconds * 1e3;
|
|
36
|
+
const date = Date.parse(trimmed);
|
|
37
|
+
return Number.isNaN(date) ? null : Math.max(0, date - now);
|
|
38
|
+
}
|
|
39
|
+
function httpRetryDelay(data) {
|
|
40
|
+
const retryAfter = parseRetryAfter(data.error.headers?.get("Retry-After"));
|
|
41
|
+
if (retryAfter !== null) return retryAfter > data.maxDelayMs ? null : retryAfter;
|
|
42
|
+
return Math.min(data.baseDelayMs * 2 ** (data.attempt - 1), data.maxDelayMs);
|
|
43
|
+
}
|
|
44
|
+
function retryHttpReads(options = {}) {
|
|
45
|
+
const { count = 5, baseDelayMs = TX_HTTP_RETRY_BASE_DELAY_MS, maxDelayMs = TX_HTTP_RETRY_MAX_DELAY_MS, statuses = TX_HTTP_RETRYABLE_STATUSES } = options;
|
|
46
|
+
return retry({
|
|
47
|
+
count,
|
|
48
|
+
delay: (error, attempt) => {
|
|
49
|
+
if (!(error instanceof HttpErrorResponse) || !statuses.includes(error.status)) return throwError(() => error);
|
|
50
|
+
const delayMs = httpRetryDelay({
|
|
51
|
+
error,
|
|
52
|
+
attempt,
|
|
53
|
+
baseDelayMs,
|
|
54
|
+
maxDelayMs
|
|
55
|
+
});
|
|
56
|
+
return delayMs === null ? throwError(() => error) : timer(delayMs);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const GROUP_TONES = {
|
|
61
|
+
ok: "success",
|
|
62
|
+
redirect: "info",
|
|
63
|
+
clientError: "danger",
|
|
64
|
+
serverError: "danger",
|
|
65
|
+
warning: "warn",
|
|
66
|
+
noResponse: "secondary",
|
|
67
|
+
unknown: "secondary"
|
|
68
|
+
};
|
|
69
|
+
const GROUP_LABELS = {
|
|
70
|
+
ok: "httpStatusOk",
|
|
71
|
+
redirect: "httpStatusRedirect",
|
|
72
|
+
clientError: "httpStatusClientError",
|
|
73
|
+
serverError: "httpStatusServerError",
|
|
74
|
+
warning: "httpStatusWarning",
|
|
75
|
+
noResponse: "httpStatusNoResponse",
|
|
76
|
+
unknown: "httpStatusUnknown"
|
|
77
|
+
};
|
|
78
|
+
function httpStatusGroup(status, warnCodes = []) {
|
|
79
|
+
if (!status) return "noResponse";
|
|
80
|
+
if (warnCodes.includes(status)) return "warning";
|
|
81
|
+
if (status >= 500) return "serverError";
|
|
82
|
+
if (status >= 400) return "clientError";
|
|
83
|
+
if (status >= 300) return "redirect";
|
|
84
|
+
return status >= 200 ? "ok" : "unknown";
|
|
85
|
+
}
|
|
86
|
+
function httpStatusTone(status, warnCodes = []) {
|
|
87
|
+
return GROUP_TONES[httpStatusGroup(status, warnCodes)];
|
|
88
|
+
}
|
|
89
|
+
var TxHttpStatusTonePipe = class TxHttpStatusTonePipe {
|
|
90
|
+
transform(status, warnCodes = []) {
|
|
91
|
+
return httpStatusTone(status, warnCodes);
|
|
92
|
+
}
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
94
|
+
minVersion: "12.0.0",
|
|
95
|
+
version: "22.2.3",
|
|
96
|
+
ngImport: i0,
|
|
97
|
+
type: TxHttpStatusTonePipe,
|
|
98
|
+
deps: [],
|
|
99
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
100
|
+
});
|
|
101
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
102
|
+
minVersion: "14.0.0",
|
|
103
|
+
version: "22.2.3",
|
|
104
|
+
ngImport: i0,
|
|
105
|
+
type: TxHttpStatusTonePipe,
|
|
106
|
+
isStandalone: true,
|
|
107
|
+
name: "txHttpStatusTone"
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
111
|
+
minVersion: "12.0.0",
|
|
112
|
+
version: "22.2.3",
|
|
113
|
+
ngImport: i0,
|
|
114
|
+
type: TxHttpStatusTonePipe,
|
|
115
|
+
decorators: [{
|
|
116
|
+
type: Pipe,
|
|
117
|
+
args: [{ name: "txHttpStatusTone" }]
|
|
118
|
+
}]
|
|
119
|
+
});
|
|
120
|
+
var TxHttpStatusGroupPipe = class TxHttpStatusGroupPipe {
|
|
121
|
+
transform(status, warnCodes = []) {
|
|
122
|
+
return httpStatusGroup(status, warnCodes);
|
|
123
|
+
}
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
125
|
+
minVersion: "12.0.0",
|
|
126
|
+
version: "22.2.3",
|
|
127
|
+
ngImport: i0,
|
|
128
|
+
type: TxHttpStatusGroupPipe,
|
|
129
|
+
deps: [],
|
|
130
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
131
|
+
});
|
|
132
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
133
|
+
minVersion: "14.0.0",
|
|
134
|
+
version: "22.2.3",
|
|
135
|
+
ngImport: i0,
|
|
136
|
+
type: TxHttpStatusGroupPipe,
|
|
137
|
+
isStandalone: true,
|
|
138
|
+
name: "txHttpStatusGroup"
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
142
|
+
minVersion: "12.0.0",
|
|
143
|
+
version: "22.2.3",
|
|
144
|
+
ngImport: i0,
|
|
145
|
+
type: TxHttpStatusGroupPipe,
|
|
146
|
+
decorators: [{
|
|
147
|
+
type: Pipe,
|
|
148
|
+
args: [{ name: "txHttpStatusGroup" }]
|
|
149
|
+
}]
|
|
150
|
+
});
|
|
151
|
+
var TxHttpStatusLabelPipe = class TxHttpStatusLabelPipe {
|
|
152
|
+
locale = inject(TxLocaleService);
|
|
153
|
+
transform(status, warnCodes = []) {
|
|
154
|
+
return this.locale.translate(GROUP_LABELS[httpStatusGroup(status, warnCodes)]);
|
|
155
|
+
}
|
|
156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
157
|
+
minVersion: "12.0.0",
|
|
158
|
+
version: "22.2.3",
|
|
159
|
+
ngImport: i0,
|
|
160
|
+
type: TxHttpStatusLabelPipe,
|
|
161
|
+
deps: [],
|
|
162
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
163
|
+
});
|
|
164
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
165
|
+
minVersion: "14.0.0",
|
|
166
|
+
version: "22.2.3",
|
|
167
|
+
ngImport: i0,
|
|
168
|
+
type: TxHttpStatusLabelPipe,
|
|
169
|
+
isStandalone: true,
|
|
170
|
+
name: "txHttpStatusLabel",
|
|
171
|
+
pure: false
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
175
|
+
minVersion: "12.0.0",
|
|
176
|
+
version: "22.2.3",
|
|
177
|
+
ngImport: i0,
|
|
178
|
+
type: TxHttpStatusLabelPipe,
|
|
179
|
+
decorators: [{
|
|
180
|
+
type: Pipe,
|
|
181
|
+
args: [{
|
|
182
|
+
name: "txHttpStatusLabel",
|
|
183
|
+
pure: false
|
|
184
|
+
}]
|
|
185
|
+
}]
|
|
186
|
+
});
|
|
187
|
+
export { TX_HTTP_NETWORK_ERROR_STATUS, TX_HTTP_RETRYABLE_STATUSES, TX_HTTP_RETRY_BASE_DELAY_MS, TX_HTTP_RETRY_COUNT, TX_HTTP_RETRY_FACTOR, TX_HTTP_RETRY_MAX_DELAY_MS, TxHttpStatusGroupPipe, TxHttpStatusLabelPipe, TxHttpStatusTonePipe, buildHttpParams, httpRetryDelay, httpStatusGroup, httpStatusTone, parseRetryAfter, retryHttpReads };
|
|
188
|
+
|
|
189
|
+
//# sourceMappingURL=tectra-ng-utils-http.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-http.mjs","names":[],"sources":["../../../../packages/utils/http/src/http-params.functions.ts","../../../../packages/utils/http/src/http-retry.functions.ts","../../../../packages/utils/http/src/http-status.ts"],"sourcesContent":["import { HttpParams } from '@angular/common/http';\n\nfunction toParamValue(value: unknown): string {\n if (value instanceof Date) {\n return value.toISOString();\n }\n return typeof value === 'object' ? JSON.stringify(value) : String(value);\n}\n\nconst isEmpty = (value: unknown): boolean => value === undefined || value === null || value === '';\n\nexport function buildHttpParams(query: object): HttpParams {\n let params = new HttpParams();\n Object.entries(query).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.filter((item) => !isEmpty(item)).forEach((item) => (params = params.append(key, toParamValue(item))));\n } else if (!isEmpty(value)) {\n params = params.set(key, toParamValue(value));\n }\n });\n return params;\n}\n","import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';\nimport { MonoTypeOperatorFunction, retry, throwError, timer } from 'rxjs';\nimport { TxHttpRetryDelay, TxHttpRetryOptions } from './http.types';\n\nexport const TX_HTTP_RETRY_COUNT = 5;\nexport const TX_HTTP_RETRY_BASE_DELAY_MS = 2000;\nexport const TX_HTTP_RETRY_MAX_DELAY_MS = 30000;\nexport const TX_HTTP_RETRY_FACTOR = 2;\nexport const TX_HTTP_NETWORK_ERROR_STATUS = 0;\nexport const TX_HTTP_RETRYABLE_STATUSES: readonly number[] = [\n TX_HTTP_NETWORK_ERROR_STATUS,\n HttpStatusCode.TooManyRequests,\n HttpStatusCode.BadGateway,\n HttpStatusCode.ServiceUnavailable,\n HttpStatusCode.GatewayTimeout,\n];\n\nexport function parseRetryAfter(value: string | null | undefined, now: number = Date.now()): number | null {\n const trimmed = value?.trim();\n if (!trimmed) {\n return null;\n }\n const seconds = Number(trimmed);\n if (Number.isFinite(seconds) && seconds >= 0) {\n return seconds * 1000;\n }\n const date = Date.parse(trimmed);\n return Number.isNaN(date) ? null : Math.max(0, date - now);\n}\n\nexport function httpRetryDelay(data: TxHttpRetryDelay): number | null {\n const retryAfter = parseRetryAfter(data.error.headers?.get('Retry-After'));\n if (retryAfter !== null) {\n return retryAfter > data.maxDelayMs ? null : retryAfter;\n }\n return Math.min(data.baseDelayMs * TX_HTTP_RETRY_FACTOR ** (data.attempt - 1), data.maxDelayMs);\n}\n\nexport function retryHttpReads<T>(options: TxHttpRetryOptions = {}): MonoTypeOperatorFunction<T> {\n const {\n count = TX_HTTP_RETRY_COUNT,\n baseDelayMs = TX_HTTP_RETRY_BASE_DELAY_MS,\n maxDelayMs = TX_HTTP_RETRY_MAX_DELAY_MS,\n statuses = TX_HTTP_RETRYABLE_STATUSES,\n } = options;\n return retry({\n count,\n delay: (error: unknown, attempt: number) => {\n if (!(error instanceof HttpErrorResponse) || !statuses.includes(error.status)) {\n return throwError(() => error);\n }\n const delayMs = httpRetryDelay({ error, attempt, baseDelayMs, maxDelayMs });\n return delayMs === null ? throwError(() => error) : timer(delayMs);\n },\n });\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { TxTranslations } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { TxHttpStatusGroup, TxHttpStatusTone } from './http.types';\n\nconst GROUP_TONES: Record<TxHttpStatusGroup, TxHttpStatusTone> = {\n ok: 'success',\n redirect: 'info',\n clientError: 'danger',\n serverError: 'danger',\n warning: 'warn',\n noResponse: 'secondary',\n unknown: 'secondary',\n};\n\nconst GROUP_LABELS: Record<TxHttpStatusGroup, keyof TxTranslations> = {\n ok: 'httpStatusOk',\n redirect: 'httpStatusRedirect',\n clientError: 'httpStatusClientError',\n serverError: 'httpStatusServerError',\n warning: 'httpStatusWarning',\n noResponse: 'httpStatusNoResponse',\n unknown: 'httpStatusUnknown',\n};\n\nexport function httpStatusGroup(status: number | null | undefined, warnCodes: readonly number[] = []): TxHttpStatusGroup {\n if (!status) {\n return 'noResponse';\n }\n if (warnCodes.includes(status)) {\n return 'warning';\n }\n if (status >= 500) {\n return 'serverError';\n }\n if (status >= 400) {\n return 'clientError';\n }\n if (status >= 300) {\n return 'redirect';\n }\n return status >= 200 ? 'ok' : 'unknown';\n}\n\nexport function httpStatusTone(status: number | null | undefined, warnCodes: readonly number[] = []): TxHttpStatusTone {\n return GROUP_TONES[httpStatusGroup(status, warnCodes)];\n}\n\n@Pipe({ name: 'txHttpStatusTone' })\nexport class TxHttpStatusTonePipe implements PipeTransform {\n transform(status: number | null | undefined, warnCodes: readonly number[] = []): TxHttpStatusTone {\n return httpStatusTone(status, warnCodes);\n }\n}\n\n@Pipe({ name: 'txHttpStatusGroup' })\nexport class TxHttpStatusGroupPipe implements PipeTransform {\n transform(status: number | null | undefined, warnCodes: readonly number[] = []): TxHttpStatusGroup {\n return httpStatusGroup(status, warnCodes);\n }\n}\n\n@Pipe({ name: 'txHttpStatusLabel', pure: false })\nexport class TxHttpStatusLabelPipe implements PipeTransform {\n private readonly locale = inject(TxLocaleService);\n\n transform(status: number | null | undefined, warnCodes: readonly number[] = []): string {\n return this.locale.translate(GROUP_LABELS[httpStatusGroup(status, warnCodes)]);\n }\n}\n"],"mappings":";;;;;AAEA,SAAS,aAAa,OAAc;CAClC,IAAI,iBAAiB,MACnB,OAAO,MAAM,YAAW;CAE1B,OAAO,OAAO,UAAU,WAAW,KAAK,UAAU,KAAK,IAAI,OAAO,KAAK;AACzE;AAEA,MAAM,WAAW,UAA4B,UAAU,UAAa,UAAU,QAAQ,UAAU;AAEhG,SAAgB,gBAAgB,OAAa;CAC3C,IAAI,SAAS,IAAI,WAAU;CAC3B,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,WAAU;EAC7C,IAAI,MAAM,QAAQ,KAAK,GACrB,MAAM,QAAQ,SAAS,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,SAAS,SAAU,SAAS,OAAO,OAAO,KAAK,aAAa,IAAI,CAAC,CAAE;OACrG,IAAI,CAAC,QAAQ,KAAK,GACvB,SAAS,OAAO,IAAI,KAAK,aAAa,KAAK,CAAC;CAEhD,CAAC;CACD,OAAO;AACT;ACjBA,MAAa,sBAAsB;AACnC,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;AACpC,MAAa,+BAA+B;AAC5C,MAAa,6BAAgD;;CAE3D,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;AAChB;AAED,SAAgB,gBAAgB,OAAkC,MAAc,KAAK,IAAG,GAAE;CACxF,MAAM,UAAU,OAAO,KAAI;CAC3B,IAAI,CAAC,SACH,OAAO;CAET,MAAM,UAAU,OAAO,OAAO;CAC9B,IAAI,OAAO,SAAS,OAAO,KAAK,WAAW,GACzC,OAAO,UAAU;CAEnB,MAAM,OAAO,KAAK,MAAM,OA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,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAqB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAArB,OAAA,QAAA,GAAA,gBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAqB,cAAA;EAAA,MAAA;EAAA,MAAA;CAAA,CAAA;;AAArB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EADjC,MAAA;EAAK,MAAA,CAAA;GAAE,MAAM;GAAqB,MAAM;EAAK,CAAE"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { DOCUMENT } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { DestroyRef, Directive, ElementRef, Renderer2, afterNextRender, afterRenderEffect, booleanAttribute, inject, input, numberAttribute, output, signal } from "@angular/core";
|
|
4
|
+
const split = (classes) => (classes ?? "").split(/\s+/).filter(Boolean);
|
|
5
|
+
var TxInView = class TxInView {
|
|
6
|
+
element = inject(ElementRef).nativeElement;
|
|
7
|
+
renderer = inject(Renderer2);
|
|
8
|
+
view = inject(DOCUMENT).defaultView;
|
|
9
|
+
threshold = input(.3, {
|
|
10
|
+
...ngDevMode ? { debugName: "threshold" } : /* istanbul ignore next */ {},
|
|
11
|
+
transform: numberAttribute
|
|
12
|
+
});
|
|
13
|
+
rootMargin = input("0px", ...ngDevMode ? [{ debugName: "rootMargin" }] : /* istanbul ignore next */ []);
|
|
14
|
+
once = input(true, {
|
|
15
|
+
...ngDevMode ? { debugName: "once" } : /* istanbul ignore next */ {},
|
|
16
|
+
transform: booleanAttribute
|
|
17
|
+
});
|
|
18
|
+
enterClass = input(void 0, ...ngDevMode ? [{ debugName: "enterClass" }] : /* istanbul ignore next */ []);
|
|
19
|
+
leaveClass = input(void 0, ...ngDevMode ? [{ debugName: "leaveClass" }] : /* istanbul ignore next */ []);
|
|
20
|
+
entered = output();
|
|
21
|
+
left = output();
|
|
22
|
+
isInView = signal(false, ...ngDevMode ? [{ debugName: "isInView" }] : /* istanbul ignore next */ []);
|
|
23
|
+
constructor() {
|
|
24
|
+
const destroyRef = inject(DestroyRef);
|
|
25
|
+
afterNextRender(() => {
|
|
26
|
+
const Observer = this.view?.IntersectionObserver;
|
|
27
|
+
if (!Observer) {
|
|
28
|
+
this.update(true);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const observer = new Observer((entries) => {
|
|
32
|
+
const visible = entries.some((entry) => entry.isIntersecting);
|
|
33
|
+
if (visible === this.isInView()) return;
|
|
34
|
+
this.update(visible);
|
|
35
|
+
if (visible && this.once()) observer.disconnect();
|
|
36
|
+
}, {
|
|
37
|
+
threshold: this.threshold(),
|
|
38
|
+
rootMargin: this.rootMargin()
|
|
39
|
+
});
|
|
40
|
+
observer.observe(this.element);
|
|
41
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
update(visible) {
|
|
45
|
+
this.isInView.set(visible);
|
|
46
|
+
const [add, remove] = visible ? [this.enterClass(), this.leaveClass()] : [this.leaveClass(), this.enterClass()];
|
|
47
|
+
split(remove).forEach((name) => this.renderer.removeClass(this.element, name));
|
|
48
|
+
split(add).forEach((name) => this.renderer.addClass(this.element, name));
|
|
49
|
+
if (visible) this.entered.emit();
|
|
50
|
+
else this.left.emit();
|
|
51
|
+
}
|
|
52
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
53
|
+
minVersion: "12.0.0",
|
|
54
|
+
version: "22.2.3",
|
|
55
|
+
ngImport: i0,
|
|
56
|
+
type: TxInView,
|
|
57
|
+
deps: [],
|
|
58
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
59
|
+
});
|
|
60
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
61
|
+
minVersion: "17.1.0",
|
|
62
|
+
version: "22.2.3",
|
|
63
|
+
type: TxInView,
|
|
64
|
+
isStandalone: true,
|
|
65
|
+
selector: "[txInView]",
|
|
66
|
+
inputs: {
|
|
67
|
+
threshold: {
|
|
68
|
+
classPropertyName: "threshold",
|
|
69
|
+
publicName: "threshold",
|
|
70
|
+
isSignal: true,
|
|
71
|
+
isRequired: false,
|
|
72
|
+
transformFunction: null
|
|
73
|
+
},
|
|
74
|
+
rootMargin: {
|
|
75
|
+
classPropertyName: "rootMargin",
|
|
76
|
+
publicName: "rootMargin",
|
|
77
|
+
isSignal: true,
|
|
78
|
+
isRequired: false,
|
|
79
|
+
transformFunction: null
|
|
80
|
+
},
|
|
81
|
+
once: {
|
|
82
|
+
classPropertyName: "once",
|
|
83
|
+
publicName: "once",
|
|
84
|
+
isSignal: true,
|
|
85
|
+
isRequired: false,
|
|
86
|
+
transformFunction: null
|
|
87
|
+
},
|
|
88
|
+
enterClass: {
|
|
89
|
+
classPropertyName: "enterClass",
|
|
90
|
+
publicName: "enterClass",
|
|
91
|
+
isSignal: true,
|
|
92
|
+
isRequired: false,
|
|
93
|
+
transformFunction: null
|
|
94
|
+
},
|
|
95
|
+
leaveClass: {
|
|
96
|
+
classPropertyName: "leaveClass",
|
|
97
|
+
publicName: "leaveClass",
|
|
98
|
+
isSignal: true,
|
|
99
|
+
isRequired: false,
|
|
100
|
+
transformFunction: null
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
outputs: {
|
|
104
|
+
entered: "entered",
|
|
105
|
+
left: "left"
|
|
106
|
+
},
|
|
107
|
+
host: { properties: { "class.tx-in-view": "isInView()" } },
|
|
108
|
+
exportAs: ["txInView"],
|
|
109
|
+
ngImport: i0
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
113
|
+
minVersion: "12.0.0",
|
|
114
|
+
version: "22.2.3",
|
|
115
|
+
ngImport: i0,
|
|
116
|
+
type: TxInView,
|
|
117
|
+
decorators: [{
|
|
118
|
+
type: Directive,
|
|
119
|
+
args: [{
|
|
120
|
+
selector: "[txInView]",
|
|
121
|
+
exportAs: "txInView",
|
|
122
|
+
host: { "[class.tx-in-view]": "isInView()" }
|
|
123
|
+
}]
|
|
124
|
+
}],
|
|
125
|
+
ctorParameters: () => [],
|
|
126
|
+
propDecorators: {
|
|
127
|
+
threshold: [{
|
|
128
|
+
type: i0.Input,
|
|
129
|
+
args: [{
|
|
130
|
+
isSignal: true,
|
|
131
|
+
alias: "threshold",
|
|
132
|
+
required: false
|
|
133
|
+
}]
|
|
134
|
+
}],
|
|
135
|
+
rootMargin: [{
|
|
136
|
+
type: i0.Input,
|
|
137
|
+
args: [{
|
|
138
|
+
isSignal: true,
|
|
139
|
+
alias: "rootMargin",
|
|
140
|
+
required: false
|
|
141
|
+
}]
|
|
142
|
+
}],
|
|
143
|
+
once: [{
|
|
144
|
+
type: i0.Input,
|
|
145
|
+
args: [{
|
|
146
|
+
isSignal: true,
|
|
147
|
+
alias: "once",
|
|
148
|
+
required: false
|
|
149
|
+
}]
|
|
150
|
+
}],
|
|
151
|
+
enterClass: [{
|
|
152
|
+
type: i0.Input,
|
|
153
|
+
args: [{
|
|
154
|
+
isSignal: true,
|
|
155
|
+
alias: "enterClass",
|
|
156
|
+
required: false
|
|
157
|
+
}]
|
|
158
|
+
}],
|
|
159
|
+
leaveClass: [{
|
|
160
|
+
type: i0.Input,
|
|
161
|
+
args: [{
|
|
162
|
+
isSignal: true,
|
|
163
|
+
alias: "leaveClass",
|
|
164
|
+
required: false
|
|
165
|
+
}]
|
|
166
|
+
}],
|
|
167
|
+
entered: [{
|
|
168
|
+
type: i0.Output,
|
|
169
|
+
args: ["entered"]
|
|
170
|
+
}],
|
|
171
|
+
left: [{
|
|
172
|
+
type: i0.Output,
|
|
173
|
+
args: ["left"]
|
|
174
|
+
}]
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
var TxVisibleOnScroll = class TxVisibleOnScroll {
|
|
178
|
+
host = inject(ElementRef).nativeElement;
|
|
179
|
+
view = inject(DOCUMENT).defaultView;
|
|
180
|
+
emitted = /* @__PURE__ */ new Set();
|
|
181
|
+
ids = /* @__PURE__ */ new Map();
|
|
182
|
+
observer = null;
|
|
183
|
+
items = input([], {
|
|
184
|
+
...ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {},
|
|
185
|
+
alias: "txVisibleOnScroll"
|
|
186
|
+
});
|
|
187
|
+
visibleRatio = input(.99, {
|
|
188
|
+
...ngDevMode ? { debugName: "visibleRatio" } : /* istanbul ignore next */ {},
|
|
189
|
+
transform: numberAttribute
|
|
190
|
+
});
|
|
191
|
+
itemVisible = output();
|
|
192
|
+
constructor() {
|
|
193
|
+
inject(DestroyRef).onDestroy(() => this.observer?.disconnect());
|
|
194
|
+
afterRenderEffect(() => this.sync(this.items()));
|
|
195
|
+
}
|
|
196
|
+
sync(items) {
|
|
197
|
+
const Observer = this.view?.IntersectionObserver;
|
|
198
|
+
if (!Observer) return;
|
|
199
|
+
const pending = new Set(items.filter((item) => !item.ignore).map((item) => item.id));
|
|
200
|
+
this.emitted.forEach((id) => !pending.has(id) && this.emitted.delete(id));
|
|
201
|
+
this.observer?.disconnect();
|
|
202
|
+
this.ids.clear();
|
|
203
|
+
this.observer = new Observer((entries) => this.check(entries), {
|
|
204
|
+
root: this.host,
|
|
205
|
+
threshold: [this.visibleRatio()]
|
|
206
|
+
});
|
|
207
|
+
items.forEach((item, index) => {
|
|
208
|
+
const child = this.host.children[index];
|
|
209
|
+
if (child && !item.ignore && !this.emitted.has(item.id)) {
|
|
210
|
+
this.ids.set(child, item.id);
|
|
211
|
+
this.observer?.observe(child);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
check(entries) {
|
|
216
|
+
for (const entry of entries) {
|
|
217
|
+
const id = this.ids.get(entry.target);
|
|
218
|
+
if (id === void 0 || !entry.isIntersecting || entry.intersectionRatio < this.visibleRatio() || this.emitted.has(id)) continue;
|
|
219
|
+
this.emitted.add(id);
|
|
220
|
+
this.observer?.unobserve(entry.target);
|
|
221
|
+
this.itemVisible.emit(id);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
225
|
+
minVersion: "12.0.0",
|
|
226
|
+
version: "22.2.3",
|
|
227
|
+
ngImport: i0,
|
|
228
|
+
type: TxVisibleOnScroll,
|
|
229
|
+
deps: [],
|
|
230
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
231
|
+
});
|
|
232
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
233
|
+
minVersion: "17.1.0",
|
|
234
|
+
version: "22.2.3",
|
|
235
|
+
type: TxVisibleOnScroll,
|
|
236
|
+
isStandalone: true,
|
|
237
|
+
selector: "[txVisibleOnScroll]",
|
|
238
|
+
inputs: {
|
|
239
|
+
items: {
|
|
240
|
+
classPropertyName: "items",
|
|
241
|
+
publicName: "txVisibleOnScroll",
|
|
242
|
+
isSignal: true,
|
|
243
|
+
isRequired: false,
|
|
244
|
+
transformFunction: null
|
|
245
|
+
},
|
|
246
|
+
visibleRatio: {
|
|
247
|
+
classPropertyName: "visibleRatio",
|
|
248
|
+
publicName: "visibleRatio",
|
|
249
|
+
isSignal: true,
|
|
250
|
+
isRequired: false,
|
|
251
|
+
transformFunction: null
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
outputs: { itemVisible: "itemVisible" },
|
|
255
|
+
exportAs: ["txVisibleOnScroll"],
|
|
256
|
+
ngImport: i0
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
260
|
+
minVersion: "12.0.0",
|
|
261
|
+
version: "22.2.3",
|
|
262
|
+
ngImport: i0,
|
|
263
|
+
type: TxVisibleOnScroll,
|
|
264
|
+
decorators: [{
|
|
265
|
+
type: Directive,
|
|
266
|
+
args: [{
|
|
267
|
+
selector: "[txVisibleOnScroll]",
|
|
268
|
+
exportAs: "txVisibleOnScroll"
|
|
269
|
+
}]
|
|
270
|
+
}],
|
|
271
|
+
ctorParameters: () => [],
|
|
272
|
+
propDecorators: {
|
|
273
|
+
items: [{
|
|
274
|
+
type: i0.Input,
|
|
275
|
+
args: [{
|
|
276
|
+
isSignal: true,
|
|
277
|
+
alias: "txVisibleOnScroll",
|
|
278
|
+
required: false
|
|
279
|
+
}]
|
|
280
|
+
}],
|
|
281
|
+
visibleRatio: [{
|
|
282
|
+
type: i0.Input,
|
|
283
|
+
args: [{
|
|
284
|
+
isSignal: true,
|
|
285
|
+
alias: "visibleRatio",
|
|
286
|
+
required: false
|
|
287
|
+
}]
|
|
288
|
+
}],
|
|
289
|
+
itemVisible: [{
|
|
290
|
+
type: i0.Output,
|
|
291
|
+
args: ["itemVisible"]
|
|
292
|
+
}]
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
export { TxInView, TxVisibleOnScroll };
|
|
296
|
+
|
|
297
|
+
//# sourceMappingURL=tectra-ng-utils-in-view.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-in-view.mjs","names":[],"sources":["../../../../packages/utils/in-view/src/in-view.directive.ts","../../../../packages/utils/in-view/src/visible-on-scroll.directive.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, Renderer2, afterNextRender, booleanAttribute, inject, input, numberAttribute, output, signal } from '@angular/core';\n\nconst split = (classes: string | undefined): string[] => (classes ?? '').split(/\\s+/).filter(Boolean);\n\n@Directive({\n selector: '[txInView]',\n exportAs: 'txInView',\n host: { '[class.tx-in-view]': 'isInView()' },\n})\nexport class TxInView {\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly renderer = inject(Renderer2);\n private readonly view = inject(DOCUMENT).defaultView;\n\n readonly threshold = input<number, unknown>(0.3, { transform: numberAttribute });\n readonly rootMargin = input<string>('0px');\n readonly once = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly enterClass = input<string | undefined>(undefined);\n readonly leaveClass = input<string | undefined>(undefined);\n\n readonly entered = output<void>();\n readonly left = output<void>();\n\n readonly isInView = signal(false);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const Observer = this.view?.IntersectionObserver;\n if (!Observer) {\n this.update(true);\n return;\n }\n const observer = new Observer(\n (entries) => {\n const visible = entries.some((entry) => entry.isIntersecting);\n if (visible === this.isInView()) {\n return;\n }\n this.update(visible);\n if (visible && this.once()) {\n observer.disconnect();\n }\n },\n { threshold: this.threshold(), rootMargin: this.rootMargin() },\n );\n observer.observe(this.element);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n private update(visible: boolean): void {\n this.isInView.set(visible);\n const [add, remove] = visible ? [this.enterClass(), this.leaveClass()] : [this.leaveClass(), this.enterClass()];\n split(remove).forEach((name) => this.renderer.removeClass(this.element, name));\n split(add).forEach((name) => this.renderer.addClass(this.element, name));\n if (visible) {\n this.entered.emit();\n } else {\n this.left.emit();\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, afterRenderEffect, inject, input, numberAttribute, output } from '@angular/core';\n\nexport interface TxVisibleOnScrollItem {\n id: string;\n ignore?: boolean;\n}\n\n@Directive({\n selector: '[txVisibleOnScroll]',\n exportAs: 'txVisibleOnScroll',\n})\nexport class TxVisibleOnScroll {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly view = inject(DOCUMENT).defaultView;\n private readonly emitted = new Set<string>();\n private readonly ids = new Map<Element, string>();\n private observer: IntersectionObserver | null = null;\n\n readonly items = input<readonly TxVisibleOnScrollItem[]>([], { alias: 'txVisibleOnScroll' });\n readonly visibleRatio = input<number, unknown>(0.99, { transform: numberAttribute });\n\n readonly itemVisible = output<string>();\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.observer?.disconnect());\n afterRenderEffect(() => this.sync(this.items()));\n }\n\n private sync(items: readonly TxVisibleOnScrollItem[]): void {\n const Observer = this.view?.IntersectionObserver;\n if (!Observer) {\n return;\n }\n const pending = new Set(items.filter((item) => !item.ignore).map((item) => item.id));\n this.emitted.forEach((id) => !pending.has(id) && this.emitted.delete(id));\n this.observer?.disconnect();\n this.ids.clear();\n this.observer = new Observer((entries) => this.check(entries), { root: this.host, threshold: [this.visibleRatio()] });\n items.forEach((item, index) => {\n const child = this.host.children[index];\n if (child && !item.ignore && !this.emitted.has(item.id)) {\n this.ids.set(child, item.id);\n this.observer?.observe(child);\n }\n });\n }\n\n private check(entries: IntersectionObserverEntry[]): void {\n for (const entry of entries) {\n const id = this.ids.get(entry.target);\n if (id === undefined || !entry.isIntersecting || entry.intersectionRatio < this.visibleRatio() || this.emitted.has(id)) {\n continue;\n }\n this.emitted.add(id);\n this.observer?.unobserve(entry.target);\n this.itemVisible.emit(id);\n }\n }\n}\n"],"mappings":";;;AAGA,MAAM,SAAS,aAA2C,WAAW,GAAA,CAAI,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;AAOpG,IAAa,WAAb,MAAa,SAAQ;CACF,UAAU,OAAgC,UAAU,CAAC,CAAC;CACtD,WAAW,OAAO,SAAS;CAC3B,OAAO,OAAO,QAAQ,CAAC,CAAC;CAEhC,YAAY,MAAuB,IAAG;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAe,CAAA;CACpE,aAAa,MAAc,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,OAAO,MAAwB,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAClE,aAAa,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACjD,aAAa,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEjD,UAAU,OAAM;CAChB,OAAO,OAAM;C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