@arco-design/mobile-react 2.30.9 → 2.31.0
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/CHANGELOG.md +32 -0
- package/README.en-US.md +70 -2
- package/README.md +69 -2
- package/cjs/carousel/index.js +3 -0
- package/cjs/form/form-item.d.ts +3 -0
- package/cjs/form/form-item.js +38 -10
- package/cjs/form/style/css/index.css +13 -0
- package/cjs/form/style/index.less +18 -0
- package/cjs/icon/IconCheck/index.js +1 -2
- package/cjs/icon/IconDownload/index.d.ts +7 -0
- package/cjs/icon/IconDownload/index.js +41 -0
- package/cjs/icon/IconFile/index.d.ts +7 -0
- package/cjs/icon/IconFile/index.js +41 -0
- package/cjs/icon/IconKeyboard/index.js +1 -0
- package/cjs/icon/IconQuestionCircle/index.js +1 -2
- package/cjs/icon/IconUpload/index.js +6 -4
- package/cjs/icon/IconUserFill/index.js +1 -2
- package/cjs/icon/index.d.ts +3 -1
- package/cjs/icon/index.js +17 -7
- package/cjs/icon/type.d.ts +3 -1
- package/cjs/image-picker/index.js +15 -161
- package/cjs/image-picker/type.d.ts +4 -73
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +6 -2
- package/cjs/input/hooks.js +2 -2
- package/cjs/input/props.d.ts +2 -2
- package/cjs/picker/index.js +60 -19
- package/cjs/picker/type.d.ts +7 -2
- package/cjs/picker-view/components/cascader.d.ts +1 -0
- package/cjs/picker-view/components/cascader.js +8 -1
- package/cjs/picker-view/components/picker-cell.d.ts +1 -0
- package/cjs/picker-view/components/picker-cell.js +6 -1
- package/cjs/picker-view/index.d.ts +6 -1
- package/cjs/picker-view/index.js +25 -13
- package/cjs/style.d.ts +1 -0
- package/cjs/style.js +3 -1
- package/cjs/tabs/tab-cell.js +54 -29
- package/cjs/tabs/type.d.ts +5 -0
- package/cjs/uploader/index.d.ts +16 -0
- package/cjs/uploader/index.js +180 -0
- package/cjs/uploader/style/css/index.css +650 -0
- package/cjs/uploader/style/css/index.d.ts +4 -0
- package/cjs/uploader/style/css/index.js +9 -0
- package/cjs/uploader/style/index.d.ts +4 -0
- package/cjs/uploader/style/index.js +9 -0
- package/cjs/uploader/style/index.less +161 -0
- package/cjs/uploader/type.d.ts +108 -0
- package/cjs/uploader/type.js +3 -0
- package/cjs/uploader/upload/index.d.ts +2 -0
- package/cjs/uploader/upload/index.js +19 -0
- package/cjs/uploader/upload/type.d.ts +107 -0
- package/cjs/uploader/upload/type.js +3 -0
- package/cjs/uploader/upload/upload.d.ts +20 -0
- package/cjs/uploader/upload/upload.js +189 -0
- package/dist/index.js +679 -310
- package/dist/index.min.js +4 -4
- package/dist/style.css +593 -0
- package/dist/style.min.css +1 -1
- package/esm/carousel/index.js +3 -0
- package/esm/form/form-item.d.ts +3 -0
- package/esm/form/form-item.js +36 -10
- package/esm/form/style/css/index.css +13 -0
- package/esm/form/style/index.less +18 -0
- package/esm/icon/IconCheck/index.js +1 -2
- package/esm/icon/IconDownload/index.d.ts +7 -0
- package/esm/icon/IconDownload/index.js +30 -0
- package/esm/icon/IconFile/index.d.ts +7 -0
- package/esm/icon/IconFile/index.js +30 -0
- package/esm/icon/IconKeyboard/index.js +1 -0
- package/esm/icon/IconQuestionCircle/index.js +1 -2
- package/esm/icon/IconUpload/index.js +6 -4
- package/esm/icon/IconUserFill/index.js +1 -2
- package/esm/icon/index.d.ts +3 -1
- package/esm/icon/index.js +3 -1
- package/esm/icon/type.d.ts +3 -1
- package/esm/image-picker/index.js +14 -160
- package/esm/image-picker/type.d.ts +4 -73
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/hooks.js +2 -2
- package/esm/input/props.d.ts +2 -2
- package/esm/picker/index.js +61 -20
- package/esm/picker/type.d.ts +7 -2
- package/esm/picker-view/components/cascader.d.ts +1 -0
- package/esm/picker-view/components/cascader.js +8 -1
- package/esm/picker-view/components/picker-cell.d.ts +1 -0
- package/esm/picker-view/components/picker-cell.js +6 -1
- package/esm/picker-view/index.d.ts +6 -1
- package/esm/picker-view/index.js +26 -13
- package/esm/style.d.ts +1 -0
- package/esm/style.js +2 -1
- package/esm/tabs/tab-cell.js +56 -30
- package/esm/tabs/type.d.ts +5 -0
- package/esm/uploader/index.d.ts +16 -0
- package/esm/uploader/index.js +150 -0
- package/esm/uploader/style/css/index.css +650 -0
- package/esm/uploader/style/css/index.d.ts +4 -0
- package/esm/uploader/style/css/index.js +4 -0
- package/esm/uploader/style/index.d.ts +4 -0
- package/esm/uploader/style/index.js +4 -0
- package/esm/uploader/style/index.less +161 -0
- package/esm/uploader/type.d.ts +108 -0
- package/esm/uploader/type.js +1 -0
- package/esm/uploader/upload/index.d.ts +2 -0
- package/esm/uploader/upload/index.js +2 -0
- package/esm/uploader/upload/type.d.ts +107 -0
- package/esm/uploader/upload/type.js +1 -0
- package/esm/uploader/upload/upload.d.ts +20 -0
- package/esm/uploader/upload/upload.js +175 -0
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +27 -0
- package/tokens/app/arcodesign/default/index.d.ts +27 -0
- package/tokens/app/arcodesign/default/index.js +28 -1
- package/tokens/app/arcodesign/default/index.json +292 -0
- package/tokens/app/arcodesign/default/index.less +27 -0
- package/umd/carousel/index.js +3 -0
- package/umd/form/form-item.d.ts +3 -0
- package/umd/form/form-item.js +38 -10
- package/umd/form/style/css/index.css +13 -0
- package/umd/form/style/index.less +18 -0
- package/umd/icon/IconCheck/index.js +1 -2
- package/umd/icon/IconDownload/index.d.ts +7 -0
- package/umd/icon/IconDownload/index.js +49 -0
- package/umd/icon/IconFile/index.d.ts +7 -0
- package/umd/icon/IconFile/index.js +49 -0
- package/umd/icon/IconKeyboard/index.js +1 -0
- package/umd/icon/IconQuestionCircle/index.js +1 -2
- package/umd/icon/IconUpload/index.js +6 -4
- package/umd/icon/IconUserFill/index.js +1 -2
- package/umd/icon/index.d.ts +3 -1
- package/umd/icon/index.js +15 -9
- package/umd/icon/type.d.ts +3 -1
- package/umd/image-picker/index.js +17 -163
- package/umd/image-picker/type.d.ts +4 -73
- package/umd/index.d.ts +1 -0
- package/umd/index.js +7 -5
- package/umd/input/hooks.js +2 -2
- package/umd/input/props.d.ts +2 -2
- package/umd/picker/index.js +60 -19
- package/umd/picker/type.d.ts +7 -2
- package/umd/picker-view/components/cascader.d.ts +1 -0
- package/umd/picker-view/components/cascader.js +8 -1
- package/umd/picker-view/components/picker-cell.d.ts +1 -0
- package/umd/picker-view/components/picker-cell.js +6 -1
- package/umd/picker-view/index.d.ts +6 -1
- package/umd/picker-view/index.js +25 -13
- package/umd/style.d.ts +1 -0
- package/umd/style.js +4 -4
- package/umd/tabs/tab-cell.js +54 -29
- package/umd/tabs/type.d.ts +5 -0
- package/umd/uploader/index.d.ts +16 -0
- package/umd/uploader/index.js +178 -0
- package/umd/uploader/style/css/index.css +650 -0
- package/umd/uploader/style/css/index.d.ts +4 -0
- package/umd/uploader/style/css/index.js +15 -0
- package/umd/uploader/style/index.d.ts +4 -0
- package/umd/uploader/style/index.js +15 -0
- package/umd/uploader/style/index.less +161 -0
- package/umd/uploader/type.d.ts +108 -0
- package/umd/uploader/type.js +17 -0
- package/umd/uploader/upload/index.d.ts +2 -0
- package/umd/uploader/upload/index.js +27 -0
- package/umd/uploader/upload/type.d.ts +107 -0
- package/umd/uploader/upload/type.js +17 -0
- package/umd/uploader/upload/upload.d.ts +20 -0
- package/umd/uploader/upload/upload.js +200 -0
package/dist/index.js
CHANGED
@@ -126,7 +126,7 @@
|
|
126
126
|
* ```
|
127
127
|
*/
|
128
128
|
|
129
|
-
function isArray(obj) {
|
129
|
+
function isArray$1(obj) {
|
130
130
|
return opt.call(obj) === '[object Array]';
|
131
131
|
}
|
132
132
|
/**
|
@@ -237,7 +237,7 @@
|
|
237
237
|
*/
|
238
238
|
|
239
239
|
function isEmptyArray(obj) {
|
240
|
-
return isArray(obj) && !(obj === null || obj === void 0 ? void 0 : obj.length);
|
240
|
+
return isArray$1(obj) && !(obj === null || obj === void 0 ? void 0 : obj.length);
|
241
241
|
}
|
242
242
|
/**
|
243
243
|
* 深比较两个对象是否相等
|
@@ -312,7 +312,7 @@
|
|
312
312
|
|
313
313
|
if (isString(v)) {
|
314
314
|
classNames.push(v);
|
315
|
-
} else if (isArray(v)) {
|
315
|
+
} else if (isArray$1(v)) {
|
316
316
|
classNames = classNames.concat(v);
|
317
317
|
} else if (isObject$2(v)) {
|
318
318
|
Object.keys(v).forEach(function (k) {
|
@@ -1715,10 +1715,15 @@
|
|
1715
1715
|
},
|
1716
1716
|
boolean: {
|
1717
1717
|
equal: '%s 不等于 `%s`'
|
1718
|
-
}
|
1718
|
+
},
|
1719
|
+
pickerDefaultHint: '请选择'
|
1719
1720
|
},
|
1720
1721
|
NavBar: {
|
1721
1722
|
backBtnAriaLabel: '返回'
|
1723
|
+
},
|
1724
|
+
Uploader: {
|
1725
|
+
uploadBtn: '点击上传',
|
1726
|
+
retryUpload: '点击重试'
|
1722
1727
|
}
|
1723
1728
|
};
|
1724
1729
|
|
@@ -3652,7 +3657,7 @@
|
|
3652
3657
|
Object.keys(this.rules).forEach(function (key) {
|
3653
3658
|
var spPromiseGroup = [];
|
3654
3659
|
|
3655
|
-
if (isArray(_this.rules[key])) {
|
3660
|
+
if (isArray$1(_this.rules[key])) {
|
3656
3661
|
for (var i = 0; i < _this.rules[key].length; i++) {
|
3657
3662
|
var rule = _this.rules[key][i];
|
3658
3663
|
|
@@ -5132,14 +5137,18 @@
|
|
5132
5137
|
return tabs.length < overflowThreshold ? tabBarArrange : 'start';
|
5133
5138
|
}),
|
5134
5139
|
originArrange = _d[0],
|
5135
|
-
setOriginArrange = _d[1];
|
5140
|
+
setOriginArrange = _d[1];
|
5136
5141
|
|
5142
|
+
var _e = React.useState(false),
|
5143
|
+
forceUpdate = _e[0],
|
5144
|
+
setForceUpdate = _e[1]; // 默认tab小于overflowThreshold个时不开启加载前隐藏,大于overflowThreshold个时开启
|
5137
5145
|
|
5138
|
-
|
5146
|
+
|
5147
|
+
var _f = React.useState(function () {
|
5139
5148
|
return hideTabBarBeforeMounted === void 0 ? tabs.length < overflowThreshold || activeIndex === 0 : !hideTabBarBeforeMounted;
|
5140
5149
|
}),
|
5141
|
-
showTab =
|
5142
|
-
setShowTab =
|
5150
|
+
showTab = _f[0],
|
5151
|
+
setShowTab = _f[1];
|
5143
5152
|
|
5144
5153
|
var isVertical = tabDirection === 'vertical';
|
5145
5154
|
var isLine = (type || '').indexOf('line') !== -1;
|
@@ -5154,6 +5163,15 @@
|
|
5154
5163
|
var hasDivider = tabBarHasDivider === void 0 ? isLine : tabBarHasDivider;
|
5155
5164
|
var wrapSize = isVertical ? wrapWidth : wrapHeight;
|
5156
5165
|
var system = useSystem();
|
5166
|
+
|
5167
|
+
var updateScrollPosition = function updateScrollPosition() {
|
5168
|
+
if (wrapSize && tabBarScrollChance !== 'none') {
|
5169
|
+
setTimeout(function () {
|
5170
|
+
scrollToCenter();
|
5171
|
+
}, tabBarScrollChance === 'after-jump' ? Math.max(transitionDuration || 0, duration || 0) : 0);
|
5172
|
+
}
|
5173
|
+
};
|
5174
|
+
|
5157
5175
|
React.useEffect(function () {
|
5158
5176
|
nextTick(function () {
|
5159
5177
|
setCellOverflow(); // dom出来之后originArrange置空,交由tabBarArrange控制
|
@@ -5173,31 +5191,16 @@
|
|
5173
5191
|
(_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.resetUnderlineStyle();
|
5174
5192
|
});
|
5175
5193
|
}, [activeIndex, tabs, getCellPadding('left'), getCellPadding('right'), tabBarGutter, tabDirection]);
|
5176
|
-
React.useImperativeHandle(ref, function () {
|
5177
|
-
return {
|
5178
|
-
dom: domRef.current,
|
5179
|
-
scrollTo: scrollTo,
|
5180
|
-
scrollToCenter: scrollToCenter,
|
5181
|
-
hasOverflow: hasOverflow,
|
5182
|
-
setCaterpillarAnimate: function setCaterpillarAnimate(ratio) {
|
5183
|
-
var _a;
|
5184
|
-
|
5185
|
-
return (_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.setCaterpillarAnimate(ratio);
|
5186
|
-
},
|
5187
|
-
resetUnderlineStyle: function resetUnderlineStyle() {
|
5188
|
-
var _a;
|
5189
|
-
|
5190
|
-
return (_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.resetUnderlineStyle();
|
5191
|
-
}
|
5192
|
-
};
|
5193
|
-
}, [scrollToCenter, scrollTo, hasOverflow]);
|
5194
5194
|
React.useEffect(function () {
|
5195
|
-
|
5196
|
-
setTimeout(function () {
|
5197
|
-
scrollToCenter();
|
5198
|
-
}, tabBarScrollChance === 'after-jump' ? Math.max(transitionDuration || 0, duration || 0) : 0);
|
5199
|
-
}
|
5195
|
+
updateScrollPosition();
|
5200
5196
|
}, [activeIndex, wrapSize]);
|
5197
|
+
useUpdateEffect(function () {
|
5198
|
+
var _a;
|
5199
|
+
|
5200
|
+
setCellOverflow();
|
5201
|
+
(_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.resetUnderlineStyle();
|
5202
|
+
updateScrollPosition();
|
5203
|
+
}, [forceUpdate]);
|
5201
5204
|
React.useEffect(function () {
|
5202
5205
|
tabBarScrollChance !== 'none' && scrollToCenter(true); // TabCell左右可滚动时,防止触发父级touchmove事件导致滚不动
|
5203
5206
|
// @en When the TabCell can be scrolled left and right, prevent the parent touchmove event from being triggered which result in inability to scroll
|
@@ -5336,7 +5339,7 @@
|
|
5336
5339
|
return typeof tab === 'string' ? tab : tab.title;
|
5337
5340
|
}
|
5338
5341
|
|
5339
|
-
function renderTabUnderline() {
|
5342
|
+
var renderTabUnderline = function renderTabUnderline() {
|
5340
5343
|
if (!showUnderline || !isLine) {
|
5341
5344
|
return null;
|
5342
5345
|
}
|
@@ -5367,7 +5370,7 @@
|
|
5367
5370
|
getTabCenterLeft: getTabCenterLeft,
|
5368
5371
|
getTabRect: getTabRect
|
5369
5372
|
}, lineProps));
|
5370
|
-
}
|
5373
|
+
};
|
5371
5374
|
|
5372
5375
|
var cellInner = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, tabs.map(function (tab, index) {
|
5373
5376
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -5409,6 +5412,34 @@
|
|
5409
5412
|
height: '100%'
|
5410
5413
|
}
|
5411
5414
|
}) : null);
|
5415
|
+
|
5416
|
+
var _updateLayout = function updateLayout() {
|
5417
|
+
setForceUpdate(function (val) {
|
5418
|
+
return !val;
|
5419
|
+
});
|
5420
|
+
};
|
5421
|
+
|
5422
|
+
React.useImperativeHandle(ref, function () {
|
5423
|
+
return {
|
5424
|
+
dom: domRef.current,
|
5425
|
+
scrollTo: scrollTo,
|
5426
|
+
scrollToCenter: scrollToCenter,
|
5427
|
+
hasOverflow: hasOverflow,
|
5428
|
+
setCaterpillarAnimate: function setCaterpillarAnimate(ratio) {
|
5429
|
+
var _a;
|
5430
|
+
|
5431
|
+
return (_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.setCaterpillarAnimate(ratio);
|
5432
|
+
},
|
5433
|
+
resetUnderlineStyle: function resetUnderlineStyle() {
|
5434
|
+
var _a;
|
5435
|
+
|
5436
|
+
return (_a = underlineRef.current) === null || _a === void 0 ? void 0 : _a.resetUnderlineStyle();
|
5437
|
+
},
|
5438
|
+
updateLayout: function updateLayout() {
|
5439
|
+
return _updateLayout();
|
5440
|
+
}
|
5441
|
+
};
|
5442
|
+
}, [scrollToCenter, scrollTo, hasOverflow]);
|
5412
5443
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
5413
5444
|
className: cls(prefix + "-container-wrap", tabDirection, "type-" + type, tabBarClass, system),
|
5414
5445
|
style: tabBarStyle
|
@@ -7122,6 +7153,30 @@
|
|
7122
7153
|
});
|
7123
7154
|
}
|
7124
7155
|
|
7156
|
+
function IconDelete(props) {
|
7157
|
+
var _a = props.className,
|
7158
|
+
className = _a === void 0 ? '' : _a,
|
7159
|
+
_b = props.useCurrentColor,
|
7160
|
+
useCurrentColor = _b === void 0 ? true : _b,
|
7161
|
+
style = props.style,
|
7162
|
+
other = __rest$1(props, ["className", "useCurrentColor", "style"]);
|
7163
|
+
|
7164
|
+
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
7165
|
+
var prefixCls = _a.prefixCls;
|
7166
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", __assign$3({
|
7167
|
+
className: prefixCls + "-icon " + prefixCls + "-icon-delete " + className,
|
7168
|
+
width: "1em",
|
7169
|
+
height: "1em",
|
7170
|
+
style: style,
|
7171
|
+
viewBox: "0 0 1024 1024",
|
7172
|
+
xmlns: "http://www.w3.org/2000/svg"
|
7173
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("path", {
|
7174
|
+
fill: useCurrentColor ? 'currentColor' : '#000',
|
7175
|
+
d: "M640 85.333A42.667 42.667 0 01682.667 128l-.022 42.645 228.694.022c9.493 0 12.928.981 16.426 2.858a19.41 19.41 0 018.043 8.064c1.877 3.478 2.859 6.912 2.859 16.427v30.635c0 9.514-.982 12.949-2.859 16.426a19.392 19.392 0 01-8.064 8.064c-3.477 1.878-6.912 2.859-16.427 2.859l-57.984-.021V896a42.667 42.667 0 01-42.666 42.667H213.333A42.667 42.667 0 01170.667 896l-.022-640.021-57.962.021c-9.515 0-12.95-.981-16.427-2.859a19.392 19.392 0 01-8.064-8.064c-1.877-3.477-2.859-6.912-2.859-16.426v-30.635c0-9.515.982-12.95 2.859-16.427a19.392 19.392 0 018.064-8.064c3.477-1.877 6.912-2.858 16.427-2.858l228.629-.022.021-42.645A42.667 42.667 0 01384 85.333h256zM768 256H256v597.333h512V256zM448 384a21.333 21.333 0 0121.333 21.333V704A21.333 21.333 0 01448 725.333h-42.667A21.333 21.333 0 01384 704V405.333A21.333 21.333 0 01405.333 384H448zm170.667 0A21.333 21.333 0 01640 405.333V704a21.333 21.333 0 01-21.333 21.333H576A21.333 21.333 0 01554.667 704V405.333A21.333 21.333 0 01576 384h42.667z"
|
7176
|
+
}));
|
7177
|
+
});
|
7178
|
+
}
|
7179
|
+
|
7125
7180
|
function IconStarFill(props) {
|
7126
7181
|
var _a = props.className,
|
7127
7182
|
className = _a === void 0 ? '' : _a,
|
@@ -7191,8 +7246,7 @@
|
|
7191
7246
|
}, other), /*#__PURE__*/React__default["default"].createElement("path", {
|
7192
7247
|
fillRule: "evenodd",
|
7193
7248
|
clipRule: "evenodd",
|
7194
|
-
d: "M16.702 4.47a.5.5 0 00-.705.06L8.33 13.596 3.82 9.724a.5.5 0 00-.705.054l-.652.758a.5.5 0 00.054.706L7.361 15.4a.5.5 0 00.054.053l.526.445.22.188a.5.5 0 00.722-.047l8.641-10.218a.5.5 0 00-.059-.705l-.763-.645z"
|
7195
|
-
fill: useCurrentColor ? 'currentColor' : '#000'
|
7249
|
+
d: "M16.702 4.47a.5.5 0 00-.705.06L8.33 13.596 3.82 9.724a.5.5 0 00-.705.054l-.652.758a.5.5 0 00.054.706L7.361 15.4a.5.5 0 00.054.053l.526.445.22.188a.5.5 0 00.722-.047l8.641-10.218a.5.5 0 00-.059-.705l-.763-.645z"
|
7196
7250
|
}));
|
7197
7251
|
});
|
7198
7252
|
}
|
@@ -7312,8 +7366,7 @@
|
|
7312
7366
|
fill: useCurrentColor ? 'currentColor' : '#000',
|
7313
7367
|
xmlns: "http://www.w3.org/2000/svg"
|
7314
7368
|
}, other), /*#__PURE__*/React__default["default"].createElement("path", {
|
7315
|
-
d: "M12.5 10.833c2.301 0 5 1.786 5 5v2.5c0 .46-.373.834-.833.834H3.333a.833.833 0 01-.833-.834v-2.5c0-3.211 2.699-5 5-5h5zM10 1.25a4.167 4.167 0 110 8.333 4.167 4.167 0 010-8.333z"
|
7316
|
-
fill: useCurrentColor ? 'currentColor' : '#000'
|
7369
|
+
d: "M12.5 10.833c2.301 0 5 1.786 5 5v2.5c0 .46-.373.834-.833.834H3.333a.833.833 0 01-.833-.834v-2.5c0-3.211 2.699-5 5-5h5zM10 1.25a4.167 4.167 0 110 8.333 4.167 4.167 0 010-8.333z"
|
7317
7370
|
}));
|
7318
7371
|
});
|
7319
7372
|
}
|
@@ -7516,6 +7569,7 @@
|
|
7516
7569
|
height: "1em",
|
7517
7570
|
style: style,
|
7518
7571
|
version: "1.1",
|
7572
|
+
id: "svg_388a56dbb6__\u56FE\u5C42_1",
|
7519
7573
|
xmlns: "http://www.w3.org/2000/svg",
|
7520
7574
|
x: "0",
|
7521
7575
|
y: "0",
|
@@ -7562,6 +7616,58 @@
|
|
7562
7616
|
});
|
7563
7617
|
}
|
7564
7618
|
|
7619
|
+
function IconFile(props) {
|
7620
|
+
var _a = props.className,
|
7621
|
+
className = _a === void 0 ? '' : _a,
|
7622
|
+
_b = props.useCurrentColor,
|
7623
|
+
useCurrentColor = _b === void 0 ? true : _b,
|
7624
|
+
style = props.style,
|
7625
|
+
other = __rest$1(props, ["className", "useCurrentColor", "style"]);
|
7626
|
+
|
7627
|
+
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
7628
|
+
var prefixCls = _a.prefixCls;
|
7629
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", __assign$3({
|
7630
|
+
className: prefixCls + "-icon " + prefixCls + "-icon-file " + className,
|
7631
|
+
width: "1em",
|
7632
|
+
height: "1em",
|
7633
|
+
style: style,
|
7634
|
+
fill: useCurrentColor ? 'currentColor' : '#000',
|
7635
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7636
|
+
viewBox: "0 0 16 16"
|
7637
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("path", {
|
7638
|
+
d: "M2.3,2.7c0-0.7,0.6-1.3,1.3-1.3h7.3l2.7,2.7v9.3c0,0.7-0.6,1.3-1.3,1.3H3.7c-0.7,0-1.3-0.6-1.3-1.3\tV2.7z M10.4,2.7H3.7v10.7h8.7V4.6L10.4,2.7z M10.7,7.7H5.3V6.3h5.3V7.7z M8.7,10.3H5.3V9h3.3V10.3z",
|
7639
|
+
fillRule: "evenodd",
|
7640
|
+
clipRule: "evenodd"
|
7641
|
+
}));
|
7642
|
+
});
|
7643
|
+
}
|
7644
|
+
|
7645
|
+
function IconUpload(props) {
|
7646
|
+
var _a = props.className,
|
7647
|
+
className = _a === void 0 ? '' : _a,
|
7648
|
+
_b = props.useCurrentColor,
|
7649
|
+
useCurrentColor = _b === void 0 ? true : _b,
|
7650
|
+
style = props.style,
|
7651
|
+
other = __rest$1(props, ["className", "useCurrentColor", "style"]);
|
7652
|
+
|
7653
|
+
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
7654
|
+
var prefixCls = _a.prefixCls;
|
7655
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", __assign$3({
|
7656
|
+
className: prefixCls + "-icon " + prefixCls + "-icon-upload " + className,
|
7657
|
+
width: "1em",
|
7658
|
+
height: "1em",
|
7659
|
+
style: style,
|
7660
|
+
fill: useCurrentColor ? 'currentColor' : '#000',
|
7661
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7662
|
+
viewBox: "0 0 14 14"
|
7663
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("path", {
|
7664
|
+
d: "M7,1.5l3.1,3.1L9.2,5.4L7.6,3.7v5.9H6.4V3.7L4.8,5.4L3.9,4.6L7,1.5z M2.9,11.4v-1.2H1.8v2.3h10.5\tv-2.3h-1.2v1.2H2.9z",
|
7665
|
+
fillRule: "evenodd",
|
7666
|
+
clipRule: "evenodd"
|
7667
|
+
}));
|
7668
|
+
});
|
7669
|
+
}
|
7670
|
+
|
7565
7671
|
var Step = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
7566
7672
|
var title = props.title,
|
7567
7673
|
description = props.description,
|
@@ -7727,7 +7833,7 @@
|
|
7727
7833
|
* @type_en Data Display
|
7728
7834
|
*/
|
7729
7835
|
|
7730
|
-
var index$
|
7836
|
+
var index$q = componentWrapper(Steps, {
|
7731
7837
|
Step: Step
|
7732
7838
|
});
|
7733
7839
|
|
@@ -9056,7 +9162,7 @@
|
|
9056
9162
|
* @name_en ActionSheet
|
9057
9163
|
*/
|
9058
9164
|
|
9059
|
-
var index$
|
9165
|
+
var index$p = componentWrapper(ActionSheet, methodsGenerator$5(ActionSheetWithGlobalContext));
|
9060
9166
|
|
9061
9167
|
/**
|
9062
9168
|
* 加载中组件,分为四种类型,`circle`为环形,`arc`为弧线,`spin`为旋转,`dot`为圆点。所有类型均可定制颜色,环形和弧线类型可定制线圈半径及粗细,旋转和圆点类型可定制内部元素透明度。
|
@@ -9841,7 +9947,7 @@
|
|
9841
9947
|
* @name_en Avatar
|
9842
9948
|
*/
|
9843
9949
|
|
9844
|
-
var index$
|
9950
|
+
var index$o = componentWrapper(Avatar, {
|
9845
9951
|
Group: Group$4
|
9846
9952
|
});
|
9847
9953
|
|
@@ -10717,6 +10823,9 @@
|
|
10717
10823
|
|
10718
10824
|
function getFakeChild() {
|
10719
10825
|
if (noLoop) {
|
10826
|
+
// 循环状态从有到无时,重置 transforms
|
10827
|
+
// @en reset transforms when loop status changes to false
|
10828
|
+
setTransforms([]);
|
10720
10829
|
return;
|
10721
10830
|
}
|
10722
10831
|
|
@@ -11256,7 +11365,7 @@
|
|
11256
11365
|
* @name_en Cell
|
11257
11366
|
*/
|
11258
11367
|
|
11259
|
-
var index$
|
11368
|
+
var index$n = componentWrapper(Cell, {
|
11260
11369
|
Group: Group$3
|
11261
11370
|
});
|
11262
11371
|
|
@@ -12065,7 +12174,7 @@
|
|
12065
12174
|
* @name_en Collapse
|
12066
12175
|
*/
|
12067
12176
|
|
12068
|
-
var index$
|
12177
|
+
var index$m = componentWrapper(Collapse, {
|
12069
12178
|
Group: Group$1
|
12070
12179
|
});
|
12071
12180
|
|
@@ -12798,6 +12907,10 @@
|
|
12798
12907
|
return (_a = data[currentIndex]) === null || _a === void 0 ? void 0 : _a.value;
|
12799
12908
|
}
|
12800
12909
|
|
12910
|
+
function getCurrentCellData() {
|
12911
|
+
return data[currentIndex];
|
12912
|
+
}
|
12913
|
+
|
12801
12914
|
function _clearTimer() {
|
12802
12915
|
timeRef.current && clearTimeout(timeRef.current);
|
12803
12916
|
timeRef.current = null;
|
@@ -12865,7 +12978,8 @@
|
|
12865
12978
|
return {
|
12866
12979
|
movingStatus: movingStatusRef.current,
|
12867
12980
|
scrollToCurrentIndex: scrollToCurrentIndex,
|
12868
|
-
getCurrentCellValue: getCurrentCellValue
|
12981
|
+
getCurrentCellValue: getCurrentCellValue,
|
12982
|
+
getCurrentCellData: getCurrentCellData
|
12869
12983
|
};
|
12870
12984
|
});
|
12871
12985
|
return !hideEmptyCols || data && data.length ? /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -12916,7 +13030,8 @@
|
|
12916
13030
|
return {
|
12917
13031
|
getCellMovingStatus: getCellMovingStatus,
|
12918
13032
|
scrollToCurrentIndex: scrollToCurrentIndex,
|
12919
|
-
getAllCellsValue: getAllCellsValue
|
13033
|
+
getAllCellsValue: getAllCellsValue,
|
13034
|
+
getAllCellsData: getAllCellsData
|
12920
13035
|
};
|
12921
13036
|
});
|
12922
13037
|
|
@@ -12938,6 +13053,12 @@
|
|
12938
13053
|
});
|
12939
13054
|
}
|
12940
13055
|
|
13056
|
+
function getAllCellsData() {
|
13057
|
+
return pickerCellsRef.current.map(function (cell) {
|
13058
|
+
return cell.getCurrentCellData();
|
13059
|
+
});
|
13060
|
+
}
|
13061
|
+
|
12941
13062
|
function _onValueChange(value, index, newData) {
|
12942
13063
|
var children = arrayTreeFilter(data, function (item, level) {
|
12943
13064
|
return level <= index && item.value === value[level];
|
@@ -13006,6 +13127,14 @@
|
|
13006
13127
|
}));
|
13007
13128
|
});
|
13008
13129
|
|
13130
|
+
var isArray = function isArray(dt) {
|
13131
|
+
return dt ? Array.isArray(dt[0]) : false;
|
13132
|
+
};
|
13133
|
+
|
13134
|
+
var isStrOrNum = function isStrOrNum(dt) {
|
13135
|
+
return typeof dt[0][0] === 'string' || typeof dt[0][0] === 'number';
|
13136
|
+
};
|
13137
|
+
|
13009
13138
|
var PickerView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
13010
13139
|
var _a = props.className,
|
13011
13140
|
className = _a === void 0 ? '' : _a,
|
@@ -13055,14 +13184,6 @@
|
|
13055
13184
|
var innerData = React.useMemo(function () {
|
13056
13185
|
var newData;
|
13057
13186
|
|
13058
|
-
var isArray = function isArray(dt) {
|
13059
|
-
return dt ? Array.isArray(dt[0]) : false;
|
13060
|
-
};
|
13061
|
-
|
13062
|
-
var isStrOrNum = function isStrOrNum(dt) {
|
13063
|
-
return typeof dt[0][0] === 'string' || typeof dt[0][0] === 'number';
|
13064
|
-
};
|
13065
|
-
|
13066
13187
|
if (isArray(data)) {
|
13067
13188
|
if (isStrOrNum(data)) {
|
13068
13189
|
newData = data.map(function (item) {
|
@@ -13096,6 +13217,17 @@
|
|
13096
13217
|
});
|
13097
13218
|
};
|
13098
13219
|
|
13220
|
+
var getAllColumnData = function getAllColumnData() {
|
13221
|
+
var _a;
|
13222
|
+
|
13223
|
+
var curValues = cascade ? ((_a = cascaderRef.current) === null || _a === void 0 ? void 0 : _a.getAllCellsData()) || [] : pickerCellsRef.current.map(function (cell) {
|
13224
|
+
return cell.getCurrentCellData();
|
13225
|
+
});
|
13226
|
+
return curValues.filter(function (v) {
|
13227
|
+
return v !== undefined;
|
13228
|
+
});
|
13229
|
+
};
|
13230
|
+
|
13099
13231
|
function getColumnValue(index) {
|
13100
13232
|
if (index === void 0) {
|
13101
13233
|
index = 0;
|
@@ -13133,7 +13265,8 @@
|
|
13133
13265
|
getColumnValue: getColumnValue,
|
13134
13266
|
updateLayout: updateLayout,
|
13135
13267
|
resetValue: resetValue,
|
13136
|
-
scrollToCurrentIndex: scrollToCurrentIndex
|
13268
|
+
scrollToCurrentIndex: scrollToCurrentIndex,
|
13269
|
+
getAllColumnData: getAllColumnData
|
13137
13270
|
};
|
13138
13271
|
});
|
13139
13272
|
|
@@ -13268,26 +13401,40 @@
|
|
13268
13401
|
hideEmptyCols = _f === void 0 ? false : _f,
|
13269
13402
|
_g = props.title,
|
13270
13403
|
title = _g === void 0 ? '' : _g,
|
13271
|
-
|
13272
|
-
visible = _h === void 0 ? false : _h,
|
13404
|
+
userSetVisible = props.visible,
|
13273
13405
|
value = props.value,
|
13274
|
-
|
13275
|
-
needBottomOffset =
|
13406
|
+
_h = props.needBottomOffset,
|
13407
|
+
needBottomOffset = _h === void 0 ? false : _h,
|
13276
13408
|
onDismiss = props.onDismiss,
|
13277
13409
|
onOk = props.onOk,
|
13278
13410
|
onChange = props.onChange,
|
13279
|
-
|
13280
|
-
maskClosable =
|
13411
|
+
_j = props.maskClosable,
|
13412
|
+
maskClosable = _j === void 0 ? false : _j,
|
13281
13413
|
onHide = props.onHide,
|
13282
13414
|
onPickerChange = props.onPickerChange,
|
13283
13415
|
touchToStop = props.touchToStop,
|
13284
|
-
|
13285
|
-
gestureOutOfControl =
|
13286
|
-
|
13416
|
+
_k = props.gestureOutOfControl,
|
13417
|
+
gestureOutOfControl = _k === void 0 ? true : _k,
|
13418
|
+
renderLinkedContainer = props.renderLinkedContainer,
|
13419
|
+
otherProps = __rest$1(props, ["className", "itemStyle", "cascade", "cols", "rows", "data", "okText", "dismissText", "disabled", "clickable", "hideEmptyCols", "title", "visible", "value", "needBottomOffset", "onDismiss", "onOk", "onChange", "maskClosable", "onHide", "onPickerChange", "touchToStop", "gestureOutOfControl", "renderLinkedContainer"]);
|
13287
13420
|
|
13288
13421
|
var scrollValueRef = useLatestRef(value);
|
13289
13422
|
var domRef = React.useRef(null);
|
13290
13423
|
var pickerViewRef = React.useRef(null);
|
13424
|
+
|
13425
|
+
var _l = React.useState(false),
|
13426
|
+
linkVisible = _l[0],
|
13427
|
+
setLinkVisible = _l[1];
|
13428
|
+
|
13429
|
+
var _m = React.useState(function () {
|
13430
|
+
return getCurrentValueData();
|
13431
|
+
}),
|
13432
|
+
linkArgs = _m[0],
|
13433
|
+
setLinkArgs = _m[1]; // 来自linkedContainer的visible变化,优先级高于受控值
|
13434
|
+
// @en Visible changes from linkedContainer which have priority over controlled values
|
13435
|
+
|
13436
|
+
|
13437
|
+
var visible = linkVisible || userSetVisible || false;
|
13291
13438
|
React.useImperativeHandle(ref, function () {
|
13292
13439
|
return {
|
13293
13440
|
dom: domRef.current,
|
@@ -13318,39 +13465,61 @@
|
|
13318
13465
|
}
|
13319
13466
|
};
|
13320
13467
|
});
|
13468
|
+
React.useEffect(function () {
|
13469
|
+
nextTick(function () {
|
13470
|
+
setLinkArgs(getCurrentValueData());
|
13471
|
+
});
|
13472
|
+
}, []);
|
13473
|
+
|
13474
|
+
function hidePicker(scene) {
|
13475
|
+
setLinkVisible(false);
|
13476
|
+
onHide === null || onHide === void 0 ? void 0 : onHide(scene);
|
13477
|
+
}
|
13321
13478
|
|
13322
13479
|
function handleDismiss() {
|
13323
13480
|
if (onDismiss) {
|
13324
13481
|
onDismiss();
|
13325
13482
|
}
|
13326
13483
|
|
13327
|
-
|
13328
|
-
onHide('dismiss');
|
13329
|
-
}
|
13484
|
+
hidePicker('dismiss');
|
13330
13485
|
}
|
13331
13486
|
|
13332
|
-
|
13487
|
+
function getCurrentValueData() {
|
13488
|
+
var _a, _b;
|
13489
|
+
|
13490
|
+
var val = ((_a = pickerViewRef.current) === null || _a === void 0 ? void 0 : _a.getAllColumnValues()) || scrollValueRef.current || [];
|
13491
|
+
var selectedData = ((_b = pickerViewRef.current) === null || _b === void 0 ? void 0 : _b.getAllColumnData()) || [];
|
13492
|
+
return {
|
13493
|
+
value: val,
|
13494
|
+
data: selectedData
|
13495
|
+
};
|
13496
|
+
}
|
13497
|
+
|
13498
|
+
function handleConfirm() {
|
13333
13499
|
var _a;
|
13334
13500
|
|
13335
13501
|
(_a = pickerViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollToCurrentIndex();
|
13336
13502
|
nextTick(function () {
|
13337
|
-
var _a
|
13503
|
+
var _a = getCurrentValueData(),
|
13504
|
+
val = _a.value,
|
13505
|
+
selectedData = _a.data;
|
13338
13506
|
|
13339
|
-
|
13507
|
+
setLinkArgs({
|
13508
|
+
value: val,
|
13509
|
+
data: selectedData
|
13510
|
+
});
|
13340
13511
|
|
13341
13512
|
if (onOk) {
|
13342
|
-
onOk(val);
|
13513
|
+
onOk(val, selectedData);
|
13343
13514
|
}
|
13344
13515
|
|
13345
13516
|
if (onChange) {
|
13346
13517
|
onChange(val);
|
13347
13518
|
}
|
13348
13519
|
|
13349
|
-
|
13350
|
-
onHide('confirm');
|
13351
|
-
}
|
13520
|
+
hidePicker('confirm');
|
13352
13521
|
});
|
13353
|
-
}
|
13522
|
+
}
|
13354
13523
|
|
13355
13524
|
useListenResize(updateLayoutByVisible, [visible]); // 每次visible从false变为true时需要重新设置scrollValue的值为当前value的值(初始值)
|
13356
13525
|
|
@@ -13366,11 +13535,16 @@
|
|
13366
13535
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
13367
13536
|
var prefixCls = _a.prefixCls,
|
13368
13537
|
locale = _a.locale;
|
13369
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
13538
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, renderLinkedContainer ? /*#__PURE__*/React__default["default"].createElement("div", {
|
13539
|
+
className: prefixCls + "-picker-linked-container",
|
13540
|
+
onClick: function onClick() {
|
13541
|
+
return setLinkVisible(true);
|
13542
|
+
}
|
13543
|
+
}, renderLinkedContainer(linkArgs.value, linkArgs.data)) : null, /*#__PURE__*/React__default["default"].createElement(Popup$1, __assign$3({
|
13370
13544
|
visible: visible,
|
13371
13545
|
className: cls(className, prefixCls + "-picker all-border-box"),
|
13372
13546
|
close: function close() {
|
13373
|
-
return
|
13547
|
+
return hidePicker('mask');
|
13374
13548
|
},
|
13375
13549
|
direction: "bottom",
|
13376
13550
|
maskClosable: maskClosable,
|
@@ -13402,7 +13576,7 @@
|
|
13402
13576
|
clickable: clickable,
|
13403
13577
|
hideEmptyCols: hideEmptyCols,
|
13404
13578
|
touchToStop: touchToStop
|
13405
|
-
})));
|
13579
|
+
}))));
|
13406
13580
|
});
|
13407
13581
|
});
|
13408
13582
|
/**
|
@@ -13788,7 +13962,7 @@
|
|
13788
13962
|
* @displayName DatePicker
|
13789
13963
|
*/
|
13790
13964
|
|
13791
|
-
var index$
|
13965
|
+
var index$l = componentWrapper(DatePicker, 'DatePicker');
|
13792
13966
|
|
13793
13967
|
function normalizeAlert(config) {
|
13794
13968
|
var _a = config || {},
|
@@ -13986,7 +14160,7 @@
|
|
13986
14160
|
* @name_en Dialog
|
13987
14161
|
*/
|
13988
14162
|
|
13989
|
-
var index$
|
14163
|
+
var index$k = componentWrapper(Dialog, methodsGenerator$4(DialogWithGlobalContext));
|
13990
14164
|
|
13991
14165
|
/**
|
13992
14166
|
* 划分内容的装饰线
|
@@ -14457,7 +14631,7 @@
|
|
14457
14631
|
* */
|
14458
14632
|
|
14459
14633
|
function isCascadeArray(options) {
|
14460
|
-
return typeof options[0] === 'object' && !isArray(options[0]);
|
14634
|
+
return typeof options[0] === 'object' && !isArray$1(options[0]);
|
14461
14635
|
}
|
14462
14636
|
/**
|
14463
14637
|
* 格式化传入的数组
|
@@ -15747,7 +15921,7 @@
|
|
15747
15921
|
};
|
15748
15922
|
});
|
15749
15923
|
|
15750
|
-
var index$
|
15924
|
+
var index$j = (function () {
|
15751
15925
|
// Export existing implementation if available.
|
15752
15926
|
if (typeof global$1.ResizeObserver !== 'undefined') {
|
15753
15927
|
return global$1.ResizeObserver;
|
@@ -15984,7 +16158,7 @@
|
|
15984
16158
|
React.useEffect(function () {
|
15985
16159
|
if (domRef.current && reflowOnResize) {
|
15986
16160
|
if (!observerRef.current && ellipsis) {
|
15987
|
-
observerRef.current = new index$
|
16161
|
+
observerRef.current = new index$j(reflow);
|
15988
16162
|
observerRef.current.observe(domRef.current);
|
15989
16163
|
}
|
15990
16164
|
}
|
@@ -16489,6 +16663,21 @@
|
|
16489
16663
|
};
|
16490
16664
|
};
|
16491
16665
|
|
16666
|
+
function DefaultPickerLinkedContainer(_a) {
|
16667
|
+
var value = _a.value;
|
16668
|
+
|
16669
|
+
var _b = React.useContext(GlobalContext),
|
16670
|
+
prefixCls = _b.prefixCls,
|
16671
|
+
locale = _b.locale;
|
16672
|
+
|
16673
|
+
var className = prefixCls + "-form-picker-link-container";
|
16674
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
16675
|
+
className: className
|
16676
|
+
}, value && value.length ? value.join('-') : /*#__PURE__*/React__default["default"].createElement("span", {
|
16677
|
+
className: className + "-placeholder"
|
16678
|
+
}, locale === null || locale === void 0 ? void 0 : locale.Form.pickerDefaultHint));
|
16679
|
+
}
|
16680
|
+
|
16492
16681
|
var FormItemInner =
|
16493
16682
|
/** @class */
|
16494
16683
|
function (_super) {
|
@@ -16669,16 +16858,16 @@
|
|
16669
16858
|
|
16670
16859
|
var _this = this;
|
16671
16860
|
|
16672
|
-
var _b;
|
16861
|
+
var _b, _c, _d;
|
16673
16862
|
|
16674
|
-
var
|
16675
|
-
children =
|
16676
|
-
field =
|
16677
|
-
|
16678
|
-
trigger =
|
16679
|
-
|
16680
|
-
triggerPropsField =
|
16681
|
-
displayType =
|
16863
|
+
var _e = this.props,
|
16864
|
+
children = _e.children,
|
16865
|
+
field = _e.field,
|
16866
|
+
_f = _e.trigger,
|
16867
|
+
trigger = _f === void 0 ? 'onChange' : _f,
|
16868
|
+
_g = _e.triggerPropsField,
|
16869
|
+
triggerPropsField = _g === void 0 ? 'value' : _g,
|
16870
|
+
displayType = _e.displayType;
|
16682
16871
|
var getFieldValue = this.context.form.getFieldValue;
|
16683
16872
|
var props = (_a = {}, _a[triggerPropsField] = getFieldValue(field), _a.disabled = this.props.disabled, _a);
|
16684
16873
|
var childrenType = displayType || ((_b = children.type) === null || _b === void 0 ? void 0 : _b.displayName);
|
@@ -16709,16 +16898,26 @@
|
|
16709
16898
|
case FormInternalComponentType.DatePicker:
|
16710
16899
|
props = {
|
16711
16900
|
currentTs: getFieldValue(field),
|
16712
|
-
onChange: this.
|
16713
|
-
disabled: this.props.disabled
|
16901
|
+
onChange: this.innerTriggerFunctionWithValueFirst,
|
16902
|
+
disabled: this.props.disabled,
|
16903
|
+
renderLinkedContainer: ((_c = children.props) === null || _c === void 0 ? void 0 : _c.renderLinkedContainer) || function (val) {
|
16904
|
+
return /*#__PURE__*/React__default["default"].createElement(DefaultPickerLinkedContainer, {
|
16905
|
+
value: val
|
16906
|
+
});
|
16907
|
+
}
|
16714
16908
|
};
|
16715
16909
|
break;
|
16716
16910
|
|
16717
16911
|
case FormInternalComponentType.Picker:
|
16718
16912
|
props = {
|
16719
|
-
|
16720
|
-
|
16721
|
-
disabled: this.props.disabled
|
16913
|
+
value: getFieldValue(field),
|
16914
|
+
onChange: this.innerTriggerFunctionWithValueFirst,
|
16915
|
+
disabled: this.props.disabled,
|
16916
|
+
renderLinkedContainer: ((_d = children.props) === null || _d === void 0 ? void 0 : _d.renderLinkedContainer) || function (val) {
|
16917
|
+
return /*#__PURE__*/React__default["default"].createElement(DefaultPickerLinkedContainer, {
|
16918
|
+
value: val
|
16919
|
+
});
|
16920
|
+
}
|
16722
16921
|
};
|
16723
16922
|
break;
|
16724
16923
|
|
@@ -16926,7 +17125,7 @@
|
|
16926
17125
|
* @name_en Form
|
16927
17126
|
*/
|
16928
17127
|
|
16929
|
-
var index$
|
17128
|
+
var index$i = componentWrapper(Form, {
|
16930
17129
|
Item: Item$1
|
16931
17130
|
});
|
16932
17131
|
|
@@ -17060,6 +17259,20 @@
|
|
17060
17259
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, renderEl);
|
17061
17260
|
});
|
17062
17261
|
|
17262
|
+
function AddIcon() {
|
17263
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
17264
|
+
width: "30",
|
17265
|
+
height: "30",
|
17266
|
+
viewBox: "0 0 30 30",
|
17267
|
+
fill: "none"
|
17268
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
17269
|
+
fillRule: "evenodd",
|
17270
|
+
clipRule: "evenodd",
|
17271
|
+
d: "M14.5 0C14.2239 0 14 0.223857 14 0.5V14H0.5C0.223858 14 0 14.2239 0 14.5V15.5C0 15.7761 0.223857 16 0.5 16H14V29.5C14 29.7761 14.2239 30 14.5 30H15.5C15.7761 30 16 29.7761 16 29.5V16H29.5C29.7761 16 30 15.7761 30 15.5V14.5C30 14.2239 29.7761 14 29.5 14H16V0.5C16 0.223858 15.7761 0 15.5 0H14.5Z",
|
17272
|
+
fill: "#C9CDD4"
|
17273
|
+
}));
|
17274
|
+
}
|
17275
|
+
|
17063
17276
|
var es6Promise = createCommonjsModule(function (module, exports) {
|
17064
17277
|
/*!
|
17065
17278
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
@@ -18232,19 +18445,178 @@
|
|
18232
18445
|
|
18233
18446
|
});
|
18234
18447
|
|
18235
|
-
|
18236
|
-
|
18237
|
-
|
18238
|
-
|
18239
|
-
|
18240
|
-
|
18241
|
-
|
18242
|
-
|
18243
|
-
|
18244
|
-
|
18245
|
-
|
18246
|
-
|
18247
|
-
|
18448
|
+
var Upload =
|
18449
|
+
/** @class */
|
18450
|
+
function () {
|
18451
|
+
function Upload(props, fileRef, cacheRef) {
|
18452
|
+
var _this = this; // 解析文件生成预览
|
18453
|
+
|
18454
|
+
|
18455
|
+
this.handleFile = function (newFiles) {
|
18456
|
+
es6Promise.Promise.all(newFiles.map(function (file) {
|
18457
|
+
return parseFile(file);
|
18458
|
+
})).then(function (parseFiles) {
|
18459
|
+
var res = parseFiles.map(function (url, index) {
|
18460
|
+
return {
|
18461
|
+
url: url,
|
18462
|
+
status: typeof _this.props.upload === 'function' ? 'loading' : 'loaded',
|
18463
|
+
file: newFiles[index]
|
18464
|
+
};
|
18465
|
+
});
|
18466
|
+
_this.cacheRef.current = __spreadArrays$1(_this.cacheRef.current, res);
|
18467
|
+
|
18468
|
+
_this.props.onChange(__spreadArrays$1(_this.cacheRef.current)); // 执行upload
|
18469
|
+
|
18470
|
+
|
18471
|
+
if (typeof _this.props.upload === 'function') {
|
18472
|
+
newFiles.forEach(function (_file) {
|
18473
|
+
_this.props.upload(_this.cacheRef.current.find(function (_a) {
|
18474
|
+
var file = _a.file;
|
18475
|
+
return file === _file;
|
18476
|
+
})).then(function (data) {
|
18477
|
+
var index = _this.cacheRef.current.findIndex(function (_a) {
|
18478
|
+
var file = _a.file;
|
18479
|
+
return file === _file;
|
18480
|
+
});
|
18481
|
+
|
18482
|
+
if (index !== -1) {
|
18483
|
+
_this.cacheRef.current[index] = __assign$3(__assign$3(__assign$3({}, _this.cacheRef.current[index]), data), {
|
18484
|
+
status: 'loaded'
|
18485
|
+
});
|
18486
|
+
}
|
18487
|
+
}).catch(function () {
|
18488
|
+
var index = _this.cacheRef.current.findIndex(function (_a) {
|
18489
|
+
var file = _a.file;
|
18490
|
+
return file === _file;
|
18491
|
+
});
|
18492
|
+
|
18493
|
+
if (index !== -1) {
|
18494
|
+
_this.cacheRef.current[index].status = 'error';
|
18495
|
+
}
|
18496
|
+
}).finally(function () {
|
18497
|
+
_this.props.onChange(__spreadArrays$1(_this.cacheRef.current));
|
18498
|
+
});
|
18499
|
+
});
|
18500
|
+
}
|
18501
|
+
});
|
18502
|
+
};
|
18503
|
+
|
18504
|
+
this.handleChange = function (event, fromAdapter) {
|
18505
|
+
var newFiles = Array.prototype.filter.call(event.target.files || [], function (file) {
|
18506
|
+
// 过滤maxSize
|
18507
|
+
if (_this.props.maxSize && file.size > _this.props.maxSize * 1024) {
|
18508
|
+
_this.props.onMaxSizeExceed && _this.props.onMaxSizeExceed(file);
|
18509
|
+
return false;
|
18510
|
+
}
|
18511
|
+
|
18512
|
+
return true;
|
18513
|
+
}) || [];
|
18514
|
+
|
18515
|
+
if (!fromAdapter) {
|
18516
|
+
event.target.value = '';
|
18517
|
+
} // 截断limit
|
18518
|
+
|
18519
|
+
|
18520
|
+
if (_this.props.limit !== 0 && newFiles.length + _this.props.files.length > _this.props.limit) {
|
18521
|
+
_this.props.onLimitExceed && _this.props.onLimitExceed(newFiles);
|
18522
|
+
newFiles.length = _this.props.limit - _this.props.files.length;
|
18523
|
+
}
|
18524
|
+
|
18525
|
+
_this.handleFile(newFiles);
|
18526
|
+
};
|
18527
|
+
|
18528
|
+
this.deleteFile = function (index) {
|
18529
|
+
_this.props.onDeleteClick && _this.props.onDeleteClick(index);
|
18530
|
+
|
18531
|
+
_this.props.onChange(_this.props.files.filter(function (_i, j) {
|
18532
|
+
return j !== index;
|
18533
|
+
}));
|
18534
|
+
}; // 重新上传
|
18535
|
+
|
18536
|
+
|
18537
|
+
this.retryUpload = function (index) {
|
18538
|
+
_this.deleteFile(index);
|
18539
|
+
|
18540
|
+
_this.handleFile([_this.props.files[index].file]);
|
18541
|
+
};
|
18542
|
+
|
18543
|
+
this.handleSelect = function (e) {
|
18544
|
+
var _a;
|
18545
|
+
|
18546
|
+
if (e.target !== _this.fileRef.current) {
|
18547
|
+
_this.props.onUploadClick && _this.props.onUploadClick();
|
18548
|
+
_this.props.selectAdapter ? _this.props.selectAdapter().then(function (value) {
|
18549
|
+
return _this.handleChange({
|
18550
|
+
target: {
|
18551
|
+
files: value.files
|
18552
|
+
}
|
18553
|
+
}, true);
|
18554
|
+
}) : (_a = _this.fileRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
18555
|
+
}
|
18556
|
+
};
|
18557
|
+
|
18558
|
+
this.handleClick = function (e, file, index) {
|
18559
|
+
var _a, _b;
|
18560
|
+
|
18561
|
+
clearTimeout(_this.timeOutEvent);
|
18562
|
+
|
18563
|
+
if (_this.timeOutEvent !== 0) {
|
18564
|
+
(_b = (_a = _this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e, file, index);
|
18565
|
+
}
|
18566
|
+
};
|
18567
|
+
|
18568
|
+
this.handleTouchStart = function (e, image, index) {
|
18569
|
+
_this.timeOutEvent = setTimeout(function () {
|
18570
|
+
var _a, _b;
|
18571
|
+
|
18572
|
+
_this.timeOutEvent = 0;
|
18573
|
+
(_b = (_a = _this.props).onLongPress) === null || _b === void 0 ? void 0 : _b.call(_a, e, image, index);
|
18574
|
+
}, 750);
|
18575
|
+
};
|
18576
|
+
|
18577
|
+
this.props = __assign$3({}, props);
|
18578
|
+
this.fileRef = fileRef;
|
18579
|
+
this.cacheRef = cacheRef;
|
18580
|
+
this.init();
|
18581
|
+
}
|
18582
|
+
|
18583
|
+
Upload.prototype.init = function () {
|
18584
|
+
!this.props.files && (this.props.files = []);
|
18585
|
+
!this.props.limit && (this.props.limit = 0);
|
18586
|
+
!this.props.onChange && (this.props.onChange = function () {
|
18587
|
+
return null;
|
18588
|
+
});
|
18589
|
+
};
|
18590
|
+
|
18591
|
+
return Upload;
|
18592
|
+
}();
|
18593
|
+
var parseFile = function parseFile(file) {
|
18594
|
+
return new es6Promise.Promise(function (resolve, reject) {
|
18595
|
+
if (file.url) {
|
18596
|
+
resolve(file.url);
|
18597
|
+
} else {
|
18598
|
+
var reader = new FileReader();
|
18599
|
+
|
18600
|
+
reader.onload = function (e) {
|
18601
|
+
var _a;
|
18602
|
+
|
18603
|
+
var dataURL = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
|
18604
|
+
|
18605
|
+
if (!dataURL) {
|
18606
|
+
reject(new Error('file parse error'));
|
18607
|
+
}
|
18608
|
+
|
18609
|
+
resolve(dataURL);
|
18610
|
+
};
|
18611
|
+
|
18612
|
+
reader.onerror = function () {
|
18613
|
+
reject(new Error('file parse error'));
|
18614
|
+
};
|
18615
|
+
|
18616
|
+
reader.readAsDataURL(file);
|
18617
|
+
}
|
18618
|
+
});
|
18619
|
+
};
|
18248
18620
|
|
18249
18621
|
var ImagePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
18250
18622
|
var _a = props.className,
|
@@ -18263,7 +18635,6 @@
|
|
18263
18635
|
limit = _f === void 0 ? 0 : _f,
|
18264
18636
|
_g = props.images,
|
18265
18637
|
images = _g === void 0 ? [] : _g,
|
18266
|
-
maxSize = props.maxSize,
|
18267
18638
|
disabled = props.disabled,
|
18268
18639
|
deleteIcon = props.deleteIcon,
|
18269
18640
|
selectIcon = props.selectIcon,
|
@@ -18276,18 +18647,7 @@
|
|
18276
18647
|
imageProps = props.imageProps,
|
18277
18648
|
renderLoading = props.renderLoading,
|
18278
18649
|
renderError = props.renderError,
|
18279
|
-
|
18280
|
-
onClick = props.onClick,
|
18281
|
-
_l = props.onChange,
|
18282
|
-
onChange = _l === void 0 ? function () {
|
18283
|
-
return null;
|
18284
|
-
} : _l,
|
18285
|
-
onMaxSizeExceed = props.onMaxSizeExceed,
|
18286
|
-
onLimitExceed = props.onLimitExceed,
|
18287
|
-
upload = props.upload,
|
18288
|
-
selectAdapter = props.selectAdapter,
|
18289
|
-
onSelectClick = props.onSelectClick,
|
18290
|
-
onDeleteClick = props.onDeleteClick;
|
18650
|
+
selectAdapter = props.selectAdapter;
|
18291
18651
|
var domRef = React.useRef(null);
|
18292
18652
|
var fileRef = React.useRef(null);
|
18293
18653
|
var cacheRef = useLatestRef(images);
|
@@ -18296,143 +18656,9 @@
|
|
18296
18656
|
dom: domRef.current
|
18297
18657
|
};
|
18298
18658
|
});
|
18299
|
-
|
18300
|
-
|
18301
|
-
|
18302
|
-
if (file.url) {
|
18303
|
-
resolve(file.url);
|
18304
|
-
} else {
|
18305
|
-
var reader = new FileReader();
|
18306
|
-
|
18307
|
-
reader.onload = function (e) {
|
18308
|
-
var _a;
|
18309
|
-
|
18310
|
-
var dataURL = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
|
18311
|
-
|
18312
|
-
if (!dataURL) {
|
18313
|
-
reject(new Error('file parse error'));
|
18314
|
-
}
|
18315
|
-
|
18316
|
-
resolve(dataURL);
|
18317
|
-
};
|
18318
|
-
|
18319
|
-
reader.onerror = function () {
|
18320
|
-
reject(new Error('file parse error'));
|
18321
|
-
};
|
18322
|
-
|
18323
|
-
reader.readAsDataURL(file);
|
18324
|
-
}
|
18325
|
-
});
|
18326
|
-
};
|
18327
|
-
|
18328
|
-
var handleChange = function handleChange(event, fromAdapter) {
|
18329
|
-
var files = Array.prototype.filter.call(event.target.files || [], function (file) {
|
18330
|
-
// 过滤maxSize
|
18331
|
-
if (maxSize && file.size > maxSize * 1024) {
|
18332
|
-
onMaxSizeExceed && onMaxSizeExceed(file);
|
18333
|
-
return false;
|
18334
|
-
}
|
18335
|
-
|
18336
|
-
return true;
|
18337
|
-
}) || [];
|
18338
|
-
|
18339
|
-
if (!fromAdapter) {
|
18340
|
-
event.target.value = '';
|
18341
|
-
} // 截断limit
|
18342
|
-
|
18343
|
-
|
18344
|
-
if (limit !== 0 && files.length + images.length > limit) {
|
18345
|
-
onLimitExceed && onLimitExceed(files);
|
18346
|
-
files.length = limit - images.length;
|
18347
|
-
} // 解析文件生成预览
|
18348
|
-
|
18349
|
-
|
18350
|
-
es6Promise.Promise.all(files.map(function (file) {
|
18351
|
-
return parseFile(file);
|
18352
|
-
})).then(function (parseFiles) {
|
18353
|
-
var res = parseFiles.map(function (url, index) {
|
18354
|
-
return {
|
18355
|
-
url: url,
|
18356
|
-
status: typeof upload === 'function' ? 'loading' : 'loaded',
|
18357
|
-
file: files[index]
|
18358
|
-
};
|
18359
|
-
});
|
18360
|
-
cacheRef.current = __spreadArrays$1(cacheRef.current, res);
|
18361
|
-
onChange(__spreadArrays$1(cacheRef.current)); // 执行upload
|
18362
|
-
|
18363
|
-
if (typeof upload === 'function') {
|
18364
|
-
files.forEach(function (_file) {
|
18365
|
-
upload(cacheRef.current.find(function (_a) {
|
18366
|
-
var file = _a.file;
|
18367
|
-
return file === _file;
|
18368
|
-
})).then(function (data) {
|
18369
|
-
var index = cacheRef.current.findIndex(function (_a) {
|
18370
|
-
var file = _a.file;
|
18371
|
-
return file === _file;
|
18372
|
-
});
|
18373
|
-
|
18374
|
-
if (index !== -1) {
|
18375
|
-
cacheRef.current[index] = __assign$3(__assign$3(__assign$3({}, cacheRef.current[index]), data), {
|
18376
|
-
status: undefined
|
18377
|
-
});
|
18378
|
-
}
|
18379
|
-
}).catch(function () {
|
18380
|
-
var index = cacheRef.current.findIndex(function (_a) {
|
18381
|
-
var file = _a.file;
|
18382
|
-
return file === _file;
|
18383
|
-
});
|
18384
|
-
|
18385
|
-
if (index !== -1) {
|
18386
|
-
cacheRef.current[index].status = 'error';
|
18387
|
-
}
|
18388
|
-
}).finally(function () {
|
18389
|
-
onChange(__spreadArrays$1(cacheRef.current));
|
18390
|
-
});
|
18391
|
-
});
|
18392
|
-
}
|
18393
|
-
});
|
18394
|
-
};
|
18395
|
-
|
18396
|
-
var handleDelete = function handleDelete(index) {
|
18397
|
-
onDeleteClick && onDeleteClick(index);
|
18398
|
-
onChange(images.filter(function (_i, j) {
|
18399
|
-
return j !== index;
|
18400
|
-
}));
|
18401
|
-
}; // click && longPress
|
18402
|
-
|
18403
|
-
|
18404
|
-
var timeOutEvent;
|
18405
|
-
|
18406
|
-
var handleTouchStart = function handleTouchStart(e, image, index) {
|
18407
|
-
timeOutEvent = setTimeout(function () {
|
18408
|
-
timeOutEvent = 0;
|
18409
|
-
onLongPress === null || onLongPress === void 0 ? void 0 : onLongPress(e, image, index);
|
18410
|
-
}, 750);
|
18411
|
-
};
|
18412
|
-
|
18413
|
-
var handleClick = function handleClick(e, image, index) {
|
18414
|
-
clearTimeout(timeOutEvent);
|
18415
|
-
|
18416
|
-
if (timeOutEvent !== 0) {
|
18417
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e, image, index);
|
18418
|
-
}
|
18419
|
-
};
|
18420
|
-
|
18421
|
-
var handleSelect = function handleSelect(e) {
|
18422
|
-
var _a;
|
18423
|
-
|
18424
|
-
if (e.target !== fileRef.current) {
|
18425
|
-
onSelectClick && onSelectClick();
|
18426
|
-
selectAdapter ? selectAdapter().then(function (_a) {
|
18427
|
-
var files = _a.files;
|
18428
|
-
return handleChange({
|
18429
|
-
target: {
|
18430
|
-
files: files
|
18431
|
-
}
|
18432
|
-
}, true);
|
18433
|
-
}) : (_a = fileRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
18434
|
-
}
|
18435
|
-
};
|
18659
|
+
var uploadFunc = new Upload(__assign$3(__assign$3({}, props), {
|
18660
|
+
files: images
|
18661
|
+
}), fileRef, cacheRef);
|
18436
18662
|
|
18437
18663
|
var getGridData = function getGridData(prefixCls, locale) {
|
18438
18664
|
var _a;
|
@@ -18464,10 +18690,10 @@
|
|
18464
18690
|
className: prefixCls + "-image-picker-image"
|
18465
18691
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
18466
18692
|
onTouchStart: function onTouchStart(e) {
|
18467
|
-
return handleTouchStart(e, image, index);
|
18693
|
+
return uploadFunc.handleTouchStart(e, image, index);
|
18468
18694
|
},
|
18469
18695
|
onClick: function onClick(e) {
|
18470
|
-
return handleClick(e, image, index);
|
18696
|
+
return uploadFunc.handleClick(e, image, index);
|
18471
18697
|
},
|
18472
18698
|
className: prefixCls + "-image-picker-image-container"
|
18473
18699
|
}, /*#__PURE__*/React__default["default"].createElement(BaseImage, __assign$3({
|
@@ -18483,7 +18709,7 @@
|
|
18483
18709
|
})), !hideDelete && /*#__PURE__*/React__default["default"].createElement("div", {
|
18484
18710
|
className: prefixCls + "-image-picker-close",
|
18485
18711
|
onClick: function onClick() {
|
18486
|
-
return
|
18712
|
+
return uploadFunc.deleteFile(index);
|
18487
18713
|
}
|
18488
18714
|
}, deleteIcon || /*#__PURE__*/React__default["default"].createElement("div", {
|
18489
18715
|
className: prefixCls + "-image-picker-close-icon"
|
@@ -18498,7 +18724,7 @@
|
|
18498
18724
|
data.push({
|
18499
18725
|
img: /*#__PURE__*/React__default["default"].createElement("div", {
|
18500
18726
|
className: cls(prefixCls + "-image-picker-add", (_a = {}, _a[prefixCls + "-image-picker-add-disabled"] = disableSelect, _a)),
|
18501
|
-
onClick: handleSelect
|
18727
|
+
onClick: uploadFunc.handleSelect
|
18502
18728
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
18503
18729
|
className: prefixCls + "-image-picker-add-container"
|
18504
18730
|
}, selectIcon || /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -18509,7 +18735,7 @@
|
|
18509
18735
|
multiple: multiple,
|
18510
18736
|
type: "file",
|
18511
18737
|
onChange: function onChange(e) {
|
18512
|
-
return handleChange(e);
|
18738
|
+
return uploadFunc.handleChange(e);
|
18513
18739
|
},
|
18514
18740
|
ref: fileRef
|
18515
18741
|
}) : null)),
|
@@ -18549,7 +18775,7 @@
|
|
18549
18775
|
* @displayName ImagePicker
|
18550
18776
|
*/
|
18551
18777
|
|
18552
|
-
var index$
|
18778
|
+
var index$h = componentWrapper(ImagePicker, 'ImagePicker');
|
18553
18779
|
|
18554
18780
|
/*!
|
18555
18781
|
* @arco-design/transformable v1.0.1
|
@@ -21783,7 +22009,7 @@
|
|
21783
22009
|
* @name_en ImagePreview
|
21784
22010
|
*/
|
21785
22011
|
|
21786
|
-
var index$
|
22012
|
+
var index$g = componentWrapper(ImagePreview, methodsGenerator$3(ImagePreviewWithGlobalContext));
|
21787
22013
|
|
21788
22014
|
var IndexBarContext = /*#__PURE__*/React.createContext({
|
21789
22015
|
sticky: true,
|
@@ -22252,7 +22478,7 @@
|
|
22252
22478
|
* @name_en SearchBar
|
22253
22479
|
*/
|
22254
22480
|
|
22255
|
-
var index$
|
22481
|
+
var index$f = componentWrapper(IndexBar, {
|
22256
22482
|
Group: IndexBarGroup
|
22257
22483
|
});
|
22258
22484
|
|
@@ -22314,8 +22540,8 @@
|
|
22314
22540
|
React.useEffect(function () {
|
22315
22541
|
if (autoFocus) {
|
22316
22542
|
setTimeout(function () {
|
22317
|
-
inputRef.current && inputRef.current.
|
22318
|
-
},
|
22543
|
+
inputRef.current && inputRef.current.click();
|
22544
|
+
}, 100);
|
22319
22545
|
}
|
22320
22546
|
}, []);
|
22321
22547
|
React.useEffect(function () {
|
@@ -22592,7 +22818,7 @@
|
|
22592
22818
|
* @displayName Input
|
22593
22819
|
*/
|
22594
22820
|
|
22595
|
-
var index$
|
22821
|
+
var index$e = componentWrapper(Input, 'Input');
|
22596
22822
|
|
22597
22823
|
// @en let keyboard random
|
22598
22824
|
|
@@ -23604,7 +23830,7 @@
|
|
23604
23830
|
* @name_en Notify
|
23605
23831
|
*/
|
23606
23832
|
|
23607
|
-
var index$
|
23833
|
+
var index$d = componentWrapper(Notify, methodsGenerator$2(NotifyWithGlobalContext));
|
23608
23834
|
|
23609
23835
|
function Arrow() {
|
23610
23836
|
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
@@ -25019,7 +25245,7 @@
|
|
25019
25245
|
* @type_en Data Display
|
25020
25246
|
*/
|
25021
25247
|
|
25022
|
-
var index$
|
25248
|
+
var index$c = componentWrapper(Popover$1, {
|
25023
25249
|
Menu: Menu
|
25024
25250
|
});
|
25025
25251
|
|
@@ -25285,7 +25511,7 @@
|
|
25285
25511
|
* @name_en PopupSwiper
|
25286
25512
|
*/
|
25287
25513
|
|
25288
|
-
var index$
|
25514
|
+
var index$b = componentWrapper(PopupSwiper, methodsGenerator$1(PopupSwiperWithGlobalContext));
|
25289
25515
|
|
25290
25516
|
/**
|
25291
25517
|
* 进度条组件,可根据外界传递进来的百分比进行进度展示
|
@@ -26126,7 +26352,7 @@
|
|
26126
26352
|
* @displayName Radio
|
26127
26353
|
*/
|
26128
26354
|
|
26129
|
-
var index$
|
26355
|
+
var index$a = componentWrapper(Radio, 'Radio', {
|
26130
26356
|
Group: Group
|
26131
26357
|
});
|
26132
26358
|
|
@@ -26308,7 +26534,7 @@
|
|
26308
26534
|
* @displayName Rate
|
26309
26535
|
*/
|
26310
26536
|
|
26311
|
-
var index$
|
26537
|
+
var index$9 = componentWrapper(Rate, 'Rate');
|
26312
26538
|
|
26313
26539
|
function createHighlightNode(config, index) {
|
26314
26540
|
var keyword = config.keyword,
|
@@ -27341,7 +27567,7 @@
|
|
27341
27567
|
});
|
27342
27568
|
|
27343
27569
|
var getWidth = function getWidth(idx) {
|
27344
|
-
if (isArray(width)) {
|
27570
|
+
if (isArray$1(width)) {
|
27345
27571
|
return width[idx];
|
27346
27572
|
}
|
27347
27573
|
|
@@ -27540,7 +27766,7 @@
|
|
27540
27766
|
* @name_en Skeleton
|
27541
27767
|
*/
|
27542
27768
|
|
27543
|
-
var index$
|
27769
|
+
var index$8 = componentWrapper(Skeleton, {
|
27544
27770
|
Node: SkeletonNode,
|
27545
27771
|
Title: SkeletonTitle,
|
27546
27772
|
Paragraph: SkeletonParagraph,
|
@@ -28331,7 +28557,7 @@
|
|
28331
28557
|
* @displayName Slider
|
28332
28558
|
*/
|
28333
28559
|
|
28334
|
-
var index$
|
28560
|
+
var index$7 = componentWrapper(SliderWrapper, 'Slider');
|
28335
28561
|
|
28336
28562
|
function correctCalculation(leftNumber, rightNumber, operator) {
|
28337
28563
|
var magnification = 1e17;
|
@@ -28646,7 +28872,7 @@
|
|
28646
28872
|
* @displayName Stepper
|
28647
28873
|
*/
|
28648
28874
|
|
28649
|
-
var index$
|
28875
|
+
var index$6 = componentWrapper(Stepper, 'Stepper');
|
28650
28876
|
|
28651
28877
|
function renderAction(_a) {
|
28652
28878
|
var action = _a.action,
|
@@ -29455,7 +29681,7 @@
|
|
29455
29681
|
* @displayName Switch
|
29456
29682
|
*/
|
29457
29683
|
|
29458
|
-
var index$
|
29684
|
+
var index$5 = componentWrapper(Switch, 'Switch');
|
29459
29685
|
|
29460
29686
|
var TabBarContext = /*#__PURE__*/React.createContext({
|
29461
29687
|
changeIndex: function changeIndex() {},
|
@@ -29599,7 +29825,7 @@
|
|
29599
29825
|
* @name_en TabBar
|
29600
29826
|
*/
|
29601
29827
|
|
29602
|
-
var index$
|
29828
|
+
var index$4 = componentWrapper(TabBar, {
|
29603
29829
|
Item: Item
|
29604
29830
|
});
|
29605
29831
|
|
@@ -29765,7 +29991,7 @@
|
|
29765
29991
|
* @name_en Tag
|
29766
29992
|
*/
|
29767
29993
|
|
29768
|
-
var index$
|
29994
|
+
var index$3 = componentWrapper(Tag, {
|
29769
29995
|
List: List
|
29770
29996
|
});
|
29771
29997
|
|
@@ -29914,7 +30140,7 @@
|
|
29914
30140
|
* @displayName Textarea
|
29915
30141
|
*/
|
29916
30142
|
|
29917
|
-
var index$
|
30143
|
+
var index$2 = componentWrapper(Textarea, 'Textarea');
|
29918
30144
|
|
29919
30145
|
function toast(Component, type) {
|
29920
30146
|
return function (originConfig, context) {
|
@@ -30175,66 +30401,209 @@
|
|
30175
30401
|
* @name_en Toast
|
30176
30402
|
*/
|
30177
30403
|
|
30178
|
-
var index = componentWrapper(Toast, methodsGenerator(ToastWithGlobalContext));
|
30404
|
+
var index$1 = componentWrapper(Toast, methodsGenerator(ToastWithGlobalContext));
|
30405
|
+
|
30406
|
+
var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
30407
|
+
var _a = props.className,
|
30408
|
+
className = _a === void 0 ? '' : _a,
|
30409
|
+
style = props.style,
|
30410
|
+
_b = props.files,
|
30411
|
+
files = _b === void 0 ? [] : _b,
|
30412
|
+
_c = props.accept,
|
30413
|
+
accept = _c === void 0 ? undefined : _c,
|
30414
|
+
_d = props.multiple,
|
30415
|
+
multiple = _d === void 0 ? false : _d,
|
30416
|
+
capture = props.capture,
|
30417
|
+
_e = props.limit,
|
30418
|
+
limit = _e === void 0 ? 0 : _e,
|
30419
|
+
_f = props.hideStatus,
|
30420
|
+
hideStatus = _f === void 0 ? false : _f,
|
30421
|
+
_g = props.alwaysShowSelect,
|
30422
|
+
alwaysShowSelect = _g === void 0 ? false : _g,
|
30423
|
+
disabled = props.disabled,
|
30424
|
+
renderDeleteArea = props.renderDeleteArea,
|
30425
|
+
renderLoadedArea = props.renderLoadedArea,
|
30426
|
+
renderLoadingArea = props.renderLoadingArea,
|
30427
|
+
renderErrorArea = props.renderErrorArea,
|
30428
|
+
renderFileIndexArea = props.renderFileIndexArea,
|
30429
|
+
renderUploadArea = props.renderUploadArea,
|
30430
|
+
renderFileList = props.renderFileList;
|
30431
|
+
var domRef = React.useRef(null);
|
30432
|
+
var fileRef = React.useRef(null);
|
30433
|
+
var cacheRef = useLatestRef(files);
|
30434
|
+
var uploadFunc = new Upload(props, fileRef, cacheRef);
|
30435
|
+
React.useImperativeHandle(ref, function () {
|
30436
|
+
return {
|
30437
|
+
dom: domRef.current
|
30438
|
+
};
|
30439
|
+
});
|
30440
|
+
|
30441
|
+
var uploaderSelect = function uploaderSelect(prefixCls, locale) {
|
30442
|
+
var showSelect = files.length < (limit || Infinity);
|
30443
|
+
return (showSelect || alwaysShowSelect) && /*#__PURE__*/React__default["default"].createElement("div", {
|
30444
|
+
className: prefixCls + "-uploader-add",
|
30445
|
+
onClick: uploadFunc.handleSelect
|
30446
|
+
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
30447
|
+
type: "file",
|
30448
|
+
accept: accept,
|
30449
|
+
capture: capture,
|
30450
|
+
onChange: function onChange(e) {
|
30451
|
+
return uploadFunc.handleChange(e);
|
30452
|
+
},
|
30453
|
+
multiple: multiple,
|
30454
|
+
ref: fileRef
|
30455
|
+
}), renderUploadArea && renderUploadArea() || /*#__PURE__*/React__default["default"].createElement(Button, {
|
30456
|
+
className: prefixCls + "-uploader-add-button",
|
30457
|
+
size: "medium",
|
30458
|
+
icon: /*#__PURE__*/React__default["default"].createElement(IconUpload, null),
|
30459
|
+
disabled: disabled
|
30460
|
+
}, locale.Uploader.uploadBtn));
|
30461
|
+
};
|
30462
|
+
|
30463
|
+
var getUploadList = function getUploadList(prefixCls, locale) {
|
30464
|
+
var generateItemArea = function generateItemArea(fileItem, index, render, part, defaultArea) {
|
30465
|
+
if (render) {
|
30466
|
+
var node = render(fileItem, index);
|
30467
|
+
return node ? /*#__PURE__*/React__default["default"].createElement("div", {
|
30468
|
+
className: prefixCls + "-uploader-list-item-" + part
|
30469
|
+
}, node) : node;
|
30470
|
+
}
|
30471
|
+
|
30472
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
30473
|
+
className: prefixCls + "-uploader-list-item-" + part
|
30474
|
+
}, defaultArea);
|
30475
|
+
};
|
30476
|
+
|
30477
|
+
return renderFileList && renderFileList({
|
30478
|
+
retryUpload: uploadFunc.retryUpload,
|
30479
|
+
deleteFile: uploadFunc.deleteFile
|
30480
|
+
}) || /*#__PURE__*/React__default["default"].createElement("div", {
|
30481
|
+
className: prefixCls + "-uploader-list"
|
30482
|
+
}, (limit && limit < files.length ? files.slice(0, limit) : files).map(function (fileItem, index) {
|
30483
|
+
var _a, _b;
|
30484
|
+
|
30485
|
+
var file = fileItem.file,
|
30486
|
+
status = fileItem.status;
|
30487
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
30488
|
+
className: prefixCls + "-uploader-list-item",
|
30489
|
+
key: index,
|
30490
|
+
onClick: function onClick(e) {
|
30491
|
+
return uploadFunc.handleClick(e, fileItem, index);
|
30492
|
+
}
|
30493
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
30494
|
+
className: prefixCls + "-uploader-list-item-container"
|
30495
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
30496
|
+
className: prefixCls + "-uploader-list-item-wrapper"
|
30497
|
+
}, generateItemArea(fileItem, index, renderFileIndexArea, 'file', /*#__PURE__*/React__default["default"].createElement(IconFile, {
|
30498
|
+
className: prefixCls + "-uploader-list-item-file-icon"
|
30499
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
30500
|
+
className: cls(prefixCls + "-uploader-list-item-text", (_a = {}, _a[prefixCls + "-uploader-list-item-text-error"] = status === 'error', _a))
|
30501
|
+
}, file.name)), !hideStatus && /*#__PURE__*/React__default["default"].createElement("div", {
|
30502
|
+
className: prefixCls + "-uploader-list-item-status"
|
30503
|
+
}, status === 'loaded' && generateItemArea(fileItem, index, renderLoadedArea, 'loaded', /*#__PURE__*/React__default["default"].createElement(IconCheck, null)), status === 'loading' && generateItemArea(fileItem, index, renderLoadingArea, 'loading', /*#__PURE__*/React__default["default"].createElement(Loading, {
|
30504
|
+
type: "circle",
|
30505
|
+
radius: 7
|
30506
|
+
})), status === 'error' && /*#__PURE__*/React__default["default"].createElement("div", {
|
30507
|
+
onClick: function onClick() {
|
30508
|
+
return uploadFunc.retryUpload(index);
|
30509
|
+
}
|
30510
|
+
}, generateItemArea(fileItem, index, renderErrorArea, 'error', /*#__PURE__*/React__default["default"].createElement("span", null, locale.Uploader.retryUpload))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
30511
|
+
className: prefixCls + "-uploader-list-item-delete",
|
30512
|
+
onClick: function onClick() {
|
30513
|
+
return uploadFunc.deleteFile(index);
|
30514
|
+
}
|
30515
|
+
}, renderDeleteArea && renderDeleteArea(fileItem, index) || /*#__PURE__*/React__default["default"].createElement(IconDelete, {
|
30516
|
+
className: cls(prefixCls + "-uploader-list-item-delete-icon", (_b = {}, _b[prefixCls + "-uploader-list-item-delete-icon-disabled"] = disabled, _b))
|
30517
|
+
})));
|
30518
|
+
}));
|
30519
|
+
};
|
30520
|
+
|
30521
|
+
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
30522
|
+
var _b;
|
30523
|
+
|
30524
|
+
var prefixCls = _a.prefixCls,
|
30525
|
+
_c = _a.locale,
|
30526
|
+
locale = _c === void 0 ? defaultLocale : _c;
|
30527
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
30528
|
+
className: cls(prefixCls + "-uploader", className, (_b = {}, _b[prefixCls + "-uploader-disabled"] = disabled, _b)),
|
30529
|
+
style: style,
|
30530
|
+
ref: domRef
|
30531
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
30532
|
+
className: prefixCls + "-uploader-container"
|
30533
|
+
}, uploaderSelect(prefixCls, locale), getUploadList(prefixCls, locale)));
|
30534
|
+
});
|
30535
|
+
});
|
30536
|
+
/**
|
30537
|
+
* 文件上传组件
|
30538
|
+
* @en Uploader Component
|
30539
|
+
* @type 数据录入
|
30540
|
+
* @type_en Data Entry
|
30541
|
+
* @name 文件上传
|
30542
|
+
* @name_en Uploader
|
30543
|
+
* @displayName Uploader
|
30544
|
+
*/
|
30545
|
+
|
30546
|
+
var index = componentWrapper(Uploader, 'Uploader');
|
30179
30547
|
|
30180
|
-
exports.ActionSheet = index$
|
30181
|
-
exports.Avatar = index$
|
30548
|
+
exports.ActionSheet = index$p;
|
30549
|
+
exports.Avatar = index$o;
|
30182
30550
|
exports.Badge = Badge;
|
30183
30551
|
exports.Button = Button;
|
30184
30552
|
exports.Carousel = Carousel;
|
30185
|
-
exports.Cell = index$
|
30553
|
+
exports.Cell = index$n;
|
30186
30554
|
exports.Checkbox = Checkbox;
|
30187
30555
|
exports.CircleProgress = CircleProgress;
|
30188
|
-
exports.Collapse = index$
|
30556
|
+
exports.Collapse = index$m;
|
30189
30557
|
exports.ContextProvider = ContextProvider;
|
30190
30558
|
exports.CountDown = CountDown;
|
30191
|
-
exports.DatePicker = index$
|
30192
|
-
exports.Dialog = index$
|
30559
|
+
exports.DatePicker = index$l;
|
30560
|
+
exports.Dialog = index$k;
|
30193
30561
|
exports.Divider = Divider;
|
30194
30562
|
exports.Dropdown = Dropdown$1;
|
30195
30563
|
exports.DropdownMenu = DropdownMenu;
|
30196
30564
|
exports.Ellipsis = Ellipsis;
|
30197
|
-
exports.Form = index$
|
30565
|
+
exports.Form = index$i;
|
30198
30566
|
exports.Grid = Grid;
|
30199
30567
|
exports.Image = BaseImage;
|
30200
|
-
exports.ImagePicker = index$
|
30201
|
-
exports.ImagePreview = index$
|
30202
|
-
exports.IndexBar = index$
|
30203
|
-
exports.Input = index$
|
30568
|
+
exports.ImagePicker = index$h;
|
30569
|
+
exports.ImagePreview = index$g;
|
30570
|
+
exports.IndexBar = index$f;
|
30571
|
+
exports.Input = index$e;
|
30204
30572
|
exports.Keyboard = Keyboard;
|
30205
30573
|
exports.LoadMore = LoadMore;
|
30206
30574
|
exports.Loading = Loading;
|
30207
30575
|
exports.Masking = Masking$1;
|
30208
30576
|
exports.NavBar = NavBar;
|
30209
30577
|
exports.NoticeBar = NoticeBar;
|
30210
|
-
exports.Notify = index$
|
30578
|
+
exports.Notify = index$d;
|
30211
30579
|
exports.Pagination = Pagination;
|
30212
30580
|
exports.Picker = Picker$1;
|
30213
30581
|
exports.PickerView = PickerView$1;
|
30214
|
-
exports.Popover = index$
|
30582
|
+
exports.Popover = index$c;
|
30215
30583
|
exports.Popup = Popup$1;
|
30216
|
-
exports.PopupSwiper = index$
|
30584
|
+
exports.PopupSwiper = index$b;
|
30217
30585
|
exports.Portal = Portal;
|
30218
30586
|
exports.Progress = Progress;
|
30219
30587
|
exports.PullRefresh = PullRefresh;
|
30220
|
-
exports.Radio = index$
|
30221
|
-
exports.Rate = index$
|
30588
|
+
exports.Radio = index$a;
|
30589
|
+
exports.Rate = index$9;
|
30222
30590
|
exports.SearchBar = SearchBar;
|
30223
30591
|
exports.ShowMonitor = ShowMonitor;
|
30224
|
-
exports.Skeleton = index$
|
30225
|
-
exports.Slider = index$
|
30226
|
-
exports.Stepper = index$
|
30227
|
-
exports.Steps = index$
|
30592
|
+
exports.Skeleton = index$8;
|
30593
|
+
exports.Slider = index$7;
|
30594
|
+
exports.Stepper = index$6;
|
30595
|
+
exports.Steps = index$q;
|
30228
30596
|
exports.Sticky = Sticky;
|
30229
30597
|
exports.SwipeAction = SwipeAction;
|
30230
30598
|
exports.SwipeLoad = SwipeLoad;
|
30231
|
-
exports.Switch = index$
|
30232
|
-
exports.TabBar = index$
|
30599
|
+
exports.Switch = index$5;
|
30600
|
+
exports.TabBar = index$4;
|
30233
30601
|
exports.Tabs = Tabs;
|
30234
|
-
exports.Tag = index$
|
30235
|
-
exports.Textarea = index$
|
30236
|
-
exports.Toast = index;
|
30602
|
+
exports.Tag = index$3;
|
30603
|
+
exports.Textarea = index$2;
|
30604
|
+
exports.Toast = index$1;
|
30237
30605
|
exports.Transition = Transition;
|
30606
|
+
exports.Uploader = index;
|
30238
30607
|
|
30239
30608
|
Object.defineProperty(exports, '__esModule', { value: true });
|
30240
30609
|
|