@bytebrand/fe-ui-core-autobahn 1.0.53 → 1.0.55

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.
@@ -3,8 +3,8 @@
3
3
  // Pure data only — no DOM, no store access, no further imports. Split out of the package-root
4
4
  // `constants.ts` barrel so this file (and its importers) can be required WITHOUT also pulling in
5
5
  // `./constants/Search` (which `require()`s image assets — webpack-only, breaks any plain Node
6
- // consumer). `data/toAutobahnCar.ts` imports directly from here for that reason — see
7
- // [[meta-aia-marketing-image-generation]]. `constants.ts` re-exports everything here unchanged.
6
+ // consumer). `data/toAutobahnCar.ts` imports directly from here for that reason.
7
+ // `constants.ts` re-exports everything here unchanged.
8
8
  //
9
9
  // NOTE on counts: the BODY_TYPES / QUICK_FILTERS sample counts below are the design's
10
10
  // placeholder figures. They are only used by the W2 filter UI, which will replace them with
package/constants/core.ts CHANGED
@@ -35,7 +35,7 @@ export const LOCAL_STORAGE_KEY = {
35
35
  i18n_KEY: 'i18nLanguage'
36
36
  };
37
37
 
38
- export const DEFAULT_LANG: string = typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : 'de';
38
+ export const DEFAULT_LANG: string = (typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null) ?? 'de';
39
39
 
40
40
  export const ROW_STYLES = {
41
41
  marginBottom: 10
@@ -137,8 +137,8 @@ const CBD_DE_FALLBACK: Record<string, string> = {
137
137
  multimedia_bluetooth: 'Bluetooth',
138
138
  };
139
139
 
140
- /** translate a cbd:* selector code → human label. Exported: also used by the Meta AIA
141
- * marketing-image renderer (plain Node backend, no i18next — relies on the built-in de fallback). */
140
+ /** translate a cbd:* selector code → human label — the built-in de fallback applies whenever
141
+ * no `t` is injected (e.g. no i18next available). */
142
142
  export function cbd(code: any, t?: (key: string, options?: object) => string): string {
143
143
  if (code == null || code === 'N/A') return '';
144
144
  const key = String(code);
@@ -213,9 +213,8 @@ export function mapRating(currentSalesPrice?: number, predicted?: number): { rat
213
213
  /**
214
214
  * Map the 5-tier rating to a 2-tone signal — only 'top'/'good' read as a genuinely good deal
215
215
  * (green); 'fair'/'raised'/'high' all get the warn/peach tone (Figma: "Erhöhter-Preis" is
216
- * peach, not green). Pure/non-React on purpose: shared by the web card's StatChip (via
217
- * cards/cardParts.tsx's re-export) AND the Meta AIA marketing-image renderer (a plain Node
218
- * service that can't import React components).
216
+ * peach, not green). Pure/non-React on purpose: shared by the web card's StatChip via
217
+ * cards/cardParts.tsx's re-export.
219
218
  */
220
219
  export function ratingTone(rating: string): 'good' | 'warn' {
221
220
  return rating === 'top' || rating === 'good' ? 'good' : 'warn';
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.53",
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. A small set of pure, asset-require-free leaf modules (see tsconfig.node-safe.json) additionally ship a compiled .js/.d.ts sibling next to their .ts source, so plain-Node backends (e.g. image-generator's Meta AIA renderer) can require() them directly without a bundler — frontend consumers are unaffected (webpack resolves .ts/.tsx before .js).",
3
+ "version": "1.0.55",
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
5
  "main": "index.ts",
6
- "scripts": {
7
- "build:node-safe": "tsc -p tsconfig.node-safe.json"
8
- },
9
6
  "license": "UNLICENSED",
10
7
  "peerDependencies": {
11
8
  "react": "^18.0.0",
@@ -21,7 +21,7 @@ export const formatTimestamp = ({ timestamp, format = 'X', parseFormat }: IForma
21
21
  // try to parse number timestamp as unix timestamp in case if parseFormat is not specified
22
22
  // use undefined for string timestamps with no parseFormat in hope that it will either be
23
23
  // ISO 8601 or RFC 2822 and moment will be able to figure it out
24
- let parseAs: string = parseFormat;
24
+ let parseAs: string | undefined = parseFormat;
25
25
  if (!parseFormat && typeof timestamp === 'number') parseAs = 'X';
26
26
  return moment.utc(timestamp, parseAs).format(format);
27
27
  };
@@ -2,10 +2,11 @@
2
2
  //
3
3
  // Pulled out on purpose: CommonUtils.ts transitively imports `../constants/Search`, which
4
4
  // `require()`s image assets (webpack-only — breaks any plain Node `require`/`tsc` consumer).
5
- // This file only imports `../constants/price` (zero further imports), so the Meta AIA
6
- // marketing-image renderer (a plain Node backend, see ../data/toAutobahnCar.ts's `mapRating`)
7
- // can import real Preisbewertung math without dragging in frontend-only asset requires.
8
- // CommonUtils.ts re-exports these for existing consumers — one implementation, not a fork.
5
+ // This file only imports `../constants/price` (zero further imports) — a pure, testable leaf
6
+ // module. CommonUtils.ts re-exports these for existing consumers — one implementation, not a fork.
7
+ // (image-generator's Meta AIA renderer vendors a copy of this math directly instead of depending
8
+ // on this package — see services/image-generator/src/services/metaAia/vendoredAutobahnMath.ts —
9
+ // so a plain-Node backend doesn't need to npm-install this whole design system's dependency tree.)
9
10
  import { priceRatings, priceRatingConfig } from '../constants/price';
10
11
  import { PREDICTABLE_PRICE_INDEX } from '../constants/core';
11
12
 
package/cards/types.d.ts DELETED
@@ -1,112 +0,0 @@
1
- /** Pkw-EnVKV plug-in-hybrid consumption block (only present for PHEV cars). */
2
- export interface AutobahnPhev {
3
- /** electric consumption, e.g. '17,3 kWh/100 km'. */
4
- consEl: string;
5
- /** fuel consumption (weighted, combined), e.g. '1,2 l/100 km'. */
6
- consFuel: string;
7
- /** consumption when battery is discharged, e.g. '6,4 l/100 km'. */
8
- consDis: string;
9
- /** weighted combined CO₂, e.g. '28 g/km'. */
10
- co2w: string;
11
- /** CO₂ class (weighted). */
12
- co2classW: string;
13
- /** CO₂ class (discharged). */
14
- co2classD: string;
15
- }
16
- /**
17
- * View-model for a single car as rendered by the Autobahn car cards.
18
- *
19
- * REQUIRED fields are always populated with real data.
20
- * OPTIONAL fields (`?`) have no real data source yet — when absent the cards
21
- * render the 'Daten folgt' marker rather than inventing a value.
22
- */
23
- export interface AutobahnCar {
24
- make: string;
25
- model: string;
26
- trim: string;
27
- /** mileage in km (raw number; formatted de-DE by the cards). */
28
- km: number;
29
- /** first registration, e.g. '03/2021'. */
30
- reg: string;
31
- /** power label, e.g. '110 kW (150 PS)'. */
32
- power: string;
33
- /** fuel label, e.g. 'Benzin' / 'Plug-in-Hybrid'. */
34
- fuel: string;
35
- /** gearbox label, e.g. 'Automatik' / 'Schaltgetriebe'. */
36
- gear: string;
37
- /** number of previous owners (rendered as 'N. Hand'). */
38
- owners: number;
39
- /** financing monthly rate in EUR — the LEAD price on every card. */
40
- monthly: number;
41
- /**
42
- * financing terms the `monthly` rate was computed with — the per-car merged
43
- * config (dealer rate + the user's saved localStorage adjustments, ADV-157).
44
- * Absent → the card falls back to the fe-financing default-config terms.
45
- */
46
- finFirstInstallment?: number;
47
- finMonths?: number;
48
- /** purchase price in EUR (raw number; formatted de-DE by the cards). */
49
- price: number;
50
- /** ready-to-use image URLs for the carousel. */
51
- gallery: string[];
52
- /** total photo count for the image-count badge. */
53
- photos: number;
54
- /** combined fuel consumption label, e.g. '5,4 l/100 km'. */
55
- cons: string;
56
- /** combined CO₂ emissions label, e.g. '124 g/km'. */
57
- co2: string;
58
- /** CO₂ efficiency class letter, e.g. 'B'. */
59
- co2class: string;
60
- /** present only for plug-in hybrids — drives the dual-figure EnVKV line. */
61
- phev?: AutobahnPhev;
62
- /** equipment highlight chips (first few are shown on the row card). */
63
- features: string[];
64
- /** price rating tone: 'fair' → warn pill, anything else → good pill. */
65
- rating: string;
66
- /** price rating label shown in the pill, e.g. 'Guter Preis'. */
67
- ratingLabel: string;
68
- /** true → show the "NEU" badge (legacy showNewLabel: new / recently-listed car). */
69
- isNew?: boolean;
70
- /**
71
- * struck-through previous financing rate (getFinancing.ts `oldMonthlyInstallment`), gated by
72
- * the same real isStrikeShown flag as `listPrice`/`savings`. Absent → no strike under the
73
- * Finanzierung tab's hero rate.
74
- */
75
- oldMonthly?: number;
76
- /** struck-through previous leasing rate (getLeasing.ts `oldMonthlyInstallment`), same gating. */
77
- oldLease?: number;
78
- /** availability label, e.g. 'Sofort verfügbar' (offer.availabilityMode). Absent → not shown. */
79
- availability?: string;
80
- /** percent price reduction (price.historyPriceDifferencePerCent) — pairs with `drop` for the −X% badge. */
81
- dropPct?: number;
82
- /** 0 € Anzahlung available (offer.showDownPayment) — drives the "0 € Anz." badge. */
83
- zeroDown?: boolean;
84
- /** original list price (for the struck-through reference price). */
85
- listPrice?: number;
86
- /** savings vs. list price in EUR (gates the savings/strike UI; >600 to show). */
87
- savings?: number;
88
- /** real price reduction on THIS car in EUR (gates the DropChip). */
89
- drop?: number;
90
- /** lowest comparable market price in EUR (market band lower bound). */
91
- marketLow?: number;
92
- /** average comparable market price in EUR (market band reference). */
93
- marketAvg?: number;
94
- /** highest comparable market price in EUR (market band upper bound). */
95
- marketHigh?: number;
96
- /** leasing monthly rate in EUR. */
97
- lease?: number;
98
- /**
99
- * leasing terms the `lease` rate was computed with — per-car merged config,
100
- * same as finFirstInstallment/finMonths. Absent → default-config terms.
101
- */
102
- leaseMileage?: number;
103
- leaseMonths?: number;
104
- /** number of buyers currently watching this car. */
105
- watchers?: number;
106
- /** number of recent views (drives the 'vor N Std' cue). */
107
- views?: number;
108
- /** total detail-page views (stats totalCarImpCount) — shown as the eye pill under the image. */
109
- viewsCount?: number;
110
- /** total users who favorited this car (stats totalFavCount) — shown as the heart pill under the image. */
111
- favoritesCount?: number;
112
- }
package/cards/types.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- // Autobahn (auto.de redesign) — car-card view-model type.
3
- //
4
- // Typed contract for the ported car cards (CarCard / CarRow). This is a pure
5
- // presentational view-model: the cards receive a fully-resolved `AutobahnCar`
6
- // and never touch the store, API or `window`.
7
- //
8
- // IMPORTANT — needs-data discipline:
9
- // The REQUIRED fields below always carry real data from the search/listing
10
- // source. The OPTIONAL fields are ones we have NO real source for yet; they are
11
- // `?`-optional ON PURPOSE so the components can detect their absence and render
12
- // the `NEEDS_DATA_LABEL` ('Daten folgt') marker instead of a fabricated number.
13
- // Never default these to placeholder values.
14
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
1
- /** Pkw-EnVKV CO₂ efficiency classes (best → worst) and their band colors. */
2
- export declare const CO2_CLASSES: readonly ["A", "B", "C", "D", "E", "F", "G"];
3
- export type Co2Class = (typeof CO2_CLASSES)[number];
4
- export declare const CO2_COLORS: readonly string[];
5
- /** Preisbewertung (price-rating) tiers, index 0 = Top … 4 = Hoch. green → red. */
6
- export declare const TIER_LABELS: readonly ["Top Preis", "Guter Preis", "Fairer Preis", "Erhöht", "Hoher Preis"];
7
- export declare const TIER_KEYS: readonly ["top", "good", "fair", "raised", "high"];
8
- export declare const TIER_COLORS: readonly string[];
9
- export type RatingTier = 0 | 1 | 2 | 3 | 4;
10
- /** SRP sort options (labels match the design; mapped to real sort params by the SRP container). */
11
- export declare const SORTS: readonly ["Relevanz", "Preis aufsteigend", "Preis absteigend", "Erstzulassung", "Kilometerstand", "Leistung"];
12
- export type SortLabel = (typeof SORTS)[number];
13
- /** Quick-filter chips for the srp-bar: [lucide icon, label, defaultActive?]. */
14
- export type QuickFilter = readonly [icon: string, label: string, defaultActive?: boolean];
15
- export declare const QUICK_FILTERS: readonly QuickFilter[];
16
- /** Brand shortlist for the Marke select (full list comes from appStore.manufacturers at runtime). */
17
- export declare const BRANDS: readonly string[];
18
- /** Body-type tiles: [label, lucide icon, placeholder count]. Counts are design placeholders (W2 → real aggregations). */
19
- export type BodyType = readonly [label: string, icon: string, placeholderCount: string];
20
- export declare const BODY_TYPES: readonly BodyType[];
21
- /** Marker text rendered wherever the design shows a field we have no real data source for yet. */
22
- export declare const NEEDS_DATA_LABEL = "Daten folgt";
@@ -1,57 +0,0 @@
1
- "use strict";
2
- // Autobahn (auto.de redesign) — shared lookup constants.
3
- // Typed replacement for the design kit's `window.*` globals (data.jsx / ui.jsx / CdpModules.jsx).
4
- // Pure data only — no DOM, no store access, no further imports. Split out of the package-root
5
- // `constants.ts` barrel so this file (and its importers) can be required WITHOUT also pulling in
6
- // `./constants/Search` (which `require()`s image assets — webpack-only, breaks any plain Node
7
- // consumer). `data/toAutobahnCar.ts` imports directly from here for that reason — see
8
- // [[meta-aia-marketing-image-generation]]. `constants.ts` re-exports everything here unchanged.
9
- //
10
- // NOTE on counts: the BODY_TYPES / QUICK_FILTERS sample counts below are the design's
11
- // placeholder figures. They are only used by the W2 filter UI, which will replace them with
12
- // REAL aggregation counts from searchStore.aggregation. They are not rendered as real data in W1.
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.NEEDS_DATA_LABEL = exports.BODY_TYPES = exports.BRANDS = exports.QUICK_FILTERS = exports.SORTS = exports.TIER_COLORS = exports.TIER_KEYS = exports.TIER_LABELS = exports.CO2_COLORS = exports.CO2_CLASSES = void 0;
15
- /** Pkw-EnVKV CO₂ efficiency classes (best → worst) and their band colors. */
16
- exports.CO2_CLASSES = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
17
- exports.CO2_COLORS = [
18
- '#1FA01F', '#5DAE2E', '#9FC21C', '#F2C200', '#F2900D', '#E8601A', '#D4202B',
19
- ];
20
- /** Preisbewertung (price-rating) tiers, index 0 = Top … 4 = Hoch. green → red. */
21
- exports.TIER_LABELS = ['Top Preis', 'Guter Preis', 'Fairer Preis', 'Erhöht', 'Hoher Preis'];
22
- // i18n key suffixes parallel to TIER_LABELS — components render t('autobahn:tier.<key>') so the
23
- // Preisbewertung label localizes (TIER_LABELS stays the German source-of-truth used for tier→index logic).
24
- exports.TIER_KEYS = ['top', 'good', 'fair', 'raised', 'high'];
25
- exports.TIER_COLORS = ['#0F7B43', '#4FA86B', '#C7B53A', '#E08A2B', '#D4502B'];
26
- /** SRP sort options (labels match the design; mapped to real sort params by the SRP container). */
27
- exports.SORTS = [
28
- 'Relevanz',
29
- 'Preis aufsteigend',
30
- 'Preis absteigend',
31
- 'Erstzulassung',
32
- 'Kilometerstand',
33
- 'Leistung',
34
- ];
35
- exports.QUICK_FILTERS = [
36
- ['sliders-horizontal', 'Filter', true],
37
- ['fuel', 'Diesel'],
38
- ['cog', 'Automatik'],
39
- ['battery-charging', 'Hybrid'],
40
- ['gauge', 'bis 50.000 km'],
41
- ['wallet', 'bis 300 €/mtl.'],
42
- ['calendar', 'ab 2022'],
43
- ];
44
- /** Brand shortlist for the Marke select (full list comes from appStore.manufacturers at runtime). */
45
- exports.BRANDS = [
46
- 'VW', 'Mercedes-Benz', 'BMW', 'Audi', 'Opel', 'Škoda', 'Ford', 'Hyundai',
47
- ];
48
- exports.BODY_TYPES = [
49
- ['Kleinwagen', 'car', '4.812'],
50
- ['Limousine', 'car-front', '5.530'],
51
- ['Kombi', 'caravan', '6.118'],
52
- ['SUV', 'truck', '7.940'],
53
- ['Cabrio', 'wind', '1.270'],
54
- ['Van', 'bus', '2.691'],
55
- ];
56
- /** Marker text rendered wherever the design shows a field we have no real data source for yet. */
57
- exports.NEEDS_DATA_LABEL = 'Daten folgt';
@@ -1,152 +0,0 @@
1
- export declare enum N {
2
- ZERO = 0,
3
- ONE = 1,
4
- TWO = 2,
5
- THREE = 3,
6
- FOUR = 4,
7
- FIVE = 5,
8
- FOURTEEN = 14,
9
- FIFTEEN = 15,
10
- HUNDRED = 100,
11
- THOUSAND = 1000
12
- }
13
- export declare const THREE = 3;
14
- export declare const FOUR = 4;
15
- export declare const FIVE = 5;
16
- export declare const FIFTEEN = 15;
17
- export declare const FOURTEEN = 14;
18
- export declare const HUNDRED = 100;
19
- export declare const THOUSAND = 1000;
20
- export declare const PREDICTABLE_PRICE_INDEX = 1.07814;
21
- export declare const CONTAINER_STYLES: {
22
- display: string;
23
- flexDirection: string;
24
- alignItems: string;
25
- justifyContent: string;
26
- };
27
- export declare const LOCAL_STORAGE_KEY: {
28
- JWT_TOKEN_KEY: string;
29
- JWT_USER_NAME_KEY: string;
30
- i18n_KEY: string;
31
- };
32
- export declare const DEFAULT_LANG: string;
33
- export declare const ROW_STYLES: {
34
- marginBottom: number;
35
- };
36
- export declare const COLUMN_STYLES: {
37
- padding: number;
38
- boxSizing: string;
39
- };
40
- export declare const ONLINE_SINCE_KEY: string;
41
- export declare const CONSUMPTION_KEY: string;
42
- export declare const EMISSION_CLASS_KEY: string;
43
- export declare const EMISSION_STICKER_KEY: string;
44
- export declare const PARTICULATE_FILTER_KEY: string;
45
- export declare const GENERAL_INSPECTION_KEY: string;
46
- export declare const DELIVERY_PERIODS_EXTRA: {
47
- label: RegExpMatchArray;
48
- value: string;
49
- }[];
50
- export declare const WLTP_ENERGY_EFFICIENCY_CLASS: string[];
51
- export declare const offers: ({
52
- name: string;
53
- periods: number[];
54
- sliders: ({
55
- name: string;
56
- min: number;
57
- step: number;
58
- unit: string;
59
- withRangeLimit: boolean;
60
- max?: undefined;
61
- } | {
62
- name: string;
63
- min: number;
64
- max: number;
65
- step: number;
66
- unit: string;
67
- withRangeLimit?: undefined;
68
- })[];
69
- isActive?: undefined;
70
- } | {
71
- name: string;
72
- periods: number[];
73
- sliders: ({
74
- name: string;
75
- min: number;
76
- step: number;
77
- unit: string;
78
- max?: undefined;
79
- } | {
80
- name: string;
81
- min: number;
82
- max: number;
83
- step: number;
84
- unit: string;
85
- })[];
86
- isActive?: undefined;
87
- } | {
88
- name: string;
89
- periods?: undefined;
90
- sliders?: undefined;
91
- isActive?: undefined;
92
- } | {
93
- name: string;
94
- periods: number[];
95
- isActive: boolean;
96
- sliders?: undefined;
97
- })[];
98
- export declare const checkoutOffers: ({
99
- name: string;
100
- periods: number[];
101
- sliders: ({
102
- name: string;
103
- min: number;
104
- step: number;
105
- unit: string;
106
- max?: undefined;
107
- } | {
108
- name: string;
109
- min: number;
110
- max: number;
111
- step: number;
112
- unit: string;
113
- })[];
114
- isActive?: undefined;
115
- } | {
116
- name: string;
117
- periods?: undefined;
118
- sliders?: undefined;
119
- isActive?: undefined;
120
- } | {
121
- name: string;
122
- periods: number[];
123
- isActive: boolean;
124
- sliders?: undefined;
125
- })[];
126
- export declare const comparableKeys: string[];
127
- export declare const aboColorOptions: string[];
128
- export declare const aboIncludedServices: string[];
129
- export declare const aboFaq: string[];
130
- export declare const checkoutWarranties: ({
131
- name: string;
132
- color0: string;
133
- color1: string;
134
- isWarrantyActive: boolean;
135
- } | {
136
- name: string;
137
- color0: string;
138
- color1: string;
139
- isWarrantyActive?: undefined;
140
- })[];
141
- export declare const checkoutStepUrls: string[];
142
- export declare const checkoutSteps: {
143
- pathname: string;
144
- component: string;
145
- props: string;
146
- minutes: number;
147
- }[];
148
- export declare const checkoutSubStep: {
149
- pathname: string;
150
- component: string;
151
- props: string;
152
- };
package/constants/core.js DELETED
@@ -1,124 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkoutSubStep = exports.checkoutSteps = exports.checkoutStepUrls = exports.checkoutWarranties = exports.aboFaq = exports.aboIncludedServices = exports.aboColorOptions = exports.comparableKeys = exports.checkoutOffers = exports.offers = exports.WLTP_ENERGY_EFFICIENCY_CLASS = exports.DELIVERY_PERIODS_EXTRA = exports.GENERAL_INSPECTION_KEY = exports.PARTICULATE_FILTER_KEY = exports.EMISSION_STICKER_KEY = exports.EMISSION_CLASS_KEY = exports.CONSUMPTION_KEY = exports.ONLINE_SINCE_KEY = exports.COLUMN_STYLES = exports.ROW_STYLES = exports.DEFAULT_LANG = exports.LOCAL_STORAGE_KEY = exports.CONTAINER_STYLES = exports.PREDICTABLE_PRICE_INDEX = exports.THOUSAND = exports.HUNDRED = exports.FOURTEEN = exports.FIFTEEN = exports.FIVE = exports.FOUR = exports.THREE = exports.N = void 0;
4
- const selectors_1 = require("./selectors");
5
- var N;
6
- (function (N) {
7
- N[N["ZERO"] = 0] = "ZERO";
8
- N[N["ONE"] = 1] = "ONE";
9
- N[N["TWO"] = 2] = "TWO";
10
- N[N["THREE"] = 3] = "THREE";
11
- N[N["FOUR"] = 4] = "FOUR";
12
- N[N["FIVE"] = 5] = "FIVE";
13
- N[N["FOURTEEN"] = 14] = "FOURTEEN";
14
- N[N["FIFTEEN"] = 15] = "FIFTEEN";
15
- N[N["HUNDRED"] = 100] = "HUNDRED";
16
- N[N["THOUSAND"] = 1000] = "THOUSAND";
17
- })(N || (exports.N = N = {}));
18
- // interface IPriceTabs {
19
- // fin: number[];
20
- // leasing: number[];
21
- // buy: number[];
22
- // abo: number[];
23
- // [key: string]: any;
24
- // }
25
- exports.THREE = 3; // tab index
26
- exports.FOUR = 4; // tab index
27
- exports.FIVE = 5; // tab index
28
- exports.FIFTEEN = 15; // font-size
29
- exports.FOURTEEN = 14;
30
- exports.HUNDRED = 100;
31
- exports.THOUSAND = 1000;
32
- exports.PREDICTABLE_PRICE_INDEX = 1.07814;
33
- exports.CONTAINER_STYLES = {
34
- display: 'flex',
35
- flexDirection: 'row',
36
- alignItems: 'stretch',
37
- justifyContent: 'center'
38
- };
39
- exports.LOCAL_STORAGE_KEY = {
40
- JWT_TOKEN_KEY: 'auto_jwt_token',
41
- JWT_USER_NAME_KEY: 'auto_jwt_username',
42
- i18n_KEY: 'i18nLanguage'
43
- };
44
- exports.DEFAULT_LANG = typeof window !== 'undefined' ? window.localStorage.getItem(exports.LOCAL_STORAGE_KEY.i18n_KEY) : 'de';
45
- exports.ROW_STYLES = {
46
- marginBottom: 10
47
- };
48
- exports.COLUMN_STYLES = {
49
- padding: 10,
50
- boxSizing: 'border-box'
51
- };
52
- exports.ONLINE_SINCE_KEY = 'ONLINE_SINCE';
53
- exports.CONSUMPTION_KEY = 'CONSUMPTION';
54
- // detailed search keys
55
- exports.EMISSION_CLASS_KEY = 'EMISSION_CLASS';
56
- exports.EMISSION_STICKER_KEY = 'EMISSION_STICKER';
57
- exports.PARTICULATE_FILTER_KEY = 'PARTICULATE_FILTER';
58
- exports.GENERAL_INSPECTION_KEY = 'GENERAL_INSPECTION';
59
- exports.DELIVERY_PERIODS_EXTRA = selectors_1.DELIVERY_PERIODS.map((val) => ({
60
- label: val.match(/\d+/),
61
- value: val
62
- }));
63
- exports.WLTP_ENERGY_EFFICIENCY_CLASS = [
64
- "selector_energyEfficiencyClass_a",
65
- "selector_energyEfficiencyClass_b",
66
- "selector_energyEfficiencyClass_c",
67
- "selector_energyEfficiencyClass_d",
68
- "selector_energyEfficiencyClass_e",
69
- "selector_energyEfficiencyClass_f",
70
- "selector_energyEfficiencyClass_g"
71
- ];
72
- exports.offers = [
73
- {
74
- name: 'financing',
75
- periods: [12, 24, 36, 48, 60, 72, 84, 96], // tslint:disable-line
76
- sliders: [
77
- { name: 'firstInstallment', min: 0, step: 100, unit: 'euro', withRangeLimit: true }, // tslint:disable-line
78
- { name: 'annualMileage', min: 5000, max: 60000, step: 5000, unit: 'km' } // tslint:disable-line
79
- ]
80
- },
81
- {
82
- name: 'leasing',
83
- periods: [30, 36, 42, 48, 54, 60], // tslint:disable-line
84
- sliders: [
85
- { name: 'firstInstallment', min: 0, step: 100, unit: 'euro' }, // tslint:disable-line
86
- { name: 'annualMileage', min: 5000, max: 60000, step: 5000, unit: 'km' } // tslint:disable-line
87
- ]
88
- },
89
- { name: 'buy' },
90
- { name: 'abo', periods: [1, 2, 6, 9, 12, 18], isActive: false } // tslint:disable-line
91
- ];
92
- exports.checkoutOffers = [exports.offers[0], exports.offers[1], exports.offers[exports.THREE], exports.offers[2]];
93
- exports.comparableKeys = ['paybackPeriod', 'annualMileage', 'firstInstallment', 'withAddServices', 'withTransportation'];
94
- exports.aboColorOptions = ['black', 'grey', 'white', 'blue'];
95
- exports.aboIncludedServices = [
96
- 'KFZ-Versicherung (Haftpflicht, Teil- & Vollkasko)',
97
- '4 Jahre Garantie',
98
- 'Wartung, Verschleiß & wintertaugliche Reifen',
99
- 'Zulassung',
100
- 'Steuer'
101
- ];
102
- exports.aboFaq = [
103
- 'Wer kann dieses Abo buchen?',
104
- 'Wie erfolgen Übergabe und Ruckgabe?',
105
- 'Wie lang ist die Laufzeit?',
106
- 'Was kostet ein Auto Abo?'
107
- ];
108
- exports.checkoutWarranties = [
109
- { name: 'silver', color0: '#A2A0A3', color1: '#D6D6D6', isWarrantyActive: true },
110
- { name: 'bronze', color0: '#A18151', color1: '#E9BC79' },
111
- { name: 'gold', color0: '#F2D88F', color1: '#B79D62' },
112
- { name: 'no-warranty', color0: '#F2D88F', color1: '#B79D62' }
113
- ];
114
- exports.checkoutStepUrls = [
115
- 'contact-information', 'payment-type', 'payment-details', 'additional-services', 'order-overview', 'additional-services-delivery'
116
- ];
117
- exports.checkoutSteps = [
118
- { pathname: 'contact-information', component: 'ContactInformation', props: 'contactInformationProps', minutes: 2 },
119
- { pathname: 'payment-type', component: 'PaymentType', props: 'paymentTypeProps', minutes: 1 },
120
- { pathname: 'payment-details', component: 'PaymentDetails', props: 'paymentDetailsProps', minutes: 2 },
121
- { pathname: 'additional-services', component: 'AdditionalServices', props: 'additionalServicesProps', minutes: 2 },
122
- { pathname: 'order-overview', component: 'OrderOverview', props: 'orderOverviewProps', minutes: 1 }
123
- ];
124
- exports.checkoutSubStep = { pathname: 'additional-services-delivery', component: 'DeliveryServices', props: 'deliveryServicesProps' };
@@ -1,2 +0,0 @@
1
- export declare const priceRatings: string[];
2
- export declare const priceRatingConfig: any;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.priceRatingConfig = exports.priceRatings = void 0;
4
- exports.priceRatings = ['noRating', 'highPrice', 'increasedPrice', 'fairPrice', 'goodPrice', 'topPrice'];
5
- exports.priceRatingConfig = {
6
- topPrice: { min: -25, max: -9 },
7
- goodPrice: { min: -9, max: -4 },
8
- fairPrice: { min: -4, max: 4 },
9
- increasedPrice: { min: 4, max: 17 },
10
- highPrice: { min: 17, max: 25 }
11
- };
@@ -1,11 +0,0 @@
1
- export declare const BODY_TYPES: string[];
2
- export declare const FUEL_TYPES: string[];
3
- export declare const TRANSMISSION_TYPES: string[];
4
- export declare const DRIVE_TYPES: string[];
5
- export declare const EXTERIOR_COLORS: string[];
6
- export declare const INTERIOR_COLORS: string[];
7
- export declare const INTERIOR_TYPES: string[];
8
- export declare const HIGHLIGHTS_TYPES: string[];
9
- export declare const EMISSION_CLASS: string[];
10
- export declare const EMISSION_STICKERS: string[];
11
- export declare const DELIVERY_PERIODS: string[];
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DELIVERY_PERIODS = exports.EMISSION_STICKERS = exports.EMISSION_CLASS = exports.HIGHLIGHTS_TYPES = exports.INTERIOR_TYPES = exports.INTERIOR_COLORS = exports.EXTERIOR_COLORS = exports.DRIVE_TYPES = exports.TRANSMISSION_TYPES = exports.FUEL_TYPES = exports.BODY_TYPES = void 0;
4
- const car_schema_selectors_1 = require("@bytebrand/car-schema-selectors");
5
- // Basic data
6
- exports.BODY_TYPES = car_schema_selectors_1.selectors.category
7
- .filter(category => category !== 'selector_unknown');
8
- // Engine | Transmission | Drive
9
- exports.FUEL_TYPES = car_schema_selectors_1.selectors.fuel
10
- .filter(fuel => fuel !== 'selector_unknown');
11
- exports.TRANSMISSION_TYPES = car_schema_selectors_1.selectors.gearbox
12
- .filter((gearbox) => gearbox !== 'selector_unknown');
13
- exports.DRIVE_TYPES = car_schema_selectors_1.selectors.driveType
14
- .filter((driveType) => driveType !== 'selector_unknown');
15
- // Color | Pad
16
- exports.EXTERIOR_COLORS = car_schema_selectors_1.selectors.exteriorColor
17
- .filter((color) => color !== 'selector_unknown');
18
- exports.INTERIOR_COLORS = car_schema_selectors_1.selectors.interiorColor
19
- .filter((color) => color !== 'selector_unknown');
20
- exports.INTERIOR_TYPES = car_schema_selectors_1.selectors.interiorType
21
- .filter((color) => color !== 'selector_unknown');
22
- // Highlights
23
- exports.HIGHLIGHTS_TYPES = Object.keys(car_schema_selectors_1.selectors.highlights)
24
- .map((key) => car_schema_selectors_1.selectors.highlights[key].tkey);
25
- // Environment
26
- exports.EMISSION_CLASS = car_schema_selectors_1.selectors.emissionClass
27
- .filter((emClass) => emClass !== 'selector_unknown');
28
- exports.EMISSION_STICKERS = car_schema_selectors_1.selectors.emissionSticker
29
- .filter((sticker) => sticker !== 'selector_unknown');
30
- // Availability
31
- exports.DELIVERY_PERIODS = car_schema_selectors_1.selectors.deliveryPeriod
32
- .filter((deliveryPeriod) => deliveryPeriod !== 'selector_unknown');