overview-components 1.1.178 → 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 +15 -7
- package/dist/components/lit-data-grid-tanstack.js +6 -13
- package/package.json +2 -6
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
|
-
|
|
|
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
|
-
|
|
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) | `
|
|
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
|
-
|
|
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`)
|
|
67
|
-
srozumitelnou chybu
|
|
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
|
|
323
|
-
//
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
|
|
327
|
-
|
|
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.
|
|
3
|
+
"version": "1.1.179",
|
|
4
4
|
"description": "A reusable design Lit components for case overview section.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -72,15 +72,11 @@
|
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"lit": "^3.0.0",
|
|
74
74
|
"pdfjs-dist": ">=5.0.0",
|
|
75
|
-
"react": ">=17"
|
|
76
|
-
"xlsx": ">=0.18.0"
|
|
75
|
+
"react": ">=17"
|
|
77
76
|
},
|
|
78
77
|
"peerDependenciesMeta": {
|
|
79
78
|
"react": {
|
|
80
79
|
"optional": true
|
|
81
|
-
},
|
|
82
|
-
"xlsx": {
|
|
83
|
-
"optional": true
|
|
84
80
|
}
|
|
85
81
|
},
|
|
86
82
|
"devDependencies": {
|