@pointcloud/pcloud-components 0.1.4 → 0.1.5
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/README.md +297 -25
- package/dist/esm/AdvancedFilter/FormFilter.d.ts +2 -2
- package/dist/esm/AdvancedFilter/FormFilter.js +43 -45
- package/dist/esm/AdvancedFilter/index.js +66 -75
- package/dist/esm/AdvancedFilter/interface.d.ts +1 -1
- package/dist/esm/AdvancedFilter/styles/index.less +146 -116
- package/dist/esm/ConfigProvider/index.d.ts +1 -1
- package/dist/esm/ConfigProvider/index.js +5 -3
- package/dist/esm/DCascader/index.js +7 -21
- package/dist/esm/DCascader/index.less +5 -1
- package/dist/esm/DForm/DItem/index.d.ts +5 -0
- package/dist/esm/DForm/DItem/index.js +33 -0
- package/dist/esm/DForm/DItem/itemType.d.ts +106 -0
- package/dist/esm/DForm/DItem/itemType.js +1 -0
- package/dist/esm/DForm/DItem/itemsRender.d.ts +39 -0
- package/dist/esm/DForm/DItem/itemsRender.js +193 -0
- package/dist/esm/DForm/helper.js +7 -7
- package/dist/esm/DForm/index.d.ts +1 -1
- package/dist/esm/DForm/index.js +17 -17
- package/dist/esm/DForm/index.less +32 -31
- package/dist/esm/DInput/index.js +6 -11
- package/dist/esm/DSelect/index.d.ts +1 -1
- package/dist/esm/DSelect/index.js +7 -18
- package/dist/esm/DTable/index.js +58 -64
- package/dist/esm/DTable/index.less +8 -0
- package/dist/esm/DTreeSelect/index.d.ts +1 -1
- package/dist/esm/DTreeSelect/index.js +6 -20
- package/dist/esm/DTreeSelect/index.less +2 -0
- package/dist/esm/DUpload/helper.js +2 -6
- package/dist/esm/DUpload/index.js +28 -36
- package/dist/esm/DUpload/index.less +1 -0
- package/dist/esm/ErrorBoundary/index.d.ts +2 -2
- package/dist/esm/ErrorBoundary/index.js +16 -12
- package/dist/esm/ErrorBoundary/index.less +1 -0
- package/dist/esm/LModal/index.d.ts +2 -2
- package/dist/esm/LModal/index.js +11 -13
- package/dist/esm/LModal/interface.d.ts +1 -1
- package/dist/esm/LModal/styles/index.less +27 -25
- package/dist/esm/LabelValue/index.d.ts +1 -1
- package/dist/esm/LabelValue/index.js +14 -12
- package/dist/esm/LabelValue/styles/index.less +4 -0
- package/dist/esm/Loading/interface.d.ts +4 -4
- package/dist/esm/Loading/loading.d.ts +2 -2
- package/dist/esm/Loading/loading.js +18 -16
- package/dist/esm/Loading/styles/index.less +3 -1
- package/dist/esm/NoData/index.d.ts +2 -2
- package/dist/esm/NoData/index.js +14 -13
- package/dist/esm/NoData/styles/index.less +4 -1
- package/dist/umd/images/favicon.png +0 -0
- package/dist/umd/mock/dcascader/china_region_city.json +2962 -0
- package/dist/umd/mock/dcascader/china_region_county.json +9991 -0
- package/dist/umd/mock/dcascader/china_region_province.json +36 -0
- package/dist/umd/mock/dupload/other/ZJ-TZ-001_/346/212/244/345/233/275/345/272/231/346/210/217/345/217/260/345/216/206/345/217/262/345/273/272/347/255/221/346/241/243/346/241/210/350/241/250.pdf +0 -0
- package/dist/umd/mock/dupload/other//346/234/210/347/211/231/346/271/276 - /351/243/236/345/204/277/344/271/220/345/233/242.mp3 +0 -0
- package/dist/umd/mock/dupload/picture/110500-thumb.jpg +0 -0
- package/dist/umd/mock/dupload/picture/110500.jpg +0 -0
- package/dist/umd/mock/dupload/picture/110502-thumb.jpg +0 -0
- package/dist/umd/mock/dupload/picture/110502.jpg +0 -0
- package/dist/umd/mock/dupload/picture/110504.png +0 -0
- package/dist/umd/mock/dupload/picture/default.png +0 -0
- package/dist/umd/mock/dupload/picture//346/255/243/351/227/250/345/205/250/346/231/257.jpg +0 -0
- package/dist/umd/pcloud-components.min.css +1 -1
- package/dist/umd/pcloud-components.min.js +1 -1
- package/package.json +91 -73
- package/dist/esm/DForm/DItem.d.ts +0 -28
- package/dist/esm/DForm/DItem.js +0 -31
- package/dist/esm/DForm/DItemsMap.d.ts +0 -33
- package/dist/esm/DForm/DItemsMap.js +0 -148
package/dist/esm/DTable/index.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
4
|
var _excluded = ["loadMore", "columnsProp", "actionColumn", "showErrorMsg", "extraParams", "dataSource", "rowKey", "scroll", "className", "pagination", "columns", "loading"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
14
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
5
|
/*
|
|
18
6
|
* @Author : wangfeihu
|
|
19
7
|
* @Date : 2023-05-09 15:04:48
|
|
20
8
|
* @LastEditors : wangfeihu
|
|
21
|
-
* @LastEditTime : 2023-
|
|
9
|
+
* @LastEditTime : 2023-07-11 17:22:24
|
|
22
10
|
* @Description : 基于antd的Table组件
|
|
23
11
|
*/
|
|
24
12
|
import React, { forwardRef, useEffect, useRef, useState, useContext } from 'react';
|
|
25
13
|
import { message, Table } from 'antd';
|
|
26
14
|
import { ConfigContext } from "../ConfigProvider";
|
|
27
15
|
import "./index.less";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
18
|
// 分页器配置项
|
|
29
19
|
var defaultPagination = {
|
|
30
20
|
hideOnSinglePage: false,
|
|
@@ -32,11 +22,43 @@ var defaultPagination = {
|
|
|
32
22
|
showSizeChanger: true,
|
|
33
23
|
showQuickJumper: true,
|
|
34
24
|
showTotal: function showTotal(total) {
|
|
35
|
-
return /*#__PURE__*/
|
|
36
|
-
className: "d-pagination-total"
|
|
37
|
-
|
|
25
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
26
|
+
className: "d-pagination-total",
|
|
27
|
+
children: ["\u5171", /*#__PURE__*/_jsxs("span", {
|
|
28
|
+
children: [" ", total, " "]
|
|
29
|
+
}), "\u6761"]
|
|
30
|
+
});
|
|
38
31
|
}
|
|
39
32
|
};
|
|
33
|
+
|
|
34
|
+
// 操作列
|
|
35
|
+
function getActionColumnProps(props, columnsProp) {
|
|
36
|
+
var defaultProps = {
|
|
37
|
+
width: 140,
|
|
38
|
+
title: '操作',
|
|
39
|
+
dataIndex: 'action'
|
|
40
|
+
};
|
|
41
|
+
if (typeof props === 'function') {
|
|
42
|
+
return _objectSpread(_objectSpread(_objectSpread({}, columnsProp), defaultProps), {}, {
|
|
43
|
+
render: props
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
return _objectSpread(_objectSpread(_objectSpread({}, columnsProp), defaultProps), props);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 分页配置
|
|
51
|
+
function getTablePage(_pagination) {
|
|
52
|
+
var _ref = _pagination || {},
|
|
53
|
+
current = _ref.current,
|
|
54
|
+
defaultCurrent = _ref.defaultCurrent,
|
|
55
|
+
pageSize = _ref.pageSize,
|
|
56
|
+
defaultPageSize = _ref.defaultPageSize;
|
|
57
|
+
return {
|
|
58
|
+
current: current || defaultCurrent || 1,
|
|
59
|
+
size: pageSize || defaultPageSize || 10
|
|
60
|
+
};
|
|
61
|
+
}
|
|
40
62
|
function InternalTable(props, ref) {
|
|
41
63
|
var loadMore = props.loadMore,
|
|
42
64
|
columnsProp = props.columnsProp,
|
|
@@ -102,21 +124,6 @@ function InternalTable(props, ref) {
|
|
|
102
124
|
spinning: false
|
|
103
125
|
}, loading);
|
|
104
126
|
|
|
105
|
-
// 监听分页大小变化,如果外部也监听了onChange,则不会触发loadMore,但如果外部onChange返回值为undefined则正常触loadMore
|
|
106
|
-
var onChange = function onChange(page, pageSize) {
|
|
107
|
-
if (_pagination && typeof (_pagination === null || _pagination === void 0 ? void 0 : _pagination.onChange) === 'function') {
|
|
108
|
-
var data = _pagination.onChange(page, pageSize);
|
|
109
|
-
if (data === undefined) loadData(_objectSpread(_objectSpread({}, tableParams), {}, {
|
|
110
|
-
current: page,
|
|
111
|
-
size: pageSize
|
|
112
|
-
}));
|
|
113
|
-
} else {
|
|
114
|
-
loadData(_objectSpread(_objectSpread({}, tableParams), {}, {
|
|
115
|
-
current: page,
|
|
116
|
-
size: pageSize
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
127
|
// 加载数据
|
|
121
128
|
var loadData = function loadData(params) {
|
|
122
129
|
if (typeof loadMore === 'function') {
|
|
@@ -162,11 +169,27 @@ function InternalTable(props, ref) {
|
|
|
162
169
|
}
|
|
163
170
|
};
|
|
164
171
|
|
|
172
|
+
// 监听分页大小变化,如果外部也监听了onChange,则不会触发loadMore,但如果外部onChange返回值为undefined则正常触loadMore
|
|
173
|
+
var onChange = function onChange(page, pageSize) {
|
|
174
|
+
if (_pagination && typeof (_pagination === null || _pagination === void 0 ? void 0 : _pagination.onChange) === 'function') {
|
|
175
|
+
var data = _pagination.onChange(page, pageSize);
|
|
176
|
+
if (data === undefined) loadData(_objectSpread(_objectSpread({}, tableParams), {}, {
|
|
177
|
+
current: page,
|
|
178
|
+
size: pageSize
|
|
179
|
+
}));
|
|
180
|
+
} else {
|
|
181
|
+
loadData(_objectSpread(_objectSpread({}, tableParams), {}, {
|
|
182
|
+
current: page,
|
|
183
|
+
size: pageSize
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
165
188
|
// 数据初始加载
|
|
166
189
|
useEffect(function () {
|
|
167
190
|
return loadData(extraParams);
|
|
168
191
|
}, [dataSource, extraParams]);
|
|
169
|
-
return /*#__PURE__*/
|
|
192
|
+
return /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
170
193
|
ref: ref,
|
|
171
194
|
rowKey: rowKey,
|
|
172
195
|
className: _className,
|
|
@@ -184,34 +207,5 @@ function InternalTable(props, ref) {
|
|
|
184
207
|
})
|
|
185
208
|
}));
|
|
186
209
|
}
|
|
187
|
-
|
|
188
|
-
// 操作列
|
|
189
|
-
function getActionColumnProps(props, columnsProp) {
|
|
190
|
-
var defaultProps = {
|
|
191
|
-
width: 140,
|
|
192
|
-
title: '操作',
|
|
193
|
-
dataIndex: 'action'
|
|
194
|
-
};
|
|
195
|
-
if (typeof props === 'function') {
|
|
196
|
-
return _objectSpread(_objectSpread(_objectSpread({}, columnsProp), defaultProps), {}, {
|
|
197
|
-
render: props
|
|
198
|
-
});
|
|
199
|
-
} else {
|
|
200
|
-
return _objectSpread(_objectSpread(_objectSpread({}, columnsProp), defaultProps), props);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// 分页配置
|
|
205
|
-
function getTablePage(_pagination) {
|
|
206
|
-
var _ref = _pagination || {},
|
|
207
|
-
current = _ref.current,
|
|
208
|
-
defaultCurrent = _ref.defaultCurrent,
|
|
209
|
-
pageSize = _ref.pageSize,
|
|
210
|
-
defaultPageSize = _ref.defaultPageSize;
|
|
211
|
-
return {
|
|
212
|
-
current: current || defaultCurrent || 1,
|
|
213
|
-
size: pageSize || defaultPageSize || 10
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
210
|
var DTable = /*#__PURE__*/forwardRef(InternalTable);
|
|
217
211
|
export default DTable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
2
3
|
.@{prefix}-table {
|
|
3
4
|
.ant-spin-nested-loading,
|
|
4
5
|
.ant-spin-container,
|
|
@@ -23,32 +24,39 @@
|
|
|
23
24
|
max-width: 100%;
|
|
24
25
|
min-height: calc(100% - 56px);
|
|
25
26
|
max-height: calc(100% - 56px);
|
|
27
|
+
|
|
26
28
|
// 表头显示省略号,但表内单元格不省略
|
|
27
29
|
.ant-table-tbody > tr > td.ant-table-cell.ant-table-cell-ellipsis {
|
|
28
30
|
white-space: initial;
|
|
29
31
|
}
|
|
32
|
+
|
|
30
33
|
// x轨道的宽度和y轨道的高度
|
|
31
34
|
&::-webkit-scrollbar {
|
|
32
35
|
width: 4px;
|
|
33
36
|
height: 8px;
|
|
34
37
|
}
|
|
38
|
+
|
|
35
39
|
// 轨道拖动部分的背景颜色
|
|
36
40
|
&::-webkit-scrollbar-thumb {
|
|
37
41
|
background-color: #0084ff;
|
|
38
42
|
}
|
|
43
|
+
|
|
39
44
|
// 轨道背景颜色
|
|
40
45
|
&::-webkit-scrollbar-track {
|
|
41
46
|
background-color: #f1f1f1;
|
|
42
47
|
border-radius: 2px;
|
|
43
48
|
}
|
|
49
|
+
|
|
44
50
|
// x、y两条轨道的交叉处
|
|
45
51
|
&::-webkit-scrollbar-corner {
|
|
46
52
|
background-color: #f1f1f1;
|
|
47
53
|
}
|
|
48
54
|
}
|
|
55
|
+
|
|
49
56
|
.ant-spin-nested-loading > div > .ant-spin {
|
|
50
57
|
max-height: initial;
|
|
51
58
|
}
|
|
59
|
+
|
|
52
60
|
.ant-pagination-total-text span {
|
|
53
61
|
color: #40a9ff;
|
|
54
62
|
font-weight: bold;
|
|
@@ -13,7 +13,7 @@ export declare type DTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loadD
|
|
|
13
13
|
/** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
|
|
14
14
|
loading?: boolean | number;
|
|
15
15
|
};
|
|
16
|
-
declare const DTreeSelect: React.ForwardRefExoticComponent<Omit<TreeSelectProps<any, import("rc-tree-select/lib/TreeSelect").DefaultOptionType>, "loading" | "
|
|
16
|
+
declare const DTreeSelect: React.ForwardRefExoticComponent<Omit<TreeSelectProps<any, import("rc-tree-select/lib/TreeSelect").DefaultOptionType>, "loading" | "treeData" | "loadData"> & {
|
|
17
17
|
/** antd的treeData属性,可以是一个treeData数组,或一个返回等价treeData数组的promise */
|
|
18
18
|
treeData?: import("rc-tree-select/lib/TreeSelect").DefaultOptionType[] | ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>) | undefined;
|
|
19
19
|
/** antd的loadData属性,动态加载子级列表数据,默认使用treeData所提供的方法,如果传入null,则表示不进行动态加载,该方法要求返回一个treeData数组或与其等价的Promise */
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
5
|
var _excluded = ["className", "popupClassName", "treeData", "fieldNames", "loadData", "onLoadData", "loading"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
6
|
/*
|
|
22
7
|
* @Author : wangfeihu
|
|
23
8
|
* @Date : 2023-05-22 10:38:17
|
|
@@ -30,6 +15,7 @@ import React, { useRef, forwardRef, useState, useEffect, useMemo, useContext } f
|
|
|
30
15
|
import { TreeSelect } from 'antd';
|
|
31
16
|
import { ConfigContext } from "../ConfigProvider";
|
|
32
17
|
import "./index.less";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
19
|
// eslint-disable-next-line no-unused-vars
|
|
34
20
|
function deepFind(node, fn) {
|
|
35
21
|
var childrenName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
@@ -180,7 +166,7 @@ function InternalTreeSelect(props, ref) {
|
|
|
180
166
|
useEffect(function () {
|
|
181
167
|
return updateOptions(getOptionsFun);
|
|
182
168
|
}, [getOptionsFun]);
|
|
183
|
-
return /*#__PURE__*/
|
|
169
|
+
return /*#__PURE__*/_jsx(TreeSelect, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
184
170
|
ref: ref,
|
|
185
171
|
className: _className,
|
|
186
172
|
popupClassName: _popupClassName,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
2
3
|
.@{prefix}-tree-select-dropdown .ant-select-tree-node-content-wrapper {
|
|
3
4
|
overflow: hidden;
|
|
4
5
|
white-space: nowrap;
|
|
5
6
|
text-overflow: ellipsis;
|
|
6
7
|
}
|
|
8
|
+
|
|
7
9
|
.@{prefix}-tree-select-dropdown .ant-select-tree-node-content-wrapper .ant-select-tree-title {
|
|
8
10
|
overflow: hidden;
|
|
9
11
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
7
3
|
/*
|
|
8
4
|
* @Author : wangfeihu
|
|
9
5
|
* @Date : 2023-06-16 11:25:57
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
1
8
|
var _excluded = ["value", "thumbOption", "uploadButton", "itemClassName", "enablePreview", "className", "maxCount", "children", "itemRender", "customRequest", "onRemove", "onDownload", "onPreview", "onChange", "defaultFileList", "showUploadList", "fileList"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
9
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
24
9
|
/*
|
|
25
10
|
* @Author : wangfeihu
|
|
26
11
|
* @Date : 2023-06-16 09:37:07
|
|
@@ -34,15 +19,21 @@ import { Upload } from 'antd';
|
|
|
34
19
|
import helper from "./helper";
|
|
35
20
|
import { ConfigContext } from "../ConfigProvider";
|
|
36
21
|
import "./index.less";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, "
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
var defaultUploadButton = /*#__PURE__*/_jsxs("div", {
|
|
25
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
26
|
+
style: {
|
|
27
|
+
fontSize: 18
|
|
28
|
+
},
|
|
29
|
+
children: "+"
|
|
30
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
31
|
+
style: {
|
|
32
|
+
marginTop: 8
|
|
33
|
+
},
|
|
34
|
+
children: "\u4E0A\u4F20"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
46
37
|
function downloadFn(file) {
|
|
47
38
|
if (file instanceof Blob) {
|
|
48
39
|
helper.downloadFile(file);
|
|
@@ -233,7 +224,7 @@ function InternalUpload(props, ref) {
|
|
|
233
224
|
}
|
|
234
225
|
}, _callee, null, [[12, 19], [28, 35]]);
|
|
235
226
|
}));
|
|
236
|
-
return function customRequestFun(
|
|
227
|
+
return function customRequestFun(_x) {
|
|
237
228
|
return _ref.apply(this, arguments);
|
|
238
229
|
};
|
|
239
230
|
}();
|
|
@@ -368,12 +359,13 @@ function InternalUpload(props, ref) {
|
|
|
368
359
|
listRef.current.list = list;
|
|
369
360
|
setFileList(list);
|
|
370
361
|
}, [_fileList, value, defaultFileList]);
|
|
371
|
-
return /*#__PURE__*/
|
|
362
|
+
return /*#__PURE__*/_jsx(Upload, _objectSpread(_objectSpread({
|
|
372
363
|
listType: "picture-card"
|
|
373
|
-
}, _props, {
|
|
364
|
+
}, _props), {}, {
|
|
374
365
|
fileList: _finalFileList,
|
|
375
|
-
ref: ref
|
|
376
|
-
|
|
366
|
+
ref: ref,
|
|
367
|
+
children: _finalFileList.length >= maxCount ? null : _uploadButton
|
|
368
|
+
}));
|
|
377
369
|
}
|
|
378
370
|
var DUpload = /*#__PURE__*/forwardRef(InternalUpload);
|
|
379
371
|
DUpload.imageToBase64 = helper.imageToBase64;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
2
|
import * as React from 'react';
|
|
6
3
|
import classNames from 'classnames';
|
|
7
4
|
import "./index.less";
|
|
8
5
|
import { ConfigContext } from "../ConfigProvider";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
function ErrorBoundary(_ref) {
|
|
10
9
|
var err = _ref.err;
|
|
11
10
|
var _React$useContext = React.useContext(ConfigContext),
|
|
@@ -16,13 +15,18 @@ function ErrorBoundary(_ref) {
|
|
|
16
15
|
function refreshPage() {
|
|
17
16
|
window.location.reload();
|
|
18
17
|
}
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
-
className: wrapperClass
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
19
|
+
className: wrapperClass,
|
|
20
|
+
children: [/*#__PURE__*/_jsx("h2", {
|
|
21
|
+
children: "\u62B1\u6B49,\u7CFB\u7EDF\u51FA\u73B0\u95EE\u9898."
|
|
22
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
23
|
+
className: "error-text",
|
|
24
|
+
children: err && JSON.stringify(err)
|
|
25
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
26
|
+
className: "error-refresh",
|
|
27
|
+
onClick: refreshPage,
|
|
28
|
+
children: "\u91CD\u65B0\u5237\u65B0\u6D4F\u89C8\u5668"
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
export default ErrorBoundary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { LModalProps } from './interface';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
declare function LModal(props: LModalProps):
|
|
4
|
+
declare function LModal(props: LModalProps): JSX.Element;
|
|
5
5
|
export default LModal;
|
package/dist/esm/LModal/index.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
3
|
var _excluded = ["children", "mode"];
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
4
|
import { ConfigContext } from "../ConfigProvider";
|
|
11
5
|
import { Modal } from 'antd';
|
|
12
6
|
import React, { useContext, useEffect, useMemo, useRef } from 'react';
|
|
13
7
|
import "./styles/index.less";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
9
|
function LModal(props) {
|
|
15
10
|
var children = props.children,
|
|
16
11
|
_props$mode = props.mode,
|
|
@@ -28,7 +23,7 @@ function LModal(props) {
|
|
|
28
23
|
}, otherProps);
|
|
29
24
|
}, [otherProps]);
|
|
30
25
|
useEffect(function () {
|
|
31
|
-
if (otherProps.
|
|
26
|
+
if (otherProps.open) {
|
|
32
27
|
document.body.style.overflow = 'hidden';
|
|
33
28
|
} else {
|
|
34
29
|
document.body.style.overflow = '';
|
|
@@ -36,7 +31,7 @@ function LModal(props) {
|
|
|
36
31
|
return function () {
|
|
37
32
|
document.body.style.overflow = '';
|
|
38
33
|
};
|
|
39
|
-
}, [otherProps.
|
|
34
|
+
}, [otherProps.open]);
|
|
40
35
|
useEffect(function () {
|
|
41
36
|
if (containerRef.current) {
|
|
42
37
|
if (mode === 'absolute') {
|
|
@@ -46,9 +41,12 @@ function LModal(props) {
|
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
43
|
}, [mode, containerRef.current]);
|
|
49
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_jsx("div", {
|
|
50
45
|
ref: containerRef,
|
|
51
|
-
className: "".concat(getPrefixCls('modal-container'), " ").concat(getPrefixCls(mode === 'absolute' ? 'absolute-modal-container' : 'relative-modal-container'))
|
|
52
|
-
|
|
46
|
+
className: "".concat(getPrefixCls('modal-container'), " ").concat(getPrefixCls(mode === 'absolute' || mode === 'panel' ? 'absolute-modal-container' : 'relative-modal-container')),
|
|
47
|
+
children: /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, style), {}, {
|
|
48
|
+
children: children
|
|
49
|
+
}))
|
|
50
|
+
});
|
|
53
51
|
}
|
|
54
52
|
export default LModal;
|
|
@@ -3,6 +3,6 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
declare type IModalProps = Omit<ModalProps, 'width' | 'className'>;
|
|
4
4
|
export interface LModalProps extends IModalProps {
|
|
5
5
|
children?: ReactNode | undefined;
|
|
6
|
-
mode?: 'absolute' | 'relative';
|
|
6
|
+
mode?: 'absolute' | 'relative' | 'panel';
|
|
7
7
|
}
|
|
8
8
|
export {};
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
@import '../../commonStyle/index.less';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
@import '../../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-modal-container {
|
|
4
|
+
.ant-modal-wrap {
|
|
5
|
+
.ant-modal {
|
|
6
|
+
max-width: unset;
|
|
7
|
+
height: 100%;
|
|
8
|
+
|
|
9
|
+
.ant-modal-content {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.@{prefix}-absolute-modal-container {
|
|
18
|
+
.ant-modal-wrap {
|
|
19
|
+
position: fixed;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.@{prefix}-relative-modal-container {
|
|
24
|
+
.ant-modal-wrap {
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
}
|