@lanaco/lnc-react-ui 4.0.5 → 4.0.8

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.
@@ -4,10 +4,10 @@ import { P as o } from "./index-BYnWp42a.js";
4
4
  import { n as Ia } from "./emotion-styled.browser.esm-BiK8DcgW.js";
5
5
  import Na from "./Icon.js";
6
6
  import { b as R } from "./tslib.es6-DQ-SzcmG.js";
7
- import Ai from "./Button.js";
7
+ import Ei from "./Button.js";
8
8
  import { a as Ua } from "./utils-C52T57HO.js";
9
- import { u as Ei } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
10
- const Fi = /* @__PURE__ */ new Map([
9
+ import { u as Fi } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
10
+ const Ai = /* @__PURE__ */ new Map([
11
11
  // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
12
12
  ["1km", "application/vnd.1000minds.decision-model+xml"],
13
13
  ["3dml", "text/vnd.in3d.3dml"],
@@ -1211,13 +1211,13 @@ const Fi = /* @__PURE__ */ new Map([
1211
1211
  ["zsh", "text/x-scriptzsh"]
1212
1212
  ]);
1213
1213
  function G(a, i, t) {
1214
- const n = Oi(a), { webkitRelativePath: e } = a, l = typeof i == "string" ? i : typeof e == "string" && e.length > 0 ? e : `./${a.name}`;
1215
- return typeof n.path != "string" && Ya(n, "path", l), Ya(n, "relativePath", l), n;
1214
+ const n = Oi(a), { webkitRelativePath: e } = a, c = typeof i == "string" ? i : typeof e == "string" && e.length > 0 ? e : `./${a.name}`;
1215
+ return typeof n.path != "string" && Ya(n, "path", c), Ya(n, "relativePath", c), n;
1216
1216
  }
1217
1217
  function Oi(a) {
1218
1218
  const { name: i } = a;
1219
1219
  if (i && i.lastIndexOf(".") !== -1 && !a.type) {
1220
- const n = i.split(".").pop().toLowerCase(), e = Fi.get(n);
1220
+ const n = i.split(".").pop().toLowerCase(), e = Ai.get(n);
1221
1221
  e && Object.defineProperty(a, "type", {
1222
1222
  value: e,
1223
1223
  writable: !1,
@@ -1302,17 +1302,22 @@ function pi(a) {
1302
1302
  ], []);
1303
1303
  }
1304
1304
  function Va(a, i) {
1305
- var t;
1306
- if (globalThis.isSecureContext && typeof a.getAsFileSystemHandle == "function")
1307
- return a.getAsFileSystemHandle().then((l) => R(this, void 0, void 0, function* () {
1308
- const r = yield l.getFile();
1309
- return r.handle = l, G(r);
1310
- }));
1311
- const n = a.getAsFile();
1312
- if (!n)
1313
- return Promise.reject(`${a} is not a File`);
1314
- const e = G(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1315
- return Promise.resolve(e);
1305
+ return R(this, void 0, void 0, function* () {
1306
+ var t;
1307
+ if (globalThis.isSecureContext && typeof a.getAsFileSystemHandle == "function") {
1308
+ const c = yield a.getAsFileSystemHandle();
1309
+ if (c === null)
1310
+ throw new Error(`${a} is not a File`);
1311
+ if (c !== void 0) {
1312
+ const r = yield c.getFile();
1313
+ return r.handle = c, G(r);
1314
+ }
1315
+ }
1316
+ const n = a.getAsFile();
1317
+ if (!n)
1318
+ throw new Error(`${a} is not a File`);
1319
+ return G(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1320
+ });
1316
1321
  }
1317
1322
  function Li(a) {
1318
1323
  return R(this, void 0, void 0, function* () {
@@ -1323,11 +1328,11 @@ function oi(a) {
1323
1328
  const i = a.createReader();
1324
1329
  return new Promise((t, n) => {
1325
1330
  const e = [];
1326
- function l() {
1331
+ function c() {
1327
1332
  i.readEntries((r) => R(this, void 0, void 0, function* () {
1328
1333
  if (r.length) {
1329
1334
  const s = Promise.all(r.map(Li));
1330
- e.push(s), l();
1335
+ e.push(s), c();
1331
1336
  } else
1332
1337
  try {
1333
1338
  const s = yield Promise.all(e);
@@ -1339,7 +1344,7 @@ function oi(a) {
1339
1344
  n(r);
1340
1345
  });
1341
1346
  }
1342
- l();
1347
+ c();
1343
1348
  });
1344
1349
  }
1345
1350
  function Mi(a) {
@@ -1359,10 +1364,10 @@ var Oa = function(a, i) {
1359
1364
  var t = Array.isArray(i) ? i : i.split(",");
1360
1365
  if (t.length === 0)
1361
1366
  return !0;
1362
- var n = a.name || "", e = (a.type || "").toLowerCase(), l = e.replace(/\/.*$/, "");
1367
+ var n = a.name || "", e = (a.type || "").toLowerCase(), c = e.replace(/\/.*$/, "");
1363
1368
  return t.some(function(r) {
1364
1369
  var s = r.trim().toLowerCase();
1365
- return s.charAt(0) === "." ? n.toLowerCase().endsWith(s) : s.endsWith("/*") ? l === s.replace(/\/.*$/, "") : e === s;
1370
+ return s.charAt(0) === "." ? n.toLowerCase().endsWith(s) : s.endsWith("/*") ? c === s.replace(/\/.*$/, "") : e === s;
1366
1371
  });
1367
1372
  }
1368
1373
  return !0;
@@ -1428,17 +1433,17 @@ function Sa(a, i) {
1428
1433
  function Wi(a, i) {
1429
1434
  var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
1430
1435
  if (t != null) {
1431
- var n = [], e = !0, l = !1, r, s;
1436
+ var n = [], e = !0, c = !1, r, s;
1432
1437
  try {
1433
1438
  for (t = t.call(a); !(e = (r = t.next()).done) && (n.push(r.value), !(i && n.length === i)); e = !0)
1434
1439
  ;
1435
1440
  } catch (g) {
1436
- l = !0, s = g;
1441
+ c = !0, s = g;
1437
1442
  } finally {
1438
1443
  try {
1439
1444
  !e && t.return != null && t.return();
1440
1445
  } finally {
1441
- if (l) throw s;
1446
+ if (c) throw s;
1442
1447
  }
1443
1448
  }
1444
1449
  return n;
@@ -1486,10 +1491,10 @@ function I(a) {
1486
1491
  return a != null;
1487
1492
  }
1488
1493
  function Zi(a) {
1489
- var i = a.files, t = a.accept, n = a.minSize, e = a.maxSize, l = a.multiple, r = a.maxFiles, s = a.validator;
1490
- return !l && i.length > 1 || l && r >= 1 && i.length > r ? !1 : i.every(function(g) {
1491
- var E = ri(g, t), w = na(E, 1), F = w[0], L = si(g, n, e), j = na(L, 1), O = j[0], _ = s ? s(g) : null;
1492
- return F && O && !_;
1494
+ var i = a.files, t = a.accept, n = a.minSize, e = a.maxSize, c = a.multiple, r = a.maxFiles, s = a.validator;
1495
+ return !c && i.length > 1 || c && r >= 1 && i.length > r ? !1 : i.every(function(g) {
1496
+ var F = ri(g, t), w = na(F, 1), A = w[0], L = si(g, n, e), j = na(L, 1), O = j[0], _ = s ? s(g) : null;
1497
+ return A && O && !_;
1493
1498
  });
1494
1499
  }
1495
1500
  function ba(a) {
@@ -1517,10 +1522,10 @@ function k() {
1517
1522
  for (var a = arguments.length, i = new Array(a), t = 0; t < a; t++)
1518
1523
  i[t] = arguments[t];
1519
1524
  return function(n) {
1520
- for (var e = arguments.length, l = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
1521
- l[r - 1] = arguments[r];
1525
+ for (var e = arguments.length, c = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
1526
+ c[r - 1] = arguments[r];
1522
1527
  return i.some(function(s) {
1523
- return !ba(n) && s && s.apply(void 0, [n].concat(l)), ba(n);
1528
+ return !ba(n) && s && s.apply(void 0, [n].concat(c)), ba(n);
1524
1529
  });
1525
1530
  };
1526
1531
  }
@@ -1530,11 +1535,11 @@ function nt() {
1530
1535
  function et(a) {
1531
1536
  if (I(a)) {
1532
1537
  var i = Object.entries(a).filter(function(t) {
1533
- var n = na(t, 2), e = n[0], l = n[1], r = !0;
1534
- return di(e) || (console.warn('Skipped "'.concat(e, '" 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.')), r = !1), (!Array.isArray(l) || !l.every(mi)) && (console.warn('Skipped "'.concat(e, '" because an invalid file extension was provided.')), r = !1), r;
1538
+ var n = na(t, 2), e = n[0], c = n[1], r = !0;
1539
+ return di(e) || (console.warn('Skipped "'.concat(e, '" 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.')), r = !1), (!Array.isArray(c) || !c.every(mi)) && (console.warn('Skipped "'.concat(e, '" because an invalid file extension was provided.')), r = !1), r;
1535
1540
  }).reduce(function(t, n) {
1536
- var e = na(n, 2), l = e[0], r = e[1];
1537
- return Xa(Xa({}, t), {}, ci({}, l, r));
1541
+ var e = na(n, 2), c = e[0], r = e[1];
1542
+ return Xa(Xa({}, t), {}, ci({}, c, r));
1538
1543
  }, {});
1539
1544
  return [{
1540
1545
  // description is required due to https://crbug.com/1264708
@@ -1547,8 +1552,8 @@ function et(a) {
1547
1552
  function pt(a) {
1548
1553
  if (I(a))
1549
1554
  return Object.entries(a).reduce(function(i, t) {
1550
- var n = na(t, 2), e = n[0], l = n[1];
1551
- return [].concat(Ja(i), [e], Ja(l));
1555
+ var n = na(t, 2), e = n[0], c = n[1];
1556
+ return [].concat(Ja(i), [e], Ja(c));
1552
1557
  }, []).filter(function(i) {
1553
1558
  return di(i) || mi(i);
1554
1559
  }).join(",");
@@ -1603,17 +1608,17 @@ function Ca(a, i) {
1603
1608
  function gt(a, i) {
1604
1609
  var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
1605
1610
  if (t != null) {
1606
- var n = [], e = !0, l = !1, r, s;
1611
+ var n = [], e = !0, c = !1, r, s;
1607
1612
  try {
1608
1613
  for (t = t.call(a); !(e = (r = t.next()).done) && (n.push(r.value), !(i && n.length === i)); e = !0)
1609
1614
  ;
1610
1615
  } catch (g) {
1611
- l = !0, s = g;
1616
+ c = !0, s = g;
1612
1617
  } finally {
1613
1618
  try {
1614
1619
  !e && t.return != null && t.return();
1615
1620
  } finally {
1616
- if (l) throw s;
1621
+ if (c) throw s;
1617
1622
  }
1618
1623
  }
1619
1624
  return n;
@@ -1650,27 +1655,27 @@ function ha(a, i) {
1650
1655
  if (a == null) return {};
1651
1656
  var t = ht(a, i), n, e;
1652
1657
  if (Object.getOwnPropertySymbols) {
1653
- var l = Object.getOwnPropertySymbols(a);
1654
- for (e = 0; e < l.length; e++)
1655
- n = l[e], !(i.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(a, n) && (t[n] = a[n]);
1658
+ var c = Object.getOwnPropertySymbols(a);
1659
+ for (e = 0; e < c.length; e++)
1660
+ n = c[e], !(i.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(a, n) && (t[n] = a[n]);
1656
1661
  }
1657
1662
  return t;
1658
1663
  }
1659
1664
  function ht(a, i) {
1660
1665
  if (a == null) return {};
1661
- var t = {}, n = Object.keys(a), e, l;
1662
- for (l = 0; l < n.length; l++)
1663
- e = n[l], !(i.indexOf(e) >= 0) && (t[e] = a[e]);
1666
+ var t = {}, n = Object.keys(a), e, c;
1667
+ for (c = 0; c < n.length; c++)
1668
+ e = n[c], !(i.indexOf(e) >= 0) && (t[e] = a[e]);
1664
1669
  return t;
1665
1670
  }
1666
1671
  var Ra = /* @__PURE__ */ ei(function(a, i) {
1667
- var t = a.children, n = ha(a, lt), e = fi(n), l = e.open, r = ha(e, rt);
1672
+ var t = a.children, n = ha(a, lt), e = fi(n), c = e.open, r = ha(e, rt);
1668
1673
  return ji(i, function() {
1669
1674
  return {
1670
- open: l
1675
+ open: c
1671
1676
  };
1672
- }, [l]), /* @__PURE__ */ wi.createElement(Di, null, t(m(m({}, r), {}, {
1673
- open: l
1677
+ }, [c]), /* @__PURE__ */ wi.createElement(Di, null, t(m(m({}, r), {}, {
1678
+ open: c
1674
1679
  })));
1675
1680
  });
1676
1681
  Ra.displayName = "Dropzone";
@@ -1869,19 +1874,19 @@ var qa = {
1869
1874
  fileRejections: []
1870
1875
  };
1871
1876
  function fi() {
1872
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = m(m({}, vi), a), t = i.accept, n = i.disabled, e = i.getFilesFromEvent, l = i.maxSize, r = i.minSize, s = i.multiple, g = i.maxFiles, E = i.onDragEnter, w = i.onDragLeave, F = i.onDragOver, L = i.onDrop, j = i.onDropAccepted, O = i.onDropRejected, _ = i.onFileDialogCancel, A = i.onFileDialogOpen, V = i.useFsAccessApi, J = i.autoFocus, M = i.preventDropOnDocument, Q = i.noClick, $ = i.noKeyboard, P = i.noDrag, D = i.noDragEventsBubbling, K = i.onError, S = i.validator, C = Y(function() {
1877
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = m(m({}, vi), a), t = i.accept, n = i.disabled, e = i.getFilesFromEvent, c = i.maxSize, r = i.minSize, s = i.multiple, g = i.maxFiles, F = i.onDragEnter, w = i.onDragLeave, A = i.onDragOver, L = i.onDrop, j = i.onDropAccepted, O = i.onDropRejected, _ = i.onFileDialogCancel, E = i.onFileDialogOpen, V = i.useFsAccessApi, J = i.autoFocus, M = i.preventDropOnDocument, Q = i.noClick, $ = i.noKeyboard, P = i.noDrag, D = i.noDragEventsBubbling, K = i.onError, S = i.validator, C = Y(function() {
1873
1878
  return pt(t);
1874
1879
  }, [t]), ea = Y(function() {
1875
1880
  return et(t);
1876
1881
  }, [t]), B = Y(function() {
1877
- return typeof A == "function" ? A : ni;
1878
- }, [A]), T = Y(function() {
1882
+ return typeof E == "function" ? E : ni;
1883
+ }, [E]), T = Y(function() {
1879
1884
  return typeof _ == "function" ? _ : ni;
1880
1885
  }, [_]), u = ta(null), x = ta(null), pa = ki(yt, qa), oa = _a(pa, 2), X = oa[0], b = oa[1], ca = X.isFocused, la = X.isFileDialogActive, H = ta(typeof window < "u" && window.isSecureContext && V && nt()), ra = function() {
1881
1886
  !H.current && la && setTimeout(function() {
1882
1887
  if (x.current) {
1883
- var c = x.current.files;
1884
- c.length || (b({
1888
+ var l = x.current.files;
1889
+ l.length || (b({
1885
1890
  type: "closeDialog"
1886
1891
  }), T());
1887
1892
  }
@@ -1892,8 +1897,8 @@ function fi() {
1892
1897
  window.removeEventListener("focus", ra, !1);
1893
1898
  };
1894
1899
  }, [x, la, T, H]);
1895
- var z = ta([]), ya = function(c) {
1896
- u.current && u.current.contains(c.target) || (c.preventDefault(), z.current = []);
1900
+ var z = ta([]), ya = function(l) {
1901
+ u.current && u.current.contains(l.target) || (l.preventDefault(), z.current = []);
1897
1902
  };
1898
1903
  xa(function() {
1899
1904
  return M && (document.addEventListener("dragover", ii, !1), document.addEventListener("drop", ya, !1)), function() {
@@ -1906,13 +1911,13 @@ function fi() {
1906
1911
  var d = h(function(p) {
1907
1912
  K ? K(p) : console.error(p);
1908
1913
  }, [K]), q = h(function(p) {
1909
- p.preventDefault(), p.persist(), ua(p), z.current = [].concat(mt(z.current), [p.target]), fa(p) && Promise.resolve(e(p)).then(function(c) {
1914
+ p.preventDefault(), p.persist(), ua(p), z.current = [].concat(mt(z.current), [p.target]), fa(p) && Promise.resolve(e(p)).then(function(l) {
1910
1915
  if (!(ba(p) && !D)) {
1911
- var v = c.length, f = v > 0 && Zi({
1912
- files: c,
1916
+ var v = l.length, f = v > 0 && Zi({
1917
+ files: l,
1913
1918
  accept: C,
1914
1919
  minSize: r,
1915
- maxSize: l,
1920
+ maxSize: c,
1916
1921
  multiple: s,
1917
1922
  maxFiles: g,
1918
1923
  validator: S
@@ -1922,42 +1927,42 @@ function fi() {
1922
1927
  isDragReject: y,
1923
1928
  isDragActive: !0,
1924
1929
  type: "setDraggedFiles"
1925
- }), E && E(p);
1930
+ }), F && F(p);
1926
1931
  }
1927
- }).catch(function(c) {
1928
- return d(c);
1932
+ }).catch(function(l) {
1933
+ return d(l);
1929
1934
  });
1930
- }, [e, E, d, D, C, r, l, s, g, S]), Z = h(function(p) {
1935
+ }, [e, F, d, D, C, r, c, s, g, S]), Z = h(function(p) {
1931
1936
  p.preventDefault(), p.persist(), ua(p);
1932
- var c = fa(p);
1933
- if (c && p.dataTransfer)
1937
+ var l = fa(p);
1938
+ if (l && p.dataTransfer)
1934
1939
  try {
1935
1940
  p.dataTransfer.dropEffect = "copy";
1936
1941
  } catch {
1937
1942
  }
1938
- return c && F && F(p), !1;
1939
- }, [F, D]), La = h(function(p) {
1943
+ return l && A && A(p), !1;
1944
+ }, [A, D]), La = h(function(p) {
1940
1945
  p.preventDefault(), p.persist(), ua(p);
1941
- var c = z.current.filter(function(f) {
1946
+ var l = z.current.filter(function(f) {
1942
1947
  return u.current && u.current.contains(f);
1943
- }), v = c.indexOf(p.target);
1944
- v !== -1 && c.splice(v, 1), z.current = c, !(c.length > 0) && (b({
1948
+ }), v = l.indexOf(p.target);
1949
+ v !== -1 && l.splice(v, 1), z.current = l, !(l.length > 0) && (b({
1945
1950
  type: "setDraggedFiles",
1946
1951
  isDragActive: !1,
1947
1952
  isDragAccept: !1,
1948
1953
  isDragReject: !1
1949
1954
  }), fa(p) && w && w(p));
1950
- }, [u, w, D]), sa = h(function(p, c) {
1955
+ }, [u, w, D]), sa = h(function(p, l) {
1951
1956
  var v = [], f = [];
1952
1957
  p.forEach(function(y) {
1953
- var aa = ri(y, C), U = _a(aa, 2), ka = U[0], ja = U[1], Da = si(y, r, l), va = _a(Da, 2), za = va[0], Aa = va[1], Ea = S ? S(y) : null;
1954
- if (ka && za && !Ea)
1958
+ var aa = ri(y, C), U = _a(aa, 2), ka = U[0], ja = U[1], Da = si(y, r, c), va = _a(Da, 2), za = va[0], Ea = va[1], Fa = S ? S(y) : null;
1959
+ if (ka && za && !Fa)
1955
1960
  v.push(y);
1956
1961
  else {
1957
- var Fa = [ja, Aa];
1958
- Ea && (Fa = Fa.concat(Ea)), f.push({
1962
+ var Aa = [ja, Ea];
1963
+ Fa && (Aa = Aa.concat(Fa)), f.push({
1959
1964
  file: y,
1960
- errors: Fa.filter(function(hi) {
1965
+ errors: Aa.filter(function(hi) {
1961
1966
  return hi;
1962
1967
  })
1963
1968
  });
@@ -1972,12 +1977,12 @@ function fi() {
1972
1977
  fileRejections: f,
1973
1978
  isDragReject: f.length > 0,
1974
1979
  type: "setFiles"
1975
- }), L && L(v, f, c), f.length > 0 && O && O(f, c), v.length > 0 && j && j(v, c);
1976
- }, [b, s, C, r, l, g, L, j, O, S]), da = h(function(p) {
1977
- p.preventDefault(), p.persist(), ua(p), z.current = [], fa(p) && Promise.resolve(e(p)).then(function(c) {
1978
- ba(p) && !D || sa(c, p);
1979
- }).catch(function(c) {
1980
- return d(c);
1980
+ }), L && L(v, f, l), f.length > 0 && O && O(f, l), v.length > 0 && j && j(v, l);
1981
+ }, [b, s, C, r, c, g, L, j, O, S]), da = h(function(p) {
1982
+ p.preventDefault(), p.persist(), ua(p), z.current = [], fa(p) && Promise.resolve(e(p)).then(function(l) {
1983
+ ba(p) && !D || sa(l, p);
1984
+ }).catch(function(l) {
1985
+ return d(l);
1981
1986
  }), b({
1982
1987
  type: "reset"
1983
1988
  });
@@ -1990,16 +1995,16 @@ function fi() {
1990
1995
  multiple: s,
1991
1996
  types: ea
1992
1997
  };
1993
- window.showOpenFilePicker(p).then(function(c) {
1994
- return e(c);
1995
- }).then(function(c) {
1996
- sa(c, null), b({
1998
+ window.showOpenFilePicker(p).then(function(l) {
1999
+ return e(l);
2000
+ }).then(function(l) {
2001
+ sa(l, null), b({
1997
2002
  type: "closeDialog"
1998
2003
  });
1999
- }).catch(function(c) {
2000
- ot(c) ? (T(c), b({
2004
+ }).catch(function(l) {
2005
+ ot(l) ? (T(l), b({
2001
2006
  type: "closeDialog"
2002
- })) : ct(c) ? (H.current = !1, x.current ? (x.current.value = null, x.current.click()) : d(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."))) : d(c);
2007
+ })) : ct(l) ? (H.current = !1, x.current ? (x.current.value = null, x.current.click()) : d(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."))) : d(l);
2003
2008
  });
2004
2009
  return;
2005
2010
  }
@@ -2018,17 +2023,17 @@ function fi() {
2018
2023
  });
2019
2024
  }, []), Ba = h(function() {
2020
2025
  Q || (tt() ? setTimeout(W, 0) : W());
2021
- }, [Q, W]), N = function(c) {
2022
- return n ? null : c;
2023
- }, wa = function(c) {
2024
- return $ ? null : N(c);
2025
- }, ma = function(c) {
2026
- return P ? null : N(c);
2027
- }, ua = function(c) {
2028
- D && c.stopPropagation();
2026
+ }, [Q, W]), N = function(l) {
2027
+ return n ? null : l;
2028
+ }, wa = function(l) {
2029
+ return $ ? null : N(l);
2030
+ }, ma = function(l) {
2031
+ return P ? null : N(l);
2032
+ }, ua = function(l) {
2033
+ D && l.stopPropagation();
2029
2034
  }, xi = Y(function() {
2030
2035
  return function() {
2031
- var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, v = c === void 0 ? "ref" : c, f = p.role, y = p.onKeyDown, aa = p.onFocus, U = p.onBlur, ka = p.onClick, ja = p.onDragEnter, Da = p.onDragOver, va = p.onDragLeave, za = p.onDrop, Aa = ha(p, st);
2036
+ var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, f = p.role, y = p.onKeyDown, aa = p.onFocus, U = p.onBlur, ka = p.onClick, ja = p.onDragEnter, Da = p.onDragOver, va = p.onDragLeave, za = p.onDrop, Ea = ha(p, st);
2032
2037
  return m(m(Ta({
2033
2038
  onKeyDown: wa(k(y, Ma)),
2034
2039
  onFocus: wa(k(aa, $a)),
@@ -2041,13 +2046,13 @@ function fi() {
2041
2046
  role: typeof f == "string" && f !== "" ? f : "presentation"
2042
2047
  }, v, u), !n && !$ ? {
2043
2048
  tabIndex: 0
2044
- } : {}), Aa);
2049
+ } : {}), Ea);
2045
2050
  };
2046
2051
  }, [u, Ma, $a, Ka, Ba, q, Z, La, da, $, P, n]), gi = h(function(p) {
2047
2052
  p.stopPropagation();
2048
2053
  }, []), bi = Y(function() {
2049
2054
  return function() {
2050
- var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = p.refKey, v = c === void 0 ? "ref" : c, f = p.onChange, y = p.onClick, aa = ha(p, dt), U = Ta({
2055
+ var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, f = p.onChange, y = p.onClick, aa = ha(p, dt), U = Ta({
2051
2056
  accept: C,
2052
2057
  multiple: s,
2053
2058
  type: "file",
@@ -2163,23 +2168,23 @@ const wt = {
2163
2168
  `, zt = Ia.span`
2164
2169
  align-self: self-end;
2165
2170
  cursor: pointer;
2166
- `, At = ei((a, i) => {
2171
+ `, Et = ei((a, i) => {
2167
2172
  const {
2168
2173
  inputRef: t,
2169
2174
  id: n = "",
2170
2175
  disabled: e = !1,
2171
- preventDefault: l,
2176
+ preventDefault: c,
2172
2177
  acceptDropzone: r = {},
2173
2178
  acceptInput: s,
2174
2179
  multiple: g = !1,
2175
- selectFileText: E = "Select file",
2180
+ selectFileText: F = "Select file",
2176
2181
  control: w,
2177
- dndFileText: F = "Drag and drop file here or",
2182
+ dndFileText: A = "Drag and drop file here or",
2178
2183
  showFileSize: L = !1,
2179
2184
  showDnD: j = !0,
2180
2185
  className: O = "",
2181
2186
  style: _ = {},
2182
- onChange: A = () => {
2187
+ onChange: E = () => {
2183
2188
  },
2184
2189
  onFocus: V = () => {
2185
2190
  },
@@ -2194,7 +2199,7 @@ const wt = {
2194
2199
  inputProps: D,
2195
2200
  alwaysShowDropzone: K = !1,
2196
2201
  ...S
2197
- } = a, C = Ei(), [ea, B] = Wa(!1), [T, u] = Wa(j), x = ta();
2202
+ } = a, C = Fi(), [ea, B] = Wa(!1), [T, u] = Wa(j), x = ta();
2198
2203
  xa(() => {
2199
2204
  u(j);
2200
2205
  }, [j]);
@@ -2202,9 +2207,9 @@ const wt = {
2202
2207
  const oa = h((d, q) => {
2203
2208
  Q && Q(d, q), u(!1);
2204
2209
  }, []), X = h((d) => {
2205
- A && !e && A(d), M && M(d), u(!1);
2210
+ E && !e && E(d), M && M(d), u(!1);
2206
2211
  }, []), b = (d) => {
2207
- A && !e && A(d), u(!1);
2212
+ E && !e && E(d), u(!1);
2208
2213
  }, ca = (d) => {
2209
2214
  var q, Z;
2210
2215
  i != null && i.current ? (q = i.current) == null || q.click() : (Z = x == null ? void 0 : x.current) == null || Z.click();
@@ -2214,11 +2219,11 @@ const wt = {
2214
2219
  },
2215
2220
  disabled: e
2216
2221
  }) : /* @__PURE__ */ ia(
2217
- Ai,
2222
+ Ei,
2218
2223
  {
2219
2224
  color: $,
2220
2225
  size: P,
2221
- text: E,
2226
+ text: F,
2222
2227
  disabled: e,
2223
2228
  onClick: (d) => {
2224
2229
  d.preventDefault(), ca();
@@ -2266,14 +2271,14 @@ const wt = {
2266
2271
  !z && !T && !K && /* @__PURE__ */ ia(zt, { children: /* @__PURE__ */ ia(Na, { icon: "plus", size: P }) }),
2267
2272
  (z || T || K) && /* @__PURE__ */ Ha(yi, { children: [
2268
2273
  /* @__PURE__ */ ia(Na, { icon: "upload", size: P, className: "dnd-icon-lnc" }),
2269
- F,
2274
+ A,
2270
2275
  la()
2271
2276
  ] })
2272
2277
  ]
2273
2278
  }
2274
2279
  );
2275
2280
  });
2276
- At.propTypes = {
2281
+ Et.propTypes = {
2277
2282
  inputRef: o.any,
2278
2283
  id: o.string,
2279
2284
  disabled: o.bool,
@@ -2327,5 +2332,5 @@ At.propTypes = {
2327
2332
  inputProps: o.any
2328
2333
  };
2329
2334
  export {
2330
- At as default
2335
+ Et as default
2331
2336
  };
package/dist/MenuItem.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("react/jsx-runtime"),f=require("react"),s=require("./index-BIlhCoy2.cjs"),Y=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),M=require("./Icon.cjs"),l=require("./utils-DTAPpJXU.cjs"),G=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),H=Y.newStyled.div`
1
+ "use strict";const c=require("react/jsx-runtime"),f=require("react"),s=require("./index-BIlhCoy2.cjs"),G=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),M=require("./Icon.cjs"),l=require("./utils-DTAPpJXU.cjs"),H=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),J=G.newStyled.div`
2
2
  box-sizing: border-box;
3
3
  cursor: ${n=>n.disabled==!1?"pointer":"context-menu"};
4
4
  width: 100%;
@@ -33,4 +33,4 @@
33
33
  color: ${l.getColorRgbaValue(n.theme,"MenuItem",n.color,"hover","text")};
34
34
  `}
35
35
  }
36
- `,h=f.forwardRef((n,a)=>{const{value:T,active:r=null,icon:E,disabled:m=!1,isNested:d=!1,showNested:P,justifyToEnd:J=!1,onFocus:N=()=>{},onBlur:k=()=>{},onClick:C=()=>{},onKeyDown:v=()=>{},onMouseEnter:Q=()=>{},onMouseLeave:W=()=>{},toggleNested:u=()=>{},onItemSelected:w=()=>{},className:x="",style:_={},color:$="primary",iconProps:R,__TYPE__:X="MENU_ITEM",children:S,...A}=n,j={theme:G.useTheme(),color:$,style:_},y=f.useRef(),[q,g]=f.useState(r??!1);f.useEffect(()=>{g(r)},[r]);const O=e=>{m==!1&&(d&&u&&u(),w(e,T)),C(C)},D=e=>{g(!0),N(e)},V=e=>{r==null&&g(!1),k(e)},F=e=>{e.preventDefault(),e.key=="ArrowDown"?b(a?a.current:y.current):e.key=="ArrowUp"?p(a?a.current:y.current):(e.key=="Enter"||e.keyCode==32)&&m==!1&&(d&&u&&u(),w(e,T)),v(e)},b=e=>{if(e!=null&&e.nextSibling){let o=B(e);if(o!=null&&o.node&&(o==null?void 0:o.type)=="item")o.node.focus();else if(o!=null&&o.node&&(o==null?void 0:o.type)=="nested"){let i=z(o.node);i&&i.focus()}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&b(e.parentElement)}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&b(e.parentElement)},p=e=>{if(e!=null&&e.previousSibling){let o=K(e);if(o!=null&&o.node&&(o==null?void 0:o.type)=="item")o.node.focus();else if(o!=null&&o.node&&(o==null?void 0:o.type)=="nested"){let i=L(o.node);i&&i.focus()}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&p(e.parentElement)}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&p(e.parentElement)},B=e=>{for(;e=e.nextSibling;){if(t(e,"menu-item-lnc"))return{node:e,type:"item"};if(t(e,"nested-item-lnc"))return{node:e,type:"nested"}}return null},K=e=>{for(;e=e.previousSibling;){if(t(e,"menu-item-lnc"))return{node:e,type:"item"};if(t(e,"nested-item-lnc"))return{node:e,type:"nested"}}return null},z=e=>{var o;return(o=Array.from(e.querySelectorAll(".menu-item-lnc")))==null?void 0:o[0]},L=e=>{var o;return(o=Array.from(e.querySelectorAll(".menu-item-lnc")))==null?void 0:o.pop()},t=(e,o)=>{var i=" "+e.className+" ",U=" "+o+" ";return i.indexOf(U)!=-1};return c.jsx(c.Fragment,{children:c.jsxs(H,{ref:a||y,className:"menu-item-lnc "+(d?"nested-menu-item-lnc ":"")+(P?"spread-nested-item-lnc ":"")+x,...j,disabled:m,tabIndex:0,onKeyDown:F,onFocus:D,onBlur:V,onClick:O,isActive:q,showNested:P,...A,children:[E&&c.jsx(M,{icon:E,className:"menu-icon-lnc",...R}),c.jsx("div",{children:S}),d&&c.jsx(M,{icon:"angle-down",className:"sub-menu-icon-lnc"})]})})});h.propTypes={value:s.PropTypes.any,active:s.PropTypes.bool,icon:s.PropTypes.string,disabled:s.PropTypes.bool,isNested:s.PropTypes.bool,justifyToEnd:s.PropTypes.bool,onBlur:s.PropTypes.func,onFocus:s.PropTypes.func,onClick:s.PropTypes.func,onKeyDown:s.PropTypes.func,onMouseEnter:s.PropTypes.func,onMouseLeave:s.PropTypes.func,className:s.PropTypes.string,style:s.PropTypes.object,color:s.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),iconProps:s.PropTypes.any,size:s.PropTypes.oneOf(["small","medium","large"]),__TYPE__:s.PropTypes.string};h.displayName="MENU_ITEM";module.exports=h;
36
+ `,h=f.forwardRef((n,a)=>{const{value:T,active:r=null,icon:E,disabled:m=!1,isNested:d=!1,showNested:P,justifyToEnd:Q=!1,onFocus:N=()=>{},onBlur:k=()=>{},onClick:C=()=>{},onKeyDown:v=()=>{},onMouseEnter:W=()=>{},onMouseLeave:X=()=>{},toggleNested:u=()=>{},onItemSelected:w=()=>{},className:x="",style:_={},color:$="primary",size:R="small",iconProps:S,__TYPE__:Z="MENU_ITEM",children:A,...j}=n,q={theme:H.useTheme(),color:$,style:_,size:R},y=f.useRef(),[O,g]=f.useState(r??!1);f.useEffect(()=>{g(r)},[r]);const D=e=>{m==!1&&(d&&u&&u(),w(e,T)),C(C)},V=e=>{g(!0),N(e)},F=e=>{r==null&&g(!1),k(e)},z=e=>{e.preventDefault(),e.key=="ArrowDown"?b(a?a.current:y.current):e.key=="ArrowUp"?p(a?a.current:y.current):(e.key=="Enter"||e.keyCode==32)&&m==!1&&(d&&u&&u(),w(e,T)),v(e)},b=e=>{if(e!=null&&e.nextSibling){let o=B(e);if(o!=null&&o.node&&(o==null?void 0:o.type)=="item")o.node.focus();else if(o!=null&&o.node&&(o==null?void 0:o.type)=="nested"){let i=L(o.node);i&&i.focus()}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&b(e.parentElement)}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&b(e.parentElement)},p=e=>{if(e!=null&&e.previousSibling){let o=K(e);if(o!=null&&o.node&&(o==null?void 0:o.type)=="item")o.node.focus();else if(o!=null&&o.node&&(o==null?void 0:o.type)=="nested"){let i=U(o.node);i&&i.focus()}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&p(e.parentElement)}else e!=null&&e.parentElement&&t(e.parentElement,"nested-item-lnc")&&p(e.parentElement)},B=e=>{for(;e=e.nextSibling;){if(t(e,"menu-item-lnc"))return{node:e,type:"item"};if(t(e,"nested-item-lnc"))return{node:e,type:"nested"}}return null},K=e=>{for(;e=e.previousSibling;){if(t(e,"menu-item-lnc"))return{node:e,type:"item"};if(t(e,"nested-item-lnc"))return{node:e,type:"nested"}}return null},L=e=>{var o;return(o=Array.from(e.querySelectorAll(".menu-item-lnc")))==null?void 0:o[0]},U=e=>{var o;return(o=Array.from(e.querySelectorAll(".menu-item-lnc")))==null?void 0:o.pop()},t=(e,o)=>{var i=" "+e.className+" ",Y=" "+o+" ";return i.indexOf(Y)!=-1};return c.jsx(c.Fragment,{children:c.jsxs(J,{ref:a||y,className:"menu-item-lnc "+(d?"nested-menu-item-lnc ":"")+(P?"spread-nested-item-lnc ":"")+x,...q,disabled:m,tabIndex:0,onKeyDown:z,onFocus:V,onBlur:F,onClick:D,isActive:O,showNested:P,...j,children:[E&&c.jsx(M,{icon:E,className:"menu-icon-lnc",...S}),c.jsx("div",{children:A}),d&&c.jsx(M,{icon:"angle-down",className:"sub-menu-icon-lnc"})]})})});h.propTypes={value:s.PropTypes.any,active:s.PropTypes.bool,icon:s.PropTypes.string,disabled:s.PropTypes.bool,isNested:s.PropTypes.bool,justifyToEnd:s.PropTypes.bool,onBlur:s.PropTypes.func,onFocus:s.PropTypes.func,onClick:s.PropTypes.func,onKeyDown:s.PropTypes.func,onMouseEnter:s.PropTypes.func,onMouseLeave:s.PropTypes.func,className:s.PropTypes.string,style:s.PropTypes.object,color:s.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),iconProps:s.PropTypes.any,size:s.PropTypes.oneOf(["small","medium","large"]),__TYPE__:s.PropTypes.string};h.displayName="MENU_ITEM";module.exports=h;