@salesforcedevs/mrkt-components
Advanced tools
Comparing version 0.41.0 to 0.53.5-alpha
{ | ||
"name": "@salesforcedevs/mrkt-components", | ||
"version": "0.41.0", | ||
"version": "0.53.5-alpha", | ||
"description": "Marketing Lightning web components for DSC", | ||
@@ -17,4 +17,3 @@ "license": "MIT", | ||
"@types/classnames": "^2.2.10" | ||
}, | ||
"gitHead": "363477b8997dcd990c2d668b03ee0142334d7815" | ||
} | ||
} |
@@ -6,3 +6,2 @@ import { LightningElement, api } from "lwc"; | ||
@api dark!: boolean; | ||
@api title!: string; | ||
@api imgSrc!: string; | ||
@@ -9,0 +8,0 @@ @api imgSrcMobile?: string; |
@@ -9,2 +9,3 @@ import { api, LightningElement } from "lwc"; | ||
@api imgSrcRight?: string; | ||
@api overlapImages?: boolean = false; | ||
@api lightGradient?: boolean; | ||
@@ -27,5 +28,6 @@ @api subtitle?: string; | ||
this.lightGradient && "light-gradient", | ||
this.subtitle && "has-subtitle" | ||
this.subtitle && "has-subtitle", | ||
this.overlapImages && "overlap-images" | ||
); | ||
} | ||
} |
@@ -9,2 +9,4 @@ import { api } from "lwc"; | ||
@api subscribeHref!: string; | ||
@api containerQuery: string = "body"; | ||
@api showAtId?: string; | ||
@@ -27,3 +29,3 @@ @api | ||
private _navItems!: OptionWithLink[]; | ||
private isVisible: boolean = true; | ||
private isVisible: boolean = false; | ||
private sectionIntersectionEntryMap: | ||
@@ -36,2 +38,11 @@ | { | ||
private get containerElement(): HTMLElement { | ||
return document.querySelector(this.containerQuery) as HTMLElement; | ||
} | ||
private get showAtElement(): HTMLElement { | ||
const id = this.showAtId || this.hashIds[0]; | ||
return document.getElementById(id) as HTMLElement; | ||
} | ||
private get className(): string { | ||
@@ -72,3 +83,3 @@ return cx("subnav", !this.isVisible && "hide"); | ||
this.onPageScroll(); | ||
window.addEventListener("scroll", this.onPageScroll); | ||
this.containerElement?.addEventListener("scroll", this.onPageScroll); | ||
} | ||
@@ -79,9 +90,8 @@ | ||
this.sectionsObserver.disconnect(); | ||
window.removeEventListener("scroll", this.onPageScroll); | ||
this.containerElement?.removeEventListener("scroll", this.onPageScroll); | ||
} | ||
private onPageScroll = () => { | ||
const firstSection = document.getElementById(this.hashIds[0]); | ||
if (firstSection) { | ||
this.isVisible = firstSection.getBoundingClientRect().y <= 1; | ||
if (this.showAtElement) { | ||
this.isVisible = this.showAtElement.getBoundingClientRect().y <= 1; | ||
} | ||
@@ -114,3 +124,3 @@ }; | ||
private scrollToTop() { | ||
window.scroll({ | ||
this.containerElement.scroll({ | ||
top: 0, | ||
@@ -117,0 +127,0 @@ left: 0, |
@@ -9,4 +9,5 @@ import { api, LightningElement } from "lwc"; | ||
@api buttonLabel!: string; | ||
@api buttonHref!: string; | ||
@api imgSrc!: string; | ||
@api imgAlt!: string; | ||
} |
@@ -9,2 +9,5 @@ import { api, LightningElement } from "lwc"; | ||
iconSymbol: string; | ||
iconSprite: string; | ||
iconColor: string; | ||
iconBackgroundColor: string; | ||
}; | ||
@@ -11,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
1139
40994
38