@nice2dev/ui-bi 1.1.6 → 1.1.9
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/CHANGELOG.md +101 -0
- package/README.md +13 -53
- package/dist/{NiceDocumentViewer-B-uEPZAf-CEkT03Kq.js → NiceDocumentViewer-BtpiyHdE-B0Wjc_z7.js} +110 -110
- package/dist/{NiceDocumentViewer-B-uEPZAf-zKq6VI8X.cjs → NiceDocumentViewer-BtpiyHdE-CpHKE6c1.cjs} +16 -16
- package/dist/{index-C5HkRuCY.js → index-BbAnSU3F.js} +55519 -40884
- package/dist/index-CiIML9tH.cjs +6676 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types.d.ts +0 -21
- package/dist/ui-bi.css +1 -1
- package/package.json +3 -3
- package/dist/NiceDashboardStudio.d.ts +0 -8
- package/dist/NiceDocumentViewer-B-uEPZAf-CmZ792mF.js +0 -674
- package/dist/NiceDocumentViewer-B-uEPZAf-Deg24KCP.cjs +0 -180
- package/dist/NiceReportBuilder.d.ts +0 -8
- package/dist/index-5FyuIZGq.cjs +0 -6671
- package/dist/index-BLSxTE3T.cjs +0 -6671
- package/dist/index-Ct0VIHvK.js +0 -94147
- package/dist/style.css +0 -1
- package/dist/viewAdapters.d.ts +0 -5
package/dist/{NiceDocumentViewer-B-uEPZAf-CEkT03Kq.js → NiceDocumentViewer-BtpiyHdE-B0Wjc_z7.js}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { x as g } from "./index-BbAnSU3F.js";
|
|
3
3
|
import { forwardRef as be, useRef as V, useState as f, useMemo as _e, useCallback as l, useEffect as q, useImperativeHandle as xe } from "react";
|
|
4
|
-
function ye(
|
|
4
|
+
function ye(r, o) {
|
|
5
5
|
var a;
|
|
6
|
-
const
|
|
7
|
-
return
|
|
6
|
+
const n = ((a = r.split(".").pop()) == null ? void 0 : a.toLowerCase().split("?")[0]) ?? "";
|
|
7
|
+
return n === "pdf" ? "pdf" : ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg", "ico", "tiff", "tif"].includes(n) ? "image" : ["mp4", "webm", "ogg", "mov", "avi", "mkv"].includes(n) ? "video" : ["mp3", "wav", "flac", "aac", "m4a", "ogg"].includes(n) ? "audio" : ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "odt", "ods", "odp"].includes(n) ? "office" : n === "html" || n === "htm" ? "html" : ["txt", "log", "md", "json", "xml", "csv", "yaml", "yml"].includes(n) ? "text" : "unknown";
|
|
8
8
|
}
|
|
9
|
-
function ke(
|
|
10
|
-
if (
|
|
9
|
+
function ke(r) {
|
|
10
|
+
if (r === 0)
|
|
11
11
|
return "0 B";
|
|
12
|
-
const
|
|
13
|
-
return parseFloat((
|
|
12
|
+
const o = 1024, n = ["B", "KB", "MB", "GB"], a = Math.floor(Math.log(r) / Math.log(o));
|
|
13
|
+
return parseFloat((r / Math.pow(o, a)).toFixed(1)) + " " + n[a];
|
|
14
14
|
}
|
|
15
|
-
function Ce(
|
|
16
|
-
const
|
|
17
|
-
return
|
|
15
|
+
function Ce(r) {
|
|
16
|
+
const o = Math.floor(r / 3600), n = Math.floor(r % 3600 / 60), a = Math.floor(r % 60);
|
|
17
|
+
return o > 0 ? `${o}:${n.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}` : `${n}:${a.toString().padStart(2, "0")}`;
|
|
18
18
|
}
|
|
19
19
|
function Ne({
|
|
20
|
-
src:
|
|
21
|
-
page:
|
|
22
|
-
zoom:
|
|
20
|
+
src: r,
|
|
21
|
+
page: o,
|
|
22
|
+
zoom: n,
|
|
23
23
|
rotation: a,
|
|
24
24
|
onPageChange: u,
|
|
25
25
|
onLoad: d,
|
|
@@ -41,11 +41,11 @@ function Ne({
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
p ? s.GlobalWorkerOptions.workerSrc = p : s.version && (s.GlobalWorkerOptions.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${s.version}/pdf.worker.min.js`);
|
|
44
|
-
const b = await s.getDocument(
|
|
44
|
+
const b = await s.getDocument(r).promise;
|
|
45
45
|
if (x)
|
|
46
46
|
return;
|
|
47
47
|
z.current = b, J(b.numPages), d({
|
|
48
|
-
name:
|
|
48
|
+
name: r.split("/").pop() ?? "document.pdf",
|
|
49
49
|
type: "pdf",
|
|
50
50
|
mimeType: "application/pdf",
|
|
51
51
|
pageCount: b.numPages
|
|
@@ -56,7 +56,7 @@ function Ne({
|
|
|
56
56
|
})(), () => {
|
|
57
57
|
x = !0;
|
|
58
58
|
};
|
|
59
|
-
}, [
|
|
59
|
+
}, [r, p, d, h]), q(() => {
|
|
60
60
|
const x = z.current, s = v.current;
|
|
61
61
|
if (!x || !s || _ === 0)
|
|
62
62
|
return;
|
|
@@ -65,10 +65,10 @@ function Ne({
|
|
|
65
65
|
if (!U) {
|
|
66
66
|
B(!0);
|
|
67
67
|
try {
|
|
68
|
-
const P = Math.max(1, Math.min(
|
|
68
|
+
const P = Math.max(1, Math.min(o, _)), M = await x.getPage(P);
|
|
69
69
|
if (b)
|
|
70
70
|
return;
|
|
71
|
-
const y = M.getViewport({ scale:
|
|
71
|
+
const y = M.getViewport({ scale: n, rotation: a }), E = s.getContext("2d");
|
|
72
72
|
if (!E)
|
|
73
73
|
return;
|
|
74
74
|
s.height = y.height, s.width = y.width, await M.render({
|
|
@@ -84,12 +84,12 @@ function Ne({
|
|
|
84
84
|
})(), () => {
|
|
85
85
|
b = !0;
|
|
86
86
|
};
|
|
87
|
-
}, [
|
|
87
|
+
}, [o, n, a, _, U]), /* @__PURE__ */ e("div", { className: "nice-document-viewer__pdf", children: /* @__PURE__ */ e("canvas", { ref: v, className: "nice-document-viewer__pdf-canvas" }) });
|
|
88
88
|
}
|
|
89
89
|
function ze({
|
|
90
|
-
src:
|
|
91
|
-
zoom:
|
|
92
|
-
rotation:
|
|
90
|
+
src: r,
|
|
91
|
+
zoom: o,
|
|
92
|
+
rotation: n,
|
|
93
93
|
onLoad: a,
|
|
94
94
|
onError: u
|
|
95
95
|
}) {
|
|
@@ -97,50 +97,50 @@ function ze({
|
|
|
97
97
|
(z) => {
|
|
98
98
|
const _ = z.currentTarget;
|
|
99
99
|
h(!0), a({
|
|
100
|
-
name:
|
|
100
|
+
name: r.split("/").pop() ?? "image",
|
|
101
101
|
type: "image",
|
|
102
102
|
width: _.naturalWidth,
|
|
103
103
|
height: _.naturalHeight
|
|
104
104
|
});
|
|
105
105
|
},
|
|
106
|
-
[
|
|
106
|
+
[r, a]
|
|
107
107
|
), v = l(() => {
|
|
108
108
|
u(new Error("Failed to load image"));
|
|
109
109
|
}, [u]);
|
|
110
110
|
return /* @__PURE__ */ e("div", { className: "nice-document-viewer__image", children: /* @__PURE__ */ e(
|
|
111
111
|
"img",
|
|
112
112
|
{
|
|
113
|
-
src:
|
|
113
|
+
src: r,
|
|
114
114
|
alt: "Document",
|
|
115
115
|
onLoad: p,
|
|
116
116
|
onError: v,
|
|
117
117
|
style: {
|
|
118
|
-
transform: `scale(${
|
|
118
|
+
transform: `scale(${o}) rotate(${n}deg)`,
|
|
119
119
|
opacity: d ? 1 : 0
|
|
120
120
|
},
|
|
121
121
|
draggable: !1
|
|
122
122
|
}
|
|
123
123
|
) });
|
|
124
124
|
}
|
|
125
|
-
function Ee({ src:
|
|
125
|
+
function Ee({ src: r, type: o, onLoad: n, onError: a }) {
|
|
126
126
|
const u = V(null), d = l(() => {
|
|
127
127
|
const p = u.current;
|
|
128
128
|
if (!p)
|
|
129
129
|
return;
|
|
130
130
|
const v = {
|
|
131
|
-
name:
|
|
132
|
-
type:
|
|
131
|
+
name: r.split("/").pop() ?? (o === "video" ? "video" : "audio"),
|
|
132
|
+
type: o,
|
|
133
133
|
duration: p.duration
|
|
134
134
|
};
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
a(new Error(`Failed to load ${
|
|
138
|
-
}, [
|
|
139
|
-
return
|
|
135
|
+
o === "video" && "videoWidth" in p && (v.width = p.videoWidth, v.height = p.videoHeight), n(v);
|
|
136
|
+
}, [r, o, n]), h = l(() => {
|
|
137
|
+
a(new Error(`Failed to load ${o}`));
|
|
138
|
+
}, [o, a]);
|
|
139
|
+
return o === "video" ? /* @__PURE__ */ e("div", { className: "nice-document-viewer__video", children: /* @__PURE__ */ e(
|
|
140
140
|
"video",
|
|
141
141
|
{
|
|
142
142
|
ref: u,
|
|
143
|
-
src:
|
|
143
|
+
src: r,
|
|
144
144
|
controls: !0,
|
|
145
145
|
onLoadedMetadata: d,
|
|
146
146
|
onError: h
|
|
@@ -149,20 +149,20 @@ function Ee({ src: o, type: r, onLoad: t, onError: a }) {
|
|
|
149
149
|
"audio",
|
|
150
150
|
{
|
|
151
151
|
ref: u,
|
|
152
|
-
src:
|
|
152
|
+
src: r,
|
|
153
153
|
controls: !0,
|
|
154
154
|
onLoadedMetadata: d,
|
|
155
155
|
onError: h
|
|
156
156
|
}
|
|
157
157
|
) });
|
|
158
158
|
}
|
|
159
|
-
function Le({ src:
|
|
160
|
-
const [a, u] = f(!1), d = `${
|
|
161
|
-
u(!0),
|
|
162
|
-
name:
|
|
159
|
+
function Le({ src: r, viewerUrl: o, onLoad: n }) {
|
|
160
|
+
const [a, u] = f(!1), d = `${o ?? "https://view.officeapps.live.com/op/embed.aspx?src="}${encodeURIComponent(r)}`, h = l(() => {
|
|
161
|
+
u(!0), n({
|
|
162
|
+
name: r.split("/").pop() ?? "document",
|
|
163
163
|
type: "office"
|
|
164
164
|
});
|
|
165
|
-
}, [
|
|
165
|
+
}, [r, n]);
|
|
166
166
|
return /* @__PURE__ */ e("div", { className: "nice-document-viewer__office", children: /* @__PURE__ */ e(
|
|
167
167
|
"iframe",
|
|
168
168
|
{
|
|
@@ -173,45 +173,45 @@ function Le({ src: o, viewerUrl: r, onLoad: t }) {
|
|
|
173
173
|
}
|
|
174
174
|
) });
|
|
175
175
|
}
|
|
176
|
-
function je({ src:
|
|
176
|
+
function je({ src: r, onLoad: o, onError: n }) {
|
|
177
177
|
const [a, u] = f(null);
|
|
178
178
|
return q(() => {
|
|
179
|
-
fetch(
|
|
179
|
+
fetch(r).then((d) => {
|
|
180
180
|
if (!d.ok)
|
|
181
181
|
throw new Error("Failed to fetch text");
|
|
182
182
|
return d.text();
|
|
183
183
|
}).then((d) => {
|
|
184
|
-
u(d),
|
|
185
|
-
name:
|
|
184
|
+
u(d), o({
|
|
185
|
+
name: r.split("/").pop() ?? "text",
|
|
186
186
|
type: "text",
|
|
187
187
|
size: d.length
|
|
188
188
|
});
|
|
189
189
|
}).catch((d) => {
|
|
190
|
-
|
|
190
|
+
n(d instanceof Error ? d : new Error("Failed to load text"));
|
|
191
191
|
});
|
|
192
|
-
}, [
|
|
192
|
+
}, [r, o, n]), a === null ? /* @__PURE__ */ e("div", { className: "nice-document-viewer__loading", children: "Loading..." }) : /* @__PURE__ */ e("div", { className: "nice-document-viewer__text", children: /* @__PURE__ */ e("pre", { children: a }) });
|
|
193
193
|
}
|
|
194
|
-
function Pe({ src:
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
name:
|
|
194
|
+
function Pe({ src: r, onLoad: o }) {
|
|
195
|
+
const n = l(() => {
|
|
196
|
+
o({
|
|
197
|
+
name: r.split("/").pop() ?? "page.html",
|
|
198
198
|
type: "html"
|
|
199
199
|
});
|
|
200
|
-
}, [
|
|
200
|
+
}, [r, o]);
|
|
201
201
|
return /* @__PURE__ */ e("div", { className: "nice-document-viewer__html", children: /* @__PURE__ */ e(
|
|
202
202
|
"iframe",
|
|
203
203
|
{
|
|
204
|
-
src:
|
|
205
|
-
onLoad:
|
|
204
|
+
src: r,
|
|
205
|
+
onLoad: n,
|
|
206
206
|
title: "HTML Document",
|
|
207
207
|
sandbox: "allow-same-origin allow-scripts"
|
|
208
208
|
}
|
|
209
209
|
) });
|
|
210
210
|
}
|
|
211
211
|
const $e = be(
|
|
212
|
-
function(
|
|
212
|
+
function(r, o) {
|
|
213
213
|
const {
|
|
214
|
-
src:
|
|
214
|
+
src: n,
|
|
215
215
|
type: a,
|
|
216
216
|
name: u,
|
|
217
217
|
height: d = 600,
|
|
@@ -232,28 +232,28 @@ const $e = be(
|
|
|
232
232
|
onError: E,
|
|
233
233
|
onPageChange: I,
|
|
234
234
|
onZoomChange: W,
|
|
235
|
-
pdfWorkerUrl:
|
|
235
|
+
pdfWorkerUrl: oe,
|
|
236
236
|
officeViewerUrl: ie,
|
|
237
237
|
loading: ae,
|
|
238
238
|
errorContent: Y,
|
|
239
239
|
className: ce,
|
|
240
240
|
"data-testid": de
|
|
241
|
-
} =
|
|
241
|
+
} = r, Q = V(null), [t, le] = f(null), [k, se] = f(_), [L, ue] = f(p), [ee, me] = f(0), [H, ne] = f(!1), [T, pe] = f(null), [fe, te] = f(!0), C = _e(() => a ?? ye(n), [n, a]), j = l(
|
|
242
242
|
(i) => {
|
|
243
|
-
le(i),
|
|
243
|
+
le(i), te(!1), y == null || y(i);
|
|
244
244
|
},
|
|
245
245
|
[y]
|
|
246
246
|
), A = l(
|
|
247
247
|
(i) => {
|
|
248
|
-
pe(i),
|
|
248
|
+
pe(i), te(!1), E == null || E(i);
|
|
249
249
|
},
|
|
250
250
|
[E]
|
|
251
251
|
), w = l(
|
|
252
252
|
(i) => {
|
|
253
|
-
const c = (
|
|
253
|
+
const c = (t == null ? void 0 : t.pageCount) ?? 1, Z = Math.max(1, Math.min(i, c));
|
|
254
254
|
se(Z), I == null || I(Z);
|
|
255
255
|
},
|
|
256
|
-
[
|
|
256
|
+
[t == null ? void 0 : t.pageCount, I]
|
|
257
257
|
), D = l(() => w(k + 1), [k, w]), F = l(() => w(k - 1), [k, w]), N = l(
|
|
258
258
|
(i) => {
|
|
259
259
|
const c = Math.max(v, Math.min(i, z));
|
|
@@ -264,13 +264,13 @@ const $e = be(
|
|
|
264
264
|
me((c) => (c + i) % 360);
|
|
265
265
|
}, []), O = l(() => {
|
|
266
266
|
const i = document.createElement("a");
|
|
267
|
-
i.href =
|
|
268
|
-
}, [
|
|
269
|
-
const i = window.open(
|
|
267
|
+
i.href = n, i.download = u ?? (t == null ? void 0 : t.name) ?? "document", document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
268
|
+
}, [n, u, t == null ? void 0 : t.name]), X = l(() => {
|
|
269
|
+
const i = window.open(n, "_blank");
|
|
270
270
|
i && (i.onload = () => i.print());
|
|
271
|
-
}, [
|
|
271
|
+
}, [n]), S = l(() => {
|
|
272
272
|
var i, c, Z;
|
|
273
|
-
Q.current && (H ? ((i = document.exitFullscreen) == null || i.call(document),
|
|
273
|
+
Q.current && (H ? ((i = document.exitFullscreen) == null || i.call(document), ne(!1)) : ((Z = (c = Q.current).requestFullscreen) == null || Z.call(c), ne(!0)));
|
|
274
274
|
}, [H]);
|
|
275
275
|
q(() => {
|
|
276
276
|
if (!M)
|
|
@@ -289,7 +289,7 @@ const $e = be(
|
|
|
289
289
|
w(1);
|
|
290
290
|
break;
|
|
291
291
|
case "End":
|
|
292
|
-
w((
|
|
292
|
+
w((t == null ? void 0 : t.pageCount) ?? 1);
|
|
293
293
|
break;
|
|
294
294
|
case "+":
|
|
295
295
|
case "=":
|
|
@@ -312,13 +312,13 @@ const $e = be(
|
|
|
312
312
|
D,
|
|
313
313
|
F,
|
|
314
314
|
w,
|
|
315
|
-
|
|
315
|
+
t == null ? void 0 : t.pageCount,
|
|
316
316
|
$,
|
|
317
317
|
K,
|
|
318
318
|
R,
|
|
319
319
|
S
|
|
320
320
|
]), xe(
|
|
321
|
-
|
|
321
|
+
o,
|
|
322
322
|
() => ({
|
|
323
323
|
goToPage: w,
|
|
324
324
|
nextPage: D,
|
|
@@ -331,7 +331,7 @@ const $e = be(
|
|
|
331
331
|
download: O,
|
|
332
332
|
print: X,
|
|
333
333
|
toggleFullscreen: S,
|
|
334
|
-
getInfo: () =>
|
|
334
|
+
getInfo: () => t
|
|
335
335
|
}),
|
|
336
336
|
[
|
|
337
337
|
w,
|
|
@@ -345,7 +345,7 @@ const $e = be(
|
|
|
345
345
|
O,
|
|
346
346
|
X,
|
|
347
347
|
S,
|
|
348
|
-
|
|
348
|
+
t
|
|
349
349
|
]
|
|
350
350
|
);
|
|
351
351
|
const he = () => {
|
|
@@ -360,21 +360,21 @@ const $e = be(
|
|
|
360
360
|
return /* @__PURE__ */ e(
|
|
361
361
|
Ne,
|
|
362
362
|
{
|
|
363
|
-
src:
|
|
363
|
+
src: n,
|
|
364
364
|
page: k,
|
|
365
365
|
zoom: L,
|
|
366
366
|
rotation: ee,
|
|
367
367
|
onPageChange: w,
|
|
368
368
|
onLoad: j,
|
|
369
369
|
onError: A,
|
|
370
|
-
workerUrl:
|
|
370
|
+
workerUrl: oe
|
|
371
371
|
}
|
|
372
372
|
);
|
|
373
373
|
case "image":
|
|
374
374
|
return /* @__PURE__ */ e(
|
|
375
375
|
ze,
|
|
376
376
|
{
|
|
377
|
-
src:
|
|
377
|
+
src: n,
|
|
378
378
|
zoom: L,
|
|
379
379
|
rotation: ee,
|
|
380
380
|
onLoad: j,
|
|
@@ -383,13 +383,13 @@ const $e = be(
|
|
|
383
383
|
);
|
|
384
384
|
case "video":
|
|
385
385
|
case "audio":
|
|
386
|
-
return /* @__PURE__ */ e(Ee, { src:
|
|
386
|
+
return /* @__PURE__ */ e(Ee, { src: n, type: C, onLoad: j, onError: A });
|
|
387
387
|
case "office":
|
|
388
|
-
return /* @__PURE__ */ e(Le, { src:
|
|
388
|
+
return /* @__PURE__ */ e(Le, { src: n, viewerUrl: ie, onLoad: j });
|
|
389
389
|
case "text":
|
|
390
|
-
return /* @__PURE__ */ e(je, { src:
|
|
390
|
+
return /* @__PURE__ */ e(je, { src: n, onLoad: j, onError: A });
|
|
391
391
|
case "html":
|
|
392
|
-
return /* @__PURE__ */ e(Pe, { src:
|
|
392
|
+
return /* @__PURE__ */ e(Pe, { src: n, onLoad: j });
|
|
393
393
|
default:
|
|
394
394
|
return /* @__PURE__ */ m("div", { className: "nice-document-viewer__unknown", children: [
|
|
395
395
|
/* @__PURE__ */ m("span", { children: [
|
|
@@ -399,7 +399,7 @@ const $e = be(
|
|
|
399
399
|
/* @__PURE__ */ e("button", { type: "button", onClick: O, children: "Download" })
|
|
400
400
|
] });
|
|
401
401
|
}
|
|
402
|
-
}, ve = U && C === "pdf" && ((
|
|
402
|
+
}, ve = U && C === "pdf" && ((t == null ? void 0 : t.pageCount) ?? 0) > 1, we = B && (C === "pdf" || C === "image"), ge = P && (C === "pdf" || C === "image");
|
|
403
403
|
return /* @__PURE__ */ m(
|
|
404
404
|
"div",
|
|
405
405
|
{
|
|
@@ -429,18 +429,18 @@ const $e = be(
|
|
|
429
429
|
value: k,
|
|
430
430
|
onChange: (i) => w(parseInt(i.target.value, 10)),
|
|
431
431
|
min: 1,
|
|
432
|
-
max: (
|
|
432
|
+
max: (t == null ? void 0 : t.pageCount) ?? 1
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
435
|
"/ ",
|
|
436
|
-
(
|
|
436
|
+
(t == null ? void 0 : t.pageCount) ?? 1
|
|
437
437
|
] }),
|
|
438
438
|
/* @__PURE__ */ e(
|
|
439
439
|
"button",
|
|
440
440
|
{
|
|
441
441
|
type: "button",
|
|
442
442
|
onClick: D,
|
|
443
|
-
disabled: k >= ((
|
|
443
|
+
disabled: k >= ((t == null ? void 0 : t.pageCount) ?? 1),
|
|
444
444
|
"aria-label": "Next page",
|
|
445
445
|
children: /* @__PURE__ */ e(g, { name: "chevron-right", size: 16 })
|
|
446
446
|
}
|
|
@@ -471,31 +471,31 @@ const $e = be(
|
|
|
471
471
|
fe && !T && (ae ?? /* @__PURE__ */ e("div", { className: "nice-document-viewer__loading", children: "Loading..." })),
|
|
472
472
|
he()
|
|
473
473
|
] }),
|
|
474
|
-
|
|
475
|
-
/* @__PURE__ */ e("span", { className: "nice-document-viewer__name", children: u ??
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
474
|
+
t && /* @__PURE__ */ m("div", { className: "nice-document-viewer__info", children: [
|
|
475
|
+
/* @__PURE__ */ e("span", { className: "nice-document-viewer__name", children: u ?? t.name }),
|
|
476
|
+
t.size && /* @__PURE__ */ e("span", { className: "nice-document-viewer__size", children: ke(t.size) }),
|
|
477
|
+
t.width && t.height && /* @__PURE__ */ m("span", { className: "nice-document-viewer__dimensions", children: [
|
|
478
|
+
t.width,
|
|
479
479
|
" × ",
|
|
480
|
-
|
|
480
|
+
t.height
|
|
481
481
|
] }),
|
|
482
|
-
|
|
482
|
+
t.duration && /* @__PURE__ */ e("span", { className: "nice-document-viewer__duration", children: Ce(t.duration) })
|
|
483
483
|
] })
|
|
484
484
|
]
|
|
485
485
|
}
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
|
-
),
|
|
489
|
-
if (typeof document < "u" && !document.getElementById(
|
|
490
|
-
const
|
|
491
|
-
|
|
488
|
+
), re = "nice-document-viewer-styles";
|
|
489
|
+
if (typeof document < "u" && !document.getElementById(re)) {
|
|
490
|
+
const r = document.createElement("style");
|
|
491
|
+
r.id = re, r.textContent = `
|
|
492
492
|
.nice-document-viewer {
|
|
493
493
|
display: flex;
|
|
494
494
|
flex-direction: column;
|
|
495
|
-
border: 1px solid var(--border-color, #e5e7eb);
|
|
495
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
496
496
|
border-radius: var(--nice-radius-sm, 4px);
|
|
497
497
|
overflow: hidden;
|
|
498
|
-
background: var(--bg-primary, #ffffff);
|
|
498
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
.nice-document-viewer--fullscreen {
|
|
@@ -514,8 +514,8 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
514
514
|
align-items: center;
|
|
515
515
|
justify-content: space-between;
|
|
516
516
|
padding: var(--nice-space-2, 8px) var(--nice-space-3, 12px);
|
|
517
|
-
background: var(--bg-primary, #ffffff);
|
|
518
|
-
border-bottom: 1px solid var(--border-color, #e5e7eb);
|
|
517
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
518
|
+
border-bottom: 1px solid var(--nice-border-color, #e5e7eb);
|
|
519
519
|
flex-shrink: 0;
|
|
520
520
|
}
|
|
521
521
|
|
|
@@ -529,15 +529,15 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
529
529
|
|
|
530
530
|
.nice-document-viewer__toolbar button {
|
|
531
531
|
padding: var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px);
|
|
532
|
-
border: 1px solid var(--border-color, #e5e7eb);
|
|
532
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
533
533
|
border-radius: var(--nice-radius-sm, 4px);
|
|
534
|
-
background: var(--bg-primary, #ffffff);
|
|
534
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
535
535
|
cursor: pointer;
|
|
536
536
|
font-size: 14px;
|
|
537
537
|
}
|
|
538
538
|
|
|
539
539
|
.nice-document-viewer__toolbar button:hover:not(:disabled) {
|
|
540
|
-
background: var(--hover-bg, color-mix(in srgb, var(--text-primary, #000) 4%, transparent));
|
|
540
|
+
background: var(--nice-hover-bg, color-mix(in srgb, var(--nice-text-primary, #000) 4%, transparent));
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
.nice-document-viewer__toolbar button:disabled {
|
|
@@ -556,7 +556,7 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
556
556
|
.nice-document-viewer__pagination input {
|
|
557
557
|
width: 50px;
|
|
558
558
|
padding: var(--nice-space-1, 4px);
|
|
559
|
-
border: 1px solid var(--border-color, #e5e7eb);
|
|
559
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
560
560
|
border-radius: var(--nice-radius-sm, 4px);
|
|
561
561
|
text-align: center;
|
|
562
562
|
}
|
|
@@ -585,7 +585,7 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
585
585
|
justify-content: center;
|
|
586
586
|
gap: var(--nice-space-3, 12px);
|
|
587
587
|
padding: var(--nice-space-10, 40px);
|
|
588
|
-
color: var(--text-secondary, #475569);
|
|
588
|
+
color: var(--nice-text-secondary, #475569);
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
.nice-document-viewer__error span {
|
|
@@ -640,7 +640,7 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
640
640
|
height: 100%;
|
|
641
641
|
overflow: auto;
|
|
642
642
|
padding: var(--nice-space-4, 16px);
|
|
643
|
-
background: var(--bg-primary, #ffffff);
|
|
643
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
644
644
|
}
|
|
645
645
|
|
|
646
646
|
.nice-document-viewer__text pre {
|
|
@@ -656,18 +656,18 @@ if (typeof document < "u" && !document.getElementById(oe)) {
|
|
|
656
656
|
align-items: center;
|
|
657
657
|
gap: var(--nice-space-4, 16px);
|
|
658
658
|
padding: var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);
|
|
659
|
-
background: var(--bg-primary, #ffffff);
|
|
660
|
-
border-top: 1px solid var(--border-color, #e5e7eb);
|
|
659
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
660
|
+
border-top: 1px solid var(--nice-border-color, #e5e7eb);
|
|
661
661
|
font-size: 12px;
|
|
662
|
-
color: var(--text-secondary, #475569);
|
|
662
|
+
color: var(--nice-text-secondary, #475569);
|
|
663
663
|
flex-shrink: 0;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
666
|
.nice-document-viewer__name {
|
|
667
667
|
font-weight: 500;
|
|
668
|
-
color: var(--text-primary, #0f172a);
|
|
668
|
+
color: var(--nice-text-primary, #0f172a);
|
|
669
669
|
}
|
|
670
|
-
`, document.head.appendChild(
|
|
670
|
+
`, document.head.appendChild(r);
|
|
671
671
|
}
|
|
672
672
|
export {
|
|
673
673
|
$e as NiceDocumentViewer
|