@pnkx-lib/ui 1.9.545 → 1.9.547
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/style.css +2 -2
- package/es/chunks/_Map-DrbKlWOd.js +291 -0
- package/es/chunks/{bundle-mjs-BME7zF0Z.js → bundle-mjs-BBFHkixS.js} +1 -1
- package/es/chunks/{get-DPccfEM4.js → get-B8ylKzPy.js} +3 -535
- package/es/chunks/{index.esm-Dr5ZHcf7.js → index.esm-Ds4t-z37.js} +3 -6
- package/es/chunks/isArray-BL9F4qX0.js +249 -0
- package/es/chunks/isBoolean-AinkADvr.js +45 -0
- package/es/chunks/isEmpty-CiTVbosv.js +740 -0
- package/es/chunks/{table-Btvh90Co.js → table-CIEieGXp.js} +1 -0
- package/es/chunks/{toArray-GtzhUyP3.js → toArray-7SKWyzWi.js} +79 -67
- package/es/constants/index.js +1 -1
- package/es/fields/CascaderField.js +2 -2
- package/es/fields/Checkbox.js +2 -2
- package/es/fields/DatePicker.js +2 -2
- package/es/fields/DateRangePicker.js +2 -2
- package/es/fields/Input.js +2 -2
- package/es/fields/InputRangePicker.js +2 -2
- package/es/fields/PnkxField.js +1 -1
- package/es/fields/Radio.js +1 -1
- package/es/fields/Select.js +2 -2
- package/es/fields/SliderRanger.js +2 -2
- package/es/fields/SliderSingle.js +2 -2
- package/es/fields/Switch.js +2 -2
- package/es/fields/Textarea.js +2 -2
- package/es/fields/TimePicker.js +2 -2
- package/es/fields/TimeRangePicker.js +2 -2
- package/es/fields/TinyMCE.js +18 -37
- package/es/fields/Upload.js +1 -1
- package/es/index.js +1 -1
- package/es/ui/BulkActions/index.js +4 -3
- package/es/ui/Button.js +1 -1
- package/es/ui/Cascader.js +1 -1
- package/es/ui/CategoryStatus.js +1 -1
- package/es/ui/Clock/index.js +1 -1
- package/es/ui/Container.js +1 -1
- package/es/ui/CustomeBulkActions/index.js +3 -2
- package/es/ui/Descriptions.js +1 -1
- package/es/ui/GenericUploadModal.js +575 -637
- package/es/ui/Label.js +1 -1
- package/es/ui/Layout.js +30 -33
- package/es/ui/Modal.js +1 -1
- package/es/ui/SearchFilterForm.js +1 -1
- package/es/ui/SelectSingleTable.js +3 -2
- package/es/ui/SelectTable.js +2 -2
- package/es/ui/Sidebar/index.js +1 -1
- package/es/ui/Table/index.js +1 -1
- package/es/ui/TableCategory/index.js +5 -4
- package/es/ui/TableForm/index.js +46 -3
- package/es/ui/Tabs.js +4 -4
- package/es/ui/UploadComponent.js +1 -1
- package/es/ui/UploadImage.js +1 -1
- package/es/ui/index.js +50 -2
- package/package.json +2 -2
- package/types/constants/table.d.ts +2 -1
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Modal, Spin } from 'antd';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { isValidElement, version as version$1, useRef, useLayoutEffect, useEffect, Component, useContext, forwardRef, useMemo as useMemo$1, useState, Children, useImperativeHandle } from 'react';
|
|
5
|
-
import { b as useMemo, i as isFragment$1, L as LocaleContext, l as localeValues, c as useLayoutUpdateEffect, d as Context, _ as _toConsumableArray, u as unit, e as clearFix, f as textEllipsis, g as genStyleHooks, m as merge, r as resetComponent, h as defaultPrefixCls, j as genComponentStyleHook, w as warning, C as ConfigContext, k as useToken, S as SizeContext, n as devUseWarning, p as getAlphaColor, q as getLineHeight, s as genFocusStyle, v as resetIcon, x as genSubStyleComponent, a as useComponentConfig, D as DisabledContext,
|
|
5
|
+
import { b as useMemo, i as isFragment$1, L as LocaleContext, l as localeValues, c as useLayoutUpdateEffect, d as Context, _ as _toConsumableArray, u as unit, e as clearFix, f as textEllipsis, g as genStyleHooks, m as merge, r as resetComponent, h as defaultPrefixCls, j as genComponentStyleHook, w as warning, C as ConfigContext, k as useToken, S as SizeContext, n as devUseWarning, p as getAlphaColor, q as getLineHeight, s as genFocusStyle, v as resetIcon, x as genSubStyleComponent, a as useComponentConfig, D as DisabledContext, o as omit, y as useLayoutEffect$1, t as toArray$2 } from '../chunks/toArray-7SKWyzWi.js';
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
7
7
|
import ReactDOM__default, { createPortal, flushSync } from 'react-dom';
|
|
8
8
|
import { c as classNames } from '../chunks/index-xdC7i8zM.js';
|
|
@@ -12,7 +12,7 @@ import { _ as _typeof, b as _defineProperty } from '../chunks/defineProperty-CTL
|
|
|
12
12
|
import { R as RefIcon$7 } from '../chunks/LoadingOutlined-C5-PNVpb.js';
|
|
13
13
|
import { R as RefIcon$8, a as RefIcon$a } from '../chunks/CloseCircleFilled-4jnV3XJV.js';
|
|
14
14
|
import { R as RefIcon$9 } from '../chunks/CloseOutlined-DdLJZQvZ.js';
|
|
15
|
-
import { C as Controller } from '../chunks/index.esm-
|
|
15
|
+
import { C as Controller } from '../chunks/index.esm-Ds4t-z37.js';
|
|
16
16
|
import { toast } from '@pnkx-lib/core';
|
|
17
17
|
import { R as RefIcon$b } from '../chunks/InboxOutlined-W7xl_mLq.js';
|
|
18
18
|
|
|
@@ -1545,257 +1545,274 @@ function genCSSMotionList(transitionSupport) {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
const CSSMotionList = genCSSMotionList(supportTransition);
|
|
1547
1547
|
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1548
|
+
function _regeneratorRuntime() {
|
|
1549
|
+
_regeneratorRuntime = function _regeneratorRuntime() {
|
|
1550
|
+
return r;
|
|
1551
|
+
};
|
|
1552
|
+
var t,
|
|
1553
|
+
r = {},
|
|
1554
|
+
e = Object.prototype,
|
|
1555
|
+
n = e.hasOwnProperty,
|
|
1556
|
+
o = "function" == typeof Symbol ? Symbol : {},
|
|
1557
|
+
i = o.iterator || "@@iterator",
|
|
1558
|
+
a = o.asyncIterator || "@@asyncIterator",
|
|
1559
|
+
u = o.toStringTag || "@@toStringTag";
|
|
1560
|
+
function c(t, r, e, n) {
|
|
1561
|
+
return Object.defineProperty(t, r, {
|
|
1562
|
+
value: e,
|
|
1563
|
+
enumerable: !n,
|
|
1564
|
+
configurable: !n,
|
|
1565
|
+
writable: !n
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1554
1568
|
try {
|
|
1555
|
-
|
|
1556
|
-
} catch (
|
|
1557
|
-
|
|
1569
|
+
c({}, "");
|
|
1570
|
+
} catch (t) {
|
|
1571
|
+
c = function c(t, r, e) {
|
|
1572
|
+
return t[r] = e;
|
|
1573
|
+
};
|
|
1558
1574
|
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
function _regenerator() {
|
|
1575
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
1576
|
-
var e,
|
|
1577
|
-
t,
|
|
1578
|
-
r = "function" == typeof Symbol ? Symbol : {},
|
|
1579
|
-
n = r.iterator || "@@iterator",
|
|
1580
|
-
o = r.toStringTag || "@@toStringTag";
|
|
1581
|
-
function i(r, n, o, i) {
|
|
1582
|
-
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
1583
|
-
u = Object.create(c.prototype);
|
|
1584
|
-
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
1585
|
-
var i,
|
|
1586
|
-
c,
|
|
1587
|
-
u,
|
|
1588
|
-
f = 0,
|
|
1589
|
-
p = o || [],
|
|
1590
|
-
y = false,
|
|
1591
|
-
G = {
|
|
1592
|
-
p: 0,
|
|
1593
|
-
n: 0,
|
|
1594
|
-
v: e,
|
|
1595
|
-
a: d,
|
|
1596
|
-
f: d.bind(e, 4),
|
|
1597
|
-
d: function d(t, r) {
|
|
1598
|
-
return i = t, c = 0, u = e, G.n = r, a;
|
|
1599
|
-
}
|
|
1600
|
-
};
|
|
1601
|
-
function d(r, n) {
|
|
1602
|
-
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
1603
|
-
var o,
|
|
1604
|
-
i = p[t],
|
|
1605
|
-
d = G.p,
|
|
1606
|
-
l = i[2];
|
|
1607
|
-
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
1575
|
+
function h(r, e, n, o) {
|
|
1576
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
1577
|
+
a = Object.create(i.prototype);
|
|
1578
|
+
return c(a, "_invoke", function (r, e, n) {
|
|
1579
|
+
var o = 1;
|
|
1580
|
+
return function (i, a) {
|
|
1581
|
+
if (3 === o) throw Error("Generator is already running");
|
|
1582
|
+
if (4 === o) {
|
|
1583
|
+
if ("throw" === i) throw a;
|
|
1584
|
+
return {
|
|
1585
|
+
value: t,
|
|
1586
|
+
done: true
|
|
1587
|
+
};
|
|
1608
1588
|
}
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
if (f = 2, i) {
|
|
1618
|
-
if (c || (o = "next"), t = i[o]) {
|
|
1619
|
-
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
1620
|
-
if (!t.done) return t;
|
|
1621
|
-
u = t.value, c < 2 && (c = 0);
|
|
1622
|
-
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
1623
|
-
i = e;
|
|
1624
|
-
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
1625
|
-
} catch (t) {
|
|
1626
|
-
i = e, c = 1, u = t;
|
|
1627
|
-
} finally {
|
|
1628
|
-
f = 1;
|
|
1589
|
+
for (n.method = i, n.arg = a;;) {
|
|
1590
|
+
var u = n.delegate;
|
|
1591
|
+
if (u) {
|
|
1592
|
+
var c = d(u, n);
|
|
1593
|
+
if (c) {
|
|
1594
|
+
if (c === f) continue;
|
|
1595
|
+
return c;
|
|
1596
|
+
}
|
|
1629
1597
|
}
|
|
1598
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
1599
|
+
if (1 === o) throw o = 4, n.arg;
|
|
1600
|
+
n.dispatchException(n.arg);
|
|
1601
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
1602
|
+
o = 3;
|
|
1603
|
+
var h = s(r, e, n);
|
|
1604
|
+
if ("normal" === h.type) {
|
|
1605
|
+
if (o = n.done ? 4 : 2, h.arg === f) continue;
|
|
1606
|
+
return {
|
|
1607
|
+
value: h.arg,
|
|
1608
|
+
done: n.done
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
1630
1612
|
}
|
|
1631
|
-
return {
|
|
1632
|
-
value: t,
|
|
1633
|
-
done: y
|
|
1634
|
-
};
|
|
1635
1613
|
};
|
|
1636
|
-
}(r,
|
|
1614
|
+
}(r, n, new Context(o || [])), true), a;
|
|
1637
1615
|
}
|
|
1638
|
-
|
|
1639
|
-
function Generator() {}
|
|
1640
|
-
function GeneratorFunction() {}
|
|
1641
|
-
function GeneratorFunctionPrototype() {}
|
|
1642
|
-
t = Object.getPrototypeOf;
|
|
1643
|
-
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
1644
|
-
return this;
|
|
1645
|
-
}), t),
|
|
1646
|
-
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
1647
|
-
function f(e) {
|
|
1648
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
1649
|
-
}
|
|
1650
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
1651
|
-
return this;
|
|
1652
|
-
}), _regeneratorDefine(u, "toString", function () {
|
|
1653
|
-
return "[object Generator]";
|
|
1654
|
-
}), (_regenerator = function _regenerator() {
|
|
1655
|
-
return {
|
|
1656
|
-
w: i,
|
|
1657
|
-
m: f
|
|
1658
|
-
};
|
|
1659
|
-
})();
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
function AsyncIterator(t, e) {
|
|
1663
|
-
function n(r, o, i, f) {
|
|
1616
|
+
function s(t, r, e) {
|
|
1664
1617
|
try {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
}, function (t) {
|
|
1670
|
-
n("throw", t, i, f);
|
|
1671
|
-
}) : e.resolve(u).then(function (t) {
|
|
1672
|
-
c.value = t, i(c);
|
|
1673
|
-
}, function (t) {
|
|
1674
|
-
return n("throw", t, i, f);
|
|
1675
|
-
});
|
|
1618
|
+
return {
|
|
1619
|
+
type: "normal",
|
|
1620
|
+
arg: t.call(r, e)
|
|
1621
|
+
};
|
|
1676
1622
|
} catch (t) {
|
|
1677
|
-
|
|
1623
|
+
return {
|
|
1624
|
+
type: "throw",
|
|
1625
|
+
arg: t
|
|
1626
|
+
};
|
|
1678
1627
|
}
|
|
1679
1628
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1629
|
+
r.wrap = h;
|
|
1630
|
+
var f = {};
|
|
1631
|
+
function Generator() {}
|
|
1632
|
+
function GeneratorFunction() {}
|
|
1633
|
+
function GeneratorFunctionPrototype() {}
|
|
1634
|
+
var l = {};
|
|
1635
|
+
c(l, i, function () {
|
|
1682
1636
|
return this;
|
|
1683
|
-
})
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1637
|
+
});
|
|
1638
|
+
var p = Object.getPrototypeOf,
|
|
1639
|
+
y = p && p(p(x([])));
|
|
1640
|
+
y && y !== e && n.call(y, i) && (l = y);
|
|
1641
|
+
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
|
|
1642
|
+
function g(t) {
|
|
1643
|
+
["next", "throw", "return"].forEach(function (r) {
|
|
1644
|
+
c(t, r, function (t) {
|
|
1645
|
+
return this._invoke(r, t);
|
|
1687
1646
|
});
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
function AsyncIterator(t, r) {
|
|
1650
|
+
function e(o, i, a, u) {
|
|
1651
|
+
var c = s(t[o], t, i);
|
|
1652
|
+
if ("throw" !== c.type) {
|
|
1653
|
+
var h = c.arg,
|
|
1654
|
+
f = h.value;
|
|
1655
|
+
return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
1656
|
+
e("next", t, a, u);
|
|
1657
|
+
}, function (t) {
|
|
1658
|
+
e("throw", t, a, u);
|
|
1659
|
+
}) : r.resolve(f).then(function (t) {
|
|
1660
|
+
h.value = t, a(h);
|
|
1661
|
+
}, function (t) {
|
|
1662
|
+
return e("throw", t, a, u);
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
u(c.arg);
|
|
1688
1666
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
function _regeneratorAsync(n, e, r, t, o) {
|
|
1698
|
-
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
1699
|
-
return a.next().then(function (n) {
|
|
1700
|
-
return n.done ? n.value : a.next();
|
|
1701
|
-
});
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
function _regeneratorKeys(e) {
|
|
1705
|
-
var n = Object(e),
|
|
1706
|
-
r = [];
|
|
1707
|
-
for (var t in n) r.unshift(t);
|
|
1708
|
-
return function e() {
|
|
1709
|
-
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
1710
|
-
return e.done = true, e;
|
|
1711
|
-
};
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
function _regeneratorValues(e) {
|
|
1715
|
-
if (null != e) {
|
|
1716
|
-
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
1717
|
-
r = 0;
|
|
1718
|
-
if (t) return t.call(e);
|
|
1719
|
-
if ("function" == typeof e.next) return e;
|
|
1720
|
-
if (!isNaN(e.length)) return {
|
|
1721
|
-
next: function next() {
|
|
1722
|
-
return e && r >= e.length && (e = void 0), {
|
|
1723
|
-
value: e && e[r++],
|
|
1724
|
-
done: !e
|
|
1725
|
-
};
|
|
1667
|
+
var o;
|
|
1668
|
+
c(this, "_invoke", function (t, n) {
|
|
1669
|
+
function i() {
|
|
1670
|
+
return new r(function (r, o) {
|
|
1671
|
+
e(t, n, r, o);
|
|
1672
|
+
});
|
|
1726
1673
|
}
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
e =
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
"
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
1762
|
-
},
|
|
1763
|
-
finish: function finish(r) {
|
|
1764
|
-
return t(n.f, r);
|
|
1765
|
-
}
|
|
1766
|
-
}, t = function t(r, _t, o) {
|
|
1767
|
-
n.p = e.prev, n.n = e.next;
|
|
1768
|
-
try {
|
|
1769
|
-
return r(_t, o);
|
|
1770
|
-
} finally {
|
|
1771
|
-
e.next = n.n;
|
|
1772
|
-
}
|
|
1773
|
-
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
1774
|
-
try {
|
|
1775
|
-
return r.call(this, e);
|
|
1776
|
-
} finally {
|
|
1777
|
-
n.p = e.prev, n.n = e.next;
|
|
1674
|
+
return o = o ? o.then(i, i) : i();
|
|
1675
|
+
}, true);
|
|
1676
|
+
}
|
|
1677
|
+
function d(r, e) {
|
|
1678
|
+
var n = e.method,
|
|
1679
|
+
o = r.i[n];
|
|
1680
|
+
if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
|
|
1681
|
+
var i = s(o, r.i, e.arg);
|
|
1682
|
+
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
1683
|
+
var a = i.arg;
|
|
1684
|
+
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
|
|
1685
|
+
}
|
|
1686
|
+
function w(t) {
|
|
1687
|
+
this.tryEntries.push(t);
|
|
1688
|
+
}
|
|
1689
|
+
function m(r) {
|
|
1690
|
+
var e = r[4] || {};
|
|
1691
|
+
e.type = "normal", e.arg = t, r[4] = e;
|
|
1692
|
+
}
|
|
1693
|
+
function Context(t) {
|
|
1694
|
+
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
|
|
1695
|
+
}
|
|
1696
|
+
function x(r) {
|
|
1697
|
+
if (null != r) {
|
|
1698
|
+
var e = r[i];
|
|
1699
|
+
if (e) return e.call(r);
|
|
1700
|
+
if ("function" == typeof r.next) return r;
|
|
1701
|
+
if (!isNaN(r.length)) {
|
|
1702
|
+
var o = -1,
|
|
1703
|
+
a = function e() {
|
|
1704
|
+
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
|
|
1705
|
+
return e.value = t, e.done = true, e;
|
|
1706
|
+
};
|
|
1707
|
+
return a.next = a;
|
|
1778
1708
|
}
|
|
1779
|
-
}
|
|
1709
|
+
}
|
|
1710
|
+
throw new TypeError(_typeof(r) + " is not iterable");
|
|
1780
1711
|
}
|
|
1781
|
-
return (
|
|
1712
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) {
|
|
1713
|
+
var r = "function" == typeof t && t.constructor;
|
|
1714
|
+
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
1715
|
+
}, r.mark = function (t) {
|
|
1716
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
1717
|
+
}, r.awrap = function (t) {
|
|
1782
1718
|
return {
|
|
1783
|
-
|
|
1784
|
-
return r.w(a(e), t, n, o && o.reverse());
|
|
1785
|
-
},
|
|
1786
|
-
isGeneratorFunction: n,
|
|
1787
|
-
mark: r.m,
|
|
1788
|
-
awrap: function awrap(r, e) {
|
|
1789
|
-
return new _OverloadYield(r, e);
|
|
1790
|
-
},
|
|
1791
|
-
AsyncIterator: AsyncIterator,
|
|
1792
|
-
async: function async(r, e, t, o, u) {
|
|
1793
|
-
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
1794
|
-
},
|
|
1795
|
-
keys: _regeneratorKeys,
|
|
1796
|
-
values: _regeneratorValues
|
|
1719
|
+
__await: t
|
|
1797
1720
|
};
|
|
1798
|
-
})()
|
|
1721
|
+
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
1722
|
+
return this;
|
|
1723
|
+
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
|
|
1724
|
+
void 0 === i && (i = Promise);
|
|
1725
|
+
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
1726
|
+
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
1727
|
+
return t.done ? t.value : a.next();
|
|
1728
|
+
});
|
|
1729
|
+
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
1730
|
+
return this;
|
|
1731
|
+
}), c(v, "toString", function () {
|
|
1732
|
+
return "[object Generator]";
|
|
1733
|
+
}), r.keys = function (t) {
|
|
1734
|
+
var r = Object(t),
|
|
1735
|
+
e = [];
|
|
1736
|
+
for (var n in r) e.unshift(n);
|
|
1737
|
+
return function t() {
|
|
1738
|
+
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
|
|
1739
|
+
return t.done = true, t;
|
|
1740
|
+
};
|
|
1741
|
+
}, r.values = x, Context.prototype = {
|
|
1742
|
+
constructor: Context,
|
|
1743
|
+
reset: function reset(r) {
|
|
1744
|
+
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
|
|
1745
|
+
},
|
|
1746
|
+
stop: function stop() {
|
|
1747
|
+
this.done = true;
|
|
1748
|
+
var t = this.tryEntries[0][4];
|
|
1749
|
+
if ("throw" === t.type) throw t.arg;
|
|
1750
|
+
return this.rval;
|
|
1751
|
+
},
|
|
1752
|
+
dispatchException: function dispatchException(r) {
|
|
1753
|
+
if (this.done) throw r;
|
|
1754
|
+
var e = this;
|
|
1755
|
+
function n(t) {
|
|
1756
|
+
a.type = "throw", a.arg = r, e.next = t;
|
|
1757
|
+
}
|
|
1758
|
+
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
|
|
1759
|
+
var i = this.tryEntries[o],
|
|
1760
|
+
a = i[4],
|
|
1761
|
+
u = this.prev,
|
|
1762
|
+
c = i[1],
|
|
1763
|
+
h = i[2];
|
|
1764
|
+
if (-1 === i[0]) return n("end"), false;
|
|
1765
|
+
if (!c && !h) throw Error("try statement without catch or finally");
|
|
1766
|
+
if (null != i[0] && i[0] <= u) {
|
|
1767
|
+
if (u < c) return this.method = "next", this.arg = t, n(c), true;
|
|
1768
|
+
if (u < h) return n(h), false;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
},
|
|
1772
|
+
abrupt: function abrupt(t, r) {
|
|
1773
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
1774
|
+
var n = this.tryEntries[e];
|
|
1775
|
+
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
|
|
1776
|
+
var o = n;
|
|
1777
|
+
break;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
|
|
1781
|
+
var i = o ? o[4] : {};
|
|
1782
|
+
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
|
|
1783
|
+
},
|
|
1784
|
+
complete: function complete(t, r) {
|
|
1785
|
+
if ("throw" === t.type) throw t.arg;
|
|
1786
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
|
|
1787
|
+
},
|
|
1788
|
+
finish: function finish(t) {
|
|
1789
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
1790
|
+
var e = this.tryEntries[r];
|
|
1791
|
+
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
"catch": function _catch(t) {
|
|
1795
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
1796
|
+
var e = this.tryEntries[r];
|
|
1797
|
+
if (e[0] === t) {
|
|
1798
|
+
var n = e[4];
|
|
1799
|
+
if ("throw" === n.type) {
|
|
1800
|
+
var o = n.arg;
|
|
1801
|
+
m(e);
|
|
1802
|
+
}
|
|
1803
|
+
return o;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
throw Error("illegal catch attempt");
|
|
1807
|
+
},
|
|
1808
|
+
delegateYield: function delegateYield(r, e, n) {
|
|
1809
|
+
return this.delegate = {
|
|
1810
|
+
i: x(r),
|
|
1811
|
+
r: e,
|
|
1812
|
+
n: n
|
|
1813
|
+
}, "next" === this.method && (this.arg = t), f;
|
|
1814
|
+
}
|
|
1815
|
+
}, r;
|
|
1799
1816
|
}
|
|
1800
1817
|
|
|
1801
1818
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -2234,26 +2251,26 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2234
2251
|
_this.onClick(e);
|
|
2235
2252
|
}
|
|
2236
2253
|
});
|
|
2237
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
2238
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
2239
|
-
var
|
|
2254
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDrop", /*#__PURE__*/function () {
|
|
2255
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
|
2256
|
+
var multiple, files, _files;
|
|
2240
2257
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2241
2258
|
while (1) switch (_context.prev = _context.next) {
|
|
2242
2259
|
case 0:
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
})) {
|
|
2249
|
-
existFileCallback === null || existFileCallback === void 0 || existFileCallback();
|
|
2260
|
+
multiple = _this.props.multiple;
|
|
2261
|
+
e.preventDefault();
|
|
2262
|
+
if (!(e.type === 'dragover')) {
|
|
2263
|
+
_context.next = 4;
|
|
2264
|
+
break;
|
|
2250
2265
|
}
|
|
2251
|
-
|
|
2266
|
+
return _context.abrupt("return");
|
|
2267
|
+
case 4:
|
|
2268
|
+
if (!_this.props.directory) {
|
|
2252
2269
|
_context.next = 11;
|
|
2253
2270
|
break;
|
|
2254
2271
|
}
|
|
2255
2272
|
_context.next = 7;
|
|
2256
|
-
return traverseFileTree(Array.prototype.slice.call(items), function (_file) {
|
|
2273
|
+
return traverseFileTree(Array.prototype.slice.call(e.dataTransfer.items), function (_file) {
|
|
2257
2274
|
return attrAccept(_file, _this.props.accept);
|
|
2258
2275
|
});
|
|
2259
2276
|
case 7:
|
|
@@ -2262,80 +2279,23 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2262
2279
|
_context.next = 14;
|
|
2263
2280
|
break;
|
|
2264
2281
|
case 11:
|
|
2265
|
-
|
|
2266
|
-
return attrAccept(file, accept);
|
|
2282
|
+
_files = _toConsumableArray(e.dataTransfer.files).filter(function (file) {
|
|
2283
|
+
return attrAccept(file, _this.props.accept);
|
|
2267
2284
|
});
|
|
2268
2285
|
if (multiple === false) {
|
|
2269
|
-
|
|
2286
|
+
_files = _files.slice(0, 1);
|
|
2270
2287
|
}
|
|
2271
|
-
_this.uploadFiles(
|
|
2288
|
+
_this.uploadFiles(_files);
|
|
2272
2289
|
case 14:
|
|
2273
2290
|
case "end":
|
|
2274
2291
|
return _context.stop();
|
|
2275
2292
|
}
|
|
2276
2293
|
}, _callee);
|
|
2277
2294
|
}));
|
|
2278
|
-
return function (_x
|
|
2295
|
+
return function (_x) {
|
|
2279
2296
|
return _ref.apply(this, arguments);
|
|
2280
2297
|
};
|
|
2281
2298
|
}());
|
|
2282
|
-
_defineProperty(_assertThisInitialized(_this), "onFilePaste", /*#__PURE__*/function () {
|
|
2283
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
2284
|
-
var pastable, clipboardData;
|
|
2285
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2286
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
2287
|
-
case 0:
|
|
2288
|
-
pastable = _this.props.pastable;
|
|
2289
|
-
if (pastable) {
|
|
2290
|
-
_context2.next = 3;
|
|
2291
|
-
break;
|
|
2292
|
-
}
|
|
2293
|
-
return _context2.abrupt("return");
|
|
2294
|
-
case 3:
|
|
2295
|
-
if (!(e.type === 'paste')) {
|
|
2296
|
-
_context2.next = 6;
|
|
2297
|
-
break;
|
|
2298
|
-
}
|
|
2299
|
-
clipboardData = e.clipboardData;
|
|
2300
|
-
return _context2.abrupt("return", _this.onDataTransferFiles(clipboardData, function () {
|
|
2301
|
-
e.preventDefault();
|
|
2302
|
-
}));
|
|
2303
|
-
case 6:
|
|
2304
|
-
case "end":
|
|
2305
|
-
return _context2.stop();
|
|
2306
|
-
}
|
|
2307
|
-
}, _callee2);
|
|
2308
|
-
}));
|
|
2309
|
-
return function (_x3) {
|
|
2310
|
-
return _ref2.apply(this, arguments);
|
|
2311
|
-
};
|
|
2312
|
-
}());
|
|
2313
|
-
_defineProperty(_assertThisInitialized(_this), "onFileDragOver", function (e) {
|
|
2314
|
-
e.preventDefault();
|
|
2315
|
-
});
|
|
2316
|
-
_defineProperty(_assertThisInitialized(_this), "onFileDrop", /*#__PURE__*/function () {
|
|
2317
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
|
|
2318
|
-
var dataTransfer;
|
|
2319
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2320
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
2321
|
-
case 0:
|
|
2322
|
-
e.preventDefault();
|
|
2323
|
-
if (!(e.type === 'drop')) {
|
|
2324
|
-
_context3.next = 4;
|
|
2325
|
-
break;
|
|
2326
|
-
}
|
|
2327
|
-
dataTransfer = e.dataTransfer;
|
|
2328
|
-
return _context3.abrupt("return", _this.onDataTransferFiles(dataTransfer));
|
|
2329
|
-
case 4:
|
|
2330
|
-
case "end":
|
|
2331
|
-
return _context3.stop();
|
|
2332
|
-
}
|
|
2333
|
-
}, _callee3);
|
|
2334
|
-
}));
|
|
2335
|
-
return function (_x4) {
|
|
2336
|
-
return _ref3.apply(this, arguments);
|
|
2337
|
-
};
|
|
2338
|
-
}());
|
|
2339
2299
|
_defineProperty(_assertThisInitialized(_this), "uploadFiles", function (files) {
|
|
2340
2300
|
var originFiles = _toConsumableArray(files);
|
|
2341
2301
|
var postFiles = originFiles.map(function (file) {
|
|
@@ -2347,9 +2307,9 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2347
2307
|
// Batch upload files
|
|
2348
2308
|
Promise.all(postFiles).then(function (fileList) {
|
|
2349
2309
|
var onBatchStart = _this.props.onBatchStart;
|
|
2350
|
-
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (
|
|
2351
|
-
var origin =
|
|
2352
|
-
parsedFile =
|
|
2310
|
+
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (_ref2) {
|
|
2311
|
+
var origin = _ref2.origin,
|
|
2312
|
+
parsedFile = _ref2.parsedFile;
|
|
2353
2313
|
return {
|
|
2354
2314
|
file: origin,
|
|
2355
2315
|
parsedFile: parsedFile
|
|
@@ -2366,35 +2326,35 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2366
2326
|
* Process file before upload. When all the file is ready, we start upload.
|
|
2367
2327
|
*/
|
|
2368
2328
|
_defineProperty(_assertThisInitialized(_this), "processFile", /*#__PURE__*/function () {
|
|
2369
|
-
var
|
|
2329
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, fileList) {
|
|
2370
2330
|
var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;
|
|
2371
|
-
return _regeneratorRuntime().wrap(function
|
|
2372
|
-
while (1) switch (
|
|
2331
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2332
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
2373
2333
|
case 0:
|
|
2374
2334
|
beforeUpload = _this.props.beforeUpload;
|
|
2375
2335
|
transformedFile = file;
|
|
2376
2336
|
if (!beforeUpload) {
|
|
2377
|
-
|
|
2337
|
+
_context2.next = 14;
|
|
2378
2338
|
break;
|
|
2379
2339
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2340
|
+
_context2.prev = 3;
|
|
2341
|
+
_context2.next = 6;
|
|
2382
2342
|
return beforeUpload(file, fileList);
|
|
2383
2343
|
case 6:
|
|
2384
|
-
transformedFile =
|
|
2385
|
-
|
|
2344
|
+
transformedFile = _context2.sent;
|
|
2345
|
+
_context2.next = 12;
|
|
2386
2346
|
break;
|
|
2387
2347
|
case 9:
|
|
2388
|
-
|
|
2389
|
-
|
|
2348
|
+
_context2.prev = 9;
|
|
2349
|
+
_context2.t0 = _context2["catch"](3);
|
|
2390
2350
|
// Rejection will also trade as false
|
|
2391
2351
|
transformedFile = false;
|
|
2392
2352
|
case 12:
|
|
2393
2353
|
if (!(transformedFile === false)) {
|
|
2394
|
-
|
|
2354
|
+
_context2.next = 14;
|
|
2395
2355
|
break;
|
|
2396
2356
|
}
|
|
2397
|
-
return
|
|
2357
|
+
return _context2.abrupt("return", {
|
|
2398
2358
|
origin: file,
|
|
2399
2359
|
parsedFile: null,
|
|
2400
2360
|
action: null,
|
|
@@ -2404,14 +2364,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2404
2364
|
// Get latest action
|
|
2405
2365
|
action = _this.props.action;
|
|
2406
2366
|
if (!(typeof action === 'function')) {
|
|
2407
|
-
|
|
2367
|
+
_context2.next = 21;
|
|
2408
2368
|
break;
|
|
2409
2369
|
}
|
|
2410
|
-
|
|
2370
|
+
_context2.next = 18;
|
|
2411
2371
|
return action(file);
|
|
2412
2372
|
case 18:
|
|
2413
|
-
mergedAction =
|
|
2414
|
-
|
|
2373
|
+
mergedAction = _context2.sent;
|
|
2374
|
+
_context2.next = 22;
|
|
2415
2375
|
break;
|
|
2416
2376
|
case 21:
|
|
2417
2377
|
mergedAction = action;
|
|
@@ -2419,14 +2379,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2419
2379
|
// Get latest data
|
|
2420
2380
|
data = _this.props.data;
|
|
2421
2381
|
if (!(typeof data === 'function')) {
|
|
2422
|
-
|
|
2382
|
+
_context2.next = 29;
|
|
2423
2383
|
break;
|
|
2424
2384
|
}
|
|
2425
|
-
|
|
2385
|
+
_context2.next = 26;
|
|
2426
2386
|
return data(file);
|
|
2427
2387
|
case 26:
|
|
2428
|
-
mergedData =
|
|
2429
|
-
|
|
2388
|
+
mergedData = _context2.sent;
|
|
2389
|
+
_context2.next = 30;
|
|
2430
2390
|
break;
|
|
2431
2391
|
case 29:
|
|
2432
2392
|
mergedData = data;
|
|
@@ -2444,7 +2404,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2444
2404
|
}
|
|
2445
2405
|
mergedParsedFile = parsedFile;
|
|
2446
2406
|
mergedParsedFile.uid = file.uid;
|
|
2447
|
-
return
|
|
2407
|
+
return _context2.abrupt("return", {
|
|
2448
2408
|
origin: file,
|
|
2449
2409
|
data: mergedData,
|
|
2450
2410
|
parsedFile: mergedParsedFile,
|
|
@@ -2452,12 +2412,12 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2452
2412
|
});
|
|
2453
2413
|
case 35:
|
|
2454
2414
|
case "end":
|
|
2455
|
-
return
|
|
2415
|
+
return _context2.stop();
|
|
2456
2416
|
}
|
|
2457
|
-
},
|
|
2417
|
+
}, _callee2, null, [[3, 9]]);
|
|
2458
2418
|
}));
|
|
2459
|
-
return function (
|
|
2460
|
-
return
|
|
2419
|
+
return function (_x2, _x3) {
|
|
2420
|
+
return _ref3.apply(this, arguments);
|
|
2461
2421
|
};
|
|
2462
2422
|
}());
|
|
2463
2423
|
_defineProperty(_assertThisInitialized(_this), "saveFileInput", function (node) {
|
|
@@ -2469,46 +2429,31 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2469
2429
|
key: "componentDidMount",
|
|
2470
2430
|
value: function componentDidMount() {
|
|
2471
2431
|
this._isMounted = true;
|
|
2472
|
-
var pastable = this.props.pastable;
|
|
2473
|
-
if (pastable) {
|
|
2474
|
-
document.addEventListener('paste', this.onFilePaste);
|
|
2475
|
-
}
|
|
2476
2432
|
}
|
|
2477
2433
|
}, {
|
|
2478
2434
|
key: "componentWillUnmount",
|
|
2479
2435
|
value: function componentWillUnmount() {
|
|
2480
2436
|
this._isMounted = false;
|
|
2481
2437
|
this.abort();
|
|
2482
|
-
document.removeEventListener('paste', this.onFilePaste);
|
|
2483
|
-
}
|
|
2484
|
-
}, {
|
|
2485
|
-
key: "componentDidUpdate",
|
|
2486
|
-
value: function componentDidUpdate(prevProps) {
|
|
2487
|
-
var pastable = this.props.pastable;
|
|
2488
|
-
if (pastable && !prevProps.pastable) {
|
|
2489
|
-
document.addEventListener('paste', this.onFilePaste);
|
|
2490
|
-
} else if (!pastable && prevProps.pastable) {
|
|
2491
|
-
document.removeEventListener('paste', this.onFilePaste);
|
|
2492
|
-
}
|
|
2493
2438
|
}
|
|
2494
2439
|
}, {
|
|
2495
2440
|
key: "post",
|
|
2496
|
-
value: function post(
|
|
2441
|
+
value: function post(_ref4) {
|
|
2497
2442
|
var _this2 = this;
|
|
2498
|
-
var data =
|
|
2499
|
-
origin =
|
|
2500
|
-
action =
|
|
2501
|
-
parsedFile =
|
|
2443
|
+
var data = _ref4.data,
|
|
2444
|
+
origin = _ref4.origin,
|
|
2445
|
+
action = _ref4.action,
|
|
2446
|
+
parsedFile = _ref4.parsedFile;
|
|
2502
2447
|
if (!this._isMounted) {
|
|
2503
2448
|
return;
|
|
2504
2449
|
}
|
|
2505
|
-
var _this$
|
|
2506
|
-
onStart = _this$
|
|
2507
|
-
customRequest = _this$
|
|
2508
|
-
name = _this$
|
|
2509
|
-
headers = _this$
|
|
2510
|
-
withCredentials = _this$
|
|
2511
|
-
method = _this$
|
|
2450
|
+
var _this$props2 = this.props,
|
|
2451
|
+
onStart = _this$props2.onStart,
|
|
2452
|
+
customRequest = _this$props2.customRequest,
|
|
2453
|
+
name = _this$props2.name,
|
|
2454
|
+
headers = _this$props2.headers,
|
|
2455
|
+
withCredentials = _this$props2.withCredentials,
|
|
2456
|
+
method = _this$props2.method;
|
|
2512
2457
|
var uid = origin.uid;
|
|
2513
2458
|
var request = customRequest || upload;
|
|
2514
2459
|
var requestOption = {
|
|
@@ -2566,28 +2511,28 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2566
2511
|
}, {
|
|
2567
2512
|
key: "render",
|
|
2568
2513
|
value: function render() {
|
|
2569
|
-
var _this$
|
|
2570
|
-
Tag = _this$
|
|
2571
|
-
prefixCls = _this$
|
|
2572
|
-
className = _this$
|
|
2573
|
-
_this$
|
|
2574
|
-
classNames$1 = _this$
|
|
2575
|
-
disabled = _this$
|
|
2576
|
-
id = _this$
|
|
2577
|
-
name = _this$
|
|
2578
|
-
style = _this$
|
|
2579
|
-
_this$
|
|
2580
|
-
styles = _this$
|
|
2581
|
-
multiple = _this$
|
|
2582
|
-
accept = _this$
|
|
2583
|
-
capture = _this$
|
|
2584
|
-
children = _this$
|
|
2585
|
-
directory = _this$
|
|
2586
|
-
openFileDialogOnClick = _this$
|
|
2587
|
-
onMouseEnter = _this$
|
|
2588
|
-
onMouseLeave = _this$
|
|
2589
|
-
hasControlInside = _this$
|
|
2590
|
-
otherProps = _objectWithoutProperties(_this$
|
|
2514
|
+
var _this$props3 = this.props,
|
|
2515
|
+
Tag = _this$props3.component,
|
|
2516
|
+
prefixCls = _this$props3.prefixCls,
|
|
2517
|
+
className = _this$props3.className,
|
|
2518
|
+
_this$props3$classNam = _this$props3.classNames,
|
|
2519
|
+
classNames$1 = _this$props3$classNam === void 0 ? {} : _this$props3$classNam,
|
|
2520
|
+
disabled = _this$props3.disabled,
|
|
2521
|
+
id = _this$props3.id,
|
|
2522
|
+
name = _this$props3.name,
|
|
2523
|
+
style = _this$props3.style,
|
|
2524
|
+
_this$props3$styles = _this$props3.styles,
|
|
2525
|
+
styles = _this$props3$styles === void 0 ? {} : _this$props3$styles,
|
|
2526
|
+
multiple = _this$props3.multiple,
|
|
2527
|
+
accept = _this$props3.accept,
|
|
2528
|
+
capture = _this$props3.capture,
|
|
2529
|
+
children = _this$props3.children,
|
|
2530
|
+
directory = _this$props3.directory,
|
|
2531
|
+
openFileDialogOnClick = _this$props3.openFileDialogOnClick,
|
|
2532
|
+
onMouseEnter = _this$props3.onMouseEnter,
|
|
2533
|
+
onMouseLeave = _this$props3.onMouseLeave,
|
|
2534
|
+
hasControlInside = _this$props3.hasControlInside,
|
|
2535
|
+
otherProps = _objectWithoutProperties(_this$props3, _excluded$4);
|
|
2591
2536
|
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), "".concat(prefixCls, "-disabled"), disabled), className, className));
|
|
2592
2537
|
// because input don't have directory/webkitdirectory type declaration
|
|
2593
2538
|
var dirProps = directory ? {
|
|
@@ -2600,7 +2545,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2600
2545
|
onMouseEnter: onMouseEnter,
|
|
2601
2546
|
onMouseLeave: onMouseLeave,
|
|
2602
2547
|
onDrop: this.onFileDrop,
|
|
2603
|
-
onDragOver: this.
|
|
2548
|
+
onDragOver: this.onFileDrop,
|
|
2604
2549
|
tabIndex: hasControlInside ? undefined : '0'
|
|
2605
2550
|
};
|
|
2606
2551
|
return /*#__PURE__*/React__default.createElement(Tag, _extends({}, events, {
|
|
@@ -2718,7 +2663,8 @@ const initMotionCommonLeave = duration => ({
|
|
|
2718
2663
|
animationDuration: duration,
|
|
2719
2664
|
animationFillMode: 'both'
|
|
2720
2665
|
});
|
|
2721
|
-
const initMotion = (motionCls, inKeyframes, outKeyframes, duration
|
|
2666
|
+
const initMotion = function (motionCls, inKeyframes, outKeyframes, duration) {
|
|
2667
|
+
let sameLevel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
2722
2668
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
|
2723
2669
|
return {
|
|
2724
2670
|
[`
|
|
@@ -2761,7 +2707,8 @@ const fadeOut = new Keyframe('antFadeOut', {
|
|
|
2761
2707
|
opacity: 0
|
|
2762
2708
|
}
|
|
2763
2709
|
});
|
|
2764
|
-
const initFadeMotion = (token
|
|
2710
|
+
const initFadeMotion = function (token) {
|
|
2711
|
+
let sameLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2765
2712
|
const {
|
|
2766
2713
|
antCls
|
|
2767
2714
|
} = token;
|
|
@@ -3084,7 +3031,7 @@ const genListStyle = token => {
|
|
|
3084
3031
|
}
|
|
3085
3032
|
},
|
|
3086
3033
|
[`${componentCls}-icon ${iconCls}`]: {
|
|
3087
|
-
color: token.
|
|
3034
|
+
color: token.colorTextDescription,
|
|
3088
3035
|
fontSize
|
|
3089
3036
|
},
|
|
3090
3037
|
[`${itemCls}-progress`]: {
|
|
@@ -3443,7 +3390,7 @@ const genBaseStyle$1 = token => {
|
|
|
3443
3390
|
};
|
|
3444
3391
|
};
|
|
3445
3392
|
const prepareComponentToken$3 = token => ({
|
|
3446
|
-
actionsColor: token.
|
|
3393
|
+
actionsColor: token.colorTextDescription
|
|
3447
3394
|
});
|
|
3448
3395
|
// ============================== Export ==============================
|
|
3449
3396
|
const useStyle$4 = genStyleHooks('Upload', token => {
|
|
@@ -3485,19 +3432,22 @@ const getCurrentHeight = node => ({
|
|
|
3485
3432
|
height: node ? node.offsetHeight : 0
|
|
3486
3433
|
});
|
|
3487
3434
|
const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
3488
|
-
const initCollapseMotion = (
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3435
|
+
const initCollapseMotion = function () {
|
|
3436
|
+
let rootCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultPrefixCls;
|
|
3437
|
+
return {
|
|
3438
|
+
motionName: `${rootCls}-motion-collapse`,
|
|
3439
|
+
onAppearStart: getCollapsedHeight,
|
|
3440
|
+
onEnterStart: getCollapsedHeight,
|
|
3441
|
+
onAppearActive: getRealHeight,
|
|
3442
|
+
onEnterActive: getRealHeight,
|
|
3443
|
+
onLeaveStart: getCurrentHeight,
|
|
3444
|
+
onLeaveActive: getCollapsedHeight,
|
|
3445
|
+
onAppearEnd: skipOpacityTransition,
|
|
3446
|
+
onEnterEnd: skipOpacityTransition,
|
|
3447
|
+
onLeaveEnd: skipOpacityTransition,
|
|
3448
|
+
motionDeadline: 500
|
|
3449
|
+
};
|
|
3450
|
+
};
|
|
3501
3451
|
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
|
|
3502
3452
|
if (transitionName !== undefined) {
|
|
3503
3453
|
return transitionName;
|
|
@@ -3574,7 +3524,7 @@ const genWaveStyle = token => {
|
|
|
3574
3524
|
}
|
|
3575
3525
|
};
|
|
3576
3526
|
};
|
|
3577
|
-
const useStyle$3 = genComponentStyleHook('Wave', genWaveStyle);
|
|
3527
|
+
const useStyle$3 = genComponentStyleHook('Wave', token => [genWaveStyle(token)]);
|
|
3578
3528
|
|
|
3579
3529
|
const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
|
|
3580
3530
|
|
|
@@ -3683,28 +3633,31 @@ const defaultReactRender = (node, container) => {
|
|
|
3683
3633
|
};
|
|
3684
3634
|
};
|
|
3685
3635
|
let unstableRender = defaultReactRender;
|
|
3686
|
-
|
|
3687
|
-
* @deprecated Set React render function for compatible usage.
|
|
3688
|
-
* This is internal usage only compatible with React 19.
|
|
3689
|
-
* And will be removed in next major version.
|
|
3690
|
-
*/
|
|
3691
|
-
function unstableSetRender(render) {
|
|
3636
|
+
function getReactRender() {
|
|
3692
3637
|
return unstableRender;
|
|
3693
3638
|
}
|
|
3694
3639
|
|
|
3695
3640
|
function isValidWaveColor(color) {
|
|
3696
3641
|
return color && color !== '#fff' && color !== '#ffffff' && color !== 'rgb(255, 255, 255)' && color !== 'rgba(255, 255, 255, 1)' && !/rgba\((?:\d*, ){3}0\)/.test(color) &&
|
|
3697
3642
|
// any transparent rgba color
|
|
3698
|
-
color !== 'transparent'
|
|
3643
|
+
color !== 'transparent';
|
|
3699
3644
|
}
|
|
3700
3645
|
function getTargetWaveColor(node) {
|
|
3701
|
-
var _a;
|
|
3702
3646
|
const {
|
|
3703
3647
|
borderTopColor,
|
|
3704
3648
|
borderColor,
|
|
3705
3649
|
backgroundColor
|
|
3706
3650
|
} = getComputedStyle(node);
|
|
3707
|
-
|
|
3651
|
+
if (isValidWaveColor(borderTopColor)) {
|
|
3652
|
+
return borderTopColor;
|
|
3653
|
+
}
|
|
3654
|
+
if (isValidWaveColor(borderColor)) {
|
|
3655
|
+
return borderColor;
|
|
3656
|
+
}
|
|
3657
|
+
if (isValidWaveColor(backgroundColor)) {
|
|
3658
|
+
return backgroundColor;
|
|
3659
|
+
}
|
|
3660
|
+
return null;
|
|
3708
3661
|
}
|
|
3709
3662
|
|
|
3710
3663
|
function validateNum(value) {
|
|
@@ -3803,15 +3756,18 @@ const WaveEffect = props => {
|
|
|
3803
3756
|
}
|
|
3804
3757
|
return false;
|
|
3805
3758
|
}
|
|
3806
|
-
}, ({
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3759
|
+
}, (_ref, ref) => {
|
|
3760
|
+
let {
|
|
3761
|
+
className: motionClassName
|
|
3762
|
+
} = _ref;
|
|
3763
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3764
|
+
ref: composeRef(divRef, ref),
|
|
3765
|
+
className: classNames(className, motionClassName, {
|
|
3766
|
+
'wave-quick': isSmallComponent
|
|
3767
|
+
}),
|
|
3768
|
+
style: waveStyle
|
|
3769
|
+
});
|
|
3770
|
+
});
|
|
3815
3771
|
};
|
|
3816
3772
|
const showWaveEffect = (target, info) => {
|
|
3817
3773
|
var _a;
|
|
@@ -3828,7 +3784,7 @@ const showWaveEffect = (target, info) => {
|
|
|
3828
3784
|
holder.style.left = '0px';
|
|
3829
3785
|
holder.style.top = '0px';
|
|
3830
3786
|
target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
|
|
3831
|
-
const reactRender =
|
|
3787
|
+
const reactRender = getReactRender();
|
|
3832
3788
|
let unmountCallback = null;
|
|
3833
3789
|
function registerUnmount() {
|
|
3834
3790
|
return unmountCallback;
|
|
@@ -4140,10 +4096,11 @@ const DefaultLoadingIcon = props => {
|
|
|
4140
4096
|
onEnterActive: getRealWidth,
|
|
4141
4097
|
onLeaveStart: getRealWidth,
|
|
4142
4098
|
onLeaveActive: getCollapsedWidth
|
|
4143
|
-
}, ({
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4099
|
+
}, (_ref, ref) => {
|
|
4100
|
+
let {
|
|
4101
|
+
className: motionCls,
|
|
4102
|
+
style: motionStyle
|
|
4103
|
+
} = _ref;
|
|
4147
4104
|
const mergedStyle = Object.assign(Object.assign({}, style), motionStyle);
|
|
4148
4105
|
return /*#__PURE__*/React__default.createElement(InnerLoadingIcon, {
|
|
4149
4106
|
prefixCls: prefixCls,
|
|
@@ -4295,13 +4252,16 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
4295
4252
|
}
|
|
4296
4253
|
const isArray = Array.isArray(color);
|
|
4297
4254
|
if (isArray && color.length) {
|
|
4298
|
-
this.colors = color.map(
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4255
|
+
this.colors = color.map(_ref => {
|
|
4256
|
+
let {
|
|
4257
|
+
color: c,
|
|
4258
|
+
percent
|
|
4259
|
+
} = _ref;
|
|
4260
|
+
return {
|
|
4261
|
+
color: new AggregationColor(c),
|
|
4262
|
+
percent
|
|
4263
|
+
};
|
|
4264
|
+
});
|
|
4305
4265
|
this.metaColor = new Color(this.colors[0].color.metaColor);
|
|
4306
4266
|
} else {
|
|
4307
4267
|
this.metaColor = new Color(isArray ? '' : color);
|
|
@@ -4384,13 +4344,6 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
4384
4344
|
}]);
|
|
4385
4345
|
}();
|
|
4386
4346
|
|
|
4387
|
-
const generateColor = color => {
|
|
4388
|
-
if (color instanceof AggregationColor) {
|
|
4389
|
-
return color;
|
|
4390
|
-
}
|
|
4391
|
-
return new AggregationColor(color);
|
|
4392
|
-
};
|
|
4393
|
-
|
|
4394
4347
|
const isBright = (value, bgColorToken) => {
|
|
4395
4348
|
const {
|
|
4396
4349
|
r,
|
|
@@ -4432,7 +4385,6 @@ const prepareComponentToken$2 = token => {
|
|
|
4432
4385
|
}), {});
|
|
4433
4386
|
return Object.assign(Object.assign({}, shadowColorTokens), {
|
|
4434
4387
|
fontWeight: 400,
|
|
4435
|
-
iconGap: token.marginXS,
|
|
4436
4388
|
defaultShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`,
|
|
4437
4389
|
primaryShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`,
|
|
4438
4390
|
dangerShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`,
|
|
@@ -4486,7 +4438,7 @@ const genSharedButtonStyle = token => {
|
|
|
4486
4438
|
opacityLoading,
|
|
4487
4439
|
motionDurationSlow,
|
|
4488
4440
|
motionEaseInOut,
|
|
4489
|
-
|
|
4441
|
+
marginXS,
|
|
4490
4442
|
calc
|
|
4491
4443
|
} = token;
|
|
4492
4444
|
return {
|
|
@@ -4494,7 +4446,7 @@ const genSharedButtonStyle = token => {
|
|
|
4494
4446
|
outline: 'none',
|
|
4495
4447
|
position: 'relative',
|
|
4496
4448
|
display: 'inline-flex',
|
|
4497
|
-
gap:
|
|
4449
|
+
gap: token.marginXS,
|
|
4498
4450
|
alignItems: 'center',
|
|
4499
4451
|
justifyContent: 'center',
|
|
4500
4452
|
fontWeight,
|
|
@@ -4546,7 +4498,7 @@ const genSharedButtonStyle = token => {
|
|
|
4546
4498
|
[`&:not(${componentCls}-icon-end)`]: {
|
|
4547
4499
|
[`${componentCls}-loading-icon-motion`]: {
|
|
4548
4500
|
'&-appear-start, &-enter-start': {
|
|
4549
|
-
marginInlineEnd: calc(
|
|
4501
|
+
marginInlineEnd: calc(marginXS).mul(-1).equal()
|
|
4550
4502
|
},
|
|
4551
4503
|
'&-appear-active, &-enter-active': {
|
|
4552
4504
|
marginInlineEnd: 0
|
|
@@ -4555,7 +4507,7 @@ const genSharedButtonStyle = token => {
|
|
|
4555
4507
|
marginInlineEnd: 0
|
|
4556
4508
|
},
|
|
4557
4509
|
'&-leave-active': {
|
|
4558
|
-
marginInlineEnd: calc(
|
|
4510
|
+
marginInlineEnd: calc(marginXS).mul(-1).equal()
|
|
4559
4511
|
}
|
|
4560
4512
|
}
|
|
4561
4513
|
},
|
|
@@ -4563,7 +4515,7 @@ const genSharedButtonStyle = token => {
|
|
|
4563
4515
|
flexDirection: 'row-reverse',
|
|
4564
4516
|
[`${componentCls}-loading-icon-motion`]: {
|
|
4565
4517
|
'&-appear-start, &-enter-start': {
|
|
4566
|
-
marginInlineStart: calc(
|
|
4518
|
+
marginInlineStart: calc(marginXS).mul(-1).equal()
|
|
4567
4519
|
},
|
|
4568
4520
|
'&-appear-active, &-enter-active': {
|
|
4569
4521
|
marginInlineStart: 0
|
|
@@ -4572,7 +4524,7 @@ const genSharedButtonStyle = token => {
|
|
|
4572
4524
|
marginInlineStart: 0
|
|
4573
4525
|
},
|
|
4574
4526
|
'&-leave-active': {
|
|
4575
|
-
marginInlineStart: calc(
|
|
4527
|
+
marginInlineStart: calc(marginXS).mul(-1).equal()
|
|
4576
4528
|
}
|
|
4577
4529
|
}
|
|
4578
4530
|
}
|
|
@@ -4695,10 +4647,8 @@ const genPresetColorStyle = token => {
|
|
|
4695
4647
|
borderColor: activeColor,
|
|
4696
4648
|
background: token.colorBgContainer
|
|
4697
4649
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, lightColor, {
|
|
4698
|
-
color: darkColor,
|
|
4699
4650
|
background: lightHoverColor
|
|
4700
4651
|
}, {
|
|
4701
|
-
color: darkColor,
|
|
4702
4652
|
background: lightBorderColor
|
|
4703
4653
|
})), genTextLinkButtonStyle(token, darkColor, 'link', {
|
|
4704
4654
|
color: hoverColor
|
|
@@ -4724,10 +4674,8 @@ const genDefaultButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
4724
4674
|
color: token.solidTextColor,
|
|
4725
4675
|
background: token.colorBgSolidActive
|
|
4726
4676
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorFillTertiary, {
|
|
4727
|
-
color: token.defaultColor,
|
|
4728
4677
|
background: token.colorFillSecondary
|
|
4729
4678
|
}, {
|
|
4730
|
-
color: token.defaultColor,
|
|
4731
4679
|
background: token.colorFill
|
|
4732
4680
|
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder)), genTextLinkButtonStyle(token, token.textTextColor, 'link', {
|
|
4733
4681
|
color: token.colorLinkHover,
|
|
@@ -4747,10 +4695,8 @@ const genPrimaryButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
4747
4695
|
borderColor: token.colorPrimaryActive,
|
|
4748
4696
|
background: token.colorBgContainer
|
|
4749
4697
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorPrimaryBg, {
|
|
4750
|
-
color: token.colorPrimary,
|
|
4751
4698
|
background: token.colorPrimaryBgHover
|
|
4752
4699
|
}, {
|
|
4753
|
-
color: token.colorPrimary,
|
|
4754
4700
|
background: token.colorPrimaryBorder
|
|
4755
4701
|
})), genTextLinkButtonStyle(token, token.colorPrimaryText, 'text', {
|
|
4756
4702
|
color: token.colorPrimaryTextHover,
|
|
@@ -4784,10 +4730,8 @@ const genDangerousStyle = token => Object.assign(Object.assign(Object.assign(Obj
|
|
|
4784
4730
|
color: token.colorErrorActive,
|
|
4785
4731
|
borderColor: token.colorErrorActive
|
|
4786
4732
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorErrorBg, {
|
|
4787
|
-
color: token.colorError,
|
|
4788
4733
|
background: token.colorErrorBgFilledHover
|
|
4789
4734
|
}, {
|
|
4790
|
-
color: token.colorError,
|
|
4791
4735
|
background: token.colorErrorBgActive
|
|
4792
4736
|
})), genTextLinkButtonStyle(token, token.colorError, 'text', {
|
|
4793
4737
|
color: token.colorErrorHover,
|
|
@@ -4856,7 +4800,8 @@ const genCompatibleButtonStyle = token => Object.assign(Object.assign(Object.ass
|
|
|
4856
4800
|
color: token.colorLinkActive
|
|
4857
4801
|
}));
|
|
4858
4802
|
// =============================== Size ===============================
|
|
4859
|
-
const genButtonStyle = (token
|
|
4803
|
+
const genButtonStyle = function (token) {
|
|
4804
|
+
let prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
4860
4805
|
const {
|
|
4861
4806
|
componentCls,
|
|
4862
4807
|
controlHeight,
|
|
@@ -4955,7 +4900,7 @@ const useStyle$2 = genStyleHooks('Button', token => {
|
|
|
4955
4900
|
});
|
|
4956
4901
|
|
|
4957
4902
|
// handle border collapse
|
|
4958
|
-
function compactItemBorder(token, parentCls, options
|
|
4903
|
+
function compactItemBorder(token, parentCls, options) {
|
|
4959
4904
|
const {
|
|
4960
4905
|
focusElCls,
|
|
4961
4906
|
focus,
|
|
@@ -4967,16 +4912,13 @@ function compactItemBorder(token, parentCls, options, prefixCls) {
|
|
|
4967
4912
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
4968
4913
|
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()
|
|
4969
4914
|
},
|
|
4970
|
-
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
4971
|
-
zIndex: 2
|
|
4972
|
-
},
|
|
4973
4915
|
'&-item': Object.assign(Object.assign({
|
|
4974
4916
|
[hoverEffects]: {
|
|
4975
|
-
zIndex:
|
|
4917
|
+
zIndex: 2
|
|
4976
4918
|
}
|
|
4977
4919
|
}, focusElCls ? {
|
|
4978
4920
|
[`&${focusElCls}`]: {
|
|
4979
|
-
zIndex:
|
|
4921
|
+
zIndex: 2
|
|
4980
4922
|
}
|
|
4981
4923
|
} : {}), {
|
|
4982
4924
|
[`&[disabled] ${childCombinator}`]: {
|
|
@@ -5009,30 +4951,28 @@ function compactItemBorderRadius(prefixCls, parentCls, options) {
|
|
|
5009
4951
|
}
|
|
5010
4952
|
};
|
|
5011
4953
|
}
|
|
5012
|
-
function genCompactItemStyle(token
|
|
5013
|
-
|
|
5014
|
-
|
|
4954
|
+
function genCompactItemStyle(token) {
|
|
4955
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
4956
|
+
focus: true
|
|
4957
|
+
};
|
|
5015
4958
|
const {
|
|
5016
4959
|
componentCls
|
|
5017
4960
|
} = token;
|
|
5018
4961
|
const compactCls = `${componentCls}-compact`;
|
|
5019
4962
|
return {
|
|
5020
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options
|
|
4963
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))
|
|
5021
4964
|
};
|
|
5022
4965
|
}
|
|
5023
4966
|
|
|
5024
|
-
function compactItemVerticalBorder(token, parentCls
|
|
4967
|
+
function compactItemVerticalBorder(token, parentCls) {
|
|
5025
4968
|
return {
|
|
5026
4969
|
// border collapse
|
|
5027
4970
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
5028
4971
|
marginBottom: token.calc(token.lineWidth).mul(-1).equal()
|
|
5029
4972
|
},
|
|
5030
|
-
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
5031
|
-
zIndex: 2
|
|
5032
|
-
},
|
|
5033
4973
|
'&-item': {
|
|
5034
4974
|
'&:hover,&:focus,&:active': {
|
|
5035
|
-
zIndex:
|
|
4975
|
+
zIndex: 2
|
|
5036
4976
|
},
|
|
5037
4977
|
'&[disabled]': {
|
|
5038
4978
|
zIndex: 0
|
|
@@ -5062,7 +5002,7 @@ function compactItemBorderVerticalRadius(prefixCls, parentCls) {
|
|
|
5062
5002
|
function genCompactItemVerticalStyle(token) {
|
|
5063
5003
|
const compactCls = `${token.componentCls}-compact-vertical`;
|
|
5064
5004
|
return {
|
|
5065
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls
|
|
5005
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
|
|
5066
5006
|
};
|
|
5067
5007
|
}
|
|
5068
5008
|
|
|
@@ -5138,7 +5078,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5138
5078
|
variant,
|
|
5139
5079
|
type,
|
|
5140
5080
|
danger = false,
|
|
5141
|
-
shape
|
|
5081
|
+
shape = 'default',
|
|
5142
5082
|
size: customizeSize,
|
|
5143
5083
|
styles,
|
|
5144
5084
|
disabled: customDisabled,
|
|
@@ -5160,30 +5100,16 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5160
5100
|
// https://github.com/ant-design/ant-design/issues/47605
|
|
5161
5101
|
// Compatible with original `type` behavior
|
|
5162
5102
|
const mergedType = type || 'default';
|
|
5163
|
-
const {
|
|
5164
|
-
button
|
|
5165
|
-
} = React__default.useContext(ConfigContext);
|
|
5166
|
-
const shape = customizeShape || (button === null || button === void 0 ? void 0 : button.shape) || 'default';
|
|
5167
5103
|
const [mergedColor, mergedVariant] = useMemo$1(() => {
|
|
5168
|
-
// >>>>> Local
|
|
5169
|
-
// Color & Variant
|
|
5170
5104
|
if (color && variant) {
|
|
5171
5105
|
return [color, variant];
|
|
5172
5106
|
}
|
|
5173
|
-
|
|
5174
|
-
if (
|
|
5175
|
-
|
|
5176
|
-
if (danger) {
|
|
5177
|
-
return ['danger', colorVariantPair[1]];
|
|
5178
|
-
}
|
|
5179
|
-
return colorVariantPair;
|
|
5180
|
-
}
|
|
5181
|
-
// >>> Context fallback
|
|
5182
|
-
if ((button === null || button === void 0 ? void 0 : button.color) && (button === null || button === void 0 ? void 0 : button.variant)) {
|
|
5183
|
-
return [button.color, button.variant];
|
|
5107
|
+
const colorVariantPair = ButtonTypeMap[mergedType] || [];
|
|
5108
|
+
if (danger) {
|
|
5109
|
+
return ['danger', colorVariantPair[1]];
|
|
5184
5110
|
}
|
|
5185
|
-
return
|
|
5186
|
-
}, [type, color, variant, danger
|
|
5111
|
+
return colorVariantPair;
|
|
5112
|
+
}, [type, color, variant, danger]);
|
|
5187
5113
|
const isDanger = mergedColor === 'danger';
|
|
5188
5114
|
const mergedColorText = isDanger ? 'dangerous' : mergedColor;
|
|
5189
5115
|
const {
|
|
@@ -5218,9 +5144,8 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5218
5144
|
};
|
|
5219
5145
|
}, []);
|
|
5220
5146
|
// ========================= Effect =========================
|
|
5221
|
-
// Loading
|
|
5222
|
-
|
|
5223
|
-
useLayoutEffect$1(() => {
|
|
5147
|
+
// Loading
|
|
5148
|
+
useEffect(() => {
|
|
5224
5149
|
let delayTimer = null;
|
|
5225
5150
|
if (loadingOrDelay.delay > 0) {
|
|
5226
5151
|
delayTimer = setTimeout(() => {
|
|
@@ -5237,7 +5162,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5237
5162
|
}
|
|
5238
5163
|
}
|
|
5239
5164
|
return cleanupTimer;
|
|
5240
|
-
}, [loadingOrDelay
|
|
5165
|
+
}, [loadingOrDelay]);
|
|
5241
5166
|
// Two chinese characters check
|
|
5242
5167
|
useEffect(() => {
|
|
5243
5168
|
// FIXME: for HOC usage like <FormatMessage />
|
|
@@ -5295,7 +5220,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5295
5220
|
// ========================= Render =========================
|
|
5296
5221
|
const classes = classNames(prefixCls, hashId, cssVarCls, {
|
|
5297
5222
|
[`${prefixCls}-${shape}`]: shape !== 'default' && shape,
|
|
5298
|
-
// Compatible with versions earlier than 5.21.0
|
|
5223
|
+
// line(253 - 254): Compatible with versions earlier than 5.21.0
|
|
5299
5224
|
[`${prefixCls}-${mergedType}`]: mergedType,
|
|
5300
5225
|
[`${prefixCls}-dangerous`]: danger,
|
|
5301
5226
|
[`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
|
|
@@ -5379,9 +5304,12 @@ function file2Obj(file) {
|
|
|
5379
5304
|
/** Upload fileList. Replace file if exist or just push into it. */
|
|
5380
5305
|
function updateFileList(file, fileList) {
|
|
5381
5306
|
const nextFileList = _toConsumableArray(fileList);
|
|
5382
|
-
const fileIndex = nextFileList.findIndex(
|
|
5383
|
-
|
|
5384
|
-
|
|
5307
|
+
const fileIndex = nextFileList.findIndex(_ref => {
|
|
5308
|
+
let {
|
|
5309
|
+
uid
|
|
5310
|
+
} = _ref;
|
|
5311
|
+
return uid === file.uid;
|
|
5312
|
+
});
|
|
5385
5313
|
if (fileIndex === -1) {
|
|
5386
5314
|
nextFileList.push(file);
|
|
5387
5315
|
} else {
|
|
@@ -5402,7 +5330,8 @@ function removeFileItem(file, fileList) {
|
|
|
5402
5330
|
return removed;
|
|
5403
5331
|
}
|
|
5404
5332
|
// ==================== Default Image Preview ====================
|
|
5405
|
-
const extname = (
|
|
5333
|
+
const extname = function () {
|
|
5334
|
+
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
5406
5335
|
const temp = url.split('/');
|
|
5407
5336
|
const filename = temp[temp.length - 1];
|
|
5408
5337
|
const filenameWithoutSuffix = filename.split(/#|\?/)[0];
|
|
@@ -7833,6 +7762,8 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
7833
7762
|
var doc = popupElement.ownerDocument;
|
|
7834
7763
|
var win = getWin(popupElement);
|
|
7835
7764
|
var _win$getComputedStyle = win.getComputedStyle(popupElement),
|
|
7765
|
+
width = _win$getComputedStyle.width,
|
|
7766
|
+
height = _win$getComputedStyle.height,
|
|
7836
7767
|
popupPosition = _win$getComputedStyle.position;
|
|
7837
7768
|
var originLeft = popupElement.style.left;
|
|
7838
7769
|
var originTop = popupElement.style.top;
|
|
@@ -7881,9 +7812,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
7881
7812
|
};
|
|
7882
7813
|
}
|
|
7883
7814
|
var popupRect = popupElement.getBoundingClientRect();
|
|
7884
|
-
var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
|
|
7885
|
-
height = _win$getComputedStyle2.height,
|
|
7886
|
-
width = _win$getComputedStyle2.width;
|
|
7887
7815
|
popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
|
|
7888
7816
|
popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
|
|
7889
7817
|
var _doc$documentElement = doc.documentElement,
|
|
@@ -8757,10 +8685,6 @@ function generateTrigger() {
|
|
|
8757
8685
|
cloneProps.className = classNames(originChildProps.className, className);
|
|
8758
8686
|
}
|
|
8759
8687
|
|
|
8760
|
-
// ============================ Perf ============================
|
|
8761
|
-
var renderedRef = React.useRef(false);
|
|
8762
|
-
renderedRef.current || (renderedRef.current = forceRender || mergedOpen || inMotion);
|
|
8763
|
-
|
|
8764
8688
|
// =========================== Render ===========================
|
|
8765
8689
|
var mergedChildrenProps = _objectSpread2(_objectSpread2({}, originChildProps), cloneProps);
|
|
8766
8690
|
|
|
@@ -8795,7 +8719,7 @@ function generateTrigger() {
|
|
|
8795
8719
|
onResize: onTargetResize
|
|
8796
8720
|
}, /*#__PURE__*/React.createElement(TriggerWrapper, {
|
|
8797
8721
|
getTriggerDOMNode: getTriggerDOMNode
|
|
8798
|
-
}, triggerNode)),
|
|
8722
|
+
}, triggerNode)), /*#__PURE__*/React.createElement(TriggerContext.Provider, {
|
|
8799
8723
|
value: context
|
|
8800
8724
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
8801
8725
|
portal: PortalComponent,
|
|
@@ -9034,11 +8958,12 @@ const FormItemInputContext = /*#__PURE__*/React.createContext({});
|
|
|
9034
8958
|
if (process.env.NODE_ENV !== 'production') {
|
|
9035
8959
|
FormItemInputContext.displayName = 'FormItemInputContext';
|
|
9036
8960
|
}
|
|
9037
|
-
const NoFormStyle =
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
8961
|
+
const NoFormStyle = _ref => {
|
|
8962
|
+
let {
|
|
8963
|
+
children,
|
|
8964
|
+
status,
|
|
8965
|
+
override
|
|
8966
|
+
} = _ref;
|
|
9042
8967
|
const formItemInputContext = React.useContext(FormItemInputContext);
|
|
9043
8968
|
const newFormItemInputContext = React.useMemo(() => {
|
|
9044
8969
|
const newContext = Object.assign({}, formItemInputContext);
|
|
@@ -9481,11 +9406,6 @@ function getPlacements(config) {
|
|
|
9481
9406
|
borderRadius} = config;
|
|
9482
9407
|
const halfArrowWidth = arrowWidth / 2;
|
|
9483
9408
|
const placementMap = {};
|
|
9484
|
-
// Dynamic offset
|
|
9485
|
-
const arrowOffset = getArrowOffsetToken({
|
|
9486
|
-
contentRadius: borderRadius,
|
|
9487
|
-
limitVerticalRadius: true
|
|
9488
|
-
});
|
|
9489
9409
|
Object.keys(PlacementAlignMap).forEach(key => {
|
|
9490
9410
|
const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key];
|
|
9491
9411
|
const placementInfo = Object.assign(Object.assign({}, template), {
|
|
@@ -9520,6 +9440,11 @@ function getPlacements(config) {
|
|
|
9520
9440
|
placementInfo.offset[0] = halfArrowWidth + offset;
|
|
9521
9441
|
break;
|
|
9522
9442
|
}
|
|
9443
|
+
// Dynamic offset
|
|
9444
|
+
const arrowOffset = getArrowOffsetToken({
|
|
9445
|
+
contentRadius: borderRadius,
|
|
9446
|
+
limitVerticalRadius: true
|
|
9447
|
+
});
|
|
9523
9448
|
if (arrowPointAtCenter) {
|
|
9524
9449
|
switch (key) {
|
|
9525
9450
|
case 'topLeft':
|
|
@@ -9591,7 +9516,7 @@ const genTooltipStyle = token => {
|
|
|
9591
9516
|
minWidth: centerAlignMinWidth,
|
|
9592
9517
|
minHeight: controlHeight,
|
|
9593
9518
|
padding: `${unit(token.calc(paddingSM).div(2).equal())} ${unit(paddingXS)}`,
|
|
9594
|
-
color:
|
|
9519
|
+
color: tooltipColor,
|
|
9595
9520
|
textAlign: 'start',
|
|
9596
9521
|
textDecoration: 'none',
|
|
9597
9522
|
wordWrap: 'break-word',
|
|
@@ -9613,18 +9538,21 @@ const genTooltipStyle = token => {
|
|
|
9613
9538
|
[`${componentCls}-content`]: {
|
|
9614
9539
|
position: 'relative'
|
|
9615
9540
|
}
|
|
9616
|
-
}), genPresetColor(token, (colorKey, {
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9541
|
+
}), genPresetColor(token, (colorKey, _ref) => {
|
|
9542
|
+
let {
|
|
9543
|
+
darkColor
|
|
9544
|
+
} = _ref;
|
|
9545
|
+
return {
|
|
9546
|
+
[`&${componentCls}-${colorKey}`]: {
|
|
9547
|
+
[`${componentCls}-inner`]: {
|
|
9548
|
+
backgroundColor: darkColor
|
|
9549
|
+
},
|
|
9550
|
+
[`${componentCls}-arrow`]: {
|
|
9551
|
+
'--antd-arrow-background-color': darkColor
|
|
9552
|
+
}
|
|
9625
9553
|
}
|
|
9626
|
-
}
|
|
9627
|
-
}))
|
|
9554
|
+
};
|
|
9555
|
+
})), {
|
|
9628
9556
|
// RTL
|
|
9629
9557
|
'&-rtl': {
|
|
9630
9558
|
direction: 'rtl'
|
|
@@ -9651,7 +9579,8 @@ const prepareComponentToken$1 = token => Object.assign(Object.assign({
|
|
|
9651
9579
|
})), getArrowToken(merge(token, {
|
|
9652
9580
|
borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
|
|
9653
9581
|
})));
|
|
9654
|
-
const useStyle$1 = (prefixCls
|
|
9582
|
+
const useStyle$1 = (function (prefixCls) {
|
|
9583
|
+
let injectStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9655
9584
|
const useStyle = genStyleHooks('Tooltip', token => {
|
|
9656
9585
|
const {
|
|
9657
9586
|
borderRadius,
|
|
@@ -9672,7 +9601,7 @@ const useStyle$1 = (prefixCls, injectStyle = true) => {
|
|
|
9672
9601
|
injectStyle
|
|
9673
9602
|
});
|
|
9674
9603
|
return useStyle(prefixCls);
|
|
9675
|
-
};
|
|
9604
|
+
});
|
|
9676
9605
|
|
|
9677
9606
|
const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
9678
9607
|
/**
|
|
@@ -9680,7 +9609,8 @@ const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
|
9680
9609
|
* @param color color to be judged
|
|
9681
9610
|
* @param includeInverse whether to include reversed colors
|
|
9682
9611
|
*/
|
|
9683
|
-
function isPresetColor(color
|
|
9612
|
+
function isPresetColor(color) {
|
|
9613
|
+
let includeInverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9684
9614
|
if (includeInverse) {
|
|
9685
9615
|
return [].concat(_toConsumableArray(inverseColors), _toConsumableArray(PresetColors)).includes(color);
|
|
9686
9616
|
}
|
|
@@ -9694,12 +9624,8 @@ function parseColor(prefixCls, color) {
|
|
|
9694
9624
|
});
|
|
9695
9625
|
const overlayStyle = {};
|
|
9696
9626
|
const arrowStyle = {};
|
|
9697
|
-
const rgb = generateColor(color).toRgb();
|
|
9698
|
-
const luminance = (0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b) / 255;
|
|
9699
|
-
const textColor = luminance < 0.5 ? '#FFF' : '#000';
|
|
9700
9627
|
if (color && !isInternalColor) {
|
|
9701
9628
|
overlayStyle.background = color;
|
|
9702
|
-
overlayStyle['--ant-tooltip-color'] = textColor;
|
|
9703
9629
|
// @ts-ignore
|
|
9704
9630
|
arrowStyle['--antd-arrow-background-color'] = color;
|
|
9705
9631
|
}
|
|
@@ -9762,7 +9688,6 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9762
9688
|
afterOpenChange,
|
|
9763
9689
|
afterVisibleChange,
|
|
9764
9690
|
destroyTooltipOnHide,
|
|
9765
|
-
destroyOnHidden,
|
|
9766
9691
|
arrow = true,
|
|
9767
9692
|
title,
|
|
9768
9693
|
overlay,
|
|
@@ -9779,7 +9704,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9779
9704
|
styles,
|
|
9780
9705
|
classNames: tooltipClassNames
|
|
9781
9706
|
} = props,
|
|
9782
|
-
restProps = __rest$3(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "
|
|
9707
|
+
restProps = __rest$3(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
|
|
9783
9708
|
const mergedShowArrow = !!arrow;
|
|
9784
9709
|
const [, token] = useToken();
|
|
9785
9710
|
const {
|
|
@@ -9812,7 +9737,8 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9812
9737
|
});
|
|
9813
9738
|
// ============================== Warn ==============================
|
|
9814
9739
|
if (process.env.NODE_ENV !== 'production') {
|
|
9815
|
-
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['
|
|
9740
|
+
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(_ref => {
|
|
9741
|
+
let [deprecatedName, newName] = _ref;
|
|
9816
9742
|
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
|
9817
9743
|
});
|
|
9818
9744
|
process.env.NODE_ENV !== "production" ? warning(!destroyTooltipOnHide || typeof destroyTooltipOnHide === 'boolean', 'usage', '`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly.') : void 0;
|
|
@@ -9906,8 +9832,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9906
9832
|
motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),
|
|
9907
9833
|
motionDeadline: 1000
|
|
9908
9834
|
},
|
|
9909
|
-
|
|
9910
|
-
destroyTooltipOnHide: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide
|
|
9835
|
+
destroyTooltipOnHide: !!destroyTooltipOnHide
|
|
9911
9836
|
}), tempOpen ? cloneElement(child, {
|
|
9912
9837
|
className: childCls
|
|
9913
9838
|
}) : child);
|
|
@@ -9930,10 +9855,11 @@ function validProgress(progress) {
|
|
|
9930
9855
|
}
|
|
9931
9856
|
return progress;
|
|
9932
9857
|
}
|
|
9933
|
-
function getSuccessPercent({
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9858
|
+
function getSuccessPercent(_ref) {
|
|
9859
|
+
let {
|
|
9860
|
+
success,
|
|
9861
|
+
successPercent
|
|
9862
|
+
} = _ref;
|
|
9937
9863
|
let percent = successPercent;
|
|
9938
9864
|
/** @deprecated Use `percent` instead */
|
|
9939
9865
|
if (success && 'progress' in success) {
|
|
@@ -9944,21 +9870,23 @@ function getSuccessPercent({
|
|
|
9944
9870
|
}
|
|
9945
9871
|
return percent;
|
|
9946
9872
|
}
|
|
9947
|
-
const getPercentage =
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9873
|
+
const getPercentage = _ref2 => {
|
|
9874
|
+
let {
|
|
9875
|
+
percent,
|
|
9876
|
+
success,
|
|
9877
|
+
successPercent
|
|
9878
|
+
} = _ref2;
|
|
9952
9879
|
const realSuccessPercent = validProgress(getSuccessPercent({
|
|
9953
9880
|
success,
|
|
9954
9881
|
successPercent
|
|
9955
9882
|
}));
|
|
9956
9883
|
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
|
9957
9884
|
};
|
|
9958
|
-
const getStrokeColor =
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9885
|
+
const getStrokeColor = _ref3 => {
|
|
9886
|
+
let {
|
|
9887
|
+
success = {},
|
|
9888
|
+
strokeColor
|
|
9889
|
+
} = _ref3;
|
|
9962
9890
|
const {
|
|
9963
9891
|
strokeColor: successColor
|
|
9964
9892
|
} = success;
|
|
@@ -10404,10 +10332,13 @@ const sortGradient = gradients => {
|
|
|
10404
10332
|
}
|
|
10405
10333
|
});
|
|
10406
10334
|
tempArr = tempArr.sort((a, b) => a.key - b.key);
|
|
10407
|
-
return tempArr.map(
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10335
|
+
return tempArr.map(_ref => {
|
|
10336
|
+
let {
|
|
10337
|
+
key,
|
|
10338
|
+
value
|
|
10339
|
+
} = _ref;
|
|
10340
|
+
return `${value} ${key}%`;
|
|
10341
|
+
}).join(', ');
|
|
10411
10342
|
};
|
|
10412
10343
|
/**
|
|
10413
10344
|
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
|
|
@@ -10703,30 +10634,31 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
10703
10634
|
Progress.displayName = 'Progress';
|
|
10704
10635
|
}
|
|
10705
10636
|
|
|
10706
|
-
const ListItem = /*#__PURE__*/React.forwardRef(({
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10637
|
+
const ListItem = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
10638
|
+
let {
|
|
10639
|
+
prefixCls,
|
|
10640
|
+
className,
|
|
10641
|
+
style,
|
|
10642
|
+
locale,
|
|
10643
|
+
listType,
|
|
10644
|
+
file,
|
|
10645
|
+
items,
|
|
10646
|
+
progress: progressProps,
|
|
10647
|
+
iconRender,
|
|
10648
|
+
actionIconRender,
|
|
10649
|
+
itemRender,
|
|
10650
|
+
isImgUrl,
|
|
10651
|
+
showPreviewIcon,
|
|
10652
|
+
showRemoveIcon,
|
|
10653
|
+
showDownloadIcon,
|
|
10654
|
+
previewIcon: customPreviewIcon,
|
|
10655
|
+
removeIcon: customRemoveIcon,
|
|
10656
|
+
downloadIcon: customDownloadIcon,
|
|
10657
|
+
extra: customExtra,
|
|
10658
|
+
onPreview,
|
|
10659
|
+
onDownload,
|
|
10660
|
+
onClose
|
|
10661
|
+
} = _ref;
|
|
10730
10662
|
var _a, _b;
|
|
10731
10663
|
// Status: which will ignore `removed` status
|
|
10732
10664
|
const {
|
|
@@ -10832,16 +10764,17 @@ const ListItem = /*#__PURE__*/React.forwardRef(({
|
|
|
10832
10764
|
motionName: `${rootPrefixCls}-fade`,
|
|
10833
10765
|
visible: mergedStatus === 'uploading',
|
|
10834
10766
|
motionDeadline: 2000
|
|
10835
|
-
},
|
|
10836
|
-
|
|
10837
|
-
|
|
10767
|
+
}, _ref2 => {
|
|
10768
|
+
let {
|
|
10769
|
+
className: motionClassName
|
|
10770
|
+
} = _ref2;
|
|
10838
10771
|
// show loading icon if upload progress listener is disabled
|
|
10839
|
-
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({
|
|
10772
|
+
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({}, progressProps, {
|
|
10840
10773
|
type: "line",
|
|
10841
10774
|
percent: file.percent,
|
|
10842
10775
|
"aria-label": file['aria-label'],
|
|
10843
10776
|
"aria-labelledby": file['aria-labelledby']
|
|
10844
|
-
}
|
|
10777
|
+
}))) : null;
|
|
10845
10778
|
return /*#__PURE__*/React.createElement("div", {
|
|
10846
10779
|
className: classNames(`${prefixCls}-list-item-progress`, motionClassName)
|
|
10847
10780
|
}, loadingProgress);
|
|
@@ -10955,9 +10888,11 @@ const InternalUploadList = (props, ref) => {
|
|
|
10955
10888
|
(_b = (_a = customIcon.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
10956
10889
|
}
|
|
10957
10890
|
},
|
|
10958
|
-
className: `${prefixCls}-list-item-action
|
|
10959
|
-
disabled: acceptUploadDisabled ? disabled : false
|
|
10891
|
+
className: `${prefixCls}-list-item-action`
|
|
10960
10892
|
};
|
|
10893
|
+
if (acceptUploadDisabled) {
|
|
10894
|
+
btnProps.disabled = disabled;
|
|
10895
|
+
}
|
|
10961
10896
|
return /*#__PURE__*/React.isValidElement(customIcon) ? (/*#__PURE__*/React.createElement(Button, Object.assign({}, btnProps, {
|
|
10962
10897
|
icon: cloneElement(customIcon, Object.assign(Object.assign({}, customIcon.props), {
|
|
10963
10898
|
onClick: () => {}
|
|
@@ -10991,48 +10926,54 @@ const InternalUploadList = (props, ref) => {
|
|
|
10991
10926
|
className: listClassNames
|
|
10992
10927
|
}, /*#__PURE__*/React.createElement(CSSMotionList, Object.assign({}, motionConfig, {
|
|
10993
10928
|
component: false
|
|
10994
|
-
}),
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
10929
|
+
}), _ref => {
|
|
10930
|
+
let {
|
|
10931
|
+
key,
|
|
10932
|
+
file,
|
|
10933
|
+
className: motionClassName,
|
|
10934
|
+
style: motionStyle
|
|
10935
|
+
} = _ref;
|
|
10936
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
10937
|
+
key: key,
|
|
10938
|
+
locale: locale,
|
|
10939
|
+
prefixCls: prefixCls,
|
|
10940
|
+
className: motionClassName,
|
|
10941
|
+
style: motionStyle,
|
|
10942
|
+
file: file,
|
|
10943
|
+
items: items,
|
|
10944
|
+
progress: progress,
|
|
10945
|
+
listType: listType,
|
|
10946
|
+
isImgUrl: isImgUrl,
|
|
10947
|
+
showPreviewIcon: showPreviewIcon,
|
|
10948
|
+
showRemoveIcon: showRemoveIcon,
|
|
10949
|
+
showDownloadIcon: showDownloadIcon,
|
|
10950
|
+
removeIcon: removeIcon,
|
|
10951
|
+
previewIcon: previewIcon,
|
|
10952
|
+
downloadIcon: downloadIcon,
|
|
10953
|
+
extra: extra,
|
|
10954
|
+
iconRender: internalIconRender,
|
|
10955
|
+
actionIconRender: actionIconRender,
|
|
10956
|
+
itemRender: itemRender,
|
|
10957
|
+
onPreview: onInternalPreview,
|
|
10958
|
+
onDownload: onInternalDownload,
|
|
10959
|
+
onClose: onInternalClose
|
|
10960
|
+
});
|
|
10961
|
+
}), appendAction && (/*#__PURE__*/React.createElement(CSSMotion, Object.assign({}, motionConfig, {
|
|
11024
10962
|
visible: appendActionVisible,
|
|
11025
10963
|
forceRender: true
|
|
11026
|
-
}),
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
10964
|
+
}), _ref2 => {
|
|
10965
|
+
let {
|
|
10966
|
+
className: motionClassName,
|
|
10967
|
+
style: motionStyle
|
|
10968
|
+
} = _ref2;
|
|
10969
|
+
return cloneElement(appendAction, oriProps => ({
|
|
10970
|
+
className: classNames(oriProps.className, motionClassName),
|
|
10971
|
+
style: Object.assign(Object.assign(Object.assign({}, motionStyle), {
|
|
10972
|
+
// prevent the element has hover css pseudo-class that may cause animation to end prematurely.
|
|
10973
|
+
pointerEvents: motionClassName ? 'none' : undefined
|
|
10974
|
+
}), oriProps.style)
|
|
10975
|
+
}));
|
|
10976
|
+
})));
|
|
11036
10977
|
};
|
|
11037
10978
|
const UploadList = /*#__PURE__*/React.forwardRef(InternalUploadList);
|
|
11038
10979
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -11068,7 +11009,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
11068
11009
|
};
|
|
11069
11010
|
const LIST_IGNORE = `__LIST_IGNORE_${Date.now()}__`;
|
|
11070
11011
|
const InternalUpload = (props, ref) => {
|
|
11071
|
-
const config = useComponentConfig('upload');
|
|
11072
11012
|
const {
|
|
11073
11013
|
fileList,
|
|
11074
11014
|
defaultFileList,
|
|
@@ -11103,7 +11043,6 @@ const InternalUpload = (props, ref) => {
|
|
|
11103
11043
|
// ===================== Disabled =====================
|
|
11104
11044
|
const disabled = React.useContext(DisabledContext);
|
|
11105
11045
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
11106
|
-
const customRequest = props.customRequest || config.customRequest;
|
|
11107
11046
|
const [mergedFileList, setMergedFileList] = useMergedState(defaultFileList || [], {
|
|
11108
11047
|
value: fileList,
|
|
11109
11048
|
postState: list => list !== null && list !== void 0 ? list : []
|
|
@@ -11233,6 +11172,7 @@ const InternalUpload = (props, ref) => {
|
|
|
11233
11172
|
const onSuccess = (response, file, xhr) => {
|
|
11234
11173
|
try {
|
|
11235
11174
|
if (typeof response === 'string') {
|
|
11175
|
+
// biome-ignore lint/style/noParameterAssign: we need to modify response
|
|
11236
11176
|
response = JSON.parse(response);
|
|
11237
11177
|
}
|
|
11238
11178
|
} catch (_a) {
|
|
@@ -11325,7 +11265,6 @@ const InternalUpload = (props, ref) => {
|
|
|
11325
11265
|
onProgress,
|
|
11326
11266
|
onSuccess
|
|
11327
11267
|
}, props), {
|
|
11328
|
-
customRequest,
|
|
11329
11268
|
data,
|
|
11330
11269
|
multiple,
|
|
11331
11270
|
action,
|
|
@@ -11424,8 +11363,7 @@ const InternalUpload = (props, ref) => {
|
|
|
11424
11363
|
[`${prefixCls}-hidden`]: !children
|
|
11425
11364
|
});
|
|
11426
11365
|
const uploadButton = /*#__PURE__*/React.createElement("div", {
|
|
11427
|
-
className: uploadBtnCls
|
|
11428
|
-
style: mergedStyle
|
|
11366
|
+
className: uploadBtnCls
|
|
11429
11367
|
}, /*#__PURE__*/React.createElement(Upload$1, Object.assign({}, rcUploadProps, {
|
|
11430
11368
|
ref: upload
|
|
11431
11369
|
})));
|