@cfx-dev/ui-components 4.5.1 → 4.5.3
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/assets/all_css.css +2 -0
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/StyledInput.css +1 -0
- package/dist/assets/css/StyledTextarea.css +1 -0
- package/dist/assets/css/Textarea.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.js +139 -129
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +2 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +53 -44
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +13 -12
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Input.js +94 -89
- package/dist/components/Input/Input.types.d.ts +2 -0
- package/dist/components/Input/Input.types.js +1 -0
- package/dist/components/Input/RichInput.d.ts +1 -1
- package/dist/components/Input/index.d.ts +2 -1
- package/dist/components/InputDropzone/InputDropzone.d.ts +1 -0
- package/dist/components/InputDropzone/InputDropzone.js +135 -134
- package/dist/components/InputDropzone/InputDropzoneShowcase.js +6 -5
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/Radio/Radio.js +21 -19
- package/dist/components/StyledInput/StyledInput.d.ts +12 -0
- package/dist/components/StyledInput/StyledInput.js +46 -0
- package/dist/components/StyledInput/index.d.ts +2 -0
- package/dist/components/StyledInput/index.js +4 -0
- package/dist/components/StyledTextarea/StyledTextarea.d.ts +10 -0
- package/dist/components/StyledTextarea/StyledTextarea.js +32 -0
- package/dist/components/StyledTextarea/index.d.ts +2 -0
- package/dist/components/StyledTextarea/index.js +4 -0
- package/dist/components/Switch/Switch.js +61 -49
- package/dist/components/Tabular/Tabular.d.ts +12 -0
- package/dist/components/Tabular/Tabular.js +34 -33
- package/dist/components/Tabular/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -3
- package/dist/components/Textarea/Textarea.js +46 -43
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +57 -47
- package/dist/main.d.ts +5 -1
- package/dist/main.js +126 -122
- package/dist/rsc.d.ts +4 -0
- package/dist/rsc.js +12 -8
- package/dist/styles-scss/global.scss +1 -1
- package/dist/styles-scss/tokens.scss +19 -20
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as wa, jsx as
|
|
2
|
-
import oa, { useMemo as
|
|
1
|
+
import { jsxs as wa, jsx as B } from "react/jsx-runtime";
|
|
2
|
+
import oa, { useMemo as T, useRef as ea, useReducer as hi, useEffect as ka, useCallback as y, forwardRef as yi, useImperativeHandle as wi, Fragment as ki } from "react";
|
|
3
3
|
import { P as s } from "../../index-DQMInta3.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as I } from "../../tslib.es6-CtHwNPxX.js";
|
|
5
5
|
import { IconBig as ji } from "../IconBig/IconBig.js";
|
|
6
6
|
import { Text as Na } from "../Text/Text.js";
|
|
7
7
|
import { clsx as Di } from "../../utils/clsx.js";
|
|
@@ -1209,7 +1209,7 @@ const zi = /* @__PURE__ */ new Map([
|
|
|
1209
1209
|
["zmm", "application/vnd.handheld-entertainment+xml"],
|
|
1210
1210
|
["zsh", "text/x-scriptzsh"]
|
|
1211
1211
|
]);
|
|
1212
|
-
function
|
|
1212
|
+
function L(a, i, t) {
|
|
1213
1213
|
const n = Ai(a), { webkitRelativePath: p } = a, o = typeof i == "string" ? i : typeof p == "string" && p.length > 0 ? p : `./${a.name}`;
|
|
1214
1214
|
return typeof n.path != "string" && Ba(n, "path", o), Ba(n, "relativePath", o), n;
|
|
1215
1215
|
}
|
|
@@ -1242,7 +1242,7 @@ const _i = [
|
|
|
1242
1242
|
// Windows
|
|
1243
1243
|
];
|
|
1244
1244
|
function Ei(a) {
|
|
1245
|
-
return
|
|
1245
|
+
return I(this, void 0, void 0, function* () {
|
|
1246
1246
|
return ca(a) && Fi(a.dataTransfer) ? Ri(a.dataTransfer, a.type) : Oi(a) ? Pi(a) : Array.isArray(a) && a.every((i) => "getFile" in i && typeof i.getFile == "function") ? Ii(a) : [];
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
@@ -1256,15 +1256,15 @@ function ca(a) {
|
|
|
1256
1256
|
return typeof a == "object" && a !== null;
|
|
1257
1257
|
}
|
|
1258
1258
|
function Pi(a) {
|
|
1259
|
-
return za(a.target.files).map((i) =>
|
|
1259
|
+
return za(a.target.files).map((i) => L(i));
|
|
1260
1260
|
}
|
|
1261
1261
|
function Ii(a) {
|
|
1262
|
-
return
|
|
1263
|
-
return (yield Promise.all(a.map((t) => t.getFile()))).map((t) =>
|
|
1262
|
+
return I(this, void 0, void 0, function* () {
|
|
1263
|
+
return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => L(t));
|
|
1264
1264
|
});
|
|
1265
1265
|
}
|
|
1266
1266
|
function Ri(a, i) {
|
|
1267
|
-
return
|
|
1267
|
+
return I(this, void 0, void 0, function* () {
|
|
1268
1268
|
if (a.items) {
|
|
1269
1269
|
const t = za(a.items).filter((p) => p.kind === "file");
|
|
1270
1270
|
if (i !== "drop")
|
|
@@ -1272,7 +1272,7 @@ function Ri(a, i) {
|
|
|
1272
1272
|
const n = yield Promise.all(t.map(qi));
|
|
1273
1273
|
return Ua(ti(n));
|
|
1274
1274
|
}
|
|
1275
|
-
return Ua(za(a.files).map((t) =>
|
|
1275
|
+
return Ua(za(a.files).map((t) => L(t)));
|
|
1276
1276
|
});
|
|
1277
1277
|
}
|
|
1278
1278
|
function Ua(a) {
|
|
@@ -1301,7 +1301,7 @@ function ti(a) {
|
|
|
1301
1301
|
], []);
|
|
1302
1302
|
}
|
|
1303
1303
|
function Ya(a, i) {
|
|
1304
|
-
return
|
|
1304
|
+
return I(this, void 0, void 0, function* () {
|
|
1305
1305
|
var t;
|
|
1306
1306
|
if (globalThis.isSecureContext && typeof a.getAsFileSystemHandle == "function") {
|
|
1307
1307
|
const o = yield a.getAsFileSystemHandle();
|
|
@@ -1309,17 +1309,17 @@ function Ya(a, i) {
|
|
|
1309
1309
|
throw new Error(`${a} is not a File`);
|
|
1310
1310
|
if (o !== void 0) {
|
|
1311
1311
|
const l = yield o.getFile();
|
|
1312
|
-
return l.handle = o,
|
|
1312
|
+
return l.handle = o, L(l);
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
const n = a.getAsFile();
|
|
1316
1316
|
if (!n)
|
|
1317
1317
|
throw new Error(`${a} is not a File`);
|
|
1318
|
-
return
|
|
1318
|
+
return L(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
|
|
1319
1319
|
});
|
|
1320
1320
|
}
|
|
1321
1321
|
function Ci(a) {
|
|
1322
|
-
return
|
|
1322
|
+
return I(this, void 0, void 0, function* () {
|
|
1323
1323
|
return a.isDirectory ? ni(a) : Si(a);
|
|
1324
1324
|
});
|
|
1325
1325
|
}
|
|
@@ -1328,7 +1328,7 @@ function ni(a) {
|
|
|
1328
1328
|
return new Promise((t, n) => {
|
|
1329
1329
|
const p = [];
|
|
1330
1330
|
function o() {
|
|
1331
|
-
i.readEntries((l) =>
|
|
1331
|
+
i.readEntries((l) => I(this, void 0, void 0, function* () {
|
|
1332
1332
|
if (l.length) {
|
|
1333
1333
|
const r = Promise.all(l.map(Ci));
|
|
1334
1334
|
p.push(r), o();
|
|
@@ -1347,10 +1347,10 @@ function ni(a) {
|
|
|
1347
1347
|
});
|
|
1348
1348
|
}
|
|
1349
1349
|
function Si(a) {
|
|
1350
|
-
return
|
|
1350
|
+
return I(this, void 0, void 0, function* () {
|
|
1351
1351
|
return new Promise((i, t) => {
|
|
1352
1352
|
a.file((n) => {
|
|
1353
|
-
const p =
|
|
1353
|
+
const p = L(n, a.fullPath);
|
|
1354
1354
|
i(p);
|
|
1355
1355
|
}, (n) => {
|
|
1356
1356
|
t(n);
|
|
@@ -1408,7 +1408,7 @@ function Va(a) {
|
|
|
1408
1408
|
function ei(a, i, t) {
|
|
1409
1409
|
return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function U(a, i) {
|
|
1412
1412
|
return Hi(a) || Ki(a, i) || pi(a, i) || $i();
|
|
1413
1413
|
}
|
|
1414
1414
|
function $i() {
|
|
@@ -1476,24 +1476,24 @@ function oi(a, i) {
|
|
|
1476
1476
|
return [t, t ? null : Gi(i)];
|
|
1477
1477
|
}
|
|
1478
1478
|
function ci(a, i, t) {
|
|
1479
|
-
if (
|
|
1480
|
-
if (
|
|
1479
|
+
if (P(a.size))
|
|
1480
|
+
if (P(i) && P(t)) {
|
|
1481
1481
|
if (a.size > t) return [!1, Qa(t)];
|
|
1482
1482
|
if (a.size < i) return [!1, Xa(i)];
|
|
1483
1483
|
} else {
|
|
1484
|
-
if (
|
|
1485
|
-
if (
|
|
1484
|
+
if (P(i) && a.size < i) return [!1, Xa(i)];
|
|
1485
|
+
if (P(t) && a.size > t) return [!1, Qa(t)];
|
|
1486
1486
|
}
|
|
1487
1487
|
return [!0, null];
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function P(a) {
|
|
1490
1490
|
return a != null;
|
|
1491
1491
|
}
|
|
1492
1492
|
function Vi(a) {
|
|
1493
1493
|
var i = a.files, t = a.accept, n = a.minSize, p = a.maxSize, o = a.multiple, l = a.maxFiles, r = a.validator;
|
|
1494
1494
|
return !o && i.length > 1 || o && l >= 1 && i.length > l ? !1 : i.every(function(u) {
|
|
1495
|
-
var k = oi(u, t), z =
|
|
1496
|
-
return
|
|
1495
|
+
var k = oi(u, t), z = U(k, 1), A = z[0], j = ci(u, n, p), _ = U(j, 1), E = _[0], F = r ? r(u) : null;
|
|
1496
|
+
return A && E && !F;
|
|
1497
1497
|
});
|
|
1498
1498
|
}
|
|
1499
1499
|
function la(a) {
|
|
@@ -1532,12 +1532,12 @@ function at() {
|
|
|
1532
1532
|
return "showOpenFilePicker" in window;
|
|
1533
1533
|
}
|
|
1534
1534
|
function it(a) {
|
|
1535
|
-
if (
|
|
1535
|
+
if (P(a)) {
|
|
1536
1536
|
var i = Object.entries(a).filter(function(t) {
|
|
1537
|
-
var n =
|
|
1537
|
+
var n = U(t, 2), p = n[0], o = n[1], l = !0;
|
|
1538
1538
|
return li(p) || (console.warn('Skipped "'.concat(p, '" 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(ri)) && (console.warn('Skipped "'.concat(p, '" because an invalid file extension was provided.')), l = !1), l;
|
|
1539
1539
|
}).reduce(function(t, n) {
|
|
1540
|
-
var p =
|
|
1540
|
+
var p = U(n, 2), o = p[0], l = p[1];
|
|
1541
1541
|
return Va(Va({}, t), {}, ei({}, o, l));
|
|
1542
1542
|
}, {});
|
|
1543
1543
|
return [{
|
|
@@ -1549,9 +1549,9 @@ function it(a) {
|
|
|
1549
1549
|
return a;
|
|
1550
1550
|
}
|
|
1551
1551
|
function tt(a) {
|
|
1552
|
-
if (
|
|
1552
|
+
if (P(a))
|
|
1553
1553
|
return Object.entries(a).reduce(function(i, t) {
|
|
1554
|
-
var n =
|
|
1554
|
+
var n = U(t, 2), p = n[0], o = n[1];
|
|
1555
1555
|
return [].concat(Ga(i), [p], Ga(o));
|
|
1556
1556
|
}, []).filter(function(i) {
|
|
1557
1557
|
return li(i) || ri(i);
|
|
@@ -1873,19 +1873,19 @@ var Fa = {
|
|
|
1873
1873
|
fileRejections: []
|
|
1874
1874
|
};
|
|
1875
1875
|
function mi() {
|
|
1876
|
-
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = d(d({}, di), a), t = i.accept, n = i.disabled, p = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, u = i.maxFiles, k = i.onDragEnter, z = i.onDragLeave,
|
|
1876
|
+
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = d(d({}, di), a), t = i.accept, n = i.disabled, p = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, u = i.maxFiles, k = i.onDragEnter, z = i.onDragLeave, A = i.onDragOver, j = i.onDrop, _ = i.onDropAccepted, E = i.onDropRejected, F = i.onFileDialogCancel, M = i.onFileDialogOpen, Y = i.useFsAccessApi, G = i.autoFocus, $ = i.preventDropOnDocument, J = i.noClick, K = i.noKeyboard, V = i.noDrag, f = i.noDragEventsBubbling, sa = i.onError, H = i.validator, N = T(function() {
|
|
1877
1877
|
return tt(t);
|
|
1878
|
-
}, [t]), Pa =
|
|
1878
|
+
}, [t]), Pa = T(function() {
|
|
1879
1879
|
return it(t);
|
|
1880
|
-
}, [t]), da =
|
|
1881
|
-
return typeof
|
|
1882
|
-
}, [
|
|
1880
|
+
}, [t]), da = T(function() {
|
|
1881
|
+
return typeof M == "function" ? M : ii;
|
|
1882
|
+
}, [M]), Q = T(function() {
|
|
1883
1883
|
return typeof F == "function" ? F : ii;
|
|
1884
|
-
}, [F]),
|
|
1884
|
+
}, [F]), x = ea(null), h = ea(null), vi = hi(gt, Fa), Ia = Da(vi, 2), ma = Ia[0], g = Ia[1], ui = ma.isFocused, Ra = ma.isFileDialogActive, X = ea(typeof window < "u" && window.isSecureContext && Y && at()), qa = function() {
|
|
1885
1885
|
!X.current && Ra && setTimeout(function() {
|
|
1886
1886
|
if (h.current) {
|
|
1887
1887
|
var c = h.current.files;
|
|
1888
|
-
c.length || (
|
|
1888
|
+
c.length || (g({
|
|
1889
1889
|
type: "closeDialog"
|
|
1890
1890
|
}), Q());
|
|
1891
1891
|
}
|
|
@@ -1896,42 +1896,42 @@ function mi() {
|
|
|
1896
1896
|
window.removeEventListener("focus", qa, !1);
|
|
1897
1897
|
};
|
|
1898
1898
|
}, [h, Ra, Q, X]);
|
|
1899
|
-
var
|
|
1900
|
-
|
|
1899
|
+
var R = ea([]), Ca = function(c) {
|
|
1900
|
+
x.current && x.current.contains(c.target) || (c.preventDefault(), R.current = []);
|
|
1901
1901
|
};
|
|
1902
1902
|
ka(function() {
|
|
1903
|
-
return
|
|
1904
|
-
|
|
1903
|
+
return $ && (document.addEventListener("dragover", Za, !1), document.addEventListener("drop", Ca, !1)), function() {
|
|
1904
|
+
$ && (document.removeEventListener("dragover", Za), document.removeEventListener("drop", Ca));
|
|
1905
1905
|
};
|
|
1906
|
-
}, [
|
|
1907
|
-
return !n &&
|
|
1906
|
+
}, [x, $]), ka(function() {
|
|
1907
|
+
return !n && G && x.current && x.current.focus(), function() {
|
|
1908
1908
|
};
|
|
1909
|
-
}, [
|
|
1910
|
-
var
|
|
1909
|
+
}, [x, G, n]);
|
|
1910
|
+
var O = y(function(e) {
|
|
1911
1911
|
sa ? sa(e) : console.error(e);
|
|
1912
1912
|
}, [sa]), Sa = y(function(e) {
|
|
1913
|
-
e.preventDefault(), e.persist(), ta(e),
|
|
1914
|
-
if (!(la(e) && !
|
|
1913
|
+
e.preventDefault(), e.persist(), ta(e), R.current = [].concat(rt(R.current), [e.target]), pa(e) && Promise.resolve(p(e)).then(function(c) {
|
|
1914
|
+
if (!(la(e) && !f)) {
|
|
1915
1915
|
var m = c.length, v = m > 0 && Vi({
|
|
1916
1916
|
files: c,
|
|
1917
|
-
accept:
|
|
1917
|
+
accept: N,
|
|
1918
1918
|
minSize: l,
|
|
1919
1919
|
maxSize: o,
|
|
1920
1920
|
multiple: r,
|
|
1921
1921
|
maxFiles: u,
|
|
1922
|
-
validator:
|
|
1923
|
-
}),
|
|
1924
|
-
|
|
1922
|
+
validator: H
|
|
1923
|
+
}), b = m > 0 && !v;
|
|
1924
|
+
g({
|
|
1925
1925
|
isDragAccept: v,
|
|
1926
|
-
isDragReject:
|
|
1926
|
+
isDragReject: b,
|
|
1927
1927
|
isDragActive: !0,
|
|
1928
1928
|
type: "setDraggedFiles"
|
|
1929
1929
|
}), k && k(e);
|
|
1930
1930
|
}
|
|
1931
1931
|
}).catch(function(c) {
|
|
1932
|
-
return
|
|
1932
|
+
return O(c);
|
|
1933
1933
|
});
|
|
1934
|
-
}, [p, k,
|
|
1934
|
+
}, [p, k, O, f, N, l, o, r, u, H]), Ta = y(function(e) {
|
|
1935
1935
|
e.preventDefault(), e.persist(), ta(e);
|
|
1936
1936
|
var c = pa(e);
|
|
1937
1937
|
if (c && e.dataTransfer)
|
|
@@ -1939,55 +1939,55 @@ function mi() {
|
|
|
1939
1939
|
e.dataTransfer.dropEffect = "copy";
|
|
1940
1940
|
} catch {
|
|
1941
1941
|
}
|
|
1942
|
-
return c &&
|
|
1943
|
-
}, [
|
|
1942
|
+
return c && A && A(e), !1;
|
|
1943
|
+
}, [A, f]), La = y(function(e) {
|
|
1944
1944
|
e.preventDefault(), e.persist(), ta(e);
|
|
1945
|
-
var c =
|
|
1946
|
-
return
|
|
1945
|
+
var c = R.current.filter(function(v) {
|
|
1946
|
+
return x.current && x.current.contains(v);
|
|
1947
1947
|
}), m = c.indexOf(e.target);
|
|
1948
|
-
m !== -1 && c.splice(m, 1),
|
|
1948
|
+
m !== -1 && c.splice(m, 1), R.current = c, !(c.length > 0) && (g({
|
|
1949
1949
|
type: "setDraggedFiles",
|
|
1950
1950
|
isDragActive: !1,
|
|
1951
1951
|
isDragAccept: !1,
|
|
1952
1952
|
isDragReject: !1
|
|
1953
1953
|
}), pa(e) && z && z(e));
|
|
1954
|
-
}, [
|
|
1954
|
+
}, [x, z, f]), Z = y(function(e, c) {
|
|
1955
1955
|
var m = [], v = [];
|
|
1956
|
-
e.forEach(function(
|
|
1957
|
-
var
|
|
1956
|
+
e.forEach(function(b) {
|
|
1957
|
+
var W = oi(b, N), S = Da(W, 2), ua = S[0], fa = S[1], xa = ci(b, l, o), na = Da(xa, 2), ga = na[0], ba = na[1], ha = H ? H(b) : null;
|
|
1958
1958
|
if (ua && ga && !ha)
|
|
1959
|
-
m.push(
|
|
1959
|
+
m.push(b);
|
|
1960
1960
|
else {
|
|
1961
1961
|
var ya = [fa, ba];
|
|
1962
1962
|
ha && (ya = ya.concat(ha)), v.push({
|
|
1963
|
-
file:
|
|
1963
|
+
file: b,
|
|
1964
1964
|
errors: ya.filter(function(bi) {
|
|
1965
1965
|
return bi;
|
|
1966
1966
|
})
|
|
1967
1967
|
});
|
|
1968
1968
|
}
|
|
1969
|
-
}), (!r && m.length > 1 || r && u >= 1 && m.length > u) && (m.forEach(function(
|
|
1969
|
+
}), (!r && m.length > 1 || r && u >= 1 && m.length > u) && (m.forEach(function(b) {
|
|
1970
1970
|
v.push({
|
|
1971
|
-
file:
|
|
1971
|
+
file: b,
|
|
1972
1972
|
errors: [Ji]
|
|
1973
1973
|
});
|
|
1974
|
-
}), m.splice(0)),
|
|
1974
|
+
}), m.splice(0)), g({
|
|
1975
1975
|
acceptedFiles: m,
|
|
1976
1976
|
fileRejections: v,
|
|
1977
1977
|
isDragReject: v.length > 0,
|
|
1978
1978
|
type: "setFiles"
|
|
1979
|
-
}),
|
|
1980
|
-
}, [
|
|
1981
|
-
e.preventDefault(), e.persist(), ta(e),
|
|
1982
|
-
la(e) && !
|
|
1979
|
+
}), j && j(m, v, c), v.length > 0 && E && E(v, c), m.length > 0 && _ && _(m, c);
|
|
1980
|
+
}, [g, r, N, l, o, u, j, _, E, H]), aa = y(function(e) {
|
|
1981
|
+
e.preventDefault(), e.persist(), ta(e), R.current = [], pa(e) && Promise.resolve(p(e)).then(function(c) {
|
|
1982
|
+
la(e) && !f || Z(c, e);
|
|
1983
1983
|
}).catch(function(c) {
|
|
1984
|
-
return
|
|
1985
|
-
}),
|
|
1984
|
+
return O(c);
|
|
1985
|
+
}), g({
|
|
1986
1986
|
type: "reset"
|
|
1987
1987
|
});
|
|
1988
|
-
}, [p, Z,
|
|
1988
|
+
}, [p, Z, O, f]), q = y(function() {
|
|
1989
1989
|
if (X.current) {
|
|
1990
|
-
|
|
1990
|
+
g({
|
|
1991
1991
|
type: "openDialog"
|
|
1992
1992
|
}), da();
|
|
1993
1993
|
var e = {
|
|
@@ -1997,62 +1997,62 @@ function mi() {
|
|
|
1997
1997
|
window.showOpenFilePicker(e).then(function(c) {
|
|
1998
1998
|
return p(c);
|
|
1999
1999
|
}).then(function(c) {
|
|
2000
|
-
Z(c, null),
|
|
2000
|
+
Z(c, null), g({
|
|
2001
2001
|
type: "closeDialog"
|
|
2002
2002
|
});
|
|
2003
2003
|
}).catch(function(c) {
|
|
2004
|
-
nt(c) ? (Q(c),
|
|
2004
|
+
nt(c) ? (Q(c), g({
|
|
2005
2005
|
type: "closeDialog"
|
|
2006
|
-
})) : et(c) ? (X.current = !1, h.current ? (h.current.value = null, h.current.click()) :
|
|
2006
|
+
})) : et(c) ? (X.current = !1, h.current ? (h.current.value = null, h.current.click()) : O(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."))) : O(c);
|
|
2007
2007
|
});
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
|
-
h.current && (
|
|
2010
|
+
h.current && (g({
|
|
2011
2011
|
type: "openDialog"
|
|
2012
2012
|
}), da(), h.current.value = null, h.current.click());
|
|
2013
|
-
}, [
|
|
2014
|
-
!
|
|
2015
|
-
}, [
|
|
2016
|
-
|
|
2013
|
+
}, [g, da, Q, Y, Z, O, Pa, r]), Ma = y(function(e) {
|
|
2014
|
+
!x.current || !x.current.isEqualNode(e.target) || (e.key === " " || e.key === "Enter" || e.keyCode === 32 || e.keyCode === 13) && (e.preventDefault(), q());
|
|
2015
|
+
}, [x, q]), $a = y(function() {
|
|
2016
|
+
g({
|
|
2017
2017
|
type: "focus"
|
|
2018
2018
|
});
|
|
2019
2019
|
}, []), Ka = y(function() {
|
|
2020
|
-
|
|
2020
|
+
g({
|
|
2021
2021
|
type: "blur"
|
|
2022
2022
|
});
|
|
2023
2023
|
}, []), Ha = y(function() {
|
|
2024
|
-
|
|
2025
|
-
}, [
|
|
2024
|
+
J || (Zi() ? setTimeout(q, 0) : q());
|
|
2025
|
+
}, [J, q]), C = function(c) {
|
|
2026
2026
|
return n ? null : c;
|
|
2027
2027
|
}, va = function(c) {
|
|
2028
|
-
return
|
|
2028
|
+
return K ? null : C(c);
|
|
2029
2029
|
}, ia = function(c) {
|
|
2030
|
-
return
|
|
2030
|
+
return V ? null : C(c);
|
|
2031
2031
|
}, ta = function(c) {
|
|
2032
|
-
|
|
2033
|
-
}, fi =
|
|
2032
|
+
f && c.stopPropagation();
|
|
2033
|
+
}, fi = T(function() {
|
|
2034
2034
|
return function() {
|
|
2035
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.role,
|
|
2035
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.role, b = e.onKeyDown, W = e.onFocus, S = e.onBlur, ua = e.onClick, fa = e.onDragEnter, xa = e.onDragOver, na = e.onDragLeave, ga = e.onDrop, ba = ra(e, ct);
|
|
2036
2036
|
return d(d(Ea({
|
|
2037
|
-
onKeyDown: va(w(
|
|
2038
|
-
onFocus: va(w(
|
|
2039
|
-
onBlur: va(w(
|
|
2040
|
-
onClick:
|
|
2037
|
+
onKeyDown: va(w(b, Ma)),
|
|
2038
|
+
onFocus: va(w(W, $a)),
|
|
2039
|
+
onBlur: va(w(S, Ka)),
|
|
2040
|
+
onClick: C(w(ua, Ha)),
|
|
2041
2041
|
onDragEnter: ia(w(fa, Sa)),
|
|
2042
2042
|
onDragOver: ia(w(xa, Ta)),
|
|
2043
2043
|
onDragLeave: ia(w(na, La)),
|
|
2044
2044
|
onDrop: ia(w(ga, aa)),
|
|
2045
2045
|
role: typeof v == "string" && v !== "" ? v : "presentation"
|
|
2046
|
-
}, m,
|
|
2046
|
+
}, m, x), !n && !K ? {
|
|
2047
2047
|
tabIndex: 0
|
|
2048
2048
|
} : {}), ba);
|
|
2049
2049
|
};
|
|
2050
|
-
}, [
|
|
2050
|
+
}, [x, Ma, $a, Ka, Ha, Sa, Ta, La, aa, K, V, n]), xi = y(function(e) {
|
|
2051
2051
|
e.stopPropagation();
|
|
2052
|
-
}, []), gi =
|
|
2052
|
+
}, []), gi = T(function() {
|
|
2053
2053
|
return function() {
|
|
2054
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.onChange,
|
|
2055
|
-
accept:
|
|
2054
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.onChange, b = e.onClick, W = ra(e, lt), S = Ea({
|
|
2055
|
+
accept: N,
|
|
2056
2056
|
multiple: r,
|
|
2057
2057
|
type: "file",
|
|
2058
2058
|
style: {
|
|
@@ -2067,20 +2067,20 @@ function mi() {
|
|
|
2067
2067
|
width: "1px",
|
|
2068
2068
|
whiteSpace: "nowrap"
|
|
2069
2069
|
},
|
|
2070
|
-
onChange:
|
|
2071
|
-
onClick:
|
|
2070
|
+
onChange: C(w(v, aa)),
|
|
2071
|
+
onClick: C(w(b, xi)),
|
|
2072
2072
|
tabIndex: -1
|
|
2073
2073
|
}, m, h);
|
|
2074
|
-
return d(d({},
|
|
2074
|
+
return d(d({}, S), W);
|
|
2075
2075
|
};
|
|
2076
2076
|
}, [h, t, r, aa, n]);
|
|
2077
2077
|
return d(d({}, ma), {}, {
|
|
2078
2078
|
isFocused: ui && !n,
|
|
2079
2079
|
getRootProps: fi,
|
|
2080
2080
|
getInputProps: gi,
|
|
2081
|
-
rootRef:
|
|
2081
|
+
rootRef: x,
|
|
2082
2082
|
inputRef: h,
|
|
2083
|
-
open:
|
|
2083
|
+
open: C(q)
|
|
2084
2084
|
});
|
|
2085
2085
|
}
|
|
2086
2086
|
function gt(a, i) {
|
|
@@ -2140,41 +2140,42 @@ function jt(a) {
|
|
|
2140
2140
|
onRemoveRejection: u,
|
|
2141
2141
|
dropzoneItemClassName: k,
|
|
2142
2142
|
dropzoneClassName: z,
|
|
2143
|
+
name: A,
|
|
2143
2144
|
...j
|
|
2144
2145
|
} = a, {
|
|
2145
|
-
isFocused:
|
|
2146
|
-
isDragActive:
|
|
2147
|
-
isDragAccept:
|
|
2148
|
-
isDragReject:
|
|
2149
|
-
isFileDialogActive:
|
|
2146
|
+
isFocused: _,
|
|
2147
|
+
isDragActive: E,
|
|
2148
|
+
isDragAccept: F,
|
|
2149
|
+
isDragReject: M,
|
|
2150
|
+
isFileDialogActive: Y,
|
|
2150
2151
|
getRootProps: G,
|
|
2151
|
-
getInputProps:
|
|
2152
|
-
} = mi(j),
|
|
2153
|
-
r && r(
|
|
2154
|
-
}, [r]),
|
|
2155
|
-
u && u(
|
|
2156
|
-
}, [u]),
|
|
2152
|
+
getInputProps: $
|
|
2153
|
+
} = mi(j), J = oa.useCallback((f) => {
|
|
2154
|
+
r && r(f);
|
|
2155
|
+
}, [r]), K = oa.useCallback((f) => {
|
|
2156
|
+
u && u(f);
|
|
2157
|
+
}, [u]), V = Di(D.dropzone, z, {
|
|
2157
2158
|
[D.disabled]: j.disabled,
|
|
2158
|
-
[D.focused]:
|
|
2159
|
-
[D.dragActive]:
|
|
2160
|
-
[D.dragAccept]:
|
|
2161
|
-
[D.dragReject]:
|
|
2162
|
-
[D.fileDialogActive]:
|
|
2159
|
+
[D.focused]: _,
|
|
2160
|
+
[D.dragActive]: E,
|
|
2161
|
+
[D.dragAccept]: F,
|
|
2162
|
+
[D.dragReject]: M,
|
|
2163
|
+
[D.fileDialogActive]: Y
|
|
2163
2164
|
});
|
|
2164
2165
|
return /* @__PURE__ */ wa("section", { children: [
|
|
2165
2166
|
/* @__PURE__ */ wa(
|
|
2166
2167
|
"div",
|
|
2167
2168
|
{
|
|
2168
|
-
className:
|
|
2169
|
+
className: V,
|
|
2169
2170
|
...G({
|
|
2170
2171
|
"aria-label": l
|
|
2171
2172
|
}),
|
|
2172
2173
|
children: [
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ B("input", { ...$({ name: A }) }),
|
|
2175
|
+
/* @__PURE__ */ B(ji, { name: "Upload" }),
|
|
2175
2176
|
/* @__PURE__ */ wa(Na, { className: D.text, children: [
|
|
2176
2177
|
p ? `${n} ` : n,
|
|
2177
|
-
!!p && /* @__PURE__ */
|
|
2178
|
+
!!p && /* @__PURE__ */ B(
|
|
2178
2179
|
Na,
|
|
2179
2180
|
{
|
|
2180
2181
|
weight: "bold",
|
|
@@ -2187,28 +2188,28 @@ function jt(a) {
|
|
|
2187
2188
|
]
|
|
2188
2189
|
}
|
|
2189
2190
|
),
|
|
2190
|
-
i.map((
|
|
2191
|
+
i.map((f) => /* @__PURE__ */ B(
|
|
2191
2192
|
Wa,
|
|
2192
2193
|
{
|
|
2193
2194
|
removeAriaLabel: o,
|
|
2194
|
-
file:
|
|
2195
|
-
onRemoveFile:
|
|
2195
|
+
file: f,
|
|
2196
|
+
onRemoveFile: J,
|
|
2196
2197
|
className: k
|
|
2197
2198
|
},
|
|
2198
|
-
|
|
2199
|
+
f.path
|
|
2199
2200
|
)),
|
|
2200
2201
|
t.map(({
|
|
2201
|
-
file:
|
|
2202
|
-
}) => /* @__PURE__ */
|
|
2202
|
+
file: f
|
|
2203
|
+
}) => /* @__PURE__ */ B(
|
|
2203
2204
|
Wa,
|
|
2204
2205
|
{
|
|
2205
2206
|
theme: "failed",
|
|
2206
2207
|
removeAriaLabel: o,
|
|
2207
|
-
file:
|
|
2208
|
-
onRemoveFile:
|
|
2208
|
+
file: f,
|
|
2209
|
+
onRemoveFile: K,
|
|
2209
2210
|
className: k
|
|
2210
2211
|
},
|
|
2211
|
-
|
|
2212
|
+
f.path
|
|
2212
2213
|
))
|
|
2213
2214
|
] });
|
|
2214
2215
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import n from "react";
|
|
3
3
|
import d from "./InputDropzone.js";
|
|
4
4
|
function R() {
|
|
5
|
-
const [
|
|
5
|
+
const [a, i] = n.useState([]), [l, c] = n.useState([]), r = n.useCallback((o, t) => {
|
|
6
6
|
i(o), c(t);
|
|
7
7
|
}, []), p = n.useCallback((o) => {
|
|
8
8
|
i((t) => {
|
|
@@ -18,8 +18,9 @@ function R() {
|
|
|
18
18
|
return /* @__PURE__ */ m(
|
|
19
19
|
d,
|
|
20
20
|
{
|
|
21
|
-
value:
|
|
22
|
-
rejections:
|
|
21
|
+
value: a,
|
|
22
|
+
rejections: l,
|
|
23
|
+
name: "InputDropzone",
|
|
23
24
|
onRemoveFile: p,
|
|
24
25
|
onRemoveRejection: u,
|
|
25
26
|
onDrop: r,
|
|
@@ -31,7 +32,7 @@ function R() {
|
|
|
31
32
|
}
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
+
const j = n.memo(R);
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
j as default
|
|
37
38
|
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import { clsx as
|
|
4
|
-
const
|
|
5
|
-
root:
|
|
3
|
+
import { clsx as h } from "../../utils/clsx.js";
|
|
4
|
+
const R = "cfxui__Radio__root__05f1c", p = "cfxui__Radio__indicator__2181e", z = "cfxui__Radio__disabled__c411f", e = {
|
|
5
|
+
root: R,
|
|
6
6
|
"size-normal": "cfxui__Radio__size-normal__6dccc",
|
|
7
7
|
"size-large": "cfxui__Radio__size-large__0a074",
|
|
8
|
-
indicator:
|
|
9
|
-
disabled:
|
|
8
|
+
indicator: p,
|
|
9
|
+
disabled: z
|
|
10
10
|
};
|
|
11
11
|
let t = 1;
|
|
12
|
-
function
|
|
12
|
+
function N(d) {
|
|
13
13
|
const {
|
|
14
14
|
checked: i,
|
|
15
15
|
onChange: n,
|
|
16
16
|
label: _,
|
|
17
17
|
size: l = "normal",
|
|
18
18
|
className: r,
|
|
19
|
-
disabled: s = !1
|
|
20
|
-
|
|
19
|
+
disabled: s = !1,
|
|
20
|
+
name: f
|
|
21
|
+
} = d, m = a.useRef(t);
|
|
21
22
|
a.useEffect(() => {
|
|
22
23
|
t += 1;
|
|
23
24
|
}, []);
|
|
24
|
-
const
|
|
25
|
+
const u = () => {
|
|
25
26
|
n(!i);
|
|
26
|
-
}, c = a.useId(),
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
}, c = a.useId(), x = h(e.root, r, e[`size-${l}`], { [e.disabled]: s });
|
|
28
|
+
return /* @__PURE__ */ b("label", { className: x, htmlFor: c, children: [
|
|
29
|
+
/* @__PURE__ */ o(
|
|
29
30
|
"input",
|
|
30
31
|
{
|
|
31
32
|
type: "radio",
|
|
32
|
-
tabIndex:
|
|
33
|
+
tabIndex: m.current,
|
|
33
34
|
checked: i,
|
|
34
35
|
disabled: s,
|
|
35
|
-
onChange:
|
|
36
|
-
id: c
|
|
36
|
+
onChange: u,
|
|
37
|
+
id: c,
|
|
38
|
+
name: f
|
|
37
39
|
}
|
|
38
40
|
),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ o("div", { className: e.indicator }),
|
|
42
|
+
/* @__PURE__ */ o("div", { className: e.label, children: _ })
|
|
41
43
|
] });
|
|
42
44
|
}
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
N as Radio
|
|
45
47
|
};
|