@forgeroute/ui 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forgeroute-ui-charts.mjs +1 -1
- package/fesm2022/forgeroute-ui-charts.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-pdf.mjs +582 -0
- package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -0
- package/fesm2022/forgeroute-ui.mjs +134 -3
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +10 -2
- package/types/forgeroute-ui-pdf.d.ts +206 -0
- package/types/forgeroute-ui.d.ts +50 -5
|
@@ -19,7 +19,7 @@ const VALUE_LABELS = {
|
|
|
19
19
|
ctx.textBaseline = "bottom";
|
|
20
20
|
chart.getDatasetMeta(0).data.forEach((bar, i) => {
|
|
21
21
|
const value = chart.data.datasets[0]?.data[i];
|
|
22
|
-
if (typeof value === "number" && value !== 0) ctx.fillText(String(value), bar.x, bar.y - 2);
|
|
22
|
+
if (typeof value === "number" && Number.isFinite(value) && value !== 0) ctx.fillText(String(value), bar.x, bar.y - 2);
|
|
23
23
|
});
|
|
24
24
|
ctx.restore();
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-charts.mjs","names":[],"sources":["../../../projects/forgeroute-ui/charts/src/bar-chart/bar-chart.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, DestroyRef, ElementRef, NgZone, computed, effect, inject, input, viewChild,\n} from '@angular/core';\nimport { BarController, BarElement, CategoryScale, Chart, LinearScale, Tooltip } from 'chart.js';\nimport type { Plugin } from 'chart.js';\n\n// Registered when a chart is first created (not at import time) so apps that never use ui-bar-chart can drop chart.js from their bundle.\nlet registered = false;\nfunction registerChartParts(): void {\n if (registered) return;\n Chart.register(BarController, BarElement, CategoryScale, LinearScale, Tooltip);\n registered = true;\n}\n\n/** Draws each bar's value above it (nothing for a 0 bar). Local to ui-bar-chart so no chart.js plugin package is needed. */\nconst VALUE_LABELS: Plugin<'bar'> = {\n id: 'uiBarChartValueLabels',\n afterDatasetsDraw(chart) {\n const opts = (chart.options.plugins as Record<string, { enabled?: boolean } | undefined>)['uiBarChartValueLabels'];\n if (opts?.enabled === false) return;\n const ctx = chart.ctx;\n ctx.save();\n ctx.fillStyle = '#475569';\n ctx.font = '600 11px sans-serif';\n ctx.textAlign = 'center';\n ctx.textBaseline = 'bottom';\n chart.getDatasetMeta(0).data.forEach((bar, i) => {\n const value = chart.data.datasets[0]?.data[i];\n if (typeof value === 'number' && value !== 0) ctx.fillText(String(value), bar.x, bar.y - 2);\n });\n ctx.restore();\n },\n};\n\n/**\n * Bar chart of one series (e.g. calls per day). Pass the category `labels` and the matching `values`.\n *\n * <ui-bar-chart [labels]=\"['8/1', '8/2']\" [values]=\"[3, 0]\" ariaLabel=\"Daily call volume\"\n * unitSingular=\"call\" unitPlural=\"calls\" />\n *\n * - Bars show their value above them (`showValues`, a 0 bar shows nothing), the y axis starts at 0 and counts whole numbers.\n * - The tooltip reads \"<value> <unit>\" (`unitSingular` for 1, `unitPlural` otherwise; no unit = just the number).\n * - With an `ariaLabel` the chart is an image for assistive tech (`role=\"img\"` + that label; without a label no role is set, as an\n * unnamed image is an accessibility error); render the same figures as text next to it\n * (e.g. a visually hidden list) when the exact values matter.\n * - Height is `height` px (shorter on phones: 200px up to 768px wide, 160px up to 480px wide, when the default 240 is used);\n * the width follows the container. Needs the optional peer dependency `chart.js` (>= 4).\n */\n@Component({\n selector: 'ui-bar-chart',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"bc-wrap\" [class.bc-default-height]=\"height() === 240\" [style.height.px]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\" [attr.aria-label]=\"ariaLabel() || null\">\n <canvas #canvas></canvas>\n </div>\n `,\n styles: [`\n :host { display: block; }\n .bc-wrap { position: relative; }\n @media (max-width: 768px) { .bc-wrap.bc-default-height { height: 200px !important; } }\n @media (max-width: 480px) { .bc-wrap.bc-default-height { height: 160px !important; } }\n `],\n})\nexport class BarChartComponent {\n /** Category labels, left to right (one per bar). */\n readonly labels = input<string[]>([]);\n /** The bar values, in the order of `labels`. */\n readonly values = input<number[]>([]);\n /** Bar colour (any CSS colour). */\n readonly color = input('#3b82f6');\n /** Bar colour while hovered. */\n readonly hoverColor = input('#2563eb');\n /** Chart height in px. */\n readonly height = input(240);\n /** Spoken description of the chart. */\n readonly ariaLabel = input('');\n /** Show each bar's value above it. */\n readonly showValues = input(true);\n /** Tooltip unit for exactly 1 (e.g. \"call\"). */\n readonly unitSingular = input('');\n /** Tooltip unit for any other value (e.g. \"calls\"). */\n readonly unitPlural = input('');\n\n private readonly canvas = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n private readonly zone = inject(NgZone);\n private chart: Chart<'bar'> | null = null;\n\n private readonly tooltipText = (value: number): string => {\n const unit = value === 1 ? this.unitSingular() : this.unitPlural();\n return unit ? `${value} ${unit}` : String(value);\n };\n\n protected readonly series = computed(() => ({\n labels: this.labels(),\n data: this.values(),\n color: this.color(),\n hoverColor: this.hoverColor(),\n showValues: this.showValues(),\n }));\n\n constructor() {\n effect(() => {\n const s = this.series();\n const canvas = this.canvas().nativeElement;\n if (!this.chart) {\n registerChartParts();\n this.zone.runOutsideAngular(() => {\n this.chart = new Chart(canvas, {\n type: 'bar',\n data: { labels: s.labels, datasets: [{ data: s.data, backgroundColor: s.color, hoverBackgroundColor: s.hoverColor, borderRadius: 3, borderSkipped: false }] },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n animation: false,\n layout: { padding: { top: 20 } },\n plugins: {\n legend: { display: false },\n tooltip: { callbacks: { label: (item) => this.tooltipText(Number(item.raw)) } },\n },\n scales: {\n y: { beginAtZero: true, ticks: { precision: 0, color: '#94a3b8', font: { size: 11 } }, grid: { color: '#e2e8f0' }, border: { display: false } },\n x: { grid: { display: false }, ticks: { maxRotation: 0, color: '#94a3b8', font: { size: 10 } }, border: { display: false } },\n },\n },\n plugins: [VALUE_LABELS],\n });\n });\n }\n const chart = this.chart!;\n chart.data.labels = s.labels;\n const ds = chart.data.datasets[0];\n ds.data = s.data;\n ds.backgroundColor = s.color;\n ds.hoverBackgroundColor = s.hoverColor;\n // the value labels plugin reads this flag at draw time\n (chart.options.plugins as Record<string, unknown>)['uiBarChartValueLabels'] = { enabled: s.showValues };\n chart.update('none');\n });\n inject(DestroyRef).onDestroy(() => { this.chart?.destroy(); this.chart = null; });\n }\n}\n"],"mappings":";;;AAOA,IAAI,aAAa;AACjB,SAAS,qBAAkB;CACzB,IAAI,YAAY;CAChB,MAAM,SAAS,eAAe,YAAY,eAAe,aAAa,OAAO;CAC7E,aAAa;AACf;AAGA,MAAM,eAA8B;CAClC,IAAI;CACJ,kBAAkB,OAAK;EAErB,IADc,MAAM,QAAQ,QAA8D,wBACtF,EAAM,YAAY,OAAO;EAC7B,MAAM,MAAM,MAAM;EAClB,IAAI,KAAI;EACR,IAAI,YAAY;EAChB,IAAI,OAAO;EACX,IAAI,YAAY;EAChB,IAAI,eAAe;EACnB,MAAM,eAAe,CAAC,CAAC,CAAC,KAAK,SAAS,KAAK,MAAK;GAC9C,MAAM,QAAQ,MAAM,KAAK,SAAS,EAAE,EAAE,KAAK;GAC3C,IAAI,OAAO,UAAU,YAAY,UAAU,GAAG,IAAI,SAAS,OAAO,KAAK,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC;EAC5F,CAAC;EACD,IAAI,QAAO;CACb;AACD;AAiCD,IAAa,oBAAb,MAAa,kBAAiB;CAqC5B,cAAA;EAnCS,KAAA,SAAS,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,SAAS,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,QAAQ,MAAM,WAA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IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-charts.mjs","names":[],"sources":["../../../projects/forgeroute-ui/charts/src/bar-chart/bar-chart.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, DestroyRef, ElementRef, NgZone, computed, effect, inject, input, viewChild,\n} from '@angular/core';\nimport { BarController, BarElement, CategoryScale, Chart, LinearScale, Tooltip } from 'chart.js';\nimport type { Plugin } from 'chart.js';\n\n// Registered when a chart is first created (not at import time) so apps that never use ui-bar-chart can drop chart.js from their bundle.\nlet registered = false;\nfunction registerChartParts(): void {\n if (registered) return;\n Chart.register(BarController, BarElement, CategoryScale, LinearScale, Tooltip);\n registered = true;\n}\n\n/** Draws each bar's value above it (nothing for a 0 bar). Local to ui-bar-chart so no chart.js plugin package is needed. */\nconst VALUE_LABELS: Plugin<'bar'> = {\n id: 'uiBarChartValueLabels',\n afterDatasetsDraw(chart) {\n const opts = (chart.options.plugins as Record<string, { enabled?: boolean } | undefined>)['uiBarChartValueLabels'];\n if (opts?.enabled === false) return;\n const ctx = chart.ctx;\n ctx.save();\n ctx.fillStyle = '#475569';\n ctx.font = '600 11px sans-serif';\n ctx.textAlign = 'center';\n ctx.textBaseline = 'bottom';\n chart.getDatasetMeta(0).data.forEach((bar, i) => {\n const value = chart.data.datasets[0]?.data[i];\n if (typeof value === 'number' && Number.isFinite(value) && value !== 0) ctx.fillText(String(value), bar.x, bar.y - 2);\n });\n ctx.restore();\n },\n};\n\n/**\n * Bar chart of one series (e.g. calls per day). Pass the category `labels` and the matching `values`.\n *\n * <ui-bar-chart [labels]=\"['8/1', '8/2']\" [values]=\"[3, 0]\" ariaLabel=\"Daily call volume\"\n * unitSingular=\"call\" unitPlural=\"calls\" />\n *\n * - Bars show their value above them (`showValues`, a 0 bar shows nothing), the y axis starts at 0 and counts whole numbers.\n * - The tooltip reads \"<value> <unit>\" (`unitSingular` for 1, `unitPlural` otherwise; no unit = just the number).\n * - With an `ariaLabel` the chart is an image for assistive tech (`role=\"img\"` + that label; without a label no role is set, as an\n * unnamed image is an accessibility error); render the same figures as text next to it\n * (e.g. a visually hidden list) when the exact values matter.\n * - Height is `height` px (shorter on phones: 200px up to 768px wide, 160px up to 480px wide, when the default 240 is used);\n * the width follows the container. Needs the optional peer dependency `chart.js` (>= 4).\n */\n@Component({\n selector: 'ui-bar-chart',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"bc-wrap\" [class.bc-default-height]=\"height() === 240\" [style.height.px]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\" [attr.aria-label]=\"ariaLabel() || null\">\n <canvas #canvas></canvas>\n </div>\n `,\n styles: [`\n :host { display: block; }\n .bc-wrap { position: relative; }\n @media (max-width: 768px) { .bc-wrap.bc-default-height { height: 200px !important; } }\n @media (max-width: 480px) { .bc-wrap.bc-default-height { height: 160px !important; } }\n `],\n})\nexport class BarChartComponent {\n /** Category labels, left to right (one per bar). */\n readonly labels = input<string[]>([]);\n /** The bar values, in the order of `labels`. */\n readonly values = input<number[]>([]);\n /** Bar colour (any CSS colour). */\n readonly color = input('#3b82f6');\n /** Bar colour while hovered. */\n readonly hoverColor = input('#2563eb');\n /** Chart height in px. */\n readonly height = input(240);\n /** Spoken description of the chart. */\n readonly ariaLabel = input('');\n /** Show each bar's value above it. */\n readonly showValues = input(true);\n /** Tooltip unit for exactly 1 (e.g. \"call\"). */\n readonly unitSingular = input('');\n /** Tooltip unit for any other value (e.g. \"calls\"). */\n readonly unitPlural = input('');\n\n private readonly canvas = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n private readonly zone = inject(NgZone);\n private chart: Chart<'bar'> | null = null;\n\n private readonly tooltipText = (value: number): string => {\n const unit = value === 1 ? this.unitSingular() : this.unitPlural();\n return unit ? `${value} ${unit}` : String(value);\n };\n\n protected readonly series = computed(() => ({\n labels: this.labels(),\n data: this.values(),\n color: this.color(),\n hoverColor: this.hoverColor(),\n showValues: this.showValues(),\n }));\n\n constructor() {\n effect(() => {\n const s = this.series();\n const canvas = this.canvas().nativeElement;\n if (!this.chart) {\n registerChartParts();\n this.zone.runOutsideAngular(() => {\n this.chart = new Chart(canvas, {\n type: 'bar',\n data: { labels: s.labels, datasets: [{ data: s.data, backgroundColor: s.color, hoverBackgroundColor: s.hoverColor, borderRadius: 3, borderSkipped: false }] },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n animation: false,\n layout: { padding: { top: 20 } },\n plugins: {\n legend: { display: false },\n tooltip: { callbacks: { label: (item) => this.tooltipText(Number(item.raw)) } },\n },\n scales: {\n y: { beginAtZero: true, ticks: { precision: 0, color: '#94a3b8', font: { size: 11 } }, grid: { color: '#e2e8f0' }, border: { display: false } },\n x: { grid: { display: false }, ticks: { maxRotation: 0, color: '#94a3b8', font: { size: 10 } }, border: { display: false } },\n },\n },\n plugins: [VALUE_LABELS],\n });\n });\n }\n const chart = this.chart!;\n chart.data.labels = s.labels;\n const ds = chart.data.datasets[0];\n ds.data = s.data;\n ds.backgroundColor = s.color;\n ds.hoverBackgroundColor = s.hoverColor;\n // the value labels plugin reads this flag at draw time\n (chart.options.plugins as Record<string, unknown>)['uiBarChartValueLabels'] = { enabled: s.showValues };\n chart.update('none');\n });\n inject(DestroyRef).onDestroy(() => { this.chart?.destroy(); this.chart = null; });\n }\n}\n"],"mappings":";;;AAOA,IAAI,aAAa;AACjB,SAAS,qBAAkB;CACzB,IAAI,YAAY;CAChB,MAAM,SAAS,eAAe,YAAY,eAAe,aAAa,OAAO;CAC7E,aAAa;AACf;AAGA,MAAM,eAA8B;CAClC,IAAI;CACJ,kBAAkB,OAAK;EAErB,IADc,MAAM,QAAQ,QAA8D,wBACtF,EAAM,YAAY,OAAO;EAC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AA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, Injector, PLATFORM_ID, afterNextRender, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
|
|
4
|
+
const PDF_VIEWER_WORKER_SRC = new InjectionToken("PDF_VIEWER_WORKER_SRC", {
|
|
5
|
+
providedIn: "root",
|
|
6
|
+
factory: () => ""
|
|
7
|
+
});
|
|
8
|
+
const DEFAULT_MAX_WIDTH = 700;
|
|
9
|
+
const DEFAULT_FIELD_HEIGHT = 14;
|
|
10
|
+
const MAX_CANVAS_PIXELS = 16e6;
|
|
11
|
+
const MAX_TOTAL_CANVAS_PIXELS = 48e6;
|
|
12
|
+
const WORKER_MISSING = "PDF worker is not configured.";
|
|
13
|
+
var PdfViewerComponent = class PdfViewerComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.src = input(null, ...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
16
|
+
this.data = input(null, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
17
|
+
this.httpHeaders = input({}, ...ngDevMode ? [{ debugName: "httpHeaders" }] : /* istanbul ignore next */ []);
|
|
18
|
+
this.withCredentials = input(false, ...ngDevMode ? [{ debugName: "withCredentials" }] : /* istanbul ignore next */ []);
|
|
19
|
+
this.workerSrc = input("", ...ngDevMode ? [{ debugName: "workerSrc" }] : /* istanbul ignore next */ []);
|
|
20
|
+
this.maxPageWidth = input(DEFAULT_MAX_WIDTH, ...ngDevMode ? [{ debugName: "maxPageWidth" }] : /* istanbul ignore next */ []);
|
|
21
|
+
this.pixelRatio = input(null, ...ngDevMode ? [{ debugName: "pixelRatio" }] : /* istanbul ignore next */ []);
|
|
22
|
+
this.fields = input([], ...ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []);
|
|
23
|
+
this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
24
|
+
this.loadingText = input("Loading document…", ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
|
|
25
|
+
this.errorText = input("Failed to load document.", ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
|
|
26
|
+
this.loaded = output();
|
|
27
|
+
this.loadFailed = output();
|
|
28
|
+
this.pagesRendered = output();
|
|
29
|
+
this.status = signal("idle", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
|
|
30
|
+
this.pageSizes = signal([], ...ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []);
|
|
31
|
+
this.containerWidth = signal(0, ...ngDevMode ? [{ debugName: "containerWidth" }] : /* istanbul ignore next */ []);
|
|
32
|
+
this.customError = signal("", ...ngDevMode ? [{ debugName: "customError" }] : /* istanbul ignore next */ []);
|
|
33
|
+
this.errorMessage = computed(() => this.customError() || this.errorText(), ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
34
|
+
this.drawKey = computed(() => this.views().map((v) => v.canvasWidth + "x" + v.canvasHeight).join("|"), ...ngDevMode ? [{ debugName: "drawKey" }] : /* istanbul ignore next */ []);
|
|
35
|
+
this.effectiveWidth = computed(() => this.widthFor(this.containerWidth()), ...ngDevMode ? [{ debugName: "effectiveWidth" }] : /* istanbul ignore next */ []);
|
|
36
|
+
this.views = computed(() => {
|
|
37
|
+
const sizes = this.pageSizes();
|
|
38
|
+
const cssWidth = this.effectiveWidth();
|
|
39
|
+
const ratio = this.resolvedRatio();
|
|
40
|
+
const byPage = /* @__PURE__ */ new Map();
|
|
41
|
+
for (const f of this.fields()) {
|
|
42
|
+
if (!Number.isInteger(f.page) || f.page < 1 || f.page > sizes.length) continue;
|
|
43
|
+
const list = byPage.get(f.page) ?? [];
|
|
44
|
+
list.push(f);
|
|
45
|
+
byPage.set(f.page, list);
|
|
46
|
+
}
|
|
47
|
+
const base = sizes.map((size) => {
|
|
48
|
+
const scale = cssWidth / size.width;
|
|
49
|
+
const cssHeight = size.height * scale;
|
|
50
|
+
return {
|
|
51
|
+
scale,
|
|
52
|
+
cssHeight,
|
|
53
|
+
pageRatio: Math.min(ratio, Math.sqrt(MAX_CANVAS_PIXELS / (cssWidth * cssHeight)))
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
let factor = 1;
|
|
57
|
+
const bitmaps = () => base.map((b) => {
|
|
58
|
+
const r = Math.max(Math.min(b.pageRatio, 1), b.pageRatio * factor);
|
|
59
|
+
return {
|
|
60
|
+
w: Math.floor(cssWidth * r),
|
|
61
|
+
h: Math.floor(b.cssHeight * r)
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
let sized = bitmaps();
|
|
65
|
+
for (let i = 0; i < 6; i++) {
|
|
66
|
+
const total = sized.reduce((sum, b) => sum + b.w * b.h, 0);
|
|
67
|
+
if (total <= MAX_TOTAL_CANVAS_PIXELS) break;
|
|
68
|
+
factor *= Math.sqrt(MAX_TOTAL_CANVAS_PIXELS / total);
|
|
69
|
+
sized = bitmaps();
|
|
70
|
+
}
|
|
71
|
+
return sizes.map((size, i) => {
|
|
72
|
+
const { scale, cssHeight } = base[i];
|
|
73
|
+
const fields = (byPage.get(i + 1) ?? []).map((f) => {
|
|
74
|
+
const h = f.height ?? DEFAULT_FIELD_HEIGHT;
|
|
75
|
+
const left = f.x / size.width * 100;
|
|
76
|
+
return {
|
|
77
|
+
id: f.id,
|
|
78
|
+
label: f.label,
|
|
79
|
+
tone: f.tone ?? "blue",
|
|
80
|
+
left,
|
|
81
|
+
top: (size.height - f.y - h) / size.height * 100,
|
|
82
|
+
width: f.width == null ? null : f.width / size.width * 100,
|
|
83
|
+
maxWidth: Math.max(0, 100 - left),
|
|
84
|
+
height: h / size.height * 100,
|
|
85
|
+
fontPx: Math.max(9, h * scale * .7)
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
number: i + 1,
|
|
90
|
+
cssWidth,
|
|
91
|
+
cssHeight,
|
|
92
|
+
canvasWidth: sized[i].w,
|
|
93
|
+
canvasHeight: sized[i].h,
|
|
94
|
+
fields
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}, ...ngDevMode ? [{ debugName: "views" }] : /* istanbul ignore next */ []);
|
|
98
|
+
this.host = inject(ElementRef);
|
|
99
|
+
this.injector = inject(Injector);
|
|
100
|
+
this.tokenWorkerSrc = inject(PDF_VIEWER_WORKER_SRC);
|
|
101
|
+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
102
|
+
this.headersKey = computed(() => JSON.stringify(this.httpHeaders()), ...ngDevMode ? [{ debugName: "headersKey" }] : /* istanbul ignore next */ []);
|
|
103
|
+
this.loadToken = 0;
|
|
104
|
+
this.drawToken = 0;
|
|
105
|
+
this.doc = null;
|
|
106
|
+
this.loadingTask = null;
|
|
107
|
+
this.pageProxies = [];
|
|
108
|
+
this.renderTasks = [];
|
|
109
|
+
this.observer = null;
|
|
110
|
+
this.frame = 0;
|
|
111
|
+
this.lastDrawKey = "";
|
|
112
|
+
effect(() => {
|
|
113
|
+
this.src();
|
|
114
|
+
this.data();
|
|
115
|
+
this.headersKey();
|
|
116
|
+
this.withCredentials();
|
|
117
|
+
this.workerSrc();
|
|
118
|
+
if (!this.isBrowser) return;
|
|
119
|
+
untracked(() => void this.startLoad());
|
|
120
|
+
});
|
|
121
|
+
effect(() => {
|
|
122
|
+
const key = this.drawKey();
|
|
123
|
+
untracked(() => {
|
|
124
|
+
if (this.status() === "ready" && key !== this.lastDrawKey) this.scheduleDraw();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
if (this.isBrowser && typeof ResizeObserver !== "undefined") {
|
|
128
|
+
this.observer = new ResizeObserver(() => this.onResize());
|
|
129
|
+
this.observer.observe(this.host.nativeElement);
|
|
130
|
+
}
|
|
131
|
+
inject(DestroyRef).onDestroy(() => {
|
|
132
|
+
this.loadToken++;
|
|
133
|
+
this.drawToken++;
|
|
134
|
+
this.observer?.disconnect();
|
|
135
|
+
if (this.frame && typeof cancelAnimationFrame === "function") cancelAnimationFrame(this.frame);
|
|
136
|
+
this.teardown();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
loadPdfJs() {
|
|
140
|
+
return import("pdfjs-dist");
|
|
141
|
+
}
|
|
142
|
+
resolvedRatio() {
|
|
143
|
+
const explicit = this.pixelRatio();
|
|
144
|
+
if (explicit != null && explicit > 0) return explicit;
|
|
145
|
+
const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
|
|
146
|
+
return Math.min(Math.max(dpr, 1), 3);
|
|
147
|
+
}
|
|
148
|
+
widthFor(container) {
|
|
149
|
+
const max = this.maxPageWidth() > 0 ? this.maxPageWidth() : DEFAULT_MAX_WIDTH;
|
|
150
|
+
return container > 0 ? Math.min(max, container) : max;
|
|
151
|
+
}
|
|
152
|
+
async startLoad() {
|
|
153
|
+
const token = ++this.loadToken;
|
|
154
|
+
this.drawToken++;
|
|
155
|
+
this.teardown();
|
|
156
|
+
this.pageSizes.set([]);
|
|
157
|
+
this.customError.set("");
|
|
158
|
+
const data = this.data();
|
|
159
|
+
const src = this.src();
|
|
160
|
+
if (data == null && !src) {
|
|
161
|
+
this.status.set("idle");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.containerWidth.set(this.host.nativeElement.clientWidth);
|
|
165
|
+
this.status.set("loading");
|
|
166
|
+
try {
|
|
167
|
+
const pdfjs = await this.loadPdfJs();
|
|
168
|
+
if (token !== this.loadToken) return;
|
|
169
|
+
const worker = this.workerSrc() || this.tokenWorkerSrc;
|
|
170
|
+
if (worker) pdfjs.GlobalWorkerOptions.workerSrc = worker;
|
|
171
|
+
else if (!pdfjs.GlobalWorkerOptions.workerSrc) {
|
|
172
|
+
this.fail(/* @__PURE__ */ new Error(WORKER_MISSING), WORKER_MISSING);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const params = data != null ? { data: data instanceof Uint8Array ? data.slice() : new Uint8Array(data.slice(0)) } : { url: src };
|
|
176
|
+
if (data == null) {
|
|
177
|
+
const headers = this.httpHeaders();
|
|
178
|
+
if (Object.keys(headers).length > 0) params["httpHeaders"] = headers;
|
|
179
|
+
if (this.withCredentials()) params["withCredentials"] = true;
|
|
180
|
+
}
|
|
181
|
+
const task = pdfjs.getDocument(params);
|
|
182
|
+
this.loadingTask = task;
|
|
183
|
+
const doc = await task.promise;
|
|
184
|
+
if (token !== this.loadToken) {
|
|
185
|
+
this.destroyDoc(doc);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
this.doc = doc;
|
|
189
|
+
const proxies = [];
|
|
190
|
+
const sizes = [];
|
|
191
|
+
for (let i = 1; i <= doc.numPages; i++) {
|
|
192
|
+
const page = await doc.getPage(i);
|
|
193
|
+
if (token !== this.loadToken) return;
|
|
194
|
+
const vp = page.getViewport({ scale: 1 });
|
|
195
|
+
if (!(Number.isFinite(vp.width) && Number.isFinite(vp.height) && vp.width > 0 && vp.height > 0)) throw new Error("invalid page size");
|
|
196
|
+
proxies.push(page);
|
|
197
|
+
sizes.push({
|
|
198
|
+
width: vp.width,
|
|
199
|
+
height: vp.height
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
this.pageProxies = proxies;
|
|
203
|
+
this.containerWidth.set(this.host.nativeElement.clientWidth);
|
|
204
|
+
this.pageSizes.set(sizes);
|
|
205
|
+
this.status.set("ready");
|
|
206
|
+
this.loaded.emit({
|
|
207
|
+
pageCount: sizes.length,
|
|
208
|
+
pages: sizes.map((s) => ({ ...s })),
|
|
209
|
+
document: doc
|
|
210
|
+
});
|
|
211
|
+
this.scheduleDraw();
|
|
212
|
+
} catch (err) {
|
|
213
|
+
if (token !== this.loadToken) return;
|
|
214
|
+
this.fail(err);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
fail(err, message = "") {
|
|
218
|
+
this.loadToken++;
|
|
219
|
+
this.drawToken++;
|
|
220
|
+
this.teardown();
|
|
221
|
+
this.pageSizes.set([]);
|
|
222
|
+
this.customError.set(message);
|
|
223
|
+
this.status.set("error");
|
|
224
|
+
this.loadFailed.emit(err);
|
|
225
|
+
}
|
|
226
|
+
scheduleDraw() {
|
|
227
|
+
const id = ++this.drawToken;
|
|
228
|
+
this.lastDrawKey = this.drawKey();
|
|
229
|
+
this.cancelRenders();
|
|
230
|
+
afterNextRender(() => void this.draw(id), { injector: this.injector });
|
|
231
|
+
}
|
|
232
|
+
async draw(id) {
|
|
233
|
+
const token = this.loadToken;
|
|
234
|
+
const stale = () => id !== this.drawToken || token !== this.loadToken;
|
|
235
|
+
this.cancelRenders();
|
|
236
|
+
const views = this.views();
|
|
237
|
+
const canvases = Array.from(this.host.nativeElement.querySelectorAll("canvas.pv-canvas"));
|
|
238
|
+
const sizes = this.pageSizes();
|
|
239
|
+
const scales = [];
|
|
240
|
+
try {
|
|
241
|
+
for (let i = 0; i < views.length; i++) {
|
|
242
|
+
if (stale()) return;
|
|
243
|
+
const canvas = canvases[i];
|
|
244
|
+
const page = this.pageProxies[i];
|
|
245
|
+
if (!canvas || !page || !canvas.getContext("2d")) throw new Error("canvas unavailable");
|
|
246
|
+
const cssScale = views[i].cssWidth / sizes[i].width;
|
|
247
|
+
scales.push(cssScale);
|
|
248
|
+
const viewport = page.getViewport({ scale: views[i].canvasWidth / sizes[i].width });
|
|
249
|
+
const task = page.render({
|
|
250
|
+
canvas,
|
|
251
|
+
viewport
|
|
252
|
+
});
|
|
253
|
+
this.renderTasks.push(task);
|
|
254
|
+
await task.promise;
|
|
255
|
+
}
|
|
256
|
+
} catch (err) {
|
|
257
|
+
if (stale() || err?.name === "RenderingCancelledException") return;
|
|
258
|
+
this.fail(err);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (stale()) return;
|
|
262
|
+
this.pagesRendered.emit({
|
|
263
|
+
pageCount: views.length,
|
|
264
|
+
scale: scales[0] ?? 1,
|
|
265
|
+
pageWidths: views.map((v) => v.cssWidth)
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
onResize() {
|
|
269
|
+
if (this.frame || typeof requestAnimationFrame !== "function") return;
|
|
270
|
+
this.frame = requestAnimationFrame(() => {
|
|
271
|
+
this.frame = 0;
|
|
272
|
+
const before = this.effectiveWidth();
|
|
273
|
+
this.containerWidth.set(this.host.nativeElement.clientWidth);
|
|
274
|
+
if (this.effectiveWidth() !== before && this.status() === "ready") this.scheduleDraw();
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
cancelRenders() {
|
|
278
|
+
for (const t of this.renderTasks) try {
|
|
279
|
+
t.cancel?.();
|
|
280
|
+
} catch {}
|
|
281
|
+
this.renderTasks = [];
|
|
282
|
+
}
|
|
283
|
+
teardown() {
|
|
284
|
+
this.cancelRenders();
|
|
285
|
+
const task = this.loadingTask;
|
|
286
|
+
this.loadingTask = null;
|
|
287
|
+
if (task) try {
|
|
288
|
+
Promise.resolve(task.destroy?.()).catch(() => void 0);
|
|
289
|
+
} catch {}
|
|
290
|
+
const doc = this.doc;
|
|
291
|
+
this.doc = null;
|
|
292
|
+
this.pageProxies = [];
|
|
293
|
+
if (doc) this.destroyDoc(doc);
|
|
294
|
+
}
|
|
295
|
+
destroyDoc(doc) {
|
|
296
|
+
try {
|
|
297
|
+
Promise.resolve(doc.destroy()).catch(() => void 0);
|
|
298
|
+
} catch {}
|
|
299
|
+
}
|
|
300
|
+
static {
|
|
301
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
302
|
+
minVersion: "12.0.0",
|
|
303
|
+
version: "22.2.2",
|
|
304
|
+
ngImport: i0,
|
|
305
|
+
type: PdfViewerComponent,
|
|
306
|
+
deps: [],
|
|
307
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
static {
|
|
311
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
312
|
+
minVersion: "17.0.0",
|
|
313
|
+
version: "22.2.2",
|
|
314
|
+
type: PdfViewerComponent,
|
|
315
|
+
isStandalone: true,
|
|
316
|
+
selector: "ui-pdf-viewer",
|
|
317
|
+
inputs: {
|
|
318
|
+
src: {
|
|
319
|
+
classPropertyName: "src",
|
|
320
|
+
publicName: "src",
|
|
321
|
+
isSignal: true,
|
|
322
|
+
isRequired: false,
|
|
323
|
+
transformFunction: null
|
|
324
|
+
},
|
|
325
|
+
data: {
|
|
326
|
+
classPropertyName: "data",
|
|
327
|
+
publicName: "data",
|
|
328
|
+
isSignal: true,
|
|
329
|
+
isRequired: false,
|
|
330
|
+
transformFunction: null
|
|
331
|
+
},
|
|
332
|
+
httpHeaders: {
|
|
333
|
+
classPropertyName: "httpHeaders",
|
|
334
|
+
publicName: "httpHeaders",
|
|
335
|
+
isSignal: true,
|
|
336
|
+
isRequired: false,
|
|
337
|
+
transformFunction: null
|
|
338
|
+
},
|
|
339
|
+
withCredentials: {
|
|
340
|
+
classPropertyName: "withCredentials",
|
|
341
|
+
publicName: "withCredentials",
|
|
342
|
+
isSignal: true,
|
|
343
|
+
isRequired: false,
|
|
344
|
+
transformFunction: null
|
|
345
|
+
},
|
|
346
|
+
workerSrc: {
|
|
347
|
+
classPropertyName: "workerSrc",
|
|
348
|
+
publicName: "workerSrc",
|
|
349
|
+
isSignal: true,
|
|
350
|
+
isRequired: false,
|
|
351
|
+
transformFunction: null
|
|
352
|
+
},
|
|
353
|
+
maxPageWidth: {
|
|
354
|
+
classPropertyName: "maxPageWidth",
|
|
355
|
+
publicName: "maxPageWidth",
|
|
356
|
+
isSignal: true,
|
|
357
|
+
isRequired: false,
|
|
358
|
+
transformFunction: null
|
|
359
|
+
},
|
|
360
|
+
pixelRatio: {
|
|
361
|
+
classPropertyName: "pixelRatio",
|
|
362
|
+
publicName: "pixelRatio",
|
|
363
|
+
isSignal: true,
|
|
364
|
+
isRequired: false,
|
|
365
|
+
transformFunction: null
|
|
366
|
+
},
|
|
367
|
+
fields: {
|
|
368
|
+
classPropertyName: "fields",
|
|
369
|
+
publicName: "fields",
|
|
370
|
+
isSignal: true,
|
|
371
|
+
isRequired: false,
|
|
372
|
+
transformFunction: null
|
|
373
|
+
},
|
|
374
|
+
ariaLabel: {
|
|
375
|
+
classPropertyName: "ariaLabel",
|
|
376
|
+
publicName: "ariaLabel",
|
|
377
|
+
isSignal: true,
|
|
378
|
+
isRequired: false,
|
|
379
|
+
transformFunction: null
|
|
380
|
+
},
|
|
381
|
+
loadingText: {
|
|
382
|
+
classPropertyName: "loadingText",
|
|
383
|
+
publicName: "loadingText",
|
|
384
|
+
isSignal: true,
|
|
385
|
+
isRequired: false,
|
|
386
|
+
transformFunction: null
|
|
387
|
+
},
|
|
388
|
+
errorText: {
|
|
389
|
+
classPropertyName: "errorText",
|
|
390
|
+
publicName: "errorText",
|
|
391
|
+
isSignal: true,
|
|
392
|
+
isRequired: false,
|
|
393
|
+
transformFunction: null
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
outputs: {
|
|
397
|
+
loaded: "loaded",
|
|
398
|
+
loadFailed: "loadFailed",
|
|
399
|
+
pagesRendered: "pagesRendered"
|
|
400
|
+
},
|
|
401
|
+
ngImport: i0,
|
|
402
|
+
template: `
|
|
403
|
+
<div class="pv-root" [attr.role]="ariaLabel() ? 'region' : null" [attr.aria-label]="ariaLabel() || null"
|
|
404
|
+
[attr.aria-busy]="status() === 'loading'">
|
|
405
|
+
<div class="pv-live" role="status" aria-live="polite">{{ status() === 'loading' ? loadingText() : '' }}</div>
|
|
406
|
+
@switch (status()) {
|
|
407
|
+
@case ('loading') { <div class="pv-state pv-loading" aria-hidden="true">{{ loadingText() }}</div> }
|
|
408
|
+
@case ('error') { <div class="pv-state pv-error" role="alert">{{ errorMessage() }}</div> }
|
|
409
|
+
@case ('ready') {
|
|
410
|
+
<div class="pv-pages">
|
|
411
|
+
@for (p of views(); track p.number) {
|
|
412
|
+
<div class="pv-page" [style.width.px]="p.cssWidth">
|
|
413
|
+
<canvas class="pv-canvas" role="img" [attr.aria-label]="'Page ' + p.number + ' of ' + views().length"
|
|
414
|
+
[attr.width]="p.canvasWidth" [attr.height]="p.canvasHeight"></canvas>
|
|
415
|
+
@for (f of p.fields; track $index) {
|
|
416
|
+
<div class="pv-field pv-tone-{{ f.tone }}"
|
|
417
|
+
[style.left.%]="f.left" [style.top.%]="f.top" [style.width.%]="f.width" [style.max-width.%]="f.maxWidth"
|
|
418
|
+
[style.height.%]="f.height" [style.font-size.px]="f.fontPx">
|
|
419
|
+
<span class="pv-field-label">{{ f.label }}</span>
|
|
420
|
+
</div>
|
|
421
|
+
}
|
|
422
|
+
</div>
|
|
423
|
+
}
|
|
424
|
+
</div>
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
</div>
|
|
428
|
+
`,
|
|
429
|
+
isInline: true,
|
|
430
|
+
styles: [":host{display:block;width:100%}.pv-root{position:relative}.pv-live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.pv-state{display:flex;align-items:center;justify-content:center;width:100%;min-height:12rem;padding:0 16px;text-align:center;font-size:.8125rem;line-height:1.4;overflow-wrap:anywhere;box-sizing:border-box}.pv-loading{color:#64748b}.pv-error{color:#dc2626}.pv-pages{display:flex;flex-direction:column;gap:16px;width:100%;max-width:100%}.pv-page{position:relative;margin:0 auto;max-width:100%}.pv-canvas{display:block;width:100%;height:auto;background:#fff;border-radius:2px;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.pv-field{position:absolute;display:flex;align-items:center;box-sizing:border-box;padding:0 4px;overflow:hidden;pointer-events:none;border:1px solid;border-radius:2px;-webkit-user-select:none;user-select:none}.pv-field-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1}.pv-tone-blue{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8}.pv-tone-green{background:#dcfce7;border-color:#86efac;color:#15803d}.pv-tone-amber{background:#fef3c7;border-color:#fcd34d;color:#92400e}.pv-tone-red{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}.pv-tone-slate{background:#f1f5f9;border-color:#cbd5e1;color:#334155}\n"],
|
|
431
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
436
|
+
minVersion: "12.0.0",
|
|
437
|
+
version: "22.2.2",
|
|
438
|
+
ngImport: i0,
|
|
439
|
+
type: PdfViewerComponent,
|
|
440
|
+
decorators: [{
|
|
441
|
+
type: Component,
|
|
442
|
+
args: [{
|
|
443
|
+
selector: "ui-pdf-viewer",
|
|
444
|
+
standalone: true,
|
|
445
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
446
|
+
template: `
|
|
447
|
+
<div class="pv-root" [attr.role]="ariaLabel() ? 'region' : null" [attr.aria-label]="ariaLabel() || null"
|
|
448
|
+
[attr.aria-busy]="status() === 'loading'">
|
|
449
|
+
<div class="pv-live" role="status" aria-live="polite">{{ status() === 'loading' ? loadingText() : '' }}</div>
|
|
450
|
+
@switch (status()) {
|
|
451
|
+
@case ('loading') { <div class="pv-state pv-loading" aria-hidden="true">{{ loadingText() }}</div> }
|
|
452
|
+
@case ('error') { <div class="pv-state pv-error" role="alert">{{ errorMessage() }}</div> }
|
|
453
|
+
@case ('ready') {
|
|
454
|
+
<div class="pv-pages">
|
|
455
|
+
@for (p of views(); track p.number) {
|
|
456
|
+
<div class="pv-page" [style.width.px]="p.cssWidth">
|
|
457
|
+
<canvas class="pv-canvas" role="img" [attr.aria-label]="'Page ' + p.number + ' of ' + views().length"
|
|
458
|
+
[attr.width]="p.canvasWidth" [attr.height]="p.canvasHeight"></canvas>
|
|
459
|
+
@for (f of p.fields; track $index) {
|
|
460
|
+
<div class="pv-field pv-tone-{{ f.tone }}"
|
|
461
|
+
[style.left.%]="f.left" [style.top.%]="f.top" [style.width.%]="f.width" [style.max-width.%]="f.maxWidth"
|
|
462
|
+
[style.height.%]="f.height" [style.font-size.px]="f.fontPx">
|
|
463
|
+
<span class="pv-field-label">{{ f.label }}</span>
|
|
464
|
+
</div>
|
|
465
|
+
}
|
|
466
|
+
</div>
|
|
467
|
+
}
|
|
468
|
+
</div>
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
</div>
|
|
472
|
+
`,
|
|
473
|
+
styles: [":host{display:block;width:100%}.pv-root{position:relative}.pv-live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.pv-state{display:flex;align-items:center;justify-content:center;width:100%;min-height:12rem;padding:0 16px;text-align:center;font-size:.8125rem;line-height:1.4;overflow-wrap:anywhere;box-sizing:border-box}.pv-loading{color:#64748b}.pv-error{color:#dc2626}.pv-pages{display:flex;flex-direction:column;gap:16px;width:100%;max-width:100%}.pv-page{position:relative;margin:0 auto;max-width:100%}.pv-canvas{display:block;width:100%;height:auto;background:#fff;border-radius:2px;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.pv-field{position:absolute;display:flex;align-items:center;box-sizing:border-box;padding:0 4px;overflow:hidden;pointer-events:none;border:1px solid;border-radius:2px;-webkit-user-select:none;user-select:none}.pv-field-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1}.pv-tone-blue{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8}.pv-tone-green{background:#dcfce7;border-color:#86efac;color:#15803d}.pv-tone-amber{background:#fef3c7;border-color:#fcd34d;color:#92400e}.pv-tone-red{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}.pv-tone-slate{background:#f1f5f9;border-color:#cbd5e1;color:#334155}\n"]
|
|
474
|
+
}]
|
|
475
|
+
}],
|
|
476
|
+
ctorParameters: () => [],
|
|
477
|
+
propDecorators: {
|
|
478
|
+
src: [{
|
|
479
|
+
type: i0.Input,
|
|
480
|
+
args: [{
|
|
481
|
+
isSignal: true,
|
|
482
|
+
alias: "src",
|
|
483
|
+
required: false
|
|
484
|
+
}]
|
|
485
|
+
}],
|
|
486
|
+
data: [{
|
|
487
|
+
type: i0.Input,
|
|
488
|
+
args: [{
|
|
489
|
+
isSignal: true,
|
|
490
|
+
alias: "data",
|
|
491
|
+
required: false
|
|
492
|
+
}]
|
|
493
|
+
}],
|
|
494
|
+
httpHeaders: [{
|
|
495
|
+
type: i0.Input,
|
|
496
|
+
args: [{
|
|
497
|
+
isSignal: true,
|
|
498
|
+
alias: "httpHeaders",
|
|
499
|
+
required: false
|
|
500
|
+
}]
|
|
501
|
+
}],
|
|
502
|
+
withCredentials: [{
|
|
503
|
+
type: i0.Input,
|
|
504
|
+
args: [{
|
|
505
|
+
isSignal: true,
|
|
506
|
+
alias: "withCredentials",
|
|
507
|
+
required: false
|
|
508
|
+
}]
|
|
509
|
+
}],
|
|
510
|
+
workerSrc: [{
|
|
511
|
+
type: i0.Input,
|
|
512
|
+
args: [{
|
|
513
|
+
isSignal: true,
|
|
514
|
+
alias: "workerSrc",
|
|
515
|
+
required: false
|
|
516
|
+
}]
|
|
517
|
+
}],
|
|
518
|
+
maxPageWidth: [{
|
|
519
|
+
type: i0.Input,
|
|
520
|
+
args: [{
|
|
521
|
+
isSignal: true,
|
|
522
|
+
alias: "maxPageWidth",
|
|
523
|
+
required: false
|
|
524
|
+
}]
|
|
525
|
+
}],
|
|
526
|
+
pixelRatio: [{
|
|
527
|
+
type: i0.Input,
|
|
528
|
+
args: [{
|
|
529
|
+
isSignal: true,
|
|
530
|
+
alias: "pixelRatio",
|
|
531
|
+
required: false
|
|
532
|
+
}]
|
|
533
|
+
}],
|
|
534
|
+
fields: [{
|
|
535
|
+
type: i0.Input,
|
|
536
|
+
args: [{
|
|
537
|
+
isSignal: true,
|
|
538
|
+
alias: "fields",
|
|
539
|
+
required: false
|
|
540
|
+
}]
|
|
541
|
+
}],
|
|
542
|
+
ariaLabel: [{
|
|
543
|
+
type: i0.Input,
|
|
544
|
+
args: [{
|
|
545
|
+
isSignal: true,
|
|
546
|
+
alias: "ariaLabel",
|
|
547
|
+
required: false
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
loadingText: [{
|
|
551
|
+
type: i0.Input,
|
|
552
|
+
args: [{
|
|
553
|
+
isSignal: true,
|
|
554
|
+
alias: "loadingText",
|
|
555
|
+
required: false
|
|
556
|
+
}]
|
|
557
|
+
}],
|
|
558
|
+
errorText: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "errorText",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
loaded: [{
|
|
567
|
+
type: i0.Output,
|
|
568
|
+
args: ["loaded"]
|
|
569
|
+
}],
|
|
570
|
+
loadFailed: [{
|
|
571
|
+
type: i0.Output,
|
|
572
|
+
args: ["loadFailed"]
|
|
573
|
+
}],
|
|
574
|
+
pagesRendered: [{
|
|
575
|
+
type: i0.Output,
|
|
576
|
+
args: ["pagesRendered"]
|
|
577
|
+
}]
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
export { PDF_VIEWER_WORKER_SRC, PdfViewerComponent };
|
|
581
|
+
|
|
582
|
+
//# sourceMappingURL=forgeroute-ui-pdf.mjs.map
|