@bytebrand/fe-ui-core-autobahn 1.0.139 → 1.0.140
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/package.json +30 -30
- package/vdp/VdpModules.tsx +13 -15
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
|
|
5
|
-
"main": "index.ts",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"peerDependencies": {
|
|
8
|
-
"react": "^18.0.0",
|
|
9
|
-
"react-dom": "^18.0.0"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
13
|
-
"@bytebrand/fe-financing": "^5.14.20",
|
|
14
|
-
"classnames": "2.2.6",
|
|
15
|
-
"clsx": "^2.1.1",
|
|
16
|
-
"d3-format": "1.4.5",
|
|
17
|
-
"js-cookie": "^2.2.0",
|
|
18
|
-
"lodash": "^4.17.21",
|
|
19
|
-
"lucide-react": "^0.288.0",
|
|
20
|
-
"mobx-react": "^7.6.0",
|
|
21
|
-
"moment": "^2.29.1",
|
|
22
|
-
"qs": "^6.6.0",
|
|
23
|
-
"react-device-detect": "^2.1.2",
|
|
24
|
-
"react-grid-system": "^5.0.2",
|
|
25
|
-
"react-lazyload": "^3.2.0",
|
|
26
|
-
"react-scroll": "^1.9.3",
|
|
27
|
-
"react-slick": "^0.29.0",
|
|
28
|
-
"slick-carousel": "1.8.1"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
+
"version": "1.0.140",
|
|
4
|
+
"description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"react": "^18.0.0",
|
|
9
|
+
"react-dom": "^18.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
13
|
+
"@bytebrand/fe-financing": "^5.14.20",
|
|
14
|
+
"classnames": "2.2.6",
|
|
15
|
+
"clsx": "^2.1.1",
|
|
16
|
+
"d3-format": "1.4.5",
|
|
17
|
+
"js-cookie": "^2.2.0",
|
|
18
|
+
"lodash": "^4.17.21",
|
|
19
|
+
"lucide-react": "^0.288.0",
|
|
20
|
+
"mobx-react": "^7.6.0",
|
|
21
|
+
"moment": "^2.29.1",
|
|
22
|
+
"qs": "^6.6.0",
|
|
23
|
+
"react-device-detect": "^2.1.2",
|
|
24
|
+
"react-grid-system": "^5.0.2",
|
|
25
|
+
"react-lazyload": "^3.2.0",
|
|
26
|
+
"react-scroll": "^1.9.3",
|
|
27
|
+
"react-slick": "^0.29.0",
|
|
28
|
+
"slick-carousel": "1.8.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/vdp/VdpModules.tsx
CHANGED
|
@@ -2240,28 +2240,29 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
2240
2240
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2241
2241
|
}, [open, initialShowBreakdown]);
|
|
2242
2242
|
// in-sheet "Finanzierungs-/Leasingdetails" toggle (mobile): expanding the breakdown alone left
|
|
2243
|
-
// it below the fold — scroll the sheet body
|
|
2244
|
-
// the
|
|
2245
|
-
// .fin-modal--expanded's 0.35s min-height transition
|
|
2246
|
-
//
|
|
2247
|
-
//
|
|
2248
|
-
//
|
|
2243
|
+
// it below the fold — scroll the sheet body so the "Repräsentatives Beispiel" headline lands at
|
|
2244
|
+
// the top of the body (not all the way down: that hid the headline and overshot). Runs
|
|
2245
|
+
// alongside .fin-modal--expanded's own 0.35s min-height transition instead of waiting it out
|
|
2246
|
+
// or disabling it: the target is re-read every frame and clamped to the current max scroll,
|
|
2247
|
+
// so the growing sheet and the scroll finish together in one motion. Hand-rolled rAF instead
|
|
2248
|
+
// of scrollTo({behavior:'smooth'}) so the duration is ours. Collapsing doesn't scroll.
|
|
2249
2249
|
const revealBreakdownRef = React.useRef(false);
|
|
2250
2250
|
React.useEffect(() => {
|
|
2251
2251
|
if (!showBreakdown || !revealBreakdownRef.current) return;
|
|
2252
2252
|
revealBreakdownRef.current = false;
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2253
|
+
const el = mobileBreakdownRef.current;
|
|
2254
|
+
const body = el?.closest('.fin-modal-body') as HTMLElement | null | undefined;
|
|
2255
|
+
if (!el || !body) return;
|
|
2255
2256
|
const from = body.scrollTop;
|
|
2256
|
-
const
|
|
2257
|
-
if (dist <= 0) return;
|
|
2258
|
-
const duration = 300;
|
|
2257
|
+
const duration = 400;
|
|
2259
2258
|
let start: number | null = null;
|
|
2260
2259
|
let raf = 0;
|
|
2261
2260
|
const step = (now: number): void => {
|
|
2262
2261
|
if (start === null) start = now;
|
|
2263
2262
|
const p = Math.min(1, (now - start) / duration);
|
|
2264
|
-
|
|
2263
|
+
const headlineTop = el.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop;
|
|
2264
|
+
const to = Math.max(from, Math.min(headlineTop - 8, body.scrollHeight - body.clientHeight));
|
|
2265
|
+
body.scrollTop = from + (to - from) * (1 - Math.pow(1 - p, 3));
|
|
2265
2266
|
if (p < 1) raf = window.requestAnimationFrame(step);
|
|
2266
2267
|
};
|
|
2267
2268
|
raf = window.requestAnimationFrame(step);
|
|
@@ -3443,9 +3444,6 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
3443
3444
|
type="button"
|
|
3444
3445
|
onClick={() => {
|
|
3445
3446
|
revealBreakdownRef.current = !showBreakdown;
|
|
3446
|
-
// expanding: grow the sheet to full height at once (no min-height
|
|
3447
|
-
// transition) so the scroll-down above runs on a settled layout
|
|
3448
|
-
if (!showBreakdown && sheetRef.current) sheetRef.current.style.transition = 'none';
|
|
3449
3447
|
setShowBreakdown((v) => !v);
|
|
3450
3448
|
}}
|
|
3451
3449
|
style={{ ...expanderBtnStyle, justifyContent: 'center', padding: '2px 0 20px' }}>
|