@pnkx-lib/ui 1.9.513 → 1.9.514
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-Dhv5_mhq.js → GenericUploadModal-CkhTggnS.js} +575 -637
- package/es/chunks/{bundle-mjs-BME7zF0Z.js → bundle-mjs-BBFHkixS.js} +1 -1
- package/es/chunks/{index.esm-Dr5ZHcf7.js → index.esm-Ds4t-z37.js} +3 -6
- package/es/chunks/{toArray-2LkvUaha.js → toArray-DzhjhY0s.js} +81 -68
- 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 +17 -36
- 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 +30 -33
- package/es/ui/Modal.js +1 -1
- package/es/ui/SearchFilterForm.js +1 -1
- package/es/ui/SelectSingleTable.js +16 -3
- 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 +2061 -2166
- package/package.json +1 -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, 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-DzhjhY0s.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-Ds4t-z37.js';
|
|
16
16
|
import { toast } from '@pnkx-lib/core';
|
|
17
17
|
import { R as RefIcon$b } from './InboxOutlined-BBuIJe6u.js';
|
|
18
18
|
|
|
@@ -3627,6 +3627,8 @@ 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,
|
|
3630
3632
|
popupPosition = _win$getComputedStyle.position;
|
|
3631
3633
|
var originLeft = popupElement.style.left;
|
|
3632
3634
|
var originTop = popupElement.style.top;
|
|
@@ -3675,9 +3677,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
3675
3677
|
};
|
|
3676
3678
|
}
|
|
3677
3679
|
var popupRect = popupElement.getBoundingClientRect();
|
|
3678
|
-
var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
|
|
3679
|
-
height = _win$getComputedStyle2.height,
|
|
3680
|
-
width = _win$getComputedStyle2.width;
|
|
3681
3680
|
popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
|
|
3682
3681
|
popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
|
|
3683
3682
|
var _doc$documentElement = doc.documentElement,
|
|
@@ -4551,10 +4550,6 @@ function generateTrigger() {
|
|
|
4551
4550
|
cloneProps.className = classNames(originChildProps.className, className);
|
|
4552
4551
|
}
|
|
4553
4552
|
|
|
4554
|
-
// ============================ Perf ============================
|
|
4555
|
-
var renderedRef = React.useRef(false);
|
|
4556
|
-
renderedRef.current || (renderedRef.current = forceRender || mergedOpen || inMotion);
|
|
4557
|
-
|
|
4558
4553
|
// =========================== Render ===========================
|
|
4559
4554
|
var mergedChildrenProps = _objectSpread2(_objectSpread2({}, originChildProps), cloneProps);
|
|
4560
4555
|
|
|
@@ -4589,7 +4584,7 @@ function generateTrigger() {
|
|
|
4589
4584
|
onResize: onTargetResize
|
|
4590
4585
|
}, /*#__PURE__*/React.createElement(TriggerWrapper, {
|
|
4591
4586
|
getTriggerDOMNode: getTriggerDOMNode
|
|
4592
|
-
}, triggerNode)),
|
|
4587
|
+
}, triggerNode)), /*#__PURE__*/React.createElement(TriggerContext.Provider, {
|
|
4593
4588
|
value: context
|
|
4594
4589
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
4595
4590
|
portal: PortalComponent,
|
|
@@ -4824,257 +4819,274 @@ var Tooltip$1 = function Tooltip(props, ref) {
|
|
|
4824
4819
|
};
|
|
4825
4820
|
const Tooltip$2 = /*#__PURE__*/forwardRef(Tooltip$1);
|
|
4826
4821
|
|
|
4827
|
-
function
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4822
|
+
function _regeneratorRuntime() {
|
|
4823
|
+
_regeneratorRuntime = function _regeneratorRuntime() {
|
|
4824
|
+
return r;
|
|
4825
|
+
};
|
|
4826
|
+
var t,
|
|
4827
|
+
r = {},
|
|
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
|
+
}
|
|
4833
4842
|
try {
|
|
4834
|
-
|
|
4835
|
-
} catch (
|
|
4836
|
-
|
|
4843
|
+
c({}, "");
|
|
4844
|
+
} catch (t) {
|
|
4845
|
+
c = function c(t, r, e) {
|
|
4846
|
+
return t[r] = e;
|
|
4847
|
+
};
|
|
4837
4848
|
}
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
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;
|
|
4878
|
-
}
|
|
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));
|
|
4849
|
+
function h(r, e, n, o) {
|
|
4850
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
4851
|
+
a = Object.create(i.prototype);
|
|
4852
|
+
return c(a, "_invoke", function (r, e, n) {
|
|
4853
|
+
var o = 1;
|
|
4854
|
+
return function (i, a) {
|
|
4855
|
+
if (3 === o) throw Error("Generator is already running");
|
|
4856
|
+
if (4 === o) {
|
|
4857
|
+
if ("throw" === i) throw a;
|
|
4858
|
+
return {
|
|
4859
|
+
value: t,
|
|
4860
|
+
done: true
|
|
4861
|
+
};
|
|
4887
4862
|
}
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4863
|
+
for (n.method = i, n.arg = a;;) {
|
|
4864
|
+
var u = n.delegate;
|
|
4865
|
+
if (u) {
|
|
4866
|
+
var c = d(u, n);
|
|
4867
|
+
if (c) {
|
|
4868
|
+
if (c === f) continue;
|
|
4869
|
+
return c;
|
|
4870
|
+
}
|
|
4871
|
+
}
|
|
4872
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
4873
|
+
if (1 === o) throw o = 4, n.arg;
|
|
4874
|
+
n.dispatchException(n.arg);
|
|
4875
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
4876
|
+
o = 3;
|
|
4877
|
+
var h = s(r, e, n);
|
|
4878
|
+
if ("normal" === h.type) {
|
|
4879
|
+
if (o = n.done ? 4 : 2, h.arg === f) continue;
|
|
4880
|
+
return {
|
|
4881
|
+
value: h.arg,
|
|
4882
|
+
done: n.done
|
|
4883
|
+
};
|
|
4908
4884
|
}
|
|
4885
|
+
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
4909
4886
|
}
|
|
4910
|
-
return {
|
|
4911
|
-
value: t,
|
|
4912
|
-
done: y
|
|
4913
|
-
};
|
|
4914
4887
|
};
|
|
4915
|
-
}(r,
|
|
4888
|
+
}(r, n, new Context(o || [])), true), a;
|
|
4916
4889
|
}
|
|
4917
|
-
|
|
4918
|
-
function Generator() {}
|
|
4919
|
-
function GeneratorFunction() {}
|
|
4920
|
-
function GeneratorFunctionPrototype() {}
|
|
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 () {
|
|
4930
|
-
return this;
|
|
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) {
|
|
4890
|
+
function s(t, r, e) {
|
|
4943
4891
|
try {
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
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);
|
|
4954
|
-
});
|
|
4892
|
+
return {
|
|
4893
|
+
type: "normal",
|
|
4894
|
+
arg: t.call(r, e)
|
|
4895
|
+
};
|
|
4955
4896
|
} catch (t) {
|
|
4956
|
-
|
|
4897
|
+
return {
|
|
4898
|
+
type: "throw",
|
|
4899
|
+
arg: t
|
|
4900
|
+
};
|
|
4957
4901
|
}
|
|
4958
4902
|
}
|
|
4959
|
-
|
|
4960
|
-
|
|
4903
|
+
r.wrap = h;
|
|
4904
|
+
var f = {};
|
|
4905
|
+
function Generator() {}
|
|
4906
|
+
function GeneratorFunction() {}
|
|
4907
|
+
function GeneratorFunctionPrototype() {}
|
|
4908
|
+
var l = {};
|
|
4909
|
+
c(l, i, function () {
|
|
4961
4910
|
return this;
|
|
4962
|
-
})
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4911
|
+
});
|
|
4912
|
+
var p = Object.getPrototypeOf,
|
|
4913
|
+
y = p && p(p(x([])));
|
|
4914
|
+
y && y !== e && n.call(y, i) && (l = y);
|
|
4915
|
+
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
|
|
4916
|
+
function g(t) {
|
|
4917
|
+
["next", "throw", "return"].forEach(function (r) {
|
|
4918
|
+
c(t, r, function (t) {
|
|
4919
|
+
return this._invoke(r, t);
|
|
4966
4920
|
});
|
|
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);
|
|
4967
4940
|
}
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
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
|
-
};
|
|
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
|
+
});
|
|
5005
4947
|
}
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
e =
|
|
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
|
-
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
5041
|
-
},
|
|
5042
|
-
finish: function finish(r) {
|
|
5043
|
-
return t(n.f, r);
|
|
5044
|
-
}
|
|
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;
|
|
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;
|
|
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;
|
|
5057
4982
|
}
|
|
5058
|
-
}
|
|
4983
|
+
}
|
|
4984
|
+
throw new TypeError(_typeof(r) + " is not iterable");
|
|
5059
4985
|
}
|
|
5060
|
-
return (
|
|
4986
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) {
|
|
4987
|
+
var r = "function" == typeof t && t.constructor;
|
|
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) {
|
|
5061
4992
|
return {
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
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 () {
|
|
5004
|
+
return this;
|
|
5005
|
+
}), c(v, "toString", function () {
|
|
5006
|
+
return "[object Generator]";
|
|
5007
|
+
}), r.keys = function (t) {
|
|
5008
|
+
var r = Object(t),
|
|
5009
|
+
e = [];
|
|
5010
|
+
for (var n in r) e.unshift(n);
|
|
5011
|
+
return function t() {
|
|
5012
|
+
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
|
|
5013
|
+
return t.done = true, t;
|
|
5076
5014
|
};
|
|
5077
|
-
}
|
|
5015
|
+
}, r.values = x, Context.prototype = {
|
|
5016
|
+
constructor: Context,
|
|
5017
|
+
reset: function reset(r) {
|
|
5018
|
+
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
|
|
5019
|
+
},
|
|
5020
|
+
stop: function stop() {
|
|
5021
|
+
this.done = true;
|
|
5022
|
+
var t = this.tryEntries[0][4];
|
|
5023
|
+
if ("throw" === t.type) throw t.arg;
|
|
5024
|
+
return this.rval;
|
|
5025
|
+
},
|
|
5026
|
+
dispatchException: function dispatchException(r) {
|
|
5027
|
+
if (this.done) throw r;
|
|
5028
|
+
var e = this;
|
|
5029
|
+
function n(t) {
|
|
5030
|
+
a.type = "throw", a.arg = r, e.next = t;
|
|
5031
|
+
}
|
|
5032
|
+
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
|
|
5033
|
+
var i = this.tryEntries[o],
|
|
5034
|
+
a = i[4],
|
|
5035
|
+
u = this.prev,
|
|
5036
|
+
c = i[1],
|
|
5037
|
+
h = i[2];
|
|
5038
|
+
if (-1 === i[0]) return n("end"), false;
|
|
5039
|
+
if (!c && !h) throw Error("try statement without catch or finally");
|
|
5040
|
+
if (null != i[0] && i[0] <= u) {
|
|
5041
|
+
if (u < c) return this.method = "next", this.arg = t, n(c), true;
|
|
5042
|
+
if (u < h) return n(h), false;
|
|
5043
|
+
}
|
|
5044
|
+
}
|
|
5045
|
+
},
|
|
5046
|
+
abrupt: function abrupt(t, r) {
|
|
5047
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
5048
|
+
var n = this.tryEntries[e];
|
|
5049
|
+
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
|
|
5050
|
+
var o = n;
|
|
5051
|
+
break;
|
|
5052
|
+
}
|
|
5053
|
+
}
|
|
5054
|
+
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
|
|
5055
|
+
var i = o ? o[4] : {};
|
|
5056
|
+
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
|
|
5057
|
+
},
|
|
5058
|
+
complete: function complete(t, r) {
|
|
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;
|
|
5078
|
+
}
|
|
5079
|
+
}
|
|
5080
|
+
throw Error("illegal catch attempt");
|
|
5081
|
+
},
|
|
5082
|
+
delegateYield: function delegateYield(r, e, n) {
|
|
5083
|
+
return this.delegate = {
|
|
5084
|
+
i: x(r),
|
|
5085
|
+
r: e,
|
|
5086
|
+
n: n
|
|
5087
|
+
}, "next" === this.method && (this.arg = t), f;
|
|
5088
|
+
}
|
|
5089
|
+
}, r;
|
|
5078
5090
|
}
|
|
5079
5091
|
|
|
5080
5092
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -5569,26 +5581,26 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5569
5581
|
_this.onClick(e);
|
|
5570
5582
|
}
|
|
5571
5583
|
});
|
|
5572
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
5573
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
5574
|
-
var
|
|
5584
|
+
_defineProperty(_assertThisInitialized(_this), "onFileDrop", /*#__PURE__*/function () {
|
|
5585
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
|
5586
|
+
var multiple, files, _files;
|
|
5575
5587
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5576
5588
|
while (1) switch (_context.prev = _context.next) {
|
|
5577
5589
|
case 0:
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
})) {
|
|
5584
|
-
existFileCallback === null || existFileCallback === void 0 || existFileCallback();
|
|
5590
|
+
multiple = _this.props.multiple;
|
|
5591
|
+
e.preventDefault();
|
|
5592
|
+
if (!(e.type === 'dragover')) {
|
|
5593
|
+
_context.next = 4;
|
|
5594
|
+
break;
|
|
5585
5595
|
}
|
|
5586
|
-
|
|
5596
|
+
return _context.abrupt("return");
|
|
5597
|
+
case 4:
|
|
5598
|
+
if (!_this.props.directory) {
|
|
5587
5599
|
_context.next = 11;
|
|
5588
5600
|
break;
|
|
5589
5601
|
}
|
|
5590
5602
|
_context.next = 7;
|
|
5591
|
-
return traverseFileTree(Array.prototype.slice.call(items), function (_file) {
|
|
5603
|
+
return traverseFileTree(Array.prototype.slice.call(e.dataTransfer.items), function (_file) {
|
|
5592
5604
|
return attrAccept(_file, _this.props.accept);
|
|
5593
5605
|
});
|
|
5594
5606
|
case 7:
|
|
@@ -5597,80 +5609,23 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5597
5609
|
_context.next = 14;
|
|
5598
5610
|
break;
|
|
5599
5611
|
case 11:
|
|
5600
|
-
|
|
5601
|
-
return attrAccept(file, accept);
|
|
5612
|
+
_files = _toConsumableArray(e.dataTransfer.files).filter(function (file) {
|
|
5613
|
+
return attrAccept(file, _this.props.accept);
|
|
5602
5614
|
});
|
|
5603
5615
|
if (multiple === false) {
|
|
5604
|
-
|
|
5616
|
+
_files = _files.slice(0, 1);
|
|
5605
5617
|
}
|
|
5606
|
-
_this.uploadFiles(
|
|
5618
|
+
_this.uploadFiles(_files);
|
|
5607
5619
|
case 14:
|
|
5608
5620
|
case "end":
|
|
5609
5621
|
return _context.stop();
|
|
5610
5622
|
}
|
|
5611
5623
|
}, _callee);
|
|
5612
5624
|
}));
|
|
5613
|
-
return function (_x
|
|
5625
|
+
return function (_x) {
|
|
5614
5626
|
return _ref.apply(this, arguments);
|
|
5615
5627
|
};
|
|
5616
5628
|
}());
|
|
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
|
-
}());
|
|
5674
5629
|
_defineProperty(_assertThisInitialized(_this), "uploadFiles", function (files) {
|
|
5675
5630
|
var originFiles = _toConsumableArray(files);
|
|
5676
5631
|
var postFiles = originFiles.map(function (file) {
|
|
@@ -5682,9 +5637,9 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5682
5637
|
// Batch upload files
|
|
5683
5638
|
Promise.all(postFiles).then(function (fileList) {
|
|
5684
5639
|
var onBatchStart = _this.props.onBatchStart;
|
|
5685
|
-
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (
|
|
5686
|
-
var origin =
|
|
5687
|
-
parsedFile =
|
|
5640
|
+
onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (_ref2) {
|
|
5641
|
+
var origin = _ref2.origin,
|
|
5642
|
+
parsedFile = _ref2.parsedFile;
|
|
5688
5643
|
return {
|
|
5689
5644
|
file: origin,
|
|
5690
5645
|
parsedFile: parsedFile
|
|
@@ -5701,35 +5656,35 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5701
5656
|
* Process file before upload. When all the file is ready, we start upload.
|
|
5702
5657
|
*/
|
|
5703
5658
|
_defineProperty(_assertThisInitialized(_this), "processFile", /*#__PURE__*/function () {
|
|
5704
|
-
var
|
|
5659
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, fileList) {
|
|
5705
5660
|
var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;
|
|
5706
|
-
return _regeneratorRuntime().wrap(function
|
|
5707
|
-
while (1) switch (
|
|
5661
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5662
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5708
5663
|
case 0:
|
|
5709
5664
|
beforeUpload = _this.props.beforeUpload;
|
|
5710
5665
|
transformedFile = file;
|
|
5711
5666
|
if (!beforeUpload) {
|
|
5712
|
-
|
|
5667
|
+
_context2.next = 14;
|
|
5713
5668
|
break;
|
|
5714
5669
|
}
|
|
5715
|
-
|
|
5716
|
-
|
|
5670
|
+
_context2.prev = 3;
|
|
5671
|
+
_context2.next = 6;
|
|
5717
5672
|
return beforeUpload(file, fileList);
|
|
5718
5673
|
case 6:
|
|
5719
|
-
transformedFile =
|
|
5720
|
-
|
|
5674
|
+
transformedFile = _context2.sent;
|
|
5675
|
+
_context2.next = 12;
|
|
5721
5676
|
break;
|
|
5722
5677
|
case 9:
|
|
5723
|
-
|
|
5724
|
-
|
|
5678
|
+
_context2.prev = 9;
|
|
5679
|
+
_context2.t0 = _context2["catch"](3);
|
|
5725
5680
|
// Rejection will also trade as false
|
|
5726
5681
|
transformedFile = false;
|
|
5727
5682
|
case 12:
|
|
5728
5683
|
if (!(transformedFile === false)) {
|
|
5729
|
-
|
|
5684
|
+
_context2.next = 14;
|
|
5730
5685
|
break;
|
|
5731
5686
|
}
|
|
5732
|
-
return
|
|
5687
|
+
return _context2.abrupt("return", {
|
|
5733
5688
|
origin: file,
|
|
5734
5689
|
parsedFile: null,
|
|
5735
5690
|
action: null,
|
|
@@ -5739,14 +5694,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5739
5694
|
// Get latest action
|
|
5740
5695
|
action = _this.props.action;
|
|
5741
5696
|
if (!(typeof action === 'function')) {
|
|
5742
|
-
|
|
5697
|
+
_context2.next = 21;
|
|
5743
5698
|
break;
|
|
5744
5699
|
}
|
|
5745
|
-
|
|
5700
|
+
_context2.next = 18;
|
|
5746
5701
|
return action(file);
|
|
5747
5702
|
case 18:
|
|
5748
|
-
mergedAction =
|
|
5749
|
-
|
|
5703
|
+
mergedAction = _context2.sent;
|
|
5704
|
+
_context2.next = 22;
|
|
5750
5705
|
break;
|
|
5751
5706
|
case 21:
|
|
5752
5707
|
mergedAction = action;
|
|
@@ -5754,14 +5709,14 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5754
5709
|
// Get latest data
|
|
5755
5710
|
data = _this.props.data;
|
|
5756
5711
|
if (!(typeof data === 'function')) {
|
|
5757
|
-
|
|
5712
|
+
_context2.next = 29;
|
|
5758
5713
|
break;
|
|
5759
5714
|
}
|
|
5760
|
-
|
|
5715
|
+
_context2.next = 26;
|
|
5761
5716
|
return data(file);
|
|
5762
5717
|
case 26:
|
|
5763
|
-
mergedData =
|
|
5764
|
-
|
|
5718
|
+
mergedData = _context2.sent;
|
|
5719
|
+
_context2.next = 30;
|
|
5765
5720
|
break;
|
|
5766
5721
|
case 29:
|
|
5767
5722
|
mergedData = data;
|
|
@@ -5779,7 +5734,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5779
5734
|
}
|
|
5780
5735
|
mergedParsedFile = parsedFile;
|
|
5781
5736
|
mergedParsedFile.uid = file.uid;
|
|
5782
|
-
return
|
|
5737
|
+
return _context2.abrupt("return", {
|
|
5783
5738
|
origin: file,
|
|
5784
5739
|
data: mergedData,
|
|
5785
5740
|
parsedFile: mergedParsedFile,
|
|
@@ -5787,12 +5742,12 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5787
5742
|
});
|
|
5788
5743
|
case 35:
|
|
5789
5744
|
case "end":
|
|
5790
|
-
return
|
|
5745
|
+
return _context2.stop();
|
|
5791
5746
|
}
|
|
5792
|
-
},
|
|
5747
|
+
}, _callee2, null, [[3, 9]]);
|
|
5793
5748
|
}));
|
|
5794
|
-
return function (
|
|
5795
|
-
return
|
|
5749
|
+
return function (_x2, _x3) {
|
|
5750
|
+
return _ref3.apply(this, arguments);
|
|
5796
5751
|
};
|
|
5797
5752
|
}());
|
|
5798
5753
|
_defineProperty(_assertThisInitialized(_this), "saveFileInput", function (node) {
|
|
@@ -5804,46 +5759,31 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5804
5759
|
key: "componentDidMount",
|
|
5805
5760
|
value: function componentDidMount() {
|
|
5806
5761
|
this._isMounted = true;
|
|
5807
|
-
var pastable = this.props.pastable;
|
|
5808
|
-
if (pastable) {
|
|
5809
|
-
document.addEventListener('paste', this.onFilePaste);
|
|
5810
|
-
}
|
|
5811
5762
|
}
|
|
5812
5763
|
}, {
|
|
5813
5764
|
key: "componentWillUnmount",
|
|
5814
5765
|
value: function componentWillUnmount() {
|
|
5815
5766
|
this._isMounted = false;
|
|
5816
5767
|
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
|
-
}
|
|
5828
5768
|
}
|
|
5829
5769
|
}, {
|
|
5830
5770
|
key: "post",
|
|
5831
|
-
value: function post(
|
|
5771
|
+
value: function post(_ref4) {
|
|
5832
5772
|
var _this2 = this;
|
|
5833
|
-
var data =
|
|
5834
|
-
origin =
|
|
5835
|
-
action =
|
|
5836
|
-
parsedFile =
|
|
5773
|
+
var data = _ref4.data,
|
|
5774
|
+
origin = _ref4.origin,
|
|
5775
|
+
action = _ref4.action,
|
|
5776
|
+
parsedFile = _ref4.parsedFile;
|
|
5837
5777
|
if (!this._isMounted) {
|
|
5838
5778
|
return;
|
|
5839
5779
|
}
|
|
5840
|
-
var _this$
|
|
5841
|
-
onStart = _this$
|
|
5842
|
-
customRequest = _this$
|
|
5843
|
-
name = _this$
|
|
5844
|
-
headers = _this$
|
|
5845
|
-
withCredentials = _this$
|
|
5846
|
-
method = _this$
|
|
5780
|
+
var _this$props2 = this.props,
|
|
5781
|
+
onStart = _this$props2.onStart,
|
|
5782
|
+
customRequest = _this$props2.customRequest,
|
|
5783
|
+
name = _this$props2.name,
|
|
5784
|
+
headers = _this$props2.headers,
|
|
5785
|
+
withCredentials = _this$props2.withCredentials,
|
|
5786
|
+
method = _this$props2.method;
|
|
5847
5787
|
var uid = origin.uid;
|
|
5848
5788
|
var request = customRequest || upload;
|
|
5849
5789
|
var requestOption = {
|
|
@@ -5901,28 +5841,28 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5901
5841
|
}, {
|
|
5902
5842
|
key: "render",
|
|
5903
5843
|
value: function render() {
|
|
5904
|
-
var _this$
|
|
5905
|
-
Tag = _this$
|
|
5906
|
-
prefixCls = _this$
|
|
5907
|
-
className = _this$
|
|
5908
|
-
_this$
|
|
5909
|
-
classNames$1 = _this$
|
|
5910
|
-
disabled = _this$
|
|
5911
|
-
id = _this$
|
|
5912
|
-
name = _this$
|
|
5913
|
-
style = _this$
|
|
5914
|
-
_this$
|
|
5915
|
-
styles = _this$
|
|
5916
|
-
multiple = _this$
|
|
5917
|
-
accept = _this$
|
|
5918
|
-
capture = _this$
|
|
5919
|
-
children = _this$
|
|
5920
|
-
directory = _this$
|
|
5921
|
-
openFileDialogOnClick = _this$
|
|
5922
|
-
onMouseEnter = _this$
|
|
5923
|
-
onMouseLeave = _this$
|
|
5924
|
-
hasControlInside = _this$
|
|
5925
|
-
otherProps = _objectWithoutProperties(_this$
|
|
5844
|
+
var _this$props3 = this.props,
|
|
5845
|
+
Tag = _this$props3.component,
|
|
5846
|
+
prefixCls = _this$props3.prefixCls,
|
|
5847
|
+
className = _this$props3.className,
|
|
5848
|
+
_this$props3$classNam = _this$props3.classNames,
|
|
5849
|
+
classNames$1 = _this$props3$classNam === void 0 ? {} : _this$props3$classNam,
|
|
5850
|
+
disabled = _this$props3.disabled,
|
|
5851
|
+
id = _this$props3.id,
|
|
5852
|
+
name = _this$props3.name,
|
|
5853
|
+
style = _this$props3.style,
|
|
5854
|
+
_this$props3$styles = _this$props3.styles,
|
|
5855
|
+
styles = _this$props3$styles === void 0 ? {} : _this$props3$styles,
|
|
5856
|
+
multiple = _this$props3.multiple,
|
|
5857
|
+
accept = _this$props3.accept,
|
|
5858
|
+
capture = _this$props3.capture,
|
|
5859
|
+
children = _this$props3.children,
|
|
5860
|
+
directory = _this$props3.directory,
|
|
5861
|
+
openFileDialogOnClick = _this$props3.openFileDialogOnClick,
|
|
5862
|
+
onMouseEnter = _this$props3.onMouseEnter,
|
|
5863
|
+
onMouseLeave = _this$props3.onMouseLeave,
|
|
5864
|
+
hasControlInside = _this$props3.hasControlInside,
|
|
5865
|
+
otherProps = _objectWithoutProperties(_this$props3, _excluded$1);
|
|
5926
5866
|
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), "".concat(prefixCls, "-disabled"), disabled), className, className));
|
|
5927
5867
|
// because input don't have directory/webkitdirectory type declaration
|
|
5928
5868
|
var dirProps = directory ? {
|
|
@@ -5935,7 +5875,7 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
|
|
|
5935
5875
|
onMouseEnter: onMouseEnter,
|
|
5936
5876
|
onMouseLeave: onMouseLeave,
|
|
5937
5877
|
onDrop: this.onFileDrop,
|
|
5938
|
-
onDragOver: this.
|
|
5878
|
+
onDragOver: this.onFileDrop,
|
|
5939
5879
|
tabIndex: hasControlInside ? undefined : '0'
|
|
5940
5880
|
};
|
|
5941
5881
|
return /*#__PURE__*/React__default.createElement(Tag, _extends({}, events, {
|
|
@@ -6053,7 +5993,8 @@ const initMotionCommonLeave = duration => ({
|
|
|
6053
5993
|
animationDuration: duration,
|
|
6054
5994
|
animationFillMode: 'both'
|
|
6055
5995
|
});
|
|
6056
|
-
const initMotion = (motionCls, inKeyframes, outKeyframes, duration
|
|
5996
|
+
const initMotion = function (motionCls, inKeyframes, outKeyframes, duration) {
|
|
5997
|
+
let sameLevel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6057
5998
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
|
6058
5999
|
return {
|
|
6059
6000
|
[`
|
|
@@ -6096,7 +6037,8 @@ const fadeOut = new Keyframe('antFadeOut', {
|
|
|
6096
6037
|
opacity: 0
|
|
6097
6038
|
}
|
|
6098
6039
|
});
|
|
6099
|
-
const initFadeMotion = (token
|
|
6040
|
+
const initFadeMotion = function (token) {
|
|
6041
|
+
let sameLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6100
6042
|
const {
|
|
6101
6043
|
antCls
|
|
6102
6044
|
} = token;
|
|
@@ -6419,7 +6361,7 @@ const genListStyle = token => {
|
|
|
6419
6361
|
}
|
|
6420
6362
|
},
|
|
6421
6363
|
[`${componentCls}-icon ${iconCls}`]: {
|
|
6422
|
-
color: token.
|
|
6364
|
+
color: token.colorTextDescription,
|
|
6423
6365
|
fontSize
|
|
6424
6366
|
},
|
|
6425
6367
|
[`${itemCls}-progress`]: {
|
|
@@ -6778,7 +6720,7 @@ const genBaseStyle$1 = token => {
|
|
|
6778
6720
|
};
|
|
6779
6721
|
};
|
|
6780
6722
|
const prepareComponentToken$3 = token => ({
|
|
6781
|
-
actionsColor: token.
|
|
6723
|
+
actionsColor: token.colorTextDescription
|
|
6782
6724
|
});
|
|
6783
6725
|
// ============================== Export ==============================
|
|
6784
6726
|
const useStyle$4 = genStyleHooks('Upload', token => {
|
|
@@ -6820,19 +6762,22 @@ const getCurrentHeight = node => ({
|
|
|
6820
6762
|
height: node ? node.offsetHeight : 0
|
|
6821
6763
|
});
|
|
6822
6764
|
const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
6823
|
-
const initCollapseMotion = (
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6765
|
+
const initCollapseMotion = function () {
|
|
6766
|
+
let rootCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultPrefixCls;
|
|
6767
|
+
return {
|
|
6768
|
+
motionName: `${rootCls}-motion-collapse`,
|
|
6769
|
+
onAppearStart: getCollapsedHeight,
|
|
6770
|
+
onEnterStart: getCollapsedHeight,
|
|
6771
|
+
onAppearActive: getRealHeight,
|
|
6772
|
+
onEnterActive: getRealHeight,
|
|
6773
|
+
onLeaveStart: getCurrentHeight,
|
|
6774
|
+
onLeaveActive: getCollapsedHeight,
|
|
6775
|
+
onAppearEnd: skipOpacityTransition,
|
|
6776
|
+
onEnterEnd: skipOpacityTransition,
|
|
6777
|
+
onLeaveEnd: skipOpacityTransition,
|
|
6778
|
+
motionDeadline: 500
|
|
6779
|
+
};
|
|
6780
|
+
};
|
|
6836
6781
|
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
|
|
6837
6782
|
if (transitionName !== undefined) {
|
|
6838
6783
|
return transitionName;
|
|
@@ -6881,7 +6826,7 @@ const genWaveStyle = token => {
|
|
|
6881
6826
|
}
|
|
6882
6827
|
};
|
|
6883
6828
|
};
|
|
6884
|
-
const useStyle$3 = genComponentStyleHook('Wave', genWaveStyle);
|
|
6829
|
+
const useStyle$3 = genComponentStyleHook('Wave', token => [genWaveStyle(token)]);
|
|
6885
6830
|
|
|
6886
6831
|
const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
|
|
6887
6832
|
|
|
@@ -6990,28 +6935,31 @@ const defaultReactRender = (node, container) => {
|
|
|
6990
6935
|
};
|
|
6991
6936
|
};
|
|
6992
6937
|
let unstableRender = defaultReactRender;
|
|
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) {
|
|
6938
|
+
function getReactRender() {
|
|
6999
6939
|
return unstableRender;
|
|
7000
6940
|
}
|
|
7001
6941
|
|
|
7002
6942
|
function isValidWaveColor(color) {
|
|
7003
6943
|
return color && color !== '#fff' && color !== '#ffffff' && color !== 'rgb(255, 255, 255)' && color !== 'rgba(255, 255, 255, 1)' && !/rgba\((?:\d*, ){3}0\)/.test(color) &&
|
|
7004
6944
|
// any transparent rgba color
|
|
7005
|
-
color !== 'transparent'
|
|
6945
|
+
color !== 'transparent';
|
|
7006
6946
|
}
|
|
7007
6947
|
function getTargetWaveColor(node) {
|
|
7008
|
-
var _a;
|
|
7009
6948
|
const {
|
|
7010
6949
|
borderTopColor,
|
|
7011
6950
|
borderColor,
|
|
7012
6951
|
backgroundColor
|
|
7013
6952
|
} = getComputedStyle(node);
|
|
7014
|
-
|
|
6953
|
+
if (isValidWaveColor(borderTopColor)) {
|
|
6954
|
+
return borderTopColor;
|
|
6955
|
+
}
|
|
6956
|
+
if (isValidWaveColor(borderColor)) {
|
|
6957
|
+
return borderColor;
|
|
6958
|
+
}
|
|
6959
|
+
if (isValidWaveColor(backgroundColor)) {
|
|
6960
|
+
return backgroundColor;
|
|
6961
|
+
}
|
|
6962
|
+
return null;
|
|
7015
6963
|
}
|
|
7016
6964
|
|
|
7017
6965
|
function validateNum(value) {
|
|
@@ -7110,15 +7058,18 @@ const WaveEffect = props => {
|
|
|
7110
7058
|
}
|
|
7111
7059
|
return false;
|
|
7112
7060
|
}
|
|
7113
|
-
}, ({
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7061
|
+
}, (_ref, ref) => {
|
|
7062
|
+
let {
|
|
7063
|
+
className: motionClassName
|
|
7064
|
+
} = _ref;
|
|
7065
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7066
|
+
ref: composeRef(divRef, ref),
|
|
7067
|
+
className: classNames(className, motionClassName, {
|
|
7068
|
+
'wave-quick': isSmallComponent
|
|
7069
|
+
}),
|
|
7070
|
+
style: waveStyle
|
|
7071
|
+
});
|
|
7072
|
+
});
|
|
7122
7073
|
};
|
|
7123
7074
|
const showWaveEffect = (target, info) => {
|
|
7124
7075
|
var _a;
|
|
@@ -7135,7 +7086,7 @@ const showWaveEffect = (target, info) => {
|
|
|
7135
7086
|
holder.style.left = '0px';
|
|
7136
7087
|
holder.style.top = '0px';
|
|
7137
7088
|
target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
|
|
7138
|
-
const reactRender =
|
|
7089
|
+
const reactRender = getReactRender();
|
|
7139
7090
|
let unmountCallback = null;
|
|
7140
7091
|
function registerUnmount() {
|
|
7141
7092
|
return unmountCallback;
|
|
@@ -7447,10 +7398,11 @@ const DefaultLoadingIcon = props => {
|
|
|
7447
7398
|
onEnterActive: getRealWidth,
|
|
7448
7399
|
onLeaveStart: getRealWidth,
|
|
7449
7400
|
onLeaveActive: getCollapsedWidth
|
|
7450
|
-
}, ({
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7401
|
+
}, (_ref, ref) => {
|
|
7402
|
+
let {
|
|
7403
|
+
className: motionCls,
|
|
7404
|
+
style: motionStyle
|
|
7405
|
+
} = _ref;
|
|
7454
7406
|
const mergedStyle = Object.assign(Object.assign({}, style), motionStyle);
|
|
7455
7407
|
return /*#__PURE__*/React__default.createElement(InnerLoadingIcon, {
|
|
7456
7408
|
prefixCls: prefixCls,
|
|
@@ -7546,13 +7498,16 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
7546
7498
|
}
|
|
7547
7499
|
const isArray = Array.isArray(color);
|
|
7548
7500
|
if (isArray && color.length) {
|
|
7549
|
-
this.colors = color.map(
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7501
|
+
this.colors = color.map(_ref => {
|
|
7502
|
+
let {
|
|
7503
|
+
color: c,
|
|
7504
|
+
percent
|
|
7505
|
+
} = _ref;
|
|
7506
|
+
return {
|
|
7507
|
+
color: new AggregationColor(c),
|
|
7508
|
+
percent
|
|
7509
|
+
};
|
|
7510
|
+
});
|
|
7556
7511
|
this.metaColor = new Color(this.colors[0].color.metaColor);
|
|
7557
7512
|
} else {
|
|
7558
7513
|
this.metaColor = new Color(isArray ? '' : color);
|
|
@@ -7635,13 +7590,6 @@ let AggregationColor = /*#__PURE__*/function () {
|
|
|
7635
7590
|
}]);
|
|
7636
7591
|
}();
|
|
7637
7592
|
|
|
7638
|
-
const generateColor = color => {
|
|
7639
|
-
if (color instanceof AggregationColor) {
|
|
7640
|
-
return color;
|
|
7641
|
-
}
|
|
7642
|
-
return new AggregationColor(color);
|
|
7643
|
-
};
|
|
7644
|
-
|
|
7645
7593
|
const isBright = (value, bgColorToken) => {
|
|
7646
7594
|
const {
|
|
7647
7595
|
r,
|
|
@@ -7683,7 +7631,6 @@ const prepareComponentToken$2 = token => {
|
|
|
7683
7631
|
}), {});
|
|
7684
7632
|
return Object.assign(Object.assign({}, shadowColorTokens), {
|
|
7685
7633
|
fontWeight: 400,
|
|
7686
|
-
iconGap: token.marginXS,
|
|
7687
7634
|
defaultShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`,
|
|
7688
7635
|
primaryShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`,
|
|
7689
7636
|
dangerShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`,
|
|
@@ -7737,7 +7684,7 @@ const genSharedButtonStyle = token => {
|
|
|
7737
7684
|
opacityLoading,
|
|
7738
7685
|
motionDurationSlow,
|
|
7739
7686
|
motionEaseInOut,
|
|
7740
|
-
|
|
7687
|
+
marginXS,
|
|
7741
7688
|
calc
|
|
7742
7689
|
} = token;
|
|
7743
7690
|
return {
|
|
@@ -7745,7 +7692,7 @@ const genSharedButtonStyle = token => {
|
|
|
7745
7692
|
outline: 'none',
|
|
7746
7693
|
position: 'relative',
|
|
7747
7694
|
display: 'inline-flex',
|
|
7748
|
-
gap:
|
|
7695
|
+
gap: token.marginXS,
|
|
7749
7696
|
alignItems: 'center',
|
|
7750
7697
|
justifyContent: 'center',
|
|
7751
7698
|
fontWeight,
|
|
@@ -7797,7 +7744,7 @@ const genSharedButtonStyle = token => {
|
|
|
7797
7744
|
[`&:not(${componentCls}-icon-end)`]: {
|
|
7798
7745
|
[`${componentCls}-loading-icon-motion`]: {
|
|
7799
7746
|
'&-appear-start, &-enter-start': {
|
|
7800
|
-
marginInlineEnd: calc(
|
|
7747
|
+
marginInlineEnd: calc(marginXS).mul(-1).equal()
|
|
7801
7748
|
},
|
|
7802
7749
|
'&-appear-active, &-enter-active': {
|
|
7803
7750
|
marginInlineEnd: 0
|
|
@@ -7806,7 +7753,7 @@ const genSharedButtonStyle = token => {
|
|
|
7806
7753
|
marginInlineEnd: 0
|
|
7807
7754
|
},
|
|
7808
7755
|
'&-leave-active': {
|
|
7809
|
-
marginInlineEnd: calc(
|
|
7756
|
+
marginInlineEnd: calc(marginXS).mul(-1).equal()
|
|
7810
7757
|
}
|
|
7811
7758
|
}
|
|
7812
7759
|
},
|
|
@@ -7814,7 +7761,7 @@ const genSharedButtonStyle = token => {
|
|
|
7814
7761
|
flexDirection: 'row-reverse',
|
|
7815
7762
|
[`${componentCls}-loading-icon-motion`]: {
|
|
7816
7763
|
'&-appear-start, &-enter-start': {
|
|
7817
|
-
marginInlineStart: calc(
|
|
7764
|
+
marginInlineStart: calc(marginXS).mul(-1).equal()
|
|
7818
7765
|
},
|
|
7819
7766
|
'&-appear-active, &-enter-active': {
|
|
7820
7767
|
marginInlineStart: 0
|
|
@@ -7823,7 +7770,7 @@ const genSharedButtonStyle = token => {
|
|
|
7823
7770
|
marginInlineStart: 0
|
|
7824
7771
|
},
|
|
7825
7772
|
'&-leave-active': {
|
|
7826
|
-
marginInlineStart: calc(
|
|
7773
|
+
marginInlineStart: calc(marginXS).mul(-1).equal()
|
|
7827
7774
|
}
|
|
7828
7775
|
}
|
|
7829
7776
|
}
|
|
@@ -7946,10 +7893,8 @@ const genPresetColorStyle = token => {
|
|
|
7946
7893
|
borderColor: activeColor,
|
|
7947
7894
|
background: token.colorBgContainer
|
|
7948
7895
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, lightColor, {
|
|
7949
|
-
color: darkColor,
|
|
7950
7896
|
background: lightHoverColor
|
|
7951
7897
|
}, {
|
|
7952
|
-
color: darkColor,
|
|
7953
7898
|
background: lightBorderColor
|
|
7954
7899
|
})), genTextLinkButtonStyle(token, darkColor, 'link', {
|
|
7955
7900
|
color: hoverColor
|
|
@@ -7975,10 +7920,8 @@ const genDefaultButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
7975
7920
|
color: token.solidTextColor,
|
|
7976
7921
|
background: token.colorBgSolidActive
|
|
7977
7922
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorFillTertiary, {
|
|
7978
|
-
color: token.defaultColor,
|
|
7979
7923
|
background: token.colorFillSecondary
|
|
7980
7924
|
}, {
|
|
7981
|
-
color: token.defaultColor,
|
|
7982
7925
|
background: token.colorFill
|
|
7983
7926
|
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder)), genTextLinkButtonStyle(token, token.textTextColor, 'link', {
|
|
7984
7927
|
color: token.colorLinkHover,
|
|
@@ -7998,10 +7941,8 @@ const genPrimaryButtonStyle = token => Object.assign(Object.assign(Object.assign
|
|
|
7998
7941
|
borderColor: token.colorPrimaryActive,
|
|
7999
7942
|
background: token.colorBgContainer
|
|
8000
7943
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorPrimaryBg, {
|
|
8001
|
-
color: token.colorPrimary,
|
|
8002
7944
|
background: token.colorPrimaryBgHover
|
|
8003
7945
|
}, {
|
|
8004
|
-
color: token.colorPrimary,
|
|
8005
7946
|
background: token.colorPrimaryBorder
|
|
8006
7947
|
})), genTextLinkButtonStyle(token, token.colorPrimaryText, 'text', {
|
|
8007
7948
|
color: token.colorPrimaryTextHover,
|
|
@@ -8035,10 +7976,8 @@ const genDangerousStyle = token => Object.assign(Object.assign(Object.assign(Obj
|
|
|
8035
7976
|
color: token.colorErrorActive,
|
|
8036
7977
|
borderColor: token.colorErrorActive
|
|
8037
7978
|
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorErrorBg, {
|
|
8038
|
-
color: token.colorError,
|
|
8039
7979
|
background: token.colorErrorBgFilledHover
|
|
8040
7980
|
}, {
|
|
8041
|
-
color: token.colorError,
|
|
8042
7981
|
background: token.colorErrorBgActive
|
|
8043
7982
|
})), genTextLinkButtonStyle(token, token.colorError, 'text', {
|
|
8044
7983
|
color: token.colorErrorHover,
|
|
@@ -8107,7 +8046,8 @@ const genCompatibleButtonStyle = token => Object.assign(Object.assign(Object.ass
|
|
|
8107
8046
|
color: token.colorLinkActive
|
|
8108
8047
|
}));
|
|
8109
8048
|
// =============================== Size ===============================
|
|
8110
|
-
const genButtonStyle = (token
|
|
8049
|
+
const genButtonStyle = function (token) {
|
|
8050
|
+
let prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
8111
8051
|
const {
|
|
8112
8052
|
componentCls,
|
|
8113
8053
|
controlHeight,
|
|
@@ -8206,7 +8146,7 @@ const useStyle$2 = genStyleHooks('Button', token => {
|
|
|
8206
8146
|
});
|
|
8207
8147
|
|
|
8208
8148
|
// handle border collapse
|
|
8209
|
-
function compactItemBorder(token, parentCls, options
|
|
8149
|
+
function compactItemBorder(token, parentCls, options) {
|
|
8210
8150
|
const {
|
|
8211
8151
|
focusElCls,
|
|
8212
8152
|
focus,
|
|
@@ -8218,16 +8158,13 @@ function compactItemBorder(token, parentCls, options, prefixCls) {
|
|
|
8218
8158
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
8219
8159
|
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()
|
|
8220
8160
|
},
|
|
8221
|
-
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
8222
|
-
zIndex: 2
|
|
8223
|
-
},
|
|
8224
8161
|
'&-item': Object.assign(Object.assign({
|
|
8225
8162
|
[hoverEffects]: {
|
|
8226
|
-
zIndex:
|
|
8163
|
+
zIndex: 2
|
|
8227
8164
|
}
|
|
8228
8165
|
}, focusElCls ? {
|
|
8229
8166
|
[`&${focusElCls}`]: {
|
|
8230
|
-
zIndex:
|
|
8167
|
+
zIndex: 2
|
|
8231
8168
|
}
|
|
8232
8169
|
} : {}), {
|
|
8233
8170
|
[`&[disabled] ${childCombinator}`]: {
|
|
@@ -8260,30 +8197,28 @@ function compactItemBorderRadius(prefixCls, parentCls, options) {
|
|
|
8260
8197
|
}
|
|
8261
8198
|
};
|
|
8262
8199
|
}
|
|
8263
|
-
function genCompactItemStyle(token
|
|
8264
|
-
|
|
8265
|
-
|
|
8200
|
+
function genCompactItemStyle(token) {
|
|
8201
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
8202
|
+
focus: true
|
|
8203
|
+
};
|
|
8266
8204
|
const {
|
|
8267
8205
|
componentCls
|
|
8268
8206
|
} = token;
|
|
8269
8207
|
const compactCls = `${componentCls}-compact`;
|
|
8270
8208
|
return {
|
|
8271
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options
|
|
8209
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))
|
|
8272
8210
|
};
|
|
8273
8211
|
}
|
|
8274
8212
|
|
|
8275
|
-
function compactItemVerticalBorder(token, parentCls
|
|
8213
|
+
function compactItemVerticalBorder(token, parentCls) {
|
|
8276
8214
|
return {
|
|
8277
8215
|
// border collapse
|
|
8278
8216
|
[`&-item:not(${parentCls}-last-item)`]: {
|
|
8279
8217
|
marginBottom: token.calc(token.lineWidth).mul(-1).equal()
|
|
8280
8218
|
},
|
|
8281
|
-
[`&-item:not(${prefixCls}-status-success)`]: {
|
|
8282
|
-
zIndex: 2
|
|
8283
|
-
},
|
|
8284
8219
|
'&-item': {
|
|
8285
8220
|
'&:hover,&:focus,&:active': {
|
|
8286
|
-
zIndex:
|
|
8221
|
+
zIndex: 2
|
|
8287
8222
|
},
|
|
8288
8223
|
'&[disabled]': {
|
|
8289
8224
|
zIndex: 0
|
|
@@ -8313,7 +8248,7 @@ function compactItemBorderVerticalRadius(prefixCls, parentCls) {
|
|
|
8313
8248
|
function genCompactItemVerticalStyle(token) {
|
|
8314
8249
|
const compactCls = `${token.componentCls}-compact-vertical`;
|
|
8315
8250
|
return {
|
|
8316
|
-
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls
|
|
8251
|
+
[compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
|
|
8317
8252
|
};
|
|
8318
8253
|
}
|
|
8319
8254
|
|
|
@@ -8389,7 +8324,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8389
8324
|
variant,
|
|
8390
8325
|
type,
|
|
8391
8326
|
danger = false,
|
|
8392
|
-
shape
|
|
8327
|
+
shape = 'default',
|
|
8393
8328
|
size: customizeSize,
|
|
8394
8329
|
styles,
|
|
8395
8330
|
disabled: customDisabled,
|
|
@@ -8411,30 +8346,16 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8411
8346
|
// https://github.com/ant-design/ant-design/issues/47605
|
|
8412
8347
|
// Compatible with original `type` behavior
|
|
8413
8348
|
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';
|
|
8418
8349
|
const [mergedColor, mergedVariant] = useMemo$1(() => {
|
|
8419
|
-
// >>>>> Local
|
|
8420
|
-
// Color & Variant
|
|
8421
8350
|
if (color && variant) {
|
|
8422
8351
|
return [color, variant];
|
|
8423
8352
|
}
|
|
8424
|
-
|
|
8425
|
-
if (
|
|
8426
|
-
|
|
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];
|
|
8353
|
+
const colorVariantPair = ButtonTypeMap[mergedType] || [];
|
|
8354
|
+
if (danger) {
|
|
8355
|
+
return ['danger', colorVariantPair[1]];
|
|
8435
8356
|
}
|
|
8436
|
-
return
|
|
8437
|
-
}, [type, color, variant, danger
|
|
8357
|
+
return colorVariantPair;
|
|
8358
|
+
}, [type, color, variant, danger]);
|
|
8438
8359
|
const isDanger = mergedColor === 'danger';
|
|
8439
8360
|
const mergedColorText = isDanger ? 'dangerous' : mergedColor;
|
|
8440
8361
|
const {
|
|
@@ -8469,9 +8390,8 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8469
8390
|
};
|
|
8470
8391
|
}, []);
|
|
8471
8392
|
// ========================= Effect =========================
|
|
8472
|
-
// Loading
|
|
8473
|
-
|
|
8474
|
-
useLayoutEffect$1(() => {
|
|
8393
|
+
// Loading
|
|
8394
|
+
useEffect(() => {
|
|
8475
8395
|
let delayTimer = null;
|
|
8476
8396
|
if (loadingOrDelay.delay > 0) {
|
|
8477
8397
|
delayTimer = setTimeout(() => {
|
|
@@ -8488,7 +8408,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8488
8408
|
}
|
|
8489
8409
|
}
|
|
8490
8410
|
return cleanupTimer;
|
|
8491
|
-
}, [loadingOrDelay
|
|
8411
|
+
}, [loadingOrDelay]);
|
|
8492
8412
|
// Two chinese characters check
|
|
8493
8413
|
useEffect(() => {
|
|
8494
8414
|
// FIXME: for HOC usage like <FormatMessage />
|
|
@@ -8546,7 +8466,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
8546
8466
|
// ========================= Render =========================
|
|
8547
8467
|
const classes = classNames(prefixCls, hashId, cssVarCls, {
|
|
8548
8468
|
[`${prefixCls}-${shape}`]: shape !== 'default' && shape,
|
|
8549
|
-
// Compatible with versions earlier than 5.21.0
|
|
8469
|
+
// line(253 - 254): Compatible with versions earlier than 5.21.0
|
|
8550
8470
|
[`${prefixCls}-${mergedType}`]: mergedType,
|
|
8551
8471
|
[`${prefixCls}-dangerous`]: danger,
|
|
8552
8472
|
[`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
|
|
@@ -8630,9 +8550,12 @@ function file2Obj(file) {
|
|
|
8630
8550
|
/** Upload fileList. Replace file if exist or just push into it. */
|
|
8631
8551
|
function updateFileList(file, fileList) {
|
|
8632
8552
|
const nextFileList = _toConsumableArray(fileList);
|
|
8633
|
-
const fileIndex = nextFileList.findIndex(
|
|
8634
|
-
|
|
8635
|
-
|
|
8553
|
+
const fileIndex = nextFileList.findIndex(_ref => {
|
|
8554
|
+
let {
|
|
8555
|
+
uid
|
|
8556
|
+
} = _ref;
|
|
8557
|
+
return uid === file.uid;
|
|
8558
|
+
});
|
|
8636
8559
|
if (fileIndex === -1) {
|
|
8637
8560
|
nextFileList.push(file);
|
|
8638
8561
|
} else {
|
|
@@ -8653,7 +8576,8 @@ function removeFileItem(file, fileList) {
|
|
|
8653
8576
|
return removed;
|
|
8654
8577
|
}
|
|
8655
8578
|
// ==================== Default Image Preview ====================
|
|
8656
|
-
const extname = (
|
|
8579
|
+
const extname = function () {
|
|
8580
|
+
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8657
8581
|
const temp = url.split('/');
|
|
8658
8582
|
const filename = temp[temp.length - 1];
|
|
8659
8583
|
const filenameWithoutSuffix = filename.split(/#|\?/)[0];
|
|
@@ -9034,11 +8958,12 @@ const FormItemInputContext = /*#__PURE__*/React.createContext({});
|
|
|
9034
8958
|
if (process.env.NODE_ENV !== 'production') {
|
|
9035
8959
|
FormItemInputContext.displayName = 'FormItemInputContext';
|
|
9036
8960
|
}
|
|
9037
|
-
const NoFormStyle =
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
8961
|
+
const NoFormStyle = _ref => {
|
|
8962
|
+
let {
|
|
8963
|
+
children,
|
|
8964
|
+
status,
|
|
8965
|
+
override
|
|
8966
|
+
} = _ref;
|
|
9042
8967
|
const formItemInputContext = React.useContext(FormItemInputContext);
|
|
9043
8968
|
const newFormItemInputContext = React.useMemo(() => {
|
|
9044
8969
|
const newContext = Object.assign({}, formItemInputContext);
|
|
@@ -9481,11 +9406,6 @@ function getPlacements(config) {
|
|
|
9481
9406
|
borderRadius} = config;
|
|
9482
9407
|
const halfArrowWidth = arrowWidth / 2;
|
|
9483
9408
|
const placementMap = {};
|
|
9484
|
-
// Dynamic offset
|
|
9485
|
-
const arrowOffset = getArrowOffsetToken({
|
|
9486
|
-
contentRadius: borderRadius,
|
|
9487
|
-
limitVerticalRadius: true
|
|
9488
|
-
});
|
|
9489
9409
|
Object.keys(PlacementAlignMap).forEach(key => {
|
|
9490
9410
|
const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key];
|
|
9491
9411
|
const placementInfo = Object.assign(Object.assign({}, template), {
|
|
@@ -9520,6 +9440,11 @@ function getPlacements(config) {
|
|
|
9520
9440
|
placementInfo.offset[0] = halfArrowWidth + offset;
|
|
9521
9441
|
break;
|
|
9522
9442
|
}
|
|
9443
|
+
// Dynamic offset
|
|
9444
|
+
const arrowOffset = getArrowOffsetToken({
|
|
9445
|
+
contentRadius: borderRadius,
|
|
9446
|
+
limitVerticalRadius: true
|
|
9447
|
+
});
|
|
9523
9448
|
if (arrowPointAtCenter) {
|
|
9524
9449
|
switch (key) {
|
|
9525
9450
|
case 'topLeft':
|
|
@@ -9591,7 +9516,7 @@ const genTooltipStyle = token => {
|
|
|
9591
9516
|
minWidth: centerAlignMinWidth,
|
|
9592
9517
|
minHeight: controlHeight,
|
|
9593
9518
|
padding: `${unit(token.calc(paddingSM).div(2).equal())} ${unit(paddingXS)}`,
|
|
9594
|
-
color:
|
|
9519
|
+
color: tooltipColor,
|
|
9595
9520
|
textAlign: 'start',
|
|
9596
9521
|
textDecoration: 'none',
|
|
9597
9522
|
wordWrap: 'break-word',
|
|
@@ -9613,18 +9538,21 @@ const genTooltipStyle = token => {
|
|
|
9613
9538
|
[`${componentCls}-content`]: {
|
|
9614
9539
|
position: 'relative'
|
|
9615
9540
|
}
|
|
9616
|
-
}), genPresetColor(token, (colorKey, {
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9541
|
+
}), genPresetColor(token, (colorKey, _ref) => {
|
|
9542
|
+
let {
|
|
9543
|
+
darkColor
|
|
9544
|
+
} = _ref;
|
|
9545
|
+
return {
|
|
9546
|
+
[`&${componentCls}-${colorKey}`]: {
|
|
9547
|
+
[`${componentCls}-inner`]: {
|
|
9548
|
+
backgroundColor: darkColor
|
|
9549
|
+
},
|
|
9550
|
+
[`${componentCls}-arrow`]: {
|
|
9551
|
+
'--antd-arrow-background-color': darkColor
|
|
9552
|
+
}
|
|
9625
9553
|
}
|
|
9626
|
-
}
|
|
9627
|
-
}))
|
|
9554
|
+
};
|
|
9555
|
+
})), {
|
|
9628
9556
|
// RTL
|
|
9629
9557
|
'&-rtl': {
|
|
9630
9558
|
direction: 'rtl'
|
|
@@ -9651,7 +9579,8 @@ const prepareComponentToken$1 = token => Object.assign(Object.assign({
|
|
|
9651
9579
|
})), getArrowToken(merge(token, {
|
|
9652
9580
|
borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
|
|
9653
9581
|
})));
|
|
9654
|
-
const useStyle$1 = (prefixCls
|
|
9582
|
+
const useStyle$1 = (function (prefixCls) {
|
|
9583
|
+
let injectStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9655
9584
|
const useStyle = genStyleHooks('Tooltip', token => {
|
|
9656
9585
|
const {
|
|
9657
9586
|
borderRadius,
|
|
@@ -9672,7 +9601,7 @@ const useStyle$1 = (prefixCls, injectStyle = true) => {
|
|
|
9672
9601
|
injectStyle
|
|
9673
9602
|
});
|
|
9674
9603
|
return useStyle(prefixCls);
|
|
9675
|
-
};
|
|
9604
|
+
});
|
|
9676
9605
|
|
|
9677
9606
|
const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
9678
9607
|
/**
|
|
@@ -9680,7 +9609,8 @@ const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
|
9680
9609
|
* @param color color to be judged
|
|
9681
9610
|
* @param includeInverse whether to include reversed colors
|
|
9682
9611
|
*/
|
|
9683
|
-
function isPresetColor(color
|
|
9612
|
+
function isPresetColor(color) {
|
|
9613
|
+
let includeInverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9684
9614
|
if (includeInverse) {
|
|
9685
9615
|
return [].concat(_toConsumableArray(inverseColors), _toConsumableArray(PresetColors)).includes(color);
|
|
9686
9616
|
}
|
|
@@ -9694,12 +9624,8 @@ function parseColor(prefixCls, color) {
|
|
|
9694
9624
|
});
|
|
9695
9625
|
const overlayStyle = {};
|
|
9696
9626
|
const arrowStyle = {};
|
|
9697
|
-
const rgb = generateColor(color).toRgb();
|
|
9698
|
-
const luminance = (0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b) / 255;
|
|
9699
|
-
const textColor = luminance < 0.5 ? '#FFF' : '#000';
|
|
9700
9627
|
if (color && !isInternalColor) {
|
|
9701
9628
|
overlayStyle.background = color;
|
|
9702
|
-
overlayStyle['--ant-tooltip-color'] = textColor;
|
|
9703
9629
|
// @ts-ignore
|
|
9704
9630
|
arrowStyle['--antd-arrow-background-color'] = color;
|
|
9705
9631
|
}
|
|
@@ -9762,7 +9688,6 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9762
9688
|
afterOpenChange,
|
|
9763
9689
|
afterVisibleChange,
|
|
9764
9690
|
destroyTooltipOnHide,
|
|
9765
|
-
destroyOnHidden,
|
|
9766
9691
|
arrow = true,
|
|
9767
9692
|
title,
|
|
9768
9693
|
overlay,
|
|
@@ -9779,7 +9704,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9779
9704
|
styles,
|
|
9780
9705
|
classNames: tooltipClassNames
|
|
9781
9706
|
} = props,
|
|
9782
|
-
restProps = __rest$3(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "
|
|
9707
|
+
restProps = __rest$3(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
|
|
9783
9708
|
const mergedShowArrow = !!arrow;
|
|
9784
9709
|
const [, token] = useToken();
|
|
9785
9710
|
const {
|
|
@@ -9812,7 +9737,8 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9812
9737
|
});
|
|
9813
9738
|
// ============================== Warn ==============================
|
|
9814
9739
|
if (process.env.NODE_ENV !== 'production') {
|
|
9815
|
-
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['
|
|
9740
|
+
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(_ref => {
|
|
9741
|
+
let [deprecatedName, newName] = _ref;
|
|
9816
9742
|
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
|
9817
9743
|
});
|
|
9818
9744
|
process.env.NODE_ENV !== "production" ? warning(!destroyTooltipOnHide || typeof destroyTooltipOnHide === 'boolean', 'usage', '`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly.') : void 0;
|
|
@@ -9906,8 +9832,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9906
9832
|
motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),
|
|
9907
9833
|
motionDeadline: 1000
|
|
9908
9834
|
},
|
|
9909
|
-
|
|
9910
|
-
destroyTooltipOnHide: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide
|
|
9835
|
+
destroyTooltipOnHide: !!destroyTooltipOnHide
|
|
9911
9836
|
}), tempOpen ? cloneElement(child, {
|
|
9912
9837
|
className: childCls
|
|
9913
9838
|
}) : child);
|
|
@@ -9930,10 +9855,11 @@ function validProgress(progress) {
|
|
|
9930
9855
|
}
|
|
9931
9856
|
return progress;
|
|
9932
9857
|
}
|
|
9933
|
-
function getSuccessPercent({
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9858
|
+
function getSuccessPercent(_ref) {
|
|
9859
|
+
let {
|
|
9860
|
+
success,
|
|
9861
|
+
successPercent
|
|
9862
|
+
} = _ref;
|
|
9937
9863
|
let percent = successPercent;
|
|
9938
9864
|
/** @deprecated Use `percent` instead */
|
|
9939
9865
|
if (success && 'progress' in success) {
|
|
@@ -9944,21 +9870,23 @@ function getSuccessPercent({
|
|
|
9944
9870
|
}
|
|
9945
9871
|
return percent;
|
|
9946
9872
|
}
|
|
9947
|
-
const getPercentage =
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9873
|
+
const getPercentage = _ref2 => {
|
|
9874
|
+
let {
|
|
9875
|
+
percent,
|
|
9876
|
+
success,
|
|
9877
|
+
successPercent
|
|
9878
|
+
} = _ref2;
|
|
9952
9879
|
const realSuccessPercent = validProgress(getSuccessPercent({
|
|
9953
9880
|
success,
|
|
9954
9881
|
successPercent
|
|
9955
9882
|
}));
|
|
9956
9883
|
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
|
9957
9884
|
};
|
|
9958
|
-
const getStrokeColor =
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9885
|
+
const getStrokeColor = _ref3 => {
|
|
9886
|
+
let {
|
|
9887
|
+
success = {},
|
|
9888
|
+
strokeColor
|
|
9889
|
+
} = _ref3;
|
|
9962
9890
|
const {
|
|
9963
9891
|
strokeColor: successColor
|
|
9964
9892
|
} = success;
|
|
@@ -10404,10 +10332,13 @@ const sortGradient = gradients => {
|
|
|
10404
10332
|
}
|
|
10405
10333
|
});
|
|
10406
10334
|
tempArr = tempArr.sort((a, b) => a.key - b.key);
|
|
10407
|
-
return tempArr.map(
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10335
|
+
return tempArr.map(_ref => {
|
|
10336
|
+
let {
|
|
10337
|
+
key,
|
|
10338
|
+
value
|
|
10339
|
+
} = _ref;
|
|
10340
|
+
return `${value} ${key}%`;
|
|
10341
|
+
}).join(', ');
|
|
10411
10342
|
};
|
|
10412
10343
|
/**
|
|
10413
10344
|
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
|
|
@@ -10703,30 +10634,31 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
10703
10634
|
Progress.displayName = 'Progress';
|
|
10704
10635
|
}
|
|
10705
10636
|
|
|
10706
|
-
const ListItem = /*#__PURE__*/React.forwardRef(({
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10637
|
+
const ListItem = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
10638
|
+
let {
|
|
10639
|
+
prefixCls,
|
|
10640
|
+
className,
|
|
10641
|
+
style,
|
|
10642
|
+
locale,
|
|
10643
|
+
listType,
|
|
10644
|
+
file,
|
|
10645
|
+
items,
|
|
10646
|
+
progress: progressProps,
|
|
10647
|
+
iconRender,
|
|
10648
|
+
actionIconRender,
|
|
10649
|
+
itemRender,
|
|
10650
|
+
isImgUrl,
|
|
10651
|
+
showPreviewIcon,
|
|
10652
|
+
showRemoveIcon,
|
|
10653
|
+
showDownloadIcon,
|
|
10654
|
+
previewIcon: customPreviewIcon,
|
|
10655
|
+
removeIcon: customRemoveIcon,
|
|
10656
|
+
downloadIcon: customDownloadIcon,
|
|
10657
|
+
extra: customExtra,
|
|
10658
|
+
onPreview,
|
|
10659
|
+
onDownload,
|
|
10660
|
+
onClose
|
|
10661
|
+
} = _ref;
|
|
10730
10662
|
var _a, _b;
|
|
10731
10663
|
// Status: which will ignore `removed` status
|
|
10732
10664
|
const {
|
|
@@ -10832,16 +10764,17 @@ const ListItem = /*#__PURE__*/React.forwardRef(({
|
|
|
10832
10764
|
motionName: `${rootPrefixCls}-fade`,
|
|
10833
10765
|
visible: mergedStatus === 'uploading',
|
|
10834
10766
|
motionDeadline: 2000
|
|
10835
|
-
},
|
|
10836
|
-
|
|
10837
|
-
|
|
10767
|
+
}, _ref2 => {
|
|
10768
|
+
let {
|
|
10769
|
+
className: motionClassName
|
|
10770
|
+
} = _ref2;
|
|
10838
10771
|
// show loading icon if upload progress listener is disabled
|
|
10839
|
-
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({
|
|
10772
|
+
const loadingProgress = 'percent' in file ? (/*#__PURE__*/React.createElement(Progress, Object.assign({}, progressProps, {
|
|
10840
10773
|
type: "line",
|
|
10841
10774
|
percent: file.percent,
|
|
10842
10775
|
"aria-label": file['aria-label'],
|
|
10843
10776
|
"aria-labelledby": file['aria-labelledby']
|
|
10844
|
-
}
|
|
10777
|
+
}))) : null;
|
|
10845
10778
|
return /*#__PURE__*/React.createElement("div", {
|
|
10846
10779
|
className: classNames(`${prefixCls}-list-item-progress`, motionClassName)
|
|
10847
10780
|
}, loadingProgress);
|
|
@@ -10955,9 +10888,11 @@ const InternalUploadList = (props, ref) => {
|
|
|
10955
10888
|
(_b = (_a = customIcon.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
10956
10889
|
}
|
|
10957
10890
|
},
|
|
10958
|
-
className: `${prefixCls}-list-item-action
|
|
10959
|
-
disabled: acceptUploadDisabled ? disabled : false
|
|
10891
|
+
className: `${prefixCls}-list-item-action`
|
|
10960
10892
|
};
|
|
10893
|
+
if (acceptUploadDisabled) {
|
|
10894
|
+
btnProps.disabled = disabled;
|
|
10895
|
+
}
|
|
10961
10896
|
return /*#__PURE__*/React.isValidElement(customIcon) ? (/*#__PURE__*/React.createElement(Button, Object.assign({}, btnProps, {
|
|
10962
10897
|
icon: cloneElement(customIcon, Object.assign(Object.assign({}, customIcon.props), {
|
|
10963
10898
|
onClick: () => {}
|
|
@@ -10991,48 +10926,54 @@ const InternalUploadList = (props, ref) => {
|
|
|
10991
10926
|
className: listClassNames
|
|
10992
10927
|
}, /*#__PURE__*/React.createElement(CSSMotionList, Object.assign({}, motionConfig, {
|
|
10993
10928
|
component: false
|
|
10994
|
-
}),
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
10929
|
+
}), _ref => {
|
|
10930
|
+
let {
|
|
10931
|
+
key,
|
|
10932
|
+
file,
|
|
10933
|
+
className: motionClassName,
|
|
10934
|
+
style: motionStyle
|
|
10935
|
+
} = _ref;
|
|
10936
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
10937
|
+
key: key,
|
|
10938
|
+
locale: locale,
|
|
10939
|
+
prefixCls: prefixCls,
|
|
10940
|
+
className: motionClassName,
|
|
10941
|
+
style: motionStyle,
|
|
10942
|
+
file: file,
|
|
10943
|
+
items: items,
|
|
10944
|
+
progress: progress,
|
|
10945
|
+
listType: listType,
|
|
10946
|
+
isImgUrl: isImgUrl,
|
|
10947
|
+
showPreviewIcon: showPreviewIcon,
|
|
10948
|
+
showRemoveIcon: showRemoveIcon,
|
|
10949
|
+
showDownloadIcon: showDownloadIcon,
|
|
10950
|
+
removeIcon: removeIcon,
|
|
10951
|
+
previewIcon: previewIcon,
|
|
10952
|
+
downloadIcon: downloadIcon,
|
|
10953
|
+
extra: extra,
|
|
10954
|
+
iconRender: internalIconRender,
|
|
10955
|
+
actionIconRender: actionIconRender,
|
|
10956
|
+
itemRender: itemRender,
|
|
10957
|
+
onPreview: onInternalPreview,
|
|
10958
|
+
onDownload: onInternalDownload,
|
|
10959
|
+
onClose: onInternalClose
|
|
10960
|
+
});
|
|
10961
|
+
}), appendAction && (/*#__PURE__*/React.createElement(CSSMotion, Object.assign({}, motionConfig, {
|
|
11024
10962
|
visible: appendActionVisible,
|
|
11025
10963
|
forceRender: true
|
|
11026
|
-
}),
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
10964
|
+
}), _ref2 => {
|
|
10965
|
+
let {
|
|
10966
|
+
className: motionClassName,
|
|
10967
|
+
style: motionStyle
|
|
10968
|
+
} = _ref2;
|
|
10969
|
+
return cloneElement(appendAction, oriProps => ({
|
|
10970
|
+
className: classNames(oriProps.className, motionClassName),
|
|
10971
|
+
style: Object.assign(Object.assign(Object.assign({}, motionStyle), {
|
|
10972
|
+
// prevent the element has hover css pseudo-class that may cause animation to end prematurely.
|
|
10973
|
+
pointerEvents: motionClassName ? 'none' : undefined
|
|
10974
|
+
}), oriProps.style)
|
|
10975
|
+
}));
|
|
10976
|
+
})));
|
|
11036
10977
|
};
|
|
11037
10978
|
const UploadList = /*#__PURE__*/React.forwardRef(InternalUploadList);
|
|
11038
10979
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -11068,7 +11009,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
11068
11009
|
};
|
|
11069
11010
|
const LIST_IGNORE = `__LIST_IGNORE_${Date.now()}__`;
|
|
11070
11011
|
const InternalUpload = (props, ref) => {
|
|
11071
|
-
const config = useComponentConfig('upload');
|
|
11072
11012
|
const {
|
|
11073
11013
|
fileList,
|
|
11074
11014
|
defaultFileList,
|
|
@@ -11103,7 +11043,6 @@ const InternalUpload = (props, ref) => {
|
|
|
11103
11043
|
// ===================== Disabled =====================
|
|
11104
11044
|
const disabled = React.useContext(DisabledContext);
|
|
11105
11045
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
11106
|
-
const customRequest = props.customRequest || config.customRequest;
|
|
11107
11046
|
const [mergedFileList, setMergedFileList] = useMergedState(defaultFileList || [], {
|
|
11108
11047
|
value: fileList,
|
|
11109
11048
|
postState: list => list !== null && list !== void 0 ? list : []
|
|
@@ -11233,6 +11172,7 @@ const InternalUpload = (props, ref) => {
|
|
|
11233
11172
|
const onSuccess = (response, file, xhr) => {
|
|
11234
11173
|
try {
|
|
11235
11174
|
if (typeof response === 'string') {
|
|
11175
|
+
// biome-ignore lint/style/noParameterAssign: we need to modify response
|
|
11236
11176
|
response = JSON.parse(response);
|
|
11237
11177
|
}
|
|
11238
11178
|
} catch (_a) {
|
|
@@ -11325,7 +11265,6 @@ const InternalUpload = (props, ref) => {
|
|
|
11325
11265
|
onProgress,
|
|
11326
11266
|
onSuccess
|
|
11327
11267
|
}, props), {
|
|
11328
|
-
customRequest,
|
|
11329
11268
|
data,
|
|
11330
11269
|
multiple,
|
|
11331
11270
|
action,
|
|
@@ -11424,8 +11363,7 @@ const InternalUpload = (props, ref) => {
|
|
|
11424
11363
|
[`${prefixCls}-hidden`]: !children
|
|
11425
11364
|
});
|
|
11426
11365
|
const uploadButton = /*#__PURE__*/React.createElement("div", {
|
|
11427
|
-
className: uploadBtnCls
|
|
11428
|
-
style: mergedStyle
|
|
11366
|
+
className: uploadBtnCls
|
|
11429
11367
|
}, /*#__PURE__*/React.createElement(Upload$1, Object.assign({}, rcUploadProps, {
|
|
11430
11368
|
ref: upload
|
|
11431
11369
|
})));
|