welcome-ui 10.0.0-alpha.4 → 10.0.0-alpha.5
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/2W3RN7C5-DMC82gDP.js +61 -0
- package/dist/{4I4MLMKD-z3Xm3qCo.js → 4I4MLMKD-BO6Lcy7s.js} +17 -17
- package/dist/Accordion.js +19 -17
- package/dist/Alert.js +40 -31
- package/dist/AspectRatio.js +1 -0
- package/dist/Avatar.js +13 -11
- package/dist/{B7UTNDHN-BDa2-8JK.js → B7UTNDHN-BghjolIs.js} +30 -30
- package/dist/Badge.js +1 -0
- package/dist/Breadcrumb.js +76 -71
- package/dist/Button.js +8 -6
- package/dist/ButtonGroup.js +6 -4
- package/dist/Card.css +1 -1
- package/dist/Card.js +68 -15
- package/dist/Checkbox.js +30 -29
- package/dist/CloseButton.js +7 -5
- package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
- package/dist/{DSAASPLT-C-2xDjIv.js → DSAASPLT-Fx1kuAsk.js} +3 -3
- package/dist/DatePicker.js +82 -78
- package/dist/DateTimePicker.js +22 -21
- package/dist/Drawer.js +101 -80
- package/dist/DropdownMenu.css +1 -1
- package/dist/DropdownMenu.js +889 -462
- package/dist/Field.js +1 -0
- package/dist/FieldGroup.js +9 -7
- package/dist/FileDrop.js +184 -176
- package/dist/FileUpload.js +43 -40
- package/dist/{GVVKDT6A-C66-lr0B.js → GVVKDT6A-CF9ejW_c.js} +103 -103
- package/dist/Hint.js +9 -7
- package/dist/Icon.js +6 -4
- package/dist/InputText.js +30 -28
- package/dist/{KPUWHTQJ-Byij2al4.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
- package/dist/Label.js +9 -7
- package/dist/Link.js +25 -21
- package/dist/Loader.js +12 -10
- package/dist/Logo.js +21 -13
- package/dist/Modal.js +145 -114
- package/dist/{NI3IVY7K-DpF3td-7.js → NI3IVY7K-Dy240mkD.js} +160 -160
- package/dist/{NMGNQVTG-BgAqqGOq.js → NMGNQVTG-DRO2uXZT.js} +6 -6
- package/dist/{OE2EFRVA-DkdhQLJL.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
- package/dist/{OLVWQA7U-wHytlFYu.js → OLVWQA7U-Dia3UUnG.js} +36 -36
- package/dist/Pagination.js +39 -37
- package/dist/PasswordInput.js +20 -17
- package/dist/Popover.js +89 -72
- package/dist/{RTNCFSKZ-LcIdBwa8.js → RTNCFSKZ-BywELldk.js} +42 -42
- package/dist/Radio.js +20 -19
- package/dist/RadioGroup.js +29 -27
- package/dist/RadioTab.js +2 -1
- package/dist/{SBSPVDDI-BoxPz2JY.js → SBSPVDDI-CmtnvvUX.js} +46 -46
- package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
- package/dist/Search.css +1 -1
- package/dist/Search.js +62 -60
- package/dist/Select.css +1 -1
- package/dist/Select.js +204 -202
- package/dist/Slider.js +66 -61
- package/dist/Stepper.js +34 -27
- package/dist/StickyNote.js +30 -23
- package/dist/Swiper.js +52 -50
- package/dist/{T22PY7TE-CzEDuEn1.js → T22PY7TE-gLuJpoOm.js} +46 -46
- package/dist/Table.js +34 -21
- package/dist/Tabs.js +161 -152
- package/dist/Tag.css +1 -1
- package/dist/Tag.js +70 -65
- package/dist/Text.js +4 -2
- package/dist/Textarea.js +10 -8
- package/dist/TimePicker.js +22 -21
- package/dist/Toast.js +186 -177
- package/dist/Toggle.js +16 -14
- package/dist/Tooltip.js +29 -27
- package/dist/VariantIcon.js +7 -5
- package/dist/VisuallyHidden.js +8 -6
- package/dist/WelcomeLoader.js +3 -2
- package/dist/XCKGTAUF-CJwwVibW.js +25 -0
- package/dist/{Y67KZUMI-BDyUNSJw.js → Y67KZUMI-BwLWwpNF.js} +2 -2
- package/dist/{ZTXFEM5L-CjFLRObi.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
- package/dist/theme.js +1 -0
- package/dist/types/components/Alert/components/Title.d.ts +4 -1
- package/dist/types/components/Alert/index.d.ts +4 -1
- package/dist/types/components/Card/Body.d.ts +2 -3
- package/dist/types/components/Card/Footer.d.ts +6 -0
- package/dist/types/components/Card/Header.d.ts +5 -0
- package/dist/types/components/Card/index.d.ts +7 -8
- package/dist/types/components/Card/types.d.ts +16 -3
- package/dist/types/components/Checkbox/index.d.ts +1 -2
- package/dist/types/components/Checkbox/types.d.ts +3 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
- package/dist/types/components/Drawer/components/Close.d.ts +4 -1
- package/dist/types/components/Drawer/components/Title.d.ts +4 -1
- package/dist/types/components/Drawer/index.d.ts +12 -3
- package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
- package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/DropdownMenu/types.d.ts +26 -5
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
- package/dist/types/components/Loader/index.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
- package/dist/types/components/Modal/Assets/index.d.ts +16 -4
- package/dist/types/components/Modal/components/Close.d.ts +4 -1
- package/dist/types/components/Modal/index.d.ts +16 -4
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
- package/dist/types/components/Popover/Arrow.d.ts +4 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
- package/dist/types/components/RadioGroup/index.d.ts +4 -1
- package/dist/types/components/Stepper/index.d.ts +8 -2
- package/dist/types/components/StickyNote/components/Button.d.ts +4 -1
- package/dist/types/components/StickyNote/components/Title.d.ts +4 -1
- package/dist/types/components/StickyNote/index.d.ts +8 -2
- package/dist/types/components/Swiper/index.d.ts +4 -1
- package/dist/types/components/Table/index.d.ts +20 -5
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
- package/dist/types/components/Tag/types.d.ts +4 -2
- package/dist/types/components/Toast/index.d.ts +4 -1
- package/dist/utils.js +1 -0
- package/package.json +2 -2
- package/dist/2W3RN7C5-uG7eBeTQ.js +0 -61
- package/dist/SQZLCNLX-CUlXoT69.js +0 -82
- package/dist/XCKGTAUF-CahZE721.js +0 -25
package/dist/FileDrop.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import './FileDrop.css';
|
|
2
3
|
import { jsxs as V, Fragment as vi, jsx as f } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
import { g as
|
|
4
|
+
import Si, { useMemo as Y, useRef as fa, useReducer as qi, useEffect as ta, useCallback as j, forwardRef as fi, useImperativeHandle as Ti, Fragment as Li, useState as Qa } from "react";
|
|
5
|
+
import { _ as $, P as s } from "./tslib.es6-C80jYMbM.js";
|
|
6
|
+
import { g as Ci, c as Da } from "./index-PAaZGbyz.js";
|
|
6
7
|
import { Button as ha } from "./Button.js";
|
|
7
8
|
import { Icon as G } from "./Icon.js";
|
|
8
|
-
import { c as
|
|
9
|
-
import { g as
|
|
9
|
+
import { c as ai } from "./create-event-rXDe5aCQ.js";
|
|
10
|
+
import { g as Mi, a as Ni, b as xi } from "./index-DmEMuVTM.js";
|
|
10
11
|
import { Text as ya } from "./Text.js";
|
|
11
|
-
const
|
|
12
|
+
const $i = /* @__PURE__ */ new Map([
|
|
12
13
|
// https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
|
|
13
14
|
["1km", "application/vnd.1000minds.decision-model+xml"],
|
|
14
15
|
["3dml", "text/vnd.in3d.3dml"],
|
|
@@ -1212,13 +1213,13 @@ const Mi = /* @__PURE__ */ new Map([
|
|
|
1212
1213
|
["zsh", "text/x-scriptzsh"]
|
|
1213
1214
|
]);
|
|
1214
1215
|
function Z(a, i, t) {
|
|
1215
|
-
const e =
|
|
1216
|
-
return typeof e.path != "string" &&
|
|
1216
|
+
const e = Ki(a), { webkitRelativePath: n } = a, o = typeof i == "string" ? i : typeof n == "string" && n.length > 0 ? n : `./${a.name}`;
|
|
1217
|
+
return typeof e.path != "string" && ii(e, "path", o), ii(e, "relativePath", o), e;
|
|
1217
1218
|
}
|
|
1218
|
-
function
|
|
1219
|
+
function Ki(a) {
|
|
1219
1220
|
const { name: i } = a;
|
|
1220
1221
|
if (i && i.lastIndexOf(".") !== -1 && !a.type) {
|
|
1221
|
-
const e = i.split(".").pop().toLowerCase(), n =
|
|
1222
|
+
const e = i.split(".").pop().toLowerCase(), n = $i.get(e);
|
|
1222
1223
|
n && Object.defineProperty(a, "type", {
|
|
1223
1224
|
value: n,
|
|
1224
1225
|
writable: !1,
|
|
@@ -1228,7 +1229,7 @@ function $i(a) {
|
|
|
1228
1229
|
}
|
|
1229
1230
|
return a;
|
|
1230
1231
|
}
|
|
1231
|
-
function
|
|
1232
|
+
function ii(a, i, t) {
|
|
1232
1233
|
Object.defineProperty(a, i, {
|
|
1233
1234
|
value: t,
|
|
1234
1235
|
writable: !1,
|
|
@@ -1236,49 +1237,49 @@ function ai(a, i, t) {
|
|
|
1236
1237
|
enumerable: !0
|
|
1237
1238
|
});
|
|
1238
1239
|
}
|
|
1239
|
-
const
|
|
1240
|
+
const Hi = [
|
|
1240
1241
|
// Thumbnail cache files for macOS and Windows
|
|
1241
1242
|
".DS_Store",
|
|
1242
1243
|
// macOs
|
|
1243
1244
|
"Thumbs.db"
|
|
1244
1245
|
// Windows
|
|
1245
1246
|
];
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1248
|
-
return wa(a) &&
|
|
1247
|
+
function Wi(a) {
|
|
1248
|
+
return $(this, void 0, void 0, function* () {
|
|
1249
|
+
return wa(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) : [];
|
|
1249
1250
|
});
|
|
1250
1251
|
}
|
|
1251
|
-
function
|
|
1252
|
+
function Ui(a) {
|
|
1252
1253
|
return wa(a);
|
|
1253
1254
|
}
|
|
1254
|
-
function
|
|
1255
|
+
function Bi(a) {
|
|
1255
1256
|
return wa(a) && wa(a.target);
|
|
1256
1257
|
}
|
|
1257
1258
|
function wa(a) {
|
|
1258
1259
|
return typeof a == "object" && a !== null;
|
|
1259
1260
|
}
|
|
1260
|
-
function
|
|
1261
|
+
function Yi(a) {
|
|
1261
1262
|
return Ca(a.target.files).map((i) => Z(i));
|
|
1262
1263
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
1264
|
+
function Vi(a) {
|
|
1265
|
+
return $(this, void 0, void 0, function* () {
|
|
1265
1266
|
return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => Z(t));
|
|
1266
1267
|
});
|
|
1267
1268
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return
|
|
1269
|
+
function Gi(a, i) {
|
|
1270
|
+
return $(this, void 0, void 0, function* () {
|
|
1270
1271
|
if (a.items) {
|
|
1271
1272
|
const t = Ca(a.items).filter((n) => n.kind === "file");
|
|
1272
1273
|
if (i !== "drop")
|
|
1273
1274
|
return t;
|
|
1274
|
-
const e = yield Promise.all(t.map(
|
|
1275
|
-
return
|
|
1275
|
+
const e = yield Promise.all(t.map(Zi));
|
|
1276
|
+
return ti(gi(e));
|
|
1276
1277
|
}
|
|
1277
|
-
return
|
|
1278
|
+
return ti(Ca(a.files).map((t) => Z(t)));
|
|
1278
1279
|
});
|
|
1279
1280
|
}
|
|
1280
|
-
function
|
|
1281
|
-
return a.filter((i) =>
|
|
1281
|
+
function ti(a) {
|
|
1282
|
+
return a.filter((i) => Hi.indexOf(i.name) === -1);
|
|
1282
1283
|
}
|
|
1283
1284
|
function Ca(a) {
|
|
1284
1285
|
if (a === null)
|
|
@@ -1290,11 +1291,11 @@ function Ca(a) {
|
|
|
1290
1291
|
}
|
|
1291
1292
|
return i;
|
|
1292
1293
|
}
|
|
1293
|
-
function
|
|
1294
|
+
function Zi(a) {
|
|
1294
1295
|
if (typeof a.webkitGetAsEntry != "function")
|
|
1295
|
-
return
|
|
1296
|
+
return ei(a);
|
|
1296
1297
|
const i = a.webkitGetAsEntry();
|
|
1297
|
-
return i && i.isDirectory ? bi(i) :
|
|
1298
|
+
return i && i.isDirectory ? bi(i) : ei(a, i);
|
|
1298
1299
|
}
|
|
1299
1300
|
function gi(a) {
|
|
1300
1301
|
return a.reduce((i, t) => [
|
|
@@ -1302,10 +1303,10 @@ function gi(a) {
|
|
|
1302
1303
|
...Array.isArray(t) ? gi(t) : [t]
|
|
1303
1304
|
], []);
|
|
1304
1305
|
}
|
|
1305
|
-
function
|
|
1306
|
+
function ei(a, i) {
|
|
1306
1307
|
var t;
|
|
1307
1308
|
if (typeof a.getAsFileSystemHandle == "function")
|
|
1308
|
-
return a.getAsFileSystemHandle().then((o) =>
|
|
1309
|
+
return a.getAsFileSystemHandle().then((o) => $(this, void 0, void 0, function* () {
|
|
1309
1310
|
const l = yield o.getFile();
|
|
1310
1311
|
return l.handle = o, Z(l);
|
|
1311
1312
|
}));
|
|
@@ -1315,9 +1316,9 @@ function ti(a, i) {
|
|
|
1315
1316
|
const n = Z(e, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
|
|
1316
1317
|
return Promise.resolve(n);
|
|
1317
1318
|
}
|
|
1318
|
-
function
|
|
1319
|
-
return
|
|
1320
|
-
return a.isDirectory ? bi(a) :
|
|
1319
|
+
function Ji(a) {
|
|
1320
|
+
return $(this, void 0, void 0, function* () {
|
|
1321
|
+
return a.isDirectory ? bi(a) : Xi(a);
|
|
1321
1322
|
});
|
|
1322
1323
|
}
|
|
1323
1324
|
function bi(a) {
|
|
@@ -1325,9 +1326,9 @@ function bi(a) {
|
|
|
1325
1326
|
return new Promise((t, e) => {
|
|
1326
1327
|
const n = [];
|
|
1327
1328
|
function o() {
|
|
1328
|
-
i.readEntries((l) =>
|
|
1329
|
+
i.readEntries((l) => $(this, void 0, void 0, function* () {
|
|
1329
1330
|
if (l.length) {
|
|
1330
|
-
const r = Promise.all(l.map(
|
|
1331
|
+
const r = Promise.all(l.map(Ji));
|
|
1331
1332
|
n.push(r), o();
|
|
1332
1333
|
} else
|
|
1333
1334
|
try {
|
|
@@ -1343,8 +1344,8 @@ function bi(a) {
|
|
|
1343
1344
|
o();
|
|
1344
1345
|
});
|
|
1345
1346
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return
|
|
1347
|
+
function Xi(a) {
|
|
1348
|
+
return $(this, void 0, void 0, function* () {
|
|
1348
1349
|
return new Promise((i, t) => {
|
|
1349
1350
|
a.file((e) => {
|
|
1350
1351
|
const n = Z(e, a.fullPath);
|
|
@@ -1355,9 +1356,9 @@ function Zi(a) {
|
|
|
1355
1356
|
});
|
|
1356
1357
|
});
|
|
1357
1358
|
}
|
|
1358
|
-
var xa = {},
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1359
|
+
var xa = {}, ni;
|
|
1360
|
+
function Qi() {
|
|
1361
|
+
return ni || (ni = 1, xa.__esModule = !0, xa.default = function(a, i) {
|
|
1361
1362
|
if (a && i) {
|
|
1362
1363
|
var t = Array.isArray(i) ? i : i.split(",");
|
|
1363
1364
|
if (t.length === 0)
|
|
@@ -1371,22 +1372,22 @@ function Ji() {
|
|
|
1371
1372
|
return !0;
|
|
1372
1373
|
}), xa;
|
|
1373
1374
|
}
|
|
1374
|
-
var
|
|
1375
|
-
const Sa = /* @__PURE__ */
|
|
1376
|
-
function
|
|
1377
|
-
return
|
|
1375
|
+
var at = Qi();
|
|
1376
|
+
const Sa = /* @__PURE__ */ Ci(at);
|
|
1377
|
+
function pi(a) {
|
|
1378
|
+
return et(a) || tt(a) || yi(a) || it();
|
|
1378
1379
|
}
|
|
1379
|
-
function
|
|
1380
|
+
function it() {
|
|
1380
1381
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1381
1382
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1382
1383
|
}
|
|
1383
|
-
function
|
|
1384
|
+
function tt(a) {
|
|
1384
1385
|
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
1385
1386
|
}
|
|
1386
|
-
function
|
|
1387
|
+
function et(a) {
|
|
1387
1388
|
if (Array.isArray(a)) return Ma(a);
|
|
1388
1389
|
}
|
|
1389
|
-
function
|
|
1390
|
+
function oi(a, i) {
|
|
1390
1391
|
var t = Object.keys(a);
|
|
1391
1392
|
if (Object.getOwnPropertySymbols) {
|
|
1392
1393
|
var e = Object.getOwnPropertySymbols(a);
|
|
@@ -1396,12 +1397,12 @@ function pi(a, i) {
|
|
|
1396
1397
|
}
|
|
1397
1398
|
return t;
|
|
1398
1399
|
}
|
|
1399
|
-
function
|
|
1400
|
+
function ci(a) {
|
|
1400
1401
|
for (var i = 1; i < arguments.length; i++) {
|
|
1401
1402
|
var t = arguments[i] != null ? arguments[i] : {};
|
|
1402
|
-
i % 2 ?
|
|
1403
|
+
i % 2 ? oi(Object(t), !0).forEach(function(e) {
|
|
1403
1404
|
hi(a, e, t[e]);
|
|
1404
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) :
|
|
1405
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : oi(Object(t)).forEach(function(e) {
|
|
1405
1406
|
Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(t, e));
|
|
1406
1407
|
});
|
|
1407
1408
|
}
|
|
@@ -1411,9 +1412,9 @@ function hi(a, i, t) {
|
|
|
1411
1412
|
return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
|
|
1412
1413
|
}
|
|
1413
1414
|
function ea(a, i) {
|
|
1414
|
-
return
|
|
1415
|
+
return ot(a) || pt(a, i) || yi(a, i) || nt();
|
|
1415
1416
|
}
|
|
1416
|
-
function
|
|
1417
|
+
function nt() {
|
|
1417
1418
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1418
1419
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1419
1420
|
}
|
|
@@ -1431,7 +1432,7 @@ function Ma(a, i) {
|
|
|
1431
1432
|
e[t] = a[t];
|
|
1432
1433
|
return e;
|
|
1433
1434
|
}
|
|
1434
|
-
function
|
|
1435
|
+
function pt(a, i) {
|
|
1435
1436
|
var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
|
|
1436
1437
|
if (t != null) {
|
|
1437
1438
|
var e = [], n = !0, o = !1, l, r;
|
|
@@ -1450,48 +1451,48 @@ function et(a, i) {
|
|
|
1450
1451
|
return e;
|
|
1451
1452
|
}
|
|
1452
1453
|
}
|
|
1453
|
-
function
|
|
1454
|
+
function ot(a) {
|
|
1454
1455
|
if (Array.isArray(a)) return a;
|
|
1455
1456
|
}
|
|
1456
|
-
var
|
|
1457
|
+
var ct = typeof Sa == "function" ? Sa : Sa.default, lt = "file-invalid-type", rt = "file-too-large", st = "file-too-small", dt = "too-many-files", mt = function() {
|
|
1457
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];
|
|
1458
1459
|
return {
|
|
1459
|
-
code:
|
|
1460
|
+
code: lt,
|
|
1460
1461
|
message: "File type must be ".concat(e)
|
|
1461
1462
|
};
|
|
1462
|
-
},
|
|
1463
|
+
}, li = function(i) {
|
|
1463
1464
|
return {
|
|
1464
|
-
code:
|
|
1465
|
+
code: rt,
|
|
1465
1466
|
message: "File is larger than ".concat(i, " ").concat(i === 1 ? "byte" : "bytes")
|
|
1466
1467
|
};
|
|
1467
|
-
},
|
|
1468
|
+
}, ri = function(i) {
|
|
1468
1469
|
return {
|
|
1469
|
-
code:
|
|
1470
|
+
code: st,
|
|
1470
1471
|
message: "File is smaller than ".concat(i, " ").concat(i === 1 ? "byte" : "bytes")
|
|
1471
1472
|
};
|
|
1472
|
-
},
|
|
1473
|
-
code:
|
|
1473
|
+
}, ut = {
|
|
1474
|
+
code: dt,
|
|
1474
1475
|
message: "Too many files"
|
|
1475
1476
|
};
|
|
1476
1477
|
function wi(a, i) {
|
|
1477
|
-
var t = a.type === "application/x-moz-file" ||
|
|
1478
|
-
return [t, t ? null :
|
|
1478
|
+
var t = a.type === "application/x-moz-file" || ct(a, i);
|
|
1479
|
+
return [t, t ? null : mt(i)];
|
|
1479
1480
|
}
|
|
1480
1481
|
function ki(a, i, t) {
|
|
1481
|
-
if (
|
|
1482
|
-
if (
|
|
1483
|
-
if (a.size > t) return [!1,
|
|
1484
|
-
if (a.size < i) return [!1,
|
|
1482
|
+
if (N(a.size))
|
|
1483
|
+
if (N(i) && N(t)) {
|
|
1484
|
+
if (a.size > t) return [!1, li(t)];
|
|
1485
|
+
if (a.size < i) return [!1, ri(i)];
|
|
1485
1486
|
} else {
|
|
1486
|
-
if (
|
|
1487
|
-
if (
|
|
1487
|
+
if (N(i) && a.size < i) return [!1, ri(i)];
|
|
1488
|
+
if (N(t) && a.size > t) return [!1, li(t)];
|
|
1488
1489
|
}
|
|
1489
1490
|
return [!0, null];
|
|
1490
1491
|
}
|
|
1491
|
-
function
|
|
1492
|
+
function N(a) {
|
|
1492
1493
|
return a != null;
|
|
1493
1494
|
}
|
|
1494
|
-
function
|
|
1495
|
+
function vt(a) {
|
|
1495
1496
|
var i = a.files, t = a.accept, e = a.minSize, n = a.maxSize, o = a.multiple, l = a.maxFiles, r = a.validator;
|
|
1496
1497
|
return !o && i.length > 1 || o && l >= 1 && i.length > l ? !1 : i.every(function(v) {
|
|
1497
1498
|
var w = wi(v, t), D = ea(w, 1), I = D[0], F = ki(v, e, n), P = ea(F, 1), h = P[0], E = r ? r(v) : null;
|
|
@@ -1506,18 +1507,18 @@ function ga(a) {
|
|
|
1506
1507
|
return i === "Files" || i === "application/x-moz-file";
|
|
1507
1508
|
}) : !!a.target && !!a.target.files;
|
|
1508
1509
|
}
|
|
1509
|
-
function
|
|
1510
|
+
function si(a) {
|
|
1510
1511
|
a.preventDefault();
|
|
1511
1512
|
}
|
|
1512
|
-
function
|
|
1513
|
+
function ft(a) {
|
|
1513
1514
|
return a.indexOf("MSIE") !== -1 || a.indexOf("Trident/") !== -1;
|
|
1514
1515
|
}
|
|
1515
|
-
function
|
|
1516
|
+
function xt(a) {
|
|
1516
1517
|
return a.indexOf("Edge/") !== -1;
|
|
1517
1518
|
}
|
|
1518
|
-
function
|
|
1519
|
+
function gt() {
|
|
1519
1520
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
|
|
1520
|
-
return
|
|
1521
|
+
return ft(a) || xt(a);
|
|
1521
1522
|
}
|
|
1522
1523
|
function O() {
|
|
1523
1524
|
for (var a = arguments.length, i = new Array(a), t = 0; t < a; t++)
|
|
@@ -1530,17 +1531,17 @@ function O() {
|
|
|
1530
1531
|
});
|
|
1531
1532
|
};
|
|
1532
1533
|
}
|
|
1533
|
-
function
|
|
1534
|
+
function bt() {
|
|
1534
1535
|
return "showOpenFilePicker" in window;
|
|
1535
1536
|
}
|
|
1536
|
-
function
|
|
1537
|
-
if (
|
|
1537
|
+
function ht(a) {
|
|
1538
|
+
if (N(a)) {
|
|
1538
1539
|
var i = Object.entries(a).filter(function(t) {
|
|
1539
1540
|
var e = ea(t, 2), n = e[0], o = e[1], l = !0;
|
|
1540
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;
|
|
1541
1542
|
}).reduce(function(t, e) {
|
|
1542
1543
|
var n = ea(e, 2), o = n[0], l = n[1];
|
|
1543
|
-
return
|
|
1544
|
+
return ci(ci({}, t), {}, hi({}, o, l));
|
|
1544
1545
|
}, {});
|
|
1545
1546
|
return [{
|
|
1546
1547
|
// description is required due to https://crbug.com/1264708
|
|
@@ -1550,19 +1551,19 @@ function gt(a) {
|
|
|
1550
1551
|
}
|
|
1551
1552
|
return a;
|
|
1552
1553
|
}
|
|
1553
|
-
function
|
|
1554
|
-
if (
|
|
1554
|
+
function yt(a) {
|
|
1555
|
+
if (N(a))
|
|
1555
1556
|
return Object.entries(a).reduce(function(i, t) {
|
|
1556
1557
|
var e = ea(t, 2), n = e[0], o = e[1];
|
|
1557
|
-
return [].concat(
|
|
1558
|
+
return [].concat(pi(i), [n], pi(o));
|
|
1558
1559
|
}, []).filter(function(i) {
|
|
1559
1560
|
return ji(i) || Di(i);
|
|
1560
1561
|
}).join(",");
|
|
1561
1562
|
}
|
|
1562
|
-
function
|
|
1563
|
+
function wt(a) {
|
|
1563
1564
|
return a instanceof DOMException && (a.name === "AbortError" || a.code === a.ABORT_ERR);
|
|
1564
1565
|
}
|
|
1565
|
-
function
|
|
1566
|
+
function kt(a) {
|
|
1566
1567
|
return a instanceof DOMException && (a.name === "SecurityError" || a.code === a.SECURITY_ERR);
|
|
1567
1568
|
}
|
|
1568
1569
|
function ji(a) {
|
|
@@ -1571,42 +1572,42 @@ function ji(a) {
|
|
|
1571
1572
|
function Di(a) {
|
|
1572
1573
|
return /^.*\.[\w]+$/.test(a);
|
|
1573
1574
|
}
|
|
1574
|
-
var
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1575
|
+
var jt = ["children"], Dt = ["open"], zt = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _t = ["refKey", "onChange", "onClick"];
|
|
1576
|
+
function Et(a) {
|
|
1577
|
+
return Ft(a) || Ot(a) || zi(a) || At();
|
|
1577
1578
|
}
|
|
1578
|
-
function
|
|
1579
|
+
function At() {
|
|
1579
1580
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1580
1581
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1581
1582
|
}
|
|
1582
|
-
function
|
|
1583
|
+
function Ot(a) {
|
|
1583
1584
|
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
1584
1585
|
}
|
|
1585
|
-
function
|
|
1586
|
-
if (Array.isArray(a)) return
|
|
1586
|
+
function Ft(a) {
|
|
1587
|
+
if (Array.isArray(a)) return Na(a);
|
|
1587
1588
|
}
|
|
1588
1589
|
function qa(a, i) {
|
|
1589
|
-
return
|
|
1590
|
+
return Rt(a) || It(a, i) || zi(a, i) || Pt();
|
|
1590
1591
|
}
|
|
1591
|
-
function
|
|
1592
|
+
function Pt() {
|
|
1592
1593
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1593
1594
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1594
1595
|
}
|
|
1595
1596
|
function zi(a, i) {
|
|
1596
1597
|
if (a) {
|
|
1597
|
-
if (typeof a == "string") return
|
|
1598
|
+
if (typeof a == "string") return Na(a, i);
|
|
1598
1599
|
var t = Object.prototype.toString.call(a).slice(8, -1);
|
|
1599
1600
|
if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
|
|
1600
|
-
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 Na(a, i);
|
|
1601
1602
|
}
|
|
1602
1603
|
}
|
|
1603
|
-
function
|
|
1604
|
+
function Na(a, i) {
|
|
1604
1605
|
(i == null || i > a.length) && (i = a.length);
|
|
1605
1606
|
for (var t = 0, e = new Array(i); t < i; t++)
|
|
1606
1607
|
e[t] = a[t];
|
|
1607
1608
|
return e;
|
|
1608
1609
|
}
|
|
1609
|
-
function
|
|
1610
|
+
function It(a, i) {
|
|
1610
1611
|
var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
|
|
1611
1612
|
if (t != null) {
|
|
1612
1613
|
var e = [], n = !0, o = !1, l, r;
|
|
@@ -1625,10 +1626,10 @@ function Ft(a, i) {
|
|
|
1625
1626
|
return e;
|
|
1626
1627
|
}
|
|
1627
1628
|
}
|
|
1628
|
-
function
|
|
1629
|
+
function Rt(a) {
|
|
1629
1630
|
if (Array.isArray(a)) return a;
|
|
1630
1631
|
}
|
|
1631
|
-
function
|
|
1632
|
+
function di(a, i) {
|
|
1632
1633
|
var t = Object.keys(a);
|
|
1633
1634
|
if (Object.getOwnPropertySymbols) {
|
|
1634
1635
|
var e = Object.getOwnPropertySymbols(a);
|
|
@@ -1641,20 +1642,20 @@ function si(a, i) {
|
|
|
1641
1642
|
function m(a) {
|
|
1642
1643
|
for (var i = 1; i < arguments.length; i++) {
|
|
1643
1644
|
var t = arguments[i] != null ? arguments[i] : {};
|
|
1644
|
-
i % 2 ?
|
|
1645
|
-
|
|
1646
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) :
|
|
1645
|
+
i % 2 ? di(Object(t), !0).forEach(function(e) {
|
|
1646
|
+
$a(a, e, t[e]);
|
|
1647
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : di(Object(t)).forEach(function(e) {
|
|
1647
1648
|
Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(t, e));
|
|
1648
1649
|
});
|
|
1649
1650
|
}
|
|
1650
1651
|
return a;
|
|
1651
1652
|
}
|
|
1652
|
-
function
|
|
1653
|
+
function $a(a, i, t) {
|
|
1653
1654
|
return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
|
|
1654
1655
|
}
|
|
1655
1656
|
function ja(a, i) {
|
|
1656
1657
|
if (a == null) return {};
|
|
1657
|
-
var t =
|
|
1658
|
+
var t = St(a, i), e, n;
|
|
1658
1659
|
if (Object.getOwnPropertySymbols) {
|
|
1659
1660
|
var o = Object.getOwnPropertySymbols(a);
|
|
1660
1661
|
for (n = 0; n < o.length; n++)
|
|
@@ -1662,27 +1663,27 @@ function ja(a, i) {
|
|
|
1662
1663
|
}
|
|
1663
1664
|
return t;
|
|
1664
1665
|
}
|
|
1665
|
-
function
|
|
1666
|
+
function St(a, i) {
|
|
1666
1667
|
if (a == null) return {};
|
|
1667
1668
|
var t = {}, e = Object.keys(a), n, o;
|
|
1668
1669
|
for (o = 0; o < e.length; o++)
|
|
1669
1670
|
n = e[o], !(i.indexOf(n) >= 0) && (t[n] = a[n]);
|
|
1670
1671
|
return t;
|
|
1671
1672
|
}
|
|
1672
|
-
var
|
|
1673
|
-
var t = a.children, e = ja(a,
|
|
1674
|
-
return
|
|
1673
|
+
var Wa = /* @__PURE__ */ fi(function(a, i) {
|
|
1674
|
+
var t = a.children, e = ja(a, jt), n = Ei(e), o = n.open, l = ja(n, Dt);
|
|
1675
|
+
return Ti(i, function() {
|
|
1675
1676
|
return {
|
|
1676
1677
|
open: o
|
|
1677
1678
|
};
|
|
1678
|
-
}, [o]), /* @__PURE__ */
|
|
1679
|
+
}, [o]), /* @__PURE__ */ Si.createElement(Li, null, t(m(m({}, l), {}, {
|
|
1679
1680
|
open: o
|
|
1680
1681
|
})));
|
|
1681
1682
|
});
|
|
1682
|
-
|
|
1683
|
+
Wa.displayName = "Dropzone";
|
|
1683
1684
|
var _i = {
|
|
1684
1685
|
disabled: !1,
|
|
1685
|
-
getFilesFromEvent:
|
|
1686
|
+
getFilesFromEvent: Wi,
|
|
1686
1687
|
maxSize: 1 / 0,
|
|
1687
1688
|
minSize: 0,
|
|
1688
1689
|
multiple: !0,
|
|
@@ -1696,8 +1697,8 @@ var _i = {
|
|
|
1696
1697
|
useFsAccessApi: !1,
|
|
1697
1698
|
autoFocus: !1
|
|
1698
1699
|
};
|
|
1699
|
-
|
|
1700
|
-
|
|
1700
|
+
Wa.defaultProps = _i;
|
|
1701
|
+
Wa.propTypes = {
|
|
1701
1702
|
/**
|
|
1702
1703
|
* Render function that exposes the dropzone state and prop getter fns
|
|
1703
1704
|
*
|
|
@@ -1876,14 +1877,14 @@ var Ka = {
|
|
|
1876
1877
|
};
|
|
1877
1878
|
function Ei() {
|
|
1878
1879
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = m(m({}, _i), a), t = i.accept, e = i.disabled, n = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, v = i.maxFiles, w = i.onDragEnter, D = i.onDragLeave, I = i.onDragOver, F = i.onDrop, P = i.onDropAccepted, h = i.onDropRejected, E = i.onFileDialogCancel, q = i.onFileDialogOpen, na = i.useFsAccessApi, pa = i.autoFocus, J = i.preventDropOnDocument, k = i.noClick, R = i.noKeyboard, K = i.noDrag, z = i.noDragEventsBubbling, X = i.onError, T = i.validator, L = Y(function() {
|
|
1879
|
-
return
|
|
1880
|
+
return yt(t);
|
|
1880
1881
|
}, [t]), oa = Y(function() {
|
|
1881
|
-
return
|
|
1882
|
+
return ht(t);
|
|
1882
1883
|
}, [t]), Q = Y(function() {
|
|
1883
|
-
return typeof q == "function" ? q :
|
|
1884
|
+
return typeof q == "function" ? q : mi;
|
|
1884
1885
|
}, [q]), C = Y(function() {
|
|
1885
|
-
return typeof E == "function" ? E :
|
|
1886
|
-
}, [E]), g = fa(null), b = fa(null), ca =
|
|
1886
|
+
return typeof E == "function" ? E : mi;
|
|
1887
|
+
}, [E]), g = fa(null), b = fa(null), ca = qi(qt, Ka), la = qa(ca, 2), _ = la[0], d = la[1], A = _.isFocused, ra = _.isFileDialogActive, H = fa(typeof window < "u" && window.isSecureContext && na && bt()), aa = function() {
|
|
1887
1888
|
!H.current && ra && setTimeout(function() {
|
|
1888
1889
|
if (b.current) {
|
|
1889
1890
|
var c = b.current.files;
|
|
@@ -1898,12 +1899,12 @@ function Ei() {
|
|
|
1898
1899
|
window.removeEventListener("focus", aa, !1);
|
|
1899
1900
|
};
|
|
1900
1901
|
}, [b, ra, C, H]);
|
|
1901
|
-
var S = fa([]),
|
|
1902
|
+
var S = fa([]), Ua = function(c) {
|
|
1902
1903
|
g.current && g.current.contains(c.target) || (c.preventDefault(), S.current = []);
|
|
1903
1904
|
};
|
|
1904
1905
|
ta(function() {
|
|
1905
|
-
return J && (document.addEventListener("dragover",
|
|
1906
|
-
J && (document.removeEventListener("dragover",
|
|
1906
|
+
return J && (document.addEventListener("dragover", si, !1), document.addEventListener("drop", Ua, !1)), function() {
|
|
1907
|
+
J && (document.removeEventListener("dragover", si), document.removeEventListener("drop", Ua));
|
|
1907
1908
|
};
|
|
1908
1909
|
}, [g, J]), ta(function() {
|
|
1909
1910
|
return !e && pa && g.current && g.current.focus(), function() {
|
|
@@ -1911,10 +1912,10 @@ function Ei() {
|
|
|
1911
1912
|
}, [g, pa, e]);
|
|
1912
1913
|
var M = j(function(p) {
|
|
1913
1914
|
X ? X(p) : console.error(p);
|
|
1914
|
-
}, [X]),
|
|
1915
|
-
p.preventDefault(), p.persist(), ua(p), S.current = [].concat(
|
|
1915
|
+
}, [X]), Ba = j(function(p) {
|
|
1916
|
+
p.preventDefault(), p.persist(), ua(p), S.current = [].concat(Et(S.current), [p.target]), ga(p) && Promise.resolve(n(p)).then(function(c) {
|
|
1916
1917
|
if (!(ka(p) && !z)) {
|
|
1917
|
-
var u = c.length, x = u > 0 &&
|
|
1918
|
+
var u = c.length, x = u > 0 && vt({
|
|
1918
1919
|
files: c,
|
|
1919
1920
|
accept: L,
|
|
1920
1921
|
minSize: l,
|
|
@@ -1933,7 +1934,7 @@ function Ei() {
|
|
|
1933
1934
|
}).catch(function(c) {
|
|
1934
1935
|
return M(c);
|
|
1935
1936
|
});
|
|
1936
|
-
}, [n, w, M, z, L, l, o, r, v, T]),
|
|
1937
|
+
}, [n, w, M, z, L, l, o, r, v, T]), Ya = j(function(p) {
|
|
1937
1938
|
p.preventDefault(), p.persist(), ua(p);
|
|
1938
1939
|
var c = ga(p);
|
|
1939
1940
|
if (c && p.dataTransfer)
|
|
@@ -1942,7 +1943,7 @@ function Ei() {
|
|
|
1942
1943
|
} catch {
|
|
1943
1944
|
}
|
|
1944
1945
|
return c && I && I(p), !1;
|
|
1945
|
-
}, [I, z]),
|
|
1946
|
+
}, [I, z]), Va = j(function(p) {
|
|
1946
1947
|
p.preventDefault(), p.persist(), ua(p);
|
|
1947
1948
|
var c = S.current.filter(function(x) {
|
|
1948
1949
|
return g.current && g.current.contains(x);
|
|
@@ -1963,15 +1964,15 @@ function Ei() {
|
|
|
1963
1964
|
var Ra = [Aa, Pa];
|
|
1964
1965
|
Ia && (Ra = Ra.concat(Ia)), x.push({
|
|
1965
1966
|
file: y,
|
|
1966
|
-
errors: Ra.filter(function(
|
|
1967
|
-
return
|
|
1967
|
+
errors: Ra.filter(function(Ri) {
|
|
1968
|
+
return Ri;
|
|
1968
1969
|
})
|
|
1969
1970
|
});
|
|
1970
1971
|
}
|
|
1971
1972
|
}), (!r && u.length > 1 || r && v >= 1 && u.length > v) && (u.forEach(function(y) {
|
|
1972
1973
|
x.push({
|
|
1973
1974
|
file: y,
|
|
1974
|
-
errors: [
|
|
1975
|
+
errors: [ut]
|
|
1975
1976
|
});
|
|
1976
1977
|
}), u.splice(0)), d({
|
|
1977
1978
|
acceptedFiles: u,
|
|
@@ -2003,27 +2004,27 @@ function Ei() {
|
|
|
2003
2004
|
type: "closeDialog"
|
|
2004
2005
|
});
|
|
2005
2006
|
}).catch(function(c) {
|
|
2006
|
-
|
|
2007
|
+
wt(c) ? (C(c), d({
|
|
2007
2008
|
type: "closeDialog"
|
|
2008
|
-
})) :
|
|
2009
|
+
})) : kt(c) ? (H.current = !1, b.current ? (b.current.value = null, b.current.click()) : M(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."))) : M(c);
|
|
2009
2010
|
});
|
|
2010
2011
|
return;
|
|
2011
2012
|
}
|
|
2012
2013
|
b.current && (d({
|
|
2013
2014
|
type: "openDialog"
|
|
2014
2015
|
}), Q(), b.current.value = null, b.current.click());
|
|
2015
|
-
}, [d, Q, C, na, sa, M, oa, r]),
|
|
2016
|
+
}, [d, Q, C, na, sa, M, oa, r]), Ga = j(function(p) {
|
|
2016
2017
|
!g.current || !g.current.isEqualNode(p.target) || (p.key === " " || p.key === "Enter" || p.keyCode === 32 || p.keyCode === 13) && (p.preventDefault(), W());
|
|
2017
|
-
}, [g, W]),
|
|
2018
|
+
}, [g, W]), Za = j(function() {
|
|
2018
2019
|
d({
|
|
2019
2020
|
type: "focus"
|
|
2020
2021
|
});
|
|
2021
|
-
}, []),
|
|
2022
|
+
}, []), Ja = j(function() {
|
|
2022
2023
|
d({
|
|
2023
2024
|
type: "blur"
|
|
2024
2025
|
});
|
|
2025
|
-
}, []),
|
|
2026
|
-
k || (
|
|
2026
|
+
}, []), Xa = j(function() {
|
|
2027
|
+
k || (gt() ? setTimeout(W, 0) : W());
|
|
2027
2028
|
}, [k, W]), U = function(c) {
|
|
2028
2029
|
return e ? null : c;
|
|
2029
2030
|
}, _a = function(c) {
|
|
@@ -2032,28 +2033,28 @@ function Ei() {
|
|
|
2032
2033
|
return K ? null : U(c);
|
|
2033
2034
|
}, ua = function(c) {
|
|
2034
2035
|
z && c.stopPropagation();
|
|
2035
|
-
},
|
|
2036
|
+
}, Fi = Y(function() {
|
|
2036
2037
|
return function() {
|
|
2037
|
-
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, u = c === void 0 ? "ref" : c, x = p.role, y = p.onKeyDown, ia = p.onFocus, B = p.onBlur, Ea = p.onClick, Aa = p.onDragEnter, Oa = p.onDragOver, va = p.onDragLeave, Fa = p.onDrop, Pa = ja(p,
|
|
2038
|
-
return m(m(
|
|
2039
|
-
onKeyDown: _a(O(y,
|
|
2040
|
-
onFocus: _a(O(ia,
|
|
2041
|
-
onBlur: _a(O(B,
|
|
2042
|
-
onClick: U(O(Ea,
|
|
2043
|
-
onDragEnter: ma(O(Aa,
|
|
2044
|
-
onDragOver: ma(O(Oa,
|
|
2045
|
-
onDragLeave: ma(O(va,
|
|
2038
|
+
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, u = c === void 0 ? "ref" : c, x = p.role, y = p.onKeyDown, ia = p.onFocus, B = p.onBlur, Ea = p.onClick, Aa = p.onDragEnter, Oa = p.onDragOver, va = p.onDragLeave, Fa = p.onDrop, Pa = ja(p, zt);
|
|
2039
|
+
return m(m($a({
|
|
2040
|
+
onKeyDown: _a(O(y, Ga)),
|
|
2041
|
+
onFocus: _a(O(ia, Za)),
|
|
2042
|
+
onBlur: _a(O(B, Ja)),
|
|
2043
|
+
onClick: U(O(Ea, Xa)),
|
|
2044
|
+
onDragEnter: ma(O(Aa, Ba)),
|
|
2045
|
+
onDragOver: ma(O(Oa, Ya)),
|
|
2046
|
+
onDragLeave: ma(O(va, Va)),
|
|
2046
2047
|
onDrop: ma(O(Fa, da)),
|
|
2047
2048
|
role: typeof x == "string" && x !== "" ? x : "presentation"
|
|
2048
2049
|
}, u, g), !e && !R ? {
|
|
2049
2050
|
tabIndex: 0
|
|
2050
2051
|
} : {}), Pa);
|
|
2051
2052
|
};
|
|
2052
|
-
}, [g,
|
|
2053
|
+
}, [g, Ga, Za, Ja, Xa, Ba, Ya, Va, da, R, K, e]), Pi = j(function(p) {
|
|
2053
2054
|
p.stopPropagation();
|
|
2054
|
-
}, []),
|
|
2055
|
+
}, []), Ii = Y(function() {
|
|
2055
2056
|
return function() {
|
|
2056
|
-
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, u = c === void 0 ? "ref" : c, x = p.onChange, y = p.onClick, ia = ja(p,
|
|
2057
|
+
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, u = c === void 0 ? "ref" : c, x = p.onChange, y = p.onClick, ia = ja(p, _t), B = $a({
|
|
2057
2058
|
accept: L,
|
|
2058
2059
|
multiple: r,
|
|
2059
2060
|
type: "file",
|
|
@@ -2070,7 +2071,7 @@ function Ei() {
|
|
|
2070
2071
|
whiteSpace: "nowrap"
|
|
2071
2072
|
},
|
|
2072
2073
|
onChange: U(O(x, da)),
|
|
2073
|
-
onClick: U(O(y,
|
|
2074
|
+
onClick: U(O(y, Pi)),
|
|
2074
2075
|
tabIndex: -1
|
|
2075
2076
|
}, u, b);
|
|
2076
2077
|
return m(m({}, B), ia);
|
|
@@ -2078,14 +2079,14 @@ function Ei() {
|
|
|
2078
2079
|
}, [b, t, r, da, e]);
|
|
2079
2080
|
return m(m({}, _), {}, {
|
|
2080
2081
|
isFocused: A && !e,
|
|
2081
|
-
getRootProps:
|
|
2082
|
-
getInputProps:
|
|
2082
|
+
getRootProps: Fi,
|
|
2083
|
+
getInputProps: Ii,
|
|
2083
2084
|
rootRef: g,
|
|
2084
2085
|
inputRef: b,
|
|
2085
2086
|
open: U(W)
|
|
2086
2087
|
});
|
|
2087
2088
|
}
|
|
2088
|
-
function
|
|
2089
|
+
function qt(a, i) {
|
|
2089
2090
|
switch (i.type) {
|
|
2090
2091
|
case "focus":
|
|
2091
2092
|
return m(m({}, a), {}, {
|
|
@@ -2121,11 +2122,11 @@ function Rt(a, i) {
|
|
|
2121
2122
|
return a;
|
|
2122
2123
|
}
|
|
2123
2124
|
}
|
|
2124
|
-
function
|
|
2125
|
+
function mi() {
|
|
2125
2126
|
}
|
|
2126
|
-
const
|
|
2127
|
-
root:
|
|
2128
|
-
disabled:
|
|
2127
|
+
const Tt = "_root_tju30_2", Lt = "_disabled_tju30_26", Ct = "_actions_tju30_65", za = {
|
|
2128
|
+
root: Tt,
|
|
2129
|
+
disabled: Lt,
|
|
2129
2130
|
"drag-reject": "_drag-reject_tju30_32",
|
|
2130
2131
|
"file-input": "_file-input_tju30_35",
|
|
2131
2132
|
"file-preview": "_file-preview_tju30_40",
|
|
@@ -2133,17 +2134,17 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2133
2134
|
"file-preview-name": "_file-preview-name_tju30_51",
|
|
2134
2135
|
"file-preview-size": "_file-preview-size_tju30_55",
|
|
2135
2136
|
"image-preview": "_image-preview_tju30_60",
|
|
2136
|
-
actions:
|
|
2137
|
+
actions: Ct,
|
|
2137
2138
|
"message-title": "_message-title_tju30_72",
|
|
2138
2139
|
"message-hint": "_message-hint_tju30_75",
|
|
2139
2140
|
"message-file-button-text": "_message-file-button-text_tju30_80"
|
|
2140
|
-
}, Ta = Da(za),
|
|
2141
|
+
}, Ta = Da(za), Ai = ({
|
|
2141
2142
|
file: a,
|
|
2142
2143
|
fileName: i,
|
|
2143
2144
|
forceFileType: t,
|
|
2144
2145
|
previewButtonText: e = "Preview"
|
|
2145
2146
|
}) => {
|
|
2146
|
-
const n = typeof a == "string", o =
|
|
2147
|
+
const n = typeof a == "string", o = Mi(a, t), l = a instanceof File ? Ni(a) : null, r = n && i ? i : xi(a);
|
|
2147
2148
|
return /* @__PURE__ */ V(vi, { children: [
|
|
2148
2149
|
/* @__PURE__ */ f(G, { className: Ta("file-preview-icon"), name: o, size: "xxl" }),
|
|
2149
2150
|
/* @__PURE__ */ f(ya, { as: "h4", className: Ta("file-preview-name"), lines: 1, variant: "heading-md-strong", children: r }),
|
|
@@ -2164,7 +2165,9 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2164
2165
|
}
|
|
2165
2166
|
) : null
|
|
2166
2167
|
] });
|
|
2167
|
-
}
|
|
2168
|
+
};
|
|
2169
|
+
Ai.displayName = "FileDrop.FilePreview";
|
|
2170
|
+
const La = Da(za), Ha = ({
|
|
2168
2171
|
disabled: a,
|
|
2169
2172
|
fileButtonText: i = "Browse file",
|
|
2170
2173
|
hint: t = "Drag & drop a file here or",
|
|
@@ -2183,7 +2186,9 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2183
2186
|
children: i
|
|
2184
2187
|
}
|
|
2185
2188
|
)
|
|
2186
|
-
] })
|
|
2189
|
+
] });
|
|
2190
|
+
Ha.displayName = "FileDrop.Message";
|
|
2191
|
+
const Mt = Da(za), Oi = ({
|
|
2187
2192
|
disabled: a,
|
|
2188
2193
|
error: i,
|
|
2189
2194
|
file: t,
|
|
@@ -2195,7 +2200,9 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2195
2200
|
isHoverReject: v,
|
|
2196
2201
|
openFile: w,
|
|
2197
2202
|
wordings: D
|
|
2198
|
-
}) => r ? /* @__PURE__ */ f(G, { name: "smile-beam-solid" }) : v ? /* @__PURE__ */ f(G, { name: "sad-solid" }) : i ? /* @__PURE__ */ f(
|
|
2203
|
+
}) => r ? /* @__PURE__ */ f(G, { name: "smile-beam-solid" }) : v ? /* @__PURE__ */ f(G, { name: "sad-solid" }) : i ? /* @__PURE__ */ f(Ha, { openFile: w, ...D }) : n ? l ? /* @__PURE__ */ f("img", { className: Mt("image-preview"), src: n }) : /* @__PURE__ */ f(Ai, { file: t, fileName: e, forceFileType: o, ...D }) : /* @__PURE__ */ f(Ha, { disabled: a, openFile: w, ...D });
|
|
2204
|
+
Oi.displayName = "FileDrop.Preview";
|
|
2205
|
+
const ui = /\.(jpeg|jpg|gif|png|webp)$/, Nt = (a) => a ? typeof a == "string" ? !!xi(a).match(ui) : a.name ? !!a.name.match(ui) : !1 : !1, $t = (a) => {
|
|
2199
2206
|
let i;
|
|
2200
2207
|
if (a instanceof File ? i = a.preview : i = a, typeof i != "string" || i.startsWith("blob:"))
|
|
2201
2208
|
return i;
|
|
@@ -2205,12 +2212,12 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2205
2212
|
} catch {
|
|
2206
2213
|
return;
|
|
2207
2214
|
}
|
|
2208
|
-
}, Kt = 2e6, Ht = "ERROR_INVALID_TYPE", Wt = "ERROR_INVALID_SIZE", ba = Da(za),
|
|
2215
|
+
}, Kt = 2e6, Ht = "ERROR_INVALID_TYPE", Wt = "ERROR_INVALID_SIZE", ba = Da(za), Ut = fi(
|
|
2209
2216
|
({
|
|
2210
2217
|
accept: a = {
|
|
2211
2218
|
"image/*": []
|
|
2212
2219
|
},
|
|
2213
|
-
children: i =
|
|
2220
|
+
children: i = Oi,
|
|
2214
2221
|
className: t,
|
|
2215
2222
|
disabled: e,
|
|
2216
2223
|
fileName: n,
|
|
@@ -2229,14 +2236,14 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2229
2236
|
wordings: na,
|
|
2230
2237
|
...pa
|
|
2231
2238
|
}, J) => {
|
|
2232
|
-
const [k, R] =
|
|
2239
|
+
const [k, R] = Qa(q), [K, z] = Qa(void 0);
|
|
2233
2240
|
ta(() => {
|
|
2234
2241
|
R(q);
|
|
2235
2242
|
}, [q]), ta(() => () => k && k instanceof File && URL.revokeObjectURL(k.preview), [k]);
|
|
2236
2243
|
const X = (_) => {
|
|
2237
2244
|
const [d] = _;
|
|
2238
2245
|
d instanceof File && (d.preview = URL.createObjectURL(d)), R(d), z(null);
|
|
2239
|
-
const A =
|
|
2246
|
+
const A = ai({ name: F, value: d });
|
|
2240
2247
|
h == null || h(A), l == null || l(A);
|
|
2241
2248
|
}, T = (_, d) => {
|
|
2242
2249
|
let A;
|
|
@@ -2248,7 +2255,7 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2248
2255
|
}), R(null), z(A), E == null || E(A), h == null || h(d), P == null || P();
|
|
2249
2256
|
}, L = (_) => {
|
|
2250
2257
|
_.preventDefault(), R(null), z(null);
|
|
2251
|
-
const d =
|
|
2258
|
+
const d = ai({ name: F, value: null });
|
|
2252
2259
|
h == null || h(d), r == null || r(d);
|
|
2253
2260
|
}, { getInputProps: oa, getRootProps: Q, isDragAccept: C, isDragActive: g, isDragReject: b, open: ca } = Ei({
|
|
2254
2261
|
accept: a,
|
|
@@ -2288,9 +2295,9 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2288
2295
|
error: K,
|
|
2289
2296
|
file: k,
|
|
2290
2297
|
fileName: n,
|
|
2291
|
-
fileUrl: k &&
|
|
2298
|
+
fileUrl: k && $t(k),
|
|
2292
2299
|
forceFileType: o,
|
|
2293
|
-
isAnImage: o === "image" ||
|
|
2300
|
+
isAnImage: o === "image" || Nt(k),
|
|
2294
2301
|
isHoverAccept: C,
|
|
2295
2302
|
isHoverReject: b,
|
|
2296
2303
|
openFile: ca,
|
|
@@ -2315,6 +2322,7 @@ const St = "_root_tju30_2", qt = "_disabled_tju30_26", Tt = "_actions_tju30_65",
|
|
|
2315
2322
|
);
|
|
2316
2323
|
}
|
|
2317
2324
|
);
|
|
2325
|
+
Ut.displayName = "FileDrop";
|
|
2318
2326
|
export {
|
|
2319
|
-
|
|
2327
|
+
Ut as FileDrop
|
|
2320
2328
|
};
|