@things-factory/organization 10.1.228 → 10.1.229
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/dist-client/component/department-selector.js +0 -7
- package/dist-client/component/department-selector.js.map +1 -1
- package/dist-client/pages/department/department-list-page.js +1 -1
- package/dist-client/pages/department/department-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/role-tasks.js +2 -0
- package/dist-server/role-tasks.js.map +1 -1
- package/dist-server/service/department/department-query.d.ts +1 -0
- package/dist-server/service/department/department-query.js +26 -3
- package/dist-server/service/department/department-query.js.map +1 -1
- package/dist-server/service/department/department.js +3 -1
- package/dist-server/service/department/department.js.map +1 -1
- package/dist-server/service/employee-profile/employee-profile-document.d.ts +20 -4
- package/dist-server/service/employee-profile/employee-profile-document.js +101 -39
- package/dist-server/service/employee-profile/employee-profile-document.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/tests/department-open-fields.test.ts +72 -0
- package/tests/employee-profile-document.test.ts +57 -3
- package/translations/en.json +2 -0
- package/translations/es.json +2 -0
- package/translations/ja.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"employee-profile-document.js","sourceRoot":"","sources":["../../../server/service/employee-profile/employee-profile-document.ts"],"names":[],"mappings":";;;AA8HA,wBAEC;AAGD,4BAGC;AAWD,oCAYC;AAED,wCAGC;AAGD,8BAGC;AAkBD,gDA6EC;AAGD,0CAIC;AAGD,oCAmBC;AAMD,oCAYC;AAiDD,4BAYC;AAGD,gCA0BC;AAGD,0CASC;AAiBD,gCAkBC;AA0CD,gDAEC;AAGD,kCAMC;AAGD,8CAOC;AAGD,0CAGC;AAGD,oBAEC;AAGD,wCA4CC;AAxjBD,qCAA6D;AAE7D,qEAAkD;AAwHlD,0FAA0F;AAC7E,QA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IAAI,EAAE,CAAC,CAAC,gCAAgC,CAAC;QACzC,SAAS,EAAE,CAAC,CAAC,sCAAsC,CAAC;QACpD,MAAM,EAAE,CAAC,CAAC,kCAAkC,CAAC;QAC7C,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACjF,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,yCAAyC,EAAE,EAAE,CAAC,EAAE,CAAC;QACtE,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,6CAA6C,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9E,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kCAAkC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9D,aAAa,EAAE,CAAC,CAAC,0CAA0C,CAAC;KAC7D,CAAA;AACH,CAAC","sourcesContent":["import { Borders, Style, Workbook, Worksheet } from 'exceljs'\n\nimport { todayOf } from './employee-profile-rules'\n\n/*\n * The employee profiles a quotation attaches, as a document a person can hand in as it is (ADR-0169 decisions 6 · 8):\n * a page a person, made to show what the person is worth - the name large with where they stand, the figures a buyer\n * weighs (total experience, projects delivered, certificates held), the expertise in their own words and skills, then\n * the projects first, the careers, certificates and education - laid out for A4. Several people open with a roster.\n *\n * One layout (`profileSheetLayout`, `rosterLayout`) is painted twice: as an Excel workbook, a sheet a page\n * (`profileWorkbook`), and as HTML printed to PDF, a page break a sheet (`profileHtml`). Pure - the door reads the data\n * and the pdf module prints.\n */\n\n/** A row of any of the four tables - each has some of these. */\ntype Row = {\n school?: string\n major?: string\n degree?: string\n name?: string\n issuer?: string\n acquiredOn?: string\n company?: string\n department?: string\n position?: string\n duties?: string\n client?: string\n role?: string\n technologies?: string\n startedOn?: string\n endedOn?: string\n}\n\nexport type ProfilePerson = {\n name?: string | null\n departmentName?: string | null\n jobPosition?: string | null\n jobResponsibility?: string | null\n hiredOn?: string | null\n profile?: {\n summary?: string | null\n skills?: string[] | null\n educations?: Row[] | null\n certificates?: Row[] | null\n careers?: Row[] | null\n projects?: Row[] | null\n } | null\n}\n\n/** The words of the document, in the reader's language - handed in so this stays free of i18next. */\nexport type ProfileSheetWords = Record<\n | 'title'\n | 'rosterTitle'\n | 'expertise'\n | 'name'\n | 'department'\n | 'jobPosition'\n | 'hiredOn'\n | 'careerLength'\n | 'projectsDone'\n | 'certificatesHeld'\n | 'summary'\n | 'skills'\n | 'educations'\n | 'certificates'\n | 'careers'\n | 'projects'\n | 'school'\n | 'major'\n | 'degree'\n | 'period'\n | 'certificate'\n | 'issuer'\n | 'acquiredOn'\n | 'company'\n | 'position'\n | 'duties'\n | 'project'\n | 'client'\n | 'role'\n | 'technologies'\n | 'ongoing'\n | 'none'\n | 'writtenOn'\n | 'averageCareer'\n | 'number',\n string\n> & {\n /** 「12년 3개월」 */\n years: (years: number, months: number) => string\n /** 「8건」 */\n projectCount: (count: number) => string\n /** 「3개」 */\n certificateCount: (count: number) => string\n /** 「5명」 */\n peopleCount: (count: number) => string\n}\n\n/** What a cell is - the painter styles by it. */\nexport type CellRole =\n | 'company'\n | 'kicker'\n | 'name'\n | 'tagline'\n | 'rule'\n | 'statLabel'\n | 'statValue'\n | 'section'\n | 'summary'\n | 'label'\n | 'skills'\n | 'head'\n | 'value'\n | 'none'\n\n/** A cell of the six-column grid: `col` from 1, spanning `span` columns. */\nexport type LayoutCell = { col: number; span?: number; value: string; role: CellRole }\n\n/** A line of the grid; `zebra` shades every other row of a table. */\nexport type LayoutLine = { cells: LayoutCell[]; height?: number; zebra?: boolean }\n\n/** The grid's six columns, in characters - together about the width of A4 in portrait. */\nexport const COLUMN_WIDTHS = [18, 20, 15, 12, 21, 18]\n\n/** 「2023.03」 from 「2023-03」 or 「2023-03-02」 - the dotted form a staffing profile is read in. */\nexport function dotted(day?: string | null): string {\n return (day ?? '').trim().replace(/-/g, '.')\n}\n\n/** A period as one cell - an open end is still going on. */\nexport function periodOf(startedOn: string | undefined, endedOn: string | undefined, ongoing: string): string {\n if (!startedOn && !endedOn) return ''\n return `${dotted(startedOn)} ~ ${endedOn ? dotted(endedOn) : ongoing}`.trim()\n}\n\nconst monthIndex = (day?: string | null): number | null => {\n const match = /^(\\d{4})-(\\d{2})/.exec((day ?? '').trim())\n return match ? Number(match[1]) * 12 + Number(match[2]) - 1 : null\n}\n\n/**\n * The months a person has worked: the careers before this company and the time here since the hire day, counted\n * once where they overlap. A career with no end runs to `today`; one with no start is left out.\n */\nexport function careerMonths(person: ProfilePerson, today = new Date()): number {\n const now = today.getFullYear() * 12 + today.getMonth()\n const months = new Set<number>()\n const spans = [\n ...(person.profile?.careers ?? []).map(row => [monthIndex(row.startedOn), row.endedOn ? monthIndex(row.endedOn) : now] as const),\n [monthIndex(person.hiredOn), now] as const\n ]\n for (const [from, to] of spans) {\n if (from === null || to === null) continue\n for (let month = from; month <= Math.min(to, now); month++) months.add(month)\n }\n return months.size\n}\n\nexport function careerLengthOf(person: ProfilePerson, words: ProfileSheetWords, today = new Date()): string {\n const months = careerMonths(person, today)\n return months ? words.years(Math.floor(months / 12), months % 12) : ''\n}\n\n/** Where the person stands, in one line: department · position / responsibility · hired on. */\nexport function taglineOf(person: ProfilePerson, words: ProfileSheetWords): string {\n const role = [person.jobPosition, person.jobResponsibility].filter(Boolean).join(' / ')\n return [person.departmentName, role, person.hiredOn ? `${words.hiredOn} ${dotted(person.hiredOn)}` : ''].filter(Boolean).join(' · ')\n}\n\n/** The head every page opens with: the employer and what the page is, the name large, a line under it. */\nfunction headOf(company: string, kicker: string, name: string, tagline: string): LayoutLine[] {\n return [\n {\n cells: [\n { col: 1, span: 3, value: company, role: 'company' },\n { col: 4, span: 3, value: kicker, role: 'kicker' }\n ]\n },\n { cells: [{ col: 1, span: 6, value: name, role: 'name' }], height: 40 },\n { cells: [{ col: 1, span: 6, value: tagline, role: 'tagline' }], height: 20 },\n { cells: [{ col: 1, span: 6, value: '', role: 'rule' }], height: 6 }\n ]\n}\n\n/** One person's page, line by line. `company` is the employer's name; `today` the day it is written. */\nexport function profileSheetLayout(person: ProfilePerson, words: ProfileSheetWords, company: string, today = new Date()): LayoutLine[] {\n const profile = person.profile ?? {}\n const lines: LayoutLine[] = [...headOf(company, words.title, person.name ?? '', taglineOf(person, words))]\n const gap = (height = 12) => lines.push({ cells: [], height })\n const section = (title: string) => {\n gap(16)\n lines.push({ cells: [{ col: 1, span: 6, value: title, role: 'section' }], height: 24 })\n gap(6)\n }\n\n /* A table: its head and its rows in the columns given as [col, span], every other row shaded; none says so. */\n const table = (title: string, columns: [number, number, string][], rows: Row[] | null | undefined, cells: (row: Row) => (string | undefined)[]) => {\n section(title)\n lines.push({ cells: columns.map(([col, span, head]) => ({ col, span, value: head, role: 'head' })) })\n if (!rows?.length) return lines.push({ cells: [{ col: 1, span: 6, value: words.none, role: 'none' }] })\n rows.forEach((row, index) =>\n lines.push({\n cells: cells(row).map((text, at) => ({ col: columns[at][0], span: columns[at][1], value: text ?? '', role: 'value' })),\n ...(index % 2 ? { zebra: true } : {})\n })\n )\n }\n\n /* The figures a buyer weighs first. */\n const projects = profile.projects?.length ?? 0\n const certificates = profile.certificates?.length ?? 0\n gap(14)\n lines.push({\n cells: [\n { col: 1, span: 2, value: words.careerLength, role: 'statLabel' },\n { col: 3, span: 2, value: words.projectsDone, role: 'statLabel' },\n { col: 5, span: 2, value: words.certificatesHeld, role: 'statLabel' }\n ],\n height: 20\n })\n lines.push({\n cells: [\n { col: 1, span: 2, value: careerLengthOf(person, words, today) || '—', role: 'statValue' },\n { col: 3, span: 2, value: projects ? words.projectCount(projects) : '—', role: 'statValue' },\n { col: 5, span: 2, value: certificates ? words.certificateCount(certificates) : '—', role: 'statValue' }\n ],\n height: 34\n })\n\n section(words.expertise)\n if (profile.summary?.trim()) lines.push({ cells: [{ col: 1, span: 6, value: profile.summary.trim(), role: 'summary' }] })\n lines.push({\n cells: [\n { col: 1, value: words.skills, role: 'label' },\n { col: 2, span: 5, value: (profile.skills ?? []).join(', '), role: 'skills' }\n ]\n })\n\n table(\n words.projects,\n [[1, 1, words.period], [2, 1, words.project], [3, 1, words.client], [4, 1, words.role], [5, 1, words.duties], [6, 1, words.technologies]],\n profile.projects,\n row => [periodOf(row.startedOn, row.endedOn, words.ongoing), row.name, row.client, row.role, row.duties, row.technologies]\n )\n table(\n words.careers,\n [[1, 1, words.period], [2, 1, words.company], [3, 1, words.department], [4, 1, words.position], [5, 2, words.duties]],\n profile.careers,\n row => [periodOf(row.startedOn, row.endedOn, words.ongoing), row.company, row.department, row.position, row.duties]\n )\n table(words.certificates, [[1, 1, words.acquiredOn], [2, 3, words.certificate], [5, 2, words.issuer]], profile.certificates, row => [\n dotted(row.acquiredOn),\n row.name,\n row.issuer\n ])\n table(words.educations, [[1, 1, words.period], [2, 2, words.school], [4, 2, words.major], [6, 1, words.degree]], profile.educations, row => [\n periodOf(row.startedOn, row.endedOn, words.ongoing),\n row.school,\n row.major,\n row.degree\n ])\n return lines\n}\n\n/** How many people, and their experience on average - the team's weight in one line. */\nexport function rosterTaglineOf(people: ProfilePerson[], words: ProfileSheetWords, today = new Date()): string {\n const months = people.map(person => careerMonths(person, today))\n const average = people.length ? Math.round(months.reduce((sum, one) => sum + one, 0) / people.length) : 0\n return [words.peopleCount(people.length), average ? `${words.averageCareer} ${words.years(Math.floor(average / 12), average % 12)}` : ''].filter(Boolean).join(' · ')\n}\n\n/** The roster that opens a document of several people - one line a person, in the order picked. */\nexport function rosterLayout(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): LayoutLine[] {\n return [\n ...headOf(company, `${words.writtenOn} ${dotted(todayOf(today))}`, words.rosterTitle, rosterTaglineOf(people, words, today)),\n { cells: [], height: 16 },\n {\n cells: [words.number, words.name, words.department, words.jobPosition, words.careerLength, words.skills].map((value, index) => ({ col: index + 1, value, role: 'head' as const }))\n },\n ...people.map((person, index) => ({\n cells: [\n String(index + 1),\n person.name ?? '',\n person.departmentName ?? '',\n person.jobPosition ?? '',\n careerLengthOf(person, words, today),\n (person.profile?.skills ?? []).join(', ')\n ].map((value, column) => ({ col: column + 1, value, role: 'value' as const })),\n ...(index % 2 ? { zebra: true } : {})\n }))\n ]\n}\n\n/**\n * A sheet name for each person. Excel takes at most 31 characters, none of \\ / ? * [ ] :, and no two alike ignoring\n * case - two people of one name become 「홍길동」 and 「홍길동 (2)」. `reserved` are names already in the book.\n */\nexport function sheetNamesOf(names: (string | null | undefined)[], reserved: string[] = []): string[] {\n const taken = new Set<string>(reserved.map(name => name.toLowerCase()))\n return names.map((name, index) => {\n const base = (name ?? '').replace(/[\\\\/?*[\\]:]/g, ' ').replace(/^'+|'+$/g, '').trim() || `#${index + 1}`\n let candidate = base.slice(0, 31)\n for (let n = 2; taken.has(candidate.toLowerCase()); n++) {\n const tail = ` (${n})`\n candidate = base.slice(0, 31 - tail.length) + tail\n }\n taken.add(candidate.toLowerCase())\n return candidate\n })\n}\n\n/** The document's colours - a deep navy for what leads the eye, a pale blue-grey ground, quiet lines. */\nexport const PALETTE = { navy: '1F3A5F', ground: 'EEF3F8', zebra: 'F7F9FB', line: 'C9D2DC', ink: '17242C', muted: '5F6B76' }\n\nconst FONT = 'Malgun Gothic'\nconst argb = (hex: string) => ({ argb: `FF${hex}` })\nconst LINE = { style: 'thin' as const, color: argb(PALETTE.line) }\nconst RULED: Partial<Borders> = { top: LINE, left: LINE, bottom: LINE, right: LINE }\nconst ground = (hex: string) => ({ type: 'pattern' as const, pattern: 'solid' as const, fgColor: argb(hex) })\nconst font = (size: number, extra: Partial<Style['font']> = {}) => ({ name: FONT, size, color: argb(PALETTE.ink), ...extra })\n\n/** How each role of cell is painted in Excel. */\nconst PAINT: Record<CellRole, Partial<Style>> = {\n company: { font: font(9, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'left', vertical: 'bottom' } },\n kicker: { font: font(9, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'right', vertical: 'bottom' } },\n name: { font: font(22, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'left', vertical: 'bottom' } },\n tagline: { font: font(10.5, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'left', vertical: 'top' } },\n rule: { border: { bottom: { style: 'thick', color: argb(PALETTE.navy) } } },\n statLabel: {\n font: font(9, { color: argb(PALETTE.muted) }),\n fill: ground(PALETTE.ground),\n alignment: { horizontal: 'center', vertical: 'bottom' },\n border: { top: { style: 'medium', color: argb(PALETTE.navy) } }\n },\n statValue: { font: font(16, { bold: true, color: argb(PALETTE.navy) }), fill: ground(PALETTE.ground), alignment: { horizontal: 'center', vertical: 'middle' } },\n section: { font: font(12, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'left', vertical: 'bottom' }, border: { bottom: { style: 'medium', color: argb(PALETTE.navy) } } },\n summary: {\n font: font(10.5),\n fill: ground(PALETTE.ground),\n alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 },\n border: { left: { style: 'thick', color: argb(PALETTE.navy) } }\n },\n label: { font: font(9.5, { bold: true, color: argb(PALETTE.navy) }), fill: ground(PALETTE.ground), alignment: { horizontal: 'center', vertical: 'middle', wrapText: true }, border: RULED },\n skills: { font: font(10, { bold: true }), alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 }, border: RULED },\n head: {\n font: font(9.5, { bold: true, color: argb('FFFFFF') }),\n fill: ground(PALETTE.navy),\n alignment: { horizontal: 'center', vertical: 'middle', wrapText: true },\n border: { top: { style: 'thin', color: argb(PALETTE.navy) }, bottom: { style: 'thin', color: argb(PALETTE.navy) }, left: LINE, right: LINE }\n },\n value: { font: font(9.5), alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 }, border: RULED },\n none: { font: font(9.5, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'center', vertical: 'middle' }, border: RULED }\n}\n\n/**\n * A line's height in points, for as many text lines as its longest boxed cell wraps into - Excel does not grow a row\n * for wrapped text written by a program. A full-width character is about two of the column's character units.\n */\nexport function heightOf(line: LayoutLine): number | undefined {\n const boxed = line.cells.filter(cell => ['label', 'skills', 'summary', 'head', 'value', 'none'].includes(cell.role))\n if (!boxed.length) return undefined\n const wraps = boxed.map(cell => {\n const width = COLUMN_WIDTHS.slice(cell.col - 1, cell.col - 1 + (cell.span ?? 1)).reduce((sum, one) => sum + one, 0) - (cell.role === 'summary' ? 4 : 1)\n return cell.value.split('\\n').reduce((lines, text) => {\n const units = [...text].reduce((sum, char) => sum + (char.charCodeAt(0) > 0x2e7f ? 1.9 : 0.9), 0)\n return lines + Math.max(1, Math.ceil(units / Math.max(width, 1)))\n }, 0)\n })\n const lines = Math.max(...wraps)\n return boxed.some(cell => cell.role === 'summary') ? lines * 16 + 14 : lines * 15 + 7\n}\n\n/** Paint a layout on a sheet: values, spans merged, each cell of a span painted so a boxed cell is boxed all round. */\nexport function paintSheet(sheet: Worksheet, lines: LayoutLine[], footer = '') {\n COLUMN_WIDTHS.forEach((width, index) => (sheet.getColumn(index + 1).width = width))\n lines.forEach((line, index) => {\n const row = sheet.getRow(index + 1)\n const height = Math.max(line.height ?? 0, heightOf(line) ?? 0)\n if (height) row.height = height\n for (const cell of line.cells) {\n const span = cell.span ?? 1\n const style = line.zebra && cell.role === 'value' ? { ...PAINT.value, fill: ground(PALETTE.zebra) } : PAINT[cell.role]\n for (let col = cell.col; col < cell.col + span; col++) Object.assign(row.getCell(col), { style })\n row.getCell(cell.col).value = cell.value\n if (span > 1) sheet.mergeCells(index + 1, cell.col, index + 1, cell.col + span - 1)\n }\n })\n sheet.views = [{ showGridLines: false }]\n sheet.pageSetup = {\n paperSize: 9,\n orientation: 'portrait',\n fitToPage: true,\n fitToWidth: 1,\n fitToHeight: 0,\n horizontalCentered: true,\n margins: { left: 0.5, right: 0.5, top: 0.6, bottom: 0.7, header: 0.3, footer: 0.3 }\n }\n /* The employer at the foot of every printed page, and the page of how many. `&` is Excel's escape. */\n sheet.headerFooter = { oddFooter: `&L&8${footer.replace(/&/g, '&&')}&R&8&P / &N` }\n}\n\n/** The workbook of the people given, in their order - opened by a roster when there are several. */\nexport function profileWorkbook(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): Workbook {\n const book = new Workbook()\n const footer = [company, words.title].filter(Boolean).join(' · ')\n /* The roster's name follows Excel's rules as the people's do. */\n const roster = people.length > 1 ? sheetNamesOf([words.rosterTitle]) : []\n if (roster.length) paintSheet(book.addWorksheet(roster[0]), rosterLayout(people, words, company, today), footer)\n const names = sheetNamesOf(people.map(person => person.name), roster)\n people.forEach((person, index) => paintSheet(book.addWorksheet(names[index]), profileSheetLayout(person, words, company, today), footer))\n return book\n}\n\nconst escapeHtml = (text: string) => text.replace(/[&<>\"]/g, c => ({ '&': '&', '<': '<', '>': '>', '\"': '"' })[c]!)\n\n/** A cell's content as HTML: skills as tags, line breaks kept, everything escaped. */\nfunction cellHtml(cell: LayoutCell): string {\n if (cell.role === 'skills') {\n return cell.value\n .split(', ')\n .filter(Boolean)\n .map(skill => `<span class=\"tag\">${escapeHtml(skill)}</span>`)\n .join('')\n }\n return escapeHtml(cell.value).replace(/\\n/g, '<br>')\n}\n\n/** The same layout as HTML: a table of the six columns a page, the roles as classes. */\nexport function layoutHtml(lines: LayoutLine[]): string {\n const total = COLUMN_WIDTHS.reduce((sum, width) => sum + width, 0)\n const columns = COLUMN_WIDTHS.map(width => `<col style=\"width:${((width / total) * 100).toFixed(2)}%\">`).join('')\n const rows = lines.map(line => {\n const style = line.height ? ` style=\"height:${Math.round(line.height * 1.33)}px\"` : ''\n if (!line.cells.length) return `<tr class=\"gap\"${style}><td colspan=\"6\"></td></tr>`\n let next = 1\n const cells: string[] = []\n for (const cell of line.cells) {\n if (cell.col > next) cells.push(`<td colspan=\"${cell.col - next}\"></td>`)\n const span = cell.span ?? 1\n cells.push(`<td class=\"${cell.role}\"${span > 1 ? ` colspan=\"${span}\"` : ''}>${cellHtml(cell)}</td>`)\n next = cell.col + span\n }\n if (next <= 6) cells.push(`<td colspan=\"${7 - next}\"></td>`)\n return `<tr${line.zebra ? ' class=\"zebra\"' : ''}${style}>${cells.join('')}</tr>`\n })\n return `<table><colgroup>${columns}</colgroup>${rows.join('')}</table>`\n}\n\n/** How the roles look on paper - the workbook's paint in CSS. */\nexport const PROFILE_CSS = `\nbody { margin: 0; font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; font-size: 9.5pt; color: #${PALETTE.ink};\n -webkit-print-color-adjust: exact; print-color-adjust: exact }\n.sheet { break-after: page }\n.sheet:last-child { break-after: auto }\ntable { width: 100%; border-collapse: collapse; table-layout: fixed }\ntd { padding: 5px 7px; vertical-align: middle; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.45 }\ntr.gap td { padding: 0 }\ntd.company { font-size: 8.5pt; color: #${PALETTE.muted}; padding: 0 0 2px }\ntd.kicker { font-size: 8.5pt; font-weight: 700; color: #${PALETTE.navy}; text-align: right; letter-spacing: 0.08em; padding: 0 0 2px }\ntd.name { font-size: 24pt; font-weight: 800; color: #${PALETTE.navy}; letter-spacing: 0.02em; padding: 6px 0 0; vertical-align: bottom }\ntd.tagline { font-size: 10.5pt; color: #${PALETTE.muted}; padding: 2px 0 8px; vertical-align: top }\ntd.rule { border-bottom: 3px solid #${PALETTE.navy}; padding: 0 }\ntd.statLabel { background: #${PALETTE.ground}; border-top: 2px solid #${PALETTE.navy}; text-align: center; font-size: 8.5pt; color: #${PALETTE.muted}; padding: 8px 0 0 }\ntd.statValue { background: #${PALETTE.ground}; text-align: center; font-size: 17pt; font-weight: 800; color: #${PALETTE.navy}; padding: 0 0 8px }\ntd.statLabel + td.statLabel, td.statValue + td.statValue { border-left: 8px solid #fff }\ntd.section { font-size: 12pt; font-weight: 800; color: #${PALETTE.navy}; border-bottom: 2px solid #${PALETTE.navy}; padding: 0 0 4px; vertical-align: bottom }\ntd.summary { background: #${PALETTE.ground}; border-left: 4px solid #${PALETTE.navy}; font-size: 10.5pt; padding: 10px 14px }\ntd.label { background: #${PALETTE.ground}; color: #${PALETTE.navy}; font-weight: 700; text-align: center; border: 1px solid #${PALETTE.line} }\ntd.skills { border: 1px solid #${PALETTE.line}; padding: 6px 8px }\n.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 10px; background: #${PALETTE.navy}; color: #fff; font-size: 8.5pt; font-weight: 600 }\ntd.head { background: #${PALETTE.navy}; color: #fff; font-weight: 700; text-align: center; border: 1px solid #${PALETTE.navy}; font-size: 9pt }\ntd.value { border: 1px solid #${PALETTE.line} }\ntr.zebra td.value { background: #${PALETTE.zebra} }\ntd.none { border: 1px solid #${PALETTE.line}; color: #${PALETTE.muted}; text-align: center }\ntr { break-inside: avoid }\n`\n\n/** On a screen, the pages as sheets of A4 on a grey desk - the preview reads as the PDF will (ADR-0169 decision 9). */\nexport const PROFILE_SCREEN_CSS = `\n@media screen {\n html { background: #e9edf1 }\n body { padding: 24px 0 }\n .sheet { box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 12mm; background: #fff;\n box-shadow: 0 1px 3px rgba(23, 36, 44, .12), 0 8px 24px rgba(23, 36, 44, .08) }\n}\n`\n\n/** The preview: the same pages as one HTML document, to be shown in a frame. */\nexport function profilePreviewHtml(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): string {\n return `<!doctype html><html><head><meta charset=\"utf-8\"><style>${PROFILE_CSS}${PROFILE_SCREEN_CSS}</style></head><body>${profileHtml(people, words, company, today)}</body></html>`\n}\n\n/** The document as one HTML page set: the roster first when there are several, then a page a person. */\nexport function profileHtml(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): string {\n const sheets = [\n ...(people.length > 1 ? [rosterLayout(people, words, company, today)] : []),\n ...people.map(person => profileSheetLayout(person, words, company, today))\n ]\n return sheets.map(lines => `<section class=\"sheet\">${layoutHtml(lines)}</section>`).join('')\n}\n\n/** The foot of every printed PDF page: the employer and the document at the left, the page of how many at the right. */\nexport function profileFooterHtml(company: string, words: ProfileSheetWords): string {\n /* The footer is a Handlebars template in the pdf module - a brace in the name must not open one. */\n const left = escapeHtml([company, words.title].filter(Boolean).join(' · ')).replace(/[{}]/g, c => (c === '{' ? '{' : '}'))\n return (\n `<div style=\"width:100%;padding:0 12mm;display:flex;justify-content:space-between;font-family:'Malgun Gothic','Apple SD Gothic Neo','Noto Sans KR',sans-serif;` +\n `font-size:7.5pt;color:#${PALETTE.muted}\"><span>${left}</span><span><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></span></div>`\n )\n}\n\n/** 「인력프로필-20261027.xlsx」 - the word in the reader's language, the day the profiles were taken. */\nexport function profileFileName(word: string, extension: 'xlsx' | 'pdf' | 'html', day = new Date()): string {\n const pad = (n: number) => String(n).padStart(2, '0')\n return `${word}-${day.getFullYear()}${pad(day.getMonth() + 1)}${pad(day.getDate())}.${extension}`\n}\n\n/** A word as a document heads with it - its first letter capital where the language has capitals (「proyectos」 → 「Proyectos」). */\nexport function lead(word: string): string {\n return word ? word.charAt(0).toLocaleUpperCase() + word.slice(1) : word\n}\n\n/** The document's words from the server's translator - the reader's language, each as a heading begins. */\nexport function profileWordsOf(translate: (key: string, options?: any) => string): ProfileSheetWords {\n const t = (key: string, options?: any) => lead(translate(key, options))\n const p = (name: string) => t(`label.employee-profile-${name}`)\n return {\n title: t('text.employee-profile-doc-title'),\n rosterTitle: t('text.employee-profile-doc-roster'),\n expertise: t('text.employee-profile-doc-expertise'),\n name: t('field.name'),\n department: t('label.department'),\n jobPosition: t('label.job-position'),\n hiredOn: t('label.hired-on'),\n careerLength: p('career-length'),\n projectsDone: t('text.employee-profile-doc-projects-done'),\n certificatesHeld: t('text.employee-profile-doc-certificates-held'),\n summary: p('summary'),\n skills: p('skills'),\n educations: p('educations'),\n certificates: p('certificates'),\n careers: p('careers'),\n projects: p('projects'),\n school: p('school'),\n major: p('major'),\n degree: p('degree'),\n period: p('period'),\n certificate: p('certificate'),\n issuer: p('issuer'),\n acquiredOn: p('acquired-on'),\n company: p('company'),\n position: p('position'),\n duties: p('duties'),\n project: p('project'),\n client: p('client'),\n role: p('role'),\n technologies: p('technologies'),\n ongoing: t('text.employee-profile-doc-ongoing'),\n none: t('text.employee-profile-doc-none'),\n writtenOn: t('text.employee-profile-doc-written-on'),\n number: t('text.employee-profile-doc-number'),\n years: (years, months) => t('text.employee-profile-doc-years', { years, months }),\n projectCount: n => t('text.employee-profile-doc-project-count', { n }),\n certificateCount: n => t('text.employee-profile-doc-certificate-count', { n }),\n peopleCount: n => t('text.employee-profile-doc-people', { n }),\n averageCareer: t('text.employee-profile-doc-average-career')\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"employee-profile-document.js","sourceRoot":"","sources":["../../../server/service/employee-profile/employee-profile-document.ts"],"names":[],"mappings":";;;AAoIA,wBAEC;AAGD,4BAGC;AAOD,kCASC;AAWD,oCAYC;AAED,wCAGC;AAGD,8BAGC;AAkBD,gDA6EC;AAGD,0CAIC;AAGD,oCAsCC;AAMD,oCAYC;AAiDD,4BAYC;AAGD,gCA4BC;AAGD,0CASC;AAiBD,gCAsCC;AA0CD,gDAEC;AAGD,kCAMC;AAGD,8CAOC;AAGD,0CAGC;AAGD,oBAEC;AAGD,wCA4CC;AAvnBD,qCAA6D;AAE7D,qEAAkD;AA2HlD,0FAA0F;AAC7E,QAAA,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAErD,sHAAsH;AACzG,QAAA,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEpD,gGAAgG;AAChG,SAAgB,MAAM,CAAC,GAAmB;IACxC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;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AE,EAAE,CAAC,EAAE,CAAC;QAC9E,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kCAAkC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9D,aAAa,EAAE,CAAC,CAAC,0CAA0C,CAAC;KAC7D,CAAA;AACH,CAAC","sourcesContent":["import { Borders, Style, Workbook, Worksheet } from 'exceljs'\n\nimport { todayOf } from './employee-profile-rules'\n\n/*\n * The employee profiles a quotation attaches, as a document a person can hand in as it is (ADR-0169 decisions 6 · 8):\n * a page a person, made to show what the person is worth - the name large with where they stand, the figures a buyer\n * weighs (total experience, projects delivered, certificates held), the expertise in their own words and skills, then\n * the projects first, the careers, certificates and education - laid out for A4. Several people open with a roster.\n *\n * One layout (`profileSheetLayout`, `rosterLayout`) is painted twice: as an Excel workbook, a sheet a page\n * (`profileWorkbook`), and as HTML printed to PDF, a page break a sheet (`profileHtml`). Pure - the door reads the data\n * and the pdf module prints.\n */\n\n/** A row of any of the four tables - each has some of these. */\ntype Row = {\n school?: string\n major?: string\n degree?: string\n name?: string\n issuer?: string\n acquiredOn?: string\n company?: string\n department?: string\n position?: string\n duties?: string\n client?: string\n role?: string\n technologies?: string\n startedOn?: string\n endedOn?: string\n}\n\nexport type ProfilePerson = {\n name?: string | null\n departmentName?: string | null\n jobPosition?: string | null\n jobResponsibility?: string | null\n hiredOn?: string | null\n profile?: {\n summary?: string | null\n skills?: string[] | null\n educations?: Row[] | null\n certificates?: Row[] | null\n careers?: Row[] | null\n projects?: Row[] | null\n } | null\n}\n\n/** The words of the document, in the reader's language - handed in so this stays free of i18next. */\nexport type ProfileSheetWords = Record<\n | 'title'\n | 'rosterTitle'\n | 'expertise'\n | 'name'\n | 'department'\n | 'jobPosition'\n | 'hiredOn'\n | 'careerLength'\n | 'projectsDone'\n | 'certificatesHeld'\n | 'summary'\n | 'skills'\n | 'educations'\n | 'certificates'\n | 'careers'\n | 'projects'\n | 'school'\n | 'major'\n | 'degree'\n | 'period'\n | 'certificate'\n | 'issuer'\n | 'acquiredOn'\n | 'company'\n | 'position'\n | 'duties'\n | 'project'\n | 'client'\n | 'role'\n | 'technologies'\n | 'ongoing'\n | 'none'\n | 'writtenOn'\n | 'averageCareer'\n | 'number',\n string\n> & {\n /** 「12년 3개월」 */\n years: (years: number, months: number) => string\n /** 「8건」 */\n projectCount: (count: number) => string\n /** 「3개」 */\n certificateCount: (count: number) => string\n /** 「5명」 */\n peopleCount: (count: number) => string\n}\n\n/** What a cell is - the painter styles by it. */\nexport type CellRole =\n | 'company'\n | 'kicker'\n | 'name'\n | 'tagline'\n | 'rule'\n | 'statLabel'\n | 'statValue'\n | 'section'\n | 'summary'\n | 'label'\n | 'skills'\n | 'head'\n | 'value'\n | 'none'\n\n/**\n * A cell of the six-column grid: `col` from 1, spanning `span` columns and `rows` lines - the lines below leave its\n * columns out. A cell over several lines keeps its text where the first line has it, at the top.\n */\nexport type LayoutCell = { col: number; span?: number; rows?: number; value: string; role: CellRole }\n\n/** A line of the grid; `zebra` shades every other row of a table. */\nexport type LayoutLine = { cells: LayoutCell[]; height?: number; zebra?: boolean }\n\n/** The grid's six columns, in characters - together about the width of A4 in portrait. */\nexport const COLUMN_WIDTHS = [18, 20, 15, 12, 21, 18]\n\n/** The roster's six columns: a narrow number, then who - its career spans the last two, its skills the whole line. */\nexport const ROSTER_WIDTHS = [6, 24, 24, 18, 16, 16]\n\n/** 「2023.03」 from 「2023-03」 or 「2023-03-02」 - the dotted form a staffing profile is read in. */\nexport function dotted(day?: string | null): string {\n return (day ?? '').trim().replace(/-/g, '.')\n}\n\n/** A period as one cell - an open end is still going on. */\nexport function periodOf(startedOn: string | undefined, endedOn: string | undefined, ongoing: string): string {\n if (!startedOn && !endedOn) return ''\n return `${dotted(startedOn)} ~ ${endedOn ? dotted(endedOn) : ongoing}`.trim()\n}\n\n/**\n * Newest first, as a résumé reads. A period is ordered by its end - one still going (no end) on top - and two that ended\n * together by the later start; a day (a certificate's) by the day. A row with no date keeps its place, after the dated\n * ones. Only the document is ordered; the profile keeps the rows as they were written.\n */\nexport function newestFirst<R extends { startedOn?: string; endedOn?: string; acquiredOn?: string }>(rows: R[] | null | undefined): R[] {\n const ONGOING = '9999-99'\n const endOf = (row: R) => (row.acquiredOn ?? row.endedOn ?? (row.startedOn ? ONGOING : '')).trim()\n const startOf = (row: R) => (row.acquiredOn ?? row.startedOn ?? '').trim()\n return [...(rows ?? [])].sort((a, b) => {\n const [endA, endB] = [endOf(a), endOf(b)]\n if (!endA || !endB) return Number(!endA) - Number(!endB)\n return endB.localeCompare(endA) || startOf(b).localeCompare(startOf(a))\n })\n}\n\nconst monthIndex = (day?: string | null): number | null => {\n const match = /^(\\d{4})-(\\d{2})/.exec((day ?? '').trim())\n return match ? Number(match[1]) * 12 + Number(match[2]) - 1 : null\n}\n\n/**\n * The months a person has worked: the careers before this company and the time here since the hire day, counted\n * once where they overlap. A career with no end runs to `today`; one with no start is left out.\n */\nexport function careerMonths(person: ProfilePerson, today = new Date()): number {\n const now = today.getFullYear() * 12 + today.getMonth()\n const months = new Set<number>()\n const spans = [\n ...(person.profile?.careers ?? []).map(row => [monthIndex(row.startedOn), row.endedOn ? monthIndex(row.endedOn) : now] as const),\n [monthIndex(person.hiredOn), now] as const\n ]\n for (const [from, to] of spans) {\n if (from === null || to === null) continue\n for (let month = from; month <= Math.min(to, now); month++) months.add(month)\n }\n return months.size\n}\n\nexport function careerLengthOf(person: ProfilePerson, words: ProfileSheetWords, today = new Date()): string {\n const months = careerMonths(person, today)\n return months ? words.years(Math.floor(months / 12), months % 12) : ''\n}\n\n/** Where the person stands, in one line: department · position / responsibility · hired on. */\nexport function taglineOf(person: ProfilePerson, words: ProfileSheetWords): string {\n const role = [person.jobPosition, person.jobResponsibility].filter(Boolean).join(' / ')\n return [person.departmentName, role, person.hiredOn ? `${words.hiredOn} ${dotted(person.hiredOn)}` : ''].filter(Boolean).join(' · ')\n}\n\n/** The head every page opens with: the employer and what the page is, the name large, a line under it. */\nfunction headOf(company: string, kicker: string, name: string, tagline: string): LayoutLine[] {\n return [\n {\n cells: [\n { col: 1, span: 3, value: company, role: 'company' },\n { col: 4, span: 3, value: kicker, role: 'kicker' }\n ]\n },\n { cells: [{ col: 1, span: 6, value: name, role: 'name' }], height: 40 },\n { cells: [{ col: 1, span: 6, value: tagline, role: 'tagline' }], height: 20 },\n { cells: [{ col: 1, span: 6, value: '', role: 'rule' }], height: 6 }\n ]\n}\n\n/** One person's page, line by line. `company` is the employer's name; `today` the day it is written. */\nexport function profileSheetLayout(person: ProfilePerson, words: ProfileSheetWords, company: string, today = new Date()): LayoutLine[] {\n const profile = person.profile ?? {}\n const lines: LayoutLine[] = [...headOf(company, words.title, person.name ?? '', taglineOf(person, words))]\n const gap = (height = 12) => lines.push({ cells: [], height })\n const section = (title: string) => {\n gap(16)\n lines.push({ cells: [{ col: 1, span: 6, value: title, role: 'section' }], height: 24 })\n gap(6)\n }\n\n /* A table: its head and its rows in the columns given as [col, span], every other row shaded; none says so. */\n const table = (title: string, columns: [number, number, string][], rows: Row[] | null | undefined, cells: (row: Row) => (string | undefined)[]) => {\n section(title)\n lines.push({ cells: columns.map(([col, span, head]) => ({ col, span, value: head, role: 'head' })) })\n if (!rows?.length) return lines.push({ cells: [{ col: 1, span: 6, value: words.none, role: 'none' }] })\n rows.forEach((row, index) =>\n lines.push({\n cells: cells(row).map((text, at) => ({ col: columns[at][0], span: columns[at][1], value: text ?? '', role: 'value' })),\n ...(index % 2 ? { zebra: true } : {})\n })\n )\n }\n\n /* The figures a buyer weighs first. */\n const projects = profile.projects?.length ?? 0\n const certificates = profile.certificates?.length ?? 0\n gap(14)\n lines.push({\n cells: [\n { col: 1, span: 2, value: words.careerLength, role: 'statLabel' },\n { col: 3, span: 2, value: words.projectsDone, role: 'statLabel' },\n { col: 5, span: 2, value: words.certificatesHeld, role: 'statLabel' }\n ],\n height: 20\n })\n lines.push({\n cells: [\n { col: 1, span: 2, value: careerLengthOf(person, words, today) || '—', role: 'statValue' },\n { col: 3, span: 2, value: projects ? words.projectCount(projects) : '—', role: 'statValue' },\n { col: 5, span: 2, value: certificates ? words.certificateCount(certificates) : '—', role: 'statValue' }\n ],\n height: 34\n })\n\n section(words.expertise)\n if (profile.summary?.trim()) lines.push({ cells: [{ col: 1, span: 6, value: profile.summary.trim(), role: 'summary' }] })\n lines.push({\n cells: [\n { col: 1, value: words.skills, role: 'label' },\n { col: 2, span: 5, value: (profile.skills ?? []).join(', '), role: 'skills' }\n ]\n })\n\n table(\n words.projects,\n [[1, 1, words.period], [2, 1, words.project], [3, 1, words.client], [4, 1, words.role], [5, 1, words.duties], [6, 1, words.technologies]],\n newestFirst(profile.projects),\n row => [periodOf(row.startedOn, row.endedOn, words.ongoing), row.name, row.client, row.role, row.duties, row.technologies]\n )\n table(\n words.careers,\n [[1, 1, words.period], [2, 1, words.company], [3, 1, words.department], [4, 1, words.position], [5, 2, words.duties]],\n newestFirst(profile.careers),\n row => [periodOf(row.startedOn, row.endedOn, words.ongoing), row.company, row.department, row.position, row.duties]\n )\n table(words.certificates, [[1, 1, words.acquiredOn], [2, 3, words.certificate], [5, 2, words.issuer]], newestFirst(profile.certificates), row => [\n dotted(row.acquiredOn),\n row.name,\n row.issuer\n ])\n table(words.educations, [[1, 1, words.period], [2, 2, words.school], [4, 2, words.major], [6, 1, words.degree]], newestFirst(profile.educations), row => [\n periodOf(row.startedOn, row.endedOn, words.ongoing),\n row.school,\n row.major,\n row.degree\n ])\n return lines\n}\n\n/** How many people, and their experience on average - the team's weight in one line. */\nexport function rosterTaglineOf(people: ProfilePerson[], words: ProfileSheetWords, today = new Date()): string {\n const months = people.map(person => careerMonths(person, today))\n const average = people.length ? Math.round(months.reduce((sum, one) => sum + one, 0) / people.length) : 0\n return [words.peopleCount(people.length), average ? `${words.averageCareer} ${words.years(Math.floor(average / 12), average % 12)}` : ''].filter(Boolean).join(' · ')\n}\n\n/** The roster that opens a document of several people - one line a person, in the order picked. */\nexport function rosterLayout(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): LayoutLine[] {\n return [\n ...headOf(company, `${words.writtenOn} ${dotted(todayOf(today))}`, words.rosterTitle, rosterTaglineOf(people, words, today)),\n { cells: [], height: 16 },\n {\n cells: [\n ...[words.number, words.name, words.department, words.jobPosition].map((value, index) => ({ col: index + 1, value, role: 'head' as const })),\n { col: 5, span: 2, value: words.careerLength, role: 'head' as const }\n ]\n },\n /*\n * Two lines a person: who, then the skills under the name across the rest of the page - a list too long for one\n * column of six. The number runs down both lines, so it marks where a person starts; a person with no skills\n * written keeps one line.\n */\n ...people.flatMap((person, index) => {\n const shade = index % 2 ? { zebra: true } : {}\n const skills = (person.profile?.skills ?? []).join(', ')\n return [\n {\n cells: [\n { col: 1, rows: skills ? 2 : 1, value: String(index + 1), role: 'value' as const },\n ...[person.name ?? '', person.departmentName ?? '', person.jobPosition ?? ''].map((value, column) => ({ col: column + 2, value, role: 'value' as const })),\n { col: 5, span: 2, value: careerLengthOf(person, words, today), role: 'value' as const }\n ],\n ...shade\n },\n ...(skills\n ? [\n {\n cells: [{ col: 2, span: 5, value: skills, role: 'value' as const }],\n ...shade\n }\n ]\n : [])\n ]\n })\n ]\n}\n\n/**\n * A sheet name for each person. Excel takes at most 31 characters, none of \\ / ? * [ ] :, and no two alike ignoring\n * case - two people of one name become 「홍길동」 and 「홍길동 (2)」. `reserved` are names already in the book.\n */\nexport function sheetNamesOf(names: (string | null | undefined)[], reserved: string[] = []): string[] {\n const taken = new Set<string>(reserved.map(name => name.toLowerCase()))\n return names.map((name, index) => {\n const base = (name ?? '').replace(/[\\\\/?*[\\]:]/g, ' ').replace(/^'+|'+$/g, '').trim() || `#${index + 1}`\n let candidate = base.slice(0, 31)\n for (let n = 2; taken.has(candidate.toLowerCase()); n++) {\n const tail = ` (${n})`\n candidate = base.slice(0, 31 - tail.length) + tail\n }\n taken.add(candidate.toLowerCase())\n return candidate\n })\n}\n\n/** The document's colours - a deep navy for what leads the eye, a pale blue-grey ground, quiet lines. */\nexport const PALETTE = { navy: '1F3A5F', ground: 'EEF3F8', zebra: 'F7F9FB', line: 'C9D2DC', ink: '17242C', muted: '5F6B76' }\n\nconst FONT = 'Malgun Gothic'\nconst argb = (hex: string) => ({ argb: `FF${hex}` })\nconst LINE = { style: 'thin' as const, color: argb(PALETTE.line) }\nconst RULED: Partial<Borders> = { top: LINE, left: LINE, bottom: LINE, right: LINE }\nconst ground = (hex: string) => ({ type: 'pattern' as const, pattern: 'solid' as const, fgColor: argb(hex) })\nconst font = (size: number, extra: Partial<Style['font']> = {}) => ({ name: FONT, size, color: argb(PALETTE.ink), ...extra })\n\n/** How each role of cell is painted in Excel. */\nconst PAINT: Record<CellRole, Partial<Style>> = {\n company: { font: font(9, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'left', vertical: 'bottom' } },\n kicker: { font: font(9, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'right', vertical: 'bottom' } },\n name: { font: font(22, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'left', vertical: 'bottom' } },\n tagline: { font: font(10.5, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'left', vertical: 'top' } },\n rule: { border: { bottom: { style: 'thick', color: argb(PALETTE.navy) } } },\n statLabel: {\n font: font(9, { color: argb(PALETTE.muted) }),\n fill: ground(PALETTE.ground),\n alignment: { horizontal: 'center', vertical: 'bottom' },\n border: { top: { style: 'medium', color: argb(PALETTE.navy) } }\n },\n statValue: { font: font(16, { bold: true, color: argb(PALETTE.navy) }), fill: ground(PALETTE.ground), alignment: { horizontal: 'center', vertical: 'middle' } },\n section: { font: font(12, { bold: true, color: argb(PALETTE.navy) }), alignment: { horizontal: 'left', vertical: 'bottom' }, border: { bottom: { style: 'medium', color: argb(PALETTE.navy) } } },\n summary: {\n font: font(10.5),\n fill: ground(PALETTE.ground),\n alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 },\n border: { left: { style: 'thick', color: argb(PALETTE.navy) } }\n },\n label: { font: font(9.5, { bold: true, color: argb(PALETTE.navy) }), fill: ground(PALETTE.ground), alignment: { horizontal: 'center', vertical: 'middle', wrapText: true }, border: RULED },\n skills: { font: font(10, { bold: true }), alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 }, border: RULED },\n head: {\n font: font(9.5, { bold: true, color: argb('FFFFFF') }),\n fill: ground(PALETTE.navy),\n alignment: { horizontal: 'center', vertical: 'middle', wrapText: true },\n border: { top: { style: 'thin', color: argb(PALETTE.navy) }, bottom: { style: 'thin', color: argb(PALETTE.navy) }, left: LINE, right: LINE }\n },\n value: { font: font(9.5), alignment: { horizontal: 'left', vertical: 'middle', wrapText: true, indent: 1 }, border: RULED },\n none: { font: font(9.5, { color: argb(PALETTE.muted) }), alignment: { horizontal: 'center', vertical: 'middle' }, border: RULED }\n}\n\n/**\n * A line's height in points, for as many text lines as its longest boxed cell wraps into - Excel does not grow a row\n * for wrapped text written by a program. A full-width character is about two of the column's character units.\n */\nexport function heightOf(line: LayoutLine, widths = COLUMN_WIDTHS): number | undefined {\n const boxed = line.cells.filter(cell => ['label', 'skills', 'summary', 'head', 'value', 'none'].includes(cell.role))\n if (!boxed.length) return undefined\n const wraps = boxed.map(cell => {\n const width = widths.slice(cell.col - 1, cell.col - 1 + (cell.span ?? 1)).reduce((sum, one) => sum + one, 0) - (cell.role === 'summary' ? 4 : 1)\n return cell.value.split('\\n').reduce((lines, text) => {\n const units = [...text].reduce((sum, char) => sum + (char.charCodeAt(0) > 0x2e7f ? 1.9 : 0.9), 0)\n return lines + Math.max(1, Math.ceil(units / Math.max(width, 1)))\n }, 0)\n })\n const lines = Math.max(...wraps)\n return boxed.some(cell => cell.role === 'summary') ? lines * 16 + 14 : lines * 15 + 7\n}\n\n/** Paint a layout on a sheet: values, spans merged, each cell of a span painted so a boxed cell is boxed all round. */\nexport function paintSheet(sheet: Worksheet, lines: LayoutLine[], footer = '', widths = COLUMN_WIDTHS) {\n widths.forEach((width, index) => (sheet.getColumn(index + 1).width = width))\n lines.forEach((line, index) => {\n const row = sheet.getRow(index + 1)\n const height = Math.max(line.height ?? 0, heightOf(line, widths) ?? 0)\n if (height) row.height = height\n for (const cell of line.cells) {\n const span = cell.span ?? 1\n const style = line.zebra && cell.role === 'value' ? { ...PAINT.value, fill: ground(PALETTE.zebra) } : PAINT[cell.role]\n const rows = cell.rows ?? 1\n const painted = rows > 1 ? { ...style, alignment: { ...style.alignment, vertical: 'top' as const } } : style\n for (let at = 0; at < rows; at++) for (let col = cell.col; col < cell.col + span; col++) Object.assign(sheet.getRow(index + 1 + at).getCell(col), { style: painted })\n row.getCell(cell.col).value = cell.value\n if (span > 1 || rows > 1) sheet.mergeCells(index + 1, cell.col, index + rows, cell.col + span - 1)\n }\n })\n sheet.views = [{ showGridLines: false }]\n sheet.pageSetup = {\n paperSize: 9,\n orientation: 'portrait',\n fitToPage: true,\n fitToWidth: 1,\n fitToHeight: 0,\n horizontalCentered: true,\n margins: { left: 0.5, right: 0.5, top: 0.6, bottom: 0.7, header: 0.3, footer: 0.3 }\n }\n /* The employer at the foot of every printed page, and the page of how many. `&` is Excel's escape. */\n sheet.headerFooter = { oddFooter: `&L&8${footer.replace(/&/g, '&&')}&R&8&P / &N` }\n}\n\n/** The workbook of the people given, in their order - opened by a roster when there are several. */\nexport function profileWorkbook(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): Workbook {\n const book = new Workbook()\n const footer = [company, words.title].filter(Boolean).join(' · ')\n /* The roster's name follows Excel's rules as the people's do. */\n const roster = people.length > 1 ? sheetNamesOf([words.rosterTitle]) : []\n if (roster.length) paintSheet(book.addWorksheet(roster[0]), rosterLayout(people, words, company, today), footer, ROSTER_WIDTHS)\n const names = sheetNamesOf(people.map(person => person.name), roster)\n people.forEach((person, index) => paintSheet(book.addWorksheet(names[index]), profileSheetLayout(person, words, company, today), footer))\n return book\n}\n\nconst escapeHtml = (text: string) => text.replace(/[&<>\"]/g, c => ({ '&': '&', '<': '<', '>': '>', '\"': '"' })[c]!)\n\n/** A cell's content as HTML: skills as tags, line breaks kept, everything escaped. */\nfunction cellHtml(cell: LayoutCell): string {\n if (cell.role === 'skills') {\n return cell.value\n .split(', ')\n .filter(Boolean)\n .map(skill => `<span class=\"tag\">${escapeHtml(skill)}</span>`)\n .join('')\n }\n return escapeHtml(cell.value).replace(/\\n/g, '<br>')\n}\n\n/** The same layout as HTML: a table of the six columns a page, the roles as classes. */\nexport function layoutHtml(lines: LayoutLine[], widths = COLUMN_WIDTHS): string {\n const total = widths.reduce((sum, width) => sum + width, 0)\n const columns = widths.map(width => `<col style=\"width:${((width / total) * 100).toFixed(2)}%\">`).join('')\n /* How many more lines each column is still held by a cell from a line above. */\n const held = [0, 0, 0, 0, 0, 0, 0]\n const rows = lines.map(line => {\n const style = line.height ? ` style=\"height:${Math.round(line.height * 1.33)}px\"` : ''\n const covered = held.map(lines => lines > 0)\n for (let col = 1; col <= 6; col++) held[col] = Math.max(0, held[col] - 1)\n if (!line.cells.length) return `<tr class=\"gap\"${style}><td colspan=\"6\"></td></tr>`\n const cells: string[] = []\n /* Empty columns between cells, as runs that leave out the columns a cell above still holds. */\n const fill = (from: number, to: number) => {\n for (let col = from; col < to; ) {\n if (covered[col]) {\n col++\n continue\n }\n let end = col\n while (end < to && !covered[end]) end++\n cells.push(`<td colspan=\"${end - col}\"></td>`)\n col = end\n }\n }\n let next = 1\n for (const cell of line.cells) {\n fill(next, cell.col)\n const span = cell.span ?? 1\n const rows = cell.rows ?? 1\n for (let col = cell.col; col < cell.col + span; col++) held[col] = rows - 1\n const attributes = `${span > 1 ? ` colspan=\"${span}\"` : ''}${rows > 1 ? ` rowspan=\"${rows}\" style=\"vertical-align:top\"` : ''}`\n cells.push(`<td class=\"${cell.role}\"${attributes}>${cellHtml(cell)}</td>`)\n next = cell.col + span\n }\n fill(next, 7)\n return `<tr${line.zebra ? ' class=\"zebra\"' : ''}${style}>${cells.join('')}</tr>`\n })\n return `<table><colgroup>${columns}</colgroup>${rows.join('')}</table>`\n}\n\n/** How the roles look on paper - the workbook's paint in CSS. */\nexport const PROFILE_CSS = `\nbody { margin: 0; font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; font-size: 9.5pt; color: #${PALETTE.ink};\n -webkit-print-color-adjust: exact; print-color-adjust: exact }\n.sheet { break-after: page }\n.sheet:last-child { break-after: auto }\ntable { width: 100%; border-collapse: collapse; table-layout: fixed }\ntd { padding: 5px 7px; vertical-align: middle; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.45 }\ntr.gap td { padding: 0 }\ntd.company { font-size: 8.5pt; color: #${PALETTE.muted}; padding: 0 0 2px }\ntd.kicker { font-size: 8.5pt; font-weight: 700; color: #${PALETTE.navy}; text-align: right; letter-spacing: 0.08em; padding: 0 0 2px }\ntd.name { font-size: 24pt; font-weight: 800; color: #${PALETTE.navy}; letter-spacing: 0.02em; padding: 6px 0 0; vertical-align: bottom }\ntd.tagline { font-size: 10.5pt; color: #${PALETTE.muted}; padding: 2px 0 8px; vertical-align: top }\ntd.rule { border-bottom: 3px solid #${PALETTE.navy}; padding: 0 }\ntd.statLabel { background: #${PALETTE.ground}; border-top: 2px solid #${PALETTE.navy}; text-align: center; font-size: 8.5pt; color: #${PALETTE.muted}; padding: 8px 0 0 }\ntd.statValue { background: #${PALETTE.ground}; text-align: center; font-size: 17pt; font-weight: 800; color: #${PALETTE.navy}; padding: 0 0 8px }\ntd.statLabel + td.statLabel, td.statValue + td.statValue { border-left: 8px solid #fff }\ntd.section { font-size: 12pt; font-weight: 800; color: #${PALETTE.navy}; border-bottom: 2px solid #${PALETTE.navy}; padding: 0 0 4px; vertical-align: bottom }\ntd.summary { background: #${PALETTE.ground}; border-left: 4px solid #${PALETTE.navy}; font-size: 10.5pt; padding: 10px 14px }\ntd.label { background: #${PALETTE.ground}; color: #${PALETTE.navy}; font-weight: 700; text-align: center; border: 1px solid #${PALETTE.line} }\ntd.skills { border: 1px solid #${PALETTE.line}; padding: 6px 8px }\n.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 10px; background: #${PALETTE.navy}; color: #fff; font-size: 8.5pt; font-weight: 600 }\ntd.head { background: #${PALETTE.navy}; color: #fff; font-weight: 700; text-align: center; border: 1px solid #${PALETTE.navy}; font-size: 9pt }\ntd.value { border: 1px solid #${PALETTE.line} }\ntr.zebra td.value { background: #${PALETTE.zebra} }\ntd.none { border: 1px solid #${PALETTE.line}; color: #${PALETTE.muted}; text-align: center }\ntr { break-inside: avoid }\n`\n\n/** On a screen, the pages as sheets of A4 on a grey desk - the preview reads as the PDF will (ADR-0169 decision 9). */\nexport const PROFILE_SCREEN_CSS = `\n@media screen {\n html { background: #e9edf1 }\n body { padding: 24px 0 }\n .sheet { box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 12mm; background: #fff;\n box-shadow: 0 1px 3px rgba(23, 36, 44, .12), 0 8px 24px rgba(23, 36, 44, .08) }\n}\n`\n\n/** The preview: the same pages as one HTML document, to be shown in a frame. */\nexport function profilePreviewHtml(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): string {\n return `<!doctype html><html><head><meta charset=\"utf-8\"><style>${PROFILE_CSS}${PROFILE_SCREEN_CSS}</style></head><body>${profileHtml(people, words, company, today)}</body></html>`\n}\n\n/** The document as one HTML page set: the roster first when there are several, then a page a person. */\nexport function profileHtml(people: ProfilePerson[], words: ProfileSheetWords, company: string, today = new Date()): string {\n const sheets: [LayoutLine[], number[]][] = [\n ...(people.length > 1 ? [[rosterLayout(people, words, company, today), ROSTER_WIDTHS] as [LayoutLine[], number[]]] : []),\n ...people.map(person => [profileSheetLayout(person, words, company, today), COLUMN_WIDTHS] as [LayoutLine[], number[]])\n ]\n return sheets.map(([lines, widths]) => `<section class=\"sheet\">${layoutHtml(lines, widths)}</section>`).join('')\n}\n\n/** The foot of every printed PDF page: the employer and the document at the left, the page of how many at the right. */\nexport function profileFooterHtml(company: string, words: ProfileSheetWords): string {\n /* The footer is a Handlebars template in the pdf module - a brace in the name must not open one. */\n const left = escapeHtml([company, words.title].filter(Boolean).join(' · ')).replace(/[{}]/g, c => (c === '{' ? '{' : '}'))\n return (\n `<div style=\"width:100%;padding:0 12mm;display:flex;justify-content:space-between;font-family:'Malgun Gothic','Apple SD Gothic Neo','Noto Sans KR',sans-serif;` +\n `font-size:7.5pt;color:#${PALETTE.muted}\"><span>${left}</span><span><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></span></div>`\n )\n}\n\n/** 「인력프로필-20261027.xlsx」 - the word in the reader's language, the day the profiles were taken. */\nexport function profileFileName(word: string, extension: 'xlsx' | 'pdf' | 'html', day = new Date()): string {\n const pad = (n: number) => String(n).padStart(2, '0')\n return `${word}-${day.getFullYear()}${pad(day.getMonth() + 1)}${pad(day.getDate())}.${extension}`\n}\n\n/** A word as a document heads with it - its first letter capital where the language has capitals (「proyectos」 → 「Proyectos」). */\nexport function lead(word: string): string {\n return word ? word.charAt(0).toLocaleUpperCase() + word.slice(1) : word\n}\n\n/** The document's words from the server's translator - the reader's language, each as a heading begins. */\nexport function profileWordsOf(translate: (key: string, options?: any) => string): ProfileSheetWords {\n const t = (key: string, options?: any) => lead(translate(key, options))\n const p = (name: string) => t(`label.employee-profile-${name}`)\n return {\n title: t('text.employee-profile-doc-title'),\n rosterTitle: t('text.employee-profile-doc-roster'),\n expertise: t('text.employee-profile-doc-expertise'),\n name: t('field.name'),\n department: t('label.department'),\n jobPosition: t('label.job-position'),\n hiredOn: t('label.hired-on'),\n careerLength: p('career-length'),\n projectsDone: t('text.employee-profile-doc-projects-done'),\n certificatesHeld: t('text.employee-profile-doc-certificates-held'),\n summary: p('summary'),\n skills: p('skills'),\n educations: p('educations'),\n certificates: p('certificates'),\n careers: p('careers'),\n projects: p('projects'),\n school: p('school'),\n major: p('major'),\n degree: p('degree'),\n period: p('period'),\n certificate: p('certificate'),\n issuer: p('issuer'),\n acquiredOn: p('acquired-on'),\n company: p('company'),\n position: p('position'),\n duties: p('duties'),\n project: p('project'),\n client: p('client'),\n role: p('role'),\n technologies: p('technologies'),\n ongoing: t('text.employee-profile-doc-ongoing'),\n none: t('text.employee-profile-doc-none'),\n writtenOn: t('text.employee-profile-doc-written-on'),\n number: t('text.employee-profile-doc-number'),\n years: (years, months) => t('text.employee-profile-doc-years', { years, months }),\n projectCount: n => t('text.employee-profile-doc-project-count', { n }),\n certificateCount: n => t('text.employee-profile-doc-certificate-count', { n }),\n peopleCount: n => t('text.employee-profile-doc-people', { n }),\n averageCareer: t('text.employee-profile-doc-average-career')\n }\n}\n"]}
|