@pnkx-lib/ui 1.9.532 → 1.9.533
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/{bundle-mjs-BBFHkixS.js → bundle-mjs-BME7zF0Z.js} +1 -1
- package/es/chunks/{index.esm-Ds4t-z37.js → index.esm-AaUjBMaK.js} +55 -90
- package/es/chunks/{toArray-7SKWyzWi.js → toArray-DACIS0E1.js} +42 -44
- package/es/constants/index.js +1 -0
- package/es/fields/CascaderField.js +1 -1
- package/es/fields/Checkbox.js +1 -1
- package/es/fields/DatePicker.js +1 -1
- package/es/fields/DateRangePicker.js +1 -1
- package/es/fields/Input.js +1 -1
- package/es/fields/InputRangePicker.js +1 -1
- package/es/fields/PnkxField.js +1 -1
- package/es/fields/Select.js +1 -1
- package/es/fields/SliderRanger.js +1 -1
- package/es/fields/SliderSingle.js +1 -1
- package/es/fields/Switch.js +1 -1
- package/es/fields/Textarea.js +1 -1
- package/es/fields/TimePicker.js +1 -1
- package/es/fields/TimeRangePicker.js +1 -1
- package/es/fields/TinyMCE.js +35 -16
- package/es/ui/Button.js +1 -1
- package/es/ui/Cascader.js +1 -1
- package/es/ui/CategoryStatus.js +1 -1
- package/es/ui/Container.js +1 -1
- package/es/ui/Descriptions.js +1 -1
- package/es/ui/GenericUploadModal.js +578 -540
- package/es/ui/Label.js +1 -1
- package/es/ui/Layout.js +31 -28
- package/es/ui/Modal.js +1 -1
- package/es/ui/SearchFilterForm.js +1 -1
- package/es/ui/SelectSingleTable.js +1 -1
- package/es/ui/SelectTable.js +1 -1
- package/es/ui/Sidebar/index.js +1 -1
- package/es/ui/UploadComponent.js +1 -1
- package/es/ui/UploadImage.js +1 -1
- package/es/ui/index.js +127 -26
- 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, o as omit, y as useLayoutEffect$1, t as toArray$2 } from '../chunks/toArray-
|
|
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-DACIS0E1.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-AaUjBMaK.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,274 +1545,259 @@ function genCSSMotionList(transitionSupport) {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
const CSSMotionList = genCSSMotionList(supportTransition);
|
|
1547
1547
|
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
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
|
-
}
|
|
1548
|
+
function _OverloadYield(e, d) {
|
|
1549
|
+
this.v = e, this.k = d;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
1553
|
+
var i = Object.defineProperty;
|
|
1568
1554
|
try {
|
|
1569
|
-
|
|
1570
|
-
} catch (
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1555
|
+
i({}, "", {});
|
|
1556
|
+
} catch (e) {
|
|
1557
|
+
i = 0;
|
|
1558
|
+
}
|
|
1559
|
+
_regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
1560
|
+
if (r) i ? i(e, r, {
|
|
1561
|
+
value: n,
|
|
1562
|
+
enumerable: !t,
|
|
1563
|
+
configurable: !t,
|
|
1564
|
+
writable: !t
|
|
1565
|
+
}) : e[r] = n;else {
|
|
1566
|
+
var o = function o(r, n) {
|
|
1567
|
+
_regeneratorDefine(e, r, function (e) {
|
|
1568
|
+
return this._invoke(r, n, e);
|
|
1569
|
+
});
|
|
1570
|
+
};
|
|
1571
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
1572
|
+
}
|
|
1573
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
function _regenerator() {
|
|
1577
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
1578
|
+
var e,
|
|
1579
|
+
t,
|
|
1580
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
1581
|
+
n = r.iterator || "@@iterator",
|
|
1582
|
+
o = r.toStringTag || "@@toStringTag";
|
|
1583
|
+
function i(r, n, o, i) {
|
|
1584
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
1585
|
+
u = Object.create(c.prototype);
|
|
1586
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
1587
|
+
var i,
|
|
1588
|
+
c,
|
|
1589
|
+
u,
|
|
1590
|
+
f = 0,
|
|
1591
|
+
p = o || [],
|
|
1592
|
+
y = false,
|
|
1593
|
+
G = {
|
|
1594
|
+
p: 0,
|
|
1595
|
+
n: 0,
|
|
1596
|
+
v: e,
|
|
1597
|
+
a: d,
|
|
1598
|
+
f: d.bind(e, 4),
|
|
1599
|
+
d: function d(t, r) {
|
|
1600
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
1597
1601
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1602
|
+
};
|
|
1603
|
+
function d(r, n) {
|
|
1604
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
1605
|
+
var o,
|
|
1606
|
+
i = p[t],
|
|
1607
|
+
d = G.p,
|
|
1608
|
+
l = i[2];
|
|
1609
|
+
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));
|
|
1610
|
+
}
|
|
1611
|
+
if (o || r > 1) return a;
|
|
1612
|
+
throw y = true, n;
|
|
1613
|
+
}
|
|
1614
|
+
return function (o, p, l) {
|
|
1615
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
1616
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
1617
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
1618
|
+
try {
|
|
1619
|
+
if (f = 2, i) {
|
|
1620
|
+
if (c || (o = "next"), t = i[o]) {
|
|
1621
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
1622
|
+
if (!t.done) return t;
|
|
1623
|
+
u = t.value, c < 2 && (c = 0);
|
|
1624
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
1625
|
+
i = e;
|
|
1626
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
1627
|
+
} catch (t) {
|
|
1628
|
+
i = e, c = 1, u = t;
|
|
1629
|
+
} finally {
|
|
1630
|
+
f = 1;
|
|
1610
1631
|
}
|
|
1611
|
-
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
1612
1632
|
}
|
|
1633
|
+
return {
|
|
1634
|
+
value: t,
|
|
1635
|
+
done: y
|
|
1636
|
+
};
|
|
1613
1637
|
};
|
|
1614
|
-
}(r,
|
|
1615
|
-
}
|
|
1616
|
-
function s(t, r, e) {
|
|
1617
|
-
try {
|
|
1618
|
-
return {
|
|
1619
|
-
type: "normal",
|
|
1620
|
-
arg: t.call(r, e)
|
|
1621
|
-
};
|
|
1622
|
-
} catch (t) {
|
|
1623
|
-
return {
|
|
1624
|
-
type: "throw",
|
|
1625
|
-
arg: t
|
|
1626
|
-
};
|
|
1627
|
-
}
|
|
1638
|
+
}(r, o, i), true), u;
|
|
1628
1639
|
}
|
|
1629
|
-
|
|
1630
|
-
var f = {};
|
|
1640
|
+
var a = {};
|
|
1631
1641
|
function Generator() {}
|
|
1632
1642
|
function GeneratorFunction() {}
|
|
1633
1643
|
function GeneratorFunctionPrototype() {}
|
|
1634
|
-
|
|
1635
|
-
c(
|
|
1644
|
+
t = Object.getPrototypeOf;
|
|
1645
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
1646
|
+
return this;
|
|
1647
|
+
}), t),
|
|
1648
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
1649
|
+
function f(e) {
|
|
1650
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
1651
|
+
}
|
|
1652
|
+
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 () {
|
|
1636
1653
|
return this;
|
|
1637
|
-
})
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1654
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
1655
|
+
return "[object Generator]";
|
|
1656
|
+
}), (_regenerator = function _regenerator() {
|
|
1657
|
+
return {
|
|
1658
|
+
w: i,
|
|
1659
|
+
m: f
|
|
1660
|
+
};
|
|
1661
|
+
})();
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
function AsyncIterator(t, e) {
|
|
1665
|
+
function n(r, o, i, f) {
|
|
1666
|
+
try {
|
|
1667
|
+
var c = t[r](o),
|
|
1668
|
+
u = c.value;
|
|
1669
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
1670
|
+
n("next", t, i, f);
|
|
1671
|
+
}, function (t) {
|
|
1672
|
+
n("throw", t, i, f);
|
|
1673
|
+
}) : e.resolve(u).then(function (t) {
|
|
1674
|
+
c.value = t, i(c);
|
|
1675
|
+
}, function (t) {
|
|
1676
|
+
return n("throw", t, i, f);
|
|
1646
1677
|
});
|
|
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);
|
|
1666
|
-
}
|
|
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
|
-
});
|
|
1673
|
-
}
|
|
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;
|
|
1708
|
-
}
|
|
1678
|
+
} catch (t) {
|
|
1679
|
+
f(t);
|
|
1709
1680
|
}
|
|
1710
|
-
throw new TypeError(_typeof(r) + " is not iterable");
|
|
1711
1681
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
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) {
|
|
1718
|
-
return {
|
|
1719
|
-
__await: t
|
|
1720
|
-
};
|
|
1721
|
-
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
1682
|
+
var r;
|
|
1683
|
+
this.next || (_regeneratorDefine(AsyncIterator.prototype), _regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
1722
1684
|
return this;
|
|
1723
|
-
}),
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
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
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
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
|
-
}
|
|
1685
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
1686
|
+
function f() {
|
|
1687
|
+
return new e(function (e, r) {
|
|
1688
|
+
n(t, i, e, r);
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
return r = r ? r.then(f, f) : f();
|
|
1692
|
+
}, true);
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
1696
|
+
return new AsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
1700
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
1701
|
+
return a.next().then(function (n) {
|
|
1702
|
+
return n.done ? n.value : a.next();
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
function _regeneratorKeys(e) {
|
|
1707
|
+
var n = Object(e),
|
|
1708
|
+
r = [];
|
|
1709
|
+
for (var t in n) r.unshift(t);
|
|
1710
|
+
return function e() {
|
|
1711
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
1712
|
+
return e.done = true, e;
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
function _regeneratorValues(e) {
|
|
1717
|
+
if (null != e) {
|
|
1718
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
1719
|
+
r = 0;
|
|
1720
|
+
if (t) return t.call(e);
|
|
1721
|
+
if ("function" == typeof e.next) return e;
|
|
1722
|
+
if (!isNaN(e.length)) return {
|
|
1723
|
+
next: function next() {
|
|
1724
|
+
return e && r >= e.length && (e = void 0), {
|
|
1725
|
+
value: e && e[r++],
|
|
1726
|
+
done: !e
|
|
1727
|
+
};
|
|
1770
1728
|
}
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
function _regeneratorRuntime() {
|
|
1735
|
+
|
|
1736
|
+
var r = _regenerator(),
|
|
1737
|
+
e = r.m(_regeneratorRuntime),
|
|
1738
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
1739
|
+
function n(r) {
|
|
1740
|
+
var e = "function" == typeof r && r.constructor;
|
|
1741
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
1742
|
+
}
|
|
1743
|
+
var o = {
|
|
1744
|
+
"throw": 1,
|
|
1745
|
+
"return": 2,
|
|
1746
|
+
"break": 3,
|
|
1747
|
+
"continue": 3
|
|
1748
|
+
};
|
|
1749
|
+
function a(r) {
|
|
1750
|
+
var e, t;
|
|
1751
|
+
return function (n) {
|
|
1752
|
+
e || (e = {
|
|
1753
|
+
stop: function stop() {
|
|
1754
|
+
return t(n.a, 2);
|
|
1755
|
+
},
|
|
1756
|
+
"catch": function _catch() {
|
|
1757
|
+
return n.v;
|
|
1758
|
+
},
|
|
1759
|
+
abrupt: function abrupt(r, e) {
|
|
1760
|
+
return t(n.a, o[r], e);
|
|
1761
|
+
},
|
|
1762
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
1763
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
1764
|
+
},
|
|
1765
|
+
finish: function finish(r) {
|
|
1766
|
+
return t(n.f, r);
|
|
1778
1767
|
}
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
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;
|
|
1768
|
+
}, t = function t(r, _t, o) {
|
|
1769
|
+
n.p = e.prev, n.n = e.next;
|
|
1770
|
+
try {
|
|
1771
|
+
return r(_t, o);
|
|
1772
|
+
} finally {
|
|
1773
|
+
e.next = n.n;
|
|
1804
1774
|
}
|
|
1775
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
1776
|
+
try {
|
|
1777
|
+
return r.call(this, e);
|
|
1778
|
+
} finally {
|
|
1779
|
+
n.p = e.prev, n.n = e.next;
|
|
1805
1780
|
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
r
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
return (_regeneratorRuntime = function _regeneratorRuntime() {
|
|
1784
|
+
return {
|
|
1785
|
+
wrap: function wrap(e, t, n, o) {
|
|
1786
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
1787
|
+
},
|
|
1788
|
+
isGeneratorFunction: n,
|
|
1789
|
+
mark: r.m,
|
|
1790
|
+
awrap: function awrap(r, e) {
|
|
1791
|
+
return new _OverloadYield(r, e);
|
|
1792
|
+
},
|
|
1793
|
+
AsyncIterator: AsyncIterator,
|
|
1794
|
+
async: function async(r, e, t, o, u) {
|
|
1795
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
1796
|
+
},
|
|
1797
|
+
keys: _regeneratorKeys,
|
|
1798
|
+
values: _regeneratorValues
|
|
1799
|
+
};
|
|
1800
|
+
})();
|
|
1816
1801
|
}
|
|
1817
1802
|
|
|
1818
1803
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -2251,26 +2236,26 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2251
2236
|
_this.onClick(e);
|
|
2252
2237
|
}
|
|
2253
2238
|
});
|
|
2254
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
2255
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
2256
|
-
var multiple, files,
|
|
2239
|
+
_defineProperty(_assertThisInitialized(_this), "onDataTransferFiles", /*#__PURE__*/function () {
|
|
2240
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataTransfer, existFileCallback) {
|
|
2241
|
+
var _this$props2, multiple, accept, directory, items, files, acceptFiles;
|
|
2257
2242
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2258
2243
|
while (1) switch (_context.prev = _context.next) {
|
|
2259
2244
|
case 0:
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2245
|
+
_this$props2 = _this.props, multiple = _this$props2.multiple, accept = _this$props2.accept, directory = _this$props2.directory;
|
|
2246
|
+
items = _toConsumableArray(dataTransfer.items || []);
|
|
2247
|
+
files = _toConsumableArray(dataTransfer.files || []);
|
|
2248
|
+
if (files.length > 0 || items.some(function (item) {
|
|
2249
|
+
return item.kind === 'file';
|
|
2250
|
+
})) {
|
|
2251
|
+
existFileCallback === null || existFileCallback === void 0 || existFileCallback();
|
|
2265
2252
|
}
|
|
2266
|
-
|
|
2267
|
-
case 4:
|
|
2268
|
-
if (!_this.props.directory) {
|
|
2253
|
+
if (!directory) {
|
|
2269
2254
|
_context.next = 11;
|
|
2270
2255
|
break;
|
|
2271
2256
|
}
|
|
2272
2257
|
_context.next = 7;
|
|
2273
|
-
return traverseFileTree(Array.prototype.slice.call(
|
|
2258
|
+
return traverseFileTree(Array.prototype.slice.call(items), function (_file) {
|
|
2274
2259
|
return attrAccept(_file, _this.props.accept);
|
|
2275
2260
|
});
|
|
2276
2261
|
case 7:
|
|
@@ -2279,23 +2264,80 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2279
2264
|
_context.next = 14;
|
|
2280
2265
|
break;
|
|
2281
2266
|
case 11:
|
|
2282
|
-
|
|
2283
|
-
return attrAccept(file,
|
|
2267
|
+
acceptFiles = _toConsumableArray(files).filter(function (file) {
|
|
2268
|
+
return attrAccept(file, accept);
|
|
2284
2269
|
});
|
|
2285
2270
|
if (multiple === false) {
|
|
2286
|
-
|
|
2271
|
+
acceptFiles = files.slice(0, 1);
|
|
2287
2272
|
}
|
|
2288
|
-
_this.uploadFiles(
|
|
2273
|
+
_this.uploadFiles(acceptFiles);
|
|
2289
2274
|
case 14:
|
|
2290
2275
|
case "end":
|
|
2291
2276
|
return _context.stop();
|
|
2292
2277
|
}
|
|
2293
2278
|
}, _callee);
|
|
2294
2279
|
}));
|
|
2295
|
-
return function (_x) {
|
|
2280
|
+
return function (_x, _x2) {
|
|
2296
2281
|
return _ref.apply(this, arguments);
|
|
2297
2282
|
};
|
|
2298
2283
|
}());
|
|
2284
|
+
_defineProperty(_assertThisInitialized(_this), "onFilePaste", /*#__PURE__*/function () {
|
|
2285
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
2286
|
+
var pastable, clipboardData;
|
|
2287
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2288
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
2289
|
+
case 0:
|
|
2290
|
+
pastable = _this.props.pastable;
|
|
2291
|
+
if (pastable) {
|
|
2292
|
+
_context2.next = 3;
|
|
2293
|
+
break;
|
|
2294
|
+
}
|
|
2295
|
+
return _context2.abrupt("return");
|
|
2296
|
+
case 3:
|
|
2297
|
+
if (!(e.type === 'paste')) {
|
|
2298
|
+
_context2.next = 6;
|
|
2299
|
+
break;
|
|
2300
|
+
}
|
|
2301
|
+
clipboardData = e.clipboardData;
|
|
2302
|
+
return _context2.abrupt("return", _this.onDataTransferFiles(clipboardData, function () {
|
|
2303
|
+
e.preventDefault();
|
|
2304
|
+
}));
|
|
2305
|
+
case 6:
|
|
2306
|
+
case "end":
|
|
2307
|
+
return _context2.stop();
|
|
2308
|
+
}
|
|
2309
|
+
}, _callee2);
|
|
2310
|
+
}));
|
|
2311
|
+
return function (_x3) {
|
|
2312
|
+
return _ref2.apply(this, arguments);
|
|
2313
|
+
};
|
|
2314
|
+
}());
|
|
2315
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDragOver", function (e) {
|
|
2316
|
+
e.preventDefault();
|
|
2317
|
+
});
|
|
2318
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDrop", /*#__PURE__*/function () {
|
|
2319
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
|
|
2320
|
+
var dataTransfer;
|
|
2321
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2322
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
2323
|
+
case 0:
|
|
2324
|
+
e.preventDefault();
|
|
2325
|
+
if (!(e.type === 'drop')) {
|
|
2326
|
+
_context3.next = 4;
|
|
2327
|
+
break;
|
|
2328
|
+
}
|
|
2329
|
+
dataTransfer = e.dataTransfer;
|
|
2330
|
+
return _context3.abrupt("return", _this.onDataTransferFiles(dataTransfer));
|
|
2331
|
+
case 4:
|
|
2332
|
+
case "end":
|
|
2333
|
+
return _context3.stop();
|
|
2334
|
+
}
|
|
2335
|
+
}, _callee3);
|
|
2336
|
+
}));
|
|
2337
|
+
return function (_x4) {
|
|
2338
|
+
return _ref3.apply(this, arguments);
|
|
2339
|
+
};
|
|
2340
|
+
}());
|
|
2299
2341
|
_defineProperty(_assertThisInitialized(_this), "uploadFiles", function (files) {
|
|
2300
2342
|
var originFiles = _toConsumableArray(files);
|
|
2301
2343
|
var postFiles = originFiles.map(function (file) {
|
|
@@ -2307,9 +2349,9 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2307
2349
|
// Batch upload files
|
|
2308
2350
|
Promise.all(postFiles).then(function (fileList) {
|
|
2309
2351
|
var onBatchStart = _this.props.onBatchStart;
|
|
2310
|
-
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (
|
|
2311
|
-
var origin =
|
|
2312
|
-
parsedFile =
|
|
2352
|
+
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (_ref4) {
|
|
2353
|
+
var origin = _ref4.origin,
|
|
2354
|
+
parsedFile = _ref4.parsedFile;
|
|
2313
2355
|
return {
|
|
2314
2356
|
file: origin,
|
|
2315
2357
|
parsedFile: parsedFile
|
|
@@ -2326,35 +2368,35 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2326
2368
|
* Process file before upload. When all the file is ready, we start upload.
|
|
2327
2369
|
*/
|
|
2328
2370
|
_defineProperty(_assertThisInitialized(_this), "processFile", /*#__PURE__*/function () {
|
|
2329
|
-
var
|
|
2371
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file, fileList) {
|
|
2330
2372
|
var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;
|
|
2331
|
-
return _regeneratorRuntime().wrap(function
|
|
2332
|
-
while (1) switch (
|
|
2373
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2374
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
2333
2375
|
case 0:
|
|
2334
2376
|
beforeUpload = _this.props.beforeUpload;
|
|
2335
2377
|
transformedFile = file;
|
|
2336
2378
|
if (!beforeUpload) {
|
|
2337
|
-
|
|
2379
|
+
_context4.next = 14;
|
|
2338
2380
|
break;
|
|
2339
2381
|
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2382
|
+
_context4.prev = 3;
|
|
2383
|
+
_context4.next = 6;
|
|
2342
2384
|
return beforeUpload(file, fileList);
|
|
2343
2385
|
case 6:
|
|
2344
|
-
transformedFile =
|
|
2345
|
-
|
|
2386
|
+
transformedFile = _context4.sent;
|
|
2387
|
+
_context4.next = 12;
|
|
2346
2388
|
break;
|
|
2347
2389
|
case 9:
|
|
2348
|
-
|
|
2349
|
-
|
|
2390
|
+
_context4.prev = 9;
|
|
2391
|
+
_context4.t0 = _context4["catch"](3);
|
|
2350
2392
|
// Rejection will also trade as false
|
|
2351
2393
|
transformedFile = false;
|
|
2352
2394
|
case 12:
|
|
2353
2395
|
if (!(transformedFile === false)) {
|
|
2354
|
-
|
|
2396
|
+
_context4.next = 14;
|
|
2355
2397
|
break;
|
|
2356
2398
|
}
|
|
2357
|
-
return
|
|
2399
|
+
return _context4.abrupt("return", {
|
|
2358
2400
|
origin: file,
|
|
2359
2401
|
parsedFile: null,
|
|
2360
2402
|
action: null,
|
|
@@ -2364,14 +2406,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2364
2406
|
// Get latest action
|
|
2365
2407
|
action = _this.props.action;
|
|
2366
2408
|
if (!(typeof action === 'function')) {
|
|
2367
|
-
|
|
2409
|
+
_context4.next = 21;
|
|
2368
2410
|
break;
|
|
2369
2411
|
}
|
|
2370
|
-
|
|
2412
|
+
_context4.next = 18;
|
|
2371
2413
|
return action(file);
|
|
2372
2414
|
case 18:
|
|
2373
|
-
mergedAction =
|
|
2374
|
-
|
|
2415
|
+
mergedAction = _context4.sent;
|
|
2416
|
+
_context4.next = 22;
|
|
2375
2417
|
break;
|
|
2376
2418
|
case 21:
|
|
2377
2419
|
mergedAction = action;
|
|
@@ -2379,14 +2421,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2379
2421
|
// Get latest data
|
|
2380
2422
|
data = _this.props.data;
|
|
2381
2423
|
if (!(typeof data === 'function')) {
|
|
2382
|
-
|
|
2424
|
+
_context4.next = 29;
|
|
2383
2425
|
break;
|
|
2384
2426
|
}
|
|
2385
|
-
|
|
2427
|
+
_context4.next = 26;
|
|
2386
2428
|
return data(file);
|
|
2387
2429
|
case 26:
|
|
2388
|
-
mergedData =
|
|
2389
|
-
|
|
2430
|
+
mergedData = _context4.sent;
|
|
2431
|
+
_context4.next = 30;
|
|
2390
2432
|
break;
|
|
2391
2433
|
case 29:
|
|
2392
2434
|
mergedData = data;
|
|
@@ -2404,7 +2446,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2404
2446
|
}
|
|
2405
2447
|
mergedParsedFile = parsedFile;
|
|
2406
2448
|
mergedParsedFile.uid = file.uid;
|
|
2407
|
-
return
|
|
2449
|
+
return _context4.abrupt("return", {
|
|
2408
2450
|
origin: file,
|
|
2409
2451
|
data: mergedData,
|
|
2410
2452
|
parsedFile: mergedParsedFile,
|
|
@@ -2412,12 +2454,12 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2412
2454
|
});
|
|
2413
2455
|
case 35:
|
|
2414
2456
|
case "end":
|
|
2415
|
-
return
|
|
2457
|
+
return _context4.stop();
|
|
2416
2458
|
}
|
|
2417
|
-
},
|
|
2459
|
+
}, _callee4, null, [[3, 9]]);
|
|
2418
2460
|
}));
|
|
2419
|
-
return function (
|
|
2420
|
-
return
|
|
2461
|
+
return function (_x5, _x6) {
|
|
2462
|
+
return _ref5.apply(this, arguments);
|
|
2421
2463
|
};
|
|
2422
2464
|
}());
|
|
2423
2465
|
_defineProperty(_assertThisInitialized(_this), "saveFileInput", function (node) {
|
|
@@ -2429,31 +2471,46 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2429
2471
|
key: "componentDidMount",
|
|
2430
2472
|
value: function componentDidMount() {
|
|
2431
2473
|
this._isMounted = true;
|
|
2474
|
+
var pastable = this.props.pastable;
|
|
2475
|
+
if (pastable) {
|
|
2476
|
+
document.addEventListener('paste', this.onFilePaste);
|
|
2477
|
+
}
|
|
2432
2478
|
}
|
|
2433
2479
|
}, {
|
|
2434
2480
|
key: "componentWillUnmount",
|
|
2435
2481
|
value: function componentWillUnmount() {
|
|
2436
2482
|
this._isMounted = false;
|
|
2437
2483
|
this.abort();
|
|
2484
|
+
document.removeEventListener('paste', this.onFilePaste);
|
|
2485
|
+
}
|
|
2486
|
+
}, {
|
|
2487
|
+
key: "componentDidUpdate",
|
|
2488
|
+
value: function componentDidUpdate(prevProps) {
|
|
2489
|
+
var pastable = this.props.pastable;
|
|
2490
|
+
if (pastable && !prevProps.pastable) {
|
|
2491
|
+
document.addEventListener('paste', this.onFilePaste);
|
|
2492
|
+
} else if (!pastable && prevProps.pastable) {
|
|
2493
|
+
document.removeEventListener('paste', this.onFilePaste);
|
|
2494
|
+
}
|
|
2438
2495
|
}
|
|
2439
2496
|
}, {
|
|
2440
2497
|
key: "post",
|
|
2441
|
-
value: function post(
|
|
2498
|
+
value: function post(_ref6) {
|
|
2442
2499
|
var _this2 = this;
|
|
2443
|
-
var data =
|
|
2444
|
-
origin =
|
|
2445
|
-
action =
|
|
2446
|
-
parsedFile =
|
|
2500
|
+
var data = _ref6.data,
|
|
2501
|
+
origin = _ref6.origin,
|
|
2502
|
+
action = _ref6.action,
|
|
2503
|
+
parsedFile = _ref6.parsedFile;
|
|
2447
2504
|
if (!this._isMounted) {
|
|
2448
2505
|
return;
|
|
2449
2506
|
}
|
|
2450
|
-
var _this$
|
|
2451
|
-
onStart = _this$
|
|
2452
|
-
customRequest = _this$
|
|
2453
|
-
name = _this$
|
|
2454
|
-
headers = _this$
|
|
2455
|
-
withCredentials = _this$
|
|
2456
|
-
method = _this$
|
|
2507
|
+
var _this$props3 = this.props,
|
|
2508
|
+
onStart = _this$props3.onStart,
|
|
2509
|
+
customRequest = _this$props3.customRequest,
|
|
2510
|
+
name = _this$props3.name,
|
|
2511
|
+
headers = _this$props3.headers,
|
|
2512
|
+
withCredentials = _this$props3.withCredentials,
|
|
2513
|
+
method = _this$props3.method;
|
|
2457
2514
|
var uid = origin.uid;
|
|
2458
2515
|
var request = customRequest || upload;
|
|
2459
2516
|
var requestOption = {
|
|
@@ -2511,28 +2568,28 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2511
2568
|
}, {
|
|
2512
2569
|
key: "render",
|
|
2513
2570
|
value: function render() {
|
|
2514
|
-
var _this$
|
|
2515
|
-
Tag = _this$
|
|
2516
|
-
prefixCls = _this$
|
|
2517
|
-
className = _this$
|
|
2518
|
-
_this$
|
|
2519
|
-
classNames$1 = _this$
|
|
2520
|
-
disabled = _this$
|
|
2521
|
-
id = _this$
|
|
2522
|
-
name = _this$
|
|
2523
|
-
style = _this$
|
|
2524
|
-
_this$
|
|
2525
|
-
styles = _this$
|
|
2526
|
-
multiple = _this$
|
|
2527
|
-
accept = _this$
|
|
2528
|
-
capture = _this$
|
|
2529
|
-
children = _this$
|
|
2530
|
-
directory = _this$
|
|
2531
|
-
openFileDialogOnClick = _this$
|
|
2532
|
-
onMouseEnter = _this$
|
|
2533
|
-
onMouseLeave = _this$
|
|
2534
|
-
hasControlInside = _this$
|
|
2535
|
-
otherProps = _objectWithoutProperties(_this$
|
|
2571
|
+
var _this$props4 = this.props,
|
|
2572
|
+
Tag = _this$props4.component,
|
|
2573
|
+
prefixCls = _this$props4.prefixCls,
|
|
2574
|
+
className = _this$props4.className,
|
|
2575
|
+
_this$props4$classNam = _this$props4.classNames,
|
|
2576
|
+
classNames$1 = _this$props4$classNam === void 0 ? {} : _this$props4$classNam,
|
|
2577
|
+
disabled = _this$props4.disabled,
|
|
2578
|
+
id = _this$props4.id,
|
|
2579
|
+
name = _this$props4.name,
|
|
2580
|
+
style = _this$props4.style,
|
|
2581
|
+
_this$props4$styles = _this$props4.styles,
|
|
2582
|
+
styles = _this$props4$styles === void 0 ? {} : _this$props4$styles,
|
|
2583
|
+
multiple = _this$props4.multiple,
|
|
2584
|
+
accept = _this$props4.accept,
|
|
2585
|
+
capture = _this$props4.capture,
|
|
2586
|
+
children = _this$props4.children,
|
|
2587
|
+
directory = _this$props4.directory,
|
|
2588
|
+
openFileDialogOnClick = _this$props4.openFileDialogOnClick,
|
|
2589
|
+
onMouseEnter = _this$props4.onMouseEnter,
|
|
2590
|
+
onMouseLeave = _this$props4.onMouseLeave,
|
|
2591
|
+
hasControlInside = _this$props4.hasControlInside,
|
|
2592
|
+
otherProps = _objectWithoutProperties(_this$props4, _excluded$4);
|
|
2536
2593
|
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), "".concat(prefixCls, "-disabled"), disabled), className, className));
|
|
2537
2594
|
// because input don't have directory/webkitdirectory type declaration
|
|
2538
2595
|
var dirProps = directory ? {
|
|
@@ -2545,7 +2602,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
2545
2602
|
onMouseEnter: onMouseEnter,
|
|
2546
2603
|
onMouseLeave: onMouseLeave,
|
|
2547
2604
|
onDrop: this.onFileDrop,
|
|
2548
|
-
onDragOver: this.
|
|
2605
|
+
onDragOver: this.onFileDragOver,
|
|
2549
2606
|
tabIndex: hasControlInside ? undefined : '0'
|
|
2550
2607
|
};
|
|
2551
2608
|
return /*#__PURE__*/React__default.createElement(Tag, _extends({}, events, {
|
|
@@ -2663,8 +2720,7 @@ const initMotionCommonLeave = duration => ({
|
|
|
2663
2720
|
animationDuration: duration,
|
|
2664
2721
|
animationFillMode: 'both'
|
|
2665
2722
|
});
|
|
2666
|
-
const initMotion =
|
|
2667
|
-
let sameLevel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
2723
|
+
const initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
|
|
2668
2724
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
|
2669
2725
|
return {
|
|
2670
2726
|
[`
|
|
@@ -2707,8 +2763,7 @@ const fadeOut = new Keyframe('antFadeOut', {
|
|
|
2707
2763
|
opacity: 0
|
|
2708
2764
|
}
|
|
2709
2765
|
});
|
|
2710
|
-
const initFadeMotion =
|
|
2711
|
-
let sameLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2766
|
+
const initFadeMotion = (token, sameLevel = false) => {
|
|
2712
2767
|
const {
|
|
2713
2768
|
antCls
|
|
2714
2769
|
} = token;
|
|
@@ -3031,7 +3086,7 @@ const genListStyle = token => {
|
|
|
3031
3086
|
}
|
|
3032
3087
|
},
|
|
3033
3088
|
[`${componentCls}-icon ${iconCls}`]: {
|
|
3034
|
-
color: token.
|
|
3089
|
+
color: token.colorIcon,
|
|
3035
3090
|
fontSize
|
|
3036
3091
|
},
|
|
3037
3092
|
[`${itemCls}-progress`]: {
|
|
@@ -3390,7 +3445,7 @@ const genBaseStyle$1 = token => {
|
|
|
3390
3445
|
};
|
|
3391
3446
|
};
|
|
3392
3447
|
const prepareComponentToken$3 = token => ({
|
|
3393
|
-
actionsColor: token.
|
|
3448
|
+
actionsColor: token.colorIcon
|
|
3394
3449
|
});
|
|
3395
3450
|
// ============================== Export ==============================
|
|
3396
3451
|
const useStyle$4 = genStyleHooks('Upload', token => {
|
|
@@ -3432,22 +3487,19 @@ const getCurrentHeight = node => ({
|
|
|
3432
3487
|
height: node ? node.offsetHeight : 0
|
|
3433
3488
|
});
|
|
3434
3489
|
const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
3435
|
-
const initCollapseMotion =
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
motionDeadline: 500
|
|
3449
|
-
};
|
|
3450
|
-
};
|
|
3490
|
+
const initCollapseMotion = (rootCls = defaultPrefixCls) => ({
|
|
3491
|
+
motionName: `${rootCls}-motion-collapse`,
|
|
3492
|
+
onAppearStart: getCollapsedHeight,
|
|
3493
|
+
onEnterStart: getCollapsedHeight,
|
|
3494
|
+
onAppearActive: getRealHeight,
|
|
3495
|
+
onEnterActive: getRealHeight,
|
|
3496
|
+
onLeaveStart: getCurrentHeight,
|
|
3497
|
+
onLeaveActive: getCollapsedHeight,
|
|
3498
|
+
onAppearEnd: skipOpacityTransition,
|
|
3499
|
+
onEnterEnd: skipOpacityTransition,
|
|
3500
|
+
onLeaveEnd: skipOpacityTransition,
|
|
3501
|
+
motionDeadline: 500
|
|
3502
|
+
});
|
|
3451
3503
|
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
|
|
3452
3504
|
if (transitionName !== undefined) {
|
|
3453
3505
|
return transitionName;
|
|
@@ -3633,7 +3685,12 @@ const defaultReactRender = (node, container) => {
|
|
|
3633
3685
|
};
|
|
3634
3686
|
};
|
|
3635
3687
|
let unstableRender = defaultReactRender;
|
|
3636
|
-
|
|
3688
|
+
/**
|
|
3689
|
+
* @deprecated Set React render function for compatible usage.
|
|
3690
|
+
* This is internal usage only compatible with React 19.
|
|
3691
|
+
* And will be removed in next major version.
|
|
3692
|
+
*/
|
|
3693
|
+
function unstableSetRender(render) {
|
|
3637
3694
|
return unstableRender;
|
|
3638
3695
|
}
|
|
3639
3696
|
|
|
@@ -3756,18 +3813,15 @@ const WaveEffect = props => {
|
|
|
3756
3813
|
}
|
|
3757
3814
|
return false;
|
|
3758
3815
|
}
|
|
3759
|
-
}, (
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
style: waveStyle
|
|
3769
|
-
});
|
|
3770
|
-
});
|
|
3816
|
+
}, ({
|
|
3817
|
+
className: motionClassName
|
|
3818
|
+
}, ref) => (/*#__PURE__*/React.createElement("div", {
|
|
3819
|
+
ref: composeRef(divRef, ref),
|
|
3820
|
+
className: classNames(className, motionClassName, {
|
|
3821
|
+
'wave-quick': isSmallComponent
|
|
3822
|
+
}),
|
|
3823
|
+
style: waveStyle
|
|
3824
|
+
})));
|
|
3771
3825
|
};
|
|
3772
3826
|
const showWaveEffect = (target, info) => {
|
|
3773
3827
|
var _a;
|
|
@@ -3784,7 +3838,7 @@ const showWaveEffect = (target, info) => {
|
|
|
3784
3838
|
holder.style.left = '0px';
|
|
3785
3839
|
holder.style.top = '0px';
|
|
3786
3840
|
target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
|
|
3787
|
-
const reactRender =
|
|
3841
|
+
const reactRender = unstableSetRender();
|
|
3788
3842
|
let unmountCallback = null;
|
|
3789
3843
|
function registerUnmount() {
|
|
3790
3844
|
return unmountCallback;
|
|
@@ -4096,11 +4150,10 @@ const DefaultLoadingIcon = props => {
|
|
|
4096
4150
|
onEnterActive: getRealWidth,
|
|
4097
4151
|
onLeaveStart: getRealWidth,
|
|
4098
4152
|
onLeaveActive: getCollapsedWidth
|
|
4099
|
-
}, (
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
} = _ref;
|
|
4153
|
+
}, ({
|
|
4154
|
+
className: motionCls,
|
|
4155
|
+
style: motionStyle
|
|
4156
|
+
}, ref) => {
|
|
4104
4157
|
const mergedStyle = Object.assign(Object.assign({}, style), motionStyle);
|
|
4105
4158
|
return /*#__PURE__*/React__default.createElement(InnerLoadingIcon, {
|
|
4106
4159
|
prefixCls: prefixCls,
|
|
@@ -4252,16 +4305,13 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
4252
4305
|
}
|
|
4253
4306
|
const isArray = Array.isArray(color);
|
|
4254
4307
|
if (isArray && color.length) {
|
|
4255
|
-
this.colors = color.map(
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
percent
|
|
4263
|
-
};
|
|
4264
|
-
});
|
|
4308
|
+
this.colors = color.map(({
|
|
4309
|
+
color: c,
|
|
4310
|
+
percent
|
|
4311
|
+
}) => ({
|
|
4312
|
+
color: new AggregationColor(c),
|
|
4313
|
+
percent
|
|
4314
|
+
}));
|
|
4265
4315
|
this.metaColor = new Color(this.colors[0].color.metaColor);
|
|
4266
4316
|
} else {
|
|
4267
4317
|
this.metaColor = new Color(isArray ? '' : color);
|
|
@@ -4800,8 +4850,7 @@ const genCompatibleButtonStyle = token => Object.assign(Object.assign(Object.ass
|
|
|
4800
4850
|
color: token.colorLinkActive
|
|
4801
4851
|
}));
|
|
4802
4852
|
// =============================== Size ===============================
|
|
4803
|
-
const genButtonStyle =
|
|
4804
|
-
let prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
4853
|
+
const genButtonStyle = (token, prefixCls = '') => {
|
|
4805
4854
|
const {
|
|
4806
4855
|
componentCls,
|
|
4807
4856
|
controlHeight,
|
|
@@ -4951,10 +5000,9 @@ function compactItemBorderRadius(prefixCls, parentCls, options) {
|
|
|
4951
5000
|
}
|
|
4952
5001
|
};
|
|
4953
5002
|
}
|
|
4954
|
-
function genCompactItemStyle(token
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
};
|
|
5003
|
+
function genCompactItemStyle(token, options = {
|
|
5004
|
+
focus: true
|
|
5005
|
+
}) {
|
|
4958
5006
|
const {
|
|
4959
5007
|
componentCls
|
|
4960
5008
|
} = token;
|
|
@@ -5100,16 +5148,29 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5100
5148
|
// https://github.com/ant-design/ant-design/issues/47605
|
|
5101
5149
|
// Compatible with original `type` behavior
|
|
5102
5150
|
const mergedType = type || 'default';
|
|
5151
|
+
const {
|
|
5152
|
+
button
|
|
5153
|
+
} = React__default.useContext(ConfigContext);
|
|
5103
5154
|
const [mergedColor, mergedVariant] = useMemo$1(() => {
|
|
5155
|
+
// >>>>> Local
|
|
5156
|
+
// Color & Variant
|
|
5104
5157
|
if (color && variant) {
|
|
5105
5158
|
return [color, variant];
|
|
5106
5159
|
}
|
|
5107
|
-
|
|
5108
|
-
if (danger) {
|
|
5109
|
-
|
|
5160
|
+
// Sugar syntax
|
|
5161
|
+
if (type || danger) {
|
|
5162
|
+
const colorVariantPair = ButtonTypeMap[mergedType] || [];
|
|
5163
|
+
if (danger) {
|
|
5164
|
+
return ['danger', colorVariantPair[1]];
|
|
5165
|
+
}
|
|
5166
|
+
return colorVariantPair;
|
|
5167
|
+
}
|
|
5168
|
+
// >>> Context fallback
|
|
5169
|
+
if ((button === null || button === void 0 ? void 0 : button.color) && (button === null || button === void 0 ? void 0 : button.variant)) {
|
|
5170
|
+
return [button.color, button.variant];
|
|
5110
5171
|
}
|
|
5111
|
-
return
|
|
5112
|
-
}, [type, color, variant, danger]);
|
|
5172
|
+
return ['default', 'outlined'];
|
|
5173
|
+
}, [type, color, variant, danger, button === null || button === void 0 ? void 0 : button.variant, button === null || button === void 0 ? void 0 : button.color]);
|
|
5113
5174
|
const isDanger = mergedColor === 'danger';
|
|
5114
5175
|
const mergedColorText = isDanger ? 'dangerous' : mergedColor;
|
|
5115
5176
|
const {
|
|
@@ -5144,8 +5205,9 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5144
5205
|
};
|
|
5145
5206
|
}, []);
|
|
5146
5207
|
// ========================= Effect =========================
|
|
5147
|
-
// Loading
|
|
5148
|
-
|
|
5208
|
+
// Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
|
|
5209
|
+
// https://github.com/ant-design/ant-design/issues/51325
|
|
5210
|
+
useLayoutEffect(() => {
|
|
5149
5211
|
let delayTimer = null;
|
|
5150
5212
|
if (loadingOrDelay.delay > 0) {
|
|
5151
5213
|
delayTimer = setTimeout(() => {
|
|
@@ -5162,7 +5224,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5162
5224
|
}
|
|
5163
5225
|
}
|
|
5164
5226
|
return cleanupTimer;
|
|
5165
|
-
}, [loadingOrDelay]);
|
|
5227
|
+
}, [loadingOrDelay.delay, loadingOrDelay.loading]);
|
|
5166
5228
|
// Two chinese characters check
|
|
5167
5229
|
useEffect(() => {
|
|
5168
5230
|
// FIXME: for HOC usage like <FormatMessage />
|
|
@@ -5220,7 +5282,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
5220
5282
|
// ========================= Render =========================
|
|
5221
5283
|
const classes = classNames(prefixCls, hashId, cssVarCls, {
|
|
5222
5284
|
[`${prefixCls}-${shape}`]: shape !== 'default' && shape,
|
|
5223
|
-
//
|
|
5285
|
+
// Compatible with versions earlier than 5.21.0
|
|
5224
5286
|
[`${prefixCls}-${mergedType}`]: mergedType,
|
|
5225
5287
|
[`${prefixCls}-dangerous`]: danger,
|
|
5226
5288
|
[`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
|
|
@@ -5304,12 +5366,9 @@ function file2Obj(file) {
|
|
|
5304
5366
|
/** Upload fileList. Replace file if exist or just push into it. */
|
|
5305
5367
|
function updateFileList(file, fileList) {
|
|
5306
5368
|
const nextFileList = _toConsumableArray(fileList);
|
|
5307
|
-
const fileIndex = nextFileList.findIndex(
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
} = _ref;
|
|
5311
|
-
return uid === file.uid;
|
|
5312
|
-
});
|
|
5369
|
+
const fileIndex = nextFileList.findIndex(({
|
|
5370
|
+
uid
|
|
5371
|
+
}) => uid === file.uid);
|
|
5313
5372
|
if (fileIndex === -1) {
|
|
5314
5373
|
nextFileList.push(file);
|
|
5315
5374
|
} else {
|
|
@@ -5330,8 +5389,7 @@ function removeFileItem(file, fileList) {
|
|
|
5330
5389
|
return removed;
|
|
5331
5390
|
}
|
|
5332
5391
|
// ==================== Default Image Preview ====================
|
|
5333
|
-
const extname =
|
|
5334
|
-
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
5392
|
+
const extname = (url = '') => {
|
|
5335
5393
|
const temp = url.split('/');
|
|
5336
5394
|
const filename = temp[temp.length - 1];
|
|
5337
5395
|
const filenameWithoutSuffix = filename.split(/#|\?/)[0];
|
|
@@ -8958,12 +9016,11 @@ const FormItemInputContext = /*#__PURE__*/React.createContext({});
|
|
|
8958
9016
|
if (process.env.NODE_ENV !== 'production') {
|
|
8959
9017
|
FormItemInputContext.displayName = 'FormItemInputContext';
|
|
8960
9018
|
}
|
|
8961
|
-
const NoFormStyle =
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
} = _ref;
|
|
9019
|
+
const NoFormStyle = ({
|
|
9020
|
+
children,
|
|
9021
|
+
status,
|
|
9022
|
+
override
|
|
9023
|
+
}) => {
|
|
8967
9024
|
const formItemInputContext = React.useContext(FormItemInputContext);
|
|
8968
9025
|
const newFormItemInputContext = React.useMemo(() => {
|
|
8969
9026
|
const newContext = Object.assign({}, formItemInputContext);
|
|
@@ -9538,21 +9595,18 @@ const genTooltipStyle = token => {
|
|
|
9538
9595
|
[`${componentCls}-content`]: {
|
|
9539
9596
|
position: 'relative'
|
|
9540
9597
|
}
|
|
9541
|
-
}), genPresetColor(token, (colorKey,
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
}
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
[`${componentCls}-arrow`]: {
|
|
9551
|
-
'--antd-arrow-background-color': darkColor
|
|
9552
|
-
}
|
|
9598
|
+
}), genPresetColor(token, (colorKey, {
|
|
9599
|
+
darkColor
|
|
9600
|
+
}) => ({
|
|
9601
|
+
[`&${componentCls}-${colorKey}`]: {
|
|
9602
|
+
[`${componentCls}-inner`]: {
|
|
9603
|
+
backgroundColor: darkColor
|
|
9604
|
+
},
|
|
9605
|
+
[`${componentCls}-arrow`]: {
|
|
9606
|
+
'--antd-arrow-background-color': darkColor
|
|
9553
9607
|
}
|
|
9554
|
-
}
|
|
9555
|
-
})), {
|
|
9608
|
+
}
|
|
9609
|
+
}))), {
|
|
9556
9610
|
// RTL
|
|
9557
9611
|
'&-rtl': {
|
|
9558
9612
|
direction: 'rtl'
|
|
@@ -9579,8 +9633,7 @@ const prepareComponentToken$1 = token => Object.assign(Object.assign({
|
|
|
9579
9633
|
})), getArrowToken(merge(token, {
|
|
9580
9634
|
borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
|
|
9581
9635
|
})));
|
|
9582
|
-
const useStyle$1 = (
|
|
9583
|
-
let injectStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9636
|
+
const useStyle$1 = (prefixCls, injectStyle = true) => {
|
|
9584
9637
|
const useStyle = genStyleHooks('Tooltip', token => {
|
|
9585
9638
|
const {
|
|
9586
9639
|
borderRadius,
|
|
@@ -9601,7 +9654,7 @@ const useStyle$1 = (function (prefixCls) {
|
|
|
9601
9654
|
injectStyle
|
|
9602
9655
|
});
|
|
9603
9656
|
return useStyle(prefixCls);
|
|
9604
|
-
}
|
|
9657
|
+
};
|
|
9605
9658
|
|
|
9606
9659
|
const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
9607
9660
|
/**
|
|
@@ -9609,8 +9662,7 @@ const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
|
9609
9662
|
* @param color color to be judged
|
|
9610
9663
|
* @param includeInverse whether to include reversed colors
|
|
9611
9664
|
*/
|
|
9612
|
-
function isPresetColor(color) {
|
|
9613
|
-
let includeInverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9665
|
+
function isPresetColor(color, includeInverse = true) {
|
|
9614
9666
|
if (includeInverse) {
|
|
9615
9667
|
return [].concat(_toConsumableArray(inverseColors), _toConsumableArray(PresetColors)).includes(color);
|
|
9616
9668
|
}
|
|
@@ -9688,6 +9740,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9688
9740
|
afterOpenChange,
|
|
9689
9741
|
afterVisibleChange,
|
|
9690
9742
|
destroyTooltipOnHide,
|
|
9743
|
+
destroyOnHidden,
|
|
9691
9744
|
arrow = true,
|
|
9692
9745
|
title,
|
|
9693
9746
|
overlay,
|
|
@@ -9704,7 +9757,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9704
9757
|
styles,
|
|
9705
9758
|
classNames: tooltipClassNames
|
|
9706
9759
|
} = props,
|
|
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"]);
|
|
9760
|
+
restProps = __rest$3(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
|
|
9708
9761
|
const mergedShowArrow = !!arrow;
|
|
9709
9762
|
const [, token] = useToken();
|
|
9710
9763
|
const {
|
|
@@ -9737,8 +9790,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9737
9790
|
});
|
|
9738
9791
|
// ============================== Warn ==============================
|
|
9739
9792
|
if (process.env.NODE_ENV !== 'production') {
|
|
9740
|
-
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(
|
|
9741
|
-
let [deprecatedName, newName] = _ref;
|
|
9793
|
+
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['destroyTooltipOnHide', 'destroyOnHidden'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(([deprecatedName, newName]) => {
|
|
9742
9794
|
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
|
9743
9795
|
});
|
|
9744
9796
|
process.env.NODE_ENV !== "production" ? warning(!destroyTooltipOnHide || typeof destroyTooltipOnHide === 'boolean', 'usage', '`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly.') : void 0;
|
|
@@ -9832,7 +9884,8 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9832
9884
|
motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),
|
|
9833
9885
|
motionDeadline: 1000
|
|
9834
9886
|
},
|
|
9835
|
-
|
|
9887
|
+
// TODO: In the future, destroyTooltipOnHide in rc-tooltip needs to be upgrade to destroyOnHidden
|
|
9888
|
+
destroyTooltipOnHide: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide
|
|
9836
9889
|
}), tempOpen ? cloneElement(child, {
|
|
9837
9890
|
className: childCls
|
|
9838
9891
|
}) : child);
|
|
@@ -9855,11 +9908,10 @@ function validProgress(progress) {
|
|
|
9855
9908
|
}
|
|
9856
9909
|
return progress;
|
|
9857
9910
|
}
|
|
9858
|
-
function getSuccessPercent(
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
} = _ref;
|
|
9911
|
+
function getSuccessPercent({
|
|
9912
|
+
success,
|
|
9913
|
+
successPercent
|
|
9914
|
+
}) {
|
|
9863
9915
|
let percent = successPercent;
|
|
9864
9916
|
/** @deprecated Use `percent` instead */
|
|
9865
9917
|
if (success && 'progress' in success) {
|
|
@@ -9870,23 +9922,21 @@ function getSuccessPercent(_ref) {
|
|
|
9870
9922
|
}
|
|
9871
9923
|
return percent;
|
|
9872
9924
|
}
|
|
9873
|
-
const getPercentage =
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
} = _ref2;
|
|
9925
|
+
const getPercentage = ({
|
|
9926
|
+
percent,
|
|
9927
|
+
success,
|
|
9928
|
+
successPercent
|
|
9929
|
+
}) => {
|
|
9879
9930
|
const realSuccessPercent = validProgress(getSuccessPercent({
|
|
9880
9931
|
success,
|
|
9881
9932
|
successPercent
|
|
9882
9933
|
}));
|
|
9883
9934
|
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
|
9884
9935
|
};
|
|
9885
|
-
const getStrokeColor =
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
} = _ref3;
|
|
9936
|
+
const getStrokeColor = ({
|
|
9937
|
+
success = {},
|
|
9938
|
+
strokeColor
|
|
9939
|
+
}) => {
|
|
9890
9940
|
const {
|
|
9891
9941
|
strokeColor: successColor
|
|
9892
9942
|
} = success;
|
|
@@ -10332,13 +10382,10 @@ const sortGradient = gradients => {
|
|
|
10332
10382
|
}
|
|
10333
10383
|
});
|
|
10334
10384
|
tempArr = tempArr.sort((a, b) => a.key - b.key);
|
|
10335
|
-
return tempArr.map(
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
} = _ref;
|
|
10340
|
-
return `${value} ${key}%`;
|
|
10341
|
-
}).join(', ');
|
|
10385
|
+
return tempArr.map(({
|
|
10386
|
+
key,
|
|
10387
|
+
value
|
|
10388
|
+
}) => `${value} ${key}%`).join(', ');
|
|
10342
10389
|
};
|
|
10343
10390
|
/**
|
|
10344
10391
|
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
|
|
@@ -10634,31 +10681,30 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
10634
10681
|
Progress.displayName = 'Progress';
|
|
10635
10682
|
}
|
|
10636
10683
|
|
|
10637
|
-
const ListItem = /*#__PURE__*/React.forwardRef((
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
} = _ref;
|
|
10684
|
+
const ListItem = /*#__PURE__*/React.forwardRef(({
|
|
10685
|
+
prefixCls,
|
|
10686
|
+
className,
|
|
10687
|
+
style,
|
|
10688
|
+
locale,
|
|
10689
|
+
listType,
|
|
10690
|
+
file,
|
|
10691
|
+
items,
|
|
10692
|
+
progress: progressProps,
|
|
10693
|
+
iconRender,
|
|
10694
|
+
actionIconRender,
|
|
10695
|
+
itemRender,
|
|
10696
|
+
isImgUrl,
|
|
10697
|
+
showPreviewIcon,
|
|
10698
|
+
showRemoveIcon,
|
|
10699
|
+
showDownloadIcon,
|
|
10700
|
+
previewIcon: customPreviewIcon,
|
|
10701
|
+
removeIcon: customRemoveIcon,
|
|
10702
|
+
downloadIcon: customDownloadIcon,
|
|
10703
|
+
extra: customExtra,
|
|
10704
|
+
onPreview,
|
|
10705
|
+
onDownload,
|
|
10706
|
+
onClose
|
|
10707
|
+
}, ref) => {
|
|
10662
10708
|
var _a, _b;
|
|
10663
10709
|
// Status: which will ignore `removed` status
|
|
10664
10710
|
const {
|
|
@@ -10764,17 +10810,16 @@ const ListItem = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
10764
10810
|
motionName: `${rootPrefixCls}-fade`,
|
|
10765
10811
|
visible: mergedStatus === 'uploading',
|
|
10766
10812
|
motionDeadline: 2000
|
|
10767
|
-
},
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
} = _ref2;
|
|
10813
|
+
}, ({
|
|
10814
|
+
className: motionClassName
|
|
10815
|
+
}) => {
|
|
10771
10816
|
// show loading icon if upload progress listener is disabled
|
|
10772
|
-
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({
|
|
10817
|
+
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({
|
|
10773
10818
|
type: "line",
|
|
10774
10819
|
percent: file.percent,
|
|
10775
10820
|
"aria-label": file['aria-label'],
|
|
10776
10821
|
"aria-labelledby": file['aria-labelledby']
|
|
10777
|
-
}))) : null;
|
|
10822
|
+
}, progressProps))) : null;
|
|
10778
10823
|
return /*#__PURE__*/React.createElement("div", {
|
|
10779
10824
|
className: classNames(`${prefixCls}-list-item-progress`, motionClassName)
|
|
10780
10825
|
}, loadingProgress);
|
|
@@ -10888,11 +10933,9 @@ const InternalUploadList = (props, ref) => {
|
|
|
10888
10933
|
(_b = (_a = customIcon.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
10889
10934
|
}
|
|
10890
10935
|
},
|
|
10891
|
-
className: `${prefixCls}-list-item-action
|
|
10936
|
+
className: `${prefixCls}-list-item-action`,
|
|
10937
|
+
disabled: acceptUploadDisabled ? disabled : false
|
|
10892
10938
|
};
|
|
10893
|
-
if (acceptUploadDisabled) {
|
|
10894
|
-
btnProps.disabled = disabled;
|
|
10895
|
-
}
|
|
10896
10939
|
return /*#__PURE__*/React.isValidElement(customIcon) ? (/*#__PURE__*/React.createElement(Button, Object.assign({}, btnProps, {
|
|
10897
10940
|
icon: cloneElement(customIcon, Object.assign(Object.assign({}, customIcon.props), {
|
|
10898
10941
|
onClick: () => {}
|
|
@@ -10926,54 +10969,48 @@ const InternalUploadList = (props, ref) => {
|
|
|
10926
10969
|
className: listClassNames
|
|
10927
10970
|
}, /*#__PURE__*/React.createElement(CSSMotionList, Object.assign({}, motionConfig, {
|
|
10928
10971
|
component: false
|
|
10929
|
-
}),
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
onClose: onInternalClose
|
|
10960
|
-
});
|
|
10961
|
-
}), appendAction && (/*#__PURE__*/React.createElement(CSSMotion, Object.assign({}, motionConfig, {
|
|
10972
|
+
}), ({
|
|
10973
|
+
key,
|
|
10974
|
+
file,
|
|
10975
|
+
className: motionClassName,
|
|
10976
|
+
style: motionStyle
|
|
10977
|
+
}) => (/*#__PURE__*/React.createElement(ListItem, {
|
|
10978
|
+
key: key,
|
|
10979
|
+
locale: locale,
|
|
10980
|
+
prefixCls: prefixCls,
|
|
10981
|
+
className: motionClassName,
|
|
10982
|
+
style: motionStyle,
|
|
10983
|
+
file: file,
|
|
10984
|
+
items: items,
|
|
10985
|
+
progress: progress,
|
|
10986
|
+
listType: listType,
|
|
10987
|
+
isImgUrl: isImgUrl,
|
|
10988
|
+
showPreviewIcon: showPreviewIcon,
|
|
10989
|
+
showRemoveIcon: showRemoveIcon,
|
|
10990
|
+
showDownloadIcon: showDownloadIcon,
|
|
10991
|
+
removeIcon: removeIcon,
|
|
10992
|
+
previewIcon: previewIcon,
|
|
10993
|
+
downloadIcon: downloadIcon,
|
|
10994
|
+
extra: extra,
|
|
10995
|
+
iconRender: internalIconRender,
|
|
10996
|
+
actionIconRender: actionIconRender,
|
|
10997
|
+
itemRender: itemRender,
|
|
10998
|
+
onPreview: onInternalPreview,
|
|
10999
|
+
onDownload: onInternalDownload,
|
|
11000
|
+
onClose: onInternalClose
|
|
11001
|
+
}))), appendAction && (/*#__PURE__*/React.createElement(CSSMotion, Object.assign({}, motionConfig, {
|
|
10962
11002
|
visible: appendActionVisible,
|
|
10963
11003
|
forceRender: true
|
|
10964
|
-
}),
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
}), oriProps.style)
|
|
10975
|
-
}));
|
|
10976
|
-
})));
|
|
11004
|
+
}), ({
|
|
11005
|
+
className: motionClassName,
|
|
11006
|
+
style: motionStyle
|
|
11007
|
+
}) => cloneElement(appendAction, oriProps => ({
|
|
11008
|
+
className: classNames(oriProps.className, motionClassName),
|
|
11009
|
+
style: Object.assign(Object.assign(Object.assign({}, motionStyle), {
|
|
11010
|
+
// prevent the element has hover css pseudo-class that may cause animation to end prematurely.
|
|
11011
|
+
pointerEvents: motionClassName ? 'none' : undefined
|
|
11012
|
+
}), oriProps.style)
|
|
11013
|
+
})))));
|
|
10977
11014
|
};
|
|
10978
11015
|
const UploadList = /*#__PURE__*/React.forwardRef(InternalUploadList);
|
|
10979
11016
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -11363,7 +11400,8 @@ const InternalUpload = (props, ref) => {
|
|
|
11363
11400
|
[`${prefixCls}-hidden`]: !children
|
|
11364
11401
|
});
|
|
11365
11402
|
const uploadButton = /*#__PURE__*/React.createElement("div", {
|
|
11366
|
-
className: uploadBtnCls
|
|
11403
|
+
className: uploadBtnCls,
|
|
11404
|
+
style: mergedStyle
|
|
11367
11405
|
}, /*#__PURE__*/React.createElement(Upload$1, Object.assign({}, rcUploadProps, {
|
|
11368
11406
|
ref: upload
|
|
11369
11407
|
})));
|