@haloduck/ui 2.0.26 → 2.0.28
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/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -3007,6 +3007,12 @@ class TableComponent {
|
|
|
3007
3007
|
.subscribe(() => {
|
|
3008
3008
|
this.setupIntersectionObserver();
|
|
3009
3009
|
});
|
|
3010
|
+
// 데이터 행 렌더링 변화에 맞춰 센티널 타겟을 재지정
|
|
3011
|
+
this.dataRows?.changes
|
|
3012
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
3013
|
+
.subscribe(() => {
|
|
3014
|
+
this.setupIntersectionObserver();
|
|
3015
|
+
});
|
|
3010
3016
|
const container = this.scrollContainer?.nativeElement;
|
|
3011
3017
|
this.scrollListenerTarget = container || (typeof window !== 'undefined' ? window : undefined);
|
|
3012
3018
|
if (this.scrollListenerTarget) {
|
|
@@ -3038,7 +3044,7 @@ class TableComponent {
|
|
|
3038
3044
|
this.intersectionObserver = new IntersectionObserver(this.onIntersection, {
|
|
3039
3045
|
root: rootElement || undefined,
|
|
3040
3046
|
rootMargin: '0px 0px 200px 0px',
|
|
3041
|
-
threshold: 0.
|
|
3047
|
+
threshold: 0.05,
|
|
3042
3048
|
});
|
|
3043
3049
|
this.intersectionObserver.observe(target);
|
|
3044
3050
|
});
|
|
@@ -3054,20 +3060,17 @@ class TableComponent {
|
|
|
3054
3060
|
for (const entry of entries) {
|
|
3055
3061
|
if (!entry.isIntersecting)
|
|
3056
3062
|
continue;
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
if (!this.hasObservedOnce && !allowWithoutScroll) {
|
|
3060
|
-
// 내부 스크롤 컨테이너가 있고 첫 교차는 무시
|
|
3063
|
+
// 첫 교차는 무시하여 초기 붙자마자의 즉시 트리거 방지
|
|
3064
|
+
if (!this.hasObservedOnce) {
|
|
3061
3065
|
this.hasObservedOnce = true;
|
|
3062
3066
|
continue;
|
|
3063
3067
|
}
|
|
3064
|
-
// 마지막 키가 존재, 로딩 아님, 그리고
|
|
3068
|
+
// 마지막 키가 존재, 로딩 아님, 그리고 실제 스크롤이 있었을 때만 로드
|
|
3065
3069
|
Promise.all([
|
|
3066
3070
|
firstValueFrom(this.lastEvaluatedKey.pipe(take(1))),
|
|
3067
3071
|
firstValueFrom(this.isLoading.pipe(take(1))),
|
|
3068
3072
|
]).then(([lastKey, isLoading]) => {
|
|
3069
|
-
|
|
3070
|
-
if (!(lastKey && !isLoading && scrolledOk)) {
|
|
3073
|
+
if (!(lastKey && !isLoading && this.didScrollSinceLastLoad)) {
|
|
3071
3074
|
return;
|
|
3072
3075
|
}
|
|
3073
3076
|
// 중복 호출 방지: 즉시 관찰 해제 후 로드 트리거
|