overview-components 1.1.177 → 1.1.179

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/README.md CHANGED
@@ -20,12 +20,19 @@ This package is **ESM-only** (`"type": "module"`). It cannot be loaded with `req
20
20
  | `lit` `^3.0.0` | **yes** | all components (provided by the consumer so a single Lit instance is shared) |
21
21
  | `pdfjs-dist` `>=5.0.0` | **yes** | `lit-attachments-tab` (PDF thumbnails) |
22
22
  | `react` `>=17` | only for `overview-components/react` | React wrappers |
23
- | `xlsx` (SheetJS) `>=0.18.0` | optional | Excel export in `lit-data-grid-tanstack` (lazily imported; or set `window.XLSX`) |
23
+ | SheetJS via `window.XLSX` | optional | Excel export in `lit-data-grid-tanstack` (the host provides SheetJS; it is **not** bundled) |
24
24
 
25
25
  ```bash
26
26
  npm install lit pdfjs-dist # required peers
27
27
  npm install react # only if you use the React wrappers
28
- npm install xlsx # only if you use the Excel export
28
+ ```
29
+
30
+ For Excel export the host app makes SheetJS available on `window.XLSX` (it is not bundled, to
31
+ avoid forcing a heavy/CVE-prone dependency on every consumer):
32
+
33
+ ```js
34
+ import * as XLSX from 'xlsx'; // any SheetJS build/CDN works
35
+ window.XLSX = XLSX;
29
36
  ```
30
37
 
31
38
  ## Co nainstalovat podle funkcionality (v cílové aplikaci)
@@ -39,7 +46,7 @@ Nainstaluj jen to, co odpovídá tomu, co skutečně používáš:
39
46
  | Lit / vanilla komponenty (`<lit-…>`) | `overview-components` | `overview-components`, `lit`, `pdfjs-dist` |
40
47
  | React wrappery (`<Badge />`, …) | `overview-components/react` | `overview-components`, `lit`, `pdfjs-dist`, `react` |
41
48
  | Jen JSON schémata (i v Node, bez DOM) | `overview-components/schemas` | `overview-components` (nic dalšího) |
42
- | Excel export v `lit-data-grid-tanstack` | — (navíc k výše uvedenému) | `xlsx` *(nebo nastav `window.XLSX`)* |
49
+ | Excel export v `lit-data-grid-tanstack` | — (navíc k výše uvedenému) | sprístupniť `window.XLSX` (SheetJS nebundluje sa) |
43
50
  | PDF náhledy v `lit-attachments-tab` | — (součást základu) | `pdfjs-dist` *(už je v základu)* |
44
51
 
45
52
  > Hlavní vstupní bod `overview-components` natáhne celou knihovnu komponent včetně
@@ -58,13 +65,14 @@ npm install react
58
65
  # C) Jen JSON schémata (např. validace v Node) — stačí samotný balíček
59
66
  npm install overview-components
60
67
 
61
- # D) Excel export v data-gridu (k tomu, co je v A nebo B)
62
- npm install xlsx
68
+ # D) Excel export v data-gridu (k tomu, co je v A nebo B) — SheetJS se nebundluje,
69
+ # host ho sprístupní na window.XLSX:
70
+ # import * as XLSX from 'xlsx'; window.XLSX = XLSX;
63
71
  ```
64
72
 
65
73
  Pokud některou peer závislost nenainstaluješ, build cílové app spadne na
66
- `Cannot find module '…'` (např. chybějící `lit`), případně Excel export vyhodí
67
- srozumitelnou chybu o chybějícím `xlsx`.
74
+ `Cannot find module '…'` (např. chybějící `lit`); Excel export bez `window.XLSX`
75
+ vyhodí srozumitelnou chybu.
68
76
 
69
77
  ## Usage — Lit / vanilla
70
78
 
@@ -319,19 +319,12 @@ export class LitDataGridTanstack extends LitElement {
319
319
  async loadXLSX() {
320
320
  if (this.server || window.XLSX)
321
321
  return;
322
- // Excel export je voliteľný. Konzument môže buď nastaviť window.XLSX (napr. načítať
323
- // SheetJS skript), alebo nainštalovať voliteľnú peer závislosť "xlsx", ktorá sa tu
324
- // lenivo naimportuje. Špecifikátor je v premennej zámerne bundler ho neanalyzuje
325
- // staticky, takže build konzumenta bez "xlsx" sa nerozbije.
326
- try {
327
- const specifier = 'xlsx';
328
- const mod = await import(/* @vite-ignore */ specifier);
329
- window.XLSX = mod?.default ?? mod;
330
- }
331
- catch (err) {
332
- throw new Error('Excel export vyžaduje knižnicu XLSX (SheetJS). Nainštalujte voliteľnú ' +
333
- 'závislosť "xlsx" alebo nastavte window.XLSX pred exportom.');
334
- }
322
+ // Excel export zámerne NEbundluje SheetJS (ťažká, voliteľná knižnica) žiadny
323
+ // dynamický import, aby bundler konzumenta nehlásil "Critical dependency" a aby sa
324
+ // do balíčka neťahala závislosť so známymi CVE. Hosťovská aplikácia sprístupní
325
+ // window.XLSX pred exportom, napr.: import * as XLSX from 'xlsx'; window.XLSX = XLSX;
326
+ throw new Error('Excel export vyžaduje SheetJS vo `window.XLSX`. Sprístupnite ho v aplikácii ' +
327
+ '(napr. `import * as XLSX from "xlsx"; window.XLSX = XLSX;`) pred spustením exportu.');
335
328
  }
336
329
  // row density
337
330
  getRowHeight() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overview-components",
3
- "version": "1.1.177",
3
+ "version": "1.1.179",
4
4
  "description": "A reusable design Lit components for case overview section.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -25,15 +25,18 @@
25
25
  "exports": {
26
26
  ".": {
27
27
  "types": "./dist/index.d.ts",
28
- "import": "./dist/index.js"
28
+ "import": "./dist/index.js",
29
+ "default": "./dist/index.js"
29
30
  },
30
31
  "./react": {
31
32
  "types": "./dist/components/react-wrappers/index.d.ts",
32
- "import": "./dist/components/react-wrappers/index.js"
33
+ "import": "./dist/components/react-wrappers/index.js",
34
+ "default": "./dist/components/react-wrappers/index.js"
33
35
  },
34
36
  "./schemas": {
35
37
  "types": "./dist/schemas/index.d.ts",
36
- "import": "./dist/schemas/index.js"
38
+ "import": "./dist/schemas/index.js",
39
+ "default": "./dist/schemas/index.js"
37
40
  },
38
41
  "./package.json": "./package.json"
39
42
  },
@@ -69,15 +72,11 @@
69
72
  "peerDependencies": {
70
73
  "lit": "^3.0.0",
71
74
  "pdfjs-dist": ">=5.0.0",
72
- "react": ">=17",
73
- "xlsx": ">=0.18.0"
75
+ "react": ">=17"
74
76
  },
75
77
  "peerDependenciesMeta": {
76
78
  "react": {
77
79
  "optional": true
78
- },
79
- "xlsx": {
80
- "optional": true
81
80
  }
82
81
  },
83
82
  "devDependencies": {