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