@rivet-health/design-system 41.1.1 → 41.1.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.
|
@@ -651,8 +651,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
651
651
|
}]
|
|
652
652
|
});
|
|
653
653
|
var LockScrollDirective = class LockScrollDirective {
|
|
654
|
-
constructor(context) {
|
|
654
|
+
constructor(context, documentRef) {
|
|
655
655
|
this.context = context;
|
|
656
|
+
this.documentRef = documentRef;
|
|
656
657
|
this.lock = false;
|
|
657
658
|
}
|
|
658
659
|
ngOnInit() {
|
|
@@ -670,16 +671,20 @@ var LockScrollDirective = class LockScrollDirective {
|
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
673
|
lockScroll() {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
674
|
+
const body = this.documentRef.body;
|
|
675
|
+
if (!body) return;
|
|
676
|
+
this.context.scrollPosition = this.documentRef.documentElement.scrollTop;
|
|
677
|
+
body.style.position = "fixed";
|
|
678
|
+
body.style.overflow = "hidden";
|
|
679
|
+
body.style.width = "100%";
|
|
680
|
+
body.style.height = "100%";
|
|
681
|
+
body.style.top = `${this.context.scrollPosition * -1}px`;
|
|
679
682
|
}
|
|
680
683
|
unlockScroll() {
|
|
681
|
-
|
|
682
|
-
|
|
684
|
+
const body = this.documentRef.body;
|
|
685
|
+
if (!body) return;
|
|
686
|
+
body.removeAttribute("style");
|
|
687
|
+
this.documentRef.documentElement.scrollTop = this.context.scrollPosition;
|
|
683
688
|
}
|
|
684
689
|
static {
|
|
685
690
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -687,7 +692,7 @@ var LockScrollDirective = class LockScrollDirective {
|
|
|
687
692
|
version: "22.2.4",
|
|
688
693
|
ngImport: i0,
|
|
689
694
|
type: LockScrollDirective,
|
|
690
|
-
deps: [{ token: LockScrollContextService }],
|
|
695
|
+
deps: [{ token: LockScrollContextService }, { token: DOCUMENT }],
|
|
691
696
|
target: i0.ɵɵFactoryTarget.Directive
|
|
692
697
|
});
|
|
693
698
|
}
|
|
@@ -715,7 +720,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
715
720
|
standalone: false
|
|
716
721
|
}]
|
|
717
722
|
}],
|
|
718
|
-
ctorParameters: () => [{ type: LockScrollContextService }
|
|
723
|
+
ctorParameters: () => [{ type: LockScrollContextService }, {
|
|
724
|
+
type: Document,
|
|
725
|
+
decorators: [{
|
|
726
|
+
type: Inject,
|
|
727
|
+
args: [DOCUMENT]
|
|
728
|
+
}]
|
|
729
|
+
}],
|
|
719
730
|
propDecorators: { lock: [{
|
|
720
731
|
type: Input,
|
|
721
732
|
args: ["rivLockScroll"]
|