welcome-ui 0.0.0-dev.1764083596268 → 0.0.0-dev.1764249770432
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/Breadcrumb.js +136 -134
- package/dist/CloseButton.js +1 -1
- package/dist/FileDrop.css +1 -1
- package/dist/FileDrop.js +333 -312
- package/dist/Link.css +1 -1
- package/dist/Link.js +43 -43
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +35 -37
- package/dist/Select.css +1 -1
- package/dist/Select.js +177 -177
- package/dist/theme.css +1 -1
- package/dist/types/components/Breadcrumb/Item.d.ts +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts +1 -1
- package/dist/types/components/Breadcrumb/types.d.ts +2 -1
- package/dist/types/components/FileDrop/types.d.ts +2 -0
- package/dist/types/components/Radio/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/FileDrop.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './FileDrop.css';
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import Si, { useMemo as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { g as Ci, c as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Icon as
|
|
3
|
+
import { jsxs as L, Fragment as ui, jsx as x } from "react/jsx-runtime";
|
|
4
|
+
import Si, { useMemo as Z, useRef as fa, useReducer as qi, useEffect as pa, useCallback as E, forwardRef as fi, useImperativeHandle as Ti, Fragment as Li, useState as Qa } from "react";
|
|
5
|
+
import { _ as K, P as s } from "./tslib.es6-C80jYMbM.js";
|
|
6
|
+
import { g as Ci, c as za } from "./index-PAaZGbyz.js";
|
|
7
|
+
import { Button as ya } from "./Button.js";
|
|
8
|
+
import { Icon as J } from "./Icon.js";
|
|
9
9
|
import { c as ai } from "./create-event-rXDe5aCQ.js";
|
|
10
10
|
import { g as Mi, a as Ni, b as xi } from "./index-DmEMuVTM.js";
|
|
11
|
-
import { Text as
|
|
11
|
+
import { Text as wa } from "./Text.js";
|
|
12
12
|
const $i = /* @__PURE__ */ new Map([
|
|
13
13
|
// https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
|
|
14
14
|
["1km", "application/vnd.1000minds.decision-model+xml"],
|
|
@@ -1212,7 +1212,7 @@ const $i = /* @__PURE__ */ new Map([
|
|
|
1212
1212
|
["zmm", "application/vnd.handheld-entertainment+xml"],
|
|
1213
1213
|
["zsh", "text/x-scriptzsh"]
|
|
1214
1214
|
]);
|
|
1215
|
-
function
|
|
1215
|
+
function X(a, i, t) {
|
|
1216
1216
|
const e = Ki(a), { webkitRelativePath: n } = a, o = typeof i == "string" ? i : typeof n == "string" && n.length > 0 ? n : `./${a.name}`;
|
|
1217
1217
|
return typeof e.path != "string" && ii(e, "path", o), ii(e, "relativePath", o), e;
|
|
1218
1218
|
}
|
|
@@ -1245,43 +1245,43 @@ const Hi = [
|
|
|
1245
1245
|
// Windows
|
|
1246
1246
|
];
|
|
1247
1247
|
function Wi(a) {
|
|
1248
|
-
return
|
|
1249
|
-
return
|
|
1248
|
+
return K(this, void 0, void 0, function* () {
|
|
1249
|
+
return ka(a) && Ui(a.dataTransfer) ? Gi(a.dataTransfer, a.type) : Bi(a) ? Yi(a) : Array.isArray(a) && a.every((i) => "getFile" in i && typeof i.getFile == "function") ? Vi(a) : [];
|
|
1250
1250
|
});
|
|
1251
1251
|
}
|
|
1252
1252
|
function Ui(a) {
|
|
1253
|
-
return
|
|
1253
|
+
return ka(a);
|
|
1254
1254
|
}
|
|
1255
1255
|
function Bi(a) {
|
|
1256
|
-
return
|
|
1256
|
+
return ka(a) && ka(a.target);
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function ka(a) {
|
|
1259
1259
|
return typeof a == "object" && a !== null;
|
|
1260
1260
|
}
|
|
1261
1261
|
function Yi(a) {
|
|
1262
|
-
return
|
|
1262
|
+
return Ma(a.target.files).map((i) => X(i));
|
|
1263
1263
|
}
|
|
1264
1264
|
function Vi(a) {
|
|
1265
|
-
return
|
|
1266
|
-
return (yield Promise.all(a.map((t) => t.getFile()))).map((t) =>
|
|
1265
|
+
return K(this, void 0, void 0, function* () {
|
|
1266
|
+
return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => X(t));
|
|
1267
1267
|
});
|
|
1268
1268
|
}
|
|
1269
1269
|
function Gi(a, i) {
|
|
1270
|
-
return
|
|
1270
|
+
return K(this, void 0, void 0, function* () {
|
|
1271
1271
|
if (a.items) {
|
|
1272
|
-
const t =
|
|
1272
|
+
const t = Ma(a.items).filter((n) => n.kind === "file");
|
|
1273
1273
|
if (i !== "drop")
|
|
1274
1274
|
return t;
|
|
1275
1275
|
const e = yield Promise.all(t.map(Zi));
|
|
1276
1276
|
return ti(gi(e));
|
|
1277
1277
|
}
|
|
1278
|
-
return ti(
|
|
1278
|
+
return ti(Ma(a.files).map((t) => X(t)));
|
|
1279
1279
|
});
|
|
1280
1280
|
}
|
|
1281
1281
|
function ti(a) {
|
|
1282
1282
|
return a.filter((i) => Hi.indexOf(i.name) === -1);
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function Ma(a) {
|
|
1285
1285
|
if (a === null)
|
|
1286
1286
|
return [];
|
|
1287
1287
|
const i = [];
|
|
@@ -1306,18 +1306,18 @@ function gi(a) {
|
|
|
1306
1306
|
function ei(a, i) {
|
|
1307
1307
|
var t;
|
|
1308
1308
|
if (typeof a.getAsFileSystemHandle == "function")
|
|
1309
|
-
return a.getAsFileSystemHandle().then((o) =>
|
|
1309
|
+
return a.getAsFileSystemHandle().then((o) => K(this, void 0, void 0, function* () {
|
|
1310
1310
|
const l = yield o.getFile();
|
|
1311
|
-
return l.handle = o,
|
|
1311
|
+
return l.handle = o, X(l);
|
|
1312
1312
|
}));
|
|
1313
1313
|
const e = a.getAsFile();
|
|
1314
1314
|
if (!e)
|
|
1315
1315
|
return Promise.reject(`${a} is not a File`);
|
|
1316
|
-
const n =
|
|
1316
|
+
const n = X(e, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
|
|
1317
1317
|
return Promise.resolve(n);
|
|
1318
1318
|
}
|
|
1319
1319
|
function Ji(a) {
|
|
1320
|
-
return
|
|
1320
|
+
return K(this, void 0, void 0, function* () {
|
|
1321
1321
|
return a.isDirectory ? bi(a) : Xi(a);
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
@@ -1326,7 +1326,7 @@ function bi(a) {
|
|
|
1326
1326
|
return new Promise((t, e) => {
|
|
1327
1327
|
const n = [];
|
|
1328
1328
|
function o() {
|
|
1329
|
-
i.readEntries((l) =>
|
|
1329
|
+
i.readEntries((l) => K(this, void 0, void 0, function* () {
|
|
1330
1330
|
if (l.length) {
|
|
1331
1331
|
const r = Promise.all(l.map(Ji));
|
|
1332
1332
|
n.push(r), o();
|
|
@@ -1345,10 +1345,10 @@ function bi(a) {
|
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
1347
|
function Xi(a) {
|
|
1348
|
-
return
|
|
1348
|
+
return K(this, void 0, void 0, function* () {
|
|
1349
1349
|
return new Promise((i, t) => {
|
|
1350
1350
|
a.file((e) => {
|
|
1351
|
-
const n =
|
|
1351
|
+
const n = X(e, a.fullPath);
|
|
1352
1352
|
i(n);
|
|
1353
1353
|
}, (e) => {
|
|
1354
1354
|
t(e);
|
|
@@ -1373,7 +1373,7 @@ function Qi() {
|
|
|
1373
1373
|
}), xa;
|
|
1374
1374
|
}
|
|
1375
1375
|
var at = Qi();
|
|
1376
|
-
const
|
|
1376
|
+
const Ta = /* @__PURE__ */ Ci(at);
|
|
1377
1377
|
function pi(a) {
|
|
1378
1378
|
return et(a) || tt(a) || yi(a) || it();
|
|
1379
1379
|
}
|
|
@@ -1385,7 +1385,7 @@ function tt(a) {
|
|
|
1385
1385
|
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
1386
1386
|
}
|
|
1387
1387
|
function et(a) {
|
|
1388
|
-
if (Array.isArray(a)) return
|
|
1388
|
+
if (Array.isArray(a)) return Na(a);
|
|
1389
1389
|
}
|
|
1390
1390
|
function oi(a, i) {
|
|
1391
1391
|
var t = Object.keys(a);
|
|
@@ -1411,7 +1411,7 @@ function ci(a) {
|
|
|
1411
1411
|
function hi(a, i, t) {
|
|
1412
1412
|
return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function oa(a, i) {
|
|
1415
1415
|
return ot(a) || pt(a, i) || yi(a, i) || nt();
|
|
1416
1416
|
}
|
|
1417
1417
|
function nt() {
|
|
@@ -1420,13 +1420,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1420
1420
|
}
|
|
1421
1421
|
function yi(a, i) {
|
|
1422
1422
|
if (a) {
|
|
1423
|
-
if (typeof a == "string") return
|
|
1423
|
+
if (typeof a == "string") return Na(a, i);
|
|
1424
1424
|
var t = Object.prototype.toString.call(a).slice(8, -1);
|
|
1425
1425
|
if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
|
|
1426
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return
|
|
1426
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Na(a, i);
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function Na(a, i) {
|
|
1430
1430
|
(i == null || i > a.length) && (i = a.length);
|
|
1431
1431
|
for (var t = 0, e = new Array(i); t < i; t++)
|
|
1432
1432
|
e[t] = a[t];
|
|
@@ -1454,7 +1454,7 @@ function pt(a, i) {
|
|
|
1454
1454
|
function ot(a) {
|
|
1455
1455
|
if (Array.isArray(a)) return a;
|
|
1456
1456
|
}
|
|
1457
|
-
var ct = typeof
|
|
1457
|
+
var ct = typeof Ta == "function" ? Ta : Ta.default, lt = "file-invalid-type", rt = "file-too-large", st = "file-too-small", dt = "too-many-files", mt = function() {
|
|
1458
1458
|
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t = i.split(","), e = t.length > 1 ? "one of ".concat(t.join(", ")) : t[0];
|
|
1459
1459
|
return {
|
|
1460
1460
|
code: lt,
|
|
@@ -1470,7 +1470,7 @@ var ct = typeof Sa == "function" ? Sa : Sa.default, lt = "file-invalid-type", rt
|
|
|
1470
1470
|
code: st,
|
|
1471
1471
|
message: "File is smaller than ".concat(i, " ").concat(i === 1 ? "byte" : "bytes")
|
|
1472
1472
|
};
|
|
1473
|
-
},
|
|
1473
|
+
}, vt = {
|
|
1474
1474
|
code: dt,
|
|
1475
1475
|
message: "Too many files"
|
|
1476
1476
|
};
|
|
@@ -1479,27 +1479,27 @@ function wi(a, i) {
|
|
|
1479
1479
|
return [t, t ? null : mt(i)];
|
|
1480
1480
|
}
|
|
1481
1481
|
function ki(a, i, t) {
|
|
1482
|
-
if (
|
|
1483
|
-
if (
|
|
1482
|
+
if ($(a.size))
|
|
1483
|
+
if ($(i) && $(t)) {
|
|
1484
1484
|
if (a.size > t) return [!1, li(t)];
|
|
1485
1485
|
if (a.size < i) return [!1, ri(i)];
|
|
1486
1486
|
} else {
|
|
1487
|
-
if (
|
|
1488
|
-
if (
|
|
1487
|
+
if ($(i) && a.size < i) return [!1, ri(i)];
|
|
1488
|
+
if ($(t) && a.size > t) return [!1, li(t)];
|
|
1489
1489
|
}
|
|
1490
1490
|
return [!0, null];
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function $(a) {
|
|
1493
1493
|
return a != null;
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1495
|
+
function ut(a) {
|
|
1496
1496
|
var i = a.files, t = a.accept, e = a.minSize, n = a.maxSize, o = a.multiple, l = a.maxFiles, r = a.validator;
|
|
1497
1497
|
return !o && i.length > 1 || o && l >= 1 && i.length > l ? !1 : i.every(function(v) {
|
|
1498
|
-
var
|
|
1499
|
-
return
|
|
1498
|
+
var h = wi(v, t), D = oa(h, 1), S = D[0], C = ki(v, e, n), q = oa(C, 1), O = q[0], F = r ? r(v) : null;
|
|
1499
|
+
return S && O && !F;
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function ja(a) {
|
|
1503
1503
|
return typeof a.isPropagationStopped == "function" ? a.isPropagationStopped() : typeof a.cancelBubble < "u" ? a.cancelBubble : !1;
|
|
1504
1504
|
}
|
|
1505
1505
|
function ga(a) {
|
|
@@ -1520,14 +1520,14 @@ function gt() {
|
|
|
1520
1520
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
|
|
1521
1521
|
return ft(a) || xt(a);
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function A() {
|
|
1524
1524
|
for (var a = arguments.length, i = new Array(a), t = 0; t < a; t++)
|
|
1525
1525
|
i[t] = arguments[t];
|
|
1526
1526
|
return function(e) {
|
|
1527
1527
|
for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), l = 1; l < n; l++)
|
|
1528
1528
|
o[l - 1] = arguments[l];
|
|
1529
1529
|
return i.some(function(r) {
|
|
1530
|
-
return !
|
|
1530
|
+
return !ja(e) && r && r.apply(void 0, [e].concat(o)), ja(e);
|
|
1531
1531
|
});
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
@@ -1535,12 +1535,12 @@ function bt() {
|
|
|
1535
1535
|
return "showOpenFilePicker" in window;
|
|
1536
1536
|
}
|
|
1537
1537
|
function ht(a) {
|
|
1538
|
-
if (
|
|
1538
|
+
if ($(a)) {
|
|
1539
1539
|
var i = Object.entries(a).filter(function(t) {
|
|
1540
|
-
var e =
|
|
1540
|
+
var e = oa(t, 2), n = e[0], o = e[1], l = !0;
|
|
1541
1541
|
return ji(n) || (console.warn('Skipped "'.concat(n, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), l = !1), (!Array.isArray(o) || !o.every(Di)) && (console.warn('Skipped "'.concat(n, '" because an invalid file extension was provided.')), l = !1), l;
|
|
1542
1542
|
}).reduce(function(t, e) {
|
|
1543
|
-
var n =
|
|
1543
|
+
var n = oa(e, 2), o = n[0], l = n[1];
|
|
1544
1544
|
return ci(ci({}, t), {}, hi({}, o, l));
|
|
1545
1545
|
}, {});
|
|
1546
1546
|
return [{
|
|
@@ -1552,9 +1552,9 @@ function ht(a) {
|
|
|
1552
1552
|
return a;
|
|
1553
1553
|
}
|
|
1554
1554
|
function yt(a) {
|
|
1555
|
-
if (
|
|
1555
|
+
if ($(a))
|
|
1556
1556
|
return Object.entries(a).reduce(function(i, t) {
|
|
1557
|
-
var e =
|
|
1557
|
+
var e = oa(t, 2), n = e[0], o = e[1];
|
|
1558
1558
|
return [].concat(pi(i), [n], pi(o));
|
|
1559
1559
|
}, []).filter(function(i) {
|
|
1560
1560
|
return ji(i) || Di(i);
|
|
@@ -1584,9 +1584,9 @@ function Ot(a) {
|
|
|
1584
1584
|
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
1585
1585
|
}
|
|
1586
1586
|
function Ft(a) {
|
|
1587
|
-
if (Array.isArray(a)) return
|
|
1587
|
+
if (Array.isArray(a)) return $a(a);
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1589
|
+
function La(a, i) {
|
|
1590
1590
|
return Rt(a) || It(a, i) || zi(a, i) || Pt();
|
|
1591
1591
|
}
|
|
1592
1592
|
function Pt() {
|
|
@@ -1595,13 +1595,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1595
1595
|
}
|
|
1596
1596
|
function zi(a, i) {
|
|
1597
1597
|
if (a) {
|
|
1598
|
-
if (typeof a == "string") return
|
|
1598
|
+
if (typeof a == "string") return $a(a, i);
|
|
1599
1599
|
var t = Object.prototype.toString.call(a).slice(8, -1);
|
|
1600
1600
|
if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
|
|
1601
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return
|
|
1601
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return $a(a, i);
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1604
|
+
function $a(a, i) {
|
|
1605
1605
|
(i == null || i > a.length) && (i = a.length);
|
|
1606
1606
|
for (var t = 0, e = new Array(i); t < i; t++)
|
|
1607
1607
|
e[t] = a[t];
|
|
@@ -1639,21 +1639,21 @@ function di(a, i) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
return t;
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1642
|
+
function d(a) {
|
|
1643
1643
|
for (var i = 1; i < arguments.length; i++) {
|
|
1644
1644
|
var t = arguments[i] != null ? arguments[i] : {};
|
|
1645
1645
|
i % 2 ? di(Object(t), !0).forEach(function(e) {
|
|
1646
|
-
|
|
1646
|
+
Ka(a, e, t[e]);
|
|
1647
1647
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : di(Object(t)).forEach(function(e) {
|
|
1648
1648
|
Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(t, e));
|
|
1649
1649
|
});
|
|
1650
1650
|
}
|
|
1651
1651
|
return a;
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function Ka(a, i, t) {
|
|
1654
1654
|
return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function Da(a, i) {
|
|
1657
1657
|
if (a == null) return {};
|
|
1658
1658
|
var t = St(a, i), e, n;
|
|
1659
1659
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1670,17 +1670,17 @@ function St(a, i) {
|
|
|
1670
1670
|
n = e[o], !(i.indexOf(n) >= 0) && (t[n] = a[n]);
|
|
1671
1671
|
return t;
|
|
1672
1672
|
}
|
|
1673
|
-
var
|
|
1674
|
-
var t = a.children, e =
|
|
1673
|
+
var Ua = /* @__PURE__ */ fi(function(a, i) {
|
|
1674
|
+
var t = a.children, e = Da(a, jt), n = Ei(e), o = n.open, l = Da(n, Dt);
|
|
1675
1675
|
return Ti(i, function() {
|
|
1676
1676
|
return {
|
|
1677
1677
|
open: o
|
|
1678
1678
|
};
|
|
1679
|
-
}, [o]), /* @__PURE__ */ Si.createElement(Li, null, t(
|
|
1679
|
+
}, [o]), /* @__PURE__ */ Si.createElement(Li, null, t(d(d({}, l), {}, {
|
|
1680
1680
|
open: o
|
|
1681
1681
|
})));
|
|
1682
1682
|
});
|
|
1683
|
-
|
|
1683
|
+
Ua.displayName = "Dropzone";
|
|
1684
1684
|
var _i = {
|
|
1685
1685
|
disabled: !1,
|
|
1686
1686
|
getFilesFromEvent: Wi,
|
|
@@ -1697,8 +1697,8 @@ var _i = {
|
|
|
1697
1697
|
useFsAccessApi: !1,
|
|
1698
1698
|
autoFocus: !1
|
|
1699
1699
|
};
|
|
1700
|
-
|
|
1701
|
-
|
|
1700
|
+
Ua.defaultProps = _i;
|
|
1701
|
+
Ua.propTypes = {
|
|
1702
1702
|
/**
|
|
1703
1703
|
* Render function that exposes the dropzone state and prop getter fns
|
|
1704
1704
|
*
|
|
@@ -1866,7 +1866,7 @@ Wa.propTypes = {
|
|
|
1866
1866
|
*/
|
|
1867
1867
|
validator: s.func
|
|
1868
1868
|
};
|
|
1869
|
-
var
|
|
1869
|
+
var Ha = {
|
|
1870
1870
|
isFocused: !1,
|
|
1871
1871
|
isFileDialogActive: !1,
|
|
1872
1872
|
isDragActive: !1,
|
|
@@ -1876,186 +1876,186 @@ var Ka = {
|
|
|
1876
1876
|
fileRejections: []
|
|
1877
1877
|
};
|
|
1878
1878
|
function Ei() {
|
|
1879
|
-
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i =
|
|
1879
|
+
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = d(d({}, _i), a), t = i.accept, e = i.disabled, n = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, v = i.maxFiles, h = i.onDragEnter, D = i.onDragLeave, S = i.onDragOver, C = i.onDrop, q = i.onDropAccepted, O = i.onDropRejected, F = i.onFileDialogCancel, y = i.onFileDialogOpen, M = i.useFsAccessApi, H = i.autoFocus, Q = i.preventDropOnDocument, ca = i.noClick, aa = i.noKeyboard, z = i.noDrag, _ = i.noDragEventsBubbling, ia = i.onError, P = i.validator, N = Z(function() {
|
|
1880
1880
|
return yt(t);
|
|
1881
|
-
}, [t]),
|
|
1881
|
+
}, [t]), la = Z(function() {
|
|
1882
1882
|
return ht(t);
|
|
1883
|
-
}, [t]),
|
|
1884
|
-
return typeof
|
|
1885
|
-
}, [
|
|
1886
|
-
return typeof
|
|
1887
|
-
}, [
|
|
1888
|
-
!
|
|
1889
|
-
if (
|
|
1890
|
-
var c =
|
|
1891
|
-
c.length || (
|
|
1883
|
+
}, [t]), ta = Z(function() {
|
|
1884
|
+
return typeof y == "function" ? y : mi;
|
|
1885
|
+
}, [y]), W = Z(function() {
|
|
1886
|
+
return typeof F == "function" ? F : mi;
|
|
1887
|
+
}, [F]), f = fa(null), g = fa(null), Ea = qi(qt, Ha), U = La(Ea, 2), B = U[0], b = U[1], I = B.isFocused, w = B.isFileDialogActive, k = fa(typeof window < "u" && window.isSecureContext && M && bt()), ra = function() {
|
|
1888
|
+
!k.current && w && setTimeout(function() {
|
|
1889
|
+
if (g.current) {
|
|
1890
|
+
var c = g.current.files;
|
|
1891
|
+
c.length || (b({
|
|
1892
1892
|
type: "closeDialog"
|
|
1893
|
-
}),
|
|
1893
|
+
}), W());
|
|
1894
1894
|
}
|
|
1895
1895
|
}, 300);
|
|
1896
1896
|
};
|
|
1897
|
-
|
|
1898
|
-
return window.addEventListener("focus",
|
|
1899
|
-
window.removeEventListener("focus",
|
|
1897
|
+
pa(function() {
|
|
1898
|
+
return window.addEventListener("focus", ra, !1), function() {
|
|
1899
|
+
window.removeEventListener("focus", ra, !1);
|
|
1900
1900
|
};
|
|
1901
|
-
}, [
|
|
1902
|
-
var
|
|
1903
|
-
|
|
1901
|
+
}, [g, w, W, k]);
|
|
1902
|
+
var T = fa([]), ea = function(c) {
|
|
1903
|
+
f.current && f.current.contains(c.target) || (c.preventDefault(), T.current = []);
|
|
1904
1904
|
};
|
|
1905
|
-
|
|
1906
|
-
return
|
|
1907
|
-
|
|
1905
|
+
pa(function() {
|
|
1906
|
+
return Q && (document.addEventListener("dragover", si, !1), document.addEventListener("drop", ea, !1)), function() {
|
|
1907
|
+
Q && (document.removeEventListener("dragover", si), document.removeEventListener("drop", ea));
|
|
1908
1908
|
};
|
|
1909
|
-
}, [
|
|
1910
|
-
return !e &&
|
|
1909
|
+
}, [f, Q]), pa(function() {
|
|
1910
|
+
return !e && H && f.current && f.current.focus(), function() {
|
|
1911
1911
|
};
|
|
1912
|
-
}, [
|
|
1913
|
-
var
|
|
1914
|
-
|
|
1915
|
-
}, [
|
|
1916
|
-
p.preventDefault(), p.persist(),
|
|
1917
|
-
if (!(
|
|
1918
|
-
var
|
|
1912
|
+
}, [f, H, e]);
|
|
1913
|
+
var R = E(function(p) {
|
|
1914
|
+
ia ? ia(p) : console.error(p);
|
|
1915
|
+
}, [ia]), Ba = E(function(p) {
|
|
1916
|
+
p.preventDefault(), p.persist(), va(p), T.current = [].concat(Et(T.current), [p.target]), ga(p) && Promise.resolve(n(p)).then(function(c) {
|
|
1917
|
+
if (!(ja(p) && !_)) {
|
|
1918
|
+
var m = c.length, u = m > 0 && ut({
|
|
1919
1919
|
files: c,
|
|
1920
|
-
accept:
|
|
1920
|
+
accept: N,
|
|
1921
1921
|
minSize: l,
|
|
1922
1922
|
maxSize: o,
|
|
1923
1923
|
multiple: r,
|
|
1924
1924
|
maxFiles: v,
|
|
1925
|
-
validator:
|
|
1926
|
-
}),
|
|
1927
|
-
|
|
1928
|
-
isDragAccept:
|
|
1929
|
-
isDragReject:
|
|
1925
|
+
validator: P
|
|
1926
|
+
}), j = m > 0 && !u;
|
|
1927
|
+
b({
|
|
1928
|
+
isDragAccept: u,
|
|
1929
|
+
isDragReject: j,
|
|
1930
1930
|
isDragActive: !0,
|
|
1931
1931
|
type: "setDraggedFiles"
|
|
1932
|
-
}),
|
|
1932
|
+
}), h && h(p);
|
|
1933
1933
|
}
|
|
1934
1934
|
}).catch(function(c) {
|
|
1935
|
-
return
|
|
1935
|
+
return R(c);
|
|
1936
1936
|
});
|
|
1937
|
-
}, [n,
|
|
1938
|
-
p.preventDefault(), p.persist(),
|
|
1937
|
+
}, [n, h, R, _, N, l, o, r, v, P]), Ya = E(function(p) {
|
|
1938
|
+
p.preventDefault(), p.persist(), va(p);
|
|
1939
1939
|
var c = ga(p);
|
|
1940
1940
|
if (c && p.dataTransfer)
|
|
1941
1941
|
try {
|
|
1942
1942
|
p.dataTransfer.dropEffect = "copy";
|
|
1943
1943
|
} catch {
|
|
1944
1944
|
}
|
|
1945
|
-
return c &&
|
|
1946
|
-
}, [
|
|
1947
|
-
p.preventDefault(), p.persist(),
|
|
1948
|
-
var c =
|
|
1949
|
-
return
|
|
1950
|
-
}),
|
|
1951
|
-
|
|
1945
|
+
return c && S && S(p), !1;
|
|
1946
|
+
}, [S, _]), Va = E(function(p) {
|
|
1947
|
+
p.preventDefault(), p.persist(), va(p);
|
|
1948
|
+
var c = T.current.filter(function(u) {
|
|
1949
|
+
return f.current && f.current.contains(u);
|
|
1950
|
+
}), m = c.indexOf(p.target);
|
|
1951
|
+
m !== -1 && c.splice(m, 1), T.current = c, !(c.length > 0) && (b({
|
|
1952
1952
|
type: "setDraggedFiles",
|
|
1953
1953
|
isDragActive: !1,
|
|
1954
1954
|
isDragAccept: !1,
|
|
1955
1955
|
isDragReject: !1
|
|
1956
1956
|
}), ga(p) && D && D(p));
|
|
1957
|
-
}, [
|
|
1958
|
-
var
|
|
1959
|
-
p.forEach(function(
|
|
1960
|
-
var
|
|
1961
|
-
if (
|
|
1962
|
-
|
|
1957
|
+
}, [f, D, _]), sa = E(function(p, c) {
|
|
1958
|
+
var m = [], u = [];
|
|
1959
|
+
p.forEach(function(j) {
|
|
1960
|
+
var na = wi(j, N), G = La(na, 2), Oa = G[0], Fa = G[1], Pa = ki(j, l, o), ua = La(Pa, 2), Ia = ua[0], Ra = ua[1], Sa = P ? P(j) : null;
|
|
1961
|
+
if (Oa && Ia && !Sa)
|
|
1962
|
+
m.push(j);
|
|
1963
1963
|
else {
|
|
1964
|
-
var
|
|
1965
|
-
|
|
1966
|
-
file:
|
|
1967
|
-
errors:
|
|
1964
|
+
var qa = [Fa, Ra];
|
|
1965
|
+
Sa && (qa = qa.concat(Sa)), u.push({
|
|
1966
|
+
file: j,
|
|
1967
|
+
errors: qa.filter(function(Ri) {
|
|
1968
1968
|
return Ri;
|
|
1969
1969
|
})
|
|
1970
1970
|
});
|
|
1971
1971
|
}
|
|
1972
|
-
}), (!r &&
|
|
1973
|
-
|
|
1974
|
-
file:
|
|
1975
|
-
errors: [
|
|
1972
|
+
}), (!r && m.length > 1 || r && v >= 1 && m.length > v) && (m.forEach(function(j) {
|
|
1973
|
+
u.push({
|
|
1974
|
+
file: j,
|
|
1975
|
+
errors: [vt]
|
|
1976
1976
|
});
|
|
1977
|
-
}),
|
|
1978
|
-
acceptedFiles:
|
|
1979
|
-
fileRejections:
|
|
1980
|
-
isDragReject:
|
|
1977
|
+
}), m.splice(0)), b({
|
|
1978
|
+
acceptedFiles: m,
|
|
1979
|
+
fileRejections: u,
|
|
1980
|
+
isDragReject: u.length > 0,
|
|
1981
1981
|
type: "setFiles"
|
|
1982
|
-
}),
|
|
1983
|
-
}, [
|
|
1984
|
-
p.preventDefault(), p.persist(),
|
|
1985
|
-
|
|
1982
|
+
}), C && C(m, u, c), u.length > 0 && O && O(u, c), m.length > 0 && q && q(m, c);
|
|
1983
|
+
}, [b, r, N, l, o, v, C, q, O, P]), da = E(function(p) {
|
|
1984
|
+
p.preventDefault(), p.persist(), va(p), T.current = [], ga(p) && Promise.resolve(n(p)).then(function(c) {
|
|
1985
|
+
ja(p) && !_ || sa(c, p);
|
|
1986
1986
|
}).catch(function(c) {
|
|
1987
|
-
return
|
|
1988
|
-
}),
|
|
1987
|
+
return R(c);
|
|
1988
|
+
}), b({
|
|
1989
1989
|
type: "reset"
|
|
1990
1990
|
});
|
|
1991
|
-
}, [n, sa,
|
|
1992
|
-
if (
|
|
1993
|
-
|
|
1991
|
+
}, [n, sa, R, _]), Y = E(function() {
|
|
1992
|
+
if (k.current) {
|
|
1993
|
+
b({
|
|
1994
1994
|
type: "openDialog"
|
|
1995
|
-
}),
|
|
1995
|
+
}), ta();
|
|
1996
1996
|
var p = {
|
|
1997
1997
|
multiple: r,
|
|
1998
|
-
types:
|
|
1998
|
+
types: la
|
|
1999
1999
|
};
|
|
2000
2000
|
window.showOpenFilePicker(p).then(function(c) {
|
|
2001
2001
|
return n(c);
|
|
2002
2002
|
}).then(function(c) {
|
|
2003
|
-
sa(c, null),
|
|
2003
|
+
sa(c, null), b({
|
|
2004
2004
|
type: "closeDialog"
|
|
2005
2005
|
});
|
|
2006
2006
|
}).catch(function(c) {
|
|
2007
|
-
wt(c) ? (
|
|
2007
|
+
wt(c) ? (W(c), b({
|
|
2008
2008
|
type: "closeDialog"
|
|
2009
|
-
})) : kt(c) ? (
|
|
2009
|
+
})) : kt(c) ? (k.current = !1, g.current ? (g.current.value = null, g.current.click()) : R(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : R(c);
|
|
2010
2010
|
});
|
|
2011
2011
|
return;
|
|
2012
2012
|
}
|
|
2013
|
-
|
|
2013
|
+
g.current && (b({
|
|
2014
2014
|
type: "openDialog"
|
|
2015
|
-
}),
|
|
2016
|
-
}, [
|
|
2017
|
-
!
|
|
2018
|
-
}, [
|
|
2019
|
-
|
|
2015
|
+
}), ta(), g.current.value = null, g.current.click());
|
|
2016
|
+
}, [b, ta, W, M, sa, R, la, r]), Ga = E(function(p) {
|
|
2017
|
+
!f.current || !f.current.isEqualNode(p.target) || (p.key === " " || p.key === "Enter" || p.keyCode === 32 || p.keyCode === 13) && (p.preventDefault(), Y());
|
|
2018
|
+
}, [f, Y]), Za = E(function() {
|
|
2019
|
+
b({
|
|
2020
2020
|
type: "focus"
|
|
2021
2021
|
});
|
|
2022
|
-
}, []), Ja =
|
|
2023
|
-
|
|
2022
|
+
}, []), Ja = E(function() {
|
|
2023
|
+
b({
|
|
2024
2024
|
type: "blur"
|
|
2025
2025
|
});
|
|
2026
|
-
}, []), Xa =
|
|
2027
|
-
|
|
2028
|
-
}, [
|
|
2026
|
+
}, []), Xa = E(function() {
|
|
2027
|
+
ca || (gt() ? setTimeout(Y, 0) : Y());
|
|
2028
|
+
}, [ca, Y]), V = function(c) {
|
|
2029
2029
|
return e ? null : c;
|
|
2030
|
-
},
|
|
2031
|
-
return
|
|
2030
|
+
}, Aa = function(c) {
|
|
2031
|
+
return aa ? null : V(c);
|
|
2032
2032
|
}, ma = function(c) {
|
|
2033
|
-
return
|
|
2034
|
-
},
|
|
2035
|
-
|
|
2036
|
-
}, Fi =
|
|
2033
|
+
return z ? null : V(c);
|
|
2034
|
+
}, va = function(c) {
|
|
2035
|
+
_ && c.stopPropagation();
|
|
2036
|
+
}, Fi = Z(function() {
|
|
2037
2037
|
return function() {
|
|
2038
|
-
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey,
|
|
2039
|
-
return
|
|
2040
|
-
onKeyDown:
|
|
2041
|
-
onFocus:
|
|
2042
|
-
onBlur:
|
|
2043
|
-
onClick:
|
|
2044
|
-
onDragEnter: ma(
|
|
2045
|
-
onDragOver: ma(
|
|
2046
|
-
onDragLeave: ma(
|
|
2047
|
-
onDrop: ma(
|
|
2048
|
-
role: typeof
|
|
2049
|
-
},
|
|
2038
|
+
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, m = c === void 0 ? "ref" : c, u = p.role, j = p.onKeyDown, na = p.onFocus, G = p.onBlur, Oa = p.onClick, Fa = p.onDragEnter, Pa = p.onDragOver, ua = p.onDragLeave, Ia = p.onDrop, Ra = Da(p, zt);
|
|
2039
|
+
return d(d(Ka({
|
|
2040
|
+
onKeyDown: Aa(A(j, Ga)),
|
|
2041
|
+
onFocus: Aa(A(na, Za)),
|
|
2042
|
+
onBlur: Aa(A(G, Ja)),
|
|
2043
|
+
onClick: V(A(Oa, Xa)),
|
|
2044
|
+
onDragEnter: ma(A(Fa, Ba)),
|
|
2045
|
+
onDragOver: ma(A(Pa, Ya)),
|
|
2046
|
+
onDragLeave: ma(A(ua, Va)),
|
|
2047
|
+
onDrop: ma(A(Ia, da)),
|
|
2048
|
+
role: typeof u == "string" && u !== "" ? u : "presentation"
|
|
2049
|
+
}, m, f), !e && !aa ? {
|
|
2050
2050
|
tabIndex: 0
|
|
2051
|
-
} : {}),
|
|
2051
|
+
} : {}), Ra);
|
|
2052
2052
|
};
|
|
2053
|
-
}, [
|
|
2053
|
+
}, [f, Ga, Za, Ja, Xa, Ba, Ya, Va, da, aa, z, e]), Pi = E(function(p) {
|
|
2054
2054
|
p.stopPropagation();
|
|
2055
|
-
}, []), Ii =
|
|
2055
|
+
}, []), Ii = Z(function() {
|
|
2056
2056
|
return function() {
|
|
2057
|
-
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey,
|
|
2058
|
-
accept:
|
|
2057
|
+
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, m = c === void 0 ? "ref" : c, u = p.onChange, j = p.onClick, na = Da(p, _t), G = Ka({
|
|
2058
|
+
accept: N,
|
|
2059
2059
|
multiple: r,
|
|
2060
2060
|
type: "file",
|
|
2061
2061
|
style: {
|
|
@@ -2070,116 +2070,118 @@ function Ei() {
|
|
|
2070
2070
|
width: "1px",
|
|
2071
2071
|
whiteSpace: "nowrap"
|
|
2072
2072
|
},
|
|
2073
|
-
onChange:
|
|
2074
|
-
onClick:
|
|
2073
|
+
onChange: V(A(u, da)),
|
|
2074
|
+
onClick: V(A(j, Pi)),
|
|
2075
2075
|
tabIndex: -1
|
|
2076
|
-
},
|
|
2077
|
-
return
|
|
2076
|
+
}, m, g);
|
|
2077
|
+
return d(d({}, G), na);
|
|
2078
2078
|
};
|
|
2079
|
-
}, [
|
|
2080
|
-
return
|
|
2081
|
-
isFocused:
|
|
2079
|
+
}, [g, t, r, da, e]);
|
|
2080
|
+
return d(d({}, B), {}, {
|
|
2081
|
+
isFocused: I && !e,
|
|
2082
2082
|
getRootProps: Fi,
|
|
2083
2083
|
getInputProps: Ii,
|
|
2084
|
-
rootRef:
|
|
2085
|
-
inputRef:
|
|
2086
|
-
open:
|
|
2084
|
+
rootRef: f,
|
|
2085
|
+
inputRef: g,
|
|
2086
|
+
open: V(Y)
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
function qt(a, i) {
|
|
2090
2090
|
switch (i.type) {
|
|
2091
2091
|
case "focus":
|
|
2092
|
-
return
|
|
2092
|
+
return d(d({}, a), {}, {
|
|
2093
2093
|
isFocused: !0
|
|
2094
2094
|
});
|
|
2095
2095
|
case "blur":
|
|
2096
|
-
return
|
|
2096
|
+
return d(d({}, a), {}, {
|
|
2097
2097
|
isFocused: !1
|
|
2098
2098
|
});
|
|
2099
2099
|
case "openDialog":
|
|
2100
|
-
return
|
|
2100
|
+
return d(d({}, Ha), {}, {
|
|
2101
2101
|
isFileDialogActive: !0
|
|
2102
2102
|
});
|
|
2103
2103
|
case "closeDialog":
|
|
2104
|
-
return
|
|
2104
|
+
return d(d({}, a), {}, {
|
|
2105
2105
|
isFileDialogActive: !1
|
|
2106
2106
|
});
|
|
2107
2107
|
case "setDraggedFiles":
|
|
2108
|
-
return
|
|
2108
|
+
return d(d({}, a), {}, {
|
|
2109
2109
|
isDragActive: i.isDragActive,
|
|
2110
2110
|
isDragAccept: i.isDragAccept,
|
|
2111
2111
|
isDragReject: i.isDragReject
|
|
2112
2112
|
});
|
|
2113
2113
|
case "setFiles":
|
|
2114
|
-
return
|
|
2114
|
+
return d(d({}, a), {}, {
|
|
2115
2115
|
acceptedFiles: i.acceptedFiles,
|
|
2116
2116
|
fileRejections: i.fileRejections,
|
|
2117
2117
|
isDragReject: i.isDragReject
|
|
2118
2118
|
});
|
|
2119
2119
|
case "reset":
|
|
2120
|
-
return
|
|
2120
|
+
return d({}, Ha);
|
|
2121
2121
|
default:
|
|
2122
2122
|
return a;
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
2125
|
function mi() {
|
|
2126
2126
|
}
|
|
2127
|
-
const Tt = "
|
|
2127
|
+
const Tt = "_root_z1bfm_2", Lt = "_disabled_z1bfm_26", Ct = "_actions_z1bfm_68", _a = {
|
|
2128
2128
|
root: Tt,
|
|
2129
2129
|
disabled: Lt,
|
|
2130
|
-
"drag-reject": "_drag-
|
|
2131
|
-
"file-input": "_file-
|
|
2132
|
-
"file-preview": "_file-
|
|
2133
|
-
"file-preview-icon": "_file-preview-
|
|
2134
|
-
"file-preview-name": "_file-preview-
|
|
2135
|
-
"file-preview-size": "_file-preview-
|
|
2136
|
-
"
|
|
2130
|
+
"drag-reject": "_drag-reject_z1bfm_32",
|
|
2131
|
+
"file-input": "_file-input_z1bfm_35",
|
|
2132
|
+
"file-preview": "_file-preview_z1bfm_40",
|
|
2133
|
+
"file-preview-icon": "_file-preview-icon_z1bfm_48",
|
|
2134
|
+
"file-preview-name": "_file-preview-name_z1bfm_51",
|
|
2135
|
+
"file-preview-size": "_file-preview-size_z1bfm_55",
|
|
2136
|
+
"file-preview-button": "_file-preview-button_z1bfm_58",
|
|
2137
|
+
"image-preview": "_image-preview_z1bfm_63",
|
|
2137
2138
|
actions: Ct,
|
|
2138
|
-
"message-title": "_message-
|
|
2139
|
-
"message-hint": "_message-
|
|
2140
|
-
"message-file-button-text": "_message-file-button-
|
|
2141
|
-
},
|
|
2139
|
+
"message-title": "_message-title_z1bfm_73",
|
|
2140
|
+
"message-hint": "_message-hint_z1bfm_76",
|
|
2141
|
+
"message-file-button-text": "_message-file-button-text_z1bfm_81"
|
|
2142
|
+
}, ba = za(_a), Ai = ({
|
|
2142
2143
|
file: a,
|
|
2143
2144
|
fileName: i,
|
|
2144
2145
|
forceFileType: t,
|
|
2145
2146
|
previewButtonText: e = "Preview"
|
|
2146
2147
|
}) => {
|
|
2147
2148
|
const n = typeof a == "string", o = Mi(a, t), l = a instanceof File ? Ni(a) : null, r = n && i ? i : xi(a);
|
|
2148
|
-
return /* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
|
|
2151
|
-
!n && /* @__PURE__ */ f(ya, { className: Ta("file-preview-size"), lines: 1, variant: "body-md", children: l }),
|
|
2152
|
-
n ? /* @__PURE__ */ V(
|
|
2153
|
-
ha,
|
|
2149
|
+
return /* @__PURE__ */ L(ui, { children: [
|
|
2150
|
+
n ? /* @__PURE__ */ L(
|
|
2151
|
+
ya,
|
|
2154
2152
|
{
|
|
2155
2153
|
as: "a",
|
|
2156
|
-
className: "
|
|
2154
|
+
className: ba("file-preview-size", "file-preview-button"),
|
|
2157
2155
|
href: a,
|
|
2158
2156
|
rel: "noopener noreferrer",
|
|
2159
2157
|
size: "md",
|
|
2160
2158
|
target: "_blank",
|
|
2159
|
+
variant: "secondary",
|
|
2161
2160
|
children: [
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ x("span", { children: e }),
|
|
2162
|
+
/* @__PURE__ */ x(J, { name: "external-link-alt" })
|
|
2164
2163
|
]
|
|
2165
2164
|
}
|
|
2166
|
-
) : null
|
|
2165
|
+
) : null,
|
|
2166
|
+
/* @__PURE__ */ x(J, { className: ba("file-preview-icon"), name: o, size: "xxl" }),
|
|
2167
|
+
/* @__PURE__ */ x(wa, { className: ba("file-preview-name"), lines: 1, variant: "heading-xs-strong", children: r }),
|
|
2168
|
+
!n && /* @__PURE__ */ x(wa, { className: ba("file-preview-size"), lines: 1, variant: "body-md", children: l })
|
|
2167
2169
|
] });
|
|
2168
2170
|
};
|
|
2169
2171
|
Ai.displayName = "FileDrop.FilePreview";
|
|
2170
|
-
const
|
|
2172
|
+
const Ca = za(_a), Wa = ({
|
|
2171
2173
|
disabled: a,
|
|
2172
2174
|
fileButtonText: i = "Browse file",
|
|
2173
2175
|
hint: t = "Drag & drop a file here or",
|
|
2174
2176
|
openFile: e,
|
|
2175
2177
|
title: n = "Add file"
|
|
2176
|
-
}) => /* @__PURE__ */
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
|
|
2178
|
+
}) => /* @__PURE__ */ L(ui, { children: [
|
|
2179
|
+
/* @__PURE__ */ x(wa, { className: Ca("message-title"), variant: "heading-xs-strong", children: n }),
|
|
2180
|
+
/* @__PURE__ */ x(wa, { className: Ca("message-hint"), variant: "body-md", children: t }),
|
|
2181
|
+
/* @__PURE__ */ x(
|
|
2182
|
+
ya,
|
|
2181
2183
|
{
|
|
2182
|
-
className:
|
|
2184
|
+
className: Ca("message-file-button-text"),
|
|
2183
2185
|
disabled: a,
|
|
2184
2186
|
onClick: e,
|
|
2185
2187
|
type: "button",
|
|
@@ -2187,8 +2189,8 @@ const La = Da(za), Ha = ({
|
|
|
2187
2189
|
}
|
|
2188
2190
|
)
|
|
2189
2191
|
] });
|
|
2190
|
-
|
|
2191
|
-
const Mt =
|
|
2192
|
+
Wa.displayName = "FileDrop.Message";
|
|
2193
|
+
const Mt = za(_a), Oi = ({
|
|
2192
2194
|
disabled: a,
|
|
2193
2195
|
error: i,
|
|
2194
2196
|
file: t,
|
|
@@ -2198,11 +2200,11 @@ const Mt = Da(za), Oi = ({
|
|
|
2198
2200
|
isAnImage: l,
|
|
2199
2201
|
isHoverAccept: r,
|
|
2200
2202
|
isHoverReject: v,
|
|
2201
|
-
openFile:
|
|
2203
|
+
openFile: h,
|
|
2202
2204
|
wordings: D
|
|
2203
|
-
}) => r ? /* @__PURE__ */
|
|
2205
|
+
}) => r ? /* @__PURE__ */ x(J, { name: "smile-beam-solid" }) : v ? /* @__PURE__ */ x(J, { name: "sad-solid" }) : i ? /* @__PURE__ */ x(Wa, { openFile: h, ...D }) : n ? l ? /* @__PURE__ */ x("img", { className: Mt("image-preview"), src: n }) : /* @__PURE__ */ x(Ai, { file: t, fileName: e, forceFileType: o, ...D }) : /* @__PURE__ */ x(Wa, { disabled: a, openFile: h, ...D });
|
|
2204
2206
|
Oi.displayName = "FileDrop.Preview";
|
|
2205
|
-
const
|
|
2207
|
+
const vi = /\.(jpeg|jpg|gif|png|webp)$/, Nt = (a) => a ? typeof a == "string" ? !!xi(a).match(vi) : a.name ? !!a.name.match(vi) : !1 : !1, $t = (a) => {
|
|
2206
2208
|
let i;
|
|
2207
2209
|
if (a instanceof File ? i = a.preview : i = a, typeof i != "string" || i.startsWith("blob:"))
|
|
2208
2210
|
return i;
|
|
@@ -2212,109 +2214,128 @@ const ui = /\.(jpeg|jpg|gif|png|webp)$/, Nt = (a) => a ? typeof a == "string" ?
|
|
|
2212
2214
|
} catch {
|
|
2213
2215
|
return;
|
|
2214
2216
|
}
|
|
2215
|
-
}, Kt = 2e6, Ht = "ERROR_INVALID_TYPE", Wt = "ERROR_INVALID_SIZE",
|
|
2217
|
+
}, Kt = 2e6, Ht = "ERROR_INVALID_TYPE", Wt = "ERROR_INVALID_SIZE", ha = za(_a), Ut = fi(
|
|
2216
2218
|
({
|
|
2217
2219
|
accept: a = {
|
|
2218
2220
|
"image/*": []
|
|
2219
2221
|
},
|
|
2220
2222
|
children: i = Oi,
|
|
2221
2223
|
className: t,
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2224
|
+
deleteButtonText: e = "Delete",
|
|
2225
|
+
disabled: n,
|
|
2226
|
+
editButtonText: o = "Edit",
|
|
2227
|
+
fileName: l,
|
|
2228
|
+
forceFileType: r,
|
|
2229
|
+
handleAddFile: v,
|
|
2230
|
+
handleRemoveFile: h,
|
|
2231
|
+
isClearable: D,
|
|
2232
|
+
isEditable: S,
|
|
2233
|
+
maxSize: C = Kt,
|
|
2234
|
+
multiple: q,
|
|
2235
|
+
name: O,
|
|
2236
|
+
onBlur: F,
|
|
2237
|
+
onChange: y,
|
|
2238
|
+
onError: M,
|
|
2239
|
+
value: H,
|
|
2240
|
+
wordings: Q,
|
|
2241
|
+
...ca
|
|
2242
|
+
}, aa) => {
|
|
2243
|
+
const [z, _] = Qa(H), [ia, P] = Qa(void 0);
|
|
2244
|
+
pa(() => {
|
|
2245
|
+
_(H);
|
|
2246
|
+
}, [H]), pa(() => () => z && z instanceof File && URL.revokeObjectURL(z.preview), [z]);
|
|
2247
|
+
const N = (I) => {
|
|
2248
|
+
const [w] = I;
|
|
2249
|
+
w instanceof File && (w.preview = URL.createObjectURL(w)), _(w), P(null);
|
|
2250
|
+
const k = ai({ name: O, value: w });
|
|
2251
|
+
y == null || y(k), v == null || v(k);
|
|
2252
|
+
}, la = (I, w) => {
|
|
2253
|
+
let k;
|
|
2254
|
+
I.map(({ errors: ra }) => {
|
|
2255
|
+
ra.map((T) => {
|
|
2256
|
+
const { code: ea, message: R } = T;
|
|
2257
|
+
ea === "file-invalid-type" ? k = Ht : ea === "file-too-large" ? k = Wt : k = R;
|
|
2254
2258
|
});
|
|
2255
|
-
}),
|
|
2256
|
-
},
|
|
2257
|
-
|
|
2258
|
-
const
|
|
2259
|
-
|
|
2260
|
-
}, { getInputProps:
|
|
2259
|
+
}), _(null), P(k), M == null || M(k), y == null || y(w), F == null || F();
|
|
2260
|
+
}, ta = (I) => {
|
|
2261
|
+
I.preventDefault(), _(null), P(null);
|
|
2262
|
+
const w = ai({ name: O, value: null });
|
|
2263
|
+
y == null || y(w), h == null || h(w);
|
|
2264
|
+
}, { getInputProps: W, getRootProps: f, isDragAccept: g, isDragActive: Ea, isDragReject: U, open: B } = Ei({
|
|
2261
2265
|
accept: a,
|
|
2262
|
-
disabled:
|
|
2263
|
-
maxSize:
|
|
2264
|
-
multiple:
|
|
2266
|
+
disabled: n,
|
|
2267
|
+
maxSize: C,
|
|
2268
|
+
multiple: q,
|
|
2265
2269
|
noClick: !0,
|
|
2266
|
-
onDropAccepted:
|
|
2267
|
-
onDropRejected:
|
|
2268
|
-
}),
|
|
2269
|
-
return /* @__PURE__ */
|
|
2270
|
+
onDropAccepted: N,
|
|
2271
|
+
onDropRejected: la
|
|
2272
|
+
}), b = (I) => M(I);
|
|
2273
|
+
return /* @__PURE__ */ L(
|
|
2270
2274
|
"div",
|
|
2271
2275
|
{
|
|
2272
|
-
className:
|
|
2273
|
-
...
|
|
2274
|
-
disabled:
|
|
2275
|
-
handleRemoveFile:
|
|
2276
|
-
isClearable:
|
|
2277
|
-
isDragAccept:
|
|
2278
|
-
isDragActive:
|
|
2279
|
-
isDragReject:
|
|
2280
|
-
isEditable:
|
|
2281
|
-
ref:
|
|
2276
|
+
className: ha("root", n && "disabled", U && "drag-reject", t),
|
|
2277
|
+
...f({
|
|
2278
|
+
disabled: n,
|
|
2279
|
+
handleRemoveFile: h,
|
|
2280
|
+
isClearable: D,
|
|
2281
|
+
isDragAccept: g,
|
|
2282
|
+
isDragActive: Ea,
|
|
2283
|
+
isDragReject: U,
|
|
2284
|
+
isEditable: S,
|
|
2285
|
+
ref: aa
|
|
2282
2286
|
}),
|
|
2283
|
-
...
|
|
2287
|
+
...ca,
|
|
2284
2288
|
children: [
|
|
2285
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ x(
|
|
2286
2290
|
"input",
|
|
2287
2291
|
{
|
|
2288
|
-
className:
|
|
2289
|
-
...
|
|
2292
|
+
className: ha("file-input"),
|
|
2293
|
+
...W({ disabled: n, multiple: q, name: O, onError: b })
|
|
2290
2294
|
}
|
|
2291
2295
|
),
|
|
2292
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ L("div", { className: ha("file-preview"), children: [
|
|
2293
2297
|
i({
|
|
2294
|
-
disabled:
|
|
2295
|
-
error:
|
|
2296
|
-
file:
|
|
2297
|
-
fileName:
|
|
2298
|
-
fileUrl:
|
|
2299
|
-
forceFileType:
|
|
2300
|
-
isAnImage:
|
|
2301
|
-
isHoverAccept:
|
|
2302
|
-
isHoverReject:
|
|
2303
|
-
openFile:
|
|
2304
|
-
wordings:
|
|
2298
|
+
disabled: n,
|
|
2299
|
+
error: ia,
|
|
2300
|
+
file: z,
|
|
2301
|
+
fileName: l,
|
|
2302
|
+
fileUrl: z && $t(z),
|
|
2303
|
+
forceFileType: r,
|
|
2304
|
+
isAnImage: r === "image" || Nt(z),
|
|
2305
|
+
isHoverAccept: g,
|
|
2306
|
+
isHoverReject: U,
|
|
2307
|
+
openFile: B,
|
|
2308
|
+
wordings: Q
|
|
2305
2309
|
}),
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
+
z ? /* @__PURE__ */ L("div", { className: ha("actions"), children: [
|
|
2311
|
+
/* @__PURE__ */ L(
|
|
2312
|
+
ya,
|
|
2313
|
+
{
|
|
2314
|
+
disabled: !S,
|
|
2315
|
+
onClick: B,
|
|
2316
|
+
size: "lg",
|
|
2317
|
+
type: "button",
|
|
2318
|
+
variant: "secondary",
|
|
2319
|
+
children: [
|
|
2320
|
+
/* @__PURE__ */ x(J, { name: "pen" }),
|
|
2321
|
+
o
|
|
2322
|
+
]
|
|
2323
|
+
}
|
|
2324
|
+
),
|
|
2325
|
+
/* @__PURE__ */ L(
|
|
2326
|
+
ya,
|
|
2310
2327
|
{
|
|
2311
|
-
|
|
2312
|
-
|
|
2328
|
+
disabled: !D,
|
|
2329
|
+
onClick: ta,
|
|
2330
|
+
size: "lg",
|
|
2313
2331
|
type: "button",
|
|
2314
|
-
variant: "
|
|
2315
|
-
children:
|
|
2332
|
+
variant: "secondary-danger",
|
|
2333
|
+
children: [
|
|
2334
|
+
/* @__PURE__ */ x(J, { name: "trash" }),
|
|
2335
|
+
e
|
|
2336
|
+
]
|
|
2316
2337
|
}
|
|
2317
|
-
)
|
|
2338
|
+
)
|
|
2318
2339
|
] }) : null
|
|
2319
2340
|
] })
|
|
2320
2341
|
]
|