@pnkx-lib/ui 1.9.510 → 1.9.512
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/{GenericUploadModal-CkhTggnS.js → GenericUploadModal-Dhv5_mhq.js} +637 -575
- 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-DzhjhY0s.js → toArray-2LkvUaha.js} +68 -81
- 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/index.js +1 -1
- 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 +2 -2
- 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 +9 -7
- 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 +3145 -3040
- package/package.json +1 -1
- package/types/components/ui/CustomeBulkActions/ConvertData.d.ts +2 -2
- package/types/components/ui/Sidebar/components/UserInfoSection.d.ts +2 -0
|
@@ -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, forwardRef, useImperativeHandle, Component, useContext, useMemo as useMemo$1, useState, Children } from 'react';
|
|
5
|
-
import { b as useMemo, i as isFragment$1, L as LocaleContext, l as localeValues, c as useLayoutUpdateEffect, d as Context, e as useLayoutEffect$1, _ as _toConsumableArray, t as toArray$2, u as unit, f as clearFix, h as textEllipsis, g as genStyleHooks, m as merge, r as resetComponent, j as defaultPrefixCls, k as genComponentStyleHook, w as warning$1, C as ConfigContext, n as useToken, S as SizeContext, p as devUseWarning, q as getAlphaColor, s as getLineHeight, v as genFocusStyle, x as resetIcon, y as genSubStyleComponent, a as useComponentConfig, D as DisabledContext, o as omit } from './toArray-
|
|
5
|
+
import { b as useMemo, i as isFragment$1, L as LocaleContext, l as localeValues, c as useLayoutUpdateEffect, d as Context, e as useLayoutEffect$1, _ as _toConsumableArray, t as toArray$2, u as unit, f as clearFix, h as textEllipsis, g as genStyleHooks, m as merge, r as resetComponent, j as defaultPrefixCls, k as genComponentStyleHook, w as warning$1, C as ConfigContext, n as useToken, S as SizeContext, p as devUseWarning, q as getAlphaColor, s as getLineHeight, v as genFocusStyle, x as resetIcon, y as genSubStyleComponent, a as useComponentConfig, D as DisabledContext, o as omit } from './toArray-2LkvUaha.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 './index-BLRvgOFN.js';
|
|
@@ -12,7 +12,7 @@ import { _ as _typeof, b as _defineProperty } from './defineProperty-CTLrw71t.js
|
|
|
12
12
|
import { R as RefIcon$7 } from './LoadingOutlined-DCtDXz9K.js';
|
|
13
13
|
import { R as RefIcon$8, a as RefIcon$a } from './CloseCircleFilled-Bo29sDEQ.js';
|
|
14
14
|
import { R as RefIcon$9 } from './CloseOutlined-CZUJ_3tW.js';
|
|
15
|
-
import { C as Controller } from './index.esm-
|
|
15
|
+
import { C as Controller } from './index.esm-Dr5ZHcf7.js';
|
|
16
16
|
import { toast } from '@pnkx-lib/core';
|
|
17
17
|
import { R as RefIcon$b } from './InboxOutlined-BBuIJe6u.js';
|
|
18
18
|
|
|
@@ -3627,8 +3627,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
3627
3627
|
var doc = popupElement.ownerDocument;
|
|
3628
3628
|
var win = getWin(popupElement);
|
|
3629
3629
|
var _win$getComputedStyle = win.getComputedStyle(popupElement),
|
|
3630
|
-
width = _win$getComputedStyle.width,
|
|
3631
|
-
height = _win$getComputedStyle.height,
|
|
3632
3630
|
popupPosition = _win$getComputedStyle.position;
|
|
3633
3631
|
var originLeft = popupElement.style.left;
|
|
3634
3632
|
var originTop = popupElement.style.top;
|
|
@@ -3677,6 +3675,9 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
3677
3675
|
};
|
|
3678
3676
|
}
|
|
3679
3677
|
var popupRect = popupElement.getBoundingClientRect();
|
|
3678
|
+
var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
|
|
3679
|
+
height = _win$getComputedStyle2.height,
|
|
3680
|
+
width = _win$getComputedStyle2.width;
|
|
3680
3681
|
popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
|
|
3681
3682
|
popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
|
|
3682
3683
|
var _doc$documentElement = doc.documentElement,
|
|
@@ -4550,6 +4551,10 @@ function generateTrigger() {
|
|
|
4550
4551
|
cloneProps.className = classNames(originChildProps.className, className);
|
|
4551
4552
|
}
|
|
4552
4553
|
|
|
4554
|
+
// ============================ Perf ============================
|
|
4555
|
+
var renderedRef = React.useRef(false);
|
|
4556
|
+
renderedRef.current || (renderedRef.current = forceRender || mergedOpen || inMotion);
|
|
4557
|
+
|
|
4553
4558
|
// =========================== Render ===========================
|
|
4554
4559
|
var mergedChildrenProps = _objectSpread2(_objectSpread2({}, originChildProps), cloneProps);
|
|
4555
4560
|
|
|
@@ -4584,7 +4589,7 @@ function generateTrigger() {
|
|
|
4584
4589
|
onResize: onTargetResize
|
|
4585
4590
|
}, /*#__PURE__*/React.createElement(TriggerWrapper, {
|
|
4586
4591
|
getTriggerDOMNode: getTriggerDOMNode
|
|
4587
|
-
}, triggerNode)), /*#__PURE__*/React.createElement(TriggerContext.Provider, {
|
|
4592
|
+
}, triggerNode)), renderedRef.current && /*#__PURE__*/React.createElement(TriggerContext.Provider, {
|
|
4588
4593
|
value: context
|
|
4589
4594
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
4590
4595
|
portal: PortalComponent,
|
|
@@ -4819,274 +4824,257 @@ var Tooltip$1 = function Tooltip(props, ref) {
|
|
|
4819
4824
|
};
|
|
4820
4825
|
const Tooltip$2 = /*#__PURE__*/forwardRef(Tooltip$1);
|
|
4821
4826
|
|
|
4822
|
-
function
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
e = Object.prototype,
|
|
4829
|
-
n = e.hasOwnProperty,
|
|
4830
|
-
o = "function" == typeof Symbol ? Symbol : {},
|
|
4831
|
-
i = o.iterator || "@@iterator",
|
|
4832
|
-
a = o.asyncIterator || "@@asyncIterator",
|
|
4833
|
-
u = o.toStringTag || "@@toStringTag";
|
|
4834
|
-
function c(t, r, e, n) {
|
|
4835
|
-
return Object.defineProperty(t, r, {
|
|
4836
|
-
value: e,
|
|
4837
|
-
enumerable: !n,
|
|
4838
|
-
configurable: !n,
|
|
4839
|
-
writable: !n
|
|
4840
|
-
});
|
|
4841
|
-
}
|
|
4827
|
+
function _OverloadYield(e, d) {
|
|
4828
|
+
this.v = e, this.k = d;
|
|
4829
|
+
}
|
|
4830
|
+
|
|
4831
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
4832
|
+
var i = Object.defineProperty;
|
|
4842
4833
|
try {
|
|
4843
|
-
|
|
4844
|
-
} catch (
|
|
4845
|
-
|
|
4846
|
-
return t[r] = e;
|
|
4847
|
-
};
|
|
4834
|
+
i({}, "", {});
|
|
4835
|
+
} catch (e) {
|
|
4836
|
+
i = 0;
|
|
4848
4837
|
}
|
|
4849
|
-
function
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4838
|
+
_regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
4839
|
+
function o(r, n) {
|
|
4840
|
+
_regeneratorDefine(e, r, function (e) {
|
|
4841
|
+
return this._invoke(r, n, e);
|
|
4842
|
+
});
|
|
4843
|
+
}
|
|
4844
|
+
r ? i ? i(e, r, {
|
|
4845
|
+
value: n,
|
|
4846
|
+
enumerable: !t,
|
|
4847
|
+
configurable: !t,
|
|
4848
|
+
writable: !t
|
|
4849
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
4850
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4853
|
+
function _regenerator() {
|
|
4854
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
4855
|
+
var e,
|
|
4856
|
+
t,
|
|
4857
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
4858
|
+
n = r.iterator || "@@iterator",
|
|
4859
|
+
o = r.toStringTag || "@@toStringTag";
|
|
4860
|
+
function i(r, n, o, i) {
|
|
4861
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
4862
|
+
u = Object.create(c.prototype);
|
|
4863
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
4864
|
+
var i,
|
|
4865
|
+
c,
|
|
4866
|
+
u,
|
|
4867
|
+
f = 0,
|
|
4868
|
+
p = o || [],
|
|
4869
|
+
y = false,
|
|
4870
|
+
G = {
|
|
4871
|
+
p: 0,
|
|
4872
|
+
n: 0,
|
|
4873
|
+
v: e,
|
|
4874
|
+
a: d,
|
|
4875
|
+
f: d.bind(e, 4),
|
|
4876
|
+
d: function d(t, r) {
|
|
4877
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
4871
4878
|
}
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4879
|
+
};
|
|
4880
|
+
function d(r, n) {
|
|
4881
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
4882
|
+
var o,
|
|
4883
|
+
i = p[t],
|
|
4884
|
+
d = G.p,
|
|
4885
|
+
l = i[2];
|
|
4886
|
+
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));
|
|
4887
|
+
}
|
|
4888
|
+
if (o || r > 1) return a;
|
|
4889
|
+
throw y = true, n;
|
|
4890
|
+
}
|
|
4891
|
+
return function (o, p, l) {
|
|
4892
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
4893
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
4894
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
4895
|
+
try {
|
|
4896
|
+
if (f = 2, i) {
|
|
4897
|
+
if (c || (o = "next"), t = i[o]) {
|
|
4898
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
4899
|
+
if (!t.done) return t;
|
|
4900
|
+
u = t.value, c < 2 && (c = 0);
|
|
4901
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
4902
|
+
i = e;
|
|
4903
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
4904
|
+
} catch (t) {
|
|
4905
|
+
i = e, c = 1, u = t;
|
|
4906
|
+
} finally {
|
|
4907
|
+
f = 1;
|
|
4884
4908
|
}
|
|
4885
|
-
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
4886
4909
|
}
|
|
4910
|
+
return {
|
|
4911
|
+
value: t,
|
|
4912
|
+
done: y
|
|
4913
|
+
};
|
|
4887
4914
|
};
|
|
4888
|
-
}(r,
|
|
4889
|
-
}
|
|
4890
|
-
function s(t, r, e) {
|
|
4891
|
-
try {
|
|
4892
|
-
return {
|
|
4893
|
-
type: "normal",
|
|
4894
|
-
arg: t.call(r, e)
|
|
4895
|
-
};
|
|
4896
|
-
} catch (t) {
|
|
4897
|
-
return {
|
|
4898
|
-
type: "throw",
|
|
4899
|
-
arg: t
|
|
4900
|
-
};
|
|
4901
|
-
}
|
|
4915
|
+
}(r, o, i), true), u;
|
|
4902
4916
|
}
|
|
4903
|
-
|
|
4904
|
-
var f = {};
|
|
4917
|
+
var a = {};
|
|
4905
4918
|
function Generator() {}
|
|
4906
4919
|
function GeneratorFunction() {}
|
|
4907
4920
|
function GeneratorFunctionPrototype() {}
|
|
4908
|
-
|
|
4909
|
-
c(
|
|
4921
|
+
t = Object.getPrototypeOf;
|
|
4922
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
4923
|
+
return this;
|
|
4924
|
+
}), t),
|
|
4925
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
4926
|
+
function f(e) {
|
|
4927
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
4928
|
+
}
|
|
4929
|
+
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 () {
|
|
4910
4930
|
return this;
|
|
4911
|
-
})
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4931
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
4932
|
+
return "[object Generator]";
|
|
4933
|
+
}), (_regenerator = function _regenerator() {
|
|
4934
|
+
return {
|
|
4935
|
+
w: i,
|
|
4936
|
+
m: f
|
|
4937
|
+
};
|
|
4938
|
+
})();
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4941
|
+
function AsyncIterator(t, e) {
|
|
4942
|
+
function n(r, o, i, f) {
|
|
4943
|
+
try {
|
|
4944
|
+
var c = t[r](o),
|
|
4945
|
+
u = c.value;
|
|
4946
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
4947
|
+
n("next", t, i, f);
|
|
4948
|
+
}, function (t) {
|
|
4949
|
+
n("throw", t, i, f);
|
|
4950
|
+
}) : e.resolve(u).then(function (t) {
|
|
4951
|
+
c.value = t, i(c);
|
|
4952
|
+
}, function (t) {
|
|
4953
|
+
return n("throw", t, i, f);
|
|
4920
4954
|
});
|
|
4921
|
-
})
|
|
4922
|
-
|
|
4923
|
-
function AsyncIterator(t, r) {
|
|
4924
|
-
function e(o, i, a, u) {
|
|
4925
|
-
var c = s(t[o], t, i);
|
|
4926
|
-
if ("throw" !== c.type) {
|
|
4927
|
-
var h = c.arg,
|
|
4928
|
-
f = h.value;
|
|
4929
|
-
return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
4930
|
-
e("next", t, a, u);
|
|
4931
|
-
}, function (t) {
|
|
4932
|
-
e("throw", t, a, u);
|
|
4933
|
-
}) : r.resolve(f).then(function (t) {
|
|
4934
|
-
h.value = t, a(h);
|
|
4935
|
-
}, function (t) {
|
|
4936
|
-
return e("throw", t, a, u);
|
|
4937
|
-
});
|
|
4938
|
-
}
|
|
4939
|
-
u(c.arg);
|
|
4940
|
-
}
|
|
4941
|
-
var o;
|
|
4942
|
-
c(this, "_invoke", function (t, n) {
|
|
4943
|
-
function i() {
|
|
4944
|
-
return new r(function (r, o) {
|
|
4945
|
-
e(t, n, r, o);
|
|
4946
|
-
});
|
|
4947
|
-
}
|
|
4948
|
-
return o = o ? o.then(i, i) : i();
|
|
4949
|
-
}, true);
|
|
4950
|
-
}
|
|
4951
|
-
function d(r, e) {
|
|
4952
|
-
var n = e.method,
|
|
4953
|
-
o = r.i[n];
|
|
4954
|
-
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;
|
|
4955
|
-
var i = s(o, r.i, e.arg);
|
|
4956
|
-
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
4957
|
-
var a = i.arg;
|
|
4958
|
-
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);
|
|
4959
|
-
}
|
|
4960
|
-
function w(t) {
|
|
4961
|
-
this.tryEntries.push(t);
|
|
4962
|
-
}
|
|
4963
|
-
function m(r) {
|
|
4964
|
-
var e = r[4] || {};
|
|
4965
|
-
e.type = "normal", e.arg = t, r[4] = e;
|
|
4966
|
-
}
|
|
4967
|
-
function Context(t) {
|
|
4968
|
-
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
|
|
4969
|
-
}
|
|
4970
|
-
function x(r) {
|
|
4971
|
-
if (null != r) {
|
|
4972
|
-
var e = r[i];
|
|
4973
|
-
if (e) return e.call(r);
|
|
4974
|
-
if ("function" == typeof r.next) return r;
|
|
4975
|
-
if (!isNaN(r.length)) {
|
|
4976
|
-
var o = -1,
|
|
4977
|
-
a = function e() {
|
|
4978
|
-
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
|
|
4979
|
-
return e.value = t, e.done = true, e;
|
|
4980
|
-
};
|
|
4981
|
-
return a.next = a;
|
|
4982
|
-
}
|
|
4955
|
+
} catch (t) {
|
|
4956
|
+
f(t);
|
|
4983
4957
|
}
|
|
4984
|
-
throw new TypeError(_typeof(r) + " is not iterable");
|
|
4985
4958
|
}
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
4989
|
-
}, r.mark = function (t) {
|
|
4990
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
4991
|
-
}, r.awrap = function (t) {
|
|
4992
|
-
return {
|
|
4993
|
-
__await: t
|
|
4994
|
-
};
|
|
4995
|
-
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
4996
|
-
return this;
|
|
4997
|
-
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
|
|
4998
|
-
void 0 === i && (i = Promise);
|
|
4999
|
-
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
5000
|
-
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
5001
|
-
return t.done ? t.value : a.next();
|
|
5002
|
-
});
|
|
5003
|
-
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
4959
|
+
var r;
|
|
4960
|
+
this.next || (_regeneratorDefine(AsyncIterator.prototype), _regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
5004
4961
|
return this;
|
|
5005
|
-
}),
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
return
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
4962
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
4963
|
+
function f() {
|
|
4964
|
+
return new e(function (e, r) {
|
|
4965
|
+
n(t, i, e, r);
|
|
4966
|
+
});
|
|
4967
|
+
}
|
|
4968
|
+
return r = r ? r.then(f, f) : f();
|
|
4969
|
+
}, true);
|
|
4970
|
+
}
|
|
4971
|
+
|
|
4972
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
4973
|
+
return new AsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4976
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
4977
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
4978
|
+
return a.next().then(function (n) {
|
|
4979
|
+
return n.done ? n.value : a.next();
|
|
4980
|
+
});
|
|
4981
|
+
}
|
|
4982
|
+
|
|
4983
|
+
function _regeneratorKeys(e) {
|
|
4984
|
+
var n = Object(e),
|
|
4985
|
+
r = [];
|
|
4986
|
+
for (var t in n) r.unshift(t);
|
|
4987
|
+
return function e() {
|
|
4988
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
4989
|
+
return e.done = true, e;
|
|
4990
|
+
};
|
|
4991
|
+
}
|
|
4992
|
+
|
|
4993
|
+
function _regeneratorValues(e) {
|
|
4994
|
+
if (null != e) {
|
|
4995
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
4996
|
+
r = 0;
|
|
4997
|
+
if (t) return t.call(e);
|
|
4998
|
+
if ("function" == typeof e.next) return e;
|
|
4999
|
+
if (!isNaN(e.length)) return {
|
|
5000
|
+
next: function next() {
|
|
5001
|
+
return e && r >= e.length && (e = void 0), {
|
|
5002
|
+
value: e && e[r++],
|
|
5003
|
+
done: !e
|
|
5004
|
+
};
|
|
5044
5005
|
}
|
|
5045
|
-
}
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5006
|
+
};
|
|
5007
|
+
}
|
|
5008
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
5009
|
+
}
|
|
5010
|
+
|
|
5011
|
+
function _regeneratorRuntime() {
|
|
5012
|
+
|
|
5013
|
+
var r = _regenerator(),
|
|
5014
|
+
e = r.m(_regeneratorRuntime),
|
|
5015
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
5016
|
+
function n(r) {
|
|
5017
|
+
var e = "function" == typeof r && r.constructor;
|
|
5018
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
5019
|
+
}
|
|
5020
|
+
var o = {
|
|
5021
|
+
"throw": 1,
|
|
5022
|
+
"return": 2,
|
|
5023
|
+
"break": 3,
|
|
5024
|
+
"continue": 3
|
|
5025
|
+
};
|
|
5026
|
+
function a(r) {
|
|
5027
|
+
var e, t;
|
|
5028
|
+
return function (n) {
|
|
5029
|
+
e || (e = {
|
|
5030
|
+
stop: function stop() {
|
|
5031
|
+
return t(n.a, 2);
|
|
5032
|
+
},
|
|
5033
|
+
"catch": function _catch() {
|
|
5034
|
+
return n.v;
|
|
5035
|
+
},
|
|
5036
|
+
abrupt: function abrupt(r, e) {
|
|
5037
|
+
return t(n.a, o[r], e);
|
|
5038
|
+
},
|
|
5039
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
5040
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
5041
|
+
},
|
|
5042
|
+
finish: function finish(r) {
|
|
5043
|
+
return t(n.f, r);
|
|
5052
5044
|
}
|
|
5053
|
-
}
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
if ("throw" === t.type) throw t.arg;
|
|
5060
|
-
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;
|
|
5061
|
-
},
|
|
5062
|
-
finish: function finish(t) {
|
|
5063
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
5064
|
-
var e = this.tryEntries[r];
|
|
5065
|
-
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
5066
|
-
}
|
|
5067
|
-
},
|
|
5068
|
-
"catch": function _catch(t) {
|
|
5069
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
5070
|
-
var e = this.tryEntries[r];
|
|
5071
|
-
if (e[0] === t) {
|
|
5072
|
-
var n = e[4];
|
|
5073
|
-
if ("throw" === n.type) {
|
|
5074
|
-
var o = n.arg;
|
|
5075
|
-
m(e);
|
|
5076
|
-
}
|
|
5077
|
-
return o;
|
|
5045
|
+
}, t = function t(r, _t, o) {
|
|
5046
|
+
n.p = e.prev, n.n = e.next;
|
|
5047
|
+
try {
|
|
5048
|
+
return r(_t, o);
|
|
5049
|
+
} finally {
|
|
5050
|
+
e.next = n.n;
|
|
5078
5051
|
}
|
|
5052
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
5053
|
+
try {
|
|
5054
|
+
return r.call(this, e);
|
|
5055
|
+
} finally {
|
|
5056
|
+
n.p = e.prev, n.n = e.next;
|
|
5079
5057
|
}
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
r
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5058
|
+
};
|
|
5059
|
+
}
|
|
5060
|
+
return (_regeneratorRuntime = function _regeneratorRuntime() {
|
|
5061
|
+
return {
|
|
5062
|
+
wrap: function wrap(e, t, n, o) {
|
|
5063
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
5064
|
+
},
|
|
5065
|
+
isGeneratorFunction: n,
|
|
5066
|
+
mark: r.m,
|
|
5067
|
+
awrap: function awrap(r, e) {
|
|
5068
|
+
return new _OverloadYield(r, e);
|
|
5069
|
+
},
|
|
5070
|
+
AsyncIterator: AsyncIterator,
|
|
5071
|
+
async: function async(r, e, t, o, u) {
|
|
5072
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
5073
|
+
},
|
|
5074
|
+
keys: _regeneratorKeys,
|
|
5075
|
+
values: _regeneratorValues
|
|
5076
|
+
};
|
|
5077
|
+
})();
|
|
5090
5078
|
}
|
|
5091
5079
|
|
|
5092
5080
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -5581,26 +5569,26 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5581
5569
|
_this.onClick(e);
|
|
5582
5570
|
}
|
|
5583
5571
|
});
|
|
5584
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
5585
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
5586
|
-
var multiple, files,
|
|
5572
|
+
_defineProperty(_assertThisInitialized(_this), "onDataTransferFiles", /*#__PURE__*/function () {
|
|
5573
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataTransfer, existFileCallback) {
|
|
5574
|
+
var _this$props2, multiple, accept, directory, items, files, acceptFiles;
|
|
5587
5575
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5588
5576
|
while (1) switch (_context.prev = _context.next) {
|
|
5589
5577
|
case 0:
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5578
|
+
_this$props2 = _this.props, multiple = _this$props2.multiple, accept = _this$props2.accept, directory = _this$props2.directory;
|
|
5579
|
+
items = _toConsumableArray(dataTransfer.items || []);
|
|
5580
|
+
files = _toConsumableArray(dataTransfer.files || []);
|
|
5581
|
+
if (files.length > 0 || items.some(function (item) {
|
|
5582
|
+
return item.kind === 'file';
|
|
5583
|
+
})) {
|
|
5584
|
+
existFileCallback === null || existFileCallback === void 0 || existFileCallback();
|
|
5595
5585
|
}
|
|
5596
|
-
|
|
5597
|
-
case 4:
|
|
5598
|
-
if (!_this.props.directory) {
|
|
5586
|
+
if (!directory) {
|
|
5599
5587
|
_context.next = 11;
|
|
5600
5588
|
break;
|
|
5601
5589
|
}
|
|
5602
5590
|
_context.next = 7;
|
|
5603
|
-
return traverseFileTree(Array.prototype.slice.call(
|
|
5591
|
+
return traverseFileTree(Array.prototype.slice.call(items), function (_file) {
|
|
5604
5592
|
return attrAccept(_file, _this.props.accept);
|
|
5605
5593
|
});
|
|
5606
5594
|
case 7:
|
|
@@ -5609,23 +5597,80 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5609
5597
|
_context.next = 14;
|
|
5610
5598
|
break;
|
|
5611
5599
|
case 11:
|
|
5612
|
-
|
|
5613
|
-
return attrAccept(file,
|
|
5600
|
+
acceptFiles = _toConsumableArray(files).filter(function (file) {
|
|
5601
|
+
return attrAccept(file, accept);
|
|
5614
5602
|
});
|
|
5615
5603
|
if (multiple === false) {
|
|
5616
|
-
|
|
5604
|
+
acceptFiles = files.slice(0, 1);
|
|
5617
5605
|
}
|
|
5618
|
-
_this.uploadFiles(
|
|
5606
|
+
_this.uploadFiles(acceptFiles);
|
|
5619
5607
|
case 14:
|
|
5620
5608
|
case "end":
|
|
5621
5609
|
return _context.stop();
|
|
5622
5610
|
}
|
|
5623
5611
|
}, _callee);
|
|
5624
5612
|
}));
|
|
5625
|
-
return function (_x) {
|
|
5613
|
+
return function (_x, _x2) {
|
|
5626
5614
|
return _ref.apply(this, arguments);
|
|
5627
5615
|
};
|
|
5628
5616
|
}());
|
|
5617
|
+
_defineProperty(_assertThisInitialized(_this), "onFilePaste", /*#__PURE__*/function () {
|
|
5618
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
5619
|
+
var pastable, clipboardData;
|
|
5620
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5621
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5622
|
+
case 0:
|
|
5623
|
+
pastable = _this.props.pastable;
|
|
5624
|
+
if (pastable) {
|
|
5625
|
+
_context2.next = 3;
|
|
5626
|
+
break;
|
|
5627
|
+
}
|
|
5628
|
+
return _context2.abrupt("return");
|
|
5629
|
+
case 3:
|
|
5630
|
+
if (!(e.type === 'paste')) {
|
|
5631
|
+
_context2.next = 6;
|
|
5632
|
+
break;
|
|
5633
|
+
}
|
|
5634
|
+
clipboardData = e.clipboardData;
|
|
5635
|
+
return _context2.abrupt("return", _this.onDataTransferFiles(clipboardData, function () {
|
|
5636
|
+
e.preventDefault();
|
|
5637
|
+
}));
|
|
5638
|
+
case 6:
|
|
5639
|
+
case "end":
|
|
5640
|
+
return _context2.stop();
|
|
5641
|
+
}
|
|
5642
|
+
}, _callee2);
|
|
5643
|
+
}));
|
|
5644
|
+
return function (_x3) {
|
|
5645
|
+
return _ref2.apply(this, arguments);
|
|
5646
|
+
};
|
|
5647
|
+
}());
|
|
5648
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDragOver", function (e) {
|
|
5649
|
+
e.preventDefault();
|
|
5650
|
+
});
|
|
5651
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDrop", /*#__PURE__*/function () {
|
|
5652
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
|
|
5653
|
+
var dataTransfer;
|
|
5654
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5655
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
5656
|
+
case 0:
|
|
5657
|
+
e.preventDefault();
|
|
5658
|
+
if (!(e.type === 'drop')) {
|
|
5659
|
+
_context3.next = 4;
|
|
5660
|
+
break;
|
|
5661
|
+
}
|
|
5662
|
+
dataTransfer = e.dataTransfer;
|
|
5663
|
+
return _context3.abrupt("return", _this.onDataTransferFiles(dataTransfer));
|
|
5664
|
+
case 4:
|
|
5665
|
+
case "end":
|
|
5666
|
+
return _context3.stop();
|
|
5667
|
+
}
|
|
5668
|
+
}, _callee3);
|
|
5669
|
+
}));
|
|
5670
|
+
return function (_x4) {
|
|
5671
|
+
return _ref3.apply(this, arguments);
|
|
5672
|
+
};
|
|
5673
|
+
}());
|
|
5629
5674
|
_defineProperty(_assertThisInitialized(_this), "uploadFiles", function (files) {
|
|
5630
5675
|
var originFiles = _toConsumableArray(files);
|
|
5631
5676
|
var postFiles = originFiles.map(function (file) {
|
|
@@ -5637,9 +5682,9 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5637
5682
|
// Batch upload files
|
|
5638
5683
|
Promise.all(postFiles).then(function (fileList) {
|
|
5639
5684
|
var onBatchStart = _this.props.onBatchStart;
|
|
5640
|
-
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (
|
|
5641
|
-
var origin =
|
|
5642
|
-
parsedFile =
|
|
5685
|
+
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (_ref4) {
|
|
5686
|
+
var origin = _ref4.origin,
|
|
5687
|
+
parsedFile = _ref4.parsedFile;
|
|
5643
5688
|
return {
|
|
5644
5689
|
file: origin,
|
|
5645
5690
|
parsedFile: parsedFile
|
|
@@ -5656,35 +5701,35 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5656
5701
|
* Process file before upload. When all the file is ready, we start upload.
|
|
5657
5702
|
*/
|
|
5658
5703
|
_defineProperty(_assertThisInitialized(_this), "processFile", /*#__PURE__*/function () {
|
|
5659
|
-
var
|
|
5704
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file, fileList) {
|
|
5660
5705
|
var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;
|
|
5661
|
-
return _regeneratorRuntime().wrap(function
|
|
5662
|
-
while (1) switch (
|
|
5706
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
5707
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
5663
5708
|
case 0:
|
|
5664
5709
|
beforeUpload = _this.props.beforeUpload;
|
|
5665
5710
|
transformedFile = file;
|
|
5666
5711
|
if (!beforeUpload) {
|
|
5667
|
-
|
|
5712
|
+
_context4.next = 14;
|
|
5668
5713
|
break;
|
|
5669
5714
|
}
|
|
5670
|
-
|
|
5671
|
-
|
|
5715
|
+
_context4.prev = 3;
|
|
5716
|
+
_context4.next = 6;
|
|
5672
5717
|
return beforeUpload(file, fileList);
|
|
5673
5718
|
case 6:
|
|
5674
|
-
transformedFile =
|
|
5675
|
-
|
|
5719
|
+
transformedFile = _context4.sent;
|
|
5720
|
+
_context4.next = 12;
|
|
5676
5721
|
break;
|
|
5677
5722
|
case 9:
|
|
5678
|
-
|
|
5679
|
-
|
|
5723
|
+
_context4.prev = 9;
|
|
5724
|
+
_context4.t0 = _context4["catch"](3);
|
|
5680
5725
|
// Rejection will also trade as false
|
|
5681
5726
|
transformedFile = false;
|
|
5682
5727
|
case 12:
|
|
5683
5728
|
if (!(transformedFile === false)) {
|
|
5684
|
-
|
|
5729
|
+
_context4.next = 14;
|
|
5685
5730
|
break;
|
|
5686
5731
|
}
|
|
5687
|
-
return
|
|
5732
|
+
return _context4.abrupt("return", {
|
|
5688
5733
|
origin: file,
|
|
5689
5734
|
parsedFile: null,
|
|
5690
5735
|
action: null,
|
|
@@ -5694,14 +5739,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5694
5739
|
// Get latest action
|
|
5695
5740
|
action = _this.props.action;
|
|
5696
5741
|
if (!(typeof action === 'function')) {
|
|
5697
|
-
|
|
5742
|
+
_context4.next = 21;
|
|
5698
5743
|
break;
|
|
5699
5744
|
}
|
|
5700
|
-
|
|
5745
|
+
_context4.next = 18;
|
|
5701
5746
|
return action(file);
|
|
5702
5747
|
case 18:
|
|
5703
|
-
mergedAction =
|
|
5704
|
-
|
|
5748
|
+
mergedAction = _context4.sent;
|
|
5749
|
+
_context4.next = 22;
|
|
5705
5750
|
break;
|
|
5706
5751
|
case 21:
|
|
5707
5752
|
mergedAction = action;
|
|
@@ -5709,14 +5754,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5709
5754
|
// Get latest data
|
|
5710
5755
|
data = _this.props.data;
|
|
5711
5756
|
if (!(typeof data === 'function')) {
|
|
5712
|
-
|
|
5757
|
+
_context4.next = 29;
|
|
5713
5758
|
break;
|
|
5714
5759
|
}
|
|
5715
|
-
|
|
5760
|
+
_context4.next = 26;
|
|
5716
5761
|
return data(file);
|
|
5717
5762
|
case 26:
|
|
5718
|
-
mergedData =
|
|
5719
|
-
|
|
5763
|
+
mergedData = _context4.sent;
|
|
5764
|
+
_context4.next = 30;
|
|
5720
5765
|
break;
|
|
5721
5766
|
case 29:
|
|
5722
5767
|
mergedData = data;
|
|
@@ -5734,7 +5779,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5734
5779
|
}
|
|
5735
5780
|
mergedParsedFile = parsedFile;
|
|
5736
5781
|
mergedParsedFile.uid = file.uid;
|
|
5737
|
-
return
|
|
5782
|
+
return _context4.abrupt("return", {
|
|
5738
5783
|
origin: file,
|
|
5739
5784
|
data: mergedData,
|
|
5740
5785
|
parsedFile: mergedParsedFile,
|
|
@@ -5742,12 +5787,12 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5742
5787
|
});
|
|
5743
5788
|
case 35:
|
|
5744
5789
|
case "end":
|
|
5745
|
-
return
|
|
5790
|
+
return _context4.stop();
|
|
5746
5791
|
}
|
|
5747
|
-
},
|
|
5792
|
+
}, _callee4, null, [[3, 9]]);
|
|
5748
5793
|
}));
|
|
5749
|
-
return function (
|
|
5750
|
-
return
|
|
5794
|
+
return function (_x5, _x6) {
|
|
5795
|
+
return _ref5.apply(this, arguments);
|
|
5751
5796
|
};
|
|
5752
5797
|
}());
|
|
5753
5798
|
_defineProperty(_assertThisInitialized(_this), "saveFileInput", function (node) {
|
|
@@ -5759,31 +5804,46 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5759
5804
|
key: "componentDidMount",
|
|
5760
5805
|
value: function componentDidMount() {
|
|
5761
5806
|
this._isMounted = true;
|
|
5807
|
+
var pastable = this.props.pastable;
|
|
5808
|
+
if (pastable) {
|
|
5809
|
+
document.addEventListener('paste', this.onFilePaste);
|
|
5810
|
+
}
|
|
5762
5811
|
}
|
|
5763
5812
|
}, {
|
|
5764
5813
|
key: "componentWillUnmount",
|
|
5765
5814
|
value: function componentWillUnmount() {
|
|
5766
5815
|
this._isMounted = false;
|
|
5767
5816
|
this.abort();
|
|
5817
|
+
document.removeEventListener('paste', this.onFilePaste);
|
|
5818
|
+
}
|
|
5819
|
+
}, {
|
|
5820
|
+
key: "componentDidUpdate",
|
|
5821
|
+
value: function componentDidUpdate(prevProps) {
|
|
5822
|
+
var pastable = this.props.pastable;
|
|
5823
|
+
if (pastable && !prevProps.pastable) {
|
|
5824
|
+
document.addEventListener('paste', this.onFilePaste);
|
|
5825
|
+
} else if (!pastable && prevProps.pastable) {
|
|
5826
|
+
document.removeEventListener('paste', this.onFilePaste);
|
|
5827
|
+
}
|
|
5768
5828
|
}
|
|
5769
5829
|
}, {
|
|
5770
5830
|
key: "post",
|
|
5771
|
-
value: function post(
|
|
5831
|
+
value: function post(_ref6) {
|
|
5772
5832
|
var _this2 = this;
|
|
5773
|
-
var data =
|
|
5774
|
-
origin =
|
|
5775
|
-
action =
|
|
5776
|
-
parsedFile =
|
|
5833
|
+
var data = _ref6.data,
|
|
5834
|
+
origin = _ref6.origin,
|
|
5835
|
+
action = _ref6.action,
|
|
5836
|
+
parsedFile = _ref6.parsedFile;
|
|
5777
5837
|
if (!this._isMounted) {
|
|
5778
5838
|
return;
|
|
5779
5839
|
}
|
|
5780
|
-
var _this$
|
|
5781
|
-
onStart = _this$
|
|
5782
|
-
customRequest = _this$
|
|
5783
|
-
name = _this$
|
|
5784
|
-
headers = _this$
|
|
5785
|
-
withCredentials = _this$
|
|
5786
|
-
method = _this$
|
|
5840
|
+
var _this$props3 = this.props,
|
|
5841
|
+
onStart = _this$props3.onStart,
|
|
5842
|
+
customRequest = _this$props3.customRequest,
|
|
5843
|
+
name = _this$props3.name,
|
|
5844
|
+
headers = _this$props3.headers,
|
|
5845
|
+
withCredentials = _this$props3.withCredentials,
|
|
5846
|
+
method = _this$props3.method;
|
|
5787
5847
|
var uid = origin.uid;
|
|
5788
5848
|
var request = customRequest || upload;
|
|
5789
5849
|
var requestOption = {
|
|
@@ -5841,28 +5901,28 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5841
5901
|
}, {
|
|
5842
5902
|
key: "render",
|
|
5843
5903
|
value: function render() {
|
|
5844
|
-
var _this$
|
|
5845
|
-
Tag = _this$
|
|
5846
|
-
prefixCls = _this$
|
|
5847
|
-
className = _this$
|
|
5848
|
-
_this$
|
|
5849
|
-
classNames$1 = _this$
|
|
5850
|
-
disabled = _this$
|
|
5851
|
-
id = _this$
|
|
5852
|
-
name = _this$
|
|
5853
|
-
style = _this$
|
|
5854
|
-
_this$
|
|
5855
|
-
styles = _this$
|
|
5856
|
-
multiple = _this$
|
|
5857
|
-
accept = _this$
|
|
5858
|
-
capture = _this$
|
|
5859
|
-
children = _this$
|
|
5860
|
-
directory = _this$
|
|
5861
|
-
openFileDialogOnClick = _this$
|
|
5862
|
-
onMouseEnter = _this$
|
|
5863
|
-
onMouseLeave = _this$
|
|
5864
|
-
hasControlInside = _this$
|
|
5865
|
-
otherProps = _objectWithoutProperties(_this$
|
|
5904
|
+
var _this$props4 = this.props,
|
|
5905
|
+
Tag = _this$props4.component,
|
|
5906
|
+
prefixCls = _this$props4.prefixCls,
|
|
5907
|
+
className = _this$props4.className,
|
|
5908
|
+
_this$props4$classNam = _this$props4.classNames,
|
|
5909
|
+
classNames$1 = _this$props4$classNam === void 0 ? {} : _this$props4$classNam,
|
|
5910
|
+
disabled = _this$props4.disabled,
|
|
5911
|
+
id = _this$props4.id,
|
|
5912
|
+
name = _this$props4.name,
|
|
5913
|
+
style = _this$props4.style,
|
|
5914
|
+
_this$props4$styles = _this$props4.styles,
|
|
5915
|
+
styles = _this$props4$styles === void 0 ? {} : _this$props4$styles,
|
|
5916
|
+
multiple = _this$props4.multiple,
|
|
5917
|
+
accept = _this$props4.accept,
|
|
5918
|
+
capture = _this$props4.capture,
|
|
5919
|
+
children = _this$props4.children,
|
|
5920
|
+
directory = _this$props4.directory,
|
|
5921
|
+
openFileDialogOnClick = _this$props4.openFileDialogOnClick,
|
|
5922
|
+
onMouseEnter = _this$props4.onMouseEnter,
|
|
5923
|
+
onMouseLeave = _this$props4.onMouseLeave,
|
|
5924
|
+
hasControlInside = _this$props4.hasControlInside,
|
|
5925
|
+
otherProps = _objectWithoutProperties(_this$props4, _excluded$1);
|
|
5866
5926
|
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), "".concat(prefixCls, "-disabled"), disabled), className, className));
|
|
5867
5927
|
// because input don't have directory/webkitdirectory type declaration
|
|
5868
5928
|
var dirProps = directory ? {
|
|
@@ -5875,7 +5935,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5875
5935
|
onMouseEnter: onMouseEnter,
|
|
5876
5936
|
onMouseLeave: onMouseLeave,
|
|
5877
5937
|
onDrop: this.onFileDrop,
|
|
5878
|
-
onDragOver: this.
|
|
5938
|
+
onDragOver: this.onFileDragOver,
|
|
5879
5939
|
tabIndex: hasControlInside ? undefined : '0'
|
|
5880
5940
|
};
|
|
5881
5941
|
return /*#__PURE__*/React__default.createElement(Tag, _extends({}, events, {
|
|
@@ -5993,8 +6053,7 @@ const initMotionCommonLeave = duration => ({
|
|
|
5993
6053
|
animationDuration: duration,
|
|
5994
6054
|
animationFillMode: 'both'
|
|
5995
6055
|
});
|
|
5996
|
-
const initMotion =
|
|
5997
|
-
let sameLevel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6056
|
+
const initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
|
|
5998
6057
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
|
5999
6058
|
return {
|
|
6000
6059
|
[`
|
|
@@ -6037,8 +6096,7 @@ const fadeOut = new Keyframe('antFadeOut', {
|
|
|
6037
6096
|
opacity: 0
|
|
6038
6097
|
}
|
|
6039
6098
|
});
|
|
6040
|
-
const initFadeMotion =
|
|
6041
|
-
let sameLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6099
|
+
const initFadeMotion = (token, sameLevel = false) => {
|
|
6042
6100
|
const {
|
|
6043
6101
|
antCls
|
|
6044
6102
|
} = token;
|
|
@@ -6361,7 +6419,7 @@ const genListStyle = token => {
|
|
|
6361
6419
|
}
|
|
6362
6420
|
},
|
|
6363
6421
|
[`${componentCls}-icon ${iconCls}`]: {
|
|
6364
|
-
color: token.
|
|
6422
|
+
color: token.colorIcon,
|
|
6365
6423
|
fontSize
|
|
6366
6424
|
},
|
|
6367
6425
|
[`${itemCls}-progress`]: {
|
|
@@ -6720,7 +6778,7 @@ const genBaseStyle$1 = token => {
|
|
|
6720
6778
|
};
|
|
6721
6779
|
};
|
|
6722
6780
|
const prepareComponentToken$3 = token => ({
|
|
6723
|
-
actionsColor: token.
|
|
6781
|
+
actionsColor: token.colorIcon
|
|
6724
6782
|
});
|
|
6725
6783
|
// ============================== Export ==============================
|
|
6726
6784
|
const useStyle$4 = genStyleHooks('Upload', token => {
|
|
@@ -6762,22 +6820,19 @@ const getCurrentHeight = node => ({
|
|
|
6762
6820
|
height: node ? node.offsetHeight : 0
|
|
6763
6821
|
});
|
|
6764
6822
|
const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
6765
|
-
const initCollapseMotion =
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
motionDeadline: 500
|
|
6779
|
-
};
|
|
6780
|
-
};
|
|
6823
|
+
const initCollapseMotion = (rootCls = defaultPrefixCls) => ({
|
|
6824
|
+
motionName: `${rootCls}-motion-collapse`,
|
|
6825
|
+
onAppearStart: getCollapsedHeight,
|
|
6826
|
+
onEnterStart: getCollapsedHeight,
|
|
6827
|
+
onAppearActive: getRealHeight,
|
|
6828
|
+
onEnterActive: getRealHeight,
|
|
6829
|
+
onLeaveStart: getCurrentHeight,
|
|
6830
|
+
onLeaveActive: getCollapsedHeight,
|
|
6831
|
+
onAppearEnd: skipOpacityTransition,
|
|
6832
|
+
onEnterEnd: skipOpacityTransition,
|
|
6833
|
+
onLeaveEnd: skipOpacityTransition,
|
|
6834
|
+
motionDeadline: 500
|
|
6835
|
+
});
|
|
6781
6836
|
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
|
|
6782
6837
|
if (transitionName !== undefined) {
|
|
6783
6838
|
return transitionName;
|
|
@@ -6826,7 +6881,7 @@ const genWaveStyle = token => {
|
|
|
6826
6881
|
}
|
|
6827
6882
|
};
|
|
6828
6883
|
};
|
|
6829
|
-
const useStyle$3 = genComponentStyleHook('Wave',
|
|
6884
|
+
const useStyle$3 = genComponentStyleHook('Wave', genWaveStyle);
|
|
6830
6885
|
|
|
6831
6886
|
const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
|
|
6832
6887
|
|
|
@@ -6935,31 +6990,28 @@ const defaultReactRender = (node, container) => {
|
|
|
6935
6990
|
};
|
|
6936
6991
|
};
|
|
6937
6992
|
let unstableRender = defaultReactRender;
|
|
6938
|
-
|
|
6993
|
+
/**
|
|
6994
|
+
* @deprecated Set React render function for compatible usage.
|
|
6995
|
+
* This is internal usage only compatible with React 19.
|
|
6996
|
+
* And will be removed in next major version.
|
|
6997
|
+
*/
|
|
6998
|
+
function unstableSetRender(render) {
|
|
6939
6999
|
return unstableRender;
|
|
6940
7000
|
}
|
|
6941
7001
|
|
|
6942
7002
|
function isValidWaveColor(color) {
|
|
6943
7003
|
return color && color !== '#fff' && color !== '#ffffff' && color !== 'rgb(255, 255, 255)' && color !== 'rgba(255, 255, 255, 1)' && !/rgba\((?:\d*, ){3}0\)/.test(color) &&
|
|
6944
7004
|
// any transparent rgba color
|
|
6945
|
-
color !== 'transparent';
|
|
7005
|
+
color !== 'transparent' && color !== 'canvastext';
|
|
6946
7006
|
}
|
|
6947
7007
|
function getTargetWaveColor(node) {
|
|
7008
|
+
var _a;
|
|
6948
7009
|
const {
|
|
6949
7010
|
borderTopColor,
|
|
6950
7011
|
borderColor,
|
|
6951
7012
|
backgroundColor
|
|
6952
7013
|
} = getComputedStyle(node);
|
|
6953
|
-
|
|
6954
|
-
return borderTopColor;
|
|
6955
|
-
}
|
|
6956
|
-
if (isValidWaveColor(borderColor)) {
|
|
6957
|
-
return borderColor;
|
|
6958
|
-
}
|
|
6959
|
-
if (isValidWaveColor(backgroundColor)) {
|
|
6960
|
-
return backgroundColor;
|
|
6961
|
-
}
|
|
6962
|
-
return null;
|
|
7014
|
+
return (_a = [borderTopColor, borderColor, backgroundColor].find(isValidWaveColor)) !== null && _a !== void 0 ? _a : null;
|
|
6963
7015
|
}
|
|
6964
7016
|
|
|
6965
7017
|
function validateNum(value) {
|
|
@@ -7058,18 +7110,15 @@ const WaveEffect = props => {
|
|
|
7058
7110
|
}
|
|
7059
7111
|
return false;
|
|
7060
7112
|
}
|
|
7061
|
-
}, (
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
style: waveStyle
|
|
7071
|
-
});
|
|
7072
|
-
});
|
|
7113
|
+
}, ({
|
|
7114
|
+
className: motionClassName
|
|
7115
|
+
}, ref) => (/*#__PURE__*/React.createElement("div", {
|
|
7116
|
+
ref: composeRef(divRef, ref),
|
|
7117
|
+
className: classNames(className, motionClassName, {
|
|
7118
|
+
'wave-quick': isSmallComponent
|
|
7119
|
+
}),
|
|
7120
|
+
style: waveStyle
|
|
7121
|
+
})));
|
|
7073
7122
|
};
|
|
7074
7123
|
const showWaveEffect = (target, info) => {
|
|
7075
7124
|
var _a;
|
|
@@ -7086,7 +7135,7 @@ const showWaveEffect = (target, info) => {
|
|
|
7086
7135
|
holder.style.left = '0px';
|
|
7087
7136
|
holder.style.top = '0px';
|
|
7088
7137
|
target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
|
|
7089
|
-
const reactRender =
|
|
7138
|
+
const reactRender = unstableSetRender();
|
|
7090
7139
|
let unmountCallback = null;
|
|
7091
7140
|
function registerUnmount() {
|
|
7092
7141
|
return unmountCallback;
|
|
@@ -7398,11 +7447,10 @@ const DefaultLoadingIcon = props => {
|
|
|
7398
7447
|
onEnterActive: getRealWidth,
|
|
7399
7448
|
onLeaveStart: getRealWidth,
|
|
7400
7449
|
onLeaveActive: getCollapsedWidth
|
|
7401
|
-
}, (
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
} = _ref;
|
|
7450
|
+
}, ({
|
|
7451
|
+
className: motionCls,
|
|
7452
|
+
style: motionStyle
|
|
7453
|
+
}, ref) => {
|
|
7406
7454
|
const mergedStyle = Object.assign(Object.assign({}, style), motionStyle);
|
|
7407
7455
|
return /*#__PURE__*/React__default.createElement(InnerLoadingIcon, {
|
|
7408
7456
|
prefixCls: prefixCls,
|
|
@@ -7498,16 +7546,13 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
7498
7546
|
}
|
|
7499
7547
|
const isArray = Array.isArray(color);
|
|
7500
7548
|
if (isArray && color.length) {
|
|
7501
|
-
this.colors = color.map(
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
percent
|
|
7509
|
-
};
|
|
7510
|
-
});
|
|
7549
|
+
this.colors = color.map(({
|
|
7550
|
+
color: c,
|
|
7551
|
+
percent
|
|
7552
|
+
}) => ({
|
|
7553
|
+
color: new AggregationColor(c),
|
|
7554
|
+
percent
|
|
7555
|
+
}));
|
|
7511
7556
|
this.metaColor = new Color(this.colors[0].color.metaColor);
|
|
7512
7557
|
} else {
|
|
7513
7558
|
this.metaColor = new Color(isArray ? '' : color);
|
|
@@ -7590,6 +7635,13 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
7590
7635
|
}]);
|
|
7591
7636
|
}();
|
|
7592
7637
|
|
|
7638
|
+
const generateColor = color => {
|
|
7639
|
+
if (color instanceof AggregationColor) {
|
|
7640
|
+
return color;
|
|
7641
|
+
}
|
|
7642
|
+
return new AggregationColor(color);
|
|
7643
|
+
};
|
|
7644
|
+
|
|
7593
7645
|
const isBright = (value, bgColorToken) => {
|
|
7594
7646
|
const {
|
|
7595
7647
|
r,
|
|
@@ -7631,6 +7683,7 @@ const prepareComponentToken$2 = token => {
|
|
|
7631
7683
|
}), {});
|
|
7632
7684
|
return Object.assign(Object.assign({}, shadowColorTokens), {
|
|
7633
7685
|
fontWeight: 400,
|
|
7686
|
+
iconGap: token.marginXS,
|
|
7634
7687
|
defaultShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`,
|
|
7635
7688
|
primaryShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`,
|
|
7636
7689
|
dangerShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`,
|
|
@@ -7684,7 +7737,7 @@ const genSharedButtonStyle = token => {
|
|
|
7684
7737
|
opacityLoading,
|
|
7685
7738
|
motionDurationSlow,
|
|
7686
7739
|
motionEaseInOut,
|
|
7687
|
-
|
|
7740
|
+
iconGap,
|
|
7688
7741
|
calc
|
|
7689
7742
|
} = token;
|
|
7690
7743
|
return {
|
|
@@ -7692,7 +7745,7 @@ const genSharedButtonStyle = token => {
|
|
|
7692
7745
|
outline: 'none',
|
|
7693
7746
|
position: 'relative',
|
|
7694
7747
|
display: 'inline-flex',
|
|
7695
|
-
gap:
|
|
7748
|
+
gap: iconGap,
|
|
7696
7749
|
alignItems: 'center',
|
|
7697
7750
|
justifyContent: 'center',
|
|
7698
7751
|
fontWeight,
|
|
@@ -7744,7 +7797,7 @@ const genSharedButtonStyle = token => {
|
|
|
7744
7797
|
[`&:not(${componentCls}-icon-end)`]: {
|
|
7745
7798
|
[`${componentCls}-loading-icon-motion`]: {
|
|
7746
7799
|
'&-appear-start, &-enter-start': {
|
|
7747
|
-
marginInlineEnd: calc(
|
|
7800
|
+
marginInlineEnd: calc(iconGap).mul(-1).equal()
|
|
7748
7801
|
},
|
|
7749
7802
|
'&-appear-active, &-enter-active': {
|
|
7750
7803
|
marginInlineEnd: 0
|
|
@@ -7753,7 +7806,7 @@ const genSharedButtonStyle = token => {
|
|
|
7753
7806
|
marginInlineEnd: 0
|
|
7754
7807
|
},
|
|
7755
7808
|
'&-leave-active': {
|
|
7756
|
-
marginInlineEnd: calc(
|
|
7809
|
+
marginInlineEnd: calc(iconGap).mul(-1).equal()
|
|
7757
7810
|
}
|
|
7758
7811
|
}
|
|
7759
7812
|
},
|
|
@@ -7761,7 +7814,7 @@ const genSharedButtonStyle = token => {
|
|
|
7761
7814
|
flexDirection: 'row-reverse',
|
|
7762
7815
|
[`${componentCls}-loading-icon-motion`]: {
|
|
7763
7816
|
'&-appear-start, &-enter-start': {
|
|
7764
|
-
marginInlineStart: calc(
|
|
7817
|
+
marginInlineStart: calc(iconGap).mul(-1).equal()
|
|
7765
7818
|
},
|
|
7766
7819
|
'&-appear-active, &-enter-active': {
|
|
7767
7820
|
marginInlineStart: 0
|
|
@@ -7770,7 +7823,7 @@ const genSharedButtonStyle = token => {
|
|
|
7770
7823
|
marginInlineStart: 0
|
|
7771
7824
|
},
|
|
7772
7825
|
'&-leave-active': {
|
|
7773
|
-
marginInlineStart: calc(
|
|
7826
|
+
marginInlineStart: calc(iconGap).mul(-1).equal()
|
|
7774
7827
|
}
|
|
7775
7828
|
}
|
|
7776
7829
|
}
|
|
@@ -7893,8 +7946,10 @@ const genPresetColorStyle = token => {
|
|
|
7893
7946
|
borderColor: activeColor,
|
|
7894
7947
|
background: token.colorBgContainer
|
|
7895
7948
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, lightColor, {
|
|
7949
|
+
color: darkColor,
|
|
7896
7950
|
background: lightHoverColor
|
|
7897
7951
|
}, {
|
|
7952
|
+
color: darkColor,
|
|
7898
7953
|
background: lightBorderColor
|
|
7899
7954
|
})), genTextLinkButtonStyle(token, darkColor, 'link', {
|
|
7900
7955
|
color: hoverColor
|
|
@@ -7920,8 +7975,10 @@ const genDefaultButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
7920
7975
|
color: token.solidTextColor,
|
|
7921
7976
|
background: token.colorBgSolidActive
|
|
7922
7977
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorFillTertiary, {
|
|
7978
|
+
color: token.defaultColor,
|
|
7923
7979
|
background: token.colorFillSecondary
|
|
7924
7980
|
}, {
|
|
7981
|
+
color: token.defaultColor,
|
|
7925
7982
|
background: token.colorFill
|
|
7926
7983
|
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder)), genTextLinkButtonStyle(token, token.textTextColor, 'link', {
|
|
7927
7984
|
color: token.colorLinkHover,
|
|
@@ -7941,8 +7998,10 @@ const genPrimaryButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
7941
7998
|
borderColor: token.colorPrimaryActive,
|
|
7942
7999
|
background: token.colorBgContainer
|
|
7943
8000
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorPrimaryBg, {
|
|
8001
|
+
color: token.colorPrimary,
|
|
7944
8002
|
background: token.colorPrimaryBgHover
|
|
7945
8003
|
}, {
|
|
8004
|
+
color: token.colorPrimary,
|
|
7946
8005
|
background: token.colorPrimaryBorder
|
|
7947
8006
|
})), genTextLinkButtonStyle(token, token.colorPrimaryText, 'text', {
|
|
7948
8007
|
color: token.colorPrimaryTextHover,
|
|
@@ -7976,8 +8035,10 @@ const genDangerousStyle = token => Object.assign(Object.assign(Object.assign(Obj
|
|
|
7976
8035
|
color: token.colorErrorActive,
|
|
7977
8036
|
borderColor: token.colorErrorActive
|
|
7978
8037
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorErrorBg, {
|
|
8038
|
+
color: token.colorError,
|
|
7979
8039
|
background: token.colorErrorBgFilledHover
|
|
7980
8040
|
}, {
|
|
8041
|
+
color: token.colorError,
|
|
7981
8042
|
background: token.colorErrorBgActive
|
|
7982
8043
|
})), genTextLinkButtonStyle(token, token.colorError, 'text', {
|
|
7983
8044
|
color: token.colorErrorHover,
|
|
@@ -8046,8 +8107,7 @@ const genCompatibleButtonStyle = token => Object.assign(Object.assign(Object.ass
|
|
|
8046
8107
|
color: token.colorLinkActive
|
|
8047
8108
|
}));
|
|
8048
8109
|
// =============================== Size ===============================
|
|
8049
|
-
const genButtonStyle =
|
|
8050
|
-
let prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
8110
|
+
const genButtonStyle = (token, prefixCls = '') => {
|
|
8051
8111
|
const {
|
|
8052
8112
|
componentCls,
|
|
8053
8113
|
controlHeight,
|
|
@@ -8146,7 +8206,7 @@ const useStyle$2 = genStyleHooks('Button', token => {
|
|
|
8146
8206
|
});
|
|
8147
8207
|
|
|
8148
8208
|
// handle border collapse
|
|
8149
|
-
function compactItemBorder(token, parentCls, options) {
|
|
8209
|
+
function compactItemBorder(token, parentCls, options, prefixCls) {
|
|
8150
8210
|
const {
|
|
8151
8211
|
focusElCls,
|
|
8152
8212
|
focus,
|
|
@@ -8158,13 +8218,16 @@ function compactItemBorder(token, parentCls, options) {
|
|
|
8158
8218
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
8159
8219
|
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()
|
|
8160
8220
|
},
|
|
8221
|
+
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
8222
|
+
zIndex: 2
|
|
8223
|
+
},
|
|
8161
8224
|
'&-item': Object.assign(Object.assign({
|
|
8162
8225
|
[hoverEffects]: {
|
|
8163
|
-
zIndex:
|
|
8226
|
+
zIndex: 3
|
|
8164
8227
|
}
|
|
8165
8228
|
}, focusElCls ? {
|
|
8166
8229
|
[`&${focusElCls}`]: {
|
|
8167
|
-
zIndex:
|
|
8230
|
+
zIndex: 3
|
|
8168
8231
|
}
|
|
8169
8232
|
} : {}), {
|
|
8170
8233
|
[`&[disabled] ${childCombinator}`]: {
|
|
@@ -8197,28 +8260,30 @@ function compactItemBorderRadius(prefixCls, parentCls, options) {
|
|
|
8197
8260
|
}
|
|
8198
8261
|
};
|
|
8199
8262
|
}
|
|
8200
|
-
function genCompactItemStyle(token
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
};
|
|
8263
|
+
function genCompactItemStyle(token, options = {
|
|
8264
|
+
focus: true
|
|
8265
|
+
}) {
|
|
8204
8266
|
const {
|
|
8205
8267
|
componentCls
|
|
8206
8268
|
} = token;
|
|
8207
8269
|
const compactCls = `${componentCls}-compact`;
|
|
8208
8270
|
return {
|
|
8209
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))
|
|
8271
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options, componentCls)), compactItemBorderRadius(componentCls, compactCls, options))
|
|
8210
8272
|
};
|
|
8211
8273
|
}
|
|
8212
8274
|
|
|
8213
|
-
function compactItemVerticalBorder(token, parentCls) {
|
|
8275
|
+
function compactItemVerticalBorder(token, parentCls, prefixCls) {
|
|
8214
8276
|
return {
|
|
8215
8277
|
// border collapse
|
|
8216
8278
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
8217
8279
|
marginBottom: token.calc(token.lineWidth).mul(-1).equal()
|
|
8218
8280
|
},
|
|
8281
|
+
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
8282
|
+
zIndex: 2
|
|
8283
|
+
},
|
|
8219
8284
|
'&-item': {
|
|
8220
8285
|
'&:hover,&:focus,&:active': {
|
|
8221
|
-
zIndex:
|
|
8286
|
+
zIndex: 3
|
|
8222
8287
|
},
|
|
8223
8288
|
'&[disabled]': {
|
|
8224
8289
|
zIndex: 0
|
|
@@ -8248,7 +8313,7 @@ function compactItemBorderVerticalRadius(prefixCls, parentCls) {
|
|
|
8248
8313
|
function genCompactItemVerticalStyle(token) {
|
|
8249
8314
|
const compactCls = `${token.componentCls}-compact-vertical`;
|
|
8250
8315
|
return {
|
|
8251
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
|
|
8316
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls, token.componentCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
|
|
8252
8317
|
};
|
|
8253
8318
|
}
|
|
8254
8319
|
|
|
@@ -8324,7 +8389,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8324
8389
|
variant,
|
|
8325
8390
|
type,
|
|
8326
8391
|
danger = false,
|
|
8327
|
-
shape
|
|
8392
|
+
shape: customizeShape,
|
|
8328
8393
|
size: customizeSize,
|
|
8329
8394
|
styles,
|
|
8330
8395
|
disabled: customDisabled,
|
|
@@ -8346,16 +8411,30 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8346
8411
|
// https://github.com/ant-design/ant-design/issues/47605
|
|
8347
8412
|
// Compatible with original `type` behavior
|
|
8348
8413
|
const mergedType = type || 'default';
|
|
8414
|
+
const {
|
|
8415
|
+
button
|
|
8416
|
+
} = React__default.useContext(ConfigContext);
|
|
8417
|
+
const shape = customizeShape || (button === null || button === void 0 ? void 0 : button.shape) || 'default';
|
|
8349
8418
|
const [mergedColor, mergedVariant] = useMemo$1(() => {
|
|
8419
|
+
// >>>>> Local
|
|
8420
|
+
// Color & Variant
|
|
8350
8421
|
if (color && variant) {
|
|
8351
8422
|
return [color, variant];
|
|
8352
8423
|
}
|
|
8353
|
-
|
|
8354
|
-
if (danger) {
|
|
8355
|
-
|
|
8424
|
+
// Sugar syntax
|
|
8425
|
+
if (type || danger) {
|
|
8426
|
+
const colorVariantPair = ButtonTypeMap[mergedType] || [];
|
|
8427
|
+
if (danger) {
|
|
8428
|
+
return ['danger', colorVariantPair[1]];
|
|
8429
|
+
}
|
|
8430
|
+
return colorVariantPair;
|
|
8431
|
+
}
|
|
8432
|
+
// >>> Context fallback
|
|
8433
|
+
if ((button === null || button === void 0 ? void 0 : button.color) && (button === null || button === void 0 ? void 0 : button.variant)) {
|
|
8434
|
+
return [button.color, button.variant];
|
|
8356
8435
|
}
|
|
8357
|
-
return
|
|
8358
|
-
}, [type, color, variant, danger]);
|
|
8436
|
+
return ['default', 'outlined'];
|
|
8437
|
+
}, [type, color, variant, danger, button === null || button === void 0 ? void 0 : button.variant, button === null || button === void 0 ? void 0 : button.color]);
|
|
8359
8438
|
const isDanger = mergedColor === 'danger';
|
|
8360
8439
|
const mergedColorText = isDanger ? 'dangerous' : mergedColor;
|
|
8361
8440
|
const {
|
|
@@ -8390,8 +8469,9 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8390
8469
|
};
|
|
8391
8470
|
}, []);
|
|
8392
8471
|
// ========================= Effect =========================
|
|
8393
|
-
// Loading
|
|
8394
|
-
|
|
8472
|
+
// Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
|
|
8473
|
+
// https://github.com/ant-design/ant-design/issues/51325
|
|
8474
|
+
useLayoutEffect$1(() => {
|
|
8395
8475
|
let delayTimer = null;
|
|
8396
8476
|
if (loadingOrDelay.delay > 0) {
|
|
8397
8477
|
delayTimer = setTimeout(() => {
|
|
@@ -8408,7 +8488,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8408
8488
|
}
|
|
8409
8489
|
}
|
|
8410
8490
|
return cleanupTimer;
|
|
8411
|
-
}, [loadingOrDelay]);
|
|
8491
|
+
}, [loadingOrDelay.delay, loadingOrDelay.loading]);
|
|
8412
8492
|
// Two chinese characters check
|
|
8413
8493
|
useEffect(() => {
|
|
8414
8494
|
// FIXME: for HOC usage like <FormatMessage />
|
|
@@ -8466,7 +8546,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8466
8546
|
// ========================= Render =========================
|
|
8467
8547
|
const classes = classNames(prefixCls, hashId, cssVarCls, {
|
|
8468
8548
|
[`${prefixCls}-${shape}`]: shape !== 'default' && shape,
|
|
8469
|
-
//
|
|
8549
|
+
// Compatible with versions earlier than 5.21.0
|
|
8470
8550
|
[`${prefixCls}-${mergedType}`]: mergedType,
|
|
8471
8551
|
[`${prefixCls}-dangerous`]: danger,
|
|
8472
8552
|
[`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
|
|
@@ -8550,12 +8630,9 @@ function file2Obj(file) {
|
|
|
8550
8630
|
/** Upload fileList. Replace file if exist or just push into it. */
|
|
8551
8631
|
function updateFileList(file, fileList) {
|
|
8552
8632
|
const nextFileList = _toConsumableArray(fileList);
|
|
8553
|
-
const fileIndex = nextFileList.findIndex(
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
} = _ref;
|
|
8557
|
-
return uid === file.uid;
|
|
8558
|
-
});
|
|
8633
|
+
const fileIndex = nextFileList.findIndex(({
|
|
8634
|
+
uid
|
|
8635
|
+
}) => uid === file.uid);
|
|
8559
8636
|
if (fileIndex === -1) {
|
|
8560
8637
|
nextFileList.push(file);
|
|
8561
8638
|
} else {
|
|
@@ -8576,8 +8653,7 @@ function removeFileItem(file, fileList) {
|
|
|
8576
8653
|
return removed;
|
|
8577
8654
|
}
|
|
8578
8655
|
// ==================== Default Image Preview ====================
|
|
8579
|
-
const extname =
|
|
8580
|
-
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8656
|
+
const extname = (url = '') => {
|
|
8581
8657
|
const temp = url.split('/');
|
|
8582
8658
|
const filename = temp[temp.length - 1];
|
|
8583
8659
|
const filenameWithoutSuffix = filename.split(/#|\?/)[0];
|
|
@@ -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
|
})));
|