@eric-emg/symphiq-components 1.2.512 → 1.2.514
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/symphiq-components.mjs +99 -44
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1958,6 +1958,32 @@ class HeaderScrollService {
|
|
|
1958
1958
|
this.log('Ignored: programmatic scroll', { scrollPosition });
|
|
1959
1959
|
return;
|
|
1960
1960
|
}
|
|
1961
|
+
const scrollDelta = scrollPosition - this.lastScrollPosition;
|
|
1962
|
+
const absScrollDelta = Math.abs(scrollDelta);
|
|
1963
|
+
this.lastScrollPosition = scrollPosition;
|
|
1964
|
+
const currentState = this.isScrolled();
|
|
1965
|
+
let desiredState = currentState;
|
|
1966
|
+
if (!currentState && scrollPosition > this.config.collapseThreshold) {
|
|
1967
|
+
desiredState = true;
|
|
1968
|
+
}
|
|
1969
|
+
else if (currentState && scrollPosition < this.config.expandThreshold) {
|
|
1970
|
+
desiredState = false;
|
|
1971
|
+
}
|
|
1972
|
+
if (currentState === desiredState) {
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
const isFastScroll = absScrollDelta > 30;
|
|
1976
|
+
const isWellPastThreshold = !currentState && scrollPosition > this.config.collapseThreshold * 2;
|
|
1977
|
+
const fastScrollBypass = isFastScroll && isWellPastThreshold && desiredState;
|
|
1978
|
+
if (fastScrollBypass) {
|
|
1979
|
+
this.log('Fast scroll bypass triggered', { scrollPosition, absScrollDelta });
|
|
1980
|
+
if (this.scrollTimeout) {
|
|
1981
|
+
clearTimeout(this.scrollTimeout);
|
|
1982
|
+
this.scrollTimeout = null;
|
|
1983
|
+
}
|
|
1984
|
+
this.applyStateChange(desiredState);
|
|
1985
|
+
return;
|
|
1986
|
+
}
|
|
1961
1987
|
const timeSinceLastChange = now - this.lastStateChangeTime;
|
|
1962
1988
|
if (timeSinceLastChange < this.config.stateChangeCooldown) {
|
|
1963
1989
|
this.log('Ignored: cooldown active', {
|
|
@@ -1967,8 +1993,6 @@ class HeaderScrollService {
|
|
|
1967
1993
|
});
|
|
1968
1994
|
return;
|
|
1969
1995
|
}
|
|
1970
|
-
const scrollDelta = scrollPosition - this.lastScrollPosition;
|
|
1971
|
-
const absScrollDelta = Math.abs(scrollDelta);
|
|
1972
1996
|
const newDirection = scrollDelta > 2 ? 'down' : scrollDelta < -2 ? 'up' : 'none';
|
|
1973
1997
|
if (newDirection !== 'none') {
|
|
1974
1998
|
if (newDirection === this.scrollDirection) {
|
|
@@ -1985,18 +2009,6 @@ class HeaderScrollService {
|
|
|
1985
2009
|
else {
|
|
1986
2010
|
this.scrollStabilityCount = 0;
|
|
1987
2011
|
}
|
|
1988
|
-
this.lastScrollPosition = scrollPosition;
|
|
1989
|
-
const currentState = this.isScrolled();
|
|
1990
|
-
let desiredState = currentState;
|
|
1991
|
-
if (!currentState && scrollPosition > this.config.collapseThreshold) {
|
|
1992
|
-
desiredState = true;
|
|
1993
|
-
}
|
|
1994
|
-
else if (currentState && scrollPosition < this.config.expandThreshold) {
|
|
1995
|
-
desiredState = false;
|
|
1996
|
-
}
|
|
1997
|
-
if (currentState === desiredState) {
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
2012
|
const isStable = this.scrollStabilityCount >= this.STABILITY_THRESHOLD;
|
|
2001
2013
|
const hasConsistentDirection = this.consecutiveDirectionCount >= 3;
|
|
2002
2014
|
const directionMatchesIntent = (desiredState && this.scrollDirection === 'down') ||
|
|
@@ -2086,18 +2098,70 @@ class HeaderScrollService {
|
|
|
2086
2098
|
this.scrollTimeout = null;
|
|
2087
2099
|
}
|
|
2088
2100
|
}
|
|
2101
|
+
applyStateChange(desiredState) {
|
|
2102
|
+
this.stateChangeCount++;
|
|
2103
|
+
this.log('STATE CHANGE #' + this.stateChangeCount, {
|
|
2104
|
+
from: this.isScrolled() ? 'collapsed' : 'expanded',
|
|
2105
|
+
to: desiredState ? 'collapsed' : 'expanded',
|
|
2106
|
+
scrollPosition: window.scrollY,
|
|
2107
|
+
willCompensate: desiredState
|
|
2108
|
+
});
|
|
2109
|
+
this.isProgrammaticScroll = true;
|
|
2110
|
+
this.isScrolled.set(desiredState);
|
|
2111
|
+
this.lastStateChangeTime = Date.now();
|
|
2112
|
+
this.scrollStabilityCount = 0;
|
|
2113
|
+
this.consecutiveDirectionCount = 0;
|
|
2114
|
+
if (desiredState) {
|
|
2115
|
+
const beforeScroll = window.scrollY;
|
|
2116
|
+
window.scrollBy(0, this.HEADER_HEIGHT_DIFF);
|
|
2117
|
+
this.log('Scroll compensation applied', {
|
|
2118
|
+
before: beforeScroll,
|
|
2119
|
+
after: window.scrollY,
|
|
2120
|
+
compensation: this.HEADER_HEIGHT_DIFF
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
setTimeout(() => {
|
|
2124
|
+
this.isProgrammaticScroll = false;
|
|
2125
|
+
this.lastScrollPosition = window.scrollY;
|
|
2126
|
+
this.log('Programmatic scroll lock released', { scrollPosition: window.scrollY });
|
|
2127
|
+
}, 400);
|
|
2128
|
+
}
|
|
2089
2129
|
handleEmbeddedScroll(scrollTop, collapseThreshold, expandThreshold) {
|
|
2090
2130
|
const now = Date.now();
|
|
2091
2131
|
if (this.isProgrammaticScroll) {
|
|
2092
2132
|
this.log('Embedded ignored: programmatic scroll', { scrollTop });
|
|
2093
2133
|
return;
|
|
2094
2134
|
}
|
|
2135
|
+
const scrollDelta = scrollTop - this.lastScrollPosition;
|
|
2136
|
+
const absScrollDelta = Math.abs(scrollDelta);
|
|
2137
|
+
this.lastScrollPosition = scrollTop;
|
|
2138
|
+
const currentState = this.isScrolled();
|
|
2139
|
+
let desiredState = currentState;
|
|
2140
|
+
if (!currentState && scrollTop > collapseThreshold) {
|
|
2141
|
+
desiredState = true;
|
|
2142
|
+
}
|
|
2143
|
+
else if (currentState && scrollTop < expandThreshold) {
|
|
2144
|
+
desiredState = false;
|
|
2145
|
+
}
|
|
2146
|
+
if (currentState === desiredState) {
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
const isFastScroll = absScrollDelta > 30;
|
|
2150
|
+
const isWellPastThreshold = !currentState && scrollTop > collapseThreshold * 2;
|
|
2151
|
+
const fastScrollBypass = isFastScroll && isWellPastThreshold && desiredState;
|
|
2152
|
+
if (fastScrollBypass) {
|
|
2153
|
+
this.log('Fast scroll bypass triggered', { scrollTop, absScrollDelta, collapseThreshold });
|
|
2154
|
+
if (this.scrollTimeout) {
|
|
2155
|
+
clearTimeout(this.scrollTimeout);
|
|
2156
|
+
this.scrollTimeout = null;
|
|
2157
|
+
}
|
|
2158
|
+
this.applyEmbeddedStateChange(desiredState, scrollTop);
|
|
2159
|
+
return;
|
|
2160
|
+
}
|
|
2095
2161
|
const timeSinceLastChange = now - this.lastStateChangeTime;
|
|
2096
2162
|
if (timeSinceLastChange < this.config.stateChangeCooldown) {
|
|
2097
2163
|
return;
|
|
2098
2164
|
}
|
|
2099
|
-
const scrollDelta = scrollTop - this.lastScrollPosition;
|
|
2100
|
-
const absScrollDelta = Math.abs(scrollDelta);
|
|
2101
2165
|
const newDirection = scrollDelta > 2 ? 'down' : scrollDelta < -2 ? 'up' : 'none';
|
|
2102
2166
|
if (newDirection !== 'none') {
|
|
2103
2167
|
if (newDirection === this.scrollDirection) {
|
|
@@ -2114,18 +2178,6 @@ class HeaderScrollService {
|
|
|
2114
2178
|
else {
|
|
2115
2179
|
this.scrollStabilityCount = 0;
|
|
2116
2180
|
}
|
|
2117
|
-
this.lastScrollPosition = scrollTop;
|
|
2118
|
-
const currentState = this.isScrolled();
|
|
2119
|
-
let desiredState = currentState;
|
|
2120
|
-
if (!currentState && scrollTop > collapseThreshold) {
|
|
2121
|
-
desiredState = true;
|
|
2122
|
-
}
|
|
2123
|
-
else if (currentState && scrollTop < expandThreshold) {
|
|
2124
|
-
desiredState = false;
|
|
2125
|
-
}
|
|
2126
|
-
if (currentState === desiredState) {
|
|
2127
|
-
return;
|
|
2128
|
-
}
|
|
2129
2181
|
const isStable = this.scrollStabilityCount >= this.STABILITY_THRESHOLD;
|
|
2130
2182
|
const hasConsistentDirection = this.consecutiveDirectionCount >= 3;
|
|
2131
2183
|
const directionMatchesIntent = (desiredState && this.scrollDirection === 'down') ||
|
|
@@ -2163,23 +2215,26 @@ class HeaderScrollService {
|
|
|
2163
2215
|
if (finalCurrentState === finalDesiredState) {
|
|
2164
2216
|
return;
|
|
2165
2217
|
}
|
|
2166
|
-
this.
|
|
2167
|
-
this.log('EMBEDDED STATE CHANGE #' + this.stateChangeCount, {
|
|
2168
|
-
from: finalCurrentState ? 'collapsed' : 'expanded',
|
|
2169
|
-
to: finalDesiredState ? 'collapsed' : 'expanded',
|
|
2170
|
-
scrollTop
|
|
2171
|
-
});
|
|
2172
|
-
this.isProgrammaticScroll = true;
|
|
2173
|
-
this.isScrolled.set(finalDesiredState);
|
|
2174
|
-
this.lastStateChangeTime = Date.now();
|
|
2175
|
-
this.scrollStabilityCount = 0;
|
|
2176
|
-
this.consecutiveDirectionCount = 0;
|
|
2177
|
-
setTimeout(() => {
|
|
2178
|
-
this.isProgrammaticScroll = false;
|
|
2179
|
-
this.lastScrollPosition = scrollTop;
|
|
2180
|
-
}, 400);
|
|
2218
|
+
this.applyEmbeddedStateChange(finalDesiredState, scrollTop);
|
|
2181
2219
|
}, this.config.debounceDelay);
|
|
2182
2220
|
}
|
|
2221
|
+
applyEmbeddedStateChange(desiredState, scrollTop) {
|
|
2222
|
+
this.stateChangeCount++;
|
|
2223
|
+
this.log('EMBEDDED STATE CHANGE #' + this.stateChangeCount, {
|
|
2224
|
+
from: this.isScrolled() ? 'collapsed' : 'expanded',
|
|
2225
|
+
to: desiredState ? 'collapsed' : 'expanded',
|
|
2226
|
+
scrollTop
|
|
2227
|
+
});
|
|
2228
|
+
this.isProgrammaticScroll = true;
|
|
2229
|
+
this.isScrolled.set(desiredState);
|
|
2230
|
+
this.lastStateChangeTime = Date.now();
|
|
2231
|
+
this.scrollStabilityCount = 0;
|
|
2232
|
+
this.consecutiveDirectionCount = 0;
|
|
2233
|
+
setTimeout(() => {
|
|
2234
|
+
this.isProgrammaticScroll = false;
|
|
2235
|
+
this.lastScrollPosition = scrollTop;
|
|
2236
|
+
}, 400);
|
|
2237
|
+
}
|
|
2183
2238
|
static { this.ɵfac = function HeaderScrollService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HeaderScrollService)(); }; }
|
|
2184
2239
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HeaderScrollService, factory: HeaderScrollService.ɵfac, providedIn: 'root' }); }
|
|
2185
2240
|
}
|
|
@@ -96868,7 +96923,7 @@ class SymphiqProfileFocusAreasAnalysesDashboardComponent {
|
|
|
96868
96923
|
type: HostListener,
|
|
96869
96924
|
args: ['window:scroll', ['$event']]
|
|
96870
96925
|
}] }); })();
|
|
96871
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqProfileFocusAreasAnalysesDashboardComponent, { className: "SymphiqProfileFocusAreasAnalysesDashboardComponent", filePath: "lib/components/profile-analyses-focus-areas-dashboard/symphiq-profile-focus-areas-analyses-dashboard.component.ts", lineNumber:
|
|
96926
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqProfileFocusAreasAnalysesDashboardComponent, { className: "SymphiqProfileFocusAreasAnalysesDashboardComponent", filePath: "lib/components/profile-analyses-focus-areas-dashboard/symphiq-profile-focus-areas-analyses-dashboard.component.ts", lineNumber: 682 }); })();
|
|
96872
96927
|
|
|
96873
96928
|
const _c0$6 = () => [];
|
|
96874
96929
|
function SymphiqProfileFocusAreaDashboardComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|