@haloduck/ui 2.0.29 → 2.0.31
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 +14 -17
- package/fesm2022/haloduck-ui.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
package/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -2893,7 +2893,7 @@ class AutoLoadDirective {
|
|
|
2893
2893
|
ngZone = inject(NgZone);
|
|
2894
2894
|
observer;
|
|
2895
2895
|
isLoading = false;
|
|
2896
|
-
|
|
2896
|
+
hasTriggeredOnce = false;
|
|
2897
2897
|
autoLoadEnabled = true;
|
|
2898
2898
|
autoLoadThreshold = 0.1;
|
|
2899
2899
|
autoLoadRootMargin = '0px';
|
|
@@ -2927,29 +2927,26 @@ class AutoLoadDirective {
|
|
|
2927
2927
|
if (this.isLoading || !this.autoLoadEnabled) {
|
|
2928
2928
|
return;
|
|
2929
2929
|
}
|
|
2930
|
-
//
|
|
2931
|
-
//
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
// 옵저버를 일시적으로 해제하여 연속 트리거 방지
|
|
2940
|
-
this.temporarilyDisableObserver();
|
|
2941
|
-
}
|
|
2942
|
-
this.hasLoadedOnce = true;
|
|
2930
|
+
// 첫 번째 로드는 건너뛰고, 이후부터는 보일 때마다 자동 로드
|
|
2931
|
+
// if (this.hasTriggeredOnce) {
|
|
2932
|
+
this.isLoading = true;
|
|
2933
|
+
this.autoLoadTrigger.emit();
|
|
2934
|
+
// 옵저버를 일시적으로 해제하여 연속 트리거 방지
|
|
2935
|
+
this.temporarilyDisableObserver();
|
|
2936
|
+
// } else {
|
|
2937
|
+
// this.hasTriggeredOnce = true;
|
|
2938
|
+
// }
|
|
2943
2939
|
}
|
|
2944
2940
|
temporarilyDisableObserver() {
|
|
2945
2941
|
if (this.observer) {
|
|
2946
2942
|
this.observer.disconnect();
|
|
2947
|
-
//
|
|
2943
|
+
// 1초 후 옵저버 재연결
|
|
2948
2944
|
setTimeout(() => {
|
|
2949
2945
|
if (this.autoLoadEnabled && this.observer) {
|
|
2946
|
+
this.isLoading = false;
|
|
2950
2947
|
this.observer.observe(this.elementRef.nativeElement);
|
|
2951
2948
|
}
|
|
2952
|
-
},
|
|
2949
|
+
}, 1000);
|
|
2953
2950
|
}
|
|
2954
2951
|
}
|
|
2955
2952
|
disconnect() {
|
|
@@ -2963,7 +2960,7 @@ class AutoLoadDirective {
|
|
|
2963
2960
|
}
|
|
2964
2961
|
// 자동 로드를 재활성화하는 메서드
|
|
2965
2962
|
resetAutoLoad() {
|
|
2966
|
-
this.
|
|
2963
|
+
this.hasTriggeredOnce = false;
|
|
2967
2964
|
this.isLoading = false;
|
|
2968
2965
|
}
|
|
2969
2966
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AutoLoadDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|