diff --git a/public/datasheets/h1z2z2-k-de.pdf b/public/datasheets/h1z2z2-k-de.pdf index 1a144567..68df66ab 100644 Binary files a/public/datasheets/h1z2z2-k-de.pdf and b/public/datasheets/h1z2z2-k-de.pdf differ diff --git a/public/datasheets/h1z2z2-k-en.pdf b/public/datasheets/h1z2z2-k-en.pdf index cf2d47cc..c65cc192 100644 Binary files a/public/datasheets/h1z2z2-k-en.pdf and b/public/datasheets/h1z2z2-k-en.pdf differ diff --git a/public/datasheets/n2x2y-2-de.pdf b/public/datasheets/n2x2y-2-de.pdf index f1eed8e8..e6e4bae5 100644 Binary files a/public/datasheets/n2x2y-2-de.pdf and b/public/datasheets/n2x2y-2-de.pdf differ diff --git a/public/datasheets/n2x2y-en.pdf b/public/datasheets/n2x2y-en.pdf index 87a23f27..1d519341 100644 Binary files a/public/datasheets/n2x2y-en.pdf and b/public/datasheets/n2x2y-en.pdf differ diff --git a/public/datasheets/n2xfk2y-de.pdf b/public/datasheets/n2xfk2y-de.pdf index a4c4e38d..c9dee340 100644 Binary files a/public/datasheets/n2xfk2y-de.pdf and b/public/datasheets/n2xfk2y-de.pdf differ diff --git a/public/datasheets/n2xfk2y-en.pdf b/public/datasheets/n2xfk2y-en.pdf index cf746489..2828f14d 100644 Binary files a/public/datasheets/n2xfk2y-en.pdf and b/public/datasheets/n2xfk2y-en.pdf differ diff --git a/public/datasheets/n2xfkld2y-de.pdf b/public/datasheets/n2xfkld2y-de.pdf index a1cf72b1..bc6e6f5e 100644 Binary files a/public/datasheets/n2xfkld2y-de.pdf and b/public/datasheets/n2xfkld2y-de.pdf differ diff --git a/public/datasheets/n2xfkld2y-en.pdf b/public/datasheets/n2xfkld2y-en.pdf index 2e141f1a..ed49ffc2 100644 Binary files a/public/datasheets/n2xfkld2y-en.pdf and b/public/datasheets/n2xfkld2y-en.pdf differ diff --git a/public/datasheets/n2xs2y-2-de.pdf b/public/datasheets/n2xs2y-2-de.pdf index fb4cc23a..bc803b9b 100644 Binary files a/public/datasheets/n2xs2y-2-de.pdf and b/public/datasheets/n2xs2y-2-de.pdf differ diff --git a/public/datasheets/n2xs2y-en.pdf b/public/datasheets/n2xs2y-en.pdf index a55a6c4f..5d5be756 100644 Binary files a/public/datasheets/n2xs2y-en.pdf and b/public/datasheets/n2xs2y-en.pdf differ diff --git a/public/datasheets/n2xsf2y-2-de.pdf b/public/datasheets/n2xsf2y-2-de.pdf index d1567b48..35366c2e 100644 Binary files a/public/datasheets/n2xsf2y-2-de.pdf and b/public/datasheets/n2xsf2y-2-de.pdf differ diff --git a/public/datasheets/n2xsf2y-en.pdf b/public/datasheets/n2xsf2y-en.pdf index b883781a..1c91e149 100644 Binary files a/public/datasheets/n2xsf2y-en.pdf and b/public/datasheets/n2xsf2y-en.pdf differ diff --git a/public/datasheets/n2xsfl2y-2-de.pdf b/public/datasheets/n2xsfl2y-2-de.pdf index b04a7b31..75b09a21 100644 Binary files a/public/datasheets/n2xsfl2y-2-de.pdf and b/public/datasheets/n2xsfl2y-2-de.pdf differ diff --git a/public/datasheets/n2xsfl2y-3-en.pdf b/public/datasheets/n2xsfl2y-3-en.pdf index 937c95bc..a790db5a 100644 Binary files a/public/datasheets/n2xsfl2y-3-en.pdf and b/public/datasheets/n2xsfl2y-3-en.pdf differ diff --git a/public/datasheets/n2xsfl2y-de.pdf b/public/datasheets/n2xsfl2y-de.pdf index c7ce0cce..ff908c44 100644 Binary files a/public/datasheets/n2xsfl2y-de.pdf and b/public/datasheets/n2xsfl2y-de.pdf differ diff --git a/public/datasheets/n2xsfl2y-en.pdf b/public/datasheets/n2xsfl2y-en.pdf index 088dc213..f279d572 100644 Binary files a/public/datasheets/n2xsfl2y-en.pdf and b/public/datasheets/n2xsfl2y-en.pdf differ diff --git a/public/datasheets/n2xsy-2-de.pdf b/public/datasheets/n2xsy-2-de.pdf index c2ceb5df..6e464bdf 100644 Binary files a/public/datasheets/n2xsy-2-de.pdf and b/public/datasheets/n2xsy-2-de.pdf differ diff --git a/public/datasheets/n2xsy-en.pdf b/public/datasheets/n2xsy-en.pdf index 15c3fe0b..580012f3 100644 Binary files a/public/datasheets/n2xsy-en.pdf and b/public/datasheets/n2xsy-en.pdf differ diff --git a/public/datasheets/n2xy-2-de.pdf b/public/datasheets/n2xy-2-de.pdf index 562fdcb6..506d4f4c 100644 Binary files a/public/datasheets/n2xy-2-de.pdf and b/public/datasheets/n2xy-2-de.pdf differ diff --git a/public/datasheets/n2xy-en.pdf b/public/datasheets/n2xy-en.pdf index 00d81f25..c1fe00e0 100644 Binary files a/public/datasheets/n2xy-en.pdf and b/public/datasheets/n2xy-en.pdf differ diff --git a/public/datasheets/na2x2y-2-de.pdf b/public/datasheets/na2x2y-2-de.pdf index 56b30c6b..ec7f6cb3 100644 Binary files a/public/datasheets/na2x2y-2-de.pdf and b/public/datasheets/na2x2y-2-de.pdf differ diff --git a/public/datasheets/na2x2y-en.pdf b/public/datasheets/na2x2y-en.pdf index 7659c7ae..94cb4bb6 100644 Binary files a/public/datasheets/na2x2y-en.pdf and b/public/datasheets/na2x2y-en.pdf differ diff --git a/public/datasheets/na2xfk2y-de.pdf b/public/datasheets/na2xfk2y-de.pdf index 99786ee2..b60f15f6 100644 Binary files a/public/datasheets/na2xfk2y-de.pdf and b/public/datasheets/na2xfk2y-de.pdf differ diff --git a/public/datasheets/na2xfk2y-en.pdf b/public/datasheets/na2xfk2y-en.pdf index d67f9392..ab3611a1 100644 Binary files a/public/datasheets/na2xfk2y-en.pdf and b/public/datasheets/na2xfk2y-en.pdf differ diff --git a/public/datasheets/na2xfkld2y-de.pdf b/public/datasheets/na2xfkld2y-de.pdf index 7d3768df..868bab3e 100644 Binary files a/public/datasheets/na2xfkld2y-de.pdf and b/public/datasheets/na2xfkld2y-de.pdf differ diff --git a/public/datasheets/na2xfkld2y-en.pdf b/public/datasheets/na2xfkld2y-en.pdf index 2a6e05f4..c75b03d3 100644 Binary files a/public/datasheets/na2xfkld2y-en.pdf and b/public/datasheets/na2xfkld2y-en.pdf differ diff --git a/public/datasheets/na2xs2y-2-de.pdf b/public/datasheets/na2xs2y-2-de.pdf index 55851b34..a4994640 100644 Binary files a/public/datasheets/na2xs2y-2-de.pdf and b/public/datasheets/na2xs2y-2-de.pdf differ diff --git a/public/datasheets/na2xs2y-en.pdf b/public/datasheets/na2xs2y-en.pdf index 9baf088d..10578b51 100644 Binary files a/public/datasheets/na2xs2y-en.pdf and b/public/datasheets/na2xs2y-en.pdf differ diff --git a/public/datasheets/na2xsf2y-2-de.pdf b/public/datasheets/na2xsf2y-2-de.pdf index d30a1375..3ff80cc3 100644 Binary files a/public/datasheets/na2xsf2y-2-de.pdf and b/public/datasheets/na2xsf2y-2-de.pdf differ diff --git a/public/datasheets/na2xsf2y-en.pdf b/public/datasheets/na2xsf2y-en.pdf index 7dd37bac..2789c715 100644 Binary files a/public/datasheets/na2xsf2y-en.pdf and b/public/datasheets/na2xsf2y-en.pdf differ diff --git a/public/datasheets/na2xsfl2y-2-de.pdf b/public/datasheets/na2xsfl2y-2-de.pdf index aaf96df5..75089a0a 100644 Binary files a/public/datasheets/na2xsfl2y-2-de.pdf and b/public/datasheets/na2xsfl2y-2-de.pdf differ diff --git a/public/datasheets/na2xsfl2y-3-en.pdf b/public/datasheets/na2xsfl2y-3-en.pdf index 1c3aa8eb..b49cece2 100644 Binary files a/public/datasheets/na2xsfl2y-3-en.pdf and b/public/datasheets/na2xsfl2y-3-en.pdf differ diff --git a/public/datasheets/na2xsfl2y-de.pdf b/public/datasheets/na2xsfl2y-de.pdf index 697caa53..049b4fb4 100644 Binary files a/public/datasheets/na2xsfl2y-de.pdf and b/public/datasheets/na2xsfl2y-de.pdf differ diff --git a/public/datasheets/na2xsfl2y-en.pdf b/public/datasheets/na2xsfl2y-en.pdf index 9fcdd55f..334b6330 100644 Binary files a/public/datasheets/na2xsfl2y-en.pdf and b/public/datasheets/na2xsfl2y-en.pdf differ diff --git a/public/datasheets/na2xsy-2-de.pdf b/public/datasheets/na2xsy-2-de.pdf index 32e14bfd..02865da6 100644 Binary files a/public/datasheets/na2xsy-2-de.pdf and b/public/datasheets/na2xsy-2-de.pdf differ diff --git a/public/datasheets/na2xsy-en.pdf b/public/datasheets/na2xsy-en.pdf index 565cb36e..f9c030ae 100644 Binary files a/public/datasheets/na2xsy-en.pdf and b/public/datasheets/na2xsy-en.pdf differ diff --git a/public/datasheets/na2xy-2-de.pdf b/public/datasheets/na2xy-2-de.pdf index 7c6114e9..7f9e6e6c 100644 Binary files a/public/datasheets/na2xy-2-de.pdf and b/public/datasheets/na2xy-2-de.pdf differ diff --git a/public/datasheets/na2xy-en.pdf b/public/datasheets/na2xy-en.pdf index 1efb71fc..fe1dbaa3 100644 Binary files a/public/datasheets/na2xy-en.pdf and b/public/datasheets/na2xy-en.pdf differ diff --git a/public/datasheets/nay2y-2-de.pdf b/public/datasheets/nay2y-2-de.pdf index cf3d9fa8..44cfc4f8 100644 Binary files a/public/datasheets/nay2y-2-de.pdf and b/public/datasheets/nay2y-2-de.pdf differ diff --git a/public/datasheets/nay2y-en.pdf b/public/datasheets/nay2y-en.pdf index 1aa300ec..b6148cde 100644 Binary files a/public/datasheets/nay2y-en.pdf and b/public/datasheets/nay2y-en.pdf differ diff --git a/public/datasheets/naycwy-2-de.pdf b/public/datasheets/naycwy-2-de.pdf index 83f97239..6580f396 100644 Binary files a/public/datasheets/naycwy-2-de.pdf and b/public/datasheets/naycwy-2-de.pdf differ diff --git a/public/datasheets/naycwy-en.pdf b/public/datasheets/naycwy-en.pdf index 62db1a47..45b936d0 100644 Binary files a/public/datasheets/naycwy-en.pdf and b/public/datasheets/naycwy-en.pdf differ diff --git a/public/datasheets/nayy-2-de.pdf b/public/datasheets/nayy-2-de.pdf index 22382737..ac602717 100644 Binary files a/public/datasheets/nayy-2-de.pdf and b/public/datasheets/nayy-2-de.pdf differ diff --git a/public/datasheets/nayy-en.pdf b/public/datasheets/nayy-en.pdf index 5f37cb79..76457d46 100644 Binary files a/public/datasheets/nayy-en.pdf and b/public/datasheets/nayy-en.pdf differ diff --git a/public/datasheets/ny2y-2-de.pdf b/public/datasheets/ny2y-2-de.pdf index f73a5627..9e4fd53f 100644 Binary files a/public/datasheets/ny2y-2-de.pdf and b/public/datasheets/ny2y-2-de.pdf differ diff --git a/public/datasheets/ny2y-en.pdf b/public/datasheets/ny2y-en.pdf index 61e4fdf4..0be5a74a 100644 Binary files a/public/datasheets/ny2y-en.pdf and b/public/datasheets/ny2y-en.pdf differ diff --git a/public/datasheets/nycwy-2-de.pdf b/public/datasheets/nycwy-2-de.pdf index 04220cdb..6753f4de 100644 Binary files a/public/datasheets/nycwy-2-de.pdf and b/public/datasheets/nycwy-2-de.pdf differ diff --git a/public/datasheets/nycwy-en.pdf b/public/datasheets/nycwy-en.pdf index 22f00853..69d7f5f2 100644 Binary files a/public/datasheets/nycwy-en.pdf and b/public/datasheets/nycwy-en.pdf differ diff --git a/public/datasheets/nyy-2-de.pdf b/public/datasheets/nyy-2-de.pdf index 8c1dea5f..a36f034a 100644 Binary files a/public/datasheets/nyy-2-de.pdf and b/public/datasheets/nyy-2-de.pdf differ diff --git a/public/datasheets/nyy-en.pdf b/public/datasheets/nyy-en.pdf index 55bda7d9..6d870bef 100644 Binary files a/public/datasheets/nyy-en.pdf and b/public/datasheets/nyy-en.pdf differ diff --git a/scripts/pdf/model/build-datasheet-model.ts b/scripts/pdf/model/build-datasheet-model.ts index 016f02a5..ca84d7de 100644 --- a/scripts/pdf/model/build-datasheet-model.ts +++ b/scripts/pdf/model/build-datasheet-model.ts @@ -70,6 +70,18 @@ function parseVoltageSortKey(voltageLabel: string): number { function compactNumericForLocale(value: string, locale: 'en' | 'de'): string { const v = normalizeValue(value); if (!v) return ''; + + // Compact common bending-radius style: "15xD (Single core); 12xD (Multi core)" -> "15/12xD". + // Keep semantics, reduce width. Never truncate with ellipses. + if (/\d+xD/i.test(v)) { + const nums = Array.from(v.matchAll(/(\d+)xD/gi)).map(m => m[1]).filter(Boolean); + const unique: string[] = []; + for (const n of nums) { + if (!unique.includes(n)) unique.push(n); + } + if (unique.length) return `${unique.join('/') }xD`; + } + const hasDigit = /\d/.test(v); if (!hasDigit) return v; const trimmed = v.replace(/\s+/g, ' ').trim(); @@ -242,6 +254,12 @@ function denseAbbrevLabel(args: { key: string; locale: 'en' | 'de'; unit?: strin return args.locale === 'de' ? 'Leiter' : 'Cond.'; case 'shape': return args.locale === 'de' ? 'Form' : 'Shape'; + // Electrical + case 'cap': + // Capacitance. Use a clear label; lowercase "cap" looks like an internal key. + return `Cap${suffix}`; + case 'X': + return `X${suffix}`; case 'test_volt': return `U_test${suffix}`; case 'rated_volt': @@ -265,13 +283,14 @@ function denseAbbrevLabel(args: { key: string; locale: 'en' | 'de'; unit?: strin } } -function summarizeOptions(options: string[] | undefined, maxItems: number = 3): string { +function summarizeOptions(options: string[] | undefined): string { const vals = (options || []).map(normalizeValue).filter(Boolean); if (vals.length === 0) return ''; const uniq = Array.from(new Set(vals)); if (uniq.length === 1) return uniq[0]; - if (uniq.length <= maxItems) return uniq.join(' / '); - return `${uniq.slice(0, maxItems).join(' / ')} / ...`; + // Never use ellipsis truncation in datasheets. Prefer full value list. + // (Long values should be handled by layout; if needed we can later add wrapping rules.) + return uniq.join(' / '); } function parseNumericOption(value: string): number | null { @@ -294,10 +313,17 @@ function summarizeNumericRange(options: string[] | undefined): { ok: boolean; te return { ok: true, text: `${fmt(min)}–${fmt(max)}` }; } -function summarizeSmartOptions(label: string, options: string[] | undefined): string { +function summarizeSmartOptions(_label: string, options: string[] | undefined): string { const range = summarizeNumericRange(options); if (range.ok) return range.text; - return summarizeOptions(options, 3); + return summarizeOptions(options); +} + +function normalizeDesignation(value: string): string { + return String(value || '') + .toUpperCase() + .replace(/-\d+$/g, '') + .replace(/[^A-Z0-9]+/g, ''); } function buildExcelModel(args: { product: ProductData; locale: 'en' | 'de' }): BuildExcelModelResult { @@ -361,6 +387,14 @@ function buildExcelModel(args: { product: ProductData; locale: 'en' | 'de' }): B 'cpr class': { header: 'CPR class', unit: '', key: 'cpr' }, 'flame retardant': { header: 'Flame retardant', unit: '', key: 'flame' }, 'self-extinguishing of single cable': { header: 'Flame retardant', unit: '', key: 'flame' }, + + // High-value electrical/screen columns + 'capacitance (approx.)': { header: 'Capacitance', unit: 'uF/km', key: 'cap' }, + 'capacitance': { header: 'Capacitance', unit: 'uF/km', key: 'cap' }, + 'reactance': { header: 'Reactance', unit: 'Ohm/km', key: 'X' }, + 'diameter over screen': { header: 'Diameter over screen', unit: 'mm', key: 'D_screen' }, + 'metallic screen mm2': { header: 'Metallic screen', unit: 'mm2', key: 'S_screen' }, + 'metallic screen': { header: 'Metallic screen', unit: 'mm2', key: 'S_screen' }, }; const excelKeys = Object.keys(sample).filter(k => k && k !== 'Part Number' && k !== 'Units'); @@ -464,6 +498,10 @@ function buildExcelModel(args: { product: ProductData; locale: 'en' | 'de' }): B const denseTableKeyOrder = [ 'Cond', 'shape', + // Electrical properties (when present) + 'cap', + 'X', + // Dimensions and ratings 'DI', 'RI', 'Wi', @@ -473,6 +511,9 @@ function buildExcelModel(args: { product: ProductData; locale: 'en' | 'de' }): B 'Wm', 'Rbv', 'Ø', + // Screen data (when present) + 'D_screen', + 'S_screen', 'Fzv', 'G', ] as const; @@ -510,16 +551,33 @@ function buildExcelModel(args: { product: ProductData; locale: 'en' | 'de' }): B if (!mappedByKey.has(c.mapping.key)) mappedByKey.set(c.mapping.key, c); } + // If conductor material is missing in Excel, derive it from designation. + // NA... => Al, N... => Cu (common for this dataset). + if (!mappedByKey.has('Cond')) { + mappedByKey.set('Cond', { + excelKey: '', + mapping: { header: 'Cond.', unit: '', key: 'Cond' }, + }); + } + const orderedTableColumns = denseTableKeyOrder .filter(k => mappedByKey.has(k)) .map(k => mappedByKey.get(k)!) .map(({ excelKey, mapping }) => { - const unit = normalizeUnit(units[excelKey] || mapping.unit || ''); + const unit = normalizeUnit((excelKey ? units[excelKey] : '') || mapping.unit || ''); return { key: mapping.key, label: denseAbbrevLabel({ key: mapping.key, locale: args.locale, unit }) || formatExcelHeaderLabel(excelKey, unit), get: (rowIndex: number) => { const srcRowIndex = indices[rowIndex]; + + if (mapping.key === 'Cond' && !excelKey) { + const pn = normalizeDesignation(args.product.name || args.product.slug || args.product.sku || ''); + if (/^NA/.test(pn)) return 'Al'; + if (/^N/.test(pn)) return 'Cu'; + return ''; + } + const raw = excelKey ? normalizeValue(String(compatibleRows[srcRowIndex]?.[excelKey] ?? '')) : ''; return compactCellForDenseTable(raw, unit, args.locale); }, diff --git a/scripts/pdf/react-pdf/DatasheetDocument.tsx b/scripts/pdf/react-pdf/DatasheetDocument.tsx index 37404b09..1819a6f9 100644 --- a/scripts/pdf/react-pdf/DatasheetDocument.tsx +++ b/scripts/pdf/react-pdf/DatasheetDocument.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { Document, Image, Page, Text, View } from '@react-pdf/renderer'; import type { DatasheetModel, DatasheetVoltageTable } from '../model/types'; +import { CONFIG } from '../model/utils'; import { styles } from './styles'; import { Header } from './components/Header'; import { Footer } from './components/Footer'; @@ -25,9 +26,9 @@ function chunk(arr: T[], size: number): T[][] { export function DatasheetDocument(props: { model: DatasheetModel; assets: Assets }): React.ReactElement { const { model, assets } = props; const headerTitle = model.labels.datasheet; - const footerLeft = `${model.labels.sku}: ${model.product.sku}`; - const firstColLabel = model.locale === 'de' ? 'Adern & Querschnitt' : 'Cores & cross-section'; + // Dense tables require compact headers (no wrapping). Use standard abbreviations. + const firstColLabel = model.locale === 'de' ? 'Adern & QS' : 'Cores & CS'; const tablePages: Array<{ table: DatasheetVoltageTable; rows: DatasheetVoltageTable['rows'] }> = model.voltageTables.flatMap(t => { @@ -40,7 +41,7 @@ export function DatasheetDocument(props: { model: DatasheetModel; assets: Assets
-